f2fs: include non-compressed blocks in compr_written_block
Need to include non-compressed blocks in compr_written_block to
estimate average compression ratio more accurately.
Fixes: 5ac443e26a09 ("f2fs: add sysfs nodes to get runtime compression stat")
Cc: stable@vger.kernel.org
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -1501,6 +1501,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
|
|||||||
if (cluster_may_compress(cc)) {
|
if (cluster_may_compress(cc)) {
|
||||||
err = f2fs_compress_pages(cc);
|
err = f2fs_compress_pages(cc);
|
||||||
if (err == -EAGAIN) {
|
if (err == -EAGAIN) {
|
||||||
|
add_compr_block_stat(cc->inode, cc->cluster_size);
|
||||||
goto write;
|
goto write;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
f2fs_put_rpages_wbc(cc, wbc, true, 1);
|
f2fs_put_rpages_wbc(cc, wbc, true, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user