From 6f448b040bdda2eff17d0bc940b7e76b9bb11f17 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Thu, 8 Jun 2023 13:02:45 +0200 Subject: [PATCH] fs: remove sb->s_mode JIRA: https://issues.redhat.com/browse/RHEL-1516 Conflicts: drop change on f2fs which isn't enabled on rhel9 commit 81b1fb7d17c0110df839e13468ada9e99bb6e5f4 Author: Christoph Hellwig Date: Thu Jun 8 13:02:45 2023 +0200 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 Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-18-hch@lst.de Signed-off-by: Jens Axboe Signed-off-by: Ming Lei --- fs/nilfs2/super.c | 1 - fs/super.c | 2 -- include/linux/fs.h | 1 - 3 files changed, 4 deletions(-) diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index b288b48b664c..1a0636bc8a22 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -1306,7 +1306,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)); diff --git a/fs/super.c b/fs/super.c index 0f9ebb5d5de2..e7149c5b6d11 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1300,7 +1300,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); @@ -1374,7 +1373,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); diff --git a/include/linux/fs.h b/include/linux/fs.h index 0268d85a51f0..49c6e0e1dcc7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1542,7 +1542,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