]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/xfs/xfs_trans_priv.h
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / fs / xfs / xfs_trans_priv.h
index d91706c56c633a1eb4ed243cf182d2891200e24d..b317a3644c006817d7c6a2ccc3b0e08cc59e2a3f 100644 (file)
@@ -164,4 +164,35 @@ xfs_trans_ail_copy_lsn(
        *dst = *src;
 }
 #endif
+
+static inline void
+xfs_clear_li_failed(
+       struct xfs_log_item     *lip)
+{
+       struct xfs_buf  *bp = lip->li_buf;
+
+       ASSERT(lip->li_flags & XFS_LI_IN_AIL);
+       lockdep_assert_held(&lip->li_ailp->xa_lock);
+
+       if (lip->li_flags & XFS_LI_FAILED) {
+               lip->li_flags &= ~XFS_LI_FAILED;
+               lip->li_buf = NULL;
+               xfs_buf_rele(bp);
+       }
+}
+
+static inline void
+xfs_set_li_failed(
+       struct xfs_log_item     *lip,
+       struct xfs_buf          *bp)
+{
+       lockdep_assert_held(&lip->li_ailp->xa_lock);
+
+       if (!(lip->li_flags & XFS_LI_FAILED)) {
+               xfs_buf_hold(bp);
+               lip->li_flags |= XFS_LI_FAILED;
+               lip->li_buf = bp;
+       }
+}
+
 #endif /* __XFS_TRANS_PRIV_H__ */