Skip to content

Commit

Permalink
Merge branch 'vfs' of git://git.kernel.org/pub/scm/linux/kernel/git/a…
Browse files Browse the repository at this point in the history
…rnd/bkl

* 'vfs' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: (30 commits)
  BKL: remove BKL from freevxfs
  BKL: remove BKL from qnx4
  autofs4: Only declare function when CONFIG_COMPAT is defined
  autofs: Only declare function when CONFIG_COMPAT is defined
  ncpfs: Lock socket in ncpfs while setting its callbacks
  fs/locks.c: prepare for BKL removal
  BKL: Remove BKL from ncpfs
  BKL: Remove BKL from OCFS2
  BKL: Remove BKL from squashfs
  BKL: Remove BKL from jffs2
  BKL: Remove BKL from ecryptfs
  BKL: Remove BKL from afs
  BKL: Remove BKL from USB gadgetfs
  BKL: Remove BKL from autofs4
  BKL: Remove BKL from isofs
  BKL: Remove BKL from fat
  BKL: Remove BKL from ext2 filesystem
  BKL: Remove BKL from do_new_mount()
  BKL: Remove BKL from cgroup
  BKL: Remove BKL from NTFS
  ...
  • Loading branch information
torvalds committed Oct 22, 2010
2 parents c37927d + 6d7bccc commit 79f14b7
Show file tree
Hide file tree
Showing 59 changed files with 691 additions and 711 deletions.
1 change: 0 additions & 1 deletion drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/smp_lock.h>

#include <linux/device.h>
#include <linux/moduleparam.h>
Expand Down
8 changes: 7 additions & 1 deletion fs/adfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,15 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
struct adfs_sb_info *asb;
struct inode *root;

lock_kernel();

sb->s_flags |= MS_NODIRATIME;

asb = kzalloc(sizeof(*asb), GFP_KERNEL);
if (!asb)
if (!asb) {
unlock_kernel();
return -ENOMEM;
}
sb->s_fs_info = asb;

/* set default options */
Expand Down Expand Up @@ -474,13 +478,15 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
goto error;
} else
sb->s_root->d_op = &adfs_dentry_operations;
unlock_kernel();
return 0;

error_free_bh:
brelse(bh);
error:
sb->s_fs_info = NULL;
kfree(asb);
unlock_kernel();
return -EINVAL;
}

Expand Down
14 changes: 4 additions & 10 deletions fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/parser.h>
#include <linux/magic.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/slab.h>
#include "affs.h"

Expand Down Expand Up @@ -46,8 +45,6 @@ affs_put_super(struct super_block *sb)
struct affs_sb_info *sbi = AFFS_SB(sb);
pr_debug("AFFS: put_super()\n");

lock_kernel();

if (!(sb->s_flags & MS_RDONLY) && sb->s_dirt)
affs_commit_super(sb, 1, 1);

Expand All @@ -56,8 +53,6 @@ affs_put_super(struct super_block *sb)
affs_brelse(sbi->s_root_bh);
kfree(sbi);
sb->s_fs_info = NULL;

unlock_kernel();
}

static void
Expand Down Expand Up @@ -302,6 +297,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL);
if (!sbi)
return -ENOMEM;

sb->s_fs_info = sbi;
mutex_init(&sbi->s_bmlock);
spin_lock_init(&sbi->symlink_lock);
Expand Down Expand Up @@ -527,7 +523,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
kfree(new_opts);
return -EINVAL;
}
lock_kernel();

replace_mount_options(sb, new_opts);

sbi->s_flags = mount_flags;
Expand All @@ -543,17 +539,15 @@ affs_remount(struct super_block *sb, int *flags, char *data)
memcpy(sbi->s_volume, volume, 32);
spin_unlock(&sbi->symlink_lock);

if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) {
unlock_kernel();
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
return 0;
}

if (*flags & MS_RDONLY) {
affs_write_super(sb);
affs_free_bitmap(sb);
} else
res = affs_init_bitmap(sb, flags);

