mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
fuse: don't bump attr_version in cached write
The attribute version in fuse_inode should be updated whenever the attributes might have changed on the server. In case of cached writes this is not the case, so updating the attr_version is unnecessary and could possibly affect performance. Open code the remaining part of fuse_write_update_size(). Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
fa5eee57e3
commit
8c56e03d2e
1 changed files with 5 additions and 2 deletions
|
@ -2309,15 +2309,18 @@ static int fuse_write_end(struct file *file, struct address_space *mapping,
|
|||
if (!copied)
|
||||
goto unlock;
|
||||
|
||||
pos += copied;
|
||||
if (!PageUptodate(page)) {
|
||||
/* Zero any unwritten bytes at the end of the page */
|
||||
size_t endoff = (pos + copied) & ~PAGE_MASK;
|
||||
size_t endoff = pos & ~PAGE_MASK;
|
||||
if (endoff)
|
||||
zero_user_segment(page, endoff, PAGE_SIZE);
|
||||
SetPageUptodate(page);
|
||||
}
|
||||
|
||||
fuse_write_update_size(inode, pos + copied);
|
||||
if (pos > inode->i_size)
|
||||
i_size_write(inode, pos);
|
||||
|
||||
set_page_dirty(page);
|
||||
|
||||
unlock:
|
||||
|
|
Loading…
Reference in a new issue