Unbreak build on Linux kernel < 3.10

d12614521a("Fixes for procfs files backed by linked lists")
uses PDE_DATA(), but since PDE_DATA() (public interface which
replaced old public interface PDE()) first appeared in upstream
kernel 3.10, it lacks visible local definition for kernel < 3.10.

Move the local PDE_DATA() definition to a ZoL header, to unbreak
build on kernel < 3.10.

--
module/spl/spl-procfs-list.c: In function 'procfs_list_open':
module/spl/spl-procfs-list.c:166: error: implicit declaration of function 'PDE_DATA'
module/spl/spl-procfs-list.c:166: warning: assignment makes pointer from integer without a cast

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Gallagher <john.gallagher@delphix.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8599
This commit is contained in:
Tomohiro Kusumi 2019-04-09 06:59:24 +09:00 committed by Brian Behlendorf
parent c375c69eca
commit 9a65234c8b
2 changed files with 4 additions and 4 deletions

View File

@ -27,6 +27,10 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#ifndef HAVE_PDE_DATA
#define PDE_DATA(x) (PDE(x)->data)
#endif
extern struct proc_dir_entry *proc_spl_kstat; extern struct proc_dir_entry *proc_spl_kstat;
int spl_proc_init(void); int spl_proc_init(void);

View File

@ -30,10 +30,6 @@
#include <sys/cmn_err.h> #include <sys/cmn_err.h>
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
#ifndef HAVE_PDE_DATA
#define PDE_DATA(x) (PDE(x)->data)
#endif
static kmutex_t kstat_module_lock; static kmutex_t kstat_module_lock;
static struct list_head kstat_module_list; static struct list_head kstat_module_list;
static kid_t kstat_id; static kid_t kstat_id;