Loading fs/fuse/file.c +6 −15 Original line number Diff line number Diff line Loading @@ -798,21 +798,12 @@ static void fuse_short_read(struct inode *inode, u64 attr_ver, size_t num_read, { struct fuse_conn *fc = get_fuse_conn(inode); if (fc->writeback_cache) { /* * A hole in a file. Some data after the hole are in page cache, * but have not reached the client fs yet. So, the hole is not * present there. * If writeback_cache is enabled, a short read means there's a hole in * the file. Some data after the hole is in page cache, but has not * reached the client fs yet. So the hole is not present there. */ int i; int start_idx = num_read >> PAGE_SHIFT; size_t off = num_read & (PAGE_SIZE - 1); for (i = start_idx; i < ap->num_pages; i++) { zero_user_segment(ap->pages[i], off, PAGE_SIZE); off = 0; } } else { if (!fc->writeback_cache) { loff_t pos = page_offset(ap->pages[0]) + num_read; fuse_read_update_size(inode, pos, attr_ver); } Loading Loading
fs/fuse/file.c +6 −15 Original line number Diff line number Diff line Loading @@ -798,21 +798,12 @@ static void fuse_short_read(struct inode *inode, u64 attr_ver, size_t num_read, { struct fuse_conn *fc = get_fuse_conn(inode); if (fc->writeback_cache) { /* * A hole in a file. Some data after the hole are in page cache, * but have not reached the client fs yet. So, the hole is not * present there. * If writeback_cache is enabled, a short read means there's a hole in * the file. Some data after the hole is in page cache, but has not * reached the client fs yet. So the hole is not present there. */ int i; int start_idx = num_read >> PAGE_SHIFT; size_t off = num_read & (PAGE_SIZE - 1); for (i = start_idx; i < ap->num_pages; i++) { zero_user_segment(ap->pages[i], off, PAGE_SIZE); off = 0; } } else { if (!fc->writeback_cache) { loff_t pos = page_offset(ap->pages[0]) + num_read; fuse_read_update_size(inode, pos, attr_ver); } Loading