Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50fd8010673b770f6489c9ee96680c204aefa84a
Commit:     50fd8010673b770f6489c9ee96680c204aefa84a
Parent:     ba17674fe02909fef049fd4b620a2805bdb8c693
Author:     Eric Van Hensbergen <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 17 14:31:07 2007 -0500
Committer:  Eric Van Hensbergen <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 14:31:07 2007 -0500

    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 <[EMAIL PROTECTED]>
---
 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 7166916..ba4b1ca 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,
 
        fid = filp->private_data;
        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;
+       }
 
        if (*offset > inode->i_size) {
                inode->i_size = *offset;
                inode->i_blocks = (inode->i_size + 512 - 1) >> 9;
        }
 
-       invalidate_inode_pages2(inode->i_mapping);
        return ret;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to