From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760791AbXEJKr3 (ORCPT ); Thu, 10 May 2007 06:47:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758396AbXEJKrW (ORCPT ); Thu, 10 May 2007 06:47:22 -0400 Received: from brick.kernel.dk ([80.160.20.94]:5995 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758411AbXEJKrW (ORCPT ); Thu, 10 May 2007 06:47:22 -0400 Date: Thu, 10 May 2007 12:46:53 +0200 From: Jens Axboe To: Andrew Morton Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 7/13] i386 sg: add support for chaining scatterlists Message-ID: <20070510104653.GM4629@kernel.dk> References: <11787925152319-git-send-email-jens.axboe@oracle.com> <11787925162760-git-send-email-jens.axboe@oracle.com> <20070510034331.2d3e9410.akpm@linux-foundation.org> <20070510104454.GL4629@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070510104454.GL4629@kernel.dk> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 10 2007, Jens Axboe wrote: > Yeah, I'm inclined to agree. Perhaps it would be better to put this > stuff in lib/scatterlist.c or something like that instead? > > > > +/* > > > + * Chain previous sglist to this one > > > + */ > > > +static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, > > > + struct scatterlist *sgl) > > > +{ > > > +#ifndef ARCH_HAS_SG_CHAIN > > > + BUG(); > > > +#endif > > > > Can use BUILD_BUG_ON here. Or just #error. > > Good idea, thanks! No wait a second, that wont work. The code is always being built in sg scsi_lib.c, it should just not be called unless we can do chaining. We will never have a large number of segments that require chaining without ARCH_HAS_SG_CHAIN, so it'll never be called in that case. So it has to remain as it is, a BUG(). -- Jens Axboe