[PATCH 5/6] smbfs: BKL ioctl pushdown

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Kacur
Date: Wednesday, May 5, 2010 - 6:15 am

Convert smb_ioctl to an unlocked ioctl and push down the bkl into it.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 fs/smbfs/dir.c   |    2 +-
 fs/smbfs/file.c  |    2 +-
 fs/smbfs/ioctl.c |   10 +++++++---
 fs/smbfs/proto.h |    2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c
index 3e4803b..6c97842 100644
--- a/fs/smbfs/dir.c
+++ b/fs/smbfs/dir.c
@@ -39,7 +39,7 @@ const struct file_operations smb_dir_operations =
 {
 	.read		= generic_read_dir,
 	.readdir	= smb_readdir,
-	.ioctl		= smb_ioctl,
+	.unlocked_ioctl	= smb_ioctl,
 	.open		= smb_dir_open,
 };
 
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index dbf6548..84ecf0e 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -437,7 +437,7 @@ const struct file_operations smb_file_operations =
 	.aio_read	= smb_file_aio_read,
 	.write		= do_sync_write,
 	.aio_write	= smb_file_aio_write,
-	.ioctl		= smb_ioctl,
+	.unlocked_ioctl	= smb_ioctl,
 	.mmap		= smb_file_mmap,
 	.open		= smb_file_open,
 	.release	= smb_file_release,
diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c
index dbae1f8..dfc3a94 100644
--- a/fs/smbfs/ioctl.c
+++ b/fs/smbfs/ioctl.c
@@ -19,17 +19,19 @@
 #include <linux/smb_mount.h>
 
 #include <asm/uaccess.h>
+#include <linux/smp_lock.h>
 
 #include "proto.h"
 
-int
-smb_ioctl(struct inode *inode, struct file *filp,
-	  unsigned int cmd, unsigned long arg)
+long smb_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
+	struct inode *inode = filp->f_dentry->d_inode;
 	struct smb_sb_info *server = server_from_inode(inode);
 	struct smb_conn_opt opt;
 	int result = -EINVAL;
 
+	lock_kernel();
+
 	switch (cmd) {
 		uid16_t uid16;
 		uid_t uid32;
@@ -63,5 +65,7 @@ smb_ioctl(struct inode *inode, struct file *filp,
 		break;
 	}
 
+	unlock_kernel();
+
 	return result;
 }
diff --git a/fs/smbfs/proto.h b/fs/smbfs/proto.h
index 03f456c..05939a6 100644
--- a/fs/smbfs/proto.h
+++ b/fs/smbfs/proto.h
@@ -67,7 +67,7 @@ extern const struct address_space_operations smb_file_aops;
 extern const struct file_operations smb_file_operations;
 extern const struct inode_operations smb_file_inode_operations;
 /* ioctl.c */
-extern int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
+extern long smb_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 /* smbiod.c */
 extern void smbiod_wake_up(void);
 extern int smbiod_register_server(struct smb_sb_info *server);
-- 
1.6.6.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] BKL ioctl pushdown, John Kacur, (Wed May 5, 6:15 am)
[PATCH 1/6] coda: BKL ioctl pushdown, John Kacur, (Wed May 5, 6:15 am)
[PATCH 3/6] fat: BKL ioctl pushdown, John Kacur, (Wed May 5, 6:15 am)
[PATCH 4/6] ncpfs: BKL ioctl pushdown, John Kacur, (Wed May 5, 6:15 am)
[PATCH 5/6] smbfs: BKL ioctl pushdown, John Kacur, (Wed May 5, 6:15 am)
[PATCH 6/6] udf: BKL ioctl pushdown, John Kacur, (Wed May 5, 6:15 am)
Re: [PATCH 6/6] udf: BKL ioctl pushdown, Jan Kara, (Wed May 5, 7:39 am)
Re: [PATCH 3/6] fat: BKL ioctl pushdown, OGAWA Hirofumi, (Wed May 5, 9:04 am)
Re: [PATCH 3/6] fat: BKL ioctl pushdown, John Kacur, (Wed May 5, 10:34 am)
Re: [PATCH 3/6] fat: BKL ioctl pushdown, OGAWA Hirofumi, (Wed May 5, 11:30 am)
[PATCH] fat: convert to unlocked_ioctl, Arnd Bergmann, (Wed May 5, 12:55 pm)
Re: [PATCH 3/6] fat: BKL ioctl pushdown, John Kacur, (Wed May 5, 1:16 pm)
Re: [PATCH] fat: convert to unlocked_ioctl, OGAWA Hirofumi, (Wed May 5, 2:06 pm)
Re: [PATCH 0/6] BKL ioctl pushdown, Frederic Weisbecker, (Tue May 11, 12:08 am)
Re: [PATCH 1/6] coda: BKL ioctl pushdown, Frederic Weisbecker, (Sun May 16, 7:10 pm)
Re: [PATCH 2/6] coda: Clean-up whitespace problems in pioctl.c, Frederic Weisbecker, (Sun May 16, 7:13 pm)
Re: [PATCH 4/6] ncpfs: BKL ioctl pushdown, Frederic Weisbecker, (Sun May 16, 7:24 pm)
Re: [PATCH 5/6] smbfs: BKL ioctl pushdown, Frederic Weisbecker, (Sun May 16, 7:26 pm)
Re: [PATCH 5/6] smbfs: BKL ioctl pushdown, Frederic Weisbecker, (Sun May 16, 7:35 pm)
Re: [PATCH 5/6] smbfs: BKL ioctl pushdown, John Kacur, (Mon May 17, 4:46 am)