blob: d6a6b8f272d187c51eab3a5e5a5c07f20d562999 [file] [log] [blame]
Christopher Ferris49f525c2016-12-12 14:55:36 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_NILFS2_API_H
20#define _LINUX_NILFS2_API_H
21#include <linux/types.h>
22#include <linux/ioctl.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080023struct nilfs_cpinfo {
24 __u32 ci_flags;
25 __u32 ci_pad;
26 __u64 ci_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -080027 __u64 ci_create;
28 __u64 ci_nblk_inc;
29 __u64 ci_inodes_count;
30 __u64 ci_blocks_count;
Christopher Ferris49f525c2016-12-12 14:55:36 -080031 __u64 ci_next;
32};
33enum {
34 NILFS_CPINFO_SNAPSHOT,
Christopher Ferris49f525c2016-12-12 14:55:36 -080035 NILFS_CPINFO_INVALID,
36 NILFS_CPINFO_SKETCH,
37 NILFS_CPINFO_MINOR,
38};
Christopher Ferris49f525c2016-12-12 14:55:36 -080039#define NILFS_CPINFO_FNS(flag,name) static inline int nilfs_cpinfo_ ##name(const struct nilfs_cpinfo * cpinfo) \
40{ return ! ! (cpinfo->ci_flags & (1UL << NILFS_CPINFO_ ##flag)); \
41}
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080042struct nilfs_suinfo {
43 __u64 sui_lastmod;
44 __u32 sui_nblocks;
45 __u32 sui_flags;
46};
47enum {
48 NILFS_SUINFO_ACTIVE,
49 NILFS_SUINFO_DIRTY,
50 NILFS_SUINFO_ERROR,
51};
Christopher Ferris49f525c2016-12-12 14:55:36 -080052#define NILFS_SUINFO_FNS(flag,name) static inline int nilfs_suinfo_ ##name(const struct nilfs_suinfo * si) \
53{ return si->sui_flags & (1UL << NILFS_SUINFO_ ##flag); \
54}
55struct nilfs_suinfo_update {
56 __u64 sup_segnum;
Christopher Ferris49f525c2016-12-12 14:55:36 -080057 __u32 sup_flags;
58 __u32 sup_reserved;
59 struct nilfs_suinfo sup_sui;
60};
Christopher Ferris49f525c2016-12-12 14:55:36 -080061enum {
62 NILFS_SUINFO_UPDATE_LASTMOD,
63 NILFS_SUINFO_UPDATE_NBLOCKS,
64 NILFS_SUINFO_UPDATE_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -080065 __NR_NILFS_SUINFO_UPDATE_FIELDS,
66};
67#define NILFS_SUINFO_UPDATE_FNS(flag,name) static inline void nilfs_suinfo_update_set_ ##name(struct nilfs_suinfo_update * sup) \
68{ sup->sup_flags |= 1UL << NILFS_SUINFO_UPDATE_ ##flag; \
69} static inline void nilfs_suinfo_update_clear_ ##name(struct nilfs_suinfo_update * sup) \
70{ sup->sup_flags &= ~(1UL << NILFS_SUINFO_UPDATE_ ##flag); \
71} static inline int nilfs_suinfo_update_ ##name(const struct nilfs_suinfo_update * sup) \
72{ return ! ! (sup->sup_flags & (1UL << NILFS_SUINFO_UPDATE_ ##flag)); \
73}
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080074enum {
75 NILFS_CHECKPOINT,
76 NILFS_SNAPSHOT,
77};
78struct nilfs_cpmode {
79 __u64 cm_cno;
80 __u32 cm_mode;
81 __u32 cm_pad;
82};
Christopher Ferris49f525c2016-12-12 14:55:36 -080083struct nilfs_argv {
Christopher Ferris49f525c2016-12-12 14:55:36 -080084 __u64 v_base;
85 __u32 v_nmembs;
86 __u16 v_size;
87 __u16 v_flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -080088 __u64 v_index;
89};
90struct nilfs_period {
91 __u64 p_start;
Christopher Ferris49f525c2016-12-12 14:55:36 -080092 __u64 p_end;
93};
94struct nilfs_cpstat {
95 __u64 cs_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -080096 __u64 cs_ncps;
97 __u64 cs_nsss;
98};
99struct nilfs_sustat {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800100 __u64 ss_nsegs;
101 __u64 ss_ncleansegs;
102 __u64 ss_ndirtysegs;
103 __u64 ss_ctime;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800104 __u64 ss_nongc_ctime;
105 __u64 ss_prot_seq;
106};
107struct nilfs_vinfo {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108 __u64 vi_vblocknr;
109 __u64 vi_start;
110 __u64 vi_end;
111 __u64 vi_blocknr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800112};
113struct nilfs_vdesc {
114 __u64 vd_ino;
115 __u64 vd_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800116 __u64 vd_vblocknr;
117 struct nilfs_period vd_period;
118 __u64 vd_blocknr;
119 __u64 vd_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800120 __u32 vd_flags;
121 __u32 vd_pad;
122};
123struct nilfs_bdesc {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800124 __u64 bd_ino;
125 __u64 bd_oblocknr;
126 __u64 bd_blocknr;
127 __u64 bd_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800128 __u32 bd_level;
129 __u32 bd_pad;
130};
131#define NILFS_IOCTL_IDENT 'n'
Christopher Ferris49f525c2016-12-12 14:55:36 -0800132#define NILFS_IOCTL_CHANGE_CPMODE _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode)
133#define NILFS_IOCTL_DELETE_CHECKPOINT _IOW(NILFS_IOCTL_IDENT, 0x81, __u64)
134#define NILFS_IOCTL_GET_CPINFO _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv)
135#define NILFS_IOCTL_GET_CPSTAT _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800136#define NILFS_IOCTL_GET_SUINFO _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv)
137#define NILFS_IOCTL_GET_SUSTAT _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat)
138#define NILFS_IOCTL_GET_VINFO _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv)
139#define NILFS_IOCTL_GET_BDESCS _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800140#define NILFS_IOCTL_CLEAN_SEGMENTS _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5])
141#define NILFS_IOCTL_SYNC _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)
142#define NILFS_IOCTL_RESIZE _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)
143#define NILFS_IOCTL_SET_ALLOC_RANGE _IOW(NILFS_IOCTL_IDENT, 0x8C, __u64[2])
Christopher Ferris49f525c2016-12-12 14:55:36 -0800144#define NILFS_IOCTL_SET_SUINFO _IOW(NILFS_IOCTL_IDENT, 0x8D, struct nilfs_argv)
145#endif