summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 9ebde0cd632e..a2bb7d2870e4 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -961,7 +961,7 @@ struct ext4_inode_info {
961 /* 961 /*
962 * i_block_group is the number of the block group which contains 962 * i_block_group is the number of the block group which contains
963 * this file's inode. Constant across the lifetime of the inode, 963 * this file's inode. Constant across the lifetime of the inode,
964 * it is ued for making block allocation decisions - we try to 964 * it is used for making block allocation decisions - we try to
965 * place a file's data blocks near its inode block, and new inodes 965 * place a file's data blocks near its inode block, and new inodes
966 * near to their parent directory's inode. 966 * near to their parent directory's inode.
967 */ 967 */
@@ -1049,10 +1049,8 @@ struct ext4_inode_info {
1049 ext4_group_t i_last_alloc_group; 1049 ext4_group_t i_last_alloc_group;
1050 1050
1051 /* allocation reservation info for delalloc */ 1051 /* allocation reservation info for delalloc */
1052 /* In case of bigalloc, these refer to clusters rather than blocks */ 1052 /* In case of bigalloc, this refer to clusters rather than blocks */
1053 unsigned int i_reserved_data_blocks; 1053 unsigned int i_reserved_data_blocks;
1054 unsigned int i_reserved_meta_blocks;
1055 unsigned int i_allocated_meta_blocks;
1056 ext4_lblk_t i_da_metadata_calc_last_lblock; 1054 ext4_lblk_t i_da_metadata_calc_last_lblock;
1057 int i_da_metadata_calc_len; 1055 int i_da_metadata_calc_len;
1058 1056
@@ -2022,7 +2020,8 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
2022 2020
2023#define is_dx(dir) (ext4_has_feature_dir_index((dir)->i_sb) && \ 2021#define is_dx(dir) (ext4_has_feature_dir_index((dir)->i_sb) && \
2024 ext4_test_inode_flag((dir), EXT4_INODE_INDEX)) 2022 ext4_test_inode_flag((dir), EXT4_INODE_INDEX))
2025#define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX) 2023#define EXT4_DIR_LINK_MAX(dir) unlikely((dir)->i_nlink >= EXT4_LINK_MAX && \
2024 !(ext4_has_feature_dir_nlink((dir)->i_sb) && is_dx(dir)))
2026#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1) 2025#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
2027 2026
2028/* Legal values for the dx_root hash_version field: */ 2027/* Legal values for the dx_root hash_version field: */
@@ -2462,6 +2461,8 @@ extern void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid);
2462int ext4_inode_is_fast_symlink(struct inode *inode); 2461int ext4_inode_is_fast_symlink(struct inode *inode);
2463struct buffer_head *ext4_getblk(handle_t *, struct inode *, ext4_lblk_t, int); 2462struct buffer_head *ext4_getblk(handle_t *, struct inode *, ext4_lblk_t, int);
2464struct buffer_head *ext4_bread(handle_t *, struct inode *, ext4_lblk_t, int); 2463struct buffer_head *ext4_bread(handle_t *, struct inode *, ext4_lblk_t, int);
2464int ext4_bread_batch(struct inode *inode, ext4_lblk_t block, int bh_count,
2465 bool wait, struct buffer_head **bhs);
2465int ext4_get_block_unwritten(struct inode *inode, sector_t iblock, 2466int ext4_get_block_unwritten(struct inode *inode, sector_t iblock,
2466 struct buffer_head *bh_result, int create); 2467 struct buffer_head *bh_result, int create);
2467int ext4_get_block(struct inode *inode, sector_t iblock, 2468int ext4_get_block(struct inode *inode, sector_t iblock,
@@ -3074,7 +3075,7 @@ extern int ext4_handle_dirty_dirent_node(handle_t *handle,
3074 struct inode *inode, 3075 struct inode *inode,
3075 struct buffer_head *bh); 3076 struct buffer_head *bh);
3076#define S_SHIFT 12 3077#define S_SHIFT 12
3077static const unsigned char ext4_type_by_mode[S_IFMT >> S_SHIFT] = { 3078static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = {
3078 [S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE, 3079 [S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE,
3079 [S_IFDIR >> S_SHIFT] = EXT4_FT_DIR, 3080 [S_IFDIR >> S_SHIFT] = EXT4_FT_DIR,
3080 [S_IFCHR >> S_SHIFT] = EXT4_FT_CHRDEV, 3081 [S_IFCHR >> S_SHIFT] = EXT4_FT_CHRDEV,