Skip to content

Commit

Permalink
o Don't add a message if not necessary to the pass through filter.
Browse files Browse the repository at this point in the history
  That way, we can see the progress bar even on them.
  (the 'format' column now tells us that this is pass-through)
  • Loading branch information
hzeller committed Sep 23, 2012
1 parent 1971a4a commit 79e7608
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions folve-filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class PassThroughHandler : public FileHandler {
const HandlerStats &known_stats)
: FileHandler(filter_id), filedes_(filedes),
file_size_(-1), max_accessed_(0), info_stats_(known_stats) {
info_stats_.message.append("; pass through.");
DLogf("Creating PassThrough filter for '%s'", known_stats.filename.c_str());
struct stat st;
file_size_ = (Stat(&st) == 0) ? st.st_size : -1;
Expand All @@ -67,8 +66,8 @@ class PassThroughHandler : public FileHandler {
~PassThroughHandler() { close(filedes_); }

virtual int Read(char *buf, size_t size, off_t offset) {
max_accessed_ = std::max(max_accessed_, (long unsigned int) offset + size);
const int result = pread(filedes_, buf, size, offset);
max_accessed_ = std::max(max_accessed_, (long unsigned int) offset + result);
return result == -1 ? -errno : result;
}
virtual int Stat(struct stat *st) {
Expand Down Expand Up @@ -597,10 +596,7 @@ FileHandler *FolveFilesystem::CreateFromDescriptor(
config_dirs()[cfg_idx],
&file_info);
if (filter != NULL) return filter;
} else {
file_info.message = "No filter config selected.";
}

// Every other file-type is just passed through as is.
return new PassThroughHandler(filedes, cfg_idx, file_info);
}
Expand Down

0 comments on commit 79e7608

Please sign in to comment.