| 54 | } |
| 55 | |
| 56 | fn unregister_ring<FD>(fd: FD) -> Result<()> |
| 57 | where |
| 58 | FD: AsRawFd + AsFd, |
| 59 | { |
| 60 | let mut update = io_uring_rsrc_update::default(); |
| 61 | update.offset = fd.as_raw_fd() as u32; |
| 62 | update.data = io_uring_ptr::null(); |
| 63 | |
| 64 | do_register( |
| 65 | fd, |
| 66 | true, |
| 67 | IoringRegisterOp::UnregisterRingFds, |
| 68 | (&update as *const io_uring_rsrc_update as *mut io_uring_rsrc_update).cast::<c_void>(), |
| 69 | 1, |
| 70 | )?; |
| 71 | |
| 72 | Ok(()) |
| 73 | } |
| 74 | |
| 75 | /// Set bounded and unbounded async kernel worker counts to 0, to test |
| 76 | /// registering with registered ring fd. |