diff options
author | Eric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com> | 2007-10-17 15:31:07 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com> | 2007-10-17 15:31:07 -0400 |
commit | 50fd8010673b770f6489c9ee96680c204aefa84a (patch) | |
tree | 734686c1c5be427d72665f2ea63537886717f157 /fs/9p/vfs_file.c | |
parent | ba17674fe02909fef049fd4b620a2805bdb8c693 (diff) |
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: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r-- | fs/9p/vfs_file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 716691689fd5..ba4b1caa9c43 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -162,15 +162,17 @@ v9fs_file_write(struct file *filp, const char __user * data, | |||
162 | 162 | ||
163 | fid = filp->private_data; | 163 | fid = filp->private_data; |
164 | ret = p9_client_uwrite(fid, data, *offset, count); | 164 | ret = p9_client_uwrite(fid, data, *offset, count); |
165 | if (ret > 0) | 165 | if (ret > 0) { |
166 | invalidate_inode_pages2_range(inode->i_mapping, *offset, | ||
167 | *offset+ret); | ||
166 | *offset += ret; | 168 | *offset += ret; |
169 | } | ||
167 | 170 | ||
168 | if (*offset > inode->i_size) { | 171 | if (*offset > inode->i_size) { |
169 | inode->i_size = *offset; | 172 | inode->i_size = *offset; |
170 | inode->i_blocks = (inode->i_size + 512 - 1) >> 9; | 173 | inode->i_blocks = (inode->i_size + 512 - 1) >> 9; |
171 | } | 174 | } |
172 | 175 | ||
173 | invalidate_inode_pages2(inode->i_mapping); | ||
174 | return ret; | 176 | return ret; |
175 | } | 177 | } |
176 | 178 | ||