Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58537
b: refs/heads/master
c: 01370f0
h: refs/heads/master
i:
  58535: 6524938
v: v3
  • Loading branch information
Linus Torvalds committed Jul 10, 2007
1 parent 9a08725 commit 7c09c5f
Show file tree
Hide file tree
Showing 74 changed files with 1,811 additions and 27,997 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0845718dafea3e16041d270c256e8516acf4e13d
refs/heads/master: 01370f0603f8435d415a19f7e62d1bab826c3589
16 changes: 3 additions & 13 deletions trunk/Documentation/block/barrier.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,33 +82,23 @@ including draining and flushing.
typedef void (prepare_flush_fn)(request_queue_t *q, struct request *rq);

int blk_queue_ordered(request_queue_t *q, unsigned ordered,
prepare_flush_fn *prepare_flush_fn,
unsigned gfp_mask);

int blk_queue_ordered_locked(request_queue_t *q, unsigned ordered,
prepare_flush_fn *prepare_flush_fn,
unsigned gfp_mask);

The only difference between the two functions is whether or not the
caller is holding q->queue_lock on entry. The latter expects the
caller is holding the lock.
prepare_flush_fn *prepare_flush_fn);

@q : the queue in question
@ordered : the ordered mode the driver/device supports
@prepare_flush_fn : this function should prepare @rq such that it
flushes cache to physical medium when executed
@gfp_mask : gfp_mask used when allocating data structures
for ordered processing

For example, SCSI disk driver's prepare_flush_fn looks like the
following.

static void sd_prepare_flush(request_queue_t *q, struct request *rq)
{
memset(rq->cmd, 0, sizeof(rq->cmd));
rq->flags |= REQ_BLOCK_PC;
rq->cmd_type = REQ_TYPE_BLOCK_PC;
rq->timeout = SD_TIMEOUT;
rq->cmd[0] = SYNCHRONIZE_CACHE;
rq->cmd_len = 10;
}

The following seven ordered modes are supported. The following table
Expand Down
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ W: http://www.openib.org/
T: git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
S: Supported

INPUT (KEYBOARD, MOUSE, JOYSTICK) DRIVERS
INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
P: Dmitry Torokhov
M: dmitry.torokhov@gmail.com
M: dtor@mail.ru
Expand Down
4 changes: 2 additions & 2 deletions trunk/block/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Block layer core configuration
#
config BLOCK
menuconfig BLOCK
bool "Enable the block layer" if EMBEDDED
default y
help
Expand Down Expand Up @@ -49,6 +49,6 @@ config LSF

If unsure, say Y.

endif
endif # BLOCK

source block/Kconfig.iosched
39 changes: 36 additions & 3 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ struct cfq_data {
struct cfq_queue *active_queue;
struct cfq_io_context *active_cic;

struct cfq_queue *async_cfqq[IOPRIO_BE_NR];

struct timer_list idle_class_timer;

sector_t last_position;
Expand Down Expand Up @@ -1351,8 +1353,8 @@ static void cfq_ioc_set_ioprio(struct io_context *ioc)
}

static struct cfq_queue *
cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
gfp_t gfp_mask)
cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync,
struct task_struct *tsk, gfp_t gfp_mask)
{
struct cfq_queue *cfqq, *new_cfqq = NULL;
struct cfq_io_context *cic;
Expand Down Expand Up @@ -1405,12 +1407,35 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
if (new_cfqq)
kmem_cache_free(cfq_pool, new_cfqq);

atomic_inc(&cfqq->ref);
out:
WARN_ON((gfp_mask & __GFP_WAIT) && !cfqq);
return cfqq;
}

static struct cfq_queue *
cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
gfp_t gfp_mask)
{
const int ioprio = task_ioprio(tsk);
struct cfq_queue *cfqq = NULL;

if (!is_sync)
cfqq = cfqd->async_cfqq[ioprio];
if (!cfqq)
cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);

/*
* pin the queue now that it's allocated, scheduler exit will prune it
*/
if (!is_sync && !cfqd->async_cfqq[ioprio]) {
atomic_inc(&cfqq->ref);
cfqd->async_cfqq[ioprio] = cfqq;
}

atomic_inc(&cfqq->ref);
return cfqq;
}

/*
* We drop cfq io contexts lazily, so we may find a dead one.
*/
Expand Down Expand Up @@ -2019,6 +2044,7 @@ static void cfq_exit_queue(elevator_t *e)
{
struct cfq_data *cfqd = e->elevator_data;
request_queue_t *q = cfqd->queue;
int i;

cfq_shutdown_timer_wq(cfqd);

Expand All @@ -2035,6 +2061,13 @@ static void cfq_exit_queue(elevator_t *e)
__cfq_exit_single_io_context(cfqd, cic);
}

