diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2010-06-09 18:59:31 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-08-02 15:28:29 -0400 |
commit | 50cc42ff3d7bc48a436c5a0413459ca7841b505f (patch) | |
tree | 7209ab2807e3a284c1fbd36dd885e34b81809b0d /net/9p | |
parent | 652df9a7fd03cb47a3f663f0c08a2bd086505e9b (diff) |
9p: Define and implement TSYMLINK for 9P2000.L
Create a symbolic link
SYNOPSIS
size[4] Tsymlink tag[2] fid[4] name[s] symtgt[s] gid[4]
size[4] Rsymlink tag[2] qid[13]
DESCRIPTION
Create a symbolic link named 'name' pointing to 'symtgt'.
gid represents the effective group id of the caller.
The permissions of a symbolic link are irrelevant hence it is omitted
from the protocol.
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Reviewed-by: Sripathi Kodi <sripathik@in.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index ad1c4489ab4d..e37e64cb9394 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1095,6 +1095,40 @@ error: | |||
1095 | } | 1095 | } |
1096 | EXPORT_SYMBOL(p9_client_fcreate); | 1096 | EXPORT_SYMBOL(p9_client_fcreate); |
1097 | 1097 | ||
1098 | int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid, | ||
1099 | struct p9_qid *qid) | ||
1100 | { | ||
1101 | int err = 0; | ||
1102 | struct p9_client *clnt; | ||
1103 | struct p9_req_t *req; | ||
1104 | |||
1105 | P9_DPRINTK(P9_DEBUG_9P, ">>> TSYMLINK dfid %d name %s symtgt %s\n", | ||
1106 | dfid->fid, name, symtgt); | ||
1107 | clnt = dfid->clnt; | ||
1108 | |||
1109 | req = p9_client_rpc(clnt, P9_TSYMLINK, "dssd", dfid->fid, name, symtgt, | ||
1110 | gid); | ||
1111 | if (IS_ERR(req)) { | ||
1112 | err = PTR_ERR(req); | ||
1113 | goto error; | ||
1114 | } | ||
1115 | |||
1116 | err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid); | ||
1117 | if (err) { | ||
1118 | p9pdu_dump(1, req->rc); | ||
1119 | goto free_and_error; | ||
1120 | } | ||
1121 | |||
1122 | P9_DPRINTK(P9_DEBUG_9P, "<<< RSYMLINK qid %x.%llx.%x\n", | ||
1123 | qid->type, (unsigned long long)qid->path, qid->version); | ||
1124 | |||
1125 | free_and_error: | ||
1126 | p9_free_req(clnt, req); | ||
1127 | error: | ||
1128 | return err; | ||
1129 | } | ||
1130 | EXPORT_SYMBOL(p9_client_symlink); | ||
1131 | |||
1098 | int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname) | 1132 | int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname) |
1099 | { | 1133 | { |
1100 | struct p9_client *clnt; | 1134 | struct p9_client *clnt; |