Linux 3.4: Switch to d_make_root
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 22 Mar 2012 02:19:04 +0000 (22:19 -0400)
committerDerrick Brashear <shadow@dementix.org>
Thu, 22 Mar 2012 14:05:06 +0000 (07:05 -0700)
If d_make_root is available, use it instead of d_alloc_root.
The helper was introduced in 3.3, and d_alloc_root gets removed
in 3.4.

Change-Id: I39aaa6fd14d04c05ad9cb5b610e7f12f70fe0c94
Reviewed-on: http://gerrit.openafs.org/6931
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

acinclude.m4
src/afs/LINUX/osi_vfsops.c

index 92cad6f..91231ba 100644 (file)
@@ -848,6 +848,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([d_alloc_anon],
                                     [#include <linux/fs.h>],
                                     [d_alloc_anon(NULL);])
+                AC_CHECK_LINUX_FUNC([d_make_root],
+                                    [#include <linux/fs.h>],
+                                    [d_make_root(NULL);])
                 AC_CHECK_LINUX_FUNC([do_sync_read],
                                     [#include <linux/fs.h>],
                                     [do_sync_read(NULL, NULL, 0, NULL);])
index 4c44988..9bdc304 100644 (file)
@@ -184,7 +184,11 @@ afs_root(struct super_block *afsp)
 
                /* setup super_block and mount point inode. */
                afs_globalVp = tvp;
+#if defined(HAVE_LINUX_D_MAKE_ROOT)
+               afsp->s_root = d_make_root(ip);
+#else
                afsp->s_root = d_alloc_root(ip);
+#endif
 #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
                afsp->s_root->d_op = &afs_dentry_operations;
 #endif