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>
Thu, 3 Jan 2019 15:14:02 +0000 (08:14 -0700)
commitc5f346c7b9720e78122cb521c70546fda946b578
treea98535cca0636f4b1b53a42496e48a4454c66f82
parent7c2a2266ced0f5be7ebb652f25ad3a04052aea9f
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