Linux 4.12 compat: PF_FSTRANS was removed

Change SPL_FSTRANS to optionally contains PF_FSTRANS. Also, add
__spl_pf_fstrans_check for the checks specifically for PF_FSTRANS.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #614
This commit is contained in:
Chunwei Chen
2017-05-09 10:36:54 -07:00
committed by Brian Behlendorf
parent 3665037f30
commit 8f87971e1f
2 changed files with 39 additions and 10 deletions
+6 -6
View File
@@ -558,13 +558,13 @@ int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4)
* May enter XFS which generates a warning when PF_FSTRANS is set.
* To avoid this the flag is cleared over vfs_sync() and then reset.
*/
fstrans = spl_fstrans_check();
fstrans = __spl_pf_fstrans_check();
if (fstrans)
current->flags &= ~(PF_FSTRANS);
current->flags &= ~(__SPL_PF_FSTRANS);
error = -spl_filp_fsync(vp->v_file, datasync);
if (fstrans)
current->flags |= PF_FSTRANS;
current->flags |= __SPL_PF_FSTRANS;
return (error);
} /* vn_fsync() */
@@ -590,9 +590,9 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag,
* May enter XFS which generates a warning when PF_FSTRANS is set.
* To avoid this the flag is cleared over vfs_sync() and then reset.
*/
fstrans = spl_fstrans_check();
fstrans = __spl_pf_fstrans_check();
if (fstrans)
current->flags &= ~(PF_FSTRANS);
current->flags &= ~(__SPL_PF_FSTRANS);
/*
* When supported by the underlying file system preferentially
@@ -603,7 +603,7 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag,
bfp->l_start, bfp->l_len);
if (fstrans)
current->flags |= PF_FSTRANS;
current->flags |= __SPL_PF_FSTRANS;
if (error == 0)
return (0);