Skip to content

Commit

Permalink
ipc: drop ipc_lock_by_ptr
Browse files Browse the repository at this point in the history
After previous cleanups and optimizations, this function is no longer
heavily used and we don't have a good reason to keep it.  Update the few
remaining callers and get rid of it.

Signed-off-by: Davidlohr Bueso <[email protected]>
Cc: Sedat Dilek <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Manfred Spraul <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Davidlohr Bueso authored and torvalds committed Sep 11, 2013
1 parent 530fcd1 commit 32a2750
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion ipc/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
perm = idr_find(&ids->ipcs_idr, next_id);
if (perm == NULL)
continue;
ipc_lock_by_ptr(perm);
rcu_read_lock();
ipc_lock_object(perm);
free(ns, perm);
total++;
}
Expand Down
6 changes: 4 additions & 2 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ static struct kern_ipc_perm *ipc_findkey(struct ipc_ids *ids, key_t key)
continue;
}

ipc_lock_by_ptr(ipc);
rcu_read_lock();
ipc_lock_object(ipc);
return ipc;
}

Expand Down Expand Up @@ -838,7 +839,8 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
ipc = idr_find(&ids->ipcs_idr, pos);
if (ipc != NULL) {
*new_pos = pos + 1;
ipc_lock_by_ptr(ipc);
rcu_read_lock();
ipc_lock_object(ipc);
return ipc;
}
}
Expand Down
6 changes: 0 additions & 6 deletions ipc/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ static inline void ipc_assert_locked_object(struct kern_ipc_perm *perm)
assert_spin_locked(&perm->lock);
}

static inline void ipc_lock_by_ptr(struct kern_ipc_perm *perm)
{
rcu_read_lock();
ipc_lock_object(perm);
}

static inline void ipc_unlock(struct kern_ipc_perm *perm)
{
ipc_unlock_object(perm);
Expand Down

0 comments on commit 32a2750

Please sign in to comment.