btrfs-progs: make the device scan logic more clear
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 6 Mar 2014 03:36:48 +0000 (11:36 +0800)
committerChris Mason <clm@fb.com>
Fri, 21 Mar 2014 13:23:32 +0000 (06:23 -0700)
commit0e1b00c666cae6c89ebff2f6746dd91a64e85f12
tree43c93bbcb9dc7a71203d770445dad6853e0f069f
parent6831721a431529e770c936f8cd479332d91fb652
btrfs-progs: make the device scan logic more clear

1. Use long option to replace the original strcmp() to parse
the "--all-devices".
2. the "int ret" is defined in 2 places, just define it once
and make the return pattern into "goto + single return".

This does not change the actual scan procedure and return values.
Just make it clear, the original seems a little confusing.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
cmds-device.c