参照元†
- struct zoneref *z
- 現在のzonerefではなく、次のzonerefを指定する。もしhighest_indexを越えたzonerefを参照していたら、次のnodeのzonerefを返す。
- next_zones_zonelist(++z, ...)のように使われる。
- linux-5.15/zoneref
- enum zone_type highest_zoneidx
- nodemask_t *nodes
返り値†
/**
* next_zones_zonelist - Returns the next zone at or below highest_zoneidx within the allowed nodemask using a cursor within a zonelist as a starting point
* @z: The cursor used as a starting point for the search
* @highest_zoneidx: The zone index of the highest zone to return
* @nodes: An optional nodemask to filter the zonelist with
*
* This function returns the next zone at or below a given zone index that is
* within the allowed nodemask using a cursor as the starting point for the
* search. The zoneref returned is a cursor that represents the current zone
* being examined. It should be advanced by one before calling
* next_zones_zonelist again.
*
* Return: the next zone at or below highest_zoneidx within the allowed
* nodemask using a cursor within a zonelist as a starting point
*/
static __always_inline struct zoneref *next_zones_zonelist(struct zoneref *z,
enum zone_type highest_zoneidx,
nodemask_t *nodes)
{
if (likely(!nodes && zonelist_zone_idx(z) <= highest_zoneidx))
return z;
return __next_zones_zonelist(z, highest_zoneidx, nodes);
}
- highest_zoneidxよりインデックスが小さいなら、zonerefをそのまま返す。
- nextと関数名についているが、この関数内で次のzoneref(z++のようにインクリメントすると得られる)は使わない。呼び出し元が指定するzが、次のzonerefを指している。紛らわしい……。
- linux-5.15/likely()
- zonelist_zone_idx(z)はz->zone_idxと同じ。
コメント†