Merge branch 'for-chris-fixed' of git://git.jan-o-sch.net/btrfs-unstable
authorChris Mason <chris.mason@fusionio.com>
Thu, 25 Oct 2012 19:53:10 +0000 (15:53 -0400)
committerChris Mason <chris.mason@fusionio.com>
Thu, 25 Oct 2012 19:53:10 +0000 (15:53 -0400)
1  2 
fs/btrfs/backref.c
fs/btrfs/ctree.h

diff --combined fs/btrfs/backref.c
index b8b69266393a375f1ee8fbe5786e45126cf7adae,65608fbf2232f23780a5620b6c15db22f9084475..208d8aa5b07e488f1f39cb0877ff46bb5d08d5a6
@@@ -283,9 -283,7 +283,7 @@@ static int __resolve_indirect_ref(struc
                goto out;
        }
  
-       rcu_read_lock();
-       root_level = btrfs_header_level(root->node);
-       rcu_read_unlock();
+       root_level = btrfs_old_root_level(root, time_seq);
  
        if (root_level + 1 == level)
                goto out;
@@@ -1177,15 -1175,16 +1175,15 @@@ int btrfs_find_one_extref(struct btrfs_
        return ret;
  }
  
 -static char *ref_to_path(struct btrfs_root *fs_root,
 -                       struct btrfs_path *path,
 -                       u32 name_len, unsigned long name_off,
 -                       struct extent_buffer *eb_in, u64 parent,
 -                       char *dest, u32 size)
 +char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
 +                      u32 name_len, unsigned long name_off,
 +                      struct extent_buffer *eb_in, u64 parent,
 +                      char *dest, u32 size)
  {
        int slot;
        u64 next_inum;
        int ret;
 -      s64 bytes_left = size - 1;
 +      s64 bytes_left = ((s64)size) - 1;
        struct extent_buffer *eb = eb_in;
        struct btrfs_key found_key;
        int leave_spinning = path->leave_spinning;
@@@ -1265,10 -1264,10 +1263,10 @@@ char *btrfs_iref_to_path(struct btrfs_r
                         struct extent_buffer *eb_in, u64 parent,
                         char *dest, u32 size)
  {
 -      return ref_to_path(fs_root, path,
 -                         btrfs_inode_ref_name_len(eb_in, iref),
 -                         (unsigned long)(iref + 1),
 -                         eb_in, parent, dest, size);
 +      return btrfs_ref_to_path(fs_root, path,
 +                               btrfs_inode_ref_name_len(eb_in, iref),
 +                               (unsigned long)(iref + 1),
 +                               eb_in, parent, dest, size);
  }
  
  /*
@@@ -1714,8 -1713,9 +1712,8 @@@ static int inode_to_path(u64 inum, u32 
                                        ipath->fspath->bytes_left - s_ptr : 0;
  
        fspath_min = (char *)ipath->fspath->val + (i + 1) * s_ptr;
 -      fspath = ref_to_path(ipath->fs_root, ipath->btrfs_path, name_len,
 -                           name_off, eb, inum, fspath_min,
 -                           bytes_left);
 +      fspath = btrfs_ref_to_path(ipath->fs_root, ipath->btrfs_path, name_len,
 +                                 name_off, eb, inum, fspath_min, bytes_left);
        if (IS_ERR(fspath))
                return PTR_ERR(fspath);
  
diff --combined fs/btrfs/ctree.h
index 8a92ab1632a23382a7e095b3340376dc318d8f5b,34c5a442dd33032b6e76d93695ea7346802779b7..2ce1135400cf01c816af6e2f85a18bd18057f3e3
@@@ -3120,6 -3120,7 +3120,7 @@@ static inline u64 btrfs_inc_tree_mod_se
  {
        return atomic_inc_return(&fs_info->tree_mod_seq);
  }
+ int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq);
  
  /* root-item.c */
  int btrfs_find_root_ref(struct btrfs_root *tree_root,
@@@ -3338,8 -3339,6 +3339,8 @@@ struct extent_map *btrfs_get_extent(str
  int btrfs_update_inode(struct btrfs_trans_handle *trans,
                              struct btrfs_root *root,
                              struct inode *inode);
 +int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
 +                              struct btrfs_root *root, struct inode *inode);
  int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode);
  int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode);
  int btrfs_orphan_cleanup(struct btrfs_root *root);