* [PATCH] io_uring: define and set show_fdinfo only if procfs is enabled
@ 2020-02-26 17:38 Tobias Klauser
2020-02-26 17:57 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2020-02-26 17:38 UTC (permalink / raw)
To: Jens Axboe; +Cc: io-uring
Follow the pattern used with other *_show_fdinfo functions and only
define and use io_uring_show_fdinfo and its helper functions if
CONFIG_PROCFS is set.
Fixes: 87ce955b24c9 ("io_uring: add ->show_fdinfo() for the io_uring file descriptor")
Signed-off-by: Tobias Klauser <[email protected]>
---
fs/io_uring.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index de650df9ac53..1a0138d98b60 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6647,6 +6647,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
return submitted ? submitted : ret;
}
+#ifdef CONFIG_PROCFS
static int io_uring_show_cred(int id, void *p, void *data)
{
const struct cred *cred = p;
@@ -6720,6 +6721,7 @@ static void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
percpu_ref_put(&ctx->refs);
}
}
+#endif
static const struct file_operations io_uring_fops = {
.release = io_uring_release,
@@ -6731,7 +6733,9 @@ static const struct file_operations io_uring_fops = {
#endif
.poll = io_uring_poll,
.fasync = io_uring_fasync,
+#ifdef CONFIG_PROCFS
.show_fdinfo = io_uring_show_fdinfo,
+#endif
};
static int io_allocate_scq_urings(struct io_ring_ctx *ctx,
--
2.25.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring: define and set show_fdinfo only if procfs is enabled
2020-02-26 17:38 [PATCH] io_uring: define and set show_fdinfo only if procfs is enabled Tobias Klauser
@ 2020-02-26 17:57 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-02-26 17:57 UTC (permalink / raw)
To: Tobias Klauser; +Cc: io-uring
On 2/26/20 10:38 AM, Tobias Klauser wrote:
> Follow the pattern used with other *_show_fdinfo functions and only
> define and use io_uring_show_fdinfo and its helper functions if
> CONFIG_PROCFS is set.
Thanks, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-26 17:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-26 17:38 [PATCH] io_uring: define and set show_fdinfo only if procfs is enabled Tobias Klauser
2020-02-26 17:57 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox