aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/protocol.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-01-29 19:18:50 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-02-12 06:19:31 -0500
commit447c50943fd008755122c7a62bac068e73c1cf2c (patch)
tree426cd65ce6dc68aebd9185602560c7c30eb48272 /net/9p/protocol.c
parentf791f7c5e354870eaa5e31c4038c6723683283f1 (diff)
9p: Modify the stat structures to use kuid_t and kgid_t
9p has thre strucrtures that can encode inode stat information. Modify all of those structures to contain kuid_t and kgid_t values. Modify he wire encoders and decoders of those structures to use 'u' and 'g' instead of 'd' in the format string where uids and gids are present. This results in all kuid and kgid conversion to and from on the wire values being performed by the same code in protocol.c where the client is known at the time of the conversion. Cc: Eric Van Hensbergen <ericvh@gmail.com> Cc: Ron Minnich <rminnich@gmail.com> Cc: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net/9p/protocol.c')
-rw-r--r--net/9p/protocol.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index c289c6cee98e..ab9127ec5b7a 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -199,11 +199,12 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
199 va_arg(ap, struct p9_wstat *); 199 va_arg(ap, struct p9_wstat *);
200 200
201 memset(stbuf, 0, sizeof(struct p9_wstat)); 201 memset(stbuf, 0, sizeof(struct p9_wstat));
202 stbuf->n_uid = stbuf->n_gid = stbuf->n_muid = 202 stbuf->n_uid = stbuf->n_muid = INVALID_UID;
203 -1; 203 stbuf->n_gid = INVALID_GID;
204
204 errcode = 205 errcode =
205 p9pdu_readf(pdu, proto_version, 206 p9pdu_readf(pdu, proto_version,
206 "wwdQdddqssss?sddd", 207 "wwdQdddqssss?sugu",
207 &stbuf->size, &stbuf->type, 208 &stbuf->size, &stbuf->type,
208 &stbuf->dev, &stbuf->qid, 209 &stbuf->dev, &stbuf->qid,
209 &stbuf->mode, &stbuf->atime, 210 &stbuf->mode, &stbuf->atime,
@@ -316,7 +317,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
316 memset(stbuf, 0, sizeof(struct p9_stat_dotl)); 317 memset(stbuf, 0, sizeof(struct p9_stat_dotl));
317 errcode = 318 errcode =
318 p9pdu_readf(pdu, proto_version, 319 p9pdu_readf(pdu, proto_version,
319 "qQdddqqqqqqqqqqqqqqq", 320 "qQdugqqqqqqqqqqqqqqq",
320 &stbuf->st_result_mask, 321 &stbuf->st_result_mask,
321 &stbuf->qid, 322 &stbuf->qid,
322 &stbuf->st_mode, 323 &stbuf->st_mode,
@@ -426,7 +427,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
426 va_arg(ap, const struct p9_wstat *); 427 va_arg(ap, const struct p9_wstat *);
427 errcode = 428 errcode =
428 p9pdu_writef(pdu, proto_version, 429 p9pdu_writef(pdu, proto_version,
429 "wwdQdddqssss?sddd", 430 "wwdQdddqssss?sugu",
430 stbuf->size, stbuf->type, 431 stbuf->size, stbuf->type,
431 stbuf->dev, &stbuf->qid, 432 stbuf->dev, &stbuf->qid,
432 stbuf->mode, stbuf->atime, 433 stbuf->mode, stbuf->atime,
@@ -504,7 +505,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
504 struct p9_iattr_dotl *); 505 struct p9_iattr_dotl *);
505 506
506 errcode = p9pdu_writef(pdu, proto_version, 507 errcode = p9pdu_writef(pdu, proto_version,
507 "ddddqqqqq", 508 "ddugqqqqq",
508 p9attr->valid, 509 p9attr->valid,
509 p9attr->mode, 510 p9attr->mode,
510 p9attr->uid, 511 p9attr->uid,