diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/genhd.h | 30 | ||||
-rw-r--r-- | include/linux/mm.h | 13 |
3 files changed, 13 insertions, 31 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 994df3780007..0fac822c1157 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -205,7 +205,6 @@ unifdef-y += futex.h | |||
205 | unifdef-y += fs.h | 205 | unifdef-y += fs.h |
206 | unifdef-y += gameport.h | 206 | unifdef-y += gameport.h |
207 | unifdef-y += generic_serial.h | 207 | unifdef-y += generic_serial.h |
208 | unifdef-y += genhd.h | ||
209 | unifdef-y += gfs2_ondisk.h | 208 | unifdef-y += gfs2_ondisk.h |
210 | unifdef-y += hayesesp.h | 209 | unifdef-y += hayesesp.h |
211 | unifdef-y += hdlcdrv.h | 210 | unifdef-y += hdlcdrv.h |
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 | |||
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> | 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 | ||
577 | static inline void printk_all_partitions(void) { } | 553 | static 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 */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3f3ccfe42de0..b695875d63e3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -235,15 +235,22 @@ static inline int get_page_unless_zero(struct page *page) | |||
235 | struct page *vmalloc_to_page(const void *addr); | 235 | struct page *vmalloc_to_page(const void *addr); |
236 | unsigned long vmalloc_to_pfn(const void *addr); | 236 | unsigned long vmalloc_to_pfn(const void *addr); |
237 | 237 | ||
238 | #ifdef CONFIG_MMU | 238 | /* |
239 | /* Determine if an address is within the vmalloc range */ | 239 | * Determine if an address is within the vmalloc range |
240 | * | ||
241 | * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there | ||
242 | * is no special casing required. | ||
243 | */ | ||
240 | static inline int is_vmalloc_addr(const void *x) | 244 | static inline int is_vmalloc_addr(const void *x) |
241 | { | 245 | { |
246 | #ifdef CONFIG_MMU | ||
242 | unsigned long addr = (unsigned long)x; | 247 | unsigned long addr = (unsigned long)x; |
243 | 248 | ||
244 | return addr >= VMALLOC_START && addr < VMALLOC_END; | 249 | return addr >= VMALLOC_START && addr < VMALLOC_END; |
245 | } | 250 | #else |
251 | return 0; | ||
246 | #endif | 252 | #endif |
253 | } | ||
247 | 254 | ||
248 | static inline struct page *compound_head(struct page *page) | 255 | static inline struct page *compound_head(struct page *page) |
249 | { | 256 | { |