[Pvfs2-cvs] commit by vilayann in pvfs2-1/src/io/trove: README
pvfs2-storage.h trove-internal.h trove-types.h trove.c trove.h
CVS commit program
cvs at parl.clemson.edu
Wed Aug 9 16:17:46 EDT 2006
Update of /projects/cvsroot/pvfs2-1/src/io/trove
In directory parlweb1:/tmp/cvs-serv7687/src/io/trove
Modified Files:
Tag: posix-extensions-branch
README pvfs2-storage.h trove-internal.h trove-types.h trove.c
trove.h
Log Message:
Reverse merge changes from HEAD to posix-extensions-branch.
Index: README
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/README,v
diff -p -u -r1.1.1.1 -r1.1.1.1.32.1
--- README 9 Jan 2003 17:24:03 -0000 1.1.1.1
+++ README 9 Aug 2006 20:17:46 -0000 1.1.1.1.32.1
@@ -11,16 +11,16 @@ which he can install wherever. So that'
[snip]
-If you look at the test programs in src/io/trove/test/, in particular
+If you look at the test programs in test/io/trove/, in particular
trove-mkfs.c, you'll see how the functions get called. The functions
available for the most part match exactly with what is described in
-doc/pvfs2-design-storageint/storage-interface.tex. There are some
+doc/design/storage-interface.tex. There are some
management operations that are NOT described in that document, and that
might be confusing.
The code in src/io/trove/ is basically wrapper code to handle mapping
to a particular instance of a trove implementation. The code in
-src/io/trove/trove_dbpf is the only existing implementation. It is
-described in doc/pvfs2-trove-dbpf/trove-dbpf.tex.
+src/io/trove/trove-dbpf/ is the only existing implementation. It is
+described in doc/design/trove-dbpf.tex.
[snip]
Index: pvfs2-storage.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/pvfs2-storage.h,v
diff -p -u -r1.11.2.1 -r1.11.2.2
--- pvfs2-storage.h 7 Jun 2006 03:20:56 -0000 1.11.2.1
+++ pvfs2-storage.h 9 Aug 2006 20:17:46 -0000 1.11.2.2
@@ -97,60 +97,93 @@ struct PVFS_ds_storedattr_s
};
typedef struct PVFS_ds_storedattr_s PVFS_ds_storedattr;
+#define PVFS_ds_init_time(__dsa) \
+do { \
+ (__dsa)->ctime = time(NULL); \
+ (__dsa)->atime = time(NULL); \
+ (__dsa)->mtime = time(NULL); \
+} while (0)
+
#define PVFS_ds_attr_to_stored(__from, __to) \
do { \
(__to) = * ((PVFS_ds_storedattr *) &(__from)); \
} while (0)
-#define PVFS_ds_stored_to_attr(__from, __to, __b_size)\
+#define PVFS_ds_stored_to_attr(__from, __to, __b_size) \
do { \
- memcpy(&__to, &__from, sizeof(PVFS_ds_storedattr)); \
+ memcpy(&(__to), &(__from), sizeof(PVFS_ds_storedattr)); \
(__to).b_size = (__b_size); \
} while (0)
-#define PVFS_ds_attr_to_object_attr(__dsa, __oa) \
-do { \
- __oa->owner = __dsa->uid; __oa->group = __dsa->gid; \
- __oa->perms = __dsa->mode; __oa->ctime = __dsa->ctime; \
- __oa->mtime = __dsa->mtime; __oa->atime = __dsa->atime;\
- __oa->objtype = __dsa->type; \
- __oa->u.meta.dfile_count = __dsa->dfile_count; \
- __oa->u.meta.dist_size = __dsa->dist_size; \
+#define PVFS_ds_attr_to_object_attr(__dsa, __oa) \
+do { \
+ (__oa)->owner = (__dsa)->uid; \
+ (__oa)->group = (__dsa)->gid; \
+ (__oa)->perms = (__dsa)->mode; \
+ (__oa)->ctime = (__dsa)->ctime; \
+ (__oa)->mtime = (__dsa)->mtime; \
+ (__oa)->atime = (__dsa)->atime; \
+ (__oa)->objtype = (__dsa)->type; \
+ (__oa)->u.meta.dfile_count = (__dsa)->dfile_count; \
+ (__oa)->u.meta.dist_size = (__dsa)->dist_size; \
} while(0)
#define PVFS_object_attr_to_ds_attr(__oa, __dsa) \
do { \
- __dsa->uid = __oa->owner; __dsa->gid = __oa->group; \
- __dsa->mode = __oa->perms; __dsa->ctime = __oa->ctime; \
- __dsa->mtime = __oa->mtime; __dsa->atime = __oa->atime;\
- __dsa->type = __oa->objtype; \
- __dsa->dfile_count = __oa->u.meta.dfile_count; \
- __dsa->dist_size = __oa->u.meta.dist_size; \
+ (__dsa)->uid = (__oa)->owner; \
+ (__dsa)->gid = (__oa)->group; \
+ (__dsa)->mode = (__oa)->perms; \
+ (__dsa)->ctime = (__oa)->ctime; \
+ (__dsa)->mtime = (__oa)->mtime; \
+ (__dsa)->atime = (__oa)->atime; \
+ (__dsa)->type = (__oa)->objtype; \
+ (__dsa)->dfile_count = (__oa)->u.meta.dfile_count; \
+ (__dsa)->dist_size = (__oa)->u.meta.dist_size; \
} while(0)
#define PVFS_object_attr_overwrite_setable(dest, src) \
do { \
- if (src->mask & PVFS_ATTR_COMMON_UID) \
- dest->owner = src->owner; \
- if (src->mask & PVFS_ATTR_COMMON_GID) \
- dest->group = src->group; \
- if (src->mask & PVFS_ATTR_COMMON_PERM) \
- dest->perms = src->perms; \
- if (src->mask & PVFS_ATTR_COMMON_ATIME) \
- dest->atime = src->atime; \
- if (src->mask & PVFS_ATTR_COMMON_CTIME) \
- dest->ctime = src->ctime; \
- if (src->mask & PVFS_ATTR_COMMON_MTIME) \
- dest->mtime = src->mtime; \
- if (src->mask & PVFS_ATTR_COMMON_TYPE) \
+ if ((src)->mask & PVFS_ATTR_COMMON_UID) \
+ (dest)->owner = (src)->owner; \
+ if ((src)->mask & PVFS_ATTR_COMMON_GID) \
+ (dest)->group = (src)->group; \
+ if ((src)->mask & PVFS_ATTR_COMMON_PERM) \
+ (dest)->perms = (src)->perms; \
+ if ((src)->mask & PVFS_ATTR_COMMON_ATIME) \
+ { \
+ if ((src)->mask & PVFS_ATTR_COMMON_ATIME_SET) \
+ { \
+ (dest)->atime = (src)->atime; \
+ } \
+ else \
+ { \
+ (dest)->atime = time(NULL); \
+ } \
+ } \
+ if ((src)->mask & PVFS_ATTR_COMMON_MTIME) \
+ { \
+ if ((src)->mask & PVFS_ATTR_COMMON_MTIME_SET) \
+ { \
+ (dest)->mtime = (src)->mtime; \
+ } \
+ else \
+ { \
+ (dest)->mtime = time(NULL); \
+ } \
+ } \
+ if ((src)->mask & PVFS_ATTR_COMMON_CTIME) \
+ { \
+ (dest)->ctime = time(NULL); \
+ } \
+ if ((src)->mask & PVFS_ATTR_COMMON_TYPE) \
{ \
- dest->objtype = src->objtype; \
- if ((src->objtype == PVFS_TYPE_METAFILE) && \
- (src->mask & PVFS_ATTR_META_DIST)) \
- dest->u.meta.dist_size = src->u.meta.dist_size; \
- if ((src->objtype == PVFS_TYPE_METAFILE) && \
- (src->mask & PVFS_ATTR_META_DFILES)) \
- dest->u.meta.dfile_count = src->u.meta.dfile_count;\
+ (dest)->objtype = (src)->objtype; \
+ if (((src)->objtype == PVFS_TYPE_METAFILE) && \
+ ((src)->mask & PVFS_ATTR_META_DIST)) \
+ (dest)->u.meta.dist_size = (src)->u.meta.dist_size;\
+ if (((src)->objtype == PVFS_TYPE_METAFILE) && \
+ ((src)->mask & PVFS_ATTR_META_DFILES)) \
+ (dest)->u.meta.dfile_count = (src)->u.meta.dfile_count;\
} \
} while(0)
Index: trove-internal.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/trove-internal.h,v
diff -p -u -r1.21.28.1 -r1.21.28.2
--- trove-internal.h 9 May 2006 23:10:12 -0000 1.21.28.1
+++ trove-internal.h 9 Aug 2006 20:17:46 -0000 1.21.28.2
@@ -132,6 +132,7 @@ struct TROVE_keyval_ops
TROVE_coll_id coll_id,
TROVE_handle handle,
TROVE_keyval_s *key_p,
+ TROVE_keyval_s *val_p,
TROVE_ds_flags flags,
TROVE_vtag_s *inout_vtag,
void *user_ptr,
@@ -177,6 +178,7 @@ struct TROVE_keyval_ops
TROVE_handle handle,
TROVE_keyval_s *key_array,
TROVE_keyval_s *val_array,
+ TROVE_ds_state *err_array,
int count,
TROVE_ds_flags flags,
TROVE_vtag_s *out_vtag,
@@ -202,6 +204,14 @@ struct TROVE_keyval_ops
void *user_ptr,
TROVE_context_id context_id,
TROVE_op_id *out_op_id_p);
+ int (*keyval_get_handle_info)(
+ TROVE_coll_id coll_id,
+ TROVE_handle handle,
+ TROVE_ds_flags flags,
+ TROVE_keyval_handle_info *info,
+ void *user_ptr,
+ TROVE_context_id context_id,
+ TROVE_op_id *out_op_id_p);
};
struct TROVE_dspace_ops
Index: trove-types.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/trove-types.h,v
diff -p -u -r1.30 -r1.30.28.1
--- trove-types.h 22 Dec 2004 20:03:52 -0000 1.30
+++ trove-types.h 9 Aug 2006 20:17:46 -0000 1.30.28.1
@@ -37,6 +37,7 @@ typedef PVFS_ds_type TROVE
typedef PVFS_vtag TROVE_vtag_s;
typedef PVFS_ds_flags TROVE_ds_flags;
typedef PVFS_ds_keyval TROVE_keyval_s;
+typedef PVFS_ds_keyval_handle_info TROVE_keyval_handle_info;
typedef PVFS_ds_position TROVE_ds_position;
typedef PVFS_ds_attributes TROVE_ds_attributes_s;
typedef PVFS_ds_attributes TROVE_ds_attributes;
Index: trove.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/trove.c,v
diff -p -u -r1.4.6.2 -r1.4.6.3
--- trove.c 7 Jun 2006 03:20:56 -0000 1.4.6.2
+++ trove.c 9 Aug 2006 20:17:46 -0000 1.4.6.3
@@ -30,6 +30,7 @@ extern struct TROVE_mgmt_ops *mgmt_me
struct PINT_perf_counter* PINT_server_pc = NULL;
int TROVE_db_cache_size_bytes = 0;
+int TROVE_shm_key_hint = 0;
/** Initiate reading from a contiguous region in a bstream into a
* contiguous region in memory.
@@ -354,6 +355,7 @@ int trove_keyval_remove(
TROVE_coll_id coll_id,
TROVE_handle handle,
TROVE_keyval_s* key_p,
+ TROVE_keyval_s* val_p,
TROVE_ds_flags flags,
TROVE_vtag_s* vtag,
void* user_ptr,
@@ -370,6 +372,7 @@ int trove_keyval_remove(
coll_id,
handle,
key_p,
+ val_p,
flags,
vtag,
user_ptr,
@@ -474,6 +477,7 @@ int trove_keyval_read_list(
TROVE_handle handle,
TROVE_keyval_s* key_array,
TROVE_keyval_s* val_array,
+ TROVE_ds_state* err_array,
int count,
TROVE_ds_flags flags,
TROVE_vtag_s* vtag,
@@ -503,6 +507,7 @@ int trove_keyval_read_list(
handle,
key_array,
val_array,
+ err_array,
count,
flags,
vtag,
@@ -582,6 +587,30 @@ int trove_keyval_flush(
out_op_id_p);
}
+int trove_keyval_get_handle_info(TROVE_coll_id coll_id,
+ TROVE_handle handle,
+ TROVE_ds_flags flags,
+ TROVE_keyval_handle_info *info,
+ void * user_ptr,
+ TROVE_context_id context_id,
+ TROVE_op_id *out_op_id_p)
+{
+ int method_id;
+
+ method_id = map_coll_id_to_method(coll_id);
+ if (method_id < 0) {
+ return -1; /* NEED STATUS TYPE FOR THIS */
+ }
+ return keyval_method_table[method_id]->keyval_get_handle_info(
+ coll_id,
+ handle,
+ flags,
+ info,
+ user_ptr,
+ context_id,
+ out_op_id_p);
+}
+
/** Initiate creation of a new data space.
*/
int trove_dspace_create(
@@ -960,6 +989,11 @@ int trove_collection_setinfo(
{
TROVE_db_cache_size_bytes = *((int *)parameter);
return 0;
+ }
+ if(option == TROVE_SHM_KEY_HINT)
+ {
+ TROVE_shm_key_hint = *((int*)parameter);
+ return(0);
}
method_id = map_coll_id_to_method(coll_id);
Index: trove.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/trove.h,v
diff -p -u -r1.29.2.2 -r1.29.2.3
--- trove.h 7 Jun 2006 03:20:56 -0000 1.29.2.2
+++ trove.h 9 Aug 2006 20:17:46 -0000 1.29.2.3
@@ -59,9 +59,7 @@ enum
TROVE_DB_CACHE_MMAP = 1 << 5,
TROVE_DB_CACHE_SYS = 1 << 6,
- TROVE_IMMEDIATE_COMPLETION = 1 << 7,
- TROVE_DSPACE_SYNC_COALESCE = 1 << 8,
- TROVE_KEYVAL_SYNC_COALESCE = 1 << 9
+ TROVE_KEYVAL_HANDLE_COUNT = 1 << 7
};
/* get/setinfo option flags */
@@ -75,7 +73,10 @@ enum
TROVE_COLLECTION_ATTR_CACHE_INITIALIZE,
TROVE_DB_CACHE_SIZE_BYTES,
TROVE_COLLECTION_COALESCING_HIGH_WATERMARK,
- TROVE_COLLECTION_COALESCING_LOW_WATERMARK
+ TROVE_COLLECTION_COALESCING_LOW_WATERMARK,
+ TROVE_COLLECTION_META_SYNC_MODE,
+ TROVE_COLLECTION_IMMEDIATE_COMPLETION,
+ TROVE_SHM_KEY_HINT
};
/** Initializes the Trove layer. Must be called before any other Trove
@@ -239,6 +240,7 @@ int trove_keyval_remove(
TROVE_coll_id coll_id,
TROVE_handle handle,
TROVE_keyval_s *key_p,
+ TROVE_keyval_s *val_p,
TROVE_ds_flags flags,
TROVE_vtag_s *vtag,
void *user_ptr,
@@ -284,6 +286,7 @@ int trove_keyval_read_list(
TROVE_handle handle,
TROVE_keyval_s *key_array,
TROVE_keyval_s *val_array,
+ TROVE_ds_state *err_array,
int count,
TROVE_ds_flags flags,
TROVE_vtag_s *vtag,
@@ -309,6 +312,14 @@ int trove_keyval_flush(TROVE_coll_id col
void *user_ptr,
TROVE_context_id context_id,
TROVE_op_id *out_op_id_p);
+
+int trove_keyval_get_handle_info(TROVE_coll_id coll_id,
+ TROVE_handle handle,
+ TROVE_ds_flags flags,
+ TROVE_keyval_handle_info *info,
+ void * user_ptr,
+ TROVE_context_id context_id,
+ TROVE_op_id *out_op_id_p);
int trove_dspace_create(TROVE_coll_id coll_id,
TROVE_handle_extent_array *handle_extent_array,
More information about the Pvfs2-cvs
mailing list