]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
btrfs: move super_block specific helpers into super.h
authorJosef Bacik <josef@toxicpanda.com>
Wed, 26 Oct 2022 19:08:40 +0000 (15:08 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:47 +0000 (18:00 +0100)
This will make syncing fs.h to user space a little easier if we can pull
the super block specific helpers out of fs.h and put them in super.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>
17 files changed:
fs/btrfs/compression.c
fs/btrfs/defrag.c
fs/btrfs/export.c
fs/btrfs/extent_io.c
fs/btrfs/file-item.c
fs/btrfs/file.c
fs/btrfs/free-space-cache.c
fs/btrfs/fs.h
fs/btrfs/inode.c
fs/btrfs/lzo.c
fs/btrfs/messages.c
fs/btrfs/ordered-data.c
fs/btrfs/props.c
fs/btrfs/reflink.c
fs/btrfs/relocation.c
fs/btrfs/super.h
fs/btrfs/volumes.c

index 61828f8375e62dfdbf3e772fedca0f119b1a0e34..e66fa18dbcf7a2ba459dfc404d2698a5b3065cab 100644 (file)
@@ -35,6 +35,7 @@
 #include "subpage.h"
 #include "zoned.h"
 #include "file-item.h"
+#include "super.h"
 
 static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" };
 
index ed82085acea3319d39f4204545d4234d4abe43e7..48a9460d49c779939842262df391f4292e9591cf 100644 (file)
@@ -15,6 +15,7 @@
 #include "subpage.h"
 #include "defrag.h"
 #include "file-item.h"
+#include "super.h"
 
 static struct kmem_cache *btrfs_inode_defrag_cachep;
 
index b6bc9684648fcef8270b7b88246ead3318ecb50e..744a02b7fd671748e488d6504cf8dab39cd5dd88 100644 (file)
@@ -8,6 +8,7 @@
 #include "print-tree.h"
 #include "export.h"
 #include "accessors.h"
+#include "super.h"
 
 #define BTRFS_FID_SIZE_NON_CONNECTABLE (offsetof(struct btrfs_fid, \
                                                 parent_objectid) / 4)
index 6373b15652503995fd5dae6fc7b01ecf03258171..bda420d697f49f2877aacf7176d6058d0c21070a 100644 (file)
@@ -35,6 +35,7 @@
 #include "file-item.h"
 #include "file.h"
 #include "dev-replace.h"
+#include "super.h"
 
 static struct kmem_cache *extent_buffer_cache;
 
index 20d88cd0b602b0407acc141826cc909d83e17577..036d50af5666cd4c83172740f6817d735d011211 100644 (file)
@@ -20,6 +20,7 @@
 #include "fs.h"
 #include "accessors.h"
 #include "file-item.h"
+#include "super.h"
 
 #define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \
                                   sizeof(struct btrfs_item) * 2) / \
index b94dc4b2c4867277945827ed1d367bf9a6c2862f..f9bea57abbde7295ddad725cc06c35e1ebaa684d 100644 (file)
@@ -36,6 +36,7 @@
 #include "file-item.h"
 #include "ioctl.h"
 #include "file.h"