/*
* Put the async queues
*/
for (i = 0; i < IOPRIO_BE_NR; i++)
if (cfqd->async_cfqq[i])
cfq_put_queue(cfqd->async_cfqq[i]);

spin_unlock_irq(q->queue_lock);

cfq_shutdown_timer_wq(cfqd);
Expand Down
13 changes: 3 additions & 10 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,8 @@ static inline int elv_try_merge(struct request *__rq, struct bio *bio)
static struct elevator_type *elevator_find(const char *name)
{
struct elevator_type *e;
struct list_head *entry;

list_for_each(entry, &elv_list) {

e = list_entry(entry, struct elevator_type, list);

list_for_each_entry(e, &elv_list, list) {
if (!strcmp(e->elevator_name, name))
return e;
}
Expand Down Expand Up @@ -1116,14 +1112,11 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
{
elevator_t *e = q->elevator;
struct elevator_type *elv = e->elevator_type;
struct list_head *entry;
struct elevator_type *__e;
int len = 0;

spin_lock(&elv_list_lock);
list_for_each(entry, &elv_list) {
struct elevator_type *__e;

__e = list_entry(entry, struct elevator_type, list);
list_for_each_entry(__e, &elv_list, list) {
if (!strcmp(elv->elevator_name, __e->elevator_name))
len += sprintf(name+len, "[%s] ", elv->elevator_name);
else
Expand Down
13 changes: 2 additions & 11 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@ int blk_do_ordered(request_queue_t *q, struct request **rqp)
static int flush_dry_bio_endio(struct bio *bio, unsigned int bytes, int error)
{
request_queue_t *q = bio->bi_private;
struct bio_vec *bvec;
int i;

/*
* This is dry run, restore bio_sector and size. We'll finish
Expand All @@ -540,13 +538,6 @@ static int flush_dry_bio_endio(struct bio *bio, unsigned int bytes, int error)
if (bio->bi_size)
return 1;

/* Rewind bvec's */
bio->bi_idx = 0;
bio_for_each_segment(bvec, bio, i) {
bvec->bv_len += bvec->bv_offset;
bvec->bv_offset = 0;
}

/* Reset bio */
set_bit(BIO_UPTODATE, &bio->bi_flags);
bio->bi_size = q->bi_size;
Expand Down Expand Up @@ -1304,9 +1295,9 @@ static int blk_hw_contig_segment(request_queue_t *q, struct bio *bio,
if (unlikely(!bio_flagged(nxt, BIO_SEG_VALID)))
blk_recount_segments(q, nxt);
if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)) ||
BIOVEC_VIRT_OVERSIZE(bio->bi_hw_front_size + bio->bi_hw_back_size))
BIOVEC_VIRT_OVERSIZE(bio->bi_hw_back_size + nxt->bi_hw_front_size))
return 0;
if (bio->bi_size + nxt->bi_size > q->max_segment_size)
if (bio->bi_hw_back_size + nxt->bi_hw_front_size > q->max_segment_size)
return 0;

return 1;
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ source "drivers/scsi/Kconfig"

source "drivers/ata/Kconfig"

source "drivers/cdrom/Kconfig"

source "drivers/md/Kconfig"

source "drivers/message/fusion/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acorn/block/fd1772.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ static void redo_fd_request(void)
del_timer(&motor_off_timer);

ReqCnt = 0;
ReqCmd = CURRENT->cmd;
ReqCmd = rq_data_dir(CURRENT);
ReqBlock = CURRENT->sector;
ReqBuffer = CURRENT->buffer;
setup_req_params(drive);
Expand Down
13 changes: 3 additions & 10 deletions trunk/drivers/acorn/block/mfmhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static void mfm_rw_intr(void)
a choice of command end or some data which is ready to be collected */
/* I think we have to transfer data while the interrupt line is on and its
not any other type of interrupt */
if (CURRENT->cmd == WRITE) {
if (rq_data_dir(CURRENT) == WRITE) {
extern void hdc63463_writedma(void);
if ((hdc63463_dataleft <= 0) && (!(mfm_status & STAT_CED))) {
printk("mfm_rw_intr: Apparent DMA write request when no more to DMA\n");
Expand Down Expand Up @@ -799,7 +799,7 @@ static void issue_request(unsigned int block, unsigned int nsect,
raw_cmd.head = start_head;
raw_cmd.cylinder = track / p->heads;
raw_cmd.cmdtype = CURRENT->cmd;
raw_cmd.cmdcode = CURRENT->cmd == WRITE ? CMD_WD : CMD_RD;
raw_cmd.cmdcode = rq_data_dir(CURRENT) == WRITE ? CMD_WD : CMD_RD;
raw_cmd.cmddata[0] = dev + 1; /* DAG: +1 to get US */
raw_cmd.cmddata[1] = raw_cmd.head;
raw_cmd.cmddata[2] = raw_cmd.cylinder >> 8;
Expand Down Expand Up @@ -830,7 +830,7 @@ static void issue_request(unsigned int block, unsigned int nsect,
hdc63463_dataleft = nsect * 256; /* Better way? */

DBG("mfm%c: %sing: CHS=%d/%d/%d, sectors=%d, buffer=0x%08lx (%p)\n",
raw_cmd.dev + 'a', (CURRENT->cmd == READ) ? "read" : "writ",
raw_cmd.dev + 'a', rq_data_dir(CURRENT) == READ ? "read" : "writ",
raw_cmd.cylinder,
raw_cmd.head,
raw_cmd.sector, nsect, (unsigned long) Copy_buffer, CURRENT);
Expand Down Expand Up @@ -917,13 +917,6 @@ static void mfm_request(void)

DBG("mfm_request: block after offset=%d\n", block);

if (CURRENT->cmd != READ && CURRENT->cmd != WRITE) {
printk("unknown mfm-command %d\n", CURRENT->cmd);
end_request(CURRENT, 0);
Busy = 0;
printk("mfm: continue 4\n");
continue;
}
issue_request(block, nsect, CURRENT);

break;
Expand Down
44 changes: 7 additions & 37 deletions trunk/drivers/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
# Block device driver configuration
#

if BLOCK
menuconfig BLK_DEV
bool "Block devices"
depends on BLOCK
default y

menu "Block devices"
if BLK_DEV

config BLK_DEV_FD
tristate "Normal floppy disk support"
Expand Down Expand Up @@ -56,40 +59,9 @@ config AMIGA_Z2RAM
To compile this driver as a module, choose M here: the
module will be called z2ram.

config ATARI_ACSI
tristate "Atari ACSI support"
depends on ATARI && BROKEN
---help---
This enables support for the Atari ACSI interface. The driver
supports hard disks and CD-ROMs, which have 512-byte sectors, or can
be switched to that mode. Due to the ACSI command format, only disks
up to 1 GB are supported. Special support for certain ACSI to SCSI
adapters, which could relax that, isn't included yet. The ACSI
driver is also the basis for certain other drivers for devices
attached to the ACSI bus: Atari SLM laser printer, BioNet-100
Ethernet, and PAMsNet Ethernet. If you want to use one of these
devices, you need ACSI support, too.

To compile this driver as a module, choose M here: the
module will be called acsi.

comment "Some devices (e.g. CD jukebox) support multiple LUNs"
depends on ATARI && ATARI_ACSI

config ACSI_MULTI_LUN
bool "Probe all LUNs on each ACSI device"
depends on ATARI_ACSI
help
If you have a ACSI device that supports more than one LUN (Logical
Unit Number), e.g. a CD jukebox, you should say Y here so that all
will be found by the ACSI driver. An ACSI device with multiple LUNs
acts logically like multiple ACSI devices. The vast majority of ACSI
devices have only one LUN, and so most people can say N here and
should in fact do so, because it is safer.

config ATARI_SLM
tristate "Atari SLM laser printer support"
depends on ATARI && ATARI_ACSI!=n
depends on ATARI
help
If you have an Atari SLM laser printer, say Y to include support for
it in the kernel. Otherwise, say N. This driver is also available as
Expand Down Expand Up @@ -453,6 +425,4 @@ config ATA_OVER_ETH

source "drivers/s390/block/Kconfig"

endmenu

endif
endif # BLK_DEV
1 change: 0 additions & 1 deletion trunk/drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ obj-$(CONFIG_MAC_FLOPPY) += swim3.o
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o
obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
obj-$(CONFIG_ATARI_ACSI) += acsi.o
obj-$(CONFIG_ATARI_SLM) += acsi_slm.o
obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
obj-$(CONFIG_BLK_DEV_RAM) += rd.o
Expand Down
Loading

0 comments on commit 7c09c5f

Please sign in to comment.