[Pvfs2-cvs] commit by slang in pvfs2/src/client/sysint: module.mk.in server-get-config.sm sys-getattr.sm

CVS commit program cvs at parl.clemson.edu
Mon Dec 4 17:30:13 EST 2006


Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb1:/tmp/cvs-serv8254/src/client/sysint

Modified Files:
	module.mk.in server-get-config.sm sys-getattr.sm 
Log Message:
commit Phil's patches for doing pvfs2-validate.  This adds a PVFS_mgmt_get_config call to the management interface (before it was just handled by the internal config code).  This is a building block for doing consistency checking between config files.  The changes also allow the getattr to be done on datafile handles as well as other handle types (all handle types are supported now).


Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/module.mk.in,v
diff -p -u -r1.83 -r1.84
--- module.mk.in	13 Sep 2006 20:22:48 -0000	1.83
+++ module.mk.in	4 Dec 2006 22:30:13 -0000	1.84
@@ -8,6 +8,7 @@ CSRC := \
 	$(DIR)/pint-sysint-utils.c \
 	$(DIR)/getparent.c \
 	$(DIR)/client-state-machine.c \
+	$(DIR)/mgmt-get-config.c \
 	$(DIR)/mgmt-misc.c \
 	$(DIR)/sys-dist.c \
 	$(DIR)/error-details.c

Index: server-get-config.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/server-get-config.sm,v
diff -p -u -r1.24 -r1.25
--- server-get-config.sm	12 Sep 2006 00:49:30 -0000	1.24
+++ server-get-config.sm	4 Dec 2006 22:30:13 -0000	1.25
@@ -356,45 +356,51 @@ static int server_get_config_parse(PINT_
     int ret = -1;
     struct filesystem_configuration_s* cur_fs = NULL;
 
-    ret = server_parse_config(
-        sm_p->u.get_config.config,  sm_p->u.get_config.fs_config_buf,
-        sm_p->u.get_config.fs_config_buf_size,
-        sm_p->u.get_config.server_config_buf,
-        sm_p->u.get_config.server_config_buf_size);
-    if (ret)
+    if(sm_p->u.get_config.config)
     {
-	gossip_err("Failed to get_config from host %s\n",
-                   sm_p->u.get_config.mntent->the_pvfs_config_server); 
-	js_p->error_code = ret;
-        return 1;
+        ret = server_parse_config(
+            sm_p->u.get_config.config,  sm_p->u.get_config.fs_config_buf,
+            sm_p->u.get_config.fs_config_buf_size,
+            sm_p->u.get_config.server_config_buf,
+            sm_p->u.get_config.server_config_buf_size);
+        if (ret)
+        {
+            gossip_err("Failed to get_config from host %s\n",
+                       sm_p->u.get_config.mntent->the_pvfs_config_server); 
+            js_p->error_code = ret;
+            return 1;
+        }
     }
     
-    cur_fs = PINT_config_find_fs_name(sm_p->u.get_config.config, 
-        sm_p->u.get_config.mntent->pvfs_fs_name);
-    if (!cur_fs)
+    if(sm_p->u.get_config.mntent->fs_id == PVFS_FS_ID_NULL)
     {
-	gossip_err("Warning:\n Cannot retrieve information about "
-		"pvfstab entry %s\n",
-		sm_p->u.get_config.mntent->the_pvfs_config_server);
+        cur_fs = PINT_config_find_fs_name(sm_p->u.get_config.config, 
+            sm_p->u.get_config.mntent->pvfs_fs_name);
+        if (!cur_fs)
+        {
+            gossip_err("Warning:\n Cannot retrieve information about "
+                    "pvfstab entry %s\n",
+                    sm_p->u.get_config.mntent->the_pvfs_config_server);
 
-	/*
-          if the device has no space left on it, we can't save
-          the config file for parsing and get a failure; make
-          a note of that possibility here
-        */ 
-	gossip_err("\nHINTS: If you're sure that your pvfstab file "
-                   "contains valid information,\n please make sure "
-                   "that you are not out of disk space and that you "
-                   "have\n write permissions in the current "
-                   "directory or in the /tmp directory\n\n");
+            /*
+              if the device has no space left on it, we can't save
+              the config file for parsing and get a failure; make
+              a note of that possibility here
+            */ 
+            gossip_err("\nHINTS: If you're sure that your pvfstab file "
+                       "contains valid information,\n please make sure "
+                       "that you are not out of disk space and that you "
+                       "have\n write permissions in the current "
+                       "directory or in the /tmp directory\n\n");
 
-	js_p->error_code = -PVFS_ENODEV;
-        return(1);
-    }
+            js_p->error_code = -PVFS_ENODEV;
+            return(1);
+        }
 
-    sm_p->u.get_config.mntent->fs_id = cur_fs->coll_id;
-    cur_fs->flowproto = sm_p->u.get_config.mntent->flowproto;
-    cur_fs->encoding = sm_p->u.get_config.mntent->encoding;
+        sm_p->u.get_config.mntent->fs_id = cur_fs->coll_id;
+        cur_fs->flowproto = sm_p->u.get_config.mntent->flowproto;
+        cur_fs->encoding = sm_p->u.get_config.mntent->encoding;
+    }
 
     js_p->error_code = 0;
     return 1;

