diff options
Diffstat (limited to 'fs/xfs/xfs_log.h')
-rw-r--r-- | fs/xfs/xfs_log.h | 36 |
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 | ||
107 | typedef struct xfs_log_iovec { | 102 | typedef 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 | ||
108 | struct 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 { | |||
126 | struct xfs_mount; | 130 | struct xfs_mount; |
127 | struct xlog_in_core; | 131 | struct xlog_in_core; |
128 | struct xlog_ticket; | 132 | struct xlog_ticket; |
133 | struct xfs_log_item; | ||
134 | struct xfs_item_ops; | ||
135 | struct xfs_trans; | ||
136 | |||
137 | void 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 | ||
130 | xfs_lsn_t xfs_log_done(struct xfs_mount *mp, | 142 | xfs_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 | ||
175 | void xlog_iodone(struct xfs_buf *); | 187 | void xlog_iodone(struct xfs_buf *); |
176 | 188 | ||
177 | struct xlog_ticket * xfs_log_ticket_get(struct xlog_ticket *ticket); | 189 | struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket); |
178 | void xfs_log_ticket_put(struct xlog_ticket *ticket); | 190 | void xfs_log_ticket_put(struct xlog_ticket *ticket); |
179 | 191 | ||
180 | #endif | 192 | xlog_tid_t xfs_log_get_trans_ident(struct xfs_trans *tp); |
181 | |||
182 | |||
183 | extern int xlog_debug; /* set to 1 to enable real log */ | ||
184 | 193 | ||
194 | int 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); | ||
197 | bool 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__ */ |