Merge branch 'cleanups_and_fixes' into inode_numbers
authorChris Mason <chris.mason@oracle.com>
Mon, 23 May 2011 18:37:47 +0000 (14:37 -0400)
committerChris Mason <chris.mason@oracle.com>
Mon, 23 May 2011 18:37:47 +0000 (14:37 -0400)
Conflicts:
fs/btrfs/tree-log.c
fs/btrfs/volumes.c

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 files changed:
1  2 
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/dir-item.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/file-item.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c
fs/btrfs/super.c
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -638,11 -630,12 +637,12 @@@ int btrfs_del_csums(struct btrfs_trans_
                        if (key.offset < bytenr)
                                break;
                }
 -              btrfs_release_path(root, path);
 +              btrfs_release_path(path);
        }
+       ret = 0;
  out:
        btrfs_free_path(path);
-       return 0;
+       return ret;
  }
  
  int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -675,10 -675,13 +675,13 @@@ static noinline int drop_one_dir_item(s
                return -ENOMEM;
  
        read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len);
 -      btrfs_release_path(root, path);
 +      btrfs_release_path(path);
  
        inode = read_one_inode(root, location.objectid);
-       BUG_ON(!inode);
+       if (!inode) {
+               kfree(name);
+               return -EIO;
+       }
  
        ret = link_to_fixup_dir(trans, root, path, location.objectid);
        BUG_ON(ret);
@@@ -1051,11 -1056,13 +1057,13 @@@ static noinline int fixup_inode_link_co
                        break;
  
                ret = btrfs_del_item(trans, root, path);
-               BUG_ON(ret);
+               if (ret)
+                       goto out;
  
 -              btrfs_release_path(root, path);
 +              btrfs_release_path(path);
                inode = read_one_inode(root, key.offset);
-               BUG_ON(!inode);
+               if (!inode)
+                       return -EIO;
  
                ret = fixup_inode_link_count(trans, root, inode);
                BUG_ON(ret);
                 */
                key.offset = (u64)-1;
        }
 -      btrfs_release_path(root, path);
+       ret = 0;
+ out:
-       return 0;
 +      btrfs_release_path(path);
+       return ret;
  }
  
  
@@@ -1427,12 -1438,15 +1439,15 @@@ again
                                                     dir_key->offset,
                                                     name, name_len, 0);
                }
 -              if (!log_di || IS_ERR(log_di)) {
 +              if (IS_ERR_OR_NULL(log_di)) {
                        btrfs_dir_item_key_to_cpu(eb, di, &location);
 -                      btrfs_release_path(root, path);
 -                      btrfs_release_path(log, log_path);
 +                      btrfs_release_path(path);
 +                      btrfs_release_path(log_path);
                        inode = read_one_inode(root, location.objectid);
-                       BUG_ON(!inode);
+                       if (!inode) {
+                               kfree(name);
+                               return -EIO;
+                       }
  
                        ret = link_to_fixup_dir(trans, root,
                                                path, location.objectid);
@@@ -2589,10 -2602,11 +2604,11 @@@ static int drop_objectid_items(struct b
                        break;
  
                ret = btrfs_del_item(trans, log, path);
-               BUG_ON(ret);
+               if (ret)
+                       break;
 -              btrfs_release_path(log, path);
 +              btrfs_release_path(path);
        }
 -      btrfs_release_path(log, path);
 +      btrfs_release_path(path);
        return ret;
  }
  
Simple merge
@@@ -85,10 -85,9 +85,12 @@@ struct btrfs_device 
        /* physical drive uuid (or lvm uuid) */
        u8 uuid[BTRFS_UUID_SIZE];
  
 +      /* per-device scrub information */
 +      struct scrub_dev *scrub_device;
 +
        struct btrfs_work work;
+       struct rcu_head rcu;
+       struct work_struct rcu_work;
  };
  
  struct btrfs_fs_devices {