projects/linux·commit 56f29d7f

Merge branch 'block' of git://brick.kernel.dk/data/git/linux-2.6-block

56f29d7f · Linus Torvalds <[email protected]> · 2006-09-30 12:07:01 -07:00

* '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 [email protected] 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]
  ...
Commit
56f29d7fe452890eeeb7f2b0138b2d95b9745fb6
Parents
e823aff2 · 059af497

Merge commit. Changes below are compared with the first parent: e823aff2.

Changes

147 files changed · +2841 −2884

FileStatusAddDelContent
MAINTAINERSmodified+4−4View file
arch/mips/kernel/signal_n32.cmodified+2−2View file
arch/um/drivers/ubd_kern.cmodified+0−2View file
block/Kconfigmodified+20−0View file
block/Kconfig.ioschedmodified+3−0View file
block/Makefilemodified+1−1View file
block/as-iosched.cmodified+161−511View file
block/blktrace.cmodified+9−17View file
block/cfq-iosched.cmodified+281−584View file
block/deadline-iosched.cmodified+74−390View file
block/elevator.cmodified+263−52View file
block/ll_rw_blk.cmodified+103−133View file
block/noop-iosched.cmodified+1−1View file
block/scsi_ioctl.cmodified+3−3View file
drivers/block/DAC960.cmodified+1−1View file
drivers/block/Kconfigmodified+4−0View file
drivers/block/cciss.cmodified+0−1View file
drivers/block/cpqarray.cmodified+0−1View file
drivers/block/floppy.cmodified+2−2View file
drivers/block/loop.cmodified+160−0View file
drivers/block/nbd.cmodified+4−4View file
drivers/block/paride/pd.cmodified+2−4View file
drivers/block/pktcdvd.cmodified+4−4View file
drivers/block/swim3.cmodified+2−2View file
drivers/block/swim_iop.cmodified+2−2View file
drivers/block/xd.cmodified+1−1View file
drivers/cdrom/Kconfigmodified+1−1View file
drivers/cdrom/cdrom.cmodified+1−1View file
drivers/cdrom/cdu31a.cmodified+3−1View file
drivers/char/Kconfigmodified+1−0View file
drivers/char/random.cmodified+4−0View file
drivers/fc4/fc.cmodified+0−1View file
drivers/ide/Kconfigmodified+4−0View file
drivers/ide/ide-cd.cmodified+35−34View file
drivers/ide/ide-disk.cmodified+3−2View file
drivers/ide/ide-dma.cmodified+1−1View file
drivers/ide/ide-floppy.cmodified+8−9View file
drivers/ide/ide-io.cmodified+24−26View file
drivers/ide/ide-lib.cmodified+3−2View file
drivers/ide/ide-tape.cmodified+7−7View file
drivers/ide/ide-taskfile.cmodified+4−4View file
drivers/ide/ide.cmodified+4−4View file
drivers/ide/legacy/hd.cmodified+1−1View file
drivers/md/Kconfigmodified+3−0View file
drivers/md/dm-emc.cmodified+2−1View file
drivers/message/i2o/Kconfigmodified+1−1View file
drivers/message/i2o/i2o_block.cmodified+4−3View file
drivers/mmc/Kconfigmodified+1−1View file
drivers/mmc/Makefilemodified+2−1View file
drivers/mmc/mmc_queue.cmodified+3−3View file
drivers/mtd/Kconfigmodified+6−6View file
drivers/mtd/devices/Kconfigmodified+1−1View file
drivers/mtd/mtd_blkdevs.cmodified+1−1View file
drivers/s390/block/Kconfigmodified+1−1View file
drivers/s390/block/dasd_diag.cmodified+1−1View file
drivers/s390/block/dasd_eckd.cmodified+1−1View file
drivers/s390/block/dasd_fba.cmodified+1−1View file
drivers/scsi/Kconfigmodified+2−0View file
drivers/scsi/aic7xxx_old.cmodified+2−2View file
drivers/scsi/ide-scsi.cmodified+8−8View file
drivers/scsi/pluto.cmodified+3−3View file
drivers/scsi/scsi.cmodified+2−11View file
drivers/scsi/scsi_lib.cmodified+19−18View file
drivers/scsi/sd.cmodified+2−3View file
drivers/scsi/sun3_NCR5380.cmodified+1−1View file
drivers/scsi/sun3_scsi.cmodified+1−1View file
drivers/scsi/sun3_scsi_vme.cmodified+1−1View file
drivers/usb/storage/Kconfigmodified+2−3View file
fs/Kconfigmodified+24−7View file
fs/Makefilemodified+10−4View file
fs/afs/file.cmodified+0−2View file
fs/binfmt_elf.cmodified+0−1View file
fs/bio.cmodified+2−2View file
fs/block_dev.cmodified+23−0View file
fs/buffer.cmodified+0−174View file
fs/char_dev.cmodified+1−0View file
fs/cifs/file.cmodified+0−1View file
fs/cifs/inode.cmodified+0−1View file
fs/cifs/ioctl.cmodified+3−4View file
fs/compat.cmodified+3−7View file
fs/compat_ioctl.cmodified+18−190View file
fs/dcache.cmodified+1−3View file
fs/ext2/dir.cmodified+3−0View file
fs/ext2/ext2.hmodified+1−0View file
fs/ext2/file.cmodified+6−0View file
fs/ext2/ioctl.cmodified+32−0View file
fs/ext3/dir.cmodified+3−0View file
fs/ext3/file.cmodified+3−0View file
fs/ext3/inode.cmodified+3−2View file
fs/ext3/ioctl.cmodified+54−1View file
fs/ext3/namei.cmodified+2−1View file
fs/fat/dir.cmodified+56−0View file
fs/fs-writeback.cmodified+4−5View file
fs/hfsplus/hfsplus_fs.hmodified+2−6View file
fs/hfsplus/ioctl.cmodified+8−9View file
fs/inode.cmodified+0−21View file
fs/internal.hadded+55−0View file
fs/ioprio.cmodified+12−7View file
fs/jfs/ioctl.cmodified+7−8View file
fs/mpage.cmodified+2−0View file
fs/namespace.cmodified+1−2View file
fs/nfs/write.cmodified+0−1View file
fs/no-block.cadded+22−0View file
fs/partitions/Makefilemodified+1−1View file
fs/proc/proc_misc.cmodified+10−1View file
fs/quota.cmodified+31−13View file
fs/reiserfs/dir.cmodified+3−0View file
fs/reiserfs/file.cmodified+4−0View file
fs/reiserfs/ioctl.cmodified+35−0View file
fs/splice.cmodified+1−1View file
fs/super.cmodified+35−0View file
fs/sync.cmodified+113−0View file
fs/xfs/Kconfigmodified+1−0View file
include/linux/bio.hmodified+2−0View file
include/linux/blkdev.hmodified+176−157View file
include/linux/blktrace_api.hmodified+2−1View file
include/linux/buffer_head.hmodified+17−2View file
include/linux/compat_ioctl.hmodified+2−6View file
include/linux/elevator.hmodified+62−6View file
include/linux/ext2_fs.hmodified+36−28View file
include/linux/ext3_fs.hmodified+22−4View file
include/linux/fs.hmodified+63−4View file
include/linux/genhd.hmodified+4−0View file
include/linux/mm.hmodified+3−1View file
include/linux/mpage.hmodified+2−5View file
include/linux/raid/md.hmodified+3−0View file
include/linux/raid/md_k.hmodified+3−0View file
include/linux/ramfs.hmodified+1−0View file
include/linux/rbtree.hmodified+1−1View file
include/linux/reiserfs_fs.hmodified+22−15View file
include/linux/sched.hmodified+0−1View file
include/linux/tty.hmodified+3−0View file
include/linux/writeback.hmodified+2−0View file
include/scsi/scsi_tcq.hmodified+3−2View file
init/Kconfigmodified+1−1View file
init/do_mounts.cmodified+12−1View file
kernel/compat.cmodified+2−0View file
kernel/exit.cmodified+1−0View file
kernel/sys_ni.cmodified+5−0View file
lib/rbtree.cmodified+6−0View file
mm/Makefilemodified+3−0View file
mm/bounce.cadded+302−0View file
mm/filemap.cmodified+34−0View file
mm/highmem.cmodified+0−281View file
mm/migrate.cmodified+3−1View file
mm/page-writeback.cmodified+140−3View file
mm/truncate.cmodified+26−0View file

