Whamcloud - gitweb
landing b_cmobd_merge on HEAD
authorphil <phil>
Wed, 2 Jun 2004 15:06:23 +0000 (15:06 +0000)
committerphil <phil>
Wed, 2 Jun 2004 15:06:23 +0000 (15:06 +0000)
b_cmobd_merge should not be used for any further development or testing!

781 files changed:
ldiskfs/kernel_patches/patches/export-ext3-2.6-suse.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/export_symbols-ext3-2.6-suse.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/ext3-ea-in-inode-2.6-suse.patch [moved from lustre/kernel_patches/patches/ext3-ea-in-inode-2.6.0.patch with 98% similarity]
ldiskfs/kernel_patches/patches/ext3-include-fixes-2.6-suse.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/ext3-map_inode_page-2.6-suse.patch [moved from lustre/kernel_patches/patches/ext3-map_inode_page-2.6.0.patch with 100% similarity]
ldiskfs/kernel_patches/patches/ext3-san-jdike-2.6-suse.patch [moved from lustre/kernel_patches/patches/ext3-san-jdike-2.5.73.patch with 100% similarity]
ldiskfs/kernel_patches/patches/ext3-wantedi-2.6-suse.patch [moved from lustre/kernel_patches/patches/ext3-wantedi-2.6.3.patch with 91% similarity]
ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series [new file with mode: 0644]
ldiskfs/ldiskfs/Makefile.in [new file with mode: 0644]
ldiskfs/ldiskfs/autoMakefile.am [new file with mode: 0644]
lnet/.cvsignore
lnet/Makefile.am [deleted file]
lnet/Makefile.in [new file with mode: 0644]
lnet/Rules.linux [deleted file]
lnet/archdep.m4
lnet/autoMakefile.am [moved from lnet/klnds/Makefile.am with 59% similarity]
lnet/build.m4
lnet/include/linux/kp30.h
lnet/include/linux/kpr.h
lnet/include/linux/libcfs.h
lnet/include/linux/portals_compat25.h
lnet/include/lnet/Makefile.am [deleted file]
lnet/include/lnet/api-support.h
lnet/include/lnet/api.h
lnet/include/lnet/arg-blocks.h
lnet/include/lnet/errno.h
lnet/include/lnet/internal.h
lnet/include/lnet/lib-dispatch.h
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-p30.h
lnet/include/lnet/lib-types.h
lnet/include/lnet/lnet.h
lnet/include/lnet/lnetctl.h
lnet/include/lnet/nal.h
lnet/include/lnet/nalids.h
lnet/include/lnet/p30.h
lnet/include/lnet/ptlctl.h
lnet/include/lnet/types.h
lnet/klnds/.cvsignore
lnet/klnds/Makefile.in [new file with mode: 0644]
lnet/klnds/autoMakefile.am [moved from lnet/include/Makefile.am with 66% similarity]
lnet/klnds/gmlnd/.cvsignore
lnet/klnds/gmlnd/Makefile.am [deleted file]
lnet/klnds/gmlnd/Makefile.in [new file with mode: 0644]
lnet/klnds/gmlnd/autoMakefile.am [new file with mode: 0644]
lnet/klnds/gmlnd/gmlnd.h
lnet/klnds/gmlnd/gmlnd_api.c
lnet/klnds/gmlnd/gmlnd_module.c
lnet/klnds/iblnd/.cvsignore
lnet/klnds/iblnd/Makefile.am [deleted file]
lnet/klnds/iblnd/Makefile.in [new file with mode: 0644]
lnet/klnds/iblnd/autoMakefile.am [new file with mode: 0644]
lnet/klnds/iblnd/ibnal.c
lnet/klnds/qswlnd/.cvsignore
lnet/klnds/qswlnd/Makefile.am [deleted file]
lnet/klnds/qswlnd/Makefile.in [new file with mode: 0644]
lnet/klnds/qswlnd/autoMakefile.am [new file with mode: 0644]
lnet/klnds/qswlnd/qswlnd.c
lnet/klnds/qswlnd/qswlnd.h
lnet/klnds/qswlnd/qswlnd_cb.c
lnet/klnds/scimaclnd/.cvsignore
lnet/klnds/scimaclnd/Makefile.am [deleted file]
lnet/klnds/scimaclnd/Makefile.in [new file with mode: 0644]
lnet/klnds/scimaclnd/autoMakefile.am [new file with mode: 0644]
lnet/klnds/scimaclnd/scimacnal.c
lnet/klnds/socklnd/.cvsignore
lnet/klnds/socklnd/Makefile.am [deleted file]
lnet/klnds/socklnd/Makefile.in [new file with mode: 0644]
lnet/klnds/socklnd/autoMakefile.am [new file with mode: 0644]
lnet/klnds/socklnd/socklnd.c
lnet/klnds/socklnd/socklnd.h
lnet/klnds/socklnd/socklnd_cb.c
lnet/libcfs/.cvsignore
lnet/libcfs/Makefile.am [deleted file]
lnet/libcfs/Makefile.in [new file with mode: 0644]
lnet/libcfs/autoMakefile.am [new file with mode: 0644]
lnet/libcfs/debug.c
lnet/libcfs/module.c
lnet/libcfs/proc.c
lnet/lnet/.cvsignore
lnet/lnet/Makefile.in [new file with mode: 0644]
lnet/lnet/api-eq.c
lnet/lnet/api-errno.c
lnet/lnet/api-init.c
lnet/lnet/api-me.c
lnet/lnet/api-ni.c
lnet/lnet/api-wrap.c
lnet/lnet/autoMakefile.am [moved from lnet/lnet/Makefile.am with 57% similarity]
lnet/lnet/lib-dispatch.c
lnet/lnet/lib-init.c
lnet/lnet/lib-md.c
lnet/lnet/lib-me.c
lnet/lnet/lib-msg.c
lnet/lnet/lib-ni.c
lnet/lnet/module.c
lnet/router/.cvsignore
lnet/router/Makefile.am [deleted file]
lnet/router/Makefile.in [new file with mode: 0644]
lnet/router/autoMakefile.am [new file with mode: 0644]
lnet/router/router.c
lnet/router/router.h
lnet/tests/.cvsignore
lnet/tests/Makefile.am [deleted file]
lnet/tests/Makefile.in [new file with mode: 0644]
lnet/tests/autoMakefile.am [new file with mode: 0644]
lnet/tests/ping_cli.c
lnet/tests/ping_srv.c
lnet/tests/sping_cli.c
lnet/tests/sping_srv.c
lnet/ulnds/Makefile.am
lnet/ulnds/bridge.h
lnet/ulnds/connection.c
lnet/ulnds/procapi.c
lnet/ulnds/procbridge.h
lnet/ulnds/proclib.c
lnet/ulnds/socklnd/Makefile.am
lnet/ulnds/socklnd/bridge.h
lnet/ulnds/socklnd/connection.c
lnet/ulnds/socklnd/procapi.c
lnet/ulnds/socklnd/procbridge.h
lnet/ulnds/socklnd/proclib.c
lnet/utils/Makefile.am
lnet/utils/acceptor.c
lnet/utils/debug.c
lnet/utils/gmlndnid.c
lnet/utils/l_ioctl.c
lnet/utils/parser.c
lnet/utils/parser.h
lnet/utils/portals.c
lnet/utils/wirecheck.c
lustre/.cvsignore
lustre/ChangeLog
lustre/Makefile.am [deleted file]
lustre/Makefile.in [new file with mode: 0644]
lustre/Makefile.mk
lustre/README.kernel-source [new file with mode: 0644]
lustre/Rules [deleted file]
lustre/Rules.in [new file with mode: 0644]
lustre/autoMakefile.am [new file with mode: 0644]
lustre/autogen.sh
lustre/cmobd/.cvsignore [new file with mode: 0644]
lustre/cmobd/Makefile.in [new file with mode: 0644]
lustre/cmobd/Makefile.mk [new file with mode: 0644]
lustre/cmobd/autoMakefile.am [moved from lnet/include/linux/Makefile.am with 53% similarity]
lustre/cmobd/cache_manager_obd.c [new file with mode: 0644]
lustre/cmobd/cmobd_internal.h [new file with mode: 0644]
lustre/cmobd/cmobd_mds_reint.c [new file with mode: 0644]
lustre/cmobd/cmobd_oss_reint.c [new file with mode: 0644]
lustre/cmobd/cmobd_reint.c [new file with mode: 0644]
lustre/cmobd/cmobd_write.c [new file with mode: 0644]
lustre/cmobd/lproc_cm.c [new file with mode: 0644]
lustre/cobd/.cvsignore
lustre/cobd/Makefile.in [new file with mode: 0644]
lustre/cobd/autoMakefile.am [moved from lustre/cobd/Makefile.am with 50% similarity]
lustre/cobd/cache_obd.c
lustre/cobd/lproc_cache.c
lustre/conf/Makefile.am
lustre/conf/lustre.dtd
lustre/configure.in
lustre/doc/Makefile.am
lustre/doc/lmc.1
lustre/doc/lmc.lyx
lustre/include/.cvsignore
lustre/include/Makefile.am
lustre/include/config.h.in [deleted file]
lustre/include/liblustre.h
lustre/include/linux/Makefile.am
lustre/include/linux/lprocfs_status.h
lustre/include/linux/lustre_cfg.h
lustre/include/linux/lustre_cmobd.h [new file with mode: 0644]
lustre/include/linux/lustre_compat25.h
lustre/include/linux/lustre_dlm.h
lustre/include/linux/lustre_fsfilt.h
lustre/include/linux/lustre_idl.h
lustre/include/linux/lustre_lib.h
lustre/include/linux/lustre_lite.h
lustre/include/linux/lustre_log.h
lustre/include/linux/lustre_mds.h
lustre/include/linux/lustre_net.h
lustre/include/linux/lustre_smfs.h [new file with mode: 0644]
lustre/include/linux/lvfs.h
lustre/include/linux/lvfs_linux.h
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/include/linux/obd_support.h
lustre/include/lustre/.cvsignore [new file with mode: 0644]
lustre/include/lustre/Makefile.am [moved from lustre/portals/knals/Makefile.am with 59% similarity]
lustre/include/lustre/liblustreapi.h [new file with mode: 0644]
lustre/include/lustre/lustre_user.h [moved from lustre/include/linux/lustre_user.h with 78% similarity]
lustre/install-sh [deleted file]
lustre/kernel-tests/.cvsignore [new file with mode: 0644]
lustre/kernel-tests/Makefile [new file with mode: 0644]
lustre/kernel_patches/kernel_configs/kernel-2.4.18-chaos-2.4.18-i686-smp.config [new file with mode: 0644]
lustre/kernel_patches/kernel_configs/kernel-2.4.18-chaos-2.4.18-i686.config [new file with mode: 0644]
lustre/kernel_patches/kernel_configs/kernel-2.4.20-rh-2.4-i686-smp.config [moved from lustre/kernel_patches/kernel_configs/kernel-2.4.20-rh-2.4-i586-smp.config with 100% similarity]
lustre/kernel_patches/kernel_configs/kernel-2.4.20-rh-2.4-i686.config [moved from lustre/kernel_patches/kernel_configs/kernel-2.4.20-rh-2.4-i586.config with 100% similarity]
lustre/kernel_patches/kernel_configs/kernel-2.4.21-suse-2.4.21-2-x86_64.config [new file with mode: 0644]
lustre/kernel_patches/patches/2.6.0-mm2.patch [deleted file]
lustre/kernel_patches/patches/2.6.0-test6-mm4.patch [deleted file]
lustre/kernel_patches/patches/add_page_private.patch
lustre/kernel_patches/patches/bproc-patch-2.4.20
lustre/kernel_patches/patches/cifs_2.6.5.patch [new file with mode: 0644]
lustre/kernel_patches/patches/configurable-x86-stack-2.4.21-sles8sp3.patch [new file with mode: 0644]
lustre/kernel_patches/patches/dev_read_only-2.6-suse.patch [moved from lustre/kernel_patches/patches/dev_read_only_2.6.0.patch with 100% similarity]
lustre/kernel_patches/patches/dev_read_only-suse-2.4.19.patch [new file with mode: 0644]
lustre/kernel_patches/patches/directio-2.4.24.patch [new file with mode: 0644]
lustre/kernel_patches/patches/export-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/export-2.6.3.patch [deleted file]
lustre/kernel_patches/patches/export-ext3-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/export-truncate-2.6-suse.patch [moved from lustre/kernel_patches/patches/export-truncate-2.5.63.patch with 100% similarity]
lustre/kernel_patches/patches/export_lookup_create.patch [new file with mode: 0644]
lustre/kernel_patches/patches/export_symbols-2.6-suse.patch [moved from lustre/kernel_patches/patches/export_symbols-2.6.0.patch with 50% similarity]
lustre/kernel_patches/patches/export_symbols-2.6.0-test6.patch [deleted file]
lustre/kernel_patches/patches/export_symbols-ext3-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/exports_2.4.19-suse.patch
lustre/kernel_patches/patches/ext-2.4-patch-1-suse-2.4.19.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.18-chaos.patch
lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.20.patch
lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.21-chaos.patch
lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.21-suse2.patch
lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.22-rh.patch
lustre/kernel_patches/patches/ext3-ea-in-inode-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-extents-2.4.18-chaos-pdirops.patch
lustre/kernel_patches/patches/ext3-extents-2.4.18-chaos.patch
lustre/kernel_patches/patches/ext3-extents-2.4.20-rh.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-extents-2.4.20.patch
lustre/kernel_patches/patches/ext3-extents-2.4.24.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-extents-in-ea-2.4.20.patch
lustre/kernel_patches/patches/ext3-extents-in-ea-exports-symbol.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-htree-2.4.19-pre1.patch
lustre/kernel_patches/patches/ext3-htree-2.4.21-chaos.patch
lustre/kernel_patches/patches/ext3-htree-2.4.22-rh.patch
lustre/kernel_patches/patches/ext3-htree-suse.patch
lustre/kernel_patches/patches/ext3-htree.patch
lustre/kernel_patches/patches/ext3-include-fixes-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-init-generation-2.6-suse.patch [moved from lustre/kernel_patches/patches/ext3-init-generation-2.6.0.patch with 100% similarity]
lustre/kernel_patches/patches/ext3-map_inode_page-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-mballoc-2.4.21-suse2.patch
lustre/kernel_patches/patches/ext3-mballoc-2.4.24.patch
lustre/kernel_patches/patches/ext3-mds-num-2.4.24.patch
lustre/kernel_patches/patches/ext3-orphan_lock-2.4.19-suse.patch
lustre/kernel_patches/patches/ext3-pdirops-2.4.24-chaos.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-san-jdike-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-trusted_ea-suse-2.4.19.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-use-after-free-suse.patch
lustre/kernel_patches/patches/ext3-wantedi-2.6-suse.patch [moved from lustre/kernel_patches/patches/ext3-wantedi-2.6.patch with 72% similarity]
lustre/kernel_patches/patches/ext3-wantedi-misc-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/ext3-xattr-header-move-2.6.suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/header-guards-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/htree-ext3-2.4.18.patch
lustre/kernel_patches/patches/invalidate_show-2.4.21-sles8sp3.patch [new file with mode: 0644]
lustre/kernel_patches/patches/invalidate_show-2.6.0.patch [deleted file]
lustre/kernel_patches/patches/iopen-2.4.18-2.patch
lustre/kernel_patches/patches/iopen-2.4.18.patch
lustre/kernel_patches/patches/iopen-2.4.19-suse.patch
lustre/kernel_patches/patches/iopen-2.4.21-sles8sp3.patch [new file with mode: 0644]
lustre/kernel_patches/patches/iopen-2.5.73.patch [deleted file]
lustre/kernel_patches/patches/iopen-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/iopen-2.6-vanilla.patch [moved from lustre/kernel_patches/patches/iopen-2.6.3-mm4.patch with 77% similarity]
lustre/kernel_patches/patches/iopen-2.6.0-test6.patch [deleted file]
lustre/kernel_patches/patches/iopen-2.6.0.patch [deleted file]
lustre/kernel_patches/patches/iopen-misc-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/kernel_text_address-2.4.21-sles8sp3.patch [new file with mode: 0644]
lustre/kernel_patches/patches/kernel_text_address-2.6.0.patch [deleted file]
lustre/kernel_patches/patches/kernel_text_address-2.6.3.patch [deleted file]
lustre/kernel_patches/patches/kexec-2.6.0-full.patch [deleted file]
lustre/kernel_patches/patches/kexec-2.6.0-test6-full.patch [deleted file]
lustre/kernel_patches/patches/linux-2.4.19-pre1-xattr-0.8.54.patch
lustre/kernel_patches/patches/linux-2.4.19-xattr-0.8.54-suse.patch
lustre/kernel_patches/patches/linux-2.4.20-tmpfs-iopen.patch [deleted file]
lustre/kernel_patches/patches/linux-2.4.20-tmpfs-xattr.patch [deleted file]
lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-chaos.patch
lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-hp.patch
lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54.patch
lustre/kernel_patches/patches/linux-2.4.21-xattr-0.8.54-chaos.patch
lustre/kernel_patches/patches/linux-2.4.21-xattr-0.8.54-suse.patch
lustre/kernel_patches/patches/linux-2.4.22-xattr-0.8.54.patch
lustre/kernel_patches/patches/linux-2.4.24-xattr-0.8.54.patch
lustre/kernel_patches/patches/linux-2.6.3-CITI_NFS4_ALL.patch [deleted file]
lustre/kernel_patches/patches/linux-2.6.3-nfs-intent.patch [deleted file]
lustre/kernel_patches/patches/lkcd-cvs-2.6.0-test6.patch [deleted file]
lustre/kernel_patches/patches/lkcd-kernel-changes-2.6.0-test6.patch [deleted file]
lustre/kernel_patches/patches/lustre_version.patch
lustre/kernel_patches/patches/mkdep-revert-rh-2.4.patch [new file with mode: 0644]
lustre/kernel_patches/patches/nfs-cifs-intent-2.6-suse.patch [moved from lustre/kernel_patches/patches/fs-intent-2.6.3-mm4.patch with 77% similarity]
lustre/kernel_patches/patches/nfs-cifs-intent-2.6.3-suse.patch [deleted file]
lustre/kernel_patches/patches/qla2xxx-v8.00.00b1-2.5.73.patch [deleted file]
lustre/kernel_patches/patches/removepage-2.6-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/removepage-2.6.0.patch [deleted file]
lustre/kernel_patches/patches/removepage-vanilla-2.6.5.patch [new file with mode: 0644]
lustre/kernel_patches/patches/revalide-special-oops-2.6.4.suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/smfs-export-symbol.patch [new file with mode: 0644]
lustre/kernel_patches/patches/tcp-zero-copy-2.4.21-sles8sp3.patch [new file with mode: 0644]
lustre/kernel_patches/patches/uml-2.6.0-fix.patch [deleted file]
lustre/kernel_patches/patches/uml-fix-2.6.3.patch [deleted file]
lustre/kernel_patches/patches/uml-patch-2.4.24-1.patch [moved from lustre/kernel_patches/patches/uml-patch-2.4.23-1.patch with 98% similarity]
lustre/kernel_patches/patches/uml-patch-2.6.0-1-fix1.patch [deleted file]
lustre/kernel_patches/patches/uml-patch-2.6.0-1.patch [deleted file]
lustre/kernel_patches/patches/uml-patch-2.6.0-test5.patch [deleted file]
lustre/kernel_patches/patches/uml-patch-2.6.3-rc2-1.patch [deleted file]
lustre/kernel_patches/patches/vfs_intent-2.4.18-18-chaos65.patch
lustre/kernel_patches/patches/vfs_intent-2.4.19-pre1.patch
lustre/kernel_patches/patches/vfs_intent-2.4.19-suse.patch
lustre/kernel_patches/patches/vfs_intent-2.4.20-hp.patch
lustre/kernel_patches/patches/vfs_intent-2.4.20-rh.patch
lustre/kernel_patches/patches/vfs_intent-2.4.20-vanilla.patch
lustre/kernel_patches/patches/vfs_intent-2.4.21-chaos.patch
lustre/kernel_patches/patches/vfs_intent-2.4.21-sles8sp3.patch [new file with mode: 0644]
lustre/kernel_patches/patches/vfs_intent-2.4.21-suse2.patch
lustre/kernel_patches/patches/vfs_intent-2.4.22-rh.patch
lustre/kernel_patches/patches/vfs_intent-2.6-suse.patch [moved from lustre/kernel_patches/patches/vfs_intent-2.6.3.patch with 81% similarity]
lustre/kernel_patches/patches/vfs_intent-2.6.3-suse.patch [deleted file]
lustre/kernel_patches/patches/vfs_intent_2.6.0-test1.patch [deleted file]
lustre/kernel_patches/patches/vfs_intent_2.6.0-test6.patch [deleted file]
lustre/kernel_patches/patches/vfs_intent_2.6.0.patch [deleted file]
lustre/kernel_patches/patches/vfs_mntcwd_2.5.72_rev1.patch [deleted file]
lustre/kernel_patches/patches/vfs_nointent-2.6-suse.patch [moved from lustre/kernel_patches/patches/vfs_nointent_2.6.3-suse.patch with 76% similarity]
lustre/kernel_patches/patches/vfs_nointent-2.6.3-mm4.patch [deleted file]
lustre/kernel_patches/patches/vfs_nointent_2.6.0-test1.patch [deleted file]
lustre/kernel_patches/patches/vfs_nointent_2.6.0-test6.patch [deleted file]
lustre/kernel_patches/patches/vfs_nointent_2.6.0-uml1.patch [deleted file]
lustre/kernel_patches/patches/vfs_races-2.6-suse.patch [moved from lustre/kernel_patches/patches/vfs_races_2.5.72_rev1.patch with 100% similarity]
lustre/kernel_patches/patches/xattr-0.8.54-2.4.22-rh.patch
lustre/kernel_patches/series/2.6-suse.series [new file with mode: 0644]
lustre/kernel_patches/series/2.6.3-mm4 [deleted file]
lustre/kernel_patches/series/chaos-2.4.18
lustre/kernel_patches/series/chaos-2.4.18-pdirops
lustre/kernel_patches/series/chaos-2.4.21
lustre/kernel_patches/series/kgdb_2.6.0 [deleted file]
lustre/kernel_patches/series/kgdb_2.6.0_test1 [deleted file]
lustre/kernel_patches/series/kgdb_2.6.0_test6 [deleted file]
lustre/kernel_patches/series/ldiskfs-2.6-suse.series [new file with mode: 0644]
lustre/kernel_patches/series/ldiskfs-2.6.6-vanilla.series [new file with mode: 0644]
lustre/kernel_patches/series/rh-2.4.20
lustre/kernel_patches/series/smfs-2.4.20 [new file with mode: 0644]
lustre/kernel_patches/series/smfs-2.4.20-rh [new file with mode: 0644]
lustre/kernel_patches/series/smfs-2.4.24 [new file with mode: 0644]
lustre/kernel_patches/series/suse-2.4.19
lustre/kernel_patches/series/suse-2.4.21-2
lustre/kernel_patches/series/suse-2.6.3 [deleted file]
lustre/kernel_patches/series/suse-sles8sp3-2.4.21 [new file with mode: 0644]
lustre/kernel_patches/series/uml_2.6.0 [deleted file]
lustre/kernel_patches/series/uml_2.6.0_test3 [deleted file]
lustre/kernel_patches/series/vanilla-2.4.20
lustre/kernel_patches/series/vanilla-2.4.24
lustre/kernel_patches/series/vanilla-2.6.3-nfs4 [deleted file]
lustre/kernel_patches/series/vanilla-2.6.6 [new file with mode: 0644]
lustre/kernel_patches/targets/2.6-suse.target [new file with mode: 0644]
lustre/kernel_patches/targets/chaos-2.4.18.target [new file with mode: 0644]
lustre/kernel_patches/targets/rh-2.4.target
lustre/kernel_patches/targets/suse-2.4.21-2.target [new file with mode: 0644]
lustre/kernel_patches/which_patch
lustre/ldiskfs/.cvsignore [new file with mode: 0644]
lustre/ldiskfs/Makefile.in [new file with mode: 0644]
lustre/ldiskfs/autoMakefile.am [new file with mode: 0644]
lustre/ldlm/.cvsignore
lustre/ldlm/Makefile.am
lustre/ldlm/Makefile.mk
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/liblustre/Makefile.am
lustre/liblustre/dir.c
lustre/liblustre/file.c
lustre/liblustre/genlib.sh
lustre/liblustre/llite_lib.c
lustre/liblustre/namei.c
lustre/liblustre/rw.c
lustre/liblustre/super.c
lustre/liblustre/tests/.cvsignore
lustre/liblustre/tests/Makefile.am
lustre/liblustre/tests/echo_test.c
lustre/liblustre/tests/recovery_small.c
lustre/liblustre/tests/replay_single.c
lustre/liblustre/tests/sanity.c
lustre/liblustre/tests/test_common.c
lustre/liblustre/tests/test_common.h
lustre/llite/.cvsignore
lustre/llite/Makefile.am [deleted file]
lustre/llite/Makefile.in [new file with mode: 0644]
lustre/llite/Makefile.mk
lustre/llite/autoMakefile.am [new file with mode: 0644]
lustre/llite/dcache.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_close.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_nfs.c
lustre/llite/lproc_llite.c
lustre/llite/namei.c
lustre/llite/rw.c
lustre/llite/rw24.c
lustre/llite/rw26.c
lustre/llite/special.c [new file with mode: 0644]
lustre/llite/super.c
lustre/llite/super25.c
lustre/llite/symlink.c
lustre/lmv/Makefile.in [new file with mode: 0644]
lustre/lmv/Makefile.mk [new file with mode: 0644]
lustre/lmv/autoMakefile.am [moved from lustre/lmv/Makefile.am with 55% similarity]
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_obd.c
lustre/lmv/lmv_objmgr.c
lustre/lmv/lproc_lmv.c [new file with mode: 0644]
lustre/lov/.cvsignore
lustre/lov/Makefile.in [new file with mode: 0644]
lustre/lov/autoMakefile.am [moved from lustre/lov/Makefile.am with 56% similarity]
lustre/lov/lov_internal.h
lustre/lov/lov_log.c
lustre/lov/lov_obd.c
lustre/lov/lov_pack.c
lustre/lov/lproc_lov.c
lustre/lvfs/.cvsignore
lustre/lvfs/Makefile.am [deleted file]
lustre/lvfs/Makefile.in [new file with mode: 0644]
lustre/lvfs/Makefile.mk
lustre/lvfs/autoMakefile.am [new file with mode: 0644]
lustre/lvfs/fsfilt_ext3.c
lustre/lvfs/fsfilt_reiserfs.c
lustre/lvfs/fsfilt_smfs.c [new file with mode: 0644]
lustre/lvfs/llog.c [moved from lustre/obdclass/llog.c with 64% similarity]
lustre/lvfs/llog_cat.c [moved from lustre/obdclass/llog_cat.c with 57% similarity]
lustre/lvfs/llog_lvfs.c [new file with mode: 0644]
lustre/lvfs/lvfs_common.c
lustre/lvfs/lvfs_internal.h
lustre/lvfs/lvfs_linux.c
lustre/lvfs/lvfs_reint.c [new file with mode: 0644]
lustre/lvfs/lvfs_undo.c [new file with mode: 0644]
lustre/lvfs/lvfs_userfs.c
lustre/mdc/.cvsignore
lustre/mdc/Makefile.in [new file with mode: 0644]
lustre/mdc/autoMakefile.am [moved from lustre/mdc/Makefile.am with 57% similarity]
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_reint.c
lustre/mdc/mdc_request.c
lustre/mds/.cvsignore
lustre/mds/Makefile.am [deleted file]
lustre/mds/Makefile.in [new file with mode: 0644]
lustre/mds/Makefile.mk
lustre/mds/autoMakefile.am [moved from lustre/ost/Makefile.am with 54% similarity]
lustre/mds/handler.c
lustre/mds/lproc_mds.c
lustre/mds/mds_fs.c
lustre/mds/mds_internal.h
lustre/mds/mds_lib.c
lustre/mds/mds_lmv.c
lustre/mds/mds_log.c
lustre/mds/mds_lov.c
lustre/mds/mds_open.c
lustre/mds/mds_reint.c
lustre/mds/mds_unlink_open.c
lustre/mgmt/.cvsignore
lustre/mgmt/Makefile.in [new file with mode: 0644]
lustre/mgmt/autoMakefile.am [new file with mode: 0644]
lustre/mgmt/mgmt_cli.c
lustre/mgmt/mgmt_svc.c
lustre/missing [deleted file]
lustre/mkinstalldirs [deleted file]
lustre/obdclass/.cvsignore
lustre/obdclass/Makefile.am [deleted file]
lustre/obdclass/Makefile.in [new file with mode: 0644]
lustre/obdclass/Makefile.mk
lustre/obdclass/autoMakefile.am [new file with mode: 0644]
lustre/obdclass/class_obd.c
lustre/obdclass/genops.c
lustre/obdclass/llog_internal.h [deleted file]
lustre/obdclass/llog_ioctl.c
lustre/obdclass/llog_lvfs.c [deleted file]
lustre/obdclass/llog_obd.c
lustre/obdclass/llog_test.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lustre_peer.c
lustre/obdclass/obd_config.c
lustre/obdclass/simple.c
lustre/obdclass/sysctl.c
lustre/obdecho/.cvsignore
lustre/obdecho/Makefile.in [new file with mode: 0644]
lustre/obdecho/autoMakefile.am [moved from lustre/obdecho/Makefile.am with 54% similarity]
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/obdfilter/.cvsignore
lustre/obdfilter/Makefile.am [deleted file]
lustre/obdfilter/Makefile.in [new file with mode: 0644]
lustre/obdfilter/autoMakefile.am [new file with mode: 0644]
lustre/obdfilter/filter.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/filter_io.c
lustre/obdfilter/filter_io_24.c
lustre/obdfilter/filter_io_26.c
lustre/obdfilter/filter_log.c
lustre/obdfilter/filter_lvb.c
lustre/obdfilter/lproc_obdfilter.c
lustre/osc/.cvsignore
lustre/osc/Makefile.in [new file with mode: 0644]
lustre/osc/autoMakefile.am [moved from lustre/osc/Makefile.am with 58% similarity]
lustre/osc/lproc_osc.c
lustre/osc/osc_create.c
lustre/osc/osc_request.c
lustre/ost/.cvsignore
lustre/ost/Makefile.in [new file with mode: 0644]
lustre/ost/autoMakefile.am [moved from lustre/mgmt/Makefile.am with 57% similarity]
lustre/ost/ost_handler.c
lustre/portals/.cvsignore
lustre/portals/Makefile.am [deleted file]
lustre/portals/Makefile.in [new file with mode: 0644]
lustre/portals/Rules.linux [deleted file]
lustre/portals/archdep.m4
lustre/portals/autoMakefile.am [new file with mode: 0644]
lustre/portals/build.m4
lustre/portals/include/linux/kp30.h
lustre/portals/include/linux/kpr.h
lustre/portals/include/linux/libcfs.h
lustre/portals/include/linux/portals_compat25.h
lustre/portals/include/portals/Makefile.am [deleted file]
lustre/portals/include/portals/api-support.h
lustre/portals/include/portals/api.h
lustre/portals/include/portals/arg-blocks.h
lustre/portals/include/portals/errno.h
lustre/portals/include/portals/lib-dispatch.h
lustre/portals/include/portals/lib-p30.h
lustre/portals/include/portals/lib-types.h
lustre/portals/include/portals/nal.h
lustre/portals/include/portals/nalids.h
lustre/portals/include/portals/p30.h
lustre/portals/include/portals/ptlctl.h
lustre/portals/include/portals/types.h
lustre/portals/knals/.cvsignore
lustre/portals/knals/Makefile.in [new file with mode: 0644]
lustre/portals/knals/autoMakefile.am [moved from lustre/portals/include/Makefile.am with 66% similarity]
lustre/portals/knals/gmnal/.cvsignore
lustre/portals/knals/gmnal/Makefile.am [deleted file]
lustre/portals/knals/gmnal/Makefile.in [new file with mode: 0644]
lustre/portals/knals/gmnal/autoMakefile.am [new file with mode: 0644]
lustre/portals/knals/gmnal/gmnal.h
lustre/portals/knals/gmnal/gmnal_api.c
lustre/portals/knals/gmnal/gmnal_module.c
lustre/portals/knals/ibnal/.cvsignore
lustre/portals/knals/ibnal/Makefile.am [deleted file]
lustre/portals/knals/ibnal/Makefile.in [new file with mode: 0644]
lustre/portals/knals/ibnal/autoMakefile.am [new file with mode: 0644]
lustre/portals/knals/ibnal/ibnal.c
lustre/portals/knals/qswnal/.cvsignore
lustre/portals/knals/qswnal/Makefile.am [deleted file]
lustre/portals/knals/qswnal/Makefile.in [new file with mode: 0644]
lustre/portals/knals/qswnal/autoMakefile.am [new file with mode: 0644]
lustre/portals/knals/qswnal/qswnal.c
lustre/portals/knals/qswnal/qswnal.h
lustre/portals/knals/qswnal/qswnal_cb.c
lustre/portals/knals/scimacnal/.cvsignore
lustre/portals/knals/scimacnal/Makefile.am [deleted file]
lustre/portals/knals/scimacnal/Makefile.in [new file with mode: 0644]
lustre/portals/knals/scimacnal/autoMakefile.am [new file with mode: 0644]
lustre/portals/knals/scimacnal/scimacnal.c
lustre/portals/knals/socknal/.cvsignore
lustre/portals/knals/socknal/Makefile.am [deleted file]
lustre/portals/knals/socknal/Makefile.in [new file with mode: 0644]
lustre/portals/knals/socknal/autoMakefile.am [new file with mode: 0644]
lustre/portals/knals/socknal/socknal.c
lustre/portals/knals/socknal/socknal.h
lustre/portals/knals/socknal/socknal_cb.c
lustre/portals/libcfs/.cvsignore
lustre/portals/libcfs/Makefile.am [deleted file]
lustre/portals/libcfs/Makefile.in [new file with mode: 0644]
lustre/portals/libcfs/autoMakefile.am [new file with mode: 0644]
lustre/portals/libcfs/debug.c
lustre/portals/libcfs/module.c
lustre/portals/libcfs/proc.c
lustre/portals/portals/.cvsignore
lustre/portals/portals/Makefile.in [new file with mode: 0644]
lustre/portals/portals/api-eq.c
lustre/portals/portals/api-errno.c
lustre/portals/portals/api-init.c
lustre/portals/portals/api-me.c
lustre/portals/portals/api-ni.c
lustre/portals/portals/api-wrap.c
lustre/portals/portals/autoMakefile.am [moved from lustre/portals/portals/Makefile.am with 57% similarity]
lustre/portals/portals/lib-dispatch.c
lustre/portals/portals/lib-init.c
lustre/portals/portals/lib-md.c
lustre/portals/portals/lib-me.c
lustre/portals/portals/lib-msg.c
lustre/portals/portals/lib-ni.c
lustre/portals/portals/module.c
lustre/portals/router/.cvsignore
lustre/portals/router/Makefile.am [deleted file]
lustre/portals/router/Makefile.in [new file with mode: 0644]
lustre/portals/router/autoMakefile.am [new file with mode: 0644]
lustre/portals/router/router.c
lustre/portals/router/router.h
lustre/portals/tests/.cvsignore
lustre/portals/tests/Makefile.am [deleted file]
lustre/portals/tests/Makefile.in [new file with mode: 0644]
lustre/portals/tests/autoMakefile.am [new file with mode: 0644]
lustre/portals/tests/ping_cli.c
lustre/portals/tests/ping_srv.c
lustre/portals/tests/sping_cli.c
lustre/portals/tests/sping_srv.c
lustre/portals/unals/Makefile.am
lustre/portals/unals/bridge.h
lustre/portals/unals/connection.c
lustre/portals/unals/procapi.c
lustre/portals/unals/procbridge.h
lustre/portals/unals/proclib.c
lustre/portals/utils/Makefile.am
lustre/portals/utils/acceptor.c
lustre/portals/utils/debug.c
lustre/portals/utils/gmnalnid.c
lustre/portals/utils/l_ioctl.c
lustre/portals/utils/parser.c
lustre/portals/utils/parser.h
lustre/portals/utils/portals.c
lustre/portals/utils/wirecheck.c
lustre/ptlbd/.cvsignore
lustre/ptlbd/Makefile.in [new file with mode: 0644]
lustre/ptlbd/autoMakefile.am [moved from lustre/ptlbd/Makefile.am with 50% similarity]
lustre/ptlbd/blk.c
lustre/ptlbd/client.c
lustre/ptlbd/server.c
lustre/ptlrpc/.cvsignore
lustre/ptlrpc/Makefile.in [new file with mode: 0644]
lustre/ptlrpc/Makefile.mk
lustre/ptlrpc/autoMakefile.am [moved from lustre/ptlrpc/Makefile.am with 72% similarity]
lustre/ptlrpc/client.c
lustre/ptlrpc/connection.c
lustre/ptlrpc/events.c
lustre/ptlrpc/import.c
lustre/ptlrpc/llog_client.c
lustre/ptlrpc/llog_net.c
lustre/ptlrpc/llog_server.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/pers.c
lustre/ptlrpc/pinger.c
lustre/ptlrpc/ptlrpc_internal.h
lustre/ptlrpc/ptlrpc_module.c
lustre/ptlrpc/ptlrpcd.c
lustre/ptlrpc/recov_thread.c
lustre/ptlrpc/recover.c
lustre/ptlrpc/service.c
lustre/scripts/.cvsignore
lustre/scripts/Makefile.am
lustre/scripts/collect-stats.sh [new file with mode: 0644]
lustre/scripts/graph-rpcs.sh [new file with mode: 0755]
lustre/scripts/land1.sh
lustre/scripts/lbuild
lustre/scripts/lmake
lustre/scripts/lustre-kernel-2.4.spec.in
lustre/scripts/lustre.spec.in
lustre/scripts/merge1.sh
lustre/scripts/version_tag.pl.in [moved from lustre/scripts/version_tag.pl with 94% similarity]
lustre/smfs/.cvsignore
lustre/smfs/Makefile.am [deleted file]
lustre/smfs/Makefile.in [new file with mode: 0644]
lustre/smfs/autoMakefile.am [moved from lustre/portals/include/linux/Makefile.am with 54% similarity]
lustre/smfs/cache.c
lustre/smfs/cache_space.c [new file with mode: 0644]
lustre/smfs/dir.c
lustre/smfs/file.c
lustre/smfs/inode.c
lustre/smfs/ioctl.c [new file with mode: 0644]
lustre/smfs/journal.c
lustre/smfs/journal_ext3.c [deleted file]
lustre/smfs/kml.c
lustre/smfs/kml_idl.h [deleted file]
lustre/smfs/mds_kml.c [new file with mode: 0644]
lustre/smfs/options.c
lustre/smfs/ost_kml.c [new file with mode: 0644]
lustre/smfs/reint.c [deleted file]
lustre/smfs/sm_fs.c
lustre/smfs/smfs_internal.h
lustre/smfs/smfs_llog.c
lustre/smfs/smfs_support.h [deleted file]
lustre/smfs/super.c
lustre/smfs/symlink.c
lustre/smfs/sysctl.c
lustre/snapfs/.cvsignore
lustre/snapfs/Makefile.am [deleted file]
lustre/snapfs/Makefile.in [new file with mode: 0644]
lustre/snapfs/autoMakefile.am [new file with mode: 0644]
lustre/snapfs/options.c
lustre/snapfs/utils/Makefile.am
lustre/snapfs/utils/parser.c
lustre/tests/.RC_CURRENT.tag
lustre/tests/.cvsignore
lustre/tests/Makefile.am
lustre/tests/acceptance-small.sh
lustre/tests/ba-echo.sh [deleted file]
lustre/tests/ba-mount.sh [deleted file]
lustre/tests/cfg/insanity-adev.sh
lustre/tests/cfg/insanity-local.sh
lustre/tests/cfg/insanity-mdev.sh
lustre/tests/cfg/local.sh
lustre/tests/cfg/mdev.sh
lustre/tests/cmknod.c
lustre/tests/cmobd_cobd_cleanup.sh [new file with mode: 0644]
lustre/tests/cmobd_cobd_setup.sh [new file with mode: 0644]
lustre/tests/cmobd_setup.sh [new file with mode: 0644]
lustre/tests/cobd_test.sh [new file with mode: 0644]
lustre/tests/conf-sanity.sh
lustre/tests/copy_attr.c [new file with mode: 0644]
lustre/tests/createdestroy.c
lustre/tests/createmany.c
lustre/tests/directio.c
lustre/tests/echo.sh
lustre/tests/fsx.c
lustre/tests/insanity.sh
lustre/tests/lfsck_config.sh [new file with mode: 0755]
lustre/tests/lfscktest.sh [new file with mode: 0755]
lustre/tests/lfscktest_config.sh [new file with mode: 0644]
lustre/tests/ll_cobd_cleanup.sh [new file with mode: 0644]
lustre/tests/ll_cobd_setup.sh [new file with mode: 0644]
lustre/tests/ll_dirstripe_verify.c [new file with mode: 0644]
lustre/tests/llmount.sh
lustre/tests/llmountcleanup.sh
lustre/tests/local.sh
lustre/tests/lov.sh
lustre/tests/lp_utils.c [new file with mode: 0644]
lustre/tests/lp_utils.h [new file with mode: 0644]
lustre/tests/lsmfs.sh [new file with mode: 0755]
lustre/tests/mcr-routed-config.sh
lustre/tests/mcrlov.sh
lustre/tests/mkdirmany.c
lustre/tests/mount2.sh [deleted file]
lustre/tests/mount2fs.sh
lustre/tests/mount2lov.sh [deleted file]
lustre/tests/multiop.c
lustre/tests/munlink.c
lustre/tests/oos.sh
lustre/tests/oos2.sh
lustre/tests/open_delay.c
lustre/tests/openclose.c
lustre/tests/openfile.c
lustre/tests/openfilleddirunlink.c [new file with mode: 0644]
lustre/tests/parallel_grouplock.c [new file with mode: 0644]
lustre/tests/recovery-cleanup.sh
lustre/tests/recovery-small-upcall.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single.sh
lustre/tests/run-llog.sh
lustre/tests/run_lfscktest.sh [new file with mode: 0755]
lustre/tests/runas.c
lustre/tests/runregression-brw.sh
lustre/tests/runregression-mds.sh
lustre/tests/runregression-net.sh
lustre/tests/runtests
lustre/tests/sanity.sh
lustre/tests/sanityN.sh
lustre/tests/smfs.sh [new file with mode: 0755]
lustre/tests/socketserver
lustre/tests/stat.c
lustre/tests/stat_fs.h
lustre/tests/statmany.c
lustre/tests/test-framework.sh
lustre/tests/uml.sh
lustre/tests/uml_cobd.sh [new file with mode: 0644]
lustre/tests/write_append_truncate.c
lustre/tests/write_disjoint.c
lustre/utils/Lustre/lustredb.py
lustre/utils/Makefile.am
lustre/utils/lconf
lustre/utils/lctl.c
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/llmount.c
lustre/utils/lmc
lustre/utils/lustre_cfg.c
lustre/utils/obd.c
lustre/utils/obdctl.h
lustre/utils/parser.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

