[Pvfs2-cvs] commit by slang in pvfs2/src/apps/kernel/linux: pvfs2-client-core.c

CVS commit program cvs at parl.clemson.edu
Mon Apr 7 12:30:52 EDT 2008


Update of /projects/cvsroot/pvfs2/src/apps/kernel/linux
In directory parlweb1:/tmp/cvs-serv1608/src/apps/kernel/linux

Modified Files:
      Tag: he-branch
	pvfs2-client-core.c 
Log Message:
hints and events.


Index: pvfs2-client-core.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/kernel/linux/pvfs2-client-core.c,v
diff -p -u -r1.92 -r1.92.4.1
--- pvfs2-client-core.c	6 Mar 2008 20:40:59 -0000	1.92
+++ pvfs2-client-core.c	7 Apr 2008 16:30:51 -0000	1.92.4.1
@@ -92,6 +92,7 @@ typedef struct
     char* gossip_mask;
     int logstamp_type;
     int logstamp_type_set;
+    int create_request_id;
     int standalone;
     /* kernel module buffer size settings */
     unsigned int dev_buffer_count;
@@ -123,7 +124,8 @@ typedef struct
 
     job_status_s jstat;
     struct PINT_dev_unexp_info info;
-
+    PVFS_hint * hints;
+    
     /* iox requests may post multiple operations at one shot */
     int num_ops, num_incomplete_ops;
     PVFS_sys_op_id op_id;
@@ -190,6 +192,7 @@ static struct PINT_dev_params s_desc_par
 static struct PINT_perf_counter* acache_pc = NULL;
 static struct PINT_perf_counter* static_acache_pc = NULL;
 static struct PINT_perf_counter* ncache_pc = NULL;
+static char hostname[100];
 
 /* used only for deleting all allocated vfs_request objects */
 vfs_request_t *s_vfs_request_array[MAX_NUM_OPS] = {NULL};
@@ -210,12 +213,15 @@ static int set_acache_parameters(options
 static void set_device_parameters(options_t *s_opts);
 static void reset_ncache_timeout(void);
 static int set_ncache_parameters(options_t* s_opts);
+static int create_request_id(PVFS_hint ** hint, vfs_request_t *vfs_request);
 
 static PVFS_object_ref perform_lookup_on_create_error(
     PVFS_object_ref parent,
     char *entry_name,
     PVFS_credentials *credentials,
-    int follow_link);
+    int follow_link, 
+    PVFS_hint * hints
+    );
 
 static int write_device_response(
     void *buffer_list,
@@ -425,6 +431,27 @@ static void finalize_ops_in_progress_tab
     }
 }
 
