From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 515C8C4BA18 for ; Wed, 26 Feb 2020 17:45:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E3A720801 for ; Wed, 26 Feb 2020 17:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbgBZRpQ (ORCPT ); Wed, 26 Feb 2020 12:45:16 -0500 Received: from sym2.noone.org ([178.63.92.236]:55126 "EHLO sym2.noone.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgBZRpP (ORCPT ); Wed, 26 Feb 2020 12:45:15 -0500 X-Greylist: delayed 402 seconds by postgrey-1.27 at vger.kernel.org; Wed, 26 Feb 2020 12:45:15 EST Received: by sym2.noone.org (Postfix, from userid 1002) id 48SNLw6Yxzzvjc1; Wed, 26 Feb 2020 18:38:32 +0100 (CET) From: Tobias Klauser To: Jens Axboe Cc: io-uring@vger.kernel.org Subject: [PATCH] io_uring: define and set show_fdinfo only if procfs is enabled Date: Wed, 26 Feb 2020 18:38:32 +0100 Message-Id: <20200226173832.17773-1-tklauser@distanz.ch> X-Mailer: git-send-email 2.11.0 Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org 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 --- 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