Part of this function is the same as part of "mount_ramfs_mac" function. How about reuse this piece of code in "mount_ramfs_mac"?