From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 7/7] btrfs: move dev_stats helpers to volumes.c
Date: Fri, 23 Aug 2019 19:08:48 +0200 [thread overview]
Message-ID: <70943b43bb89d5c68067d40bf8fc8b8944a21a0b.1566579823.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1566579823.git.dsterba@suse.com>
The other dev stats functions are already there and the helpers are not
used by anything else.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/ctree.h | 24 ------------------------
fs/btrfs/volumes.c | 23 +++++++++++++++++++++++
2 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 5977995b1b69..35a94a43758d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2257,30 +2257,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);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index dc1f6985c2c4..104fa1c2afb0 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -7276,6 +7276,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;
--
2.22.0
next prev parent reply other threads:[~2019-08-23 17:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-23 17:08 [PATCH 0/7] Move some code out of ctree.c and ctree.h David Sterba
2019-08-23 17:08 ` [PATCH 1/7] btrfs: move cond_wake_up functions out of ctree David Sterba
2019-08-27 13:34 ` Johannes Thumshirn
2019-08-23 17:08 ` [PATCH 2/7] btrfs: move math functions to misc.h David Sterba
2019-08-27 13:35 ` Johannes Thumshirn
2019-08-23 17:08 ` [PATCH 3/7] btrfs: move private raid56 definitions from ctree.h David Sterba
2019-08-27 13:36 ` Johannes Thumshirn
2019-08-23 17:08 ` [PATCH 4/7] btrfs: rename and export read_node_slot David Sterba
2019-08-27 13:39 ` Johannes Thumshirn
2019-08-23 17:08 ` [PATCH 5/7] btrfs: move functions for tree compare to send.c David Sterba
2019-08-27 13:38 ` Johannes Thumshirn
2019-08-23 17:08 ` [PATCH 6/7] btrfs: move struct io_ctl to free-space-cache.h David Sterba
2019-08-27 13:40 ` Johannes Thumshirn
2019-08-23 17:08 ` David Sterba [this message]
2019-08-27 13:41 ` [PATCH 7/7] btrfs: move dev_stats helpers to volumes.c Johannes Thumshirn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70943b43bb89d5c68067d40bf8fc8b8944a21a0b.1566579823.git.dsterba@suse.com \
--to=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).