* [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs
@ 2022-09-15 2:34 Liu Shixin
2022-09-20 7:41 ` Christoph Hellwig
2022-09-22 1:49 ` Jens Axboe
0 siblings, 2 replies; 4+ messages in thread
From: Liu Shixin @ 2022-09-15 2:34 UTC (permalink / raw)
To: Justin Sanders, Jens Axboe; +Cc: linux-block, Liu Shixin
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/block/aoe/aoeblk.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 12b3ca8f6f4a..128722cf6c3c 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -108,7 +108,7 @@ static ssize_t aoedisk_show_payload(struct device *dev,
return sysfs_emit(page, "%lu\n", d->maxbcnt);
}
-static int aoedisk_debugfs_show(struct seq_file *s, void *ignored)
+static int aoe_debugfs_show(struct seq_file *s, void *ignored)
{
struct aoedev *d;
struct aoetgt **t, **te;
@@ -151,11 +151,7 @@ static int aoedisk_debugfs_show(struct seq_file *s, void *ignored)
return 0;
}
-
-static int aoe_debugfs_open(struct inode *inode, struct file *file)
-{
- return single_open(file, aoedisk_debugfs_show, inode->i_private);
-}
+DEFINE_SHOW_ATTRIBUTE(aoe_debugfs);
static DEVICE_ATTR(state, 0444, aoedisk_show_state, NULL);
static DEVICE_ATTR(mac, 0444, aoedisk_show_mac, NULL);
@@ -184,13 +180,6 @@ static const struct attribute_group *aoe_attr_groups[] = {
NULL,
};
-static const struct file_operations aoe_debugfs_fops = {
- .open = aoe_debugfs_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
-
static void
aoedisk_add_debugfs(struct aoedev *d)
{
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs
2022-09-15 2:34 [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs Liu Shixin
@ 2022-09-20 7:41 ` Christoph Hellwig
2022-09-22 1:49 ` Jens Axboe
2022-09-22 1:49 ` Jens Axboe
1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2022-09-20 7:41 UTC (permalink / raw)
To: Liu Shixin; +Cc: Justin Sanders, Jens Axboe, linux-block
How maintained is aoe still? Everytime I looked at it it feels
more and more bitrotting..
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs
2022-09-20 7:41 ` Christoph Hellwig
@ 2022-09-22 1:49 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-09-22 1:49 UTC (permalink / raw)
To: Christoph Hellwig, Liu Shixin; +Cc: Justin Sanders, linux-block
On 9/20/22 1:41 AM, Christoph Hellwig wrote:
> How maintained is aoe still? Everytime I looked at it it feels
> more and more bitrotting..
It's not maintained at all.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs
2022-09-15 2:34 [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs Liu Shixin
2022-09-20 7:41 ` Christoph Hellwig
@ 2022-09-22 1:49 ` Jens Axboe
1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-09-22 1:49 UTC (permalink / raw)
To: Justin Sanders, Liu Shixin; +Cc: linux-block
On Thu, 15 Sep 2022 10:34:24 +0800, Liu Shixin wrote:
> Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
>
>
Applied, thanks!
[1/1] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs
commit: 8ef859995dbcc5bdc4b0707c9130e130f53c1b08
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-22 1:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 2:34 [PATCH] block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs Liu Shixin
2022-09-20 7:41 ` Christoph Hellwig
2022-09-22 1:49 ` Jens Axboe
2022-09-22 1:49 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.