mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Linux 3.1 compat, kern_path_parent()
Prior to Linux 3.1 the kern_path_parent symbol was exported for use by kernel modules. As of Linux 3.1 it is now longer easily available. To handle this case the spl will now dynamically look up address of the missing symbol at module load time. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #52
This commit is contained in:
@@ -67,11 +67,17 @@ spl_filp_open(const char *name, int flags, int mode, int *err)
|
||||
#define spl_inode_unlock(ip) (up(&(ip)->i_sem))
|
||||
#endif /* HAVE_INODE_I_MUTEX */
|
||||
|
||||
#ifdef HAVE_KERN_PATH_PARENT
|
||||
#define spl_kern_path_parent(path, nd) kern_path_parent(path, nd)
|
||||
#ifdef HAVE_KERN_PATH_PARENT_HEADER
|
||||
# ifndef HAVE_KERN_PATH_PARENT_SYMBOL
|
||||
typedef int (*kern_path_parent_t)(const char *, struct nameidata *);
|
||||
extern kern_path_parent_t kern_path_parent_fn;
|
||||
# define spl_kern_path_parent(path, nd) kern_path_parent_fn(path, nd)
|
||||
# else
|
||||
# define spl_kern_path_parent(path, nd) kern_path_parent(path, nd)
|
||||
# endif /* HAVE_KERN_PATH_PARENT_SYMBOL */
|
||||
#else
|
||||
#define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd)
|
||||
#endif /* HAVE_KERN_PATH_PARENT */
|
||||
# define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd)
|
||||
#endif /* HAVE_KERN_PATH_PARENT_HEADER */
|
||||
|
||||
#endif /* SPL_FILE_COMPAT_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user