Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp477506imu; Fri, 16 Nov 2018 05:35:26 -0800 (PST) X-Google-Smtp-Source: AJdET5dkCQexHA17Dzf3133qwyKfwtTZuOL7JPS885cieMsInf/5R5v+AtwQteva2dIPFgN6Knzl X-Received: by 2002:a17:902:2cc3:: with SMTP id n61-v6mr10975727plb.76.1542375326395; Fri, 16 Nov 2018 05:35:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542375326; cv=none; d=google.com; s=arc-20160816; b=JQC5y3ELsuyt+a/esPZBZL88sIXfIBGJmdN2A27RWzz6q1XAEl2zTe0QEPqJuqj5wR tAGTNpNp7Dfv0j+DTVCqVCAzTRYvkiDRwqeifvsNwYONNcwNqt1Rm1JwG5nKTvOvbMYp KJ9kCAGoN4x+gDRvCI9wHcgiVKF1/edslLmTgeQ3Fhmt0CSeilN+4GKVtYz18946gc5w dnsTyZEJ5I5H91HTTMuvbOEdcAUUgkvP3RBWDQsj+/bwcJ719i3RMVVHD5gtuiIlh1bn Z/PHE713fKiPm9s1uCOs8/2nbnLtRwjE1Vl6UzF+tUED5lwSb04z564mHTz+1B8C3MUi dgIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AR2xXaLgWTf6vQA3KprB0IzJe/jn0Al85urUboL29IQ=; b=Yd78YWT3JPsHpD9OsiRWGMUlo6/OTReUySLmy6Gp0TSOXckctxrGwE2GNslCK4dBK6 jqH1H4uDLMNSJDyPAhHka0W7yV6ArsAky7X7BrKzPSs2TCmxIbZ2023UZTM60VIZrpq+ /nR4UYITRuT69u/rfzNoQaDWhk94rGf5DdMsTRoZbXpGQse4YcQU/JmVhvZo0o5ebr4A k0wNxL76cKPvPUMbAGGLQWB9yaF32nOc1H8pGb9s13f0hKxTNhIOB/y0JQKAuYdPd5wE 2AV0mjTt8ZJYJ49kU6r6ccTzADMHDEbNjqow4qt1LUE3Dx4W0juNKoZ5SdxyOPp+f3yM Hqsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si29152072pgt.293.2018.11.16.05.35.11; Fri, 16 Nov 2018 05:35:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389859AbeKPXqv (ORCPT + 99 others); Fri, 16 Nov 2018 18:46:51 -0500 Received: from verein.lst.de ([213.95.11.211]:49825 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727711AbeKPXqu (ORCPT ); Fri, 16 Nov 2018 18:46:50 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id CA1FB68D60; Fri, 16 Nov 2018 14:34:22 +0100 (CET) Date: Fri, 16 Nov 2018 14:34:22 +0100 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, linux-erofs@lists.ozlabs.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Christoph Hellwig , Theodore Ts'o , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com Subject: Re: [PATCH V10 05/19] block: introduce bvec_last_segment() Message-ID: <20181116133422.GD3165@lst.de> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-6-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115085306.9910-6-ming.lei@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + unsigned last_page = total / PAGE_SIZE; > + > + if (last_page * PAGE_SIZE == total) Not sure it matters much with modern compilers, but generally we shit by PAGE_SHIFT instead of multiplying with or dividing by PAGE_SIZE.