diff mbox

[V9fs-developer,2/3] net/9p: Implement TXATTRCREATE 9p call

Message ID 1274426949-17713-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Aneesh Kumar K.V May 21, 2010, 7:29 a.m. UTC
None
diff mbox

Patch

diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index f45104b..76bb989 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -135,6 +135,8 @@  enum p9_msg_t {
 	P9_RRENAME,
 	P9_TXATTRWALK = 30,
 	P9_RXATTRWALK,
+	P9_TXATTRCREATE = 32,
+	P9_RXATTRCREATE,
 	P9_TVERSION = 100,
 	P9_RVERSION,
 	P9_TAUTH = 102,
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 1eb365d..0973251 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -220,6 +220,8 @@  int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
 struct p9_wstat *p9_client_stat(struct p9_fid *fid);
 int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
 extern struct p9_fid *p9_client_xattrwalk(struct p9_fid *, const char *, u64 *);
+extern int p9_client_xattrcreate(struct p9_fid *, const char *, u64, int);
+
 struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
 void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
 
diff --git a/net/9p/client.c b/net/9p/client.c
index 6217739..d8dd660 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1481,3 +1481,28 @@  error:
 	return ERR_PTR(err);
 }
 EXPORT_SYMBOL_GPL(p9_client_xattrwalk);
+
+int p9_client_xattrcreate(struct p9_fid *fid, const char *name,
+			u64 attr_size, int flags)
+{
+	int err;
+	struct p9_req_t *req;
+	struct p9_client *clnt;
+
+	P9_DPRINTK(P9_DEBUG_9P,
+		">>> TXATTRCREATE fid %d name  %s size %lld flag %d\n",
+		fid->fid, name, (long long)attr_size, flags);
+	err = 0;
+	clnt = fid->clnt;
+	req = p9_client_rpc(clnt, P9_TXATTRCREATE, "dsqd",
+			fid->fid, name, attr_size, flags);
+	if (IS_ERR(req)) {
+		err = PTR_ERR(req);
+		goto error;
+	}
+	P9_DPRINTK(P9_DEBUG_9P, "<<< RXATTRCREATE fid %d\n", fid->fid);
+	p9_free_req(clnt, req);
+error:
+	return err;
+}
+EXPORT_SYMBOL_GPL(p9_client_xattrcreate);