diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-12-22 16:25:50 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-12-22 16:25:50 +0000 |
commit | 10eee285f7682f9330e17198c966a66665e119d6 (patch) | |
tree | 12ff436fda22d2c0efef46bc2c11a23259c056c1 /sys/fs/devfs | |
parent | 9168f082588b1fcbc8d398fb7c78d7d2b9b8405c (diff) | |
download | src-10eee285f7682f9330e17198c966a66665e119d6.tar.gz src-10eee285f7682f9330e17198c966a66665e119d6.zip |
Shuffle numeric values of the IO_* flags to match the O_* flags from
fcntl.h.
This is in preparation for making the flags passed to device drivers be
consistently from fcntl.h for all entrypoints.
Today open, close and ioctl uses fcntl.h flags, while read and write
uses vnode.h flags.
Notes
Notes:
svn path=/head/; revision=139188
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 2ffaa1389d9f..b75caa6af0a7 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1435,3 +1435,16 @@ static struct vop_vector devfs_specops = { .vop_symlink = VOP_PANIC, .vop_write = VOP_PANIC, }; + +/* + * Our calling convention to the device drivers used to be that we passed + * vnode.h IO_* flags to read()/write(), but we're moving to fcntl.h O_ + * flags instead since that's what open(), close() and ioctl() takes and + * we don't really want vnode.h in device drivers. + * We solved the source compatibility by redefining some vnode flags to + * be the same as the fcntl ones and by sending down the bitwise OR of + * the respective fcntl/vnode flags. These CTASSERTS make sure nobody + * pulls the rug out under this. + */ +CTASSERT(O_NONBLOCK == IO_NDELAY); +CTASSERT(O_FSYNC == IO_SYNC); |