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
76a0537b
Commit
76a0537b
authored
Mar 28, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Sort updates in bch2_trans_update()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
4afe7000
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update.h
+3
-9
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/btree_update_leaf.c
+20
-2
No files found.
fs/bcachefs/btree_update.h
View file @
76a0537b
...
...
@@ -99,19 +99,13 @@ int bch2_btree_node_rewrite(struct bch_fs *c, struct btree_iter *,
int
bch2_btree_node_update_key
(
struct
bch_fs
*
,
struct
btree_iter
*
,
struct
btree
*
,
struct
bkey_i_btree_ptr
*
);
static
inline
void
bch2_trans_update
(
struct
btree_trans
*
trans
,
struct
btree_insert_entry
entry
)
{
BUG_ON
(
trans
->
nr_updates
>=
trans
->
nr_iters
+
4
);
trans
->
updates
[
trans
->
nr_updates
++
]
=
entry
;
}
int
bch2_trans_commit
(
struct
btree_trans
*
,
struct
disk_reservation
*
,
u64
*
,
unsigned
);
struct
btree_insert_entry
*
bch2_trans_update
(
struct
btree_trans
*
,
struct
btree_insert_entry
);
#define bch2_trans_do(_c, _journal_seq, _flags, _do) \
({ \
struct btree_trans trans; \
...
...
fs/bcachefs/btree_update_leaf.c
View file @
76a0537b
...
...
@@ -809,8 +809,6 @@ int bch2_trans_commit(struct btree_trans *trans,
trans
->
journal_seq
=
journal_seq
;
trans
->
flags
=
flags
;
bubble_sort
(
trans
->
updates
,
trans
->
nr_updates
,
btree_trans_cmp
);
trans_for_each_update
(
trans
,
i
)
btree_insert_entry_checks
(
trans
,
i
);
bch2_btree_trans_verify_locks
(
trans
);
...
...
@@ -871,6 +869,26 @@ int bch2_trans_commit(struct btree_trans *trans,
goto
out
;
}
struct
btree_insert_entry
*
bch2_trans_update
(
struct
btree_trans
*
trans
,
struct
btree_insert_entry
entry
)
{
struct
btree_insert_entry
*
i
;
BUG_ON
(
trans
->
nr_updates
>=
trans
->
nr_iters
+
4
);
for
(
i
=
trans
->
updates
;
i
<
trans
->
updates
+
trans
->
nr_updates
;
i
++
)
if
(
btree_trans_cmp
(
entry
,
*
i
)
<
0
)
break
;
memmove
(
&
i
[
1
],
&
i
[
0
],
(
void
*
)
&
trans
->
updates
[
trans
->
nr_updates
]
-
(
void
*
)
i
);
trans
->
nr_updates
++
;
*
i
=
entry
;
return
i
;
}
int
bch2_btree_delete_at
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
iter
,
unsigned
flags
)
{
...
...
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