Displaying 6 results from an estimated 6 matches for "div_factor".
2010 Dec 12
0
[PATCH] Btrfs: pick the correct metadata allocation size on small devices
...+ u64 total_rw_bytes = root->fs_info->fs_devices->total_rw_bytes;
+ u64 max_chunk_size;
u64 thresh;
if (sinfo->bytes_used + sinfo->bytes_reserved +
@@ -3251,8 +3253,9 @@ static int should_alloc_chunk(struct btrfs_root *root,
alloc_bytes < div_factor(num_bytes, 8))
return 0;
+ max_chunk_size = min(256 * 1024 * 1024, div_factor(total_rw_bytes, 1));
thresh = btrfs_super_total_bytes(&root->fs_info->super_copy);
- thresh = max_t(u64, 256 * 1024 * 1024, div_factor_fine(thresh, 5));
+ thresh = max...
2008 Oct 10
1
[PATCH] fix enospc when there is plenty of space
...) {
- *start_ret = info->offset;
- return 0;
- }
-
-new_group:
- last = cache->key.objectid + cache->key.offset;
-
- cache = btrfs_lookup_first_block_group(root->fs_info, last);
- if (!cache)
- goto out;
-
- *cache_ret = cache;
- goto again;
-
-out:
- return -ENOSPC;
-}
-
-static u64 div_factor(u64 num, int factor)
-{
- if (factor == 10)
- return num;
- num *= factor;
- do_div(num, 10);
- return num;
-}
-
static struct btrfs_space_info *__find_space_info(struct btrfs_fs_info *info,
u64 flags)
{
@@ -384,6 +331,15 @@ static struct btrfs_space_info *__find_space_info(struct btrfs...
2011 May 02
5
[PATCH v3 0/3] btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates
chunks on the devices in the same order. This leads to a very uneven
distribution, especially with RAID1 or RAID10 and an uneven number of
devices.
This patch always sorts the devices before allocating, and allocates the
stripes on the devices with the most available space, as long as there
is enough space available. In a low
2011 Apr 12
3
[PATCH v2 0/3] btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates
chunks on the devices in the same order. This leads to a very uneven
distribution, especially with RAID1 or RAID10 and an uneven number of
devices.
This patch always sorts the devices before allocating, and allocates the
stripes on the devices with the most available space, as long as there
is enough space available. In a low
2011 Aug 23
40
[PATCH 00/21] [RFC] Btrfs: restriper
Hello,
This patch series adds an initial implementation of restriper (it''s a
clever name for relocation framework that allows to do selective profile
changing and selective balancing with some goodies like pausing/resuming
and reporting progress to the user.
Profile changing is global (per-FS) so far, per-subvolume profiles
require some discussion and can be implemented in future.
2012 Dec 13
22
[PATCH] Btrfs: fix a deadlock on chunk mutex
An user reported that he has hit an annoying deadlock while playing with
ceph based on btrfs.
Current updating device tree requires space from METADATA chunk,
so we -may- need to do a recursive chunk allocation when adding/updating
dev extent, that is where the deadlock comes from.
If we use SYSTEM metadata to update device tree, we can avoid the recursive
stuff.
Reported-by: Jim Schutt