From 7efe9640320ecb90c41483632ec34a778652644f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Tigeot?= Date: Sun, 29 Jul 2012 19:26:02 +0200 Subject: [PATCH 2/2] kernel: remove O_FRNONBLOCKING * Like O_ROOTCRED it was effectively unused and removing it frees up a precious bit among the various O_xxx flags * Partially fixes issue #2357 --- sys/kern/vfs_vnops.c | 4 +--- sys/sys/fcntl.h | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index ec8faba..9b28f66 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -647,9 +647,7 @@ vn_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags) vp = (struct vnode *)fp->f_data; ioflag = 0; - if (flags & O_FRNONBLOCKING) { - ioflag |= (IO_NDELAY | IO_NRDELAY); - } else if (flags & O_FBLOCKING) { + if (flags & O_FBLOCKING) { /* ioflag &= ~IO_NDELAY; */ } else if (flags & O_FNONBLOCKING) { ioflag |= IO_NDELAY; diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 2733b37..8566bb6 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -106,7 +106,6 @@ #define O_FUNBUFFERED 0x01000000 /* force unbuffered (direct) I/O */ #define O_FBUFFERED 0x02000000 /* force buffered I/O */ #define O_MAPONREAD 0x04000000 /* memory map read buffer */ -#define O_FRNONBLOCKING 0x08000000 /* nonblocking I/O no disk wait */ #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) #define FREVOKED 0x10000000 /* revoked by fdrevoke() */ @@ -117,7 +116,7 @@ #define O_FMASK (O_FBLOCKING|O_FNONBLOCKING|O_FAPPEND|O_FOFFSET|\ O_FSYNCWRITE|O_FASYNCWRITE|O_FUNBUFFERED|O_FBUFFERED|\ - O_MAPONREAD|O_FRNONBLOCKING) + O_MAPONREAD) #ifdef _KERNEL /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ -- 1.7.10.5