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.h30
1 files changed, 3 insertions, 27 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 32c2ac49a070..ecd2bf63fc84 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -55,24 +55,6 @@ enum {
55 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ 55 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */
56}; 56};
57 57
58#ifndef __KERNEL__
59
60struct partition {
61 unsigned char boot_ind; /* 0x80 - active */
62 unsigned char head; /* starting head */
63 unsigned char sector; /* starting sector */
64 unsigned char cyl; /* starting cylinder */
65 unsigned char sys_ind; /* What partition type */
66 unsigned char end_head; /* end head */
67 unsigned char end_sector; /* end sector */
68 unsigned char end_cyl; /* end cylinder */
69 unsigned int start_sect; /* starting sector counting from 0 */
70 unsigned int nr_sects; /* nr of sectors in partition */
71} __attribute__((packed));
72
73#endif
74
75#ifdef __KERNEL__
76#include <linux/major.h> 58#include <linux/major.h>
77#include <linux/device.h> 59#include <linux/device.h>
78#include <linux/smp.h> 60#include <linux/smp.h>
@@ -228,7 +210,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) {
228 sizeof(struct disk_stats)); 210 sizeof(struct disk_stats));
229} 211}
230 212
231#else 213#else /* !CONFIG_SMP */
232#define __disk_stat_add(gendiskp, field, addnd) \ 214#define __disk_stat_add(gendiskp, field, addnd) \
233 (gendiskp->dkstats.field += addnd) 215 (gendiskp->dkstats.field += addnd)
234#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) 216#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field)
@@ -256,7 +238,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value)
256 memset(&part->dkstats, value, sizeof(struct disk_stats)); 238 memset(&part->dkstats, value, sizeof(struct disk_stats));
257} 239}
258 240
259#endif 241#endif /* CONFIG_SMP */
260 242
261#define disk_stat_add(gendiskp, field, addnd) \ 243#define disk_stat_add(gendiskp, field, addnd) \
262 do { \ 244 do { \
@@ -395,8 +377,6 @@ static inline void set_capacity(struct gendisk *disk, sector_t size)
395 disk->capacity = size; 377 disk->capacity = size;
396} 378}
397 379
398#endif /* __KERNEL__ */
399
400#ifdef CONFIG_SOLARIS_X86_PARTITION 380#ifdef CONFIG_SOLARIS_X86_PARTITION
401 381
402#define SOLARIS_X86_NUMSLICE 16 382#define SOLARIS_X86_NUMSLICE 16
@@ -540,8 +520,6 @@ struct unixware_disklabel {
540# define MINIX_NR_SUBPARTITIONS 4 520# define MINIX_NR_SUBPARTITIONS 4
541#endif /* CONFIG_MINIX_SUBPARTITION */ 521#endif /* CONFIG_MINIX_SUBPARTITION */
542 522
543#ifdef __KERNEL__
544
545#define ADDPART_FLAG_NONE 0 523#define ADDPART_FLAG_NONE 0
546#define ADDPART_FLAG_RAID 1 524#define ADDPART_FLAG_RAID 1
547#define ADDPART_FLAG_WHOLEDISK 2 525#define ADDPART_FLAG_WHOLEDISK 2
@@ -570,8 +548,6 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index)
570 return bdget(MKDEV(disk->major, disk->first_minor) + index); 548 return bdget(MKDEV(disk->major, disk->first_minor) + index);
571} 549}
572 550
573#endif
574
575#else /* CONFIG_BLOCK */ 551#else /* CONFIG_BLOCK */
576 552
577static inline void printk_all_partitions(void) { } 553static inline void printk_all_partitions(void) { }
@@ -584,4 +560,4 @@ static inline dev_t blk_lookup_devt(const char *name)
584 560
585#endif /* CONFIG_BLOCK */ 561#endif /* CONFIG_BLOCK */
586 562
587#endif 563#endif /* _LINUX_GENHD_H */