Commit e6fb56b2 authored by Christian Göttsche's avatar Christian Göttsche Committed by Paul Moore
Browse files

selinux: add likely hints for fast paths



In the network hashtable lookup code add likely() compiler hints in the
fast path, like already done in sel_netif_sid().

Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 9cc034be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey_num, u32 *sid)

	rcu_read_lock();
	pkey = sel_ib_pkey_find(subnet_prefix, pkey_num);
	if (pkey) {
	if (likely(pkey)) {
		*sid = pkey->psec.sid;
		rcu_read_unlock();
		return 0;
+1 −1
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ int sel_netnode_sid(const void *addr, u16 family, u32 *sid)

	rcu_read_lock();
	node = sel_netnode_find(addr, family);
	if (node != NULL) {
	if (likely(node != NULL)) {
		*sid = node->nsec.sid;
		rcu_read_unlock();
		return 0;
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ int sel_netport_sid(u8 protocol, u16 pnum, u32 *sid)

	rcu_read_lock();
	port = sel_netport_find(protocol, pnum);
	if (port != NULL) {
	if (likely(port != NULL)) {
		*sid = port->psec.sid;
		rcu_read_unlock();
		return 0;