xref: /aosp_15_r20/prebuilts/build-tools/sysroots/x86_64-unknown-linux-musl/include/linux/nilfs2_api.h (revision cda5da8d549138a6648c5ee6d7a49cf8f4a657be)
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _LINUX_NILFS2_API_H
8 #define _LINUX_NILFS2_API_H
9 #include <linux/types.h>
10 #include <linux/ioctl.h>
11 struct nilfs_cpinfo {
12   __u32 ci_flags;
13   __u32 ci_pad;
14   __u64 ci_cno;
15   __u64 ci_create;
16   __u64 ci_nblk_inc;
17   __u64 ci_inodes_count;
18   __u64 ci_blocks_count;
19   __u64 ci_next;
20 };
21 enum {
22   NILFS_CPINFO_SNAPSHOT,
23   NILFS_CPINFO_INVALID,
24   NILFS_CPINFO_SKETCH,
25   NILFS_CPINFO_MINOR,
26 };
27 #define NILFS_CPINFO_FNS(flag,name) static inline int nilfs_cpinfo_ ##name(const struct nilfs_cpinfo * cpinfo) \
28 { return ! ! (cpinfo->ci_flags & (1UL << NILFS_CPINFO_ ##flag)); \
29 }
30 struct nilfs_suinfo {
31   __u64 sui_lastmod;
32   __u32 sui_nblocks;
33   __u32 sui_flags;
34 };
35 enum {
36   NILFS_SUINFO_ACTIVE,
37   NILFS_SUINFO_DIRTY,
38   NILFS_SUINFO_ERROR,
39 };
40 #define NILFS_SUINFO_FNS(flag,name) static inline int nilfs_suinfo_ ##name(const struct nilfs_suinfo * si) \
41 { return si->sui_flags & (1UL << NILFS_SUINFO_ ##flag); \
42 }
43 struct nilfs_suinfo_update {
44   __u64 sup_segnum;
45   __u32 sup_flags;
46   __u32 sup_reserved;
47   struct nilfs_suinfo sup_sui;
48 };
49 enum {
50   NILFS_SUINFO_UPDATE_LASTMOD,
51   NILFS_SUINFO_UPDATE_NBLOCKS,
52   NILFS_SUINFO_UPDATE_FLAGS,
53   __NR_NILFS_SUINFO_UPDATE_FIELDS,
54 };
55 #define NILFS_SUINFO_UPDATE_FNS(flag,name) static inline void nilfs_suinfo_update_set_ ##name(struct nilfs_suinfo_update * sup) \
56 { sup->sup_flags |= 1UL << NILFS_SUINFO_UPDATE_ ##flag; \
57 } static inline void nilfs_suinfo_update_clear_ ##name(struct nilfs_suinfo_update * sup) \
58 { sup->sup_flags &= ~(1UL << NILFS_SUINFO_UPDATE_ ##flag); \
59 } static inline int nilfs_suinfo_update_ ##name(const struct nilfs_suinfo_update * sup) \
60 { return ! ! (sup->sup_flags & (1UL << NILFS_SUINFO_UPDATE_ ##flag)); \
61 }
62 enum {
63   NILFS_CHECKPOINT,
64   NILFS_SNAPSHOT,
65 };
66 struct nilfs_cpmode {
67   __u64 cm_cno;
68   __u32 cm_mode;
69   __u32 cm_pad;
70 };
71 struct nilfs_argv {
72   __u64 v_base;
73   __u32 v_nmembs;
74   __u16 v_size;
75   __u16 v_flags;
76   __u64 v_index;
77 };
78 struct nilfs_period {
79   __u64 p_start;
80   __u64 p_end;
81 };
82 struct nilfs_cpstat {
83   __u64 cs_cno;
84   __u64 cs_ncps;
85   __u64 cs_nsss;
86 };
87 struct nilfs_sustat {
88   __u64 ss_nsegs;
89   __u64 ss_ncleansegs;
90   __u64 ss_ndirtysegs;
91   __u64 ss_ctime;
92   __u64 ss_nongc_ctime;
93   __u64 ss_prot_seq;
94 };
95 struct nilfs_vinfo {
96   __u64 vi_vblocknr;
97   __u64 vi_start;
98   __u64 vi_end;
99   __u64 vi_blocknr;
100 };
101 struct nilfs_vdesc {
102   __u64 vd_ino;
103   __u64 vd_cno;
104   __u64 vd_vblocknr;
105   struct nilfs_period vd_period;
106   __u64 vd_blocknr;
107   __u64 vd_offset;
108   __u32 vd_flags;
109   __u32 vd_pad;
110 };
111 struct nilfs_bdesc {
112   __u64 bd_ino;
113   __u64 bd_oblocknr;
114   __u64 bd_blocknr;
115   __u64 bd_offset;
116   __u32 bd_level;
117   __u32 bd_pad;
118 };
119 #define NILFS_IOCTL_IDENT 'n'
120 #define NILFS_IOCTL_CHANGE_CPMODE _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode)
121 #define NILFS_IOCTL_DELETE_CHECKPOINT _IOW(NILFS_IOCTL_IDENT, 0x81, __u64)
122 #define NILFS_IOCTL_GET_CPINFO _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv)
123 #define NILFS_IOCTL_GET_CPSTAT _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat)
124 #define NILFS_IOCTL_GET_SUINFO _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv)
125 #define NILFS_IOCTL_GET_SUSTAT _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat)
126 #define NILFS_IOCTL_GET_VINFO _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv)
127 #define NILFS_IOCTL_GET_BDESCS _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv)
128 #define NILFS_IOCTL_CLEAN_SEGMENTS _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5])
129 #define NILFS_IOCTL_SYNC _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)
130 #define NILFS_IOCTL_RESIZE _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)
131 #define NILFS_IOCTL_SET_ALLOC_RANGE _IOW(NILFS_IOCTL_IDENT, 0x8C, __u64[2])
132 #define NILFS_IOCTL_SET_SUINFO _IOW(NILFS_IOCTL_IDENT, 0x8D, struct nilfs_argv)
133 #endif
134