Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: kill swap_io_context()
  as-iosched: fix inconsistent ioc->lock context
  ide-cd: fix leftover data BUG
  block: make elevator lib checkpatch compliant
  cfq-iosched: make checkpatch compliant
  block: make core bits checkpatch compliant
  block: new end request handling interface should take unsigned byte counts
  unexport add_disk_randomness
  block/sunvdc.c:print_version() must be __devinit
  splice: always updated atime in direct splice
  • Loading branch information
Linus Torvalds committed Feb 1, 2008
2 parents 31fa5d2 + 3bc217f commit 24e1c13
Show file tree
Hide file tree
Showing 17 changed files with 220 additions and 254 deletions.
24 changes: 6 additions & 18 deletions block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ static void free_as_io_context(struct as_io_context *aic)

static void as_trim(struct io_context *ioc)
{
spin_lock(&ioc->lock);
spin_lock_irq(&ioc->lock);
if (ioc->aic)
free_as_io_context(ioc->aic);
ioc->aic = NULL;
spin_unlock(&ioc->lock);
spin_unlock_irq(&ioc->lock);
}

/* Called when the task exits */
Expand Down Expand Up @@ -235,10 +235,12 @@ static void as_put_io_context(struct request *rq)
aic = RQ_IOC(rq)->aic;

if (rq_is_sync(rq) && aic) {
spin_lock(&aic->lock);
unsigned long flags;

spin_lock_irqsave(&aic->lock, flags);
set_bit(AS_TASK_IORUNNING, &aic->state);
aic->last_end_request = jiffies;
spin_unlock(&aic->lock);
spin_unlock_irqrestore(&aic->lock, flags);
}

put_io_context(RQ_IOC(rq));
Expand Down Expand Up @@ -1266,22 +1268,8 @@ static void as_merged_requests(struct request_queue *q, struct request *req,
*/
if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) {
if (time_before(rq_fifo_time(next), rq_fifo_time(req))) {
struct io_context *rioc = RQ_IOC(req);
struct io_context *nioc = RQ_IOC(next);

list_move(&req->queuelist, &next->queuelist);
rq_set_fifo_time(req, rq_fifo_time(next));
/*
* Don't copy here but swap, because when anext is
* removed below, it must contain the unused context
*/
if (rioc != nioc) {
double_spin_lock(&rioc->lock, &nioc->lock,
rioc < nioc);
swap_io_context(&rioc, &nioc);
double_spin_unlock(&rioc->lock, &nioc->lock,
rioc < nioc);
}
}
}

Expand Down
5 changes: 2 additions & 3 deletions block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered,
{
if (ordered & (QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH) &&
prepare_flush_fn == NULL) {
printk(KERN_ERR "blk_queue_ordered: prepare_flush_fn required\n");
printk(KERN_ERR "%s: prepare_flush_fn required\n",
__FUNCTION__);
return -EINVAL;
}

Expand All @@ -47,7 +48,6 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered,

return 0;
}

EXPORT_SYMBOL(blk_queue_ordered);

/*
Expand Down Expand Up @@ -315,5 +315,4 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
bio_put(bio);
return ret;
}

EXPORT_SYMBOL(blkdev_issue_flush);
Loading

0 comments on commit 24e1c13

Please sign in to comment.