[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-nfs
Subject: Re: [PATCH 12/23] ceph: use bvec_set_page to initialize a bvec
From: Xiubo Li <xiubli () redhat ! com>
Date: 2023-01-31 1:51:00
Message-ID: ba3adefd-f2d8-d074-4dfc-5677c3cd71a3 () redhat ! com
[Download RAW message or body]
On 31/01/2023 02:02, Ilya Dryomov wrote:
> On Mon, Jan 30, 2023 at 10:22 AM Christoph Hellwig <hch@lst.de> wrote:
>> Use the bvec_set_page helper to initialize a bvec.
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> ---
>> fs/ceph/file.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
>> index 764598e1efd91f..6419dce7c57987 100644
>> --- a/fs/ceph/file.c
>> +++ b/fs/ceph/file.c
>> @@ -103,11 +103,11 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize,
>> size += bytes;
>>
>> for ( ; bytes; idx++, bvec_idx++) {
>> - struct bio_vec bv = {
>> - .bv_page = pages[idx],
>> - .bv_len = min_t(int, bytes, PAGE_SIZE - start),
>> - .bv_offset = start,
>> - };
>> + struct bio_vec bv;
>> +
>> + bvec_set_page(&bv, pages[idx],
> Hi Christoph,
>
> There is trailing whitespace on this line which git complains about
> and it made me take a second look. I think bvec_set_page() allows to
> make this more compact:
>
> for ( ; bytes; idx++, bvec_idx++) {
> int len = min_t(int, bytes, PAGE_SIZE - start);
>
> bvec_set_page(&bvecs[bvec_idx], pages[idx], len, start);
> bytes -= len;
> start = 0;
> }
>
This looks better.
Thanks
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic