diff options
author | M. Mohan Kumar <mohan@in.ibm.com> | 2010-09-28 16:29:25 +0200 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-10-28 16:08:48 +0200 |
commit | 329176cc2c50e63c580ddaabb385876db5af1360 (patch) | |
tree | c7a95364c6339f75d37e1b63890d94114cd1935e /net/9p | |
parent | 9p: Use V9FS_MAGIC in statfs (diff) | |
download | linux-329176cc2c50e63c580ddaabb385876db5af1360.tar.xz linux-329176cc2c50e63c580ddaabb385876db5af1360.zip |
9p: Implement TREADLINK operation for 9p2000.L
Synopsis
size[4] TReadlink tag[2] fid[4]
size[4] RReadlink tag[2] target[s]
Description
Readlink is used to return the contents of the symoblic link
referred by fid. Contents of symboic link is returned as a
response.
target[s] - Contents of the symbolic link referred by fid.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
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 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index fc1b0579016a..2bc99e9031e7 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1870,3 +1870,29 @@ error: return err; } EXPORT_SYMBOL(p9_client_getlock_dotl); + +int p9_client_readlink(struct p9_fid *fid, char **target) +{ + int err; + struct p9_client *clnt; + struct p9_req_t *req; + + err = 0; + clnt = fid->clnt; + P9_DPRINTK(P9_DEBUG_9P, ">>> TREADLINK fid %d\n", fid->fid); + + req = p9_client_rpc(clnt, P9_TREADLINK, "d", fid->fid); + if (IS_ERR(req)) + return PTR_ERR(req); + + err = p9pdu_readf(req->rc, clnt->proto_version, "s", target); + if (err) { + p9pdu_dump(1, req->rc); + goto error; + } + P9_DPRINTK(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target); +error: + p9_free_req(clnt, req); + return err; +} +EXPORT_SYMBOL(p9_client_readlink); |