aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/aio.h41
-rw-r--r--include/linux/atmdev.h12
-rw-r--r--include/linux/bfs_fs.h42
-rw-r--r--include/linux/bio.h6
-rw-r--r--include/linux/bootmem.h32
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/connector.h23
-rw-r--r--include/linux/cpumask.h10
-rw-r--r--include/linux/cpuset.h5
-rw-r--r--include/linux/dmapool.h2
-rw-r--r--include/linux/gfp.h14
-rw-r--r--include/linux/hugetlb.h13
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/inetdevice.h12
-rw-r--r--include/linux/ipv6.h5
-rw-r--r--include/linux/jbd.h2
-rw-r--r--include/linux/key-ui.h87
-rw-r--r--include/linux/key.h78
-rw-r--r--include/linux/kfifo.h4
-rw-r--r--include/linux/list.h39
-rw-r--r--include/linux/mempool.h9
-rw-r--r--include/linux/mod_devicetable.h7
-rw-r--r--include/linux/netdevice.h89
-rw-r--r--include/linux/netfilter/nfnetlink.h12
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h15
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h8
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_protocol.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_tuple.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_core.h12
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/netpoll.h2
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pci_ids.h16
-rw-r--r--include/linux/posix_acl.h6
-rw-r--r--include/linux/radix-tree.h2
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/sched.h13
-rw-r--r--include/linux/security.h6
-rw-r--r--include/linux/skbuff.h40
-rw-r--r--include/linux/slab.h19
-rw-r--r--include/linux/string.h2
-rw-r--r--include/linux/suspend.h2
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/sysctl.h26
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h2
-rw-r--r--include/linux/textsearch.h3
-rw-r--r--include/linux/types.h4
-rw-r--r--include/linux/vmalloc.h4
50 files changed, 470 insertions, 280 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
168static inline u32 jiffies_to_AHZ(unsigned long x) 168static 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 */
46struct kiocb { 85struct 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
338enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS };
339
331struct atm_dev { 340struct 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
458int atm_charge(struct atm_vcc *vcc,int truesize); 468int atm_charge(struct atm_vcc *vcc,int truesize);
459struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, 469struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
460 int gfp_flags); 470 gfp_t gfp_flags);
461int atm_pcr_goal(struct atm_trafprm *tp); 471int atm_pcr_goal(struct atm_trafprm *tp);
462 472
463void vcc_release_async(struct atm_vcc *vcc, int reply); 473void 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 */
22struct bfs_inode { 22struct 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
43struct bfs_dirent { 43struct 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 */
49struct bfs_super_block { 49struct 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);
276extern struct bio_set *bioset_create(int, int, int); 276extern struct bio_set *bioset_create(int, int, int);
277extern void bioset_free(struct bio_set *); 277extern void bioset_free(struct bio_set *);
278 278
279extern struct bio *bio_alloc(unsigned int __nocast, int); 279extern struct bio *bio_alloc(gfp_t, int);
280extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); 280extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
281extern void bio_put(struct bio *); 281extern void bio_put(struct bio *);
282extern void bio_free(struct bio *, struct bio_set *); 282extern void bio_free(struct bio *, struct bio_set *);
283 283
@@ -287,7 +287,7 @@ extern int bio_phys_segments(struct request_queue *, struct bio *);
287extern int bio_hw_segments(struct request_queue *, struct bio *); 287extern int bio_hw_segments(struct request_queue *, struct bio *);
288 288
289extern void __bio_clone(struct bio *, struct bio *); 289extern void __bio_clone(struct bio *, struct bio *);
290extern struct bio *bio_clone(struct bio *, unsigned int __nocast); 290extern struct bio *bio_clone(struct bio *, gfp_t);
291 291
292extern void bio_init(struct bio *); 292extern 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 {
43extern unsigned long __init bootmem_bootmap_pages (unsigned long); 43extern unsigned long __init bootmem_bootmap_pages (unsigned long);
44extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); 44extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
45extern void __init free_bootmem (unsigned long addr, unsigned long size); 45extern void __init free_bootmem (unsigned long addr, unsigned long size);
46extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); 46extern 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
48extern void __init reserve_bootmem (unsigned long addr, unsigned long size); 48extern 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 */
58extern unsigned long __init free_all_bootmem (void); 68extern 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
61extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); 71extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size);
62extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); 72extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size);
63extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); 73extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat);
64extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); 74extern 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
106extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ 124extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */
107 125
126static 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
131static 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 *);
172void __bforget(struct buffer_head *); 172void __bforget(struct buffer_head *);
173void __breadahead(struct block_device *, sector_t block, int size); 173void __breadahead(struct block_device *, sector_t block, int size);
174struct buffer_head *__bread(struct block_device *, sector_t block, int size); 174struct buffer_head *__bread(struct block_device *, sector_t block, int size);
175struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags); 175struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
176void free_buffer_head(struct buffer_head * bh); 176void free_buffer_head(struct buffer_head * bh);
177void FASTCALL(unlock_buffer(struct buffer_head *bh)); 177void FASTCALL(unlock_buffer(struct buffer_head *bh));
178void FASTCALL(__lock_buffer(struct buffer_head *bh)); 178void FASTCALL(__lock_buffer(struct buffer_head *bh));
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
107struct cn_callback { 107struct 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
112struct 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
115struct cn_callback_entry { 122struct 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
143int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); 150int cn_add_callback(struct cb_id *, char *, void (*callback) (void *));
144void cn_del_callback(struct cb_id *); 151void cn_del_callback(struct cb_id *);
145int cn_netlink_send(struct cn_msg *, u32, int); 152int cn_netlink_send(struct cn_msg *, u32, gfp_t);
146 153
147int cn_queue_add_callback(struct cn_queue_dev *dev, struct cn_callback *cb); 154int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *));
148void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 155void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
149 156
150struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); 157struct 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
153int cn_cb_equal(struct cb_id *, struct cb_id *); 160int cn_cb_equal(struct cb_id *, struct cb_id *);
154 161
162void cn_queue_wrapper(void *data);
163
155extern int cn_already_initialized; 164extern 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);
23void cpuset_update_current_mems_allowed(void); 23void cpuset_update_current_mems_allowed(void);
24void cpuset_restrict_to_mems_allowed(unsigned long *nodes); 24void cpuset_restrict_to_mems_allowed(unsigned long *nodes);
25int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); 25int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
26extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); 26extern int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask);
27extern int cpuset_excl_nodes_overlap(const struct task_struct *p); 27extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
28extern struct file_operations proc_cpuset_operations; 28extern struct file_operations proc_cpuset_operations;
29extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 29extern 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
52static inline int cpuset_zone_allowed(struct zone *z, 52static 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/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
20void dma_pool_destroy(struct dma_pool *pool); 20void dma_pool_destroy(struct dma_pool *pool);
21 21
22void *dma_pool_alloc(struct dma_pool *pool, unsigned int __nocast mem_flags, 22void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
23 dma_addr_t *handle); 23 dma_addr_t *handle);
24 24
25void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); 25void 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
87extern struct page * 87extern struct page *
88FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); 88FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *));
89 89
90static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_mask, 90static 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
101extern struct page *alloc_pages_current(unsigned int __nocast gfp_mask, unsigned order); 101extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);
102 102
103static inline struct page * 103static inline struct page *
104alloc_pages(unsigned int __nocast gfp_mask, unsigned int order) 104alloc_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}
111extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, 111extern 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
120extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order)); 120extern unsigned long FASTCALL(__get_free_pages(gfp_t gfp_mask, unsigned int order));
121extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask)); 121extern 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..42cb7d70f9ac 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -155,11 +155,24 @@ static inline void set_file_hugepages(struct file *file)
155{ 155{
156 file->f_op = &hugetlbfs_file_operations; 156 file->f_op = &hugetlbfs_file_operations;
157} 157}
158
159static inline int valid_hugetlb_file_off(struct vm_area_struct *vma,
160 unsigned long address)
161{
162 struct inode *inode = vma->vm_file->f_dentry->d_inode;
163 loff_t file_off = address - vma->vm_start;
164
165 file_off += (vma->vm_pgoff << PAGE_SHIFT);
166
167 return (file_off < inode->i_size);
168}
169
158#else /* !CONFIG_HUGETLBFS */ 170#else /* !CONFIG_HUGETLBFS */
159 171
160#define is_file_hugepages(file) 0 172#define is_file_hugepages(file) 0
161#define set_file_hugepages(file) BUG() 173#define set_file_hugepages(file) BUG()
162#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) 174#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS)
175#define valid_hugetlb_file_off(vma, address) 0
163 176
164#endif /* !CONFIG_HUGETLBFS */ 177#endif /* !CONFIG_HUGETLBFS */
165 178
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
114extern struct ctl_table ether_table[]; 115extern 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/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
145static 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
145static __inline__ struct in_device * 153static __inline__ struct in_device *
146in_dev_get(const struct net_device *dev) 154in_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
158static __inline__ struct in_device * 166static __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 */
936extern kmem_cache_t *jbd_handle_cache; 936extern kmem_cache_t *jbd_handle_cache;
937 937
938static inline handle_t *jbd_alloc_handle(unsigned int __nocast gfp_flags) 938static 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/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 */
45static inline int key_permission(const struct key *key, key_perm_t perm) 44extern 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 */
68static 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; 48static inline int key_permission(const key_ref_t key_ref, key_perm_t perm)
83
84 return kperm != 0;
85}
86
87static 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
97static 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
124extern struct key *lookup_user_key(struct task_struct *context, 53extern 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
128extern long join_session_keyring(const char *name); 57extern 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 */
89typedef struct __key_reference_with_attributes *key_ref_t;
90
91static 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
97static 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
102static 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
257static inline void key_ref_put(key_ref_t key_ref)
258{
259 key_put(key_ref_to_ptr(key_ref));
260}
261
218extern struct key *request_key(struct key_type *type, 262extern 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
222extern int key_validate(struct key *key); 266extern int key_validate(struct key *key);
223 267
224extern struct key *key_create_or_update(struct key *keyring, 268extern 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
231extern int key_update(struct key *key, 275extern 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
244extern int keyring_clear(struct key *keyring); 288extern int keyring_clear(struct key *keyring);
245 289
246extern struct key *keyring_search(struct key *keyring, 290extern 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
250extern int keyring_add_key(struct key *keyring, 294extern 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
37extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, 37extern 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);
39extern struct kfifo *kfifo_alloc(unsigned int size, unsigned int __nocast gfp_mask, 39extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
40 spinlock_t *lock); 40 spinlock_t *lock);
41extern void kfifo_free(struct kfifo *fifo); 41extern void kfifo_free(struct kfifo *fifo);
42extern unsigned int __kfifo_put(struct kfifo *fifo, 42extern unsigned int __kfifo_put(struct kfifo *fifo,
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
9typedef void * (mempool_alloc_t)(unsigned int __nocast gfp_mask, void *pool_data); 9typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data);
10typedef void (mempool_free_t)(void *element, void *pool_data); 10typedef void (mempool_free_t)(void *element, void *pool_data);
11 11
12typedef struct mempool_s { 12typedef struct mempool_s {
@@ -26,17 +26,16 @@ extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
26extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, 26extern 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
29extern int mempool_resize(mempool_t *pool, int new_min_nr, 29extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask);
30 unsigned int __nocast gfp_mask);
31extern void mempool_destroy(mempool_t *pool); 30extern void mempool_destroy(mempool_t *pool);
32extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask); 31extern void * mempool_alloc(mempool_t *pool, gfp_t gfp_mask);
33extern void mempool_free(void *element, mempool_t *pool); 32extern 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 */
39void *mempool_alloc_slab(unsigned int __nocast gfp_mask, void *pool_data); 38void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data);
40void mempool_free_slab(void *element, void *pool_data); 39void 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/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 {
41struct nfattr 41struct 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
71enum ctattr_protoinfo { 71enum 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
78enum 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
78enum ctattr_counters { 85enum 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 4ced38736813..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
122enum ip_conntrack_expect_events { 126enum ip_conntrack_expect_events {
@@ -192,8 +196,8 @@ do { \
192 196
193struct ip_conntrack_counter 197struct ip_conntrack_counter
194{ 198{
195 u_int64_t packets; 199 u_int32_t packets;
196 u_int64_t bytes; 200 u_int32_t bytes;
197}; 201};
198 202
199struct ip_conntrack_helper; 203struct ip_conntrack_helper;
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 20e43f018b7c..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.
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;
58struct ip_nat_info 58struct 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. */
8extern int ip_nat_init(void);
9extern void ip_nat_cleanup(void);
10 8
11extern unsigned int nat_packet(struct ip_conntrack *ct, 9extern 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
16extern int icmp_reply_translation(struct sk_buff **pskb, 14extern 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/netlink.h b/include/linux/netlink.h
index bdebdc564506..ba25ca874c20 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -131,7 +131,7 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*
131extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 131extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
132extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 132extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
133extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, 133extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
134 __u32 group, unsigned int __nocast allocation); 134 __u32 group, gfp_t allocation);
135extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); 135extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code);
136extern int netlink_register_notifier(struct notifier_block *nb); 136extern int netlink_register_notifier(struct notifier_block *nb);
137extern int netlink_unregister_notifier(struct notifier_block *nb); 137extern 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
22static inline unsigned int __nocast mapping_gfp_mask(struct address_space * mapping) 22static 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 b86a4b77007e..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
@@ -559,6 +561,7 @@
559#define PCI_VENDOR_ID_DELL 0x1028 561#define PCI_VENDOR_ID_DELL 0x1028
560#define PCI_DEVICE_ID_DELL_RACIII 0x0008 562#define PCI_DEVICE_ID_DELL_RACIII 0x0008
561#define PCI_DEVICE_ID_DELL_RAC4 0x0012 563#define PCI_DEVICE_ID_DELL_RAC4 0x0012
564#define PCI_DEVICE_ID_DELL_PERC5 0x0015
562 565
563#define PCI_VENDOR_ID_MATROX 0x102B 566#define PCI_VENDOR_ID_MATROX 0x102B
564#define PCI_DEVICE_ID_MATROX_MGA_2 0x0518 567#define PCI_DEVICE_ID_MATROX_MGA_2 0x0518
@@ -769,6 +772,8 @@
769#define PCI_DEVICE_ID_TI_TVP4010 0x3d04 772#define PCI_DEVICE_ID_TI_TVP4010 0x3d04
770#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 773#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
771#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
772#define PCI_DEVICE_ID_TI_1130 0xac12 777#define PCI_DEVICE_ID_TI_1130 0xac12
773#define PCI_DEVICE_ID_TI_1031 0xac13 778#define PCI_DEVICE_ID_TI_1031 0xac13
774#define PCI_DEVICE_ID_TI_1131 0xac15 779#define PCI_DEVICE_ID_TI_1131 0xac15
@@ -785,12 +790,17 @@
785#define PCI_DEVICE_ID_TI_4451 0xac42 790#define PCI_DEVICE_ID_TI_4451 0xac42
786#define PCI_DEVICE_ID_TI_4510 0xac44 791#define PCI_DEVICE_ID_TI_4510 0xac44
787#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
788#define PCI_DEVICE_ID_TI_1410 0xac50 796#define PCI_DEVICE_ID_TI_1410 0xac50
789#define PCI_DEVICE_ID_TI_1420 0xac51 797#define PCI_DEVICE_ID_TI_1420 0xac51
790#define PCI_DEVICE_ID_TI_1451A 0xac52 798#define PCI_DEVICE_ID_TI_1451A 0xac52
791#define PCI_DEVICE_ID_TI_1620 0xac54 799#define PCI_DEVICE_ID_TI_1620 0xac54
792#define PCI_DEVICE_ID_TI_1520 0xac55 800#define PCI_DEVICE_ID_TI_1520 0xac55
793#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
794 804
795#define PCI_VENDOR_ID_SONY 0x104d 805#define PCI_VENDOR_ID_SONY 0x104d
796#define PCI_DEVICE_ID_SONY_CXD3222 0x8039 806#define PCI_DEVICE_ID_SONY_CXD3222 0x8039
@@ -976,6 +986,7 @@
976#define PCI_DEVICE_ID_SUN_SABRE 0xa000 986#define PCI_DEVICE_ID_SUN_SABRE 0xa000
977#define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 987#define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001
978#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 988#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801
989#define PCI_DEVICE_ID_SUN_CASSINI 0xabba
979 990
980#define PCI_VENDOR_ID_CMD 0x1095 991#define PCI_VENDOR_ID_CMD 0x1095
981#define PCI_DEVICE_ID_CMD_640 0x0640 992#define PCI_DEVICE_ID_CMD_640 0x0640
@@ -2187,7 +2198,12 @@
2187#define PCI_DEVICE_ID_ENE_1211 0x1211 2198#define PCI_DEVICE_ID_ENE_1211 0x1211
2188#define PCI_DEVICE_ID_ENE_1225 0x1225 2199#define PCI_DEVICE_ID_ENE_1225 0x1225
2189#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
2190#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
2191#define PCI_VENDOR_ID_CHELSIO 0x1425 2207#define PCI_VENDOR_ID_CHELSIO 0x1425
2192 2208
2193#define PCI_VENDOR_ID_MIPS 0x153f 2209#define PCI_VENDOR_ID_MIPS 0x153f
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
74extern struct posix_acl *posix_acl_alloc(int, unsigned int __nocast); 74extern struct posix_acl *posix_acl_alloc(int, gfp_t);
75extern struct posix_acl *posix_acl_clone(const struct posix_acl *, unsigned int __nocast); 75extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t);
76extern int posix_acl_valid(const struct posix_acl *); 76extern int posix_acl_valid(const struct posix_acl *);
77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
78extern struct posix_acl *posix_acl_from_mode(mode_t, unsigned int __nocast); 78extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t);
79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *);
80extern int posix_acl_create_masq(struct posix_acl *, mode_t *); 80extern int posix_acl_create_masq(struct posix_acl *, mode_t *);
81extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); 81extern 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);
50unsigned int 50unsigned int
51radix_tree_gang_lookup(struct radix_tree_root *root, void **results, 51radix_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);
53int radix_tree_preload(unsigned int __nocast gfp_mask); 53int radix_tree_preload(gfp_t gfp_mask);
54void radix_tree_init(void); 54void radix_tree_init(void);
55void *radix_tree_tag_set(struct radix_tree_root *root, 55void *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/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 *);
1006extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); 1018extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
1007extern int kill_pg_info(int, struct siginfo *, pid_t); 1019extern int kill_pg_info(int, struct siginfo *, pid_t);
1008extern int kill_proc_info(int, struct siginfo *, pid_t); 1020extern int kill_proc_info(int, struct siginfo *, pid_t);
1021extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t);
1009extern void do_notify_parent(struct task_struct *, int); 1022extern void do_notify_parent(struct task_struct *, int);
1010extern void force_sig(int, struct task_struct *); 1023extern void force_sig(int, struct task_struct *);
1011extern void force_sig_specific(int, struct task_struct *); 1024extern 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
2637static inline int security_sk_alloc(struct sock *sk, int family, 2637static 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
2755static inline int security_sk_alloc(struct sock *sk, int family, 2754static 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
158extern struct timeval skb_tv_base;
159
160struct skb_timeval { 158struct 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
305extern void __kfree_skb(struct sk_buff *skb); 303extern void __kfree_skb(struct sk_buff *skb);
306extern struct sk_buff *__alloc_skb(unsigned int size, 304extern struct sk_buff *__alloc_skb(unsigned int size,
307 unsigned int __nocast priority, int fclone); 305 gfp_t priority, int fclone);
308static inline struct sk_buff *alloc_skb(unsigned int size, 306static 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
314static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 312static 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
320extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, 318extern 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);
323extern void kfree_skbmem(struct sk_buff *skb); 321extern void kfree_skbmem(struct sk_buff *skb);
324extern struct sk_buff *skb_clone(struct sk_buff *skb, 322extern struct sk_buff *skb_clone(struct sk_buff *skb,
325 unsigned int __nocast priority); 323 gfp_t priority);
326extern struct sk_buff *skb_copy(const struct sk_buff *skb, 324extern struct sk_buff *skb_copy(const struct sk_buff *skb,
327 unsigned int __nocast priority); 325 gfp_t priority);
328extern struct sk_buff *pskb_copy(struct sk_buff *skb, 326extern struct sk_buff *pskb_copy(struct sk_buff *skb,
329 unsigned int __nocast gfp_mask); 327 gfp_t gfp_mask);
330extern int pskb_expand_head(struct sk_buff *skb, 328extern 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);
333extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, 331extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
334 unsigned int headroom); 332 unsigned int headroom);
335extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 333extern 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);
338extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 336extern 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)
340extern void skb_over_panic(struct sk_buff *skb, int len, 338extern 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 */
488static inline struct sk_buff *skb_share_check(struct sk_buff *skb, 486static 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 */
520static inline struct sk_buff *skb_unshare(struct sk_buff *skb, 518static 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 */
1021static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1019static 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 */
1135extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); 1133extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp);
1136static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) 1134static 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 */
1273static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) 1267static 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
1279extern void __net_timestamp(struct sk_buff *skb); 1273extern 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));
62extern int kmem_cache_destroy(kmem_cache_t *); 62extern int kmem_cache_destroy(kmem_cache_t *);
63extern int kmem_cache_shrink(kmem_cache_t *); 63extern int kmem_cache_shrink(kmem_cache_t *);
64extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); 64extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t);
65extern void kmem_cache_free(kmem_cache_t *, void *); 65extern void kmem_cache_free(kmem_cache_t *, void *);
66extern unsigned int kmem_cache_size(kmem_cache_t *); 66extern unsigned int kmem_cache_size(kmem_cache_t *);
67extern const char *kmem_cache_name(kmem_cache_t *); 67extern const char *kmem_cache_name(kmem_cache_t *);
68extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); 68extern 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. */
71struct cache_sizes { 71struct cache_sizes {
@@ -74,9 +74,9 @@ struct cache_sizes {
74 kmem_cache_t *cs_dmacachep; 74 kmem_cache_t *cs_dmacachep;
75}; 75};
76extern struct cache_sizes malloc_sizes[]; 76extern struct cache_sizes malloc_sizes[];
77extern void *__kmalloc(size_t, unsigned int __nocast); 77extern void *__kmalloc(size_t, gfp_t);
78 78
79static inline void *kmalloc(size_t size, unsigned int __nocast flags) 79static 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
102extern void *kzalloc(size_t, unsigned int __nocast); 102extern 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 */
110static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) 110static 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 *);
118extern unsigned int ksize(const void *); 118extern unsigned int ksize(const void *);
119 119
120#ifdef CONFIG_NUMA 120#ifdef CONFIG_NUMA
121extern void *kmem_cache_alloc_node(kmem_cache_t *, 121extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
122 unsigned int __nocast flags, int node); 122extern void *kmalloc_node(size_t size, gfp_t flags, int node);
123extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node);
124#else 123#else
125static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) 124static 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}
129static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) 128static 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);
88extern void * memchr(const void *,int,__kernel_size_t); 88extern void * memchr(const void *,int,__kernel_size_t);
89#endif 89#endif
90 90
91extern char *kstrdup(const char *s, unsigned int __nocast gfp); 91extern 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);
71struct saved_context; 71struct saved_context;
72void __save_processor_state(struct saved_context *ctxt); 72void __save_processor_state(struct saved_context *ctxt);
73void __restore_processor_state(struct saved_context *ctxt); 73void __restore_processor_state(struct saved_context *ctxt);
74extern unsigned long get_usable_page(unsigned gfp_mask);
75extern 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 */
150extern void out_of_memory(unsigned int __nocast gfp_mask, int order); 150extern void out_of_memory(gfp_t gfp_mask, int order);
151 151
152/* linux/mm/memory.c */ 152/* linux/mm/memory.c */
153extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 153extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
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 */
527enum {
528 NET_LLC2=1,
529 NET_LLC_STATION=2,
530};
531
532/* /proc/sys/net/llc/llc2 */
533enum {
534 NET_LLC2_TIMEOUT=1,
535};
536
537/* /proc/sys/net/llc/station */
538enum {
539 NET_LLC_STATION_ACK_TIMEOUT=1,
540};
541
542/* /proc/sys/net/llc/llc2/timeout */
543enum {
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 */
527enum { 551enum {
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
161static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) 161static 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/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;
165typedef __u64 __bitwise __be64; 165typedef __u64 __bitwise __be64;
166#endif 166#endif
167 167
168#ifdef __KERNEL__
169typedef unsigned __nocast gfp_t;
170#endif
171
168struct ustat { 172struct 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 {
34extern void *vmalloc(unsigned long size); 34extern void *vmalloc(unsigned long size);
35extern void *vmalloc_exec(unsigned long size); 35extern void *vmalloc_exec(unsigned long size);
36extern void *vmalloc_32(unsigned long size); 36extern void *vmalloc_32(unsigned long size);
37extern void *__vmalloc(unsigned long size, unsigned int __nocast gfp_mask, pgprot_t prot); 37extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
38extern void *__vmalloc_area(struct vm_struct *area, unsigned int __nocast gfp_mask, pgprot_t prot); 38extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot);
39extern void vfree(void *addr); 39extern void vfree(void *addr);
40 40
41extern void *vmap(struct page **pages, unsigned int count, 41extern void *vmap(struct page **pages, unsigned int count,