[Pvfs2-cvs] commit by kunkel in pvfs2/src/common/misc: pvfs2-debug.c pint-event.c digest.c server-config.c xattr-utils.h pint-util.c server-config.h pvfs2-internal.h xattr-utils.c pvfs2-util.c mkspace.c

CVS commit program cvs at parl.clemson.edu
Sat Dec 2 06:20:35 EST 2006


Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb1:/tmp/cvs-serv18213/src/common/misc

Modified Files:
      Tag: kunkel-hint-branch
	pvfs2-debug.c pint-event.c digest.c server-config.c 
	xattr-utils.h pint-util.c server-config.h pvfs2-internal.h 
	xattr-utils.c pvfs2-util.c mkspace.c 
Log Message:
Upgrade to current CVS version


Index: pvfs2-debug.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-debug.c,v
diff -p -u -r1.43.2.2 -r1.43.2.3
--- pvfs2-debug.c	27 Sep 2006 08:57:26 -0000	1.43.2.2
+++ pvfs2-debug.c	2 Dec 2006 11:20:33 -0000	1.43.2.3
@@ -104,6 +104,10 @@ static __keyword_mask_t s_keyword_mask_m
     { "keyval", GOSSIP_DBPF_KEYVAL_DEBUG },
     /* Debug the metadata sync coalescing code */
     { "coalesce", GOSSIP_DBPF_COALESCE_DEBUG },
