Since newer firmware versions now support tracking of the known zeroed state
for AF DASD disks, we don't need to warn the user about exiting iprconfig
when there are known zeroed disks if the adapter has this support.

Signed-off-by: Brian King <brk...@linux.vnet.ibm.com>
---

 iprconfig.c |   15 +++++++++++++++
 iprlib.c    |   20 ++++++++++++++++++++
 iprlib.h    |    1 +
 3 files changed, 36 insertions(+)

diff -puN iprlib.c~iprutils_known_zeroed iprlib.c
--- iprutils.patched/iprlib.c~iprutils_known_zeroed     2016-07-13 
17:41:05.879406930 -0500
+++ iprutils.patched-bjking1/iprlib.c   2016-07-13 17:41:05.896406846 -0500
@@ -7423,6 +7423,26 @@ int ipr_get_dev_attr(struct ipr_dev *dev
        return 0;
 }
 
+int ipr_known_zeroed_is_saved(struct ipr_dev *dev)
+{
+       int len;
+       struct ipr_mode_pages mode_pages;
+       struct ipr_ioa_mode_page *page;
+
+       memset(&mode_pages, 0, sizeof(mode_pages));
+
+       if (!ipr_mode_sense(dev, 0x20, &mode_pages)) {
+               page = (struct ipr_ioa_mode_page *) (((u8 *)&mode_pages) +
+                                                    
mode_pages.hdr.block_desc_len +
+                                                    sizeof(mode_pages.hdr));
+
+               if (page->format_completed)
+                       return 1;
+       }
+
+       return 0;
+}
+
 int ipr_set_format_completed_bit(struct ipr_dev *dev)
 {
        int len;
diff -puN iprlib.h~iprutils_known_zeroed iprlib.h
--- iprutils.patched/iprlib.h~iprutils_known_zeroed     2016-07-13 
17:41:05.882406915 -0500
+++ iprutils.patched-bjking1/iprlib.h   2016-07-13 17:41:05.898406836 -0500
@@ -2946,6 +2946,7 @@ int ipr_get_live_dump(struct ipr_ioa *);
 int ipr_jbod_sysfs_bind(struct ipr_dev *, u8);
 int ipr_max_queue_depth(struct ipr_ioa *ioa, int num_devs, int num_ssd_devs);
 void ipr_count_devices_in_vset(struct ipr_dev *, int *num_devs, int 
*ssd_num_devs);
+int ipr_known_zeroed_is_saved(struct ipr_dev *);
 
 static inline u32 ipr_get_dev_res_handle(struct ipr_ioa *ioa, struct 
ipr_dev_record *dev_rcd)
 {
diff -puN iprconfig.c~iprutils_known_zeroed iprconfig.c
--- iprutils.patched/iprconfig.c~iprutils_known_zeroed  2016-07-13 
17:41:05.887406890 -0500
+++ iprutils.patched-bjking1/iprconfig.c        2016-07-13 17:41:05.901406822 
-0500
@@ -19457,6 +19457,21 @@ int main(int argc, char *argv[])
        while (head_zdev) {
                struct screen_output *s_out;
                i_container *i_con;
+               struct ipr_ioa *ioa;
+               struct ipr_dev *dev;
+               int num_zeroed = 0;
+
+               for_each_ioa(ioa) {
+                       for_each_af_dasd(ioa, dev) {
+                               if (ipr_device_is_zeroed(dev) &&
+                                   !ipr_known_zeroed_is_saved(dev)) {
+                                       num_zeroed++;
+                               }
+                       }
+               }
+
+               if (!num_zeroed)
+                       break;
 
                n_exit_confirm.body = body_init(n_exit_confirm.header, NULL);
 
_


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to