[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130824151817.GA15588@infradead.org>
Date: Sat, 24 Aug 2013 08:18:17 -0700
From: Christoph Hellwig <hch@...radead.org>
To: "Nicholas A. Bellinger" <nab@...erainc.com>
Cc: target-devel <target-devel@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>,
linux-scsi <linux-scsi@...r.kernel.org>,
Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>,
Martin Petersen <martin.petersen@...cle.com>,
Chris Mason <chris.mason@...ionio.com>,
Roland Dreier <roland@...estorage.com>,
James Bottomley <JBottomley@...allels.com>,
Nicholas Bellinger <nab@...ux-iscsi.org>
Subject: Re: [PATCH-v2 06/12] target: Add memory allocation for bidirectional
commands
> 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,
including opencoding the actual BIDI case there as a first step.
If we go down your proposed route for COMPARE and WRITE we'd also
allocate that buffer there, although I think there is a more elegant
way to do that, but more on that later.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists