diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-03-08 06:09:49 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-22 16:43:36 -0400 |
commit | 7add697a3d271aa7080513f92dab190c75174b7e (patch) | |
tree | 435508f4ab7222c367ea72ca208027218b5f7613 /fs/9p/vfs_file.c | |
parent | ea59bb759b8fd240860c37026ab1b998d26ac285 (diff) |
fs/9p: Attach writeback_fid on first open with WR flag
We don't need writeback fid if we are only doing O_RDONLY open
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3337d58d0fc5..6997eb62fbba 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -91,7 +91,8 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
91 | 91 | ||
92 | file->private_data = fid; | 92 | file->private_data = fid; |
93 | mutex_lock(&v9inode->v_mutex); | 93 | mutex_lock(&v9inode->v_mutex); |
94 | if (v9ses->cache && !v9inode->writeback_fid) { | 94 | if (v9ses->cache && !v9inode->writeback_fid && |
95 | ((file->f_flags & O_ACCMODE) != O_RDONLY)) { | ||
95 | /* | 96 | /* |
96 | * clone a fid and add it to writeback_fid | 97 | * clone a fid and add it to writeback_fid |
97 | * we do it during open time instead of | 98 | * we do it during open time instead of |