linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan()
@ 2016-03-09 23:04 Satoru Takeuchi
  2016-03-09 23:08 ` [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage Satoru Takeuchi
  2016-03-10 13:27 ` [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Satoru Takeuchi @ 2016-03-09 23:04 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

It's unnecessary since it's always 1.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
This patch can be applied to devel (commit b2bdd0da8969).
---
 cmds-device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cmds-device.c b/cmds-device.c
index cb470af..78d6535 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -246,7 +246,6 @@ static const char * const cmd_device_scan_usage[] = {
 static int cmd_device_scan(int argc, char **argv)
 {
 	int i;
-	int devstart = 1;
 	int all = 0;
 	int ret = 0;

@@ -282,7 +281,7 @@ static int cmd_device_scan(int argc, char **argv)
 		goto out;
 	}

-	for( i = devstart ; i < argc ; i++ ){
+	for (i = 1; i < argc; i++) {
 		char *path;

 		if (is_block_device(argv[i]) != 1) {
-- 
2.7.0


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

* [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage
  2016-03-09 23:04 [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() Satoru Takeuchi
@ 2016-03-09 23:08 ` Satoru Takeuchi
  2016-03-10 13:36   ` David Sterba
  2016-03-10 13:27 ` [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() David Sterba
  1 sibling, 1 reply; 5+ messages in thread
From: Satoru Takeuchi @ 2016-03-09 23:08 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

It's already marked as deprecated in cmd_device_scan_usage().

commit 5444864e5605 ("btrfs-progs: remove BTRFS_SCAN_PROC scan method")

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
 Documentation/btrfs-device.asciidoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/btrfs-device.asciidoc b/Documentation/btrfs-device.asciidoc
index bd878f4..bf16a94 100644
--- a/Documentation/btrfs-device.asciidoc
+++ b/Documentation/btrfs-device.asciidoc
@@ -89,8 +89,8 @@ Scan devices for a btrfs filesystem.
 If one or more devices are passed, these are scanned for a btrfs filesystem.
 If no devices are passed, btrfs uses block devices containing btrfs
 filesystem as listed by blkid.
-Finally, if '--all-devices' or '-d' is passed, all the devices under /dev are
-scanned.
+Finally, '--all-devices' or '-d' is the deprecated option. If it is passed,
+its behavior is the same as if no devices are passed.

 *stats* [-z] <path>|<device>::
 Read and print the device IO stats for all mounted devices of the filesystem
-- 
2.7.0

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

* Re: [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan()
  2016-03-09 23:04 [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() Satoru Takeuchi
  2016-03-09 23:08 ` [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage Satoru Takeuchi
@ 2016-03-10 13:27 ` David Sterba
  2016-03-10 23:18   ` Satoru Takeuchi
  1 sibling, 1 reply; 5+ messages in thread
From: David Sterba @ 2016-03-10 13:27 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: linux-btrfs@vger.kernel.org

On Thu, Mar 10, 2016 at 08:04:59AM +0900, Satoru Takeuchi wrote:
> It's unnecessary since it's always 1.
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> ---
> This patch can be applied to devel (commit b2bdd0da8969).
> ---
>  cmds-device.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/cmds-device.c b/cmds-device.c
> index cb470af..78d6535 100644
> --- a/cmds-device.c
> +++ b/cmds-device.c
> @@ -246,7 +246,6 @@ static const char * const cmd_device_scan_usage[] = {
>  static int cmd_device_scan(int argc, char **argv)
>  {
>  	int i;
> -	int devstart = 1;
>  	int all = 0;
>  	int ret = 0;
> 
> @@ -282,7 +281,7 @@ static int cmd_device_scan(int argc, char **argv)
>  		goto out;
>  	}
> 
> -	for( i = devstart ; i < argc ; i++ ){
> +	for (i = 1; i < argc; i++) {

Actually it needs to be set to optind before the for cycle, otherwise:

  # btrfs device scan -- /dev/sda
  ERROR: not a block device: --

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

* Re: [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage
  2016-03-09 23:08 ` [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage Satoru Takeuchi
@ 2016-03-10 13:36   ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2016-03-10 13:36 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: linux-btrfs@vger.kernel.org

On Thu, Mar 10, 2016 at 08:08:31AM +0900, Satoru Takeuchi wrote:
> It's already marked as deprecated in cmd_device_scan_usage().
> 
> commit 5444864e5605 ("btrfs-progs: remove BTRFS_SCAN_PROC scan method")
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Applied, thanks.

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

* Re: [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan()
  2016-03-10 13:27 ` [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() David Sterba
@ 2016-03-10 23:18   ` Satoru Takeuchi
  0 siblings, 0 replies; 5+ messages in thread
From: Satoru Takeuchi @ 2016-03-10 23:18 UTC (permalink / raw)
  To: dsterba, linux-btrfs@vger.kernel.org

On 2016/03/10 22:27, David Sterba wrote:
> On Thu, Mar 10, 2016 at 08:04:59AM +0900, Satoru Takeuchi wrote:
>> It's unnecessary since it's always 1.
>>
>> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
>> ---
>> This patch can be applied to devel (commit b2bdd0da8969).
>> ---
>>   cmds-device.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/cmds-device.c b/cmds-device.c
>> index cb470af..78d6535 100644
>> --- a/cmds-device.c
>> +++ b/cmds-device.c
>> @@ -246,7 +246,6 @@ static const char * const cmd_device_scan_usage[] = {
>>   static int cmd_device_scan(int argc, char **argv)
>>   {
>>   	int i;
>> -	int devstart = 1;
>>   	int all = 0;
>>   	int ret = 0;
>>
>> @@ -282,7 +281,7 @@ static int cmd_device_scan(int argc, char **argv)
>>   		goto out;
>>   	}
>>
>> -	for( i = devstart ; i < argc ; i++ ){
>> +	for (i = 1; i < argc; i++) {
>
> Actually it needs to be set to optind before the for cycle, otherwise:
>
>    # btrfs device scan -- /dev/sda
>    ERROR: not a block device: --

Thank you for your comment. I'll fix it.

Satoru

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

end of thread, other threads:[~2016-03-10 23:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 23:04 [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() Satoru Takeuchi
2016-03-09 23:08 ` [PATCH 2/2] btrfs-progs: Describe device scan -d is a deprecated option in manpage Satoru Takeuchi
2016-03-10 13:36   ` David Sterba
2016-03-10 13:27 ` [PATCH 1/2] btrfs-progs: Remove unnecessary variable devstart from cmd_device_scan() David Sterba
2016-03-10 23:18   ` Satoru Takeuchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).