Whamcloud - gitweb
LU-10018 protocol: MDT as a statfs proxy
[fs/lustre-release.git] / lustre / include / obd_class.h
index 3aaa52e..31b06d9 100644 (file)
@@ -47,6 +47,7 @@
                                          * obd_osfs_age */
 #define OBD_STATFS_FOR_MDT0    0x0004  /* The statfs is only for retrieving
                                         * information from MDT0. */
+#define OBD_STATFS_SUM         0x0008  /* get aggregated statfs from MDT */
 
 extern rwlock_t obd_dev_lock;
 
@@ -1081,7 +1082,10 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
 
        CDEBUG(D_SUPER, "osfs %lld, max_age %lld\n",
                obd->obd_osfs_age, max_age);
-       if (obd->obd_osfs_age < max_age) {
+       /* ignore cache if aggregated isn't expected */
+       if (obd->obd_osfs_age < max_age ||
+           ((obd->obd_osfs.os_state & OS_STATE_SUM) &&
+            !(flags & OBD_STATFS_SUM))) {
                 rc = OBP(obd, statfs)(env, exp, osfs, max_age, flags);
                 if (rc == 0) {
                        spin_lock(&obd->obd_osfs_lock);