Commit 16367fe
ublk: allow UBLK_IO_(UN)REGISTER_IO_BUF on any task
Currently, UBLK_IO_REGISTER_IO_BUF and UBLK_IO_UNREGISTER_IO_BUF are
only permitted on the ublk_io's daemon task. But this restriction is
unnecessary. ublk_register_io_buf() calls __ublk_check_and_get_req() to
look up the request from the tagset and atomically take a reference on
the request without accessing the ublk_io. ublk_unregister_io_buf()
doesn't use the q_id or tag at all.
So allow these opcodes even on tasks other than io->task.
Handle UBLK_IO_UNREGISTER_IO_BUF before obtaining the ubq and io since
the buffer index being unregistered is not necessarily related to the
specified q_id and tag.
Add a feature flag UBLK_F_BUF_REG_OFF_DAEMON that userspace can use to
determine whether the kernel supports off-daemon buffer registration.
Suggested-by: Ming Lei <[email protected]>
Signed-off-by: Caleb Sander Mateos <[email protected]>1 parent 9ce5505 commit 16367fe
2 files changed
Lines changed: 30 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
2020 | 2021 | | |
2021 | 2022 | | |
2022 | 2023 | | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | 2024 | | |
2034 | 2025 | | |
2035 | 2026 | | |
| |||
2186 | 2177 | | |
2187 | 2178 | | |
2188 | 2179 | | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
2189 | 2188 | | |
2190 | 2189 | | |
2191 | 2190 | | |
| |||
2206 | 2205 | | |
2207 | 2206 | | |
2208 | 2207 | | |
2209 | | - | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2210 | 2217 | | |
| 2218 | + | |
2211 | 2219 | | |
2212 | 2220 | | |
2213 | 2221 | | |
| |||
2226 | 2234 | | |
2227 | 2235 | | |
2228 | 2236 | | |
2229 | | - | |
2230 | | - | |
2231 | 2237 | | |
2232 | 2238 | | |
2233 | 2239 | | |
| |||
2920 | 2926 | | |
2921 | 2927 | | |
2922 | 2928 | | |
2923 | | - | |
| 2929 | + | |
| 2930 | + | |
2924 | 2931 | | |
2925 | 2932 | | |
2926 | 2933 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
| |||
0 commit comments