linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Will Drewry <redpig@dataspill.org>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH][RFC] resize2fs and uninit_bg questions
Date: Wed, 23 Sep 2009 03:34:36 -0600	[thread overview]
Message-ID: <20090923093436.GW10562@webber.adilger.int> (raw)
In-Reply-To: <20090919121909.GA1077@freezingfog.local>

On Sep 19, 2009  07:19 -0500, Will Drewry wrote:
> @@ -482,6 +482,8 @@ retry:
>  
>  	csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
>  					       EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
> +	lazy_flag = EXT2_HAS_COMPAT_FEATURE(fs->super,
> +					       EXT2_FEATURE_COMPAT_LAZY_BG);
>  	adj = old_fs->group_desc_count;
>  	max_group = fs->group_desc_count - adj;
>  	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
> @@ -496,9 +498,12 @@ retry:
>  		adjblocks = 0;
>  
>  		fs->group_desc[i].bg_flags = 0;
> -		if (csum_flag)
> -			fs->group_desc[i].bg_flags |= EXT2_BG_INODE_UNINIT |
> -				EXT2_BG_INODE_ZEROED;
> +		if (csum_flag) {
> +			fs->group_desc[i].bg_flags |= EXT2_BG_INODE_UNINIT;
> +			if (!lazy_flag) {
> +				fs->group_desc[i].bg_flags |= EXT2_BG_INODE_ZEROED;
> +			}
> +		}

This code could be cleaned up a bit by assigning "EXT2_BG_INODE_ZEROED" to
lazy_flag so that you don't need to check this each time:

	lazy_flag = EXT2_HAS_COMPAT_FEATURE(fs->super,
					    EXT2_FEATURE_COMPAT_LAZY_BG) ?
				EXT2_BG_INODE_ZEROED : 0;

		if (csum_flag)
			fs->group_desc[i].bg_flags |=
				EXT2_BG_INODE_UNINIT | lazy_flag;

Still waiting to head from Ted on the use of COMPAT_LAZY_BG.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


  reply	other threads:[~2009-09-23  9:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 16:24 [PATCH][RFC] resize2fs and uninit_bg questions Will Drewry
2009-09-16 19:08 ` Andreas Dilger
2009-09-16 20:42   ` Will Drewry
2009-09-16 21:22     ` Andreas Dilger
2009-09-16 23:11       ` Will Drewry
2009-09-17 19:28         ` Ric Wheeler
2009-09-18  6:09           ` Martin K. Petersen
2009-09-18 11:43             ` Ric Wheeler
2009-09-18 13:56               ` Andreas Dilger
2009-09-19 12:19         ` Will Drewry
2009-09-23  9:34           ` Andreas Dilger [this message]
2009-09-23 19:28             ` Will Drewry
2009-09-25  6:21               ` Andreas Dilger

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=20090923093436.GW10562@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=redpig@dataspill.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).