blob: 2f2692eff9722fa58827477d2ad1274f57aa5509 [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}
42#define NILFS_SUINFO_FNS(flag,name) static inline int nilfs_suinfo_ ##name(const struct nilfs_suinfo * si) \
43{ return si->sui_flags & (1UL << NILFS_SUINFO_ ##flag); \
44}
45struct nilfs_suinfo_update {
46 __u64 sup_segnum;
Christopher Ferris49f525c2016-12-12 14:55:36 -080047 __u32 sup_flags;
48 __u32 sup_reserved;
49 struct nilfs_suinfo sup_sui;
50};
Christopher Ferris49f525c2016-12-12 14:55:36 -080051enum {
52 NILFS_SUINFO_UPDATE_LASTMOD,
53 NILFS_SUINFO_UPDATE_NBLOCKS,
54 NILFS_SUINFO_UPDATE_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -080055 __NR_NILFS_SUINFO_UPDATE_FIELDS,
56};
57#define NILFS_SUINFO_UPDATE_FNS(flag,name) static inline void nilfs_suinfo_update_set_ ##name(struct nilfs_suinfo_update * sup) \
58{ sup->sup_flags |= 1UL << NILFS_SUINFO_UPDATE_ ##flag; \
59} static inline void nilfs_suinfo_update_clear_ ##name(struct nilfs_suinfo_update * sup) \
60{ sup->sup_flags &= ~(1UL << NILFS_SUINFO_UPDATE_ ##flag); \
61} static inline int nilfs_suinfo_update_ ##name(const struct nilfs_suinfo_update * sup) \
62{ return ! ! (sup->sup_flags & (1UL << NILFS_SUINFO_UPDATE_ ##flag)); \
63}
64struct nilfs_argv {
Christopher Ferris49f525c2016-12-12 14:55:36 -080065 __u64 v_base;
66 __u32 v_nmembs;
67 __u16 v_size;
68 __u16 v_flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -080069 __u64 v_index;
70};
71struct nilfs_period {
72 __u64 p_start;
Christopher Ferris49f525c2016-12-12 14:55:36 -080073 __u64 p_end;
74};
75struct nilfs_cpstat {
76 __u64 cs_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -080077 __u64 cs_ncps;
78 __u64 cs_nsss;
79};
80struct nilfs_sustat {
Christopher Ferris49f525c2016-12-12 14:55:36 -080081 __u64 ss_nsegs;
82 __u64 ss_ncleansegs;
83 __u64 ss_ndirtysegs;
84 __u64 ss_ctime;
Christopher Ferris49f525c2016-12-12 14:55:36 -080085 __u64 ss_nongc_ctime;
86 __u64 ss_prot_seq;
87};
88struct nilfs_vinfo {
Christopher Ferris49f525c2016-12-12 14:55:36 -080089 __u64 vi_vblocknr;
90 __u64 vi_start;
91 __u64 vi_end;
92 __u64 vi_blocknr;
Christopher Ferris49f525c2016-12-12 14:55:36 -080093};
94struct nilfs_vdesc {
95 __u64 vd_ino;
96 __u64 vd_cno;
Christopher Ferris49f525c2016-12-12 14:55:36 -080097 __u64 vd_vblocknr;
98 struct nilfs_period vd_period;
99 __u64 vd_blocknr;
100 __u64 vd_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800101 __u32 vd_flags;
102 __u32 vd_pad;
103};
104struct nilfs_bdesc {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800105 __u64 bd_ino;
106 __u64 bd_oblocknr;
107 __u64 bd_blocknr;
108 __u64 bd_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800109 __u32 bd_level;
110 __u32 bd_pad;
111};
112#define NILFS_IOCTL_IDENT 'n'
Christopher Ferris49f525c2016-12-12 14:55:36 -0800113#define NILFS_IOCTL_CHANGE_CPMODE _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode)
114#define NILFS_IOCTL_DELETE_CHECKPOINT _IOW(NILFS_IOCTL_IDENT, 0x81, __u64)
115#define NILFS_IOCTL_GET_CPINFO _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv)
116#define NILFS_IOCTL_GET_CPSTAT _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800117#define NILFS_IOCTL_GET_SUINFO _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv)
118#define NILFS_IOCTL_GET_SUSTAT _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat)
119#define NILFS_IOCTL_GET_VINFO _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv)
120#define NILFS_IOCTL_GET_BDESCS _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800121#define NILFS_IOCTL_CLEAN_SEGMENTS _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5])
122#define NILFS_IOCTL_SYNC _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)
123#define NILFS_IOCTL_RESIZE _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)
124#define NILFS_IOCTL_SET_ALLOC_RANGE _IOW(NILFS_IOCTL_IDENT, 0x8C, __u64[2])
Christopher Ferris49f525c2016-12-12 14:55:36 -0800125#define NILFS_IOCTL_SET_SUINFO _IOW(NILFS_IOCTL_IDENT, 0x8D, struct nilfs_argv)
126#endif