PERFORCE change 101798 for review
John Baldwin
jhb at FreeBSD.org
Mon Jul 17 20:30:12 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=101798
Change 101798 by jhb at jhb_mutex on 2006/07/17 20:29:26
- No lock needed for td_dupfd.
- Initialize svr4_head in MOD_LOAD catch svr4_socket up. (Why
is this function even in this file and not streams.c?)
Affected files ...
.. //depot/projects/smpng/sys/compat/svr4/svr4_socket.c#10 edit
.. //depot/projects/smpng/sys/dev/streams/streams.c#25 edit
Differences ...
==== //depot/projects/smpng/sys/compat/svr4/svr4_socket.c#10 (text+ko) ====
@@ -75,17 +75,6 @@
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) {
==== //depot/projects/smpng/sys/dev/streams/streams.c#25 (text+ko) ====
@@ -68,7 +68,7 @@
static int svr4_ptm_alloc(struct thread *);
static d_open_t streamsopen;
-struct svr4_sockcache_head svr4_head = TAILQ_HEAD_INITIALIZER(svr4_head);
+struct svr4_sockcache_head svr4_head;
/*
* Device minor numbers
@@ -86,8 +86,8 @@
dev_unix_ord_stream = 40
};
-static struct cdev *dt_ptm, *dt_arp, *dt_icmp, *dt_ip, *dt_tcp, *dt_udp, *dt_rawip,
- *dt_unix_dgram, *dt_unix_stream, *dt_unix_ord_stream;
+static struct cdev *dt_ptm, *dt_arp, *dt_icmp, *dt_ip, *dt_tcp, *dt_udp,
+ *dt_rawip, *dt_unix_dgram, *dt_unix_stream, *dt_unix_ord_stream;
static struct fileops svr4_netops = {
.fo_read = soo_read,
@@ -119,7 +119,7 @@
{
switch (type) {
case MOD_LOAD:
- /* XXX should make sure it isn't already loaded first */
+ TAILQ_INIT(&svr4_head);
dt_ptm = make_dev(&streams_cdevsw, dev_ptm, 0, 0, 0666,
"ptm");
dt_arp = make_dev(&streams_cdevsw, dev_arp, 0, 0, 0666,
@@ -274,9 +274,7 @@
(void)svr4_stream_get(fp);
fdrop(fp, td);
- PROC_LOCK(p);
td->td_dupfd = fd;
- PROC_UNLOCK(p);
return ENXIO;
}
@@ -318,9 +316,7 @@
case ENXIO:
return error;
case 0:
- PROC_LOCK(p);
td->td_dupfd = td->td_retval[0];
- PROC_UNLOCK(p);
return ENXIO;
default:
if (ttynumbers[++n] == '\0') {
More information about the p4-projects
mailing list