diff options
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 1c26c7a08ae6..6863f722cd2a 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -413,6 +413,20 @@ static inline char * mdname (mddev_t * mddev) | |||
413 | return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; | 413 | return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; |
414 | } | 414 | } |
415 | 415 | ||
416 | static inline int sysfs_link_rdev(mddev_t *mddev, mdk_rdev_t *rdev) | ||
417 | { | ||
418 | char nm[20]; | ||
419 | sprintf(nm, "rd%d", rdev->raid_disk); | ||
420 | return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); | ||
421 | } | ||
422 | |||
423 | static inline void sysfs_unlink_rdev(mddev_t *mddev, mdk_rdev_t *rdev) | ||
424 | { | ||
425 | char nm[20]; | ||
426 | sprintf(nm, "rd%d", rdev->raid_disk); | ||
427 | sysfs_remove_link(&mddev->kobj, nm); | ||
428 | } | ||
429 | |||
416 | /* | 430 | /* |
417 | * iterates through some rdev ringlist. It's safe to remove the | 431 | * iterates through some rdev ringlist. It's safe to remove the |
418 | * current 'rdev'. Dont touch 'tmp' though. | 432 | * current 'rdev'. Dont touch 'tmp' though. |