Whamcloud - gitweb
LU-3222 ofd: use of ofd_XXX helpers
[fs/lustre-release.git] / lustre / ofd / ofd_grant.c
index a27a73e..a1819fc 100644 (file)
@@ -206,7 +206,8 @@ static void ofd_grant_statfs(const struct lu_env *env, struct obd_export *exp,
 
        rc = ofd_statfs_internal(env, ofd, osfs, max_age, from_cache);
        if (unlikely(rc)) {
-               *from_cache = 0;
+               if (from_cache)
+                       *from_cache = 0;
                return;
        }
 
@@ -233,7 +234,7 @@ static obd_size ofd_grant_space_left(struct obd_export *exp)
        obd_size                 unstable;
 
        ENTRY;
-       LASSERT_SPIN_LOCKED(&ofd->ofd_grant_lock);
+       assert_spin_locked(&ofd->ofd_grant_lock);
 
        spin_lock(&ofd->ofd_osfs_lock);
        /* get available space from cached statfs data */
@@ -249,10 +250,11 @@ static obd_size ofd_grant_space_left(struct obd_export *exp)
                            D_ERROR : D_CACHE;
 
                CDEBUG_LIMIT(mask, "%s: cli %s/%p left "LPU64" < tot_grant "
-                            LPU64" unstable "LPU64" pending "LPU64"\n",
+                            LPU64" unstable "LPU64" pending "LPU64" "
+                            "dirty "LPU64"\n",
                             obd->obd_name, exp->exp_client_uuid.uuid, exp,
                             left, tot_granted, unstable,
-                            ofd->ofd_tot_pending);
+                            ofd->ofd_tot_pending, ofd->ofd_tot_dirty);
                RETURN(0);
        }
 
@@ -297,7 +299,7 @@ static void ofd_grant_incoming(const struct lu_env *env, struct obd_export *exp,
        long                             dirty, dropped, grant_chunk;
        ENTRY;
 
-       LASSERT_SPIN_LOCKED(&ofd->ofd_grant_lock);
+       assert_spin_locked(&ofd->ofd_grant_lock);
 
        if ((oa->o_valid & (OBD_MD_FLBLOCKS|OBD_MD_FLGRANT)) !=
                                        (OBD_MD_FLBLOCKS|OBD_MD_FLGRANT)) {
@@ -375,7 +377,7 @@ static void ofd_grant_shrink(struct obd_export *exp,
        struct obd_device               *obd = exp->exp_obd;
        long                             grant_shrink;
 
-       LASSERT_SPIN_LOCKED(&ofd->ofd_grant_lock);
+       assert_spin_locked(&ofd->ofd_grant_lock);
        LASSERT(exp);
        if (left_space >= ofd->ofd_tot_granted_clients *
                          OFD_GRANT_SHRINK_LIMIT(exp))
@@ -456,7 +458,7 @@ static void ofd_grant_check(const struct lu_env *env, struct obd_export *exp,
 
        ENTRY;
 
-       LASSERT_SPIN_LOCKED(&ofd->ofd_grant_lock);
+       assert_spin_locked(&ofd->ofd_grant_lock);
 
        if ((oa->o_valid & OBD_MD_FLFLAGS) &&
            (oa->o_flags & OBD_FL_RECOV_RESEND)) {
@@ -953,7 +955,7 @@ int ofd_grant_create(const struct lu_env *env, struct obd_export *exp, int *nr)
            (ofd->ofd_osfs.os_blocks >> 10)) {
                spin_unlock(&ofd->ofd_grant_lock);
                CDEBUG(D_RPCTRACE, "%s: not enough space for create "LPU64"\n",
-                      ofd_obd(ofd)->obd_name,
+                      ofd_name(ofd),
                       ofd->ofd_osfs.os_bavail * ofd->ofd_osfs.os_blocks);
                RETURN(-ENOSPC);
        }