[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2bab7050-dec7-3af8-b643-31b414b8c4b4@acm.org>
Date: Mon, 30 Jan 2023 09:09:23 -0800
From: Bart Van Assche <bvanassche@....org>
To: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>
Cc: Ilya Dryomov <idryomov@...il.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Minchan Kim <minchan@...nel.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Keith Busch <kbusch@...nel.org>,
Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
David Howells <dhowells@...hat.com>,
Marc Dionne <marc.dionne@...istor.com>,
Xiubo Li <xiubli@...hat.com>, Steve French <sfrench@...ba.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna@...nel.org>,
Mike Marshall <hubcap@...ibond.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Chuck Lever <chuck.lever@...cle.com>,
linux-block@...r.kernel.org, ceph-devel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
target-devel@...r.kernel.org, kvm@...r.kernel.org,
netdev@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
devel@...ts.orangefs.org, io-uring@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH 01/23] block: factor out a bvec_set_page helper
On 1/30/23 01:21, Christoph Hellwig wrote:
> Add a helper to initialize a bvec based of a page pointer. This will help
> removing various open code bvec initializations.
Why do you want to remove the open-coded bvec initializations? What is
wrong with open-coding bvec initialization? This patch series modifies a
lot of code but does not improve code readability. Anyone who encounters
code that uses the new function bvec_set_page() has to look up the
definition of that function to figure out what it does.
> - iv = bip->bip_vec + bip->bip_vcnt;
> -
> if (bip->bip_vcnt &&
> bvec_gap_to_prev(&bdev_get_queue(bio->bi_bdev)->limits,
> &bip->bip_vec[bip->bip_vcnt - 1], offset))
> return 0;
>
> - iv->bv_page = page;
> - iv->bv_len = len;
> - iv->bv_offset = offset;
> + bvec_set_page(&bip->bip_vec[bip->bip_vcnt], page, len, offset);
> bip->bip_vcnt++;
Has it been considered to use structure assignment instead of
introducing bvec_set_page(), e.g. as follows?
bip->bip_vec[bip->bip_vcnt] = (struct bio_vec) {
.bv_page = page, .bv_len = len, .bv_offset = offset };
Thanks,
Bart.
Powered by blists - more mailing lists