linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Daeho Jeong <daeho43@gmail.com>
To: linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Subject: [f2fs-dev] [PATCH] f2fs: add compr_inode and compr_blocks sysfs nodes
Date: Fri, 16 Oct 2020 14:14:55 +0900	[thread overview]
Message-ID: <20201016051455.1913795-1-daeho43@gmail.com> (raw)

From: Daeho Jeong <daehojeong@google.com>

Added compr_inode to show compressed inode count and compr_blocks to
show compressed block count in sysfs.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
 Documentation/ABI/testing/sysfs-fs-f2fs | 10 ++++++++++
 fs/f2fs/sysfs.c                         | 17 +++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index 834d0becae6d..a01c26484c69 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -350,3 +350,13 @@ Date:		April 2020
 Contact:	"Daeho Jeong" <daehojeong@google.com>
 Description:	Give a way to change iostat_period time. 3secs by default.
 		The new iostat trace gives stats gap given the period.
+
+What:		/sys/fs/f2fs/<disk>/compr_inode
+Date:		October 2020
+Contact:	"Daeho Jeong" <daehojeong@google.com>
+Description:	Show compressed inode count
+
+What:		/sys/fs/f2fs/<disk>/compr_blocks
+Date:		October 2020
+Contact:	"Daeho Jeong" <daehojeong@google.com>
+Description:	Show compressed block count
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 94c98e412aa1..7139a29a00d3 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -223,6 +223,19 @@ static ssize_t avg_vblocks_show(struct f2fs_attr *a,
 	f2fs_update_sit_info(sbi);
 	return sprintf(buf, "%llu\n", (unsigned long long)(si->avg_vblocks));
 }
+
+static ssize_t compr_inode_show(struct f2fs_attr *a,
+				struct f2fs_sb_info *sbi, char *buf)
+{
+	return sprintf(buf, "%u\n", atomic_read(&sbi->compr_inode));
+}
+
+static ssize_t compr_blocks_show(struct f2fs_attr *a,
+				struct f2fs_sb_info *sbi, char *buf)
+{
+	return sprintf(buf, "%llu\n", atomic64_read(&sbi->compr_blocks));
+}
+
 #endif
 
 static ssize_t main_blkaddr_show(struct f2fs_attr *a,
@@ -591,6 +604,8 @@ F2FS_STAT_ATTR(STAT_INFO, f2fs_stat_info, gc_background_calls, bg_gc);
 F2FS_GENERAL_RO_ATTR(moved_blocks_background);
 F2FS_GENERAL_RO_ATTR(moved_blocks_foreground);
 F2FS_GENERAL_RO_ATTR(avg_vblocks);
+F2FS_GENERAL_RO_ATTR(compr_inode);
+F2FS_GENERAL_RO_ATTR(compr_blocks);
 #endif
 
 #ifdef CONFIG_FS_ENCRYPTION
@@ -675,6 +690,8 @@ static struct attribute *f2fs_attrs[] = {
 	ATTR_LIST(moved_blocks_foreground),
 	ATTR_LIST(moved_blocks_background),
 	ATTR_LIST(avg_vblocks),
+	ATTR_LIST(compr_inode),
+	ATTR_LIST(compr_blocks),
 #endif
 	NULL,
 };
-- 
2.29.0.rc1.297.gfa9743e501-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2020-10-16  5:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16  5:14 Daeho Jeong [this message]
2020-10-21  4:36 ` [f2fs-dev] [PATCH] f2fs: add compr_inode and compr_blocks sysfs nodes Eric Biggers
2020-10-21  4:55   ` Daeho Jeong
2020-10-21  6:08 ` Chao Yu
2020-10-22  2:53   ` Daeho Jeong
2020-11-27  9:44     ` Chao Yu
2020-11-30  2:02       ` Daeho Jeong
2020-11-30  2:05         ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201016051455.1913795-1-daeho43@gmail.com \
    --to=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).