Only the first 600 diff lines are shown. Download the complete patch.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 28e1c7b..f0cd5a3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -501,7 +501,7 @@ S: Maintained
BLOCK LAYER
P: Jens Axboe
T: git kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
S: Maintained
@@ -1380,7 +1380,7 @@ S: Maintained
IDE/ATAPI CDROM DRIVER
P: Jens Axboe
W: http://www.kernel.dk
S: Maintained
@@ -2531,7 +2531,7 @@ S: Maintained
SCSI CDROM DRIVER
P: Jens Axboe
W: http://www.kernel.dk
S: Maintained
@@ -2976,7 +2976,7 @@ S: Maintained
UNIFORM CDROM DRIVER
P: Jens Axboe
W: http://www.kernel.dk
S: Maintained

arch/mips/kernel/signal_n32.c

View file
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 477c533..50c17ea 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -42,6 +42,8 @@
#include "signal-common.h"
+extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
+
/*
* Including <asm/unistd.h> would give use the 64-bit syscall numbers ...
*/
@@ -81,8 +83,6 @@ struct rt_sigframe_n32 {
#endif
};
-extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat);
-
save_static_function(sysn32_rt_sigsuspend);
__attribute_used__ noinline static int
_sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)

arch/um/drivers/ubd_kern.c

