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
6675c376
Commit
6675c376
authored
Feb 12, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch_acct_snapshot
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
72c27787
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+10
-0
fs/bcachefs/disk_accounting.c
fs/bcachefs/disk_accounting.c
+3
-0
fs/bcachefs/disk_accounting_format.h
fs/bcachefs/disk_accounting_format.h
+7
-1
No files found.
fs/bcachefs/buckets.c
View file @
6675c376
...
@@ -778,6 +778,16 @@ static int __trigger_extent(struct btree_trans *trans,
...
@@ -778,6 +778,16 @@ static int __trigger_extent(struct btree_trans *trans,
return
ret
;
return
ret
;
}
}
if
(
acc_replicas_key
.
replicas
.
nr_devs
&&
!
level
&&
k
.
k
->
p
.
snapshot
)
{
struct
disk_accounting_pos
acc_snapshot_key
=
{
.
type
=
BCH_DISK_ACCOUNTING_snapshot
,
.
snapshot
.
id
=
k
.
k
->
p
.
snapshot
,
};
ret
=
bch2_disk_accounting_mod
(
trans
,
&
acc_snapshot_key
,
&
replicas_sectors
,
1
,
gc
);
if
(
ret
)
return
ret
;
}
if
(
acct_compression_key
.
compression
.
type
)
{
if
(
acct_compression_key
.
compression
.
type
)
{
if
(
flags
&
BTREE_TRIGGER_overwrite
)
if
(
flags
&
BTREE_TRIGGER_overwrite
)
bch2_u64s_neg
(
compression_acct
,
ARRAY_SIZE
(
compression_acct
));
bch2_u64s_neg
(
compression_acct
,
ARRAY_SIZE
(
compression_acct
));
...
...
fs/bcachefs/disk_accounting.c
View file @
6675c376
...
@@ -146,6 +146,9 @@ void bch2_accounting_key_to_text(struct printbuf *out, struct disk_accounting_po
...
@@ -146,6 +146,9 @@ void bch2_accounting_key_to_text(struct printbuf *out, struct disk_accounting_po
case
BCH_DISK_ACCOUNTING_compression
:
case
BCH_DISK_ACCOUNTING_compression
:
bch2_prt_compression_type
(
out
,
k
->
compression
.
type
);
bch2_prt_compression_type
(
out
,
k
->
compression
.
type
);
break
;
break
;
case
BCH_DISK_ACCOUNTING_snapshot
:
prt_printf
(
out
,
"id=%u"
,
k
->
snapshot
.
id
);
break
;
}
}
}
}
...
...
fs/bcachefs/disk_accounting_format.h
View file @
6675c376
...
@@ -100,7 +100,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type)
...
@@ -100,7 +100,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type)
x(persistent_reserved, 1) \
x(persistent_reserved, 1) \
x(replicas, 2) \
x(replicas, 2) \
x(dev_data_type, 3) \
x(dev_data_type, 3) \
x(compression, 4)
x(compression, 4) \
x(snapshot, 5)
enum
disk_accounting_type
{
enum
disk_accounting_type
{
#define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr,
#define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr,
...
@@ -129,6 +130,10 @@ struct bch_acct_compression {
...
@@ -129,6 +130,10 @@ struct bch_acct_compression {
__u8
type
;
__u8
type
;
};
};
struct
bch_acct_snapshot
{
__u32
id
;
};
struct
disk_accounting_pos
{
struct
disk_accounting_pos
{
union
{
union
{
struct
{
struct
{
...
@@ -140,6 +145,7 @@ struct disk_accounting_pos {
...
@@ -140,6 +145,7 @@ struct disk_accounting_pos {
struct
bch_dev_data_type
dev_data_type
;
struct
bch_dev_data_type
dev_data_type
;
struct
bch_dev_stripe_buckets
dev_stripe_buckets
;
struct
bch_dev_stripe_buckets
dev_stripe_buckets
;
struct
bch_acct_compression
compression
;
struct
bch_acct_compression
compression
;
struct
bch_acct_snapshot
snapshot
;
};
};
};
};
struct
bpos
_pad
;
struct
bpos
_pad
;
...
...
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