Whamcloud - gitweb
Remove page.c from list of files (holdover from source Makefile.am)
authoradilger <adilger>
Wed, 8 May 2002 07:07:43 +0000 (07:07 +0000)
committeradilger <adilger>
Wed, 8 May 2002 07:07:43 +0000 (07:07 +0000)
Split the EXPORT stuff from the main patch to allow it to fail silently
if that patch is already applied to the ext3 sources in the kernel.
Minor changes to htree patch to disable debugging output.

lustre/extN/Makefile.am
lustre/extN/ext3-2.4.18-ino_sb_macro.diff [moved from lustre/extN/ext3-ino_sb-macro.diff with 99% similarity]
lustre/extN/extN-2.4.18-exports.diff [new file with mode: 0644]
lustre/extN/extN-2.4.18-ino_sb_fixup.diff [new file with mode: 0644]
lustre/extN/extN-ino_sb-fixup.diff [deleted file]
lustre/extN/htree-ext3-2.4.18.diff

index 1c72771..84934a1 100644 (file)
@@ -8,20 +8,18 @@ MODULE = extN
 modulefs_DATA = extN.o
 EXTRA_PROGRAMS = extN
 
-EXTNP = htree-ext3-2.4.18.diff ext3-ino_sb-macro.diff
+EXTNP = htree-ext3-2.4.18.diff ext3-2.4.18-ino_sb_macro.diff
+EXTNP+= extN-misc-fixup.diff
 EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c
 EXTNC+= namei.c super.c symlink.c
 EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h
-extN_SOURCES = $(EXTNC) $(EXTNI) page.c # punch.c
+extN_SOURCES = $(EXTNC) $(EXTNI) # punch.c
 EXTRA_DIST = $(EXTNP)
 DISTCLEANFILES = $(EXTNC) $(EXTNI) patch-stamp *.orig *.rej
 SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g"
 
 include $(top_srcdir)/Rules
 
-page.c:
-       test -e page.c || ln -sf $(top_srcdir)/lib/page.c
-
 # Patch the kernel files with our ext3 patches.  We need to go through some
 # extra hoops because the include files are in a different tree and because
 # patch likes to make local copies of files with (sym)links when it is patching
@@ -44,7 +42,8 @@ patch-stamp:
        list='$(EXTNP)'; for p in $$list; do                                  \
        sed $(SUB) $(srcdir)/$$p | (cd $(top_srcdir); patch -p1);             \
        done
