Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable

* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: add check for changed leaves in setup_leaf_for_split
  Btrfs: create snapshot references in same commit as snapshot
  Btrfs: fix small race with delalloc flushing waitqueue's
  Btrfs: use add_to_page_cache_lru, use __page_cache_alloc
  Btrfs: fix chunk allocate size calculation
  Btrfs: kill max_extent mount option
  Btrfs: fail to mount if we have problems reading the block groups
  Btrfs: check btrfs_get_extent return for IS_ERR()
  Btrfs: handle kmalloc() failure in inode lookup ioctl
  Btrfs: dereferencing freed memory
  Btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk()
  Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()
  Btrfs: Remove unnecessary finish_wait() in wait_current_trans()
  Btrfs: add NULL check for do_walk_down()
  Btrfs: remove duplicate include in ioctl.c

Fix trivial conflict in fs/btrfs/compression.c due to slab.h include
cleanups.
This commit is contained in:
Linus Torvalds
2010-04-05 13:21:15 -07:00
12 changed files with 92 additions and 206 deletions

View File

@@ -2199,9 +2199,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
min_stripes = 2;
}
if (type & (BTRFS_BLOCK_GROUP_RAID1)) {
num_stripes = min_t(u64, 2, fs_devices->rw_devices);
if (num_stripes < 2)
if (fs_devices->rw_devices < 2)
return -ENOSPC;
num_stripes = 2;
min_stripes = 2;
}
if (type & (BTRFS_BLOCK_GROUP_RAID10)) {
@@ -2245,8 +2245,10 @@ again:
do_div(calc_size, stripe_len);
calc_size *= stripe_len;
}
/* we don't want tiny stripes */
calc_size = max_t(u64, min_stripe_size, calc_size);
if (!looped)
calc_size = max_t(u64, min_stripe_size, calc_size);
do_div(calc_size, stripe_len);
calc_size *= stripe_len;
@@ -3390,6 +3392,8 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
key.type = 0;
again:
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
goto error;
while (1) {
leaf = path->nodes[0];
slot = path->slots[0];