Skip to content

Commit

Permalink
Merge pull request #3 from mulkieran/master-snap
Browse files Browse the repository at this point in the history
Master snap
  • Loading branch information
trgill authored Aug 30, 2016
2 parents 622300c + c58e01e commit a814ef8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
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

0 comments on commit a814ef8

Please sign in to comment.