diff options
author | M. Mohan Kumar <mohan@in.ibm.com> | 2010-06-16 04:57:01 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-08-02 15:28:30 -0400 |
commit | 4b43516ab19b748b48322937fd9307af17541c4d (patch) | |
tree | 0ab84e8d69abce9d63e1937b1a807d2243444a01 /net/9p | |
parent | 50cc42ff3d7bc48a436c5a0413459ca7841b505f (diff) |
9p: Implement TMKNOD
Synopsis
size[4] Tmknod tag[2] fid[4] name[s] mode[4] major[4] minor[4] gid[4]
size[4] Rmknod tag[2] qid[13]
Description
mknod asks the file server to create a device node with given major and
minor number, mode and gid. The qid for the new device node is returned
with the mknod reply message.
[sripathik@in.ibm.com: Fix error handling code]
Signed-off-by: M. Mohan Kumar <mohan@in.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 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index e37e64cb9394..cdfbd6740796 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1622,3 +1622,34 @@ error: | |||
1622 | return err; | 1622 | return err; |
1623 | } | 1623 | } |
1624 | EXPORT_SYMBOL(p9_client_readdir); | 1624 | EXPORT_SYMBOL(p9_client_readdir); |
1625 | |||
1626 | int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode, | ||
1627 | dev_t rdev, gid_t gid, struct p9_qid *qid) | ||
1628 | { | ||
1629 | int err; | ||
1630 | struct p9_client *clnt; | ||
1631 | struct p9_req_t *req; | ||
1632 | |||
1633 | err = 0; | ||
1634 | clnt = fid->clnt; | ||
1635 | P9_DPRINTK(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d " | ||
1636 | "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev)); | ||
1637 | req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddd", fid->fid, name, mode, | ||
1638 | MAJOR(rdev), MINOR(rdev), gid); | ||
1639 | if (IS_ERR(req)) | ||
1640 | return PTR_ERR(req); | ||
1641 | |||
1642 | err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid); | ||
1643 | if (err) { | ||
1644 | p9pdu_dump(1, req->rc); | ||
1645 | goto error; | ||
1646 | } | ||
1647 | P9_DPRINTK(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type, | ||
1648 | (unsigned long long)qid->path, qid->version); | ||
1649 | |||
1650 | error: | ||
1651 | p9_free_req(clnt, req); | ||
1652 | return err; | ||
1653 | |||
1654 | } | ||
1655 | EXPORT_SYMBOL(p9_client_mknod_dotl); | ||