public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-ext4@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Stephen Tweedie <sct@redhat.com>,
	adilger@clusterfs.com, Theodore Tso <tytso@MIT.EDU>
Subject: Re: [PATCH 1/4] ext4: use ext4_group_first_block_no()
Date: Tue, 19 Feb 2008 00:18:22 -0800	[thread overview]
Message-ID: <1203409102.3612.30.camel@localhost.localdomain> (raw)
In-Reply-To: <20080217060839.GH3390@APFDCB5C>

On Sun, 2008-02-17 at 15:08 +0900, Akinobu Mita wrote:
> Use ext4_group_first_block_no() and assign the return values to
> ext2_fsblk_t variables.
> 
Acked for ext2/3/4 patches(except a little typo in above change log:
ext4_fsblk_t). ext4 patch is queued in ext4 patch queue
http://repo.or.cz/w/ext4-patch-queue.git

Mingming

> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Stephen Tweedie <sct@redhat.com>
> Cc: adilger@clusterfs.com
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Mingming Cao <cmm@us.ibm.com>
> Cc: Theodore Tso <tytso@MIT.EDU>
> ---
>  fs/ext4/balloc.c |    6 +++---
>  fs/ext4/xattr.c  |    6 ++----
>  2 files changed, 5 insertions(+), 7 deletions(-)
> 
> Index: 2.6-rc/fs/ext4/xattr.c
> ===================================================================
> --- 2.6-rc.orig/fs/ext4/xattr.c
> +++ 2.6-rc/fs/ext4/xattr.c
> @@ -808,10 +808,8 @@ inserted:
>  			get_bh(new_bh);
>  		} else {
>  			/* We need to allocate a new block */
> -			ext4_fsblk_t goal = le32_to_cpu(
> -					EXT4_SB(sb)->s_es->s_first_data_block) +
> -				(ext4_fsblk_t)EXT4_I(inode)->i_block_group *
> -				EXT4_BLOCKS_PER_GROUP(sb);
> +			ext4_fsblk_t goal = ext4_group_first_block_no(sb,
> +						EXT4_I(inode)->i_block_group);
>  			ext4_fsblk_t block = ext4_new_block(handle, inode,
>  							goal, &error);
>  			if (error)
> Index: 2.6-rc/fs/ext4/balloc.c
> ===================================================================
> --- 2.6-rc.orig/fs/ext4/balloc.c
> +++ 2.6-rc/fs/ext4/balloc.c
> @@ -48,7 +48,6 @@ void ext4_get_group_no_and_offset(struct
>  unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
>  		 ext4_group_t block_group, struct ext4_group_desc *gdp)
>  {
> -	unsigned long start;
>  	int bit, bit_max;
>  	unsigned free_blocks, group_blocks;
>  	struct ext4_sb_info *sbi = EXT4_SB(sb);
> @@ -106,11 +105,12 @@ unsigned ext4_init_block_bitmap(struct s
>  	free_blocks = group_blocks - bit_max;
> 
>  	if (bh) {
> +		ext4_fsblk_t start;
> +
>  		for (bit = 0; bit < bit_max; bit++)
>  			ext4_set_bit(bit, bh->b_data);
> 
> -		start = block_group * EXT4_BLOCKS_PER_GROUP(sb) +
> -			le32_to_cpu(sbi->s_es->s_first_data_block);
> +		start = ext4_group_first_block_no(sb, block_group);
> 
>  		/* Set bits for block and inode bitmaps, and inode table */
>  		ext4_set_bit(ext4_block_bitmap(sb, gdp) - start, bh->b_data);

      reply	other threads:[~2008-02-19  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17  6:08 [PATCH 1/4] ext4: use ext4_group_first_block_no() Akinobu Mita
2008-02-19  8:18 ` Mingming Cao [this message]

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=1203409102.3612.30.camel@localhost.localdomain \
    --to=cmm@us.ibm.com \
    --cc=adilger@clusterfs.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sct@redhat.com \
    --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