From: Gleb C. <lna...@ya...> - 2024-04-26 06:39:00
|
Commit: 6a21f45 GitHub URL: https://github.com/SCST-project/scst/commit/6a21f456f78ae4d69736e89d2839949e9c5e7e7b Author: Brian Meagher Date: 2024-04-26T09:38:36+03:00 Log Message: ----------- iscsi-scst: Add mechanism to restore target parameter to default Writing the string :default: to the /sys entry will restore local_def Modified Paths: -------------- iscsi-scst/usr/param.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) =================================================================== diff --git a/iscsi-scst/usr/param.c b/iscsi-scst/usr/param.c index acdcd24..0d3ef2a 100644 --- a/iscsi-scst/usr/param.c +++ b/iscsi-scst/usr/param.c @@ -279,7 +279,10 @@ int params_val_to_str(const struct iscsi_key *keys, int idx, unsigned int val, int params_str_to_val(const struct iscsi_key *keys, int idx, const char *str, unsigned int *val) { - if (keys[idx].ops->str_to_val) + if (!strcmp(":default:", str)) { + *val = keys[idx].local_def; + return 0; + } else if (keys[idx].ops->str_to_val) return keys[idx].ops->str_to_val(str, val); else return 0; |