From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ex.2n.cz ([213.29.92.11]) by bombadil.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id 1KcjNf-0005XR-Fa for linux-mtd@lists.infradead.org; Mon, 08 Sep 2008 16:14:23 +0000 Date: Mon, 8 Sep 2008 18:14:18 +0200 To: Grant Erickson Subject: Re: [PATCH 6/6] [MTD-UTILS] nandwrite: Add Support for Reading from Standard Input Message-ID: <20080908161418.GA7185@michl.2n.cz> References: <1220848159-22407-1-git-send-email-gerickson@nuovations.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1220848159-22407-1-git-send-email-gerickson@nuovations.com> From: Ladislav Michl Cc: Tommi Airikka , linux-mtd@lists.infradead.org, Richard Titmuss List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sun, Sep 07, 2008 at 09:29:19PM -0700, Grant Erickson wrote: > Added suppport for reading in band data from standard input based on a > patch originally generated by Richard Titmuss > at . > > Signed-off-by: Grant Erickson > --- > > In addition to the above patch, further discussion of this feature was > raised by Tommi Airikka at > . Hmm, so long I was defered with implementing this feature, that someone else did it :-) Anyway, let me raise few objections: - code uses lseek. Obviously, you cannot seek on pipe. - there is no need to use "invariant placeholder". What about simply read till file ends? - there is no need to use special case for reading from stdin... So what about: while (not eof) read page (and oob if selected) data into buffer next: if (write buffer fails) mark bad, select next page, goto next Reading from stdin would imply padding. Care to implement that? Best regards, ladis PS: It is remotely possible that one day I do it myself, but I'm notoriously slow on doing things I do not urgently need.