+#include "super.h"
 
 /* simple helper to fault in pages and copy.  This should go away
  * and be replaced with calls into generic code.
index aef075b6318849a32f4bf0297dff62790a9fc6a1..797edb41d0aac5a3bb4d8fc7c06e67194f3bcc48 100644 (file)
@@ -29,6 +29,7 @@
 #include "accessors.h"
 #include "file-item.h"
 #include "file.h"
+#include "super.h"
 
 #define BITS_PER_BITMAP                (PAGE_SIZE * 8UL)
 #define MAX_CACHE_BYTES_PER_GIG        SZ_64K
index 7d0da8509567c5de8ac4ee9c6e2db22b43b68d56..c7f2a512fba248d891fd795126093a85757a7995 100644 (file)
@@ -801,11 +801,6 @@ static inline u64 btrfs_get_last_root_drop_gen(const struct btrfs_fs_info *fs_in
        return READ_ONCE(fs_info->last_root_drop_gen);
 }
 
-static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb)
-{
-       return sb->s_fs_info;
-}
-
 /*
  * Take the number of bytes to be checksummed and figure out how many leaves
  * it would require to store the csums for that many bytes.
@@ -947,18 +942,6 @@ static inline int btrfs_need_cleaner_sleep(struct btrfs_fs_info *fs_info)
                btrfs_fs_closing(fs_info);
 }
 
-static inline void btrfs_set_sb_rdonly(struct super_block *sb)
-{
-       sb->s_flags |= SB_RDONLY;
-       set_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);
-}
-
-static inline void btrfs_clear_sb_rdonly(struct super_block *sb)
-{
-       sb->s_flags &= ~SB_RDONLY;
-       clear_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);
-}
-
 static inline void btrfs_wake_unfinished_drop(struct btrfs_fs_info *fs_info)
 {
        clear_and_wake_up_bit(BTRFS_FS_UNFINISHED_DROPS, &fs_info->flags);
index 0fda1c5ba28e5108bc7505157be09b7c7f2d38bc..83e5ae6b74efb5525f10bb5790b3ec93b1474cd2 100644 (file)
@@ -68,6 +68,7 @@
 #include "acl.h"
 #include "relocation.h"
 #include "verity.h"
+#include "super.h"
 
 struct btrfs_iget_args {
        u64 ino;
index 6751874a3e699f7b05ae422ac2441d06057d3644..e7b1ceffcd33bfd40d9e8d1b0833dc82e19cf6f2 100644 (file)
@@ -16,6 +16,7 @@
 #include "messages.h"
 #include "compression.h"
 #include "ctree.h"
+#include "super.h"
 
 #define LZO_LEN        4
 
index 196757ee16f124337c3b7203bd65856b26cb48ca..625bbbbb2608d802a1d6b04f836b798d9f097941 100644 (file)
@@ -5,6 +5,7 @@
 #include "discard.h"
 #include "transaction.h"
 #include "space-info.h"
+#include "super.h"
 
 #ifdef CONFIG_PRINTK
 
index 2aea2a17ed958f34458b230238e3aaf961c5d086..8fda1949b71b0b20ac62c7ef219c2eccc1ee439c 100644 (file)
@@ -19,6 +19,7 @@
 #include "qgroup.h"
 #include "subpage.h"
 #include "file.h"
+#include "super.h"
 
 static struct kmem_cache *btrfs_ordered_extent_cache;
 
index 9ad15d69718c14a94ffdcdf1ccc01573371e12ac..0755af0e53e394f68a74bab6e830e79ae40d2348 100644 (file)
@@ -14,6 +14,7 @@
 #include "space-info.h"
 #include "fs.h"
 #include "accessors.h"
+#include "super.h"
 
 #define BTRFS_PROP_HANDLERS_HT_BITS 8
 static DEFINE_HASHTABLE(prop_handlers_ht, BTRFS_PROP_HANDLERS_HT_BITS);
index 3c962b5d8dbdd25154afb2496d3f82746e79ab1c..9d728107536e8182a91bff43f4b4f8a530081ef0 100644 (file)
@@ -14,6 +14,7 @@
 #include "accessors.h"
 #include "file-item.h"
 #include "file.h"
+#include "super.h"
 
 #define BTRFS_MAX_DEDUPE_LEN   SZ_16M
 
index f31a97d4f9ade08b61431c628de32596154ee8cf..d119986d1599e0752e83c2fe9394cbe1e8a37eb2 100644 (file)
@@ -34,6 +34,7 @@
 #include "root-tree.h"
 #include "file-item.h"
 #include "relocation.h"
+#include "super.h"
 
 /*
  * Relocation overview
index c8875653e6281b3c209a6c7a7f3e24ded87742b4..8dbb909b364f7f99ded93e92b271da015c813bb2 100644 (file)
@@ -9,4 +9,21 @@ int btrfs_sync_fs(struct super_block *sb, int wait);
 char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,
                                          u64 subvol_objectid);
 
+static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb)
+{
+       return sb->s_fs_info;
+}
+
+static inline void btrfs_set_sb_rdonly(struct super_block *sb)
+{
+       sb->s_flags |= SB_RDONLY;
+       set_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);
+}
+
+static inline void btrfs_clear_sb_rdonly(struct super_block *sb)
+{
+       sb->s_flags &= ~SB_RDONLY;
+       clear_bit(BTRFS_FS_STATE_RO, &btrfs_sb(sb)->fs_state);
+}
+
 #endif
index 5606060770eb8ef8758a6030d50034dd2dffd52a..1c9f7a94665796b65bd18e3fdc5e08f237eb0d87 100644 (file)
@@ -39,6 +39,7 @@
 #include "ioctl.h"
 #include "relocation.h"
 #include "scrub.h"
+#include "super.h"
 
 static struct bio_set btrfs_bioset;