diff options
author | Yoshihisa Abe <yoshiabe@cs.cmu.edu> | 2010-10-25 08:03:46 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 17:02:40 +0200 |
commit | da47c19e5c746829042933c8f945a71e2b62d6fc (patch) | |
tree | 54110db260f57c01745e1ace343ec72b7eec6c69 /fs/coda/inode.c | |
parent | Coda: push BKL regions into coda_upcall() (diff) | |
download | linux-da47c19e5c746829042933c8f945a71e2b62d6fc.tar.xz linux-da47c19e5c746829042933c8f945a71e2b62d6fc.zip |
Coda: replace BKL with mutex
Replace the BKL with a mutex to protect the venus_comm structure which
binds the mountpoint with the character device and holds the upcall
queues.
Signed-off-by: Yoshihisa Abe <yoshiabe@cs.cmu.edu>
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/coda/inode.c')
-rw-r--r-- | fs/coda/inode.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/coda/inode.c b/fs/coda/inode.c index b7fa3e3d772f..7993b96ca348 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -15,7 +15,7 @@ #include <linux/stat.h> #include <linux/errno.h> #include <linux/unistd.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/file.h> #include <linux/vfs.h> @@ -145,7 +145,7 @@ static int get_device_index(struct coda_mount_data *data) static int coda_fill_super(struct super_block *sb, void *data, int silent) { struct inode *root = NULL; - struct venus_comm *vc = NULL; + struct venus_comm *vc; struct CodaFid fid; int error; int idx; @@ -159,7 +159,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) printk(KERN_INFO "coda_read_super: device index: %i\n", idx); vc = &coda_comms[idx]; - lock_kernel(); + mutex_lock(&vc->vc_mutex); if (!vc->vc_inuse) { printk("coda_read_super: No pseudo device\n"); @@ -178,7 +178,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) goto unlock_out; vc->vc_sb = sb; - unlock_kernel(); + mutex_unlock(&vc->vc_mutex); sb->s_fs_info = vc; sb->s_flags |= MS_NOATIME; @@ -217,20 +217,23 @@ error: if (root) iput(root); - lock_kernel(); + mutex_lock(&vc->vc_mutex); bdi_destroy(&vc->bdi); vc->vc_sb = NULL; sb->s_fs_info = NULL; unlock_out: - unlock_kernel(); + mutex_unlock(&vc->vc_mutex); return error; } static void coda_put_super(struct super_block *sb) { - bdi_destroy(&coda_vcp(sb)->bdi); - coda_vcp(sb)->vc_sb = NULL; + struct venus_comm *vcp = coda_vcp(sb); + mutex_lock(&vcp->vc_mutex); + bdi_destroy(&vcp->bdi); + vcp->vc_sb = NULL; sb->s_fs_info = NULL; + mutex_unlock(&vcp->vc_mutex); printk("Coda: Bye bye.\n"); } |