summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_usrreq.c24
-rw-r--r--sys/sys/fcntl.h6
-rw-r--r--sys/sys/file.h4
3 files changed, 17 insertions, 17 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index e7bd6e4e331..52861e3d610 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.51 2011/05/17 00:17:01 guenther Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.52 2011/06/28 10:15:38 thib Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -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,8 @@ 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 +969,14 @@ unp_mark(struct file *fp)
if (fp == NULL)
return;
- if (fp->f_flag & FMARK)
- return;
-
- if (fp->f_flag & FDEFER)
+ if (fp->f_iflags & (FIF_MARK|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;
}
}
diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h
index 15a12ad9dae..7a62f43efe3 100644
--- a/sys/sys/fcntl.h
+++ b/sys/sys/fcntl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fcntl.h,v 1.11 2007/11/24 12:59:28 jmc Exp $ */
+/* $OpenBSD: fcntl.h,v 1.12 2011/06/28 10:15:38 thib Exp $ */
/* $NetBSD: fcntl.h,v 1.8 1995/03/26 20:24:12 jtc Exp $ */
/*-
@@ -91,9 +91,9 @@
#define O_CREAT 0x0200 /* create if nonexistent */
#define O_TRUNC 0x0400 /* truncate to zero length */
#define O_EXCL 0x0800 /* error if already exists */
+
+/* XXX - FHASLOCK should be FIF_HASLOCK. */
#ifdef _KERNEL
-#define FMARK 0x1000 /* mark during gc() */
-#define FDEFER 0x2000 /* defer for next gc pass */
#define FHASLOCK 0x4000 /* descriptor holds advisory lock */
#endif
diff --git a/sys/sys/file.h b/sys/sys/file.h
index 8b7f00eae9c..30ecebe7628 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.h,v 1.27 2010/07/19 23:00:15 guenther Exp $ */
+/* $OpenBSD: file.h,v 1.28 2011/06/28 10:15:38 thib Exp $ */
/* $NetBSD: file.h,v 1.11 1995/03/26 20:24:13 jtc Exp $ */
/*
@@ -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)