vfs: umount_begin BKL pushdown

Push BKL down into ->umount_begin()

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Alessio Igor Bogani 2009-04-24 09:06:53 +02:00 committed by Al Viro
parent 091bf7624d
commit 67e55205ec
5 changed files with 17 additions and 4 deletions

View File

@ -37,6 +37,7 @@
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/idr.h> #include <linux/idr.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/smp_lock.h>
#include <net/9p/9p.h> #include <net/9p/9p.h>
#include <net/9p/client.h> #include <net/9p/client.h>
@ -230,9 +231,12 @@ static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt)
static void static void
v9fs_umount_begin(struct super_block *sb) v9fs_umount_begin(struct super_block *sb)
{ {
struct v9fs_session_info *v9ses = sb->s_fs_info; struct v9fs_session_info *v9ses;
lock_kernel();
v9ses = sb->s_fs_info;
v9fs_session_cancel(v9ses); v9fs_session_cancel(v9ses);
unlock_kernel();
} }
static const struct super_operations v9fs_super_ops = { static const struct super_operations v9fs_super_ops = {

View File

@ -35,6 +35,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/smp_lock.h>
#include "cifsfs.h" #include "cifsfs.h"
#include "cifspdu.h" #include "cifspdu.h"
#define DECLARE_GLOBALS_HERE #define DECLARE_GLOBALS_HERE
@ -530,6 +531,7 @@ static void cifs_umount_begin(struct super_block *sb)
if (tcon == NULL) if (tcon == NULL)
return; return;
lock_kernel();
read_lock(&cifs_tcp_ses_lock); read_lock(&cifs_tcp_ses_lock);
if (tcon->tc_count == 1) if (tcon->tc_count == 1)
tcon->tidStatus = CifsExiting; tcon->tidStatus = CifsExiting;
@ -548,6 +550,7 @@ static void cifs_umount_begin(struct super_block *sb)
} }
/* BB FIXME - finish add checks for tidStatus BB */ /* BB FIXME - finish add checks for tidStatus BB */
unlock_kernel();
return; return;
} }

View File

@ -19,6 +19,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/exportfs.h> #include <linux/exportfs.h>
#include <linux/smp_lock.h>
MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>"); MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
MODULE_DESCRIPTION("Filesystem in Userspace"); MODULE_DESCRIPTION("Filesystem in Userspace");
@ -259,7 +260,9 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
static void fuse_umount_begin(struct super_block *sb) static void fuse_umount_begin(struct super_block *sb)
{ {
lock_kernel();
fuse_abort_conn(get_fuse_conn_super(sb)); fuse_abort_conn(get_fuse_conn_super(sb));
unlock_kernel();
} }
static void fuse_send_destroy(struct fuse_conn *fc) static void fuse_send_destroy(struct fuse_conn *fc)

View File

@ -1073,9 +1073,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
*/ */
if (flags & MNT_FORCE && sb->s_op->umount_begin) { if (flags & MNT_FORCE && sb->s_op->umount_begin) {
lock_kernel();
sb->s_op->umount_begin(sb); sb->s_op->umount_begin(sb);
unlock_kernel();
} }
/* /*

View File

@ -683,9 +683,12 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
*/ */
static void nfs_umount_begin(struct super_block *sb) static void nfs_umount_begin(struct super_block *sb)
{ {
struct nfs_server *server = NFS_SB(sb); struct nfs_server *server;
struct rpc_clnt *rpc; struct rpc_clnt *rpc;
lock_kernel();
server = NFS_SB(sb);
/* -EIO all pending I/O */ /* -EIO all pending I/O */
rpc = server->client_acl; rpc = server->client_acl;
if (!IS_ERR(rpc)) if (!IS_ERR(rpc))
@ -693,6 +696,8 @@ static void nfs_umount_begin(struct super_block *sb)
rpc = server->client; rpc = server->client;
if (!IS_ERR(rpc)) if (!IS_ERR(rpc))
rpc_killall_tasks(rpc); rpc_killall_tasks(rpc);
unlock_kernel();
} }
/* /*