summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-04-08 09:20:07 +0000
committerphk <phk@FreeBSD.org>2002-04-08 09:20:07 +0000
commit33405073ec643486993789d949efc25c231bdd94 (patch)
tree647a5ab6dd91af9c0d47e673f5ac04be25fd0166 /sys
parentf0ca71273ec5cada05bedea3198c9abcf27d3c2a (diff)
downloadFreeBSD-src-33405073ec643486993789d949efc25c231bdd94.zip
FreeBSD-src-33405073ec643486993789d949efc25c231bdd94.tar.gz
Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.
Sponsored by: DARPA & NAI Labs
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ccd/ccd.c2
-rw-r--r--sys/dev/null/null.c2
-rw-r--r--sys/dev/vinum/vinumhdr.h1
-rw-r--r--sys/geom/geom_ccd.c2
-rw-r--r--sys/kern/subr_diskslice.c1
-rw-r--r--sys/sys/disk.h11
-rw-r--r--sys/sys/disklabel.h10
-rw-r--r--sys/sys/diskmbr.h10
-rw-r--r--sys/sys/diskpc98.h10
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
10 files changed, 26 insertions, 25 deletions
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index 4c84a81..c9c9fa1 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -98,7 +98,7 @@
#include <sys/conf.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
-#include <sys/disklabel.h>
+#include <sys/disk.h>
#include <ufs/ffs/fs.h>
#include <sys/devicestat.h>
#include <sys/fcntl.h>
diff --git a/sys/dev/null/null.c b/sys/dev/null/null.c
index 043843d..6fa5e2b 100644
--- a/sys/dev/null/null.c
+++ b/sys/dev/null/null.c
@@ -33,7 +33,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
-#include <sys/disklabel.h>
+#include <sys/disk.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/resource.h>
diff --git a/sys/dev/vinum/vinumhdr.h b/sys/dev/vinum/vinumhdr.h
index f9182a6..c5f7ab3 100644
--- a/sys/dev/vinum/vinumhdr.h
+++ b/sys/dev/vinum/vinumhdr.h
@@ -58,6 +58,7 @@
#include <sys/uio.h>
#include <sys/namei.h>
#include <sys/stat.h>
+#include <sys/disk.h>
#include <sys/disklabel.h>
#include <ufs/ffs/fs.h>
#include <sys/syslog.h>
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index 4c84a81..c9c9fa1 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -98,7 +98,7 @@
#include <sys/conf.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
-#include <sys/disklabel.h>
+#include <sys/disk.h>
#include <ufs/ffs/fs.h>
#include <sys/devicestat.h>
#include <sys/fcntl.h>
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index 85c1862..158ccbb 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -50,6 +50,7 @@
#include <sys/systm.h>
#include <sys/bio.h>
#include <sys/conf.h>
+#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/fcntl.h>
diff --git a/sys/sys/disk.h b/sys/sys/disk.h
index 128e582..00eec8d 100644
--- a/sys/sys/disk.h
+++ b/sys/sys/disk.h
@@ -13,6 +13,9 @@
#ifndef _SYS_DISK_H_
#define _SYS_DISK_H_
+#include <sys/ioccom.h>
+
+#ifdef _KERNEL
#ifndef _SYS_DISKSLICE_H_
#include <sys/diskslice.h>
#endif /* _SYS_DISKSLICE_H_ */
@@ -42,4 +45,12 @@ void disk_destroy(dev_t dev);
struct disk *disk_enumerate(struct disk *disk);
void disk_invalidate(struct disk *disk);
+#endif
+
+#define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */
+#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */
+#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */
+#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */
+#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
+
#endif /* _SYS_DISK_H_ */
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index 870e1a9..dde62e5 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -344,7 +344,9 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */
/*
- * Disk-specific ioctls.
+ * Disklabel-specific ioctls.
+ *
+ * NB: <sys/disk.h> defines ioctls from 'd'/128 and up.
*/
/* get and set disklabel */
#define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */
@@ -354,12 +356,6 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */
-#define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */
-#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */
-#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */
-#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */
-#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
-
#ifdef __alpha__
struct disklabel_alphahack {
struct disklabel dl;
diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h
index 870e1a9..dde62e5 100644
--- a/sys/sys/diskmbr.h
+++ b/sys/sys/diskmbr.h
@@ -344,7 +344,9 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */
/*
- * Disk-specific ioctls.
+ * Disklabel-specific ioctls.
+ *
+ * NB: <sys/disk.h> defines ioctls from 'd'/128 and up.
*/
/* get and set disklabel */
#define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */
@@ -354,12 +356,6 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */
-#define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */
-#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */
-#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */
-#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */
-#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
-
#ifdef __alpha__
struct disklabel_alphahack {
struct disklabel dl;
diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h
index 870e1a9..dde62e5 100644
--- a/sys/sys/diskpc98.h
+++ b/sys/sys/diskpc98.h
@@ -344,7 +344,9 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */
/*
- * Disk-specific ioctls.
+ * Disklabel-specific ioctls.
+ *
+ * NB: <sys/disk.h> defines ioctls from 'd'/128 and up.
*/
/* get and set disklabel */
#define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */
@@ -354,12 +356,6 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */
-#define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */
-#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */
-#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */
-#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */
-#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
-
#ifdef __alpha__
struct disklabel_alphahack {
struct disklabel dl;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index dc60f4e..e459543 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -48,7 +48,7 @@
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
-#include <sys/disklabel.h>
+#include <sys/disk.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
OpenPOWER on IntegriCloud