Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-ea-in-inode-2.4.21-suse2.patch
index e1dab00..90ff24a 100644 (file)
@@ -10,19 +10,17 @@ Index: linux-2.4.21-chaos/fs/ext3/ialloc.c
 ===================================================================
 --- linux-2.4.21-chaos.orig/fs/ext3/ialloc.c   2003-12-12 17:39:10.000000000 +0300
 +++ linux-2.4.21-chaos/fs/ext3/ialloc.c        2003-12-12 17:39:55.000000000 +0300
-@@ -580,6 +580,12 @@
-       insert_inode_hash(inode);
+@@ -580,6 +580,10 @@
        inode->i_generation = sbi->s_next_generation++;
  
-+      if (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) {
-+              EXT3_I(inode)->i_extra_isize = sizeof(__u16)    /* i_extra_isize */
-+                              + sizeof(__u16);        /* i_pad1 */
-+      } else
-+              EXT3_I(inode)->i_extra_isize = 0;
-+
        inode->u.ext3_i.i_state = EXT3_STATE_NEW;
++      inode->u.ext3_i.i_extra_isize =
++              (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) ?
++              sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0;
++
        err = ext3_get_inode_loc_new(inode, &iloc, 1);
        if (err) goto fail;
+       BUFFER_TRACE(iloc->bh, "get_write_access");
 Index: linux-2.4.21-chaos/fs/ext3/inode.c
 ===================================================================
 --- linux-2.4.21-chaos.orig/fs/ext3/inode.c    2003-12-12 17:39:11.000000000 +0300
@@ -45,7 +43,7 @@ Index: linux-2.4.21-chaos/fs/ext3/inode.c
                        goto out_brelse;
        }
 +      if (EXT3_I(inode)->i_state & EXT3_STATE_NEW)
-+              memset(raw_inode, 0, EXT3_INODE_SIZE(inode->i_sb)); 
++              memset(raw_inode, 0, EXT3_INODE_SIZE(inode->i_sb));
        raw_inode->i_mode = cpu_to_le16(inode->i_mode);
        if(!(test_opt(inode->i_sb, NO_UID32))) {
                raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));
@@ -99,7 +97,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
  }
  
  /*
-+ * ext3_xattr_ibode_get()
++ * ext3_xattr_ibody_get()
 + *
 + * routine looks for attribute in inode body and returns it's value and size
 + */
@@ -179,7 +177,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +      /* try to find attribute in inode body */
 +      err = ext3_xattr_ibody_get(inode, name_index, name,
 +                                      buffer, buffer_size);
-+      if (err < 0) 
++      if (err < 0)
 +              /* search was unsuccessful, try to find EA in dedicated block */
 +              err = ext3_xattr_block_get(inode, name_index, name,
 +                              buffer, buffer_size);
@@ -222,7 +220,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +              return 0;
 +
 +      ret = ext3_get_inode_loc(inode, &iloc);
-+      if (ret) 
++      if (ret)
 +              return ret;
 +      raw_inode = iloc.raw_inode;
 +
@@ -302,7 +300,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +      /* get list of attributes stored in inode body */
 +      error = ext3_xattr_ibody_list(inode, buffer, buffer_size);
 +      if (error < 0) {
-+              /* some error occured while collecting 
++              /* some error occured while collecting
 +               * attributes in inode body */
 +              size = 0;
 +              goto cleanup;
@@ -315,12 +313,12 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +              if (buffer_size <= 0) {
 +                      buffer = NULL;
 +                      buffer_size = 0;
-+              } else 
++              } else
 +                      buffer += error;
 +      }
 +
 +      error = ext3_xattr_block_list(inode, buffer, buffer_size);
-+      if (error < 0) 
++      if (error < 0)
 +              /* listing was successful, so we return len */
 +              size = 0;
 +
@@ -331,7 +329,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
  /*
   * If the EXT3_FEATURE_COMPAT_EXT_ATTR feature of this file system is
   * not set, set it.
-@@ -480,6 +691,101 @@
+@@ -480,6 +691,102 @@
   */
  int
  ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
@@ -372,10 +370,11 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +              if (err != 0 && err != -ENOENT) {
 +                      /* not found EA in block */
 +                      goto finish;    
++              } else if (err == 0) {
++                      /* found EA in block */
++                      where = 1;
++                      found = 1;
 +              }
-+              /* found EA in block */
-+              where = 1;
-+              found = 1;
 +      } else
 +              goto finish;
 +
@@ -425,7 +424,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +
 +/*
 + * ext3_xattr_block_set()
-+ * 
++ *
 + * this routine add/remove/replace attribute in EA block
 + */
 +int
@@ -443,7 +442,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 + * NOTE: free space includes space our attribute hold
 + */
 +int
-+ext3_xattr_ibody_find(struct inode *inode, int name_index, 
++ext3_xattr_ibody_find(struct inode *inode, int name_index,
 +              const char *name, struct ext3_xattr_entry *rentry, int *free)
 +{
 +      struct ext3_xattr_entry *last;
@@ -458,7 +457,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +              return ret;
 +
 +      err = ext3_get_inode_loc(inode, &iloc);
-+      if (err) 
++      if (err)
 +              return -EIO;
 +      raw_inode = iloc.raw_inode;
 +
@@ -567,7 +566,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +
 +/*
 + * ext3_xattr_inode_set()
-+ * 
++ *
 + * this routine add/remove/replace attribute in inode body
 + */
 +int
@@ -627,7 +626,7 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +              }
 +              if (name_index == last->e_name_index &&
 +                      name_len == last->e_name_len &&
-+                      !memcmp(name, last->e_name, name_len)) 
++                      !memcmp(name, last->e_name, name_len))
 +                      here = last;
 +              else {
 +                      /* we calculate all but our attribute
@@ -664,9 +663,9 @@ Index: linux-2.4.21-chaos/fs/ext3/xattr.c
 +              e = (struct ext3_xattr_entry *) start;
 +              while (!IS_LAST_ENTRY(e)) {
 +                      struct ext3_xattr_entry *next = EXT3_XATTR_NEXT(e);
-+                      int offs = le16_to_cpu(e->e_value_offs); 
-+                      if (offs < border) 
-+                              e->e_value_offs = 
++                      int offs = le16_to_cpu(e->e_value_offs);
++                      if (offs < border)
++                              e->e_value_offs =
 +                                      cpu_to_le16(offs + size);
 +                      e = next;
 +              }
@@ -751,7 +750,7 @@ Index: linux-2.4.21-chaos/include/linux/ext3_fs_i.h
         */
        loff_t  i_disksize;
  
-+      /* on-disk additional lenght */
++      /* on-disk additional length */
 +      __u16 i_extra_isize;
 +
        /*