diff options
author | Laura Abbott <labbott@redhat.com> | 2017-04-18 20:27:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-18 20:41:12 +0200 |
commit | e4231bcda72daef497af45e195a33daa0f9357d0 (patch) | |
tree | b07421594e284d0c33e310d43d857fc67aeb8c88 /mm | |
parent | cma: Store a name in the cma structure (diff) | |
download | linux-e4231bcda72daef497af45e195a33daa0f9357d0.tar.xz linux-e4231bcda72daef497af45e195a33daa0f9357d0.zip |
cma: Introduce cma_for_each_area
Frameworks (e.g. Ion) may want to iterate over each possible CMA area to
allow for enumeration. Introduce a function to allow a callback.
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/cma.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -504,3 +504,17 @@ bool cma_release(struct cma *cma, const struct page *pages, unsigned int count) return true; } + +int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data) +{ + int i; + + for (i = 0; i < cma_area_count; i++) { + int ret = it(&cma_areas[i], data); + + if (ret) + return ret; + } + + return 0; +} |