diff options
author | Russ Cox <rsc@swtch.com> | 2007-09-24 22:33:34 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2007-09-24 22:33:34 -0400 |
commit | 67a65bbaa5df3751206eca4fd0c2db359095800f (patch) | |
tree | 1d6b2e2f9c6b9c7c8c8525ea3ad1d411368e0199 /src/cmd/venti | |
parent | c1edcb95cf02a22ae08dad2127262ca009005fad (diff) | |
download | plan9port-67a65bbaa5df3751206eca4fd0c2db359095800f.tar.gz plan9port-67a65bbaa5df3751206eca4fd0c2db359095800f.tar.bz2 plan9port-67a65bbaa5df3751206eca4fd0c2db359095800f.zip |
venti: formatting changes in fixarenas
Diffstat (limited to 'src/cmd/venti')
-rw-r--r-- | src/cmd/venti/srv/fixarenas.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/venti/srv/fixarenas.c b/src/cmd/venti/srv/fixarenas.c index 009c8e27..fd9dccc5 100644 --- a/src/cmd/venti/srv/fixarenas.c +++ b/src/cmd/venti/srv/fixarenas.c @@ -15,6 +15,8 @@ #include "fns.h" #include "whack.h" +#define ROUNDUP(x,n) (((x)+(n)-1)&~((n)-1)) + #pragma varargck type "z" uvlong #pragma varargck type "z" vlong #pragma varargck type "t" uint @@ -793,8 +795,8 @@ guessgeometry(void) } ap.arenabase = bestdiff; } - - ap.tabbase = (PartBlank+HeadSize+ap.blocksize-1)&~(ap.blocksize-1); + + ap.tabbase = ROUNDUP(PartBlank+HeadSize, ap.blocksize); /* * XXX pick up table, check arenabase. * XXX pick up table, record base name. @@ -806,7 +808,7 @@ guessgeometry(void) */ if(ap.arenabase == 0){ for(i=0; i<nelem(tabsizes); i++){ - ap.arenabase = (PartBlank+HeadSize+tabsizes[i]+ap.blocksize-1)&~(ap.blocksize-1); + ap.arenabase = ROUNDUP(PartBlank+HeadSize, ap.blocksize); p = pagein(ap.arenabase, Block); if(u32(p) == ArenaHeadMagic) break; |