Skip to content

Commit 2445a8a

Browse files
Ye Binjankara
authored andcommitted
ext2: remove ext2_new_block()
Now, only xattr allocate block use ext2_new_block(), so just opencode it in the xattr code. Signed-off-by: Ye Bin <yebin10@huawei.com> Message-Id: <20230815112612.221145-2-yebin10@huawei.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent e880763 commit 2445a8a

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

fs/ext2/balloc.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,13 +1431,6 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
14311431
return 0;
14321432
}
14331433

1434-
ext2_fsblk_t ext2_new_block(struct inode *inode, unsigned long goal, int *errp)
1435-
{
1436-
unsigned long count = 1;
1437-
1438-
return ext2_new_blocks(inode, goal, &count, errp);
1439-
}
1440-
14411434
#ifdef EXT2FS_DEBUG
14421435

14431436
unsigned long ext2_count_free(struct buffer_head *map, unsigned int numchars)

fs/ext2/ext2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,6 @@ static inline struct ext2_inode_info *EXT2_I(struct inode *inode)
695695
/* balloc.c */
696696
extern int ext2_bg_has_super(struct super_block *sb, int group);
697697
extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group);
698-
extern ext2_fsblk_t ext2_new_block(struct inode *, unsigned long, int *);
699698
extern ext2_fsblk_t ext2_new_blocks(struct inode *, unsigned long,
700699
unsigned long *, int *);
701700
extern int ext2_data_block_valid(struct ext2_sb_info *sbi, ext2_fsblk_t start_blk,

fs/ext2/xattr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,9 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
742742
/* We need to allocate a new block */
743743
ext2_fsblk_t goal = ext2_group_first_block_no(sb,
744744
EXT2_I(inode)->i_block_group);
745-
ext2_fsblk_t block = ext2_new_block(inode, goal, &error);
745+
unsigned long count = 1;
746+
ext2_fsblk_t block = ext2_new_blocks(inode, goal,
747+
&count, &error);
746748
if (error)
747749
goto cleanup;
748750
ea_idebug(inode, "creating block %lu", block);

0 commit comments

Comments
 (0)