[PATCH 5/7] dm/md dependency tree in sysfs: md to use bd_claim_by_disk



This patch is part of dm/md dependency tree in sysfs.

Following symlinks are created if md0 is built from sda and sdb
/sys/block/md0/slaves/sda --> /sys/block/sda
/sys/block/md0/slaves/sdb --> /sys/block/sdb
/sys/block/sda/holders/md0 --> /sys/block/md0
/sys/block/sdb/holders/md0 --> /sys/block/md0

Thanks,
--
Jun'ichi Nomura, NEC Solutions (America), Inc.
Use bd_claim_by_disk.

Following symlinks are created if md0 is built from sda and sdb
/sys/block/md0/slaves/sda --> /sys/block/sda
/sys/block/md0/slaves/sdb --> /sys/block/sdb
/sys/block/sda/holders/md0 --> /sys/block/md0
/sys/block/sdb/holders/md0 --> /sys/block/md0

Signed-off-by: Jun'ichi Nomura <j-nomura@xxxxxxxxxxxxx>

drivers/md/md.c | 2 ++
1 files changed, 2 insertions(+)

--- linux-2.6.16-rc6.orig/drivers/md/md.c 2006-03-11 17:12:55.000000000 -0500
+++ linux-2.6.16-rc6/drivers/md/md.c 2006-03-13 11:24:00.000000000 -0500
@@ -1298,6 +1298,7 @@ static int bind_rdev_to_array(mdk_rdev_t
else
ko = &rdev->bdev->bd_disk->kobj;
sysfs_create_link(&rdev->kobj, ko, "block");
+ bd_claim_by_disk(rdev->bdev, rdev, mddev->gendisk);
return 0;
}

@@ -1308,6 +1309,7 @@ static void unbind_rdev_from_array(mdk_r
MD_BUG();
return;
}
+ bd_release_from_disk(rdev->bdev, rdev->mddev->gendisk);
list_del_init(&rdev->same_set);
printk(KERN_INFO "md: unbind<%s>\n", bdevname(rdev->bdev,b));
rdev->mddev = NULL;


Relevant Pages

  • [PATCH 5/6] md to use bd_claim_by_disk
    ... Following symlinks are created if md0 is built from sda and sdb ...
    (Linux-Kernel)
  • Re: LibPATA code issues / 2.6.15.4
    ... So here's the info for sda and sdb. ... I/O error, dev sda, sector 390716735 ... disabling device. ...
    (Linux-Kernel)
  • RE: Boot loader problem after addiing SCSI disk
    ... Unfortunately the three scsi devices are not identical. ... The old sda and sdb are two internal raided file systems on two 3ware 8 ... port PATA controllers, ...
    (RedHat)
  • Re: Mount Problem
    ... fstab doesn't do the mount when the system is started. ... The USB disk appeared as sdb and the ... computer's internal drive was sda. ... So that relabeling could well mess up your system while booting. ...
    (comp.os.linux.setup)
  • [SLE] 9.0 Install Problem - DPT SCSI Controller
    ... but no go on the install... ... The 9.0 installer sees three drives attached sda, sdb and sdc, with sda ...
    (SuSE)