Whamcloud - gitweb
Add EXT_UNSET_BLOCK
authorgirish <girish>
Thu, 14 Aug 2008 14:47:06 +0000 (14:47 +0000)
committergirish <girish>
Thu, 14 Aug 2008 14:47:06 +0000 (14:47 +0000)
b=16114
i=adilger
i=kalpak.shah

ldiskfs/kernel_patches/patches/ext3-extents-2.6.16-sles10.patch
ldiskfs/kernel_patches/patches/ext3-extents-2.6.18-vanilla.patch

index f1f94f2..2153a9b 100644 (file)
@@ -970,7 +970,7 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/extents.c
 +}
 +
 +/*
-+ * returns first allocated block from next leaf or EXT_MAX_BLOCK
++ * returns first allocated block from next leaf or EXT_UNSET_BLOCK
 + */
 +static unsigned ext3_ext_next_leaf_block(struct ext3_extents_tree *tree,
 +                                       struct ext3_ext_path *path)
@@ -982,7 +982,7 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/extents.c
 +
 +      /* zero-tree has no leaf blocks at all */
 +      if (depth == 0)
-+              return EXT_MAX_BLOCK;
++              return EXT_UNSET_BLOCK;
 +
 +      /* go to index block */
 +      depth--;
@@ -994,7 +994,7 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/extents.c
 +              depth--;        
 +      }
 +
-+      return EXT_MAX_BLOCK;
++      return EXT_UNSET_BLOCK;
 +}
 +
 +/*
@@ -1112,7 +1112,7 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/extents.c
 +      /* probably next leaf has space for us? */
 +      fex = EXT_LAST_EXTENT(eh);
 +      next = ext3_ext_next_leaf_block(tree, path);
-+      if (newext->ee_block > fex->ee_block && next != EXT_MAX_BLOCK) {
++      if (newext->ee_block > fex->ee_block && next != EXT_UNSET_BLOCK) {
 +              ext_debug(tree, "next leaf block - %d\n", next);
 +              EXT_ASSERT(!npath);
 +              npath = ext3_ext_find_extent(tree, next, NULL);
@@ -1577,7 +1577,7 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/extents.c
 +              path[depth].p_ext = ex;
 +      
 +              a = ex->ee_block > start ? ex->ee_block : start;
-+              b = ex->ee_block + ex->ee_len - 1 < end ?
++              b = (unsigned long long)ex->ee_block + ex->ee_len - 1 < end ?
 +                      ex->ee_block + ex->ee_len - 1 : end;
 +              
 +              ext_debug(tree, "  border %u:%u\n", a, b);
@@ -2547,7 +2547,7 @@ Index: linux-2.6.16.54-0.2.5/include/linux/ext3_extents.h
 ===================================================================
 --- /dev/null
 +++ linux-2.6.16.54-0.2.5/include/linux/ext3_extents.h
-@@ -0,0 +1,262 @@
+@@ -0,0 +1,263 @@
 +/*
 + * Copyright 2008 Sun Microsystems, Inc.
 + * Written by Alex Tomas <alex@clusterfs.com>
@@ -2728,6 +2728,7 @@ Index: linux-2.6.16.54-0.2.5/include/linux/ext3_extents.h
 +
 +
 +#define EXT_MAX_BLOCK 0xffffffff
++#define EXT_UNSET_BLOCK 1
 +
 +
 +#define EXT_FIRST_EXTENT(__hdr__) \
index 1f00d9e..f19b76e 100644 (file)
@@ -1162,7 +1162,7 @@ Index: linux-2.6.18.8/fs/ext3/extents.c
 +}
 +
 +/*
-+ * returns first allocated block from next leaf or EXT_MAX_BLOCK
++ * returns first allocated block from next leaf or EXT_UNSET_BLOCK
 + */
 +static unsigned ext3_ext_next_leaf_block(struct inode *inode,
 +                                               struct ext3_ext_path *path)
@@ -1174,7 +1174,7 @@ Index: linux-2.6.18.8/fs/ext3/extents.c
 +
 +      /* zero-tree has no leaf blocks at all */
 +      if (depth == 0)
-+              return EXT_MAX_BLOCK;
++              return EXT_UNSET_BLOCK;
 +
 +      /* go to index block */
 +      depth--;
@@ -1186,7 +1186,7 @@ Index: linux-2.6.18.8/fs/ext3/extents.c
 +              depth--;
 +      }
 +
-+      return EXT_MAX_BLOCK;
++      return EXT_UNSET_BLOCK;
 +}
 +
 +/*
@@ -1309,7 +1309,7 @@ Index: linux-2.6.18.8/fs/ext3/extents.c
 +      fex = EXT_LAST_EXTENT(eh);
 +      next = ext3_ext_next_leaf_block(inode, path);
 +      if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block)
-+          && next != EXT_MAX_BLOCK) {
++          && next != EXT_UNSET_BLOCK) {
 +              ext_debug(inode, "next leaf block - %d\n", next);
 +              BUG_ON(npath != NULL);
 +              npath = ext3_ext_find_extent(inode, next, NULL);
@@ -1773,8 +1773,8 @@ Index: linux-2.6.18.8/fs/ext3/extents.c
 +              path[depth].p_ext = ex;
 +
 +              a = ex_ee_block > start ? ex_ee_block : start;
-+              b = ex_ee_block + ex_ee_len - 1 < EXT_MAX_BLOCK ?
-+                      ex_ee_block + ex_ee_len - 1 : EXT_MAX_BLOCK;
++              b = (unsigned long long)ex_ee_block + ex_ee_len - 1 < 
++                  EXT_MAX_BLOCK ? ex_ee_block + ex_ee_len - 1 : EXT_MAX_BLOCK;
 +
 +              ext_debug(inode, "  border %u:%u\n", a, b);
 +
@@ -2488,7 +2488,7 @@ Index: linux-2.6.18.8/include/linux/ext3_extents.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
 +++ linux-2.6.18.8/include/linux/ext3_extents.h        2007-07-17 09:18:14.000000000 +0200
-@@ -0,0 +1,231 @@
+@@ -0,0 +1,232 @@
 +/*
 + * Copyright 2008 Sun Microsystems, Inc.
 + * Written by Alex Tomas <alex@clusterfs.com>
@@ -2642,6 +2642,7 @@ Index: linux-2.6.18.8/include/linux/ext3_extents.h
 +
 +
 +#define EXT_MAX_BLOCK 0xffffffff
++#define EXT_UNSET_BLOCK 1
 +
 +#define EXT_FLAGS_CLR_UNKNOWN 0x7  /* Flags cleared on modification */
 +#define EXT_HDR_GEN_BITS      24