diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-23 13:58:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-23 13:58:49 -0400 |
commit | 9d1c02135516866cbbb2f80e20cfb65c63a3ce40 (patch) | |
tree | 83fa4c9100435ae530d3959f6aebde3ccc8c7481 /include | |
parent | 807094c0b1c41344def32b249d9faf7b5ebeb1e7 (diff) | |
parent | c9ffb05ca5b5098d6ea468c909dd384d90da7d54 (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:
net/9p: Fix the msize calculation.
fs/9p: add 9P2000.L unlinkat operation
fs/9p: add 9P2000.L renameat operation
fs/9p: Always ask new inode in create
fs/9p: Clean-up get_protocol_version() to use strcmp
fs/9p: Fix invalid mount options/args
fs/9p: When doing inode lookup compare qid details and inode mode bits.
fs/9p: Fid is not valid after a failed clunk.
net/9p: Remove structure not used in the code
VirtIO can transfer VIRTQUEUE_NUM of pages.
Fix the size of receive buffer packing onto VirtIO ring.
9p: clean up packet dump code
fs/9p: remove rename work around in 9p
net/9p: fix client code to fail more gracefully on protocol error
Diffstat (limited to 'include')
-rw-r--r-- | include/net/9p/9p.h | 193 | ||||
-rw-r--r-- | include/net/9p/client.h | 12 | ||||
-rw-r--r-- | include/net/9p/transport.h | 2 |
3 files changed, 24 insertions, 183 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 008711e8e78f..342dcf13d039 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -40,6 +40,7 @@ | |||
40 | * @P9_DEBUG_FID: fid allocation/deallocation tracking | 40 | * @P9_DEBUG_FID: fid allocation/deallocation tracking |
41 | * @P9_DEBUG_PKT: packet marshalling/unmarshalling | 41 | * @P9_DEBUG_PKT: packet marshalling/unmarshalling |
42 | * @P9_DEBUG_FSC: FS-cache tracing | 42 | * @P9_DEBUG_FSC: FS-cache tracing |
43 | * @P9_DEBUG_VPKT: Verbose packet debugging (full packet dump) | ||
43 | * | 44 | * |
44 | * These flags are passed at mount time to turn on various levels of | 45 | * These flags are passed at mount time to turn on various levels of |
45 | * verbosity and tracing which will be output to the system logs. | 46 | * verbosity and tracing which will be output to the system logs. |
@@ -57,6 +58,7 @@ enum p9_debug_flags { | |||
57 | P9_DEBUG_FID = (1<<9), | 58 | P9_DEBUG_FID = (1<<9), |
58 | P9_DEBUG_PKT = (1<<10), | 59 | P9_DEBUG_PKT = (1<<10), |
59 | P9_DEBUG_FSC = (1<<11), | 60 | P9_DEBUG_FSC = (1<<11), |
61 | P9_DEBUG_VPKT = (1<<12), | ||
60 | }; | 62 | }; |
61 | 63 | ||
62 | #ifdef CONFIG_NET_9P_DEBUG | 64 | #ifdef CONFIG_NET_9P_DEBUG |
@@ -74,10 +76,14 @@ do { \ | |||
74 | } \ | 76 | } \ |
75 | } while (0) | 77 | } while (0) |
76 | 78 | ||
79 | #define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu) | ||
80 | |||
77 | #else | 81 | #else |
78 | #define P9_DPRINTK(level, format, arg...) do { } while (0) | 82 | #define P9_DPRINTK(level, format, arg...) do { } while (0) |
83 | #define P9_DUMP_PKT(way, pdu) do { } while (0) | ||
79 | #endif | 84 | #endif |
80 | 85 | ||
86 | |||
81 | #define P9_EPRINTK(level, format, arg...) \ | 87 | #define P9_EPRINTK(level, format, arg...) \ |
82 | do { \ | 88 | do { \ |
83 | printk(level "9p: %s (%d): " \ | 89 | printk(level "9p: %s (%d): " \ |
@@ -175,6 +181,10 @@ enum p9_msg_t { | |||
175 | P9_RLINK, | 181 | P9_RLINK, |
176 | P9_TMKDIR = 72, | 182 | P9_TMKDIR = 72, |
177 | P9_RMKDIR, | 183 | P9_RMKDIR, |
184 | P9_TRENAMEAT = 74, | ||
185 | P9_RRENAMEAT, | ||
186 | P9_TUNLINKAT = 76, | ||
187 | P9_RUNLINKAT, | ||
178 | P9_TVERSION = 100, | 188 | P9_TVERSION = 100, |
179 | P9_RVERSION, | 189 | P9_RVERSION, |
180 | P9_TAUTH = 102, | 190 | P9_TAUTH = 102, |
@@ -321,21 +331,6 @@ enum p9_qid_t { | |||
321 | #define P9_READDIRHDRSZ 24 | 331 | #define P9_READDIRHDRSZ 24 |
322 | 332 | ||
323 | /** | 333 | /** |
324 | * struct p9_str - length prefixed string type | ||
325 | * @len: length of the string | ||
326 | * @str: the string | ||
327 | * | ||
328 | * The protocol uses length prefixed strings for all | ||
329 | * string data, so we replicate that for our internal | ||
330 | * string members. | ||
331 | */ | ||
332 | |||
333 | struct p9_str { | ||
334 | u16 len; | ||
335 | char *str; | ||
336 | }; | ||
337 | |||
338 | /** | ||
339 | * struct p9_qid - file system entity information | 334 | * struct p9_qid - file system entity information |
340 | * @type: 8-bit type &p9_qid_t | 335 | * @type: 8-bit type &p9_qid_t |
341 | * @version: 16-bit monotonically incrementing version number | 336 | * @version: 16-bit monotonically incrementing version number |
@@ -371,11 +366,11 @@ struct p9_qid { | |||
371 | * @atime: Last access/read time | 366 | * @atime: Last access/read time |
372 | * @mtime: Last modify/write time | 367 | * @mtime: Last modify/write time |
373 | * @length: file length | 368 | * @length: file length |
374 | * @name: last element of path (aka filename) in type &p9_str | 369 | * @name: last element of path (aka filename) |
375 | * @uid: owner name in type &p9_str | 370 | * @uid: owner name |
376 | * @gid: group owner in type &p9_str | 371 | * @gid: group owner |
377 | * @muid: last modifier in type &p9_str | 372 | * @muid: last modifier |
378 | * @extension: area used to encode extended UNIX support in type &p9_str | 373 | * @extension: area used to encode extended UNIX support |
379 | * @n_uid: numeric user id of owner (part of 9p2000.u extension) | 374 | * @n_uid: numeric user id of owner (part of 9p2000.u extension) |
380 | * @n_gid: numeric group id (part of 9p2000.u extension) | 375 | * @n_gid: numeric group id (part of 9p2000.u extension) |
381 | * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension) | 376 | * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension) |
@@ -512,11 +507,6 @@ struct p9_getlock { | |||
512 | char *client_id; | 507 | char *client_id; |
513 | }; | 508 | }; |
514 | 509 | ||
515 | /* Structures for Protocol Operations */ | ||
516 | struct p9_tstatfs { | ||
517 | u32 fid; | ||
518 | }; | ||
519 | |||
520 | struct p9_rstatfs { | 510 | struct p9_rstatfs { |
521 | u32 type; | 511 | u32 type; |
522 | u32 bsize; | 512 | u32 bsize; |
@@ -529,159 +519,6 @@ struct p9_rstatfs { | |||
529 | u32 namelen; | 519 | u32 namelen; |
530 | }; | 520 | }; |
531 | 521 | ||
532 | struct p9_trename { | ||
533 | u32 fid; | ||
534 | u32 newdirfid; | ||
535 | struct p9_str name; | ||
536 | }; | ||
537 | |||
538 | struct p9_rrename { | ||
539 | }; | ||
540 | |||
541 | struct p9_tversion { | ||
542 | u32 msize; | ||
543 | struct p9_str version; | ||
544 | }; | ||
545 | |||
546 | struct p9_rversion { | ||
547 | u32 msize; | ||
548 | struct p9_str version; | ||
549 | }; | ||
550 | |||
551 | struct p9_tauth { | ||
552 | u32 afid; | ||
553 | struct p9_str uname; | ||
554 | struct p9_str aname; | ||
555 | u32 n_uname; /* 9P2000.u extensions */ | ||
556 | }; | ||
557 | |||
558 | struct p9_rauth { | ||
559 | struct p9_qid qid; | ||
560 | }; | ||
561 | |||
562 | struct p9_rerror { | ||
563 | struct p9_str error; | ||
564 | u32 errno; /* 9p2000.u extension */ | ||
565 | }; | ||
566 | |||
567 | struct p9_tflush { | ||
568 | u16 oldtag; | ||
569 | }; | ||
570 | |||
571 | struct p9_rflush { | ||
572 | }; | ||
573 | |||
574 | struct p9_tattach { | ||
575 | u32 fid; | ||
576 | u32 afid; | ||
577 | struct p9_str uname; | ||
578 | struct p9_str aname; | ||
579 | u32 n_uname; /* 9P2000.u extensions */ | ||
580 | }; | ||
581 | |||
582 | struct p9_rattach { | ||
583 | struct p9_qid qid; | ||
584 | }; | ||
585 | |||
586 | struct p9_twalk { | ||
587 | u32 fid; | ||
588 | u32 newfid; | ||
589 | u16 nwname; | ||
590 | struct p9_str wnames[16]; | ||
591 | }; | ||
592 | |||
593 | struct p9_rwalk { | ||
594 | u16 nwqid; | ||
595 | struct p9_qid wqids[16]; | ||
596 | }; | ||
597 | |||
598 | struct p9_topen { | ||
599 | u32 fid; | ||
600 | u8 mode; | ||
601 | }; | ||
602 | |||
603 | struct p9_ropen { | ||
604 | struct p9_qid qid; | ||
605 | u32 iounit; | ||
606 | }; | ||
607 | |||
608 | struct p9_tcreate { | ||
609 | u32 fid; | ||
610 | struct p9_str name; | ||
611 | u32 perm; | ||
612 | u8 mode; | ||
613 | struct p9_str extension; | ||
614 | }; | ||
615 | |||
616 | struct p9_rcreate { | ||
617 | struct p9_qid qid; | ||
618 | u32 iounit; | ||
619 | }; | ||
620 | |||
621 | struct p9_tread { | ||
622 | u32 fid; | ||
623 | u64 offset; | ||
624 | u32 count; | ||
625 | }; | ||
626 | |||
627 | struct p9_rread { | ||
628 | u32 count; | ||
629 | u8 *data; | ||
630 | }; | ||
631 | |||
632 | struct p9_twrite { | ||
633 | u32 fid; | ||
634 | u64 offset; | ||
635 | u32 count; | ||
636 | u8 *data; | ||
637 | }; | ||
638 | |||
639 | struct p9_rwrite { | ||
640 | u32 count; | ||
641 | }; | ||
642 | |||
643 | struct p9_treaddir { | ||
644 | u32 fid; | ||
645 | u64 offset; | ||
646 | u32 count; | ||
647 | }; | ||
648 | |||
649 | struct p9_rreaddir { | ||
650 | u32 count; | ||
651 | u8 *data; | ||
652 | }; | ||
653 | |||
654 | |||
655 | struct p9_tclunk { | ||
656 | u32 fid; | ||
657 | }; | ||
658 | |||
659 | struct p9_rclunk { | ||
660 | }; | ||
661 | |||
662 | struct p9_tremove { | ||
663 | u32 fid; | ||
664 | }; | ||
665 | |||
666 | struct p9_rremove { | ||
667 | }; | ||
668 | |||
669 | struct p9_tstat { | ||
670 | u32 fid; | ||
671 | }; | ||
672 | |||
673 | struct p9_rstat { | ||
674 | struct p9_wstat stat; | ||
675 | }; | ||
676 | |||
677 | struct p9_twstat { | ||
678 | u32 fid; | ||
679 | struct p9_wstat stat; | ||
680 | }; | ||
681 | |||
682 | struct p9_rwstat { | ||
683 | }; | ||
684 | |||
685 | /** | 522 | /** |
686 | * struct p9_fcall - primary packet structure | 523 | * struct p9_fcall - primary packet structure |
687 | * @size: prefixed length of the structure | 524 | * @size: prefixed length of the structure |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index d26d5e98a173..55ce72ce9861 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -36,9 +36,9 @@ | |||
36 | */ | 36 | */ |
37 | 37 | ||
38 | enum p9_proto_versions{ | 38 | enum p9_proto_versions{ |
39 | p9_proto_legacy = 0, | 39 | p9_proto_legacy, |
40 | p9_proto_2000u = 1, | 40 | p9_proto_2000u, |
41 | p9_proto_2000L = 2, | 41 | p9_proto_2000L, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | 44 | ||
@@ -211,7 +211,10 @@ struct p9_dirent { | |||
211 | }; | 211 | }; |
212 | 212 | ||
213 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); | 213 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); |
214 | int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name); | 214 | int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, |
215 | const char *name); | ||
216 | int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name, | ||
217 | struct p9_fid *newdirfid, const char *new_name); | ||
215 | struct p9_client *p9_client_create(const char *dev_name, char *options); | 218 | struct p9_client *p9_client_create(const char *dev_name, char *options); |
216 | void p9_client_destroy(struct p9_client *clnt); | 219 | void p9_client_destroy(struct p9_client *clnt); |
217 | void p9_client_disconnect(struct p9_client *clnt); | 220 | void p9_client_disconnect(struct p9_client *clnt); |
@@ -231,6 +234,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | |||
231 | int p9_client_clunk(struct p9_fid *fid); | 234 | int p9_client_clunk(struct p9_fid *fid); |
232 | int p9_client_fsync(struct p9_fid *fid, int datasync); | 235 | int p9_client_fsync(struct p9_fid *fid, int datasync); |
233 | int p9_client_remove(struct p9_fid *fid); | 236 | int p9_client_remove(struct p9_fid *fid); |
237 | int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags); | ||
234 | int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, | 238 | int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, |
235 | u64 offset, u32 count); | 239 | u64 offset, u32 count); |
236 | int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, | 240 | int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, |
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h index d8549fb9c742..83531ebeee99 100644 --- a/include/net/9p/transport.h +++ b/include/net/9p/transport.h | |||
@@ -67,7 +67,7 @@ struct p9_trans_module { | |||
67 | 67 | ||
68 | void v9fs_register_trans(struct p9_trans_module *m); | 68 | void v9fs_register_trans(struct p9_trans_module *m); |
69 | void v9fs_unregister_trans(struct p9_trans_module *m); | 69 | void v9fs_unregister_trans(struct p9_trans_module *m); |
70 | struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name); | 70 | struct p9_trans_module *v9fs_get_trans_by_name(char *s); |
71 | struct p9_trans_module *v9fs_get_default_trans(void); | 71 | struct p9_trans_module *v9fs_get_default_trans(void); |
72 | void v9fs_put_trans(struct p9_trans_module *m); | 72 | void v9fs_put_trans(struct p9_trans_module *m); |
73 | #endif /* NET_9P_TRANSPORT_H */ | 73 | #endif /* NET_9P_TRANSPORT_H */ |