Skip to content

Commit

Permalink
ipc: sem_putref() does not need the semaphore lock any more
Browse files Browse the repository at this point in the history
ipc_rcu_putref() uses atomics for the refcount, and the games to lock
and unlock the semaphore just to try to keep the reference counting
working are no longer useful.

Acked-by: Davidlohr Bueso <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed May 4, 2013
1 parent 6d49dab commit 73b2950
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ static inline void sem_lock_and_putref(struct sem_array *sma)

static inline void sem_putref(struct sem_array *sma)
{
sem_lock_and_putref(sma);
sem_unlock(sma, -1);
rcu_read_unlock();
ipc_rcu_putref(sma);
}

static inline void sem_rmid(struct ipc_namespace *ns, struct sem_array *s)
Expand Down

0 comments on commit 73b2950

Please sign in to comment.