From: Manfred Spraul Date: Thu, 22 May 2014 00:44:19 +0000 (+1000) Subject: ipc/sem.c: store which operation blocks in perform_atomic_semop() X-Git-Tag: next-20140530~2^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e7950b18a81621f518d45b04bb256ae4cf9893a5;p=karo-tx-linux.git ipc/sem.c: store which operation blocks in perform_atomic_semop() Preparation for the next patch: In the slow-path of perform_atomic_semop(), store a pointer to the operation that caused the operation to block. Signed-off-by: Manfred Spraul Cc: Davidlohr Bueso Cc: Michael Kerrisk Signed-off-by: Andrew Morton --- diff --git a/ipc/sem.c b/ipc/sem.c index b93b561842cd..d61362b31f1e 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -109,6 +109,7 @@ struct sem_queue { int pid; /* process id of requesting process */ int status; /* completion status of operation */ struct sembuf *sops; /* array of pending operations */ + struct sembuf *blocking; /* the operation that blocked */ int nsops; /* number of operations */ int alter; /* does *sops alter the array? */ }; @@ -642,6 +643,8 @@ out_of_range: goto undo; would_block: + q->blocking = sop; + if (sop->sem_flg & IPC_NOWAIT) result = -EAGAIN; else