diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2011-06-19 04:55:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2011-06-19 04:55:35 +0000 |
commit | 3e3ad7757f379f859cf5f09cbb7aa83f78364b19 (patch) | |
tree | 295c545f0e41cbdb975ac2a060c71d9b5f07b0be /sys/dev/ata | |
parent | a809e4c7b624b56c125ce1320f4ad1bc5958112b (diff) |
Use disk_lock_nointr() in the xxclose() routines so that they cannot
be interrupted.
ok matthew
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/wd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 145a42256b5..d5e95cb6295 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.104 2011/06/19 04:35:06 deraadt Exp $ */ +/* $OpenBSD: wd.c,v 1.105 2011/06/19 04:55:34 deraadt Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -734,15 +734,14 @@ wdclose(dev_t dev, int flag, int fmt, struct proc *p) { struct wd_softc *wd; int part = DISKPART(dev); - int error = 0; wd = wdlookup(DISKUNIT(dev)); if (wd == NULL) return ENXIO; WDCDEBUG_PRINT(("wdclose\n"), DEBUG_FUNCS); - if ((error = disk_lock(&wd->sc_dk)) != 0) - goto exit; + + disk_lock_nointr(&wd->sc_dk); switch (fmt) { case S_IFCHR: @@ -762,9 +761,8 @@ wdclose(dev_t dev, int flag, int fmt, struct proc *p) disk_unlock(&wd->sc_dk); - exit: device_unref(&wd->sc_dev); - return (error); + return (0); } void |