disk.h (210225) | disk.h (210226) |
---|---|
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 * | 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: head/sys/sys/disk.h 210225 2010-07-18 20:23:10Z trasz $ | 9 * $FreeBSD: head/sys/sys/disk.h 210226 2010-07-18 20:57:53Z trasz $ |
10 * 11 */ 12 13#ifndef _SYS_DISK_H_ 14#define _SYS_DISK_H_ 15 16#include <sys/ioccom.h> 17 18#ifdef _KERNEL 19 20#ifndef _SYS_CONF_H_ 21#include <sys/conf.h> /* XXX: temporary to avoid breakage */ 22#endif 23 24void disk_err(struct bio *bp, const char *what, int blkdone, int nl); 25 26#endif 27 28#define DIOCGSECTORSIZE _IOR('d', 128, u_int) | 10 * 11 */ 12 13#ifndef _SYS_DISK_H_ 14#define _SYS_DISK_H_ 15 16#include <sys/ioccom.h> 17 18#ifdef _KERNEL 19 20#ifndef _SYS_CONF_H_ 21#include <sys/conf.h> /* XXX: temporary to avoid breakage */ 22#endif 23 24void disk_err(struct bio *bp, const char *what, int blkdone, int nl); 25 26#endif 27 28#define DIOCGSECTORSIZE _IOR('d', 128, u_int) |
29 /* | 29 /*- |
30 * Get the sectorsize of the device in bytes. The sectorsize is the 31 * smallest unit of data which can be transfered from this device. 32 * Usually this is a power of two but it may not be. (ie: CDROM audio) 33 */ 34 35#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ | 30 * Get the sectorsize of the device in bytes. The sectorsize is the 31 * smallest unit of data which can be transfered from this device. 32 * Usually this is a power of two but it may not be. (ie: CDROM audio) 33 */ 34 35#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ |
36 /* | 36 /*- |
37 * Get the size of the entire device in bytes. This should be a 38 * multiple of the sectorsize. 39 */ 40 41#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ | 37 * Get the size of the entire device in bytes. This should be a 38 * multiple of the sectorsize. 39 */ 40 41#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ |
42 /* | 42 /*- |
43 * Get the firmwares notion of number of sectors per track. This 44 * value is mostly used for compatibility with various ill designed 45 * disk label formats. Don't use it unless you have to. 46 */ 47 48#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ | 43 * Get the firmwares notion of number of sectors per track. This 44 * value is mostly used for compatibility with various ill designed 45 * disk label formats. Don't use it unless you have to. 46 */ 47 48#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ |
49 /* | 49 /*- |
50 * Get the firmwares notion of number of heads per cylinder. This 51 * value is mostly used for compatibility with various ill designed 52 * disk label formats. Don't use it unless you have to. 53 */ 54 55#define DIOCSKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */ | 50 * Get the firmwares notion of number of heads per cylinder. This 51 * value is mostly used for compatibility with various ill designed 52 * disk label formats. Don't use it unless you have to. 53 */ 54 55#define DIOCSKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */ |
56 /* | 56 /*- |
57 * Enable/Disable (the argument is boolean) the device for kernel 58 * core dumps. 59 */ 60 61#define DIOCGFRONTSTUFF _IOR('d', 134, off_t) | 57 * Enable/Disable (the argument is boolean) the device for kernel 58 * core dumps. 59 */ 60 61#define DIOCGFRONTSTUFF _IOR('d', 134, off_t) |
62 /* | 62 /*- |
63 * Many disk formats have some amount of space reserved at the 64 * start of the disk to hold bootblocks, various disklabels and 65 * similar stuff. This ioctl returns the number of such bytes 66 * which may apply to the device. 67 */ 68 69#define DIOCGFLUSH _IO('d', 135) /* Flush write cache */ | 63 * Many disk formats have some amount of space reserved at the 64 * start of the disk to hold bootblocks, various disklabels and 65 * similar stuff. This ioctl returns the number of such bytes 66 * which may apply to the device. 67 */ 68 69#define DIOCGFLUSH _IO('d', 135) /* Flush write cache */ |
70 /* | 70 /*- |
71 * Flush write cache of the device. 72 */ 73 74#define DIOCGDELETE _IOW('d', 136, off_t[2]) /* Delete data */ | 71 * Flush write cache of the device. 72 */ 73 74#define DIOCGDELETE _IOW('d', 136, off_t[2]) /* Delete data */ |
75 /* | 75 /*- |
76 * Mark data on the device as unused. 77 */ 78 79#define DISK_IDENT_SIZE 256 80#define DIOCGIDENT _IOR('d', 137, char[DISK_IDENT_SIZE]) | 76 * Mark data on the device as unused. 77 */ 78 79#define DISK_IDENT_SIZE 256 80#define DIOCGIDENT _IOR('d', 137, char[DISK_IDENT_SIZE]) |
81 /* | 81 /*- |
82 * Get the ident of the given provider. Ident is (most of the time) 83 * a uniqe and fixed provider's identifier. Ident's properties are as 84 * follow: 85 * - ident value is preserved between reboots, 86 * - provider can be detached/attached and ident is preserved, 87 * - provider's name can change - ident can't, 88 * - ident value should not be based on on-disk metadata; in other 89 * words copying whole data from one disk to another should not --- 4 unchanged lines hidden (view full) --- 94 * - GEOM classes that consumes single providers and provide single 95 * providers, like geli, gbde, should just attach class name to the 96 * ident of the underlying provider, 97 * - ident is an ASCII string (is printable), 98 * - ident is optional and applications can't relay on its presence. 99 */ 100 101#define DIOCGPROVIDERNAME _IOR('d', 138, char[MAXPATHLEN]) | 82 * Get the ident of the given provider. Ident is (most of the time) 83 * a uniqe and fixed provider's identifier. Ident's properties are as 84 * follow: 85 * - ident value is preserved between reboots, 86 * - provider can be detached/attached and ident is preserved, 87 * - provider's name can change - ident can't, 88 * - ident value should not be based on on-disk metadata; in other 89 * words copying whole data from one disk to another should not --- 4 unchanged lines hidden (view full) --- 94 * - GEOM classes that consumes single providers and provide single 95 * providers, like geli, gbde, should just attach class name to the 96 * ident of the underlying provider, 97 * - ident is an ASCII string (is printable), 98 * - ident is optional and applications can't relay on its presence. 99 */ 100 101#define DIOCGPROVIDERNAME _IOR('d', 138, char[MAXPATHLEN]) |
102 /* | 102 /*- |
103 * Store the provider name, given a device path, in a buffer. The buffer 104 * must be at least MAXPATHLEN bytes long. 105 */ 106 107#define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ | 103 * Store the provider name, given a device path, in a buffer. The buffer 104 * must be at least MAXPATHLEN bytes long. 105 */ 106 107#define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ |
108 /* | 108 /*- |
109 * Get the size of the device's optimal access block in bytes. 110 * This should be a multiple of the sectorsize. 111 */ 112 113#define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ | 109 * Get the size of the device's optimal access block in bytes. 110 * This should be a multiple of the sectorsize. 111 */ 112 113#define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ |
114 /* | 114 /*- |
115 * Get the offset of the first device's optimal access block in bytes. 116 * This should be a multiple of the sectorsize. 117 */ 118 119#endif /* _SYS_DISK_H_ */ | 115 * Get the offset of the first device's optimal access block in bytes. 116 * This should be a multiple of the sectorsize. 117 */ 118 119#endif /* _SYS_DISK_H_ */ |