blob: 528c4baad09146aa815bdfe529dfd41978e3fe44 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX_STAT_H
3#define _LINUX_STAT_H
4
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6#include <asm/stat.h>
David Howells607ca462012-10-13 10:46:48 +01007#include <uapi/linux/stat.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#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 Drepper1c710c82007-05-08 00:33:25 -070015#define UTIME_NOW ((1l << 30) - 1l)
16#define UTIME_OMIT ((1l << 30) - 2l)
17
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/types.h>
19#include <linux/time.h>
Eric W. Biedermana7c19382012-02-09 09:10:30 -080020#include <linux/uidgid.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
David Howellsa528d352017-01-31 16:46:22 +000022#define KSTAT_QUERY_FLAGS (AT_STATX_SYNC_TYPE)
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024struct kstat {
David Howellsa528d352017-01-31 16:46:22 +000025 u32 result_mask; /* What fields the user got */
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 umode_t mode;
27 unsigned int nlink;
David Howellsa528d352017-01-31 16:46:22 +000028 uint32_t blksize; /* Preferred I/O size */
29 u64 attributes;
David Howells3209f682017-03-31 18:32:17 +010030 u64 attributes_mask;
David Howellsa528d352017-01-31 16:46:22 +000031#define KSTAT_ATTR_FS_IOC_FLAGS \
32 (STATX_ATTR_COMPRESSED | \
33 STATX_ATTR_IMMUTABLE | \
34 STATX_ATTR_APPEND | \
35 STATX_ATTR_NODUMP | \
Eric Biggers3ad25222019-10-29 13:41:38 -070036 STATX_ATTR_ENCRYPTED | \
37 STATX_ATTR_VERITY \
David Howellsa528d352017-01-31 16:46:22 +000038 )/* Attrs corresponding to FS_*_FL flags */
39 u64 ino;
40 dev_t dev;
41 dev_t rdev;
Eric W. Biedermana7c19382012-02-09 09:10:30 -080042 kuid_t uid;
43 kgid_t gid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 loff_t size;
Deepa Dinamani95582b02018-05-08 19:36:02 -070045 struct timespec64 atime;
46 struct timespec64 mtime;
47 struct timespec64 ctime;
48 struct timespec64 btime; /* File creation time */
David Howellsa528d352017-01-31 16:46:22 +000049 u64 blocks;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050};
51
52#endif