diff options
author | Greg Kurz <groug@kaod.org> | 2021-01-21 19:15:10 +0100 |
---|---|---|
committer | Greg Kurz <groug@kaod.org> | 2021-01-22 15:17:19 +0100 |
commit | 20b7f45b22c3c00dc6f8bc73a66dffb6d436aa85 (patch) | |
tree | a91323e882fbddb64f6a5299cabd142ccbb5aa53 /include | |
parent | feabd6cf78ca3b57da2ce48e95b704e72147bf2c (diff) |
9pfs: Improve unreclaim loop
If a fid was actually re-opened by v9fs_reopen_fid(), we re-traverse the
fid list from the head in case some other request created a fid that
needs to be marked unreclaimable as well (i.e. the client opened a new
handle on the path that is being unlinked). This is suboptimal since
most if not all fids that require it have likely been taken care of
already.
This is mostly the result of new fids being added to the head of the
list. Since the list is now a QSIMPLEQ, add new fids at the end instead
to avoid the need to rewind. Take a reference on the fid to ensure it
doesn't go away during v9fs_reopen_fid() and that it can be safely
passed to QSIMPLEQ_NEXT() afterwards. Since the associated put_fid()
can also yield, same is done with the next fid. So the logic here is
to get a reference on a fid and only put it back during the next
iteration after we could get a reference on the next fid.
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <20210121181510.1459390-1-groug@kaod.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions