[Pvfs2-cvs] commit by elaine in pvfs2/src/proto: pvfs2-req-proto.h

CVS commit program cvs at parl.clemson.edu
Mon Apr 28 16:44:05 EDT 2008


Update of /projects/cvsroot/pvfs2/src/proto
In directory parlweb1:/tmp/cvs-serv25206/src/proto

Modified Files:
      Tag: cu-sandbox-branch
	pvfs2-req-proto.h 
Log Message:



Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.151.4.8 -r1.151.4.9
--- pvfs2-req-proto.h	15 Apr 2008 20:19:27 -0000	1.151.4.8
+++ pvfs2-req-proto.h	28 Apr 2008 20:44:05 -0000	1.151.4.9
@@ -210,399 +210,20 @@ struct PVFS_servreq_create_file
     PVFS_handle parent_handle;
     PVFS_fs_id fs_id;
     uint32_t num_data_files;
-    PVFS_handle_extent_array meta_handle_extent_array;
     PVFS_object_attr attr;
+    PVFS_handle_extent_array meta_handle_extent_array;
 };
 
-static inline void
-encode_PVFS_servreq_create_file (char **pptr, const
-				 struct PVFS_servreq_create_file *x)
-{
-  do
-    {
-      uint32_t len = 0;
-      if (*&x->object_name)
-			len = strlen (*&x->object_name);
-      *(uint32_t *) * (pptr) = len;
-      if (len)
-	{
-	  memcpy (*(pptr) + 4, *&x->object_name, len + 1);
-	  *(pptr) += (((4 + len + 1) + 7) & ~7);
-	}
-      else
-	{
-	  *(uint32_t *) * (pptr) = 0;
-	  *(pptr) += 8;
-	}
-    }
-  while (0);
-  do
-    {
-      *(uint64_t *) * (pptr) = *(&x->parent_handle);
-      *(pptr) += 8;
-    }
-  while (0);
-  do
-    {
-      *(int32_t *) * (pptr) = *(&x->fs_id);
-      *(pptr) += 4;
-    }
-  while (0);
-  do
-    {
-      *(uint32_t *) * (pptr) = *(&x->num_data_files);
-      *(pptr) += 4;
-    }
-  while (0);
-  encode_PVFS_handle_extent_array (pptr, &x->meta_handle_extent_array);
-  do
-    {
-      do
-	{
-	  *(uint32_t *) * (pptr) = *(&(&x->attr)->owner);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(uint32_t *) * (pptr) = *(&(&x->attr)->group);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(uint32_t *) * (pptr) = *(&(&x->attr)->perms);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(int64_t *) * (pptr) = *(&(&x->attr)->atime);
-	  *(pptr) += 8;
-	}
-      while (0);
-      do
-	{
-	  *(int64_t *) * (pptr) = *(&(&x->attr)->mtime);
-	  *(pptr) += 8;
-	}
-      while (0);
-      do
-	{
-	  *(int64_t *) * (pptr) = *(&(&x->attr)->ctime);
-	  *(pptr) += 8;
-	}
-      while (0);
-      do
-	{
-	  *(uint32_t *) * (pptr) = *(&(&x->attr)->mask);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(int32_t *) * (pptr) = *(&(&x->attr)->objtype);
-	  *(pptr) += 4;
-	}
-      while (0);
-      if ((&x->attr)->mask & (1 << 10))
-	do
-	  {
-	    do
-	      {
-		PINT_dist *px = *(&(&(&x->attr)->u.meta)->dist);
-		do
-		  {
-		    uint32_t len = 0;
-		    if (*&px->dist_name)
-		      len = strlen (*&px->dist_name);
-		    *(uint32_t *) * (pptr) = len;
-		    if (len)
-		      {
-			memcpy (*(pptr) + 4, *&px->dist_name, len + 1);
-			*(pptr) += (((4 + len + 1) + 7) & ~7);
-		      }
-		    else
-		      {
-			*(uint32_t *) * (pptr) = 0;
-			*(pptr) += 8;
-		      }
-		  }
-		while (0);
-		if (!px->methods)
-		  {
-		    gossip_err ("%s: encode_PINT_dist: methods is null\n", __func__);
-		    exit (1);
-		  }
-		(px->methods->encode_lebf) (pptr, px->params);
-		do
-		  {
-		    int _pad =
-		      ((((uintptr_t) * (pptr)) + 7) & ~7) -
-		      (uintptr_t) * (pptr);
-		    *(pptr) += _pad;
-		  }
-		while (0);;
-	      }
-	    while (0);
-	  }
-	while (0);
-      if ((&x->attr)->mask & (1 << 11))
-	do
-	  {
-	    int dfiles_i;
-	    do
-	      {
-		*(uint32_t *) * (pptr) =
-		  *(&(&(&x->attr)->u.meta)->dfile_count);
-		*(pptr) += 4;
-	      }
-	    while (0);
-	    do
-	      {
-		*(pptr) += 4;
-	      }
-	    while (0);
-	    for (dfiles_i = 0;
-		 dfiles_i < (&(&x->attr)->u.meta)->dfile_count; dfiles_i++)
-	      do
-		{
-		  *(uint64_t *) * (pptr) =
-		    *(&(&(&x->attr)->u.meta)->dfile_array[dfiles_i]);
-		  *(pptr) += 8;
-		}
-	      while (0);
-	    encode_PVFS_metafile_hint (pptr, &(&(&x->attr)->u.meta)->hint);
-	  }
-	while (0);
-      if ((&x->attr)->mask & (1 << 15))
-	encode_PVFS_datafile_attr (pptr, &(&x->attr)->u.data);
-      if ((&x->attr)->mask & (1 << 18))
-	encode_PVFS_symlink_attr (pptr, &(&x->attr)->u.sym);
-      if (((&x->attr)->mask & (1 << 19)) || ((&x->attr)->mask & (1 << 20)))
-	do
-	  {
-	    do
-	      {
-		*(int64_t *) * (pptr) =
-		  *(&(&(&x->attr)->u.dir)->dirent_count);
-		*(pptr) += 8;
-	      }
-	    while (0);
-	    encode_PVFS_directory_hint (pptr, &(&(&x->attr)->u.dir)->hint);
-	  }
-	while (0);
-    }
-  while (0);
-  do
-    {
-      *(pptr) += 4;
-    }
-  while (0);
-}
+endecode_fields_7_struct(
+    PVFS_servreq_create_file,
+    string, object_name,
+    PVFS_handle, parent_handle,
+    PVFS_fs_id, fs_id,
+    uint32_t, num_data_files,
+    PVFS_object_attr, attr,
+    PVFS_handle_extent_array, meta_handle_extent_array,
+    skip4,)
 
