0001
0002
0003
0004
0005
0006
0007 #ifndef __XFS_SHARED_H__
0008 #define __XFS_SHARED_H__
0009
0010
0011
0012
0013
0014 struct xfs_ifork;
0015 struct xfs_buf;
0016 struct xfs_buf_ops;
0017 struct xfs_mount;
0018 struct xfs_trans;
0019 struct xfs_inode;
0020
0021
0022
0023
0024 extern const struct xfs_buf_ops xfs_agf_buf_ops;
0025 extern const struct xfs_buf_ops xfs_agfl_buf_ops;
0026 extern const struct xfs_buf_ops xfs_agi_buf_ops;
0027 extern const struct xfs_buf_ops xfs_attr3_leaf_buf_ops;
0028 extern const struct xfs_buf_ops xfs_attr3_rmt_buf_ops;
0029 extern const struct xfs_buf_ops xfs_bmbt_buf_ops;
0030 extern const struct xfs_buf_ops xfs_bnobt_buf_ops;
0031 extern const struct xfs_buf_ops xfs_cntbt_buf_ops;
0032 extern const struct xfs_buf_ops xfs_da3_node_buf_ops;
0033 extern const struct xfs_buf_ops xfs_dquot_buf_ops;
0034 extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops;
0035 extern const struct xfs_buf_ops xfs_finobt_buf_ops;
0036 extern const struct xfs_buf_ops xfs_inobt_buf_ops;
0037 extern const struct xfs_buf_ops xfs_inode_buf_ops;
0038 extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
0039 extern const struct xfs_buf_ops xfs_refcountbt_buf_ops;
0040 extern const struct xfs_buf_ops xfs_rmapbt_buf_ops;
0041 extern const struct xfs_buf_ops xfs_rtbuf_ops;
0042 extern const struct xfs_buf_ops xfs_sb_buf_ops;
0043 extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
0044 extern const struct xfs_buf_ops xfs_symlink_buf_ops;
0045
0046
0047 int xfs_log_calc_unit_res(struct xfs_mount *mp, int unit_bytes);
0048 int xfs_log_calc_minimum_size(struct xfs_mount *);
0049
0050 struct xfs_trans_res;
0051 void xfs_log_get_max_trans_res(struct xfs_mount *mp,
0052 struct xfs_trans_res *max_resp);
0053
0054
0055
0056
0057
0058 #define XFS_TRANS_DIRTY (1u << 0)
0059
0060 #define XFS_TRANS_SB_DIRTY (1u << 1)
0061
0062 #define XFS_TRANS_PERM_LOG_RES (1u << 2)
0063
0064 #define XFS_TRANS_SYNC (1u << 3)
0065
0066 #define XFS_TRANS_RESERVE (1u << 4)
0067
0068 #define XFS_TRANS_NO_WRITECOUNT (1u << 5)
0069
0070 #define XFS_TRANS_RES_FDBLKS (1u << 6)
0071
0072 #define XFS_TRANS_HAS_INTENT_DONE (1u << 7)
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 #define XFS_TRANS_LOWMODE 0x100
0086
0087
0088
0089
0090 #define XFS_TRANS_SB_ICOUNT 0x00000001
0091 #define XFS_TRANS_SB_IFREE 0x00000002
0092 #define XFS_TRANS_SB_FDBLOCKS 0x00000004
0093 #define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008
0094 #define XFS_TRANS_SB_FREXTENTS 0x00000010
0095 #define XFS_TRANS_SB_RES_FREXTENTS 0x00000020
0096 #define XFS_TRANS_SB_DBLOCKS 0x00000040
0097 #define XFS_TRANS_SB_AGCOUNT 0x00000080
0098 #define XFS_TRANS_SB_IMAXPCT 0x00000100
0099 #define XFS_TRANS_SB_REXTSIZE 0x00000200
0100 #define XFS_TRANS_SB_RBMBLOCKS 0x00000400
0101 #define XFS_TRANS_SB_RBLOCKS 0x00000800
0102 #define XFS_TRANS_SB_REXTENTS 0x00001000
0103 #define XFS_TRANS_SB_REXTSLOG 0x00002000
0104
0105
0106
0107
0108
0109
0110 #define XFS_AGF_REF 4
0111 #define XFS_AGI_REF 4
0112 #define XFS_AGFL_REF 3
0113 #define XFS_INO_BTREE_REF 3
0114 #define XFS_ALLOC_BTREE_REF 2
0115 #define XFS_BMAP_BTREE_REF 2
0116 #define XFS_RMAP_BTREE_REF 2
0117 #define XFS_DIR_BTREE_REF 2
0118 #define XFS_INO_REF 2
0119 #define XFS_ATTR_BTREE_REF 1
0120 #define XFS_DQUOT_REF 1
0121 #define XFS_REFC_BTREE_REF 1
0122 #define XFS_SSB_REF 0
0123
0124
0125
0126
0127 #define XFS_ICHGTIME_MOD 0x1
0128 #define XFS_ICHGTIME_CHG 0x2
0129 #define XFS_ICHGTIME_CREATE 0x4
0130
0131
0132
0133
0134
0135 int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen);
0136 int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
0137 uint32_t size, struct xfs_buf *bp);
0138 bool xfs_symlink_hdr_ok(xfs_ino_t ino, uint32_t offset,
0139 uint32_t size, struct xfs_buf *bp);
0140 void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp,
0141 struct xfs_inode *ip, struct xfs_ifork *ifp);
0142 xfs_failaddr_t xfs_symlink_shortform_verify(struct xfs_inode *ip);
0143
0144
0145 struct xfs_ino_geometry {
0146
0147 uint64_t maxicount;
0148
0149
0150 unsigned int inode_cluster_size;
0151
0152
0153
0154
0155
0156
0157
0158 unsigned int inode_cluster_size_raw;
0159
0160
0161 unsigned int inodes_per_cluster;
0162 unsigned int blocks_per_cluster;
0163
0164
0165 unsigned int cluster_align;
0166 unsigned int cluster_align_inodes;
0167 unsigned int inoalign_mask;
0168
0169 unsigned int inobt_mxr[2];
0170 unsigned int inobt_mnr[2];
0171 unsigned int inobt_maxlevels;
0172
0173
0174 unsigned int ialloc_inos;
0175 unsigned int ialloc_blks;
0176
0177
0178 unsigned int ialloc_min_blks;
0179
0180
0181 unsigned int ialloc_align;
0182
0183 unsigned int agino_log;
0184
0185
0186 unsigned int attr_fork_offset;
0187
0188
0189 uint64_t new_diflags2;
0190
0191 };
0192
0193 #endif