mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@nokia.com>
To: Colin Cross <ccross@android.com>
Cc: Olof Johansson <olof@lixom.net>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Lei Wen <adrian.wenl@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mandeep Baines <msb@chromium.org>
Subject: Re: [PATCH] mmc_block: Allow more than 8 partitions per card
Date: Thu, 09 Sep 2010 10:54:56 +0300	[thread overview]
Message-ID: <4C8892D0.4070303@nokia.com> (raw)
In-Reply-To: <1283964637-28246-1-git-send-email-ccross@android.com>

ext Colin Cross wrote:
> Set the GENHD_FL_EXT_DEVT flag, which will allocate minor numbers
> in major 259 for partitions past disk->minors.
> 
> Also remove the use of disk_devt to determine devidx from md->disk.
> md->disk->first_minor is always initialized from devidx and can
> always be used to recover it.

Yeah, but it is a bit weird.  It seems to me that devidx should just
be a member of struct mmc_blk_data.

Doesn't look like devidx is cleared in all the error paths out of
mmc_blk_alloc() either, if you want something else to do ;-)

> 
> Signed-off-by: Colin Cross <ccross@android.com>
> ---
>  drivers/mmc/card/block.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index d545f79..07d8eb0 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -87,11 +87,7 @@ static void mmc_blk_put(struct mmc_blk_data *md)
>  	mutex_lock(&open_lock);
>  	md->usage--;
>  	if (md->usage == 0) {
> -		int devmaj = MAJOR(disk_devt(md->disk));
> -		int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT;
> -
> -		if (!devmaj)
> -			devidx = md->disk->first_minor >> MMC_SHIFT;
> +		int devidx = md->disk->first_minor >> MMC_SHIFT;
>  
>  		blk_cleanup_queue(md->queue.queue);
>  
> @@ -607,6 +603,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
>  	md->disk->private_data = md;
>  	md->disk->queue = md->queue.queue;
>  	md->disk->driverfs_dev = &card->dev;
> +	md->disk->flags = GENHD_FL_EXT_DEVT;
>  
>  	/*
>  	 * As discussed on lkml, GENHD_FL_REMOVABLE should:


      parent reply	other threads:[~2010-09-09  7:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18  4:13 [PATCH] mmc: make number of mmcblk minors configurable Olof Johansson
2010-08-19  0:16 ` Andrew Morton
2010-08-19  3:22   ` Olof Johansson
2010-08-20  1:02     ` [PATCH v2] mmc: add config and runtime option for number of mmcblk minors Olof Johansson
2010-08-20 22:13       ` [PATCH v3] " Olof Johansson
2010-08-20 22:18         ` sys_init_module system call runcoderen
2010-08-20 22:32           ` Randy Dunlap
2010-08-20 22:50             ` runcoderen
2010-09-08 14:25         ` [PATCH v3] mmc: add config and runtime option for number of mmcblk minors Lei Wen
2010-09-08 14:57           ` Olof Johansson
2010-09-08 15:19             ` Kay Sievers
2010-09-08 15:57               ` Olof Johansson
2010-09-08 16:48                 ` Colin Cross
2010-09-08 16:50                   ` [PATCH] mmc_block: Allow more than 8 partitions per card Colin Cross
2010-09-09  2:49                     ` Lei Wen
2010-09-09  7:54                     ` Adrian Hunter [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=4C8892D0.4070303@nokia.com \
    --to=adrian.hunter@nokia.com \
    --cc=adrian.wenl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ccross@android.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=msb@chromium.org \
    --cc=olof@lixom.net \
    /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

Powered by JetHome