From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 9C9056B000D for ; Mon, 11 Jun 2018 13:20:00 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id z5-v6so10547073pfz.6 for ; Mon, 11 Jun 2018 10:20:00 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id w28-v6si24887211pge.329.2018.06.11.10.19.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 10:19:59 -0700 (PDT) Date: Mon, 11 Jun 2018 10:19:38 -0700 From: Christoph Hellwig 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: 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 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);