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
1a470560
Commit
1a470560
authored
Mar 18, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: BTREE_INSERT_ATOMIC must be used for extents now
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
49a67206
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/btree_update_leaf.c
+9
-2
No files found.
fs/bcachefs/btree_update_leaf.c
View file @
1a470560
...
@@ -406,9 +406,10 @@ bch2_deferred_update_alloc(struct bch_fs *c,
...
@@ -406,9 +406,10 @@ bch2_deferred_update_alloc(struct bch_fs *c,
/* Normal update interface: */
/* Normal update interface: */
static
inline
void
btree_insert_entry_checks
(
struct
b
ch_fs
*
c
,
static
inline
void
btree_insert_entry_checks
(
struct
b
tree_trans
*
trans
,
struct
btree_insert_entry
*
i
)
struct
btree_insert_entry
*
i
)
{
{
struct
bch_fs
*
c
=
trans
->
c
;
enum
btree_id
btree_id
=
!
i
->
deferred
enum
btree_id
btree_id
=
!
i
->
deferred
?
i
->
iter
->
btree_id
?
i
->
iter
->
btree_id
:
i
->
d
->
btree_id
;
:
i
->
d
->
btree_id
;
...
@@ -419,6 +420,9 @@ static inline void btree_insert_entry_checks(struct bch_fs *c,
...
@@ -419,6 +420,9 @@ static inline void btree_insert_entry_checks(struct bch_fs *c,
EBUG_ON
((
i
->
iter
->
flags
&
BTREE_ITER_IS_EXTENTS
)
&&
EBUG_ON
((
i
->
iter
->
flags
&
BTREE_ITER_IS_EXTENTS
)
&&
!
bch2_extent_is_atomic
(
i
->
k
,
i
->
iter
));
!
bch2_extent_is_atomic
(
i
->
k
,
i
->
iter
));
EBUG_ON
((
i
->
iter
->
flags
&
BTREE_ITER_IS_EXTENTS
)
&&
!
(
trans
->
flags
&
BTREE_INSERT_ATOMIC
));
bch2_btree_iter_verify_locks
(
i
->
iter
);
bch2_btree_iter_verify_locks
(
i
->
iter
);
}
}
...
@@ -840,7 +844,7 @@ int bch2_trans_commit(struct btree_trans *trans,
...
@@ -840,7 +844,7 @@ int bch2_trans_commit(struct btree_trans *trans,
bubble_sort
(
trans
->
updates
,
trans
->
nr_updates
,
btree_trans_cmp
);
bubble_sort
(
trans
->
updates
,
trans
->
nr_updates
,
btree_trans_cmp
);
trans_for_each_update
(
trans
,
i
)
trans_for_each_update
(
trans
,
i
)
btree_insert_entry_checks
(
c
,
i
);
btree_insert_entry_checks
(
trans
,
i
);
if
(
unlikely
(
!
(
trans
->
flags
&
BTREE_INSERT_NOCHECK_RW
)
&&
if
(
unlikely
(
!
(
trans
->
flags
&
BTREE_INSERT_NOCHECK_RW
)
&&
!
percpu_ref_tryget
(
&
c
->
writes
)))
!
percpu_ref_tryget
(
&
c
->
writes
)))
...
@@ -954,7 +958,10 @@ int bch2_btree_delete_range(struct bch_fs *c, enum btree_id id,
...
@@ -954,7 +958,10 @@ int bch2_btree_delete_range(struct bch_fs *c, enum btree_id id,
bch2_trans_update
(
&
trans
,
BTREE_INSERT_ENTRY
(
iter
,
&
delete
));
bch2_trans_update
(
&
trans
,
BTREE_INSERT_ENTRY
(
iter
,
&
delete
));
ret
=
bch2_trans_commit
(
&
trans
,
NULL
,
journal_seq
,
ret
=
bch2_trans_commit
(
&
trans
,
NULL
,
journal_seq
,
BTREE_INSERT_ATOMIC
|
BTREE_INSERT_NOFAIL
);
BTREE_INSERT_NOFAIL
);
if
(
ret
==
-
EINTR
)
ret
=
0
;
if
(
ret
)
if
(
ret
)
break
;
break
;
...
...
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