public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove unneded lock_kernel in drivers/md/dm.c and use unlocked_ioctl.
@ 2007-07-31  2:23 Diego Woitasen
  2007-08-14 20:12 ` Alasdair G Kergon
  0 siblings, 1 reply; 2+ messages in thread
From: Diego Woitasen @ 2007-07-31  2:23 UTC (permalink / raw)
  To: dm-devel; +Cc: linux-kernel, Diego Woitasen


Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
---
 drivers/md/dm.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 141ff9f..aebb207 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -282,17 +282,16 @@ static int dm_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
 	return dm_get_geometry(md, geo);
 }
 
-static int dm_blk_ioctl(struct inode *inode, struct file *file,
-			unsigned int cmd, unsigned long arg)
+static long dm_blk_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct mapped_device *md;
 	struct dm_table *map;
 	struct dm_target *tgt;
+	struct inode *inode;
 	int r = -ENOTTY;
 
-	/* We don't really need this lock, but we do need 'inode'. */
-	unlock_kernel();
 
+	inode = file->f_path.dentry->d_inode;
 	md = inode->i_bdev->bd_disk->private_data;
 
 	map = dm_get_table(md);
@@ -317,7 +316,6 @@ static int dm_blk_ioctl(struct inode *inode, struct file *file,
 out:
 	dm_table_put(map);
 
-	lock_kernel();
 	return r;
 }
 
@@ -1550,7 +1548,7 @@ EXPORT_SYMBOL_GPL(dm_noflush_suspending);
 static struct block_device_operations dm_blk_dops = {
 	.open = dm_blk_open,
 	.release = dm_blk_close,
-	.ioctl = dm_blk_ioctl,
+	.unlocked_ioctl = dm_blk_ioctl,
 	.getgeo = dm_blk_getgeo,
 	.owner = THIS_MODULE
 };
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] remove unneded lock_kernel in drivers/md/dm.c and use unlocked_ioctl.
  2007-07-31  2:23 [PATCH] remove unneded lock_kernel in drivers/md/dm.c and use unlocked_ioctl Diego Woitasen
@ 2007-08-14 20:12 ` Alasdair G Kergon
  0 siblings, 0 replies; 2+ messages in thread
From: Alasdair G Kergon @ 2007-08-14 20:12 UTC (permalink / raw)
  To: Diego Woitasen; +Cc: dm-devel, linux-kernel

On Mon, Jul 30, 2007 at 11:23:49PM -0300, Diego Woitasen wrote:
> -static int dm_blk_ioctl(struct inode *inode, struct file *file,
> -			unsigned int cmd, unsigned long arg)
> +static long dm_blk_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

> -	/* We don't really need this lock, but we do need 'inode'. */
> -	unlock_kernel();
> +	inode = file->f_path.dentry->d_inode;

Have the call paths that pass a NULL 'file' parameter down all been
changed?  If not, perhaps pass the 'inode' parameter into
unlocked_ioctl(), as happens with ioctl(), to get rid of the lock.

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-14 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31  2:23 [PATCH] remove unneded lock_kernel in drivers/md/dm.c and use unlocked_ioctl Diego Woitasen
2007-08-14 20:12 ` Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox