xfs: need to see iclog flags in tracing
[linux-2.6-microblaze.git] / fs / xfs / xfs_log_priv.h
index 1c6fdbf..f3e79a4 100644 (file)
@@ -50,6 +50,26 @@ enum xlog_iclog_state {
        XLOG_STATE_IOERROR,     /* IO error happened in sync'ing log */
 };
 
+#define XLOG_STATE_STRINGS \
+       { XLOG_STATE_ACTIVE,    "XLOG_STATE_ACTIVE" }, \
+       { XLOG_STATE_WANT_SYNC, "XLOG_STATE_WANT_SYNC" }, \
+       { XLOG_STATE_SYNCING,   "XLOG_STATE_SYNCING" }, \
+       { XLOG_STATE_DONE_SYNC, "XLOG_STATE_DONE_SYNC" }, \
+       { XLOG_STATE_CALLBACK,  "XLOG_STATE_CALLBACK" }, \
+       { XLOG_STATE_DIRTY,     "XLOG_STATE_DIRTY" }, \
+       { XLOG_STATE_IOERROR,   "XLOG_STATE_IOERROR" }
+
+/*
+ * In core log flags
+ */
+#define XLOG_ICL_NEED_FLUSH    (1 << 0)        /* iclog needs REQ_PREFLUSH */
+#define XLOG_ICL_NEED_FUA      (1 << 1)        /* iclog needs REQ_FUA */
+
+#define XLOG_ICL_STRINGS \
+       { XLOG_ICL_NEED_FLUSH,  "XLOG_ICL_NEED_FLUSH" }, \
+       { XLOG_ICL_NEED_FUA,    "XLOG_ICL_NEED_FUA" }
+
+
 /*
  * Log ticket flags
  */
@@ -201,10 +221,8 @@ typedef struct xlog_in_core {
        u32                     ic_size;
        u32                     ic_offset;
        enum xlog_iclog_state   ic_state;
+       unsigned int            ic_flags;
        char                    *ic_datap;      /* pointer to iclog data */
-
-       /* Callback structures need their own cacheline */
-       spinlock_t              ic_callback_lock ____cacheline_aligned_in_smp;
        struct list_head        ic_callbacks;
 
        /* reference counts need their own cacheline */
@@ -230,7 +248,7 @@ struct xfs_cil;
 
 struct xfs_cil_ctx {
        struct xfs_cil          *cil;
-       xfs_lsn_t               sequence;       /* chkpt sequence # */
+       xfs_csn_t               sequence;       /* chkpt sequence # */
        xfs_lsn_t               start_lsn;      /* first LSN of chkpt commit */
        xfs_lsn_t               commit_lsn;     /* chkpt commit record lsn */
        struct xlog_ticket      *ticket;        /* chkpt ticket */
@@ -268,10 +286,10 @@ struct xfs_cil {
        struct xfs_cil_ctx      *xc_ctx;
 
        spinlock_t              xc_push_lock ____cacheline_aligned_in_smp;
-       xfs_lsn_t               xc_push_seq;
+       xfs_csn_t               xc_push_seq;
        struct list_head        xc_committing;
        wait_queue_head_t       xc_commit_wait;
-       xfs_lsn_t               xc_current_sequence;
+       xfs_csn_t               xc_current_sequence;
        struct work_struct      xc_push_work;
        wait_queue_head_t       xc_push_wait;   /* background push throttle */
 } ____cacheline_aligned_in_smp;
@@ -436,6 +454,8 @@ struct xlog {
 #endif
        /* log recovery lsn tracking (for buffer submission */
        xfs_lsn_t               l_recovery_lsn;
+
+       uint32_t                l_iclog_roundoff;/* padding roundoff */
 };
 
 #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \
@@ -478,13 +498,15 @@ void      xlog_print_tic_res(struct xfs_mount *mp, struct xlog_ticket *ticket);
 void   xlog_print_trans(struct xfs_trans *);
 int    xlog_write(struct xlog *log, struct xfs_log_vec *log_vector,
                struct xlog_ticket *tic, xfs_lsn_t *start_lsn,
-               struct xlog_in_core **commit_iclog, uint flags,
-               bool need_start_rec);
+               struct xlog_in_core **commit_iclog, uint optype);
 int    xlog_commit_record(struct xlog *log, struct xlog_ticket *ticket,
                struct xlog_in_core **iclog, xfs_lsn_t *lsn);
 void   xfs_log_ticket_ungrant(struct xlog *log, struct xlog_ticket *ticket);
 void   xfs_log_ticket_regrant(struct xlog *log, struct xlog_ticket *ticket);
 
+int xlog_state_release_iclog(struct xlog *log, struct xlog_in_core *iclog,
+               xfs_lsn_t log_tail_lsn);
+
 /*
  * When we crack an atomic LSN, we sample it first so that the value will not
  * change while we are cracking it into the component values. This means we
@@ -547,19 +569,18 @@ int       xlog_cil_init(struct xlog *log);
 void   xlog_cil_init_post_recovery(struct xlog *log);
 void   xlog_cil_destroy(struct xlog *log);
 bool   xlog_cil_empty(struct xlog *log);
+void   xlog_cil_commit(struct xlog *log, struct xfs_trans *tp,
+                       xfs_csn_t *commit_seq, bool regrant);
 
 /*
  * CIL force routines
  */
-xfs_lsn_t
-xlog_cil_force_lsn(
-       struct xlog *log,
-       xfs_lsn_t sequence);
+xfs_lsn_t xlog_cil_force_seq(struct xlog *log, xfs_csn_t sequence);
 
 static inline void
 xlog_cil_force(struct xlog *log)
 {
-       xlog_cil_force_lsn(log, log->l_cilp->xc_current_sequence);
+       xlog_cil_force_seq(log, log->l_cilp->xc_current_sequence);
 }
 
 /*
@@ -582,6 +603,8 @@ xlog_wait(
        remove_wait_queue(wq, &wait);
 }
 
+int xlog_wait_on_iclog(struct xlog_in_core *iclog);
+
 /*
  * The LSN is valid so long as it is behind the current LSN. If it isn't, this
  * means that the next log record that includes this metadata could have a