+    /* Display the  hostnames instead of IP addrs in debug output */
+    { "access_hostnames", GOSSIP_ACCESS_HOSTNAMES },
+    /* Show the client device events */
+    { "dev", GOSSIP_DEV_DEBUG },
     /* Everything except the periodic events.  Useful for debugging */
     { "verbose",
       (__DEBUG_ALL & ~(GOSSIP_PERFCOUNTER_DEBUG | GOSSIP_STATE_MACHINE_DEBUG))

Index: pint-event.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-event.c,v
diff -p -u -r1.13.18.8 -r1.13.18.9
--- pint-event.c	1 Oct 2006 08:38:16 -0000	1.13.18.8
+++ pint-event.c	2 Dec 2006 11:20:33 -0000	1.13.18.9
@@ -40,12 +40,13 @@ int PINT_event_bmi_start, PINT_event_bmi
 int PINT_event_flow_start, PINT_event_flow_stop;
 int PINT_event_unexpected_decode;
 
+extern char * mpe_logfile;
+#endif
+
 int * PINT_event_perf_counter_update = 0; /* event number for perf counters*/
 char ** PINT_event_perf_counter_key_names = 0;
 int PINT_event_perf_counter_keys = 0;
 
-extern char * mpe_logfile;
-#endif
 
 void PINT_event_initalize_perf_counter_events(int number){
     PINT_event_perf_counter_update = calloc(number,sizeof(int));

Index: digest.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/digest.c,v
diff -p -u -r1.4.6.1 -r1.4.6.2
--- digest.c	25 Sep 2006 12:39:47 -0000	1.4.6.1
+++ digest.c	2 Dec 2006 11:20:33 -0000	1.4.6.2
@@ -8,6 +8,7 @@
 
 #ifdef WITH_OPENSSL
 
+
 #ifdef HAVE_OPENSSL_EVP_H
 #include <openssl/evp.h>
 #endif
@@ -20,8 +21,10 @@
 #ifdef __GEN_POSIX_LOCKING__
 #include <pthread.h>
 #include <linux/unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
 
-static _syscall0(pid_t,gettid)
 
 static gen_mutex_t *mutex = NULL;
 static pthread_once_t once_initialize = PTHREAD_ONCE_INIT;
@@ -40,11 +43,14 @@ static void do_lock(int mode, int n, con
 
 static unsigned long get_tid(void)
 {
-	/* NOTE:
-	 * This could fail on non 2.6 kernels, since gettid()
-	 * probably does not exist?
-	 */
-	return gettid();
+	 /* If gettid syscall does not exist, fall back to getpid, which I
+	  * think will do something similar to gettid on non-ntpl
+	  * implementations */
+#if defined(__NR_gettid)
+	return syscall(__NR_gettid);
+#else
+	return getpid();
+#endif
 }
 
 static void callback_init(void)

Index: server-config.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config.c,v
diff -p -u -r1.90.2.2 -r1.90.2.3
--- server-config.c	27 Sep 2006 08:57:26 -0000	1.90.2.2
+++ server-config.c	2 Dec 2006 11:20:33 -0000	1.90.2.3
@@ -18,6 +18,7 @@
 #include "server-config.h"
 #include "pvfs2.h"
 #include "job.h"
+#include "trove.h"
 #include "gossip.h"
 #include "extent-utils.h"
 #include "mkspace.h"
@@ -92,7 +93,6 @@ static DOTCONF_CB(get_attr_cache_keyword
 static DOTCONF_CB(get_attr_cache_size);
 static DOTCONF_CB(get_attr_cache_max_num_elems);
 static DOTCONF_CB(get_trove_sync_meta);
-static DOTCONF_CB(get_trove_alt_aio);
 static DOTCONF_CB(get_trove_sync_data);
 static DOTCONF_CB(get_db_cache_size_bytes);
 static DOTCONF_CB(get_trove_max_concurrent_io);
@@ -110,6 +110,7 @@ static DOTCONF_CB(get_client_retry_delay
 static DOTCONF_CB(get_secret_key);
 static DOTCONF_CB(get_coalescing_high_watermark);
 static DOTCONF_CB(get_coalescing_low_watermark);
+static DOTCONF_CB(get_trove_method);
 
 static FUNC_ERRORHANDLER(errorhandler);
 const char *contextchecker(command_t *cmd, unsigned long mask);
@@ -552,12 +553,12 @@ static const configoption_t options[] =
      /* Specifies the timeout value in seconds for BMI jobs on the server.
       */
      {"ServerJobBMITimeoutSecs",ARG_INT, get_server_job_bmi_timeout,NULL,
-         CTX_DEFAULTS|CTX_GLOBAL, "30"},
+         CTX_DEFAULTS|CTX_GLOBAL, "300"},
      
      /* Specifies the timeout value in seconds for TROVE jobs on the server.
       */
      {"ServerJobFlowTimeoutSecs",ARG_INT, get_server_job_flow_timeout,NULL,
-         CTX_DEFAULTS|CTX_GLOBAL, "30"},
+         CTX_DEFAULTS|CTX_GLOBAL, "300"},
      
      /* Specifies the timeout value in seconds for BMI jobs on the client.
       */
@@ -763,12 +764,6 @@ static const configoption_t options[] =
     {"DBCacheType", ARG_STR, get_db_cache_type, NULL,
         CTX_STORAGEHINTS, "sys"},
 
-    /* enable alternate AIO implementation for certain types of I/O
-     * operations (experimental 
-     */
-    {"TroveAltAIOMode",ARG_STR, get_trove_alt_aio, NULL, 
-        CTX_DEFAULTS|CTX_GLOBAL,"no"},
-
     /* Specifies the format of the date/timestamp that events will have
      * in the event log.  Possible values are:
      *
@@ -816,6 +811,22 @@ static const configoption_t options[] =
     {"CoalescingLowWatermark", ARG_INT, get_coalescing_low_watermark, NULL,
         CTX_STORAGEHINTS, "1"},
 
+    /* This option specifies the method used for trove.  Currently the
+     * dbpf method is the default.  Other methods include 'alt-aio'.
+     *
+     * Note that this option can be specified in either the <Defaults>
+     * context of the main fs.conf, or in a filesystem specific <StorageHints>
+     * context, but the semantics of TroveMethod in the <Defaults>
+     * context is different from other options.  The TroveMethod in the
+     * <Defaults> context only specifies which method is used at
+     * server initialization.  It does not specify the default TroveMethod
+     * for all the filesystems the server supports.  To set the TroveMethod
+     * for a filesystem, the TroveMethod must be placed in the <StorageHints>
+     * context for that filesystem.
+     */
+    {"TroveMethod", ARG_STR, get_trove_method, NULL, 
+        CTX_DEFAULTS|CTX_GLOBAL|CTX_STORAGEHINTS, "dbpf"},
+
     /* Specifies the file system's key for use in HMAC-based digests of
      * client operations.
      */
@@ -1973,28 +1984,6 @@ DOTCONF_CB(get_attr_cache_max_num_elems)
     return NULL;
 }
 
-DOTCONF_CB(get_trove_alt_aio)
-{
-    struct server_configuration_s *config_s = 
-        (struct server_configuration_s *)cmd->context;
-
-    if(strcasecmp(cmd->data.str, "yes") == 0)
-    {
-        config_s->trove_alt_aio_mode = 1;
-    }
-    else if(strcasecmp(cmd->data.str, "no") == 0)
-    {
-        config_s->trove_alt_aio_mode = 0;
-    }
-    else
-    {
-        return("TroveAltAIOMode value must be 'yes' or 'no'.\n");
-    }
-
-    return NULL;
-}
-
-
 DOTCONF_CB(get_trove_sync_meta)
 {
     struct filesystem_configuration_s *fs_conf = NULL;
@@ -2415,6 +2404,40 @@ DOTCONF_CB(get_coalescing_low_watermark)
     fs_conf->coalescing_low_watermark = cmd->data.value;
     return NULL;
 }
+
+DOTCONF_CB(get_trove_method)
+{
+    int * method;
+    struct server_configuration_s *config_s =
+        (struct server_configuration_s *)cmd->context;
+
+    method = &config_s->trove_method;
+    if(config_s->configuration_context == CTX_STORAGEHINTS)
+    {
+        /* we must be in a storagehints inside a filesystem context */
+        struct filesystem_configuration_s *fs_conf =
+            (struct filesystem_configuration_s *)
+            PINT_llist_head(config_s->file_systems);
+
+        method = &fs_conf->trove_method; 
+    }
+
+    if(!strcmp(cmd->data.str, "dbpf"))
+    {
+        *method = TROVE_METHOD_DBPF;
+    }
+    else if(!strcmp(cmd->data.str, "alt-aio"))
+    {
+        *method = TROVE_METHOD_DBPF_ALTAIO;
+    }
+    else
+    {
+        return "Error unknown TroveMethod option\n";
+    }
+    return NULL;
+}
+
+
 
 /*
  * Function: PINT_config_release

Index: xattr-utils.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/xattr-utils.h,v
diff -p -u -r1.2 -r1.2.18.1
--- xattr-utils.h	7 Mar 2006 21:35:08 -0000	1.2
+++ xattr-utils.h	2 Dec 2006 11:20:33 -0000	1.2.18.1
@@ -10,8 +10,12 @@
 #include "pvfs2-config.h"
 
 #ifndef HAVE_FGETXATTR_PROTOTYPE
+#ifndef HAVE_FGETXATTR_EXTRA_ARGS
 /* prototype taken from fgetxattr(2) on Fedora FC4 */
 ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size);
+#else
+ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size, int pos, int opts);
+#endif
 #endif
 
 #endif

