Whamcloud - gitweb
b=16238
authorkalpak <kalpak>
Thu, 10 Jul 2008 13:24:28 +0000 (13:24 +0000)
committerkalpak <kalpak>
Thu, 10 Jul 2008 13:24:28 +0000 (13:24 +0000)
i=adilger
i=girish

Remove dead code related to ext3_ext_ioct()

ldiskfs/kernel_patches/patches/ext3-extents-2.6.16-sles10.patch
ldiskfs/kernel_patches/patches/ext3-extents-2.6.5.patch
ldiskfs/kernel_patches/patches/ext3-extents-2.6.9-rhel4.patch
ldiskfs/kernel_patches/patches/ext3-fiemap-2.6-sles10.patch

index fd17dab..6289f1b 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.16.27-0.9/fs/ext3/extents.c
+Index: linux-2.6.16.54-0.2.5/fs/ext3/extents.c
 ===================================================================
 --- /dev/null
 ===================================================================
 --- /dev/null
-+++ linux-2.6.16.27-0.9/fs/ext3/extents.c
-@@ -0,0 +1,2359 @@
++++ linux-2.6.16.54-0.2.5/fs/ext3/extents.c
+@@ -0,0 +1,2264 @@
 +/*
 + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
 +/*
 + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
@@ -2260,101 +2260,6 @@ Index: linux-2.6.16.27-0.9/fs/ext3/extents.c
 +      return ext3_ext_calc_metadata_amount(&tree, blocks);
 +}
 +      
 +      return ext3_ext_calc_metadata_amount(&tree, blocks);
 +}
 +      
-+static int
-+ext3_ext_store_extent_cb(struct ext3_extents_tree *tree,
-+                       struct ext3_ext_path *path,
-+                       struct ext3_ext_cache *newex)
-+{
-+      struct ext3_extent_buf *buf = (struct ext3_extent_buf *) tree->private;
-+
-+      if (newex->ec_type != EXT3_EXT_CACHE_EXTENT)
-+              return EXT_CONTINUE;
-+
-+      if (buf->err < 0)
-+              return EXT_BREAK;
-+      if (buf->cur - buf->buffer + sizeof(*newex) > buf->buflen)
-+              return EXT_BREAK;
-+
-+      if (!copy_to_user(buf->cur, newex, sizeof(*newex))) {
-+              buf->err++;
-+              buf->cur += sizeof(*newex);
-+      } else {
-+              buf->err = -EFAULT;
-+              return EXT_BREAK;
-+      }
-+      return EXT_CONTINUE;
-+}
-+
-+static int
-+ext3_ext_collect_stats_cb(struct ext3_extents_tree *tree,
-+                        struct ext3_ext_path *path,
-+                        struct ext3_ext_cache *ex)
-+{
-+      struct ext3_extent_tree_stats *buf =
-+              (struct ext3_extent_tree_stats *) tree->private;
-+      int depth;
-+
-+      if (ex->ec_type != EXT3_EXT_CACHE_EXTENT)
-+              return EXT_CONTINUE;
-+
-+      depth = EXT_DEPTH(tree);
-+      buf->extents_num++;
-+      if (path[depth].p_ext == EXT_FIRST_EXTENT(path[depth].p_hdr))
-+              buf->leaf_num++;
-+      return EXT_CONTINUE;
-+}
-+
-+int ext3_ext_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
-+                 unsigned long arg)
-+{
-+      int err = 0;
-+
-+      if (!(EXT3_I(inode)->i_flags & EXT3_EXTENTS_FL))
-+              return -EINVAL;
-+
-+      if (cmd == EXT3_IOC_GET_EXTENTS) {
-+              struct ext3_extent_buf buf;
-+              struct ext3_extents_tree tree;
-+
-+              if (copy_from_user(&buf, (void *) arg, sizeof(buf)))
-+                      return -EFAULT;
-+
-+              ext3_init_tree_desc(&tree, inode);
-+              buf.cur = buf.buffer;
-+              buf.err = 0;
-+              tree.private = &buf;
-+              down(&EXT3_I(inode)->truncate_sem);
-+              err = ext3_ext_walk_space(&tree, buf.start, EXT_MAX_BLOCK,
-+                                        ext3_ext_store_extent_cb);
-+              up(&EXT3_I(inode)->truncate_sem);
-+              if (err == 0)
-+                      err = buf.err;
-+      } else if (cmd == EXT3_IOC_GET_TREE_STATS) {
-+              struct ext3_extent_tree_stats buf;
-+              struct ext3_extents_tree tree;
-+
-+              ext3_init_tree_desc(&tree, inode);
-+              down(&EXT3_I(inode)->truncate_sem);
-+              buf.depth = EXT_DEPTH(&tree);
-+              buf.extents_num = 0;
-+              buf.leaf_num = 0;
-+              tree.private = &buf;
-+              err = ext3_ext_walk_space(&tree, 0, EXT_MAX_BLOCK,
-+                                        ext3_ext_collect_stats_cb);
-+              up(&EXT3_I(inode)->truncate_sem);
-+              if (!err)
-+                      err = copy_to_user((void *) arg, &buf, sizeof(buf));
-+      } else if (cmd == EXT3_IOC_GET_TREE_DEPTH) {
-+              struct ext3_extents_tree tree;
-+              ext3_init_tree_desc(&tree, inode);
-+              down(&EXT3_I(inode)->truncate_sem);
-+              err = EXT_DEPTH(&tree);
-+              up(&EXT3_I(inode)->truncate_sem);
-+      }
-+
-+      return err;
-+}
-+
 +EXPORT_SYMBOL(ext3_init_tree_desc);
 +EXPORT_SYMBOL(ext3_mark_inode_dirty);
 +EXPORT_SYMBOL(ext3_ext_invalidate_cache);
 +EXPORT_SYMBOL(ext3_init_tree_desc);
 +EXPORT_SYMBOL(ext3_mark_inode_dirty);
 +EXPORT_SYMBOL(ext3_ext_invalidate_cache);
@@ -2362,10 +2267,10 @@ Index: linux-2.6.16.27-0.9/fs/ext3/extents.c
 +EXPORT_SYMBOL(ext3_ext_walk_space);
 +EXPORT_SYMBOL(ext3_ext_find_goal);
 +EXPORT_SYMBOL(ext3_ext_calc_credits_for_insert);
 +EXPORT_SYMBOL(ext3_ext_walk_space);
 +EXPORT_SYMBOL(ext3_ext_find_goal);
 +EXPORT_SYMBOL(ext3_ext_calc_credits_for_insert);
-Index: linux-2.6.16.27-0.9/fs/ext3/ialloc.c
+Index: linux-2.6.16.54-0.2.5/fs/ext3/ialloc.c
 ===================================================================
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/ialloc.c
-+++ linux-2.6.16.27-0.9/fs/ext3/ialloc.c
+--- linux-2.6.16.54-0.2.5.orig/fs/ext3/ialloc.c
++++ linux-2.6.16.54-0.2.5/fs/ext3/ialloc.c
 @@ -601,7 +601,7 @@ got:
        ei->i_dir_start_lookup = 0;
        ei->i_disksize = 0;
 @@ -601,7 +601,7 @@ got:
        ei->i_dir_start_lookup = 0;
        ei->i_disksize = 0;
@@ -2394,10 +2299,10 @@ Index: linux-2.6.16.27-0.9/fs/ext3/ialloc.c
        err = ext3_mark_inode_dirty(handle, inode);
        if (err) {
                ext3_std_error(sb, err);
        err = ext3_mark_inode_dirty(handle, inode);
        if (err) {
                ext3_std_error(sb, err);
-Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
+Index: linux-2.6.16.54-0.2.5/fs/ext3/inode.c
 ===================================================================
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/inode.c
-+++ linux-2.6.16.27-0.9/fs/ext3/inode.c
+--- linux-2.6.16.54-0.2.5.orig/fs/ext3/inode.c
++++ linux-2.6.16.54-0.2.5/fs/ext3/inode.c
 @@ -40,7 +40,7 @@
  #include "iopen.h"
  #include "acl.h"
 @@ -40,7 +40,7 @@
  #include "iopen.h"
  #include "acl.h"
@@ -2407,7 +2312,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
  
  /*
   * Test whether an inode is a fast symlink.
  
  /*
   * Test whether an inode is a fast symlink.
-@@ -788,6 +788,17 @@ out:
+@@ -789,6 +789,17 @@ out:
        return err;
  }
  
        return err;
  }
  
@@ -2425,7 +2330,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
  static int ext3_get_block(struct inode *inode, sector_t iblock,
                        struct buffer_head *bh_result, int create)
  {
  static int ext3_get_block(struct inode *inode, sector_t iblock,
                        struct buffer_head *bh_result, int create)
  {
-@@ -798,8 +809,8 @@ static int ext3_get_block(struct inode *
+@@ -799,8 +810,8 @@ static int ext3_get_block(struct inode *
                handle = ext3_journal_current_handle();
                J_ASSERT(handle != 0);
        }
                handle = ext3_journal_current_handle();
                J_ASSERT(handle != 0);
        }
@@ -2436,7 +2341,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        return ret;
  }
  
        return ret;
  }
  
-@@ -843,7 +854,7 @@ ext3_direct_io_get_blocks(struct inode *
+@@ -844,7 +855,7 @@ ext3_direct_io_get_blocks(struct inode *
  
  get_block:
        if (ret == 0)
  
  get_block:
        if (ret == 0)
@@ -2445,7 +2350,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
                                        bh_result, create, 0);
        bh_result->b_size = (1 << inode->i_blkbits);
        return ret;
                                        bh_result, create, 0);
        bh_result->b_size = (1 << inode->i_blkbits);
        return ret;
-@@ -863,7 +874,7 @@ struct buffer_head *ext3_getblk(handle_t
+@@ -864,7 +875,7 @@ struct buffer_head *ext3_getblk(handle_t
        dummy.b_state = 0;
        dummy.b_blocknr = -1000;
        buffer_trace_init(&dummy.b_history);
        dummy.b_state = 0;
        dummy.b_blocknr = -1000;
        buffer_trace_init(&dummy.b_history);
@@ -2454,7 +2359,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        if (!*errp && buffer_mapped(&dummy)) {
                struct buffer_head *bh;
                bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
        if (!*errp && buffer_mapped(&dummy)) {
                struct buffer_head *bh;
                bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
-@@ -1606,7 +1617,7 @@ void ext3_set_aops(struct inode *inode)
+@@ -1607,7 +1618,7 @@ void ext3_set_aops(struct inode *inode)
   * This required during truncate. We need to physically zero the tail end
   * of that block so it doesn't yield old data if the file is later grown.
   */
   * This required during truncate. We need to physically zero the tail end
   * of that block so it doesn't yield old data if the file is later grown.
   */
