Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/zfs/sa.c
Show First 20 Lines • Show All 1,496 Lines • ▼ Show 20 Lines | sa_lookup(sa_handle_t *hdl, sa_attr_type_t attr, void *buf, uint32_t buflen) | ||||
error = sa_lookup_locked(hdl, attr, buf, buflen); | error = sa_lookup_locked(hdl, attr, buf, buflen); | ||||
mutex_exit(&hdl->sa_lock); | mutex_exit(&hdl->sa_lock); | ||||
return (error); | return (error); | ||||
} | } | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
int | int | ||||
sa_lookup_uio(sa_handle_t *hdl, sa_attr_type_t attr, uio_t *uio) | sa_lookup_uio(sa_handle_t *hdl, sa_attr_type_t attr, zfs_uio_t *uio) | ||||
{ | { | ||||
int error; | int error; | ||||
sa_bulk_attr_t bulk; | sa_bulk_attr_t bulk; | ||||
bulk.sa_data = NULL; | bulk.sa_data = NULL; | ||||
bulk.sa_attr = attr; | bulk.sa_attr = attr; | ||||
bulk.sa_data_func = NULL; | bulk.sa_data_func = NULL; | ||||
ASSERT(hdl); | ASSERT(hdl); | ||||
mutex_enter(&hdl->sa_lock); | mutex_enter(&hdl->sa_lock); | ||||
if ((error = sa_attr_op(hdl, &bulk, 1, SA_LOOKUP, NULL)) == 0) { | if ((error = sa_attr_op(hdl, &bulk, 1, SA_LOOKUP, NULL)) == 0) { | ||||
error = uiomove((void *)bulk.sa_addr, MIN(bulk.sa_size, | error = zfs_uiomove((void *)bulk.sa_addr, MIN(bulk.sa_size, | ||||
uio_resid(uio)), UIO_READ, uio); | zfs_uio_resid(uio)), UIO_READ, uio); | ||||
} | } | ||||
mutex_exit(&hdl->sa_lock); | mutex_exit(&hdl->sa_lock); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* For the existed object that is upgraded from old system, its ondisk layout | * For the existed object that is upgraded from old system, its ondisk layout | ||||
* has no slot for the project ID attribute. But quota accounting logic needs | * has no slot for the project ID attribute. But quota accounting logic needs | ||||
▲ Show 20 Lines • Show All 730 Lines • Show Last 20 Lines |