Whamcloud - gitweb
land b_smallfix 20040407_1414:
[fs/lustre-release.git] / lustre / kernel_patches / patches / iopen-2.6-suse.patch
@@ -7,37 +7,10 @@
  include/linux/ext3_fs.h            |    2 
  7 files changed, 304 insertions(+), 1 deletion(-)
 
-Index: linux-2.6.0/Documentation/filesystems/ext2.txt
+Index: linux-2.6.4-51.1/fs/ext3/inode.c
 ===================================================================
---- linux-2.6.0.orig/Documentation/filesystems/ext2.txt        2002-11-11 06:28:06.000000000 +0300
-+++ linux-2.6.0/Documentation/filesystems/ext2.txt     2004-01-07 17:12:07.000000000 +0300
-@@ -35,6 +35,22 @@
- sb=n                          Use alternate superblock at this location.
-+iopen                         Makes an invisible pseudo-directory called 
-+                              __iopen__ available in the root directory
-+                              of the filesystem.  Allows open-by-inode-
-+                              number.  i.e., inode 3145 can be accessed
-+                              via /mntpt/__iopen__/3145
-+
-+iopen_nopriv                  This option makes the iopen directory be
-+                              world-readable.  This may be safer since it
-+                              allows daemons to run as an unprivileged user,
-+                              however it significantly changes the security
-+                              model of a Unix filesystem, since previously
-+                              all files under a mode 700 directory were not
-+                              generally avilable even if the
-+                              permissions on the file itself is
-+                              world-readable.
-+
- grpquota,noquota,quota,usrquota       Quota options are silently ignored by ext2.
-Index: linux-2.6.0/fs/ext3/inode.c
-===================================================================
---- linux-2.6.0.orig/fs/ext3/inode.c   2004-01-04 15:27:40.000000000 +0300
-+++ linux-2.6.0/fs/ext3/inode.c        2004-01-07 17:12:07.000000000 +0300
+--- linux-2.6.4-51.1.orig/fs/ext3/inode.c      2004-04-06 00:31:14.000000000 -0400
++++ linux-2.6.4-51.1/fs/ext3/inode.c   2004-04-06 00:31:24.000000000 -0400
 @@ -37,6 +37,7 @@
  #include <linux/mpage.h>
  #include <linux/uio.h>
@@ -55,10 +28,10 @@ Index: linux-2.6.0/fs/ext3/inode.c
        if (ext3_get_inode_loc(inode, &iloc, 0))
                goto bad_inode;
        bh = iloc.bh;
-Index: linux-2.6.0/fs/ext3/iopen.c
+Index: linux-2.6.4-51.1/fs/ext3/iopen.c
 ===================================================================
---- linux-2.6.0.orig/fs/ext3/iopen.c   2003-01-30 13:24:37.000000000 +0300
-+++ linux-2.6.0/fs/ext3/iopen.c        2004-01-07 17:14:22.000000000 +0300
+--- linux-2.6.4-51.1.orig/fs/ext3/iopen.c      2004-04-06 00:31:24.000000000 -0400
++++ linux-2.6.4-51.1/fs/ext3/iopen.c   2004-04-06 00:31:24.000000000 -0400
 @@ -0,0 +1,223 @@
 +
 +
@@ -68,7 +41,7 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 + * Special support for open by inode number
 + *
 + * Copyright (C) 2001 by Theodore Ts'o (tytso@alum.mit.edu).
-+ * 
++ *
 + * This file may be redistributed under the terms of the GNU General
 + * Public License.
 + */
@@ -94,8 +67,8 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +{
 +      struct inode * inode;
 +      unsigned long ino;
-+        struct list_head *lp;
-+        struct dentry *alternate;
++      struct list_head *lp;
++      struct dentry *alternate;
 +      char buf[IOPEN_NAME_LEN];
 +      
 +      if (dentry->d_name.len >= IOPEN_NAME_LEN)
@@ -126,24 +99,24 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +              return ERR_PTR(-ENOENT);
 +      }
 +
-+        /* preferrably return a connected dentry */
-+        spin_lock(&dcache_lock);
-+        list_for_each(lp, &inode->i_dentry) {
-+                alternate = list_entry(lp, struct dentry, d_alias);
-+                assert(!(alternate->d_flags & DCACHE_DISCONNECTED));
-+        }
-+
-+        if (!list_empty(&inode->i_dentry)) {
-+                alternate = list_entry(inode->i_dentry.next, 
-+                                       struct dentry, d_alias);
-+                dget_locked(alternate);
-+                alternate->d_vfs_flags |= DCACHE_REFERENCED;
-+                iput(inode);
-+                spin_unlock(&dcache_lock);
-+                return alternate;
-+        }
-+        dentry->d_flags |= DCACHE_DISCONNECTED;
-+        spin_unlock(&dcache_lock);
++      /* preferrably return a connected dentry */
++      spin_lock(&dcache_lock);
++      list_for_each(lp, &inode->i_dentry) {
++              alternate = list_entry(lp, struct dentry, d_alias);
++              assert(!(alternate->d_flags & DCACHE_DISCONNECTED));
++      }
++
++      if (!list_empty(&inode->i_dentry)) {
++              alternate = list_entry(inode->i_dentry.next,
++                                     struct dentry, d_alias);
++              dget_locked(alternate);
++              alternate->d_vfs_flags |= DCACHE_REFERENCED;
++              iput(inode);
++              spin_unlock(&dcache_lock);
++              return alternate;
++      }
++      dentry->d_flags |= DCACHE_DISCONNECTED;
++      spin_unlock(&dcache_lock);
 +
 +      d_add(dentry, inode);
 +      return NULL;
