scsi: zfcp: move maximum age of diagnostic buffers into a per-adapter variable
authorBenjamin Block <bblock@linux.ibm.com>
Fri, 25 Oct 2019 16:12:51 +0000 (18:12 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Oct 2019 02:16:15 +0000 (22:16 -0400)
commit48910f8c35cfd250d806f3e03150d256f40b6d4c
tree33409f703b79a34d361e16fd2adf5384b5a1fae5
parent8a72db70b5ca3c3feb3ca25519e8a9516cc60cfe
scsi: zfcp: move maximum age of diagnostic buffers into a per-adapter variable

Replace the static define (ZFCP_DIAG_MAX_AGE) with a per-adapter variable
(${adapter}->diagnostics->max_age). This new variable is exported via
sysfs, along with other, already existing adapter variables, and can both
be read and written. This way users can choose how much time should pass
between refreshes of diagnostic buffers. The default value for the age
remains to be five seconds.

By setting this new variable to 0, the caching of diagnostic buffers for
userspace accesses can also be completely removed.

All diagnostic buffers of a given adapter are subject to this setting in
the same way.

Link: https://lore.kernel.org/r/b1d0977cc884b16dd4ca6418e4320c56a4c31d63.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>
drivers/s390/scsi/zfcp_diag.c
drivers/s390/scsi/zfcp_diag.h
drivers/s390/scsi/zfcp_sysfs.c