unlock_kernel();
return res;
}

Expand Down
5 changes: 2 additions & 3 deletions fs/afs/flock.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* 2 of the License, or (at your option) any later version.
*/

#include <linux/smp_lock.h>
#include "internal.h"

#define AFS_LOCK_GRANTED 0
Expand Down Expand Up @@ -274,7 +273,7 @@ static int afs_do_setlk(struct file *file, struct file_lock *fl)

type = (fl->fl_type == F_RDLCK) ? AFS_LOCK_READ : AFS_LOCK_WRITE;

lock_kernel();
lock_flocks();

/* make sure we've got a callback on this file and that our view of the
* data version is up to date */
Expand Down Expand Up @@ -421,7 +420,7 @@ static int afs_do_setlk(struct file *file, struct file_lock *fl)
afs_vnode_fetch_status(vnode, NULL, key);

error:
unlock_kernel();
unlock_flocks();
_leave(" = %d", ret);
return ret;

Expand Down
5 changes: 0 additions & 5 deletions fs/afs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <linux/mount.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/parser.h>
Expand Down Expand Up @@ -453,12 +452,8 @@ static void afs_put_super(struct super_block *sb)

_enter("");

lock_kernel();

afs_put_volume(as->volume);

unlock_kernel();

_leave("");
}

Expand Down
2 changes: 2 additions & 0 deletions fs/autofs/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ static int autofs_root_unlink(struct inode *,struct dentry *);
static int autofs_root_rmdir(struct inode *,struct dentry *);
static int autofs_root_mkdir(struct inode *,struct dentry *,int);
static long autofs_root_ioctl(struct file *,unsigned int,unsigned long);
#ifdef CONFIG_COMPAT
static long autofs_root_compat_ioctl(struct file *,unsigned int,unsigned long);
#endif

const struct file_operations autofs_root_operations = {
.llseek = generic_file_llseek,
Expand Down
14 changes: 9 additions & 5 deletions fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <linux/param.h>
#include <linux/time.h>
#include <linux/compat.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>

#include "autofs_i.h"

Expand All @@ -28,7 +28,9 @@ static int autofs4_dir_unlink(struct inode *,struct dentry *);
static int autofs4_dir_rmdir(struct inode *,struct dentry *);
static int autofs4_dir_mkdir(struct inode *,struct dentry *,int);
static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long);
#ifdef CONFIG_COMPAT
static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long);
#endif
static int autofs4_dir_open(struct inode *inode, struct file *file);
static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
static void *autofs4_follow_link(struct dentry *, struct nameidata *);
Expand Down Expand Up @@ -978,15 +980,17 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp,
}
}

static DEFINE_MUTEX(autofs4_ioctl_mutex);

static long autofs4_root_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg)
{
long ret;
struct inode *inode = filp->f_dentry->d_inode;

lock_kernel();
mutex_lock(&autofs4_ioctl_mutex);
ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
unlock_kernel();
mutex_unlock(&autofs4_ioctl_mutex);

return ret;
}
Expand All @@ -998,13 +1002,13 @@ static long autofs4_root_compat_ioctl(struct file *filp,
struct inode *inode = filp->f_path.dentry->d_inode;
int ret;

lock_kernel();
mutex_lock(&autofs4_ioctl_mutex);
if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL)
ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
else
ret = autofs4_root_ioctl_unlocked(inode, filp, cmd,
(unsigned long)compat_ptr(arg));
unlock_kernel();
mutex_unlock(&autofs4_ioctl_mutex);

return ret;
}
Expand Down
5 changes: 0 additions & 5 deletions fs/bfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/smp_lock.h>
#include <linux/buffer_head.h>
#include <linux/vfs.h>
#include <linux/writeback.h>
Expand Down Expand Up @@ -215,14 +214,10 @@ static void bfs_put_super(struct super_block *s)
if (!info)
return;

lock_kernel();

