Commit 881627f3 authored by Christoph Hellwig's avatar Christoph Hellwig

init: remove the bstat helper

The only caller of the bstat function becomes cleaner and simpler when
open coding the function.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarNeilBrown <neilb@suse.de>
Acked-by: default avatarSong Liu <song@kernel.org>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9e96c8c0
...@@ -20,16 +20,6 @@ static inline int create_dev(char *name, dev_t dev) ...@@ -20,16 +20,6 @@ static inline int create_dev(char *name, dev_t dev)
return ksys_mknod(name, S_IFBLK|0600, new_encode_dev(dev)); return ksys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
} }
static inline u32 bstat(char *name)
{
struct kstat stat;
if (vfs_stat(name, &stat) != 0)
return 0;
if (!S_ISBLK(stat.mode))
return 0;
return stat.rdev;
}
#ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_RAM
int __init rd_load_disk(int n); int __init rd_load_disk(int n);
......
...@@ -138,9 +138,9 @@ static void __init md_setup_drive(void) ...@@ -138,9 +138,9 @@ static void __init md_setup_drive(void)
dev = MKDEV(MD_MAJOR, minor); dev = MKDEV(MD_MAJOR, minor);
create_dev(name, dev); create_dev(name, dev);
for (i = 0; i < MD_SB_DISKS && devname != NULL; i++) { for (i = 0; i < MD_SB_DISKS && devname != NULL; i++) {
struct kstat stat;
char *p; char *p;
char comp_name[64]; char comp_name[64];
u32 rdev;
p = strchr(devname, ','); p = strchr(devname, ',');
if (p) if (p)
...@@ -150,9 +150,9 @@ static void __init md_setup_drive(void) ...@@ -150,9 +150,9 @@ static void __init md_setup_drive(void)
if (strncmp(devname, "/dev/", 5) == 0) if (strncmp(devname, "/dev/", 5) == 0)
devname += 5; devname += 5;
snprintf(comp_name, 63, "/dev/%s", devname); snprintf(comp_name, 63, "/dev/%s", devname);
rdev = bstat(comp_name); if (vfs_stat(comp_name, &stat) == 0 &&
if (rdev) S_ISBLK(stat.mode))
dev = new_decode_dev(rdev); dev = new_decode_dev(stat.rdev);
if (!dev) { if (!dev) {
printk(KERN_WARNING "md: Unknown device name: %s\n", devname); printk(KERN_WARNING "md: Unknown device name: %s\n", devname);
break; break;
......
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