Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys - Use NODEV instead of 0
details: https://anonhg.NetBSD.org/src/rev/302a01753663
branches: trunk
changeset: 335289:302a01753663
user: christos <christos%NetBSD.org@localhost>
date: Fri Jan 02 01:14:22 2015 +0000
description:
- Use NODEV instead of 0
- Return EBUSY if there was no label
diffstat:
sys/dev/dkwedge/dk.c | 8 ++++----
sys/kern/subr_disk.c | 8 +++++---
2 files changed, 9 insertions(+), 7 deletions(-)
diffs (67 lines):
diff -r dcdbc61f24b5 -r 302a01753663 sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c Fri Jan 02 01:13:00 2015 +0000
+++ b/sys/dev/dkwedge/dk.c Fri Jan 02 01:14:22 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dk.c,v 1.78 2014/12/31 19:52:05 christos Exp $ */
+/* $NetBSD: dk.c,v 1.79 2015/01/02 01:14:22 christos Exp $ */
/*-
* Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.78 2014/12/31 19:52:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.79 2015/01/02 01:14:22 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_dkwedge.h"
@@ -1359,10 +1359,10 @@
return (ENXIO);
/*
- * We pass 0 instead of our device to indicate we don't
+ * We pass NODEV instead of our device to indicate we don't
* want to handle disklabel ioctls
*/
- error = disk_ioctl(&sc->sc_dk, 0, cmd, data, flag, l);
+ error = disk_ioctl(&sc->sc_dk, NODEV, cmd, data, flag, l);
if (error != EPASSTHROUGH)
return (error);
diff -r dcdbc61f24b5 -r 302a01753663 sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c Fri Jan 02 01:13:00 2015 +0000
+++ b/sys/kern/subr_disk.c Fri Jan 02 01:14:22 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.110 2014/12/31 20:13:41 mlelstv Exp $ */
+/* $NetBSD: subr_disk.c,v 1.111 2015/01/02 01:14:22 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.110 2014/12/31 20:13:41 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.111 2015/01/02 01:14:22 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -502,7 +502,7 @@
break;
}
- if (dev == 0)
+ if (dev == NODEV)
return EPASSTHROUGH;
/* The following should be moved to dk_ioctl */
@@ -521,6 +521,8 @@
#endif
case DIOCGPART:
+ if (dk->dk_label == NULL)
+ return EBUSY;
pt = data;
pt->disklab = dk->dk_label;
pt->part = &dk->dk_label->d_partitions[DISKPART(dev)];
Home |
Main Index |
Thread Index |
Old Index