1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-25 06:25:13 +00:00

fix commit block fs directory to be created

This commit is contained in:
yixiang-zhang
2018-01-12 17:18:06 +08:00
committed by Jonathan Xu
parent fedef3faeb
commit 48950167c2
2 changed files with 1 additions and 30 deletions

View File

@@ -28,8 +28,6 @@ struct _BHandle {
};
typedef struct {
char *v0_block_dir;
int v0_block_dir_len;
char *block_dir;
int block_dir_len;
char *tmp_dir;
@@ -270,8 +268,6 @@ block_backend_fs_foreach_block (BlockBackend *bend,
#if defined MIGRATION
if (version > 0)
block_dir = g_build_filename (priv->block_dir, store_id, NULL);
else
block_dir = g_strdup(priv->v0_block_dir);
#else
block_dir = g_build_filename (priv->block_dir, store_id, NULL);
#endif
@@ -415,11 +411,7 @@ get_block_path (BlockBackend *bend,
if (version > 0) {
n = snprintf (path, SEAF_PATH_MAX, "%s/%s/", priv->block_dir, store_id);
pos += n;
} else {
memcpy (pos, priv->v0_block_dir, priv->v0_block_dir_len);
pos[priv->v0_block_dir_len] = '/';
pos += priv->v0_block_dir_len + 1;
}
} else
#else
n = snprintf (path, SEAF_PATH_MAX, "%s/%s/", priv->block_dir, store_id);
pos += n;
@@ -460,9 +452,6 @@ block_backend_fs_new (const char *seaf_dir, const char *tmp_dir)
priv = g_new0(FsPriv, 1);
bend->be_priv = priv;
priv->v0_block_dir = g_build_filename (seaf_dir, "blocks", NULL);
priv->v0_block_dir_len = strlen(priv->v0_block_dir);
priv->block_dir = g_build_filename (seaf_dir, "storage", "blocks", NULL);
priv->block_dir_len = strlen (priv->block_dir);