Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfe82c85 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: remove ext4_new_meta_block()



There were only two one callers of the function ext4_new_meta_block(),
which just a very simpler wrapper function around
ext4_new_meta_blocks().  Change those two functions to call
ext4_new_meta_blocks() directly, to save code and stack space usage.

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 815a1130
Loading
Loading
Loading
Loading
+0 −17
Original line number Original line Diff line number Diff line
@@ -724,23 +724,6 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
	return ret;
	return ret;
}
}


/*
 * ext4_new_meta_block() -- allocate block for meta data (indexing) blocks
 *
 * @handle:             handle to this transaction
 * @inode:              file inode
 * @goal:               given target block(filesystem wide)
 * @errp:               error code
 *
 * Return allocated block number on success
 */
ext4_fsblk_t ext4_new_meta_block(handle_t *handle, struct inode *inode,
		ext4_fsblk_t goal, int *errp)
{
	unsigned long count = 1;
	return ext4_new_meta_blocks(handle, inode, goal, &count, errp);
}

/**
/**
 * ext4_count_free_blocks() -- count filesystem free blocks
 * ext4_count_free_blocks() -- count filesystem free blocks
 * @sb:		superblock
 * @sb:		superblock
+0 −2
Original line number Original line Diff line number Diff line
@@ -998,8 +998,6 @@ extern ext4_grpblk_t ext4_block_group_offset(struct super_block *sb,
extern int ext4_bg_has_super(struct super_block *sb, ext4_group_t group);
extern int ext4_bg_has_super(struct super_block *sb, ext4_group_t group);
extern unsigned long ext4_bg_num_gdb(struct super_block *sb,
extern unsigned long ext4_bg_num_gdb(struct super_block *sb,
			ext4_group_t group);
			ext4_group_t group);
extern ext4_fsblk_t ext4_new_meta_block(handle_t *handle, struct inode *inode,
			ext4_fsblk_t goal, int *errp);
extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
			ext4_fsblk_t goal, unsigned long *count, int *errp);
			ext4_fsblk_t goal, unsigned long *count, int *errp);
extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks);
extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks);
+2 −1
Original line number Original line Diff line number Diff line
@@ -189,9 +189,10 @@ ext4_ext_new_meta_block(handle_t *handle, struct inode *inode,
			struct ext4_extent *ex, int *err)
			struct ext4_extent *ex, int *err)
{
{
	ext4_fsblk_t goal, newblock;
	ext4_fsblk_t goal, newblock;
	unsigned long count = 1;


	goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block));
	goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block));
	newblock = ext4_new_meta_block(handle, inode, goal, err);
	newblock = ext4_new_meta_blocks(handle, inode, goal, &count, err);
	return newblock;
	return newblock;
}
}


+3 −2
Original line number Original line Diff line number Diff line
@@ -689,6 +689,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
		     struct ext4_xattr_info *i,
		     struct ext4_xattr_info *i,
		     struct ext4_xattr_block_find *bs)
		     struct ext4_xattr_block_find *bs)
{
{
	unsigned long count = 1;
	struct super_block *sb = inode->i_sb;
	struct super_block *sb = inode->i_sb;
	struct buffer_head *new_bh = NULL;
	struct buffer_head *new_bh = NULL;
	struct ext4_xattr_search *s = &bs->s;
	struct ext4_xattr_search *s = &bs->s;
@@ -810,8 +811,8 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
			/* We need to allocate a new block */
			/* We need to allocate a new block */
			ext4_fsblk_t goal = ext4_group_first_block_no(sb,
			ext4_fsblk_t goal = ext4_group_first_block_no(sb,
						EXT4_I(inode)->i_block_group);
						EXT4_I(inode)->i_block_group);
			ext4_fsblk_t block = ext4_new_meta_block(handle, inode,
			ext4_fsblk_t block = ext4_new_meta_blocks(handle, inode,
							goal, &error);
						  goal, &count, &error);
			if (error)
			if (error)
				goto cleanup;
				goto cleanup;
			ea_idebug(inode, "creating block %d", block);
			ea_idebug(inode, "creating block %d", block);