Index: pint-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-util.c,v
diff -p -u -r1.13.2.1 -r1.13.2.2
--- pint-util.c	25 Sep 2006 12:39:47 -0000	1.13.2.1
+++ pint-util.c	2 Dec 2006 11:20:33 -0000	1.13.2.2
@@ -230,6 +230,7 @@ int PINT_copy_object_attr(PVFS_object_at
                 }
                 dest->u.meta.dist_size = src->u.meta.dist_size;
             }
+            memcpy(&dest->u.meta.hint, &src->u.meta.hint, sizeof(dest->u.meta.hint));
         }
 
         if (src->mask & PVFS_ATTR_SYMLNK_TARGET)

Index: server-config.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config.h,v
diff -p -u -r1.53.2.2 -r1.53.2.3
--- server-config.h	27 Sep 2006 08:57:26 -0000	1.53.2.2
+++ server-config.h	2 Dec 2006 11:20:34 -0000	1.53.2.3
@@ -91,6 +91,8 @@ typedef struct filesystem_configuration_
     int fp_buffer_size;
     int fp_buffers_per_flow;
 
+    int trove_method;
+
     /* Export flags bitwise OR of flags specified */
     int exp_flags;
 
@@ -182,6 +184,8 @@ typedef struct server_configuration_s
     int trove_max_concurrent_io;    /* allow the number of aio operations to
                                      * be configurable.
                                      */
