From: Manfred Spraul Date: Fri, 6 Jun 2014 21:37:49 +0000 (-0700) Subject: ipc/sem.c: store which operation blocks in perform_atomic_semop() X-Git-Tag: v3.16-rc1~82^2~4^2~47 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ed247b7ca0d20b4528eec362f8435594818d7601;p=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 Signed-off-by: Linus Torvalds --- 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 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q) goto undo; would_block: + q->blocking = sop; + if (sop->sem_flg & IPC_NOWAIT) result = -EAGAIN; else