From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 2/2] [block]: Skip refresh_total_sectors() for scsi-generic devices Date: Sun, 16 May 2010 15:30:22 +0200 Message-ID: <20100516133022.GB27075@lst.de> References: <1273930259-12694-1-git-send-email-nab@linux-iscsi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Kevin Wolf , Christoph Hellwig , Gerd Hoffmann , Hannes Reinecke , kvm-devel , qemu-devel To: "Nicholas A. Bellinger" Return-path: Received: from verein.lst.de ([213.95.11.210]:36801 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605Ab0EPNak (ORCPT ); Sun, 16 May 2010 09:30:40 -0400 Content-Disposition: inline In-Reply-To: <1273930259-12694-1-git-send-email-nab@linux-iscsi.org> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, May 15, 2010 at 06:30:59AM -0700, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch adds a BlockDriverState->sg check in block.c:bdrv_common_open() > to skip the new refresh_total_sectors() call once we know we are working with > a scsi-generic device. > > We go ahead and skip this call for scsi-generic devices because > block/raw-posix.c:raw_getlength() -> lseek() will return -ESPIPE. How about moving that check into refresh_total_sectors?