mutex_destroy(&info->bfs_lock);
kfree(info->si_imap);
kfree(info);
s->s_fs_info = NULL;

unlock_kernel();
}

static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf)
Expand Down
13 changes: 5 additions & 8 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/smp_lock.h>
#include "cifsfs.h"
#include "cifspdu.h"
#define DECLARE_GLOBALS_HERE
Expand Down Expand Up @@ -200,8 +199,6 @@ cifs_put_super(struct super_block *sb)
return;
}

lock_kernel();

rc = cifs_umount(sb, cifs_sb);
if (rc)
cERROR(1, "cifs_umount failed with return code %d", rc);
Expand All @@ -215,8 +212,6 @@ cifs_put_super(struct super_block *sb)
unload_nls(cifs_sb->local_nls);
bdi_destroy(&cifs_sb->bdi);
kfree(cifs_sb);

unlock_kernel();
}

static int
Expand Down Expand Up @@ -514,7 +509,9 @@ cifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
int rc;
struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
struct super_block *sb;

sb = sget(fs_type, NULL, set_anon_super, NULL);

cFYI(1, "Devname: %s flags: %d ", dev_name, flags);

Expand Down Expand Up @@ -565,8 +562,8 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)

static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
{
/* note that this is called by vfs setlease with the BKL held
although I doubt that BKL is needed here in cifs */
/* note that this is called by vfs setlease with lock_flocks held
to protect *lease from going away */
struct inode *inode = file->f_path.dentry->d_inode;

if (!(S_ISREG(inode->i_mode)))
Expand Down
8 changes: 7 additions & 1 deletion fs/coda/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
int error;
int idx;

lock_kernel();

idx = get_device_index((struct coda_mount_data *) data);

/* Ignore errors in data, for backward compatibility */
Expand All @@ -159,11 +161,13 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
vc = &coda_comms[idx];
if (!vc->vc_inuse) {
printk("coda_read_super: No pseudo device\n");
unlock_kernel();
return -EINVAL;
}

if ( vc->vc_sb ) {
printk("coda_read_super: Device already mounted\n");
unlock_kernel();
return -EBUSY;
}

Expand Down Expand Up @@ -202,7 +206,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
sb->s_root = d_alloc_root(root);
if (!sb->s_root)
goto error;
return 0;
unlock_kernel();
return 0;

error:
bdi_destroy(&vc->bdi);
Expand All @@ -212,6 +217,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
if (vc)
vc->vc_sb = NULL;

unlock_kernel();
return -EINVAL;
}

Expand Down
3 changes: 0 additions & 3 deletions fs/ecryptfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/security.h>
#include <linux/compat.h>
#include <linux/fs_stack.h>
#include <linux/smp_lock.h>
#include "ecryptfs_kernel.h"

/**
Expand Down Expand Up @@ -284,11 +283,9 @@ static int ecryptfs_fasync(int fd, struct file *file, int flag)
int rc = 0;
struct file *lower_file = NULL;

lock_kernel();
lower_file = ecryptfs_file_to_lower(file);
if (lower_file->f_op && lower_file->f_op->fasync)
rc = lower_file->f_op->fasync(fd, lower_file, flag);
unlock_kernel();
return rc;
}

Expand Down
6 changes: 4 additions & 2 deletions fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,15 +747,16 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
__le32 features;
int err;

err = -ENOMEM;
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi)
return -ENOMEM;
goto failed_unlock;

sbi->s_blockgroup_lock =
kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
if (!sbi->s_blockgroup_lock) {
kfree(sbi);
return -ENOMEM;
goto failed_unlock;
}
sb->s_fs_info = sbi;
sbi->s_sb_block = sb_block;
Expand Down Expand Up @@ -1107,6 +1108,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
sb->s_fs_info = NULL;
kfree(sbi->s_blockgroup_lock);
kfree(sbi);
failed_unlock:
return ret;
}

Expand Down
Loading

0 comments on commit 79f14b7

Please sign in to comment.