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
7423330e
Commit
7423330e
authored
Apr 10, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: prt_printf() now respects \r\n\t
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
2dcb605e
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
226 additions
and
589 deletions
+226
-589
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_background.c
+11
-21
fs/bcachefs/backpointers.c
fs/bcachefs/backpointers.c
+1
-2
fs/bcachefs/btree_io.c
fs/bcachefs/btree_io.c
+5
-10
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+6
-12
fs/bcachefs/btree_key_cache.c
fs/bcachefs/btree_key_cache.c
+3
-6
fs/bcachefs/btree_locking.c
fs/bcachefs/btree_locking.c
+2
-4
fs/bcachefs/btree_trans_commit.c
fs/bcachefs/btree_trans_commit.c
+2
-4
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+5
-16
fs/bcachefs/checksum.c
fs/bcachefs/checksum.c
+4
-8
fs/bcachefs/debug.c
fs/bcachefs/debug.c
+16
-48
fs/bcachefs/inode.c
fs/bcachefs/inode.c
+7
-17
fs/bcachefs/io_read.c
fs/bcachefs/io_read.c
+1
-2
fs/bcachefs/io_write.c
fs/bcachefs/io_write.c
+1
-2
fs/bcachefs/journal.c
fs/bcachefs/journal.c
+41
-56
fs/bcachefs/move.c
fs/bcachefs/move.c
+12
-25
fs/bcachefs/quota.c
fs/bcachefs/quota.c
+19
-93
fs/bcachefs/sb-clean.c
fs/bcachefs/sb-clean.c
+2
-4
fs/bcachefs/sb-counters.c
fs/bcachefs/sb-counters.c
+4
-11
fs/bcachefs/sb-downgrade.c
fs/bcachefs/sb-downgrade.c
+3
-6
fs/bcachefs/sb-members.c
fs/bcachefs/sb-members.c
+24
-72
fs/bcachefs/super-io.c
fs/bcachefs/super-io.c
+21
-49
fs/bcachefs/sysfs.c
fs/bcachefs/sysfs.c
+19
-77
fs/bcachefs/util.c
fs/bcachefs/util.c
+17
-44
No files found.
fs/bcachefs/alloc_background.c
View file @
7423330e
...
...
@@ -330,27 +330,17 @@ void bch2_alloc_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c
prt_printf
(
out
,
"gen %u oldest_gen %u data_type "
,
a
->
gen
,
a
->
oldest_gen
);
bch2_prt_data_type
(
out
,
a
->
data_type
);
prt_newline
(
out
);
prt_printf
(
out
,
"journal_seq %llu"
,
a
->
journal_seq
);
prt_newline
(
out
);
prt_printf
(
out
,
"need_discard %llu"
,
BCH_ALLOC_V4_NEED_DISCARD
(
a
));
prt_newline
(
out
);
prt_printf
(
out
,
"need_inc_gen %llu"
,
BCH_ALLOC_V4_NEED_INC_GEN
(
a
));
prt_newline
(
out
);
prt_printf
(
out
,
"dirty_sectors %u"
,
a
->
dirty_sectors
);
prt_newline
(
out
);
prt_printf
(
out
,
"cached_sectors %u"
,
a
->
cached_sectors
);
prt_newline
(
out
);
prt_printf
(
out
,
"stripe %u"
,
a
->
stripe
);
prt_newline
(
out
);
prt_printf
(
out
,
"stripe_redundancy %u"
,
a
->
stripe_redundancy
);
prt_newline
(
out
);
prt_printf
(
out
,
"io_time[READ] %llu"
,
a
->
io_time
[
READ
]);
prt_newline
(
out
);
prt_printf
(
out
,
"io_time[WRITE] %llu"
,
a
->
io_time
[
WRITE
]);
prt_newline
(
out
);
prt_printf
(
out
,
"fragmentation %llu"
,
a
->
fragmentation_lru
);
prt_newline
(
out
);
prt_printf
(
out
,
"bp_start %llu"
,
BCH_ALLOC_V4_BACKPOINTERS_START
(
a
));
prt_printf
(
out
,
"journal_seq %llu
\n
"
,
a
->
journal_seq
);
prt_printf
(
out
,
"need_discard %llu
\n
"
,
BCH_ALLOC_V4_NEED_DISCARD
(
a
));
prt_printf
(
out
,
"need_inc_gen %llu
\n
"
,
BCH_ALLOC_V4_NEED_INC_GEN
(
a
));
prt_printf
(
out
,
"dirty_sectors %u
\n
"
,
a
->
dirty_sectors
);
prt_printf
(
out
,
"cached_sectors %u
\n
"
,
a
->
cached_sectors
);
prt_printf
(
out
,
"stripe %u
\n
"
,
a
->
stripe
);
prt_printf
(
out
,
"stripe_redundancy %u
\n
"
,
a
->
stripe_redundancy
);
prt_printf
(
out
,
"io_time[READ] %llu
\n
"
,
a
->
io_time
[
READ
]);
prt_printf
(
out
,
"io_time[WRITE] %llu
\n
"
,
a
->
io_time
[
WRITE
]);
prt_printf
(
out
,
"fragmentation %llu
\n
"
,
a
->
fragmentation_lru
);
prt_printf
(
out
,
"bp_start %llu
\n
"
,
BCH_ALLOC_V4_BACKPOINTERS_START
(
a
));
printbuf_indent_sub
(
out
,
2
);
}
...
...
fs/bcachefs/backpointers.c
View file @
7423330e
...
...
@@ -117,8 +117,7 @@ static noinline int backpointer_mod_err(struct btree_trans *trans,
bch_err
(
c
,
"%s"
,
buf
.
buf
);
}
else
if
(
c
->
curr_recovery_pass
>
BCH_RECOVERY_PASS_check_extents_to_backpointers
)
{
prt_printf
(
&
buf
,
"backpointer not found when deleting"
);
prt_newline
(
&
buf
);
prt_printf
(
&
buf
,
"backpointer not found when deleting
\n
"
);
printbuf_indent_add
(
&
buf
,
2
);
prt_printf
(
&
buf
,
"searching for "
);
...
...
fs/bcachefs/btree_io.c
View file @
7423330e
...
...
@@ -522,7 +522,9 @@ static void btree_err_msg(struct printbuf *out, struct bch_fs *c,
prt_printf
(
out
,
"at btree "
);
bch2_btree_pos_to_text
(
out
,
c
,
b
);
prt_printf
(
out
,
"
\n
node offset %u/%u"
,
printbuf_indent_add
(
out
,
2
);
prt_printf
(
out
,
"
\n
node offset %u/%u"
,
b
->
written
,
btree_ptr_sectors_written
(
&
b
->
key
));
if
(
i
)
prt_printf
(
out
,
" bset u64s %u"
,
le16_to_cpu
(
i
->
u64s
));
...
...
@@ -2344,20 +2346,13 @@ void bch2_btree_write_stats_to_text(struct printbuf *out, struct bch_fs *c)
printbuf_tabstop_push
(
out
,
20
);
printbuf_tabstop_push
(
out
,
10
);
prt_tab
(
out
);
prt_str
(
out
,
"nr"
);
prt_tab
(
out
);
prt_str
(
out
,
"size"
);
prt_newline
(
out
);
prt_printf
(
out
,
"
\t
nr
\t
size
\n
"
);
for
(
unsigned
i
=
0
;
i
<
BTREE_WRITE_TYPE_NR
;
i
++
)
{
u64
nr
=
atomic64_read
(
&
c
->
btree_write_stats
[
i
].
nr
);
u64
bytes
=
atomic64_read
(
&
c
->
btree_write_stats
[
i
].
bytes
);
prt_printf
(
out
,
"%s:"
,
bch2_btree_write_types
[
i
]);
prt_tab
(
out
);
prt_u64
(
out
,
nr
);
prt_tab
(
out
);
prt_printf
(
out
,
"%s:
\t
%llu
\t
"
,
bch2_btree_write_types
[
i
],
nr
);
prt_human_readable_u64
(
out
,
nr
?
div64_u64
(
bytes
,
nr
)
:
0
);
prt_newline
(
out
);
}
...
...
fs/bcachefs/btree_iter.c
View file @
7423330e
...
...
@@ -1387,19 +1387,17 @@ void __noreturn bch2_trans_in_restart_error(struct btree_trans *trans)
noinline
__cold
void
bch2_trans_updates_to_text
(
struct
printbuf
*
buf
,
struct
btree_trans
*
trans
)
{
prt_printf
(
buf
,
"transaction updates for %s journal seq %llu"
,
prt_printf
(
buf
,
"transaction updates for %s journal seq %llu
\n
"
,
trans
->
fn
,
trans
->
journal_res
.
seq
);
prt_newline
(
buf
);
printbuf_indent_add
(
buf
,
2
);
trans_for_each_update
(
trans
,
i
)
{
struct
bkey_s_c
old
=
{
&
i
->
old_k
,
i
->
old_v
};
prt_printf
(
buf
,
"update: btree=%s cached=%u %pS"
,
prt_printf
(
buf
,
"update: btree=%s cached=%u %pS
\n
"
,
bch2_btree_id_str
(
i
->
btree_id
),
i
->
cached
,
(
void
*
)
i
->
ip_allocated
);
prt_newline
(
buf
);
prt_printf
(
buf
,
" old "
);
bch2_bkey_val_to_text
(
buf
,
trans
->
c
,
old
);
...
...
@@ -3166,13 +3164,11 @@ bch2_btree_bkey_cached_common_to_text(struct printbuf *out,
pid
=
owner
?
owner
->
pid
:
0
;
rcu_read_unlock
();
prt_tab
(
out
);
prt_printf
(
out
,
"%px %c l=%u %s:"
,
b
,
b
->
cached
?
'c'
:
'b'
,
prt_printf
(
out
,
"
\t
%px %c l=%u %s:"
,
b
,
b
->
cached
?
'c'
:
'b'
,
b
->
level
,
bch2_btree_id_str
(
b
->
btree_id
));
bch2_bpos_to_text
(
out
,
btree_node_pos
(
b
));
prt_tab
(
out
);
prt_printf
(
out
,
" locks %u:%u:%u held by pid %u"
,
prt_printf
(
out
,
"
\t
locks %u:%u:%u held by pid %u"
,
c
.
n
[
0
],
c
.
n
[
1
],
c
.
n
[
2
],
pid
);
}
...
...
@@ -3229,10 +3225,8 @@ void bch2_btree_trans_to_text(struct printbuf *out, struct btree_trans *trans)
b
=
READ_ONCE
(
trans
->
locking
);
if
(
b
)
{
prt_printf
(
out
,
" blocked for %lluus on"
,
div_u64
(
local_clock
()
-
trans
->
locking_wait
.
start_time
,
1000
));
prt_newline
(
out
);
prt_printf
(
out
,
" blocked for %lluus on
\n
"
,
div_u64
(
local_clock
()
-
trans
->
locking_wait
.
start_time
,
1000
));
prt_printf
(
out
,
" %c"
,
lock_types
[
trans
->
locking_wait
.
lock_want
]);
bch2_btree_bkey_cached_common_to_text
(
out
,
b
);
prt_newline
(
out
);
...
...
fs/bcachefs/btree_key_cache.c
View file @
7423330e
...
...
@@ -1039,12 +1039,9 @@ int bch2_fs_btree_key_cache_init(struct btree_key_cache *bc)
void
bch2_btree_key_cache_to_text
(
struct
printbuf
*
out
,
struct
btree_key_cache
*
c
)
{
prt_printf
(
out
,
"nr_freed:
\t
%lu"
,
atomic_long_read
(
&
c
->
nr_freed
));
prt_newline
(
out
);
prt_printf
(
out
,
"nr_keys:
\t
%lu"
,
atomic_long_read
(
&
c
->
nr_keys
));
prt_newline
(
out
);
prt_printf
(
out
,
"nr_dirty:
\t
%lu"
,
atomic_long_read
(
&
c
->
nr_dirty
));
prt_newline
(
out
);
prt_printf
(
out
,
"nr_freed:
\t
%lu
\n
"
,
atomic_long_read
(
&
c
->
nr_freed
));
prt_printf
(
out
,
"nr_keys:
\t
%lu
\n
"
,
atomic_long_read
(
&
c
->
nr_keys
));
prt_printf
(
out
,
"nr_dirty:
\t
%lu
\n
"
,
atomic_long_read
(
&
c
->
nr_dirty
));
}
void
bch2_btree_key_cache_exit
(
void
)
...
...
fs/bcachefs/btree_locking.c
View file @
7423330e
...
...
@@ -83,8 +83,7 @@ static noinline void print_cycle(struct printbuf *out, struct lock_graph *g)
{
struct
trans_waiting_for_lock
*
i
;
prt_printf
(
out
,
"Found lock cycle (%u entries):"
,
g
->
nr
);
prt_newline
(
out
);
prt_printf
(
out
,
"Found lock cycle (%u entries):
\n
"
,
g
->
nr
);
for
(
i
=
g
->
g
;
i
<
g
->
g
+
g
->
nr
;
i
++
)
{
struct
task_struct
*
task
=
READ_ONCE
(
i
->
trans
->
locking_wait
.
task
);
...
...
@@ -224,8 +223,7 @@ static noinline int break_cycle(struct lock_graph *g, struct printbuf *cycle)
bch2_btree_trans_to_text
(
&
buf
,
trans
);
prt_printf
(
&
buf
,
"backtrace:"
);
prt_newline
(
&
buf
);
prt_printf
(
&
buf
,
"backtrace:
\n
"
);
printbuf_indent_add
(
&
buf
,
2
);
bch2_prt_task_backtrace
(
&
buf
,
trans
->
locking_wait
.
task
,
2
,
GFP_NOWAIT
);
printbuf_indent_sub
(
&
buf
,
2
);
...
...
fs/bcachefs/btree_trans_commit.c
View file @
7423330e
...
...
@@ -773,9 +773,8 @@ static noinline int bch2_trans_commit_bkey_invalid(struct btree_trans *trans,
struct
bch_fs
*
c
=
trans
->
c
;
printbuf_reset
(
err
);
prt_printf
(
err
,
"invalid bkey on insert from %s -> %ps"
,
prt_printf
(
err
,
"invalid bkey on insert from %s -> %ps
\n
"
,
trans
->
fn
,
(
void
*
)
i
->
ip_allocated
);
prt_newline
(
err
);
printbuf_indent_add
(
err
,
2
);
bch2_bkey_val_to_text
(
err
,
c
,
bkey_i_to_s_c
(
i
->
k
));
...
...
@@ -796,8 +795,7 @@ static noinline int bch2_trans_commit_journal_entry_invalid(struct btree_trans *
struct
bch_fs
*
c
=
trans
->
c
;
struct
printbuf
buf
=
PRINTBUF
;
prt_printf
(
&
buf
,
"invalid bkey on insert from %s"
,
trans
->
fn
);
prt_newline
(
&
buf
);
prt_printf
(
&
buf
,
"invalid bkey on insert from %s
\n
"
,
trans
->
fn
);
printbuf_indent_add
(
&
buf
,
2
);
bch2_journal_entry_to_text
(
&
buf
,
c
,
i
);
...
...
fs/bcachefs/buckets.c
View file @
7423330e
...
...
@@ -274,25 +274,14 @@ void bch2_dev_usage_init(struct bch_dev *ca)
void
bch2_dev_usage_to_text
(
struct
printbuf
*
out
,
struct
bch_dev_usage
*
usage
)
{
prt_tab
(
out
);
prt_str
(
out
,
"buckets"
);
prt_tab_rjust
(
out
);
prt_str
(
out
,
"sectors"
);
prt_tab_rjust
(
out
);
prt_str
(
out
,
"fragmented"
);
prt_tab_rjust
(
out
);
prt_newline
(
out
);
prt_printf
(
out
,
"
\t
buckets
\r
sectors
\r
fragmented
\r\n
"
);
for
(
unsigned
i
=
0
;
i
<
BCH_DATA_NR
;
i
++
)
{
bch2_prt_data_type
(
out
,
i
);
prt_tab
(
out
);
prt_u64
(
out
,
usage
->
d
[
i
].
buckets
);
prt_tab_rjust
(
out
);
prt_u64
(
out
,
usage
->
d
[
i
].
sectors
);
prt_tab_rjust
(
out
);
prt_u64
(
out
,
usage
->
d
[
i
].
fragmented
);
prt_tab_rjust
(
out
);
prt_newline
(
out
);
prt_printf
(
out
,
"
\t
%llu
\r
%llu
\r
%llu
\r\n
"
,
usage
->
d
[
i
].
buckets
,
usage
->
d
[
i
].
sectors
,
usage
->
d
[
i
].
fragmented
);
}
}
...
...
fs/bcachefs/checksum.c
View file @
7423330e
...
...
@@ -494,14 +494,10 @@ static void bch2_sb_crypt_to_text(struct printbuf *out, struct bch_sb *sb,
{
struct
bch_sb_field_crypt
*
crypt
=
field_to_type
(
f
,
crypt
);
prt_printf
(
out
,
"KFD: %llu"
,
BCH_CRYPT_KDF_TYPE
(
crypt
));
prt_newline
(
out
);
prt_printf
(
out
,
"scrypt n: %llu"
,
BCH_KDF_SCRYPT_N
(
crypt
));
prt_newline
(
out
);
prt_printf
(
out
,
"scrypt r: %llu"
,
BCH_KDF_SCRYPT_R
(
crypt
));
prt_newline
(
out
);
prt_printf
(
out
,
"scrypt p: %llu"
,
BCH_KDF_SCRYPT_P
(
crypt
));
prt_newline
(
out
);
prt_printf
(
out
,
"KFD: %llu
\n
"
,
BCH_CRYPT_KDF_TYPE
(
crypt
));
prt_printf
(
out
,
"scrypt n: %llu
\n
"
,
BCH_KDF_SCRYPT_N
(
crypt
));
prt_printf
(
out
,
"scrypt r: %llu
\n
"
,
BCH_KDF_SCRYPT_R
(
crypt
));
prt_printf
(
out
,
"scrypt p: %llu
\n
"
,
BCH_KDF_SCRYPT_P
(
crypt
));
}
const
struct
bch_sb_field_ops
bch_sb_field_ops_crypt
=
{
...
...
fs/bcachefs/debug.c
View file @
7423330e
...
...
@@ -492,51 +492,26 @@ static void bch2_cached_btree_node_to_text(struct printbuf *out, struct bch_fs *
if
(
!
out
->
nr_tabstops
)
printbuf_tabstop_push
(
out
,
32
);
prt_printf
(
out
,
"%px btree=%s l=%u "
,
b
,
bch2_btree_id_str
(
b
->
c
.
btree_id
),
b
->
c
.
level
);
prt_newline
(
out
);
prt_printf
(
out
,
"%px btree=%s l=%u
\n
"
,
b
,
bch2_btree_id_str
(
b
->
c
.
btree_id
),
b
->
c
.
level
);
printbuf_indent_add
(
out
,
2
);
bch2_bkey_val_to_text
(
out
,
c
,
bkey_i_to_s_c
(
&
b
->
key
));
prt_newline
(
out
);
prt_printf
(
out
,
"flags: "
);
prt_tab
(
out
);
prt_printf
(
out
,
"flags:
\t
"
);
prt_bitflags
(
out
,
bch2_btree_node_flags
,
b
->
flags
);
prt_newline
(
out
);
prt_printf
(
out
,
"pcpu read locks: "
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
b
->
c
.
lock
.
readers
!=
NULL
);
prt_newline
(
out
);
prt_printf
(
out
,
"written:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
b
->
written
);
prt_newline
(
out
);
prt_printf
(
out
,
"writes blocked:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
!
list_empty_careful
(
&
b
->
write_blocked
));
prt_newline
(
out
);
prt_printf
(
out
,
"will make reachable:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%lx"
,
b
->
will_make_reachable
);
prt_newline
(
out
);
prt_printf
(
out
,
"journal pin %px:"
,
&
b
->
writes
[
0
].
journal
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
b
->
writes
[
0
].
journal
.
seq
);
prt_newline
(
out
);
prt_printf
(
out
,
"pcpu read locks:
\t
%u
\n
"
,
b
->
c
.
lock
.
readers
!=
NULL
);
prt_printf
(
out
,
"written:
\t
%u
\n
"
,
b
->
written
);
prt_printf
(
out
,
"writes blocked:
\t
%u
\n
"
,
!
list_empty_careful
(
&
b
->
write_blocked
));
prt_printf
(
out
,
"will make reachable:
\t
%lx
\n
"
,
b
->
will_make_reachable
);
prt_printf
(
out
,
"journal pin %px:
"
,
&
b
->
writes
[
1
].
journal
);
prt_tab
(
out
);
prt_printf
(
out
,
"
%llu"
,
b
->
writes
[
1
].
journal
.
seq
);
prt_newline
(
out
);
prt_printf
(
out
,
"journal pin %px:
\t
%llu
\n
"
,
&
b
->
writes
[
0
].
journal
,
b
->
writes
[
0
].
journal
.
seq
);
prt_printf
(
out
,
"
journal pin %px:
\t
%llu
\n
"
,
&
b
->
writes
[
1
].
journal
,
b
->
writes
[
1
].
journal
.
seq
);
printbuf_indent_sub
(
out
,
2
);
}
...
...
@@ -625,8 +600,7 @@ static ssize_t bch2_btree_transactions_read(struct file *file, char __user *buf,
bch2_btree_trans_to_text
(
&
i
->
buf
,
trans
);
prt_printf
(
&
i
->
buf
,
"backtrace:"
);
prt_newline
(
&
i
->
buf
);
prt_printf
(
&
i
->
buf
,
"backtrace:
\n
"
);
printbuf_indent_add
(
&
i
->
buf
,
2
);
bch2_prt_task_backtrace
(
&
i
->
buf
,
task
,
0
,
GFP_KERNEL
);
printbuf_indent_sub
(
&
i
->
buf
,
2
);
...
...
@@ -782,25 +756,20 @@ static ssize_t btree_transaction_stats_read(struct file *file, char __user *buf,
!
bch2_btree_transaction_fns
[
i
->
iter
])
break
;
prt_printf
(
&
i
->
buf
,
"%s: "
,
bch2_btree_transaction_fns
[
i
->
iter
]);
prt_newline
(
&
i
->
buf
);
prt_printf
(
&
i
->
buf
,
"%s:
\n
"
,
bch2_btree_transaction_fns
[
i
->
iter
]);
printbuf_indent_add
(
&
i
->
buf
,
2
);
mutex_lock
(
&
s
->
lock
);
prt_printf
(
&
i
->
buf
,
"Max mem used: %u"
,
s
->
max_mem
);
prt_newline
(
&
i
->
buf
);
prt_printf
(
&
i
->
buf
,
"Transaction duration:"
);
prt_newline
(
&
i
->
buf
);
prt_printf
(
&
i
->
buf
,
"Max mem used: %u
\n
"
,
s
->
max_mem
);
prt_printf
(
&
i
->
buf
,
"Transaction duration:
\n
"
);
printbuf_indent_add
(
&
i
->
buf
,
2
);
bch2_time_stats_to_text
(
&
i
->
buf
,
&
s
->
duration
);
printbuf_indent_sub
(
&
i
->
buf
,
2
);
if
(
IS_ENABLED
(
CONFIG_BCACHEFS_LOCK_TIME_STATS
))
{
prt_printf
(
&
i
->
buf
,
"Lock hold times:"
);
prt_newline
(
&
i
->
buf
);
prt_printf
(
&
i
->
buf
,
"Lock hold times:
\n
"
);
printbuf_indent_add
(
&
i
->
buf
,
2
);
bch2_time_stats_to_text
(
&
i
->
buf
,
&
s
->
lock_hold_times
);
...
...
@@ -808,8 +777,7 @@ static ssize_t btree_transaction_stats_read(struct file *file, char __user *buf,
}
if
(
s
->
max_paths_text
)
{
prt_printf
(
&
i
->
buf
,
"Maximum allocated btree paths (%u):"
,
s
->
nr_max_paths
);
prt_newline
(
&
i
->
buf
);
prt_printf
(
&
i
->
buf
,
"Maximum allocated btree paths (%u):
\n
"
,
s
->
nr_max_paths
);
printbuf_indent_add
(
&
i
->
buf
,
2
);
prt_str_indented
(
&
i
->
buf
,
s
->
max_paths_text
);
...
...
fs/bcachefs/inode.c
View file @
7423330e
...
...
@@ -535,29 +535,19 @@ static void __bch2_inode_unpacked_to_text(struct printbuf *out,
struct
bch_inode_unpacked
*
inode
)
{
printbuf_indent_add
(
out
,
2
);
prt_printf
(
out
,
"mode=%o"
,
inode
->
bi_mode
);
prt_newline
(
out
);
prt_printf
(
out
,
"mode=%o
\n
"
,
inode
->
bi_mode
);
prt_str
(
out
,
"flags="
);
prt_bitflags
(
out
,
bch2_inode_flag_strs
,
inode
->
bi_flags
&
((
1U
<<
20
)
-
1
));
prt_printf
(
out
,
" (%x)"
,
inode
->
bi_flags
);
prt_newline
(
out
);
prt_printf
(
out
,
" (%x)
\n
"
,
inode
->
bi_flags
);
prt_printf
(
out
,
"journal_seq=%llu"
,
inode
->
bi_journal_seq
);
prt_newline
(
out
);
prt_printf
(
out
,
"bi_size=%llu"
,
inode
->
bi_size
);
prt_newline
(
out
);
prt_printf
(
out
,
"bi_sectors=%llu"
,
inode
->
bi_sectors
);
prt_newline
(
out
);
prt_printf
(
out
,
"bi_version=%llu"
,
inode
->
bi_version
);
prt_newline
(
out
);
prt_printf
(
out
,
"journal_seq=%llu
\n
"
,
inode
->
bi_journal_seq
);
prt_printf
(
out
,
"bi_size=%llu
\n
"
,
inode
->
bi_size
);
prt_printf
(
out
,
"bi_sectors=%llu
\n
"
,
inode
->
bi_sectors
);
prt_printf
(
out
,
"bi_version=%llu
\n
"
,
inode
->
bi_version
);
#define x(_name, _bits) \
prt_printf(out, #_name "=%llu", (u64) inode->_name); \
prt_newline(out);
prt_printf(out, #_name "=%llu\n", (u64) inode->_name);
BCH_INODE_FIELDS_v3
()
#undef x
printbuf_indent_sub
(
out
,
2
);
...
...
fs/bcachefs/io_read.c
View file @
7423330e
...
...
@@ -771,9 +771,8 @@ static noinline void read_from_stale_dirty_pointer(struct btree_trans *trans,
PTR_BUCKET_POS
(
c
,
&
ptr
),
BTREE_ITER_CACHED
);
prt_printf
(
&
buf
,
"Attempting to read from stale dirty pointer:"
);
prt_printf
(
&
buf
,
"Attempting to read from stale dirty pointer:
\n
"
);
printbuf_indent_add
(
&
buf
,
2
);
prt_newline
(
&
buf
);
bch2_bkey_val_to_text
(
&
buf
,
c
,
k
);
prt_newline
(
&
buf
);
...
...
fs/bcachefs/io_write.c
View file @
7423330e
...
...
@@ -1649,8 +1649,7 @@ void bch2_write_op_to_text(struct printbuf *out, struct bch_write_op *op)
prt_bitflags
(
out
,
bch2_write_flags
,
op
->
flags
);
prt_newline
(
out
);
prt_printf
(
out
,
"ref: %u"
,
closure_nr_remaining
(
&
op
->
cl
));
prt_newline
(
out
);
prt_printf
(
out
,
"ref: %u
\n
"
,
closure_nr_remaining
(
&
op
->
cl
));
printbuf_indent_sub
(
out
,
2
);
}
...
...
fs/bcachefs/journal.c
View file @
7423330e
...
...
@@ -53,29 +53,19 @@ static void bch2_journal_buf_to_text(struct printbuf *out, struct journal *j, u6
unsigned
i
=
seq
&
JOURNAL_BUF_MASK
;
struct
journal_buf
*
buf
=
j
->
buf
+
i
;
prt_str
(
out
,
"seq:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
seq
);
prt_newline
(
out
);
prt_printf
(
out
,
"seq:
\t
%llu
\n
"
,
seq
);
printbuf_indent_add
(
out
,
2
);
prt_str
(
out
,
"refcount:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
journal_state_count
(
s
,
i
));
prt_newline
(
out
);
prt_printf
(
out
,
"refcount:
\t
%u
\n
"
,
journal_state_count
(
s
,
i
));
prt_str
(
out
,
"size:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"size:
\t
"
);
prt_human_readable_u64
(
out
,
vstruct_bytes
(
buf
->
data
));
prt_newline
(
out
);
prt_str
(
out
,
"expires:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%li jiffies"
,
buf
->
expires
-
jiffies
);
prt_newline
(
out
);
prt_printf
(
out
,
"expires:
\t
"
);
prt_printf
(
out
,
"%li jiffies
\n
"
,
buf
->
expires
-
jiffies
);
prt_str
(
out
,
"flags:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"flags:
\t
"
);
if
(
buf
->
noflush
)
prt_str
(
out
,
"noflush "
);
if
(
buf
->
must_flush
)
...
...
@@ -1422,12 +1412,12 @@ void __bch2_journal_debug_to_text(struct printbuf *out, struct journal *j)
s
=
READ_ONCE
(
j
->
reservations
);
prt_printf
(
out
,
"dirty journal entries:
\t
%llu/%llu
\n
"
,
fifo_used
(
&
j
->
pin
),
j
->
pin
.
size
);
prt_printf
(
out
,
"seq:
\t
\t\t
%llu
\n
"
,
journal_cur_seq
(
j
));
prt_printf
(
out
,
"seq_ondisk:
\t
\t
%llu
\n
"
,
j
->
seq_ondisk
);
prt_printf
(
out
,
"last_seq:
\t
\t
%llu
\n
"
,
journal_last_seq
(
j
));
prt_printf
(
out
,
"seq:
\t
%llu
\n
"
,
journal_cur_seq
(
j
));
prt_printf
(
out
,
"seq_ondisk:
\t
%llu
\n
"
,
j
->
seq_ondisk
);
prt_printf
(
out
,
"last_seq:
\t
%llu
\n
"
,
journal_last_seq
(
j
));
prt_printf
(
out
,
"last_seq_ondisk:
\t
%llu
\n
"
,
j
->
last_seq_ondisk
);
prt_printf
(
out
,
"flushed_seq_ondisk:
\t
%llu
\n
"
,
j
->
flushed_seq_ondisk
);
prt_printf
(
out
,
"watermark:
\t
\t
%s
\n
"
,
bch2_watermarks
[
j
->
watermark
]);
prt_printf
(
out
,
"watermark:
\t
%s
\n
"
,
bch2_watermarks
[
j
->
watermark
]);
prt_printf
(
out
,
"each entry reserved:
\t
%u
\n
"
,
j
->
entry_u64s_reserved
);
prt_printf
(
out
,
"nr flush writes:
\t
%llu
\n
"
,
j
->
nr_flush_writes
);
prt_printf
(
out
,
"nr noflush writes:
\t
%llu
\n
"
,
j
->
nr_noflush_writes
);
...
...
@@ -1436,48 +1426,48 @@ void __bch2_journal_debug_to_text(struct printbuf *out, struct journal *j)
prt_newline
(
out
);
prt_printf
(
out
,
"nr direct reclaim:
\t
%llu
\n
"
,
j
->
nr_direct_reclaim
);
prt_printf
(
out
,
"nr background reclaim:
\t
%llu
\n
"
,
j
->
nr_background_reclaim
);
prt_printf
(
out
,
"reclaim kicked:
\t
\t
%u
\n
"
,
j
->
reclaim_kicked
);
prt_printf
(
out
,
"reclaim kicked:
\t
%u
\n
"
,
j
->
reclaim_kicked
);
prt_printf
(
out
,
"reclaim runs in:
\t
%u ms
\n
"
,
time_after
(
j
->
next_reclaim
,
now
)
?
jiffies_to_msecs
(
j
->
next_reclaim
-
jiffies
)
:
0
);
prt_printf
(
out
,
"blocked:
\t
\t
%u
\n
"
,
j
->
blocked
);
prt_printf
(
out
,
"blocked:
\t
%u
\n
"
,
j
->
blocked
);
prt_printf
(
out
,
"current entry sectors:
\t
%u
\n
"
,
j
->
cur_entry_sectors
);
prt_printf
(
out
,
"current entry error:
\t
%s
\n
"
,
bch2_journal_errors
[
j
->
cur_entry_error
]);
prt_printf
(
out
,
"current entry:
\t
\t
"
);
prt_printf
(
out
,
"current entry:
\t
"
);
switch
(
s
.
cur_entry_offset
)
{
case
JOURNAL_ENTRY_ERROR_VAL
:
prt_printf
(
out
,
"error"
);
prt_printf
(
out
,
"error
\n
"
);
break
;
case
JOURNAL_ENTRY_CLOSED_VAL
:
prt_printf
(
out
,
"closed"
);
prt_printf
(
out
,
"closed
\n
"
);
break
;
default:
prt_printf
(
out
,
"%u/%u"
,
s
.
cur_entry_offset
,
j
->
cur_entry_u64s
);
prt_printf
(
out
,
"%u/%u
\n
"
,
s
.
cur_entry_offset
,
j
->
cur_entry_u64s
);
break
;
}
prt_newline
(
out
);
prt_printf
(
out
,
"unwritten entries:"
);
prt_newline
(
out
);
prt_printf
(
out
,
"unwritten entries:
\n
"
);
bch2_journal_bufs_to_text
(
out
,
j
);
prt_printf
(
out
,
"replay done:
\t
\t
%i
\n
"
,
"replay done:
\t
%i
\n
"
,
test_bit
(
JOURNAL_REPLAY_DONE
,
&
j
->
flags
));
prt_printf
(
out
,
"space:
\n
"
);
prt_printf
(
out
,
"
\t
discarded
\t
%u:%u
\n
"
,
printbuf_indent_add
(
out
,
2
);
prt_printf
(
out
,
"discarded
\t
%u:%u
\n
"
,
j
->
space
[
journal_space_discarded
].
next_entry
,
j
->
space
[
journal_space_discarded
].
total
);
prt_printf
(
out
,
"
\t
clean ondisk
\t
%u:%u
\n
"
,
prt_printf
(
out
,
"clean ondisk
\t
%u:%u
\n
"
,
j
->
space
[
journal_space_clean_ondisk
].
next_entry
,
j
->
space
[
journal_space_clean_ondisk
].
total
);
prt_printf
(
out
,
"
\t
clean
\t
\t
%u:%u
\n
"
,
prt_printf
(
out
,
"
clean
\t
%u:%u
\n
"
,
j
->
space
[
journal_space_clean
].
next_entry
,
j
->
space
[
journal_space_clean
].
total
);
prt_printf
(
out
,
"
\t
total
\t
\t
%u:%u
\n
"
,
prt_printf
(
out
,
"
total
\t
%u:%u
\n
"
,
j
->
space
[
journal_space_total
].
next_entry
,
j
->
space
[
journal_space_total
].
total
);
printbuf_indent_sub
(
out
,
2
);
for_each_member_device_rcu
(
c
,
ca
,
&
c
->
rw_devs
[
BCH_DATA_journal
])
{
struct
journal_device
*
ja
=
&
ca
->
journal
;
...
...
@@ -1489,13 +1479,15 @@ void __bch2_journal_debug_to_text(struct printbuf *out, struct journal *j)
continue
;
prt_printf
(
out
,
"dev %u:
\n
"
,
ca
->
dev_idx
);
prt_printf
(
out
,
"
\t
nr
\t\t
%u
\n
"
,
ja
->
nr
);
prt_printf
(
out
,
"
\t
bucket size
\t
%u
\n
"
,
ca
->
mi
.
bucket_size
);
prt_printf
(
out
,
"
\t
available
\t
%u:%u
\n
"
,
bch2_journal_dev_buckets_available
(
j
,
ja
,
journal_space_discarded
),
ja
->
sectors_free
);
prt_printf
(
out
,
"
\t
discard_idx
\t
%u
\n
"
,
ja
->
discard_idx
);
prt_printf
(
out
,
"
\t
dirty_ondisk
\t
%u (seq %llu)
\n
"
,
ja
->
dirty_idx_ondisk
,
ja
->
bucket_seq
[
ja
->
dirty_idx_ondisk
]);
prt_printf
(
out
,
"
\t
dirty_idx
\t
%u (seq %llu)
\n
"
,
ja
->
dirty_idx
,
ja
->
bucket_seq
[
ja
->
dirty_idx
]);
prt_printf
(
out
,
"
\t
cur_idx
\t\t
%u (seq %llu)
\n
"
,
ja
->
cur_idx
,
ja
->
bucket_seq
[
ja
->
cur_idx
]);
printbuf_indent_add
(
out
,
2
);
prt_printf
(
out
,
"nr
\t
%u
\n
"
,
ja
->
nr
);
prt_printf
(
out
,
"bucket size
\t
%u
\n
"
,
ca
->
mi
.
bucket_size
);
prt_printf
(
out
,
"available
\t
%u:%u
\n
"
,
bch2_journal_dev_buckets_available
(
j
,
ja
,
journal_space_discarded
),
ja
->
sectors_free
);
prt_printf
(
out
,
"discard_idx
\t
%u
\n
"
,
ja
->
discard_idx
);
prt_printf
(
out
,
"dirty_ondisk
\t
%u (seq %llu)
\n
"
,
ja
->
dirty_idx_ondisk
,
ja
->
bucket_seq
[
ja
->
dirty_idx_ondisk
]);
prt_printf
(
out
,
"dirty_idx
\t
%u (seq %llu)
\n
"
,
ja
->
dirty_idx
,
ja
->
bucket_seq
[
ja
->
dirty_idx
]);
prt_printf
(
out
,
"cur_idx
\t
%u (seq %llu)
\n
"
,
ja
->
cur_idx
,
ja
->
bucket_seq
[
ja
->
cur_idx
]);
printbuf_indent_sub
(
out
,
2
);
}
rcu_read_unlock
();
...
...
@@ -1527,25 +1519,18 @@ bool bch2_journal_seq_pins_to_text(struct printbuf *out, struct journal *j, u64
pin_list
=
journal_seq_pin
(
j
,
*
seq
);
prt_printf
(
out
,
"%llu: count %u"
,
*
seq
,
atomic_read
(
&
pin_list
->
count
));
prt_newline
(
out
);
prt_printf
(
out
,
"%llu: count %u
\n
"
,
*
seq
,
atomic_read
(
&
pin_list
->
count
));
printbuf_indent_add
(
out
,
2
);
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
pin_list
->
list
);
i
++
)
list_for_each_entry
(
pin
,
&
pin_list
->
list
[
i
],
list
)
{
prt_printf
(
out
,
"
\t
%px %ps"
,
pin
,
pin
->
flush
);
prt_newline
(
out
);
}
list_for_each_entry
(
pin
,
&
pin_list
->
list
[
i
],
list
)
prt_printf
(
out
,
"
\t
%px %ps
\n
"
,
pin
,
pin
->
flush
);
if
(
!
list_empty
(
&
pin_list
->
flushed
))
{
prt_printf
(
out
,
"flushed:"
);
prt_newline
(
out
);
}
if
(
!
list_empty
(
&
pin_list
->
flushed
))
prt_printf
(
out
,
"flushed:
\n
"
);
list_for_each_entry
(
pin
,
&
pin_list
->
flushed
,
list
)
{
prt_printf
(
out
,
"
\t
%px %ps"
,
pin
,
pin
->
flush
);
prt_newline
(
out
);
}
list_for_each_entry
(
pin
,
&
pin_list
->
flushed
,
list
)
prt_printf
(
out
,
"
\t
%px %ps
\n
"
,
pin
,
pin
->
flush
);
printbuf_indent_sub
(
out
,
2
);
...
...
fs/bcachefs/move.c
View file @
7423330e
...
...
@@ -41,28 +41,23 @@ static void bch2_data_update_opts_to_text(struct printbuf *out, struct bch_fs *c
struct
data_update_opts
*
data_opts
)
{
printbuf_tabstop_push
(
out
,
20
);
prt_str
(
out
,
"rewrite ptrs:"
);
prt_tab
(
out
);
prt_str
(
out
,
"rewrite ptrs:
\t
"
);
bch2_prt_u64_base2
(
out
,
data_opts
->
rewrite_ptrs
);
prt_newline
(
out
);
prt_str
(
out
,
"kill ptrs: "
);
prt_tab
(
out
);
prt_str
(
out
,
"kill ptrs:
\t
"
);
bch2_prt_u64_base2
(
out
,
data_opts
->
kill_ptrs
);
prt_newline
(
out
);
prt_str
(
out
,
"target: "
);
prt_tab
(
out
);
prt_str
(
out
,
"target:
\t
"
);
bch2_target_to_text
(
out
,
c
,
data_opts
->
target
);
prt_newline
(
out
);
prt_str
(
out
,
"compression: "
);
prt_tab
(
out
);
prt_str
(
out
,
"compression:
\t
"
);
bch2_compression_opt_to_text
(
out
,
background_compression
(
*
io_opts
));
prt_newline
(
out
);
prt_str
(
out
,
"extra replicas: "
);
prt_tab
(
out
);
prt_str
(
out
,
"extra replicas:
\t
"
);
prt_u64
(
out
,
data_opts
->
extra_replicas
);
}
...
...
@@ -1127,23 +1122,17 @@ void bch2_move_stats_to_text(struct printbuf *out, struct bch_move_stats *stats)
prt_newline
(
out
);
printbuf_indent_add
(
out
,
2
);
prt_str
(
out
,
"keys moved: "
);
prt_u64
(
out
,
atomic64_read
(
&
stats
->
keys_moved
));
prt_newline
(
out
);
prt_str
(
out
,
"keys raced: "
);
prt_u64
(
out
,
atomic64_read
(
&
stats
->
keys_raced
));
prt_newline
(
out
);
prt_str
(
out
,
"bytes seen: "
);
prt_printf
(
out
,
"keys moved: %llu
\n
"
,
atomic64_read
(
&
stats
->
keys_moved
));
prt_printf
(
out
,
"keys raced: %llu
\n
"
,
atomic64_read
(
&
stats
->
keys_raced
));
prt_printf
(
out
,
"bytes seen: "
);
prt_human_readable_u64
(
out
,
atomic64_read
(
&
stats
->
sectors_seen
)
<<
9
);
prt_newline
(
out
);
prt_
str
(
out
,
"bytes moved: "
);
prt_
printf
(
out
,
"bytes moved: "
);
prt_human_readable_u64
(
out
,
atomic64_read
(
&
stats
->
sectors_moved
)
<<
9
);
prt_newline
(
out
);
prt_
str
(
out
,
"bytes raced: "
);
prt_
printf
(
out
,
"bytes raced: "
);
prt_human_readable_u64
(
out
,
atomic64_read
(
&
stats
->
sectors_raced
)
<<
9
);
prt_newline
(
out
);
...
...
@@ -1157,19 +1146,17 @@ static void bch2_moving_ctxt_to_text(struct printbuf *out, struct bch_fs *c, str
bch2_move_stats_to_text
(
out
,
ctxt
->
stats
);
printbuf_indent_add
(
out
,
2
);
prt_printf
(
out
,
"reads: ios %u/%u sectors %u/%u"
,
prt_printf
(
out
,
"reads: ios %u/%u sectors %u/%u
\n
"
,
atomic_read
(
&
ctxt
->
read_ios
),
c
->
opts
.
move_ios_in_flight
,
atomic_read
(
&
ctxt
->
read_sectors
),
c
->
opts
.
move_bytes_in_flight
>>
9
);
prt_newline
(
out
);
prt_printf
(
out
,
"writes: ios %u/%u sectors %u/%u"
,
prt_printf
(
out
,
"writes: ios %u/%u sectors %u/%u
\n
"
,
atomic_read
(
&
ctxt
->
write_ios
),
c
->
opts
.
move_ios_in_flight
,
atomic_read
(
&
ctxt
->
write_sectors
),
c
->
opts
.
move_bytes_in_flight
>>
9
);
prt_newline
(
out
);
printbuf_indent_add
(
out
,
2
);
...
...
fs/bcachefs/quota.c
View file @
7423330e
...
...
@@ -97,45 +97,14 @@ static void qc_info_to_text(struct printbuf *out, struct qc_info *i)
printbuf_tabstops_reset
(
out
);
printbuf_tabstop_push
(
out
,
20
);
prt_str
(
out
,
"i_fieldmask"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%x"
,
i
->
i_fieldmask
);
prt_newline
(
out
);
prt_str
(
out
,
"i_flags"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_flags
);
prt_newline
(
out
);
prt_str
(
out
,
"i_spc_timelimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_spc_timelimit
);
prt_newline
(
out
);
prt_str
(
out
,
"i_ino_timelimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_ino_timelimit
);
prt_newline
(
out
);
prt_str
(
out
,
"i_rt_spc_timelimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_rt_spc_timelimit
);
prt_newline
(
out
);
prt_str
(
out
,
"i_spc_warnlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_spc_warnlimit
);
prt_newline
(
out
);
prt_str
(
out
,
"i_ino_warnlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_ino_warnlimit
);
prt_newline
(
out
);
prt_str
(
out
,
"i_rt_spc_warnlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
->
i_rt_spc_warnlimit
);
prt_newline
(
out
);
prt_printf
(
out
,
"i_fieldmask
\t
%x
\n
"
,
i
->
i_fieldmask
);
prt_printf
(
out
,
"i_flags
\t
%u
\n
"
,
i
->
i_flags
);
prt_printf
(
out
,
"i_spc_timelimit
\t
%u
\n
"
,
i
->
i_spc_timelimit
);
prt_printf
(
out
,
"i_ino_timelimit
\t
%u
\n
"
,
i
->
i_ino_timelimit
);
prt_printf
(
out
,
"i_rt_spc_timelimit
\t
%u
\n
"
,
i
->
i_rt_spc_timelimit
);
prt_printf
(
out
,
"i_spc_warnlimit
\t
%u
\n
"
,
i
->
i_spc_warnlimit
);
prt_printf
(
out
,
"i_ino_warnlimit
\t
%u
\n
"
,
i
->
i_ino_warnlimit
);
prt_printf
(
out
,
"i_rt_spc_warnlimit
\t
%u
\n
"
,
i
->
i_rt_spc_warnlimit
);
}
static
void
qc_dqblk_to_text
(
struct
printbuf
*
out
,
struct
qc_dqblk
*
q
)
...
...
@@ -143,60 +112,17 @@ static void qc_dqblk_to_text(struct printbuf *out, struct qc_dqblk *q)
printbuf_tabstops_reset
(
out
);
printbuf_tabstop_push
(
out
,
20
);
prt_str
(
out
,
"d_fieldmask"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%x"
,
q
->
d_fieldmask
);
prt_newline
(
out
);
prt_str
(
out
,
"d_spc_hardlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_spc_hardlimit
);
prt_newline
(
out
);
prt_str
(
out
,
"d_spc_softlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_spc_softlimit
);
prt_newline
(
out
);
prt_str
(
out
,
"d_ino_hardlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_ino_hardlimit
);
prt_newline
(
out
);
prt_str
(
out
,
"d_ino_softlimit"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_ino_softlimit
);
prt_newline
(
out
);
prt_str
(
out
,
"d_space"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_space
);
prt_newline
(
out
);
prt_str
(
out
,
"d_ino_count"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_ino_count
);
prt_newline
(
out
);
prt_str
(
out
,
"d_ino_timer"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_ino_timer
);
prt_newline
(
out
);
prt_str
(
out
,
"d_spc_timer"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
q
->
d_spc_timer
);
prt_newline
(
out
);
prt_str
(
out
,
"d_ino_warns"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%i"
,
q
->
d_ino_warns
);
prt_newline
(
out
);
prt_str
(
out
,
"d_spc_warns"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%i"
,
q
->
d_spc_warns
);
prt_newline
(
out
);
prt_printf
(
out
,
"d_fieldmask
\t
%x
\n
"
,
q
->
d_fieldmask
);
prt_printf
(
out
,
"d_spc_hardlimit
\t
%llu
\n
"
,
q
->
d_spc_hardlimit
);
prt_printf
(
out
,
"d_spc_softlimit
\t
%llu
\n
"
,
q
->
d_spc_softlimit
);
prt_printf
(
out
,
"d_ino_hardlimit\%llu
\n
"
,
q
->
d_ino_hardlimit
);
prt_printf
(
out
,
"d_ino_softlimit
\t
%llu
\n
"
,
q
->
d_ino_softlimit
);
prt_printf
(
out
,
"d_space
\t
%llu
\n
"
,
q
->
d_space
);
prt_printf
(
out
,
"d_ino_count
\t
%llu
\n
"
,
q
->
d_ino_count
);
prt_printf
(
out
,
"d_ino_timer
\t
%llu
\n
"
,
q
->
d_ino_timer
);
prt_printf
(
out
,
"d_spc_timer
\t
%llu
\n
"
,
q
->
d_spc_timer
);
prt_printf
(
out
,
"d_ino_warns
\t
%i
\n
"
,
q
->
d_ino_warns
);
prt_printf
(
out
,
"d_spc_warns
\t
%i
\n
"
,
q
->
d_spc_warns
);
}
static
inline
unsigned
__next_qtype
(
unsigned
i
,
unsigned
qtypes
)
...
...
fs/bcachefs/sb-clean.c
View file @
7423330e
...
...
@@ -298,10 +298,8 @@ static void bch2_sb_clean_to_text(struct printbuf *out, struct bch_sb *sb,
struct
bch_sb_field_clean
*
clean
=
field_to_type
(
f
,
clean
);
struct
jset_entry
*
entry
;
prt_printf
(
out
,
"flags: %x"
,
le32_to_cpu
(
clean
->
flags
));
prt_newline
(
out
);
prt_printf
(
out
,
"journal_seq: %llu"
,
le64_to_cpu
(
clean
->
journal_seq
));
prt_newline
(
out
);
prt_printf
(
out
,
"flags: %x
\n
"
,
le32_to_cpu
(
clean
->
flags
));
prt_printf
(
out
,
"journal_seq: %llu
\n
"
,
le64_to_cpu
(
clean
->
journal_seq
));
for
(
entry
=
clean
->
start
;
entry
!=
vstruct_end
(
&
clean
->
field
);
...
...
fs/bcachefs/sb-counters.c
View file @
7423330e
...
...
@@ -31,19 +31,12 @@ static void bch2_sb_counters_to_text(struct printbuf *out, struct bch_sb *sb,
struct
bch_sb_field
*
f
)
{
struct
bch_sb_field_counters
*
ctrs
=
field_to_type
(
f
,
counters
);
unsigned
int
i
;
unsigned
int
nr
=
bch2_sb_counter_nr_entries
(
ctrs
);
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
if
(
i
<
BCH_COUNTER_NR
)
prt_printf
(
out
,
"%s "
,
bch2_counter_names
[
i
]);
else
prt_printf
(
out
,
"(unknown)"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
le64_to_cpu
(
ctrs
->
d
[
i
]));
prt_newline
(
out
);
}
for
(
unsigned
i
=
0
;
i
<
nr
;
i
++
)
prt_printf
(
out
,
"%s
\t
%llu
\n
"
,
i
<
BCH_COUNTER_NR
?
bch2_counter_names
[
i
]
:
"(unknown)"
,
le64_to_cpu
(
ctrs
->
d
[
i
]));
};
int
bch2_sb_counters_to_cpu
(
struct
bch_fs
*
c
)
...
...
fs/bcachefs/sb-downgrade.c
View file @
7423330e
...
...
@@ -164,19 +164,16 @@ static void bch2_sb_downgrade_to_text(struct printbuf *out, struct bch_sb *sb,
printbuf_tabstop_push
(
out
,
16
);
for_each_downgrade_entry
(
e
,
i
)
{
prt_str
(
out
,
"version:"
);
prt_tab
(
out
);
prt_str
(
out
,
"version:
\t
"
);
bch2_version_to_text
(
out
,
le16_to_cpu
(
i
->
version
));
prt_newline
(
out
);
prt_str
(
out
,
"recovery passes:"
);
prt_tab
(
out
);
prt_str
(
out
,
"recovery passes:
\t
"
);
prt_bitflags
(
out
,
bch2_recovery_passes
,
bch2_recovery_passes_from_stable
(
le64_to_cpu
(
i
->
recovery_passes
[
0
])));
prt_newline
(
out
);
prt_str
(
out
,
"errors:"
);
prt_tab
(
out
);
prt_str
(
out
,
"errors:
\t
"
);
bool
first
=
true
;
for
(
unsigned
j
=
0
;
j
<
le16_to_cpu
(
i
->
nr_errors
);
j
++
)
{
if
(
!
first
)
...
...
fs/bcachefs/sb-members.c
View file @
7423330e
...
...
@@ -167,15 +167,11 @@ static void member_to_text(struct printbuf *out,
if
(
!
bch2_member_exists
(
&
m
))
return
;
prt_printf
(
out
,
"Device:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
i
);
prt_newline
(
out
);
prt_printf
(
out
,
"Device:
\t
%u
\n
"
,
i
);
printbuf_indent_add
(
out
,
2
);
prt_printf
(
out
,
"Label:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Label:
\t
"
);
if
(
BCH_MEMBER_GROUP
(
&
m
))
{
unsigned
idx
=
BCH_MEMBER_GROUP
(
&
m
)
-
1
;
...
...
@@ -189,96 +185,59 @@ static void member_to_text(struct printbuf *out,
}
prt_newline
(
out
);
prt_printf
(
out
,
"UUID:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"UUID:
\t
"
);
pr_uuid
(
out
,
m
.
uuid
.
b
);
prt_newline
(
out
);
prt_printf
(
out
,
"Size:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Size:
\t
"
);
prt_units_u64
(
out
,
device_size
<<
9
);
prt_newline
(
out
);
for
(
unsigned
i
=
0
;
i
<
BCH_MEMBER_ERROR_NR
;
i
++
)
{
prt_printf
(
out
,
"%s errors:"
,
bch2_member_error_strs
[
i
]);
prt_tab
(
out
);
prt_u64
(
out
,
le64_to_cpu
(
m
.
errors
[
i
]));
prt_newline
(
out
);
}
for
(
unsigned
i
=
0
;
i
<
BCH_MEMBER_ERROR_NR
;
i
++
)
prt_printf
(
out
,
"%s errors:
\t
%llu
\n
"
,
bch2_member_error_strs
[
i
],
le64_to_cpu
(
m
.
errors
[
i
]));
for
(
unsigned
i
=
0
;
i
<
BCH_IOPS_NR
;
i
++
)
{
prt_printf
(
out
,
"%s iops:"
,
bch2_iops_measurements
[
i
]);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
le32_to_cpu
(
m
.
iops
[
i
]));
prt_newline
(
out
);
}
for
(
unsigned
i
=
0
;
i
<
BCH_IOPS_NR
;
i
++
)
prt_printf
(
out
,
"%s iops:
\t
%u
\n
"
,
bch2_iops_measurements
[
i
],
le32_to_cpu
(
m
.
iops
[
i
]));
prt_printf
(
out
,
"Bucket size:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Bucket size:
\t
"
);
prt_units_u64
(
out
,
bucket_size
<<
9
);
prt_newline
(
out
);
prt_printf
(
out
,
"First bucket:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
le16_to_cpu
(
m
.
first_bucket
));
prt_newline
(
out
);
prt_printf
(
out
,
"Buckets:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
le64_to_cpu
(
m
.
nbuckets
));
prt_newline
(
out
);
prt_printf
(
out
,
"First bucket:
\t
%u
\n
"
,
le16_to_cpu
(
m
.
first_bucket
));
prt_printf
(
out
,
"Buckets:
\t
%llu
\n
"
,
le64_to_cpu
(
m
.
nbuckets
));
prt_printf
(
out
,
"Last mount:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Last mount:
\t
"
);
if
(
m
.
last_mount
)
bch2_prt_datetime
(
out
,
le64_to_cpu
(
m
.
last_mount
));
else
prt_printf
(
out
,
"(never)"
);
prt_newline
(
out
);
prt_printf
(
out
,
"Last superblock write:"
);
prt_tab
(
out
);
prt_u64
(
out
,
le64_to_cpu
(
m
.
seq
));
prt_newline
(
out
);
prt_printf
(
out
,
"Last superblock write:
\t
%llu
\n
"
,
le64_to_cpu
(
m
.
seq
));
prt_printf
(
out
,
"State:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%s"
,
prt_printf
(
out
,
"State:
\t
%s
\n
"
,
BCH_MEMBER_STATE
(
&
m
)
<
BCH_MEMBER_STATE_NR
?
bch2_member_states
[
BCH_MEMBER_STATE
(
&
m
)]
:
"unknown"
);
prt_newline
(
out
);
prt_printf
(
out
,
"Data allowed:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Data allowed:
\t
"
);
if
(
BCH_MEMBER_DATA_ALLOWED
(
&
m
))
prt_bitflags
(
out
,
__bch2_data_types
,
BCH_MEMBER_DATA_ALLOWED
(
&
m
));
else
prt_printf
(
out
,
"(none)"
);
prt_newline
(
out
);
prt_printf
(
out
,
"Has data:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Has data:
\t
"
);
if
(
data_have
)
prt_bitflags
(
out
,
__bch2_data_types
,
data_have
);
else
prt_printf
(
out
,
"(none)"
);
prt_newline
(
out
);
prt_str
(
out
,
"Durability:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
BCH_MEMBER_DURABILITY
(
&
m
)
?
BCH_MEMBER_DURABILITY
(
&
m
)
-
1
:
1
);
prt_newline
(
out
);
prt_printf
(
out
,
"Durability:
\t
%llu
\n
"
,
BCH_MEMBER_DURABILITY
(
&
m
)
?
BCH_MEMBER_DURABILITY
(
&
m
)
-
1
:
1
);
prt_printf
(
out
,
"Discard:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
BCH_MEMBER_DISCARD
(
&
m
));
prt_newline
(
out
);
prt_printf
(
out
,
"Freespace initialized:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
BCH_MEMBER_FREESPACE_INITIALIZED
(
&
m
));
prt_newline
(
out
);
prt_printf
(
out
,
"Discard:
\t
%llu
\n
"
,
BCH_MEMBER_DISCARD
(
&
m
));
prt_printf
(
out
,
"Freespace initialized:
\t
%llu
\n
"
,
BCH_MEMBER_FREESPACE_INITIALIZED
(
&
m
));
printbuf_indent_sub
(
out
,
2
);
}
...
...
@@ -390,12 +349,8 @@ void bch2_dev_io_errors_to_text(struct printbuf *out, struct bch_dev *ca)
prt_newline
(
out
);
printbuf_indent_add
(
out
,
2
);
for
(
unsigned
i
=
0
;
i
<
BCH_MEMBER_ERROR_NR
;
i
++
)
{
prt_printf
(
out
,
"%s:"
,
bch2_member_error_strs
[
i
]);
prt_tab
(
out
);
prt_u64
(
out
,
atomic64_read
(
&
ca
->
errors
[
i
]));
prt_newline
(
out
);
}
for
(
unsigned
i
=
0
;
i
<
BCH_MEMBER_ERROR_NR
;
i
++
)
prt_printf
(
out
,
"%s:
\t
%llu
\n
"
,
bch2_member_error_strs
[
i
],
atomic64_read
(
&
ca
->
errors
[
i
]));
printbuf_indent_sub
(
out
,
2
);
prt_str
(
out
,
"IO errors since "
);
...
...
@@ -404,12 +359,9 @@ void bch2_dev_io_errors_to_text(struct printbuf *out, struct bch_dev *ca)
prt_newline
(
out
);
printbuf_indent_add
(
out
,
2
);
for
(
unsigned
i
=
0
;
i
<
BCH_MEMBER_ERROR_NR
;
i
++
)
{
prt_printf
(
out
,
"%s:"
,
bch2_member_error_strs
[
i
]);
prt_tab
(
out
);
prt_u64
(
out
,
atomic64_read
(
&
ca
->
errors
[
i
])
-
le64_to_cpu
(
m
.
errors_at_reset
[
i
]));
prt_newline
(
out
);
}
for
(
unsigned
i
=
0
;
i
<
BCH_MEMBER_ERROR_NR
;
i
++
)
prt_printf
(
out
,
"%s:
\t
%llu
\n
"
,
bch2_member_error_strs
[
i
],
atomic64_read
(
&
ca
->
errors
[
i
])
-
le64_to_cpu
(
m
.
errors_at_reset
[
i
]));
printbuf_indent_sub
(
out
,
2
);
}
...
...
fs/bcachefs/super-io.c
View file @
7423330e
...
...
@@ -1176,8 +1176,7 @@ static void bch2_sb_ext_to_text(struct printbuf *out, struct bch_sb *sb,
{
struct
bch_sb_field_ext
*
e
=
field_to_type
(
f
,
ext
);
prt_printf
(
out
,
"Recovery passes required:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Recovery passes required:
\t
"
);
prt_bitflags
(
out
,
bch2_recovery_passes
,
bch2_recovery_passes_from_stable
(
le64_to_cpu
(
e
->
recovery_passes_required
[
0
])));
prt_newline
(
out
);
...
...
@@ -1186,16 +1185,14 @@ static void bch2_sb_ext_to_text(struct printbuf *out, struct bch_sb *sb,
if
(
errors_silent
)
{
le_bitvector_to_cpu
(
errors_silent
,
(
void
*
)
e
->
errors_silent
,
sizeof
(
e
->
errors_silent
)
*
8
);
prt_printf
(
out
,
"Errors to silently fix:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Errors to silently fix:
\t
"
);
prt_bitflags_vector
(
out
,
bch2_sb_error_strs
,
errors_silent
,
sizeof
(
e
->
errors_silent
)
*
8
);
prt_newline
(
out
);
kfree
(
errors_silent
);
}
prt_printf
(
out
,
"Btrees with missing data:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Btrees with missing data:
\t
"
);
prt_bitflags
(
out
,
__bch2_btree_ids
,
le64_to_cpu
(
e
->
btrees_lost_data
));
prt_newline
(
out
);
}
...
...
@@ -1305,95 +1302,71 @@ void bch2_sb_to_text(struct printbuf *out, struct bch_sb *sb,
for
(
int
i
=
0
;
i
<
sb
->
nr_devices
;
i
++
)
nr_devices
+=
bch2_dev_exists
(
sb
,
i
);
prt_printf
(
out
,
"External UUID:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"External UUID:
\t
"
);
pr_uuid
(
out
,
sb
->
user_uuid
.
b
);
prt_newline
(
out
);
prt_printf
(
out
,
"Internal UUID:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Internal UUID:
\t
"
);
pr_uuid
(
out
,
sb
->
uuid
.
b
);
prt_newline
(
out
);
prt_printf
(
out
,
"Magic number:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Magic number:
\t
"
);
pr_uuid
(
out
,
sb
->
magic
.
b
);
prt_newline
(
out
);
prt_str
(
out
,
"Device index:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
sb
->
dev_idx
);
prt_newline
(
out
);
prt_printf
(
out
,
"Device index:
\t
%u
\n
"
,
sb
->
dev_idx
);
prt_str
(
out
,
"Label:"
);
prt_tab
(
out
);
prt_str
(
out
,
"Label:
\t
"
);
prt_printf
(
out
,
"%.*s"
,
(
int
)
sizeof
(
sb
->
label
),
sb
->
label
);
prt_newline
(
out
);
prt_str
(
out
,
"Version:"
);
prt_tab
(
out
);
prt_str
(
out
,
"Version:
\t
"
);
bch2_version_to_text
(
out
,
le16_to_cpu
(
sb
->
version
));
prt_newline
(
out
);
prt_str
(
out
,
"Version upgrade complete:"
);
prt_tab
(
out
);
prt_str
(
out
,
"Version upgrade complete:
\t
"
);
bch2_version_to_text
(
out
,
BCH_SB_VERSION_UPGRADE_COMPLETE
(
sb
));
prt_newline
(
out
);
prt_printf
(
out
,
"Oldest version on disk:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Oldest version on disk:
\t
"
);
bch2_version_to_text
(
out
,
le16_to_cpu
(
sb
->
version_min
));
prt_newline
(
out
);
prt_printf
(
out
,
"Created:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Created:
\t
"
);
if
(
sb
->
time_base_lo
)
bch2_prt_datetime
(
out
,
div_u64
(
le64_to_cpu
(
sb
->
time_base_lo
),
NSEC_PER_SEC
));
else
prt_printf
(
out
,
"(not set)"
);
prt_newline
(
out
);
prt_printf
(
out
,
"Sequence number:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Sequence number:
\t
"
);
prt_printf
(
out
,
"%llu"
,
le64_to_cpu
(
sb
->
seq
));
prt_newline
(
out
);
prt_printf
(
out
,
"Time of last write:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Time of last write:
\t
"
);
bch2_prt_datetime
(
out
,
le64_to_cpu
(
sb
->
write_time
));
prt_newline
(
out
);
prt_printf
(
out
,
"Superblock size:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Superblock size:
\t
"
);
prt_units_u64
(
out
,
vstruct_bytes
(
sb
));
prt_str
(
out
,
"/"
);
prt_units_u64
(
out
,
512ULL
<<
sb
->
layout
.
sb_max_size_bits
);
prt_newline
(
out
);
prt_printf
(
out
,
"Clean:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu"
,
BCH_SB_CLEAN
(
sb
));
prt_newline
(
out
);
prt_printf
(
out
,
"Devices:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%u"
,
nr_devices
);
prt_newline
(
out
);
prt_printf
(
out
,
"Clean:
\t
%llu
\n
"
,
BCH_SB_CLEAN
(
sb
));
prt_printf
(
out
,
"Devices:
\t
%u
\n
"
,
nr_devices
);
prt_printf
(
out
,
"Sections:"
);
prt_printf
(
out
,
"Sections:
\t
"
);
vstruct_for_each
(
sb
,
f
)
fields_have
|=
1
<<
le32_to_cpu
(
f
->
type
);
prt_tab
(
out
);
prt_bitflags
(
out
,
bch2_sb_fields
,
fields_have
);
prt_newline
(
out
);
prt_printf
(
out
,
"Features:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Features:
\t
"
);
prt_bitflags
(
out
,
bch2_sb_features
,
le64_to_cpu
(
sb
->
features
[
0
]));
prt_newline
(
out
);
prt_printf
(
out
,
"Compat features:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"Compat features:
\t
"
);
prt_bitflags
(
out
,
bch2_sb_compat
,
le64_to_cpu
(
sb
->
compat
[
0
]));
prt_newline
(
out
);
...
...
@@ -1410,8 +1383,7 @@ void bch2_sb_to_text(struct printbuf *out, struct bch_sb *sb,
if
(
opt
->
get_sb
!=
BCH2_NO_SB_OPT
)
{
u64
v
=
bch2_opt_from_sb
(
sb
,
id
);
prt_printf
(
out
,
"%s:"
,
opt
->
attr
.
name
);
prt_tab
(
out
);
prt_printf
(
out
,
"%s:
\t
"
,
opt
->
attr
.
name
);
bch2_opt_to_text
(
out
,
NULL
,
sb
,
opt
,
v
,
OPT_HUMAN_READABLE
|
OPT_SHOW_FULL_LIST
);
prt_newline
(
out
);
...
...
fs/bcachefs/sysfs.c
View file @
7423330e
...
...
@@ -189,12 +189,8 @@ static void bch2_write_refs_to_text(struct printbuf *out, struct bch_fs *c)
{
bch2_printbuf_tabstop_push
(
out
,
24
);
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
c
->
writes
);
i
++
)
{
prt_str
(
out
,
bch2_write_refs
[
i
]);
prt_tab
(
out
);
prt_printf
(
out
,
"%li"
,
atomic_long_read
(
&
c
->
writes
[
i
]));
prt_newline
(
out
);
}
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
c
->
writes
);
i
++
)
prt_printf
(
out
,
"%s
\t
%li
\n
"
,
bch2_write_refs
[
i
],
atomic_long_read
(
&
c
->
writes
[
i
]));
}
#endif
...
...
@@ -313,22 +309,11 @@ static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c
if
(
ret
)
return
ret
;
prt_str
(
out
,
"type"
);
printbuf_tabstop_push
(
out
,
12
);
prt_tab
(
out
);
prt_str
(
out
,
"compressed"
);
printbuf_tabstop_push
(
out
,
16
);
prt_tab_rjust
(
out
);
prt_str
(
out
,
"uncompressed"
);
printbuf_tabstop_push
(
out
,
16
);
prt_tab_rjust
(
out
);
prt_str
(
out
,
"average extent size"
);
printbuf_tabstop_push
(
out
,
24
);
prt_tab_rjust
(
out
);
prt_newline
(
out
);
prt_printf
(
out
,
"type
\t
compressed
\r
uncompressed
\r
average extent size
\r\n
"
);
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
s
);
i
++
)
{
bch2_prt_compression_type
(
out
,
i
);
...
...
@@ -594,13 +579,11 @@ SHOW(bch2_fs_counters)
if (attr == &sysfs_##t) { \
counter = percpu_u64_get(&c->counters[BCH_COUNTER_##t]);\
counter_since_mount = counter - c->counters_on_mount[BCH_COUNTER_##t];\
prt_printf(out, "since mount:"); \
prt_tab(out); \
prt_printf(out, "since mount:\t"); \
prt_human_readable_u64(out, counter_since_mount); \
prt_newline(out); \
\
prt_printf(out, "since filesystem creation:"); \
prt_tab(out); \
prt_printf(out, "since filesystem creation:\t"); \
prt_human_readable_u64(out, counter); \
prt_newline(out); \
}
...
...
@@ -796,11 +779,11 @@ static void dev_alloc_debug_to_text(struct printbuf *out, struct bch_dev *ca)
{
struct
bch_fs
*
c
=
ca
->
fs
;
struct
bch_dev_usage
stats
=
bch2_dev_usage_read
(
ca
);
unsigned
i
,
nr
[
BCH_DATA_NR
];
unsigned
nr
[
BCH_DATA_NR
];
memset
(
nr
,
0
,
sizeof
(
nr
));
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
c
->
open_buckets
);
i
++
)
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
c
->
open_buckets
);
i
++
)
nr
[
c
->
open_buckets
[
i
].
data_type
]
++
;
printbuf_tabstop_push
(
out
,
8
);
...
...
@@ -813,65 +796,24 @@ static void dev_alloc_debug_to_text(struct printbuf *out, struct bch_dev *ca)
prt_newline
(
out
);
prt_printf
(
out
,
"reserves:"
);
prt_newline
(
out
);
for
(
i
=
0
;
i
<
BCH_WATERMARK_NR
;
i
++
)
{
prt_str
(
out
,
bch2_watermarks
[
i
]);
prt_tab
(
out
);
prt_u64
(
out
,
bch2_dev_buckets_reserved
(
ca
,
i
));
prt_tab_rjust
(
out
);
prt_newline
(
out
);
}
prt_printf
(
out
,
"reserves:
\n
"
);
for
(
unsigned
i
=
0
;
i
<
BCH_WATERMARK_NR
;
i
++
)
prt_printf
(
out
,
"%s
\t
%llu
\r\n
"
,
bch2_watermarks
[
i
],
bch2_dev_buckets_reserved
(
ca
,
i
));
prt_newline
(
out
);
printbuf_tabstops_reset
(
out
);
printbuf_tabstop_push
(
out
,
24
);
prt_str
(
out
,
"freelist_wait"
);
prt_tab
(
out
);
prt_str
(
out
,
c
->
freelist_wait
.
list
.
first
?
"waiting"
:
"empty"
);
prt_newline
(
out
);
prt_str
(
out
,
"open buckets allocated"
);
prt_tab
(
out
);
prt_u64
(
out
,
OPEN_BUCKETS_COUNT
-
c
->
open_buckets_nr_free
);
prt_newline
(
out
);
prt_str
(
out
,
"open buckets this dev"
);
prt_tab
(
out
);
prt_u64
(
out
,
ca
->
nr_open_buckets
);
prt_newline
(
out
);
prt_str
(
out
,
"open buckets total"
);
prt_tab
(
out
);
prt_u64
(
out
,
OPEN_BUCKETS_COUNT
);
prt_newline
(
out
);
prt_str
(
out
,
"open_buckets_wait"
);
prt_tab
(
out
);
prt_str
(
out
,
c
->
open_buckets_wait
.
list
.
first
?
"waiting"
:
"empty"
);
prt_newline
(
out
);
prt_str
(
out
,
"open_buckets_btree"
);
prt_tab
(
out
);
prt_u64
(
out
,
nr
[
BCH_DATA_btree
]);
prt_newline
(
out
);
prt_str
(
out
,
"open_buckets_user"
);
prt_tab
(
out
);
prt_u64
(
out
,
nr
[
BCH_DATA_user
]);
prt_newline
(
out
);
prt_str
(
out
,
"buckets_to_invalidate"
);
prt_tab
(
out
);
prt_u64
(
out
,
should_invalidate_buckets
(
ca
,
stats
));
prt_newline
(
out
);
prt_str
(
out
,
"btree reserve cache"
);
prt_tab
(
out
);
prt_u64
(
out
,
c
->
btree_reserve_cache_nr
);
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 this dev
\t
%i
\n
"
,
ca
->
nr_open_buckets
);
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
,
"buckets_to_invalidate
\t
%llu
\n
"
,
should_invalidate_buckets
(
ca
,
stats
));
prt_printf
(
out
,
"btree reserve cache
\t
%u
\n
"
,
c
->
btree_reserve_cache_nr
);
}
static
const
char
*
const
bch2_rw
[]
=
{
...
...
fs/bcachefs/util.c
View file @
7423330e
...
...
@@ -348,15 +348,12 @@ static void bch2_pr_time_units_aligned(struct printbuf *out, u64 ns)
{
const
struct
time_unit
*
u
=
bch2_pick_time_units
(
ns
);
prt_printf
(
out
,
"%llu "
,
div64_u64
(
ns
,
u
->
nsecs
));
prt_tab_rjust
(
out
);
prt_printf
(
out
,
"%s"
,
u
->
name
);
prt_printf
(
out
,
"%llu
\r
%s"
,
div64_u64
(
ns
,
u
->
nsecs
),
u
->
name
);
}
static
inline
void
pr_name_and_units
(
struct
printbuf
*
out
,
const
char
*
name
,
u64
ns
)
{
prt_str
(
out
,
name
);
prt_tab
(
out
);
prt_printf
(
out
,
"%s
\t
"
,
name
);
bch2_pr_time_units_aligned
(
out
,
ns
);
prt_newline
(
out
);
}
...
...
@@ -389,12 +386,8 @@ void bch2_time_stats_to_text(struct printbuf *out, struct bch2_time_stats *stats
}
printbuf_tabstop_push
(
out
,
out
->
indent
+
TABSTOP_SIZE
);
prt_printf
(
out
,
"count:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llu "
,
stats
->
duration_stats
.
n
);
prt_printf
(
out
,
"count:
\t
%llu
\n
"
,
stats
->
duration_stats
.
n
);
printbuf_tabstop_pop
(
out
);
prt_newline
(
out
);
printbuf_tabstops_reset
(
out
);
...
...
@@ -403,13 +396,8 @@ void bch2_time_stats_to_text(struct printbuf *out, struct bch2_time_stats *stats
printbuf_tabstop_push
(
out
,
0
);
printbuf_tabstop_push
(
out
,
TABSTOP_SIZE
+
2
);
prt_tab
(
out
);
prt_printf
(
out
,
"since mount"
);
prt_tab_rjust
(
out
);
prt_tab
(
out
);
prt_printf
(
out
,
"
\t
since mount
\r\t
recent
\r\n
"
);
prt_printf
(
out
,
"recent"
);
prt_tab_rjust
(
out
);
prt_newline
(
out
);
printbuf_tabstops_reset
(
out
);
printbuf_tabstop_push
(
out
,
out
->
indent
+
20
);
...
...
@@ -417,23 +405,20 @@ void bch2_time_stats_to_text(struct printbuf *out, struct bch2_time_stats *stats
printbuf_tabstop_push
(
out
,
2
);
printbuf_tabstop_push
(
out
,
TABSTOP_SIZE
);
prt_printf
(
out
,
"duration of events"
);
prt_newline
(
out
);
prt_printf
(
out
,
"duration of events
\n
"
);
printbuf_indent_add
(
out
,
2
);
pr_name_and_units
(
out
,
"min:"
,
stats
->
min_duration
);
pr_name_and_units
(
out
,
"max:"
,
stats
->
max_duration
);
pr_name_and_units
(
out
,
"total:"
,
stats
->
total_duration
);
prt_printf
(
out
,
"mean:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"mean:
\t
"
);
bch2_pr_time_units_aligned
(
out
,
d_mean
);
prt_tab
(
out
);
bch2_pr_time_units_aligned
(
out
,
mean_and_variance_weighted_get_mean
(
stats
->
duration_stats_weighted
,
TIME_STATS_MV_WEIGHT
));
prt_newline
(
out
);
prt_printf
(
out
,
"stddev:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"stddev:
\t
"
);
bch2_pr_time_units_aligned
(
out
,
d_stddev
);
prt_tab
(
out
);
bch2_pr_time_units_aligned
(
out
,
mean_and_variance_weighted_get_stddev
(
stats
->
duration_stats_weighted
,
TIME_STATS_MV_WEIGHT
));
...
...
@@ -441,22 +426,19 @@ void bch2_time_stats_to_text(struct printbuf *out, struct bch2_time_stats *stats
printbuf_indent_sub
(
out
,
2
);
prt_newline
(
out
);
prt_printf
(
out
,
"time between events"
);
prt_newline
(
out
);
prt_printf
(
out
,
"time between events
\n
"
);
printbuf_indent_add
(
out
,
2
);
pr_name_and_units
(
out
,
"min:"
,
stats
->
min_freq
);
pr_name_and_units
(
out
,
"max:"
,
stats
->
max_freq
);
prt_printf
(
out
,
"mean:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"mean:
\t
"
);
bch2_pr_time_units_aligned
(
out
,
f_mean
);
prt_tab
(
out
);
bch2_pr_time_units_aligned
(
out
,
mean_and_variance_weighted_get_mean
(
stats
->
freq_stats_weighted
,
TIME_STATS_MV_WEIGHT
));
prt_newline
(
out
);
prt_printf
(
out
,
"stddev:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"stddev:
\t
"
);
bch2_pr_time_units_aligned
(
out
,
f_stddev
);
prt_tab
(
out
);
bch2_pr_time_units_aligned
(
out
,
mean_and_variance_weighted_get_stddev
(
stats
->
freq_stats_weighted
,
TIME_STATS_MV_WEIGHT
));
...
...
@@ -589,40 +571,31 @@ void bch2_pd_controller_debug_to_text(struct printbuf *out, struct bch_pd_contro
if
(
!
out
->
nr_tabstops
)
printbuf_tabstop_push
(
out
,
20
);
prt_printf
(
out
,
"rate:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"rate:
\t
"
);
prt_human_readable_s64
(
out
,
pd
->
rate
.
rate
);
prt_newline
(
out
);
prt_printf
(
out
,
"target:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"target:
\t
"
);
prt_human_readable_u64
(
out
,
pd
->
last_target
);
prt_newline
(
out
);
prt_printf
(
out
,
"actual:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"actual:
\t
"
);
prt_human_readable_u64
(
out
,
pd
->
last_actual
);
prt_newline
(
out
);
prt_printf
(
out
,
"proportional:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"proportional:
\t
"
);
prt_human_readable_s64
(
out
,
pd
->
last_proportional
);
prt_newline
(
out
);
prt_printf
(
out
,
"derivative:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"derivative:
\t
"
);
prt_human_readable_s64
(
out
,
pd
->
last_derivative
);
prt_newline
(
out
);
prt_printf
(
out
,
"change:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"change:
\t
"
);
prt_human_readable_s64
(
out
,
pd
->
last_change
);
prt_newline
(
out
);
prt_printf
(
out
,
"next io:"
);
prt_tab
(
out
);
prt_printf
(
out
,
"%llims"
,
div64_s64
(
pd
->
rate
.
next
-
local_clock
(),
NSEC_PER_MSEC
));
prt_newline
(
out
);
prt_printf
(
out
,
"next io:
\t
%llims
\n
"
,
div64_s64
(
pd
->
rate
.
next
-
local_clock
(),
NSEC_PER_MSEC
));
}
/* misc: */
...
...
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