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)))
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
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);
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
* 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;