On 10/16/2015 06:30 PM, Gabriel Krisman Bertazi wrote:
> set-write-cache-policy command in iprconfig was designed to
> enable/disable write cache of JBOD disks only.  Now, the same interface
> can be used to configure vset write Cache. This patch modifies
> set-write-cache-policy to also support vset devices.
> 
> Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
> ---
>  iprconfig.8 | 4 ++--
>  iprconfig.c | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/iprconfig.8 b/iprconfig.8
> index 65bb1e3..8e7d3d6 100644
> --- a/iprconfig.8
> +++ b/iprconfig.8
> @@ -601,8 +601,8 @@ Default is 2.
>  .B set-write-cache-policy [device] [writeback|writethrough]
>  .br
>  Set the write cache policy for [device]. Available policies are
> -writeback and writethrough.  This feature is only supported by JBOD
> -disks.  Example:
> +writeback and writethrough.  This command supports JBOD disk (write
> +cache) and Volume Sets (vset write cache).  Example:
>  .br
>  .B iprconfig -c set-write-cache-policy sdp writeback
>  .TP
> diff --git a/iprconfig.c b/iprconfig.c
> index 8240bf7..3a370ee 100644
> --- a/iprconfig.c
> +++ b/iprconfig.c
> @@ -10940,7 +10940,7 @@ int change_disk_config(i_container * i_con)
>                       i_con = add_i_con(i_con,_("No"),&disk_config_attr[2]);
>       }
> 
> -     if (ipr_is_gscsi(dev)) {
> +     if (ipr_is_gscsi(dev) || ipr_is_volume_set(dev)) {

Let's only expose this attribute in the ncurses UI if the adapter supports vset 
write cache.

>               disk_config_attr[3].option = 4;
>               disk_config_attr[3].write_cache_policy =
>                                               disk_attr.write_cache_policy;
> @@ -15092,7 +15092,7 @@ static int set_device_write_cache_policy(char **args, 
> int num_args)
>               return -EINVAL;
>       }
> 
> -     if (!ipr_is_gscsi(dev)) {
> +     if (!ipr_is_gscsi(dev) && !ipr_is_volume_set(dev)) {
>               scsi_err(dev, "Unable to set cache policy.\n");
>               return -EINVAL;
>       }
> @@ -15143,7 +15143,7 @@ static int query_device_write_cache_policy(char 
> **args, int num_args)
>               fprintf(stderr, "Cannot find %s\n", args[0]);
>               return -EINVAL;
>       }
> -     if (dev->scsi_dev_data->type != TYPE_DISK) {
> +     if (!ipr_is_gscsi(dev) && !ipr_is_volume_set(dev)) {
>               scsi_err(dev, "Cannot query write back policy.\n");
>               return -EINVAL;
>       }
> 


-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to