diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2009-03-10 20:33:19 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-03-10 20:33:19 -0400 |
| commit | 78851e1aa4c3b796d5f0bb11b445016726302b44 (patch) | |
| tree | f3ab7900494d6e98d95211e90a5bcdcee66bd13b | |
| parent | ae46141ff08f1965b17c531b571953c39ce8b9e2 (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>
| -rw-r--r-- | include/linux/lockd/lockd.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index aa6fe7026de7..51855dfd8adb 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, | |||
| 346 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | 346 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 349 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | 350 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, |
| 350 | const struct sockaddr *sap2) | 351 | const struct sockaddr *sap2) |
| 351 | { | 352 | { |
| @@ -353,6 +354,13 @@ static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | |||
| 353 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | 354 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; |
| 354 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | 355 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); |
| 355 | } | 356 | } |
| 357 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
| 358 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
| 359 | const struct sockaddr *sap2) | ||
| 360 | { | ||
| 361 | return 0; | ||
| 362 | } | ||
| 363 | #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
| 356 | 364 | ||
| 357 | /* | 365 | /* |
| 358 | * Compare two host addresses | 366 | * Compare two host addresses |
