btrfs: move dev_stats helpers to volumes.c
authorDavid Sterba <dsterba@suse.com>
Wed, 21 Aug 2019 18:05:32 +0000 (20:05 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:16 +0000 (14:59 +0200)
The other dev stats functions are already there and the helpers are not
used by anything else.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/volumes.c

index 0b6eca7..ba34f7b 100644 (file)
@@ -2258,30 +2258,6 @@ static inline u32 btrfs_file_extent_inline_item_len(
        return btrfs_item_size(eb, e) - BTRFS_FILE_EXTENT_INLINE_DATA_START;
 }
 
-/* btrfs_dev_stats_item */
-static inline u64 btrfs_dev_stats_value(const struct extent_buffer *eb,
-                                       const struct btrfs_dev_stats_item *ptr,
-                                       int index)
-{
-       u64 val;
-
-       read_extent_buffer(eb, &val,
-                          offsetof(struct btrfs_dev_stats_item, values) +
-                           ((unsigned long)ptr) + (index * sizeof(u64)),
-                          sizeof(val));
-       return val;
-}
-
-static inline void btrfs_set_dev_stats_value(struct extent_buffer *eb,
-                                            struct btrfs_dev_stats_item *ptr,
-                                            int index, u64 val)
-{
-       write_extent_buffer(eb, &val,
-                           offsetof(struct btrfs_dev_stats_item, values) +
-                            ((unsigned long)ptr) + (index * sizeof(u64)),
-                           sizeof(val));
-}
-
 /* btrfs_qgroup_status_item */
 BTRFS_SETGET_FUNCS(qgroup_status_generation, struct btrfs_qgroup_status_item,
                   generation, 64);
index 02976c1..a324480 100644 (file)
@@ -7285,6 +7285,29 @@ void btrfs_init_devices_late(struct btrfs_fs_info *fs_info)
        }
 }
 
+static u64 btrfs_dev_stats_value(const struct extent_buffer *eb,
+                                const struct btrfs_dev_stats_item *ptr,
+                                int index)
+{
+       u64 val;
+
+       read_extent_buffer(eb, &val,
+                          offsetof(struct btrfs_dev_stats_item, values) +
+                           ((unsigned long)ptr) + (index * sizeof(u64)),
+                          sizeof(val));
+       return val;
+}
+
+static void btrfs_set_dev_stats_value(struct extent_buffer *eb,
+                                     struct btrfs_dev_stats_item *ptr,
+                                     int index, u64 val)
+{
+       write_extent_buffer(eb, &val,
+                           offsetof(struct btrfs_dev_stats_item, values) +
+                            ((unsigned long)ptr) + (index * sizeof(u64)),
+                           sizeof(val));
+}
+
 int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info)
 {
        struct btrfs_key key;