* Free an ABD allocated from abd_get_offset() or abd_get_from_buf(). Will not * free the underlying scatterlist or buffer. */
| 220 | * free the underlying scatterlist or buffer. |
| 221 | */ |
| 222 | void |
| 223 | abd_put(abd_t *abd) |
| 224 | { |
| 225 | if (abd == NULL) |
| 226 | return; |
| 227 | |
| 228 | abd_verify(abd); |
| 229 | ASSERT(!(abd->abd_flags & ABD_FLAG_OWNER)); |
| 230 | |
| 231 | if (abd->abd_parent != NULL) { |
| 232 | (void) zfs_refcount_remove_many(&abd->abd_parent->abd_children, |
| 233 | abd->abd_size, abd); |
| 234 | } |
| 235 | |
| 236 | if (abd_is_gang(abd)) |
| 237 | abd_put_gang_abd(abd); |
| 238 | |
| 239 | zfs_refcount_destroy(&abd->abd_children); |
| 240 | abd_free_struct(abd); |
| 241 | } |
| 242 | |
| 243 | /* |
| 244 | * Allocate an ABD that must be linear, along with its own underlying data |
no test coverage detected