diff options
author | Jeff Layton <jlayton@kernel.org> | 2024-11-13 09:17:51 -0500 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-11-14 10:45:53 +0100 |
commit | 9fed2c0f2f0771b990d068ef0a2b32e770ae6d48 (patch) | |
tree | f7efaa0568afb1238d72f1e6f024cc30c344cc3d /fs/inode.c | |
parent | b40508ca5d5c1ef0b559bc3bd25a2047240b5601 (diff) |
fs: reduce pointer chasing in is_mgtime() test
The is_mgtime test checks whether the FS_MGTIME flag is set in the
fstype. To get there from the inode though, we have to dereference 3
pointers.
Add a new IOP_MGTIME flag, and have inode_init_always() set that flag
when the fstype flag is set. Then, make is_mgtime test for IOP_MGTIME
instead.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20241113-mgtime-v1-1-84e256980e11@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c index 3b66082afe22..bb0117e679de 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -241,6 +241,8 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_opflags = 0; if (sb->s_xattr) inode->i_opflags |= IOP_XATTR; + if (sb->s_type->fs_flags & FS_MGTIME) + inode->i_opflags |= IOP_MGTIME; i_uid_write(inode, 0); i_gid_write(inode, 0); atomic_set(&inode->i_writecount, 0); |