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
449ceafb
Commit
449ceafb
authored
Apr 13, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_trans_commit_flags_to_text()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
b7f10636
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
5 deletions
+29
-5
fs/bcachefs/btree_trans_commit.c
fs/bcachefs/btree_trans_commit.c
+21
-0
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update.h
+2
-0
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+5
-4
fs/bcachefs/btree_update_interior.h
fs/bcachefs/btree_update_interior.h
+1
-1
No files found.
fs/bcachefs/btree_trans_commit.c
View file @
449ceafb
// SPDX-License-Identifier: GPL-2.0
#include "bcachefs.h"
#include "alloc_foreground.h"
#include "btree_gc.h"
#include "btree_io.h"
#include "btree_iter.h"
...
...
@@ -19,6 +20,26 @@
#include <linux/prefetch.h>
static
const
char
*
const
trans_commit_flags_strs
[]
=
{
#define x(n, ...) #n,
BCH_TRANS_COMMIT_FLAGS
()
#undef x
NULL
};
void
bch2_trans_commit_flags_to_text
(
struct
printbuf
*
out
,
enum
bch_trans_commit_flags
flags
)
{
enum
bch_watermark
watermark
=
flags
&
BCH_WATERMARK_MASK
;
prt_printf
(
out
,
"watermark=%s"
,
bch2_watermarks
[
watermark
]);
flags
>>=
BCH_WATERMARK_BITS
;
if
(
flags
)
{
prt_char
(
out
,
' '
);
bch2_prt_bitflags
(
out
,
trans_commit_flags_strs
,
flags
);
}
}
static
void
verify_update_old_key
(
struct
btree_trans
*
trans
,
struct
btree_insert_entry
*
i
)
{
#ifdef CONFIG_BCACHEFS_DEBUG
...
...
fs/bcachefs/btree_update.h
View file @
449ceafb
...
...
@@ -44,6 +44,8 @@ enum bch_trans_commit_flags {
#undef x
};
void
bch2_trans_commit_flags_to_text
(
struct
printbuf
*
,
enum
bch_trans_commit_flags
);
int
bch2_btree_delete_extent_at
(
struct
btree_trans
*
,
struct
btree_iter
*
,
unsigned
,
unsigned
);
int
bch2_btree_delete_at
(
struct
btree_trans
*
,
struct
btree_iter
*
,
unsigned
);
...
...
fs/bcachefs/btree_update_interior.c
View file @
449ceafb
...
...
@@ -1207,7 +1207,7 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path,
as
->
start_time
=
start_time
;
as
->
ip_started
=
_RET_IP_
;
as
->
mode
=
BTREE_UPDATE_none
;
as
->
watermark
=
watermark
;
as
->
flags
=
flags
;
as
->
took_gc_lock
=
true
;
as
->
btree_id
=
path
->
btree_id
;
as
->
update_level_start
=
level_start
;
...
...
@@ -2565,12 +2565,13 @@ void bch2_btree_root_alloc_fake(struct bch_fs *c, enum btree_id id, unsigned lev
static
void
bch2_btree_update_to_text
(
struct
printbuf
*
out
,
struct
btree_update
*
as
)
{
prt_printf
(
out
,
"%ps: btree=%s l=%u-%u watermark=%s mode=%s nodes_written=%u cl.remaining=%u journal_seq=%llu
\n
"
,
(
void
*
)
as
->
ip_started
,
prt_printf
(
out
,
"%ps: "
,
(
void
*
)
as
->
ip_started
);
bch2_trans_commit_flags_to_text
(
out
,
as
->
flags
);
prt_printf
(
out
,
" btree=%s l=%u-%u mode=%s nodes_written=%u cl.remaining=%u journal_seq=%llu
\n
"
,
bch2_btree_id_str
(
as
->
btree_id
),
as
->
update_level_start
,
as
->
update_level_end
,
bch2_watermarks
[
as
->
watermark
],
bch2_btree_update_modes
[
as
->
mode
],
as
->
nodes_written
,
closure_nr_remaining
(
&
as
->
cl
),
...
...
fs/bcachefs/btree_update_interior.h
View file @
449ceafb
...
...
@@ -52,7 +52,7 @@ struct btree_update {
struct
list_head
unwritten_list
;
enum
btree_update_mode
mode
;
enum
bch_
watermark
watermark
;
enum
bch_
trans_commit_flags
flags
;
unsigned
nodes_written
:
1
;
unsigned
took_gc_lock
:
1
;
...
...
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