All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: cmm@us.ibm.com, tytso@mit.edu, sandeen@redhat.com
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 4/5] ext4: Use both hi and lo bits of the group desc values.
Date: Fri, 21 Nov 2008 00:14:32 +0530	[thread overview]
Message-ID: <20081120184432.GB11212@skywalker> (raw)
In-Reply-To: <1227205580-27596-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Nov 20, 2008 at 11:56:20PM +0530, Aneesh Kumar K.V wrote:
> Rename the lower bits with suffix _lo and add helper
> to access the values. Also rename bg_itable_unused_hi
> to bg_pad as in e2fsprogs. bg_itable_unused_hi is never
> used before
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  fs/ext4/balloc.c  |   11 ++++---
>  fs/ext4/ext4.h    |   24 +++++++++++++--
>  fs/ext4/ialloc.c  |   83 ++++++++++++++++++++++++++++-------------------------
>  fs/ext4/inode.c   |    2 +-
>  fs/ext4/mballoc.c |   15 +++++----
>  fs/ext4/resize.c  |    4 +-
>  fs/ext4/super.c   |   64 +++++++++++++++++++++++++++++++++++++++-
>  7 files changed, 143 insertions(+), 60 deletions(-)
> 
> diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
> index d268f5f..efe68d9 100644
> --- a/fs/ext4/balloc.c
> +++ b/fs/ext4/balloc.c
> @@ -102,9 +102,9 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
>  		if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
>  			ext4_error(sb, __func__,
>  				  "Checksum bad for group %u\n", block_group);
> -			gdp->bg_free_blocks_count = 0;
> -			gdp->bg_free_inodes_count = 0;
> -			gdp->bg_itable_unused = 0;
> +			ext4_free_blks_set(sb, gdp, 0);
> +			ext4_free_inodes_set(sb, gdp, 0);
> +			ext4_itable_unused_set(sb, gdp, 0);
>  			memset(bh->b_data, 0xff, sb->s_blocksize);
>  			return 0;
>  		}
> @@ -444,7 +444,8 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
>  		}
>  	}
>  	spin_lock(sb_bgl_lock(sbi, block_group));
> -	le16_add_cpu(&desc->bg_free_blocks_count, blocks_freed);
> +	blocks_freed += ext4_free_blks_count(sb, desc);
> +	ext4_free_blks_set(sb, desc, blocks_freed);
>  	desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc);
>  	spin_unlock(sb_bgl_lock(sbi, block_group));
>  	percpu_counter_add(&sbi->s_freeblocks_counter, blocks_freed);
> @@ -742,7 +743,7 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
>  		gdp = ext4_get_group_desc(sb, i, NULL);
>  		if (!gdp)
>  			continue;
> -		desc_count += le16_to_cpu(gdp->bg_free_blocks_count);
> +		desc_count += ext4_free_blks_count(sb, gdp);
>  	}
> 

blocks_freed is used later so use count;

@@ -372,7 +372,7 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
 	struct ext4_group_desc *desc;
 	struct ext4_super_block *es;
 	struct ext4_sb_info *sbi;
-	int err = 0, ret;
+	int err = 0, ret, count;
 	ext4_grpblk_t blocks_freed;
 	struct ext4_group_info *grp;
 
@@ -444,7 +444,8 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
 		}
 	}
 	spin_lock(sb_bgl_lock(sbi, block_group));
-	le16_add_cpu(&desc->bg_free_blocks_count, blocks_freed);
+	count = blocks_freed + ext4_free_blks_count(sb, desc);
+	ext4_free_blks_set(sb, desc, count);
 	desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc);
 	spin_unlock(sb_bgl_lock(sbi, block_group));
 	percpu_counter_add(&sbi->s_freeblocks_counter, blocks_freed);


  reply	other threads:[~2008-11-20 18:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20 18:26 [PATCH 1/5] ext4: unlock group before ext4_error Aneesh Kumar K.V
2008-11-20 18:26 ` [PATCH 3/5] ext4: Fix the race between read_block_bitmap and mark_diskspace_used Aneesh Kumar K.V
2008-11-20 18:26   ` [PATCH 4/5] ext4: Use both hi and lo bits of the group desc values Aneesh Kumar K.V
2008-11-20 18:44     ` Aneesh Kumar K.V [this message]
2008-11-20 18:34 ` [PATCH 1/5] ext4: unlock group before ext4_error Aneesh Kumar K.V
2008-11-20 18:35 ` Peter Staubach
2008-11-20 18:47   ` Aneesh Kumar K.V
2008-11-20 22:38 ` Theodore Tso

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=20081120184432.GB11212@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.