zil.h 1.4 KB

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