lkml.org 
[lkml]   [2021]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/13] xfs: convert xfs_errortag attrs to use ->seq_show
Date
Trivial conversion to the seq_file based sysfs attributes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
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
\
 
 \ /
  Last update: 2021-09-13 07:59    [W:0.122 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site