@@ -157,7 +130,7 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +{
 +      const unsigned char *old_name, *new_name;
 +
-+      memcpy(dentry->d_iname, target->d_iname, DNAME_INLINE_LEN); 
++      memcpy(dentry->d_iname, target->d_iname, DNAME_INLINE_LEN);
 +      old_name = target->d_name.name;
 +      new_name = dentry->d_name.name;
 +      if (old_name == target->d_iname)
@@ -171,37 +144,37 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +
 +struct dentry *iopen_connect_dentry(struct dentry *de, struct inode *inode)
 +{
-+        struct dentry *tmp, *goal = NULL;
-+        struct list_head *lp;
-+
-+        /* preferrably return a connected dentry */
-+        spin_lock(&dcache_lock);
-+        /* verify this dentry is really new */
-+        assert(!de->d_inode);
-+        assert(list_empty(&de->d_subdirs));
-+        assert(list_empty(&de->d_alias));
-+
-+
-+        list_for_each(lp, &inode->i_dentry) {
-+                tmp = list_entry(lp, struct dentry, d_alias);
-+                if (tmp->d_flags & DCACHE_DISCONNECTED) {
-+                        assert(tmp->d_alias.next == &inode->i_dentry);
-+                        assert(tmp->d_alias.prev == &inode->i_dentry);
-+                        goal = tmp;
-+                        dget_locked(goal);
-+                        break;
-+                }
-+        }
-+        spin_unlock(&dcache_lock);
-+
-+        if (!goal)
-+                return NULL; 
-+
-+        goal->d_flags &= ~DCACHE_DISCONNECTED;
++      struct dentry *tmp, *goal = NULL;
++      struct list_head *lp;
++
++      /* preferrably return a connected dentry */
++      spin_lock(&dcache_lock);
++      /* verify this dentry is really new */
++      assert(!de->d_inode);
++      assert(list_empty(&de->d_subdirs));
++      assert(list_empty(&de->d_alias));
++
++
++      list_for_each(lp, &inode->i_dentry) {
++              tmp = list_entry(lp, struct dentry, d_alias);
++              if (tmp->d_flags & DCACHE_DISCONNECTED) {
++                      assert(tmp->d_alias.next == &inode->i_dentry);
++                      assert(tmp->d_alias.prev == &inode->i_dentry);
++                      goal = tmp;
++                      dget_locked(goal);
++                      break;
++              }
++      }
++      spin_unlock(&dcache_lock);
++
++      if (!goal)
++              return NULL;
++
++      goal->d_flags &= ~DCACHE_DISCONNECTED;
 +      d_rehash(de);
 +      d_move(goal, de);
 +
-+        return goal;
++      return goal;
 +}
 +
 +/*
@@ -243,7 +216,7 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +
 +      inode = iget(dir->i_sb, EXT3_BAD_INO);
 +
-+      if (!inode) 
++      if (!inode)
 +              return 0;
 +      d_add(dentry, inode);
 +      return 1;
@@ -272,7 +245,7 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +      EXT3_I(inode)->i_dtime = 0;
 +      inode->i_blksize = PAGE_SIZE;   /* This is the optimal IO size
 +                                       * (for stat), not the fs block
-+                                       * size */  
++                                       * size */
 +      inode->i_blocks = 0;
 +      inode->i_version = 1;
 +      inode->i_generation = 0;
@@ -283,18 +256,18 @@ Index: linux-2.6.0/fs/ext3/iopen.c
 +
 +      return 1;
 +}
-Index: linux-2.6.0/fs/ext3/iopen.h
+Index: linux-2.6.4-51.1/fs/ext3/iopen.h
 ===================================================================
---- linux-2.6.0.orig/fs/ext3/iopen.h   2003-01-30 13:24:37.000000000 +0300
-+++ linux-2.6.0/fs/ext3/iopen.h        2004-01-07 17:12:07.000000000 +0300
+--- linux-2.6.4-51.1.orig/fs/ext3/iopen.h      2004-04-06 00:31:24.000000000 -0400
++++ linux-2.6.4-51.1/fs/ext3/iopen.h   2004-04-06 00:31:24.000000000 -0400
 @@ -0,0 +1,15 @@
 +/*
 + * iopen.h
 + *
 + * Special support for opening files by inode number.
-+ * 
++ *
 + * Copyright (C) 2001 by Theodore Ts'o (tytso@alum.mit.edu).
-+ * 
++ *
 + * This file may be redistributed under the terms of the GNU General
 + * Public License.
 + */
@@ -303,10 +276,10 @@ Index: linux-2.6.0/fs/ext3/iopen.h
 +extern int ext3_iopen_get_inode(struct inode * inode);
 +
 +
