restart:
osc_object_lock(obj);
ext = osc_extent_search(obj, cur->oe_start);
- if (ext == NULL)
+ if (!ext)
ext = first_extent(obj);
- while (ext != NULL) {
+ for (; ext; ext = next_extent(ext)) {
pgoff_t ext_chk_start = ext->oe_start >> ppc_bits;
- pgoff_t ext_chk_end = ext->oe_end >> ppc_bits;
+ pgoff_t ext_chk_end = ext->oe_end >> ppc_bits;
LASSERT(sanity_check_nolock(ext) == 0);
if (chunk > ext_chk_end + 1 || chunk < ext_chk_start)
EASSERTF(!overlapped(ext, cur), ext,
EXTSTR"\n", EXTPARA(cur));
- ext = next_extent(ext);
continue;
}
/* discontiguous chunks? */
- if (chunk + 1 < ext_chk_start) {
- ext = next_extent(ext);
+ if (chunk + 1 < ext_chk_start)
continue;
- }
/* ok, from now on, ext and cur have these attrs:
* 1. covered by the same lock
}
/* non-overlapped extent */
- if (ext->oe_state != OES_CACHE || ext->oe_fsync_wait) {
+ if (ext->oe_state != OES_CACHE || ext->oe_fsync_wait)
/* we can't do anything for a non OES_CACHE extent, or
* if there is someone waiting for this extent to be
* flushed, try next one. */
- ext = next_extent(ext);
continue;
- }
/* check if they belong to the same rpc slot before trying to
* merge. the extents are not overlapped and contiguous at
* chunk level to get here. */
- if (ext->oe_max_end != max_end) {
+ if (ext->oe_max_end != max_end)
/* if they don't belong to the same RPC slot or
* max_pages_per_rpc has ever changed, do not merge. */
- ext = next_extent(ext);
continue;
- }
/* check whether maximum extent size will be hit */
if ((ext_chk_end - ext_chk_start + 1 + 1) << ppc_bits >
- cli->cl_max_extent_pages) {
- ext = next_extent(ext);
+ cli->cl_max_extent_pages)
continue;
- }
/* it's required that an extent must be contiguous at chunk
* level so that we know the whole extent is covered by grant
}
if (found != NULL)
break;
-
- ext = next_extent(ext);
}
osc_extent_tree_dump(D_CACHE, obj);