linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Andre Noll <maan@systemlinux.org>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH 1/6] md: Make mddev->chunk_size sector-based.
Date: Tue, 26 May 2009 09:02:20 +1000	[thread overview]
Message-ID: <18971.9084.661068.219724@notabene.brown> (raw)
In-Reply-To: message from Andre Noll on Monday May 25

On Monday May 25, maan@systemlinux.org wrote:
> This patch changes the type of the chunk_size field from int to
> sector_t and renames it to chunk_sectors with the implied change of
> semantics. Since
> 
> 	is_power_of_2(chunk_size) = is_power_of_2(chunk_sectors << 9)
> 				  = is_power_of_2(chunk_sectors)
> 
> these bits don't need an adjustment for the shift.

Thanks.

I don't really want chunk_sectors to be sector_t - it is a waste on
32bit, and would cause
> +		if (sector_div(temp, mddev->chunk_sectors))

to fail.
I've left it as 'int' and removed all the (int) casts and (sector_t)
casts.   I adjusted the comment too.

I also changed:
	if (mddev->chunk_sectors << 9 < PAGE_SIZE ||
to
	if (mddev->chunk_sectors < (PAGE_SIZE >> 9) ||
primarily because I need the brackets around the shift, even if the
C compiler doesn't.


Thanks,
NeilBrown

  reply	other threads:[~2009-05-25 23:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25  9:27 [PATCH 0/6] md: More sector_t conversions -- intro Andre Noll
2009-05-25  9:27 ` [PATCH 1/6] md: Make mddev->chunk_size sector-based Andre Noll
2009-05-25 23:02   ` Neil Brown [this message]
2009-05-25  9:27 ` [PATCH 2/6] md: Fix a bug in super_1_sync() Andre Noll
2009-05-25  9:49   ` NeilBrown
2009-05-25 13:40     ` Andre Noll
2009-05-25  9:27 ` [PATCH 3/6] md: Convert mddev->new_chunk to sectors Andre Noll
2009-05-25  9:27 ` [PATCH 4/6] md: convert conf->chunk_size and conf->prev_chunk " Andre Noll
2009-05-25 23:14   ` Neil Brown
2009-05-25  9:27 ` [PATCH 5/6] md/raid5: Use is_power_of_2() in raid5_reconfig()/raid6_reconfig() Andre Noll
2009-05-25  9:27 ` [PATCH 6/6] md/raid5: Kill outdated comment Andre Noll
2009-05-25 23:49 ` [PATCH 0/6] md: More sector_t conversions -- intro Neil Brown
2009-05-26  2:40   ` Neil Brown
2009-05-27  8:02   ` Andre Noll

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=18971.9084.661068.219724@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=maan@systemlinux.org \
    /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).