diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-03-24 12:29:39 -0500 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-03-24 12:29:39 -0500 |
| commit | 4bbf7bc4c7bf1c80ec3c942fa5f1b6e6fa67dd99 (patch) | |
| tree | c4ff89dc09abe69d58db1e14da22ecda9fdd3ce8 /include/linux | |
| parent | 84ac69e8bf9f36eb0166817373336d14fa58f5cc (diff) | |
| parent | aec5c3c1a929d7d79a420e943285cf3ba26a7c0d (diff) | |
Merge branch 'upstream'
Conflicts:
drivers/scsi/libata-core.c
Diffstat (limited to 'include/linux')
54 files changed, 829 insertions, 155 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 7d8ff97b3e92..d9ed27969855 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
| @@ -46,6 +46,9 @@ | |||
| 46 | * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf | 46 | * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
| 47 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf | 47 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf |
| 48 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list | 48 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list |
| 49 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region | ||
| 50 | * bitmap_release_region(bitmap, pos, order) Free specified bit region | ||
| 51 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region | ||
| 49 | */ | 52 | */ |
| 50 | 53 | ||
| 51 | /* | 54 | /* |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 56bb6a4e15f3..c179966f1a2f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -22,6 +22,7 @@ typedef struct request_queue request_queue_t; | |||
| 22 | struct elevator_queue; | 22 | struct elevator_queue; |
| 23 | typedef struct elevator_queue elevator_t; | 23 | typedef struct elevator_queue elevator_t; |
| 24 | struct request_pm_state; | 24 | struct request_pm_state; |
| 25 | struct blk_trace; | ||
| 25 | 26 | ||
| 26 | #define BLKDEV_MIN_RQ 4 | 27 | #define BLKDEV_MIN_RQ 4 |
| 27 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 28 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
| @@ -416,6 +417,8 @@ struct request_queue | |||
| 416 | unsigned int sg_reserved_size; | 417 | unsigned int sg_reserved_size; |
| 417 | int node; | 418 | int node; |
| 418 | 419 | ||
| 420 | struct blk_trace *blk_trace; | ||
| 421 | |||
| 419 | /* | 422 | /* |
| 420 | * reserved for flush operations | 423 | * reserved for flush operations |
| 421 | */ | 424 | */ |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h new file mode 100644 index 000000000000..b34d3e73d5ea --- /dev/null +++ b/include/linux/blktrace_api.h | |||
| @@ -0,0 +1,277 @@ | |||
| 1 | #ifndef BLKTRACE_H | ||
| 2 | #define BLKTRACE_H | ||
| 3 | |||
| 4 | #include <linux/config.h> | ||
| 5 | #include <linux/blkdev.h> | ||
| 6 | #include <linux/relay.h> | ||
| 7 | |||
| 8 | /* | ||
| 9 | * Trace categories | ||
| 10 | */ | ||
| 11 | enum blktrace_cat { | ||
| 12 | BLK_TC_READ = 1 << 0, /* reads */ | ||
| 13 | BLK_TC_WRITE = 1 << 1, /* writes */ | ||
| 14 | BLK_TC_BARRIER = 1 << 2, /* barrier */ | ||
| 15 | BLK_TC_SYNC = 1 << 3, /* barrier */ | ||
| 16 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | ||
| 17 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ | ||
| 18 | BLK_TC_ISSUE = 1 << 6, /* issue */ | ||
| 19 | BLK_TC_COMPLETE = 1 << 7, /* completions */ | ||
| 20 | BLK_TC_FS = 1 << 8, /* fs requests */ | ||
| 21 | BLK_TC_PC = 1 << 9, /* pc requests */ | ||
| 22 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | ||
| 23 | |||
| 24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | #define BLK_TC_SHIFT (16) | ||
| 28 | #define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT) | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Basic trace actions | ||
| 32 | */ | ||
| 33 | enum blktrace_act { | ||
| 34 | __BLK_TA_QUEUE = 1, /* queued */ | ||
| 35 | __BLK_TA_BACKMERGE, /* back merged to existing rq */ | ||
| 36 | __BLK_TA_FRONTMERGE, /* front merge to existing rq */ | ||
| 37 | __BLK_TA_GETRQ, /* allocated new request */ | ||
| 38 | __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */ | ||
| 39 | __BLK_TA_REQUEUE, /* request requeued */ | ||
| 40 | __BLK_TA_ISSUE, /* sent to driver */ | ||
| 41 | __BLK_TA_COMPLETE, /* completed by driver */ | ||
| 42 | __BLK_TA_PLUG, /* queue was plugged */ | ||
| 43 | __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */ | ||
| 44 | __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */ | ||
| 45 | __BLK_TA_INSERT, /* insert request */ | ||
| 46 | __BLK_TA_SPLIT, /* bio was split */ | ||
| 47 | __BLK_TA_BOUNCE, /* bio was bounced */ | ||
| 48 | __BLK_TA_REMAP, /* bio was remapped */ | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* | ||
| 52 | * Trace actions in full. Additionally, read or write is masked | ||
| 53 | */ | ||
| 54 | #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 55 | #define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 56 | #define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 57 | #define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 58 | #define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 59 | #define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE)) | ||
| 60 | #define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE)) | ||
| 61 | #define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE)) | ||
| 62 | #define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 63 | #define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 64 | #define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 65 | #define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 66 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) | ||
| 67 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | ||
| 68 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 69 | |||
| 70 | #define BLK_IO_TRACE_MAGIC 0x65617400 | ||
| 71 | #define BLK_IO_TRACE_VERSION 0x07 | ||
| 72 | |||
| 73 | /* | ||
| 74 | * The trace itself | ||
| 75 | */ | ||
| 76 | struct blk_io_trace { | ||
| 77 | u32 magic; /* MAGIC << 8 | version */ | ||
| 78 | u32 sequence; /* event number */ | ||
| 79 | u64 time; /* in microseconds */ | ||
| 80 | u64 sector; /* disk offset */ | ||
| 81 | u32 bytes; /* transfer length */ | ||
| 82 | u32 action; /* what happened */ | ||
| 83 | u32 pid; /* who did it */ | ||
| 84 | u32 device; /* device number */ | ||
| 85 | u32 cpu; /* on what cpu did it happen */ | ||
| 86 | u16 error; /* completion error */ | ||
| 87 | u16 pdu_len; /* length of data after this trace */ | ||
| 88 | }; | ||
| 89 | |||
| 90 | /* | ||
| 91 | * The remap event | ||
| 92 | */ | ||
| 93 | struct blk_io_trace_remap { | ||
| 94 | u32 device; | ||
| 95 | u32 __pad; | ||
| 96 | u64 sector; | ||
| 97 | }; | ||
| 98 | |||
| 99 | enum { | ||
| 100 | Blktrace_setup = 1, | ||
| 101 | Blktrace_running, | ||
| 102 | Blktrace_stopped, | ||
| 103 | }; | ||
| 104 | |||
| 105 | struct blk_trace { | ||
| 106 | int trace_state; | ||
| 107 | struct rchan *rchan; | ||
| 108 | unsigned long *sequence; | ||
| 109 | u16 act_mask; | ||
| 110 | u64 start_lba; | ||
| 111 | u64 end_lba; | ||
| 112 | u32 pid; | ||
| 113 | u32 dev; | ||
| 114 | struct dentry *dir; | ||
| 115 | struct dentry *dropped_file; | ||
| 116 | atomic_t dropped; | ||
| 117 | }; | ||
| 118 | |||
| 119 | /* | ||
| 120 | * User setup structure passed with BLKTRACESTART | ||
| 121 | */ | ||
| 122 | struct blk_user_trace_setup { | ||
| 123 | char name[BDEVNAME_SIZE]; /* output */ | ||
| 124 | u16 act_mask; /* input */ | ||
| 125 | u32 buf_size; /* input */ | ||
| 126 | u32 buf_nr; /* input */ | ||
| 127 | u64 start_lba; | ||
| 128 | u64 end_lba; | ||
| 129 | u32 pid; | ||
| 130 | }; | ||
| 131 | |||
| 132 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
| 133 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | ||
| 134 | extern void blk_trace_shutdown(request_queue_t *); | ||
| 135 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | ||
| 136 | |||
| 137 | /** | ||
| 138 | * blk_add_trace_rq - Add a trace for a request oriented action | ||
| 139 | * @q: queue the io is for | ||
| 140 | * @rq: the source request | ||
| 141 | * @what: the action | ||
| 142 | * | ||
| 143 | * Description: | ||
| 144 | * Records an action against a request. Will log the bio offset + size. | ||
| 145 | * | ||
| 146 | **/ | ||
| 147 | static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | ||
| 148 | u32 what) | ||
| 149 | { | ||
| 150 | struct blk_trace *bt = q->blk_trace; | ||
| 151 | int rw = rq->flags & 0x07; | ||
| 152 | |||
| 153 | if (likely(!bt)) | ||
| 154 | return; | ||
| 155 | |||
| 156 | if (blk_pc_request(rq)) { | ||
| 157 | what |= BLK_TC_ACT(BLK_TC_PC); | ||
| 158 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); | ||
| 159 | } else { | ||
| 160 | what |= BLK_TC_ACT(BLK_TC_FS); | ||
| 161 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL); | ||
| 162 | } | ||
| 163 | } | ||
| 164 | |||
| 165 | /** | ||
| 166 | * blk_add_trace_bio - Add a trace for a bio oriented action | ||
| 167 | * @q: queue the io is for | ||
| 168 | * @bio: the source bio | ||
| 169 | * @what: the action | ||
| 170 | * | ||
| 171 | * Description: | ||
| 172 | * Records an action against a bio. Will log the bio offset + size. | ||
| 173 | * | ||
| 174 | **/ | ||
| 175 | static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio, | ||
| 176 | u32 what) | ||
| 177 | { | ||
| 178 | struct blk_trace *bt = q->blk_trace; | ||
| 179 | |||
| 180 | if (likely(!bt)) | ||
| 181 | return; | ||
| 182 | |||
| 183 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL); | ||
| 184 | } | ||
| 185 | |||
| 186 | /** | ||
| 187 | * blk_add_trace_generic - Add a trace for a generic action | ||
| 188 | * @q: queue the io is for | ||
| 189 | * @bio: the source bio | ||
| 190 | * @rw: the data direction | ||
| 191 | * @what: the action | ||
| 192 | * | ||
| 193 | * Description: | ||
| 194 | * Records a simple trace | ||
| 195 | * | ||
| 196 | **/ | ||
| 197 | static inline void blk_add_trace_generic(struct request_queue *q, | ||
| 198 | struct bio *bio, int rw, u32 what) | ||
| 199 | { | ||
| 200 | struct blk_trace *bt = q->blk_trace; | ||
| 201 | |||
| 202 | if (likely(!bt)) | ||
| 203 | return; | ||
| 204 | |||
| 205 | if (bio) | ||
| 206 | blk_add_trace_bio(q, bio, what); | ||
| 207 | else | ||
| 208 | __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL); | ||
| 209 | } | ||
| 210 | |||
| 211 | /** | ||
| 212 | * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload | ||
| 213 | * @q: queue the io is for | ||
| 214 | * @what: the action | ||
| 215 | * @bio: the source bio | ||
| 216 | * @pdu: the integer payload | ||
| 217 | * | ||
| 218 | * Description: | ||
| 219 | * Adds a trace with some integer payload. This might be an unplug | ||
| 220 | * option given as the action, with the depth at unplug time given | ||
| 221 | * as the payload | ||
| 222 | * | ||
| 223 | **/ | ||
| 224 | static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what, | ||
| 225 | struct bio *bio, unsigned int pdu) | ||
| 226 | { | ||
| 227 | struct blk_trace *bt = q->blk_trace; | ||
| 228 | u64 rpdu = cpu_to_be64(pdu); | ||
| 229 | |||
| 230 | if (likely(!bt)) | ||
| 231 | return; | ||
| 232 | |||
| 233 | if (bio) | ||
| 234 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu); | ||
| 235 | else | ||
| 236 | __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu); | ||
| 237 | } | ||
| 238 | |||
| 239 | /** | ||
| 240 | * blk_add_trace_remap - Add a trace for a remap operation | ||
| 241 | * @q: queue the io is for | ||
| 242 | * @bio: the source bio | ||
| 243 | * @dev: target device | ||
| 244 | * @from: source sector | ||
| 245 | * @to: target sector | ||
| 246 | * | ||
| 247 | * Description: | ||
| 248 | * Device mapper or raid target sometimes need to split a bio because | ||
| 249 | * it spans a stripe (or similar). Add a trace for that action. | ||
| 250 | * | ||
| 251 | **/ | ||
| 252 | static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | ||
| 253 | dev_t dev, sector_t from, sector_t to) | ||
| 254 | { | ||
| 255 | struct blk_trace *bt = q->blk_trace; | ||
| 256 | struct blk_io_trace_remap r; | ||
| 257 | |||
| 258 | if (likely(!bt)) | ||
| 259 | return; | ||
| 260 | |||
| 261 | r.device = cpu_to_be32(dev); | ||
| 262 | r.sector = cpu_to_be64(to); | ||
| 263 | |||
| 264 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | ||
| 265 | } | ||
| 266 | |||
| 267 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | ||
| 268 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | ||
| 269 | #define blk_trace_shutdown(q) do { } while (0) | ||
| 270 | #define blk_add_trace_rq(q, rq, what) do { } while (0) | ||
| 271 | #define blk_add_trace_bio(q, rq, what) do { } while (0) | ||
| 272 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | ||
| 273 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | ||
| 274 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | ||
| 275 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | ||
| 276 | |||
| 277 | #endif | ||
diff --git a/include/linux/cache.h b/include/linux/cache.h index d22e632f41fb..cc4b3aafad9a 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
| @@ -13,9 +13,7 @@ | |||
| 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| 16 | #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) || defined(CONFIG_PARISC) | 16 | #ifndef __read_mostly |
| 17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
| 18 | #else | ||
| 19 | #define __read_mostly | 17 | #define __read_mostly |
| 20 | #endif | 18 | #endif |
| 21 | 19 | ||
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index b68fdf1f3156..3c9b0bc05123 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
| @@ -378,7 +378,6 @@ struct cdrom_generic_command | |||
| 378 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ | 378 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ |
| 379 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ | 379 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ |
| 380 | #define CDC_RESET 0x200 /* hard reset device */ | 380 | #define CDC_RESET 0x200 /* hard reset device */ |
| 381 | #define CDC_IOCTLS 0x400 /* driver has non-standard ioctls */ | ||
| 382 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ | 381 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ |
| 383 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ | 382 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ |
| 384 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ | 383 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ |
| @@ -974,9 +973,7 @@ struct cdrom_device_ops { | |||
| 974 | int (*reset) (struct cdrom_device_info *); | 973 | int (*reset) (struct cdrom_device_info *); |
| 975 | /* play stuff */ | 974 | /* play stuff */ |
| 976 | int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); | 975 | int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); |
| 977 | /* dev-specific */ | 976 | |
| 978 | int (*dev_ioctl) (struct cdrom_device_info *, | ||
| 979 | unsigned int, unsigned long); | ||
| 980 | /* driver specifications */ | 977 | /* driver specifications */ |
| 981 | const int capability; /* capability flags */ | 978 | const int capability; /* capability flags */ |
| 982 | int n_minors; /* number of active minor devices */ | 979 | int n_minors; /* number of active minor devices */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index ae7dfb790df3..efb518f16bb3 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
| @@ -97,6 +97,10 @@ COMPATIBLE_IOCTL(BLKRRPART) | |||
| 97 | COMPATIBLE_IOCTL(BLKFLSBUF) | 97 | COMPATIBLE_IOCTL(BLKFLSBUF) |
| 98 | COMPATIBLE_IOCTL(BLKSECTSET) | 98 | COMPATIBLE_IOCTL(BLKSECTSET) |
| 99 | COMPATIBLE_IOCTL(BLKSSZGET) | 99 | COMPATIBLE_IOCTL(BLKSSZGET) |
| 100 | COMPATIBLE_IOCTL(BLKTRACESTART) | ||
| 101 | COMPATIBLE_IOCTL(BLKTRACESTOP) | ||
| 102 | COMPATIBLE_IOCTL(BLKTRACESETUP) | ||
| 103 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) | ||
| 100 | ULONG_IOCTL(BLKRASET) | 104 | ULONG_IOCTL(BLKRASET) |
| 101 | ULONG_IOCTL(BLKFRASET) | 105 | ULONG_IOCTL(BLKFRASET) |
| 102 | /* RAID */ | 106 | /* RAID */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 3bc606927116..9354722a9217 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * cpuset interface | 4 | * cpuset interface |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2003 BULL SA | 6 | * Copyright (C) 2003 BULL SA |
| 7 | * Copyright (C) 2004 Silicon Graphics, Inc. | 7 | * Copyright (C) 2004-2006 Silicon Graphics, Inc. |
| 8 | * | 8 | * |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| @@ -51,6 +51,18 @@ extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | |||
| 51 | extern void cpuset_lock(void); | 51 | extern void cpuset_lock(void); |
| 52 | extern void cpuset_unlock(void); | 52 | extern void cpuset_unlock(void); |
| 53 | 53 | ||
| 54 | extern int cpuset_mem_spread_node(void); | ||
| 55 | |||
| 56 | static inline int cpuset_do_page_mem_spread(void) | ||
| 57 | { | ||
| 58 | return current->flags & PF_SPREAD_PAGE; | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline int cpuset_do_slab_mem_spread(void) | ||
| 62 | { | ||
| 63 | return current->flags & PF_SPREAD_SLAB; | ||
| 64 | } | ||
| 65 | |||
| 54 | #else /* !CONFIG_CPUSETS */ | 66 | #else /* !CONFIG_CPUSETS */ |
| 55 | 67 | ||
| 56 | static inline int cpuset_init_early(void) { return 0; } | 68 | static inline int cpuset_init_early(void) { return 0; } |
| @@ -99,6 +111,21 @@ static inline char *cpuset_task_status_allowed(struct task_struct *task, | |||
| 99 | static inline void cpuset_lock(void) {} | 111 | static inline void cpuset_lock(void) {} |
| 100 | static inline void cpuset_unlock(void) {} | 112 | static inline void cpuset_unlock(void) {} |
| 101 | 113 | ||
| 114 | static inline int cpuset_mem_spread_node(void) | ||
| 115 | { | ||
| 116 | return 0; | ||
| 117 | } | ||
| 118 | |||
| 119 | static inline int cpuset_do_page_mem_spread(void) | ||
| 120 | { | ||
| 121 | return 0; | ||
| 122 | } | ||
| 123 | |||
| 124 | static inline int cpuset_do_slab_mem_spread(void) | ||
| 125 | { | ||
| 126 | return 0; | ||
| 127 | } | ||
| 128 | |||
| 102 | #endif /* !CONFIG_CPUSETS */ | 129 | #endif /* !CONFIG_CPUSETS */ |
| 103 | 130 | ||
| 104 | #endif /* _LINUX_CPUSET_H */ | 131 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1289f0ec4c00..1e4bdfcf83a2 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
| @@ -52,7 +52,12 @@ struct file; | |||
| 52 | #ifdef CONFIG_EPOLL | 52 | #ifdef CONFIG_EPOLL |
| 53 | 53 | ||
| 54 | /* Used to initialize the epoll bits inside the "struct file" */ | 54 | /* Used to initialize the epoll bits inside the "struct file" */ |
| 55 | void eventpoll_init_file(struct file *file); | 55 | static inline void eventpoll_init_file(struct file *file) |
| 56 | { | ||
| 57 | INIT_LIST_HEAD(&file->f_ep_links); | ||
| 58 | spin_lock_init(&file->f_ep_lock); | ||
| 59 | } | ||
| 60 | |||
| 56 | 61 | ||
| 57 | /* Used to release the epoll bits inside the "struct file" */ | 62 | /* Used to release the epoll bits inside the "struct file" */ |
| 58 | void eventpoll_release_file(struct file *file); | 63 | void eventpoll_release_file(struct file *file); |
| @@ -85,7 +90,6 @@ static inline void eventpoll_release(struct file *file) | |||
| 85 | eventpoll_release_file(file); | 90 | eventpoll_release_file(file); |
| 86 | } | 91 | } |
| 87 | 92 | ||
| 88 | |||
| 89 | #else | 93 | #else |
| 90 | 94 | ||
| 91 | static inline void eventpoll_init_file(struct file *file) {} | 95 | static inline void eventpoll_init_file(struct file *file) {} |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c0272d73ab20..e7239f2f97a1 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -772,9 +772,12 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned); | |||
| 772 | 772 | ||
| 773 | 773 | ||
| 774 | /* inode.c */ | 774 | /* inode.c */ |
| 775 | extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); | 775 | int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); |
| 776 | extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | 776 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); |
| 777 | extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 777 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
| 778 | int ext3_get_block_handle(handle_t *handle, struct inode *inode, | ||
| 779 | sector_t iblock, struct buffer_head *bh_result, int create, | ||
| 780 | int extend_disksize); | ||
| 778 | 781 | ||
| 779 | extern void ext3_read_inode (struct inode *); | 782 | extern void ext3_read_inode (struct inode *); |
| 780 | extern int ext3_write_inode (struct inode *, int); | 783 | extern int ext3_write_inode (struct inode *, int); |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index e71dd98dbcae..7abf90147180 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/rwsem.h> | 19 | #include <linux/rwsem.h> |
| 20 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
| 21 | #include <linux/seqlock.h> | 21 | #include <linux/seqlock.h> |
| 22 | #include <linux/mutex.h> | ||
| 22 | 23 | ||
| 23 | struct ext3_reserve_window { | 24 | struct ext3_reserve_window { |
| 24 | __u32 _rsv_start; /* First byte reserved */ | 25 | __u32 _rsv_start; /* First byte reserved */ |
| @@ -122,16 +123,16 @@ struct ext3_inode_info { | |||
| 122 | __u16 i_extra_isize; | 123 | __u16 i_extra_isize; |
| 123 | 124 | ||
| 124 | /* | 125 | /* |
| 125 | * truncate_sem is for serialising ext3_truncate() against | 126 | * truncate_mutex is for serialising ext3_truncate() against |
| 126 | * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's | 127 | * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's |
| 127 | * data tree are chopped off during truncate. We can't do that in | 128 | * data tree are chopped off during truncate. We can't do that in |
| 128 | * ext3 because whenever we perform intermediate commits during | 129 | * ext3 because whenever we perform intermediate commits during |
| 129 | * truncate, the inode and all the metadata blocks *must* be in a | 130 | * truncate, the inode and all the metadata blocks *must* be in a |
| 130 | * consistent state which allows truncation of the orphans to restart | 131 | * consistent state which allows truncation of the orphans to restart |
| 131 | * during recovery. Hence we must fix the get_block-vs-truncate race | 132 | * during recovery. Hence we must fix the get_block-vs-truncate race |
| 132 | * by other means, so we have truncate_sem. | 133 | * by other means, so we have truncate_mutex. |
| 133 | */ | 134 | */ |
| 134 | struct semaphore truncate_sem; | 135 | struct mutex truncate_mutex; |
| 135 | struct inode vfs_inode; | 136 | struct inode vfs_inode; |
| 136 | }; | 137 | }; |
| 137 | 138 | ||
diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h index e8e747139b9a..b2913bba35d8 100644 --- a/include/linux/fadvise.h +++ b/include/linux/fadvise.h | |||
| @@ -18,4 +18,10 @@ | |||
| 18 | #define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ | 18 | #define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ |
| 19 | #endif | 19 | #endif |
| 20 | 20 | ||
| 21 | /* | ||
| 22 | * Linux-specific fadvise() extensions: | ||
| 23 | */ | ||
| 24 | #define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range */ | ||
| 25 | #define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range */ | ||
| 26 | |||
| 21 | #endif /* FADVISE_H_INCLUDED */ | 27 | #endif /* FADVISE_H_INCLUDED */ |
diff --git a/include/linux/file.h b/include/linux/file.h index 9901b850f2e4..9f7c2513866f 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
| 11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
| 12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
| 13 | #include <linux/types.h> | ||
| 13 | 14 | ||
| 14 | /* | 15 | /* |
| 15 | * The default fd array needs to be at least BITS_PER_LONG, | 16 | * The default fd array needs to be at least BITS_PER_LONG, |
| @@ -17,10 +18,22 @@ | |||
| 17 | */ | 18 | */ |
| 18 | #define NR_OPEN_DEFAULT BITS_PER_LONG | 19 | #define NR_OPEN_DEFAULT BITS_PER_LONG |
| 19 | 20 | ||
| 21 | /* | ||
| 22 | * The embedded_fd_set is a small fd_set, | ||
| 23 | * suitable for most tasks (which open <= BITS_PER_LONG files) | ||
| 24 | */ | ||
| 25 | struct embedded_fd_set { | ||
| 26 | unsigned long fds_bits[1]; | ||
| 27 | }; | ||
| 28 | |||
| 29 | /* | ||
| 30 | * More than this number of fds: we use a separately allocated fd_set | ||
| 31 | */ | ||
| 32 | #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) | ||
| 33 | |||
| 20 | struct fdtable { | 34 | struct fdtable { |
| 21 | unsigned int max_fds; | 35 | unsigned int max_fds; |
| 22 | int max_fdset; | 36 | int max_fdset; |
| 23 | int next_fd; | ||
| 24 | struct file ** fd; /* current fd array */ | 37 | struct file ** fd; /* current fd array */ |
| 25 | fd_set *close_on_exec; | 38 | fd_set *close_on_exec; |
| 26 | fd_set *open_fds; | 39 | fd_set *open_fds; |
| @@ -33,13 +46,20 @@ struct fdtable { | |||
| 33 | * Open file table structure | 46 | * Open file table structure |
| 34 | */ | 47 | */ |
| 35 | struct files_struct { | 48 | struct files_struct { |
| 49 | /* | ||
| 50 | * read mostly part | ||
| 51 | */ | ||
| 36 | atomic_t count; | 52 | atomic_t count; |
| 37 | struct fdtable *fdt; | 53 | struct fdtable *fdt; |
| 38 | struct fdtable fdtab; | 54 | struct fdtable fdtab; |
| 39 | fd_set close_on_exec_init; | 55 | /* |
| 40 | fd_set open_fds_init; | 56 | * written part on a separate cache line in SMP |
| 57 | */ | ||
| 58 | spinlock_t file_lock ____cacheline_aligned_in_smp; | ||
| 59 | int next_fd; | ||
| 60 | struct embedded_fd_set close_on_exec_init; | ||
| 61 | struct embedded_fd_set open_fds_init; | ||
| 41 | struct file * fd_array[NR_OPEN_DEFAULT]; | 62 | struct file * fd_array[NR_OPEN_DEFAULT]; |
| 42 | spinlock_t file_lock; /* Protects concurrent writers. Nests inside tsk->alloc_lock */ | ||
| 43 | }; | 63 | }; |
| 44 | 64 | ||
| 45 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 65 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 128d0082522c..215696a0f16f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -103,7 +103,9 @@ extern int dir_notify_enable; | |||
| 103 | #define MS_BIND 4096 | 103 | #define MS_BIND 4096 |
| 104 | #define MS_MOVE 8192 | 104 | #define MS_MOVE 8192 |
| 105 | #define MS_REC 16384 | 105 | #define MS_REC 16384 |
| 106 | #define MS_VERBOSE 32768 | 106 | #define MS_VERBOSE 32768 /* War is peace. Verbosity is silence. |
| 107 | MS_VERBOSE is deprecated. */ | ||
| 108 | #define MS_SILENT 32768 | ||
| 107 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ | 109 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ |
| 108 | #define MS_UNBINDABLE (1<<17) /* change to unbindable */ | 110 | #define MS_UNBINDABLE (1<<17) /* change to unbindable */ |
| 109 | #define MS_PRIVATE (1<<18) /* change to private */ | 111 | #define MS_PRIVATE (1<<18) /* change to private */ |
| @@ -197,6 +199,10 @@ extern int dir_notify_enable; | |||
| 197 | #define BLKBSZGET _IOR(0x12,112,size_t) | 199 | #define BLKBSZGET _IOR(0x12,112,size_t) |
| 198 | #define BLKBSZSET _IOW(0x12,113,size_t) | 200 | #define BLKBSZSET _IOW(0x12,113,size_t) |
| 199 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ | 201 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ |
| 202 | #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup) | ||
| 203 | #define BLKTRACESTART _IO(0x12,116) | ||
| 204 | #define BLKTRACESTOP _IO(0x12,117) | ||
| 205 | #define BLKTRACETEARDOWN _IO(0x12,118) | ||
| 200 | 206 | ||
| 201 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 207 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
| 202 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 208 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
| @@ -344,7 +350,7 @@ struct address_space_operations { | |||
| 344 | /* Write back some dirty pages from this mapping. */ | 350 | /* Write back some dirty pages from this mapping. */ |
| 345 | int (*writepages)(struct address_space *, struct writeback_control *); | 351 | int (*writepages)(struct address_space *, struct writeback_control *); |
| 346 | 352 | ||
| 347 | /* Set a page dirty */ | 353 | /* Set a page dirty. Return true if this dirtied it */ |
| 348 | int (*set_page_dirty)(struct page *page); | 354 | int (*set_page_dirty)(struct page *page); |
| 349 | 355 | ||
| 350 | int (*readpages)(struct file *filp, struct address_space *mapping, | 356 | int (*readpages)(struct file *filp, struct address_space *mapping, |
| @@ -397,8 +403,8 @@ struct block_device { | |||
| 397 | dev_t bd_dev; /* not a kdev_t - it's a search key */ | 403 | dev_t bd_dev; /* not a kdev_t - it's a search key */ |
| 398 | struct inode * bd_inode; /* will die */ | 404 | struct inode * bd_inode; /* will die */ |
| 399 | int bd_openers; | 405 | int bd_openers; |
| 400 | struct semaphore bd_sem; /* open/close mutex */ | 406 | struct mutex bd_mutex; /* open/close mutex */ |
| 401 | struct semaphore bd_mount_sem; /* mount mutex */ | 407 | struct mutex bd_mount_mutex; /* mount mutex */ |
| 402 | struct list_head bd_inodes; | 408 | struct list_head bd_inodes; |
| 403 | void * bd_holder; | 409 | void * bd_holder; |
| 404 | int bd_holders; | 410 | int bd_holders; |
| @@ -509,7 +515,7 @@ struct inode { | |||
| 509 | 515 | ||
| 510 | #ifdef CONFIG_INOTIFY | 516 | #ifdef CONFIG_INOTIFY |
| 511 | struct list_head inotify_watches; /* watches on this inode */ | 517 | struct list_head inotify_watches; /* watches on this inode */ |
| 512 | struct semaphore inotify_sem; /* protects the watches list */ | 518 | struct mutex inotify_mutex; /* protects the watches list */ |
| 513 | #endif | 519 | #endif |
| 514 | 520 | ||
| 515 | unsigned long i_state; | 521 | unsigned long i_state; |
| @@ -847,7 +853,7 @@ struct super_block { | |||
| 847 | * The next field is for VFS *only*. No filesystems have any business | 853 | * The next field is for VFS *only*. No filesystems have any business |
| 848 | * even looking at it. You had been warned. | 854 | * even looking at it. You had been warned. |
| 849 | */ | 855 | */ |
| 850 | struct semaphore s_vfs_rename_sem; /* Kludge */ | 856 | struct mutex s_vfs_rename_mutex; /* Kludge */ |
| 851 | 857 | ||
| 852 | /* Granuality of c/m/atime in ns. | 858 | /* Granuality of c/m/atime in ns. |
| 853 | Cannot be worse than a second */ | 859 | Cannot be worse than a second */ |
| @@ -1115,6 +1121,18 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
| 1115 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1121 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
| 1116 | } | 1122 | } |
| 1117 | 1123 | ||
| 1124 | static inline void inode_inc_link_count(struct inode *inode) | ||
| 1125 | { | ||
| 1126 | inode->i_nlink++; | ||
| 1127 | mark_inode_dirty(inode); | ||
| 1128 | } | ||
| 1129 | |||
| 1130 | static inline void inode_dec_link_count(struct inode *inode) | ||
| 1131 | { | ||
| 1132 | inode->i_nlink--; | ||
| 1133 | mark_inode_dirty(inode); | ||
| 1134 | } | ||
| 1135 | |||
| 1118 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | 1136 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); |
| 1119 | static inline void file_accessed(struct file *file) | 1137 | static inline void file_accessed(struct file *file) |
| 1120 | { | 1138 | { |
| @@ -1455,6 +1473,12 @@ extern int filemap_fdatawait(struct address_space *); | |||
| 1455 | extern int filemap_write_and_wait(struct address_space *mapping); | 1473 | extern int filemap_write_and_wait(struct address_space *mapping); |
| 1456 | extern int filemap_write_and_wait_range(struct address_space *mapping, | 1474 | extern int filemap_write_and_wait_range(struct address_space *mapping, |
| 1457 | loff_t lstart, loff_t lend); | 1475 | loff_t lstart, loff_t lend); |
| 1476 | extern int wait_on_page_writeback_range(struct address_space *mapping, | ||
| 1477 | pgoff_t start, pgoff_t end); | ||
| 1478 | extern int __filemap_fdatawrite_range(struct address_space *mapping, | ||
| 1479 | loff_t start, loff_t end, int sync_mode); | ||
| 1480 | |||
| 1481 | extern long do_fsync(struct file *file, int datasync); | ||
| 1458 | extern void sync_supers(void); | 1482 | extern void sync_supers(void); |
| 1459 | extern void sync_filesystems(int wait); | 1483 | extern void sync_filesystems(int wait); |
| 1460 | extern void emergency_sync(void); | 1484 | extern void emergency_sync(void); |
| @@ -1534,7 +1558,7 @@ extern void destroy_inode(struct inode *); | |||
| 1534 | extern struct inode *new_inode(struct super_block *); | 1558 | extern struct inode *new_inode(struct super_block *); |
| 1535 | extern int remove_suid(struct dentry *); | 1559 | extern int remove_suid(struct dentry *); |
| 1536 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); | 1560 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); |
| 1537 | extern struct semaphore iprune_sem; | 1561 | extern struct mutex iprune_mutex; |
| 1538 | 1562 | ||
| 1539 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | 1563 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
| 1540 | extern void remove_inode_hash(struct inode *); | 1564 | extern void remove_inode_hash(struct inode *); |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 0abe9d9a0069..652611a4bdcd 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #ifndef GENERIC_SERIAL_H | 12 | #ifndef GENERIC_SERIAL_H |
| 13 | #define GENERIC_SERIAL_H | 13 | #define GENERIC_SERIAL_H |
| 14 | 14 | ||
| 15 | #include <linux/mutex.h> | ||
| 16 | |||
| 15 | struct real_driver { | 17 | struct real_driver { |
| 16 | void (*disable_tx_interrupts) (void *); | 18 | void (*disable_tx_interrupts) (void *); |
| 17 | void (*enable_tx_interrupts) (void *); | 19 | void (*enable_tx_interrupts) (void *); |
| @@ -34,7 +36,7 @@ struct gs_port { | |||
| 34 | int xmit_head; | 36 | int xmit_head; |
| 35 | int xmit_tail; | 37 | int xmit_tail; |
| 36 | int xmit_cnt; | 38 | int xmit_cnt; |
| 37 | struct semaphore port_write_sem; | 39 | struct mutex port_write_mutex; |
| 38 | int flags; | 40 | int flags; |
| 39 | wait_queue_head_t open_wait; | 41 | wait_queue_head_t open_wait; |
| 40 | wait_queue_head_t close_wait; | 42 | wait_queue_head_t close_wait; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index eef5ccdcd731..fd647fde5ec1 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -149,22 +149,16 @@ struct disk_attribute { | |||
| 149 | ({ \ | 149 | ({ \ |
| 150 | typeof(gendiskp->dkstats->field) res = 0; \ | 150 | typeof(gendiskp->dkstats->field) res = 0; \ |
| 151 | int i; \ | 151 | int i; \ |
| 152 | for (i=0; i < NR_CPUS; i++) { \ | 152 | for_each_cpu(i) \ |
| 153 | if (!cpu_possible(i)) \ | ||
| 154 | continue; \ | ||
| 155 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ | 153 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ |
| 156 | } \ | ||
| 157 | res; \ | 154 | res; \ |
| 158 | }) | 155 | }) |
| 159 | 156 | ||
| 160 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | 157 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { |
| 161 | int i; | 158 | int i; |
| 162 | for (i=0; i < NR_CPUS; i++) { | 159 | for_each_cpu(i) |
| 163 | if (cpu_possible(i)) { | 160 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, |
| 164 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, | 161 | sizeof (struct disk_stats)); |
| 165 | sizeof (struct disk_stats)); | ||
| 166 | } | ||
| 167 | } | ||
| 168 | } | 162 | } |
| 169 | 163 | ||
| 170 | #else | 164 | #else |
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 7eb4004b3601..a90c09d331c1 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h | |||
| @@ -27,11 +27,13 @@ struct sensor_device_attribute{ | |||
| 27 | #define to_sensor_dev_attr(_dev_attr) \ | 27 | #define to_sensor_dev_attr(_dev_attr) \ |
| 28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) | 28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) |
| 29 | 29 | ||
| 30 | #define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \ | 30 | #define SENSOR_ATTR(_name, _mode, _show, _store, _index) \ |
| 31 | struct sensor_device_attribute sensor_dev_attr_##_name = { \ | 31 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ |
| 32 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 32 | .index = _index } |
| 33 | .index = _index, \ | 33 | |
| 34 | } | 34 | #define SENSOR_DEVICE_ATTR(_name, _mode, _show, _store, _index) \ |
| 35 | struct sensor_device_attribute sensor_dev_attr_##_name \ | ||
| 36 | = SENSOR_ATTR(_name, _mode, _show, _store, _index) | ||
| 35 | 37 | ||
| 36 | struct sensor_device_attribute_2 { | 38 | struct sensor_device_attribute_2 { |
| 37 | struct device_attribute dev_attr; | 39 | struct device_attribute dev_attr; |
| @@ -41,11 +43,13 @@ struct sensor_device_attribute_2 { | |||
| 41 | #define to_sensor_dev_attr_2(_dev_attr) \ | 43 | #define to_sensor_dev_attr_2(_dev_attr) \ |
| 42 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) | 44 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) |
| 43 | 45 | ||
| 46 | #define SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) \ | ||
| 47 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ | ||
| 48 | .index = _index, \ | ||
| 49 | .nr = _nr } | ||
| 50 | |||
| 44 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ | 51 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ |
| 45 | struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ | 52 | struct sensor_device_attribute_2 sensor_dev_attr_##_name \ |
| 46 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 53 | = SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) |
| 47 | .index = _index, \ | ||
| 48 | .nr = _nr, \ | ||
| 49 | } | ||
| 50 | 54 | ||
| 51 | #endif /* _LINUX_HWMON_SYSFS_H */ | 55 | #endif /* _LINUX_HWMON_SYSFS_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 474c8f4f5d4f..ec311bc89439 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -172,7 +172,6 @@ | |||
| 172 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | 172 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ |
| 173 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ | 173 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ |
| 174 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ | 174 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ |
| 175 | #define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */ | ||
| 176 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ | 175 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ |
| 177 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ | 176 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ |
| 178 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ | 177 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 63f1d63cc1d8..1635ee25918f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | #include <linux/mod_devicetable.h> | 32 | #include <linux/mod_devicetable.h> |
| 33 | #include <linux/device.h> /* for struct device */ | 33 | #include <linux/device.h> /* for struct device */ |
| 34 | #include <linux/sched.h> /* for completion */ | 34 | #include <linux/sched.h> /* for completion */ |
| 35 | #include <asm/semaphore.h> | 35 | #include <linux/mutex.h> |
| 36 | 36 | ||
| 37 | /* --- For i2c-isa ---------------------------------------------------- */ | 37 | /* --- For i2c-isa ---------------------------------------------------- */ |
| 38 | 38 | ||
| @@ -225,8 +225,8 @@ struct i2c_adapter { | |||
| 225 | int (*client_unregister)(struct i2c_client *); | 225 | int (*client_unregister)(struct i2c_client *); |
| 226 | 226 | ||
| 227 | /* data fields that are valid for all devices */ | 227 | /* data fields that are valid for all devices */ |
| 228 | struct semaphore bus_lock; | 228 | struct mutex bus_lock; |
| 229 | struct semaphore clist_lock; | 229 | struct mutex clist_lock; |
| 230 | 230 | ||
| 231 | int timeout; | 231 | int timeout; |
| 232 | int retries; | 232 | int retries; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index a7fc4cc79b23..8d2db412ba9c 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -792,6 +792,7 @@ typedef struct hwif_s { | |||
| 792 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ | 792 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ |
| 793 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 793 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
| 794 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 794 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
| 795 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | ||
| 795 | 796 | ||
| 796 | struct device gendev; | 797 | struct device gendev; |
| 797 | struct completion gendev_rel_comp; /* To deal with device release() */ | 798 | struct completion gendev_rel_comp; /* To deal with device release() */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index dcfd2ecccb5d..92146f3b7423 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -7,11 +7,10 @@ | |||
| 7 | #define INIT_FDTABLE \ | 7 | #define INIT_FDTABLE \ |
| 8 | { \ | 8 | { \ |
| 9 | .max_fds = NR_OPEN_DEFAULT, \ | 9 | .max_fds = NR_OPEN_DEFAULT, \ |
| 10 | .max_fdset = __FD_SETSIZE, \ | 10 | .max_fdset = EMBEDDED_FD_SET_SIZE, \ |
| 11 | .next_fd = 0, \ | ||
| 12 | .fd = &init_files.fd_array[0], \ | 11 | .fd = &init_files.fd_array[0], \ |
| 13 | .close_on_exec = &init_files.close_on_exec_init, \ | 12 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ |
| 14 | .open_fds = &init_files.open_fds_init, \ | 13 | .open_fds = (fd_set *)&init_files.open_fds_init, \ |
| 15 | .rcu = RCU_HEAD_INIT, \ | 14 | .rcu = RCU_HEAD_INIT, \ |
| 16 | .free_files = NULL, \ | 15 | .free_files = NULL, \ |
| 17 | .next = NULL, \ | 16 | .next = NULL, \ |
| @@ -20,9 +19,10 @@ | |||
| 20 | #define INIT_FILES \ | 19 | #define INIT_FILES \ |
| 21 | { \ | 20 | { \ |
| 22 | .count = ATOMIC_INIT(1), \ | 21 | .count = ATOMIC_INIT(1), \ |
| 23 | .file_lock = SPIN_LOCK_UNLOCKED, \ | ||
| 24 | .fdt = &init_files.fdtab, \ | 22 | .fdt = &init_files.fdtab, \ |
| 25 | .fdtab = INIT_FDTABLE, \ | 23 | .fdtab = INIT_FDTABLE, \ |
| 24 | .file_lock = SPIN_LOCK_UNLOCKED, \ | ||
| 25 | .next_fd = 0, \ | ||
| 26 | .close_on_exec_init = { { 0, } }, \ | 26 | .close_on_exec_init = { { 0, } }, \ |
| 27 | .open_fds_init = { { 0, } }, \ | 27 | .open_fds_init = { { 0, } }, \ |
| 28 | .fd_array = { NULL, } \ | 28 | .fd_array = { NULL, } \ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 41ee79962bb2..2ccbfb6340ba 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/journal-head.h> | 28 | #include <linux/journal-head.h> |
| 29 | #include <linux/stddef.h> | 29 | #include <linux/stddef.h> |
| 30 | #include <linux/bit_spinlock.h> | 30 | #include <linux/bit_spinlock.h> |
| 31 | #include <linux/mutex.h> | ||
| 31 | #include <asm/semaphore.h> | 32 | #include <asm/semaphore.h> |
| 32 | #endif | 33 | #endif |
| 33 | 34 | ||
| @@ -575,7 +576,7 @@ struct transaction_s | |||
| 575 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | 576 | * @j_wait_checkpoint: Wait queue to trigger checkpointing |
| 576 | * @j_wait_commit: Wait queue to trigger commit | 577 | * @j_wait_commit: Wait queue to trigger commit |
| 577 | * @j_wait_updates: Wait queue to wait for updates to complete | 578 | * @j_wait_updates: Wait queue to wait for updates to complete |
| 578 | * @j_checkpoint_sem: Semaphore for locking against concurrent checkpoints | 579 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints |
| 579 | * @j_head: Journal head - identifies the first unused block in the journal | 580 | * @j_head: Journal head - identifies the first unused block in the journal |
| 580 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 581 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
| 581 | * journal. | 582 | * journal. |
| @@ -645,7 +646,7 @@ struct journal_s | |||
| 645 | int j_barrier_count; | 646 | int j_barrier_count; |
| 646 | 647 | ||
| 647 | /* The barrier lock itself */ | 648 | /* The barrier lock itself */ |
| 648 | struct semaphore j_barrier; | 649 | struct mutex j_barrier; |
| 649 | 650 | ||
| 650 | /* | 651 | /* |
| 651 | * Transactions: The current running transaction... | 652 | * Transactions: The current running transaction... |
| @@ -687,7 +688,7 @@ struct journal_s | |||
| 687 | wait_queue_head_t j_wait_updates; | 688 | wait_queue_head_t j_wait_updates; |
| 688 | 689 | ||
| 689 | /* Semaphore for locking against concurrent checkpoints */ | 690 | /* Semaphore for locking against concurrent checkpoints */ |
| 690 | struct semaphore j_checkpoint_sem; | 691 | struct mutex j_checkpoint_mutex; |
| 691 | 692 | ||
| 692 | /* | 693 | /* |
| 693 | * Journal head: identifies the first unused block in the journal. | 694 | * Journal head: identifies the first unused block in the journal. |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3b507bf05d09..bb6e7ddee2fd 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -91,6 +91,9 @@ extern struct notifier_block *panic_notifier_list; | |||
| 91 | extern long (*panic_blink)(long time); | 91 | extern long (*panic_blink)(long time); |
| 92 | NORET_TYPE void panic(const char * fmt, ...) | 92 | NORET_TYPE void panic(const char * fmt, ...) |
| 93 | __attribute__ ((NORET_AND format (printf, 1, 2))); | 93 | __attribute__ ((NORET_AND format (printf, 1, 2))); |
| 94 | extern void oops_enter(void); | ||
| 95 | extern void oops_exit(void); | ||
| 96 | extern int oops_may_print(void); | ||
| 94 | fastcall NORET_TYPE void do_exit(long error_code) | 97 | fastcall NORET_TYPE void do_exit(long error_code) |
| 95 | ATTRIB_NORET; | 98 | ATTRIB_NORET; |
| 96 | NORET_TYPE void complete_and_exit(struct completion *, long) | 99 | NORET_TYPE void complete_and_exit(struct completion *, long) |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 669756bc20a2..778adc0fa640 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/percpu.h> | 36 | #include <linux/percpu.h> |
| 37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
| 38 | #include <linux/rcupdate.h> | 38 | #include <linux/rcupdate.h> |
| 39 | #include <linux/mutex.h> | ||
| 39 | 40 | ||
| 40 | #ifdef CONFIG_KPROBES | 41 | #ifdef CONFIG_KPROBES |
| 41 | #include <asm/kprobes.h> | 42 | #include <asm/kprobes.h> |
| @@ -152,7 +153,7 @@ struct kretprobe_instance { | |||
| 152 | }; | 153 | }; |
| 153 | 154 | ||
| 154 | extern spinlock_t kretprobe_lock; | 155 | extern spinlock_t kretprobe_lock; |
| 155 | extern struct semaphore kprobe_mutex; | 156 | extern struct mutex kprobe_mutex; |
| 156 | extern int arch_prepare_kprobe(struct kprobe *p); | 157 | extern int arch_prepare_kprobe(struct kprobe *p); |
| 157 | extern void arch_arm_kprobe(struct kprobe *p); | 158 | extern void arch_arm_kprobe(struct kprobe *p); |
| 158 | extern void arch_disarm_kprobe(struct kprobe *p); | 159 | extern void arch_disarm_kprobe(struct kprobe *p); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index b3d4c906e242..70ca99bbc6c7 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -162,7 +162,6 @@ enum { | |||
| 162 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ | 162 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ |
| 163 | 163 | ||
| 164 | /* various lengths of time */ | 164 | /* various lengths of time */ |
| 165 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ | ||
| 166 | ATA_TMOUT_PIO = 30 * HZ, | 165 | ATA_TMOUT_PIO = 30 * HZ, |
| 167 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 166 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
| 168 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 167 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ |
| @@ -363,6 +362,11 @@ struct ata_device { | |||
| 363 | unsigned int max_sectors; /* per-device max sectors */ | 362 | unsigned int max_sectors; /* per-device max sectors */ |
| 364 | unsigned int cdb_len; | 363 | unsigned int cdb_len; |
| 365 | 364 | ||
| 365 | /* per-dev xfer mask */ | ||
| 366 | unsigned int pio_mask; | ||
| 367 | unsigned int mwdma_mask; | ||
| 368 | unsigned int udma_mask; | ||
| 369 | |||
| 366 | /* for CHS addressing */ | 370 | /* for CHS addressing */ |
| 367 | u16 cylinders; /* Number of cylinders */ | 371 | u16 cylinders; /* Number of cylinders */ |
| 368 | u16 heads; /* Number of heads */ | 372 | u16 heads; /* Number of heads */ |
| @@ -400,6 +404,7 @@ struct ata_port { | |||
| 400 | 404 | ||
| 401 | struct ata_host_stats stats; | 405 | struct ata_host_stats stats; |
| 402 | struct ata_host_set *host_set; | 406 | struct ata_host_set *host_set; |
| 407 | struct device *dev; | ||
| 403 | 408 | ||
| 404 | struct work_struct port_task; | 409 | struct work_struct port_task; |
| 405 | 410 | ||
| @@ -520,9 +525,9 @@ extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | |||
| 520 | extern int ata_scsi_release(struct Scsi_Host *host); | 525 | extern int ata_scsi_release(struct Scsi_Host *host); |
| 521 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 526 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
| 522 | extern int ata_scsi_device_resume(struct scsi_device *); | 527 | extern int ata_scsi_device_resume(struct scsi_device *); |
| 523 | extern int ata_scsi_device_suspend(struct scsi_device *); | 528 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); |
| 524 | extern int ata_device_resume(struct ata_port *, struct ata_device *); | 529 | extern int ata_device_resume(struct ata_port *, struct ata_device *); |
| 525 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); | 530 | extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); |
| 526 | extern int ata_ratelimit(void); | 531 | extern int ata_ratelimit(void); |
| 527 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 532 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
| 528 | unsigned long timeout_pat, | 533 | unsigned long timeout_pat, |
| @@ -573,6 +578,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev, | |||
| 573 | struct block_device *bdev, | 578 | struct block_device *bdev, |
| 574 | sector_t capacity, int geom[]); | 579 | sector_t capacity, int geom[]); |
| 575 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 580 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
| 581 | extern struct ata_device *ata_dev_pair(struct ata_port *ap, | ||
| 582 | struct ata_device *adev); | ||
| 576 | 583 | ||
| 577 | /* | 584 | /* |
| 578 | * Timing helpers | 585 | * Timing helpers |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 147eb01e0d4b..c08c9983e840 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
| @@ -28,17 +28,27 @@ | |||
| 28 | #define ALIGN __ALIGN | 28 | #define ALIGN __ALIGN |
| 29 | #define ALIGN_STR __ALIGN_STR | 29 | #define ALIGN_STR __ALIGN_STR |
| 30 | 30 | ||
| 31 | #ifndef ENTRY | ||
| 31 | #define ENTRY(name) \ | 32 | #define ENTRY(name) \ |
| 32 | .globl name; \ | 33 | .globl name; \ |
| 33 | ALIGN; \ | 34 | ALIGN; \ |
| 34 | name: | 35 | name: |
| 36 | #endif | ||
| 35 | 37 | ||
| 36 | #define KPROBE_ENTRY(name) \ | 38 | #define KPROBE_ENTRY(name) \ |
| 37 | .section .kprobes.text, "ax"; \ | 39 | .section .kprobes.text, "ax"; \ |
| 38 | .globl name; \ | 40 | ENTRY(name) |
| 39 | ALIGN; \ | ||
| 40 | name: | ||
| 41 | 41 | ||
| 42 | #ifndef END | ||
| 43 | #define END(name) \ | ||
| 44 | .size name, .-name | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #ifndef ENDPROC | ||
| 48 | #define ENDPROC(name) \ | ||
| 49 | .type name, @function; \ | ||
| 50 | END(name) | ||
| 51 | #endif | ||
| 42 | 52 | ||
| 43 | #endif | 53 | #endif |
| 44 | 54 | ||
diff --git a/include/linux/loop.h b/include/linux/loop.h index f96506782ebe..e76c7611d6cc 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/bio.h> | 17 | #include <linux/bio.h> |
| 18 | #include <linux/blkdev.h> | 18 | #include <linux/blkdev.h> |
| 19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
| 20 | #include <linux/mutex.h> | ||
| 20 | 21 | ||
| 21 | /* Possible states of device */ | 22 | /* Possible states of device */ |
| 22 | enum { | 23 | enum { |
| @@ -60,7 +61,7 @@ struct loop_device { | |||
| 60 | int lo_state; | 61 | int lo_state; |
| 61 | struct completion lo_done; | 62 | struct completion lo_done; |
| 62 | struct completion lo_bh_done; | 63 | struct completion lo_bh_done; |
| 63 | struct semaphore lo_ctl_mutex; | 64 | struct mutex lo_ctl_mutex; |
| 64 | int lo_pending; | 65 | int lo_pending; |
| 65 | 66 | ||
| 66 | request_queue_t *lo_queue; | 67 | request_queue_t *lo_queue; |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index bbd2221923c3..6a7621b2b12b 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -147,6 +147,7 @@ extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new); | |||
| 147 | extern void mpol_rebind_task(struct task_struct *tsk, | 147 | extern void mpol_rebind_task(struct task_struct *tsk, |
| 148 | const nodemask_t *new); | 148 | const nodemask_t *new); |
| 149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | 149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); |
| 150 | extern void mpol_fix_fork_child_flag(struct task_struct *p); | ||
| 150 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) | 151 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) |
| 151 | 152 | ||
| 152 | #ifdef CONFIG_CPUSET | 153 | #ifdef CONFIG_CPUSET |
| @@ -248,6 +249,10 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new) | |||
| 248 | { | 249 | { |
| 249 | } | 250 | } |
| 250 | 251 | ||
| 252 | static inline void mpol_fix_fork_child_flag(struct task_struct *p) | ||
| 253 | { | ||
| 254 | } | ||
| 255 | |||
| 251 | #define set_cpuset_being_rebound(x) do {} while (0) | 256 | #define set_cpuset_being_rebound(x) do {} while (0) |
| 252 | 257 | ||
| 253 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 258 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 8bcd9450d926..779e6a5744c7 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
| @@ -184,6 +184,7 @@ struct fat_slot_info { | |||
| 184 | #include <linux/string.h> | 184 | #include <linux/string.h> |
| 185 | #include <linux/nls.h> | 185 | #include <linux/nls.h> |
| 186 | #include <linux/fs.h> | 186 | #include <linux/fs.h> |
| 187 | #include <linux/mutex.h> | ||
| 187 | 188 | ||
| 188 | struct fat_mount_options { | 189 | struct fat_mount_options { |
| 189 | uid_t fs_uid; | 190 | uid_t fs_uid; |
| @@ -226,7 +227,7 @@ struct msdos_sb_info { | |||
| 226 | unsigned long max_cluster; /* maximum cluster number */ | 227 | unsigned long max_cluster; /* maximum cluster number */ |
| 227 | unsigned long root_cluster; /* first cluster of the root directory */ | 228 | unsigned long root_cluster; /* first cluster of the root directory */ |
| 228 | unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ | 229 | unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ |
| 229 | struct semaphore fat_lock; | 230 | struct mutex fat_lock; |
| 230 | unsigned int prev_free; /* previously allocated cluster number */ | 231 | unsigned int prev_free; /* previously allocated cluster number */ |
| 231 | unsigned int free_clusters; /* -1 if undefined */ | 232 | unsigned int free_clusters; /* -1 if undefined */ |
| 232 | struct fat_mount_options options; | 233 | struct fat_mount_options options; |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index f95d51fae733..a6ce409ec6fc 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
| @@ -38,6 +38,7 @@ enum { | |||
| 38 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
| 39 | 39 | ||
| 40 | #include <linux/wait.h> | 40 | #include <linux/wait.h> |
| 41 | #include <linux/mutex.h> | ||
| 41 | 42 | ||
| 42 | /* values for flags field */ | 43 | /* values for flags field */ |
| 43 | #define NBD_READ_ONLY 0x0001 | 44 | #define NBD_READ_ONLY 0x0001 |
| @@ -57,7 +58,7 @@ struct nbd_device { | |||
| 57 | struct request *active_req; | 58 | struct request *active_req; |
| 58 | wait_queue_head_t active_wq; | 59 | wait_queue_head_t active_wq; |
| 59 | 60 | ||
| 60 | struct semaphore tx_lock; | 61 | struct mutex tx_lock; |
| 61 | struct gendisk *disk; | 62 | struct gendisk *disk; |
| 62 | int blksize; | 63 | int blksize; |
| 63 | u64 bytesize; | 64 | u64 bytesize; |
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h index 415be1ec6f98..bdb4c8ae6924 100644 --- a/include/linux/ncp_fs_i.h +++ b/include/linux/ncp_fs_i.h | |||
| @@ -19,7 +19,7 @@ struct ncp_inode_info { | |||
| 19 | __le32 DosDirNum; | 19 | __le32 DosDirNum; |
| 20 | __u8 volNumber; | 20 | __u8 volNumber; |
| 21 | __le32 nwattr; | 21 | __le32 nwattr; |
| 22 | struct semaphore open_sem; | 22 | struct mutex open_mutex; |
| 23 | atomic_t opened; | 23 | atomic_t opened; |
| 24 | int access; | 24 | int access; |
| 25 | int flags; | 25 | int flags; |
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index cf858eb80f0b..b089d9506283 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/ncp_mount.h> | 12 | #include <linux/ncp_mount.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/mutex.h> | ||
| 14 | 15 | ||
| 15 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
| 16 | 17 | ||
| @@ -51,7 +52,7 @@ struct ncp_server { | |||
| 51 | receive replies */ | 52 | receive replies */ |
| 52 | 53 | ||
| 53 | int lock; /* To prevent mismatch in protocols. */ | 54 | int lock; /* To prevent mismatch in protocols. */ |
| 54 | struct semaphore sem; | 55 | struct mutex mutex; |
| 55 | 56 | ||
| 56 | int current_size; /* for packet preparation */ | 57 | int current_size; /* for packet preparation */ |
| 57 | int has_subfunction; | 58 | int has_subfunction; |
| @@ -96,7 +97,7 @@ struct ncp_server { | |||
| 96 | struct { | 97 | struct { |
| 97 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ | 98 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ |
| 98 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ | 99 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ |
| 99 | struct semaphore creq_sem; /* DGRAM only: lock accesses to rcv.creq */ | 100 | struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */ |
| 100 | 101 | ||
| 101 | unsigned int state; /* STREAM only: receiver state */ | 102 | unsigned int state; /* STREAM only: receiver state */ |
| 102 | struct { | 103 | struct { |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ee700c6eb442..839f0b3c23aa 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -51,6 +51,10 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) | |||
| 51 | #define page_cache_release(page) put_page(page) | 51 | #define page_cache_release(page) put_page(page) |
| 52 | void release_pages(struct page **pages, int nr, int cold); | 52 | void release_pages(struct page **pages, int nr, int cold); |
| 53 | 53 | ||
| 54 | #ifdef CONFIG_NUMA | ||
| 55 | extern struct page *page_cache_alloc(struct address_space *x); | ||
| 56 | extern struct page *page_cache_alloc_cold(struct address_space *x); | ||
| 57 | #else | ||
| 54 | static inline struct page *page_cache_alloc(struct address_space *x) | 58 | static inline struct page *page_cache_alloc(struct address_space *x) |
| 55 | { | 59 | { |
| 56 | return alloc_pages(mapping_gfp_mask(x), 0); | 60 | return alloc_pages(mapping_gfp_mask(x), 0); |
| @@ -60,6 +64,7 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x) | |||
| 60 | { | 64 | { |
| 61 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 65 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); |
| 62 | } | 66 | } |
| 67 | #endif | ||
| 63 | 68 | ||
| 64 | typedef int filler_t(void *, struct page *); | 69 | typedef int filler_t(void *, struct page *); |
| 65 | 70 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index fe1a2b02fc55..0aad5a378e95 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -95,6 +95,11 @@ enum pci_channel_state { | |||
| 95 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, | 95 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, |
| 96 | }; | 96 | }; |
| 97 | 97 | ||
| 98 | typedef unsigned short __bitwise pci_bus_flags_t; | ||
| 99 | enum pci_bus_flags { | ||
| 100 | PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, | ||
| 101 | }; | ||
| 102 | |||
| 98 | /* | 103 | /* |
| 99 | * The pci_dev structure is used to describe PCI devices. | 104 | * The pci_dev structure is used to describe PCI devices. |
| 100 | */ | 105 | */ |
| @@ -203,7 +208,7 @@ struct pci_bus { | |||
| 203 | char name[48]; | 208 | char name[48]; |
| 204 | 209 | ||
| 205 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ | 210 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
| 206 | unsigned short pad2; | 211 | pci_bus_flags_t bus_flags; /* Inherited by child busses */ |
| 207 | struct device *bridge; | 212 | struct device *bridge; |
| 208 | struct class_device class_dev; | 213 | struct class_device class_dev; |
| 209 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ | 214 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
| @@ -485,9 +490,9 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *); | |||
| 485 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 490 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
| 486 | int (*)(struct pci_dev *, u8, u8)); | 491 | int (*)(struct pci_dev *, u8, u8)); |
| 487 | #define HAVE_PCI_REQ_REGIONS 2 | 492 | #define HAVE_PCI_REQ_REGIONS 2 |
| 488 | int pci_request_regions(struct pci_dev *, char *); | 493 | int pci_request_regions(struct pci_dev *, const char *); |
| 489 | void pci_release_regions(struct pci_dev *); | 494 | void pci_release_regions(struct pci_dev *); |
| 490 | int pci_request_region(struct pci_dev *, int, char *); | 495 | int pci_request_region(struct pci_dev *, int, const char *); |
| 491 | void pci_release_region(struct pci_dev *, int); | 496 | void pci_release_region(struct pci_dev *, int); |
| 492 | 497 | ||
| 493 | /* drivers/pci/bus.c */ | 498 | /* drivers/pci/bus.c */ |
| @@ -516,6 +521,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass | |||
| 516 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | 521 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), |
| 517 | void *userdata); | 522 | void *userdata); |
| 518 | int pci_cfg_space_size(struct pci_dev *dev); | 523 | int pci_cfg_space_size(struct pci_dev *dev); |
| 524 | unsigned char pci_bus_max_busnr(struct pci_bus* bus); | ||
| 519 | 525 | ||
| 520 | /* kmem_cache style wrapper around pci_alloc_consistent() */ | 526 | /* kmem_cache style wrapper around pci_alloc_consistent() */ |
| 521 | 527 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ec3c32932620..6f080ae59286 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -69,6 +69,7 @@ | |||
| 69 | #define PCI_CLASS_SYSTEM_TIMER 0x0802 | 69 | #define PCI_CLASS_SYSTEM_TIMER 0x0802 |
| 70 | #define PCI_CLASS_SYSTEM_RTC 0x0803 | 70 | #define PCI_CLASS_SYSTEM_RTC 0x0803 |
| 71 | #define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 | 71 | #define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 |
| 72 | #define PCI_CLASS_SYSTEM_SDHCI 0x0805 | ||
| 72 | #define PCI_CLASS_SYSTEM_OTHER 0x0880 | 73 | #define PCI_CLASS_SYSTEM_OTHER 0x0880 |
| 73 | 74 | ||
| 74 | #define PCI_BASE_CLASS_INPUT 0x09 | 75 | #define PCI_BASE_CLASS_INPUT 0x09 |
| @@ -1371,6 +1372,7 @@ | |||
| 1371 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1372 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
| 1372 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1373 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
| 1373 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 | 1374 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 |
| 1375 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000SB 0x0205 | ||
| 1374 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 | 1376 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 |
| 1375 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 | 1377 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 |
| 1376 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 | 1378 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 |
| @@ -1864,11 +1866,13 @@ | |||
| 1864 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b | 1866 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b |
| 1865 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1867 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
| 1866 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | 1868 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 |
| 1869 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | ||
| 1867 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1870 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
| 1868 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1871 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
| 1869 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 1872 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
| 1870 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 | 1873 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 |
| 1871 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a | 1874 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a |
| 1875 | #define PCI_DEVICE_ID_TIGON3_5755 0x167b | ||
| 1872 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c | 1876 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c |
| 1873 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d | 1877 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d |
| 1874 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e | 1878 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e |
diff --git a/include/linux/platform.h b/include/linux/platform.h deleted file mode 100644 index 3c33084a6ec2..000000000000 --- a/include/linux/platform.h +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/platform.h - platform driver definitions | ||
| 3 | * | ||
| 4 | * Because of the prolific consumerism of the average American, | ||
| 5 | * and the dominant marketing budgets of PC OEMs, we have been | ||
| 6 | * blessed with frequent updates of the PC architecture. | ||
| 7 | * | ||
| 8 | * While most of these calls are singular per architecture, they | ||
| 9 | * require an extra layer of abstraction on the x86 so the right | ||
| 10 | * subsystem gets the right call. | ||
| 11 | * | ||
| 12 | * Basically, this consolidates the power off and reboot callbacks | ||
| 13 | * into one structure, as well as adding power management hooks. | ||
| 14 | * | ||
| 15 | * When adding a platform driver, please make sure all callbacks are | ||
| 16 | * filled. There are defaults defined below that do nothing; use those | ||
| 17 | * if you do not support that callback. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef _PLATFORM_H_ | ||
| 21 | #define _PLATFORM_H_ | ||
| 22 | #ifdef __KERNEL__ | ||
| 23 | |||
| 24 | #include <linux/types.h> | ||
| 25 | |||
| 26 | struct platform_t { | ||
| 27 | char * name; | ||
| 28 | u32 suspend_states; | ||
| 29 | void (*reboot)(char * cmd); | ||
| 30 | void (*halt)(void); | ||
| 31 | void (*power_off)(void); | ||
| 32 | int (*suspend)(int state, int flags); | ||
| 33 | void (*idle)(void); | ||
| 34 | }; | ||
| 35 | |||
| 36 | extern struct platform_t * platform; | ||
| 37 | extern void default_reboot(char * cmd); | ||
| 38 | extern void default_halt(void); | ||
| 39 | extern int default_suspend(int state, int flags); | ||
| 40 | extern void default_idle(void); | ||
| 41 | |||
| 42 | #endif /* __KERNEL__ */ | ||
| 43 | #endif /* _PLATFORM_H */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5be87ba3b7ac..6df2585c0169 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -188,6 +188,8 @@ extern void device_power_up(void); | |||
| 188 | extern void device_resume(void); | 188 | extern void device_resume(void); |
| 189 | 189 | ||
| 190 | #ifdef CONFIG_PM | 190 | #ifdef CONFIG_PM |
| 191 | extern suspend_disk_method_t pm_disk_mode; | ||
| 192 | |||
| 191 | extern int device_suspend(pm_message_t state); | 193 | extern int device_suspend(pm_message_t state); |
| 192 | 194 | ||
| 193 | #define device_set_wakeup_enable(dev,val) \ | 195 | #define device_set_wakeup_enable(dev,val) \ |
| @@ -215,7 +217,6 @@ static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |||
| 215 | 217 | ||
| 216 | static inline void dpm_runtime_resume(struct device * dev) | 218 | static inline void dpm_runtime_resume(struct device * dev) |
| 217 | { | 219 | { |
| 218 | |||
| 219 | } | 220 | } |
| 220 | 221 | ||
| 221 | #endif | 222 | #endif |
diff --git a/include/linux/profile.h b/include/linux/profile.h index 026969a5595c..1f2fea6640a4 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | struct proc_dir_entry; | 15 | struct proc_dir_entry; |
| 16 | struct pt_regs; | 16 | struct pt_regs; |
| 17 | struct notifier_block; | ||
| 17 | 18 | ||
| 18 | /* init basic kernel profiler */ | 19 | /* init basic kernel profiler */ |
| 19 | void __init profile_init(void); | 20 | void __init profile_init(void); |
| @@ -32,7 +33,6 @@ enum profile_type { | |||
| 32 | 33 | ||
| 33 | #ifdef CONFIG_PROFILING | 34 | #ifdef CONFIG_PROFILING |
| 34 | 35 | ||
| 35 | struct notifier_block; | ||
| 36 | struct task_struct; | 36 | struct task_struct; |
| 37 | struct mm_struct; | 37 | struct mm_struct; |
| 38 | 38 | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index f33aeb22c26a..8dc2d04a103f 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
| 39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
| 40 | #include <linux/spinlock.h> | 40 | #include <linux/spinlock.h> |
| 41 | #include <linux/mutex.h> | ||
| 41 | 42 | ||
| 42 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 43 | #define __DQUOT_VERSION__ "dquot_6.5.1" |
| 43 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | 44 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 |
| @@ -215,7 +216,7 @@ struct dquot { | |||
| 215 | struct list_head dq_inuse; /* List of all quotas */ | 216 | struct list_head dq_inuse; /* List of all quotas */ |
| 216 | struct list_head dq_free; /* Free list element */ | 217 | struct list_head dq_free; /* Free list element */ |
| 217 | struct list_head dq_dirty; /* List of dirty dquots */ | 218 | struct list_head dq_dirty; /* List of dirty dquots */ |
| 218 | struct semaphore dq_lock; /* dquot IO lock */ | 219 | struct mutex dq_lock; /* dquot IO lock */ |
| 219 | atomic_t dq_count; /* Use count */ | 220 | atomic_t dq_count; /* Use count */ |
| 220 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ | 221 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ |
| 221 | struct super_block *dq_sb; /* superblock this applies to */ | 222 | struct super_block *dq_sb; /* superblock this applies to */ |
| @@ -285,8 +286,8 @@ struct quota_format_type { | |||
| 285 | 286 | ||
| 286 | struct quota_info { | 287 | struct quota_info { |
| 287 | unsigned int flags; /* Flags for diskquotas on this device */ | 288 | unsigned int flags; /* Flags for diskquotas on this device */ |
| 288 | struct semaphore dqio_sem; /* lock device while I/O in progress */ | 289 | struct mutex dqio_mutex; /* lock device while I/O in progress */ |
| 289 | struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ | 290 | struct mutex dqonoff_mutex; /* Serialize quotaon & quotaoff */ |
| 290 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ | 291 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ |
| 291 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ | 292 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ |
| 292 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ | 293 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 9d5494aaac0f..3009c813d83d 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
| @@ -130,6 +130,6 @@ struct r1bio_s { | |||
| 130 | * with failure when last write completes (and all failed). | 130 | * with failure when last write completes (and all failed). |
| 131 | * Record that bi_end_io was called with this flag... | 131 | * Record that bi_end_io was called with this flag... |
| 132 | */ | 132 | */ |
| 133 | #define R1BIO_Returned 4 | 133 | #define R1BIO_Returned 6 |
| 134 | 134 | ||
| 135 | #endif | 135 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index c2ec6c77874e..5673008b61e1 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -113,8 +113,6 @@ struct rcu_data { | |||
| 113 | 113 | ||
| 114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); | 114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); |
| 115 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); | 115 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); |
| 116 | extern struct rcu_ctrlblk rcu_ctrlblk; | ||
| 117 | extern struct rcu_ctrlblk rcu_bh_ctrlblk; | ||
| 118 | 116 | ||
| 119 | /* | 117 | /* |
| 120 | * Increment the quiescent state counter. | 118 | * Increment the quiescent state counter. |
diff --git a/include/linux/relay.h b/include/linux/relay.h new file mode 100644 index 000000000000..4bcc1531d6a9 --- /dev/null +++ b/include/linux/relay.h | |||
| @@ -0,0 +1,281 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/relay.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp | ||
| 5 | * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com) | ||
| 6 | * | ||
| 7 | * CONFIG_RELAY definitions and declarations | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef _LINUX_RELAY_H | ||
| 11 | #define _LINUX_RELAY_H | ||
| 12 | |||
| 13 | #include <linux/config.h> | ||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/sched.h> | ||
| 16 | #include <linux/wait.h> | ||
| 17 | #include <linux/list.h> | ||
| 18 | #include <linux/fs.h> | ||
| 19 | #include <linux/poll.h> | ||
| 20 | #include <linux/kref.h> | ||
| 21 | |||
| 22 | /* Needs a _much_ better name... */ | ||
| 23 | #define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE) | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Tracks changes to rchan/rchan_buf structs | ||
| 27 | */ | ||
| 28 | #define RELAYFS_CHANNEL_VERSION 6 | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Per-cpu relay channel buffer | ||
| 32 | */ | ||
| 33 | struct rchan_buf | ||
| 34 | { | ||
| 35 | void *start; /* start of channel buffer */ | ||
| 36 | void *data; /* start of current sub-buffer */ | ||
| 37 | size_t offset; /* current offset into sub-buffer */ | ||
| 38 | size_t subbufs_produced; /* count of sub-buffers produced */ | ||
| 39 | size_t subbufs_consumed; /* count of sub-buffers consumed */ | ||
| 40 | struct rchan *chan; /* associated channel */ | ||
| 41 | wait_queue_head_t read_wait; /* reader wait queue */ | ||
| 42 | struct work_struct wake_readers; /* reader wake-up work struct */ | ||
| 43 | struct dentry *dentry; /* channel file dentry */ | ||
| 44 | struct kref kref; /* channel buffer refcount */ | ||
| 45 | struct page **page_array; /* array of current buffer pages */ | ||
| 46 | unsigned int page_count; /* number of current buffer pages */ | ||
| 47 | unsigned int finalized; /* buffer has been finalized */ | ||
| 48 | size_t *padding; /* padding counts per sub-buffer */ | ||
| 49 | size_t prev_padding; /* temporary variable */ | ||
| 50 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ | ||
| 51 | unsigned int cpu; /* this buf's cpu */ | ||
| 52 | } ____cacheline_aligned; | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Relay channel data structure | ||
| 56 | */ | ||
| 57 | struct rchan | ||
| 58 | { | ||
| 59 | u32 version; /* the version of this struct */ | ||
| 60 | size_t subbuf_size; /* sub-buffer size */ | ||
| 61 | size_t n_subbufs; /* number of sub-buffers per buffer */ | ||
| 62 | size_t alloc_size; /* total buffer size allocated */ | ||
| 63 | struct rchan_callbacks *cb; /* client callbacks */ | ||
| 64 | struct kref kref; /* channel refcount */ | ||
| 65 | void *private_data; /* for user-defined data */ | ||
| 66 | size_t last_toobig; /* tried to log event > subbuf size */ | ||
| 67 | struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ | ||
| 68 | }; | ||
| 69 | |||
| 70 | /* | ||
| 71 | * Relay channel client callbacks | ||
| 72 | */ | ||
| 73 | struct rchan_callbacks | ||
| 74 | { | ||
| 75 | /* | ||
| 76 | * subbuf_start - called on buffer-switch to a new sub-buffer | ||
| 77 | * @buf: the channel buffer containing the new sub-buffer | ||
| 78 | * @subbuf: the start of the new sub-buffer | ||
| 79 | * @prev_subbuf: the start of the previous sub-buffer | ||
| 80 | * @prev_padding: unused space at the end of previous sub-buffer | ||
| 81 | * | ||
| 82 | * The client should return 1 to continue logging, 0 to stop | ||
| 83 | * logging. | ||
| 84 | * | ||
| 85 | * NOTE: subbuf_start will also be invoked when the buffer is | ||
| 86 | * created, so that the first sub-buffer can be initialized | ||
| 87 | * if necessary. In this case, prev_subbuf will be NULL. | ||
| 88 | * | ||
| 89 | * NOTE: the client can reserve bytes at the beginning of the new | ||
| 90 | * sub-buffer by calling subbuf_start_reserve() in this callback. | ||
| 91 | */ | ||
| 92 | int (*subbuf_start) (struct rchan_buf *buf, | ||
| 93 | void *subbuf, | ||
| 94 | void *prev_subbuf, | ||
| 95 | size_t prev_padding); | ||
| 96 | |||
| 97 | /* | ||
| 98 | * buf_mapped - relay buffer mmap notification | ||
| 99 | * @buf: the channel buffer | ||
| 100 | * @filp: relay file pointer | ||
| 101 | * | ||
| 102 | * Called when a relay file is successfully mmapped | ||
| 103 | */ | ||
| 104 | void (*buf_mapped)(struct rchan_buf *buf, | ||
| 105 | struct file *filp); | ||
| 106 | |||
| 107 | /* | ||
| 108 | * buf_unmapped - relay buffer unmap notification | ||
| 109 | * @buf: the channel buffer | ||
| 110 | * @filp: relay file pointer | ||
| 111 | * | ||
| 112 | * Called when a relay file is successfully unmapped | ||
| 113 | */ | ||
| 114 | void (*buf_unmapped)(struct rchan_buf *buf, | ||
| 115 | struct file *filp); | ||
| 116 | /* | ||
| 117 | * create_buf_file - create file to represent a relay channel buffer | ||
| 118 | * @filename: the name of the file to create | ||
| 119 | * @parent: the parent of the file to create | ||
| 120 | * @mode: the mode of the file to create | ||
| 121 | * @buf: the channel buffer | ||
| 122 | * @is_global: outparam - set non-zero if the buffer should be global | ||
| 123 | * | ||
| 124 | * Called during relay_open(), once for each per-cpu buffer, | ||
| 125 | * to allow the client to create a file to be used to | ||
| 126 | * represent the corresponding channel buffer. If the file is | ||
| 127 | * created outside of relay, the parent must also exist in | ||
| 128 | * that filesystem. | ||
| 129 | * | ||
| 130 | * The callback should return the dentry of the file created | ||
| 131 | * to represent the relay buffer. | ||
| 132 | * | ||
| 133 | * Setting the is_global outparam to a non-zero value will | ||
| 134 | * cause relay_open() to create a single global buffer rather | ||
| 135 | * than the default set of per-cpu buffers. | ||
| 136 | * | ||
| 137 | * See Documentation/filesystems/relayfs.txt for more info. | ||
| 138 | */ | ||
| 139 | struct dentry *(*create_buf_file)(const char *filename, | ||
| 140 | struct dentry *parent, | ||
| 141 | int mode, | ||
| 142 | struct rchan_buf *buf, | ||
| 143 | int *is_global); | ||
| 144 | |||
| 145 | /* | ||
| 146 | * remove_buf_file - remove file representing a relay channel buffer | ||
| 147 | * @dentry: the dentry of the file to remove | ||
| 148 | * | ||
| 149 | * Called during relay_close(), once for each per-cpu buffer, | ||
| 150 | * to allow the client to remove a file used to represent a | ||
| 151 | * channel buffer. | ||
| 152 | * | ||
| 153 | * The callback should return 0 if successful, negative if not. | ||
| 154 | */ | ||
| 155 | int (*remove_buf_file)(struct dentry *dentry); | ||
| 156 | }; | ||
| 157 | |||
| 158 | /* | ||
| 159 | * CONFIG_RELAY kernel API, kernel/relay.c | ||
| 160 | */ | ||
| 161 | |||
| 162 | struct rchan *relay_open(const char *base_filename, | ||
| 163 | struct dentry *parent, | ||
| 164 | size_t subbuf_size, | ||
| 165 | size_t n_subbufs, | ||
| 166 | struct rchan_callbacks *cb); | ||
| 167 | extern void relay_close(struct rchan *chan); | ||
| 168 | extern void relay_flush(struct rchan *chan); | ||
| 169 | extern void relay_subbufs_consumed(struct rchan *chan, | ||
| 170 | unsigned int cpu, | ||
| 171 | size_t consumed); | ||
| 172 | extern void relay_reset(struct rchan *chan); | ||
| 173 | extern int relay_buf_full(struct rchan_buf *buf); | ||
| 174 | |||
| 175 | extern size_t relay_switch_subbuf(struct rchan_buf *buf, | ||
| 176 | size_t length); | ||
| 177 | |||
| 178 | /** | ||
| 179 | * relay_write - write data into the channel | ||
| 180 | * @chan: relay channel | ||
| 181 | * @data: data to be written | ||
| 182 | * @length: number of bytes to write | ||
| 183 | * | ||
| 184 | * Writes data into the current cpu's channel buffer. | ||
| 185 | * | ||
| 186 | * Protects the buffer by disabling interrupts. Use this | ||
| 187 | * if you might be logging from interrupt context. Try | ||
| 188 | * __relay_write() if you know you won't be logging from | ||
| 189 | * interrupt context. | ||
| 190 | */ | ||
| 191 | static inline void relay_write(struct rchan *chan, | ||
| 192 | const void *data, | ||
| 193 | size_t length) | ||
| 194 | { | ||
| 195 | unsigned long flags; | ||
| 196 | struct rchan_buf *buf; | ||
| 197 | |||
| 198 | local_irq_save(flags); | ||
| 199 | buf = chan->buf[smp_processor_id()]; | ||
| 200 | if (unlikely(buf->offset + length > chan->subbuf_size)) | ||
| 201 | length = relay_switch_subbuf(buf, length); | ||
| 202 | memcpy(buf->data + buf->offset, data, length); | ||
| 203 | buf->offset += length; | ||
| 204 | local_irq_restore(flags); | ||
| 205 | } | ||
| 206 | |||
| 207 | /** | ||
| 208 | * __relay_write - write data into the channel | ||
| 209 | * @chan: relay channel | ||
| 210 | * @data: data to be written | ||
| 211 | * @length: number of bytes to write | ||
| 212 | * | ||
| 213 | * Writes data into the current cpu's channel buffer. | ||
| 214 | * | ||
| 215 | * Protects the buffer by disabling preemption. Use | ||
| 216 | * relay_write() if you might be logging from interrupt | ||
| 217 | * context. | ||
| 218 | */ | ||
| 219 | static inline void __relay_write(struct rchan *chan, | ||
| 220 | const void *data, | ||
| 221 | size_t length) | ||
| 222 | { | ||
| 223 | struct rchan_buf *buf; | ||
| 224 | |||
| 225 | buf = chan->buf[get_cpu()]; | ||
| 226 | if (unlikely(buf->offset + length > buf->chan->subbuf_size)) | ||
| 227 | length = relay_switch_subbuf(buf, length); | ||
| 228 | memcpy(buf->data + buf->offset, data, length); | ||
| 229 | buf->offset += length; | ||
| 230 | put_cpu(); | ||
| 231 | } | ||
| 232 | |||
| 233 | /** | ||
| 234 | * relay_reserve - reserve slot in channel buffer | ||
| 235 | * @chan: relay channel | ||
| 236 | * @length: number of bytes to reserve | ||
| 237 | * | ||
| 238 | * Returns pointer to reserved slot, NULL if full. | ||
| 239 | * | ||
| 240 | * Reserves a slot in the current cpu's channel buffer. | ||
| 241 | * Does not protect the buffer at all - caller must provide | ||
| 242 | * appropriate synchronization. | ||
| 243 | */ | ||
| 244 | static inline void *relay_reserve(struct rchan *chan, size_t length) | ||
| 245 | { | ||
| 246 | void *reserved; | ||
| 247 | struct rchan_buf *buf = chan->buf[smp_processor_id()]; | ||
| 248 | |||
| 249 | if (unlikely(buf->offset + length > buf->chan->subbuf_size)) { | ||
| 250 | length = relay_switch_subbuf(buf, length); | ||
| 251 | if (!length) | ||
| 252 | return NULL; | ||
| 253 | } | ||
| 254 | reserved = buf->data + buf->offset; | ||
| 255 | buf->offset += length; | ||
| 256 | |||
| 257 | return reserved; | ||
| 258 | } | ||
| 259 | |||
| 260 | /** | ||
| 261 | * subbuf_start_reserve - reserve bytes at the start of a sub-buffer | ||
| 262 | * @buf: relay channel buffer | ||
| 263 | * @length: number of bytes to reserve | ||
| 264 | * | ||
| 265 | * Helper function used to reserve bytes at the beginning of | ||
| 266 | * a sub-buffer in the subbuf_start() callback. | ||
| 267 | */ | ||
| 268 | static inline void subbuf_start_reserve(struct rchan_buf *buf, | ||
| 269 | size_t length) | ||
| 270 | { | ||
| 271 | BUG_ON(length >= buf->chan->subbuf_size - 1); | ||
| 272 | buf->offset = length; | ||
| 273 | } | ||
| 274 | |||
| 275 | /* | ||
| 276 | * exported relay file operations, kernel/relay.c | ||
| 277 | */ | ||
| 278 | extern struct file_operations relay_file_operations; | ||
| 279 | |||
| 280 | #endif /* _LINUX_RELAY_H */ | ||
| 281 | |||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d572d5376319..df0cdd41085c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -839,6 +839,7 @@ enum | |||
| 839 | #define RTMGRP_IPV4_IFADDR 0x10 | 839 | #define RTMGRP_IPV4_IFADDR 0x10 |
| 840 | #define RTMGRP_IPV4_MROUTE 0x20 | 840 | #define RTMGRP_IPV4_MROUTE 0x20 |
| 841 | #define RTMGRP_IPV4_ROUTE 0x40 | 841 | #define RTMGRP_IPV4_ROUTE 0x40 |
| 842 | #define RTMGRP_IPV4_RULE 0x80 | ||
| 842 | 843 | ||
| 843 | #define RTMGRP_IPV6_IFADDR 0x100 | 844 | #define RTMGRP_IPV6_IFADDR 0x100 |
| 844 | #define RTMGRP_IPV6_MROUTE 0x200 | 845 | #define RTMGRP_IPV6_MROUTE 0x200 |
| @@ -869,7 +870,8 @@ enum rtnetlink_groups { | |||
| 869 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE | 870 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE |
| 870 | RTNLGRP_IPV4_ROUTE, | 871 | RTNLGRP_IPV4_ROUTE, |
| 871 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE | 872 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE |
| 872 | RTNLGRP_NOP1, | 873 | RTNLGRP_IPV4_RULE, |
| 874 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE | ||
| 873 | RTNLGRP_IPV6_IFADDR, | 875 | RTNLGRP_IPV6_IFADDR, |
| 874 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR | 876 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR |
| 875 | RTNLGRP_IPV6_MROUTE, | 877 | RTNLGRP_IPV6_MROUTE, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 62e6314382f0..e0054c1b9a09 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -206,11 +206,11 @@ extern void update_process_times(int user); | |||
| 206 | extern void scheduler_tick(void); | 206 | extern void scheduler_tick(void); |
| 207 | 207 | ||
| 208 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 208 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
| 209 | extern void softlockup_tick(struct pt_regs *regs); | 209 | extern void softlockup_tick(void); |
| 210 | extern void spawn_softlockup_task(void); | 210 | extern void spawn_softlockup_task(void); |
| 211 | extern void touch_softlockup_watchdog(void); | 211 | extern void touch_softlockup_watchdog(void); |
| 212 | #else | 212 | #else |
| 213 | static inline void softlockup_tick(struct pt_regs *regs) | 213 | static inline void softlockup_tick(void) |
| 214 | { | 214 | { |
| 215 | } | 215 | } |
| 216 | static inline void spawn_softlockup_task(void) | 216 | static inline void spawn_softlockup_task(void) |
| @@ -706,6 +706,7 @@ struct task_struct { | |||
| 706 | prio_array_t *array; | 706 | prio_array_t *array; |
| 707 | 707 | ||
| 708 | unsigned short ioprio; | 708 | unsigned short ioprio; |
| 709 | unsigned int btrace_seq; | ||
| 709 | 710 | ||
| 710 | unsigned long sleep_avg; | 711 | unsigned long sleep_avg; |
| 711 | unsigned long long timestamp, last_ran; | 712 | unsigned long long timestamp, last_ran; |
| @@ -868,6 +869,7 @@ struct task_struct { | |||
| 868 | struct cpuset *cpuset; | 869 | struct cpuset *cpuset; |
| 869 | nodemask_t mems_allowed; | 870 | nodemask_t mems_allowed; |
| 870 | int cpuset_mems_generation; | 871 | int cpuset_mems_generation; |
| 872 | int cpuset_mem_spread_rotor; | ||
| 871 | #endif | 873 | #endif |
| 872 | atomic_t fs_excl; /* holding fs exclusive resources */ | 874 | atomic_t fs_excl; /* holding fs exclusive resources */ |
| 873 | struct rcu_head rcu; | 875 | struct rcu_head rcu; |
| @@ -928,6 +930,9 @@ static inline void put_task_struct(struct task_struct *t) | |||
| 928 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ | 930 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ |
| 929 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ | 931 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ |
| 930 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ | 932 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ |
| 933 | #define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ | ||
| 934 | #define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */ | ||
| 935 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | ||
| 931 | 936 | ||
| 932 | /* | 937 | /* |
| 933 | * Only the _current_ task can read/write to tsk->flags, but other | 938 | * Only the _current_ task can read/write to tsk->flags, but other |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 850a974ee505..b95f6eb7254c 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/string.h> | 6 | #include <linux/string.h> |
| 7 | #include <asm/semaphore.h> | 7 | #include <linux/mutex.h> |
| 8 | 8 | ||
| 9 | struct seq_operations; | 9 | struct seq_operations; |
| 10 | struct file; | 10 | struct file; |
| @@ -19,7 +19,7 @@ struct seq_file { | |||
| 19 | size_t count; | 19 | size_t count; |
| 20 | loff_t index; | 20 | loff_t index; |
| 21 | loff_t version; | 21 | loff_t version; |
| 22 | struct semaphore sem; | 22 | struct mutex lock; |
| 23 | struct seq_operations *op; | 23 | struct seq_operations *op; |
| 24 | void *private; | 24 | void *private; |
| 25 | }; | 25 | }; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 2b28c849d75a..e2ee5b268797 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -46,6 +46,7 @@ typedef struct kmem_cache kmem_cache_t; | |||
| 46 | what is reclaimable later*/ | 46 | what is reclaimable later*/ |
| 47 | #define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ | 47 | #define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ |
| 48 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */ | 48 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */ |
| 49 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ | ||
| 49 | 50 | ||
| 50 | /* flags passed to a constructor func */ | 51 | /* flags passed to a constructor func */ |
| 51 | #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ | 52 | #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ |
diff --git a/include/linux/string.h b/include/linux/string.h index 369be3264a55..dee221429ad0 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -18,6 +18,8 @@ extern char * strsep(char **,const char *); | |||
| 18 | extern __kernel_size_t strspn(const char *,const char *); | 18 | extern __kernel_size_t strspn(const char *,const char *); |
| 19 | extern __kernel_size_t strcspn(const char *,const char *); | 19 | extern __kernel_size_t strcspn(const char *,const char *); |
| 20 | 20 | ||
| 21 | extern char *strndup_user(const char __user *, long); | ||
| 22 | |||
| 21 | /* | 23 | /* |
| 22 | * Include machine specific inline routines | 24 | * Include machine specific inline routines |
| 23 | */ | 25 | */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 12415dd94451..54eac8a39a4c 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -234,14 +234,15 @@ extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *v | |||
| 234 | /* linux/mm/swapfile.c */ | 234 | /* linux/mm/swapfile.c */ |
| 235 | extern long total_swap_pages; | 235 | extern long total_swap_pages; |
| 236 | extern unsigned int nr_swapfiles; | 236 | extern unsigned int nr_swapfiles; |
| 237 | extern struct swap_info_struct swap_info[]; | ||
| 238 | extern void si_swapinfo(struct sysinfo *); | 237 | extern void si_swapinfo(struct sysinfo *); |
| 239 | extern swp_entry_t get_swap_page(void); | 238 | extern swp_entry_t get_swap_page(void); |
| 240 | extern swp_entry_t get_swap_page_of_type(int type); | 239 | extern swp_entry_t get_swap_page_of_type(int); |
| 241 | extern int swap_duplicate(swp_entry_t); | 240 | extern int swap_duplicate(swp_entry_t); |
| 242 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 241 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
| 243 | extern void swap_free(swp_entry_t); | 242 | extern void swap_free(swp_entry_t); |
| 244 | extern void free_swap_and_cache(swp_entry_t); | 243 | extern void free_swap_and_cache(swp_entry_t); |
| 244 | extern int swap_type_of(dev_t); | ||
| 245 | extern unsigned int count_swap_pages(int, int); | ||
| 245 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); | 246 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); |
| 246 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 247 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
| 247 | extern int can_share_swap_page(struct page *); | 248 | extern int can_share_swap_page(struct page *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b9ea44ac0ddb..e487e3b60f60 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -568,5 +568,6 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | |||
| 568 | int flag); | 568 | int flag); |
| 569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
| 570 | int flags, int mode); | 570 | int flags, int mode); |
| 571 | asmlinkage long sys_unshare(unsigned long unshare_flags); | ||
| 571 | 572 | ||
| 572 | #endif | 573 | #endif |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f45cd74e6f24..f13f49afe198 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/tty_driver.h> | 24 | #include <linux/tty_driver.h> |
| 25 | #include <linux/tty_ldisc.h> | 25 | #include <linux/tty_ldisc.h> |
| 26 | #include <linux/screen_info.h> | 26 | #include <linux/screen_info.h> |
| 27 | #include <linux/mutex.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
| 29 | 30 | ||
| @@ -231,8 +232,8 @@ struct tty_struct { | |||
| 231 | int canon_data; | 232 | int canon_data; |
| 232 | unsigned long canon_head; | 233 | unsigned long canon_head; |
| 233 | unsigned int canon_column; | 234 | unsigned int canon_column; |
| 234 | struct semaphore atomic_read; | 235 | struct mutex atomic_read_lock; |
| 235 | struct semaphore atomic_write; | 236 | struct mutex atomic_write_lock; |
| 236 | unsigned char *write_buf; | 237 | unsigned char *write_buf; |
| 237 | int write_cnt; | 238 | int write_cnt; |
| 238 | spinlock_t read_lock; | 239 | spinlock_t read_lock; |
| @@ -319,8 +320,7 @@ extern void tty_ldisc_put(int); | |||
| 319 | extern void tty_wakeup(struct tty_struct *tty); | 320 | extern void tty_wakeup(struct tty_struct *tty); |
| 320 | extern void tty_ldisc_flush(struct tty_struct *tty); | 321 | extern void tty_ldisc_flush(struct tty_struct *tty); |
| 321 | 322 | ||
| 322 | struct semaphore; | 323 | extern struct mutex tty_mutex; |
| 323 | extern struct semaphore tty_sem; | ||
| 324 | 324 | ||
| 325 | /* n_tty.c */ | 325 | /* n_tty.c */ |
| 326 | extern struct tty_ldisc tty_ldisc_N_TTY; | 326 | extern struct tty_ldisc tty_ldisc_N_TTY; |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 222faf97d5f9..0c6169fff366 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
| @@ -7,14 +7,8 @@ extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *c | |||
| 7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | 7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); |
| 8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | 8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); |
| 9 | 9 | ||
| 10 | #ifdef INCLUDE_INLINE_FUNCS | 10 | static inline int tty_insert_flip_char(struct tty_struct *tty, |
| 11 | #define _INLINE_ extern | 11 | unsigned char ch, char flag) |
| 12 | #else | ||
| 13 | #define _INLINE_ static __inline__ | ||
| 14 | #endif | ||
| 15 | |||
| 16 | _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, | ||
| 17 | unsigned char ch, char flag) | ||
| 18 | { | 12 | { |
| 19 | struct tty_buffer *tb = tty->buf.tail; | 13 | struct tty_buffer *tb = tty->buf.tail; |
| 20 | if (tb && tb->active && tb->used < tb->size) { | 14 | if (tb && tb->active && tb->used < tb->size) { |
| @@ -25,7 +19,7 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, | |||
| 25 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | 19 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); |
| 26 | } | 20 | } |
| 27 | 21 | ||
| 28 | _INLINE_ void tty_schedule_flip(struct tty_struct *tty) | 22 | static inline void tty_schedule_flip(struct tty_struct *tty) |
| 29 | { | 23 | { |
| 30 | unsigned long flags; | 24 | unsigned long flags; |
| 31 | spin_lock_irqsave(&tty->buf.lock, flags); | 25 | spin_lock_irqsave(&tty->buf.lock, flags); |
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h index b15ff2e99c91..80ae9ef940dc 100644 --- a/include/linux/udf_fs_sb.h +++ b/include/linux/udf_fs_sb.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #ifndef _UDF_FS_SB_H | 13 | #ifndef _UDF_FS_SB_H |
| 14 | #define _UDF_FS_SB_H 1 | 14 | #define _UDF_FS_SB_H 1 |
| 15 | 15 | ||
| 16 | #include <asm/semaphore.h> | 16 | #include <linux/mutex.h> |
| 17 | 17 | ||
| 18 | #pragma pack(1) | 18 | #pragma pack(1) |
| 19 | 19 | ||
| @@ -111,7 +111,7 @@ struct udf_sb_info | |||
| 111 | /* VAT inode */ | 111 | /* VAT inode */ |
| 112 | struct inode *s_vat; | 112 | struct inode *s_vat; |
| 113 | 113 | ||
| 114 | struct semaphore s_alloc_sem; | 114 | struct mutex s_alloc_mutex; |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | #endif /* _UDF_FS_SB_H */ | 117 | #endif /* _UDF_FS_SB_H */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index fab5aed8ca31..530ae3f4248c 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -73,6 +73,11 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
| 73 | int vt_waitactive(int vt); | 73 | int vt_waitactive(int vt); |
| 74 | void change_console(struct vc_data *new_vc); | 74 | void change_console(struct vc_data *new_vc); |
| 75 | void reset_vc(struct vc_data *vc); | 75 | void reset_vc(struct vc_data *vc); |
| 76 | #ifdef CONFIG_VT | ||
| 77 | int is_console_suspend_safe(void); | ||
| 78 | #else | ||
| 79 | static inline int is_console_suspend_safe(void) { return 1; } | ||
| 80 | #endif | ||
| 76 | 81 | ||
| 77 | /* | 82 | /* |
| 78 | * vc_screen.c shares this temporary buffer with the console write code so that | 83 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index a555a0f7a7b4..13588564b42b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
| 3 | * | 3 | * |
| 4 | * Version : 19 18.3.05 | 4 | * Version : 20 17.2.06 |
| 5 | * | 5 | * |
| 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
| 7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #ifndef _LINUX_WIRELESS_H | 10 | #ifndef _LINUX_WIRELESS_H |
| @@ -80,7 +80,7 @@ | |||
| 80 | * (there is some stuff that will be added in the future...) | 80 | * (there is some stuff that will be added in the future...) |
| 81 | * I just plan to increment with each new version. | 81 | * I just plan to increment with each new version. |
| 82 | */ | 82 | */ |
| 83 | #define WIRELESS_EXT 19 | 83 | #define WIRELESS_EXT 20 |
| 84 | 84 | ||
| 85 | /* | 85 | /* |
| 86 | * Changes : | 86 | * Changes : |
| @@ -204,6 +204,10 @@ | |||
| 204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros | 204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros |
| 205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM | 205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM |
| 206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros | 206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros |
| 207 | * | ||
| 208 | * V19 to V20 | ||
| 209 | * ---------- | ||
| 210 | * - RtNetlink requests support (SET/GET) | ||
| 207 | */ | 211 | */ |
| 208 | 212 | ||
| 209 | /**************************** CONSTANTS ****************************/ | 213 | /**************************** CONSTANTS ****************************/ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index beaef5c7a0ea..56f92fcbe94a 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -88,8 +88,8 @@ void throttle_vm_writeout(void); | |||
| 88 | /* These are exported to sysctl. */ | 88 | /* These are exported to sysctl. */ |
| 89 | extern int dirty_background_ratio; | 89 | extern int dirty_background_ratio; |
| 90 | extern int vm_dirty_ratio; | 90 | extern int vm_dirty_ratio; |
| 91 | extern int dirty_writeback_centisecs; | 91 | extern int dirty_writeback_interval; |
| 92 | extern int dirty_expire_centisecs; | 92 | extern int dirty_expire_interval; |
| 93 | extern int block_dump; | 93 | extern int block_dump; |
| 94 | extern int laptop_mode; | 94 | extern int laptop_mode; |
| 95 | 95 | ||
| @@ -99,7 +99,15 @@ int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | |||
| 99 | void __user *, size_t *, loff_t *); | 99 | void __user *, size_t *, loff_t *); |
| 100 | 100 | ||
| 101 | void page_writeback_init(void); | 101 | void page_writeback_init(void); |
| 102 | void balance_dirty_pages_ratelimited(struct address_space *mapping); | 102 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, |
| 103 | unsigned long nr_pages_dirtied); | ||
| 104 | |||
| 105 | static inline void | ||
| 106 | balance_dirty_pages_ratelimited(struct address_space *mapping) | ||
| 107 | { | ||
| 108 | balance_dirty_pages_ratelimited_nr(mapping, 1); | ||
| 109 | } | ||
| 110 | |||
| 103 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | 111 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); |
| 104 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 112 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
| 105 | int sync_page_range(struct inode *inode, struct address_space *mapping, | 113 | int sync_page_range(struct inode *inode, struct address_space *mapping, |