@@ -2463,7 +2368,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
                struct address_space *mapping, loff_t from)
  {
        unsigned long index = from >> PAGE_CACHE_SHIFT;
                struct address_space *mapping, loff_t from)
  {
        unsigned long index = from >> PAGE_CACHE_SHIFT;
-@@ -2116,6 +2127,9 @@ void ext3_truncate(struct inode * inode)
+@@ -2117,6 +2128,9 @@ void ext3_truncate(struct inode * inode)
                        return;
        }
  
                        return;
        }
  
@@ -2490,10 +2395,10 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
-Index: linux-2.6.16.27-0.9/fs/ext3/Makefile
+Index: linux-2.6.16.54-0.2.5/fs/ext3/Makefile
 ===================================================================
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/Makefile
-+++ linux-2.6.16.27-0.9/fs/ext3/Makefile
+--- linux-2.6.16.54-0.2.5.orig/fs/ext3/Makefile
++++ linux-2.6.16.54-0.2.5/fs/ext3/Makefile
 @@ -5,7 +5,8 @@
  obj-$(CONFIG_EXT3_FS) += ext3.o
  
 @@ -5,7 +5,8 @@
  obj-$(CONFIG_EXT3_FS) += ext3.o
  
@@ -2504,10 +2409,10 @@ Index: linux-2.6.16.27-0.9/fs/ext3/Makefile
  
  ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
  
  ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
-Index: linux-2.6.16.27-0.9/fs/ext3/super.c
+Index: linux-2.6.16.54-0.2.5/fs/ext3/super.c
 ===================================================================
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/super.c
-+++ linux-2.6.16.27-0.9/fs/ext3/super.c
+--- linux-2.6.16.54-0.2.5.orig/fs/ext3/super.c
++++ linux-2.6.16.54-0.2.5/fs/ext3/super.c
 @@ -392,6 +392,7 @@ static void ext3_put_super (struct super
        struct ext3_super_block *es = sbi->s_es;
        int i;
 @@ -392,6 +392,7 @@ static void ext3_put_super (struct super
        struct ext3_super_block *es = sbi->s_es;
        int i;
@@ -2525,7 +2430,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
        return &ei->vfs_inode;
  }
  
        return &ei->vfs_inode;
  }
  
-@@ -681,6 +684,7 @@ enum {
+@@ -678,6 +681,7 @@ enum {
        Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
        Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
        Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
        Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
@@ -2533,7 +2438,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
        Opt_grpquota
  };
  
        Opt_grpquota
  };
  
