Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-06 Thread Filipe David Manana
On Sun, Apr 6, 2014 at 1:18 AM, Marc MERLIN m...@merlins.org wrote: On Fri, Apr 04, 2014 at 04:20:41PM +0100, Filipe David Borba Manana wrote: This new send flag makes send calculate first the amount of new file data (in bytes) the send root has relatively to the parent root, or for the case

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-06 Thread Marc MERLIN
On Sun, Apr 06, 2014 at 05:57:38PM +0100, Filipe David Manana wrote: I looked around and found nothing that looked similar enough. Obviously it's an assert, so I can run without it, but my source being very different from yours just made me want to check that this was most likely ok to run

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-05 Thread Marc MERLIN
On Fri, Apr 04, 2014 at 04:20:41PM +0100, Filipe David Borba Manana wrote: This new send flag makes send calculate first the amount of new file data (in bytes) the send root has relatively to the parent root, or for the case of a non-incremental send, the total amount of file data we will

[RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-04 Thread Filipe David Borba Manana
This new send flag makes send calculate first the amount of new file data (in bytes) the send root has relatively to the parent root, or for the case of a non-incremental send, the total amount of file data we will send through the send stream. In other words, it computes the sum of the lengths

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-04 Thread Konstantinos Skarlatos
On 4/4/2014 6:20 μμ, Filipe David Borba Manana wrote: This new send flag makes send calculate first the amount of new file data (in bytes) the send root has relatively to the parent root, or for the case of a non-incremental send, the total amount of file data we will send through the send

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-04 Thread David Sterba
On Fri, Apr 04, 2014 at 04:20:41PM +0100, Filipe David Borba Manana wrote: @@ -4307,6 +4348,22 @@ out: return num_read; } +static int send_total_data_size(struct send_ctx *sctx, u64 data_size) +{ + int ret; + + ret = begin_cmd(sctx, BTRFS_SEND_C_TOTAL_DATA_SIZE); +

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-04 Thread Filipe David Manana
On Fri, Apr 4, 2014 at 3:52 PM, Konstantinos Skarlatos k.skarla...@gmail.com wrote: On 4/4/2014 6:20 μμ, Filipe David Borba Manana wrote: This new send flag makes send calculate first the amount of new file data (in bytes) the send root has relatively to the parent root, or for the case of a

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-04 Thread Filipe David Manana
On Fri, Apr 4, 2014 at 4:53 PM, David Sterba dste...@suse.cz wrote: On Fri, Apr 04, 2014 at 04:20:41PM +0100, Filipe David Borba Manana wrote: @@ -4307,6 +4348,22 @@ out: return num_read; } +static int send_total_data_size(struct send_ctx *sctx, u64 data_size) +{ + int ret; +

Re: [RFC PATCH] Btrfs: send, add calculate data size flag to allow for progress estimation

2014-04-04 Thread David Sterba
On Fri, Apr 04, 2014 at 05:01:41PM +0100, Filipe David Manana wrote: * Send a clone command to user space. */ --- a/fs/btrfs/send.h +++ b/fs/btrfs/send.h @@ -87,6 +87,7 @@ enum btrfs_send_cmd { BTRFS_SEND_C_END, BTRFS_SEND_C_UPDATE_EXTENT, +