Re: [PATCH 13/20] btrfs-progs: use cmd_struct as command entry point

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/7/18 9:40 PM, jeffm@xxxxxxxx wrote:
> From: Jeff Mahoney <jeffm@xxxxxxxx>
> diff --git a/cmds-inspect.c b/cmds-inspect.c
> index afd7fe48..12f200b3 100644
> --- a/cmds-inspect.c
> +++ b/cmds-inspect.c
> @@ -625,33 +629,27 @@ static int cmd_inspect_min_dev_size(int argc, char **argv)
>  out:
>  	return !!ret;
>  }
> +static DEFINE_SIMPLE_COMMAND(inspect_min_dev_size, "min-dev-size");
>  
>  static const char inspect_cmd_group_info[] =
>  "query various internal information";
>  
> -const struct cmd_group inspect_cmd_group = {
> +static const struct cmd_group inspect_cmd_group = {
>  	inspect_cmd_group_usage, inspect_cmd_group_info, {
> -		{ "inode-resolve", cmd_inspect_inode_resolve,
> -			cmd_inspect_inode_resolve_usage, NULL, 0 },
> -		{ "logical-resolve", cmd_inspect_logical_resolve,
> -			cmd_inspect_logical_resolve_usage, NULL, 0 },
> -		{ "subvolid-resolve", cmd_inspect_subvolid_resolve,
> -			cmd_inspect_subvolid_resolve_usage, NULL, 0 },
> -		{ "rootid", cmd_inspect_rootid, cmd_inspect_rootid_usage, NULL,
> -			0 },
> -		{ "min-dev-size", cmd_inspect_min_dev_size,
> -			cmd_inspect_min_dev_size_usage, NULL, 0 },
> -		{ "dump-tree", cmd_inspect_dump_tree,
> -				cmd_inspect_dump_tree_usage, NULL, 0 },
> -		{ "dump-super", cmd_inspect_dump_super,
> -				cmd_inspect_dump_super_usage, NULL, 0 },
> -		{ "tree-stats", cmd_inspect_tree_stats,
> -				cmd_inspect_tree_stats_usage, NULL, 0 },
> -		NULL_CMD_STRUCT
> +		&cmd_struct_inspect_inode_resolve,
> +		&cmd_struct_inspect_logical_resolve,
> +		&cmd_struct_inspect_subvolid_resolve,
> +		&cmd_struct_inspect_rootid,
> +		&cmd_struct_inspect_min_dev_size,
> +		&cmd_struct_inspect_dump_tree,
> +		&cmd_struct_inspect_dump_super,
> +		&cmd_struct_inspect_tree_stats,
> +		NULL
>  	}
>  };
>  
> -int cmd_inspect(int argc, char **argv)
> +static int cmd_inspect(int argc, char **argv)
>  {
>  	return handle_command_group(&inspect_cmd_group, argc, argv);
>  }
> +DEFINE_GROUP_COMMAND(inspect, "inspect");

"inspect-internal"

-Jeff


-- 
Jeff Mahoney
SUSE Labs

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux