SPL_AC_SHRINK_CONTROL_STRUCT
SPL_AC_RWSEM_SPINLOCK_IS_RAW
SPL_AC_SCHED_RT_HEADER
+ SPL_AC_2ARGS_VFS_GETATTR
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
AC_MSG_RESULT(no)
])
])
+
+dnl #
+dnl # 3.9 API change,
+dnl # vfs_getattr() uses 2 args
+dnl # It takes struct path * instead of struct vfsmount * and struct dentry *
+dnl #
+AC_DEFUN([SPL_AC_2ARGS_VFS_GETATTR], [
+ AC_MSG_CHECKING([whether vfs_getattr() wants])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ vfs_getattr((struct path *) NULL,
+ (struct kstat *)NULL);
+ ],[
+ AC_MSG_RESULT(2 args)
+ AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
+ [vfs_getattr wants 2 args])
+ ],[
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ vfs_getattr((struct vfsmount *)NULL,
+ (struct dentry *)NULL,
+ (struct kstat *)NULL);
+ ],[
+ AC_MSG_RESULT(3 args)
+ ],[
+ AC_MSG_ERROR(unknown)
+ ])
+ ])
+])
if (IS_ERR(fp))
SRETURN(-PTR_ERR(fp));
+#ifdef HAVE_2ARGS_VFS_GETATTR
+ rc = vfs_getattr(&fp->f_path, &stat);
+#else
rc = vfs_getattr(fp->f_path.mnt, fp->f_dentry, &stat);
+#endif
if (rc) {
filp_close(fp, 0);
SRETURN(-rc);
fp = vp->v_file;
- rc = vfs_getattr(fp->f_path.mnt, fp->f_dentry, &stat);
+#ifdef HAVE_2ARGS_VFS_GETATTR
+ rc = vfs_getattr(&fp->f_path, &stat);
+#else
+ rc = vfs_getattr(fp->f_path.mnt, fp->f_dentry, &stat);
+#endif
if (rc)
SRETURN(-rc);
if (vp == NULL)
SGOTO(out_fget, rc);
- if (vfs_getattr(lfp->f_path.mnt, lfp->f_dentry, &stat))
+#ifdef HAVE_2ARGS_VFS_GETATTR
+ rc = vfs_getattr(&lfp->f_path, &stat);
+#else
+ rc = vfs_getattr(lfp->f_path.mnt, lfp->f_dentry, &stat);
+#endif
+ if (rc)
SGOTO(out_vnode, rc);
mutex_enter(&vp->v_lock);