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
c85d7796
Commit
c85d7796
authored
Mar 01, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_copygc_wait_to_text()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
2611a041
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
fs/bcachefs/movinggc.c
fs/bcachefs/movinggc.c
+12
-0
fs/bcachefs/movinggc.h
fs/bcachefs/movinggc.h
+2
-0
fs/bcachefs/sysfs.c
fs/bcachefs/sysfs.c
+4
-3
No files found.
fs/bcachefs/movinggc.c
View file @
c85d7796
...
...
@@ -172,6 +172,18 @@ unsigned long bch2_copygc_wait_amount(struct bch_fs *c)
return
wait
;
}
void
bch2_copygc_wait_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
)
{
prt_printf
(
out
,
"Currently waiting for: "
);
prt_human_readable_u64
(
out
,
max
(
0LL
,
c
->
copygc_wait
-
atomic64_read
(
&
c
->
io_clock
[
WRITE
].
now
))
<<
9
);
prt_newline
(
out
);
prt_printf
(
out
,
"Currently calculated wait: "
);
prt_human_readable_u64
(
out
,
bch2_copygc_wait_amount
(
c
));
prt_newline
(
out
);
}
static
int
bch2_copygc_thread
(
void
*
arg
)
{
struct
bch_fs
*
c
=
arg
;
...
...
fs/bcachefs/movinggc.h
View file @
c85d7796
...
...
@@ -3,6 +3,8 @@
#define _BCACHEFS_MOVINGGC_H
unsigned
long
bch2_copygc_wait_amount
(
struct
bch_fs
*
);
void
bch2_copygc_wait_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
);
void
bch2_copygc_stop
(
struct
bch_fs
*
);
int
bch2_copygc_start
(
struct
bch_fs
*
);
void
bch2_fs_copygc_init
(
struct
bch_fs
*
);
...
...
fs/bcachefs/sysfs.c
View file @
c85d7796
...
...
@@ -27,6 +27,7 @@
#include "journal.h"
#include "keylist.h"
#include "move.h"
#include "movinggc.h"
#include "nocow_locking.h"
#include "opts.h"
#include "rebalance.h"
...
...
@@ -427,9 +428,9 @@ SHOW(bch2_fs)
sysfs_printf
(
rebalance_enabled
,
"%i"
,
c
->
rebalance
.
enabled
);
sysfs_pd_controller_show
(
rebalance
,
&
c
->
rebalance
.
pd
);
/* XXX */
sysfs_hprint
(
copy_gc_wait
,
max
(
0LL
,
c
->
copygc_wait
-
atomic64_read
(
&
c
->
io_clock
[
WRITE
].
now
))
<<
9
);
if
(
attr
==
&
sysfs_copy_gc_wait
)
bch2_copygc_wait_to_text
(
out
,
c
);
if
(
attr
==
&
sysfs_rebalance_work
)
bch2_rebalance_work_to_text
(
out
,
c
);
...
...
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