blob: fff27e603814121516418f2697fbcf7f1fbf6f43 [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
22struct kstat {
David Howellsa528d352017-01-31 16:46:22 +000023 u32 result_mask; /* What fields the user got */
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 umode_t mode;
25 unsigned int nlink;
David Howellsa528d352017-01-31 16:46:22 +000026 uint32_t blksize; /* Preferred I/O size */
27 u64 attributes;
David Howells3209f682017-03-31 18:32:17 +010028 u64 attributes_mask;
David Howellsa528d352017-01-31 16:46:22 +000029#define KSTAT_ATTR_FS_IOC_FLAGS \
30 (STATX_ATTR_COMPRESSED | \
31 STATX_ATTR_IMMUTABLE | \
32 STATX_ATTR_APPEND | \
33 STATX_ATTR_NODUMP | \
Eric Biggers3ad25222019-10-29 13:41:38 -070034 STATX_ATTR_ENCRYPTED | \
35 STATX_ATTR_VERITY \
David Howellsa528d352017-01-31 16:46:22 +000036 )/* Attrs corresponding to FS_*_FL flags */
37 u64 ino;
38 dev_t dev;
39 dev_t rdev;
Eric W. Biedermana7c19382012-02-09 09:10:30 -080040 kuid_t uid;
41 kgid_t gid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 loff_t size;
Deepa Dinamani95582b02018-05-08 19:36:02 -070043 struct timespec64 atime;
44 struct timespec64 mtime;
45 struct timespec64 ctime;
46 struct timespec64 btime; /* File creation time */
David Howellsa528d352017-01-31 16:46:22 +000047 u64 blocks;
Miklos Szeredifa2fcf42020-05-14 16:44:24 +020048 u64 mnt_id;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049};
50
51#endif