@@ -22,7 +22,6 @@ struct fuse_out_header {
2222 uint64_t unique ;
2323};
2424
25-
2625struct vfs_req_header {
2726 struct fuse_in_header in ;
2827};
@@ -32,68 +31,67 @@ struct vfs_resp_header {
3231};
3332
3433struct fuse_init_in {
35- uint32_t major ; // FUSE major version supported by the guest (typically 7)
36- uint32_t minor ; // FUSE minor version supported by the guest (e.g., 31, 26)
37- uint32_t max_readahead ; // Maximum readahead size supported by the guest
38- // (e.g., 0x10000)
39- uint32_t flags ; // Flags requested by the guest (e.g., support for
40- // writeback cache)
34+ /* FUSE major version supported by the guest (typically 7) */
35+ uint32_t major ;
36+ /* FUSE minor version supported by the guest (e.g., 31, 26) */
37+ uint32_t minor ;
38+ uint32_t max_readahead ; /* Maximum readahead size supported by the guest */
39+ uint32_t flags ; /* Flags requested by the guest */
4140};
4241
4342struct fuse_init_out {
44- uint32_t major ; // FUSE major version supported by the device
45- uint32_t minor ; // FUSE minor version supported by the device
46- uint32_t max_readahead ; // Maximum readahead size accepted by the device
47- uint32_t
48- flags ; // Flags supported by the device (negotiated with the guest)
49- uint16_t max_background ; // Maximum number of background requests
50- uint16_t
51- congestion_threshold ; // Threshold for marking the connection congested
52- uint32_t max_write ; // Maximum write size the device can handle
53- uint32_t time_gran ; // Time granularity (in nanoseconds)
54- uint32_t unused [11 ]; // Reserved
43+ uint32_t major ; /* FUSE major version supported by the device */
44+ uint32_t minor ; /* FUSE minor version supported by the device */
45+ uint32_t max_readahead ; /* Maximum readahead size accepted by the device */
46+ /* Flags supported by the device (negotiated with the guest) */
47+ uint32_t flags ;
48+ uint16_t max_background ; /* Maximum number of background requests */
49+ uint16_t congestion_threshold ;
50+ uint32_t max_write ; /* Maximum write size the device can handle */
51+ uint32_t time_gran ; /* Time granularity (in nanoseconds) */
52+ uint32_t unused [11 ]; /* Reserved */
5553};
5654
5755struct fuse_getattr_in {
58- uint32_t getattr_flags ; // bitmask for valid fields (e.g. FUSE_GETATTR_FH)
59- uint32_t padding ; // unused, reserved for alignment
60- uint64_t fh ; // optional: file handle (used when getattr_flags has
61- // FUSE_GETATTR_FH)
56+ /* bitmask for valid fields (e.g. FUSE_GETATTR_FH) */
57+ uint32_t getattr_flags ;
58+ uint32_t padding ; /* unused, reserved for alignment */
59+ uint64_t fh ; /* optional: file handle (used when getattr_flags has */
6260};
6361
6462struct fuse_attr {
65- uint64_t ino ; // inode number
66- uint64_t size ; // file size in bytes
67- uint64_t blocks ; // number of 512B blocks allocated
68- uint64_t atime ; // last access time (UNIX time)
69- uint64_t mtime ; // last modification time
70- uint64_t ctime ; // last status change time
71- uint32_t atimensec ; // nanoseconds part
63+ uint64_t ino ; /* inode number */
64+ uint64_t size ; /* file size in bytes */
65+ uint64_t blocks ; /* number of 512B blocks allocated */
66+ uint64_t atime ; /* last access time (UNIX time) */
67+ uint64_t mtime ; /* last modification time */
68+ uint64_t ctime ; /* last status change time */
69+ uint32_t atimensec ; /* nanoseconds part */
7270 uint32_t mtimensec ;
7371 uint32_t ctimensec ;
74- uint32_t mode ; // file mode (e.g. S_IFDIR | 0755)
75- uint32_t nlink ; // number of hard links
76- uint32_t uid ; // owner uid
77- uint32_t gid ; // owner gid
78- uint32_t rdev ; // device ID (if special file)
79- uint32_t blksize ; // block size
80- uint32_t flags ; // reserved
72+ uint32_t mode ; /* file mode (e.g. S_IFDIR | 0755) */
73+ uint32_t nlink ; /* number of hard links */
74+ uint32_t uid ; /* owner uid */
75+ uint32_t gid ; /* owner gid */
76+ uint32_t rdev ; /* device ID (if special file) */
77+ uint32_t blksize ; /* block size */
78+ uint32_t flags ; /* reserved */
8179};
8280
8381struct fuse_attr_out {
84- uint64_t attr_valid ; // seconds the attributes are valid
85- uint32_t attr_valid_nsec ; // nanoseconds part of attr_valid
86- uint32_t dummy ; // padding for alignment
87- struct fuse_attr attr ; // actual attributes
82+ uint64_t attr_valid ; /* seconds the attributes are valid */
83+ uint32_t attr_valid_nsec ; /* nanoseconds part of attr_valid */
84+ uint32_t dummy ; /* padding for alignment */
85+ struct fuse_attr attr ; /* actual attributes */
8886};
8987
9088struct fuse_open_in {
9189 uint32_t flags ;
92- uint32_t open_flags ; /* FUSE_OPEN_... */
90+ uint32_t open_flags ;
9391};
9492
9593struct fuse_open_out {
96- uint64_t fh ; // file handle
94+ uint64_t fh ;
9795 uint32_t open_flags ;
9896 int32_t backing_id ;
9997};
@@ -109,21 +107,21 @@ struct fuse_read_in {
109107};
110108
111109struct fuse_entry_out {
112- uint64_t nodeid ; // inode number
113- uint64_t generation ; // inode generation
114- uint64_t entry_valid ; // cache timeout (sec)
115- uint64_t attr_valid ; // attr cache timeout (sec)
116- uint32_t entry_valid_nsec ; // cache timeout (nsec)
117- uint32_t attr_valid_nsec ; // attr cache timeout (nsec)
118- struct fuse_attr attr ; // file attributes
110+ uint64_t nodeid ; /* inode number */
111+ uint64_t generation ; /* inode generation */
112+ uint64_t entry_valid ; /* cache timeout (sec) */
113+ uint64_t attr_valid ; /* attr cache timeout (sec) */
114+ uint32_t entry_valid_nsec ; /* cache timeout (nsec) */
115+ uint32_t attr_valid_nsec ; /* attr cache timeout (nsec) */
116+ struct fuse_attr attr ; /* file attributes */
119117};
120118
121119struct fuse_dirent {
122- uint64_t ino ; // inode number
123- uint64_t off ; // offset to next entry
124- uint32_t namelen ; // length of the entry name
125- uint32_t type ; // file type (DT_REG, DT_DIR, etc.)
126- char name []; // name (not null-terminated)
120+ uint64_t ino ; /* inode number */
121+ uint64_t off ; /* offset to next entry */
122+ uint32_t namelen ; /* length of the entry name */
123+ uint32_t type ; /* file type (DT_REG, DT_DIR, etc.) */
124+ char name []; /* name (not null-terminated) */
127125};
128126
129127struct fuse_direntplus {
@@ -132,8 +130,7 @@ struct fuse_direntplus {
132130};
133131
134132struct fuse_lookup_in {
135- uint64_t parent ; // inode of parent dir
136- // char name[]; // followed by name (not null-terminated!)
133+ uint64_t parent ; /* inode of parent dir */
137134};
138135
139136struct fuse_forget_in {
@@ -144,7 +141,7 @@ struct fuse_create_in {
144141 uint32_t flags ;
145142 uint32_t mode ;
146143 uint32_t umask ;
147- uint32_t open_flags ; /* FUSE_OPEN_... */
144+ uint32_t open_flags ;
148145};
149146
150147struct fuse_release_in {
0 commit comments