/* Allocate a root ("/") dentry for the inode given. The inode is instantiated and returned. NULL is returned if there is insufficient memory or the inode passed is NULL.  */
struct dentry* d_alloc_root(struct inode *root_inode)
/* Allocate a root ("/") dentry for the inode given. The inode is instantiated and returned. NULL is returned if there is insufficient memory or the inode passed is NULL.  */
struct dentry* d_alloc_root(struct inode *root_inode)
{
	struct dentry *res = NULL;
	if (root_inode) {
		static const struct qstr name = { .name = "/", .len = 1 };
		res = d_alloc(NULL, &name);
		if (res) {
			res->d_sb = root_inode->i_sb;
			res->d_parent = res;
			d_instantiate(res, root_inode);
		}
	}
	return res;
}