[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_59C3AA88A8F1829226E5D3619837FC4A9E09@qq.com>
Date: Mon, 12 Jun 2023 02:59:47 +0800
From: wenyang.linux@...mail.com
To: Alexander Viro <viro@...iv.linux.org.uk>,
Jens Axboe <axboe@...nel.dk>,
Christian Brauner <brauner@...nel.org>
Cc: Wen Yang <wenyang.linux@...mail.com>,
Christoph Hellwig <hch@....de>, Dylan Yudaken <dylany@...com>,
David Woodhouse <dwmw@...zon.co.uk>,
Matthew Wilcox <willy@...radead.org>,
Eric Biggers <ebiggers@...gle.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] eventfd: show flags in fdinfo
From: Wen Yang <wenyang.linux@...mail.com>
The flags should be displayed in fdinfo, as different flags
could affect the behavior of eventfd.
Signed-off-by: Wen Yang <wenyang.linux@...mail.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Christian Brauner <brauner@...nel.org>
Cc: Christoph Hellwig <hch@....de>
Cc: Dylan Yudaken <dylany@...com>
Cc: David Woodhouse <dwmw@...zon.co.uk>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Eric Biggers <ebiggers@...gle.com>
Cc: linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
fs/eventfd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 6c06a527747f..5b5448e65f6f 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -33,10 +33,10 @@ struct eventfd_ctx {
/*
* Every time that a write(2) is performed on an eventfd, the
* value of the __u64 being written is added to "count" and a
- * wakeup is performed on "wqh". A read(2) will return the "count"
- * value to userspace, and will reset "count" to zero. The kernel
- * side eventfd_signal() also, adds to the "count" counter and
- * issue a wakeup.
+ * wakeup is performed on "wqh". If EFD_SEMAPHORE flag was not
+ * specified, a read(2) will return the "count" value to userspace,
+ * and will reset "count" to zero. The kernel side eventfd_signal()
+ * also, adds to the "count" counter and issue a wakeup.
*/
__u64 count;
unsigned int flags;
@@ -301,6 +301,7 @@ static void eventfd_show_fdinfo(struct seq_file *m, struct file *f)
(unsigned long long)ctx->count);
spin_unlock_irq(&ctx->wqh.lock);
seq_printf(m, "eventfd-id: %d\n", ctx->id);
+ seq_printf(m, "eventfd-flags: 0%o\n", ctx->flags);
}
#endif
--
2.34.1
Powered by blists - more mailing lists