From patchwork Wed Sep 14 08:37:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9330901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B8596077F for ; Wed, 14 Sep 2016 08:39:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CF3529B5A for ; Wed, 14 Sep 2016 08:39:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 519FA29B6F; Wed, 14 Sep 2016 08:39:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA90B29B5A for ; Wed, 14 Sep 2016 08:39:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761625AbcINIi6 (ORCPT ); Wed, 14 Sep 2016 04:38:58 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36191 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761144AbcINIha (ORCPT ); Wed, 14 Sep 2016 04:37:30 -0400 Received: by mail-wm0-f51.google.com with SMTP id b187so34762301wme.1 for ; Wed, 14 Sep 2016 01:37:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=19ZwjSUjvXb+t0+pPQl8pVXcU6DF0cbhtbekpPJyrXQ=; b=BLShEOA7Nu2xPqLJ4MGNt1BNspf2pv6Vvp6XcGS9X/uOs9MsWjFNjUF75AL1vPO6kN QKh0vRH9j23dKgolJupZEv4/dO/4pEWoBPNYU0FbIFgUM6ioUhc+DQoWP/qkdk5YgO4q VJ164FKxzr0w6dzQz+Zu2n+HEXKz92Rx6Jst8aQ9vG3J1lLsdkvpd911KRtMCrL2mrj4 nALEPu+ZrDtIJzRc65rnIQ9FJckYJc+z21741ZVXW1QapK0hI0MnyfrqMTpJ6j6q1uth xhDxTzNpKzkqK9zYS2OHjPpOvBSnruDrRKtqi/OHmB2eRNqZuIztSL6DOROlc2I31amj dfQQ== X-Gm-Message-State: AE9vXwPa5DnsHKuqwFqInJIdw3a2EbojFWc2YSP87RHD2Ii3v6YwHmFFEH7OQS8E4O1h9JEK X-Received: by 10.28.60.2 with SMTP id j2mr9560531wma.46.1473842249004; Wed, 14 Sep 2016 01:37:29 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id g184sm9533889wme.15.2016.09.14.01.37.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 01:37:27 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH 07/11] pipe: remove generic_pipe_buf_confirm() Date: Wed, 14 Sep 2016 10:37:12 +0200 Message-Id: <1473842236-28655-8-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1473842236-28655-1-git-send-email-mszeredi@redhat.com> References: <1473842236-28655-1-git-send-email-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now all instances of .confirm are set to generic_pipe_buf_confirm(). The method and the helper can be removed. Signed-off-by: Miklos Szeredi --- fs/pipe.c | 18 ------------------ fs/splice.c | 4 ---- include/linux/pipe_fs_i.h | 18 +----------------- kernel/relay.c | 1 - kernel/trace/trace.c | 2 -- 5 files changed, 1 insertion(+), 42 deletions(-) diff --git a/fs/pipe.c b/fs/pipe.c index 4fc422f0dea8..47b41568b3fc 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -200,22 +200,6 @@ void generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf) EXPORT_SYMBOL(generic_pipe_buf_get); /** - * generic_pipe_buf_confirm - verify contents of the pipe buffer - * @info: the pipe that the buffer belongs to - * @buf: the buffer to confirm - * - * Description: - * This function does nothing, because the generic pipe code uses - * pages that are always good when inserted into the pipe. - */ -int generic_pipe_buf_confirm(struct pipe_inode_info *info, - struct pipe_buffer *buf) -{ - return 0; -} -EXPORT_SYMBOL(generic_pipe_buf_confirm); - -/** * generic_pipe_buf_release - put a reference to a &struct pipe_buffer * @pipe: the pipe that the buffer belongs to * @buf: the buffer to put a reference to @@ -232,7 +216,6 @@ EXPORT_SYMBOL(generic_pipe_buf_release); static const struct pipe_buf_operations anon_pipe_buf_ops = { .can_merge = 1, - .confirm = generic_pipe_buf_confirm, .release = anon_pipe_buf_release, .steal = anon_pipe_buf_steal, .get = generic_pipe_buf_get, @@ -240,7 +223,6 @@ static const struct pipe_buf_operations anon_pipe_buf_ops = { static const struct pipe_buf_operations packet_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = anon_pipe_buf_release, .steal = anon_pipe_buf_steal, .get = generic_pipe_buf_get, diff --git a/fs/splice.c b/fs/splice.c index 0ecbe3011796..dc4648ba6e8d 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -95,7 +95,6 @@ static void page_cache_pipe_buf_release(struct pipe_inode_info *pipe, const struct pipe_buf_operations page_cache_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = page_cache_pipe_buf_release, .steal = page_cache_pipe_buf_steal, .get = generic_pipe_buf_get, @@ -113,7 +112,6 @@ static int user_page_pipe_buf_steal(struct pipe_inode_info *pipe, static const struct pipe_buf_operations user_page_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = page_cache_pipe_buf_release, .steal = user_page_pipe_buf_steal, .get = generic_pipe_buf_get, @@ -507,7 +505,6 @@ EXPORT_SYMBOL(generic_file_splice_read); static const struct pipe_buf_operations default_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = generic_pipe_buf_release, .steal = generic_pipe_buf_steal, .get = generic_pipe_buf_get, @@ -522,7 +519,6 @@ static int generic_pipe_buf_nosteal(struct pipe_inode_info *pipe, /* Pipe buffer operations for a socket and similar. */ const struct pipe_buf_operations nosteal_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = generic_pipe_buf_release, .steal = generic_pipe_buf_nosteal, .get = generic_pipe_buf_get, diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index e7497c9dde7f..ae9d87ea95cb 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -62,12 +62,6 @@ struct pipe_inode_info { }; /* - * Note on the nesting of these functions: - * - * ->confirm() - * ->steal() - * - * That is, ->steal() must be called on a confirmed buffer. * See below for the meaning of each operation. Also see kerneldoc * in fs/pipe.c for the pipe and generic variants of these hooks. */ @@ -80,15 +74,6 @@ struct pipe_buf_operations { int can_merge; /* - * ->confirm() verifies that the data in the pipe buffer is there - * and that the contents are good. If the pages in the pipe belong - * to a file system, we may need to wait for IO completion in this - * hook. Returns 0 for good, or a negative error value in case of - * error. - */ - int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); - - /* * When the contents of this pipe buffer has been completely * consumed by a reader, ->release() is called. */ @@ -143,7 +128,7 @@ static inline void pipe_buf_release(struct pipe_inode_info *pipe, static inline int pipe_buf_confirm(struct pipe_inode_info *pipe, struct pipe_buffer *buf) { - return buf->ops->confirm(pipe, buf); + return 0; } /** @@ -179,7 +164,6 @@ void free_pipe_info(struct pipe_inode_info *); /* Generic pipe buffer ops functions */ void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); -int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); diff --git a/kernel/relay.c b/kernel/relay.c index d797502140b9..da954ce520b2 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -1223,7 +1223,6 @@ static void relay_pipe_buf_release(struct pipe_inode_info *pipe, static const struct pipe_buf_operations relay_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = relay_pipe_buf_release, .steal = generic_pipe_buf_steal, .get = generic_pipe_buf_get, diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index dade4c9559cc..bdf891c78708 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5219,7 +5219,6 @@ static void tracing_spd_release_pipe(struct splice_pipe_desc *spd, static const struct pipe_buf_operations tracing_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = generic_pipe_buf_release, .steal = generic_pipe_buf_steal, .get = generic_pipe_buf_get, @@ -6114,7 +6113,6 @@ static void buffer_pipe_buf_get(struct pipe_inode_info *pipe, /* Pipe buffer operations for a buffer. */ static const struct pipe_buf_operations buffer_pipe_buf_ops = { .can_merge = 0, - .confirm = generic_pipe_buf_confirm, .release = buffer_pipe_buf_release, .steal = generic_pipe_buf_steal, .get = buffer_pipe_buf_get,