[PATCH V2 1/2] Btrfs-progs: make pretty_sizes() work less error prone

2013-07-07 Thread Wang Shilong
From: Wang Shilong wangsl-f...@cn.fujitsu.com In the original code, pretty_sizes() may return NULL in two cases: 1 Allocating memory dynamically fails 2 Overflow happens(size exceeds YB) Since we are limited to 16EB both theoretically and practically due to everything being 64bit, we can just

[PATCH V2] Btrfs-progs: fix compile warning in btrfs_free_block_groups()

2013-07-07 Thread Wang Shilong
From: Wang Shilong wangsl-f...@cn.fujitsu.com extent-tree.c: In function 'btrfs_free_block_groups': extent-tree.c:3189:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com --- V1-V2: use 'uintptr_t' instead of

Re: [PATCH 0/2] introduce list_for_each_entry_del

2013-07-07 Thread Dave Chinner
On Fri, Jul 05, 2013 at 04:41:00PM -0400, Jörn Engel wrote: On Mon, 3 June 2013 13:28:03 -0400, Joern Engel wrote: A purely janitorial patchset. A fairly common pattern is to take a list, remove every object from it and do something with this object - usually kfree() some variant. A

Re: [PATCH 03/12] Btrfs-progs: Don't free the devices when close the ctree

2013-07-07 Thread Anand Jain
btrfs_close_devices() should reset fs_devices-latest_bdev and fs_devices-lowest_bdev as well they hold fd of the open dev in the list which is being closed. On 07/03/2013 09:25 PM, Miao Xie wrote: Some commands(such as btrfs-convert) access the devices again after we close the ctree, so