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
1df42b57
Commit
1df42b57
authored
6 years ago
by
Kent Overstreet
Committed by
Kent Overstreet
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: don't do initial gc if have alloc info feature
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
3577df5f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
+25
-11
fs/bcachefs/bcachefs.h
fs/bcachefs/bcachefs.h
+1
-0
fs/bcachefs/bcachefs_format.h
fs/bcachefs/bcachefs_format.h
+4
-0
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_gc.c
+2
-4
fs/bcachefs/recovery.c
fs/bcachefs/recovery.c
+12
-6
fs/bcachefs/super-io.c
fs/bcachefs/super-io.c
+6
-1
No files found.
fs/bcachefs/bcachefs.h
View file @
1df42b57
...
@@ -568,6 +568,7 @@ struct bch_fs {
...
@@ -568,6 +568,7 @@ struct bch_fs {
u32
time_base_hi
;
u32
time_base_hi
;
u32
time_precision
;
u32
time_precision
;
u64
features
;
u64
features
;
u64
compat
;
}
sb
;
}
sb
;
struct
bch_sb_handle
disk_sb
;
struct
bch_sb_handle
disk_sb
;
...
...
This diff is collapsed.
Click to expand it.
fs/bcachefs/bcachefs_format.h
View file @
1df42b57
...
@@ -1279,6 +1279,10 @@ enum bch_sb_features {
...
@@ -1279,6 +1279,10 @@ enum bch_sb_features {
BCH_FEATURE_NR
,
BCH_FEATURE_NR
,
};
};
enum
bch_sb_compat
{
BCH_COMPAT_FEAT_ALLOC_INFO
=
0
,
};
/* options: */
/* options: */
#define BCH_REPLICAS_MAX 4U
#define BCH_REPLICAS_MAX 4U
...
...
This diff is collapsed.
Click to expand it.
fs/bcachefs/btree_gc.c
View file @
1df42b57
...
@@ -577,7 +577,8 @@ static void bch2_gc_done(struct bch_fs *c, bool initial)
...
@@ -577,7 +577,8 @@ static void bch2_gc_done(struct bch_fs *c, bool initial)
percpu_down_write
(
&
c
->
mark_lock
);
percpu_down_write
(
&
c
->
mark_lock
);
if
(
initial
)
{
if
(
initial
&&
!
(
c
->
sb
.
compat
&
(
1ULL
<<
BCH_COMPAT_FEAT_ALLOC_INFO
)))
{
bch2_gc_done_nocheck
(
c
);
bch2_gc_done_nocheck
(
c
);
goto
out
;
goto
out
;
}
}
...
@@ -819,9 +820,6 @@ int bch2_gc(struct bch_fs *c, struct list_head *journal, bool initial)
...
@@ -819,9 +820,6 @@ int bch2_gc(struct bch_fs *c, struct list_head *journal, bool initial)
bch2_gc_free
(
c
);
bch2_gc_free
(
c
);
up_write
(
&
c
->
gc_lock
);
up_write
(
&
c
->
gc_lock
);
if
(
!
ret
&&
initial
)
set_bit
(
BCH_FS_INITIAL_GC_DONE
,
&
c
->
flags
);
trace_gc_end
(
c
);
trace_gc_end
(
c
);
bch2_time_stats_update
(
&
c
->
times
[
BCH_TIME_btree_gc
],
start_time
);
bch2_time_stats_update
(
&
c
->
times
[
BCH_TIME_btree_gc
],
start_time
);
...
...
This diff is collapsed.
Click to expand it.
fs/bcachefs/recovery.c
View file @
1df42b57
...
@@ -300,14 +300,18 @@ int bch2_fs_recovery(struct bch_fs *c)
...
@@ -300,14 +300,18 @@ int bch2_fs_recovery(struct bch_fs *c)
set_bit
(
BCH_FS_ALLOC_READ_DONE
,
&
c
->
flags
);
set_bit
(
BCH_FS_ALLOC_READ_DONE
,
&
c
->
flags
);
bch_verbose
(
c
,
"starting mark and sweep:"
);
if
(
!
(
c
->
sb
.
compat
&
(
1ULL
<<
BCH_COMPAT_FEAT_ALLOC_INFO
))
||
err
=
"error in recovery"
;
c
->
opts
.
fsck
)
{
ret
=
bch2_gc
(
c
,
&
journal
,
true
);
bch_verbose
(
c
,
"starting mark and sweep:"
);
if
(
ret
)
err
=
"error in recovery"
;
goto
err
;
ret
=
bch2_gc
(
c
,
&
journal
,
true
);
bch_verbose
(
c
,
"mark and sweep done"
);
if
(
ret
)
goto
err
;
bch_verbose
(
c
,
"mark and sweep done"
);
}
clear_bit
(
BCH_FS_REBUILD_REPLICAS
,
&
c
->
flags
);
clear_bit
(
BCH_FS_REBUILD_REPLICAS
,
&
c
->
flags
);
set_bit
(
BCH_FS_INITIAL_GC_DONE
,
&
c
->
flags
);
/*
/*
* Skip past versions that might have possibly been used (as nonces),
* Skip past versions that might have possibly been used (as nonces),
...
@@ -411,6 +415,8 @@ int bch2_fs_initialize(struct bch_fs *c)
...
@@ -411,6 +415,8 @@ int bch2_fs_initialize(struct bch_fs *c)
if
(
ret
)
if
(
ret
)
goto
err
;
goto
err
;
set_bit
(
BCH_FS_INITIAL_GC_DONE
,
&
c
->
flags
);
err
=
"unable to allocate journal buckets"
;
err
=
"unable to allocate journal buckets"
;
for_each_online_member
(
ca
,
c
,
i
)
for_each_online_member
(
ca
,
c
,
i
)
if
(
bch2_dev_journal_alloc
(
ca
))
{
if
(
bch2_dev_journal_alloc
(
ca
))
{
...
...
This diff is collapsed.
Click to expand it.
fs/bcachefs/super-io.c
View file @
1df42b57
...
@@ -371,6 +371,7 @@ static void bch2_sb_update(struct bch_fs *c)
...
@@ -371,6 +371,7 @@ static void bch2_sb_update(struct bch_fs *c)
c
->
sb
.
time_base_hi
=
le32_to_cpu
(
src
->
time_base_hi
);
c
->
sb
.
time_base_hi
=
le32_to_cpu
(
src
->
time_base_hi
);
c
->
sb
.
time_precision
=
le32_to_cpu
(
src
->
time_precision
);
c
->
sb
.
time_precision
=
le32_to_cpu
(
src
->
time_precision
);
c
->
sb
.
features
=
le64_to_cpu
(
src
->
features
[
0
]);
c
->
sb
.
features
=
le64_to_cpu
(
src
->
features
[
0
]);
c
->
sb
.
compat
=
le64_to_cpu
(
src
->
compat
[
0
]);
for_each_member_device
(
ca
,
c
,
i
)
for_each_member_device
(
ca
,
c
,
i
)
ca
->
mi
=
bch2_mi_to_cpu
(
mi
->
members
+
i
);
ca
->
mi
=
bch2_mi_to_cpu
(
mi
->
members
+
i
);
...
@@ -888,8 +889,10 @@ void bch2_sb_clean_renumber(struct bch_sb_field_clean *clean, int write)
...
@@ -888,8 +889,10 @@ void bch2_sb_clean_renumber(struct bch_sb_field_clean *clean, int write)
static
void
bch2_fs_mark_dirty
(
struct
bch_fs
*
c
)
static
void
bch2_fs_mark_dirty
(
struct
bch_fs
*
c
)
{
{
mutex_lock
(
&
c
->
sb_lock
);
mutex_lock
(
&
c
->
sb_lock
);
if
(
BCH_SB_CLEAN
(
c
->
disk_sb
.
sb
))
{
if
(
BCH_SB_CLEAN
(
c
->
disk_sb
.
sb
)
||
(
c
->
disk_sb
.
sb
->
compat
[
0
]
&
(
1ULL
<<
BCH_COMPAT_FEAT_ALLOC_INFO
)))
{
SET_BCH_SB_CLEAN
(
c
->
disk_sb
.
sb
,
false
);
SET_BCH_SB_CLEAN
(
c
->
disk_sb
.
sb
,
false
);
c
->
disk_sb
.
sb
->
compat
[
0
]
&=
~
(
1ULL
<<
BCH_COMPAT_FEAT_ALLOC_INFO
);
bch2_write_super
(
c
);
bch2_write_super
(
c
);
}
}
mutex_unlock
(
&
c
->
sb_lock
);
mutex_unlock
(
&
c
->
sb_lock
);
...
@@ -1011,6 +1014,8 @@ void bch2_fs_mark_clean(struct bch_fs *c, bool clean)
...
@@ -1011,6 +1014,8 @@ void bch2_fs_mark_clean(struct bch_fs *c, bool clean)
SET_BCH_SB_CLEAN
(
c
->
disk_sb
.
sb
,
true
);
SET_BCH_SB_CLEAN
(
c
->
disk_sb
.
sb
,
true
);
c
->
disk_sb
.
sb
->
compat
[
0
]
|=
1ULL
<<
BCH_COMPAT_FEAT_ALLOC_INFO
;
u64s
=
sizeof
(
*
sb_clean
)
/
sizeof
(
u64
)
+
c
->
journal
.
entry_u64s_reserved
;
u64s
=
sizeof
(
*
sb_clean
)
/
sizeof
(
u64
)
+
c
->
journal
.
entry_u64s_reserved
;
sb_clean
=
bch2_sb_resize_clean
(
&
c
->
disk_sb
,
u64s
);
sb_clean
=
bch2_sb_resize_clean
(
&
c
->
disk_sb
,
u64s
);
...
...
This diff is collapsed.
Click to expand it.
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