[Pvfs2-cvs] commit by kunkel in pvfs2/src/apps/admin: pvfs2-ls.c
pvfs2-genconfig pvfs2-fsck.c pvfs2-xattr.c
CVS commit program
cvs at parl.clemson.edu
Sat Feb 17 05:39:20 EST 2007
Update of /projects/cvsroot/pvfs2/src/apps/admin
In directory parlweb1:/tmp/cvs-serv589/src/apps/admin
Modified Files:
Tag: kunkel-hint-branch
pvfs2-ls.c pvfs2-genconfig pvfs2-fsck.c pvfs2-xattr.c
Log Message:
Sync hint-branch to current CVS version
Index: pvfs2-ls.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-ls.c,v
diff -p -u -r1.65.6.4 -r1.65.6.5
--- pvfs2-ls.c 2 Dec 2006 11:22:21 -0000 1.65.6.4
+++ pvfs2-ls.c 17 Feb 2007 10:39:19 -0000 1.65.6.5
@@ -132,7 +132,7 @@ static inline void format_size_string(
spaces_size_allowed = num_spaces_total;
}
}
-
+
buf = (char *)malloc(spaces_size_allowed+1);
assert(buf);
@@ -424,8 +424,9 @@ int do_list(
pvfs_dirent_incount = MAX_NUM_DIRENTS;
memset(&getattr_response,0,sizeof(PVFS_sysresp_getattr));
- if (PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
- &credentials, &getattr_response, NULL) == 0)
+ ret = PVFS_sys_getattr(ref, PVFS_ATTR_SYS_ALL_NOHINT,
+ &credentials, &getattr_response, NULL);
+ if(ret == 0)
{
if ((getattr_response.attr.objtype == PVFS_TYPE_METAFILE) ||
(getattr_response.attr.objtype == PVFS_TYPE_SYMLINK) ||
@@ -462,6 +463,11 @@ int do_list(
return 0;
}
}
+ else
+ {
+ PVFS_perror("PVFS_sys_getattr", ret);
+ return -1;
+ }
if (do_timing)
begin = Wtime();
@@ -695,7 +701,7 @@ static struct options* parse_args(int ar
static void usage(int argc, char** argv)
{
- fprintf(stderr, "Usage: %s [OPTION]... [FILE]...\n", argv[0]);
+ fprintf(stderr, "Usage: %s [OPTION]... [FILE]...\n", argv[0]);
fprintf(stderr, "List information about the FILEs (the current "
"directory by default)\n\n");
fprintf(stderr," -a, --all "
Index: pvfs2-genconfig
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-genconfig,v
diff -p -u -r1.61.6.3 -r1.61.6.4
--- pvfs2-genconfig 13 Jan 2007 10:16:40 -0000 1.61.6.3
+++ pvfs2-genconfig 17 Feb 2007 10:39:19 -0000 1.61.6.4
@@ -15,8 +15,11 @@ use strict 'vars';
# ugly global variables for option parsing
my $opt_protocol = '';
my $opt_port = '';
+my $opt_board = '';
my $opt_tcpport = '';
my $opt_gmport = '';
+my $opt_mxboard = '';
+my $opt_mxendpoint = '';
my $opt_ibport = '';
my $opt_ioservers = '';
my $opt_metaservers = '';
@@ -379,7 +382,7 @@ sub specusage
from the rest of the spec. While the protocols and ports are different, the
host for each uri must be the same. For example:
- --metaspec="[ib://myhosta:3335,gm://myhosta:6]:/psto,tcp://myhostb:3334"
+ --metaspec="[ib://myhosta:3335,gm://myhosta:6,mx://myhosta:0:3]:/psto,tcp://myhostb:3334"
This specifies that one endpoint is at myhosta with the infiniband and myrinet
protocols enabled, and the other endpoint is at myhostb with tcp enabled.
@@ -429,9 +432,11 @@ Usage: pvfs2-genconfig [OPTIONS] <fs.con
One of the two [] grouped options below must be chosen (for non-interactive):
[
- --protocol <PROTO>[,<PROTO>..] protocol(s) to use (tcp,gm,ib)
+ --protocol <PROTO>[,<PROTO>..] protocol(s) to use (tcp,gm,mx,ib)
--port <NUM> port to use (any single protocol)
- --ioservers <STRING> hostnames of data servers. Can be
+ --board <NUM> board index number for MX
+ (only required if --protocol=mx)
+ --ioservers <STRING> hostnames of data servers. Can be
<prefix>{#-#,#,#-#,...}
--metaservers <STRING> hostnames of meta servers.
]
@@ -446,6 +451,8 @@ Usage: pvfs2-genconfig [OPTIONS] <fs.con
--tcpport <NUM> TCP port to use
--gmport <NUM> GM port to use
+ --mxboard <NUM> MX board to use (default is 0)
+ --mxendpoint <NUM> MX endpoint to use (default is 3)
--ibport <NUM> IB port to use
--logging <STRING> debugging mask for log messages
--logstamp <STRING> timestamp type for log messages
@@ -531,7 +538,7 @@ sub get_protocol
# get network type
print $OUT <<"PROTOCOL"
You must first select the network protocol that your file system will use.
-The only currently supported options are \"tcp\", \"gm\", and \"ib\".
+The only currently supported options are \"tcp\", \"gm\", \"mx\", and \"ib\".
(For multi-homed configurations, use e.g. \"ib,tcp\".)
PROTOCOL
;;
@@ -565,10 +572,12 @@ PROTOCOL
}
} elsif ($_ eq "gm") {
$port{'gm'} = gm_get_port();
+ } elsif ($_ eq "mx") {
+ $port{'mx'} = mx_get_endpoint();
} elsif ($_ eq "ib") {
$port{'ib'} = ib_get_port();
} else {
- die "Sorry. At this time, only the tcp, gm and ib protocols are available\nfor use with this configuration utility.\n";
+ die "Sorry. At this time, only the tcp, gm, mx and ib protocols are available\nfor use with this configuration utility.\n";
}
}
@@ -744,6 +753,46 @@ sub gm_get_port
return $port;
}
+sub mx_get_endpoint
+{
+ my $port;
+ my $board = '0';
+
+ if ($opt_mxboard) {
+ $board = $opt_mxboard;
+ } elsif ($opt_board) {
+ $board = $opt_board;
+ } elsif (!$opt_iospec) {
+ if (!$opt_quiet) {
+ print $OUT "Choose a MX board (in the range of 0 to 4) for the servers to listen on. \n";
+ print $OUT "This script assumes that all servers will use the same board number.\n";
+ }
+ $board = prompt_num("Enter board number [Default is 0]: ","0");
+ }
+ # The number of boards is only limited by the number of PCI-X or PCI-Express
+ # slots in the machine. This is reasonable maximum.
+ ($board < 8) or die "MX board must be in the range 0 to 7";
+
+ if ($opt_mxendpoint) {
+ $port = $opt_mxendpoint;
+ } elsif ($opt_port) {
+ $port = $opt_port;
+ $opt_port = '';
+ } elsif (!$opt_iospec) {
+ if (!$opt_quiet) {
+ print $OUT "Choose a MX endpoint (in the range of 0 to 7) for the servers to listen on. \n";
+ print $OUT "This script assumes that all servers will use the same port number.\n";
+ }
+ $port = prompt_num("Enter port number [Default is 3]: ","3");
+ }
+ # The number of endpoints in MX is configurable. The default value is 4
+ # but may be changing to 8. It can be higher, but this is reasonable.
+ ($port < 8) or die "MX endpoint must be in the range 0 to 7";
+
+ $port = $board . ":" . $port;
+ return $port;
+}
+
sub ib_get_port
{
my $port;
@@ -1091,8 +1140,11 @@ my $show_specusage = '';
$opt_quiet = 0;
GetOptions('protocol=s' => \$opt_protocol,
'port=i' => \$opt_port,
+ 'board=i' => \$opt_board,
'tcpport=i' => \$opt_tcpport,
'gmport=i' => \$opt_gmport,
+ 'mxboard=i' => \$opt_mxboard,
+ 'mxendpoint=i' => \$opt_mxendpoint,
'ibport=i' => \$opt_ibport,
'ioservers=s' => \$opt_ioservers,
'metaservers=s' => \$opt_metaservers,
@@ -1169,6 +1221,8 @@ else
die "-port not allowed with -iospec or -metaspec."
if($opt_port ne '' && defined($opt_iospec) && defined($opt_metaspec));
+die "-board not allowed with -iospec or -metaspec."
+if($opt_board ne '' && defined($opt_iospec) && defined($opt_metaspec));
die "-iospec requires -metaspec."
if(defined($opt_iospec) && !defined($opt_metaspec));
die "-metaspec requires -iospec."
Index: pvfs2-fsck.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-fsck.c,v
diff -p -u -r1.17.2.3 -r1.17.2.4
--- pvfs2-fsck.c 2 Dec 2006 11:22:20 -0000 1.17.2.3
+++ pvfs2-fsck.c 17 Feb 2007 10:39:19 -0000 1.17.2.4
@@ -436,7 +436,7 @@ int traverse_directory_tree(PVFS_fs_id c
int server_count,
PVFS_credentials *creds)
{
- int ret, server_idx;
+ int ret, server_idx = 0;
PVFS_sysresp_lookup lookup_resp;
PVFS_sysresp_getattr getattr_resp;
PVFS_object_ref pref;
@@ -521,7 +521,7 @@ int descend(PVFS_fs_id cur_fs,
PVFS_ds_position token;
PVFS_sysresp_readdir readdir_resp;
PVFS_sysresp_getattr getattr_resp;
- PVFS_object_ref entry_ref;
+ PVFS_object_ref entry_ref = {0, 0};
count = 64;
@@ -536,7 +536,7 @@ int descend(PVFS_fs_id cur_fs,
for (i = 0; i < readdir_resp.pvfs_dirent_outcount; i++)
{
- int server_idx, ret, in_main_list = 0, in_alt_list = 0;
+ int server_idx = 0, ret, in_main_list = 0, in_alt_list = 0;
char *cur_file;
PVFS_handle cur_handle;
@@ -700,7 +700,7 @@ int verify_datafiles(PVFS_fs_id cur_fs,
int df_count,
PVFS_credentials *creds)
{
- int ret, i, server_idx, error = 0;
+ int ret, i, server_idx = 0, error = 0;
PVFS_handle *df_handles;
df_handles = (PVFS_handle *) malloc(df_count * sizeof(PVFS_handle));
Index: pvfs2-xattr.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-xattr.c,v
diff -p -u -r1.2.10.1 -r1.2.10.2
--- pvfs2-xattr.c 2 Dec 2006 11:22:21 -0000 1.2.10.1
+++ pvfs2-xattr.c 17 Feb 2007 10:39:19 -0000 1.2.10.2
@@ -416,7 +416,8 @@ static int generic_open(file_object *obj
return -1;
}
- if (resp_getattr.attr.objtype != PVFS_TYPE_METAFILE)
+ if (resp_getattr.attr.objtype != PVFS_TYPE_METAFILE &&
+ resp_getattr.attr.objtype != PVFS_TYPE_DIRECTORY)
{
fprintf(stderr, "Not a meta file!\n");
return -1;
More information about the Pvfs2-cvs
mailing list