Commit 6202783
nvmet: Improve nvmet_alloc_ctrl() interface and implementation
Introduce struct nvmet_alloc_ctrl_args to define the arguments for
the function nvmet_alloc_ctrl() to avoid the need for passing a pointer
to a struct nvmet_req as an argument. This new data structure aggregates
together the arguments that were passed to nvmet_alloc_ctrl()
(subsysnqn, hostnqn and kato), together with the struct nvmet_req fields
used by nvmet_alloc_ctrl(), that is, the fields port, p2p_client, and
ops as input and the result and error_loc fields as output, as well as a
status field. nvmet_alloc_ctrl() is also changed to return a pointer
to the allocated and initialized controller structure instead of a
status code, as the status is now returned through the status field of
struct nvmet_alloc_ctrl_args.
The function nvmet_setup_p2p_ns_map() is changed to not take a pointer
to a struct nvmet_req as argument, instead, directly specify the
p2p_client device pointer needed as argument.
The code in nvmet_execute_admin_connect() that initializes a new target
controller after allocating it is moved into nvmet_alloc_ctrl().
The code that sets up an admin queue for the controller (and the call
to nvmet_install_queue()) remains in nvmet_execute_admin_connect().
Finally, nvmet_alloc_ctrl() is also exported to allow target drivers to
use this function directly to allocate and initialize a new controller
structure without the need to rely on a fabrics connect command request.
Signed-off-by: Damien Le Moal <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Tested-by: Rick Wertenbroek <[email protected]>
Tested-by: Manivannan Sadhasivam <[email protected]>
Signed-off-by: Keith Busch <[email protected]>1 parent 200adac commit 6202783
3 files changed
+94
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1350 | 1350 | | |
1351 | 1351 | | |
1352 | 1352 | | |
1353 | | - | |
| 1353 | + | |
1354 | 1354 | | |
1355 | 1355 | | |
1356 | 1356 | | |
1357 | 1357 | | |
1358 | | - | |
| 1358 | + | |
1359 | 1359 | | |
1360 | 1360 | | |
1361 | | - | |
| 1361 | + | |
1362 | 1362 | | |
1363 | 1363 | | |
1364 | 1364 | | |
| |||
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
| 1390 | + | |
1393 | 1391 | | |
1394 | 1392 | | |
1395 | 1393 | | |
| 1394 | + | |
| 1395 | + | |
1396 | 1396 | | |
1397 | | - | |
1398 | 1397 | | |
1399 | | - | |
1400 | | - | |
| 1398 | + | |
| 1399 | + | |
1401 | 1400 | | |
1402 | 1401 | | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1407 | 1406 | | |
1408 | 1407 | | |
1409 | 1408 | | |
1410 | | - | |
| 1409 | + | |
1411 | 1410 | | |
1412 | | - | |
1413 | | - | |
| 1411 | + | |
| 1412 | + | |
1414 | 1413 | | |
1415 | | - | |
1416 | | - | |
| 1414 | + | |
| 1415 | + | |
1417 | 1416 | | |
1418 | 1417 | | |
1419 | 1418 | | |
1420 | 1419 | | |
1421 | | - | |
| 1420 | + | |
1422 | 1421 | | |
1423 | 1422 | | |
1424 | 1423 | | |
1425 | 1424 | | |
1426 | 1425 | | |
1427 | | - | |
1428 | | - | |
| 1426 | + | |
| 1427 | + | |
1429 | 1428 | | |
1430 | 1429 | | |
1431 | 1430 | | |
| |||
1439 | 1438 | | |
1440 | 1439 | | |
1441 | 1440 | | |
1442 | | - | |
1443 | | - | |
| 1441 | + | |
| 1442 | + | |
1444 | 1443 | | |
1445 | 1444 | | |
1446 | 1445 | | |
| |||
1463 | 1462 | | |
1464 | 1463 | | |
1465 | 1464 | | |
1466 | | - | |
| 1465 | + | |
1467 | 1466 | | |
1468 | 1467 | | |
1469 | 1468 | | |
1470 | 1469 | | |
1471 | | - | |
| 1470 | + | |
1472 | 1471 | | |
1473 | 1472 | | |
1474 | 1473 | | |
| |||
1490 | 1489 | | |
1491 | 1490 | | |
1492 | 1491 | | |
1493 | | - | |
| 1492 | + | |
1494 | 1493 | | |
1495 | 1494 | | |
1496 | 1495 | | |
1497 | | - | |
1498 | | - | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1499 | 1521 | | |
1500 | 1522 | | |
1501 | 1523 | | |
| |||
1509 | 1531 | | |
1510 | 1532 | | |
1511 | 1533 | | |
1512 | | - | |
1513 | | - | |
| 1534 | + | |
1514 | 1535 | | |
| 1536 | + | |
1515 | 1537 | | |
1516 | 1538 | | |
1517 | 1539 | | |
| |||
1547 | 1569 | | |
1548 | 1570 | | |
1549 | 1571 | | |
| 1572 | + | |
1550 | 1573 | | |
1551 | 1574 | | |
1552 | 1575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
224 | | - | |
| 228 | + | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
228 | | - | |
229 | | - | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
235 | | - | |
236 | | - | |
| 239 | + | |
| 240 | + | |
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
243 | | - | |
244 | | - | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | 254 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
264 | 262 | | |
265 | | - | |
266 | 263 | | |
267 | | - | |
268 | | - | |
| 264 | + | |
| 265 | + | |
269 | 266 | | |
270 | 267 | | |
271 | 268 | | |
272 | 269 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 270 | + | |
279 | 271 | | |
280 | 272 | | |
281 | 273 | | |
282 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
283 | 277 | | |
284 | 278 | | |
285 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
553 | | - | |
554 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
555 | 567 | | |
556 | 568 | | |
557 | 569 | | |
| |||
0 commit comments