aboutsummaryrefslogtreecommitdiff
path: root/include/linux/lockd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-03-10 20:33:19 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-10 20:33:19 -0400
commit78851e1aa4c3b796d5f0bb11b445016726302b44 (patch)
treef3ab7900494d6e98d95211e90a5bcdcee66bd13b /include/linux/lockd
parentae46141ff08f1965b17c531b571953c39ce8b9e2 (diff)
NLM: Shrink the IPv4-only version of nlm_cmp_addr()
Clean up/micro-optimatization: Make the AF_INET-only version of nlm_cmp_addr() smaller. This matches the style of nlm_privileged_requester(), and makes the AF_INET-only version of nlm_cmp_addr() nearly the same size as it was before IPv6 support. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/lockd')
-rw-r--r--include/linux/lockd/lockd.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index aa6fe7026de..51855dfd8ad 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -346,6 +346,7 @@ static inline int __nlm_cmp_addr4(const struct sockaddr *sap1,
return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
}
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
const struct sockaddr *sap2)
{
@@ -353,6 +354,13 @@ static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
}
+#else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
+static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
+ const struct sockaddr *sap2)
+{
+ return 0;
+}
+#endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
/*
* Compare two host addresses