diff options
author | jhb <jhb@FreeBSD.org> | 2006-07-19 18:26:09 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-07-19 18:26:09 +0000 |
commit | 35822ba820f283012cee418aab3b6e7111e888b8 (patch) | |
tree | d7dacebb4a85fa8bfcbad7b4d513ea0e3b750aa9 /sys/compat | |
parent | d4972b28e6465e6011b5e0dc4b8f36f604f685e5 (diff) | |
download | FreeBSD-src-35822ba820f283012cee418aab3b6e7111e888b8.zip FreeBSD-src-35822ba820f283012cee418aab3b6e7111e888b8.tar.gz |
Initialize svr4_head during MOD_LOAD rather than on demand.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/svr4/svr4_socket.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c index bae6e0c..e8dd79b 100644 --- a/sys/compat/svr4/svr4_socket.c +++ b/sys/compat/svr4/svr4_socket.c @@ -75,17 +75,6 @@ svr4_find_socket(td, fp, dev, ino) struct svr4_sockcache_entry *e; void *cookie = ((struct socket *)fp->f_data)->so_emuldata; - if (svr4_str_initialized != 2) { - if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) { - DPRINTF(("svr4_find_socket: uninitialized [%p,%d,%d]\n", - td, dev, ino)); - TAILQ_INIT(&svr4_head); - atomic_store_rel_int(&svr4_str_initialized, 2); - } - return NULL; - } - - DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino)); TAILQ_FOREACH(e, &svr4_head, entries) if (e->p == td->td_proc && e->dev == dev && e->ino == ino) { @@ -118,19 +107,6 @@ svr4_add_socket(td, path, st) mtx_lock(&Giant); - /* - * Wait for the TAILQ to be initialized. Only the very first CPU - * will succeed on the atomic_cmpset(). The other CPU's will spin - * until the first one finishes the initialization. Once the - * initialization is complete, the condition will always fail - * avoiding expensive atomic operations in the common case. - */ - while (svr4_str_initialized != 2) - if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) { - TAILQ_INIT(&svr4_head); - atomic_store_rel_int(&svr4_str_initialized, 2); - } - e = malloc(sizeof(*e), M_TEMP, M_WAITOK); e->cookie = NULL; e->dev = st->st_dev; |