diff options
author | M. Mohan Kumar <mohan@in.ibm.com> | 2010-06-22 10:17:50 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-08-02 15:28:32 -0400 |
commit | ef56547efa3c88609069e2a91f46e25c31dd536e (patch) | |
tree | 802bb98048ae36e59fc0bcaa21bd54e5ebf9de99 /fs/9p | |
parent | 5643135a28464e7c19d8d23a9e0804697a62c84b (diff) |
9p: Implement LOPEN
Implement 9p2000.L version of open(LOPEN) interface in 9p client.
For LOPEN, no need to convert the flags to and from 9p mode to VFS mode.
Synopsis:
size[4] Tlopen tag[2] fid[4] mode[4]
size[4] Rlopen tag[2] qid[13] iounit[4]
[Fix mode bit format - jvrao@linux.vnet.ibm.com]
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbegren <ericvh@gmail.com>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/vfs_file.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 2d686ec322a0..e97c92bd6f16 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -59,9 +59,13 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
59 | struct p9_fid *fid; | 59 | struct p9_fid *fid; |
60 | int omode; | 60 | int omode; |
61 | 61 | ||
62 | P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file); | 62 | P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file); |
63 | v9ses = v9fs_inode2v9ses(inode); | 63 | v9ses = v9fs_inode2v9ses(inode); |
64 | omode = v9fs_uflags2omode(file->f_flags, v9fs_proto_dotu(v9ses)); | 64 | if (v9fs_proto_dotl(v9ses)) |
65 | omode = file->f_flags; | ||
66 | else | ||
67 | omode = v9fs_uflags2omode(file->f_flags, | ||
68 | v9fs_proto_dotu(v9ses)); | ||
65 | fid = file->private_data; | 69 | fid = file->private_data; |
66 | if (!fid) { | 70 | if (!fid) { |
67 | fid = v9fs_fid_clone(file->f_path.dentry); | 71 | fid = v9fs_fid_clone(file->f_path.dentry); |
@@ -73,11 +77,12 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
73 | p9_client_clunk(fid); | 77 | p9_client_clunk(fid); |
74 | return err; | 78 | return err; |
75 | } | 79 | } |
76 | if (omode & P9_OTRUNC) { | 80 | if (file->f_flags & O_TRUNC) { |
77 | i_size_write(inode, 0); | 81 | i_size_write(inode, 0); |
78 | inode->i_blocks = 0; | 82 | inode->i_blocks = 0; |
79 | } | 83 | } |
80 | if ((file->f_flags & O_APPEND) && (!v9fs_proto_dotu(v9ses))) | 84 | if ((file->f_flags & O_APPEND) && |
85 | (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses))) | ||
81 | generic_file_llseek(file, 0, SEEK_END); | 86 | generic_file_llseek(file, 0, SEEK_END); |
82 | } | 87 | } |
83 | 88 | ||