[Pvfs2-cvs] commit by kunkel in pvfs2/src/apps/admin: pvfs2-xattr.c pvfs2-migrate-collection.c pvfs2-fsck.c pvfs2-showcoll.c pvfs2-genconfig pvfs2-ls.c module.mk.in pvfs2-stat.c pvfs2-lsplus.c

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


Update of /projects/cvsroot/pvfs2/src/apps/admin
In directory parlweb1:/tmp/cvs-serv18519/src/apps/admin

Modified Files:
      Tag: kunkel-hint-branch
	pvfs2-migrate-collection.c pvfs2-fsck.c pvfs2-showcoll.c 
	pvfs2-genconfig pvfs2-ls.c module.mk.in pvfs2-stat.c 
	pvfs2-lsplus.c 
Added Files:
      Tag: kunkel-hint-branch
	pvfs2-xattr.c 
Log Message:
Upgrade to current CVS version


--- /dev/null	2004-06-24 14:04:38.000000000 -0400
+++ pvfs2-xattr.c	2006-12-02 06:22:21.000000000 -0500
@@ -0,0 +1,458 @@
+/*
+ * (C) 2004 Clemson University and The University of Chicago
+ * 
+ * See COPYING in top-level directory.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <time.h>
+#include <stdlib.h>
+#include <getopt.h>
+
+#define __PINT_REQPROTO_ENCODE_FUNCS_C
+#include "pvfs2.h"
+#include "str-utils.h"
+#include "pint-sysint-utils.h"
+#include "pint-util.h"
+#include "pvfs2-internal.h"
+#include "pvfs2-req-proto.h"
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
+
+
+#define VALBUFSZ 1024
+
+/* extended attribute name spaces supported in PVFS2 */
+const char *PINT_eattr_namespaces[] =
+{
+    "system.",
+    "user.",
+    "trusted.",
+    "security.",
+    NULL
+};
+
+/* optional parameters, filled in by parse_args() */
+struct options
+{
+    PVFS_ds_keyval key;
+    PVFS_ds_keyval val;
+    char* srcfile;
+    int get, text;
+};
+
+enum object_type { 
+    UNIX_FILE, 
+    PVFS2_FILE 
+};
+
+typedef struct pvfs2_file_object_s {
+    PVFS_fs_id fs_id;
+    PVFS_object_ref ref;
+    char pvfs2_path[PVFS_NAME_MAX];	
+    char user_path[PVFS_NAME_MAX];
+    PVFS_sys_attr attr;
+    PVFS_permissions perms;
+} pvfs2_file_object;
+
+typedef struct unix_file_object_s {
+    int fd;
+    int mode;
+    char path[NAME_MAX];
+    PVFS_fs_id fs_id;
+} unix_file_object;
+
+typedef struct file_object_s {
+    int fs_type;
+    union {
+	unix_file_object ufs;
+	pvfs2_file_object pvfs2;
+    } u;
+} file_object;
+
+static struct options* parse_args(int argc, char* argv[]);
+static int generic_open(file_object *obj, PVFS_credentials *credentials);
+static int pvfs2_eattr(int get, file_object *, PVFS_ds_keyval *key_p,
+        PVFS_ds_keyval *val_p, PVFS_credentials *creds);
+static void usage(int argc, char** argv);
+static int resolve_filename(file_object *obj, char *filename);
+static int modify_val(PVFS_ds_keyval *key_p, PVFS_ds_keyval *val_p);
+static int permit_set(PVFS_ds_keyval *key_p);
+static int eattr_is_prefixed(char* key_name);
+
+int main(int argc, char **argv)
+{
+  int ret = 0;
+  struct options* user_opts = NULL;
+  file_object src;
+  PVFS_credentials credentials;
+
+  memset(&src, 0, sizeof(src));
+  /* look at command line arguments */
+  user_opts = parse_args(argc, argv);
+  if(!user_opts)
+  {
+    fprintf(stderr, "Error: failed to parse "
+            "command line arguments.\n");
+    return(-1);
+  }
+
+  ret = PVFS_util_init_defaults();
+  if(ret < 0)
+  {
+    PVFS_perror("PVFS_util_init_defaults", ret);
+    return(-1);
+  }
+  resolve_filename(&src, user_opts->srcfile);
+
+  PVFS_util_gen_credentials(&credentials);
+  ret = generic_open(&src, &credentials);
+  if (ret < 0)
+  {
+      fprintf(stderr, "Could not open %s\n", user_opts->srcfile);
+      return -1;
+  }
+  if (!eattr_is_prefixed(user_opts->key.buffer))
+  {
+      fprintf(stderr, "extended attribute key is not prefixed %s\n", (char *) user_opts->key.buffer);
+      return -1;
+  }
+  if (!user_opts->get)
+  {
+      if (!permit_set(&user_opts->key))
+      {
+          fprintf(stderr, "Not permitted to set key %s\n", (char *) user_opts->key.buffer);
+          return -1;
+      }
+      if (modify_val(&user_opts->key, &user_opts->val) < 0)
+      {
+          fprintf(stderr, "Invalid value for user-settable hint %s, %s\n", (char *) user_opts->key.buffer, (char *) user_opts->val.buffer);
+          return -1;
+      }
+  }
+
+    ret = pvfs2_eattr(user_opts->get, &src, &user_opts->key, &user_opts->val, &credentials);
+    if (ret != 0) 
+    {
+        return ret;
+    }
+    if (user_opts->get && user_opts->text)  
+    {
+        printf("key:%s Value:\n%s\n",
+                (char *)user_opts->key.buffer,
+                (char *)user_opts->val.buffer);
+    }
+  PVFS_sys_finalize();
+  return(ret);
+}
+
+static int modify_val(PVFS_ds_keyval *key_p, PVFS_ds_keyval *val_p)
+{
+    if (strncmp(key_p->buffer, "user.pvfs2.meta_hint", SPECIAL_METAFILE_HINT_KEYLEN) == 0)
+    {
+        PVFS_metafile_hint hint;
+        memset(&hint, 0, sizeof(hint));
+        if (strncmp(val_p->buffer, "+immutable", 10) == 0)
+            hint.flags |= PVFS_IMMUTABLE_FL;
+        else if (strncmp(val_p->buffer, "-immutable", 10) == 0)
+            hint.flags &= ~PVFS_IMMUTABLE_FL;
+        else if (strncmp(val_p->buffer, "+append", 7) == 0)
+            hint.flags |= PVFS_APPEND_FL;
+        else if (strncmp(val_p->buffer, "-append", 7) == 0)
+            hint.flags &= ~PVFS_APPEND_FL;
+        else if (strncmp(val_p->buffer, "+noatime", 8) == 0)
+            hint.flags |= PVFS_NOATIME_FL;
+        else if (strncmp(val_p->buffer, "-noatime", 8) == 0)
+            hint.flags &= ~PVFS_NOATIME_FL;
+        else 
+            return -1;
+        memcpy(val_p->buffer, &hint, sizeof(hint));
+        val_p->buffer_sz = sizeof(hint);
+    }
+    return 0;
+}
+
+static int permit_set(PVFS_ds_keyval *key_p)
+{
+    if (strncmp(key_p->buffer, "system.", 7) == 0
+            || strncmp(key_p->buffer, "trusted.", 8) == 0
+            || strncmp(key_p->buffer, "security.", 9) == 0)
+        return 0;
+    return 1;
+}
+
+/* pvfs2_geteattr()
+ *
+ * changes the mode of the given file to the given permissions
+ *
+ * returns zero on success and negative one on failure
+ */
+static int pvfs2_eattr(int get, file_object *obj, PVFS_ds_keyval *key_p,
+        PVFS_ds_keyval *val_p, PVFS_credentials *creds) 
+{
+  int ret = -1;
+
+  if (obj->fs_type == UNIX_FILE)
+  {
+      if (get == 1)
+      {
+#ifndef HAVE_FGETXATTR_EXTRA_ARGS
+        if ((ret = fgetxattr(obj->u.ufs.fd, key_p->buffer, val_p->buffer, val_p->buffer_sz)) < 0)
+#else
+        if ((ret = fgetxattr(obj->u.ufs.fd, key_p->buffer, val_p->buffer, val_p->buffer_sz, 0, 0)) < 0)
+#endif
+        {
+            perror("fgetxattr:");
+            return -1;
+        }
+      }
+      else
+      {
+        if ((ret = fsetxattr(obj->u.ufs.fd, key_p->buffer, val_p->buffer, val_p->buffer_sz, 0)) < 0)
+        {
+            perror("fsetxattr:");
+            return -1;
+        }
+      }
+  }
+  else
+  {
+      if (get == 1)
+      {
+          ret = PVFS_sys_geteattr(obj->u.pvfs2.ref, creds, key_p, val_p, NULL);
+      }
+      else {
+          ret = PVFS_sys_seteattr(obj->u.pvfs2.ref, creds, key_p, val_p, 0, NULL);
+      }
+
+      if (ret < 0)
+      {
+          PVFS_perror("PVFS_sys_geteattr", ret);
+          return -1;
+      }
+  }
+  return 0;
+}
+
+
+/* parse_args()
+ *
+ * parses command line arguments
+ *
+ * returns pointer to options structure on success, NULL on failure
+ */
+static struct options* parse_args(int argc, char* argv[])
+{
+    char flags[] = "k:v:ts";
+    int one_opt = 0;
+
+    struct options* tmp_opts = NULL;
+
+    /* create storage for the command line options */
+    tmp_opts = (struct options*)malloc(sizeof(struct options));
+    if(!tmp_opts){
+	return(NULL);
+    }
+    memset(tmp_opts, 0, sizeof(struct options));
+
+    /* fill in defaults */
+    memset(&tmp_opts->key, 0, sizeof(PVFS_ds_keyval));
+    memset(&tmp_opts->val, 0, sizeof(PVFS_ds_keyval));
+    tmp_opts->srcfile = strdup(argv[argc-1]);
+    tmp_opts->get = 1;
+
+    /* look at command line arguments */
+    while((one_opt = getopt(argc, argv, flags)) != EOF)
+    {
+	switch(one_opt){
+            case 't':
+                tmp_opts->text = 1;
+                break;
+            case 's':
+                tmp_opts->get = 0;
+                break;
+            case 'k':
+                tmp_opts->key.buffer = strdup(optarg);
+                tmp_opts->key.buffer_sz = strlen(tmp_opts->key.buffer) + 1;
+                break;
+            case 'v':
+                tmp_opts->val.buffer = strdup(optarg);
+                tmp_opts->val.buffer_sz = strlen(tmp_opts->val.buffer) + 1;
+                break;
+	    case('?'):
+                printf("?\n");
+		usage(argc, argv);
+		exit(EXIT_FAILURE);
+	}
+    }
+    if (tmp_opts->get == 1)
+    {
+        tmp_opts->val.buffer = calloc(1, VALBUFSZ);
+        tmp_opts->val.buffer_sz = VALBUFSZ;
+        if (tmp_opts->val.buffer == NULL)
+        {
+            fprintf(stderr, "Could not allocate val\n");
+            exit(EXIT_FAILURE);
+        }
+    }
+    else {
+        if (tmp_opts->val.buffer == NULL)
+        {
+            fprintf(stderr, "Please specify value if setting extended attributes\n");
+            usage(argc, argv);
+            exit(EXIT_FAILURE);
+        }
+    }
+    if (tmp_opts->key.buffer == NULL)
+    {
+        fprintf(stderr, "Please specify key if getting extended attributes\n");
+        usage(argc, argv);
+        exit(EXIT_FAILURE);
+    }
+    return(tmp_opts);
+}
+
+
+static void usage(int argc, char** argv)
+{
+    fprintf(stderr,"Usage: %s -s {set xattrs} -k <key> -v <val> -t {print attributes} filename\n",argv[0]);
+    return;
+}
+
+/* resolve_filename:
+ *  given 'filename', find the PVFS2 fs_id and relative pvfs_path.  In case of
+ *  error, assume 'filename' is a unix file.
+ */
+static int resolve_filename(file_object *obj, char *filename)
+{
+    int ret;
+
+    ret = PVFS_util_resolve(filename, &(obj->u.pvfs2.fs_id),
+	    obj->u.pvfs2.pvfs2_path, PVFS_NAME_MAX);
+    if (ret < 0)
+    {
+	obj->fs_type = UNIX_FILE;
+        strncpy(obj->u.ufs.path, filename, NAME_MAX);
+    } else {
+	obj->fs_type = PVFS2_FILE;
+	strncpy(obj->u.pvfs2.user_path, filename, PVFS_NAME_MAX);
+    }
+    return 0;
+}
+
+/* generic_open:
+ *  given a file_object, perform the apropriate open calls.  
+ */
+static int generic_open(file_object *obj, PVFS_credentials *credentials)
+{
+    struct stat stat_buf;
+    PVFS_sysresp_lookup resp_lookup;
+    PVFS_sysresp_getattr resp_getattr;
+    PVFS_object_ref ref;
+    int ret = -1;
+
+    if (obj->fs_type == UNIX_FILE)
+    {
+        PINT_statfs_t statfsbuf;
+        memset(&stat_buf, 0, sizeof(struct stat));
+
+        stat(obj->u.ufs.path, &stat_buf);
+        if (!S_ISREG(stat_buf.st_mode))
+        {
+            fprintf(stderr, "Not a file!\n");
+            return(-1);
+        }
+        obj->u.ufs.fd = open(obj->u.ufs.path, O_RDONLY);
+        obj->u.ufs.mode = (int)stat_buf.st_mode;
+	if (obj->u.ufs.fd < 0)
+	{
+	    perror("open");
+	    fprintf(stderr, "could not open %s\n", obj->u.ufs.path);
+	    return (-1);
+	}
+        if (PINT_statfs_fd_lookup(obj->u.ufs.fd, &statfsbuf) < 0)
+        {
+            perror("fstatfs:");
+            fprintf(stderr, "could not fstatfs %s\n", obj->u.ufs.path);
+        }
+        memcpy(&obj->u.ufs.fs_id, &PINT_statfs_fsid(&statfsbuf), 
+               sizeof(PINT_statfs_fsid(&statfsbuf)));
+        return 0;
+    }
+    else
+    {
+        memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
+        ret = PVFS_sys_lookup(obj->u.pvfs2.fs_id, 
+                              (char *) obj->u.pvfs2.pvfs2_path,
+                              credentials, 
+                              &resp_lookup,
+                              PVFS2_LOOKUP_LINK_FOLLOW, NULL);
+        if (ret < 0)
+        {
+            PVFS_perror("PVFS_sys_lookup", ret);
+            return (-1);
+        }
+        ref.handle = resp_lookup.ref.handle;
+        ref.fs_id = resp_lookup.ref.fs_id;
+
+        memset(&resp_getattr, 0, sizeof(PVFS_sysresp_getattr));
+        ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
+                               credentials, &resp_getattr, NULL);
+        if (ret)
+        {
+            fprintf(stderr, "Failed to do pvfs2 getattr on %s\n",
+                    obj->u.pvfs2.pvfs2_path);
+            return -1;
+        }
+
+        if (resp_getattr.attr.objtype != PVFS_TYPE_METAFILE)
+        {
+            fprintf(stderr, "Not a meta file!\n");
+            return -1;
+        }
+        obj->u.pvfs2.perms = resp_getattr.attr.perms;
+        memcpy(&obj->u.pvfs2.attr, &resp_getattr.attr,
+               sizeof(PVFS_sys_attr));
+        obj->u.pvfs2.attr.mask = PVFS_ATTR_SYS_ALL_SETABLE;
+        obj->u.pvfs2.ref = ref;
+    }
+    return 0;
+}
+
+static int eattr_is_prefixed(char* key_name)
+{
+    int i = 0;
+    while(PINT_eattr_namespaces[i])
+    {
+        if(strncmp(PINT_eattr_namespaces[i], key_name,
+            strlen(PINT_eattr_namespaces[i])) == 0)
+        {
+            return(1);
+        }
+        i++;
+    }
+    return(0);
+}
+
+
+
+/*
+ * Local variables:
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
+

Index: pvfs2-migrate-collection.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-migrate-collection.c,v
diff -p -u -r1.17.2.1 -r1.17.2.2
--- pvfs2-migrate-collection.c	26 Sep 2006 13:03:08 -0000	1.17.2.1
+++ pvfs2-migrate-collection.c	2 Dec 2006 11:22:20 -0000	1.17.2.2
@@ -615,7 +615,6 @@ static int translate_0_0_1(
      * will create
      */
     char handle_range[] = "4-64000000000";
