Commit cf6b0f0
committed
refactor: Change
The function was only ever called with a `File` object created from a
`memfd`. Thus instead of the call-site have to do two function calls
(one for the memfd and then another for creating the guest memory mmap,
which because of this had to do a `fstat` call to determine how big the
memfd is), have the `GuestMemoryMmap` factory directly create the
`memfd`.
This is mainly preparatory to prevent callers to pass mismatched
configurations to `memfd_create` and the subsequent `from_file` call
(e.g. different huge page configs).
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>GuestMemoryExtension::with_file into memfd_backed
1 parent 8945939 commit cf6b0f0
2 files changed
+12
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 60 | + | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
| |||
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
246 | 243 | | |
247 | 244 | | |
248 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | | - | |
| 129 | + | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
| 132 | + | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
| |||
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
340 | | - | |
| 339 | + | |
341 | 340 | | |
342 | 341 | | |
343 | 342 | | |
| |||
0 commit comments