Author: adrian.chadd
Date: Fri Apr 3 19:55:11 2009
New Revision: 13905
Modified:
branches/LUSCA_HEAD/libiapp/comm.c
branches/LUSCA_HEAD/libiapp/fd.c
Log:
Migrate stuff thats not specifically -filedescriptor- oriented
out of fd.c and into comm.c.
Speifically, these are calls to:
* commClose() - which removes the events from the event notification method
(poll, kqueue, etc)
- specifically needed for devpoll!
* Migrate the delay pools stuff out, its 100% socket only stuff.
Now, this may break for those few instances where FD's are not being
treated correctly
as -comm- sockets (eg, the stuff that goes on in libiapp/disk.c) so the
next few
commits should be to introduce debugging to code to assert() where things
are being
used wrongly, and then to change those incorrect uses. :)
In any case, the next couple of commits will most likely be to exorcise out
the
last bits of the comm loop abuse in libiapp/disk.c. I'm not sure how though.
(For posterity - the comm loop is used for pipes, fifos and sockets (which
work)
and for sync disk IO calls (which return immediately, obviously) primarily
to
do the work during the next pass through the event loop. Breaking up the
disk work
to happen during subsequent passes through the comm layer is fine, but this
mess
of different FD API uses is not. Files should use file methods, not
FD_WRITE_METHOD/
FD_READ_METHOD directly, for example. Sigh.)
Modified: branches/LUSCA_HEAD/libiapp/comm.c
==============================================================================
--- branches/LUSCA_HEAD/libiapp/comm.c (original)
+++ branches/LUSCA_HEAD/libiapp/comm.c Fri Apr 3 19:55:11 2009
@@ -700,6 +700,11 @@
comm_close_finish(int fd)
{
sqinet_done(&fd_table[fd].local_address);
+ commClose(fd);
+#if DELAY_POOLS
+ if (fd_table[fd].slow_id)
+ commRemoveSlow(fd);
+#endif
fd_close(fd); /* update fdstat */
close(fd);
CommStats.syscalls.sock.closes++;
Modified: branches/LUSCA_HEAD/libiapp/fd.c
==============================================================================
--- branches/LUSCA_HEAD/libiapp/fd.c (original)
+++ branches/LUSCA_HEAD/libiapp/fd.c Fri Apr 3 19:55:11 2009
@@ -134,12 +134,7 @@
assert(F->write_handler == NULL);
}
debug(51, 3) ("fd_close FD %d %s\n", fd, F->desc);
- commClose(fd);
F->flags.open = 0;
-#if DELAY_POOLS
- if (F->slow_id)
- commRemoveSlow(fd);
-#endif
fdUpdateBiggest(fd, 0);
Number_FD--;
memset(F, '\0', sizeof(fde));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---