login
Header Space

 
 

[PATCH] [11/18] BKL-removal: Convert ocfs2 over to unlocked_ioctl

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <mark.fasheh@...>, <linux-kernel@...>, <linux-fsdevel@...>, <akpm@...>
Date: Saturday, January 26, 2008 - 10:17 pm

As far as I can see there is nothing in ocfs2_ioctl that requires the BKL,
so use unlocked_ioctl

Cc: mark.fasheh@oracle.com

Signed-off-by: Andi Kleen <ak@suse.de>

---
 fs/ocfs2/file.c  |    4 ++--
 fs/ocfs2/ioctl.c |   12 +++---------
 fs/ocfs2/ioctl.h |    3 +--
 3 files changed, 6 insertions(+), 13 deletions(-)

Index: linux/fs/ocfs2/ioctl.c
===================================================================
--- linux.orig/fs/ocfs2/ioctl.c
+++ linux/fs/ocfs2/ioctl.c
@@ -111,9 +111,9 @@ bail:
 	return status;
 }
 
-int ocfs2_ioctl(struct inode * inode, struct file * filp,
-	unsigned int cmd, unsigned long arg)
+long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
+	struct inode *inode = filp->f_path.dentry->d_inode;
 	unsigned int flags;
 	int status;
 	struct ocfs2_space_resv sr;
@@ -148,9 +148,6 @@ int ocfs2_ioctl(struct inode * inode, st
 #ifdef CONFIG_COMPAT
 long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
-	struct inode *inode = file->f_path.dentry->d_inode;
-	int ret;
-
 	switch (cmd) {
 	case OCFS2_IOC32_GETFLAGS:
 		cmd = OCFS2_IOC_GETFLAGS;
@@ -167,9 +164,6 @@ long ocfs2_compat_ioctl(struct file *fil
 		return -ENOIOCTLCMD;
 	}
 
-	lock_kernel();
-	ret = ocfs2_ioctl(inode, file, cmd, arg);
-	unlock_kernel();
-	return ret;
+	return ocfs2_ioctl(file, cmd, arg);
 }
 #endif
Index: linux/fs/ocfs2/ioctl.h
===================================================================
--- linux.orig/fs/ocfs2/ioctl.h
+++ linux/fs/ocfs2/ioctl.h
@@ -10,8 +10,7 @@
 #ifndef OCFS2_IOCTL_H
 #define OCFS2_IOCTL_H
 
-int ocfs2_ioctl(struct inode * inode, struct file * filp,
-	unsigned int cmd, unsigned long arg);
+long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
 
 #endif /* OCFS2_IOCTL_H */
Index: linux/fs/ocfs2/file.c
===================================================================
--- linux.orig/fs/ocfs2/file.c
+++ linux/fs/ocfs2/file.c
@@ -2212,7 +2212,7 @@ const struct file_operations ocfs2_fops 
 	.open		= ocfs2_file_open,
 	.aio_read	= ocfs2_file_aio_read,
 	.aio_write	= ocfs2_file_aio_write,
-	.ioctl		= ocfs2_ioctl,
+	.unlocked_ioctl = ocfs2_ioctl,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl   = ocfs2_compat_ioctl,
 #endif
@@ -2224,7 +2224,7 @@ const struct file_operations ocfs2_dops 
 	.read		= generic_read_dir,
 	.readdir	= ocfs2_readdir,
 	.fsync		= ocfs2_sync_file,
-	.ioctl		= ocfs2_ioctl,
+	.unlocked_ioctl = ocfs2_ioctl,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl   = ocfs2_compat_ioctl,
 #endif
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] [8/18] BKL-removal: Remove BKL from remote_llseek, Trond Myklebust, (Mon Jan 28, 12:13 am)
Re: [PATCH] [8/18] BKL-removal: Remove BKL from remote_llseek, Trond Myklebust, (Mon Jan 28, 12:51 am)
[PATCH] [13/18] BKL-removal: Add compat_ioctl for cifs, Andi Kleen, (Sat Jan 26, 10:17 pm)
[PATCH] [4/18] ext3: Remove incorrect BKL comment, Andi Kleen, (Sat Jan 26, 10:17 pm)
[PATCH] [11/18] BKL-removal: Convert ocfs2 over to unlocked_..., Andi Kleen, (Sat Jan 26, 10:17 pm)
[PATCH] [14/18] BKL-removal: Add unlocked_fasync, Andi Kleen, (Sat Jan 26, 10:17 pm)
Re: [PATCH] [14/18] BKL-removal: Add unlocked_fasync, KOSAKI Motohiro, (Sun Jan 27, 3:05 am)
[PATCH] [9/18] BKL-removal: Use unlocked_ioctl for jfs, Andi Kleen, (Sat Jan 26, 10:17 pm)
speck-geostationary