btrfs: move acl prototypes into acl.h
authorJosef Bacik <josef@toxicpanda.com>
Wed, 26 Oct 2022 19:08:33 +0000 (15:08 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:46 +0000 (18:00 +0100)
Move these out of ctree.h into acl.h to cut down on code in ctree.h.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/acl.c
fs/btrfs/acl.h [new file with mode: 0644]
fs/btrfs/ctree.h
fs/btrfs/inode.c

index 548d6a5477b42795dd54da6bfce0d6e6d973d642..100bae33c6778d0dcef43d97487871550cccda81 100644 (file)
 #include <linux/sched.h>
 #include <linux/sched/mm.h>
 #include <linux/slab.h>
-
 #include "ctree.h"
 #include "btrfs_inode.h"
 #include "xattr.h"
+#include "acl.h"
 
 struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu)
 {
diff --git a/fs/btrfs/acl.h b/fs/btrfs/acl.h
new file mode 100644 (file)
index 0000000..45197b4
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef BTRFS_ACL_H
+#define BTRFS_ACL_H
+
+#ifdef CONFIG_BTRFS_FS_POSIX_ACL
+
+struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu);
+int btrfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
+                 struct posix_acl *acl, int type);
+int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode,
+                   struct posix_acl *acl, int type);
+
+#else
+
+#define btrfs_get_acl NULL
+#define btrfs_set_acl NULL
+static inline int __btrfs_set_acl(struct btrfs_trans_handle *trans,
+                                 struct inode *inode, struct posix_acl *acl,
+                                 int type)
+{
+       return -EOPNOTSUPP;
+}
+
+#endif
+
+#endif
index dcbfb1b9d269ef40c7a49784f1d39997747addf8..040b640b0222fb34c21d972612367a1c18b3d900 100644 (file)
@@ -732,24 +732,6 @@ static inline unsigned long get_eb_page_index(unsigned long offset)
 #define EXPORT_FOR_TESTS
 #endif
 
-/* acl.c */
-#ifdef CONFIG_BTRFS_FS_POSIX_ACL
-struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu);
-int btrfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
-                 struct posix_acl *acl, int type);
-int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode,
-                   struct posix_acl *acl, int type);
-#else
-#define btrfs_get_acl NULL
-#define btrfs_set_acl NULL
-static inline int __btrfs_set_acl(struct btrfs_trans_handle *trans,
-                                 struct inode *inode, struct posix_acl *acl,
-                                 int type)
-{
-       return -EOPNOTSUPP;
-}
-#endif
-
 /* relocation.c */
 int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start);
 int btrfs_init_reloc_root(struct btrfs_trans_handle *trans,
index 3fe3301b88b39867e1426e27823a13b4226301cb..cb038dbbca7d59881c26c3ad966aaeb3e07a33e1 100644 (file)
@@ -65,6 +65,7 @@
 #include "uuid-tree.h"
 #include "ioctl.h"
 #include "file.h"
+#include "acl.h"
 
 struct btrfs_iget_args {
        u64 ino;