Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] btrfs-progs: receive: make option quiet work
@ 2019-10-25 10:25 Anand Jain
  2019-11-01 10:55 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Jain @ 2019-10-25 10:25 UTC (permalink / raw)
  To: linux-btrfs

Even when -q option specified, the receive sub-command is not quiet as
show below.

 btrfs receive -q -f /tmp/t /btrfs1
 At snapshot ss3

It must be quiet atlest when its been asked to be quiet.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
This is how I checked if fstests/btrfs-progs-tests is using receive -q option.
   find  ./xfstests-devel -type f -exec grep --color -i -I "receive" {} \; \
	-print | grep "\-q"
   find  ./btrfs-progs/tests -type f -exec grep --color -i -I "receive" {} \; \
	-print | grep "\-q"

 they aren't using it. So its fine.

 cmds/receive.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmds/receive.c b/cmds/receive.c
index 4b03938ea3eb..c4827c1dd999 100644
--- a/cmds/receive.c
+++ b/cmds/receive.c
@@ -269,7 +269,8 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
 		goto out;
 	}
 
-	fprintf(stdout, "At snapshot %s\n", path);
+	if (g_verbose)
+		fprintf(stdout, "At snapshot %s\n", path);
 
 	memcpy(rctx->cur_subvol.received_uuid, uuid, BTRFS_UUID_SIZE);
 	rctx->cur_subvol.stransid = ctransid;
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: receive: make option quiet work
  2019-10-25 10:25 [PATCH] btrfs-progs: receive: make option quiet work Anand Jain
@ 2019-11-01 10:55 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2019-11-01 10:55 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Fri, Oct 25, 2019 at 06:25:20PM +0800, Anand Jain wrote:
> Even when -q option specified, the receive sub-command is not quiet as
> show below.
> 
>  btrfs receive -q -f /tmp/t /btrfs1
>  At snapshot ss3
> 
> It must be quiet atlest when its been asked to be quiet.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> This is how I checked if fstests/btrfs-progs-tests is using receive -q option.
>    find  ./xfstests-devel -type f -exec grep --color -i -I "receive" {} \; \
> 	-print | grep "\-q"
>    find  ./btrfs-progs/tests -type f -exec grep --color -i -I "receive" {} \; \
> 	-print | grep "\-q"
> 
>  they aren't using it. So its fine.
> 
>  cmds/receive.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/cmds/receive.c b/cmds/receive.c
> index 4b03938ea3eb..c4827c1dd999 100644
> --- a/cmds/receive.c
> +++ b/cmds/receive.c
> @@ -269,7 +269,8 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
>  		goto out;
>  	}
>  
> -	fprintf(stdout, "At snapshot %s\n", path);
> +	if (g_verbose)
> +		fprintf(stdout, "At snapshot %s\n", path);

Right, this seems to be forgotten in commit 33b4acc7df00bf "btrfs-progs:
receive: add option for quiet mode" that updated the verbosity.
Added to devel, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 10:25 [PATCH] btrfs-progs: receive: make option quiet work Anand Jain
2019-11-01 10:55 ` David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git