12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DISK (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> DISK (9)<strong>NAME</strong>disk, disk_init, disk_attach, disk_detach, disk_destroy, disk_busy, disk_unbusy,disk_find, disk_blocksize —generic disk frameworkSYNOPSIS#include #include #include voiddisk_init(struct disk ∗ , const char ∗name , const struct dkdriver ∗driver);voiddisk_attach(struct disk ∗);voiddisk_detach(struct disk ∗);voiddisk_destroy(struct disk ∗);voiddisk_busy(struct disk ∗);voiddisk_unbusy(struct disk ∗ , long bcount , int read);struct disk ∗disk_find(const char ∗);voiddisk_blocksize(struct disk ∗ , int blocksize);DESCRIPTIONThe <strong>NetBSD</strong> generic disk framework is designed to provide flexible, scalable, and consistent handling of diskstate and metrics information. The fundamental component of this framework is the disk structure, whichis defined as follows:struct disk {TAILQ_ENTRY(disk) dk_link; /∗ link in global disklist ∗/const char ∗dk_name; /∗ disk name ∗/prop_dictionary_t dk_info; /∗ reference to disk-info dictionary ∗/int dk_bopenmask; /∗ block devices open ∗/int dk_copenmask; /∗ character devices open ∗/int dk_openmask; /∗ composite (bopen|copen) ∗/int dk_state; /∗ label state ### ∗/int dk_blkshift; /∗ shift to convert DEV_BSIZE to blks ∗/int dk_byteshift; /∗ shift to convert bytes to blks ∗//∗∗ Metrics data; note that some metrics may have no meaning∗ on certain types of disks.∗/struct io_stats ∗dk_stats;const struct dkdriver ∗dk_driver; /∗ pointer to driver ∗/<strong>NetBSD</strong> 3.0 May 3, 2008 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!