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

2013-08-24 Thread Nicholas A. Bellinger
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: > >

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

2013-08-24 Thread Christoph Hellwig
> 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,

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

2013-08-24 Thread Christoph Hellwig
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,

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

2013-08-24 Thread Nicholas A. Bellinger
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

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

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This adds transport_generic_get_mem_bidi() to perform scatterlist allocation for bidirectional commands. Also, update transport_generic_new_cmd() to call this new function when SCF_BIDI has been set. v2 Changes: - Use SCF_COMPARE_AND_WRITE instead of CDB based check

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

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@daterainc.com This adds transport_generic_get_mem_bidi() to perform scatterlist allocation for bidirectional commands. Also, update transport_generic_new_cmd() to call this new function when SCF_BIDI has been set. v2 Changes: - Use SCF_COMPARE_AND_WRITE instead