aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-30 15:07:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-30 15:07:01 -0400
commit56f29d7fe452890eeeb7f2b0138b2d95b9745fb6 (patch)
tree01b6b70297c53c9beb8d11eb186fbad9c166b1a2 /include
parente823aff2d6eb43083abcc75a32ddfb167c324089 (diff)
parent059af497c23492cb1ddcbba11c09dad385960bc0 (diff)
Merge branch 'block' of git://brick.kernel.dk/data/git/linux-2.6-block
* 'block' of git://brick.kernel.dk/data/git/linux-2.6-block: (67 commits) [PATCH] blk_queue_start_tag() shared map race fix [PATCH] Update axboe@suse.de email address [PATCH] fix creating zero sized bio mempools in low memory system [PATCH] CONFIG_BLOCK: blk_congestion_wait() fix [PATCH] CONFIG_BLOCK internal.h cleanups [PATCH] BLOCK: Make USB storage depend on SCSI rather than selecting it [try #6] [PATCH] BLOCK: Make it possible to disable the block layer [try #6] [PATCH] BLOCK: Remove no-longer necessary linux/buffer_head.h inclusions [try #6] [PATCH] BLOCK: Remove no-longer necessary linux/mpage.h inclusions [try #6] [PATCH] BLOCK: Move the msdos device ioctl compat stuff to the msdos driver [try #6] [PATCH] BLOCK: Move the Ext3 device ioctl compat stuff to the Ext3 driver [try #6] [PATCH] BLOCK: Move the Ext2 device ioctl compat stuff to the Ext2 driver [try #6] [PATCH] BLOCK: Move the ReiserFS device ioctl compat stuff to the ReiserFS driver [try #6] [PATCH] BLOCK: Move common FS-specific ioctls to linux/fs.h [try #6] [PATCH] BLOCK: Move the loop device ioctl compat stuff to the loop driver [try #6] [PATCH] BLOCK: Move __invalidate_device() to block_dev.c [try #6] [PATCH] BLOCK: Dissociate generic_writepages() from mpage stuff [try #6] [PATCH] BLOCK: Remove dependence on existence of blockdev_superblock [try #6] [PATCH] BLOCK: Move extern declarations out of fs/*.c into header files [try #6] [PATCH] BLOCK: Don't call block_sync_page() from AFS [try #6] ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/blkdev.h333
-rw-r--r--include/linux/blktrace_api.h3
-rw-r--r--include/linux/buffer_head.h19
-rw-r--r--include/linux/compat_ioctl.h8
-rw-r--r--include/linux/elevator.h68
-rw-r--r--include/linux/ext2_fs.h64
-rw-r--r--include/linux/ext3_fs.h26
-rw-r--r--include/linux/fs.h67
-rw-r--r--include/linux/genhd.h4
-rw-r--r--include/linux/mm.h4
-rw-r--r--include/linux/mpage.h7
-rw-r--r--include/linux/raid/md.h3
-rw-r--r--include/linux/raid/md_k.h3
-rw-r--r--include/linux/ramfs.h1
-rw-r--r--include/linux/rbtree.h2
-rw-r--r--include/linux/reiserfs_fs.h37
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/tty.h3
-rw-r--r--include/linux/writeback.h2
-rw-r--r--include/scsi/scsi_tcq.h5
21 files changed, 429 insertions, 233 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 76bdaeab6f62..711c321a7011 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -148,6 +148,7 @@ struct bio {
148#define BIO_RW_BARRIER 2 148#define BIO_RW_BARRIER 2
149#define BIO_RW_FAILFAST 3 149#define BIO_RW_FAILFAST 3
150#define BIO_RW_SYNC 4 150#define BIO_RW_SYNC 4
151#define BIO_RW_META 5
151 152
152/* 153/*
153 * upper 16 bits of bi_rw define the io priority of this bio 154 * upper 16 bits of bi_rw define the io priority of this bio
@@ -178,6 +179,7 @@ struct bio {
178#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) 179#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
179#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) 180#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
180#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) 181#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
182#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
181 183
182/* 184/*
183 * will die 185 * will die
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index cfde8b3ee919..1d79b8d4ca6d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_BLKDEV_H 1#ifndef _LINUX_BLKDEV_H
2#define _LINUX_BLKDEV_H 2#define _LINUX_BLKDEV_H
3 3
4#include <linux/sched.h>
4#include <linux/major.h> 5#include <linux/major.h>
5#include <linux/genhd.h> 6#include <linux/genhd.h>
6#include <linux/list.h> 7#include <linux/list.h>
@@ -16,6 +17,22 @@
16 17
17#include <asm/scatterlist.h> 18#include <asm/scatterlist.h>
18 19
20#ifdef CONFIG_LBD
21# include <asm/div64.h>
22# define sector_div(a, b) do_div(a, b)
23#else
24# define sector_div(n, b)( \
25{ \
26 int _res; \
27 _res = (n) % (b); \
28 (n) /= (b); \
29 _res; \
30} \
31)
32#endif
33
34#ifdef CONFIG_BLOCK
35
19struct scsi_ioctl_command; 36struct scsi_ioctl_command;
20 37
21struct request_queue; 38struct request_queue;
@@ -90,7 +107,7 @@ struct io_context {
90 atomic_t refcount; 107 atomic_t refcount;
91 struct task_struct *task; 108 struct task_struct *task;
92 109
93 int (*set_ioprio)(struct io_context *, unsigned int); 110 unsigned int ioprio_changed;
94 111
95 /* 112 /*
96 * For request batching 113 * For request batching
@@ -104,8 +121,7 @@ struct io_context {
104 121
105void put_io_context(struct io_context *ioc); 122void put_io_context(struct io_context *ioc);
106void exit_io_context(void); 123void exit_io_context(void);
107struct io_context *current_io_context(gfp_t gfp_flags); 124struct io_context *get_io_context(gfp_t gfp_flags, int node);
108struct io_context *get_io_context(gfp_t gfp_flags);
109void copy_io_context(struct io_context **pdst, struct io_context **psrc); 125void copy_io_context(struct io_context **pdst, struct io_context **psrc);
110void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); 126void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
111 127
@@ -120,6 +136,90 @@ struct request_list {
120 wait_queue_head_t wait[2]; 136 wait_queue_head_t wait[2];
121}; 137};
122 138
139/*
140 * request command types
141 */
142enum rq_cmd_type_bits {
143 REQ_TYPE_FS = 1, /* fs request */
144 REQ_TYPE_BLOCK_PC, /* scsi command */
145 REQ_TYPE_SENSE, /* sense request */
146 REQ_TYPE_PM_SUSPEND, /* suspend request */
147 REQ_TYPE_PM_RESUME, /* resume request */
148 REQ_TYPE_PM_SHUTDOWN, /* shutdown request */
149 REQ_TYPE_FLUSH, /* flush request */
150 REQ_TYPE_SPECIAL, /* driver defined type */
151 REQ_TYPE_LINUX_BLOCK, /* generic block layer message */
152 /*
153 * for ATA/ATAPI devices. this really doesn't belong here, ide should
154 * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver
155 * private REQ_LB opcodes to differentiate what type of request this is
156 */
157 REQ_TYPE_ATA_CMD,
158 REQ_TYPE_ATA_TASK,
159 REQ_TYPE_ATA_TASKFILE,
160};
161
162/*
163 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
164 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
165 * SCSI cdb.
166 *
167 * 0x00 -> 0x3f are driver private, to be used for whatever purpose they need,
168 * typically to differentiate REQ_TYPE_SPECIAL requests.
169 *
170 */
171enum {
172 /*
173 * just examples for now
174 */
175 REQ_LB_OP_EJECT = 0x40, /* eject request */
176 REQ_LB_OP_FLUSH = 0x41, /* flush device */
177};
178
179/*
180 * request type modified bits. first three bits match BIO_RW* bits, important
181 */
182enum rq_flag_bits {
183 __REQ_RW, /* not set, read. set, write */
184 __REQ_FAILFAST, /* no low level driver retries */
185 __REQ_SORTED, /* elevator knows about this request */
186 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
187 __REQ_HARDBARRIER, /* may not be passed by drive either */
188 __REQ_FUA, /* forced unit access */
189 __REQ_NOMERGE, /* don't touch this for merging */
190 __REQ_STARTED, /* drive already may have started this one */
191 __REQ_DONTPREP, /* don't call prep for this one */
192 __REQ_QUEUED, /* uses queueing */
193 __REQ_ELVPRIV, /* elevator private data attached */
194 __REQ_FAILED, /* set if the request failed */
195 __REQ_QUIET, /* don't worry about errors */
196 __REQ_PREEMPT, /* set for "ide_preempt" requests */
197 __REQ_ORDERED_COLOR, /* is before or after barrier */
198 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
199 __REQ_ALLOCED, /* request came from our alloc pool */
200 __REQ_RW_META, /* metadata io request */
201 __REQ_NR_BITS, /* stops here */
202};
203
204#define REQ_RW (1 << __REQ_RW)
205#define REQ_FAILFAST (1 << __REQ_FAILFAST)
206#define REQ_SORTED (1 << __REQ_SORTED)
207#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
208#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
209#define REQ_FUA (1 << __REQ_FUA)
210#define REQ_NOMERGE (1 << __REQ_NOMERGE)
211#define REQ_STARTED (1 << __REQ_STARTED)
212#define REQ_DONTPREP (1 << __REQ_DONTPREP)
213#define REQ_QUEUED (1 << __REQ_QUEUED)
214#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
215#define REQ_FAILED (1 << __REQ_FAILED)
216#define REQ_QUIET (1 << __REQ_QUIET)
217#define REQ_PREEMPT (1 << __REQ_PREEMPT)
218#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
219#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
220#define REQ_ALLOCED (1 << __REQ_ALLOCED)
221#define REQ_RW_META (1 << __REQ_RW_META)
222
123#define BLK_MAX_CDB 16 223#define BLK_MAX_CDB 16
124 224
125/* 225/*
@@ -129,30 +229,46 @@ struct request {
129 struct list_head queuelist; 229 struct list_head queuelist;
130 struct list_head donelist; 230 struct list_head donelist;
131 231
132 unsigned long flags; /* see REQ_ bits below */ 232 request_queue_t *q;
233
234 unsigned int cmd_flags;
235 enum rq_cmd_type_bits cmd_type;
133 236
134 /* Maintain bio traversal state for part by part I/O submission. 237 /* Maintain bio traversal state for part by part I/O submission.
135 * hard_* are block layer internals, no driver should touch them! 238 * hard_* are block layer internals, no driver should touch them!
136 */ 239 */
137 240
138 sector_t sector; /* next sector to submit */ 241 sector_t sector; /* next sector to submit */
242 sector_t hard_sector; /* next sector to complete */
139 unsigned long nr_sectors; /* no. of sectors left to submit */ 243 unsigned long nr_sectors; /* no. of sectors left to submit */
244 unsigned long hard_nr_sectors; /* no. of sectors left to complete */
140 /* no. of sectors left to submit in the current segment */ 245 /* no. of sectors left to submit in the current segment */
141 unsigned int current_nr_sectors; 246 unsigned int current_nr_sectors;
142 247
143 sector_t hard_sector; /* next sector to complete */
144 unsigned long hard_nr_sectors; /* no. of sectors left to complete */
145 /* no. of sectors left to complete in the current segment */ 248 /* no. of sectors left to complete in the current segment */
146 unsigned int hard_cur_sectors; 249 unsigned int hard_cur_sectors;
147 250
148 struct bio *bio; 251 struct bio *bio;
149 struct bio *biotail; 252 struct bio *biotail;
150 253
254 struct hlist_node hash; /* merge hash */
255 /*
256 * The rb_node is only used inside the io scheduler, requests
257 * are pruned when moved to the dispatch queue. So let the
258 * completion_data share space with the rb_node.
259 */
260 union {
261 struct rb_node rb_node; /* sort/lookup */
262 void *completion_data;
263 };
264
265 /*
266 * two pointers are available for the IO schedulers, if they need
267 * more they have to dynamically allocate it.
268 */
151 void *elevator_private; 269 void *elevator_private;
152 void *completion_data; 270 void *elevator_private2;
153 271
154 int rq_status; /* should split this into a few status bits */
155 int errors;
156 struct gendisk *rq_disk; 272 struct gendisk *rq_disk;
157 unsigned long start_time; 273 unsigned long start_time;
158 274
@@ -170,15 +286,13 @@ struct request {
170 286
171 unsigned short ioprio; 287 unsigned short ioprio;
172 288
289 void *special;
290 char *buffer;
291
173 int tag; 292 int tag;
293 int errors;
174 294
175 int ref_count; 295 int ref_count;
176 request_queue_t *q;
177 struct request_list *rl;
178
179 struct completion *waiting;
180 void *special;
181 char *buffer;
182 296
183 /* 297 /*
184 * when request is used as a packet command carrier 298 * when request is used as a packet command carrier
@@ -195,80 +309,14 @@ struct request {
195 int retries; 309 int retries;
196 310
197 /* 311 /*
198 * completion callback. end_io_data should be folded in with waiting 312 * completion callback.
199 */ 313 */
200 rq_end_io_fn *end_io; 314 rq_end_io_fn *end_io;
201 void *end_io_data; 315 void *end_io_data;
202}; 316};
203 317
204/* 318/*
205 * first three bits match BIO_RW* bits, important 319 * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME
206 */
207enum rq_flag_bits {
208 __REQ_RW, /* not set, read. set, write */
209 __REQ_FAILFAST, /* no low level driver retries */
210 __REQ_SORTED, /* elevator knows about this request */
211 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
212 __REQ_HARDBARRIER, /* may not be passed by drive either */
213 __REQ_FUA, /* forced unit access */
214 __REQ_CMD, /* is a regular fs rw request */
215 __REQ_NOMERGE, /* don't touch this for merging */
216 __REQ_STARTED, /* drive already may have started this one */
217 __REQ_DONTPREP, /* don't call prep for this one */
218 __REQ_QUEUED, /* uses queueing */
219 __REQ_ELVPRIV, /* elevator private data attached */
220 /*
221 * for ATA/ATAPI devices
222 */
223 __REQ_PC, /* packet command (special) */
224 __REQ_BLOCK_PC, /* queued down pc from block layer */
225 __REQ_SENSE, /* sense retrival */
226
227 __REQ_FAILED, /* set if the request failed */
228 __REQ_QUIET, /* don't worry about errors */
229 __REQ_SPECIAL, /* driver suplied command */
230 __REQ_DRIVE_CMD,
231 __REQ_DRIVE_TASK,
232 __REQ_DRIVE_TASKFILE,
233 __REQ_PREEMPT, /* set for "ide_preempt" requests */
234 __REQ_PM_SUSPEND, /* suspend request */
235 __REQ_PM_RESUME, /* resume request */
236 __REQ_PM_SHUTDOWN, /* shutdown request */
237 __REQ_ORDERED_COLOR, /* is before or after barrier */
238 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
239 __REQ_NR_BITS, /* stops here */
240};
241
242#define REQ_RW (1 << __REQ_RW)
243#define REQ_FAILFAST (1 << __REQ_FAILFAST)
244#define REQ_SORTED (1 << __REQ_SORTED)
245#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
246#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
247#define REQ_FUA (1 << __REQ_FUA)
248#define REQ_CMD (1 << __REQ_CMD)
249#define REQ_NOMERGE (1 << __REQ_NOMERGE)
250#define REQ_STARTED (1 << __REQ_STARTED)
251#define REQ_DONTPREP (1 << __REQ_DONTPREP)
252#define REQ_QUEUED (1 << __REQ_QUEUED)
253#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
254#define REQ_PC (1 << __REQ_PC)
255#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
256#define REQ_SENSE (1 << __REQ_SENSE)
257#define REQ_FAILED (1 << __REQ_FAILED)
258#define REQ_QUIET (1 << __REQ_QUIET)
259#define REQ_SPECIAL (1 << __REQ_SPECIAL)
260#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
261#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
262#define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE)
263#define REQ_PREEMPT (1 << __REQ_PREEMPT)
264#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
265#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
266#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
267#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
268#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
269
270/*
271 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
272 * requests. Some step values could eventually be made generic. 320 * requests. Some step values could eventually be made generic.
273 */ 321 */
274struct request_pm_state 322struct request_pm_state
@@ -432,9 +480,6 @@ struct request_queue
432 struct mutex sysfs_lock; 480 struct mutex sysfs_lock;
433}; 481};
434 482
435#define RQ_INACTIVE (-1)
436#define RQ_ACTIVE 1
437
438#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
439#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 484#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
440#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ 485#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
@@ -490,25 +535,34 @@ enum {
490#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 535#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
491#define blk_queue_flushing(q) ((q)->ordseq) 536#define blk_queue_flushing(q) ((q)->ordseq)
492 537
493#define blk_fs_request(rq) ((rq)->flags & REQ_CMD) 538#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS)
494#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) 539#define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC)
495#define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST) 540#define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL)
496#define blk_rq_started(rq) ((rq)->flags & REQ_STARTED) 541#define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE)
542
543#define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST)
544#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
497 545
498#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) 546#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq))
499 547
500#define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND) 548#define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND)
501#define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME) 549#define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME)
502#define blk_pm_request(rq) \ 550#define blk_pm_request(rq) \
503 ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) 551 (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq))
504 552
505#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) 553#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
506#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) 554#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
507#define blk_fua_rq(rq) ((rq)->flags & REQ_FUA) 555#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
508 556
509#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 557#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
510 558
511#define rq_data_dir(rq) ((rq)->flags & 1) 559#define rq_data_dir(rq) ((rq)->cmd_flags & 1)
560
561/*
562 * We regard a request as sync, if it's a READ or a SYNC write.
563 */
564#define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC)
565#define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META)
512 566
513static inline int blk_queue_full(struct request_queue *q, int rw) 567static inline int blk_queue_full(struct request_queue *q, int rw)
514{ 568{
@@ -541,13 +595,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw)
541#define RQ_NOMERGE_FLAGS \ 595#define RQ_NOMERGE_FLAGS \
542 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) 596 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
543#define rq_mergeable(rq) \ 597#define rq_mergeable(rq) \
544 (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) 598 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq)))
545
546/*
547 * noop, requests are automagically marked as active/inactive by I/O
548 * scheduler -- see elv_next_request
549 */
550#define blk_queue_headactive(q, head_active)
551 599
552/* 600/*
553 * q->prep_rq_fn return values 601 * q->prep_rq_fn return values
@@ -586,11 +634,6 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio)
586 if ((rq->bio)) \ 634 if ((rq->bio)) \
587 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) 635 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
588 636
589struct sec_size {
590 unsigned block_size;
591 unsigned block_size_bits;
592};
593
594extern int blk_register_queue(struct gendisk *disk); 637extern int blk_register_queue(struct gendisk *disk);
595extern void blk_unregister_queue(struct gendisk *disk); 638extern void blk_unregister_queue(struct gendisk *disk);
596extern void register_disk(struct gendisk *dev); 639extern void register_disk(struct gendisk *dev);
@@ -612,6 +655,7 @@ extern void blk_stop_queue(request_queue_t *q);
612extern void blk_sync_queue(struct request_queue *q); 655extern void blk_sync_queue(struct request_queue *q);
613extern void __blk_stop_queue(request_queue_t *q); 656extern void __blk_stop_queue(request_queue_t *q);
614extern void blk_run_queue(request_queue_t *); 657extern void blk_run_queue(request_queue_t *);
658extern void blk_start_queueing(request_queue_t *);
615extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 659extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
616extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); 660extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
617extern int blk_rq_unmap_user(struct bio *, unsigned int); 661extern int blk_rq_unmap_user(struct bio *, unsigned int);
@@ -655,16 +699,6 @@ extern void end_that_request_last(struct request *, int);
655extern void end_request(struct request *req, int uptodate); 699extern void end_request(struct request *req, int uptodate);
656extern void blk_complete_request(struct request *); 700extern void blk_complete_request(struct request *);
657 701
658static inline int rq_all_done(struct request *rq, unsigned int nr_bytes)
659{
660 if (blk_fs_request(rq))
661 return (nr_bytes >= (rq->hard_nr_sectors << 9));
662 else if (blk_pc_request(rq))
663 return nr_bytes >= rq->data_len;
664
665 return 0;
666}
667
668/* 702/*
669 * end_that_request_first/chunk() takes an uptodate argument. we account 703 * end_that_request_first/chunk() takes an uptodate argument. we account
670 * any value <= as an io error. 0 means -EIO for compatability reasons, 704 * any value <= as an io error. 0 means -EIO for compatability reasons,
@@ -679,21 +713,6 @@ static inline void blkdev_dequeue_request(struct request *req)
679} 713}
680 714
681/* 715/*
682 * This should be in elevator.h, but that requires pulling in rq and q
683 */
684static inline void elv_dispatch_add_tail(struct request_queue *q,
685 struct request *rq)
686{
687 if (q->last_merge == rq)
688 q->last_merge = NULL;
689 q->nr_sorted--;
690
691 q->end_sector = rq_end_sector(rq);
692 q->boundary_rq = rq;
693 list_add_tail(&rq->queuelist, &q->queue_head);
694}
695
696/*
697 * Access functions for manipulating queue properties 716 * Access functions for manipulating queue properties
698 */ 717 */
699extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, 718extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn,
@@ -737,7 +756,7 @@ extern void blk_put_queue(request_queue_t *);
737 */ 756 */
738#define blk_queue_tag_depth(q) ((q)->queue_tags->busy) 757#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
739#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) 758#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
740#define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED) 759#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
741extern int blk_queue_start_tag(request_queue_t *, struct request *); 760extern int blk_queue_start_tag(request_queue_t *, struct request *);
742extern struct request *blk_queue_find_tag(request_queue_t *, int); 761extern struct request *blk_queue_find_tag(request_queue_t *, int);
743extern void blk_queue_end_tag(request_queue_t *, struct request *); 762extern void blk_queue_end_tag(request_queue_t *, struct request *);
@@ -787,14 +806,6 @@ static inline int queue_dma_alignment(request_queue_t *q)
787 return retval; 806 return retval;
788} 807}
789 808
790static inline int bdev_dma_aligment(struct block_device *bdev)
791{
792 return queue_dma_alignment(bdev_get_queue(bdev));
793}
794
795#define blk_finished_io(nsects) do { } while (0)
796#define blk_started_io(nsects) do { } while (0)
797
798/* assumes size > 256 */ 809/* assumes size > 256 */
799static inline unsigned int blksize_bits(unsigned int size) 810static inline unsigned int blksize_bits(unsigned int size)
800{ 811{
@@ -824,24 +835,32 @@ struct work_struct;
824int kblockd_schedule_work(struct work_struct *work); 835int kblockd_schedule_work(struct work_struct *work);
825void kblockd_flush(void); 836void kblockd_flush(void);
826 837
827#ifdef CONFIG_LBD
828# include <asm/div64.h>
829# define sector_div(a, b) do_div(a, b)
830#else
831# define sector_div(n, b)( \
832{ \
833 int _res; \
834 _res = (n) % (b); \
835 (n) /= (b); \
836 _res; \
837} \
838)
839#endif
840
841#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 838#define MODULE_ALIAS_BLOCKDEV(major,minor) \
842 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 839 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
843#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 840#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
844 MODULE_ALIAS("block-major-" __stringify(major) "-*") 841 MODULE_ALIAS("block-major-" __stringify(major) "-*")
845 842
846 843
844#else /* CONFIG_BLOCK */
845/*
846 * stubs for when the block layer is configured out
847 */
848#define buffer_heads_over_limit 0
849
850static inline long blk_congestion_wait(int rw, long timeout)
851{
852 return io_schedule_timeout(timeout);
853}
854
855static inline long nr_blockdev_pages(void)
856{
857 return 0;
858}
859
860static inline void exit_io_context(void)
861{
862}
863
864#endif /* CONFIG_BLOCK */
865
847#endif 866#endif
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 7520cc1ff9e2..b99a714fcac6 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -20,6 +20,7 @@ enum blktrace_cat {
20 BLK_TC_PC = 1 << 9, /* pc requests */ 20 BLK_TC_PC = 1 << 9, /* pc requests */
21 BLK_TC_NOTIFY = 1 << 10, /* special message */ 21 BLK_TC_NOTIFY = 1 << 10, /* special message */
22 BLK_TC_AHEAD = 1 << 11, /* readahead */ 22 BLK_TC_AHEAD = 1 << 11, /* readahead */
23 BLK_TC_META = 1 << 12, /* metadata */
23 24
24 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 25 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
25}; 26};
@@ -148,7 +149,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
148 u32 what) 149 u32 what)
149{ 150{
150 struct blk_trace *bt = q->blk_trace; 151 struct blk_trace *bt = q->blk_trace;
151 int rw = rq->flags & 0x03; 152 int rw = rq->cmd_flags & 0x03;
152 153
153 if (likely(!bt)) 154 if (likely(!bt))
154 return; 155 return;
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 737e407d0cd1..131ffd37e716 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -14,6 +14,8 @@
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <asm/atomic.h> 15#include <asm/atomic.h>
16 16
17#ifdef CONFIG_BLOCK
18
17enum bh_state_bits { 19enum bh_state_bits {
18 BH_Uptodate, /* Contains valid data */ 20 BH_Uptodate, /* Contains valid data */
19 BH_Dirty, /* Is dirty */ 21 BH_Dirty, /* Is dirty */
@@ -190,9 +192,7 @@ extern int buffer_heads_over_limit;
190 * Generic address_space_operations implementations for buffer_head-backed 192 * Generic address_space_operations implementations for buffer_head-backed
191 * address_spaces. 193 * address_spaces.
192 */ 194 */
193int try_to_release_page(struct page * page, gfp_t gfp_mask);
194void block_invalidatepage(struct page *page, unsigned long offset); 195void block_invalidatepage(struct page *page, unsigned long offset);
195void do_invalidatepage(struct page *page, unsigned long offset);
196int block_write_full_page(struct page *page, get_block_t *get_block, 196int block_write_full_page(struct page *page, get_block_t *get_block,
197 struct writeback_control *wbc); 197 struct writeback_control *wbc);
198int block_read_full_page(struct page*, get_block_t*); 198int block_read_full_page(struct page*, get_block_t*);
@@ -302,4 +302,19 @@ static inline void lock_buffer(struct buffer_head *bh)
302 __lock_buffer(bh); 302 __lock_buffer(bh);
303} 303}
304 304
305extern int __set_page_dirty_buffers(struct page *page);
306
307#else /* CONFIG_BLOCK */
308
309static inline void buffer_init(void) {}
310static inline int try_to_free_buffers(struct page *page) { return 1; }
311static inline int sync_blockdev(struct block_device *bdev) { return 0; }
312static inline int inode_has_buffers(struct inode *inode) { return 0; }
313static inline void invalidate_inode_buffers(struct inode *inode) {}
314static inline int remove_inode_buffers(struct inode *inode) { return 1; }
315static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
316static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {}
317
318
319#endif /* CONFIG_BLOCK */
305#endif /* _LINUX_BUFFER_HEAD_H */ 320#endif /* _LINUX_BUFFER_HEAD_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index bea0255196c4..d61ef5951538 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -90,6 +90,7 @@ COMPATIBLE_IOCTL(FDTWADDLE)
90COMPATIBLE_IOCTL(FDFMTTRK) 90COMPATIBLE_IOCTL(FDFMTTRK)
91COMPATIBLE_IOCTL(FDRAWCMD) 91COMPATIBLE_IOCTL(FDRAWCMD)
92/* 0x12 */ 92/* 0x12 */
93#ifdef CONFIG_BLOCK
93COMPATIBLE_IOCTL(BLKRASET) 94COMPATIBLE_IOCTL(BLKRASET)
94COMPATIBLE_IOCTL(BLKROSET) 95COMPATIBLE_IOCTL(BLKROSET)
95COMPATIBLE_IOCTL(BLKROGET) 96COMPATIBLE_IOCTL(BLKROGET)
@@ -103,6 +104,7 @@ COMPATIBLE_IOCTL(BLKTRACESETUP)
103COMPATIBLE_IOCTL(BLKTRACETEARDOWN) 104COMPATIBLE_IOCTL(BLKTRACETEARDOWN)
104ULONG_IOCTL(BLKRASET) 105ULONG_IOCTL(BLKRASET)
105ULONG_IOCTL(BLKFRASET) 106ULONG_IOCTL(BLKFRASET)
107#endif
106/* RAID */ 108/* RAID */
107COMPATIBLE_IOCTL(RAID_VERSION) 109COMPATIBLE_IOCTL(RAID_VERSION)
108COMPATIBLE_IOCTL(GET_ARRAY_INFO) 110COMPATIBLE_IOCTL(GET_ARRAY_INFO)
@@ -395,12 +397,6 @@ COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
395COMPATIBLE_IOCTL(DVD_AUTH) 397COMPATIBLE_IOCTL(DVD_AUTH)
396/* pktcdvd */ 398/* pktcdvd */
397COMPATIBLE_IOCTL(PACKET_CTRL_CMD) 399COMPATIBLE_IOCTL(PACKET_CTRL_CMD)
398/* Big L */
399ULONG_IOCTL(LOOP_SET_FD)
400ULONG_IOCTL(LOOP_CHANGE_FD)
401COMPATIBLE_IOCTL(LOOP_CLR_FD)
402COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
403COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
404/* Big A */ 400/* Big A */
405/* sparc only */ 401/* sparc only */
406/* Big Q for sound/OSS */ 402/* Big Q for sound/OSS */
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 1713ace808bf..b3370ef5164d 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -1,12 +1,16 @@
1#ifndef _LINUX_ELEVATOR_H 1#ifndef _LINUX_ELEVATOR_H
2#define _LINUX_ELEVATOR_H 2#define _LINUX_ELEVATOR_H
3 3
4#include <linux/percpu.h>
5
6#ifdef CONFIG_BLOCK
7
4typedef int (elevator_merge_fn) (request_queue_t *, struct request **, 8typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
5 struct bio *); 9 struct bio *);
6 10
7typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); 11typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
8 12
9typedef void (elevator_merged_fn) (request_queue_t *, struct request *); 13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int);
10 14
11typedef int (elevator_dispatch_fn) (request_queue_t *, int); 15typedef int (elevator_dispatch_fn) (request_queue_t *, int);
12 16
@@ -14,9 +18,9 @@ typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
14typedef int (elevator_queue_empty_fn) (request_queue_t *); 18typedef int (elevator_queue_empty_fn) (request_queue_t *);
15typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 19typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
16typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 20typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
17typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); 21typedef int (elevator_may_queue_fn) (request_queue_t *, int);
18 22
19typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); 23typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t);
20typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 24typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 25typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 26typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
@@ -82,19 +86,21 @@ struct elevator_queue
82 struct kobject kobj; 86 struct kobject kobj;
83 struct elevator_type *elevator_type; 87 struct elevator_type *elevator_type;
84 struct mutex sysfs_lock; 88 struct mutex sysfs_lock;
89 struct hlist_head *hash;
85}; 90};
86 91
87/* 92/*
88 * block elevator interface 93 * block elevator interface
89 */ 94 */
90extern void elv_dispatch_sort(request_queue_t *, struct request *); 95extern void elv_dispatch_sort(request_queue_t *, struct request *);
96extern void elv_dispatch_add_tail(request_queue_t *, struct request *);
91extern void elv_add_request(request_queue_t *, struct request *, int, int); 97extern void elv_add_request(request_queue_t *, struct request *, int, int);
92extern void __elv_add_request(request_queue_t *, struct request *, int, int); 98extern void __elv_add_request(request_queue_t *, struct request *, int, int);
93extern void elv_insert(request_queue_t *, struct request *, int); 99extern void elv_insert(request_queue_t *, struct request *, int);
94extern int elv_merge(request_queue_t *, struct request **, struct bio *); 100extern int elv_merge(request_queue_t *, struct request **, struct bio *);
95extern void elv_merge_requests(request_queue_t *, struct request *, 101extern void elv_merge_requests(request_queue_t *, struct request *,
96 struct request *); 102 struct request *);
97extern void elv_merged_request(request_queue_t *, struct request *); 103extern void elv_merged_request(request_queue_t *, struct request *, int);
98extern void elv_dequeue_request(request_queue_t *, struct request *); 104extern void elv_dequeue_request(request_queue_t *, struct request *);
99extern void elv_requeue_request(request_queue_t *, struct request *); 105extern void elv_requeue_request(request_queue_t *, struct request *);
100extern int elv_queue_empty(request_queue_t *); 106extern int elv_queue_empty(request_queue_t *);
@@ -103,9 +109,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *);
103extern struct request *elv_latter_request(request_queue_t *, struct request *); 109extern struct request *elv_latter_request(request_queue_t *, struct request *);
104extern int elv_register_queue(request_queue_t *q); 110extern int elv_register_queue(request_queue_t *q);
105extern void elv_unregister_queue(request_queue_t *q); 111extern void elv_unregister_queue(request_queue_t *q);
106extern int elv_may_queue(request_queue_t *, int, struct bio *); 112extern int elv_may_queue(request_queue_t *, int);
107extern void elv_completed_request(request_queue_t *, struct request *); 113extern void elv_completed_request(request_queue_t *, struct request *);
108extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); 114extern int elv_set_request(request_queue_t *, struct request *, gfp_t);
109extern void elv_put_request(request_queue_t *, struct request *); 115extern void elv_put_request(request_queue_t *, struct request *);
110 116
111/* 117/*
@@ -125,6 +131,19 @@ extern void elevator_exit(elevator_t *);
125extern int elv_rq_merge_ok(struct request *, struct bio *); 131extern int elv_rq_merge_ok(struct request *, struct bio *);
126 132
127/* 133/*
134 * Helper functions.
135 */
136extern struct request *elv_rb_former_request(request_queue_t *, struct request *);
137extern struct request *elv_rb_latter_request(request_queue_t *, struct request *);
138
139/*
140 * rb support functions.
141 */
142extern struct request *elv_rb_add(struct rb_root *, struct request *);
143extern void elv_rb_del(struct rb_root *, struct request *);
144extern struct request *elv_rb_find(struct rb_root *, sector_t);
145
146/*
128 * Return values from elevator merger 147 * Return values from elevator merger
129 */ 148 */
130#define ELEVATOR_NO_MERGE 0 149#define ELEVATOR_NO_MERGE 0
@@ -149,5 +168,42 @@ enum {
149}; 168};
150 169
151#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) 170#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
171#define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
172
173/*
174 * Hack to reuse the donelist list_head as the fifo time holder while
175 * the request is in the io scheduler. Saves an unsigned long in rq.
176 */
177#define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next)
178#define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp))
179#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
180#define rq_fifo_clear(rq) do { \
181 list_del_init(&(rq)->queuelist); \
182 INIT_LIST_HEAD(&(rq)->donelist); \
183 } while (0)
152 184
185/*
186 * io context count accounting
187 */
188#define elv_ioc_count_mod(name, __val) \
189 do { \
190 preempt_disable(); \
191 __get_cpu_var(name) += (__val); \
192 preempt_enable(); \
193 } while (0)
194
195#define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1)
196#define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1)
197
198#define elv_ioc_count_read(name) \
199({ \
200 unsigned long __val = 0; \
201 int __cpu; \
202 smp_wmb(); \
203 for_each_possible_cpu(__cpu) \
204 __val += per_cpu(name, __cpu); \
205 __val; \
206})
207
208#endif /* CONFIG_BLOCK */
153#endif 209#endif
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 33a1aa107329..153d755376a4 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -165,41 +165,49 @@ struct ext2_group_desc
165#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) 165#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
166 166
167/* 167/*
168 * Inode flags 168 * Inode flags (GETFLAGS/SETFLAGS)
169 */ 169 */
170#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ 170#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */
171#define EXT2_UNRM_FL 0x00000002 /* Undelete */ 171#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */
172#define EXT2_COMPR_FL 0x00000004 /* Compress file */ 172#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */
173#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ 173#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */
174#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ 174#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */
175#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ 175#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */
176#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ 176#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */
177#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ 177#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */
178/* Reserved for compression usage... */ 178/* Reserved for compression usage... */
179#define EXT2_DIRTY_FL 0x00000100 179#define EXT2_DIRTY_FL FS_DIRTY_FL
180#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ 180#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */
181#define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ 181#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */
182#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ 182#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */
183/* End compression flags --- maybe not all used */ 183/* End compression flags --- maybe not all used */
184#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ 184#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */
185#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ 185#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
186#define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ 186#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */
187#define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ 187#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */
188#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ 188#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
189#define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ 189#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
190#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ 190#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
191#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ 191#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */
192 192
193#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ 193#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
194#define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ 194#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
195 195
196/* 196/*
197 * ioctl commands 197 * ioctl commands
198 */ 198 */
199#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) 199#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS
200#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) 200#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS
201#define EXT2_IOC_GETVERSION _IOR('v', 1, long) 201#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION
202#define EXT2_IOC_SETVERSION _IOW('v', 2, long) 202#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION
203
204/*
205 * ioctl commands in 32 bit emulation
206 */
207#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
208#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
209#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION
210#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION
203 211
204/* 212/*
205 * Structure of an inode on the disk 213 * Structure of an inode on the disk
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index cc08f56750da..11cca1bdc0c7 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -216,14 +216,14 @@ struct ext3_new_group_data {
216/* 216/*
217 * ioctl commands 217 * ioctl commands
218 */ 218 */
219#define EXT3_IOC_GETFLAGS _IOR('f', 1, long) 219#define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS
220#define EXT3_IOC_SETFLAGS _IOW('f', 2, long) 220#define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS
221#define EXT3_IOC_GETVERSION _IOR('f', 3, long) 221#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
222#define EXT3_IOC_SETVERSION _IOW('f', 4, long) 222#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
223#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) 223#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
224#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) 224#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
225#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long) 225#define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION
226#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long) 226#define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION
227#ifdef CONFIG_JBD_DEBUG 227#ifdef CONFIG_JBD_DEBUG
228#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) 228#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
229#endif 229#endif
@@ -231,6 +231,23 @@ struct ext3_new_group_data {
231#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) 231#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
232 232
233/* 233/*
234 * ioctl commands in 32 bit emulation
235 */
236#define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS
237#define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS
238#define EXT3_IOC32_GETVERSION _IOR('f', 3, int)
239#define EXT3_IOC32_SETVERSION _IOW('f', 4, int)
240#define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int)
241#define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int)
242#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
243#ifdef CONFIG_JBD_DEBUG
244#define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
245#endif
246#define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
247#define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
248
249
250/*
234 * Mount options 251 * Mount options
235 */ 252 */
236struct ext3_mount_options { 253struct ext3_mount_options {
@@ -812,6 +829,7 @@ extern void ext3_set_aops(struct inode *inode);
812/* ioctl.c */ 829/* ioctl.c */
813extern int ext3_ioctl (struct inode *, struct file *, unsigned int, 830extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
814 unsigned long); 831 unsigned long);
832extern long ext3_compat_ioctl (struct file *, unsigned int, unsigned long);
815 833
816/* namei.c */ 834/* namei.c */
817extern int ext3_orphan_add(handle_t *, struct inode *); 835extern int ext3_orphan_add(handle_t *, struct inode *);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6eafbe309483..5baf3a153403 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -79,8 +79,8 @@ extern int dir_notify_enable;
79#define WRITE 1 79#define WRITE 1
80#define READA 2 /* read-ahead - don't block if no resources */ 80#define READA 2 /* read-ahead - don't block if no resources */
81#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ 81#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
82#define SPECIAL 4 /* For non-blockdevice requests in request queue */
83#define READ_SYNC (READ | (1 << BIO_RW_SYNC)) 82#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
83#define READ_META (READ | (1 << BIO_RW_META))
84#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) 84#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
85#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) 85#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
86 86
@@ -217,6 +217,45 @@ extern int dir_notify_enable;
217#define FIBMAP _IO(0x00,1) /* bmap access */ 217#define FIBMAP _IO(0x00,1) /* bmap access */
218#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 218#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
219 219
220#define FS_IOC_GETFLAGS _IOR('f', 1, long)
221#define FS_IOC_SETFLAGS _IOW('f', 2, long)
222#define FS_IOC_GETVERSION _IOR('v', 1, long)
223#define FS_IOC_SETVERSION _IOW('v', 2, long)
224#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
225#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
226#define FS_IOC32_GETVERSION _IOR('v', 1, int)
227#define FS_IOC32_SETVERSION _IOW('v', 2, int)
228
229/*
230 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
231 */
232#define FS_SECRM_FL 0x00000001 /* Secure deletion */
233#define FS_UNRM_FL 0x00000002 /* Undelete */
234#define FS_COMPR_FL 0x00000004 /* Compress file */
235#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
236#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
237#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
238#define FS_NODUMP_FL 0x00000040 /* do not dump file */
239#define FS_NOATIME_FL 0x00000080 /* do not update atime */
240/* Reserved for compression usage... */
241#define FS_DIRTY_FL 0x00000100
242#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
243#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
244#define FS_ECOMPR_FL 0x00000800 /* Compression error */
245/* End compression flags --- maybe not all used */
246#define FS_BTREE_FL 0x00001000 /* btree format dir */
247#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
248#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
249#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
250#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
251#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
252#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
253#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
254
255#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
256#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
257
258
220#define SYNC_FILE_RANGE_WAIT_BEFORE 1 259#define SYNC_FILE_RANGE_WAIT_BEFORE 1
221#define SYNC_FILE_RANGE_WRITE 2 260#define SYNC_FILE_RANGE_WRITE 2
222#define SYNC_FILE_RANGE_WAIT_AFTER 4 261#define SYNC_FILE_RANGE_WAIT_AFTER 4
@@ -1443,6 +1482,7 @@ extern void __init vfs_caches_init(unsigned long);
1443extern void putname(const char *name); 1482extern void putname(const char *name);
1444#endif 1483#endif
1445 1484
1485#ifdef CONFIG_BLOCK
1446extern int register_blkdev(unsigned int, const char *); 1486extern int register_blkdev(unsigned int, const char *);
1447extern int unregister_blkdev(unsigned int, const char *); 1487extern int unregister_blkdev(unsigned int, const char *);
1448extern struct block_device *bdget(dev_t); 1488extern struct block_device *bdget(dev_t);
@@ -1451,11 +1491,15 @@ extern void bd_forget(struct inode *inode);
1451extern void bdput(struct block_device *); 1491extern void bdput(struct block_device *);
1452extern struct block_device *open_by_devnum(dev_t, unsigned); 1492extern struct block_device *open_by_devnum(dev_t, unsigned);
1453extern struct block_device *open_partition_by_devnum(dev_t, unsigned); 1493extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
1454extern const struct file_operations def_blk_fops;
1455extern const struct address_space_operations def_blk_aops; 1494extern const struct address_space_operations def_blk_aops;
1495#else
1496static inline void bd_forget(struct inode *inode) {}
1497#endif
1498extern const struct file_operations def_blk_fops;
1456extern const struct file_operations def_chr_fops; 1499extern const struct file_operations def_chr_fops;
1457extern const struct file_operations bad_sock_fops; 1500extern const struct file_operations bad_sock_fops;
1458extern const struct file_operations def_fifo_fops; 1501extern const struct file_operations def_fifo_fops;
1502#ifdef CONFIG_BLOCK
1459extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1503extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1460extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1504extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1461extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1505extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1471,6 +1515,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1471#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) 1515#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder)
1472#define bd_release_from_disk(bdev, disk) bd_release(bdev) 1516#define bd_release_from_disk(bdev, disk) bd_release(bdev)
1473#endif 1517#endif
1518#endif
1474 1519
1475/* fs/char_dev.c */ 1520/* fs/char_dev.c */
1476#define CHRDEV_MAJOR_HASH_SIZE 255 1521#define CHRDEV_MAJOR_HASH_SIZE 255
@@ -1484,14 +1529,19 @@ extern int chrdev_open(struct inode *, struct file *);
1484extern void chrdev_show(struct seq_file *,off_t); 1529extern void chrdev_show(struct seq_file *,off_t);
1485 1530
1486/* fs/block_dev.c */ 1531/* fs/block_dev.c */
1487#define BLKDEV_MAJOR_HASH_SIZE 255
1488#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 1532#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
1533
1534#ifdef CONFIG_BLOCK
1535#define BLKDEV_MAJOR_HASH_SIZE 255
1489extern const char *__bdevname(dev_t, char *buffer); 1536extern const char *__bdevname(dev_t, char *buffer);
1490extern const char *bdevname(struct block_device *bdev, char *buffer); 1537extern const char *bdevname(struct block_device *bdev, char *buffer);
1491extern struct block_device *lookup_bdev(const char *); 1538extern struct block_device *lookup_bdev(const char *);
1492extern struct block_device *open_bdev_excl(const char *, int, void *); 1539extern struct block_device *open_bdev_excl(const char *, int, void *);
1493extern void close_bdev_excl(struct block_device *); 1540extern void close_bdev_excl(struct block_device *);
1494extern void blkdev_show(struct seq_file *,off_t); 1541extern void blkdev_show(struct seq_file *,off_t);
1542#else
1543#define BLKDEV_MAJOR_HASH_SIZE 0
1544#endif
1495 1545
1496extern void init_special_inode(struct inode *, umode_t, dev_t); 1546extern void init_special_inode(struct inode *, umode_t, dev_t);
1497 1547
@@ -1505,6 +1555,7 @@ extern const struct file_operations rdwr_fifo_fops;
1505 1555
1506extern int fs_may_remount_ro(struct super_block *); 1556extern int fs_may_remount_ro(struct super_block *);
1507 1557
1558#ifdef CONFIG_BLOCK
1508/* 1559/*
1509 * return READ, READA, or WRITE 1560 * return READ, READA, or WRITE
1510 */ 1561 */
@@ -1516,9 +1567,10 @@ extern int fs_may_remount_ro(struct super_block *);
1516#define bio_data_dir(bio) ((bio)->bi_rw & 1) 1567#define bio_data_dir(bio) ((bio)->bi_rw & 1)
1517 1568
1518extern int check_disk_change(struct block_device *); 1569extern int check_disk_change(struct block_device *);
1519extern int invalidate_inodes(struct super_block *);
1520extern int __invalidate_device(struct block_device *); 1570extern int __invalidate_device(struct block_device *);
1521extern int invalidate_partition(struct gendisk *, int); 1571extern int invalidate_partition(struct gendisk *, int);
1572#endif
1573extern int invalidate_inodes(struct super_block *);
1522unsigned long invalidate_mapping_pages(struct address_space *mapping, 1574unsigned long invalidate_mapping_pages(struct address_space *mapping,
1523 pgoff_t start, pgoff_t end); 1575 pgoff_t start, pgoff_t end);
1524unsigned long invalidate_inode_pages(struct address_space *mapping); 1576unsigned long invalidate_inode_pages(struct address_space *mapping);
@@ -1546,11 +1598,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
1546extern long do_fsync(struct file *file, int datasync); 1598extern long do_fsync(struct file *file, int datasync);
1547extern void sync_supers(void); 1599extern void sync_supers(void);
1548extern void sync_filesystems(int wait); 1600extern void sync_filesystems(int wait);
1601extern void __fsync_super(struct super_block *sb);
1549extern void emergency_sync(void); 1602extern void emergency_sync(void);
1550extern void emergency_remount(void); 1603extern void emergency_remount(void);
1551extern int do_remount_sb(struct super_block *sb, int flags, 1604extern int do_remount_sb(struct super_block *sb, int flags,
1552 void *data, int force); 1605 void *data, int force);
1606#ifdef CONFIG_BLOCK
1553extern sector_t bmap(struct inode *, sector_t); 1607extern sector_t bmap(struct inode *, sector_t);
1608#endif
1554extern int notify_change(struct dentry *, struct iattr *); 1609extern int notify_change(struct dentry *, struct iattr *);
1555extern int permission(struct inode *, int, struct nameidata *); 1610extern int permission(struct inode *, int, struct nameidata *);
1556extern int generic_permission(struct inode *, int, 1611extern int generic_permission(struct inode *, int,
@@ -1633,9 +1688,11 @@ static inline void insert_inode_hash(struct inode *inode) {
1633extern struct file * get_empty_filp(void); 1688extern struct file * get_empty_filp(void);
1634extern void file_move(struct file *f, struct list_head *list); 1689extern void file_move(struct file *f, struct list_head *list);
1635extern void file_kill(struct file *f); 1690extern void file_kill(struct file *f);
1691#ifdef CONFIG_BLOCK
1636struct bio; 1692struct bio;
1637extern void submit_bio(int, struct bio *); 1693extern void submit_bio(int, struct bio *);
1638extern int bdev_read_only(struct block_device *); 1694extern int bdev_read_only(struct block_device *);
1695#endif
1639extern int set_blocksize(struct block_device *, int); 1696extern int set_blocksize(struct block_device *, int);
1640extern int sb_set_blocksize(struct super_block *, int); 1697extern int sb_set_blocksize(struct super_block *, int);
1641extern int sb_min_blocksize(struct super_block *, int); 1698extern int sb_min_blocksize(struct super_block *, int);
@@ -1716,6 +1773,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1716 actor); 1773 actor);
1717} 1774}
1718 1775
1776#ifdef CONFIG_BLOCK
1719ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1777ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1720 struct block_device *bdev, const struct iovec *iov, loff_t offset, 1778 struct block_device *bdev, const struct iovec *iov, loff_t offset,
1721 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, 1779 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
@@ -1753,6 +1811,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
1753 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1811 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1754 nr_segs, get_block, end_io, DIO_OWN_LOCKING); 1812 nr_segs, get_block, end_io, DIO_OWN_LOCKING);
1755} 1813}
1814#endif
1756 1815
1757extern const struct file_operations generic_ro_fops; 1816extern const struct file_operations generic_ro_fops;
1758 1817
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index e4af57e87c17..41f276fdd185 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -11,6 +11,8 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14#ifdef CONFIG_BLOCK
15
14enum { 16enum {
15/* These three have identical behaviour; use the second one if DOS FDISK gets 17/* These three have identical behaviour; use the second one if DOS FDISK gets
16 confused about extended/logical partitions starting past cylinder 1023. */ 18 confused about extended/logical partitions starting past cylinder 1023. */
@@ -420,3 +422,5 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index)
420#endif 422#endif
421 423
422#endif 424#endif
425
426#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7b703b6d4358..4edf1934e5ca 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -743,7 +743,9 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long
743 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 743 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
744void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); 744void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long);
745 745
746int __set_page_dirty_buffers(struct page *page); 746extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
747extern void do_invalidatepage(struct page *page, unsigned long offset);
748
747int __set_page_dirty_nobuffers(struct page *page); 749int __set_page_dirty_nobuffers(struct page *page);
748int redirty_page_for_writepage(struct writeback_control *wbc, 750int redirty_page_for_writepage(struct writeback_control *wbc,
749 struct page *page); 751 struct page *page);
diff --git a/include/linux/mpage.h b/include/linux/mpage.h
index 3ca880463c47..cc5fb75af78a 100644
--- a/include/linux/mpage.h
+++ b/include/linux/mpage.h
@@ -9,6 +9,7 @@
9 * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do 9 * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do
10 * nested includes. Get it right in the .c file). 10 * nested includes. Get it right in the .c file).
11 */ 11 */
12#ifdef CONFIG_BLOCK
12 13
13struct writeback_control; 14struct writeback_control;
14typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); 15typedef int (writepage_t)(struct page *page, struct writeback_control *wbc);
@@ -21,8 +22,4 @@ int mpage_writepages(struct address_space *mapping,
21int mpage_writepage(struct page *page, get_block_t *get_block, 22int mpage_writepage(struct page *page, get_block_t *get_block,
22 struct writeback_control *wbc); 23 struct writeback_control *wbc);
23 24
24static inline int 25#endif
25generic_writepages(struct address_space *mapping, struct writeback_control *wbc)
26{
27 return mpage_writepages(mapping, wbc, NULL);
28}
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index eb3e547c8fee..c588709acbbc 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -53,6 +53,8 @@
53#include <linux/raid/md_u.h> 53#include <linux/raid/md_u.h>
54#include <linux/raid/md_k.h> 54#include <linux/raid/md_k.h>
55 55
56#ifdef CONFIG_MD
57
56/* 58/*
57 * Different major versions are not compatible. 59 * Different major versions are not compatible.
58 * Different minor versions are only downward compatible. 60 * Different minor versions are only downward compatible.
@@ -95,5 +97,6 @@ extern void md_new_event(mddev_t *mddev);
95 97
96extern void md_update_sb(mddev_t * mddev); 98extern void md_update_sb(mddev_t * mddev);
97 99
100#endif /* CONFIG_MD */
98#endif 101#endif
99 102
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index d28890295852..920b94fe31fa 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -18,6 +18,8 @@
18/* and dm-bio-list.h is not under include/linux because.... ??? */ 18/* and dm-bio-list.h is not under include/linux because.... ??? */
19#include "../../../drivers/md/dm-bio-list.h" 19#include "../../../drivers/md/dm-bio-list.h"
20 20
21#ifdef CONFIG_BLOCK
22
21#define LEVEL_MULTIPATH (-4) 23#define LEVEL_MULTIPATH (-4)
22#define LEVEL_LINEAR (-1) 24#define LEVEL_LINEAR (-1)
23#define LEVEL_FAULTY (-5) 25#define LEVEL_FAULTY (-5)
@@ -362,5 +364,6 @@ static inline void safe_put_page(struct page *p)
362 if (p) put_page(p); 364 if (p) put_page(p);
363} 365}
364 366
367#endif /* CONFIG_BLOCK */
365#endif 368#endif
366 369
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 00b340ba6612..b160fb18e8d6 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
17 17
18extern const struct file_operations ramfs_file_operations; 18extern const struct file_operations ramfs_file_operations;
19extern struct vm_operations_struct generic_file_vm_ops; 19extern struct vm_operations_struct generic_file_vm_ops;
20extern int __init init_rootfs(void);
20 21
21#endif 22#endif
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 8d5382e62c08..344bc3495ddb 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -133,7 +133,7 @@ static inline void rb_set_color(struct rb_node *rb, int color)
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 134
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) 135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
136#define RB_EMPTY_NODE(node) (rb_parent(node) != node) 136#define RB_EMPTY_NODE(node) (rb_parent(node) == node)
137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) 137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
138 138
139extern void rb_insert_color(struct rb_node *, struct rb_root *); 139extern void rb_insert_color(struct rb_node *, struct rb_root *);
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 28493ffaafe7..9c63abffd7b2 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -807,21 +807,19 @@ struct stat_data_v1 {
807#define set_sd_v1_first_direct_byte(sdp,v) \ 807#define set_sd_v1_first_direct_byte(sdp,v) \
808 ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) 808 ((sdp)->sd_first_direct_byte = cpu_to_le32(v))
809 809
810#include <linux/ext2_fs.h>
811
812/* inode flags stored in sd_attrs (nee sd_reserved) */ 810/* inode flags stored in sd_attrs (nee sd_reserved) */
813 811
814/* we want common flags to have the same values as in ext2, 812/* we want common flags to have the same values as in ext2,
815 so chattr(1) will work without problems */ 813 so chattr(1) will work without problems */
816#define REISERFS_IMMUTABLE_FL EXT2_IMMUTABLE_FL 814#define REISERFS_IMMUTABLE_FL FS_IMMUTABLE_FL
817#define REISERFS_APPEND_FL EXT2_APPEND_FL 815#define REISERFS_APPEND_FL FS_APPEND_FL
818#define REISERFS_SYNC_FL EXT2_SYNC_FL 816#define REISERFS_SYNC_FL FS_SYNC_FL
819#define REISERFS_NOATIME_FL EXT2_NOATIME_FL 817#define REISERFS_NOATIME_FL FS_NOATIME_FL
820#define REISERFS_NODUMP_FL EXT2_NODUMP_FL 818#define REISERFS_NODUMP_FL FS_NODUMP_FL
821#define REISERFS_SECRM_FL EXT2_SECRM_FL 819#define REISERFS_SECRM_FL FS_SECRM_FL
822#define REISERFS_UNRM_FL EXT2_UNRM_FL 820#define REISERFS_UNRM_FL FS_UNRM_FL
823#define REISERFS_COMPR_FL EXT2_COMPR_FL 821#define REISERFS_COMPR_FL FS_COMPR_FL
824#define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL 822#define REISERFS_NOTAIL_FL FS_NOTAIL_FL
825 823
826/* persistent flags that file inherits from the parent directory */ 824/* persistent flags that file inherits from the parent directory */
827#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ 825#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \
@@ -2163,15 +2161,24 @@ __u32 r5_hash(const signed char *msg, int len);
2163/* prototypes from ioctl.c */ 2161/* prototypes from ioctl.c */
2164int reiserfs_ioctl(struct inode *inode, struct file *filp, 2162int reiserfs_ioctl(struct inode *inode, struct file *filp,
2165 unsigned int cmd, unsigned long arg); 2163 unsigned int cmd, unsigned long arg);
2164long reiserfs_compat_ioctl(struct file *filp,
2165 unsigned int cmd, unsigned long arg);
2166 2166
2167/* ioctl's command */ 2167/* ioctl's command */
2168#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) 2168#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
2169/* define following flags to be the same as in ext2, so that chattr(1), 2169/* define following flags to be the same as in ext2, so that chattr(1),
2170 lsattr(1) will work with us. */ 2170 lsattr(1) will work with us. */
2171#define REISERFS_IOC_GETFLAGS EXT2_IOC_GETFLAGS 2171#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
2172#define REISERFS_IOC_SETFLAGS EXT2_IOC_SETFLAGS 2172#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
2173#define REISERFS_IOC_GETVERSION EXT2_IOC_GETVERSION 2173#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
2174#define REISERFS_IOC_SETVERSION EXT2_IOC_SETVERSION 2174#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
2175
2176/* the 32 bit compat definitions with int argument */
2177#define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int)
2178#define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
2179#define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
2180#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION
2181#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION
2175 2182
2176/* Locking primitives */ 2183/* Locking primitives */
2177/* Right now we are still falling back to (un)lock_kernel, but eventually that 2184/* Right now we are still falling back to (un)lock_kernel, but eventually that
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a06fc89cf6e5..fc4a9873ec10 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -710,7 +710,6 @@ extern unsigned int max_cache_size;
710 710
711 711
712struct io_context; /* See blkdev.h */ 712struct io_context; /* See blkdev.h */
713void exit_io_context(void);
714struct cpuset; 713struct cpuset;
715 714
716#define NGROUPS_SMALL 32 715#define NGROUPS_SMALL 32
diff --git a/include/linux/tty.h b/include/linux/tty.h
index ea4c2605f8da..44091c0db0b4 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -307,6 +307,9 @@ extern void tty_ldisc_put(int);
307extern void tty_wakeup(struct tty_struct *tty); 307extern void tty_wakeup(struct tty_struct *tty);
308extern void tty_ldisc_flush(struct tty_struct *tty); 308extern void tty_ldisc_flush(struct tty_struct *tty);
309 309
310extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
311 unsigned long arg);
312
310extern struct mutex tty_mutex; 313extern struct mutex tty_mutex;
311 314
312/* n_tty.c */ 315/* n_tty.c */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 9d4074ecd0cd..4f4d98addb44 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -111,6 +111,8 @@ balance_dirty_pages_ratelimited(struct address_space *mapping)
111} 111}
112 112
113int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); 113int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
114extern int generic_writepages(struct address_space *mapping,
115 struct writeback_control *wbc);
114int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 116int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
115int sync_page_range(struct inode *inode, struct address_space *mapping, 117int sync_page_range(struct inode *inode, struct address_space *mapping,
116 loff_t pos, loff_t count); 118 loff_t pos, loff_t count);
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index d04d05adfa9b..c247a28259bc 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -6,7 +6,6 @@
6#include <scsi/scsi_device.h> 6#include <scsi/scsi_device.h>
7#include <scsi/scsi_host.h> 7#include <scsi/scsi_host.h>
8 8
9
10#define MSG_SIMPLE_TAG 0x20 9#define MSG_SIMPLE_TAG 0x20
11#define MSG_HEAD_TAG 0x21 10#define MSG_HEAD_TAG 0x21
12#define MSG_ORDERED_TAG 0x22 11#define MSG_ORDERED_TAG 0x22
@@ -14,6 +13,7 @@
14#define SCSI_NO_TAG (-1) /* identify no tag in use */ 13#define SCSI_NO_TAG (-1) /* identify no tag in use */
15 14
16 15
16#ifdef CONFIG_BLOCK
17 17
18/** 18/**
19 * scsi_get_tag_type - get the type of tag the device supports 19 * scsi_get_tag_type - get the type of tag the device supports
@@ -100,7 +100,7 @@ static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg)
100 struct scsi_device *sdev = cmd->device; 100 struct scsi_device *sdev = cmd->device;
101 101
102 if (blk_rq_tagged(req)) { 102 if (blk_rq_tagged(req)) {
103 if (sdev->ordered_tags && req->flags & REQ_HARDBARRIER) 103 if (sdev->ordered_tags && req->cmd_flags & REQ_HARDBARRIER)
104 *msg++ = MSG_ORDERED_TAG; 104 *msg++ = MSG_ORDERED_TAG;
105 else 105 else
106 *msg++ = MSG_SIMPLE_TAG; 106 *msg++ = MSG_SIMPLE_TAG;
@@ -144,4 +144,5 @@ static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth)
144 return shost->bqt ? 0 : -ENOMEM; 144 return shost->bqt ? 0 : -ENOMEM;
145} 145}
146 146
147#endif /* CONFIG_BLOCK */
147#endif /* _SCSI_SCSI_TCQ_H */ 148#endif /* _SCSI_SCSI_TCQ_H */