Re: [PATCH] mmc_block: Allow more than 8 partitions per card

From: Lei Wen
Date: Wed Sep 08 2010 - 22:49:48 EST


On Thu, Sep 9, 2010 at 12:50 AM, Colin Cross <ccross@xxxxxxxxxxx> 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.
>
> Signed-off-by: Colin Cross <ccross@xxxxxxxxxxx>
> ---
> Â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:
> --
> 1.7.1
>

Looks good to me.
Acked-by: Lei Wen <leiwen@xxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/