From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.nokia.com ([192.100.122.230] helo=mgw-mx03.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LjugK-0004kE-Ih for linux-mtd@lists.infradead.org; Wed, 18 Mar 2009 12:15:43 +0000 Message-ID: <49C0E604.9040501@nokia.com> Date: Wed, 18 Mar 2009 14:16:04 +0200 From: Adrian Hunter MIME-Version: 1.0 To: Josh Boyer Subject: Re: [PATCH] [MTD] mtd-utils: Use new 64-bit ioctls to access >4GiB devices References: <20090318120652.GB2381@yoda.jdub.homelinux.org> In-Reply-To: <20090318120652.GB2381@yoda.jdub.homelinux.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "linux-mtd@lists.infradead.org" , Ricard Wanderlof List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Josh Boyer wrote: > On Wed, Mar 18, 2009 at 08:50:08AM +0100, Ricard Wanderlof wrote: >> On Wed, 18 Mar 2009, Kevin Cernekee wrote: >> >>> This patch depends on "CORE: New ioctl calls for >4GiB device support". >>> >>> Use the new kernel ioctls to support >4GiB flash devices in mtd-utils. >>> - if(ioctl(Fd,MEMGETREGIONINFO,&(reginfo[i])) != 0) >>> + if(ioctl(Fd,MEMGETREGIONINFO64,&(reginfo[i])) != 0) >> Wouldn't it be an idea to support both the old and new calls for a while >> (using compile time switching), in case someone wants to grab a newer >> version of mtdtools but doesn't have a newer kernel for whatever reason? > > Yes, it would. In fact, it would be better to probably add a new > --large-device (or similar) option to all the utilities so that > they can use both with a runtime switch. I would suggest just trying MEMGETINFO64 and if it returns ENOTTY then switch to the old ioctls.