diff --git a/ldiskfs/kernel_patches/patches/export-ext3-2.6-suse.patch b/ldiskfs/kernel_patches/patches/export-ext3-2.6-suse.patch
new file mode 100644 (file)
index 0000000..638b4bf
--- /dev/null
@@ -0,0 +1,33 @@
+Index: linux-stage/fs/ext3/super.c
+===================================================================
+--- linux-stage.orig/fs/ext3/super.c   2004-04-02 16:40:18.000000000 -0500
++++ linux-stage/fs/ext3/super.c        2004-04-02 16:40:18.000000000 -0500
+@@ -115,6 +115,8 @@
+               handle->h_err = err;
+ }
++EXPORT_SYMBOL(ext3_journal_abort_handle);
++
+ static char error_buf[1024];
+ /* Deal with the reporting of failure conditions on a filesystem such as
+@@ -1774,6 +1776,8 @@
+       return ret;
+ }
++EXPORT_SYMBOL(ext3_force_commit);
++
+ /*
+  * Ext3 always journals updates to the superblock itself, so we don't
+  * have to propagate any other updates to the superblock on disk at this
+@@ -2088,6 +2092,10 @@
+                         unsigned long *blocks, int *created, int create);
+ EXPORT_SYMBOL(ext3_map_inode_page);
++EXPORT_SYMBOL(ext3_xattr_get);
++EXPORT_SYMBOL(ext3_xattr_set_handle);
++EXPORT_SYMBOL(ext3_bread);
++
+ MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
+ MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
+ MODULE_LICENSE("GPL");
diff --git a/ldiskfs/kernel_patches/patches/export_symbols-ext3-2.6-suse.patch b/ldiskfs/kernel_patches/patches/export_symbols-ext3-2.6-suse.patch
new file mode 100644 (file)
index 0000000..2327263
--- /dev/null
@@ -0,0 +1,17 @@
+Index: linux-2.6.0/include/linux/ext3_fs_sb.h
+===================================================================
+--- linux-2.6.0.orig/include/linux/ext3_fs_sb.h        2003-06-24 18:05:26.000000000 +0400
++++ linux-2.6.0/include/linux/ext3_fs_sb.h     2003-12-31 01:09:26.000000000 +0300
+@@ -19,9 +19,12 @@
+ #ifdef __KERNEL__
+ #include <linux/timer.h>
+ #include <linux/wait.h>
++#ifndef EXT_INCLUDE
++#define EXT_INCLUDE
+ #include <linux/blockgroup_lock.h>
+ #include <linux/percpu_counter.h>
+ #endif
++#endif
+ /*
+  * third extended-fs super-block data in memory
@@ -189,7 +189,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +      /* try to find attribute in inode body */
 +      err = ext3_xattr_ibody_get(inode, name_index, name,
 +                                      buffer, buffer_size);
