1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-24 10:50:22 +03:00

s3:libsmbconf: add transactions to the libsmbconf api

This is useful for wrapping higher level aggregate operations
in transactions. The text backend implementations just return
WERR_OK, the registry backend implementatoins use the
regdb_transaction_start|commit|cancel routines just added.

Michael
This commit is contained in:
Michael Adam 2009-02-24 10:52:30 +01:00
parent 9f97674ef7
commit bd121b532c
5 changed files with 57 additions and 0 deletions

View File

@ -399,3 +399,18 @@ WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx)
return werr;
}
WERROR smbconf_transaction_start(struct smbconf_ctx *ctx)
{
return ctx->ops->transaction_start(ctx);
}
WERROR smbconf_transaction_commit(struct smbconf_ctx *ctx)
{
return ctx->ops->transaction_commit(ctx);
}
WERROR smbconf_transaction_cancel(struct smbconf_ctx *ctx)
{
return ctx->ops->transaction_cancel(ctx);
}

View File

@ -94,4 +94,8 @@ WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service);
WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx);
WERROR smbconf_transaction_start(struct smbconf_ctx *ctx);
WERROR smbconf_transaction_commit(struct smbconf_ctx *ctx);
WERROR smbconf_transaction_cancel(struct smbconf_ctx *ctx);
#endif /* _LIBSMBCONF_H_ */

View File

@ -68,6 +68,9 @@ struct smbconf_ops {
uint32_t num_includes, const char **includes);
WERROR (*delete_includes)(struct smbconf_ctx *ctx,
const char *service);
WERROR (*transaction_start)(struct smbconf_ctx *ctx);
WERROR (*transaction_commit)(struct smbconf_ctx *ctx);
WERROR (*transaction_cancel)(struct smbconf_ctx *ctx);
};
struct smbconf_ctx {

View File

@ -612,6 +612,20 @@ static WERROR smbconf_txt_delete_includes(struct smbconf_ctx *ctx,
return WERR_NOT_SUPPORTED;
}
static WERROR smbconf_txt_transaction_start(struct smbconf_ctx *ctx)
{
return WERR_OK;
}
static WERROR smbconf_txt_transaction_commit(struct smbconf_ctx *ctx)
{
return WERR_OK;
}
static WERROR smbconf_txt_transaction_cancel(struct smbconf_ctx *ctx)
{
return WERR_OK;
}
static struct smbconf_ops smbconf_ops_txt = {
.init = smbconf_txt_init,
@ -633,6 +647,9 @@ static struct smbconf_ops smbconf_ops_txt = {
.get_includes = smbconf_txt_get_includes,
.set_includes = smbconf_txt_set_includes,
.delete_includes = smbconf_txt_delete_includes,
.transaction_start = smbconf_txt_transaction_start,
.transaction_commit = smbconf_txt_transaction_commit,
.transaction_cancel = smbconf_txt_transaction_cancel,
};

View File

@ -1066,6 +1066,21 @@ done:
return werr;
}
static WERROR smbconf_reg_transaction_start(struct smbconf_ctx *ctx)
{
return regdb_transaction_start();
}
static WERROR smbconf_reg_transaction_commit(struct smbconf_ctx *ctx)
{
return regdb_transaction_commit();
}
static WERROR smbconf_reg_transaction_cancel(struct smbconf_ctx *ctx)
{
return regdb_transaction_cancel();
}
struct smbconf_ops smbconf_ops_reg = {
.init = smbconf_reg_init,
.shutdown = smbconf_reg_shutdown,
@ -1086,6 +1101,9 @@ struct smbconf_ops smbconf_ops_reg = {
.get_includes = smbconf_reg_get_includes,
.set_includes = smbconf_reg_set_includes,
.delete_includes = smbconf_reg_delete_includes,
.transaction_start = smbconf_reg_transaction_start,
.transaction_commit = smbconf_reg_transaction_commit,
.transaction_cancel = smbconf_reg_transaction_cancel,
};