Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
67d605fe
Commit
67d605fe
authored
Feb 26, 2016
by
David Sterba
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/rename-keys' into for-chris-4.6
parents
e22b3d1f
9f07e1d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
12 deletions
+64
-12
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+36
-3
fs/btrfs/print-tree.c
fs/btrfs/print-tree.c
+21
-2
fs/btrfs/volumes.c
fs/btrfs/volumes.c
+7
-7
No files found.
fs/btrfs/ctree.h
View file @
67d605fe
...
...
@@ -100,6 +100,9 @@ struct btrfs_ordered_sum;
/* tracks free space in block groups. */
#define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL
/* device stats in the device tree */
#define BTRFS_DEV_STATS_OBJECTID 0ULL
/* for storing balance parameters in the root tree */
#define BTRFS_BALANCE_OBJECTID -4ULL
...
...
@@ -2185,13 +2188,43 @@ struct btrfs_ioctl_defrag_range_args {
*/
#define BTRFS_QGROUP_RELATION_KEY 246
/*
* Obsolete name, see BTRFS_TEMPORARY_ITEM_KEY.
*/
#define BTRFS_BALANCE_ITEM_KEY 248
/*
* Persistantly stores the io stats in the device tree.
* One key for all stats, (0, BTRFS_DEV_STATS_KEY, devid).
* The key type for tree items that are stored persistently, but do not need to
* exist for extended period of time. The items can exist in any tree.
*
* [subtype, BTRFS_TEMPORARY_ITEM_KEY, data]
*
* Existing items:
*
* - balance status item
* (BTRFS_BALANCE_OBJECTID, BTRFS_TEMPORARY_ITEM_KEY, 0)
*/
#define BTRFS_TEMPORARY_ITEM_KEY 248
/*
* Obsolete name, see BTRFS_PERSISTENT_ITEM_KEY
*/
#define BTRFS_DEV_STATS_KEY 249
/*
* The key type for tree items that are stored persistently and usually exist
* for a long period, eg. filesystem lifetime. The item kinds can be status
* information, stats or preference values. The item can exist in any tree.
*
* [subtype, BTRFS_PERSISTENT_ITEM_KEY, data]
*
* Existing items:
*
* - device statistics, store IO stats in the device tree, one key for all
* stats
* (BTRFS_DEV_STATS_OBJECTID, BTRFS_DEV_STATS_KEY, 0)
*/
#define BTRFS_
DEV_STATS
_KEY 249
#define BTRFS_
PERSISTENT_ITEM
_KEY 249
/*
* Persistantly stores the device replace state in the device tree.
...
...
fs/btrfs/print-tree.c
View file @
67d605fe
...
...
@@ -295,8 +295,27 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
btrfs_dev_extent_chunk_offset
(
l
,
dev_extent
),
btrfs_dev_extent_length
(
l
,
dev_extent
));
break
;
case
BTRFS_DEV_STATS_KEY
:
printk
(
KERN_INFO
"
\t\t
device stats
\n
"
);
case
BTRFS_PERSISTENT_ITEM_KEY
:
printk
(
KERN_INFO
"
\t\t
persistent item objectid %llu offset %llu
\n
"
,
key
.
objectid
,
key
.
offset
);
switch
(
key
.
objectid
)
{
case
BTRFS_DEV_STATS_OBJECTID
:
printk
(
KERN_INFO
"
\t\t
device stats
\n
"
);
break
;
default:
printk
(
KERN_INFO
"
\t\t
unknown persistent item
\n
"
);
}
break
;
case
BTRFS_TEMPORARY_ITEM_KEY
:
printk
(
KERN_INFO
"
\t\t
temporary item objectid %llu offset %llu
\n
"
,
key
.
objectid
,
key
.
offset
);
switch
(
key
.
objectid
)
{
case
BTRFS_BALANCE_OBJECTID
:
printk
(
KERN_INFO
"
\t\t
balance status
\n
"
);
break
;
default:
printk
(
KERN_INFO
"
\t\t
unknown temporary item
\n
"
);
}
break
;
case
BTRFS_DEV_REPLACE_KEY
:
printk
(
KERN_INFO
"
\t\t
dev replace
\n
"
);
...
...
fs/btrfs/volumes.c
View file @
67d605fe
...
...
@@ -2967,7 +2967,7 @@ static int insert_balance_item(struct btrfs_root *root,
}
key
.
objectid
=
BTRFS_BALANCE_OBJECTID
;
key
.
type
=
BTRFS_
BALANCE
_ITEM_KEY
;
key
.
type
=
BTRFS_
TEMPORARY
_ITEM_KEY
;
key
.
offset
=
0
;
ret
=
btrfs_insert_empty_item
(
trans
,
root
,
path
,
&
key
,
...
...
@@ -3016,7 +3016,7 @@ static int del_balance_item(struct btrfs_root *root)
}
key
.
objectid
=
BTRFS_BALANCE_OBJECTID
;
key
.
type
=
BTRFS_
BALANCE
_ITEM_KEY
;
key
.
type
=
BTRFS_
TEMPORARY
_ITEM_KEY
;
key
.
offset
=
0
;
ret
=
btrfs_search_slot
(
trans
,
root
,
&
key
,
path
,
-
1
,
1
);
...
...
@@ -3868,7 +3868,7 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info)
return
-
ENOMEM
;
key
.
objectid
=
BTRFS_BALANCE_OBJECTID
;
key
.
type
=
BTRFS_
BALANCE
_ITEM_KEY
;
key
.
type
=
BTRFS_
TEMPORARY
_ITEM_KEY
;
key
.
offset
=
0
;
ret
=
btrfs_search_slot
(
NULL
,
fs_info
->
tree_root
,
&
key
,
path
,
0
,
0
);
...
...
@@ -6706,8 +6706,8 @@ int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info)
int
item_size
;
struct
btrfs_dev_stats_item
*
ptr
;
key
.
objectid
=
0
;
key
.
type
=
BTRFS_
DEV_STATS
_KEY
;
key
.
objectid
=
BTRFS_DEV_STATS_OBJECTID
;
key
.
type
=
BTRFS_
PERSISTENT_ITEM
_KEY
;
key
.
offset
=
device
->
devid
;
ret
=
btrfs_search_slot
(
NULL
,
dev_root
,
&
key
,
path
,
0
,
0
);
if
(
ret
)
{
...
...
@@ -6754,8 +6754,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
int
ret
;
int
i
;
key
.
objectid
=
0
;
key
.
type
=
BTRFS_
DEV_STATS
_KEY
;
key
.
objectid
=
BTRFS_DEV_STATS_OBJECTID
;
key
.
type
=
BTRFS_
PERSISTENT_ITEM
_KEY
;
key
.
offset
=
device
->
devid
;
path
=
btrfs_alloc_path
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment