linux/fs/xfs/libxfs/xfs_log_recover.h

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2000,2005 Silicon Graphics, Inc.
 * All Rights Reserved.
 */
#ifndef	__XFS_LOG_RECOVER_H__
#define __XFS_LOG_RECOVER_H__

/*
 * Each log item type (XFS_LI_*) gets its own xlog_recover_item_ops to
 * define how recovery should work for that type of log item.
 */
struct xlog_recover_item;
struct xfs_defer_op_type;

/* Sorting hat for log items as they're read in. */
enum xlog_recover_reorder {};

struct xlog_recover_item_ops {};

extern const struct xlog_recover_item_ops xlog_icreate_item_ops;
extern const struct xlog_recover_item_ops xlog_buf_item_ops;
extern const struct xlog_recover_item_ops xlog_inode_item_ops;
extern const struct xlog_recover_item_ops xlog_dquot_item_ops;
extern const struct xlog_recover_item_ops xlog_quotaoff_item_ops;
extern const struct xlog_recover_item_ops xlog_bui_item_ops;
extern const struct xlog_recover_item_ops xlog_bud_item_ops;
extern const struct xlog_recover_item_ops xlog_efi_item_ops;
extern const struct xlog_recover_item_ops xlog_efd_item_ops;
extern const struct xlog_recover_item_ops xlog_rui_item_ops;
extern const struct xlog_recover_item_ops xlog_rud_item_ops;
extern const struct xlog_recover_item_ops xlog_cui_item_ops;
extern const struct xlog_recover_item_ops xlog_cud_item_ops;
extern const struct xlog_recover_item_ops xlog_attri_item_ops;
extern const struct xlog_recover_item_ops xlog_attrd_item_ops;
extern const struct xlog_recover_item_ops xlog_xmi_item_ops;
extern const struct xlog_recover_item_ops xlog_xmd_item_ops;

/*
 * Macros, structures, prototypes for internal log manager use.
 */

#define XLOG_RHASH_BITS
#define XLOG_RHASH_SIZE
#define XLOG_RHASH_SHIFT
#define XLOG_RHASH(tid)

#define XLOG_MAX_REGIONS_IN_ITEM


/*
 * item headers are in ri_buf[0].  Additional buffers follow.
 */
struct xlog_recover_item {};

struct xlog_recover {};

#define ITEM_TYPE(i)

#define XLOG_RECOVER_CRCPASS
#define XLOG_RECOVER_PASS1
#define XLOG_RECOVER_PASS2

void xlog_buf_readahead(struct xlog *log, xfs_daddr_t blkno, uint len,
		const struct xfs_buf_ops *ops);
bool xlog_is_buffer_cancelled(struct xlog *log, xfs_daddr_t blkno, uint len);

int xlog_recover_iget(struct xfs_mount *mp, xfs_ino_t ino,
		struct xfs_inode **ipp);
int xlog_recover_iget_handle(struct xfs_mount *mp, xfs_ino_t ino, uint32_t gen,
		struct xfs_inode **ipp);
void xlog_recover_release_intent(struct xlog *log, unsigned short intent_type,
		uint64_t intent_id);
int xlog_alloc_buf_cancel_table(struct xlog *log);
void xlog_free_buf_cancel_table(struct xlog *log);

#ifdef DEBUG
void xlog_check_buf_cancel_table(struct xlog *log);
#else
#define xlog_check_buf_cancel_table
#endif

/*
 * Transform a regular reservation into one suitable for recovery of a log
 * intent item.
 *
 * Intent recovery only runs a single step of the transaction chain and defers
 * the rest to a separate transaction.  Therefore, we reduce logcount to 1 here
 * to avoid livelocks if the log grant space is nearly exhausted due to the
 * recovered intent pinning the tail.  Keep the same logflags to avoid tripping
 * asserts elsewhere.  Struct copies abound below.
 */
static inline struct xfs_trans_res
xlog_recover_resv(const struct xfs_trans_res *r)
{}

struct xfs_defer_pending;

void xlog_recover_intent_item(struct xlog *log, struct xfs_log_item *lip,
		xfs_lsn_t lsn, const struct xfs_defer_op_type *ops);
int xlog_recover_finish_intent(struct xfs_trans *tp,
		struct xfs_defer_pending *dfp);

#endif	/* __XFS_LOG_RECOVER_H__ */