xfs_log_recover.h 1.4 KB

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