-+      if (err < 0) 
++      if (err < 0)
 +              /* search was unsuccessful, try to find EA in dedicated block */
 +              err = ext3_xattr_block_get(inode, name_index, name,
 +                              buffer, buffer_size);
@@ -252,7 +252,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +              return 0;
 +
 +      ret = ext3_get_inode_loc(inode, &iloc);
-+      if (ret) 
++      if (ret)
 +              return ret;
 +      raw_inode = ext3_raw_inode(&iloc);
 +
@@ -334,7 +334,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +      /* get list of attributes stored in inode body */
 +      error = ext3_xattr_ibody_list(inode, buffer, buffer_size);
 +      if (error < 0) {
-+              /* some error occured while collecting 
++              /* some error occured while collecting
 +               * attributes in inode body */
 +              size = 0;
 +              goto cleanup;
@@ -347,12 +347,12 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +              if (buffer_size <= 0) {
 +                      buffer = NULL;
 +                      buffer_size = 0;
-+              } else 
++              } else
 +                      buffer += error;
 +      }
 +
 +      error = ext3_xattr_block_list(inode, buffer, buffer_size);
-+      if (error < 0) 
++      if (error < 0)
 +              /* listing was successful, so we return len */
 +              size = 0;
 +
@@ -374,7 +374,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 + * NOTE: free space includes space our attribute hold
 + */
 +int
