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
a7c7a309
Commit
a7c7a309
authored
Jul 24, 2018
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_mark_key() now takes bch_data_type
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
647d7b60
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_gc.c
+5
-3
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+5
-5
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+5
-7
fs/bcachefs/buckets.h
fs/bcachefs/buckets.h
+2
-2
fs/bcachefs/extents.c
fs/bcachefs/extents.c
+1
-1
No files found.
fs/bcachefs/btree_gc.c
View file @
a7c7a309
...
...
@@ -123,13 +123,14 @@ static u8 bch2_gc_mark_key(struct bch_fs *c, enum bkey_type type,
switch
(
type
)
{
case
BKEY_TYPE_BTREE
:
bch2_mark_key
(
c
,
k
,
c
->
opts
.
btree_node_size
,
true
,
pos
,
NULL
,
bch2_mark_key
(
c
,
k
,
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
pos
,
NULL
,
0
,
flags
|
BCH_BUCKET_MARK_MAY_MAKE_UNAVAILABLE
|
BCH_BUCKET_MARK_GC_LOCK_HELD
);
break
;
case
BKEY_TYPE_EXTENTS
:
bch2_mark_key
(
c
,
k
,
k
.
k
->
size
,
false
,
pos
,
NULL
,
bch2_mark_key
(
c
,
k
,
k
.
k
->
size
,
BCH_DATA_USER
,
pos
,
NULL
,
0
,
flags
|
BCH_BUCKET_MARK_MAY_MAKE_UNAVAILABLE
|
BCH_BUCKET_MARK_GC_LOCK_HELD
);
...
...
@@ -398,7 +399,8 @@ static void bch2_mark_pending_btree_node_frees(struct bch_fs *c)
for_each_pending_btree_node_free
(
c
,
as
,
d
)
if
(
d
->
index_update_done
)
bch2_mark_key
(
c
,
bkey_i_to_s_c
(
&
d
->
key
),
c
->
opts
.
btree_node_size
,
true
,
pos
,
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
pos
,
&
stats
,
0
,
BCH_BUCKET_MARK_MAY_MAKE_UNAVAILABLE
|
BCH_BUCKET_MARK_GC_LOCK_HELD
);
...
...
fs/bcachefs/btree_update_interior.c
View file @
a7c7a309
...
...
@@ -211,7 +211,7 @@ static void bch2_btree_node_free_index(struct btree_update *as, struct btree *b,
struct
bch_fs_usage
tmp
=
{
0
};
bch2_mark_key
(
c
,
bkey_i_to_s_c
(
&
d
->
key
),
-
c
->
opts
.
btree_node_size
,
true
,
b
-
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
b
?
gc_pos_btree_node
(
b
)
:
gc_pos_btree_root
(
as
->
btree_id
),
&
tmp
,
0
,
0
);
...
...
@@ -290,7 +290,7 @@ static void bch2_btree_node_free_ondisk(struct bch_fs *c,
BUG_ON
(
!
pending
->
index_update_done
);
bch2_mark_key
(
c
,
bkey_i_to_s_c
(
&
pending
->
key
),
-
c
->
opts
.
btree_node_size
,
true
,
-
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
gc_phase
(
GC_PHASE_PENDING_DELETE
),
&
stats
,
0
,
0
);
/*
...
...
@@ -1098,7 +1098,7 @@ static void bch2_btree_set_root_inmem(struct btree_update *as, struct btree *b)
__bch2_btree_set_root_inmem
(
c
,
b
);
bch2_mark_key
(
c
,
bkey_i_to_s_c
(
&
b
->
key
),
c
->
opts
.
btree_node_size
,
true
,
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
gc_pos_btree_root
(
b
->
btree_id
),
&
stats
,
0
,
0
);
...
...
@@ -1186,7 +1186,7 @@ static void bch2_insert_fixup_btree_ptr(struct btree_update *as, struct btree *b
if
(
bkey_extent_is_data
(
&
insert
->
k
))
bch2_mark_key
(
c
,
bkey_i_to_s_c
(
insert
),
c
->
opts
.
btree_node_size
,
true
,
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
gc_pos_btree_node
(
b
),
&
stats
,
0
,
0
);
while
((
k
=
bch2_btree_node_iter_peek_all
(
node_iter
,
b
))
&&
...
...
@@ -1967,7 +1967,7 @@ static void __bch2_btree_node_update_key(struct bch_fs *c,
bch2_btree_node_lock_write
(
b
,
iter
);
bch2_mark_key
(
c
,
bkey_i_to_s_c
(
&
new_key
->
k_i
),
c
->
opts
.
btree_node_size
,
true
,
c
->
opts
.
btree_node_size
,
BCH_DATA_BTREE
,
gc_pos_btree_root
(
b
->
btree_id
),
&
stats
,
0
,
0
);
bch2_btree_node_free_index
(
as
,
NULL
,
...
...
fs/bcachefs/buckets.c
View file @
a7c7a309
...
...
@@ -512,15 +512,13 @@ static void bch2_mark_pointer(struct bch_fs *c,
struct
bkey_s_c_extent
e
,
const
struct
bch_extent_ptr
*
ptr
,
struct
bch_extent_crc_unpacked
crc
,
s64
sectors
,
enum
s_alloc
type
,
s64
sectors
,
enum
bch_data_type
data_
type
,
struct
bch_fs_usage
*
stats
,
u64
journal_seq
,
unsigned
flags
)
{
struct
bucket_mark
old
,
new
;
struct
bch_dev
*
ca
=
bch_dev_bkey_exists
(
c
,
ptr
->
dev
);
struct
bucket
*
g
=
PTR_BUCKET
(
ca
,
ptr
);
enum
bch_data_type
data_type
=
type
==
S_META
?
BCH_DATA_BTREE
:
BCH_DATA_USER
;
u64
v
;
if
(
crc
.
compression_type
)
{
...
...
@@ -596,7 +594,7 @@ static void bch2_mark_pointer(struct bch_fs *c,
}
void
bch2_mark_key
(
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
s64
sectors
,
bool
metadata
,
s64
sectors
,
enum
bch_data_type
data_type
,
struct
gc_pos
pos
,
struct
bch_fs_usage
*
stats
,
u64
journal_seq
,
unsigned
flags
)
...
...
@@ -643,14 +641,14 @@ void bch2_mark_key(struct bch_fs *c, struct bkey_s_c k,
struct
bkey_s_c_extent
e
=
bkey_s_c_to_extent
(
k
);
const
struct
bch_extent_ptr
*
ptr
;
struct
bch_extent_crc_unpacked
crc
;
enum
s_alloc
type
=
metadata
?
S_META
:
S_DIRTY
;
enum
s_alloc
type
=
data_type
==
BCH_DATA_USER
?
S_DIRTY
:
S_META
;
unsigned
replicas
=
0
;
BUG_ON
(
metadata
&&
bkey_extent_is_cached
(
e
.
k
));
BUG_ON
(
!
sectors
);
extent_for_each_ptr_crc
(
e
,
ptr
,
crc
)
{
bch2_mark_pointer
(
c
,
e
,
ptr
,
crc
,
sectors
,
type
,
bch2_mark_pointer
(
c
,
e
,
ptr
,
crc
,
sectors
,
data_
type
,
stats
,
journal_seq
,
flags
);
replicas
+=
!
ptr
->
cached
;
}
...
...
fs/bcachefs/buckets.h
View file @
a7c7a309
...
...
@@ -218,8 +218,8 @@ void bch2_mark_metadata_bucket(struct bch_fs *, struct bch_dev *,
#define BCH_BUCKET_MARK_GC_WILL_VISIT (1 << 2)
#define BCH_BUCKET_MARK_GC_LOCK_HELD (1 << 3)
void
bch2_mark_key
(
struct
bch_fs
*
,
struct
bkey_s_c
,
s64
,
bool
,
struct
gc_pos
,
struct
bch_fs_usage
*
,
u64
,
unsigned
);
void
bch2_mark_key
(
struct
bch_fs
*
,
struct
bkey_s_c
,
s64
,
enum
bch_data_type
,
struct
gc_pos
,
struct
bch_fs_usage
*
,
u64
,
unsigned
);
void
bch2_recalc_sectors_available
(
struct
bch_fs
*
);
...
...
fs/bcachefs/extents.c
View file @
a7c7a309
...
...
@@ -1071,7 +1071,7 @@ static void bch2_add_sectors(struct extent_insert_state *s,
if
(
!
sectors
)
return
;
bch2_mark_key
(
c
,
k
,
sectors
,
false
,
gc_pos_btree_node
(
b
),
bch2_mark_key
(
c
,
k
,
sectors
,
BCH_DATA_USER
,
gc_pos_btree_node
(
b
),
&
s
->
stats
,
s
->
trans
->
journal_res
.
seq
,
0
);
}
...
...
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