aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.h
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2013-03-18 10:51:46 -0400
committerBen Myers <bpm@sgi.com>2013-03-22 17:06:30 -0400
commitb136645116e5471cf0b037a1759dc83620236631 (patch)
tree9b9bfaa822d88585f4fa670a10b8f54a09584372 /fs/xfs/xfs_dquot.h
parent4b6eae2e6ac8a6671839ccaea1c2e3dd5684f5df (diff)
xfs: xfs_dquot prealloc throttling watermarks and low free space
Enable tracking of high and low watermarks for preallocation throttling of files under quota restrictions. These values are calculated when the quota limit is read from disk or modified and cached for later use by the throttling algorithm. The high watermark specifies when preallocation is disabled, the low watermark specifies when throttling is enabled and the low free space data structure contains precalculated low free space limits to serve as input to determine the level of throttling required. Note that the low free space data structure is based on the existing global low free space data structure with the exception of using three stages (5%, 3% and 1%) rather than five to reduce the impact of xfs_dquot memory overhead. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dquot.h')
-rw-r--r--fs/xfs/xfs_dquot.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
index f77b711455b1..4f0ebfc43cc9 100644
--- a/fs/xfs/xfs_dquot.h
+++ b/fs/xfs/xfs_dquot.h
@@ -32,6 +32,13 @@
32struct xfs_mount; 32struct xfs_mount;
33struct xfs_trans; 33struct xfs_trans;
34 34
35enum {
36 XFS_QLOWSP_1_PCNT = 0,
37 XFS_QLOWSP_3_PCNT,
38 XFS_QLOWSP_5_PCNT,
39 XFS_QLOWSP_MAX
40};
41
35/* 42/*
36 * The incore dquot structure 43 * The incore dquot structure
37 */ 44 */
@@ -51,6 +58,9 @@ typedef struct xfs_dquot {
51 xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */ 58 xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */
52 xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */ 59 xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */
53 xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */ 60 xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */
61 xfs_qcnt_t q_prealloc_lo_wmark;/* prealloc throttle wmark */
62 xfs_qcnt_t q_prealloc_hi_wmark;/* prealloc disabled wmark */
63 int64_t q_low_space[XFS_QLOWSP_MAX];
54 struct mutex q_qlock; /* quota lock */ 64 struct mutex q_qlock; /* quota lock */
55 struct completion q_flush; /* flush completion queue */ 65 struct completion q_flush; /* flush completion queue */
56 atomic_t q_pincount; /* dquot pin count */ 66 atomic_t q_pincount; /* dquot pin count */
@@ -153,6 +163,8 @@ extern void xfs_qm_dqput(xfs_dquot_t *);
153 163
154extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *); 164extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *);
155 165
166extern void xfs_dquot_set_prealloc_limits(struct xfs_dquot *);
167
156static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp) 168static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp)
157{ 169{
158 xfs_dqlock(dqp); 170 xfs_dqlock(dqp);