Example #1
0
int nfs4_acls_init(void)
{
    LogDebug(COMPONENT_NFS_V4_ACL, "Initialize NFSv4 ACLs");
    LogDebug(COMPONENT_NFS_V4_ACL,
             "sizeof(fsal_ace_t)=%zu, sizeof(fsal_acl_t)=%zu",
             sizeof(fsal_ace_t), sizeof(fsal_acl_t));

    /* Initialize memory pool of ACLs. */
    fsal_acl_pool =
        pool_init(NULL, sizeof(fsal_acl_t), pool_basic_substrate, NULL,
                  NULL, NULL);

    /* Create hash table. */
    fsal_acl_hash = hashtable_init(&fsal_acl_hash_config);

    if (!fsal_acl_hash) {
        LogCrit(COMPONENT_NFS_V4_ACL,
                "ERROR creating hash table for NFSv4 ACLs");
        return NFS_V4_ACL_INTERNAL_ERROR;
    }

    nfs4_acls_test();

    return NFS_V4_ACL_SUCCESS;
}
Example #2
0
int nfs4_acls_init()
{
  LogDebug(COMPONENT_NFS_V4_ACL, "Initialize NFSv4 ACLs");
  LogDebug(COMPONENT_NFS_V4_ACL, "sizeof(fsal_ace_t)=%lu, sizeof(fsal_acl_t)=%lu", sizeof(fsal_ace_t), sizeof(fsal_acl_t));

  /* Initialize memory pool of ACLs. */
  MakePool(&fsal_acl_pool, nb_pool_prealloc, fsal_acl_t, NULL, NULL);

  /* Initialize memory pool of ACL keys. */
  MakePool(&fsal_acl_key_pool, nb_pool_prealloc, fsal_acl_key_t, NULL, NULL);

  /* Create hash table. */
  fsal_acl_hash = HashTable_Init(fsal_acl_hash_config);

  if(!fsal_acl_hash)
    {
      LogCrit(COMPONENT_NFS_V4_ACL, "ERROR creating hash table for NFSv4 ACLs");
      return NFS_V4_ACL_INTERNAL_ERROR;
    }

  nfs4_acls_test();

  return NFS_V4_ACL_SUCCESS;
}