Linux 3.19 compat: file_inode was added
struct access f->f_dentry->d_inode was replaced by accessor function file_inode(f) Signed-off-by: Joerg Thalheim <joerg@higgsboson.tk> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3084
This commit is contained in:
parent
77aef6f60e
commit
534759fad3
|
@ -0,0 +1,19 @@
|
||||||
|
dnl #
|
||||||
|
dnl # 3.19 API change
|
||||||
|
dnl # struct access f->f_dentry->d_inode was replaced by accessor function
|
||||||
|
dnl # file_inode(f)
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FILE_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether file_inode() is available])
|
||||||
|
ZFS_LINUX_TRY_COMPILE([
|
||||||
|
#include <linux/fs.h>
|
||||||
|
],[
|
||||||
|
struct file *f = NULL;
|
||||||
|
file_inode(f);
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_FILE_INODE, 1, [file_inode() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
|
@ -61,6 +61,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
||||||
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
||||||
ZFS_AC_KERNEL_CURRENT_UMASK
|
ZFS_AC_KERNEL_CURRENT_UMASK
|
||||||
ZFS_AC_KERNEL_SHOW_OPTIONS
|
ZFS_AC_KERNEL_SHOW_OPTIONS
|
||||||
|
ZFS_AC_KERNEL_FILE_INODE
|
||||||
ZFS_AC_KERNEL_FSYNC
|
ZFS_AC_KERNEL_FSYNC
|
||||||
ZFS_AC_KERNEL_EVICT_INODE
|
ZFS_AC_KERNEL_EVICT_INODE
|
||||||
ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS
|
ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2011 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2011 Lawrence Livermore National Security, LLC.
|
||||||
|
* Copyright (C) 2015 Jörg Thalheim.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ZFS_VFS_H
|
#ifndef _ZFS_VFS_H
|
||||||
|
@ -328,4 +329,16 @@ current_umask(void)
|
||||||
#define zpl_inode_owner_or_capable(ip) is_owner_or_cap(ip)
|
#define zpl_inode_owner_or_capable(ip) is_owner_or_cap(ip)
|
||||||
#endif /* HAVE_INODE_OWNER_OR_CAPABLE */
|
#endif /* HAVE_INODE_OWNER_OR_CAPABLE */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 3.19 API change
|
||||||
|
* struct access f->f_dentry->d_inode was replaced by accessor function
|
||||||
|
* file_inode(f)
|
||||||
|
*/
|
||||||
|
#ifndef HAVE_FILE_INODE
|
||||||
|
static inline struct inode *file_inode(const struct file *f)
|
||||||
|
{
|
||||||
|
return (f->f_dentry->d_inode);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_FILE_INODE */
|
||||||
|
|
||||||
#endif /* _ZFS_VFS_H */
|
#endif /* _ZFS_VFS_H */
|
||||||
|
|
|
@ -617,7 +617,7 @@ zpl_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
|
||||||
static int
|
static int
|
||||||
zpl_ioctl_getflags(struct file *filp, void __user *arg)
|
zpl_ioctl_getflags(struct file *filp, void __user *arg)
|
||||||
{
|
{
|
||||||
struct inode *ip = filp->f_dentry->d_inode;
|
struct inode *ip = file_inode(filp);
|
||||||
unsigned int ioctl_flags = 0;
|
unsigned int ioctl_flags = 0;
|
||||||
uint64_t zfs_flags = ITOZ(ip)->z_pflags;
|
uint64_t zfs_flags = ITOZ(ip)->z_pflags;
|
||||||
int error;
|
int error;
|
||||||
|
@ -653,7 +653,7 @@ zpl_ioctl_getflags(struct file *filp, void __user *arg)
|
||||||
static int
|
static int
|
||||||
zpl_ioctl_setflags(struct file *filp, void __user *arg)
|
zpl_ioctl_setflags(struct file *filp, void __user *arg)
|
||||||
{
|
{
|
||||||
struct inode *ip = filp->f_dentry->d_inode;
|
struct inode *ip = file_inode(filp);
|
||||||
uint64_t zfs_flags = ITOZ(ip)->z_pflags;
|
uint64_t zfs_flags = ITOZ(ip)->z_pflags;
|
||||||
unsigned int ioctl_flags;
|
unsigned int ioctl_flags;
|
||||||
cred_t *cr = CRED();
|
cred_t *cr = CRED();
|
||||||
|
|
Loading…
Reference in New Issue