Changeset 8317
- Timestamp:
- 04/30/10 16:00:57 (3 years ago)
- Location:
- branches/Orange-Branch
- Files:
-
- 83 modified
-
Makefile.in (modified) (2 diffs)
-
configure (modified) (13 diffs)
-
configure.in (modified) (4 diffs)
-
doc/REFERENCES.bib (modified) (6 diffs)
-
doc/add-server-req (modified) (1 diff)
-
doc/pvfs2-faq.tex (modified) (2 diffs)
-
doc/pvfs2-logging.txt (modified) (1 diff)
-
doc/pvfs2-quickstart.tex (modified) (1 diff)
-
examples/heartbeat/hardware-specific/Filesystem-qla-monitor (modified) (3 diffs)
-
include/pvfs2-debug.h (modified) (1 diff)
-
include/pvfs2-encode-stubs.h (modified) (1 diff)
-
include/pvfs2-mgmt.h (modified) (3 diffs)
-
include/pvfs2-types.h (modified) (2 diffs)
-
maint/config/kernel.m4 (modified) (4 diffs)
-
pvfs2-config.h.in (modified) (4 diffs)
-
src/apps/admin/pvfs2-ls.c (modified) (28 diffs)
-
src/apps/admin/pvfs2-stat.c (modified) (3 diffs)
-
src/apps/fuse/pvfs2fuse.c (modified) (4 diffs)
-
src/apps/kernel/linux/pvfs2-client-core.c (modified) (8 diffs)
-
src/apps/kernel/linux/pvfs2-client.c (modified) (1 diff)
-
src/client/sysint/client-state-machine.c (modified) (11 diffs)
-
src/client/sysint/client-state-machine.h (modified) (2 diffs)
-
src/client/sysint/fs-add.sm (modified) (11 diffs)
-
src/client/sysint/initialize.c (modified) (1 diff)
-
src/client/sysint/server-get-config.sm (modified) (3 diffs)
-
src/client/sysint/sys-create.sm (modified) (1 diff)
-
src/client/sysint/sys-io.sm (modified) (1 diff)
-
src/client/sysint/sys-truncate.sm (modified) (2 diffs)
-
src/common/gossip/gossip.c (modified) (1 diff)
-
src/common/misc/pint-hint.c (modified) (1 diff)
-
src/common/misc/pint-util.c (modified) (3 diffs)
-
src/common/misc/pint-util.h (modified) (1 diff)
-
src/common/misc/server-config.c (modified) (1 diff)
-
src/common/misc/state-machine-fns.c (modified) (1 diff)
-
src/io/bmi/bmi-method-support.h (modified) (2 diffs)
-
src/io/bmi/bmi.c (modified) (12 diffs)
-
src/io/bmi/bmi_gm/bmi-gm.c (modified) (1 diff)
-
src/io/bmi/bmi_ib/ib.c (modified) (8 diffs)
-
src/io/bmi/bmi_mx/README (modified) (3 diffs)
-
src/io/bmi/bmi_mx/mx.c (modified) (62 diffs)
-
src/io/bmi/bmi_mx/mx.h (modified) (4 diffs)
-
src/io/bmi/bmi_portals/portals.c (modified) (1 diff)
-
src/io/bmi/bmi_tcp/socket-collection.c (modified) (1 diff)
-
src/io/flow/flow.h (modified) (1 diff)
-
src/io/flow/flowproto-bmi-cache/flowproto-bmi-cache-server.c (modified) (2 diffs)
-
src/io/flow/flowproto-bmi-trove/flowproto-multiqueue.c (modified) (3 diffs)
-
src/io/job/job.c (modified) (4 diffs)
-
src/io/trove/pvfs2-storage.h (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-alt-aio.c (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-attr-cache.c (modified) (2 diffs)
-
src/io/trove/trove-dbpf/dbpf-bstream-direct.c (modified) (4 diffs)
-
src/io/trove/trove-dbpf/dbpf-dspace.c (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-mgmt.c (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-null-aio.c (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-open-cache.c (modified) (2 diffs)
-
src/io/trove/trove-dbpf/dbpf-open-cache.h (modified) (1 diff)
-
src/kernel/linux-2.6/inode.c (modified) (1 diff)
-
src/kernel/linux-2.6/namei.c (modified) (2 diffs)
-
src/kernel/linux-2.6/pvfs2-proc.c (modified) (7 diffs)
-
src/kernel/linux-2.6/super.c (modified) (8 diffs)
-
src/proto/PINT-le-bytefield.c (modified) (1 diff)
-
src/proto/endecode-funcs.h (modified) (1 diff)
-
src/proto/pvfs2-attr.h (modified) (4 diffs)
-
src/proto/pvfs2-req-proto.h (modified) (49 diffs)
-
src/server/chdirent.sm (modified) (1 diff)
-
src/server/crdirent.sm (modified) (1 diff)
-
src/server/lookup.sm (modified) (1 diff)
-
src/server/module.mk.in (modified) (1 diff)
-
src/server/prelude.sm (modified) (1 diff)
-
src/server/pvfs2-server.c (modified) (4 diffs)
-
src/server/pvfs2-server.h (modified) (1 diff)
-
src/server/rmdirent.sm (modified) (1 diff)
-
src/server/set-attr.sm (modified) (1 diff)
-
src/server/tree-communicate.sm (modified) (17 diffs)
-
src/server/unstuff.sm (modified) (1 diff)
-
test/automated/README.tests (modified) (1 diff)
-
test/automated/vfs-tests.d/ltp (modified) (1 diff)
-
test/configure (modified) (4 diffs)
-
test/configure.in (modified) (3 diffs)
-
test/io/bmi/pingpong.c (modified) (13 diffs)
-
test/io/trove/module.mk.in (modified) (1 diff)
-
test/io/trove/trove-bench-concurrent.c (modified) (2 diffs)
-
test/pvfs2-test-config.h.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Branch/Makefile.in
r7763 r8317 79 79 BUILD_OPENIB = @BUILD_OPENIB@ 80 80 BUILD_PORTALS = @BUILD_PORTALS@ 81 BUILD_ZOID = @BUILD_ZOID@ 81 82 BUILD_VIS = @BUILD_VIS@ 82 83 BUILD_KARMA = @BUILD_KARMA@ … … 400 401 endif 401 402 403 ifdef BUILD_ZOID 404 CFLAGS += -D__STATIC_METHOD_BMI_ZOID__ 405 endif 406 402 407 # enable mmap-readahead cache (unless disabled by configure) 403 408 ifdef MMAP_RA_CACHE -
branches/Orange-Branch/configure
r7987 r8317 643 643 GOSSIP_ENABLE_BACKTRACE 644 644 SERVER_LDFLAGS 645 ZOID_SRCDIR 646 BUILD_ZOID 645 647 PORTALS_LIBS 646 648 PORTALS_INCS … … 819 821 with_portals_includes 820 822 with_portals_libs 823 with_zoid 821 824 enable_static_server 822 825 ' … … 1527 1530 --with-portals-libs=<dir> 1528 1531 Extra LIBS to link Portals libraries 1532 --with-zoid=<dir> Location of the ZOID tree (default no ZOID) 1529 1533 1530 1534 Some influential environment variables: … … 3687 3691 3688 3692 3693 if 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; } 3696 if test "${ac_cv_header_pwd_h+set}" = set; then 3697 $as_echo_n "(cached) " >&6 3698 fi 3699 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_pwd_h" >&5 3700 $as_echo "$ac_cv_header_pwd_h" >&6; } 3701 else 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; } 3705 cat >conftest.$ac_ext <<_ACEOF 3706 /* confdefs.h. */ 3707 _ACEOF 3708 cat confdefs.h >>conftest.$ac_ext 3709 cat >>conftest.$ac_ext <<_ACEOF 3710 /* end confdefs.h. */ 3711 $ac_includes_default 3712 #include <pwd.h> 3713 _ACEOF 3714 rm -f conftest.$ac_objext 3715 if { (ac_try="$ac_compile" 3716 case "(($ac_try" in 3717 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 3718 *) ac_try_echo=$ac_try;; 3719 esac 3720 eval 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 3733 else 3734 $as_echo "$as_me: failed program was:" >&5 3735 sed 's/^/| /' conftest.$ac_ext >&5 3736 3737 ac_header_compiler=no 3738 fi 3739 3740 rm -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; } 3747 cat >conftest.$ac_ext <<_ACEOF 3748 /* confdefs.h. */ 3749 _ACEOF 3750 cat confdefs.h >>conftest.$ac_ext 3751 cat >>conftest.$ac_ext <<_ACEOF 3752 /* end confdefs.h. */ 3753 #include <pwd.h> 3754 _ACEOF 3755 if { (ac_try="$ac_cpp conftest.$ac_ext" 3756 case "(($ac_try" in 3757 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 3758 *) ac_try_echo=$ac_try;; 3759 esac 3760 eval 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 3773 else 3774 $as_echo "$as_me: failed program was:" >&5 3775 sed 's/^/| /' conftest.$ac_ext >&5 3776 3777 ac_header_preproc=no 3778 fi 3779 3780 rm -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? 3785 case $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 ;; 3808 esac 3809 { $as_echo "$as_me:$LINENO: checking for pwd.h" >&5 3810 $as_echo_n "checking for pwd.h... " >&6; } 3811 if test "${ac_cv_header_pwd_h+set}" = set; then 3812 $as_echo_n "(cached) " >&6 3813 else 3814 ac_cv_header_pwd_h=$ac_header_preproc 3815 fi 3816 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_pwd_h" >&5 3817 $as_echo "$ac_cv_header_pwd_h" >&6; } 3818 3819 fi 3820 if test "x$ac_cv_header_pwd_h" = x""yes; then 3821 3822 cat >>confdefs.h <<\_ACEOF 3823 #define HAVE_GETPWUID 1 3824 _ACEOF 3825 3826 fi 3827 3828 3689 3829 if test "${ac_cv_header_sys_vfs_h+set}" = set; then 3690 3830 { $as_echo "$as_me:$LINENO: checking for sys/vfs.h" >&5 … … 10182 10322 fi 10183 10323 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 10187 10328 /* confdefs.h. */ 10188 10329 _ACEOF … … 10199 10340 { 10200 10341 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); 10202 10350 10203 10351 ; … … 10227 10375 10228 10376 cat >>confdefs.h <<\_ACEOF 10229 #define HAVE_PROC_HANDLER_SIX_ARG 1 10377 #define HAVE_PROC_HANDLER_FILE_ARG 1 10378 _ACEOF 10379 10380 else 10381 $as_echo "$as_me: failed program was:" >&5 10382 sed 's/^/| /' conftest.$ac_ext >&5 10383 10384 { $as_echo "$as_me:$LINENO: result: no" >&5 10385 $as_echo "no" >&6; } 10386 10387 fi 10388 10389 rm -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 10396 cat confdefs.h >>conftest.$ac_ext 10397 cat >>conftest.$ac_ext <<_ACEOF 10398 /* end confdefs.h. */ 10399 10400 #define __KERNEL__ 10401 #include <linux/fs.h> 10402 #include <linux/sysctl.h> 10403 10404 int 10405 main () 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 10420 rm -f conftest.$ac_objext 10421 if { (ac_try="$ac_compile" 10422 case "(($ac_try" in 10423 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 10424 *) ac_try_echo=$ac_try;; 10425 esac 10426 eval 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 10441 cat >>confdefs.h <<\_ACEOF 10442 #define HAVE_PROC_HANDLER_PPOS_ARG 1 10230 10443 _ACEOF 10231 10444 … … 12927 13140 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 12928 13141 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 13147 cat confdefs.h >>conftest.$ac_ext 13148 cat >>conftest.$ac_ext <<_ACEOF 13149 /* end confdefs.h. */ 13150 13151 #define __KERNEL__ 13152 #include <linux/fs.h> 13153 13154 int 13155 main () 13156 { 13157 13158 struct super_block *s; 13159 list_empty(&s->s_dirty); 13160 13161 ; 13162 return 0; 13163 } 13164 _ACEOF 13165 rm -f conftest.$ac_objext 13166 if { (ac_try="$ac_compile" 13167 case "(($ac_try" in 13168 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 13169 *) ac_try_echo=$ac_try;; 13170 esac 13171 eval 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 13186 cat >>confdefs.h <<\_ACEOF 13187 #define HAVE_SB_DIRTY_LIST 1 13188 _ACEOF 13189 13190 else 13191 $as_echo "$as_me: failed program was:" >&5 13192 sed 's/^/| /' conftest.$ac_ext >&5 13193 13194 { $as_echo "$as_me:$LINENO: result: no" >&5 13195 $as_echo "no" >&6; } 13196 13197 fi 13198 13199 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 13200 12929 13201 tmp_cflags=$CFLAGS 12930 13202 CFLAGS="$CFLAGS -Werror" … … 12975 13247 cat >>confdefs.h <<\_ACEOF 12976 13248 #define HAVE_CURRENT_FSUID 1 13249 _ACEOF 13250 13251 else 13252 $as_echo "$as_me: failed program was:" >&5 13253 sed 's/^/| /' conftest.$ac_ext >&5 13254 13255 { $as_echo "$as_me:$LINENO: result: no" >&5 13256 $as_echo "no" >&6; } 13257 13258 fi 13259 13260 rm -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 13268 cat confdefs.h >>conftest.$ac_ext 13269 cat >>conftest.$ac_ext <<_ACEOF 13270 /* end confdefs.h. */ 13271 13272 #define __KERNEL__ 13273 #include <linux/fs.h> 13274 #include <linux/backing-dev.h> 13275 13276 int 13277 main () 13278 { 13279 13280 struct backing_dev_info foo = 13281 { 13282 .name = "foo" 13283 }; 13284 13285 ; 13286 return 0; 13287 } 13288 _ACEOF 13289 rm -f conftest.$ac_objext 13290 if { (ac_try="$ac_compile" 13291 case "(($ac_try" in 13292 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 13293 *) ac_try_echo=$ac_try;; 13294 esac 13295 eval 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 13310 cat >>confdefs.h <<\_ACEOF 13311 #define HAVE_BACKING_DEV_INFO_NAME 1 13312 _ACEOF 13313 13314 else 13315 $as_echo "$as_me: failed program was:" >&5 13316 sed 's/^/| /' conftest.$ac_ext >&5 13317 13318 { $as_echo "$as_me:$LINENO: result: no" >&5 13319 $as_echo "no" >&6; } 13320 13321 fi 13322 13323 rm -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 13332 cat confdefs.h >>conftest.$ac_ext 13333 cat >>conftest.$ac_ext <<_ACEOF 13334 /* end confdefs.h. */ 13335 13336 #define __KERNEL__ 13337 #include <linux/fs.h> 13338 #include <linux/backing-dev.h> 13339 13340 int 13341 main () 13342 { 13343 13344 int ret = bdi_init(NULL); 13345 13346 ; 13347 return 0; 13348 } 13349 _ACEOF 13350 rm -f conftest.$ac_objext 13351 if { (ac_try="$ac_compile" 13352 case "(($ac_try" in 13353 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 13354 *) ac_try_echo=$ac_try;; 13355 esac 13356 eval 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 13371 cat >>confdefs.h <<\_ACEOF 13372 #define HAVE_BDI_INIT 1 12977 13373 _ACEOF 12978 13374 … … 17490 17886 17491 17887 17888 17889 17890 # Check whether --with-zoid was given. 17891 if 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 17900 fi 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; } 17908 if test "${ac_cv_header_zbmi_h+set}" = set; then 17909 $as_echo_n "(cached) " >&6 17910 fi 17911 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_h" >&5 17912 $as_echo "$ac_cv_header_zbmi_h" >&6; } 17913 else 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; } 17917 cat >conftest.$ac_ext <<_ACEOF 17918 /* confdefs.h. */ 17919 _ACEOF 17920 cat confdefs.h >>conftest.$ac_ext 17921 cat >>conftest.$ac_ext <<_ACEOF 17922 /* end confdefs.h. */ 17923 $ac_includes_default 17924 #include <zbmi.h> 17925 _ACEOF 17926 rm -f conftest.$ac_objext 17927 if { (ac_try="$ac_compile" 17928 case "(($ac_try" in 17929 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 17930 *) ac_try_echo=$ac_try;; 17931 esac 17932 eval 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 17945 else 17946 $as_echo "$as_me: failed program was:" >&5 17947 sed 's/^/| /' conftest.$ac_ext >&5 17948 17949 ac_header_compiler=no 17950 fi 17951 17952 rm -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; } 17959 cat >conftest.$ac_ext <<_ACEOF 17960 /* confdefs.h. */ 17961 _ACEOF 17962 cat confdefs.h >>conftest.$ac_ext 17963 cat >>conftest.$ac_ext <<_ACEOF 17964 /* end confdefs.h. */ 17965 #include <zbmi.h> 17966 _ACEOF 17967 if { (ac_try="$ac_cpp conftest.$ac_ext" 17968 case "(($ac_try" in 17969 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 17970 *) ac_try_echo=$ac_try;; 17971 esac 17972 eval 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 17985 else 17986 $as_echo "$as_me: failed program was:" >&5 17987 sed 's/^/| /' conftest.$ac_ext >&5 17988 17989 ac_header_preproc=no 17990 fi 17991 17992 rm -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? 17997 case $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 ;; 18020 esac 18021 { $as_echo "$as_me:$LINENO: checking for zbmi.h" >&5 18022 $as_echo_n "checking for zbmi.h... " >&6; } 18023 if test "${ac_cv_header_zbmi_h+set}" = set; then 18024 $as_echo_n "(cached) " >&6 18025 else 18026 ac_cv_header_zbmi_h=$ac_header_preproc 18027 fi 18028 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_h" >&5 18029 $as_echo "$ac_cv_header_zbmi_h" >&6; } 18030 18031 fi 18032 if test "x$ac_cv_header_zbmi_h" = x""yes; then 18033 : 18034 else 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; }; } 18038 fi 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; } 18044 if test "${ac_cv_header_zoid_api_h+set}" = set; then 18045 $as_echo_n "(cached) " >&6 18046 fi 18047 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_zoid_api_h" >&5 18048 $as_echo "$ac_cv_header_zoid_api_h" >&6; } 18049 else 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; } 18053 cat >conftest.$ac_ext <<_ACEOF 18054 /* confdefs.h. */ 18055 _ACEOF 18056 cat confdefs.h >>conftest.$ac_ext 18057 cat >>conftest.$ac_ext <<_ACEOF 18058 /* end confdefs.h. */ 18059 $ac_includes_default 18060 #include <zoid_api.h> 18061 _ACEOF 18062 rm -f conftest.$ac_objext 18063 if { (ac_try="$ac_compile" 18064 case "(($ac_try" in 18065 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 18066 *) ac_try_echo=$ac_try;; 18067 esac 18068 eval 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 18081 else 18082 $as_echo "$as_me: failed program was:" >&5 18083 sed 's/^/| /' conftest.$ac_ext >&5 18084 18085 ac_header_compiler=no 18086 fi 18087 18088 rm -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; } 18095 cat >conftest.$ac_ext <<_ACEOF 18096 /* confdefs.h. */ 18097 _ACEOF 18098 cat confdefs.h >>conftest.$ac_ext 18099 cat >>conftest.$ac_ext <<_ACEOF 18100 /* end confdefs.h. */ 18101 #include <zoid_api.h> 18102 _ACEOF 18103 if { (ac_try="$ac_cpp conftest.$ac_ext" 18104 case "(($ac_try" in 18105 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 18106 *) ac_try_echo=$ac_try;; 18107 esac 18108 eval 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 18121 else 18122 $as_echo "$as_me: failed program was:" >&5 18123 sed 's/^/| /' conftest.$ac_ext >&5 18124 18125 ac_header_preproc=no 18126 fi 18127 18128 rm -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? 18133 case $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 ;; 18156 esac 18157 { $as_echo "$as_me:$LINENO: checking for zoid_api.h" >&5 18158 $as_echo_n "checking for zoid_api.h... " >&6; } 18159 if test "${ac_cv_header_zoid_api_h+set}" = set; then 18160 $as_echo_n "(cached) " >&6 18161 else 18162 ac_cv_header_zoid_api_h=$ac_header_preproc 18163 fi 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 18167 fi 18168 if test "x$ac_cv_header_zoid_api_h" = x""yes; then 18169 : 18170 else 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; }; } 18174 fi 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; } 18180 if test "${ac_cv_header_zbmi_protocol_h+set}" = set; then 18181 $as_echo_n "(cached) " >&6 18182 fi 18183 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_zbmi_protocol_h" >&5 18184 $as_echo "$ac_cv_header_zbmi_protocol_h" >&6; } 18185 else 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; } 18189 cat >conftest.$ac_ext <<_ACEOF 18190 /* confdefs.h. */ 18191 _ACEOF 18192 cat confdefs.h >>conftest.$ac_ext 18193 cat >>conftest.$ac_ext <<_ACEOF 18194 /* end confdefs.h. */ 18195 $ac_includes_default 18196 #include <zbmi_protocol.h> 18197 _ACEOF 18198 rm -f conftest.$ac_objext 18199 if { (ac_try="$ac_compile" 18200 case "(($ac_try" in 18201 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 18202 *) ac_try_echo=$ac_try;; 18203 esac 18204 eval 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 18217 else 18218 $as_echo "$as_me: failed program was:" >&5 18219 sed 's/^/| /' conftest.$ac_ext >&5 18220 18221 ac_header_compiler=no 18222 fi 18223 18224 rm -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; } 18231 cat >conftest.$ac_ext <<_ACEOF 18232 /* confdefs.h. */ 18233 _ACEOF 18234 cat confdefs.h >>conftest.$ac_ext 18235 cat >>conftest.$ac_ext <<_ACEOF 18236 /* end confdefs.h. */ 18237 #include <zbmi_protocol.h> 18238 _ACEOF 18239 if { (ac_try="$ac_cpp conftest.$ac_ext" 18240 case "(($ac_try" in 18241 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 18242 *) ac_try_echo=$ac_try;; 18243 esac 18244 eval 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 18257 else 18258 $as_echo "$as_me: failed program was:" >&5 18259 sed 's/^/| /' conftest.$ac_ext >&5 18260 18261 ac_header_preproc=no 18262 fi 18263 18264 rm -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? 18269 case $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 ;; 18292 esac 18293 { $as_echo "$as_me:$LINENO: checking for zbmi_protocol.h" >&5 18294 $as_echo_n "checking for zbmi_protocol.h... " >&6; } 18295 if test "${ac_cv_header_zbmi_protocol_h+set}" = set; then 18296 $as_echo_n "(cached) " >&6 18297 else 18298 ac_cv_header_zbmi_protocol_h=$ac_header_preproc 18299 fi 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 18303 fi 18304 if test "x$ac_cv_header_zbmi_protocol_h" = x""yes; then 18305 : 18306 else 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; }; } 18310 fi 18311 18312 18313 CPPFLAGS="$save_cppflags" 18314 BUILD_ZOID=1 18315 fi 18316 18317 18318 18319 17492 18320 { $as_echo "$as_me:$LINENO: checking for fgetxattr extra arguments" >&5 17493 18321 $as_echo_n "checking for fgetxattr extra arguments... " >&6; } … … 19324 20152 done 19325 20153 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"20154 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/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" 19327 20155 19328 20156 cat >confcache <<\_ACEOF … … 19952 20780 "src/io/bmi/bmi_ib/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/bmi/bmi_ib/module.mk" ;; 19953 20781 "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" ;; 19954 20783 "src/io/description/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/description/module.mk" ;; 19955 20784 "src/io/flow/module.mk") CONFIG_FILES="$CONFIG_FILES src/io/flow/module.mk" ;; … … 20764 21593 20765 21594 if 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 ; then21595 x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 -o x$BUILD_ZOID = x1 ; then 20767 21596 if test x$BUILD_BMI_TCP = x1 ; then 20768 21597 { $as_echo "$as_me:$LINENO: WARNING: You have selected to build $PKGSTR to use a \"fast\" network -
branches/Orange-Branch/configure.in
r7987 r8317 45 45 AC_CONFIG_HEADER(pvfs2-config.h) 46 46 47 AC_CHECK_HEADER([pwd.h], 48 [AC_DEFINE(HAVE_GETPWUID, 1, Define if pwd.h exists)]) 47 49 AC_CHECK_HEADER([sys/vfs.h], 48 50 [AC_DEFINE(HAVE_SYS_VFS_H, 1, Define if sys/vfs.h exists)]) … … 928 930 929 931 dnl 932 dnl Configure bmi_zoid, if --with-zoid or a variant given. 933 dnl 934 AX_ZOID 935 936 dnl 930 937 dnl check if fgetxattr takes extra arguments 931 938 AC_MSG_CHECKING([for fgetxattr extra arguments]) … … 1129 1136 src/io/bmi/bmi_ib/module.mk 1130 1137 src/io/bmi/bmi_portals/module.mk 1138 src/io/bmi/bmi_zoid/module.mk 1131 1139 src/io/description/module.mk 1132 1140 src/io/flow/module.mk … … 1268 1276 dnl 1269 1277 if 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 ; then1278 x$BUILD_OPENIB = x1 -o x$BUILD_PORTALS = x1 -o x$BUILD_ZOID = x1 ; then 1271 1279 if test x$BUILD_BMI_TCP = x1 ; then 1272 1280 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 } 1 70 2 71 @inproceedings{SmallFilesIPDPS09, … … 10 79 @inproceedings{PosixExtTReport, 11 80 author = {M. Vilayannur and S. Lang and R. Ross and R. Klundt and L. Ward}, 12 title = {Extending the POSIX I/OInterface: A Parallel File System Perspective},81 title = {Extending the {POSIX I/O} Interface: A Parallel File System Perspective}, 13 82 booktitle = {Technical Memorandum ANL/MCS-TM-302}, 14 83 year = {2008}, … … 37 106 @inproceedings{OSDCluster08, 38 107 author = {N. Ali and A. Devulapalli and D. Dalessandro and P. Wyckoff and P. Sadayappan}, 39 title = {An OSD-basedApproach to Managing Directory Operations in Parallel File Systems},108 title = {An {OSD-based} Approach to Managing Directory Operations in Parallel File Systems}, 40 109 booktitle = {IEEE International Conference on Cluster Computing}, 41 110 year = {2008}, … … 73 142 } 74 143 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 75 161 @article{BradThesis, 76 162 author = {Bradley W. Settlemyer}, … … 91 177 pages = {26-29}, 92 178 ee = {http://doi.acm.org/10.1145/1374596.1374604}, 93 crossref = {DBLP:conf/sc/2007pdsw},94 179 bibsource = {DBLP, http://dblp.uni-trier.de}, 95 180 url = {http://www.pdl.cmu.edu/PDL-FTP/HECStorage/sc07-patil.pdf} … … 621 706 booktitle = {HPCASIA '04: Proceedings of the High Performance Computing and Grid in Asia Pacific Region, Seventh International Conference}, 622 707 year = {2004}, 623 isbn = {0-7695-2138-X},624 708 pages = {136--139}, 625 709 publisher = {IEEE Computer Society}, -
branches/Orange-Branch/doc/add-server-req
r4617 r8317 38 38 PINT_server_op -- only if required 39 39 40 5) write state machine -- se details below40 5) write state machine -- see details below 41 41 src/server/<reqname>.sm 42 42 each state machine added must have a delcaration in 43 43 src/server/pvfs2-server.h 44 44 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 45 6) 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 58 48 59 49 -
branches/Orange-Branch/doc/pvfs2-faq.tex
r7697 r8317 319 319 \url{http://www.pvfs.org/}. Documentation (including this FAQ) is also 320 320 available in the \texttt{doc} subdirectory of the PVFS source distribution. 321 Please reference \texttt{pvfs2-logging.txt} to understand more about PVFS' 322 informational messages, where the logs exist, and how to turn logging 323 on and off. 321 324 322 325 \subsection{What should I do if I have a problem?} … … 713 716 pre-release kernel, but do make an effort to publish necessary patches once a 714 717 kernel is officially released. 718 719 \subsection{Does PVFS work with Open-MX?} 720 \label{sec:open-mx} 721 722 Yes, PVFS does work with Open-MX. To use Open-MX, configure PVFS with 723 the the same arguments that you would use for a normal MX installation: 724 ``--disable-bmi-tcp'' and ``--with-mx=PATH''. In addition, however, you 725 must set the ``MX\_IMM\_ACK'' environment variable to ``1'' before starting 726 the pvfs2-server or pvfs2-client daemons. This is necessary in order to 727 account for differences in how MX and Open-MX handle message progression by 728 default. 715 729 716 730 % -
branches/Orange-Branch/doc/pvfs2-logging.txt
r8315 r8317 1 PVFS Logging 2 ============ 3 4 This document describes log files produced by PVFS and how to control 5 what messages are included in them. 6 7 PVFS Log Format 8 --------------- 9 10 The log messages from all PVFS components except for the kernel module 11 are in the following format: 12 13 [<type> <timestamp>] LOG MESSAGE 14 15 The type will be one of 4 different letters depending on what type of 16 log message it is: 17 18 D - DEBUG 19 E - ERROR 20 A - ACCESS LOGGING 21 P - PERFORMANCE COUNTER 22 23 The timestamp defaults to showing the date, hour, and minute that the 24 log message was generated. The timestamp format can be modified to one 25 of the following styles by using the --logstamp argument to pvfs2-client 26 or 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 33 PVFS Log Locations 34 ------------------ 35 36 The pvfs2-server daemon writes log messages to /tmp/pvfs2-server.log by 37 default. A different output file can be specified using the LogFile 38 parameter in the configuration file. The logs can also be sent to syslog 39 instead by adding "LogType syslog" to the configuration file. 40 41 The pvfs2-client daemon writes log messages to /tmp/pvfs2-client.log by 42 default. This can be overridden using the --logfile or --logtype command 43 line arguments to pvfs2-client. 44 45 The 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 48 The PVFS client library (libpvfs2) and command line utilities generate log 49 messages to stderr if enabled. 50 51 Logging Levels 52 -------------- 53 54 All PVFS components log critical error messages automatically. However, 55 you can also turn on additional logging for debugging purposes. This is 56 controlled by specifying which logging "masks" should be enabled. 57 58 You can see a list of available pvfs2-server, client library, and 59 pvfs2-client logging levels by running the pvfs2-set-debugmask utility 60 with no arguments. 61 62 You can see a list of available kernel module logging masks and client 63 logging masks by running "cat /proc/sys/pvfs2/debug-help". 64 65 The "verbose" mask is commonly used to turn on most of the logging 66 levels that are useful for debugging problems. 67 68 Changing the log mask for pvfs2-server 69 -------------------------------------- 70 71 Use the EventLogging field in the configuration file to specify 72 a comma separated list of masks to enable. You can also use the 73 pvfs2-set-debugmask command line utility to change the mask dynamically 74 without restarting the server. 75 76 Changing the log mask for libpvfs and command line utilities 77 ------------------------------------------------------------ 78 79 Set the PVFS2_DEBUGMASK environment variable to a comma separated list of 80 client-appropriate masks prior to launching the application. 81 82 83 Changing the log mask for the kernel module 84 ------------------------------------------- 85 86 There are three ways to set the debugging level for the kernel module: 87 88 1. Set module_parm_debug_mask parameter when the kernel module is 89 loaded. 90 91 2. Set the environment variable PVFS2_KMODMASK before starting the 92 pvfs2-client. NOTE: the kernel module must be loaded before starting 93 the client-core. 94 95 3. Write a debug string to /proc/sys/pvfs2/kernel-debug after the kernel 96 module is loaded. 97 98 99 Options 1 and 2 allow the kernel debug mask to be set ONLY when PVFS is started, 100 while option 3 allows the kernel debug mask to be modified while PVFS is 101 running. Thus, option 3 dynamically updates the kernel debug mask, 102 immediately turning on the debugging options specified, and REPLACES the 103 existing debug mask. Whenever you modify the kernel debug mask using 104 option 3, an informational message is printed to the system log file, 105 giving both its numerical value and a comma-separated list of keywords representing 106 the areas of debugging just turned on. 107 108 Options 1 and 2 require the user to specify a numerical value that is 109 an OR'd list of gossip debug values. These values can be found in 110 include/pvfs2-debug.h. For example, to load the kernel module with 111 "file" debugging turned on, issue the following command: 112 113 insmod pvfs2.ko module_parm_debug_mask=4 114 115 The 4 is the value of GOSSIP_FILE_DEBUG, and module_parm_debug_mask is the kernel 116 module's input parameter for the kernel debug mask. To turn on multiple areas,for 117 example, 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 120 An informational message is displayed in the system log whenever you load the kernel 121 module, giving you the kernel debug mask's numerical value and its string 122 equivalent. Be aware that you can modify this value later using option 3. 123 124 To set the kernel debug mask using PVFS2_KMODMASK, create a global environment 125 variable and set it equal to the desired numerical value. When the pvfs2-client 126 is started, the kernel debug mask and its string equivalent will be modified. Note that 127 PVFS2_KMODMASK will override any value set by the kernel module load process. Again, 128 option 3 allows you to change the debug mask at any time. 129 130 To 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. 132 An informational message will be written to the system log file displaying the new 133 kernel debug mask and its string equivalent. 134 135 To 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 137 debug mask. 138 139 A helper /proc variable, /proc/sys/pvfs2/debug-help, will display a list of valid 140 keywords for both the kernel and client debug masks, when you issue a "cat" on it. These 141 keywords are used to build the string that represent the areas of debugging that you 142 want turned on. 143 144 145 146 Changing the log mask for the client module 147 ------------------------------------------- 148 149 There are three ways to set the debugging level for the pvfs2-client: 150 151 1. Set --gossip-mask=MASK_LIST on the command line when starting the client. This 152 list can be overridden by PVFS2_DEBUGMASK or by setting the /proc variable client-debug. 153 154 2. Write a debug string to /proc/sys/pvfs2/client-debug after starting the client. This 155 will override any value set by --gossip-mask on the command line and any value set by 156 PVFS2_DEBUGMASK. 157 158 3. Set the environment variable PVFS2_DEBUGMASK before starting the client. This will 159 override any value set by --gossip-mask on the command line. 160 161 162 Options 1 and 2 require a string of comma-separated keywords to set the client debug mask. 163 For example: 164 165 ./pvfs2-client --gossip-mask="server,trove" -p ./pvfs2-client-core 166 NOTE: after kernel module is loaded and during client startup. 167 168 echo "server,trove" > /proc/sys/pvfs2/client-debug 169 NOTE: after kernel module is loaded and client is started. 170 171 A list of client debug keywords can be found in include/pvfs2-debug.h or by accessing 172 the /proc/sys/pvfs2/debug-help variable after the kernel module is loaded. Example: 173 174 cat /proc/sys/pvfs2/debug-help 175 176 177 When the client starts, the client debug mask information is sent to the kernel module 178 where a local version of the mask and its string equivalent is maintained. This process 179 writes an informational message to the system log file displaying the numerical value of 180 the client debug mask and its string equivalent. You can also see the mask's current string 181 equivalent by issuing the following: 182 183 cat /proc/sys/pvfs2/client-debug. 184 185 186 Whenever you modify the client debug mask after the client has started, an informational message will 187 be written to the system log file displaying the new numerical value and string equivalent. At any 188 time, once PVFS is running, you can view the client debug mask using the "cat" statement above without 189 having to look in the system log file for the last modification. 190 191 -
branches/Orange-Branch/doc/pvfs2-quickstart.tex
r6690 r8317 939 939 and eventually to the kernel logs. 940 940 One could also set the kmod diagnostic level when the kernel module is loaded 941 like so, insmod pvfs2.ko gossip\_debug\_mask=<diagnostic level>.941 like so, insmod pvfs2.ko module\_parm\_debug\_mask=<diagnostic level>. 942 942 The diagnostic level will be a bitwise OR of values specified in pvfs2-debug.h. 943 For more information on setting the kernel or client debug mask, see 944 \texttt{doc/pvfs2-logging.txt} in the PVFS source tree. 943 945 944 946 \section{ROMIO Support} -
branches/Orange-Branch/examples/heartbeat/hardware-specific/Filesystem-qla-monitor
r6957 r8317 644 644 # shoot ourselves in the head 645 645 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 649 656 fi 650 657 return $ORIG_RET … … 718 725 fi 719 726 727 OP=$1 728 729 # These operations do not require instance parameters 730 case $OP in 731 meta-data) meta_data 732 exit $OCF_SUCCESS 733 ;; 734 usage) usage 735 exit $OCF_SUCCESS 736 ;; 737 esac 738 720 739 if 721 740 [ -z "$OCF_RESKEY_fsname" ] … … 742 761 fsname=$OCF_RESKEY_fsname 743 762 conf_dir=$OCF_RESKEY_conf_dir 744 745 OP=$1746 747 # These operations do not require instance parameters748 case $OP in749 meta-data) meta_data750 exit $OCF_SUCCESS751 ;;752 usage) usage753 exit $OCF_SUCCESS754 ;;755 esac756 763 757 764 blockdevice=no -
branches/Orange-Branch/include/pvfs2-debug.h
r8215 r8317 78 78 #define GOSSIP_MIRROR_DEBUG ((uint64_t)1 << 56) 79 79 80 /* NOTE: if you want your gossip flag to be controllable from81 * pvfs2-set-debugmask you have to add it in82 * src/common/misc/pvfs2-debug.c83 */84 85 80 #define GOSSIP_BMI_DEBUG_ALL (uint64_t) \ 86 81 (GOSSIP_BMI_DEBUG_TCP + GOSSIP_BMI_DEBUG_CONTROL + \ 87 82 GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB \ 88 83 + GOSSIP_BMI_DEBUG_MX + GOSSIP_BMI_DEBUG_PORTALS) 89 90 uint64_t PVFS_debug_eventlog_to_mask(91 const char *event_logging);92 84 93 85 const char *PVFS_debug_get_next_debug_keyword( -
branches/Orange-Branch/include/pvfs2-encode-stubs.h
r7471 r8317 39 39 */ 40 40 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C 41 # include "src/proto/endecode-funcs.h"41 #include "src/proto/endecode-funcs.h" 42 42 #else /* __PINT_REQPROTO_ENCODE_FUNCS_C */ 43 43 44 44 /* 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 62 62 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 73 73 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 75 75 76 76 #endif /* __PINT_REQPROTO_ENCODE_FUNCS_C */ -
branches/Orange-Branch/include/pvfs2-mgmt.h
r7471 r8317 75 75 int32_t, keyval_queue, 76 76 int32_t, reqsched, 77 skip4,) 77 skip4,); 78 78 79 79 /* low level information about individual server level objects */ … … 94 94 skip4,, 95 95 PVFS_size, b_size, 96 PVFS_handle, dirdata_handle) 96 PVFS_handle, dirdata_handle); 97 97 98 98 /* individual datapoint from event monitoring */ … … 116 116 int32_t, tv_sec, 117 117 int32_t, tv_usec, 118 skip4,) 118 skip4,); 119 119 120 120 /* values which may be or'd together in the flags field above */ -
branches/Orange-Branch/include/pvfs2-types.h
r8098 r8317 103 103 ENCODING_DIRECT = 1, 104 104 ENCODING_LE_BFIELD = 2, 105 ENCODING_XDR = 3 ,105 ENCODING_XDR = 3 106 106 }; 107 107 108 /* these values must correspond to the defined encoding types above */ 108 109 #define ENCODING_INVALID_MIN 0 … … 502 503 } u; 503 504 }; 505 504 506 encode_enum_union_2_struct( 505 507 PVFS_mgmt_setparam_value, 506 508 type, u, 507 509 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); 509 511 510 512 enum PVFS_server_mode -
branches/Orange-Branch/maint/config/kernel.m4
r7731 r8317 544 544 fi 545 545 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) 549 567 AC_TRY_COMPILE([ 550 568 #define __KERNEL__ … … 552 570 #include <linux/sysctl.h> 553 571 ], [ 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); 555 580 ], 556 581 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), 558 603 AC_MSG_RESULT(no) 559 604 ) … … 1174 1219 ) 1175 1220 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 1176 1234 dnl newer 2.6 kernels (2.6.29-ish) use current_fsuid() macro instead 1177 1235 dnl of accessing task struct fields directly … … 1192 1250 CFLAGS=$tmp_cflags 1193 1251 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 1194 1286 1195 1287 CFLAGS=$oldcflags -
branches/Orange-Branch/pvfs2-config.h.in
r7959 r8317 33 33 /* Define to 1 if you have the <attr/xattr.h> header file. */ 34 34 #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 35 41 36 42 /* Define if struct backing_dev_info in kernel has memory_backed */ … … 126 132 #undef HAVE_GETMNTENT 127 133 134 /* Define if pwd.h exists */ 135 #undef HAVE_GETPWUID 136 128 137 /* Define if struct super_operations in kernel has get_fs_key callback */ 129 138 #undef HAVE_GET_FS_KEY_SUPER_OPERATIONS … … 265 274 266 275 /* 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 268 280 269 281 /* Define if have PtlACEntry with jid argument. */ … … 304 316 tree_lock */ 305 317 #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 306 321 307 322 /* Define to 1 if you have the <SDL/SDL_ttf.h> header file. */ -
branches/Orange-Branch/src/apps/admin/pvfs2-ls.c
r8311 r8317 34 34 35 35 /* 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 /* 36 42 arbitrarily restrict the number of paths 37 43 that this ls version can take as arguments 38 44 */ 39 45 #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 40 56 41 57 /* optional parameters, filled in by parse_args() */ … … 53 69 int list_no_owner; 54 70 int list_inode; 71 int list_all_times; 55 72 int list_use_si_units; 56 73 char *start[MAX_NUM_PATHS]; … … 78 95 PVFS_sys_attr *attr, 79 96 int attr_error, 80 struct options *opts); 97 struct options *opts, 98 char* entry_buffer); 81 99 82 100 static int do_list( … … 84 102 char *start, 85 103 int fs_id, 86 struct options *opts); 104 struct options *opts, 105 char *entry_buffer); 87 106 88 107 static void print_entry_attr( … … 90 109 char *entry_name, 91 110 PVFS_sys_attr *attr, 92 struct options *opts); 111 struct options *opts, 112 char *entry_buffer); 93 113 94 114 #define print_dot_and_dot_dot_info_if_required(refn) \ … … 108 128 else if (opts->list_long) { \ 109 129 print_entry(".", refn.handle, \ 110 refn.fs_id, NULL, 0, opts); \ 130 refn.fs_id, NULL, 0, opts, \ 131 entry_buffer); \ 111 132 print_entry(".. (faked)", refn.handle, \ 112 refn.fs_id, NULL, 0, opts); \ 133 refn.fs_id, NULL, 0, opts, \ 134 entry_buffer); \ 113 135 } \ 114 136 else { \ … … 190 212 char *entry_name, 191 213 PVFS_sys_attr *attr, 192 struct options *opts) 214 struct options *opts, 215 char *entry_buffer) 193 216 { 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; 196 219 struct group *grp = NULL; 197 220 struct passwd *pwd = NULL; … … 199 222 char *owner = empty_str, *group = empty_str; 200 223 char *inode = empty_str; 201 time_t mtime ;202 struct tm *time; 224 time_t mtime, atime, ctime; 225 struct tm *time; 203 226 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}; 205 228 char scratch_size[16] = {0}, scratch_inode[16] = {0}; 206 229 char f_type = '-'; 207 230 char group_x_char = '-'; 231 int num_bytes = 0; 208 232 209 233 if (!opts->list_all && (entry_name[0] == '.')) … … 215 239 return; 216 240 } 241 217 242 mtime = (time_t)attr->mtime; 218 243 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 } 219 267 220 268 snprintf(scratch_owner,16,"%d",(int)attr->owner); … … 303 351 } 304 352 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", 307 355 inode, 308 356 f_type, … … 319 367 formatted_group, 320 368 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, 326 370 entry_name); 327 371 … … 338 382 free(formatted_group); 339 383 } 384 if (formatted_time) 385 { 386 free(formatted_time); 387 } 340 388 341 389 if (attr->objtype == PVFS_TYPE_SYMLINK) … … 345 393 if (opts->list_long) 346 394 { 347 printf("%s -> %s\n", buf, attr->link_target);395 printf("%s -> %s\n", entry_buffer, attr->link_target); 348 396 } 349 397 else 350 398 { 351 printf("%s\n", buf);399 printf("%s\n",entry_buffer); 352 400 } 353 401 } 354 402 else 355 403 { 356 printf("%s\n", buf);404 printf("%s\n",entry_buffer); 357 405 } 358 406 } … … 364 412 PVFS_sys_attr *attr, 365 413 int attr_error, 366 struct options *opts) 414 struct options *opts, 415 char *entry_buffer) 367 416 { 368 417 int ret = -1; … … 406 455 return; 407 456 } 408 print_entry_attr(handle, entry_name, &getattr_response.attr, opts );457 print_entry_attr(handle, entry_name, &getattr_response.attr, opts, entry_buffer); 409 458 } 410 459 else 411 460 { 412 print_entry_attr(handle, entry_name, attr, opts );461 print_entry_attr(handle, entry_name, attr, opts, entry_buffer); 413 462 } 414 463 } … … 426 475 char *start, 427 476 int fs_id, 428 struct options *opts) 477 struct options *opts, 478 char *entry_buffer) 429 479 { 430 480 int i = 0, printed_dot_info = 0; … … 495 545 { 496 546 print_entry_attr(ref.handle, segment, 497 &getattr_response.attr, opts );547 &getattr_response.attr, opts, entry_buffer); 498 548 } 499 549 else … … 502 552 NULL, 503 553 0, 504 opts );554 opts, entry_buffer); 505 555 } 506 556 return 0; … … 559 609 &rdplus_response.attr_array[i], 560 610 rdplus_response.stat_err_array[i], 561 opts );611 opts, entry_buffer); 562 612 563 613 PVFS_sys_attr *attr = &rdplus_response.attr_array[i]; … … 640 690 { 641 691 printf("\n"); 642 do_list(full_path,current->path,fs_id,opts );692 do_list(full_path,current->path,fs_id,opts,entry_buffer); 643 693 current = current->next; 644 694 free(head->path); … … 676 726 {"inode",0,0,0}, 677 727 {"size",0,0,0}, 728 {"all-times",0,0,0}, 678 729 {0,0,0,0} 679 730 }; … … 744 795 { 745 796 goto list_inode; 797 } 798 else if (strcmp("all-times", cur_option) == 0) 799 { 800 goto list_all_times; 746 801 } 747 802 else … … 796 851 tmp_opts->list_inode = 1; 797 852 break; 853 list_all_times: 854 tmp_opts->list_all_times = 1; 855 break; 798 856 case 't': 799 857 do_timing = 1; … … 845 903 fprintf(stderr," -n, --numeric-uid-gid like -l, but list " 846 904 "numeric UIDs and GIDs\n"); 905 fprintf(stderr," --all-times display atime, mtime," 906 " and ctime information\n"); 847 907 fprintf(stderr," -o like -l, but do not " 848 908 "list group information\n"); … … 867 927 char current_dir[PVFS_NAME_MAX] = {0}; 868 928 int found_one = 0; 929 char *entry_buffer = malloc(ENTRY_MAX); 869 930 870 931 process_name = argv[0]; 871 872 932 user_opts = parse_args(argc, argv); 873 933 if (!user_opts) … … 960 1020 else /* Root directory case has nothing to match */ 961 1021 { 962 substr = &user_opts->start[i][strlen(user_opts->start[i]) -1];1022 substr = &user_opts->start[i][strlen(user_opts->start[i])]; 963 1023 } 964 1024 … … 972 1032 user_opts->start[i][++j] = '\0'; 973 1033 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); 975 1035 976 1036 if (user_opts->num_starts > 1) … … 982 1042 PVFS_sys_finalize(); 983 1043 free(user_opts); 1044 free(entry_buffer); 984 1045 985 1046 return(ret); -
branches/Orange-Branch/src/apps/admin/pvfs2-stat.c
r7727 r8317 55 55 { 56 56 int ret = -1, 57 ret_agg = 0, 57 58 i = 0; 58 59 char ** ppszPvfsPath = NULL; … … 146 147 fprintf(stderr, "Error stating [%s]\n", user_opts.pszFiles[i]); 147 148 } 149 ret_agg |= ret; 148 150 } 149 151 … … 174 176 } 175 177 176 return( 0);178 return(ret_agg); 177 179 } 178 180 -
branches/Orange-Branch/src/apps/fuse/pvfs2fuse.c
r7711 r8317 10 10 * Sumit Narayan 11 11 * 12 * $Date: 20 09-03-06 13:54:32 $13 * $Revision: 1.3 $12 * $Date: 2010-04-30 20:00:42 $ 13 * $Revision: 1.3.8.1 $ 14 14 * 15 15 * Documentation: http://www.engr.uconn.edu/~sun03001/docs/pvfs2fuse-rpt.pdf 16 16 */ 17 17 18 /* char *pvfs2fuse_version = "$Id: pvfs2fuse.c,v 1.3 2009-03-06 13:54:32 slangExp $"; */18 /* char *pvfs2fuse_version = "$Id: pvfs2fuse.c,v 1.3.8.1 2010-04-30 20:00:42 bligon Exp $"; */ 19 19 char *pvfs2fuse_version = "0.01"; 20 20 … … 246 246 pvfs_fuse_handle_t pfh; 247 247 248 /* sumit */249 system("echo 1 >> /tmp/abc");250 251 248 ret = lookup( path, &pfh, PVFS2_LOOKUP_LINK_NO_FOLLOW ); 252 249 if ( ret < 0 ) … … 646 643 { 647 644 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 */654 645 return(resp_io.total_completed); 655 646 } … … 716 707 (void) isdatasync; 717 708 (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 */732 709 733 710 return 0; -
branches/Orange-Branch/src/apps/kernel/linux/pvfs2-client-core.c
r8251 r8317 131 131 for the blocking ioctl. 132 132 */ 133 #define REMOUNT_NOTCOMPLETED 0 134 #define REMOUNT_COMPLETED 1 135 #define REMOUNT_FAILED 2 133 136 static pthread_t remount_thread; 134 137 static pthread_mutex_t remount_mutex = PTHREAD_MUTEX_INITIALIZER; 135 static int remount_complete = 0; 138 static int remount_complete = REMOUNT_NOTCOMPLETED; 139 136 140 137 141 /* used for generating unique dynamic mount point names */ … … 503 507 upcalls for each fs mounted by the kernel at this point 504 508 */ 509 510 /* if PINT_dev_remount fails set remount_complete appropriately */ 505 511 if (PINT_dev_remount()) 506 512 { 507 513 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 } 511 520 pthread_mutex_unlock(&remount_mutex); 512 521 … … 2843 2852 } 2844 2853 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) ) 2847 2857 { 2848 2858 gossip_debug( … … 3124 3134 { 3125 3135 vfs_request = vfs_request_array[i]; 3136 3126 3137 assert(vfs_request); 3127 3138 /* assert(vfs_request->op_id == op_id_array[i]); */ … … 3270 3281 assert(ret == 0); 3271 3282 } 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 } 3272 3306 } 3273 3307 … … 3580 3614 if (ret) 3581 3615 { 3582 gossip_err("Failed to process vfs requests! ");3616 gossip_err("Failed to process vfs requests!\n"); 3583 3617 } 3584 3618 3585 3619 /* join remount thread; should be long done by now */ 3586 if (remount_complete )3620 if (remount_complete == REMOUNT_COMPLETED ) 3587 3621 { 3588 3622 pthread_join(remount_thread, NULL); … … 3619 3653 PINT_sys_release(static_acache_timer_sm_p->sys_op_id); 3620 3654 3655 gossip_err("pvfs2-client-core shutting down.\n"); 3621 3656 if (PVFS_sys_finalize()) 3622 3657 { 3623 gossip_err("Failed to finalize PVFS\n");3624 3658 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); 3625 3665 } 3626 3666 … … 3631 3671 } 3632 3672 3633 gossip_debug(GOSSIP_CLIENTCORE_DEBUG, "%s terminating\n", argv[0]);3634 3673 return 0; 3635 3674 } -
branches/Orange-Branch/src/apps/kernel/linux/pvfs2-client.c
r7725 r8317 263 263 fprintf(stderr, "Device error caught, exiting now...\n"); 264 264 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; 265 272 } 266 273 -
branches/Orange-Branch/src/client/sysint/client-state-machine.c
r8251 r8317 154 154 if (user_ptr_array) 155 155 { 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 } 157 178 } 158 179 s_completion_list[i] = NULL; … … 188 209 */ 189 210 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); 190 216 191 217 /* … … 193 219 completed and no job cancellation were issued at I/O cancel time 194 220 */ 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--; 198 224 } 199 225 200 226 gossip_debug( 201 227 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, 204 230 (PINT_smcb_complete(smcb) ? "complete" : "NOT complete")); 205 231 206 return (sm_ p->u.io.total_cancellations_remaining != 0);232 return (sm_base_p->u.io.total_cancellations_remaining != 0); 207 233 } 208 234 … … 313 339 "client_state_machine_terminate smcb %p\n",smcb); 314 340 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 319 341 if (!((PINT_smcb_op(smcb) == PVFS_SYS_IO) && 320 342 (PINT_smcb_cancelled(smcb)) && … … 322 344 !PINT_smcb_immediate_completion(smcb)) 323 345 { 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 324 353 gossip_debug(GOSSIP_CLIENT_DEBUG, 325 354 "add smcb %p to completion list\n", smcb); 326 355 ret = add_sm_to_completion_list(smcb); 327 356 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); 328 362 } 329 363 return SM_ACTION_TERMINATE; … … 506 540 return 0; 507 541 } 508 542 509 543 /* We also don't cancel small I/O operations as posted by 510 544 * sys-small-io.sm. Check the corresponding flag. We have 511 545 * to jump to the base frame rather than the current frame for this 512 546 * 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. 513 554 */ 514 555 sm_base_p = PINT_sm_frame(smcb, (-(smcb->frame_count -1))); 556 assert(sm_base_p); 515 557 if(sm_base_p->u.io.small_io) 516 558 { … … 532 574 533 575 /* 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]; 537 579 assert(cur_ctx); 538 580 … … 550 592 break; 551 593 } 552 sm_ p->u.io.total_cancellations_remaining++;594 sm_base_p->u.io.total_cancellations_remaining++; 553 595 } 554 596 … … 566 608 break; 567 609 } 568 sm_ p->u.io.total_cancellations_remaining++;610 sm_base_p->u.io.total_cancellations_remaining++; 569 611 } 570 612 … … 581 623 break; 582 624 } 583 sm_ p->u.io.total_cancellations_remaining++;625 sm_base_p->u.io.total_cancellations_remaining++; 584 626 } 585 627 … … 597 639 break; 598 640 } 599 sm_ p->u.io.total_cancellations_remaining++;641 sm_base_p->u.io.total_cancellations_remaining++; 600 642 } 601 643 } 602 644 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); 605 647 return ret; 606 648 } -
branches/Orange-Branch/src/client/sysint/client-state-machine.h
r8251 r8317 421 421 PVFS_BMI_addr_t *addr_array; 422 422 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 */ 424 426 }; 425 427 … … 700 702 PVFS_MGMT_GET_DIRDATA_HANDLE = 80, 701 703 PVFS_SERVER_GET_CONFIG = 200, 702 PVFS_SERVER_FETCH_CONFIG = 201,703 704 PVFS_CLIENT_JOB_TIMER = 300, 704 705 PVFS_CLIENT_PERF_COUNT_TIMER = 301, -
branches/Orange-Branch/src/client/sysint/fs-add.sm
r6984 r8317 45 45 extern job_context_id pint_client_sm_context; 46 46 47 static int server_fetch_config_comp_fn( 48 void *v_p, struct PVFS_server_resp *resp_p, int i); 49 47 50 %% 48 51 … … 74 77 { 75 78 jump pvfs2_server_fetch_config_nested_sm; 79 default => compare_hashes; 80 } 81 82 state compare_hashes 83 { 84 run fs_add_compare_hashes; 76 85 default => final_cleanup; 77 86 } … … 81 90 run fs_add_final_cleanup; 82 91 default => terminate; 92 } 93 } 94 95 nested 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; 83 114 } 84 115 } … … 321 352 return SM_ACTION_COMPLETE; 322 353 } 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 323 371 js_p->error_code = 0; 324 372 return SM_ACTION_COMPLETE; … … 348 396 size_t digest_len; 349 397 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 352 407 fsid = sm_p->u.get_config.mntent->fs_id; 353 count = sm_p->fetch_config.nservers;354 408 sha1_fs_digests = (char **) calloc(count, sizeof(char *)); 355 409 if (sha1_fs_digests == NULL) … … 360 414 for (i = 1; i < count; i++) 361 415 { 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]]) 363 418 { 364 419 fs_conf_size_mismatch = 1; … … 371 426 { 372 427 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); 375 431 ret = -PVFS_EINVAL; 376 432 } … … 379 435 for (i = 0; i < count; i++) 380 436 { 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]], 383 440 &sha1_fs_digests[i], &digest_len); 384 441 if (ret < 0) … … 401 458 hash2str((unsigned char *) sha1_fs_digests[i], digest_len, str); 402 459 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); 404 462 } 405 463 ret = -PVFS_EINVAL; … … 419 477 free(sm_p->fetch_config.fs_config_bufs); 420 478 sm_p->fetch_config.fs_config_bufs = NULL; 479 free(sm_p->fetch_config.result_indexes); 480 sm_p->fetch_config.result_indexes = NULL; 421 481 free(sm_p->fetch_config.fs_config_buf_size); 422 482 sm_p->fetch_config.fs_config_buf_size = NULL; … … 527 587 } 528 588 589 static 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 529 604 static PINT_sm_action fs_add_final_cleanup( 530 605 struct PINT_smcb *smcb, job_status_s *js_p) 531 606 { 532 607 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 } 533 613 if (js_p->error_code == SKIP_INTEGRITY_CHECK) 534 614 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 }544 615 sm_p->error_code = js_p->error_code; 545 616 PINT_SET_OP_COMPLETE; 546 617 return SM_ACTION_TERMINATE; 618 } 619 620 static 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 651 static 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 661 static 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; 547 709 } 548 710 -
branches/Orange-Branch/src/client/sysint/initialize.c
r7489 r8317 128 128 goto error_exit; 129 129 } 130 client_status_flag |= CLIENT_DIST_INIT; 130 131 131 132 /* initlialize the protocol encoder */ -
branches/Orange-Branch/src/client/sysint/server-get-config.sm
r7471 r8317 28 28 void *v_p, struct PVFS_server_resp *resp_p, int i); 29 29 30 static int server_fetch_config_comp_fn(31 void *v_p, struct PVFS_server_resp *resp_p, int i);32 33 30 %% 34 31 … … 73 70 { 74 71 run server_get_config_parent_cleanup; 75 default => terminate;76 }77 }78 79 nested machine pvfs2_server_fetch_config_nested_sm80 {81 state fetch_setup_msgpair82 {83 run server_fetch_config_setup_msgpair;84 success => fetch_xfer_msgpair;85 default => fetch_cleanup;86 }87 88 state fetch_xfer_msgpair89 {90 jump pvfs2_msgpairarray_sm;91 default => fetch_cleanup;92 }93 94 state fetch_cleanup95 {96 run server_fetch_config_cleanup;97 default => return;98 }99 }100 101 machine pvfs2_server_fetch_config_sm102 {103 state run_fetch_nested104 {105 jump pvfs2_server_fetch_config_nested_sm;106 default => parent_fetch_cleanup;107 }108 109 state parent_fetch_cleanup110 {111 run server_fetch_config_parent_cleanup;112 72 default => terminate; 113 73 } … … 407 367 return 0; 408 368 } 409 410 /*411 * Force a fetch the configuration file from a given set of servers412 * This is different from get_config() in that we do not depend on the413 * configuration server specified in the mnt tab file414 * Assumes that servers specified in the array are unique!415 * CURRENTLY UNUSED416 */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 #endif421 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 use452 * PINT_init_msgarray_params(), because we don't yet have a server453 * 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 else480 {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 server540 * 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 values551 * and return error code if any requests failed552 */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 }568 369 569 370 /* -
branches/Orange-Branch/src/client/sysint/sys-create.sm
r7622 r8317 803 803 */ 804 804 805 if(sm_p->u.create.user_requested_num_data_files > 1)805 if(sm_p->u.create.user_requested_num_data_files > 0) 806 806 { 807 807 /* specified by sys_create caller */ -
branches/Orange-Branch/src/client/sysint/sys-io.sm
r8251 r8317 515 515 sm_p->object_ref.handle, 516 516 IO_ATTR_MASKS, 517 // 0,518 517 sm_p->hints); 519 518 } -
branches/Orange-Branch/src/client/sysint/sys-truncate.sm
r7471 r8317 154 154 PVFS_ATTR_META_ALL|PVFS_ATTR_COMMON_TYPE, 155 155 PVFS_TYPE_METAFILE, 156 0);156 PINT_SM_GETATTR_BYPASS_CACHE); 157 157 158 158 return PINT_client_state_machine_post( … … 314 314 struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 315 315 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 316 324 /* determine if we need to unstuff or not to service this request */ 317 325 if(unstuff_needed( -
branches/Orange-Branch/src/common/gossip/gossip.c
r7528 r8317 480 480 gettimeofday(&tv, 0); 481 481 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; 485 485 break; 486 486 case GOSSIP_LOGSTAMP_THREAD: -
branches/Orange-Branch/src/common/misc/pint-hint.c
r7633 r8317 565 565 while(h) 566 566 { 567 if(!strcmp(h int->type_string, name))567 if(!strcmp(h->type_string, name)) 568 568 { 569 569 if(length) -
branches/Orange-Branch/src/common/misc/pint-util.c
r7968 r8317 18 18 #include <unistd.h> 19 19 20 #include <grp.h> 21 #include <pwd.h> 22 #include <sys/types.h> 23 20 24 #define __PINT_REQPROTO_ENCODE_FUNCS_C 21 25 #include "gen-locks.h" … … 24 28 #include "gossip.h" 25 29 #include "pvfs2-req-proto.h" 30 31 #include "pvfs2-debug.h" 32 #include "bmi-byteswap.h" 33 34 #ifdef HAVE_GETPWUID 35 static gen_mutex_t check_group_mutex = GEN_MUTEX_INITIALIZER; 36 static int pw_buf_size = 1024; // 1 KB 37 static int gr_buf_size = 1024*1024; // 1 MB 38 static char* check_group_pw_buffer = NULL; 39 static char* check_group_gr_buffer = NULL; 40 #endif 41 static int PINT_check_group(uid_t uid, gid_t gid); 26 42 27 43 void PINT_time_mark(PINT_time_marker *out_marker) … … 542 558 } 543 559 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 */ 567 int 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 */ 724 static 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 */ 816 static 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 */ 829 int 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; 924 mask: 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 952 check_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 544 960 /* 545 961 * Local variables: -
branches/Orange-Branch/src/common/misc/pint-util.h
r7450 r8317 142 142 PVFS_credentials *credentials); 143 143 144 enum PINT_access_type 145 { 146 PINT_ACCESS_EXECUTABLE = 1, 147 PINT_ACCESS_WRITABLE = 2, 148 PINT_ACCESS_READABLE = 4, 149 }; 150 151 int PINT_check_mode( 152 PVFS_object_attr *attr, 153 PVFS_uid uid, PVFS_gid gid, 154 enum PINT_access_type access_type); 155 156 int 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 144 160 #endif /* __PINT_UTIL_H */ 145 161 -
branches/Orange-Branch/src/common/misc/server-config.c
r8306 r8317 732 732 * usec: [%H:%M:%S.%U] 733 733 * 734 * datetime: [%m/%d %H:%M]734 * datetime: [%m/%d/%Y %H:%M:%S] 735 735 * 736 736 * thread: [%H:%M:%S.%U (%lu)] -
branches/Orange-Branch/src/common/misc/state-machine-fns.c
r7596 r8317 431 431 { 432 432 return smcb->op == PVFS_SERVER_GET_CONFIG 433 || smcb->op == PVFS_SERVER_FETCH_CONFIG434 433 || smcb->op == PVFS_CLIENT_JOB_TIMER 435 434 || smcb->op == PVFS_CLIENT_PERF_COUNT_TIMER -
branches/Orange-Branch/src/io/bmi/bmi-method-support.h
r7471 r8317 59 59 }; 60 60 61 /* flags that can be set per method to affect behavior */ 62 #define BMI_METHOD_FLAG_NO_POLLING 1 63 61 64 /* This is the table of interface functions that must be provided by BMI 62 65 * methods. … … 65 68 { 66 69 const char *method_name; 70 int flags; 67 71 int (*initialize) (bmi_method_addr_p, int, int); 68 72 int (*finalize) (void); -
branches/Orange-Branch/src/io/bmi/bmi.c
r8251 r8317 81 81 #ifdef __STATIC_METHOD_BMI_PORTALS__ 82 82 extern struct bmi_method_ops bmi_portals_ops; 83 #endif 84 #ifdef __STATIC_METHOD_BMI_ZOID__ 85 extern struct bmi_method_ops bmi_zoid_ops; 83 86 #endif 84 87 … … 99 102 &bmi_portals_ops, 100 103 #endif 104 #ifdef __STATIC_METHOD_BMI_ZOID__ 105 &bmi_zoid_ops, 106 #endif 101 107 NULL 102 108 }; … … 121 127 122 128 static struct bmi_method_ops **active_method_table = NULL; 123 static struct { 129 130 struct method_usage_t { 124 131 int iters_polled; /* how many iterations since this method was polled */ 125 132 int iters_active; /* how many iterations since this method had action */ 126 133 int plan; 127 } *method_usage = NULL; 134 int flags; 135 }; 136 137 static struct method_usage_t * expected_method_usage = NULL; 138 static struct method_usage_t * unexpected_method_usage = NULL; 139 128 140 static const int usage_iters_starvation = 100000; 129 141 static const int usage_iters_active = 10000; … … 531 543 known_method_count = 0; 532 544 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); 535 550 536 551 /* destroy the reference list */ … … 914 929 */ 915 930 static void 916 construct_poll_plan(int nmeth, int *idle_time_ms) 931 construct_poll_plan(struct method_usage_t * method_usage, 932 int nmeth, int *idle_time_ms) 917 933 { 918 934 int i, numplan; … … 923 939 ++method_usage[i].iters_active; 924 940 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))){ 926 943 /* recently busy, poll */ 927 944 if (0) gossip_debug(GOSSIP_BMI_DEBUG_CONTROL, … … 991 1008 *outcount = 0; 992 1009 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); 994 1012 995 1013 while (position < incount && i < tmp_active_method_count) 996 1014 { 997 if ( method_usage[i].plan) {1015 if (unexpected_method_usage[i].plan) { 998 1016 ret = active_method_table[i]->testunexpected( 999 1017 (incount - position), &tmp_outcount, … … 1007 1025 position += tmp_outcount; 1008 1026 (*outcount) += tmp_outcount; 1009 method_usage[i].iters_polled = 0;1027 unexpected_method_usage[i].iters_polled = 0; 1010 1028 if (ret) 1011 method_usage[i].iters_active = 0;1029 unexpected_method_usage[i].iters_active = 0; 1012 1030 } 1013 1031 i++; … … 1088 1106 } 1089 1107 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); 1091 1110 1092 1111 while (position < incount && i < tmp_active_method_count) 1093 1112 { 1094 if ( method_usage[i].plan) {1113 if (expected_method_usage[i].plan) { 1095 1114 ret = active_method_table[i]->testcontext( 1096 1115 incount - position, … … 1110 1129 position += tmp_outcount; 1111 1130 (*outcount) += tmp_outcount; 1112 method_usage[i].iters_polled = 0;1131 expected_method_usage[i].iters_polled = 0; 1113 1132 if (ret) 1114 method_usage[i].iters_active = 0;1133 expected_method_usage[i].iters_active = 0; 1115 1134 } 1116 1135 i++; … … 2022 2041 } 2023 2042 2043 2044 /** 2045 * Try to increase method_usage_t struct to include room for a new method. 2046 */ 2047 static 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 2024 2065 /* 2025 2066 * Attempt to insert this name into the list of active methods, … … 2072 2113 active_method_table[active_method_count] = meth; 2073 2114 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; 2085 2125 2086 2126 ++active_method_count; -
branches/Orange-Branch/src/io/bmi/bmi_gm/bmi-gm.c
r7566 r8317 158 158 const struct bmi_method_ops bmi_gm_ops = { 159 159 .method_name = BMI_gm_method_name, 160 .flags = 0, 160 161 .initialize = BMI_gm_initialize, 161 162 .finalize = BMI_gm_finalize, -
branches/Orange-Branch/src/io/bmi/bmi_ib/ib.c
r7665 r8317 23 23 #include <src/common/gen-locks/gen-locks.h> /* gen_mutex_t ... */ 24 24 #include <src/common/misc/pvfs2-internal.h> 25 #include "pint-hint.h" 25 26 26 27 #ifdef HAVE_VALGRIND_H … … 895 896 const void *buffer, bmi_size_t total_size, 896 897 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) 898 900 { 899 901 return post_send(id, remote_map, 0, &buffer, &total_size, … … 905 907 const void *const *buffers, const bmi_size_t *sizes, int list_count, 906 908 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) 908 911 { 909 912 return post_send(id, remote_map, list_count, buffers, sizes, … … 916 919 enum bmi_buffer_type buffer_flag __unused, 917 920 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) 919 923 { 920 924 return post_send(id, remote_map, 0, &buffer, &total_size, … … 929 933 enum bmi_buffer_type buffer_flag __unused, 930 934 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) 932 937 { 933 938 return post_send(id, remote_map, list_count, buffers, sizes, … … 1066 1071 void *buffer, bmi_size_t expected_len, bmi_size_t *actual_len __unused, 1067 1072 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) 1069 1074 { 1070 1075 return post_recv(id, remote_map, 0, &buffer, &expected_len, … … 1077 1082 bmi_size_t tot_expected_len, bmi_size_t *tot_actual_len __unused, 1078 1083 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) 1080 1085 { 1081 1086 return post_recv(id, remote_map, list_count, buffers, sizes, … … 2109 2114 { 2110 2115 .method_name = "bmi_ib", 2116 .flags = 0, 2111 2117 .initialize = BMI_ib_initialize, 2112 2118 .finalize = BMI_ib_finalize, -
branches/Orange-Branch/src/io/bmi/bmi_mx/README
r6973 r8317 68 68 BMX_DEBUG Turn on gossip messages 69 69 BMX_MEM_ACCT Track memory usage 70 BMX_LOGGING Turn on MPE logging71 70 BMX_SERVER_RXS Additional rxs for servers 72 71 BMX_TIMEOUT Timeout for all MX messages … … 117 116 BMI_mx_method_addr_lookup(). 118 117 119 BMX_LOGGING120 This is not generally recommended. It turns on support for MPE logging but121 it requires modifying the Makefile.in script and re-generating configure.122 Contact help <at> myri.com for assistance.123 124 118 BMX_SERVER_RXS 125 119 The server will receive messages from unknown peers. This value determines how … … 156 150 mx://hostname:ep_id 157 151 158 Use the first option if mx_info lists hostname:board and use the second option if mx_info simply shows a hostname. 152 Use the first option if mx_info lists hostname:board and use the second option 153 if mx_info simply shows a hostname. 159 154 160 155 ====================== -
branches/Orange-Branch/src/io/bmi/bmi_mx/mx.c
r7564 r8317 17 17 struct bmx_data *bmi_mx = NULL; /* global state for bmi_mx */ 18 18 19 mx_status_t BMX_NO_STATUS; 20 19 21 #if BMX_MEM_ACCT 20 22 uint64_t mem_used = 0; /* bytes used */ … … 22 24 #endif 23 25 24 #if BMX_LOGGING25 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 #endif34 35 26 /* statics for event logging */ 36 27 static PINT_event_type bmi_mx_send_event_id; … … 48 39 static void 49 40 bmx_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 51 static void 52 bmx_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 74 static void 75 bmx_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 } 50 83 51 84 /**** TX/RX handling functions **************************************/ … … 224 257 } 225 258 226 /* remove from peer's queued txs/rxs list */227 static void228 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 242 259 /* add to peer's pending rxs list */ 243 260 static void … … 280 297 } 281 298 282 /* queue on unexpected rx or tx list */299 /* dequeue from unexpected rx list */ 283 300 static void 284 bmx_q_unex_ctx(struct bmx_ctx *ctx) 285 { 301 bmx_deq_unex_rx(struct bmx_ctx **rxp) 302 { 303 struct bmx_ctx *rx = NULL; 304 list_t *list = &bmi_mx->bmx_unex_rxs; 305 286 306 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 296 315 BMX_EXIT; 297 316 return; 298 317 } 299 318 300 /* add to the global canceled list */319 /* add to the completion queue for the appropriate context */ 301 320 static void 302 bmx_q_canceled_ctx(struct bmx_ctx *ctx, bmi_error_code_t error) 303 { 321 bmx_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 304 328 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 352 static void 353 bmx_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 313 370 BMX_EXIT; 314 371 return; … … 347 404 348 405 static 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"); 406 bmx_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"); 353 413 return; 354 414 } 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); 363 420 exit(1); 364 421 } 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); 370 432 return; 371 433 } … … 416 478 417 479 return tx; 418 }419 420 static void421 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;443 480 } 444 481 … … 759 796 return ret; 760 797 } 761 bmx_put_idle_ rx(rx);798 bmx_put_idle_ctx(rx); 762 799 } 763 800 … … 810 847 bmx_globals_init(int method_id) 811 848 { 849 int i = 0; 850 812 851 #if BMX_MEM_ACCT 813 852 mem_used = 0; … … 840 879 gen_mutex_init(&bmi_mx->bmx_idle_rxs_lock); 841 880 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 847 890 INIT_QLIST_HEAD(&bmi_mx->bmx_unex_rxs); 848 891 gen_mutex_init(&bmi_mx->bmx_unex_rxs_lock); … … 883 926 param.val.context_id.shift = BMX_MSG_SHIFT; 884 927 885 if (board == -1) board = 0;886 928 mxret = mx_open_endpoint(board, ep_id, BMX_MAGIC, 887 929 ¶m, 1, ep); … … 922 964 923 965 BMX_ENTER; 924 925 #if BMX_LOGGING926 MPE_Init_log();927 #define BMX_LOG_STATE 1928 #if BMX_LOG_STATE929 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 #else942 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 */960 966 961 967 /* check params */ … … 1024 1030 ret = bmx_ctx_alloc(&rx, BMX_REQ_RX); 1025 1031 if (ret == 0) { 1026 bmx_put_idle_ rx(rx);1032 bmx_put_idle_ctx(rx); 1027 1033 } 1028 1034 } … … 1137 1143 debug(BMX_DB_MEM, "memory leaked at shutdown %lld", llu(mem_used)); 1138 1144 #endif 1139 1140 #if BMX_LOGGING1141 MPE_Finish_log("/tmp/bmi_mx.log");1142 #endif1143 1145 BMX_EXIT; 1144 1145 1146 return 0; 1146 1147 } … … 1180 1181 tx = qlist_entry(queued_txs->next, struct bmx_ctx, mxc_list); 1181 1182 qlist_del_init(&tx->mxc_list); 1182 bmx_q_c anceled_ctx(tx, err);1183 bmx_q_completed(tx, BMX_CTX_CANCELED, BMX_NO_STATUS, err); 1183 1184 } 1184 1185 /* cancel queued rxs */ … … 1187 1188 rx = qlist_entry(queued_rxs->next, struct bmx_ctx, mxc_list); 1188 1189 qlist_del_init(&rx->mxc_list); 1189 bmx_q_c anceled_ctx(rx, err);1190 bmx_q_completed(rx, BMX_CTX_CANCELED, BMX_NO_STATUS, err); 1190 1191 } 1191 1192 /* try to cancel pending rxs */ … … 1195 1196 if (result) { 1196 1197 qlist_del_init(&rx->mxc_list); 1197 bmx_q_c anceled_ctx(rx, err);1198 bmx_q_completed(rx, BMX_CTX_CANCELED, BMX_NO_STATUS, err); 1198 1199 } 1199 1200 } … … 1424 1425 uint64_t type = (uint64_t) ctx->mxc_msg_type; 1425 1426 uint64_t id = 0ULL; 1426 uint64_t tag = (uint64_t) ctx->mxc_tag;1427 uint64_t tag = (uint64_t) ((uint32_t) ctx->mxc_tag); 1427 1428 1428 1429 if (ctx->mxc_msg_type == BMX_MSG_CONN_REQ || … … 1517 1518 ret = -BMI_ENOMEM; 1518 1519 bmx_deq_pending_ctx(tx); /* uses peer lock */ 1519 bmx_q_c anceled_ctx(tx, BMI_ENOMEM);1520 bmx_q_completed(tx, BMX_CTX_CANCELED, BMX_NO_STATUS, BMI_ENOMEM); 1520 1521 } 1521 1522 } else { /* peer is not ready */ … … 1572 1573 PINT_event_id eid = 0; 1573 1574 1574 #if BMX_LOGGING1575 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 #endif1581 1582 1575 PINT_EVENT_START( 1583 1576 bmi_mx_send_event_id, bmi_mx_pid, NULL, &eid, … … 1621 1614 BMX_MALLOC(segs, (numbufs * sizeof(*segs))); 1622 1615 if (segs == NULL) { 1623 bmx_put_idle_ tx(tx);1616 bmx_put_idle_ctx(tx); 1624 1617 bmx_peer_decref(peer); 1625 1618 ret = -BMI_ENOMEM; … … 1642 1635 1643 1636 if (is_unexpected && tx->mxc_nob > (long long) BMX_UNEXPECTED_SIZE) { 1644 bmx_put_idle_ tx(tx);1637 bmx_put_idle_ctx(tx); 1645 1638 bmx_peer_decref(peer); 1646 1639 ret = -BMI_EINVAL; … … 1658 1651 BMX_MALLOC(mop, sizeof(*mop)); 1659 1652 if (mop == NULL) { 1660 bmx_put_idle_ tx(tx);1653 bmx_put_idle_ctx(tx); 1661 1654 bmx_peer_decref(peer); 1662 1655 ret = -BMI_ENOMEM; … … 1673 1666 tx->mxc_mop = mop; 1674 1667 1668 assert(context_id == mop->context_id); 1669 assert(context_id == tx->mxc_mop->context_id); 1670 1675 1671 bmx_create_match(tx); 1676 1672 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)); 1680 1677 1681 1678 ret = bmx_post_tx(tx); … … 1792 1789 ret = -BMI_ENOMEM; 1793 1790 bmx_deq_pending_ctx(rx); /* uses peer lock */ 1794 bmx_q_c anceled_ctx(rx, BMI_ENOMEM);1791 bmx_q_completed(rx, BMX_CTX_CANCELED, BMX_NO_STATUS, BMI_ENOMEM); 1795 1792 } 1796 1793 } else { /* peer is not ready */ … … 1817 1814 struct bmx_peer *peer = NULL; 1818 1815 PINT_event_id eid = 0; 1819 1820 #if BMX_LOGGING1821 MPE_Log_event(recv_start, (int) tag, NULL);1822 #endif1823 1816 1824 1817 PINT_EVENT_START( … … 1865 1858 BMX_MALLOC(segs, (numbufs * sizeof(*segs))); 1866 1859 if (segs == NULL) { 1867 bmx_put_idle_ rx(rx);1860 bmx_put_idle_ctx(rx); 1868 1861 bmx_peer_decref(peer); 1869 1862 ret = -BMI_ENOMEM; … … 1887 1880 BMX_MALLOC(mop, sizeof(*mop)); 1888 1881 if (mop == NULL) { 1889 bmx_put_idle_ rx(rx);1882 bmx_put_idle_ctx(rx); 1890 1883 bmx_peer_decref(peer); 1891 1884 ret = -BMI_ENOMEM; … … 2026 2019 } 2027 2020 2028 #if BMX_LOGGING2029 MPE_Log_event(recvunex_start, (int) tag, NULL);2030 #endif2031 2032 2021 rx = bmx_get_idle_rx(); 2033 2022 if (rx != NULL) { … … 2062 2051 "unexpected recv with tag %d length %d", 2063 2052 mx_strerror(mxret), tag, length); 2064 bmx_put_idle_ rx(rx);2053 bmx_put_idle_ctx(rx); 2065 2054 ret = -1; 2066 2055 } … … 2121 2110 "unexpected recv with %s", 2122 2111 mx_strerror(mxret)); 2123 bmx_put_idle_ rx(rx);2112 bmx_put_idle_ctx(rx); 2124 2113 ret = MX_RECV_FINISHED; 2125 2114 } … … 2341 2330 /* drop ref taken before mx_iconnect() */ 2342 2331 bmx_peer_decref(tx->mxc_peer); 2343 bmx_put_idle_ tx(tx);2332 bmx_put_idle_ctx(tx); 2344 2333 continue; 2345 2334 } else if (status.code != MX_STATUS_SUCCESS) { 2346 2335 bmx_peer_decref(rx->mxc_peer); 2347 bmx_put_idle_ rx(rx);2336 bmx_put_idle_ctx(rx); 2348 2337 continue; 2349 2338 } … … 2356 2345 BMX_VERSION, version); 2357 2346 bmx_peer_decref(rx->mxc_peer); 2358 bmx_put_idle_ rx(rx);2347 bmx_put_idle_ctx(rx); 2359 2348 continue; 2360 2349 } … … 2362 2351 debug(BMX_DB_WARN, "received CONN_REQ on a client."); 2363 2352 bmx_peer_decref(rx->mxc_peer); 2364 bmx_put_idle_ rx(rx);2353 bmx_put_idle_ctx(rx); 2365 2354 continue; 2366 2355 } … … 2390 2379 (char *) rx->mxc_buffer); 2391 2380 bmx_peer_decref(rx->mxc_peer); 2392 bmx_put_idle_ rx(rx);2381 bmx_put_idle_ctx(rx); 2393 2382 continue; 2394 2383 } … … 2399 2388 "method addr for %s", peername); 2400 2389 bmx_peer_decref(rx->mxc_peer); 2401 bmx_put_idle_ rx(rx);2390 bmx_put_idle_ctx(rx); 2402 2391 continue; 2403 2392 } … … 2409 2398 "peer for %s", peername); 2410 2399 bmx_peer_decref(rx->mxc_peer); 2411 bmx_put_idle_ rx(rx);2400 bmx_put_idle_ctx(rx); 2412 2401 continue; 2413 2402 } … … 2436 2425 mx_iconnect(bmi_mx->bmx_ep, peer->mxp_nic_id, mxmap->mxm_ep_id, 2437 2426 BMX_MAGIC, ack, peer, &request); 2438 bmx_put_idle_ rx(rx);2427 bmx_put_idle_ctx(rx); 2439 2428 } 2440 2429 } while (result); … … 2551 2540 llu(tx->mxc_match), mx_strstatus(status.code)); 2552 2541 bmx_peer_decref(tx->mxc_peer); 2553 bmx_put_idle_ tx(tx);2542 bmx_put_idle_ctx(tx); 2554 2543 } 2555 2544 } while (result); … … 2578 2567 } 2579 2568 2569 static void 2570 bmx_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 2580 2594 static int 2581 2595 BMI_mx_test(bmi_op_id_t id, int *outcount, bmi_error_code_t *err, 2582 2596 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) 2584 2598 { 2585 2599 uint32_t result = 0; … … 2592 2606 bmx_connection_handlers(); 2593 2607 2608 bmx_get_completion_token(); 2609 2594 2610 mop = id_gen_fast_lookup(id); 2595 2611 ctx = mop->method_data; 2596 2612 peer = ctx->mxc_peer; 2597 2613 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 2598 2619 switch (ctx->mxc_state) { 2620 case BMX_CTX_COMPLETED: 2599 2621 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]); 2606 2623 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); 2608 2626 *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 }2623 2627 break; 2624 2628 case BMX_CTX_PENDING: 2625 /* racing with mx_test_any() in textcontext? */2626 2629 mx_test(bmi_mx->bmx_ep, &ctx->mxc_mxreq, &ctx->mxc_mxstat, &result); 2627 2630 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); 2634 2633 *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);2655 2634 } 2656 2635 break; … … 2659 2638 ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", ctx->mxc_state); 2660 2639 } 2640 bmx_release_completion_token(); 2661 2641 BMX_EXIT; 2662 2642 … … 2677 2657 struct bmx_ctx *ctx = NULL; 2678 2658 struct bmx_peer *peer = NULL; 2679 list_t *canceled = &bmi_mx->bmx_canceled;2680 2659 int wait = 0; 2681 2660 static int count = 0; … … 2689 2668 bmx_connection_handlers(); 2690 2669 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 2720 2686 * we will always try (incount - completed) times even 2721 2687 * if some iterations have no result */ … … 2736 2702 wait = 2; 2737 2703 } 2704 2738 2705 if (result) { 2739 2706 ctx = (struct bmx_ctx *) status.context; 2740 2707 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; 2741 2714 peer = ctx->mxc_peer; 2742 2715 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", 2745 2719 llu(ctx->mxc_match), peer->mxp_mxmap->mxm_peername, 2746 2720 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]); 2767 2726 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 */ 2789 2734 2790 2735 match = (uint64_t) BMX_MSG_UNEXPECTED << BMX_MSG_SHIFT; … … 2795 2740 uint32_t result = 0; 2796 2741 mx_status_t status; 2797 list_t *unex_txs = &bmi_mx->bmx_unex_txs;2798 2742 int again = 1; 2799 2743 2800 2744 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);2810 2745 2811 2746 while (!ctx && again) { … … 2816 2751 bmx_deq_pending_ctx(ctx); 2817 2752 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)); 2821 2759 result = 0; 2822 2760 again = 1; … … 2834 2772 llu(ctx->mxc_mop->op_id)); 2835 2773 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) { 2842 2779 debug(BMX_DB_CTX, "%s unexpected send completed with " 2843 2780 "error %s", __func__, mx_strstatus(status.code)); 2844 2781 bmx_peer_disconnect(peer, 0, BMI_ENETRESET); 2845 2782 } 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));2856 2783 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 2865 2788 if (completed - old > 0) { 2866 2789 debug(BMX_DB_CTX, "%s found %d unexpected tx messages", … … 2888 2811 struct bmx_ctx *rx = NULL; 2889 2812 struct bmx_peer *peer = NULL; 2890 list_t *unex_rxs = &bmi_mx->bmx_unex_rxs;2891 2813 int again = 1; 2892 2814 … … 2897 2819 2898 2820 bmx_connection_handlers(); 2821 2822 bmx_get_completion_token(); 2899 2823 2900 2824 /* if the unexpected handler cannot get a rx, it does not post a receive. … … 2903 2827 if (result) { 2904 2828 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); 2906 2832 if (ret != 0) { 2907 2833 debug(BMX_DB_CTX, "%s mx_iprobe() found rx with match 0x%llx " … … 2914 2840 *outcount = 0; 2915 2841 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; 2919 2846 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 } 2924 2848 2925 2849 while (!rx && again) { … … 2931 2855 peer = rx->mxc_peer; 2932 2856 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)); 2934 2859 result = 0; 2935 2860 again = 1; … … 2953 2878 ui->tag = rx->mxc_tag; 2954 2879 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); 2959 2881 bmx_peer_decref(peer); /* drop the ref taken in unexpected_recv() */ 2960 2882 *outcount = 1; 2961 2883 } 2884 bmx_release_completion_token(); 2885 2962 2886 if (print) 2963 2887 BMX_EXIT; … … 3014 2938 3015 2939 ret = bmx_open_endpoint(&bmi_mx->bmx_ep, 3016 bmi_mx->bmx_board,2940 MX_ANY_NIC, 3017 2941 MX_ANY_ENDPOINT); 3018 2942 if (ret != 0) { … … 3026 2950 mx_decompose_endpoint_addr2(epa, &nic_id, &bmi_mx->bmx_ep_id, 3027 2951 &bmi_mx->bmx_sid); 2952 /* get our board number */ 2953 mx_nic_id_to_board_number(nic_id, &bmi_mx->bmx_board); 3028 2954 /* get our hostname */ 3029 2955 mx_nic_id_to_hostname(nic_id, host); … … 3141 3067 /* NOTE There may be a race between this and BMI_mx_testcontext(). */ 3142 3068 static int 3143 BMI_mx_cancel(bmi_op_id_t id, bmi_context_id context_id __unused)3069 BMI_mx_cancel(bmi_op_id_t id, bmi_context_id context_id) 3144 3070 { 3145 3071 struct method_op *mop; … … 3150 3076 BMX_ENTER; 3151 3077 3078 bmx_get_completion_token(); 3079 3152 3080 mop = id_gen_fast_lookup(id); 3153 3081 ctx = mop->method_data; 3154 3082 peer = ctx->mxc_peer; 3155 3083 3084 assert(context_id == ctx->mxc_mop->context_id); 3085 3156 3086 debug(BMX_DB_CTX, "%s %s op_id %llu mxc_state %d peer state %d", __func__, 3157 3087 ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", 3158 3088 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 3159 3093 switch (ctx->mxc_state) { 3160 3094 case BMX_CTX_QUEUED: 3161 /* we are racing with the connection setup */3162 bmx_deq_ctx(ctx);3163 bmx_q_c anceled_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); 3164 3098 break; 3165 3099 case BMX_CTX_PENDING: 3100 gen_mutex_unlock(&peer->mxp_lock); 3166 3101 if (ctx->mxc_type == BMX_REQ_TX) { 3167 3102 /* see if it completed first */ … … 3170 3105 debug(BMX_DB_CTX, "%s completed TX op_id %llu " 3171 3106 "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, 3173 3108 peer->mxp_state, mx_strstatus(ctx->mxc_mxstat.code)); 3174 3109 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); 3176 3112 } else { 3177 3113 /* and if not, then disconnect() */ … … 3182 3118 if (result == 1) { 3183 3119 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); 3185 3122 } 3186 3123 } … … 3190 3127 ctx->mxc_type == BMX_REQ_TX ? "TX" : "RX", ctx->mxc_state); 3191 3128 } 3129 bmx_release_completion_token(); 3130 3192 3131 BMX_EXIT; 3193 3132 … … 3213 3152 { 3214 3153 .method_name = "bmi_mx", 3154 .flags = 0, 3215 3155 .initialize = BMI_mx_initialize, 3216 3156 .finalize = BMI_mx_finalize, -
branches/Orange-Branch/src/io/bmi/bmi_mx/mx.h
r6980 r8317 16 16 #include <unistd.h> 17 17 #include <errno.h> 18 #include <assert.h> 18 19 19 20 #include <mx_extensions.h> /* needed for callback handler, etc. */ … … 54 55 #define BMX_DEBUG 1 /* enable debug (gossip) statements */ 55 56 #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_LOGGING59 #include "mpe.h"60 #endif61 57 62 58 #if BMX_MEM_TWEAK … … 166 162 gen_mutex_t bmx_idle_rxs_lock; /* idle_rxs lock */ 167 163 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 173 173 list_t bmx_unex_rxs; /* completed unexpected recvs */ 174 174 gen_mutex_t bmx_unex_rxs_lock; /* completed unexpected recvs lock */ … … 278 278 mx_request_t mxc_mxreq; /* MX request */ 279 279 mx_status_t mxc_mxstat; /* MX status */ 280 bmi_error_code_t mxc_error; /* BMI error code */ 280 281 281 282 uint64_t mxc_get; /* # of times returned from idle list */ -
branches/Orange-Branch/src/io/bmi/bmi_portals/portals.c
r7376 r8317 2294 2294 { 2295 2295 .method_name = "bmi_portals", 2296 .flags = 0, 2296 2297 .initialize = bmip_initialize, 2297 2298 .finalize = bmip_finalize, -
branches/Orange-Branch/src/io/bmi/bmi_tcp/socket-collection.c
r7681 r8317 90 90 if(new_server_socket > -1) 91 91 { 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; 95 95 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++; 102 103 103 104 return (tmp_scp); -
branches/Orange-Branch/src/io/flow/flow.h
r7471 r8317 100 100 101 101 /* 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); 103 103 104 104 struct flow_endpoint src; /* src endpoint */ -
branches/Orange-Branch/src/io/flow/flowproto-bmi-cache/flowproto-bmi-cache-server.c
r7471 r8317 490 490 free(flow_data); 491 491 flow_d->release(flow_d); 492 flow_d->callback(flow_d );492 flow_d->callback(flow_d, 0); 493 493 fprintf(stderr, "bmi_cache_request_init: exit with return 1. zero request.\n"); 494 494 return(1); … … 801 801 flow_d->state = FLOW_COMPLETE; 802 802 flow_d->release(flow_d); 803 flow_d->callback(flow_d );803 flow_d->callback(flow_d, 0); 804 804 fprintf(stderr, "bmi_recv_callback_fn: request is done\n"); 805 805 return; -
branches/Orange-Branch/src/io/flow/flowproto-bmi-trove/flowproto-multiqueue.c
r7603 r8317 31 31 #define MAX_REGIONS 64 32 32 33 #define FLOW_CLEANUP (__flow_data)\33 #define FLOW_CLEANUP_CANCEL_PATH(__flow_data, __cancel_path) \ 34 34 do { \ 35 35 struct flow_descriptor *__flow_d = (__flow_data)->parent; \ … … 40 40 free(__flow_data); \ 41 41 __flow_d->release(__flow_d); \ 42 __flow_d->callback(__flow_d );\42 __flow_d->callback(__flow_d, __cancel_path); \ 43 43 } while(0) 44 45 #define FLOW_CLEANUP(___flow_data) FLOW_CLEANUP_CANCEL_PATH(___flow_data, 0) 44 46 45 47 struct result_chain_entry … … 480 482 { 481 483 gen_mutex_unlock(&flow_data->parent->flow_mutex); 482 FLOW_CLEANUP (flow_data);484 FLOW_CLEANUP_CANCEL_PATH(flow_data, 1); 483 485 return(0); 484 486 } -
branches/Orange-Branch/src/io/job/job.c
r8251 r8317 130 130 static void trove_thread_mgr_callback(void* data, 131 131 PVFS_error error_code); 132 static void flow_callback(flow_descriptor* flow_d );132 static void flow_callback(flow_descriptor* flow_d, int cancel_path); 133 133 #ifndef __PVFS2_JOB_THREADED__ 134 134 static gen_mutex_t work_cycle_mutex = GEN_MUTEX_INITIALIZER; … … 5267 5267 * no return value 5268 5268 */ 5269 static void flow_callback(flow_descriptor* flow_d )5269 static void flow_callback(flow_descriptor* flow_d, int cancel_path) 5270 5270 { 5271 5271 struct job_desc* tmp_desc = (struct job_desc*)flow_d->user_ptr; … … 5281 5281 5282 5282 /* 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); 5284 5289 job_desc_q_add(completion_queue_array[tmp_desc->context_id], 5285 5290 tmp_desc); … … 5295 5300 pthread_cond_signal(&completion_cond); 5296 5301 #endif 5297 gen_mutex_unlock(&completion_mutex); 5302 if(!cancel_path) 5303 gen_mutex_unlock(&completion_mutex); 5298 5304 5299 5305 return; -
branches/Orange-Branch/src/io/trove/pvfs2-storage.h
r7450 r8317 156 156 else \ 157 157 { \ 158 (dest)->mtime = time(NULL);\158 (dest)->mtime = PINT_util_mktime_version(time(NULL)); \ 159 159 } \ 160 160 } \ -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-alt-aio.c
r7627 r8317 372 372 alt_aio_bstream_read_list, 373 373 alt_aio_bstream_write_list, 374 dbpf_bstream_flush 374 dbpf_bstream_flush, 375 NULL 375 376 }; 376 377 -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-attr-cache.c
r7450 r8317 141 141 int dbpf_attr_cache_finalize(void) 142 142 { 143 int ret = -1, i = 0 ;143 int ret = -1, i = 0, j = 0; 144 144 struct qlist_head *hash_link = NULL; 145 145 dbpf_attr_cache_elem_t *cache_elem = NULL; … … 157 157 cache_elem = qhash_entry( 158 158 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 } 159 166 free(cache_elem); 160 167 s_current_num_cache_elems--; -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-bstream-direct.c
r7750 r8317 659 659 PINT_mem_aligned_free(aligned_buf); 660 660 661 return re ad_size;661 return ret; 662 662 } 663 663 … … 858 858 goto cache_put; 859 859 } 860 if(qop_p->op.flags & TROVE_SYNC) 861 { 862 sync_required = 1; 863 } 860 sync_required = 1; 864 861 } 865 862 gen_mutex_unlock(&dbpf_update_size_lock); … … 1068 1065 NULL, 1069 1066 user_ptr, 1070 0,1067 TROVE_SYNC, 1071 1068 context_id); 1072 1069 … … 1354 1351 /* consume stream region and update mem region */ 1355 1352 ext_size = cur_stream_size; 1353 ext_ptr = cur_mem_off; 1354 ext_off = cur_stream_off; 1356 1355 1357 1356 cur_mem_size -= cur_stream_size; -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-dspace.c
r8133 r8317 1547 1547 } 1548 1548 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 } 1551 1560 } 1552 1561 -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-mgmt.c
r7992 r8317 1954 1954 coll_p->meta_sync_enabled = 1; /* MUST be 1 !*/ 1955 1955 1956 1957 1956 dbpf_collection_register(coll_p); 1958 1957 *out_coll_id_p = coll_p->coll_id; 1958 1959 clear_stranded_bstreams(coll_p->coll_id); 1960 1959 1961 return 1; 1960 1962 } -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-null-aio.c
r7607 r8317 395 395 null_aio_bstream_read_list, 396 396 null_aio_bstream_write_list, 397 dbpf_bstream_flush 397 dbpf_bstream_flush, 398 NULL 398 399 }; 399 400 -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-open-cache.c
r8114 r8317 23 23 #include <string.h> 24 24 #include <db.h> 25 #include <dirent.h> 25 26 26 27 #include "trove.h" … … 634 635 } 635 636 637 void 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 636 698 /* 637 699 * Local variables: -
branches/Orange-Branch/src/io/trove/trove-dbpf/dbpf-open-cache.h
r7560 r8317 45 45 TROVE_handle handle); 46 46 47 void clear_stranded_bstreams(TROVE_coll_id coll_id); 48 47 49 #endif /* __DBPF_OPEN_CACHE_H__ */ 48 50 -
branches/Orange-Branch/src/kernel/linux-2.6/inode.c
r7924 r8317 134 134 struct backing_dev_info pvfs2_backing_dev_info = 135 135 { 136 #ifdef HAVE_BACKING_DEV_INFO_NAME 137 .name = "pvfs2", 138 #endif 136 139 .ra_pages = 0, 137 140 #ifdef HAVE_BDI_MEMORY_BACKED -
branches/Orange-Branch/src/kernel/linux-2.6/namei.c
r7968 r8317 71 71 pvfs2_inode_t *parent = NULL, *found_pvfs2_inode = NULL; 72 72 struct super_block *sb = NULL; 73 struct dentry *res = NULL;74 73 75 74 /* … … 202 201 if (inode && !is_bad_inode(inode)) 203 202 { 203 struct dentry *res; 204 204 205 gossip_debug(GOSSIP_NAME_DEBUG, "%s:%s:%d Found good inode [%lu] with count [%d]\n", 205 206 __FILE__, __func__, __LINE__, ino
