Skip to content

Commit

Permalink
glfs: discard glfs_check_config
Browse files Browse the repository at this point in the history
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
  • Loading branch information
Prasanna Kumar Kalever committed Jun 21, 2017
1 parent 1a3721d commit 61bd03e
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions glfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,58 +430,6 @@ static char* tcmu_get_path( struct tcmu_device *dev)
return config;
}


static bool glfs_check_config(const char *cfgstring, char **reason)
{
char *path;
glfs_t *fs = NULL;
glfs_fd_t *gfd = NULL;
gluster_server *hosts = NULL; /* gluster server defination */
bool result = true;

path = strchr(cfgstring, '/');
if (!path) {
if (asprintf(reason, "No path found") == -1)
*reason = NULL;
result = false;
goto done;
}
path += 1; /* get past '/' */

fs = tcmu_create_glfs_object(path, &hosts);
if (!fs) {
tcmu_err("tcmu_create_glfs_object failed\n");
goto done;
}

gfd = glfs_open(fs, hosts->path, ALLOWED_BSOFLAGS);
if (!gfd) {
if (asprintf(reason, "glfs_open failed: %m") == -1)
*reason = NULL;
result = false;
goto unref;
}

if (glfs_access(fs, hosts->path, R_OK|W_OK) == -1) {
if (asprintf(reason, "glfs_access file not present, or not writable") == -1)
*reason = NULL;
result = false;
goto unref;
}

goto done;

unref:
gluster_cache_refresh(fs, path);

done:
if (gfd)
glfs_close(gfd);
gluster_free_server(&hosts);

return result;
}

static int tcmu_glfs_open(struct tcmu_device *dev)
{
struct glfs_state *gfsp;
Expand Down Expand Up @@ -681,8 +629,6 @@ struct tcmur_handler glfs_handler = {
.subtype = "glfs",
.cfg_desc = glfs_cfg_desc,

.check_config = glfs_check_config,

.open = tcmu_glfs_open,
.close = tcmu_glfs_close,
.read = tcmu_glfs_read,
Expand Down

0 comments on commit 61bd03e

Please sign in to comment.