aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_cil.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_log_cil.c')
-rw-r--r--fs/xfs/xfs_log_cil.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index cfe97973ba36..5eb51fc5eb84 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -17,11 +17,9 @@
17 17
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_log_format.h"
21#include "xfs_log.h" 21#include "xfs_shared.h"
22#include "xfs_trans.h" 22#include "xfs_trans_resv.h"
23#include "xfs_trans_priv.h"
24#include "xfs_log_priv.h"
25#include "xfs_sb.h" 23#include "xfs_sb.h"
26#include "xfs_ag.h" 24#include "xfs_ag.h"
27#include "xfs_mount.h" 25#include "xfs_mount.h"
@@ -29,6 +27,10 @@
29#include "xfs_alloc.h" 27#include "xfs_alloc.h"
30#include "xfs_extent_busy.h" 28#include "xfs_extent_busy.h"
31#include "xfs_discard.h" 29#include "xfs_discard.h"
30#include "xfs_trans.h"
31#include "xfs_trans_priv.h"
32#include "xfs_log.h"
33#include "xfs_log_priv.h"
32 34
33/* 35/*
34 * Allocate a new ticket. Failing to get a new ticket makes it really hard to 36 * Allocate a new ticket. Failing to get a new ticket makes it really hard to
@@ -711,6 +713,20 @@ xlog_cil_push_foreground(
711 xlog_cil_push(log); 713 xlog_cil_push(log);
712} 714}
713 715
716bool
717xlog_cil_empty(
718 struct xlog *log)
719{
720 struct xfs_cil *cil = log->l_cilp;
721 bool empty = false;
722
723 spin_lock(&cil->xc_push_lock);
724 if (list_empty(&cil->xc_cil))
725 empty = true;
726 spin_unlock(&cil->xc_push_lock);
727 return empty;
728}
729
714/* 730/*
715 * Commit a transaction with the given vector to the Committed Item List. 731 * Commit a transaction with the given vector to the Committed Item List.
716 * 732 *