-       (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-ino_sb-fixup.diff
+       (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-2.4.18-ino_sb_fixup.diff
+       -(cd $(top_srcdir); patch -p1) < $(srcdir)/extN-2.4.18-exports.diff
        echo timestamp > patch-stamp
 
 # Don't distribute any patched files.
similarity index 99%
rename from lustre/extN/ext3-ino_sb-macro.diff
rename to lustre/extN/ext3-2.4.18-ino_sb_macro.diff
index 85826ef..1d1e4ac 100644 (file)
                 * Try to place the inode in its parent directory
                 */
 -              i = dir->u.ext3_i.i_block_group;
-+              i = EXT3_I(dir)->i_block_group + 1;
++              i = EXT3_I(dir)->i_block_group;
                tmp = ext3_get_group_desc (sb, i, &bh2);
                if (tmp && le16_to_cpu(tmp->bg_free_inodes_count))
                        gdp = tmp;
diff --git a/lustre/extN/extN-2.4.18-exports.diff b/lustre/extN/extN-2.4.18-exports.diff
new file mode 100644 (file)
index 0000000..8780209
--- /dev/null
@@ -0,0 +1,11 @@
+--- linux-2.4.17/fs/extN/super.c.orig  Fri Dec 21 10:41:55 2001
++++ linux-2.4.17/fs/extN/super.c       Fri Mar 22 11:00:41 2002
+@@ -1742,7 +1742,7 @@
+       unregister_filesystem(&extN_fs_type);
+ }
+-EXPORT_NO_SYMBOLS;
++EXPORT_SYMBOL(extN_bread);
+ MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
+ MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
diff --git a/lustre/extN/extN-2.4.18-ino_sb_fixup.diff b/lustre/extN/extN-2.4.18-ino_sb_fixup.diff
new file mode 100644 (file)
index 0000000..f6bebf9
--- /dev/null
@@ -0,0 +1,33 @@
+--- ./include/linux/extN_fs.h.orig     Tue May  7 17:06:03 2002
++++ ./include/linux/extN_fs.h  Tue May  7 17:07:11 2002
+@@ -17,6 +17,8 @@
+ #define _LINUX_EXTN_FS_H
+ #include <linux/types.h>
++#include <linux/extN_fs_sb.h>
++#include <linux/extN_fs_i.h>
+ /*
+  * The second extended filesystem constants/structures
+@@ -86,8 +88,8 @@
+ #define EXTN_MIN_BLOCK_LOG_SIZE                 10
+ #ifdef __KERNEL__
+-#define EXTN_SB(sb)   (&((sb)->u.extN_sb))
+-#define EXTN_I(inode) (&((inode)->u.extN_i))
++#define EXTN_SB(sb)   ((struct extN_sb_info *)&((sb)->u.generic_sbp))
++#define EXTN_I(inode) ((struct extN_inode_info *)&((inode)->u.generic_ip))
+ #define EXTN_BLOCK_SIZE(s)            ((s)->s_blocksize)
+ #define EXTN_BLOCK_SIZE_BITS(s)               ((s)->s_blocksize_bits)
+@@ -445,7 +445,9 @@
+ };
+ #define NEXT_ORPHAN(inode) EXTN_I(inode)->i_dtime
+-#define orphan_list_entry(l) list_entry((l), struct inode, u.extN_i.i_orphan)
++#define orphan_list_entry(l) ((struct inode *)((char *)(l) - \
++              (unsigned long)(offsetof(struct inode, u.generic_ip) + \
++                              offsetof(struct extN_inode_info, i_orphan))))
+ /*
+  * Codes for operating systems
diff --git a/lustre/extN/extN-ino_sb-fixup.diff b/lustre/extN/extN-ino_sb-fixup.diff
deleted file mode 100644 (file)
index b715a39..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
---- ./fs/extN/namei.c.orig     Tue May  7 17:10:31 2002
-+++ ./fs/extN/namei.c  Tue May  7 17:13:27 2002
-@@ -1080,7 +1080,7 @@ dx_make_index:
-               root = (struct dx_root *) bh->b_data;
-               
-               extN_add_compat_feature (sb, EXTN_FEATURE_COMPAT_DIR_INDEX);
--              dir->u.extN_i.i_flags |= EXTN_INDEX_FL;
-+              EXTN_I(dir)->i_flags |= EXTN_INDEX_FL;
-               bh2 = extN_append (handle, dir, &block, &retval);
-               if (!(bh2))
-               {
-@@ -1321,7 +1321,7 @@ static int extN_mkdir(struct inode * dir
-       if (err)
-               goto out_no_entry;
-       dir->i_nlink++;
--      dir->u.extN_i.i_flags &= ~EXTN_INDEX_FL;
-+      EXTN_I(dir)->i_flags &= ~EXTN_INDEX_FL;
-       extN_mark_inode_dirty(handle, dir);
-       d_instantiate(dentry, inode);
- out_stop:
-@@ -1596,7 +1595,7 @@ static int extN_rmdir (struct inode * di
-       extN_mark_inode_dirty(handle, inode);
-       dir->i_nlink--;
-       inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
--      //      dir->u.extN_i.i_flags &= ~EXTN_INDEX_FL;
-+      //      EXTN_I(dir)->i_flags &= ~EXTN_INDEX_FL;
-       extN_mark_inode_dirty(handle, dir);
- end_rmdir:
-@@ -1642,7 +1641,7 @@ static int extN_unlink(struct inode * di
-       if (retval)
-               goto end_unlink;
-       dir->i_ctime = dir->i_mtime = CURRENT_TIME;
--      //      dir->u.extN_i.i_flags &= ~EXTN_INDEX_FL;
-+      //      EXTN_I(dir)->i_flags &= ~EXTN_INDEX_FL;
-       extN_mark_inode_dirty(handle, dir);
-       inode->i_nlink--;
-       if (!inode->i_nlink)
-@@ -1844,7 +1843,7 @@ static int extN_rename (struct inode * o
-               new_inode->i_ctime = CURRENT_TIME;
-       }
-       old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
--      // old_dir->u.extN_i.i_flags &= ~EXTN_INDEX_FL;
-+      // EXTN_I(old_dir)->i_flags &= ~EXTN_INDEX_FL;
-       if (dir_bh) {
-               BUFFER_TRACE(dir_bh, "get_write_access");
-               extN_journal_get_write_access(handle, dir_bh);
-@@ -1856,7 +1855,7 @@ static int extN_rename (struct inode * o
-                       new_inode->i_nlink--;
-               } else {
-                       new_dir->i_nlink++;
--      //              new_dir->u.extN_i.i_flags &= ~EXTN_INDEX_FL;
-+      //              EXTN_I(new_dir)->i_flags &= ~EXTN_INDEX_FL;
-                       extN_mark_inode_dirty(handle, new_dir);
-               }
-       }
---- linux-2.4.17/fs/extN/super.c.orig  Fri Dec 21 10:41:55 2001
-+++ linux-2.4.17/fs/extN/super.c       Fri Mar 22 11:00:41 2002
-@@ -1742,7 +1742,7 @@
-       unregister_filesystem(&extN_fs_type);
- }
--EXPORT_NO_SYMBOLS;
-+EXPORT_SYMBOL(extN_bread);
- MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
- MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
---- ./include/linux/extN_fs.h.orig     Tue May  7 17:06:03 2002
-+++ ./include/linux/extN_fs.h  Tue May  7 17:07:11 2002
-@@ -17,6 +17,8 @@
- #define _LINUX_EXTN_FS_H
- #include <linux/types.h>
-+#include <linux/extN_fs_sb.h>
-+#include <linux/extN_fs_i.h>
- /*
-  * The second extended filesystem constants/structures
-@@ -86,8 +88,8 @@
- #define EXTN_MIN_BLOCK_LOG_SIZE                 10
- #ifdef __KERNEL__
--#define EXTN_SB(sb)   (&((sb)->u.extN_sb))
--#define EXTN_I(inode) (&((inode)->u.extN_i))
-+#define EXTN_SB(sb)   ((struct extN_sb_info *)&((sb)->u.generic_sbp))
-+#define EXTN_I(inode) ((struct extN_inode_info *)&((inode)->u.generic_ip))
- #define EXTN_BLOCK_SIZE(s)            ((s)->s_blocksize)
- #define EXTN_BLOCK_SIZE_BITS(s)               ((s)->s_blocksize_bits)
-@@ -445,7 +445,9 @@
- };
- #define NEXT_ORPHAN(inode) EXTN_I(inode)->i_dtime
--#define orphan_list_entry(l) list_entry((l), struct inode, u.extN_i.i_orphan)
-+#define orphan_list_entry(l) ((struct inode *)((char *)(l) - \
-+              (unsigned long)(offsetof(struct inode, u.generic_ip) + \
-+                              offsetof(struct extN_inode_info, i_orphan))))
- /*
-  * Codes for operating systems
-@@ -581,7 +583,7 @@ struct extN_dir_entry_2 {
- #ifdef CONFIG_EXTN_INDEX
-   enum {extN_dx = 1};
-   #define dx_static static
--  #define is_dx(dir) ((dir)->u.extN_i.i_flags & EXTN_INDEX_FL)
-+  #define is_dx(dir) (EXTN_I(dir)->i_flags & EXTN_INDEX_FL)
- #define EXTN_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXTN_LINK_MAX)
- #define EXTN_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
- #else
index 583f9d9..ea74497 100644 (file)
@@ -28,7 +28,7 @@
 +#ifdef CONFIG_EXT3_INDEX
 +                      set_opt (*mount_options, INDEX);
 +#else
-+                      printk("EXT3 Index option not supported\n");
++                      printk("EXT3 index option not supported\n");
 +#endif
                else if (!strcmp (this_char, "debug"))
                        set_opt (*mount_options, DEBUG);
@@ -57,7 +57,7 @@
   */
  
  #include <linux/fs.h>
-@@ -38,6 +42,436 @@
+@@ -38,6 +42,435 @@
  #define NAMEI_RA_SIZE        (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
  #define NAMEI_RA_INDEX(c,b)  (((c) * NAMEI_RA_BLOCKS) + (b))
  
 +};
 +
 +typedef struct ext3_dir_entry_2 ext3_dirent;
