summaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-08-02 17:41:25 +0200
committerChristian Brauner <brauner@kernel.org>2023-08-11 13:15:03 +0200
commit2ea6f68932f73a6a9d82160d3ad0a49a5a6bb183 (patch)
tree2394448c1d778f2d9ce305be845d125513d08b27 /fs/super.c
parent4b41828be268544286794c18200e83861de3554e (diff)
fs: use the super_block as holder when mounting file systems
The file system type is not a very useful holder as it doesn't allow us to go back to the actual file system instance. Pass the super_block instead which is useful when passed back to the file system driver. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christian Brauner <brauner@kernel.org> Message-Id: <20230802154131.2221419-7-hch@lst.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/super.c b/fs/super.c
index a366bc65886e..3c7e4633efeb 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1249,7 +1249,7 @@ int setup_bdev_super(struct super_block *sb, int sb_flags,
blk_mode_t mode = sb_open_mode(sb_flags);
struct block_device *bdev;
- bdev = blkdev_get_by_dev(sb->s_dev, mode, sb->s_type, &fs_holder_ops);
+ bdev = blkdev_get_by_dev(sb->s_dev, mode, sb, &fs_holder_ops);
if (IS_ERR(bdev)) {
if (fc)
errorf(fc, "%s: Can't open blockdev", fc->source);
@@ -1262,7 +1262,7 @@ int setup_bdev_super(struct super_block *sb, int sb_flags,
* writable from userspace even for a read-only block device.
*/
if ((mode & BLK_OPEN_WRITE) && bdev_read_only(bdev)) {
- blkdev_put(bdev, sb->s_type);
+ blkdev_put(bdev, sb);
return -EACCES;
}
@@ -1278,7 +1278,7 @@ int setup_bdev_super(struct super_block *sb, int sb_flags,
mutex_unlock(&bdev->bd_fsfreeze_mutex);
if (fc)
warnf(fc, "%pg: Can't mount, blockdev is frozen", bdev);
- blkdev_put(bdev, sb->s_type);
+ blkdev_put(bdev, sb);
return -EBUSY;
}
spin_lock(&sb_lock);
@@ -1415,7 +1415,7 @@ void kill_block_super(struct super_block *sb)
generic_shutdown_super(sb);
if (bdev) {
sync_blockdev(bdev);
- blkdev_put(bdev, sb->s_type);
+ blkdev_put(bdev, sb);
}
}