Commit bebdb65e authored by Tobias Klauser's avatar Tobias Klauser Committed by Jens Axboe
Browse files

io_uring: define and set show_fdinfo only if procfs is enabled



Follow the pattern used with other *_show_fdinfo functions and only
define and use io_uring_show_fdinfo and its helper functions if
CONFIG_PROC_FS is set.

Fixes: 87ce955b ("io_uring: add ->show_fdinfo() for the io_uring file descriptor")
Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent dd3db2a3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6641,6 +6641,7 @@ out_fput:
	return submitted ? submitted : ret;
}

#ifdef CONFIG_PROC_FS
static int io_uring_show_cred(int id, void *p, void *data)
{
	const struct cred *cred = p;
@@ -6714,6 +6715,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,
@@ -6725,7 +6727,9 @@ static const struct file_operations io_uring_fops = {
#endif
	.poll		= io_uring_poll,
	.fasync		= io_uring_fasync,
#ifdef CONFIG_PROC_FS
	.show_fdinfo	= io_uring_show_fdinfo,
#endif
};

static int io_allocate_scq_urings(struct io_ring_ctx *ctx,