コード例 #1
0
ファイル: export.c プロジェクト: srimalik/nfs-ganesha
/* Here and not static because proxy.c needs this function
 * but we also need access to pxy_exp_ops - I'd rather
 * keep the later static then the former */
fsal_status_t pxy_create_export(struct fsal_module *fsal_hdl,
				void *parse_node,
				struct config_error_type *err_type,
				const struct fsal_up_vector *up_ops)
{
	struct pxy_export *exp = gsh_calloc(1, sizeof(*exp));
	struct pxy_fsal_module *pxy =
	    container_of(fsal_hdl, struct pxy_fsal_module, module);
	fsal_status_t status = {0, 0};

	fsal_export_init(&exp->exp);
	pxy_export_ops_init(&exp->exp.exp_ops);
	exp->info = &pxy->special;
	exp->exp.fsal = fsal_hdl;
	op_ctx->fsal_export = &exp->exp;

	/* Stack MDCACHE on top */
	status = mdcache_export_init(up_ops, &exp->exp.up_ops);
	if (FSAL_IS_ERROR(status)) {
		LogDebug(COMPONENT_FSAL, "MDCACHE creation failed for PROXY");
		return status;
	}

	return fsalstat(ERR_FSAL_NO_ERROR, 0);
}
コード例 #2
0
ファイル: export.c プロジェクト: Anuradha-Talur/nfs-ganesha
/* Here and not static because proxy.c needs this function
 * but we also need access to pxy_exp_ops - I'd rather
 * keep the later static then the former */
fsal_status_t pxy_create_export(struct fsal_module *fsal_hdl,
				void *parse_node,
				struct config_error_type *err_type,
				const struct fsal_up_vector *up_ops)
{
	struct pxy_export *exp = gsh_calloc(1, sizeof(*exp));
	struct pxy_fsal_module *pxy =
	    container_of(fsal_hdl, struct pxy_fsal_module, module);

	if (!exp)
		return fsalstat(ERR_FSAL_NOMEM, ENOMEM);
	if (fsal_export_init(&exp->exp) != 0) {
		gsh_free(exp);
		return fsalstat(ERR_FSAL_NOMEM, ENOMEM);
	}
	pxy_export_ops_init(&exp->exp.exp_ops);
	exp->exp.up_ops = up_ops;
	exp->info = &pxy->special;
	exp->exp.fsal = fsal_hdl;
	op_ctx->fsal_export = &exp->exp;
	return fsalstat(ERR_FSAL_NO_ERROR, 0);
}