]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: inline current_umask() and move it to fs_struct.h
authorMateusz Guzik <mjguzik@gmail.com>
Tue, 4 Nov 2025 17:04:48 +0000 (18:04 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 5 Nov 2025 21:51:23 +0000 (22:51 +0100)
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>
17 files changed:
fs/9p/acl.c
fs/btrfs/inode.c
fs/f2fs/acl.c
fs/fat/inode.c
fs/fs_struct.c
fs/hfsplus/options.c
fs/hpfs/super.c
fs/nilfs2/nilfs.h
fs/ntfs3/super.c
fs/ocfs2/acl.c
fs/omfs/inode.c
fs/smb/client/file.c
fs/smb/client/inode.c
fs/smb/client/smb1ops.c
include/linux/fs.h
include/linux/fs_struct.h
include/linux/namei.h

index eed551d8555f8d1001fb98d679fd08144a97b554..633da5e372993aba1cf2224c2f1e5907e322970f 100644 (file)
@@ -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>
index 3b1b3a0553eea06229255ad0284d76074bdb958a..dee166426511fd41cbd4d0f35e992bbf1ec7d7e3 100644 (file)
@@ -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>
index d4d7f329d23f4abe57e1218aa5e83d37304438a6..fa8d81a30fb914da2010d37d22739874f1048450 100644 (file)
@@ -9,6 +9,7 @@
  *
  * Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de>
  */
+#include <linux/fs_struct.h>
 #include <linux/f2fs_fs.h>
 #include "f2fs.h"
 #include "xattr.h"
index 9648ed09781683723d39ae08e6c024855769a584..309e560038dd83cf389efb4889f68ffa7ffb6655 100644 (file)
@@ -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
index 28be762ac1c637b61fcaeb4921828d16e3644f27..b8c46c5a38a057f83d80f316a759bcb31c6f902b 100644 (file)
@@ -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,
index a66a09a56bf70f889a7cd7299b3261df20d18835..9b377481f3979cf5e401c6cdd20b99d494ed8d68 100644 (file)
@@ -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>
index 8ab85e7ac91eb67367017498243f713fa78df7a5..371aa6de8075a72487cee206006c0e1a6929578d 100644 (file)
@@ -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>
index f466daa39440482e5368525681dc515db4dff5a1..b7e3d91b6243e3287140c2b7f04ca299c204ace2 100644 (file)
@@ -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"
index ddff94c091b8c69b24fb9a385e0e88673c9f8617..8d09dfec970a796fc3a106e17ac3f0751c7fdc8e 100644 (file)
@@ -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>
index 62464d194da3f6d4dd35cf0510d78d7253eb84f2..af1e2cedb217f1029480727e0f82b8c50c7538ae 100644 (file)
@@ -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>
 
index 135c49c5d848cd65fe59d3f32f19919577a96135..89dc093f2752519d183a60745f469778aebb4d13 100644 (file)
@@ -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"
index 474dadeb15933fca117a3c45fabb90d3d0ad7148..9dc0a968ec89bfb1334319335250dc553706470f 100644 (file)
@@ -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>
index cac355364e43c4bc5e5304c4277bd8d8260c2034..28a73717851c39f1190347e1fd6475f12bb8e2e3 100644 (file)
@@ -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>
index ca8f3dd7ff63b8555e36daa881e036615fc987bf..78650527d4bb11d60fff7dc3c0da092b9e93240f 100644 (file)
@@ -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"
index 64af28318fbfd8b45d21f8f1461b86616020465b..c0c0095b2b60397a1f17038e8f7c0542d9ed7c16 100644 (file)
@@ -2336,8 +2336,6 @@ static inline void super_set_sysfs_name_generic(struct super_block *sb, const ch
        va_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);
index baf200ab5c7777c2b08c3aa977fd37a413b09c26..0070764b790a3e251f04fe0ba510712673eca55e 100644 (file)
@@ -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 */
index fed86221c69c4bdb6fbd30d985e0af03e20f7b3e..b0679c7420a8e28674142e6918dc415bc9ff2a5b 100644 (file)
@@ -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 };