[PATCH 6/6] [MTD-UTILS] nandwrite: Add Support for Reading from Standard Input

Ladislav Michl ladis at linux-mips.org
Mon Sep 8 12:14:18 EDT 2008


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 <titmuss at slimdevices.com>
> at <http://lists.slimdevices.com/pipermail/jive-checkins/2008-May/001918.html>.
> 
> Signed-off-by: Grant Erickson <gerickson at nuovations.com>
> ---
> 
> In addition to the above patch, further discussion of this feature was
> raised by Tommi Airikka <tommi.airikka at ericsson.com> at
> <http://lists.infradead.org/pipermail/linux-mtd/2008-September/022913.html>.

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.



More information about the linux-mtd mailing list