Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
f2fs: expose # of overprivision segments
Browse files Browse the repository at this point in the history
This is useful when checking conditions during checkpoint=disable in Android.

Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Change-Id: Id6232d1095d4cddd69e7274b19859081f78fae68
  • Loading branch information
Jaegeuk Kim authored and reocat committed Jan 5, 2024
1 parent ef4e822 commit a2c6648
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Documentation/ABI/testing/sysfs-fs-f2fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ Description: Give a way to change checkpoint merge daemon's io priority.
and set the I/O priority within valid range of it. "," delimiter
is necessary in between I/O class and priority number.

What: /sys/fs/f2fs/<disk>/ovp_segments
Date: March 2021
Contact: "Jaegeuk Kim" <[email protected]>
Description: Shows the number of overprovision segments.

What: /sys/fs/f2fs/<disk>/atgc_candidate_ratio
Date: May 2021
Contact: "Chao Yu" <[email protected]>
Expand Down
9 changes: 9 additions & 0 deletions fs/f2fs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ static ssize_t reserved_segments_show(struct f2fs_attr *a,
(unsigned long long)(reserved_segments(sbi)));
}

static ssize_t ovp_segments_show(struct f2fs_attr *a,
struct f2fs_sb_info *sbi, char *buf)
{
return sprintf(buf, "%llu\n",
(unsigned long long)(overprovision_segments(sbi)));
}

static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a,
struct f2fs_sb_info *sbi, char *buf)
{
Expand Down Expand Up @@ -682,6 +689,7 @@ F2FS_RW_ATTR(CPRC_INFO, ckpt_req_control, ckpt_thread_ioprio, ckpt_thread_ioprio
F2FS_GENERAL_RO_ATTR(dirty_segments);
F2FS_GENERAL_RO_ATTR(free_segments);
F2FS_GENERAL_RO_ATTR(reserved_segments);
F2FS_GENERAL_RO_ATTR(ovp_segments);
F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes);
F2FS_GENERAL_RO_ATTR(features);
F2FS_GENERAL_RO_ATTR(current_reserved_blocks);
Expand Down Expand Up @@ -775,6 +783,7 @@ static struct attribute *f2fs_attrs[] = {
ATTR_LIST(dirty_segments),
ATTR_LIST(free_segments),
ATTR_LIST(reserved_segments),
ATTR_LIST(ovp_segments),
ATTR_LIST(unusable),
ATTR_LIST(lifetime_write_kbytes),
ATTR_LIST(features),
Expand Down

0 comments on commit a2c6648

Please sign in to comment.