.. | .. |
---|
34 | 34 | #define F2FS_ROOT_INO(sbi) ((sbi)->root_ino_num) |
---|
35 | 35 | #define F2FS_NODE_INO(sbi) ((sbi)->node_ino_num) |
---|
36 | 36 | #define F2FS_META_INO(sbi) ((sbi)->meta_ino_num) |
---|
| 37 | +#define F2FS_COMPRESS_INO(sbi) (NM_I(sbi)->max_nid) |
---|
37 | 38 | |
---|
38 | 39 | #define F2FS_MAX_QUOTAS 3 |
---|
39 | 40 | |
---|
.. | .. |
---|
71 | 72 | __u8 path[MAX_PATH_LEN]; |
---|
72 | 73 | __le32 total_segments; |
---|
73 | 74 | } __packed; |
---|
| 75 | + |
---|
| 76 | +/* reason of stop_checkpoint */ |
---|
| 77 | +enum stop_cp_reason { |
---|
| 78 | + STOP_CP_REASON_SHUTDOWN, |
---|
| 79 | + STOP_CP_REASON_FAULT_INJECT, |
---|
| 80 | + STOP_CP_REASON_META_PAGE, |
---|
| 81 | + STOP_CP_REASON_WRITE_FAIL, |
---|
| 82 | + STOP_CP_REASON_CORRUPTED_SUMMARY, |
---|
| 83 | + STOP_CP_REASON_UPDATE_INODE, |
---|
| 84 | + STOP_CP_REASON_FLUSH_FAIL, |
---|
| 85 | + STOP_CP_REASON_MAX, |
---|
| 86 | +}; |
---|
| 87 | + |
---|
| 88 | +#define MAX_STOP_REASON 32 |
---|
74 | 89 | |
---|
75 | 90 | struct f2fs_super_block { |
---|
76 | 91 | __le32 magic; /* Magic Number */ |
---|
.. | .. |
---|
115 | 130 | __u8 hot_ext_count; /* # of hot file extension */ |
---|
116 | 131 | __le16 s_encoding; /* Filename charset encoding */ |
---|
117 | 132 | __le16 s_encoding_flags; /* Filename charset encoding flags */ |
---|
118 | | - __u8 reserved[306]; /* valid reserved region */ |
---|
| 133 | + __u8 s_stop_reason[MAX_STOP_REASON]; /* stop checkpoint reason */ |
---|
| 134 | + __u8 reserved[274]; /* valid reserved region */ |
---|
119 | 135 | __le32 crc; /* checksum of superblock */ |
---|
120 | 136 | } __packed; |
---|
121 | 137 | |
---|
.. | .. |
---|
168 | 184 | unsigned char alloc_type[MAX_ACTIVE_LOGS]; |
---|
169 | 185 | |
---|
170 | 186 | /* SIT and NAT version bitmap */ |
---|
171 | | - unsigned char sit_nat_version_bitmap[1]; |
---|
| 187 | + unsigned char sit_nat_version_bitmap[]; |
---|
172 | 188 | } __packed; |
---|
173 | 189 | |
---|
174 | 190 | #define CP_CHKSUM_OFFSET 4092 /* default chksum offset in checkpoint */ |
---|
.. | .. |
---|
229 | 245 | #define F2FS_INLINE_DOTS 0x10 /* file having implicit dot dentries */ |
---|
230 | 246 | #define F2FS_EXTRA_ATTR 0x20 /* file having extra attribute */ |
---|
231 | 247 | #define F2FS_PIN_FILE 0x40 /* file should not be gced */ |
---|
| 248 | +#define F2FS_COMPRESS_RELEASED 0x80 /* file released compressed blocks */ |
---|
232 | 249 | |
---|
233 | 250 | struct f2fs_inode { |
---|
234 | 251 | __le16 i_mode; /* file mode */ |
---|
.. | .. |
---|
273 | 290 | __le64 i_compr_blocks; /* # of compressed blocks */ |
---|
274 | 291 | __u8 i_compress_algorithm; /* compress algorithm */ |
---|
275 | 292 | __u8 i_log_cluster_size; /* log of cluster size */ |
---|
276 | | - __le16 i_padding; /* padding */ |
---|
| 293 | + __le16 i_compress_flag; /* compress flag */ |
---|
| 294 | + /* 0 bit: chksum flag |
---|
| 295 | + * [10,15] bits: compress level |
---|
| 296 | + */ |
---|
277 | 297 | __le32 i_extra_end[0]; /* for attribute size calculation */ |
---|
278 | 298 | } __packed; |
---|
279 | 299 | __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */ |
---|