@@ -2012,19 +2012,16 @@ static unsigned int get_write_extents(struct osc_object *obj,
break;
}
- ext = first_extent(obj);
- while (ext) {
+ for (ext = first_extent(obj);
+ ext;
+ ext = next_extent(ext)) {
if ((ext->oe_state != OES_CACHE) ||
/* this extent may be already in current rpclist */
- (!list_empty(&ext->oe_link) && ext->oe_owner)) {
- ext = next_extent(ext);
+ (!list_empty(&ext->oe_link) && ext->oe_owner))
continue;
- }
if (!try_to_add_extent_for_io(cli, ext, &data))
return data.erd_page_count;
-
- ext = next_extent(ext);
}
return data.erd_page_count;
}
This 'while' loop is really a 'for' loop in disguise. So change it to 'for'. Signed-off-by: NeilBrown <neilb@suse.com> --- drivers/staging/lustre/lustre/osc/osc_cache.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)