]> git.dujemihanovic.xyz Git - linux.git/commit
virtio_fs: introduce virtio_fs_put_locked helper
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Sun, 25 Aug 2024 13:07:15 +0000 (16:07 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 25 Sep 2024 11:07:43 +0000 (07:07 -0400)
commit4045b6429874e07f14b5b41e326d4e6f866f8bbf
tree51f38093ee3345d295e470c41196d8527358135f
parent561a16366ef57caad66d0dfe49275cd3f809c138
virtio_fs: introduce virtio_fs_put_locked helper

Introduce a new helper function virtio_fs_put_locked to encapsulate the
common pattern of releasing a virtio_fs reference while holding a lock.
The existing virtio_fs_put helper will be used to release a virtio_fs
reference while not holding a lock.

Also add an assertion in case the lock is not taken when it should.

Reviewed-by: Idan Zach <izach@nvidia.com>
Reviewed-by: Shai Malin <smalin@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Message-Id: <20240825130716.9506-1-mgurtovoy@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
fs/fuse/virtio_fs.c