Commit 87849dd5 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (10/15) big struct block_device * push (first series)

 - md/linear.c - bring struct block_device * into private data.
parent 79c2cfb8
...@@ -56,6 +56,8 @@ static int linear_run (mddev_t *mddev) ...@@ -56,6 +56,8 @@ static int linear_run (mddev_t *mddev)
dev_info_t *disk = conf->disks + j; dev_info_t *disk = conf->disks + j;
disk->dev = rdev->dev; disk->dev = rdev->dev;
disk->bdev = rdev->bdev;
atomic_inc(&rdev->bdev->bd_count);
disk->size = rdev->size; disk->size = rdev->size;
disk->offset = curr_offset; disk->offset = curr_offset;
...@@ -101,8 +103,12 @@ static int linear_run (mddev_t *mddev) ...@@ -101,8 +103,12 @@ static int linear_run (mddev_t *mddev)
return 0; return 0;
out: out:
if (conf) if (conf) {
for (i = 0; i < MD_SB_DISKS; i++)
if (conf->disks[i].bdev)
bdput(conf->disks[i].bdev);
kfree(conf); kfree(conf);
}
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
return 1; return 1;
} }
...@@ -110,7 +116,11 @@ static int linear_run (mddev_t *mddev) ...@@ -110,7 +116,11 @@ static int linear_run (mddev_t *mddev)
static int linear_stop (mddev_t *mddev) static int linear_stop (mddev_t *mddev)
{ {
linear_conf_t *conf = mddev_to_conf(mddev); linear_conf_t *conf = mddev_to_conf(mddev);
int i;
for (i = 0; i < MD_SB_DISKS; i++)
if (conf->disks[i].bdev)
bdput(conf->disks[i].bdev);
kfree(conf->hash_table); kfree(conf->hash_table);
kfree(conf); kfree(conf);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
struct dev_info { struct dev_info {
kdev_t dev; kdev_t dev;
struct block_device *bdev;
unsigned long size; unsigned long size;
unsigned long offset; unsigned long offset;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment