Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147024
b: refs/heads/master
c: 1498ada
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 11, 2009
1 parent 945122a commit f77a778
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 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: bab2a807a489822ded0c9d4a5344c80bcac10b0a
refs/heads/master: 1498ada7a8e80afe324f2b8d86158925d0096ec9
17 changes: 13 additions & 4 deletions trunk/drivers/mtd/mtd_blkdevs.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,22 @@ static int mtd_blktrans_thread(void *arg)
{
struct mtd_blktrans_ops *tr = arg;
struct request_queue *rq = tr->blkcore_priv->rq;
struct request *req = NULL;

/* we might get involved when memory gets low, so use PF_MEMALLOC */
current->flags |= PF_MEMALLOC;

spin_lock_irq(rq->queue_lock);

while (!kthread_should_stop()) {
struct request *req;
struct mtd_blktrans_dev *dev;
int res;

req = elv_next_request(rq);

if (!req) {
req = elv_next_request(rq);
if (req)
blkdev_dequeue_request(req);
}
if (!req) {
set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irq(rq->queue_lock);
Expand All @@ -120,8 +124,13 @@ static int mtd_blktrans_thread(void *arg)

spin_lock_irq(rq->queue_lock);

__blk_end_request_cur(req, res);
if (!__blk_end_request_cur(req, res))
req = NULL;
}

if (req)
__blk_end_request_all(req, -EIO);

spin_unlock_irq(rq->queue_lock);

return 0;
Expand Down

0 comments on commit f77a778

Please sign in to comment.