From: Ricardo M. Correia Date: Wed, 25 Feb 2009 21:06:15 +0000 (+0000) Subject: Changed ptob()/btop() mult/div into bit shifts. X-Git-Tag: spl-0.4.3~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb7c7f44e8b7630f027cf92e0490062428f7fced;p=spl Changed ptob()/btop() mult/div into bit shifts. Added necessary include for PAGE_SHIFT. --- diff --git a/include/sys/param.h b/include/sys/param.h index d6b4f76..dbcdb6e 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -1,8 +1,10 @@ #ifndef _SPL_PARAM_H #define _SPL_PARAM_H +#include + /* Pages to bytes and back */ -#define ptob(pages) (pages * PAGE_SIZE) -#define btop(bytes) (bytes / PAGE_SIZE) +#define ptob(pages) (pages << PAGE_SHIFT) +#define btop(bytes) (bytes >> PAGE_SHIFT) #endif /* SPL_PARAM_H */