powerpc/spufs: sputrace: Only enable logging on open(), prevent multiple openers
authorJeremy Kerr <jk@ozlabs.org>
Wed, 15 Oct 2008 02:16:18 +0000 (13:16 +1100)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 21 Oct 2008 00:12:54 +0000 (11:12 +1100)
commitbaf399273f2ea38e2fcbd4d0b6cc7ba7f7db43eb
tree02f5b1fcde3b32f3a64143c478c63685067d776e
parent04ab591808565f968d4406f6435090ad671ebdab
powerpc/spufs: sputrace: Only enable logging on open(), prevent multiple openers

Currently, sputrace will start logging to the event buffer before the
log buffer has been open()ed. This results in a heap of "lost samples"
warnings if the sputrace file hasn't yet been opened.

Since the buffer is reset on open() anyway, there's no need to enable
logging when no-one has opened the log.

Because open clears the log, make it return EBUSY for mutliple open
calls.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/sputrace.c