Commit 4045b64
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>1 parent 561a163 commit 4045b64
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
212 | 221 | | |
213 | | - | |
214 | 222 | | |
215 | | - | |
216 | 223 | | |
217 | 224 | | |
218 | 225 | | |
| |||
1052 | 1059 | | |
1053 | 1060 | | |
1054 | 1061 | | |
1055 | | - | |
| 1062 | + | |
1056 | 1063 | | |
1057 | 1064 | | |
1058 | 1065 | | |
| |||
1596 | 1603 | | |
1597 | 1604 | | |
1598 | 1605 | | |
1599 | | - | |
1600 | 1606 | | |
1601 | | - | |
1602 | 1607 | | |
1603 | 1608 | | |
1604 | 1609 | | |
| |||
0 commit comments