Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp417745pxu; Sun, 22 Nov 2020 13:09:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBN4WQ8AvWcihR2IideDgsd+tqdaW2VKY7DCNM9h2KFMNmH5Tp8KY5X4fYnaW4zb4gHqHr X-Received: by 2002:a17:906:4482:: with SMTP id y2mr7499258ejo.342.1606079352750; Sun, 22 Nov 2020 13:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606079352; cv=none; d=google.com; s=arc-20160816; b=WrC2neGA72N+TAPzrgLqemLIM/NV2+ZnD8P63kPsuxH33UTPRbB66tQuRRu+t9/Zzc 1RiWWeHqzcnE7vG1w5U8ghQBO1kLjSFN25TEmmygceQ9TpVENO6vKO4KKU5SANlToYbt 0oqfFwPNnLjQm/IU9YgMRyjX972pZmQ9PEa9ZsenOtK8RAYkSHYjqFewPl4AoR97+TrA hnAwC0NBD4DOH/Fz5b0bOvEQrk9AKCY4iA34qV6DELWVdh5NqVvUJ7fF1hQcjVp1t76D C3xC2L3cU98QJqYRdyL1hyXbXVnhUsOeBXlsILo0wSa5UmrfThucMKtcpCVdH/gx6Zsc Cz1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=GOoX61pkLd8wZbo61Pl/ii/Pk3fsthXi4w+oqzhVANE=; b=d4FnB1ztE4BQwi9GVcyLZrGj+wI4VdwDOBfpZ/NOvq+zwxFE8+SHeRW0XpAc9QoHw9 gt28liMrBYECLXdROT1gScN6owWiTMoZ5PM5cMJEYXiSkJnsSztz86lxX+32d9kCvETe 6yrDJGce5M+edeRQ2arFvP0TSAh1S4KvGtkxqCMWCQPLyVNuUqBURBwOZsT2jJNCIXDc AGiSAuoMl9+o2XbJ40RorrnauE5gitDslDa5fZJeH+JoyWo/dRpW8eGZtBfCderfV3gU VKnCEWrCU4HsaxoR8TUfS5VMuFHONUna5IsY2IUN6NKToFeHFWF7o1+/yM2s+I0n+Ikw IvPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zBnm2Qnr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si5724353eji.86.2020.11.22.13.08.49; Sun, 22 Nov 2020 13:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zBnm2Qnr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727434AbgKVUwh (ORCPT + 99 others); Sun, 22 Nov 2020 15:52:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:57618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727418AbgKVUwh (ORCPT ); Sun, 22 Nov 2020 15:52:37 -0500 Received: from leira.hammer.space (c-68-36-133-222.hsd1.mi.comcast.net [68.36.133.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E839920782 for ; Sun, 22 Nov 2020 20:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606078357; bh=BYDboR5Cc+oCNShOsvGz1Dy+YDR9rdlwJoTlpNiF9uk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=zBnm2QnrOmm6HUeXL5C4tVMgJ5KCu7+OgboLNiuYURK1lvjPyb5oSYWxKAyeqbZhE v4zsT5rGWnhlJjU0IjH8k97jVLwnwLWjhnFr+D5ekroC6e/a8jlHmPhfeLKWig1MmB 7IzlQPwj9Ca8hyP02XOyKHwTQ3X1jic7YY80UjDE= From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 7/8] SUNRPC: Fix open coded xdr_stream_remaining() Date: Sun, 22 Nov 2020 15:52:28 -0500 Message-Id: <20201122205229.3826-8-trondmy@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201122205229.3826-7-trondmy@kernel.org> References: <20201122205229.3826-1-trondmy@kernel.org> <20201122205229.3826-2-trondmy@kernel.org> <20201122205229.3826-3-trondmy@kernel.org> <20201122205229.3826-4-trondmy@kernel.org> <20201122205229.3826-5-trondmy@kernel.org> <20201122205229.3826-6-trondmy@kernel.org> <20201122205229.3826-7-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Signed-off-by: Trond Myklebust --- net/sunrpc/xdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index ddd5cc2281ab..c852d199c789 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -1261,7 +1261,7 @@ uint64_t xdr_align_data(struct xdr_stream *xdr, uint64_t offset, uint32_t length xdr_realign_pages(xdr); from = xdr_page_pos(xdr); - bytes = xdr->nwords << 2; + bytes = xdr_stream_remaining(xdr); if (length < bytes) bytes = length; @@ -1298,7 +1298,7 @@ uint64_t xdr_expand_hole(struct xdr_stream *xdr, uint64_t offset, uint64_t lengt xdr_realign_pages(xdr); from = xdr_page_pos(xdr); - bytes = xdr->nwords << 2; + bytes = xdr_stream_remaining(xdr); if (offset + length + bytes > buf->page_len) { unsigned int shift = (offset + length + bytes) - buf->page_len; -- 2.28.0