[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db3b5263-864e-dbb8-b3d9-075b6283e5bf@nvidia.com>
Date: Sun, 27 Feb 2022 14:09:39 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Jens Axboe <axboe@...nel.dk>, jhubbard.send.patches@...il.com,
Jan Kara <jack@...e.cz>, Christoph Hellwig <hch@...radead.org>,
Dave Chinner <dchinner@...hat.com>,
"Darrick J . Wong" <djwong@...nel.org>,
Theodore Ts'o <tytso@....edu>,
Alexander Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <miklos@...redi.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Chaitanya Kulkarni <kch@...dia.com>
Cc: linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/6] iov_iter: new iov_iter_pin_pages*(), for FOLL_PIN
pages
On 2/27/22 13:57, Jens Axboe wrote:
...
>> + return res;
>> + return (res == n ? len : res * PAGE_SIZE) - *start;
>
> Trying to be clever like that just makes the code a lot less readable. I
> should not have to reason about a return value. Same in the other
> function.
>
No argument there. This was shamelessly lifted from
iov_iter_get_pages(), and I initially calculated that keeping it
identical to that known-good code, where possible, was better than
fixing it up.
However, I'll go ahead and simplify it--with pleasure--based on this
feedback.
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists