From eb7c7f44e8b7630f027cf92e0490062428f7fced Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Wed, 25 Feb 2009 21:06:15 +0000 Subject: Changed ptob()/btop() mult/div into bit shifts. Added necessary include for PAGE_SHIFT. --- include/sys/param.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sys/param.h b/include/sys/param.h index d6b4f761f..dbcdb6e9c 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 */ -- cgit v1.2.3