From d4430d62fa77208824a37fe6f85ab2831d274769 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Mar 2008 09:09:22 -0500 Subject: [PATCH] beginning of methods conversion To keep the size of changesets sane we split the switch by drivers; to keep the damn thing bisectable we do the following: 1) rename the affected methods, add ones with correct prototypes, make (few) callers handle both. That's this changeset. 2) for each driver convert to new methods. *ALL* drivers are converted in this series. 3) kill the old (renamed) methods. Note that it _is_ a flagday; all in-tree drivers are converted and by the end of this series no trace of old methods remain. The only reason why we do that this way is to keep the damn thing bisectable and allow per-driver debugging if anything goes wrong. New methods: open(bdev, mode) release(disk, mode) ioctl(bdev, mode, cmd, arg) /* Called without BKL */ compat_ioctl(bdev, mode, cmd, arg) locked_ioctl(bdev, mode, cmd, arg) /* Called with BKL, legacy */ Signed-off-by: Al Viro --- drivers/mmc/card/block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 24c97d3d16b..8cba06f5e11 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -130,8 +130,8 @@ mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo) } static struct block_device_operations mmc_bdops = { - .open = mmc_blk_open, - .release = mmc_blk_release, + .__open = mmc_blk_open, + .__release = mmc_blk_release, .getgeo = mmc_blk_getgeo, .owner = THIS_MODULE, }; -- cgit v1.2.3 From a5a1561f88fe8bfd7fdceed1d942ad494500b8a9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Mar 2008 10:33:30 -0500 Subject: [PATCH] switch mmc Signed-off-by: Al Viro --- drivers/mmc/card/block.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 8cba06f5e11..3d067c35185 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -92,18 +92,17 @@ static void mmc_blk_put(struct mmc_blk_data *md) mutex_unlock(&open_lock); } -static int mmc_blk_open(struct inode *inode, struct file *filp) +static int mmc_blk_open(struct block_device *bdev, fmode_t mode) { - struct mmc_blk_data *md; + struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk); int ret = -ENXIO; - md = mmc_blk_get(inode->i_bdev->bd_disk); if (md) { if (md->usage == 2) - check_disk_change(inode->i_bdev); + check_disk_change(bdev); ret = 0; - if ((filp->f_mode & FMODE_WRITE) && md->read_only) { + if ((mode & FMODE_WRITE) && md->read_only) { mmc_blk_put(md); ret = -EROFS; } @@ -112,9 +111,9 @@ static int mmc_blk_open(struct inode *inode, struct file *filp) return ret; } -static int mmc_blk_release(struct inode *inode, struct file *filp) +static int mmc_blk_release(struct gendisk *disk, fmode_t mode) { - struct mmc_blk_data *md = inode->i_bdev->bd_disk->private_data; + struct mmc_blk_data *md = disk->private_data; mmc_blk_put(md); return 0; @@ -130,8 +129,8 @@ mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo) } static struct block_device_operations mmc_bdops = { - .__open = mmc_blk_open, - .__release = mmc_blk_release, + .open = mmc_blk_open, + .release = mmc_blk_release, .getgeo = mmc_blk_getgeo, .owner = THIS_MODULE, }; -- cgit v1.2.3