]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - include/linux/stat.h
Merge tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux...
[thirdparty/kernel/linux.git] / include / linux / stat.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4
LT
2#ifndef _LINUX_STAT_H
3#define _LINUX_STAT_H
4
1da177e4
LT
5
6#include <asm/stat.h>
607ca46e 7#include <uapi/linux/stat.h>
1da177e4 8
1da177e4
LT
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
1c710c89
UD
15#define UTIME_NOW ((1l << 30) - 1l)
16#define UTIME_OMIT ((1l << 30) - 2l)
17
1da177e4
LT
18#include <linux/types.h>
19#include <linux/time.h>
a7c1938e 20#include <linux/uidgid.h>
1da177e4
LT
21
22struct kstat {
a528d35e 23 u32 result_mask; /* What fields the user got */
1da177e4
LT
24 umode_t mode;
25 unsigned int nlink;
a528d35e
DH
26 uint32_t blksize; /* Preferred I/O size */
27 u64 attributes;
3209f68b 28 u64 attributes_mask;
a528d35e
DH
29#define KSTAT_ATTR_FS_IOC_FLAGS \
30 (STATX_ATTR_COMPRESSED | \
31 STATX_ATTR_IMMUTABLE | \
32 STATX_ATTR_APPEND | \
33 STATX_ATTR_NODUMP | \
3ad2522c
EB
34 STATX_ATTR_ENCRYPTED | \
35 STATX_ATTR_VERITY \
a528d35e 36 )/* Attrs corresponding to FS_*_FL flags */
4f911138
AG
37#define KSTAT_ATTR_VFS_FLAGS \
38 (STATX_ATTR_IMMUTABLE | \
39 STATX_ATTR_APPEND \
40 ) /* Attrs corresponding to S_* flags that are enforced by the VFS */
a528d35e
DH
41 u64 ino;
42 dev_t dev;
43 dev_t rdev;
a7c1938e
EB
44 kuid_t uid;
45 kgid_t gid;
1da177e4 46 loff_t size;
95582b00
DD
47 struct timespec64 atime;
48 struct timespec64 mtime;
49 struct timespec64 ctime;
50 struct timespec64 btime; /* File creation time */
a528d35e 51 u64 blocks;
fa2fcf4f 52 u64 mnt_id;
825cf206
EB
53 u32 dio_mem_align;
54 u32 dio_offset_align;
a1175d6b 55 u64 change_cookie;
2a82bb02 56 u64 subvol;
1da177e4
LT
57};
58
a1175d6b
JL
59/* These definitions are internal to the kernel for now. Mainly used by nfsd. */
60
61/* mask values */
62#define STATX_CHANGE_COOKIE 0x40000000U /* Want/got stx_change_attr */
63
64/* file attribute values */
65#define STATX_ATTR_CHANGE_MONOTONIC 0x8000000000000000ULL /* version monotonically increases */
66
1da177e4 67#endif