Commit 50fd8010 authored by Eric Van Hensbergen's avatar Eric Van Hensbergen

9p: soften invalidation in loose_mode

Loose mode in 9p utilizes the page cache without respecting coherency with
the server.  Any writes previously invaldiated the entire mapping for a file.
This patch softens the behavior to only invalidate the region of the actual
write.
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent ba17674f
...@@ -162,15 +162,17 @@ v9fs_file_write(struct file *filp, const char __user * data, ...@@ -162,15 +162,17 @@ v9fs_file_write(struct file *filp, const char __user * data,
fid = filp->private_data; fid = filp->private_data;
ret = p9_client_uwrite(fid, data, *offset, count); ret = p9_client_uwrite(fid, data, *offset, count);
if (ret > 0) if (ret > 0) {
invalidate_inode_pages2_range(inode->i_mapping, *offset,
*offset+ret);
*offset += ret; *offset += ret;
}
if (*offset > inode->i_size) { if (*offset > inode->i_size) {
inode->i_size = *offset; inode->i_size = *offset;
inode->i_blocks = (inode->i_size + 512 - 1) >> 9; inode->i_blocks = (inode->i_size + 512 - 1) >> 9;
} }
invalidate_inode_pages2(inode->i_mapping);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment