Re: [PATCH-v2 06/12] target: Add memory allocation for bidirectional commands

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

 



On Sat, 2013-08-24 at 08:18 -0700, Christoph Hellwig wrote:
> >  static int
> > +transport_generic_get_mem_bidi(struct se_cmd *cmd)
> 
> Except for the fields touched in struct se_cmd this is a duplication
> of transport_generic_get_mem.  I'd suggest to factor that one into
> a new helper:
> 
> static int
> target_alloc_sgl(struct scatterlist **sgl, unsigned int **nents,
> 		u32 length, gfp_t gfp_mask)
> {
> 	..
> }
> 
> and then call that one from transport_generic_new_cmd directly,

Sounds reasonable enough, doing that bit of refactoring now..

> including opencoding the actual BIDI case there as a first step.
> 

Not sure why this needs to be opencoded for BIDI, instead of just doing
target_alloc_sgl(&cmd->t_bidi_data_sg, ...) for the two SCF_BIDI ||
SCF_COMPARE_AND_WRITE cases in transport_generic_new_cmd()..?

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux