hfsplus: Push down BKL into ioctl function

HFS is one of the remaining users of the ->ioctl function, convert it
blindly to unlocked_ioctl by pushing down the BKL.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
Arnd Bergmann 2010-04-27 16:24:20 +02:00 коммит произвёл Frederic Weisbecker
Родитель e40152ee1e
Коммит 7cc4bcc6f1
4 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -494,7 +494,7 @@ const struct inode_operations hfsplus_dir_inode_operations = {
const struct file_operations hfsplus_dir_operations = { const struct file_operations hfsplus_dir_operations = {
.read = generic_read_dir, .read = generic_read_dir,
.readdir = hfsplus_readdir, .readdir = hfsplus_readdir,
.ioctl = hfsplus_ioctl, .unlocked_ioctl = hfsplus_ioctl,
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
.release = hfsplus_dir_release, .release = hfsplus_dir_release,
}; };

Просмотреть файл

@ -337,8 +337,7 @@ struct inode *hfsplus_new_inode(struct super_block *, int);
void hfsplus_delete_inode(struct inode *); void hfsplus_delete_inode(struct inode *);
/* ioctl.c */ /* ioctl.c */
int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
unsigned long arg);
int hfsplus_setxattr(struct dentry *dentry, const char *name, int hfsplus_setxattr(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags); const void *value, size_t size, int flags);
ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,

Просмотреть файл

@ -285,7 +285,7 @@ static const struct file_operations hfsplus_file_operations = {
.fsync = file_fsync, .fsync = file_fsync,
.open = hfsplus_file_open, .open = hfsplus_file_open,
.release = hfsplus_file_release, .release = hfsplus_file_release,
.ioctl = hfsplus_ioctl, .unlocked_ioctl = hfsplus_ioctl,
}; };
struct inode *hfsplus_new_inode(struct super_block *sb, int mode) struct inode *hfsplus_new_inode(struct super_block *sb, int mode)

Просмотреть файл

@ -17,14 +17,16 @@
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/xattr.h> #include <linux/xattr.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "hfsplus_fs.h" #include "hfsplus_fs.h"
int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
unsigned long arg)
{ {
struct inode *inode = filp->f_path.dentry->d_inode;
unsigned int flags; unsigned int flags;
lock_kernel();
switch (cmd) { switch (cmd) {
case HFSPLUS_IOC_EXT2_GETFLAGS: case HFSPLUS_IOC_EXT2_GETFLAGS:
flags = 0; flags = 0;
@ -38,8 +40,10 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
case HFSPLUS_IOC_EXT2_SETFLAGS: { case HFSPLUS_IOC_EXT2_SETFLAGS: {
int err = 0; int err = 0;
err = mnt_want_write(filp->f_path.mnt); err = mnt_want_write(filp->f_path.mnt);
if (err) if (err) {
unlock_kernel();
return err; return err;
}
if (!is_owner_or_cap(inode)) { if (!is_owner_or_cap(inode)) {
err = -EACCES; err = -EACCES;
@ -85,9 +89,11 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
mark_inode_dirty(inode); mark_inode_dirty(inode);
setflags_out: setflags_out:
mnt_drop_write(filp->f_path.mnt); mnt_drop_write(filp->f_path.mnt);
unlock_kernel();
return err; return err;
} }
default: default:
unlock_kernel();
return -ENOTTY; return -ENOTTY;
} }
} }