-@@ -732,6 +736,9 @@ static match_table_t tokens = {
+@@ -729,6 +733,9 @@ static match_table_t tokens = {
        {Opt_iopen, "iopen"},
        {Opt_noiopen, "noiopen"},
        {Opt_iopen_nopriv, "iopen_nopriv"},
        {Opt_iopen, "iopen"},
        {Opt_noiopen, "noiopen"},
        {Opt_iopen_nopriv, "iopen_nopriv"},
@@ -2543,7 +2448,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
        {Opt_barrier, "barrier=%u"},
        {Opt_err, NULL},
        {Opt_resize, "resize"},
        {Opt_barrier, "barrier=%u"},
        {Opt_err, NULL},
        {Opt_resize, "resize"},
-@@ -1073,6 +1080,15 @@ clear_qf_name:
+@@ -1070,6 +1077,15 @@ clear_qf_name:
                case Opt_nobh:
                        set_opt(sbi->s_mount_opt, NOBH);
                        break;
                case Opt_nobh:
                        set_opt(sbi->s_mount_opt, NOBH);
                        break;
@@ -2559,7 +2464,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
                default:
                        printk (KERN_ERR
                                "EXT3-fs: Unrecognized mount option \"%s\" "
                default:
                        printk (KERN_ERR
                                "EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1799,6 +1815,7 @@ static int ext3_fill_super (struct super
+@@ -1800,6 +1816,7 @@ static int ext3_fill_super (struct super
        percpu_counter_mod(&sbi->s_dirs_counter,
                ext3_count_dirs(sb));
  
        percpu_counter_mod(&sbi->s_dirs_counter,
                ext3_count_dirs(sb));
  
@@ -2567,25 +2472,10 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
        lock_kernel();
        return 0;
  
        lock_kernel();
        return 0;
  
-Index: linux-2.6.16.27-0.9/fs/ext3/ioctl.c
-===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/ioctl.c
-+++ linux-2.6.16.27-0.9/fs/ext3/ioctl.c
-@@ -125,6 +125,10 @@ flags_err:
-                       err = ext3_change_inode_journal_flag(inode, jflag);
-               return err;
-       }
-+      case EXT3_IOC_GET_EXTENTS:
-+      case EXT3_IOC_GET_TREE_STATS:
-+      case EXT3_IOC_GET_TREE_DEPTH:
-+              return ext3_ext_ioctl(inode, filp, cmd, arg);
-       case EXT3_IOC_GETVERSION:
-       case EXT3_IOC_GETVERSION_OLD:
-               return put_user(inode->i_generation, (int __user *) arg);
-Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
+Index: linux-2.6.16.54-0.2.5/include/linux/ext3_fs.h
 ===================================================================
 ===================================================================
---- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs.h
-+++ linux-2.6.16.27-0.9/include/linux/ext3_fs.h
+--- linux-2.6.16.54-0.2.5.orig/include/linux/ext3_fs.h
++++ linux-2.6.16.54-0.2.5/include/linux/ext3_fs.h
 @@ -185,9 +185,10 @@ struct ext3_group_desc
  #define EXT3_NOTAIL_FL                        0x00008000 /* file tail should not be merged */
  #define EXT3_DIRSYNC_FL                       0x00010000 /* dirsync behaviour (directories only) */
 @@ -185,9 +185,10 @@ struct ext3_group_desc
  #define EXT3_NOTAIL_FL                        0x00008000 /* file tail should not be merged */
  #define EXT3_DIRSYNC_FL                       0x00010000 /* dirsync behaviour (directories only) */
@@ -2598,17 +2488,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  #define EXT3_FL_USER_MODIFIABLE               0x000380FF /* User modifiable flags */
  
  /*
  #define EXT3_FL_USER_MODIFIABLE               0x000380FF /* User modifiable flags */
  
  /*
-@@ -237,6 +238,9 @@ struct ext3_new_group_data {
- #endif
- #define EXT3_IOC_GETRSVSZ             _IOR('f', 5, long)
- #define EXT3_IOC_SETRSVSZ             _IOW('f', 6, long)
-+#define EXT3_IOC_GET_EXTENTS          _IOR('f', 7, long)
-+#define EXT3_IOC_GET_TREE_DEPTH               _IOR('f', 8, long)
-+#define EXT3_IOC_GET_TREE_STATS               _IOR('f', 9, long)
- /*
-  *  Mount options
-@@ -377,6 +381,8 @@ struct ext3_inode {
+@@ -377,6 +378,8 @@ struct ext3_inode {
  #define EXT3_MOUNT_GRPQUOTA           0x200000 /* "old" group quota */
  #define EXT3_MOUNT_IOPEN              0x400000        /* Allow access via iopen */
  #define EXT3_MOUNT_IOPEN_NOPRIV               0x800000/* Make iopen world-readable */
  #define EXT3_MOUNT_GRPQUOTA           0x200000 /* "old" group quota */
  #define EXT3_MOUNT_IOPEN              0x400000        /* Allow access via iopen */
  #define EXT3_MOUNT_IOPEN_NOPRIV               0x800000/* Make iopen world-readable */
@@ -2617,7 +2497,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef clear_opt
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef clear_opt
-@@ -565,11 +571,13 @@ static inline struct ext3_inode_info *EX
+@@ -574,11 +577,13 @@ static inline int ext3_valid_inum(struct
  #define EXT3_FEATURE_INCOMPAT_RECOVER         0x0004 /* Needs recovery */
  #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV     0x0008 /* Journal device */
  #define EXT3_FEATURE_INCOMPAT_META_BG         0x0010
  #define EXT3_FEATURE_INCOMPAT_RECOVER         0x0004 /* Needs recovery */
  #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV     0x0008 /* Journal device */
  #define EXT3_FEATURE_INCOMPAT_META_BG         0x0010
@@ -2632,7 +2512,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
  #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
-@@ -776,6 +784,7 @@ extern unsigned long ext3_count_free (st
+@@ -785,6 +790,7 @@ extern unsigned long ext3_count_free (st
  
  
  /* inode.c */
  
  
  /* inode.c */
@@ -2640,7 +2520,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
  struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
  struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
  int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
  struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
  struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
-@@ -795,6 +804,7 @@ extern int ext3_get_inode_loc(struct ino
+@@ -804,6 +810,7 @@ extern int ext3_get_inode_loc(struct ino
  extern void ext3_truncate (struct inode *);
  extern void ext3_set_inode_flags(struct inode *);
  extern void ext3_set_aops(struct inode *inode);
  extern void ext3_truncate (struct inode *);
  extern void ext3_set_inode_flags(struct inode *);
  extern void ext3_set_aops(struct inode *inode);
@@ -2648,7 +2528,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  
  /* ioctl.c */
  extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
  
  /* ioctl.c */
  extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
-@@ -848,6 +858,16 @@ extern struct inode_operations ext3_spec
+@@ -857,6 +864,14 @@ extern struct inode_operations ext3_spec
  extern struct inode_operations ext3_symlink_inode_operations;
  extern struct inode_operations ext3_fast_symlink_inode_operations;
  
  extern struct inode_operations ext3_symlink_inode_operations;
  extern struct inode_operations ext3_fast_symlink_inode_operations;
  
@@ -2660,15 +2540,13 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
 +extern void ext3_ext_init(struct super_block *);
 +extern void ext3_ext_release(struct super_block *);
 +extern void ext3_extents_initialize_blockmap(handle_t *, struct inode *);
 +extern void ext3_ext_init(struct super_block *);
 +extern void ext3_ext_release(struct super_block *);
 +extern void ext3_extents_initialize_blockmap(handle_t *, struct inode *);
-+extern int ext3_ext_ioctl(struct inode *inode, struct file *filp,
-+                        unsigned int cmd, unsigned long arg);
  
  #endif        /* __KERNEL__ */
  
  
  #endif        /* __KERNEL__ */
  
-Index: linux-2.6.16.27-0.9/include/linux/ext3_extents.h
+Index: linux-2.6.16.54-0.2.5/include/linux/ext3_extents.h
 ===================================================================
 --- /dev/null
 ===================================================================
 --- /dev/null
-+++ linux-2.6.16.27-0.9/include/linux/ext3_extents.h
++++ linux-2.6.16.54-0.2.5/include/linux/ext3_extents.h
 @@ -0,0 +1,262 @@
 +/*
 + * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
 @@ -0,0 +1,262 @@
 +/*
 + * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
@@ -2932,10 +2810,10 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_extents.h
 +
 +
 +#endif /* _LINUX_EXT3_EXTENTS */
 +
 +
 +#endif /* _LINUX_EXT3_EXTENTS */
-Index: linux-2.6.16.27-0.9/include/linux/ext3_fs_i.h
+Index: linux-2.6.16.54-0.2.5/include/linux/ext3_fs_i.h
 ===================================================================
 ===================================================================
---- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs_i.h
-+++ linux-2.6.16.27-0.9/include/linux/ext3_fs_i.h
+--- linux-2.6.16.54-0.2.5.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.16.54-0.2.5/include/linux/ext3_fs_i.h
 @@ -133,6 +133,8 @@ struct ext3_inode_info {
         */
        struct semaphore truncate_sem;
 @@ -133,6 +133,8 @@ struct ext3_inode_info {
         */
        struct semaphore truncate_sem;
index b6c37c1..1699cc9 100644 (file)
@@ -1,9 +1,9 @@
 %patch
 %patch
-Index: linux-2.6.5-sles9/fs/ext3/extents.c
+Index: linux-2.6.5-7.311/fs/ext3/extents.c
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/fs/ext3/extents.c   2005-02-17 22:07:57.023609040 +0300
-+++ linux-2.6.5-sles9/fs/ext3/extents.c        2005-02-23 01:02:37.396435640 +0300
-@@ -0,0 +1,2361 @@
+--- /dev/null
++++ linux-2.6.5-7.311/fs/ext3/extents.c
+@@ -0,0 +1,2266 @@
 +/*
 + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
 +/*
 + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
@@ -2263,101 +2263,6 @@ Index: linux-2.6.5-sles9/fs/ext3/extents.c
 +      return ext3_ext_calc_metadata_amount(&tree, blocks);
 +}
 +      
 +      return ext3_ext_calc_metadata_amount(&tree, blocks);
 +}
 +      
-+static int
-+ext3_ext_store_extent_cb(struct ext3_extents_tree *tree,
-+                       struct ext3_ext_path *path,
-+                       struct ext3_ext_cache *newex)
-+{
-+      struct ext3_extent_buf *buf = (struct ext3_extent_buf *) tree->private;
-+
-+      if (newex->ec_type != EXT3_EXT_CACHE_EXTENT)
-+              return EXT_CONTINUE;
-+
-+      if (buf->err < 0)
-+              return EXT_BREAK;
-+      if (buf->cur - buf->buffer + sizeof(*newex) > buf->buflen)
-+              return EXT_BREAK;
-+
-+      if (!copy_to_user(buf->cur, newex, sizeof(*newex))) {
-+              buf->err++;
-+              buf->cur += sizeof(*newex);
-+      } else {
-+              buf->err = -EFAULT;
-+              return EXT_BREAK;
-+      }
-+      return EXT_CONTINUE;
-+}
-+
-+static int
-+ext3_ext_collect_stats_cb(struct ext3_extents_tree *tree,
-+                        struct ext3_ext_path *path,
-+                        struct ext3_ext_cache *ex)
-+{
-+      struct ext3_extent_tree_stats *buf =
-+              (struct ext3_extent_tree_stats *) tree->private;
-+      int depth;
-+
-+      if (ex->ec_type != EXT3_EXT_CACHE_EXTENT)
-+              return EXT_CONTINUE;
-+
-+      depth = EXT_DEPTH(tree);
-+      buf->extents_num++;
-+      if (path[depth].p_ext == EXT_FIRST_EXTENT(path[depth].p_hdr))
-+              buf->leaf_num++;
-+      return EXT_CONTINUE;
-+}
-+
-+int ext3_ext_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
-+                 unsigned long arg)
-+{
-+      int err = 0;
-+
-+      if (!(EXT3_I(inode)->i_flags & EXT3_EXTENTS_FL))
-+              return -EINVAL;
-+
-+      if (cmd == EXT3_IOC_GET_EXTENTS) {
-+              struct ext3_extent_buf buf;
-+              struct ext3_extents_tree tree;
-+
-+              if (copy_from_user(&buf, (void *) arg, sizeof(buf)))
-+                      return -EFAULT;
-+
-+              ext3_init_tree_desc(&tree, inode);
-+              buf.cur = buf.buffer;
-+              buf.err = 0;
-+              tree.private = &buf;
-+              down(&EXT3_I(inode)->truncate_sem);
-+              err = ext3_ext_walk_space(&tree, buf.start, EXT_MAX_BLOCK,
-+                                        ext3_ext_store_extent_cb);
-+              up(&EXT3_I(inode)->truncate_sem);
-+              if (err == 0)
-+                      err = buf.err;
-+      } else if (cmd == EXT3_IOC_GET_TREE_STATS) {
-+              struct ext3_extent_tree_stats buf;
-+              struct ext3_extents_tree tree;
-+
-+              ext3_init_tree_desc(&tree, inode);
-+              down(&EXT3_I(inode)->truncate_sem);
-+              buf.depth = EXT_DEPTH(&tree);
-+              buf.extents_num = 0;
-+              buf.leaf_num = 0;
-+              tree.private = &buf;
-+              err = ext3_ext_walk_space(&tree, 0, EXT_MAX_BLOCK,
-+                                        ext3_ext_collect_stats_cb);
-+              up(&EXT3_I(inode)->truncate_sem);
-+              if (!err)
-+                      err = copy_to_user((void *) arg, &buf, sizeof(buf));
-+      } else if (cmd == EXT3_IOC_GET_TREE_DEPTH) {
-+              struct ext3_extents_tree tree;
-+              ext3_init_tree_desc(&tree, inode);
-+              down(&EXT3_I(inode)->truncate_sem);
-+              err = EXT_DEPTH(&tree);
-+              up(&EXT3_I(inode)->truncate_sem);
-+      }
-+
-+      return err;
-+}
-+
 +EXPORT_SYMBOL(ext3_init_tree_desc);
 +EXPORT_SYMBOL(ext3_mark_inode_dirty);
 +EXPORT_SYMBOL(ext3_ext_invalidate_cache);
 +EXPORT_SYMBOL(ext3_init_tree_desc);
 +EXPORT_SYMBOL(ext3_mark_inode_dirty);
 +EXPORT_SYMBOL(ext3_ext_invalidate_cache);
@@ -2365,11 +2270,11 @@ Index: linux-2.6.5-sles9/fs/ext3/extents.c
 +EXPORT_SYMBOL(ext3_ext_walk_space);
 +EXPORT_SYMBOL(ext3_ext_find_goal);
 +EXPORT_SYMBOL(ext3_ext_calc_credits_for_insert);
 +EXPORT_SYMBOL(ext3_ext_walk_space);
 +EXPORT_SYMBOL(ext3_ext_find_goal);
 +EXPORT_SYMBOL(ext3_ext_calc_credits_for_insert);
-Index: linux-2.6.5-sles9/fs/ext3/ialloc.c
+Index: linux-2.6.5-7.311/fs/ext3/ialloc.c
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/fs/ext3/ialloc.c    2005-02-23 01:01:52.366281264 +0300
-+++ linux-2.6.5-sles9/fs/ext3/ialloc.c 2005-02-23 01:02:37.398435336 +0300
-@@ -566,7 +566,7 @@ repeat:
+--- linux-2.6.5-7.311.orig/fs/ext3/ialloc.c
++++ linux-2.6.5-7.311/fs/ext3/ialloc.c
+@@ -603,7 +603,7 @@ got:
        ei->i_dir_start_lookup = 0;
        ei->i_disksize = 0;
  
        ei->i_dir_start_lookup = 0;
        ei->i_disksize = 0;
  
@@ -2378,7 +2283,7 @@ Index: linux-2.6.5-sles9/fs/ext3/ialloc.c
        if (S_ISLNK(mode))
                ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
        /* dirsync only applies to directories */
        if (S_ISLNK(mode))
                ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
        /* dirsync only applies to directories */
-@@ -647,6 +647,18 @@
+@@ -648,6 +648,18 @@ got:
                DQUOT_FREE_INODE(inode);
                goto fail2;
        }
                DQUOT_FREE_INODE(inode);
                goto fail2;
        }
@@ -2397,11 +2302,11 @@ Index: linux-2.6.5-sles9/fs/ext3/ialloc.c
        err = ext3_mark_inode_dirty(handle, inode);
        if (err) {
                ext3_std_error(sb, err);
        err = ext3_mark_inode_dirty(handle, inode);
        if (err) {
                ext3_std_error(sb, err);
-Index: linux-2.6.5-sles9/fs/ext3/inode.c
+Index: linux-2.6.5-7.311/fs/ext3/inode.c
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/fs/ext3/inode.c     2005-02-23 01:01:52.373280200 +0300
-+++ linux-2.6.5-sles9/fs/ext3/inode.c  2005-02-23 01:02:37.404434424 +0300
-@@ -796,6 +796,17 @@
+--- linux-2.6.5-7.311.orig/fs/ext3/inode.c
++++ linux-2.6.5-7.311/fs/ext3/inode.c
+@@ -798,6 +798,17 @@ changed:
        goto reread;
  }
  
        goto reread;
  }
  
@@ -2419,7 +2324,7 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
  static int ext3_get_block(struct inode *inode, sector_t iblock,
                        struct buffer_head *bh_result, int create)
  {
  static int ext3_get_block(struct inode *inode, sector_t iblock,
                        struct buffer_head *bh_result, int create)
  {
-@@ -806,8 +817,8 @@
+@@ -808,8 +819,8 @@ static int ext3_get_block(struct inode *
                handle = ext3_journal_current_handle();
                J_ASSERT(handle != 0);
        }
                handle = ext3_journal_current_handle();
                J_ASSERT(handle != 0);
        }
@@ -2430,7 +2335,7 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
        return ret;
  }
  
        return ret;
  }
  
-@@ -833,8 +844,8 @@
+@@ -836,8 +847,8 @@ ext3_direct_io_get_blocks(struct inode *
                }
        }
        if (ret == 0)
                }
        }
        if (ret == 0)
@@ -2441,7 +2346,7 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
        if (ret == 0)
                bh_result->b_size = (1 << inode->i_blkbits);
        return ret;
        if (ret == 0)
                bh_result->b_size = (1 << inode->i_blkbits);
        return ret;
-@@ -855,7 +866,7 @@
+@@ -858,7 +869,7 @@ struct buffer_head *ext3_getblk(handle_t
        dummy.b_state = 0;
        dummy.b_blocknr = -1000;
        buffer_trace_init(&dummy.b_history);
        dummy.b_state = 0;
        dummy.b_blocknr = -1000;
        buffer_trace_init(&dummy.b_history);
@@ -2450,7 +2355,7 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
        if (!*errp && buffer_mapped(&dummy)) {
                struct buffer_head *bh;
                bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
        if (!*errp && buffer_mapped(&dummy)) {
                struct buffer_head *bh;
                bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
-@@ -1587,7 +1598,7 @@
+@@ -1604,7 +1615,7 @@ void ext3_set_aops(struct inode *inode)
   * This required during truncate. We need to physically zero the tail end
   * of that block so it doesn't yield old data if the file is later grown.
   */
   * This required during truncate. We need to physically zero the tail end
   * of that block so it doesn't yield old data if the file is later grown.
   */
@@ -2459,7 +2364,7 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
                struct address_space *mapping, loff_t from)
  {
        unsigned long index = from >> PAGE_CACHE_SHIFT;
                struct address_space *mapping, loff_t from)
  {
        unsigned long index = from >> PAGE_CACHE_SHIFT;
-@@ -2083,6 +2094,9 @@
+@@ -2100,6 +2111,9 @@ void ext3_truncate(struct inode * inode)
                        return;
        }
  
                        return;
        }
  
@@ -2469,7 +2374,7 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
        handle = start_transaction(inode);
        if (IS_ERR(handle)) {
                if (page) {
        handle = start_transaction(inode);
        if (IS_ERR(handle)) {
                if (page) {
-@@ -2789,6 +2803,9 @@
+@@ -2806,6 +2820,9 @@ int ext3_writepage_trans_blocks(struct i
        int indirects = (EXT3_NDIR_BLOCKS % bpp) ? 5 : 3;
        int ret;
  
        int indirects = (EXT3_NDIR_BLOCKS % bpp) ? 5 : 3;
        int ret;
  
@@ -2479,10 +2384,10 @@ Index: linux-2.6.5-sles9/fs/ext3/inode.c
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
-Index: linux-2.6.5-sles9/fs/ext3/Makefile
+Index: linux-2.6.5-7.311/fs/ext3/Makefile
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/fs/ext3/Makefile    2005-02-23 01:01:46.501172896 +0300
-+++ linux-2.6.5-sles9/fs/ext3/Makefile 2005-02-23 01:02:37.405434272 +0300
+--- linux-2.6.5-7.311.orig/fs/ext3/Makefile
++++ linux-2.6.5-7.311/fs/ext3/Makefile
 @@ -5,7 +5,8 @@
  obj-$(CONFIG_EXT3_FS) += ext3.o
  
 @@ -5,7 +5,8 @@
  obj-$(CONFIG_EXT3_FS) += ext3.o
  
@@ -2493,11 +2398,11 @@ Index: linux-2.6.5-sles9/fs/ext3/Makefile
  
  ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
  
  ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
-Index: linux-2.6.5-sles9/fs/ext3/super.c
+Index: linux-2.6.5-7.311/fs/ext3/super.c
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/fs/ext3/super.c     2005-02-23 01:02:34.072940888 +0300
-+++ linux-2.6.5-sles9/fs/ext3/super.c  2005-02-23 01:47:15.291333736 +0300
-@@ -389,6 +389,7 @@
+--- linux-2.6.5-7.311.orig/fs/ext3/super.c
++++ linux-2.6.5-7.311/fs/ext3/super.c
+@@ -390,6 +390,7 @@ void ext3_put_super (struct super_block 
        struct ext3_super_block *es = sbi->s_es;
        int i;
  
        struct ext3_super_block *es = sbi->s_es;
        int i;
  
@@ -2505,7 +2410,7 @@ Index: linux-2.6.5-sles9/fs/ext3/super.c
        ext3_xattr_put_super(sb);
        journal_destroy(sbi->s_journal);
        if (!(sb->s_flags & MS_RDONLY)) {
        ext3_xattr_put_super(sb);
        journal_destroy(sbi->s_journal);
        if (!(sb->s_flags & MS_RDONLY)) {
-@@ -447,6 +448,8 @@
+@@ -451,6 +452,8 @@ static struct inode *ext3_alloc_inode(st
  #endif
        ei->i_rsv_window.rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
        ei->vfs_inode.i_version = 1;
  #endif
        ei->i_rsv_window.rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
        ei->vfs_inode.i_version = 1;
@@ -2514,7 +2419,7 @@ Index: linux-2.6.5-sles9/fs/ext3/super.c
        return &ei->vfs_inode;
  }
  
        return &ei->vfs_inode;
  }
  
-@@ -537,6 +540,7 @@
+@@ -615,6 +618,7 @@ enum {
        Opt_ignore, Opt_barrier,
        Opt_err,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
        Opt_ignore, Opt_barrier,
        Opt_err,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
@@ -2522,7 +2427,7 @@ Index: linux-2.6.5-sles9/fs/ext3/super.c
  };
  
  static match_table_t tokens = {
  };
  
  static match_table_t tokens = {
-@@ -582,6 +585,9 @@
+@@ -658,6 +662,9 @@ static match_table_t tokens = {
        {Opt_iopen, "iopen"},
        {Opt_noiopen, "noiopen"},
        {Opt_iopen_nopriv, "iopen_nopriv"},
        {Opt_iopen, "iopen"},
        {Opt_noiopen, "noiopen"},
        {Opt_iopen_nopriv, "iopen_nopriv"},
@@ -2532,7 +2437,7 @@ Index: linux-2.6.5-sles9/fs/ext3/super.c
        {Opt_barrier, "barrier=%u"},
        {Opt_err, NULL}
  };
        {Opt_barrier, "barrier=%u"},
        {Opt_err, NULL}
  };
-@@ -797,6 +802,15 @@
+@@ -874,6 +881,15 @@ static int parse_options (char * options
                        break;
                case Opt_ignore:
                        break;
                        break;
                case Opt_ignore:
                        break;
@@ -2548,7 +2453,7 @@ Index: linux-2.6.5-sles9/fs/ext3/super.c
                default:
                        printk (KERN_ERR
                                "EXT3-fs: Unrecognized mount option \"%s\" "
                default:
                        printk (KERN_ERR
                                "EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1449,6 +1460,8 @@
+@@ -1528,6 +1544,8 @@ static int ext3_fill_super (struct super
        percpu_counter_mod(&sbi->s_dirs_counter,
                ext3_count_dirs(sb));
  
        percpu_counter_mod(&sbi->s_dirs_counter,
                ext3_count_dirs(sb));
  
@@ -2557,27 +2462,12 @@ Index: linux-2.6.5-sles9/fs/ext3/super.c
        return 0;
  
  failed_mount3:
        return 0;
  
  failed_mount3:
-Index: linux-2.6.5-sles9/fs/ext3/ioctl.c
+Index: linux-2.6.5-7.311/include/linux/ext3_fs.h
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/fs/ext3/ioctl.c     2005-02-23 01:01:42.887722224 +0300
-+++ linux-2.6.5-sles9/fs/ext3/ioctl.c  2005-02-23 01:02:37.412433208 +0300
-@@ -124,6 +124,10 @@
-                       err = ext3_change_inode_journal_flag(inode, jflag);
-               return err;
-       }
-+      case EXT3_IOC_GET_EXTENTS:
-+      case EXT3_IOC_GET_TREE_STATS:
-+      case EXT3_IOC_GET_TREE_DEPTH:
-+              return ext3_ext_ioctl(inode, filp, cmd, arg);
-       case EXT3_IOC_GETVERSION:
-       case EXT3_IOC_GETVERSION_OLD:
-               return put_user(inode->i_generation, (int *) arg);
-Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
-===================================================================
---- linux-2.6.5-sles9.orig/include/linux/ext3_fs.h     2005-02-23 01:02:35.823674736 +0300
-+++ linux-2.6.5-sles9/include/linux/ext3_fs.h  2005-02-23 01:02:37.414432904 +0300
-@@ -186,8 +186,9 @@
- #define EXT3_NOTAIL_FL                        0x00008000 /* don't merge file tail */
+--- linux-2.6.5-7.311.orig/include/linux/ext3_fs.h
++++ linux-2.6.5-7.311/include/linux/ext3_fs.h
+@@ -185,9 +185,10 @@ struct ext3_group_desc
+ #define EXT3_NOTAIL_FL                        0x00008000 /* file tail should not be merged */
  #define EXT3_DIRSYNC_FL                       0x00010000 /* dirsync behaviour (directories only) */
  #define EXT3_TOPDIR_FL                        0x00020000 /* Top of directory hierarchies*/
 +#define EXT3_EXTENTS_FL                       0x00080000 /* Inode uses extents */
  #define EXT3_DIRSYNC_FL                       0x00010000 /* dirsync behaviour (directories only) */
  #define EXT3_TOPDIR_FL                        0x00020000 /* Top of directory hierarchies*/
 +#define EXT3_EXTENTS_FL                       0x00080000 /* Inode uses extents */
@@ -2587,17 +2477,8 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
 +#define EXT3_FL_USER_VISIBLE          0x000BDFFF /* User visible flags */
  #define EXT3_FL_USER_MODIFIABLE               0x000380FF /* User modifiable flags */
  
 +#define EXT3_FL_USER_VISIBLE          0x000BDFFF /* User visible flags */
  #define EXT3_FL_USER_MODIFIABLE               0x000380FF /* User modifiable flags */
  
-@@ -211,6 +212,9 @@
- #endif
- #define EXT3_IOC_GETRSVSZ             _IOR('f', 5, long)
- #define EXT3_IOC_SETRSVSZ             _IOW('f', 6, long)
-+#define EXT3_IOC_GET_EXTENTS          _IOR('f', 7, long)
-+#define EXT3_IOC_GET_TREE_DEPTH               _IOR('f', 8, long)
-+#define EXT3_IOC_GET_TREE_STATS               _IOR('f', 9, long)
  /*
  /*
-  * Structure of an inode on the disk
-@@ -333,6 +337,8 @@
+@@ -333,6 +334,8 @@ struct ext3_inode {
  #define EXT3_MOUNT_BARRIER            0x20000 /* Use block barriers */
  #define EXT3_MOUNT_IOPEN              0x80000 /* Allow access via iopen */
  #define EXT3_MOUNT_IOPEN_NOPRIV               0x100000/* Make iopen world-readable */
  #define EXT3_MOUNT_BARRIER            0x20000 /* Use block barriers */
  #define EXT3_MOUNT_IOPEN              0x80000 /* Allow access via iopen */
  #define EXT3_MOUNT_IOPEN_NOPRIV               0x100000/* Make iopen world-readable */
@@ -2606,7 +2487,7 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef clear_opt
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef clear_opt
-@@ -503,11 +509,13 @@
+@@ -521,11 +524,13 @@ static inline struct ext3_inode_info *EX
  #define EXT3_FEATURE_INCOMPAT_RECOVER         0x0004 /* Needs recovery */
  #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV     0x0008 /* Journal device */
  #define EXT3_FEATURE_INCOMPAT_META_BG         0x0010
  #define EXT3_FEATURE_INCOMPAT_RECOVER         0x0004 /* Needs recovery */
  #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV     0x0008 /* Journal device */
  #define EXT3_FEATURE_INCOMPAT_META_BG         0x0010
@@ -2621,7 +2502,7 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
  #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
  #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
-@@ -729,6 +735,9 @@
+@@ -729,6 +734,9 @@ extern unsigned long ext3_count_free (st
  
  
  /* inode.c */
  
  
  /* inode.c */
@@ -2631,7 +2512,7 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
  extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
  extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
  extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
  extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
  extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
  extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
-@@ -802,6 +809,16 @@
+@@ -802,6 +810,14 @@ extern struct inode_operations ext3_spec
  extern struct inode_operations ext3_symlink_inode_operations;
  extern struct inode_operations ext3_fast_symlink_inode_operations;
  
  extern struct inode_operations ext3_symlink_inode_operations;
  extern struct inode_operations ext3_fast_symlink_inode_operations;
  
@@ -2643,15 +2524,13 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
 +extern void ext3_ext_init(struct super_block *);
 +extern void ext3_ext_release(struct super_block *);
 +extern void ext3_extents_initialize_blockmap(handle_t *, struct inode *);
 +extern void ext3_ext_init(struct super_block *);
 +extern void ext3_ext_release(struct super_block *);
 +extern void ext3_extents_initialize_blockmap(handle_t *, struct inode *);
-+extern int ext3_ext_ioctl(struct inode *inode, struct file *filp,
-+                        unsigned int cmd, unsigned long arg);
  
  #endif        /* __KERNEL__ */
  
  
  #endif        /* __KERNEL__ */
  
-Index: linux-2.6.5-sles9/include/linux/ext3_extents.h
+Index: linux-2.6.5-7.311/include/linux/ext3_extents.h
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/include/linux/ext3_extents.h        2005-02-17 22:07:57.023609040 +0300
-+++ linux-2.6.5-sles9/include/linux/ext3_extents.h     2005-02-23 01:02:37.416432600 +0300
+--- /dev/null
++++ linux-2.6.5-7.311/include/linux/ext3_extents.h
 @@ -0,0 +1,262 @@
 +/*
 + * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
 @@ -0,0 +1,262 @@
 +/*
 + * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
@@ -2915,10 +2794,10 @@ Index: linux-2.6.5-sles9/include/linux/ext3_extents.h
 +
 +
 +#endif /* _LINUX_EXT3_EXTENTS */
 +
 +
 +#endif /* _LINUX_EXT3_EXTENTS */
-Index: linux-2.6.5-sles9/include/linux/ext3_fs_i.h
+Index: linux-2.6.5-7.311/include/linux/ext3_fs_i.h
 ===================================================================
 ===================================================================
---- linux-2.6.5-sles9.orig/include/linux/ext3_fs_i.h   2005-02-23 01:01:52.425272296 +0300
-+++ linux-2.6.5-sles9/include/linux/ext3_fs_i.h        2005-02-23 01:45:55.611446920 +0300
+--- linux-2.6.5-7.311.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.5-7.311/include/linux/ext3_fs_i.h
 @@ -19,6 +19,7 @@
  #include <linux/rwsem.h>
  #include <linux/rbtree.h>
 @@ -19,6 +19,7 @@
  #include <linux/rwsem.h>
  #include <linux/rbtree.h>
@@ -2927,7 +2806,7 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs_i.h
  
  struct reserve_window {
        __u32                   _rsv_start;     /* First byte reserved */
  
  struct reserve_window {
        __u32                   _rsv_start;     /* First byte reserved */
-@@ -128,6 +129,8 @@
+@@ -128,6 +129,8 @@ struct ext3_inode_info {
         */
        struct semaphore truncate_sem;
        struct inode vfs_inode;
         */
        struct semaphore truncate_sem;
        struct inode vfs_inode;
@@ -2936,16 +2815,3 @@ Index: linux-2.6.5-sles9/include/linux/ext3_fs_i.h
  };
  
  #endif        /* _LINUX_EXT3_FS_I */
  };
  
  #endif        /* _LINUX_EXT3_FS_I */
-
-%diffstat
- fs/ext3/Makefile             |    2 
- fs/ext3/extents.c            | 2356 +++++++++++++++++++++++++++++++++++++++++++
- fs/ext3/ialloc.c             |    4 
- fs/ext3/inode.c              |   29 
- fs/ext3/ioctl.c              |    4 
- fs/ext3/super.c              |   15 
- include/linux/ext3_extents.h |  265 ++++
- include/linux/ext3_fs.h      |   17 
- include/linux/ext3_fs_i.h    |    3 
- 9 files changed, 2687 insertions(+), 8 deletions(-)
-
index 67d6236..44a73e0 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-stage/fs/ext3/extents.c
+Index: linux-2.6.9-67.0.15/fs/ext3/extents.c
 ===================================================================
 ===================================================================
---- linux-stage.orig/fs/ext3/extents.c 2005-02-25 15:33:48.890198160 +0200
-+++ linux-stage/fs/ext3/extents.c      2005-02-25 15:33:48.917194056 +0200
-@@ -0,0 +1,2360 @@
+--- /dev/null
++++ linux-2.6.9-67.0.15/fs/ext3/extents.c
+@@ -0,0 +1,2265 @@
 +/*
 + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
 +/*
 + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
@@ -2260,101 +2260,6 @@ Index: linux-stage/fs/ext3/extents.c
 +      ext3_init_tree_desc(&tree, inode);
 +      return ext3_ext_calc_metadata_amount(&tree, blocks);
 +}
 +      ext3_init_tree_desc(&tree, inode);
 +      return ext3_ext_calc_metadata_amount(&tree, blocks);
 +}
-+      
-+static int
-+ext3_ext_store_extent_cb(struct ext3_extents_tree *tree,
-+                       struct ext3_ext_path *path,
-+                       struct ext3_ext_cache *newex)
-+{
-+      struct ext3_extent_buf *buf = (struct ext3_extent_buf *) tree->private;
-+
-+      if (newex->ec_type != EXT3_EXT_CACHE_EXTENT)
-+              return EXT_CONTINUE;
-+
-+      if (buf->err < 0)
-+              return EXT_BREAK;
-+      if (buf->cur - buf->buffer + sizeof(*newex) > buf->buflen)
-+              return EXT_BREAK;
-+
-+      if (!copy_to_user(buf->cur, newex, sizeof(*newex))) {
-+              buf->err++;
-+              buf->cur += sizeof(*newex);
-+      } else {
-+              buf->err = -EFAULT;
-+              return EXT_BREAK;
-+      }
-+      return EXT_CONTINUE;
-+}
-+
-+static int
-+ext3_ext_collect_stats_cb(struct ext3_extents_tree *tree,
-+                        struct ext3_ext_path *path,
-+                        struct ext3_ext_cache *ex)
-+{
-+      struct ext3_extent_tree_stats *buf =
-+              (struct ext3_extent_tree_stats *) tree->private;
-+      int depth;
-+
-+      if (ex->ec_type != EXT3_EXT_CACHE_EXTENT)
-+              return EXT_CONTINUE;
-+
-+      depth = EXT_DEPTH(tree);
-+      buf->extents_num++;
-+      if (path[depth].p_ext == EXT_FIRST_EXTENT(path[depth].p_hdr))
-+              buf->leaf_num++;
-+      return EXT_CONTINUE;
-+}
-+
-+int ext3_ext_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
-+                 unsigned long arg)
-+{
-+      int err = 0;
-+
-+      if (!(EXT3_I(inode)->i_flags & EXT3_EXTENTS_FL))
-+              return -EINVAL;
-+
-+      if (cmd == EXT3_IOC_GET_EXTENTS) {
-+              struct ext3_extent_buf buf;
-+              struct ext3_extents_tree tree;
-+
-+              if (copy_from_user(&buf, (void *) arg, sizeof(buf)))
-+                      return -EFAULT;
-+
-+              ext3_init_tree_desc(&tree, inode);
-+              buf.cur = buf.buffer;
-+              buf.err = 0;
-+              tree.private = &buf;
-+              down(&EXT3_I(inode)->truncate_sem);
-+              err = ext3_ext_walk_space(&tree, buf.start, EXT_MAX_BLOCK,
-+                                        ext3_ext_store_extent_cb);
-+              up(&EXT3_I(inode)->truncate_sem);
-+              if (err == 0)
-+                      err = buf.err;
-+      } else if (cmd == EXT3_IOC_GET_TREE_STATS) {
-+              struct ext3_extent_tree_stats buf;
-+              struct ext3_extents_tree tree;
-+
-+              ext3_init_tree_desc(&tree, inode);
-+              down(&EXT3_I(inode)->truncate_sem);
-+              buf.depth = EXT_DEPTH(&tree);
-+              buf.extents_num = 0;
-+              buf.leaf_num = 0;
-+              tree.private = &buf;
-+              err = ext3_ext_walk_space(&tree, 0, EXT_MAX_BLOCK,
-+                                        ext3_ext_collect_stats_cb);
-+              up(&EXT3_I(inode)->truncate_sem);
-+              if (!err)
-+                      err = copy_to_user((void *) arg, &buf, sizeof(buf));
-+      } else if (cmd == EXT3_IOC_GET_TREE_DEPTH) {
-+              struct ext3_extents_tree tree;
-+              ext3_init_tree_desc(&tree, inode);
-+              down(&EXT3_I(inode)->truncate_sem);
-+              err = EXT_DEPTH(&tree);
-+              up(&EXT3_I(inode)->truncate_sem);
-+      }
-+
-+      return err;
-+}
 +
 +EXPORT_SYMBOL(ext3_init_tree_desc);
 +EXPORT_SYMBOL(ext3_mark_inode_dirty);
 +
 +EXPORT_SYMBOL(ext3_init_tree_desc);
 +EXPORT_SYMBOL(ext3_mark_inode_dirty);
@@ -2363,11 +2268,11 @@ Index: linux-stage/fs/ext3/extents.c
 +EXPORT_SYMBOL(ext3_ext_walk_space);
 +EXPORT_SYMBOL(ext3_ext_find_goal);
 +EXPORT_SYMBOL(ext3_ext_calc_credits_for_insert);
 +EXPORT_SYMBOL(ext3_ext_walk_space);
 +EXPORT_SYMBOL(ext3_ext_find_goal);
 +EXPORT_SYMBOL(ext3_ext_calc_credits_for_insert);
-Index: linux-stage/fs/ext3/ialloc.c
+Index: linux-2.6.9-67.0.15/fs/ext3/ialloc.c
 ===================================================================
 ===================================================================
---- linux-stage.orig/fs/ext3/ialloc.c  2005-02-25 14:50:50.304202816 +0200
-+++ linux-stage/fs/ext3/ialloc.c       2005-02-25 15:33:48.920193600 +0200
-@@ -566,7 +566,7 @@ repeat:
+--- linux-2.6.9-67.0.15.orig/fs/ext3/ialloc.c
++++ linux-2.6.9-67.0.15/fs/ext3/ialloc.c
+@@ -602,7 +602,7 @@ got:
        ei->i_dir_start_lookup = 0;
        ei->i_disksize = 0;
  
        ei->i_dir_start_lookup = 0;
        ei->i_disksize = 0;
  
@@ -2376,7 +2281,7 @@ Index: linux-stage/fs/ext3/ialloc.c
        if (S_ISLNK(mode))
                ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
        /* dirsync only applies to directories */
        if (S_ISLNK(mode))
                ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
        /* dirsync only applies to directories */
-@@ -646,6 +646,18 @@
+@@ -647,6 +647,18 @@ got:
                DQUOT_FREE_INODE(inode);
                goto fail2;
        }
                DQUOT_FREE_INODE(inode);
                goto fail2;
        }
@@ -2395,11 +2300,11 @@ Index: linux-stage/fs/ext3/ialloc.c
        err = ext3_mark_inode_dirty(handle, inode);
        if (err) {
                ext3_std_error(sb, err);
        err = ext3_mark_inode_dirty(handle, inode);
        if (err) {
                ext3_std_error(sb, err);
-Index: linux-stage/fs/ext3/inode.c
+Index: linux-2.6.9-67.0.15/fs/ext3/inode.c
 ===================================================================
 ===================================================================
---- linux-stage.orig/fs/ext3/inode.c   2005-02-25 14:50:50.309202056 +0200
-+++ linux-stage/fs/ext3/inode.c        2005-02-25 15:36:51.846384592 +0200
-@@ -796,6 +796,17 @@
+--- linux-2.6.9-67.0.15.orig/fs/ext3/inode.c
++++ linux-2.6.9-67.0.15/fs/ext3/inode.c
+@@ -797,6 +797,17 @@ changed:
        goto reread;
  }
  
        goto reread;
  }
  
@@ -2417,7 +2322,7 @@ Index: linux-stage/fs/ext3/inode.c
  static int ext3_get_block(struct inode *inode, sector_t iblock,
                        struct buffer_head *bh_result, int create)
  {
  static int ext3_get_block(struct inode *inode, sector_t iblock,
                        struct buffer_head *bh_result, int create)
  {
-@@ -806,8 +817,8 @@
+@@ -807,8 +818,8 @@ static int ext3_get_block(struct inode *
                handle = ext3_journal_current_handle();
                J_ASSERT(handle != 0);
        }
                handle = ext3_journal_current_handle();
                J_ASSERT(handle != 0);
        }
@@ -2428,7 +2333,7 @@ Index: linux-stage/fs/ext3/inode.c
        return ret;
  }
  
        return ret;
  }
  
-@@ -851,7 +862,7 @@
+@@ -852,7 +863,7 @@ ext3_direct_io_get_blocks(struct inode *
  
  get_block:
        if (ret == 0)
  
  get_block:
        if (ret == 0)
@@ -2437,7 +2342,7 @@ Index: linux-stage/fs/ext3/inode.c
                                        bh_result, create, 0);
        bh_result->b_size = (1 << inode->i_blkbits);
        return ret;
                                        bh_result, create, 0);
        bh_result->b_size = (1 << inode->i_blkbits);
        return ret;
-@@ -871,7 +882,7 @@
+@@ -872,7 +883,7 @@ struct buffer_head *ext3_getblk(handle_t
        dummy.b_state = 0;
        dummy.b_blocknr = -1000;
        buffer_trace_init(&dummy.b_history);
        dummy.b_state = 0;
        dummy.b_blocknr = -1000;
        buffer_trace_init(&dummy.b_history);
@@ -2446,7 +2351,7 @@ Index: linux-stage/fs/ext3/inode.c
        if (!*errp && buffer_mapped(&dummy)) {
                struct buffer_head *bh;
                bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
        if (!*errp && buffer_mapped(&dummy)) {
                struct buffer_head *bh;
                bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
-@@ -1589,7 +1600,7 @@
+@@ -1590,7 +1601,7 @@ void ext3_set_aops(struct inode *inode)
   * This required during truncate. We need to physically zero the tail end
   * of that block so it doesn't yield old data if the file is later grown.
   */
   * This required during truncate. We need to physically zero the tail end
   * of that block so it doesn't yield old data if the file is later grown.
   */
@@ -2455,7 +2360,7 @@ Index: linux-stage/fs/ext3/inode.c
                struct address_space *mapping, loff_t from)
  {
        unsigned long index = from >> PAGE_CACHE_SHIFT;
                struct address_space *mapping, loff_t from)
  {
        unsigned long index = from >> PAGE_CACHE_SHIFT;
-@@ -2087,6 +2098,9 @@
+@@ -2088,6 +2099,9 @@ void ext3_truncate(struct inode * inode)
                        return;
        }
  
                        return;
        }
  
@@ -2465,7 +2370,7 @@ Index: linux-stage/fs/ext3/inode.c
        handle = start_transaction(inode);
        if (IS_ERR(handle)) {
                if (page) {
        handle = start_transaction(inode);
        if (IS_ERR(handle)) {
                if (page) {
-@@ -2814,6 +2828,9 @@
+@@ -2815,6 +2829,9 @@ int ext3_writepage_trans_blocks(struct i
        int indirects = (EXT3_NDIR_BLOCKS % bpp) ? 5 : 3;
        int ret;
  
        int indirects = (EXT3_NDIR_BLOCKS % bpp) ? 5 : 3;
        int ret;
  
@@ -2475,10 +2380,10 @@ Index: linux-stage/fs/ext3/inode.c
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
-Index: linux-stage/fs/ext3/Makefile
+Index: linux-2.6.9-67.0.15/fs/ext3/Makefile
 ===================================================================
 ===================================================================
---- linux-stage.orig/fs/ext3/Makefile  2005-02-25 14:49:42.168561008 +0200
-+++ linux-stage/fs/ext3/Makefile       2005-02-25 15:39:28.384587168 +0200
+--- linux-2.6.9-67.0.15.orig/fs/ext3/Makefile
++++ linux-2.6.9-67.0.15/fs/ext3/Makefile
 @@ -5,7 +5,8 @@
  obj-$(CONFIG_EXT3_FS) += ext3.o
  
 @@ -5,7 +5,8 @@
  obj-$(CONFIG_EXT3_FS) += ext3.o
  
@@ -2489,11 +2394,11 @@ Index: linux-stage/fs/ext3/Makefile
  
  ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
  
  ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
-Index: linux-stage/fs/ext3/super.c
+Index: linux-2.6.9-67.0.15/fs/ext3/super.c
 ===================================================================
 ===================================================================
---- linux-stage.orig/fs/ext3/super.c   2005-02-25 14:52:33.550506992 +0200
-+++ linux-stage/fs/ext3/super.c        2005-02-25 15:38:10.474431312 +0200
-@@ -394,6 +394,7 @@
+--- linux-2.6.9-67.0.15.orig/fs/ext3/super.c
++++ linux-2.6.9-67.0.15/fs/ext3/super.c
+@@ -394,6 +394,7 @@ void ext3_put_super (struct super_block 
        struct ext3_super_block *es = sbi->s_es;
        int i;
  
        struct ext3_super_block *es = sbi->s_es;
        int i;
  
@@ -2501,7 +2406,7 @@ Index: linux-stage/fs/ext3/super.c
        ext3_xattr_put_super(sb);
        journal_destroy(sbi->s_journal);
        if (!(sb->s_flags & MS_RDONLY)) {
        ext3_xattr_put_super(sb);
        journal_destroy(sbi->s_journal);
        if (!(sb->s_flags & MS_RDONLY)) {
-@@ -457,6 +458,8 @@
+@@ -460,6 +461,8 @@ static struct inode *ext3_alloc_inode(st
  #endif
        ei->i_rsv_window.rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
        ei->vfs_inode.i_version = 1;
  #endif
        ei->i_rsv_window.rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
        ei->vfs_inode.i_version = 1;
@@ -2510,7 +2415,7 @@ Index: linux-stage/fs/ext3/super.c
        return &ei->vfs_inode;
  }
  
        return &ei->vfs_inode;
  }
  
-@@ -589,6 +594,7 @@
+@@ -642,6 +645,7 @@ enum {
        Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0,
        Opt_ignore, Opt_barrier, Opt_err, Opt_resize,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
        Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0,
        Opt_ignore, Opt_barrier, Opt_err, Opt_resize,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
@@ -2518,7 +2423,7 @@ Index: linux-stage/fs/ext3/super.c
  };
  
  static match_table_t tokens = {
  };
  
  static match_table_t tokens = {
-@@ -639,6 +644,9 @@
+@@ -691,6 +695,9 @@ static match_table_t tokens = {
        {Opt_iopen, "iopen"},
        {Opt_noiopen, "noiopen"},
        {Opt_iopen_nopriv, "iopen_nopriv"},
        {Opt_iopen, "iopen"},
        {Opt_noiopen, "noiopen"},
        {Opt_iopen_nopriv, "iopen_nopriv"},
@@ -2528,7 +2433,7 @@ Index: linux-stage/fs/ext3/super.c
        {Opt_barrier, "barrier=%u"},
        {Opt_err, NULL},
        {Opt_resize, "resize"},
        {Opt_barrier, "barrier=%u"},
        {Opt_err, NULL},
        {Opt_resize, "resize"},
-@@ -943,6 +950,15 @@
+@@ -999,6 +1006,15 @@ clear_qf_name:
                        match_int(&args[0], &option);
                        *n_blocks_count = option;
                        break;
                        match_int(&args[0], &option);
                        *n_blocks_count = option;
                        break;
@@ -2544,7 +2449,7 @@ Index: linux-stage/fs/ext3/super.c
                default:
                        printk (KERN_ERR
                                "EXT3-fs: Unrecognized mount option \"%s\" "
                default:
                        printk (KERN_ERR
                                "EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1625,6 +1638,8 @@
+@@ -1693,6 +1709,8 @@ static int ext3_fill_super (struct super
        percpu_counter_mod(&sbi->s_dirs_counter,
                ext3_count_dirs(sb));
  
        percpu_counter_mod(&sbi->s_dirs_counter,
                ext3_count_dirs(sb));
  
@@ -2553,27 +2458,12 @@ Index: linux-stage/fs/ext3/super.c
        return 0;
  
  failed_mount3:
        return 0;
  
  failed_mount3:
-Index: linux-stage/fs/ext3/ioctl.c
+Index: linux-2.6.9-67.0.15/include/linux/ext3_fs.h
 ===================================================================
 ===================================================================
---- linux-stage.orig/fs/ext3/ioctl.c   2005-02-25 14:37:28.971023976 +0200
-+++ linux-stage/fs/ext3/ioctl.c        2005-02-25 15:33:48.938190864 +0200
-@@ -124,6 +124,10 @@
-                       err = ext3_change_inode_journal_flag(inode, jflag);
-               return err;
-       }
-+      case EXT3_IOC_GET_EXTENTS:
-+      case EXT3_IOC_GET_TREE_STATS:
-+      case EXT3_IOC_GET_TREE_DEPTH:
-+              return ext3_ext_ioctl(inode, filp, cmd, arg);
-       case EXT3_IOC_GETVERSION:
-       case EXT3_IOC_GETVERSION_OLD:
-               return put_user(inode->i_generation, (int __user *) arg);
-Index: linux-stage/include/linux/ext3_fs.h
-===================================================================
---- linux-stage.orig/include/linux/ext3_fs.h   2005-02-25 14:53:56.424908168 +0200
-+++ linux-stage/include/linux/ext3_fs.h        2005-02-25 15:39:12.841950008 +0200
-@@ -186,8 +186,9 @@
- #define EXT3_NOTAIL_FL                        0x00008000 /* don't merge file tail */
+--- linux-2.6.9-67.0.15.orig/include/linux/ext3_fs.h
++++ linux-2.6.9-67.0.15/include/linux/ext3_fs.h
+@@ -185,9 +185,10 @@ struct ext3_group_desc
+ #define EXT3_NOTAIL_FL                        0x00008000 /* file tail should not be merged */
  #define EXT3_DIRSYNC_FL                       0x00010000 /* dirsync behaviour (directories only) */
  #define EXT3_TOPDIR_FL                        0x00020000 /* Top of directory hierarchies*/
 +#define EXT3_EXTENTS_FL                       0x00080000 /* Inode uses extents */
  #define EXT3_DIRSYNC_FL                       0x00010000 /* dirsync behaviour (directories only) */
  #define EXT3_TOPDIR_FL                        0x00020000 /* Top of directory hierarchies*/
 +#define EXT3_EXTENTS_FL                       0x00080000 /* Inode uses extents */
@@ -2583,17 +2473,8 @@ Index: linux-stage/include/linux/ext3_fs.h
 +#define EXT3_FL_USER_VISIBLE          0x000BDFFF /* User visible flags */
  #define EXT3_FL_USER_MODIFIABLE               0x000380FF /* User modifiable flags */
  
 +#define EXT3_FL_USER_VISIBLE          0x000BDFFF /* User visible flags */
  #define EXT3_FL_USER_MODIFIABLE               0x000380FF /* User modifiable flags */
  
-@@ -237,6 +238,9 @@
- #endif
- #define EXT3_IOC_GETRSVSZ             _IOR('f', 5, long)
- #define EXT3_IOC_SETRSVSZ             _IOW('f', 6, long)
-+#define EXT3_IOC_GET_EXTENTS          _IOR('f', 7, long)
-+#define EXT3_IOC_GET_TREE_DEPTH               _IOR('f', 8, long)
-+#define EXT3_IOC_GET_TREE_STATS               _IOR('f', 9, long)
  /*
  /*
-  * Structure of an inode on the disk
-@@ -359,6 +363,8 @@
+@@ -359,6 +360,8 @@ struct ext3_inode {
  #define EXT3_MOUNT_RESERVATION                0x20000 /* Preallocation */
  #define EXT3_MOUNT_IOPEN              0x80000 /* Allow access via iopen */
  #define EXT3_MOUNT_IOPEN_NOPRIV               0x100000/* Make iopen world-readable */
  #define EXT3_MOUNT_RESERVATION                0x20000 /* Preallocation */
  #define EXT3_MOUNT_IOPEN              0x80000 /* Allow access via iopen */
  #define EXT3_MOUNT_IOPEN_NOPRIV               0x100000/* Make iopen world-readable */
@@ -2601,8 +2482,8 @@ Index: linux-stage/include/linux/ext3_fs.h
 +#define EXT3_MOUNT_EXTDEBUG           0x400000/* Extents debug */
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
 +#define EXT3_MOUNT_EXTDEBUG           0x400000/* Extents debug */
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
- #ifndef _LINUX_EXT2_FS_H
-@@ -503,11 +509,13 @@
+ #ifndef clear_opt
+@@ -547,11 +550,13 @@ static inline struct ext3_inode_info *EX
  #define EXT3_FEATURE_INCOMPAT_RECOVER         0x0004 /* Needs recovery */
  #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV     0x0008 /* Journal device */
  #define EXT3_FEATURE_INCOMPAT_META_BG         0x0010
  #define EXT3_FEATURE_INCOMPAT_RECOVER         0x0004 /* Needs recovery */
  #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV     0x0008 /* Journal device */
  #define EXT3_FEATURE_INCOMPAT_META_BG         0x0010
@@ -2617,7 +2498,7 @@ Index: linux-stage/include/linux/ext3_fs.h
  #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
  #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
-@@ -756,6 +763,9 @@
+@@ -757,6 +762,9 @@ extern unsigned long ext3_count_free (st
  
  
  /* inode.c */
  
  
  /* inode.c */
@@ -2627,7 +2508,7 @@ Index: linux-stage/include/linux/ext3_fs.h
  extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
  extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
  extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
  extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
  extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
  extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
-@@ -836,6 +844,16 @@
+@@ -837,6 +845,14 @@ extern struct inode_operations ext3_spec
  extern struct inode_operations ext3_symlink_inode_operations;
  extern struct inode_operations ext3_fast_symlink_inode_operations;
  
  extern struct inode_operations ext3_symlink_inode_operations;
  extern struct inode_operations ext3_fast_symlink_inode_operations;
  
@@ -2639,15 +2520,13 @@ Index: linux-stage/include/linux/ext3_fs.h
 +extern void ext3_ext_init(struct super_block *);
 +extern void ext3_ext_release(struct super_block *);
 +extern void ext3_extents_initialize_blockmap(handle_t *, struct inode *);
 +extern void ext3_ext_init(struct super_block *);
 +extern void ext3_ext_release(struct super_block *);
 +extern void ext3_extents_initialize_blockmap(handle_t *, struct inode *);
-+extern int ext3_ext_ioctl(struct inode *inode, struct file *filp,
-+                        unsigned int cmd, unsigned long arg);
  
  #endif        /* __KERNEL__ */
  
  
  #endif        /* __KERNEL__ */
  
-Index: linux-stage/include/linux/ext3_extents.h
+Index: linux-2.6.9-67.0.15/include/linux/ext3_extents.h
 ===================================================================
 ===================================================================
---- linux-stage.orig/include/linux/ext3_extents.h      2005-02-25 15:33:48.891198008 +0200
-+++ linux-stage/include/linux/ext3_extents.h   2005-02-25 15:33:48.944189952 +0200
+--- /dev/null
++++ linux-2.6.9-67.0.15/include/linux/ext3_extents.h
 @@ -0,0 +1,262 @@
 +/*
 + * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
 @@ -0,0 +1,262 @@
 +/*
 + * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
@@ -2911,11 +2790,11 @@ Index: linux-stage/include/linux/ext3_extents.h
 +              tree->cex->ec_type = EXT3_EXT_CACHE_NO;
 +}
 +#endif /* _LINUX_EXT3_EXTENTS */
 +              tree->cex->ec_type = EXT3_EXT_CACHE_NO;
 +}
 +#endif /* _LINUX_EXT3_EXTENTS */
-Index: linux-stage/include/linux/ext3_fs_i.h
+Index: linux-2.6.9-67.0.15/include/linux/ext3_fs_i.h
 ===================================================================
 ===================================================================
---- linux-stage.orig/include/linux/ext3_fs_i.h 2005-02-25 14:50:50.320200384 +0200
-+++ linux-stage/include/linux/ext3_fs_i.h      2005-02-25 15:33:48.945189800 +0200
-@@ -128,6 +128,8 @@
+--- linux-2.6.9-67.0.15.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.9-67.0.15/include/linux/ext3_fs_i.h
+@@ -128,6 +128,8 @@ struct ext3_inode_info {
         */
        struct semaphore truncate_sem;
        struct inode vfs_inode;
         */
        struct semaphore truncate_sem;
        struct inode vfs_inode;
index c64471a..eb8092d 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.16.46-0.14/fs/ext3/ioctl.c
+Index: linux-2.6.9-67.0.15/fs/ext3/ioctl.c
 ===================================================================
 ===================================================================
---- linux-2.6.16.46-0.14.orig/fs/ext3/ioctl.c
-+++ linux-2.6.16.46-0.14/fs/ext3/ioctl.c
-@@ -15,7 +15,7 @@
+--- linux-2.6.9-67.0.15.orig/fs/ext3/ioctl.c
++++ linux-2.6.9-67.0.15/fs/ext3/ioctl.c
+@@ -14,7 +14,7 @@
  #include <linux/time.h>
  #include <asm/uaccess.h>
  #include <linux/namei.h>
  #include <linux/time.h>
  #include <asm/uaccess.h>
  #include <linux/namei.h>
@@ -11,7 +11,7 @@ Index: linux-2.6.16.46-0.14/fs/ext3/ioctl.c
  
  int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                unsigned long arg)
  
  int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                unsigned long arg)
-@@ -266,6 +266,9 @@ flags_err:
+@@ -244,6 +244,9 @@ flags_err:
  
                return err;
        }
  
                return err;
        }
@@ -21,11 +21,11 @@ Index: linux-2.6.16.46-0.14/fs/ext3/ioctl.c
  
  
        default:
  
  
        default:
-Index: linux-2.6.16.46-0.14/include/linux/ext3_fs.h
+Index: linux-2.6.9-67.0.15/include/linux/ext3_fs.h
 ===================================================================
 ===================================================================
---- linux-2.6.16.46-0.14.orig/include/linux/ext3_fs.h
-+++ linux-2.6.16.46-0.14/include/linux/ext3_fs.h
-@@ -252,7 +252,6 @@ struct ext3_new_group_data {
+--- linux-2.6.9-67.0.15.orig/include/linux/ext3_fs.h
++++ linux-2.6.9-67.0.15/include/linux/ext3_fs.h
+@@ -251,7 +251,6 @@ struct ext3_new_group_data {
        __u32 free_blocks_count;
  };
  
        __u32 free_blocks_count;
  };
  
@@ -33,15 +33,16 @@ Index: linux-2.6.16.46-0.14/include/linux/ext3_fs.h
  /*
   * ioctl commands
   */
  /*
   * ioctl commands
   */
-@@ -272,6 +271,7 @@ struct ext3_new_group_data {
- #define EXT3_IOC_GET_EXTENTS          _IOR('f', 7, long)
- #define EXT3_IOC_GET_TREE_DEPTH               _IOR('f', 8, long)
- #define EXT3_IOC_GET_TREE_STATS               _IOR('f', 9, long)
+@@ -268,6 +267,8 @@ struct ext3_new_group_data {
+ #endif
+ #define EXT3_IOC_GETRSVSZ             _IOR('f', 5, long)
+ #define EXT3_IOC_SETRSVSZ             _IOW('f', 6, long)
 +#define       EXT3_IOC_FIEMAP                 _IOWR('f', 10, struct fiemap)
 +#define       EXT3_IOC_FIEMAP                 _IOWR('f', 10, struct fiemap)
++
  
  /*
  
  /*
-  *  Mount options
-@@ -853,6 +853,8 @@ static inline struct timespec ext3_curre
+  * Structure of an inode on the disk
+@@ -813,6 +814,8 @@ static inline struct timespec ext3_curre
        return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
                current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
  }
        return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
                current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
  }
@@ -50,10 +51,10 @@ Index: linux-2.6.16.46-0.14/include/linux/ext3_fs.h
  
  /*
   * This structure is stuffed into the struct file's private_data field
  
  /*
   * This structure is stuffed into the struct file's private_data field
-Index: linux-2.6.16.46-0.14/include/linux/ext3_extents.h
+Index: linux-2.6.9-67.0.15/include/linux/ext3_extents.h
 ===================================================================
 ===================================================================
---- linux-2.6.16.46-0.14.orig/include/linux/ext3_extents.h
-+++ linux-2.6.16.46-0.14/include/linux/ext3_extents.h
+--- linux-2.6.9-67.0.15.orig/include/linux/ext3_extents.h
++++ linux-2.6.9-67.0.15/include/linux/ext3_extents.h
 @@ -170,7 +170,9 @@ struct ext3_extents_helpers {
   */
  typedef int (*ext_prepare_callback)(struct ext3_extents_tree *,
 @@ -170,7 +170,9 @@ struct ext3_extents_helpers {
   */
  typedef int (*ext_prepare_callback)(struct ext3_extents_tree *,
@@ -65,7 +66,7 @@ Index: linux-2.6.16.46-0.14/include/linux/ext3_extents.h
  
  #define EXT_CONTINUE  0
  #define EXT_BREAK     1
  
  #define EXT_CONTINUE  0
  #define EXT_BREAK     1
-@@ -179,6 +180,25 @@ typedef int (*ext_prepare_callback)(stru
+@@ -179,6 +181,25 @@ typedef int (*ext_prepare_callback)(stru
  
  #define EXT_MAX_BLOCK 0xffffffff
  
  
  #define EXT_MAX_BLOCK 0xffffffff
  
@@ -91,8 +92,8 @@ Index: linux-2.6.16.46-0.14/include/linux/ext3_extents.h
  
  #define EXT_FIRST_EXTENT(__hdr__) \
        ((struct ext3_extent *) (((char *) (__hdr__)) +         \
  
  #define EXT_FIRST_EXTENT(__hdr__) \
        ((struct ext3_extent *) (((char *) (__hdr__)) +         \
-@@ -260,5 +280,10 @@ ext3_ext_invalidate_cache(struct ext3_ex
-               tree->cex->ec_type = EXT3_EXT_CACHE_NO;
+@@ -223,6 +244,11 @@ typedef int (*ext_prepare_callback)(stru
+       BUG_ON((path)[0].p_depth != depth);                             \
  }
  
 +static inline int ext3_ext_is_uninitialized(struct ext3_extent *ext)
  }
  
 +static inline int ext3_ext_is_uninitialized(struct ext3_extent *ext)
@@ -101,11 +102,12 @@ Index: linux-2.6.16.46-0.14/include/linux/ext3_extents.h
 +        return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
 +}
  
 +        return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
 +}
  
- #endif /* _LINUX_EXT3_EXTENTS */
-Index: linux-2.6.16.46-0.14/fs/ext3/extents.c
+ /*
+  * this structure is used to gather extents from the tree via ioctl
+Index: linux-2.6.9-67.0.15/fs/ext3/extents.c
 ===================================================================
 ===================================================================
---- linux-2.6.16.46-0.14.orig/fs/ext3/extents.c
-+++ linux-2.6.16.46-0.14/fs/ext3/extents.c
+--- linux-2.6.9-67.0.15.orig/fs/ext3/extents.c
++++ linux-2.6.9-67.0.15/fs/ext3/extents.c
 @@ -42,7 +42,7 @@
  #include <linux/slab.h>
  #include <linux/ext3_extents.h>
 @@ -42,7 +42,7 @@
  #include <linux/slab.h>
  #include <linux/ext3_extents.h>
@@ -115,7 +117,7 @@ Index: linux-2.6.16.46-0.14/fs/ext3/extents.c
  
  static int __ext3_ext_check_header(const char *function, int line, struct inode *inode,
                                struct ext3_extent_header *eh, int depth,
  
  static int __ext3_ext_check_header(const char *function, int line, struct inode *inode,
                                struct ext3_extent_header *eh, int depth,
-@@ -1484,7 +1484,7 @@ int ext3_ext_walk_space(struct ext3_exte
+@@ -1489,7 +1489,7 @@ int ext3_ext_walk_space(struct ext3_exte
  
                EXT_ASSERT(cbex.ec_len > 0);
                EXT_ASSERT(path[depth].p_hdr);
  
                EXT_ASSERT(cbex.ec_len > 0);
                EXT_ASSERT(path[depth].p_hdr);
@@ -124,29 +126,12 @@ Index: linux-2.6.16.46-0.14/fs/ext3/extents.c
                ext3_ext_drop_refs(path);
  
                if (err < 0)
                ext3_ext_drop_refs(path);
  
                if (err < 0)
-@@ -2499,7 +2499,8 @@ int ext3_ext_calc_blockmap_metadata(stru
- static int
- ext3_ext_store_extent_cb(struct ext3_extents_tree *tree,
-                        struct ext3_ext_path *path,
--                       struct ext3_ext_cache *newex)
-+                       struct ext3_ext_cache *newex,
-+                       struct ext3_extent *extent)
- {
-       struct ext3_extent_buf *buf = (struct ext3_extent_buf *) tree->private;
-@@ -2524,7 +2525,7 @@ ext3_ext_store_extent_cb(struct ext3_ext
- static int
- ext3_ext_collect_stats_cb(struct ext3_extents_tree *tree,
-                         struct ext3_ext_path *path,
--                        struct ext3_ext_cache *ex)
-+                        struct ext3_ext_cache *ex, struct ext3_extent *extent)
- {
-       struct ext3_extent_tree_stats *buf =
-               (struct ext3_extent_tree_stats *) tree->private;
-@@ -2591,6 +2592,149 @@ int ext3_ext_ioctl(struct inode *inode, 
-       return err;
+@@ -2503,7 +2503,148 @@ int ext3_ext_calc_blockmap_metadata(stru
+       ext3_init_tree_desc(&tree, inode);
+       return ext3_ext_calc_metadata_amount(&tree, blocks);
  }
  }
+-      
++
 +struct fiemap_internal {
 +      struct fiemap           *fiemap_s;
 +      struct fiemap_extent    fm_extent;
 +struct fiemap_internal {
 +      struct fiemap           *fiemap_s;
 +      struct fiemap_extent    fm_extent;
@@ -288,15 +273,13 @@ Index: linux-2.6.16.46-0.14/fs/ext3/extents.c
 +      return err;
 +}
 +
 +      return err;
 +}
 +
-+
-+
  EXPORT_SYMBOL(ext3_init_tree_desc);
  EXPORT_SYMBOL(ext3_mark_inode_dirty);
  EXPORT_SYMBOL(ext3_ext_invalidate_cache);
  EXPORT_SYMBOL(ext3_init_tree_desc);
  EXPORT_SYMBOL(ext3_mark_inode_dirty);
  EXPORT_SYMBOL(ext3_ext_invalidate_cache);
-Index: linux-2.6.16.46-0.14/fs/ext3/fiemap.h
+Index: linux-2.6.9-67.0.15/fs/ext3/fiemap.h
 ===================================================================
 --- /dev/null
 ===================================================================
 --- /dev/null
-+++ linux-2.6.16.46-0.14/fs/ext3/fiemap.h
++++ linux-2.6.9-67.0.15/fs/ext3/fiemap.h
 @@ -0,0 +1,49 @@
 +/*
 + * linux/fs/ext3/fiemap.h
 @@ -0,0 +1,49 @@
 +/*
 + * linux/fs/ext3/fiemap.h