diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 12:17:52 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 12:17:52 -0400 |
commit | 90890687859ea658759e653c4e70ed7e9e1a6217 (patch) | |
tree | 9065b30bb189e16ef99b8b5a0d444558f8dc579f /include/linux | |
parent | 2995bfb7855aabd493f840af361f3dd7d221caea (diff) | |
parent | 5fadd053d9bb4345ec6f405d24db4e7eb49cf81e (diff) |
Merge branch 'master'
Diffstat (limited to 'include/linux')
89 files changed, 1085 insertions, 648 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 1993a3691768..19f70462b3be 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -162,13 +162,13 @@ typedef struct acct acct_t; | |||
162 | #ifdef __KERNEL__ | 162 | #ifdef __KERNEL__ |
163 | /* | 163 | /* |
164 | * Yet another set of HZ to *HZ helper functions. | 164 | * Yet another set of HZ to *HZ helper functions. |
165 | * See <linux/times.h> for the original. | 165 | * See <linux/jiffies.h> for the original. |
166 | */ | 166 | */ |
167 | 167 | ||
168 | static inline u32 jiffies_to_AHZ(unsigned long x) | 168 | static inline u32 jiffies_to_AHZ(unsigned long x) |
169 | { | 169 | { |
170 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 | 170 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 |
171 | return x / (HZ / USER_HZ); | 171 | return x / (HZ / AHZ); |
172 | #else | 172 | #else |
173 | u64 tmp = (u64)x * TICK_NSEC; | 173 | u64 tmp = (u64)x * TICK_NSEC; |
174 | do_div(tmp, (NSEC_PER_SEC / AHZ)); | 174 | do_div(tmp, (NSEC_PER_SEC / AHZ)); |
diff --git a/include/linux/aio.h b/include/linux/aio.h index a4d5af907f90..0decf66117c1 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -24,7 +24,12 @@ struct kioctx; | |||
24 | #define KIOCB_SYNC_KEY (~0U) | 24 | #define KIOCB_SYNC_KEY (~0U) |
25 | 25 | ||
26 | /* ki_flags bits */ | 26 | /* ki_flags bits */ |
27 | #define KIF_LOCKED 0 | 27 | /* |
28 | * This may be used for cancel/retry serialization in the future, but | ||
29 | * for now it's unused and we probably don't want modules to even | ||
30 | * think they can use it. | ||
31 | */ | ||
32 | /* #define KIF_LOCKED 0 */ | ||
28 | #define KIF_KICKED 1 | 33 | #define KIF_KICKED 1 |
29 | #define KIF_CANCELLED 2 | 34 | #define KIF_CANCELLED 2 |
30 | 35 | ||
@@ -43,6 +48,40 @@ struct kioctx; | |||
43 | #define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) | 48 | #define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) |
44 | #define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) | 49 | #define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) |
45 | 50 | ||
51 | /* is there a better place to document function pointer methods? */ | ||
52 | /** | ||
53 | * ki_retry - iocb forward progress callback | ||
54 | * @kiocb: The kiocb struct to advance by performing an operation. | ||
55 | * | ||
56 | * This callback is called when the AIO core wants a given AIO operation | ||
57 | * to make forward progress. The kiocb argument describes the operation | ||
58 | * that is to be performed. As the operation proceeds, perhaps partially, | ||
59 | * ki_retry is expected to update the kiocb with progress made. Typically | ||
60 | * ki_retry is set in the AIO core and it itself calls file_operations | ||
61 | * helpers. | ||
62 | * | ||
63 | * ki_retry's return value determines when the AIO operation is completed | ||
64 | * and an event is generated in the AIO event ring. Except the special | ||
65 | * return values described below, the value that is returned from ki_retry | ||
66 | * is transferred directly into the completion ring as the operation's | ||
67 | * resulting status. Once this has happened ki_retry *MUST NOT* reference | ||
68 | * the kiocb pointer again. | ||
69 | * | ||
70 | * If ki_retry returns -EIOCBQUEUED it has made a promise that aio_complete() | ||
71 | * will be called on the kiocb pointer in the future. The AIO core will | ||
72 | * not ask the method again -- ki_retry must ensure forward progress. | ||
73 | * aio_complete() must be called once and only once in the future, multiple | ||
74 | * calls may result in undefined behaviour. | ||
75 | * | ||
76 | * If ki_retry returns -EIOCBRETRY it has made a promise that kick_iocb() | ||
77 | * will be called on the kiocb pointer in the future. This may happen | ||
78 | * through generic helpers that associate kiocb->ki_wait with a wait | ||
79 | * queue head that ki_retry uses via current->io_wait. It can also happen | ||
80 | * with custom tracking and manual calls to kick_iocb(), though that is | ||
81 | * discouraged. In either case, kick_iocb() must be called once and only | ||
82 | * once. ki_retry must ensure forward progress, the AIO core will wait | ||
83 | * indefinitely for kick_iocb() to be called. | ||
84 | */ | ||
46 | struct kiocb { | 85 | struct kiocb { |
47 | struct list_head ki_run_list; | 86 | struct list_head ki_run_list; |
48 | long ki_flags; | 87 | long ki_flags; |
diff --git a/include/linux/ata.h b/include/linux/ata.h index a5b74efab067..d2873b732bb1 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -42,13 +42,18 @@ enum { | |||
42 | ATA_SECT_SIZE = 512, | 42 | ATA_SECT_SIZE = 512, |
43 | 43 | ||
44 | ATA_ID_WORDS = 256, | 44 | ATA_ID_WORDS = 256, |
45 | ATA_ID_PROD_OFS = 27, | ||
46 | ATA_ID_FW_REV_OFS = 23, | ||
47 | ATA_ID_SERNO_OFS = 10, | 45 | ATA_ID_SERNO_OFS = 10, |
48 | ATA_ID_MAJOR_VER = 80, | 46 | ATA_ID_FW_REV_OFS = 23, |
49 | ATA_ID_PIO_MODES = 64, | 47 | ATA_ID_PROD_OFS = 27, |
48 | ATA_ID_OLD_PIO_MODES = 51, | ||
49 | ATA_ID_FIELD_VALID = 53, | ||
50 | ATA_ID_MWDMA_MODES = 63, | 50 | ATA_ID_MWDMA_MODES = 63, |
51 | ATA_ID_PIO_MODES = 64, | ||
52 | ATA_ID_EIDE_DMA_MIN = 65, | ||
53 | ATA_ID_EIDE_PIO = 67, | ||
54 | ATA_ID_EIDE_PIO_IORDY = 68, | ||
51 | ATA_ID_UDMA_MODES = 88, | 55 | ATA_ID_UDMA_MODES = 88, |
56 | ATA_ID_MAJOR_VER = 80, | ||
52 | ATA_ID_PIO4 = (1 << 1), | 57 | ATA_ID_PIO4 = (1 << 1), |
53 | 58 | ||
54 | ATA_PCI_CTL_OFS = 2, | 59 | ATA_PCI_CTL_OFS = 2, |
@@ -128,10 +133,15 @@ enum { | |||
128 | ATA_CMD_PIO_READ_EXT = 0x24, | 133 | ATA_CMD_PIO_READ_EXT = 0x24, |
129 | ATA_CMD_PIO_WRITE = 0x30, | 134 | ATA_CMD_PIO_WRITE = 0x30, |
130 | ATA_CMD_PIO_WRITE_EXT = 0x34, | 135 | ATA_CMD_PIO_WRITE_EXT = 0x34, |
136 | ATA_CMD_READ_MULTI = 0xC4, | ||
137 | ATA_CMD_READ_MULTI_EXT = 0x29, | ||
138 | ATA_CMD_WRITE_MULTI = 0xC5, | ||
139 | ATA_CMD_WRITE_MULTI_EXT = 0x39, | ||
131 | ATA_CMD_SET_FEATURES = 0xEF, | 140 | ATA_CMD_SET_FEATURES = 0xEF, |
132 | ATA_CMD_PACKET = 0xA0, | 141 | ATA_CMD_PACKET = 0xA0, |
133 | ATA_CMD_VERIFY = 0x40, | 142 | ATA_CMD_VERIFY = 0x40, |
134 | ATA_CMD_VERIFY_EXT = 0x42, | 143 | ATA_CMD_VERIFY_EXT = 0x42, |
144 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | ||
135 | 145 | ||
136 | /* SETFEATURES stuff */ | 146 | /* SETFEATURES stuff */ |
137 | SETFEATURES_XFER = 0x03, | 147 | SETFEATURES_XFER = 0x03, |
@@ -146,14 +156,14 @@ enum { | |||
146 | XFER_MW_DMA_2 = 0x22, | 156 | XFER_MW_DMA_2 = 0x22, |
147 | XFER_MW_DMA_1 = 0x21, | 157 | XFER_MW_DMA_1 = 0x21, |
148 | XFER_MW_DMA_0 = 0x20, | 158 | XFER_MW_DMA_0 = 0x20, |
159 | XFER_SW_DMA_2 = 0x12, | ||
160 | XFER_SW_DMA_1 = 0x11, | ||
161 | XFER_SW_DMA_0 = 0x10, | ||
149 | XFER_PIO_4 = 0x0C, | 162 | XFER_PIO_4 = 0x0C, |
150 | XFER_PIO_3 = 0x0B, | 163 | XFER_PIO_3 = 0x0B, |
151 | XFER_PIO_2 = 0x0A, | 164 | XFER_PIO_2 = 0x0A, |
152 | XFER_PIO_1 = 0x09, | 165 | XFER_PIO_1 = 0x09, |
153 | XFER_PIO_0 = 0x08, | 166 | XFER_PIO_0 = 0x08, |
154 | XFER_SW_DMA_2 = 0x12, | ||
155 | XFER_SW_DMA_1 = 0x11, | ||
156 | XFER_SW_DMA_0 = 0x10, | ||
157 | XFER_PIO_SLOW = 0x00, | 167 | XFER_PIO_SLOW = 0x00, |
158 | 168 | ||
159 | /* ATAPI stuff */ | 169 | /* ATAPI stuff */ |
@@ -181,6 +191,7 @@ enum { | |||
181 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ | 191 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ |
182 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ | 192 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ |
183 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ | 193 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ |
194 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ | ||
184 | }; | 195 | }; |
185 | 196 | ||
186 | enum ata_tf_protocols { | 197 | enum ata_tf_protocols { |
@@ -250,7 +261,19 @@ struct ata_taskfile { | |||
250 | ((u64) (id)[(n) + 1] << 16) | \ | 261 | ((u64) (id)[(n) + 1] << 16) | \ |
251 | ((u64) (id)[(n) + 0]) ) | 262 | ((u64) (id)[(n) + 0]) ) |
252 | 263 | ||
253 | static inline int atapi_cdb_len(u16 *dev_id) | 264 | static inline int ata_id_current_chs_valid(const u16 *id) |
265 | { | ||
266 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | ||
267 | has not been issued to the device then the values of | ||
268 | id[54] to id[56] are vendor specific. */ | ||
269 | return (id[53] & 0x01) && /* Current translation valid */ | ||
270 | id[54] && /* cylinders in current translation */ | ||
271 | id[55] && /* heads in current translation */ | ||
272 | id[55] <= 16 && | ||
273 | id[56]; /* sectors in current translation */ | ||
274 | } | ||
275 | |||
276 | static inline int atapi_cdb_len(const u16 *dev_id) | ||
254 | { | 277 | { |
255 | u16 tmp = dev_id[0] & 0x3; | 278 | u16 tmp = dev_id[0] & 0x3; |
256 | switch (tmp) { | 279 | switch (tmp) { |
@@ -260,7 +283,7 @@ static inline int atapi_cdb_len(u16 *dev_id) | |||
260 | } | 283 | } |
261 | } | 284 | } |
262 | 285 | ||
263 | static inline int is_atapi_taskfile(struct ata_taskfile *tf) | 286 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) |
264 | { | 287 | { |
265 | return (tf->protocol == ATA_PROT_ATAPI) || | 288 | return (tf->protocol == ATA_PROT_ATAPI) || |
266 | (tf->protocol == ATA_PROT_ATAPI_NODATA) || | 289 | (tf->protocol == ATA_PROT_ATAPI_NODATA) || |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 9f374cfa1b05..e7d0593bb576 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -76,6 +76,13 @@ struct atm_dev_stats { | |||
76 | /* set interface ESI */ | 76 | /* set interface ESI */ |
77 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) | 77 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) |
78 | /* force interface ESI */ | 78 | /* force interface ESI */ |
79 | #define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc) | ||
80 | /* register a LECS address */ | ||
81 | #define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc) | ||
82 | /* unregister a LECS address */ | ||
83 | #define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc) | ||
84 | /* retrieve LECS address(es) */ | ||
85 | |||
79 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) | 86 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) |
80 | /* get AAL layer statistics */ | 87 | /* get AAL layer statistics */ |
81 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) | 88 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) |
@@ -328,6 +335,8 @@ struct atm_dev_addr { | |||
328 | struct list_head entry; /* next address */ | 335 | struct list_head entry; /* next address */ |
329 | }; | 336 | }; |
330 | 337 | ||
338 | enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS }; | ||
339 | |||
331 | struct atm_dev { | 340 | struct atm_dev { |
332 | const struct atmdev_ops *ops; /* device operations; NULL if unused */ | 341 | const struct atmdev_ops *ops; /* device operations; NULL if unused */ |
333 | const struct atmphy_ops *phy; /* PHY operations, may be undefined */ | 342 | const struct atmphy_ops *phy; /* PHY operations, may be undefined */ |
@@ -338,6 +347,7 @@ struct atm_dev { | |||
338 | void *phy_data; /* private PHY date */ | 347 | void *phy_data; /* private PHY date */ |
339 | unsigned long flags; /* device flags (ATM_DF_*) */ | 348 | unsigned long flags; /* device flags (ATM_DF_*) */ |
340 | struct list_head local; /* local ATM addresses */ | 349 | struct list_head local; /* local ATM addresses */ |
350 | struct list_head lecs; /* LECS ATM addresses learned via ILMI */ | ||
341 | unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ | 351 | unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ |
342 | struct atm_cirange ci_range; /* VPI/VCI range */ | 352 | struct atm_cirange ci_range; /* VPI/VCI range */ |
343 | struct k_atm_dev_stats stats; /* statistics */ | 353 | struct k_atm_dev_stats stats; /* statistics */ |
@@ -457,7 +467,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
457 | 467 | ||
458 | int atm_charge(struct atm_vcc *vcc,int truesize); | 468 | int atm_charge(struct atm_vcc *vcc,int truesize); |
459 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, | 469 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, |
460 | int gfp_flags); | 470 | gfp_t gfp_flags); |
461 | int atm_pcr_goal(struct atm_trafprm *tp); | 471 | int atm_pcr_goal(struct atm_trafprm *tp); |
462 | 472 | ||
463 | void vcc_release_async(struct atm_vcc *vcc, int reply); | 473 | void vcc_release_async(struct atm_vcc *vcc, int reply); |
diff --git a/include/linux/audit.h b/include/linux/audit.h index b2a2509bd7ea..da3c01955f3d 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -260,11 +260,11 @@ extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | |||
260 | #ifdef CONFIG_AUDIT | 260 | #ifdef CONFIG_AUDIT |
261 | /* These are defined in audit.c */ | 261 | /* These are defined in audit.c */ |
262 | /* Public API */ | 262 | /* Public API */ |
263 | extern void audit_log(struct audit_context *ctx, int gfp_mask, | 263 | extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask, |
264 | int type, const char *fmt, ...) | 264 | int type, const char *fmt, ...) |
265 | __attribute__((format(printf,4,5))); | 265 | __attribute__((format(printf,4,5))); |
266 | 266 | ||
267 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask, int type); | 267 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type); |
268 | extern void audit_log_format(struct audit_buffer *ab, | 268 | extern void audit_log_format(struct audit_buffer *ab, |
269 | const char *fmt, ...) | 269 | const char *fmt, ...) |
270 | __attribute__((format(printf,2,3))); | 270 | __attribute__((format(printf,2,3))); |
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h index c1237aa92e38..8ed6dfdcd783 100644 --- a/include/linux/bfs_fs.h +++ b/include/linux/bfs_fs.h | |||
@@ -20,19 +20,19 @@ | |||
20 | 20 | ||
21 | /* BFS inode layout on disk */ | 21 | /* BFS inode layout on disk */ |
22 | struct bfs_inode { | 22 | struct bfs_inode { |
23 | __u16 i_ino; | 23 | __le16 i_ino; |
24 | __u16 i_unused; | 24 | __u16 i_unused; |
25 | __u32 i_sblock; | 25 | __le32 i_sblock; |
26 | __u32 i_eblock; | 26 | __le32 i_eblock; |
27 | __u32 i_eoffset; | 27 | __le32 i_eoffset; |
28 | __u32 i_vtype; | 28 | __le32 i_vtype; |
29 | __u32 i_mode; | 29 | __le32 i_mode; |
30 | __s32 i_uid; | 30 | __le32 i_uid; |
31 | __s32 i_gid; | 31 | __le32 i_gid; |
32 | __u32 i_nlink; | 32 | __le32 i_nlink; |
33 | __u32 i_atime; | 33 | __le32 i_atime; |
34 | __u32 i_mtime; | 34 | __le32 i_mtime; |
35 | __u32 i_ctime; | 35 | __le32 i_ctime; |
36 | __u32 i_padding[4]; | 36 | __u32 i_padding[4]; |
37 | }; | 37 | }; |
38 | 38 | ||
@@ -41,17 +41,17 @@ struct bfs_inode { | |||
41 | #define BFS_DIRS_PER_BLOCK 32 | 41 | #define BFS_DIRS_PER_BLOCK 32 |
42 | 42 | ||
43 | struct bfs_dirent { | 43 | struct bfs_dirent { |
44 | __u16 ino; | 44 | __le16 ino; |
45 | char name[BFS_NAMELEN]; | 45 | char name[BFS_NAMELEN]; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* BFS superblock layout on disk */ | 48 | /* BFS superblock layout on disk */ |
49 | struct bfs_super_block { | 49 | struct bfs_super_block { |
50 | __u32 s_magic; | 50 | __le32 s_magic; |
51 | __u32 s_start; | 51 | __le32 s_start; |
52 | __u32 s_end; | 52 | __le32 s_end; |
53 | __s32 s_from; | 53 | __le32 s_from; |
54 | __s32 s_to; | 54 | __le32 s_to; |
55 | __s32 s_bfrom; | 55 | __s32 s_bfrom; |
56 | __s32 s_bto; | 56 | __s32 s_bto; |
57 | char s_fsname[6]; | 57 | char s_fsname[6]; |
@@ -66,15 +66,15 @@ struct bfs_super_block { | |||
66 | #define BFS_INO2OFF(ino) \ | 66 | #define BFS_INO2OFF(ino) \ |
67 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) | 67 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) |
68 | #define BFS_NZFILESIZE(ip) \ | 68 | #define BFS_NZFILESIZE(ip) \ |
69 | ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE) | 69 | ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE) |
70 | 70 | ||
71 | #define BFS_FILESIZE(ip) \ | 71 | #define BFS_FILESIZE(ip) \ |
72 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) | 72 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) |
73 | 73 | ||
74 | #define BFS_FILEBLOCKS(ip) \ | 74 | #define BFS_FILEBLOCKS(ip) \ |
75 | ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock)) | 75 | ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock)) |
76 | #define BFS_UNCLEAN(bfs_sb, sb) \ | 76 | #define BFS_UNCLEAN(bfs_sb, sb) \ |
77 | ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) | 77 | ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) |
78 | 78 | ||
79 | 79 | ||
80 | #endif /* _LINUX_BFS_FS_H */ | 80 | #endif /* _LINUX_BFS_FS_H */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 6e1c79c8b6bf..685fd3720df5 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -276,8 +276,8 @@ extern void bio_pair_release(struct bio_pair *dbio); | |||
276 | extern struct bio_set *bioset_create(int, int, int); | 276 | extern struct bio_set *bioset_create(int, int, int); |
277 | extern void bioset_free(struct bio_set *); | 277 | extern void bioset_free(struct bio_set *); |
278 | 278 | ||
279 | extern struct bio *bio_alloc(unsigned int __nocast, int); | 279 | extern struct bio *bio_alloc(gfp_t, int); |
280 | extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); | 280 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
281 | extern void bio_put(struct bio *); | 281 | extern void bio_put(struct bio *); |
282 | extern void bio_free(struct bio *, struct bio_set *); | 282 | extern void bio_free(struct bio *, struct bio_set *); |
283 | 283 | ||
@@ -287,7 +287,7 @@ extern int bio_phys_segments(struct request_queue *, struct bio *); | |||
287 | extern int bio_hw_segments(struct request_queue *, struct bio *); | 287 | extern int bio_hw_segments(struct request_queue *, struct bio *); |
288 | 288 | ||
289 | extern void __bio_clone(struct bio *, struct bio *); | 289 | extern void __bio_clone(struct bio *, struct bio *); |
290 | extern struct bio *bio_clone(struct bio *, unsigned int __nocast); | 290 | extern struct bio *bio_clone(struct bio *, gfp_t); |
291 | 291 | ||
292 | extern void bio_init(struct bio *); | 292 | extern void bio_init(struct bio *); |
293 | 293 | ||
@@ -301,7 +301,7 @@ extern struct bio *bio_map_user_iov(struct request_queue *, | |||
301 | struct sg_iovec *, int, int); | 301 | struct sg_iovec *, int, int); |
302 | extern void bio_unmap_user(struct bio *); | 302 | extern void bio_unmap_user(struct bio *); |
303 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | 303 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, |
304 | unsigned int); | 304 | gfp_t); |
305 | extern void bio_set_pages_dirty(struct bio *bio); | 305 | extern void bio_set_pages_dirty(struct bio *bio); |
306 | extern void bio_check_pages_dirty(struct bio *bio); | 306 | extern void bio_check_pages_dirty(struct bio *bio); |
307 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); | 307 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index efdc9b5bc05c..025a7f084dbd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -96,8 +96,8 @@ struct io_context { | |||
96 | 96 | ||
97 | void put_io_context(struct io_context *ioc); | 97 | void put_io_context(struct io_context *ioc); |
98 | void exit_io_context(void); | 98 | void exit_io_context(void); |
99 | struct io_context *current_io_context(int gfp_flags); | 99 | struct io_context *current_io_context(gfp_t gfp_flags); |
100 | struct io_context *get_io_context(int gfp_flags); | 100 | struct io_context *get_io_context(gfp_t gfp_flags); |
101 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 101 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
102 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | 102 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); |
103 | 103 | ||
@@ -107,9 +107,9 @@ typedef void (rq_end_io_fn)(struct request *); | |||
107 | struct request_list { | 107 | struct request_list { |
108 | int count[2]; | 108 | int count[2]; |
109 | int starved[2]; | 109 | int starved[2]; |
110 | int elvpriv; | ||
110 | mempool_t *rq_pool; | 111 | mempool_t *rq_pool; |
111 | wait_queue_head_t wait[2]; | 112 | wait_queue_head_t wait[2]; |
112 | wait_queue_head_t drain; | ||
113 | }; | 113 | }; |
114 | 114 | ||
115 | #define BLK_MAX_CDB 16 | 115 | #define BLK_MAX_CDB 16 |
@@ -203,6 +203,7 @@ struct request { | |||
203 | enum rq_flag_bits { | 203 | enum rq_flag_bits { |
204 | __REQ_RW, /* not set, read. set, write */ | 204 | __REQ_RW, /* not set, read. set, write */ |
205 | __REQ_FAILFAST, /* no low level driver retries */ | 205 | __REQ_FAILFAST, /* no low level driver retries */ |
206 | __REQ_SORTED, /* elevator knows about this request */ | ||
206 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 207 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
207 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | 208 | __REQ_HARDBARRIER, /* may not be passed by drive either */ |
208 | __REQ_CMD, /* is a regular fs rw request */ | 209 | __REQ_CMD, /* is a regular fs rw request */ |
@@ -210,6 +211,7 @@ enum rq_flag_bits { | |||
210 | __REQ_STARTED, /* drive already may have started this one */ | 211 | __REQ_STARTED, /* drive already may have started this one */ |
211 | __REQ_DONTPREP, /* don't call prep for this one */ | 212 | __REQ_DONTPREP, /* don't call prep for this one */ |
212 | __REQ_QUEUED, /* uses queueing */ | 213 | __REQ_QUEUED, /* uses queueing */ |
214 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
213 | /* | 215 | /* |
214 | * for ATA/ATAPI devices | 216 | * for ATA/ATAPI devices |
215 | */ | 217 | */ |
@@ -235,6 +237,7 @@ enum rq_flag_bits { | |||
235 | 237 | ||
236 | #define REQ_RW (1 << __REQ_RW) | 238 | #define REQ_RW (1 << __REQ_RW) |
237 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | 239 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) |
240 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
238 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | 241 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) |
239 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | 242 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) |
240 | #define REQ_CMD (1 << __REQ_CMD) | 243 | #define REQ_CMD (1 << __REQ_CMD) |
@@ -242,6 +245,7 @@ enum rq_flag_bits { | |||
242 | #define REQ_STARTED (1 << __REQ_STARTED) | 245 | #define REQ_STARTED (1 << __REQ_STARTED) |
243 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | 246 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) |
244 | #define REQ_QUEUED (1 << __REQ_QUEUED) | 247 | #define REQ_QUEUED (1 << __REQ_QUEUED) |
248 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
245 | #define REQ_PC (1 << __REQ_PC) | 249 | #define REQ_PC (1 << __REQ_PC) |
246 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) | 250 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) |
247 | #define REQ_SENSE (1 << __REQ_SENSE) | 251 | #define REQ_SENSE (1 << __REQ_SENSE) |
@@ -333,6 +337,12 @@ struct request_queue | |||
333 | end_flush_fn *end_flush_fn; | 337 | end_flush_fn *end_flush_fn; |
334 | 338 | ||
335 | /* | 339 | /* |
340 | * Dispatch queue sorting | ||
341 | */ | ||
342 | sector_t end_sector; | ||
343 | struct request *boundary_rq; | ||
344 | |||
345 | /* | ||
336 | * Auto-unplugging state | 346 | * Auto-unplugging state |
337 | */ | 347 | */ |
338 | struct timer_list unplug_timer; | 348 | struct timer_list unplug_timer; |
@@ -354,7 +364,7 @@ struct request_queue | |||
354 | * queue needs bounce pages for pages above this limit | 364 | * queue needs bounce pages for pages above this limit |
355 | */ | 365 | */ |
356 | unsigned long bounce_pfn; | 366 | unsigned long bounce_pfn; |
357 | unsigned int bounce_gfp; | 367 | gfp_t bounce_gfp; |
358 | 368 | ||
359 | /* | 369 | /* |
360 | * various queue flags, see QUEUE_* below | 370 | * various queue flags, see QUEUE_* below |
@@ -405,8 +415,6 @@ struct request_queue | |||
405 | unsigned int sg_reserved_size; | 415 | unsigned int sg_reserved_size; |
406 | int node; | 416 | int node; |
407 | 417 | ||
408 | struct list_head drain_list; | ||
409 | |||
410 | /* | 418 | /* |
411 | * reserved for flush operations | 419 | * reserved for flush operations |
412 | */ | 420 | */ |
@@ -434,7 +442,7 @@ enum { | |||
434 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 442 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
435 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 443 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
436 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 444 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ |
437 | #define QUEUE_FLAG_DRAIN 8 /* draining queue for sched switch */ | 445 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ |
438 | #define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ | 446 | #define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ |
439 | 447 | ||
440 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 448 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
@@ -454,6 +462,7 @@ enum { | |||
454 | #define blk_pm_request(rq) \ | 462 | #define blk_pm_request(rq) \ |
455 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) | 463 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) |
456 | 464 | ||
465 | #define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) | ||
457 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) | 466 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) |
458 | #define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) | 467 | #define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) |
459 | #define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) | 468 | #define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) |
@@ -550,7 +559,7 @@ extern void generic_make_request(struct bio *bio); | |||
550 | extern void blk_put_request(struct request *); | 559 | extern void blk_put_request(struct request *); |
551 | extern void blk_end_sync_rq(struct request *rq); | 560 | extern void blk_end_sync_rq(struct request *rq); |
552 | extern void blk_attempt_remerge(request_queue_t *, struct request *); | 561 | extern void blk_attempt_remerge(request_queue_t *, struct request *); |
553 | extern struct request *blk_get_request(request_queue_t *, int, int); | 562 | extern struct request *blk_get_request(request_queue_t *, int, gfp_t); |
554 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); | 563 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); |
555 | extern void blk_requeue_request(request_queue_t *, struct request *); | 564 | extern void blk_requeue_request(request_queue_t *, struct request *); |
556 | extern void blk_plug_device(request_queue_t *); | 565 | extern void blk_plug_device(request_queue_t *); |
@@ -565,7 +574,7 @@ extern void blk_run_queue(request_queue_t *); | |||
565 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 574 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
566 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); | 575 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); |
567 | extern int blk_rq_unmap_user(struct bio *, unsigned int); | 576 | extern int blk_rq_unmap_user(struct bio *, unsigned int); |
568 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); | 577 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); |
569 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); | 578 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); |
570 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, | 579 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, |
571 | struct request *, int); | 580 | struct request *, int); |
@@ -611,12 +620,21 @@ extern void end_request(struct request *req, int uptodate); | |||
611 | 620 | ||
612 | static inline void blkdev_dequeue_request(struct request *req) | 621 | static inline void blkdev_dequeue_request(struct request *req) |
613 | { | 622 | { |
614 | BUG_ON(list_empty(&req->queuelist)); | 623 | elv_dequeue_request(req->q, req); |
624 | } | ||
615 | 625 | ||
616 | list_del_init(&req->queuelist); | 626 | /* |
627 | * This should be in elevator.h, but that requires pulling in rq and q | ||
628 | */ | ||
629 | static inline void elv_dispatch_add_tail(struct request_queue *q, | ||
630 | struct request *rq) | ||
631 | { | ||
632 | if (q->last_merge == rq) | ||
633 | q->last_merge = NULL; | ||
617 | 634 | ||
618 | if (req->rl) | 635 | q->end_sector = rq_end_sector(rq); |
619 | elv_remove_request(req->q, req); | 636 | q->boundary_rq = rq; |
637 | list_add_tail(&rq->queuelist, &q->queue_head); | ||
620 | } | 638 | } |
621 | 639 | ||
622 | /* | 640 | /* |
@@ -650,12 +668,10 @@ extern void blk_dump_rq_flags(struct request *, char *); | |||
650 | extern void generic_unplug_device(request_queue_t *); | 668 | extern void generic_unplug_device(request_queue_t *); |
651 | extern void __generic_unplug_device(request_queue_t *); | 669 | extern void __generic_unplug_device(request_queue_t *); |
652 | extern long nr_blockdev_pages(void); | 670 | extern long nr_blockdev_pages(void); |
653 | extern void blk_wait_queue_drained(request_queue_t *, int); | ||
654 | extern void blk_finish_queue_drain(request_queue_t *); | ||
655 | 671 | ||
656 | int blk_get_queue(request_queue_t *); | 672 | int blk_get_queue(request_queue_t *); |
657 | request_queue_t *blk_alloc_queue(int gfp_mask); | 673 | request_queue_t *blk_alloc_queue(gfp_t); |
658 | request_queue_t *blk_alloc_queue_node(int,int); | 674 | request_queue_t *blk_alloc_queue_node(gfp_t, int); |
659 | #define blk_put_queue(q) blk_cleanup_queue((q)) | 675 | #define blk_put_queue(q) blk_cleanup_queue((q)) |
660 | 676 | ||
661 | /* | 677 | /* |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 82bd8842d11c..3b03b0b868dd 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -43,7 +43,7 @@ typedef struct bootmem_data { | |||
43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); | 43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); |
44 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); | 44 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); |
45 | extern void __init free_bootmem (unsigned long addr, unsigned long size); | 45 | extern void __init free_bootmem (unsigned long addr, unsigned long size); |
46 | extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); | 46 | extern void * __init __alloc_bootmem_limit (unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); |
47 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 47 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
48 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | 48 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); |
49 | #define alloc_bootmem(x) \ | 49 | #define alloc_bootmem(x) \ |
@@ -54,6 +54,16 @@ extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | |||
54 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 54 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
55 | #define alloc_bootmem_low_pages(x) \ | 55 | #define alloc_bootmem_low_pages(x) \ |
56 | __alloc_bootmem((x), PAGE_SIZE, 0) | 56 | __alloc_bootmem((x), PAGE_SIZE, 0) |
57 | |||
58 | #define alloc_bootmem_limit(x, limit) \ | ||
59 | __alloc_bootmem_limit((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit)) | ||
60 | #define alloc_bootmem_low_limit(x, limit) \ | ||
61 | __alloc_bootmem_limit((x), SMP_CACHE_BYTES, 0, (limit)) | ||
62 | #define alloc_bootmem_pages_limit(x, limit) \ | ||
63 | __alloc_bootmem_limit((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit)) | ||
64 | #define alloc_bootmem_low_pages_limit(x, limit) \ | ||
65 | __alloc_bootmem_limit((x), PAGE_SIZE, 0, (limit)) | ||
66 | |||
57 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 67 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
58 | extern unsigned long __init free_all_bootmem (void); | 68 | extern unsigned long __init free_all_bootmem (void); |
59 | 69 | ||
@@ -61,7 +71,7 @@ extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long f | |||
61 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); | 71 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); |
62 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); | 72 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); |
63 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); | 73 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); |
64 | extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); | 74 | extern void * __init __alloc_bootmem_node_limit (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); |
65 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 75 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
66 | #define alloc_bootmem_node(pgdat, x) \ | 76 | #define alloc_bootmem_node(pgdat, x) \ |
67 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 77 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
@@ -69,6 +79,14 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, | |||
69 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 79 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
70 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 80 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
71 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) | 81 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) |
82 | |||
83 | #define alloc_bootmem_node_limit(pgdat, x, limit) \ | ||
84 | __alloc_bootmem_node_limit((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit)) | ||
85 | #define alloc_bootmem_pages_node_limit(pgdat, x, limit) \ | ||
86 | __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit)) | ||
87 | #define alloc_bootmem_low_pages_node_limit(pgdat, x, limit) \ | ||
88 | __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, 0, (limit)) | ||
89 | |||
72 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 90 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
73 | 91 | ||
74 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 92 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
@@ -105,5 +123,15 @@ extern void *__init alloc_large_system_hash(const char *tablename, | |||
105 | #endif | 123 | #endif |
106 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ | 124 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ |
107 | 125 | ||
126 | static inline void *__alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal) | ||
127 | { | ||
128 | return __alloc_bootmem_limit(size, align, goal, 0); | ||
129 | } | ||
130 | |||
131 | static inline void *__alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, | ||
132 | unsigned long goal) | ||
133 | { | ||
134 | return __alloc_bootmem_node_limit(pgdat, size, align, goal, 0); | ||
135 | } | ||
108 | 136 | ||
109 | #endif /* _LINUX_BOOTMEM_H */ | 137 | #endif /* _LINUX_BOOTMEM_H */ |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 90828493791f..88af42f5e04a 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -172,7 +172,7 @@ void __brelse(struct buffer_head *); | |||
172 | void __bforget(struct buffer_head *); | 172 | void __bforget(struct buffer_head *); |
173 | void __breadahead(struct block_device *, sector_t block, int size); | 173 | void __breadahead(struct block_device *, sector_t block, int size); |
174 | struct buffer_head *__bread(struct block_device *, sector_t block, int size); | 174 | struct buffer_head *__bread(struct block_device *, sector_t block, int size); |
175 | struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags); | 175 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); |
176 | void free_buffer_head(struct buffer_head * bh); | 176 | void free_buffer_head(struct buffer_head * bh); |
177 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); | 177 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); |
178 | void FASTCALL(__lock_buffer(struct buffer_head *bh)); | 178 | void FASTCALL(__lock_buffer(struct buffer_head *bh)); |
@@ -188,7 +188,7 @@ extern int buffer_heads_over_limit; | |||
188 | * Generic address_space_operations implementations for buffer_head-backed | 188 | * Generic address_space_operations implementations for buffer_head-backed |
189 | * address_spaces. | 189 | * address_spaces. |
190 | */ | 190 | */ |
191 | int try_to_release_page(struct page * page, int gfp_mask); | 191 | int try_to_release_page(struct page * page, gfp_t gfp_mask); |
192 | int block_invalidatepage(struct page *page, unsigned long offset); | 192 | int block_invalidatepage(struct page *page, unsigned long offset); |
193 | int block_write_full_page(struct page *page, get_block_t *get_block, | 193 | int block_write_full_page(struct page *page, get_block_t *get_block, |
194 | struct writeback_control *wbc); | 194 | struct writeback_control *wbc); |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 96de26301f84..95952cc1f525 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -104,12 +104,19 @@ struct cn_queue_dev { | |||
104 | struct sock *nls; | 104 | struct sock *nls; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | struct cn_callback { | 107 | struct cn_callback_id { |
108 | unsigned char name[CN_CBQ_NAMELEN]; | 108 | unsigned char name[CN_CBQ_NAMELEN]; |
109 | |||
110 | struct cb_id id; | 109 | struct cb_id id; |
110 | }; | ||
111 | |||
112 | struct cn_callback_data { | ||
113 | void (*destruct_data) (void *); | ||
114 | void *ddata; | ||
115 | |||
116 | void *callback_priv; | ||
111 | void (*callback) (void *); | 117 | void (*callback) (void *); |
112 | void *priv; | 118 | |
119 | void *free; | ||
113 | }; | 120 | }; |
114 | 121 | ||
115 | struct cn_callback_entry { | 122 | struct cn_callback_entry { |
@@ -118,8 +125,8 @@ struct cn_callback_entry { | |||
118 | struct work_struct work; | 125 | struct work_struct work; |
119 | struct cn_queue_dev *pdev; | 126 | struct cn_queue_dev *pdev; |
120 | 127 | ||
121 | void (*destruct_data) (void *); | 128 | struct cn_callback_id id; |
122 | void *ddata; | 129 | struct cn_callback_data data; |
123 | 130 | ||
124 | int seq, group; | 131 | int seq, group; |
125 | struct sock *nls; | 132 | struct sock *nls; |
@@ -142,9 +149,9 @@ struct cn_dev { | |||
142 | 149 | ||
143 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | 150 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); |
144 | void cn_del_callback(struct cb_id *); | 151 | void cn_del_callback(struct cb_id *); |
145 | int cn_netlink_send(struct cn_msg *, u32, int); | 152 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); |
146 | 153 | ||
147 | int cn_queue_add_callback(struct cn_queue_dev *dev, struct cn_callback *cb); | 154 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); |
148 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 155 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
149 | 156 | ||
150 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); | 157 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); |
@@ -152,6 +159,8 @@ void cn_queue_free_dev(struct cn_queue_dev *dev); | |||
152 | 159 | ||
153 | int cn_cb_equal(struct cb_id *, struct cb_id *); | 160 | int cn_cb_equal(struct cb_id *, struct cb_id *); |
154 | 161 | ||
162 | void cn_queue_wrapper(void *data); | ||
163 | |||
155 | extern int cn_already_initialized; | 164 | extern int cn_already_initialized; |
156 | 165 | ||
157 | #endif /* __KERNEL__ */ | 166 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index b15826f6e3a2..9bdba8169b41 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -392,4 +392,14 @@ extern cpumask_t cpu_present_map; | |||
392 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | 392 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) |
393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
394 | 394 | ||
395 | /* Find the highest possible smp_processor_id() */ | ||
396 | #define highest_possible_processor_id() \ | ||
397 | ({ \ | ||
398 | unsigned int cpu, highest = 0; \ | ||
399 | for_each_cpu_mask(cpu, cpu_possible_map) \ | ||
400 | highest = cpu; \ | ||
401 | highest; \ | ||
402 | }) | ||
403 | |||
404 | |||
395 | #endif /* __LINUX_CPUMASK_H */ | 405 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 24062a1dbf61..6e2deef96b34 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -23,7 +23,7 @@ void cpuset_init_current_mems_allowed(void); | |||
23 | void cpuset_update_current_mems_allowed(void); | 23 | void cpuset_update_current_mems_allowed(void); |
24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); | 24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); |
25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); | 25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); |
26 | extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); | 26 | extern int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask); |
27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); | 27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); |
28 | extern struct file_operations proc_cpuset_operations; | 28 | extern struct file_operations proc_cpuset_operations; |
29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | 29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); |
@@ -49,8 +49,7 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) | |||
49 | return 1; | 49 | return 1; |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline int cpuset_zone_allowed(struct zone *z, | 52 | static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) |
53 | unsigned int __nocast gfp_mask) | ||
54 | { | 53 | { |
55 | return 1; | 54 | return 1; |
56 | } | 55 | } |
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h index 04fa7dff079c..300d704bdb9a 100644 --- a/include/linux/cyclomx.h +++ b/include/linux/cyclomx.h | |||
@@ -37,8 +37,6 @@ | |||
37 | #include <linux/cycx_x25.h> | 37 | #include <linux/cycx_x25.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) | ||
41 | |||
42 | /* Adapter Data Space. | 40 | /* Adapter Data Space. |
43 | * This structure is needed because we handle multiple cards, otherwise | 41 | * This structure is needed because we handle multiple cards, otherwise |
44 | * static data would do it. | 42 | * static data would do it. |
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h index 6621df86a748..12fe6b0bfcff 100644 --- a/include/linux/cycx_drv.h +++ b/include/linux/cycx_drv.h | |||
@@ -60,6 +60,5 @@ extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | |||
60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | 60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); |
61 | extern int cycx_exec(void __iomem *addr); | 61 | extern int cycx_exec(void __iomem *addr); |
62 | 62 | ||
63 | extern void cycx_inten(struct cycx_hw *hw); | ||
64 | extern void cycx_intr(struct cycx_hw *hw); | 63 | extern void cycx_intr(struct cycx_hw *hw); |
65 | #endif /* _CYCX_DRV_H */ | 64 | #endif /* _CYCX_DRV_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 06e5d42f2c7b..95d607a48f06 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -317,6 +317,11 @@ dev_set_drvdata (struct device *dev, void *data) | |||
317 | dev->driver_data = data; | 317 | dev->driver_data = data; |
318 | } | 318 | } |
319 | 319 | ||
320 | static inline int device_is_registered(struct device *dev) | ||
321 | { | ||
322 | return klist_node_attached(&dev->knode_bus); | ||
323 | } | ||
324 | |||
320 | /* | 325 | /* |
321 | * High level routines for use by the bus drivers | 326 | * High level routines for use by the bus drivers |
322 | */ | 327 | */ |
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h index 4932ee5c77f0..76f12f46db7f 100644 --- a/include/linux/dmapool.h +++ b/include/linux/dmapool.h | |||
@@ -19,7 +19,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, | |||
19 | 19 | ||
20 | void dma_pool_destroy(struct dma_pool *pool); | 20 | void dma_pool_destroy(struct dma_pool *pool); |
21 | 21 | ||
22 | void *dma_pool_alloc(struct dma_pool *pool, unsigned int __nocast mem_flags, | 22 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, |
23 | dma_addr_t *handle); | 23 | dma_addr_t *handle); |
24 | 24 | ||
25 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); | 25 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index ea6bbc2d7407..a74c27e460ba 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -8,18 +8,17 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc | |||
8 | 8 | ||
9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); | 9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); |
10 | 10 | ||
11 | typedef struct request *(elevator_next_req_fn) (request_queue_t *); | 11 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); |
12 | 12 | ||
13 | typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, int); | 13 | typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); |
14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); | 14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); |
15 | typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *); | ||
16 | typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *); | ||
17 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); | 15 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); |
18 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | 16 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); |
19 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); | 17 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); |
20 | 18 | ||
21 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int); | 19 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); |
22 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | 20 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); |
21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | ||
23 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
24 | 23 | ||
25 | typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); | 24 | typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); |
@@ -31,10 +30,9 @@ struct elevator_ops | |||
31 | elevator_merged_fn *elevator_merged_fn; | 30 | elevator_merged_fn *elevator_merged_fn; |
32 | elevator_merge_req_fn *elevator_merge_req_fn; | 31 | elevator_merge_req_fn *elevator_merge_req_fn; |
33 | 32 | ||
34 | elevator_next_req_fn *elevator_next_req_fn; | 33 | elevator_dispatch_fn *elevator_dispatch_fn; |
35 | elevator_add_req_fn *elevator_add_req_fn; | 34 | elevator_add_req_fn *elevator_add_req_fn; |
36 | elevator_remove_req_fn *elevator_remove_req_fn; | 35 | elevator_activate_req_fn *elevator_activate_req_fn; |
37 | elevator_requeue_req_fn *elevator_requeue_req_fn; | ||
38 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; | 36 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; |
39 | 37 | ||
40 | elevator_queue_empty_fn *elevator_queue_empty_fn; | 38 | elevator_queue_empty_fn *elevator_queue_empty_fn; |
@@ -81,15 +79,15 @@ struct elevator_queue | |||
81 | /* | 79 | /* |
82 | * block elevator interface | 80 | * block elevator interface |
83 | */ | 81 | */ |
82 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | ||
84 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 83 | extern void elv_add_request(request_queue_t *, struct request *, int, int); |
85 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 84 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); |
86 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 85 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); |
87 | extern void elv_merge_requests(request_queue_t *, struct request *, | 86 | extern void elv_merge_requests(request_queue_t *, struct request *, |
88 | struct request *); | 87 | struct request *); |
89 | extern void elv_merged_request(request_queue_t *, struct request *); | 88 | extern void elv_merged_request(request_queue_t *, struct request *); |
90 | extern void elv_remove_request(request_queue_t *, struct request *); | 89 | extern void elv_dequeue_request(request_queue_t *, struct request *); |
91 | extern void elv_requeue_request(request_queue_t *, struct request *); | 90 | extern void elv_requeue_request(request_queue_t *, struct request *); |
92 | extern void elv_deactivate_request(request_queue_t *, struct request *); | ||
93 | extern int elv_queue_empty(request_queue_t *); | 91 | extern int elv_queue_empty(request_queue_t *); |
94 | extern struct request *elv_next_request(struct request_queue *q); | 92 | extern struct request *elv_next_request(struct request_queue *q); |
95 | extern struct request *elv_former_request(request_queue_t *, struct request *); | 93 | extern struct request *elv_former_request(request_queue_t *, struct request *); |
@@ -98,7 +96,7 @@ extern int elv_register_queue(request_queue_t *q); | |||
98 | extern void elv_unregister_queue(request_queue_t *q); | 96 | extern void elv_unregister_queue(request_queue_t *q); |
99 | extern int elv_may_queue(request_queue_t *, int, struct bio *); | 97 | extern int elv_may_queue(request_queue_t *, int, struct bio *); |
100 | extern void elv_completed_request(request_queue_t *, struct request *); | 98 | extern void elv_completed_request(request_queue_t *, struct request *); |
101 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int); | 99 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); |
102 | extern void elv_put_request(request_queue_t *, struct request *); | 100 | extern void elv_put_request(request_queue_t *, struct request *); |
103 | 101 | ||
104 | /* | 102 | /* |
@@ -142,4 +140,6 @@ enum { | |||
142 | ELV_MQUEUE_MUST, | 140 | ELV_MQUEUE_MUST, |
143 | }; | 141 | }; |
144 | 142 | ||
143 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) | ||
144 | |||
145 | #endif | 145 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e0b77c5af9a0..f83d997c5582 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -320,7 +320,7 @@ struct address_space_operations { | |||
320 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 320 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
321 | sector_t (*bmap)(struct address_space *, sector_t); | 321 | sector_t (*bmap)(struct address_space *, sector_t); |
322 | int (*invalidatepage) (struct page *, unsigned long); | 322 | int (*invalidatepage) (struct page *, unsigned long); |
323 | int (*releasepage) (struct page *, int); | 323 | int (*releasepage) (struct page *, gfp_t); |
324 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 324 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
325 | loff_t offset, unsigned long nr_segs); | 325 | loff_t offset, unsigned long nr_segs); |
326 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 326 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 01796c41c951..142e1c1e0689 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -119,7 +119,7 @@ struct gendisk { | |||
119 | int policy; | 119 | int policy; |
120 | 120 | ||
121 | atomic_t sync_io; /* RAID */ | 121 | atomic_t sync_io; /* RAID */ |
122 | unsigned long stamp, stamp_idle; | 122 | unsigned long stamp; |
123 | int in_flight; | 123 | int in_flight; |
124 | #ifdef CONFIG_SMP | 124 | #ifdef CONFIG_SMP |
125 | struct disk_stats *dkstats; | 125 | struct disk_stats *dkstats; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 4dc990f3b5cc..c3779432a723 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -12,8 +12,8 @@ struct vm_area_struct; | |||
12 | * GFP bitmasks.. | 12 | * GFP bitmasks.. |
13 | */ | 13 | */ |
14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ | 14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ |
15 | #define __GFP_DMA 0x01u | 15 | #define __GFP_DMA ((__force gfp_t)0x01u) |
16 | #define __GFP_HIGHMEM 0x02u | 16 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Action modifiers - doesn't change the zoning | 19 | * Action modifiers - doesn't change the zoning |
@@ -26,24 +26,24 @@ struct vm_area_struct; | |||
26 | * | 26 | * |
27 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. | 27 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. |
28 | */ | 28 | */ |
29 | #define __GFP_WAIT 0x10u /* Can wait and reschedule? */ | 29 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ |
30 | #define __GFP_HIGH 0x20u /* Should access emergency pools? */ | 30 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ |
31 | #define __GFP_IO 0x40u /* Can start physical IO? */ | 31 | #define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */ |
32 | #define __GFP_FS 0x80u /* Can call down to low-level FS? */ | 32 | #define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */ |
33 | #define __GFP_COLD 0x100u /* Cache-cold page required */ | 33 | #define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */ |
34 | #define __GFP_NOWARN 0x200u /* Suppress page allocation failure warning */ | 34 | #define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */ |
35 | #define __GFP_REPEAT 0x400u /* Retry the allocation. Might fail */ | 35 | #define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */ |
36 | #define __GFP_NOFAIL 0x800u /* Retry for ever. Cannot fail */ | 36 | #define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */ |
37 | #define __GFP_NORETRY 0x1000u /* Do not retry. Might fail */ | 37 | #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */ |
38 | #define __GFP_NO_GROW 0x2000u /* Slab internal usage */ | 38 | #define __GFP_NO_GROW ((__force gfp_t)0x2000u)/* Slab internal usage */ |
39 | #define __GFP_COMP 0x4000u /* Add compound page metadata */ | 39 | #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ |
40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ | 40 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ |
41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ | 41 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
42 | #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ | 42 | #define __GFP_NORECLAIM ((__force gfp_t)0x20000u) /* No realy zone reclaim during allocation */ |
43 | #define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */ | 43 | #define __GFP_HARDWALL ((__force gfp_t)0x40000u) /* Enforce hardwall cpuset memory allocs */ |
44 | 44 | ||
45 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 45 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
46 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) | 46 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
47 | 47 | ||
48 | /* if you forget to add the bitmask here kernel will crash, period */ | 48 | /* if you forget to add the bitmask here kernel will crash, period */ |
49 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 49 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
@@ -64,6 +64,7 @@ struct vm_area_struct; | |||
64 | 64 | ||
65 | #define GFP_DMA __GFP_DMA | 65 | #define GFP_DMA __GFP_DMA |
66 | 66 | ||
67 | #define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) | ||
67 | 68 | ||
68 | /* | 69 | /* |
69 | * There is only one page-allocator function, and two main namespaces to | 70 | * There is only one page-allocator function, and two main namespaces to |
@@ -85,30 +86,30 @@ static inline void arch_free_page(struct page *page, int order) { } | |||
85 | #endif | 86 | #endif |
86 | 87 | ||
87 | extern struct page * | 88 | extern struct page * |
88 | FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); | 89 | FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *)); |
89 | 90 | ||
90 | static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_mask, | 91 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
91 | unsigned int order) | 92 | unsigned int order) |
92 | { | 93 | { |
93 | if (unlikely(order >= MAX_ORDER)) | 94 | if (unlikely(order >= MAX_ORDER)) |
94 | return NULL; | 95 | return NULL; |
95 | 96 | ||
96 | return __alloc_pages(gfp_mask, order, | 97 | return __alloc_pages(gfp_mask, order, |
97 | NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK)); | 98 | NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask)); |
98 | } | 99 | } |
99 | 100 | ||
100 | #ifdef CONFIG_NUMA | 101 | #ifdef CONFIG_NUMA |
101 | extern struct page *alloc_pages_current(unsigned int __nocast gfp_mask, unsigned order); | 102 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); |
102 | 103 | ||
103 | static inline struct page * | 104 | static inline struct page * |
104 | alloc_pages(unsigned int __nocast gfp_mask, unsigned int order) | 105 | alloc_pages(gfp_t gfp_mask, unsigned int order) |
105 | { | 106 | { |
106 | if (unlikely(order >= MAX_ORDER)) | 107 | if (unlikely(order >= MAX_ORDER)) |
107 | return NULL; | 108 | return NULL; |
108 | 109 | ||
109 | return alloc_pages_current(gfp_mask, order); | 110 | return alloc_pages_current(gfp_mask, order); |
110 | } | 111 | } |
111 | extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, | 112 | extern struct page *alloc_page_vma(gfp_t gfp_mask, |
112 | struct vm_area_struct *vma, unsigned long addr); | 113 | struct vm_area_struct *vma, unsigned long addr); |
113 | #else | 114 | #else |
114 | #define alloc_pages(gfp_mask, order) \ | 115 | #define alloc_pages(gfp_mask, order) \ |
@@ -117,8 +118,8 @@ extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, | |||
117 | #endif | 118 | #endif |
118 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) | 119 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) |
119 | 120 | ||
120 | extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order)); | 121 | extern unsigned long FASTCALL(__get_free_pages(gfp_t gfp_mask, unsigned int order)); |
121 | extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask)); | 122 | extern unsigned long FASTCALL(get_zeroed_page(gfp_t gfp_mask)); |
122 | 123 | ||
123 | #define __get_free_page(gfp_mask) \ | 124 | #define __get_free_page(gfp_mask) \ |
124 | __get_free_pages((gfp_mask),0) | 125 | __get_free_pages((gfp_mask),0) |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e670b0d13fe0..d664330d900e 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -25,6 +25,8 @@ int is_hugepage_mem_enough(size_t); | |||
25 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
26 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
27 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
28 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | ||
29 | unsigned long address, int write_access); | ||
28 | 30 | ||
29 | extern unsigned long max_huge_pages; | 31 | extern unsigned long max_huge_pages; |
30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 32 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
@@ -99,6 +101,7 @@ static inline unsigned long hugetlb_total_pages(void) | |||
99 | do { } while (0) | 101 | do { } while (0) |
100 | #define alloc_huge_page() ({ NULL; }) | 102 | #define alloc_huge_page() ({ NULL; }) |
101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | 103 | #define free_huge_page(p) ({ (void)(p); BUG(); }) |
104 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | ||
102 | 105 | ||
103 | #ifndef HPAGE_MASK | 106 | #ifndef HPAGE_MASK |
104 | #define HPAGE_MASK 0 /* Keep the compiler happy */ | 107 | #define HPAGE_MASK 0 /* Keep the compiler happy */ |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index bdc286ec947c..b4af45aad25d 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -492,7 +492,7 @@ static inline int i2o_dma_map_sg(struct i2o_controller *c, | |||
492 | * Returns 0 on success or -ENOMEM on failure. | 492 | * Returns 0 on success or -ENOMEM on failure. |
493 | */ | 493 | */ |
494 | static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, | 494 | static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, |
495 | size_t len, unsigned int gfp_mask) | 495 | size_t len, gfp_t gfp_mask) |
496 | { | 496 | { |
497 | struct pci_dev *pdev = to_pci_dev(dev); | 497 | struct pci_dev *pdev = to_pci_dev(dev); |
498 | int dma_64 = 0; | 498 | int dma_64 = 0; |
@@ -551,7 +551,7 @@ static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr) | |||
551 | * Returns the 0 on success or negative error code on failure. | 551 | * Returns the 0 on success or negative error code on failure. |
552 | */ | 552 | */ |
553 | static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, | 553 | static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, |
554 | size_t len, unsigned int gfp_mask) | 554 | size_t len, gfp_t gfp_mask) |
555 | { | 555 | { |
556 | i2o_dma_free(dev, addr); | 556 | i2o_dma_free(dev, addr); |
557 | 557 | ||
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h index 2ef0b21517fb..1c7a0dd5536a 100644 --- a/include/linux/ibmtr.h +++ b/include/linux/ibmtr.h | |||
@@ -7,8 +7,8 @@ | |||
7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ | 7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ |
8 | 8 | ||
9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ | 9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ |
10 | #define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ | 10 | #define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */ |
11 | #define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ | 11 | #define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */ |
12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ | 12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ |
13 | 13 | ||
14 | #define TR_ISA 1 | 14 | #define TR_ISA 1 |
diff --git a/include/linux/idr.h b/include/linux/idr.h index ca3b7e462576..7fb3ff9c7b0e 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -71,8 +71,9 @@ struct idr { | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | void *idr_find(struct idr *idp, int id); | 73 | void *idr_find(struct idr *idp, int id); |
74 | int idr_pre_get(struct idr *idp, unsigned gfp_mask); | 74 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
75 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 75 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
76 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 76 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
77 | void idr_remove(struct idr *idp, int id); | 77 | void idr_remove(struct idr *idp, int id); |
78 | void idr_destroy(struct idr *idp); | ||
78 | void idr_init(struct idr *idp); | 79 | void idr_init(struct idr *idp); |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 0856548a2a08..a8b1a2071838 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -84,6 +84,7 @@ | |||
84 | #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ | 84 | #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ |
85 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ | 85 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
86 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 86 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
87 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | ||
87 | 88 | ||
88 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 89 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
89 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 90 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index fc2d4c8225aa..d21c305c6c64 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -111,7 +111,9 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
111 | return (struct ethhdr *)skb->mac.raw; | 111 | return (struct ethhdr *)skb->mac.raw; |
112 | } | 112 | } |
113 | 113 | ||
114 | #ifdef CONFIG_SYSCTL | ||
114 | extern struct ctl_table ether_table[]; | 115 | extern struct ctl_table ether_table[]; |
115 | #endif | 116 | #endif |
117 | #endif | ||
116 | 118 | ||
117 | #endif /* _LINUX_IF_ETHER_H */ | 119 | #endif /* _LINUX_IF_ETHER_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 7e1e15f934f3..fd7af86151b1 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -142,13 +142,21 @@ static __inline__ int bad_mask(u32 mask, u32 addr) | |||
142 | 142 | ||
143 | #define endfor_ifa(in_dev) } | 143 | #define endfor_ifa(in_dev) } |
144 | 144 | ||
145 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) | ||
146 | { | ||
147 | struct in_device *in_dev = dev->ip_ptr; | ||
148 | if (in_dev) | ||
149 | in_dev = rcu_dereference(in_dev); | ||
150 | return in_dev; | ||
151 | } | ||
152 | |||
145 | static __inline__ struct in_device * | 153 | static __inline__ struct in_device * |
146 | in_dev_get(const struct net_device *dev) | 154 | in_dev_get(const struct net_device *dev) |
147 | { | 155 | { |
148 | struct in_device *in_dev; | 156 | struct in_device *in_dev; |
149 | 157 | ||
150 | rcu_read_lock(); | 158 | rcu_read_lock(); |
151 | in_dev = dev->ip_ptr; | 159 | in_dev = __in_dev_get_rcu(dev); |
152 | if (in_dev) | 160 | if (in_dev) |
153 | atomic_inc(&in_dev->refcnt); | 161 | atomic_inc(&in_dev->refcnt); |
154 | rcu_read_unlock(); | 162 | rcu_read_unlock(); |
@@ -156,7 +164,7 @@ in_dev_get(const struct net_device *dev) | |||
156 | } | 164 | } |
157 | 165 | ||
158 | static __inline__ struct in_device * | 166 | static __inline__ struct in_device * |
159 | __in_dev_get(const struct net_device *dev) | 167 | __in_dev_get_rtnl(const struct net_device *dev) |
160 | { | 168 | { |
161 | return (struct in_device*)dev->ip_ptr; | 169 | return (struct in_device*)dev->ip_ptr; |
162 | } | 170 | } |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index bb6f88e14061..e0b922785d98 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -372,8 +372,9 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
372 | #define inet_v6_ipv6only(__sk) 0 | 372 | #define inet_v6_ipv6only(__sk) 0 |
373 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 373 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
374 | 374 | ||
375 | #define INET6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \ | 375 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ |
376 | (((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 376 | (((__sk)->sk_hash == (__hash)) && \ |
377 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | ||
377 | ((__sk)->sk_family == AF_INET6) && \ | 378 | ((__sk)->sk_family == AF_INET6) && \ |
378 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 379 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
379 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | 380 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index de097269bd7f..be197eb90077 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -69,7 +69,7 @@ extern int journal_enable_debug; | |||
69 | #define jbd_debug(f, a...) /**/ | 69 | #define jbd_debug(f, a...) /**/ |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | extern void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry); | 72 | extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry); |
73 | #define jbd_kmalloc(size, flags) \ | 73 | #define jbd_kmalloc(size, flags) \ |
74 | __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) | 74 | __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) |
75 | #define jbd_rep_kmalloc(size, flags) \ | 75 | #define jbd_rep_kmalloc(size, flags) \ |
@@ -890,7 +890,7 @@ extern int journal_forget (handle_t *, struct buffer_head *); | |||
890 | extern void journal_sync_buffer (struct buffer_head *); | 890 | extern void journal_sync_buffer (struct buffer_head *); |
891 | extern int journal_invalidatepage(journal_t *, | 891 | extern int journal_invalidatepage(journal_t *, |
892 | struct page *, unsigned long); | 892 | struct page *, unsigned long); |
893 | extern int journal_try_to_free_buffers(journal_t *, struct page *, int); | 893 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
894 | extern int journal_stop(handle_t *); | 894 | extern int journal_stop(handle_t *); |
895 | extern int journal_flush (journal_t *); | 895 | extern int journal_flush (journal_t *); |
896 | extern void journal_lock_updates (journal_t *); | 896 | extern void journal_lock_updates (journal_t *); |
@@ -935,7 +935,7 @@ void journal_put_journal_head(struct journal_head *jh); | |||
935 | */ | 935 | */ |
936 | extern kmem_cache_t *jbd_handle_cache; | 936 | extern kmem_cache_t *jbd_handle_cache; |
937 | 937 | ||
938 | static inline handle_t *jbd_alloc_handle(unsigned int __nocast gfp_flags) | 938 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) |
939 | { | 939 | { |
940 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); | 940 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); |
941 | } | 941 | } |
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h index cc326174a808..7a2e332067c3 100644 --- a/include/linux/key-ui.h +++ b/include/linux/key-ui.h | |||
@@ -38,92 +38,21 @@ struct keyring_list { | |||
38 | struct key *keys[0]; | 38 | struct key *keys[0]; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | |||
42 | /* | 41 | /* |
43 | * check to see whether permission is granted to use a key in the desired way | 42 | * check to see whether permission is granted to use a key in the desired way |
44 | */ | 43 | */ |
45 | static inline int key_permission(const struct key *key, key_perm_t perm) | 44 | extern int key_task_permission(const key_ref_t key_ref, |
46 | { | 45 | struct task_struct *context, |
47 | key_perm_t kperm; | 46 | key_perm_t perm); |
48 | |||
49 | if (key->uid == current->fsuid) | ||
50 | kperm = key->perm >> 16; | ||
51 | else if (key->gid != -1 && | ||
52 | key->perm & KEY_GRP_ALL && | ||
53 | in_group_p(key->gid) | ||
54 | ) | ||
55 | kperm = key->perm >> 8; | ||
56 | else | ||
57 | kperm = key->perm; | ||
58 | |||
59 | kperm = kperm & perm & KEY_ALL; | ||
60 | |||
61 | return kperm == perm; | ||
62 | } | ||
63 | |||
64 | /* | ||
65 | * check to see whether permission is granted to use a key in at least one of | ||
66 | * the desired ways | ||
67 | */ | ||
68 | static inline int key_any_permission(const struct key *key, key_perm_t perm) | ||
69 | { | ||
70 | key_perm_t kperm; | ||
71 | |||
72 | if (key->uid == current->fsuid) | ||
73 | kperm = key->perm >> 16; | ||
74 | else if (key->gid != -1 && | ||
75 | key->perm & KEY_GRP_ALL && | ||
76 | in_group_p(key->gid) | ||
77 | ) | ||
78 | kperm = key->perm >> 8; | ||
79 | else | ||
80 | kperm = key->perm; | ||
81 | 47 | ||
82 | kperm = kperm & perm & KEY_ALL; | 48 | static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) |
83 | |||
84 | return kperm != 0; | ||
85 | } | ||
86 | |||
87 | static inline int key_task_groups_search(struct task_struct *tsk, gid_t gid) | ||
88 | { | 49 | { |
89 | int ret; | 50 | return key_task_permission(key_ref, current, perm); |
90 | |||
91 | task_lock(tsk); | ||
92 | ret = groups_search(tsk->group_info, gid); | ||
93 | task_unlock(tsk); | ||
94 | return ret; | ||
95 | } | ||
96 | |||
97 | static inline int key_task_permission(const struct key *key, | ||
98 | struct task_struct *context, | ||
99 | key_perm_t perm) | ||
100 | { | ||
101 | key_perm_t kperm; | ||
102 | |||
103 | if (key->uid == context->fsuid) { | ||
104 | kperm = key->perm >> 16; | ||
105 | } | ||
106 | else if (key->gid != -1 && | ||
107 | key->perm & KEY_GRP_ALL && ( | ||
108 | key->gid == context->fsgid || | ||
109 | key_task_groups_search(context, key->gid) | ||
110 | ) | ||
111 | ) { | ||
112 | kperm = key->perm >> 8; | ||
113 | } | ||
114 | else { | ||
115 | kperm = key->perm; | ||
116 | } | ||
117 | |||
118 | kperm = kperm & perm & KEY_ALL; | ||
119 | |||
120 | return kperm == perm; | ||
121 | |||
122 | } | 51 | } |
123 | 52 | ||
124 | extern struct key *lookup_user_key(struct task_struct *context, | 53 | extern key_ref_t lookup_user_key(struct task_struct *context, |
125 | key_serial_t id, int create, int partial, | 54 | key_serial_t id, int create, int partial, |
126 | key_perm_t perm); | 55 | key_perm_t perm); |
127 | 56 | ||
128 | extern long join_session_keyring(const char *name); | 57 | extern long join_session_keyring(const char *name); |
129 | 58 | ||
diff --git a/include/linux/key.h b/include/linux/key.h index 970bbd916cf4..f1efa016dbf3 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -35,11 +35,18 @@ struct key; | |||
35 | 35 | ||
36 | #undef KEY_DEBUGGING | 36 | #undef KEY_DEBUGGING |
37 | 37 | ||
38 | #define KEY_USR_VIEW 0x00010000 /* user can view a key's attributes */ | 38 | #define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */ |
39 | #define KEY_USR_READ 0x00020000 /* user can read key payload / view keyring */ | 39 | #define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */ |
40 | #define KEY_USR_WRITE 0x00040000 /* user can update key payload / add link to keyring */ | 40 | #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ |
41 | #define KEY_USR_SEARCH 0x00080000 /* user can find a key in search / search a keyring */ | 41 | #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ |
42 | #define KEY_USR_LINK 0x00100000 /* user can create a link to a key/keyring */ | 42 | #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ |
43 | #define KEY_POS_ALL 0x1f000000 | ||
44 | |||
45 | #define KEY_USR_VIEW 0x00010000 /* user permissions... */ | ||
46 | #define KEY_USR_READ 0x00020000 | ||
47 | #define KEY_USR_WRITE 0x00040000 | ||
48 | #define KEY_USR_SEARCH 0x00080000 | ||
49 | #define KEY_USR_LINK 0x00100000 | ||
43 | #define KEY_USR_ALL 0x001f0000 | 50 | #define KEY_USR_ALL 0x001f0000 |
44 | 51 | ||
45 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ | 52 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ |
@@ -67,6 +74,38 @@ struct keyring_name; | |||
67 | 74 | ||
68 | /*****************************************************************************/ | 75 | /*****************************************************************************/ |
69 | /* | 76 | /* |
77 | * key reference with possession attribute handling | ||
78 | * | ||
79 | * NOTE! key_ref_t is a typedef'd pointer to a type that is not actually | ||
80 | * defined. This is because we abuse the bottom bit of the reference to carry a | ||
81 | * flag to indicate whether the calling process possesses that key in one of | ||
82 | * its keyrings. | ||
83 | * | ||
84 | * the key_ref_t has been made a separate type so that the compiler can reject | ||
85 | * attempts to dereference it without proper conversion. | ||
86 | * | ||
87 | * the three functions are used to assemble and disassemble references | ||
88 | */ | ||
89 | typedef struct __key_reference_with_attributes *key_ref_t; | ||
90 | |||
91 | static inline key_ref_t make_key_ref(const struct key *key, | ||
92 | unsigned long possession) | ||
93 | { | ||
94 | return (key_ref_t) ((unsigned long) key | possession); | ||
95 | } | ||
96 | |||
97 | static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) | ||
98 | { | ||
99 | return (struct key *) ((unsigned long) key_ref & ~1UL); | ||
100 | } | ||
101 | |||
102 | static inline unsigned long is_key_possessed(const key_ref_t key_ref) | ||
103 | { | ||
104 | return (unsigned long) key_ref & 1UL; | ||
105 | } | ||
106 | |||
107 | /*****************************************************************************/ | ||
108 | /* | ||
70 | * authentication token / access credential / keyring | 109 | * authentication token / access credential / keyring |
71 | * - types of key include: | 110 | * - types of key include: |
72 | * - keyrings | 111 | * - keyrings |
@@ -215,20 +254,25 @@ static inline struct key *key_get(struct key *key) | |||
215 | return key; | 254 | return key; |
216 | } | 255 | } |
217 | 256 | ||
257 | static inline void key_ref_put(key_ref_t key_ref) | ||
258 | { | ||
259 | key_put(key_ref_to_ptr(key_ref)); | ||
260 | } | ||
261 | |||
218 | extern struct key *request_key(struct key_type *type, | 262 | extern struct key *request_key(struct key_type *type, |
219 | const char *description, | 263 | const char *description, |
220 | const char *callout_info); | 264 | const char *callout_info); |
221 | 265 | ||
222 | extern int key_validate(struct key *key); | 266 | extern int key_validate(struct key *key); |
223 | 267 | ||
224 | extern struct key *key_create_or_update(struct key *keyring, | 268 | extern key_ref_t key_create_or_update(key_ref_t keyring, |
225 | const char *type, | 269 | const char *type, |
226 | const char *description, | 270 | const char *description, |
227 | const void *payload, | 271 | const void *payload, |
228 | size_t plen, | 272 | size_t plen, |
229 | int not_in_quota); | 273 | int not_in_quota); |
230 | 274 | ||
231 | extern int key_update(struct key *key, | 275 | extern int key_update(key_ref_t key, |
232 | const void *payload, | 276 | const void *payload, |
233 | size_t plen); | 277 | size_t plen); |
234 | 278 | ||
@@ -243,9 +287,9 @@ extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | |||
243 | 287 | ||
244 | extern int keyring_clear(struct key *keyring); | 288 | extern int keyring_clear(struct key *keyring); |
245 | 289 | ||
246 | extern struct key *keyring_search(struct key *keyring, | 290 | extern key_ref_t keyring_search(key_ref_t keyring, |
247 | struct key_type *type, | 291 | struct key_type *type, |
248 | const char *description); | 292 | const char *description); |
249 | 293 | ||
250 | extern int keyring_add_key(struct key *keyring, | 294 | extern int keyring_add_key(struct key *keyring, |
251 | struct key *key); | 295 | struct key *key); |
@@ -285,6 +329,10 @@ extern void key_init(void); | |||
285 | #define key_serial(k) 0 | 329 | #define key_serial(k) 0 |
286 | #define key_get(k) ({ NULL; }) | 330 | #define key_get(k) ({ NULL; }) |
287 | #define key_put(k) do { } while(0) | 331 | #define key_put(k) do { } while(0) |
332 | #define key_ref_put(k) do { } while(0) | ||
333 | #define make_key_ref(k) ({ NULL; }) | ||
334 | #define key_ref_to_ptr(k) ({ NULL; }) | ||
335 | #define is_key_possessed(k) 0 | ||
288 | #define alloc_uid_keyring(u) 0 | 336 | #define alloc_uid_keyring(u) 0 |
289 | #define switch_uid_keyring(u) do { } while(0) | 337 | #define switch_uid_keyring(u) do { } while(0) |
290 | #define __install_session_keyring(t, k) ({ NULL; }) | 338 | #define __install_session_keyring(t, k) ({ NULL; }) |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index c27cd428d269..48eccd865bd8 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -35,8 +35,8 @@ struct kfifo { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, | 37 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, |
38 | unsigned int __nocast gfp_mask, spinlock_t *lock); | 38 | gfp_t gfp_mask, spinlock_t *lock); |
39 | extern struct kfifo *kfifo_alloc(unsigned int size, unsigned int __nocast gfp_mask, | 39 | extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, |
40 | spinlock_t *lock); | 40 | spinlock_t *lock); |
41 | extern void kfifo_free(struct kfifo *fifo); | 41 | extern void kfifo_free(struct kfifo *fifo); |
42 | extern unsigned int __kfifo_put(struct kfifo *fifo, | 42 | extern unsigned int __kfifo_put(struct kfifo *fifo, |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 3b22304f12fd..7f7403aa4a41 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -65,7 +65,7 @@ extern void kobject_unregister(struct kobject *); | |||
65 | extern struct kobject * kobject_get(struct kobject *); | 65 | extern struct kobject * kobject_get(struct kobject *); |
66 | extern void kobject_put(struct kobject *); | 66 | extern void kobject_put(struct kobject *); |
67 | 67 | ||
68 | extern char * kobject_get_path(struct kobject *, int); | 68 | extern char * kobject_get_path(struct kobject *, gfp_t); |
69 | 69 | ||
70 | struct kobj_type { | 70 | struct kobj_type { |
71 | void (*release)(struct kobject *); | 71 | void (*release)(struct kobject *); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 022105c745fc..00a8a5738858 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -91,12 +91,13 @@ enum { | |||
91 | ATA_SHT_EMULATED = 1, | 91 | ATA_SHT_EMULATED = 1, |
92 | ATA_SHT_CMD_PER_LUN = 1, | 92 | ATA_SHT_CMD_PER_LUN = 1, |
93 | ATA_SHT_THIS_ID = -1, | 93 | ATA_SHT_THIS_ID = -1, |
94 | ATA_SHT_USE_CLUSTERING = 0, | 94 | ATA_SHT_USE_CLUSTERING = 1, |
95 | 95 | ||
96 | /* struct ata_device stuff */ | 96 | /* struct ata_device stuff */ |
97 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ | 97 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ |
98 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ | 98 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ |
99 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ | 99 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ |
100 | ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */ | ||
100 | 101 | ||
101 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 102 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
102 | ATA_DEV_ATA = 1, /* ATA device */ | 103 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -154,17 +155,21 @@ enum { | |||
154 | ATA_SHIFT_UDMA = 0, | 155 | ATA_SHIFT_UDMA = 0, |
155 | ATA_SHIFT_MWDMA = 8, | 156 | ATA_SHIFT_MWDMA = 8, |
156 | ATA_SHIFT_PIO = 11, | 157 | ATA_SHIFT_PIO = 11, |
158 | |||
159 | /* Masks for port functions */ | ||
160 | ATA_PORT_PRIMARY = (1 << 0), | ||
161 | ATA_PORT_SECONDARY = (1 << 1), | ||
157 | }; | 162 | }; |
158 | 163 | ||
159 | enum pio_task_states { | 164 | enum hsm_task_states { |
160 | PIO_ST_UNKNOWN, | 165 | HSM_ST_UNKNOWN, |
161 | PIO_ST_IDLE, | 166 | HSM_ST_IDLE, |
162 | PIO_ST_POLL, | 167 | HSM_ST_POLL, |
163 | PIO_ST_TMOUT, | 168 | HSM_ST_TMOUT, |
164 | PIO_ST, | 169 | HSM_ST, |
165 | PIO_ST_LAST, | 170 | HSM_ST_LAST, |
166 | PIO_ST_LAST_POLL, | 171 | HSM_ST_LAST_POLL, |
167 | PIO_ST_ERR, | 172 | HSM_ST_ERR, |
168 | }; | 173 | }; |
169 | 174 | ||
170 | /* forward declarations */ | 175 | /* forward declarations */ |
@@ -197,7 +202,7 @@ struct ata_ioports { | |||
197 | struct ata_probe_ent { | 202 | struct ata_probe_ent { |
198 | struct list_head node; | 203 | struct list_head node; |
199 | struct device *dev; | 204 | struct device *dev; |
200 | struct ata_port_operations *port_ops; | 205 | const struct ata_port_operations *port_ops; |
201 | Scsi_Host_Template *sht; | 206 | Scsi_Host_Template *sht; |
202 | struct ata_ioports port[ATA_MAX_PORTS]; | 207 | struct ata_ioports port[ATA_MAX_PORTS]; |
203 | unsigned int n_ports; | 208 | unsigned int n_ports; |
@@ -220,7 +225,7 @@ struct ata_host_set { | |||
220 | void __iomem *mmio_base; | 225 | void __iomem *mmio_base; |
221 | unsigned int n_ports; | 226 | unsigned int n_ports; |
222 | void *private_data; | 227 | void *private_data; |
223 | struct ata_port_operations *ops; | 228 | const struct ata_port_operations *ops; |
224 | struct ata_port * ports[0]; | 229 | struct ata_port * ports[0]; |
225 | }; | 230 | }; |
226 | 231 | ||
@@ -278,15 +283,18 @@ struct ata_device { | |||
278 | u8 xfer_mode; | 283 | u8 xfer_mode; |
279 | unsigned int xfer_shift; /* ATA_SHIFT_xxx */ | 284 | unsigned int xfer_shift; /* ATA_SHIFT_xxx */ |
280 | 285 | ||
281 | /* cache info about current transfer mode */ | 286 | unsigned int multi_count; /* sectors count for |
282 | u8 xfer_protocol; /* taskfile xfer protocol */ | 287 | READ/WRITE MULTIPLE */ |
283 | u8 read_cmd; /* opcode to use on read */ | 288 | |
284 | u8 write_cmd; /* opcode to use on write */ | 289 | /* for CHS addressing */ |
290 | u16 cylinders; /* Number of cylinders */ | ||
291 | u16 heads; /* Number of heads */ | ||
292 | u16 sectors; /* Number of sectors per track */ | ||
285 | }; | 293 | }; |
286 | 294 | ||
287 | struct ata_port { | 295 | struct ata_port { |
288 | struct Scsi_Host *host; /* our co-allocated scsi host */ | 296 | struct Scsi_Host *host; /* our co-allocated scsi host */ |
289 | struct ata_port_operations *ops; | 297 | const struct ata_port_operations *ops; |
290 | unsigned long flags; /* ATA_FLAG_xxx */ | 298 | unsigned long flags; /* ATA_FLAG_xxx */ |
291 | unsigned int id; /* unique id req'd by scsi midlyr */ | 299 | unsigned int id; /* unique id req'd by scsi midlyr */ |
292 | unsigned int port_no; /* unique port #; from zero */ | 300 | unsigned int port_no; /* unique port #; from zero */ |
@@ -319,7 +327,7 @@ struct ata_port { | |||
319 | struct work_struct packet_task; | 327 | struct work_struct packet_task; |
320 | 328 | ||
321 | struct work_struct pio_task; | 329 | struct work_struct pio_task; |
322 | unsigned int pio_task_state; | 330 | unsigned int hsm_task_state; |
323 | unsigned long pio_task_timeout; | 331 | unsigned long pio_task_timeout; |
324 | 332 | ||
325 | void *private_data; | 333 | void *private_data; |
@@ -333,10 +341,10 @@ struct ata_port_operations { | |||
333 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 341 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
334 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 342 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
335 | 343 | ||
336 | void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); | 344 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); |
337 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | 345 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); |
338 | 346 | ||
339 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | 347 | void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf); |
340 | u8 (*check_status)(struct ata_port *ap); | 348 | u8 (*check_status)(struct ata_port *ap); |
341 | u8 (*check_altstatus)(struct ata_port *ap); | 349 | u8 (*check_altstatus)(struct ata_port *ap); |
342 | u8 (*check_err)(struct ata_port *ap); | 350 | u8 (*check_err)(struct ata_port *ap); |
@@ -377,9 +385,22 @@ struct ata_port_info { | |||
377 | unsigned long pio_mask; | 385 | unsigned long pio_mask; |
378 | unsigned long mwdma_mask; | 386 | unsigned long mwdma_mask; |
379 | unsigned long udma_mask; | 387 | unsigned long udma_mask; |
380 | struct ata_port_operations *port_ops; | 388 | const struct ata_port_operations *port_ops; |
389 | }; | ||
390 | |||
391 | struct ata_timing { | ||
392 | unsigned short mode; /* ATA mode */ | ||
393 | unsigned short setup; /* t1 */ | ||
394 | unsigned short act8b; /* t2 for 8-bit I/O */ | ||
395 | unsigned short rec8b; /* t2i for 8-bit I/O */ | ||
396 | unsigned short cyc8b; /* t0 for 8-bit I/O */ | ||
397 | unsigned short active; /* t2 or tD */ | ||
398 | unsigned short recover; /* t2i or tK */ | ||
399 | unsigned short cycle; /* t0 */ | ||
400 | unsigned short udma; /* t2CYCTYP/2 */ | ||
381 | }; | 401 | }; |
382 | 402 | ||
403 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) | ||
383 | 404 | ||
384 | extern void ata_port_probe(struct ata_port *); | 405 | extern void ata_port_probe(struct ata_port *); |
385 | extern void __sata_phy_reset(struct ata_port *ap); | 406 | extern void __sata_phy_reset(struct ata_port *ap); |
@@ -392,26 +413,29 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i | |||
392 | unsigned int n_ports); | 413 | unsigned int n_ports); |
393 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 414 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
394 | #endif /* CONFIG_PCI */ | 415 | #endif /* CONFIG_PCI */ |
395 | extern int ata_device_add(struct ata_probe_ent *ent); | 416 | extern int ata_device_add(const struct ata_probe_ent *ent); |
417 | extern void ata_host_set_remove(struct ata_host_set *host_set); | ||
396 | extern int ata_scsi_detect(Scsi_Host_Template *sht); | 418 | extern int ata_scsi_detect(Scsi_Host_Template *sht); |
397 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 419 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
398 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 420 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
399 | extern int ata_scsi_error(struct Scsi_Host *host); | 421 | extern int ata_scsi_error(struct Scsi_Host *host); |
400 | extern int ata_scsi_release(struct Scsi_Host *host); | 422 | extern int ata_scsi_release(struct Scsi_Host *host); |
401 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 423 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
424 | extern int ata_ratelimit(void); | ||
425 | |||
402 | /* | 426 | /* |
403 | * Default driver ops implementations | 427 | * Default driver ops implementations |
404 | */ | 428 | */ |
405 | extern void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf); | 429 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); |
406 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 430 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
407 | extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp); | 431 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); |
408 | extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf); | 432 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); |
409 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); | 433 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); |
410 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | 434 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); |
411 | extern u8 ata_check_status(struct ata_port *ap); | 435 | extern u8 ata_check_status(struct ata_port *ap); |
412 | extern u8 ata_altstatus(struct ata_port *ap); | 436 | extern u8 ata_altstatus(struct ata_port *ap); |
413 | extern u8 ata_chk_err(struct ata_port *ap); | 437 | extern u8 ata_chk_err(struct ata_port *ap); |
414 | extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); | 438 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
415 | extern int ata_port_start (struct ata_port *ap); | 439 | extern int ata_port_start (struct ata_port *ap); |
416 | extern void ata_port_stop (struct ata_port *ap); | 440 | extern void ata_port_stop (struct ata_port *ap); |
417 | extern void ata_host_stop (struct ata_host_set *host_set); | 441 | extern void ata_host_stop (struct ata_host_set *host_set); |
@@ -422,8 +446,8 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | |||
422 | unsigned int buflen); | 446 | unsigned int buflen); |
423 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 447 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
424 | unsigned int n_elem); | 448 | unsigned int n_elem); |
425 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); | 449 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); |
426 | extern void ata_dev_id_string(u16 *id, unsigned char *s, | 450 | extern void ata_dev_id_string(const u16 *id, unsigned char *s, |
427 | unsigned int ofs, unsigned int len); | 451 | unsigned int ofs, unsigned int len); |
428 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | 452 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); |
429 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 453 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
@@ -440,6 +464,32 @@ extern int ata_std_bios_param(struct scsi_device *sdev, | |||
440 | sector_t capacity, int geom[]); | 464 | sector_t capacity, int geom[]); |
441 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 465 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
442 | 466 | ||
467 | /* | ||
468 | * Timing helpers | ||
469 | */ | ||
470 | extern int ata_timing_compute(struct ata_device *, unsigned short, | ||
471 | struct ata_timing *, int, int); | ||
472 | extern void ata_timing_merge(const struct ata_timing *, | ||
473 | const struct ata_timing *, struct ata_timing *, | ||
474 | unsigned int); | ||
475 | |||
476 | enum { | ||
477 | ATA_TIMING_SETUP = (1 << 0), | ||
478 | ATA_TIMING_ACT8B = (1 << 1), | ||
479 | ATA_TIMING_REC8B = (1 << 2), | ||
480 | ATA_TIMING_CYC8B = (1 << 3), | ||
481 | ATA_TIMING_8BIT = ATA_TIMING_ACT8B | ATA_TIMING_REC8B | | ||
482 | ATA_TIMING_CYC8B, | ||
483 | ATA_TIMING_ACTIVE = (1 << 4), | ||
484 | ATA_TIMING_RECOVER = (1 << 5), | ||
485 | ATA_TIMING_CYCLE = (1 << 6), | ||
486 | ATA_TIMING_UDMA = (1 << 7), | ||
487 | ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B | | ||
488 | ATA_TIMING_REC8B | ATA_TIMING_CYC8B | | ||
489 | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | | ||
490 | ATA_TIMING_CYCLE | ATA_TIMING_UDMA, | ||
491 | }; | ||
492 | |||
443 | 493 | ||
444 | #ifdef CONFIG_PCI | 494 | #ifdef CONFIG_PCI |
445 | struct pci_bits { | 495 | struct pci_bits { |
@@ -451,8 +501,8 @@ struct pci_bits { | |||
451 | 501 | ||
452 | extern void ata_pci_host_stop (struct ata_host_set *host_set); | 502 | extern void ata_pci_host_stop (struct ata_host_set *host_set); |
453 | extern struct ata_probe_ent * | 503 | extern struct ata_probe_ent * |
454 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); | 504 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
455 | extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); | 505 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
456 | 506 | ||
457 | #endif /* CONFIG_PCI */ | 507 | #endif /* CONFIG_PCI */ |
458 | 508 | ||
@@ -462,7 +512,7 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
462 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 512 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
463 | } | 513 | } |
464 | 514 | ||
465 | static inline unsigned int ata_dev_present(struct ata_device *dev) | 515 | static inline unsigned int ata_dev_present(const struct ata_device *dev) |
466 | { | 516 | { |
467 | return ((dev->class == ATA_DEV_ATA) || | 517 | return ((dev->class == ATA_DEV_ATA) || |
468 | (dev->class == ATA_DEV_ATAPI)); | 518 | (dev->class == ATA_DEV_ATAPI)); |
@@ -661,7 +711,7 @@ static inline unsigned int sata_dev_present(struct ata_port *ap) | |||
661 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; | 711 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; |
662 | } | 712 | } |
663 | 713 | ||
664 | static inline int ata_try_flush_cache(struct ata_device *dev) | 714 | static inline int ata_try_flush_cache(const struct ata_device *dev) |
665 | { | 715 | { |
666 | return ata_id_wcache_enabled(dev->id) || | 716 | return ata_id_wcache_enabled(dev->id) || |
667 | ata_id_has_flush(dev->id) || | 717 | ata_id_has_flush(dev->id) || |
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/loop.h b/include/linux/loop.h index 53fa51595443..40f63c9879d2 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -52,7 +52,7 @@ struct loop_device { | |||
52 | unsigned lo_blocksize; | 52 | unsigned lo_blocksize; |
53 | void *key_data; | 53 | void *key_data; |
54 | 54 | ||
55 | int old_gfp_mask; | 55 | gfp_t old_gfp_mask; |
56 | 56 | ||
57 | spinlock_t lo_lock; | 57 | spinlock_t lo_lock; |
58 | struct bio *lo_bio; | 58 | struct bio *lo_bio; |
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h index 9263d2db2d67..99e044b4efc6 100644 --- a/include/linux/mbcache.h +++ b/include/linux/mbcache.h | |||
@@ -22,7 +22,7 @@ struct mb_cache_entry { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct mb_cache_op { | 24 | struct mb_cache_op { |
25 | int (*free)(struct mb_cache_entry *, int); | 25 | int (*free)(struct mb_cache_entry *, gfp_t); |
26 | }; | 26 | }; |
27 | 27 | ||
28 | /* Functions on caches */ | 28 | /* Functions on caches */ |
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 796220ce47cc..f2427d7394b0 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
8 | 8 | ||
9 | typedef void * (mempool_alloc_t)(unsigned int __nocast gfp_mask, void *pool_data); | 9 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); |
10 | typedef void (mempool_free_t)(void *element, void *pool_data); | 10 | typedef void (mempool_free_t)(void *element, void *pool_data); |
11 | 11 | ||
12 | typedef struct mempool_s { | 12 | typedef struct mempool_s { |
@@ -26,17 +26,16 @@ extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | |||
26 | extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, | 26 | extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, |
27 | mempool_free_t *free_fn, void *pool_data, int nid); | 27 | mempool_free_t *free_fn, void *pool_data, int nid); |
28 | 28 | ||
29 | extern int mempool_resize(mempool_t *pool, int new_min_nr, | 29 | extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask); |
30 | unsigned int __nocast gfp_mask); | ||
31 | extern void mempool_destroy(mempool_t *pool); | 30 | extern void mempool_destroy(mempool_t *pool); |
32 | extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask); | 31 | extern void * mempool_alloc(mempool_t *pool, gfp_t gfp_mask); |
33 | extern void mempool_free(void *element, mempool_t *pool); | 32 | extern void mempool_free(void *element, mempool_t *pool); |
34 | 33 | ||
35 | /* | 34 | /* |
36 | * A mempool_alloc_t and mempool_free_t that get the memory from | 35 | * A mempool_alloc_t and mempool_free_t that get the memory from |
37 | * a slab that is passed in through pool_data. | 36 | * a slab that is passed in through pool_data. |
38 | */ | 37 | */ |
39 | void *mempool_alloc_slab(unsigned int __nocast gfp_mask, void *pool_data); | 38 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); |
40 | void mempool_free_slab(void *element, void *pool_data); | 39 | void mempool_free_slab(void *element, void *pool_data); |
41 | 40 | ||
42 | #endif /* _LINUX_MEMPOOL_H */ | 41 | #endif /* _LINUX_MEMPOOL_H */ |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 9b8d0476988a..68f5a0f392dd 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -158,6 +158,7 @@ extern int mii_link_ok (struct mii_if_info *mii); | |||
158 | extern int mii_nway_restart (struct mii_if_info *mii); | 158 | extern int mii_nway_restart (struct mii_if_info *mii); |
159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
161 | extern int mii_check_gmii_support(struct mii_if_info *mii); | ||
161 | extern void mii_check_link (struct mii_if_info *mii); | 162 | extern void mii_check_link (struct mii_if_info *mii); |
162 | extern unsigned int mii_check_media (struct mii_if_info *mii, | 163 | extern unsigned int mii_check_media (struct mii_if_info *mii, |
163 | unsigned int ok_to_print, | 164 | unsigned int ok_to_print, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 097b3a3c693d..e1649578fb0c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -747,7 +747,7 @@ extern unsigned long do_mremap(unsigned long addr, | |||
747 | * The callback will be passed nr_to_scan == 0 when the VM is querying the | 747 | * The callback will be passed nr_to_scan == 0 when the VM is querying the |
748 | * cache size, so a fastpath for that case is appropriate. | 748 | * cache size, so a fastpath for that case is appropriate. |
749 | */ | 749 | */ |
750 | typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); | 750 | typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); |
751 | 751 | ||
752 | /* | 752 | /* |
753 | * Add an aging callback. The int is the number of 'seeks' it takes | 753 | * Add an aging callback. The int is the number of 'seeks' it takes |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5ed471b58f4f..7519eb4191e7 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -302,7 +302,7 @@ void get_zone_counts(unsigned long *active, unsigned long *inactive, | |||
302 | void build_all_zonelists(void); | 302 | void build_all_zonelists(void); |
303 | void wakeup_kswapd(struct zone *zone, int order); | 303 | void wakeup_kswapd(struct zone *zone, int order); |
304 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 304 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
305 | int alloc_type, int can_try_harder, int gfp_high); | 305 | int alloc_type, int can_try_harder, gfp_t gfp_high); |
306 | 306 | ||
307 | #ifdef CONFIG_HAVE_MEMORY_PRESENT | 307 | #ifdef CONFIG_HAVE_MEMORY_PRESENT |
308 | void memory_present(int nid, unsigned long start, unsigned long end); | 308 | void memory_present(int nid, unsigned long start, unsigned long end); |
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/namei.h b/include/linux/namei.h index 7db67b008cac..1c975d0d9e94 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -8,6 +8,7 @@ struct vfsmount; | |||
8 | struct open_intent { | 8 | struct open_intent { |
9 | int flags; | 9 | int flags; |
10 | int create_mode; | 10 | int create_mode; |
11 | struct file *file; | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | enum { MAX_NESTED_LINKS = 5 }; | 14 | enum { MAX_NESTED_LINKS = 5 }; |
@@ -65,6 +66,13 @@ extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); | |||
65 | extern void path_release(struct nameidata *); | 66 | extern void path_release(struct nameidata *); |
66 | extern void path_release_on_umount(struct nameidata *); | 67 | extern void path_release_on_umount(struct nameidata *); |
67 | 68 | ||
69 | extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags); | ||
70 | extern int path_lookup_open(const char *, unsigned lookup_flags, struct nameidata *, int open_flags); | ||
71 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | ||
72 | int (*open)(struct inode *, struct file *)); | ||
73 | extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | ||
74 | extern void release_open_intent(struct nameidata *); | ||
75 | |||
68 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | 76 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); |
69 | extern struct dentry * lookup_hash(struct qstr *, struct dentry *); | 77 | extern struct dentry * lookup_hash(struct qstr *, struct dentry *); |
70 | 78 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5e90557715ab..deacea65273a 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, |
@@ -856,11 +877,9 @@ static inline void netif_rx_complete(struct net_device *dev) | |||
856 | 877 | ||
857 | static inline void netif_poll_disable(struct net_device *dev) | 878 | static inline void netif_poll_disable(struct net_device *dev) |
858 | { | 879 | { |
859 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { | 880 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) |
860 | /* No hurry. */ | 881 | /* No hurry. */ |
861 | current->state = TASK_INTERRUPTIBLE; | 882 | schedule_timeout_interruptible(1); |
862 | schedule_timeout(1); | ||
863 | } | ||
864 | } | 883 | } |
865 | 884 | ||
866 | static inline void netif_poll_enable(struct net_device *dev) | 885 | static inline void netif_poll_enable(struct net_device *dev) |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 1d5b10ae2399..f08e870100f4 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -41,11 +41,15 @@ enum nfnetlink_groups { | |||
41 | struct nfattr | 41 | struct nfattr |
42 | { | 42 | { |
43 | u_int16_t nfa_len; | 43 | u_int16_t nfa_len; |
44 | u_int16_t nfa_type; | 44 | u_int16_t nfa_type; /* we use 15 bits for the type, and the highest |
45 | * bit to indicate whether the payload is nested */ | ||
45 | } __attribute__ ((packed)); | 46 | } __attribute__ ((packed)); |
46 | 47 | ||
47 | /* FIXME: Shamelessly copy and pasted from rtnetlink.h, it's time | 48 | /* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from |
48 | * to put this in a generic file */ | 49 | * rtnetlink.h, it's time to put this in a generic file */ |
50 | |||
51 | #define NFNL_NFA_NEST 0x8000 | ||
52 | #define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff) | ||
49 | 53 | ||
50 | #define NFA_ALIGNTO 4 | 54 | #define NFA_ALIGNTO 4 |
51 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) | 55 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) |
@@ -59,7 +63,7 @@ struct nfattr | |||
59 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) | 63 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) |
60 | #define NFA_NEST(skb, type) \ | 64 | #define NFA_NEST(skb, type) \ |
61 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ | 65 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ |
62 | NFA_PUT(skb, type, 0, NULL); \ | 66 | NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ |
63 | __start; }) | 67 | __start; }) |
64 | #define NFA_NEST_END(skb, start) \ | 68 | #define NFA_NEST_END(skb, start) \ |
65 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ | 69 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 5c55751c78e4..116fcaced909 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -70,15 +70,24 @@ enum ctattr_l4proto { | |||
70 | 70 | ||
71 | enum ctattr_protoinfo { | 71 | enum ctattr_protoinfo { |
72 | CTA_PROTOINFO_UNSPEC, | 72 | CTA_PROTOINFO_UNSPEC, |
73 | CTA_PROTOINFO_TCP_STATE, | 73 | CTA_PROTOINFO_TCP, |
74 | __CTA_PROTOINFO_MAX | 74 | __CTA_PROTOINFO_MAX |
75 | }; | 75 | }; |
76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
77 | 77 | ||
78 | enum ctattr_protoinfo_tcp { | ||
79 | CTA_PROTOINFO_TCP_UNSPEC, | ||
80 | CTA_PROTOINFO_TCP_STATE, | ||
81 | __CTA_PROTOINFO_TCP_MAX | ||
82 | }; | ||
83 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | ||
84 | |||
78 | enum ctattr_counters { | 85 | enum ctattr_counters { |
79 | CTA_COUNTERS_UNSPEC, | 86 | CTA_COUNTERS_UNSPEC, |
80 | CTA_COUNTERS_PACKETS, | 87 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ |
81 | CTA_COUNTERS_BYTES, | 88 | CTA_COUNTERS_BYTES, /* old 64bit counters */ |
89 | CTA_COUNTERS32_PACKETS, | ||
90 | CTA_COUNTERS32_BYTES, | ||
82 | __CTA_COUNTERS_MAX | 91 | __CTA_COUNTERS_MAX |
83 | }; | 92 | }; |
84 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | 93 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index bace72a76cc4..d078bb91d9e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -117,6 +117,10 @@ enum ip_conntrack_events | |||
117 | /* NAT info */ | 117 | /* NAT info */ |
118 | IPCT_NATINFO_BIT = 10, | 118 | IPCT_NATINFO_BIT = 10, |
119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), |
120 | |||
121 | /* Counter highest bit has been set */ | ||
122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
120 | }; | 124 | }; |
121 | 125 | ||
122 | enum ip_conntrack_expect_events { | 126 | enum ip_conntrack_expect_events { |
@@ -192,8 +196,8 @@ do { \ | |||
192 | 196 | ||
193 | struct ip_conntrack_counter | 197 | struct 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 | ||
199 | struct ip_conntrack_helper; | 203 | struct ip_conntrack_helper; |
@@ -332,11 +336,28 @@ extern void need_ip_conntrack(void); | |||
332 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, | 336 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, |
333 | const struct ip_conntrack_tuple *orig); | 337 | const struct ip_conntrack_tuple *orig); |
334 | 338 | ||
339 | extern void __ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
340 | enum ip_conntrack_info ctinfo, | ||
341 | const struct sk_buff *skb, | ||
342 | unsigned long extra_jiffies, | ||
343 | int do_acct); | ||
344 | |||
345 | /* Refresh conntrack for this many jiffies and do accounting */ | ||
346 | static inline void ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
347 | enum ip_conntrack_info ctinfo, | ||
348 | const struct sk_buff *skb, | ||
349 | unsigned long extra_jiffies) | ||
350 | { | ||
351 | __ip_ct_refresh_acct(ct, ctinfo, skb, extra_jiffies, 1); | ||
352 | } | ||
353 | |||
335 | /* Refresh conntrack for this many jiffies */ | 354 | /* Refresh conntrack for this many jiffies */ |
336 | extern void ip_ct_refresh_acct(struct ip_conntrack *ct, | 355 | static inline void ip_ct_refresh(struct ip_conntrack *ct, |
337 | enum ip_conntrack_info ctinfo, | 356 | const struct sk_buff *skb, |
338 | const struct sk_buff *skb, | 357 | unsigned long extra_jiffies) |
339 | unsigned long extra_jiffies); | 358 | { |
359 | __ip_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | ||
360 | } | ||
340 | 361 | ||
341 | /* These are for NAT. Icky. */ | 362 | /* These are for NAT. Icky. */ |
342 | /* Update TCP window tracking data when NAT mangles the packet */ | 363 | /* Update TCP window tracking data when NAT mangles the packet */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h index 389e3851d52f..816144c75de0 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h | |||
@@ -60,8 +60,8 @@ struct ip_ct_pptp_expect { | |||
60 | 60 | ||
61 | struct pptp_pkt_hdr { | 61 | struct pptp_pkt_hdr { |
62 | __u16 packetLength; | 62 | __u16 packetLength; |
63 | __u16 packetType; | 63 | __be16 packetType; |
64 | __u32 magicCookie; | 64 | __be32 magicCookie; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /* PptpControlMessageType values */ | 67 | /* PptpControlMessageType values */ |
@@ -93,7 +93,7 @@ struct pptp_pkt_hdr { | |||
93 | #define PPTP_REMOVE_DEVICE_ERROR 6 | 93 | #define PPTP_REMOVE_DEVICE_ERROR 6 |
94 | 94 | ||
95 | struct PptpControlHeader { | 95 | struct PptpControlHeader { |
96 | __u16 messageType; | 96 | __be16 messageType; |
97 | __u16 reserved; | 97 | __u16 reserved; |
98 | }; | 98 | }; |
99 | 99 | ||
@@ -106,13 +106,13 @@ struct PptpControlHeader { | |||
106 | #define PPTP_BEARER_CAP_DIGITAL 0x2 | 106 | #define PPTP_BEARER_CAP_DIGITAL 0x2 |
107 | 107 | ||
108 | struct PptpStartSessionRequest { | 108 | struct PptpStartSessionRequest { |
109 | __u16 protocolVersion; | 109 | __be16 protocolVersion; |
110 | __u8 reserved1; | 110 | __u8 reserved1; |
111 | __u8 reserved2; | 111 | __u8 reserved2; |
112 | __u32 framingCapability; | 112 | __be32 framingCapability; |
113 | __u32 bearerCapability; | 113 | __be32 bearerCapability; |
114 | __u16 maxChannels; | 114 | __be16 maxChannels; |
115 | __u16 firmwareRevision; | 115 | __be16 firmwareRevision; |
116 | __u8 hostName[64]; | 116 | __u8 hostName[64]; |
117 | __u8 vendorString[64]; | 117 | __u8 vendorString[64]; |
118 | }; | 118 | }; |
@@ -125,13 +125,13 @@ struct PptpStartSessionRequest { | |||
125 | #define PPTP_START_UNKNOWN_PROTOCOL 5 | 125 | #define PPTP_START_UNKNOWN_PROTOCOL 5 |
126 | 126 | ||
127 | struct PptpStartSessionReply { | 127 | struct PptpStartSessionReply { |
128 | __u16 protocolVersion; | 128 | __be16 protocolVersion; |
129 | __u8 resultCode; | 129 | __u8 resultCode; |
130 | __u8 generalErrorCode; | 130 | __u8 generalErrorCode; |
131 | __u32 framingCapability; | 131 | __be32 framingCapability; |
132 | __u32 bearerCapability; | 132 | __be32 bearerCapability; |
133 | __u16 maxChannels; | 133 | __be16 maxChannels; |
134 | __u16 firmwareRevision; | 134 | __be16 firmwareRevision; |
135 | __u8 hostName[64]; | 135 | __u8 hostName[64]; |
136 | __u8 vendorString[64]; | 136 | __u8 vendorString[64]; |
137 | }; | 137 | }; |
@@ -155,7 +155,7 @@ struct PptpStopSessionReply { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | struct PptpEchoRequest { | 157 | struct PptpEchoRequest { |
158 | __u32 identNumber; | 158 | __be32 identNumber; |
159 | }; | 159 | }; |
160 | 160 | ||
161 | /* PptpEchoReplyResultCode */ | 161 | /* PptpEchoReplyResultCode */ |
@@ -163,7 +163,7 @@ struct PptpEchoRequest { | |||
163 | #define PPTP_ECHO_GENERAL_ERROR 2 | 163 | #define PPTP_ECHO_GENERAL_ERROR 2 |
164 | 164 | ||
165 | struct PptpEchoReply { | 165 | struct PptpEchoReply { |
166 | __u32 identNumber; | 166 | __be32 identNumber; |
167 | __u8 resultCode; | 167 | __u8 resultCode; |
168 | __u8 generalErrorCode; | 168 | __u8 generalErrorCode; |
169 | __u16 reserved; | 169 | __u16 reserved; |
@@ -180,16 +180,16 @@ struct PptpEchoReply { | |||
180 | #define PPTP_DONT_CARE_BEARER_TYPE 3 | 180 | #define PPTP_DONT_CARE_BEARER_TYPE 3 |
181 | 181 | ||
182 | struct PptpOutCallRequest { | 182 | struct PptpOutCallRequest { |
183 | __u16 callID; | 183 | __be16 callID; |
184 | __u16 callSerialNumber; | 184 | __be16 callSerialNumber; |
185 | __u32 minBPS; | 185 | __be32 minBPS; |
186 | __u32 maxBPS; | 186 | __be32 maxBPS; |
187 | __u32 bearerType; | 187 | __be32 bearerType; |
188 | __u32 framingType; | 188 | __be32 framingType; |
189 | __u16 packetWindow; | 189 | __be16 packetWindow; |
190 | __u16 packetProcDelay; | 190 | __be16 packetProcDelay; |
191 | __u16 reserved1; | 191 | __u16 reserved1; |
192 | __u16 phoneNumberLength; | 192 | __be16 phoneNumberLength; |
193 | __u16 reserved2; | 193 | __u16 reserved2; |
194 | __u8 phoneNumber[64]; | 194 | __u8 phoneNumber[64]; |
195 | __u8 subAddress[64]; | 195 | __u8 subAddress[64]; |
@@ -205,24 +205,24 @@ struct PptpOutCallRequest { | |||
205 | #define PPTP_OUTCALL_DONT_ACCEPT 7 | 205 | #define PPTP_OUTCALL_DONT_ACCEPT 7 |
206 | 206 | ||
207 | struct PptpOutCallReply { | 207 | struct PptpOutCallReply { |
208 | __u16 callID; | 208 | __be16 callID; |
209 | __u16 peersCallID; | 209 | __be16 peersCallID; |
210 | __u8 resultCode; | 210 | __u8 resultCode; |
211 | __u8 generalErrorCode; | 211 | __u8 generalErrorCode; |
212 | __u16 causeCode; | 212 | __be16 causeCode; |
213 | __u32 connectSpeed; | 213 | __be32 connectSpeed; |
214 | __u16 packetWindow; | 214 | __be16 packetWindow; |
215 | __u16 packetProcDelay; | 215 | __be16 packetProcDelay; |
216 | __u32 physChannelID; | 216 | __be32 physChannelID; |
217 | }; | 217 | }; |
218 | 218 | ||
219 | struct PptpInCallRequest { | 219 | struct PptpInCallRequest { |
220 | __u16 callID; | 220 | __be16 callID; |
221 | __u16 callSerialNumber; | 221 | __be16 callSerialNumber; |
222 | __u32 callBearerType; | 222 | __be32 callBearerType; |
223 | __u32 physChannelID; | 223 | __be32 physChannelID; |
224 | __u16 dialedNumberLength; | 224 | __be16 dialedNumberLength; |
225 | __u16 dialingNumberLength; | 225 | __be16 dialingNumberLength; |
226 | __u8 dialedNumber[64]; | 226 | __u8 dialedNumber[64]; |
227 | __u8 dialingNumber[64]; | 227 | __u8 dialingNumber[64]; |
228 | __u8 subAddress[64]; | 228 | __u8 subAddress[64]; |
@@ -234,61 +234,54 @@ struct PptpInCallRequest { | |||
234 | #define PPTP_INCALL_DONT_ACCEPT 3 | 234 | #define PPTP_INCALL_DONT_ACCEPT 3 |
235 | 235 | ||
236 | struct PptpInCallReply { | 236 | struct PptpInCallReply { |
237 | __u16 callID; | 237 | __be16 callID; |
238 | __u16 peersCallID; | 238 | __be16 peersCallID; |
239 | __u8 resultCode; | 239 | __u8 resultCode; |
240 | __u8 generalErrorCode; | 240 | __u8 generalErrorCode; |
241 | __u16 packetWindow; | 241 | __be16 packetWindow; |
242 | __u16 packetProcDelay; | 242 | __be16 packetProcDelay; |
243 | __u16 reserved; | 243 | __u16 reserved; |
244 | }; | 244 | }; |
245 | 245 | ||
246 | struct PptpInCallConnected { | 246 | struct PptpInCallConnected { |
247 | __u16 peersCallID; | 247 | __be16 peersCallID; |
248 | __u16 reserved; | 248 | __u16 reserved; |
249 | __u32 connectSpeed; | 249 | __be32 connectSpeed; |
250 | __u16 packetWindow; | 250 | __be16 packetWindow; |
251 | __u16 packetProcDelay; | 251 | __be16 packetProcDelay; |
252 | __u32 callFramingType; | 252 | __be32 callFramingType; |
253 | }; | 253 | }; |
254 | 254 | ||
255 | struct PptpClearCallRequest { | 255 | struct PptpClearCallRequest { |
256 | __u16 callID; | 256 | __be16 callID; |
257 | __u16 reserved; | 257 | __u16 reserved; |
258 | }; | 258 | }; |
259 | 259 | ||
260 | struct PptpCallDisconnectNotify { | 260 | struct PptpCallDisconnectNotify { |
261 | __u16 callID; | 261 | __be16 callID; |
262 | __u8 resultCode; | 262 | __u8 resultCode; |
263 | __u8 generalErrorCode; | 263 | __u8 generalErrorCode; |
264 | __u16 causeCode; | 264 | __be16 causeCode; |
265 | __u16 reserved; | 265 | __u16 reserved; |
266 | __u8 callStatistics[128]; | 266 | __u8 callStatistics[128]; |
267 | }; | 267 | }; |
268 | 268 | ||
269 | struct PptpWanErrorNotify { | 269 | struct PptpWanErrorNotify { |
270 | __u16 peersCallID; | 270 | __be16 peersCallID; |
271 | __u16 reserved; | 271 | __u16 reserved; |
272 | __u32 crcErrors; | 272 | __be32 crcErrors; |
273 | __u32 framingErrors; | 273 | __be32 framingErrors; |
274 | __u32 hardwareOverRuns; | 274 | __be32 hardwareOverRuns; |
275 | __u32 bufferOverRuns; | 275 | __be32 bufferOverRuns; |
276 | __u32 timeoutErrors; | 276 | __be32 timeoutErrors; |
277 | __u32 alignmentErrors; | 277 | __be32 alignmentErrors; |
278 | }; | 278 | }; |
279 | 279 | ||
280 | struct PptpSetLinkInfo { | 280 | struct PptpSetLinkInfo { |
281 | __u16 peersCallID; | 281 | __be16 peersCallID; |
282 | __u16 reserved; | 282 | __u16 reserved; |
283 | __u32 sendAccm; | 283 | __be32 sendAccm; |
284 | __u32 recvAccm; | 284 | __be32 recvAccm; |
285 | }; | ||
286 | |||
287 | |||
288 | struct pptp_priv_data { | ||
289 | __u16 call_id; | ||
290 | __u16 mcall_id; | ||
291 | __u16 pcall_id; | ||
292 | }; | 285 | }; |
293 | 286 | ||
294 | union pptp_ctrl_union { | 287 | union pptp_ctrl_union { |
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 14dc0f7b6556..3232db11a4e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IP_CONNTRACK_TUPLE_H | 1 | #ifndef _IP_CONNTRACK_TUPLE_H |
2 | #define _IP_CONNTRACK_TUPLE_H | 2 | #define _IP_CONNTRACK_TUPLE_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | /* A `tuple' is a structure containing the information to uniquely | 6 | /* A `tuple' is a structure containing the information to uniquely |
5 | identify a connection. ie. if two packets have the same tuple, they | 7 | identify a connection. ie. if two packets have the same tuple, they |
6 | are in the same connection; if not, they are not. | 8 | are in the same connection; if not, they are not. |
@@ -17,7 +19,7 @@ union ip_conntrack_manip_proto | |||
17 | u_int16_t all; | 19 | u_int16_t all; |
18 | 20 | ||
19 | struct { | 21 | struct { |
20 | u_int16_t port; | 22 | __be16 port; |
21 | } tcp; | 23 | } tcp; |
22 | struct { | 24 | struct { |
23 | u_int16_t port; | 25 | u_int16_t port; |
@@ -29,7 +31,7 @@ union ip_conntrack_manip_proto | |||
29 | u_int16_t port; | 31 | u_int16_t port; |
30 | } sctp; | 32 | } sctp; |
31 | struct { | 33 | struct { |
32 | u_int16_t key; /* key is 32bit, pptp only uses 16 */ | 34 | __be16 key; /* key is 32bit, pptp only uses 16 */ |
33 | } gre; | 35 | } gre; |
34 | }; | 36 | }; |
35 | 37 | ||
@@ -65,7 +67,7 @@ struct ip_conntrack_tuple | |||
65 | u_int16_t port; | 67 | u_int16_t port; |
66 | } sctp; | 68 | } sctp; |
67 | struct { | 69 | struct { |
68 | u_int16_t key; /* key is 32bit, | 70 | __be16 key; /* key is 32bit, |
69 | * pptp only uses 16 */ | 71 | * pptp only uses 16 */ |
70 | } gre; | 72 | } gre; |
71 | } u; | 73 | } u; |
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index e201ec6e9905..41a107de17cf 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -58,10 +58,6 @@ extern rwlock_t ip_nat_lock; | |||
58 | struct ip_nat_info | 58 | struct ip_nat_info |
59 | { | 59 | { |
60 | struct list_head bysource; | 60 | struct list_head bysource; |
61 | |||
62 | /* Helper (NULL if none). */ | ||
63 | struct ip_nat_helper *helper; | ||
64 | |||
65 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; | 61 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; |
66 | }; | 62 | }; |
67 | 63 | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index 3b50eb91f007..30db23f06b03 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h | |||
@@ -5,16 +5,14 @@ | |||
5 | 5 | ||
6 | /* This header used to share core functionality between the standalone | 6 | /* This header used to share core functionality between the standalone |
7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | 7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ |
8 | extern int ip_nat_init(void); | ||
9 | extern void ip_nat_cleanup(void); | ||
10 | 8 | ||
11 | extern unsigned int nat_packet(struct ip_conntrack *ct, | 9 | extern unsigned int ip_nat_packet(struct ip_conntrack *ct, |
12 | enum ip_conntrack_info conntrackinfo, | 10 | enum ip_conntrack_info conntrackinfo, |
13 | unsigned int hooknum, | 11 | unsigned int hooknum, |
14 | struct sk_buff **pskb); | 12 | struct sk_buff **pskb); |
15 | 13 | ||
16 | extern int icmp_reply_translation(struct sk_buff **pskb, | 14 | extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb, |
17 | struct ip_conntrack *ct, | 15 | struct ip_conntrack *ct, |
18 | enum ip_nat_manip_type manip, | 16 | enum ip_nat_manip_type manip, |
19 | enum ip_conntrack_dir dir); | 17 | enum ip_conntrack_dir dir); |
20 | #endif /* _IP_NAT_CORE_H */ | 18 | #endif /* _IP_NAT_CORE_H */ |
diff --git a/include/linux/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 (* | |||
131 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 131 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
132 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 132 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
133 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 133 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
134 | __u32 group, unsigned int __nocast allocation); | 134 | __u32 group, gfp_t allocation); |
135 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 135 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); |
136 | extern int netlink_register_notifier(struct notifier_block *nb); | 136 | extern int netlink_register_notifier(struct notifier_block *nb); |
137 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 137 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 5ade54a78dbb..ca5a8733000f 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -86,7 +86,7 @@ static inline void netpoll_poll_unlock(void *have) | |||
86 | 86 | ||
87 | #else | 87 | #else |
88 | #define netpoll_rx(a) 0 | 88 | #define netpoll_rx(a) 0 |
89 | #define netpoll_poll_lock(a) 0 | 89 | #define netpoll_poll_lock(a) NULL |
90 | #define netpoll_poll_unlock(a) | 90 | #define netpoll_poll_unlock(a) |
91 | #endif | 91 | #endif |
92 | 92 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 9a6047ff1b25..325fe7ae49bb 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -41,6 +41,10 @@ | |||
41 | #define NFS_MAX_FILE_IO_BUFFER_SIZE 32768 | 41 | #define NFS_MAX_FILE_IO_BUFFER_SIZE 32768 |
42 | #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 | 42 | #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 |
43 | 43 | ||
44 | /* Default timeout values */ | ||
45 | #define NFS_MAX_UDP_TIMEOUT (60*HZ) | ||
46 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) | ||
47 | |||
44 | /* | 48 | /* |
45 | * superblock magic number for NFS | 49 | * superblock magic number for NFS |
46 | */ | 50 | */ |
@@ -137,6 +141,7 @@ struct nfs_inode { | |||
137 | unsigned long attrtimeo_timestamp; | 141 | unsigned long attrtimeo_timestamp; |
138 | __u64 change_attr; /* v4 only */ | 142 | __u64 change_attr; /* v4 only */ |
139 | 143 | ||
144 | unsigned long last_updated; | ||
140 | /* "Generation counter" for the attribute cache. This is | 145 | /* "Generation counter" for the attribute cache. This is |
141 | * bumped whenever we update the metadata on the | 146 | * bumped whenever we update the metadata on the |
142 | * server. | 147 | * server. |
@@ -236,13 +241,17 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
236 | return atomic_read(&NFS_I(inode)->data_updates) != 0; | 241 | return atomic_read(&NFS_I(inode)->data_updates) != 0; |
237 | } | 242 | } |
238 | 243 | ||
244 | static inline void nfs_mark_for_revalidate(struct inode *inode) | ||
245 | { | ||
246 | spin_lock(&inode->i_lock); | ||
247 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
248 | spin_unlock(&inode->i_lock); | ||
249 | } | ||
250 | |||
239 | static inline void NFS_CACHEINV(struct inode *inode) | 251 | static inline void NFS_CACHEINV(struct inode *inode) |
240 | { | 252 | { |
241 | if (!nfs_caches_unstable(inode)) { | 253 | if (!nfs_caches_unstable(inode)) |
242 | spin_lock(&inode->i_lock); | 254 | nfs_mark_for_revalidate(inode); |
243 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
244 | spin_unlock(&inode->i_lock); | ||
245 | } | ||
246 | } | 255 | } |
247 | 256 | ||
248 | static inline int nfs_server_capable(struct inode *inode, int cap) | 257 | static inline int nfs_server_capable(struct inode *inode, int cap) |
@@ -276,7 +285,7 @@ static inline long nfs_save_change_attribute(struct inode *inode) | |||
276 | static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) | 285 | static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) |
277 | { | 286 | { |
278 | return !nfs_caches_unstable(inode) | 287 | return !nfs_caches_unstable(inode) |
279 | && chattr == NFS_I(inode)->cache_change_attribute; | 288 | && time_after_eq(chattr, NFS_I(inode)->cache_change_attribute); |
280 | } | 289 | } |
281 | 290 | ||
282 | /* | 291 | /* |
@@ -286,6 +295,7 @@ extern void nfs_zap_caches(struct inode *); | |||
286 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, | 295 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, |
287 | struct nfs_fattr *); | 296 | struct nfs_fattr *); |
288 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | 297 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); |
298 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | ||
289 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 299 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
290 | extern int nfs_permission(struct inode *, int, struct nameidata *); | 300 | extern int nfs_permission(struct inode *, int, struct nameidata *); |
291 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); | 301 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); |
@@ -312,6 +322,12 @@ extern void nfs_file_clear_open_context(struct file *filp); | |||
312 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 322 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
313 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 323 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ |
314 | 324 | ||
325 | static inline void nfs_fattr_init(struct nfs_fattr *fattr) | ||
326 | { | ||
327 | fattr->valid = 0; | ||
328 | fattr->time_start = jiffies; | ||
329 | } | ||
330 | |||
315 | /* | 331 | /* |
316 | * linux/fs/nfs/file.c | 332 | * linux/fs/nfs/file.c |
317 | */ | 333 | */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index a2bf6914ff1b..40718669b9c8 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -41,7 +41,7 @@ struct nfs_fattr { | |||
41 | __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ | 41 | __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ |
42 | __u64 change_attr; /* NFSv4 change attribute */ | 42 | __u64 change_attr; /* NFSv4 change attribute */ |
43 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ | 43 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ |
44 | unsigned long timestamp; | 44 | unsigned long time_start; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ | 47 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
@@ -96,12 +96,13 @@ struct nfs4_change_info { | |||
96 | u64 after; | 96 | u64 after; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | struct nfs_seqid; | ||
99 | /* | 100 | /* |
100 | * Arguments to the open call. | 101 | * Arguments to the open call. |
101 | */ | 102 | */ |
102 | struct nfs_openargs { | 103 | struct nfs_openargs { |
103 | const struct nfs_fh * fh; | 104 | const struct nfs_fh * fh; |
104 | __u32 seqid; | 105 | struct nfs_seqid * seqid; |
105 | int open_flags; | 106 | int open_flags; |
106 | __u64 clientid; | 107 | __u64 clientid; |
107 | __u32 id; | 108 | __u32 id; |
@@ -123,6 +124,7 @@ struct nfs_openres { | |||
123 | struct nfs4_change_info cinfo; | 124 | struct nfs4_change_info cinfo; |
124 | __u32 rflags; | 125 | __u32 rflags; |
125 | struct nfs_fattr * f_attr; | 126 | struct nfs_fattr * f_attr; |
127 | struct nfs_fattr * dir_attr; | ||
126 | const struct nfs_server *server; | 128 | const struct nfs_server *server; |
127 | int delegation_type; | 129 | int delegation_type; |
128 | nfs4_stateid delegation; | 130 | nfs4_stateid delegation; |
@@ -136,7 +138,7 @@ struct nfs_openres { | |||
136 | struct nfs_open_confirmargs { | 138 | struct nfs_open_confirmargs { |
137 | const struct nfs_fh * fh; | 139 | const struct nfs_fh * fh; |
138 | nfs4_stateid stateid; | 140 | nfs4_stateid stateid; |
139 | __u32 seqid; | 141 | struct nfs_seqid * seqid; |
140 | }; | 142 | }; |
141 | 143 | ||
142 | struct nfs_open_confirmres { | 144 | struct nfs_open_confirmres { |
@@ -148,13 +150,16 @@ struct nfs_open_confirmres { | |||
148 | */ | 150 | */ |
149 | struct nfs_closeargs { | 151 | struct nfs_closeargs { |
150 | struct nfs_fh * fh; | 152 | struct nfs_fh * fh; |
151 | nfs4_stateid stateid; | 153 | nfs4_stateid * stateid; |
152 | __u32 seqid; | 154 | struct nfs_seqid * seqid; |
153 | int open_flags; | 155 | int open_flags; |
156 | const u32 * bitmask; | ||
154 | }; | 157 | }; |
155 | 158 | ||
156 | struct nfs_closeres { | 159 | struct nfs_closeres { |
157 | nfs4_stateid stateid; | 160 | nfs4_stateid stateid; |
161 | struct nfs_fattr * fattr; | ||
162 | const struct nfs_server *server; | ||
158 | }; | 163 | }; |
159 | /* | 164 | /* |
160 | * * Arguments to the lock,lockt, and locku call. | 165 | * * Arguments to the lock,lockt, and locku call. |
@@ -164,30 +169,19 @@ struct nfs_lowner { | |||
164 | u32 id; | 169 | u32 id; |
165 | }; | 170 | }; |
166 | 171 | ||
167 | struct nfs_open_to_lock { | ||
168 | __u32 open_seqid; | ||
169 | nfs4_stateid open_stateid; | ||
170 | __u32 lock_seqid; | ||
171 | struct nfs_lowner lock_owner; | ||
172 | }; | ||
173 | |||
174 | struct nfs_exist_lock { | ||
175 | nfs4_stateid stateid; | ||
176 | __u32 seqid; | ||
177 | }; | ||
178 | |||
179 | struct nfs_lock_opargs { | 172 | struct nfs_lock_opargs { |
173 | struct nfs_seqid * lock_seqid; | ||
174 | nfs4_stateid * lock_stateid; | ||
175 | struct nfs_seqid * open_seqid; | ||
176 | nfs4_stateid * open_stateid; | ||
177 | struct nfs_lowner lock_owner; | ||
180 | __u32 reclaim; | 178 | __u32 reclaim; |
181 | __u32 new_lock_owner; | 179 | __u32 new_lock_owner; |
182 | union { | ||
183 | struct nfs_open_to_lock *open_lock; | ||
184 | struct nfs_exist_lock *exist_lock; | ||
185 | } u; | ||
186 | }; | 180 | }; |
187 | 181 | ||
188 | struct nfs_locku_opargs { | 182 | struct nfs_locku_opargs { |
189 | __u32 seqid; | 183 | struct nfs_seqid * seqid; |
190 | nfs4_stateid stateid; | 184 | nfs4_stateid * stateid; |
191 | }; | 185 | }; |
192 | 186 | ||
193 | struct nfs_lockargs { | 187 | struct nfs_lockargs { |
@@ -262,6 +256,7 @@ struct nfs_writeargs { | |||
262 | enum nfs3_stable_how stable; | 256 | enum nfs3_stable_how stable; |
263 | unsigned int pgbase; | 257 | unsigned int pgbase; |
264 | struct page ** pages; | 258 | struct page ** pages; |
259 | const u32 * bitmask; | ||
265 | }; | 260 | }; |
266 | 261 | ||
267 | struct nfs_writeverf { | 262 | struct nfs_writeverf { |
@@ -273,6 +268,7 @@ struct nfs_writeres { | |||
273 | struct nfs_fattr * fattr; | 268 | struct nfs_fattr * fattr; |
274 | struct nfs_writeverf * verf; | 269 | struct nfs_writeverf * verf; |
275 | __u32 count; | 270 | __u32 count; |
271 | const struct nfs_server *server; | ||
276 | }; | 272 | }; |
277 | 273 | ||
278 | /* | 274 | /* |
@@ -550,6 +546,7 @@ struct nfs4_create_res { | |||
550 | struct nfs_fh * fh; | 546 | struct nfs_fh * fh; |
551 | struct nfs_fattr * fattr; | 547 | struct nfs_fattr * fattr; |
552 | struct nfs4_change_info dir_cinfo; | 548 | struct nfs4_change_info dir_cinfo; |
549 | struct nfs_fattr * dir_fattr; | ||
553 | }; | 550 | }; |
554 | 551 | ||
555 | struct nfs4_fsinfo_arg { | 552 | struct nfs4_fsinfo_arg { |
@@ -571,8 +568,17 @@ struct nfs4_link_arg { | |||
571 | const struct nfs_fh * fh; | 568 | const struct nfs_fh * fh; |
572 | const struct nfs_fh * dir_fh; | 569 | const struct nfs_fh * dir_fh; |
573 | const struct qstr * name; | 570 | const struct qstr * name; |
571 | const u32 * bitmask; | ||
572 | }; | ||
573 | |||
574 | struct nfs4_link_res { | ||
575 | const struct nfs_server * server; | ||
576 | struct nfs_fattr * fattr; | ||
577 | struct nfs4_change_info cinfo; | ||
578 | struct nfs_fattr * dir_attr; | ||
574 | }; | 579 | }; |
575 | 580 | ||
581 | |||
576 | struct nfs4_lookup_arg { | 582 | struct nfs4_lookup_arg { |
577 | const struct nfs_fh * dir_fh; | 583 | const struct nfs_fh * dir_fh; |
578 | const struct qstr * name; | 584 | const struct qstr * name; |
@@ -619,6 +625,13 @@ struct nfs4_readlink { | |||
619 | struct nfs4_remove_arg { | 625 | struct nfs4_remove_arg { |
620 | const struct nfs_fh * fh; | 626 | const struct nfs_fh * fh; |
621 | const struct qstr * name; | 627 | const struct qstr * name; |
628 | const u32 * bitmask; | ||
629 | }; | ||
630 | |||
631 | struct nfs4_remove_res { | ||
632 | const struct nfs_server * server; | ||
633 | struct nfs4_change_info cinfo; | ||
634 | struct nfs_fattr * dir_attr; | ||
622 | }; | 635 | }; |
623 | 636 | ||
624 | struct nfs4_rename_arg { | 637 | struct nfs4_rename_arg { |
@@ -626,11 +639,15 @@ struct nfs4_rename_arg { | |||
626 | const struct nfs_fh * new_dir; | 639 | const struct nfs_fh * new_dir; |
627 | const struct qstr * old_name; | 640 | const struct qstr * old_name; |
628 | const struct qstr * new_name; | 641 | const struct qstr * new_name; |
642 | const u32 * bitmask; | ||
629 | }; | 643 | }; |
630 | 644 | ||
631 | struct nfs4_rename_res { | 645 | struct nfs4_rename_res { |
646 | const struct nfs_server * server; | ||
632 | struct nfs4_change_info old_cinfo; | 647 | struct nfs4_change_info old_cinfo; |
648 | struct nfs_fattr * old_fattr; | ||
633 | struct nfs4_change_info new_cinfo; | 649 | struct nfs4_change_info new_cinfo; |
650 | struct nfs_fattr * new_fattr; | ||
634 | }; | 651 | }; |
635 | 652 | ||
636 | struct nfs4_setclientid { | 653 | struct nfs4_setclientid { |
@@ -722,7 +739,7 @@ struct nfs_rpc_ops { | |||
722 | int (*write) (struct nfs_write_data *); | 739 | int (*write) (struct nfs_write_data *); |
723 | int (*commit) (struct nfs_write_data *); | 740 | int (*commit) (struct nfs_write_data *); |
724 | int (*create) (struct inode *, struct dentry *, | 741 | int (*create) (struct inode *, struct dentry *, |
725 | struct iattr *, int); | 742 | struct iattr *, int, struct nameidata *); |
726 | int (*remove) (struct inode *, struct qstr *); | 743 | int (*remove) (struct inode *, struct qstr *); |
727 | int (*unlink_setup) (struct rpc_message *, | 744 | int (*unlink_setup) (struct rpc_message *, |
728 | struct dentry *, struct qstr *); | 745 | struct dentry *, struct qstr *); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index d9a25647a295..ba6c310a055f 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -19,18 +19,19 @@ | |||
19 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ | 19 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ |
20 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ | 20 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ |
21 | 21 | ||
22 | static inline unsigned int __nocast mapping_gfp_mask(struct address_space * mapping) | 22 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
23 | { | 23 | { |
24 | return mapping->flags & __GFP_BITS_MASK; | 24 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; |
25 | } | 25 | } |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * This is non-atomic. Only to be used before the mapping is activated. | 28 | * This is non-atomic. Only to be used before the mapping is activated. |
29 | * Probably needs a barrier... | 29 | * Probably needs a barrier... |
30 | */ | 30 | */ |
31 | static inline void mapping_set_gfp_mask(struct address_space *m, int mask) | 31 | static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) |
32 | { | 32 | { |
33 | m->flags = (m->flags & ~__GFP_BITS_MASK) | mask; | 33 | m->flags = (m->flags & ~(__force unsigned long)__GFP_BITS_MASK) | |
34 | (__force unsigned long)mask; | ||
34 | } | 35 | } |
35 | 36 | ||
36 | /* | 37 | /* |
@@ -69,7 +70,7 @@ extern struct page * find_lock_page(struct address_space *mapping, | |||
69 | extern struct page * find_trylock_page(struct address_space *mapping, | 70 | extern struct page * find_trylock_page(struct address_space *mapping, |
70 | unsigned long index); | 71 | unsigned long index); |
71 | extern struct page * find_or_create_page(struct address_space *mapping, | 72 | extern struct page * find_or_create_page(struct address_space *mapping, |
72 | unsigned long index, unsigned int gfp_mask); | 73 | unsigned long index, gfp_t gfp_mask); |
73 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, | 74 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, |
74 | unsigned int nr_pages, struct page **pages); | 75 | unsigned int nr_pages, struct page **pages); |
75 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 76 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, |
@@ -92,9 +93,9 @@ extern int read_cache_pages(struct address_space *mapping, | |||
92 | struct list_head *pages, filler_t *filler, void *data); | 93 | struct list_head *pages, filler_t *filler, void *data); |
93 | 94 | ||
94 | int add_to_page_cache(struct page *page, struct address_space *mapping, | 95 | int add_to_page_cache(struct page *page, struct address_space *mapping, |
95 | unsigned long index, int gfp_mask); | 96 | unsigned long index, gfp_t gfp_mask); |
96 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | 97 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |
97 | unsigned long index, int gfp_mask); | 98 | unsigned long index, gfp_t gfp_mask); |
98 | extern void remove_from_page_cache(struct page *page); | 99 | extern void remove_from_page_cache(struct page *page); |
99 | extern void __remove_from_page_cache(struct page *page); | 100 | extern void __remove_from_page_cache(struct page *page); |
100 | 101 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c49d28eca561..71834f05504f 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 |
@@ -720,6 +723,7 @@ | |||
720 | #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 | 723 | #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 |
721 | #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 | 724 | #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 |
722 | #define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 | 725 | #define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 |
726 | #define PCI_DEVICE_ID_HP_DIVA_HURRICANE 0x132a | ||
723 | #define PCI_DEVICE_ID_HP_CISS 0x3210 | 727 | #define PCI_DEVICE_ID_HP_CISS 0x3210 |
724 | #define PCI_DEVICE_ID_HP_CISSA 0x3220 | 728 | #define PCI_DEVICE_ID_HP_CISSA 0x3220 |
725 | #define PCI_DEVICE_ID_HP_CISSB 0x3222 | 729 | #define PCI_DEVICE_ID_HP_CISSB 0x3222 |
@@ -769,6 +773,8 @@ | |||
769 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 | 773 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 |
770 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 774 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
771 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 775 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
776 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | ||
777 | #define PCI_DEVICE_ID_TI_X515 0x8036 | ||
772 | #define PCI_DEVICE_ID_TI_1130 0xac12 | 778 | #define PCI_DEVICE_ID_TI_1130 0xac12 |
773 | #define PCI_DEVICE_ID_TI_1031 0xac13 | 779 | #define PCI_DEVICE_ID_TI_1031 0xac13 |
774 | #define PCI_DEVICE_ID_TI_1131 0xac15 | 780 | #define PCI_DEVICE_ID_TI_1131 0xac15 |
@@ -785,12 +791,17 @@ | |||
785 | #define PCI_DEVICE_ID_TI_4451 0xac42 | 791 | #define PCI_DEVICE_ID_TI_4451 0xac42 |
786 | #define PCI_DEVICE_ID_TI_4510 0xac44 | 792 | #define PCI_DEVICE_ID_TI_4510 0xac44 |
787 | #define PCI_DEVICE_ID_TI_4520 0xac46 | 793 | #define PCI_DEVICE_ID_TI_4520 0xac46 |
794 | #define PCI_DEVICE_ID_TI_7510 0xac47 | ||
795 | #define PCI_DEVICE_ID_TI_7610 0xac48 | ||
796 | #define PCI_DEVICE_ID_TI_7410 0xac49 | ||
788 | #define PCI_DEVICE_ID_TI_1410 0xac50 | 797 | #define PCI_DEVICE_ID_TI_1410 0xac50 |
789 | #define PCI_DEVICE_ID_TI_1420 0xac51 | 798 | #define PCI_DEVICE_ID_TI_1420 0xac51 |
790 | #define PCI_DEVICE_ID_TI_1451A 0xac52 | 799 | #define PCI_DEVICE_ID_TI_1451A 0xac52 |
791 | #define PCI_DEVICE_ID_TI_1620 0xac54 | 800 | #define PCI_DEVICE_ID_TI_1620 0xac54 |
792 | #define PCI_DEVICE_ID_TI_1520 0xac55 | 801 | #define PCI_DEVICE_ID_TI_1520 0xac55 |
793 | #define PCI_DEVICE_ID_TI_1510 0xac56 | 802 | #define PCI_DEVICE_ID_TI_1510 0xac56 |
803 | #define PCI_DEVICE_ID_TI_X620 0xac8d | ||
804 | #define PCI_DEVICE_ID_TI_X420 0xac8e | ||
794 | 805 | ||
795 | #define PCI_VENDOR_ID_SONY 0x104d | 806 | #define PCI_VENDOR_ID_SONY 0x104d |
796 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 | 807 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 |
@@ -976,6 +987,7 @@ | |||
976 | #define PCI_DEVICE_ID_SUN_SABRE 0xa000 | 987 | #define PCI_DEVICE_ID_SUN_SABRE 0xa000 |
977 | #define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 | 988 | #define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 |
978 | #define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 | 989 | #define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 |
990 | #define PCI_DEVICE_ID_SUN_CASSINI 0xabba | ||
979 | 991 | ||
980 | #define PCI_VENDOR_ID_CMD 0x1095 | 992 | #define PCI_VENDOR_ID_CMD 0x1095 |
981 | #define PCI_DEVICE_ID_CMD_640 0x0640 | 993 | #define PCI_DEVICE_ID_CMD_640 0x0640 |
@@ -1268,7 +1280,8 @@ | |||
1268 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | 1280 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 |
1269 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | 1281 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 |
1270 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1282 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
1271 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x036F | 1283 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E |
1284 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | ||
1272 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | 1285 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 |
1273 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | 1286 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 |
1274 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B | 1287 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B |
@@ -2186,7 +2199,12 @@ | |||
2186 | #define PCI_DEVICE_ID_ENE_1211 0x1211 | 2199 | #define PCI_DEVICE_ID_ENE_1211 0x1211 |
2187 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 2200 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
2188 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 2201 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
2202 | #define PCI_DEVICE_ID_ENE_710 0x1411 | ||
2203 | #define PCI_DEVICE_ID_ENE_712 0x1412 | ||
2189 | #define PCI_DEVICE_ID_ENE_1420 0x1420 | 2204 | #define PCI_DEVICE_ID_ENE_1420 0x1420 |
2205 | #define PCI_DEVICE_ID_ENE_720 0x1421 | ||
2206 | #define PCI_DEVICE_ID_ENE_722 0x1422 | ||
2207 | |||
2190 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | 2208 | #define PCI_VENDOR_ID_CHELSIO 0x1425 |
2191 | 2209 | ||
2192 | #define PCI_VENDOR_ID_MIPS 0x153f | 2210 | #define PCI_VENDOR_ID_MIPS 0x153f |
@@ -2679,6 +2697,7 @@ | |||
2679 | 2697 | ||
2680 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d | 2698 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d |
2681 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 | 2699 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 |
2700 | #define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 | ||
2682 | 2701 | ||
2683 | #define PCI_VENDOR_ID_TIGERJET 0xe159 | 2702 | #define PCI_VENDOR_ID_TIGERJET 0xe159 |
2684 | #define PCI_DEVICE_ID_TIGERJET_300 0x0001 | 2703 | #define PCI_DEVICE_ID_TIGERJET_300 0x0001 |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 4caedddaa033..4bc241290c24 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -71,11 +71,11 @@ posix_acl_release(struct posix_acl *acl) | |||
71 | 71 | ||
72 | /* posix_acl.c */ | 72 | /* posix_acl.c */ |
73 | 73 | ||
74 | extern struct posix_acl *posix_acl_alloc(int, unsigned int __nocast); | 74 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); |
75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, unsigned int __nocast); | 75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); |
76 | extern int posix_acl_valid(const struct posix_acl *); | 76 | extern int posix_acl_valid(const struct posix_acl *); |
77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); |
78 | extern struct posix_acl *posix_acl_from_mode(mode_t, unsigned int __nocast); | 78 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); |
79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); | 79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); |
80 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); | 80 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); |
81 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | 81 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 9c51917b1cce..9f0f9281f42a 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | struct radix_tree_root { | 25 | struct radix_tree_root { |
26 | unsigned int height; | 26 | unsigned int height; |
27 | unsigned int gfp_mask; | 27 | gfp_t gfp_mask; |
28 | struct radix_tree_node *rnode; | 28 | struct radix_tree_node *rnode; |
29 | }; | 29 | }; |
30 | 30 | ||
@@ -50,7 +50,7 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |||
50 | unsigned int | 50 | unsigned int |
51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
52 | unsigned long first_index, unsigned int max_items); | 52 | unsigned long first_index, unsigned int max_items); |
53 | int radix_tree_preload(unsigned int __nocast gfp_mask); | 53 | int radix_tree_preload(gfp_t gfp_mask); |
54 | void radix_tree_init(void); | 54 | void radix_tree_init(void); |
55 | void *radix_tree_tag_set(struct radix_tree_root *root, | 55 | void *radix_tree_tag_set(struct radix_tree_root *root, |
56 | unsigned long index, int tag); | 56 | unsigned long index, int tag); |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 4e65eb44adfd..70191a5a148f 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -94,6 +94,7 @@ struct rcu_data { | |||
94 | long batch; /* Batch # for current RCU batch */ | 94 | long batch; /* Batch # for current RCU batch */ |
95 | struct rcu_head *nxtlist; | 95 | struct rcu_head *nxtlist; |
96 | struct rcu_head **nxttail; | 96 | struct rcu_head **nxttail; |
97 | long count; /* # of queued items */ | ||
97 | struct rcu_head *curlist; | 98 | struct rcu_head *curlist; |
98 | struct rcu_head **curtail; | 99 | struct rcu_head **curtail; |
99 | struct rcu_head *donelist; | 100 | struct rcu_head *donelist; |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 3b3266ff1a95..7ab2cdb83ef0 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,6 +59,10 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_restart_prepare(char *cmd); | ||
63 | extern void kernel_halt_prepare(void); | ||
64 | extern void kernel_power_off_prepare(void); | ||
65 | |||
62 | extern void kernel_restart(char *cmd); | 66 | extern void kernel_restart(char *cmd); |
63 | extern void kernel_halt(void); | 67 | extern void kernel_halt(void); |
64 | extern void kernel_power_off(void); | 68 | extern void kernel_power_off(void); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index af00b10294cd..001ab82df051 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1972,7 +1972,7 @@ extern struct address_space_operations reiserfs_address_space_operations; | |||
1972 | 1972 | ||
1973 | /* fix_nodes.c */ | 1973 | /* fix_nodes.c */ |
1974 | #ifdef CONFIG_REISERFS_CHECK | 1974 | #ifdef CONFIG_REISERFS_CHECK |
1975 | void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s); | 1975 | void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s); |
1976 | void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); | 1976 | void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); |
1977 | #else | 1977 | #else |
1978 | static inline void *reiserfs_kmalloc(size_t size, int flags, | 1978 | static inline void *reiserfs_kmalloc(size_t size, int flags, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 49e617fa0f66..27519df0f987 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -107,13 +107,25 @@ extern unsigned long nr_iowait(void); | |||
107 | 107 | ||
108 | #include <asm/processor.h> | 108 | #include <asm/processor.h> |
109 | 109 | ||
110 | /* | ||
111 | * Task state bitmask. NOTE! These bits are also | ||
112 | * encoded in fs/proc/array.c: get_task_state(). | ||
113 | * | ||
114 | * We have two separate sets of flags: task->state | ||
115 | * is about runnability, while task->exit_state are | ||
116 | * about the task exiting. Confusing, but this way | ||
117 | * modifying one set can't modify the other one by | ||
118 | * mistake. | ||
119 | */ | ||
110 | #define TASK_RUNNING 0 | 120 | #define TASK_RUNNING 0 |
111 | #define TASK_INTERRUPTIBLE 1 | 121 | #define TASK_INTERRUPTIBLE 1 |
112 | #define TASK_UNINTERRUPTIBLE 2 | 122 | #define TASK_UNINTERRUPTIBLE 2 |
113 | #define TASK_STOPPED 4 | 123 | #define TASK_STOPPED 4 |
114 | #define TASK_TRACED 8 | 124 | #define TASK_TRACED 8 |
125 | /* in tsk->exit_state */ | ||
115 | #define EXIT_ZOMBIE 16 | 126 | #define EXIT_ZOMBIE 16 |
116 | #define EXIT_DEAD 32 | 127 | #define EXIT_DEAD 32 |
128 | /* in tsk->state again */ | ||
117 | #define TASK_NONINTERACTIVE 64 | 129 | #define TASK_NONINTERACTIVE 64 |
118 | 130 | ||
119 | #define __set_task_state(tsk, state_value) \ | 131 | #define __set_task_state(tsk, state_value) \ |
@@ -1006,6 +1018,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *); | |||
1006 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1018 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1007 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1019 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1008 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1020 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1021 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t); | ||
1009 | extern void do_notify_parent(struct task_struct *, int); | 1022 | extern void do_notify_parent(struct task_struct *, int); |
1010 | extern void force_sig(int, struct task_struct *); | 1023 | extern void force_sig(int, struct task_struct *); |
1011 | extern void force_sig_specific(int, struct task_struct *); | 1024 | extern void force_sig_specific(int, struct task_struct *); |
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h index 78f634007fc6..c85e103d5e7b 100644 --- a/include/linux/sdladrv.h +++ b/include/linux/sdladrv.h | |||
@@ -52,12 +52,8 @@ typedef struct sdlahw | |||
52 | 52 | ||
53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); | 53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); |
54 | extern int sdla_down (sdlahw_t* hw); | 54 | extern int sdla_down (sdlahw_t* hw); |
55 | extern int sdla_inten (sdlahw_t* hw); | ||
56 | extern int sdla_intde (sdlahw_t* hw); | ||
57 | extern int sdla_intack (sdlahw_t* hw); | ||
58 | extern void S514_intack (sdlahw_t* hw, u32 int_status); | 55 | extern void S514_intack (sdlahw_t* hw, u32 int_status); |
59 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); | 56 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); |
60 | extern int sdla_intr (sdlahw_t* hw); | ||
61 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); | 57 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); |
62 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, | 58 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, |
63 | unsigned len); | 59 | unsigned len); |
diff --git a/include/linux/security.h b/include/linux/security.h index 0e43460d374e..dac956ed98f0 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1210,7 +1210,7 @@ struct security_operations { | |||
1210 | int (*socket_shutdown) (struct socket * sock, int how); | 1210 | int (*socket_shutdown) (struct socket * sock, int how); |
1211 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); | 1211 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); |
1212 | int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); | 1212 | int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); |
1213 | int (*sk_alloc_security) (struct sock *sk, int family, int priority); | 1213 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); |
1214 | void (*sk_free_security) (struct sock *sk); | 1214 | void (*sk_free_security) (struct sock *sk); |
1215 | #endif /* CONFIG_SECURITY_NETWORK */ | 1215 | #endif /* CONFIG_SECURITY_NETWORK */ |
1216 | }; | 1216 | }; |
@@ -2634,8 +2634,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
2634 | return security_ops->socket_getpeersec(sock, optval, optlen, len); | 2634 | return security_ops->socket_getpeersec(sock, optval, optlen, len); |
2635 | } | 2635 | } |
2636 | 2636 | ||
2637 | static inline int security_sk_alloc(struct sock *sk, int family, | 2637 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
2638 | unsigned int __nocast priority) | ||
2639 | { | 2638 | { |
2640 | return security_ops->sk_alloc_security(sk, family, priority); | 2639 | return security_ops->sk_alloc_security(sk, family, priority); |
2641 | } | 2640 | } |
@@ -2752,8 +2751,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
2752 | return -ENOPROTOOPT; | 2751 | return -ENOPROTOOPT; |
2753 | } | 2752 | } |
2754 | 2753 | ||
2755 | static inline int security_sk_alloc(struct sock *sk, int family, | 2754 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
2756 | unsigned int __nocast priority) | ||
2757 | { | 2755 | { |
2758 | return 0; | 2756 | return 0; |
2759 | } | 2757 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2741c0c55e83..b756935da9c8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -155,8 +155,6 @@ struct skb_shared_info { | |||
155 | #define SKB_DATAREF_SHIFT 16 | 155 | #define SKB_DATAREF_SHIFT 16 |
156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) | 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
157 | 157 | ||
158 | extern struct timeval skb_tv_base; | ||
159 | |||
160 | struct skb_timeval { | 158 | struct skb_timeval { |
161 | u32 off_sec; | 159 | u32 off_sec; |
162 | u32 off_usec; | 160 | u32 off_usec; |
@@ -173,9 +171,8 @@ enum { | |||
173 | * struct sk_buff - socket buffer | 171 | * struct sk_buff - socket buffer |
174 | * @next: Next buffer in list | 172 | * @next: Next buffer in list |
175 | * @prev: Previous buffer in list | 173 | * @prev: Previous buffer in list |
176 | * @list: List we are on | ||
177 | * @sk: Socket we are owned by | 174 | * @sk: Socket we are owned by |
178 | * @tstamp: Time we arrived stored as offset to skb_tv_base | 175 | * @tstamp: Time we arrived |
179 | * @dev: Device we arrived on/are leaving by | 176 | * @dev: Device we arrived on/are leaving by |
180 | * @input_dev: Device we arrived on | 177 | * @input_dev: Device we arrived on |
181 | * @h: Transport layer header | 178 | * @h: Transport layer header |
@@ -192,6 +189,7 @@ enum { | |||
192 | * @cloned: Head may be cloned (check refcnt to be sure) | 189 | * @cloned: Head may be cloned (check refcnt to be sure) |
193 | * @nohdr: Payload reference only, must not modify header | 190 | * @nohdr: Payload reference only, must not modify header |
194 | * @pkt_type: Packet class | 191 | * @pkt_type: Packet class |
192 | * @fclone: skbuff clone status | ||
195 | * @ip_summed: Driver fed us an IP checksum | 193 | * @ip_summed: Driver fed us an IP checksum |
196 | * @priority: Packet queueing priority | 194 | * @priority: Packet queueing priority |
197 | * @users: User count - see {datagram,tcp}.c | 195 | * @users: User count - see {datagram,tcp}.c |
@@ -204,6 +202,7 @@ enum { | |||
204 | * @destructor: Destruct function | 202 | * @destructor: Destruct function |
205 | * @nfmark: Can be used for communication between hooks | 203 | * @nfmark: Can be used for communication between hooks |
206 | * @nfct: Associated connection, if any | 204 | * @nfct: Associated connection, if any |
205 | * @ipvs_property: skbuff is owned by ipvs | ||
207 | * @nfctinfo: Relationship of this skb to the connection | 206 | * @nfctinfo: Relationship of this skb to the connection |
208 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 207 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
209 | * @tc_index: Traffic control index | 208 | * @tc_index: Traffic control index |
@@ -304,37 +303,37 @@ struct sk_buff { | |||
304 | 303 | ||
305 | extern void __kfree_skb(struct sk_buff *skb); | 304 | extern void __kfree_skb(struct sk_buff *skb); |
306 | extern struct sk_buff *__alloc_skb(unsigned int size, | 305 | extern struct sk_buff *__alloc_skb(unsigned int size, |
307 | unsigned int __nocast priority, int fclone); | 306 | gfp_t priority, int fclone); |
308 | static inline struct sk_buff *alloc_skb(unsigned int size, | 307 | static inline struct sk_buff *alloc_skb(unsigned int size, |
309 | unsigned int __nocast priority) | 308 | gfp_t priority) |
310 | { | 309 | { |
311 | return __alloc_skb(size, priority, 0); | 310 | return __alloc_skb(size, priority, 0); |
312 | } | 311 | } |
313 | 312 | ||
314 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 313 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
315 | unsigned int __nocast priority) | 314 | gfp_t priority) |
316 | { | 315 | { |
317 | return __alloc_skb(size, priority, 1); | 316 | return __alloc_skb(size, priority, 1); |
318 | } | 317 | } |
319 | 318 | ||
320 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, | 319 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, |
321 | unsigned int size, | 320 | unsigned int size, |
322 | unsigned int __nocast priority); | 321 | gfp_t priority); |
323 | extern void kfree_skbmem(struct sk_buff *skb); | 322 | extern void kfree_skbmem(struct sk_buff *skb); |
324 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 323 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
325 | unsigned int __nocast priority); | 324 | gfp_t priority); |
326 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, | 325 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, |
327 | unsigned int __nocast priority); | 326 | gfp_t priority); |
328 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, | 327 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, |
329 | unsigned int __nocast gfp_mask); | 328 | gfp_t gfp_mask); |
330 | extern int pskb_expand_head(struct sk_buff *skb, | 329 | extern int pskb_expand_head(struct sk_buff *skb, |
331 | int nhead, int ntail, | 330 | int nhead, int ntail, |
332 | unsigned int __nocast gfp_mask); | 331 | gfp_t gfp_mask); |
333 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | 332 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
334 | unsigned int headroom); | 333 | unsigned int headroom); |
335 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 334 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
336 | int newheadroom, int newtailroom, | 335 | int newheadroom, int newtailroom, |
337 | unsigned int __nocast priority); | 336 | gfp_t priority); |
338 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); | 337 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); |
339 | #define dev_kfree_skb(a) kfree_skb(a) | 338 | #define dev_kfree_skb(a) kfree_skb(a) |
340 | extern void skb_over_panic(struct sk_buff *skb, int len, | 339 | extern void skb_over_panic(struct sk_buff *skb, int len, |
@@ -486,7 +485,7 @@ static inline int skb_shared(const struct sk_buff *skb) | |||
486 | * NULL is returned on a memory allocation failure. | 485 | * NULL is returned on a memory allocation failure. |
487 | */ | 486 | */ |
488 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | 487 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, |
489 | unsigned int __nocast pri) | 488 | gfp_t pri) |
490 | { | 489 | { |
491 | might_sleep_if(pri & __GFP_WAIT); | 490 | might_sleep_if(pri & __GFP_WAIT); |
492 | if (skb_shared(skb)) { | 491 | if (skb_shared(skb)) { |
@@ -518,7 +517,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | |||
518 | * %NULL is returned on a memory allocation failure. | 517 | * %NULL is returned on a memory allocation failure. |
519 | */ | 518 | */ |
520 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | 519 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, |
521 | unsigned int __nocast pri) | 520 | gfp_t pri) |
522 | { | 521 | { |
523 | might_sleep_if(pri & __GFP_WAIT); | 522 | might_sleep_if(pri & __GFP_WAIT); |
524 | if (skb_cloned(skb)) { | 523 | if (skb_cloned(skb)) { |
@@ -1019,7 +1018,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
1019 | * %NULL is returned in there is no free memory. | 1018 | * %NULL is returned in there is no free memory. |
1020 | */ | 1019 | */ |
1021 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | 1020 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, |
1022 | unsigned int __nocast gfp_mask) | 1021 | gfp_t gfp_mask) |
1023 | { | 1022 | { |
1024 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); | 1023 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); |
1025 | if (likely(skb)) | 1024 | if (likely(skb)) |
@@ -1132,8 +1131,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 | 1131 | * If there is no free memory -ENOMEM is returned, otherwise zero |
1133 | * is returned and the old skb data released. | 1132 | * is returned and the old skb data released. |
1134 | */ | 1133 | */ |
1135 | extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); | 1134 | extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); |
1136 | static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) | 1135 | static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) |
1137 | { | 1136 | { |
1138 | return __skb_linearize(skb, gfp); | 1137 | return __skb_linearize(skb, gfp); |
1139 | } | 1138 | } |
@@ -1255,10 +1254,6 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
1255 | { | 1254 | { |
1256 | stamp->tv_sec = skb->tstamp.off_sec; | 1255 | stamp->tv_sec = skb->tstamp.off_sec; |
1257 | stamp->tv_usec = skb->tstamp.off_usec; | 1256 | 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 | } | 1257 | } |
1263 | 1258 | ||
1264 | /** | 1259 | /** |
@@ -1272,8 +1267,8 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
1272 | */ | 1267 | */ |
1273 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | 1268 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) |
1274 | { | 1269 | { |
1275 | skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; | 1270 | skb->tstamp.off_sec = stamp->tv_sec; |
1276 | skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; | 1271 | skb->tstamp.off_usec = stamp->tv_usec; |
1277 | } | 1272 | } |
1278 | 1273 | ||
1279 | extern void __net_timestamp(struct sk_buff *skb); | 1274 | extern void __net_timestamp(struct sk_buff *skb); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 1f356f3bbc64..09b9aa60063d 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -61,11 +61,11 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo | |||
61 | void (*)(void *, kmem_cache_t *, unsigned long)); | 61 | void (*)(void *, kmem_cache_t *, unsigned long)); |
62 | extern int kmem_cache_destroy(kmem_cache_t *); | 62 | extern int kmem_cache_destroy(kmem_cache_t *); |
63 | extern int kmem_cache_shrink(kmem_cache_t *); | 63 | extern int kmem_cache_shrink(kmem_cache_t *); |
64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); | 64 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); |
65 | extern void kmem_cache_free(kmem_cache_t *, void *); | 65 | extern void kmem_cache_free(kmem_cache_t *, void *); |
66 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
67 | extern const char *kmem_cache_name(kmem_cache_t *); | 67 | extern const char *kmem_cache_name(kmem_cache_t *); |
68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); | 68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, gfp_t gfpflags); |
69 | 69 | ||
70 | /* Size description struct for general caches. */ | 70 | /* Size description struct for general caches. */ |
71 | struct cache_sizes { | 71 | struct cache_sizes { |
@@ -74,9 +74,9 @@ struct cache_sizes { | |||
74 | kmem_cache_t *cs_dmacachep; | 74 | kmem_cache_t *cs_dmacachep; |
75 | }; | 75 | }; |
76 | extern struct cache_sizes malloc_sizes[]; | 76 | extern struct cache_sizes malloc_sizes[]; |
77 | extern void *__kmalloc(size_t, unsigned int __nocast); | 77 | extern void *__kmalloc(size_t, gfp_t); |
78 | 78 | ||
79 | static inline void *kmalloc(size_t size, unsigned int __nocast flags) | 79 | static inline void *kmalloc(size_t size, gfp_t flags) |
80 | { | 80 | { |
81 | if (__builtin_constant_p(size)) { | 81 | if (__builtin_constant_p(size)) { |
82 | int i = 0; | 82 | int i = 0; |
@@ -99,7 +99,7 @@ found: | |||
99 | return __kmalloc(size, flags); | 99 | return __kmalloc(size, flags); |
100 | } | 100 | } |
101 | 101 | ||
102 | extern void *kzalloc(size_t, unsigned int __nocast); | 102 | extern void *kzalloc(size_t, gfp_t); |
103 | 103 | ||
104 | /** | 104 | /** |
105 | * kcalloc - allocate memory for an array. The memory is set to zero. | 105 | * kcalloc - allocate memory for an array. The memory is set to zero. |
@@ -107,7 +107,7 @@ extern void *kzalloc(size_t, unsigned int __nocast); | |||
107 | * @size: element size. | 107 | * @size: element size. |
108 | * @flags: the type of memory to allocate. | 108 | * @flags: the type of memory to allocate. |
109 | */ | 109 | */ |
110 | static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) | 110 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
111 | { | 111 | { |
112 | if (n != 0 && size > INT_MAX / n) | 112 | if (n != 0 && size > INT_MAX / n) |
113 | return NULL; | 113 | return NULL; |
@@ -118,15 +118,14 @@ extern void kfree(const void *); | |||
118 | extern unsigned int ksize(const void *); | 118 | extern unsigned int ksize(const void *); |
119 | 119 | ||
120 | #ifdef CONFIG_NUMA | 120 | #ifdef CONFIG_NUMA |
121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, | 121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
122 | unsigned int __nocast flags, int node); | 122 | extern void *kmalloc_node(size_t size, gfp_t flags, int node); |
123 | extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node); | ||
124 | #else | 123 | #else |
125 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) | 124 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) |
126 | { | 125 | { |
127 | return kmem_cache_alloc(cachep, flags); | 126 | return kmem_cache_alloc(cachep, flags); |
128 | } | 127 | } |
129 | static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) | 128 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
130 | { | 129 | { |
131 | return kmalloc(size, flags); | 130 | return kmalloc(size, flags); |
132 | } | 131 | } |
diff --git a/include/linux/string.h b/include/linux/string.h index dab2652acbd8..369be3264a55 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -88,7 +88,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t); | |||
88 | extern void * memchr(const void *,int,__kernel_size_t); | 88 | extern void * memchr(const void *,int,__kernel_size_t); |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | extern char *kstrdup(const char *s, unsigned int __nocast gfp); | 91 | extern char *kstrdup(const char *s, gfp_t gfp); |
92 | 92 | ||
93 | #ifdef __cplusplus | 93 | #ifdef __cplusplus |
94 | } | 94 | } |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 04ebc24db348..b68c11a2d6dd 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -66,7 +66,12 @@ struct rpc_cred_cache { | |||
66 | 66 | ||
67 | struct rpc_auth { | 67 | struct rpc_auth { |
68 | unsigned int au_cslack; /* call cred size estimate */ | 68 | unsigned int au_cslack; /* call cred size estimate */ |
69 | unsigned int au_rslack; /* reply verf size guess */ | 69 | /* guess at number of u32's auth adds before |
70 | * reply data; normally the verifier size: */ | ||
71 | unsigned int au_rslack; | ||
72 | /* for gss, used to calculate au_rslack: */ | ||
73 | unsigned int au_verfsize; | ||
74 | |||
70 | unsigned int au_flags; /* various flags */ | 75 | unsigned int au_flags; /* various flags */ |
71 | struct rpc_authops * au_ops; /* operations */ | 76 | struct rpc_authops * au_ops; /* operations */ |
72 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may | 77 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index eadb31e3c198..1a42d902bc11 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define RPCDBG_AUTH 0x0010 | 32 | #define RPCDBG_AUTH 0x0010 |
33 | #define RPCDBG_PMAP 0x0020 | 33 | #define RPCDBG_PMAP 0x0020 |
34 | #define RPCDBG_SCHED 0x0040 | 34 | #define RPCDBG_SCHED 0x0040 |
35 | #define RPCDBG_TRANS 0x0080 | ||
35 | #define RPCDBG_SVCSOCK 0x0100 | 36 | #define RPCDBG_SVCSOCK 0x0100 |
36 | #define RPCDBG_SVCDSP 0x0200 | 37 | #define RPCDBG_SVCDSP 0x0200 |
37 | #define RPCDBG_MISC 0x0400 | 38 | #define RPCDBG_MISC 0x0400 |
@@ -94,6 +95,8 @@ enum { | |||
94 | CTL_NLMDEBUG, | 95 | CTL_NLMDEBUG, |
95 | CTL_SLOTTABLE_UDP, | 96 | CTL_SLOTTABLE_UDP, |
96 | CTL_SLOTTABLE_TCP, | 97 | CTL_SLOTTABLE_TCP, |
98 | CTL_MIN_RESVPORT, | ||
99 | CTL_MAX_RESVPORT, | ||
97 | }; | 100 | }; |
98 | 101 | ||
99 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ | 102 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 689262f63059..9b8bcf125c18 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -40,14 +40,21 @@ int gss_import_sec_context( | |||
40 | struct gss_ctx **ctx_id); | 40 | struct gss_ctx **ctx_id); |
41 | u32 gss_get_mic( | 41 | u32 gss_get_mic( |
42 | struct gss_ctx *ctx_id, | 42 | struct gss_ctx *ctx_id, |
43 | u32 qop, | ||
44 | struct xdr_buf *message, | 43 | struct xdr_buf *message, |
45 | struct xdr_netobj *mic_token); | 44 | struct xdr_netobj *mic_token); |
46 | u32 gss_verify_mic( | 45 | u32 gss_verify_mic( |
47 | struct gss_ctx *ctx_id, | 46 | struct gss_ctx *ctx_id, |
48 | struct xdr_buf *message, | 47 | struct xdr_buf *message, |
49 | struct xdr_netobj *mic_token, | 48 | struct xdr_netobj *mic_token); |
50 | u32 *qstate); | 49 | u32 gss_wrap( |
50 | struct gss_ctx *ctx_id, | ||
51 | int offset, | ||
52 | struct xdr_buf *outbuf, | ||
53 | struct page **inpages); | ||
54 | u32 gss_unwrap( | ||
55 | struct gss_ctx *ctx_id, | ||
56 | int offset, | ||
57 | struct xdr_buf *inbuf); | ||
51 | u32 gss_delete_sec_context( | 58 | u32 gss_delete_sec_context( |
52 | struct gss_ctx **ctx_id); | 59 | struct gss_ctx **ctx_id); |
53 | 60 | ||
@@ -56,7 +63,6 @@ char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | |||
56 | 63 | ||
57 | struct pf_desc { | 64 | struct pf_desc { |
58 | u32 pseudoflavor; | 65 | u32 pseudoflavor; |
59 | u32 qop; | ||
60 | u32 service; | 66 | u32 service; |
61 | char *name; | 67 | char *name; |
62 | char *auth_domain_name; | 68 | char *auth_domain_name; |
@@ -85,14 +91,21 @@ struct gss_api_ops { | |||
85 | struct gss_ctx *ctx_id); | 91 | struct gss_ctx *ctx_id); |
86 | u32 (*gss_get_mic)( | 92 | u32 (*gss_get_mic)( |
87 | struct gss_ctx *ctx_id, | 93 | struct gss_ctx *ctx_id, |
88 | u32 qop, | ||
89 | struct xdr_buf *message, | 94 | struct xdr_buf *message, |
90 | struct xdr_netobj *mic_token); | 95 | struct xdr_netobj *mic_token); |
91 | u32 (*gss_verify_mic)( | 96 | u32 (*gss_verify_mic)( |
92 | struct gss_ctx *ctx_id, | 97 | struct gss_ctx *ctx_id, |
93 | struct xdr_buf *message, | 98 | struct xdr_buf *message, |
94 | struct xdr_netobj *mic_token, | 99 | struct xdr_netobj *mic_token); |
95 | u32 *qstate); | 100 | u32 (*gss_wrap)( |
101 | struct gss_ctx *ctx_id, | ||
102 | int offset, | ||
103 | struct xdr_buf *outbuf, | ||
104 | struct page **inpages); | ||
105 | u32 (*gss_unwrap)( | ||
106 | struct gss_ctx *ctx_id, | ||
107 | int offset, | ||
108 | struct xdr_buf *buf); | ||
96 | void (*gss_delete_sec_context)( | 109 | void (*gss_delete_sec_context)( |
97 | void *internal_ctx_id); | 110 | void *internal_ctx_id); |
98 | }; | 111 | }; |
diff --git a/include/linux/sunrpc/gss_err.h b/include/linux/sunrpc/gss_err.h index 92608a2e574c..a6807867bd21 100644 --- a/include/linux/sunrpc/gss_err.h +++ b/include/linux/sunrpc/gss_err.h | |||
@@ -66,16 +66,6 @@ typedef unsigned int OM_uint32; | |||
66 | 66 | ||
67 | 67 | ||
68 | /* | 68 | /* |
69 | * Define the default Quality of Protection for per-message services. Note | ||
70 | * that an implementation that offers multiple levels of QOP may either reserve | ||
71 | * a value (for example zero, as assumed here) to mean "default protection", or | ||
72 | * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit | ||
73 | * QOP value. However a value of 0 should always be interpreted by a GSSAPI | ||
74 | * implementation as a request for the default protection level. | ||
75 | */ | ||
76 | #define GSS_C_QOP_DEFAULT 0 | ||
77 | |||
78 | /* | ||
79 | * Expiration time of 2^32-1 seconds means infinite lifetime for a | 69 | * Expiration time of 2^32-1 seconds means infinite lifetime for a |
80 | * credential or security context | 70 | * credential or security context |
81 | */ | 71 | */ |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index ffe31d2eb9ec..2c3601d31045 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
@@ -116,18 +116,22 @@ enum seal_alg { | |||
116 | 116 | ||
117 | s32 | 117 | s32 |
118 | make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | 118 | make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, |
119 | struct xdr_netobj *cksum); | 119 | int body_offset, struct xdr_netobj *cksum); |
120 | |||
121 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | ||
122 | struct xdr_netobj *); | ||
123 | |||
124 | u32 gss_verify_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | ||
125 | struct xdr_netobj *); | ||
120 | 126 | ||
121 | u32 | 127 | u32 |
122 | krb5_make_token(struct krb5_ctx *context_handle, int qop_req, | 128 | gss_wrap_kerberos(struct gss_ctx *ctx_id, int offset, |
123 | struct xdr_buf *input_message_buffer, | 129 | struct xdr_buf *outbuf, struct page **pages); |
124 | struct xdr_netobj *output_message_buffer, int toktype); | ||
125 | 130 | ||
126 | u32 | 131 | u32 |
127 | krb5_read_token(struct krb5_ctx *context_handle, | 132 | gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset, |
128 | struct xdr_netobj *input_token_buffer, | 133 | struct xdr_buf *buf); |
129 | struct xdr_buf *message_buffer, | 134 | |
130 | int *qop_state, int toktype); | ||
131 | 135 | ||
132 | u32 | 136 | u32 |
133 | krb5_encrypt(struct crypto_tfm * key, | 137 | krb5_encrypt(struct crypto_tfm * key, |
@@ -137,6 +141,13 @@ u32 | |||
137 | krb5_decrypt(struct crypto_tfm * key, | 141 | krb5_decrypt(struct crypto_tfm * key, |
138 | void *iv, void *in, void *out, int length); | 142 | void *iv, void *in, void *out, int length); |
139 | 143 | ||
144 | int | ||
145 | gss_encrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *outbuf, int offset, | ||
146 | struct page **pages); | ||
147 | |||
148 | int | ||
149 | gss_decrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *inbuf, int offset); | ||
150 | |||
140 | s32 | 151 | s32 |
141 | krb5_make_seq_num(struct crypto_tfm * key, | 152 | krb5_make_seq_num(struct crypto_tfm * key, |
142 | int direction, | 153 | int direction, |
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h index b5c9968c3c17..0beb2cf00a84 100644 --- a/include/linux/sunrpc/gss_spkm3.h +++ b/include/linux/sunrpc/gss_spkm3.h | |||
@@ -41,9 +41,9 @@ struct spkm3_ctx { | |||
41 | #define SPKM_WRAP_TOK 5 | 41 | #define SPKM_WRAP_TOK 5 |
42 | #define SPKM_DEL_TOK 6 | 42 | #define SPKM_DEL_TOK 6 |
43 | 43 | ||
44 | u32 spkm3_make_token(struct spkm3_ctx *ctx, int qop_req, struct xdr_buf * text, struct xdr_netobj * token, int toktype); | 44 | u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype); |
45 | 45 | ||
46 | u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int *qop_state, int toktype); | 46 | u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype); |
47 | 47 | ||
48 | #define CKSUMTYPE_RSA_MD5 0x0007 | 48 | #define CKSUMTYPE_RSA_MD5 0x0007 |
49 | 49 | ||
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 15f115332389..f43f237360ae 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -76,5 +76,30 @@ enum rpc_auth_stat { | |||
76 | 76 | ||
77 | #define RPC_MAXNETNAMELEN 256 | 77 | #define RPC_MAXNETNAMELEN 256 |
78 | 78 | ||
79 | /* | ||
80 | * From RFC 1831: | ||
81 | * | ||
82 | * "A record is composed of one or more record fragments. A record | ||
83 | * fragment is a four-byte header followed by 0 to (2**31) - 1 bytes of | ||
84 | * fragment data. The bytes encode an unsigned binary number; as with | ||
85 | * XDR integers, the byte order is from highest to lowest. The number | ||
86 | * encodes two values -- a boolean which indicates whether the fragment | ||
87 | * is the last fragment of the record (bit value 1 implies the fragment | ||
88 | * is the last fragment) and a 31-bit unsigned binary value which is the | ||
89 | * length in bytes of the fragment's data. The boolean value is the | ||
90 | * highest-order bit of the header; the length is the 31 low-order bits. | ||
91 | * (Note that this record specification is NOT in XDR standard form!)" | ||
92 | * | ||
93 | * The Linux RPC client always sends its requests in a single record | ||
94 | * fragment, limiting the maximum payload size for stream transports to | ||
95 | * 2GB. | ||
96 | */ | ||
97 | |||
98 | typedef u32 rpc_fraghdr; | ||
99 | |||
100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) | ||
101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) | ||
102 | #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) | ||
103 | |||
79 | #endif /* __KERNEL__ */ | 104 | #endif /* __KERNEL__ */ |
80 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 105 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 23448d0fb5bc..5da968729cf8 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -161,14 +161,10 @@ typedef struct { | |||
161 | 161 | ||
162 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); | 162 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); |
163 | 163 | ||
164 | extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *); | ||
164 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, | 165 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, |
165 | skb_reader_t *, skb_read_actor_t); | 166 | skb_reader_t *, skb_read_actor_t); |
166 | 167 | ||
167 | struct socket; | ||
168 | struct sockaddr; | ||
169 | extern int xdr_sendpages(struct socket *, struct sockaddr *, int, | ||
170 | struct xdr_buf *, unsigned int, int); | ||
171 | |||
172 | extern int xdr_encode_word(struct xdr_buf *, int, u32); | 168 | extern int xdr_encode_word(struct xdr_buf *, int, u32); |
173 | extern int xdr_decode_word(struct xdr_buf *, int, u32 *); | 169 | extern int xdr_decode_word(struct xdr_buf *, int, u32 *); |
174 | 170 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index e618c1649814..3b8b6e823c70 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/sunrpc/clnt_xprt.h | 2 | * linux/include/linux/sunrpc/xprt.h |
3 | * | 3 | * |
4 | * Declarations for the RPC transport interface. | 4 | * Declarations for the RPC transport interface. |
5 | * | 5 | * |
@@ -15,20 +15,6 @@ | |||
15 | #include <linux/sunrpc/sched.h> | 15 | #include <linux/sunrpc/sched.h> |
16 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
17 | 17 | ||
18 | /* | ||
19 | * The transport code maintains an estimate on the maximum number of out- | ||
20 | * standing RPC requests, using a smoothed version of the congestion | ||
21 | * avoidance implemented in 44BSD. This is basically the Van Jacobson | ||
22 | * congestion algorithm: If a retransmit occurs, the congestion window is | ||
23 | * halved; otherwise, it is incremented by 1/cwnd when | ||
24 | * | ||
25 | * - a reply is received and | ||
26 | * - a full number of requests are outstanding and | ||
27 | * - the congestion window hasn't been updated recently. | ||
28 | * | ||
29 | * Upper procedures may check whether a request would block waiting for | ||
30 | * a free RPC slot by using the RPC_CONGESTED() macro. | ||
31 | */ | ||
32 | extern unsigned int xprt_udp_slot_table_entries; | 18 | extern unsigned int xprt_udp_slot_table_entries; |
33 | extern unsigned int xprt_tcp_slot_table_entries; | 19 | extern unsigned int xprt_tcp_slot_table_entries; |
34 | 20 | ||
@@ -36,34 +22,23 @@ extern unsigned int xprt_tcp_slot_table_entries; | |||
36 | #define RPC_DEF_SLOT_TABLE (16U) | 22 | #define RPC_DEF_SLOT_TABLE (16U) |
37 | #define RPC_MAX_SLOT_TABLE (128U) | 23 | #define RPC_MAX_SLOT_TABLE (128U) |
38 | 24 | ||
39 | #define RPC_CWNDSHIFT (8U) | ||
40 | #define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT) | ||
41 | #define RPC_INITCWND RPC_CWNDSCALE | ||
42 | #define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT) | ||
43 | #define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd) | ||
44 | |||
45 | /* Default timeout values */ | ||
46 | #define RPC_MAX_UDP_TIMEOUT (60*HZ) | ||
47 | #define RPC_MAX_TCP_TIMEOUT (600*HZ) | ||
48 | |||
49 | /* | 25 | /* |
50 | * Wait duration for an RPC TCP connection to be established. Solaris | 26 | * RPC call and reply header size as number of 32bit words (verifier |
51 | * NFS over TCP uses 60 seconds, for example, which is in line with how | 27 | * size computed separately) |
52 | * long a server takes to reboot. | ||
53 | */ | 28 | */ |
54 | #define RPC_CONNECT_TIMEOUT (60*HZ) | 29 | #define RPC_CALLHDRSIZE 6 |
30 | #define RPC_REPHDRSIZE 4 | ||
55 | 31 | ||
56 | /* | 32 | /* |
57 | * Delay an arbitrary number of seconds before attempting to reconnect | 33 | * Parameters for choosing a free port |
58 | * after an error. | ||
59 | */ | 34 | */ |
60 | #define RPC_REESTABLISH_TIMEOUT (15*HZ) | 35 | extern unsigned int xprt_min_resvport; |
36 | extern unsigned int xprt_max_resvport; | ||
61 | 37 | ||
62 | /* RPC call and reply header size as number of 32bit words (verifier | 38 | #define RPC_MIN_RESVPORT (1U) |
63 | * size computed separately) | 39 | #define RPC_MAX_RESVPORT (65535U) |
64 | */ | 40 | #define RPC_DEF_MIN_RESVPORT (650U) |
65 | #define RPC_CALLHDRSIZE 6 | 41 | #define RPC_DEF_MAX_RESVPORT (1023U) |
66 | #define RPC_REPHDRSIZE 4 | ||
67 | 42 | ||
68 | /* | 43 | /* |
69 | * This describes a timeout strategy | 44 | * This describes a timeout strategy |
@@ -76,6 +51,9 @@ struct rpc_timeout { | |||
76 | unsigned char to_exponential; | 51 | unsigned char to_exponential; |
77 | }; | 52 | }; |
78 | 53 | ||
54 | struct rpc_task; | ||
55 | struct rpc_xprt; | ||
56 | |||
79 | /* | 57 | /* |
80 | * This describes a complete RPC request | 58 | * This describes a complete RPC request |
81 | */ | 59 | */ |
@@ -95,7 +73,10 @@ struct rpc_rqst { | |||
95 | int rq_cong; /* has incremented xprt->cong */ | 73 | int rq_cong; /* has incremented xprt->cong */ |
96 | int rq_received; /* receive completed */ | 74 | int rq_received; /* receive completed */ |
97 | u32 rq_seqno; /* gss seq no. used on req. */ | 75 | u32 rq_seqno; /* gss seq no. used on req. */ |
98 | 76 | int rq_enc_pages_num; | |
77 | struct page **rq_enc_pages; /* scratch pages for use by | ||
78 | gss privacy code */ | ||
79 | void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */ | ||
99 | struct list_head rq_list; | 80 | struct list_head rq_list; |
100 | 81 | ||
101 | struct xdr_buf rq_private_buf; /* The receive buffer | 82 | struct xdr_buf rq_private_buf; /* The receive buffer |
@@ -121,12 +102,21 @@ struct rpc_rqst { | |||
121 | #define rq_svec rq_snd_buf.head | 102 | #define rq_svec rq_snd_buf.head |
122 | #define rq_slen rq_snd_buf.len | 103 | #define rq_slen rq_snd_buf.len |
123 | 104 | ||
124 | #define XPRT_LAST_FRAG (1 << 0) | 105 | struct rpc_xprt_ops { |
125 | #define XPRT_COPY_RECM (1 << 1) | 106 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
126 | #define XPRT_COPY_XID (1 << 2) | 107 | int (*reserve_xprt)(struct rpc_task *task); |
127 | #define XPRT_COPY_DATA (1 << 3) | 108 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
109 | void (*connect)(struct rpc_task *task); | ||
110 | int (*send_request)(struct rpc_task *task); | ||
111 | void (*set_retrans_timeout)(struct rpc_task *task); | ||
112 | void (*timer)(struct rpc_task *task); | ||
113 | void (*release_request)(struct rpc_task *task); | ||
114 | void (*close)(struct rpc_xprt *xprt); | ||
115 | void (*destroy)(struct rpc_xprt *xprt); | ||
116 | }; | ||
128 | 117 | ||
129 | struct rpc_xprt { | 118 | struct rpc_xprt { |
119 | struct rpc_xprt_ops * ops; /* transport methods */ | ||
130 | struct socket * sock; /* BSD socket layer */ | 120 | struct socket * sock; /* BSD socket layer */ |
131 | struct sock * inet; /* INET layer */ | 121 | struct sock * inet; /* INET layer */ |
132 | 122 | ||
@@ -137,11 +127,13 @@ struct rpc_xprt { | |||
137 | unsigned long cong; /* current congestion */ | 127 | unsigned long cong; /* current congestion */ |
138 | unsigned long cwnd; /* congestion window */ | 128 | unsigned long cwnd; /* congestion window */ |
139 | 129 | ||
140 | unsigned int rcvsize, /* socket receive buffer size */ | 130 | size_t rcvsize, /* transport rcv buffer size */ |
141 | sndsize; /* socket send buffer size */ | 131 | sndsize; /* transport send buffer size */ |
142 | 132 | ||
143 | size_t max_payload; /* largest RPC payload size, | 133 | size_t max_payload; /* largest RPC payload size, |
144 | in bytes */ | 134 | in bytes */ |
135 | unsigned int tsh_size; /* size of transport specific | ||
136 | header */ | ||
145 | 137 | ||
146 | struct rpc_wait_queue sending; /* requests waiting to send */ | 138 | struct rpc_wait_queue sending; /* requests waiting to send */ |
147 | struct rpc_wait_queue resend; /* requests waiting to resend */ | 139 | struct rpc_wait_queue resend; /* requests waiting to resend */ |
@@ -150,11 +142,9 @@ struct rpc_xprt { | |||
150 | struct list_head free; /* free slots */ | 142 | struct list_head free; /* free slots */ |
151 | struct rpc_rqst * slot; /* slot table storage */ | 143 | struct rpc_rqst * slot; /* slot table storage */ |
152 | unsigned int max_reqs; /* total slots */ | 144 | unsigned int max_reqs; /* total slots */ |
153 | unsigned long sockstate; /* Socket state */ | 145 | unsigned long state; /* transport state */ |
154 | unsigned char shutdown : 1, /* being shut down */ | 146 | unsigned char shutdown : 1, /* being shut down */ |
155 | nocong : 1, /* no congestion control */ | 147 | resvport : 1; /* use a reserved port */ |
156 | resvport : 1, /* use a reserved port */ | ||
157 | stream : 1; /* TCP */ | ||
158 | 148 | ||
159 | /* | 149 | /* |
160 | * XID | 150 | * XID |
@@ -171,22 +161,27 @@ struct rpc_xprt { | |||
171 | unsigned long tcp_copied, /* copied to request */ | 161 | unsigned long tcp_copied, /* copied to request */ |
172 | tcp_flags; | 162 | tcp_flags; |
173 | /* | 163 | /* |
174 | * Connection of sockets | 164 | * Connection of transports |
175 | */ | 165 | */ |
176 | struct work_struct sock_connect; | 166 | unsigned long connect_timeout, |
167 | bind_timeout, | ||
168 | reestablish_timeout; | ||
169 | struct work_struct connect_worker; | ||
177 | unsigned short port; | 170 | unsigned short port; |
171 | |||
178 | /* | 172 | /* |
179 | * Disconnection of idle sockets | 173 | * Disconnection of idle transports |
180 | */ | 174 | */ |
181 | struct work_struct task_cleanup; | 175 | struct work_struct task_cleanup; |
182 | struct timer_list timer; | 176 | struct timer_list timer; |
183 | unsigned long last_used; | 177 | unsigned long last_used, |
178 | idle_timeout; | ||
184 | 179 | ||
185 | /* | 180 | /* |
186 | * Send stuff | 181 | * Send stuff |
187 | */ | 182 | */ |
188 | spinlock_t sock_lock; /* lock socket info */ | 183 | spinlock_t transport_lock; /* lock transport info */ |
189 | spinlock_t xprt_lock; /* lock xprt info */ | 184 | spinlock_t reserve_lock; /* lock slot table */ |
190 | struct rpc_task * snd_task; /* Task blocked in send */ | 185 | struct rpc_task * snd_task; /* Task blocked in send */ |
191 | 186 | ||
192 | struct list_head recv; | 187 | struct list_head recv; |
@@ -195,37 +190,111 @@ struct rpc_xprt { | |||
195 | void (*old_data_ready)(struct sock *, int); | 190 | void (*old_data_ready)(struct sock *, int); |
196 | void (*old_state_change)(struct sock *); | 191 | void (*old_state_change)(struct sock *); |
197 | void (*old_write_space)(struct sock *); | 192 | void (*old_write_space)(struct sock *); |
198 | |||
199 | wait_queue_head_t cong_wait; | ||
200 | }; | 193 | }; |
201 | 194 | ||
195 | #define XPRT_LAST_FRAG (1 << 0) | ||
196 | #define XPRT_COPY_RECM (1 << 1) | ||
197 | #define XPRT_COPY_XID (1 << 2) | ||
198 | #define XPRT_COPY_DATA (1 << 3) | ||
199 | |||
202 | #ifdef __KERNEL__ | 200 | #ifdef __KERNEL__ |
203 | 201 | ||
204 | struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, | 202 | /* |
205 | struct rpc_timeout *toparms); | 203 | * Transport operations used by ULPs |
206 | int xprt_destroy(struct rpc_xprt *); | 204 | */ |
207 | void xprt_set_timeout(struct rpc_timeout *, unsigned int, | 205 | struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *to); |
208 | unsigned long); | 206 | void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr); |
209 | 207 | ||
210 | void xprt_reserve(struct rpc_task *); | 208 | /* |
211 | int xprt_prepare_transmit(struct rpc_task *); | 209 | * Generic internal transport functions |
212 | void xprt_transmit(struct rpc_task *); | 210 | */ |
213 | void xprt_receive(struct rpc_task *); | 211 | void xprt_connect(struct rpc_task *task); |
212 | void xprt_reserve(struct rpc_task *task); | ||
213 | int xprt_reserve_xprt(struct rpc_task *task); | ||
214 | int xprt_reserve_xprt_cong(struct rpc_task *task); | ||
215 | int xprt_prepare_transmit(struct rpc_task *task); | ||
216 | void xprt_transmit(struct rpc_task *task); | ||
217 | void xprt_abort_transmit(struct rpc_task *task); | ||
214 | int xprt_adjust_timeout(struct rpc_rqst *req); | 218 | int xprt_adjust_timeout(struct rpc_rqst *req); |
215 | void xprt_release(struct rpc_task *); | 219 | void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
216 | void xprt_connect(struct rpc_task *); | 220 | void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
217 | void xprt_sock_setbufsize(struct rpc_xprt *); | 221 | void xprt_release(struct rpc_task *task); |
218 | 222 | int xprt_destroy(struct rpc_xprt *xprt); | |
219 | #define XPRT_LOCKED 0 | 223 | |
220 | #define XPRT_CONNECT 1 | 224 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) |
221 | #define XPRT_CONNECTING 2 | 225 | { |
222 | 226 | return p + xprt->tsh_size; | |
223 | #define xprt_connected(xp) (test_bit(XPRT_CONNECT, &(xp)->sockstate)) | 227 | } |
224 | #define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) | 228 | |
225 | #define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) | 229 | /* |
226 | #define xprt_test_and_clear_connected(xp) \ | 230 | * Transport switch helper functions |
227 | (test_and_clear_bit(XPRT_CONNECT, &(xp)->sockstate)) | 231 | */ |
228 | #define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) | 232 | void xprt_set_retrans_timeout_def(struct rpc_task *task); |
233 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | ||
234 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | ||
235 | void xprt_wait_for_buffer_space(struct rpc_task *task); | ||
236 | void xprt_write_space(struct rpc_xprt *xprt); | ||
237 | void xprt_update_rtt(struct rpc_task *task); | ||
238 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | ||
239 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); | ||
240 | void xprt_complete_rqst(struct rpc_task *task, int copied); | ||
241 | void xprt_release_rqst_cong(struct rpc_task *task); | ||
242 | void xprt_disconnect(struct rpc_xprt *xprt); | ||
243 | |||
244 | /* | ||
245 | * Socket transport setup operations | ||
246 | */ | ||
247 | int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to); | ||
248 | int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to); | ||
249 | |||
250 | /* | ||
251 | * Reserved bit positions in xprt->state | ||
252 | */ | ||
253 | #define XPRT_LOCKED (0) | ||
254 | #define XPRT_CONNECTED (1) | ||
255 | #define XPRT_CONNECTING (2) | ||
256 | |||
257 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | ||
258 | { | ||
259 | set_bit(XPRT_CONNECTED, &xprt->state); | ||
260 | } | ||
261 | |||
262 | static inline void xprt_clear_connected(struct rpc_xprt *xprt) | ||
263 | { | ||
264 | clear_bit(XPRT_CONNECTED, &xprt->state); | ||
265 | } | ||
266 | |||
267 | static inline int xprt_connected(struct rpc_xprt *xprt) | ||
268 | { | ||
269 | return test_bit(XPRT_CONNECTED, &xprt->state); | ||
270 | } | ||
271 | |||
272 | static inline int xprt_test_and_set_connected(struct rpc_xprt *xprt) | ||
273 | { | ||
274 | return test_and_set_bit(XPRT_CONNECTED, &xprt->state); | ||
275 | } | ||
276 | |||
277 | static inline int xprt_test_and_clear_connected(struct rpc_xprt *xprt) | ||
278 | { | ||
279 | return test_and_clear_bit(XPRT_CONNECTED, &xprt->state); | ||
280 | } | ||
281 | |||
282 | static inline void xprt_clear_connecting(struct rpc_xprt *xprt) | ||
283 | { | ||
284 | smp_mb__before_clear_bit(); | ||
285 | clear_bit(XPRT_CONNECTING, &xprt->state); | ||
286 | smp_mb__after_clear_bit(); | ||
287 | } | ||
288 | |||
289 | static inline int xprt_connecting(struct rpc_xprt *xprt) | ||
290 | { | ||
291 | return test_bit(XPRT_CONNECTING, &xprt->state); | ||
292 | } | ||
293 | |||
294 | static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt) | ||
295 | { | ||
296 | return test_and_set_bit(XPRT_CONNECTING, &xprt->state); | ||
297 | } | ||
229 | 298 | ||
230 | #endif /* __KERNEL__*/ | 299 | #endif /* __KERNEL__*/ |
231 | 300 | ||
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index f2e96fdfaae0..ba448c760168 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -71,5 +71,7 @@ void restore_processor_state(void); | |||
71 | struct saved_context; | 71 | struct saved_context; |
72 | void __save_processor_state(struct saved_context *ctxt); | 72 | void __save_processor_state(struct saved_context *ctxt); |
73 | void __restore_processor_state(struct saved_context *ctxt); | 73 | void __restore_processor_state(struct saved_context *ctxt); |
74 | extern unsigned long get_usable_page(gfp_t gfp_mask); | ||
75 | extern void free_eaten_memory(void); | ||
74 | 76 | ||
75 | #endif /* _LINUX_SWSUSP_H */ | 77 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 3c9ff0048153..20c975642cab 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -147,7 +147,7 @@ struct swap_list_t { | |||
147 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | 147 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) |
148 | 148 | ||
149 | /* linux/mm/oom_kill.c */ | 149 | /* linux/mm/oom_kill.c */ |
150 | extern void out_of_memory(unsigned int __nocast gfp_mask, int order); | 150 | extern void out_of_memory(gfp_t gfp_mask, int order); |
151 | 151 | ||
152 | /* linux/mm/memory.c */ | 152 | /* linux/mm/memory.c */ |
153 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | 153 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); |
@@ -171,8 +171,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
171 | extern void swap_setup(void); | 171 | extern void swap_setup(void); |
172 | 172 | ||
173 | /* linux/mm/vmscan.c */ | 173 | /* linux/mm/vmscan.c */ |
174 | extern int try_to_free_pages(struct zone **, unsigned int); | 174 | extern int try_to_free_pages(struct zone **, gfp_t); |
175 | extern int zone_reclaim(struct zone *, unsigned int, unsigned int); | 175 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); |
176 | extern int shrink_all_memory(int); | 176 | extern int shrink_all_memory(int); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | 178 | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3a29a9f9b451..fc8e367f671e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -202,7 +202,8 @@ enum | |||
202 | NET_TR=14, | 202 | NET_TR=14, |
203 | NET_DECNET=15, | 203 | NET_DECNET=15, |
204 | NET_ECONET=16, | 204 | NET_ECONET=16, |
205 | NET_SCTP=17, | 205 | NET_SCTP=17, |
206 | NET_LLC=18, | ||
206 | }; | 207 | }; |
207 | 208 | ||
208 | /* /proc/sys/kernel/random */ | 209 | /* /proc/sys/kernel/random */ |
@@ -522,6 +523,29 @@ enum { | |||
522 | NET_IPX_FORWARDING=2 | 523 | NET_IPX_FORWARDING=2 |
523 | }; | 524 | }; |
524 | 525 | ||
526 | /* /proc/sys/net/llc */ | ||
527 | enum { | ||
528 | NET_LLC2=1, | ||
529 | NET_LLC_STATION=2, | ||
530 | }; | ||
531 | |||
532 | /* /proc/sys/net/llc/llc2 */ | ||
533 | enum { | ||
534 | NET_LLC2_TIMEOUT=1, | ||
535 | }; | ||
536 | |||
537 | /* /proc/sys/net/llc/station */ | ||
538 | enum { | ||
539 | NET_LLC_STATION_ACK_TIMEOUT=1, | ||
540 | }; | ||
541 | |||
542 | /* /proc/sys/net/llc/llc2/timeout */ | ||
543 | enum { | ||
544 | NET_LLC2_ACK_TIMEOUT=1, | ||
545 | NET_LLC2_P_TIMEOUT=2, | ||
546 | NET_LLC2_REJ_TIMEOUT=3, | ||
547 | NET_LLC2_BUSY_TIMEOUT=4, | ||
548 | }; | ||
525 | 549 | ||
526 | /* /proc/sys/net/appletalk */ | 550 | /* /proc/sys/net/appletalk */ |
527 | enum { | 551 | enum { |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index 081b1ee8516e..e21937cf91d0 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -71,7 +71,7 @@ enum | |||
71 | TCF_META_ID_SK_SNDBUF, | 71 | TCF_META_ID_SK_SNDBUF, |
72 | TCF_META_ID_SK_ALLOCS, | 72 | TCF_META_ID_SK_ALLOCS, |
73 | TCF_META_ID_SK_ROUTE_CAPS, | 73 | TCF_META_ID_SK_ROUTE_CAPS, |
74 | TCF_META_ID_SK_HASHENT, | 74 | TCF_META_ID_SK_HASH, |
75 | TCF_META_ID_SK_LINGERTIME, | 75 | TCF_META_ID_SK_LINGERTIME, |
76 | TCF_META_ID_SK_ACK_BACKLOG, | 76 | TCF_META_ID_SK_ACK_BACKLOG, |
77 | TCF_META_ID_SK_MAX_ACK_BACKLOG, | 77 | TCF_META_ID_SK_MAX_ACK_BACKLOG, |
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 941f45ac117a..fc5bb4e91a58 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
@@ -40,7 +40,7 @@ struct ts_state | |||
40 | struct ts_ops | 40 | struct ts_ops |
41 | { | 41 | { |
42 | const char *name; | 42 | const char *name; |
43 | struct ts_config * (*init)(const void *, unsigned int, int); | 43 | struct ts_config * (*init)(const void *, unsigned int, gfp_t); |
44 | unsigned int (*find)(struct ts_config *, | 44 | unsigned int (*find)(struct ts_config *, |
45 | struct ts_state *); | 45 | struct ts_state *); |
46 | void (*destroy)(struct ts_config *); | 46 | void (*destroy)(struct ts_config *); |
@@ -148,7 +148,7 @@ static inline unsigned int textsearch_get_pattern_len(struct ts_config *conf) | |||
148 | extern int textsearch_register(struct ts_ops *); | 148 | extern int textsearch_register(struct ts_ops *); |
149 | extern int textsearch_unregister(struct ts_ops *); | 149 | extern int textsearch_unregister(struct ts_ops *); |
150 | extern struct ts_config *textsearch_prepare(const char *, const void *, | 150 | extern struct ts_config *textsearch_prepare(const char *, const void *, |
151 | unsigned int, int, int); | 151 | unsigned int, gfp_t, int); |
152 | extern void textsearch_destroy(struct ts_config *conf); | 152 | extern void textsearch_destroy(struct ts_config *conf); |
153 | extern unsigned int textsearch_find_continuous(struct ts_config *, | 153 | extern unsigned int textsearch_find_continuous(struct ts_config *, |
154 | struct ts_state *, | 154 | struct ts_state *, |
@@ -158,7 +158,8 @@ extern unsigned int textsearch_find_continuous(struct ts_config *, | |||
158 | #define TS_PRIV_ALIGNTO 8 | 158 | #define TS_PRIV_ALIGNTO 8 |
159 | #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) | 159 | #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) |
160 | 160 | ||
161 | static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) | 161 | static inline struct ts_config *alloc_ts_config(size_t payload, |
162 | gfp_t gfp_mask) | ||
162 | { | 163 | { |
163 | struct ts_config *conf; | 164 | struct ts_config *conf; |
164 | 165 | ||
diff --git a/include/linux/types.h b/include/linux/types.h index 2b678c22ca4a..21b9ce803644 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -151,7 +151,12 @@ typedef unsigned long sector_t; | |||
151 | */ | 151 | */ |
152 | 152 | ||
153 | #ifdef __CHECKER__ | 153 | #ifdef __CHECKER__ |
154 | #define __bitwise __attribute__((bitwise)) | 154 | #define __bitwise__ __attribute__((bitwise)) |
155 | #else | ||
156 | #define __bitwise__ | ||
157 | #endif | ||
158 | #ifdef __CHECK_ENDIAN__ | ||
159 | #define __bitwise __bitwise__ | ||
155 | #else | 160 | #else |
156 | #define __bitwise | 161 | #define __bitwise |
157 | #endif | 162 | #endif |
@@ -165,6 +170,10 @@ typedef __u64 __bitwise __le64; | |||
165 | typedef __u64 __bitwise __be64; | 170 | typedef __u64 __bitwise __be64; |
166 | #endif | 171 | #endif |
167 | 172 | ||
173 | #ifdef __KERNEL__ | ||
174 | typedef unsigned __bitwise__ gfp_t; | ||
175 | #endif | ||
176 | |||
168 | struct ustat { | 177 | struct ustat { |
169 | __kernel_daddr_t f_tfree; | 178 | __kernel_daddr_t f_tfree; |
170 | __kernel_ino_t f_tinode; | 179 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 4dbe580f9335..8f731e8f2821 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -933,17 +933,17 @@ static inline void usb_fill_int_urb (struct urb *urb, | |||
933 | } | 933 | } |
934 | 934 | ||
935 | extern void usb_init_urb(struct urb *urb); | 935 | extern void usb_init_urb(struct urb *urb); |
936 | extern struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags); | 936 | extern struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags); |
937 | extern void usb_free_urb(struct urb *urb); | 937 | extern void usb_free_urb(struct urb *urb); |
938 | #define usb_put_urb usb_free_urb | 938 | #define usb_put_urb usb_free_urb |
939 | extern struct urb *usb_get_urb(struct urb *urb); | 939 | extern struct urb *usb_get_urb(struct urb *urb); |
940 | extern int usb_submit_urb(struct urb *urb, unsigned mem_flags); | 940 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); |
941 | extern int usb_unlink_urb(struct urb *urb); | 941 | extern int usb_unlink_urb(struct urb *urb); |
942 | extern void usb_kill_urb(struct urb *urb); | 942 | extern void usb_kill_urb(struct urb *urb); |
943 | 943 | ||
944 | #define HAVE_USB_BUFFERS | 944 | #define HAVE_USB_BUFFERS |
945 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 945 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
946 | unsigned mem_flags, dma_addr_t *dma); | 946 | gfp_t mem_flags, dma_addr_t *dma); |
947 | void usb_buffer_free (struct usb_device *dev, size_t size, | 947 | void usb_buffer_free (struct usb_device *dev, size_t size, |
948 | void *addr, dma_addr_t dma); | 948 | void *addr, dma_addr_t dma); |
949 | 949 | ||
@@ -1050,7 +1050,7 @@ int usb_sg_init ( | |||
1050 | struct scatterlist *sg, | 1050 | struct scatterlist *sg, |
1051 | int nents, | 1051 | int nents, |
1052 | size_t length, | 1052 | size_t length, |
1053 | unsigned mem_flags | 1053 | gfp_t mem_flags |
1054 | ); | 1054 | ); |
1055 | void usb_sg_cancel (struct usb_sg_request *io); | 1055 | void usb_sg_cancel (struct usb_sg_request *io); |
1056 | void usb_sg_wait (struct usb_sg_request *io); | 1056 | void usb_sg_wait (struct usb_sg_request *io); |
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 71e608607324..ff81117eb733 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -107,18 +107,18 @@ struct usb_ep_ops { | |||
107 | int (*disable) (struct usb_ep *ep); | 107 | int (*disable) (struct usb_ep *ep); |
108 | 108 | ||
109 | struct usb_request *(*alloc_request) (struct usb_ep *ep, | 109 | struct usb_request *(*alloc_request) (struct usb_ep *ep, |
110 | unsigned gfp_flags); | 110 | gfp_t gfp_flags); |
111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); | 111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); |
112 | 112 | ||
113 | void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, | 113 | void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, |
114 | dma_addr_t *dma, unsigned gfp_flags); | 114 | dma_addr_t *dma, gfp_t gfp_flags); |
115 | void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, | 115 | void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, |
116 | unsigned bytes); | 116 | unsigned bytes); |
117 | // NOTE: on 2.6, drivers may also use dma_map() and | 117 | // NOTE: on 2.6, drivers may also use dma_map() and |
118 | // dma_sync_single_*() to directly manage dma overhead. | 118 | // dma_sync_single_*() to directly manage dma overhead. |
119 | 119 | ||
120 | int (*queue) (struct usb_ep *ep, struct usb_request *req, | 120 | int (*queue) (struct usb_ep *ep, struct usb_request *req, |
121 | unsigned gfp_flags); | 121 | gfp_t gfp_flags); |
122 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | 122 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); |
123 | 123 | ||
124 | int (*set_halt) (struct usb_ep *ep, int value); | 124 | int (*set_halt) (struct usb_ep *ep, int value); |
@@ -214,7 +214,7 @@ usb_ep_disable (struct usb_ep *ep) | |||
214 | * Returns the request, or null if one could not be allocated. | 214 | * Returns the request, or null if one could not be allocated. |
215 | */ | 215 | */ |
216 | static inline struct usb_request * | 216 | static inline struct usb_request * |
217 | usb_ep_alloc_request (struct usb_ep *ep, unsigned gfp_flags) | 217 | usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) |
218 | { | 218 | { |
219 | return ep->ops->alloc_request (ep, gfp_flags); | 219 | return ep->ops->alloc_request (ep, gfp_flags); |
220 | } | 220 | } |
@@ -254,7 +254,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) | |||
254 | */ | 254 | */ |
255 | static inline void * | 255 | static inline void * |
256 | usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, | 256 | usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, |
257 | unsigned gfp_flags) | 257 | gfp_t gfp_flags) |
258 | { | 258 | { |
259 | return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); | 259 | return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); |
260 | } | 260 | } |
@@ -330,7 +330,7 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len) | |||
330 | * reported when the usb peripheral is disconnected. | 330 | * reported when the usb peripheral is disconnected. |
331 | */ | 331 | */ |
332 | static inline int | 332 | static inline int |
333 | usb_ep_queue (struct usb_ep *ep, struct usb_request *req, unsigned gfp_flags) | 333 | usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) |
334 | { | 334 | { |
335 | return ep->ops->queue (ep, req, gfp_flags); | 335 | return ep->ops->queue (ep, req, gfp_flags); |
336 | } | 336 | } |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index b244f69ef682..3701a0673d2c 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -34,8 +34,8 @@ struct vm_struct { | |||
34 | extern void *vmalloc(unsigned long size); | 34 | extern void *vmalloc(unsigned long size); |
35 | extern void *vmalloc_exec(unsigned long size); | 35 | extern void *vmalloc_exec(unsigned long size); |
36 | extern void *vmalloc_32(unsigned long size); | 36 | extern void *vmalloc_32(unsigned long size); |
37 | extern void *__vmalloc(unsigned long size, unsigned int __nocast gfp_mask, pgprot_t prot); | 37 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
38 | extern void *__vmalloc_area(struct vm_struct *area, unsigned int __nocast gfp_mask, pgprot_t prot); | 38 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot); |
39 | extern void vfree(void *addr); | 39 | extern void vfree(void *addr); |
40 | 40 | ||
41 | extern void *vmap(struct page **pages, unsigned int count, | 41 | extern void *vmap(struct page **pages, unsigned int count, |
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 167d956c492b..dae9860091dd 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h | |||
@@ -265,15 +265,6 @@ typedef struct { | |||
265 | #include <linux/tty_driver.h> | 265 | #include <linux/tty_driver.h> |
266 | #include <linux/tty_flip.h> | 266 | #include <linux/tty_flip.h> |
267 | 267 | ||
268 | |||
269 | #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) | ||
270 | #define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\ | ||
271 | ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0) | ||
272 | #define is_hex_digit(ch) ((((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')||\ | ||
273 | ((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'f')||\ | ||
274 | ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'F'))?1:0) | ||
275 | |||
276 | |||
277 | /****** Data Structures *****************************************************/ | 268 | /****** Data Structures *****************************************************/ |
278 | 269 | ||
279 | /* Adapter Data Space. | 270 | /* Adapter Data Space. |