aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/9p/9p.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/9p/9p.h')
-rw-r--r--include/net/9p/9p.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 156c26bb8bd7..a8de812ccbc8 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -88,8 +88,16 @@ do { \
88 * enum p9_msg_t - 9P message types 88 * enum p9_msg_t - 9P message types
89 * @P9_TSTATFS: file system status request 89 * @P9_TSTATFS: file system status request
90 * @P9_RSTATFS: file system status response 90 * @P9_RSTATFS: file system status response
91 * @P9_TSYMLINK: make symlink request
92 * @P9_RSYMLINK: make symlink response
93 * @P9_TMKNOD: create a special file object request
94 * @P9_RMKNOD: create a special file object response
95 * @P9_TLCREATE: prepare a handle for I/O on an new file for 9P2000.L
96 * @P9_RLCREATE: response with file access information for 9P2000.L
91 * @P9_TRENAME: rename request 97 * @P9_TRENAME: rename request
92 * @P9_RRENAME: rename response 98 * @P9_RRENAME: rename response
99 * @P9_TMKDIR: create a directory request
100 * @P9_RMKDIR: create a directory response
93 * @P9_TVERSION: version handshake request 101 * @P9_TVERSION: version handshake request
94 * @P9_RVERSION: version handshake response 102 * @P9_RVERSION: version handshake response
95 * @P9_TAUTH: request to establish authentication channel 103 * @P9_TAUTH: request to establish authentication channel
@@ -131,8 +139,30 @@ do { \
131enum p9_msg_t { 139enum p9_msg_t {
132 P9_TSTATFS = 8, 140 P9_TSTATFS = 8,
133 P9_RSTATFS, 141 P9_RSTATFS,
142 P9_TLOPEN = 12,
143 P9_RLOPEN,
144 P9_TLCREATE = 14,
145 P9_RLCREATE,
146 P9_TSYMLINK = 16,
147 P9_RSYMLINK,
148 P9_TMKNOD = 18,
149 P9_RMKNOD,
134 P9_TRENAME = 20, 150 P9_TRENAME = 20,
135 P9_RRENAME, 151 P9_RRENAME,
152 P9_TGETATTR = 24,
153 P9_RGETATTR,
154 P9_TSETATTR = 26,
155 P9_RSETATTR,
156 P9_TXATTRWALK = 30,
157 P9_RXATTRWALK,
158 P9_TXATTRCREATE = 32,
159 P9_RXATTRCREATE,
160 P9_TREADDIR = 40,
161 P9_RREADDIR,
162 P9_TLINK = 70,
163 P9_RLINK,
164 P9_TMKDIR = 72,
165 P9_RMKDIR,
136 P9_TVERSION = 100, 166 P9_TVERSION = 100,
137 P9_RVERSION, 167 P9_RVERSION,
138 P9_TAUTH = 102, 168 P9_TAUTH = 102,
@@ -275,6 +305,9 @@ enum p9_qid_t {
275/* ample room for Twrite/Rread header */ 305/* ample room for Twrite/Rread header */
276#define P9_IOHDRSZ 24 306#define P9_IOHDRSZ 24
277 307
308/* Room for readdir header */
309#define P9_READDIRHDRSZ 24
310
278/** 311/**
279 * struct p9_str - length prefixed string type 312 * struct p9_str - length prefixed string type
280 * @len: length of the string 313 * @len: length of the string
@@ -357,6 +390,74 @@ struct p9_wstat {
357 u32 n_muid; /* 9p2000.u extensions */ 390 u32 n_muid; /* 9p2000.u extensions */
358}; 391};
359 392
393struct p9_stat_dotl {
394 u64 st_result_mask;
395 struct p9_qid qid;
396 u32 st_mode;
397 u32 st_uid;
398 u32 st_gid;
399 u64 st_nlink;
400 u64 st_rdev;
401 u64 st_size;
402 u64 st_blksize;
403 u64 st_blocks;
404 u64 st_atime_sec;
405 u64 st_atime_nsec;
406 u64 st_mtime_sec;
407 u64 st_mtime_nsec;
408 u64 st_ctime_sec;
409 u64 st_ctime_nsec;
410 u64 st_btime_sec;
411 u64 st_btime_nsec;
412 u64 st_gen;
413 u64 st_data_version;
414};
415
416#define P9_STATS_MODE 0x00000001ULL
417#define P9_STATS_NLINK 0x00000002ULL
418#define P9_STATS_UID 0x00000004ULL
419#define P9_STATS_GID 0x00000008ULL
420#define P9_STATS_RDEV 0x00000010ULL
421#define P9_STATS_ATIME 0x00000020ULL
422#define P9_STATS_MTIME 0x00000040ULL
423#define P9_STATS_CTIME 0x00000080ULL
424#define P9_STATS_INO 0x00000100ULL
425#define P9_STATS_SIZE 0x00000200ULL
426#define P9_STATS_BLOCKS 0x00000400ULL
427
428#define P9_STATS_BTIME 0x00000800ULL
429#define P9_STATS_GEN 0x00001000ULL
430#define P9_STATS_DATA_VERSION 0x00002000ULL
431
432#define P9_STATS_BASIC 0x000007ffULL /* Mask for fields up to BLOCKS */
433#define P9_STATS_ALL 0x00003fffULL /* Mask for All fields above */
434
435/**
436 * struct p9_iattr_dotl - P9 inode attribute for setattr
437 * @valid: bitfield specifying which fields are valid
438 * same as in struct iattr
439 * @mode: File permission bits
440 * @uid: user id of owner
441 * @gid: group id
442 * @size: File size
443 * @atime_sec: Last access time, seconds
444 * @atime_nsec: Last access time, nanoseconds
445 * @mtime_sec: Last modification time, seconds
446 * @mtime_nsec: Last modification time, nanoseconds
447 */
448
449struct p9_iattr_dotl {
450 u32 valid;
451 u32 mode;
452 u32 uid;
453 u32 gid;
454 u64 size;
455 u64 atime_sec;
456 u64 atime_nsec;
457 u64 mtime_sec;
458 u64 mtime_nsec;
459};
460
360/* Structures for Protocol Operations */ 461/* Structures for Protocol Operations */
361struct p9_tstatfs { 462struct p9_tstatfs {
362 u32 fid; 463 u32 fid;
@@ -485,6 +586,18 @@ struct p9_rwrite {
485 u32 count; 586 u32 count;
486}; 587};
487 588
589struct p9_treaddir {
590 u32 fid;
591 u64 offset;
592 u32 count;
593};
594
595struct p9_rreaddir {
596 u32 count;
597 u8 *data;
598};
599
600
488struct p9_tclunk { 601struct p9_tclunk {
489 u32 fid; 602 u32 fid;
490}; 603};