19 #include <linux/types.h>
21 #include <linux/magic.h>
23 #include <linux/quota.h>
25 #include <linux/rbtree.h>
29 #include <linux/wait.h>
50 #define ext4_debug(f, a...) \
52 printk(KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \
53 __FILE__, __LINE__, __func__); \
54 printk(KERN_DEBUG f, ## a); \
57 #define ext4_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
60 #define EXT4_ERROR_INODE(inode, fmt, a...) \
61 ext4_error_inode((inode), __func__, __LINE__, 0, (fmt), ## a)
63 #define EXT4_ERROR_INODE_BLOCK(inode, block, fmt, a...) \
64 ext4_error_inode((inode), __func__, __LINE__, (block), (fmt), ## a)
66 #define EXT4_ERROR_FILE(file, block, fmt, a...) \
67 ext4_error_file((file), __func__, __LINE__, (block), (fmt), ## a)
89 #define EXT4_MB_HINT_MERGE 0x0001
91 #define EXT4_MB_HINT_RESERVED 0x0002
93 #define EXT4_MB_HINT_METADATA 0x0004
95 #define EXT4_MB_HINT_FIRST 0x0008
97 #define EXT4_MB_HINT_BEST 0x0010
99 #define EXT4_MB_HINT_DATA 0x0020
101 #define EXT4_MB_HINT_NOPREALLOC 0x0040
103 #define EXT4_MB_HINT_GROUP_ALLOC 0x0080
105 #define EXT4_MB_HINT_GOAL_ONLY 0x0100
107 #define EXT4_MB_HINT_TRY_GOAL 0x0200
109 #define EXT4_MB_DELALLOC_RESERVED 0x0400
111 #define EXT4_MB_STREAM_ALLOC 0x0800
113 #define EXT4_MB_USE_ROOT_BLOCKS 0x1000
143 #define EXT4_MAP_NEW (1 << BH_New)
144 #define EXT4_MAP_MAPPED (1 << BH_Mapped)
145 #define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten)
146 #define EXT4_MAP_BOUNDARY (1 << BH_Boundary)
147 #define EXT4_MAP_UNINIT (1 << BH_Uninit)
155 #define EXT4_MAP_FROM_CLUSTER (1 << BH_AllocFromCluster)
156 #define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\
157 EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\
158 EXT4_MAP_UNINIT | EXT4_MAP_FROM_CLUSTER)
185 #define EXT4_IO_END_UNWRITTEN 0x0001
186 #define EXT4_IO_END_ERROR 0x0002
187 #define EXT4_IO_END_QUEUED 0x0004
188 #define EXT4_IO_END_DIRECT 0x0008
195 #define MAX_IO_PAGES 128
229 #define EXT4_BAD_INO 1
230 #define EXT4_ROOT_INO 2
231 #define EXT4_USR_QUOTA_INO 3
232 #define EXT4_GRP_QUOTA_INO 4
233 #define EXT4_BOOT_LOADER_INO 5
234 #define EXT4_UNDEL_DIR_INO 6
235 #define EXT4_RESIZE_INO 7
236 #define EXT4_JOURNAL_INO 8
239 #define EXT4_GOOD_OLD_FIRST_INO 11
244 #define EXT4_LINK_MAX 65000
249 #define EXT4_MIN_BLOCK_SIZE 1024
250 #define EXT4_MAX_BLOCK_SIZE 65536
251 #define EXT4_MIN_BLOCK_LOG_SIZE 10
252 #define EXT4_MAX_BLOCK_LOG_SIZE 16
254 # define EXT4_BLOCK_SIZE(s) ((s)->s_blocksize)
256 # define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size)
258 #define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof(__u32))
259 #define EXT4_CLUSTER_SIZE(s) (EXT4_BLOCK_SIZE(s) << \
260 EXT4_SB(s)->s_cluster_bits)
262 # define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
263 # define EXT4_CLUSTER_BITS(s) (EXT4_SB(s)->s_cluster_bits)
265 # define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
268 #define EXT4_ADDR_PER_BLOCK_BITS(s) (EXT4_SB(s)->s_addr_per_block_bits)
269 #define EXT4_INODE_SIZE(s) (EXT4_SB(s)->s_inode_size)
270 #define EXT4_FIRST_INO(s) (EXT4_SB(s)->s_first_ino)
272 #define EXT4_INODE_SIZE(s) (((s)->s_rev_level == EXT4_GOOD_OLD_REV) ? \
273 EXT4_GOOD_OLD_INODE_SIZE : \
275 #define EXT4_FIRST_INO(s) (((s)->s_rev_level == EXT4_GOOD_OLD_REV) ? \
276 EXT4_GOOD_OLD_FIRST_INO : \
279 #define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
282 #define EXT4_B2C(sbi, blk) ((blk) >> (sbi)->s_cluster_bits)
284 #define EXT4_C2B(sbi, cluster) ((cluster) << (sbi)->s_cluster_bits)
286 #define EXT4_NUM_B2C(sbi, blks) (((blks) + (sbi)->s_cluster_ratio - 1) >> \
287 (sbi)->s_cluster_bits)
319 #define EXT4_BG_INODE_BITMAP_CSUM_HI_END \
320 (offsetof(struct ext4_group_desc, bg_inode_bitmap_csum_hi) + \
322 #define EXT4_BG_BLOCK_BITMAP_CSUM_HI_END \
323 (offsetof(struct ext4_group_desc, bg_block_bitmap_csum_hi) + \
336 #define EXT4_BG_INODE_UNINIT 0x0001
337 #define EXT4_BG_BLOCK_UNINIT 0x0002
338 #define EXT4_BG_INODE_ZEROED 0x0004
343 #define EXT4_MIN_DESC_SIZE 32
344 #define EXT4_MIN_DESC_SIZE_64BIT 64
345 #define EXT4_MAX_DESC_SIZE EXT4_MIN_BLOCK_SIZE
346 #define EXT4_DESC_SIZE(s) (EXT4_SB(s)->s_desc_size)
348 # define EXT4_BLOCKS_PER_GROUP(s) (EXT4_SB(s)->s_blocks_per_group)
349 # define EXT4_CLUSTERS_PER_GROUP(s) (EXT4_SB(s)->s_clusters_per_group)
350 # define EXT4_DESC_PER_BLOCK(s) (EXT4_SB(s)->s_desc_per_block)
351 # define EXT4_INODES_PER_GROUP(s) (EXT4_SB(s)->s_inodes_per_group)
352 # define EXT4_DESC_PER_BLOCK_BITS(s) (EXT4_SB(s)->s_desc_per_block_bits)
354 # define EXT4_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
355 # define EXT4_DESC_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / EXT4_DESC_SIZE(s))
356 # define EXT4_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
362 #define EXT4_NDIR_BLOCKS 12
363 #define EXT4_IND_BLOCK EXT4_NDIR_BLOCKS
364 #define EXT4_DIND_BLOCK (EXT4_IND_BLOCK + 1)
365 #define EXT4_TIND_BLOCK (EXT4_DIND_BLOCK + 1)
366 #define EXT4_N_BLOCKS (EXT4_TIND_BLOCK + 1)
371 #define EXT4_SECRM_FL 0x00000001
372 #define EXT4_UNRM_FL 0x00000002
373 #define EXT4_COMPR_FL 0x00000004
374 #define EXT4_SYNC_FL 0x00000008
375 #define EXT4_IMMUTABLE_FL 0x00000010
376 #define EXT4_APPEND_FL 0x00000020
377 #define EXT4_NODUMP_FL 0x00000040
378 #define EXT4_NOATIME_FL 0x00000080
380 #define EXT4_DIRTY_FL 0x00000100
381 #define EXT4_COMPRBLK_FL 0x00000200
382 #define EXT4_NOCOMPR_FL 0x00000400
383 #define EXT4_ECOMPR_FL 0x00000800
385 #define EXT4_INDEX_FL 0x00001000
386 #define EXT4_IMAGIC_FL 0x00002000
387 #define EXT4_JOURNAL_DATA_FL 0x00004000
388 #define EXT4_NOTAIL_FL 0x00008000
389 #define EXT4_DIRSYNC_FL 0x00010000
390 #define EXT4_TOPDIR_FL 0x00020000
391 #define EXT4_HUGE_FILE_FL 0x00040000
392 #define EXT4_EXTENTS_FL 0x00080000
393 #define EXT4_EA_INODE_FL 0x00200000
394 #define EXT4_EOFBLOCKS_FL 0x00400000
395 #define EXT4_RESERVED_FL 0x80000000
397 #define EXT4_FL_USER_VISIBLE 0x004BDFFF
398 #define EXT4_FL_USER_MODIFIABLE 0x004B80FF
401 #define EXT4_FL_INHERITED (EXT4_SECRM_FL | EXT4_UNRM_FL | EXT4_COMPR_FL |\
402 EXT4_SYNC_FL | EXT4_NODUMP_FL | EXT4_NOATIME_FL |\
403 EXT4_NOCOMPR_FL | EXT4_JOURNAL_DATA_FL |\
404 EXT4_NOTAIL_FL | EXT4_DIRSYNC_FL)
407 #define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL))
410 #define EXT4_OTHER_FLMASK (EXT4_NODUMP_FL | EXT4_NOATIME_FL)
454 #define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG))
455 #define CHECK_FLAG_VALUE(FLAG) if (!TEST_FLAG_VALUE(FLAG)) { \
456 printk(KERN_EMERG "EXT4 flag fail: " #FLAG ": %d %d\n", \
457 EXT4_##FLAG##_FL, EXT4_INODE_##FLAG); BUG_ON(1); }
473 static inline void ext4_check_flag_values(
void)
511 #if defined(__KERNEL__) && defined(CONFIG_COMPAT)
512 struct compat_ext4_new_group_input {
548 #define EXT4_GET_BLOCKS_CREATE 0x0001
550 #define EXT4_GET_BLOCKS_UNINIT_EXT 0x0002
551 #define EXT4_GET_BLOCKS_CREATE_UNINIT_EXT (EXT4_GET_BLOCKS_UNINIT_EXT|\
552 EXT4_GET_BLOCKS_CREATE)
556 #define EXT4_GET_BLOCKS_DELALLOC_RESERVE 0x0004
560 #define EXT4_GET_BLOCKS_PRE_IO 0x0008
561 #define EXT4_GET_BLOCKS_CONVERT 0x0010
562 #define EXT4_GET_BLOCKS_IO_CREATE_EXT (EXT4_GET_BLOCKS_PRE_IO|\
563 EXT4_GET_BLOCKS_CREATE_UNINIT_EXT)
565 #define EXT4_GET_BLOCKS_IO_CONVERT_EXT (EXT4_GET_BLOCKS_CONVERT|\
566 EXT4_GET_BLOCKS_CREATE_UNINIT_EXT)
568 #define EXT4_GET_BLOCKS_PUNCH_OUT_EXT 0x0020
570 #define EXT4_GET_BLOCKS_NO_NORMALIZE 0x0040
572 #define EXT4_GET_BLOCKS_KEEP_SIZE 0x0080
574 #define EXT4_GET_BLOCKS_NO_LOCK 0x0100
579 #define EXT4_FREE_BLOCKS_METADATA 0x0001
580 #define EXT4_FREE_BLOCKS_FORGET 0x0002
581 #define EXT4_FREE_BLOCKS_VALIDATED 0x0004
582 #define EXT4_FREE_BLOCKS_NO_QUOT_UPDATE 0x0008
583 #define EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER 0x0010
584 #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER 0x0020
589 #define EXT4_DISCARD_PARTIAL_PG_ZERO_UNMAPPED 0x0001
594 #define EXT4_IOC_GETFLAGS FS_IOC_GETFLAGS
595 #define EXT4_IOC_SETFLAGS FS_IOC_SETFLAGS
596 #define EXT4_IOC_GETVERSION _IOR('f', 3, long)
597 #define EXT4_IOC_SETVERSION _IOW('f', 4, long)
598 #define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
599 #define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
600 #define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
601 #define EXT4_IOC_SETRSVSZ _IOW('f', 6, long)
602 #define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
603 #define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
604 #define EXT4_IOC_MIGRATE _IO('f', 9)
607 #define EXT4_IOC_ALLOC_DA_BLKS _IO('f', 12)
608 #define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
609 #define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
611 #if defined(__KERNEL__) && defined(CONFIG_COMPAT)
615 #define EXT4_IOC32_GETFLAGS FS_IOC32_GETFLAGS
616 #define EXT4_IOC32_SETFLAGS FS_IOC32_SETFLAGS
617 #define EXT4_IOC32_GETVERSION _IOR('f', 3, int)
618 #define EXT4_IOC32_SETVERSION _IOW('f', 4, int)
619 #define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
620 #define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
621 #define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
622 #define EXT4_IOC32_GROUP_ADD _IOW('f', 8, struct compat_ext4_new_group_input)
623 #define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
624 #define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
628 #define EXT4_MAX_BLOCK_FILE_PHYS 0xFFFFFFFF
702 #define EXT4_EPOCH_BITS 2
703 #define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
704 #define EXT4_NSEC_MASK (~0UL << EXT4_EPOCH_BITS)
716 #define EXT4_FITS_IN_INODE(ext4_inode, einode, field) \
717 ((offsetof(typeof(*ext4_inode), field) + \
718 sizeof((ext4_inode)->field)) \
719 <= (EXT4_GOOD_OLD_INODE_SIZE + \
720 (einode)->i_extra_isize)) \
731 if (
sizeof(time->
tv_sec) > 4)
737 #define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \
739 (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \
740 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
741 (raw_inode)->xtime ## _extra = \
742 ext4_encode_extra_time(&(inode)->xtime); \
745 #define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
747 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
748 (raw_inode)->xtime = cpu_to_le32((einode)->xtime.tv_sec); \
749 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
750 (raw_inode)->xtime ## _extra = \
751 ext4_encode_extra_time(&(einode)->xtime); \
754 #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \
756 (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \
757 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
758 ext4_decode_extra_time(&(inode)->xtime, \
759 raw_inode->xtime ## _extra); \
761 (inode)->xtime.tv_nsec = 0; \
764 #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
766 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
767 (einode)->xtime.tv_sec = \
768 (signed)le32_to_cpu((raw_inode)->xtime); \
769 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
770 ext4_decode_extra_time(&(einode)->xtime, \
771 raw_inode->xtime ## _extra); \
773 (einode)->xtime.tv_nsec = 0; \
776 #define i_disk_version osd1.linux1.l_i_version
778 #if defined(__KERNEL__) || defined(__linux__)
779 #define i_reserved1 osd1.linux1.l_i_reserved1
780 #define i_file_acl_high osd2.linux2.l_i_file_acl_high
781 #define i_blocks_high osd2.linux2.l_i_blocks_high
782 #define i_uid_low i_uid
783 #define i_gid_low i_gid
784 #define i_uid_high osd2.linux2.l_i_uid_high
785 #define i_gid_high osd2.linux2.l_i_gid_high
786 #define i_checksum_lo osd2.linux2.l_i_checksum_lo
788 #elif defined(__GNU__)
790 #define i_translator osd1.hurd1.h_i_translator
791 #define i_uid_high osd2.hurd2.h_i_uid_high
792 #define i_gid_high osd2.hurd2.h_i_gid_high
793 #define i_author osd2.hurd2.h_i_author
795 #elif defined(__masix__)
797 #define i_reserved1 osd1.masix1.m_i_reserved1
798 #define i_file_acl_high osd2.masix2.m_i_file_acl_high
799 #define i_reserved2 osd2.masix2.m_i_reserved2
831 #if (BITS_PER_LONG < 64)
836 #ifdef CONFIG_EXT4_FS_XATTR
932 #define EXT4_VALID_FS 0x0001
933 #define EXT4_ERROR_FS 0x0002
934 #define EXT4_ORPHAN_FS 0x0004
939 #define EXT2_FLAGS_SIGNED_HASH 0x0001
940 #define EXT2_FLAGS_UNSIGNED_HASH 0x0002
941 #define EXT2_FLAGS_TEST_FILESYS 0x0004
946 #define EXT4_MOUNT_GRPID 0x00004
947 #define EXT4_MOUNT_DEBUG 0x00008
948 #define EXT4_MOUNT_ERRORS_CONT 0x00010
949 #define EXT4_MOUNT_ERRORS_RO 0x00020
950 #define EXT4_MOUNT_ERRORS_PANIC 0x00040
951 #define EXT4_MOUNT_ERRORS_MASK 0x00070
952 #define EXT4_MOUNT_MINIX_DF 0x00080
953 #define EXT4_MOUNT_NOLOAD 0x00100
954 #define EXT4_MOUNT_DATA_FLAGS 0x00C00
955 #define EXT4_MOUNT_JOURNAL_DATA 0x00400
956 #define EXT4_MOUNT_ORDERED_DATA 0x00800
957 #define EXT4_MOUNT_WRITEBACK_DATA 0x00C00
958 #define EXT4_MOUNT_UPDATE_JOURNAL 0x01000
959 #define EXT4_MOUNT_NO_UID32 0x02000
960 #define EXT4_MOUNT_XATTR_USER 0x04000
961 #define EXT4_MOUNT_POSIX_ACL 0x08000
962 #define EXT4_MOUNT_NO_AUTO_DA_ALLOC 0x10000
963 #define EXT4_MOUNT_BARRIER 0x20000
964 #define EXT4_MOUNT_QUOTA 0x80000
965 #define EXT4_MOUNT_USRQUOTA 0x100000
966 #define EXT4_MOUNT_GRPQUOTA 0x200000
967 #define EXT4_MOUNT_DIOREAD_NOLOCK 0x400000
968 #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000
969 #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000
970 #define EXT4_MOUNT_MBLK_IO_SUBMIT 0x4000000
971 #define EXT4_MOUNT_DELALLOC 0x8000000
972 #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000
973 #define EXT4_MOUNT_BLOCK_VALIDITY 0x20000000
974 #define EXT4_MOUNT_DISCARD 0x40000000
975 #define EXT4_MOUNT_INIT_INODE_TABLE 0x80000000
977 #define EXT4_MOUNT2_EXPLICIT_DELALLOC 0x00000001
980 #define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \
982 #define set_opt(sb, opt) EXT4_SB(sb)->s_mount_opt |= \
984 #define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & \
987 #define clear_opt2(sb, opt) EXT4_SB(sb)->s_mount_opt2 &= \
989 #define set_opt2(sb, opt) EXT4_SB(sb)->s_mount_opt2 |= \
991 #define test_opt2(sb, opt) (EXT4_SB(sb)->s_mount_opt2 & \
994 #define ext4_test_and_set_bit __test_and_set_bit_le
995 #define ext4_set_bit __set_bit_le
996 #define ext4_set_bit_atomic ext2_set_bit_atomic
997 #define ext4_test_and_clear_bit __test_and_clear_bit_le
998 #define ext4_clear_bit __clear_bit_le
999 #define ext4_clear_bit_atomic ext2_clear_bit_atomic
1000 #define ext4_test_bit test_bit_le
1001 #define ext4_find_next_zero_bit find_next_zero_bit_le
1002 #define ext4_find_next_bit find_next_bit_le
1009 #define EXT4_DFL_MAX_MNT_COUNT 20
1010 #define EXT4_DFL_CHECKINTERVAL 0
1015 #define EXT4_ERRORS_CONTINUE 1
1016 #define EXT4_ERRORS_RO 2
1017 #define EXT4_ERRORS_PANIC 3
1018 #define EXT4_ERRORS_DEFAULT EXT4_ERRORS_CONTINUE
1021 #define EXT4_CRC32C_CHKSUM 1
1118 #define EXT4_S_ERR_START offsetof(struct ext4_super_block, s_error_count)
1130 #define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts)
1139 #define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START)
1146 #define EXT4_MF_MNTDIR_SAMPLED 0x0001
1147 #define EXT4_MF_FS_ABORTED 0x0002
1152 struct ext4_sb_info {
1153 unsigned long s_desc_size;
1154 unsigned long s_inodes_per_block;
1155 unsigned long s_blocks_per_group;
1156 unsigned long s_clusters_per_group;
1157 unsigned long s_inodes_per_group;
1158 unsigned long s_itb_per_group;
1159 unsigned long s_gdb_count;
1160 unsigned long s_desc_per_block;
1163 unsigned long s_overhead;
1164 unsigned int s_cluster_ratio;
1165 unsigned int s_cluster_bits;
1166 loff_t s_bitmap_maxbytes;
1167 struct buffer_head * s_sbh;
1169 struct buffer_head **s_group_desc;
1170 unsigned int s_mount_opt;
1171 unsigned int s_mount_opt2;
1172 unsigned int s_mount_flags;
1173 unsigned int s_def_mount_opt;
1177 unsigned short s_mount_state;
1178 unsigned short s_pad;
1179 int s_addr_per_block_bits;
1180 int s_desc_per_block_bits;
1183 unsigned int s_inode_readahead_blks;
1184 unsigned int s_inode_goal;
1186 u32 s_next_generation;
1188 int s_def_hash_version;
1189 int s_hash_unsigned;
1203 struct mutex s_orphan_lock;
1204 unsigned long s_resize_flags;
1206 unsigned long s_commit_interval;
1207 u32 s_max_batch_time;
1208 u32 s_min_batch_time;
1214 unsigned int s_want_extra_isize;
1217 #ifdef EXTENTS_STATS
1219 unsigned long s_ext_min;
1220 unsigned long s_ext_max;
1221 unsigned long s_depth_max;
1223 unsigned long s_ext_blocks;
1224 unsigned long s_ext_extents;
1228 struct ext4_group_info ***s_group_info;
1229 struct inode *s_buddy_cache;
1231 unsigned short *s_mb_offsets;
1232 unsigned int *s_mb_maxs;
1233 unsigned int s_group_info_size;
1236 unsigned long s_stripe;
1237 unsigned int s_mb_stream_request;
1238 unsigned int s_mb_max_to_scan;
1239 unsigned int s_mb_min_to_scan;
1240 unsigned int s_mb_stats;
1241 unsigned int s_mb_order2_reqs;
1242 unsigned int s_mb_group_prealloc;
1243 unsigned int s_max_writeback_mb_bump;
1244 unsigned int s_max_dir_size_kb;
1246 unsigned long s_mb_last_group;
1247 unsigned long s_mb_last_start;
1258 unsigned long s_mb_buddies_generated;
1259 unsigned long long s_mb_generation_time;
1269 unsigned long s_sectors_written_start;
1270 u64 s_kbytes_written;
1273 unsigned int s_extent_max_zeroout_kb;
1275 unsigned int s_log_groups_per_flex;
1286 struct ext4_li_request *s_li_request;
1288 unsigned int s_li_wait_mult;
1318 static inline int ext4_valid_inum(
struct super_block *
sb,
unsigned long ino)
1329 static inline void ext4_set_io_unwritten_flag(
struct inode *
inode,
1338 static inline ext4_io_end_t *ext4_inode_aio(
struct inode *inode)
1343 static inline void ext4_inode_aio_set(
struct inode *inode,
ext4_io_end_t *
io)
1355 EXT4_STATE_NO_EXPAND,
1356 EXT4_STATE_DA_ALLOC_CLOSE,
1357 EXT4_STATE_EXT_MIGRATE,
1358 EXT4_STATE_DIO_UNWRITTEN,
1359 EXT4_STATE_NEWENTRY,
1360 EXT4_STATE_DELALLOC_RESERVED,
1361 EXT4_STATE_DIOREAD_LOCK,
1365 #define EXT4_INODE_BIT_FNS(name, field, offset) \
1366 static inline int ext4_test_inode_##name(struct inode *inode, int bit) \
1368 return test_bit(bit + (offset), &EXT4_I(inode)->i_##field); \
1370 static inline void ext4_set_inode_##name(struct inode *inode, int bit) \
1372 set_bit(bit + (offset), &EXT4_I(inode)->i_##field); \
1374 static inline void ext4_clear_inode_##name(struct inode *inode, int bit) \
1376 clear_bit(bit + (offset), &EXT4_I(inode)->i_##field); \
1380 #if (BITS_PER_LONG < 64)
1381 EXT4_INODE_BIT_FNS(
state, state_flags, 0)
1385 (ei)->i_state_flags = 0;
1399 #define EXT4_SB(sb) (sb)
1402 #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
1407 #define EXT4_OS_LINUX 0
1408 #define EXT4_OS_HURD 1
1409 #define EXT4_OS_MASIX 2
1410 #define EXT4_OS_FREEBSD 3
1411 #define EXT4_OS_LITES 4
1416 #define EXT4_GOOD_OLD_REV 0
1417 #define EXT4_DYNAMIC_REV 1
1419 #define EXT4_CURRENT_REV EXT4_GOOD_OLD_REV
1420 #define EXT4_MAX_SUPP_REV EXT4_DYNAMIC_REV
1422 #define EXT4_GOOD_OLD_INODE_SIZE 128
1428 #define EXT4_HAS_COMPAT_FEATURE(sb,mask) \
1429 ((EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask)) != 0)
1430 #define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \
1431 ((EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask)) != 0)
1432 #define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \
1433 ((EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask)) != 0)
1434 #define EXT4_SET_COMPAT_FEATURE(sb,mask) \
1435 EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
1436 #define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \
1437 EXT4_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
1438 #define EXT4_SET_INCOMPAT_FEATURE(sb,mask) \
1439 EXT4_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
1440 #define EXT4_CLEAR_COMPAT_FEATURE(sb,mask) \
1441 EXT4_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
1442 #define EXT4_CLEAR_RO_COMPAT_FEATURE(sb,mask) \
1443 EXT4_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
1444 #define EXT4_CLEAR_INCOMPAT_FEATURE(sb,mask) \
1445 EXT4_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
1447 #define EXT4_FEATURE_COMPAT_DIR_PREALLOC 0x0001
1448 #define EXT4_FEATURE_COMPAT_IMAGIC_INODES 0x0002
1449 #define EXT4_FEATURE_COMPAT_HAS_JOURNAL 0x0004
1450 #define EXT4_FEATURE_COMPAT_EXT_ATTR 0x0008
1451 #define EXT4_FEATURE_COMPAT_RESIZE_INODE 0x0010
1452 #define EXT4_FEATURE_COMPAT_DIR_INDEX 0x0020
1454 #define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
1455 #define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
1456 #define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
1457 #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008
1458 #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010
1459 #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
1460 #define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
1461 #define EXT4_FEATURE_RO_COMPAT_QUOTA 0x0100
1462 #define EXT4_FEATURE_RO_COMPAT_BIGALLOC 0x0200
1469 #define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400
1471 #define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
1472 #define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
1473 #define EXT4_FEATURE_INCOMPAT_RECOVER 0x0004
1474 #define EXT4_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
1475 #define EXT4_FEATURE_INCOMPAT_META_BG 0x0010
1476 #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040
1477 #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
1478 #define EXT4_FEATURE_INCOMPAT_MMP 0x0100
1479 #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
1480 #define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400
1481 #define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000
1482 #define EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM 0x2000
1483 #define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000
1484 #define EXT4_FEATURE_INCOMPAT_INLINEDATA 0x8000
1486 #define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR
1487 #define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \
1488 EXT4_FEATURE_INCOMPAT_META_BG)
1489 #define EXT2_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
1490 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
1491 EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
1493 #define EXT3_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR
1494 #define EXT3_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \
1495 EXT4_FEATURE_INCOMPAT_RECOVER| \
1496 EXT4_FEATURE_INCOMPAT_META_BG)
1497 #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
1498 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
1499 EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
1501 #define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
1502 #define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \
1503 EXT4_FEATURE_INCOMPAT_RECOVER| \
1504 EXT4_FEATURE_INCOMPAT_META_BG| \
1505 EXT4_FEATURE_INCOMPAT_EXTENTS| \
1506 EXT4_FEATURE_INCOMPAT_64BIT| \
1507 EXT4_FEATURE_INCOMPAT_FLEX_BG| \
1508 EXT4_FEATURE_INCOMPAT_MMP)
1509 #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
1510 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
1511 EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
1512 EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
1513 EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
1514 EXT4_FEATURE_RO_COMPAT_BTREE_DIR |\
1515 EXT4_FEATURE_RO_COMPAT_HUGE_FILE |\
1516 EXT4_FEATURE_RO_COMPAT_BIGALLOC |\
1517 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\
1518 EXT4_FEATURE_RO_COMPAT_QUOTA)
1523 #define EXT4_DEF_RESUID 0
1524 #define EXT4_DEF_RESGID 0
1526 #define EXT4_DEF_INODE_READAHEAD_BLKS 32
1531 #define EXT4_DEFM_DEBUG 0x0001
1532 #define EXT4_DEFM_BSDGROUPS 0x0002
1533 #define EXT4_DEFM_XATTR_USER 0x0004
1534 #define EXT4_DEFM_ACL 0x0008
1535 #define EXT4_DEFM_UID16 0x0010
1536 #define EXT4_DEFM_JMODE 0x0060
1537 #define EXT4_DEFM_JMODE_DATA 0x0020
1538 #define EXT4_DEFM_JMODE_ORDERED 0x0040
1539 #define EXT4_DEFM_JMODE_WBACK 0x0060
1540 #define EXT4_DEFM_NOBARRIER 0x0100
1541 #define EXT4_DEFM_BLOCK_VALIDITY 0x0200
1542 #define EXT4_DEFM_DISCARD 0x0400
1543 #define EXT4_DEFM_NODELALLOC 0x0800
1548 #define EXT4_DEF_MIN_BATCH_TIME 0
1549 #define EXT4_DEF_MAX_BATCH_TIME 15000
1555 #define EXT4_FLEX_SIZE_DIR_ALLOC_SCHEME 4
1560 #define EXT4_NAME_LEN 255
1599 #define EXT4_FT_UNKNOWN 0
1600 #define EXT4_FT_REG_FILE 1
1601 #define EXT4_FT_DIR 2
1602 #define EXT4_FT_CHRDEV 3
1603 #define EXT4_FT_BLKDEV 4
1604 #define EXT4_FT_FIFO 5
1605 #define EXT4_FT_SOCK 6
1606 #define EXT4_FT_SYMLINK 7
1608 #define EXT4_FT_MAX 8
1610 #define EXT4_FT_DIR_CSUM 0xDE
1617 #define EXT4_DIR_PAD 4
1618 #define EXT4_DIR_ROUND (EXT4_DIR_PAD - 1)
1619 #define EXT4_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT4_DIR_ROUND) & \
1621 #define EXT4_MAX_REC_LEN ((1<<16)-1)
1627 static inline unsigned int
1628 ext4_rec_len_from_disk(
__le16 dlen,
unsigned blocksize)
1632 #if (PAGE_CACHE_SIZE >= 65536)
1635 return (len & 65532) | ((len & 3) << 16);
1641 static inline __le16 ext4_rec_len_to_disk(
unsigned len,
unsigned blocksize)
1643 if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3))
1645 #if (PAGE_CACHE_SIZE >= 65536)
1648 if (len == blocksize) {
1649 if (blocksize == 65536)
1654 return cpu_to_le16((len & 65532) | ((len >> 16) & 3));
1665 #define is_dx(dir) (EXT4_HAS_COMPAT_FEATURE(dir->i_sb, \
1666 EXT4_FEATURE_COMPAT_DIR_INDEX) && \
1667 ext4_test_inode_flag((dir), EXT4_INODE_INDEX))
1668 #define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
1669 #define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
1673 #define DX_HASH_LEGACY 0
1674 #define DX_HASH_HALF_MD4 1
1675 #define DX_HASH_TEA 2
1676 #define DX_HASH_LEGACY_UNSIGNED 3
1677 #define DX_HASH_HALF_MD4_UNSIGNED 4
1678 #define DX_HASH_TEA_UNSIGNED 5
1680 static inline u32 ext4_chksum(
struct ext4_sb_info *sbi,
u32 crc,
1689 BUG_ON(crypto_shash_descsize(sbi->s_chksum_driver)!=
sizeof(
desc.ctx));
1691 desc.shash.tfm = sbi->s_chksum_driver;
1714 #define EXT4_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1)
1715 #define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1)
1721 #define HASH_NB_ALWAYS 1
1729 struct buffer_head *bh;
1734 static inline struct ext4_inode *ext4_raw_inode(
struct ext4_iloc *iloc)
1736 return (
struct ext4_inode *) (iloc->bh->b_data + iloc->offset);
1765 #define ERR_BAD_DX_DIR -75000
1773 #define EXT4_DEF_LI_WAIT_MULT 10
1774 #define EXT4_DEF_LI_MAX_START_DELAY 5
1775 #define EXT4_LAZYINIT_QUIT 0x0001
1776 #define EXT4_LAZYINIT_RUNNING 0x0002
1781 struct ext4_lazy_init {
1782 unsigned long li_state;
1784 struct mutex li_list_mtx;
1787 struct ext4_li_request {
1789 struct ext4_sb_info *lr_sbi;
1792 unsigned long lr_next_sched;
1793 unsigned long lr_timeout;
1796 struct ext4_features {
1808 #define EXT4_MMP_MAGIC 0x004D4D50U
1809 #define EXT4_MMP_SEQ_CLEAN 0xFF4D4D50U
1810 #define EXT4_MMP_SEQ_FSCK 0xE24D4D50U
1811 #define EXT4_MMP_SEQ_MAX 0xE24D4D4FU
1822 char mmp_nodename[64];
1823 char mmp_bdevname[32];
1830 __le16 mmp_check_interval;
1839 struct buffer_head *bh;
1851 #define EXT4_MMP_CHECK_MULT 2UL
1856 #define EXT4_MMP_MIN_CHECK_INTERVAL 5UL
1861 #define EXT4_MMP_MAX_CHECK_INTERVAL 300UL
1872 # define ATTRIB_NORET __attribute__((noreturn))
1873 # define NORET_AND noreturn,
1879 struct buffer_head *bh,
int sz);
1882 struct buffer_head *bh,
int sz);
1885 struct buffer_head *bh);
1888 struct buffer_head *bh);
1894 struct buffer_head *bh);
1895 extern unsigned int ext4_block_group(
struct super_block *sb,
1905 unsigned long *
count,
1908 s64 nclusters,
unsigned int flags);
1910 extern void ext4_check_blocks_bitmap(
struct super_block *);
1913 struct buffer_head ** bh);
1920 struct buffer_head *bh);
1924 struct buffer_head *bh,
1939 struct buffer_head *,
unsigned int);
1940 #define ext4_check_dir_entry(dir, filp, de, bh, offset) \
1941 unlikely(__ext4_check_dir_entry(__func__, __LINE__, (dir), (filp), \
1942 (de), (bh), (offset)))
1964 extern void ext4_check_inodes_bitmap(
struct super_block *);
1971 extern long ext4_mb_stats;
1972 extern long ext4_mb_max_to_scan;
1977 extern int ext4_mb_reserve_blocks(
struct super_block *,
int);
1993 struct buffer_head *
ext4_getblk(handle_t *,
struct inode *,
1995 struct buffer_head *
ext4_bread(handle_t *,
struct inode *,
1998 struct buffer_head *bh_result,
int create);
2007 extern int ext4_sync_inode(handle_t *,
struct inode *);
2025 extern qsize_t *ext4_get_reserved_space(
struct inode *inode);
2027 int used,
int quota_claim);
2034 unsigned long nr_segs);
2040 extern long ext4_ioctl(
struct file *,
unsigned int,
unsigned long);
2041 extern long ext4_compat_ioctl(
struct file *,
unsigned int,
unsigned long);
2075 #define ext4_error(sb, message...) __ext4_error(sb, __func__, \
2076 __LINE__, ## message)
2085 extern __printf(4, 5)
2088 #define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \
2089 __LINE__, ## message)
2093 #define ext4_warning(sb, message...) __ext4_warning(sb, __func__, \
2094 __LINE__, ## message)
2099 #define dump_mmp_msg(sb, mmp, msg) __dump_mmp_msg(sb, mmp, __func__, \
2104 unsigned long, ext4_fsblk_t,
2106 #define ext4_grp_locked_error(sb, grp, message...) \
2107 __ext4_grp_locked_error(__func__, __LINE__, (sb), (grp), ## message)
2109 extern int ext4_update_compat_feature(handle_t *
handle,
struct super_block *sb,
2111 extern int ext4_update_rocompat_feature(handle_t *
handle,
2112 struct super_block *sb,
__u32 rocompat);
2113 extern int ext4_update_incompat_feature(handle_t *
handle,
2114 struct super_block *sb,
__u32 incompat);
2149 static inline int ext4_has_group_desc_csum(
struct super_block *sb)
2162 static inline ext4_fsblk_t ext4_r_blocks_count(
struct ext4_super_block *es)
2168 static inline ext4_fsblk_t ext4_free_blocks_count(
struct ext4_super_block *es)
2195 static inline loff_t ext4_isize(
struct ext4_inode *raw_inode)
2204 static inline void ext4_isize_set(
struct ext4_inode *raw_inode, loff_t
i_size)
2211 struct ext4_group_info *ext4_get_group_info(
struct super_block *sb,
2214 struct ext4_group_info ***grp_info;
2215 long indexv, indexh;
2216 grp_info =
EXT4_SB(sb)->s_group_info;
2217 indexv = group >> (EXT4_DESC_PER_BLOCK_BITS(sb));
2219 return grp_info[indexv][indexh];
2227 static inline ext4_group_t ext4_get_groups_count(
struct super_block *sb)
2229 ext4_group_t ngroups =
EXT4_SB(sb)->s_groups_count;
2235 static inline ext4_group_t ext4_flex_group(
struct ext4_sb_info *sbi,
2238 return block_group >> sbi->s_log_groups_per_flex;
2241 static inline unsigned int ext4_flex_bg_size(
struct ext4_sb_info *sbi)
2243 return 1 << sbi->s_log_groups_per_flex;
2246 #define ext4_std_error(sb, errno) \
2249 __ext4_std_error((sb), __func__, __LINE__, (errno)); \
2257 #define EXT4_FREECLUSTERS_WATERMARK (4 * (percpu_counter_batch * nr_cpu_ids))
2259 #define EXT4_FREECLUSTERS_WATERMARK 0
2262 static inline void ext4_update_i_disksize(
struct inode *inode, loff_t newsize)
2268 if (newsize >
EXT4_I(inode)->i_disksize)
2269 EXT4_I(inode)->i_disksize = newsize;
2274 struct ext4_group_info {
2275 unsigned long bb_state;
2292 #define EXT4_GROUP_INFO_NEED_INIT_BIT 0
2293 #define EXT4_GROUP_INFO_WAS_TRIMMED_BIT 1
2295 #define EXT4_MB_GRP_NEED_INIT(grp) \
2296 (test_bit(EXT4_GROUP_INFO_NEED_INIT_BIT, &((grp)->bb_state)))
2298 #define EXT4_MB_GRP_WAS_TRIMMED(grp) \
2299 (test_bit(EXT4_GROUP_INFO_WAS_TRIMMED_BIT, &((grp)->bb_state)))
2300 #define EXT4_MB_GRP_SET_TRIMMED(grp) \
2301 (set_bit(EXT4_GROUP_INFO_WAS_TRIMMED_BIT, &((grp)->bb_state)))
2302 #define EXT4_MB_GRP_CLEAR_TRIMMED(grp) \
2303 (clear_bit(EXT4_GROUP_INFO_WAS_TRIMMED_BIT, &((grp)->bb_state)))
2305 #define EXT4_MAX_CONTENTION 8
2306 #define EXT4_CONTENTION_THRESHOLD 2
2308 static inline spinlock_t *ext4_group_lock_ptr(
struct super_block *sb,
2311 return bgl_lock_ptr(
EXT4_SB(sb)->s_blockgroup_lock, group);
2318 static inline int ext4_fs_is_busy(
struct ext4_sb_info *sbi)
2320 return (
atomic_read(&sbi->s_lock_busy) > EXT4_CONTENTION_THRESHOLD);
2323 static inline void ext4_lock_group(
struct super_block *sb, ext4_group_t group)
2326 if (spin_trylock(lock))
2331 atomic_add_unless(&
EXT4_SB(sb)->s_lock_busy, -1, 0);
2337 atomic_add_unless(&
EXT4_SB(sb)->s_lock_busy, 1,
2338 EXT4_MAX_CONTENTION);
2343 static inline void ext4_unlock_group(
struct super_block *sb,
2346 spin_unlock(ext4_group_lock_ptr(sb, group));
2352 #define ext4_check_indirect_blockref(inode, bh) \
2353 ext4_check_blockref(__func__, __LINE__, inode, \
2354 (__le32 *)(bh)->b_data, \
2355 EXT4_ADDR_PER_BLOCK((inode)->i_sb))
2357 #define ext4_ind_check_inode(inode) \
2358 ext4_check_blockref(__func__, __LINE__, inode, \
2359 EXT4_I(inode)->i_data, \
2390 ext4_fsblk_t start_blk,
2391 unsigned int count);
2393 struct inode *,
__le32 *,
unsigned int);
2397 extern int ext4_ext_writepage_trans_blocks(
struct inode *,
int);
2437 struct mmp_struct *mmp);
2440 enum ext4_state_bits {
2443 BH_AllocFromCluster,
2462 #define BH_BITMAP_UPTODATE BH_JBDPrivateStart
2464 static inline int bitmap_uptodate(
struct buffer_head *bh)
2466 return (buffer_uptodate(bh) &&
2467 test_bit(BH_BITMAP_UPTODATE, &(bh)->b_state));
2469 static inline void set_bitmap_uptodate(
struct buffer_head *bh)
2471 set_bit(BH_BITMAP_UPTODATE, &(bh)->b_state);
2478 static inline void ext4_inode_block_unlocked_dio(
struct inode *inode)
2480 ext4_set_inode_state(inode, EXT4_STATE_DIOREAD_LOCK);
2483 static inline void ext4_inode_resume_unlocked_dio(
struct inode *inode)
2486 ext4_clear_inode_state(inode, EXT4_STATE_DIOREAD_LOCK);
2489 #define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
2492 #define EXT4_WQ_HASH_SZ 37
2493 #define ext4_ioend_wq(v) (&ext4__ioend_wq[((unsigned long)(v)) %\
2495 #define ext4_aio_mutex(v) (&ext4__aio_mutex[((unsigned long)(v)) %\
2500 #define EXT4_RESIZING 0