On 10/21/19 9:43 PM, David Sterba wrote:
On Tue, Oct 15, 2019 at 11:29:34AM +0800, Anand Jain wrote:
I was thinking there might be some common code between the
sub-commands in btrfs-progs now or in future, and if the printf()
due to verbose is required in one sub-command and the same printf()
due to verbose is not required in another sub-command (which I
called unwanted message) then we won't have any choice to not
to print those unwanted printf().
But as this is just an anticipatory only, so probably we could try
global verbose and see how it fares. I will try.
I see, but it would be better to have a concrete example where it's
problematic so we can figure out ways how to filter unwanted messages.
I solved with an argument to btrfs_scan_devcies() [1], by adding
%verbose argument to btrfs_scan_devices() to make sure
only btrfs dev scan would print the verbose and not the btrfs fi show.
If btrfs fi show prints the verbose it shall break few test-cases
in fstests.
[1]
https://patchwork.kernel.org/patch/11201791/
https://patchwork.kernel.org/patch/11201793/