1
2
3
4
5
6 #ifndef __XFS_TRANS_RESV_H__
7 #define __XFS_TRANS_RESV_H__
8
9 struct xfs_mount;
10
11
12
13
14 struct xfs_trans_res {
15 uint tr_logres;
16 int tr_logcount;
17 int tr_logflags;
18
19 };
20
21 struct xfs_trans_resv {
22 struct xfs_trans_res tr_write;
23 struct xfs_trans_res tr_itruncate;
24 struct xfs_trans_res tr_rename;
25 struct xfs_trans_res tr_link;
26 struct xfs_trans_res tr_remove;
27 struct xfs_trans_res tr_symlink;
28 struct xfs_trans_res tr_create;
29 struct xfs_trans_res tr_create_tmpfile;
30 struct xfs_trans_res tr_mkdir;
31 struct xfs_trans_res tr_ifree;
32 struct xfs_trans_res tr_ichange;
33 struct xfs_trans_res tr_growdata;
34 struct xfs_trans_res tr_addafork;
35 struct xfs_trans_res tr_writeid;
36 struct xfs_trans_res tr_attrinval;
37
38 struct xfs_trans_res tr_attrsetm;
39
40 struct xfs_trans_res tr_attrsetrt;
41
42 struct xfs_trans_res tr_attrrm;
43 struct xfs_trans_res tr_clearagi;
44 struct xfs_trans_res tr_growrtalloc;
45 struct xfs_trans_res tr_growrtzero;
46 struct xfs_trans_res tr_growrtfree;
47 struct xfs_trans_res tr_qm_setqlim;
48 struct xfs_trans_res tr_qm_dqalloc;
49 struct xfs_trans_res tr_qm_quotaoff;
50 struct xfs_trans_res tr_qm_equotaoff;
51 struct xfs_trans_res tr_sb;
52 struct xfs_trans_res tr_fsyncts;
53 };
54
55
56 #define M_RES(mp) (&(mp)->m_resv)
57
58
59
60
61
62
63
64
65 #define XFS_DIROP_LOG_RES(mp) \
66 (XFS_FSB_TO_B(mp, XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK)) + \
67 (XFS_FSB_TO_B(mp, XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)))
68 #define XFS_DIROP_LOG_COUNT(mp) \
69 (XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \
70 XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)
71
72
73
74
75 #define XFS_DEFAULT_LOG_COUNT 1
76 #define XFS_DEFAULT_PERM_LOG_COUNT 2
77 #define XFS_ITRUNCATE_LOG_COUNT 2
78 #define XFS_ITRUNCATE_LOG_COUNT_REFLINK 8
79 #define XFS_INACTIVE_LOG_COUNT 2
80 #define XFS_CREATE_LOG_COUNT 2
81 #define XFS_CREATE_TMPFILE_LOG_COUNT 2
82 #define XFS_MKDIR_LOG_COUNT 3
83 #define XFS_SYMLINK_LOG_COUNT 3
84 #define XFS_REMOVE_LOG_COUNT 2
85 #define XFS_LINK_LOG_COUNT 2
86 #define XFS_RENAME_LOG_COUNT 2
87 #define XFS_WRITE_LOG_COUNT 2
88 #define XFS_WRITE_LOG_COUNT_REFLINK 8
89 #define XFS_ADDAFORK_LOG_COUNT 2
90 #define XFS_ATTRINVAL_LOG_COUNT 1
91 #define XFS_ATTRSET_LOG_COUNT 3
92 #define XFS_ATTRRM_LOG_COUNT 3
93
94 void xfs_trans_resv_calc(struct xfs_mount *mp, struct xfs_trans_resv *resp);
95 uint xfs_allocfree_log_count(struct xfs_mount *mp, uint num_ops);
96
97 #endif