Use d_alloc_root() instead of d_make_root() in linux kernel < 3.3

d_alloc_root() is gone in 32991ab305ace7017c62f8eecbe5eb36dc32e13b.

Link: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=32991ab305ace7017c62f8eecbe5eb36dc32e13b
This commit is contained in:
Azat Khuzhin 2013-09-10 23:45:45 +04:00
parent 18df3131a2
commit a315571b05

View File

@ -714,7 +714,14 @@ int simplefs_fill_super(struct super_block *sb, void *data, int silent)
root_inode->i_private = root_inode->i_private =
simplefs_get_inode(sb, SIMPLEFS_ROOTDIR_INODE_NUMBER); simplefs_get_inode(sb, SIMPLEFS_ROOTDIR_INODE_NUMBER);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
sb->s_root = d_make_root(root_inode); sb->s_root = d_make_root(root_inode);
#else
sb->s_root = d_alloc_root(root_inode);
if (!sb->s_root)
iput(root_inode);
#endif
if (!sb->s_root) if (!sb->s_root)
return -ENOMEM; return -ENOMEM;