diff options
Diffstat (limited to 'include/linux')
65 files changed, 1073 insertions, 333 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 1993a3691768..19f70462b3be 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
| @@ -162,13 +162,13 @@ typedef struct acct acct_t; | |||
| 162 | #ifdef __KERNEL__ | 162 | #ifdef __KERNEL__ |
| 163 | /* | 163 | /* |
| 164 | * Yet another set of HZ to *HZ helper functions. | 164 | * Yet another set of HZ to *HZ helper functions. |
| 165 | * See <linux/times.h> for the original. | 165 | * See <linux/jiffies.h> for the original. |
| 166 | */ | 166 | */ |
| 167 | 167 | ||
| 168 | static inline u32 jiffies_to_AHZ(unsigned long x) | 168 | static inline u32 jiffies_to_AHZ(unsigned long x) |
| 169 | { | 169 | { |
| 170 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 | 170 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 |
| 171 | return x / (HZ / USER_HZ); | 171 | return x / (HZ / AHZ); |
| 172 | #else | 172 | #else |
| 173 | u64 tmp = (u64)x * TICK_NSEC; | 173 | u64 tmp = (u64)x * TICK_NSEC; |
| 174 | do_div(tmp, (NSEC_PER_SEC / AHZ)); | 174 | do_div(tmp, (NSEC_PER_SEC / AHZ)); |
diff --git a/include/linux/aio.h b/include/linux/aio.h index a4d5af907f90..0decf66117c1 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
| @@ -24,7 +24,12 @@ struct kioctx; | |||
| 24 | #define KIOCB_SYNC_KEY (~0U) | 24 | #define KIOCB_SYNC_KEY (~0U) |
| 25 | 25 | ||
| 26 | /* ki_flags bits */ | 26 | /* ki_flags bits */ |
| 27 | #define KIF_LOCKED 0 | 27 | /* |
| 28 | * This may be used for cancel/retry serialization in the future, but | ||
| 29 | * for now it's unused and we probably don't want modules to even | ||
| 30 | * think they can use it. | ||
| 31 | */ | ||
| 32 | /* #define KIF_LOCKED 0 */ | ||
| 28 | #define KIF_KICKED 1 | 33 | #define KIF_KICKED 1 |
| 29 | #define KIF_CANCELLED 2 | 34 | #define KIF_CANCELLED 2 |
| 30 | 35 | ||
| @@ -43,6 +48,40 @@ struct kioctx; | |||
| 43 | #define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) | 48 | #define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) |
| 44 | #define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) | 49 | #define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) |
| 45 | 50 | ||
| 51 | /* is there a better place to document function pointer methods? */ | ||
| 52 | /** | ||
| 53 | * ki_retry - iocb forward progress callback | ||
| 54 | * @kiocb: The kiocb struct to advance by performing an operation. | ||
| 55 | * | ||
| 56 | * This callback is called when the AIO core wants a given AIO operation | ||
| 57 | * to make forward progress. The kiocb argument describes the operation | ||
| 58 | * that is to be performed. As the operation proceeds, perhaps partially, | ||
| 59 | * ki_retry is expected to update the kiocb with progress made. Typically | ||
| 60 | * ki_retry is set in the AIO core and it itself calls file_operations | ||
| 61 | * helpers. | ||
| 62 | * | ||
| 63 | * ki_retry's return value determines when the AIO operation is completed | ||
| 64 | * and an event is generated in the AIO event ring. Except the special | ||
| 65 | * return values described below, the value that is returned from ki_retry | ||
| 66 | * is transferred directly into the completion ring as the operation's | ||
| 67 | * resulting status. Once this has happened ki_retry *MUST NOT* reference | ||
| 68 | * the kiocb pointer again. | ||
| 69 | * | ||
| 70 | * If ki_retry returns -EIOCBQUEUED it has made a promise that aio_complete() | ||
| 71 | * will be called on the kiocb pointer in the future. The AIO core will | ||
| 72 | * not ask the method again -- ki_retry must ensure forward progress. | ||
| 73 | * aio_complete() must be called once and only once in the future, multiple | ||
| 74 | * calls may result in undefined behaviour. | ||
| 75 | * | ||
| 76 | * If ki_retry returns -EIOCBRETRY it has made a promise that kick_iocb() | ||
| 77 | * will be called on the kiocb pointer in the future. This may happen | ||
| 78 | * through generic helpers that associate kiocb->ki_wait with a wait | ||
| 79 | * queue head that ki_retry uses via current->io_wait. It can also happen | ||
| 80 | * with custom tracking and manual calls to kick_iocb(), though that is | ||
| 81 | * discouraged. In either case, kick_iocb() must be called once and only | ||
| 82 | * once. ki_retry must ensure forward progress, the AIO core will wait | ||
| 83 | * indefinitely for kick_iocb() to be called. | ||
| 84 | */ | ||
| 46 | struct kiocb { | 85 | struct kiocb { |
| 47 | struct list_head ki_run_list; | 86 | struct list_head ki_run_list; |
| 48 | long ki_flags; | 87 | long ki_flags; |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 9f374cfa1b05..e7d0593bb576 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
| @@ -76,6 +76,13 @@ struct atm_dev_stats { | |||
| 76 | /* set interface ESI */ | 76 | /* set interface ESI */ |
| 77 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) | 77 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) |
| 78 | /* force interface ESI */ | 78 | /* force interface ESI */ |
| 79 | #define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc) | ||
| 80 | /* register a LECS address */ | ||
| 81 | #define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc) | ||
| 82 | /* unregister a LECS address */ | ||
| 83 | #define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc) | ||
| 84 | /* retrieve LECS address(es) */ | ||
| 85 | |||
| 79 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) | 86 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) |
| 80 | /* get AAL layer statistics */ | 87 | /* get AAL layer statistics */ |
| 81 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) | 88 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) |
| @@ -328,6 +335,8 @@ struct atm_dev_addr { | |||
| 328 | struct list_head entry; /* next address */ | 335 | struct list_head entry; /* next address */ |
| 329 | }; | 336 | }; |
| 330 | 337 | ||
| 338 | enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS }; | ||
| 339 | |||
| 331 | struct atm_dev { | 340 | struct atm_dev { |
| 332 | const struct atmdev_ops *ops; /* device operations; NULL if unused */ | 341 | const struct atmdev_ops *ops; /* device operations; NULL if unused */ |
| 333 | const struct atmphy_ops *phy; /* PHY operations, may be undefined */ | 342 | const struct atmphy_ops *phy; /* PHY operations, may be undefined */ |
| @@ -338,6 +347,7 @@ struct atm_dev { | |||
| 338 | void *phy_data; /* private PHY date */ | 347 | void *phy_data; /* private PHY date */ |
| 339 | unsigned long flags; /* device flags (ATM_DF_*) */ | 348 | unsigned long flags; /* device flags (ATM_DF_*) */ |
| 340 | struct list_head local; /* local ATM addresses */ | 349 | struct list_head local; /* local ATM addresses */ |
| 350 | struct list_head lecs; /* LECS ATM addresses learned via ILMI */ | ||
| 341 | unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ | 351 | unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ |
| 342 | struct atm_cirange ci_range; /* VPI/VCI range */ | 352 | struct atm_cirange ci_range; /* VPI/VCI range */ |
| 343 | struct k_atm_dev_stats stats; /* statistics */ | 353 | struct k_atm_dev_stats stats; /* statistics */ |
| @@ -457,7 +467,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
| 457 | 467 | ||
| 458 | int atm_charge(struct atm_vcc *vcc,int truesize); | 468 | int atm_charge(struct atm_vcc *vcc,int truesize); |
| 459 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, | 469 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, |
| 460 | int gfp_flags); | 470 | gfp_t gfp_flags); |
| 461 | int atm_pcr_goal(struct atm_trafprm *tp); | 471 | int atm_pcr_goal(struct atm_trafprm *tp); |
| 462 | 472 | ||
| 463 | void vcc_release_async(struct atm_vcc *vcc, int reply); | 473 | void vcc_release_async(struct atm_vcc *vcc, int reply); |
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h index c1237aa92e38..8ed6dfdcd783 100644 --- a/include/linux/bfs_fs.h +++ b/include/linux/bfs_fs.h | |||
| @@ -20,19 +20,19 @@ | |||
| 20 | 20 | ||
| 21 | /* BFS inode layout on disk */ | 21 | /* BFS inode layout on disk */ |
| 22 | struct bfs_inode { | 22 | struct bfs_inode { |
| 23 | __u16 i_ino; | 23 | __le16 i_ino; |
| 24 | __u16 i_unused; | 24 | __u16 i_unused; |
| 25 | __u32 i_sblock; | 25 | __le32 i_sblock; |
| 26 | __u32 i_eblock; | 26 | __le32 i_eblock; |
| 27 | __u32 i_eoffset; | 27 | __le32 i_eoffset; |
| 28 | __u32 i_vtype; | 28 | __le32 i_vtype; |
| 29 | __u32 i_mode; | 29 | __le32 i_mode; |
| 30 | __s32 i_uid; | 30 | __le32 i_uid; |
| 31 | __s32 i_gid; | 31 | __le32 i_gid; |
| 32 | __u32 i_nlink; | 32 | __le32 i_nlink; |
| 33 | __u32 i_atime; | 33 | __le32 i_atime; |
| 34 | __u32 i_mtime; | 34 | __le32 i_mtime; |
| 35 | __u32 i_ctime; | 35 | __le32 i_ctime; |
| 36 | __u32 i_padding[4]; | 36 | __u32 i_padding[4]; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| @@ -41,17 +41,17 @@ struct bfs_inode { | |||
| 41 | #define BFS_DIRS_PER_BLOCK 32 | 41 | #define BFS_DIRS_PER_BLOCK 32 |
| 42 | 42 | ||
| 43 | struct bfs_dirent { | 43 | struct bfs_dirent { |
| 44 | __u16 ino; | 44 | __le16 ino; |
| 45 | char name[BFS_NAMELEN]; | 45 | char name[BFS_NAMELEN]; |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | /* BFS superblock layout on disk */ | 48 | /* BFS superblock layout on disk */ |
| 49 | struct bfs_super_block { | 49 | struct bfs_super_block { |
| 50 | __u32 s_magic; | 50 | __le32 s_magic; |
| 51 | __u32 s_start; | 51 | __le32 s_start; |
| 52 | __u32 s_end; | 52 | __le32 s_end; |
| 53 | __s32 s_from; | 53 | __le32 s_from; |
| 54 | __s32 s_to; | 54 | __le32 s_to; |
| 55 | __s32 s_bfrom; | 55 | __s32 s_bfrom; |
| 56 | __s32 s_bto; | 56 | __s32 s_bto; |
| 57 | char s_fsname[6]; | 57 | char s_fsname[6]; |
| @@ -66,15 +66,15 @@ struct bfs_super_block { | |||
| 66 | #define BFS_INO2OFF(ino) \ | 66 | #define BFS_INO2OFF(ino) \ |
| 67 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) | 67 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) |
| 68 | #define BFS_NZFILESIZE(ip) \ | 68 | #define BFS_NZFILESIZE(ip) \ |
| 69 | ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE) | 69 | ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE) |
| 70 | 70 | ||
| 71 | #define BFS_FILESIZE(ip) \ | 71 | #define BFS_FILESIZE(ip) \ |
| 72 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) | 72 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) |
| 73 | 73 | ||
| 74 | #define BFS_FILEBLOCKS(ip) \ | 74 | #define BFS_FILEBLOCKS(ip) \ |
| 75 | ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock)) | 75 | ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock)) |
| 76 | #define BFS_UNCLEAN(bfs_sb, sb) \ | 76 | #define BFS_UNCLEAN(bfs_sb, sb) \ |
| 77 | ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) | 77 | ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) |
| 78 | 78 | ||
| 79 | 79 | ||
| 80 | #endif /* _LINUX_BFS_FS_H */ | 80 | #endif /* _LINUX_BFS_FS_H */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 6e1c79c8b6bf..3344b4e8e43a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -276,8 +276,8 @@ extern void bio_pair_release(struct bio_pair *dbio); | |||
| 276 | extern struct bio_set *bioset_create(int, int, int); | 276 | extern struct bio_set *bioset_create(int, int, int); |
| 277 | extern void bioset_free(struct bio_set *); | 277 | extern void bioset_free(struct bio_set *); |
| 278 | 278 | ||
| 279 | extern struct bio *bio_alloc(unsigned int __nocast, int); | 279 | extern struct bio *bio_alloc(gfp_t, int); |
| 280 | extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); | 280 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
| 281 | extern void bio_put(struct bio *); | 281 | extern void bio_put(struct bio *); |
| 282 | extern void bio_free(struct bio *, struct bio_set *); | 282 | extern void bio_free(struct bio *, struct bio_set *); |
| 283 | 283 | ||
| @@ -287,7 +287,7 @@ extern int bio_phys_segments(struct request_queue *, struct bio *); | |||
| 287 | extern int bio_hw_segments(struct request_queue *, struct bio *); | 287 | extern int bio_hw_segments(struct request_queue *, struct bio *); |
| 288 | 288 | ||
| 289 | extern void __bio_clone(struct bio *, struct bio *); | 289 | extern void __bio_clone(struct bio *, struct bio *); |
| 290 | extern struct bio *bio_clone(struct bio *, unsigned int __nocast); | 290 | extern struct bio *bio_clone(struct bio *, gfp_t); |
| 291 | 291 | ||
| 292 | extern void bio_init(struct bio *); | 292 | extern void bio_init(struct bio *); |
| 293 | 293 | ||
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 82bd8842d11c..3b03b0b868dd 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -43,7 +43,7 @@ typedef struct bootmem_data { | |||
| 43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); | 43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); |
| 44 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); | 44 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); |
| 45 | extern void __init free_bootmem (unsigned long addr, unsigned long size); | 45 | extern void __init free_bootmem (unsigned long addr, unsigned long size); |
| 46 | extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); | 46 | extern void * __init __alloc_bootmem_limit (unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); |
| 47 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 47 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
| 48 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | 48 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); |
| 49 | #define alloc_bootmem(x) \ | 49 | #define alloc_bootmem(x) \ |
| @@ -54,6 +54,16 @@ extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | |||
| 54 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 54 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
| 55 | #define alloc_bootmem_low_pages(x) \ | 55 | #define alloc_bootmem_low_pages(x) \ |
| 56 | __alloc_bootmem((x), PAGE_SIZE, 0) | 56 | __alloc_bootmem((x), PAGE_SIZE, 0) |
| 57 | |||
| 58 | #define alloc_bootmem_limit(x, limit) \ | ||
| 59 | __alloc_bootmem_limit((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit)) | ||
| 60 | #define alloc_bootmem_low_limit(x, limit) \ | ||
| 61 | __alloc_bootmem_limit((x), SMP_CACHE_BYTES, 0, (limit)) | ||
| 62 | #define alloc_bootmem_pages_limit(x, limit) \ | ||
| 63 | __alloc_bootmem_limit((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit)) | ||
| 64 | #define alloc_bootmem_low_pages_limit(x, limit) \ | ||
| 65 | __alloc_bootmem_limit((x), PAGE_SIZE, 0, (limit)) | ||
| 66 | |||
| 57 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 67 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
| 58 | extern unsigned long __init free_all_bootmem (void); | 68 | extern unsigned long __init free_all_bootmem (void); |
| 59 | 69 | ||
| @@ -61,7 +71,7 @@ extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long f | |||
| 61 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); | 71 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); |
| 62 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); | 72 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); |
| 63 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); | 73 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); |
| 64 | extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); | 74 | extern void * __init __alloc_bootmem_node_limit (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); |
| 65 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 75 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
| 66 | #define alloc_bootmem_node(pgdat, x) \ | 76 | #define alloc_bootmem_node(pgdat, x) \ |
| 67 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 77 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
| @@ -69,6 +79,14 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, | |||
| 69 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 79 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
| 70 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 80 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
| 71 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) | 81 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) |
| 82 | |||
| 83 | #define alloc_bootmem_node_limit(pgdat, x, limit) \ | ||
| 84 | __alloc_bootmem_node_limit((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit)) | ||
| 85 | #define alloc_bootmem_pages_node_limit(pgdat, x, limit) \ | ||
| 86 | __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit)) | ||
| 87 | #define alloc_bootmem_low_pages_node_limit(pgdat, x, limit) \ | ||
| 88 | __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, 0, (limit)) | ||
| 89 | |||
| 72 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 90 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
| 73 | 91 | ||
| 74 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 92 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
| @@ -105,5 +123,15 @@ extern void *__init alloc_large_system_hash(const char *tablename, | |||
| 105 | #endif | 123 | #endif |
| 106 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ | 124 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ |
| 107 | 125 | ||
| 126 | static inline void *__alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal) | ||
| 127 | { | ||
| 128 | return __alloc_bootmem_limit(size, align, goal, 0); | ||
| 129 | } | ||
| 130 | |||
| 131 | static inline void *__alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, | ||
| 132 | unsigned long goal) | ||
| 133 | { | ||
| 134 | return __alloc_bootmem_node_limit(pgdat, size, align, goal, 0); | ||
| 135 | } | ||
| 108 | 136 | ||
| 109 | #endif /* _LINUX_BOOTMEM_H */ | 137 | #endif /* _LINUX_BOOTMEM_H */ |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 90828493791f..6a1d154c0825 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -172,7 +172,7 @@ void __brelse(struct buffer_head *); | |||
| 172 | void __bforget(struct buffer_head *); | 172 | void __bforget(struct buffer_head *); |
| 173 | void __breadahead(struct block_device *, sector_t block, int size); | 173 | void __breadahead(struct block_device *, sector_t block, int size); |
| 174 | struct buffer_head *__bread(struct block_device *, sector_t block, int size); | 174 | struct buffer_head *__bread(struct block_device *, sector_t block, int size); |
| 175 | struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags); | 175 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); |
| 176 | void free_buffer_head(struct buffer_head * bh); | 176 | void free_buffer_head(struct buffer_head * bh); |
| 177 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); | 177 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); |
| 178 | void FASTCALL(__lock_buffer(struct buffer_head *bh)); | 178 | void FASTCALL(__lock_buffer(struct buffer_head *bh)); |
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h index 5fde6f4d6c1e..04bd756efc67 100644 --- a/include/linux/byteorder/generic.h +++ b/include/linux/byteorder/generic.h | |||
| @@ -5,6 +5,10 @@ | |||
| 5 | * linux/byteorder_generic.h | 5 | * linux/byteorder_generic.h |
| 6 | * Generic Byte-reordering support | 6 | * Generic Byte-reordering support |
| 7 | * | 7 | * |
| 8 | * The "... p" macros, like le64_to_cpup, can be used with pointers | ||
| 9 | * to unaligned data, but there will be a performance penalty on | ||
| 10 | * some architectures. Use get_unaligned for unaligned data. | ||
| 11 | * | ||
| 8 | * Francois-Rene Rideau <fare@tunes.org> 19970707 | 12 | * Francois-Rene Rideau <fare@tunes.org> 19970707 |
| 9 | * gathered all the good ideas from all asm-foo/byteorder.h into one file, | 13 | * gathered all the good ideas from all asm-foo/byteorder.h into one file, |
| 10 | * cleaned them up. | 14 | * cleaned them up. |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 96de26301f84..95952cc1f525 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
| @@ -104,12 +104,19 @@ struct cn_queue_dev { | |||
| 104 | struct sock *nls; | 104 | struct sock *nls; |
| 105 | }; | 105 | }; |
| 106 | 106 | ||
| 107 | struct cn_callback { | 107 | struct cn_callback_id { |
| 108 | unsigned char name[CN_CBQ_NAMELEN]; | 108 | unsigned char name[CN_CBQ_NAMELEN]; |
| 109 | |||
| 110 | struct cb_id id; | 109 | struct cb_id id; |
| 110 | }; | ||
| 111 | |||
| 112 | struct cn_callback_data { | ||
| 113 | void (*destruct_data) (void *); | ||
| 114 | void *ddata; | ||
| 115 | |||
| 116 | void *callback_priv; | ||
| 111 | void (*callback) (void *); | 117 | void (*callback) (void *); |
| 112 | void *priv; | 118 | |
| 119 | void *free; | ||
| 113 | }; | 120 | }; |
| 114 | 121 | ||
| 115 | struct cn_callback_entry { | 122 | struct cn_callback_entry { |
| @@ -118,8 +125,8 @@ struct cn_callback_entry { | |||
| 118 | struct work_struct work; | 125 | struct work_struct work; |
| 119 | struct cn_queue_dev *pdev; | 126 | struct cn_queue_dev *pdev; |
| 120 | 127 | ||
| 121 | void (*destruct_data) (void *); | 128 | struct cn_callback_id id; |
| 122 | void *ddata; | 129 | struct cn_callback_data data; |
| 123 | 130 | ||
| 124 | int seq, group; | 131 | int seq, group; |
| 125 | struct sock *nls; | 132 | struct sock *nls; |
| @@ -142,9 +149,9 @@ struct cn_dev { | |||
| 142 | 149 | ||
| 143 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | 150 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); |
| 144 | void cn_del_callback(struct cb_id *); | 151 | void cn_del_callback(struct cb_id *); |
| 145 | int cn_netlink_send(struct cn_msg *, u32, int); | 152 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); |
| 146 | 153 | ||
| 147 | int cn_queue_add_callback(struct cn_queue_dev *dev, struct cn_callback *cb); | 154 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); |
| 148 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 155 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
| 149 | 156 | ||
| 150 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); | 157 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); |
| @@ -152,6 +159,8 @@ void cn_queue_free_dev(struct cn_queue_dev *dev); | |||
| 152 | 159 | ||
| 153 | int cn_cb_equal(struct cb_id *, struct cb_id *); | 160 | int cn_cb_equal(struct cb_id *, struct cb_id *); |
| 154 | 161 | ||
| 162 | void cn_queue_wrapper(void *data); | ||
| 163 | |||
| 155 | extern int cn_already_initialized; | 164 | extern int cn_already_initialized; |
| 156 | 165 | ||
| 157 | #endif /* __KERNEL__ */ | 166 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index b15826f6e3a2..9bdba8169b41 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -392,4 +392,14 @@ extern cpumask_t cpu_present_map; | |||
| 392 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | 392 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) |
| 393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
| 394 | 394 | ||
| 395 | /* Find the highest possible smp_processor_id() */ | ||
| 396 | #define highest_possible_processor_id() \ | ||
| 397 | ({ \ | ||
| 398 | unsigned int cpu, highest = 0; \ | ||
| 399 | for_each_cpu_mask(cpu, cpu_possible_map) \ | ||
| 400 | highest = cpu; \ | ||
| 401 | highest; \ | ||
| 402 | }) | ||
| 403 | |||
| 404 | |||
| 395 | #endif /* __LINUX_CPUMASK_H */ | 405 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 24062a1dbf61..6e2deef96b34 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -23,7 +23,7 @@ void cpuset_init_current_mems_allowed(void); | |||
| 23 | void cpuset_update_current_mems_allowed(void); | 23 | void cpuset_update_current_mems_allowed(void); |
| 24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); | 24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); |
| 25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); | 25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); |
| 26 | extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); | 26 | extern int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask); |
| 27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); | 27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); |
| 28 | extern struct file_operations proc_cpuset_operations; | 28 | extern struct file_operations proc_cpuset_operations; |
| 29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | 29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); |
| @@ -49,8 +49,7 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) | |||
| 49 | return 1; | 49 | return 1; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | static inline int cpuset_zone_allowed(struct zone *z, | 52 | static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) |
| 53 | unsigned int __nocast gfp_mask) | ||
| 54 | { | 53 | { |
| 55 | return 1; | 54 | return 1; |
| 56 | } | 55 | } |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 8bf4bacb5051..71fab4311e92 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
| @@ -4,16 +4,6 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <asm/byteorder.h> | 5 | #include <asm/byteorder.h> |
| 6 | 6 | ||
| 7 | /* Structure describing an Internet (DCCP) socket address. */ | ||
| 8 | struct sockaddr_dccp { | ||
| 9 | __u16 sdccp_family; /* Address family */ | ||
| 10 | __u16 sdccp_port; /* Port number */ | ||
| 11 | __u32 sdccp_addr; /* Internet address */ | ||
| 12 | __u32 sdccp_service; /* Service */ | ||
| 13 | /* Pad to size of `struct sockaddr': 16 bytes . */ | ||
| 14 | __u32 sdccp_pad; | ||
| 15 | }; | ||
| 16 | |||
| 17 | /** | 7 | /** |
| 18 | * struct dccp_hdr - generic part of DCCP packet header | 8 | * struct dccp_hdr - generic part of DCCP packet header |
| 19 | * | 9 | * |
| @@ -188,6 +178,11 @@ enum { | |||
| 188 | 178 | ||
| 189 | /* DCCP socket options */ | 179 | /* DCCP socket options */ |
| 190 | #define DCCP_SOCKOPT_PACKET_SIZE 1 | 180 | #define DCCP_SOCKOPT_PACKET_SIZE 1 |
| 181 | #define DCCP_SOCKOPT_SERVICE 2 | ||
| 182 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | ||
| 183 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | ||
| 184 | |||
| 185 | #define DCCP_SERVICE_LIST_MAX_LEN 32 | ||
| 191 | 186 | ||
| 192 | #ifdef __KERNEL__ | 187 | #ifdef __KERNEL__ |
| 193 | 188 | ||
| @@ -337,7 +332,8 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
| 337 | */ | 332 | */ |
| 338 | struct dccp_options { | 333 | struct dccp_options { |
| 339 | __u64 dccpo_sequence_window; | 334 | __u64 dccpo_sequence_window; |
| 340 | __u8 dccpo_ccid; | 335 | __u8 dccpo_rx_ccid; |
| 336 | __u8 dccpo_tx_ccid; | ||
| 341 | __u8 dccpo_send_ack_vector; | 337 | __u8 dccpo_send_ack_vector; |
| 342 | __u8 dccpo_send_ndp_count; | 338 | __u8 dccpo_send_ndp_count; |
| 343 | }; | 339 | }; |
| @@ -360,14 +356,8 @@ static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) | |||
| 360 | 356 | ||
| 361 | extern struct inet_timewait_death_row dccp_death_row; | 357 | extern struct inet_timewait_death_row dccp_death_row; |
| 362 | 358 | ||
| 363 | /* Read about the ECN nonce to see why it is 253 */ | ||
| 364 | #define DCCP_MAX_ACK_VECTOR_LEN 253 | ||
| 365 | |||
| 366 | struct dccp_options_received { | 359 | struct dccp_options_received { |
| 367 | u32 dccpor_ndp:24, | 360 | u32 dccpor_ndp; /* only 24 bits */ |
| 368 | dccpor_ack_vector_len:8; | ||
| 369 | u32 dccpor_ack_vector_idx:10; | ||
| 370 | /* 22 bits hole, try to pack */ | ||
| 371 | u32 dccpor_timestamp; | 361 | u32 dccpor_timestamp; |
| 372 | u32 dccpor_timestamp_echo; | 362 | u32 dccpor_timestamp_echo; |
| 373 | u32 dccpor_elapsed_time; | 363 | u32 dccpor_elapsed_time; |
| @@ -382,6 +372,27 @@ enum dccp_role { | |||
| 382 | DCCP_ROLE_SERVER, | 372 | DCCP_ROLE_SERVER, |
| 383 | }; | 373 | }; |
| 384 | 374 | ||
| 375 | struct dccp_service_list { | ||
| 376 | __u32 dccpsl_nr; | ||
| 377 | __u32 dccpsl_list[0]; | ||
| 378 | }; | ||
| 379 | |||
| 380 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) | ||
| 381 | |||
| 382 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, | ||
| 383 | const u32 service) | ||
| 384 | { | ||
| 385 | if (likely(sl != NULL)) { | ||
| 386 | u32 i = sl->dccpsl_nr; | ||
| 387 | while (i--) | ||
| 388 | if (sl->dccpsl_list[i] == service) | ||
| 389 | return 1; | ||
| 390 | } | ||
| 391 | return 0; | ||
| 392 | } | ||
| 393 | |||
| 394 | struct dccp_ackvec; | ||
| 395 | |||
| 385 | /** | 396 | /** |
| 386 | * struct dccp_sock - DCCP socket state | 397 | * struct dccp_sock - DCCP socket state |
| 387 | * | 398 | * |
| @@ -402,7 +413,7 @@ enum dccp_role { | |||
| 402 | * @dccps_packet_size - Set thru setsockopt | 413 | * @dccps_packet_size - Set thru setsockopt |
| 403 | * @dccps_role - Role of this sock, one of %dccp_role | 414 | * @dccps_role - Role of this sock, one of %dccp_role |
| 404 | * @dccps_ndp_count - number of Non Data Packets since last data packet | 415 | * @dccps_ndp_count - number of Non Data Packets since last data packet |
| 405 | * @dccps_hc_rx_ackpkts - receiver half connection acked packets | 416 | * @dccps_hc_rx_ackvec - rx half connection ack vector |
| 406 | */ | 417 | */ |
| 407 | struct dccp_sock { | 418 | struct dccp_sock { |
| 408 | /* inet_connection_sock has to be the first member of dccp_sock */ | 419 | /* inet_connection_sock has to be the first member of dccp_sock */ |
| @@ -417,7 +428,8 @@ struct dccp_sock { | |||
| 417 | __u64 dccps_gss; | 428 | __u64 dccps_gss; |
| 418 | __u64 dccps_gsr; | 429 | __u64 dccps_gsr; |
| 419 | __u64 dccps_gar; | 430 | __u64 dccps_gar; |
| 420 | unsigned long dccps_service; | 431 | __u32 dccps_service; |
| 432 | struct dccp_service_list *dccps_service_list; | ||
| 421 | struct timeval dccps_timestamp_time; | 433 | struct timeval dccps_timestamp_time; |
| 422 | __u32 dccps_timestamp_echo; | 434 | __u32 dccps_timestamp_echo; |
| 423 | __u32 dccps_packet_size; | 435 | __u32 dccps_packet_size; |
| @@ -426,7 +438,7 @@ struct dccp_sock { | |||
| 426 | __u32 dccps_pmtu_cookie; | 438 | __u32 dccps_pmtu_cookie; |
| 427 | __u32 dccps_mss_cache; | 439 | __u32 dccps_mss_cache; |
| 428 | struct dccp_options dccps_options; | 440 | struct dccp_options dccps_options; |
| 429 | struct dccp_ackpkts *dccps_hc_rx_ackpkts; | 441 | struct dccp_ackvec *dccps_hc_rx_ackvec; |
| 430 | void *dccps_hc_rx_ccid_private; | 442 | void *dccps_hc_rx_ccid_private; |
| 431 | void *dccps_hc_tx_ccid_private; | 443 | void *dccps_hc_tx_ccid_private; |
| 432 | struct ccid *dccps_hc_rx_ccid; | 444 | struct ccid *dccps_hc_rx_ccid; |
| @@ -443,6 +455,11 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk) | |||
| 443 | return (struct dccp_sock *)sk; | 455 | return (struct dccp_sock *)sk; |
| 444 | } | 456 | } |
| 445 | 457 | ||
| 458 | static inline int dccp_service_not_initialized(const struct sock *sk) | ||
| 459 | { | ||
| 460 | return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; | ||
| 461 | } | ||
| 462 | |||
| 446 | static inline const char *dccp_role(const struct sock *sk) | 463 | static inline const char *dccp_role(const struct sock *sk) |
| 447 | { | 464 | { |
| 448 | switch (dccp_sk(sk)->dccps_role) { | 465 | switch (dccp_sk(sk)->dccps_role) { |
diff --git a/include/linux/device.h b/include/linux/device.h index 06e5d42f2c7b..95d607a48f06 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -317,6 +317,11 @@ dev_set_drvdata (struct device *dev, void *data) | |||
| 317 | dev->driver_data = data; | 317 | dev->driver_data = data; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | static inline int device_is_registered(struct device *dev) | ||
| 321 | { | ||
| 322 | return klist_node_attached(&dev->knode_bus); | ||
| 323 | } | ||
| 324 | |||
| 320 | /* | 325 | /* |
| 321 | * High level routines for use by the bus drivers | 326 | * High level routines for use by the bus drivers |
| 322 | */ | 327 | */ |
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h index 4932ee5c77f0..76f12f46db7f 100644 --- a/include/linux/dmapool.h +++ b/include/linux/dmapool.h | |||
| @@ -19,7 +19,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, | |||
| 19 | 19 | ||
| 20 | void dma_pool_destroy(struct dma_pool *pool); | 20 | void dma_pool_destroy(struct dma_pool *pool); |
| 21 | 21 | ||
| 22 | void *dma_pool_alloc(struct dma_pool *pool, unsigned int __nocast mem_flags, | 22 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, |
| 23 | dma_addr_t *handle); | 23 | dma_addr_t *handle); |
| 24 | 24 | ||
| 25 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); | 25 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 4dc990f3b5cc..3010e172394d 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -85,9 +85,9 @@ static inline void arch_free_page(struct page *page, int order) { } | |||
| 85 | #endif | 85 | #endif |
| 86 | 86 | ||
| 87 | extern struct page * | 87 | extern struct page * |
| 88 | FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); | 88 | FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *)); |
| 89 | 89 | ||
| 90 | static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_mask, | 90 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
| 91 | unsigned int order) | 91 | unsigned int order) |
| 92 | { | 92 | { |
| 93 | if (unlikely(order >= MAX_ORDER)) | 93 | if (unlikely(order >= MAX_ORDER)) |
| @@ -98,17 +98,17 @@ static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_m | |||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | #ifdef CONFIG_NUMA | 100 | #ifdef CONFIG_NUMA |
| 101 | extern struct page *alloc_pages_current(unsigned int __nocast gfp_mask, unsigned order); | 101 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); |
| 102 | 102 | ||
| 103 | static inline struct page * | 103 | static inline struct page * |
| 104 | alloc_pages(unsigned int __nocast gfp_mask, unsigned int order) | 104 | alloc_pages(gfp_t gfp_mask, unsigned int order) |
| 105 | { | 105 | { |
| 106 | if (unlikely(order >= MAX_ORDER)) | 106 | if (unlikely(order >= MAX_ORDER)) |
| 107 | return NULL; | 107 | return NULL; |
| 108 | 108 | ||
| 109 | return alloc_pages_current(gfp_mask, order); | 109 | return alloc_pages_current(gfp_mask, order); |
| 110 | } | 110 | } |
| 111 | extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, | 111 | extern struct page *alloc_page_vma(gfp_t gfp_mask, |
| 112 | struct vm_area_struct *vma, unsigned long addr); | 112 | struct vm_area_struct *vma, unsigned long addr); |
| 113 | #else | 113 | #else |
| 114 | #define alloc_pages(gfp_mask, order) \ | 114 | #define alloc_pages(gfp_mask, order) \ |
| @@ -117,8 +117,8 @@ extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, | |||
| 117 | #endif | 117 | #endif |
| 118 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) | 118 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) |
| 119 | 119 | ||
| 120 | extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order)); | 120 | extern unsigned long FASTCALL(__get_free_pages(gfp_t gfp_mask, unsigned int order)); |
| 121 | extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask)); | 121 | extern unsigned long FASTCALL(get_zeroed_page(gfp_t gfp_mask)); |
| 122 | 122 | ||
| 123 | #define __get_free_page(gfp_mask) \ | 123 | #define __get_free_page(gfp_mask) \ |
| 124 | __get_free_pages((gfp_mask),0) | 124 | __get_free_pages((gfp_mask),0) |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e670b0d13fe0..d664330d900e 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -25,6 +25,8 @@ int is_hugepage_mem_enough(size_t); | |||
| 25 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
| 26 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
| 27 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
| 28 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | ||
| 29 | unsigned long address, int write_access); | ||
| 28 | 30 | ||
| 29 | extern unsigned long max_huge_pages; | 31 | extern unsigned long max_huge_pages; |
| 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 32 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
| @@ -99,6 +101,7 @@ static inline unsigned long hugetlb_total_pages(void) | |||
| 99 | do { } while (0) | 101 | do { } while (0) |
| 100 | #define alloc_huge_page() ({ NULL; }) | 102 | #define alloc_huge_page() ({ NULL; }) |
| 101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | 103 | #define free_huge_page(p) ({ (void)(p); BUG(); }) |
| 104 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | ||
| 102 | 105 | ||
| 103 | #ifndef HPAGE_MASK | 106 | #ifndef HPAGE_MASK |
| 104 | #define HPAGE_MASK 0 /* Keep the compiler happy */ | 107 | #define HPAGE_MASK 0 /* Keep the compiler happy */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index be35332b67e6..3d49a305bf88 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -230,11 +230,6 @@ struct i2c_adapter { | |||
| 230 | struct device dev; /* the adapter device */ | 230 | struct device dev; /* the adapter device */ |
| 231 | struct class_device class_dev; /* the class device */ | 231 | struct class_device class_dev; /* the class device */ |
| 232 | 232 | ||
| 233 | #ifdef CONFIG_PROC_FS | ||
| 234 | /* No need to set this when you initialize the adapter */ | ||
| 235 | int inode; | ||
| 236 | #endif /* def CONFIG_PROC_FS */ | ||
| 237 | |||
| 238 | int nr; | 233 | int nr; |
| 239 | struct list_head clients; | 234 | struct list_head clients; |
| 240 | struct list_head list; | 235 | struct list_head list; |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index fc2d4c8225aa..d21c305c6c64 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -111,7 +111,9 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
| 111 | return (struct ethhdr *)skb->mac.raw; | 111 | return (struct ethhdr *)skb->mac.raw; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | #ifdef CONFIG_SYSCTL | ||
| 114 | extern struct ctl_table ether_table[]; | 115 | extern struct ctl_table ether_table[]; |
| 115 | #endif | 116 | #endif |
| 117 | #endif | ||
| 116 | 118 | ||
| 117 | #endif /* _LINUX_IF_ETHER_H */ | 119 | #endif /* _LINUX_IF_ETHER_H */ |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 17d0c0d40b0e..eef0876d8307 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -42,8 +42,8 @@ struct hlist_node; | |||
| 42 | struct vlan_ethhdr { | 42 | struct vlan_ethhdr { |
| 43 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ | 43 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ |
| 44 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ | 44 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ |
| 45 | unsigned short h_vlan_proto; /* Should always be 0x8100 */ | 45 | __be16 h_vlan_proto; /* Should always be 0x8100 */ |
| 46 | unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */ | 46 | __be16 h_vlan_TCI; /* Encapsulates priority and VLAN ID */ |
| 47 | unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ | 47 | unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| @@ -55,8 +55,8 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | struct vlan_hdr { | 57 | struct vlan_hdr { |
| 58 | unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */ | 58 | __be16 h_vlan_TCI; /* Encapsulates priority and VLAN ID */ |
| 59 | unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ | 59 | __be16 h_vlan_encapsulated_proto; /* packet type ID field (or len) */ |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | #define VLAN_VID_MASK 0xfff | 62 | #define VLAN_VID_MASK 0xfff |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 7e1e15f934f3..fd7af86151b1 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -142,13 +142,21 @@ static __inline__ int bad_mask(u32 mask, u32 addr) | |||
| 142 | 142 | ||
| 143 | #define endfor_ifa(in_dev) } | 143 | #define endfor_ifa(in_dev) } |
| 144 | 144 | ||
| 145 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) | ||
| 146 | { | ||
| 147 | struct in_device *in_dev = dev->ip_ptr; | ||
| 148 | if (in_dev) | ||
| 149 | in_dev = rcu_dereference(in_dev); | ||
| 150 | return in_dev; | ||
| 151 | } | ||
| 152 | |||
| 145 | static __inline__ struct in_device * | 153 | static __inline__ struct in_device * |
| 146 | in_dev_get(const struct net_device *dev) | 154 | in_dev_get(const struct net_device *dev) |
| 147 | { | 155 | { |
| 148 | struct in_device *in_dev; | 156 | struct in_device *in_dev; |
| 149 | 157 | ||
| 150 | rcu_read_lock(); | 158 | rcu_read_lock(); |
| 151 | in_dev = dev->ip_ptr; | 159 | in_dev = __in_dev_get_rcu(dev); |
| 152 | if (in_dev) | 160 | if (in_dev) |
| 153 | atomic_inc(&in_dev->refcnt); | 161 | atomic_inc(&in_dev->refcnt); |
| 154 | rcu_read_unlock(); | 162 | rcu_read_unlock(); |
| @@ -156,7 +164,7 @@ in_dev_get(const struct net_device *dev) | |||
| 156 | } | 164 | } |
| 157 | 165 | ||
| 158 | static __inline__ struct in_device * | 166 | static __inline__ struct in_device * |
| 159 | __in_dev_get(const struct net_device *dev) | 167 | __in_dev_get_rtnl(const struct net_device *dev) |
| 160 | { | 168 | { |
| 161 | return (struct in_device*)dev->ip_ptr; | 169 | return (struct in_device*)dev->ip_ptr; |
| 162 | } | 170 | } |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index bb6f88e14061..e0b922785d98 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -372,8 +372,9 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
| 372 | #define inet_v6_ipv6only(__sk) 0 | 372 | #define inet_v6_ipv6only(__sk) 0 |
| 373 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 373 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
| 374 | 374 | ||
| 375 | #define INET6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \ | 375 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ |
| 376 | (((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 376 | (((__sk)->sk_hash == (__hash)) && \ |
| 377 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | ||
| 377 | ((__sk)->sk_family == AF_INET6) && \ | 378 | ((__sk)->sk_family == AF_INET6) && \ |
| 378 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 379 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
| 379 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | 380 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index de097269bd7f..ff853b3173c6 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -935,7 +935,7 @@ void journal_put_journal_head(struct journal_head *jh); | |||
| 935 | */ | 935 | */ |
| 936 | extern kmem_cache_t *jbd_handle_cache; | 936 | extern kmem_cache_t *jbd_handle_cache; |
| 937 | 937 | ||
| 938 | static inline handle_t *jbd_alloc_handle(unsigned int __nocast gfp_flags) | 938 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) |
| 939 | { | 939 | { |
| 940 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); | 940 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); |
| 941 | } | 941 | } |
diff --git a/include/linux/joystick.h b/include/linux/joystick.h index 06b9af77eb7f..5fd20ddd7ae3 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h | |||
| @@ -111,29 +111,30 @@ struct js_corr { | |||
| 111 | #define JS_SET_ALL 8 | 111 | #define JS_SET_ALL 8 |
| 112 | 112 | ||
| 113 | struct JS_DATA_TYPE { | 113 | struct JS_DATA_TYPE { |
| 114 | __s32 buttons; | 114 | int32_t buttons; |
| 115 | __s32 x; | 115 | int32_t x; |
| 116 | __s32 y; | 116 | int32_t y; |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | struct JS_DATA_SAVE_TYPE_32 { | 119 | struct JS_DATA_SAVE_TYPE_32 { |
| 120 | __s32 JS_TIMEOUT; | 120 | int32_t JS_TIMEOUT; |
| 121 | __s32 BUSY; | 121 | int32_t BUSY; |
| 122 | __s32 JS_EXPIRETIME; | 122 | int32_t JS_EXPIRETIME; |
| 123 | __s32 JS_TIMELIMIT; | 123 | int32_t JS_TIMELIMIT; |
| 124 | struct JS_DATA_TYPE JS_SAVE; | 124 | struct JS_DATA_TYPE JS_SAVE; |
| 125 | struct JS_DATA_TYPE JS_CORR; | 125 | struct JS_DATA_TYPE JS_CORR; |
| 126 | }; | 126 | }; |
| 127 | 127 | ||
| 128 | struct JS_DATA_SAVE_TYPE_64 { | 128 | struct JS_DATA_SAVE_TYPE_64 { |
| 129 | __s32 JS_TIMEOUT; | 129 | int32_t JS_TIMEOUT; |
| 130 | __s32 BUSY; | 130 | int32_t BUSY; |
| 131 | __s64 JS_EXPIRETIME; | 131 | int64_t JS_EXPIRETIME; |
| 132 | __s64 JS_TIMELIMIT; | 132 | int64_t JS_TIMELIMIT; |
| 133 | struct JS_DATA_TYPE JS_SAVE; | 133 | struct JS_DATA_TYPE JS_SAVE; |
| 134 | struct JS_DATA_TYPE JS_CORR; | 134 | struct JS_DATA_TYPE JS_CORR; |
| 135 | }; | 135 | }; |
| 136 | 136 | ||
| 137 | #ifdef __KERNEL__ | ||
| 137 | #if BITS_PER_LONG == 64 | 138 | #if BITS_PER_LONG == 64 |
| 138 | #define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64 | 139 | #define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64 |
| 139 | #elif BITS_PER_LONG == 32 | 140 | #elif BITS_PER_LONG == 32 |
| @@ -141,5 +142,6 @@ struct JS_DATA_SAVE_TYPE_64 { | |||
| 141 | #else | 142 | #else |
| 142 | #error Unexpected BITS_PER_LONG | 143 | #error Unexpected BITS_PER_LONG |
| 143 | #endif | 144 | #endif |
| 145 | #endif | ||
| 144 | 146 | ||
| 145 | #endif /* _LINUX_JOYSTICK_H */ | 147 | #endif /* _LINUX_JOYSTICK_H */ |
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h index cc326174a808..7a2e332067c3 100644 --- a/include/linux/key-ui.h +++ b/include/linux/key-ui.h | |||
| @@ -38,92 +38,21 @@ struct keyring_list { | |||
| 38 | struct key *keys[0]; | 38 | struct key *keys[0]; |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | |||
| 42 | /* | 41 | /* |
| 43 | * check to see whether permission is granted to use a key in the desired way | 42 | * check to see whether permission is granted to use a key in the desired way |
| 44 | */ | 43 | */ |
| 45 | static inline int key_permission(const struct key *key, key_perm_t perm) | 44 | extern int key_task_permission(const key_ref_t key_ref, |
| 46 | { | 45 | struct task_struct *context, |
| 47 | key_perm_t kperm; | 46 | key_perm_t perm); |
| 48 | |||
| 49 | if (key->uid == current->fsuid) | ||
| 50 | kperm = key->perm >> 16; | ||
| 51 | else if (key->gid != -1 && | ||
| 52 | key->perm & KEY_GRP_ALL && | ||
| 53 | in_group_p(key->gid) | ||
| 54 | ) | ||
| 55 | kperm = key->perm >> 8; | ||
| 56 | else | ||
| 57 | kperm = key->perm; | ||
| 58 | |||
| 59 | kperm = kperm & perm & KEY_ALL; | ||
| 60 | |||
| 61 | return kperm == perm; | ||
| 62 | } | ||
| 63 | |||
| 64 | /* | ||
| 65 | * check to see whether permission is granted to use a key in at least one of | ||
| 66 | * the desired ways | ||
| 67 | */ | ||
| 68 | static inline int key_any_permission(const struct key *key, key_perm_t perm) | ||
| 69 | { | ||
| 70 | key_perm_t kperm; | ||
| 71 | |||
| 72 | if (key->uid == current->fsuid) | ||
| 73 | kperm = key->perm >> 16; | ||
| 74 | else if (key->gid != -1 && | ||
| 75 | key->perm & KEY_GRP_ALL && | ||
| 76 | in_group_p(key->gid) | ||
| 77 | ) | ||
| 78 | kperm = key->perm >> 8; | ||
| 79 | else | ||
| 80 | kperm = key->perm; | ||
| 81 | 47 | ||
| 82 | kperm = kperm & perm & KEY_ALL; | 48 | static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) |
| 83 | |||
| 84 | return kperm != 0; | ||
| 85 | } | ||
| 86 | |||
| 87 | static inline int key_task_groups_search(struct task_struct *tsk, gid_t gid) | ||
| 88 | { | 49 | { |
| 89 | int ret; | 50 | return key_task_permission(key_ref, current, perm); |
| 90 | |||
| 91 | task_lock(tsk); | ||
| 92 | ret = groups_search(tsk->group_info, gid); | ||
| 93 | task_unlock(tsk); | ||
| 94 | return ret; | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline int key_task_permission(const struct key *key, | ||
| 98 | struct task_struct *context, | ||
| 99 | key_perm_t perm) | ||
| 100 | { | ||
| 101 | key_perm_t kperm; | ||
| 102 | |||
| 103 | if (key->uid == context->fsuid) { | ||
| 104 | kperm = key->perm >> 16; | ||
| 105 | } | ||
| 106 | else if (key->gid != -1 && | ||
| 107 | key->perm & KEY_GRP_ALL && ( | ||
| 108 | key->gid == context->fsgid || | ||
| 109 | key_task_groups_search(context, key->gid) | ||
| 110 | ) | ||
| 111 | ) { | ||
| 112 | kperm = key->perm >> 8; | ||
| 113 | } | ||
| 114 | else { | ||
| 115 | kperm = key->perm; | ||
| 116 | } | ||
| 117 | |||
| 118 | kperm = kperm & perm & KEY_ALL; | ||
| 119 | |||
| 120 | return kperm == perm; | ||
| 121 | |||
| 122 | } | 51 | } |
| 123 | 52 | ||
| 124 | extern struct key *lookup_user_key(struct task_struct *context, | 53 | extern key_ref_t lookup_user_key(struct task_struct *context, |
| 125 | key_serial_t id, int create, int partial, | 54 | key_serial_t id, int create, int partial, |
| 126 | key_perm_t perm); | 55 | key_perm_t perm); |
| 127 | 56 | ||
| 128 | extern long join_session_keyring(const char *name); | 57 | extern long join_session_keyring(const char *name); |
| 129 | 58 | ||
diff --git a/include/linux/key.h b/include/linux/key.h index 970bbd916cf4..f1efa016dbf3 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -35,11 +35,18 @@ struct key; | |||
| 35 | 35 | ||
| 36 | #undef KEY_DEBUGGING | 36 | #undef KEY_DEBUGGING |
| 37 | 37 | ||
| 38 | #define KEY_USR_VIEW 0x00010000 /* user can view a key's attributes */ | 38 | #define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */ |
| 39 | #define KEY_USR_READ 0x00020000 /* user can read key payload / view keyring */ | 39 | #define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */ |
| 40 | #define KEY_USR_WRITE 0x00040000 /* user can update key payload / add link to keyring */ | 40 | #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ |
| 41 | #define KEY_USR_SEARCH 0x00080000 /* user can find a key in search / search a keyring */ | 41 | #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ |
| 42 | #define KEY_USR_LINK 0x00100000 /* user can create a link to a key/keyring */ | 42 | #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ |
| 43 | #define KEY_POS_ALL 0x1f000000 | ||
| 44 | |||
| 45 | #define KEY_USR_VIEW 0x00010000 /* user permissions... */ | ||
| 46 | #define KEY_USR_READ 0x00020000 | ||
| 47 | #define KEY_USR_WRITE 0x00040000 | ||
| 48 | #define KEY_USR_SEARCH 0x00080000 | ||
| 49 | #define KEY_USR_LINK 0x00100000 | ||
| 43 | #define KEY_USR_ALL 0x001f0000 | 50 | #define KEY_USR_ALL 0x001f0000 |
| 44 | 51 | ||
| 45 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ | 52 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ |
| @@ -67,6 +74,38 @@ struct keyring_name; | |||
| 67 | 74 | ||
| 68 | /*****************************************************************************/ | 75 | /*****************************************************************************/ |
| 69 | /* | 76 | /* |
| 77 | * key reference with possession attribute handling | ||
| 78 | * | ||
| 79 | * NOTE! key_ref_t is a typedef'd pointer to a type that is not actually | ||
| 80 | * defined. This is because we abuse the bottom bit of the reference to carry a | ||
| 81 | * flag to indicate whether the calling process possesses that key in one of | ||
| 82 | * its keyrings. | ||
| 83 | * | ||
| 84 | * the key_ref_t has been made a separate type so that the compiler can reject | ||
| 85 | * attempts to dereference it without proper conversion. | ||
| 86 | * | ||
| 87 | * the three functions are used to assemble and disassemble references | ||
| 88 | */ | ||
| 89 | typedef struct __key_reference_with_attributes *key_ref_t; | ||
| 90 | |||
| 91 | static inline key_ref_t make_key_ref(const struct key *key, | ||
| 92 | unsigned long possession) | ||
| 93 | { | ||
| 94 | return (key_ref_t) ((unsigned long) key | possession); | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) | ||
| 98 | { | ||
| 99 | return (struct key *) ((unsigned long) key_ref & ~1UL); | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline unsigned long is_key_possessed(const key_ref_t key_ref) | ||
| 103 | { | ||
| 104 | return (unsigned long) key_ref & 1UL; | ||
| 105 | } | ||
| 106 | |||
| 107 | /*****************************************************************************/ | ||
| 108 | /* | ||
| 70 | * authentication token / access credential / keyring | 109 | * authentication token / access credential / keyring |
| 71 | * - types of key include: | 110 | * - types of key include: |
| 72 | * - keyrings | 111 | * - keyrings |
| @@ -215,20 +254,25 @@ static inline struct key *key_get(struct key *key) | |||
| 215 | return key; | 254 | return key; |
| 216 | } | 255 | } |
| 217 | 256 | ||
| 257 | static inline void key_ref_put(key_ref_t key_ref) | ||
| 258 | { | ||
| 259 | key_put(key_ref_to_ptr(key_ref)); | ||
| 260 | } | ||
| 261 | |||
| 218 | extern struct key *request_key(struct key_type *type, | 262 | extern struct key *request_key(struct key_type *type, |
| 219 | const char *description, | 263 | const char *description, |
| 220 | const char *callout_info); | 264 | const char *callout_info); |
| 221 | 265 | ||
| 222 | extern int key_validate(struct key *key); | 266 | extern int key_validate(struct key *key); |
| 223 | 267 | ||
| 224 | extern struct key *key_create_or_update(struct key *keyring, | 268 | extern key_ref_t key_create_or_update(key_ref_t keyring, |
| 225 | const char *type, | 269 | const char *type, |
| 226 | const char *description, | 270 | const char *description, |
| 227 | const void *payload, | 271 | const void *payload, |
| 228 | size_t plen, | 272 | size_t plen, |
| 229 | int not_in_quota); | 273 | int not_in_quota); |
| 230 | 274 | ||
| 231 | extern int key_update(struct key *key, | 275 | extern int key_update(key_ref_t key, |
| 232 | const void *payload, | 276 | const void *payload, |
| 233 | size_t plen); | 277 | size_t plen); |
| 234 | 278 | ||
| @@ -243,9 +287,9 @@ extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | |||
| 243 | 287 | ||
| 244 | extern int keyring_clear(struct key *keyring); | 288 | extern int keyring_clear(struct key *keyring); |
| 245 | 289 | ||
| 246 | extern struct key *keyring_search(struct key *keyring, | 290 | extern key_ref_t keyring_search(key_ref_t keyring, |
| 247 | struct key_type *type, | 291 | struct key_type *type, |
| 248 | const char *description); | 292 | const char *description); |
| 249 | 293 | ||
| 250 | extern int keyring_add_key(struct key *keyring, | 294 | extern int keyring_add_key(struct key *keyring, |
| 251 | struct key *key); | 295 | struct key *key); |
| @@ -285,6 +329,10 @@ extern void key_init(void); | |||
| 285 | #define key_serial(k) 0 | 329 | #define key_serial(k) 0 |
| 286 | #define key_get(k) ({ NULL; }) | 330 | #define key_get(k) ({ NULL; }) |
| 287 | #define key_put(k) do { } while(0) | 331 | #define key_put(k) do { } while(0) |
| 332 | #define key_ref_put(k) do { } while(0) | ||
| 333 | #define make_key_ref(k) ({ NULL; }) | ||
| 334 | #define key_ref_to_ptr(k) ({ NULL; }) | ||
| 335 | #define is_key_possessed(k) 0 | ||
| 288 | #define alloc_uid_keyring(u) 0 | 336 | #define alloc_uid_keyring(u) 0 |
| 289 | #define switch_uid_keyring(u) do { } while(0) | 337 | #define switch_uid_keyring(u) do { } while(0) |
| 290 | #define __install_session_keyring(t, k) ({ NULL; }) | 338 | #define __install_session_keyring(t, k) ({ NULL; }) |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index c27cd428d269..48eccd865bd8 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
| @@ -35,8 +35,8 @@ struct kfifo { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, | 37 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, |
| 38 | unsigned int __nocast gfp_mask, spinlock_t *lock); | 38 | gfp_t gfp_mask, spinlock_t *lock); |
| 39 | extern struct kfifo *kfifo_alloc(unsigned int size, unsigned int __nocast gfp_mask, | 39 | extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, |
| 40 | spinlock_t *lock); | 40 | spinlock_t *lock); |
| 41 | extern void kfifo_free(struct kfifo *fifo); | 41 | extern void kfifo_free(struct kfifo *fifo); |
| 42 | extern unsigned int __kfifo_put(struct kfifo *fifo, | 42 | extern unsigned int __kfifo_put(struct kfifo *fifo, |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 022105c745fc..ceee1fc42c60 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -393,6 +393,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i | |||
| 393 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 393 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
| 394 | #endif /* CONFIG_PCI */ | 394 | #endif /* CONFIG_PCI */ |
| 395 | extern int ata_device_add(struct ata_probe_ent *ent); | 395 | extern int ata_device_add(struct ata_probe_ent *ent); |
| 396 | extern void ata_host_set_remove(struct ata_host_set *host_set); | ||
| 396 | extern int ata_scsi_detect(Scsi_Host_Template *sht); | 397 | extern int ata_scsi_detect(Scsi_Host_Template *sht); |
| 397 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 398 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
| 398 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 399 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
diff --git a/include/linux/list.h b/include/linux/list.h index e6ec59682274..084971f333fe 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -442,12 +442,14 @@ static inline void list_splice_init(struct list_head *list, | |||
| 442 | * as long as the traversal is guarded by rcu_read_lock(). | 442 | * as long as the traversal is guarded by rcu_read_lock(). |
| 443 | */ | 443 | */ |
| 444 | #define list_for_each_rcu(pos, head) \ | 444 | #define list_for_each_rcu(pos, head) \ |
| 445 | for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | 445 | for (pos = (head)->next; \ |
| 446 | pos = rcu_dereference(pos->next)) | 446 | prefetch(rcu_dereference(pos)->next), pos != (head); \ |
| 447 | pos = pos->next) | ||
| 447 | 448 | ||
| 448 | #define __list_for_each_rcu(pos, head) \ | 449 | #define __list_for_each_rcu(pos, head) \ |
| 449 | for (pos = (head)->next; pos != (head); \ | 450 | for (pos = (head)->next; \ |
| 450 | pos = rcu_dereference(pos->next)) | 451 | rcu_dereference(pos) != (head); \ |
| 452 | pos = pos->next) | ||
| 451 | 453 | ||
| 452 | /** | 454 | /** |
| 453 | * list_for_each_safe_rcu - iterate over an rcu-protected list safe | 455 | * list_for_each_safe_rcu - iterate over an rcu-protected list safe |
| @@ -461,8 +463,9 @@ static inline void list_splice_init(struct list_head *list, | |||
| 461 | * as long as the traversal is guarded by rcu_read_lock(). | 463 | * as long as the traversal is guarded by rcu_read_lock(). |
| 462 | */ | 464 | */ |
| 463 | #define list_for_each_safe_rcu(pos, n, head) \ | 465 | #define list_for_each_safe_rcu(pos, n, head) \ |
| 464 | for (pos = (head)->next, n = pos->next; pos != (head); \ | 466 | for (pos = (head)->next; \ |
| 465 | pos = rcu_dereference(n), n = pos->next) | 467 | n = rcu_dereference(pos)->next, pos != (head); \ |
| 468 | pos = n) | ||
| 466 | 469 | ||
| 467 | /** | 470 | /** |
| 468 | * list_for_each_entry_rcu - iterate over rcu list of given type | 471 | * list_for_each_entry_rcu - iterate over rcu list of given type |
| @@ -474,11 +477,11 @@ static inline void list_splice_init(struct list_head *list, | |||
| 474 | * the _rcu list-mutation primitives such as list_add_rcu() | 477 | * the _rcu list-mutation primitives such as list_add_rcu() |
| 475 | * as long as the traversal is guarded by rcu_read_lock(). | 478 | * as long as the traversal is guarded by rcu_read_lock(). |
| 476 | */ | 479 | */ |
| 477 | #define list_for_each_entry_rcu(pos, head, member) \ | 480 | #define list_for_each_entry_rcu(pos, head, member) \ |
| 478 | for (pos = list_entry((head)->next, typeof(*pos), member); \ | 481 | for (pos = list_entry((head)->next, typeof(*pos), member); \ |
| 479 | prefetch(pos->member.next), &pos->member != (head); \ | 482 | prefetch(rcu_dereference(pos)->member.next), \ |
| 480 | pos = rcu_dereference(list_entry(pos->member.next, \ | 483 | &pos->member != (head); \ |
| 481 | typeof(*pos), member))) | 484 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
| 482 | 485 | ||
| 483 | 486 | ||
| 484 | /** | 487 | /** |
| @@ -492,8 +495,9 @@ static inline void list_splice_init(struct list_head *list, | |||
| 492 | * as long as the traversal is guarded by rcu_read_lock(). | 495 | * as long as the traversal is guarded by rcu_read_lock(). |
| 493 | */ | 496 | */ |
| 494 | #define list_for_each_continue_rcu(pos, head) \ | 497 | #define list_for_each_continue_rcu(pos, head) \ |
| 495 | for ((pos) = (pos)->next; prefetch((pos)->next), (pos) != (head); \ | 498 | for ((pos) = (pos)->next; \ |
| 496 | (pos) = rcu_dereference((pos)->next)) | 499 | prefetch(rcu_dereference((pos))->next), (pos) != (head); \ |
| 500 | (pos) = (pos)->next) | ||
| 497 | 501 | ||
| 498 | /* | 502 | /* |
| 499 | * Double linked lists with a single pointer list head. | 503 | * Double linked lists with a single pointer list head. |
| @@ -696,8 +700,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 696 | pos = n) | 700 | pos = n) |
| 697 | 701 | ||
| 698 | #define hlist_for_each_rcu(pos, head) \ | 702 | #define hlist_for_each_rcu(pos, head) \ |
| 699 | for ((pos) = (head)->first; pos && ({ prefetch((pos)->next); 1; }); \ | 703 | for ((pos) = (head)->first; \ |
| 700 | (pos) = rcu_dereference((pos)->next)) | 704 | rcu_dereference((pos)) && ({ prefetch((pos)->next); 1; }); \ |
| 705 | (pos) = (pos)->next) | ||
| 701 | 706 | ||
| 702 | /** | 707 | /** |
| 703 | * hlist_for_each_entry - iterate over list of given type | 708 | * hlist_for_each_entry - iterate over list of given type |
| @@ -762,9 +767,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 762 | */ | 767 | */ |
| 763 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 768 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ |
| 764 | for (pos = (head)->first; \ | 769 | for (pos = (head)->first; \ |
| 765 | pos && ({ prefetch(pos->next); 1;}) && \ | 770 | rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \ |
| 766 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 771 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ |
| 767 | pos = rcu_dereference(pos->next)) | 772 | pos = pos->next) |
| 768 | 773 | ||
| 769 | #else | 774 | #else |
| 770 | #warning "don't include kernel headers in userspace" | 775 | #warning "don't include kernel headers in userspace" |
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 796220ce47cc..f2427d7394b0 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
| 8 | 8 | ||
| 9 | typedef void * (mempool_alloc_t)(unsigned int __nocast gfp_mask, void *pool_data); | 9 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); |
| 10 | typedef void (mempool_free_t)(void *element, void *pool_data); | 10 | typedef void (mempool_free_t)(void *element, void *pool_data); |
| 11 | 11 | ||
| 12 | typedef struct mempool_s { | 12 | typedef struct mempool_s { |
| @@ -26,17 +26,16 @@ extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | |||
| 26 | extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, | 26 | extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, |
| 27 | mempool_free_t *free_fn, void *pool_data, int nid); | 27 | mempool_free_t *free_fn, void *pool_data, int nid); |
| 28 | 28 | ||
| 29 | extern int mempool_resize(mempool_t *pool, int new_min_nr, | 29 | extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask); |
| 30 | unsigned int __nocast gfp_mask); | ||
| 31 | extern void mempool_destroy(mempool_t *pool); | 30 | extern void mempool_destroy(mempool_t *pool); |
| 32 | extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask); | 31 | extern void * mempool_alloc(mempool_t *pool, gfp_t gfp_mask); |
| 33 | extern void mempool_free(void *element, mempool_t *pool); | 32 | extern void mempool_free(void *element, mempool_t *pool); |
| 34 | 33 | ||
| 35 | /* | 34 | /* |
| 36 | * A mempool_alloc_t and mempool_free_t that get the memory from | 35 | * A mempool_alloc_t and mempool_free_t that get the memory from |
| 37 | * a slab that is passed in through pool_data. | 36 | * a slab that is passed in through pool_data. |
| 38 | */ | 37 | */ |
| 39 | void *mempool_alloc_slab(unsigned int __nocast gfp_mask, void *pool_data); | 38 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); |
| 40 | void mempool_free_slab(void *element, void *pool_data); | 39 | void mempool_free_slab(void *element, void *pool_data); |
| 41 | 40 | ||
| 42 | #endif /* _LINUX_MEMPOOL_H */ | 41 | #endif /* _LINUX_MEMPOOL_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 82d7024f0765..097b3a3c693d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -136,6 +136,7 @@ extern unsigned int kobjsize(const void *objp); | |||
| 136 | #define VM_EXEC 0x00000004 | 136 | #define VM_EXEC 0x00000004 |
| 137 | #define VM_SHARED 0x00000008 | 137 | #define VM_SHARED 0x00000008 |
| 138 | 138 | ||
| 139 | /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */ | ||
| 139 | #define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */ | 140 | #define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */ |
| 140 | #define VM_MAYWRITE 0x00000020 | 141 | #define VM_MAYWRITE 0x00000020 |
| 141 | #define VM_MAYEXEC 0x00000040 | 142 | #define VM_MAYEXEC 0x00000040 |
| @@ -350,7 +351,8 @@ static inline void put_page(struct page *page) | |||
| 350 | * only one copy in memory, at most, normally. | 351 | * only one copy in memory, at most, normally. |
| 351 | * | 352 | * |
| 352 | * For the non-reserved pages, page_count(page) denotes a reference count. | 353 | * For the non-reserved pages, page_count(page) denotes a reference count. |
| 353 | * page_count() == 0 means the page is free. | 354 | * page_count() == 0 means the page is free. page->lru is then used for |
| 355 | * freelist management in the buddy allocator. | ||
| 354 | * page_count() == 1 means the page is used for exactly one purpose | 356 | * page_count() == 1 means the page is used for exactly one purpose |
| 355 | * (e.g. a private data page of one process). | 357 | * (e.g. a private data page of one process). |
| 356 | * | 358 | * |
| @@ -376,10 +378,8 @@ static inline void put_page(struct page *page) | |||
| 376 | * attaches, plus 1 if `private' contains something, plus one for | 378 | * attaches, plus 1 if `private' contains something, plus one for |
| 377 | * the page cache itself. | 379 | * the page cache itself. |
| 378 | * | 380 | * |
| 379 | * All pages belonging to an inode are in these doubly linked lists: | 381 | * Instead of keeping dirty/clean pages in per address-space lists, we instead |
| 380 | * mapping->clean_pages, mapping->dirty_pages and mapping->locked_pages; | 382 | * now tag pages as dirty/under writeback in the radix tree. |
| 381 | * using the page->list list_head. These fields are also used for | ||
| 382 | * freelist managemet (when page_count()==0). | ||
| 383 | * | 383 | * |
| 384 | * There is also a per-mapping radix tree mapping index to the page | 384 | * There is also a per-mapping radix tree mapping index to the page |
| 385 | * in memory if present. The tree is rooted at mapping->root. | 385 | * in memory if present. The tree is rooted at mapping->root. |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 47da39ba3f03..2f0299a448f6 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -183,7 +183,7 @@ struct of_device_id | |||
| 183 | char name[32]; | 183 | char name[32]; |
| 184 | char type[32]; | 184 | char type[32]; |
| 185 | char compatible[128]; | 185 | char compatible[128]; |
| 186 | #if __KERNEL__ | 186 | #ifdef __KERNEL__ |
| 187 | void *data; | 187 | void *data; |
| 188 | #else | 188 | #else |
| 189 | kernel_ulong_t data; | 189 | kernel_ulong_t data; |
| @@ -209,10 +209,11 @@ struct pcmcia_device_id { | |||
| 209 | /* for real multi-function devices */ | 209 | /* for real multi-function devices */ |
| 210 | __u8 function; | 210 | __u8 function; |
| 211 | 211 | ||
| 212 | /* for pseude multi-function devices */ | 212 | /* for pseudo multi-function devices */ |
| 213 | __u8 device_no; | 213 | __u8 device_no; |
| 214 | 214 | ||
| 215 | __u32 prod_id_hash[4]; | 215 | __u32 prod_id_hash[4] |
| 216 | __attribute__((aligned(sizeof(__u32)))); | ||
| 216 | 217 | ||
| 217 | /* not matched against in kernelspace*/ | 218 | /* not matched against in kernelspace*/ |
| 218 | #ifdef __KERNEL__ | 219 | #ifdef __KERNEL__ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7c717907896d..368e4c825ff1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -265,6 +265,8 @@ struct net_device | |||
| 265 | * the interface. | 265 | * the interface. |
| 266 | */ | 266 | */ |
| 267 | char name[IFNAMSIZ]; | 267 | char name[IFNAMSIZ]; |
| 268 | /* device name hash chain */ | ||
| 269 | struct hlist_node name_hlist; | ||
| 268 | 270 | ||
| 269 | /* | 271 | /* |
| 270 | * I/O specific fields | 272 | * I/O specific fields |
| @@ -292,6 +294,21 @@ struct net_device | |||
| 292 | 294 | ||
| 293 | /* ------- Fields preinitialized in Space.c finish here ------- */ | 295 | /* ------- Fields preinitialized in Space.c finish here ------- */ |
| 294 | 296 | ||
| 297 | /* Net device features */ | ||
| 298 | unsigned long features; | ||
| 299 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ | ||
| 300 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ | ||
| 301 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ | ||
| 302 | #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ | ||
| 303 | #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ | ||
| 304 | #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ | ||
| 305 | #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ | ||
| 306 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ | ||
| 307 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ | ||
| 308 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | ||
| 309 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | ||
| 310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | ||
| 311 | |||
| 295 | struct net_device *next_sched; | 312 | struct net_device *next_sched; |
| 296 | 313 | ||
| 297 | /* Interface index. Unique device identifier */ | 314 | /* Interface index. Unique device identifier */ |
| @@ -316,9 +333,6 @@ struct net_device | |||
| 316 | * will (read: may be cleaned up at will). | 333 | * will (read: may be cleaned up at will). |
| 317 | */ | 334 | */ |
| 318 | 335 | ||
| 319 | /* These may be needed for future network-power-down code. */ | ||
| 320 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | ||
| 321 | unsigned long last_rx; /* Time of last Rx */ | ||
| 322 | 336 | ||
| 323 | unsigned short flags; /* interface flags (a la BSD) */ | 337 | unsigned short flags; /* interface flags (a la BSD) */ |
| 324 | unsigned short gflags; | 338 | unsigned short gflags; |
| @@ -328,15 +342,12 @@ struct net_device | |||
| 328 | unsigned mtu; /* interface MTU value */ | 342 | unsigned mtu; /* interface MTU value */ |
| 329 | unsigned short type; /* interface hardware type */ | 343 | unsigned short type; /* interface hardware type */ |
| 330 | unsigned short hard_header_len; /* hardware hdr length */ | 344 | unsigned short hard_header_len; /* hardware hdr length */ |
| 331 | void *priv; /* pointer to private data */ | ||
| 332 | 345 | ||
| 333 | struct net_device *master; /* Pointer to master device of a group, | 346 | struct net_device *master; /* Pointer to master device of a group, |
| 334 | * which this device is member of. | 347 | * which this device is member of. |
| 335 | */ | 348 | */ |
| 336 | 349 | ||
| 337 | /* Interface address info. */ | 350 | /* Interface address info. */ |
| 338 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | ||
| 339 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ | ||
| 340 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 351 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
| 341 | unsigned char addr_len; /* hardware address length */ | 352 | unsigned char addr_len; /* hardware address length */ |
| 342 | unsigned short dev_id; /* for shared network cards */ | 353 | unsigned short dev_id; /* for shared network cards */ |
| @@ -346,8 +357,6 @@ struct net_device | |||
| 346 | int promiscuity; | 357 | int promiscuity; |
| 347 | int allmulti; | 358 | int allmulti; |
| 348 | 359 | ||
| 349 | int watchdog_timeo; | ||
| 350 | struct timer_list watchdog_timer; | ||
| 351 | 360 | ||
| 352 | /* Protocol specific pointers */ | 361 | /* Protocol specific pointers */ |
| 353 | 362 | ||
| @@ -358,32 +367,62 @@ struct net_device | |||
| 358 | void *ec_ptr; /* Econet specific data */ | 367 | void *ec_ptr; /* Econet specific data */ |
| 359 | void *ax25_ptr; /* AX.25 specific data */ | 368 | void *ax25_ptr; /* AX.25 specific data */ |
| 360 | 369 | ||
| 361 | struct list_head poll_list; /* Link to poll list */ | 370 | /* |
| 371 | * Cache line mostly used on receive path (including eth_type_trans()) | ||
| 372 | */ | ||
| 373 | struct list_head poll_list ____cacheline_aligned_in_smp; | ||
| 374 | /* Link to poll list */ | ||
| 375 | |||
| 376 | int (*poll) (struct net_device *dev, int *quota); | ||
| 362 | int quota; | 377 | int quota; |
| 363 | int weight; | 378 | int weight; |
| 379 | unsigned long last_rx; /* Time of last Rx */ | ||
| 380 | /* Interface address info used in eth_type_trans() */ | ||
| 381 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast | ||
| 382 | because most packets are unicast) */ | ||
| 383 | |||
| 384 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | ||
| 364 | 385 | ||
| 386 | /* | ||
| 387 | * Cache line mostly used on queue transmit path (qdisc) | ||
| 388 | */ | ||
| 389 | /* device queue lock */ | ||
| 390 | spinlock_t queue_lock ____cacheline_aligned_in_smp; | ||
| 365 | struct Qdisc *qdisc; | 391 | struct Qdisc *qdisc; |
| 366 | struct Qdisc *qdisc_sleeping; | 392 | struct Qdisc *qdisc_sleeping; |
| 367 | struct Qdisc *qdisc_ingress; | ||
| 368 | struct list_head qdisc_list; | 393 | struct list_head qdisc_list; |
| 369 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 394 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
| 370 | 395 | ||
| 371 | /* ingress path synchronizer */ | 396 | /* ingress path synchronizer */ |
| 372 | spinlock_t ingress_lock; | 397 | spinlock_t ingress_lock; |
| 398 | struct Qdisc *qdisc_ingress; | ||
| 399 | |||
| 400 | /* | ||
| 401 | * One part is mostly used on xmit path (device) | ||
| 402 | */ | ||
| 373 | /* hard_start_xmit synchronizer */ | 403 | /* hard_start_xmit synchronizer */ |
| 374 | spinlock_t xmit_lock; | 404 | spinlock_t xmit_lock ____cacheline_aligned_in_smp; |
| 375 | /* cpu id of processor entered to hard_start_xmit or -1, | 405 | /* cpu id of processor entered to hard_start_xmit or -1, |
| 376 | if nobody entered there. | 406 | if nobody entered there. |
| 377 | */ | 407 | */ |
| 378 | int xmit_lock_owner; | 408 | int xmit_lock_owner; |
| 379 | /* device queue lock */ | 409 | void *priv; /* pointer to private data */ |
| 380 | spinlock_t queue_lock; | 410 | int (*hard_start_xmit) (struct sk_buff *skb, |
| 411 | struct net_device *dev); | ||
| 412 | /* These may be needed for future network-power-down code. */ | ||
| 413 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | ||
| 414 | |||
| 415 | int watchdog_timeo; /* used by dev_watchdog() */ | ||
| 416 | struct timer_list watchdog_timer; | ||
| 417 | |||
| 418 | /* | ||
| 419 | * refcnt is a very hot point, so align it on SMP | ||
| 420 | */ | ||
| 381 | /* Number of references to this device */ | 421 | /* Number of references to this device */ |
| 382 | atomic_t refcnt; | 422 | atomic_t refcnt ____cacheline_aligned_in_smp; |
| 423 | |||
| 383 | /* delayed register/unregister */ | 424 | /* delayed register/unregister */ |
| 384 | struct list_head todo_list; | 425 | struct list_head todo_list; |
| 385 | /* device name hash chain */ | ||
| 386 | struct hlist_node name_hlist; | ||
| 387 | /* device index hash chain */ | 426 | /* device index hash chain */ |
| 388 | struct hlist_node index_hlist; | 427 | struct hlist_node index_hlist; |
| 389 | 428 | ||
| @@ -396,21 +435,6 @@ struct net_device | |||
| 396 | NETREG_RELEASED, /* called free_netdev */ | 435 | NETREG_RELEASED, /* called free_netdev */ |
| 397 | } reg_state; | 436 | } reg_state; |
| 398 | 437 | ||
| 399 | /* Net device features */ | ||
| 400 | unsigned long features; | ||
| 401 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ | ||
| 402 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ | ||
| 403 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ | ||
| 404 | #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ | ||
| 405 | #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ | ||
| 406 | #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ | ||
| 407 | #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ | ||
| 408 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ | ||
| 409 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ | ||
| 410 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | ||
| 411 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | ||
| 412 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | ||
| 413 | |||
| 414 | /* Called after device is detached from network. */ | 438 | /* Called after device is detached from network. */ |
| 415 | void (*uninit)(struct net_device *dev); | 439 | void (*uninit)(struct net_device *dev); |
| 416 | /* Called after last user reference disappears. */ | 440 | /* Called after last user reference disappears. */ |
| @@ -419,10 +443,7 @@ struct net_device | |||
| 419 | /* Pointers to interface service routines. */ | 443 | /* Pointers to interface service routines. */ |
| 420 | int (*open)(struct net_device *dev); | 444 | int (*open)(struct net_device *dev); |
| 421 | int (*stop)(struct net_device *dev); | 445 | int (*stop)(struct net_device *dev); |
| 422 | int (*hard_start_xmit) (struct sk_buff *skb, | ||
| 423 | struct net_device *dev); | ||
| 424 | #define HAVE_NETDEV_POLL | 446 | #define HAVE_NETDEV_POLL |
| 425 | int (*poll) (struct net_device *dev, int *quota); | ||
| 426 | int (*hard_header) (struct sk_buff *skb, | 447 | int (*hard_header) (struct sk_buff *skb, |
| 427 | struct net_device *dev, | 448 | struct net_device *dev, |
| 428 | unsigned short type, | 449 | unsigned short type, |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 1d5b10ae2399..f08e870100f4 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -41,11 +41,15 @@ enum nfnetlink_groups { | |||
| 41 | struct nfattr | 41 | struct nfattr |
| 42 | { | 42 | { |
| 43 | u_int16_t nfa_len; | 43 | u_int16_t nfa_len; |
| 44 | u_int16_t nfa_type; | 44 | u_int16_t nfa_type; /* we use 15 bits for the type, and the highest |
| 45 | * bit to indicate whether the payload is nested */ | ||
| 45 | } __attribute__ ((packed)); | 46 | } __attribute__ ((packed)); |
| 46 | 47 | ||
| 47 | /* FIXME: Shamelessly copy and pasted from rtnetlink.h, it's time | 48 | /* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from |
| 48 | * to put this in a generic file */ | 49 | * rtnetlink.h, it's time to put this in a generic file */ |
| 50 | |||
| 51 | #define NFNL_NFA_NEST 0x8000 | ||
| 52 | #define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff) | ||
| 49 | 53 | ||
| 50 | #define NFA_ALIGNTO 4 | 54 | #define NFA_ALIGNTO 4 |
| 51 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) | 55 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) |
| @@ -59,7 +63,7 @@ struct nfattr | |||
| 59 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) | 63 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) |
| 60 | #define NFA_NEST(skb, type) \ | 64 | #define NFA_NEST(skb, type) \ |
| 61 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ | 65 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ |
| 62 | NFA_PUT(skb, type, 0, NULL); \ | 66 | NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ |
| 63 | __start; }) | 67 | __start; }) |
| 64 | #define NFA_NEST_END(skb, start) \ | 68 | #define NFA_NEST_END(skb, start) \ |
| 65 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ | 69 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 5c55751c78e4..116fcaced909 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
| @@ -70,15 +70,24 @@ enum ctattr_l4proto { | |||
| 70 | 70 | ||
| 71 | enum ctattr_protoinfo { | 71 | enum ctattr_protoinfo { |
| 72 | CTA_PROTOINFO_UNSPEC, | 72 | CTA_PROTOINFO_UNSPEC, |
| 73 | CTA_PROTOINFO_TCP_STATE, | 73 | CTA_PROTOINFO_TCP, |
| 74 | __CTA_PROTOINFO_MAX | 74 | __CTA_PROTOINFO_MAX |
| 75 | }; | 75 | }; |
| 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
| 77 | 77 | ||
| 78 | enum ctattr_protoinfo_tcp { | ||
| 79 | CTA_PROTOINFO_TCP_UNSPEC, | ||
| 80 | CTA_PROTOINFO_TCP_STATE, | ||
| 81 | __CTA_PROTOINFO_TCP_MAX | ||
| 82 | }; | ||
| 83 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | ||
| 84 | |||
| 78 | enum ctattr_counters { | 85 | enum ctattr_counters { |
| 79 | CTA_COUNTERS_UNSPEC, | 86 | CTA_COUNTERS_UNSPEC, |
| 80 | CTA_COUNTERS_PACKETS, | 87 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ |
| 81 | CTA_COUNTERS_BYTES, | 88 | CTA_COUNTERS_BYTES, /* old 64bit counters */ |
| 89 | CTA_COUNTERS32_PACKETS, | ||
| 90 | CTA_COUNTERS32_BYTES, | ||
| 82 | __CTA_COUNTERS_MAX | 91 | __CTA_COUNTERS_MAX |
| 83 | }; | 92 | }; |
| 84 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | 93 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 7e033e9271a8..d078bb91d9e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
| @@ -117,6 +117,10 @@ enum ip_conntrack_events | |||
| 117 | /* NAT info */ | 117 | /* NAT info */ |
| 118 | IPCT_NATINFO_BIT = 10, | 118 | IPCT_NATINFO_BIT = 10, |
| 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), |
| 120 | |||
| 121 | /* Counter highest bit has been set */ | ||
| 122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
| 123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
| 120 | }; | 124 | }; |
| 121 | 125 | ||
| 122 | enum ip_conntrack_expect_events { | 126 | enum ip_conntrack_expect_events { |
| @@ -133,11 +137,13 @@ enum ip_conntrack_expect_events { | |||
| 133 | 137 | ||
| 134 | #include <linux/netfilter_ipv4/ip_conntrack_tcp.h> | 138 | #include <linux/netfilter_ipv4/ip_conntrack_tcp.h> |
| 135 | #include <linux/netfilter_ipv4/ip_conntrack_icmp.h> | 139 | #include <linux/netfilter_ipv4/ip_conntrack_icmp.h> |
| 140 | #include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h> | ||
| 136 | #include <linux/netfilter_ipv4/ip_conntrack_sctp.h> | 141 | #include <linux/netfilter_ipv4/ip_conntrack_sctp.h> |
| 137 | 142 | ||
| 138 | /* per conntrack: protocol private data */ | 143 | /* per conntrack: protocol private data */ |
| 139 | union ip_conntrack_proto { | 144 | union ip_conntrack_proto { |
| 140 | /* insert conntrack proto private data here */ | 145 | /* insert conntrack proto private data here */ |
| 146 | struct ip_ct_gre gre; | ||
| 141 | struct ip_ct_sctp sctp; | 147 | struct ip_ct_sctp sctp; |
| 142 | struct ip_ct_tcp tcp; | 148 | struct ip_ct_tcp tcp; |
| 143 | struct ip_ct_icmp icmp; | 149 | struct ip_ct_icmp icmp; |
| @@ -148,6 +154,7 @@ union ip_conntrack_expect_proto { | |||
| 148 | }; | 154 | }; |
| 149 | 155 | ||
| 150 | /* Add protocol helper include file here */ | 156 | /* Add protocol helper include file here */ |
| 157 | #include <linux/netfilter_ipv4/ip_conntrack_pptp.h> | ||
| 151 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> | 158 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> |
| 152 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> | 159 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> |
| 153 | #include <linux/netfilter_ipv4/ip_conntrack_irc.h> | 160 | #include <linux/netfilter_ipv4/ip_conntrack_irc.h> |
| @@ -155,12 +162,20 @@ union ip_conntrack_expect_proto { | |||
| 155 | /* per conntrack: application helper private data */ | 162 | /* per conntrack: application helper private data */ |
| 156 | union ip_conntrack_help { | 163 | union ip_conntrack_help { |
| 157 | /* insert conntrack helper private data (master) here */ | 164 | /* insert conntrack helper private data (master) here */ |
| 165 | struct ip_ct_pptp_master ct_pptp_info; | ||
| 158 | struct ip_ct_ftp_master ct_ftp_info; | 166 | struct ip_ct_ftp_master ct_ftp_info; |
| 159 | struct ip_ct_irc_master ct_irc_info; | 167 | struct ip_ct_irc_master ct_irc_info; |
| 160 | }; | 168 | }; |
| 161 | 169 | ||
| 162 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 170 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
| 163 | #include <linux/netfilter_ipv4/ip_nat.h> | 171 | #include <linux/netfilter_ipv4/ip_nat.h> |
| 172 | #include <linux/netfilter_ipv4/ip_nat_pptp.h> | ||
| 173 | |||
| 174 | /* per conntrack: nat application helper private data */ | ||
| 175 | union ip_conntrack_nat_help { | ||
| 176 | /* insert nat helper private data here */ | ||
| 177 | struct ip_nat_pptp nat_pptp_info; | ||
| 178 | }; | ||
| 164 | #endif | 179 | #endif |
| 165 | 180 | ||
| 166 | #include <linux/types.h> | 181 | #include <linux/types.h> |
| @@ -181,8 +196,8 @@ do { \ | |||
| 181 | 196 | ||
| 182 | struct ip_conntrack_counter | 197 | struct ip_conntrack_counter |
| 183 | { | 198 | { |
| 184 | u_int64_t packets; | 199 | u_int32_t packets; |
| 185 | u_int64_t bytes; | 200 | u_int32_t bytes; |
| 186 | }; | 201 | }; |
| 187 | 202 | ||
| 188 | struct ip_conntrack_helper; | 203 | struct ip_conntrack_helper; |
| @@ -223,6 +238,7 @@ struct ip_conntrack | |||
| 223 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 238 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
| 224 | struct { | 239 | struct { |
| 225 | struct ip_nat_info info; | 240 | struct ip_nat_info info; |
| 241 | union ip_conntrack_nat_help help; | ||
| 226 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ | 242 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ |
| 227 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) | 243 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) |
| 228 | int masq_index; | 244 | int masq_index; |
| @@ -320,11 +336,28 @@ extern void need_ip_conntrack(void); | |||
| 320 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, | 336 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, |
| 321 | const struct ip_conntrack_tuple *orig); | 337 | const struct ip_conntrack_tuple *orig); |
| 322 | 338 | ||
| 339 | extern void __ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
| 340 | enum ip_conntrack_info ctinfo, | ||
| 341 | const struct sk_buff *skb, | ||
| 342 | unsigned long extra_jiffies, | ||
| 343 | int do_acct); | ||
| 344 | |||
| 345 | /* Refresh conntrack for this many jiffies and do accounting */ | ||
| 346 | static inline void ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
| 347 | enum ip_conntrack_info ctinfo, | ||
| 348 | const struct sk_buff *skb, | ||
| 349 | unsigned long extra_jiffies) | ||
| 350 | { | ||
| 351 | __ip_ct_refresh_acct(ct, ctinfo, skb, extra_jiffies, 1); | ||
| 352 | } | ||
| 353 | |||
| 323 | /* Refresh conntrack for this many jiffies */ | 354 | /* Refresh conntrack for this many jiffies */ |
| 324 | extern void ip_ct_refresh_acct(struct ip_conntrack *ct, | 355 | static inline void ip_ct_refresh(struct ip_conntrack *ct, |
| 325 | enum ip_conntrack_info ctinfo, | 356 | const struct sk_buff *skb, |
| 326 | const struct sk_buff *skb, | 357 | unsigned long extra_jiffies) |
| 327 | unsigned long extra_jiffies); | 358 | { |
| 359 | __ip_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | ||
| 360 | } | ||
| 328 | 361 | ||
| 329 | /* These are for NAT. Icky. */ | 362 | /* These are for NAT. Icky. */ |
| 330 | /* Update TCP window tracking data when NAT mangles the packet */ | 363 | /* Update TCP window tracking data when NAT mangles the packet */ |
| @@ -372,7 +405,7 @@ extern struct ip_conntrack_expect * | |||
| 372 | __ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); | 405 | __ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); |
| 373 | 406 | ||
| 374 | extern struct ip_conntrack_expect * | 407 | extern struct ip_conntrack_expect * |
| 375 | ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple); | 408 | ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); |
| 376 | 409 | ||
| 377 | extern struct ip_conntrack_tuple_hash * | 410 | extern struct ip_conntrack_tuple_hash * |
| 378 | __ip_conntrack_find(const struct ip_conntrack_tuple *tuple, | 411 | __ip_conntrack_find(const struct ip_conntrack_tuple *tuple, |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h new file mode 100644 index 000000000000..816144c75de0 --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h | |||
| @@ -0,0 +1,325 @@ | |||
| 1 | /* PPTP constants and structs */ | ||
| 2 | #ifndef _CONNTRACK_PPTP_H | ||
| 3 | #define _CONNTRACK_PPTP_H | ||
| 4 | |||
| 5 | /* state of the control session */ | ||
| 6 | enum pptp_ctrlsess_state { | ||
| 7 | PPTP_SESSION_NONE, /* no session present */ | ||
| 8 | PPTP_SESSION_ERROR, /* some session error */ | ||
| 9 | PPTP_SESSION_STOPREQ, /* stop_sess request seen */ | ||
| 10 | PPTP_SESSION_REQUESTED, /* start_sess request seen */ | ||
| 11 | PPTP_SESSION_CONFIRMED, /* session established */ | ||
| 12 | }; | ||
| 13 | |||
| 14 | /* state of the call inside the control session */ | ||
| 15 | enum pptp_ctrlcall_state { | ||
| 16 | PPTP_CALL_NONE, | ||
| 17 | PPTP_CALL_ERROR, | ||
| 18 | PPTP_CALL_OUT_REQ, | ||
| 19 | PPTP_CALL_OUT_CONF, | ||
| 20 | PPTP_CALL_IN_REQ, | ||
| 21 | PPTP_CALL_IN_REP, | ||
| 22 | PPTP_CALL_IN_CONF, | ||
| 23 | PPTP_CALL_CLEAR_REQ, | ||
| 24 | }; | ||
| 25 | |||
| 26 | |||
| 27 | /* conntrack private data */ | ||
| 28 | struct ip_ct_pptp_master { | ||
| 29 | enum pptp_ctrlsess_state sstate; /* session state */ | ||
| 30 | |||
| 31 | /* everything below is going to be per-expectation in newnat, | ||
| 32 | * since there could be more than one call within one session */ | ||
| 33 | enum pptp_ctrlcall_state cstate; /* call state */ | ||
| 34 | u_int16_t pac_call_id; /* call id of PAC, host byte order */ | ||
| 35 | u_int16_t pns_call_id; /* call id of PNS, host byte order */ | ||
| 36 | |||
| 37 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack | ||
| 38 | * and therefore imposes a fixed limit on the number of maps */ | ||
| 39 | struct ip_ct_gre_keymap *keymap_orig, *keymap_reply; | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* conntrack_expect private member */ | ||
| 43 | struct ip_ct_pptp_expect { | ||
| 44 | enum pptp_ctrlcall_state cstate; /* call state */ | ||
| 45 | u_int16_t pac_call_id; /* call id of PAC */ | ||
| 46 | u_int16_t pns_call_id; /* call id of PNS */ | ||
| 47 | }; | ||
| 48 | |||
| 49 | |||
| 50 | #ifdef __KERNEL__ | ||
| 51 | |||
| 52 | #define IP_CONNTR_PPTP PPTP_CONTROL_PORT | ||
| 53 | |||
| 54 | #define PPTP_CONTROL_PORT 1723 | ||
| 55 | |||
| 56 | #define PPTP_PACKET_CONTROL 1 | ||
| 57 | #define PPTP_PACKET_MGMT 2 | ||
| 58 | |||
| 59 | #define PPTP_MAGIC_COOKIE 0x1a2b3c4d | ||
| 60 | |||
| 61 | struct pptp_pkt_hdr { | ||
| 62 | __u16 packetLength; | ||
| 63 | __be16 packetType; | ||
| 64 | __be32 magicCookie; | ||
| 65 | }; | ||
| 66 | |||
| 67 | /* PptpControlMessageType values */ | ||
| 68 | #define PPTP_START_SESSION_REQUEST 1 | ||
| 69 | #define PPTP_START_SESSION_REPLY 2 | ||
| 70 | #define PPTP_STOP_SESSION_REQUEST 3 | ||
| 71 | #define PPTP_STOP_SESSION_REPLY 4 | ||
| 72 | #define PPTP_ECHO_REQUEST 5 | ||
| 73 | #define PPTP_ECHO_REPLY 6 | ||
| 74 | #define PPTP_OUT_CALL_REQUEST 7 | ||
| 75 | #define PPTP_OUT_CALL_REPLY 8 | ||
| 76 | #define PPTP_IN_CALL_REQUEST 9 | ||
| 77 | #define PPTP_IN_CALL_REPLY 10 | ||
| 78 | #define PPTP_IN_CALL_CONNECT 11 | ||
| 79 | #define PPTP_CALL_CLEAR_REQUEST 12 | ||
| 80 | #define PPTP_CALL_DISCONNECT_NOTIFY 13 | ||
| 81 | #define PPTP_WAN_ERROR_NOTIFY 14 | ||
| 82 | #define PPTP_SET_LINK_INFO 15 | ||
| 83 | |||
| 84 | #define PPTP_MSG_MAX 15 | ||
| 85 | |||
| 86 | /* PptpGeneralError values */ | ||
| 87 | #define PPTP_ERROR_CODE_NONE 0 | ||
| 88 | #define PPTP_NOT_CONNECTED 1 | ||
| 89 | #define PPTP_BAD_FORMAT 2 | ||
| 90 | #define PPTP_BAD_VALUE 3 | ||
| 91 | #define PPTP_NO_RESOURCE 4 | ||
| 92 | #define PPTP_BAD_CALLID 5 | ||
| 93 | #define PPTP_REMOVE_DEVICE_ERROR 6 | ||
| 94 | |||
| 95 | struct PptpControlHeader { | ||
| 96 | __be16 messageType; | ||
| 97 | __u16 reserved; | ||
| 98 | }; | ||
| 99 | |||
| 100 | /* FramingCapability Bitmap Values */ | ||
| 101 | #define PPTP_FRAME_CAP_ASYNC 0x1 | ||
| 102 | #define PPTP_FRAME_CAP_SYNC 0x2 | ||
| 103 | |||
| 104 | /* BearerCapability Bitmap Values */ | ||
| 105 | #define PPTP_BEARER_CAP_ANALOG 0x1 | ||
| 106 | #define PPTP_BEARER_CAP_DIGITAL 0x2 | ||
| 107 | |||
| 108 | struct PptpStartSessionRequest { | ||
| 109 | __be16 protocolVersion; | ||
| 110 | __u8 reserved1; | ||
| 111 | __u8 reserved2; | ||
| 112 | __be32 framingCapability; | ||
| 113 | __be32 bearerCapability; | ||
| 114 | __be16 maxChannels; | ||
| 115 | __be16 firmwareRevision; | ||
| 116 | __u8 hostName[64]; | ||
| 117 | __u8 vendorString[64]; | ||
| 118 | }; | ||
| 119 | |||
| 120 | /* PptpStartSessionResultCode Values */ | ||
| 121 | #define PPTP_START_OK 1 | ||
| 122 | #define PPTP_START_GENERAL_ERROR 2 | ||
| 123 | #define PPTP_START_ALREADY_CONNECTED 3 | ||
| 124 | #define PPTP_START_NOT_AUTHORIZED 4 | ||
| 125 | #define PPTP_START_UNKNOWN_PROTOCOL 5 | ||
| 126 | |||
| 127 | struct PptpStartSessionReply { | ||
| 128 | __be16 protocolVersion; | ||
| 129 | __u8 resultCode; | ||
| 130 | __u8 generalErrorCode; | ||
| 131 | __be32 framingCapability; | ||
| 132 | __be32 bearerCapability; | ||
| 133 | __be16 maxChannels; | ||
| 134 | __be16 firmwareRevision; | ||
| 135 | __u8 hostName[64]; | ||
| 136 | __u8 vendorString[64]; | ||
| 137 | }; | ||
| 138 | |||
| 139 | /* PptpStopReasons */ | ||
| 140 | #define PPTP_STOP_NONE 1 | ||
| 141 | #define PPTP_STOP_PROTOCOL 2 | ||
| 142 | #define PPTP_STOP_LOCAL_SHUTDOWN 3 | ||
| 143 | |||
| 144 | struct PptpStopSessionRequest { | ||
| 145 | __u8 reason; | ||
| 146 | }; | ||
| 147 | |||
| 148 | /* PptpStopSessionResultCode */ | ||
| 149 | #define PPTP_STOP_OK 1 | ||
| 150 | #define PPTP_STOP_GENERAL_ERROR 2 | ||
| 151 | |||
| 152 | struct PptpStopSessionReply { | ||
| 153 | __u8 resultCode; | ||
| 154 | __u8 generalErrorCode; | ||
| 155 | }; | ||
| 156 | |||
| 157 | struct PptpEchoRequest { | ||
| 158 | __be32 identNumber; | ||
| 159 | }; | ||
| 160 | |||
| 161 | /* PptpEchoReplyResultCode */ | ||
| 162 | #define PPTP_ECHO_OK 1 | ||
| 163 | #define PPTP_ECHO_GENERAL_ERROR 2 | ||
| 164 | |||
| 165 | struct PptpEchoReply { | ||
| 166 | __be32 identNumber; | ||
| 167 | __u8 resultCode; | ||
| 168 | __u8 generalErrorCode; | ||
| 169 | __u16 reserved; | ||
| 170 | }; | ||
| 171 | |||
| 172 | /* PptpFramingType */ | ||
| 173 | #define PPTP_ASYNC_FRAMING 1 | ||
| 174 | #define PPTP_SYNC_FRAMING 2 | ||
| 175 | #define PPTP_DONT_CARE_FRAMING 3 | ||
| 176 | |||
| 177 | /* PptpCallBearerType */ | ||
| 178 | #define PPTP_ANALOG_TYPE 1 | ||
| 179 | #define PPTP_DIGITAL_TYPE 2 | ||
| 180 | #define PPTP_DONT_CARE_BEARER_TYPE 3 | ||
| 181 | |||
| 182 | struct PptpOutCallRequest { | ||
| 183 | __be16 callID; | ||
| 184 | __be16 callSerialNumber; | ||
| 185 | __be32 minBPS; | ||
| 186 | __be32 maxBPS; | ||
| 187 | __be32 bearerType; | ||
| 188 | __be32 framingType; | ||
| 189 | __be16 packetWindow; | ||
| 190 | __be16 packetProcDelay; | ||
| 191 | __u16 reserved1; | ||
| 192 | __be16 phoneNumberLength; | ||
| 193 | __u16 reserved2; | ||
| 194 | __u8 phoneNumber[64]; | ||
| 195 | __u8 subAddress[64]; | ||
| 196 | }; | ||
| 197 | |||
| 198 | /* PptpCallResultCode */ | ||
| 199 | #define PPTP_OUTCALL_CONNECT 1 | ||
| 200 | #define PPTP_OUTCALL_GENERAL_ERROR 2 | ||
| 201 | #define PPTP_OUTCALL_NO_CARRIER 3 | ||
| 202 | #define PPTP_OUTCALL_BUSY 4 | ||
| 203 | #define PPTP_OUTCALL_NO_DIAL_TONE 5 | ||
| 204 | #define PPTP_OUTCALL_TIMEOUT 6 | ||
| 205 | #define PPTP_OUTCALL_DONT_ACCEPT 7 | ||
| 206 | |||
| 207 | struct PptpOutCallReply { | ||
| 208 | __be16 callID; | ||
| 209 | __be16 peersCallID; | ||
| 210 | __u8 resultCode; | ||
| 211 | __u8 generalErrorCode; | ||
| 212 | __be16 causeCode; | ||
| 213 | __be32 connectSpeed; | ||
| 214 | __be16 packetWindow; | ||
| 215 | __be16 packetProcDelay; | ||
| 216 | __be32 physChannelID; | ||
| 217 | }; | ||
| 218 | |||
| 219 | struct PptpInCallRequest { | ||
| 220 | __be16 callID; | ||
| 221 | __be16 callSerialNumber; | ||
| 222 | __be32 callBearerType; | ||
| 223 | __be32 physChannelID; | ||
| 224 | __be16 dialedNumberLength; | ||
| 225 | __be16 dialingNumberLength; | ||
| 226 | __u8 dialedNumber[64]; | ||
| 227 | __u8 dialingNumber[64]; | ||
| 228 | __u8 subAddress[64]; | ||
| 229 | }; | ||
| 230 | |||
| 231 | /* PptpInCallResultCode */ | ||
| 232 | #define PPTP_INCALL_ACCEPT 1 | ||
| 233 | #define PPTP_INCALL_GENERAL_ERROR 2 | ||
| 234 | #define PPTP_INCALL_DONT_ACCEPT 3 | ||
| 235 | |||
| 236 | struct PptpInCallReply { | ||
| 237 | __be16 callID; | ||
| 238 | __be16 peersCallID; | ||
| 239 | __u8 resultCode; | ||
| 240 | __u8 generalErrorCode; | ||
| 241 | __be16 packetWindow; | ||
| 242 | __be16 packetProcDelay; | ||
| 243 | __u16 reserved; | ||
| 244 | }; | ||
| 245 | |||
| 246 | struct PptpInCallConnected { | ||
| 247 | __be16 peersCallID; | ||
| 248 | __u16 reserved; | ||
| 249 | __be32 connectSpeed; | ||
| 250 | __be16 packetWindow; | ||
| 251 | __be16 packetProcDelay; | ||
| 252 | __be32 callFramingType; | ||
| 253 | }; | ||
| 254 | |||
| 255 | struct PptpClearCallRequest { | ||
| 256 | __be16 callID; | ||
| 257 | __u16 reserved; | ||
| 258 | }; | ||
| 259 | |||
| 260 | struct PptpCallDisconnectNotify { | ||
| 261 | __be16 callID; | ||
| 262 | __u8 resultCode; | ||
| 263 | __u8 generalErrorCode; | ||
| 264 | __be16 causeCode; | ||
| 265 | __u16 reserved; | ||
| 266 | __u8 callStatistics[128]; | ||
| 267 | }; | ||
| 268 | |||
| 269 | struct PptpWanErrorNotify { | ||
| 270 | __be16 peersCallID; | ||
| 271 | __u16 reserved; | ||
| 272 | __be32 crcErrors; | ||
| 273 | __be32 framingErrors; | ||
| 274 | __be32 hardwareOverRuns; | ||
| 275 | __be32 bufferOverRuns; | ||
| 276 | __be32 timeoutErrors; | ||
| 277 | __be32 alignmentErrors; | ||
| 278 | }; | ||
| 279 | |||
| 280 | struct PptpSetLinkInfo { | ||
| 281 | __be16 peersCallID; | ||
| 282 | __u16 reserved; | ||
| 283 | __be32 sendAccm; | ||
| 284 | __be32 recvAccm; | ||
| 285 | }; | ||
| 286 | |||
| 287 | union pptp_ctrl_union { | ||
| 288 | struct PptpStartSessionRequest sreq; | ||
| 289 | struct PptpStartSessionReply srep; | ||
| 290 | struct PptpStopSessionRequest streq; | ||
| 291 | struct PptpStopSessionReply strep; | ||
| 292 | struct PptpOutCallRequest ocreq; | ||
| 293 | struct PptpOutCallReply ocack; | ||
| 294 | struct PptpInCallRequest icreq; | ||
| 295 | struct PptpInCallReply icack; | ||
| 296 | struct PptpInCallConnected iccon; | ||
| 297 | struct PptpClearCallRequest clrreq; | ||
| 298 | struct PptpCallDisconnectNotify disc; | ||
| 299 | struct PptpWanErrorNotify wanerr; | ||
| 300 | struct PptpSetLinkInfo setlink; | ||
| 301 | }; | ||
| 302 | |||
| 303 | extern int | ||
| 304 | (*ip_nat_pptp_hook_outbound)(struct sk_buff **pskb, | ||
| 305 | struct ip_conntrack *ct, | ||
| 306 | enum ip_conntrack_info ctinfo, | ||
| 307 | struct PptpControlHeader *ctlh, | ||
| 308 | union pptp_ctrl_union *pptpReq); | ||
| 309 | |||
| 310 | extern int | ||
| 311 | (*ip_nat_pptp_hook_inbound)(struct sk_buff **pskb, | ||
| 312 | struct ip_conntrack *ct, | ||
| 313 | enum ip_conntrack_info ctinfo, | ||
| 314 | struct PptpControlHeader *ctlh, | ||
| 315 | union pptp_ctrl_union *pptpReq); | ||
| 316 | |||
| 317 | extern int | ||
| 318 | (*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig, | ||
| 319 | struct ip_conntrack_expect *exp_reply); | ||
| 320 | |||
| 321 | extern void | ||
| 322 | (*ip_nat_pptp_hook_expectfn)(struct ip_conntrack *ct, | ||
| 323 | struct ip_conntrack_expect *exp); | ||
| 324 | #endif /* __KERNEL__ */ | ||
| 325 | #endif /* _CONNTRACK_PPTP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h new file mode 100644 index 000000000000..8d090ef82f5f --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | #ifndef _CONNTRACK_PROTO_GRE_H | ||
| 2 | #define _CONNTRACK_PROTO_GRE_H | ||
| 3 | #include <asm/byteorder.h> | ||
| 4 | |||
| 5 | /* GRE PROTOCOL HEADER */ | ||
| 6 | |||
| 7 | /* GRE Version field */ | ||
| 8 | #define GRE_VERSION_1701 0x0 | ||
| 9 | #define GRE_VERSION_PPTP 0x1 | ||
| 10 | |||
| 11 | /* GRE Protocol field */ | ||
| 12 | #define GRE_PROTOCOL_PPTP 0x880B | ||
| 13 | |||
| 14 | /* GRE Flags */ | ||
| 15 | #define GRE_FLAG_C 0x80 | ||
| 16 | #define GRE_FLAG_R 0x40 | ||
| 17 | #define GRE_FLAG_K 0x20 | ||
| 18 | #define GRE_FLAG_S 0x10 | ||
| 19 | #define GRE_FLAG_A 0x80 | ||
| 20 | |||
| 21 | #define GRE_IS_C(f) ((f)&GRE_FLAG_C) | ||
| 22 | #define GRE_IS_R(f) ((f)&GRE_FLAG_R) | ||
| 23 | #define GRE_IS_K(f) ((f)&GRE_FLAG_K) | ||
| 24 | #define GRE_IS_S(f) ((f)&GRE_FLAG_S) | ||
| 25 | #define GRE_IS_A(f) ((f)&GRE_FLAG_A) | ||
| 26 | |||
| 27 | /* GRE is a mess: Four different standards */ | ||
| 28 | struct gre_hdr { | ||
| 29 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 30 | __u16 rec:3, | ||
| 31 | srr:1, | ||
| 32 | seq:1, | ||
| 33 | key:1, | ||
| 34 | routing:1, | ||
| 35 | csum:1, | ||
| 36 | version:3, | ||
| 37 | reserved:4, | ||
| 38 | ack:1; | ||
| 39 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
| 40 | __u16 csum:1, | ||
| 41 | routing:1, | ||
| 42 | key:1, | ||
| 43 | seq:1, | ||
| 44 | srr:1, | ||
| 45 | rec:3, | ||
| 46 | ack:1, | ||
| 47 | reserved:4, | ||
| 48 | version:3; | ||
| 49 | #else | ||
| 50 | #error "Adjust your <asm/byteorder.h> defines" | ||
| 51 | #endif | ||
| 52 | __u16 protocol; | ||
| 53 | }; | ||
| 54 | |||
| 55 | /* modified GRE header for PPTP */ | ||
| 56 | struct gre_hdr_pptp { | ||
| 57 | __u8 flags; /* bitfield */ | ||
| 58 | __u8 version; /* should be GRE_VERSION_PPTP */ | ||
| 59 | __u16 protocol; /* should be GRE_PROTOCOL_PPTP */ | ||
| 60 | __u16 payload_len; /* size of ppp payload, not inc. gre header */ | ||
| 61 | __u16 call_id; /* peer's call_id for this session */ | ||
| 62 | __u32 seq; /* sequence number. Present if S==1 */ | ||
| 63 | __u32 ack; /* seq number of highest packet recieved by */ | ||
| 64 | /* sender in this session */ | ||
| 65 | }; | ||
| 66 | |||
| 67 | |||
| 68 | /* this is part of ip_conntrack */ | ||
| 69 | struct ip_ct_gre { | ||
| 70 | unsigned int stream_timeout; | ||
| 71 | unsigned int timeout; | ||
| 72 | }; | ||
| 73 | |||
| 74 | #ifdef __KERNEL__ | ||
| 75 | struct ip_conntrack_expect; | ||
| 76 | struct ip_conntrack; | ||
| 77 | |||
| 78 | /* structure for original <-> reply keymap */ | ||
| 79 | struct ip_ct_gre_keymap { | ||
| 80 | struct list_head list; | ||
| 81 | |||
| 82 | struct ip_conntrack_tuple tuple; | ||
| 83 | }; | ||
| 84 | |||
| 85 | /* add new tuple->key_reply pair to keymap */ | ||
| 86 | int ip_ct_gre_keymap_add(struct ip_conntrack *ct, | ||
| 87 | struct ip_conntrack_tuple *t, | ||
| 88 | int reply); | ||
| 89 | |||
| 90 | /* delete keymap entries */ | ||
| 91 | void ip_ct_gre_keymap_destroy(struct ip_conntrack *ct); | ||
| 92 | |||
| 93 | |||
| 94 | /* get pointer to gre key, if present */ | ||
| 95 | static inline u_int32_t *gre_key(struct gre_hdr *greh) | ||
| 96 | { | ||
| 97 | if (!greh->key) | ||
| 98 | return NULL; | ||
| 99 | if (greh->csum || greh->routing) | ||
| 100 | return (u_int32_t *) (greh+sizeof(*greh)+4); | ||
| 101 | return (u_int32_t *) (greh+sizeof(*greh)); | ||
| 102 | } | ||
| 103 | |||
| 104 | /* get pointer ot gre csum, if present */ | ||
| 105 | static inline u_int16_t *gre_csum(struct gre_hdr *greh) | ||
| 106 | { | ||
| 107 | if (!greh->csum) | ||
| 108 | return NULL; | ||
| 109 | return (u_int16_t *) (greh+sizeof(*greh)); | ||
| 110 | } | ||
| 111 | |||
| 112 | #endif /* __KERNEL__ */ | ||
| 113 | |||
| 114 | #endif /* _CONNTRACK_PROTO_GRE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h index b6b99be8632a..2c76b879e3dc 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h | |||
| @@ -52,6 +52,9 @@ struct ip_conntrack_protocol | |||
| 52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, | 52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, |
| 53 | const struct ip_conntrack *ct); | 53 | const struct ip_conntrack *ct); |
| 54 | 54 | ||
| 55 | /* convert nfnetlink attributes to protoinfo */ | ||
| 56 | int (*from_nfattr)(struct nfattr *tb[], struct ip_conntrack *ct); | ||
| 57 | |||
| 55 | int (*tuple_to_nfattr)(struct sk_buff *skb, | 58 | int (*tuple_to_nfattr)(struct sk_buff *skb, |
| 56 | const struct ip_conntrack_tuple *t); | 59 | const struct ip_conntrack_tuple *t); |
| 57 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 60 | int (*nfattr_to_tuple)(struct nfattr *tb[], |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index c33f0b5e0d0a..3232db11a4e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_TUPLE_H | 1 | #ifndef _IP_CONNTRACK_TUPLE_H |
| 2 | #define _IP_CONNTRACK_TUPLE_H | 2 | #define _IP_CONNTRACK_TUPLE_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 4 | /* A `tuple' is a structure containing the information to uniquely | 6 | /* A `tuple' is a structure containing the information to uniquely |
| 5 | identify a connection. ie. if two packets have the same tuple, they | 7 | identify a connection. ie. if two packets have the same tuple, they |
| 6 | are in the same connection; if not, they are not. | 8 | are in the same connection; if not, they are not. |
| @@ -17,7 +19,7 @@ union ip_conntrack_manip_proto | |||
| 17 | u_int16_t all; | 19 | u_int16_t all; |
| 18 | 20 | ||
| 19 | struct { | 21 | struct { |
| 20 | u_int16_t port; | 22 | __be16 port; |
| 21 | } tcp; | 23 | } tcp; |
| 22 | struct { | 24 | struct { |
| 23 | u_int16_t port; | 25 | u_int16_t port; |
| @@ -28,6 +30,9 @@ union ip_conntrack_manip_proto | |||
| 28 | struct { | 30 | struct { |
| 29 | u_int16_t port; | 31 | u_int16_t port; |
| 30 | } sctp; | 32 | } sctp; |
| 33 | struct { | ||
| 34 | __be16 key; /* key is 32bit, pptp only uses 16 */ | ||
| 35 | } gre; | ||
| 31 | }; | 36 | }; |
| 32 | 37 | ||
| 33 | /* The manipulable part of the tuple. */ | 38 | /* The manipulable part of the tuple. */ |
| @@ -61,6 +66,10 @@ struct ip_conntrack_tuple | |||
| 61 | struct { | 66 | struct { |
| 62 | u_int16_t port; | 67 | u_int16_t port; |
| 63 | } sctp; | 68 | } sctp; |
| 69 | struct { | ||
| 70 | __be16 key; /* key is 32bit, | ||
| 71 | * pptp only uses 16 */ | ||
| 72 | } gre; | ||
| 64 | } u; | 73 | } u; |
| 65 | 74 | ||
| 66 | /* The protocol. */ | 75 | /* The protocol. */ |
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index e201ec6e9905..41a107de17cf 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
| @@ -58,10 +58,6 @@ extern rwlock_t ip_nat_lock; | |||
| 58 | struct ip_nat_info | 58 | struct ip_nat_info |
| 59 | { | 59 | { |
| 60 | struct list_head bysource; | 60 | struct list_head bysource; |
| 61 | |||
| 62 | /* Helper (NULL if none). */ | ||
| 63 | struct ip_nat_helper *helper; | ||
| 64 | |||
| 65 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; | 61 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; |
| 66 | }; | 62 | }; |
| 67 | 63 | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index 3b50eb91f007..30db23f06b03 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h | |||
| @@ -5,16 +5,14 @@ | |||
| 5 | 5 | ||
| 6 | /* This header used to share core functionality between the standalone | 6 | /* This header used to share core functionality between the standalone |
| 7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | 7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ |
| 8 | extern int ip_nat_init(void); | ||
| 9 | extern void ip_nat_cleanup(void); | ||
| 10 | 8 | ||
| 11 | extern unsigned int nat_packet(struct ip_conntrack *ct, | 9 | extern unsigned int ip_nat_packet(struct ip_conntrack *ct, |
| 12 | enum ip_conntrack_info conntrackinfo, | 10 | enum ip_conntrack_info conntrackinfo, |
| 13 | unsigned int hooknum, | 11 | unsigned int hooknum, |
| 14 | struct sk_buff **pskb); | 12 | struct sk_buff **pskb); |
| 15 | 13 | ||
| 16 | extern int icmp_reply_translation(struct sk_buff **pskb, | 14 | extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb, |
| 17 | struct ip_conntrack *ct, | 15 | struct ip_conntrack *ct, |
| 18 | enum ip_nat_manip_type manip, | 16 | enum ip_nat_manip_type manip, |
| 19 | enum ip_conntrack_dir dir); | 17 | enum ip_conntrack_dir dir); |
| 20 | #endif /* _IP_NAT_CORE_H */ | 18 | #endif /* _IP_NAT_CORE_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_nat_pptp.h b/include/linux/netfilter_ipv4/ip_nat_pptp.h new file mode 100644 index 000000000000..eaf66c2e8f93 --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_nat_pptp.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | /* PPTP constants and structs */ | ||
| 2 | #ifndef _NAT_PPTP_H | ||
| 3 | #define _NAT_PPTP_H | ||
| 4 | |||
| 5 | /* conntrack private data */ | ||
| 6 | struct ip_nat_pptp { | ||
| 7 | u_int16_t pns_call_id; /* NAT'ed PNS call id */ | ||
| 8 | u_int16_t pac_call_id; /* NAT'ed PAC call id */ | ||
| 9 | }; | ||
| 10 | |||
| 11 | #endif /* _NAT_PPTP_H */ | ||
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 58c72a52dc65..59f70b34e029 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -455,6 +455,9 @@ extern unsigned int ip6t_do_table(struct sk_buff **pskb, | |||
| 455 | 455 | ||
| 456 | /* Check for an extension */ | 456 | /* Check for an extension */ |
| 457 | extern int ip6t_ext_hdr(u8 nexthdr); | 457 | extern int ip6t_ext_hdr(u8 nexthdr); |
| 458 | /* find specified header and get offset to it */ | ||
| 459 | extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | ||
| 460 | u8 target); | ||
| 458 | 461 | ||
| 459 | #define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1)) | 462 | #define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1)) |
| 460 | 463 | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 7bbd25970c9e..ba25ca874c20 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #define NETLINK_IP6_FW 13 | 20 | #define NETLINK_IP6_FW 13 |
| 21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
| 22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ | 22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ |
| 23 | #define NETLINK_GENERIC 16 | ||
| 23 | 24 | ||
| 24 | #define MAX_LINKS 32 | 25 | #define MAX_LINKS 32 |
| 25 | 26 | ||
| @@ -130,7 +131,7 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (* | |||
| 130 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 131 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
| 131 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 132 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
| 132 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 133 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
| 133 | __u32 group, unsigned int __nocast allocation); | 134 | __u32 group, gfp_t allocation); |
| 134 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 135 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); |
| 135 | extern int netlink_register_notifier(struct notifier_block *nb); | 136 | extern int netlink_register_notifier(struct notifier_block *nb); |
| 136 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 137 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 5ade54a78dbb..ca5a8733000f 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -86,7 +86,7 @@ static inline void netpoll_poll_unlock(void *have) | |||
| 86 | 86 | ||
| 87 | #else | 87 | #else |
| 88 | #define netpoll_rx(a) 0 | 88 | #define netpoll_rx(a) 0 |
| 89 | #define netpoll_poll_lock(a) 0 | 89 | #define netpoll_poll_lock(a) NULL |
| 90 | #define netpoll_poll_unlock(a) | 90 | #define netpoll_poll_unlock(a) |
| 91 | #endif | 91 | #endif |
| 92 | 92 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index d9a25647a295..acbf31c154f8 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ | 19 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ |
| 20 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ | 20 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ |
| 21 | 21 | ||
| 22 | static inline unsigned int __nocast mapping_gfp_mask(struct address_space * mapping) | 22 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
| 23 | { | 23 | { |
| 24 | return mapping->flags & __GFP_BITS_MASK; | 24 | return mapping->flags & __GFP_BITS_MASK; |
| 25 | } | 25 | } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 72fe3385743c..f74ed9462475 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -185,6 +185,7 @@ | |||
| 185 | #define PCI_DEVICE_ID_LSI_61C102 0x0901 | 185 | #define PCI_DEVICE_ID_LSI_61C102 0x0901 |
| 186 | #define PCI_DEVICE_ID_LSI_63C815 0x1000 | 186 | #define PCI_DEVICE_ID_LSI_63C815 0x1000 |
| 187 | #define PCI_DEVICE_ID_LSI_SAS1064 0x0050 | 187 | #define PCI_DEVICE_ID_LSI_SAS1064 0x0050 |
| 188 | #define PCI_DEVICE_ID_LSI_SAS1064R 0x0411 | ||
| 188 | #define PCI_DEVICE_ID_LSI_SAS1066 0x005E | 189 | #define PCI_DEVICE_ID_LSI_SAS1066 0x005E |
| 189 | #define PCI_DEVICE_ID_LSI_SAS1068 0x0054 | 190 | #define PCI_DEVICE_ID_LSI_SAS1068 0x0054 |
| 190 | #define PCI_DEVICE_ID_LSI_SAS1064A 0x005C | 191 | #define PCI_DEVICE_ID_LSI_SAS1064A 0x005C |
| @@ -392,6 +393,7 @@ | |||
| 392 | #define PCI_DEVICE_ID_NS_87560_USB 0x0012 | 393 | #define PCI_DEVICE_ID_NS_87560_USB 0x0012 |
| 393 | #define PCI_DEVICE_ID_NS_83815 0x0020 | 394 | #define PCI_DEVICE_ID_NS_83815 0x0020 |
| 394 | #define PCI_DEVICE_ID_NS_83820 0x0022 | 395 | #define PCI_DEVICE_ID_NS_83820 0x0022 |
| 396 | #define PCI_DEVICE_ID_NS_SATURN 0x0035 | ||
| 395 | #define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 | 397 | #define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 |
| 396 | #define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 | 398 | #define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 |
| 397 | #define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 | 399 | #define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 |
| @@ -491,6 +493,7 @@ | |||
| 491 | #define PCI_DEVICE_ID_AMI_MEGARAID2 0x9060 | 493 | #define PCI_DEVICE_ID_AMI_MEGARAID2 0x9060 |
| 492 | 494 | ||
| 493 | #define PCI_VENDOR_ID_AMD 0x1022 | 495 | #define PCI_VENDOR_ID_AMD 0x1022 |
| 496 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 | ||
| 494 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 497 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
| 495 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 498 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
| 496 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 499 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
| @@ -558,6 +561,7 @@ | |||
| 558 | #define PCI_VENDOR_ID_DELL 0x1028 | 561 | #define PCI_VENDOR_ID_DELL 0x1028 |
| 559 | #define PCI_DEVICE_ID_DELL_RACIII 0x0008 | 562 | #define PCI_DEVICE_ID_DELL_RACIII 0x0008 |
| 560 | #define PCI_DEVICE_ID_DELL_RAC4 0x0012 | 563 | #define PCI_DEVICE_ID_DELL_RAC4 0x0012 |
| 564 | #define PCI_DEVICE_ID_DELL_PERC5 0x0015 | ||
| 561 | 565 | ||
| 562 | #define PCI_VENDOR_ID_MATROX 0x102B | 566 | #define PCI_VENDOR_ID_MATROX 0x102B |
| 563 | #define PCI_DEVICE_ID_MATROX_MGA_2 0x0518 | 567 | #define PCI_DEVICE_ID_MATROX_MGA_2 0x0518 |
| @@ -768,6 +772,8 @@ | |||
| 768 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 | 772 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 |
| 769 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 773 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
| 770 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 774 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
| 775 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | ||
| 776 | #define PCI_DEVICE_ID_TI_X515 0x8036 | ||
| 771 | #define PCI_DEVICE_ID_TI_1130 0xac12 | 777 | #define PCI_DEVICE_ID_TI_1130 0xac12 |
| 772 | #define PCI_DEVICE_ID_TI_1031 0xac13 | 778 | #define PCI_DEVICE_ID_TI_1031 0xac13 |
| 773 | #define PCI_DEVICE_ID_TI_1131 0xac15 | 779 | #define PCI_DEVICE_ID_TI_1131 0xac15 |
| @@ -784,12 +790,17 @@ | |||
| 784 | #define PCI_DEVICE_ID_TI_4451 0xac42 | 790 | #define PCI_DEVICE_ID_TI_4451 0xac42 |
| 785 | #define PCI_DEVICE_ID_TI_4510 0xac44 | 791 | #define PCI_DEVICE_ID_TI_4510 0xac44 |
| 786 | #define PCI_DEVICE_ID_TI_4520 0xac46 | 792 | #define PCI_DEVICE_ID_TI_4520 0xac46 |
| 793 | #define PCI_DEVICE_ID_TI_7510 0xac47 | ||
| 794 | #define PCI_DEVICE_ID_TI_7610 0xac48 | ||
| 795 | #define PCI_DEVICE_ID_TI_7410 0xac49 | ||
| 787 | #define PCI_DEVICE_ID_TI_1410 0xac50 | 796 | #define PCI_DEVICE_ID_TI_1410 0xac50 |
| 788 | #define PCI_DEVICE_ID_TI_1420 0xac51 | 797 | #define PCI_DEVICE_ID_TI_1420 0xac51 |
| 789 | #define PCI_DEVICE_ID_TI_1451A 0xac52 | 798 | #define PCI_DEVICE_ID_TI_1451A 0xac52 |
| 790 | #define PCI_DEVICE_ID_TI_1620 0xac54 | 799 | #define PCI_DEVICE_ID_TI_1620 0xac54 |
| 791 | #define PCI_DEVICE_ID_TI_1520 0xac55 | 800 | #define PCI_DEVICE_ID_TI_1520 0xac55 |
| 792 | #define PCI_DEVICE_ID_TI_1510 0xac56 | 801 | #define PCI_DEVICE_ID_TI_1510 0xac56 |
| 802 | #define PCI_DEVICE_ID_TI_X620 0xac8d | ||
| 803 | #define PCI_DEVICE_ID_TI_X420 0xac8e | ||
| 793 | 804 | ||
| 794 | #define PCI_VENDOR_ID_SONY 0x104d | 805 | #define PCI_VENDOR_ID_SONY 0x104d |
| 795 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 | 806 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 |
| @@ -975,6 +986,7 @@ | |||
| 975 | #define PCI_DEVICE_ID_SUN_SABRE 0xa000 | 986 | #define PCI_DEVICE_ID_SUN_SABRE 0xa000 |
| 976 | #define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 | 987 | #define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 |
| 977 | #define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 | 988 | #define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 |
| 989 | #define PCI_DEVICE_ID_SUN_CASSINI 0xabba | ||
| 978 | 990 | ||
| 979 | #define PCI_VENDOR_ID_CMD 0x1095 | 991 | #define PCI_VENDOR_ID_CMD 0x1095 |
| 980 | #define PCI_DEVICE_ID_CMD_640 0x0640 | 992 | #define PCI_DEVICE_ID_CMD_640 0x0640 |
| @@ -1267,7 +1279,8 @@ | |||
| 1267 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | 1279 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 |
| 1268 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | 1280 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 |
| 1269 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1281 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
| 1270 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x036F | 1282 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E |
| 1283 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | ||
| 1271 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | 1284 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 |
| 1272 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | 1285 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 |
| 1273 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B | 1286 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B |
| @@ -2185,7 +2198,12 @@ | |||
| 2185 | #define PCI_DEVICE_ID_ENE_1211 0x1211 | 2198 | #define PCI_DEVICE_ID_ENE_1211 0x1211 |
| 2186 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 2199 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
| 2187 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 2200 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
| 2201 | #define PCI_DEVICE_ID_ENE_710 0x1411 | ||
| 2202 | #define PCI_DEVICE_ID_ENE_712 0x1412 | ||
| 2188 | #define PCI_DEVICE_ID_ENE_1420 0x1420 | 2203 | #define PCI_DEVICE_ID_ENE_1420 0x1420 |
| 2204 | #define PCI_DEVICE_ID_ENE_720 0x1421 | ||
| 2205 | #define PCI_DEVICE_ID_ENE_722 0x1422 | ||
| 2206 | |||
| 2189 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | 2207 | #define PCI_VENDOR_ID_CHELSIO 0x1425 |
| 2190 | 2208 | ||
| 2191 | #define PCI_VENDOR_ID_MIPS 0x153f | 2209 | #define PCI_VENDOR_ID_MIPS 0x153f |
| @@ -2252,6 +2270,9 @@ | |||
| 2252 | 2270 | ||
| 2253 | #define PCI_VENDOR_ID_INFINICON 0x1820 | 2271 | #define PCI_VENDOR_ID_INFINICON 0x1820 |
| 2254 | 2272 | ||
| 2273 | #define PCI_VENDOR_ID_SITECOM 0x182d | ||
| 2274 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 | ||
| 2275 | |||
| 2255 | #define PCI_VENDOR_ID_TOPSPIN 0x1867 | 2276 | #define PCI_VENDOR_ID_TOPSPIN 0x1867 |
| 2256 | 2277 | ||
| 2257 | #define PCI_VENDOR_ID_TDI 0x192E | 2278 | #define PCI_VENDOR_ID_TDI 0x192E |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 4caedddaa033..4bc241290c24 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
| @@ -71,11 +71,11 @@ posix_acl_release(struct posix_acl *acl) | |||
| 71 | 71 | ||
| 72 | /* posix_acl.c */ | 72 | /* posix_acl.c */ |
| 73 | 73 | ||
| 74 | extern struct posix_acl *posix_acl_alloc(int, unsigned int __nocast); | 74 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); |
| 75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, unsigned int __nocast); | 75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); |
| 76 | extern int posix_acl_valid(const struct posix_acl *); | 76 | extern int posix_acl_valid(const struct posix_acl *); |
| 77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); |
| 78 | extern struct posix_acl *posix_acl_from_mode(mode_t, unsigned int __nocast); | 78 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); |
| 79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); | 79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); |
| 80 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); | 80 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); |
| 81 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | 81 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 9c51917b1cce..045d4761febc 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
| @@ -50,7 +50,7 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |||
| 50 | unsigned int | 50 | unsigned int |
| 51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
| 52 | unsigned long first_index, unsigned int max_items); | 52 | unsigned long first_index, unsigned int max_items); |
| 53 | int radix_tree_preload(unsigned int __nocast gfp_mask); | 53 | int radix_tree_preload(gfp_t gfp_mask); |
| 54 | void radix_tree_init(void); | 54 | void radix_tree_init(void); |
| 55 | void *radix_tree_tag_set(struct radix_tree_root *root, | 55 | void *radix_tree_tag_set(struct radix_tree_root *root, |
| 56 | unsigned long index, int tag); | 56 | unsigned long index, int tag); |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 4e65eb44adfd..70191a5a148f 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -94,6 +94,7 @@ struct rcu_data { | |||
| 94 | long batch; /* Batch # for current RCU batch */ | 94 | long batch; /* Batch # for current RCU batch */ |
| 95 | struct rcu_head *nxtlist; | 95 | struct rcu_head *nxtlist; |
| 96 | struct rcu_head **nxttail; | 96 | struct rcu_head **nxttail; |
| 97 | long count; /* # of queued items */ | ||
| 97 | struct rcu_head *curlist; | 98 | struct rcu_head *curlist; |
| 98 | struct rcu_head **curtail; | 99 | struct rcu_head **curtail; |
| 99 | struct rcu_head *donelist; | 100 | struct rcu_head *donelist; |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 3b3266ff1a95..7ab2cdb83ef0 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
| @@ -59,6 +59,10 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
| 59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
| 60 | */ | 60 | */ |
| 61 | 61 | ||
| 62 | extern void kernel_restart_prepare(char *cmd); | ||
| 63 | extern void kernel_halt_prepare(void); | ||
| 64 | extern void kernel_power_off_prepare(void); | ||
| 65 | |||
| 62 | extern void kernel_restart(char *cmd); | 66 | extern void kernel_restart(char *cmd); |
| 63 | extern void kernel_halt(void); | 67 | extern void kernel_halt(void); |
| 64 | extern void kernel_power_off(void); | 68 | extern void kernel_power_off(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 49e617fa0f66..27519df0f987 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -107,13 +107,25 @@ extern unsigned long nr_iowait(void); | |||
| 107 | 107 | ||
| 108 | #include <asm/processor.h> | 108 | #include <asm/processor.h> |
| 109 | 109 | ||
| 110 | /* | ||
| 111 | * Task state bitmask. NOTE! These bits are also | ||
| 112 | * encoded in fs/proc/array.c: get_task_state(). | ||
| 113 | * | ||
| 114 | * We have two separate sets of flags: task->state | ||
| 115 | * is about runnability, while task->exit_state are | ||
| 116 | * about the task exiting. Confusing, but this way | ||
| 117 | * modifying one set can't modify the other one by | ||
| 118 | * mistake. | ||
| 119 | */ | ||
| 110 | #define TASK_RUNNING 0 | 120 | #define TASK_RUNNING 0 |
| 111 | #define TASK_INTERRUPTIBLE 1 | 121 | #define TASK_INTERRUPTIBLE 1 |
| 112 | #define TASK_UNINTERRUPTIBLE 2 | 122 | #define TASK_UNINTERRUPTIBLE 2 |
| 113 | #define TASK_STOPPED 4 | 123 | #define TASK_STOPPED 4 |
| 114 | #define TASK_TRACED 8 | 124 | #define TASK_TRACED 8 |
| 125 | /* in tsk->exit_state */ | ||
| 115 | #define EXIT_ZOMBIE 16 | 126 | #define EXIT_ZOMBIE 16 |
| 116 | #define EXIT_DEAD 32 | 127 | #define EXIT_DEAD 32 |
| 128 | /* in tsk->state again */ | ||
| 117 | #define TASK_NONINTERACTIVE 64 | 129 | #define TASK_NONINTERACTIVE 64 |
| 118 | 130 | ||
| 119 | #define __set_task_state(tsk, state_value) \ | 131 | #define __set_task_state(tsk, state_value) \ |
| @@ -1006,6 +1018,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *); | |||
| 1006 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1018 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
| 1007 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1019 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
| 1008 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1020 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
| 1021 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t); | ||
| 1009 | extern void do_notify_parent(struct task_struct *, int); | 1022 | extern void do_notify_parent(struct task_struct *, int); |
| 1010 | extern void force_sig(int, struct task_struct *); | 1023 | extern void force_sig(int, struct task_struct *); |
| 1011 | extern void force_sig_specific(int, struct task_struct *); | 1024 | extern void force_sig_specific(int, struct task_struct *); |
diff --git a/include/linux/security.h b/include/linux/security.h index 0e43460d374e..627382e74057 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -2634,8 +2634,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
| 2634 | return security_ops->socket_getpeersec(sock, optval, optlen, len); | 2634 | return security_ops->socket_getpeersec(sock, optval, optlen, len); |
| 2635 | } | 2635 | } |
| 2636 | 2636 | ||
| 2637 | static inline int security_sk_alloc(struct sock *sk, int family, | 2637 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
| 2638 | unsigned int __nocast priority) | ||
| 2639 | { | 2638 | { |
| 2640 | return security_ops->sk_alloc_security(sk, family, priority); | 2639 | return security_ops->sk_alloc_security(sk, family, priority); |
| 2641 | } | 2640 | } |
| @@ -2752,8 +2751,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
| 2752 | return -ENOPROTOOPT; | 2751 | return -ENOPROTOOPT; |
| 2753 | } | 2752 | } |
| 2754 | 2753 | ||
| 2755 | static inline int security_sk_alloc(struct sock *sk, int family, | 2754 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
| 2756 | unsigned int __nocast priority) | ||
| 2757 | { | 2755 | { |
| 2758 | return 0; | 2756 | return 0; |
| 2759 | } | 2757 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2741c0c55e83..8f5d9e7f8734 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -155,8 +155,6 @@ struct skb_shared_info { | |||
| 155 | #define SKB_DATAREF_SHIFT 16 | 155 | #define SKB_DATAREF_SHIFT 16 |
| 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) | 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
| 157 | 157 | ||
| 158 | extern struct timeval skb_tv_base; | ||
| 159 | |||
| 160 | struct skb_timeval { | 158 | struct skb_timeval { |
| 161 | u32 off_sec; | 159 | u32 off_sec; |
| 162 | u32 off_usec; | 160 | u32 off_usec; |
| @@ -175,7 +173,7 @@ enum { | |||
| 175 | * @prev: Previous buffer in list | 173 | * @prev: Previous buffer in list |
| 176 | * @list: List we are on | 174 | * @list: List we are on |
| 177 | * @sk: Socket we are owned by | 175 | * @sk: Socket we are owned by |
| 178 | * @tstamp: Time we arrived stored as offset to skb_tv_base | 176 | * @tstamp: Time we arrived |
| 179 | * @dev: Device we arrived on/are leaving by | 177 | * @dev: Device we arrived on/are leaving by |
| 180 | * @input_dev: Device we arrived on | 178 | * @input_dev: Device we arrived on |
| 181 | * @h: Transport layer header | 179 | * @h: Transport layer header |
| @@ -304,37 +302,37 @@ struct sk_buff { | |||
| 304 | 302 | ||
| 305 | extern void __kfree_skb(struct sk_buff *skb); | 303 | extern void __kfree_skb(struct sk_buff *skb); |
| 306 | extern struct sk_buff *__alloc_skb(unsigned int size, | 304 | extern struct sk_buff *__alloc_skb(unsigned int size, |
| 307 | unsigned int __nocast priority, int fclone); | 305 | gfp_t priority, int fclone); |
| 308 | static inline struct sk_buff *alloc_skb(unsigned int size, | 306 | static inline struct sk_buff *alloc_skb(unsigned int size, |
| 309 | unsigned int __nocast priority) | 307 | gfp_t priority) |
| 310 | { | 308 | { |
| 311 | return __alloc_skb(size, priority, 0); | 309 | return __alloc_skb(size, priority, 0); |
| 312 | } | 310 | } |
| 313 | 311 | ||
| 314 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 312 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
| 315 | unsigned int __nocast priority) | 313 | gfp_t priority) |
| 316 | { | 314 | { |
| 317 | return __alloc_skb(size, priority, 1); | 315 | return __alloc_skb(size, priority, 1); |
| 318 | } | 316 | } |
| 319 | 317 | ||
| 320 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, | 318 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, |
| 321 | unsigned int size, | 319 | unsigned int size, |
| 322 | unsigned int __nocast priority); | 320 | gfp_t priority); |
| 323 | extern void kfree_skbmem(struct sk_buff *skb); | 321 | extern void kfree_skbmem(struct sk_buff *skb); |
| 324 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 322 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
| 325 | unsigned int __nocast priority); | 323 | gfp_t priority); |
| 326 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, | 324 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, |
| 327 | unsigned int __nocast priority); | 325 | gfp_t priority); |
| 328 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, | 326 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, |
| 329 | unsigned int __nocast gfp_mask); | 327 | gfp_t gfp_mask); |
| 330 | extern int pskb_expand_head(struct sk_buff *skb, | 328 | extern int pskb_expand_head(struct sk_buff *skb, |
| 331 | int nhead, int ntail, | 329 | int nhead, int ntail, |
| 332 | unsigned int __nocast gfp_mask); | 330 | gfp_t gfp_mask); |
| 333 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | 331 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
| 334 | unsigned int headroom); | 332 | unsigned int headroom); |
| 335 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 333 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
| 336 | int newheadroom, int newtailroom, | 334 | int newheadroom, int newtailroom, |
| 337 | unsigned int __nocast priority); | 335 | gfp_t priority); |
| 338 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); | 336 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); |
| 339 | #define dev_kfree_skb(a) kfree_skb(a) | 337 | #define dev_kfree_skb(a) kfree_skb(a) |
| 340 | extern void skb_over_panic(struct sk_buff *skb, int len, | 338 | extern void skb_over_panic(struct sk_buff *skb, int len, |
| @@ -486,7 +484,7 @@ static inline int skb_shared(const struct sk_buff *skb) | |||
| 486 | * NULL is returned on a memory allocation failure. | 484 | * NULL is returned on a memory allocation failure. |
| 487 | */ | 485 | */ |
| 488 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | 486 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, |
| 489 | unsigned int __nocast pri) | 487 | gfp_t pri) |
| 490 | { | 488 | { |
| 491 | might_sleep_if(pri & __GFP_WAIT); | 489 | might_sleep_if(pri & __GFP_WAIT); |
| 492 | if (skb_shared(skb)) { | 490 | if (skb_shared(skb)) { |
| @@ -518,7 +516,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | |||
| 518 | * %NULL is returned on a memory allocation failure. | 516 | * %NULL is returned on a memory allocation failure. |
| 519 | */ | 517 | */ |
| 520 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | 518 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, |
| 521 | unsigned int __nocast pri) | 519 | gfp_t pri) |
| 522 | { | 520 | { |
| 523 | might_sleep_if(pri & __GFP_WAIT); | 521 | might_sleep_if(pri & __GFP_WAIT); |
| 524 | if (skb_cloned(skb)) { | 522 | if (skb_cloned(skb)) { |
| @@ -1019,7 +1017,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
| 1019 | * %NULL is returned in there is no free memory. | 1017 | * %NULL is returned in there is no free memory. |
| 1020 | */ | 1018 | */ |
| 1021 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | 1019 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, |
| 1022 | unsigned int __nocast gfp_mask) | 1020 | gfp_t gfp_mask) |
| 1023 | { | 1021 | { |
| 1024 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); | 1022 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); |
| 1025 | if (likely(skb)) | 1023 | if (likely(skb)) |
| @@ -1132,8 +1130,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i, | |||
| 1132 | * If there is no free memory -ENOMEM is returned, otherwise zero | 1130 | * If there is no free memory -ENOMEM is returned, otherwise zero |
| 1133 | * is returned and the old skb data released. | 1131 | * is returned and the old skb data released. |
| 1134 | */ | 1132 | */ |
| 1135 | extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); | 1133 | extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); |
| 1136 | static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) | 1134 | static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) |
| 1137 | { | 1135 | { |
| 1138 | return __skb_linearize(skb, gfp); | 1136 | return __skb_linearize(skb, gfp); |
| 1139 | } | 1137 | } |
| @@ -1255,10 +1253,6 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
| 1255 | { | 1253 | { |
| 1256 | stamp->tv_sec = skb->tstamp.off_sec; | 1254 | stamp->tv_sec = skb->tstamp.off_sec; |
| 1257 | stamp->tv_usec = skb->tstamp.off_usec; | 1255 | stamp->tv_usec = skb->tstamp.off_usec; |
| 1258 | if (skb->tstamp.off_sec) { | ||
| 1259 | stamp->tv_sec += skb_tv_base.tv_sec; | ||
| 1260 | stamp->tv_usec += skb_tv_base.tv_usec; | ||
| 1261 | } | ||
| 1262 | } | 1256 | } |
| 1263 | 1257 | ||
| 1264 | /** | 1258 | /** |
| @@ -1272,8 +1266,8 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
| 1272 | */ | 1266 | */ |
| 1273 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | 1267 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) |
| 1274 | { | 1268 | { |
| 1275 | skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; | 1269 | skb->tstamp.off_sec = stamp->tv_sec; |
| 1276 | skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; | 1270 | skb->tstamp.off_usec = stamp->tv_usec; |
| 1277 | } | 1271 | } |
| 1278 | 1272 | ||
| 1279 | extern void __net_timestamp(struct sk_buff *skb); | 1273 | extern void __net_timestamp(struct sk_buff *skb); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 1f356f3bbc64..5fc04a16ecb0 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -61,11 +61,11 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo | |||
| 61 | void (*)(void *, kmem_cache_t *, unsigned long)); | 61 | void (*)(void *, kmem_cache_t *, unsigned long)); |
| 62 | extern int kmem_cache_destroy(kmem_cache_t *); | 62 | extern int kmem_cache_destroy(kmem_cache_t *); |
| 63 | extern int kmem_cache_shrink(kmem_cache_t *); | 63 | extern int kmem_cache_shrink(kmem_cache_t *); |
| 64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); | 64 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); |
| 65 | extern void kmem_cache_free(kmem_cache_t *, void *); | 65 | extern void kmem_cache_free(kmem_cache_t *, void *); |
| 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
| 67 | extern const char *kmem_cache_name(kmem_cache_t *); | 67 | extern const char *kmem_cache_name(kmem_cache_t *); |
| 68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); | 68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, gfp_t gfpflags); |
| 69 | 69 | ||
| 70 | /* Size description struct for general caches. */ | 70 | /* Size description struct for general caches. */ |
| 71 | struct cache_sizes { | 71 | struct cache_sizes { |
| @@ -74,9 +74,9 @@ struct cache_sizes { | |||
| 74 | kmem_cache_t *cs_dmacachep; | 74 | kmem_cache_t *cs_dmacachep; |
| 75 | }; | 75 | }; |
| 76 | extern struct cache_sizes malloc_sizes[]; | 76 | extern struct cache_sizes malloc_sizes[]; |
| 77 | extern void *__kmalloc(size_t, unsigned int __nocast); | 77 | extern void *__kmalloc(size_t, gfp_t); |
| 78 | 78 | ||
| 79 | static inline void *kmalloc(size_t size, unsigned int __nocast flags) | 79 | static inline void *kmalloc(size_t size, gfp_t flags) |
| 80 | { | 80 | { |
| 81 | if (__builtin_constant_p(size)) { | 81 | if (__builtin_constant_p(size)) { |
| 82 | int i = 0; | 82 | int i = 0; |
| @@ -99,7 +99,7 @@ found: | |||
| 99 | return __kmalloc(size, flags); | 99 | return __kmalloc(size, flags); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | extern void *kzalloc(size_t, unsigned int __nocast); | 102 | extern void *kzalloc(size_t, gfp_t); |
| 103 | 103 | ||
| 104 | /** | 104 | /** |
| 105 | * kcalloc - allocate memory for an array. The memory is set to zero. | 105 | * kcalloc - allocate memory for an array. The memory is set to zero. |
| @@ -107,7 +107,7 @@ extern void *kzalloc(size_t, unsigned int __nocast); | |||
| 107 | * @size: element size. | 107 | * @size: element size. |
| 108 | * @flags: the type of memory to allocate. | 108 | * @flags: the type of memory to allocate. |
| 109 | */ | 109 | */ |
| 110 | static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) | 110 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
| 111 | { | 111 | { |
| 112 | if (n != 0 && size > INT_MAX / n) | 112 | if (n != 0 && size > INT_MAX / n) |
| 113 | return NULL; | 113 | return NULL; |
| @@ -118,15 +118,14 @@ extern void kfree(const void *); | |||
| 118 | extern unsigned int ksize(const void *); | 118 | extern unsigned int ksize(const void *); |
| 119 | 119 | ||
| 120 | #ifdef CONFIG_NUMA | 120 | #ifdef CONFIG_NUMA |
| 121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, | 121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
| 122 | unsigned int __nocast flags, int node); | 122 | extern void *kmalloc_node(size_t size, gfp_t flags, int node); |
| 123 | extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node); | ||
| 124 | #else | 123 | #else |
| 125 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) | 124 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) |
| 126 | { | 125 | { |
| 127 | return kmem_cache_alloc(cachep, flags); | 126 | return kmem_cache_alloc(cachep, flags); |
| 128 | } | 127 | } |
| 129 | static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) | 128 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
| 130 | { | 129 | { |
| 131 | return kmalloc(size, flags); | 130 | return kmalloc(size, flags); |
| 132 | } | 131 | } |
diff --git a/include/linux/string.h b/include/linux/string.h index dab2652acbd8..369be3264a55 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -88,7 +88,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t); | |||
| 88 | extern void * memchr(const void *,int,__kernel_size_t); | 88 | extern void * memchr(const void *,int,__kernel_size_t); |
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| 91 | extern char *kstrdup(const char *s, unsigned int __nocast gfp); | 91 | extern char *kstrdup(const char *s, gfp_t gfp); |
| 92 | 92 | ||
| 93 | #ifdef __cplusplus | 93 | #ifdef __cplusplus |
| 94 | } | 94 | } |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index f2e96fdfaae0..ad15a54806d8 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -71,5 +71,7 @@ void restore_processor_state(void); | |||
| 71 | struct saved_context; | 71 | struct saved_context; |
| 72 | void __save_processor_state(struct saved_context *ctxt); | 72 | void __save_processor_state(struct saved_context *ctxt); |
| 73 | void __restore_processor_state(struct saved_context *ctxt); | 73 | void __restore_processor_state(struct saved_context *ctxt); |
| 74 | extern unsigned long get_usable_page(unsigned gfp_mask); | ||
| 75 | extern void free_eaten_memory(void); | ||
| 74 | 76 | ||
| 75 | #endif /* _LINUX_SWSUSP_H */ | 77 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 3c9ff0048153..a7bf1a3b1496 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -147,7 +147,7 @@ struct swap_list_t { | |||
| 147 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | 147 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) |
| 148 | 148 | ||
| 149 | /* linux/mm/oom_kill.c */ | 149 | /* linux/mm/oom_kill.c */ |
| 150 | extern void out_of_memory(unsigned int __nocast gfp_mask, int order); | 150 | extern void out_of_memory(gfp_t gfp_mask, int order); |
| 151 | 151 | ||
| 152 | /* linux/mm/memory.c */ | 152 | /* linux/mm/memory.c */ |
| 153 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | 153 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 425f58c8ea4a..a6f03e473737 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -508,5 +508,7 @@ asmlinkage long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3, | |||
| 508 | 508 | ||
| 509 | asmlinkage long sys_ioprio_set(int which, int who, int ioprio); | 509 | asmlinkage long sys_ioprio_set(int which, int who, int ioprio); |
| 510 | asmlinkage long sys_ioprio_get(int which, int who); | 510 | asmlinkage long sys_ioprio_get(int which, int who); |
| 511 | asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | ||
| 512 | unsigned long maxnode); | ||
| 511 | 513 | ||
| 512 | #endif | 514 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3a29a9f9b451..fc8e367f671e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -202,7 +202,8 @@ enum | |||
| 202 | NET_TR=14, | 202 | NET_TR=14, |
| 203 | NET_DECNET=15, | 203 | NET_DECNET=15, |
| 204 | NET_ECONET=16, | 204 | NET_ECONET=16, |
| 205 | NET_SCTP=17, | 205 | NET_SCTP=17, |
| 206 | NET_LLC=18, | ||
| 206 | }; | 207 | }; |
| 207 | 208 | ||
| 208 | /* /proc/sys/kernel/random */ | 209 | /* /proc/sys/kernel/random */ |
| @@ -522,6 +523,29 @@ enum { | |||
| 522 | NET_IPX_FORWARDING=2 | 523 | NET_IPX_FORWARDING=2 |
| 523 | }; | 524 | }; |
| 524 | 525 | ||
| 526 | /* /proc/sys/net/llc */ | ||
| 527 | enum { | ||
| 528 | NET_LLC2=1, | ||
| 529 | NET_LLC_STATION=2, | ||
| 530 | }; | ||
| 531 | |||
| 532 | /* /proc/sys/net/llc/llc2 */ | ||
| 533 | enum { | ||
| 534 | NET_LLC2_TIMEOUT=1, | ||
| 535 | }; | ||
| 536 | |||
| 537 | /* /proc/sys/net/llc/station */ | ||
| 538 | enum { | ||
| 539 | NET_LLC_STATION_ACK_TIMEOUT=1, | ||
| 540 | }; | ||
| 541 | |||
| 542 | /* /proc/sys/net/llc/llc2/timeout */ | ||
| 543 | enum { | ||
| 544 | NET_LLC2_ACK_TIMEOUT=1, | ||
| 545 | NET_LLC2_P_TIMEOUT=2, | ||
| 546 | NET_LLC2_REJ_TIMEOUT=3, | ||
| 547 | NET_LLC2_BUSY_TIMEOUT=4, | ||
| 548 | }; | ||
| 525 | 549 | ||
| 526 | /* /proc/sys/net/appletalk */ | 550 | /* /proc/sys/net/appletalk */ |
| 527 | enum { | 551 | enum { |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index 081b1ee8516e..e21937cf91d0 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
| @@ -71,7 +71,7 @@ enum | |||
| 71 | TCF_META_ID_SK_SNDBUF, | 71 | TCF_META_ID_SK_SNDBUF, |
| 72 | TCF_META_ID_SK_ALLOCS, | 72 | TCF_META_ID_SK_ALLOCS, |
| 73 | TCF_META_ID_SK_ROUTE_CAPS, | 73 | TCF_META_ID_SK_ROUTE_CAPS, |
| 74 | TCF_META_ID_SK_HASHENT, | 74 | TCF_META_ID_SK_HASH, |
| 75 | TCF_META_ID_SK_LINGERTIME, | 75 | TCF_META_ID_SK_LINGERTIME, |
| 76 | TCF_META_ID_SK_ACK_BACKLOG, | 76 | TCF_META_ID_SK_ACK_BACKLOG, |
| 77 | TCF_META_ID_SK_MAX_ACK_BACKLOG, | 77 | TCF_META_ID_SK_MAX_ACK_BACKLOG, |
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 941f45ac117a..515046d1b2f4 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
| @@ -158,7 +158,8 @@ extern unsigned int textsearch_find_continuous(struct ts_config *, | |||
| 158 | #define TS_PRIV_ALIGNTO 8 | 158 | #define TS_PRIV_ALIGNTO 8 |
| 159 | #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) | 159 | #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) |
| 160 | 160 | ||
| 161 | static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) | 161 | static inline struct ts_config *alloc_ts_config(size_t payload, |
| 162 | gfp_t gfp_mask) | ||
| 162 | { | 163 | { |
| 163 | struct ts_config *conf; | 164 | struct ts_config *conf; |
| 164 | 165 | ||
diff --git a/include/linux/tfrc.h b/include/linux/tfrc.h new file mode 100644 index 000000000000..7dab7831c3cb --- /dev/null +++ b/include/linux/tfrc.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | #ifndef _LINUX_TFRC_H_ | ||
| 2 | #define _LINUX_TFRC_H_ | ||
| 3 | /* | ||
| 4 | * include/linux/tfrc.h | ||
| 5 | * | ||
| 6 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. | ||
| 7 | * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> | ||
| 8 | * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
| 9 | * Copyright (c) 2003 Nils-Erik Mattsson, Joacim Haggmark, Magnus Erixzon | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; either version 2 of the License, or | ||
| 14 | * (at your option) any later version. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include <linux/types.h> | ||
| 18 | |||
| 19 | struct tfrc_rx_info { | ||
| 20 | __u32 tfrcrx_x_recv; | ||
| 21 | __u32 tfrcrx_rtt; | ||
| 22 | __u32 tfrcrx_p; | ||
| 23 | }; | ||
| 24 | |||
| 25 | struct tfrc_tx_info { | ||
| 26 | __u32 tfrctx_x; | ||
| 27 | __u32 tfrctx_x_recv; | ||
| 28 | __u32 tfrctx_x_calc; | ||
| 29 | __u32 tfrctx_rtt; | ||
| 30 | __u32 tfrctx_p; | ||
| 31 | __u32 tfrctx_rto; | ||
| 32 | __u32 tfrctx_ipi; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #endif /* _LINUX_TFRC_H_ */ | ||
diff --git a/include/linux/types.h b/include/linux/types.h index 2b678c22ca4a..0aee34f9da9f 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -165,6 +165,10 @@ typedef __u64 __bitwise __le64; | |||
| 165 | typedef __u64 __bitwise __be64; | 165 | typedef __u64 __bitwise __be64; |
| 166 | #endif | 166 | #endif |
| 167 | 167 | ||
| 168 | #ifdef __KERNEL__ | ||
| 169 | typedef unsigned __nocast gfp_t; | ||
| 170 | #endif | ||
| 171 | |||
| 168 | struct ustat { | 172 | struct ustat { |
| 169 | __kernel_daddr_t f_tfree; | 173 | __kernel_daddr_t f_tfree; |
| 170 | __kernel_ino_t f_tinode; | 174 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index b244f69ef682..3701a0673d2c 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -34,8 +34,8 @@ struct vm_struct { | |||
| 34 | extern void *vmalloc(unsigned long size); | 34 | extern void *vmalloc(unsigned long size); |
| 35 | extern void *vmalloc_exec(unsigned long size); | 35 | extern void *vmalloc_exec(unsigned long size); |
| 36 | extern void *vmalloc_32(unsigned long size); | 36 | extern void *vmalloc_32(unsigned long size); |
| 37 | extern void *__vmalloc(unsigned long size, unsigned int __nocast gfp_mask, pgprot_t prot); | 37 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
| 38 | extern void *__vmalloc_area(struct vm_struct *area, unsigned int __nocast gfp_mask, pgprot_t prot); | 38 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot); |
| 39 | extern void vfree(void *addr); | 39 | extern void vfree(void *addr); |
| 40 | 40 | ||
| 41 | extern void *vmap(struct page **pages, unsigned int count, | 41 | extern void *vmap(struct page **pages, unsigned int count, |
