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
37165014
Commit
37165014
authored
Dec 27, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: wb_key_cmp -> wb_key_ref_cmp
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
89056f24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
fs/bcachefs/btree_write_buffer.c
fs/bcachefs/btree_write_buffer.c
+6
-6
No files found.
fs/bcachefs/btree_write_buffer.c
View file @
37165014
...
...
@@ -17,14 +17,14 @@ static int bch2_btree_write_buffer_journal_flush(struct journal *,
static
int
bch2_journal_keys_to_write_buffer
(
struct
bch_fs
*
,
struct
journal_buf
*
);
static
inline
bool
__wb_key_cmp
(
const
struct
wb_key_ref
*
l
,
const
struct
wb_key_ref
*
r
)
static
inline
bool
__wb_key_
ref_
cmp
(
const
struct
wb_key_ref
*
l
,
const
struct
wb_key_ref
*
r
)
{
return
(
cmp_int
(
l
->
hi
,
r
->
hi
)
?:
cmp_int
(
l
->
mi
,
r
->
mi
)
?:
cmp_int
(
l
->
lo
,
r
->
lo
))
>=
0
;
}
static
inline
bool
wb_key_cmp
(
const
struct
wb_key_ref
*
l
,
const
struct
wb_key_ref
*
r
)
static
inline
bool
wb_key_
ref_
cmp
(
const
struct
wb_key_ref
*
l
,
const
struct
wb_key_ref
*
r
)
{
#ifdef CONFIG_X86_64
int
cmp
;
...
...
@@ -39,10 +39,10 @@ static inline bool wb_key_cmp(const struct wb_key_ref *l, const struct wb_key_re
:
[
l
]
"r"
(
l
),
[
r
]
"r"
(
r
)
:
"rax"
,
"cc"
);
EBUG_ON
(
cmp
!=
__wb_key_cmp
(
l
,
r
));
EBUG_ON
(
cmp
!=
__wb_key_
ref_
cmp
(
l
,
r
));
return
cmp
;
#else
return
__wb_key_cmp
(
l
,
r
);
return
__wb_key_
ref_
cmp
(
l
,
r
);
#endif
}
...
...
@@ -87,12 +87,12 @@ static noinline void wb_sort(struct wb_key_ref *base, size_t num)
* average, 3/4 worst-case.)
*/
for
(
b
=
a
;
c
=
2
*
b
+
1
,
(
d
=
c
+
1
)
<
n
;)
b
=
wb_key_cmp
(
base
+
c
,
base
+
d
)
?
c
:
d
;
b
=
wb_key_
ref_
cmp
(
base
+
c
,
base
+
d
)
?
c
:
d
;
if
(
d
==
n
)
/* Special case last leaf with no sibling */
b
=
c
;
/* Now backtrack from "b" to the correct location for "a" */
while
(
b
!=
a
&&
wb_key_cmp
(
base
+
a
,
base
+
b
))
while
(
b
!=
a
&&
wb_key_
ref_
cmp
(
base
+
a
,
base
+
b
))
b
=
(
b
-
1
)
/
2
;
c
=
b
;
/* Where "a" belongs */
while
(
b
!=
a
)
{
/* Shift it into place */
...
...
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