From: Sunil Mushran Date: Mon Dec 31 14:25:57 2007 Subject: [Ocfs2-devel] [PATCH 15/30] ocfs2: Handles configfs_depend_item() and configfs_undepend_item() In-Reply-To: <1199139862-31452-1-git-send-email-sunil.mushran@oracle.com> References: <1199139862-31452-1-git-send-email-sunil.mushran@oracle.com> Message-ID: <1199139862-31452-14-git-send-email-sunil.mushran@oracle.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ocfs2-devel@oss.oracle.com Commit 631d1febab8e546e3bb800bdfe2c212b8adf87de in mainline introduces two new calls in configfs, configfs_depend_item() and configfs_undepend_item(). This patch allows one to build ocfs2 with kernels having/not having this change. Signed-off-by: Sunil Mushran Signed-off-by: Joel Becker --- Makefile | 3 ++- configure.in | 5 +++++ kapi-compat/include/configfs.h | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletions(-) create mode 100644 kapi-compat/include/configfs.h diff --git a/Makefile b/Makefile index 8823752..cbb99be 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/drop_nlink.h \ kapi-compat/include/slab.h \ kapi-compat/include/fstype.h \ - kapi-compat/include/sysctl.h + kapi-compat/include/sysctl.h \ + kapi-compat/include/configfs.h PATCH_FILES = diff --git a/configure.in b/configure.in index 8f6eb37..eb8fe18 100644 --- a/configure.in +++ b/configure.in @@ -220,6 +220,11 @@ OCFS2_CHECK_KERNEL([enum FS_OCFS2 in sysctl.h], sysctl.h, , sysctl_compat_header="sysctl.h", [FS_OCFS2]) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $sysctl_compat_header" +configfs_compat_header="" +OCFS2_CHECK_KERNEL([configfs_depend_item() in configfs.h], configfs.h, + , configfs_compat_header="configfs.h", [configfs_depend_item()]) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $configfs_compat_header" + # using -include has two advantages: # the source doesn't need to know to include compat headers # the compat header file names don't go through the search path diff --git a/kapi-compat/include/configfs.h b/kapi-compat/include/configfs.h new file mode 100644 index 0000000..cbc11e6 --- /dev/null +++ b/kapi-compat/include/configfs.h @@ -0,0 +1,7 @@ +#ifndef KAPI_CONFIGFS_H +#define KAPI_CONFIGFS_H + +#define configfs_depend_item(a, b) (0) +#define configfs_undepend_item(a, b) + +#endif -- 1.5.3.4