[Pvfs2-cvs] commit by kunkel in pvfs2/src/io/trove/trove-dbpf:
dbpf-bstream-aio.c dbpf-error.c dbpf-mgmt.c
CVS commit program
cvs at parl.clemson.edu
Sat Aug 19 09:09:37 EDT 2006
Update of /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf
In directory parlweb1:/tmp/cvs-serv3901/src/io/trove/trove-dbpf
Modified Files:
Tag: kunkel-branch
dbpf-bstream-aio.c dbpf-error.c dbpf-mgmt.c
Log Message:
Added PVFS-hint, changed tests for pwrite/odirect/transactions/aio dbpf
support to allow users to explicitly enable or disable the functionality.
In the aio implementation is a bug since somebody else modified it.
Index: dbpf-bstream-aio.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-bstream-aio.c,v
diff -p -u -r1.24.6.9 -r1.24.6.10
--- dbpf-bstream-aio.c 9 Aug 2006 20:04:40 -0000 1.24.6.9
+++ dbpf-bstream-aio.c 19 Aug 2006 13:09:37 -0000 1.24.6.10
@@ -58,7 +58,7 @@ extern gen_mutex_t dbpf_attr_cache_mutex
#define DBPF_MAX_IOS_IN_PROGRESS 16
static int s_dbpf_ios_in_progress = 0;
static gen_mutex_t s_dbpf_io_mutex = GEN_MUTEX_INITIALIZER;
-dbpf_op_queue_s s_dbpf_io_ready_queue;
+dbpf_op_queue_t s_dbpf_io_ready_queue;
static int issue_or_delay_io_operation(
dbpf_queued_op_t * cur_op,
Index: dbpf-error.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-error.c,v
diff -p -u -r1.8.22.3 -r1.8.22.4
--- dbpf-error.c 24 Jul 2006 17:20:48 -0000 1.8.22.3
+++ dbpf-error.c 19 Aug 2006 13:09:37 -0000 1.8.22.4
@@ -24,11 +24,13 @@ PVFS_error dbpf_db_error_to_trove_error(
{
case 0:
return 0;
+ /*
case DB_VERSION_MISMATCH:
gossip_err("Error: DB_VERSION_MISMATCH encountered,"
" version of libdb is different from the libdb which created"
" the database environment. This should never happen!\n");
return TROVE_EIO;
+ */
case DB_OLD_VERSION:
gossip_err("Error: DB_OLD_VERSION encountered,"
" version of libdb is different from the libdb which created"
Index: dbpf-mgmt.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-mgmt.c,v
diff -p -u -r1.89.2.8 -r1.89.2.9
--- dbpf-mgmt.c 18 Aug 2006 05:12:10 -0000 1.89.2.8
+++ dbpf-mgmt.c 19 Aug 2006 13:09:37 -0000 1.89.2.9
@@ -637,6 +637,8 @@ static int dbpf_storage_create(char *sto
char sto_attrib_dbname[PATH_MAX] = {0};
char collections_dbname[PATH_MAX] = {0};
char deletion_path_name[PATH_MAX];
+ DB_ENV * env;
+ int error;
DBPF_GET_STORAGE_DIRNAME(storage_dirname, PATH_MAX, stoname);
@@ -646,6 +648,12 @@ static int dbpf_storage_create(char *sto
return ret;
}
+ env = dbpf_getdb_env(storage_dirname, 0, &error);
+ if (error)
+ {
+ return error;
+ }
+
DBPF_GET_STO_ATTRIB_DBNAME(sto_attrib_dbname, PATH_MAX, stoname);
ret = dbpf_db_create(storage_dirname, sto_attrib_dbname, NULL);
if (ret != 0)
@@ -668,6 +676,8 @@ static int dbpf_storage_create(char *sto
*/
DBPF_GET_SHADOW_REMOVE_BSTREAM_DIRNAME(deletion_path_name, PATH_MAX,
stoname);
+
+ dbpf_putdb_env(env, storage_dirname);
ret = DBPF_MKDIR(deletion_path_name, 0755);
if(ret != 0)
@@ -768,7 +778,7 @@ static int dbpf_collection_create(char *
struct stat dbstat;
char path_name[PATH_MAX] = {0}, dir[PATH_MAX] = {0};
char coll_path[PATH_MAX] = {0};
- DB_ENV * env;
+ DB_ENV * env = NULL;
if (my_storage_p == NULL)
{
@@ -835,6 +845,12 @@ static int dbpf_collection_create(char *
}
}
+ /* per-collection environment */
+ if ((env = dbpf_getdb_env(coll_path, COLL_ENV_FLAGS, &ret)) == NULL)
+ {
+ return -trove_errno_to_trove_error(errno);
+ }
+
DBPF_GET_COLL_DIRNAME(coll_path, PATH_MAX, sto_p->name, new_coll_id);
ret = DBPF_MKDIR(coll_path, 0755);
if (ret != 0)
@@ -1615,6 +1631,15 @@ static struct dbpf_storage *dbpf_storage
sto_p->refct = 0;
sto_p->flags = flags;
+ sto_p->env = dbpf_getdb_env(sto_p->name, 0, error_p);
+ if (*error_p)
+ {
+ free(sto_p->name);
+ free(sto_p);
+ my_storage_p = NULL;
+ return NULL;
+ }
+
DBPF_GET_STO_ATTRIB_DBNAME(path_name, PATH_MAX, stoname);
sto_p->sto_attr_db = dbpf_db_open(sto_p->name, path_name, NULL, error_p, NULL);
if (sto_p->sto_attr_db == NULL)
@@ -1635,7 +1660,8 @@ static struct dbpf_storage *dbpf_storage
my_storage_p = NULL;
return NULL;
}
-
+
+ dbpf_putdb_env(sto_p->env, path_name);
my_storage_p = sto_p;
return sto_p;
}
More information about the Pvfs2-cvs
mailing list