Skip to contentSkip to conversation

ext2/3: Support 2^32-1 blocks(Kernel)

PATCH Chuck Ebbert 1 participant 1 message Mar 26, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 1 line · Theodore Ts'o

Fix the i386 bitmap operations so they are 32-bit clean

...

Quoted 2 lines
lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 renamed from lib/ext2fs/bitops.h Sat Mar 25 01:42:02 2006 -0500 +0 -0

...

lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 line 184

Quoted 7 lines
lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 renamed from lib/ext2fs/bitops.h Sat Mar 25 01:42:02 2006 -0500 +1 -0
@@ -155,9 +179,10 @@
 {
      int oldbit;
 
+     addr = (void *) (((unsigned char *) addr) + (nr >> 3));
      __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0"
              :"=r" (oldbit),"=m" (EXT2FS_ADDR)
                                ^

This should be "+" because that data is both read and written
by the assembler instruction.

lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 line 195

Quoted 12 lines
lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 renamed from lib/ext2fs/bitops.h Sat Mar 25 01:42:02 2006 -0500 +2 -1
-             :"r" (nr));
+             :"r" (nr & 7));
      return oldbit;
 }
 
@@ -165,9 +190,10 @@
 {
      int oldbit;
 
+     addr = (void *) (((unsigned char *) addr) + (nr >> 3));
      __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0"
              :"=r" (oldbit),"=m" (EXT2FS_ADDR)
                                ^

Same here.

lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 line 198

Quoted 4 lines
lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500 renamed from lib/ext2fs/bitops.h Sat Mar 25 01:42:02 2006 -0500 +1 -1
-             :"r" (nr));
+             :"r" (nr & 7));
      return oldbit;
 }

See include/asm-i386/bitops.h where that has already been done (it's still wrong, but less so than before.)

Signature · 2 lines
Chuck
"Penguins don't come from next door, they come from the Antarctic!"