Changeset 8317

Show
Ignore:
Timestamp:
04/30/10 16:00:57 (3 years ago)
Author:
bligon
Message:

merge of B2O-Blue-Sync,HEAD,and latest of Orange.

Location:
branches/Orange-Branch
Files:
83 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/Makefile.in

    r7763 r8317  
    7979BUILD_OPENIB = @BUILD_OPENIB@ 
    8080BUILD_PORTALS = @BUILD_PORTALS@ 
     81BUILD_ZOID = @BUILD_ZOID@ 
    8182BUILD_VIS = @BUILD_VIS@ 
    8283BUILD_KARMA = @BUILD_KARMA@ 
     
    400401endif 
    401402 
     403ifdef BUILD_ZOID 
     404    CFLAGS += -D__STATIC_METHOD_BMI_ZOID__ 
     405endif 
     406 
    402407# enable mmap-readahead cache (unless disabled by configure) 
    403408ifdef MMAP_RA_CACHE 
  • branches/Orange-Branch/configure

    r7987 r8317  
    643643GOSSIP_ENABLE_BACKTRACE 
    644644SERVER_LDFLAGS 
     645ZOID_SRCDIR 
     646BUILD_ZOID 
    645647PORTALS_LIBS 
    646648PORTALS_INCS 
     
    819821with_portals_includes 
    820822with_portals_libs 
     823with_zoid 
    821824enable_static_server 
    822825' 
     
    15271530  --with-portals-libs=<dir> 
    15281531                          Extra LIBS to link Portals libraries 
     1532  --with-zoid=<dir>         Location of the ZOID tree (default no ZOID) 
    15291533 
    15301534Some influential environment variables: 
     
    36873691 
    36883692 
     3693if test "${ac_cv_header_pwd_h+set}" = set; then 
     3694  { $as_echo "$as_me:$LINENO: checking for pwd.h" >&5 
     3695$as_echo_n "checking for pwd.h... " >&6; } 
     3696if test "${ac_cv_header_pwd_h+set}" = set; then 
     3697  $as_echo_n "(cached) " >&6 
     3698fi 
     3699{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pwd_h" >&5 
     3700$as_echo "$ac_cv_header_pwd_h" >&6; } 
     3701else 
     3702  # Is the header compilable? 
     3703{ $as_echo "$as_me:$LINENO: checking pwd.h usability" >&5 
     3704$as_echo_n "checking pwd.h usability... " >&6; } 
     3705cat >conftest.$ac_ext <<_ACEOF 
     3706/* confdefs.h.  */ 
     3707_ACEOF 
     3708cat confdefs.h >>conftest.$ac_ext 
     3709cat >>conftest.$ac_ext <<_ACEOF 
     3710/* end confdefs.h.  */ 
     3711$ac_includes_default 
     3712#include <pwd.h> 
     3713_ACEOF 
     3714rm -f conftest.$ac_objext 
     3715if { (ac_try="$ac_compile" 
     3716case "(($ac_try" in 
     3717  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     3718  *) ac_try_echo=$ac_try;; 
     3719esac 
     3720eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     3721$as_echo "$ac_try_echo") >&5 
     3722  (eval "$ac_compile") 2>conftest.er1 
     3723  ac_status=$? 
     3724  grep -v '^ *+' conftest.er1 >conftest.err 
     3725  rm -f conftest.er1 
     3726  cat conftest.err >&5 
     3727  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3728  (exit $ac_status); } && { 
     3729         test -z "$ac_c_werror_flag" || 
     3730         test ! -s conftest.err 
     3731       } && test -s conftest.$ac_objext; then 
     3732  ac_header_compiler=yes 
     3733else 
     3734  $as_echo "$as_me: failed program was:" >&5 
     3735sed 's/^/| /' conftest.$ac_ext >&5 
     3736 
     3737        ac_header_compiler=no 
     3738fi 
     3739 
     3740rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     3741{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     3742$as_echo "$ac_header_compiler" >&6; } 
     3743 
     3744# Is the header present? 
     3745{ $as_echo "$as_me:$LINENO: checking pwd.h presence" >&5 
     3746$as_echo_n "checking pwd.h presence... " >&6; } 
     3747cat >conftest.$ac_ext <<_ACEOF 
     3748/* confdefs.h.  */ 
     3749_ACEOF 
     3750cat confdefs.h >>conftest.$ac_ext 
     3751cat >>conftest.$ac_ext <<_ACEOF 
     3752/* end confdefs.h.  */ 
     3753#include <pwd.h> 
     3754_ACEOF 
     3755if { (ac_try="$ac_cpp conftest.$ac_ext" 
     3756case "(($ac_try" in 
     3757  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     3758  *) ac_try_echo=$ac_try;; 
     3759esac 
     3760eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     3761$as_echo "$ac_try_echo") >&5 
     3762  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 
     3763  ac_status=$? 
     3764  grep -v '^ *+' conftest.er1 >conftest.err 
     3765  rm -f conftest.er1 
     3766  cat conftest.err >&5 
     3767  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3768  (exit $ac_status); } >/dev/null && { 
     3769         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 
     3770         test ! -s conftest.err 
     3771       }; then 
     3772  ac_header_preproc=yes 
     3773else 
     3774  $as_echo "$as_me: failed program was:" >&5 
     3775sed 's/^/| /' conftest.$ac_ext >&5 
     3776 
     3777  ac_header_preproc=no 
     3778fi 
     3779 
     3780rm -f conftest.err conftest.$ac_ext 
     3781{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     3782$as_echo "$ac_header_preproc" >&6; } 
     3783 
     3784# So?  What about this header? 
     3785case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     3786  yes:no: ) 
     3787    { $as_echo "$as_me:$LINENO: WARNING: pwd.h: accepted by the compiler, rejected by the preprocessor!" >&5 
     3788$as_echo "$as_me: WARNING: pwd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     3789    { $as_echo "$as_me:$LINENO: WARNING: pwd.h: proceeding with the compiler's result" >&5 
     3790$as_echo "$as_me: WARNING: pwd.h: proceeding with the compiler's result" >&2;} 
     3791    ac_header_preproc=yes 
     3792    ;; 
     3793  no:yes:* ) 
     3794    { $as_echo "$as_me:$LINENO: WARNING: pwd.h: present but cannot be compiled" >&5 
     3795$as_echo "$as_me: WARNING: pwd.h: present but cannot be compiled" >&2;} 
     3796    { $as_echo "$as_me:$LINENO: WARNING: pwd.h:     check for missing prerequisite headers?" >&5 
     3797$as_echo "$as_me: WARNING: pwd.h:     check for missing prerequisite headers?" >&2;} 
     3798    { $as_echo "$as_me:$LINENO: WARNING: pwd.h: see the Autoconf documentation" >&5 
     3799$as_echo "$as_me: WARNING: pwd.h: see the Autoconf documentation" >&2;} 
     3800    { $as_echo "$as_me:$LINENO: WARNING: pwd.h:     section \"Present But Cannot Be Compiled\"" >&5 
     3801$as_echo "$as_me: WARNING: pwd.h:     section \"Present But Cannot Be Compiled\"" >&2;} 
     3802    { $as_echo "$as_me:$LINENO: WARNING: pwd.h: proceeding with the preprocessor's result" >&5 
     3803$as_echo "$as_me: WARNING: pwd.h: proceeding with the preprocessor's result" >&2;} 
     3804    { $as_echo "$as_me:$LINENO: WARNING: pwd.h: in the future, the compiler will take precedence" >&5 
     3805$as_echo "$as_me: WARNING: pwd.h: in the future, the compiler will take precedence" >&2;} 
     3806 
     3807    ;; 
     3808esac 
     3809{ $as_echo "$as_me:$LINENO: checking for pwd.h" >&5 
     3810$as_echo_n "checking for pwd.h... " >&6; } 
     3811if test "${ac_cv_header_pwd_h+set}" = set; then 
     3812  $as_echo_n "(cached) " >&6 
     3813else 
     3814  ac_cv_header_pwd_h=$ac_header_preproc 
     3815fi 
     3816{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pwd_h" >&5 
     3817$as_echo "$ac_cv_header_pwd_h" >&6; } 
     3818 
     3819fi 
     3820if test "x$ac_cv_header_pwd_h" = x""yes; then 
     3821 
     3822cat >>confdefs.h <<\_ACEOF 
     3823#define HAVE_GETPWUID 1 
     3824_ACEOF 
     3825 
     3826fi 
     3827 
     3828 
    36893829if test "${ac_cv_header_sys_vfs_h+set}" = set; then 
    36903830  { $as_echo "$as_me:$LINENO: checking for sys/vfs.h" >&5 
     
    1018210322        fi 
    1018310323 
    10184                 { $as_echo "$as_me:$LINENO: checking for 6th argument to sysctl proc handlers" >&5 
    10185 $as_echo_n "checking for 6th argument to sysctl proc handlers... " >&6; } 
    10186                 cat >conftest.$ac_ext <<_ACEOF 
     10324 
     10325                { $as_echo "$as_me:$LINENO: checking for file argument to sysctl proc handlers" >&5 
     10326$as_echo_n "checking for file argument to sysctl proc handlers... " >&6; } 
     10327        cat >conftest.$ac_ext <<_ACEOF 
    1018710328/* confdefs.h.  */ 
    1018810329_ACEOF 
     
    1019910340{ 
    1020010341 
    10201             proc_dointvec_minmax(NULL, 0, NULL, NULL, NULL, NULL); 
     10342                struct ctl_table * ctl = NULL; 
     10343                int write = 0; 
     10344                struct file * filp = NULL; 
     10345                void __user * buffer = NULL; 
     10346                size_t * lenp = NULL; 
     10347                loff_t * ppos = NULL; 
     10348 
     10349                proc_dointvec_minmax(ctl, write, filp, buffer, lenp, ppos); 
    1020210350 
    1020310351  ; 
     
    1022710375 
    1022810376cat >>confdefs.h <<\_ACEOF 
    10229 #define HAVE_PROC_HANDLER_SIX_ARG 1 
     10377#define HAVE_PROC_HANDLER_FILE_ARG 1 
     10378_ACEOF 
     10379 
     10380else 
     10381  $as_echo "$as_me: failed program was:" >&5 
     10382sed 's/^/| /' conftest.$ac_ext >&5 
     10383 
     10384        { $as_echo "$as_me:$LINENO: result: no" >&5 
     10385$as_echo "no" >&6; } 
     10386 
     10387fi 
     10388 
     10389rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     10390 
     10391        { $as_echo "$as_me:$LINENO: checking for ppos argument to sysctl proc handlers" >&5 
     10392$as_echo_n "checking for ppos argument to sysctl proc handlers... " >&6; } 
     10393                cat >conftest.$ac_ext <<_ACEOF 
     10394/* confdefs.h.  */ 
     10395_ACEOF 
     10396cat confdefs.h >>conftest.$ac_ext 
     10397cat >>conftest.$ac_ext <<_ACEOF 
     10398/* end confdefs.h.  */ 
     10399 
     10400            #define __KERNEL__ 
     10401            #include <linux/fs.h> 
     10402            #include <linux/sysctl.h> 
     10403 
     10404int 
     10405main () 
     10406{ 
     10407 
     10408                struct ctl_table * ctl = NULL; 
     10409                int write = 0; 
     10410                void __user * buffer = NULL; 
     10411                size_t * lenp = NULL; 
     10412                loff_t * ppos = NULL; 
     10413 
     10414                proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); 
     10415 
     10416  ; 
     10417  return 0; 
     10418} 
     10419_ACEOF 
     10420rm -f conftest.$ac_objext 
     10421if { (ac_try="$ac_compile" 
     10422case "(($ac_try" in 
     10423  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     10424  *) ac_try_echo=$ac_try;; 
     10425esac 
     10426eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     10427$as_echo "$ac_try_echo") >&5 
     10428  (eval "$ac_compile") 2>conftest.er1 
     10429  ac_status=$? 
     10430  grep -v '^ *+' conftest.er1 >conftest.err 
     10431  rm -f conftest.er1 
     10432  cat conftest.err >&5 
     10433  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     10434  (exit $ac_status); } && { 
     10435         test -z "$ac_c_werror_flag" || 
     10436         test ! -s conftest.err 
     10437       } && test -s conftest.$ac_objext; then 
     10438  { $as_echo "$as_me:$LINENO: result: yes" >&5 
     10439$as_echo "yes" >&6; } 
     10440 
     10441cat >>confdefs.h <<\_ACEOF 
     10442#define HAVE_PROC_HANDLER_PPOS_ARG 1 
    1023010443_ACEOF 
    1023110444 
     
    1292713140rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
    1292813141 
     13142        { $as_echo "$as_me:$LINENO: checking for s_dirty in struct super_block" >&5 
     13143$as_echo_n "checking for s_dirty in struct super_block... " >&6; } 
     13144        cat >conftest.$ac_ext <<_ACEOF 
     13145/* confdefs.h.  */ 
     13146_ACEOF 
     13147cat confdefs.h >>conftest.$ac_ext 
     13148cat >>conftest.$ac_ext <<_ACEOF 
     13149/* end confdefs.h.  */ 
     13150 
     13151                #define __KERNEL__ 
     13152                #include <linux/fs.h> 
     13153 
     13154int 
     13155main () 
     13156{ 
     13157 
     13158                struct super_block *s; 
     13159                list_empty(&s->s_dirty); 
     13160 
     13161  ; 
     13162  return 0; 
     13163} 
     13164_ACEOF 
     13165rm -f conftest.$ac_objext 
     13166if { (ac_try="$ac_compile" 
     13167case "(($ac_try" in 
     13168  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     13169  *) ac_try_echo=$ac_try;; 
     13170esac 
     13171eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     13172$as_echo "$ac_try_echo") >&5 
     13173  (eval "$ac_compile") 2>conftest.er1 
     13174  ac_status=$? 
     13175  grep -v '^ *+' conftest.er1 >conftest.err 
     13176  rm -f conftest.er1 
     13177  cat conftest.err >&5 
     13178  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     13179  (exit $ac_status); } && { 
     13180         test -z "$ac_c_werror_flag" || 
     13181         test ! -s conftest.err 
     13182       } && test -s conftest.$ac_objext; then 
     13183  { $as_echo "$as_me:$LINENO: result: yes" >&5 
     13184$as_echo "yes" >&6; } 
     13185 
     13186cat >>confdefs.h <<\_ACEOF 
     13187#define HAVE_SB_DIRTY_LIST 1 
     13188_ACEOF 
     13189 
     13190else 
     13191  $as_echo "$as_me: failed program was:" >&5 
     13192sed 's/^/| /' conftest.$ac_ext >&5 
     13193 
     13194        { $as_echo "$as_me:$LINENO: result: no" >&5 
     13195$as_echo "no" >&6; } 
     13196 
     13197fi 
     13198 
     13199rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     13200 
    1292913201                        tmp_cflags=$CFLAGS 
    1293013202        CFLAGS="$CFLAGS -Werror" 
     
    1297513247cat >>confdefs.h <<\_ACEOF 
    1297613248#define HAVE_CURRENT_FSUID 1 
     13249_ACEOF 
     13250 
     13251else 
     13252  $as_echo "$as_me: failed program was:" >&5 
     13253sed 's/^/| /' conftest.$ac_ext >&5 
     13254 
     13255        { $as_echo "$as_me:$LINENO: result: no" >&5 
     13256$as_echo "no" >&6; } 
     13257 
     13258fi 
     13259 
     13260rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     13261        CFLAGS=$tmp_cflags 
     13262 
     13263                { $as_echo "$as_me:$LINENO: checking if kernel backing_dev_info struct has a name field" >&5 
     13264$as_echo_n "checking if kernel backing_dev_info struct has a name field... " >&6; } 
     13265        cat >conftest.$ac_ext <<_ACEOF 
     13266/* confdefs.h.  */ 
     13267_ACEOF 
     13268cat confdefs.h >>conftest.$ac_ext 
     13269cat >>conftest.$ac_ext <<_ACEOF 
     13270/* end confdefs.h.  */ 
     13271 
     13272                #define __KERNEL__ 
     13273                #include <linux/fs.h> 
     13274                #include <linux/backing-dev.h> 
     13275 
     13276int 
     13277main () 
     13278{ 
     13279 
     13280                struct backing_dev_info foo = 
     13281                { 
     13282                    .name = "foo" 
     13283                }; 
     13284 
     13285  ; 
     13286  return 0; 
     13287} 
     13288_ACEOF 
     13289rm -f conftest.$ac_objext 
     13290if { (ac_try="$ac_compile" 
     13291case "(($ac_try" in 
     13292  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     13293  *) ac_try_echo=$ac_try;; 
     13294esac 
     13295eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     13296$as_echo "$ac_try_echo") >&5 
     13297  (eval "$ac_compile") 2>conftest.er1 
     13298  ac_status=$? 
     13299  grep -v '^ *+' conftest.er1 >conftest.err 
     13300  rm -f conftest.er1 
     13301  cat conftest.err >&5 
     13302  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     13303  (exit $ac_status); } && { 
     13304         test -z "$ac_c_werror_flag" || 
     13305         test ! -s conftest.err 
     13306       } && test -s conftest.$ac_objext; then 
     13307  { $as_echo "$as_me:$LINENO: result: yes" >&5 
     13308$as_echo "yes" >&6; } 
     13309 
     13310cat >>confdefs.h <<\_ACEOF 
     13311#define HAVE_BACKING_DEV_INFO_NAME 1 
     13312_ACEOF 
     13313 
     13314else 
     13315  $as_echo "$as_me: failed program was:" >&5 
     13316sed 's/^/| /' conftest.$ac_ext >&5 
     13317 
     13318        { $as_echo "$as_me:$LINENO: result: no" >&5 
     13319$as_echo "no" >&6; } 
     13320 
     13321fi 
     13322 
     13323rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     13324 
     13325                tmp_cflags=$CFLAGS 
     13326        CFLAGS="$CFLAGS -Werror" 
     13327        { $as_echo "$as_me:$LINENO: checking for bdi_init" >&5 
     13328$as_echo_n "checking for bdi_init... " >&6; } 
     13329        cat >conftest.$ac_ext <<_ACEOF 
     13330/* confdefs.h.  */ 
     13331_ACEOF 
     13332cat confdefs.h >>conftest.$ac_ext 
     13333cat >>conftest.$ac_ext <<_ACEOF 
     13334/* end confdefs.h.  */ 
     13335 
     13336                #define __KERNEL__ 
     13337                #include <linux/fs.h> 
     13338                #include <linux/backing-dev.h> 
     13339 
     13340int 
     13341main () 
     13342{ 
     13343 
     13344                int ret = bdi_init(NULL); 
     13345 
     13346  ; 
     13347  return 0; 
     13348} 
     13349_ACEOF 
     13350rm -f conftest.$ac_objext 
     13351if { (ac_try="$ac_compile" 
     13352case "(($ac_try" in 
     13353  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     13354  *) ac_try_echo=$ac_try;; 
     13355esac 
     13356eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     13357$as_echo "$ac_try_echo") >&5 
     13358  (eval "$ac_compile") 2>conftest.er1 
     13359  ac_status=$? 
     13360  grep -v '^ *+' conftest.er1 >conftest.err 
     13361  rm -f conftest.er1 
     13362  cat conftest.err >&5 
     13363  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     13364  (exit $ac_status); } && { 
     13365         test -z "$ac_c_werror_flag" || 
     13366         test ! -s conftest.err 
     13367       } && test -s conftest.$ac_objext; then 
     13368  { $as_echo "$as_me:$LINENO: result: yes" >&5 
     13369$as_echo "yes" >&6; } 
     13370 
     13371cat >>confdefs.h <<\_ACEOF 
     13372#define HAVE_BDI_INIT 1 
    1297713373_ACEOF 
    1297813374 
     
    1749017886 
    1749117887 
     17888 
     17889 
     17890# Check whether --with-zoid was given. 
     17891if test "${with_zoid+set}" = set; then 
     17892  withval=$with_zoid; if test -z "$withval" -o "$withval" = yes ; then 
     17893            { { $as_echo "$as_me:$LINENO: error: Option --with-zoid requires the path to your ZOID source tree." >&5 
     17894$as_echo "$as_me: error: Option --with-zoid requires the path to your ZOID source tree." >&2;} 
     17895   { (exit 1); exit 1; }; } 
     17896        elif test "$withval" != no ; then 
     17897            ZOID_SRCDIR="$withval" 
     17898        fi 
     17899 
     17900fi 
     17901 
     17902    if test -n "$ZOID_SRCDIR" ; then 
     17903        save_cppflags="$CPPFLAGS" 
     17904        CPPFLAGS="$CPPFLAGS -Isrc/io/bmi -I$ZOID_SRCDIR/include -I$ZOID_SRCDIR/zbmi -I$ZOID_SRCDIR/zbmi/implementation" 
     17905        if test "${ac_cv_header_zbmi_h+set}" = set; then 
     17906  { $as_echo "$as_me:$LINENO: checking for zbmi.h" >&5 
     17907$as_echo_n "checking for zbmi.h... " >&6; } 
     17908if test "${ac_cv_header_zbmi_h+set}" = set; then 
     17909  $as_echo_n "(cached) " >&6 
     17910fi 
     17911{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_h" >&5 
     17912$as_echo "$ac_cv_header_zbmi_h" >&6; } 
     17913else 
     17914  # Is the header compilable? 
     17915{ $as_echo "$as_me:$LINENO: checking zbmi.h usability" >&5 
     17916$as_echo_n "checking zbmi.h usability... " >&6; } 
     17917cat >conftest.$ac_ext <<_ACEOF 
     17918/* confdefs.h.  */ 
     17919_ACEOF 
     17920cat confdefs.h >>conftest.$ac_ext 
     17921cat >>conftest.$ac_ext <<_ACEOF 
     17922/* end confdefs.h.  */ 
     17923$ac_includes_default 
     17924#include <zbmi.h> 
     17925_ACEOF 
     17926rm -f conftest.$ac_objext 
     17927if { (ac_try="$ac_compile" 
     17928case "(($ac_try" in 
     17929  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     17930  *) ac_try_echo=$ac_try;; 
     17931esac 
     17932eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     17933$as_echo "$ac_try_echo") >&5 
     17934  (eval "$ac_compile") 2>conftest.er1 
     17935  ac_status=$? 
     17936  grep -v '^ *+' conftest.er1 >conftest.err 
     17937  rm -f conftest.er1 
     17938  cat conftest.err >&5 
     17939  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     17940  (exit $ac_status); } && { 
     17941         test -z "$ac_c_werror_flag" || 
     17942         test ! -s conftest.err 
     17943       } && test -s conftest.$ac_objext; then 
     17944  ac_header_compiler=yes 
     17945else 
     17946  $as_echo "$as_me: failed program was:" >&5 
     17947sed 's/^/| /' conftest.$ac_ext >&5 
     17948 
     17949        ac_header_compiler=no 
     17950fi 
     17951 
     17952rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     17953{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     17954$as_echo "$ac_header_compiler" >&6; } 
     17955 
     17956# Is the header present? 
     17957{ $as_echo "$as_me:$LINENO: checking zbmi.h presence" >&5 
     17958$as_echo_n "checking zbmi.h presence... " >&6; } 
     17959cat >conftest.$ac_ext <<_ACEOF 
     17960/* confdefs.h.  */ 
     17961_ACEOF 
     17962cat confdefs.h >>conftest.$ac_ext 
     17963cat >>conftest.$ac_ext <<_ACEOF 
     17964/* end confdefs.h.  */ 
     17965#include <zbmi.h> 
     17966_ACEOF 
     17967if { (ac_try="$ac_cpp conftest.$ac_ext" 
     17968case "(($ac_try" in 
     17969  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     17970  *) ac_try_echo=$ac_try;; 
     17971esac 
     17972eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     17973$as_echo "$ac_try_echo") >&5 
     17974  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 
     17975  ac_status=$? 
     17976  grep -v '^ *+' conftest.er1 >conftest.err 
     17977  rm -f conftest.er1 
     17978  cat conftest.err >&5 
     17979  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     17980  (exit $ac_status); } >/dev/null && { 
     17981         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 
     17982         test ! -s conftest.err 
     17983       }; then 
     17984  ac_header_preproc=yes 
     17985else 
     17986  $as_echo "$as_me: failed program was:" >&5 
     17987sed 's/^/| /' conftest.$ac_ext >&5 
     17988 
     17989  ac_header_preproc=no 
     17990fi 
     17991 
     17992rm -f conftest.err conftest.$ac_ext 
     17993{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     17994$as_echo "$ac_header_preproc" >&6; } 
     17995 
     17996# So?  What about this header? 
     17997case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     17998  yes:no: ) 
     17999    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h: accepted by the compiler, rejected by the preprocessor!" >&5 
     18000$as_echo "$as_me: WARNING: zbmi.h: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     18001    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h: proceeding with the compiler's result" >&5 
     18002$as_echo "$as_me: WARNING: zbmi.h: proceeding with the compiler's result" >&2;} 
     18003    ac_header_preproc=yes 
     18004    ;; 
     18005  no:yes:* ) 
     18006    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h: present but cannot be compiled" >&5 
     18007$as_echo "$as_me: WARNING: zbmi.h: present but cannot be compiled" >&2;} 
     18008    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h:     check for missing prerequisite headers?" >&5 
     18009$as_echo "$as_me: WARNING: zbmi.h:     check for missing prerequisite headers?" >&2;} 
     18010    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h: see the Autoconf documentation" >&5 
     18011$as_echo "$as_me: WARNING: zbmi.h: see the Autoconf documentation" >&2;} 
     18012    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h:     section \"Present But Cannot Be Compiled\"" >&5 
     18013$as_echo "$as_me: WARNING: zbmi.h:     section \"Present But Cannot Be Compiled\"" >&2;} 
     18014    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h: proceeding with the preprocessor's result" >&5 
     18015$as_echo "$as_me: WARNING: zbmi.h: proceeding with the preprocessor's result" >&2;} 
     18016    { $as_echo "$as_me:$LINENO: WARNING: zbmi.h: in the future, the compiler will take precedence" >&5 
     18017$as_echo "$as_me: WARNING: zbmi.h: in the future, the compiler will take precedence" >&2;} 
     18018 
     18019    ;; 
     18020esac 
     18021{ $as_echo "$as_me:$LINENO: checking for zbmi.h" >&5 
     18022$as_echo_n "checking for zbmi.h... " >&6; } 
     18023if test "${ac_cv_header_zbmi_h+set}" = set; then 
     18024  $as_echo_n "(cached) " >&6 
     18025else 
     18026  ac_cv_header_zbmi_h=$ac_header_preproc 
     18027fi 
     18028{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_h" >&5 
     18029$as_echo "$ac_cv_header_zbmi_h" >&6; } 
     18030 
     18031fi 
     18032if test "x$ac_cv_header_zbmi_h" = x""yes; then 
     18033  : 
     18034else 
     18035  { { $as_echo "$as_me:$LINENO: error: Header zbmi.h not found." >&5 
     18036$as_echo "$as_me: error: Header zbmi.h not found." >&2;} 
     18037   { (exit 1); exit 1; }; } 
     18038fi 
     18039 
     18040 
     18041        if test "${ac_cv_header_zoid_api_h+set}" = set; then 
     18042  { $as_echo "$as_me:$LINENO: checking for zoid_api.h" >&5 
     18043$as_echo_n "checking for zoid_api.h... " >&6; } 
     18044if test "${ac_cv_header_zoid_api_h+set}" = set; then 
     18045  $as_echo_n "(cached) " >&6 
     18046fi 
     18047{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zoid_api_h" >&5 
     18048$as_echo "$ac_cv_header_zoid_api_h" >&6; } 
     18049else 
     18050  # Is the header compilable? 
     18051{ $as_echo "$as_me:$LINENO: checking zoid_api.h usability" >&5 
     18052$as_echo_n "checking zoid_api.h usability... " >&6; } 
     18053cat >conftest.$ac_ext <<_ACEOF 
     18054/* confdefs.h.  */ 
     18055_ACEOF 
     18056cat confdefs.h >>conftest.$ac_ext 
     18057cat >>conftest.$ac_ext <<_ACEOF 
     18058/* end confdefs.h.  */ 
     18059$ac_includes_default 
     18060#include <zoid_api.h> 
     18061_ACEOF 
     18062rm -f conftest.$ac_objext 
     18063if { (ac_try="$ac_compile" 
     18064case "(($ac_try" in 
     18065  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     18066  *) ac_try_echo=$ac_try;; 
     18067esac 
     18068eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     18069$as_echo "$ac_try_echo") >&5 
     18070  (eval "$ac_compile") 2>conftest.er1 
     18071  ac_status=$? 
     18072  grep -v '^ *+' conftest.er1 >conftest.err 
     18073  rm -f conftest.er1 
     18074  cat conftest.err >&5 
     18075  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     18076  (exit $ac_status); } && { 
     18077         test -z "$ac_c_werror_flag" || 
     18078         test ! -s conftest.err 
     18079       } && test -s conftest.$ac_objext; then 
     18080  ac_header_compiler=yes 
     18081else 
     18082  $as_echo "$as_me: failed program was:" >&5 
     18083sed 's/^/| /' conftest.$ac_ext >&5 
     18084 
     18085        ac_header_compiler=no 
     18086fi 
     18087 
     18088rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     18089{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     18090$as_echo "$ac_header_compiler" >&6; } 
     18091 
     18092# Is the header present? 
     18093{ $as_echo "$as_me:$LINENO: checking zoid_api.h presence" >&5 
     18094$as_echo_n "checking zoid_api.h presence... " >&6; } 
     18095cat >conftest.$ac_ext <<_ACEOF 
     18096/* confdefs.h.  */ 
     18097_ACEOF 
     18098cat confdefs.h >>conftest.$ac_ext 
     18099cat >>conftest.$ac_ext <<_ACEOF 
     18100/* end confdefs.h.  */ 
     18101#include <zoid_api.h> 
     18102_ACEOF 
     18103if { (ac_try="$ac_cpp conftest.$ac_ext" 
     18104case "(($ac_try" in 
     18105  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     18106  *) ac_try_echo=$ac_try;; 
     18107esac 
     18108eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     18109$as_echo "$ac_try_echo") >&5 
     18110  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 
     18111  ac_status=$? 
     18112  grep -v '^ *+' conftest.er1 >conftest.err 
     18113  rm -f conftest.er1 
     18114  cat conftest.err >&5 
     18115  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     18116  (exit $ac_status); } >/dev/null && { 
     18117         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 
     18118         test ! -s conftest.err 
     18119       }; then 
     18120  ac_header_preproc=yes 
     18121else 
     18122  $as_echo "$as_me: failed program was:" >&5 
     18123sed 's/^/| /' conftest.$ac_ext >&5 
     18124 
     18125  ac_header_preproc=no 
     18126fi 
     18127 
     18128rm -f conftest.err conftest.$ac_ext 
     18129{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     18130$as_echo "$ac_header_preproc" >&6; } 
     18131 
     18132# So?  What about this header? 
     18133case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     18134  yes:no: ) 
     18135    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h: accepted by the compiler, rejected by the preprocessor!" >&5 
     18136$as_echo "$as_me: WARNING: zoid_api.h: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     18137    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h: proceeding with the compiler's result" >&5 
     18138$as_echo "$as_me: WARNING: zoid_api.h: proceeding with the compiler's result" >&2;} 
     18139    ac_header_preproc=yes 
     18140    ;; 
     18141  no:yes:* ) 
     18142    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h: present but cannot be compiled" >&5 
     18143$as_echo "$as_me: WARNING: zoid_api.h: present but cannot be compiled" >&2;} 
     18144    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h:     check for missing prerequisite headers?" >&5 
     18145$as_echo "$as_me: WARNING: zoid_api.h:     check for missing prerequisite headers?" >&2;} 
     18146    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h: see the Autoconf documentation" >&5 
     18147$as_echo "$as_me: WARNING: zoid_api.h: see the Autoconf documentation" >&2;} 
     18148    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h:     section \"Present But Cannot Be Compiled\"" >&5 
     18149$as_echo "$as_me: WARNING: zoid_api.h:     section \"Present But Cannot Be Compiled\"" >&2;} 
     18150    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h: proceeding with the preprocessor's result" >&5 
     18151$as_echo "$as_me: WARNING: zoid_api.h: proceeding with the preprocessor's result" >&2;} 
     18152    { $as_echo "$as_me:$LINENO: WARNING: zoid_api.h: in the future, the compiler will take precedence" >&5 
     18153$as_echo "$as_me: WARNING: zoid_api.h: in the future, the compiler will take precedence" >&2;} 
     18154 
     18155    ;; 
     18156esac 
     18157{ $as_echo "$as_me:$LINENO: checking for zoid_api.h" >&5 
     18158$as_echo_n "checking for zoid_api.h... " >&6; } 
     18159if test "${ac_cv_header_zoid_api_h+set}" = set; then 
     18160  $as_echo_n "(cached) " >&6 
     18161else 
     18162  ac_cv_header_zoid_api_h=$ac_header_preproc 
     18163fi 
     18164{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zoid_api_h" >&5 
     18165$as_echo "$ac_cv_header_zoid_api_h" >&6; } 
     18166 
     18167fi 
     18168if test "x$ac_cv_header_zoid_api_h" = x""yes; then 
     18169  : 
     18170else 
     18171  { { $as_echo "$as_me:$LINENO: error: Header zoid_api.h not found." >&5 
     18172$as_echo "$as_me: error: Header zoid_api.h not found." >&2;} 
     18173   { (exit 1); exit 1; }; } 
     18174fi 
     18175 
     18176 
     18177        if test "${ac_cv_header_zbmi_protocol_h+set}" = set; then 
     18178  { $as_echo "$as_me:$LINENO: checking for zbmi_protocol.h" >&5 
     18179$as_echo_n "checking for zbmi_protocol.h... " >&6; } 
     18180if test "${ac_cv_header_zbmi_protocol_h+set}" = set; then 
     18181  $as_echo_n "(cached) " >&6 
     18182fi 
     18183{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_protocol_h" >&5 
     18184$as_echo "$ac_cv_header_zbmi_protocol_h" >&6; } 
     18185else 
     18186  # Is the header compilable? 
     18187{ $as_echo "$as_me:$LINENO: checking zbmi_protocol.h usability" >&5 
     18188$as_echo_n "checking zbmi_protocol.h usability... " >&6; } 
     18189cat >conftest.$ac_ext <<_ACEOF 
     18190/* confdefs.h.  */ 
     18191_ACEOF 
     18192cat confdefs.h >>conftest.$ac_ext 
     18193cat >>conftest.$ac_ext <<_ACEOF 
     18194/* end confdefs.h.  */ 
     18195$ac_includes_default 
     18196#include <zbmi_protocol.h> 
     18197_ACEOF 
     18198rm -f conftest.$ac_objext 
     18199if { (ac_try="$ac_compile" 
     18200case "(($ac_try" in 
     18201  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     18202  *) ac_try_echo=$ac_try;; 
     18203esac 
     18204eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     18205$as_echo "$ac_try_echo") >&5 
     18206  (eval "$ac_compile") 2>conftest.er1 
     18207  ac_status=$? 
     18208  grep -v '^ *+' conftest.er1 >conftest.err 
     18209  rm -f conftest.er1 
     18210  cat conftest.err >&5 
     18211  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     18212  (exit $ac_status); } && { 
     18213         test -z "$ac_c_werror_flag" || 
     18214         test ! -s conftest.err 
     18215       } && test -s conftest.$ac_objext; then 
     18216  ac_header_compiler=yes 
     18217else 
     18218  $as_echo "$as_me: failed program was:" >&5 
     18219sed 's/^/| /' conftest.$ac_ext >&5 
     18220 
     18221        ac_header_compiler=no 
     18222fi 
     18223 
     18224rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     18225{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     18226$as_echo "$ac_header_compiler" >&6; } 
     18227 
     18228# Is the header present? 
     18229{ $as_echo "$as_me:$LINENO: checking zbmi_protocol.h presence" >&5 
     18230$as_echo_n "checking zbmi_protocol.h presence... " >&6; } 
     18231cat >conftest.$ac_ext <<_ACEOF 
     18232/* confdefs.h.  */ 
     18233_ACEOF 
     18234cat confdefs.h >>conftest.$ac_ext 
     18235cat >>conftest.$ac_ext <<_ACEOF 
     18236/* end confdefs.h.  */ 
     18237#include <zbmi_protocol.h> 
     18238_ACEOF 
     18239if { (ac_try="$ac_cpp conftest.$ac_ext" 
     18240case "(($ac_try" in 
     18241  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     18242  *) ac_try_echo=$ac_try;; 
     18243esac 
     18244eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 
     18245$as_echo "$ac_try_echo") >&5 
     18246  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 
     18247  ac_status=$? 
     18248  grep -v '^ *+' conftest.er1 >conftest.err 
     18249  rm -f conftest.er1 
     18250  cat conftest.err >&5 
     18251  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     18252  (exit $ac_status); } >/dev/null && { 
     18253         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 
     18254         test ! -s conftest.err 
     18255       }; then 
     18256  ac_header_preproc=yes 
     18257else 
     18258  $as_echo "$as_me: failed program was:" >&5 
     18259sed 's/^/| /' conftest.$ac_ext >&5 
     18260 
     18261  ac_header_preproc=no 
     18262fi 
     18263 
     18264rm -f conftest.err conftest.$ac_ext 
     18265{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     18266$as_echo "$ac_header_preproc" >&6; } 
     18267 
     18268# So?  What about this header? 
     18269case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     18270  yes:no: ) 
     18271    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h: accepted by the compiler, rejected by the preprocessor!" >&5 
     18272$as_echo "$as_me: WARNING: zbmi_protocol.h: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     18273    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h: proceeding with the compiler's result" >&5 
     18274$as_echo "$as_me: WARNING: zbmi_protocol.h: proceeding with the compiler's result" >&2;} 
     18275    ac_header_preproc=yes 
     18276    ;; 
     18277  no:yes:* ) 
     18278    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h: present but cannot be compiled" >&5 
     18279$as_echo "$as_me: WARNING: zbmi_protocol.h: present but cannot be compiled" >&2;} 
     18280    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h:     check for missing prerequisite headers?" >&5 
     18281$as_echo "$as_me: WARNING: zbmi_protocol.h:     check for missing prerequisite headers?" >&2;} 
     18282    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h: see the Autoconf documentation" >&5 
     18283$as_echo "$as_me: WARNING: zbmi_protocol.h: see the Autoconf documentation" >&2;} 
     18284    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h:     section \"Present But Cannot Be Compiled\"" >&5 
     18285$as_echo "$as_me: WARNING: zbmi_protocol.h:     section \"Present But Cannot Be Compiled\"" >&2;} 
     18286    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h: proceeding with the preprocessor's result" >&5 
     18287$as_echo "$as_me: WARNING: zbmi_protocol.h: proceeding with the preprocessor's result" >&2;} 
     18288    { $as_echo "$as_me:$LINENO: WARNING: zbmi_protocol.h: in the future, the compiler will take precedence" >&5 
     18289$as_echo "$as_me: WARNING: zbmi_protocol.h: in the future, the compiler will take precedence" >&2;} 
     18290 
     18291    ;; 
     18292esac 
     18293{ $as_echo "$as_me:$LINENO: checking for zbmi_protocol.h" >&5 
     18294$as_echo_n "checking for zbmi_protocol.h... " >&6; } 
     18295if test "${ac_cv_header_zbmi_protocol_h+set}" = set; then 
     18296  $as_echo_n "(cached) " >&6 
     18297else 
     18298  ac_cv_header_zbmi_protocol_h=$ac_header_preproc 
     18299fi 
     18300{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_protocol_h" >&5 
     18301$as_echo "$ac_cv_header_zbmi_protocol_h" >&6; } 
     18302 
     18303fi 
     18304if test "x$ac_cv_header_zbmi_protocol_h" = x""yes; then 
     18305  : 
     18306else 
     18307  { { $as_echo "$as_me:$LINENO: error: Header zbmi_protocol.h not found." >&5 
     18308$as_echo "$as_me: error: Header zbmi_protocol.h not found." >&2;} 
     18309   { (exit 1); exit 1; }; } 
     18310fi 
     18311 
     18312 
     18313        CPPFLAGS="$save_cppflags" 
     18314        BUILD_ZOID=1 
     18315    fi 
     18316 
     18317 
     18318 
     18319 
    1749218320{ $as_echo "$as_me:$LINENO: checking for fgetxattr extra arguments" >&5 
    1749318321$as_echo_n "checking for fgetxattr extra arguments... " >&6; } 
     
    1932420152done 
    1932520153 
    19326 ac_config_files="$ac_config_files include/pvfs2.h Makefile module.mk src/apps/admin/module.mk src/apps/admin/pvfs2-config src/apps/karma/module.mk src/apps/vis/module.mk src/apps/fuse/module.mk src/apps/kernel/linux/module.mk src/apps/user/module.mk src/io/trove/module.mk src/io/trove/trove-handle-mgmt/module.mk src/io/trove/trove-dbpf/module.mk src/common/misc/module.mk src/common/quickhash/module.mk src/common/quicklist/module.mk src/common/dotconf/module.mk src/common/id-generator/module.mk src/common/gossip/module.mk src/common/gen-locks/module.mk src/common/llist/module.mk src/common/statecomp/module.mk src/common/events/module.mk src/common/mgmt/module.mk src/io/bmi/module.mk src/io/bmi/bmi_tcp/module.mk src/io/bmi/bmi_gm/module.mk src/io/bmi/bmi_mx/module.mk src/io/bmi/bmi_ib/module.mk src/io/bmi/bmi_portals/module.mk src/io/description/module.mk src/io/flow/module.mk src/io/flow/flowproto-bmi-trove/module.mk src/io/flow/flowproto-template/module.mk src/io/flow/flowproto-dump-offsets/module.mk src/io/flow/flowproto-bmi-cache/module.mk src/io/buffer/module.mk src/io/job/module.mk src/io/dev/module.mk src/proto/module.mk src/server/module.mk src/server/request-scheduler/module.mk src/client/sysint/module.mk src/kernel/linux-2.6/Makefile src/kernel/linux-2.4/Makefile doc/module.mk doc/coding/module.mk doc/design/module.mk doc/random/module.mk examples/pvfs2-server.rc doc/doxygen/pvfs2-doxygen.conf" 
     20154ac_config_files="$ac_config_files include/pvfs2.h Makefile module.mk src/apps/admin/module.mk src/apps/admin/pvfs2-config src/apps/karma/module.mk src/apps/vis/module.mk src/apps/fuse/module.mk src/apps/kernel/linux/module.mk src/apps/user/module.mk src/io/trove/module.mk src/io/trove/trove-handle-mgmt/module.mk src/io/trove/trove-dbpf/module.mk src/common/misc/module.mk src/common/quickhash/module.mk src/common/quicklist/module.mk src/common/dotconf/module.mk src/common/id-generator/module.mk src/common/gossip/module.mk src/common/gen-locks/module.mk src/common/llist/module.mk src/common/statecomp/module.mk src/common/events/module.mk src/common/mgmt/module.mk src/io/bmi/module.mk src/io/bmi/bmi_tcp/module.mk src/io/bmi/bmi_gm/module.mk src/io/bmi/bmi_mx/module.mk src/io/bmi/bmi_ib/module.mk src/io/bmi/bmi_portals/module.mk src/io/bmi/bmi_zoid/module.mk src/io/description/module.mk src/io/flow/module.mk src/io/flow/flowproto-bmi-trove/module.mk src/io/flow/flowproto-template/module.mk src/io/flow/flowproto-dump-offsets/module.mk src/io/flow/flowproto-bmi-cache/module.mk src/io/buffer/module.mk src/io/job/module.mk src/io/dev/module.mk src/proto/module.mk src/server/module.mk src/server/request-scheduler/module.mk src/client/sysint/module.mk src/kernel/linux-2.6/Makefile src/kernel/linux-2.4/Makefile doc/module.mk doc/coding/module.mk doc/design/module.mk doc/random/module.mk examples/pvfs2-server.rc doc/doxygen/pvfs2-doxygen.conf" 
    1932720155 
    1932820156cat >confcache <<\_ACEOF 
     
    1995220780    "src/io/bmi/bmi_ib/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/bmi/bmi_ib/module.mk" ;; 
    1995320781    "src/io/bmi/bmi_portals/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/bmi/bmi_portals/module.mk" ;; 
     20782    "src/io/bmi/bmi_zoid/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/bmi/bmi_zoid/module.mk" ;; 
    1995420783    "src/io/description/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/description/module.mk" ;; 
    1995520784    "src/io/flow/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/flow/module.mk" ;; 
     
    2076421593 
    2076521594if test x$BUILD_GM = x1 -o x$BUILD_MX = x1 -o x$BUILD_IB = x1 -o \ 
    20766         x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 ; then 
     21595        x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 -o x$BUILD_ZOID = x1 ; then 
    2076721596    if test x$BUILD_BMI_TCP = x1 ; then 
    2076821597        { $as_echo "$as_me:$LINENO: WARNING: You have selected to build $PKGSTR to use a \"fast\" network 
  • branches/Orange-Branch/configure.in

    r7987 r8317  
    4545AC_CONFIG_HEADER(pvfs2-config.h) 
    4646 
     47AC_CHECK_HEADER([pwd.h], 
     48    [AC_DEFINE(HAVE_GETPWUID, 1, Define if pwd.h exists)]) 
    4749AC_CHECK_HEADER([sys/vfs.h], 
    4850                [AC_DEFINE(HAVE_SYS_VFS_H, 1, Define if sys/vfs.h exists)]) 
     
    928930 
    929931dnl 
     932dnl Configure bmi_zoid, if --with-zoid or a variant given. 
     933dnl 
     934AX_ZOID 
     935 
     936dnl 
    930937dnl check if fgetxattr takes extra arguments 
    931938AC_MSG_CHECKING([for fgetxattr extra arguments]) 
     
    11291136src/io/bmi/bmi_ib/module.mk 
    11301137src/io/bmi/bmi_portals/module.mk 
     1138src/io/bmi/bmi_zoid/module.mk 
    11311139src/io/description/module.mk 
    11321140src/io/flow/module.mk 
     
    12681276dnl 
    12691277if test x$BUILD_GM = x1 -o x$BUILD_MX = x1 -o x$BUILD_IB = x1 -o \ 
    1270         x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 ; then 
     1278        x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 -o x$BUILD_ZOID = x1 ; then 
    12711279    if test x$BUILD_BMI_TCP = x1 ; then 
    12721280        AC_MSG_WARN([You have selected to build $PKGSTR to use a "fast" network 
  • branches/Orange-Branch/doc/REFERENCES.bib

    r7631 r8317  
     1@PhdThesis{bradles-diss, 
     2    author = {Bradley W. Settlemyer}, 
     3    title = {A Study of Client-based Caching for Parallel {I/O}}, 
     4    school = {Clemson University}, 
     5    address = {Clemson, SC}, 
     6    year = {2009}, 
     7    month = {August}, 
     8} 
     9 
     10@conference{hadoop-pvfs, 
     11    title={In Search of an {API} for Scalable File Systems: Under the table or 
     12    above it?}, 
     13    author={Swapnil Patil and Garth A. Gibson and Gregory R. Ganger and 
     14    Julio Lopez and Milo Polte and Wittawat Tantisiroj and Lin Xiao}, 
     15    booktitle={USENIX HotCloud Workshop 2009}, 
     16    month={June}, 
     17    year={2009} 
     18} 
     19 
     20@conference{syscall-diag, 
     21    title={System-Call Based Problem Diagnosis for {PVFS}}, 
     22    author={Michael P. Kasick and Keith A. Bare and Eugene E. Marinelli III 
     23    and Jiaqi Tan and Rajeev Gandhi and Priya Narasimhan}, 
     24    booktitle={Proceedings of the 5th Workshop on Hot Topics in System 
     25    Dependability (HotDep '09)}, 
     26    month={June}, 
     27    year={2009} 
     28} 
     29 
     30@conference{coord-access-toappear-iasds09, 
     31    title={Interfaces for Coordinated Access in the File System}, 
     32    author={Sam Lang and Robert Latham and Dries Kimpe and Robert Ross}, 
     33    booktitle={Proceedings of 2009 Workshop on Interfaces and 
     34    Architectures for Scientific Data Storage}, 
     35    month={September}, 
     36    year={2009}, 
     37    note={(\textbf{To Appear})} 
     38} 
     39 
     40@article{dyn-fs-semantics, 
     41    author = {Michael Kuhn and Julian Martin Kunkel and Thomas Ludwig}, 
     42    title = {Dynamic file system semantics to enable metadata optimizations 
     43    in {PVFS}}, 
     44    journal ={Concurrency and Computation: Practice and Experience}, 
     45    year = {2009}, 
     46    publisher = {John Wiley and Sons, Ltd}, 
     47} 
     48 
     49@conference{pvfs-bgp-toappear-sc09, 
     50    title={{I/O} Performance Challenges at Leadership Scale}, 
     51    author={Samuel Lang and Philip Carns and Robert Latham and Robert Ross and Kevin Harms and William Allcock}, 
     52    booktitle={Proceedings of Supercomputing}, 
     53    month={November}, 
     54    year={2009}, 
     55    note={(\textbf{To Appear})} 
     56} 
     57 
     58@article{IPDPS.2009.5161070, 
     59    author = {Xuechen Zhang and Song Jiang and Kei Davis}, 
     60    title = {Making resonance a common case: A high-performance implementation 
     61    of collective I/O on parallel file systems}, 
     62    journal ={Parallel and Distributed Processing Symposium, International}, 
     63    volume = {0}, 
     64    year = {2009}, 
     65    pages = {1-12}, 
     66    doi = {http://doi.ieeecomputersociety.org/10.1109/IPDPS.2009.5161070}, 
     67    publisher = {IEEE Computer Society}, 
     68    address = {Los Alamitos, CA, USA}, 
     69} 
    170 
    271@inproceedings{SmallFilesIPDPS09, 
     
    1079@inproceedings{PosixExtTReport, 
    1180 author = {M. Vilayannur and  S. Lang and  R. Ross and  R. Klundt  and L. Ward}, 
    12  title = {Extending the POSIX I/O Interface: A Parallel File System Perspective}, 
     81 title = {Extending the {POSIX I/O} Interface: A Parallel File System Perspective}, 
    1382 booktitle = {Technical Memorandum ANL/MCS-TM-302}, 
    1483 year = {2008}, 
     
    37106@inproceedings{OSDCluster08, 
    38107 author = {N. Ali and  A. Devulapalli and  D. Dalessandro and  P. Wyckoff and  P. Sadayappan}, 
    39  title = {An OSD-based Approach to Managing Directory Operations in Parallel File Systems}, 
     108 title = {An {OSD-based} Approach to Managing Directory Operations in Parallel File Systems}, 
    40109 booktitle = {IEEE International Conference on Cluster Computing}, 
    41110 year = {2008}, 
     
    73142} 
    74143 
     144@inproceedings{kunkel:bottlenecks, 
     145  author={Julian Kunkel and Thomas Ludwig}, 
     146  title={Bottleneck Detection in Parallel File Systems with Trace-Based Performance Monitoring}, 
     147  booktitle={Euro-Par 2008: Proceedings of the 14th International Euro-Par Conference on Parallel Processing}, 
     148  year = {2008}, 
     149  pages={212--221} 
     150} 
     151 
     152@inproceedings{ludwig:pioviz, 
     153  author={Thomas Ludwig and Stephan Krempel and Michael Kuhn and Julian Kunkel and Christian Lohse}, 
     154  title={Analysis of the {MPI-IO} Optimization Levels with the {PIOViz} Jumpshot Enhancement}, 
     155  booktitle={Proceedings of EuroPVM/MPI 2007}, 
     156  year={2007}, 
     157  month={September}, 
     158  pages={213--222} 
     159} 
     160 
    75161@article{BradThesis, 
    76162 author = {Bradley W. Settlemyer}, 
     
    91177  pages     = {26-29}, 
    92178  ee        = {http://doi.acm.org/10.1145/1374596.1374604}, 
    93   crossref  = {DBLP:conf/sc/2007pdsw}, 
    94179  bibsource = {DBLP, http://dblp.uni-trier.de}, 
    95180  url = {http://www.pdl.cmu.edu/PDL-FTP/HECStorage/sc07-patil.pdf} 
     
    621706   booktitle = {HPCASIA '04: Proceedings of the High Performance Computing and Grid in Asia Pacific Region, Seventh International Conference}, 
    622707   year = {2004}, 
    623    isbn = {0-7695-2138-X}, 
    624708   pages = {136--139}, 
    625709   publisher = {IEEE Computer Society}, 
  • branches/Orange-Branch/doc/add-server-req

    r4617 r8317  
    3838                        PINT_server_op  -- only if required 
    3939 
    40 5) write state machine -- se details below 
     405) write state machine -- see details below 
    4141                src/server/<reqname>.sm 
    4242                        each state machine added must have a delcaration in 
    4343                                src/server/pvfs2-server.h 
    4444 
    45 6) update request scheduler 
    46                 src/server/request-scheduler/request-scheduler.c 
    47                         PINT_req_sched_target_handle() 
    48  
    49 7) add entry to server operation parameters table 
    50                 src/server/pvfs2-server.c 
    51                         init_req_table -- see src/server/prelude.sm 
    52                         prelude_perm_check() 
    53  
    54 8) add entry in final response state machine 
    55                 src/server/final-response.sm 
    56                         s_req_resp_type_map 
    57  
     456) update src/server/pvfs2-server-req.c 
     46                add new entry to PINT_server_req_table[] 
     47                reference the params structure from the state machine 
    5848 
    5949 
  • branches/Orange-Branch/doc/pvfs2-faq.tex

    r7697 r8317  
    319319\url{http://www.pvfs.org/}.  Documentation (including this FAQ) is also 
    320320available in the \texttt{doc} subdirectory of the PVFS source distribution. 
     321Please reference \texttt{pvfs2-logging.txt} to understand more about PVFS' 
     322informational messages, where the logs exist, and how to turn logging 
     323on and off. 
    321324 
    322325\subsection{What should I do if I have a problem?} 
     
    713716pre-release kernel, but do make an effort to publish necessary patches once a 
    714717kernel is officially released.  
     718 
     719\subsection{Does PVFS work with Open-MX?} 
     720\label{sec:open-mx} 
     721 
     722Yes, PVFS does work with Open-MX.  To use Open-MX, configure PVFS with 
     723the the same arguments that you would use for a normal MX installation: 
     724``--disable-bmi-tcp'' and ``--with-mx=PATH''.  In addition, however, you 
     725must set the ``MX\_IMM\_ACK'' environment variable to ``1'' before starting 
     726the pvfs2-server or pvfs2-client daemons.  This is necessary in order to 
     727account for differences in how MX and Open-MX handle message progression by 
     728default. 
    715729 
    716730% 
  • branches/Orange-Branch/doc/pvfs2-logging.txt

    r8315 r8317  
     1PVFS Logging 
     2============ 
     3 
     4This document describes log files produced by PVFS and how to control 
     5what messages are included in them. 
     6 
     7PVFS Log Format 
     8--------------- 
     9 
     10The log messages from all PVFS components except for the kernel module 
     11are in the following format:  
     12 
     13    [<type> <timestamp>] LOG MESSAGE 
     14 
     15The type will be one of 4 different letters depending on what type of 
     16log message it is: 
     17 
     18    D - DEBUG  
     19    E - ERROR  
     20    A - ACCESS LOGGING 
     21    P - PERFORMANCE COUNTER  
     22 
     23The timestamp defaults to showing the date, hour, and minute that the 
     24log message was generated.  The timestamp format can be modified to one 
     25of the following styles by using the --logstamp argument to pvfs2-client 
     26or the LogStamp field in the pvfs2-server config file: 
     27 
     28    datetime: (default, as described above) 
     29    usec: shows time with microsecond granularity (but no date) 
     30    none: no time stamp 
     31    thread: includes thread ID with each message 
     32 
     33PVFS Log Locations 
     34------------------ 
     35 
     36The pvfs2-server daemon writes log messages to /tmp/pvfs2-server.log by 
     37default.  A different output file can be specified using the LogFile 
     38parameter in the configuration file.  The logs can also be sent to syslog 
     39instead by adding "LogType syslog" to the configuration file. 
     40 
     41The pvfs2-client daemon writes log messages to /tmp/pvfs2-client.log by 
     42default.  This can be overridden using the --logfile or --logtype command 
     43line arguments to pvfs2-client. 
     44 
     45The PVFS kernel module (pvfs2.ko) generates log messages to dmesg and/or 
     46/var/log/messages and/or /var/log/kern depending on your Linux distribution. 
     47 
     48The PVFS client library (libpvfs2) and command line utilities generate log 
     49messages to stderr if enabled. 
     50 
     51Logging Levels 
     52-------------- 
     53 
     54All PVFS components log critical error messages automatically.  However,  
     55you can also turn on additional logging for debugging purposes.  This is 
     56controlled by specifying which logging "masks" should be enabled. 
     57 
     58You can see a list of available pvfs2-server, client library, and 
     59pvfs2-client logging levels by running the pvfs2-set-debugmask utility 
     60with no arguments. 
     61 
     62You can see a list of available kernel module logging masks and client 
     63logging masks by running "cat /proc/sys/pvfs2/debug-help". 
     64 
     65The "verbose" mask is commonly used to turn on most of the logging 
     66levels that are useful for debugging problems. 
     67 
     68Changing the log mask for pvfs2-server 
     69-------------------------------------- 
     70 
     71Use the EventLogging field in the configuration file to specify 
     72a comma separated list of masks to enable.  You can also use the 
     73pvfs2-set-debugmask command line utility to change the mask dynamically 
     74without restarting the server. 
     75 
     76Changing the log mask for libpvfs and command line utilities 
     77------------------------------------------------------------ 
     78 
     79Set the PVFS2_DEBUGMASK environment variable to a comma separated list of 
     80client-appropriate masks prior to launching the application. 
     81 
     82 
     83Changing the log mask for the kernel module 
     84------------------------------------------- 
     85 
     86There are three ways to set the debugging level for the kernel module: 
     87 
     881.  Set module_parm_debug_mask parameter when the kernel module is 
     89loaded.   
     90 
     912.  Set the environment variable PVFS2_KMODMASK before starting the  
     92pvfs2-client.  NOTE:  the kernel module must be loaded before starting 
     93the client-core. 
     94 
     953.  Write a debug string to /proc/sys/pvfs2/kernel-debug after the kernel 
     96module is loaded. 
     97 
     98 
     99Options 1 and 2 allow the kernel debug mask to be set ONLY when PVFS is started, 
     100while option 3 allows the kernel debug mask to be modified while PVFS is  
     101running.  Thus, option 3 dynamically updates the kernel debug mask,  
     102immediately turning on the debugging options specified, and REPLACES the 
     103existing debug mask.  Whenever you modify the kernel debug mask using 
     104option 3, an informational message is printed to the system log file,  
     105giving both its numerical value and a comma-separated list of keywords representing 
     106the areas of debugging just turned on. 
     107 
     108Options 1 and 2 require the user to specify a numerical value that is 
     109an OR'd list of gossip debug values.  These values can be found in 
     110include/pvfs2-debug.h.  For example, to load the kernel module with 
     111"file" debugging turned on, issue the following command: 
     112 
     113insmod pvfs2.ko module_parm_debug_mask=4 
     114 
     115The 4 is the value of GOSSIP_FILE_DEBUG, and module_parm_debug_mask is the kernel 
     116module's input parameter for the kernel debug mask.  To turn on multiple areas,for 
     117example, file and dcache, set module_parm_debug_mask = (GOSSIP_FILE_DEBUG | GOSSIP_DCACHE_DEBUG) = 
     118(4 | 128) = 132.  Its string equivalent would be "file,dcache". 
     119 
     120An informational message is displayed in the system log whenever you load the kernel  
     121module, giving you the kernel debug mask's numerical value and its string  
     122equivalent.  Be aware that you can modify this value later using option 3. 
     123 
     124To set the kernel debug mask using PVFS2_KMODMASK, create a global environment  
     125variable and set it equal to the desired numerical value.  When the pvfs2-client 
     126is started, the kernel debug mask and its string equivalent will be modified.  Note that  
     127PVFS2_KMODMASK will override any value set by the kernel module load process.  Again, 
     128option 3 allows you to change the debug mask at any time. 
     129 
     130To set the kernel debug mask using the /proc variable, write a debug string to  
     131/proc/sys/pvfs2/kernel-debug.  Example:  echo "file,dcache" > /proc/sys/pvfs2/kernel-debug. 
     132An informational message will be written to the system log file displaying the new 
     133kernel debug mask and its string equivalent. 
     134 
     135To see the kernel debug mask without looking in the system log, issue a "cat" on 
     136/proc/sys/pvfs2/kernel-debug and you will see the string equivalent of the kernel 
     137debug mask.  
     138 
     139A helper /proc variable, /proc/sys/pvfs2/debug-help, will display a list of valid 
     140keywords for both the kernel and client debug masks, when you issue a "cat" on it.  These  
     141keywords are used to build the string that represent the areas of debugging that you  
     142want turned on. 
     143 
     144 
     145 
     146Changing the log mask for the client module 
     147------------------------------------------- 
     148 
     149There are three ways to set the debugging level for the pvfs2-client: 
     150 
     1511.  Set --gossip-mask=MASK_LIST on the command line when starting the client.  This 
     152list can be overridden by PVFS2_DEBUGMASK or by setting the /proc variable client-debug.  
     153 
     1542.  Write a debug string to /proc/sys/pvfs2/client-debug after starting the client. This 
     155will override any value set by --gossip-mask on the command line and any value set by 
     156PVFS2_DEBUGMASK. 
     157 
     1583.  Set the environment variable PVFS2_DEBUGMASK before starting the client.  This will 
     159override any value set by --gossip-mask on the command line. 
     160 
     161 
     162Options 1 and 2 require a string of comma-separated keywords to set the client debug mask. 
     163For example: 
     164 
     165./pvfs2-client --gossip-mask="server,trove" -p ./pvfs2-client-core 
     166NOTE: after kernel module is loaded and during client startup. 
     167 
     168echo "server,trove" > /proc/sys/pvfs2/client-debug 
     169NOTE: after kernel module is loaded and client is started. 
     170 
     171A list of client debug keywords can be found in include/pvfs2-debug.h or by accessing 
     172the /proc/sys/pvfs2/debug-help variable after the kernel module is loaded. Example: 
     173 
     174cat /proc/sys/pvfs2/debug-help 
     175 
     176 
     177When the client starts, the client debug mask information is sent to the kernel module 
     178where a local version of the mask and its string equivalent is maintained.  This process 
     179writes an informational message to the system log file displaying the numerical value of 
     180the client debug mask and its string equivalent.  You can also see the mask's current string 
     181equivalent by issuing the following: 
     182 
     183cat /proc/sys/pvfs2/client-debug. 
     184 
     185 
     186Whenever you modify the client debug mask after the client has started, an informational message will 
     187be written to the system log file displaying the new numerical value and string equivalent.  At any 
     188time, once PVFS is running, you can view the client debug mask using the "cat" statement above without 
     189having to look in the system log file for the last modification. 
     190 
     191 
  • branches/Orange-Branch/doc/pvfs2-quickstart.tex

    r6690 r8317  
    939939and eventually to the kernel logs. 
    940940One could also set the kmod diagnostic level when the kernel module is loaded 
    941 like so, insmod pvfs2.ko gossip\_debug\_mask=<diagnostic level>. 
     941like so, insmod pvfs2.ko module\_parm\_debug\_mask=<diagnostic level>. 
    942942The diagnostic level will be a bitwise OR of values specified in pvfs2-debug.h. 
     943For more information on setting the kernel or client debug mask, see 
     944\texttt{doc/pvfs2-logging.txt} in the PVFS source tree. 
    943945 
    944946\section{ROMIO Support} 
  • branches/Orange-Branch/examples/heartbeat/hardware-specific/Filesystem-qla-monitor

    r6957 r8317  
    644644      # shoot ourselves in the head 
    645645      return $OCF_ERR_GENERIC 
    646     else 
    647       return $ORIG_RET 
    648     fi     
     646    fi 
     647    dd bs=4096 count=1 if=/dev/zero oflag=direct of=${MOUNTPOINT}/filesystem.monitor 
     648    if [ $? -ne 0 ]; then 
     649      ocf_log err "Error: Unable to write to $DEVICE on node `hostname`." 
     650      /usr/bin/logger -p user.err -t PVFS2 "Error: Unable to write to $DEVICE on node `hostname`, failing over." 
     651      /usr/bin/fs-instance-alarm.pl --fs-name $fsname --ce `hostname` --type PVFS2_HA --msg "Error: Unable to write to $DEVICE on node `hostname`, failing over." 
     652      # shoot ourselves in the head 
     653      /usr/bin/fs-power-control.pl --fs-name $fsname --conf-dir $conf_dir --host `hostname` --command reboot 
     654      return $OCF_ERR_GENERIC 
     655    fi 
    649656  fi 
    650657  return $ORIG_RET 
     
    718725fi 
    719726 
     727OP=$1 
     728 
     729# These operations do not require instance parameters 
     730case $OP in 
     731  meta-data)            meta_data 
     732                        exit $OCF_SUCCESS 
     733                        ;; 
     734  usage)                usage 
     735                        exit $OCF_SUCCESS 
     736                        ;; 
     737esac 
     738 
    720739if  
    721740  [ -z "$OCF_RESKEY_fsname" ] 
     
    742761fsname=$OCF_RESKEY_fsname 
    743762conf_dir=$OCF_RESKEY_conf_dir 
    744  
    745 OP=$1 
    746  
    747 # These operations do not require instance parameters 
    748 case $OP in 
    749   meta-data)            meta_data 
    750                         exit $OCF_SUCCESS 
    751                         ;; 
    752   usage)                usage 
    753                         exit $OCF_SUCCESS 
    754                         ;; 
    755 esac 
    756763 
    757764blockdevice=no 
  • branches/Orange-Branch/include/pvfs2-debug.h

    r8215 r8317  
    7878#define GOSSIP_MIRROR_DEBUG            ((uint64_t)1 << 56) 
    7979 
    80 /* NOTE: if you want your gossip flag to be controllable from  
    81  * pvfs2-set-debugmask you have to add it in 
    82  * src/common/misc/pvfs2-debug.c 
    83  */ 
    84  
    8580#define GOSSIP_BMI_DEBUG_ALL (uint64_t)                               \ 
    8681(GOSSIP_BMI_DEBUG_TCP + GOSSIP_BMI_DEBUG_CONTROL +                    \ 
    8782 GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB \ 
    8883 + GOSSIP_BMI_DEBUG_MX + GOSSIP_BMI_DEBUG_PORTALS) 
    89  
    90 uint64_t PVFS_debug_eventlog_to_mask( 
    91     const char *event_logging); 
    9284 
    9385const char *PVFS_debug_get_next_debug_keyword( 
  • branches/Orange-Branch/include/pvfs2-encode-stubs.h

    r7471 r8317  
    3939 */ 
    4040#ifdef __PINT_REQPROTO_ENCODE_FUNCS_C 
    41 #  include "src/proto/endecode-funcs.h" 
     41#include "src/proto/endecode-funcs.h" 
    4242#else  /* __PINT_REQPROTO_ENCODE_FUNCS_C */ 
    4343 
    4444/* dummy declarations to turn off functions */ 
    45 #define endecode_fields_1(n,t1,x1) 
    46 #define endecode_fields_1_struct(n,t1,x1) 
    47 #define endecode_fields_2(n,t1,x1,t2,x2) 
    48 #define endecode_fields_2_struct(n,t1,x1,t2,x2) 
    49 #define endecode_fields_3(n,t1,x1,t2,x2,t3,x3) 
    50 #define endecode_fields_3_struct(n,t1,x1,t2,x2,t3,x3) 
    51 #define endecode_fields_4(n,t1,x1,t2,x2,t3,x3,t4,x4) 
    52 #define endecode_fields_4_struct(n,t1,x1,t2,x2,t3,x3,t4,x4) 
    53 #define endecode_fields_5(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) 
    54 #define endecode_fields_5_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) 
    55 #define endecode_fields_6(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6) 
    56 #define endecode_fields_7_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7) 
    57 #define endecode_fields_8_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8) 
    58 #define endecode_fields_9_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9) 
    59 #define endecode_fields_10_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10) 
    60 #define endecode_fields_11_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11) 
    61 #define endecode_fields_12(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12) 
     45#define endecode_fields_1(n,t1,x1) struct endecode_fake_struct 
     46#define endecode_fields_1_struct(n,t1,x1) struct endecode_fake_struct 
     47#define endecode_fields_2(n,t1,x1,t2,x2) struct endecode_fake_struct 
     48#define endecode_fields_2_struct(n,t1,x1,t2,x2) struct endecode_fake_struct 
     49#define endecode_fields_3(n,t1,x1,t2,x2,t3,x3) struct endecode_fake_struct 
     50#define endecode_fields_3_struct(n,t1,x1,t2,x2,t3,x3) struct endecode_fake_struct 
     51#define endecode_fields_4(n,t1,x1,t2,x2,t3,x3,t4,x4) struct endecode_fake_struct 
     52#define endecode_fields_4_struct(n,t1,x1,t2,x2,t3,x3,t4,x4) struct endecode_fake_struct 
     53#define endecode_fields_5(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) struct endecode_fake_struct 
     54#define endecode_fields_5_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) struct endecode_fake_struct 
     55#define endecode_fields_6(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6) struct endecode_fake_struct 
     56#define endecode_fields_7_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7) struct endecode_fake_struct 
     57#define endecode_fields_8_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8) struct endecode_fake_struct 
     58#define endecode_fields_9_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9) struct endecode_fake_struct 
     59#define endecode_fields_10_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10) struct endecode_fake_struct 
     60#define endecode_fields_11_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11) struct endecode_fake_struct 
     61#define endecode_fields_12(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12) struct endecode_fake_struct 
    6262 
    63 #define endecode_fields_1a(n,t1,x1,tn1,n1,ta1,a1) 
    64 #define endecode_fields_1a_struct(n,t1,x1,tn1,n1,ta1,a1) 
    65 #define endecode_fields_1aa_struct(n,t1,x1,tn1,n1,ta1,a1,ta2,a2) 
    66 #define endecode_fields_2a_struct(n,t1,x1,t2,x2,tn1,n1,ta1,a1) 
    67 #define endecode_fields_2aa_struct(n,t1,x1,t2,x2,tn1,n1,ta1,a1,ta2,a2) 
    68 #define endecode_fields_3a_struct(n,t1,x1,t2,x2,t3,x3,tn1,n1,ta1,a1) 
    69 #define endecode_fields_4aa_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,tn1,n1,ta1,a1,ta2,a2) 
    70 #define endecode_fields_1a_1a_struct(n,t1,x1,tn1,n1,ta1,a1,t2,x2,tn2,n2,ta2,a2) 
    71 #define endecode_fields_4a_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,tn1,n1,ta1,a1) 
    72 #define endecode_fields_5a_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,tn1,n1,ta1,a1) 
     63#define endecode_fields_1a(n,t1,x1,tn1,n1,ta1,a1) struct endecode_fake_struct 
     64#define endecode_fields_1a_struct(n,t1,x1,tn1,n1,ta1,a1) struct endecode_fake_struct 
     65#define endecode_fields_1aa_struct(n,t1,x1,tn1,n1,ta1,a1,ta2,a2) struct endecode_fake_struct 
     66#define endecode_fields_2a_struct(n,t1,x1,t2,x2,tn1,n1,ta1,a1) struct endecode_fake_struct 
     67#define endecode_fields_2aa_struct(n,t1,x1,t2,x2,tn1,n1,ta1,a1,ta2,a2) struct endecode_fake_struct 
     68#define endecode_fields_3a_struct(n,t1,x1,t2,x2,t3,x3,tn1,n1,ta1,a1) struct endecode_fake_struct 
     69#define endecode_fields_4aa_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,tn1,n1,ta1,a1,ta2,a2) struct endecode_fake_struct 
     70#define endecode_fields_1a_1a_struct(n,t1,x1,tn1,n1,ta1,a1,t2,x2,tn2,n2,ta2,a2) struct endecode_fake_struct 
     71#define endecode_fields_4a_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,tn1,n1,ta1,a1) struct endecode_fake_struct 
     72#define endecode_fields_5a_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,tn1,n1,ta1,a1) struct endecode_fake_struct 
    7373 
    74 #define encode_enum_union_2_struct(name, ename, uname, ut1, un1, en1, ut2, un2, en2) 
     74#define encode_enum_union_2_struct(name, ename, uname, ut1, un1, en1, ut2, un2, en2) struct endecode_fake_struct 
    7575 
    7676#endif  /* __PINT_REQPROTO_ENCODE_FUNCS_C */ 
  • branches/Orange-Branch/include/pvfs2-mgmt.h

    r7471 r8317  
    7575    int32_t, keyval_queue, 
    7676    int32_t, reqsched, 
    77     skip4,) 
     77    skip4,); 
    7878 
    7979/* low level information about individual server level objects */ 
     
    9494  skip4,, 
    9595  PVFS_size, b_size, 
    96   PVFS_handle, dirdata_handle) 
     96  PVFS_handle, dirdata_handle); 
    9797 
    9898/* individual datapoint from event monitoring */ 
     
    116116    int32_t, tv_sec, 
    117117    int32_t, tv_usec, 
    118     skip4,) 
     118    skip4,); 
    119119 
    120120/* values which may be or'd together in the flags field above */ 
  • branches/Orange-Branch/include/pvfs2-types.h

    r8098 r8317  
    103103    ENCODING_DIRECT = 1, 
    104104    ENCODING_LE_BFIELD = 2, 
    105     ENCODING_XDR = 3, 
     105    ENCODING_XDR = 3 
    106106}; 
     107 
    107108/* these values must correspond to the defined encoding types above */ 
    108109#define ENCODING_INVALID_MIN                    0 
     
    502503    } u; 
    503504}; 
     505 
    504506encode_enum_union_2_struct( 
    505507    PVFS_mgmt_setparam_value, 
    506508    type, u, 
    507509    uint64_t, value,        PVFS_MGMT_PARAM_TYPE_UINT64, 
    508     string,   string_value, PVFS_MGMT_PARAM_TYPE_STRING) 
     510    string,   string_value, PVFS_MGMT_PARAM_TYPE_STRING); 
    509511 
    510512enum PVFS_server_mode 
  • branches/Orange-Branch/maint/config/kernel.m4

    r7731 r8317  
    544544        fi 
    545545 
    546         dnl Test to see if sysctl proc handlers have a 6th argument 
    547         AC_MSG_CHECKING(for 6th argument to sysctl proc handlers) 
    548         dnl if this test passes, there is a 6th argument 
     546        dnl the proc handler functions have changed over the years. 
     547        dnl pre-2.6.8: proc_handler(ctl_table       *ctl, 
     548        dnl                         int             write, 
     549        dnl                         struct file     *filp, 
     550        dnl                         void            *buffer, 
     551        dnl                         size_t          *lenp) 
     552        dnl 
     553        dnl 2.6.8-2.6.31: proc_handler(ctl_table       *ctl, 
     554        dnl                            int             write, 
     555        dnl                            struct file     *filp, 
     556        dnl                            void            *buffer, 
     557        dnl                            size_t          *lenp, 
     558        dnl                            loff_t          *ppos) 
     559        dnl > 2.6.31: proc_handler(ctl_table       *ctl, 
     560        dnl                        int             write, 
     561        dnl                        void            *buffer, 
     562        dnl                        size_t          *lenp, 
     563        dnl                        loff_t          *ppos) 
     564  
     565        dnl Test to see if sysctl proc handlers have a file argument 
     566        AC_MSG_CHECKING(for file argument to sysctl proc handlers) 
    549567        AC_TRY_COMPILE([ 
    550568            #define __KERNEL__ 
     
    552570            #include <linux/sysctl.h> 
    553571            ], [ 
    554             proc_dointvec_minmax(NULL, 0, NULL, NULL, NULL, NULL); 
     572                struct ctl_table * ctl = NULL; 
     573                int write = 0; 
     574                struct file * filp = NULL; 
     575                void __user * buffer = NULL; 
     576                size_t * lenp = NULL; 
     577                loff_t * ppos = NULL; 
     578 
     579                proc_dointvec_minmax(ctl, write, filp, buffer, lenp, ppos); 
    555580            ], 
    556581            AC_MSG_RESULT(yes) 
    557             AC_DEFINE(HAVE_PROC_HANDLER_SIX_ARG, 1, Define if sysctl proc handlers have 6th argument), 
     582            AC_DEFINE(HAVE_PROC_HANDLER_FILE_ARG, 1, Define if sysctl proc handlers have 6th argument), 
     583            AC_MSG_RESULT(no) 
     584            ) 
     585 
     586        AC_MSG_CHECKING(for ppos argument to sysctl proc handlers) 
     587        dnl if this test passes, there is a ppos argument 
     588        AC_TRY_COMPILE([ 
     589            #define __KERNEL__ 
     590            #include <linux/fs.h> 
     591            #include <linux/sysctl.h> 
     592            ], [ 
     593                struct ctl_table * ctl = NULL; 
     594                int write = 0; 
     595                void __user * buffer = NULL; 
     596                size_t * lenp = NULL; 
     597                loff_t * ppos = NULL; 
     598 
     599                proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); 
     600            ], 
     601            AC_MSG_RESULT(yes) 
     602            AC_DEFINE(HAVE_PROC_HANDLER_PPOS_ARG, 1, Define if sysctl proc handlers have ppos argument), 
    558603            AC_MSG_RESULT(no) 
    559604            ) 
     
    11741219        ) 
    11751220 
     1221        AC_MSG_CHECKING(for s_dirty in struct super_block) 
     1222        AC_TRY_COMPILE([ 
     1223                #define __KERNEL__ 
     1224                #include <linux/fs.h> 
     1225        ], [ 
     1226                struct super_block *s; 
     1227                list_empty(&s->s_dirty); 
     1228        ], 
     1229        AC_MSG_RESULT(yes) 
     1230        AC_DEFINE(HAVE_SB_DIRTY_LIST, 1, [Define if struct super_block has s_dirty list]), 
     1231        AC_MSG_RESULT(no) 
     1232        ) 
     1233 
    11761234        dnl newer 2.6 kernels (2.6.29-ish) use current_fsuid() macro instead 
    11771235        dnl of accessing task struct fields directly 
     
    11921250        CFLAGS=$tmp_cflags 
    11931251 
     1252        dnl 2.6.32 added a mandatory name field to the bdi structure 
     1253        AC_MSG_CHECKING(if kernel backing_dev_info struct has a name field) 
     1254        AC_TRY_COMPILE([ 
     1255                #define __KERNEL__ 
     1256                #include <linux/fs.h> 
     1257                #include <linux/backing-dev.h> 
     1258        ], [ 
     1259                struct backing_dev_info foo =  
     1260                { 
     1261                    .name = "foo" 
     1262                }; 
     1263        ], 
     1264        AC_MSG_RESULT(yes) 
     1265        AC_DEFINE(HAVE_BACKING_DEV_INFO_NAME, 1, [Define if kernel backing_dev_info struct has a name field]), 
     1266        AC_MSG_RESULT(no) 
     1267        ) 
     1268 
     1269        dnl some 2.6 kernels have functions to explicitly initialize bdi structs 
     1270        tmp_cflags=$CFLAGS 
     1271        CFLAGS="$CFLAGS -Werror" 
     1272        AC_MSG_CHECKING(for bdi_init) 
     1273        AC_TRY_COMPILE([ 
     1274                #define __KERNEL__ 
     1275                #include <linux/fs.h> 
     1276                #include <linux/backing-dev.h> 
     1277        ], [ 
     1278                int ret = bdi_init(NULL); 
     1279        ], 
     1280        AC_MSG_RESULT(yes) 
     1281        AC_DEFINE(HAVE_BDI_INIT, 1, [Define if bdi_init function is present]), 
     1282        AC_MSG_RESULT(no) 
     1283        ) 
     1284        CFLAGS=$tmp_cflags 
     1285 
    11941286 
    11951287        CFLAGS=$oldcflags 
  • branches/Orange-Branch/pvfs2-config.h.in

    r7959 r8317  
    3333/* Define to 1 if you have the <attr/xattr.h> header file. */ 
    3434#undef HAVE_ATTR_XATTR_H 
     35 
     36/* Define if kernel backing_dev_info struct has a name field */ 
     37#undef HAVE_BACKING_DEV_INFO_NAME 
     38 
     39/* Define if bdi_init function is present */ 
     40#undef HAVE_BDI_INIT 
    3541 
    3642/* Define if struct backing_dev_info in kernel has memory_backed */ 
     
    126132#undef HAVE_GETMNTENT 
    127133 
     134/* Define if pwd.h exists */ 
     135#undef HAVE_GETPWUID 
     136 
    128137/* Define if struct super_operations in kernel has get_fs_key callback */ 
    129138#undef HAVE_GET_FS_KEY_SUPER_OPERATIONS 
     
    265274 
    266275/* Define if sysctl proc handlers have 6th argument */ 
    267 #undef HAVE_PROC_HANDLER_SIX_ARG 
     276#undef HAVE_PROC_HANDLER_FILE_ARG 
     277 
     278/* Define if sysctl proc handlers have ppos argument */ 
     279#undef HAVE_PROC_HANDLER_PPOS_ARG 
    268280 
    269281/* Define if have PtlACEntry with jid argument. */ 
     
    304316   tree_lock */ 
    305317#undef HAVE_RW_LOCK_TREE_ADDR_SPACE_STRUCT 
     318 
     319/* Define if struct super_block has s_dirty list */ 
     320#undef HAVE_SB_DIRTY_LIST 
    306321 
    307322/* Define to 1 if you have the <SDL/SDL_ttf.h> header file. */ 
  • branches/Orange-Branch/src/apps/admin/pvfs2-ls.c

    r8311 r8317  
    3434 
    3535/* 
     36  Define the maximum length of a single line of output. This is about the  
     37  size of 256 maximum path segments, a file name, and attributes. 
     38 */ 
     39#define ENTRY_MAX          66560 
     40 
     41/* 
    3642  arbitrarily restrict the number of paths 
    3743  that this ls version can take as arguments 
    3844*/ 
    3945#define MAX_NUM_PATHS       8 
     46 
     47/* 
     48  Max length of the fully formatted date/time fields 
     49*/ 
     50#define MAX_TIME_LENGTH    128 
     51 
     52/* 
     53  Length of the formatted date/time for --all-times option 
     54*/ 
     55#define ALL_TIMES_LENGTH    25 
    4056 
    4157/* optional parameters, filled in by parse_args() */ 
     
    5369    int list_no_owner; 
    5470    int list_inode; 
     71    int list_all_times; 
    5572    int list_use_si_units; 
    5673    char *start[MAX_NUM_PATHS]; 
     
    7895    PVFS_sys_attr *attr, 
    7996    int attr_error, 
    80     struct options *opts); 
     97    struct options *opts, 
     98    char* entry_buffer); 
    8199 
    82100static int do_list( 
     
    84102    char *start, 
    85103    int fs_id, 
    86     struct options *opts); 
     104    struct options *opts, 
     105    char *entry_buffer); 
    87106 
    88107static void print_entry_attr( 
     
    90109    char *entry_name, 
    91110    PVFS_sys_attr *attr, 
    92     struct options *opts); 
     111    struct options *opts, 
     112    char *entry_buffer); 
    93113 
    94114#define print_dot_and_dot_dot_info_if_required(refn)        \ 
     
    108128        else if (opts->list_long) {                         \ 
    109129            print_entry(".", refn.handle,                   \ 
    110                         refn.fs_id, NULL, 0, opts);         \ 
     130                        refn.fs_id, NULL, 0, opts,          \ 
     131                        entry_buffer);                      \ 
    111132            print_entry(".. (faked)", refn.handle,          \ 
    112                         refn.fs_id, NULL, 0, opts);         \ 
     133                        refn.fs_id, NULL, 0, opts,          \ 
     134                        entry_buffer);                      \ 
    113135        }                                                   \ 
    114136        else {                                              \ 
     
    190212    char *entry_name, 
    191213    PVFS_sys_attr *attr, 
    192     struct options *opts) 
     214    struct options *opts, 
     215    char *entry_buffer) 
    193216{ 
    194     char buf[128] = {0}, *formatted_size = NULL; 
    195     char *formatted_owner = NULL, *formatted_group = NULL; 
     217    char *formatted_size = NULL; 
     218    char *formatted_owner = NULL, *formatted_group = NULL, *formatted_time = NULL; 
    196219    struct group *grp = NULL; 
    197220    struct passwd *pwd = NULL; 
     
    199222    char *owner = empty_str, *group = empty_str; 
    200223    char *inode = empty_str; 
    201     time_t mtime; 
    202     struct tm *time;     
     224    time_t mtime, atime, ctime; 
     225    struct tm *time; 
    203226    PVFS_size size = 0; 
    204     char scratch_owner[16] = {0}, scratch_group[16] = {0}; 
     227    char scratch_owner[16] = {0}, scratch_group[16] = {0}, scratch_time[MAX_TIME_LENGTH] = {0}, scratch_big_time[MAX_TIME_LENGTH] = {0}; 
    205228    char scratch_size[16] = {0}, scratch_inode[16] = {0}; 
    206229    char f_type = '-'; 
    207230    char group_x_char = '-'; 
     231    int num_bytes = 0; 
    208232 
    209233    if (!opts->list_all && (entry_name[0] == '.')) 
     
    215239        return; 
    216240    } 
     241 
    217242    mtime = (time_t)attr->mtime; 
    218243    time = localtime(&mtime); 
     244    if(opts->list_all_times) 
     245    { 
     246        atime = (time_t)attr->atime; 
     247        ctime = (time_t)attr->ctime; 
     248 
     249        num_bytes = strftime( scratch_time,ALL_TIMES_LENGTH+1,"%F %H:%M:%S %z",time ); 
     250        strncpy(scratch_big_time,scratch_time,num_bytes); 
     251 
     252        time = localtime(&atime); 
     253        num_bytes = strftime( scratch_time,ALL_TIMES_LENGTH+3,"  %F %H:%M:%S %z",time ); 
     254        strncat(scratch_big_time,scratch_time,num_bytes); 
     255 
     256        time = localtime(&ctime); 
     257        num_bytes = strftime( scratch_time,ALL_TIMES_LENGTH+3,"  %F %H:%M:%S %z",time ); 
     258        strncat(scratch_big_time,scratch_time,num_bytes); 
     259 
     260        format_size_string(scratch_big_time,strlen(scratch_big_time),&formatted_time,0,1); 
     261    } 
     262    else 
     263    { 
     264        strftime( scratch_time,17,"%F %H:%M",time ); 
     265        format_size_string(scratch_time,16,&formatted_time,0,1); 
     266    } 
    219267 
    220268    snprintf(scratch_owner,16,"%d",(int)attr->owner); 
     
    303351    } 
    304352 
    305     snprintf(buf,128,"%s%c%c%c%c%c%c%c%c%c%c    1 %s %s %s " 
    306              "%.4d-%.2d-%.2d %.2d:%.2d %s", 
     353    snprintf(entry_buffer,ENTRY_MAX,"%s%c%c%c%c%c%c%c%c%c%c    1 %s %s %s " 
     354             "%s %s", 
    307355             inode, 
    308356             f_type, 
     
    319367             formatted_group, 
    320368             formatted_size, 
    321              (time->tm_year + 1900), 
    322              (time->tm_mon + 1), 
    323              time->tm_mday, 
    324              (time->tm_hour), 
    325              (time->tm_min), 
     369             formatted_time, 
    326370             entry_name); 
    327371 
     
    338382        free(formatted_group); 
    339383    } 
     384    if (formatted_time) 
     385    { 
     386        free(formatted_time); 
     387    } 
    340388 
    341389    if (attr->objtype == PVFS_TYPE_SYMLINK) 
     
    345393        if (opts->list_long) 
    346394        { 
    347             printf("%s -> %s\n", buf, attr->link_target); 
     395            printf("%s -> %s\n", entry_buffer, attr->link_target); 
    348396        } 
    349397        else 
    350398        { 
    351             printf("%s\n",buf); 
     399            printf("%s\n",entry_buffer); 
    352400        } 
    353401    } 
    354402    else 
    355403    { 
    356         printf("%s\n",buf); 
     404        printf("%s\n",entry_buffer); 
    357405    } 
    358406} 
     
    364412    PVFS_sys_attr *attr, 
    365413    int attr_error, 
    366     struct options *opts) 
     414    struct options *opts, 
     415    char *entry_buffer) 
    367416{ 
    368417    int ret = -1; 
     
    406455                return; 
    407456            } 
    408             print_entry_attr(handle, entry_name,  &getattr_response.attr, opts); 
     457            print_entry_attr(handle, entry_name,  &getattr_response.attr, opts, entry_buffer); 
    409458        } 
    410459        else 
    411460        { 
    412             print_entry_attr(handle, entry_name, attr, opts); 
     461            print_entry_attr(handle, entry_name, attr, opts, entry_buffer); 
    413462        } 
    414463    } 
     
    426475    char *start, 
    427476    int fs_id, 
    428     struct options *opts) 
     477    struct options *opts, 
     478    char *entry_buffer) 
    429479{ 
    430480    int i = 0, printed_dot_info = 0; 
     
    495545            { 
    496546                print_entry_attr(ref.handle, segment, 
    497                                  &getattr_response.attr, opts); 
     547                                 &getattr_response.attr, opts, entry_buffer); 
    498548            } 
    499549            else 
     
    502552                        NULL, 
    503553                        0, 
    504                         opts); 
     554                        opts, entry_buffer); 
    505555            } 
    506556            return 0; 
     
    559609                    &rdplus_response.attr_array[i], 
    560610                    rdplus_response.stat_err_array[i], 
    561                     opts); 
     611                    opts, entry_buffer); 
    562612 
    563613            PVFS_sys_attr *attr = &rdplus_response.attr_array[i]; 
     
    640690        { 
    641691            printf("\n"); 
    642             do_list(full_path,current->path,fs_id,opts); 
     692            do_list(full_path,current->path,fs_id,opts,entry_buffer); 
    643693            current = current->next; 
    644694            free(head->path); 
     
    676726        {"inode",0,0,0}, 
    677727        {"size",0,0,0}, 
     728        {"all-times",0,0,0}, 
    678729        {0,0,0,0} 
    679730    }; 
     
    744795                { 
    745796                    goto list_inode; 
     797                } 
     798                else if (strcmp("all-times", cur_option) == 0) 
     799                { 
     800                    goto list_all_times; 
    746801                } 
    747802                else 
     
    796851                tmp_opts->list_inode = 1; 
    797852                break; 
     853          list_all_times: 
     854                tmp_opts->list_all_times = 1; 
     855                break; 
    798856            case 't': 
    799857                do_timing = 1; 
     
    845903    fprintf(stderr,"  -n, --numeric-uid-gid      like -l, but list " 
    846904            "numeric UIDs and GIDs\n"); 
     905    fprintf(stderr,"      --all-times            display atime, mtime," 
     906            " and ctime information\n"); 
    847907    fprintf(stderr,"  -o                         like -l, but do not " 
    848908            "list group information\n"); 
     
    867927    char current_dir[PVFS_NAME_MAX] = {0}; 
    868928    int found_one = 0; 
     929    char *entry_buffer = malloc(ENTRY_MAX); 
    869930 
    870931    process_name = argv[0]; 
    871  
    872932    user_opts = parse_args(argc, argv); 
    873933    if (!user_opts) 
     
    9601020        else /* Root directory case has nothing to match */ 
    9611021        { 
    962             substr = &user_opts->start[i][strlen(user_opts->start[i])-1]; 
     1022            substr = &user_opts->start[i][strlen(user_opts->start[i])]; 
    9631023        } 
    9641024 
     
    9721032        user_opts->start[i][++j] = '\0'; 
    9731033 
    974         do_list(user_opts->start[i], pvfs_path[i], fs_id_array[i], user_opts); 
     1034        do_list(user_opts->start[i], pvfs_path[i], fs_id_array[i], user_opts, entry_buffer); 
    9751035 
    9761036        if (user_opts->num_starts > 1) 
     
    9821042    PVFS_sys_finalize(); 
    9831043    free(user_opts); 
     1044    free(entry_buffer); 
    9841045 
    9851046    return(ret); 
  • branches/Orange-Branch/src/apps/admin/pvfs2-stat.c

    r7727 r8317  
    5555{ 
    5656   int               ret          = -1, 
     57                     ret_agg      =  0, 
    5758                     i            =  0; 
    5859   char           ** ppszPvfsPath = NULL; 
     
    146147         fprintf(stderr, "Error stating [%s]\n", user_opts.pszFiles[i]); 
    147148      } 
     149      ret_agg |= ret; 
    148150   } 
    149151 
     
    174176   } 
    175177 
    176    return(0); 
     178   return(ret_agg); 
    177179} 
    178180 
  • branches/Orange-Branch/src/apps/fuse/pvfs2fuse.c

    r7711 r8317  
    1010 *           Sumit Narayan 
    1111 * 
    12  *   $Date: 2009-03-06 13:54:32 $ 
    13  *   $Revision: 1.3 $ 
     12 *   $Date: 2010-04-30 20:00:42 $ 
     13 *   $Revision: 1.3.8.1 $ 
    1414 * 
    1515 *   Documentation: http://www.engr.uconn.edu/~sun03001/docs/pvfs2fuse-rpt.pdf 
    1616 */ 
    1717 
    18 /* char *pvfs2fuse_version = "$Id: pvfs2fuse.c,v 1.3 2009-03-06 13:54:32 slang Exp $"; */ 
     18/* char *pvfs2fuse_version = "$Id: pvfs2fuse.c,v 1.3.8.1 2010-04-30 20:00:42 bligon Exp $"; */ 
    1919char *pvfs2fuse_version = "0.01"; 
    2020 
     
    246246   pvfs_fuse_handle_t   pfh; 
    247247 
    248 /* sumit */ 
    249    system("echo 1 >> /tmp/abc"); 
    250  
    251248   ret = lookup( path, &pfh, PVFS2_LOOKUP_LINK_NO_FOLLOW ); 
    252249   if ( ret < 0 ) 
     
    646643   { 
    647644          PVFS_Request_free(&mem_req); 
    648 /* sumit */ 
    649    ret = PVFS_sys_flush(pfh->ref, &pfh->creds); 
    650  
    651    if(ret < 0) 
    652           return PVFS_ERROR_TO_ERRNO_N(ret); 
    653 /* end sumit */ 
    654645          return(resp_io.total_completed); 
    655646   } 
     
    716707   (void) isdatasync; 
    717708   (void) fi; 
    718  
    719 /* sumit */ 
    720    int ret; 
    721    pvfs_fuse_handle_t pfh; 
    722  
    723    ret = lookup(path, &pfh, PVFS2_LOOKUP_LINK_FOLLOW); 
    724    if(ret < 0) 
    725           return PVFS_ERROR_TO_ERRNO_N(ret); 
    726  
    727    ret = PVFS_sys_flush(pfh.ref, &pfh.creds); 
    728  
    729    if(ret < 0) 
    730           return PVFS_ERROR_TO_ERRNO_N(ret); 
    731 /* end sumit */ 
    732709 
    733710   return 0; 
  • branches/Orange-Branch/src/apps/kernel/linux/pvfs2-client-core.c

    r8251 r8317  
    131131  for the blocking ioctl. 
    132132*/ 
     133#define REMOUNT_NOTCOMPLETED    0 
     134#define REMOUNT_COMPLETED       1 
     135#define REMOUNT_FAILED          2 
    133136static pthread_t remount_thread; 
    134137static pthread_mutex_t remount_mutex = PTHREAD_MUTEX_INITIALIZER; 
    135 static int remount_complete = 0; 
     138static int remount_complete = REMOUNT_NOTCOMPLETED; 
     139 
    136140 
    137141/* used for generating unique dynamic mount point names */ 
     
    503507      upcalls for each fs mounted by the kernel at this point 
    504508     */ 
     509 
     510    /* if PINT_dev_remount fails set remount_complete appropriately */ 
    505511    if (PINT_dev_remount()) 
    506512    { 
    507513        gossip_err("*** Failed to remount filesystems!\n"); 
    508     } 
    509  
    510     remount_complete = 1; 
     514        remount_complete = REMOUNT_FAILED; 
     515    } 
     516    else 
     517    { 
     518        remount_complete = REMOUNT_COMPLETED; 
     519    } 
    511520    pthread_mutex_unlock(&remount_mutex); 
    512521 
     
    28432852    } 
    28442853 
    2845     if (!remount_complete && 
    2846         (vfs_request->in_upcall.type != PVFS2_VFS_OP_FS_MOUNT)) 
     2854    if (remount_complete == REMOUNT_NOTCOMPLETED && 
     2855        (vfs_request->in_upcall.type != PVFS2_VFS_OP_FS_MOUNT) &&  
     2856        (vfs_request->in_upcall.type != PVFS2_VFS_OP_CANCEL) ) 
    28472857    { 
    28482858        gossip_debug( 
     
    31243134        { 
    31253135            vfs_request = vfs_request_array[i]; 
     3136 
    31263137            assert(vfs_request); 
    31273138/*             assert(vfs_request->op_id == op_id_array[i]); */ 
     
    32703281            assert(ret == 0); 
    32713282        } 
     3283 
     3284        /* The status of the remount thread needs to be checked in the event  
     3285         * the remount fails on client-core startup. If this is the initial  
     3286         * startup then any mount requests will fail as expected and the  
     3287         * client-core will behave normally. However, if a mount was  
     3288         * previously successful (in a previous client-core incarnation)  
     3289         * client-core doesn't check if the remount succeeded before  
     3290         * handling the mount request and fs_add. Then any subsequent requests 
     3291         * cause this thread spins around PINT_dev_test_unexpected. 
     3292         * 
     3293         * With the current structure of process_vfs_request, creating the  
     3294         * remount thread before entering the while loop, it seems exiting  
     3295         * client-core on a failed remount attempt is the most staight forward  
     3296         * way to handle this case. Exiting will cause the parent to kickoff  
     3297         * another client-core and try the remount until it succeeds. 
     3298         */ 
     3299        if( remount_complete == REMOUNT_FAILED ) 
     3300        { 
     3301            gossip_debug(GOSSIP_CLIENTCORE_DEBUG, 
     3302                         "%s: remount not completed successfully, no longer " 
     3303                         "handling requests.\n", __func__); 
     3304            return -PVFS_EAGAIN;  
     3305        } 
    32723306    } 
    32733307 
     
    35803614    if (ret) 
    35813615    { 
    3582         gossip_err("Failed to process vfs requests!"); 
     3616        gossip_err("Failed to process vfs requests!\n"); 
    35833617    } 
    35843618 
    35853619    /* join remount thread; should be long done by now */ 
    3586     if (remount_complete) 
     3620    if (remount_complete == REMOUNT_COMPLETED ) 
    35873621    { 
    35883622        pthread_join(remount_thread, NULL); 
     
    36193653       PINT_sys_release(static_acache_timer_sm_p->sys_op_id); 
    36203654 
     3655    gossip_err("pvfs2-client-core shutting down.\n"); 
    36213656    if (PVFS_sys_finalize()) 
    36223657    { 
    3623         gossip_err("Failed to finalize PVFS\n"); 
    36243658        return 1; 
     3659    } 
     3660 
     3661    /* if failed remount tell the parent it's something we did wrong. */ 
     3662    if( remount_complete != REMOUNT_COMPLETED ) 
     3663    { 
     3664        return(-PVFS_EAGAIN); 
    36253665    } 
    36263666 
     
    36313671    } 
    36323672 
    3633     gossip_debug(GOSSIP_CLIENTCORE_DEBUG, "%s terminating\n", argv[0]); 
    36343673    return 0; 
    36353674} 
  • branches/Orange-Branch/src/apps/kernel/linux/pvfs2-client.c

    r7725 r8317  
    263263                    fprintf(stderr, "Device error caught, exiting now...\n"); 
    264264                    exit(1);         
     265                } 
     266 
     267                /* catch special case of exiting due to inability to remount */ 
     268                /* we want to try again in this case. */ 
     269                if (WEXITSTATUS(ret) == (unsigned char)-PVFS_EAGAIN) 
     270                { 
     271                    continue; 
    265272                } 
    266273 
  • branches/Orange-Branch/src/client/sysint/client-state-machine.c

    r8251 r8317  
    154154            if (user_ptr_array) 
    155155            { 
    156                 user_ptr_array[i] = (void *)sm_p->user_ptr; 
     156                /* if this smcb has been set cancelled and is a PVFS_SYS_IO 
     157                 * state machine then stick the user_ptr of the base frame 
     158                 * in to the user_ptr_array instead of the standard sm_p  
     159                 * user_ptr. This prevents segfaults back in  
     160                 * process_vfs_requests which expects the pointer to be a  
     161                 * vfs_request. 
     162                 */ 
     163                if( smcb->op_cancelled && smcb->op == PVFS_SYS_IO ) 
     164                { 
     165                    PINT_client_sm *sm_base_p = PINT_sm_frame(smcb, 
     166                                                 (-(smcb->frame_count -1))); 
     167                    assert(sm_base_p); 
     168                    gossip_debug(GOSSIP_CANCEL_DEBUG, "%s: assignment of " 
     169                                 "PVFS_SYS_IO user_ptr from sm_base_p(%p), " 
     170                                 "user_ptr(%p)\n", __func__, sm_base_p,  
     171                                 sm_base_p->user_ptr); 
     172                    user_ptr_array[i] = sm_base_p->user_ptr; 
     173                } 
     174                else 
     175                { 
     176                    user_ptr_array[i] = (void *)sm_p->user_ptr; 
     177                } 
    157178            } 
    158179            s_completion_list[i] = NULL; 
     
    188209    */ 
    189210    assert(sm_p); 
     211     
     212    PINT_client_sm *sm_base_p =  
     213        PINT_sm_frame(smcb, (-(smcb->frame_count -1))); 
     214 
     215    assert(sm_base_p); 
    190216 
    191217    /* 
     
    193219      completed and no job cancellation were issued at I/O cancel time 
    194220    */ 
    195     if (sm_p->u.io.total_cancellations_remaining > 0) 
    196     { 
    197         sm_p->u.io.total_cancellations_remaining--; 
     221    if (sm_base_p->u.io.total_cancellations_remaining > 0) 
     222    { 
     223        sm_base_p->u.io.total_cancellations_remaining--; 
    198224    } 
    199225 
    200226    gossip_debug( 
    201227        GOSSIP_IO_DEBUG, "(%p) cancelled_io_jobs_are_pending: %d " 
    202         "remaining (op %s)\n", sm_p, 
    203         sm_p->u.io.total_cancellations_remaining, 
     228        "remaining (op %s)\n", sm_base_p, 
     229        sm_base_p->u.io.total_cancellations_remaining, 
    204230        (PINT_smcb_complete(smcb) ? "complete" : "NOT complete")); 
    205231 
    206     return (sm_p->u.io.total_cancellations_remaining != 0); 
     232    return (sm_base_p->u.io.total_cancellations_remaining != 0); 
    207233} 
    208234 
     
    313339                 "client_state_machine_terminate smcb %p\n",smcb); 
    314340 
    315     PINT_EVENT_END(PINT_client_sys_event_id, pint_client_pid, NULL, sm_p->event_id, 0); 
    316  
    317     PVFS_hint_free(sm_p->hints); 
    318  
    319341    if (!((PINT_smcb_op(smcb) == PVFS_SYS_IO) && 
    320342            (PINT_smcb_cancelled(smcb)) && 
     
    322344        !PINT_smcb_immediate_completion(smcb)) 
    323345    { 
     346        gossip_debug(GOSSIP_CLIENT_DEBUG, 
     347                 "client_state_machine_terminate smcb %p completing\n",smcb); 
     348 
     349        PINT_EVENT_END(PINT_client_sys_event_id, pint_client_pid, NULL, sm_p->event_id, 0); 
     350        PVFS_hint_free(sm_p->hints); 
     351        sm_p->hints = NULL; 
     352 
    324353        gossip_debug(GOSSIP_CLIENT_DEBUG,  
    325354                "add smcb %p to completion list\n", smcb); 
    326355        ret = add_sm_to_completion_list(smcb); 
    327356        assert(ret == 0); 
     357    } 
     358    else 
     359    { 
     360        gossip_debug(GOSSIP_CLIENT_DEBUG, 
     361                 "client_state_machine_terminate smcb %p waiting for cancelled jobs\n",smcb); 
    328362    } 
    329363    return SM_ACTION_TERMINATE; 
     
    506540        return 0; 
    507541    } 
    508     
     542     
    509543    /* We also don't cancel small I/O operations as posted by 
    510544     * sys-small-io.sm.  Check the corresponding flag.  We have  
    511545     * to jump to the base frame rather than the current frame for this 
    512546     * information because small-io may have pushed a msgpairarray. 
     547     * 
     548     * sm_base_p is used below instead of sm_p since it contains the correct 
     549     * counters and context pointers. In the event the control block only 
     550     * has one frame it behaves as it did previously. If the cancellation is  
     551     * occuring when a non-IO frame has been pushed on the stack, which doesn't 
     552     * have the expected structure, it doesn't cause a segfault but leaves 
     553     * it on the state machines stack. 
    513554     */  
    514555    sm_base_p = PINT_sm_frame(smcb, (-(smcb->frame_count -1))); 
     556    assert(sm_base_p); 
    515557    if(sm_base_p->u.io.small_io) 
    516558    { 
     
    532574 
    533575    /* now run through and cancel the outstanding jobs */ 
    534     for(i = 0; i < sm_p->u.io.context_count; i++) 
    535     { 
    536         PINT_client_io_ctx *cur_ctx = &sm_p->u.io.contexts[i]; 
     576    for(i = 0; i < sm_base_p->u.io.context_count; i++) 
     577    { 
     578        PINT_client_io_ctx *cur_ctx = &sm_base_p->u.io.contexts[i]; 
    537579        assert(cur_ctx); 
    538580 
     
    550592                break; 
    551593            } 
    552             sm_p->u.io.total_cancellations_remaining++; 
     594            sm_base_p->u.io.total_cancellations_remaining++; 
    553595        } 
    554596 
     
    566608                break; 
    567609            } 
    568             sm_p->u.io.total_cancellations_remaining++; 
     610            sm_base_p->u.io.total_cancellations_remaining++; 
    569611        } 
    570612 
     
    581623                break; 
    582624            } 
    583             sm_p->u.io.total_cancellations_remaining++; 
     625            sm_base_p->u.io.total_cancellations_remaining++; 
    584626        } 
    585627 
     
    597639                break; 
    598640            } 
    599             sm_p->u.io.total_cancellations_remaining++; 
     641            sm_base_p->u.io.total_cancellations_remaining++; 
    600642        } 
    601643    } 
    602644    gossip_debug(GOSSIP_CANCEL_DEBUG, "(%p) Total cancellations " 
    603                  "remaining: %d\n", sm_p, 
    604                  sm_p->u.io.total_cancellations_remaining); 
     645                 "remaining: %d\n", sm_base_p, 
     646                 sm_base_p->u.io.total_cancellations_remaining); 
    605647    return ret; 
    606648} 
  • branches/Orange-Branch/src/client/sysint/client-state-machine.h

    r8251 r8317  
    421421    PVFS_BMI_addr_t *addr_array; 
    422422    char **fs_config_bufs; 
    423     int32_t *fs_config_buf_size; 
     423    int *fs_config_buf_size; 
     424    int result_count; /* number of servers that actually responded */ 
     425    int* result_indexes; /* index into fs_config_bufs of valid responses */ 
    424426}; 
    425427 
     
    700702    PVFS_MGMT_GET_DIRDATA_HANDLE   = 80, 
    701703    PVFS_SERVER_GET_CONFIG         = 200, 
    702     PVFS_SERVER_FETCH_CONFIG         = 201, 
    703704    PVFS_CLIENT_JOB_TIMER          = 300, 
    704705    PVFS_CLIENT_PERF_COUNT_TIMER   = 301, 
  • branches/Orange-Branch/src/client/sysint/fs-add.sm

    r6984 r8317  
    4545extern job_context_id pint_client_sm_context; 
    4646 
     47static int server_fetch_config_comp_fn( 
     48    void *v_p, struct PVFS_server_resp *resp_p, int i); 
     49 
    4750%% 
    4851 
     
    7477    { 
    7578        jump pvfs2_server_fetch_config_nested_sm; 
     79        default => compare_hashes; 
     80    } 
     81 
     82    state compare_hashes 
     83    { 
     84        run fs_add_compare_hashes; 
    7685        default => final_cleanup; 
    7786    } 
     
    8190        run fs_add_final_cleanup; 
    8291        default => terminate; 
     92    } 
     93} 
     94 
     95nested machine pvfs2_server_fetch_config_nested_sm 
     96{ 
     97    state fetch_setup_msgpair 
     98    { 
     99        run server_fetch_config_setup_msgpair; 
     100        success => fetch_xfer_msgpair; 
     101        default => fetch_cleanup; 
     102    } 
     103 
     104    state fetch_xfer_msgpair 
     105    { 
     106        jump pvfs2_msgpairarray_sm; 
     107        default => fetch_cleanup; 
     108    } 
     109 
     110    state fetch_cleanup 
     111    { 
     112        run server_fetch_config_cleanup; 
     113        default => return; 
    83114    } 
    84115} 
     
    321352        return SM_ACTION_COMPLETE; 
    322353    } 
     354 
     355    sm_p->fetch_config.result_indexes = (int*)calloc(count, 
     356        sizeof(int)); 
     357    if(sm_p->fetch_config.result_indexes == NULL) 
     358    { 
     359        free(sm_p->fetch_config.addr_array); 
     360        sm_p->fetch_config.addr_array = NULL; 
     361        free(sm_p->fetch_config.fs_config_bufs); 
     362        sm_p->fetch_config.fs_config_bufs = NULL; 
     363        free(sm_p->fetch_config.fs_config_buf_size); 
     364        sm_p->fetch_config.fs_config_buf_size = NULL; 
     365        free(sm_p->fetch_config.result_indexes); 
     366        sm_p->fetch_config.result_indexes = NULL; 
     367        js_p->error_code = -PVFS_ENOMEM; 
     368        return SM_ACTION_COMPLETE; 
     369    } 
     370 
    323371    js_p->error_code = 0; 
    324372    return SM_ACTION_COMPLETE; 
     
    348396    size_t digest_len; 
    349397    PVFS_fs_id fsid; 
    350  
    351     assert(js_p->error_code == 0); 
     398    int* indexes = sm_p->fetch_config.result_indexes; 
     399 
     400    count = sm_p->fetch_config.result_count; 
     401    if(count < 2) 
     402    { 
     403        /* nothing to compare */ 
     404        goto out; 
     405    } 
     406 
    352407    fsid = sm_p->u.get_config.mntent->fs_id; 
    353     count = sm_p->fetch_config.nservers; 
    354408    sha1_fs_digests = (char **) calloc(count, sizeof(char *)); 
    355409    if (sha1_fs_digests == NULL) 
     
    360414    for (i = 1; i < count; i++) 
    361415    { 
    362         if (sm_p->fetch_config.fs_config_buf_size[0] != sm_p->fetch_config.fs_config_buf_size[i]) 
     416        if (sm_p->fetch_config.fs_config_buf_size[indexes[0]] != 
     417            sm_p->fetch_config.fs_config_buf_size[indexes[i]]) 
    363418        { 
    364419            fs_conf_size_mismatch = 1; 
     
    371426        { 
    372427            gossip_err("     FS config file on %s -> (size) %d\n",  
    373                    PVFS_mgmt_map_addr(fsid, sm_p->cred_p, sm_p->fetch_config.addr_array[i], &tmp), 
    374                    sm_p->fetch_config.fs_config_buf_size[i] - 1); 
     428                   PVFS_mgmt_map_addr(fsid, sm_p->cred_p, 
     429                   sm_p->fetch_config.addr_array[indexes[i]], &tmp), 
     430                   sm_p->fetch_config.fs_config_buf_size[indexes[i]] - 1); 
    375431            ret = -PVFS_EINVAL; 
    376432        } 
     
    379435    for (i = 0; i < count; i++) 
    380436    { 
    381         ret = PINT_util_digest_sha1(sm_p->fetch_config.fs_config_bufs[i],  
    382                                     sm_p->fetch_config.fs_config_buf_size[i], 
     437        ret = 
     438        PINT_util_digest_sha1(sm_p->fetch_config.fs_config_bufs[indexes[i]],  
     439                                    sm_p->fetch_config.fs_config_buf_size[indexes[i]], 
    383440                                    &sha1_fs_digests[i], &digest_len); 
    384441        if (ret < 0) 
     
    401458            hash2str((unsigned char *) sha1_fs_digests[i], digest_len, str); 
    402459            gossip_err("     FS config file on %s -> (SHA1) %s\n",  
    403                    PVFS_mgmt_map_addr(fsid, sm_p->cred_p, sm_p->fetch_config.addr_array[i], &tmp), str); 
     460                   PVFS_mgmt_map_addr(fsid, sm_p->cred_p, 
     461                   sm_p->fetch_config.addr_array[indexes[i]], &tmp), str); 
    404462        } 
    405463        ret = -PVFS_EINVAL; 
     
    419477    free(sm_p->fetch_config.fs_config_bufs); 
    420478    sm_p->fetch_config.fs_config_bufs = NULL; 
     479    free(sm_p->fetch_config.result_indexes); 
     480    sm_p->fetch_config.result_indexes = NULL; 
    421481    free(sm_p->fetch_config.fs_config_buf_size); 
    422482    sm_p->fetch_config.fs_config_buf_size = NULL; 
     
    527587} 
    528588 
     589static PINT_sm_action fs_add_compare_hashes( 
     590    struct PINT_smcb *smcb, job_status_s *js_p) 
     591{ 
     592    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
     593 
     594    if (js_p->error_code == SKIP_INTEGRITY_CHECK) 
     595        js_p->error_code = 0; 
     596    else 
     597    { 
     598        compare_hashes(sm_p, js_p); 
     599    } 
     600 
     601    return SM_ACTION_COMPLETE; 
     602} 
     603 
    529604static PINT_sm_action fs_add_final_cleanup( 
    530605    struct PINT_smcb *smcb, job_status_s *js_p) 
    531606{ 
    532607    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
     608    if(sm_p->u.get_config.free_config_flag) 
     609    { 
     610        PINT_config_release(sm_p->u.get_config.config); 
     611        free(sm_p->u.get_config.config); 
     612    } 
    533613    if (js_p->error_code == SKIP_INTEGRITY_CHECK) 
    534614        js_p->error_code = 0; 
    535     else if (js_p->error_code == 0) 
    536     { 
    537         compare_hashes(sm_p, js_p); 
    538     } 
    539     if(sm_p->u.get_config.free_config_flag) 
    540     { 
    541         PINT_config_release(sm_p->u.get_config.config); 
    542         free(sm_p->u.get_config.config); 
    543     } 
    544615    sm_p->error_code = js_p->error_code; 
    545616    PINT_SET_OP_COMPLETE; 
    546617    return SM_ACTION_TERMINATE; 
     618} 
     619 
     620static PINT_sm_action server_fetch_config_setup_msgpair(struct PINT_smcb *smcb, 
     621                                           job_status_s *js_p) 
     622{ 
     623    int i; 
     624    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
     625    PINT_sm_msgpair_state *msg_p = NULL; 
     626 
     627    gossip_debug(GOSSIP_CLIENT_DEBUG, 
     628                "fetch_config state: server_fetch_config_setup_msgpair\n"); 
     629 
     630    foreach_msgpair(&sm_p->msgarray_op, msg_p, i) 
     631    { 
     632        sm_p->msgarray_op.msgarray[i].enc_type = sm_p->msgarray_op.msgpair.enc_type; 
     633        PINT_SERVREQ_GETCONFIG_FILL(msg_p->req, *sm_p->cred_p, sm_p->hints); 
     634 
     635        msg_p->fs_id = PVFS_FS_ID_NULL; 
     636        msg_p->handle = PVFS_HANDLE_NULL; 
     637        /* only try once to retrieve a config file from each server */ 
     638        msg_p->retry_flag = PVFS_MSGPAIR_NO_RETRY; 
     639        msg_p->comp_fn = server_fetch_config_comp_fn; 
     640        msg_p->svr_addr = sm_p->fetch_config.addr_array[i]; 
     641    } 
     642    /* don't complain so much about servers we can't reach yet */ 
     643    sm_p->msgarray_op.params.quiet_flag = 1;  
     644 
     645    js_p->error_code = 0; 
     646 
     647    PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op); 
     648    return SM_ACTION_COMPLETE; 
     649} 
     650 
     651static PINT_sm_action server_fetch_config_cleanup(struct PINT_smcb *smcb, 
     652                                    job_status_s *js_p) 
     653{ 
     654    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
     655    PINT_msgpairarray_destroy(&sm_p->msgarray_op); 
     656    /* preserve js_p->error_code */ 
     657 
     658    return SM_ACTION_COMPLETE; 
     659} 
     660 
     661static int server_fetch_config_comp_fn( 
     662    void *v_p, 
     663    struct PVFS_server_resp *resp_p, 
     664    int i) 
     665{ 
     666    PINT_smcb *smcb = v_p; 
     667    PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM); 
     668    int j; 
     669 
     670    /* if this particular request was successful, then store the server 
     671     * response and let the caller sort it out */ 
     672 
     673    if (sm_p->msgarray_op.msgarray[i].op_status == 0) 
     674    { 
     675        sm_p->fetch_config.fs_config_bufs[i] =  
     676                strdup(resp_p->u.getconfig.fs_config_buf); 
     677        sm_p->fetch_config.fs_config_buf_size[i] =  
     678                resp_p->u.getconfig.fs_config_buf_size; 
     679    } 
     680 
     681    /* is this this last response? */ 
     682    if (i == (sm_p->msgarray_op.count -1)) 
     683    { 
     684        /* look through responses, count the number of valid responses we 
     685         * received, and mark where they are in the array 
     686         */ 
     687        sm_p->fetch_config.result_count = 0; 
     688        for(j=0; j<sm_p->msgarray_op.count; j++) 
     689        { 
     690            if(sm_p->msgarray_op.msgarray[j].op_status == 0) 
     691            { 
     692                sm_p->fetch_config.result_indexes[sm_p->fetch_config.result_count] 
     693                    = j; 
     694                sm_p->fetch_config.result_count++; 
     695            } 
     696        } 
     697        if(sm_p->fetch_config.result_count > 0) 
     698        { 
     699            /* we got at least one config file */ 
     700            return(0); 
     701        } 
     702        else 
     703        { 
     704            /* pick an error code */ 
     705            return PINT_msgarray_status(&sm_p->msgarray_op); 
     706        } 
     707    } 
     708    return 0; 
    547709} 
    548710 
  • branches/Orange-Branch/src/client/sysint/initialize.c

    r7489 r8317  
    128128        goto error_exit; 
    129129    } 
     130    client_status_flag |= CLIENT_DIST_INIT; 
    130131     
    131132    /* initlialize the protocol encoder */ 
  • branches/Orange-Branch/src/client/sysint/server-get-config.sm

    r7471 r8317  
    2828    void *v_p, struct PVFS_server_resp *resp_p, int i); 
    2929 
    30 static int server_fetch_config_comp_fn( 
    31     void *v_p, struct PVFS_server_resp *resp_p, int i); 
    32  
    3330%% 
    3431 
     
    7370    { 
    7471        run server_get_config_parent_cleanup; 
    75         default => terminate; 
    76     } 
    77 } 
    78  
    79 nested machine pvfs2_server_fetch_config_nested_sm 
    80 { 
    81     state fetch_setup_msgpair 
    82     { 
    83         run server_fetch_config_setup_msgpair; 
    84         success => fetch_xfer_msgpair; 
    85         default => fetch_cleanup; 
    86     } 
    87  
    88     state fetch_xfer_msgpair 
    89     { 
    90         jump pvfs2_msgpairarray_sm; 
    91         default => fetch_cleanup; 
    92     } 
    93  
    94     state fetch_cleanup 
    95     { 
    96         run server_fetch_config_cleanup; 
    97         default => return; 
    98     } 
    99 } 
    100  
    101 machine pvfs2_server_fetch_config_sm 
    102 { 
    103     state run_fetch_nested  
    104     { 
    105         jump pvfs2_server_fetch_config_nested_sm; 
    106         default => parent_fetch_cleanup; 
    107     } 
    108  
    109     state parent_fetch_cleanup 
    110     { 
    111         run server_fetch_config_parent_cleanup; 
    11272        default => terminate; 
    11373    } 
     
    407367    return 0; 
    408368} 
    409  
    410 /* 
    411  * Force a fetch the configuration file from a given set of servers 
    412  * This is different from get_config() in that we do not depend on the 
    413  * configuration server specified in the mnt tab file 
    414  * Assumes that servers specified in the array are unique! 
    415  * CURRENTLY UNUSED 
    416  */ 
    417 #ifdef __GNUC__ 
    418 static int PINT_fetch_config_list(int nservers, PVFS_BMI_addr_t *servers, 
    419                 char **fs_config_bufs, int *fs_config_buf_size) __attribute__((unused)); 
    420 #endif 
    421  
    422 static int PINT_fetch_config_list(int nservers, PVFS_BMI_addr_t *servers, 
    423                 char **fs_config_bufs, int *fs_config_buf_size) 
    424 { 
    425     int ret = -PVFS_EINVAL; 
    426     PINT_smcb *smcb = NULL; 
    427     PINT_client_sm *sm_p = NULL; 
    428     PVFS_error error = 0; 
    429     PVFS_credentials creds; 
    430     PVFS_sys_op_id op_id; 
    431  
    432     gossip_debug(GOSSIP_CLIENT_DEBUG, 
    433                  "PINT_fetch_config_list entered\n"); 
    434     if (nservers < 0 || !servers || !fs_config_bufs || !fs_config_buf_size) 
    435     { 
    436         return ret; 
    437     } 
    438  
    439     PVFS_util_gen_credentials(&creds); 
    440     PINT_smcb_alloc(&smcb, PVFS_SERVER_FETCH_CONFIG, 
    441              sizeof(struct PINT_client_sm), 
    442              client_op_state_get_machine, 
    443              client_state_machine_terminate, 
    444              pint_client_sm_context); 
    445     if (smcb == NULL) 
    446     { 
    447         return -PVFS_ENOMEM; 
    448     } 
    449     sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    450  
    451     /* NOTE: we set these fields manually here rather than use 
    452      * PINT_init_msgarray_params(), because we don't yet have a server 
    453      * configuration file to override default parameters. 
    454      */ 
    455     sm_p->msgarray_op.params.job_context = pint_client_sm_context; 
    456     sm_p->msgarray_op.params.job_timeout = 30;   /* 30 second job timeout */ 
    457     sm_p->msgarray_op.params.retry_delay = 2000; /* 2 second retry delay */ 
    458     sm_p->msgarray_op.params.retry_limit = 5;    /* retry up to 5 times */ 
    459     PINT_init_sysint_credentials(sm_p->cred_p, &creds); 
    460     sm_p->fetch_config.nservers = nservers; 
    461     sm_p->fetch_config.addr_array = servers; 
    462     sm_p->fetch_config.fs_config_bufs = fs_config_bufs; 
    463     sm_p->fetch_config.fs_config_buf_size = fs_config_buf_size; 
    464  
    465     ret = PINT_msgpairarray_init(&sm_p->msgarray_op, nservers); 
    466     if(ret != 0) 
    467     { 
    468         PINT_smcb_free(smcb); 
    469         return ret; 
    470     } 
    471  
    472     ret = PINT_client_state_machine_post( 
    473         smcb, &op_id, NULL); 
    474     if (ret) 
    475     { 
    476         PVFS_perror_gossip("PINT_client_state_machine_post call", ret); 
    477         error = ret; 
    478     } 
    479     else 
    480     { 
    481         ret = PVFS_sys_wait(op_id, "X-fetch_config", &error); 
    482         if (ret) 
    483         { 
    484             PVFS_perror_gossip("PVFS_sys_wait call", ret); 
    485             error = ret; 
    486         } 
    487     } 
    488  
    489     PINT_sys_release(op_id); 
    490     return(error); 
    491 } 
    492  
    493 static PINT_sm_action server_fetch_config_setup_msgpair(struct PINT_smcb *smcb, 
    494                                            job_status_s *js_p) 
    495 { 
    496     int i; 
    497     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    498     PINT_sm_msgpair_state *msg_p = NULL; 
    499  
    500     gossip_debug(GOSSIP_CLIENT_DEBUG, 
    501                 "fetch_config state: server_fetch_config_setup_msgpair\n"); 
    502  
    503     foreach_msgpair(&sm_p->msgarray_op, msg_p, i) 
    504     { 
    505         sm_p->msgarray_op.msgarray[i].enc_type = sm_p->msgarray_op.msgpair.enc_type; 
    506         PINT_SERVREQ_GETCONFIG_FILL(msg_p->req, *sm_p->cred_p, sm_p->hints); 
    507  
    508         msg_p->fs_id = PVFS_FS_ID_NULL; 
    509         msg_p->handle = PVFS_HANDLE_NULL; 
    510         msg_p->retry_flag = PVFS_MSGPAIR_RETRY; 
    511         msg_p->comp_fn = server_fetch_config_comp_fn; 
    512         msg_p->svr_addr = sm_p->fetch_config.addr_array[i]; 
    513     } 
    514  
    515     js_p->error_code = 0; 
    516  
    517     PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op); 
    518     return SM_ACTION_COMPLETE; 
    519 } 
    520  
    521 static PINT_sm_action server_fetch_config_cleanup(struct PINT_smcb *smcb, 
    522                                     job_status_s *js_p) 
    523 { 
    524     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    525     PINT_msgpairarray_destroy(&sm_p->msgarray_op); 
    526     /* preserve js_p->error_code */ 
    527  
    528     return SM_ACTION_COMPLETE; 
    529 } 
    530  
    531 static int server_fetch_config_comp_fn( 
    532     void *v_p, 
    533     struct PVFS_server_resp *resp_p, 
    534     int i) 
    535 { 
    536     PINT_smcb *smcb = v_p; 
    537     PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM); 
    538  
    539     /* if this particular request was successful, then store the server 
    540      * response and let the caller sort it out */ 
    541  
    542     if (sm_p->msgarray_op.msgarray[i].op_status == 0) 
    543     { 
    544         sm_p->fetch_config.fs_config_bufs[i] =  
    545                 strdup(resp_p->u.getconfig.fs_config_buf); 
    546         sm_p->fetch_config.fs_config_buf_size[i] =  
    547                 resp_p->u.getconfig.fs_config_buf_size; 
    548     } 
    549  
    550     /* if this is the last response, check all of the status values 
    551      * and return error code if any requests failed 
    552      */ 
    553     if (i == (sm_p->msgarray_op.count -1)) 
    554     { 
    555         return PINT_msgarray_status(&sm_p->msgarray_op); 
    556     } 
    557     return 0; 
    558 } 
    559  
    560 static PINT_sm_action server_fetch_config_parent_cleanup(struct PINT_smcb *smcb, 
    561                                     job_status_s *js_p) 
    562 { 
    563     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    564     sm_p->error_code  = js_p->error_code; 
    565     PINT_SET_OP_COMPLETE; 
    566     return SM_ACTION_DEFERRED; 
    567 } 
    568369         
    569370/* 
  • branches/Orange-Branch/src/client/sysint/sys-create.sm

    r7622 r8317  
    803803     */ 
    804804 
    805     if(sm_p->u.create.user_requested_num_data_files > 1) 
     805    if(sm_p->u.create.user_requested_num_data_files > 0) 
    806806    { 
    807807        /* specified by sys_create caller */ 
  • branches/Orange-Branch/src/client/sysint/sys-io.sm

    r8251 r8317  
    515515                sm_p->object_ref.handle, 
    516516                IO_ATTR_MASKS, 
    517 //                0, 
    518517                sm_p->hints); 
    519518    } 
  • branches/Orange-Branch/src/client/sysint/sys-truncate.sm

    r7471 r8317  
    154154        PVFS_ATTR_META_ALL|PVFS_ATTR_COMMON_TYPE, 
    155155        PVFS_TYPE_METAFILE, 
    156         0); 
     156        PINT_SM_GETATTR_BYPASS_CACHE); 
    157157 
    158158    return PINT_client_state_machine_post( 
     
    314314    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    315315 
     316    /* check for write access */ 
     317    js_p->error_code = PINT_check_mode( 
     318        &sm_p->getattr.attr, sm_p->cred_p->uid, sm_p->cred_p->gid, PINT_ACCESS_WRITABLE); 
     319    if(js_p->error_code) 
     320    { 
     321        return 1; 
     322    } 
     323 
    316324    /* determine if we need to unstuff or not to service this request */ 
    317325    if(unstuff_needed( 
  • branches/Orange-Branch/src/common/gossip/gossip.c

    r7528 r8317  
    480480            gettimeofday(&tv, 0); 
    481481            tp = tv.tv_sec; 
    482             strftime(bptr, 14, "%m/%d %H:%M] ", localtime(&tp)); 
    483             bptr += 13; 
    484             bsize -= 13; 
     482            strftime(bptr, 22, "%m/%d/%Y %H:%M:%S] ", localtime(&tp)); 
     483            bptr += 21; 
     484            bsize -= 21; 
    485485            break; 
    486486        case GOSSIP_LOGSTAMP_THREAD: 
  • branches/Orange-Branch/src/common/misc/pint-hint.c

    r7633 r8317  
    565565    while(h) 
    566566    { 
    567         if(!strcmp(hint->type_string, name)) 
     567        if(!strcmp(h->type_string, name)) 
    568568        { 
    569569            if(length) 
  • branches/Orange-Branch/src/common/misc/pint-util.c

    r7968 r8317  
    1818#include <unistd.h> 
    1919 
     20#include <grp.h> 
     21#include <pwd.h> 
     22#include <sys/types.h> 
     23 
    2024#define __PINT_REQPROTO_ENCODE_FUNCS_C 
    2125#include "gen-locks.h" 
     
    2428#include "gossip.h" 
    2529#include "pvfs2-req-proto.h" 
     30 
     31#include "pvfs2-debug.h" 
     32#include "bmi-byteswap.h" 
     33 
     34#ifdef HAVE_GETPWUID 
     35static gen_mutex_t check_group_mutex = GEN_MUTEX_INITIALIZER; 
     36static int pw_buf_size = 1024;      // 1 KB 
     37static int gr_buf_size = 1024*1024; // 1 MB 
     38static char* check_group_pw_buffer = NULL; 
     39static char* check_group_gr_buffer = NULL; 
     40#endif 
     41static int PINT_check_group(uid_t uid, gid_t gid); 
    2642 
    2743void PINT_time_mark(PINT_time_marker *out_marker) 
     
    542558} 
    543559 
     560/* PINT_check_mode() 
     561 * 
     562 * checks to see if the type of access described by "access_type" is permitted  
     563 * for user "uid" of group "gid" on the object with attributes "attr" 
     564 * 
     565 * returns 0 on success, -PVFS_EACCES if permission is not granted 
     566 */ 
     567int PINT_check_mode( 
     568    PVFS_object_attr *attr, 
     569    PVFS_uid uid, PVFS_gid gid, 
     570    enum PINT_access_type access_type) 
     571{ 
     572    int in_group_flag = 0; 
     573    int ret = 0; 
     574 
     575    /* if we don't have masks for the permission information that we 
     576     * need, then the system is broken 
     577     */ 
     578    assert(attr->mask & PVFS_ATTR_COMMON_UID && 
     579           attr->mask & PVFS_ATTR_COMMON_GID && 
     580           attr->mask & PVFS_ATTR_COMMON_PERM); 
     581    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - check_mode called --- " 
     582                 "(uid=%d,gid=%d,access_type=%d)\n", uid, gid, access_type); 
     583    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - object attributes --- " 
     584                 "(uid=%d,gid=%d,mode=%d)\n", attr->owner, attr->group, 
     585                 attr->perms); 
     586 
     587    /* give root permission, no matter what */ 
     588    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, 
     589                 " - checking if uid (%d) is root ...\n", uid); 
     590    if (uid == 0) 
     591    { 
     592        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     593        return 0; 
     594    } 
     595    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     596 
     597    /* see if uid matches object owner */ 
     598    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - checking if owner (%d) " 
     599        "matches uid (%d)...\n", attr->owner, uid); 
     600    if(attr->owner == uid) 
     601    { 
     602        /* see if object user permissions match access type */ 
     603        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     604        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - checking if permissions " 
     605            "(%d) allows access type (%d) for user...\n", attr->perms, access_type); 
     606        if(access_type == PINT_ACCESS_READABLE && (attr->perms & 
     607            PVFS_U_READ)) 
     608        { 
     609            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     610            return(0); 
     611        } 
     612        if(access_type == PINT_ACCESS_WRITABLE && (attr->perms & 
     613            PVFS_U_WRITE)) 
     614        { 
     615            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     616            return(0); 
     617        } 
     618        if(access_type == PINT_ACCESS_EXECUTABLE && (attr->perms & 
     619            PVFS_U_EXECUTE)) 
     620        { 
     621            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     622            return(0); 
     623        } 
     624        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     625    } 
     626    else 
     627    { 
     628        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     629    } 
     630 
     631    /* see if other bits allow access */ 
     632    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - checking if permissions " 
     633        "(%d) allows access type (%d) by others...\n", attr->perms, access_type); 
     634    if(access_type == PINT_ACCESS_READABLE && (attr->perms & 
     635        PVFS_O_READ)) 
     636    { 
     637        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     638        return(0); 
     639    } 
     640    if(access_type == PINT_ACCESS_WRITABLE && (attr->perms & 
     641        PVFS_O_WRITE)) 
     642    { 
     643        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     644        return(0); 
     645    } 
     646    if(access_type == PINT_ACCESS_EXECUTABLE && (attr->perms & 
     647        PVFS_O_EXECUTE)) 
     648    { 
     649        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     650        return(0); 
     651    } 
     652    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     653 
     654    /* see if gid matches object group */ 
     655    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - checking if group (%d) " 
     656        "matches gid (%d)...\n", attr->group, gid); 
     657    if(attr->group == gid) 
     658    { 
     659        /* default group match */ 
     660        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     661        in_group_flag = 1; 
     662    } 
     663    else 
     664    { 
     665        /* no default group match, check supplementary groups */ 
     666        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     667        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - checking for" 
     668            " supplementary group match...\n"); 
     669        ret = PINT_check_group(uid, attr->group); 
     670        if(ret == 0) 
     671        { 
     672            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     673            in_group_flag = 1; 
     674        } 
     675        else 
     676        { 
     677            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     678            if(ret != -PVFS_ENOENT) 
     679            { 
     680                /* system error; not just failed match */ 
     681                return(ret); 
     682            } 
     683        } 
     684    } 
     685 
     686    if(in_group_flag) 
     687    { 
     688        /* see if object group permissions match access type */ 
     689        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - checking if permissions " 
     690            "(%d) allows access type (%d) for group...\n", attr->perms, access_type); 
     691        if(access_type == PINT_ACCESS_READABLE && (attr->perms & 
     692            PVFS_G_READ)) 
     693        { 
     694            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     695            return(0); 
     696        } 
     697        if(access_type == PINT_ACCESS_WRITABLE && (attr->perms & 
     698            PVFS_G_WRITE)) 
     699        { 
     700            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     701            return(0); 
     702        } 
     703        if(access_type == PINT_ACCESS_EXECUTABLE && (attr->perms & 
     704            PVFS_G_EXECUTE)) 
     705        { 
     706            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - yes\n"); 
     707            return(0); 
     708        } 
     709        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, " - no\n"); 
     710    } 
     711   
     712    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "******PINT_check_mode: denying access\n"); 
     713    /* default case: access denied */ 
     714    return -PVFS_EACCES; 
     715} 
     716 
     717/* PINT_check_group() 
     718 * 
     719 * checks to see if uid is a member of gid 
     720 *  
     721 * returns 0 on success, -PVFS_ENOENT if not a member, other PVFS error codes 
     722 * on system failure 
     723 */ 
     724static int PINT_check_group(uid_t uid, gid_t gid) 
     725{ 
     726#ifdef HAVE_GETPWUID 
     727    struct passwd pwd; 
     728    struct passwd* pwd_p = NULL; 
     729    struct group grp; 
     730    struct group* grp_p = NULL; 
     731    int i = 0; 
     732    int ret = -1; 
     733 
     734    /* Explanation:  
     735     * 
     736     * We use the _r variants of getpwuid and getgrgid in order to insure 
     737     * thread safety; particularly if this function ever gets called in a 
     738     * client side situation in which we can't prevent the application from 
     739     * making conflicting calls. 
     740     * 
     741     * These _r functions require that a buffer be supplied for the user and 
     742     * group information, however.  These buffers may be unconfortably large 
     743     * for the stack, so we malloc them on a static pointer and then mutex 
     744     * lock this function so that it can still be reentrant. 
     745     */ 
     746 
     747    gen_mutex_lock(&check_group_mutex); 
     748 
     749    if(!check_group_pw_buffer) 
     750    { 
     751        check_group_pw_buffer = (char*)malloc(pw_buf_size); 
     752        check_group_gr_buffer = (char*)malloc(gr_buf_size); 
     753        if(!check_group_pw_buffer || !check_group_gr_buffer) 
     754        { 
     755            if(check_group_pw_buffer) 
     756            { 
     757                free(check_group_pw_buffer); 
     758                check_group_pw_buffer = NULL; 
     759            } 
     760            if(check_group_gr_buffer) 
     761            { 
     762                free(check_group_gr_buffer); 
     763                check_group_gr_buffer = NULL; 
     764            } 
     765            gen_mutex_unlock(&check_group_mutex); 
     766            return(-PVFS_ENOMEM); 
     767        } 
     768    } 
     769 
     770    /* get user information */ 
     771    ret = getpwuid_r(uid, &pwd, check_group_pw_buffer, pw_buf_size, &pwd_p); 
     772    if(ret != 0 || pwd_p == NULL) 
     773    { 
     774        gen_mutex_unlock(&check_group_mutex); 
     775        gossip_err("Get user info for (uid=%d) failed." 
     776                   "errno [%d] error_msg [%s]\n", 
     777                   uid, ret, strerror(ret)); 
     778        return(-PVFS_EINVAL); 
     779    } 
     780 
     781    /* check primary group */ 
     782    if(pwd.pw_gid == gid) 
     783    { 
     784        gen_mutex_unlock(&check_group_mutex); 
     785        return 0; 
     786    } 
     787 
     788    /* get the members of the group */ 
     789    ret = getgrgid_r(gid, &grp, check_group_gr_buffer, gr_buf_size, &grp_p); 
     790    if(ret != 0 || grp_p == NULL) 
     791    { 
     792      gen_mutex_unlock(&check_group_mutex); 
     793      gossip_err("Get members for group (gid=%d) failed." 
     794                 "errno [%d] error_msg [%s]\n", 
     795                 gid, ret, strerror(ret)); 
     796      return(-PVFS_EINVAL); 
     797    } 
     798 
     799    for(i = 0; grp.gr_mem[i] != NULL; i++) 
     800    { 
     801        if(0 == strcmp(pwd.pw_name, grp.gr_mem[i])) 
     802        { 
     803            gen_mutex_unlock(&check_group_mutex); 
     804            return 0; 
     805        }  
     806    } 
     807 
     808    gen_mutex_unlock(&check_group_mutex); 
     809    return(-PVFS_ENOENT); 
     810#else 
     811    return 0; 
     812#endif 
     813} 
     814 
     815/* Checks if a given user is part of any groups that matches the file gid */ 
     816static int in_group_p(PVFS_uid uid, PVFS_gid gid, PVFS_gid attr_group) 
     817{ 
     818    if (attr_group == gid) 
     819        return 1; 
     820    if (PINT_check_group(uid, attr_group) == 0) 
     821        return 1; 
     822    return 0; 
     823} 
     824 
     825/* 
     826 * Return 0 if requesting clients is granted want access to the object 
     827 * by the acl. Returns -PVFS_E... otherwise. 
     828 */ 
     829int PINT_check_acls(void *acl_buf, size_t acl_size,  
     830    PVFS_object_attr *attr, 
     831    PVFS_uid uid, PVFS_gid gid, int want) 
     832{ 
     833    pvfs2_acl_entry pe, *pa; 
     834    int i = 0, found = 0, count = 0; 
     835    assert(attr->mask & PVFS_ATTR_COMMON_UID && 
     836           attr->mask & PVFS_ATTR_COMMON_GID && 
     837           attr->mask & PVFS_ATTR_COMMON_PERM); 
     838 
     839    if (acl_size == 0) 
     840    { 
     841        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "no acl's present.. denying access\n"); 
     842        return -PVFS_EACCES; 
     843    } 
     844 
     845    /* keyval for ACLs includes a \0. so subtract the thingie */ 
     846    acl_size--; 
     847    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "PINT_check_acls: read keyval size " 
     848    " %d (%d acl entries)\n", 
     849        (int) acl_size,  
     850        (int) (acl_size / sizeof(pvfs2_acl_entry))); 
     851    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "uid = %d, gid = %d, want = %d\n", 
     852        uid, gid, want); 
     853 
     854    assert(acl_buf); 
     855    /* if the acl format doesn't look valid, then return an error rather than 
     856     * asserting; we don't want the server to crash due to an invalid keyval 
     857     */ 
     858    if((acl_size % sizeof(pvfs2_acl_entry)) != 0) 
     859    { 
     860        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "invalid acls on object\n"); 
     861        return(-PVFS_EACCES); 
     862    } 
     863    count = acl_size / sizeof(pvfs2_acl_entry); 
     864 
     865    for (i = 0; i < count; i++) 
     866    { 
     867        pa = (pvfs2_acl_entry *) acl_buf + i; 
     868        /*  
     869           NOTE: Remember that keyval is encoded as lebf, so convert it  
     870           to host representation  
     871        */ 
     872        pe.p_tag  = bmitoh32(pa->p_tag); 
     873        pe.p_perm = bmitoh32(pa->p_perm); 
     874        pe.p_id   = bmitoh32(pa->p_id); 
     875        pa = &pe; 
     876        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "Decoded ACL entry %d " 
     877            "(p_tag %d, p_perm %d, p_id %d)\n", 
     878            i, pa->p_tag, pa->p_perm, pa->p_id); 
     879        switch(pa->p_tag)  
     880        { 
     881            case PVFS2_ACL_USER_OBJ: 
     882                /* (May have been checked already) */ 
     883                if (attr->owner == uid) 
     884                    goto check_perm; 
     885                break; 
     886            case PVFS2_ACL_USER: 
     887                if (pa->p_id == uid) 
     888                    goto mask; 
     889                break; 
     890            case PVFS2_ACL_GROUP_OBJ: 
     891                if (in_group_p(uid, gid, attr->group))  
     892                { 
     893                    found = 1; 
     894                    if ((pa->p_perm & want) == want) 
     895                        goto mask; 
     896                } 
     897                break; 
     898            case PVFS2_ACL_GROUP: 
     899                if (in_group_p(uid, gid, pa->p_id)) { 
     900                    found = 1; 
     901                    if ((pa->p_perm & want) == want) 
     902                        goto mask; 
     903                } 
     904                break; 
     905            case PVFS2_ACL_MASK: 
     906                break; 
     907            case PVFS2_ACL_OTHER: 
     908                if (found) 
     909                { 
     910                    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "(1) PINT_check_acls:" 
     911                        "returning access denied\n"); 
     912                    return -PVFS_EACCES; 
     913                } 
     914                else 
     915                    goto check_perm; 
     916            default: 
     917                gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "(2) PINT_check_acls: " 
     918                        "returning EIO\n"); 
     919                return -PVFS_EIO; 
     920        } 
     921    } 
     922    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "(3) PINT_check_acls: returning EIO\n"); 
     923    return -PVFS_EIO; 
     924mask: 
     925    /* search the remaining entries */ 
     926    i = i + 1; 
     927    for (; i < count; i++) 
     928    { 
     929        pvfs2_acl_entry me, *mask_obj = (pvfs2_acl_entry *) acl_buf + i; 
     930         
     931        /*  
     932          NOTE: Again, since pvfs2_acl_entry is in lebf, we need to 
     933          convert it to host endian format 
     934         */ 
     935        me.p_tag  = bmitoh32(mask_obj->p_tag); 
     936        me.p_perm = bmitoh32(mask_obj->p_perm); 
     937        me.p_id   = bmitoh32(mask_obj->p_id); 
     938        mask_obj = &me; 
     939        gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "Decoded (mask) ACL entry %d " 
     940            "(p_tag %d, p_perm %d, p_id %d)\n", 
     941            i, mask_obj->p_tag, mask_obj->p_perm, mask_obj->p_id); 
     942        if (mask_obj->p_tag == PVFS2_ACL_MASK)  
     943        { 
     944            if ((pa->p_perm & mask_obj->p_perm & want) == want) 
     945                return 0; 
     946            gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "(4) PINT_check_acls:" 
     947                "returning access denied (mask)\n"); 
     948            return -PVFS_EACCES; 
     949        } 
     950    } 
     951 
     952check_perm: 
     953    if ((pa->p_perm & want) == want) 
     954        return 0; 
     955    gossip_debug(GOSSIP_PERMISSIONS_DEBUG, "(5) PINT_check_acls: returning" 
     956            "access denied\n"); 
     957    return -PVFS_EACCES; 
     958} 
     959 
    544960/* 
    545961 * Local variables: 
  • branches/Orange-Branch/src/common/misc/pint-util.h

    r7450 r8317  
    142142    PVFS_credentials *credentials); 
    143143 
     144enum PINT_access_type 
     145{ 
     146    PINT_ACCESS_EXECUTABLE = 1, 
     147    PINT_ACCESS_WRITABLE = 2, 
     148    PINT_ACCESS_READABLE = 4, 
     149}; 
     150 
     151int PINT_check_mode( 
     152    PVFS_object_attr *attr, 
     153    PVFS_uid uid, PVFS_gid gid, 
     154    enum PINT_access_type access_type); 
     155 
     156int PINT_check_acls(void *acl_buf, size_t acl_size,  
     157    PVFS_object_attr *attr, 
     158    PVFS_uid uid, PVFS_gid gid, int want); 
     159 
    144160#endif /* __PINT_UTIL_H */ 
    145161 
  • branches/Orange-Branch/src/common/misc/server-config.c

    r8306 r8317  
    732732     * usec: [%H:%M:%S.%U] 
    733733     * 
    734      * datetime: [%m/%d %H:%M] 
     734     * datetime: [%m/%d/%Y %H:%M:%S] 
    735735     * 
    736736     * thread: [%H:%M:%S.%U (%lu)] 
  • branches/Orange-Branch/src/common/misc/state-machine-fns.c

    r7596 r8317  
    431431{ 
    432432    return smcb->op == PVFS_SERVER_GET_CONFIG  
    433         || smcb->op == PVFS_SERVER_FETCH_CONFIG 
    434433        || smcb->op == PVFS_CLIENT_JOB_TIMER  
    435434        || smcb->op == PVFS_CLIENT_PERF_COUNT_TIMER  
  • branches/Orange-Branch/src/io/bmi/bmi-method-support.h

    r7471 r8317  
    5959}; 
    6060 
     61/* flags that can be set per method to affect behavior */ 
     62#define BMI_METHOD_FLAG_NO_POLLING 1 
     63 
    6164/* This is the table of interface functions that must be provided by BMI 
    6265 * methods. 
     
    6568{ 
    6669    const char *method_name; 
     70    int flags; 
    6771    int (*initialize) (bmi_method_addr_p, int, int); 
    6872    int (*finalize) (void); 
  • branches/Orange-Branch/src/io/bmi/bmi.c

    r8251 r8317  
    8181#ifdef __STATIC_METHOD_BMI_PORTALS__ 
    8282extern struct bmi_method_ops bmi_portals_ops; 
     83#endif 
     84#ifdef __STATIC_METHOD_BMI_ZOID__ 
     85extern struct bmi_method_ops bmi_zoid_ops; 
    8386#endif 
    8487 
     
    99102    &bmi_portals_ops, 
    100103#endif 
     104#ifdef __STATIC_METHOD_BMI_ZOID__ 
     105    &bmi_zoid_ops, 
     106#endif 
    101107    NULL 
    102108}; 
     
    121127 
    122128static struct bmi_method_ops **active_method_table = NULL; 
    123 static struct { 
     129 
     130struct method_usage_t { 
    124131    int iters_polled;  /* how many iterations since this method was polled */ 
    125132    int iters_active;  /* how many iterations since this method had action */ 
    126133    int plan; 
    127 } *method_usage = NULL; 
     134    int flags; 
     135}; 
     136 
     137static struct method_usage_t * expected_method_usage = NULL; 
     138static struct method_usage_t * unexpected_method_usage = NULL; 
     139 
    128140static const int usage_iters_starvation = 100000; 
    129141static const int usage_iters_active = 10000; 
     
    531543    known_method_count = 0; 
    532544 
    533     if (method_usage) 
    534         free(method_usage); 
     545    if (expected_method_usage) 
     546        free(expected_method_usage); 
     547 
     548    if (unexpected_method_usage) 
     549       free(unexpected_method_usage); 
    535550 
    536551    /* destroy the reference list */ 
     
    914929 */ 
    915930static void 
    916 construct_poll_plan(int nmeth, int *idle_time_ms) 
     931construct_poll_plan(struct method_usage_t * method_usage, 
     932      int nmeth, int *idle_time_ms) 
    917933{ 
    918934    int i, numplan; 
     
    923939        ++method_usage[i].iters_active; 
    924940        method_usage[i].plan = 0; 
    925         if (method_usage[i].iters_active <= usage_iters_active) { 
     941        if ((method_usage[i].iters_active <= usage_iters_active) && 
     942            (!(method_usage[i].flags & BMI_METHOD_FLAG_NO_POLLING))){ 
    926943            /* recently busy, poll */ 
    927944            if (0) gossip_debug(GOSSIP_BMI_DEBUG_CONTROL, 
     
    9911008    *outcount = 0; 
    9921009 
    993     construct_poll_plan(tmp_active_method_count, &max_idle_time_ms); 
     1010    construct_poll_plan(unexpected_method_usage, 
     1011          tmp_active_method_count, &max_idle_time_ms); 
    9941012 
    9951013    while (position < incount && i < tmp_active_method_count) 
    9961014    { 
    997         if (method_usage[i].plan) { 
     1015        if (unexpected_method_usage[i].plan) { 
    9981016            ret = active_method_table[i]->testunexpected( 
    9991017                (incount - position), &tmp_outcount, 
     
    10071025            position += tmp_outcount; 
    10081026            (*outcount) += tmp_outcount; 
    1009             method_usage[i].iters_polled = 0; 
     1027            unexpected_method_usage[i].iters_polled = 0; 
    10101028            if (ret) 
    1011                 method_usage[i].iters_active = 0; 
     1029                unexpected_method_usage[i].iters_active = 0; 
    10121030        } 
    10131031        i++; 
     
    10881106    } 
    10891107 
    1090     construct_poll_plan(tmp_active_method_count, &max_idle_time_ms); 
     1108    construct_poll_plan(expected_method_usage, 
     1109          tmp_active_method_count, &max_idle_time_ms); 
    10911110 
    10921111    while (position < incount && i < tmp_active_method_count) 
    10931112    { 
    1094         if (method_usage[i].plan) { 
     1113        if (expected_method_usage[i].plan) { 
    10951114            ret = active_method_table[i]->testcontext( 
    10961115                incount - position,  
     
    11101129            position += tmp_outcount; 
    11111130            (*outcount) += tmp_outcount; 
    1112             method_usage[i].iters_polled = 0; 
     1131            expected_method_usage[i].iters_polled = 0; 
    11131132            if (ret) 
    1114                 method_usage[i].iters_active = 0; 
     1133                expected_method_usage[i].iters_active = 0; 
    11151134        } 
    11161135        i++; 
     
    20222041} 
    20232042 
     2043 
     2044/** 
     2045 * Try to increase method_usage_t struct to include room for a new method. 
     2046 */ 
     2047static int grow_method_usage (struct method_usage_t ** p, int newflags) 
     2048{ 
     2049    struct method_usage_t * x = *p; 
     2050    *p = malloc((active_method_count + 1) * sizeof(**p)); 
     2051    if (!*p) { 
     2052        *p = x; 
     2053        return 0; 
     2054    } 
     2055    if (active_method_count) { 
     2056        memcpy(*p, x, active_method_count * sizeof(**p)); 
     2057        free(x); 
     2058    } 
     2059    memset(&((*p)[active_method_count]), 0, sizeof(**p)); 
     2060    (*p)[active_method_count].flags = newflags; 
     2061 
     2062    return 1; 
     2063 } 
     2064 
    20242065/* 
    20252066 * Attempt to insert this name into the list of active methods, 
     
    20722113    active_method_table[active_method_count] = meth; 
    20732114 
    2074     x = method_usage; 
    2075     method_usage = malloc((active_method_count + 1) * sizeof(*method_usage)); 
    2076     if (!method_usage) { 
    2077         method_usage = x; 
    2078         return -ENOMEM; 
    2079     } 
    2080     if (active_method_count) { 
    2081         memcpy(method_usage, x, active_method_count * sizeof(*method_usage)); 
    2082         free(x); 
    2083     } 
    2084     memset(&method_usage[active_method_count], 0, sizeof(*method_usage)); 
     2115    if (!grow_method_usage (&unexpected_method_usage, meth->flags)) 
     2116       return -ENOMEM; 
     2117 
     2118    /** 
     2119     * If we run out of memory here, the unexpected_method_usage will be 
     2120     * larger than strictly required but there is no memory leak. 
     2121     */ 
     2122 
     2123    if (!grow_method_usage (&expected_method_usage, meth->flags)) 
     2124       return -ENOMEM; 
    20852125 
    20862126    ++active_method_count; 
  • branches/Orange-Branch/src/io/bmi/bmi_gm/bmi-gm.c

    r7566 r8317  
    158158const struct bmi_method_ops bmi_gm_ops = { 
    159159    .method_name = BMI_gm_method_name, 
     160    .flags = 0, 
    160161    .initialize = BMI_gm_initialize, 
    161162    .finalize = BMI_gm_finalize, 
  • branches/Orange-Branch/src/io/bmi/bmi_ib/ib.c

    r7665 r8317  
    2323#include <src/common/gen-locks/gen-locks.h>  /* gen_mutex_t ... */ 
    2424#include <src/common/misc/pvfs2-internal.h> 
     25#include "pint-hint.h" 
    2526 
    2627#ifdef HAVE_VALGRIND_H 
     
    895896                 const void *buffer, bmi_size_t total_size, 
    896897                 enum bmi_buffer_type buffer_flag __unused, 
    897                  bmi_msg_tag_t tag, void *user_ptr, bmi_context_id context_id) 
     898                 bmi_msg_tag_t tag, void *user_ptr, bmi_context_id 
     899                 context_id, PVFS_hint hints __unused) 
    898900{ 
    899901    return post_send(id, remote_map, 0, &buffer, &total_size, 
     
    905907  const void *const *buffers, const bmi_size_t *sizes, int list_count, 
    906908  bmi_size_t total_size, enum bmi_buffer_type buffer_flag __unused, 
    907   bmi_msg_tag_t tag, void *user_ptr, bmi_context_id context_id) 
     909  bmi_msg_tag_t tag, void *user_ptr, bmi_context_id context_id, PVFS_hint 
     910  hints __unused) 
    908911{ 
    909912    return post_send(id, remote_map, list_count, buffers, sizes, 
     
    916919                           enum bmi_buffer_type buffer_flag __unused, 
    917920                           bmi_msg_tag_t tag, void *user_ptr, 
    918                            bmi_context_id context_id) 
     921                           bmi_context_id context_id, PVFS_hint hints 
     922                           __unused) 
    919923{ 
    920924    return post_send(id, remote_map, 0, &buffer, &total_size, 
     
    929933                                enum bmi_buffer_type buffer_flag __unused, 
    930934                                bmi_msg_tag_t tag, void *user_ptr, 
    931                                 bmi_context_id context_id) 
     935                                bmi_context_id context_id, PVFS_hint hints 
     936                                __unused) 
    932937{ 
    933938    return post_send(id, remote_map, list_count, buffers, sizes, 
     
    10661071  void *buffer, bmi_size_t expected_len, bmi_size_t *actual_len __unused, 
    10671072  enum bmi_buffer_type buffer_flag __unused, bmi_msg_tag_t tag, void *user_ptr, 
    1068   bmi_context_id context_id) 
     1073  bmi_context_id context_id, PVFS_hint hints __unused) 
    10691074{ 
    10701075    return post_recv(id, remote_map, 0, &buffer, &expected_len, 
     
    10771082  bmi_size_t tot_expected_len, bmi_size_t *tot_actual_len __unused, 
    10781083  enum bmi_buffer_type buffer_flag __unused, bmi_msg_tag_t tag, void *user_ptr, 
    1079   bmi_context_id context_id) 
     1084  bmi_context_id context_id, PVFS_hint hints __unused) 
    10801085{ 
    10811086    return post_recv(id, remote_map, list_count, buffers, sizes, 
     
    21092114{ 
    21102115    .method_name = "bmi_ib", 
     2116    .flags = 0, 
    21112117    .initialize = BMI_ib_initialize, 
    21122118    .finalize = BMI_ib_finalize, 
  • branches/Orange-Branch/src/io/bmi/bmi_mx/README

    r6973 r8317  
    6868    BMX_DEBUG                   Turn on gossip messages 
    6969    BMX_MEM_ACCT                Track memory usage 
    70     BMX_LOGGING                 Turn on MPE logging 
    7170    BMX_SERVER_RXS              Additional rxs for servers 
    7271    BMX_TIMEOUT                 Timeout for all MX messages 
     
    117116BMI_mx_method_addr_lookup(). 
    118117 
    119 BMX_LOGGING 
    120 This is not generally recommended. It turns on support for MPE logging but 
    121 it requires modifying the Makefile.in script and re-generating configure. 
    122 Contact help <at> myri.com for assistance. 
    123  
    124118BMX_SERVER_RXS 
    125119The server will receive messages from unknown peers. This value determines how 
     
    156150mx://hostname:ep_id 
    157151 
    158 Use the first option if mx_info lists hostname:board and use the second option if mx_info simply shows a hostname. 
     152Use the first option if mx_info lists hostname:board and use the second option 
     153if mx_info simply shows a hostname. 
    159154 
    160155====================== 
  • branches/Orange-Branch/src/io/bmi/bmi_mx/mx.c

    r7564 r8317  
    1717struct bmx_data *bmi_mx = NULL; /* global state for bmi_mx */ 
    1818 
     19mx_status_t     BMX_NO_STATUS; 
     20 
    1921#if BMX_MEM_ACCT 
    2022uint64_t        mem_used = 0;   /* bytes used */ 
     
    2224#endif 
    2325 
    24 #if BMX_LOGGING 
    25 int     send_start; 
    26 int     send_finish; 
    27 int     recv_start; 
    28 int     recv_finish; 
    29 int     sendunex_start; 
    30 int     sendunex_finish; 
    31 int     recvunex_start; 
    32 int     recvunex_finish; 
    33 #endif 
    34  
    3526/* statics for event logging */ 
    3627static PINT_event_type bmi_mx_send_event_id; 
     
    4839static void 
    4940bmx_create_peername(void); 
     41 
     42/**** Completion function token handling ****************************/ 
     43/* We should not hold any locks when calling mx_test[_any](), 
     44 * mx_wait_any() or mx_cancel(). We want to avoid races between them, 
     45 * however. So, before calling any completion function, the caller 
     46 * must hold this token.  These functions implement a token system (i.e. 
     47 * semaphore) that will wake up mx_wait_any() to reduce blocking times 
     48 * for the calling function. 
     49 */ 
     50 
     51static void 
     52bmx_get_completion_token(void) 
     53{ 
     54        int     done    = 0; 
     55 
     56        do { 
     57                gen_mutex_lock(&bmi_mx->bmx_completion_lock); 
     58                if (bmi_mx->bmx_refcount == 1) { 
     59                        bmi_mx->bmx_refcount--; 
     60                        done = 1; 
     61                        gen_mutex_unlock(&bmi_mx->bmx_completion_lock); 
     62                } else { 
     63                        assert(bmi_mx->bmx_refcount == 0); 
     64                        /* someone has the lock, wake the MX endpoint in 
     65                         * case they are blocking in mx_wait_any() */ 
     66                        gen_mutex_unlock(&bmi_mx->bmx_completion_lock); 
     67                        mx_wakeup(bmi_mx->bmx_ep); 
     68                } 
     69        } while (!done); 
     70 
     71        return; 
     72} 
     73 
     74static void 
     75bmx_release_completion_token(void) 
     76{ 
     77        gen_mutex_lock(&bmi_mx->bmx_completion_lock); 
     78        bmi_mx->bmx_refcount++; 
     79        assert(bmi_mx->bmx_refcount == 1); 
     80        gen_mutex_unlock(&bmi_mx->bmx_completion_lock); 
     81        return; 
     82} 
    5083 
    5184/**** TX/RX handling functions **************************************/ 
     
    224257} 
    225258 
    226 /* remove from peer's queued txs/rxs list */ 
    227 static void 
    228 bmx_deq_ctx(struct bmx_ctx *ctx) 
    229 { 
    230         struct bmx_peer *peer = ctx->mxc_peer; 
    231  
    232         BMX_ENTER; 
    233         if (!qlist_empty(&ctx->mxc_list)) { 
    234                 gen_mutex_lock(&peer->mxp_lock); 
    235                 qlist_del_init(&ctx->mxc_list); 
    236                 gen_mutex_unlock(&peer->mxp_lock); 
    237         } 
    238         BMX_EXIT; 
    239         return; 
    240 } 
    241  
    242259/* add to peer's pending rxs list */ 
    243260static void 
     
    280297} 
    281298 
    282 /* queue on unexpected rx or tx list */ 
     299/* dequeue from unexpected rx list */ 
    283300static void 
    284 bmx_q_unex_ctx(struct bmx_ctx *ctx) 
    285 { 
     301bmx_deq_unex_rx(struct bmx_ctx **rxp) 
     302{ 
     303        struct bmx_ctx  *rx     = NULL; 
     304        list_t          *list   = &bmi_mx->bmx_unex_rxs; 
     305 
    286306        BMX_ENTER; 
    287         if (ctx->mxc_type == BMX_REQ_RX) { 
    288                 gen_mutex_lock(&bmi_mx->bmx_unex_rxs_lock); 
    289                 qlist_add_tail(&ctx->mxc_list, &bmi_mx->bmx_unex_rxs); 
    290                 gen_mutex_unlock(&bmi_mx->bmx_unex_rxs_lock); 
    291         } else { 
    292                 gen_mutex_lock(&bmi_mx->bmx_unex_txs_lock); 
    293                 qlist_add_tail(&ctx->mxc_list, &bmi_mx->bmx_unex_txs); 
    294                 gen_mutex_unlock(&bmi_mx->bmx_unex_txs_lock); 
    295         } 
     307        gen_mutex_lock(&bmi_mx->bmx_unex_rxs_lock); 
     308        if (!qlist_empty(list)) { 
     309                rx = qlist_entry(list->next, struct bmx_ctx, mxc_list); 
     310                qlist_del_init(&rx->mxc_list); 
     311        } 
     312        gen_mutex_unlock(&bmi_mx->bmx_unex_rxs_lock); 
     313        *rxp = rx; 
     314 
    296315        BMX_EXIT; 
    297316        return; 
    298317} 
    299318 
    300 /* add to the global canceled list */ 
     319/* add to the completion queue for the appropriate context */ 
    301320static void 
    302 bmx_q_canceled_ctx(struct bmx_ctx *ctx, bmi_error_code_t error) 
    303 { 
     321bmx_q_completed(struct bmx_ctx *ctx, enum bmx_ctx_state state, 
     322                mx_status_t status, bmi_error_code_t error) 
     323{ 
     324        int             id      = 0; 
     325        gen_mutex_t     *lock   = NULL; 
     326        list_t          *list   = NULL; 
     327 
    304328        BMX_ENTER; 
    305         ctx->mxc_state = BMX_CTX_CANCELED; 
    306         if (error < 0) 
    307                 ctx->mxc_mxstat.code = error; 
    308         else 
    309                 ctx->mxc_mxstat.code = -error; 
    310         gen_mutex_lock(&bmi_mx->bmx_canceled_lock); 
    311         qlist_add_tail(&ctx->mxc_list, &bmi_mx->bmx_canceled); 
    312         gen_mutex_unlock(&bmi_mx->bmx_canceled_lock); 
     329 
     330        ctx->mxc_state = state; 
     331        ctx->mxc_mxstat = status; 
     332        ctx->mxc_error = error < 0 ? error : -error; 
     333 
     334        if (ctx->mxc_type == BMX_REQ_RX && 
     335            ctx->mxc_msg_type == BMX_MSG_UNEXPECTED) { 
     336                list = &bmi_mx->bmx_unex_rxs; 
     337                lock = &bmi_mx->bmx_unex_rxs_lock; 
     338        } else { 
     339                id = (int) ctx->mxc_mop->context_id; 
     340                lock = &bmi_mx->bmx_done_q_lock[id]; 
     341                list = &bmi_mx->bmx_done_q[id]; 
     342        } 
     343 
     344 
     345        gen_mutex_lock(lock); 
     346        qlist_add_tail(&ctx->mxc_list, list); 
     347        gen_mutex_unlock(lock); 
     348        BMX_EXIT; 
     349        return; 
     350} 
     351 
     352static void 
     353bmx_deq_completed(struct bmx_ctx **ctxp, bmi_context_id context_id) 
     354{ 
     355        int             id      = (int) context_id; 
     356        list_t          *list   = &bmi_mx->bmx_done_q[id]; 
     357        gen_mutex_t     *lock   = &bmi_mx->bmx_done_q_lock[id]; 
     358        struct bmx_ctx  *ctx    = NULL; 
     359 
     360        BMX_ENTER; 
     361 
     362        gen_mutex_lock(lock); 
     363        if (!qlist_empty(list)) { 
     364                ctx = qlist_entry(list->next, struct bmx_ctx, mxc_list); 
     365                qlist_del_init(&ctx->mxc_list); 
     366        } 
     367        gen_mutex_unlock(lock); 
     368        *ctxp = ctx; 
     369 
    313370        BMX_EXIT; 
    314371        return; 
     
    347404 
    348405static void 
    349 bmx_put_idle_rx(struct bmx_ctx *rx) 
    350 { 
    351         if (rx == NULL) { 
    352                 debug(BMX_DB_WARN, "put_idle_rx() called with NULL"); 
     406bmx_put_idle_ctx(struct bmx_ctx *ctx) 
     407{ 
     408        list_t          *list   = &bmi_mx->bmx_idle_txs; 
     409        gen_mutex_t     *lock   = &bmi_mx->bmx_idle_txs_lock; 
     410 
     411        if (ctx == NULL) { 
     412                debug(BMX_DB_WARN, "put_idle_ctx() called with NULL"); 
    353413                return; 
    354414        } 
    355         if (rx->mxc_type != BMX_REQ_RX) { 
    356                 debug(BMX_DB_WARN, "put_idle_rx() called with a TX"); 
    357                 return; 
    358         } 
    359         if (rx->mxc_get != rx->mxc_put + 1) { 
    360                 debug(BMX_DB_ERR, "put_idle_rx() get (%llu) != put (%llu) + 1", 
    361                          (unsigned long long) rx->mxc_get, 
    362                          (unsigned long long) rx->mxc_put); 
     415        ctx->mxc_put++; 
     416        if (ctx->mxc_get != ctx->mxc_put) { 
     417                debug(BMX_DB_ERR, "put_idle_ctx() get (%llu) != put (%llu)", 
     418                         (unsigned long long) ctx->mxc_get, 
     419                         (unsigned long long) ctx->mxc_put); 
    363420                exit(1); 
    364421        } 
    365         bmx_ctx_init(rx); 
    366         rx->mxc_put++; 
    367         gen_mutex_lock(&bmi_mx->bmx_idle_rxs_lock); 
    368         qlist_add(&rx->mxc_list, &bmi_mx->bmx_idle_rxs); 
    369         gen_mutex_unlock(&bmi_mx->bmx_idle_rxs_lock); 
     422        bmx_ctx_init(ctx); 
     423 
     424        if (ctx->mxc_type == BMX_REQ_RX) { 
     425                list   = &bmi_mx->bmx_idle_rxs; 
     426                lock   = &bmi_mx->bmx_idle_rxs_lock; 
     427        } 
     428 
     429        gen_mutex_lock(lock); 
     430        qlist_add(&ctx->mxc_list, list); 
     431        gen_mutex_unlock(lock); 
    370432        return; 
    371433} 
     
    416478 
    417479        return tx; 
    418 } 
    419  
    420 static void 
    421 bmx_put_idle_tx(struct bmx_ctx *tx) 
    422 { 
    423         if (tx == NULL) { 
    424                 debug(BMX_DB_WARN, "put_idle_tx() called with NULL"); 
    425                 return; 
    426         } 
    427         if (tx->mxc_type != BMX_REQ_TX) { 
    428                 debug(BMX_DB_WARN, "put_idle_tx() called with a TX"); 
    429                 return; 
    430         } 
    431         if (tx->mxc_get != tx->mxc_put + 1) { 
    432                 debug(BMX_DB_ERR, "put_idle_tx() get (%llu) != put (%llu) + 1", 
    433                          (unsigned long long) tx->mxc_get, 
    434                          (unsigned long long) tx->mxc_put); 
    435                 exit(1); 
    436         } 
    437         bmx_ctx_init(tx); 
    438         tx->mxc_put++; 
    439         gen_mutex_lock(&bmi_mx->bmx_idle_txs_lock); 
    440         qlist_add(&tx->mxc_list, &bmi_mx->bmx_idle_txs); 
    441         gen_mutex_unlock(&bmi_mx->bmx_idle_txs_lock); 
    442         return; 
    443480} 
    444481 
     
    759796                        return ret; 
    760797                } 
    761                 bmx_put_idle_rx(rx); 
     798                bmx_put_idle_ctx(rx); 
    762799        } 
    763800 
     
    810847bmx_globals_init(int method_id) 
    811848{ 
     849        int     i       = 0; 
     850 
    812851#if BMX_MEM_ACCT 
    813852        mem_used = 0; 
     
    840879        gen_mutex_init(&bmi_mx->bmx_idle_rxs_lock); 
    841880 
    842         INIT_QLIST_HEAD(&bmi_mx->bmx_canceled); 
    843         gen_mutex_init(&bmi_mx->bmx_canceled_lock); 
    844  
    845         INIT_QLIST_HEAD(&bmi_mx->bmx_unex_txs); 
    846         gen_mutex_init(&bmi_mx->bmx_unex_txs_lock); 
     881        gen_mutex_init(&bmi_mx->bmx_completion_lock); 
     882        /* set to 1 to allow testing to start */ 
     883        bmi_mx->bmx_refcount = 1; 
     884 
     885        for (i = 0; i < BMI_MAX_CONTEXTS; i++) { 
     886                INIT_QLIST_HEAD(&bmi_mx->bmx_done_q[i]); 
     887                gen_mutex_init(&bmi_mx->bmx_done_q_lock[i]); 
     888        } 
     889 
    847890        INIT_QLIST_HEAD(&bmi_mx->bmx_unex_rxs); 
    848891        gen_mutex_init(&bmi_mx->bmx_unex_rxs_lock); 
     
    883926        param.val.context_id.shift = BMX_MSG_SHIFT; 
    884927 
    885         if (board == -1) board = 0; 
    886928        mxret = mx_open_endpoint(board, ep_id, BMX_MAGIC, 
    887929                                 &param, 1, ep); 
     
    922964 
    923965        BMX_ENTER; 
    924  
    925 #if BMX_LOGGING 
    926         MPE_Init_log(); 
    927 #define BMX_LOG_STATE 1 
    928 #if BMX_LOG_STATE 
    929         send_start              = MPE_Log_get_event_number(); 
    930         send_finish             = MPE_Log_get_event_number(); 
    931         recv_start              = MPE_Log_get_event_number(); 
    932         recv_finish             = MPE_Log_get_event_number(); 
    933         sendunex_start          = MPE_Log_get_event_number(); 
    934         sendunex_finish         = MPE_Log_get_event_number(); 
    935         recvunex_start          = MPE_Log_get_event_number(); 
    936         recvunex_finish         = MPE_Log_get_event_number(); 
    937         MPE_Describe_state(send_start, send_finish, "Send", "red"); 
    938         MPE_Describe_state(recv_start, recv_finish, "Recv", "blue"); 
    939         MPE_Describe_state(sendunex_start, sendunex_finish, "SendUnex", "orange"); 
    940         MPE_Describe_state(recvunex_start, recvunex_finish, "RecvUnex", "green"); 
    941 #else 
    942         MPE_Log_get_solo_eventID(&send_start); 
    943         MPE_Log_get_solo_eventID(&send_finish); 
    944         MPE_Log_get_solo_eventID(&recv_start); 
    945         MPE_Log_get_solo_eventID(&recv_finish); 
    946         MPE_Log_get_solo_eventID(&sendunex_start); 
    947         MPE_Log_get_solo_eventID(&sendunex_finish); 
    948         MPE_Log_get_solo_eventID(&recvunex_start); 
    949         MPE_Log_get_solo_eventID(&recvunex_finish); 
    950         MPE_Describe_info_event(send_start, "Send_start", "red1", "tag:%d"); 
    951         MPE_Describe_info_event(send_finish, "Send_finish", "red3", "tag:%d"); 
    952         MPE_Describe_info_event(recv_start, "Recv_start", "blue1", "tag:%d"); 
    953         MPE_Describe_info_event(recv_finish, "Recv_finish", "blue3", "tag:%d"); 
    954         MPE_Describe_info_event(sendunex_start, "SendUnex_start", "orange1", "tag:%d"); 
    955         MPE_Describe_info_event(sendunex_finish, "SendUnex_finish", "orange3", "tag:%d"); 
    956         MPE_Describe_info_event(recvunex_start, "RecvUnex_start", "green1", "tag:%d"); 
    957         MPE_Describe_info_event(recvunex_finish, "RecvUnex_finish", "green3", "tag:%d"); 
    958 #endif /* state or event */ 
    959 #endif /* BMX_LOGGING */ 
    960966 
    961967         /* check params */ 
     
    10241030                        ret = bmx_ctx_alloc(&rx, BMX_REQ_RX); 
    10251031                        if (ret == 0) { 
    1026                                 bmx_put_idle_rx(rx); 
     1032                                bmx_put_idle_ctx(rx); 
    10271033                        } 
    10281034                } 
     
    11371143        debug(BMX_DB_MEM, "memory leaked at shutdown %lld", llu(mem_used)); 
    11381144#endif 
    1139  
    1140 #if BMX_LOGGING 
    1141         MPE_Finish_log("/tmp/bmi_mx.log"); 
    1142 #endif 
    11431145        BMX_EXIT; 
    1144  
    11451146        return 0; 
    11461147} 
     
    11801181                tx = qlist_entry(queued_txs->next, struct bmx_ctx, mxc_list); 
    11811182                qlist_del_init(&tx->mxc_list); 
    1182                 bmx_q_canceled_ctx(tx, err); 
     1183                bmx_q_completed(tx, BMX_CTX_CANCELED, BMX_NO_STATUS, err); 
    11831184        } 
    11841185        /* cancel queued rxs */ 
     
    11871188                rx = qlist_entry(queued_rxs->next, struct bmx_ctx, mxc_list); 
    11881189                qlist_del_init(&rx->mxc_list); 
    1189                 bmx_q_canceled_ctx(rx, err); 
     1190                bmx_q_completed(rx, BMX_CTX_CANCELED, BMX_NO_STATUS, err); 
    11901191        } 
    11911192        /* try to cancel pending rxs */ 
     
    11951196                if (result) { 
    11961197                        qlist_del_init(&rx->mxc_list); 
    1197                         bmx_q_canceled_ctx(rx, err); 
     1198                        bmx_q_completed(rx, BMX_CTX_CANCELED, BMX_NO_STATUS, err); 
    11981199                } 
    11991200        } 
     
    14241425        uint64_t        type    = (uint64_t) ctx->mxc_msg_type; 
    14251426        uint64_t        id      = 0ULL; 
    1426         uint64_t        tag     = (uint64_t) ctx->mxc_tag; 
     1427        uint64_t        tag     = (uint64_t) ((uint32_t) ctx->mxc_tag); 
    14271428 
    14281429        if (ctx->mxc_msg_type == BMX_MSG_CONN_REQ ||  
     
    15171518                        ret = -BMI_ENOMEM; 
    15181519                        bmx_deq_pending_ctx(tx);        /* uses peer lock */ 
    1519                         bmx_q_canceled_ctx(tx, BMI_ENOMEM); 
     1520                        bmx_q_completed(tx, BMX_CTX_CANCELED, BMX_NO_STATUS, BMI_ENOMEM); 
    15201521                } 
    15211522        } else { /* peer is not ready */ 
     
    15721573        PINT_event_id            eid    = 0; 
    15731574 
    1574 #if BMX_LOGGING 
    1575         if (!is_unexpected) { 
    1576                 MPE_Log_event(send_start, (int) tag, NULL); 
    1577         } else { 
    1578                 MPE_Log_event(sendunex_start, (int) tag, NULL); 
    1579         } 
    1580 #endif 
    1581  
    15821575        PINT_EVENT_START( 
    15831576            bmi_mx_send_event_id, bmi_mx_pid, NULL, &eid, 
     
    16211614                BMX_MALLOC(segs, (numbufs * sizeof(*segs))); 
    16221615                if (segs == NULL) { 
    1623                         bmx_put_idle_tx(tx); 
     1616                        bmx_put_idle_ctx(tx); 
    16241617                        bmx_peer_decref(peer); 
    16251618                        ret = -BMI_ENOMEM; 
     
    16421635 
    16431636        if (is_unexpected && tx->mxc_nob > (long long) BMX_UNEXPECTED_SIZE) { 
    1644                 bmx_put_idle_tx(tx); 
     1637                bmx_put_idle_ctx(tx); 
    16451638                bmx_peer_decref(peer); 
    16461639                ret = -BMI_EINVAL; 
     
    16581651        BMX_MALLOC(mop, sizeof(*mop)); 
    16591652        if (mop == NULL) { 
    1660                 bmx_put_idle_tx(tx); 
     1653                bmx_put_idle_ctx(tx); 
    16611654                bmx_peer_decref(peer); 
    16621655                ret = -BMI_ENOMEM; 
     
    16731666        tx->mxc_mop = mop; 
    16741667 
     1668        assert(context_id == mop->context_id); 
     1669        assert(context_id == tx->mxc_mop->context_id); 
     1670 
    16751671        bmx_create_match(tx); 
    16761672 
    1677         debug(BMX_DB_CTX, "%s tag= %d length= %d %s op_id= %llu", __func__, tag, 
    1678                         (int) total_size, is_unexpected ? "UNEXPECTED" : "EXPECTED", 
    1679                         llu(mop->op_id)); 
     1673        debug(BMX_DB_CTX, "%s tag= %d length= %d %s op_id= %llu context_id= %lld", 
     1674                        __func__, tag, (int) total_size, 
     1675                        is_unexpected ? "UNEXPECTED" : "EXPECTED", 
     1676                        llu(mop->op_id), lld(context_id)); 
    16801677 
    16811678        ret = bmx_post_tx(tx); 
     
    17921789                        ret = -BMI_ENOMEM; 
    17931790                        bmx_deq_pending_ctx(rx);        /* uses peer lock */ 
    1794                         bmx_q_canceled_ctx(rx, BMI_ENOMEM); 
     1791                        bmx_q_completed(rx, BMX_CTX_CANCELED, BMX_NO_STATUS, BMI_ENOMEM); 
    17951792                } 
    17961793        } else { /* peer is not ready */ 
     
    18171814        struct bmx_peer         *peer   = NULL; 
    18181815        PINT_event_id            eid    = 0; 
    1819  
    1820 #if BMX_LOGGING 
    1821         MPE_Log_event(recv_start, (int) tag, NULL); 
    1822 #endif 
    18231816 
    18241817        PINT_EVENT_START( 
     
    18651858                BMX_MALLOC(segs, (numbufs * sizeof(*segs))); 
    18661859                if (segs == NULL) { 
    1867                         bmx_put_idle_rx(rx); 
     1860                        bmx_put_idle_ctx(rx); 
    18681861                        bmx_peer_decref(peer); 
    18691862                        ret = -BMI_ENOMEM; 
     
    18871880        BMX_MALLOC(mop, sizeof(*mop)); 
    18881881        if (mop == NULL) { 
    1889                 bmx_put_idle_rx(rx); 
     1882                bmx_put_idle_ctx(rx); 
    18901883                bmx_peer_decref(peer); 
    18911884                ret = -BMI_ENOMEM; 
     
    20262019        } 
    20272020 
    2028 #if BMX_LOGGING 
    2029         MPE_Log_event(recvunex_start, (int) tag, NULL); 
    2030 #endif 
    2031  
    20322021        rx = bmx_get_idle_rx(); 
    20332022        if (rx != NULL) { 
     
    20622051                                        "unexpected recv with tag %d length %d", 
    20632052                                        mx_strerror(mxret), tag, length); 
    2064                         bmx_put_idle_rx(rx); 
     2053                        bmx_put_idle_ctx(rx); 
    20652054                        ret = -1; 
    20662055                } 
     
    21212110                                                "unexpected recv with %s",  
    21222111                                                mx_strerror(mxret)); 
    2123                                 bmx_put_idle_rx(rx); 
     2112                                bmx_put_idle_ctx(rx); 
    21242113                                ret = MX_RECV_FINISHED; 
    21252114                        } 
     
    23412330                                /* drop ref taken before mx_iconnect() */ 
    23422331                                bmx_peer_decref(tx->mxc_peer); 
    2343                                 bmx_put_idle_tx(tx); 
     2332                                bmx_put_idle_ctx(tx); 
    23442333                                continue; 
    23452334                        } else if (status.code != MX_STATUS_SUCCESS) { 
    23462335                                bmx_peer_decref(rx->mxc_peer); 
    2347                                 bmx_put_idle_rx(rx); 
     2336                                bmx_put_idle_ctx(rx); 
    23482337                                continue; 
    23492338                        } 
     
    23562345                                                BMX_VERSION, version); 
    23572346                                bmx_peer_decref(rx->mxc_peer); 
    2358                                 bmx_put_idle_rx(rx); 
     2347                                bmx_put_idle_ctx(rx); 
    23592348                                continue; 
    23602349                        } 
     
    23622351                                debug(BMX_DB_WARN, "received CONN_REQ on a client."); 
    23632352                                bmx_peer_decref(rx->mxc_peer); 
    2364                                 bmx_put_idle_rx(rx); 
     2353                                bmx_put_idle_ctx(rx); 
    23652354                                continue; 
    23662355                        } 
     
    23902379                                                        (char *) rx->mxc_buffer); 
    23912380                                        bmx_peer_decref(rx->mxc_peer); 
    2392                                         bmx_put_idle_rx(rx); 
     2381                                        bmx_put_idle_ctx(rx); 
    23932382                                        continue; 
    23942383                                } 
     
    23992388                                                        "method addr for %s", peername); 
    24002389                                        bmx_peer_decref(rx->mxc_peer); 
    2401                                         bmx_put_idle_rx(rx); 
     2390                                        bmx_put_idle_ctx(rx); 
    24022391                                        continue; 
    24032392                                } 
     
    24092398                                                        "peer for %s", peername); 
    24102399                                        bmx_peer_decref(rx->mxc_peer); 
    2411                                         bmx_put_idle_rx(rx); 
     2400                                        bmx_put_idle_ctx(rx); 
    24122401                                        continue; 
    24132402                                } 
     
    24362425                        mx_iconnect(bmi_mx->bmx_ep, peer->mxp_nic_id, mxmap->mxm_ep_id, 
    24372426                                    BMX_MAGIC, ack, peer, &request); 
    2438                         bmx_put_idle_rx(rx); 
     2427                        bmx_put_idle_ctx(rx); 
    24392428                } 
    24402429        } while (result); 
     
    25512540                                        llu(tx->mxc_match), mx_strstatus(status.code)); 
    25522541                        bmx_peer_decref(tx->mxc_peer); 
    2553                         bmx_put_idle_tx(tx); 
     2542                        bmx_put_idle_ctx(tx); 
    25542543                } 
    25552544        } while (result); 
     
    25782567} 
    25792568 
     2569static void 
     2570bmx_complete_ctx(struct bmx_ctx *ctx, bmi_op_id_t *outid, bmi_error_code_t *err, 
     2571                 bmi_size_t *size, void **user_ptr) 
     2572{ 
     2573        struct bmx_peer *peer   = ctx->mxc_peer; 
     2574 
     2575        *outid = ctx->mxc_mop->op_id; 
     2576        *err = ctx->mxc_error; 
     2577        *size = ctx->mxc_mxstat.xfer_length; 
     2578        if (user_ptr) 
     2579                *user_ptr = ctx->mxc_mop->user_ptr; 
     2580        PINT_EVENT_END( 
     2581            (ctx->mxc_type == BMX_REQ_TX ? 
     2582             bmi_mx_send_event_id : bmi_mx_recv_event_id), 
     2583            bmi_mx_pid, NULL, ctx->mxc_mop->event_id, 
     2584            *outid, *size); 
     2585 
     2586        id_gen_fast_unregister(ctx->mxc_mop->op_id); 
     2587        BMX_FREE(ctx->mxc_mop, sizeof(*ctx->mxc_mop)); 
     2588        bmx_put_idle_ctx(ctx); 
     2589        bmx_peer_decref(peer); /* drop the ref taken in [send|recv]_common */ 
     2590 
     2591        return; 
     2592} 
     2593 
    25802594static int 
    25812595BMI_mx_test(bmi_op_id_t id, int *outcount, bmi_error_code_t *err, 
    25822596            bmi_size_t *size, void **user_ptr, int max_idle_time __unused, 
    2583             bmi_context_id context_id __unused) 
     2597            bmi_context_id context_id) 
    25842598{ 
    25852599        uint32_t         result = 0; 
     
    25922606        bmx_connection_handlers(); 
    25932607 
     2608        bmx_get_completion_token(); 
     2609 
    25942610        mop = id_gen_fast_lookup(id); 
    25952611        ctx = mop->method_data; 
    25962612        peer = ctx->mxc_peer; 
    25972613 
     2614        assert(context_id == mop->context_id); 
     2615        if (ctx->mxc_type == BMX_REQ_RX) 
     2616                assert(ctx->mxc_msg_type != BMX_MSG_UNEXPECTED); 
     2617        assert(context_id == ctx->mxc_mop->context_id); 
     2618 
    25982619        switch (ctx->mxc_state) { 
     2620        case BMX_CTX_COMPLETED: 
    25992621        case BMX_CTX_CANCELED: 
    2600                 /* we are racing with testcontext */ 
    2601                 gen_mutex_lock(&bmi_mx->bmx_canceled_lock); 
    2602                 if (ctx->mxc_state != BMX_CTX_CANCELED) { 
    2603                         gen_mutex_unlock(&bmi_mx->bmx_canceled_lock); 
    2604                         return 0; 
    2605                 } 
     2622                gen_mutex_lock(&bmi_mx->bmx_done_q_lock[(int) context_id]); 
    26062623                qlist_del_init(&ctx->mxc_list); 
    2607                 gen_mutex_unlock(&bmi_mx->bmx_canceled_lock); 
     2624                gen_mutex_unlock(&bmi_mx->bmx_done_q_lock[(int) context_id]); 
     2625                bmx_complete_ctx(ctx, &id, err, size, user_ptr); 
    26082626                *outcount = 1; 
    2609                 *err = ctx->mxc_mxstat.code; 
    2610                 if (ctx->mxc_mop) { 
    2611                         if (user_ptr) { 
    2612                                 *user_ptr = ctx->mxc_mop->user_ptr; 
    2613                         } 
    2614                         id_gen_fast_unregister(ctx->mxc_mop->op_id); 
    2615                         BMX_FREE(ctx->mxc_mop, sizeof(*ctx->mxc_mop)); 
    2616                 } 
    2617                 bmx_peer_decref(peer); 
    2618                 if (ctx->mxc_type == BMX_REQ_TX) { 
    2619                         bmx_put_idle_tx(ctx); 
    2620                 } else { 
    2621                         bmx_put_idle_rx(ctx); 
    2622                 } 
    26232627                break; 
    26242628        case BMX_CTX_PENDING: 
    2625                 /* racing with mx_test_any() in textcontext? */ 
    26262629                mx_test(bmi_mx->bmx_ep, &ctx->mxc_mxreq, &ctx->mxc_mxstat, &result); 
    26272630                if (result) { 
    2628                         PINT_EVENT_END( 
    2629                             (ctx->mxc_type == BMX_REQ_TX ? 
    2630                              bmi_mx_send_event_id : bmi_mx_recv_event_id), 
    2631                             bmi_mx_pid, NULL, ctx->mxc_mop->event_id, 
    2632                             ctx->mxc_mop->op_id, *size); 
    2633  
     2631                        bmx_deq_pending_ctx(ctx); 
     2632                        bmx_complete_ctx(ctx, &id, err, size, user_ptr); 
    26342633                        *outcount = 1; 
    2635                         if (ctx->mxc_mxstat.code == MX_STATUS_SUCCESS) { 
    2636                                 *err = 0; 
    2637                                 *size = ctx->mxc_mxstat.xfer_length; 
    2638                         } else { 
    2639                                 *err = bmx_mx_to_bmi_errno(ctx->mxc_mxstat.code); 
    2640                         } 
    2641                         if (ctx->mxc_mop) { 
    2642                                 if (user_ptr) { 
    2643                                         *user_ptr = ctx->mxc_mop->user_ptr; 
    2644                                 } 
    2645                                 id_gen_fast_unregister(ctx->mxc_mop->op_id); 
    2646                                 BMX_FREE(ctx->mxc_mop, sizeof(*ctx->mxc_mop)); 
    2647                         } 
    2648                         bmx_deq_pending_ctx(ctx); 
    2649                         if (ctx->mxc_type == BMX_REQ_TX) { 
    2650                                 bmx_put_idle_tx(ctx); 
    2651                         } else { 
    2652                                 bmx_put_idle_rx(ctx); 
    2653                         } 
    2654                         bmx_peer_decref(peer); 
    26552634                } 
    26562635                break; 
     
    26592638                        ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", ctx->mxc_state); 
    26602639        } 
     2640        bmx_release_completion_token(); 
    26612641        BMX_EXIT; 
    26622642 
     
    26772657        struct bmx_ctx  *ctx            = NULL; 
    26782658        struct bmx_peer *peer           = NULL; 
    2679         list_t          *canceled       = &bmi_mx->bmx_canceled; 
    26802659        int             wait            = 0; 
    26812660        static int      count           = 0; 
     
    26892668        bmx_connection_handlers(); 
    26902669 
    2691         /* always return canceled messages first */ 
    2692         while (completed < incount && !qlist_empty(canceled)) { 
    2693                 gen_mutex_lock(&bmi_mx->bmx_canceled_lock); 
    2694                 ctx = qlist_entry(canceled->next, struct bmx_ctx, mxc_list); 
    2695                 qlist_del_init(&ctx->mxc_list); 
    2696                 /* change state in case test is trying to reap it as well */ 
    2697                 ctx->mxc_state = BMX_CTX_COMPLETED; 
    2698                 gen_mutex_unlock(&bmi_mx->bmx_canceled_lock); 
    2699                 peer = ctx->mxc_peer; 
    2700                 outids[completed] = ctx->mxc_mop->op_id; 
    2701                 errs[completed] = ctx->mxc_mxstat.code; 
    2702                 if (user_ptrs) 
    2703                         user_ptrs[completed] = ctx->mxc_mop->user_ptr; 
    2704                 id_gen_fast_unregister(ctx->mxc_mop->op_id); 
    2705                 BMX_FREE(ctx->mxc_mop, sizeof(*ctx->mxc_mop)); 
    2706                 completed++; 
    2707                 if (ctx->mxc_type == BMX_REQ_TX) { 
    2708                         bmx_put_idle_tx(ctx); 
    2709                 } else { 
    2710                         bmx_put_idle_rx(ctx); 
    2711                 } 
    2712                 bmx_peer_decref(peer); /* drop the ref taken in [send|recv]_common */ 
    2713                 if (completed > 0) { 
    2714                         debug(BMX_DB_CTX, "%s found %d canceled messages", 
    2715                               __func__, completed); 
    2716                 } 
    2717         } 
    2718  
    2719         /* return completed messages 
     2670        bmx_get_completion_token(); 
     2671 
     2672        /* always return queued, completed messages first */ 
     2673        do { 
     2674                bmx_deq_completed(&ctx, context_id); 
     2675                if (ctx) { 
     2676                        bmx_complete_ctx(ctx, &outids[completed], &errs[completed], 
     2677                                         &sizes[completed], &user_ptrs[completed]); 
     2678                        completed++; 
     2679                } 
     2680        } while (completed < incount && ctx != NULL); 
     2681 
     2682        if (completed > 0) 
     2683                debug(BMX_DB_CTX, "%s found %d completed messages", __func__, completed); 
     2684 
     2685        /* try to complete expected messages 
    27202686         * we will always try (incount - completed) times even 
    27212687         *     if some iterations have no result */ 
     
    27362702                        wait = 2; 
    27372703                } 
     2704 
    27382705                if (result) { 
    27392706                        ctx = (struct bmx_ctx *) status.context; 
    27402707                        bmx_deq_pending_ctx(ctx); 
     2708                        if (ctx->mxc_mop->context_id != context_id) { 
     2709                                bmx_q_completed(ctx, BMX_CTX_COMPLETED, status, 
     2710                                                bmx_mx_to_bmi_errno(status.code)); 
     2711                                continue; 
     2712                        } 
     2713                        ctx->mxc_mxstat = status; 
    27412714                        peer = ctx->mxc_peer; 
    27422715                        debug(BMX_DB_CTX, "%s completing expected %s with match 0x%llx " 
    2743                                         "for %s with op_id %llu length %d %s", __func__,  
    2744                                         ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", 
     2716                                        "for %s with op_id %llu length %d %s " 
     2717                                        "context_id= %d mop->context_id= %d", 
     2718                                        __func__, ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", 
    27452719                                        llu(ctx->mxc_match), peer->mxp_mxmap->mxm_peername, 
    27462720                                        llu(ctx->mxc_mop->op_id), status.xfer_length, 
    2747                                         mx_strstatus(status.code)); 
    2748  
    2749                         outids[completed] = ctx->mxc_mop->op_id; 
    2750                         if (status.code == MX_SUCCESS) { 
    2751                                 errs[completed] = 0; 
    2752                                 sizes[completed] = status.xfer_length; 
    2753                         } else { 
    2754                                 errs[completed] = bmx_mx_to_bmi_errno(status.code); 
    2755                         } 
    2756                         if (user_ptrs) 
    2757                                 user_ptrs[completed] = ctx->mxc_mop->user_ptr; 
    2758  
    2759                         PINT_EVENT_END( 
    2760                             (ctx->mxc_type == BMX_REQ_TX ? 
    2761                              bmi_mx_send_event_id : bmi_mx_recv_event_id), 
    2762                             bmi_mx_pid, NULL, ctx->mxc_mop->event_id, 
    2763                             ctx->mxc_mop->op_id, status.xfer_length); 
    2764  
    2765                         id_gen_fast_unregister(ctx->mxc_mop->op_id); 
    2766                         BMX_FREE(ctx->mxc_mop, sizeof(*ctx->mxc_mop)); 
     2721                                        mx_strstatus(status.code), (int) context_id, 
     2722                                        (int) ctx->mxc_mop->context_id); 
     2723 
     2724                        bmx_complete_ctx(ctx, &outids[completed], &errs[completed], 
     2725                                         &sizes[completed], &user_ptrs[completed]); 
    27672726                        completed++; 
    2768 #if BMX_LOGGING 
    2769                         if (ctx->mxc_type == BMX_REQ_TX) { 
    2770                                 MPE_Log_event(send_finish, (int) ctx->mxc_tag, NULL); 
    2771                         } else { 
    2772                                 MPE_Log_event(recv_finish, (int) ctx->mxc_tag, NULL); 
    2773                         } 
    2774 #endif 
    2775                         if (ctx->mxc_type == BMX_REQ_TX) { 
    2776                                 bmx_put_idle_tx(ctx); 
    2777                         } else { 
    2778                                 bmx_put_idle_rx(ctx); 
    2779                         } 
    2780                         bmx_peer_decref(peer); /* drop the ref taken in [send|recv]_common */ 
    2781                 } 
    2782                 if (completed - old > 0) { 
    2783                         debug(BMX_DB_CTX, "%s found %d expected messages", 
    2784                               __func__, completed - old); 
    2785                 } 
    2786         } 
    2787  
    2788         /* check for completed unexpected sends */ 
     2727                } 
     2728        } 
     2729 
     2730        if (completed - old > 0) 
     2731                debug(BMX_DB_CTX, "%s found %d expected messages", __func__, completed - old); 
     2732 
     2733        /* try to complete unexpected sends */ 
    27892734 
    27902735        match = (uint64_t) BMX_MSG_UNEXPECTED << BMX_MSG_SHIFT; 
     
    27952740                uint32_t        result          = 0; 
    27962741                mx_status_t     status; 
    2797                 list_t          *unex_txs       = &bmi_mx->bmx_unex_txs; 
    27982742                int             again           = 1; 
    27992743 
    28002744                ctx = NULL; 
    2801  
    2802                 gen_mutex_lock(&bmi_mx->bmx_unex_txs_lock); 
    2803                 if (!qlist_empty(unex_txs)) { 
    2804                         ctx = qlist_entry(unex_txs->next, struct bmx_ctx, mxc_list); 
    2805                         peer = ctx->mxc_peer; 
    2806                         qlist_del_init(&ctx->mxc_list); 
    2807                         result = 1; 
    2808                 } 
    2809                 gen_mutex_unlock(&bmi_mx->bmx_unex_txs_lock); 
    28102745 
    28112746                while (!ctx && again) { 
     
    28162751                                bmx_deq_pending_ctx(ctx); 
    28172752                                peer = ctx->mxc_peer; 
    2818                                 if (ctx->mxc_type == BMX_REQ_RX) { 
    2819                                         /* queue until testunexpected is called */ 
    2820                                         bmx_q_unex_ctx(ctx); 
     2753                                if (ctx->mxc_type == BMX_REQ_RX || 
     2754                                    ctx->mxc_mop->context_id != context_id) { 
     2755                                        /* queue until testunexpected or queue 
     2756                                         * until testcontext for the correct context */ 
     2757                                        bmx_q_completed(ctx, BMX_CTX_COMPLETED, status, 
     2758                                                        bmx_mx_to_bmi_errno(status.code)); 
    28212759                                        result = 0; 
    28222760                                        again = 1; 
     
    28342772                                        llu(ctx->mxc_mop->op_id)); 
    28352773 
    2836                         outids[completed] = ctx->mxc_mop->op_id; 
    2837                         if (status.code == MX_SUCCESS) { 
    2838                                 errs[completed] = 0; 
    2839                                 sizes[completed] = status.xfer_length; 
    2840                         } else { 
    2841                                 errs[completed] = bmx_mx_to_bmi_errno(status.code); 
     2774                        ctx->mxc_mxstat = status; 
     2775                        bmx_complete_ctx(ctx, &outids[completed], &errs[completed], 
     2776                                         &sizes[completed], &user_ptrs[completed]); 
     2777 
     2778                        if (status.code != MX_SUCCESS) { 
    28422779                                debug(BMX_DB_CTX, "%s unexpected send completed with " 
    28432780                                      "error %s", __func__, mx_strstatus(status.code)); 
    28442781                                bmx_peer_disconnect(peer, 0, BMI_ENETRESET); 
    28452782                        } 
    2846                         if (user_ptrs) 
    2847                                 user_ptrs[completed] = ctx->mxc_mop->user_ptr; 
    2848                         PINT_EVENT_END( 
    2849                             (ctx->mxc_type == BMX_REQ_TX ? 
    2850                              bmi_mx_send_event_id : bmi_mx_recv_event_id), 
    2851                             bmi_mx_pid, NULL, ctx->mxc_mop->event_id, 
    2852                             ctx->mxc_mop->op_id, status.xfer_length); 
    2853  
    2854                         id_gen_fast_unregister(ctx->mxc_mop->op_id); 
    2855                         BMX_FREE(ctx->mxc_mop, sizeof(*ctx->mxc_mop)); 
    28562783                        completed++; 
    2857 #if BMX_LOGGING 
    2858                         MPE_Log_event(sendunex_finish, (int) ctx->mxc_tag, NULL); 
    2859 #endif 
    2860  
    2861                         bmx_put_idle_tx(ctx); 
    2862                         bmx_peer_decref(peer); /* drop the ref taken in [send|recv]_common */ 
    2863                 } 
    2864         } 
     2784                } 
     2785        } 
     2786        bmx_release_completion_token(); 
     2787 
    28652788        if (completed - old > 0) { 
    28662789                debug(BMX_DB_CTX, "%s found %d unexpected tx messages",  
     
    28882811        struct bmx_ctx  *rx             = NULL; 
    28892812        struct bmx_peer *peer           = NULL; 
    2890         list_t          *unex_rxs       = &bmi_mx->bmx_unex_rxs; 
    28912813        int             again           = 1; 
    28922814 
     
    28972819 
    28982820        bmx_connection_handlers(); 
     2821 
     2822        bmx_get_completion_token(); 
    28992823 
    29002824        /* if the unexpected handler cannot get a rx, it does not post a receive. 
     
    29032827        if (result) { 
    29042828                int     ret     = 0; 
    2905                 ret = bmx_post_unexpected_recv(status.source, 0, 0, 0, status.match_info, status.xfer_length); 
     2829                ret = bmx_post_unexpected_recv(status.source, 0, 0, 0, 
     2830                                               status.match_info, 
     2831                                               status.xfer_length); 
    29062832                if (ret != 0) { 
    29072833                        debug(BMX_DB_CTX, "%s mx_iprobe() found rx with match 0x%llx " 
     
    29142840        *outcount = 0; 
    29152841 
    2916         gen_mutex_lock(&bmi_mx->bmx_unex_rxs_lock); 
    2917         if (!qlist_empty(unex_rxs)) { 
    2918                 rx = qlist_entry(unex_rxs->next, struct bmx_ctx, mxc_list); 
     2842        bmx_deq_unex_rx(&rx); 
     2843        if (rx) { 
     2844                result = 1; 
     2845                status = rx->mxc_mxstat; 
    29192846                peer = rx->mxc_peer; 
    2920                 qlist_del_init(&rx->mxc_list); 
    2921                 result = 1; 
    2922         } 
    2923         gen_mutex_unlock(&bmi_mx->bmx_unex_rxs_lock); 
     2847        } 
    29242848 
    29252849        while (!rx && again) { 
     
    29312855                        peer = rx->mxc_peer; 
    29322856                        if (rx->mxc_type == BMX_REQ_TX) { 
    2933                                 bmx_q_unex_ctx(rx); 
     2857                                bmx_q_completed(rx, BMX_CTX_COMPLETED, status, 
     2858                                                bmx_mx_to_bmi_errno(status.code)); 
    29342859                                result = 0; 
    29352860                                again = 1; 
     
    29532878                ui->tag = rx->mxc_tag; 
    29542879 
    2955 #if BMX_LOGGING 
    2956                 MPE_Log_event(recvunex_finish, (int) rx->mxc_tag, NULL); 
    2957 #endif 
    2958                 bmx_put_idle_rx(rx); 
     2880                bmx_put_idle_ctx(rx); 
    29592881                bmx_peer_decref(peer); /* drop the ref taken in unexpected_recv() */ 
    29602882                *outcount = 1; 
    29612883        } 
     2884        bmx_release_completion_token(); 
     2885 
    29622886        if (print) 
    29632887                BMX_EXIT; 
     
    30142938 
    30152939                ret = bmx_open_endpoint(&bmi_mx->bmx_ep, 
    3016                                         bmi_mx->bmx_board, 
     2940                                        MX_ANY_NIC, 
    30172941                                        MX_ANY_ENDPOINT); 
    30182942                if (ret != 0) { 
     
    30262950                mx_decompose_endpoint_addr2(epa, &nic_id, &bmi_mx->bmx_ep_id, 
    30272951                                            &bmi_mx->bmx_sid); 
     2952                /* get our board number */ 
     2953                mx_nic_id_to_board_number(nic_id, &bmi_mx->bmx_board); 
    30282954                /* get our hostname */ 
    30292955                mx_nic_id_to_hostname(nic_id, host); 
     
    31413067/* NOTE There may be a race between this and BMI_mx_testcontext(). */ 
    31423068static int 
    3143 BMI_mx_cancel(bmi_op_id_t id, bmi_context_id context_id __unused) 
     3069BMI_mx_cancel(bmi_op_id_t id, bmi_context_id context_id) 
    31443070{ 
    31453071        struct method_op        *mop; 
     
    31503076        BMX_ENTER; 
    31513077 
     3078        bmx_get_completion_token(); 
     3079 
    31523080        mop = id_gen_fast_lookup(id); 
    31533081        ctx = mop->method_data; 
    31543082        peer = ctx->mxc_peer; 
    31553083 
     3084        assert(context_id == ctx->mxc_mop->context_id); 
     3085 
    31563086        debug(BMX_DB_CTX, "%s %s op_id %llu mxc_state %d peer state %d", __func__,  
    31573087                        ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX",  
    31583088                        llu(ctx->mxc_mop->op_id), ctx->mxc_state, peer->mxp_state); 
     3089 
     3090        /* avoid race with connection setup */ 
     3091        gen_mutex_lock(&peer->mxp_lock); 
     3092 
    31593093        switch (ctx->mxc_state) { 
    31603094        case BMX_CTX_QUEUED: 
    3161                 /* we are racing with the connection setup */ 
    3162                 bmx_deq_ctx(ctx); 
    3163                 bmx_q_canceled_ctx(ctx, BMI_ECANCEL); 
     3095                qlist_del_init(&ctx->mxc_list); 
     3096                gen_mutex_unlock(&peer->mxp_lock); 
     3097                bmx_q_completed(ctx, BMX_CTX_CANCELED, BMX_NO_STATUS, BMI_ECANCEL); 
    31643098                break; 
    31653099        case BMX_CTX_PENDING: 
     3100                gen_mutex_unlock(&peer->mxp_lock); 
    31663101                if (ctx->mxc_type == BMX_REQ_TX) { 
    31673102                        /* see if it completed first */ 
     
    31703105                                debug(BMX_DB_CTX, "%s completed TX op_id %llu " 
    31713106                                      "mxc_state %d peer state %d status.code %s", 
    3172                                       __func__, llu(ctx->mxc_mop->op_id), ctx->mxc_state,  
     3107                                      __func__, llu(ctx->mxc_mop->op_id), ctx->mxc_state, 
    31733108                                      peer->mxp_state, mx_strstatus(ctx->mxc_mxstat.code)); 
    31743109                                bmx_deq_pending_ctx(ctx); 
    3175                                 bmx_q_canceled_ctx(ctx,  BMI_ECANCEL); 
     3110                                bmx_q_completed(ctx, BMX_CTX_CANCELED, 
     3111                                                ctx->mxc_mxstat, BMI_ECANCEL); 
    31763112                        } else { 
    31773113                                /* and if not, then disconnect() */ 
     
    31823118                        if (result == 1) { 
    31833119                                bmx_deq_pending_ctx(ctx); 
    3184                                 bmx_q_canceled_ctx(ctx,  BMI_ECANCEL); 
     3120                                bmx_q_completed(ctx, BMX_CTX_CANCELED, 
     3121                                                BMX_NO_STATUS, BMI_ECANCEL); 
    31853122                        } 
    31863123                } 
     
    31903127                        ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", ctx->mxc_state); 
    31913128        } 
     3129        bmx_release_completion_token(); 
     3130 
    31923131        BMX_EXIT; 
    31933132 
     
    32133152{ 
    32143153    .method_name               = "bmi_mx", 
     3154    .flags = 0, 
    32153155    .initialize                = BMI_mx_initialize, 
    32163156    .finalize                  = BMI_mx_finalize, 
  • branches/Orange-Branch/src/io/bmi/bmi_mx/mx.h

    r6980 r8317  
    1616#include <unistd.h> 
    1717#include <errno.h> 
     18#include <assert.h> 
    1819 
    1920#include <mx_extensions.h>      /* needed for callback handler, etc. */ 
     
    5455#define BMX_DEBUG     1         /* enable debug (gossip) statements */ 
    5556#define BMX_MEM_ACCT  0         /* track number of bytes alloc's and freed */ 
    56 #define BMX_LOGGING   0         /* use MPE logging routines */ 
    57  
    58 #if BMX_LOGGING 
    59 #include "mpe.h" 
    60 #endif 
    6157 
    6258#if BMX_MEM_TWEAK 
     
    166162        gen_mutex_t         bmx_idle_rxs_lock;  /* idle_rxs lock */ 
    167163 
    168         list_t              bmx_canceled;       /* canceled reqs waiting for test */ 
    169         gen_mutex_t         bmx_canceled_lock;  /* canceled list lock */ 
    170  
    171         list_t              bmx_unex_txs;       /* completed unexpected sends */ 
    172         gen_mutex_t         bmx_unex_txs_lock;  /* completed unexpected sends lock */ 
     164        gen_mutex_t         bmx_completion_lock; /* lock for test* functions */ 
     165        int                 bmx_refcount;       /* try to avoid races between test* 
     166                                                   and cancel functions */ 
     167 
     168                                                /* completed expected msgs 
     169                                                 * including unexpected sends */ 
     170        list_t              bmx_done_q[BMI_MAX_CONTEXTS]; 
     171        gen_mutex_t         bmx_done_q_lock[BMI_MAX_CONTEXTS]; 
     172 
    173173        list_t              bmx_unex_rxs;       /* completed unexpected recvs */ 
    174174        gen_mutex_t         bmx_unex_rxs_lock;  /* completed unexpected recvs lock */ 
     
    278278        mx_request_t        mxc_mxreq;      /* MX request */ 
    279279        mx_status_t         mxc_mxstat;     /* MX status */ 
     280        bmi_error_code_t    mxc_error;      /* BMI error code */ 
    280281 
    281282        uint64_t            mxc_get;        /* # of times returned from idle list */ 
  • branches/Orange-Branch/src/io/bmi/bmi_portals/portals.c

    r7376 r8317  
    22942294{ 
    22952295    .method_name = "bmi_portals", 
     2296    .flags = 0, 
    22962297    .initialize = bmip_initialize, 
    22972298    .finalize = bmip_finalize, 
  • branches/Orange-Branch/src/io/bmi/bmi_tcp/socket-collection.c

    r7681 r8317  
    9090    if(new_server_socket > -1) 
    9191    { 
    92         tmp_scp->pollfd_array[0].fd = new_server_socket; 
    93         tmp_scp->pollfd_array[0].events = POLLIN; 
    94         tmp_scp->addr_array[0] = NULL; 
     92        tmp_scp->pollfd_array[tmp_scp->array_count].fd = new_server_socket; 
     93        tmp_scp->pollfd_array[tmp_scp->array_count].events = POLLIN; 
     94        tmp_scp->addr_array[tmp_scp->array_count] = NULL; 
    9595        tmp_scp->array_count++; 
    96         /* Add the pipe_fd[0] fd to the poll in set always */ 
    97         tmp_scp->pollfd_array[1].fd = tmp_scp->pipe_fd[0]; 
    98         tmp_scp->pollfd_array[1].events = POLLIN; 
    99         tmp_scp->addr_array[1] = NULL; 
    100         tmp_scp->array_count++; 
    101     } 
     96    } 
     97 
     98    /* Add the pipe_fd[0] fd to the poll in set always */ 
     99    tmp_scp->pollfd_array[tmp_scp->array_count].fd = tmp_scp->pipe_fd[0]; 
     100    tmp_scp->pollfd_array[tmp_scp->array_count].events = POLLIN; 
     101    tmp_scp->addr_array[tmp_scp->array_count] = NULL; 
     102    tmp_scp->array_count++; 
    102103 
    103104    return (tmp_scp); 
  • branches/Orange-Branch/src/io/flow/flow.h

    r7471 r8317  
    100100 
    101101    /* function to be triggered upon completion */ 
    102     void(*callback)(struct flow_descriptor* flow_d); 
     102    void(*callback)(struct flow_descriptor* flow_d, int cancel_path); 
    103103 
    104104    struct flow_endpoint src;   /* src endpoint */ 
  • branches/Orange-Branch/src/io/flow/flowproto-bmi-cache/flowproto-bmi-cache-server.c

    r7471 r8317  
    490490                free(flow_data); 
    491491                flow_d->release(flow_d); 
    492                 flow_d->callback(flow_d); 
     492                flow_d->callback(flow_d, 0); 
    493493                fprintf(stderr, "bmi_cache_request_init: exit with return 1. zero request.\n"); 
    494494                return(1); 
     
    801801                        flow_d->state = FLOW_COMPLETE; 
    802802                        flow_d->release(flow_d); 
    803                         flow_d->callback(flow_d); 
     803                        flow_d->callback(flow_d, 0); 
    804804                        fprintf(stderr, "bmi_recv_callback_fn: request is done\n"); 
    805805                        return; 
  • branches/Orange-Branch/src/io/flow/flowproto-bmi-trove/flowproto-multiqueue.c

    r7603 r8317  
    3131#define MAX_REGIONS 64 
    3232 
    33 #define FLOW_CLEANUP(__flow_data)                                     \ 
     33#define FLOW_CLEANUP_CANCEL_PATH(__flow_data, __cancel_path)          \ 
    3434do {                                                                  \ 
    3535    struct flow_descriptor *__flow_d = (__flow_data)->parent;         \ 
     
    4040    free(__flow_data);                                                \ 
    4141    __flow_d->release(__flow_d);                                      \ 
    42     __flow_d->callback(__flow_d);                                     \ 
     42    __flow_d->callback(__flow_d, __cancel_path);                      \ 
    4343} while(0) 
     44 
     45#define FLOW_CLEANUP(___flow_data) FLOW_CLEANUP_CANCEL_PATH(___flow_data, 0) 
    4446 
    4547struct result_chain_entry 
     
    480482        { 
    481483            gen_mutex_unlock(&flow_data->parent->flow_mutex); 
    482             FLOW_CLEANUP(flow_data); 
     484            FLOW_CLEANUP_CANCEL_PATH(flow_data, 1); 
    483485            return(0); 
    484486        } 
  • branches/Orange-Branch/src/io/job/job.c

    r8251 r8317  
    130130static void trove_thread_mgr_callback(void* data, 
    131131    PVFS_error error_code); 
    132 static void flow_callback(flow_descriptor* flow_d); 
     132static void flow_callback(flow_descriptor* flow_d, int cancel_path); 
    133133#ifndef __PVFS2_JOB_THREADED__ 
    134134static gen_mutex_t work_cycle_mutex = GEN_MUTEX_INITIALIZER; 
     
    52675267 * no return value 
    52685268 */ 
    5269 static void flow_callback(flow_descriptor* flow_d) 
     5269static void flow_callback(flow_descriptor* flow_d, int cancel_path) 
    52705270{ 
    52715271    struct job_desc* tmp_desc = (struct job_desc*)flow_d->user_ptr; 
     
    52815281 
    52825282    /* set job descriptor fields and put into completion queue */ 
    5283     gen_mutex_lock(&completion_mutex); 
     5283 
     5284    /* if this is being triggered directly from PINT_flow_cancel(), then the 
     5285     * completion mutex is already held by the caller; skip the mutex. 
     5286     */ 
     5287    if(!cancel_path) 
     5288        gen_mutex_lock(&completion_mutex); 
    52845289    job_desc_q_add(completion_queue_array[tmp_desc->context_id], 
    52855290                   tmp_desc); 
     
    52955300    pthread_cond_signal(&completion_cond); 
    52965301#endif 
    5297     gen_mutex_unlock(&completion_mutex); 
     5302    if(!cancel_path) 
     5303        gen_mutex_unlock(&completion_mutex); 
    52985304 
    52995305    return; 
  • branches/Orange-Branch/src/io/trove/pvfs2-storage.h

    r7450 r8317  
    156156        else                                                   \ 
    157157        {                                                      \ 
    158             (dest)->mtime = time(NULL);                        \ 
     158            (dest)->mtime = PINT_util_mktime_version(time(NULL)); \ 
    159159        }                                                      \ 
    160160    }                                                          \ 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-alt-aio.c

    r7627 r8317  
    372372    alt_aio_bstream_read_list, 
    373373    alt_aio_bstream_write_list, 
    374     dbpf_bstream_flush 
     374    dbpf_bstream_flush, 
     375    NULL 
    375376}; 
    376377 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-attr-cache.c

    r7450 r8317  
    141141int dbpf_attr_cache_finalize(void) 
    142142{ 
    143     int ret = -1, i = 0; 
     143    int ret = -1, i = 0, j = 0; 
    144144    struct qlist_head *hash_link = NULL; 
    145145    dbpf_attr_cache_elem_t *cache_elem = NULL; 
     
    157157                    cache_elem = qhash_entry( 
    158158                        hash_link, dbpf_attr_cache_elem_t, hash_link); 
     159                    for( j = 0; j < cache_elem->num_keyval_pairs; j++ ) 
     160                    { 
     161                        /* any elements still existing need their keyval pairs 
     162                         * data pointer free'd before the element is free'd */ 
     163                        if( cache_elem->keyval_pairs[j].data ) 
     164                            free(cache_elem->keyval_pairs[j].data); 
     165                    } 
    159166                    free(cache_elem); 
    160167                    s_current_num_cache_elems--; 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-bstream-direct.c

    r7750 r8317  
    659659    PINT_mem_aligned_free(aligned_buf); 
    660660 
    661     return read_size; 
     661    return ret; 
    662662} 
    663663 
     
    858858                goto cache_put; 
    859859            } 
    860             if(qop_p->op.flags & TROVE_SYNC) 
    861             { 
    862                 sync_required = 1; 
    863             } 
     860            sync_required = 1; 
    864861        } 
    865862        gen_mutex_unlock(&dbpf_update_size_lock); 
     
    10681065                        NULL, 
    10691066                        user_ptr, 
    1070                         0, 
     1067                        TROVE_SYNC, 
    10711068                        context_id); 
    10721069 
     
    13541351            /* consume stream region and update mem region */ 
    13551352            ext_size = cur_stream_size; 
     1353            ext_ptr = cur_mem_off; 
     1354            ext_off = cur_stream_off; 
    13561355 
    13571356            cur_mem_size -= cur_stream_size; 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-dspace.c

    r8133 r8317  
    15471547        } 
    15481548 
    1549         return bstream_method_table[method_id]->bstream_cancel( 
    1550             coll_id, id, context_id); 
     1549        if(bstream_method_table[method_id]->bstream_cancel) 
     1550        { 
     1551            return bstream_method_table[method_id]->bstream_cancel( 
     1552                coll_id, id, context_id); 
     1553        } 
     1554        else 
     1555        { 
     1556            gossip_debug(GOSSIP_TROVE_DEBUG, "Trove cancellation is not supported for this operation type; ignoring.\n"); 
     1557            return(0); 
     1558 
     1559        } 
    15511560    } 
    15521561 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-mgmt.c

    r7992 r8317  
    19541954    coll_p->meta_sync_enabled = 1; /* MUST be 1 !*/ 
    19551955 
    1956  
    19571956    dbpf_collection_register(coll_p); 
    19581957    *out_coll_id_p = coll_p->coll_id; 
     1958 
     1959    clear_stranded_bstreams(coll_p->coll_id); 
     1960 
    19591961    return 1; 
    19601962} 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-null-aio.c

    r7607 r8317  
    395395    null_aio_bstream_read_list, 
    396396    null_aio_bstream_write_list, 
    397     dbpf_bstream_flush 
     397    dbpf_bstream_flush, 
     398    NULL 
    398399}; 
    399400 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-open-cache.c

    r8114 r8317  
    2323#include <string.h> 
    2424#include <db.h> 
     25#include <dirent.h> 
    2526 
    2627#include "trove.h" 
     
    634635} 
    635636 
     637void clear_stranded_bstreams(TROVE_coll_id coll_id) 
     638{ 
     639    char path_name[PATH_MAX]; 
     640    DIR *current_dir = NULL; 
     641    struct dirent *current_dirent = NULL; 
     642    struct stat file_info; 
     643    struct file_struct *tmp_item; 
     644 
     645    DBPF_GET_STRANDED_BSTREAM_DIRNAME(path_name, PATH_MAX, 
     646                                      my_storage_p->data_path, coll_id); 
     647 
     648    /* remove entries in the stranded bstreams directory */ 
     649    current_dir = opendir(path_name); 
     650    if(current_dir) 
     651    { 
     652        while((current_dirent = readdir(current_dir))) 
     653        { 
     654            if((strcmp(current_dirent->d_name, ".") == 0) || 
     655               (strcmp(current_dirent->d_name, "..") == 0)) 
     656            { 
     657                continue; 
     658            } 
     659            tmp_item = (struct file_struct *) malloc(sizeof(struct file_struct)); 
     660            if(!tmp_item) 
     661            { 
     662                gossip_err("Unable to allocate memory for file_struct [%d].\n", errno); 
     663                return; 
     664            } 
     665            tmp_item->pathname = malloc(PATH_MAX); 
     666            if(!tmp_item->pathname) 
     667            { 
     668                gossip_err("Unable to allocate memory for pathname[%d].\n", errno); 
     669                free(tmp_item); 
     670                return; 
     671            } 
     672            snprintf(tmp_item->pathname, PATH_MAX, "%s/%s", path_name, 
     673                     current_dirent->d_name); 
     674            if(stat(tmp_item->pathname, &file_info) < 0) 
     675            { 
     676                gossip_err("error doing stat on bstream entry\n"); 
     677                continue; 
     678            } 
     679            assert(S_ISREG(file_info.st_mode)); 
     680            /* Add to the queue */ 
     681 
     682            pthread_mutex_lock(&dbpf_unlink_context.mutex); 
     683            qlist_add_tail(&tmp_item->list_link, &dbpf_unlink_context.global_list); 
     684            pthread_cond_signal(&dbpf_unlink_context.data_available); 
     685            pthread_mutex_unlock(&dbpf_unlink_context.mutex); 
     686            gossip_debug(GOSSIP_DBPF_OPEN_CACHE_DEBUG, 
     687              "Added [%s] to the queue.\n", tmp_item->pathname); 
     688        } 
     689        closedir(current_dir); 
     690    } 
     691    else 
     692    {    
     693        gossip_err("Unable to open stranded bstream directory [%s] to " 
     694          "perform initialization of stranded bstream cleanup", path_name); 
     695    } 
     696} 
     697 
    636698/* 
    637699 * Local variables: 
  • branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-open-cache.h

    r7560 r8317  
    4545    TROVE_handle handle); 
    4646 
     47void clear_stranded_bstreams(TROVE_coll_id coll_id); 
     48     
    4749#endif /* __DBPF_OPEN_CACHE_H__ */ 
    4850 
  • branches/Orange-Branch/src/kernel/linux-2.6/inode.c

    r7924 r8317  
    134134struct backing_dev_info pvfs2_backing_dev_info = 
    135135{ 
     136#ifdef HAVE_BACKING_DEV_INFO_NAME 
     137    .name = "pvfs2", 
     138#endif 
    136139    .ra_pages = 0, 
    137140#ifdef HAVE_BDI_MEMORY_BACKED 
  • branches/Orange-Branch/src/kernel/linux-2.6/namei.c

    r7968 r8317  
    7171    pvfs2_inode_t *parent = NULL, *found_pvfs2_inode = NULL; 
    7272    struct super_block *sb = NULL; 
    73     struct dentry *res = NULL; 
    7473 
    7574    /* 
     
    202201    if (inode && !is_bad_inode(inode)) 
    203202    { 
     203        struct dentry *res; 
     204 
    204205        gossip_debug(GOSSIP_NAME_DEBUG, "%s:%s:%d Found good inode [%lu] with count [%d]\n",  
    205206            __FILE__, __func__, __LINE__, ino