]> Git Repo - linux.git/commitdiff
ipc/sem.c: store which operation blocks in perform_atomic_semop()
authorManfred Spraul <[email protected]>
Fri, 6 Jun 2014 21:37:49 +0000 (14:37 -0700)
committerLinus Torvalds <[email protected]>
Fri, 6 Jun 2014 23:08:15 +0000 (16:08 -0700)
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 <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
ipc/sem.c

index b93b561842cdf86a1ed52ba575151980b9d13d5f..d61362b31f1ebf996492d5bdf6644aef25b0310c 100644 (file)
--- 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
This page took 0.057565 seconds and 4 git commands to generate.