-Index: linux-2.6.0/fs/ext3/namei.c
+Index: linux-2.6.4-51.1/fs/ext3/namei.c
 ===================================================================
---- linux-2.6.0.orig/fs/ext3/namei.c   2004-01-04 15:27:40.000000000 +0300
-+++ linux-2.6.0/fs/ext3/namei.c        2004-01-07 17:12:45.000000000 +0300
+--- linux-2.6.4-51.1.orig/fs/ext3/namei.c      2004-04-06 00:31:11.000000000 -0400
++++ linux-2.6.4-51.1/fs/ext3/namei.c   2004-04-06 00:31:24.000000000 -0400
 @@ -37,6 +37,7 @@
  #include <linux/buffer_head.h>
  #include <linux/smp_lock.h>
@@ -320,7 +293,7 @@ Index: linux-2.6.0/fs/ext3/namei.c
  #endif
  
 +struct dentry *iopen_connect_dentry(struct dentry *de, struct inode *inode);
-+ 
++
  static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd)
  {
        struct inode * inode;
@@ -352,11 +325,11 @@ Index: linux-2.6.0/fs/ext3/namei.c
        d_add(dentry, inode);
        return NULL;
  }
-Index: linux-2.6.0/fs/ext3/super.c
+Index: linux-2.6.4-51.1/fs/ext3/super.c
 ===================================================================
---- linux-2.6.0.orig/fs/ext3/super.c   2004-01-04 15:27:40.000000000 +0300
-+++ linux-2.6.0/fs/ext3/super.c        2004-01-07 17:12:07.000000000 +0300
-@@ -535,7 +535,7 @@
+--- linux-2.6.4-51.1.orig/fs/ext3/super.c      2004-04-06 00:31:14.000000000 -0400
++++ linux-2.6.4-51.1/fs/ext3/super.c   2004-04-06 00:31:24.000000000 -0400
+@@ -536,7 +536,7 @@
        Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_noload,
        Opt_commit, Opt_journal_update, Opt_journal_inum,
        Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback,
@@ -365,7 +338,7 @@ Index: linux-2.6.0/fs/ext3/super.c
  };
  
  static match_table_t tokens = {
-@@ -574,6 +574,9 @@
+@@ -575,6 +575,9 @@
        {Opt_ignore, "noquota"},
        {Opt_ignore, "quota"},
        {Opt_ignore, "usrquota"},
@@ -375,7 +348,7 @@ Index: linux-2.6.0/fs/ext3/super.c
        {Opt_err, NULL}
  };
  
-@@ -761,6 +764,18 @@
+@@ -762,6 +765,18 @@
                case Opt_abort:
                        set_opt(sbi->s_mount_opt, ABORT);
                        break;
@@ -394,23 +367,10 @@ Index: linux-2.6.0/fs/ext3/super.c
                case Opt_ignore:
                        break;
                default:
-Index: linux-2.6.0/fs/ext3/Makefile
+Index: linux-2.6.4-51.1/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.0.orig/fs/ext3/Makefile  2003-09-19 18:00:24.000000000 +0400
-+++ linux-2.6.0/fs/ext3/Makefile       2004-01-07 17:12:07.000000000 +0300
-@@ -5,7 +5,7 @@
- obj-$(CONFIG_EXT3_FS) += ext3.o
- ext3-y        := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
--         ioctl.o namei.o super.o symlink.o hash.o
-+         ioctl.o namei.o super.o symlink.o hash.o iopen.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.0/include/linux/ext3_fs.h
-===================================================================
---- linux-2.6.0.orig/include/linux/ext3_fs.h   2004-01-04 15:27:40.000000000 +0300
-+++ linux-2.6.0/include/linux/ext3_fs.h        2004-01-07 17:12:07.000000000 +0300
+--- linux-2.6.4-51.1.orig/include/linux/ext3_fs.h      2004-04-06 00:31:11.000000000 -0400
++++ linux-2.6.4-51.1/include/linux/ext3_fs.h   2004-04-06 00:31:24.000000000 -0400
 @@ -325,6 +325,8 @@
  #define EXT3_MOUNT_NO_UID32           0x2000  /* Disable 32-bit UIDs */
  #define EXT3_MOUNT_XATTR_USER         0x4000  /* Extended user attributes */
@@ -420,3 +380,16 @@ Index: linux-2.6.0/include/linux/ext3_fs.h
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef _LINUX_EXT2_FS_H
+Index: linux-2.6.4-51.1/fs/ext3/Makefile
+===================================================================
+--- linux-2.6.4-51.1.orig/fs/ext3/Makefile     2004-04-06 00:27:21.000000000 -0400
++++ linux-2.6.4-51.1/fs/ext3/Makefile  2004-04-06 00:31:42.000000000 -0400
+@@ -5,7 +5,7 @@
+ obj-$(CONFIG_EXT3_FS) += ext3.o
+ ext3-y        := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
+-         ioctl.o namei.o super.o symlink.o hash.o
++         ioctl.o namei.o super.o symlink.o hash.o iopen.o
+ ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
+ ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o