Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove two diffs that have been committed

  • Loading branch information...
commit fcd3131eed7a92ca5aa0c5ffbe4ad5a4ac05936f 1 parent 0baec6c
@mdempsky authored
Showing with 0 additions and 231 deletions.
  1. +0 −101 patches/file-flags-mark-defer.diff
  2. +0 −130 patches/unix-seqpacket.diff
View
101 patches/file-flags-mark-defer.diff
@@ -1,101 +0,0 @@
-This diff moves the kernel-only FMARK and FDEFER flags from the fully
-utilized and only 16-bit f_flag field to the grossly under-utilized
-and 32-bit f_iflags field.
-
-Index: sys/fcntl.h
-===================================================================
-RCS file: /home/mdempsky/anoncvs/cvs/src/sys/sys/fcntl.h,v
-retrieving revision 1.11
-diff -u -p -r1.11 fcntl.h
---- sys/fcntl.h 24 Nov 2007 12:59:28 -0000 1.11
-+++ sys/fcntl.h 26 Jun 2011 06:07:15 -0000
-@@ -92,8 +92,6 @@
- #define O_TRUNC 0x0400 /* truncate to zero length */
- #define O_EXCL 0x0800 /* error if already exists */
- #ifdef _KERNEL
--#define FMARK 0x1000 /* mark during gc() */
--#define FDEFER 0x2000 /* defer for next gc pass */
- #define FHASLOCK 0x4000 /* descriptor holds advisory lock */
- #endif
-
-Index: sys/file.h
-===================================================================
-RCS file: /home/mdempsky/anoncvs/cvs/src/sys/sys/file.h,v
-retrieving revision 1.27
-diff -u -p -r1.27 file.h
---- sys/file.h 19 Jul 2010 23:00:15 -0000 1.27
-+++ sys/file.h 26 Jun 2011 06:07:46 -0000
-@@ -88,6 +88,8 @@ struct file {
-
- #define FIF_WANTCLOSE 0x01 /* a close is waiting for usecount */
- #define FIF_LARVAL 0x02 /* not fully constructed, don't use */
-+#define FIF_MARK 0x04 /* mark during gc() */
-+#define FIF_DEFER 0x08 /* defer for next gc pass */
-
- #define FILE_IS_USABLE(fp) \
- (((fp)->f_iflags & (FIF_WANTCLOSE|FIF_LARVAL)) == 0)
-Index: kern/uipc_usrreq.c
-===================================================================
-RCS file: /home/mdempsky/anoncvs/cvs/src/sys/kern/uipc_usrreq.c,v
-retrieving revision 1.51
-diff -u -p -r1.51 uipc_usrreq.c
---- kern/uipc_usrreq.c 17 May 2011 00:17:01 -0000 1.51
-+++ kern/uipc_usrreq.c 26 Jun 2011 06:06:51 -0000
-@@ -818,21 +818,21 @@ unp_gc(void)
- unp_gcing = 1;
- unp_defer = 0;
- LIST_FOREACH(fp, &filehead, f_list)
-- fp->f_flag &= ~(FMARK|FDEFER);
-+ fp->f_iflags &= ~(FIF_MARK|FIF_DEFER);
- do {
- LIST_FOREACH(fp, &filehead, f_list) {
-- if (fp->f_flag & FDEFER) {
-- fp->f_flag &= ~FDEFER;
-+ if (fp->f_iflags & FIF_DEFER) {
-+ fp->f_iflags &= ~FIF_DEFER;
- unp_defer--;
- } else {
- if (fp->f_count == 0)
- continue;
-- if (fp->f_flag & FMARK)
-+ if (fp->f_iflags & FIF_MARK)
- continue;
- if (fp->f_count == fp->f_msgcount)
- continue;
- }
-- fp->f_flag |= FMARK;
-+ fp->f_iflags |= FIF_MARK;
-
- if (fp->f_type != DTYPE_SOCKET ||
- (so = (struct socket *)fp->f_data) == NULL)
-@@ -904,7 +904,7 @@ unp_gc(void)
- nextfp = LIST_NEXT(fp, f_list);
- if (fp->f_count == 0)
- continue;
-- if (fp->f_count == fp->f_msgcount && !(fp->f_flag & FMARK)) {
-+ if (fp->f_count == fp->f_msgcount && !(fp->f_iflags & FIF_MARK)) {
- *fpp++ = fp;
- nunref++;
- FREF(fp);
-@@ -968,17 +968,17 @@ unp_mark(struct file *fp)
- if (fp == NULL)
- return;
-
-- if (fp->f_flag & FMARK)
-+ if (fp->f_iflags & FIF_MARK)
- return;
-
-- if (fp->f_flag & FDEFER)
-+ if (fp->f_iflags & FIF_DEFER)
- return;
-
- if (fp->f_type == DTYPE_SOCKET) {
- unp_defer++;
-- fp->f_flag |= FDEFER;
-+ fp->f_iflags |= FIF_DEFER;
- } else {
-- fp->f_flag |= FMARK;
-+ fp->f_iflags |= FIF_MARK;
- }
- }
-
View
130 patches/unix-seqpacket.diff
@@ -1,130 +0,0 @@
-This diff adds support for SOCK_SEQPACKET to UNIX domain sockets.
-SOCK_SEQPACKET is identical to SOCK_STREAM, except that message
-boundaries are maintained similar to SOCK_DGRAM.
-
-Index: uipc_proto.c
-===================================================================
-RCS file: /home/mdempsky/anoncvs/cvs/src/sys/kern/uipc_proto.c,v
-retrieving revision 1.5
-diff -u -p -r1.5 uipc_proto.c
---- uipc_proto.c 5 Apr 2011 19:54:36 -0000 1.5
-+++ uipc_proto.c 23 Jun 2011 21:17:55 -0000
-@@ -55,6 +55,11 @@ struct protosw unixsw[] = {
- uipc_usrreq,
- 0, 0, 0, 0,
- },
-+{ SOCK_SEQPACKET,&unixdomain, PF_LOCAL, PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
-+ 0, 0, 0, 0,
-+ uipc_usrreq,
-+ 0, 0, 0, 0,
-+},
- { SOCK_DGRAM, &unixdomain, PF_LOCAL, PR_ATOMIC|PR_ADDR|PR_RIGHTS,
- 0, 0, 0, 0,
- uipc_usrreq,
-Index: uipc_usrreq.c
-===================================================================
-RCS file: /home/mdempsky/anoncvs/cvs/src/sys/kern/uipc_usrreq.c,v
-retrieving revision 1.51
-diff -u -p -r1.51 uipc_usrreq.c
---- uipc_usrreq.c 17 May 2011 00:17:01 -0000 1.51
-+++ uipc_usrreq.c 23 Jun 2011 21:38:17 -0000
-@@ -52,7 +52,7 @@
- * Unix communications domain.
- *
- * TODO:
-- * SEQPACKET, RDM
-+ * RDM
- * rethink name space problems
- * need a proper out-of-band
- */
-@@ -142,6 +142,7 @@ uipc_usrreq(struct socket *so, int req,
- /*NOTREACHED*/
-
- case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
- #define rcv (&so->so_rcv)
- #define snd (&so2->so_snd)
- if (unp->unp_conn == NULL)
-@@ -204,6 +205,7 @@ uipc_usrreq(struct socket *so, int req,
- }
-
- case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
- #define rcv (&so2->so_rcv)
- #define snd (&so->so_snd)
- if (so->so_state & SS_CANTSENDMORE) {
-@@ -223,7 +225,9 @@ uipc_usrreq(struct socket *so, int req,
- if (control) {
- if (sbappendcontrol(rcv, m, control))
- control = NULL;
-- } else
-+ } else if (so->so_type == SOCK_SEQPACKET)
-+ sbappendrecord(rcv, m);
-+ else
- sbappend(rcv, m);
- snd->sb_mbmax -=
- rcv->sb_mbcnt - unp->unp_conn->unp_mbcnt;
-@@ -250,9 +254,17 @@ uipc_usrreq(struct socket *so, int req,
-
- case PRU_SENSE:
- ((struct stat *) m)->st_blksize = so->so_snd.sb_hiwat;
-- if (so->so_type == SOCK_STREAM && unp->unp_conn != NULL) {
-- so2 = unp->unp_conn->unp_socket;
-- ((struct stat *) m)->st_blksize += so2->so_rcv.sb_cc;
-+ switch (so->so_type) {
-+ case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
-+ if (unp->unp_conn != NULL) {
-+ so2 = unp->unp_conn->unp_socket;
-+ ((struct stat *) m)->st_blksize +=
-+ so2->so_rcv.sb_cc;
-+ }
-+ break;
-+ default:
-+ break;
- }
- ((struct stat *) m)->st_dev = NODEV;
- if (unp->unp_ino == 0)
-@@ -328,6 +340,7 @@ unp_attach(struct socket *so)
- switch (so->so_type) {
-
- case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
- error = soreserve(so, unpst_sendspace, unpst_recvspace);
- break;
-
-@@ -511,6 +524,7 @@ unp_connect2(struct socket *so, struct s
- break;
-
- case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
- unp2->unp_conn = unp;
- soisconnected(so);
- soisconnected(so2);
-@@ -551,6 +565,7 @@ unp_disconnect(struct unpcb *unp)
- break;
-
- case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
- soisdisconnected(unp->unp_socket);
- unp2->unp_conn = NULL;
- soisdisconnected(unp2->unp_socket);
-@@ -570,9 +585,15 @@ unp_shutdown(struct unpcb *unp)
- {
- struct socket *so;
-
-- if (unp->unp_socket->so_type == SOCK_STREAM && unp->unp_conn &&
-- (so = unp->unp_conn->unp_socket))
-- socantrcvmore(so);
-+ switch (unp->unp_socket->so_type) {
-+ case SOCK_STREAM:
-+ case SOCK_SEQPACKET:
-+ if (unp->unp_conn && (so = unp->unp_conn->unp_socket))
-+ socantrcvmore(so);
-+ break;
-+ default:
-+ break;
-+ }
- }
-
- void
Please sign in to comment.
Something went wrong with that request. Please try again.