X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Fautoconf%2Flustre-libcfs.m4;h=5d063ed9592f92e7eaa77a835066ce877ed98451;hp=467874cdc22a28b779143cf30685cb2a1ac17925;hb=6dbf1ffdec1240fbc8a86210b439d31a6c80c8de;hpb=e67c6e366752611ffd2baeb7cefa24c9f289eb78 diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index 467874c..5d063ed 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -508,7 +508,7 @@ AC_DEFUN([LIBCFS_NETWORK_NAMESPACE], LB_LINUX_TRY_COMPILE([ #include ],[ - struct net *net = &init_ns; + struct net *net = &init_net; ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_INIT_NET, 1, @@ -644,6 +644,70 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# LIBCFS_CRED_WRAPPERS +# +# wrappers for task's credentials are in sles11 +# +AC_DEFUN([LIBCFS_CRED_WRAPPERS], +[AC_MSG_CHECKING([if kernel has wrappers for task's credentials]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + uid_t uid; + + uid = current_uid(); +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# +# LN_STRUCT_CRED_IN_TASK +# +# struct cred was introduced in 2.6.29 to streamline credentials in task struct +# +AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK], +[AC_MSG_CHECKING([if kernel has struct cred]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + struct task_struct *tsk = NULL; + tsk->real_cred = NULL; +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# +# LIBCFS_FUNC_UNSHARE_FS_STRUCT +# +# unshare_fs_struct was introduced in 2.6.30 to prevent others to directly +# mess with copy_fs_struct +# +AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT], +[AC_MSG_CHECKING([if kernel defines unshare_fs_struct()]) +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" +LB_LINUX_TRY_COMPILE([ + #include + #include +],[ + unshare_fs_struct(); +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found]) +],[ + AC_MSG_RESULT([no]) +]) +EXTRA_KCFLAGS="$tmp_flags" +]) + # # LIBCFS_PROG_LINUX # @@ -687,6 +751,12 @@ LIBCFS_NETLINK_NETNS LIBCFS_FUNC_DUMP_TRACE # 2.6.26 LIBCFS_SEM_COUNT +# 2.6.27 +LIBCFS_CRED_WRAPPERS +# 2.6.29 +LIBCFS_STRUCT_CRED_IN_TASK +# 2.6.30 +LIBCFS_FUNC_UNSHARE_FS_STRUCT LIBCFS_SOCK_MAP_FD_2ARG ])