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
255ebbbf
Commit
255ebbbf
authored
Dec 08, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_path_get() -> btree_path_idx_t
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
5ce8b92d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
16 deletions
+20
-16
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+6
-6
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+3
-3
fs/bcachefs/btree_types.h
fs/bcachefs/btree_types.h
+2
-0
fs/bcachefs/btree_update.c
fs/bcachefs/btree_update.c
+7
-5
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+2
-2
No files found.
fs/bcachefs/btree_iter.c
View file @
255ebbbf
...
...
@@ -1547,10 +1547,10 @@ static inline struct btree_path *btree_path_alloc(struct btree_trans *trans,
return
path
;
}
struct
btree_path
*
bch2_path_get
(
struct
btree_trans
*
trans
,
enum
btree_id
btree_id
,
struct
bpos
pos
,
unsigned
locks_want
,
unsigned
level
,
unsigned
flags
,
unsigned
long
ip
)
btree_path_idx_t
bch2_path_get
(
struct
btree_trans
*
trans
,
enum
btree_id
btree_id
,
struct
bpos
pos
,
unsigned
locks_want
,
unsigned
level
,
unsigned
flags
,
unsigned
long
ip
)
{
struct
btree_path
*
path
,
*
path_pos
=
NULL
;
bool
cached
=
flags
&
BTREE_ITER_CACHED
;
...
...
@@ -1618,7 +1618,7 @@ struct btree_path *bch2_path_get(struct btree_trans *trans,
if
(
locks_want
>
path
->
locks_want
)
bch2_btree_path_upgrade_noupgrade_sibs
(
trans
,
path
,
locks_want
,
NULL
);
return
path
;
return
path
->
idx
;
}
struct
bkey_s_c
bch2_btree_path_peek_slot
(
struct
btree_path
*
path
,
struct
bkey
*
u
)
...
...
@@ -1928,7 +1928,7 @@ struct bkey_s_c btree_trans_peek_key_cache(struct btree_iter *iter, struct bpos
return
bkey_s_c_null
;
if
(
!
iter
->
key_cache_path
)
iter
->
key_cache_path
=
bch2_path_get
(
trans
,
iter
->
btree_id
,
pos
,
iter
->
key_cache_path
=
trans
->
paths
+
bch2_path_get
(
trans
,
iter
->
btree_id
,
pos
,
iter
->
flags
&
BTREE_ITER_INTENT
,
0
,
iter
->
flags
|
BTREE_ITER_CACHED
|
BTREE_ITER_CACHED_NOFILL
,
...
...
fs/bcachefs/btree_iter.h
View file @
255ebbbf
...
...
@@ -202,8 +202,8 @@ static inline int __must_check bch2_btree_path_traverse(struct btree_trans *tran
int
__must_check
bch2_btree_path_traverse
(
struct
btree_trans
*
,
struct
btree_path
*
,
unsigned
);
struct
btree_path
*
bch2_path_get
(
struct
btree_trans
*
,
enum
btree_id
,
struct
bpos
,
unsigned
,
unsigned
,
unsigned
,
unsigned
long
);
btree_path_idx_t
bch2_path_get
(
struct
btree_trans
*
,
enum
btree_id
,
struct
bpos
,
unsigned
,
unsigned
,
unsigned
,
unsigned
long
);
struct
bkey_s_c
bch2_btree_path_peek_slot
(
struct
btree_path
*
,
struct
bkey
*
);
/*
...
...
@@ -443,7 +443,7 @@ static inline void bch2_trans_iter_init_common(struct btree_trans *trans,
#ifdef CONFIG_BCACHEFS_DEBUG
iter
->
ip_allocated
=
ip
;
#endif
iter
->
path
=
bch2_path_get
(
trans
,
btree_id
,
iter
->
pos
,
iter
->
path
=
trans
->
paths
+
bch2_path_get
(
trans
,
btree_id
,
iter
->
pos
,
locks_want
,
depth
,
flags
,
ip
);
}
...
...
fs/bcachefs/btree_types.h
View file @
255ebbbf
...
...
@@ -222,6 +222,8 @@ enum btree_path_uptodate {
#define TRACK_PATH_ALLOCATED
#endif
typedef
u16
btree_path_idx_t
;
struct
btree_path
{
u8
idx
;
u8
sorted_idx
;
...
...
fs/bcachefs/btree_update.c
View file @
255ebbbf
...
...
@@ -344,16 +344,18 @@ static noinline int flush_new_cached_update(struct btree_trans *trans,
enum
btree_update_flags
flags
,
unsigned
long
ip
)
{
struct
btree_path
*
btree_path
;
struct
bkey
k
;
int
ret
;
btree_path
=
bch2_path_get
(
trans
,
path
->
btree_id
,
path
->
pos
,
1
,
0
,
BTREE_ITER_INTENT
,
_THIS_IP_
);
ret
=
bch2_btree_path_traverse
(
trans
,
btree_path
,
0
);
btree_path_idx_t
path_idx
=
bch2_path_get
(
trans
,
path
->
btree_id
,
path
->
pos
,
1
,
0
,
BTREE_ITER_INTENT
,
_THIS_IP_
);
ret
=
bch2_btree_path_traverse
(
trans
,
trans
->
paths
+
path_idx
,
0
);
if
(
ret
)
goto
out
;
struct
btree_path
*
btree_path
=
trans
->
paths
+
path_idx
;
/*
* The old key in the insert entry might actually refer to an existing
* key in the btree that has been deleted from cache and not yet
...
...
@@ -467,7 +469,7 @@ static noinline int bch2_trans_update_get_key_cache(struct btree_trans *trans,
int
ret
;
if
(
!
iter
->
key_cache_path
)
iter
->
key_cache_path
=
iter
->
key_cache_path
=
trans
->
paths
+
bch2_path_get
(
trans
,
path
->
btree_id
,
path
->
pos
,
1
,
0
,
BTREE_ITER_INTENT
|
BTREE_ITER_CACHED
,
_THIS_IP_
);
...
...
fs/bcachefs/btree_update_interior.c
View file @
255ebbbf
...
...
@@ -36,7 +36,7 @@ static struct btree_path *get_unlocked_mut_path(struct btree_trans *trans,
{
struct
btree_path
*
path
;
path
=
bch2_path_get
(
trans
,
btree_id
,
pos
,
level
+
1
,
level
,
path
=
trans
->
paths
+
bch2_path_get
(
trans
,
btree_id
,
pos
,
level
+
1
,
level
,
BTREE_ITER_NOPRESERVE
|
BTREE_ITER_INTENT
,
_RET_IP_
);
path
=
bch2_btree_path_make_mut
(
trans
,
path
,
true
,
_RET_IP_
);
...
...
@@ -1795,7 +1795,7 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
?
bpos_predecessor
(
b
->
data
->
min_key
)
:
bpos_successor
(
b
->
data
->
max_key
);
sib_path
=
bch2_path_get
(
trans
,
path
->
btree_id
,
sib_pos
,
sib_path
=
trans
->
paths
+
bch2_path_get
(
trans
,
path
->
btree_id
,
sib_pos
,
U8_MAX
,
level
,
BTREE_ITER_INTENT
,
_THIS_IP_
);
ret
=
bch2_btree_path_traverse
(
trans
,
sib_path
,
false
);
if
(
ret
)
...
...
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