[Pvfs2-cvs] commit by slang in pvfs2/src/apps/admin: module.mk.in
pvfs2-chmod.c pvfs2-chown.c pvfs2-cp.c
pvfs2-event-mon-example.c pvfs2-fs-dump.c pvfs2-fsck.c
pvfs2-ln.c pvfs2-ls.c pvfs2-lsplus.c
pvfs2-migrate-collection.c pvfs2-mkdir.c
pvfs2-perf-mon-example.c pvfs2-ping.c pvfs2-remove-object.c
pvfs2-rm.c pvfs2-set-debugmask.c pvfs2-set-eventmask.c
pvfs2-set-mode.c pvfs2-set-sync.c pvfs2-showcoll.c
pvfs2-stat.c pvfs2-statfs.c pvfs2-touch.c pvfs2-validate.c
pvfs2-viewdist.c pvfs2-xattr.c
CVS commit program
cvs at parl.clemson.edu
Mon Apr 7 12:30:46 EDT 2008
Update of /projects/cvsroot/pvfs2/src/apps/admin
In directory parlweb1:/tmp/cvs-serv1608/src/apps/admin
Modified Files:
Tag: he-branch
module.mk.in pvfs2-chmod.c pvfs2-chown.c pvfs2-cp.c
pvfs2-event-mon-example.c pvfs2-fs-dump.c pvfs2-fsck.c
pvfs2-ln.c pvfs2-ls.c pvfs2-lsplus.c
pvfs2-migrate-collection.c pvfs2-mkdir.c
pvfs2-perf-mon-example.c pvfs2-ping.c pvfs2-remove-object.c
pvfs2-rm.c pvfs2-set-debugmask.c pvfs2-set-eventmask.c
pvfs2-set-mode.c pvfs2-set-sync.c pvfs2-showcoll.c
pvfs2-stat.c pvfs2-statfs.c pvfs2-touch.c pvfs2-validate.c
pvfs2-viewdist.c pvfs2-xattr.c
Log Message:
hints and events.
Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/module.mk.in,v
diff -p -u -r1.46 -r1.46.10.1
--- module.mk.in 7 Nov 2007 21:46:55 -0000 1.46
+++ module.mk.in 7 Apr 2008 16:30:46 -0000 1.46.10.1
@@ -13,7 +13,6 @@ ADMINSRC := \
$(DIR)/pvfs2-stat.c \
$(DIR)/pvfs2-statfs.c \
$(DIR)/pvfs2-perf-mon-example.c \
- $(DIR)/pvfs2-event-mon-example.c \
$(DIR)/pvfs2-mkdir.c \
$(DIR)/pvfs2-chmod.c \
$(DIR)/pvfs2-chown.c \
@@ -28,6 +27,8 @@ ADMINSRC := \
$(DIR)/pvfs2-ln.c \
$(DIR)/pvfs2-perror.c \
$(DIR)/pvfs2-check-server.c
+
+# $(DIR)/pvfs2-event-mon-example.c \
ADMINSRC_SERVER := \
$(DIR)/pvfs2-mkspace.c \
Index: pvfs2-chmod.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-chmod.c,v
diff -p -u -r1.4 -r1.4.38.1
--- pvfs2-chmod.c 29 May 2006 16:16:36 -0000 1.4
+++ pvfs2-chmod.c 7 Apr 2008 16:30:46 -0000 1.4.38.1
@@ -108,7 +108,7 @@ int pvfs2_chmod (PVFS_permissions perms,
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
ret = PVFS_sys_lookup(cur_fs, pvfs_path,
&credentials, &resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -147,7 +147,7 @@ int pvfs2_chmod (PVFS_permissions perms,
ret = PVFS_sys_ref_lookup(parent_ref.fs_id, str_buf,
parent_ref, &credentials, &resp_lookup,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (ret != 0)
{
fprintf(stderr, "Target '%s' does not exist!\n", str_buf);
@@ -156,7 +156,7 @@ int pvfs2_chmod (PVFS_permissions perms,
memset(&resp_getattr,0,sizeof(PVFS_sysresp_getattr));
attrmask = (PVFS_ATTR_SYS_ALL_SETABLE);
- ret = PVFS_sys_getattr(resp_lookup.ref,attrmask,&credentials,&resp_getattr);
+ ret = PVFS_sys_getattr(resp_lookup.ref,attrmask,&credentials,&resp_getattr, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_getattr",ret);
@@ -168,7 +168,7 @@ int pvfs2_chmod (PVFS_permissions perms,
new_attr.perms = perms;
new_attr.mask = PVFS_ATTR_SYS_PERM;
- ret = PVFS_sys_setattr(resp_lookup.ref,new_attr,&credentials);
+ ret = PVFS_sys_setattr(resp_lookup.ref,new_attr,&credentials, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_setattr",ret);
Index: pvfs2-chown.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-chown.c,v
diff -p -u -r1.3 -r1.3.38.1
--- pvfs2-chown.c 29 May 2006 16:16:36 -0000 1.3
+++ pvfs2-chown.c 7 Apr 2008 16:30:46 -0000 1.3.38.1
@@ -114,7 +114,7 @@ int pvfs2_chown (PVFS_uid owner, PVFS_gi
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
ret = PVFS_sys_lookup(cur_fs, pvfs_path,
&credentials, &resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -153,7 +153,7 @@ int pvfs2_chown (PVFS_uid owner, PVFS_gi
ret = PVFS_sys_ref_lookup(parent_ref.fs_id, str_buf,
parent_ref, &credentials, &resp_lookup,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (ret != 0)
{
fprintf(stderr, "Target '%s' does not exist!\n", str_buf);
@@ -162,7 +162,7 @@ int pvfs2_chown (PVFS_uid owner, PVFS_gi
memset(&resp_getattr,0,sizeof(PVFS_sysresp_getattr));
attrmask = (PVFS_ATTR_SYS_ALL_SETABLE);
- ret = PVFS_sys_getattr(resp_lookup.ref,attrmask,&credentials,&resp_getattr);
+ ret = PVFS_sys_getattr(resp_lookup.ref,attrmask,&credentials,&resp_getattr, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_getattr",ret);
@@ -175,7 +175,7 @@ int pvfs2_chown (PVFS_uid owner, PVFS_gi
new_attr.group = group;
new_attr.mask = PVFS_ATTR_SYS_UID | PVFS_ATTR_SYS_GID;
- ret = PVFS_sys_setattr(resp_lookup.ref,new_attr,&credentials);
+ ret = PVFS_sys_setattr(resp_lookup.ref,new_attr,&credentials, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_setattr",ret);
Index: pvfs2-cp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-cp.c,v
diff -p -u -r1.26 -r1.26.4.1
--- pvfs2-cp.c 3 Mar 2008 17:39:10 -0000 1.26
+++ pvfs2-cp.c 7 Apr 2008 16:30:46 -0000 1.26.4.1
@@ -25,6 +25,7 @@
#include "str-utils.h"
#include "pint-sysint-utils.h"
#include "pvfs2-internal.h"
+#include "pvfs2-hint.h"
/* optional parameters, filled in by parse_args() */
struct options
@@ -70,6 +71,7 @@ typedef struct file_object_s {
} u;
} file_object;
+static PVFS_hint hints = NULL;
static struct options* parse_args(int argc, char* argv[]);
static void usage(int argc, char** argv);
@@ -132,6 +134,8 @@ int main (int argc, char ** argv)
return(-1);
}
+ PVFS_hint_import_env(& hints);
+
ret = PVFS_util_init_defaults();
if (ret < 0)
{
@@ -198,6 +202,7 @@ int main (int argc, char ** argv)
{
print_timings(time2-time1, total_written);
}
+
ret = 0;
main_out:
@@ -205,6 +210,8 @@ main_out:
PVFS_sys_finalize();
free(user_opts);
free(buffer);
+
+ PVFS_hint_free(hints);
return(ret);
}
@@ -331,7 +338,7 @@ static size_t generic_read(file_object *
return (ret);
}
ret = PVFS_sys_read(src->u.pvfs2.ref, file_req, offset,
- buffer, mem_req, credentials, &resp_io);
+ buffer, mem_req, credentials, &resp_io, hints);
if (ret == 0)
{
PVFS_Request_free(&mem_req);
@@ -363,7 +370,7 @@ static size_t generic_write(file_object
return(ret);
}
ret = PVFS_sys_write(dest->u.pvfs2.ref, file_req, offset,
- buffer, mem_req, credentials, &resp_io);
+ buffer, mem_req, credentials, &resp_io, hints);
if (ret == 0)
{
PVFS_Request_free(&mem_req);
@@ -484,7 +491,7 @@ static int generic_open(file_object *obj
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
ret = PVFS_sys_lookup(obj->u.pvfs2.fs_id, obj->u.pvfs2.pvfs2_path,
credentials, &resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, hints);
if (ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -553,13 +560,13 @@ static int generic_open(file_object *obj
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
ret = PVFS_sys_ref_lookup(parent_ref.fs_id, entry_name,
parent_ref, credentials, &resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, hints);
if ((ret == 0) && (open_type == OPEN_SRC))
{
memset(&resp_getattr, 0, sizeof(PVFS_sysresp_getattr));
ret = PVFS_sys_getattr(resp_lookup.ref, PVFS_ATTR_SYS_ALL_NOHINT,
- credentials, &resp_getattr);
+ credentials, &resp_getattr, hints);
if (ret)
{
fprintf(stderr, "Failed to do pvfs2 getattr on %s\n",
@@ -628,7 +635,7 @@ static int generic_open(file_object *obj
ret = PVFS_sys_create(entry_name, parent_ref,
obj->u.pvfs2.attr, credentials,
- new_dist, NULL, &resp_create);
+ new_dist, &resp_create, NULL, hints);
if (ret < 0)
{
PVFS_perror("PVFS_sys_create", ret);
@@ -662,7 +669,7 @@ static int generic_cleanup(file_object *
/* preserve permissions doing a pvfs2 => pvfs2 copy */
if ((src->fs_type == PVFS2_FILE) && (dest->fs_type == PVFS2_FILE))
{
- PVFS_sys_setattr(dest->u.pvfs2.ref, src->u.pvfs2.attr, credentials);
+ PVFS_sys_setattr(dest->u.pvfs2.ref, src->u.pvfs2.attr, credentials, hints);
}
if ((src->fs_type == UNIX_FILE) && (src->u.ufs.fd != -1))
Index: pvfs2-event-mon-example.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-event-mon-example.c,v
diff -p -u -r1.16 -r1.16.52.1
--- pvfs2-event-mon-example.c 10 Nov 2005 01:26:56 -0000 1.16
+++ pvfs2-event-mon-example.c 7 Apr 2008 16:30:46 -0000 1.16.52.1
@@ -16,7 +16,6 @@
#include "pvfs2.h"
#include "pvfs2-mgmt.h"
-#include "pvfs2-event.h"
#ifndef PVFS2_VERSION
#define PVFS2_VERSION "Unknown"
@@ -129,7 +128,8 @@ int main(int argc, char **argv)
addr_array,
io_server_count,
EVENT_DEPTH,
- NULL /* detailed errors */);
+ NULL /* detailed errors */
+ , NULL);
if (ret < 0)
{
PVFS_perror("PVFS_mgmt_event_mon_list", EVENT_DEPTH);
Index: pvfs2-fs-dump.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-fs-dump.c,v
diff -p -u -r1.43 -r1.43.36.1
--- pvfs2-fs-dump.c 16 Jun 2006 21:01:11 -0000 1.43
+++ pvfs2-fs-dump.c 7 Apr 2008 16:30:46 -0000 1.43.36.1
@@ -111,6 +111,7 @@ int main(int argc, char **argv)
PVFS_credentials creds;
int server_count;
PVFS_BMI_addr_t *addr_array;
+ struct PVFS_mgmt_setparam_value param_value;
/* look at command line arguments */
user_opts = parse_args(argc, argv);
@@ -166,26 +167,31 @@ int main(int argc, char **argv)
return -1;
}
+ param_value.type = PVFS_SERV_PARAM_MODE;
+ param_value.u.value = PVFS_SERVER_ADMIN_MODE;
+
/* put the servers into administrative mode */
ret = PVFS_mgmt_setparam_list(cur_fs,
- &creds,
- PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_ADMIN_MODE,
- addr_array,
- NULL,
- server_count,
- NULL /* detailed errors */);
+ &creds,
+ PVFS_SERV_PARAM_MODE,
+ ¶m_value,
+ addr_array,
+ server_count,
+ NULL, /* detailed errors */
+ NULL);
if (ret != 0)
{
+ param_value.type = PVFS_SERV_PARAM_MODE;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+
PVFS_perror("PVFS_mgmt_setparam_list", ret);
PVFS_mgmt_setparam_list(cur_fs,
&creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return(-1);
}
@@ -213,15 +219,16 @@ int main(int argc, char **argv)
handlelist_finalize();
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
PVFS_mgmt_setparam_list(
cur_fs,
&creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
PVFS_sys_finalize();
@@ -241,20 +248,22 @@ int build_handlelist(PVFS_fs_id cur_fs,
unsigned long *total_count_array;
PVFS_ds_position *position_array;
struct PVFS_mgmt_server_stat *stat_array;
+ struct PVFS_mgmt_setparam_value param_value;
/* find out how many handles are in use on each */
stat_array = (struct PVFS_mgmt_server_stat *)
malloc(server_count * sizeof(struct PVFS_mgmt_server_stat));
if (stat_array == NULL)
{
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
PVFS_mgmt_setparam_list(cur_fs,
creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return -1;
}
@@ -263,18 +272,20 @@ int build_handlelist(PVFS_fs_id cur_fs,
stat_array,
addr_array,
server_count,
- NULL /* details */);
+ NULL /* details */
+ , NULL);
if (ret != 0)
{
- PVFS_perror("PVFS_mgmt_statfs_list", ret);
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+ PVFS_perror("PVFS_mgmt_statfs_list", ret);
PVFS_mgmt_setparam_list(cur_fs,
creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return -1;
}
@@ -348,18 +359,20 @@ int build_handlelist(PVFS_fs_id cur_fs,
position_array,
addr_array,
server_count,
- NULL /* details */);
+ NULL /* details */
+ , NULL);
if (ret < 0)
{
- PVFS_perror("PVFS_mgmt_iterate_handles_list", ret);
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+ PVFS_perror("PVFS_mgmt_iterate_handles_list", ret);
PVFS_mgmt_setparam_list(cur_fs,
creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return -1;
}
@@ -434,14 +447,14 @@ int traverse_directory_tree(PVFS_fs_id c
PVFS_object_ref pref;
PVFS_sys_lookup(cur_fs, "/", creds,
- &lookup_resp, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &lookup_resp, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
/* lookup_resp.pinode_refn.handle gets root handle */
pref = lookup_resp.ref;
PVFS_sys_getattr(pref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp);
+ &getattr_resp, NULL);
if (getattr_resp.attr.objtype != PVFS_TYPE_DIRECTORY)
{
@@ -490,7 +503,7 @@ int descend(PVFS_fs_id cur_fs,
(!token ? PVFS_READDIR_START : token),
count,
creds,
- &readdir_resp);
+ &readdir_resp, NULL);
for (i = 0; i < readdir_resp.pvfs_dirent_outcount; i++)
{
@@ -507,7 +520,7 @@ int descend(PVFS_fs_id cur_fs,
if ((ret = PVFS_sys_getattr(entry_ref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp)) != 0)
+ &getattr_resp, NULL)) != 0)
{
printf("Could not get attributes of handle %llu [%d]\n",
llu(cur_handle), ret);
@@ -585,7 +598,7 @@ void verify_datafiles(PVFS_fs_id cur_fs,
printf("invalid value of number of datafiles = %d\n", df_count);
assert(0);
}
- ret = PVFS_mgmt_get_dfile_array(mf_ref, creds, df_handles, df_count);
+ ret = PVFS_mgmt_get_dfile_array(mf_ref, creds, df_handles, df_count, NULL);
if (ret != 0)
{
assert(0);
@@ -638,7 +651,7 @@ void analyze_remaining_handles(PVFS_fs_i
/* only remaining handles are dirdata */
PVFS_sys_getattr(entry_ref,
PVFS_ATTR_SYS_ALL,
- creds, &getattr_resp);
+ creds, &getattr_resp, NULL);
if (getattr_resp.attr.objtype != PVFS_TYPE_DIRDATA)
{
flag = 0;
Index: pvfs2-fsck.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-fsck.c,v
diff -p -u -r1.24 -r1.24.6.1
--- pvfs2-fsck.c 10 Dec 2007 16:13:53 -0000 1.24
+++ pvfs2-fsck.c 7 Apr 2008 16:30:46 -0000 1.24.6.1
@@ -50,6 +50,7 @@ int main(int argc, char **argv)
int server_count;
PVFS_BMI_addr_t *addr_array = NULL;
struct handlelist *hl_all, *hl_unrefd, *hl_notree;
+ struct PVFS_mgmt_setparam_value param_value;
fsck_opts = parse_args(argc, argv);
if (!fsck_opts)
@@ -122,15 +123,17 @@ int main(int argc, char **argv)
return -1;
}
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_ADMIN_MODE;
/* put the servers into administrative mode */
ret = PVFS_mgmt_setparam_list(cur_fs,
&creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_ADMIN_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL /* detailed errors */);
+ NULL, /* detailed errors */
+ NULL);
if (ret != 0)
{
PVFS_perror("PVFS_mgmt_setparam_list", ret);
@@ -177,15 +180,17 @@ int main(int argc, char **argv)
handlelist_finalize(&hl_all);
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+
/* drop out of admin mode now that we've traversed the dir tree */
PVFS_mgmt_setparam_list(cur_fs,
&creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t) PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
in_admin_mode = 0;
/* third pass moves salvagable objects into lost+found:
@@ -212,15 +217,18 @@ int main(int argc, char **argv)
exit_now:
if (in_admin_mode) {
+
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+
/* get us out of admin mode */
PVFS_mgmt_setparam_list(cur_fs,
&creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t) PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
}
PVFS_sys_finalize();
@@ -245,20 +253,22 @@ struct handlelist *build_handlelist(PVFS
PVFS_ds_position *position_array;
struct PVFS_mgmt_server_stat *stat_array;
struct handlelist *hl;
+ struct PVFS_mgmt_setparam_value param_value;
/* find out how many handles are in use on each */
stat_array = (struct PVFS_mgmt_server_stat *)
malloc(server_count * sizeof(struct PVFS_mgmt_server_stat));
if (stat_array == NULL)
{
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
PVFS_mgmt_setparam_list(cur_fs,
creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return NULL;
}
@@ -267,18 +277,21 @@ struct handlelist *build_handlelist(PVFS
stat_array,
addr_array,
server_count,
- NULL /* details */);
+ NULL /* details */
+ , NULL);
if (ret != 0)
{
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+
PVFS_perror("PVFS_mgmt_statfs_list", ret);
PVFS_mgmt_setparam_list(cur_fs,
creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return NULL;
}
@@ -353,18 +366,20 @@ struct handlelist *build_handlelist(PVFS
position_array,
addr_array,
server_count,
- NULL /* details */);
+ NULL /* details */, NULL);
if (ret < 0)
{
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = PVFS_SERVER_NORMAL_MODE;
+
PVFS_perror("PVFS_mgmt_iterate_handles_list", ret);
PVFS_mgmt_setparam_list(cur_fs,
creds,
PVFS_SERV_PARAM_MODE,
- (uint64_t)PVFS_SERVER_NORMAL_MODE,
+ ¶m_value,
addr_array,
- NULL,
server_count,
- NULL);
+ NULL, NULL);
return NULL;
}
@@ -443,7 +458,7 @@ int traverse_directory_tree(PVFS_fs_id c
"/",
creds,
&lookup_resp,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
assert(ret == 0);
pref = lookup_resp.ref;
@@ -451,7 +466,7 @@ int traverse_directory_tree(PVFS_fs_id c
PVFS_sys_getattr(pref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp);
+ &getattr_resp, NULL);
assert(getattr_resp.attr.objtype == PVFS_TYPE_DIRECTORY);
@@ -486,7 +501,7 @@ int match_dirdata(struct handlelist *hl,
ret = PVFS_mgmt_get_dirdata_handle(dir_ref,
&dirdata_handle,
- creds);
+ creds, NULL);
if (ret != 0)
{
PVFS_perror("match_dirdata", ret);
@@ -530,7 +545,7 @@ int descend(PVFS_fs_id cur_fs,
(!token ? PVFS_READDIR_START : token),
count,
creds,
- &readdir_resp);
+ &readdir_resp, NULL);
for (i = 0; i < readdir_resp.pvfs_dirent_outcount; i++)
{
@@ -569,7 +584,7 @@ int descend(PVFS_fs_id cur_fs,
ret = PVFS_sys_getattr(entry_ref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp);
+ &getattr_resp, NULL);
if (ret != 0) {
ret = remove_directory_entry(dir_ref,
entry_ref,
@@ -706,7 +721,7 @@ int verify_datafiles(PVFS_fs_id cur_fs,
{
assert(0);
}
- ret = PVFS_mgmt_get_dfile_array(mf_ref, creds, df_handles, df_count);
+ ret = PVFS_mgmt_get_dfile_array(mf_ref, creds, df_handles, df_count, NULL);
if (ret != 0)
{
/* what does this mean? */
@@ -799,7 +814,7 @@ struct handlelist *find_sub_trees(PVFS_f
ret = PVFS_sys_getattr(handle_ref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp);
+ &getattr_resp, NULL);
if (ret) {
/* remove anything we can't get attributes on */
ret = remove_object(handle_ref,
@@ -880,7 +895,7 @@ struct handlelist *fill_lost_and_found(P
ret = PVFS_sys_getattr(handle_ref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp);
+ &getattr_resp, NULL);
if (ret) {
printf("warning: problem calling getattr on %llu; assuming datafile for now.\n",
llu(handle));
@@ -991,7 +1006,7 @@ void cull_leftovers(PVFS_fs_id cur_fs,
ret = PVFS_sys_getattr(handle_ref,
PVFS_ATTR_SYS_ALL_NOHINT,
creds,
- &getattr_resp);
+ &getattr_resp, NULL);
if (ret) {
printf("warning: problem calling getattr on %llu\n",
llu(handle));
@@ -1027,7 +1042,7 @@ int create_lost_and_found(PVFS_fs_id cur
"/lost+found",
creds,
&lookup_resp,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (ret == 0) {
laf_ref = lookup_resp.ref;
return 0;
@@ -1043,7 +1058,7 @@ int create_lost_and_found(PVFS_fs_id cur
"/",
creds,
&lookup_resp,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
assert(ret == 0);
root_ref = lookup_resp.ref;
@@ -1056,7 +1071,7 @@ int create_lost_and_found(PVFS_fs_id cur
root_ref,
attr,
creds,
- &mkdir_resp);
+ &mkdir_resp, NULL);
if (ret == 0) {
laf_ref = mkdir_resp.ref;
}
@@ -1085,7 +1100,7 @@ int create_dirent(PVFS_object_ref dir_re
ret = PVFS_mgmt_create_dirent(dir_ref,
name,
handle,
- creds);
+ creds, NULL);
if (ret != 0) {
PVFS_perror("PVFS_mgmt_create_dirent", ret);
}
@@ -1113,7 +1128,7 @@ int remove_directory_entry(PVFS_object_r
if (fsck_opts->destructive) {
ret = PVFS_mgmt_remove_dirent(dir_ref,
name,
- creds);
+ creds, NULL);
if (ret != 0) {
PVFS_perror("PVFS_mgmt_remove_dirent", ret);
}
@@ -1138,7 +1153,7 @@ int remove_object(PVFS_object_ref obj_re
if (fsck_opts->destructive) {
ret = PVFS_mgmt_remove_object(obj_ref,
- creds);
+ creds, NULL);
if (ret != 0) {
PVFS_perror("PVFS_mgmt_remove_object", ret);
}
@@ -1523,4 +1538,3 @@ static char *get_type_str(int type)
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
-
Index: pvfs2-ln.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-ln.c,v
diff -p -u -r1.5 -r1.5.22.1
--- pvfs2-ln.c 16 Sep 2006 21:48:39 -0000 1.5
+++ pvfs2-ln.c 7 Apr 2008 16:30:46 -0000 1.5.22.1
@@ -187,7 +187,7 @@ static int make_link(PVFS_credentials
(char *) pszLinkTarget,
attr,
pCredentials,
- &resp_sym);
+ &resp_sym, NULL);
if (ret < 0)
{
Index: pvfs2-ls.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-ls.c,v
diff -p -u -r1.73 -r1.73.4.1
--- pvfs2-ls.c 22 Feb 2008 15:26:08 -0000 1.73
+++ pvfs2-ls.c 7 Apr 2008 16:30:46 -0000 1.73.4.1
@@ -126,7 +126,7 @@ static inline void format_size_string(
spaces_size_allowed = num_spaces_total;
}
}
-
+
buf = (char *)malloc(spaces_size_allowed+1);
assert(buf);
@@ -342,6 +342,8 @@ void print_entry(
PVFS_object_ref ref;
PVFS_credentials credentials;
PVFS_sysresp_getattr getattr_response;
+ PVFS_hint hints = PVFS_HINT_NULL;
+ int client_id, req_id;
if (!opts->list_long)
{
@@ -362,8 +364,15 @@ void print_entry(
memset(&getattr_response,0, sizeof(PVFS_sysresp_getattr));
PVFS_util_gen_credentials(&credentials);
+ client_id = random();
+ printf("CLIENT_ID: %d\n", client_id);
+ PVFS_hint_add(&hints, PVFS_HINT_CLIENT_ID_NAME, sizeof(uint32_t), &client_id);
+ req_id = random();
+ printf("REQ_ID: %d\n", req_id);
+ PVFS_hint_add(&hints, PVFS_HINT_REQUEST_ID_NAME, sizeof(uint32_t), &req_id);
+
ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
- &credentials, &getattr_response);
+ &credentials, &getattr_response, hints);
if (ret)
{
fprintf(stderr,"Failed to get attributes on handle %llu,%d\n",
@@ -399,6 +408,8 @@ int do_list(
PVFS_ds_position token;
uint64_t dir_version = 0;
double begin = 0., end;
+ PVFS_hint hints = PVFS_HINT_NULL;
+ uint32_t client_id, req_id;
name = start;
@@ -406,7 +417,7 @@ int do_list(
PVFS_util_gen_credentials(&credentials);
ret = PVFS_sys_lookup(fs_id, name, &credentials,
- &lk_response, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &lk_response, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if(ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -417,9 +428,16 @@ int do_list(
ref.fs_id = fs_id;
pvfs_dirent_incount = MAX_NUM_DIRENTS;
+ client_id = random();
+ printf("CLIENT_ID: %d\n", client_id);
+ PVFS_hint_add(&hints, PVFS_HINT_CLIENT_ID_NAME, sizeof(uint32_t), &client_id);
+ req_id = random();
+ printf("REQ_ID: %d\n", req_id);
+ PVFS_hint_add(&hints, PVFS_HINT_REQUEST_ID_NAME, sizeof(uint32_t), &req_id);
+
memset(&getattr_response,0,sizeof(PVFS_sysresp_getattr));
ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
- &credentials, &getattr_response);
+ &credentials, &getattr_response, hints);
if(ret == 0)
{
if ((getattr_response.attr.objtype == PVFS_TYPE_METAFILE) ||
@@ -438,7 +456,7 @@ int do_list(
if (getattr_response.attr.objtype == PVFS_TYPE_DIRECTORY)
{
if (PVFS_sys_getparent(ref.fs_id, name, &credentials,
- &getparent_resp) == 0)
+ &getparent_resp, NULL) == 0)
{
print_dot_and_dot_dot_info_if_required(
getparent_resp.parent_ref);
@@ -468,10 +486,19 @@ int do_list(
token = 0;
do
{
+ PVFS_hint_free(hints);
+ hints = PVFS_HINT_NULL;
+ client_id = random();
+ printf("CLIENT_ID: %d\n", client_id);
+ PVFS_hint_add(&hints, PVFS_HINT_CLIENT_ID_NAME, sizeof(uint32_t), &client_id);
+ req_id = random();
+ printf("REQ_ID: %d\n", req_id);
+ PVFS_hint_add(&hints, PVFS_HINT_REQUEST_ID_NAME, sizeof(uint32_t), &req_id);
+
memset(&rd_response, 0, sizeof(PVFS_sysresp_readdir));
ret = PVFS_sys_readdir(
ref, (!token ? PVFS_READDIR_START : token),
- pvfs_dirent_incount, &credentials, &rd_response);
+ pvfs_dirent_incount, &credentials, &rd_response, hints);
if(ret < 0)
{
PVFS_perror("PVFS_sys_readdir", ret);
Index: pvfs2-lsplus.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-lsplus.c,v
diff -p -u -r1.6 -r1.6.4.1
--- pvfs2-lsplus.c 11 Mar 2008 14:49:41 -0000 1.6
+++ pvfs2-lsplus.c 7 Apr 2008 16:30:46 -0000 1.6.4.1
@@ -387,7 +387,7 @@ void print_entry(
PVFS_util_gen_credentials(&credentials);
ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
- &credentials, &getattr_response);
+ &credentials, &getattr_response, NULL);
if (ret)
{
fprintf(stderr,"Failed to get attributes on handle %llu,%d\n",
@@ -436,7 +436,7 @@ int do_list(
PVFS_util_gen_credentials(&credentials);
ret = PVFS_sys_lookup(fs_id, name, &credentials,
- &lk_response, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &lk_response, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if(ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -449,7 +449,7 @@ int do_list(
memset(&getattr_response,0,sizeof(PVFS_sysresp_getattr));
if (PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL,
- &credentials, &getattr_response) == 0)
+ &credentials, &getattr_response, NULL) == 0)
{
if ((getattr_response.attr.objtype == PVFS_TYPE_METAFILE) ||
(getattr_response.attr.objtype == PVFS_TYPE_SYMLINK) ||
@@ -467,7 +467,7 @@ int do_list(
if (getattr_response.attr.objtype == PVFS_TYPE_DIRECTORY)
{
if (PVFS_sys_getparent(ref.fs_id, name, &credentials,
- &getparent_resp) == 0)
+ &getparent_resp, NULL) == 0)
{
print_dot_and_dot_dot_info_if_required(
getparent_resp.parent_ref);
@@ -499,8 +499,10 @@ int do_list(
ret = PVFS_sys_readdirplus(
ref, (!token ? PVFS_READDIR_START : token),
pvfs_dirent_incount, &credentials,
- (opts->list_long) ? PVFS_ATTR_SYS_ALL : PVFS_ATTR_SYS_ALL_NOSIZE,
- &rdplus_response);
+ (opts->list_long) ?
+ PVFS_ATTR_SYS_ALL : PVFS_ATTR_SYS_ALL_NOSIZE,
+ &rdplus_response,
+ NULL);
if(ret < 0)
{
PVFS_perror("PVFS_sys_readdir", ret);
Index: pvfs2-migrate-collection.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-migrate-collection.c,v
diff -p -u -r1.21 -r1.21.2.1
--- pvfs2-migrate-collection.c 4 Apr 2008 16:39:47 -0000 1.21
+++ pvfs2-migrate-collection.c 7 Apr 2008 16:30:46 -0000 1.21.2.1
@@ -1124,7 +1124,7 @@ static int translate_dspace_attr_0_0_1(
coll_id, &extent_array, &new_handle,
tmp_attr->type, NULL,
(TROVE_SYNC | TROVE_FORCE_REQUESTED_HANDLE),
- NULL, trove_context, &op_id);
+ NULL, trove_context, &op_id, NULL);
while (ret == 0)
{
@@ -1168,7 +1168,7 @@ static int translate_dspace_attr_0_0_1(
TROVE_SYNC,
NULL,
trove_context,
- &op_id);
+ &op_id, NULL);
while (ret == 0)
{
ret = trove_dspace_test(
@@ -1452,7 +1452,7 @@ static int translate_keyval_db_0_0_1(
state = 0;
ret = trove_keyval_write(
coll_id, handle, &t_key, &t_val, trove_flags, 0, NULL,
- trove_context, &op_id);
+ trove_context, &op_id, NULL);
while (ret == 0)
{
Index: pvfs2-mkdir.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-mkdir.c,v
diff -p -u -r1.13 -r1.13.22.1
--- pvfs2-mkdir.c 16 Sep 2006 21:48:39 -0000 1.13
+++ pvfs2-mkdir.c 7 Apr 2008 16:30:46 -0000 1.13.22.1
@@ -237,7 +237,7 @@ static int make_directory(PVFS_credentia
parentdir_ptr,
credentials,
&resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
if( ret < 0 &&
!make_parent_dirs)
@@ -275,7 +275,7 @@ static int make_directory(PVFS_credentia
parentdir_ptr,
credentials,
&resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
if(ret < 0)
{
@@ -314,7 +314,7 @@ static int make_directory(PVFS_credentia
parent_ref,
attr,
credentials,
- &resp_mkdir);
+ &resp_mkdir, NULL);
if (ret < 0)
{
Index: pvfs2-perf-mon-example.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-perf-mon-example.c,v
diff -p -u -r1.23 -r1.23.38.1
--- pvfs2-perf-mon-example.c 29 May 2006 16:16:36 -0000 1.23
+++ pvfs2-perf-mon-example.c 7 Apr 2008 16:30:46 -0000 1.23.38.1
@@ -157,7 +157,7 @@ int main(int argc, char **argv)
next_id_array,
io_server_count,
HISTORY,
- NULL);
+ NULL, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_mgmt_perf_mon_list", ret);
Index: pvfs2-ping.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-ping.c,v
diff -p -u -r1.52 -r1.52.22.1
--- pvfs2-ping.c 12 Sep 2006 00:49:29 -0000 1.52
+++ pvfs2-ping.c 7 Apr 2008 16:30:46 -0000 1.52.22.1
@@ -53,6 +53,7 @@ int main(int argc, char **argv)
PVFS_credentials creds;
PVFS_sysresp_lookup resp_lookup;
PVFS_error_details * error_details;
+ struct PVFS_mgmt_setparam_value param_value;
int count;
/* look at command line arguments */
@@ -168,14 +169,17 @@ int main(int argc, char **argv)
fprintf(stderr, "Failure: could not create error details\n");
return(-1);
}
-
+
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = (uint64_t)cur_fs;
+
/* check that the fsid exists on all of the servers */
/* TODO: we need a way to get information out about which server fails
* in error cases here
*/
ret = PVFS_mgmt_setparam_all(
cur_fs, &creds, PVFS_SERV_PARAM_FSID_CHECK,
- (uint64_t)cur_fs, NULL, error_details);
+ ¶m_value, error_details, NULL);
if(ret < 0)
{
PVFS_perror("PVFS_mgmt_setparam_all", ret);
@@ -193,7 +197,7 @@ int main(int argc, char **argv)
printf("\n(7) Verifying that root handle is owned by one server...\n");
ret = PVFS_sys_lookup(cur_fs, "/", &creds,
- &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if(ret != 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -202,13 +206,16 @@ int main(int argc, char **argv)
}
printf("\n Root handle: %llu\n", llu(resp_lookup.ref.handle));
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = (uint64_t)resp_lookup.ref.handle;
+
/* check that only one server controls root handle */
/* TODO: we need a way to get information out about which server
* failed in error cases here
*/
ret = PVFS_mgmt_setparam_all(
cur_fs, &creds, PVFS_SERV_PARAM_ROOT_CHECK,
- (uint64_t)resp_lookup.ref.handle, NULL, error_details);
+ ¶m_value, error_details, NULL);
if(ret < 0)
{
@@ -294,7 +301,7 @@ static int noop_all_servers(PVFS_fs_id f
{
printf(" %s ",
PVFS_mgmt_map_addr(fsid, &creds, addr_array[i], &tmp));
- ret = PVFS_mgmt_noop(fsid, &creds, addr_array[i]);
+ ret = PVFS_mgmt_noop(fsid, &creds, addr_array[i], NULL);
if (ret == 0)
{
printf("Ok\n");
@@ -336,7 +343,7 @@ static int noop_all_servers(PVFS_fs_id f
{
printf(" %s ",
PVFS_mgmt_map_addr(fsid, &creds, addr_array[i], &tmp));
- ret = PVFS_mgmt_noop(fsid, &creds, addr_array[i]);
+ ret = PVFS_mgmt_noop(fsid, &creds, addr_array[i], NULL);
if (ret == 0)
{
printf("Ok\n");
Index: pvfs2-remove-object.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-remove-object.c,v
diff -p -u -r1.8 -r1.8.22.1
--- pvfs2-remove-object.c 16 Sep 2006 21:48:39 -0000 1.8
+++ pvfs2-remove-object.c 7 Apr 2008 16:30:46 -0000 1.8.22.1
@@ -216,7 +216,7 @@ int main(int argc, char **argv)
fprintf(stderr,"Attempting to remove object %llu,%d\n",
llu(ref.handle), ref.fs_id);
- ret = PVFS_mgmt_remove_object(ref, &credentials);
+ ret = PVFS_mgmt_remove_object(ref, &credentials, NULL);
if (ret)
{
PVFS_perror("PVFS_mgmt_remove_object", ret);
@@ -228,7 +228,7 @@ int main(int argc, char **argv)
"\n", user_opts->dirent_name, llu(ref.handle), ref.fs_id);
ret = PVFS_mgmt_remove_dirent(
- ref, user_opts->dirent_name, &credentials);
+ ref, user_opts->dirent_name, &credentials, NULL);
if (ret)
{
PVFS_perror("PVFS_mgmt_remove_dirent", ret);
Index: pvfs2-rm.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-rm.c,v
diff -p -u -r1.10 -r1.10.12.1
--- pvfs2-rm.c 5 Apr 2007 20:58:36 -0000 1.10
+++ pvfs2-rm.c 7 Apr 2008 16:30:46 -0000 1.10.12.1
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
rc = PVFS_sys_lookup(cur_fs, pvfs_path, &credentials,
- &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (rc)
{
PVFS_perror("PVFS_sys_lookup", rc);
@@ -110,7 +110,7 @@ int main(int argc, char **argv)
memset(&resp_getattr, 0, sizeof(PVFS_sysresp_getattr));
rc = PVFS_sys_getattr(resp_lookup.ref, PVFS_ATTR_SYS_TYPE,
- &credentials, &resp_getattr);
+ &credentials, &resp_getattr, NULL);
if (rc)
{
PVFS_perror("PVFS_sys_getattr", rc);
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
rc = PVFS_sys_lookup(cur_fs, directory, &credentials,
- &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (rc)
{
PVFS_perror("PVFS_sys_lookup", rc);
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
}
parent_ref = resp_lookup.ref;
- rc = PVFS_sys_remove(filename, parent_ref, &credentials);
+ rc = PVFS_sys_remove(filename, parent_ref, &credentials, NULL);
if (rc)
{
fprintf(stderr, "Error: An error occurred while "
Index: pvfs2-set-debugmask.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-set-debugmask.c,v
diff -p -u -r1.24 -r1.24.22.1
--- pvfs2-set-debugmask.c 16 Sep 2006 21:48:39 -0000 1.24
+++ pvfs2-set-debugmask.c 7 Apr 2008 16:30:46 -0000 1.24.22.1
@@ -42,6 +42,7 @@ int main(int argc, char **argv)
struct options *user_opts = NULL;
char pvfs_path[PVFS_NAME_MAX] = {0};
PVFS_credentials creds;
+ struct PVFS_mgmt_setparam_value param_value;
/* look at command line arguments */
user_opts = parse_args(argc, argv);
@@ -76,18 +77,22 @@ int main(int argc, char **argv)
printf("Setting debugmask on server %s\n",
user_opts->single_server);
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = (uint64_t)user_opts->debug_mask;
ret = PVFS_mgmt_setparam_single(
cur_fs, &creds, PVFS_SERV_PARAM_GOSSIP_MASK,
- user_opts->debug_mask, user_opts->single_server,
+ ¶m_value, user_opts->single_server,
NULL, NULL);
}
else
{
printf("Setting debugmask on all servers\n");
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = user_opts->debug_mask;
ret = PVFS_mgmt_setparam_all(
cur_fs, &creds, PVFS_SERV_PARAM_GOSSIP_MASK,
- user_opts->debug_mask, NULL, NULL);
+ ¶m_value, NULL, NULL);
}
if (ret)
Index: pvfs2-set-eventmask.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-set-eventmask.c,v
diff -p -u -r1.12 -r1.12.38.1
--- pvfs2-set-eventmask.c 29 May 2006 16:16:36 -0000 1.12
+++ pvfs2-set-eventmask.c 7 Apr 2008 16:30:46 -0000 1.12.38.1
@@ -27,10 +27,8 @@ struct options
{
char* mnt_point;
int mnt_point_set;
- int api_mask;
- int api_mask_set;
- int op_mask;
- int op_mask_set;
+ char *event_string;
+ int events_set;
};
static struct options* parse_args(int argc, char* argv[]);
@@ -43,8 +41,8 @@ int main(int argc, char **argv)
struct options* user_opts = NULL;
char pvfs_path[PVFS_NAME_MAX] = {0};
PVFS_credentials creds;
+ struct PVFS_mgmt_setparam_value param_value;
- /* look at command line arguments */
user_opts = parse_args(argc, argv);
if(!user_opts)
{
@@ -73,35 +71,24 @@ int main(int argc, char **argv)
PVFS_util_gen_credentials(&creds);
- if(!user_opts->op_mask || !user_opts->api_mask)
+ param_value.type = PVFS_MGMT_PARAM_TYPE_STRING;
+ if(!user_opts->event_string)
{
- /* turn off event logging */
- ret = PVFS_mgmt_setparam_all(cur_fs, &creds,
- PVFS_SERV_PARAM_EVENT_ON, 0, NULL, NULL);
+ param_value.u.string_value = "none";
}
else
{
- /* set mask */
- ret = PVFS_mgmt_setparam_all(cur_fs, &creds,
- PVFS_SERV_PARAM_EVENT_MASKS,
- (int64_t)(((int64_t)user_opts->op_mask << 32)
- + user_opts->api_mask),
- NULL, NULL);
- if(ret < 0)
- {
- PVFS_perror("PVFS_mgmt_setparam_all", ret);
- return(-1);
- }
-
- /* turn on event logging */
- ret = PVFS_mgmt_setparam_all(cur_fs, &creds,
- PVFS_SERV_PARAM_EVENT_ON, 1, NULL, NULL);
+ param_value.u.string_value = user_opts->event_string;
}
+ ret = PVFS_mgmt_setparam_all(
+ cur_fs, &creds,
+ PVFS_SERV_PARAM_EVENT_ENABLE,
+ ¶m_value, NULL, NULL);
if(ret < 0)
{
- PVFS_perror("PVFS_mgmt_setparam_all", ret);
- return(-1);
+ PVFS_perror("PVFS_mgmt_setparam_all", ret);
+ return(-1);
}
PVFS_sys_finalize();
@@ -118,7 +105,7 @@ int main(int argc, char **argv)
*/
static struct options* parse_args(int argc, char* argv[])
{
- char flags[] = "vm:a:o:";
+ char flags[] = "vm:e:";
int one_opt = 0;
int len = 0;
@@ -160,23 +147,14 @@ static struct options* parse_args(int ar
strcat(tmp_opts->mnt_point, "/");
tmp_opts->mnt_point_set = 1;
break;
- case('a'):
- sscanf(optarg, "%x", &tmp_opts->api_mask);
- if(ret < 1){
- if(tmp_opts->mnt_point) free(tmp_opts->mnt_point);
- free(tmp_opts);
- return(NULL);
- }
- tmp_opts->api_mask_set = 1;
- break;
- case('o'):
- sscanf(optarg, "%x", &tmp_opts->op_mask);
+ case('e'):
+ tmp_opts->event_string = strdup(optarg);
if(ret < 1){
if(tmp_opts->mnt_point) free(tmp_opts->mnt_point);
free(tmp_opts);
return(NULL);
}
- tmp_opts->op_mask_set = 1;
+ tmp_opts->events_set = 1;
break;
case('?'):
usage(argc, argv);
@@ -184,8 +162,7 @@ static struct options* parse_args(int ar
}
}
- if(!tmp_opts->mnt_point_set || !tmp_opts->api_mask_set ||
- !tmp_opts->op_mask_set)
+ if(!tmp_opts->mnt_point_set || !tmp_opts->events_set)
{
if(tmp_opts->mnt_point) free(tmp_opts->mnt_point);
free(tmp_opts);
@@ -200,8 +177,8 @@ static void usage(int argc, char** argv)
{
fprintf(stderr, "\n");
fprintf(stderr, "Usage : %s [-m fs_mount_point] "
- "[-a hex_api_mask] [-o hex_operation_mask]\n", argv[0]);
- fprintf(stderr, "Example: %s -m /mnt/pvfs2 -a 0xFFFF -o 0xFFFF\n",
+ "[-e events]\n", argv[0]);
+ fprintf(stderr, "Example: %s -m /mnt/pvfs2 -e bmi-send,dbpf-write\n",
argv[0]);
return;
}
Index: pvfs2-set-mode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-set-mode.c,v
diff -p -u -r1.13 -r1.13.38.1
--- pvfs2-set-mode.c 29 May 2006 16:16:36 -0000 1.13
+++ pvfs2-set-mode.c 7 Apr 2008 16:30:46 -0000 1.13.38.1
@@ -41,6 +41,7 @@ int main(int argc, char **argv)
struct options* user_opts = NULL;
char pvfs_path[PVFS_NAME_MAX] = {0};
PVFS_credentials creds;
+ struct PVFS_mgmt_setparam_value param_value;
/* look at command line arguments */
user_opts = parse_args(argc, argv);
@@ -70,10 +71,13 @@ int main(int argc, char **argv)
PVFS_util_gen_credentials(&creds);
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = user_opts->mode;
+
ret = PVFS_mgmt_setparam_all(cur_fs,
&creds,
PVFS_SERV_PARAM_MODE,
- user_opts->mode,
+ ¶m_value,
NULL,
NULL /* detailed errors */);
Index: pvfs2-set-sync.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-set-sync.c,v
diff -p -u -r1.4 -r1.4.10.1
--- pvfs2-set-sync.c 18 Oct 2007 18:37:10 -0000 1.4
+++ pvfs2-set-sync.c 7 Apr 2008 16:30:46 -0000 1.4.10.1
@@ -46,6 +46,7 @@ int main(int argc, char **argv)
struct options* user_opts = NULL;
char pvfs_path[PVFS_NAME_MAX] = {0};
PVFS_credentials creds;
+ struct PVFS_mgmt_setparam_value param_value;
/* look at command line arguments */
user_opts = parse_args(argc, argv);
@@ -75,10 +76,12 @@ int main(int argc, char **argv)
PVFS_util_gen_credentials(&creds);
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = user_opts->meta_sync;
ret = PVFS_mgmt_setparam_all(cur_fs,
&creds,
PVFS_SERV_PARAM_SYNC_META,
- user_opts->meta_sync,
+ ¶m_value,
NULL,
NULL /* detailed errors */);
if(ret < 0)
@@ -87,10 +90,13 @@ int main(int argc, char **argv)
return(-1);
}
+ param_value.type = PVFS_MGMT_PARAM_TYPE_UINT64;
+ param_value.u.value = user_opts->data_sync;
+
ret = PVFS_mgmt_setparam_all(cur_fs,
&creds,
PVFS_SERV_PARAM_SYNC_DATA,
- user_opts->data_sync,
+ ¶m_value,
NULL,
NULL /* detailed errors */);
if(ret < 0)
Index: pvfs2-showcoll.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-showcoll.c,v
diff -p -u -r1.24 -r1.24.20.1
--- pvfs2-showcoll.c 18 Oct 2006 16:01:10 -0000 1.24
+++ pvfs2-showcoll.c 7 Apr 2008 16:30:46 -0000 1.24.20.1
@@ -295,7 +295,7 @@ static int print_dspace(TROVE_coll_id co
0 /* flags */,
NULL /* user ptr */,
trove_context,
- &op_id);
+ &op_id, NULL);
while (ret == 0) {
ret = trove_dspace_test(
coll_id, op_id, trove_context, &opcount, NULL, NULL, &state,
@@ -374,7 +374,7 @@ static int print_dspace_keyvals(TROVE_co
NULL /* vtag */,
NULL /* user ptr */,
trove_context,
- &op_id);
+ &op_id, NULL);
while (ret == 0) ret = trove_dspace_test(
coll_id, op_id, trove_context, &opcount, NULL, NULL, &state,
Index: pvfs2-stat.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-stat.c,v
diff -p -u -r1.9 -r1.9.20.1
--- pvfs2-stat.c 26 Sep 2006 03:44:15 -0000 1.9
+++ pvfs2-stat.c 7 Apr 2008 16:30:46 -0000 1.9.20.1
@@ -200,7 +200,7 @@ static int do_stat(const char
(char *) pszRelativeFile,
(PVFS_credentials *) credentials,
&lk_response,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
}
else
{
@@ -208,7 +208,7 @@ static int do_stat(const char
(char *) pszRelativeFile,
(PVFS_credentials *) credentials,
&lk_response,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
}
if(ret < 0)
@@ -227,7 +227,7 @@ static int do_stat(const char
ret = PVFS_sys_getattr(ref,
PVFS_ATTR_SYS_ALL_NOHINT,
(PVFS_credentials *) credentials,
- &getattr_response);
+ &getattr_response, NULL);
if(ret < 0)
{
Index: pvfs2-statfs.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-statfs.c,v
diff -p -u -r1.31 -r1.31.38.1
--- pvfs2-statfs.c 29 May 2006 16:16:36 -0000 1.31
+++ pvfs2-statfs.c 7 Apr 2008 16:30:46 -0000 1.31.38.1
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
PVFS_util_gen_credentials(&creds);
/* gather normal statfs statistics from system interface */
- ret = PVFS_sys_statfs(cur_fs, &creds, &resp_statfs);
+ ret = PVFS_sys_statfs(cur_fs, &creds, &resp_statfs, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_statfs", ret);
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
outcount = resp_statfs.server_count;
ret = PVFS_mgmt_statfs_all(cur_fs, &creds, stat_array,
- &outcount, NULL);
+ &outcount, NULL, NULL);
for(j = 0; j<2; j++)
{
Index: pvfs2-touch.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-touch.c,v
diff -p -u -r1.5 -r1.5.2.1
--- pvfs2-touch.c 4 Apr 2008 16:43:37 -0000 1.5
+++ pvfs2-touch.c 7 Apr 2008 16:30:46 -0000 1.5.2.1
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));
rc = PVFS_sys_lookup(cur_fs, pvfs_path, &credentials,
- &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ &resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (rc)
{
PVFS_perror("PVFS_sys_lookup", rc);
@@ -122,8 +122,7 @@ int main(int argc, char **argv)
attr,
&credentials,
NULL,
- NULL,
- &resp_create);
+ &resp_create, NULL, NULL);
if (rc)
{
fprintf(stderr, "Error: An error occurred while creating %s\n",
Index: pvfs2-validate.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-validate.c,v
diff -p -u -r1.4 -r1.4.6.1
--- pvfs2-validate.c 10 Dec 2007 16:13:53 -0000 1.4
+++ pvfs2-validate.c 7 Apr 2008 16:30:46 -0000 1.4.6.1
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
cur_fs, pvfs_path,
&creds,
&lookup_resp,
- PVFS2_LOOKUP_LINK_NO_FOLLOW);
+ PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);
if (ret != 0)
{
Index: pvfs2-viewdist.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-viewdist.c,v
diff -p -u -r1.16 -r1.16.10.1
--- pvfs2-viewdist.c 15 Aug 2007 16:39:21 -0000 1.16
+++ pvfs2-viewdist.c 7 Apr 2008 16:30:46 -0000 1.16.10.1
@@ -91,7 +91,7 @@ static int generic_dist(file_object *obj
{
char *buffer = (char *) malloc(4096);
int ret;
-
+
if (obj->fs_type == UNIX_FILE)
{
#ifndef HAVE_FGETXATTR_EXTRA_ARGS
@@ -113,8 +113,8 @@ static int generic_dist(file_object *obj
key.buffer_sz = strlen(DIST_KEY) + 1;
val.buffer = buffer;
val.buffer_sz = 4096;
- if ((ret = PVFS_sys_geteattr(obj->u.pvfs2.ref,
- creds, &key, &val)) < 0)
+ if ((ret = PVFS_sys_geteattr(obj->u.pvfs2.ref,
+ creds, &key, &val, NULL)) < 0)
{
PVFS_perror("PVFS_sys_geteattr", ret);
return -1;
@@ -137,7 +137,7 @@ static int generic_server_location(file_
char *buffer = (char *) malloc(4096);
int ret, num_dfiles, count;
PVFS_fs_id fsid;
-
+
if (obj->fs_type == UNIX_FILE)
{
#ifndef HAVE_FGETXATTR_EXTRA_ARGS
@@ -159,8 +159,8 @@ static int generic_server_location(file_
key.buffer_sz = strlen(DFILE_KEY) + 1;
val.buffer = buffer;
val.buffer_sz = 4096;
- if ((ret = PVFS_sys_geteattr(obj->u.pvfs2.ref,
- creds, &key, &val)) < 0)
+ if ((ret = PVFS_sys_geteattr(obj->u.pvfs2.ref,
+ creds, &key, &val, NULL)) < 0)
{
PVFS_perror("PVFS_sys_geteattr", ret);
return -1;
@@ -169,7 +169,7 @@ static int generic_server_location(file_
fsid = obj->u.pvfs2.fs_id;
}
/*
- * At this point, we know all the dfile handles
+ * At this point, we know all the dfile handles
*/
num_dfiles = (ret / sizeof(PVFS_handle));
count = num_dfiles < *nservers ? num_dfiles : *nservers;
@@ -212,6 +212,7 @@ int main(int argc, char ** argv)
PVFS_credentials credentials;
char *servers[256];
PVFS_handle handles[256];
+ char metadataserver[256];
int i, nservers = 256;
memset(&dist, 0, sizeof(dist));
@@ -258,10 +259,21 @@ int main(int argc, char ** argv)
printf("dist_name = %s\n", dist->dist_name);
printf("dist_params:\n%s\n", dist->methods->params_string(dist->params));
PINT_dist_free(dist);
+
+
+ ret = PINT_cached_config_get_server_name(metadataserver, 256,
+ src.u.pvfs2.ref.handle, src.u.pvfs2.ref.fs_id);
+ if( ret != 0)
+ {
+ fprintf(stderr, "Error, could not get metadataserver name\n");
+ return (-1);
+ }
+ printf("Metadataserver: %s\n", metadataserver);
+
printf("Number of datafiles/servers = %d\n", nservers);
for (i = 0; i < nservers; i++)
{
- printf("Server %d - %s, handle: %llu (%08llx.bstream)\n", i, servers[i],
+ printf("Datafile %d - %s, handle: %llu (%08llx.bstream)\n", i, servers[i],
llu(handles[i]), llu(handles[i]));
free(servers[i]);
}
@@ -380,18 +392,18 @@ static int generic_open(file_object *obj
perror("fstatfs:");
fprintf(stderr, "could not fstatfs %s\n", obj->u.ufs.path);
}
- memcpy(&obj->u.ufs.fs_id, &PINT_statfs_fsid(&statfsbuf),
+ 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,
+ ret = PVFS_sys_lookup(obj->u.pvfs2.fs_id,
(char *) obj->u.pvfs2.pvfs2_path,
- credentials,
+ credentials,
&resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -402,7 +414,7 @@ static int generic_open(file_object *obj
memset(&resp_getattr, 0, sizeof(PVFS_sysresp_getattr));
ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
- credentials, &resp_getattr);
+ credentials, &resp_getattr, NULL);
if (ret)
{
fprintf(stderr, "Failed to do pvfs2 getattr on %s\n",
Index: pvfs2-xattr.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-xattr.c,v
diff -p -u -r1.6 -r1.6.10.1
--- pvfs2-xattr.c 19 Aug 2007 18:20:26 -0000 1.6
+++ pvfs2-xattr.c 7 Apr 2008 16:30:46 -0000 1.6.10.1
@@ -248,10 +248,10 @@ static int pvfs2_eattr(int get, file_obj
{
if (get == 1)
{
- ret = PVFS_sys_geteattr(obj->u.pvfs2.ref, creds, key_p, val_p);
+ 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);
+ ret = PVFS_sys_seteattr(obj->u.pvfs2.ref, creds, key_p, val_p, 0, NULL);
}
if (ret < 0)
@@ -415,7 +415,7 @@ static int generic_open(file_object *obj
(char *) obj->u.pvfs2.pvfs2_path,
credentials,
&resp_lookup,
- PVFS2_LOOKUP_LINK_FOLLOW);
+ PVFS2_LOOKUP_LINK_FOLLOW, NULL);
if (ret < 0)
{
PVFS_perror("PVFS_sys_lookup", ret);
@@ -426,7 +426,7 @@ static int generic_open(file_object *obj
memset(&resp_getattr, 0, sizeof(PVFS_sysresp_getattr));
ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
- credentials, &resp_getattr);
+ credentials, &resp_getattr, NULL);
if (ret)
{
fprintf(stderr, "Failed to do pvfs2 getattr on %s\n",
More information about the Pvfs2-cvs
mailing list