Remove <linux/genhd.h> from user-visible headers.

It was all wrapped in '#ifdef CONFIG_BLOCK' anyway, so userspace was
getting nothing useful out of it. And the special #ifndef __KERNEL__
version of 'struct partition' makes me inclined to promote an attitude
of violence...

Stick some comments on some of the #endifs too, while we're at it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Woodhouse and committed by
Linus Torvalds
a8ae50ba 0738c4bb

+3 -28
-1
include/linux/Kbuild
··· 205 unifdef-y += fs.h 206 unifdef-y += gameport.h 207 unifdef-y += generic_serial.h 208 - unifdef-y += genhd.h 209 unifdef-y += gfs2_ondisk.h 210 unifdef-y += hayesesp.h 211 unifdef-y += hdlcdrv.h
··· 205 unifdef-y += fs.h 206 unifdef-y += gameport.h 207 unifdef-y += generic_serial.h 208 unifdef-y += gfs2_ondisk.h 209 unifdef-y += hayesesp.h 210 unifdef-y += hdlcdrv.h
+3 -27
include/linux/genhd.h
··· 55 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ 56 }; 57 58 - #ifndef __KERNEL__ 59 - 60 - struct 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> 77 #include <linux/device.h> 78 #include <linux/smp.h> ··· 210 sizeof(struct disk_stats)); 211 } 212 213 - #else 214 #define __disk_stat_add(gendiskp, field, addnd) \ 215 (gendiskp->dkstats.field += addnd) 216 #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) ··· 238 memset(&part->dkstats, value, sizeof(struct disk_stats)); 239 } 240 241 - #endif 242 243 #define disk_stat_add(gendiskp, field, addnd) \ 244 do { \ ··· 376 { 377 disk->capacity = size; 378 } 379 - 380 - #endif /* __KERNEL__ */ 381 382 #ifdef CONFIG_SOLARIS_X86_PARTITION 383 ··· 520 # define MINIX_NR_SUBPARTITIONS 4 521 #endif /* CONFIG_MINIX_SUBPARTITION */ 522 523 - #ifdef __KERNEL__ 524 - 525 #define ADDPART_FLAG_NONE 0 526 #define ADDPART_FLAG_RAID 1 527 #define ADDPART_FLAG_WHOLEDISK 2 ··· 548 return bdget(MKDEV(disk->major, disk->first_minor) + index); 549 } 550 551 - #endif 552 - 553 #else /* CONFIG_BLOCK */ 554 555 static inline void printk_all_partitions(void) { } ··· 560 561 #endif /* CONFIG_BLOCK */ 562 563 - #endif
··· 55 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ 56 }; 57 58 #include <linux/major.h> 59 #include <linux/device.h> 60 #include <linux/smp.h> ··· 228 sizeof(struct disk_stats)); 229 } 230 231 + #else /* !CONFIG_SMP */ 232 #define __disk_stat_add(gendiskp, field, addnd) \ 233 (gendiskp->dkstats.field += addnd) 234 #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) ··· 256 memset(&part->dkstats, value, sizeof(struct disk_stats)); 257 } 258 259 + #endif /* CONFIG_SMP */ 260 261 #define disk_stat_add(gendiskp, field, addnd) \ 262 do { \ ··· 394 { 395 disk->capacity = size; 396 } 397 398 #ifdef CONFIG_SOLARIS_X86_PARTITION 399 ··· 540 # define MINIX_NR_SUBPARTITIONS 4 541 #endif /* CONFIG_MINIX_SUBPARTITION */ 542 543 #define ADDPART_FLAG_NONE 0 544 #define ADDPART_FLAG_RAID 1 545 #define ADDPART_FLAG_WHOLEDISK 2 ··· 570 return bdget(MKDEV(disk->major, disk->first_minor) + index); 571 } 572 573 #else /* CONFIG_BLOCK */ 574 575 static inline void printk_all_partitions(void) { } ··· 584 585 #endif /* CONFIG_BLOCK */ 586 587 + #endif /* _LINUX_GENHD_H */