1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000,2005 Silicon Graphics, Inc.
6 #ifndef __XFS_LOG_RECOVER_H__
7 #define __XFS_LOG_RECOVER_H__
10 * Macros, structures, prototypes for internal log manager use.
13 #define XLOG_RHASH_BITS 4
14 #define XLOG_RHASH_SIZE 16
15 #define XLOG_RHASH_SHIFT 2
16 #define XLOG_RHASH(tid) \
17 ((((uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
19 #define XLOG_MAX_REGIONS_IN_ITEM (XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK / 2 + 1)
23 * item headers are in ri_buf[0]. Additional buffers follow.
25 typedef struct xlog_recover_item
{
26 struct list_head ri_list
;
28 int ri_cnt
; /* count of regions found */
29 int ri_total
; /* total regions */
30 xfs_log_iovec_t
*ri_buf
; /* ptr to regions buffer */
31 } xlog_recover_item_t
;
33 typedef struct xlog_recover
{
34 struct hlist_node r_list
;
35 xlog_tid_t r_log_tid
; /* log's transaction id */
36 xfs_trans_header_t r_theader
; /* trans header for partial */
37 int r_state
; /* not needed */
38 xfs_lsn_t r_lsn
; /* xact lsn */
39 struct list_head r_itemq
; /* q for items */
42 #define ITEM_TYPE(i) (*(unsigned short *)(i)->ri_buf[0].i_addr)
45 * This is the number of entries in the l_buf_cancel_table used during
48 #define XLOG_BC_TABLE_SIZE 64
50 #define XLOG_RECOVER_CRCPASS 0
51 #define XLOG_RECOVER_PASS1 1
52 #define XLOG_RECOVER_PASS2 2
54 #endif /* __XFS_LOG_RECOVER_H__ */