From a315571b05c3f38446ff9bce87653f21f731d68a Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 10 Sep 2013 23:45:45 +0400 Subject: [PATCH] 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 --- simple.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simple.c b/simple.c index 01c4da5..5c3231f 100644 --- a/simple.c +++ b/simple.c @@ -714,7 +714,14 @@ int simplefs_fill_super(struct super_block *sb, void *data, int silent) root_inode->i_private = 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); +#else + sb->s_root = d_alloc_root(root_inode); + if (!sb->s_root) + iput(root_inode); +#endif + if (!sb->s_root) return -ENOMEM;