diff options
author | mav <mav@FreeBSD.org> | 2014-01-20 23:56:49 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-01-20 23:56:49 +0000 |
commit | 5f170995ac7c7d0494bcfe42617b88ec2286ffb7 (patch) | |
tree | fb7784a1530e8faf1a99a65f60a038fa165937bd /sys/cam | |
parent | 0b6cdba729d365b83f3a36ac8c5d3af010eff888 (diff) | |
download | FreeBSD-src-5f170995ac7c7d0494bcfe42617b88ec2286ffb7.zip FreeBSD-src-5f170995ac7c7d0494bcfe42617b88ec2286ffb7.tar.gz |
MFC r260407:
Allow delete_method sysctl to be set to "DISABLE".
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index ee9b220..741a492 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1959,7 +1959,7 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) char buf[16]; const char *p; struct da_softc *softc; - int i, error, value; + int i, error, methods, value; softc = (struct da_softc *)arg1; @@ -1972,8 +1972,9 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); + methods = softc->delete_available | (1 << DA_DELETE_DISABLE); for (i = 0; i <= DA_DELETE_MAX; i++) { - if (!(softc->delete_available & (1 << i)) || + if (!(methods & (1 << i)) || strcmp(buf, da_delete_method_names[i]) != 0) continue; dadeletemethodset(softc, i); |