Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32a27500 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Linus Torvalds
Browse files

ipc: drop ipc_lock_by_ptr



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: default avatarDavidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 530fcd16
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -89,7 +89,8 @@ void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
		perm = idr_find(&ids->ipcs_idr, next_id);
		perm = idr_find(&ids->ipcs_idr, next_id);
		if (perm == NULL)
		if (perm == NULL)
			continue;
			continue;
		ipc_lock_by_ptr(perm);
		rcu_read_lock();
		ipc_lock_object(perm);
		free(ns, perm);
		free(ns, perm);
		total++;
		total++;
	}
	}
+4 −2
Original line number Original line Diff line number Diff line
@@ -205,7 +205,8 @@ static struct kern_ipc_perm *ipc_findkey(struct ipc_ids *ids, key_t key)
			continue;
			continue;
		}
		}


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


@@ -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);
		ipc = idr_find(&ids->ipcs_idr, pos);
		if (ipc != NULL) {
		if (ipc != NULL) {
			*new_pos = pos + 1;
			*new_pos = pos + 1;
			ipc_lock_by_ptr(ipc);
			rcu_read_lock();
			ipc_lock_object(ipc);
			return ipc;
			return ipc;
		}
		}
	}
	}
+0 −6
Original line number Original line Diff line number Diff line
@@ -171,12 +171,6 @@ static inline void ipc_assert_locked_object(struct kern_ipc_perm *perm)
	assert_spin_locked(&perm->lock);
	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)
static inline void ipc_unlock(struct kern_ipc_perm *perm)
{
{
	ipc_unlock_object(perm);
	ipc_unlock_object(perm);