Whamcloud - gitweb
b=21670 output format specifiers fixes in LQS_DEBUG
[fs/lustre-release.git] / lustre / quota / quota_internal.h
index a6db1ec..e3c88e6 100644 (file)
@@ -87,7 +87,7 @@
 #define LQS_DEBUG(lqs, fmt, arg...)                                           \
         CDEBUG(D_QUOTA, "lqs(%p) id(%u) flag(%lu) type(%c) bunit(%lu) "       \
                "btune(%lu) iunit(%lu) itune(%lu) lqs_bwrite_pending(%lu) "    \
-               "lqs_iwrite_pending(%lu) ino_rec("LPD64") blk_rec("LPD64" ) "  \
+               "lqs_iwrite_pending(%lu) ino_rec(%lld) blk_rec(%lld) "         \
                "refcount(%d): "                                               \
                fmt, lqs, lqs->lqs_id, lqs->lqs_flags,                         \
                LQS_IS_GRP(lqs) ? 'g' : 'u',                                   \
@@ -211,4 +211,16 @@ int lmv_quota_check(struct obd_device *unused, struct obd_export *exp,
 int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
                     struct obd_quotactl *oqctl);
 int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk);
+
+static inline int client_quota_recoverable_error(int rc)
+{
+        return (rc == -ETIMEDOUT || rc == -EAGAIN);
+}
+
+static inline int client_quota_should_resend(int resend, struct client_obd *cli)
+{
+        return (atomic_read(&cli->cl_quota_resends) >= 0) ?
+                atomic_read(&cli->cl_quota_resends) > resend : 1;
+}
+
 #endif