2003-03-24 17:04:29

by Dave Jones

[permalink] [raw]
Subject: ancient block_dev patch

Andrew,
What became of this patch ? Is it needed ?


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/block_dev.c linux-2.5/fs/block_dev.c
--- bk-linus/fs/block_dev.c 2003-03-17 12:40:51.000000000 +0000
+++ linux-2.5/fs/block_dev.c 2003-03-17 13:09:03.000000000 +0000
@@ -653,15 +653,16 @@ int blkdev_put(struct block_device *bdev
struct gendisk *disk = bdev->bd_disk;

down(&bdev->bd_sem);
- switch (kind) {
- case BDEV_FILE:
- case BDEV_FS:
- sync_blockdev(bd_inode->i_bdev);
- break;
- }
lock_kernel();
- if (!--bdev->bd_openers)
+ if (!--bdev->bd_openers) {
+ switch (kind) {
+ case BDEV_FILE:
+ case BDEV_FS:
+ sync_blockdev(bd_inode->i_bdev);
+ break;
+ }
kill_bdev(bdev);
+ }
if (bdev->bd_contains == bdev) {
if (disk->fops->release)
ret = disk->fops->release(bd_inode, NULL);


2003-03-24 18:05:04

by Andrew Morton

[permalink] [raw]
Subject: Re: ancient block_dev patch

[email protected] wrote:
>
> Andrew,
> What became of this patch ? Is it needed ?
>
>
> ...
> down(&bdev->bd_sem);
> - switch (kind) {
> - case BDEV_FILE:
> - case BDEV_FS:
> - sync_blockdev(bd_inode->i_bdev);
> - break;
> - }
> lock_kernel();
> - if (!--bdev->bd_openers)
> + if (!--bdev->bd_openers) {
> + switch (kind) {
> + case BDEV_FILE:
> + case BDEV_FS:
> + sync_blockdev(bd_inode->i_bdev);
> + break;
> + }
> kill_bdev(bdev);
> + }

Seems so, yes. Without it we sync the blockdev on every close rather
than on the final one.

It has scary potential to expose existing bugs. I shall play with it,
thanks.

2003-03-24 18:05:31

by Christoph Hellwig

[permalink] [raw]
Subject: Re: ancient block_dev patch

On Mon, Mar 24, 2003 at 04:41:54PM +0000, [email protected] wrote:
> Andrew,
> What became of this patch ? Is it needed ?

It's not needed but a nice speedup for certain loads. IIRC one of them
was INN directly using blockdevices.

2003-03-24 18:18:50

by Arjan van de Ven

[permalink] [raw]
Subject: Re: ancient block_dev patch

On Mon, 2003-03-24 at 19:16, Christoph Hellwig wrote:
> On Mon, Mar 24, 2003 at 04:41:54PM +0000, [email protected] wrote:
> > Andrew,
> > What became of this patch ? Is it needed ?
>
> It's not needed but a nice speedup for certain loads. IIRC one of them
> was INN directly using blockdevices

and certain dvd players


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part