summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_blkio.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2001-10-26 12:03:27 +0000
committerart <art@openbsd.org>2001-10-26 12:03:27 +0000
commitaf97e5cfdd9f3b11ddf6b53127c6fa8808c13864 (patch)
tree196c0184f49baa99376ee4bc29405db139ede540 /sys/compat/linux/linux_blkio.c
parentWell, "zap kernfs" and MISS! (diff)
downloadwireguard-openbsd-af97e5cfdd9f3b11ddf6b53127c6fa8808c13864.tar.xz
wireguard-openbsd-af97e5cfdd9f3b11ddf6b53127c6fa8808c13864.zip
- every new fd created by falloc() is marked as larval and should not be used
any anyone. Every caller of falloc matures the fd when it's usable. - Since every lookup in the fd table must now check this flag and all of them do the same thing, move all the necessary checks into a function - fd_getfile.
Diffstat (limited to 'sys/compat/linux/linux_blkio.c')
-rw-r--r--sys/compat/linux/linux_blkio.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/compat/linux/linux_blkio.c b/sys/compat/linux/linux_blkio.c
index 41e9e7c8817..b09dc192aa9 100644
--- a/sys/compat/linux/linux_blkio.c
+++ b/sys/compat/linux/linux_blkio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_blkio.c,v 1.1 2001/04/09 06:53:44 tholo Exp $ */
+/* $OpenBSD: linux_blkio.c,v 1.2 2001/10/26 12:03:27 art Exp $ */
/* $NetBSD: linux_blkio.c,v 1.3 2001/01/18 17:48:04 tv Exp $ */
/*
@@ -69,18 +69,8 @@ linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
struct disklabel label;
fdp = p->p_fd;
-#if 1
- if ((u_int)SCARG(uap, fd) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL)
+ if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
-#else
- if ((u_int)SCARG(uap, fd) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL ||
- (fp->f_iflags & FIF_WANTCLOSE) != 0)
- return (EBADF);
-
- FILE_USE(fp);
-#endif
error = 0;
ioctlf = fp->f_ops->fo_ioctl;
com = SCARG(uap, com);