summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-08-17 17:28:10 +0000
committerbde <bde@FreeBSD.org>1998-08-17 17:28:10 +0000
commitfaebf197e2d7de25dfa6b0a50d7ac5291470b4e6 (patch)
tree864c35d909dcc8c685770ea33f7bb120b76a6496 /sys/kern/vfs_aio.c
parent5b84dcbd90c00243d3d0d763446294e23b44ec4a (diff)
downloadFreeBSD-src-faebf197e2d7de25dfa6b0a50d7ac5291470b4e6.zip
FreeBSD-src-faebf197e2d7de25dfa6b0a50d7ac5291470b4e6.tar.gz
Fixed nonsense overflow checking (checking that a long variable is less
than INT_MAX after it has possibly overflowed). Removed an unused variable and its associated 2 style bugs. Removed unused includes.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index cdd3340..89e5a58 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -13,7 +13,7 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: vfs_aio.c,v 1.31 1998/07/05 20:33:18 julian Exp $
+ * $Id: vfs_aio.c,v 1.32 1998/07/15 06:51:14 bde Exp $
*/
/*
@@ -30,8 +30,7 @@
#include <sys/lock.h>
#include <sys/unistd.h>
#include <sys/proc.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
+#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
@@ -46,7 +45,6 @@
#include <vm/vm_zone.h>
#include <sys/aio.h>
#include <sys/shm.h>
-#include <sys/user.h>
#include <machine/cpu.h>
#include <machine/limits.h>
@@ -541,7 +539,6 @@ aio_process(struct aiocblist *aiocbe)
struct iovec aiov;
unsigned int fd;
int cnt;
- static nperline=0;
int error;
off_t offset;
int oublock_st, oublock_end;
@@ -1277,9 +1274,10 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type)
}
aiocbe->uaiocb._aiocb_private.kernelinfo = (void *)(intptr_t)jobrefid;
- jobrefid++;
- if (jobrefid > INT_MAX)
+ if (jobrefid == LONG_MAX)
jobrefid = 1;
+ else
+ jobrefid++;
if (opcode == LIO_NOP) {
TAILQ_INSERT_HEAD(&aio_freejobs, aiocbe, list);
OpenPOWER on IntegriCloud