Identifying reflink / CoW files

2012-09-21 Thread Jp Wise
Good morning, I'm working on an offline deduplication script intended to work around the copy-on-write functionality of BTRFS. Simply put - is there any existing utility to compare two files (or dirs) and output if the files share the same physical extents / data blocks on disk? - aka - they'

Re: [PATCH V3 1/2] Btrfs: cleanup duplicated division functions

2012-09-21 Thread David Sterba
On Fri, Sep 21, 2012 at 05:07:46PM +0800, Miao Xie wrote: > --- a/fs/btrfs/ioctl.c > +++ b/fs/btrfs/ioctl.c > @@ -3335,6 +3335,24 @@ static long btrfs_ioctl_balance(struct file *file, > void __user *arg) > > goto do_balance; > } > + > + if ((bargs-

Re: [PATCH] Btrfs-progs: btrfs subvolume delete could delete subvolumes

2012-09-21 Thread David Sterba
On Fri, Sep 21, 2012 at 02:54:08PM +0800, Anand jain wrote: > From: Anand Jain > > With this user will be able to provide more than one subvolume > to delete. > eg: btrfs subvolume delete Yes, this is useful, thanks. I'm thinking if it's ok to stop on first error, ie. when the subvolume does n

Re: [PATCH 1/2] Btrfs-progs: fix the btrfs-debug-tree usage

2012-09-21 Thread David Sterba
On Fri, Sep 21, 2012 at 02:59:44PM +0800, Anand jain wrote: > @@ -51,6 +51,8 @@ static void print_extents(struct btrfs_root *root, struct > extent_buffer *eb) >btrfs_node_blockptr(eb, i), >size, >

[PATCH V3 1/2] Btrfs: cleanup duplicated division functions

2012-09-21 Thread Miao Xie
div_factor{_fine} has been implemented for two times, and these two functions are very similar, so cleanup the reduplicate implement and drop the original div_factor(), and then rename div_factor_fine() to div_factor(). So the divisor of the new div_factor() is 100, not 10. And I move div_factor i

Re: [PATCH V2 1/2] Btrfs: cleanup duplicated division functions

2012-09-21 Thread Miao Xie
On Thu, 20 Sep 2012 15:28:03 +0200, David Sterba wrote: > On Thu, Sep 20, 2012 at 10:57:54AM +0800, Miao Xie wrote: >> Because those functions are mostly used on the hot path, and we are sure >> the parameters are right in the most cases, we don't add complex checks >> for the parameters. But in th

Re: [PATCH] Btrfs-progs: btrfs subvolume delete could delete subvolumes

2012-09-21 Thread Ilya Dryomov
On Fri, Sep 21, 2012 at 02:54:08PM +0800, Anand jain wrote: > From: Anand Jain > > With this user will be able to provide more than one subvolume > to delete. > eg: btrfs subvolume delete > > Signed-off-by: Anand Jain > --- > cmds-subvolume.c | 36 > ma