btrfs: move split_flags/combine_flags helpers to inode-item.h
authorJosef Bacik <josef@toxicpanda.com>
Sat, 29 Apr 2023 20:07:18 +0000 (16:07 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:25 +0000 (13:59 +0200)
These are more related to the inode item flags on disk than the
in-memory btrfs_inode, move the helpers to inode-item.h.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode-item.h
fs/btrfs/tree-checker.c

index 0849b85b94fe964b044708eb2a98fad3a12495e6..08c9960233940837155c33423391a6d4b1ed4c82 100644 (file)
@@ -404,22 +404,6 @@ static inline bool btrfs_inode_can_compress(const struct btrfs_inode *inode)
        return true;
 }
 
-/*
- * btrfs_inode_item stores flags in a u64, btrfs_inode stores them in two
- * separate u32s. These two functions convert between the two representations.
- */
-static inline u64 btrfs_inode_combine_flags(u32 flags, u32 ro_flags)
-{
-       return (flags | ((u64)ro_flags << 32));
-}
-
-static inline void btrfs_inode_split_flags(u64 inode_item_flags,
-                                          u32 *flags, u32 *ro_flags)
-{
-       *flags = (u32)inode_item_flags;
-       *ro_flags = (u32)(inode_item_flags >> 32);
-}
-
 /* Array of bytes with variable length, hexadecimal format 0x1234 */
 #define CSUM_FMT                               "0x%*phN"
 #define CSUM_FMT_VALUE(size, bytes)            size, bytes
index b80aeb715701095add2fe1b5c514a2dd48829888..ede43b6c65591d0c48583d7244415a5609c52237 100644 (file)
@@ -60,6 +60,22 @@ struct btrfs_truncate_control {
        bool clear_extent_range;
 };
 
+/*
+ * btrfs_inode_item stores flags in a u64, btrfs_inode stores them in two
+ * separate u32s. These two functions convert between the two representations.
+ */
+static inline u64 btrfs_inode_combine_flags(u32 flags, u32 ro_flags)
+{
+       return (flags | ((u64)ro_flags << 32));
+}
+
+static inline void btrfs_inode_split_flags(u64 inode_item_flags,
+                                          u32 *flags, u32 *ro_flags)
+{
+       *flags = (u32)inode_item_flags;
+       *ro_flags = (u32)(inode_item_flags >> 32);
+}
+
 int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
                               struct btrfs_root *root,
                               struct btrfs_truncate_control *control);
index 9e92548a6aa21e8b9ba349ccc13c0c5402a45147..351ba9e90675d30abca33467ce9f10c711268eda 100644 (file)
 #include "compression.h"
 #include "volumes.h"
 #include "misc.h"
-#include "btrfs_inode.h"
 #include "fs.h"
 #include "accessors.h"
 #include "file-item.h"
+#include "inode-item.h"
 
 /*
  * Error message should follow the following format: