X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_cache.c;h=4de029840776991e19b5fb365839bbc49d599e88;hb=b34bf55f9493778c30b816a8cbbd1b901b05b60e;hp=20765d7aa4942ba7556758db99f37e100511c230;hpb=51dd6269c91dab7543cd9dfd1848c983efa6db36;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index 20765d7..4de0298 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -229,8 +229,8 @@ static int osc_extent_sanity_check0(struct osc_extent *ext, struct ldlm_extent *extent; extent = &ext->oe_dlmlock->l_policy_data.l_extent; - if (!(extent->start <= cl_offset(osc2cl(obj), ext->oe_start) && - extent->end >= cl_offset(osc2cl(obj), ext->oe_max_end))) + if (!(extent->start <= ext->oe_start << PAGE_SHIFT && + extent->end >= ext->oe_max_end << PAGE_SHIFT)) GOTO(out, rc = 100); if (!(ext->oe_dlmlock->l_granted_mode & (LCK_PW | LCK_GROUP))) @@ -1279,10 +1279,10 @@ static int osc_refresh_count(const struct lu_env *env, if (result < 0) return result; kms = attr->cat_kms; - if (cl_offset(obj, index) >= kms) + if (index << PAGE_SHIFT >= kms) /* catch race with truncate */ return 0; - else if (cl_offset(obj, index + 1) > kms) + else if ((index + 1) << PAGE_SHIFT > kms) /* catch sub-page write at end of file */ return kms & ~PAGE_MASK; else @@ -2702,8 +2702,8 @@ int osc_cache_truncate_start(const struct lu_env *env, struct osc_object *obj, ENTRY; /* pages with index greater or equal to index will be truncated. */ - index = cl_index(osc2cl(obj), size); - partial = size > cl_offset(osc2cl(obj), index); + index = size >> PAGE_SHIFT; + partial = size > (index << PAGE_SHIFT); again: osc_object_lock(obj); @@ -3172,12 +3172,12 @@ static bool check_and_discard_cb(const struct lu_env *env, struct cl_io *io, tmp->l_policy_data.l_extent.start; /* no lock covering this page */ - if (index < cl_index(osc2cl(osc), start)) { + if (index < start >> PAGE_SHIFT) { /* no lock at @index, * first lock at @start */ info->oti_ng_index = - cl_index(osc2cl(osc), start); + start >> PAGE_SHIFT; discard = true; } else { /* Cache the first-non-overlapped @@ -3188,7 +3188,7 @@ static bool check_and_discard_cb(const struct lu_env *env, struct cl_io *io, * pages. */ info->oti_fn_index = - cl_index(osc2cl(osc), end + 1); + (end + 1) >> PAGE_SHIFT; if (end == OBD_OBJECT_EOF) info->oti_fn_index = CL_PAGE_EOF;