View file
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 5fa4c8e..fda4a39 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -981,8 +981,6 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
__u64 offset;
int len;
- if(req->rq_status == RQ_INACTIVE) return(1);
-
/* This should be impossible now */
if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
printk("Write attempted on readonly ubd device %s\n",

block/Kconfig

View file
diff --git a/block/Kconfig b/block/Kconfig
index b6f5f0a..9af6c61 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -1,6 +1,24 @@
#
# Block layer core configuration
#
+config BLOCK
+ bool "Enable the block layer"
+ default y
+ help
+ This permits the block layer to be removed from the kernel if it's not
+ needed (on some embedded devices for example). If this option is
+ disabled, then blockdev files will become unusable and some
+ filesystems (such as ext3) will become unavailable.
+
+ This option will also disable SCSI character devices and USB storage
+ since they make use of various block layer definitions and
+ facilities.
+
+ Say Y here unless you know you really don't want to mount disks and
+ suchlike.
+
+if BLOCK
+
#XXX - it makes sense to enable this only for 32-bit subarch's, not for x86_64
#for instance.
config LBD
@@ -33,4 +51,6 @@ config LSF
If unsure, say Y.
+endif
+
source block/Kconfig.iosched

block/Kconfig.iosched

View file
diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched
index 48d090e..903f0d3 100644
--- a/block/Kconfig.iosched
+++ b/block/Kconfig.iosched
@@ -1,3 +1,4 @@
+if BLOCK
menu "IO Schedulers"
@@ -67,3 +68,5 @@ config DEFAULT_IOSCHED
default "noop" if DEFAULT_NOOP
endmenu
+
+endif

block/Makefile

View file
diff --git a/block/Makefile b/block/Makefile
index c05de0e..4b84d0d 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -2,7 +2,7 @@
# Makefile for the kernel block layer
#
-obj-y := elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
+obj-$(CONFIG_BLOCK) := elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o
obj-$(CONFIG_IOSCHED_AS) += as-iosched.o

block/as-iosched.c

View file
diff --git a/block/as-iosched.c b/block/as-iosched.c
index 5da56d4..165509e 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -1,7 +1,7 @@
/*
* Anticipatory & deadline i/o scheduler.
*
- * Copyright (C) 2002 Jens Axboe <[email protected]>
+ * Copyright (C) 2002 Jens Axboe <[email protected]>
* Nick Piggin <[email protected]>
*
*/
@@ -14,7 +14,6 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/compiler.h>
-#include <linux/hash.h>
#include <linux/rbtree.h>
#include <linux/interrupt.h>
@@ -93,9 +92,8 @@ struct as_data {
struct rb_root sort_list[2];
struct list_head fifo_list[2];
- struct as_rq *next_arq[2]; /* next in sort order */
+ struct request *next_rq[2]; /* next in sort order */
sector_t last_sector[2]; /* last REQ_SYNC & REQ_ASYNC sectors */
- struct hlist_head *hash; /* request hash */
unsigned long exit_prob; /* probability a task will exit while
being waited on */
@@ -115,7 +113,6 @@ struct as_data {
int write_batch_count; /* max # of reqs in a write batch */
int current_write_count; /* how many requests left this batch */
int write_batch_idled; /* has the write batch gone idle? */
- mempool_t *arq_pool;
enum anticipation_status antic_status;
unsigned long antic_start; /* jiffies: when it started */
@@ -133,8 +130,6 @@ struct as_data {
unsigned long antic_expire;
};
-#define list_entry_fifo(ptr) list_entry((ptr), struct as_rq, fifo)
-
/*
* per-request data.
*/
@@ -150,40 +145,14 @@ enum arq_state {
AS_RQ_POSTSCHED, /* when they shouldn't be */
};
-struct as_rq {
- /*
- * rbtree index, key is the starting offset
- */
- struct rb_node rb_node;
- sector_t rb_key;
-
- struct request *request;
-
- struct io_context *io_context; /* The submitting task */
-
- /*
- * request hash, key is the ending offset (for back merge lookup)
- */
- struct hlist_node hash;
-
- /*
- * expire fifo
- */
- struct list_head fifo;
- unsigned long expires;
+#define RQ_IOC(rq) ((struct io_context *) (rq)->elevator_private)
+#define RQ_STATE(rq) ((enum arq_state)(rq)->elevator_private2)
+#define RQ_SET_STATE(rq, state) ((rq)->elevator_private2 = (void *) state)
- unsigned int is_sync;
- enum arq_state state;
-};
-
-#define RQ_DATA(rq) ((struct as_rq *) (rq)->elevator_private)
-
-static kmem_cache_t *arq_pool;
-
-static atomic_t ioc_count = ATOMIC_INIT(0);
+static DEFINE_PER_CPU(unsigned long, ioc_count);
static struct completion *ioc_gone;
-static void as_move_to_dispatch(struct as_data *ad, struct as_rq *arq);
+static void as_move_to_dispatch(struct as_data *ad, struct request *rq);
static void as_antic_stop(struct as_data *ad);
/*
@@ -194,7 +163,8 @@ static void as_antic_stop(struct as_data *ad);
static void free_as_io_context(struct as_io_context *aic)
{
kfree(aic);
- if (atomic_dec_and_test(&ioc_count) && ioc_gone)
+ elv_ioc_count_dec(ioc_count);
+ if (ioc_gone && !elv_ioc_count_read(ioc_count))
complete(ioc_gone);
}
@@ -230,7 +200,7 @@ static struct as_io_context *alloc_as_io_context(void)
ret->seek_total = 0;
ret->seek_samples = 0;
ret->seek_mean = 0;
- atomic_inc(&ioc_count);
+ elv_ioc_count_inc(ioc_count);
}
return ret;
@@ -240,9 +210,9 @@ static struct as_io_context *alloc_as_io_context(void)
* If the current task has no AS IO context then create one and initialise it.
* Then take a ref on the task's io context and return it.
*/
-static struct io_context *as_get_io_context(void)
+static struct io_context *as_get_io_context(int node)
{
- struct io_context *ioc = get_io_context(GFP_ATOMIC);
+ struct io_context *ioc = get_io_context(GFP_ATOMIC, node);
if (ioc && !ioc->aic) {
ioc->aic = alloc_as_io_context();
if (!ioc->aic) {
@@ -253,194 +223,43 @@ static struct io_context *as_get_io_context(void)
return ioc;
}
-static void as_put_io_context(struct as_rq *arq)
+static void as_put_io_context(struct request *rq)
{
struct as_io_context *aic;
- if (unlikely(!arq->io_context))
+ if (unlikely(!RQ_IOC(rq)))
return;
- aic = arq->io_context->aic;
+ aic = RQ_IOC(rq)->aic;
- if (arq->is_sync == REQ_SYNC && aic) {
+ if (rq_is_sync(rq) && aic) {
spin_lock(&aic->lock);
set_bit(AS_TASK_IORUNNING, &aic->state);
aic->last_end_request = jiffies;
spin_unlock(&aic->lock);
}
- put_io_context(arq->io_context);
-}
-
-/*
- * the back merge hash support functions
- */
-static const int as_hash_shift = 6;
-#define AS_HASH_BLOCK(sec) ((sec) >> 3)
-#define AS_HASH_FN(sec) (hash_long(AS_HASH_BLOCK((sec)), as_hash_shift))
-#define AS_HASH_ENTRIES (1 << as_hash_shift)
-#define rq_hash_key(rq) ((rq)->sector + (rq)->nr_sectors)
-
-static inline void __as_del_arq_hash(struct as_rq *arq)
-{
- hlist_del_init(&arq->hash);
-}
-
-static inline void as_del_arq_hash(struct as_rq *arq)
-{
- if (!hlist_unhashed(&arq->hash))
- __as_del_arq_hash(arq);
-}
-
-static void as_add_arq_hash(struct as_data *ad, struct as_rq *arq)
-{
- struct request *rq = arq->request;
-
- BUG_ON(!hlist_unhashed(&arq->hash));
-
- hlist_add_head(&arq->hash, &ad->hash[AS_HASH_FN(rq_hash_key(rq))]);
-}
-
-/*
- * move hot entry to front of chain
- */
-static inline void as_hot_arq_hash(struct as_data *ad, struct as_rq *arq)
-{
- struct request *rq = arq->request;
- struct hlist_head *head = &ad->hash[AS_HASH_FN(rq_hash_key(rq))];
-
- if (hlist_unhashed(&arq->hash)) {
- WARN_ON(1);
- return;
- }
-
- if (&arq->hash != head->first) {
- hlist_del(&arq->hash);
- hlist_add_head(&arq->hash, head);
- }
-}
-
-static struct request *as_find_arq_hash(struct as_data *ad, sector_t offset)
-{
- struct hlist_head *hash_list = &ad->hash[AS_HASH_FN(offset)];
- struct hlist_node *entry, *next;
- struct as_rq *arq;
-
- hlist_for_each_entry_safe(arq, entry, next, hash_list, hash) {
- struct request *__rq = arq->request;
-
- BUG_ON(hlist_unhashed(&arq->hash));
-
- if (!rq_mergeable(__rq)) {
- as_del_arq_hash(arq);
- continue;
- }
-
- if (rq_hash_key(__rq) == offset)
- return __rq;
- }
-
- return NULL;
+ put_io_context(RQ_IOC(rq));
}
/*
* rb tree support functions
*/
-#define rb_entry_arq(node) rb_entry((node), struct as_rq, rb_node)
-#define ARQ_RB_ROOT(ad, arq) (&(ad)->sort_list[(arq)->is_sync])
-#define rq_rb_key(rq) (rq)->sector
-
-/*
- * as_find_first_arq finds the first (lowest sector numbered) request
- * for the specified data_dir. Used to sweep back to the start of the disk
- * (1-way elevator) after we process the last (highest sector) request.
- */
-static struct as_rq *as_find_first_arq(struct as_data *ad, int data_dir)
-{
- struct rb_node *n = ad->sort_list[data_dir].rb_node;
-
- if (n == NULL)
- return NULL;
-
- for (;;) {
- if (n->rb_left == NULL)
- return rb_entry_arq(n);
-
- n = n->rb_left;
- }
-}
-
-/*
- * Add the request to the rb tree if it is unique. If there is an alias (an
- * existing request against the same sector), which can happen when using
- * direct IO, then return the alias.
- */
-static struct as_rq *__as_add_arq_rb(struct as_data *ad, struct as_rq *arq)
-{
- struct rb_node **p = &ARQ_RB_ROOT(ad, arq)->rb_node;
- struct rb_node *parent = NULL;
- struct as_rq *__arq;
- struct request *rq = arq->request;
-
- arq->rb_key = rq_rb_key(rq);
-
- while (*p) {
- parent = *p;
- __arq = rb_entry_arq(parent);
-
- if (arq->rb_key < __arq->rb_key)
- p = &(*p)->rb_left;
- else if (arq->rb_key > __arq->rb_key)
- p = &(*p)->rb_right;
- else
- return __arq;
- }
-
- rb_link_node(&arq->rb_node, parent, p);
- rb_insert_color(&arq->rb_node, ARQ_RB_ROOT(ad, arq));
-
- return NULL;
-}
+#define RQ_RB_ROOT(ad, rq) (&(ad)->sort_list[rq_is_sync((rq))])
-static void as_add_arq_rb(struct as_data *ad, struct as_rq *arq)
+static void as_add_rq_rb(struct as_data *ad, struct request *rq)
{
- struct as_rq *alias;
+ struct request *alias;
- while ((unlikely(alias = __as_add_arq_rb(ad, arq)))) {
+ while ((unlikely(alias = elv_rb_add(RQ_RB_ROOT(ad, rq), rq)))) {
as_move_to_dispatch(ad, alias);
as_antic_stop(ad);
}
}
-static inline void as_del_arq_rb(struct as_data *ad, struct as_rq *arq)
-{
- if (!RB_EMPTY_NODE(&arq->rb_node)) {
- WARN_ON(1);
- return;
- }
-
- rb_erase(&arq->rb_node, ARQ_RB_ROOT(ad, arq));
- RB_CLEAR_NODE(&arq->rb_node);
-}
-
-static struct request *
-as_find_arq_rb(struct as_data *ad, sector_t sector, int data_dir)
+static inline void as_del_rq_rb(struct as_data *ad, struct request *rq)
{
- struct rb_node *n = ad->sort_list[data_dir].rb_node;
- struct as_rq *arq;
-
- while (n) {
- arq = rb_entry_arq(n);
-
- if (sector < arq->rb_key)
- n = n->rb_left;
- else if (sector > arq->rb_key)
- n = n->rb_right;
- else
- return arq->request;
- }
-
- return NULL;
+ elv_rb_del(RQ_RB_ROOT(ad, rq), rq);
}
/*
@@ -458,26 +277,26 @@ as_find_arq_rb(struct as_data *ad, sector_t sector, int data_dir)
* as_choose_req selects the preferred one of two requests of the same data_dir
* ignoring time - eg. timeouts, which is the job of as_dispatch_request
*/
-static struct as_rq *
-as_choose_req(struct as_data *ad, struct as_rq *arq1, struct as_rq *arq2)
+static struct request *
+as_choose_req(struct as_data *ad, struct request *rq1, struct request *rq2)
{
int data_dir;
sector_t last, s1, s2, d1, d2;
int r1_wrap=0, r2_wrap=0; /* requests are behind the disk head */
const sector_t maxback = MAXBACK;
- if (arq1 == NULL || arq1 == arq2)
- return arq2;
- if (arq2 == NULL)
- return arq1;
+ if (rq1 == NULL || rq1 == rq2)
+ return rq2;
+ if (rq2 == NULL)
+ return rq1;
- data_dir = arq1->is_sync;
+ data_dir = rq_is_sync(rq1);
last = ad->last_sector[data_dir];
- s1 = arq1->request->sector;
- s2 = arq2->request->sector;
+ s1 = rq1->sector;
+ s2 = rq2->sector;
- BUG_ON(data_dir != arq2->is_sync);
+ BUG_ON(data_dir != rq_is_sync(rq2));
/*
* Strict one way elevator _except_ in the case where we allow
@@ -504,61 +323,58 @@ as_choose_req(struct as_data *ad, struct as_rq *arq1, struct as_rq *arq2)
/* Found required data */
if (!r1_wrap && r2_wrap)
- return arq1;
+ return rq1;
else if (!r2_wrap && r1_wrap)
- return arq2;
+ return rq2;
else if (r1_wrap && r2_wrap) {
/* both behind the head */
if (s1 <= s2)
- return arq1;
+ return rq1;
else
- return arq2;
+ return rq2;
}
/* Both requests in front of the head */
if (d1 < d2)
- return arq1;
+ return rq1;
else if (d2 < d1)
- return arq2;
+ return rq2;
else {
if (s1 >= s2)
- return arq1;
+ return rq1;
else
- return arq2;
+ return rq2;
}
}
/*
- * as_find_next_arq finds the next request after @prev in elevator order.
+ * as_find_next_rq finds the next request after @prev in elevator order.
* this with as_choose_req form the basis for how the scheduler chooses
* what request to process next. Anticipation works on top of this.
*/
-static struct as_rq *as_find_next_arq(struct as_data *ad, struct as_rq *last)
+static struct request *
+as_find_next_rq(struct as_data *ad, struct request *last)
{
- const int data_dir = last->is_sync;
- struct as_rq *ret;
struct rb_node *rbnext = rb_next(&last->rb_node);
struct rb_node *rbprev = rb_prev(&last->rb_node);
- struct as_rq *arq_next, *arq_prev;
+ struct request *next = NULL, *prev = NULL;
- BUG_ON(!RB_EMPTY_NODE(&last->rb_node));
+ BUG_ON(RB_EMPTY_NODE(&last->rb_node));
if (rbprev)
- arq_prev = rb_entry_arq(rbprev);
- else
- arq_prev = NULL;
+ prev = rb_entry_rq(rbprev);
if (rbnext)
- arq_next = rb_entry_arq(rbnext);
+ next = rb_entry_rq(rbnext);
else {
- arq_next = as_find_first_arq(ad, data_dir);
- if (arq_next == last)
- arq_next = NULL;
- }
+ const int data_dir = rq_is_sync(last);
- ret = as_choose_req(ad, arq_next, arq_prev);
+ rbnext = rb_first(&ad->sort_list[data_dir]);
+ if (rbnext && rbnext != &last->rb_node)
+ next = rb_entry_rq(rbnext);
+ }
- return ret;
+ return as_choose_req(ad, next, prev);
}
/*
@@ -712,8 +528,7 @@ static void as_update_seekdist(struct as_data *ad, struct as_io_context *aic,
static void as_update_iohist(struct as_data *ad, struct as_io_context *aic,
struct request *rq)
{
- struct as_rq *arq = RQ_DATA(rq);
- int data_dir = arq->is_sync;
+ int data_dir = rq_is_sync(rq);
unsigned long thinktime = 0;
sector_t seek_dist;

This diff is incomplete. Download the complete patch.

block/blktrace.c

View file

This diff is incomplete. Download the complete patch.

block/cfq-iosched.c

View file

This diff is incomplete. Download the complete patch.

block/deadline-iosched.c

View file

This diff is incomplete. Download the complete patch.

block/elevator.c

View file

This diff is incomplete. Download the complete patch.

block/ll_rw_blk.c

View file

This diff is incomplete. Download the complete patch.

block/noop-iosched.c

View file

This diff is incomplete. Download the complete patch.

block/scsi_ioctl.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/DAC960.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/block/cciss.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/cpqarray.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/floppy.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/loop.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/nbd.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/paride/pd.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/pktcdvd.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/swim3.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/swim_iop.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/xd.c

View file

This diff is incomplete. Download the complete patch.

drivers/cdrom/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/cdrom/cdrom.c

View file

This diff is incomplete. Download the complete patch.

drivers/cdrom/cdu31a.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/char/random.c

View file

This diff is incomplete. Download the complete patch.

drivers/fc4/fc.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-cd.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-disk.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-dma.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-floppy.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-io.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-lib.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-tape.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-taskfile.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/legacy/hd.c

View file

This diff is incomplete. Download the complete patch.

drivers/md/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/md/dm-emc.c

View file

This diff is incomplete. Download the complete patch.

drivers/message/i2o/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/message/i2o/i2o_block.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/mmc_queue.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtd_blkdevs.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_diag.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_eckd.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_fba.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aic7xxx_old.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ide-scsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/pluto.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_lib.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sd.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sun3_NCR5380.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sun3_scsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sun3_scsi_vme.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/storage/Kconfig

View file

This diff is incomplete. Download the complete patch.

fs/Kconfig

View file

This diff is incomplete. Download the complete patch.

fs/Makefile

View file

This diff is incomplete. Download the complete patch.

fs/afs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/binfmt_elf.c

View file

This diff is incomplete. Download the complete patch.

fs/bio.c

View file

This diff is incomplete. Download the complete patch.

fs/block_dev.c

View file

This diff is incomplete. Download the complete patch.

fs/buffer.c

View file

This diff is incomplete. Download the complete patch.

fs/char_dev.c

View file

This diff is incomplete. Download the complete patch.

fs/cifs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/cifs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/cifs/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/compat.c

View file

This diff is incomplete. Download the complete patch.

fs/compat_ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/dcache.c

View file

This diff is incomplete. Download the complete patch.

fs/ext2/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/ext2/ext2.h

View file

This diff is incomplete. Download the complete patch.

fs/ext2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ext2/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/ext3/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/ext3/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ext3/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/ext3/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/ext3/namei.c

View file

This diff is incomplete. Download the complete patch.

fs/fat/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/fs-writeback.c

View file

This diff is incomplete. Download the complete patch.

fs/hfsplus/hfsplus_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/hfsplus/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/internal.h

View file

This diff is incomplete. Download the complete patch.

fs/ioprio.c

View file

This diff is incomplete. Download the complete patch.

fs/jfs/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/mpage.c

View file

This diff is incomplete. Download the complete patch.

fs/namespace.c

View file

This diff is incomplete. Download the complete patch.

fs/nfs/write.c

View file

This diff is incomplete. Download the complete patch.

fs/no-block.c

View file

This diff is incomplete. Download the complete patch.

fs/partitions/Makefile

View file

This diff is incomplete. Download the complete patch.

fs/proc/proc_misc.c

View file

This diff is incomplete. Download the complete patch.

fs/quota.c

View file

This diff is incomplete. Download the complete patch.

fs/reiserfs/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/reiserfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/reiserfs/ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/splice.c

View file

This diff is incomplete. Download the complete patch.

fs/super.c

View file

This diff is incomplete. Download the complete patch.

fs/sync.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/Kconfig

View file

This diff is incomplete. Download the complete patch.

include/linux/bio.h

View file

This diff is incomplete. Download the complete patch.

include/linux/blkdev.h

View file

This diff is incomplete. Download the complete patch.

include/linux/blktrace_api.h

View file

This diff is incomplete. Download the complete patch.

include/linux/buffer_head.h

View file

This diff is incomplete. Download the complete patch.

include/linux/compat_ioctl.h

View file

This diff is incomplete. Download the complete patch.

include/linux/elevator.h

View file

This diff is incomplete. Download the complete patch.

include/linux/ext2_fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/ext3_fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/genhd.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mpage.h

View file

This diff is incomplete. Download the complete patch.

include/linux/raid/md.h

View file

This diff is incomplete. Download the complete patch.

include/linux/raid/md_k.h

View file

This diff is incomplete. Download the complete patch.

include/linux/ramfs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/rbtree.h

View file

This diff is incomplete. Download the complete patch.

include/linux/reiserfs_fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched.h

View file

This diff is incomplete. Download the complete patch.

include/linux/tty.h

View file

This diff is incomplete. Download the complete patch.

include/linux/writeback.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_tcq.h

View file

This diff is incomplete. Download the complete patch.

init/Kconfig

View file

This diff is incomplete. Download the complete patch.

init/do_mounts.c

View file

This diff is incomplete. Download the complete patch.

kernel/compat.c

View file

This diff is incomplete. Download the complete patch.

kernel/exit.c

View file

This diff is incomplete. Download the complete patch.

kernel/sys_ni.c

View file

This diff is incomplete. Download the complete patch.

lib/rbtree.c

View file

This diff is incomplete. Download the complete patch.

mm/Makefile

View file

This diff is incomplete. Download the complete patch.

mm/bounce.c

View file

This diff is incomplete. Download the complete patch.

mm/filemap.c

View file

This diff is incomplete. Download the complete patch.

mm/highmem.c

View file

This diff is incomplete. Download the complete patch.

mm/migrate.c

View file

This diff is incomplete. Download the complete patch.

mm/page-writeback.c

View file

This diff is incomplete. Download the complete patch.

mm/truncate.c

View file

This diff is incomplete. Download the complete patch.