Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 7 | #ifndef _LINUX_NILFS2_API_H |
| 8 | #define _LINUX_NILFS2_API_H |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/ioctl.h> |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 11 | struct nilfs_cpinfo { |
| 12 | __u32 ci_flags; |
| 13 | __u32 ci_pad; |
| 14 | __u64 ci_cno; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 15 | __u64 ci_create; |
| 16 | __u64 ci_nblk_inc; |
| 17 | __u64 ci_inodes_count; |
| 18 | __u64 ci_blocks_count; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 19 | __u64 ci_next; |
| 20 | }; |
| 21 | enum { |
| 22 | NILFS_CPINFO_SNAPSHOT, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 23 | NILFS_CPINFO_INVALID, |
| 24 | NILFS_CPINFO_SKETCH, |
| 25 | NILFS_CPINFO_MINOR, |
| 26 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 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 | } |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 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 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 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; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 45 | __u32 sup_flags; |
| 46 | __u32 sup_reserved; |
| 47 | struct nilfs_suinfo sup_sui; |
| 48 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 49 | enum { |
| 50 | NILFS_SUINFO_UPDATE_LASTMOD, |
| 51 | NILFS_SUINFO_UPDATE_NBLOCKS, |
| 52 | NILFS_SUINFO_UPDATE_FLAGS, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 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 | } |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 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 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 71 | struct nilfs_argv { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 72 | __u64 v_base; |
| 73 | __u32 v_nmembs; |
| 74 | __u16 v_size; |
| 75 | __u16 v_flags; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 76 | __u64 v_index; |
| 77 | }; |
| 78 | struct nilfs_period { |
| 79 | __u64 p_start; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 80 | __u64 p_end; |
| 81 | }; |
| 82 | struct nilfs_cpstat { |
| 83 | __u64 cs_cno; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 84 | __u64 cs_ncps; |
| 85 | __u64 cs_nsss; |
| 86 | }; |
| 87 | struct nilfs_sustat { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 88 | __u64 ss_nsegs; |
| 89 | __u64 ss_ncleansegs; |
| 90 | __u64 ss_ndirtysegs; |
| 91 | __u64 ss_ctime; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 92 | __u64 ss_nongc_ctime; |
| 93 | __u64 ss_prot_seq; |
| 94 | }; |
| 95 | struct nilfs_vinfo { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 96 | __u64 vi_vblocknr; |
| 97 | __u64 vi_start; |
| 98 | __u64 vi_end; |
| 99 | __u64 vi_blocknr; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 100 | }; |
| 101 | struct nilfs_vdesc { |
| 102 | __u64 vd_ino; |
| 103 | __u64 vd_cno; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 104 | __u64 vd_vblocknr; |
| 105 | struct nilfs_period vd_period; |
| 106 | __u64 vd_blocknr; |
| 107 | __u64 vd_offset; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 108 | __u32 vd_flags; |
| 109 | __u32 vd_pad; |
| 110 | }; |
| 111 | struct nilfs_bdesc { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 112 | __u64 bd_ino; |
| 113 | __u64 bd_oblocknr; |
| 114 | __u64 bd_blocknr; |
| 115 | __u64 bd_offset; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 116 | __u32 bd_level; |
| 117 | __u32 bd_pad; |
| 118 | }; |
| 119 | #define NILFS_IOCTL_IDENT 'n' |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 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) |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 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) |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 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]) |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 132 | #define NILFS_IOCTL_SET_SUINFO _IOW(NILFS_IOCTL_IDENT, 0x8D, struct nilfs_argv) |
| 133 | #endif |