summaryrefslogtreecommitdiffstats
path: root/fs/9p/fid.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-02-28 17:03:57 +0530
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 09:57:37 -0500
commit3cf387d780944305839f5b27c51f225444ba4d27 (patch)
treeed4ef1d723ed3c7c280aadfcf397218004e49252 /fs/9p/fid.c
parent17311779ac3dcd06f8ef727a06969c439e116a20 (diff)
downloadlinux-3cf387d780944305839f5b27c51f225444ba4d27.tar.gz
linux-3cf387d780944305839f5b27c51f225444ba4d27.tar.bz2
linux-3cf387d780944305839f5b27c51f225444ba4d27.zip
fs/9p: Add fid to inode in cached mode
The fid attached to inode will be opened O_RDWR mode and is used for dirty page writeback only. 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/fid.c')
-rw-r--r--fs/9p/fid.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index b00223c99d70..9d6a5d3bfe15 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -261,3 +261,29 @@ struct p9_fid *v9fs_fid_clone(struct dentry *dentry)
ret = p9_client_walk(fid, 0, NULL, 1);
return ret;
}
+
+
+struct p9_fid *v9fs_writeback_fid(struct dentry *dentry)
+{
+ int err;
+ struct p9_fid *fid;
+
+ fid = v9fs_fid_clone(dentry);
+ if (IS_ERR(fid))
+ goto error_out;
+ /*
+ * writeback fid will only be used to write back the
+ * dirty pages. We always request for the open fid in read-write
+ * mode so that a partial page write which result in page
+ * read can work.
+ * FIXME!!: we should make the fid owned by uid = 0
+ */
+ err = p9_client_open(fid, O_RDWR);
+ if (err < 0) {
+ p9_client_clunk(fid);
+ fid = ERR_PTR(err);
+ goto error_out;
+ }
+error_out:
+ return fid;
+}