-+/* dx_static exists purely to suppress compiler warnings */
 +static inline unsigned dx_get_block (struct dx_entry *entry);
 +static void dx_set_block (struct dx_entry *entry, unsigned value);
 +static inline unsigned dx_get_hash (struct dx_entry *entry);
 +      de = (ext3_dirent *) ((char *) de - data3 + data1); // relocate de
 +      de->rec_len = cpu_to_le16(data1 + blocksize - (char *) de);
 +      de2->rec_len = cpu_to_le16(data2 + blocksize - (char *) de2);
-+      dxtrace_on(dx_show_leaf ((ext3_dirent *) data1, blocksize, 1));
-+      dxtrace_on(dx_show_leaf ((ext3_dirent *) data2, blocksize, 1));
++      dxtrace(dx_show_leaf ((ext3_dirent *) data1, blocksize, 1));
++      dxtrace(dx_show_leaf ((ext3_dirent *) data2, blocksize, 1));
 +
 +      /* Which block gets the new entry? */
 +      if (hash >= hash2)
 +      ext3_journal_dirty_metadata (handle, bh2);
 +      brelse (bh2);
 +      ext3_journal_dirty_metadata (handle, frame->bh);
-+      dxtrace_on(dx_show_index ("frame", frame->entries));
++      dxtrace(dx_show_index ("frame", frame->entries));
 +      return de;
 +}
 +#endif
 +                      de = (ext3_dirent *) ((char *) de + rlen);
 +              }
 +              /* Block full, should compress but for now just split */
