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
57af63b2
Commit
57af63b2
authored
Dec 25, 2021
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_alloc_sectors_append_ptrs() now takes cached flag
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
04f0f77d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
14 deletions
+12
-14
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_foreground.c
+8
-6
fs/bcachefs/alloc_foreground.h
fs/bcachefs/alloc_foreground.h
+1
-1
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+1
-1
fs/bcachefs/io.c
fs/bcachefs/io.c
+2
-6
No files found.
fs/bcachefs/alloc_foreground.c
View file @
57af63b2
...
...
@@ -866,7 +866,8 @@ struct write_point *bch2_alloc_sectors_start(struct bch_fs *c,
* as allocated out of @ob
*/
void
bch2_alloc_sectors_append_ptrs
(
struct
bch_fs
*
c
,
struct
write_point
*
wp
,
struct
bkey_i
*
k
,
unsigned
sectors
)
struct
bkey_i
*
k
,
unsigned
sectors
,
bool
cached
)
{
struct
open_bucket
*
ob
;
...
...
@@ -877,13 +878,14 @@ void bch2_alloc_sectors_append_ptrs(struct bch_fs *c, struct write_point *wp,
open_bucket_for_each
(
c
,
&
wp
->
ptrs
,
ob
,
i
)
{
struct
bch_dev
*
ca
=
bch_dev_bkey_exists
(
c
,
ob
->
ptr
.
dev
);
struct
bch_extent_ptr
tmp
=
ob
->
ptr
;
struct
bch_extent_ptr
ptr
=
ob
->
ptr
;
tmp
.
cached
=
!
ca
->
mi
.
durability
&&
wp
->
type
==
BCH_DATA_user
;
ptr
.
cached
=
cached
||
(
!
ca
->
mi
.
durability
&&
wp
->
type
==
BCH_DATA_user
);
tmp
.
offset
+=
ca
->
mi
.
bucket_size
-
ob
->
sectors_free
;
bch2_bkey_append_ptr
(
k
,
tmp
);
ptr
.
offset
+=
ca
->
mi
.
bucket_size
-
ob
->
sectors_free
;
bch2_bkey_append_ptr
(
k
,
ptr
);
BUG_ON
(
sectors
>
ob
->
sectors_free
);
ob
->
sectors_free
-=
sectors
;
...
...
fs/bcachefs/alloc_foreground.h
View file @
57af63b2
...
...
@@ -106,7 +106,7 @@ struct write_point *bch2_alloc_sectors_start(struct bch_fs *,
struct
closure
*
);
void
bch2_alloc_sectors_append_ptrs
(
struct
bch_fs
*
,
struct
write_point
*
,
struct
bkey_i
*
,
unsigned
);
struct
bkey_i
*
,
unsigned
,
bool
);
void
bch2_alloc_sectors_done
(
struct
bch_fs
*
,
struct
write_point
*
);
void
bch2_open_buckets_stop_dev
(
struct
bch_fs
*
,
struct
bch_dev
*
,
...
...
fs/bcachefs/btree_update_interior.c
View file @
57af63b2
...
...
@@ -236,7 +236,7 @@ static struct btree *__bch2_btree_node_alloc(struct bch_fs *c,
}
bkey_btree_ptr_v2_init
(
&
tmp
.
k
);
bch2_alloc_sectors_append_ptrs
(
c
,
wp
,
&
tmp
.
k
,
btree_sectors
(
c
));
bch2_alloc_sectors_append_ptrs
(
c
,
wp
,
&
tmp
.
k
,
btree_sectors
(
c
)
,
false
);
bch2_open_bucket_get
(
c
,
wp
,
&
ob
);
bch2_alloc_sectors_done
(
c
,
wp
);
...
...
fs/bcachefs/io.c
View file @
57af63b2
...
...
@@ -746,7 +746,6 @@ static void init_append_extent(struct bch_write_op *op,
struct
bch_extent_crc_unpacked
crc
)
{
struct
bkey_i_extent
*
e
;
struct
bch_extent_ptr
*
ptr
;
op
->
pos
.
offset
+=
crc
.
uncompressed_size
;
...
...
@@ -760,11 +759,8 @@ static void init_append_extent(struct bch_write_op *op,
crc
.
nonce
)
bch2_extent_crc_append
(
&
e
->
k_i
,
crc
);
bch2_alloc_sectors_append_ptrs
(
op
->
c
,
wp
,
&
e
->
k_i
,
crc
.
compressed_size
);
if
(
op
->
flags
&
BCH_WRITE_CACHED
)
extent_for_each_ptr
(
extent_i_to_s
(
e
),
ptr
)
ptr
->
cached
=
true
;
bch2_alloc_sectors_append_ptrs
(
op
->
c
,
wp
,
&
e
->
k_i
,
crc
.
compressed_size
,
op
->
flags
&
BCH_WRITE_CACHED
);
bch2_keylist_push
(
&
op
->
insert_keys
);
}
...
...
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