]> git.baikalelectronics.ru Git - kernel.git/commit
lib/scatterlist: Introduce sgl_alloc() and sgl_free()
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 5 Jan 2018 16:26:46 +0000 (08:26 -0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 6 Jan 2018 16:18:00 +0000 (09:18 -0700)
commitdf60b446180687e092e3f07cfe21db18ed9665f5
treeefd4cbbac280618e1cd6e9dd464730a739c2b37f
parenteef66588177757d9004dbc6a8bf0c2b29bace021
lib/scatterlist: Introduce sgl_alloc() and sgl_free()

Many kernel drivers contain code that allocates and frees both a
scatterlist and the pages that populate that scatterlist.
Introduce functions in lib/scatterlist.c that perform these tasks
instead of duplicating this functionality in multiple drivers.
Only include these functions in the build if CONFIG_SGL_ALLOC=y
to avoid that the kernel size increases if this functionality is
not used.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/scatterlist.h
lib/Kconfig
lib/scatterlist.c