Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Linux 3.10 compat: replace PDE()->data with PDE_DATA()
Browse files Browse the repository at this point in the history
Linux kernel commit torvalds/linux@d9dda78b renamed PDE() to
PDE_DATA().  To handle this detect the prefered interface
and define a PDE_DATA() wrapper for consistency.

Signed-off-by: Yuxuan Shui <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #257
  • Loading branch information
yshui authored and behlendorf committed Jul 8, 2013
1 parent c02ab72 commit 1ddf972
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions config/spl-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_CTL_UNNUMBERED
SPL_AC_CTL_NAME
SPL_AC_VMALLOC_INFO
SPL_AC_PDE_DATA
SPL_AC_FLS64
SPL_AC_DEVICE_CREATE
SPL_AC_5ARGS_DEVICE_CREATE
Expand Down Expand Up @@ -1377,6 +1378,24 @@ AC_DEFUN([SPL_AC_VMALLOC_INFO], [
])
])

dnl #
dnl # 3.10 API change,
dnl # PDE is replaced by PDE_DATA
dnl #
AC_DEFUN([SPL_AC_PDE_DATA], [
AC_MSG_CHECKING([whether PDE_DATA() is available])
SPL_LINUX_TRY_COMPILE_SYMBOL([
#include <linux/proc_fs.h>
], [
PDE_DATA(NULL);
], [PDE_DATA], [], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PDE_DATA, 1, [yes])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.17 API change
dnl # The helper functions first_online_pgdat(), next_online_pgdat(), and
Expand Down
5 changes: 4 additions & 1 deletion module/spl/spl-kstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#endif

#define SS_DEBUG_SUBSYS SS_KSTAT
#ifndef HAVE_PDE_DATA
#define PDE_DATA(x) (PDE(x)->data)
#endif

static spinlock_t kstat_lock;
static struct list_head kstat_list;
Expand Down Expand Up @@ -359,7 +362,7 @@ proc_kstat_open(struct inode *inode, struct file *filp)
return rc;

f = filp->private_data;
f->private = PDE(inode)->data;
f->private = PDE_DATA(inode);

return rc;
}
Expand Down

0 comments on commit 1ddf972

Please sign in to comment.