Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482Ab3HUGf1 (ORCPT ); Wed, 21 Aug 2013 02:35:27 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:42593 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461Ab3HUGfZ (ORCPT ); Wed, 21 Aug 2013 02:35:25 -0400 Date: Tue, 20 Aug 2013 23:35:24 -0700 From: Christoph Hellwig To: "Nicholas A. Bellinger" Cc: target-devel , lkml , linux-scsi , Christoph Hellwig , Hannes Reinecke , Martin Petersen , Chris Mason , James Bottomley , Nicholas Bellinger Subject: Re: [PATCH 6/9] target: Allow sbc_ops->execute_rw() to accept SGLs + data_direction Message-ID: <20130821063524.GH25506@infradead.org> References: <1377029280-19144-1-git-send-email-nab@daterainc.com> <1377029280-19144-7-git-send-email-nab@daterainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1377029280-19144-7-git-send-email-nab@daterainc.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 25 On Tue, Aug 20, 2013 at 08:07:57PM +0000, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > COMPARE_AND_WRITE expects to be able to send down a DMA_FROM_DEVICE > to obtain the necessary READ payload for comparision against the > first half of the WRITE payload containing the verify user data. > > Currently virtual backends expect to internally reference SGLs, > SGL nents, and data_direction, so change IBLOCK, FILEIO and RD > sbc_ops->execute_rw() to accept this values as function parameters. > > Also add the sbc_execute_rw() wrapper to handle the special case > for the initial COMPARE_AND_WRITE DMA_FROM_DEVICE -> READ I/O > submission. I don't like the way this is structured with the new method. It seems like we should just pass the sgl and associated data to execute_cmd and have the read vs write logic driven by command code, using generic flags instead of specificly checking for compare and write. -- 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/