+#define REQ_LENGTH 100
+static int create_request_id(PVFS_hint ** hint, vfs_request_t *vfs_request)
+{
+    if (s_opts.create_request_id)
+    {
+        char str[REQ_LENGTH];
+        if( vfs_request->in_upcall.tgid != -1 ){
+            snprintf(str, REQ_LENGTH, "host:%s,pid:%d,tgid:%d", 
+                hostname, vfs_request->in_upcall.pid, 
+                vfs_request->in_upcall.tgid);
+        }else{
+            snprintf(str, REQ_LENGTH, "host:%s,pid:%d", 
+                hostname, vfs_request->in_upcall.pid);
+        }
+        
+        str[REQ_LENGTH-1] = 0;
+        PVFS_add_hint(hint, REQUEST_ID, str);
+    }
+    return 0;
+}
+
 static void *exec_remount(void *ptr)
 {
     pthread_mutex_lock(&remount_mutex);
@@ -471,6 +498,7 @@ static inline void log_operation_timing(
 static PVFS_error post_lookup_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
+    PVFS_hint * hints = NULL;
 
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
@@ -479,6 +507,7 @@ static PVFS_error post_lookup_request(vf
         vfs_request->in_upcall.req.lookup.parent_refn.fs_id,
         llu(vfs_request->in_upcall.req.lookup.parent_refn.handle));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_ref_lookup(
         vfs_request->in_upcall.req.lookup.parent_refn.fs_id,
         vfs_request->in_upcall.req.lookup.d_name,
@@ -486,7 +515,8 @@ static PVFS_error post_lookup_request(vf
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.lookup,
         vfs_request->in_upcall.req.lookup.sym_follow,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -502,21 +532,24 @@ static PVFS_error post_lookup_request(vf
 static PVFS_error post_create_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "Got a create request for %s (fsid %d | parent %llu)\n",
         vfs_request->in_upcall.req.create.d_name,
         vfs_request->in_upcall.req.create.parent_refn.fs_id,
         llu(vfs_request->in_upcall.req.create.parent_refn.handle));
-
+    
+    create_request_id(& hints, vfs_request);    
     ret = PVFS_isys_create(
         vfs_request->in_upcall.req.create.d_name,
         vfs_request->in_upcall.req.create.parent_refn,
         vfs_request->in_upcall.req.create.attributes,
         &vfs_request->in_upcall.credentials, NULL, NULL,
         &vfs_request->response.create,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -528,7 +561,8 @@ static PVFS_error post_create_request(vf
 static PVFS_error post_symlink_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "Got a symlink request from %s (fsid %d | parent %llu) to %s\n",
@@ -536,7 +570,8 @@ static PVFS_error post_symlink_request(v
         vfs_request->in_upcall.req.sym.parent_refn.fs_id,
         llu(vfs_request->in_upcall.req.sym.parent_refn.handle),
         vfs_request->in_upcall.req.sym.target);
-
+        
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_symlink(
         vfs_request->in_upcall.req.sym.entry_name,
         vfs_request->in_upcall.req.sym.parent_refn,
@@ -544,8 +579,9 @@ static PVFS_error post_symlink_request(v
         vfs_request->in_upcall.req.sym.attributes,
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.symlink,
-        &vfs_request->op_id, (void *)vfs_request);
-
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
+    
     if (ret < 0)
     {
         PVFS_perror_gossip("Posting symlink create failed", ret);
@@ -556,19 +592,22 @@ static PVFS_error post_symlink_request(v
 static PVFS_error post_getattr_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "got a getattr request for fsid %d | handle %llu\n",
         vfs_request->in_upcall.req.getattr.refn.fs_id,
         llu(vfs_request->in_upcall.req.getattr.refn.handle));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_getattr(
         vfs_request->in_upcall.req.getattr.refn,
         vfs_request->in_upcall.req.getattr.mask,
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.getattr,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -580,7 +619,8 @@ static PVFS_error post_getattr_request(v
 static PVFS_error post_setattr_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "got a setattr request for fsid %d | handle %llu [mask %d]\n",
@@ -588,11 +628,13 @@ static PVFS_error post_setattr_request(v
         llu(vfs_request->in_upcall.req.setattr.refn.handle),
         vfs_request->in_upcall.req.setattr.attributes.mask);
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_setattr(
         vfs_request->in_upcall.req.setattr.refn,
         vfs_request->in_upcall.req.setattr.attributes,
         &vfs_request->in_upcall.credentials,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -604,7 +646,8 @@ static PVFS_error post_setattr_request(v
 static PVFS_error post_remove_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "Got a remove request for %s under fsid %d and "
@@ -612,11 +655,13 @@ static PVFS_error post_remove_request(vf
         vfs_request->in_upcall.req.remove.parent_refn.fs_id,
         llu(vfs_request->in_upcall.req.remove.parent_refn.handle));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_remove(
         vfs_request->in_upcall.req.remove.d_name,
         vfs_request->in_upcall.req.remove.parent_refn,
         &vfs_request->in_upcall.credentials,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -628,7 +673,8 @@ static PVFS_error post_remove_request(vf
 static PVFS_error post_mkdir_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "Got a mkdir request for %s (fsid %d | parent %llu)\n",
@@ -636,13 +682,15 @@ static PVFS_error post_mkdir_request(vfs
         vfs_request->in_upcall.req.mkdir.parent_refn.fs_id,
         llu(vfs_request->in_upcall.req.mkdir.parent_refn.handle));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_mkdir(
         vfs_request->in_upcall.req.mkdir.d_name,
         vfs_request->in_upcall.req.mkdir.parent_refn,
         vfs_request->in_upcall.req.mkdir.attributes,
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.mkdir,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -654,20 +702,23 @@ static PVFS_error post_mkdir_request(vfs
 static PVFS_error post_readdir_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(GOSSIP_CLIENTCORE_DEBUG, "Got a readdir request "
                  "for %llu,%d (token %llu)\n",
                  llu(vfs_request->in_upcall.req.readdir.refn.handle),
                  vfs_request->in_upcall.req.readdir.refn.fs_id,
                  llu(vfs_request->in_upcall.req.readdir.token));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_readdir(
         vfs_request->in_upcall.req.readdir.refn,
         vfs_request->in_upcall.req.readdir.token,
         vfs_request->in_upcall.req.readdir.max_dirent_count,
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.readdir,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -705,7 +756,8 @@ static PVFS_error post_readdirplus_reque
 static PVFS_error post_rename_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "Got a rename request for %s under fsid %d and "
@@ -717,13 +769,15 @@ static PVFS_error post_rename_request(vf
         vfs_request->in_upcall.req.rename.new_parent_refn.fs_id,
         llu(vfs_request->in_upcall.req.rename.new_parent_refn.handle));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_rename(
         vfs_request->in_upcall.req.rename.d_old_name,
         vfs_request->in_upcall.req.rename.old_parent_refn,
         vfs_request->in_upcall.req.rename.d_new_name,
         vfs_request->in_upcall.req.rename.new_parent_refn,
         &vfs_request->in_upcall.credentials,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -735,7 +789,8 @@ static PVFS_error post_rename_request(vf
 static PVFS_error post_truncate_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG, "Got a truncate request for %llu under "
         "fsid %d to be size %lld\n",
@@ -743,11 +798,13 @@ static PVFS_error post_truncate_request(
         vfs_request->in_upcall.req.truncate.refn.fs_id,
         lld(vfs_request->in_upcall.req.truncate.size));
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_truncate(
         vfs_request->in_upcall.req.truncate.refn,
         vfs_request->in_upcall.req.truncate.size,
         &vfs_request->in_upcall.credentials,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -759,7 +816,8 @@ static PVFS_error post_truncate_request(
 static PVFS_error post_getxattr_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "got a getxattr request for fsid %d | handle %llu\n",
@@ -799,6 +857,7 @@ static PVFS_error post_getxattr_request(
     vfs_request->response.geteattr.val_array[0].buffer_sz = 
         PVFS_REQ_LIMIT_VAL_LEN;
 
+    create_request_id(& hints, vfs_request);
     /* Remember to free these up */
     ret = PVFS_isys_geteattr_list(
         vfs_request->in_upcall.req.getxattr.refn,
@@ -807,7 +866,9 @@ static PVFS_error post_getxattr_request(
         &vfs_request->key,
         &vfs_request->response.geteattr,
         &vfs_request->op_id, 
+        hints, 
         (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -819,7 +880,8 @@ static PVFS_error post_getxattr_request(
 static PVFS_error post_setxattr_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "got a setxattr request for fsid %d | handle %llu\n",
@@ -838,6 +900,7 @@ static PVFS_error post_setxattr_request(
     vfs_request->val.buffer_sz = 
         vfs_request->in_upcall.req.setxattr.keyval.val_sz;
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_seteattr_list(
         vfs_request->in_upcall.req.setxattr.refn,
         &vfs_request->in_upcall.credentials,
@@ -846,7 +909,9 @@ static PVFS_error post_setxattr_request(
         &vfs_request->val,
         vfs_request->in_upcall.req.setxattr.flags,
         &vfs_request->op_id, 
+        hints, 
         (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -858,7 +923,8 @@ static PVFS_error post_setxattr_request(
 static PVFS_error post_removexattr_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "got a removexattr request for fsid %d | handle %llu\n",
@@ -872,12 +938,15 @@ static PVFS_error post_removexattr_reque
         GOSSIP_CLIENTCORE_DEBUG,
         "removexattr key %s\n", (char *) vfs_request->key.buffer);
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_deleattr(
         vfs_request->in_upcall.req.setxattr.refn,
         &vfs_request->in_upcall.credentials,
         &vfs_request->key,
         &vfs_request->op_id, 
+        hints, 
         (void *)vfs_request);
+    vfs_request->hints = hints;
 
     if (ret < 0)
     {
@@ -890,7 +959,8 @@ static PVFS_error post_listxattr_request
 {
     PVFS_error ret = -PVFS_EINVAL;
     int i = 0, j = 0;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG,
         "got a listxattr request for fsid %d | handle %llu\n",
@@ -932,6 +1002,8 @@ static PVFS_error post_listxattr_request
         free(vfs_request->response.listeattr.key_array);
         return -PVFS_ENOMEM;
     }
+    
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_listeattr(
         vfs_request->in_upcall.req.listxattr.refn,
         vfs_request->in_upcall.req.listxattr.token,
@@ -939,8 +1011,10 @@ static PVFS_error post_listxattr_request
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.listeattr,
         &vfs_request->op_id, 
+        hints, 
         (void *)vfs_request);
-
+    vfs_request->hints = hints;
+    
     if (ret < 0)
     {
         PVFS_perror_gossip("Posting listxattr failed", ret);
@@ -1377,16 +1451,19 @@ static PVFS_error service_param_request(
 static PVFS_error post_statfs_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG, "Got a statfs request for fsid %d\n",
         vfs_request->in_upcall.req.statfs.fs_id);
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_statfs(
         vfs_request->in_upcall.req.statfs.fs_id,
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.statfs,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
 
     vfs_request->out_downcall.status = ret;
     vfs_request->out_downcall.type = vfs_request->in_upcall.type;
@@ -1507,7 +1584,8 @@ static PVFS_error post_io_readahead_requ
 static PVFS_error post_io_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
 #ifdef USE_MMAP_RA_CACHE
     int val = 0, amt_returned = 0;
     void *buf = NULL;
@@ -1621,6 +1699,7 @@ static PVFS_error post_io_request(vfs_re
         PVFS_BYTE, &vfs_request->file_req);
     assert(ret == 0);
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_io(
         vfs_request->in_upcall.req.io.refn, vfs_request->file_req,
         vfs_request->in_upcall.req.io.offset, 
@@ -1628,7 +1707,7 @@ static PVFS_error post_io_request(vfs_re
         &vfs_request->in_upcall.credentials,
         &vfs_request->response.io,
         vfs_request->in_upcall.req.io.io_type,
-        &vfs_request->op_id, (void *)vfs_request);
+        &vfs_request->op_id, hints, (void *)vfs_request);
 
     if (ret < 0)
     {
@@ -1671,6 +1750,8 @@ static PVFS_error post_iox_request(vfs_r
     int32_t i, num_ops_posted, iox_count, iox_index;
     int32_t *mem_sizes = NULL;
     PVFS_error ret = -PVFS_EINVAL;
+    PVFS_hint * hints = NULL;
+
     struct read_write_x *rwx = (struct read_write_x *) vfs_request->in_upcall.trailer_buf;
 
     if (vfs_request->in_upcall.trailer_size <= 0 || rwx == NULL)
@@ -1797,7 +1878,9 @@ static PVFS_error post_iox_request(vfs_r
             gossip_err("post_iox_request: request_hindexed failed\n");
             break;
         }
-        /* post the I/O */
+
+        create_request_id(& hints, vfs_request);
+       /* post the I/O */
         ret = PVFS_isys_io(
             vfs_request->in_upcall.req.iox.refn, vfs_request->file_req_a[i],
             0, 
@@ -1806,6 +1889,7 @@ static PVFS_error post_iox_request(vfs_r
             &vfs_request->response.iox[i],
             vfs_request->in_upcall.req.iox.io_type,
             &vfs_request->op_ids[i],
+           hints,
             (void *)vfs_request);
 
         if (ret < 0)
@@ -1901,17 +1985,20 @@ static PVFS_error service_operation_canc
 static PVFS_error post_fsync_request(vfs_request_t *vfs_request)
 {
     PVFS_error ret = -PVFS_EINVAL;
-
+    PVFS_hint * hints = NULL;
+    
     gossip_debug(
         GOSSIP_CLIENTCORE_DEBUG, "Got a flush request for %llu,%d\n",
         llu(vfs_request->in_upcall.req.fsync.refn.handle),
         vfs_request->in_upcall.req.fsync.refn.fs_id);
 
+    create_request_id(& hints, vfs_request);
     ret = PVFS_isys_flush(
         vfs_request->in_upcall.req.fsync.refn,
         &vfs_request->in_upcall.credentials,
-        &vfs_request->op_id, (void *)vfs_request);
-
+        &vfs_request->op_id, hints, (void *)vfs_request);
+    vfs_request->hints = hints;
+    
     if (ret < 0)
     {
         PVFS_perror_gossip("Posting flush failed", ret);
@@ -1923,15 +2010,15 @@ static PVFS_object_ref perform_lookup_on
     PVFS_object_ref parent,
     char *entry_name,
     PVFS_credentials *credentials,
-    int follow_link)
+    int follow_link, 
+    PVFS_hint * hints)
 {
     PVFS_error ret = 0;
     PVFS_sysresp_lookup lookup_response;
     PVFS_object_ref refn = { PVFS_HANDLE_NULL, PVFS_FS_ID_NULL };
-
     ret = PVFS_sys_ref_lookup(
         parent.fs_id, entry_name, parent, credentials,
-        &lookup_response, follow_link);
+        &lookup_response, follow_link, hints);
 
     if (ret)
     {
@@ -2186,11 +2273,14 @@ static inline void package_downcall_memb
                 */
                 if (*error_code == -PVFS_EEXIST)
                 {
+                    PVFS_hint * hints = NULL;
+                    create_request_id(& hints, vfs_request);
                     vfs_request->out_downcall.resp.create.refn =
                         perform_lookup_on_create_error(
                             vfs_request->in_upcall.req.create.parent_refn,
                             vfs_request->in_upcall.req.create.d_name,
-                            &vfs_request->in_upcall.credentials, 1);
+                            &vfs_request->in_upcall.credentials, 1, hints);
+                    vfs_request->hints = hints;
 
                     if (vfs_request->out_downcall.resp.create.refn.handle ==
                         PVFS_HANDLE_NULL)
@@ -2638,6 +2728,7 @@ static inline PVFS_error repost_unexp_vf
     PINT_dev_release_unexpected(&vfs_request->info);
     PINT_sys_release(vfs_request->op_id);
 
+    PVFS_free_hint(& vfs_request->hints);
     memset(vfs_request, 0, sizeof(vfs_request_t));
     vfs_request->is_dev_unexp = 1;
 
@@ -3161,6 +3252,16 @@ int main(int argc, char **argv)
     memset(&s_opts, 0, sizeof(options_t));
     parse_args(argc, argv, &s_opts);
 
+    ret = gethostname(hostname, 100);
+    if(ret < 0)
+    {
+        if( s_opts.create_request_id ){
+            fprintf(stderr, "gethostname could not determine hostname ! "
+                "Request ID can not transfer hostname to server \n");
+            hostname[0] = 0;
+        }
+    }
+
     if(!s_opts.standalone)
     {
         struct rlimit lim = {0,0};
@@ -3487,6 +3588,7 @@ static void print_help(char *progname)
     printf("--logtype=file|syslog         specify writing logs to file or syslog\n");
     printf("--logstamp=none|usec|datetime overrides the default log message's time stamp\n");
     printf("--gossip-mask=MASK_LIST       gossip logging mask\n");
+    printf("--create-request-id           create a id which is transfered to the server\n");
     printf("--desc-count=VALUE            overrides the default # of kernel buffer descriptors\n");
     printf("--desc-size=VALUE             overrides the default size of each kernel buffer descriptor\n");
 }
@@ -3514,6 +3616,7 @@ static void parse_args(int argc, char **
         {"logfile",1,0,0},
         {"logtype",1,0,0},
         {"logstamp",1,0,0},
+        {"create-request-id",0,0,0},
         {"standalone",0,0,0},
         {0,0,0,0}
     };
@@ -3688,6 +3791,10 @@ static void parse_args(int argc, char **
                 else if (strcmp("gossip-mask", cur_option) == 0)
                 {
                     opts->gossip_mask = optarg;
+                }
+                else if (strcmp("create-request-id", cur_option) == 0)
+                {
+                    opts->create_request_id = 1;   
                 }
                 else if (strcmp("standalone", cur_option) == 0)
                 {



More information about the Pvfs2-cvs mailing list