-    char* method_name = NULL;
     TROVE_op_id op_id;
     TROVE_context_id trove_context = -1;
     char current_path[PATH_MAX];
@@ -681,7 +680,8 @@ static int translate_0_0_1(
     }
 
     /* initialize trove and lookup collection */
-    ret = trove_initialize(storage_space, 0, &method_name, 0);
+    ret = trove_initialize(
+        TROVE_METHOD_DBPF, NULL, storage_space, 0);
     if (ret < 0)
     {
         PVFS_perror("trove_initialize", ret);
@@ -689,7 +689,8 @@ static int translate_0_0_1(
         pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0);
         return(-1);
     }
-    ret = trove_collection_lookup(coll_name, &coll_id, NULL, &op_id);
+    ret = trove_collection_lookup(
+        TROVE_METHOD_DBPF, coll_name, &coll_id, NULL, &op_id);
     if (ret != 1)
     {   
         fprintf(stderr, "Error: failed to lookup new collection.\n");
@@ -740,7 +741,7 @@ static int translate_0_0_1(
 
     /* at this point, we are done with the Trove API */
     trove_close_context(coll_id, trove_context);
-    trove_finalize();
+    trove_finalize(TROVE_METHOD_DBPF);
     PINT_dist_finalize();
 
     /* convert bstreams */
@@ -1249,28 +1250,28 @@ static int translate_keyval_key_0_0_1(TR
     if(!strncmp(db_key->data, "root_handle", strlen("root_handle")))
     {
         keyval->buffer = ROOT_HANDLE_KEYSTR;
-        keyval->buffer_sz = strlen(ROOT_HANDLE_KEYSTR);
+        keyval->buffer_sz = ROOT_HANDLE_KEYLEN;
     }
     else if(!strncmp(db_key->data, "dir_ent", strlen("dir_ent")))
     {
         keyval->buffer = DIRECTORY_ENTRY_KEYSTR;
-        keyval->buffer_sz = strlen(DIRECTORY_ENTRY_KEYSTR);
+        keyval->buffer_sz = DIRECTORY_ENTRY_KEYLEN;
     }
     else if(!strncmp(db_key->data, 
                      "datafile_handles", strlen("datafile_handles")))
     {
         keyval->buffer = DATAFILE_HANDLES_KEYSTR;
-        keyval->buffer_sz = strlen(DATAFILE_HANDLES_KEYSTR);
+        keyval->buffer_sz = DATAFILE_HANDLES_KEYLEN;
     }
     else if(!strncmp(db_key->data, "metafile_dist", strlen("metafile_dist")))
     {
         keyval->buffer = METAFILE_DIST_KEYSTR;
-        keyval->buffer_sz = strlen(METAFILE_DIST_KEYSTR);
+        keyval->buffer_sz = METAFILE_DIST_KEYLEN;
     }
     else if(!strncmp(db_key->data, "symlink_target", strlen("symlink_target")))
     {
         keyval->buffer = SYMLINK_TARGET_KEYSTR;
-        keyval->buffer_sz = strlen(SYMLINK_TARGET_KEYSTR);
+        keyval->buffer_sz = SYMLINK_TARGET_KEYLEN;
     }
     else
     {
@@ -1383,11 +1384,12 @@ static int translate_keyval_db_0_0_1(
                 /* assume its a component name of a directory entry */
                 t_key.buffer = key.data;
                 t_key.buffer_sz = key.size;
+		t_val.buffer = data.data;
+		t_val.buffer_sz = data.size;
                 trove_flags |= TROVE_KEYVAL_HANDLE_COUNT;
                 trove_flags |= TROVE_NOOVERWRITE;
             }
-            
-            if(!strncmp(t_key.buffer, "md", 2)) /* metafile_dist */
+            else if(!strncmp(t_key.buffer, "md", 2)) /* metafile_dist */
             {
                 PINT_dist *newdist;
                 newdist = data.data;

Index: pvfs2-fsck.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-fsck.c,v
diff -p -u -r1.17.2.2 -r1.17.2.3
--- pvfs2-fsck.c	25 Sep 2006 12:39:48 -0000	1.17.2.2
+++ pvfs2-fsck.c	2 Dec 2006 11:22:20 -0000	1.17.2.3
@@ -456,7 +456,9 @@ int traverse_directory_tree(PVFS_fs_id c
 		     &getattr_resp, NULL);
 
     assert(getattr_resp.attr.objtype == PVFS_TYPE_DIRECTORY);
-    assert(handlelist_find_handle(hl, pref.handle, &server_idx) == 0);
+
+    ret = handlelist_find_handle(hl, pref.handle, &server_idx);
+    assert(ret == 0);
 
     handlelist_remove_handle(hl, pref.handle, server_idx);
 

Index: pvfs2-showcoll.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-showcoll.c,v
diff -p -u -r1.22.6.2 -r1.22.6.3
--- pvfs2-showcoll.c	26 Sep 2006 13:03:08 -0000	1.22.6.2
+++ pvfs2-showcoll.c	2 Dec 2006 11:22:21 -0000	1.22.6.3
@@ -60,7 +60,6 @@ int main(int argc, char **argv)
     TROVE_ds_state state;
     TROVE_keyval_s key, val;
     TROVE_context_id trove_context = -1;
-    char *method_name;
 
     ret = parse_args(argc, argv);
     if (ret < 0) {
@@ -71,8 +70,10 @@ int main(int argc, char **argv)
     }
 
     /* initialize trove, verifying storage space exists */
-    ret = trove_initialize(storage_space, 0, &method_name, 0);
-    if (ret < 0) {
+    ret = trove_initialize(
+        TROVE_METHOD_DBPF, NULL, storage_space, 0);
+    if (ret < 0) 
+    {
 	fprintf(stderr,
 		"%s: error: trove initialize failed; aborting!\n",
 		argv[0]);
@@ -91,10 +92,10 @@ int main(int argc, char **argv)
 	    fprintf(stderr,
 		    "%s: error: collection iterate failed; aborting!\n",
 		    argv[0]);
-	    trove_finalize();
+	    trove_finalize(TROVE_METHOD_DBPF);
 	    return -1;
 	}
-	trove_finalize();
+	trove_finalize(TROVE_METHOD_DBPF);
 	return 0;
     }
 
@@ -104,7 +105,8 @@ int main(int argc, char **argv)
      * - print out information on the dataspaces in the collection
      */
 
-    ret = trove_collection_lookup(collection,
+    ret = trove_collection_lookup(TROVE_METHOD_DBPF,
+                                  collection,
 				  &coll_id,
 				  NULL,
 				  &op_id);
@@ -113,7 +115,7 @@ int main(int argc, char **argv)
 		"%s: error: collection lookup failed for collection '%s'; aborting!.\n",
 		argv[0],
 		collection);
-	trove_finalize();
+	trove_finalize(TROVE_METHOD_DBPF);
 	return -1;
     }
 
@@ -189,7 +191,7 @@ int main(int argc, char **argv)
     }
 
     trove_close_context(coll_id, trove_context);
-    trove_finalize();
+    trove_finalize(TROVE_METHOD_DBPF);
 
     return 0;
 }
@@ -499,7 +501,8 @@ static int print_collections(void)
     fprintf(stdout, "Storage space %s collections:\n", storage_space);
 
     while (count > 0) {
-	ret = trove_collection_iterate(&pos,
+	ret = trove_collection_iterate(TROVE_METHOD_DBPF,
+                                       &pos,
 				       &name,
 				       &coll_id,
 				       &count,

Index: pvfs2-genconfig
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-genconfig,v
diff -p -u -r1.61.6.1 -r1.61.6.2
--- pvfs2-genconfig	25 Sep 2006 12:39:49 -0000	1.61.6.1
+++ pvfs2-genconfig	2 Dec 2006 11:22:21 -0000	1.61.6.2
@@ -23,6 +23,7 @@ my $opt_metaservers = '';
 my $opt_logfile = '';
 my $opt_storage = '';
 my $opt_trovesync = '1';
+my $opt_trovemethod = '';
 my $opt_quiet = '';
 my $opt_logging = '';
 my $opt_logstamp = '';
@@ -288,6 +289,11 @@ sub emit_filesystem
         print $target "\t\tCoalescingLowWatermark 1\n";
     }
 
+    if($opt_trovemethod ne "")
+    {
+        print $target "\t\tTroveMethod $opt_trovemethod\n";
+    }
+
     print $target "\t</StorageHints>\n";
 
     if($opt_gen_key ne "0")
@@ -459,6 +465,7 @@ Usage: pvfs2-genconfig [OPTIONS] <fs.con
      --notrovesync                     sync metadata only upon request
      --server-job-timeout <NUM>        server job timeout value (seconds)
      --client-job-timeout <NUM>        server job timeout value (seconds)
+     --trove-method <STRING>           specify a trove method
      --first-handle <NUM>              first handle value to reserve
      --last-handle  <NUM>              last handle value to reserve
      --root-handle  <NUM>              handle value to reserve for root object
@@ -1116,6 +1123,7 @@ GetOptions('protocol=s'    => \$opt_prot
     'help'          => \$show_help,
     'quiet!'        => \$opt_quiet,
     'trovesync!'    => \$opt_trovesync,
+    'trove-method=s' => \$opt_trovemethod,
     'iospec=s'     => \$opt_iospec,
     'metaspec=s'   => \$opt_metaspec, 
     'spec-usage!'  => \$show_specusage,

Index: pvfs2-ls.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-ls.c,v
diff -p -u -r1.65.6.3 -r1.65.6.4
--- pvfs2-ls.c	26 Sep 2006 13:03:08 -0000	1.65.6.3
+++ pvfs2-ls.c	2 Dec 2006 11:22:21 -0000	1.65.6.4
@@ -404,7 +404,7 @@ int do_list(
     PVFS_object_ref ref;
     PVFS_ds_position token;
     uint64_t dir_version = 0;
-    double begin, end;
+    double begin = 0., end;
 
     name = start;
 

Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/module.mk.in,v
diff -p -u -r1.39.14.1 -r1.39.14.2
--- module.mk.in	25 Sep 2006 12:39:48 -0000	1.39.14.1
+++ module.mk.in	2 Dec 2006 11:22:21 -0000	1.39.14.2
@@ -21,6 +21,7 @@ ADMINSRC := \
 	$(DIR)/pvfs2-fsck.c\
 	$(DIR)/pvfs2-cp.c \
 	$(DIR)/pvfs2-viewdist.c \
+	$(DIR)/pvfs2-xattr.c \
 	$(DIR)/pvfs2-touch.c \
 	$(DIR)/pvfs2-remove-object.c \
 	$(DIR)/pvfs2-ln.c \

Index: pvfs2-stat.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-stat.c,v
diff -p -u -r1.7.2.3 -r1.7.2.4
--- pvfs2-stat.c	26 Sep 2006 13:03:08 -0000	1.7.2.3
+++ pvfs2-stat.c	2 Dec 2006 11:22:21 -0000	1.7.2.4
@@ -478,7 +478,22 @@ void print_stats(const PVFS_object_ref *
    {
       fprintf(stdout, "  dir entries   : %llu\n", llu(attr->dirent_count));
    }
-   
+
+   if ((attr->mask & PVFS_ATTR_SYS_TYPE) && 
+          (attr->objtype & PVFS_TYPE_METAFILE))
+   {
+       if (attr->flags == 0)
+           fprintf(stdout, "  flags         : none");
+       else
+           fprintf(stdout, "  flags         : ");
+       if (attr->flags & PVFS_IMMUTABLE_FL)
+           fprintf(stdout, "immutable, ");
+       if (attr->flags & PVFS_APPEND_FL)
+           fprintf(stdout, "append-only, ");
+       if (attr->flags & PVFS_NOATIME_FL)
+           fprintf(stdout, "noatime ");
+       fprintf(stdout, "\n");
+   }
 }
 
 static void usage(int argc, char** argv)

Index: pvfs2-lsplus.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-lsplus.c,v
diff -p -u -r1.3.6.1 -r1.3.6.2
--- pvfs2-lsplus.c	25 Sep 2006 12:39:48 -0000	1.3.6.1
+++ pvfs2-lsplus.c	2 Dec 2006 11:22:21 -0000	1.3.6.2
@@ -394,7 +394,7 @@ int do_list(
     PVFS_object_ref ref;
     PVFS_ds_position token;
     uint64_t dir_version = 0;
-    double begin, end;
+    double begin = 0., end;
 
     name = start;
 



More information about the Pvfs2-cvs mailing list