stat.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_STAT_H
  3. #define _LINUX_STAT_H
  4. #include <asm/stat.h>
  5. #include <uapi/linux/stat.h>
  6. #define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
  7. #define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
  8. #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
  9. #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH)
  10. #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH)
  11. #define UTIME_NOW ((1l << 30) - 1l)
  12. #define UTIME_OMIT ((1l << 30) - 2l)
  13. #include <linux/types.h>
  14. #include <linux/time.h>
  15. #include <linux/uidgid.h>
  16. struct kstat {
  17. u32 result_mask; /* What fields the user got */
  18. umode_t mode;
  19. unsigned int nlink;
  20. uint32_t blksize; /* Preferred I/O size */
  21. u64 attributes;
  22. u64 attributes_mask;
  23. #define KSTAT_ATTR_FS_IOC_FLAGS \
  24. (STATX_ATTR_COMPRESSED | \
  25. STATX_ATTR_IMMUTABLE | \
  26. STATX_ATTR_APPEND | \
  27. STATX_ATTR_NODUMP | \
  28. STATX_ATTR_ENCRYPTED | \
  29. STATX_ATTR_VERITY \
  30. )/* Attrs corresponding to FS_*_FL flags */
  31. u64 ino;
  32. dev_t dev;
  33. dev_t rdev;
  34. kuid_t uid;
  35. kgid_t gid;
  36. loff_t size;
  37. struct timespec64 atime;
  38. struct timespec64 mtime;
  39. struct timespec64 ctime;
  40. struct timespec64 btime; /* File creation time */
  41. u64 blocks;
  42. u64 mnt_id;
  43. };
  44. #endif