aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-01 11:28:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-01 11:28:53 -0500
commitb930c26416c4ea6855726fd977145ccea9afbdda (patch)
treeae18b550c5918ba36f92d0971cc7f2cc8918a05d /fs/btrfs/super.c
parent11d814a20166461358e1cefaf6bcd425698b8460 (diff)
parentf4a8e6563ea5366f563cb741a27fe90c5fa7f0fc (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: fix meta data raid-repair merge problem Btrfs: skip allocation attempt from empty cluster Btrfs: skip block groups without enough space for a cluster Btrfs: start search for new cluster at the beginning Btrfs: reset cluster's max_size when creating bitmap Btrfs: initialize new bitmaps' list Btrfs: fix oops when calling statfs on readonly device Btrfs: Don't error on resizing FS to same size Btrfs: fix deadlock on metadata reservation when evicting a inode Fix URL of btrfs-progs git repository in docs btrfs scrub: handle -ENOMEM from init_ipath()
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 17ee7fc5e64e..e28ad4baf483 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1057,7 +1057,7 @@ static int btrfs_calc_avail_data_space(struct btrfs_root *root, u64 *free_bytes)
1057 int i = 0, nr_devices; 1057 int i = 0, nr_devices;
1058 int ret; 1058 int ret;
1059 1059
1060 nr_devices = fs_info->fs_devices->rw_devices; 1060 nr_devices = fs_info->fs_devices->open_devices;
1061 BUG_ON(!nr_devices); 1061 BUG_ON(!nr_devices);
1062 1062
1063 devices_info = kmalloc(sizeof(*devices_info) * nr_devices, 1063 devices_info = kmalloc(sizeof(*devices_info) * nr_devices,
@@ -1079,8 +1079,8 @@ static int btrfs_calc_avail_data_space(struct btrfs_root *root, u64 *free_bytes)
1079 else 1079 else
1080 min_stripe_size = BTRFS_STRIPE_LEN; 1080 min_stripe_size = BTRFS_STRIPE_LEN;
1081 1081
1082 list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) { 1082 list_for_each_entry(device, &fs_devices->devices, dev_list) {
1083 if (!device->in_fs_metadata) 1083 if (!device->in_fs_metadata || !device->bdev)
1084 continue; 1084 continue;
1085 1085
1086 avail_space = device->total_bytes - device->bytes_used; 1086 avail_space = device->total_bytes - device->bytes_used;