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
f6363aca
Commit
f6363aca
authored
Dec 08, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_btree_path_make_mut() -> btree_path_idx_t
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
4617d946
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+6
-7
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+7
-6
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+5
-5
fs/bcachefs/btree_write_buffer.c
fs/bcachefs/btree_write_buffer.c
+1
-1
No files found.
fs/bcachefs/btree_iter.c
View file @
f6363aca
...
@@ -1208,13 +1208,12 @@ static struct btree_path *btree_path_clone(struct btree_trans *trans, struct btr
...
@@ -1208,13 +1208,12 @@ static struct btree_path *btree_path_clone(struct btree_trans *trans, struct btr
}
}
__flatten
__flatten
struct
btree_path
*
__bch2_btree_path_make_mut
(
struct
btree_trans
*
trans
,
btree_path_idx_t
__bch2_btree_path_make_mut
(
struct
btree_trans
*
trans
,
struct
btree_path
*
path
,
bool
intent
,
btree_path_idx_t
path
,
bool
intent
,
unsigned
long
ip
)
unsigned
long
ip
)
{
{
__btree_path_put
(
path
,
intent
);
__btree_path_put
(
trans
->
paths
+
path
,
intent
);
path
=
btree_path_clone
(
trans
,
path
,
intent
)
;
path
=
btree_path_clone
(
trans
,
trans
->
paths
+
path
,
intent
)
->
idx
;
path
->
preserve
=
false
;
trans
->
paths
[
path
].
preserve
=
false
;
return
path
;
return
path
;
}
}
...
@@ -1228,7 +1227,7 @@ __bch2_btree_path_set_pos(struct btree_trans *trans,
...
@@ -1228,7 +1227,7 @@ __bch2_btree_path_set_pos(struct btree_trans *trans,
bch2_trans_verify_not_in_restart
(
trans
);
bch2_trans_verify_not_in_restart
(
trans
);
EBUG_ON
(
!
trans
->
paths
[
path_idx
].
ref
);
EBUG_ON
(
!
trans
->
paths
[
path_idx
].
ref
);
path_idx
=
bch2_btree_path_make_mut
(
trans
,
trans
->
paths
+
path_idx
,
intent
,
ip
)
->
idx
;
path_idx
=
bch2_btree_path_make_mut
(
trans
,
path_idx
,
intent
,
ip
)
;
struct
btree_path
*
path
=
trans
->
paths
+
path_idx
;
struct
btree_path
*
path
=
trans
->
paths
+
path_idx
;
path
->
pos
=
new_pos
;
path
->
pos
=
new_pos
;
...
...
fs/bcachefs/btree_iter.h
View file @
f6363aca
...
@@ -160,17 +160,18 @@ __trans_next_path_with_node(struct btree_trans *trans, struct btree *b,
...
@@ -160,17 +160,18 @@ __trans_next_path_with_node(struct btree_trans *trans, struct btree *b,
_path = __trans_next_path_with_node((_trans), (_b), \
_path = __trans_next_path_with_node((_trans), (_b), \
(_path)->idx + 1))
(_path)->idx + 1))
struct
btree_path
*
__bch2_btree_path_make_mut
(
struct
btree_trans
*
,
struct
btree_path
*
,
btree_path_idx_t
__bch2_btree_path_make_mut
(
struct
btree_trans
*
,
btree_path_idx_t
,
bool
,
unsigned
long
);
bool
,
unsigned
long
);
static
inline
struct
btree_path
*
__must_check
static
inline
btree_path_idx_t
__must_check
bch2_btree_path_make_mut
(
struct
btree_trans
*
trans
,
bch2_btree_path_make_mut
(
struct
btree_trans
*
trans
,
struct
btree_path
*
path
,
bool
intent
,
btree_path_idx_t
path
,
bool
intent
,
unsigned
long
ip
)
unsigned
long
ip
)
{
{
if
(
path
->
ref
>
1
||
path
->
preserve
)
if
(
trans
->
paths
[
path
].
ref
>
1
||
trans
->
paths
[
path
].
preserve
)
path
=
__bch2_btree_path_make_mut
(
trans
,
path
,
intent
,
ip
);
path
=
__bch2_btree_path_make_mut
(
trans
,
path
,
intent
,
ip
);
path
->
should_be_locked
=
false
;
trans
->
paths
[
path
].
should_be_locked
=
false
;
return
path
;
return
path
;
}
}
...
...
fs/bcachefs/btree_update_interior.c
View file @
f6363aca
...
@@ -34,12 +34,12 @@ static struct btree_path *get_unlocked_mut_path(struct btree_trans *trans,
...
@@ -34,12 +34,12 @@ static struct btree_path *get_unlocked_mut_path(struct btree_trans *trans,
unsigned
level
,
unsigned
level
,
struct
bpos
pos
)
struct
bpos
pos
)
{
{
struct
btree_path
*
path
;
btree_path_idx_t
path_idx
=
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_NOPRESERVE
|
BTREE_ITER_INTENT
,
_RET_IP_
);
BTREE_ITER_INTENT
,
_RET_IP_
);
path
=
bch2_btree_path_make_mut
(
trans
,
path
,
true
,
_RET_IP_
);
path_idx
=
bch2_btree_path_make_mut
(
trans
,
path_idx
,
true
,
_RET_IP_
);
struct
btree_path
*
path
=
trans
->
paths
+
path_idx
;
bch2_btree_path_downgrade
(
trans
,
path
);
bch2_btree_path_downgrade
(
trans
,
path
);
__bch2_btree_path_unlock
(
trans
,
path
);
__bch2_btree_path_unlock
(
trans
,
path
);
return
path
;
return
path
;
...
@@ -2167,7 +2167,7 @@ static int __bch2_btree_node_update_key(struct btree_trans *trans,
...
@@ -2167,7 +2167,7 @@ static int __bch2_btree_node_update_key(struct btree_trans *trans,
if
(
parent
)
{
if
(
parent
)
{
bch2_trans_copy_iter
(
&
iter2
,
iter
);
bch2_trans_copy_iter
(
&
iter2
,
iter
);
iter2
.
path
=
bch2_btree_path_make_mut
(
trans
,
iter2
.
path
,
iter2
.
path
=
trans
->
paths
+
bch2_btree_path_make_mut
(
trans
,
iter2
.
path
->
idx
,
iter2
.
flags
&
BTREE_ITER_INTENT
,
iter2
.
flags
&
BTREE_ITER_INTENT
,
_THIS_IP_
);
_THIS_IP_
);
...
...
fs/bcachefs/btree_write_buffer.c
View file @
f6363aca
...
@@ -140,7 +140,7 @@ static inline int wb_flush_one(struct btree_trans *trans, struct btree_iter *ite
...
@@ -140,7 +140,7 @@ static inline int wb_flush_one(struct btree_trans *trans, struct btree_iter *ite
* set_pos and traverse():
* set_pos and traverse():
*/
*/
if
(
iter
->
path
->
ref
>
1
)
if
(
iter
->
path
->
ref
>
1
)
iter
->
path
=
__bch2_btree_path_make_mut
(
trans
,
iter
->
path
,
true
,
_THIS_IP_
);
iter
->
path
=
trans
->
paths
+
__bch2_btree_path_make_mut
(
trans
,
iter
->
path
->
idx
,
true
,
_THIS_IP_
);
path
=
iter
->
path
;
path
=
iter
->
path
;
...
...
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