Skip to content

Commit ba58a37

Browse files
author
Miklos Szeredi
committed
fuse: add STATX request
Use the same structure as statx. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 8d8f9c4 commit ba58a37

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

include/uapi/linux/fuse.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
*
211211
* 7.39
212212
* - add FUSE_DIRECT_IO_RELAX
213+
* - add FUSE_STATX and related structures
213214
*/
214215

215216
#ifndef _LINUX_FUSE_H
@@ -272,6 +273,40 @@ struct fuse_attr {
272273
uint32_t flags;
273274
};
274275

276+
/*
277+
* The following structures are bit-for-bit compatible with the statx(2) ABI in
278+
* Linux.
279+
*/
280+
struct fuse_sx_time {
281+
int64_t tv_sec;
282+
uint32_t tv_nsec;
283+
int32_t __reserved;
284+
};
285+
286+
struct fuse_statx {
287+
uint32_t mask;
288+
uint32_t blksize;
289+
uint64_t attributes;
290+
uint32_t nlink;
291+
uint32_t uid;
292+
uint32_t gid;
293+
uint16_t mode;
294+
uint16_t __spare0[1];
295+
uint64_t ino;
296+
uint64_t size;
297+
uint64_t blocks;
298+
uint64_t attributes_mask;
299+
struct fuse_sx_time atime;
300+
struct fuse_sx_time btime;
301+
struct fuse_sx_time ctime;
302+
struct fuse_sx_time mtime;
303+
uint32_t rdev_major;
304+
uint32_t rdev_minor;
305+
uint32_t dev_major;
306+
uint32_t dev_minor;
307+
uint64_t __spare2[14];
308+
};
309+
275310
struct fuse_kstatfs {
276311
uint64_t blocks;
277312
uint64_t bfree;
@@ -581,6 +616,7 @@ enum fuse_opcode {
581616
FUSE_REMOVEMAPPING = 49,
582617
FUSE_SYNCFS = 50,
583618
FUSE_TMPFILE = 51,
619+
FUSE_STATX = 52,
584620

585621
/* CUSE specific operations */
586622
CUSE_INIT = 4096,
@@ -645,6 +681,22 @@ struct fuse_attr_out {
645681
struct fuse_attr attr;
646682
};
647683

684+
struct fuse_statx_in {
685+
uint32_t getattr_flags;
686+
uint32_t reserved;
687+
uint64_t fh;
688+
uint32_t sx_flags;
689+
uint32_t sx_mask;
690+
};
691+
692+
struct fuse_statx_out {
693+
uint64_t attr_valid; /* Cache timeout for the attributes */
694+
uint32_t attr_valid_nsec;
695+
uint32_t flags;
696+
uint64_t spare[2];
697+
struct fuse_statx stat;
698+
};
699+
648700
#define FUSE_COMPAT_MKNOD_IN_SIZE 8
649701

650702
struct fuse_mknod_in {

0 commit comments

Comments
 (0)