fs: inline current_umask() and move it to fs_struct.h
Subsystems (12)
PATCH 1/1 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.
---
build tested with allmodconfig on x86-64
this pulls in sched.h in fs_struct.h for task_struct.
perhaps current_umask would be served better as a macro?
either way, it is used a lot and there is no good reason to func it
fs/9p/acl.c | 1 + fs/btrfs/inode.c | 1 + fs/f2fs/acl.c | 1 + fs/fat/inode.c | 1 + fs/fs_struct.c | 6 ------ fs/hfsplus/options.c | 1 + fs/hpfs/super.c | 1 + fs/nilfs2/nilfs.h | 1 + fs/ntfs3/super.c | 1 + fs/ocfs2/acl.c | 1 + fs/omfs/inode.c | 1 + fs/smb/client/file.c | 1 + fs/smb/client/inode.c | 1 + fs/smb/client/smb1ops.c | 1 + include/linux/fs.h | 2 -- include/linux/fs_struct.h | 6 ++++++ include/linux/namei.h | 1 + 17 files changed, 20 insertions(+), 8 deletions(-)
fs/9p/acl.c +1 -0
@@ -6,6 +6,7 @@#include <linux/module.h> #include <linux/fs.h> +#include <linux/fs_struct.h> #include <net/9p/9p.h> #include <net/9p/client.h> #include <linux/slab.h>
fs/btrfs/inode.c +1 -0
@@ -9,6 +9,7 @@#include <linux/blk-cgroup.h> #include <linux/file.h> #include <linux/fs.h> +#include <linux/fs_struct.h> #include <linux/pagemap.h> #include <linux/highmem.h> #include <linux/time.h>
fs/f2fs/acl.c +1 -0
@@ -9,6 +9,7 @@* * Copyright (C) 2001-2003 Andreas Gruenbacher, <[email protected]> */ +#include <linux/fs_struct.h> #include <linux/f2fs_fs.h> #include "f2fs.h" #include "xattr.h"
fs/fat/inode.c +1 -0
@@ -22,6 +22,7 @@#include <linux/unaligned.h> #include <linux/random.h> #include <linux/iversion.h> +#include <linux/fs_struct.h> #include "fat.h" #ifndef CONFIG_FAT_DEFAULT_IOCHARSET
fs/fs_struct.c +0 -6
@@ -146,12 +146,6 @@ int unshare_fs_struct(void) }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 */ struct fs_struct init_fs = { .users =1 ,
fs/hfsplus/options.c +1 -0
@@ -12,6 +12,7 @@#include <linux/string.h> #include <linux/kernel.h> #include <linux/sched.h> +#include <linux/fs_struct.h> #include <linux/fs_context.h> #include <linux/fs_parser.h> #include <linux/nls.h>
fs/hpfs/super.c +1 -0
@@ -9,6 +9,7 @@#include "hpfs_fn.h" #include <linux/module.h> +#include <linux/fs_struct.h> #include <linux/fs_context.h> #include <linux/fs_parser.h> #include <linux/init.h>
fs/nilfs2/nilfs.h +1 -0
@@ -14,6 +14,7 @@#include <linux/buffer_head.h> #include <linux/spinlock.h> #include <linux/blkdev.h> +#include <linux/fs_struct.h> #include <linux/nilfs2_api.h> #include <linux/nilfs2_ondisk.h> #include "the_nilfs.h"
fs/ntfs3/super.c +1 -0
@@ -51,6 +51,7 @@#include <linux/buffer_head.h> #include <linux/exportfs.h> #include <linux/fs.h> +#include <linux/fs_struct.h> #include <linux/fs_context.h> #include <linux/fs_parser.h> #include <linux/log2.h>
fs/ocfs2/acl.c +1 -0
@@ -13,6 +13,7 @@#include <linux/module.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/fs_struct.h> #include <cluster/masklog.h>
fs/omfs/inode.c +1 -0
@@ -14,6 +14,7 @@#include <linux/writeback.h> #include <linux/seq_file.h> #include <linux/crc-itu-t.h> +#include <linux/fs_struct.h> #include <linux/fs_context.h> #include <linux/fs_parser.h> #include "omfs.h"
fs/smb/client/file.c +1 -0
@@ -9,6 +9,7 @@* */ #include <linux/fs.h> +#include <linux/fs_struct.h> #include <linux/filelock.h> #include <linux/backing-dev.h> #include <linux/stat.h>
fs/smb/client/inode.c +1 -0
@@ -6,6 +6,7 @@* */ #include <linux/fs.h> +#include <linux/fs_struct.h> #include <linux/stat.h> #include <linux/slab.h> #include <linux/pagemap.h>
fs/smb/client/smb1ops.c +1 -0
@@ -7,6 +7,7 @@#include <linux/pagemap.h> #include <linux/vfs.h> +#include <linux/fs_struct.h> #include <uapi/linux/magic.h> #include "cifsglob.h" #include "cifsproto.h"
include/linux/fs.h +0 -2
@@ -2902,8 +2902,6 @@ static inline void super_set_sysfs_name_generic(struct super_block *sb, const chva_end (args); } -extern int current_umask (void ); -extern void ihold (struct inode * inode);extern void iput (struct inode *);int inode_update_timestamps (struct inode *inode,int flags);
include/linux/fs_struct.h +6 -0
@@ -2,6 +2,7 @@#ifndef _LINUX_FS_STRUCT_H#define _LINUX_FS_STRUCT_H +#include <linux/sched.h> #include <linux/path.h> #include <linux/spinlock.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 ); +static inline int current_umask (void ) +{ +return current->fs->umask; +} +#endif /* _LINUX_FS_STRUCT_H */
include/linux/namei.h +1 -0
@@ -7,6 +7,7 @@#include <linux/path.h> #include <linux/fcntl.h> #include <linux/errno.h> +#include <linux/fs_struct.h> enum {MAX_NESTED_LINKS =8 };
Signature · 1 line
2.34.1
Quoted 4 lines · Mateusz Guzik
There is no good reason to have this as a func call, other than avoiding the churn of adding
fs_struct.has needed.
Applied to the vfs-6.19.fs_header branch of the vfs/vfs.git tree. Patches in the vfs-6.19.fs_header branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-6.19.fs_header
[1/1] fs: inline current_umask() and move it to fs_struct.h
https://git.kernel.org/vfs/vfs/c/1943722fbbe6