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>
This commit is contained in:

committed by
Eric Van Hensbergen

parent
652df9a7fd
commit
50cc42ff3d
@@ -1095,6 +1095,40 @@ error:
|
||||
}
|
||||
EXPORT_SYMBOL(p9_client_fcreate);
|
||||
|
||||
int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
|
||||
struct p9_qid *qid)
|
||||
{
|
||||
int err = 0;
|
||||
struct p9_client *clnt;
|
||||
struct p9_req_t *req;
|
||||
|
||||
P9_DPRINTK(P9_DEBUG_9P, ">>> TSYMLINK dfid %d name %s symtgt %s\n",
|
||||
dfid->fid, name, symtgt);
|
||||
clnt = dfid->clnt;
|
||||
|
||||
req = p9_client_rpc(clnt, P9_TSYMLINK, "dssd", dfid->fid, name, symtgt,
|
||||
gid);
|
||||
if (IS_ERR(req)) {
|
||||
err = PTR_ERR(req);
|
||||
goto error;
|
||||
}
|
||||
|
||||
err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid);
|
||||
if (err) {
|
||||
p9pdu_dump(1, req->rc);
|
||||
goto free_and_error;
|
||||
}
|
||||
|
||||
P9_DPRINTK(P9_DEBUG_9P, "<<< RSYMLINK qid %x.%llx.%x\n",
|
||||
qid->type, (unsigned long long)qid->path, qid->version);
|
||||
|
||||
free_and_error:
|
||||
p9_free_req(clnt, req);
|
||||
error:
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(p9_client_symlink);
|
||||
|
||||
int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname)
|
||||
{
|
||||
struct p9_client *clnt;
|
||||
|
Reference in New Issue
Block a user