Print this page
OS-1566 filesystem limits for ZFS datasets
*** 19,28 ****
--- 19,29 ----
* CDDL HEADER END
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
* DSL permissions are stored in a two level zap attribute
* mechanism. The first level identifies the "class" of
*** 519,529 ****
/*
* Check if user has requested permission.
*/
int
! dsl_deleg_access_impl(dsl_dataset_t *ds, const char *perm, cred_t *cr)
{
dsl_dir_t *dd;
dsl_pool_t *dp;
void *cookie;
int error;
--- 520,531 ----
/*
* Check if user has requested permission.
*/
int
! dsl_deleg_access_impl(dsl_dataset_t *ds, const char *perm, cred_t *cr,
! boolean_t do_lock)
{
dsl_dir_t *dd;
dsl_pool_t *dp;
void *cookie;
int error;
*** 553,562 ****
--- 555,565 ----
}
avl_create(&permsets, perm_set_compare, sizeof (perm_set_t),
offsetof(perm_set_t, p_node));
+ if (do_lock)
rw_enter(&dp->dp_config_rwlock, RW_READER);
for (dd = ds->ds_dir; dd != NULL; dd = dd->dd_parent,
checkflag = ZFS_DELEG_DESCENDENT) {
uint64_t zapobj;
boolean_t expanded;
*** 614,623 ****
--- 617,627 ----
if (error == 0)
goto success;
}
error = EPERM;
success:
+ if (do_lock)
rw_exit(&dp->dp_config_rwlock);
cookie = NULL;
while ((setnode = avl_destroy_nodes(&permsets, &cookie)) != NULL)
kmem_free(setnode, sizeof (perm_set_t));
*** 633,643 ****
error = dsl_dataset_hold(dsname, FTAG, &ds);
if (error)
return (error);
! error = dsl_deleg_access_impl(ds, perm, cr);
dsl_dataset_rele(ds, FTAG);
return (error);
}
--- 637,647 ----
error = dsl_dataset_hold(dsname, FTAG, &ds);
if (error)
return (error);
! error = dsl_deleg_access_impl(ds, perm, cr, B_TRUE);
dsl_dataset_rele(ds, FTAG);
return (error);
}