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
a8958a1a
Commit
a8958a1a
authored
Nov 02, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bkey_copy() is no longer a macro
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
103ffe9a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
19 deletions
+15
-19
fs/bcachefs/bkey.h
fs/bcachefs/bkey.h
+9
-13
fs/bcachefs/bkey_sort.c
fs/bcachefs/bkey_sort.c
+3
-3
fs/bcachefs/btree_io.c
fs/bcachefs/btree_io.c
+2
-2
fs/bcachefs/btree_update_interior.h
fs/bcachefs/btree_update_interior.h
+1
-1
No files found.
fs/bcachefs/bkey.h
View file @
a8958a1a
...
...
@@ -92,19 +92,15 @@ enum bkey_lr_packed {
#define bkey_lr_packed(_l, _r) \
((_l)->format + ((_r)->format << 1))
#define bkey_copy(_dst, _src) \
do { \
BUILD_BUG_ON(!type_is(_dst, struct bkey_i *) && \
!type_is(_dst, struct bkey_packed *)); \
BUILD_BUG_ON(!type_is(_src, struct bkey_i *) && \
!type_is(_src, struct bkey_packed *)); \
EBUG_ON((u64 *) (_dst) > (u64 *) (_src) && \
(u64 *) (_dst) < (u64 *) (_src) + \
((struct bkey *) (_src))->u64s); \
\
memcpy_u64s_small((_dst), (_src), \
((struct bkey *) (_src))->u64s); \
} while (0)
static
inline
void
bkey_p_copy
(
struct
bkey_packed
*
dst
,
const
struct
bkey_packed
*
src
)
{
memcpy_u64s_small
(
dst
,
src
,
src
->
u64s
);
}
static
inline
void
bkey_copy
(
struct
bkey_i
*
dst
,
const
struct
bkey_i
*
src
)
{
memcpy_u64s_small
(
dst
,
src
,
src
->
k
.
u64s
);
}
struct
btree
;
...
...
fs/bcachefs/bkey_sort.c
View file @
a8958a1a
...
...
@@ -106,7 +106,7 @@ bch2_key_sort_fix_overlapping(struct bch_fs *c, struct bset *dst,
while
((
k
=
sort_iter_peek
(
iter
)))
{
if
(
!
bkey_deleted
(
k
)
&&
!
should_drop_next_key
(
iter
))
{
bkey_copy
(
out
,
k
);
bkey_
p_
copy
(
out
,
k
);
btree_keys_account_key_add
(
&
nr
,
0
,
out
);
out
=
bkey_p_next
(
out
);
}
...
...
@@ -137,7 +137,7 @@ bch2_sort_repack(struct bset *dst, struct btree *src,
continue
;
if
(
!
transform
)
bkey_copy
(
out
,
in
);
bkey_
p_
copy
(
out
,
in
);
else
if
(
bch2_bkey_transform
(
out_f
,
out
,
bkey_packed
(
in
)
?
in_f
:
&
bch2_bkey_format_current
,
in
))
out
->
format
=
KEY_FORMAT_LOCAL_BTREE
;
...
...
@@ -191,7 +191,7 @@ unsigned bch2_sort_keys(struct bkey_packed *dst,
memcpy_u64s_small
(
out
,
in
,
bkeyp_key_u64s
(
f
,
in
));
set_bkeyp_val_u64s
(
f
,
out
,
0
);
}
else
{
bkey_copy
(
out
,
in
);
bkey_
p_
copy
(
out
,
in
);
}
out
->
needs_whiteout
|=
needs_whiteout
;
out
=
bkey_p_next
(
out
);
...
...
fs/bcachefs/btree_io.c
View file @
a8958a1a
...
...
@@ -184,7 +184,7 @@ static void bch2_sort_whiteouts(struct bch_fs *c, struct btree *b)
k
=
new_whiteouts
;
while
(
ptrs
!=
ptrs_end
)
{
bkey_copy
(
k
,
*
ptrs
);
bkey_
p_
copy
(
k
,
*
ptrs
);
k
=
bkey_p_next
(
k
);
ptrs
++
;
}
...
...
@@ -260,7 +260,7 @@ static bool bch2_drop_whiteouts(struct btree *b, enum compact_mode mode)
n
=
bkey_p_next
(
k
);
if
(
!
bkey_deleted
(
k
))
{
bkey_copy
(
out
,
k
);
bkey_
p_
copy
(
out
,
k
);
out
=
bkey_p_next
(
out
);
}
else
{
BUG_ON
(
k
->
needs_whiteout
);
...
...
fs/bcachefs/btree_update_interior.h
View file @
a8958a1a
...
...
@@ -303,7 +303,7 @@ static inline void push_whiteout(struct bch_fs *c, struct btree *b,
k
.
needs_whiteout
=
true
;
b
->
whiteout_u64s
+=
k
.
u64s
;
bkey_copy
(
unwritten_whiteouts_start
(
c
,
b
),
&
k
);
bkey_
p_
copy
(
unwritten_whiteouts_start
(
c
,
b
),
&
k
);
}
/*
...
...
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