summaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_diag.h
diff options
context:
space:
mode:
authorBenjamin Block <bblock@linux.ibm.com>2019-10-25 18:12:48 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2019-10-28 22:16:15 -0400
commit8155eb0785279728b6b2e29aba2ca52d16aa526f (patch)
treecf3888c460269cc7e29d43f78f952537ae3524d1 /drivers/s390/scsi/zfcp_diag.h
parent6028f7c4cd87cac13481255d7e35dd2c9207ecae (diff)
downloadlinux-8155eb0785279728b6b2e29aba2ca52d16aa526f.tar.bz2
scsi: zfcp: implicitly refresh port-data diagnostics when reading sysfs
This patch adds implicit updates to the sysfs entries that read the diagnostic data stored in the "caching buffer" for Exchange Port Data. An update is triggered once the buffer is older than ZFCP_DIAG_MAX_AGE milliseconds (5s). This entails sending an Exchange Port Data command to the FCP-Channel, and during its ingress path updating the cached data and the timestamp. To prevent multiple concurrent userspace-applications from triggering this update in parallel we synchronize all of them using a wait-queue (waiting threads are interruptible; the updating thread is not). Link: https://lore.kernel.org/r/c145b5cfc99a63b6a018b1184fbd27bb09c955f5.1572018132.git.bblock@linux.ibm.com Reviewed-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_diag.h')
-rw-r--r--drivers/s390/scsi/zfcp_diag.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_diag.h b/drivers/s390/scsi/zfcp_diag.h
index 2deebccda17d..7ff8fb0bb735 100644
--- a/drivers/s390/scsi/zfcp_diag.h
+++ b/drivers/s390/scsi/zfcp_diag.h
@@ -71,6 +71,17 @@ void zfcp_diag_sysfs_destroy(struct zfcp_adapter *const adapter);
void zfcp_diag_update_xdata(struct zfcp_diag_header *const hdr,
const void *const data, const bool incomplete);
+/*
+ * Function-Type used in zfcp_diag_update_buffer_limited() for the function
+ * that does the buffer-implementation dependent work.
+ */
+typedef int (*zfcp_diag_update_buffer_func)(struct zfcp_adapter *const adapter);
+
+int zfcp_diag_update_port_data_buffer(struct zfcp_adapter *const adapter);
+int zfcp_diag_update_buffer_limited(struct zfcp_adapter *const adapter,
+ struct zfcp_diag_header *const hdr,
+ zfcp_diag_update_buffer_func buffer_update);
+
/**
* zfcp_diag_support_sfp() - Return %true if the @adapter supports reporting
* SFP Data.