[PATCH 12/13] xfs: convert xfs_errortag attrs to use ->seq_show
From: Christoph Hellwig
Date: Mon Sep 13 2021 - 01:58:41 EST
Trivial conversion to the seq_file based sysfs attributes.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
fs/xfs/xfs_error.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index 81c445e9489bd..143a1e0b12ffe 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -104,22 +104,22 @@ xfs_errortag_attr_store(
return count;
}
-STATIC ssize_t
-xfs_errortag_attr_show(
+STATIC int
+xfs_errortag_attr_seq_show(
struct kobject *kobject,
struct attribute *attr,
- char *buf)
+ struct seq_file *sf)
{
struct xfs_mount *mp = to_mp(kobject);
struct xfs_errortag_attr *xfs_attr = to_attr(attr);
- return snprintf(buf, PAGE_SIZE, "%u\n",
- xfs_errortag_get(mp, xfs_attr->tag));
+ seq_printf(sf, "%u\n", xfs_errortag_get(mp, xfs_attr->tag));
+ return 0;
}
static const struct sysfs_ops xfs_errortag_sysfs_ops = {
- .show = xfs_errortag_attr_show,
- .store = xfs_errortag_attr_store,
+ .seq_show = xfs_errortag_attr_seq_show,
+ .store = xfs_errortag_attr_store,
};
#define XFS_ERRORTAG_ATTR_RW(_name, _tag) \
--
2.30.2