From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 11 Jun 2018 10:19:38 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , Christoph Hellwig , Alexander Viro , Kent Overstreet , David Sterba , Huang Ying , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , "Darrick J . Wong" , Coly Li , Filipe Manana , Randy Dunlap Subject: Re: [PATCH V6 08/30] block: introduce chunk_last_segment() Message-ID: <20180611171938.GA5101@infradead.org> References: <20180609123014.8861-1-ming.lei@redhat.com> <20180609123014.8861-9-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609123014.8861-9-ming.lei@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: I think both callers would be just as easy to understand by using nth_page() instead of these magic helpers. E.g. for guard_bio_eod: unsigned offset = (bv.bv_offset + bv.bv_len); struct page *page = nth_page(bv.bv_page, offset); zero_user(page, offset & PAGE_MASK, truncated_bytes);