diff options
Diffstat (limited to 'rpc/glfs-operations.c')
-rw-r--r-- | rpc/glfs-operations.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rpc/glfs-operations.c b/rpc/glfs-operations.c index 9ae8ec5..72de38f 100644 --- a/rpc/glfs-operations.c +++ b/rpc/glfs-operations.c @@ -20,6 +20,10 @@ glusterBlockVolumeInit(char *volume, int *errCode, char **errMsg) struct glfs *glfs; int ret; + glfs = queryCache(volume); + if (glfs) { + return glfs; + } glfs = glfs_new(volume); if (!glfs) { @@ -67,6 +71,12 @@ glusterBlockVolumeInit(char *volume, int *errCode, char **errMsg) goto out; } + if (appendNewEntry(volume, glfs)) { + *errCode = ENOMEM; + LOG("gfapi", GB_LOG_ERROR, "allocation failed in appendNewEntry(%s)", volume); + goto out; + } + return glfs; out: |