1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 24d3c95f5SJorgen Lundman /* 34d3c95f5SJorgen Lundman * GRUB -- GRand Unified Bootloader 44d3c95f5SJorgen Lundman * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. 54d3c95f5SJorgen Lundman */ 64d3c95f5SJorgen Lundman /* 74d3c95f5SJorgen Lundman * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 84d3c95f5SJorgen Lundman * Use is subject to license terms. 94d3c95f5SJorgen Lundman */ 104d3c95f5SJorgen Lundman 114d3c95f5SJorgen Lundman #ifndef _SYS_ZIL_H 124d3c95f5SJorgen Lundman #define _SYS_ZIL_H 134d3c95f5SJorgen Lundman 144d3c95f5SJorgen Lundman /* 154d3c95f5SJorgen Lundman * Intent log format: 164d3c95f5SJorgen Lundman * 174d3c95f5SJorgen Lundman * Each objset has its own intent log. The log header (zil_header_t) 184d3c95f5SJorgen Lundman * for objset N's intent log is kept in the Nth object of the SPA's 194d3c95f5SJorgen Lundman * intent_log objset. The log header points to a chain of log blocks, 204d3c95f5SJorgen Lundman * each of which contains log records (i.e., transactions) followed by 214d3c95f5SJorgen Lundman * a log block trailer (zil_trailer_t). The format of a log record 224d3c95f5SJorgen Lundman * depends on the record (or transaction) type, but all records begin 234d3c95f5SJorgen Lundman * with a common structure that defines the type, length, and txg. 244d3c95f5SJorgen Lundman */ 254d3c95f5SJorgen Lundman 264d3c95f5SJorgen Lundman /* 274d3c95f5SJorgen Lundman * Intent log header - this on disk structure holds fields to manage 284d3c95f5SJorgen Lundman * the log. All fields are 64 bit to easily handle cross architectures. 294d3c95f5SJorgen Lundman */ 304d3c95f5SJorgen Lundman typedef struct zil_header { 314d3c95f5SJorgen Lundman uint64_t zh_claim_txg; /* txg in which log blocks were claimed */ 324d3c95f5SJorgen Lundman uint64_t zh_replay_seq; /* highest replayed sequence number */ 334d3c95f5SJorgen Lundman blkptr_t zh_log; /* log chain */ 344d3c95f5SJorgen Lundman uint64_t zh_claim_seq; /* highest claimed sequence number */ 354d3c95f5SJorgen Lundman uint64_t zh_flags; /* header flags */ 364d3c95f5SJorgen Lundman uint64_t zh_pad[4]; 374d3c95f5SJorgen Lundman } zil_header_t; 384d3c95f5SJorgen Lundman 394d3c95f5SJorgen Lundman /* 404d3c95f5SJorgen Lundman * zh_flags bit settings 414d3c95f5SJorgen Lundman */ 424d3c95f5SJorgen Lundman #define ZIL_REPLAY_NEEDED 0x1 /* replay needed - internal only */ 434d3c95f5SJorgen Lundman 444d3c95f5SJorgen Lundman #endif /* _SYS_ZIL_H */ 45