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