Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_GENHD_H |
| 2 | #define _LINUX_GENHD_H |
| 3 | |
| 4 | /* |
| 5 | * genhd.h Copyright (C) 1992 Drew Eckhardt |
| 6 | * Generic hard disk header file by |
| 7 | * Drew Eckhardt |
| 8 | * |
| 9 | * <drew@colorado.edu> |
| 10 | */ |
| 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
David Howells | 9361401 | 2006-09-30 20:45:40 +0200 | [diff] [blame] | 14 | #ifdef CONFIG_BLOCK |
| 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | enum { |
| 17 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
| 18 | confused about extended/logical partitions starting past cylinder 1023. */ |
| 19 | DOS_EXTENDED_PARTITION = 5, |
| 20 | LINUX_EXTENDED_PARTITION = 0x85, |
| 21 | WIN98_EXTENDED_PARTITION = 0x0f, |
| 22 | |
| 23 | LINUX_SWAP_PARTITION = 0x82, |
| 24 | LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ |
| 25 | |
| 26 | SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION, |
| 27 | NEW_SOLARIS_X86_PARTITION = 0xbf, |
| 28 | |
| 29 | DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */ |
| 30 | DM6_AUX3PARTITION = 0x53, /* no DDO: use xlated geom */ |
| 31 | DM6_PARTITION = 0x54, /* has DDO: use xlated geom & offset */ |
| 32 | EZD_PARTITION = 0x55, /* EZ-DRIVE */ |
| 33 | |
| 34 | FREEBSD_PARTITION = 0xa5, /* FreeBSD Partition ID */ |
| 35 | OPENBSD_PARTITION = 0xa6, /* OpenBSD Partition ID */ |
| 36 | NETBSD_PARTITION = 0xa9, /* NetBSD Partition ID */ |
| 37 | BSDI_PARTITION = 0xb7, /* BSDI Partition ID */ |
| 38 | MINIX_PARTITION = 0x81, /* Minix Partition ID */ |
| 39 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ |
| 40 | }; |
| 41 | |
| 42 | #ifndef __KERNEL__ |
| 43 | |
| 44 | struct partition { |
| 45 | unsigned char boot_ind; /* 0x80 - active */ |
| 46 | unsigned char head; /* starting head */ |
| 47 | unsigned char sector; /* starting sector */ |
| 48 | unsigned char cyl; /* starting cylinder */ |
| 49 | unsigned char sys_ind; /* What partition type */ |
| 50 | unsigned char end_head; /* end head */ |
| 51 | unsigned char end_sector; /* end sector */ |
| 52 | unsigned char end_cyl; /* end cylinder */ |
| 53 | unsigned int start_sect; /* starting sector counting from 0 */ |
| 54 | unsigned int nr_sects; /* nr of sectors in partition */ |
| 55 | } __attribute__((packed)); |
| 56 | |
| 57 | #endif |
| 58 | |
| 59 | #ifdef __KERNEL__ |
David Woodhouse | 34186ef | 2006-04-25 14:07:57 +0100 | [diff] [blame] | 60 | #include <linux/major.h> |
| 61 | #include <linux/device.h> |
| 62 | #include <linux/smp.h> |
| 63 | #include <linux/string.h> |
| 64 | #include <linux/fs.h> |
| 65 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | struct partition { |
| 67 | unsigned char boot_ind; /* 0x80 - active */ |
| 68 | unsigned char head; /* starting head */ |
| 69 | unsigned char sector; /* starting sector */ |
| 70 | unsigned char cyl; /* starting cylinder */ |
| 71 | unsigned char sys_ind; /* What partition type */ |
| 72 | unsigned char end_head; /* end head */ |
| 73 | unsigned char end_sector; /* end sector */ |
| 74 | unsigned char end_cyl; /* end cylinder */ |
| 75 | __le32 start_sect; /* starting sector counting from 0 */ |
| 76 | __le32 nr_sects; /* nr of sectors in partition */ |
| 77 | } __attribute__((packed)); |
| 78 | |
| 79 | struct hd_struct { |
| 80 | sector_t start_sect; |
| 81 | sector_t nr_sects; |
| 82 | struct kobject kobj; |
Jun'ichi Nomura | 6a4d44c | 2006-03-27 01:17:55 -0800 | [diff] [blame] | 83 | struct kobject *holder_dir; |
Jens Axboe | 47a0041 | 2005-11-09 13:38:47 +0100 | [diff] [blame] | 84 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | int policy, partno; |
| 86 | }; |
| 87 | |
| 88 | #define GENHD_FL_REMOVABLE 1 |
| 89 | #define GENHD_FL_DRIVERFS 2 |
| 90 | #define GENHD_FL_CD 8 |
| 91 | #define GENHD_FL_UP 16 |
| 92 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
| 93 | |
| 94 | struct disk_stats { |
Ben Woodard | 837c787 | 2006-03-22 08:09:31 +0100 | [diff] [blame] | 95 | unsigned long sectors[2]; /* READs and WRITEs */ |
| 96 | unsigned long ios[2]; |
| 97 | unsigned long merges[2]; |
| 98 | unsigned long ticks[2]; |
| 99 | unsigned long io_ticks; |
| 100 | unsigned long time_in_queue; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | struct gendisk { |
| 104 | int major; /* major number of driver */ |
| 105 | int first_minor; |
| 106 | int minors; /* maximum number of minors, =1 for |
| 107 | * disks that can't be partitioned. */ |
| 108 | char disk_name[32]; /* name of major driver */ |
| 109 | struct hd_struct **part; /* [indexed by minor] */ |
Kay Sievers | d4d7e5d | 2006-03-24 20:45:35 +0100 | [diff] [blame] | 110 | int part_uevent_suppress; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | struct block_device_operations *fops; |
| 112 | struct request_queue *queue; |
| 113 | void *private_data; |
| 114 | sector_t capacity; |
| 115 | |
| 116 | int flags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | struct device *driverfs_dev; |
| 118 | struct kobject kobj; |
Jun'ichi Nomura | 6a4d44c | 2006-03-27 01:17:55 -0800 | [diff] [blame] | 119 | struct kobject *holder_dir; |
| 120 | struct kobject *slave_dir; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | |
| 122 | struct timer_rand_state *random; |
| 123 | int policy; |
| 124 | |
| 125 | atomic_t sync_io; /* RAID */ |
Chen, Kenneth W | 20e5c81 | 2005-10-13 21:48:42 +0200 | [diff] [blame] | 126 | unsigned long stamp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | int in_flight; |
| 128 | #ifdef CONFIG_SMP |
| 129 | struct disk_stats *dkstats; |
| 130 | #else |
| 131 | struct disk_stats dkstats; |
| 132 | #endif |
| 133 | }; |
| 134 | |
| 135 | /* Structure for sysfs attributes on block devices */ |
| 136 | struct disk_attribute { |
| 137 | struct attribute attr; |
| 138 | ssize_t (*show)(struct gendisk *, char *); |
Kay Sievers | a7fd670 | 2005-10-01 14:49:43 +0200 | [diff] [blame] | 139 | ssize_t (*store)(struct gendisk *, const char *, size_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | }; |
| 141 | |
| 142 | /* |
| 143 | * Macros to operate on percpu disk statistics: |
| 144 | * |
| 145 | * The __ variants should only be called in critical sections. The full |
| 146 | * variants disable/enable preemption. |
| 147 | */ |
| 148 | #ifdef CONFIG_SMP |
| 149 | #define __disk_stat_add(gendiskp, field, addnd) \ |
| 150 | (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) |
| 151 | |
| 152 | #define disk_stat_read(gendiskp, field) \ |
| 153 | ({ \ |
| 154 | typeof(gendiskp->dkstats->field) res = 0; \ |
| 155 | int i; \ |
KAMEZAWA Hiroyuki | 0a94502 | 2006-03-28 01:56:37 -0800 | [diff] [blame] | 156 | for_each_possible_cpu(i) \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | res; \ |
| 159 | }) |
| 160 | |
| 161 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { |
| 162 | int i; |
KAMEZAWA Hiroyuki | 0a94502 | 2006-03-28 01:56:37 -0800 | [diff] [blame] | 163 | for_each_possible_cpu(i) |
Andrew Morton | 394e390 | 2006-03-23 03:01:05 -0800 | [diff] [blame] | 164 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, |
| 165 | sizeof (struct disk_stats)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | #else |
| 169 | #define __disk_stat_add(gendiskp, field, addnd) \ |
| 170 | (gendiskp->dkstats.field += addnd) |
| 171 | #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) |
| 172 | |
| 173 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { |
| 174 | memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); |
| 175 | } |
| 176 | #endif |
| 177 | |
| 178 | #define disk_stat_add(gendiskp, field, addnd) \ |
| 179 | do { \ |
| 180 | preempt_disable(); \ |
| 181 | __disk_stat_add(gendiskp, field, addnd); \ |
| 182 | preempt_enable(); \ |
| 183 | } while (0) |
| 184 | |
| 185 | #define __disk_stat_dec(gendiskp, field) __disk_stat_add(gendiskp, field, -1) |
| 186 | #define disk_stat_dec(gendiskp, field) disk_stat_add(gendiskp, field, -1) |
| 187 | |
| 188 | #define __disk_stat_inc(gendiskp, field) __disk_stat_add(gendiskp, field, 1) |
| 189 | #define disk_stat_inc(gendiskp, field) disk_stat_add(gendiskp, field, 1) |
| 190 | |
| 191 | #define __disk_stat_sub(gendiskp, field, subnd) \ |
| 192 | __disk_stat_add(gendiskp, field, -subnd) |
| 193 | #define disk_stat_sub(gendiskp, field, subnd) \ |
| 194 | disk_stat_add(gendiskp, field, -subnd) |
| 195 | |
| 196 | |
| 197 | /* Inlines to alloc and free disk stats in struct gendisk */ |
| 198 | #ifdef CONFIG_SMP |
| 199 | static inline int init_disk_stats(struct gendisk *disk) |
| 200 | { |
| 201 | disk->dkstats = alloc_percpu(struct disk_stats); |
| 202 | if (!disk->dkstats) |
| 203 | return 0; |
| 204 | return 1; |
| 205 | } |
| 206 | |
| 207 | static inline void free_disk_stats(struct gendisk *disk) |
| 208 | { |
| 209 | free_percpu(disk->dkstats); |
| 210 | } |
| 211 | #else /* CONFIG_SMP */ |
| 212 | static inline int init_disk_stats(struct gendisk *disk) |
| 213 | { |
| 214 | return 1; |
| 215 | } |
| 216 | |
| 217 | static inline void free_disk_stats(struct gendisk *disk) |
| 218 | { |
| 219 | } |
| 220 | #endif /* CONFIG_SMP */ |
| 221 | |
| 222 | /* drivers/block/ll_rw_blk.c */ |
| 223 | extern void disk_round_stats(struct gendisk *disk); |
| 224 | |
| 225 | /* drivers/block/genhd.c */ |
Neil Horman | ac20427 | 2005-06-23 00:09:11 -0700 | [diff] [blame] | 226 | extern int get_blkdev_list(char *, int); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | extern void add_disk(struct gendisk *disk); |
| 228 | extern void del_gendisk(struct gendisk *gp); |
| 229 | extern void unlink_gendisk(struct gendisk *gp); |
| 230 | extern struct gendisk *get_gendisk(dev_t dev, int *part); |
| 231 | |
| 232 | extern void set_device_ro(struct block_device *bdev, int flag); |
| 233 | extern void set_disk_ro(struct gendisk *disk, int flag); |
| 234 | |
| 235 | /* drivers/char/random.c */ |
| 236 | extern void add_disk_randomness(struct gendisk *disk); |
| 237 | extern void rand_initialize_disk(struct gendisk *disk); |
| 238 | |
| 239 | static inline sector_t get_start_sect(struct block_device *bdev) |
| 240 | { |
| 241 | return bdev->bd_contains == bdev ? 0 : bdev->bd_part->start_sect; |
| 242 | } |
| 243 | static inline sector_t get_capacity(struct gendisk *disk) |
| 244 | { |
| 245 | return disk->capacity; |
| 246 | } |
| 247 | static inline void set_capacity(struct gendisk *disk, sector_t size) |
| 248 | { |
| 249 | disk->capacity = size; |
| 250 | } |
| 251 | |
| 252 | #endif /* __KERNEL__ */ |
| 253 | |
| 254 | #ifdef CONFIG_SOLARIS_X86_PARTITION |
| 255 | |
| 256 | #define SOLARIS_X86_NUMSLICE 8 |
| 257 | #define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) |
| 258 | |
| 259 | struct solaris_x86_slice { |
| 260 | __le16 s_tag; /* ID tag of partition */ |
| 261 | __le16 s_flag; /* permission flags */ |
| 262 | __le32 s_start; /* start sector no of partition */ |
| 263 | __le32 s_size; /* # of blocks in partition */ |
| 264 | }; |
| 265 | |
| 266 | struct solaris_x86_vtoc { |
| 267 | unsigned int v_bootinfo[3]; /* info needed by mboot (unsupported) */ |
| 268 | __le32 v_sanity; /* to verify vtoc sanity */ |
| 269 | __le32 v_version; /* layout version */ |
| 270 | char v_volume[8]; /* volume name */ |
| 271 | __le16 v_sectorsz; /* sector size in bytes */ |
| 272 | __le16 v_nparts; /* number of partitions */ |
| 273 | unsigned int v_reserved[10]; /* free space */ |
| 274 | struct solaris_x86_slice |
| 275 | v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */ |
| 276 | unsigned int timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp (unsupported) */ |
| 277 | char v_asciilabel[128]; /* for compatibility */ |
| 278 | }; |
| 279 | |
| 280 | #endif /* CONFIG_SOLARIS_X86_PARTITION */ |
| 281 | |
| 282 | #ifdef CONFIG_BSD_DISKLABEL |
| 283 | /* |
| 284 | * BSD disklabel support by Yossi Gottlieb <yogo@math.tau.ac.il> |
| 285 | * updated by Marc Espie <Marc.Espie@openbsd.org> |
| 286 | */ |
| 287 | |
| 288 | /* check against BSD src/sys/sys/disklabel.h for consistency */ |
| 289 | |
| 290 | #define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */ |
| 291 | #define BSD_MAXPARTITIONS 16 |
| 292 | #define OPENBSD_MAXPARTITIONS 16 |
| 293 | #define BSD_FS_UNUSED 0 /* disklabel unused partition entry ID */ |
| 294 | struct bsd_disklabel { |
| 295 | __le32 d_magic; /* the magic number */ |
| 296 | __s16 d_type; /* drive type */ |
| 297 | __s16 d_subtype; /* controller/d_type specific */ |
| 298 | char d_typename[16]; /* type name, e.g. "eagle" */ |
| 299 | char d_packname[16]; /* pack identifier */ |
| 300 | __u32 d_secsize; /* # of bytes per sector */ |
| 301 | __u32 d_nsectors; /* # of data sectors per track */ |
| 302 | __u32 d_ntracks; /* # of tracks per cylinder */ |
| 303 | __u32 d_ncylinders; /* # of data cylinders per unit */ |
| 304 | __u32 d_secpercyl; /* # of data sectors per cylinder */ |
| 305 | __u32 d_secperunit; /* # of data sectors per unit */ |
| 306 | __u16 d_sparespertrack; /* # of spare sectors per track */ |
| 307 | __u16 d_sparespercyl; /* # of spare sectors per cylinder */ |
| 308 | __u32 d_acylinders; /* # of alt. cylinders per unit */ |
| 309 | __u16 d_rpm; /* rotational speed */ |
| 310 | __u16 d_interleave; /* hardware sector interleave */ |
| 311 | __u16 d_trackskew; /* sector 0 skew, per track */ |
| 312 | __u16 d_cylskew; /* sector 0 skew, per cylinder */ |
| 313 | __u32 d_headswitch; /* head switch time, usec */ |
| 314 | __u32 d_trkseek; /* track-to-track seek, usec */ |
| 315 | __u32 d_flags; /* generic flags */ |
| 316 | #define NDDATA 5 |
| 317 | __u32 d_drivedata[NDDATA]; /* drive-type specific information */ |
| 318 | #define NSPARE 5 |
| 319 | __u32 d_spare[NSPARE]; /* reserved for future use */ |
| 320 | __le32 d_magic2; /* the magic number (again) */ |
| 321 | __le16 d_checksum; /* xor of data incl. partitions */ |
| 322 | |
| 323 | /* filesystem and partition information: */ |
| 324 | __le16 d_npartitions; /* number of partitions in following */ |
| 325 | __le32 d_bbsize; /* size of boot area at sn0, bytes */ |
| 326 | __le32 d_sbsize; /* max size of fs superblock, bytes */ |
| 327 | struct bsd_partition { /* the partition table */ |
| 328 | __le32 p_size; /* number of sectors in partition */ |
| 329 | __le32 p_offset; /* starting sector */ |
| 330 | __le32 p_fsize; /* filesystem basic fragment size */ |
| 331 | __u8 p_fstype; /* filesystem type, see below */ |
| 332 | __u8 p_frag; /* filesystem fragments per block */ |
| 333 | __le16 p_cpg; /* filesystem cylinders per group */ |
| 334 | } d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */ |
| 335 | }; |
| 336 | |
| 337 | #endif /* CONFIG_BSD_DISKLABEL */ |
| 338 | |
| 339 | #ifdef CONFIG_UNIXWARE_DISKLABEL |
| 340 | /* |
| 341 | * Unixware slices support by Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl> |
| 342 | * and Krzysztof G. Baranowski <kgb@knm.org.pl> |
| 343 | */ |
| 344 | |
| 345 | #define UNIXWARE_DISKMAGIC (0xCA5E600DUL) /* The disk magic number */ |
| 346 | #define UNIXWARE_DISKMAGIC2 (0x600DDEEEUL) /* The slice table magic nr */ |
| 347 | #define UNIXWARE_NUMSLICE 16 |
| 348 | #define UNIXWARE_FS_UNUSED 0 /* Unused slice entry ID */ |
| 349 | |
| 350 | struct unixware_slice { |
| 351 | __le16 s_label; /* label */ |
| 352 | __le16 s_flags; /* permission flags */ |
| 353 | __le32 start_sect; /* starting sector */ |
| 354 | __le32 nr_sects; /* number of sectors in slice */ |
| 355 | }; |
| 356 | |
| 357 | struct unixware_disklabel { |
| 358 | __le32 d_type; /* drive type */ |
| 359 | __le32 d_magic; /* the magic number */ |
| 360 | __le32 d_version; /* version number */ |
| 361 | char d_serial[12]; /* serial number of the device */ |
| 362 | __le32 d_ncylinders; /* # of data cylinders per device */ |
| 363 | __le32 d_ntracks; /* # of tracks per cylinder */ |
| 364 | __le32 d_nsectors; /* # of data sectors per track */ |
| 365 | __le32 d_secsize; /* # of bytes per sector */ |
| 366 | __le32 d_part_start; /* # of first sector of this partition */ |
| 367 | __le32 d_unknown1[12]; /* ? */ |
| 368 | __le32 d_alt_tbl; /* byte offset of alternate table */ |
| 369 | __le32 d_alt_len; /* byte length of alternate table */ |
| 370 | __le32 d_phys_cyl; /* # of physical cylinders per device */ |
| 371 | __le32 d_phys_trk; /* # of physical tracks per cylinder */ |
| 372 | __le32 d_phys_sec; /* # of physical sectors per track */ |
| 373 | __le32 d_phys_bytes; /* # of physical bytes per sector */ |
| 374 | __le32 d_unknown2; /* ? */ |
| 375 | __le32 d_unknown3; /* ? */ |
| 376 | __le32 d_pad[8]; /* pad */ |
| 377 | |
| 378 | struct unixware_vtoc { |
| 379 | __le32 v_magic; /* the magic number */ |
| 380 | __le32 v_version; /* version number */ |
| 381 | char v_name[8]; /* volume name */ |
| 382 | __le16 v_nslices; /* # of slices */ |
| 383 | __le16 v_unknown1; /* ? */ |
| 384 | __le32 v_reserved[10]; /* reserved */ |
| 385 | struct unixware_slice |
| 386 | v_slice[UNIXWARE_NUMSLICE]; /* slice headers */ |
| 387 | } vtoc; |
| 388 | |
| 389 | }; /* 408 */ |
| 390 | |
| 391 | #endif /* CONFIG_UNIXWARE_DISKLABEL */ |
| 392 | |
| 393 | #ifdef CONFIG_MINIX_SUBPARTITION |
| 394 | # define MINIX_NR_SUBPARTITIONS 4 |
| 395 | #endif /* CONFIG_MINIX_SUBPARTITION */ |
| 396 | |
| 397 | #ifdef __KERNEL__ |
| 398 | |
| 399 | char *disk_name (struct gendisk *hd, int part, char *buf); |
| 400 | |
| 401 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); |
| 402 | extern void add_partition(struct gendisk *, int, sector_t, sector_t); |
| 403 | extern void delete_partition(struct gendisk *, int); |
| 404 | |
Christoph Lameter | 1946089 | 2005-06-23 00:08:19 -0700 | [diff] [blame] | 405 | extern struct gendisk *alloc_disk_node(int minors, int node_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 406 | extern struct gendisk *alloc_disk(int minors); |
| 407 | extern struct kobject *get_disk(struct gendisk *disk); |
| 408 | extern void put_disk(struct gendisk *disk); |
| 409 | |
| 410 | extern void blk_register_region(dev_t dev, unsigned long range, |
| 411 | struct module *module, |
| 412 | struct kobject *(*probe)(dev_t, int *, void *), |
| 413 | int (*lock)(dev_t, void *), |
| 414 | void *data); |
| 415 | extern void blk_unregister_region(dev_t dev, unsigned long range); |
| 416 | |
| 417 | static inline struct block_device *bdget_disk(struct gendisk *disk, int index) |
| 418 | { |
| 419 | return bdget(MKDEV(disk->major, disk->first_minor) + index); |
| 420 | } |
| 421 | |
| 422 | #endif |
| 423 | |
| 424 | #endif |
David Howells | 9361401 | 2006-09-30 20:45:40 +0200 | [diff] [blame] | 425 | |
| 426 | #endif |