fs: add fget_many() and fput_many()
authorJens Axboe <axboe@kernel.dk>
Wed, 21 Nov 2018 17:32:39 +0000 (10:32 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 6 Jan 2019 20:52:49 +0000 (13:52 -0700)
commite7e6f01d7ddec953269e8d247ec0af9ec5139d5a
treeef8fcb648bd204e19121a566b6bc420f30f844c4
parent682d5b7f657ff6c6efc265866f7e13773fbceaa1
fs: add fget_many() and fput_many()

Some uses cases repeatedly get and put references to the same file, but
the only exposed interface is doing these one at the time. As each of
these entail an atomic inc or dec on a shared structure, that cost can
add up.

Add fget_many(), which works just like fget(), except it takes an
argument for how many references to get on the file. Ditto fput_many(),
which can drop an arbitrary number of references to a file.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/file.c
fs/file_table.c
include/linux/file.h
include/linux/fs.h