|
@@ -239,8 +239,11 @@ struct ext4_io_submit {
|
|
# define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size)
|
|
# define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size)
|
|
#endif
|
|
#endif
|
|
#define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof(__u32))
|
|
#define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof(__u32))
|
|
|
|
+#define EXT4_CLUSTER_SIZE(s) (EXT4_BLOCK_SIZE(s) << \
|
|
|
|
+ EXT4_SB(s)->s_cluster_bits)
|
|
#ifdef __KERNEL__
|
|
#ifdef __KERNEL__
|
|
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
|
|
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
|
|
|
|
+# define EXT4_CLUSTER_BITS(s) (EXT4_SB(s)->s_cluster_bits)
|
|
#else
|
|
#else
|
|
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
|
|
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
|
|
#endif
|
|
#endif
|
|
@@ -306,6 +309,7 @@ struct flex_groups {
|
|
#define EXT4_DESC_SIZE(s) (EXT4_SB(s)->s_desc_size)
|
|
#define EXT4_DESC_SIZE(s) (EXT4_SB(s)->s_desc_size)
|
|
#ifdef __KERNEL__
|
|
#ifdef __KERNEL__
|
|
# define EXT4_BLOCKS_PER_GROUP(s) (EXT4_SB(s)->s_blocks_per_group)
|
|
# define EXT4_BLOCKS_PER_GROUP(s) (EXT4_SB(s)->s_blocks_per_group)
|
|
|
|
+# define EXT4_CLUSTERS_PER_GROUP(s) (EXT4_SB(s)->s_clusters_per_group)
|
|
# define EXT4_DESC_PER_BLOCK(s) (EXT4_SB(s)->s_desc_per_block)
|
|
# define EXT4_DESC_PER_BLOCK(s) (EXT4_SB(s)->s_desc_per_block)
|
|
# define EXT4_INODES_PER_GROUP(s) (EXT4_SB(s)->s_inodes_per_group)
|
|
# define EXT4_INODES_PER_GROUP(s) (EXT4_SB(s)->s_inodes_per_group)
|
|
# define EXT4_DESC_PER_BLOCK_BITS(s) (EXT4_SB(s)->s_desc_per_block_bits)
|
|
# define EXT4_DESC_PER_BLOCK_BITS(s) (EXT4_SB(s)->s_desc_per_block_bits)
|
|
@@ -975,9 +979,9 @@ struct ext4_super_block {
|
|
/*10*/ __le32 s_free_inodes_count; /* Free inodes count */
|
|
/*10*/ __le32 s_free_inodes_count; /* Free inodes count */
|
|
__le32 s_first_data_block; /* First Data Block */
|
|
__le32 s_first_data_block; /* First Data Block */
|
|
__le32 s_log_block_size; /* Block size */
|
|
__le32 s_log_block_size; /* Block size */
|
|
- __le32 s_obso_log_frag_size; /* Obsoleted fragment size */
|
|
|
|
|
|
+ __le32 s_log_cluster_size; /* Allocation cluster size */
|
|
/*20*/ __le32 s_blocks_per_group; /* # Blocks per group */
|
|
/*20*/ __le32 s_blocks_per_group; /* # Blocks per group */
|
|
- __le32 s_obso_frags_per_group; /* Obsoleted fragments per group */
|
|
|
|
|
|
+ __le32 s_clusters_per_group; /* # Clusters per group */
|
|
__le32 s_inodes_per_group; /* # Inodes per group */
|
|
__le32 s_inodes_per_group; /* # Inodes per group */
|
|
__le32 s_mtime; /* Mount time */
|
|
__le32 s_mtime; /* Mount time */
|
|
/*30*/ __le32 s_wtime; /* Write time */
|
|
/*30*/ __le32 s_wtime; /* Write time */
|
|
@@ -1073,7 +1077,10 @@ struct ext4_super_block {
|
|
__u8 s_last_error_func[32]; /* function where the error happened */
|
|
__u8 s_last_error_func[32]; /* function where the error happened */
|
|
#define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts)
|
|
#define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts)
|
|
__u8 s_mount_opts[64];
|
|
__u8 s_mount_opts[64];
|
|
- __le32 s_reserved[112]; /* Padding to the end of the block */
|
|
|
|
|
|
+ __le32 s_usr_quota_inum; /* inode for tracking user quota */
|
|
|
|
+ __le32 s_grp_quota_inum; /* inode for tracking group quota */
|
|
|
|
+ __le32 s_overhead_clusters; /* overhead blocks/clusters in fs */
|
|
|
|
+ __le32 s_reserved[109]; /* Padding to the end of the block */
|
|
};
|
|
};
|
|
|
|
|
|
#define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START)
|
|
#define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START)
|
|
@@ -1093,6 +1100,7 @@ struct ext4_sb_info {
|
|
unsigned long s_desc_size; /* Size of a group descriptor in bytes */
|
|
unsigned long s_desc_size; /* Size of a group descriptor in bytes */
|
|
unsigned long s_inodes_per_block;/* Number of inodes per block */
|
|
unsigned long s_inodes_per_block;/* Number of inodes per block */
|
|
unsigned long s_blocks_per_group;/* Number of blocks in a group */
|
|
unsigned long s_blocks_per_group;/* Number of blocks in a group */
|
|
|
|
+ unsigned long s_clusters_per_group; /* Number of clusters in a group */
|
|
unsigned long s_inodes_per_group;/* Number of inodes in a group */
|
|
unsigned long s_inodes_per_group;/* Number of inodes in a group */
|
|
unsigned long s_itb_per_group; /* Number of inode table blocks per group */
|
|
unsigned long s_itb_per_group; /* Number of inode table blocks per group */
|
|
unsigned long s_gdb_count; /* Number of group descriptor blocks */
|
|
unsigned long s_gdb_count; /* Number of group descriptor blocks */
|
|
@@ -1101,6 +1109,8 @@ struct ext4_sb_info {
|
|
ext4_group_t s_blockfile_groups;/* Groups acceptable for non-extent files */
|
|
ext4_group_t s_blockfile_groups;/* Groups acceptable for non-extent files */
|
|
unsigned long s_overhead_last; /* Last calculated overhead */
|
|
unsigned long s_overhead_last; /* Last calculated overhead */
|
|
unsigned long s_blocks_last; /* Last seen block count */
|
|
unsigned long s_blocks_last; /* Last seen block count */
|
|
|
|
+ unsigned int s_cluster_ratio; /* Number of blocks per cluster */
|
|
|
|
+ unsigned int s_cluster_bits; /* log2 of s_cluster_ratio */
|
|
loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */
|
|
loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */
|
|
struct buffer_head * s_sbh; /* Buffer containing the super block */
|
|
struct buffer_head * s_sbh; /* Buffer containing the super block */
|
|
struct ext4_super_block *s_es; /* Pointer to the super block in the buffer */
|
|
struct ext4_super_block *s_es; /* Pointer to the super block in the buffer */
|
|
@@ -1367,6 +1377,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
|
|
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
|
|
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
|
|
#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
|
|
#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
|
|
#define EXT4_FEATURE_RO_COMPAT_QUOTA 0x0100
|
|
#define EXT4_FEATURE_RO_COMPAT_QUOTA 0x0100
|
|
|
|
+#define EXT4_FEATURE_RO_COMPAT_BIGALLOC 0x0200
|
|
|
|
|
|
#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
|
|
#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
|
|
#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
|
|
#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
|