diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2010-06-17 21:27:46 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-08-02 15:28:32 -0400 |
commit | 5643135a28464e7c19d8d23a9e0804697a62c84b (patch) | |
tree | d7141110fab0f3d71a95fe18b0b77cbaca645c80 /net/9p | |
parent | 01a622bd7409bb7af38e784cff814e5e723f7951 (diff) |
fs/9p: This patch implements TLCREATE for 9p2000.L protocol.
SYNOPSIS
size[4] Tlcreate tag[2] fid[4] name[s] flags[4] mode[4] gid[4]
size[4] Rlcreate tag[2] qid[13] iounit[4]
DESCRIPTION
The Tlreate request asks the file server to create a new regular file with the
name supplied, in the directory (dir) represented by fid.
The mode argument specifies the permissions to use. New file is created with
the uid if the fid and with supplied gid.
The flags argument represent Linux access mode flags with which the caller
is requesting to open the file with. Protocol allows all the Linux access
modes but it is upto the server to allow/disallow any of these acess modes.
If the server doesn't support any of the access mode, it is expected to
return error.
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index a3bdd341f2ac..e580409b1052 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1050,6 +1050,50 @@ error: | |||
1050 | } | 1050 | } |
1051 | EXPORT_SYMBOL(p9_client_open); | 1051 | EXPORT_SYMBOL(p9_client_open); |
1052 | 1052 | ||
1053 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | ||
1054 | gid_t gid, struct p9_qid *qid) | ||
1055 | { | ||
1056 | int err = 0; | ||
1057 | struct p9_client *clnt; | ||
1058 | struct p9_req_t *req; | ||
1059 | int iounit; | ||
1060 | |||
1061 | P9_DPRINTK(P9_DEBUG_9P, | ||
1062 | ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n", | ||
1063 | ofid->fid, name, flags, mode, gid); | ||
1064 | clnt = ofid->clnt; | ||
1065 | |||
1066 | if (ofid->mode != -1) | ||
1067 | return -EINVAL; | ||
1068 | |||
1069 | req = p9_client_rpc(clnt, P9_TLCREATE, "dsddd", ofid->fid, name, flags, | ||
1070 | mode, gid); | ||
1071 | if (IS_ERR(req)) { | ||
1072 | err = PTR_ERR(req); | ||
1073 | goto error; | ||
1074 | } | ||
1075 | |||
1076 | err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", qid, &iounit); | ||
1077 | if (err) { | ||
1078 | p9pdu_dump(1, req->rc); | ||
1079 | goto free_and_error; | ||
1080 | } | ||
1081 | |||
1082 | P9_DPRINTK(P9_DEBUG_9P, "<<< RLCREATE qid %x.%llx.%x iounit %x\n", | ||
1083 | qid->type, | ||
1084 | (unsigned long long)qid->path, | ||
1085 | qid->version, iounit); | ||
1086 | |||
1087 | ofid->mode = mode; | ||
1088 | ofid->iounit = iounit; | ||
1089 | |||
1090 | free_and_error: | ||
1091 | p9_free_req(clnt, req); | ||
1092 | error: | ||
1093 | return err; | ||
1094 | } | ||
1095 | EXPORT_SYMBOL(p9_client_create_dotl); | ||
1096 | |||
1053 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, | 1097 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, |
1054 | char *extension) | 1098 | char *extension) |
1055 | { | 1099 | { |