Message ID | 20200629072021.9864-1-hare@suse.de |
---|---|
Headers | show |
Series | scsi: enable reserved commands for LLDDs | expand |
On 6/29/20 3:08 PM, John Garry wrote: > >> return fibptr; >> } >> @@ -240,36 +231,28 @@ struct fib *aac_fib_alloc_tag(struct aac_dev >> *dev, struct scsi_cmnd *scmd) >> /** >> * aac_fib_alloc - allocate a fib >> * @dev: Adapter to allocate the fib for >> + * @direction: DMA data direction >> * >> * Allocate a fib from the adapter fib pool. If the pool is empty we >> * return NULL. >> */ >> -struct fib *aac_fib_alloc(struct aac_dev *dev) >> +struct fib *aac_fib_alloc(struct aac_dev *dev, int direction) >> { >> - struct fib * fibptr; >> + struct scsi_cmnd *scmd; >> + struct fib * fibptr = NULL; >> unsigned long flags; >> + >> spin_lock_irqsave(&dev->fib_lock, flags); > > Do you still require this spinlock'ing? > No, indeed not. Will be removing them. Cheers, Hannes
On 02/07/2020 09:21, Johannes Thumshirn wrote: > On 02/07/2020 09:59, Hannes Reinecke wrote: >> That's one of the best-kept secrets in the block layer: >> >> op_is_write() >> >> The assumption is that every request with a REQ_OP which has the lowest >> bit set is a write. >> And quite a lot of accounting the the block layer revolves around that. >> So we'll need to keep it. >> >> ... and we probably should document it somewhere. > Now that I check further, it is documented in blk_types.h: * The least significant bit of the operation number indicates the data * transfer direction: * * - if the least significant bit is set transfers are TO the device * - if the least significant bit is not set transfers are FROM the device * > I personally find this very obvious: > > static inline bool op_is_write(unsigned int op) > { > return (op & 1); > } > > . >