Commit 899ac10c authored by Christoph Hellwig's avatar Christoph Hellwig

initrd: remove the BLKFLSBUF call in handle_initrd

BLKFLSBUF used to be overloaded for the ramdisk driver to free the whole
ramdisk, which was completely different behavior compared to all other
drivers.  But this magic overload got removed in commit ff269568
("brd: remove support for BLKFLSBUF"), so this call is entirely
pointless now.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c8376994
...@@ -115,21 +115,12 @@ static void __init handle_initrd(void) ...@@ -115,21 +115,12 @@ static void __init handle_initrd(void)
if (!error) if (!error)
printk("okay\n"); printk("okay\n");
else { else {
int fd = ksys_open("/dev/root.old", O_RDWR, 0);
if (error == -ENOENT) if (error == -ENOENT)
printk("/initrd does not exist. Ignored.\n"); printk("/initrd does not exist. Ignored.\n");
else else
printk("failed\n"); printk("failed\n");
printk(KERN_NOTICE "Unmounting old root\n"); printk(KERN_NOTICE "Unmounting old root\n");
ksys_umount("/old", MNT_DETACH); ksys_umount("/old", MNT_DETACH);
printk(KERN_NOTICE "Trying to free ramdisk memory ... ");
if (fd < 0) {
error = fd;
} else {
error = ksys_ioctl(fd, BLKFLSBUF, 0);
ksys_close(fd);
}
printk(!error ? "okay\n" : "failed\n");
} }
} }
......
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