Index: sys-getattr.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-getattr.sm,v
diff -p -u -r1.104 -r1.105
--- sys-getattr.sm	26 Sep 2006 03:44:16 -0000	1.104
+++ sys-getattr.sm	4 Dec 2006 22:30:13 -0000	1.105
@@ -761,30 +761,35 @@ static int getattr_acache_insert(PINT_cl
 {   
     PVFS_size* tmp_size = NULL;
 
-    /* see if we have a size value to cache */
-    if (sm_p->getattr.attr.objtype == PVFS_TYPE_METAFILE &&
-        sm_p->getattr.req_attrmask & PVFS_ATTR_DATA_SIZE)
-    {                                           
-        /* compute size as requested */
-        assert(sm_p->getattr.attr.u.meta.dist);
-        assert(sm_p->getattr.attr.u.meta.dist->methods &&
-               sm_p->getattr.attr.u.meta.dist->methods->logical_file_size);
-        
-        sm_p->getattr.size =
-            (sm_p->getattr.attr.u.meta.dist->methods->logical_file_size)(
-            sm_p->getattr.attr.u.meta.dist->params,
-            sm_p->getattr.attr.u.meta.dfile_count,
-            sm_p->getattr.size_array);
+    if( sm_p->getattr.attr.objtype == PVFS_TYPE_METAFILE || 
+        sm_p->getattr.attr.objtype == PVFS_TYPE_DIRECTORY ||
+        sm_p->getattr.attr.objtype == PVFS_TYPE_SYMLINK )
+    {
+        /* see if we have a size value to cache */
+        if (sm_p->getattr.attr.objtype == PVFS_TYPE_METAFILE &&
+            sm_p->getattr.req_attrmask & PVFS_ATTR_DATA_SIZE)
+        {                                           
+            /* compute size as requested */
+            assert(sm_p->getattr.attr.u.meta.dist);
+            assert(sm_p->getattr.attr.u.meta.dist->methods &&
+                   sm_p->getattr.attr.u.meta.dist->methods->logical_file_size);
+            
+            sm_p->getattr.size =
+                (sm_p->getattr.attr.u.meta.dist->methods->logical_file_size)(
+                sm_p->getattr.attr.u.meta.dist->params,
+                sm_p->getattr.attr.u.meta.dfile_count,
+                sm_p->getattr.size_array);
 
-        tmp_size = &sm_p->getattr.size;
-    }
+            tmp_size = &sm_p->getattr.size;
+        }
 
-    PINT_acache_update(sm_p->getattr.object_ref,
-        &sm_p->getattr.attr,
-        tmp_size);
+        PINT_acache_update(sm_p->getattr.object_ref,
+            &sm_p->getattr.attr,
+            tmp_size);
 
-    gossip_debug(GOSSIP_CLIENT_DEBUG, "trying to add object "
-                 "reference to acache\n");
+        gossip_debug(GOSSIP_CLIENT_DEBUG, "trying to add object "
+                     "reference to acache\n");
+    }
 
     return 1;
 }
@@ -912,7 +917,15 @@ static int getattr_set_sys_response(PINT
 
        if (sm_p->getattr.req_attrmask & PVFS_ATTR_DATA_SIZE)
         {
-            sysresp->attr.size = sm_p->getattr.size;
+            if( attr->objtype == PVFS_TYPE_DATAFILE )
+            {
+                sysresp->attr.size = attr->u.data.size;
+            }
+            else
+            {
+                sysresp->attr.size = sm_p->getattr.size;
+            }
+
             sysresp->attr.mask |= PVFS_ATTR_SYS_SIZE;
         }
 



More information about the Pvfs2-cvs mailing list