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
2d3b5810
Commit
2d3b5810
authored
6 years ago
by
Kent Overstreet
Committed by
Kent Overstreet
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Better journal debug
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
c8cc5b3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
fs/bcachefs/journal.c
fs/bcachefs/journal.c
+33
-14
No files found.
fs/bcachefs/journal.c
View file @
2d3b5810
...
@@ -1084,35 +1084,54 @@ ssize_t bch2_journal_print_debug(struct journal *j, char *buf)
...
@@ -1084,35 +1084,54 @@ ssize_t bch2_journal_print_debug(struct journal *j, char *buf)
{
{
struct
printbuf
out
=
_PBUF
(
buf
,
PAGE_SIZE
);
struct
printbuf
out
=
_PBUF
(
buf
,
PAGE_SIZE
);
struct
bch_fs
*
c
=
container_of
(
j
,
struct
bch_fs
,
journal
);
struct
bch_fs
*
c
=
container_of
(
j
,
struct
bch_fs
,
journal
);
union
journal_res_state
*
s
=
&
j
->
reservation
s
;
union
journal_res_state
s
;
struct
bch_dev
*
ca
;
struct
bch_dev
*
ca
;
unsigned
iter
;
unsigned
iter
;
rcu_read_lock
();
rcu_read_lock
();
spin_lock
(
&
j
->
lock
);
spin_lock
(
&
j
->
lock
);
s
=
READ_ONCE
(
j
->
reservations
);
pr_buf
(
&
out
,
pr_buf
(
&
out
,
"active journal entries:
\t
%llu
\n
"
"active journal entries:
\t
%llu
\n
"
"seq:
\t\t\t
%llu
\n
"
"seq:
\t\t\t
%llu
\n
"
"last_seq:
\t\t
%llu
\n
"
"last_seq:
\t\t
%llu
\n
"
"last_seq_ondisk:
\t
%llu
\n
"
"last_seq_ondisk:
\t
%llu
\n
"
"reservation count:
\t
%u
\n
"
"current entry:
\t\t
"
,
"reservation offset:
\t
%u
\n
"
"current entry u64s:
\t
%u
\n
"
"io in flight:
\t\t
%i
\n
"
"need write:
\t\t
%i
\n
"
"dirty:
\t\t\t
%i
\n
"
"replay done:
\t\t
%i
\n
"
,
fifo_used
(
&
j
->
pin
),
fifo_used
(
&
j
->
pin
),
journal_cur_seq
(
j
),
journal_cur_seq
(
j
),
journal_last_seq
(
j
),
journal_last_seq
(
j
),
j
->
last_seq_ondisk
,
j
->
last_seq_ondisk
);
journal_state_count
(
*
s
,
s
->
idx
),
s
->
cur_entry_offset
,
switch
(
s
.
cur_entry_offset
)
{
j
->
cur_entry_u64s
,
case
JOURNAL_ENTRY_ERROR_VAL
:
s
->
prev_buf_unwritten
,
pr_buf
(
&
out
,
"error
\n
"
);
break
;
case
JOURNAL_ENTRY_CLOSED_VAL
:
pr_buf
(
&
out
,
"closed
\n
"
);
break
;
default:
pr_buf
(
&
out
,
"%u/%u
\n
"
,
s
.
cur_entry_offset
,
j
->
cur_entry_u64s
);
break
;
}
pr_buf
(
&
out
,
"current entry refs:
\t
%u
\n
"
"prev entry unwritten:
\t
"
,
journal_state_count
(
s
,
s
.
idx
));
if
(
s
.
prev_buf_unwritten
)
pr_buf
(
&
out
,
"yes, ref %u
\n
"
,
journal_state_count
(
s
,
!
s
.
idx
));
else
pr_buf
(
&
out
,
"no
\n
"
);
pr_buf
(
&
out
,
"need write:
\t\t
%i
\n
"
"replay done:
\t\t
%i
\n
"
,
test_bit
(
JOURNAL_NEED_WRITE
,
&
j
->
flags
),
test_bit
(
JOURNAL_NEED_WRITE
,
&
j
->
flags
),
journal_entry_is_open
(
j
),
test_bit
(
JOURNAL_REPLAY_DONE
,
&
j
->
flags
));
test_bit
(
JOURNAL_REPLAY_DONE
,
&
j
->
flags
));
for_each_member_device_rcu
(
ca
,
c
,
iter
,
for_each_member_device_rcu
(
ca
,
c
,
iter
,
...
...
This diff is collapsed.
Click to expand it.
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