+    int trove_method;
+
 } server_configuration_s;
 
 int PINT_parse_config(

Index: pvfs2-internal.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-internal.h,v
diff -p -u -r1.4.2.1 -r1.4.2.2
--- pvfs2-internal.h	25 Sep 2006 12:39:47 -0000	1.4.2.1
+++ pvfs2-internal.h	2 Dec 2006 11:20:35 -0000	1.4.2.2
@@ -25,6 +25,27 @@
  * specifier and a parameter are mismatched, that machine will issue
  * a warning, while 64-bit machines will silently perform the cast.
  */
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#endif
+
+#ifdef BITS_PER_LONG
+/* don't use SIZEOF_* fields generated at configure */
+#if BITS_PER_LONG == 32
+#  define llu(x) (x)
+#  define lld(x) (x)
+#  define SCANF_lld "%lld"
+#elif BITS_PER_LONG == 64
+#  define llu(x) (unsigned long long)(x)
+#  define lld(x) (long long)(x)
+#define SCANF_lld "%ld"
+#else
+#  error Unexpected  BITS_PER_LONG
+#endif
+
+#else
+ 
 #if SIZEOF_LONG_INT == 4 
 #  define llu(x) (x)
 #  define lld(x) (x)
@@ -37,6 +58,8 @@
 #  error Unexpected sizeof(long int)
 #endif
 
+#endif /* BITS_PER_LONG */
+
 /* key string definition macros.  These are used by the server and
  * by the client (in the case of xattrs with viewdist, etc).
  */
@@ -54,6 +77,16 @@
 
 #define SYMLINK_TARGET_KEYSTR   "st\0"
 #define SYMLINK_TARGET_KEYLEN   3
+
+/* Optional xattrs have "user.pvfs2." as a prefix */
+#define SPECIAL_DIST_NAME_KEYSTR        "dist_name\0"
+#define SPECIAL_DIST_NAME_KEYLEN         21
+#define SPECIAL_DIST_PARAMS_KEYSTR      "dist_params\0"
+#define SPECIAL_DIST_PARAMS_KEYLEN       23
+#define SPECIAL_NUM_DFILES_KEYSTR       "num_dfiles\0"
+#define SPECIAL_NUM_DFILES_KEYLEN        22
+#define SPECIAL_METAFILE_HINT_KEYSTR    "meta_hint\0"
+#define SPECIAL_METAFILE_HINT_KEYLEN    21
 
 #define IO_MAX_REGIONS 64
 

Index: xattr-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/xattr-utils.c,v
diff -p -u -r1.2 -r1.2.22.1
--- xattr-utils.c	23 Feb 2006 23:29:25 -0000	1.2
+++ xattr-utils.c	2 Dec 2006 11:20:35 -0000	1.2.22.1
@@ -13,7 +13,11 @@
 #include "xattr-utils.h"
 
 #ifndef HAVE_FGETXATTR
+#ifndef HAVE_FGETXATTR_EXTRA_ARGS
 ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size)
