Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef _LINUX_STAT_H |
| 3 | #define _LINUX_STAT_H |
| 4 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
| 6 | #include <asm/stat.h> |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 7 | #include <uapi/linux/stat.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) |
| 10 | #define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO) |
| 11 | #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) |
| 12 | #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) |
| 13 | #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) |
| 14 | |
Ulrich Drepper | 1c710c8 | 2007-05-08 00:33:25 -0700 | [diff] [blame] | 15 | #define UTIME_NOW ((1l << 30) - 1l) |
| 16 | #define UTIME_OMIT ((1l << 30) - 2l) |
| 17 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <linux/types.h> |
| 19 | #include <linux/time.h> |
Eric W. Biederman | a7c1938 | 2012-02-09 09:10:30 -0800 | [diff] [blame] | 20 | #include <linux/uidgid.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 22 | #define KSTAT_QUERY_FLAGS (AT_STATX_SYNC_TYPE) |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | struct kstat { |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 25 | u32 result_mask; /* What fields the user got */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | umode_t mode; |
| 27 | unsigned int nlink; |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 28 | uint32_t blksize; /* Preferred I/O size */ |
| 29 | u64 attributes; |
David Howells | 3209f68 | 2017-03-31 18:32:17 +0100 | [diff] [blame] | 30 | u64 attributes_mask; |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 31 | #define KSTAT_ATTR_FS_IOC_FLAGS \ |
| 32 | (STATX_ATTR_COMPRESSED | \ |
| 33 | STATX_ATTR_IMMUTABLE | \ |
| 34 | STATX_ATTR_APPEND | \ |
| 35 | STATX_ATTR_NODUMP | \ |
Eric Biggers | 3ad2522 | 2019-10-29 13:41:38 -0700 | [diff] [blame] | 36 | STATX_ATTR_ENCRYPTED | \ |
| 37 | STATX_ATTR_VERITY \ |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 38 | )/* Attrs corresponding to FS_*_FL flags */ |
| 39 | u64 ino; |
| 40 | dev_t dev; |
| 41 | dev_t rdev; |
Eric W. Biederman | a7c1938 | 2012-02-09 09:10:30 -0800 | [diff] [blame] | 42 | kuid_t uid; |
| 43 | kgid_t gid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | loff_t size; |
Deepa Dinamani | 95582b0 | 2018-05-08 19:36:02 -0700 | [diff] [blame] | 45 | struct timespec64 atime; |
| 46 | struct timespec64 mtime; |
| 47 | struct timespec64 ctime; |
| 48 | struct timespec64 btime; /* File creation time */ |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 49 | u64 blocks; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | #endif |