zil.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /*
  8. * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  9. * Use is subject to license terms.
  10. */
  11. #ifndef _SYS_ZIL_H
  12. #define _SYS_ZIL_H
  13. /*
  14. * Intent log format:
  15. *
  16. * Each objset has its own intent log. The log header (zil_header_t)
  17. * for objset N's intent log is kept in the Nth object of the SPA's
  18. * intent_log objset. The log header points to a chain of log blocks,
  19. * each of which contains log records (i.e., transactions) followed by
  20. * a log block trailer (zil_trailer_t). The format of a log record
  21. * depends on the record (or transaction) type, but all records begin
  22. * with a common structure that defines the type, length, and txg.
  23. */
  24. /*
  25. * Intent log header - this on disk structure holds fields to manage
  26. * the log. All fields are 64 bit to easily handle cross architectures.
  27. */
  28. typedef struct zil_header {
  29. uint64_t zh_claim_txg; /* txg in which log blocks were claimed */
  30. uint64_t zh_replay_seq; /* highest replayed sequence number */
  31. blkptr_t zh_log; /* log chain */
  32. uint64_t zh_claim_seq; /* highest claimed sequence number */
  33. uint64_t zh_flags; /* header flags */
  34. uint64_t zh_pad[4];
  35. } zil_header_t;
  36. /*
  37. * zh_flags bit settings
  38. */
  39. #define ZIL_REPLAY_NEEDED 0x1 /* replay needed - internal only */
  40. #endif /* _SYS_ZIL_H */