mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 - [email protected]]
Signed-off-by: M. Mohan Kumar <[email protected]>
Signed-off-by: Venkateswararao Jujjuri <[email protected]>
Signed-off-by: Eric Van Hensbegren <[email protected]>
This commit is contained in:
parent
5643135a28
commit
ef56547efa
3 changed files with 21 additions and 11 deletions
|
|
@ -59,9 +59,13 @@ int v9fs_file_open(struct inode *inode, struct file *file)
|
|||
struct p9_fid *fid;
|
||||
int omode;
|
||||
|
||||
P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file);
|
||||
P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file);
|
||||
v9ses = v9fs_inode2v9ses(inode);
|
||||
omode = v9fs_uflags2omode(file->f_flags, v9fs_proto_dotu(v9ses));
|
||||
if (v9fs_proto_dotl(v9ses))
|
||||
omode = file->f_flags;
|
||||
else
|
||||
omode = v9fs_uflags2omode(file->f_flags,
|
||||
v9fs_proto_dotu(v9ses));
|
||||
fid = file->private_data;
|
||||
if (!fid) {
|
||||
fid = v9fs_fid_clone(file->f_path.dentry);
|
||||
|
|
@ -73,11 +77,12 @@ int v9fs_file_open(struct inode *inode, struct file *file)
|
|||
p9_client_clunk(fid);
|
||||
return err;
|
||||
}
|
||||
if (omode & P9_OTRUNC) {
|
||||
if (file->f_flags & O_TRUNC) {
|
||||
i_size_write(inode, 0);
|
||||
inode->i_blocks = 0;
|
||||
}
|
||||
if ((file->f_flags & O_APPEND) && (!v9fs_proto_dotu(v9ses)))
|
||||
if ((file->f_flags & O_APPEND) &&
|
||||
(!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)))
|
||||
generic_file_llseek(file, 0, SEEK_END);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue