diff options
author | Chao Yu | 2020-11-27 21:20:06 +0800 |
---|---|---|
committer | Jaegeuk Kim | 2020-12-02 22:00:22 -0800 |
commit | 3a0a9cbc44bbb8a23a3fc12edfd1834452360a50 (patch) | |
tree | 659f3cf7f5c0a1f69eda2a8b44e5f084f56f4cf8 /fs/f2fs/sysfs.c | |
parent | b28f047b28c51d0b9864c34b097bb0b221ea7247 (diff) |
f2fs: fix kbytes written stat for multi-device case
For multi-device case, one f2fs image includes multi devices, so it
needs to account bytes written of all block devices belong to the image
rather than one main block device, fix it.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/sysfs.c')
-rw-r--r-- | fs/f2fs/sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index ec77ccfea923..fce2997382af 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -97,7 +97,8 @@ static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a, return sprintf(buf, "%llu\n", (unsigned long long)(sbi->kbytes_written + - BD_PART_WRITTEN(sbi))); + ((f2fs_get_sectors_written(sbi) - + sbi->sectors_written_start) >> 1))); } static ssize_t features_show(struct f2fs_attr *a, |