X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fofd%2Fofd_grant.c;h=a1819fc3bba59be1b2fbdce39566f4a8224a7ad0;hp=a27a73ec1852dc243c87a25e6d75ede43b23e3af;hb=f6dc0994f2bb5d2624e622213b634e74a1c76e3f;hpb=863de7db65825b5862459127da1140d3ac5bcc41;ds=sidebyside diff --git a/lustre/ofd/ofd_grant.c b/lustre/ofd/ofd_grant.c index a27a73e..a1819fc 100644 --- a/lustre/ofd/ofd_grant.c +++ b/lustre/ofd/ofd_grant.c @@ -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); }