Commit 23a1238
lib: revert InPlaceWrite implementation for Arc<MaybeUninit<T>>
The kernel version of pinned_init implemented InPlaceWrite on UniqueArc,
not Arc. This ensures that InPlaceWrite is not writing to a shared Arc.
Userspace does not have this facility and therefore cannot lift the
kernel implementation of InPlaceWrite directly into Arc<>.
One possibility would be to use Arc::get_mut(), though this would introduce
a panic in the case where the Arc is shared. So just revert part of
commit 6841b61 ("rust: init: add `write_[pin_]init` functions", 2024-11-22).
Suggested-by: Benno Lossin <benno.lossin@proton.me>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 1769d7f commit 23a1238
1 file changed
Lines changed: 16 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1229 | 1236 | | |
1230 | 1237 | | |
1231 | 1238 | | |
1232 | 1239 | | |
1233 | 1240 | | |
1234 | 1241 | | |
1235 | 1242 | | |
1236 | | - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
1237 | 1251 | | |
1238 | 1252 | | |
1239 | 1253 | | |
| |||
1276 | 1290 | | |
1277 | 1291 | | |
1278 | 1292 | | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | 1293 | | |
1305 | 1294 | | |
1306 | 1295 | | |
| |||
0 commit comments