diff options
Diffstat (limited to 'include/linux/lockd')
-rw-r--r-- | include/linux/lockd/lockd.h | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index c325b187966b..a34dea46b629 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -338,49 +338,6 @@ static inline int nlm_privileged_requester(const struct svc_rqst *rqstp) | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | static inline int __nlm_cmp_addr4(const struct sockaddr *sap1, | ||
342 | const struct sockaddr *sap2) | ||
343 | { | ||
344 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
345 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
346 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
347 | } | ||
348 | |||
349 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
350 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
351 | const struct sockaddr *sap2) | ||
352 | { | ||
353 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
354 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
355 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | ||
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) */ | ||
364 | |||
365 | /* | ||
366 | * Compare two host addresses | ||
367 | * | ||
368 | * Return TRUE if the addresses are the same; otherwise FALSE. | ||
369 | */ | ||
370 | static inline int nlm_cmp_addr(const struct sockaddr *sap1, | ||
371 | const struct sockaddr *sap2) | ||
372 | { | ||
373 | if (sap1->sa_family == sap2->sa_family) { | ||
374 | switch (sap1->sa_family) { | ||
375 | case AF_INET: | ||
376 | return __nlm_cmp_addr4(sap1, sap2); | ||
377 | case AF_INET6: | ||
378 | return __nlm_cmp_addr6(sap1, sap2); | ||
379 | } | ||
380 | } | ||
381 | return 0; | ||
382 | } | ||
383 | |||
384 | /* | 341 | /* |
385 | * Compare two NLM locks. | 342 | * Compare two NLM locks. |
386 | * When the second lock is of type F_UNLCK, this acts like a wildcard. | 343 | * When the second lock is of type F_UNLCK, this acts like a wildcard. |
@@ -395,7 +352,7 @@ static inline int nlm_compare_locks(const struct file_lock *fl1, | |||
395 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); | 352 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); |
396 | } | 353 | } |
397 | 354 | ||
398 | extern struct lock_manager_operations nlmsvc_lock_operations; | 355 | extern const struct lock_manager_operations nlmsvc_lock_operations; |
399 | 356 | ||
400 | #endif /* __KERNEL__ */ | 357 | #endif /* __KERNEL__ */ |
401 | 358 | ||