powerpc: Honor O_NONBLOCK flag when reading RTAS log
authorVitaly Mayatskikh <v.mayatskih@gmail.com>
Sun, 28 Sep 2008 23:24:33 +0000 (23:24 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 7 Oct 2008 03:26:21 +0000 (14:26 +1100)
commit76c31f239ea221a6c84bd26141262a43bfe8b7f4
treee93025a86c4c935d14a996b17aae572b9ded49dd
parent3396c72b92efd16bca16490a72277b3a494e0f0e
powerpc: Honor O_NONBLOCK flag when reading RTAS log

rtas_log_read() doesn't check file flags for O_NONBLOCK and blocks
non-blocking readers of /proc/ppc64/rtas/error_log when there is
no data available. This fixes it.

Also rtas_log_read() returns now with ENODATA to prevent suspending of
process in wait_event_interruptible() when logging facility was
switched off and log is already empty.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/rtasd.c