Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16929
b: refs/heads/master
c: 8382bf2
h: refs/heads/master
i:
  16927: f2b74e9
v: v3
  • Loading branch information
Peter Osterlund authored and Linus Torvalds committed Jan 9, 2006
1 parent 604b514 commit 84d70b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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: 97a41e26124330e41aa10ef88cd1711bc3d17460
refs/heads/master: 8382bf2e72d16d0532e351299121ccd3bca0fdd8
12 changes: 9 additions & 3 deletions trunk/drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1955,9 +1955,12 @@ static int pkt_open_dev(struct pktcdvd_device *pd, int write)
if ((ret = blkdev_get(pd->bdev, FMODE_READ, O_RDONLY)))
goto out;

if ((ret = bd_claim(pd->bdev, pd)))
goto out_putdev;

if ((ret = pkt_get_last_written(pd, &lba))) {
printk("pktcdvd: pkt_get_last_written failed\n");
goto out_putdev;
goto out_unclaim;
}

set_capacity(pd->disk, lba << 2);
Expand All @@ -1967,7 +1970,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, int write)
q = bdev_get_queue(pd->bdev);
if (write) {
if ((ret = pkt_open_write(pd)))
goto out_putdev;
goto out_unclaim;
/*
* Some CDRW drives can not handle writes larger than one packet,
* even if the size is a multiple of the packet size.
Expand All @@ -1982,13 +1985,15 @@ static int pkt_open_dev(struct pktcdvd_device *pd, int write)
}

if ((ret = pkt_set_segment_merging(pd, q)))
goto out_putdev;
goto out_unclaim;

if (write)
printk("pktcdvd: %lukB available on disc\n", lba << 1);

return 0;

out_unclaim:
bd_release(pd->bdev);
out_putdev:
blkdev_put(pd->bdev);
out:
Expand All @@ -2007,6 +2012,7 @@ static void pkt_release_dev(struct pktcdvd_device *pd, int flush)
pkt_lock_door(pd, 0);

pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);
bd_release(pd->bdev);
blkdev_put(pd->bdev);
}

Expand Down

0 comments on commit 84d70b8

Please sign in to comment.