mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
fs: remove sb->s_mode
There is no real need to store the open mode in the super_block now. It is only used by f2fs, which can easily recalculate it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Christian Brauner <brauner@kernel.org> Link: https://lore.kernel.org/r/20230608110258.189493-18-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
3f0b3e785e
commit
81b1fb7d17
@ -3993,6 +3993,7 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
|
||||
struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi);
|
||||
unsigned int max_devices = MAX_DEVICES;
|
||||
unsigned int logical_blksize;
|
||||
fmode_t mode = sb_open_mode(sbi->sb->s_flags);
|
||||
int i;
|
||||
|
||||
/* Initialize single device information */
|
||||
@ -4024,8 +4025,8 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
|
||||
if (max_devices == 1) {
|
||||
/* Single zoned block device mount */
|
||||
FDEV(0).bdev =
|
||||
blkdev_get_by_dev(sbi->sb->s_bdev->bd_dev,
|
||||
sbi->sb->s_mode, sbi->sb->s_type, NULL);
|
||||
blkdev_get_by_dev(sbi->sb->s_bdev->bd_dev, mode,
|
||||
sbi->sb->s_type, NULL);
|
||||
} else {
|
||||
/* Multi-device mount */
|
||||
memcpy(FDEV(i).path, RDEV(i).path, MAX_PATH_LEN);
|
||||
@ -4043,8 +4044,9 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
|
||||
(FDEV(i).total_segments <<
|
||||
sbi->log_blocks_per_seg) - 1;
|
||||
}
|
||||
FDEV(i).bdev = blkdev_get_by_path(FDEV(i).path,
|
||||
sbi->sb->s_mode, sbi->sb->s_type, NULL);
|
||||
FDEV(i).bdev = blkdev_get_by_path(FDEV(i).path, mode,
|
||||
sbi->sb->s_type,
|
||||
NULL);
|
||||
}
|
||||
if (IS_ERR(FDEV(i).bdev))
|
||||
return PTR_ERR(FDEV(i).bdev);
|
||||
|
@ -1316,7 +1316,6 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
|
||||
s_new = true;
|
||||
|
||||
/* New superblock instance created */
|
||||
s->s_mode = mode;
|
||||
snprintf(s->s_id, sizeof(s->s_id), "%pg", sd.bdev);
|
||||
sb_set_blocksize(s, block_size(sd.bdev));
|
||||
|
||||
|
@ -1308,7 +1308,6 @@ int get_tree_bdev(struct fs_context *fc,
|
||||
blkdev_put(bdev, fc->fs_type);
|
||||
down_write(&s->s_umount);
|
||||
} else {
|
||||
s->s_mode = mode;
|
||||
snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
|
||||
shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s",
|
||||
fc->fs_type->name, s->s_id);
|
||||
@ -1382,7 +1381,6 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
|
||||
blkdev_put(bdev, fs_type);
|
||||
down_write(&s->s_umount);
|
||||
} else {
|
||||
s->s_mode = mode;
|
||||
snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
|
||||
shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s",
|
||||
fs_type->name, s->s_id);
|
||||
|
@ -1215,7 +1215,6 @@ struct super_block {
|
||||
uuid_t s_uuid; /* UUID */
|
||||
|
||||
unsigned int s_max_links;
|
||||
fmode_t s_mode;
|
||||
|
||||
/*
|
||||
* The next field is for VFS *only*. No filesystems have any business
|
||||
|
Loading…
Reference in New Issue
Block a user