From d4430d62fa77208824a37fe6f85ab2831d274769 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
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 <viro@zeniv.linux.org.uk>
---
 drivers/block/z2ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'drivers/block/z2ram.c')

diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index be20a67f1fa8..4860d0f36870 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -314,8 +314,8 @@ z2_release( struct inode *inode, struct file *filp )
 static struct block_device_operations z2_fops =
 {
 	.owner		= THIS_MODULE,
-	.open		= z2_open,
-	.release	= z2_release,
+	.__open		= z2_open,
+	.__release	= z2_release,
 };
 
 static struct kobject *z2_find(dev_t dev, int *part, void *data)
-- 
cgit v1.2.3


From ab746cb9386313201f2e0060e85a30781047dee1 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun, 2 Mar 2008 10:24:45 -0500
Subject: [PATCH] switch z2ram

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/block/z2ram.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

(limited to 'drivers/block/z2ram.c')

diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 4860d0f36870..80754cdd3119 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -137,8 +137,7 @@ get_chipram( void )
     return;
 }
 
-static int
-z2_open( struct inode *inode, struct file *filp )
+static int z2_open(struct block_device *bdev, fmode_t mode)
 {
     int device;
     int max_z2_map = ( Z2RAM_SIZE / Z2RAM_CHUNKSIZE ) *
@@ -147,7 +146,7 @@ z2_open( struct inode *inode, struct file *filp )
 	sizeof( z2ram_map[0] );
     int rc = -ENOMEM;
 
-    device = iminor(inode);
+    device = MINOR(bdev->bd_dev);
 
     if ( current_device != -1 && current_device != device )
     {
@@ -299,7 +298,7 @@ err_out:
 }
 
 static int
-z2_release( struct inode *inode, struct file *filp )
+z2_release(struct gendisk *disk, fmode_t mode)
 {
     if ( current_device == -1 )
 	return 0;     
@@ -314,8 +313,8 @@ z2_release( struct inode *inode, struct file *filp )
 static struct block_device_operations z2_fops =
 {
 	.owner		= THIS_MODULE,
-	.__open		= z2_open,
-	.__release	= z2_release,
+	.open		= z2_open,
+	.release	= z2_release,
 };
 
 static struct kobject *z2_find(dev_t dev, int *part, void *data)
-- 
cgit v1.2.3