switch_log
kfree(ctx->switch_log);
return (ctx->switch_log->head - ctx->switch_log->tail) %
if (ctx->switch_log) {
ctx->switch_log = kmalloc_flex(*ctx->switch_log, log,
if (!ctx->switch_log) {
ctx->switch_log->head = ctx->switch_log->tail = 0;
init_waitqueue_head(&ctx->switch_log->wait);
kfree(ctx->switch_log);
ctx->switch_log = NULL;
p = ctx->switch_log->log + ctx->switch_log->tail % SWITCH_LOG_BUFSIZE;
error = spufs_wait(ctx->switch_log->wait,
ctx->switch_log->tail =
(ctx->switch_log->tail + 1) %
poll_wait(file, &ctx->switch_log->wait, wait);
if (!ctx->switch_log)
p = ctx->switch_log->log + ctx->switch_log->head;
ctx->switch_log->head =
(ctx->switch_log->head + 1) % SWITCH_LOG_BUFSIZE;
wake_up(&ctx->switch_log->wait);
struct switch_log *switch_log;