• Andrew Morton's avatar
    [PATCH] for_each_zone macro · a4b065fa
    Andrew Morton authored
    Patch from Robert Love.
    
    Attached patch implements for_each_zone(zont_t *) which is a helper
    macro to cleanup code of the form:
    
            for (pgdat = pgdat_list; pgdat; pgdat = pgdat->node_next) {
                    for (i = 0; i < MAX_NR_ZONES; ++i) {
                            zone_t * z = pgdat->node_zones + i;
                            /* ... */
                    }
            }
    
    and replace it with:
    
            for_each_zone(zone) {
                    /* ... */
            }
    
    This patch only replaces one use of the above loop with the new macro.
    Pending code, however, currently in the full rmap patch uses
    for_each_zone more extensively.
    a4b065fa
page_alloc.c 23 KB