mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
eventfd: show the EFD_SEMAPHORE flag in fdinfo
The EFD_SEMAPHORE flag should be displayed in fdinfo, as different value could affect the behavior of eventfd. Suggested-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Wen Yang <wenyang.linux@foxmail.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Jens Axboe <axboe@kernel.dk> Cc: Christian Brauner <brauner@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Dylan Yudaken <dylany@fb.com> Cc: David Woodhouse <dwmw@amazon.co.uk> Cc: Matthew Wilcox <willy@infradead.org> Cc: Eric Biggers <ebiggers@google.com> Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: <tencent_05B9CFEFE6B9BC2A9B3A27886A122A7D9205@qq.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
5c075c5b8f
commit
33d8b5d782
10
fs/eventfd.c
10
fs/eventfd.c
@@ -33,10 +33,10 @@ struct eventfd_ctx {
|
|||||||
/*
|
/*
|
||||||
* Every time that a write(2) is performed on an eventfd, the
|
* Every time that a write(2) is performed on an eventfd, the
|
||||||
* value of the __u64 being written is added to "count" and a
|
* value of the __u64 being written is added to "count" and a
|
||||||
* wakeup is performed on "wqh". A read(2) will return the "count"
|
* wakeup is performed on "wqh". If EFD_SEMAPHORE flag was not
|
||||||
* value to userspace, and will reset "count" to zero. The kernel
|
* specified, a read(2) will return the "count" value to userspace,
|
||||||
* side eventfd_signal() also, adds to the "count" counter and
|
* and will reset "count" to zero. The kernel side eventfd_signal()
|
||||||
* issue a wakeup.
|
* also, adds to the "count" counter and issue a wakeup.
|
||||||
*/
|
*/
|
||||||
__u64 count;
|
__u64 count;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
@@ -301,6 +301,8 @@ static void eventfd_show_fdinfo(struct seq_file *m, struct file *f)
|
|||||||
(unsigned long long)ctx->count);
|
(unsigned long long)ctx->count);
|
||||||
spin_unlock_irq(&ctx->wqh.lock);
|
spin_unlock_irq(&ctx->wqh.lock);
|
||||||
seq_printf(m, "eventfd-id: %d\n", ctx->id);
|
seq_printf(m, "eventfd-id: %d\n", ctx->id);
|
||||||
|
seq_printf(m, "eventfd-semaphore: %d\n",
|
||||||
|
!!(ctx->flags & EFD_SEMAPHORE));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user