Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master snap #3

Merged
merged 3 commits into from
Aug 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/libstratis.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,11 @@ STRATIS_EXPORT int stratis_svolume_get(struct stratis_ctx *ctx, svolume_t **svol

spool = g_hash_table_lookup(ctx->spool_table->table, poolname);

if (spool == NULL || spool->svolume_table == NULL)
rc = STRATIS_NOTFOUND;
if (spool == NULL)
return STRATIS_POOL_NOTFOUND;

if (spool->svolume_table == NULL)
return STRATIS_VOLUME_NOTFOUND;

*svolume = g_hash_table_lookup(spool->svolume_table->table, volumename);

Expand Down Expand Up @@ -1000,11 +1003,6 @@ STRATIS_EXPORT int stratis_svolume_create_snapshot(svolume_t *svolume,

}

STRATIS_EXPORT int stratis_svolume_destroy_snapshot(svolume_t *svolume, char *name) {
int rc = STRATIS_OK;

return rc;
}

/*
* Devs
Expand Down
1 change: 0 additions & 1 deletion lib/stratis/libstratis.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ int stratis_svolume_table_find(svolume_table_t *svolume_table, svolume_t **svolu
char *name);
int stratis_svolume_create_snapshot(svolume_t *svolume, spool_t *spool,
svolume_t **snapshot, char *name);
int stratis_svolume_destroy_snapshot(svolume_t *svolume, char *name);


/*
Expand Down
22 changes: 2 additions & 20 deletions stratisd/stratis_dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ static int get_volume_object_path(sd_bus_message *m, void *userdata, sd_bus_erro
}

rc = stratis_svolume_get(ctx, &svolume, poolname, volumename);
if (rc != STRATIS_OK)
goto out;

if (svolume != NULL) {
dbus_name = svolume->dbus_name;
Expand Down Expand Up @@ -828,25 +830,6 @@ static int create_snapshot(sd_bus_message *m, void *userdata, sd_bus_error *erro
stratis_get_user_message(rc));
}

static int destroy_snapshot(sd_bus_message *m, void *userdata, sd_bus_error *error) {
int rc = STRATIS_OK;
svolume_t *svolume = userdata;
char *name = NULL;

rc = sd_bus_message_read(m, "s", &name);

if (rc < 0) {
rc = STRATIS_BAD_PARAM;
goto out;
}

rc = stratis_svolume_destroy_snapshot(svolume, name);

out:
return sd_bus_reply_method_return(m, "sis", svolume->dbus_name, rc,
stratis_get_user_message(rc));
}


static int destroy_volumes(sd_bus_message *m, void *userdata,
sd_bus_error *error) {
Expand Down Expand Up @@ -1397,7 +1380,6 @@ static const sd_bus_vtable svolume_vtable[] = {
SD_BUS_PROPERTY(VOLUME_ID, "s", get_svolume_property, 0,
SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_METHOD("CreateSnapshot", "s", "sis", create_snapshot, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("DestroySnapshot", "s", "sis", destroy_snapshot, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Rename", "s", "sis", rename_volume, 0),
SD_BUS_METHOD("SetMountPoint", "s", "is", set_mount_point_volume, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetQuota", "s", "is", set_quota_volume, SD_BUS_VTABLE_UNPRIVILEGED),
Expand Down