[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180612032419.GB26412@ming.t460p>
Date: Tue, 12 Jun 2018 11:24:20 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Jens Axboe <axboe@...com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Kent Overstreet <kent.overstreet@...il.com>,
David Sterba <dsterba@...e.cz>,
Huang Ying <ying.huang@...el.com>,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
Theodore Ts'o <tytso@....edu>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Coly Li <colyli@...e.de>, Filipe Manana <fdmanana@...il.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH V6 08/30] block: introduce chunk_last_segment()
On Mon, Jun 11, 2018 at 10:19:38AM -0700, Christoph Hellwig wrote:
> 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);
The above lines should have been written as:
struct page *page = nth_page(bv.bv_page, offset / PAGE_SIZE)
but this way may cause 'page' points to the next page of bv's last
page if offset == N * PAGE_SIZE.
Thanks,
Ming
Powered by blists - more mailing lists