blob: 993f1fdc43b78a13b0e524c3743977a312232ed2 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 */
Christopher Ferris49f525c2016-12-12 14:55:36 -08007#ifndef _LINUX_NILFS2_API_H
8#define _LINUX_NILFS2_API_H
9#include <linux/types.h>
10#include <linux/ioctl.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080011struct nilfs_cpinfo {
12 __u32 ci_flags;
13 __u32 ci_pad;
14 __u64 ci_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -080015 __u64 ci_create;
16 __u64 ci_nblk_inc;
17 __u64 ci_inodes_count;
18 __u64 ci_blocks_count;
Christopher Ferris49f525c2016-12-12 14:55:36 -080019 __u64 ci_next;
20};
21enum {
22 NILFS_CPINFO_SNAPSHOT,
Christopher Ferris49f525c2016-12-12 14:55:36 -080023 NILFS_CPINFO_INVALID,
24 NILFS_CPINFO_SKETCH,
25 NILFS_CPINFO_MINOR,
26};
Christopher Ferris49f525c2016-12-12 14:55:36 -080027#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}
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080030struct nilfs_suinfo {
31 __u64 sui_lastmod;
32 __u32 sui_nblocks;
33 __u32 sui_flags;
34};
35enum {
36 NILFS_SUINFO_ACTIVE,
37 NILFS_SUINFO_DIRTY,
38 NILFS_SUINFO_ERROR,
39};
Christopher Ferris49f525c2016-12-12 14:55:36 -080040#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}
43struct nilfs_suinfo_update {
44 __u64 sup_segnum;
Christopher Ferris49f525c2016-12-12 14:55:36 -080045 __u32 sup_flags;
46 __u32 sup_reserved;
47 struct nilfs_suinfo sup_sui;
48};
Christopher Ferris49f525c2016-12-12 14:55:36 -080049enum {
50 NILFS_SUINFO_UPDATE_LASTMOD,
51 NILFS_SUINFO_UPDATE_NBLOCKS,
52 NILFS_SUINFO_UPDATE_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -080053 __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}
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080062enum {
63 NILFS_CHECKPOINT,
64 NILFS_SNAPSHOT,
65};
66struct nilfs_cpmode {
67 __u64 cm_cno;
68 __u32 cm_mode;
69 __u32 cm_pad;
70};
Christopher Ferris49f525c2016-12-12 14:55:36 -080071struct nilfs_argv {
Christopher Ferris49f525c2016-12-12 14:55:36 -080072 __u64 v_base;
73 __u32 v_nmembs;
74 __u16 v_size;
75 __u16 v_flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -080076 __u64 v_index;
77};
78struct nilfs_period {
79 __u64 p_start;
Christopher Ferris49f525c2016-12-12 14:55:36 -080080 __u64 p_end;
81};
82struct nilfs_cpstat {
83 __u64 cs_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -080084 __u64 cs_ncps;
85 __u64 cs_nsss;
86};
87struct nilfs_sustat {
Christopher Ferris49f525c2016-12-12 14:55:36 -080088 __u64 ss_nsegs;
89 __u64 ss_ncleansegs;
90 __u64 ss_ndirtysegs;
91 __u64 ss_ctime;
Christopher Ferris49f525c2016-12-12 14:55:36 -080092 __u64 ss_nongc_ctime;
93 __u64 ss_prot_seq;
94};
95struct nilfs_vinfo {
Christopher Ferris49f525c2016-12-12 14:55:36 -080096 __u64 vi_vblocknr;
97 __u64 vi_start;
98 __u64 vi_end;
99 __u64 vi_blocknr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800100};
101struct nilfs_vdesc {
102 __u64 vd_ino;
103 __u64 vd_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800104 __u64 vd_vblocknr;
105 struct nilfs_period vd_period;
106 __u64 vd_blocknr;
107 __u64 vd_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108 __u32 vd_flags;
109 __u32 vd_pad;
110};
111struct nilfs_bdesc {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800112 __u64 bd_ino;
113 __u64 bd_oblocknr;
114 __u64 bd_blocknr;
115 __u64 bd_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800116 __u32 bd_level;
117 __u32 bd_pad;
118};
119#define NILFS_IOCTL_IDENT 'n'
Christopher Ferris49f525c2016-12-12 14:55:36 -0800120#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)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800124#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)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800128#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])
Christopher Ferris49f525c2016-12-12 14:55:36 -0800132#define NILFS_IOCTL_SET_SUINFO _IOW(NILFS_IOCTL_IDENT, 0x8D, struct nilfs_argv)
133#endif