9p: Define and implement TLINK for 9P2000.L

This patch adds a helper function to get the dentry from inode and
uses it in creating a Hardlink

SYNOPSIS

size[4] Tlink tag[2] dfid[4] oldfid[4] newpath[s]

size[4] Rlink tag[2]

DESCRIPTION

Create a link 'newpath' in directory pointed by dfid linking to oldfid path.

[sripathik@in.ibm.com : p9_client_link should not free req structure
if p9_client_rpc has returned an error.]

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
This commit is contained in:
Venkateswararao Jujjuri (JV)
2010-06-03 15:16:59 -07:00
committed by Eric Van Hensbergen
parent 09d34ee5f9
commit 652df9a7fd
3 changed files with 22 additions and 0 deletions

View File

@@ -1095,6 +1095,25 @@ error:
}
EXPORT_SYMBOL(p9_client_fcreate);
int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname)
{
struct p9_client *clnt;
struct p9_req_t *req;
P9_DPRINTK(P9_DEBUG_9P, ">>> TLINK dfid %d oldfid %d newname %s\n",
dfid->fid, oldfid->fid, newname);
clnt = dfid->clnt;
req = p9_client_rpc(clnt, P9_TLINK, "dds", dfid->fid, oldfid->fid,
newname);
if (IS_ERR(req))
return PTR_ERR(req);
P9_DPRINTK(P9_DEBUG_9P, "<<< RLINK\n");
p9_free_req(clnt, req);
return 0;
}
EXPORT_SYMBOL(p9_client_link);
int p9_client_clunk(struct p9_fid *fid)
{
int err;