Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
details: https://anonhg.NetBSD.org/src/rev/76ccd7e9723d
branches: trunk
changeset: 828397:76ccd7e9723d
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Mon Dec 11 03:25:45 2017 +0000
description:
Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).
diffstat:
sys/net/if.c | 24 ++++++++++++------------
sys/net/if.h | 8 ++++----
sys/net/npf/npf_ifaddr.c | 8 ++++----
sys/net/npf/npf_os.c | 8 ++++----
4 files changed, 24 insertions(+), 24 deletions(-)
diffs (174 lines):
diff -r 373b3a2ed4fa -r 76ccd7e9723d sys/net/if.c
--- a/sys/net/if.c Mon Dec 11 02:33:17 2017 +0000
+++ b/sys/net/if.c Mon Dec 11 03:25:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.411 2017/12/08 05:22:23 ozaki-r Exp $ */
+/* $NetBSD: if.c,v 1.412 2017/12/11 03:25:45 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.411 2017/12/08 05:22:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.412 2017/12/11 03:25:45 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -732,9 +732,9 @@
ifp->if_ioctl_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
LIST_INIT(&ifp->if_multiaddrs);
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
if_getindex(ifp);
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
return 0;
@@ -781,10 +781,10 @@
if (ifp->if_transmit == NULL || ifp->if_transmit == if_nulltransmit)
ifp->if_transmit = if_transmit;
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
TAILQ_INSERT_TAIL(&ifnet_list, ifp, if_list);
IFNET_WRITER_INSERT_TAIL(ifp);
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
}
/*
@@ -1317,12 +1317,12 @@
if_deactivate(ifp);
mutex_exit(ifp->if_ioctl_lock);
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
ifindex2ifnet[ifp->if_index] = NULL;
TAILQ_REMOVE(&ifnet_list, ifp, if_list);
IFNET_WRITER_REMOVE(ifp);
pserialize_perform(ifnet_psz);
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
/* Wait for all readers to drain before freeing. */
psref_target_destroy(&ifp->if_psref, ifnet_psref_class);
@@ -1793,11 +1793,11 @@
ifa->ifa_ifp = ifp;
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
TAILQ_INSERT_TAIL(&ifp->if_addrlist, ifa, ifa_list);
IFADDR_ENTRY_INIT(ifa);
IFADDR_WRITER_INSERT_TAIL(ifp, ifa);
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
ifaref(ifa);
}
@@ -1808,13 +1808,13 @@
KASSERT(ifa->ifa_ifp == ifp);
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
TAILQ_REMOVE(&ifp->if_addrlist, ifa, ifa_list);
IFADDR_WRITER_REMOVE(ifa);
#ifdef NET_MPSAFE
pserialize_perform(ifnet_psz);
#endif
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
#ifdef NET_MPSAFE
psref_target_destroy(&ifa->ifa_psref, ifa_psref_class);
diff -r 373b3a2ed4fa -r 76ccd7e9723d sys/net/if.h
--- a/sys/net/if.h Mon Dec 11 02:33:17 2017 +0000
+++ b/sys/net/if.h Mon Dec 11 03:25:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.251 2017/12/08 05:22:23 ozaki-r Exp $ */
+/* $NetBSD: if.h,v 1.252 2017/12/11 03:25:45 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -1185,9 +1185,9 @@
} \
} while (0)
-#define IFNET_LOCK() mutex_enter(&ifnet_mtx)
-#define IFNET_UNLOCK() mutex_exit(&ifnet_mtx)
-#define IFNET_LOCKED() mutex_owned(&ifnet_mtx)
+#define IFNET_GLOBAL_LOCK() mutex_enter(&ifnet_mtx)
+#define IFNET_GLOBAL_UNLOCK() mutex_exit(&ifnet_mtx)
+#define IFNET_GLOBAL_LOCKED() mutex_owned(&ifnet_mtx)
#define IFNET_READER_EMPTY() \
(PSLIST_READER_FIRST(&ifnet_pslist, struct ifnet, if_pslist_entry) == NULL)
diff -r 373b3a2ed4fa -r 76ccd7e9723d sys/net/npf/npf_ifaddr.c
--- a/sys/net/npf/npf_ifaddr.c Mon Dec 11 02:33:17 2017 +0000
+++ b/sys/net/npf/npf_ifaddr.c Mon Dec 11 03:25:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_ifaddr.c,v 1.2 2017/01/03 00:58:05 rmind Exp $ */
+/* $NetBSD: npf_ifaddr.c,v 1.3 2017/12/11 03:25:46 ozaki-r Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_ifaddr.c,v 1.2 2017/01/03 00:58:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_ifaddr.c,v 1.3 2017/12/11 03:25:46 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -170,11 +170,11 @@
ifnet_t *ifp;
KERNEL_LOCK(1, NULL);
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
IFNET_WRITER_FOREACH(ifp) {
npf_ifaddr_sync(npf, ifp);
}
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
KERNEL_UNLOCK_ONE(NULL);
}
diff -r 373b3a2ed4fa -r 76ccd7e9723d sys/net/npf/npf_os.c
--- a/sys/net/npf/npf_os.c Mon Dec 11 02:33:17 2017 +0000
+++ b/sys/net/npf/npf_os.c Mon Dec 11 03:25:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_os.c,v 1.8 2017/11/17 07:37:12 ozaki-r Exp $ */
+/* $NetBSD: npf_os.c,v 1.9 2017/12/11 03:25:46 ozaki-r Exp $ */
/*-
* Copyright (c) 2009-2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef _KERNEL
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.8 2017/11/17 07:37:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.9 2017/12/11 03:25:46 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "pf.h"
@@ -313,11 +313,11 @@
ifnet_t *ifp;
KERNEL_LOCK(1, NULL);
- IFNET_LOCK();
+ IFNET_GLOBAL_LOCK();
IFNET_WRITER_FOREACH(ifp) {
ifp->if_pf_kif = arg;
}
- IFNET_UNLOCK();
+ IFNET_GLOBAL_UNLOCK();
KERNEL_UNLOCK_ONE(NULL);
}
Home |
Main Index |
Thread Index |
Old Index