* update or add new attribute */
| 2038 | * update or add new attribute |
| 2039 | */ |
| 2040 | int |
| 2041 | sa_update(sa_handle_t *hdl, sa_attr_type_t type, |
| 2042 | void *buf, uint32_t buflen, dmu_tx_t *tx) |
| 2043 | { |
| 2044 | int error; |
| 2045 | sa_bulk_attr_t bulk; |
| 2046 | |
| 2047 | VERIFY3U(buflen, <=, SA_ATTR_MAX_LEN); |
| 2048 | |
| 2049 | bulk.sa_attr = type; |
| 2050 | bulk.sa_data_func = NULL; |
| 2051 | bulk.sa_length = buflen; |
| 2052 | bulk.sa_data = buf; |
| 2053 | |
| 2054 | mutex_enter(&hdl->sa_lock); |
| 2055 | error = sa_bulk_update_impl(hdl, &bulk, 1, tx); |
| 2056 | mutex_exit(&hdl->sa_lock); |
| 2057 | return (error); |
| 2058 | } |
| 2059 | |
| 2060 | /* |
| 2061 | * Return size of an attribute |
no test coverage detected