diff options
| author | ozaki-r <ozaki-r@NetBSD.org> | 2017-03-14 09:03:08 +0000 |
|---|---|---|
| committer | ozaki-r <ozaki-r@NetBSD.org> | 2017-03-14 09:03:08 +0000 |
| commit | 49c4be2fa92aa73eb1f26c9e50f4d237f5e9fb81 (patch) | |
| tree | 7f56488f8375583f1184f34f8e78e9893c916832 /sys/compat/linux/common/linux_socket.c | |
| parent | fb6ed68a49041a8d1ace3421f8299ec1bb1e20bb (diff) | |
Use if_acquire and if_release instead of using psref API directly
- Provide if_release for consistency to if_acquire
- Use if_acquire and if_release for ifp iterations
- Make ifnet_psref_class static
Diffstat (limited to 'sys/compat/linux/common/linux_socket.c')
| -rw-r--r-- | sys/compat/linux/common/linux_socket.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c index 4d01796de2c..6b646318422 100644 --- a/sys/compat/linux/common/linux_socket.c +++ b/sys/compat/linux/common/linux_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.137 2017/02/03 16:57:39 christos Exp $ */ +/* $NetBSD: linux_socket.c,v 1.138 2017/03/14 09:03:08 ozaki-r Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.137 2017/02/03 16:57:39 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138 2017/03/14 09:03:08 ozaki-r Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1143,7 +1143,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data) s = pserialize_read_enter(); IFNET_READER_FOREACH(ifp) { struct ifaddr *ifa; - psref_acquire(&psref, &ifp->if_psref, ifnet_psref_class); + if_acquire(ifp, &psref); (void)strncpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)); @@ -1179,7 +1179,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data) ifa_release(ifa, &psref_ifa); } - psref_release(&psref, &ifp->if_psref, ifnet_psref_class); + if_release(ifp, &psref); } pserialize_read_exit(s); curlwp_bindx(bound); @@ -1193,7 +1193,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data) release_exit: pserialize_read_exit(s); - psref_release(&psref, &ifp->if_psref, ifnet_psref_class); + if_release(ifp, &psref); curlwp_bindx(bound); return error; } |
