The patch titled Subject: fs, eventfd: add procfs fdinfo helper has been added to the -mm tree. Its filename is fs-eventfd-add-procfs-fdinfo-helper.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Cyrill Gorcunov <gorcunov@xxxxxxxxxx> Subject: fs, eventfd: add procfs fdinfo helper This allows us to print out raw counter value. The /proc/pid/fdinfo/fd output is | pos: 0 | flags: 04002 | eventfd-count: 5a Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx> Acked-by: Pavel Emelyanov <xemul@xxxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Andrey Vagin <avagin@xxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Cc: James Bottomley <jbottomley@xxxxxxxxxxxxx> Cc: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Cc: Matthew Helsley <matt.helsley@xxxxxxxxx> Cc: "J. Bruce Fields" <bfields@xxxxxxxxxxxx> Cc: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/eventfd.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff -puN fs/eventfd.c~fs-eventfd-add-procfs-fdinfo-helper fs/eventfd.c --- a/fs/eventfd.c~fs-eventfd-add-procfs-fdinfo-helper +++ a/fs/eventfd.c @@ -19,6 +19,8 @@ #include <linux/export.h> #include <linux/kref.h> #include <linux/eventfd.h> +#include <linux/proc_fs.h> +#include <linux/seq_file.h> struct eventfd_ctx { struct kref kref; @@ -284,7 +286,25 @@ static ssize_t eventfd_write(struct file return res; } +#ifdef CONFIG_PROC_FS +static int eventfd_show_fdinfo(struct seq_file *m, struct file *f) +{ + struct eventfd_ctx *ctx = f->private_data; + int ret; + + spin_lock_irq(&ctx->wqh.lock); + ret = seq_printf(m, "eventfd-count: %16llx\n", + (unsigned long long)ctx->count); + spin_unlock_irq(&ctx->wqh.lock); + + return ret; +} +#endif + static const struct file_operations eventfd_fops = { +#ifdef CONFIG_PROC_FS + .show_fdinfo = eventfd_show_fdinfo, +#endif .release = eventfd_release, .poll = eventfd_poll, .read = eventfd_read, _ Patches currently in -mm which might be from gorcunov@xxxxxxxxxx are linux-next.patch proc-check-vma-vm_file-before-dereferencing.patch procfs-add-vmflags-field-in-smaps-output-v4.patch procfs-add-vmflags-field-in-smaps-output-v4-fix.patch proc-pid-status-add-seccomp-field.patch tools-testing-selftests-kcmp-kcmp_testc-print-reason-for-failure-in-kcmp_test.patch procfs-add-ability-to-plug-in-auxiliary-fdinfo-providers.patch fs-eventfd-add-procfs-fdinfo-helper.patch fs-epoll-add-procfs-fdinfo-helper-v2.patch fdinfo-show-sigmask-for-signalfd-fd-v3.patch fs-exportfs-escape-nil-dereference-if-no-s_export_op-present.patch fs-exportfs-add-exportfs_encode_inode_fh-helper.patch fs-notify-add-procfs-fdinfo-helper-v6.patch fs-notify-add-procfs-fdinfo-helper-v6-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html