From patchwork Tue Nov 20 03:00:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 10689841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7F7B1923 for ; Tue, 20 Nov 2018 03:01:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAEAA2A12F for ; Tue, 20 Nov 2018 03:01:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF60029F69; Tue, 20 Nov 2018 03:01:11 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 55E1F2A12F for ; Tue, 20 Nov 2018 03:01:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731370AbeKTN1S (ORCPT ); Tue, 20 Nov 2018 08:27:18 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58264 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731551AbeKTN1R (ORCPT ); Tue, 20 Nov 2018 08:27:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=glAq6Gs18GzvpqR01u9VYg+AHUgGTTkhYlPGHzpyFZw=; b=JQuwnm62lDHQS1e0q6BPhXAir p3HPrKZ5MiZkGsTfpzCxhHIlU0YSY0BMRnzjuqO/D5RgeeisOlNCNZvFsEFhnd5gbad17Nmq1biT8 mBroUoFTMPAWYB36cir5WPo6ya9Q8eoiL0tcj1V8ql8h1sP5R1gnQpgSv6vVDUTXtewlQRMtHinUt Kio90OIw2vBhqqIUYuDm/qFeoz4brQmwKP+qGFzN74tkZQa4Y89H3A7NV9ZsP2qD4VsTniP0+jnnj C7InurhV4B+XDVSZ8asOtp8MRInxSSxYh2bcPmjTCcZR8FY+KRoxLSVKtXJ+k0GS+n/h1/E2BaYuF M/op/eCgA==; Received: from [2600:1700:65a0:78e0:514:7862:1503:8e4d] (helo=sagi-Latitude-E7470.lbits) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOwH4-0000FW-8s; Tue, 20 Nov 2018 03:00:26 +0000 From: Sagi Grimberg To: linux-nvme@lists.infradead.org Cc: linux-block@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Keith Busch , Christoph Hellwig Subject: [PATCH v2 03/14] iov_iter: pass void csum pointer to csum_and_copy_to_iter Date: Mon, 19 Nov 2018 19:00:04 -0800 Message-Id: <20181120030019.31738-4-sagi@grimberg.me> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181120030019.31738-1-sagi@grimberg.me> References: <20181120030019.31738-1-sagi@grimberg.me> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The single caller to csum_and_copy_to_iter is skb_copy_and_csum_datagram and we are trying to unite its logic with skb_copy_datagram_iter by passing a callback to the copy function that we want to apply. Thus, we need to make the checksum pointer private to the function. Signed-off-by: Sagi Grimberg --- include/linux/uio.h | 2 +- lib/iov_iter.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/uio.h b/include/linux/uio.h index 55ce99ddb912..41d1f8d3313d 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -266,7 +266,7 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count) { i->count = count; } -size_t csum_and_copy_to_iter(const void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); +size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *csump, struct iov_iter *i); size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); bool csum_and_copy_from_iter_full(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 7ebccb5c1637..db93531ca3e3 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1432,10 +1432,11 @@ bool csum_and_copy_from_iter_full(void *addr, size_t bytes, __wsum *csum, } EXPORT_SYMBOL(csum_and_copy_from_iter_full); -size_t csum_and_copy_to_iter(const void *addr, size_t bytes, __wsum *csum, +size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *csump, struct iov_iter *i) { const char *from = addr; + __wsum *csum = csump; __wsum sum, next; size_t off = 0; sum = *csum;