Re: [PATCH 09/40] btrfs: simplify scrub_recheck_block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 23, 2022 at 08:10:51AM +0800, Qu Wenruo wrote:
>>   		}
>>
>>   		WARN_ON(!spage->page);
>> -		bio = btrfs_bio_alloc(1);
>> -		bio_set_dev(bio, spage->dev->bdev);
>> -
>> -		bio_add_page(bio, spage->page, fs_info->sectorsize, 0);
>> -		bio->bi_iter.bi_sector = spage->physical >> 9;
>> -		bio->bi_opf = REQ_OP_READ;
>> +		bio_init(&bio, spage->dev->bdev, &bvec, 1, REQ_OP_READ);
>> +		__bio_add_page(&bio, spage->page, fs_info->sectorsize, 0);
>
> Can we make the naming for __bio_add_page() better?
>
> With more on-stack bio usage, such __bio_add_page() is really a little
> embarrassing.

__bio_add_page is really just a micro-optimize version of
__bio_add_page for sinle page users like this.  To be honest we should
probably just stop using it and I should not have added it here.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux