diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 10:41:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 10:41:13 -0400 |
commit | 4fd5ec509bd486b5dd8cac1a4d4d7e2cbdf7c546 (patch) | |
tree | a8ddfdcc4bfb702457e8eeff57fd6b5a2f4249b2 /net/9p | |
parent | 6e188240ebc2a132d70924942d7c8b9acb46e11a (diff) | |
parent | 6d27e64d74e14c1cf2b4af438d7e8a77017bd654 (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: Optimize TCREATE by eliminating a redundant fid clone.
9p: cleanup: remove unneeded assignment
9p: Add mksock support
fs/9p: Make sure we properly instantiate dentry.
9p: add 9P2000.L rename operation
9p: add 9P2000.L statfs operation
9p: VFS switches for 9p2000.L: VFS switches
9p: VFS switches for 9p2000.L: protocol and client changes
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 70 | ||||
-rw-r--r-- | net/9p/protocol.c | 6 |
2 files changed, 73 insertions, 3 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 0aa79faa9850..37c8da07a80b 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1321,7 +1321,8 @@ static int p9_client_statsize(struct p9_wstat *wst, int proto_version) | |||
1321 | if (wst->muid) | 1321 | if (wst->muid) |
1322 | ret += strlen(wst->muid); | 1322 | ret += strlen(wst->muid); |
1323 | 1323 | ||
1324 | if (proto_version == p9_proto_2000u) { | 1324 | if ((proto_version == p9_proto_2000u) || |
1325 | (proto_version == p9_proto_2000L)) { | ||
1325 | ret += 2+4+4+4; /* extension[s] n_uid[4] n_gid[4] n_muid[4] */ | 1326 | ret += 2+4+4+4; /* extension[s] n_uid[4] n_gid[4] n_muid[4] */ |
1326 | if (wst->extension) | 1327 | if (wst->extension) |
1327 | ret += strlen(wst->extension); | 1328 | ret += strlen(wst->extension); |
@@ -1364,3 +1365,70 @@ error: | |||
1364 | return err; | 1365 | return err; |
1365 | } | 1366 | } |
1366 | EXPORT_SYMBOL(p9_client_wstat); | 1367 | EXPORT_SYMBOL(p9_client_wstat); |
1368 | |||
1369 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb) | ||
1370 | { | ||
1371 | int err; | ||
1372 | struct p9_req_t *req; | ||
1373 | struct p9_client *clnt; | ||
1374 | |||
1375 | err = 0; | ||
1376 | clnt = fid->clnt; | ||
1377 | |||
1378 | P9_DPRINTK(P9_DEBUG_9P, ">>> TSTATFS fid %d\n", fid->fid); | ||
1379 | |||
1380 | req = p9_client_rpc(clnt, P9_TSTATFS, "d", fid->fid); | ||
1381 | if (IS_ERR(req)) { | ||
1382 | err = PTR_ERR(req); | ||
1383 | goto error; | ||
1384 | } | ||
1385 | |||
1386 | err = p9pdu_readf(req->rc, clnt->proto_version, "ddqqqqqqd", &sb->type, | ||
1387 | &sb->bsize, &sb->blocks, &sb->bfree, &sb->bavail, | ||
1388 | &sb->files, &sb->ffree, &sb->fsid, &sb->namelen); | ||
1389 | if (err) { | ||
1390 | p9pdu_dump(1, req->rc); | ||
1391 | p9_free_req(clnt, req); | ||
1392 | goto error; | ||
1393 | } | ||
1394 | |||
1395 | P9_DPRINTK(P9_DEBUG_9P, "<<< RSTATFS fid %d type 0x%lx bsize %ld " | ||
1396 | "blocks %llu bfree %llu bavail %llu files %llu ffree %llu " | ||
1397 | "fsid %llu namelen %ld\n", | ||
1398 | fid->fid, (long unsigned int)sb->type, (long int)sb->bsize, | ||
1399 | sb->blocks, sb->bfree, sb->bavail, sb->files, sb->ffree, | ||
1400 | sb->fsid, (long int)sb->namelen); | ||
1401 | |||
1402 | p9_free_req(clnt, req); | ||
1403 | error: | ||
1404 | return err; | ||
1405 | } | ||
1406 | EXPORT_SYMBOL(p9_client_statfs); | ||
1407 | |||
1408 | int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name) | ||
1409 | { | ||
1410 | int err; | ||
1411 | struct p9_req_t *req; | ||
1412 | struct p9_client *clnt; | ||
1413 | |||
1414 | err = 0; | ||
1415 | clnt = fid->clnt; | ||
1416 | |||
1417 | P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAME fid %d newdirfid %d name %s\n", | ||
1418 | fid->fid, newdirfid->fid, name); | ||
1419 | |||
1420 | req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid, | ||
1421 | newdirfid->fid, name); | ||
1422 | if (IS_ERR(req)) { | ||
1423 | err = PTR_ERR(req); | ||
1424 | goto error; | ||
1425 | } | ||
1426 | |||
1427 | P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAME fid %d\n", fid->fid); | ||
1428 | |||
1429 | p9_free_req(clnt, req); | ||
1430 | error: | ||
1431 | return err; | ||
1432 | } | ||
1433 | EXPORT_SYMBOL(p9_client_rename); | ||
1434 | |||
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index e7541d5b0118..77d3aab4036b 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
@@ -341,7 +341,8 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
341 | } | 341 | } |
342 | break; | 342 | break; |
343 | case '?': | 343 | case '?': |
344 | if (proto_version != p9_proto_2000u) | 344 | if ((proto_version != p9_proto_2000u) && |
345 | (proto_version != p9_proto_2000L)) | ||
345 | return 0; | 346 | return 0; |
346 | break; | 347 | break; |
347 | default: | 348 | default: |
@@ -488,7 +489,8 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
488 | } | 489 | } |
489 | break; | 490 | break; |
490 | case '?': | 491 | case '?': |
491 | if (proto_version != p9_proto_2000u) | 492 | if ((proto_version != p9_proto_2000u) && |
493 | (proto_version != p9_proto_2000L)) | ||
492 | return 0; | 494 | return 0; |
493 | break; | 495 | break; |
494 | default: | 496 | default: |