linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH, RFC] ext4: remove ext4_new_meta_block()
Date: Sun, 07 Dec 2008 19:30:45 -0600	[thread overview]
Message-ID: <493C78C5.8080805@redhat.com> (raw)
In-Reply-To: <1228678434-14707-2-git-send-email-tytso@mit.edu>

Theodore Ts'o wrote:
> 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: "Theodore Ts'o" <tytso@mit.edu>

Looks like a good idea to me.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/ext4/balloc.c  |   17 -----------------
>  fs/ext4/ext4.h    |    2 --
>  fs/ext4/extents.c |    3 ++-
>  fs/ext4/xattr.c   |    5 +++--
>  4 files changed, 5 insertions(+), 22 deletions(-)
> 
> diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
> index 02e8ce4..47cf25d 100644
> --- a/fs/ext4/balloc.c
> +++ b/fs/ext4/balloc.c
> @@ -724,23 +724,6 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
>  	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
>   * @sb:		superblock
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 74cb395..ac8551e 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -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 unsigned long ext4_bg_num_gdb(struct super_block *sb,
>  			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,
>  			ext4_fsblk_t goal, unsigned long *count, int *errp);
>  extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks);
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index ea2ce3c..e5b169b 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -189,9 +189,10 @@ ext4_ext_new_meta_block(handle_t *handle, struct inode *inode,
>  			struct ext4_extent *ex, int *err)
>  {
>  	ext4_fsblk_t goal, newblock;
> +	unsigned long count = 1;
>  
>  	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;
>  }
>  
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 80626d5..f896e2c 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -689,6 +689,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
>  		     struct ext4_xattr_info *i,
>  		     struct ext4_xattr_block_find *bs)
>  {
> +	unsigned long count = 1;
>  	struct super_block *sb = inode->i_sb;
>  	struct buffer_head *new_bh = NULL;
>  	struct ext4_xattr_search *s = &bs->s;
> @@ -810,8 +811,8 @@ inserted:
>  			/* We need to allocate a new block */
>  			ext4_fsblk_t goal = ext4_group_first_block_no(sb,
>  						EXT4_I(inode)->i_block_group);
> -			ext4_fsblk_t block = ext4_new_meta_block(handle, inode,
> -							goal, &error);
> +			ext4_fsblk_t block = ext4_new_meta_blocks(handle, inode,
> +						  goal, &count, &error);
>  			if (error)
>  				goto cleanup;
>  			ea_idebug(inode, "creating block %d", block);


  parent reply	other threads:[~2008-12-08  1:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-07 19:33 [PATCH, RFC] ext4: remove ext4_new_blocks() and call ext4_mb_new_blocks() directly Theodore Ts'o
2008-12-07 19:33 ` [PATCH, RFC] ext4: remove ext4_new_meta_block() Theodore Ts'o
2008-12-07 19:33   ` [PATCH, RFC] ext4: remove do_blk_alloc() Theodore Ts'o
2008-12-08  1:30   ` Eric Sandeen [this message]
2008-12-08  8:23 ` [PATCH, RFC] ext4: remove ext4_new_blocks() and call ext4_mb_new_blocks() directly Shen Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=493C78C5.8080805@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).