aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/client.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2010-05-31 03:52:45 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2010-08-02 15:28:33 -0400
commit0ef63f345c48afe5896c5cffcba57f0457d409b9 (patch)
treeb02ca26b3d74d998a6e609a9abd9a753d0ab8075 /net/9p/client.c
parentef56547efa3c88609069e2a91f46e25c31dd536e (diff)
net/9p: Implement attrwalk 9p call
TXATTRWALK: Descend a ATTR namespace size[4] TXATTRWALK tag[2] fid[4] newfid[4] name[s] size[4] RXATTRWALK tag[2] size[8] txattrwalk gets a fid pointing to xattr. This fid can later be used to read the xattr value. If name is NULL the fid returned can be used to get the list of extended attribute associated to the file system object. Signed-off-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/client.c')
-rw-r--r--net/9p/client.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index c458e042d384..ec80ee71d453 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1622,6 +1622,56 @@ error:
1622} 1622}
1623EXPORT_SYMBOL(p9_client_rename); 1623EXPORT_SYMBOL(p9_client_rename);
1624 1624
1625/*
1626 * An xattrwalk without @attr_name gives the fid for the lisxattr namespace
1627 */
1628struct p9_fid *p9_client_xattrwalk(struct p9_fid *file_fid,
1629 const char *attr_name, u64 *attr_size)
1630{
1631 int err;
1632 struct p9_req_t *req;
1633 struct p9_client *clnt;
1634 struct p9_fid *attr_fid;
1635
1636 err = 0;
1637 clnt = file_fid->clnt;
1638 attr_fid = p9_fid_create(clnt);
1639 if (IS_ERR(attr_fid)) {
1640 err = PTR_ERR(attr_fid);
1641 attr_fid = NULL;
1642 goto error;
1643 }
1644 P9_DPRINTK(P9_DEBUG_9P,
1645 ">>> TXATTRWALK file_fid %d, attr_fid %d name %s\n",
1646 file_fid->fid, attr_fid->fid, attr_name);
1647
1648 req = p9_client_rpc(clnt, P9_TXATTRWALK, "dds",
1649 file_fid->fid, attr_fid->fid, attr_name);
1650 if (IS_ERR(req)) {
1651 err = PTR_ERR(req);
1652 goto error;
1653 }
1654 err = p9pdu_readf(req->rc, clnt->proto_version, "q", attr_size);
1655 if (err) {
1656 p9pdu_dump(1, req->rc);
1657 p9_free_req(clnt, req);
1658 goto clunk_fid;
1659 }
1660 p9_free_req(clnt, req);
1661 P9_DPRINTK(P9_DEBUG_9P, "<<< RXATTRWALK fid %d size %llu\n",
1662 attr_fid->fid, *attr_size);
1663 return attr_fid;
1664clunk_fid:
1665 p9_client_clunk(attr_fid);
1666 attr_fid = NULL;
1667error:
1668 if (attr_fid && (attr_fid != file_fid))
1669 p9_fid_destroy(attr_fid);
1670
1671 return ERR_PTR(err);
1672}
1673EXPORT_SYMBOL_GPL(p9_client_xattrwalk);
1674
1625int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset) 1675int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
1626{ 1676{
1627 int err, rsize, total; 1677 int err, rsize, total;