Commit ed74d1c
committed
virtio/block: wrap disk_image in a Mutex
Imago's discard_to_* operations require a mutable reference to Storage.
Let's wrap disk_image in a Mutex so we can obtain such reference when
needed. Since, in practice, we won't have multiple threads accessing the
lock, the overhead should be very small (one or two operations on
atomics).
Signed-off-by: Sergio Lopez <[email protected]>1 parent d8a0c55 commit ed74d1c
File tree
3 files changed
+12
-16
lines changed- src/devices/src/virtio
- block
3 files changed
+12
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 98 | | |
103 | 99 | | |
104 | 100 | | |
| |||
146 | 142 | | |
147 | 143 | | |
148 | 144 | | |
149 | | - | |
| 145 | + | |
150 | 146 | | |
151 | 147 | | |
152 | 148 | | |
153 | | - | |
| 149 | + | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
| |||
206 | 202 | | |
207 | 203 | | |
208 | 204 | | |
209 | | - | |
| 205 | + | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
| |||
271 | 267 | | |
272 | 268 | | |
273 | 269 | | |
274 | | - | |
| 270 | + | |
275 | 271 | | |
276 | 272 | | |
277 | | - | |
| 273 | + | |
278 | 274 | | |
279 | 275 | | |
280 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
0 commit comments