xfs: xfs_dquot prealloc throttling watermarks and low free space
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_dquot.h
index f77b711455b1042c5411447f12f2c7730309a1ac..4f0ebfc43cc962c8a93121682ec1755ee003905b 100644 (file)
 struct xfs_mount;
 struct xfs_trans;
 
+enum {
+       XFS_QLOWSP_1_PCNT = 0,
+       XFS_QLOWSP_3_PCNT,
+       XFS_QLOWSP_5_PCNT,
+       XFS_QLOWSP_MAX
+};
+
 /*
  * The incore dquot structure
  */
@@ -51,6 +58,9 @@ typedef struct xfs_dquot {
        xfs_qcnt_t       q_res_bcount;  /* total regular nblks used+reserved */
        xfs_qcnt_t       q_res_icount;  /* total inos allocd+reserved */
        xfs_qcnt_t       q_res_rtbcount;/* total realtime blks used+reserved */
+       xfs_qcnt_t       q_prealloc_lo_wmark;/* prealloc throttle wmark */
+       xfs_qcnt_t       q_prealloc_hi_wmark;/* prealloc disabled wmark */
+       int64_t          q_low_space[XFS_QLOWSP_MAX];
        struct mutex     q_qlock;       /* quota lock */
        struct completion q_flush;      /* flush completion queue */
        atomic_t          q_pincount;   /* dquot pin count */
@@ -153,6 +163,8 @@ extern void         xfs_qm_dqput(xfs_dquot_t *);
 
 extern void            xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *);
 
+extern void            xfs_dquot_set_prealloc_limits(struct xfs_dquot *);
+
 static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp)
 {
        xfs_dqlock(dqp);