mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +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 */
|
||||
|
||||
|
||||
+3
-2
@@ -189,8 +189,9 @@ extern file_t *vn_getf(int fd);
|
||||
extern void vn_releasef(int fd);
|
||||
extern int vn_set_pwd(const char *filename);
|
||||
|
||||
int vn_init(void);
|
||||
void vn_fini(void);
|
||||
int spl_vn_init_kallsyms_lookup(void);
|
||||
int spl_vn_init(void);
|
||||
void spl_vn_fini(void);
|
||||
|
||||
#define VOP_CLOSE vn_close
|
||||
#define VOP_SEEK vn_seek
|
||||
|
||||
Reference in New Issue
Block a user