Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
0004  * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
0005  */
0006 
0007 #ifndef __TRANS_DOT_H__
0008 #define __TRANS_DOT_H__
0009 
0010 #include <linux/buffer_head.h>
0011 struct gfs2_sbd;
0012 struct gfs2_rgrpd;
0013 struct gfs2_glock;
0014 
0015 #define RES_DINODE  1
0016 #define RES_INDIRECT    1
0017 #define RES_JDATA   1
0018 #define RES_DATA    1
0019 #define RES_LEAF    1
0020 #define RES_RG_HDR  1
0021 #define RES_RG_BIT  2
0022 #define RES_EATTR   1
0023 #define RES_STATFS  1
0024 #define RES_QUOTA   2
0025 
0026 /* reserve either the number of blocks to be allocated plus the rg header
0027  * block, or all of the blocks in the rg, whichever is smaller */
0028 static inline unsigned int gfs2_rg_blocks(const struct gfs2_inode *ip, unsigned requested)
0029 {
0030     struct gfs2_rgrpd *rgd = ip->i_res.rs_rgd;
0031 
0032     if (requested < rgd->rd_length)
0033         return requested + 1;
0034     return rgd->rd_length;
0035 }
0036 
0037 extern int __gfs2_trans_begin(struct gfs2_trans *tr, struct gfs2_sbd *sdp,
0038                   unsigned int blocks, unsigned int revokes,
0039                   unsigned long ip);
0040 extern int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
0041                 unsigned int revokes);
0042 
0043 extern void gfs2_trans_end(struct gfs2_sbd *sdp);
0044 extern void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh);
0045 extern void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh);
0046 extern void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd);
0047 extern void gfs2_trans_remove_revoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len);
0048 extern void gfs2_trans_free(struct gfs2_sbd *sdp, struct gfs2_trans *tr);
0049 
0050 #endif /* __TRANS_DOT_H__ */