[PATCH] remove unneded lock_kernel in drivers/md/dm.c and use unlocked_ioctl.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Diego Woitasen <[email protected]>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux