On 10/26/2015 08:14 AM, Gabriel Krisman Bertazi wrote:
> Add a new '-vc <policy>' option to raid-create to allow setting Sync
> Write Cache policy for vsets during raid creation. For performance
> reasons, if user doesn't specify any policy and adapter supports it, it
> will default to Writeback.
>
> New syntax allowed:
>
> $ iprconfig -c raid-create sg1 -z -c writeback
> $ iprconfig -c raid-create sg1 -r 10 -c writethrough
>
> Signed-off-by: Gabriel Krisman Bertazi <[email protected]>
> ---
> iprconfig.8 | 6 ++++--
> iprconfig.c | 34 ++++++++++++++++++++++++++++++++--
> 2 files changed, 36 insertions(+), 4 deletions(-)
>
> diff --git a/iprconfig.8 b/iprconfig.8
> index 682ec69..65bb1e3 100644
> --- a/iprconfig.8
> +++ b/iprconfig.8
> @@ -474,12 +474,14 @@ specified array will be displayed.
> .br
> Show the current write cache policy for [device].
> .TP
> -.B raid-create [-r raid_level] [-s stripe_size_in_kb] [-l label]
> [--skip-format] [devices...]
> +.B raid-create [-r raid_level] [-s stripe_size_in_kb] [-l label]
> [--skip-format] [-vc cache_policy] [devices...]
I think you missed my previous comment. Can we change the -vc option to be -c
instead?
> Create a RAID array. RAID level can be any supported RAID level for the given
> adapter, such as 0, 10, 5, 6. Currently supported stripe sizes in kb
> include 16, 64, and 256. If raid_level is not specified, it will default to
> RAID 5. If stripe size is not specified, it will default to the recommended
> -stripe size for the selected RAID level. Devices are specified with their
> full
> +stripe size for the selected RAID level. Available cache policies are the
> +same that can be passed to set-write-cache-policy command. If none is
> +specified, write back is assumed. Devices are specified with their full
> name, either the /dev/sd name or the /dev/sg name is acceptable. On some RAID
> adapters, a label can also be specified. Example array
> creation:
> diff --git a/iprconfig.c b/iprconfig.c
> index e591655..c4f8c77 100644
> --- a/iprconfig.c
> +++ b/iprconfig.c
> @@ -59,6 +59,7 @@ struct array_cmd_data {
> u16 stripe_size;
> int qdepth;
> u32 do_cmd;
> + int vset_cache;
> struct ipr_ioa *ioa;
> struct ipr_dev *dev;
> struct ipr_array_query_data *qac;
> @@ -4031,11 +4032,14 @@ int raid_start_complete()
> } else
> retry = 0;
> if
> (ipr_get_dev_attr(dev, &attr)) {
> - syslog(LOG_ERR,
> _("Unable to read queue_depth"));
> + syslog(LOG_ERR,
> +
> _("Unable to read attributes when creating arrays"));
> } else {
>
> attr.queue_depth = cur_raid_cmd->qdepth;
> +
> attr.write_cache_policy = cur_raid_cmd->vset_cache;
> if
> (ipr_set_dev_attr(dev, &attr, 1))
> -
> syslog(LOG_ERR, _("Unable to set queue_depth"));
> +
> syslog(LOG_ERR,
> +
> _("Unable to set attributes when creating arrays"));
> }
> } else
> break;
> @@ -13691,6 +13697,8 @@ static int raid_create(char **args, int num_args)
> next_qdepth = 1;
> else if (strcmp(args[i], "-l") == 0)
> next_label = 1;
> + else if (strcmp(args[i], "-vc") == 0)
And here as well.
> + next_vcache = 1;
> else if (strcmp(args[i], "--skip-format") == 0)
> skip_format = 1;
> else if (next_raid_level) {
--
Brian King
Power Linux I/O
IBM Linux Technology Center
------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iprdd-devel