Whamcloud - gitweb
LU-12702 quota: wait pending write before acquiring remotely
[fs/lustre-release.git] / lustre / include / dt_object.h
index 45b136a..e1d574a 100644 (file)
@@ -298,6 +298,17 @@ struct dt_device_operations {
                       struct dt_device *dev);
 
        /**
+        * Wait pending quota update finish
+        *
+        * There might be a window that quota usage has been updated,
+        * but commit callback to reduce pending write have not been
+        * finished, this is used to wait all pending update done.
+        *
+        * \param[in] dev       dt device
+        */
+       void (*dt_wait_quota_pending)(struct dt_device *dev);
+
+       /**
         * Start transaction commit asynchronously.
         *
 
@@ -2697,6 +2708,14 @@ static inline int dt_ro(const struct lu_env *env, struct dt_device *dev)
         return dev->dd_ops->dt_ro(env, dev);
 }
 
+static inline void dt_wait_quota_pending(struct dt_device *dev)
+{
+       LASSERT(dev);
+       LASSERT(dev->dd_ops);
+       if (dev->dd_ops->dt_wait_quota_pending)
+               dev->dd_ops->dt_wait_quota_pending(dev);
+}
+
 static inline int dt_declare_insert(const struct lu_env *env,
                                     struct dt_object *dt,
                                     const struct dt_rec *rec,