ext2: remove ext2_new_block()
authorYe Bin <yebin10@huawei.com>
Tue, 15 Aug 2023 11:26:09 +0000 (19:26 +0800)
committerJan Kara <jack@suse.cz>
Wed, 16 Aug 2023 15:35:08 +0000 (17:35 +0200)
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>
fs/ext2/balloc.c
fs/ext2/ext2.h
fs/ext2/xattr.c

index eca60b747c6b54025f2e3b6044d28a912e6e50f8..ddaa823fc7f55acf6670a25e0dd7989b3d76d3b9 100644 (file)
@@ -1431,13 +1431,6 @@ out:
        return 0;
 }
 
-ext2_fsblk_t ext2_new_block(struct inode *inode, unsigned long goal, int *errp)
-{
-       unsigned long count = 1;
-
-       return ext2_new_blocks(inode, goal, &count, errp);
-}
-
 #ifdef EXT2FS_DEBUG
 
 unsigned long ext2_count_free(struct buffer_head *map, unsigned int numchars)
index 35a041c47c38fe670958dc3acb6bf7ce6b7f8fc0..954fb82ab22c595edac327319fc2940fa7124ff8 100644 (file)
@@ -695,7 +695,6 @@ static inline struct ext2_inode_info *EXT2_I(struct inode *inode)
 /* balloc.c */
 extern int ext2_bg_has_super(struct super_block *sb, int group);
 extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group);
-extern ext2_fsblk_t ext2_new_block(struct inode *, unsigned long, int *);
 extern ext2_fsblk_t ext2_new_blocks(struct inode *, unsigned long,
                                unsigned long *, int *);
 extern int ext2_data_block_valid(struct ext2_sb_info *sbi, ext2_fsblk_t start_blk,
index 89517937d36c4e28a70cffcd2bec07315c1ddc83..06933eabac2653397fd83fe1b6f3143c3872f77a 100644 (file)
@@ -742,7 +742,9 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
                        /* We need to allocate a new block */
                        ext2_fsblk_t goal = ext2_group_first_block_no(sb,
                                                EXT2_I(inode)->i_block_group);
-                       ext2_fsblk_t block = ext2_new_block(inode, goal, &error);
+                       unsigned long count = 1;
+                       ext2_fsblk_t block = ext2_new_blocks(inode, goal,
+                                                            &count, &error);
                        if (error)
                                goto cleanup;
                        ea_idebug(inode, "creating block %lu", block);