diff options
author | Christoph Hellwig <hch@lst.de> | 2020-06-06 11:49:35 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-07-16 16:34:42 +0300 |
commit | 881627f353754dd05a8f3e1c1941f0dbbf47a170 (patch) | |
tree | 9544cb47ae7ee8a413cbf9da8ce236b14ec9167e /init/do_mounts_md.c | |
parent | 9e96c8c0e94eea2f69a9705f5d0f51928ea26c17 (diff) | |
download | linux-881627f353754dd05a8f3e1c1941f0dbbf47a170.tar.xz |
init: remove the bstat helper
The only caller of the bstat function becomes cleaner and simpler when
open coding the function.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: NeilBrown <neilb@suse.de>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/do_mounts_md.c')
-rw-r--r-- | init/do_mounts_md.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c index b84031528dd4..359363e85ccd 100644 --- a/init/do_mounts_md.c +++ b/init/do_mounts_md.c @@ -138,9 +138,9 @@ static void __init md_setup_drive(void) dev = MKDEV(MD_MAJOR, minor); create_dev(name, dev); for (i = 0; i < MD_SB_DISKS && devname != NULL; i++) { + struct kstat stat; char *p; char comp_name[64]; - u32 rdev; p = strchr(devname, ','); if (p) @@ -150,9 +150,9 @@ static void __init md_setup_drive(void) if (strncmp(devname, "/dev/", 5) == 0) devname += 5; snprintf(comp_name, 63, "/dev/%s", devname); - rdev = bstat(comp_name); - if (rdev) - dev = new_decode_dev(rdev); + if (vfs_stat(comp_name, &stat) == 0 && + S_ISBLK(stat.mode)) + dev = new_decode_dev(stat.rdev); if (!dev) { printk(KERN_WARNING "md: Unknown device name: %s\n", devname); break; |