Re: [PATCH 3/3] block: Specify the operation type when calling blk_mq_map_queue()

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

 



On Fri, Jun 17, 2022 at 11:25:41AM -0700, Bart Van Assche wrote:
> I looked into adding a __bitwise annotation for request flags by 
> introducing a new type that is called blk_mq_opf_t. Introducing such a type 
> without modifying a lot of code seems difficult to me. This is what I ran 
> into:
> * If the type of the operation type constants (REQ_OP_READ etc.) is 
> modified into blk_mq_opf_t then their type changes from 'enum req_opf' into 
> type blk_mq_opf_t and sparse complains when passing e.g. REQ_OP_READ to a 
> function that accepts an argument with type enum req_opf.
> * If the type of the operation type constants is not modified then sparse 
> complains about bitwise or-ing the operation type and a request flag, e.g. 
> REQ_OP_WRITE | REQ_FUA.
>
> I'm not sure how to solve this other than by modifying the functions that 
> accept an 'opf' argument into accepting an additional argument (enum 
> req_opf op + blk_mq_opf_t op_flags).

I actually always though of one type for the operation plus flags
as we basically always use the together.  That might still run into
a lot of problems, but is definitively way simpler and matches how
all the argument passing actually works.



[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