diff options
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index f804d41ec9d3..0030640e2d72 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -1147,14 +1147,14 @@ nilfs_mount(struct file_system_type *fs_type, int flags, | |||
1147 | { | 1147 | { |
1148 | struct nilfs_super_data sd; | 1148 | struct nilfs_super_data sd; |
1149 | struct super_block *s; | 1149 | struct super_block *s; |
1150 | fmode_t mode = FMODE_READ; | 1150 | fmode_t mode = FMODE_READ | FMODE_EXCL; |
1151 | struct dentry *root_dentry; | 1151 | struct dentry *root_dentry; |
1152 | int err, s_new = false; | 1152 | int err, s_new = false; |
1153 | 1153 | ||
1154 | if (!(flags & MS_RDONLY)) | 1154 | if (!(flags & MS_RDONLY)) |
1155 | mode |= FMODE_WRITE; | 1155 | mode |= FMODE_WRITE; |
1156 | 1156 | ||
1157 | sd.bdev = open_bdev_exclusive(dev_name, mode, fs_type); | 1157 | sd.bdev = blkdev_get_by_path(dev_name, mode, fs_type); |
1158 | if (IS_ERR(sd.bdev)) | 1158 | if (IS_ERR(sd.bdev)) |
1159 | return ERR_CAST(sd.bdev); | 1159 | return ERR_CAST(sd.bdev); |
1160 | 1160 | ||
@@ -1233,7 +1233,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, | |||
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | if (!s_new) | 1235 | if (!s_new) |
1236 | close_bdev_exclusive(sd.bdev, mode); | 1236 | blkdev_put(sd.bdev, mode); |
1237 | 1237 | ||
1238 | return root_dentry; | 1238 | return root_dentry; |
1239 | 1239 | ||
@@ -1242,7 +1242,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, | |||
1242 | 1242 | ||
1243 | failed: | 1243 | failed: |
1244 | if (!s_new) | 1244 | if (!s_new) |
1245 | close_bdev_exclusive(sd.bdev, mode); | 1245 | blkdev_put(sd.bdev, mode); |
1246 | return ERR_PTR(err); | 1246 | return ERR_PTR(err); |
1247 | } | 1247 | } |
1248 | 1248 | ||