Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-ea-in-inode-2.6-suse.patch
index 39fa9ce..72c25a4 100644 (file)
@@ -3,15 +3,13 @@ Index: linux-2.6.0/fs/ext3/ialloc.c
 ===================================================================
 --- linux-2.6.0.orig/fs/ext3/ialloc.c  2004-01-14 18:54:11.000000000 +0300
 +++ linux-2.6.0/fs/ext3/ialloc.c       2004-01-14 18:54:12.000000000 +0300
-@@ -627,6 +627,11 @@
+@@ -627,6 +627,9 @@
        inode->i_generation = EXT3_SB(sb)->s_next_generation++;
  
        ei->i_state = EXT3_STATE_NEW;
-+      if (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) {
-+              ei->i_extra_isize = sizeof(__u16)       /* i_extra_isize */
-+                              + sizeof(__u16);        /* i_pad1 */
-+      } else
-+              ei->i_extra_isize = 0;
++      ei->i_extra_isize =
++              (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) ?
++              sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0;
  
        ret = inode;
        if(DQUOT_ALLOC_INODE(inode)) {
@@ -50,6 +48,16 @@ Index: linux-2.6.0/fs/ext3/inode.c
        BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
        rc = ext3_journal_dirty_metadata(handle, bh);
        if (!err)
+@@ -2849,7 +2857,8 @@ ext3_reserve_inode_write(handle_t *handl
+ {
+       int err = 0;
+       if (handle) {
+-              err = ext3_get_inode_loc(inode, iloc, 1);
++              err = ext3_get_inode_loc(inode, iloc, EXT3_I(inode)->i_state &
++                                                      EXT3_STATE_NEW);
+               if (!err) {
+                       BUFFER_TRACE(iloc->bh, "get_write_access");
+                       err = ext3_journal_get_write_access(handle, iloc->bh);
 Index: linux-2.6.0/fs/ext3/xattr.c
 ===================================================================
 --- linux-2.6.0.orig/fs/ext3/xattr.c   2003-12-30 08:33:13.000000000 +0300
@@ -94,7 +102,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
  
  /*
 - * ext3_xattr_list()
-+ * ext3_xattr_ibode_get()
++ * ext3_xattr_ibody_get()
   *
 - * Copy a list of attribute names into the buffer
 + * routine looks for attribute in inode body and returns it's value and size
@@ -113,7 +121,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +      if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
 +              return -ENOENT;
 +
-+      ret = ext3_get_inode_loc(inode, &iloc);
++      ret = ext3_get_inode_loc(inode, &iloc, 0);
 +      if (ret)
 +              return ret;
 +      raw_inode = ext3_raw_inode(&iloc);
@@ -215,15 +223,6 @@ Index: linux-2.6.0/fs/ext3/xattr.c
        error = 0;
        if (!EXT3_I(inode)->i_file_acl)
                goto cleanup;
-@@ -380,7 +469,7 @@
-       if (!bh)
-               goto cleanup;
-       ea_bdebug(bh, "b_count=%d, refcount=%d",
--              atomic_read(&(bh->b_count)), le32_to_cpu(HDR(bh)->h_refcount));
-+              (int) atomic_read(&(bh->b_count)), (int) le32_to_cpu(HDR(bh)->h_refcount));
-       end = bh->b_data + bh->b_size;
-       if (HDR(bh)->h_magic != cpu_to_le32(EXT3_XATTR_MAGIC) ||
-           HDR(bh)->h_blocks != cpu_to_le32(1)) {
 @@ -431,11 +520,138 @@
  
  cleanup:
@@ -251,7 +250,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +      if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
 +              return 0;
 +
-+      ret = ext3_get_inode_loc(inode, &iloc);
++      ret = ext3_get_inode_loc(inode, &iloc, 0);
 +      if (ret)
 +              return ret;
 +      raw_inode = ext3_raw_inode(&iloc);
@@ -388,7 +387,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +      if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
 +              return ret;
 +
-+      err = ext3_get_inode_loc(inode, &iloc);
++      err = ext3_get_inode_loc(inode, &iloc, 0);
 +      if (err)
 +              return -EIO;
 +      raw_inode = ext3_raw_inode(&iloc);
@@ -519,7 +518,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +      if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
 +              return -ENOSPC;
 +
-+      err = ext3_get_inode_loc(inode, &iloc);
++      err = ext3_get_inode_loc(inode, &iloc, 0);
 +      if (err)
 +              return err;
 +      raw_inode = ext3_raw_inode(&iloc);
@@ -626,9 +625,9 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +              memset(last->e_name, 0, esize);
 +              memcpy(last->e_name, name, last->e_name_len);
 +              if (start + offs + value_len > end)
-+                      printk("ALERT at %s:%d: 0x%p + %d + %d > 0x%p\n",
-+                                      __FILE__, __LINE__, start, offs,
-+                                      value_len, end);
++                      printk("ALERT at %s:%d: 0x%p + %d + %zd > 0x%p\n",
++                             __FILE__, __LINE__, start, offs,
++                             value_len, end);
 +              memcpy(start + offs, value, value_len);
 +              last = EXT3_XATTR_NEXT(last);
 +              *((__u32 *) last) = 0;
@@ -807,6 +806,14 @@ Index: linux-2.6.0/include/linux/ext3_fs.h
  };
  
  #define i_size_high   i_dir_acl
+@@ -721,6 +723,7 @@
+ 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 *);
++int ext3_get_inode_loc(struct inode *inode, struct ext3_iloc *iloc, int in_mem);
+ extern void ext3_read_inode (struct inode *);
+ extern void ext3_write_inode (struct inode *, int);
 Index: linux-2.6.0/include/linux/ext3_fs_i.h
 ===================================================================
 --- linux-2.6.0.orig/include/linux/ext3_fs_i.h 2003-12-30 08:32:44.000000000 +0300