aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/genhd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r--include/linux/genhd.h35
1 files changed, 6 insertions, 29 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 09a3b18918c7..ecd2bf63fc84 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -18,11 +18,13 @@
18#define dev_to_disk(device) container_of(device, struct gendisk, dev) 18#define dev_to_disk(device) container_of(device, struct gendisk, dev)
19#define dev_to_part(device) container_of(device, struct hd_struct, dev) 19#define dev_to_part(device) container_of(device, struct hd_struct, dev)
20 20
21extern struct device_type disk_type;
22extern struct device_type part_type; 21extern struct device_type part_type;
23extern struct kobject *block_depr; 22extern struct kobject *block_depr;
24extern struct class block_class; 23extern struct class block_class;
25 24
25extern const struct seq_operations partitions_op;
26extern const struct seq_operations diskstats_op;
27
26enum { 28enum {
27/* These three have identical behaviour; use the second one if DOS FDISK gets 29/* These three have identical behaviour; use the second one if DOS FDISK gets
28 confused about extended/logical partitions starting past cylinder 1023. */ 30 confused about extended/logical partitions starting past cylinder 1023. */
@@ -53,24 +55,6 @@ enum {
53 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ 55 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */
54}; 56};
55 57
56#ifndef __KERNEL__
57
58struct partition {
59 unsigned char boot_ind; /* 0x80 - active */
60 unsigned char head; /* starting head */
61 unsigned char sector; /* starting sector */
62 unsigned char cyl; /* starting cylinder */
63 unsigned char sys_ind; /* What partition type */
64 unsigned char end_head; /* end head */
65 unsigned char end_sector; /* end sector */
66 unsigned char end_cyl; /* end cylinder */
67 unsigned int start_sect; /* starting sector counting from 0 */
68 unsigned int nr_sects; /* nr of sectors in partition */
69} __attribute__((packed));
70
71#endif
72
73#ifdef __KERNEL__
74#include <linux/major.h> 58#include <linux/major.h>
75#include <linux/device.h> 59#include <linux/device.h>
76#include <linux/smp.h> 60#include <linux/smp.h>
@@ -226,7 +210,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) {
226 sizeof(struct disk_stats)); 210 sizeof(struct disk_stats));
227} 211}
228 212
229#else 213#else /* !CONFIG_SMP */
230#define __disk_stat_add(gendiskp, field, addnd) \ 214#define __disk_stat_add(gendiskp, field, addnd) \
231 (gendiskp->dkstats.field += addnd) 215 (gendiskp->dkstats.field += addnd)
232#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) 216#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field)
@@ -254,7 +238,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value)
254 memset(&part->dkstats, value, sizeof(struct disk_stats)); 238 memset(&part->dkstats, value, sizeof(struct disk_stats));
255} 239}
256 240
257#endif 241#endif /* CONFIG_SMP */
258 242
259#define disk_stat_add(gendiskp, field, addnd) \ 243#define disk_stat_add(gendiskp, field, addnd) \
260 do { \ 244 do { \
@@ -393,8 +377,6 @@ static inline void set_capacity(struct gendisk *disk, sector_t size)
393 disk->capacity = size; 377 disk->capacity = size;
394} 378}
395 379
396#endif /* __KERNEL__ */
397
398#ifdef CONFIG_SOLARIS_X86_PARTITION 380#ifdef CONFIG_SOLARIS_X86_PARTITION
399 381
400#define SOLARIS_X86_NUMSLICE 16 382#define SOLARIS_X86_NUMSLICE 16
@@ -538,8 +520,6 @@ struct unixware_disklabel {
538# define MINIX_NR_SUBPARTITIONS 4 520# define MINIX_NR_SUBPARTITIONS 4
539#endif /* CONFIG_MINIX_SUBPARTITION */ 521#endif /* CONFIG_MINIX_SUBPARTITION */
540 522
541#ifdef __KERNEL__
542
543#define ADDPART_FLAG_NONE 0 523#define ADDPART_FLAG_NONE 0
544#define ADDPART_FLAG_RAID 1 524#define ADDPART_FLAG_RAID 1
545#define ADDPART_FLAG_WHOLEDISK 2 525#define ADDPART_FLAG_WHOLEDISK 2
@@ -556,7 +536,6 @@ extern struct gendisk *alloc_disk_node(int minors, int node_id);
556extern struct gendisk *alloc_disk(int minors); 536extern struct gendisk *alloc_disk(int minors);
557extern struct kobject *get_disk(struct gendisk *disk); 537extern struct kobject *get_disk(struct gendisk *disk);
558extern void put_disk(struct gendisk *disk); 538extern void put_disk(struct gendisk *disk);
559extern void genhd_media_change_notify(struct gendisk *disk);
560extern void blk_register_region(dev_t devt, unsigned long range, 539extern void blk_register_region(dev_t devt, unsigned long range,
561 struct module *module, 540 struct module *module,
562 struct kobject *(*probe)(dev_t, int *, void *), 541 struct kobject *(*probe)(dev_t, int *, void *),
@@ -569,8 +548,6 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index)
569 return bdget(MKDEV(disk->major, disk->first_minor) + index); 548 return bdget(MKDEV(disk->major, disk->first_minor) + index);
570} 549}
571 550
572#endif
573
574#else /* CONFIG_BLOCK */ 551#else /* CONFIG_BLOCK */
575 552
576static inline void printk_all_partitions(void) { } 553static inline void printk_all_partitions(void) { }
@@ -583,4 +560,4 @@ static inline dev_t blk_lookup_devt(const char *name)
583 560
584#endif /* CONFIG_BLOCK */ 561#endif /* CONFIG_BLOCK */
585 562
586#endif 563#endif /* _LINUX_GENHD_H */