Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1174684pxk; Fri, 25 Sep 2020 08:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgcBMNqtC3SMw3+3cgoe7ThpQAZzU75L5g4tT3fX8Z9GDnibwrLTgi2n5c5Iff0+kFmWtm X-Received: by 2002:a50:fc0b:: with SMTP id i11mr1759004edr.164.1601046253064; Fri, 25 Sep 2020 08:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601046253; cv=none; d=google.com; s=arc-20160816; b=l2nQgLTDGxlA8VCIOg1bdIeg7oYOAk1TPnn2Ovyk7G/3UiONa5xkP7Ywm4Qu54ydpX a1zrfQkvt2B2lhtiAuyHRBR1aXmkK0uWKFSW5pGeOP90JTPgnVd8eut2x3hC1gspBIfn RednLis4f8kMjHo3HXyhkh5YD8+nlDhCzXYQlBLKR3p78UxhaKubw0lg0+jmd88cdhOv NszW3Ig43VKz1wA0qOwpLfyuhJhqZA98kYWC40pptLrOfpAmpbvintKuQuo/PIhDc7p9 RsnQYKe0+Z5GLTYaCO2ccTFQo1Y3xAYUHT58quyaPU8zlL7rvISKt9+bLOjvOPBW+zLG 15bA== 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:cc:to:from; bh=rr9ugwicd2pVPhnibopR8/HmHoyHKpwg4xIXK9dvM8k=; b=YbJNG4QvPSlFO2eE8yVC/uw+Apq4xJg22MV5DBP8sZ8ib0WBl7fuhxkbuA+2BRqpVJ dtjnzdhWGb2KdpxG3kkeZToQI+KiDfGQ0JxojTuNfQD+w/IBi6UBsEl9C8fZTsXoqexc 8idDJ2ROl6qkdvX1sCxtwcZao5ZZd2J7QqsShKUzude9Auh3WvAxSBMzep8+W4+N+Izv Cz/TI+xapYmXso3ZJz+NzruikMnpCT6k+eQiUUmqhu8RPXOB/n7eWYgPfcZ0px79qgbo ol/aACB8vPysJbDxtCT4CpZ4bdOl5pbfmFVBLHovMb9JkXrGitxyPsOptbXdtdMLcTAc Ixzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si2452806ejj.33.2020.09.25.08.03.49; Fri, 25 Sep 2020 08:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729493AbgIYPCW (ORCPT + 99 others); Fri, 25 Sep 2020 11:02:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:34806 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728888AbgIYPCT (ORCPT ); Fri, 25 Sep 2020 11:02:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F1C89B04F; Fri, 25 Sep 2020 15:02:17 +0000 (UTC) From: Coly Li To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Coly Li , Ilya Dryomov , Jeff Layton Subject: [PATCH v8 7/7] libceph: use sendpage_ok() in ceph_tcp_sendpage() Date: Fri, 25 Sep 2020 23:01:19 +0800 Message-Id: <20200925150119.112016-8-colyli@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200925150119.112016-1-colyli@suse.de> References: <20200925150119.112016-1-colyli@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In libceph, ceph_tcp_sendpage() does the following checks before handle the page by network layer's zero copy sendpage method, if (page_count(page) >= 1 && !PageSlab(page)) This check is exactly what sendpage_ok() does. This patch replace the open coded checks by sendpage_ok() as a code cleanup. Signed-off-by: Coly Li Cc: Ilya Dryomov Cc: Jeff Layton --- net/ceph/messenger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index bdfd66ba3843..d4d7a0e52491 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -575,7 +575,7 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page, * coalescing neighboring slab objects into a single frag which * triggers one of hardened usercopy checks. */ - if (page_count(page) >= 1 && !PageSlab(page)) + if (sendpage_ok(page)) sendpage = sock->ops->sendpage; else sendpage = sock_no_sendpage; -- 2.26.2