diff options
author | Sripathi Kodi <sripathik@in.ibm.com> | 2010-03-25 08:47:26 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-05-21 17:44:34 -0400 |
commit | 4681dbdacb5cdc4d3273c3a97a1858d6e00a5fe7 (patch) | |
tree | e29be0d9f98caa7ee176cf0a1a3c3a22fca4934d /net/9p/client.c | |
parent | bda8e7752063cdbdd1d308bc1705400a8cec1aeb (diff) |
9p: add 9P2000.L rename operation
I made a V2 of this patch on top of my patches for VFS switches.
All the changes were due to change in some offsets.
rename - change name of file or directory
size[4] Trename tag[2] fid[4] newdirfid[4] name[s]
size[4] Rrename tag[2]
The rename message is used to change the name of a file, possibly moving it
to a new directory. The 9P wstat message can only rename a file within the
same directory.
Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/client.c')
-rw-r--r-- | net/9p/client.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 430a1c4a7c6..37c8da07a80 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1404,3 +1404,31 @@ error: | |||
1404 | return err; | 1404 | return err; |
1405 | } | 1405 | } |
1406 | EXPORT_SYMBOL(p9_client_statfs); | 1406 | EXPORT_SYMBOL(p9_client_statfs); |
1407 | |||
1408 | int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name) | ||
1409 | { | ||
1410 | int err; | ||
1411 | struct p9_req_t *req; | ||
1412 | struct p9_client *clnt; | ||
1413 | |||
1414 | err = 0; | ||
1415 | clnt = fid->clnt; | ||
1416 | |||
1417 | P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAME fid %d newdirfid %d name %s\n", | ||
1418 | fid->fid, newdirfid->fid, name); | ||
1419 | |||
1420 | req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid, | ||
1421 | newdirfid->fid, name); | ||
1422 | if (IS_ERR(req)) { | ||
1423 | err = PTR_ERR(req); | ||
1424 | goto error; | ||
1425 | } | ||
1426 | |||
1427 | P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAME fid %d\n", fid->fid); | ||
1428 | |||
1429 | p9_free_req(clnt, req); | ||
1430 | error: | ||
1431 | return err; | ||
1432 | } | ||
1433 | EXPORT_SYMBOL(p9_client_rename); | ||
1434 | |||