aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_log.h')
-rw-r--r--fs/xfs/xfs_log.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index 97a24c7795a4..916eb7db14d9 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -19,7 +19,6 @@
19#define __XFS_LOG_H__ 19#define __XFS_LOG_H__
20 20
21/* get lsn fields */ 21/* get lsn fields */
22
23#define CYCLE_LSN(lsn) ((uint)((lsn)>>32)) 22#define CYCLE_LSN(lsn) ((uint)((lsn)>>32))
24#define BLOCK_LSN(lsn) ((uint)(lsn)) 23#define BLOCK_LSN(lsn) ((uint)(lsn))
25 24
@@ -56,14 +55,10 @@ static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2)
56/* 55/*
57 * Flags to xfs_log_reserve() 56 * Flags to xfs_log_reserve()
58 * 57 *
59 * XFS_LOG_SLEEP: If space is not available, sleep (default)
60 * XFS_LOG_NOSLEEP: If space is not available, return error
61 * XFS_LOG_PERM_RESERV: Permanent reservation. When writes are 58 * XFS_LOG_PERM_RESERV: Permanent reservation. When writes are
62 * performed against this type of reservation, the reservation 59 * performed against this type of reservation, the reservation
63 * is not decreased. Long running transactions should use this. 60 * is not decreased. Long running transactions should use this.
64 */ 61 */
65#define XFS_LOG_SLEEP 0x0
66#define XFS_LOG_NOSLEEP 0x1
67#define XFS_LOG_PERM_RESERV 0x2 62#define XFS_LOG_PERM_RESERV 0x2
68 63
69/* 64/*
@@ -105,11 +100,20 @@ static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2)
105#define XLOG_REG_TYPE_MAX 19 100#define XLOG_REG_TYPE_MAX 19
106 101
107typedef struct xfs_log_iovec { 102typedef struct xfs_log_iovec {
108 xfs_caddr_t i_addr; /* beginning address of region */ 103 void *i_addr; /* beginning address of region */
109 int i_len; /* length in bytes of region */ 104 int i_len; /* length in bytes of region */
110 uint i_type; /* type of region */ 105 uint i_type; /* type of region */
111} xfs_log_iovec_t; 106} xfs_log_iovec_t;
112 107
108struct xfs_log_vec {
109 struct xfs_log_vec *lv_next; /* next lv in build list */
110 int lv_niovecs; /* number of iovecs in lv */
111 struct xfs_log_iovec *lv_iovecp; /* iovec array */
112 struct xfs_log_item *lv_item; /* owner */
113 char *lv_buf; /* formatted buffer */
114 int lv_buf_len; /* size of formatted buffer */
115};
116
113/* 117/*
114 * Structure used to pass callback function and the function's argument 118 * Structure used to pass callback function and the function's argument
115 * to the log manager. 119 * to the log manager.
@@ -126,6 +130,14 @@ typedef struct xfs_log_callback {
126struct xfs_mount; 130struct xfs_mount;
127struct xlog_in_core; 131struct xlog_in_core;
128struct xlog_ticket; 132struct xlog_ticket;
133struct xfs_log_item;
134struct xfs_item_ops;
135struct xfs_trans;
136
137void xfs_log_item_init(struct xfs_mount *mp,
138 struct xfs_log_item *item,
139 int type,
140 struct xfs_item_ops *ops);
129 141
130xfs_lsn_t xfs_log_done(struct xfs_mount *mp, 142xfs_lsn_t xfs_log_done(struct xfs_mount *mp,
131 struct xlog_ticket *ticket, 143 struct xlog_ticket *ticket,
@@ -174,13 +186,15 @@ int xfs_log_need_covered(struct xfs_mount *mp);
174 186
175void xlog_iodone(struct xfs_buf *); 187void xlog_iodone(struct xfs_buf *);
176 188
177struct xlog_ticket * xfs_log_ticket_get(struct xlog_ticket *ticket); 189struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket);
178void xfs_log_ticket_put(struct xlog_ticket *ticket); 190void xfs_log_ticket_put(struct xlog_ticket *ticket);
179 191
180#endif 192xlog_tid_t xfs_log_get_trans_ident(struct xfs_trans *tp);
181
182
183extern int xlog_debug; /* set to 1 to enable real log */
184 193
194int xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp,
195 struct xfs_log_vec *log_vector,
196 xfs_lsn_t *commit_lsn, int flags);
197bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
185 198
199#endif
186#endif /* __XFS_LOG_H__ */ 200#endif /* __XFS_LOG_H__ */