| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 23 | struct nilfs_cpinfo { | 
|  | 24 | __u32 ci_flags; | 
|  | 25 | __u32 ci_pad; | 
|  | 26 | __u64 ci_cno; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 27 | __u64 ci_create; | 
|  | 28 | __u64 ci_nblk_inc; | 
|  | 29 | __u64 ci_inodes_count; | 
|  | 30 | __u64 ci_blocks_count; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 31 | __u64 ci_next; | 
|  | 32 | }; | 
|  | 33 | enum { | 
|  | 34 | NILFS_CPINFO_SNAPSHOT, | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 35 | NILFS_CPINFO_INVALID, | 
|  | 36 | NILFS_CPINFO_SKETCH, | 
|  | 37 | NILFS_CPINFO_MINOR, | 
|  | 38 | }; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 39 | #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 | } | 
|  | 45 | struct nilfs_suinfo_update { | 
|  | 46 | __u64 sup_segnum; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 47 | __u32 sup_flags; | 
|  | 48 | __u32 sup_reserved; | 
|  | 49 | struct nilfs_suinfo sup_sui; | 
|  | 50 | }; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 51 | enum { | 
|  | 52 | NILFS_SUINFO_UPDATE_LASTMOD, | 
|  | 53 | NILFS_SUINFO_UPDATE_NBLOCKS, | 
|  | 54 | NILFS_SUINFO_UPDATE_FLAGS, | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 55 | __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 | } | 
|  | 64 | struct nilfs_argv { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 65 | __u64 v_base; | 
|  | 66 | __u32 v_nmembs; | 
|  | 67 | __u16 v_size; | 
|  | 68 | __u16 v_flags; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 69 | __u64 v_index; | 
|  | 70 | }; | 
|  | 71 | struct nilfs_period { | 
|  | 72 | __u64 p_start; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 73 | __u64 p_end; | 
|  | 74 | }; | 
|  | 75 | struct nilfs_cpstat { | 
|  | 76 | __u64 cs_cno; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 77 | __u64 cs_ncps; | 
|  | 78 | __u64 cs_nsss; | 
|  | 79 | }; | 
|  | 80 | struct nilfs_sustat { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 81 | __u64 ss_nsegs; | 
|  | 82 | __u64 ss_ncleansegs; | 
|  | 83 | __u64 ss_ndirtysegs; | 
|  | 84 | __u64 ss_ctime; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 85 | __u64 ss_nongc_ctime; | 
|  | 86 | __u64 ss_prot_seq; | 
|  | 87 | }; | 
|  | 88 | struct nilfs_vinfo { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 89 | __u64 vi_vblocknr; | 
|  | 90 | __u64 vi_start; | 
|  | 91 | __u64 vi_end; | 
|  | 92 | __u64 vi_blocknr; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 93 | }; | 
|  | 94 | struct nilfs_vdesc { | 
|  | 95 | __u64 vd_ino; | 
|  | 96 | __u64 vd_cno; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 97 | __u64 vd_vblocknr; | 
|  | 98 | struct nilfs_period vd_period; | 
|  | 99 | __u64 vd_blocknr; | 
|  | 100 | __u64 vd_offset; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 101 | __u32 vd_flags; | 
|  | 102 | __u32 vd_pad; | 
|  | 103 | }; | 
|  | 104 | struct nilfs_bdesc { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 105 | __u64 bd_ino; | 
|  | 106 | __u64 bd_oblocknr; | 
|  | 107 | __u64 bd_blocknr; | 
|  | 108 | __u64 bd_offset; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 109 | __u32 bd_level; | 
|  | 110 | __u32 bd_pad; | 
|  | 111 | }; | 
|  | 112 | #define NILFS_IOCTL_IDENT 'n' | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 113 | #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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 117 | #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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 121 | #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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 125 | #define NILFS_IOCTL_SET_SUINFO _IOW(NILFS_IOCTL_IDENT, 0x8D, struct nilfs_argv) | 
|  | 126 | #endif |