+#else
+ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size, int pos, int opts )
+#endif
 {
     errno = ENOSYS;
     return -1;

Index: pvfs2-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-util.c,v
diff -p -u -r1.90.6.1 -r1.90.6.2
--- pvfs2-util.c	25 Sep 2006 12:39:47 -0000	1.90.6.1
+++ pvfs2-util.c	2 Dec 2006 11:20:35 -0000	1.90.6.2
@@ -164,6 +164,7 @@ int PVFS_util_copy_sys_attr(
         dest_attr->dfile_count = src_attr->dfile_count;
         dest_attr->objtype = src_attr->objtype;
         dest_attr->mask = src_attr->mask;
+        dest_attr->flags = src_attr->flags;
 
         if (src_attr->mask & PVFS_ATTR_SYS_SIZE)
         {

Index: mkspace.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/mkspace.c,v
diff -p -u -r1.39.4.2 -r1.39.4.3
--- mkspace.c	26 Sep 2006 13:03:13 -0000	1.39.4.2
+++ mkspace.c	2 Dec 2006 11:20:35 -0000	1.39.4.3
@@ -25,7 +25,6 @@
 #include "pvfs2-internal.h"
 #include "pint-util.h"
 
-static char *dir_ent_string = DIRECTORY_ENTRY_KEYSTR;
 static char *lost_and_found_string = "lost+found";
 
 static TROVE_handle s_used_handles[4] =
@@ -128,7 +127,6 @@ int pvfs2_mkspace(
     TROVE_handle_extent cur_extent;
     TROVE_handle_extent_array extent_array;
     TROVE_context_id trove_context = -1;
-    char *method_name = NULL;
     char *merged_handle_ranges = NULL;
     TROVE_handle new_root_handle = TROVE_HANDLE_NULL;
     TROVE_handle root_dirdata_handle = TROVE_HANDLE_NULL;
@@ -158,7 +156,10 @@ int pvfs2_mkspace(
           try to initialize; fails if storage space isn't there, which
           is exactly what we're expecting in this case.
         */
-        ret = trove_initialize(storage_space, 0, &method_name, 0);
+        ret = trove_initialize(TROVE_METHOD_DBPF, 
+			       NULL, 
+			       storage_space, 
+			       0);
         if (ret > -1)
         {
             gossip_err("error: storage space %s already "
@@ -166,7 +167,7 @@ int pvfs2_mkspace(
             return -1;
         }
 
-        ret = trove_storage_create(storage_space, NULL, &op_id);
+        ret = trove_storage_create(TROVE_METHOD_DBPF, storage_space, NULL, &op_id);
         if (ret != 1)
         {
             gossip_err("error: storage create failed; aborting!\n");
@@ -175,7 +176,9 @@ int pvfs2_mkspace(
     }
 
     /* now that the storage space exists, initialize trove properly */
-    ret = trove_initialize(storage_space, 0, &method_name, 0);
+    ret = trove_initialize(
+	TROVE_METHOD_DBPF, NULL, 
+	storage_space, 0);
     if (ret < 0)
     {
 	gossip_err("error: trove initialize failed; aborting!\n");
@@ -186,12 +189,13 @@ int pvfs2_mkspace(
                   storage_space);
 
     /* try to look up collection used to store file system */
-    ret = trove_collection_lookup(collection, &coll_id, NULL, &op_id);
+    ret = trove_collection_lookup(
+	TROVE_METHOD_DBPF, collection, &coll_id, NULL, &op_id);
     if (ret == 1)
     {
 	mkspace_print(verbose, "warning: collection lookup succeeded "
                       "before it should; aborting!\n");
-	trove_finalize();
+	trove_finalize(TROVE_METHOD_DBPF);
 	return -1;
     }
 
@@ -205,7 +209,8 @@ int pvfs2_mkspace(
     }
 
     /* make sure a collection lookup succeeds */
-    ret = trove_collection_lookup(collection, &coll_id, NULL, &op_id);
+    ret = trove_collection_lookup(
+	TROVE_METHOD_DBPF, collection, &coll_id, NULL, &op_id);
     if (ret != 1)
     {
 	mkspace_print(verbose,"error: collection lookup failed for "
@@ -555,8 +560,8 @@ int pvfs2_mkspace(
             "with handle %llu\n", llu(lost_and_found_dirdata_handle));
         s_used_handles[3] = lost_and_found_dirdata_handle;
 
-        key.buffer = dir_ent_string;
-        key.buffer_sz = strlen(dir_ent_string) + 1;
+        key.buffer = DIRECTORY_ENTRY_KEYSTR;
+        key.buffer_sz = DIRECTORY_ENTRY_KEYLEN;
         val.buffer = &lost_and_found_dirdata_handle;
         val.buffer_sz = sizeof(TROVE_handle);
 
@@ -620,7 +625,7 @@ int pvfs2_mkspace(
     {
         trove_close_context(coll_id, trove_context);
     }
-    trove_finalize();
+    trove_finalize(TROVE_METHOD_DBPF);
 
     mkspace_print(verbose, "collection created:\n"
                   "\troot handle = %llu, coll id = %d, "
@@ -637,14 +642,15 @@ int pvfs2_rmspace(
     int verbose)
 {
     int ret = -1;
-    char *method_name = NULL;
     TROVE_op_id op_id;
     static int trove_is_initialized = 0;
 
     /* try to initialize; fails if storage space isn't there */
     if (!trove_is_initialized)
     {
-        ret = trove_initialize(storage_space, 0, &method_name, 0);
+        ret = trove_initialize(
+	    TROVE_METHOD_DBPF, NULL,
+	    storage_space, 0);
         if (ret == -1)
         {
             gossip_err("error: storage space %s does not "
@@ -657,7 +663,8 @@ int pvfs2_rmspace(
     mkspace_print(verbose, "Attempting to remove collection %s\n",
                   collection);
 
-    ret = trove_collection_remove(collection, NULL, &op_id);
+    ret = trove_collection_remove(
+	TROVE_METHOD_DBPF, collection, NULL, &op_id);
     mkspace_print(
         verbose, "PVFS2 Collection %s removed %s\n", collection,
         (((ret == 1) || (ret == -TROVE_ENOENT)) ? "successfully" :
@@ -665,13 +672,14 @@ int pvfs2_rmspace(
 
     if (!remove_collection_only)
     {
-		  /*
-		  * it is a bit weird to do a trove_finaliz() prior to blowing away
-		  * the storage space, but this allows the __db files of the DB env
-		  * to be blown away for the rmdir() to work correctly!
-		  */
-		  trove_finalize();
-        ret = trove_storage_remove(storage_space, NULL, &op_id);
+        ret = trove_storage_remove(
+	    TROVE_METHOD_DBPF, storage_space, NULL, &op_id);
+	/*
+	 * it is a bit weird to do a trove_finaliz() prior to blowing away
+	 * the storage space, but this allows the __db files of the DB env
+	 * to be blown away for the rmdir() to work correctly!
+	 */
+	trove_finalize(TROVE_METHOD_DBPF);
         mkspace_print(
             verbose, "PVFS2 Storage Space %s removed %s\n",
             storage_space, (((ret == 1) || (ret == -TROVE_ENOENT)) ?
@@ -681,3 +689,4 @@ int pvfs2_rmspace(
     }
     return ret;
 }
+



More information about the Pvfs2-cvs mailing list