[Pvfs2-cvs] commit by kunkel in pvfs2/src/io/trove/trove-tas: module.mk.in tas.c

CVS commit program cvs at parl.clemson.edu
Sat May 26 06:15:38 EDT 2007


Update of /projects/cvsroot/pvfs2/src/io/trove/trove-tas
In directory parlweb1:/tmp/cvs-serv21402/src/io/trove/trove-tas

Modified Files:
      Tag: pvfs2-kunkel-tas-branch
	module.mk.in tas.c 
Log Message:
Make statfs work with TAS.


Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-tas/Attic/module.mk.in,v
diff -p -u -r1.1.2.2 -r1.1.2.3
--- module.mk.in	30 Oct 2006 21:17:37 -0000	1.1.2.2
+++ module.mk.in	26 May 2007 10:15:38 -0000	1.1.2.3
@@ -5,5 +5,9 @@ LIBSRC += \
 SERVERSRC += \
 	$(DIR)/tas.c \
 	$(DIR)/red-black-tree.c	\
-	$(DIR)/tas-queue.c 
-	
+	$(DIR)/tas-queue.c
+
+# Grab trove-ledger.h from handle-mgmt.  Also make _GNU_SOURCE definition
+# required for access to pread/pwrite on Linux.  _XOPEN_SOURCE seems to be
+# incompatible with Berkeley DB.
+MODCFLAGS_$(DIR) = -I$(srcdir)/src/io/trove/trove-handle-mgmt -D_GNU_SOURCE

Index: tas.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-tas/Attic/tas.c,v
diff -p -u -r1.1.2.8 -r1.1.2.9
--- tas.c	24 May 2007 14:01:39 -0000	1.1.2.8
+++ tas.c	26 May 2007 10:15:38 -0000	1.1.2.9
@@ -18,6 +18,7 @@
 #include "trove.h"
 #include "trove-internal.h"
 #include "gossip.h"
+#include "trove-handle-mgmt.h"
 
 extern struct TROVE_dspace_ops dbpf_dspace_ops;
 extern struct TROVE_mgmt_ops dbpf_mgmt_ops;
@@ -1897,7 +1898,9 @@ static int tas_collection_setinfo(TROVE_
             gossip_debug(GOSSIP_TROVE_DEBUG,
                          "TROVE_COLLECTION_HANDLE_RANGES: %s %d\n",
                          (char *) parameter, context_id);
-
+            /* necessary to get statfs working */
+            ret = trove_set_handle_ranges(
+                coll_id, context_id, (char *)parameter);
             /* set minimum handles according to handle range... */
             TROVE_handle minMetaHandle,
               maxMetaHandle,
@@ -2082,11 +2085,30 @@ static int tas_collection_getinfo(TROVE_
                                   TROVE_coll_getinfo_options opt,
                                   void *parameter)
 {
-    fprintf(stderr,
-            "TROVE MODULE TAS: FUNCTION tas_collection_getinfo not implemented\n");
+
     gossip_debug(GOSSIP_TROVE_DEBUG,
                  "Tas tas_collection_getinfo\n");
-    return 1;
+
+    switch(opt)
+    {
+        case PVFS_COLLECTION_STATFS:
+            {
+                TROVE_statfs *tmp_trove_statfs = (TROVE_statfs *)parameter;
+
+                tmp_trove_statfs->fs_id = coll_id;
+
+                tmp_trove_statfs->bytes_available = ((uint64_t) 1000) * 1024 * 1024;
+                tmp_trove_statfs->bytes_total = ((uint64_t) 10000) * 1024 * 1024;
+
+                return RETURN_IMMEDIATE_COMPLETE;
+            }
+    }
+
+     fprintf(stderr,
+                  "TROVE MODULE TAS: FUNCTION tas_collection_geteattr not implemented for option"
+                  " %d\n", (int) opt);
+
+    return RETURN_IMMEDIATE_COMPLETE;
 }
 
 static int tas_collection_seteattr(TROVE_coll_id coll_id,



More information about the Pvfs2-cvs mailing list