Re: [PATCH v2 10/11] iomap: Add support for zone append writes

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

 



On 24/03/2020 23:46, Dave Chinner wrote:
>> @@ -266,12 +290,28 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,
>>   
>>   		bio = bio_alloc(GFP_KERNEL, nr_pages);
>>   		bio_set_dev(bio, iomap->bdev);
>> -		bio->bi_iter.bi_sector = iomap_sector(iomap, pos);
>> +		bio->bi_iter.bi_sector = iomap_dio_bio_sector(dio, iomap, pos);
>>   		bio->bi_write_hint = dio->iocb->ki_hint;
>>   		bio->bi_ioprio = dio->iocb->ki_ioprio;
>>   		bio->bi_private = dio;
>>   		bio->bi_end_io = iomap_dio_bio_end_io;
>>   
>> +		if (dio->flags & IOMAP_DIO_WRITE) {
>> +			bio->bi_opf = REQ_SYNC | REQ_IDLE;
>> +			if (zone_append)
>> +				bio->bi_opf |= REQ_OP_ZONE_APPEND;
>> +			else
>> +				bio->bi_opf |= REQ_OP_WRITE;
>> +			if (use_fua)
>> +				bio->bi_opf |= REQ_FUA;
>> +			else
>> +				dio->flags &= ~IOMAP_DIO_WRITE_FUA;
>> +		} else {
>> +			bio->bi_opf = REQ_OP_READ;
>> +			if (dio->flags & IOMAP_DIO_DIRTY)
>> +				bio_set_pages_dirty(bio);
>> +		}
> Why move all this code? If it's needed, please split it into a
> separate patchi to separate it from the new functionality...
> 

The code is moved as bio_iov_iter_get_pages() needs the correct bi_opf 
set for zone append to be able to check the limits (see patch 03/11, 
block: Introduce REQ_OP_ZONE_APPEND in this series).

The call chain is:
bio_iov_iter_get_pages()
`-> bio_iov_iter_get_pages()
     `-> bio_full()
         `-> bio_can_zone_append()

I'm not sure if separating this movement would make it clearer, apart 
from a commit message?




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux