aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/super.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-06-07 12:39:33 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:18 -0400
commitaa7dfb8954ccf49e026ba13d12991a4eb7defb96 (patch)
treeff2d6cf81629322906bd0cea1423e9efe516ffee /fs/nilfs2/super.c
parente59399d0102c1813cec48db5cebe1750313f88a0 (diff)
nilfs2: get rid of bd_mount_sem use from nilfs
This will remove every bd_mount_sem use in nilfs. The intended exclusion control was replaced by the previous patch ("nilfs2: correct exclusion control in nilfs_remount function") for nilfs_remount(), and this patch will replace remains with a new mutex that this inserts in nilfs object. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r--fs/nilfs2/super.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f02762fa8ea..1777a3467bd 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -764,7 +764,7 @@ int nilfs_store_magic_and_option(struct super_block *sb,
764 * @silent: silent mode flag 764 * @silent: silent mode flag
765 * @nilfs: the_nilfs struct 765 * @nilfs: the_nilfs struct
766 * 766 *
767 * This function is called exclusively by bd_mount_mutex. 767 * This function is called exclusively by nilfs->ns_mount_mutex.
768 * So, the recovery process is protected from other simultaneous mounts. 768 * So, the recovery process is protected from other simultaneous mounts.
769 */ 769 */
770static int 770static int
@@ -1105,7 +1105,7 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1105 goto failed; 1105 goto failed;
1106 } 1106 }
1107 1107
1108 down(&sd.bdev->bd_mount_sem); 1108 mutex_lock(&nilfs->ns_mount_mutex);
1109 1109
1110 if (!sd.cno) { 1110 if (!sd.cno) {
1111 /* 1111 /*
@@ -1164,7 +1164,7 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1164 need_to_close = 0; 1164 need_to_close = 0;
1165 } 1165 }
1166 1166
1167 up(&sd.bdev->bd_mount_sem); 1167 mutex_unlock(&nilfs->ns_mount_mutex);
1168 put_nilfs(nilfs); 1168 put_nilfs(nilfs);
1169 if (need_to_close) 1169 if (need_to_close)
1170 close_bdev_exclusive(sd.bdev, flags); 1170 close_bdev_exclusive(sd.bdev, flags);
@@ -1172,7 +1172,7 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1172 return 0; 1172 return 0;
1173 1173
1174 failed_unlock: 1174 failed_unlock:
1175 up(&sd.bdev->bd_mount_sem); 1175 mutex_unlock(&nilfs->ns_mount_mutex);
1176 put_nilfs(nilfs); 1176 put_nilfs(nilfs);
1177 failed: 1177 failed:
1178 close_bdev_exclusive(sd.bdev, flags); 1178 close_bdev_exclusive(sd.bdev, flags);
@@ -1181,14 +1181,14 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1181 1181
1182 cancel_new: 1182 cancel_new:
1183 /* Abandoning the newly allocated superblock */ 1183 /* Abandoning the newly allocated superblock */
1184 up(&sd.bdev->bd_mount_sem); 1184 mutex_unlock(&nilfs->ns_mount_mutex);
1185 put_nilfs(nilfs); 1185 put_nilfs(nilfs);
1186 up_write(&s->s_umount); 1186 up_write(&s->s_umount);
1187 deactivate_super(s); 1187 deactivate_super(s);
1188 /* 1188 /*
1189 * deactivate_super() invokes close_bdev_exclusive(). 1189 * deactivate_super() invokes close_bdev_exclusive().
1190 * We must finish all post-cleaning before this call; 1190 * We must finish all post-cleaning before this call;
1191 * put_nilfs() and unlocking bd_mount_sem need the block device. 1191 * put_nilfs() needs the block device.
1192 */ 1192 */
1193 return err; 1193 return err;
1194} 1194}