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