-+ext3_xattr_ibody_find(struct inode *inode, int name_index, 
++ext3_xattr_ibody_find(struct inode *inode, int name_index,
 +              const char *name, struct ext3_xattr_entry *rentry, int *free)
 +{
 +      struct ext3_xattr_entry *last;
@@ -389,7 +389,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +              return ret;
 +
 +      err = ext3_get_inode_loc(inode, &iloc);
-+      if (err) 
++      if (err)
 +              return -EIO;
 +      raw_inode = ext3_raw_inode(&iloc);
 +
@@ -498,7 +498,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +
 +/*
 + * ext3_xattr_inode_set()
-+ * 
++ *
 + * this routine add/remove/replace attribute in inode body
 + */
 +int
@@ -558,7 +558,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +              }
 +              if (name_index == last->e_name_index &&
 +                      name_len == last->e_name_len &&
-+                      !memcmp(name, last->e_name, name_len)) 
++                      !memcmp(name, last->e_name, name_len))
 +                      here = last;
 +              else {
 +                      /* we calculate all but our attribute
@@ -595,9 +595,9 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +              e = (struct ext3_xattr_entry *) start;
 +              while (!IS_LAST_ENTRY(e)) {
 +                      struct ext3_xattr_entry *next = EXT3_XATTR_NEXT(e);
-+                      int offs = le16_to_cpu(e->e_value_offs); 
-+                      if (offs < border) 
-+                              e->e_value_offs = 
++                      int offs = le16_to_cpu(e->e_value_offs);
++                      if (offs < border)
++                              e->e_value_offs =
 +                                      cpu_to_le16(offs + size);
 +                      e = next;
 +              }
@@ -741,7 +741,7 @@ Index: linux-2.6.0/fs/ext3/xattr.c
 +
 +/*
 + * ext3_xattr_block_set()
-+ * 
++ *
 + * this routine add/remove/replace attribute in EA block
 + */
 +int
@@ -815,7 +815,7 @@ Index: linux-2.6.0/include/linux/ext3_fs_i.h
         */
        loff_t  i_disksize;
  
-+      /* on-disk additional lenght */
++      /* on-disk additional length */
 +      __u16 i_extra_isize;
 +
        /*
diff --git a/ldiskfs/kernel_patches/patches/ext3-include-fixes-2.6-suse.patch b/ldiskfs/kernel_patches/patches/ext3-include-fixes-2.6-suse.patch
new file mode 100644 (file)
index 0000000..28e3587
--- /dev/null
@@ -0,0 +1,20 @@
+Index: linux-stage/include/linux/ext3_fs.h
+===================================================================
+--- linux-stage.orig/include/linux/ext3_fs.h   2004-04-02 16:43:37.000000000 -0500
++++ linux-stage/include/linux/ext3_fs.h        2004-04-02 16:43:37.000000000 -0500
+@@ -331,12 +331,13 @@
+ #define EXT3_MOUNT_IOPEN_NOPRIV              0x20000  /* Make iopen world-readable */
+ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
+-#ifndef _LINUX_EXT2_FS_H
++#ifndef clear_opt
+ #define clear_opt(o, opt)             o &= ~EXT3_MOUNT_##opt
+ #define set_opt(o, opt)                       o |= EXT3_MOUNT_##opt
+ #define test_opt(sb, opt)             (EXT3_SB(sb)->s_mount_opt & \
+                                        EXT3_MOUNT_##opt)
+-#else
++#endif
++#ifndef EXT2_MOUNT_NOLOAD
+ #define EXT2_MOUNT_NOLOAD             EXT3_MOUNT_NOLOAD
+ #define EXT2_MOUNT_ABORT              EXT3_MOUNT_ABORT
+ #define EXT2_MOUNT_DATA_FLAGS         EXT3_MOUNT_DATA_FLAGS
@@ -154,22 +154,6 @@ Index: uml-2.6.3/fs/ext3/namei.c
        err = PTR_ERR(inode);
        if (IS_ERR(inode))
                goto out_stop;
-Index: uml-2.6.3/include/linux/dcache.h
-===================================================================
---- uml-2.6.3.orig/include/linux/dcache.h      2004-02-21 00:19:14.365988600 +0800
-+++ uml-2.6.3/include/linux/dcache.h   2004-02-21 00:21:04.612228624 +0800
-@@ -25,6 +25,11 @@
- #define IS_ROOT(x) ((x) == (x)->d_parent)
-+struct dentry_params {
-+      unsigned long   p_inum;
-+      void            *p_ptr;
-+};
-+
- /*
-  * "quick string" -- eases parameter passing, but more importantly
-  * saves "metadata" about the string (ie length and the hash).
 Index: uml-2.6.3/include/linux/ext3_fs.h
 ===================================================================
 --- uml-2.6.3.orig/include/linux/ext3_fs.h     2004-01-09 14:59:44.000000000 +0800
diff --git a/ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch b/ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch
new file mode 100644 (file)
index 0000000..2133355
--- /dev/null
@@ -0,0 +1,475 @@
+ fs/ext3/inode.c                    |    3 
+ fs/ext3/iopen.c                    |  239 +++++++++++++++++++++++++++++++++++++
+ fs/ext3/iopen.h                    |   15 ++
+ fs/ext3/namei.c                    |   13 ++
+ fs/ext3/super.c                    |   17 ++
+ include/linux/ext3_fs.h            |    2 
+ 7 files changed, 304 insertions(+), 1 deletion(-)
+
+Index: linux-stage/fs/ext3/Makefile
+===================================================================
+--- linux-stage.orig/fs/ext3/Makefile  2004-05-07 16:00:16.000000000 -0400
++++ linux-stage/fs/ext3/Makefile       2004-05-07 16:00:17.000000000 -0400
+@@ -4,7 +4,7 @@
+ obj-$(CONFIG_EXT3_FS) += ext3.o
+-ext3-y        := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
++ext3-y        := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
+          ioctl.o namei.o super.o symlink.o hash.o
+ ext3-$(CONFIG_EXT3_FS_XATTR)   += xattr.o xattr_user.o xattr_trusted.o
+Index: linux-stage/fs/ext3/inode.c
+===================================================================
+--- linux-stage.orig/fs/ext3/inode.c   2004-05-07 16:00:16.000000000 -0400
++++ linux-stage/fs/ext3/inode.c        2004-05-07 17:21:59.000000000 -0400
+@@ -37,6 +37,7 @@
+ #include <linux/mpage.h>
+ #include <linux/uio.h>
+ #include "xattr.h"
++#include "iopen.h"
+ #include "acl.h"
+ /*
+@@ -2472,6 +2473,9 @@
+       ei->i_acl = EXT3_ACL_NOT_CACHED;
+       ei->i_default_acl = EXT3_ACL_NOT_CACHED;
+ #endif
++      if (ext3_iopen_get_inode(inode))
++              return;
++
+       if (ext3_get_inode_loc(inode, &iloc, 0))
+               goto bad_inode;
+       bh = iloc.bh;
+Index: linux-stage/fs/ext3/iopen.c
+===================================================================
+--- linux-stage.orig/fs/ext3/iopen.c   2004-05-07 16:00:17.000000000 -0400
++++ linux-stage/fs/ext3/iopen.c        2004-05-07 17:22:37.000000000 -0400
+@@ -0,0 +1,272 @@
++/*
++ * linux/fs/ext3/iopen.c
++ *
++ * Special support for open by inode number
++ *
++ * Copyright (C) 2001 by Theodore Ts'o (tytso@alum.mit.edu).
++ *
++ * This file may be redistributed under the terms of the GNU General
++ * Public License.
++ *
++ *
++ * Invariants:
++ *   - there is only ever a single DCACHE_NFSD_DISCONNECTED dentry alias
++ *     for an inode at one time.
++ *   - there are never both connected and DCACHE_NFSD_DISCONNECTED dentry
++ *     aliases on an inode at the same time.
++ *
++ * If we have any connected dentry aliases for an inode, use one of those
++ * in iopen_lookup().  Otherwise, we instantiate a single NFSD_DISCONNECTED
++ * dentry for this inode, which thereafter will be found by the dcache
++ * when looking up this inode number in __iopen__, so we don't return here
++ * until it is gone.
++ *
++ * If we get an inode via a regular name lookup, then we "rename" the
++ * NFSD_DISCONNECTED dentry to the proper name and parent.  This ensures
++ * existing users of the disconnected dentry will continue to use the same
++ * dentry as the connected users, and there will never be both kinds of
++ * dentry aliases at one time.
++ */
++
++#include <linux/sched.h>
++#include <linux/fs.h>
++#include <linux/ext3_jbd.h>
++#include <linux/jbd.h>
++#include <linux/ext3_fs.h>
++#include <linux/smp_lock.h>
++#include <linux/dcache.h>
++#include <linux/security.h>
++#include "iopen.h"
++
++#ifndef assert
++#define assert(test) J_ASSERT(test)
++#endif
++
++#define IOPEN_NAME_LEN        32
++
++/*
++ * This implements looking up an inode by number.
++ */
++static struct dentry *iopen_lookup(struct inode * dir, struct dentry *dentry,
++                                 struct nameidata *nd)
++{
++      struct inode *inode;
++      unsigned long ino;
++      struct list_head *lp;
++      struct dentry *alternate;
++      char buf[IOPEN_NAME_LEN];
++
++      if (dentry->d_name.len >= IOPEN_NAME_LEN)
++              return ERR_PTR(-ENAMETOOLONG);
++
++      memcpy(buf, dentry->d_name.name, dentry->d_name.len);
++      buf[dentry->d_name.len] = 0;
++
++      if (strcmp(buf, ".") == 0)
++              ino = dir->i_ino;
++      else if (strcmp(buf, "..") == 0)
++              ino = EXT3_ROOT_INO;
++      else
++              ino = simple_strtoul(buf, 0, 0);
++
++      if ((ino != EXT3_ROOT_INO &&
++           //ino != EXT3_ACL_IDX_INO &&
++           //ino != EXT3_ACL_DATA_INO &&
++           ino < EXT3_FIRST_INO(dir->i_sb)) ||
++          ino > le32_to_cpu(EXT3_SB(dir->i_sb)->s_es->s_inodes_count))
++              return ERR_PTR(-ENOENT);
++
++      inode = iget(dir->i_sb, ino);
++      if (!inode)
++              return ERR_PTR(-EACCES);
++      if (is_bad_inode(inode)) {
++              iput(inode);
++              return ERR_PTR(-ENOENT);
++      }
++
++      assert(list_empty(&dentry->d_alias));           /* d_instantiate */
++      assert(d_unhashed(dentry));             /* d_rehash */
++
++      /* preferrably return a connected dentry */
++      spin_lock(&dcache_lock);
++      list_for_each(lp, &inode->i_dentry) {
++              alternate = list_entry(lp, struct dentry, d_alias);
++              assert(!(alternate->d_flags & DCACHE_DISCONNECTED));
++      }
++
++      if (!list_empty(&inode->i_dentry)) {
++              alternate = list_entry(inode->i_dentry.next,
++                                     struct dentry, d_alias);
++              dget_locked(alternate);
++              alternate->d_vfs_flags |= DCACHE_REFERENCED;
++              iput(inode);
++              spin_unlock(&dcache_lock);
++              return alternate;
++      }
++      dentry->d_flags |= DCACHE_DISCONNECTED;
++
++      /* d_add(), but don't drop dcache_lock before adding dentry to inode */
++      list_add(&dentry->d_alias, &inode->i_dentry);   /* d_instantiate */
++      dentry->d_inode = inode;
++
++      __d_rehash(dentry, 0);                          /* d_rehash */
++      spin_unlock(&dcache_lock);
++
++      return NULL;
++}
++
++#define do_switch(x,y) do { \
++      __typeof__ (x) __tmp = x; \
++      x = y; y = __tmp; } while (0)
++
++static inline void switch_names(struct dentry *dentry, struct dentry *target)
++{
++      const unsigned char *old_name, *new_name;
++
++      memcpy(dentry->d_iname, target->d_iname, DNAME_INLINE_LEN);
++      old_name = target->d_name.name;
++      new_name = dentry->d_name.name;
++      if (old_name == target->d_iname)
++              old_name = dentry->d_iname;
++      if (new_name == dentry->d_iname)
++              new_name = target->d_iname;
++      target->d_name.name = new_name;
++      dentry->d_name.name = old_name;
++}
++
++/* This function is spliced into ext3_lookup and does the move of a
++ * disconnected dentry (if it exists) to a connected dentry.
++ */
++struct dentry *iopen_connect_dentry(struct dentry *dentry, struct inode *inode,
++                                  int rehash)
++{
++      struct dentry *tmp, *goal = NULL;
++      struct list_head *lp;
++
++      /* verify this dentry is really new */
++      assert(dentry->d_inode == NULL);
++      assert(list_empty(&dentry->d_alias));           /* d_instantiate */
++      if (rehash)
++              assert(d_unhashed(dentry));     /* d_rehash */
++      assert(list_empty(&dentry->d_subdirs));
++
++      spin_lock(&dcache_lock);
++      if (!inode)
++              goto do_rehash;
++
++      /* preferrably return a connected dentry */
++      list_for_each(lp, &inode->i_dentry) {
++              tmp = list_entry(lp, struct dentry, d_alias);
++              if (tmp->d_flags & DCACHE_DISCONNECTED) {
++                      assert(tmp->d_alias.next == &inode->i_dentry);
++                      assert(tmp->d_alias.prev == &inode->i_dentry);
++                      goal = tmp;
++                      dget_locked(goal);
++                      break;
++              }
++      }
++
++      if (!goal)
++              goto do_instantiate;
++
++      /* Move the goal to the de hash queue */
++      goal->d_flags &= ~ DCACHE_DISCONNECTED;
++      security_d_instantiate(goal, inode);
++      __d_rehash(dentry, 0);
++      __d_move(goal, dentry);
++      spin_unlock(&dcache_lock);
++      iput(inode);
++
++      return goal;
++
++      /* d_add(), but don't drop dcache_lock before adding dentry to inode */
++do_instantiate:
++      list_add(&dentry->d_alias, &inode->i_dentry);   /* d_instantiate */
++      dentry->d_inode = inode;
++do_rehash:
++      if (rehash)
++              __d_rehash(dentry, 0);                  /* d_rehash */
++      spin_unlock(&dcache_lock);
++
++      return NULL;
++}
++
++/*
++ * These are the special structures for the iopen pseudo directory.
++ */
++
++static struct inode_operations iopen_inode_operations = {
++      lookup:         iopen_lookup,           /* BKL held */
++};
++
++static struct file_operations iopen_file_operations = {
++      read:           generic_read_dir,
++};
++
++static int match_dentry(struct dentry *dentry, const char *name)
++{
++      int     len;
++
++      len = strlen(name);
++      if (dentry->d_name.len != len)
++              return 0;
++      if (strncmp(dentry->d_name.name, name, len))
++              return 0;
++      return 1;
++}
++
++/*
++ * This function is spliced into ext3_lookup and returns 1 the file
++ * name is __iopen__ and dentry has been filled in appropriately.
++ */
++int ext3_check_for_iopen(struct inode *dir, struct dentry *dentry)
++{
++      struct inode *inode;
++
++      if (dir->i_ino != EXT3_ROOT_INO ||
++          !test_opt(dir->i_sb, IOPEN) ||
++          !match_dentry(dentry, "__iopen__"))
++              return 0;
++
++      inode = iget(dir->i_sb, EXT3_BAD_INO);
++
++      if (!inode)
++              return 0;
++      d_add(dentry, inode);
++      return 1;
++}
++
++/*
++ * This function is spliced into read_inode; it returns 1 if inode
++ * number is the one for /__iopen__, in which case the inode is filled
++ * in appropriately.  Otherwise, this fuction returns 0.
++ */
++int ext3_iopen_get_inode(struct inode *inode)
++{
++      if (inode->i_ino != EXT3_BAD_INO)
++              return 0;
++
++      inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR;
++      if (test_opt(inode->i_sb, IOPEN_NOPRIV))
++              inode->i_mode |= 0777;
++      inode->i_uid = 0;
++      inode->i_gid = 0;
++      inode->i_nlink = 1;
++      inode->i_size = 4096;
++      inode->i_atime = CURRENT_TIME;
++      inode->i_ctime = CURRENT_TIME;
++      inode->i_mtime = CURRENT_TIME;
++      EXT3_I(inode)->i_dtime = 0;
++      inode->i_blksize = PAGE_SIZE;   /* This is the optimal IO size
++                                       * (for stat), not the fs block
++                                       * size */
++      inode->i_blocks = 0;
++      inode->i_version = 1;
++      inode->i_generation = 0;
++
++      inode->i_op = &iopen_inode_operations;
++      inode->i_fop = &iopen_file_operations;
++      inode->i_mapping->a_ops = 0;
++
++      return 1;
++}
+Index: linux-stage/fs/ext3/iopen.h
+===================================================================
+--- linux-stage.orig/fs/ext3/iopen.h   2004-05-07 16:00:17.000000000 -0400
++++ linux-stage/fs/ext3/iopen.h        2004-05-07 16:00:17.000000000 -0400
+@@ -0,0 +1,15 @@
++/*
++ * iopen.h
++ *
++ * Special support for opening files by inode number.
++ *
++ * Copyright (C) 2001 by Theodore Ts'o (tytso@alum.mit.edu).
++ *
++ * This file may be redistributed under the terms of the GNU General
++ * Public License.
++ */
++
++extern int ext3_check_for_iopen(struct inode *dir, struct dentry *dentry);
++extern int ext3_iopen_get_inode(struct inode *inode);
++extern struct dentry *iopen_connect_dentry(struct dentry *dentry,
++                                         struct inode *inode, int rehash);
+Index: linux-stage/fs/ext3/namei.c
+===================================================================
+--- linux-stage.orig/fs/ext3/namei.c   2004-05-07 16:00:16.000000000 -0400
++++ linux-stage/fs/ext3/namei.c        2004-05-07 16:00:17.000000000 -0400
+@@ -37,6 +37,7 @@
+ #include <linux/buffer_head.h>
+ #include <linux/smp_lock.h>
+ #include "xattr.h"
++#include "iopen.h"
+ #include "acl.h"
+ /*
+@@ -979,6 +980,9 @@
+       if (dentry->d_name.len > EXT3_NAME_LEN)
+               return ERR_PTR(-ENAMETOOLONG);
++      if (ext3_check_for_iopen(dir, dentry))
++              return NULL;
++
+       bh = ext3_find_entry(dentry, &de);
+       inode = NULL;
+       if (bh) {
+@@ -989,10 +993,8 @@
+               if (!inode)
+                       return ERR_PTR(-EACCES);
+       }
+-      if (inode)
+-              return d_splice_alias(inode, dentry);
+-      d_add(dentry, inode);
+-      return NULL;
++
++      return iopen_connect_dentry(dentry, inode, 1);
+ }
+@@ -2019,10 +2021,6 @@
+                             inode->i_nlink);
+       inode->i_version++;
+       inode->i_nlink = 0;
+-      /* There's no need to set i_disksize: the fact that i_nlink is
+-       * zero will ensure that the right thing happens during any
+-       * recovery. */
+-      inode->i_size = 0;
+       ext3_orphan_add(handle, inode);
+       inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+       ext3_mark_inode_dirty(handle, inode);
+@@ -2139,6 +2137,23 @@
+       return err;
+ }
++/* Like ext3_add_nondir() except for call to iopen_connect_dentry */
++static int ext3_add_link(handle_t *handle, struct dentry *dentry,
++                       struct inode *inode)
++{
++      int err = ext3_add_entry(handle, dentry, inode);
++      if (!err) {
++              err = ext3_mark_inode_dirty(handle, inode);
++              if (err == 0) {
++                      (void)iopen_connect_dentry(dentry, inode, 0);
++                      return 0;
++              }
++      }
++      ext3_dec_count(handle, inode);
++      iput(inode);
++      return err;
++}
++
+ static int ext3_link (struct dentry * old_dentry,
+               struct inode * dir, struct dentry *dentry)
+ {
+@@ -2161,7 +2176,8 @@
+       ext3_inc_count(handle, inode);
+       atomic_inc(&inode->i_count);
+-      err = ext3_add_nondir(handle, dentry, inode);
++      err = ext3_add_link(handle, dentry, inode);
++      ext3_orphan_del(handle,inode);
+       ext3_journal_stop(handle);
+       return err;
+ }
+Index: linux-stage/fs/ext3/super.c
+===================================================================
+--- linux-stage.orig/fs/ext3/super.c   2004-05-07 16:00:16.000000000 -0400
++++ linux-stage/fs/ext3/super.c        2004-05-07 17:21:59.000000000 -0400
+@@ -536,7 +536,7 @@
+       Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_noload,
+       Opt_commit, Opt_journal_update, Opt_journal_inum,
+       Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback,
+-      Opt_ignore, Opt_err,
++      Opt_ignore, Opt_err, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
+ };
+ static match_table_t tokens = {
+@@ -575,6 +575,9 @@
+       {Opt_ignore, "noquota"},
+       {Opt_ignore, "quota"},
+       {Opt_ignore, "usrquota"},
++      {Opt_iopen,  "iopen"},
++      {Opt_noiopen,  "noiopen"},
++      {Opt_iopen_nopriv,  "iopen_nopriv"},
+       {Opt_err, NULL}
+ };
+@@ -762,6 +765,18 @@
+               case Opt_abort:
+                       set_opt(sbi->s_mount_opt, ABORT);
+                       break;
++              case Opt_iopen:
++                      set_opt (sbi->s_mount_opt, IOPEN);
++                      clear_opt (sbi->s_mount_opt, IOPEN_NOPRIV);
++                      break;
++              case Opt_noiopen:
++                      clear_opt (sbi->s_mount_opt, IOPEN);
++                      clear_opt (sbi->s_mount_opt, IOPEN_NOPRIV);
++                      break;
++              case Opt_iopen_nopriv:
++                      set_opt (sbi->s_mount_opt, IOPEN);
++                      set_opt (sbi->s_mount_opt, IOPEN_NOPRIV);
++                      break;
+               case Opt_ignore:
+                       break;
+               default:
+Index: linux-stage/include/linux/ext3_fs.h
+===================================================================
+--- linux-stage.orig/include/linux/ext3_fs.h   2004-05-07 16:00:16.000000000 -0400
++++ linux-stage/include/linux/ext3_fs.h        2004-05-07 16:00:17.000000000 -0400
+@@ -325,6 +325,8 @@
+ #define EXT3_MOUNT_NO_UID32           0x2000  /* Disable 32-bit UIDs */
+ #define EXT3_MOUNT_XATTR_USER         0x4000  /* Extended user attributes */
+ #define EXT3_MOUNT_POSIX_ACL          0x8000  /* POSIX Access Control Lists */
++#define EXT3_MOUNT_IOPEN             0x10000  /* Allow access via iopen */
++#define EXT3_MOUNT_IOPEN_NOPRIV              0x20000  /* Make iopen world-readable */
+ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
+ #ifndef _LINUX_EXT2_FS_H
diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series
new file mode 100644 (file)
index 0000000..cff99dd
--- /dev/null
@@ -0,0 +1,9 @@
+ext3-wantedi-2.6-suse.patch
+ext3-san-jdike-2.6-suse.patch
+iopen-2.6-suse.patch 
+export_symbols-ext3-2.6-suse.patch
+ext3-map_inode_page-2.6-suse.patch
+ext3-init-generation-2.6-suse.patch
+ext3-ea-in-inode-2.6-suse.patch
+export-ext3-2.6-suse.patch
+ext3-include-fixes-2.6-suse.patch
diff --git a/ldiskfs/ldiskfs/Makefile.in b/ldiskfs/ldiskfs/Makefile.in
new file mode 100644 (file)
index 0000000..7d1e229
--- /dev/null
@@ -0,0 +1,19 @@
+default: all
+
+MODULES := ldiskfs
+
+# copy makefile over to not break patches
+ext3_extra := $(wildcard @LINUX@/fs/ext3/Makefile)
+
+ext3_headers := $(wildcard @LINUX@/fs/ext3/*.h)
+linux_headers := $(wildcard @LINUX@/include/linux/ext3*.h)
+
+ext3_sources := $(filter-out %.mod.c,$(wildcard @LINUX@/fs/ext3/*.c))
+new_sources := iopen.c iopen.h
+ldiskfs_sources := $(notdir $(ext3_sources) $(ext3_headers)) $(new_sources)
+
+ldiskfs-objs := $(filter %.o,$(ldiskfs_sources:.c=.o))
+
+EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LUSTRE@ -I@LUSTRE@/ldiskfs
+
+@INCLUDE_RULES@
diff --git a/ldiskfs/ldiskfs/autoMakefile.am b/ldiskfs/ldiskfs/autoMakefile.am
new file mode 100644 (file)
index 0000000..b24081e
--- /dev/null
@@ -0,0 +1,64 @@
+if LDISKFS
+modulefs_DATA = ldiskfs$(KMODEXT)
+endif
+
+ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers))))
+
+$(filter %.c,$(ldiskfs_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_sources))
+
+ldiskfs_sed_flags = \
+       -e "s/dx_hash_info/ext3_dx_hash_info/g" \
+       -e "s/dir_private_info/ext3_dir_private_info/g" \
+       -e "s/DX_HASH/EXT3_DX_HASH/g" \
+       -e "s/EXT3/LDISKFS/g" -e "s/ext3/ldiskfs/g"
+
+%.c: linux-stage/fs/ext3/%.c
+       sed $(strip $(ldiskfs_sed_flags)) $< > $@
+
+%.h: linux-stage/fs/ext3/%.h
+       sed $(strip $(ldiskfs_sed_flags)) $< > $@
+
+linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h
+       sed $(strip $(ldiskfs_sed_flags)) $< > $@
+
+#
+# FIXME: we need to grab the series in configure somehow
+# (see bug 1679)
+#
+series := @top_srcdir@/kernel_patches/series/ldiskfs-2.6-suse.series
+
+sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series)
+       rm -rf linux-stage linux sources $(ldiskfs_SOURCES)
+       mkdir -p linux-stage/fs/ext3 linux-stage/include/linux
+       cd linux-stage && quilt setup -l ../$(series)
+       cp $(ext3_sources) $(ext3_headers) $(ext3_extra) linux-stage/fs/ext3
+       cp $(linux_headers) linux-stage/include/linux
+       cd linux-stage && quilt push -a -q
+       mkdir linux
+       @echo -n "Replacing 'ext3' with 'ldiskfs':"
+       @for i in $(notdir $(ext3_headers) $(ext3_sources)) $(new_sources) ; do \
+               echo -n " $$i" ; \
+               sed $(strip $(ldiskfs_sed_flags)) \
+                       linux-stage/fs/ext3/$$i > $$i ; \
+       done
+       @for i in $(subst ext3,,$(notdir $(linux_headers))) ; do \
+               echo -n " ext3$$i" ; \
+               sed $(strip $(ldiskfs_sed_flags)) \
+                       linux-stage/include/linux/ext3$$i \
+                       > linux/ldiskfs$$i ; \
+       done
+       touch sources
+
+foo-check:
+       @echo "ldiskfs_sources: $(ldiskfs_sources)"
+       @echo "ldiskfs_SOURCES: $(ldiskfs_SOURCES)"
+       @echo "ldiskfs_headers: $(ldiskfs_headers)"
+       @echo "ldiskfs_objects: $(ldiskfs_objects)"
+       @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
+       @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
+
+MOSTLYCLEANFILES = *.o *.ko *.mod.c
+CLEANFILES = sources *.c *.h
+
+clean: clean-am
+       rm -rf linux linux-stage
index c1a9bdf..f30d862 100644 (file)
@@ -1,9 +1,11 @@
 Kernelenv
 Makefile
-Makefile.in
+autoMakefile
+autoMakefile.in
 aclocal.m4
 autom4te.cache
 config.log
 config.status
 configure
-.*.o.cmd
+.*.cmd
+.depend
diff --git a/lnet/Makefile.am b/lnet/Makefile.am
deleted file mode 100644 (file)
index 0083ac1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2001  Cluster File Systems, Inc.
-#
-# This code is issued under the GNU General Public License.
-# See the file COPYING in this distribution
-
-EXTRA_DIST = Rules.linux archdep.m4 include 
-DIST_SUBDIRS = libcfs portals knals unals utils tests doc router
-
-if LIBLUSTRE
-SUBDIRS = portals unals utils
-else
-
-if CRAY_PORTALS
-SUBDIRS = libcfs tests doc 
-else 
-SUBDIRS = libcfs portals knals unals utils tests doc router
-endif
-
-endif
diff --git a/lnet/Makefile.in b/lnet/Makefile.in
new file mode 100644 (file)
index 0000000..71d0dc8
--- /dev/null
@@ -0,0 +1,9 @@
+subdir-m += libcfs
+
+cray-subdirs += portals
+cray-subdirs += knals
+cray-subdirs += router
+cray-subdirs += tests
+@CRAY_PORTALS_FALSE@subdir-m += $(cray-subdirs)
+
+@INCLUDE_RULES@
diff --git a/lnet/Rules.linux b/lnet/Rules.linux
deleted file mode 100644 (file)
index 232a248..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# included in Linux kernel directories
-# Rules for module building
-
-if LINUX25
-
-basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
-AM_CPPFLAGS= -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2  -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
-
-$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
-       rm -f $(MODULE)_tmp.c
-       $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
-       $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
-
-else
-
-$(MODULE).o: $($(MODULE)_OBJECTS)
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $($(MODULE)_OBJECTS)
-
-endif
-
-tags:
-       rm -f $(top_srcdir)/TAGS
-       rm -f $(top_srcdir)/tags
-       find $(top_srcdir)/../portals/ -name '*.[hc]' | xargs etags -a
-       find $(top_srcdir) -name '*.[hc]' | grep -v ".orig" | xargs etags -a
-       find $(top_srcdir)/../portals/ -name '*.[hc]' | xargs ctags -a
-       find $(top_srcdir) -name '*.[hc]' | grep -v ".orig" | xargs ctags -a
index b203a95..636ee1d 100644 (file)
@@ -1,25 +1,55 @@
+# -------- we can't build modules unless srcdir = builddir
+if test x$enable_modules != xno ; then
+AC_CHECK_FILE([autoMakefile.am],[],
+       [AC_MSG_ERROR([At this time, Lustre does not support building kernel modules with srcdir != buildir.])])
+fi
 
 # -------- in kernel compilation? (2.5 only) -------------
-AC_ARG_ENABLE(inkernel, [  --enable-inkernel set up 2.5 kernel makefiles])
+AC_MSG_CHECKING([if inkernel build support is requested])
+AC_ARG_ENABLE([inkernel],
+       AC_HELP_STRING([--enable-inkernel],
+                      [set up 2.5 kernel makefiles]),
+       [],[enable_inkernel=no])
+AC_MSG_RESULT([$enable_inkernel])
 AM_CONDITIONAL(INKERNEL, test x$enable_inkernel = xyes)
-echo "Makefile for in kernel build: $INKERNEL"
 
 # -------- are we building against an external portals? -------
-# haha, I wonder how one is really supposed to do this
-# automake seems to have a DEFS variable which looks good
-AC_ARG_WITH(cray-portals, [  --with-cray-portals=[path] path to cray portals],
-       CRAY_PORTALS_INCLUDE="-I$with_cray_portals"
-       CC="$CC -DCRAY_PORTALS=1"
-       )
-AC_SUBST(CRAY_PORTALS_INCLUDE)
-AM_CONDITIONAL(CRAY_PORTALS, test ! "x$with_cray_portals" = x)
-
-# -------- liblustre compilation --------------
-AC_ARG_WITH(lib, [  --with-lib compile lustre library], host_cpu="lib")
+AC_MSG_CHECKING([if Cray portals should be used])
+AC_ARG_WITH([cray-portals],
+       AC_HELP_STRING([--with-cray-portals=path],
+                      [path to cray portals]),
+       [
+               if test "$with_cray_portals" != no; then
+                       if test -r $with_cray_portals/include/portals/api.h ; then
+                               CRAY_PORTALS_INCLUDE="-I$with_cray_portals/include"
+                               AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
+                       else
+                               AC_MSG_ERROR([--with-cray-portals specified badly])
+                        fi
+                fi
+       ],[with_cray_portals=no])
+AC_MSG_RESULT([$with_cray_portals])
+
+AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
+
+# -------- enable tests and utils? -------
+if test x$enable_tests = xno ; then
+       AC_MSG_NOTICE([disabling tests])
+       enable_tests=no
+fi
+if test x$enable_utils = xno ; then
+       AC_MSG_NOTICE([disabling utilities])
+       enable_utils=no
+fi
 
 # -------- set linuxdir ------------
-
-AC_ARG_WITH(linux, [  --with-linux=[path] set path to Linux source (default=/usr/src/linux)],LINUX=$with_linux,LINUX=/usr/src/linux)
+AC_MSG_CHECKING([for Linux sources])
+AC_ARG_WITH([linux],
+       AC_HELP_STRING([--with-linux=path],
+                      [set path to Linux source (default=/usr/src/linux)]),
+       [LINUX=$with_linux],
+       [LINUX=/usr/src/linux])
+AC_MSG_RESULT([$LINUX])
 AC_SUBST(LINUX)
 if test x$enable_inkernel = xyes ; then
         echo ln -s `pwd` $LINUX/fs/lustre
@@ -27,201 +57,196 @@ if test x$enable_inkernel = xyes ; then
         ln -s `pwd` $LINUX/fs/lustre
 fi
 
-#  --------------------
-AC_MSG_CHECKING(if you are running user mode linux for $host_cpu ...)
-if test $host_cpu = "lib" ; then 
-        host_cpu="lib"
-       AC_MSG_RESULT(no building Lustre library)
-else
-  if test -e $LINUX/include/asm-um ; then
-    if test  X`ls -id $LINUX/include/asm/ | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
-       host_cpu="um";
-       AC_MSG_RESULT(yes)
-    else
-       AC_MSG_RESULT(no (asm doesn't point at asm-um))
-    fi
+# -------- check for .confg --------
+AC_ARG_WITH([linux-config],
+       [AC_HELP_STRING([--with-linux-config=path],
+                       [set path to Linux .conf (default=\$LINUX/.config)])],
+       [LINUX_CONFIG=$with_linux_config],
+       [LINUX_CONFIG=$LINUX/.config])
+AC_SUBST(LINUX_CONFIG)
 
-  else 
-        AC_MSG_RESULT(no (asm-um missing))
-  fi
-fi
+AC_CHECK_FILE([/boot/kernel.h],
+       [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
+       [AC_CHECK_FILE([/var/adm/running-kernel.h]),
+               [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h']])
 
-# --------- Linux 25 ------------------
+AC_ARG_WITH([kernel-source-header],
+       AC_HELP_STRING([--with-kernel-source-header=path],
+                       [Use a different kernel version header.  Consult README.kernel-source for details.]),
+       [KERNEL_SOURCE_HEADER=$with_kernel_source_header])
 
-AC_MSG_CHECKING(if you are running linux 2.5)
-if test -e $LINUX/include/linux/namei.h ; then
-        linux25="yes"
-        AC_MSG_RESULT(yes)
-else
-        linux25="no"
-        AC_MSG_RESULT(no)
+#  --------------------
+ARCH_UM=
+UML_CFLAGS=
+if test x$enable_modules != xno ; then
+       AC_MSG_CHECKING([if you are running user mode linux for $host_cpu])
+       if test -e $LINUX/include/asm-um ; then
+               if test  X`ls -id $LINUX/include/asm/ | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
+                       ARCH_UM='ARCH=um'
+                       # see notes in Rules.in
+                       UML_CFLAGS='-O0'
+                       AC_MSG_RESULT(yes)
+               else
+                       AC_MSG_RESULT([no (asm doesn't point at asm-um)])
+               fi
+       else
+               AC_MSG_RESULT([no (asm-um missing)])
+       fi
 fi
+AC_SUBST(ARCH_UM)
+AC_SUBST(UML_CFLAGS)
+# --------- Linux 25 ------------------
+
+AC_CHECK_FILE([$LINUX/include/linux/namei.h],
+       [
+               linux25="yes"
+               KMODEXT=".ko"
+       ],[
+               KMODEXT=".o"
+               linux25="no"
+       ])
+AC_MSG_CHECKING([if you are using Linux 2.6])
+AC_MSG_RESULT([$linux25])
 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
-echo "Makefiles for in linux 2.5 build: $LINUX25"
+AC_SUBST(KMODEXT)
 
 # -------  Makeflags ------------------
 
-AC_MSG_CHECKING(setting make flags system architecture: )
-case ${host_cpu} in
-       lib )
-       AC_MSG_RESULT($host_cpu)
-       KCFLAGS='-g -Wall '
-       KCPPFLAGS='-D__arch_lib__ '
-       libdir='${exec_prefix}/lib/lustre'
-        MOD_LINK=elf_i386
-;;
-       um )
-       AC_MSG_RESULT($host_cpu)
-       KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common '
-        case ${linux25} in
-                yes )
-                KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE  -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/kernel/skas/include -O2 -nostdinc -iwithprefix include'
-        ;;
-                * )
-                KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE  -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/include '
-        ;;
-        esac
-
-        MOD_LINK=elf_i386
-;;
-       i*86 )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -pipe'
-        case ${linux25} in
-                yes )
-                KCPPFLAGS='-D__KERNEL__ -DMODULE -march=i686 -I$(LINUX)/include/asm-i386/mach-default -nostdinc -iwithprefix include '
-        ;;
-                * )
-                KCPPFLAGS='-D__KERNEL__ -DMODULE '
-        ;;
-        esac
-        MOD_LINK=elf_i386
-;;
-
-       alphaev6 )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6'
-        KCPPFLAGS='-D__KERNEL__ -DMODULE '
-        MOD_LINK=elf64alpha
-;;
-
-       alphaev67 )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6'
-        KCPPFLAGS='-D__KERNEL__ -DMODULE '
-        MOD_LINK=elf64alpha
-;;
-
-       alpha* )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev5'
-        KCPPFLAGS='-D__KERNEL__ -DMODULE '
-        MOD_LINK=elf64alpha
-;;
-
-       ia64 )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step'
-       KCPPFLAGS='-D__KERNEL__ -DMODULE'
-        MOD_LINK=elf64_ia64
-;;
-
-       x86_64 )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000 -fno-strength-reduce -fno-asynchronous-unwind-tables'
-       KCPPFLAGS='-D__KERNEL__ -DMODULE'
-        MOD_LINK=elf_x86_64
-;;
-
-       sparc64 )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs'
-        KCPPFLAGS='-D__KERNEL__'
-        MOD_LINK=elf64_sparc
-
-;;
-
-       powerpc )
-       AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-O2 -g -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
-        KCPPFLAGS='-D__KERNEL__ -DMODULE'
-        MOD_LINK=elf32ppclinux
-;;
-
-        *)
-       AC_ERROR("Unknown Linux Platform: $host_cpu")
-;;
-esac
-
-# ----------- make dep run? ------------------
-
-if test $host_cpu != "lib" ; then 
-  AC_MSG_CHECKING(if make dep has been run in kernel source (host $host_cpu) )
-  if test -f $LINUX/include/linux/config.h ; then
-  AC_MSG_RESULT(yes)
- else
-  AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
-  fi
+CPPFLAGS="$CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE -I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include"
+
+# liblustre are all the same
+LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
+AC_SUBST(LLCPPFLAGS)
+
+LLCFLAGS="-g -Wall -fPIC"
+AC_SUBST(LLCFLAGS)
+
+# everyone builds against portals and lustre
+
+if test x$enable_ldiskfs = xyes ; then
+       AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
+       AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
+       AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls])
+       AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security])
 fi
 
+EXTRA_KCFLAGS="-g $CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE -I$PWD/portals/include -I$PWD/include"
+
+# these are like AC_TRY_COMPILE, but try to build modules against the
+# kernel, inside the kernel-tests directory
+
+AC_DEFUN([LUSTRE_MODULE_CONFTEST],
+[cat >conftest.c <<_ACEOF
+$1
+_ACEOF
+])
+
+AC_DEFUN([LUSTRE_MODULE_COMPILE_IFELSE],
+[m4_ifvaln([$1], [LUSTRE_MODULE_CONFTEST([$1])])dnl
+rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.ko
+AS_IF([AC_TRY_COMMAND(cp conftest.c kernel-tests && make [$2] -f $PWD/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX EXTRA_CFLAGS="$EXTRA_KCFLAGS" $ARCH_UM SUBDIRS=$PWD/kernel-tests) >/dev/null && AC_TRY_COMMAND([$3])],
+       [$4],
+       [_AC_MSG_LOG_CONFTEST
+m4_ifvaln([$5],[$5])dnl])dnl
+rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.mod.o kernel-tests/conftest.ko m4_ifval([$1], [kernel-tests/conftest.c conftest.c])[]dnl
+])
+
+AC_DEFUN([LUSTRE_MODULE_TRY_COMPILE],
+[LUSTRE_MODULE_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[$1]], [[$2]])],
+       [modules],
+       [test -s kernel-tests/conftest.o],
+       [$3], [$4])])
+
+AC_DEFUN([LUSTRE_MODULE_TRY_MAKE],
+[LUSTRE_MODULE_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4], [$5], [$6])])
+
 # ------------ include paths ------------------
 
-KINCFLAGS="$CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE \
-       -I\$(top_srcdir)/include \
-       -I\$(top_srcdir)/portals/include"
-if test $host_cpu != "lib" ; then 
-    KINCFLAGS="$KINCFLAGS -I$LINUX/include -I$LINUX/include"
-fi
-CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
-
-if test $host_cpu != "lib" ; then 
-# ------------ autoconf.h ------------------
-  AC_MSG_CHECKING(if autoconf.h is in kernel source)
-  if test -f $LINUX/include/linux/autoconf.h ; then
-      AC_MSG_RESULT(yes)
-  else
-      AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
-  fi
-
-# ------------ LINUXRELEASE and moduledir ------------------
-  AC_MSG_CHECKING(for Linux release)
-  
-  dnl We need to rid ourselves of the nasty [ ] quotes.
-  changequote(, )
-  dnl Get release from version.h
-  LINUXRELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z_-]*\).*/\1/p' $LINUX/include/linux/version.h`"
-  changequote([, ])
-  
-  moduledir='$(libdir)/modules/'$LINUXRELEASE/kernel
-  AC_SUBST(moduledir)
-  
-  modulefsdir='$(moduledir)/fs/$(PACKAGE)'
-  AC_SUBST(modulefsdir)
-  
-  AC_MSG_RESULT($LINUXRELEASE)
-  AC_SUBST(LINUXRELEASE)
-
-# ------------ RELEASE --------------------------------
-  AC_MSG_CHECKING(lustre release)
-  
-  dnl We need to rid ourselves of the nasty [ ] quotes.
-  changequote(, )
-  dnl Get release from version.h
-  RELEASE="`sed -ne 's/-/_/g' -e 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z_]*\).*/\1/p' $LINUX/include/linux/version.h`_`date +%Y%m%d%H%M`"
-  changequote([, ])
-
-  AC_MSG_RESULT($RELEASE)
-  AC_SUBST(RELEASE)
-
-# ---------- modversions? --------------------
-  AC_MSG_CHECKING(for MODVERSIONS)
-  if egrep -e 'MODVERSIONS.*1' $LINUX/include/linux/autoconf.h >/dev/null 2>&1;
-  then
-       if test $linux25 != "yes"; then
-                MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
-                AC_MSG_RESULT(yes)
-        fi
-  fi
+if test x$enable_modules != xno ; then
+       # ------------ .config exists ----------------
+       AC_CHECK_FILE([$LINUX_CONFIG],[],
+               [AC_MSG_ERROR([Kernel config could not be found.  If you are building from a kernel-source rpm consult README.kernel-source])])
+
+       # ----------- make dep run? ------------------
+       AC_CHECK_FILES([$LINUX/include/linux/autoconf.h
+                       $LINUX/include/linux/version.h
+                       $LINUX/include/linux/config.h],[],
+               [AC_MSG_ERROR([Run make config in $LINUX.])])
+
+       # ------------ rhconfig.h includes runtime-generated bits --
+       # red hat kernel-source checks
+
+       # we know this exists after the check above.  if the user
+       # tarred up the tree and ran make dep etc. in it, then
+       # version.h gets overwritten with a standard linux one.
+
+       if grep rhconfig $LINUX/include/linux/version.h >/dev/null ; then
+               # This is a clean kernel-source tree, we need to
+               # enable extensive workarounds to get this to build
+               # modules
+               AC_CHECK_FILE([$KERNEL_SOURCE_HEADER],
+                       [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
+                               AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
+                               AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
+                               AC_MSG_WARN([Consult README.kernel-source for details.])
+                       fi],
+                       [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found.  Consult README.kernel-source for details.])])
+               EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
+       fi
+
+       # --- check that we can build modules at all
+       AC_MSG_CHECKING([that modules can be built])
+       LUSTRE_MODULE_TRY_COMPILE([],[],
+               [
+                       AC_MSG_RESULT([yes])
+               ],[
+                       AC_MSG_RESULT([no])
+                       AC_MSG_WARN([Consult config.log for details.])
+                       AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult README.kernel-source])
+                       AC_MSG_ERROR([Kernel modules could not be built.])
+               ])
+
+       # ------------ LINUXRELEASE and moduledir ------------------
+       AC_MSG_CHECKING([for Linux release])
+       rm -f kernel-tests/conftest.i
+       LINUXRELEASE=
+       if test $linux25 = 'yes' ; then
+               makerule="$PWD/kernel-tests"
+       else
+               makerule="_dir_$PWD/kernel-tests"
+       fi
+       LUSTRE_MODULE_TRY_MAKE(
+               [#include <linux/version.h>],
+               [LINUXRELEASE=UTS_RELEASE],
+               [$makerule LUSTRE_KERNEL_TEST=conftest.i],
+               [test -s kernel-tests/conftest.i],
+               [
+                       # LINUXRELEASE="UTS_RELEASE"
+                       eval $(grep LINUXRELEASE kernel-tests/conftest.i)
+               ],[
+                       AC_MSG_RESULT([unknown])
+                       AC_MSG_ERROR([Could not preprocess test program.  Consult config.log for details.])
+               ])
+       rm -f kernel-tests/conftest.i
+       if test x$LINUXRELEASE = x ; then
+               AC_MSG_RESULT([unknown])
+               AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
+       fi
+       AC_MSG_RESULT([$LINUXRELEASE])
+       AC_SUBST(LINUXRELEASE)
+
+       moduledir='$(libdir)/modules/'$LINUXRELEASE/kernel
+       AC_SUBST(moduledir)
+
+       modulefsdir='$(moduledir)/fs/$(PACKAGE)'
+       AC_SUBST(modulefsdir)
+
+       # ------------ RELEASE --------------------------------
+       AC_MSG_CHECKING([for Lustre release])
+       RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`"
+       AC_MSG_RESULT($RELEASE)
+       AC_SUBST(RELEASE)
 fi
 
 # ---------- Portals flags --------------------
@@ -234,166 +259,299 @@ fi
 #fi
 #AC_SUBST(usrprefix)
 
-AC_MSG_CHECKING(if kernel has CPU affinity support)
-SET_CPUS_ALLOW="`grep -c set_cpus_allowed $LINUX/kernel/softirq.c`"
-if test "$SET_CPUS_ALLOW" != 0 ; then
-  enable_affinity_temp="-DCPU_AFFINITY=1"
-  AC_MSG_RESULT(yes)
+AC_MSG_CHECKING([for zero-copy TCP support])
+AC_ARG_ENABLE([zerocopy],
+       AC_HELP_STRING([--disable-zerocopy],
+                      [disable socknal zerocopy]),
+       [],[enable_zerocopy='yes'])
+if test x$enable_zerocopy = xno ; then
+       AC_MSG_RESULT([no (by request)])
 else
-  enable_affinity_temp=""
-  AC_MSG_RESULT(no)
+       ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
+       if test "$ZCCD" != 0 ; then
+               AC_DEFINE(SOCKNAL_ZC, 1, [use zero-copy TCP])
+               AC_MSG_RESULT(yes)
+       else
+               AC_MSG_RESULT([no (no kernel support)])
+       fi
 fi
 
-AC_MSG_CHECKING(if kernel has zero-copy TCP support)
-ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
-if test "$ZCCD" != 0 ; then
-  enable_zerocopy_temp="-DSOCKNAL_ZC=1"
-  AC_MSG_RESULT(yes)
+AC_MSG_CHECKING([for CPU affinity support])
+AC_ARG_ENABLE([affinity],
+       AC_HELP_STRING([--disable-affinity],
+                      [disable process/irq affinity]),
+       [],[enable_affinity='yes'])
+if test x$enable_affinity = xno ; then
+       AC_MSG_RESULT([no (by request)])
 else
-  enable_zerocopy_temp=""
-  AC_MSG_RESULT(no)
+       SET_CPUS_ALLOW="`grep -c set_cpus_allowed $LINUX/kernel/softirq.c`"
+       if test "$SET_CPUS_ALLOW" != 0 ; then
+               AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no (no kernel support)])
+       fi
 fi
 
-AC_ARG_ENABLE(zerocopy, [  --disable-zerocopy disable socknal zerocopy],enable_zerocopy="", enable_zerocopy=$enable_zerocopy_temp)
 
-AC_ARG_ENABLE(affinity, [  --disable-affinity disable process/irq affinity],enable_affinity="", enable_affinity=$enable_affinity_temp)
 #####################################
 
-AC_MSG_CHECKING(if quadrics kernel headers are present)
+AC_MSG_CHECKING([if quadrics kernel headers are present])
 if test -d $LINUX/drivers/net/qsnet ; then
-  AC_MSG_RESULT(yes)
-  QSWNAL="qswnal"
-  AC_MSG_CHECKING(for multirail EKC)
-  if test -f $LINUX/include/elan/epcomms.h; then
-       AC_MSG_RESULT(supported)
-       with_quadrics="-DMULTIRAIL_EKC=1"
-  else
-       AC_MSG_RESULT(not supported)
-       with_quadrics="-I$LINUX/drivers/net/qsnet/include"
-  fi
-  :
+       AC_MSG_RESULT([yes])
+       QSWNAL="qswnal"
+       AC_MSG_CHECKING([for multirail EKC])
+       if test -f $LINUX/include/elan/epcomms.h; then
+               AC_MSG_RESULT([supported])
+               QSWCPPFLAGS="-DMULTIRAIL_EKC=1"
+       else
+               AC_MSG_RESULT([not supported])
+               if test -d $LINUX/drivers/net/qsnet/include; then
+                       QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
+               else
+                       QSWCPPFLAGS="-I$LINUX/include/linux"
+               fi
+       fi
 else
-  AC_MSG_RESULT(no)
-  QSWNAL=""
-  with_quadrics=""
-  :
+       AC_MSG_RESULT([no])
+       QSWNAL=""
+       QSWCPPFLAGS=""
 fi
-AC_SUBST(with_quadrics)
+AC_SUBST(QSWCPPFLAGS)
 AC_SUBST(QSWNAL)
-
-# R. Read 5/02
-GMNAL=""
-echo "checking with-gm=" ${with_gm}
-if test "${with_gm+set}" = set; then
-  if test "${with_gm}" = yes; then
-    with_gm="-I/usr/local/gm/include"
-  else
-    with_gm="-I$with_gm/include -I$with_gm/drivers -I$with_gm/drivers/linux/gm"
-  fi
-  GMNAL="gmnal"
-else
-# default case - no GM
-  with_gm=""
-fi
-AC_SUBST(with_gm)
+AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
+
+AC_MSG_CHECKING([if gm support was requested])
+AC_ARG_WITH([gm],
+       AC_HELP_STRING([--with-gm=path],
+                      [build gmnal against path]),
+       [
+               case $with_gm in 
+                       yes)
+                               AC_MSG_RESULT([yes])
+                               GMCPPFLAGS="-I/usr/local/gm/include"
+                               GMNAL="gmnal"
+                               ;;
+                       no)
+                               AC_MSG_RESULT([no])
+                               GMCPPFLAGS=""
+                               GMNAL=""
+                               ;;
+                       *)
+                               AC_MSG_RESULT([yes])
+                               GMCPPFLAGS="-I$with_gm/include -I$with_gm/drivers -I$with_gm/drivers/linux/gm"
+                               GMNAL="gmnal"
+                               ;;
+               esac
+       ],[
+               AC_MSG_RESULT([no])
+               GMCPPFLAGS=""
+               GMNAL=""
+       ])
+AC_SUBST(GMCPPFLAGS)
 AC_SUBST(GMNAL)
-
+AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
 
 #fixme: where are the default IB includes?
 default_ib_include_dir=/usr/local/ib/include
 an_ib_include_file=vapi.h
 
-AC_ARG_WITH(ib, [  --with-ib=[yes/no/path] Path to IB includes], with_ib=$withval, with_ib=$default_ib)
-AC_MSG_CHECKING(if IB headers are present)
-if test "$with_ib" = yes; then
-    with_ib=$default_ib_include_dir
-fi
-if test "$with_ib" != no -a -f ${with_ib}/${an_ib_include_file}; then
-    AC_MSG_RESULT(yes)
-    IBNAL="ibnal"
-    with_ib="-I${with_ib}"
-else
-    AC_MSG_RESULT(no)
-    IBNAL=""
-    with_ib=""
-fi
+AC_MSG_CHECKING([if ib nal support was requested])
+AC_ARG_WITH([ib],
+       AC_HELP_STRING([--with-ib=yes/no/path],
+                      [Path to IB includes]),
+       [
+               case $with_ib in
+                       yes)
+                               AC_MSG_RESULT([yes])
+                               IBCPPFLAGS="-I/usr/local/ib/include"
+                               IBNAL="ibnal"
+                               ;;
+                       no)
+                               AC_MSG_RESULT([no])
+                               IBCPPFLAGS=""
+                               IBNAL=""
+                               ;;
+                       *)
+                               AC_MSG_RESULT([yes])
+                               IBCPPFLAGS="-I$with_ib"
+                               IBNAL=""
+                               ;;
+               esac
+       ],[
+               AC_MSG_RESULT([no])
+               IBFLAGS=""
+               IBNAL=""
+       ])
 AC_SUBST(IBNAL)
-AC_SUBST(with_ib)
-
+AC_SUBST(IBCPPFLAGS)
+AM_CONDITIONAL(BUILD_IBNAL, test x$IBNAL = "xibnal")
 
-def_scamac=/opt/scali/include
-AC_ARG_WITH(scamac, [  --with-scamac=[yes/no/path] Path to ScaMAC includes (default=/opt/scali/include)], with_scamac=$withval, with_scamac=$def_scamac)
-AC_MSG_CHECKING(if ScaMAC headers are present)
-if test "$with_scamac" = yes; then
-  with_scamac=$def_scamac
-fi
-if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then
-  AC_MSG_RESULT(yes)
-  SCIMACNAL="scimacnal"
-  with_scamac="-I${with_scamac} -I${with_scamac}/icm"
-else
-  AC_MSG_RESULT(no)
-  SCIMACNAL=""
-  with_scamac=""
-fi
-
-AC_SUBST(with_scamac)
-AC_SUBST(SCIMACNAL)
-
-CFLAGS="$KCFLAGS"
-CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib"
-
-AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
 AC_SUBST(MOD_LINK)
 AC_SUBST(LINUX25)
-AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
 
 # ---------- Red Hat 2.4.18 has iobuf->dovary --------------
 # But other kernels don't
 
 AC_MSG_CHECKING([if struct kiobuf has a dovary field])
-AC_TRY_COMPILE([#define __KERNEL__
-               #include <linux/iobuf.h>],
-              [struct kiobuf iobuf;
-               iobuf.dovary = 1;],
-              [AC_MSG_RESULT([yes])
-                CPPFLAGS="$CPPFLAGS -DHAVE_KIOBUF_DOVARY"],
-              [AC_MSG_RESULT([no])])
+LUSTRE_MODULE_TRY_COMPILE(
+       [
+               #include <linux/iobuf.h>
+       ],[
+               struct kiobuf iobuf;
+               iobuf.dovary = 1;
+       ],[
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
+       ],[
+               AC_MSG_RESULT([no])
+       ])
+
+# ----------- 2.6.4 no longer has page->list ---------------
+AC_MSG_CHECKING([if struct page has a list field])
+LUSTRE_MODULE_TRY_COMPILE(
+       [
+               #include <linux/mm.h>
+       ],[
+               struct page page;
+               &page.list;
+       ],[
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
+       ],[
+               AC_MSG_RESULT([no])
+       ])
 
 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
 # This needs to run after we've defined the KCPPFLAGS
 
-AC_MSG_CHECKING(for kernel version)
-AC_TRY_COMPILE([#define __KERNEL__
-             #include <linux/sched.h>],
-            [struct task_struct p;
-             p.sighand = NULL;],
-            [RH_2_4_20=1],
-            [RH_2_4_20=0])
-
-if test $RH_2_4_20 = 1; then
-       AC_MSG_RESULT(redhat-2.4.20)
-       CPPFLAGS="$CPPFLAGS -DCONFIG_RH_2_4_20"
-else
-       AC_MSG_RESULT($LINUXRELEASE)
-fi 
+AC_MSG_CHECKING([for kernel version])
+LUSTRE_MODULE_TRY_COMPILE(
+       [
+               #include <linux/sched.h>
+       ],[
+               struct task_struct p;
+               p.sighand = NULL;
+       ],[
+               AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
+               AC_MSG_RESULT([redhat-2.4.20])
+       ],[
+               AC_MSG_RESULT([$LINUXRELEASE])
+       ])
 
 # ---------- Red Hat 2.4.21 backports some more 2.5 bits --------
 
-AC_MSG_CHECKING(if kernel defines PDE)
+AC_MSG_CHECKING([if kernel defines PDE])
 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
 if test "$HAVE_PDE" != 0 ; then
-  CPPFLAGS="$CPPFLAGS -DHAVE_PDE"
-  AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
+       AC_MSG_RESULT([yes])
 else
-  AC_MSG_RESULT(no)
+       AC_MSG_RESULT([no])
 fi
 
-AC_MSG_CHECKING(if kernel passes struct file to direct_IO)
+AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
 if test "$HAVE_DIO_FILE" != 0 ; then
-  CPPFLAGS="$CPPFLAGS -DHAVE_DIO_FILE"
-  AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
+       AC_MSG_RESULT(yes)
 else
-  AC_MSG_RESULT(no)
+       AC_MSG_RESULT(no)
+fi
+
+if test x$enable_modules != xno ; then
+       # ---------- modules? ------------------------
+       AC_MSG_CHECKING([for module support])
+       LUSTRE_MODULE_TRY_COMPILE(
+               [
+                       #include <linux/config.h>
+               ],[
+                       #ifndef CONFIG_MODULES
+                       #error CONFIG_MODULES not #defined
+                       #endif
+               ],[
+                       AC_MSG_RESULT([yes])
+               ],[
+                       AC_MSG_RESULT([no])
+                       AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
+               ])
+
+       # ---------- modversions? --------------------
+       AC_MSG_CHECKING([for MODVERSIONS])
+       LUSTRE_MODULE_TRY_COMPILE(
+               [
+                       #include <linux/config.h>
+               ],[
+                       #ifndef CONFIG_MODVERSIONS
+                       #error CONFIG_MODVERSIONS not #defined
+                       #endif
+               ],[
+                       AC_MSG_RESULT([yes])
+               ],[
+                       AC_MSG_RESULT([no])
+               ])
+
+       # ------------ preempt -----------------------
+       AC_MSG_CHECKING([if preempt is enabled])
+       LUSTRE_MODULE_TRY_COMPILE(
+               [
+                       #include <linux/config.h>
+               ],[
+                       #ifndef CONFIG_PREEMPT
+                       #error CONFIG_PREEMPT is not #defined
+                       #endif
+               ],[
+                       AC_MSG_RESULT([yes])
+                       AC_MSG_ERROR([Lustre does not support kernels with preempt enabled.])
+               ],[
+                       AC_MSG_RESULT([no])
+               ])
+
+       if test $BACKINGFS = 'ext3' ; then
+               # --- Check that ext3 and ext3 xattr are enabled in the kernel
+               AC_MSG_CHECKING([that ext3 is enabled in the kernel])
+               LUSTRE_MODULE_TRY_COMPILE(
+                       [
+                               #include <linux/config.h>
+                       ],[
+                               #ifndef CONFIG_EXT3_FS
+                               #ifndef CONFIG_EXT3_FS_MODULE
+                               #error CONFIG_EXT3_FS not #defined
+                               #endif
+                               #endif
+                       ],[
+                               AC_MSG_RESULT([yes])
+                       ],[
+                               AC_MSG_RESULT([no])
+                               AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
+                       ])
+
+               AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
+               LUSTRE_MODULE_TRY_COMPILE(
+                       [
+                               #include <linux/config.h>
+                       ],[
+                               #ifndef CONFIG_EXT3_FS_XATTR
+                               #error CONFIG_EXT3_FS_XATTR not #defined
+                               #endif
+                       ],[
+                               AC_MSG_RESULT([yes])
+                       ],[
+                               AC_MSG_RESULT([no])
+                               AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR.)])
+                               AC_MSG_WARN([This build may fail.])
+                       ])
+       fi # BACKINGFS = ext3
 fi
+
+CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
+EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
+AC_SUBST(EXTRA_KCFLAGS)
+
+#echo "KCPPFLAGS: $KCPPFLAGS"
+#echo "KCFLAGS: $KCFLAGS"
+#echo "LLCPPFLAGS: $LLCPPFLAGS"
+#echo "LLCFLAGS: $LLCFLAGS"
+#echo "MOD_LINK: $MOD_LINK"
+#echo "CFLAGS: $CFLAGS"
+#echo "CPPFLAGS: $CPPFLAGS"
similarity index 59%
rename from lnet/klnds/Makefile.am
rename to lnet/autoMakefile.am
index df6ee5c..bd57e6e 100644 (file)
@@ -3,5 +3,6 @@
 # This code is issued under the GNU General Public License.
 # See the file COPYING in this distribution
 
-DIST_SUBDIRS= socknal qswnal gmnal scimacnal ibnal
-SUBDIRS= socknal @QSWNAL@ @GMNAL@ @SCIMACNAL@ @IBNAL@
+EXTRA_DIST = archdep.m4 build.m4 include 
+
+SUBDIRS = portals libcfs knals unals router tests doc utils
index 8c55b20..93a370f 100644 (file)
@@ -1,5 +1,9 @@
 # ----------  other tests and settings ---------
 
+AC_CHECK_TYPE([spinlock_t],
+       [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
+       [],
+       [#include <linux/spinlock.h>])
 
 # ---------  unsigned long long sane? -------
 
@@ -28,6 +32,9 @@ pkgexampledir='${prefix}/usr/lib/$(PACKAGE)/examples'
 AC_SUBST(pkgexampledir)
 pymoddir='${prefix}/usr/lib/${PACKAGE}/python/Lustre'
 AC_SUBST(pymoddir)
+# for substitution in lconf
+PYMOD_DIR="/usr/lib/$PACKAGE/python"
+AC_SUBST(PYMOD_DIR)
 modulenetdir='$(moduledir)/net/$(PACKAGE)'
 AC_SUBST(modulenetdir)
 
@@ -35,14 +42,15 @@ AC_SUBST(modulenetdir)
 # ----------  BAD gcc? ------------
 AC_PROG_RANLIB
 AC_PROG_CC
-AC_MSG_CHECKING(for buggy compiler)
+AC_MSG_CHECKING([for buggy compiler])
 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
 bad_cc() {
+       AC_MSG_RESULT([buggy compiler found!])
        echo
        echo "   '$CC_VERSION'"
        echo "  has been known to generate bad code, "
        echo "  please get an updated compiler."
-       AC_MSG_ERROR(sorry)
+       AC_MSG_ERROR([sorry])
 }
 TMP_VERSION=`echo $CC_VERSION | cut -c 1-16`
 if test "$TMP_VERSION" = "gcc version 2.95"; then
@@ -61,7 +69,7 @@ case "$CC_VERSION" in
                bad_cc
                ;;
        *)
-               AC_MSG_RESULT(no known problems)
+               AC_MSG_RESULT([no known problems])
                ;;
 esac
 # end ------  BAD gcc? ------------
@@ -70,29 +78,30 @@ esac
 
 # this doesn't seem to work on older autoconf
 # AC_CHECK_LIB(readline, readline,,)
-AC_ARG_ENABLE(readline,        [  --enable-readline  use readline library],,
-                       enable_readline="yes")
-if test "$enable_readline" = "yes" ; then
-   LIBREADLINE="-lreadline -lncurses"
-   HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
+AC_MSG_CHECKING([for readline support])
+AC_ARG_ENABLE(readline,
+       AC_HELP_STRING([--disable-readline],
+                       [do not use readline library]),
+       [],[enable_readline='yes'])
+AC_MSG_RESULT([$enable_readline]) 
+if test x$enable_readline = xyes ; then
+       LIBREADLINE="-lreadline -lncurses"
+       AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
 else 
-   LIBREADLINE=""
-   HAVE_LIBREADLINE=""
+       LIBREADLINE=""
 fi
 AC_SUBST(LIBREADLINE)
-AC_SUBST(HAVE_LIBREADLINE)
 
-AC_ARG_ENABLE(efence,  [  --enable-efence  use efence library],,
-                       enable_efence="no")
+AC_MSG_CHECKING([if efence debugging support is requested])
+AC_ARG_ENABLE(efence,
+       AC_HELP_STRING([--enable-efence],
+                       [use efence library]),
+       [],[enable_efence='no'])
+AC_MSG_RESULT([$enable_efence])
 if test "$enable_efence" = "yes" ; then
-   LIBEFENCE="-lefence"
-   HAVE_LIBEFENCE="-DHAVE_LIBEFENCE=1"
+       LIBEFENCE="-lefence"
+       AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
 else 
-   LIBEFENCE=""
-   HAVE_LIBEFENCE=""
+       LIBEFENCE=""
 fi
 AC_SUBST(LIBEFENCE)
-AC_SUBST(HAVE_LIBEFENCE)
-
index 9e7e7c2..c55dd37 100644 (file)
@@ -8,7 +8,7 @@
 #define PORTAL_DEBUG
 
 #ifndef offsetof
-# define offsetof(typ,memb)     ((int)((char *)&(((typ *)0)->memb)))
+# define offsetof(typ,memb)     ((unsigned long)((char *)&(((typ *)0)->memb)))
 #endif
 
 #define LOWEST_BIT_SET(x)       ((x) & ~((x) - 1))
@@ -301,6 +301,7 @@ extern void kportal_blockallsigs (void);
 #endif
 # include <unistd.h>
 # include <time.h>
+# include <limits.h>
 # include <asm/types.h>
 # ifndef DEBUG_SUBSYSTEM
 #  define DEBUG_SUBSYSTEM S_UNDEFINED
@@ -309,7 +310,12 @@ extern void kportal_blockallsigs (void);
 #  undef NDEBUG
 #  include <assert.h>
 #  define LASSERT(e)     assert(e)
-#  define LASSERTF(cond, args...)     assert(cond)
+#  define LASSERTF(cond, args...)                                              \
+do {                                                                           \
+          if (!(cond))                                                         \
+                CERROR(args);                                                  \
+          assert(cond);                                                        \
+} while (0)
 # else
 #  define LASSERT(e)
 #  define LASSERTF(cond, args...) do { } while (0)
@@ -317,6 +323,7 @@ extern void kportal_blockallsigs (void);
 # define printk(format, args...) printf (format, ## args)
 # define PORTAL_ALLOC(ptr, size) do { (ptr) = malloc(size); } while (0);
 # define PORTAL_FREE(a, b) do { free(a); } while (0);
+void portals_debug_dumplog(void);
 # define portals_debug_msg(subsys, mask, file, fn, line, stack, format, a...) \
     printf("%02x:%06x (@%lu %s:%s,l. %d %d %lu): " format,                    \
            (subsys), (mask), (long)time(0), file, fn, line,                   \
@@ -433,40 +440,6 @@ struct portals_device_userstate
  * USER LEVEL STUFF BELOW
  */
 
-#define PORTALS_CFG_VERSION 0x00010001;
-
-struct portals_cfg {
-        __u32 pcfg_version;
-        __u32 pcfg_command;
-
-        __u32 pcfg_nal;
-        __u32 pcfg_flags;
-
-        __u32 pcfg_gw_nal;
-        __u64 pcfg_nid;
-        __u64 pcfg_nid2;
-        __u64 pcfg_nid3;
-        __u32 pcfg_id;
-        __u32 pcfg_misc;
-        __u32 pcfg_fd;
-        __u32 pcfg_count;
-        __u32 pcfg_size;
-        __u32 pcfg_wait;
-
-        __u32 pcfg_plen1; /* buffers in userspace */
-        char *pcfg_pbuf1;
-        __u32 pcfg_plen2; /* buffers in userspace */
-        char *pcfg_pbuf2;
-};
-
-#define PCFG_INIT(pcfg, cmd)                            \
-do {                                                    \
-        memset(&pcfg, 0, sizeof(pcfg));                 \
-        pcfg.pcfg_version = PORTALS_CFG_VERSION;        \
-        pcfg.pcfg_command = (cmd);                      \
-                                                        \
-} while (0)
-
 #define PORTAL_IOCTL_VERSION 0x00010007
 #define PING_SYNC       0
 #define PING_ASYNC      1
@@ -672,21 +645,13 @@ enum {
         GMNAL     = 3,
         /*          4 unused */
         TCPNAL    = 5,
-        SCIMACNAL = 6,
-        ROUTER    = 7,
-        IBNAL     = 8,
+        ROUTER    = 6,
+        IBNAL     = 7,
+        CRAY_KB_ERNAL = 8,
         NAL_ENUM_END_MARKER
 };
 
-#ifdef __KERNEL__
-extern ptl_handle_ni_t  kqswnal_ni;
-extern ptl_handle_ni_t  ksocknal_ni;
-extern ptl_handle_ni_t  kgmnal_ni;
-extern ptl_handle_ni_t  kibnal_ni;
-extern ptl_handle_ni_t  kscimacnal_ni;
-#endif
-
-#define PTL_NALFMT_SIZE         16
+#define PTL_NALFMT_SIZE               26 /* %u:%u.%u.%u.%u (10+4+4+4+3+1) */
 
 #define NAL_MAX_NR (NAL_ENUM_END_MARKER - 1)
 
@@ -711,10 +676,6 @@ enum {
         DEBUG_DAEMON_CONTINUE    =  4,
 };
 
-/* module.c */
-typedef int (*nal_cmd_handler_t)(struct portals_cfg *, void * private);
-int kportal_nal_register(int nal, nal_cmd_handler_t handler, void * private);
-int kportal_nal_unregister(int nal);
 
 enum cfg_record_type {
         PORTALS_CFG_TYPE = 1,
@@ -722,10 +683,6 @@ enum cfg_record_type {
 };
 
 typedef int (*cfg_record_cb_t)(enum cfg_record_type, int len, void *data);
-int kportal_nal_cmd(struct portals_cfg *);
-
-ptl_handle_ni_t *kportal_get_ni (int nal);
-void kportal_put_ni (int nal);
 
 #ifdef __CYGWIN__
 # ifndef BITS_PER_LONG
@@ -737,6 +694,16 @@ void kportal_put_ni (int nal);
 # endif
 #endif
 
+#if BITS_PER_LONG > 32
+# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
+# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
+# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
+#else
+# define LI_POISON ((int)0x5a5a5a5a)
+# define LL_POISON ((long)0x5a5a5a5a)
+# define LP_POISON ((void *)(long)0x5a5a5a5a)
+#endif
+
 #if defined(__x86_64__)
 # define LPU64 "%Lu"
 # define LPD64 "%Ld"
index 45b58fe..51d2d2f 100644 (file)
@@ -81,21 +81,6 @@ typedef struct {
         void                    *kpr_arg;
 } kpr_router_t;
 
-/* Router's control interface (Kernel Portals Routing Control Interface) */
-typedef const struct {
-        int     (*kprci_add_route)(int gateway_nal, ptl_nid_t gateway_nid,
-                                   ptl_nid_t lo_nid, ptl_nid_t hi_nid);
-        int     (*kprci_del_route)(int gateway_nal, ptl_nid_t gateway_nid,
-                                   ptl_nid_t lo_nid, ptl_nid_t hi_nid);
-        int     (*kprci_get_route)(int index, int *gateway_nal,
-                                   ptl_nid_t *gateway,
-                                   ptl_nid_t *lo_nid, ptl_nid_t *hi_nid,
-                                   int *alive);
-        int     (*kprci_notify)(int gateway_nal, ptl_nid_t gateway_nid,
-                                int alive, time_t when);
-} kpr_control_interface_t;
-
-extern kpr_control_interface_t  kpr_control_interface;
 extern kpr_router_interface_t   kpr_router_interface;
 
 static inline int
index 3ebf935..c2a15f4 100644 (file)
@@ -6,8 +6,43 @@
 
 #define PORTAL_DEBUG
 
+/* I think this beast is just trying to get cycles_t and get_cycles().
+ * this should be in its own header. */
+#ifdef __linux__
+# include <asm/types.h>
+# if defined(__powerpc__) && !defined(__KERNEL__)
+#  define __KERNEL__
+#  include <asm/timex.h>
+#  undef __KERNEL__
+# else
+#  if defined(__KERNEL__)
+#   include <asm/timex.h>
+#  else
+#   include <sys/time.h>
+#   define cycles_t unsigned long
+static inline cycles_t get_cycles(void) 
+{
+        struct timeval tv;
+        gettimeofday(&tv, NULL);
+        return (tv.tv_sec * 100000) + tv.tv_usec;
+}
+#  endif
+# endif
+#else
+# include <sys/types.h>
+typedef u_int32_t __u32;
+typedef u_int64_t __u64;
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+#endif
+
 #ifndef offsetof
-# define offsetof(typ,memb)     ((int)((char *)&(((typ *)0)->memb)))
+# define offsetof(typ,memb)     ((unsigned long)((char *)&(((typ *)0)->memb)))
 #endif
 
 #define LOWEST_BIT_SET(x)       ((x) & ~((x) - 1))
@@ -45,7 +80,8 @@ extern unsigned int portal_cerror;
 #define S_COBD        0x00200000
 #define S_IBNAL       0x00400000
 #define S_LMV         0x00800000
-
+#define S_SM          0x01000000
+#define S_CMOBD       0x02000000
 /* If you change these values, please keep portals/utils/debug.c
  * up to date! */
 
@@ -165,6 +201,45 @@ do {                                                                    \
 #define EXIT                            do { } while (0)
 #endif
 
+#define PORTALS_CFG_VERSION 0x00010001;
+
+struct portals_cfg {
+        __u32 pcfg_version;
+        __u32 pcfg_command;
+
+        __u32 pcfg_nal;
+        __u32 pcfg_flags;
+
+        __u32 pcfg_gw_nal;
+        __u64 pcfg_nid;
+        __u64 pcfg_nid2;
+        __u64 pcfg_nid3;
+        __u32 pcfg_id;
+        __u32 pcfg_misc;
+        __u32 pcfg_fd;
+        __u32 pcfg_count;
+        __u32 pcfg_size;
+        __u32 pcfg_wait;
+
+        __u32 pcfg_plen1; /* buffers in userspace */
+        char *pcfg_pbuf1;
+        __u32 pcfg_plen2; /* buffers in userspace */
+        char *pcfg_pbuf2;
+};
+
+#define PCFG_INIT(pcfg, cmd)                            \
+do {                                                    \
+        memset(&pcfg, 0, sizeof(pcfg));                 \
+        pcfg.pcfg_version = PORTALS_CFG_VERSION;        \
+        pcfg.pcfg_command = (cmd);                      \
+                                                        \
+} while (0)
+
+typedef int (nal_cmd_handler_fn)(struct portals_cfg *, void *);
+int libcfs_nal_cmd_register(int nal, nal_cmd_handler_fn *handler, void *arg);
+int libcfs_nal_cmd(struct portals_cfg *pcfg);
+void libcfs_nal_cmd_unregister(int nal);
+
 struct portal_ioctl_data {
         __u32 ioc_len;
         __u32 ioc_version;
@@ -197,6 +272,7 @@ struct portal_ioctl_data {
         char ioc_bulk[0];
 };
 
+
 #ifdef __KERNEL__
 
 #include <linux/list.h>
index 4361858..9ab4020 100644 (file)
@@ -40,6 +40,9 @@
 # define RECALC_SIGPENDING         recalc_sigpending()
 # define CURRENT_SECONDS           CURRENT_TIME
 
+# define kernel_text_address(addr) is_kernel_text_address(addr)
+extern int is_kernel_text_address(unsigned long addr);
+
 #else /* 2.4.x */
 
 # define SIGNAL_MASK_LOCK(task, flags)                                  \
 # define RECALC_SIGPENDING         recalc_sigpending(current)
 # define CURRENT_SECONDS           CURRENT_TIME
 
+# define kernel_text_address(addr) is_kernel_text_address(addr)
+extern int is_kernel_text_address(unsigned long addr);
+
 #endif
 
 #if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20))
-# define THREAD_NAME(comm, fmt, a...)                                   \
-        sprintf(comm, fmt "|%d", ## a, current->thread.extern_pid)
+# define THREAD_NAME(comm, len, fmt, a...)                              \
+        snprintf(comm, len, fmt "|%d", ## a, current->thread.extern_pid)
 #elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-# define THREAD_NAME(comm, fmt, a...)                                   \
-        sprintf(comm, fmt "|%d", ## a, current->thread.mode.tt.extern_pid)
+# define THREAD_NAME(comm, len, fmt, a...)                              \
+        snprintf(comm, len,fmt"|%d", ## a,current->thread.mode.tt.extern_pid)
+#else
+# define THREAD_NAME(comm, len, fmt, a...)                              \
+        snprintf(comm, len, fmt, ## a)
+#endif
+
+#ifdef HAVE_PAGE_LIST
+/* 2.4 alloc_page users can use page->list */
+#define PAGE_LIST_ENTRY list
+#define PAGE_LIST(page) ((page)->list)
 #else
-# define THREAD_NAME(comm, fmt, a...)                                   \
-        sprintf(comm, fmt, ## a)
+/* 2.6 alloc_page users can use page->lru */
+#define PAGE_LIST_ENTRY lru
+#define PAGE_LIST(page) ((page)->lru)
 #endif
 
 #endif /* _PORTALS_COMPAT_H */
diff --git a/lnet/include/lnet/Makefile.am b/lnet/include/lnet/Makefile.am
deleted file mode 100644 (file)
index c61b084..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (C) 2001  Cluster File Systems, Inc.
-#
-# This code is issued under the GNU General Public License.
-# See the file COPYING in this distribution
-
-SUBDIRS = base
-include $(top_srcdir)/Rules
-
-pkginclude_HEADERS=api-support.h api.h arg-blocks.h defines.h errno.h internal.h lib-dispatch.h lib-nal.h lib-p30.h lib-types.h myrnal.h nal.h p30.h ppid.h ptlctl.h stringtab.h types.h nalids.h list.h bridge.h ipmap.h procbridge.h lltrace.h
-
index db83ae7..cfae78c 100644 (file)
@@ -1,5 +1,3 @@
-# define DEBUG_SUBSYSTEM S_PORTALS
-# define PORTAL_DEBUG
 
 #include "build_check.h"
 
index 69fa339..6d382bb 100644 (file)
@@ -9,9 +9,9 @@
 int PtlInit(int *);
 void PtlFini(void);
 
-int PtlNIInit(ptl_interface_t interface, ptl_pt_index_t ptl_size_in,
-              ptl_ac_index_t acl_size_in, ptl_pid_t requested_pid,
-              ptl_handle_ni_t * interface_out);
+int PtlNIInit(ptl_interface_t interface, ptl_pid_t requested_pid,
+             ptl_ni_limits_t *desired_limits, ptl_ni_limits_t *actual_limits,
+              ptl_handle_ni_t *interface_out);
 
 int PtlNIInitialized(ptl_interface_t);
 
@@ -37,17 +37,6 @@ int PtlNIHandle(ptl_handle_any_t handle_in, ptl_handle_ni_t * interface_out);
 #endif
 
 
-/*
- * PtlNIDebug: 
- *
- * This is not an official Portals 3 API call.  It is provided
- * by the reference implementation to allow the maintainers an
- * easy way to turn on and off debugging information in the
- * library.  Do not use it in code that is not intended for use
- * with any version other than the portable reference library.
- */
-unsigned int PtlNIDebug(ptl_handle_ni_t ni, unsigned int mask_in);
-
 /* 
  * PtlNIFailNid
  *
@@ -123,8 +112,8 @@ int PtlMDUpdate_internal(ptl_handle_md_t md_in, ptl_md_t * old_inout,
 
 /* These should be called by users */
 int PtlEQAlloc(ptl_handle_ni_t ni_in, ptl_size_t count_in,
-               int (*callback) (ptl_event_t * event),
-               ptl_handle_eq_t * handle_out);
+               ptl_eq_handler_t handler,
+               ptl_handle_eq_t *handle_out);
 int PtlEQFree(ptl_handle_eq_t eventq_in);
 
 int PtlEQCount(ptl_handle_eq_t eventq_in, ptl_size_t * count_out);
index 0be8a3d..21e30d5 100644 (file)
@@ -18,7 +18,7 @@
 #define PTL_GETID     1
 #define PTL_NISTATUS  2
 #define PTL_NIDIST    3
-#define PTL_NIDEBUG   4
+// #define PTL_NIDEBUG   4
 #define PTL_MEATTACH  5
 #define PTL_MEINSERT  6
 // #define PTL_MEPREPEND 7
@@ -205,7 +205,7 @@ typedef struct PtlEQAlloc_in {
         ptl_size_t count_in;
         void *base_in;
         int len_in;
-        int (*callback_in) (ptl_event_t * event);
+        ptl_eq_handler_t callback_in;
 } PtlEQAlloc_in;
 
 typedef struct PtlEQAlloc_out {
index 499f32b..a98bfd9 100644 (file)
@@ -37,12 +37,11 @@ typedef enum {
         PTL_MD_NO_UPDATE       = 18,
         PTL_FAIL               = 19,
 
-        PTL_IOV_TOO_MANY       = 20,
-        PTL_IOV_TOO_SMALL      = 21,
+        PTL_IOV_INVALID        = 20,
 
-       PTL_EQ_IN_USE           = 22,
+       PTL_EQ_IN_USE           = 21,
 
-        PTL_MAX_ERRNO          = 23
+        PTL_MAX_ERRNO          = 22
 } ptl_err_t;
 /* If you change these, you must update the string table in api-errno.c */
 
index 94f4f48..25778e4 100644 (file)
 
 #include <portals/p30.h>
 
-extern int ptl_init;           /* Has the library be initialized */
+extern int ptl_init;           /* Has the library been initialized */
 
 extern int ptl_ni_init(void);
-extern int ptl_me_init(void);
-extern int ptl_md_init(void);
-extern int ptl_eq_init(void);
-
-extern int ptl_me_ni_init(nal_t * nal);
-extern int ptl_md_ni_init(nal_t * nal);
-extern int ptl_eq_ni_init(nal_t * nal);
-
 extern void ptl_ni_fini(void);
-extern void ptl_me_fini(void);
-extern void ptl_md_fini(void);
-extern void ptl_eq_fini(void);
-
-extern void ptl_me_ni_fini(nal_t * nal);
-extern void ptl_md_ni_fini(nal_t * nal);
-extern void ptl_eq_ni_fini(nal_t * nal);
 
 static inline ptl_eq_t *
 ptl_handle2usereq (ptl_handle_eq_t *handle)
index 90ed4f5..610c776 100644 (file)
@@ -18,7 +18,6 @@
 extern int do_PtlGetId(nal_cb_t * nal, void *private, void *args, void *ret);
 extern int do_PtlNIStatus(nal_cb_t * nal, void *private, void *args, void *ret);
 extern int do_PtlNIDist(nal_cb_t * nal, void *private, void *args, void *ret);
-extern int do_PtlNIDebug(nal_cb_t * nal, void *private, void *args, void *ret);
 extern int do_PtlMEAttach(nal_cb_t * nal, void *private, void *args, void *ret);
 extern int do_PtlMEInsert(nal_cb_t * nal, void *private, void *args, void *ret);
 extern int do_PtlMEPrepend(nal_cb_t * nal, void *private, void *args,
index 350447e..efa929c 100644 (file)
@@ -194,11 +194,11 @@ lib_md_alloc (nal_cb_t *nal, ptl_md_t *umd)
         int       niov;
 
         if ((umd->options & PTL_MD_KIOV) != 0) {
-                niov = umd->niov;
+                niov = umd->length;
                 size = offsetof(lib_md_t, md_iov.kiov[niov]);
         } else {
                 niov = ((umd->options & PTL_MD_IOVEC) != 0) ?
-                       umd->niov : 1;
+                       umd->length : 1;
                 size = offsetof(lib_md_t, md_iov.iov[niov]);
         }
 
@@ -346,8 +346,9 @@ ptl_handle2me (ptl_handle_me_t *handle, nal_cb_t *nal)
         return (lh_entry (lh, lib_me_t, me_lh));
 }
 
-extern int lib_init(nal_cb_t * cb, ptl_nid_t nid, ptl_pid_t pid, int gsize,
-                    ptl_pt_index_t tbl_size, ptl_ac_index_t ac_size);
+extern int lib_init(nal_cb_t *cb, ptl_process_id_t pid,
+                    ptl_ni_limits_t *desired_limits, 
+                    ptl_ni_limits_t *actual_limits);
 extern int lib_fini(nal_cb_t * cb);
 extern void lib_dispatch(nal_cb_t * cb, void *private, int index,
                          void *arg_block, void *ret_block);
index 350447e..efa929c 100644 (file)
@@ -194,11 +194,11 @@ lib_md_alloc (nal_cb_t *nal, ptl_md_t *umd)
         int       niov;
 
         if ((umd->options & PTL_MD_KIOV) != 0) {
-                niov = umd->niov;
+                niov = umd->length;
                 size = offsetof(lib_md_t, md_iov.kiov[niov]);
         } else {
                 niov = ((umd->options & PTL_MD_IOVEC) != 0) ?
-                       umd->niov : 1;
+                       umd->length : 1;
                 size = offsetof(lib_md_t, md_iov.iov[niov]);
         }
 
@@ -346,8 +346,9 @@ ptl_handle2me (ptl_handle_me_t *handle, nal_cb_t *nal)
         return (lh_entry (lh, lib_me_t, me_lh));
 }
 
-extern int lib_init(nal_cb_t * cb, ptl_nid_t nid, ptl_pid_t pid, int gsize,
-                    ptl_pt_index_t tbl_size, ptl_ac_index_t ac_size);
+extern int lib_init(nal_cb_t *cb, ptl_process_id_t pid,
+                    ptl_ni_limits_t *desired_limits, 
+                    ptl_ni_limits_t *actual_limits);
 extern int lib_fini(nal_cb_t * cb);
 extern void lib_dispatch(nal_cb_t * cb, void *private, int index,
                          void *arg_block, void *ret_block);
index 40776a6..ef618c7 100644 (file)
@@ -169,7 +169,7 @@ struct lib_eq_t {
         ptl_size_t        size;
         ptl_event_t      *base;
         int               eq_refcount;
-        int (*event_callback) (ptl_event_t * event);
+        ptl_eq_handler_t  event_callback;
         void             *eq_addrkey;
 };
 
@@ -245,15 +245,11 @@ typedef struct {
  * extracted by masking with (PTL_COOKIE_TYPES - 1) */
 
 typedef struct {
-        int up;
-        int refcnt;
         ptl_nid_t nid;
         ptl_pid_t pid;
-        int num_nodes;
-        unsigned int debug;
         lib_ptl_t tbl;
-        lib_ac_t ac;
         lib_counters_t counters;
+        ptl_ni_limits_t actual_limits;
 
         int               ni_lh_hash_size;      /* size of lib handle hash table */
         struct list_head *ni_lh_hash_table;     /* all extant lib handles, this interface */
index 577ffab..4b8631d 100644 (file)
 #endif
 
 #include <portals/types.h>
-#include <portals/nal.h>
 #include <portals/api.h>
-#include <portals/nalids.h>
-
-/*
- * Debugging flags reserved for the Portals reference library.
- * These are not part of the API as described in the SAND report
- * but are for the use of the maintainers of the reference implementation.
- *
- * It is not expected that the real implementations will export
- * this functionality.
- */
-#define PTL_DEBUG_NONE          0ul
-#define PTL_DEBUG_ALL           (0x0FFFul)     /* Only the Portals flags */
-
-#define __bit(x)                ((unsigned long) 1<<(x))
-#define PTL_DEBUG_PUT           __bit(0)
-#define PTL_DEBUG_GET           __bit(1)
-#define PTL_DEBUG_REPLY         __bit(2)
-#define PTL_DEBUG_ACK           __bit(3)
-#define PTL_DEBUG_DROP          __bit(4)
-#define PTL_DEBUG_REQUEST       __bit(5)
-#define PTL_DEBUG_DELIVERY      __bit(6)
-#define PTL_DEBUG_UNLINK        __bit(7)
-#define PTL_DEBUG_THRESHOLD     __bit(8)
-#define PTL_DEBUG_API           __bit(9)
-
-/*
- * These eight are reserved for the NAL to define
- * It should probably give them better names...
- */
-#define PTL_DEBUG_NI_ALL        (0xF000ul)     /* Only the NAL flags */
-#define PTL_DEBUG_NI0           __bit(24)
-#define PTL_DEBUG_NI1           __bit(25)
-#define PTL_DEBUG_NI2           __bit(26)
-#define PTL_DEBUG_NI3           __bit(27)
-#define PTL_DEBUG_NI4           __bit(28)
-#define PTL_DEBUG_NI5           __bit(29)
-#define PTL_DEBUG_NI6           __bit(30)
-#define PTL_DEBUG_NI7           __bit(31)
 
 #endif
index 12ef47a..2af336e 100644 (file)
 #ifndef _PTLCTL_H_
 #define _PTLCTL_H_
 
+#include <portals/types.h>
+#include <linux/kp30.h>
+#include <linux/libcfs.h>
+
 #define PORTALS_DEV_ID 0
 #define PORTALS_DEV_PATH "/dev/portals"
 #define OBD_DEV_ID 1
@@ -76,13 +80,15 @@ int jt_dbg_panic(int argc, char **argv);
 int ptl_set_cfg_record_cb(cfg_record_cb_t cb);
 
 /* l_ioctl.c */
-typedef int (ioc_handler_t)(int dev_id, int opc, void *buf);
+typedef int (ioc_handler_t)(int dev_id, unsigned int opc, void *buf);
 void set_ioc_handler(ioc_handler_t *handler);
 int register_ioc_dev(int dev_id, const char * dev_name);
 void unregister_ioc_dev(int dev_id);
 int set_ioctl_dump(char * file);
-int l_ioctl(int dev_id, int opc, void *buf);
-int parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *));
+int l_ioctl(int dev_id, unsigned int opc, void *buf);
+int parse_dump(char * dump_file, ioc_handler_t ioc_func);
 int jt_ioc_dump(int argc, char **argv);
+extern char *dump_filename;
+int dump(int dev_id, unsigned int opc, void *buf);
 
 #endif
index 5b72046..1f925c1 100644 (file)
 typedef struct nal_t nal_t;
 
 struct nal_t {
-       ptl_ni_t ni;
-       int refct;
-       void *nal_data;
-       int *timeout;           /* for libp30api users */
-       int (*forward) (nal_t * nal, int index, /* Function ID */
-                       void *args, size_t arg_len, void *ret, size_t ret_len);
+       int              nal_refct;
+       void            *nal_data;
 
-       int (*shutdown) (nal_t * nal, int interface);
+       int (*startup) (nal_t *nal, ptl_pid_t requested_pid,
+                       ptl_ni_limits_t *req, ptl_ni_limits_t *actual);
+       
+       void (*shutdown) (nal_t *nal);
 
-       int (*validate) (nal_t * nal, void *base, size_t extent);
+       int (*forward) (nal_t *nal, int index,  /* Function ID */
+                       void *args, size_t arg_len, void *ret, size_t ret_len);
 
-       int (*yield) (nal_t * nal, unsigned long *flags, int milliseconds);
+       int (*yield) (nal_t *nal, unsigned long *flags, int milliseconds);
 
-       void (*lock) (nal_t * nal, unsigned long *flags);
+       void (*lock) (nal_t *nal, unsigned long *flags);
 
-       void (*unlock) (nal_t * nal, unsigned long *flags);
+       void (*unlock) (nal_t *nal, unsigned long *flags);
 };
 
-typedef nal_t *(ptl_interface_t) (int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t requested_pid);
-extern nal_t *PTL_IFACE_IP(int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t requested_pid);
-extern nal_t *PTL_IFACE_MYR(int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t requested_pid);
-
 extern nal_t *ptl_hndl2nal(ptl_handle_any_t * any);
 
-#ifndef PTL_IFACE_DEFAULT
-#define PTL_IFACE_DEFAULT (PTL_IFACE_IP)
+#ifdef __KERNEL__
+extern int ptl_register_nal(ptl_interface_t interface, nal_t *nal);
+extern void ptl_unregister_nal(ptl_interface_t interface);
 #endif
 
 #endif
index 1568593..55a991b 100644 (file)
@@ -1,6 +1,2 @@
 #include "build_check.h"
 
-#define PTL_IFACE_TCP 1
-#define PTL_IFACE_ER 2
-#define PTL_IFACE_SS 3
-#define PTL_IFACE_MAX 4
index 577ffab..4b8631d 100644 (file)
 #endif
 
 #include <portals/types.h>
-#include <portals/nal.h>
 #include <portals/api.h>
-#include <portals/nalids.h>
-
-/*
- * Debugging flags reserved for the Portals reference library.
- * These are not part of the API as described in the SAND report
- * but are for the use of the maintainers of the reference implementation.
- *
- * It is not expected that the real implementations will export
- * this functionality.
- */
-#define PTL_DEBUG_NONE          0ul
-#define PTL_DEBUG_ALL           (0x0FFFul)     /* Only the Portals flags */
-
-#define __bit(x)                ((unsigned long) 1<<(x))
-#define PTL_DEBUG_PUT           __bit(0)
-#define PTL_DEBUG_GET           __bit(1)
-#define PTL_DEBUG_REPLY         __bit(2)
-#define PTL_DEBUG_ACK           __bit(3)
-#define PTL_DEBUG_DROP          __bit(4)
-#define PTL_DEBUG_REQUEST       __bit(5)
-#define PTL_DEBUG_DELIVERY      __bit(6)
-#define PTL_DEBUG_UNLINK        __bit(7)
-#define PTL_DEBUG_THRESHOLD     __bit(8)
-#define PTL_DEBUG_API           __bit(9)
-
-/*
- * These eight are reserved for the NAL to define
- * It should probably give them better names...
- */
-#define PTL_DEBUG_NI_ALL        (0xF000ul)     /* Only the NAL flags */
-#define PTL_DEBUG_NI0           __bit(24)
-#define PTL_DEBUG_NI1           __bit(25)
-#define PTL_DEBUG_NI2           __bit(26)
-#define PTL_DEBUG_NI3           __bit(27)
-#define PTL_DEBUG_NI4           __bit(28)
-#define PTL_DEBUG_NI5           __bit(29)
-#define PTL_DEBUG_NI6           __bit(30)
-#define PTL_DEBUG_NI7           __bit(31)
 
 #endif
index 12ef47a..2af336e 100644 (file)
 #ifndef _PTLCTL_H_
 #define _PTLCTL_H_
 
+#include <portals/types.h>
+#include <linux/kp30.h>
+#include <linux/libcfs.h>
+
 #define PORTALS_DEV_ID 0
 #define PORTALS_DEV_PATH "/dev/portals"
 #define OBD_DEV_ID 1
@@ -76,13 +80,15 @@ int jt_dbg_panic(int argc, char **argv);
 int ptl_set_cfg_record_cb(cfg_record_cb_t cb);
 
 /* l_ioctl.c */
-typedef int (ioc_handler_t)(int dev_id, int opc, void *buf);
+typedef int (ioc_handler_t)(int dev_id, unsigned int opc, void *buf);
 void set_ioc_handler(ioc_handler_t *handler);
 int register_ioc_dev(int dev_id, const char * dev_name);
 void unregister_ioc_dev(int dev_id);
 int set_ioctl_dump(char * file);
-int l_ioctl(int dev_id, int opc, void *buf);
-int parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *));
+int l_ioctl(int dev_id, unsigned int opc, void *buf);
+int parse_dump(char * dump_file, ioc_handler_t ioc_func);
 int jt_ioc_dump(int argc, char **argv);
+extern char *dump_filename;
+int dump(int dev_id, unsigned int opc, void *buf);
 
 #endif
index 902db76..ef2712b 100644 (file)
@@ -3,28 +3,7 @@
 
 #include "build_check.h"
 
-#ifdef __linux__
-# include <asm/types.h>
-# if defined(__powerpc__) && !defined(__KERNEL__)
-#  define __KERNEL__
-#  include <asm/timex.h>
-#  undef __KERNEL__
-# else
-#  include <asm/timex.h>
-# endif
-#else
-# include <sys/types.h>
-typedef u_int32_t __u32;
-typedef u_int64_t __u64;
-#endif
-
-#ifdef __KERNEL__
-# include <linux/time.h>
-#else
-# include <sys/time.h>
-# define do_gettimeofday(tv) gettimeofday(tv, NULL);
-#endif
-
+#include <linux/libcfs.h>
 #include <portals/errno.h>
 
 /* This implementation uses the same type for API function return codes and
@@ -41,7 +20,6 @@ typedef __u64 ptl_hdr_data_t;
 typedef __u32 ptl_size_t;
 
 #define PTL_TIME_FOREVER    (-1)
-#define PTL_EQ_HANDLER_NONE NULL
 
 typedef struct {
         unsigned long nal_idx;                 /* which network interface */
@@ -81,12 +59,6 @@ typedef enum {
 } ptl_ins_pos_t;
 
 typedef struct {
-       struct page     *kiov_page;
-       unsigned int     kiov_len;
-       unsigned int     kiov_offset;
-} ptl_kiov_t;
-
-typedef struct {
         void            *start;
         ptl_size_t       length;
         int              threshold;
@@ -94,7 +66,6 @@ typedef struct {
         unsigned int     options;
         void            *user_ptr;
         ptl_handle_eq_t  eventq;
-       unsigned int     niov;
 } ptl_md_t;
 
 /* Options for the MD structure */
@@ -112,9 +83,19 @@ typedef struct {
 
 /* For compatibility with Cray Portals */
 #define PTL_MD_LUSTRE_COMPLETION_SEMANTICS  0
+#define PTL_MD_PHYS                         0
 
 #define PTL_MD_THRESH_INF       (-1)
 
+/* NB lustre portals uses struct iovec internally! */
+typedef struct iovec ptl_md_iovec_t;
+
+typedef struct {
+       struct page     *kiov_page;
+       unsigned int     kiov_len;
+       unsigned int     kiov_offset;
+} ptl_kiov_t;
+
 typedef enum {
         PTL_EVENT_GET_START,
         PTL_EVENT_GET_END,
@@ -168,6 +149,9 @@ typedef enum {
         PTL_NOACK_REQ
 } ptl_ack_req_t;
 
+typedef void (*ptl_eq_handler_t)(ptl_event_t *event);
+#define PTL_EQ_HANDLER_NONE NULL
+
 typedef struct {
         volatile ptl_seq_t sequence;
         ptl_size_t size;
@@ -180,11 +164,14 @@ typedef struct {
 } ptl_ni_t;
 
 typedef struct {
-        int max_match_entries;    /* max number of match entries */
-        int max_mem_descriptors;  /* max number of memory descriptors */
-        int max_event_queues;     /* max number of event queues */
-        int max_atable_index;     /* maximum access control list table index */
-        int max_ptable_index;     /* maximum portals table index */
+       int max_mes;
+       int max_mds;
+       int max_eqs;
+       int max_ac_index;
+       int max_pt_index;
+       int max_md_iovecs;
+       int max_me_list;
+       int max_getput_md;
 } ptl_ni_limits_t;
 
 /*
@@ -202,4 +189,7 @@ typedef enum {
 
 typedef int ptl_sr_value_t;
 
+typedef int ptl_interface_t;
+#define PTL_IFACE_DEFAULT    (-1)
+
 #endif
index 89a4aa6..f5fd0b0 100644 (file)
@@ -1,3 +1,5 @@
 Makefile
-Makefile.in
-.*.o.cmd
+autoMakefile
+autoMakefile.in
+.*.cmd
+.depend
diff --git a/lnet/klnds/Makefile.in b/lnet/klnds/Makefile.in
new file mode 100644 (file)
index 0000000..b5ed168
--- /dev/null
@@ -0,0 +1,6 @@
+@BUILD_GMNAL_TRUE@subdir-m += gmnal
+@BUILD_IBNAL_TRUE@subdir-m += ibnal
+@BUILD_QSWNAL_TRUE@subdir-m += qswnal
+subdir-m += socknal
+
+@INCLUDE_RULES@
similarity index 66%
rename from lnet/include/Makefile.am
rename to lnet/klnds/autoMakefile.am
index 2cf7f99..9d04a46 100644 (file)
@@ -3,6 +3,4 @@
 # This code is issued under the GNU General Public License.
 # See the file COPYING in this distribution
 
-SUBDIRS = portals linux
-EXTRA_DIST = config.h.in
-include $(top_srcdir)/Rules
+SUBDIRS = gmnal ibnal qswnal socknal
index e995588..642e2e6 100644 (file)
@@ -1,3 +1,10 @@
 .deps
 Makefile
-Makefile.in
+autoMakefile.in
+autoMakefile
+*.ko
+*.mod.c
+.*.cmd
+.*.flags
+.tmp_versions
+.depend
diff --git a/lnet/klnds/gmlnd/Makefile.am b/lnet/klnds/gmlnd/Makefile.am
deleted file mode 100644 (file)
index bac4680..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (C) 2001  Cluster File Systems, Inc.
-#
-# This code is issued under the GNU General Public License.
-# See the file COPYING in this distribution
-
-include ../../Rules.linux
-
-MODULE = kgmnal
-modulenet_DATA = kgmnal.o
-EXTRA_PROGRAMS = kgmnal
-
-DEFS = -DGM_KERNEL
-kgmnal_SOURCES = gmnal.h gmnal_api.c gmnal_cb.c gmnal_comm.c gmnal_utils.c gmnal_module.c
diff --git a/lnet/klnds/gmlnd/Makefile.in b/lnet/klnds/gmlnd/Makefile.in
new file mode 100644 (file)
index 0000000..89ea361
--- /dev/null
@@ -0,0 +1,6 @@
+MODULES := kgmnal
+kgmnal-objs := gmnal_api.o gmnal_cb.o gmnal_comm.o gmnal_utils.o gmnal_module.o
+
+EXTRA_PRE_CFLAGS := @GMCPPFLAGS@
+
+@INCLUDE_RULES@
diff --git a/lnet/klnds/gmlnd/autoMakefile.am b/lnet/klnds/gmlnd/autoMakefile.am
new file mode 100644 (file)
index 0000000..d8b9edb
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright (C) 2001  Cluster File Systems, Inc.
+#
+# This code is issued under the GNU General Public License.
+# See the file COPYING in this distribution
+
+if MODULES
+if BUILD_GMNAL
+if !CRAY_PORTALS
+modulenet_DATA = kgmnal$(KMODEXT)
+endif
+endif
+endif
+
+MOSTLYCLEANFILES = *.o *.ko *.mod.c
+DIST_SOURCES = $(kgmnal-objs:%.o=%.c) gmnal.h
index 9955599..e48552e 100644 (file)
@@ -190,7 +190,6 @@ typedef struct _gmnal_rxtwe {
 #define NRXTHREADS 10 /* max number of receiver threads */
 
 typedef struct _gmnal_data_t {
-       int             refcnt;
        spinlock_t      cb_lock;
        spinlock_t      stxd_lock;
        struct semaphore stxd_token;
@@ -309,9 +308,12 @@ extern gmnal_data_t        *global_nal_data;
 /*
  *     API NAL
  */
+int gmnal_api_startup(nal_t *, ptl_pid_t, 
+                      ptl_ni_limits_t *, ptl_ni_limits_t *);
+
 int gmnal_api_forward(nal_t *, int, void *, size_t, void *, size_t);
 
-int gmnal_api_shutdown(nal_t *, int);
+void gmnal_api_shutdown(nal_t *);
 
 int gmnal_api_validate(nal_t *, void *, size_t);
 
@@ -323,14 +325,13 @@ void gmnal_api_unlock(nal_t *, unsigned long *);
 
 
 #define GMNAL_INIT_NAL(a)      do {    \
+                                a->startup = gmnal_api_startup; \
                                a->forward = gmnal_api_forward; \
                                a->shutdown = gmnal_api_shutdown; \
-                               a->validate = NULL; \
                                a->yield = gmnal_api_yield; \
                                a->lock = gmnal_api_lock; \
                                a->unlock = gmnal_api_unlock; \
                                a->timeout = NULL; \
-                               a->refct = 1; \
                                a->nal_data = NULL; \
                                } while (0)
 
@@ -373,7 +374,7 @@ void gmnal_cb_sti(nal_cb_t *, unsigned long *);
 
 int gmnal_cb_dist(nal_cb_t *, ptl_nid_t, unsigned long *);
 
-nal_t *gmnal_init(int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t rpid);
+int gmnal_init(void);
 
 void  gmnal_fini(void);
 
index 338d75c..7c94f93 100644 (file)
@@ -123,18 +123,51 @@ gmnal_api_forward(nal_t *nal, int index, void *args, size_t arg_len,
 
 /*
  *     gmnal_api_shutdown
+ *      nal_refct == 0 => called on last matching PtlNIFini()
  *     Close down this interface and free any resources associated with it
  *     nal_t   nal     our nal to shutdown
  */
-int
+void
 gmnal_api_shutdown(nal_t *nal, int interface)
 {
+       gmnal_data_t    *nal_data;
+       nal_cb_t        *nal_cb;
 
-       gmnal_data_t    *nal_data = nal->nal_data;
-
+        if (nal->nal_refct != 0)
+                return;
+        
        CDEBUG(D_TRACE, "gmnal_api_shutdown: nal_data [%p]\n", nal_data);
 
-       return(PTL_OK);
+        LASSERT(nal == global_nal_data->nal);
+        nal_data = nal->nal_data;
+        LASSERT(nal_data == global_nal_data);
+        nal_cb = nal_data->nal_cb;
+
+        /* Stop portals calling our ioctl handler */
+        libcfs_nal_cmd_unregister(GMNAL);
+
+        /* XXX for shutdown "under fire" we probably need to set a shutdown
+         * flag so when lib calls us we fail immediately and dont queue any
+         * more work but our threads can still call into lib OK.  THEN
+         * shutdown our threads, THEN lib_fini() */
+        lib_fini(nal_cb);
+
+       gmnal_stop_rxthread(nal_data);
+       gmnal_stop_ctthread(nal_data);
+       gmnal_free_txd(nal_data);
+       gmnal_free_srxd(nal_data);
+       GMNAL_GM_LOCK(nal_data);
+       gm_close(nal_data->gm_port);
+       gm_finalize();
+       GMNAL_GM_UNLOCK(nal_data);
+        if (nal_data->sysctl)
+                unregister_sysctl_table (nal_data->sysctl);
+       PORTAL_FREE(nal, sizeof(nal_t));        
+       PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
+       PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
+
+        global_nal_data = NULL;
+        PORTAL_MODULE_UNUSE;
 }
 
 
@@ -210,57 +243,54 @@ gmnal_api_unlock(nal_t *nal, unsigned long *flags)
 }
 
 
-nal_t *
-gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size, 
-           ptl_pid_t rpid)
+int
+gmnal_api_startup(nal_t *nal, ptl_pid_t requested_pid,
+                  ptl_ni_limits_t *requested_limits,
+                  ptl_ni_limits_t *actual_limits)
 {
 
-       nal_t           *nal = NULL;
        nal_cb_t        *nal_cb = NULL;
        gmnal_data_t    *nal_data = NULL;
        gmnal_srxd_t    *srxd = NULL;
        gm_status_t     gm_status;
        unsigned int    local_nid = 0, global_nid = 0;
-       ptl_nid_t       portals_nid;
-       ptl_pid_t       portals_pid = 0;
+        ptl_process_id_t process_id;
+
+        if (nal->nal_refct != 0) {
+                if (actual_limits != NULL) {
+                        nal_data = (gmnal_data_t *)nal->nal_data;
+                        nal_cb = nal_data->nal_cb;
+                        *actual_limits = nal->_cb->ni.actual_limits;
+                return (PTL_OK);
+        }
 
+        /* Called on first PtlNIInit() */
 
-       CDEBUG(D_TRACE, "gmnal_init : interface [%d], ptl_size [%d], "
-              "ac_size[%d]\n", interface, ptl_size, ac_size);
+       CDEBUG(D_TRACE, "startup\n");
 
+        LASSERT(global_nal_data == NULL);
 
        PORTAL_ALLOC(nal_data, sizeof(gmnal_data_t));
        if (!nal_data) {
                CDEBUG(D_ERROR, "can't get memory\n");
-               return(NULL);
+               return(PTL_NO_SPACE);
        }       
        memset(nal_data, 0, sizeof(gmnal_data_t));
        /*
         *      set the small message buffer size 
         */
-       nal_data->refcnt = 1;
 
        CDEBUG(D_INFO, "Allocd and reset nal_data[%p]\n", nal_data);
        CDEBUG(D_INFO, "small_msg_size is [%d]\n", nal_data->small_msg_size);
 
-       PORTAL_ALLOC(nal, sizeof(nal_t));
-       if (!nal) {
-               PORTAL_FREE(nal_data, sizeof(gmnal_data_t));
-               return(NULL);
-       }
-       memset(nal, 0, sizeof(nal_t));
-       CDEBUG(D_INFO, "Allocd and reset nal[%p]\n", nal);
-
        PORTAL_ALLOC(nal_cb, sizeof(nal_cb_t));
        if (!nal_cb) {
-               PORTAL_FREE(nal, sizeof(nal_t));
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));
-               return(NULL);
+               return(PTL_NO_SPACE);
        }
        memset(nal_cb, 0, sizeof(nal_cb_t));
        CDEBUG(D_INFO, "Allocd and reset nal_cb[%p]\n", nal_cb);
 
-       GMNAL_INIT_NAL(nal);
        GMNAL_INIT_NAL_CB(nal_cb);
        /*
         *      String them all together
@@ -280,10 +310,9 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
        CDEBUG(D_INFO, "Calling gm_init\n");
        if (gm_init() != GM_SUCCESS) {
                CDEBUG(D_ERROR, "call to gm_init failed\n");
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
        }
 
 
@@ -326,10 +355,9 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
                GMNAL_GM_LOCK(nal_data);
                gm_finalize();
                GMNAL_GM_UNLOCK(nal_data);
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
        }
 
        
@@ -344,10 +372,9 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
                gm_close(nal_data->gm_port);
                gm_finalize();
                GMNAL_GM_UNLOCK(nal_data);
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
        }
 
 
@@ -374,10 +401,9 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
                gm_close(nal_data->gm_port);
                gm_finalize();
                GMNAL_GM_UNLOCK(nal_data);
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
        }
 
        gmnal_start_kernel_threads(nal_data);
@@ -407,10 +433,9 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
                gm_close(nal_data->gm_port);
                gm_finalize();
                GMNAL_GM_UNLOCK(nal_data);
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
        }
        nal_data->gm_local_nid = local_nid;
        CDEBUG(D_INFO, "Local node id is [%u]\n", local_nid);
@@ -428,10 +453,9 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
                gm_close(nal_data->gm_port);
                gm_finalize();
                GMNAL_GM_UNLOCK(nal_data);
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
        }
        CDEBUG(D_INFO, "Global node id is [%u]\n", global_nid);
        nal_data->gm_global_nid = global_nid;
@@ -440,13 +464,15 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
 /*
        pid = gm_getpid();
 */
-       CDEBUG(D_INFO, "portals_pid is [%u]\n", portals_pid);
-       portals_nid = (unsigned long)global_nid;
-       CDEBUG(D_INFO, "portals_nid is ["LPU64"]\n", portals_nid);
+        process_id.pid = 0;
+        process_id.nid = global_nid;
+        
+       CDEBUG(D_INFO, "portals_pid is [%u]\n", process_id.pid);
+       CDEBUG(D_INFO, "portals_nid is ["LPU64"]\n", process_id.nid);
        
        CDEBUG(D_PORTALS, "calling lib_init\n");
-       if (lib_init(nal_cb, portals_nid, portals_pid, 1024, ptl_size
-                    ac_size) != PTL_OK) {
+       if (lib_init(nal_cb, process_id
+                     requested_limits, actual_limits) != PTL_OK) {
                CDEBUG(D_ERROR, "lib_init failed\n");
                gmnal_stop_rxthread(nal_data);
                gmnal_stop_ctthread(nal_data);
@@ -456,22 +482,68 @@ gmnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
                gm_close(nal_data->gm_port);
                gm_finalize();
                GMNAL_GM_UNLOCK(nal_data);
-               PORTAL_FREE(nal, sizeof(nal_t));        
                PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
                PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
-               return(NULL);
+               return(PTL_FAIL);
                
        }
+
+       if (libcfs_nal_cmd_register(GMNAL, &gmnal_cmd, nal->nal_data) != 0) {
+               CDEBUG(D_INFO, "libcfs_nal_cmd_register failed\n");
+
+                /* XXX these cleanup cases should be restructured to
+                 * minimise duplication... */
+                lib_fini(nal_cb);
+                
+               gmnal_stop_rxthread(nal_data);
+               gmnal_stop_ctthread(nal_data);
+               gmnal_free_txd(nal_data);
+               gmnal_free_srxd(nal_data);
+               GMNAL_GM_LOCK(nal_data);
+               gm_close(nal_data->gm_port);
+               gm_finalize();
+               GMNAL_GM_UNLOCK(nal_data);
+               PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
+               PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
+               return(PTL_FAIL);
+        }
+
+        /* might be better to initialise this at module load rather than in
+         * NAL startup */
         nal_data->sysctl = NULL;
         nal_data->sysctl = register_sysctl_table (gmnalnal_top_sysctl_table, 0);
 
        
        CDEBUG(D_INFO, "gmnal_init finished\n");
        global_nal_data = nal->nal_data;
-       return(nal);
+
+        /* no unload now until shutdown */
+        PORTAL_MODULE_USE;
+        
+       return(PTL_OK);
 }
 
+nal_t the_gm_nal;
+
+/* 
+ *        Called when module loaded
+ */
+int gmnal_init(void)
+{
+        int    rc;
+
+       memset(&the_gm_nal, 0, sizeof(nal_t));
+       CDEBUG(D_INFO, "reset nal[%p]\n", &the_gm_nal);
+       GMNAL_INIT_NAL(&the_gm_nal);
 
+        rc = ptl_register_nal(GMNAL, &the_gm_nal);
+        if (rc != PTL_OK)
+                CERROR("Can't register GMNAL: %d\n", rc);
+
+        return (rc);
+}
+
+                
 
 /*
  *     Called when module removed
@@ -484,20 +556,7 @@ void gmnal_fini()
 
        CDEBUG(D_TRACE, "gmnal_fini\n");
 
-       PtlNIFini(kgmnal_ni);
-       lib_fini(nal_cb);
+        LASSERT(global_nal_data == NULL);
 
-       gmnal_stop_rxthread(nal_data);
-       gmnal_stop_ctthread(nal_data);
-       gmnal_free_txd(nal_data);
-       gmnal_free_srxd(nal_data);
-       GMNAL_GM_LOCK(nal_data);
-       gm_close(nal_data->gm_port);
-       gm_finalize();
-       GMNAL_GM_UNLOCK(nal_data);
-        if (nal_data->sysctl)
-                unregister_sysctl_table (nal_data->sysctl);
-       PORTAL_FREE(nal, sizeof(nal_t));        
-       PORTAL_FREE(nal_data, sizeof(gmnal_data_t));    
-       PORTAL_FREE(nal_cb, sizeof(nal_cb_t));
+        ptl_unregister_nal(GMNAL);
 }
index 31f6819..278230e 100644 (file)
@@ -32,9 +32,6 @@ int num_rx_threads = -1;
 int num_stxds = 5;
 int gm_port = 4;
 
-ptl_handle_ni_t        kgmnal_ni;
-
-
 int 
 gmnal_cmd(struct portals_cfg *pcfg, void *private)
 {
@@ -92,26 +89,15 @@ gmnal_load(void)
 
 
        CDEBUG(D_INFO, "Calling gmnal_init\n");
-       status = PtlNIInit(gmnal_init, 32, 4, 0, &kgmnal_ni);
+        statud = gmnal_init();
        if (status == PTL_OK) {
-               CDEBUG(D_INFO, "Portals GMNAL initialised ok kgmnal_ni\n");
+               CDEBUG(D_INFO, "Portals GMNAL initialised ok\n");
        } else {
                CDEBUG(D_INFO, "Portals GMNAL Failed to initialise\n");
-               return(1);
+               return(-ENODEV);
                
        }
 
-       CDEBUG(D_INFO, "Calling kportal_nal_register\n");
-       /*
-        *      global_nal_data is set by gmnal_init
-        */
-       if (kportal_nal_register(GMNAL, &gmnal_cmd, global_nal_data) != 0) {
-               CDEBUG(D_INFO, "kportal_nal_register failed\n");
-               return(1);
-       }
-
-       CDEBUG(D_INFO, "Calling PORTAL_SYMBOL_REGISTER\n");
-       PORTAL_SYMBOL_REGISTER(kgmnal_ni);
        CDEBUG(D_INFO, "This is the end of the gmnal init routine");
 
 
@@ -122,11 +108,7 @@ gmnal_load(void)
 static void __exit
 gmnal_unload(void)
 {
-
-       kportal_nal_unregister(GMNAL);
-       PORTAL_SYMBOL_UNREGISTER(kgmnal_ni);
        gmnal_fini();
-       global_nal_data = NULL;
        return;
 }
 
@@ -135,8 +117,6 @@ module_init(gmnal_load);
 
 module_exit(gmnal_unload);
 
-EXPORT_SYMBOL(kgmnal_ni);
-
 MODULE_PARM(gmnal_small_msg_size, "i");
 MODULE_PARM(num_rx_threads, "i");
 MODULE_PARM(num_stxds, "i");
index e995588..48b17e9 100644 (file)
@@ -1,3 +1,10 @@
 .deps
 Makefile
-Makefile.in
+autoMakefile.in
+autoMakefile
+*.ko
+*.mod.c
+.*.flags
+.*.cmd
+.tmp_versions
+.depend
diff --git a/lnet/klnds/iblnd/Makefile.am b/lnet/klnds/iblnd/Makefile.am
deleted file mode 100644 (file)
index 84818dc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-include ../../Rules.linux
-
-MODULE = kibnal
-modulenet_DATA = kibnal.o
-EXTRA_PROGRAMS = kibnal
-
-
-DEFS =
-CPPFLAGS=@CPPFLAGS@ @with_ib@
-kibnal_SOURCES = ibnal.h ibnal.c ibnal_cb.c
diff --git a/lnet/klnds/iblnd/Makefile.in b/lnet/klnds/iblnd/Makefile.in
new file mode 100644 (file)
index 0000000..e180b3e
--- /dev/null
@@ -0,0 +1,6 @@
+MODULES := kibnal
+kibnal-objs := ibnal.o ibnal_cb.o
+
+EXTRA_PRE_CFLAGS := @IBCPPFLAGS@
+
+@INCLUDE_RULES@
diff --git a/lnet/klnds/iblnd/autoMakefile.am b/lnet/klnds/iblnd/autoMakefile.am
new file mode 100644 (file)
index 0000000..ffe084c
--- /dev/null
@@ -0,0 +1,10 @@
+if MODULES
+if !CRAY_PORTALS
+if BUILD_IBNAL
+modulenet_DATA = kibnal$(KMODEXT)
+endif
+endif
+endif
+
+MOSTLYCLEANFILES = *.o *.ko *.mod.c
+DIST_SOURCES = $(kibnal-objs:%.o=%.c) ibnal.h
index 02beca7..86c2a63 100644 (file)
@@ -235,11 +235,6 @@ kibnal_init(int             interface, // no use here
   kibnal_data_t *nal_data  = NULL;
   int            rc;
 
-  unsigned int nnids = 1; // number of nids 
-                          // do we know how many nodes are in this
-                          // system related to this kib_nid  
-                          //
-
   CDEBUG(D_NET, "kibnal_init:calling lib_init with nid 0x%u\n",
                   kibnal_data.kib_nid);
 
@@ -252,7 +247,6 @@ kibnal_init(int             interface, // no use here
   rc = lib_init(&kibnal_lib, 
                 kibnal_data.kib_nid, 
                 0, // process id is set as 0  
-                nnids,
                 ptl_size, 
                 ac_size);
 
@@ -2034,16 +2028,13 @@ kibnal_initialize(void)
    CDEBUG(D_PORTALS, "kibnal_initialize: Enter kibnal_initialize\n");
 
    // set api functional pointers 
+   kibnal_api.startup    = kibnal_startup;
    kibnal_api.forward    = kibnal_forward;
    kibnal_api.shutdown   = kibnal_shutdown;
    kibnal_api.yield      = kibnal_yield;
-   kibnal_api.validate   = NULL; /* our api validate is a NOOP */
    kibnal_api.lock       = kibnal_lock;
    kibnal_api.unlock     = kibnal_unlock;
    kibnal_api.nal_data   = &kibnal_data; // this is so called private data 
-   kibnal_api.refct      = 1;
-   kibnal_api.timeout    = NULL;
-   kibnal_lib.nal_data   = &kibnal_data;
   
    memset(&kibnal_data, 0, sizeof(kibnal_data));
 
index e995588..48b17e9 100644 (file)
@@ -1,3 +1,10 @@
 .deps
 Makefile
-Makefile.in
+autoMakefile.in
+autoMakefile
+*.ko
+*.mod.c
+.*.flags
+.*.cmd
+.tmp_versions
+.depend
diff --git a/lnet/klnds/qswlnd/Makefile.am b/lnet/klnds/qswlnd/Makefile.am
deleted file mode 100644 (file)
index 3eb4dd5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2001  Cluster File Systems, Inc.
-#
-# This code is issued under the GNU General Public License.
-# See the file COPYING in this distribution
-
-include ../../Rules.linux
-
-MODULE = kqswnal
-modulenet_DATA = kqswnal.o
-EXTRA_PROGRAMS = kqswnal
-
-
-#CFLAGS:= @KCFLAGS@ 
-#CPPFLAGS:=@KCPPFLAGS@
-DEFS =
-CPPFLAGS=@CPPFLAGS@ @with_quadrics@
-kqswnal_SOURCES = qswnal.c qswnal_cb.c qswnal.h
diff --git a/lnet/klnds/qswlnd/Makefile.in b/lnet/klnds/qswlnd/Makefile.in
new file mode 100644 (file)
index 0000000..d27240c
--- /dev/null
@@ -0,0 +1,6 @@
+MODULES := kqswnal
+kqswnal-objs := qswnal.o qswnal_cb.o
+
+EXTRA_POST_CFLAGS := @QSWCPPFLAGS@ -I/usr/include
+
+@INCLUDE_RULES@
diff --git a/lnet/klnds/qswlnd/autoMakefile.am b/lnet/klnds/qswlnd/autoMakefile.am
new file mode 100644 (file)
index 0000000..b5b2e07
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright (C) 2001  Cluster File Systems, Inc.
+#
+# This code is issued under the GNU General Public License.
+# See the file COPYING in this distribution
+
+if MODULES
+if !CRAY_PORTALS
+if BUILD_QSWNAL
+modulenet_DATA = kqswnal$(KMODEXT)
+endif
+endif
+endif
+
+MOSTLYCLEANFILES = *.o *.ko *.mod.c
+DIST_SOURCES = $(kqswnal-objs:%.o=%.c) qswnal.h
index a386eef..f4005de 100644 (file)
 
 #include "qswnal.h"
 
-ptl_handle_ni_t                kqswnal_ni;
 nal_t                  kqswnal_api;
 kqswnal_data_t         kqswnal_data;
+ptl_handle_ni_t         kqswnal_ni;
+kqswnal_tunables_t      kqswnal_tunables;
 
 kpr_nal_interface_t kqswnal_router_interface = {
        kprni_nalid:    QSWNAL,
@@ -43,10 +44,7 @@ kpr_nal_interface_t kqswnal_router_interface = {
 
 static ctl_table kqswnal_ctl_table[] = {
        {QSWNAL_SYSCTL_OPTIMIZED_GETS, "optimized_gets",
-        &kqswnal_data.kqn_optimized_gets, sizeof (int),
-        0644, NULL, &proc_dointvec},
-       {QSWNAL_SYSCTL_COPY_SMALL_FWD, "copy_small_fwd",
-        &kqswnal_data.kqn_copy_small_fwd, sizeof (int),
+        &kqswnal_tunables.kqn_optimized_gets, sizeof (int),
         0644, NULL, &proc_dointvec},
        {0}
 };
@@ -101,15 +99,6 @@ kqswnal_unlock(nal_t *nal, unsigned long *flags)
 }
 
 static int
-kqswnal_shutdown(nal_t *nal, int ni)
-{
-       CDEBUG (D_NET, "shutdown\n");
-
-       LASSERT (nal == &kqswnal_api);
-       return (0);
-}
-
-static int
 kqswnal_yield(nal_t *nal, unsigned long *flags, int milliseconds)
 {
        /* NB called holding statelock */
@@ -119,7 +108,7 @@ kqswnal_yield(nal_t *nal, unsigned long *flags, int milliseconds)
        CDEBUG (D_NET, "yield\n");
 
        if (milliseconds == 0) {
-               if (current->need_resched)
+               if (need_resched())
                        schedule();
                return 0;
        }
@@ -148,20 +137,6 @@ kqswnal_yield(nal_t *nal, unsigned long *flags, int milliseconds)
        return (milliseconds);
 }
 
-static nal_t *
-kqswnal_init(int interface, ptl_pt_index_t ptl_size, ptl_ac_index_t ac_size,
-            ptl_pid_t requested_pid)
-{
-       ptl_nid_t mynid = kqswnal_elanid2nid (kqswnal_data.kqn_elanid);
-       int       nnids = kqswnal_data.kqn_nnodes;
-
-        CDEBUG(D_NET, "calling lib_init with nid "LPX64" of %d\n", mynid, nnids);
-
-       lib_init(&kqswnal_lib, mynid, 0, nnids, ptl_size, ac_size);
-
-       return (&kqswnal_api);
-}
-
 int
 kqswnal_get_tx_desc (struct portals_cfg *pcfg)
 {
@@ -219,26 +194,32 @@ kqswnal_cmd (struct portals_cfg *pcfg, void *private)
        }
 }
 
-void __exit
-kqswnal_finalise (void)
+static void
+kqswnal_shutdown(nal_t *nal)
 {
+       unsigned long flags;
+       int           do_lib_fini = 0;
+
+       /* NB The first ref was this module! */
+       if (nal->nal_refct != 0) {
+               PORTAL_MODULE_UNUSE;
+               return;
+       }
+
+       CDEBUG (D_NET, "shutdown\n");
+       LASSERT (nal == &kqswnal_api);
+
        switch (kqswnal_data.kqn_init)
        {
        default:
                LASSERT (0);
 
        case KQN_INIT_ALL:
-#if CONFIG_SYSCTL
-                if (kqswnal_data.kqn_sysctl != NULL)
-                        unregister_sysctl_table (kqswnal_data.kqn_sysctl);
-#endif         
-               PORTAL_SYMBOL_UNREGISTER (kqswnal_ni);
-                kportal_nal_unregister(QSWNAL);
+                libcfs_nal_cmd_unregister(QSWNAL);
                /* fall through */
 
-       case KQN_INIT_PTL:
-               PtlNIFini (kqswnal_ni);
-               lib_fini (&kqswnal_lib);
+       case KQN_INIT_LIB:
+               do_lib_fini = 1;
                /* fall through */
 
        case KQN_INIT_DATA:
@@ -249,18 +230,24 @@ kqswnal_finalise (void)
        }
 
        /**********************************************************************/
-       /* Make router stop her calling me and fail any more call-ins */
+       /* Tell router we're shutting down.  Any router calls my threads
+        * make will now fail immediately and the router will stop calling
+        * into me. */
        kpr_shutdown (&kqswnal_data.kqn_router);
-
+       
        /**********************************************************************/
-       /* flag threads we've started to terminate and wait for all to ack */
-
+       /* Signal the start of shutdown... */
+       spin_lock_irqsave(&kqswnal_data.kqn_idletxd_lock, flags);
        kqswnal_data.kqn_shuttingdown = 1;
-       wake_up_all (&kqswnal_data.kqn_sched_waitq);
+       spin_unlock_irqrestore(&kqswnal_data.kqn_idletxd_lock, flags);
+
+       wake_up_all(&kqswnal_data.kqn_idletxd_waitq);
 
-       while (atomic_read (&kqswnal_data.kqn_nthreads_running) != 0) {
-               CDEBUG(D_NET, "waiting for %d threads to start shutting down\n",
-                      atomic_read (&kqswnal_data.kqn_nthreads_running));
+       /**********************************************************************/
+       /* wait for sends that have allocated a tx desc to launch or give up */
+       while (atomic_read (&kqswnal_data.kqn_pending_txs) != 0) {
+               CDEBUG(D_NET, "waiting for %d pending sends\n",
+                      atomic_read (&kqswnal_data.kqn_pending_txs));
                set_current_state (TASK_UNINTERRUPTIBLE);
                schedule_timeout (HZ);
        }
@@ -268,18 +255,27 @@ kqswnal_finalise (void)
        /**********************************************************************/
        /* close elan comms */
 #if MULTIRAIL_EKC
+       /* Shut down receivers first; rx callbacks might try sending... */
        if (kqswnal_data.kqn_eprx_small != NULL)
                ep_free_rcvr (kqswnal_data.kqn_eprx_small);
 
        if (kqswnal_data.kqn_eprx_large != NULL)
                ep_free_rcvr (kqswnal_data.kqn_eprx_large);
 
+       /* NB ep_free_rcvr() returns only after we've freed off all receive
+        * buffers (see shutdown handling in kqswnal_requeue_rx()).  This
+        * means we must have completed any messages we passed to
+        * lib_parse() or kpr_fwd_start(). */
+
        if (kqswnal_data.kqn_eptx != NULL)
                ep_free_xmtr (kqswnal_data.kqn_eptx);
 
-       /* freeing the xmtr completes all txs pdq */
+       /* NB ep_free_xmtr() returns only after all outstanding transmits
+        * have called their callback... */
        LASSERT(list_empty(&kqswnal_data.kqn_activetxds));
 #else
+       /* "Old" EKC just pretends to shutdown cleanly but actually
+        * provides no guarantees */
        if (kqswnal_data.kqn_eprx_small != NULL)
                ep_remove_large_rcvr (kqswnal_data.kqn_eprx_small);
 
@@ -298,7 +294,6 @@ kqswnal_finalise (void)
 #endif
        /**********************************************************************/