]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/sys/disk.h
This commit was generated by cvs2svn to compensate for changes in r92828,
[FreeBSD/FreeBSD.git] / sys / sys / disk.h
1 /*
2  * ----------------------------------------------------------------------------
3  * "THE BEER-WARE LICENSE" (Revision 42):
4  * <phk@FreeBSD.ORG> wrote this file.  As long as you retain this notice you
5  * can do whatever you want with this stuff. If we meet some day, and you think
6  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
7  * ----------------------------------------------------------------------------
8  *
9  * $FreeBSD$
10  *
11  */
12
13 #ifndef _SYS_DISK_H_
14 #define _SYS_DISK_H_
15
16 #ifndef _SYS_DISKSLICE_H_
17 #include <sys/diskslice.h>
18 #endif /* _SYS_DISKSLICE_H_ */
19
20 #ifndef _SYS_DISKLABEL
21 #include <sys/disklabel.h>
22 #endif /* _SYS_DISKLABEL */
23
24 #include <sys/queue.h>
25
26 struct disk {
27         u_int                   d_flags;
28         u_int                   d_dsflags;
29         struct cdevsw           *d_devsw;
30         dev_t                   d_dev;
31         struct diskslices       *d_slice;
32         struct disklabel        d_label;
33         LIST_ENTRY(disk)        d_list;
34         void                    *d_softc;
35 };
36
37 #define DISKFLAG_LOCK           0x1
38 #define DISKFLAG_WANTED         0x2
39
40 dev_t disk_create(int unit, struct disk *disk, int flags, struct cdevsw *cdevsw, struct cdevsw *diskdevsw);
41 void disk_destroy(dev_t dev);
42 int disk_dumpcheck(dev_t dev, u_int *count, u_int *blkno, u_int *secsize);
43 struct disk *disk_enumerate(struct disk *disk);
44 void disk_invalidate(struct disk *disk);
45
46 #endif /* _SYS_DISK_H_ */