aboutsummaryrefslogtreecommitdiff
path: root/net/9p/conv.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 15:05:58 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 15:05:58 -0700
commit9d8190f87b5458160ba75d05e8ad6abefbe48a26 (patch)
tree7abeb91aa2a40b91004f53520b7bf1f2c80aab7e /net/9p/conv.c
parentc2f73fd07d2ce4605b404f34395eb734a7ba9967 (diff)
parent982c37cfb6e61c0e64634abc2e305d757c1405b2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: 9p: remove sysctl 9p: fix bad kconfig cross-dependency 9p: soften invalidation in loose_mode 9p: attach-per-user 9p: rename uid and gid parameters 9p: define session flags 9p: Make transports dynamic
Diffstat (limited to 'net/9p/conv.c')
-rw-r--r--net/9p/conv.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/net/9p/conv.c b/net/9p/conv.c
index d979d958ea1..aa2aa9884f9 100644
--- a/net/9p/conv.c
+++ b/net/9p/conv.c
@@ -547,7 +547,8 @@ error:
}
EXPORT_SYMBOL(p9_create_tversion);
-struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname)
+struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname,
+ u32 n_uname, int dotu)
{
int size;
struct p9_fcall *fc;
@@ -555,7 +556,16 @@ struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname)
struct cbuf *bufp = &buffer;
/* afid[4] uname[s] aname[s] */
- size = 4 + 2 + strlen(uname) + 2 + strlen(aname);
+ size = 4 + 2 + 2;
+ if (uname)
+ size += strlen(uname);
+
+ if (aname)
+ size += strlen(aname);
+
+ if (dotu)
+ size += 4; /* n_uname */
+
fc = p9_create_common(bufp, size, P9_TAUTH);
if (IS_ERR(fc))
goto error;
@@ -563,6 +573,8 @@ struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname)
p9_put_int32(bufp, afid, &fc->params.tauth.afid);
p9_put_str(bufp, uname, &fc->params.tauth.uname);
p9_put_str(bufp, aname, &fc->params.tauth.aname);
+ if (dotu)
+ p9_put_int32(bufp, n_uname, &fc->params.tauth.n_uname);
if (buf_check_overflow(bufp)) {
kfree(fc);
@@ -574,7 +586,8 @@ error:
EXPORT_SYMBOL(p9_create_tauth);
struct p9_fcall *
-p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname)
+p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname,
+ u32 n_uname, int dotu)
{
int size;
struct p9_fcall *fc;
@@ -582,7 +595,16 @@ p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname)
struct cbuf *bufp = &buffer;
/* fid[4] afid[4] uname[s] aname[s] */
- size = 4 + 4 + 2 + strlen(uname) + 2 + strlen(aname);
+ size = 4 + 4 + 2 + 2;
+ if (uname)
+ size += strlen(uname);
+
+ if (aname)
+ size += strlen(aname);
+
+ if (dotu)
+ size += 4; /* n_uname */
+
fc = p9_create_common(bufp, size, P9_TATTACH);
if (IS_ERR(fc))
goto error;
@@ -591,6 +613,8 @@ p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname)
p9_put_int32(bufp, afid, &fc->params.tattach.afid);
p9_put_str(bufp, uname, &fc->params.tattach.uname);
p9_put_str(bufp, aname, &fc->params.tattach.aname);
+ if (dotu)
+ p9_put_int32(bufp, n_uname, &fc->params.tattach.n_uname);
error:
return fc;