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
42c7d748
Commit
42c7d748
authored
May 13, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: stripe creation fixes
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
6009b4e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
fs/bcachefs/ec.c
fs/bcachefs/ec.c
+26
-0
No files found.
fs/bcachefs/ec.c
View file @
42c7d748
...
@@ -180,6 +180,25 @@ static int extent_matches_stripe(struct bch_fs *c,
...
@@ -180,6 +180,25 @@ static int extent_matches_stripe(struct bch_fs *c,
return
-
1
;
return
-
1
;
}
}
static
bool
extent_has_stripe_ptr
(
struct
bkey_s_c
k
,
u64
idx
)
{
struct
bkey_s_c_extent
e
;
const
union
bch_extent_entry
*
entry
;
if
(
!
bkey_extent_is_data
(
k
.
k
))
return
false
;
e
=
bkey_s_c_to_extent
(
k
);
extent_for_each_entry
(
e
,
entry
)
if
(
extent_entry_type
(
entry
)
==
BCH_EXTENT_ENTRY_stripe_ptr
&&
entry
->
stripe_ptr
.
idx
==
idx
)
return
true
;
return
false
;
}
static
void
ec_stripe_key_init
(
struct
bch_fs
*
c
,
static
void
ec_stripe_key_init
(
struct
bch_fs
*
c
,
struct
bkey_i_stripe
*
s
,
struct
bkey_i_stripe
*
s
,
struct
open_buckets
*
blocks
,
struct
open_buckets
*
blocks
,
...
@@ -756,12 +775,19 @@ static int ec_stripe_update_ptrs(struct bch_fs *c,
...
@@ -756,12 +775,19 @@ static int ec_stripe_update_ptrs(struct bch_fs *c,
while
((
k
=
bch2_btree_iter_peek
(
iter
)).
k
&&
while
((
k
=
bch2_btree_iter_peek
(
iter
)).
k
&&
!
(
ret
=
bkey_err
(
k
))
&&
!
(
ret
=
bkey_err
(
k
))
&&
bkey_cmp
(
bkey_start_pos
(
k
.
k
),
pos
->
p
)
<
0
)
{
bkey_cmp
(
bkey_start_pos
(
k
.
k
),
pos
->
p
)
<
0
)
{
if
(
extent_has_stripe_ptr
(
k
,
s
->
key
.
k
.
p
.
offset
))
{
bch2_btree_iter_next
(
iter
);
continue
;
}
idx
=
extent_matches_stripe
(
c
,
&
s
->
key
.
v
,
k
);
idx
=
extent_matches_stripe
(
c
,
&
s
->
key
.
v
,
k
);
if
(
idx
<
0
)
{
if
(
idx
<
0
)
{
bch2_btree_iter_next
(
iter
);
bch2_btree_iter_next
(
iter
);
continue
;
continue
;
}
}
bch2_btree_iter_set_pos
(
iter
,
bkey_start_pos
(
k
.
k
));
dev
=
s
->
key
.
v
.
ptrs
[
idx
].
dev
;
dev
=
s
->
key
.
v
.
ptrs
[
idx
].
dev
;
bkey_reassemble
(
&
tmp
.
k
,
k
);
bkey_reassemble
(
&
tmp
.
k
,
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