From: Muli Ben-Yehuda <mulix@mulix.org>

Shed some much-needed light.


 include/linux/mman.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -puN include/linux/mman.h~calc_vm_trans-commentary include/linux/mman.h
--- 25/include/linux/mman.h~calc_vm_trans-commentary	2003-10-02 07:47:50.000000000 -0700
+++ 25-akpm/include/linux/mman.h	2003-10-02 07:47:50.000000000 -0700
@@ -28,8 +28,13 @@ static inline void vm_unacct_memory(long
 	vm_acct_memory(-pages);
 }
 
-/* Optimisation macro. */
-#define _calc_vm_trans(x,bit1,bit2) \
+/*
+ * Optimisation macro.  It is equivalent to:
+ *      (x & bit1) ? bit2 : 0
+ * but this version is faster.
+ * ("bit1" and "bit2" must be single bits)
+ */
+#define _calc_vm_trans(x, bit1, bit2) \
   ((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \
    : ((x) & (bit1)) / ((bit1) / (bit2)))
 

_