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
427e1bb8
Commit
427e1bb8
authored
Apr 16, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: fs_alloc_debug_to_text()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
feb25553
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
fs/bcachefs/sysfs.c
fs/bcachefs/sysfs.c
+35
-0
No files found.
fs/bcachefs/sysfs.c
View file @
427e1bb8
...
...
@@ -362,6 +362,37 @@ static void bch2_btree_wakeup_all(struct bch_fs *c)
seqmutex_unlock
(
&
c
->
btree_trans_lock
);
}
static
void
fs_alloc_debug_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
)
{
unsigned
nr
[
BCH_DATA_NR
];
memset
(
nr
,
0
,
sizeof
(
nr
));
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
c
->
open_buckets
);
i
++
)
nr
[
c
->
open_buckets
[
i
].
data_type
]
++
;
printbuf_tabstop_push
(
out
,
24
);
percpu_down_read
(
&
c
->
mark_lock
);
prt_printf
(
out
,
"hidden
\t
%llu
\n
"
,
bch2_fs_usage_read_one
(
c
,
&
c
->
usage_base
->
b
.
hidden
));
prt_printf
(
out
,
"btree
\t
%llu
\n
"
,
bch2_fs_usage_read_one
(
c
,
&
c
->
usage_base
->
b
.
btree
));
prt_printf
(
out
,
"data
\t
%llu
\n
"
,
bch2_fs_usage_read_one
(
c
,
&
c
->
usage_base
->
b
.
data
));
prt_printf
(
out
,
"cached
\t
%llu
\n
"
,
bch2_fs_usage_read_one
(
c
,
&
c
->
usage_base
->
b
.
cached
));
prt_printf
(
out
,
"reserved
\t
%llu
\n
"
,
bch2_fs_usage_read_one
(
c
,
&
c
->
usage_base
->
b
.
reserved
));
prt_printf
(
out
,
"online_reserved
\t
%llu
\n
"
,
percpu_u64_get
(
c
->
online_reserved
));
prt_printf
(
out
,
"nr_inodes
\t
%llu
\n
"
,
bch2_fs_usage_read_one
(
c
,
&
c
->
usage_base
->
b
.
nr_inodes
));
percpu_up_read
(
&
c
->
mark_lock
);
prt_newline
(
out
);
prt_printf
(
out
,
"freelist_wait
\t
%s
\n
"
,
c
->
freelist_wait
.
list
.
first
?
"waiting"
:
"empty"
);
prt_printf
(
out
,
"open buckets allocated
\t
%i
\n
"
,
OPEN_BUCKETS_COUNT
-
c
->
open_buckets_nr_free
);
prt_printf
(
out
,
"open buckets total
\t
%u
\n
"
,
OPEN_BUCKETS_COUNT
);
prt_printf
(
out
,
"open_buckets_wait
\t
%s
\n
"
,
c
->
open_buckets_wait
.
list
.
first
?
"waiting"
:
"empty"
);
prt_printf
(
out
,
"open_buckets_btree
\t
%u
\n
"
,
nr
[
BCH_DATA_btree
]);
prt_printf
(
out
,
"open_buckets_user
\t
%u
\n
"
,
nr
[
BCH_DATA_user
]);
prt_printf
(
out
,
"btree reserve cache
\t
%u
\n
"
,
c
->
btree_reserve_cache_nr
);
}
SHOW
(
bch2_fs
)
{
struct
bch_fs
*
c
=
container_of
(
kobj
,
struct
bch_fs
,
kobj
);
...
...
@@ -444,6 +475,9 @@ SHOW(bch2_fs)
if
(
attr
==
&
sysfs_disk_groups
)
bch2_disk_groups_to_text
(
out
,
c
);
if
(
attr
==
&
sysfs_alloc_debug
)
fs_alloc_debug_to_text
(
out
,
c
);
return
0
;
}
...
...
@@ -650,6 +684,7 @@ struct attribute *bch2_fs_internal_files[] = {
&
sysfs_internal_uuid
,
&
sysfs_disk_groups
,
&
sysfs_alloc_debug
,
NULL
};
...
...
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