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
81c771b2
Commit
81c771b2
authored
Mar 08, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Improve bch2_new_stripes_to_text()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
8fcdf814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
fs/bcachefs/ec.c
fs/bcachefs/ec.c
+10
-8
No files found.
fs/bcachefs/ec.c
View file @
81c771b2
...
...
@@ -1145,6 +1145,10 @@ static void ec_stripe_create(struct ec_stripe_new *s)
}
}
mutex_lock
(
&
c
->
ec_stripe_new_lock
);
list_del
(
&
s
->
list
);
mutex_unlock
(
&
c
->
ec_stripe_new_lock
);
if
(
s
->
idx
)
bch2_stripe_close
(
c
,
s
);
...
...
@@ -1160,10 +1164,8 @@ static struct ec_stripe_new *get_pending_stripe(struct bch_fs *c)
mutex_lock
(
&
c
->
ec_stripe_new_lock
);
list_for_each_entry
(
s
,
&
c
->
ec_stripe_new_list
,
list
)
if
(
!
atomic_read
(
&
s
->
pin
))
{
list_del
(
&
s
->
list
);
if
(
!
atomic_read
(
&
s
->
pin
))
goto
out
;
}
s
=
NULL
;
out:
mutex_unlock
(
&
c
->
ec_stripe_new_lock
);
...
...
@@ -1855,8 +1857,8 @@ void bch2_new_stripes_to_text(struct printbuf *out, struct bch_fs *c)
h
->
target
,
h
->
algo
,
h
->
redundancy
);
if
(
h
->
s
)
prt_printf
(
out
,
"
\t
pending: blocks %u+%u allocated %u
\n
"
,
h
->
s
->
nr_data
,
h
->
s
->
nr_parity
,
prt_printf
(
out
,
"
\t
pending:
idx %llu
blocks %u+%u allocated %u
\n
"
,
h
->
s
->
idx
,
h
->
s
->
nr_data
,
h
->
s
->
nr_parity
,
bitmap_weight
(
h
->
s
->
blocks_allocated
,
h
->
s
->
nr_data
));
}
...
...
@@ -1864,9 +1866,9 @@ void bch2_new_stripes_to_text(struct printbuf *out, struct bch_fs *c)
mutex_lock
(
&
c
->
ec_stripe_new_lock
);
list_for_each_entry
(
s
,
&
c
->
ec_stripe_new_list
,
list
)
{
prt_printf
(
out
,
"
\t
in flight: blocks %u+%u pin %u
\n
"
,
s
->
nr_data
,
s
->
nr_parity
,
atomic_read
(
&
s
->
pin
));
prt_printf
(
out
,
"
\t
in flight:
idx %llu
blocks %u+%u pin %u
\n
"
,
s
->
idx
,
s
->
nr_data
,
s
->
nr_parity
,
atomic_read
(
&
s
->
pin
));
}
mutex_unlock
(
&
c
->
ec_stripe_new_lock
);
}
...
...
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