fs: inline current_umask() and move it to fs_struct.h

There is no good reason to have this as a func call, other than avoiding
the churn of adding fs_struct.h as needed.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20251104170448.630414-1-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Mateusz Guzik 2025-11-04 18:04:48 +01:00 committed by Christian Brauner
parent 723cd9872d
commit 5b8ed52866
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
17 changed files with 20 additions and 8 deletions

View File

@ -6,6 +6,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fs_struct.h>
#include <net/9p/9p.h> #include <net/9p/9p.h>
#include <net/9p/client.h> #include <net/9p/client.h>
#include <linux/slab.h> #include <linux/slab.h>

View File

@ -9,6 +9,7 @@
#include <linux/blk-cgroup.h> #include <linux/blk-cgroup.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fs_struct.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/time.h> #include <linux/time.h>

View File

@ -9,6 +9,7 @@
* *
* Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de> * Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de>
*/ */
#include <linux/fs_struct.h>
#include <linux/f2fs_fs.h> #include <linux/f2fs_fs.h>
#include "f2fs.h" #include "f2fs.h"
#include "xattr.h" #include "xattr.h"

View File

@ -22,6 +22,7 @@
#include <linux/unaligned.h> #include <linux/unaligned.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/iversion.h> #include <linux/iversion.h>
#include <linux/fs_struct.h>
#include "fat.h" #include "fat.h"
#ifndef CONFIG_FAT_DEFAULT_IOCHARSET #ifndef CONFIG_FAT_DEFAULT_IOCHARSET

View File

@ -146,12 +146,6 @@ int unshare_fs_struct(void)
} }
EXPORT_SYMBOL_GPL(unshare_fs_struct); EXPORT_SYMBOL_GPL(unshare_fs_struct);
int current_umask(void)
{
return current->fs->umask;
}
EXPORT_SYMBOL(current_umask);
/* to be mentioned only in INIT_TASK */ /* to be mentioned only in INIT_TASK */
struct fs_struct init_fs = { struct fs_struct init_fs = {
.users = 1, .users = 1,

View File

@ -12,6 +12,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/fs_struct.h>
#include <linux/fs_context.h> #include <linux/fs_context.h>
#include <linux/fs_parser.h> #include <linux/fs_parser.h>
#include <linux/nls.h> #include <linux/nls.h>

View File

@ -9,6 +9,7 @@
#include "hpfs_fn.h" #include "hpfs_fn.h"
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs_struct.h>
#include <linux/fs_context.h> #include <linux/fs_context.h>
#include <linux/fs_parser.h> #include <linux/fs_parser.h>
#include <linux/init.h> #include <linux/init.h>

View File

@ -14,6 +14,7 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/fs_struct.h>
#include <linux/nilfs2_api.h> #include <linux/nilfs2_api.h>
#include <linux/nilfs2_ondisk.h> #include <linux/nilfs2_ondisk.h>
#include "the_nilfs.h" #include "the_nilfs.h"

View File

@ -51,6 +51,7 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/exportfs.h> #include <linux/exportfs.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fs_struct.h>
#include <linux/fs_context.h> #include <linux/fs_context.h>
#include <linux/fs_parser.h> #include <linux/fs_parser.h>
#include <linux/log2.h> #include <linux/log2.h>

View File

@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/fs_struct.h>
#include <cluster/masklog.h> #include <cluster/masklog.h>

View File

@ -14,6 +14,7 @@
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/crc-itu-t.h> #include <linux/crc-itu-t.h>
#include <linux/fs_struct.h>
#include <linux/fs_context.h> #include <linux/fs_context.h>
#include <linux/fs_parser.h> #include <linux/fs_parser.h>
#include "omfs.h" #include "omfs.h"

View File

@ -9,6 +9,7 @@
* *
*/ */
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fs_struct.h>
#include <linux/filelock.h> #include <linux/filelock.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/stat.h> #include <linux/stat.h>

View File

@ -6,6 +6,7 @@
* *
*/ */
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fs_struct.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>

View File

@ -7,6 +7,7 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/vfs.h> #include <linux/vfs.h>
#include <linux/fs_struct.h>
#include <uapi/linux/magic.h> #include <uapi/linux/magic.h>
#include "cifsglob.h" #include "cifsglob.h"
#include "cifsproto.h" #include "cifsproto.h"

View File

@ -2336,8 +2336,6 @@ static inline void super_set_sysfs_name_generic(struct super_block *sb, const ch
va_end(args); va_end(args);
} }
extern int current_umask(void);
extern void ihold(struct inode * inode); extern void ihold(struct inode * inode);
extern void iput(struct inode *); extern void iput(struct inode *);
int inode_update_timestamps(struct inode *inode, int flags); int inode_update_timestamps(struct inode *inode, int flags);

View File

@ -2,6 +2,7 @@
#ifndef _LINUX_FS_STRUCT_H #ifndef _LINUX_FS_STRUCT_H
#define _LINUX_FS_STRUCT_H #define _LINUX_FS_STRUCT_H
#include <linux/sched.h>
#include <linux/path.h> #include <linux/path.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/seqlock.h> #include <linux/seqlock.h>
@ -41,4 +42,9 @@ static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
extern bool current_chrooted(void); extern bool current_chrooted(void);
static inline int current_umask(void)
{
return current->fs->umask;
}
#endif /* _LINUX_FS_STRUCT_H */ #endif /* _LINUX_FS_STRUCT_H */

View File

@ -7,6 +7,7 @@
#include <linux/path.h> #include <linux/path.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/fs_struct.h>
enum { MAX_NESTED_LINKS = 8 }; enum { MAX_NESTED_LINKS = 8 };