From ad89419cc6aa126364d86082a5b3f940f252278c Mon Sep 17 00:00:00 2001 From: provos Date: Mon, 24 Apr 2000 06:26:23 +0000 Subject: [PATCH] fix macros that calculated bitmap size for fdalloc. fries@ helped debugging. --- sys/sys/filedesc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index ce56b6206cb..e936413eac3 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: filedesc.h,v 1.7 2000/02/28 18:04:09 provos Exp $ */ +/* $OpenBSD: filedesc.h,v 1.8 2000/04/24 06:26:23 provos Exp $ */ /* $NetBSD: filedesc.h,v 1.14 1996/04/09 20:55:28 cgd Exp $ */ /* @@ -55,8 +55,9 @@ #define NDENTRIES 32 /* 32 fds per entry */ #define NDENTRYMASK (NDENTRIES - 1) #define NDENTRYSHIFT 5 /* bits per entry */ -#define NDLOSLOTS(x) (((x) + NDENTRIES - 1) >> NDENTRYSHIFT) -#define NDHISLOTS(x) ((NDLOSLOTS(x) + NDENTRIES - 1) >> NDENTRYSHIFT) +#define NDREDUCE(x) (((x) + NDENTRIES - 1) >> NDENTRYSHIFT) +#define NDHISLOTS(x) (NDREDUCE(NDREDUCE(x))) +#define NDLOSLOTS(x) (NDHISLOTS(x) << NDENTRYSHIFT) struct filedesc { struct file **fd_ofiles; /* file structures for open files */ -- 2.20.1