-+              dxtrace_on(printk("using %u of %u node entries\n",
++              dxtrace(printk("using %u of %u node entries\n",
 +                      dx_get_count(entries), dx_get_limit(entries)));
 +              /* Need to split index? */
 +              if (dx_get_count(entries) == dx_get_limit(entries))
 +                      {
 +                              unsigned icount1 = icount/2, icount2 = icount - icount1;
 +                              unsigned hash2 = dx_get_hash(entries + icount1);
-+                              dxtrace_on(printk("Split index %i/%i\n", icount1, icount2));
++                              dxtrace(printk("Split index %i/%i\n", icount1, icount2));
 +                              
 +                              BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */
 +                              ext3_journal_get_write_access(handle, frames[0].bh);
 -                              dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
 -                              ext3_mark_inode_dirty(handle, dir);
 +                              dx_insert_block (frames + 0, hash2, newblock);
-+                              dxtrace_on(dx_show_index ("node", frames[1].entries));
-+                              dxtrace_on(dx_show_index ("node",
++                              dxtrace(dx_show_index ("node", frames[1].entries));
++                              dxtrace(dx_show_index ("node",
 +                                      ((struct dx_node *) bh2->b_data)->entries));
 +                              ext3_journal_dirty_metadata(handle, bh2);
 +                              brelse (bh2);
 -                              ext3_debug ("skipping to next block\n");
 -
 -                              de = (struct ext3_dir_entry_2 *) bh->b_data;
-+                              dxtrace_on(printk("Creating second level index...\n"));
++                              dxtrace(printk("Creating second level index...\n"));
 +                              memcpy((char *) entries2, (char *) entries,
 +                                      icount * sizeof(struct dx_entry));
 +                              dx_set_limit(entries2, dx_node_limit(dir));
 +              goto add;
 +
 +dxfull:
-+              dxtrace_on(printk("Directory index full!\n"));
++              ext3_warning(sb, __FUNCTION__, "Directory index full!\n"));
 +              retval = -ENOSPC;
 +dxfail2:
 +              brelse(bh);
 +       * and/or different from the directory change time.
 +       */
 +      dir->i_mtime = dir->i_ctime = CURRENT_TIME;
-+      /* dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL; */
++      /* EXT3_I(dir)->i_flags &= ~EXT3_INDEX_FL; */
 +      ext3_mark_inode_dirty(handle, dir);
 +      dir->i_version = ++event;
 +      BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
 +              unsigned len;
 +              u32 hash;
 +              
-+              dxtrace_on(printk("Creating index\n"));
++              dxtrace(printk("Creating index\n"));
 +              ext3_journal_get_write_access(handle, bh);
 +              root = (struct dx_root *) bh->b_data;
 +              
 +              ext3_add_compat_feature (sb, EXT3_FEATURE_COMPAT_DIR_INDEX);
-+              dir->u.ext3_i.i_flags |= EXT3_INDEX_FL;
++              EXT3_I(dir)->i_flags |= EXT3_INDEX_FL;
 +              bh2 = ext3_append (handle, dir, &block, &retval);
 +              if (!(bh2))
 +              {
  
 -      handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS + 3);
 +      handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-+                                      EXT3_INDEX_EXTRA_TRANS_BLOCKS+3);
++                                      EXT3_INDEX_EXTRA_TRANS_BLOCKS + 3);
        if (IS_ERR(handle))
                return PTR_ERR(handle);
  
        dir->i_nlink--;
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 -      dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
-+      //      dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
++      //      EXT3_I(dir)->i_flags &= ~EXT3_INDEX_FL;
        ext3_mark_inode_dirty(handle, dir);
  
  end_rmdir:
                goto end_unlink;
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 -      dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
-+      //      dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
++      //      EXT3_I(dir)->i_flags &= ~EXT3_INDEX_FL;
        ext3_mark_inode_dirty(handle, dir);
        inode->i_nlink--;
        if (!inode->i_nlink)
  
 -      handle = ext3_journal_start(old_dir, 2 * EXT3_DATA_TRANS_BLOCKS + 2);
 +      handle = ext3_journal_start(old_dir, 2 * EXT3_DATA_TRANS_BLOCKS +
-+                                      EXT3_INDEX_EXTRA_TRANS_BLOCKS+ 2);
++                                      EXT3_INDEX_EXTRA_TRANS_BLOCKS + 2);
        if (IS_ERR(handle))
                return PTR_ERR(handle);
  
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
 -      old_dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
-+      // old_dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
++      // EXT3_I(old_dir)->i_flags &= ~EXT3_INDEX_FL;
        if (dir_bh) {
                BUFFER_TRACE(dir_bh, "get_write_access");
                ext3_journal_get_write_access(handle, dir_bh);
                } else {
                        new_dir->i_nlink++;
 -                      new_dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
-+      //              new_dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
++      //              EXT3_I(new_dir)->i_flags &= ~EXT3_INDEX_FL;
                        ext3_mark_inode_dirty(handle, new_dir);
                }
        }
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef _LINUX_EXT2_FS_H
-@@ -575,6 +576,26 @@
+@@ -575,6 +576,24 @@
  #define EXT3_DIR_ROUND                        (EXT3_DIR_PAD - 1)
  #define EXT3_DIR_REC_LEN(name_len)    (((name_len) + 8 + EXT3_DIR_ROUND) & \
                                         ~EXT3_DIR_ROUND)
 +
 +#ifdef CONFIG_EXT3_INDEX
 +  enum {ext3_dx = 1};
-+  #define dx_static static
-+  #define is_dx(dir) ((dir)->u.ext3_i.i_flags & EXT3_INDEX_FL)
++  #define is_dx(dir) (EXT3_I(dir)->i_flags & EXT3_INDEX_FL)
 +#define EXT3_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT3_LINK_MAX)
 +#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
 +#else
 +  enum {ext3_dx = 0};
-+  #define dx_static
 +  #define is_dx(dir) 0
 +#define EXT3_DIR_LINK_MAX(dir) ((dir)->i_nlink >= EXT3_LINK_MAX)
 +#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2)