OSDN Git Service

io_uring: simplify file ref tracking in submission state
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 16 Jul 2020 20:28:33 +0000 (23:28 +0300)
committerJens Axboe <axboe@kernel.dk>
Fri, 24 Jul 2020 19:00:44 +0000 (13:00 -0600)
commit06ef3608b0eed673fcbc62cf74c8d3ad0007a337
tree39ced7885ecf8b833c3cbe5572203f96e04c44e5
parent57f1a64958543fe18a7fe0addbfb31bb2ceeaea2
io_uring: simplify file ref tracking in submission state

Currently, file refs in struct io_submit_state are tracked with 2 vars:
@has_refs -- how many refs were initially taken
@used_refs -- number of refs used

Replace it with a single variable counting how many refs left at the
current moment.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c