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 /net | |
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 'net')
-rw-r--r-- | net/9p/client.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index e580409b1052..c458e042d384 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1016,14 +1016,18 @@ int p9_client_open(struct p9_fid *fid, int mode) | |||
1016 | struct p9_qid qid; | 1016 | struct p9_qid qid; |
1017 | int iounit; | 1017 | int iounit; |
1018 | 1018 | ||
1019 | P9_DPRINTK(P9_DEBUG_9P, ">>> TOPEN fid %d mode %d\n", fid->fid, mode); | ||
1020 | err = 0; | ||
1021 | clnt = fid->clnt; | 1019 | clnt = fid->clnt; |
1020 | P9_DPRINTK(P9_DEBUG_9P, ">>> %s fid %d mode %d\n", | ||
1021 | p9_is_proto_dotl(clnt) ? "TLOPEN" : "TOPEN", fid->fid, mode); | ||
1022 | err = 0; | ||
1022 | 1023 | ||
1023 | if (fid->mode != -1) | 1024 | if (fid->mode != -1) |
1024 | return -EINVAL; | 1025 | return -EINVAL; |
1025 | 1026 | ||
1026 | req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode); | 1027 | if (p9_is_proto_dotl(clnt)) |
1028 | req = p9_client_rpc(clnt, P9_TLOPEN, "dd", fid->fid, mode); | ||
1029 | else | ||
1030 | req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode); | ||
1027 | if (IS_ERR(req)) { | 1031 | if (IS_ERR(req)) { |
1028 | err = PTR_ERR(req); | 1032 | err = PTR_ERR(req); |
1029 | goto error; | 1033 | goto error; |
@@ -1035,10 +1039,9 @@ int p9_client_open(struct p9_fid *fid, int mode) | |||
1035 | goto free_and_error; | 1039 | goto free_and_error; |
1036 | } | 1040 | } |
1037 | 1041 | ||
1038 | P9_DPRINTK(P9_DEBUG_9P, "<<< ROPEN qid %x.%llx.%x iounit %x\n", | 1042 | P9_DPRINTK(P9_DEBUG_9P, "<<< %s qid %x.%llx.%x iounit %x\n", |
1039 | qid.type, | 1043 | p9_is_proto_dotl(clnt) ? "RLOPEN" : "ROPEN", qid.type, |
1040 | (unsigned long long)qid.path, | 1044 | (unsigned long long)qid.path, qid.version, iounit); |
1041 | qid.version, iounit); | ||
1042 | 1045 | ||
1043 | fid->mode = mode; | 1046 | fid->mode = mode; |
1044 | fid->iounit = iounit; | 1047 | fid->iounit = iounit; |