Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123509
b: refs/heads/master
c: a72b214
h: refs/heads/master
i:
  123507: 0a2d48f
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Dec 29, 2008
1 parent 5b361a1 commit 51dac14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 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: 1d0bf587df5b17bb93b32d760171417883ca907f
refs/heads/master: a72b2147ec9e77be68308ba06190603550d1cb61
28 changes: 9 additions & 19 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
static int __ide_end_request(ide_drive_t *drive, struct request *rq,
int uptodate, unsigned int nr_bytes, int dequeue)
{
unsigned long flags;
int ret = 1;
int error = 0;

Expand All @@ -84,11 +85,13 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
ide_dma_on(drive);
}

if (!__blk_end_request(rq, error, nr_bytes)) {
if (dequeue)
HWGROUP(drive)->rq = NULL;
spin_lock_irqsave(&ide_lock, flags);
if (!__blk_end_request(rq, error, nr_bytes))
ret = 0;
}
spin_unlock_irqrestore(&ide_lock, flags);

if (ret == 0 && dequeue)
drive->hwif->hwgroup->rq = NULL;

return ret;
}
Expand All @@ -108,8 +111,6 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
{
unsigned int nr_bytes = nr_sectors << 9;
struct request *rq = drive->hwif->hwgroup->rq;
unsigned long flags;
int ret = 1;

if (!nr_bytes) {
if (blk_pc_request(rq))
Expand All @@ -118,11 +119,7 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
nr_bytes = rq->hard_cur_sectors << 9;
}

spin_lock_irqsave(&ide_lock, flags);
ret = __ide_end_request(drive, rq, uptodate, nr_bytes, 1);
spin_unlock_irqrestore(&ide_lock, flags);

return ret;
return __ide_end_request(drive, rq, uptodate, nr_bytes, 1);
}
EXPORT_SYMBOL(ide_end_request);

Expand Down Expand Up @@ -236,16 +233,9 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq,
int uptodate, int nr_sectors)
{
unsigned long flags;
int ret;

BUG_ON(!blk_rq_started(rq));

spin_lock_irqsave(&ide_lock, flags);
ret = __ide_end_request(drive, rq, uptodate, nr_sectors << 9, 0);
spin_unlock_irqrestore(&ide_lock, flags);

return ret;
return __ide_end_request(drive, rq, uptodate, nr_sectors << 9, 0);
}
EXPORT_SYMBOL_GPL(ide_end_dequeued_request);

Expand Down

0 comments on commit 51dac14

Please sign in to comment.