diff options
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 30 | ||||
-rw-r--r-- | net/9p/protocol.c | 17 |
2 files changed, 47 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 5e97118da3bf..b2f70ec889c2 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1426,6 +1426,36 @@ error: | |||
1426 | } | 1426 | } |
1427 | EXPORT_SYMBOL(p9_client_wstat); | 1427 | EXPORT_SYMBOL(p9_client_wstat); |
1428 | 1428 | ||
1429 | int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *p9attr) | ||
1430 | { | ||
1431 | int err; | ||
1432 | struct p9_req_t *req; | ||
1433 | struct p9_client *clnt; | ||
1434 | |||
1435 | err = 0; | ||
1436 | clnt = fid->clnt; | ||
1437 | P9_DPRINTK(P9_DEBUG_9P, ">>> TSETATTR fid %d\n", fid->fid); | ||
1438 | P9_DPRINTK(P9_DEBUG_9P, | ||
1439 | " valid=%x mode=%x uid=%d gid=%d size=%lld\n" | ||
1440 | " atime_sec=%lld atime_nsec=%lld\n" | ||
1441 | " mtime_sec=%lld mtime_nsec=%lld\n", | ||
1442 | p9attr->valid, p9attr->mode, p9attr->uid, p9attr->gid, | ||
1443 | p9attr->size, p9attr->atime_sec, p9attr->atime_nsec, | ||
1444 | p9attr->mtime_sec, p9attr->mtime_nsec); | ||
1445 | |||
1446 | req = p9_client_rpc(clnt, P9_TSETATTR, "dI", fid->fid, p9attr); | ||
1447 | |||
1448 | if (IS_ERR(req)) { | ||
1449 | err = PTR_ERR(req); | ||
1450 | goto error; | ||
1451 | } | ||
1452 | P9_DPRINTK(P9_DEBUG_9P, "<<< RSETATTR fid %d\n", fid->fid); | ||
1453 | p9_free_req(clnt, req); | ||
1454 | error: | ||
1455 | return err; | ||
1456 | } | ||
1457 | EXPORT_SYMBOL(p9_client_setattr); | ||
1458 | |||
1429 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb) | 1459 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb) |
1430 | { | 1460 | { |
1431 | int err; | 1461 | int err; |
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 3e4f77695891..3acd3afb20c8 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
@@ -516,6 +516,23 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
516 | } | 516 | } |
517 | } | 517 | } |
518 | break; | 518 | break; |
519 | case 'I':{ | ||
520 | struct p9_iattr_dotl *p9attr = va_arg(ap, | ||
521 | struct p9_iattr_dotl *); | ||
522 | |||
523 | errcode = p9pdu_writef(pdu, proto_version, | ||
524 | "ddddqqqqq", | ||
525 | p9attr->valid, | ||
526 | p9attr->mode, | ||
527 | p9attr->uid, | ||
528 | p9attr->gid, | ||
529 | p9attr->size, | ||
530 | p9attr->atime_sec, | ||
531 | p9attr->atime_nsec, | ||
532 | p9attr->mtime_sec, | ||
533 | p9attr->mtime_nsec); | ||
534 | } | ||
535 | break; | ||
519 | case '?': | 536 | case '?': |
520 | if ((proto_version != p9_proto_2000u) && | 537 | if ((proto_version != p9_proto_2000u) && |
521 | (proto_version != p9_proto_2000L)) | 538 | (proto_version != p9_proto_2000L)) |