Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756073Ab3HXXhM (ORCPT ); Sat, 24 Aug 2013 19:37:12 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:46771 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755911Ab3HXXhK (ORCPT ); Sat, 24 Aug 2013 19:37:10 -0400 Message-ID: <1377387845.32763.149.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH-v2 06/12] target: Add memory allocation for bidirectional commands From: "Nicholas A. Bellinger" To: Christoph Hellwig Cc: "Nicholas A. Bellinger" , target-devel , lkml , linux-scsi , Christoph Hellwig , Hannes Reinecke , Martin Petersen , Chris Mason , Roland Dreier , James Bottomley Date: Sat, 24 Aug 2013 16:44:05 -0700 In-Reply-To: <20130824151817.GA15588@infradead.org> References: <1377147250-10125-1-git-send-email-nab@daterainc.com> <1377147250-10125-7-git-send-email-nab@daterainc.com> <20130824151817.GA15588@infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1079 Lines: 33 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/