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
77d63522
Commit
77d63522
authored
Oct 19, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Make replicas_delta_list smaller
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
fbc519ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/btree_update_leaf.c
+4
-2
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+11
-7
fs/bcachefs/buckets_types.h
fs/bcachefs/buckets_types.h
+5
-1
No files found.
fs/bcachefs/btree_update_leaf.c
View file @
77d63522
...
...
@@ -587,9 +587,11 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
bch2_journal_res_put
(
&
c
->
journal
,
&
trans
->
journal_res
);
out_clear_replicas:
if
(
trans
->
fs_usage_deltas
)
{
memset
(
&
trans
->
fs_usage_deltas
->
fs_usage
,
0
,
sizeof
(
trans
->
fs_usage_deltas
->
fs_usage
));
trans
->
fs_usage_deltas
->
used
=
0
;
memset
((
void
*
)
trans
->
fs_usage_deltas
+
offsetof
(
struct
replicas_delta_list
,
memset_start
),
0
,
(
void
*
)
&
trans
->
fs_usage_deltas
->
memset_end
-
(
void
*
)
&
trans
->
fs_usage_deltas
->
memset_start
);
}
return
ret
;
...
...
fs/bcachefs/buckets.c
View file @
77d63522
...
...
@@ -585,9 +585,14 @@ void bch2_replicas_delta_list_apply(struct bch_fs *c,
{
struct
replicas_delta
*
d
=
r
->
d
;
struct
replicas_delta
*
top
=
(
void
*
)
r
->
d
+
r
->
used
;
unsigned
i
;
fs_usage
->
nr_inodes
+=
r
->
nr_inodes
;
acc_u64s
((
u64
*
)
fs_usage
,
(
u64
*
)
&
r
->
fs_usage
,
sizeof
(
*
fs_usage
)
/
sizeof
(
u64
));
for
(
i
=
0
;
i
<
BCH_REPLICAS_MAX
;
i
++
)
{
fs_usage
->
reserved
+=
r
->
persistent_reserved
[
i
];
fs_usage
->
persistent_reserved
[
i
]
+=
r
->
persistent_reserved
[
i
];
}
while
(
d
!=
top
)
{
BUG_ON
((
void
*
)
d
>
(
void
*
)
top
);
...
...
@@ -1739,9 +1744,9 @@ int bch2_trans_mark_key(struct btree_trans *trans, struct bkey_s_c k,
d
=
replicas_deltas_realloc
(
trans
,
0
);
if
(
!
(
flags
&
BCH_BUCKET_MARK_OVERWRITE
))
d
->
fs_usage
.
nr_inodes
++
;
d
->
nr_inodes
++
;
else
d
->
fs_usage
.
nr_inodes
--
;
d
->
nr_inodes
--
;
return
0
;
case
KEY_TYPE_reservation
:
{
unsigned
replicas
=
bkey_s_c_to_reservation
(
k
).
v
->
nr_replicas
;
...
...
@@ -1750,10 +1755,9 @@ int bch2_trans_mark_key(struct btree_trans *trans, struct bkey_s_c k,
sectors
*=
replicas
;
replicas
=
clamp_t
(
unsigned
,
replicas
,
1
,
ARRAY_SIZE
(
d
->
fs_usage
.
persistent_reserved
));
ARRAY_SIZE
(
d
->
persistent_reserved
));
d
->
fs_usage
.
reserved
+=
sectors
;
d
->
fs_usage
.
persistent_reserved
[
replicas
-
1
]
+=
sectors
;
d
->
persistent_reserved
[
replicas
-
1
]
+=
sectors
;
return
0
;
}
case
KEY_TYPE_reflink_p
:
...
...
fs/bcachefs/buckets_types.h
View file @
77d63522
...
...
@@ -100,7 +100,11 @@ struct replicas_delta {
struct
replicas_delta_list
{
unsigned
size
;
unsigned
used
;
struct
bch_fs_usage
fs_usage
;
struct
{}
memset_start
;
u64
nr_inodes
;
u64
persistent_reserved
[
BCH_REPLICAS_MAX
];
struct
{}
memset_end
;
struct
replicas_delta
d
[
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