linux/fs/jfs/jfs_txnmgr.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *   Copyright (C) International Business Machines Corp., 2000-2004
 */
#ifndef _H_JFS_TXNMGR
#define _H_JFS_TXNMGR

#include "jfs_logmgr.h"

/*
 * Hide implementation of TxBlock and TxLock
 */
#define tid_to_tblock(tid)

#define lid_to_tlock(lid)

/*
 *	transaction block
 */
struct tblock {};

extern struct tblock *TxBlock;	/* transaction block table */

/* commit flags: tblk->xflag */
#define COMMIT_SYNC
#define COMMIT_FORCE
#define COMMIT_FLUSH
#define COMMIT_MAP
#define COMMIT_PMAP
#define COMMIT_WMAP
#define COMMIT_PWMAP
#define COMMIT_FREE
#define COMMIT_DELETE
#define COMMIT_TRUNCATE
#define COMMIT_CREATE
#define COMMIT_LAZY
#define COMMIT_PAGE
#define COMMIT_INODE

/* group commit flags tblk->flag: see jfs_logmgr.h */

/*
 *	transaction lock
 */
struct tlock {};				/* (64) */

extern struct tlock *TxLock;	/* transaction lock table */

/*
 * tlock flag
 */
/* txLock state */
#define tlckPAGELOCK
#define tlckINODELOCK
#define tlckLINELOCK
#define tlckINLINELOCK
/* lmLog state */
#define tlckLOG
/* updateMap state */
#define tlckUPDATEMAP
#define tlckDIRECTORY
/* freeLock state */
#define tlckFREELOCK
#define tlckWRITEPAGE
#define tlckFREEPAGE

/*
 * tlock type
 */
#define tlckTYPE
#define tlckINODE
#define tlckXTREE
#define tlckDTREE
#define tlckMAP
#define tlckEA
#define tlckACL
#define tlckDATA
#define tlckBTROOT

#define tlckOPERATION
#define tlckGROW
#define tlckREMOVE
#define tlckTRUNCATE
#define tlckRELOCATE
#define tlckENTRY
#define tlckEXTEND
#define tlckSPLIT
#define tlckNEW
#define tlckFREE
#define tlckRELINK

/*
 *	linelock for lmLog()
 *
 * note: linelock and its variations are overlaid
 * at tlock.lock: watch for alignment;
 */
struct lv {};				/* (2) */

#define TLOCKSHORT
#define TLOCKLONG

struct linelock {};				/* (48) */

#define dt_lock

struct xtlock {};				/* (48) */


/*
 *	maplock for txUpdateMap()
 *
 * note: maplock and its variations are overlaid
 * at tlock.lock/linelock: watch for alignment;
 * N.B. next field may be set by linelock, and should not
 * be modified by maplock;
 * N.B. index of the first pxdlock specifies index of next
 * free maplock (i.e., number of maplock) in the tlock;
 */
struct maplock {};				/* (16): */

/* maplock flag */
#define mlckALLOC
#define mlckALLOCXADLIST
#define mlckALLOCPXDLIST
#define mlckALLOCXAD
#define mlckALLOCPXD
#define mlckFREE
#define mlckFREEXADLIST
#define mlckFREEPXDLIST
#define mlckFREEXAD
#define mlckFREEPXD

#define pxd_lock

struct xdlistlock {};				/* (16): */

#define xdlist

/*
 *	commit
 *
 * parameter to the commit manager routines
 */
struct commit {};

/*
 * external declarations
 */
extern int jfs_tlocks_low;

extern int txInit(void);
extern void txExit(void);
extern struct tlock *txLock(tid_t, struct inode *, struct metapage *, int);
extern struct tlock *txMaplock(tid_t, struct inode *, int);
extern int txCommit(tid_t, int, struct inode **, int);
extern tid_t txBegin(struct super_block *, int);
extern void txBeginAnon(struct super_block *);
extern void txEnd(tid_t);
extern void txAbort(tid_t, int);
extern struct linelock *txLinelock(struct linelock *);
extern void txFreeMap(struct inode *, struct maplock *, struct tblock *, int);
extern void txEA(tid_t, struct inode *, dxd_t *, dxd_t *);
extern void txFreelock(struct inode *);
extern int lmLog(struct jfs_log *, struct tblock *, struct lrd *,
		 struct tlock *);
extern void txQuiesce(struct super_block *);
extern void txResume(struct super_block *);
extern void txLazyUnlock(struct tblock *);
extern int jfs_lazycommit(void *);
extern int jfs_sync(void *);
#endif				/* _H_JFS_TXNMGR */