aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a91dc593f3ca..0a0d7c2f2ff6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -705,9 +705,9 @@ static struct mdk_personality *find_pers(int level, char *clevel)
705} 705}
706 706
707/* return the offset of the super block in 512byte sectors */ 707/* return the offset of the super block in 512byte sectors */
708static inline sector_t calc_dev_sboffset(struct block_device *bdev) 708static inline sector_t calc_dev_sboffset(mdk_rdev_t *rdev)
709{ 709{
710 sector_t num_sectors = i_size_read(bdev->bd_inode) / 512; 710 sector_t num_sectors = i_size_read(rdev->bdev->bd_inode) / 512;
711 return MD_NEW_SIZE_SECTORS(num_sectors); 711 return MD_NEW_SIZE_SECTORS(num_sectors);
712} 712}
713 713
@@ -991,7 +991,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
991 * 991 *
992 * It also happens to be a multiple of 4Kb. 992 * It also happens to be a multiple of 4Kb.
993 */ 993 */
994 rdev->sb_start = calc_dev_sboffset(rdev->bdev); 994 rdev->sb_start = calc_dev_sboffset(rdev);
995 995
996 ret = read_disk_sb(rdev, MD_SB_BYTES); 996 ret = read_disk_sb(rdev, MD_SB_BYTES);
997 if (ret) return ret; 997 if (ret) return ret;
@@ -1332,7 +1332,7 @@ super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
1332 return 0; /* component must fit device */ 1332 return 0; /* component must fit device */
1333 if (rdev->mddev->bitmap_info.offset) 1333 if (rdev->mddev->bitmap_info.offset)
1334 return 0; /* can't move bitmap */ 1334 return 0; /* can't move bitmap */
1335 rdev->sb_start = calc_dev_sboffset(rdev->bdev); 1335 rdev->sb_start = calc_dev_sboffset(rdev);
1336 if (!num_sectors || num_sectors > rdev->sb_start) 1336 if (!num_sectors || num_sectors > rdev->sb_start)
1337 num_sectors = rdev->sb_start; 1337 num_sectors = rdev->sb_start;
1338 md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, 1338 md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
@@ -5249,7 +5249,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
5249 printk(KERN_INFO "md: nonpersistent superblock ...\n"); 5249 printk(KERN_INFO "md: nonpersistent superblock ...\n");
5250 rdev->sb_start = i_size_read(rdev->bdev->bd_inode) / 512; 5250 rdev->sb_start = i_size_read(rdev->bdev->bd_inode) / 512;
5251 } else 5251 } else
5252 rdev->sb_start = calc_dev_sboffset(rdev->bdev); 5252 rdev->sb_start = calc_dev_sboffset(rdev);
5253 rdev->sectors = rdev->sb_start; 5253 rdev->sectors = rdev->sb_start;
5254 5254
5255 err = bind_rdev_to_array(rdev, mddev); 5255 err = bind_rdev_to_array(rdev, mddev);
@@ -5316,7 +5316,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
5316 } 5316 }
5317 5317
5318 if (mddev->persistent) 5318 if (mddev->persistent)
5319 rdev->sb_start = calc_dev_sboffset(rdev->bdev); 5319 rdev->sb_start = calc_dev_sboffset(rdev);
5320 else 5320 else
5321 rdev->sb_start = i_size_read(rdev->bdev->bd_inode) / 512; 5321 rdev->sb_start = i_size_read(rdev->bdev->bd_inode) / 512;
5322 5322