-static inline void
-decode_PVFS_servreq_create_file (char **pptr, struct
-				 PVFS_servreq_create_file *x)
-{
-  do
-    {
-      uint32_t len = *(uint32_t *) * (pptr);
-      *&x->object_name = *(pptr) + 4;
-      *(pptr) += (((4 + len + 1) + 7) & ~7);
-    }
-  while (0);
-  do
-    {
-      *(&x->parent_handle) = *(uint64_t *) * (pptr);
-      *(pptr) += 8;
-    }
-  while (0);
-  do
-    {
-      *(&x->fs_id) = *(int32_t *) * (pptr);
-      *(pptr) += 4;
-    }
-  while (0);
-  do
-    {
-      *(&x->num_data_files) = *(uint32_t *) * (pptr);
-      *(pptr) += 4;
-    }
-  while (0);
-  decode_PVFS_handle_extent_array (pptr, &x->meta_handle_extent_array);
-  do
-    {
-      do
-	{
-	  *(&(&x->attr)->owner) = *(uint32_t *) * (pptr);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->group) = *(uint32_t *) * (pptr);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->perms) = *(uint32_t *) * (pptr);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->atime) = *(int64_t *) * (pptr);
-	  *(pptr) += 8;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->mtime) = *(int64_t *) * (pptr);
-	  *(pptr) += 8;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->ctime) = *(int64_t *) * (pptr);
-	  *(pptr) += 8;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->mask) = *(uint32_t *) * (pptr);
-	  *(pptr) += 4;
-	}
-      while (0);
-      do
-	{
-	  *(&(&x->attr)->objtype) = *(int32_t *) * (pptr);
-	  *(pptr) += 4;
-	}
-      while (0);
-      if ((&x->attr)->mask & (1 << 10))
-	do
-	  {
-	    do
-	      {
-		PINT_dist tmp_dist;
-		PINT_dist *px;
-		do
-		  {
-		    uint32_t len = *(uint32_t *) * (pptr);
-		    *&tmp_dist.dist_name = *(pptr) + 4;
-		    *(pptr) += (((4 + len + 1) + 7) & ~7);
-		  }
-		while (0);
-		tmp_dist.params = 0;
-		tmp_dist.methods = 0;
-		PINT_dist_lookup (&tmp_dist);
-		if (!tmp_dist.methods)
-		  {
-		    gossip_err ("%s: decode_PINT_dist: methods is null\n", __func__);
-		    exit (1);
-		  }
-		*(&(&(&x->attr)->u.meta)->dist) = px =
-		  ((((((sizeof (*(&tmp_dist))) + 7) & ~7) +
-		     ((((&tmp_dist)->name_size) + 7) & ~7) +
-		     ((((&tmp_dist)->param_size) +
-		       7) & ~7))) ? malloc (((((sizeof (*(&tmp_dist))) +
-					       7) & ~7) +
-					     ((((&tmp_dist)->name_size) +
-					       7) & ~7) +
-					     ((((&tmp_dist)->param_size) +
-					       7) & ~7))) : 0);
-		memcpy (px, &tmp_dist, sizeof (*px));
-		px->dist_name = (char *) px + (((sizeof (*px)) + 7) & ~7);
-		memcpy (px->dist_name, tmp_dist.dist_name,
-			tmp_dist.name_size);
-		px->params = (void *) (px->dist_name +
-				       (((px->name_size) + 7) & ~7));
-		(px->methods->decode_lebf) (pptr, px->params);
-		do
-		  {
-		    int _pad = ((((uintptr_t) * (pptr)) + 7) & ~7) -
-		      (uintptr_t) * (pptr);
-		    *(pptr) += _pad;
-		  }
-		while (0);;
-	      }
-	    while (0);
-	    (&(&x->attr)->u.meta)->dist_size =
-	      ((((sizeof (*((&(&x->attr)->u.meta)->dist))) + 7) & ~7) +
-	       (((((&(&x->attr)->u.meta)->dist)->name_size) + 7) & ~7) +
-	       (((((&(&x->attr)->u.meta)->dist)->param_size) + 7) & ~7));
-	  }
-	while (0);
-      if ((&x->attr)->mask & (1 << 11))
-	do
-	  {
-	    int dfiles_i;
-	    do
-	      {
-		*(&(&(&x->attr)->u.meta)->dfile_count) =
-		  *(uint32_t *) * (pptr);
-		*(pptr) += 4;
-	      }
-	    while (0);
-	    do
-	      {
-		*(pptr) += 4;
-	      }
-	    while (0);
-	    (&(&x->attr)->u.meta)->dfile_array =
-	      (((&(&x->attr)->u.meta)->dfile_count *
-		sizeof (*(&(&x->attr)->u.meta)->dfile_array)) ?
-	       malloc ((&(&x->attr)->u.meta)->dfile_count *
-		       sizeof (*(&(&x->attr)->u.meta)->dfile_array)) : 0);
-	    for (dfiles_i = 0;
-		 dfiles_i < (&(&x->attr)->u.meta)->dfile_count; dfiles_i++)
-	      do
-		{
-		  *(&(&(&x->attr)->u.meta)->dfile_array[dfiles_i]) =
-		    *(uint64_t *) * (pptr);
-		  *(pptr) += 8;
-		}
-	      while (0);
-	    decode_PVFS_metafile_hint (pptr, &(&(&x->attr)->u.meta)->hint);
-	  }
-	while (0);
-      if ((&x->attr)->mask & (1 << 15))
-	decode_PVFS_datafile_attr (pptr, &(&x->attr)->u.data);
-      if ((&x->attr)->mask & (1 << 18))
-	decode_PVFS_symlink_attr (pptr, &(&x->attr)->u.sym);
-      if (((&x->attr)->mask & (1 << 19)) || ((&x->attr)->mask & (1 << 20)))
-	do
-	  {
-	    do
-	      {
-		*(&(&(&x->attr)->u.dir)->dirent_count) =
-		  *(int64_t *) * (pptr);
-		*(pptr) += 8;
-	      }
-	    while (0);
-	    decode_PVFS_directory_hint (pptr, &(&(&x->attr)->u.dir)->hint);
-	  }
-	while (0);
-    }
-  while (0);
-  do
-    {
-      *(pptr) += 4;
-    }
-  while (0);
-}
 
 #define extra_size_PVFS_servreq_create_file \
     (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle_extent))



More information about the Pvfs2-cvs mailing list