lkml.org 
[lkml]   [1999]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] arca-vm-2.2.5
   Date: 	Wed, 7 Apr 1999 00:19:36 +0200 (CEST)
From: Ingo Molnar <mingo@chiara.csoma.elte.hu>

On Tue, 6 Apr 1999, Stephen C. Tweedie wrote:

-#define i (((unsigned long) inode)/(sizeof(struct inode) \
& ~ (sizeof(struct inode) - 1)))
+#define i (((unsigned long) inode-PAGE_OFFSET)/(sizeof(struct inode) \
& ~ (sizeof(struct inode) - 1)))

...

btw. shouldnt it rather be something like:

#define log2(x) \

Look at the code just the 'i' in question will output :-)

mov inode, %o0
srlx %o0, 3, %o4

So on sparc64 atleast, it amounts to "inode >> 3". So:

(sizeof(struct inode) & ~ (sizeof(struct inode) - 1))

is 8 on sparc64. The 'i' construct is just meant to get rid of the
"non significant" lower bits of the inode pointer and it does so very
nicely. :-)

Later,
David S. Miller
davem@redhat.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.111 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site