aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-25 11:51:31 -0500
committerDavid Sterba <dsterba@suse.com>2016-02-11 10:15:43 -0500
commit242e2956e4afde7727fffe21adc0a7b198b77f96 (patch)
tree15a67db1b4f27ab11ba1c3828e948a9b1ffeac1a /fs/btrfs
parent50c2d5abe64c1726b48d292a2ab04f60e8238933 (diff)
btrfs: switch dev stats item to the permanent item key
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.h5
-rw-r--r--fs/btrfs/volumes.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index ffc081e11277..70054ed2bd7b 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -100,6 +100,9 @@ struct btrfs_ordered_sum;
100/* tracks free space in block groups. */ 100/* tracks free space in block groups. */
101#define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL 101#define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL
102 102
103/* device stats in the device tree */
104#define BTRFS_DEV_STATS_OBJECTID 0ULL
105
103/* for storing balance parameters in the root tree */ 106/* for storing balance parameters in the root tree */
104#define BTRFS_BALANCE_OBJECTID -4ULL 107#define BTRFS_BALANCE_OBJECTID -4ULL
105 108
@@ -2219,7 +2222,7 @@ struct btrfs_ioctl_defrag_range_args {
2219 * 2222 *
2220 * - device statistics, store IO stats in the device tree, one key for all 2223 * - device statistics, store IO stats in the device tree, one key for all
2221 * stats 2224 * stats
2222 * (0, BTRFS_DEV_STATS_KEY, 0) 2225 * (BTRFS_DEV_STATS_OBJECTID, BTRFS_DEV_STATS_KEY, 0)
2223 */ 2226 */
2224#define BTRFS_PERSISTENT_ITEM_KEY 249 2227#define BTRFS_PERSISTENT_ITEM_KEY 249
2225 2228
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b306a205504b..177a0a8dfd31 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6705,8 +6705,8 @@ int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info)
6705 int item_size; 6705 int item_size;
6706 struct btrfs_dev_stats_item *ptr; 6706 struct btrfs_dev_stats_item *ptr;
6707 6707
6708 key.objectid = 0; 6708 key.objectid = BTRFS_DEV_STATS_OBJECTID;
6709 key.type = BTRFS_DEV_STATS_KEY; 6709 key.type = BTRFS_PERSISTENT_ITEM_KEY;
6710 key.offset = device->devid; 6710 key.offset = device->devid;
6711 ret = btrfs_search_slot(NULL, dev_root, &key, path, 0, 0); 6711 ret = btrfs_search_slot(NULL, dev_root, &key, path, 0, 0);
6712 if (ret) { 6712 if (ret) {
@@ -6753,8 +6753,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
6753 int ret; 6753 int ret;
6754 int i; 6754 int i;
6755 6755
6756 key.objectid = 0; 6756 key.objectid = BTRFS_DEV_STATS_OBJECTID;
6757 key.type = BTRFS_DEV_STATS_KEY; 6757 key.type = BTRFS_PERSISTENT_ITEM_KEY;
6758 key.offset = device->devid; 6758 key.offset = device->devid;
6759 6759
6760 path = btrfs_alloc_path(); 6760 path = btrfs_alloc_path();