cluster: RHEL6 - Major tree cleanup

Fabio M. Di Nitto fabbione at fedoraproject.org
Fri May 27 06:02:22 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3a8ef438e9649737c07dc5355d84afffa650dbdd
Commit:        3a8ef438e9649737c07dc5355d84afffa650dbdd
Parent:        061bbfd798f567103918e7fb674040b90fe513bd
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Fri May 27 07:57:09 2011 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Fri May 27 07:57:09 2011 +0200

Major tree cleanup

drop gfs-utils/gfs-kernel: obsoleted
drop fence-agents/resource-agents: move to standalone upstream trees
drop *-pcmk variants
re-add gfs-ondisk header to mount.gfs2 (required to build)
update build system (only dirs/subdirs are affected)

and make ready for 3.0.12.1 release

Resolves: rhbz#707118

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 Makefile                                           |   12 +-
 configure                                          |  174 -
 fence/Makefile                                     |    2 +-
 fence/agents/Makefile                              |    6 -
 fence/agents/alom/Makefile                         |    7 -
 fence/agents/alom/fence_alom.py                    |   86 -
 fence/agents/apc/Makefile                          |    7 -
 fence/agents/apc/fence_apc.py                      |  243 -
 fence/agents/apc_snmp/Makefile                     |    7 -
 fence/agents/apc_snmp/README                       |   45 -
 fence/agents/apc_snmp/fence_apc_snmp.py            |  206 -
 fence/agents/apc_snmp/powernet369.mib              |31109 --------------------
 fence/agents/baytech/Makefile                      |    5 -
 fence/agents/baytech/fence_baytech.8               |   84 -
 fence/agents/baytech/fence_baytech.pl              |  683 -
 fence/agents/bladecenter/Makefile                  |    7 -
 fence/agents/bladecenter/fence_bladecenter.py      |  136 -
 fence/agents/bladecenter_snmp/Makefile             |    7 -
 .../bladecenter_snmp/fence_bladecenter_snmp.py     |   88 -
 fence/agents/brocade/Makefile                      |    5 -
 fence/agents/brocade/fence_brocade.8               |   84 -
 fence/agents/brocade/fence_brocade.pl              |  255 -
 fence/agents/bullpap/Makefile                      |    5 -
 fence/agents/bullpap/fence_bullpap.8               |   73 -
 fence/agents/bullpap/fence_bullpap.pl              |  366 -
 fence/agents/cisco_mds/Makefile                    |    7 -
 fence/agents/cisco_mds/fence_cisco_mds.py          |  126 -
 fence/agents/cisco_ucs/Makefile                    |    7 -
 fence/agents/cisco_ucs/fence_cisco_ucs.py          |  146 -
 fence/agents/cpint/Makefile                        |    5 -
 fence/agents/cpint/fence_cpint.8                   |   54 -
 fence/agents/cpint/fence_cpint.pl                  |  143 -
 fence/agents/drac/Makefile                         |    5 -
 fence/agents/drac/fence_drac.8                     |  105 -
 fence/agents/drac/fence_drac.pl                    |  678 -
 fence/agents/drac/test_drac.sh                     |   83 -
 fence/agents/drac5/Makefile                        |    7 -
 fence/agents/drac5/fence_drac5.py                  |  142 -
 fence/agents/egenera/Makefile                      |    5 -
 fence/agents/egenera/fence_egenera.8               |   84 -
 fence/agents/egenera/fence_egenera.pl              |  439 -
 fence/agents/eps/Makefile                          |    7 -
 fence/agents/eps/fence_eps.py                      |  131 -
 fence/agents/ibmblade/Makefile                     |   16 -
 fence/agents/ibmblade/fence_ibmblade.8             |    1 -
 fence/agents/ifmib/Makefile                        |    7 -
 fence/agents/ifmib/README                          |   45 -
 fence/agents/ifmib/fence_ifmib.py                  |  149 -
 fence/agents/ilo/Makefile                          |    7 -
 fence/agents/ilo/fence_ilo.py                      |  126 -
 fence/agents/ilo_mp/Makefile                       |    7 -
 fence/agents/ilo_mp/fence_ilo_mp.py                |   84 -
 fence/agents/intelmodular/Makefile                 |    7 -
 fence/agents/intelmodular/fence_intelmodular.py    |   99 -
 fence/agents/ipmilan/Makefile                      |   33 -
 fence/agents/ipmilan/expect.c                      |  342 -
 fence/agents/ipmilan/expect.h                      |   52 -
 fence/agents/ipmilan/ipmilan.c                     | 1203 -
 fence/agents/ldom/Makefile                         |    7 -
 fence/agents/ldom/fence_ldom.py                    |  139 -
 fence/agents/lib/Makefile                          |    7 -
 fence/agents/lib/fence2man.xsl                     |   53 -
 fence/agents/lib/fence2rng.xsl                     |   20 -
 fence/agents/lib/fencing.py.py                     |  941 -
 fence/agents/lib/fencing_snmp.py.py                |  131 -
 fence/agents/lpar/Makefile                         |    7 -
 fence/agents/lpar/fence_lpar.py                    |  185 -
 fence/agents/manual/Makefile                       |   21 -
 fence/agents/manual/fence_ack_manual.8             |   39 -
 fence/agents/manual/fence_ack_manual.sh            |   37 -
 fence/agents/mcdata/Makefile                       |    5 -
 fence/agents/mcdata/fence_mcdata.8                 |   84 -
 fence/agents/mcdata/fence_mcdata.pl                |  293 -
 fence/agents/nss_wrapper/Makefile                  |   26 -
 fence/agents/nss_wrapper/fence_nss_wrapper.c       |  482 -
 fence/agents/rackswitch/Makefile                   |   26 -
 fence/agents/rackswitch/do_rack.c                  |  752 -
 fence/agents/rackswitch/do_rack.h                  |   27 -
 fence/agents/rackswitch/fence_rackswitch.8         |   70 -
 fence/agents/rhevm/Makefile                        |    7 -
 fence/agents/rhevm/fence_rhevm.py                  |  145 -
 fence/agents/rsa/Makefile                          |    7 -
 fence/agents/rsa/fence_rsa.py                      |   92 -
 fence/agents/rsb/Makefile                          |    5 -
 fence/agents/rsb/fence_rsb.8                       |   76 -
 fence/agents/rsb/fence_rsb.py                      |  408 -
 fence/agents/sanbox2/Makefile                      |    7 -
 fence/agents/sanbox2/fence_sanbox2.py              |  167 -
 fence/agents/scsi/Makefile                         |    7 -
 fence/agents/scsi/fence_scsi.8                     |  109 -
 fence/agents/scsi/fence_scsi.pl                    |  843 -
 fence/agents/scsi/fence_scsi_check.pl              |  170 -
 fence/agents/virsh/Makefile                        |    7 -
 fence/agents/virsh/fence_virsh.py                  |  107 -
 fence/agents/vixel/Makefile                        |    5 -
 fence/agents/vixel/fence_vixel.8                   |   72 -
 fence/agents/vixel/fence_vixel.pl                  |  212 -
 fence/agents/vmware/Makefile                       |    8 -
 fence/agents/vmware/fence_vmware.py                |  342 -
 fence/agents/vmware/fence_vmware_helper.pl         |  276 -
 fence/agents/wti/Makefile                          |    7 -
 fence/agents/wti/fence_wti.py                      |  176 -
 fence/agents/xcat/Makefile                         |    5 -
 fence/agents/xcat/fence_xcat.8                     |   63 -
 fence/agents/xcat/fence_xcat.pl                    |  197 -
 fence/agents/xvm/Makefile                          |   58 -
 fence/agents/xvm/README                            |  182 -
 fence/agents/xvm/TODO                              |   33 -
 fence/agents/xvm/debug.c                           |   18 -
 fence/agents/xvm/debug.h                           |   15 -
 fence/agents/xvm/fence_xvmd.8                      |  124 -
 fence/agents/xvm/fence_xvmd.c                      |  994 -
 fence/agents/xvm/mcast.c                           |  366 -
 fence/agents/xvm/mcast.h                           |   16 -
 fence/agents/xvm/options-ccs.c                     |   97 -
 fence/agents/xvm/options.c                         |  774 -
 fence/agents/xvm/options.h                         |   65 -
 fence/agents/xvm/simple_auth.c                     |  395 -
 fence/agents/xvm/simple_auth.h                     |   17 -
 fence/agents/xvm/tcp.c                             |  282 -
 fence/agents/xvm/tcp.h                             |    9 -
 fence/agents/xvm/tests/hvm.xml                     |   32 -
 fence/agents/xvm/tests/linux.xml                   |   31 -
 fence/agents/xvm/virt.c                            |  202 -
 fence/agents/xvm/virt.h                            |   60 -
 fence/agents/xvm/vm_states.c                       |  414 -
 fence/agents/xvm/xml.c                             |  316 -
 fence/agents/xvm/xvm.h                             |   65 -
 fence/agents/zvm/Makefile                          |    5 -
 fence/agents/zvm/fence_zvm.8                       |   64 -
 fence/agents/zvm/fence_zvm.pl                      |  353 -
 gfs-kernel/src/gfs/Makefile                        |   72 -
 gfs-kernel/src/gfs/acl.c                           |  398 -
 gfs-kernel/src/gfs/acl.h                           |   34 -
 gfs-kernel/src/gfs/bits.c                          |  211 -
 gfs-kernel/src/gfs/bits.h                          |   18 -
 gfs-kernel/src/gfs/bmap.c                          | 1393 -
 gfs-kernel/src/gfs/bmap.h                          |   35 -
 gfs-kernel/src/gfs/daemon.c                        |  181 -
 gfs-kernel/src/gfs/daemon.h                        |   11 -
 gfs-kernel/src/gfs/dio.c                           | 1342 -
 gfs-kernel/src/gfs/dio.h                           |  157 -
 gfs-kernel/src/gfs/dir.c                           | 2394 --
 gfs-kernel/src/gfs/dir.h                           |   42 -
 gfs-kernel/src/gfs/eaops.c                         |  173 -
 gfs-kernel/src/gfs/eaops.h                         |   21 -
 gfs-kernel/src/gfs/eattr.c                         | 2007 --
 gfs-kernel/src/gfs/eattr.h                         |   97 -
 gfs-kernel/src/gfs/file.c                          |  437 -
 gfs-kernel/src/gfs/file.h                          |   42 -
 gfs-kernel/src/gfs/fixed_div64.h                   |  107 -
 gfs-kernel/src/gfs/format.h                        |   17 -
 gfs-kernel/src/gfs/gfs.h                           |   65 -
 gfs-kernel/src/gfs/gfs_ioctl.h                     |   31 -
 gfs-kernel/src/gfs/gfs_ondisk.h                    | 1904 --
 gfs-kernel/src/gfs/glock.c                         | 3035 --
 gfs-kernel/src/gfs/glock.h                         |  140 -
 gfs-kernel/src/gfs/glops.c                         |  664 -
 gfs-kernel/src/gfs/glops.h                         |   13 -
 gfs-kernel/src/gfs/incore.h                        | 1218 -
 gfs-kernel/src/gfs/inode.c                         | 2224 --
 gfs-kernel/src/gfs/inode.h                         |   57 -
 gfs-kernel/src/gfs/ioctl.c                         | 1607 -
 gfs-kernel/src/gfs/ioctl.h                         |    9 -
 gfs-kernel/src/gfs/lm.c                            |  237 -
 gfs-kernel/src/gfs/lm.h                            |   32 -
 gfs-kernel/src/gfs/lm_interface.h                  |  269 -
 gfs-kernel/src/gfs/lock_dlm.h                      |  173 -
 gfs-kernel/src/gfs/lock_dlm_lock.c                 |  518 -
 gfs-kernel/src/gfs/lock_dlm_main.c                 |   31 -
 gfs-kernel/src/gfs/lock_dlm_mount.c                |  278 -
 gfs-kernel/src/gfs/lock_dlm_sysfs.c                |  229 -
 gfs-kernel/src/gfs/lock_dlm_thread.c               |  358 -
 gfs-kernel/src/gfs/lock_nolock_main.c              |  221 -
 gfs-kernel/src/gfs/locking.c                       |  171 -
 gfs-kernel/src/gfs/log.c                           | 1424 -
 gfs-kernel/src/gfs/log.h                           |   66 -
 gfs-kernel/src/gfs/lops.c                          | 1649 --
 gfs-kernel/src/gfs/lops.h                          |  166 -
 gfs-kernel/src/gfs/lvb.c                           |  135 -
 gfs-kernel/src/gfs/lvb.h                           |   53 -
 gfs-kernel/src/gfs/main.c                          |  134 -
 gfs-kernel/src/gfs/mount.c                         |  209 -
 gfs-kernel/src/gfs/mount.h                         |    6 -
 gfs-kernel/src/gfs/ondisk.c                        |   15 -
 gfs-kernel/src/gfs/ops_address.c                   |  504 -
 gfs-kernel/src/gfs/ops_address.h                   |    6 -
 gfs-kernel/src/gfs/ops_dentry.c                    |  111 -
 gfs-kernel/src/gfs/ops_dentry.h                    |    6 -
 gfs-kernel/src/gfs/ops_export.c                    |  395 -
 gfs-kernel/src/gfs/ops_export.h                    |    6 -
 gfs-kernel/src/gfs/ops_file.c                      | 1913 --
 gfs-kernel/src/gfs/ops_file.h                      |   11 -
 gfs-kernel/src/gfs/ops_fstype.c                    |  828 -
 gfs-kernel/src/gfs/ops_fstype.h                    |   13 -
 gfs-kernel/src/gfs/ops_inode.c                     | 1680 --
 gfs-kernel/src/gfs/ops_inode.h                     |    9 -
 gfs-kernel/src/gfs/ops_super.c                     |  463 -
 gfs-kernel/src/gfs/ops_super.h                     |    6 -
 gfs-kernel/src/gfs/ops_vm.c                        |  233 -
 gfs-kernel/src/gfs/ops_vm.h                        |    7 -
 gfs-kernel/src/gfs/page.c                          |  266 -
 gfs-kernel/src/gfs/page.h                          |   13 -
 gfs-kernel/src/gfs/proc.c                          |  490 -
 gfs-kernel/src/gfs/proc.h                          |   14 -
 gfs-kernel/src/gfs/quota.c                         | 1140 -
 gfs-kernel/src/gfs/quota.h                         |   28 -
 gfs-kernel/src/gfs/recovery.c                      |  780 -
 gfs-kernel/src/gfs/recovery.h                      |   23 -
 gfs-kernel/src/gfs/rgrp.c                          | 2152 --
 gfs-kernel/src/gfs/rgrp.h                          |   75 -
 gfs-kernel/src/gfs/super.c                         | 1274 -
 gfs-kernel/src/gfs/super.h                         |   54 -
 gfs-kernel/src/gfs/sys.c                           |  145 -
 gfs-kernel/src/gfs/sys.h                           |   14 -
 gfs-kernel/src/gfs/trans.c                         |  453 -
 gfs-kernel/src/gfs/trans.h                         |   24 -
 gfs-kernel/src/gfs/unlinked.c                      |  432 -
 gfs-kernel/src/gfs/unlinked.h                      |   19 -
 gfs-kernel/src/gfs/util.c                          |  590 -
 gfs-kernel/src/gfs/util.h                          |  330 -
 gfs/Makefile                                       |   23 -
 gfs/gfs_debug/Makefile                             |   32 -
 gfs/gfs_debug/basic.c                              |  436 -
 gfs/gfs_debug/basic.h                              |   26 -
 gfs/gfs_debug/block_device.c                       |  117 -
 gfs/gfs_debug/block_device.h                       |   14 -
 gfs/gfs_debug/gfs_debug.h                          |   83 -
 gfs/gfs_debug/main.c                               |  179 -
 gfs/gfs_debug/ondisk.c                             |   18 -
 gfs/gfs_debug/readfile.c                           |  236 -
 gfs/gfs_debug/readfile.h                           |   14 -
 gfs/gfs_debug/util.c                               |  334 -
 gfs/gfs_debug/util.h                               |   29 -
 gfs/gfs_fsck/FEATURES                              |   25 -
 gfs/gfs_fsck/Makefile                              |   60 -
 gfs/gfs_fsck/TODO                                  |   49 -
 gfs/gfs_fsck/bio.c                                 |  168 -
 gfs/gfs_fsck/bio.h                                 |   23 -
 gfs/gfs_fsck/bitmap.c                              |  118 -
 gfs/gfs_fsck/bitmap.h                              |   20 -
 gfs/gfs_fsck/block_list.c                          |  283 -
 gfs/gfs_fsck/block_list.h                          |   89 -
 gfs/gfs_fsck/eattr.c                               |  100 -
 gfs/gfs_fsck/eattr.h                               |   21 -
 gfs/gfs_fsck/file.c                                |  231 -
 gfs/gfs_fsck/file.h                                |   10 -
 gfs/gfs_fsck/fs_bits.c                             |  350 -
 gfs/gfs_fsck/fs_bits.h                             |   34 -
 gfs/gfs_fsck/fs_bmap.c                             |  529 -
 gfs/gfs_fsck/fs_bmap.h                             |   10 -
 gfs/gfs_fsck/fs_dir.c                              | 1775 --
 gfs/gfs_fsck/fs_dir.h                              |   35 -
 gfs/gfs_fsck/fs_inode.c                            |  602 -
 gfs/gfs_fsck/fs_inode.h                            |   22 -
 gfs/gfs_fsck/fs_recovery.c                         |   75 -
 gfs/gfs_fsck/fs_recovery.h                         |    9 -
 gfs/gfs_fsck/fsck.h                                |   49 -
 gfs/gfs_fsck/fsck_incore.h                         |  137 -
 gfs/gfs_fsck/hash.c                                |   91 -
 gfs/gfs_fsck/hash.h                                |    7 -
 gfs/gfs_fsck/initialize.c                          |  421 -
 gfs/gfs_fsck/inode.c                               |  335 -
 gfs/gfs_fsck/inode.h                               |   13 -
 gfs/gfs_fsck/inode_hash.c                          |   74 -
 gfs/gfs_fsck/inode_hash.h                          |    7 -
 gfs/gfs_fsck/link.c                                |   94 -
 gfs/gfs_fsck/link.h                                |    8 -
 gfs/gfs_fsck/log.c                                 |  148 -
 gfs/gfs_fsck/log.h                                 |   87 -
 gfs/gfs_fsck/lost_n_found.c                        |  133 -
 gfs/gfs_fsck/lost_n_found.h                        |    8 -
 gfs/gfs_fsck/main.c                                |  290 -
 gfs/gfs_fsck/metawalk.c                            | 1088 -
 gfs/gfs_fsck/metawalk.h                            |   78 -
 gfs/gfs_fsck/ondisk.c                              | 1342 -
 gfs/gfs_fsck/ondisk.h                              | 2045 --
 gfs/gfs_fsck/pass1.c                               | 1124 -
 gfs/gfs_fsck/pass1b.c                              |  563 -
 gfs/gfs_fsck/pass1c.c                              |  290 -
 gfs/gfs_fsck/pass2.c                               |  962 -
 gfs/gfs_fsck/pass3.c                               |  281 -
 gfs/gfs_fsck/pass4.c                               |  233 -
 gfs/gfs_fsck/pass5.c                               |  394 -
 gfs/gfs_fsck/rgrp.c                                |  633 -
 gfs/gfs_fsck/rgrp.h                                |   20 -
 gfs/gfs_fsck/super.c                               | 1435 -
 gfs/gfs_fsck/super.h                               |   11 -
 gfs/gfs_fsck/util.c                                |  333 -
 gfs/gfs_fsck/util.h                                |   27 -
 gfs/gfs_grow/Makefile                              |   34 -
 gfs/gfs_grow/main.c                                |  974 -
 gfs/gfs_grow/ondisk.c                              |   18 -
 gfs/gfs_jadd/Makefile                              |   34 -
 gfs/gfs_jadd/main.c                                |  928 -
 gfs/gfs_jadd/ondisk.c                              |   18 -
 gfs/gfs_mkfs/Makefile                              |   38 -
 gfs/gfs_mkfs/device_geometry.c                     |  153 -
 gfs/gfs_mkfs/fs_geometry.c                         |  180 -
 gfs/gfs_mkfs/locking.c                             |  102 -
 gfs/gfs_mkfs/main.c                                |  504 -
 gfs/gfs_mkfs/mkfs_gfs.h                            |  181 -
 gfs/gfs_mkfs/ondisk.c                              |   17 -
 gfs/gfs_mkfs/structures.c                          |  845 -
 gfs/gfs_quota/Makefile                             |   31 -
 gfs/gfs_quota/check.c                              |  651 -
 gfs/gfs_quota/gfs_quota.h                          |   98 -
 gfs/gfs_quota/layout.c                             |  601 -
 gfs/gfs_quota/main.c                               |  759 -
 gfs/gfs_quota/names.c                              |   84 -
 gfs/gfs_quota/ondisk.c                             |   18 -
 gfs/gfs_tool/Makefile                              |   35 -
 gfs/gfs_tool/counters.c                            |  204 -
 gfs/gfs_tool/decipher_lockstate_dump               |  172 -
 gfs/gfs_tool/df.c                                  |  318 -
 gfs/gfs_tool/gfs_tool.h                            |   94 -
 gfs/gfs_tool/layout.c                              |  845 -
 gfs/gfs_tool/main.c                                |  274 -
 gfs/gfs_tool/misc.c                                |  755 -
 gfs/gfs_tool/ondisk.c                              |   21 -
 gfs/gfs_tool/parse_lockdump                        |  158 -
 gfs/gfs_tool/sb.c                                  |  152 -
 gfs/gfs_tool/tune.c                                |  141 -
 gfs/gfs_tool/util.c                                |  272 -
 gfs/include/global.h                               |   42 -
 gfs/include/linux_endian.h                         |   68 -
 gfs/include/list.h                                 |  325 -
 gfs/include/osi_list.h                             |   84 -
 gfs/include/osi_user.h                             |  421 -
 gfs/init.d/Makefile                                |   18 -
 gfs/init.d/gfs.in                                  |  148 -
 gfs/libgfs/Makefile                                |   33 -
 gfs/libgfs/bio.c                                   |  167 -
 gfs/libgfs/bitmap.c                                |  116 -
 gfs/libgfs/block_list.c                            |  267 -
 gfs/libgfs/file.c                                  |  233 -
 gfs/libgfs/fs_bits.c                               |  348 -
 gfs/libgfs/fs_bmap.c                               |  522 -
 gfs/libgfs/fs_dir.c                                | 1683 --
 gfs/libgfs/fs_inode.c                              |  470 -
 gfs/libgfs/incore.h                                | 1271 -
 gfs/libgfs/inode.c                                 |  322 -
 gfs/libgfs/libgfs.h                                |  398 -
 gfs/libgfs/log.c                                   |  139 -
 gfs/libgfs/ondisk.c                                | 1282 -
 gfs/libgfs/rgrp.c                                  |  593 -
 gfs/libgfs/size.c                                  |   81 -
 gfs/libgfs/super.c                                 |  530 -
 gfs/libgfs/util.c                                  |  271 -
 gfs/man/Makefile                                   |   18 -
 gfs/man/fsck.gfs.8                                 |   59 -
 gfs/man/gfs.8                                      |   37 -
 gfs/man/gfs_edit.8                                 |    1 -
 gfs/man/gfs_grow.8                                 |   63 -
 gfs/man/gfs_jadd.8                                 |   75 -
 gfs/man/gfs_quota.8                                |  101 -
 gfs/man/gfs_tool.8                                 |  145 -
 gfs/man/mkfs.gfs.8                                 |   82 -
 gfs/man/mount.gfs.8                                |  193 -
 gfs/tests/Makefile                                 |    4 -
 gfs/tests/filecon2/Makefile                        |   19 -
 gfs/tests/filecon2/filecon2.h                      |  146 -
 gfs/tests/filecon2/filecon2_client.c               |  841 -
 gfs/tests/filecon2/filecon2_server.c               |  597 -
 gfs/tests/mmdd/Makefile                            |   25 -
 gfs/tests/mmdd/mmdd.c                              |  703 -
 gfs2/mount/gfs_ondisk.h                            | 1904 ++
 group/dlm_controld/Makefile                        |   58 +-
 group/dlm_controld/pacemaker.c                     |  362 -
 group/gfs_controld/Makefile                        |   36 +-
 group/gfs_controld/member_pcmk.c                   |  113 -
 group/man/Makefile                                 |    2 -
 group/man/dlm_controld.pcmk.8                      |    1 -
 group/man/gfs_controld.pcmk.8                      |    1 -
 make/defines.mk.input                              |   18 -
 make/fencebuild.mk                                 |   43 -
 make/install.mk                                    |   12 -
 make/release.mk                                    |   70 +-
 make/uninstall.mk                                  |    9 -
 rgmanager/src/Makefile                             |    6 +-
 rgmanager/src/resources/ASEHAagent.sh              |  900 -
 rgmanager/src/resources/Makefile                   |  118 +-
 rgmanager/src/resources/SAPDatabase                | 1025 -
 rgmanager/src/resources/SAPInstance                |  591 -
 rgmanager/src/resources/apache.metadata            |   95 -
 rgmanager/src/resources/apache.sh                  |  255 -
 rgmanager/src/resources/clusterfs.sh               |  275 -
 rgmanager/src/resources/default_event_script.sl    |   20 +
 rgmanager/src/resources/drbd.metadata              |   51 -
 rgmanager/src/resources/drbd.sh                    |  144 -
 rgmanager/src/resources/fs.sh.in                   |  443 -
 rgmanager/src/resources/ip.sh                      |  987 -
 rgmanager/src/resources/lvm.metadata               |   86 -
 rgmanager/src/resources/lvm.sh                     |  134 -
 rgmanager/src/resources/lvm_by_lv.sh               |  410 -
 rgmanager/src/resources/lvm_by_vg.sh               |  401 -
 rgmanager/src/resources/mysql.metadata             |  106 -
 rgmanager/src/resources/mysql.sh                   |  174 -
 rgmanager/src/resources/named.metadata             |  104 -
 rgmanager/src/resources/named.sh                   |  193 -
 rgmanager/src/resources/netfs.sh                   |  376 -
 rgmanager/src/resources/nfsclient.sh               |  445 -
 rgmanager/src/resources/nfsexport.sh               |  238 -
 rgmanager/src/resources/nfsserver.sh               |  499 -
 rgmanager/src/resources/ocf-shellfuncs             |  165 -
 rgmanager/src/resources/openldap.metadata          |   98 -
 rgmanager/src/resources/openldap.sh                |  209 -
 rgmanager/src/resources/oracledb.sh.in             |  886 -
 rgmanager/src/resources/orainstance.metadata       |   86 -
 rgmanager/src/resources/orainstance.sh             |  526 -
 rgmanager/src/resources/oralistener.metadata       |   61 -
 rgmanager/src/resources/oralistener.sh             |  152 -
 rgmanager/src/resources/postgres-8.metadata        |   95 -
 rgmanager/src/resources/postgres-8.sh              |  206 -
 rgmanager/src/resources/ra-api-1-modified.dtd      |   68 -
 rgmanager/src/resources/ra2man.xsl                 |  158 -
 rgmanager/src/resources/ra2ref.xsl                 |   10 -
 rgmanager/src/resources/ra2rng.xsl                 |   54 -
 rgmanager/src/resources/resources.rng.head         |    1 -
 rgmanager/src/resources/resources.rng.mid          |    3 -
 rgmanager/src/resources/resources.rng.tail         |   24 -
 rgmanager/src/resources/samba.metadata             |   89 -
 rgmanager/src/resources/samba.sh                   |  223 -
 rgmanager/src/resources/script.sh                  |  103 -
 rgmanager/src/resources/service.sh                 |  282 -
 rgmanager/src/resources/smb.sh                     |  677 -
 rgmanager/src/resources/svclib_nfslock             |  260 -
 rgmanager/src/resources/tomcat-5.metadata          |  104 -
 rgmanager/src/resources/tomcat-5.sh                |  256 -
 rgmanager/src/resources/tomcat-6.metadata          |   74 -
 rgmanager/src/resources/tomcat-6.sh                |  222 -
 rgmanager/src/resources/utils/config-utils.sh.in   |  242 -
 rgmanager/src/resources/utils/fs-lib.sh            |  957 -
 .../src/resources/utils/httpd-parse-config.pl      |   65 -
 rgmanager/src/resources/utils/member_util.sh       |   66 -
 rgmanager/src/resources/utils/messages.sh          |  251 -
 .../src/resources/utils/named-parse-config.pl      |   26 -
 rgmanager/src/resources/utils/ra-skelet.sh         |  109 -
 rgmanager/src/resources/utils/rhev-check.sh        |   55 -
 .../src/resources/utils/tomcat-parse-config.pl     |   45 -
 rgmanager/src/resources/vm.sh                      | 1069 -
 scripts/fenceparse                                 |   42 -
 442 files changed, 1971 insertions(+), 149293 deletions(-)

diff --git a/Makefile b/Makefile
index 3e3cab9..cbca444 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,7 @@
 include make/defines.mk
 
-REALSUBDIRS = gfs-kernel/src/gfs \
-	      common config cman dlm fence/libfenced group \
-	      fence gfs gfs2 rgmanager bindings doc \
+REALSUBDIRS = common config cman dlm fence/libfenced group \
+	      fence gfs2 rgmanager bindings doc \
 	      contrib
 
 SUBDIRS = $(filter-out \
@@ -16,8 +15,6 @@ SUBDIRS = $(filter-out \
 	  $(if ${without_gfs2},gfs2) \
 	  $(if ${without_rgmanager},rgmanager) \
 	  $(if ${without_bindings},bindings) \
-	  $(if ${enable_gfs},,gfs) \
-	  $(if ${enable_gfs-kernel/src/gfs},,gfs-kernel/src/gfs) \
 	  , $(REALSUBDIRS))
 
 all: ${SUBDIRS}
@@ -25,10 +22,6 @@ all: ${SUBDIRS}
 ${SUBDIRS}:
 	${MAKE} -C $@ all
 
-# Kernel
-
-gfs-kernel: gfs-kernel/src/gfs
-
 # Dependencies
 
 common:
@@ -38,7 +31,6 @@ dlm: config
 fence/libfenced:
 group: cman dlm fence/libfenced
 fence: group
-gfs:
 gfs2: group
 rgmanager: cman dlm
 bindings: cman
diff --git a/configure b/configure
index 2644fa7..2e521a0 100755
--- a/configure
+++ b/configure
@@ -29,10 +29,7 @@ my %options = (
 	ldflags => \$ldflags,
 	extraldflags => \$extraldflags,
 	objdir => \$objdir,
-	kernel_build => \$kernel_build,
 	kernel_src => \$kernel_src,
-	module_dir => \$module_dir,
-	gfskincdir => \$gfskincdir,
         incdir => \$incdir,
 	libdir => \$libdir,
         ccsincdir => \$ccsincdir,
@@ -58,14 +55,8 @@ my %options = (
 	openaisincdir => \$openaisincdir,
 	openaislibdir => \$openaislibdir,
 	corosyncbin => \$corosyncbin,
-	virtincdir => \$virtincdir,
-	virtlibdir => \$virtlibdir,
 	zlibincdir => \$zlibincdir,
 	zliblibdir => \$zliblibdir,
-	nssincdir => \$nssincdir,
-	nsslibdir => \$nsslibdir,
-	nsprincdir => \$nsprincdir,
-	nsprlibdir => \$nsprlibdir,
 	ldapincdir => \$ldapincdir,
 	ldaplibdir => \$ldaplibdir,
 	libexecdir => \$libexecdir,
@@ -79,15 +70,9 @@ my %options = (
 	logrotatedir => \$logrotatedir,
 	syslogfacility => \$syslogfacility,
 	sysloglevel => \$sysloglevel,
-	snmpbin => \$snmpbin,
 	confdir => \$confdir,
 	conffile => \$conffile,
-	fence_agents => \$fence_agents,
-	fenceagentslibdir => \$fenceagentslibdir,
-	enable_crack_of_the_day => \$enable_crack_of_the_day,
-	enable_legacy_code => \$enable_legacy_code,
 	enable_contrib => \$enable_contrib,
-	enable_pacemaker => \$enable_pacemaker,
 	disable_dbus => \$disable_dbus,
 	somajor => \$somajor,
 	sominor => \$sominor,
@@ -98,13 +83,9 @@ my %options = (
 	without_dlm => \$without_dlm,
 	without_group => \$without_group,
 	without_fence => \$without_fence,
-	without_fence_agents => \$without_fence_agents,
-	enable_gfs => \$enable_gfs,
 	without_gfs2 => \$without_gfs2,
 	without_rgmanager => \$without_rgmanager,
-	without_resource_agents => \$without_resource_agents,
 	without_bindings => \$without_bindings,
-	without_kernel_modules => \$without_kernel_modules,
 	disable_kernel_check => \$disable_kernel_check,
 );
 
@@ -118,10 +99,7 @@ my $err = &GetOptions (\%options,
 		    'ldflags=s',
 		    'extraldflags=s',
 		    'objdir=s',
-		    'kernel_build=s',
 		    'kernel_src=s',
-		    'module_dir=s',
-		    'gfskincdir=s',
 		    'incdir=s',
 		    'libdir=s',
 		    'ccsincdir=s',
@@ -147,14 +125,8 @@ my $err = &GetOptions (\%options,
 		    'openaisincdir=s',
 		    'openaislibdir=s',
 		    'corosyncbin=s',
-		    'virtincdir=s',
-		    'virtlibdir=s',
 		    'zlibincdir=s',
 		    'zliblibdir=s',
-		    'nssincdir=s',
-		    'nsslibdir=s',
-		    'nsprincdir=s',
-		    'nsprlibdir=s',
 		    'ldapincdir=s',
 		    'ldaplibdir=s',
 		    'libexecdir=s',
@@ -168,18 +140,12 @@ my $err = &GetOptions (\%options,
 		    'logrotatedir=s',
 		    'syslogfacility=s',
 		    'sysloglevel=s',
-		    'snmpbin=s',
 		    'confdir=s',
 		    'conffile=s',
 		    'somajor=s',
 		    'sominor=s',
 		    'release_version=s',
-		    'fence_agents=s',
-		    'fenceagentslibdir=s',
-		    'enable_crack_of_the_day',
-		    'enable_legacy_code',
 		    'enable_contrib',
-		    'enable_pacemaker',
 		    'disable_dbus',
 		    'without_common',
 		    'without_config',
@@ -187,13 +153,9 @@ my $err = &GetOptions (\%options,
 		    'without_dlm',
 		    'without_group',
 		    'without_fence',
-		    'without_fence_agents',
-		    'enable_gfs',
 		    'without_gfs2',
 		    'without_rgmanager',
-		    'without_resource_agents',
 		    'without_bindings',
-		    'without_kernel_modules',
 		    'disable_kernel_check');
 
 if(!$err) {
@@ -219,11 +181,9 @@ if ($help || !$err) {
   print "--logrotatedir=\tthe base directory for logrorate.d files.  (Default: /etc/logrotate.d/)\n";
   print "--syslogfacility=\tset the default syslog facility.  (Default: LOG_LOCAL4)\n";
   print "--sysloglevel=\tset the default syslog level.  (Default: LOG_INFO)\n";
-  print "--snmpbin=\tthe base directory for snmp binaries (Ex: /usr/bin/snmpwalk).  (Default: {prefix}/bin)\n";
   print "--confdir=\tthe cluster config directory.  (Default: /etc/cluster)\n";
   print "--conffile=\tthe cluster config file.  (Default: cluster.conf)\n";
   print "--mandir=\tthe base directory for man pages.  (Default: {prefix}/share/man)\n";
-  print "--module_dir=\tthe base directory for kernel modules.  (Default:  /lib/modules/`uname -r`/kernel\n";
   print "\nbuild flags:\n";
   print "--cc=\t\tcompiler to use.  (Default: gcc)\n";
   print "--debug\t\tEnable debugging build. Changes default optimization CFLAGS to -O0 -DDEBUG -ggdb3\n";
@@ -233,7 +193,6 @@ if ($help || !$err) {
   print "--ldflags=\toverride default LDFLAGS settings.  (Default: none)\n";
   print "--extraldflags=\tadd extra linking options to default LDFLAGS settings.  (Default: none)\n";
   print "--objdir=\tspecify directory where to store object files.  (Defaults: current build dir)\n";
-  print "--kernel_build=\tthe directory containing the kernel object tree you wish to\n\t\tcompile against. (Default: /lib/modules/`uname -r`/build\n\t\tif available or /usr/src/linux as fallback)\n";
   print "--kernel_src=\tthe directory containing the kernel source you wish to\n\t\tcompile against.  (Default: /lib/modules/`uname -r`/source\n\t\tif available or \$kernel_build as fallback)\n";
   print "--incdir=\tthe base directory for include files.  (Default: {prefix}/include)\n";
   print "--ccsincdir=\tthe base directory for ccs include files.  (Default: ./config/libs/libccsconfdb)\n";
@@ -259,23 +218,11 @@ if ($help || !$err) {
   print "--openaisincdir=\tthe base directory for openais include files.  (Default: {incdir})\n";
   print "--openaislibdir=\tthe base directory for openais libraries.  (Default: {libdir}/openais)\n";
   print "--corosyncbin=\tlocation of corosync executable file.  (Default: /usr/sbin/corosync)\n";
-  print "--nssincdir=\tthe base directory for libnss include files.  (Default: {incdir}/nss3)\n";
-  print "--nsslibdir=\tthe base directory for libnss libraries.  (Default: {libdir})\n";
-  print "--nsprincdir=\tthe base directory for libnspr include files.  (Default: {incdir}/nspr4)\n";
-  print "--nsprlibdir=\tthe base directory for libnspr libraries.  (Default: {libdir})\n";
-  print "--virtincdir=\tthe base directory for libvirt include files.  (Default: {incdir}/libvirt)\n";
-  print "--virtlibdir=\tthe base directory for libvirt libraries.  (Default: {libdir})\n";
   print "--zlibincdir=\tthe base directory for libz include files.  (Default: {incdir})\n";
   print "--zliblibdir=\tthe base directory for libz libraries.  (Default: {libdir})\n";
   print "--ldapincdir=\tthe base directory for ldap include files.  (Default: {incdir})\n";
   print "--ldaplibdir=\tthe base directory for ldap libraries.  (Default: {libdir})\n";
-  print "--fence_agents=\tlist of fence agents to configure.  (Default: all)\n";
-  print "\t\tUse --fence_agents=help for a list\n";
-  print "--fenceagentslibdir=\tspecify directory where to install common fence python lib.  (Default: {prefix}/share/fence)\n";
-  print "--enable_crack_of_the_day\tEnable build of highly experimental features that rely on code that is not yet available for general use. (Default: no)\n";
   print "--enable_contrib\tEnable build of community contributed code/tools.  (Default: no)\n";
-  print "--enable_legacy_code\tEnable build of old/obsolete/unsupported code/tools.  (Default: no)\n";
-  print "--enable_pacemaker\tEnable building of Pacemaker-specific pieces\n";
   print "--disable_dbus\tDisable built-in support for dbus notifications.  (Default: no)\n";
   print "--without_common\tDisable common building  (Default: enabled)\n";
   print "--without_config\tDisable config building  (Default: enabled)\n";
@@ -283,13 +230,9 @@ if ($help || !$err) {
   print "--without_dlm\tDisable dlm building  (Default: enabled)\n";
   print "--without_group\tDisable group building  (Default: enabled)\n";
   print "--without_fence\tDisable fence building  (Default: enabled)\n";
-  print "--without_fence_agents\tDisable fence_agents building  (Default: enabled)\n";
-  print "--enable_gfs\tEnable gfs building  (Default: disabled)\n";
   print "--without_gfs2\tDisable gfs2 building  (Default: enabled)\n";
   print "--without_rgmanager\tDisable rgmanager building  (Default: enabled)\n";
-  print "--without_resource_agents\tDisable resource agents building  (Default: enabled)\n";
   print "--without_bindings\tDisable perl/python bindings building  (Default: enabled)\n";
-  print "--without_kernel_modules\tDisable kernel modules building  (Default: enabled)\n";
   print "--disable_kernel_check\tDisable kernel version check  (Default: enabled)\n";
   exit $ret;
 }
@@ -409,8 +352,6 @@ if (! -d "$objdir/make") {
   mkdir "$objdir";
   symlinks(".","Makefile");
   symlinks(".","*.mk");
-  symlinks("gfs-kernel","*.c");
-  symlinks("gfs-kernel","*.h");
   symlinks("bindings","*.bindings");
   symlinks("bindings","*.pl");
   symlinks("bindings","*.xs");
@@ -439,12 +380,6 @@ if (!$kernel_src) {
 if (not $disable_kernel_check and !kernel_version($kernel_src,$required_kernelversion)) {
   exit 1;
 }
-if (!$module_dir) {
-  $module_dir="/lib/modules/$un[2]/kernel";
-}
-if (!$gfskincdir) {
-  $gfskincdir="${cdir}/gfs-kernel/src/gfs";
-}
 if (!$incdir) {
   $incdir="${prefix}/include";
 }
@@ -523,24 +458,6 @@ if (!$openaislibdir) {
 if (!$corosyncbin) {
   $corosyncbin="/usr/sbin/corosync";
 }
-if (!$nssincdir) {
-  $nssincdir="${incdir}/nss3";
-}
-if (!$nsslibdir) {
-  $nsslibdir="${libdir}";
-}
-if (!$nsprincdir) {
-  $nsprincdir="${incdir}/nspr4";
-}
-if (!$nsprlibdir) {
-  $nsprlibdir="${libdir}";
-}
-if (!$virtincdir) {
-  $virtincdir="${incdir}/libvirt";
-}
-if (!$virtlibdir) {
-  $virtlibdir="${libdir}";
-}
 if (!$zlibincdir) {
   $zlibincdir="${incdir}";
 }
@@ -584,45 +501,15 @@ if (!$syslogfacility) {
 if (!$sysloglevel) {
   $sysloglevel="LOG_INFO";
 }
-if (!$snmpbin) {
-  $snmpbin="${prefix}/bin";
-}
 if (!$confdir) {
   $confdir="/etc/cluster";
 }
 if (!$conffile) {
   $conffile="cluster.conf";
 }
-if (!$fence_agents) {
-  $fence_agents="all";
-}
-if (!$fenceagentslibdir) {
-  $fenceagentslibdir="${prefix}/share/fence";
-}
-if (!$enable_crack_of_the_day) {
-  $enable_crack_of_the_day="";
-} else {
-  print "\n********************************************************************************************\n";
-  print "WARNING: *you* have explicitly enabled all possible experimental features under development!\n";
-  print "         This code will have no mercy for your data and your machines. You have been warned!\n";
-  print "\n********************************************************************************************\n";
-  $cflags="${cflags} -DEXPERIMENTAL_BUILD";
-}
 if (!$enable_contrib) {
   $enable_contrib="";
 }
-if (!$enable_legacy_code) {
-  $enable_legacy_code="";
-} else {
-  print "\n********************************************************************************************\n";
-  print "WARNING: *you* have explicitly enabled the build of old/obsoleted/unsupported code/tools\n";
-  print "         This code is provided *only* for backward compatibility\n";
-  print "\n********************************************************************************************\n";
-  $cflags="${cflags} -DLEGACY_CODE";
-}
-if (!$enable_pacemaker) {
-  $enable_pacemaker="";
-}
 if (!$disable_dbus) {
   $disable_dbus="";
 }
@@ -644,31 +531,15 @@ if (!$without_group) {
 if (!$without_fence) {
   $without_fence="";
 }
-if (!$without_fence_agents) {
-  $without_fence_agents="";
-} else {
-  $fence_agents="none";
-}
-if (!$enable_gfs) {
-  $enable_gfs="";
-}
 if (!$without_gfs2) {
   $without_gfs2="";
 }
 if (!$without_rgmanager) {
   $without_rgmanager="";
 }
-if (!$without_resource_agents) {
-  $without_resource_agents="";
-}
 if (!$without_bindings) {
   $without_bindings="";
 }
-if (!$without_kernel_modules) {
-  $enable_gfskernel=$enable_gfs;
-} else {
-  $enable_gfskernel="";
-}
 if (!$disable_kernel_check) {
   $disable_kernel_check=0;
 }
@@ -682,33 +553,6 @@ if (defined($release_version) && not length $release_version) {
   $release_version="";
 }
 
-if ((!$fence_agents) || ($fence_agents eq "all") || ($fence_agents eq "help")) {
-  @args = "find fence/agents -mindepth 2 -maxdepth 2 -name Makefile -printf '%h'";
-  open (IFILE, "@args |");
-  while (<IFILE>) {
-    chomp;
-    s|fence\/agents\/| |g;
-    s|lib ||g;
-    s|nss_wrapper ||g;
-    $all_fence = $_;
-  }
-  close IFILE;
-}
-
-if ($fence_agents eq "help") {
-  print "Available fence agents:\n$all_fence\n";
-  exit 0;
-}
-
-if ((!$fence_agents) || ($fence_agents eq "all")) {
-  print "\nThe following fence agents will be build on this system:\n$all_fence\n";
-  $fence_agents = $all_fence
-}
-
-if ($fence_agents eq "none") {
-  $fence_agents = "";
-}
-
 open IFILE, "<make/defines.mk.input" or die "Can't redirect stdin";
 open OFILE, ">${objdir}/make/defines.mk" or die "Can't redirect stdout";
 
@@ -721,10 +565,7 @@ while (<IFILE>) {
   $_ =~ s/\@CFLAGS\@/$cflags/;
   $_ =~ s/\@LDFLAGS\@/$ldflags/;
   $_ =~ s/\@OBJDIR\@/$objdir/;
-  $_ =~ s/\@KERNEL_BUILD\@/$kernel_build/;
   $_ =~ s/\@KERNEL_SRC\@/$kernel_src/;
-  $_ =~ s/\@MODULE_DIR\@/$module_dir/;
-  $_ =~ s/\@GFSKINCDIR\@/$gfskincdir/;
   $_ =~ s/\@INCDIR\@/$incdir/;
   $_ =~ s/\@LIBDIR\@/$libdir/;
   $_ =~ s/\@CCSINCDIR\@/$ccsincdir/;
@@ -752,12 +593,6 @@ while (<IFILE>) {
   $_ =~ s/\@COROSYNCBIN\@/$corosyncbin/;
   $_ =~ s/\@LDAPINCDIR\@/$ldapincdir/;
   $_ =~ s/\@LDAPLIBDIR\@/$ldaplibdir/;
-  $_ =~ s/\@NSSINCDIR\@/$nssincdir/;
-  $_ =~ s/\@NSSLIBDIR\@/$nsslibdir/;
-  $_ =~ s/\@NSPRINCDIR\@/$nsprincdir/;
-  $_ =~ s/\@NSPRLIBDIR\@/$nsprlibdir/;
-  $_ =~ s/\@VIRTINCDIR\@/$virtincdir/;
-  $_ =~ s/\@VIRTLIBDIR\@/$virtlibdir/;
   $_ =~ s/\@ZLIBINCDIR\@/$zlibincdir/;
   $_ =~ s/\@ZLIBLIBDIR\@/$zliblibdir/;
   $_ =~ s/\@LIBEXECDIR\@/$libexecdir/;
@@ -772,15 +607,9 @@ while (<IFILE>) {
   $_ =~ s/\@LOGROTATEDIR\@/$logrotatedir/;
   $_ =~ s/\@SYSLOGFACILITY\@/$syslogfacility/;
   $_ =~ s/\@SYSLOGLEVEL\@/$sysloglevel/;
-  $_ =~ s/\@SNMPBIN\@/$snmpbin/;
   $_ =~ s/\@CONFDIR\@/$confdir/;
   $_ =~ s/\@CONFFILE\@/$conffile/;
-  $_ =~ s/\@FENCE_AGENTS\@/$fence_agents/;
-  $_ =~ s/\@FENCEAGENTSLIBDIR\@/$fenceagentslibdir/;
-  $_ =~ s/\@ENABLE_CRACK_OF_THE_DAY\@/$enable_crack_of_the_day/;
-  $_ =~ s/\@ENABLE_LEGACY_CODE\@/$enable_legacy_code/;
   $_ =~ s/\@ENABLE_CONTRIB\@/$enable_contrib/;
-  $_ =~ s/\@ENABLE_PACEMAKER\@/$enable_pacemaker/;
   $_ =~ s/\@DISABLE_DBUS\@/$disable_dbus/;
   $_ =~ s/\@DISABLE_COMMON\@/$without_common/;
   $_ =~ s/\@DISABLE_CONFIG\@/$without_config/;
@@ -788,11 +617,8 @@ while (<IFILE>) {
   $_ =~ s/\@DISABLE_DLM\@/$without_dlm/;
   $_ =~ s/\@DISABLE_GROUP\@/$without_group/;
   $_ =~ s/\@DISABLE_FENCE\@/$without_fence/;
-  $_ =~ s/\@ENABLE_GFS\@/$enable_gfs/;
-  $_ =~ s/\@ENABLE_GFSKERNEL\@/$enable_gfskernel/;
   $_ =~ s/\@DISABLE_GFS2\@/$without_gfs2/;
   $_ =~ s/\@DISABLE_RGMANAGER\@/$without_rgmanager/;
-  $_ =~ s/\@DISABLE_RESOURCE_AGENTS\@/$without_resource_agents/;
   $_ =~ s/\@DISABLE_BINDINGS\@/$without_bindings/;
 
   print OFILE "$_\n";
diff --git a/fence/Makefile b/fence/Makefile
index dd9b33d..b3f9a61 100644
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -1,4 +1,4 @@
 include ../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS=agents libfence libfenced fenced fence_node fence_tool man
+SUBDIRS=libfence libfenced fenced fence_node fence_tool man
diff --git a/fence/agents/Makefile b/fence/agents/Makefile
deleted file mode 100644
index 25ccfc0..0000000
--- a/fence/agents/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-include ../../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-ifdef fence_agents
-SUBDIRS = lib nss_wrapper ${fence_agents}
-endif
diff --git a/fence/agents/alom/Makefile b/fence/agents/alom/Makefile
deleted file mode 100644
index d92eeb7..0000000
--- a/fence/agents/alom/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_alom
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/alom/fence_alom.py b/fence/agents/alom/fence_alom.py
deleted file mode 100644
index 6223608..0000000
--- a/fence/agents/alom/fence_alom.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/python
-
-# The Following Agent Has Been Tested On:
-#
-# Sun(tm) Advanced Lights Out Manager CMT v1.6.1
-# as found on SUN T2000 Niagara
-
-import sys, re, pexpect, time
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="Sun Advanced Lights Out Manager (ALOM)"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	result = ""
-	try:
-		conn.sendline("showplatform")
-                conn.log_expect(options, options["-c"], int(options["-Y"]))
-		status = re.search("standby",conn.before.lower())
-		result=(status!=None and "off" or "on")
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	return result
-
-def set_power_status(conn, options):
-	try:
-		cmd_line=(options["-o"]=="on" and "poweron" or "poweroff -f -y")
-		conn.sendline(cmd_line)
-		conn.log_expect(options, options["-c"],int(options["-g"]))
-		#Get the machine some time between poweron and poweroff
-		time.sleep(int(options["-g"]))
-		
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-		
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure", "identity_file", "test", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-	
-	pinput = process_input(device_opt)
-	pinput["-x"] = 1
-	options = check_input(device_opt, pinput)
-
-	# Default command is sc>
-	if (not options.has_key("-c")):
-		options["-c"] = "sc\>\ "
-
-	options["telnet_over_ssh"] = 1
-	
-	docs = { }
-	docs["shortdesc"] = "Fence agent for Sun ALOM"
-	docs["longdesc"] = "fence_alom is an I/O Fencing \
-agent which can be used with ALOM connected machines."
-	docs["vendorurl"] = "http://www.sun.com"
-	show_docs(options, docs)
-		
-	# Operate the fencing device
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status,None)
-
-	# Logout from system
-	try:
-		conn.sendline("logout")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass	                                         
-
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/apc/Makefile b/fence/agents/apc/Makefile
deleted file mode 100644
index fabf52c..0000000
--- a/fence/agents/apc/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_apc
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
deleted file mode 100755
index d10dd5f..0000000
--- a/fence/agents/apc/fence_apc.py
+++ /dev/null
@@ -1,243 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  Model       Firmware
-## +---------------------------------------------+
-##  AP7951	AOS v2.7.0, PDU APP v2.7.3
-##  AP7941      AOS v3.5.7, PDU APP v3.5.6
-##  AP9606	AOS v2.5.4, PDU APP v2.7.3
-##
-## @note: ssh is very slow on AP79XX devices protocol (1) and 
-##        cipher (des/blowfish) have to be defined
-#####
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New APC Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	exp_result = 0
-	outlets = {}
-	try:
-		conn.send("1\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-
-		version = 0
-		admin = 0
-		switch = 0;
-
-		if (None != re.compile('.* MasterSwitch plus.*', re.IGNORECASE | re.S).match(conn.before)):
-			switch = 1;
-			if (None != re.compile('.* MasterSwitch plus 2', re.IGNORECASE | re.S).match(conn.before)):
-				if (0 == options.has_key("-s")):
-					fail_usage("Failed: You have to enter physical switch number")
-			else:
-				if (0 == options.has_key("-s")):
-					options["-s"] = "1"
-
-		if (None == re.compile('.*Outlet Management.*', re.IGNORECASE | re.S).match(conn.before)):
-			version = 2
-		else:
-			version = 3
-
-		if (None == re.compile('.*Outlet Control/Configuration.*', re.IGNORECASE | re.S).match(conn.before)):
-			admin = 0
-		else:
-			admin = 1
-
-		if switch == 0:
-			if version == 2:
-				if admin == 0:
-					conn.send("2\r\n")
-				else:
-					conn.send("3\r\n")
-			else:
-				conn.send("2\r\n")
-				conn.log_expect(options, options["-c"], int(options["-Y"]))
-				conn.send("1\r\n")
-		else:
-			conn.send(options["-s"]+"\r\n")
-			
-		while True:
-			exp_result = conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], int(options["-Y"]))
-			lines = conn.before.split("\n");
-			show_re = re.compile('(^|\x0D)\s*(\d+)- (.*?)\s+(ON|OFF)\s*')
-			for x in lines:
-				res = show_re.search(x)
-				if (res != None):
-					outlets[res.group(2)] = (res.group(3), res.group(4))
-			conn.send("\r\n")
-			if exp_result == 0:
-				break
-		conn.send(chr(03))		
-		conn.log_expect(options, "- Logout", int(options["-Y"]))
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	if ["list", "monitor"].count(options["-o"]) == 1:
-		return outlets
-	else:
-		try:
-			(_, status) = outlets[options["-n"]]
-			return status.lower().strip()
-		except KeyError:
-			fail(EC_STATUS)
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "1",
-		'off': "2"
-	}[options["-o"]]
-
-	try:
-		conn.send("1\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-
-		version = 0
-		admin2 = 0
-		admin3 = 0
-		switch = 0
-
-		if (None != re.compile('.* MasterSwitch plus.*', re.IGNORECASE | re.S).match(conn.before)):
-			switch = 1;
-			## MasterSwitch has different schema for on/off actions
-			action = {
-				'on' : "1",
-				'off': "3"
-			}[options["-o"]]
-			if (None != re.compile('.* MasterSwitch plus 2', re.IGNORECASE | re.S).match(conn.before)):
-				if (0 == options.has_key("-s")):
-					fail_usage("Failed: You have to enter physical switch number")
-			else:
-				if (0 == options.has_key("-s")):
-					options["-s"] = 1
-
-		if (None == re.compile('.*Outlet Management.*', re.IGNORECASE | re.S).match(conn.before)):
-			version = 2
-		else:
-			version = 3
-
-		if (None == re.compile('.*Outlet Control/Configuration.*', re.IGNORECASE | re.S).match(conn.before)):
-			admin2 = 0
-		else:
-			admin2 = 1
-
-		if switch == 0:
-			if version == 2:
-				if admin2 == 0:
-					conn.send("2\r\n")
-				else:
-					conn.send("3\r\n")
-			else:
-				conn.send("2\r\n")
-				conn.log_expect(options, options["-c"], int(options["-Y"]))
-				if (None == re.compile('.*2- Outlet Restriction.*', re.IGNORECASE | re.S).match(conn.before)):
-					admin3 = 0
-				else:
-					admin3 = 1
-				conn.send("1\r\n")
-		else:
-			conn.send(options["-s"] + "\r\n")
-
-		while 1 == conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], int(options["-Y"])):
-			conn.send("\r\n")
-		conn.send(options["-n"]+"\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-
-		if switch == 0:
-			if admin2 == 1:
-				conn.send("1\r\n")
-				conn.log_expect(options, options["-c"], int(options["-Y"]))
-			if admin3 == 1:
-				conn.send("1\r\n")
-				conn.log_expect(options, options["-c"], int(options["-Y"]))
-		else:
-			conn.send("1\r\n")
-			conn.log_expect(options, options["-c"], int(options["-Y"]))
-			
-		conn.send(action+"\r\n")
-		conn.log_expect(options, "Enter 'YES' to continue or <ENTER> to cancel :", int(options["-Y"]))
-		conn.send("YES\r\n")
-		conn.log_expect(options, "Press <ENTER> to continue...", int(options["-Y"]))
-		conn.send("\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-		conn.send(chr(03))
-		conn.log_expect(options, "- Logout", int(options["-Y"]))
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure", "port", "identity_file", "switch", "test", "separator",
-			"inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	options["ssh_options"] = "-1 -c blowfish"
-
-	if 0 == options.has_key("-c"):
-		options["-c"] = "\n>"
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for APC over telnet/ssh"
-	docs["longdesc"] = "fence_apc is an I/O Fencing agent \
-which can be used with the APC network power switch. It logs into device \
-via telnet/ssh  and reboots a specified outlet. Lengthy telnet/ssh connections \
-should be avoided while a GFS cluster  is  running  because  the  connection \
-will block any necessary fencing actions."
-	docs["vendorurl"] = "http://www.apc.com"
-	show_docs(options, docs)
-
-	## Support for -n [switch]:[plug] notation that was used before
-	if (options.has_key("-n") == 1) and (-1 != options["-n"].find(":")):
-		(switch, plug) = options["-n"].split(":", 1)
-		options["-s"] = switch;
-		options["-n"] = plug;
-
-	##
-	## Operate the fencing device
-	####
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status, get_power_status)
-
-	##
-	## Logout from system
-	##
-	## In some special unspecified cases it is possible that 
-	## connection will be closed before we run close(). This is not 
-	## a problem because everything is checked before.
-	######
-	try:
-		conn.sendline("4")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/apc_snmp/Makefile b/fence/agents/apc_snmp/Makefile
deleted file mode 100644
index 3834702..0000000
--- a/fence/agents/apc_snmp/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_apc_snmp
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc_snmp/README b/fence/agents/apc_snmp/README
deleted file mode 100644
index 75aa37a..0000000
--- a/fence/agents/apc_snmp/README
+++ /dev/null
@@ -1,45 +0,0 @@
-This is an snmp based fence agent for APC power switches to be used
-with RHEL4 Red Hat Cluster Suite.
-
-The reasons to use this agent rather than the current fence_apc agent are:
-1) This script has been tested with EVERY powerswitch that APC currently
-makes.
-2) It will work on many older models that are no longer supported by APC.
-I have been told that it even works with the AP9200 switch. Older switches
-usually don't do well with the fence_apc script.
-3) This agent works with large power switches that have more than 8 outlets.
-The fence_apc script will also, in the next update -- this script will work for you now.
-
-If feedback on this beta version of the agent is good, and if ganged switches 
-can be supported, then this agent may replace fence_apc.
-
-In order to use this agent, you will need to have net-snmp-utils installed 
-on every node in your cluster. net-snmp-utils is scheduled for inclusion 
-in the base RHEL distribution for Update 4, and is yummable in FC5.
-
-After net-snmp-utils is installed, there will be a directory named:
-/usr/share/snmp/mibs/
-
-Place the accompanying powernet369.mib file in this directory.
-
-To use the agent, cp the agent to the /sbin directory on every
-cluster node. The interface for the fence_apc_snmp agent is identical to
-the existing fence_apc agent, so if you are using APC for fencing in 
-your cluster, you *could* backup your current fence_apc agent, and 
-rename this agent from fence_apc_snmp to fence_apc, and it should just work.
-
-NOTE: The fence_apc_snmp agent does not yet support ganged or 'daisy-chained'
-APC switches. 
-
-If you would rather not copy over your fence_apc agent, you can still use 
-the fence_apc_snmp agent by dropping it into /sbin on every node, and then
-defining a <fencedevice> in the cluster.conf file with agent="fence_apc_snmp"
-as an attribute, and use it that way. Note, please, that the GUI does
-not support this agent yet, and you will have to edit your cluster.conf 
-by hand and then propagate it yourself. If you need help with this, email
-me on linux-cluster or at the address below.
-
-Big thanks to Nate Straz who laid the foundation for this agent.
-
-Please let me know how this agent works.
---Jim Parsons - jparsons at redhat.com
diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py
deleted file mode 100644
index 71e978e..0000000
--- a/fence/agents/apc_snmp/fence_apc_snmp.py
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/usr/bin/python
-
-# The Following agent has been tested on:
-# - APC Switched Rack PDU (MB:v3.7.0 PF:v2.7.0 PN:apc_hw02_aos_270.bin AF1:v2.7.3 AN1:apc_hw02_aos_270.bin
-#    AF1:v2.7.3 AN1:apc_hw02_rpdu_273.bin MN:AP7930 HR:B2) - SNMP v1
-# - APC Web/SNMP Management Card (MB:v3.8.6 PF:v3.5.8 PN:apc_hw02_aos_358.bin AF1:v3.5.7 AN1:apc_hw02_aos_358.bin
-#    AF1:v3.5.7 AN1:apc_hw02_rpdu_357.bin MN:AP7900 HR:B2) - SNMP v1 and v3 (noAuthNoPrivacy,authNoPrivacy, authPrivacy)
-# - APC Switched Rack PDU (MB:v3.7.0 PF:v2.7.0 PN:apc_hw02_aos_270.bin AF1:v2.7.3 AN1:apc_hw02_rpdu_273.bin
-#    MN:AP7951 HR:B2) - SNMP v1
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-from fencing_snmp import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="APC SNMP fence agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-### CONSTANTS ###
-# oid defining fence device
-OID_SYS_OBJECT_ID='.1.3.6.1.2.1.1.2.0'
-
-### GLOBAL VARIABLES ###
-# Device - see ApcRPDU, ApcMSP, ApcMS
-device=None
-
-# Port ID
-port_id=None
-# Switch ID
-switch_id=None
-
-# Classes describing Device params
-class ApcRPDU:
-	# Rack PDU
-	status_oid=      '.1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.%d'
-	control_oid=     '.1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.%d'
-	outlet_table_oid='.1.3.6.1.4.1.318.1.1.12.3.5.1.1.2'
-	ident_str="APC rPDU"
-	state_on=1
-	state_off=2
-	turn_on=1
-	turn_off=2
-	has_switches=False
-
-class ApcMSP:
-	# Master Switch+
-	status_oid=      '.1.3.6.1.4.1.318.1.1.6.7.1.1.5.%d.1.%d'
-	control_oid=     '.1.3.6.1.4.1.318.1.1.6.5.1.1.5.%d.1.%d'
-	outlet_table_oid='.1.3.6.1.4.1.318.1.1.6.7.1.1.4'
-	ident_str="APC Master Switch+"
-	state_on=1
-	state_off=2
-	turn_on=1
-	turn_off=3
-	has_switches=True
-
-class ApcMS:
-	# Master Switch - seems oldest, but supported on every APC PDU
-	status_oid=      '.1.3.6.1.4.1.318.1.1.4.4.2.1.3.%d'
-	control_oid=     '.1.3.6.1.4.1.318.1.1.4.4.2.1.3.%d'
-	outlet_table_oid='.1.3.6.1.4.1.318.1.1.4.4.2.1.4'
-	ident_str="APC Master Switch (fallback)"
-	state_on=1
-	state_off=2
-	turn_on=1
-	turn_off=2
-	has_switches=False
-
-### FUNCTIONS ###
-def apc_set_device(conn,options):
-	global device
-
-	agents_dir={'.1.3.6.1.4.1.318.1.3.4.5':ApcRPDU,
-		    '.1.3.6.1.4.1.318.1.3.4.4':ApcMSP,
-		    None:ApcMS}
-
-	# First resolve type of APC
-	apc_type=conn.walk(OID_SYS_OBJECT_ID)
-
-	if (not ((len(apc_type)==1) and (agents_dir.has_key(apc_type[0][1])))):
-		apc_type=[[None,None]]
-
-	device=agents_dir[apc_type[0][1]]
-
-	conn.log_command("Trying %s"%(device.ident_str))
-
-def apc_resolv_port_id(conn,options):
-	global port_id,switch_id,device
-
-	if (device==None):
-		apc_set_device(conn,options)
-
-	# Now we resolv port_id/switch_id
-	if ((options["-n"].isdigit()) and ((not device.has_switches) or (options["-s"].isdigit()))):
-		port_id=int(options["-n"])
-
-		if (device.has_switches):
-			switch_id=int(options["-s"])
-	else:
-		table=conn.walk(device.outlet_table_oid,30)
-
-		for x in table:
-			if (x[1].strip('"')==options["-n"]):
-				t=x[0].split('.')
-				if (device.has_switches):
-					port_id=int(t[len(t)-1])
-					switch_id=int(t[len(t)-3])
-				else:
-					port_id=int(t[len(t)-1])
-
-	if (port_id==None):
-		fail_usage("Can't find port with name %s!"%(options["-n"]))
-
-def get_power_status(conn,options):
-	global port_id,switch_id,device
-
-	if (port_id==None):
-		apc_resolv_port_id(conn,options)
-
-	oid=((device.has_switches) and device.status_oid%(switch_id,port_id) or device.status_oid%(port_id))
-
-	(oid,status)=conn.get(oid)
-	return (status==str(device.state_on) and "on" or "off")
-
-def set_power_status(conn, options):
-	global port_id,switch_id,device
-
-	if (port_id==None):
-		apc_resolv_port_id(conn,options)
-
-	oid=((device.has_switches) and device.control_oid%(switch_id,port_id) or device.control_oid%(port_id))
-
-	conn.set(oid,(options["-o"]=="on" and device.turn_on or device.turn_off))
-
-
-def get_outlets_status(conn, options):
-	global device
-
-	result={}
-
-	if (device==None):
-		apc_set_device(conn,options)
-
-	res_ports=conn.walk(device.outlet_table_oid,30)
-
-	for x in res_ports:
-		t=x[0].split('.')
-
-		port_num=((device.has_switches) and "%s:%s"%(t[len(t)-3],t[len(t)-1]) or "%s"%(t[len(t)-1]))
-
-                port_name=x[1].strip('"')
-                port_status=""
-                result[port_num]=(port_name,port_status)
-
-        return result
-
-# Define new options
-def apc_snmp_define_defaults():
-	all_opt["snmp_version"]["default"]="1"
-	all_opt["community"]["default"]="private"
-
-# Main agent method
-def main():
-	device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
-		       "action", "ipaddr", "login", "passwd", "passwd_script",
-		       "test", "port", "separator", "no_login", "no_password",
-		       "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
-		       "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
-		       "udpport","inet4_only","inet6_only",
-		       "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	snmp_define_defaults ()
-	apc_snmp_define_defaults()
-
-	options=check_input(device_opt,process_input(device_opt))
-
-        ## Support for -n [switch]:[plug] notation that was used before
-	if ((options.has_key("-n")) and (-1 != options["-n"].find(":"))):
-		(switch, plug) = options["-n"].split(":", 1)
-		if ((switch.isdigit()) and (plug.isdigit())):
-		        options["-s"] = switch
-			options["-n"] = plug
-
-	if (not (options.has_key("-s"))):
-		options["-s"]="1"
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for APC over SNMP"
-	docs["longdesc"] = "fence_apc_snmp is an I/O Fencing agent \
-which can be used with the APC network power switch. It logs \
-into a device via SNMP and reboots a specified outlet. It supports \
-SNMP v1 and v3 with all combinations of  authenticity/privacy settings."
-	docs["vendorurl"] = "http://www.apc.com"
-	show_docs(options, docs)
-
-	# Operate the fencing device
-	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
-
-	sys.exit(result)
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/apc_snmp/powernet369.mib b/fence/agents/apc_snmp/powernet369.mib
deleted file mode 100644
index ab948f8..0000000
--- a/fence/agents/apc_snmp/powernet369.mib
+++ /dev/null
@@ -1,31109 +0,0 @@
--- *************************************************************************
--- AMERICAN POWER CONVERSION PowerNet-MIB
--- *************************************************************************
--- Copyright (c) 2005 American Power Conversion, Inc.
--- PowerNet is a Trademark of American Power Conversion Corp.
---
--- Title: APC TOP LEVEL PowerNet MIB
---
--- Version : 3.6.9
---
--- Generated by script: tomib.awk
---
--- Input File: powernetPS.mib
---
--- Created: Wednesday, January, 26, 2005
---
--- Revision History:
--- *************************************************************************
-
---          - v3.2.0 Added functionality for MasterSwitch Plus
---          - v3.3.0 Added functionality for MX28B (dcDM3) and 3-phase UPS
---          - v3.3.2 New traps for Symmetra PX UPS
--- 07/15/01 - v3.4.0 Added transfer switch
---          - v3.4.3 Added functionality for External and Integrated Environmental Monitor
--- 06/14/02 - v3.4.4 Added dcmim2(Siemens) branch, Battery Manager(Reading) traps, and
---                         Psx Traps for PDU and RM-PDU and Netlock branch/traps
--- 06/18/02 - v3.5.0a Sync Control Group support
--- 08/06/02 - v3.5.0a Environmental Management System branch/traps
--- 09/16/02 - v3.5.0b Fixed some odds/ends ... going to RM-PDU for MS additions
--- 09/25/02 - v3.5.0c MS3 additions
--- 11/05/02 - v3.5.0e More Environmental Management System/A-Link devices(ARU)
--- 11/22/02 - v3.5.0g Added General APC device status OID
--- 11/27/02 - v3.5.0h Wrapped up MS3 ((Controlled or Metered) Rack PDU) changes
--- 12/26/02 - v3.5.1a Changed MS3 name again, Controlled to Switched Rack PDU
--- 01/07/03 - v3.6.0a Added OIDs/Traps for UPS Switchable Outlet Groups.
--- 01/09/03 -         Adding the General APC device discovery OIDs (hidden)
--- 01/28/03 - v3.6.0c Made some small trap pair fixes for Switched Rack PDU (MS3) 
--- 02/13/03 - v3.6.0d Mods from the review and some EMS fixes.
---                    Added OID for the new 20kVA Symmetra 3 Phase type.
---                    Added OIDs to upsAdvConfig for Symmetra type UPSs.
---                    Added upsDiagnostics branch OID for Symmetra module information.
--- 04/05/03 - v3.6.2  Added OID for the new Smart-UPS 7500 and 10000 types.
--- 06/04/03 - v3.6.3  Added OIDs/Traps for AirFM.
--- 06/24/03 - v3.6.4  Moved some AirFM temps and humidities from system level to module level.
--- 10/24/03 - v3.6.4a Added OIDs/Traps for xPDU.
--- 10/27/03 - v3.6.4f Added AirPA OIDs.
--- 11/03/03 - v3.6.4g Merge of 3.6.4e and 3.6.4f
--- 11/07/03 - v3.6.4h Additional review corrections
--- 12/01/03 - v3.6.5a Added group OIDs for Air FM.  Added C & F OIDs for Air PA setpoint.
--- 12/19/03 - v3.6.5b Review corrections.
--- 02/23/04 - v3.6.5c Added Modbus to experimental and multiple CB(bank) rPDU support
--- 05/05/04 - v3.6.6  Adding EMS status OID and trap for H/W issues, redefined duplicate 
---                     trap #228 (to ARU Device config change) and minor clean-up
--- 05/12/04 - v3.6.7a Added Air FM alarm status OIDs.
--- 06/03/04 - v3.6.7b Added UPS Config for Simple Signal Shutdowns and Number of External
---                    batteries.  Added Mute option to the UPS Config Audible Alarm.
--- 07/12/04 - v3.6.7d Removed Air FM alarm status OIDs due to delay in release.
--- 07/14/04 - v3.6.7d Added a detailed description to the UPSAdvConfigAlarm OID
--- 07/14/04 - v3.6.7e Added Custom Event traps
--- 08/04/04 - v3.6.7  Tag for final builds, see v3.6.7 beta build notes for changes
--- 08/26/04 - v3.6.8a Added new traps for UPS internal over temperature fault and cleared.
--- 09/01/04 - v3.6.8b Adding new thresholds for EMS probe config & status
--- 09/08/04 - v3.6.8c Corrections from MIB review.
--- 09/30/04 - v3.6.8d Added new traps for AIS ^F Message events.
--- 10/21/04 - v3.6.8e EMS.  Added missing traps and new Rate functionality.
--- 10/22/04 - v3.6.8f Added resetNetworkLeaveModeAndRestart option to the mcontrolRestartAgent OID.
--- 10/28/04 - v3.6.8g Updated EMS sections from mib committee review.
--- 11/22/04 - v3.6.8  Tag for final build.
--- 12/02/04 - v3.6.9a Added OIDs and traps for BMS-HVA.
--- 12/20/04 - v3.6.9c corrections to xPDU.
--- 12/20/04 - v3.6.9c added OIDs and traps for xATS.
--- 01/03/05 - v3.6.9d removed traps for xATS.
--- 01/03/05 - v3.6.9e correction to xATS entries, that removed underscores (mib browser incompatibility)
--- 01/07/05 - v3.6.9f
--- 01/14/05 - v3.6.9g add xPDU OIDs and traps and some corrections.
--- 01/14/05 - v3.6.9g modifications to xATS OIDs and traps.
-
--- *************************************************************************
--- *************************************************************************
--- PowerNet-MIB { iso org(3) dod(6) internet(1) private(4)
---    enterprises(1) apc(318) }
-
-PowerNet-MIB DEFINITIONS ::= BEGIN
-
-IMPORTS
-   enterprises, IpAddress, Gauge, TimeTicks             FROM RFC1155-SMI
-   DisplayString                                        FROM RFC1213-MIB
-   OBJECT-TYPE                                          FROM RFC-1212
-   TRAP-TYPE                                            FROM RFC-1215;
-
-apc                            OBJECT IDENTIFIER ::=  { enterprises 318 }
-
-products                       OBJECT IDENTIFIER ::=  { apc 1 }
-apcmgmt                        OBJECT IDENTIFIER ::=  { apc 2 }
-
-hardware                       OBJECT IDENTIFIER ::=  { products 1 }
-software                       OBJECT IDENTIFIER ::=  { products 2 }
-system                         OBJECT IDENTIFIER ::=  { products 3 }
-experimental                   OBJECT IDENTIFIER ::=  { products 4 }
-
-mconfig                        OBJECT IDENTIFIER ::=  { apcmgmt 1 }
-mcontrol                       OBJECT IDENTIFIER ::=  { apcmgmt 2 }
-mtrapargs                      OBJECT IDENTIFIER ::=  { apcmgmt 3 }
-mfiletransfer                  OBJECT IDENTIFIER ::=  { apcmgmt 4 }
-
-mconfigClock                   OBJECT IDENTIFIER ::=  { mconfig 6 }
-
-mfiletransferStatus            OBJECT IDENTIFIER ::=  { mfiletransfer 1 }
-mfiletransferConfig            OBJECT IDENTIFIER ::=  { mfiletransfer 2 }
-mfiletransferControl           OBJECT IDENTIFIER ::=  { mfiletransfer 3 }
-
-mfiletransferConfigSettings    OBJECT IDENTIFIER ::=  { mfiletransferConfig 1 }
-mfiletransferConfigTFTP        OBJECT IDENTIFIER ::=  { mfiletransferConfig 2 }
-mfiletransferConfigFTP         OBJECT IDENTIFIER ::=  { mfiletransferConfig 3 }
-
-ups                            OBJECT IDENTIFIER ::=  { hardware 1 }
-measureUps                     OBJECT IDENTIFIER ::=  { hardware 2 }
-miniSNMPadapter                OBJECT IDENTIFIER ::=  { hardware 3 }
-masterswitch                   OBJECT IDENTIFIER ::=  { hardware 4 }
-masterswitchVM                 OBJECT IDENTIFIER ::=  { hardware 5 }
-masterswitchMSP                OBJECT IDENTIFIER ::=  { hardware 6 }
-dcDM3                          OBJECT IDENTIFIER ::=  { hardware 7 }
-automaticTransferSwitch        OBJECT IDENTIFIER ::=  { hardware 8 }
-dc2                            OBJECT IDENTIFIER ::=  { hardware 9 }
-environmentalMonitor           OBJECT IDENTIFIER ::=  { hardware 10 }
-netlock                        OBJECT IDENTIFIER ::=  { hardware 11 }
-rPDU                           OBJECT IDENTIFIER ::=  { hardware 12 }
-airConditioners                OBJECT IDENTIFIER ::=  { hardware 13 }
-rARU                           OBJECT IDENTIFIER ::=  { hardware 14 }
-xPDU                           OBJECT IDENTIFIER ::=  { hardware 15 }
-battMan                        OBJECT IDENTIFIER ::=  { hardware 16 }
-xATS                           OBJECT IDENTIFIER ::=  { hardware 17 }
-generator                      OBJECT IDENTIFIER ::=  { hardware 18 }
-
-powerNetSubAgent               OBJECT IDENTIFIER ::=  { software 1 }
-
-powerNetSoftwareSystem         OBJECT IDENTIFIER ::=  { powerNetSubAgent 1 }
-powerNetSoftwareConfig         OBJECT IDENTIFIER ::=  { powerNetSubAgent 2 }
-
-backUPS                        OBJECT IDENTIFIER ::=  { system  1 }
-smartUPS                       OBJECT IDENTIFIER ::=  { system  2 }
-matrixUPS                      OBJECT IDENTIFIER ::=  { system  3 }
-masterSwitch                   OBJECT IDENTIFIER ::=  { system  4 }
-symmetraUPS                    OBJECT IDENTIFIER ::=  { system  5 }
-dp100E                         OBJECT IDENTIFIER ::=  { system  6 }
-dp300E                         OBJECT IDENTIFIER ::=  { system  7 }
-monitors                       OBJECT IDENTIFIER ::=  { system  8 }
-redundantSwitch                OBJECT IDENTIFIER ::=  { system  9 }
-dcPower                        OBJECT IDENTIFIER ::=  { system  10 }
-automaticXferSwitch            OBJECT IDENTIFIER ::=  { system  11 }
-netLock                        OBJECT IDENTIFIER ::=  { system  12 }
-symmetra3PhaseUPS              OBJECT IDENTIFIER ::=  { system  13 }
-networkAir                     OBJECT IDENTIFIER ::=  { system  14 }
-infraXurePDU                   OBJECT IDENTIFIER ::=  { system  15 }
-ais5000UPS                     OBJECT IDENTIFIER ::=  { system  16 }
-smartUPS3Phase                 OBJECT IDENTIFIER ::=  { system  17 }
-battManager                    OBJECT IDENTIFIER ::=  { system  18 }
-infraXureATS                   OBJECT IDENTIFIER ::=  { system  19 }
-
-battManIdent                   OBJECT IDENTIFIER ::=  { battMan 1 }
-battManSystemCalib             OBJECT IDENTIFIER ::=  { battMan 2 }
-battManUnitCalib               OBJECT IDENTIFIER ::=  { battMan 3 }
-battManStringCalib             OBJECT IDENTIFIER ::=  { battMan 4 }
-battManBatteryCalib            OBJECT IDENTIFIER ::=  { battMan 5 }
-battManConfig                  OBJECT IDENTIFIER ::=  { battMan 6 }
-battManAlarm                   OBJECT IDENTIFIER ::=  { battMan 7 }
-battManSystemStatus            OBJECT IDENTIFIER ::=  { battMan 8 }
-battManStringStatus            OBJECT IDENTIFIER ::=  { battMan 9 }
-battManBatteryStatus           OBJECT IDENTIFIER ::=  { battMan 10 }
-battManInputContactStatus      OBJECT IDENTIFIER ::=  { battMan 11 }
-battManControl                 OBJECT IDENTIFIER ::=  { battMan 12 }
-battManTestResults             OBJECT IDENTIFIER ::=  { battMan 13 }
-
-xPDUIdent                      OBJECT IDENTIFIER ::=  { xPDU 1 }
-xPDUDevice                     OBJECT IDENTIFIER ::=  { xPDU 2 }
-xPDUACMonitoringPoint          OBJECT IDENTIFIER ::=  { xPDU 3 }
-xPDUCircuitBreakers            OBJECT IDENTIFIER ::=  { xPDU 4 }
-xPDUInputContacts              OBJECT IDENTIFIER ::=  { xPDU 5 }
-xPDUOutputRelays               OBJECT IDENTIFIER ::=  { xPDU 6 }
-xPDUMiscGroup                  OBJECT IDENTIFIER ::=  { xPDU 7 }
-
-xPDUMainInput                  OBJECT IDENTIFIER ::=  { xPDUACMonitoringPoint 1 }
-xPDUBypassInput                OBJECT IDENTIFIER ::=  { xPDUACMonitoringPoint 2 }
-xPDUUPSInput                   OBJECT IDENTIFIER ::=  { xPDUACMonitoringPoint 3 }
-xPDUSystemOutput               OBJECT IDENTIFIER ::=  { xPDUACMonitoringPoint 4 }
-xPDUGroundMonitorPoint         OBJECT IDENTIFIER ::=  { xPDUACMonitoringPoint 5 }
-
-xPDUSystemBreakers             OBJECT IDENTIFIER ::=  { xPDUCircuitBreakers 1 }
-xPDUBranchBreakers             OBJECT IDENTIFIER ::=  { xPDUCircuitBreakers 2 }
-
-xATSIdent                      OBJECT IDENTIFIER ::=  { xATS 1 }
-xATSDevice                     OBJECT IDENTIFIER ::=  { xATS 2 }
-xATSSwitch                     OBJECT IDENTIFIER ::=  { xATS 3 }
-xATSACMonitoringPoint          OBJECT IDENTIFIER ::=  { xATS 4 }
-xATSTesting                    OBJECT IDENTIFIER ::=  { xATS 5 }
-xATSInputContacts              OBJECT IDENTIFIER ::=  { xATS 6 }
-xATSOutputRelays               OBJECT IDENTIFIER ::=  { xATS 7 }
-xATSMisc                       OBJECT IDENTIFIER ::=  { xATS 8 }
-
-xATSSwitchStatus               OBJECT IDENTIFIER ::=  { xATSSwitch 1 }
-xATSSwitchSettings             OBJECT IDENTIFIER ::=  { xATSSwitch 2 }
-xATSSwitchTimers               OBJECT IDENTIFIER ::=  { xATSSwitch 3 }
-xATSSwitchBlockMap             OBJECT IDENTIFIER ::=  { xATSSwitch 4 }
-xATSSwitchStatistics           OBJECT IDENTIFIER ::=  { xATSSwitch 5 }
-
-xATSSource1                    OBJECT IDENTIFIER ::=  { xATSACMonitoringPoint 1 }
-xATSSource2                    OBJECT IDENTIFIER ::=  { xATSACMonitoringPoint 2 }
-xATSSystemOutput               OBJECT IDENTIFIER ::=  { xATSACMonitoringPoint 3 }
-
-xATSTestingStatus              OBJECT IDENTIFIER ::=  { xATSTesting 1 }
-xATSTestingResults             OBJECT IDENTIFIER ::=  { xATSTesting 2 }
-xATSTestingSchedule            OBJECT IDENTIFIER ::=  { xATSTesting 3 }
-xATSTestingSimulatePowerFail   OBJECT IDENTIFIER ::=  { xATSTesting 4 }
-
-xATSGenerator                  OBJECT IDENTIFIER ::=  { generator 1 }
-
-xATSGeneratorIdent             OBJECT IDENTIFIER ::=  { xATSGenerator 1 }
-xATSGeneratorStatus            OBJECT IDENTIFIER ::=  { xATSGenerator 2 }
-xATSGeneratorAdvStatus         OBJECT IDENTIFIER ::=  { xATSGenerator 3 }
-xATSGeneratorOutput            OBJECT IDENTIFIER ::=  { xATSGenerator 4 }
-xATSGeneratorSettings          OBJECT IDENTIFIER ::=  { xATSGenerator 5 }
-xATSGeneratorService           OBJECT IDENTIFIER ::=  { xATSGenerator 6 }
-xATSGeneratorFuelSystem        OBJECT IDENTIFIER ::=  { xATSGenerator 7 }
-
-
-smartUPS250                    OBJECT IDENTIFIER ::=  { smartUPS  1 }
-smartUPS400                    OBJECT IDENTIFIER ::=  { smartUPS  2 }
-smartUPS600                    OBJECT IDENTIFIER ::=  { smartUPS  3 }
-smartUPS900                    OBJECT IDENTIFIER ::=  { smartUPS  4 }
-smartUPS1250                   OBJECT IDENTIFIER ::=  { smartUPS  5 }
-smartUPS2000                   OBJECT IDENTIFIER ::=  { smartUPS  6 }
-
-smartUPS450                    OBJECT IDENTIFIER ::=  { smartUPS  7 }
-smartUPS700                    OBJECT IDENTIFIER ::=  { smartUPS  8 }
-smartUPS1000                   OBJECT IDENTIFIER ::=  { smartUPS  9 }
-smartUPS1400                   OBJECT IDENTIFIER ::=  { smartUPS  10 }
-smartUPS2200                   OBJECT IDENTIFIER ::=  { smartUPS  11 }
-smartUPS3000                   OBJECT IDENTIFIER ::=  { smartUPS  12 }
-smartUPS5000                   OBJECT IDENTIFIER ::=  { smartUPS  13 }
-smartUPS7500                   OBJECT IDENTIFIER ::=  { smartUPS  14 }
-smartUPS10000                  OBJECT IDENTIFIER ::=  { smartUPS  15 }
-smartUPS1500                   OBJECT IDENTIFIER ::=  { smartUPS  16 }
-
-matrixUPS3000                  OBJECT IDENTIFIER ::=  { matrixUPS 1 }
-matrixUPS5000                  OBJECT IDENTIFIER ::=  { matrixUPS 2 }
-
-masterSwitchV1                 OBJECT IDENTIFIER ::=  { masterSwitch 1}
-masterSwitchV2                 OBJECT IDENTIFIER ::=  { masterSwitch 2}
-masterSwitchVM                 OBJECT IDENTIFIER ::=  { masterSwitch 3}
-masterSwitchMSP                OBJECT IDENTIFIER ::=  { masterSwitch 4}
-masterSwitchrPDU               OBJECT IDENTIFIER ::=  { masterSwitch 5}
-
-symmetraUPS4kVA                OBJECT IDENTIFIER ::=  { symmetraUPS 1 }
-symmetraUPS8kVA                OBJECT IDENTIFIER ::=  { symmetraUPS 2 }
-symmetraUPS12kVA               OBJECT IDENTIFIER ::=  { symmetraUPS 3 }
-symmetraUPS16kVA               OBJECT IDENTIFIER ::=  { symmetraUPS 4 }
-
-environmental                  OBJECT IDENTIFIER ::=  { monitors  1 }
-environmentalMgtSystem         OBJECT IDENTIFIER ::=  { monitors  2 }
-emu2                           OBJECT IDENTIFIER ::=  { monitors  3 }
-
-dm3                            OBJECT IDENTIFIER ::=  { dcPower  1 }
-dcmim2                         OBJECT IDENTIFIER ::=  { dcPower  2 }
-
-symmetra3PhaseUPS40kVA         OBJECT IDENTIFIER ::=  { symmetra3PhaseUPS 1 }
-symmetra3PhaseUPS60kVA         OBJECT IDENTIFIER ::=  { symmetra3PhaseUPS 2 }
-symmetra3PhaseUPS80kVA         OBJECT IDENTIFIER ::=  { symmetra3PhaseUPS 3 }
-symmetra3PhaseUPS20kVA         OBJECT IDENTIFIER ::=  { symmetra3PhaseUPS 4 }
-
-airFMSeries                    OBJECT IDENTIFIER ::=  { networkAir 1 }
-rackAirRemovalUnit             OBJECT IDENTIFIER ::=  { networkAir 2 }
-airPASeries                    OBJECT IDENTIFIER ::=  { networkAir 3 }  
-
-ais5000UPS10kVA                OBJECT IDENTIFIER ::=  { ais5000UPS  1 }
-ais5000UPS20kVA                OBJECT IDENTIFIER ::=  { ais5000UPS  2 }
-ais5000UPS30kVA                OBJECT IDENTIFIER ::=  { ais5000UPS  3 }
-ais5000UPS40kVA                OBJECT IDENTIFIER ::=  { ais5000UPS  4 }
-ais5000UPS60kVA                OBJECT IDENTIFIER ::=  { ais5000UPS  5 }
-ais5000UPS80kVA                OBJECT IDENTIFIER ::=  { ais5000UPS  6 }
-ais5000UPS100kVA               OBJECT IDENTIFIER ::=  { ais5000UPS  7 }
-
-smartUPS3Phase10kVA            OBJECT IDENTIFIER ::=  { smartUPS3Phase  1 }
-smartUPS3Phase15kVA            OBJECT IDENTIFIER ::=  { smartUPS3Phase  2 }
-smartUPS3Phase20kVA            OBJECT IDENTIFIER ::=  { smartUPS3Phase  3 }
-smartUPS3Phase30kVA            OBJECT IDENTIFIER ::=  { smartUPS3Phase  4 }
-smartUPS3Phase40kVA            OBJECT IDENTIFIER ::=  { smartUPS3Phase  5 }
-
-upsIdent                       OBJECT IDENTIFIER ::=  { ups 1 }
-upsBattery                     OBJECT IDENTIFIER ::=  { ups 2 }
-upsInput                       OBJECT IDENTIFIER ::=  { ups 3 }
-upsOutput                      OBJECT IDENTIFIER ::=  { ups 4 }
-upsConfig                      OBJECT IDENTIFIER ::=  { ups 5 }
-upsControl                     OBJECT IDENTIFIER ::=  { ups 6 }
-upsTest                        OBJECT IDENTIFIER ::=  { ups 7 }
-upsComm                        OBJECT IDENTIFIER ::=  { ups 8 }
-upsPhase                       OBJECT IDENTIFIER ::=  { ups 9 }
-upsSyncCtrlGroup               OBJECT IDENTIFIER ::=  { ups 10 }
-upsState                       OBJECT IDENTIFIER ::=  { ups 11 }
-upsOutletGroups                OBJECT IDENTIFIER ::=  { ups 12 }
-upsDiagnostics                 OBJECT IDENTIFIER ::=  { ups 13 }
-
-upsBasicIdent                  OBJECT IDENTIFIER ::=  { upsIdent 1 }
-upsAdvIdent                    OBJECT IDENTIFIER ::=  { upsIdent 2 }
-
-upsBasicBattery                OBJECT IDENTIFIER ::=  { upsBattery 1 }
-upsAdvBattery                  OBJECT IDENTIFIER ::=  { upsBattery 2 }
-
-upsBasicInput                  OBJECT IDENTIFIER ::=  { upsInput 1 }
-upsAdvInput                    OBJECT IDENTIFIER ::=  { upsInput 2 }
-
-upsBasicOutput                 OBJECT IDENTIFIER ::=  { upsOutput 1 }
-upsAdvOutput                   OBJECT IDENTIFIER ::=  { upsOutput 2 }
-
-upsBasicConfig                 OBJECT IDENTIFIER ::=  { upsConfig 1 }
-upsAdvConfig                   OBJECT IDENTIFIER ::=  { upsConfig 2 }
-
-upsBasicControl                OBJECT IDENTIFIER ::=  { upsControl 1 }
-upsAdvControl                  OBJECT IDENTIFIER ::=  { upsControl 2 }
-
-upsBasicTest                   OBJECT IDENTIFIER ::=  { upsTest 1 }
-upsAdvTest                     OBJECT IDENTIFIER ::=  { upsTest 2 }
-
-upsPhaseResetValues            OBJECT IDENTIFIER ::=  { upsPhase 1 }
-upsPhaseInput                  OBJECT IDENTIFIER ::=  { upsPhase 2 }
-upsPhaseOutput                 OBJECT IDENTIFIER ::=  { upsPhase 3 }
-
-upsSyncCtrlGroupConfig         OBJECT IDENTIFIER ::=  { upsSyncCtrlGroup 1 }
-upsSyncCtrlGroupStatus         OBJECT IDENTIFIER ::=  { upsSyncCtrlGroup 2 }
-
-upsBasicState                  OBJECT IDENTIFIER ::=  { upsState 1 }
-upsAdvState                    OBJECT IDENTIFIER ::=  { upsState 2 }
-
-upsOutletGroupStatus           OBJECT IDENTIFIER ::=  { upsOutletGroups 1 }
-upsOutletGroupConfig           OBJECT IDENTIFIER ::=  { upsOutletGroups 2 }
-upsOutletGroupControl          OBJECT IDENTIFIER ::=  { upsOutletGroups 3 }
-
-upsDiagnosticIM                OBJECT IDENTIFIER ::=  { upsDiagnostics 1 }
-upsDiagnosticPowerModules      OBJECT IDENTIFIER ::=  { upsDiagnostics 2 }
-upsDiagnosticBatteries         OBJECT IDENTIFIER ::=  { upsDiagnostics 3 }
-upsDiagnosticSubsystem         OBJECT IDENTIFIER ::=  { upsDiagnostics 4 }
-upsDiagnosticExternalDevices   OBJECT IDENTIFIER ::=  { upsDiagnostics 5 }
-upsDiagnosticComBus            OBJECT IDENTIFIER ::=  { upsDiagnostics 6 }
-
-upsDiagSwitchGear              OBJECT IDENTIFIER ::=  { upsDiagnosticExternalDevices 1 }
-upsDiagMCCBBox                 OBJECT IDENTIFIER ::=  { upsDiagnosticExternalDevices 2 }
-upsDiagTransformer             OBJECT IDENTIFIER ::=  { upsDiagnosticExternalDevices 3 }
-
-mUpsEnviron                    OBJECT IDENTIFIER ::=  { measureUps 1 }
-mUpsContact                    OBJECT IDENTIFIER ::=  { measureUps 2 }
-
-serialPort                     OBJECT IDENTIFIER ::=  { miniSNMPadapter 1}
-
-serialPort1                    OBJECT IDENTIFIER ::=  { serialPort 1}
-serialPort2                    OBJECT IDENTIFIER ::=  { serialPort 2}
-
-serialPort2Config              OBJECT IDENTIFIER ::=  { serialPort2 1}
-serialPort2Control             OBJECT IDENTIFIER ::=  { serialPort2 2}
-
-sPDUIdent                      OBJECT IDENTIFIER ::=  { masterswitch 1 }
-sPDUMasterControl              OBJECT IDENTIFIER ::=  { masterswitch 2 }    
-sPDUMasterConfig               OBJECT IDENTIFIER ::=  { masterswitch 3 }
-sPDUOutletControl              OBJECT IDENTIFIER ::=  { masterswitch 4 }
-sPDUOutletConfig               OBJECT IDENTIFIER ::=  { masterswitch 5 }
-
-sPDUIdentVM                    OBJECT IDENTIFIER ::=  { masterswitchVM 1 }
-sPDUMasterControlVM            OBJECT IDENTIFIER ::=  { masterswitchVM 2 }    
-sPDUMasterConfigVM             OBJECT IDENTIFIER ::=  { masterswitchVM 3 }
-sPDUMasterStatusVM             OBJECT IDENTIFIER ::=  { masterswitchVM 4 }
-sPDUOutletControlVM            OBJECT IDENTIFIER ::=  { masterswitchVM 5 }
-sPDUOutletConfigVM             OBJECT IDENTIFIER ::=  { masterswitchVM 6 }
-sPDUOutletStatusVM             OBJECT IDENTIFIER ::=  { masterswitchVM 7 }
-
-sPDUIdentMSP                   OBJECT IDENTIFIER ::=  { masterswitchMSP 1 }
-sPDUMasterControlMSP           OBJECT IDENTIFIER ::=  { masterswitchMSP 2 }    
-sPDUMasterConfigMSP            OBJECT IDENTIFIER ::=  { masterswitchMSP 3 }
-sPDUMasterStatusMSP            OBJECT IDENTIFIER ::=  { masterswitchMSP 4 }
-sPDUOutletControlMSP           OBJECT IDENTIFIER ::=  { masterswitchMSP 5 }
-sPDUOutletConfigMSP            OBJECT IDENTIFIER ::=  { masterswitchMSP 6 }
-sPDUOutletStatusMSP            OBJECT IDENTIFIER ::=  { masterswitchMSP 7 }
-
-sPDUOutletConfigMSPall         OBJECT IDENTIFIER ::=  { sPDUOutletConfigMSP 1 }
-sPDUOutletConfigMSPgs          OBJECT IDENTIFIER ::=  { sPDUOutletConfigMSP 2 }
-sPDUOutletConfigMSPannun       OBJECT IDENTIFIER ::=  { sPDUOutletConfigMSP 3 }
-sPDUOutletConfigMSPmups        OBJECT IDENTIFIER ::=  { sPDUOutletConfigMSP 4 }
-
-rPDUIdent                      OBJECT IDENTIFIER ::=  { rPDU 1 }
-rPDULoad                       OBJECT IDENTIFIER ::=  { rPDU 2 }    
-rPDUOutlet                     OBJECT IDENTIFIER ::=  { rPDU 3 }
-rPDUPowerSupply                OBJECT IDENTIFIER ::=  { rPDU 4 }
-
-rPDULoadDevice                 OBJECT IDENTIFIER ::=  { rPDULoad 1 }
-rPDULoadPhaseConfig            OBJECT IDENTIFIER ::=  { rPDULoad 2 }    
-rPDULoadStatus                 OBJECT IDENTIFIER ::=  { rPDULoad 3 }
-rPDULoadBankConfig             OBJECT IDENTIFIER ::=  { rPDULoad 4 }    
-
-rPDUOutletDevice               OBJECT IDENTIFIER ::=  { rPDUOutlet 1 }
-rPDUOutletPhase                OBJECT IDENTIFIER ::=  { rPDUOutlet 2 }
-rPDUOutletControl              OBJECT IDENTIFIER ::=  { rPDUOutlet 3 }
-rPDUOutletConfig               OBJECT IDENTIFIER ::=  { rPDUOutlet 4 }    
-rPDUOutletStatus               OBJECT IDENTIFIER ::=  { rPDUOutlet 5 }
-rPDUOutletBank                 OBJECT IDENTIFIER ::=  { rPDUOutlet 6 }
-
-rPDUPowerSupplyDevice          OBJECT IDENTIFIER ::=  { rPDUPowerSupply 1 }
-
-dm3Ident                       OBJECT IDENTIFIER ::=  { dcDM3 1 }
-dm3Config                      OBJECT IDENTIFIER ::=  { dcDM3 2 }
-dm3Status                      OBJECT IDENTIFIER ::=  { dcDM3 3 }
-
-dm3IdentSystem                 OBJECT IDENTIFIER ::=  { dm3Ident 1}
-
-dm3ConfigSystem                OBJECT IDENTIFIER ::=  { dm3Config 1 }
-dm3ConfigLVD                   OBJECT IDENTIFIER ::=  { dm3Config 2 }
-dm3ConfigBattery               OBJECT IDENTIFIER ::=  { dm3Config 3 }
-dm3ConfigPowerModules          OBJECT IDENTIFIER ::=  { dm3Config 4 }
-dm3ConfigRelays                OBJECT IDENTIFIER ::=  { dm3Config 5 }
-dm3ConfigDistribution          OBJECT IDENTIFIER ::=  { dm3Config 6 }
-
-dm3ConfigRectifier             OBJECT IDENTIFIER ::=  { dm3ConfigPowerModules 1 }
-dm3ConfigConverter             OBJECT IDENTIFIER ::=  { dm3ConfigPowerModules 2 }
-
-dm3ConfigRectThresh            OBJECT IDENTIFIER ::=  { dm3ConfigRectifier 1 }
-dm3ConfigRectAlarms            OBJECT IDENTIFIER ::=  { dm3ConfigRectifier 2 }
-
-dm3ConfigConvThresh            OBJECT IDENTIFIER ::=  { dm3ConfigConverter 1 }
-dm3ConfigConvAlarms            OBJECT IDENTIFIER ::=  { dm3ConfigConverter 2 }
-
-dm3ConfigOutputRelays          OBJECT IDENTIFIER ::=  { dm3ConfigRelays 1 }
-dm3ConfigInputRelays           OBJECT IDENTIFIER ::=  { dm3ConfigRelays 2 }
-
-dm3ConfigBreakers              OBJECT IDENTIFIER ::=  { dm3ConfigDistribution 1 }
-dm3ConfigFuses                 OBJECT IDENTIFIER ::=  { dm3ConfigDistribution 2 }
-
-dm3StatusSystem                OBJECT IDENTIFIER ::=  { dm3Status 1 }
-dm3StatusAlarms                OBJECT IDENTIFIER ::=  { dm3Status 2 }
-dm3StatusBattery               OBJECT IDENTIFIER ::=  { dm3Status 3 }
-dm3StatusOEM                   OBJECT IDENTIFIER ::=  { dm3Status 4 }
-dm3StatusLVD                   OBJECT IDENTIFIER ::=  { dm3Status 5 }
-dm3StatusPowerModules          OBJECT IDENTIFIER ::=  { dm3Status 6 }
-dm3StatusRelays                OBJECT IDENTIFIER ::=  { dm3Status 7 }
-dm3StatusDistribution          OBJECT IDENTIFIER ::=  { dm3Status 8 }
-
-dm3StatusRectifier             OBJECT IDENTIFIER ::=  { dm3StatusPowerModules 1 }
-dm3StatusConverter             OBJECT IDENTIFIER ::=  { dm3StatusPowerModules 2 }
-
-dm3StatusOutputRelays          OBJECT IDENTIFIER ::=  { dm3StatusRelays 1 }
-dm3StatusInputRelays           OBJECT IDENTIFIER ::=  { dm3StatusRelays 2 }
-
-dm3StatusBreakers              OBJECT IDENTIFIER ::=  { dm3StatusDistribution 1 }
-dm3StatusFuses                 OBJECT IDENTIFIER ::=  { dm3StatusDistribution 2 }
-
-atsIdent                       OBJECT IDENTIFIER ::=  { automaticTransferSwitch 1 }
-atsCalibration                 OBJECT IDENTIFIER ::=  { automaticTransferSwitch 2 } 
-atsControl                     OBJECT IDENTIFIER ::=  { automaticTransferSwitch 3 }    
-atsConfig                      OBJECT IDENTIFIER ::=  { automaticTransferSwitch 4 }
-atsStatus                      OBJECT IDENTIFIER ::=  { automaticTransferSwitch 5 }
-
-atsCalibrationInput            OBJECT IDENTIFIER ::=  { atsCalibration 1 }
-atsCalibrationPowerSupply      OBJECT IDENTIFIER ::=  { atsCalibration 2 }
-atsCalibrationOutput           OBJECT IDENTIFIER ::=  { atsCalibration 3 }
-
-atsStatusDeviceStatus          OBJECT IDENTIFIER ::=  { atsStatus 1 }
-atsStatusResetValues           OBJECT IDENTIFIER ::=  { atsStatus 2 }
-atsStatusInput                 OBJECT IDENTIFIER ::=  { atsStatus 3 }
-atsStatusOutput                OBJECT IDENTIFIER ::=  { atsStatus 4 }
-
-dcmim2Ident                    OBJECT IDENTIFIER ::=  { dc2 1 }
-dcmim2Control                  OBJECT IDENTIFIER ::=  { dc2 2 }
-dcmim2Config                   OBJECT IDENTIFIER ::=  { dc2 3 }
-dcmim2Status                   OBJECT IDENTIFIER ::=  { dc2 4 }
-
-dcmim2IdentSystem              OBJECT IDENTIFIER ::=  { dcmim2Ident 1 }
-
-dcmim2ControlSystem            OBJECT IDENTIFIER ::=  { dcmim2Control 1 }
-
-dcmim2ConfigSystem             OBJECT IDENTIFIER ::=  { dcmim2Config 1 }
-dcmim2ConfigBattery            OBJECT IDENTIFIER ::=  { dcmim2Config 2 }
-dcmim2ConfigLVD                OBJECT IDENTIFIER ::=  { dcmim2Config 3 }
-
-dcmim2StatusSystem             OBJECT IDENTIFIER ::=  { dcmim2Status 1 }
-dcmim2StatusRectifier          OBJECT IDENTIFIER ::=  { dcmim2Status 2 }
-dcmim2StatusBattery            OBJECT IDENTIFIER ::=  { dcmim2Status 3 }
-dcmim2StatusLVD                OBJECT IDENTIFIER ::=  { dcmim2Status 4 }
-dcmim2StatusAlarms             OBJECT IDENTIFIER ::=  { dcmim2Status 5 }
-
-external                       OBJECT IDENTIFIER ::=  { environmentalMonitor 1 }
-integrated                     OBJECT IDENTIFIER ::=  { environmentalMonitor 2 }
-envMgtSystem                   OBJECT IDENTIFIER ::=  { environmentalMonitor 3 }
-
-emIdent                        OBJECT IDENTIFIER ::=  { external 1 }
-emConfig                       OBJECT IDENTIFIER ::=  { external 2 }
-emStatus                       OBJECT IDENTIFIER ::=  { external 3 }
-
-iemIdent                       OBJECT IDENTIFIER ::=  { integrated 1 }
-iemConfig                      OBJECT IDENTIFIER ::=  { integrated 2 }
-iemStatus                      OBJECT IDENTIFIER ::=  { integrated 3 }
-
-emsIdent                        OBJECT IDENTIFIER ::=  { envMgtSystem 1 }
-
-emsOutputRelayControl           OBJECT IDENTIFIER ::=  { envMgtSystem 2 }
-emsOutletControl                OBJECT IDENTIFIER ::=  { envMgtSystem 3 }
-emsSensorControl                OBJECT IDENTIFIER ::=  { envMgtSystem 4 }
-emsAlarmDeviceControl           OBJECT IDENTIFIER ::=  { envMgtSystem 5 }
-
-emsConfig                       OBJECT IDENTIFIER ::=  { envMgtSystem 6 }
-emsProbeConfig                  OBJECT IDENTIFIER ::=  { envMgtSystem 7 }
-emsInputContactConfig           OBJECT IDENTIFIER ::=  { envMgtSystem 8 }
-emsOutputRelayConfig            OBJECT IDENTIFIER ::=  { envMgtSystem 9 }
-emsOutletConfig                 OBJECT IDENTIFIER ::=  { envMgtSystem 10 }
-emsSensorConfig                 OBJECT IDENTIFIER ::=  { envMgtSystem 11 }
-
-emsStatus                       OBJECT IDENTIFIER ::=  { envMgtSystem 12 }
-emsProbeStatus                  OBJECT IDENTIFIER ::=  { envMgtSystem 13 }
-emsInputContactStatus           OBJECT IDENTIFIER ::=  { envMgtSystem 14 }
-emsOutputRelayStatus            OBJECT IDENTIFIER ::=  { envMgtSystem 15 }
-emsOutletStatus                 OBJECT IDENTIFIER ::=  { envMgtSystem 16 }
-emsAlarmDeviceStatus            OBJECT IDENTIFIER ::=  { envMgtSystem 17 }
-emsSensorStatus                 OBJECT IDENTIFIER ::=  { envMgtSystem 18 }
-
-nlIdent                        OBJECT IDENTIFIER ::=  { netlock 1 }
-nlStatus                       OBJECT IDENTIFIER ::=  { netlock 2 }
-
-airFM                           OBJECT IDENTIFIER ::=  { airConditioners 1 }
-airFMIdent                      OBJECT IDENTIFIER ::=  { airFM 1 }
-airFMStatus                     OBJECT IDENTIFIER ::=  { airFM 2 }
-airFMGroup                      OBJECT IDENTIFIER ::=  { airFM 3 }
-
-airPA                           OBJECT IDENTIFIER ::= { airConditioners 2 }
-airPAIdent                      OBJECT IDENTIFIER ::= { airPA 1 }
-airPAStatus                     OBJECT IDENTIFIER ::= { airPA 2 }
-
-rARUIdent                      OBJECT IDENTIFIER ::=  { rARU 1 }
-rARUConfig                     OBJECT IDENTIFIER ::=  { rARU 2 }
-rARUStatus                     OBJECT IDENTIFIER ::=  { rARU 3 }
-
-
--- object types
-
--- the products group
--- the experimental group
-
-
-
--- the apcmgmt group
--- the mconfig group
-
-mconfigNumTrapReceivers OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of managers to send traps to."
-   ::= { mconfig 1 }
-
-mconfigTrapReceiverTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MconfigTrapReceiverEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of managers to send traps to.  The number of
-       entries is given by the value of mconfigNumTrapReceivers.
-      Maximum number of Trap Receivers is four."
-   ::= { mconfig 2 }
-
-mconfigTrapReceiverEntry OBJECT-TYPE
-   SYNTAX MconfigTrapReceiverEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The managers to send traps to."
-   INDEX  { trapIndex}
-   ::= { mconfigTrapReceiverTable 1 }
-
-MconfigTrapReceiverEntry ::=
-   SEQUENCE {
-      trapIndex
-         INTEGER,
-      receiverAddr
-         IpAddress,
-      communityString
-          DisplayString,
-      severity
-         INTEGER,
-      acceptThisReceiver
-         INTEGER, 
-      receiveTrapType
-         INTEGER
-   }
-
-trapIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to a trap receiver entry."
-   ::= { mconfigTrapReceiverEntry 1 }
-
-receiverAddr OBJECT-TYPE
-   SYNTAX IpAddress
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The IP address of the manager to send a trap to."
-   ::= { mconfigTrapReceiverEntry 2 }
-
-communityString OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The community name to use in the trap when
-       sent to the manager."
-   ::= { mconfigTrapReceiverEntry 3 }
-
-severity OBJECT-TYPE
-   SYNTAX INTEGER {
-      information(1),
-      warning(2),
-      severe(3)
-   }
-   ACCESS read-only
-   STATUS obsolete
-   DESCRIPTION
-      "The severity threshold of traps to send to the manager.
-       traps are labeled in severity as informational(1), warning(2),
-       severe(3).  Only traps of equal or greater severity than
-       this value are sent to the manager."
-   ::= { mconfigTrapReceiverEntry 4 }
-
-acceptThisReceiver OBJECT-TYPE
-   SYNTAX INTEGER   {
-      yes (1),
-      no  (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "An entry will become active if yes, and will
-       be deleted if no."
-   ::= { mconfigTrapReceiverEntry 5 }
-
-
-receiveTrapType OBJECT-TYPE
-   SYNTAX INTEGER   {
-      powernet (1),
-      ietf     (2),
-      both     (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The node in this entry will receive traps defined in APC
-       PowerNet MIB, if this OID is set to yes."
-   ::= { mconfigTrapReceiverEntry 6 }
-
-mconfigBOOTPEnabled OBJECT-TYPE
-   SYNTAX INTEGER {
-      yes (1),
-      no  (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The value of yes(1) indicates the PowerNet Adapter is configured to
-       obtain its IP configuration parameters from a BOOTP server.
-       
-       The value of no(2) indicates adapter will assume IP configuration parameters 
-       values saved in adapter's eeprom, which was originally configured at local
-       console."
-   ::= { mconfig 3 }
-
-mconfigTFTPServerIP OBJECT-TYPE
-   SYNTAX IpAddress
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The IP address of TFTP server. If mconfigBOOTPEnabled is yes(1), then this IP address
-       is provided by BOOTP server and not allowed to be modified; otherwise, this IP address
-       can be modified.
-       
-       Before using TFTP to load new code image, the image file should be placed in proper
-       directory of the specified TFTP server. This OID is only supported by AP9605, AP9205, 
-       and AP9603 PowerNet SNMP Adapters."
-   ::= { mconfig 4 }
-
-newCodeAuthentViaTFTP OBJECT-TYPE
-   SYNTAX INTEGER {
-      unknown                (1),
-      validNewAgentCodeImage (2),
-      sameAgentCodeImage     (3),
-      invalidAgentCodeImage  (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Once mcontrolRestartAgent is set to loadAndExecuteNewAgent (3), PowerNet adapter will
-       start to load the remote image file, for authentication only, instead of saving the code 
-       into flash memory. Only if a validNewAgentCodeImage (1) is found will the agent reboot
-       the PowerNet adapter and invoke the loader to load and save new code into the flash memory. 
-       Otherwise, the current agent code will continue to run.
-       
-       This OID shows the result of the above authentication process.  
-                validNewAgentCodeImage (1) means the code image on TFTP server 
-                is a valid APC agent code and is different version from the current agent.
-                Once agent identifies this, loader will start to update flash memory with
-                the new agent code.
-       
-                sameAgentCodeImage  (2)  means the code image on TFTP server is exactly the
-                same as the currently running agent. Currently running agent will not invoke
-                loader to load the same again.
-                
-                invalidAgentCodeImage  (3) means the code image on TFTP server is NOT a valid
-                APC agent code. Thus, current agent will not load it into the flash memory.
-                
-       The value of this OID will be associated with TRAP codeImageAuthentDone.
-       This OID is only supported by AP9605, AP9205, and AP9603 PowerNet SNMP Adapters."
-       
-   ::= { mconfig 5 }
-
-mconfigClockDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The current date in the mm/dd/yyyy format. Example: 01/01/2000."
-   ::= { mconfigClock 1 }
-
-mconfigClockTime OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The current time in the hh:mm:ss am/pm format. Example: 12:00:00 am."
-   ::= { mconfigClock 2 }
-
-mcontrolRestartAgent OBJECT-TYPE
-   SYNTAX INTEGER   {
-      restartCurrentAgent    (1),
-      continueCurrentAgent   (2),
-      loadAndExecuteNewAgent (3),
-      restartWithoutAgent    (4),
-      resetNetworkAndRestart (5),
-      resetNetworkLeaveModeAndRestart (6)
-  }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to restartCurrentAgent (1) will restart the same SNMP
-       agent code currently saved in flash memory. Setting this OID to
-       loadAndExecuteNewAgent (3) will enable adapter to load a new agent code
-       into the flash memory and start to execute this new agent code.
-       Bootp/tftp is the default protocol. loadAndExecuteNewAgent is only
-       supported by AP9605, AP9205, and AP9603 PowerNet SNMP Adapters. Setting
-       this OID to restartWithoutAgent (4) will restart the system and not
-       start the agent. The subsequent time the system restarts the agent will
-       also automatically restart. Setting this OID to
-       resetNetworkAndRestart (5) will set the Boot Mode, IP Address, Subnet
-       Mask, and Default Gateway to defaults, expire any existing DHCP lease
-       and then restart the system. Setting this OID to
-       resetNetworkLeaveModeAndRestart (6) will leave the Boot Mode at the
-       current setting, set the IP Address, Subnet Mask, and Default Gateway to
-       defaults, expire any existing DHCP lease and then restart the system."
-
-   ::= { mcontrol 1 }
-
--- The mtrapargs group
--- These OIDs allows APC traps to be sent with additional arguments
--- which may not be defined in the APC MIB.
-      
-mtrapargsInteger OBJECT-TYPE
-   SYNTAX INTEGER    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an integer argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 1 }
-
-mtrapargsIpAddress OBJECT-TYPE
-   SYNTAX IpAddress   
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an IP address argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0.0.0.0."
-   ::= { mtrapargs 2 }
-
-mtrapargsString OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an octet string argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return a NULL string."
-   ::= { mtrapargs 3 }
-
-mtrapargsGauge OBJECT-TYPE
-   SYNTAX  Gauge 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with a Gauge argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 4 }
-
-mtrapargsTimeTicks OBJECT-TYPE
-   SYNTAX TimeTicks  
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with a TimeTicks argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 5 }
-
-mtrapargsInteger02 OBJECT-TYPE
-   SYNTAX INTEGER    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an integer argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 6 }
-
-mtrapargsInteger03 OBJECT-TYPE
-   SYNTAX INTEGER    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an integer argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 7 }
-
-mtrapargsIpAddress02 OBJECT-TYPE
-   SYNTAX IpAddress   
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an IP address argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0.0.0.0."
-   ::= { mtrapargs 8 }
-
-mtrapargsIpAddress03 OBJECT-TYPE
-   SYNTAX IpAddress   
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an IP address argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0.0.0.0."
-   ::= { mtrapargs 9 }
-   
-mtrapargsString02 OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an octet string argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return a NULL string."
-   ::= { mtrapargs 10 }
-
-mtrapargsString03 OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with an octet string argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return a NULL string."
-   ::= { mtrapargs 11 }
-
-mtrapargsGauge02 OBJECT-TYPE
-   SYNTAX  Gauge 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with a Gauge argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 12 }
-
-mtrapargsGauge03 OBJECT-TYPE
-   SYNTAX  Gauge 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with a Gauge argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 13 }
-
-mtrapargsTimeTicks02 OBJECT-TYPE
-   SYNTAX TimeTicks  
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with a TimeTicks argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 14 }
-
-mtrapargsTimeTicks03 OBJECT-TYPE
-   SYNTAX TimeTicks  
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID allows APC traps to be sent with a TimeTicks argument
-       that my not be defined in the APC MIB.
-      
-       A get of this OID will return 0."
-   ::= { mtrapargs 15 }
-   
--- the mfiletransfer group
--- the mfiletransferStatus group
-mfiletransferStatusLastTransferResult OBJECT-TYPE
-   SYNTAX INTEGER {
-      lastFileTransferResultSuccessful                 (1),
-      lastFileTransferResultNotAvailable               (2),
-      lastFileTransferResultFailureUnknown             (3),
-      lastFileTransferResultFailureServerInaccessible  (4),
-      lastFileTransferResultFailureServerAccessDenied  (5),
-      lastFileTransferResultFailureFileNotFound        (6),
-      lastFileTransferResultFailureFileTypeUnknown     (7),
-      lastFileTransferResultFailureFileCorrupted       (8)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Once mfiletransferControlInitiateFileTransfer is set to a value other than doNotInitiateFileTransfer
-      a file transfer of mfiletransferConfigSettingsFilename will be attempted from either a TFTP or FTP
-      server.
-       
-      This OID shows the last attempted file transfer result.
-        lastFileTransferResultSuccessful (1) means the file transfer was successful.
-        lastFileTransferResultNotAvailable (2) means that there have been no previous file transfers.
-        lastFileTransferResultFailureUnknown (3) means that the last file transfer failed for an unknown reason.
-        lastFileTransferResultFailureServerInaccessible (4) means that the TFTP or FTP server could not be found on the network.
-        lastFileTransferResultFailureServerAccessDenied (5) means that the TFTP or FTP server denied access.
-        lastFileTransferResultFailureFileNotFound (6) means that the file could not be located.
-        lastFileTransferResultFailureFileTypeUnknown (7) means the file was examined, but the contents were unknown.
-        lastFileTransferResultFailureFileCorrupt (8) means the transferred file was corrupt."
-       
-   ::= { mfiletransferStatus 1 }
-   
--- the mfiletransferConfig group
--- the mfiletransferConfigSettings group
-
-mfiletransferConfigSettingsFilename  OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The path and name of the file to transfer using the mfiletransferControlInitiateFileTransfer OID.
-      If the file to transfer exists in the default server directory then the path may be omitted."
-
-   ::= { mfiletransferConfigSettings 1 }
-
--- the mfiletransferConfigTFTP group
-
-mfiletransferConfigTFTPServerAddress     OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The IP Address in dotted decimal notation of the TFTP server involved in the file transfer."
-
-   ::= { mfiletransferConfigTFTP 1 }
-
--- the mfiletransferConfigFTP group
-
-mfiletransferConfigFTPServerAddress  OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The IP Address in dotted decimal notation of the FTP server involved in the file transfer."
-
-   ::= { mfiletransferConfigFTP 1 }
-
-mfiletransferConfigFTPServerUser     OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The user identification for logging into the FTP server specified with mfiletransferConfigFTPServerAddress."
-
-   ::= { mfiletransferConfigFTP 2 }
-
-mfiletransferConfigFTPServerPassword     OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The password for logging into the FTP server specified with mfiletransferConfigFTPServerAddress."
-
-   ::= { mfiletransferConfigFTP 3 }
-
--- the mfiletransferControl group
-
-mfiletransferControlInitiateFileTransfer OBJECT-TYPE
-   SYNTAX INTEGER   {
-      doNotInitiateFileTransfer             (1),
-      initiateFileTransferDownloadViaTFTP   (2),
-      initiateFileTransferDownloadViaFTP    (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to doNotInitiateFileTransfer (1) will do nothing.
-       
-      Setting this OID to initiateFileTransferDownloadViaTFTP (2) will attempt to transfer the file named in 
-      mfiletransferConfigSettingsFilename from the TFTP Server identified in mfiletransferConfigTFTPAddress.
-       
-      Setting this OID to initiateFileTransferDownloadViaFTP (3) will attempt to transfer the file named in 
-      mfiletransferConfigSettingsFilename from the FTP Server identified in mfiletransferConfigFTPAddress 
-      using mfiletransferConfigFTPUser and mfiletransferConfigFTPPassword for the FTP Server login process."
-
-   ::= { mfiletransferControl 1 }
-
--- the battManIdent group
-
-battManIdentProductName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the battery manager."
-   ::= { battManIdent 1 }
-
-battManIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery manager network interface hardware revision. 
-       This value is set at the factory." 
-   ::= { battManIdent 2 }
-
-battManIdentFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery manager network interface firmware revision. 
-       This value is set at the factory and can change with firmware update." 
-   ::= {  battManIdent 3 }
-
-battManIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date the battery manager was manufactured in mm/dd/yyyy format. 
-       This value is set at the factory." 
-   ::= { battManIdent 4 }
-   
-battManIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery manager model number character string. 
-       This value is set at the factory."
-   ::= { battManIdent 5 }
-
-battManIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery manager serial number character string. 
-       This value is set at the factory."
-   ::= { battManIdent 6 }
-
--- the battManCalib group
--- system calibration
-
-battManOhmicValueCorrectionFactor OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The system ohmic value correction factor in percent."
-   ::= { battManSystemCalib 1 }
-
--- unit calibration
-
-battManUnitCalibTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManUnitCalibTable."
-   ::= { battManUnitCalib 1 }
-   
-battManUnitCalibTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManUnitCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting calibration information from each unit in the system."
-   ::= { battManUnitCalib 2 }
-   
-battManUnitCalibTableEntry OBJECT-TYPE
-   SYNTAX BattManUnitCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The unit to get data from."
-   INDEX { battManUnitCalibIndex }
-   ::= { battManUnitCalibTable 1 }
-   
-BattManUnitCalibTableEntry ::=
-   SEQUENCE {
-       battManUnitCalibIndex           INTEGER,
-       battManUnitSerialNumber         DisplayString,
-       battManBatteryVoltageZeroCalib  INTEGER,                                 
-       battManBatteryVoltageSpanCalib  INTEGER
-   }       
-
-battManUnitCalibIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of unit calibration entries in the table."
-   ::= { battManUnitCalibTableEntry 1 }
-
-battManUnitSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The serial number of the unit."
-   ::= { battManUnitCalibTableEntry 2 }
-
-battManBatteryVoltageZeroCalib OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The unit battery voltage zero calibration in millivolts."
-   ::= { battManUnitCalibTableEntry 3 }
-
-battManBatteryVoltageSpanCalib OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The unit battery voltage span calibration in percent."
-   ::= { battManUnitCalibTableEntry 4 }
-
--- string calibration table
-
-battManStringCalibTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManStringCalibTable."
-   ::= { battManStringCalib 1 }
-   
-battManStringCalibTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManStringCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting calibration information from each string in the system."
-   ::= { battManStringCalib 2 }
-   
-battManStringCalibTableEntry OBJECT-TYPE
-   SYNTAX BattManStringCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManStringCalibIndex }
-   ::= { battManStringCalibTable 1 }
-   
-BattManStringCalibTableEntry ::=
-   SEQUENCE {
-       battManStringCalibIndex             INTEGER,
-       battManDCCurrentZeroCalib           INTEGER,                                 
-       battManACCurrentZeroCalib           INTEGER,
-       battManProbeRange                   INTEGER
-   }       
-
-battManStringCalibIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of string calibration entries in the table."
-   ::= { battManStringCalibTableEntry 1 }
-
-battManDCCurrentZeroCalib OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The string DC current zero calibration in tenths of amps."
-   ::= { battManStringCalibTableEntry 2 }
-
-battManACCurrentZeroCalib OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The string AC current zero calibration in tenths of amps."
-   ::= { battManStringCalibTableEntry 3 }
-
-battManProbeRange OBJECT-TYPE
-   SYNTAX INTEGER {
-       amps1000    (1),
-       amps500     (2),
-       amps100     (3)
-   }    
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The string probe range in amps."
-   ::= { battManStringCalibTableEntry 4 }
-
---string 1 battery calibration table
-
-battManString1BatteryCalibTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManString1BatteryCalibTable."
-   ::= { battManBatteryCalib 1 }
-   
-battManString1BatteryCalibTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString1BatteryCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting calibration information from each battery in String 1."
-   ::= { battManBatteryCalib 2 }
-   
-battManString1BatteryCalibTableEntry OBJECT-TYPE
-   SYNTAX BattManString1BatteryCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManString1BatteryCalibIndex }
-   ::= { battManString1BatteryCalibTable 1 }
-   
-BattManString1BatteryCalibTableEntry ::=
-   SEQUENCE {
-       battManString1BatteryCalibIndex             INTEGER,
-       battManString1BatteryInterTierOhmicValue    INTEGER
-   }       
-
-battManString1BatteryCalibIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of battery calibration entries in the table."
-   ::= { battManString1BatteryCalibTableEntry 1 }
-
-battManString1BatteryInterTierOhmicValue OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The battery inter-tier ohmic value in ohms.  This corresponds to the ohmic 
-       value for the positive terminal of the battery."
-   ::= { battManString1BatteryCalibTableEntry 2 }
-
---string 2 battery calibration table
-
-battManString2BatteryCalibTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManString2BatteryCalibTable."
-   ::= { battManBatteryCalib 3 }
-   
-battManString2BatteryCalibTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString2BatteryCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting calibration information from each battery in String 2."
-   ::= { battManBatteryCalib 4 }
-   
-battManString2BatteryCalibTableEntry OBJECT-TYPE
-   SYNTAX BattManString2BatteryCalibTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManString2BatteryCalibIndex }
-   ::= { battManString2BatteryCalibTable 1 }
-   
-BattManString2BatteryCalibTableEntry ::=
-   SEQUENCE {
-       battManString2BatteryCalibIndex             INTEGER,
-       battManString2BatteryInterTierOhmicValue    INTEGER
-   }       
-
-battManString2BatteryCalibIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of battery calibration entries in the table."
-   ::= { battManString2BatteryCalibTableEntry 1 }
-
-battManString2BatteryInterTierOhmicValue OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "The battery inter-tier ohmic value in ohms."
-   ::= { battManString2BatteryCalibTableEntry 2 }
-
--- the battManConfig group
-
-battManConfigApplication OBJECT-TYPE
-   SYNTAX INTEGER {
-     silcon          (1),
-     other           (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The type of application the battery manager is installed on: 
-       Silcon(1) Silcon UPS or 
-       Other(2) Other UPS/Charger."
-   ::= { battManConfig 1 } 
-
-battManConfigBatteryChemistry OBJECT-TYPE
-   SYNTAX INTEGER {
-     leadAcid        (1),
-     nickel-Cadmium  (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The battery chemistry of the monitored batteries: 
-       LeadAcid(1) Lead Acid or 
-       Nickel-Cadmium(2) Nickel-Cadmium."
-   ::= { battManConfig 2 }
-
-battManConfigBatteryAHCapacity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amp hour capacity of the monitored batteries 5-2000 AH."
-   ::= { battManConfig 3 }
-
-battManConfigNumberofStrings OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The number of strings in the battery manager system (1 - 2 Silcon)/(1 Other)."
-   ::= { battManConfig 4 }
-
-battManConfigBatteriesperString OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The number of batteries per string."
-   ::= { battManConfig 5 }
-
-battManConfigCellsperBattery OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The number of cells per battery (1 - 6 for lead-acid, 1 - 2 for NiCd."
-   ::= { battManConfig 6 }
-
-battManConfigMinCellVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The minimum battery cell voltage alarm limit in millivolts DC."
-   ::= { battManConfig 7 }
-
-battManConfigMaxCellVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum battery cell voltage alarm limit in millivolts DC."
-   ::= { battManConfig 8 }
-
-battManConfigMaxPilotTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum pilot battery temperature alarm limit in tenths of degrees Fahrenheit."
-   ::= { battManConfig 9 }
-
-battManConfigMaxPilotTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum pilot battery temperature alarm limit in tenths of degrees Celcius."
-   ::= { battManConfig 10 }
-
-battManConfigMaxAmbientTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum ambient temperature alarm limit in tenths of degrees Fahrenheit."
-   ::= { battManConfig 11 }
-
-battManConfigMaxAmbientTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum ambient temperature alarm limit in tenths of degrees Celcius."
-   ::= { battManConfig 12 }
-
-battManConfigMinAmbientTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The Minimum Ambient Temperature alarm limit in tenths of degrees Fahrenheit."
-   ::= { battManConfig 13 }
-
-battManConfigMinAmbientTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The Minimum Ambient Temperature alarm limit in tenths of degrees Celcius."
-   ::= { battManConfig 14 }
-
-battManConfigMaxRippleCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum ripple current alarm limit for the monitored battery 
-       strings in percent of AH capacity."
-   ::= { battManConfig 15 }
-
-battManConfigMaxCurrentAcceptanceDeviation OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum current acceptance deviation alarm limit in percentage."
-   ::= { battManConfig 16 }
-
-battManConfigMonitorWireLength OBJECT-TYPE
-   SYNTAX INTEGER {
-     fiftyFeetOrLess   (1),
-     moreThanFiftyFeet (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The monitor wire length:
-       fiftyFeetOrLess (1) indicates that the wire length is less than or equal to 50 feet.
-       moreThanFiftyFeet (2) indicates that the wire length is greater than 50 feet."
-   ::= { battManConfig 17 }
-
-battManConfigDischargeVoltageAlarmLevel OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The discharge voltage alarm level in percent."
-   ::= { battManConfig 18 }
-
-battManConfigAutoAnnunciatorReset OBJECT-TYPE
-   SYNTAX INTEGER {
-     disabled  (1),
-     enabled   (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The annunciator output signal reset method:
-       disabled(1) means the annunciator signal output will be reset when the reset button is pressed.
-       enabled(2) means the annunciator will stop signalling when all alarm conditions clear."
-   ::= { battManConfig 19 }
-
--- the battManAlarm group
-
-battManAlarmManagementController OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Management Controller Alarm is : 
-       normal(1) no alarm condtions identified
-       alarm(2) an alarm condition exits."
-   ::= { battManAlarm 1 }
-
-battManAlarmBatteries  OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Batteries Alarm is : 
-       normal(1) no alarm condtions identified
-       alarm(2) an alarm condition exits."
-   ::= { battManAlarm 2 }
-
-battManAlarmCharger OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Charger Alarm is : 
-       normal(1) no alarm condtions identified
-       alarm(2) an alarm condition exits."
-   ::= { battManAlarm 3 }
-
-battManAlarmEnvironment OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Environment Alarm is : 
-       normal(1) no alarm condtions identified
-       alarm(2) an alarm condition exits."
-   ::= { battManAlarm 4 }
-
--- the battManSystemStatus group
-
--- These are system wide parameters
-
-battManSystemAmbientTempC OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system ambient temperture in tenths of degrees Celcius."
-   ::= { battManSystemStatus 1 }
-
-battManSystemAmbientTempF OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system ambient temperture in tenths of degrees Fahrenheit."
-   ::= { battManSystemStatus 2 }
-
-battManSystemPilotTempC OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system pilot temperature in tenths of degrees Celcius."
-   ::= { battManSystemStatus 3 }
-
-battManSystemPilotTempF OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system pilot temperature in tenths of degrees Fahrenheit."
-   ::= { battManSystemStatus 4 }
-
-battManSystemAmbientHighTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the system has a high temperature alarm."
-   ::= { battManSystemStatus 5 }
-
-battManSystemAmbientLowTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the system has a low temperature alarm."
-   ::= { battManSystemStatus 6 }
-
-battManSystemPilotBatteryHighTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the system has a pilot battery high temperature alarm."
-   ::= { battManSystemStatus 7 }
-
-battManSystemPilotProbeDisconnected OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the system pilot probe is disconnected."
-   ::= { battManSystemStatus 8 }
-
-battManSystemAmbientProbeDisconnected OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the system ambient probe is disconnected."
-   ::= { battManSystemStatus 9 }
-
--- This is a table of input contact parameters
-
-battManInputContactTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of entries in the battManContactTable." 
-   ::= { battManInputContactStatus 1 }
-
-battManInputContactTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManInputContactTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting information from each contact 
-       in the system. " 
-   ::= { battManInputContactStatus 2 }
-
-battManInputContactTableEntry OBJECT-TYPE
-   SYNTAX BattManInputContactTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The contact to get data from."
-   INDEX  { battManInputContactIndex }
-   ::= { battManInputContactTable 1 }
-
-BattManInputContactTableEntry ::=
-   SEQUENCE {
-      battManInputContactIndex                 INTEGER,
-      battManInputContactName                  DisplayString,
-      battManInputContactAlarmState            INTEGER,
-      battManInputContactState                 INTEGER,
-      battManInputContactNormalState           INTEGER,
-      battManInputContactAlarmDelay            INTEGER
-   }
-   
-battManInputContactIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Index of contact entries in the table."
-   ::= { battManInputContactTableEntry 1 }
-
-battManInputContactName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the input contact."
-   ::= { battManInputContactTableEntry 2 }
-
-battManInputContactAlarmState OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the alarm condition is active for this contact."
-   ::= { battManInputContactTableEntry 3 }
-
-battManInputContactState OBJECT-TYPE
-   SYNTAX INTEGER {
-     open      (1),
-     closed    (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to open(1), the input contact is in the open state.
-       When set to closed(2), the input contact is in the closed state."
-   ::= { battManInputContactTableEntry 4 }
-
-battManInputContactNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-     open      (1),
-     closed    (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to open(1), the input contact is normally open.
-       When set to closed(2), the input contact is normally closed."
-   ::= { battManInputContactTableEntry 5 }
-
-battManInputContactAlarmDelay OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The alarm delay time in seconds."
-   ::= { battManInputContactTableEntry 6 }
-
--- This is a table of battery string parameters
-
-battManStringTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of entries in the battManStringTable." 
-   ::= { battManStringStatus 1 }
-
-battManStringTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManStringTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting information from each string 
-       in the system. " 
-   ::= { battManStringStatus 2 }
-
-battManStringTableEntry OBJECT-TYPE
-   SYNTAX BattManStringTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The string to get data from."
-   INDEX  { battManStringIndex }
-   ::= { battManStringTable 1 }
-
-BattManStringTableEntry ::=
-   SEQUENCE {
-      battManStringIndex                       INTEGER,
-      battManStringCurrent                     INTEGER,
-      battManStringRippleCurrent               INTEGER,
-      battManStringChargerHighVoltageAlarm     INTEGER,
-      battManStringChargerLowVoltageAlarm      INTEGER,
-      battManStringCurrentProbeDisconnected    INTEGER,
-      battManStringOnBattery                   INTEGER
-   }
-   
-battManStringIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Index of string entries in the table."
-   ::= { battManStringTableEntry 1 }
-
-battManStringCurrent OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The string current in tenths of Amps."
-   ::= { battManStringTableEntry 2 }
-
-battManStringRippleCurrent OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The string ripple current in tenths of Amps."
-   ::= { battManStringTableEntry 3 }
-
-battManStringChargerHighVoltageAlarm OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the string charger has a high voltage alarm."
-   ::= { battManStringTableEntry 4 }
-
-battManStringChargerLowVoltageAlarm OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the string charger has a low voltage alarm."
-   ::= { battManStringTableEntry 5 }
-
-battManStringCurrentProbeDisconnected OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the string charger probe is disconnected."
-   ::= { battManStringTableEntry 6 }
-
-battManStringOnBattery OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that the string is in the on-battery state."
-   ::= { battManStringTableEntry 7 }
-
--- the battManString1BatteryStatus group
-
-battManString1BatteryTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of entries in the battManString1BatteryStatusTable." 
-   ::= { battManBatteryStatus 1 }
-
-battManString1BatteryTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString1BatteryTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting information from each string 
-       in the system. " 
-   ::= { battManBatteryStatus 2 }
-
-battManString1BatteryTableEntry OBJECT-TYPE
-   SYNTAX BattManString1BatteryTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The string to get data from."
-   INDEX  { battManString1BatteryIndex }
-   ::= { battManString1BatteryTable 1 }
-
-BattManString1BatteryTableEntry ::=
-   SEQUENCE {
-      battManString1BatteryIndex                       INTEGER,
-      battManString1BatteryVoltage                     INTEGER,
-      battManString1BatteryLowestVoltage               INTEGER,
-      battManString1BatteryCellShorted                 INTEGER, 
-      battManString1BatteryOpenFuseOrConnection        INTEGER, 
-      battManString1BatteryLowCapacity                 INTEGER, 
-      battManString1BatteryHighOhmicValue              INTEGER, 
-      battManString1BatteryThermalRunaway              INTEGER, 
-      battManString1BatteryDryout                      INTEGER
-   }
-   
-battManString1BatteryIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Index of string entries in the table."
-   ::= { battManString1BatteryTableEntry 1 }
-
-battManString1BatteryVoltage OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery voltage in milli VDC."
-   ::= { battManString1BatteryTableEntry 2 }
-   
-battManString1BatteryLowestVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The lowest battery discharge voltage during the last power event in milli VDC."
-   ::= { battManString1BatteryTableEntry 3 }
-   
-battManString1BatteryCellShorted OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that a battery cell is shorted."
-   ::= { battManString1BatteryTableEntry 4 }
-
-battManString1BatteryOpenFuseOrConnection OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that a fuse or connection is open."
-   ::= { battManString1BatteryTableEntry 5 }
-
-battManString1BatteryLowCapacity OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has low capacity."
-   ::= { battManString1BatteryTableEntry 6 }
-
-battManString1BatteryHighOhmicValue OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has a high ohmic value."
-   ::= { battManString1BatteryTableEntry 7 }
-
-battManString1BatteryThermalRunaway OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has a thermal runaway condition."
-   ::= { battManString1BatteryTableEntry 8 }
-
-battManString1BatteryDryout OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has a dryout condition."
-   ::= { battManString1BatteryTableEntry 9 }
-
--- the battManString2BatteryStatus group
-
-battManString2BatteryTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of entries in the battManString2BatteryStatusTable." 
-   ::= { battManBatteryStatus 3 }
-
-battManString2BatteryTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString2BatteryTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting information from each string 
-       in the system. " 
-   ::= { battManBatteryStatus 4 }
-
-battManString2BatteryTableEntry OBJECT-TYPE
-   SYNTAX BattManString2BatteryTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The string to get data from."
-   INDEX  { battManString2BatteryIndex }
-   ::= { battManString2BatteryTable 1 }
-
-BattManString2BatteryTableEntry ::=
-   SEQUENCE {
-      battManString2BatteryIndex                       INTEGER,
-      battManString2BatteryVoltage                     INTEGER,
-      battManString2BatteryLowestVoltage               INTEGER,
-      battManString2BatteryCellShorted                 INTEGER, 
-      battManString2BatteryOpenFuseOrConnection        INTEGER, 
-      battManString2BatteryLowCapacity                 INTEGER, 
-      battManString2BatteryHighOhmicValue              INTEGER, 
-      battManString2BatteryThermalRunaway              INTEGER, 
-      battManString2BatteryDryout                      INTEGER
-   }
-   
-battManString2BatteryIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Index of string entries in the table."
-   ::= { battManString2BatteryTableEntry 1 }
-
-battManString2BatteryVoltage OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery voltage in milli VDC."
-   ::= { battManString2BatteryTableEntry 2 }
-   
-battManString2BatteryLowestVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The lowest battery discharge voltage during the last power event in milli VDC."
-   ::= { battManString2BatteryTableEntry 3 }
-   
-battManString2BatteryCellShorted OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that a battery cell is shorted."
-   ::= { battManString2BatteryTableEntry 4 }
-
-battManString2BatteryOpenFuseOrConnection OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates that a fuse or connection is open."
-   ::= { battManString2BatteryTableEntry 5 }
-
-battManString2BatteryLowCapacity OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has low capacity."
-   ::= { battManString2BatteryTableEntry 6 }
-
-battManString2BatteryHighOhmicValue OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has a high ohmic value."
-   ::= { battManString2BatteryTableEntry 7 }
-
-battManString2BatteryThermalRunaway OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has a thermal runaway condition."
-   ::= { battManString2BatteryTableEntry 8 }
-
-battManString2BatteryDryout OBJECT-TYPE
-   SYNTAX INTEGER {
-     normal          (1),
-     alarm           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When set to alarm(2), indicates a battery has a dryout condition."
-   ::= { battManString2BatteryTableEntry 9 }
-
--- battery manager control group
-battManRemoteAnnunciatorReset OBJECT-TYPE
-   SYNTAX INTEGER {
-       noOperation (1),
-       reset       (2)
-   }    
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to reset(2) will reset the user interface annunciator.
-       Getting this OID will do nothing and return the noOperation(1) value."
-   ::= { battManControl 1 }
-
-battManResetChargeCurrentDeviationBenchmark OBJECT-TYPE
-   SYNTAX INTEGER {
-       noOperation (1),
-       reset       (2)
-   }    
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to reset(2) will reset the charge current deviation benchmark.
-       Getting this OID will do nothing and return the noOperation(1) value."
-   ::= { battManControl 2 }
-
-battManResetLowestDischargeVoltages OBJECT-TYPE
-   SYNTAX INTEGER {
-       noOperation (1),
-       reset       (2)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to reset(2) will reset the lowest discharge voltages.
-       Getting this OID will do nothing and return the noOperation(1) value."
-   ::= { battManControl 3 }
-
--- the battManTestResults group
-
---string 1 test results table
-
-battManString1OhmicValueLastDischargeInfo OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Informational text showing the date/time, load, and pilot temperature for the string
-       during the last discharge when ohmic values were recorded."
-   ::= { battManTestResults 1 }       
-
-battManString1OhmicValueTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManString1OhmicValueTable."
-   ::= { battManTestResults 2 }
-   
-battManString1OhmicValueTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString1OhmicValueTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting ohmic value information from each battery in String 1."
-   ::= { battManTestResults 3 }
-   
-battManString1OhmicValueTableEntry OBJECT-TYPE
-   SYNTAX BattManString1OhmicValueTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManString1OhmicValueIndex }
-   ::= { battManString1OhmicValueTable 1 }
-   
-BattManString1OhmicValueTableEntry ::=
-   SEQUENCE {
-       battManString1OhmicValueIndex   INTEGER,
-       battManString1OhmicValueData    INTEGER
-   }       
-
-battManString1OhmicValueIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The battery number."
-   ::= { battManString1OhmicValueTableEntry 1 }
-
-battManString1OhmicValueData OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The battery inter-tier ohmic value in ohms.
-       Note: Negative values are invalid and may indicate faulty calibration
-       of ohmic value correction factors."
-   ::= { battManString1OhmicValueTableEntry 2 }
-
-battManString1ResponseTestChangeTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManString1ResponseTestChangeTable."
-   ::= { battManTestResults 4 }
-   
-battManString1ResponseTestChangeTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString1ResponseTestChangeTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting response test change information from each battery in String 1."
-   ::= { battManTestResults 5 }
-   
-battManString1ResponseTestChangeTableEntry OBJECT-TYPE
-   SYNTAX BattManString1ResponseTestChangeTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManString1ResponseTestChangeIndex }
-   ::= { battManString1ResponseTestChangeTable 1 }
-   
-BattManString1ResponseTestChangeTableEntry ::=
-   SEQUENCE {
-       battManString1ResponseTestChangeIndex   INTEGER,
-       battManString1ResponseTestChangeData    INTEGER
-   }       
-
-battManString1ResponseTestChangeIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of the entries in the table."
-   ::= { battManString1ResponseTestChangeTableEntry 1 }
-
-battManString1ResponseTestChangeData OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The battery response test change in percent."
-   ::= { battManString1ResponseTestChangeTableEntry 2 }
-
-battManString2OhmicValueLastDischargeInfo OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Informational text showing the date/time, load, and pilot temperature for the string
-       during the last discharge when ohmic values were recorded."
-   ::= { battManTestResults 6 }       
-
-battManString2OhmicValueTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManString2OhmicValueTable."
-   ::= { battManTestResults 7 }
-   
-battManString2OhmicValueTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString2OhmicValueTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting ohmic value information from each battery in String 1."
-   ::= { battManTestResults 8 }
-   
-battManString2OhmicValueTableEntry OBJECT-TYPE
-   SYNTAX BattManString2OhmicValueTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManString2OhmicValueIndex }
-   ::= { battManString2OhmicValueTable 1 }
-   
-BattManString2OhmicValueTableEntry ::=
-   SEQUENCE {
-       battManString2OhmicValueIndex   INTEGER,
-       battManString2OhmicValueData    INTEGER
-   }       
-
-battManString2OhmicValueIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of battery calibration entries in the table."
-   ::= { battManString2OhmicValueTableEntry 1 }
-
-battManString2OhmicValueData OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The battery inter-tier ohmic value in ohms.
-       Note: Negative values are invalid and may indicate faulty calibration
-       of ohmic value correction factors."
-   ::= { battManString2OhmicValueTableEntry 2 }
-
-battManString2ResponseTestChangeTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The number of entries in the battManString2ResponseTestChangeTable."
-   ::= { battManTestResults 9 }
-   
-battManString2ResponseTestChangeTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF BattManString2ResponseTestChangeTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "Allows for getting response test change information from each battery in String 1."
-   ::= { battManTestResults 10 }
-   
-battManString2ResponseTestChangeTableEntry OBJECT-TYPE
-   SYNTAX BattManString2ResponseTestChangeTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-       "The string to get data from."
-   INDEX { battManString2ResponseTestChangeIndex }
-   ::= { battManString2ResponseTestChangeTable 1 }
-   
-BattManString2ResponseTestChangeTableEntry ::=
-   SEQUENCE {
-       battManString2ResponseTestChangeIndex   INTEGER,
-       battManString2ResponseTestChangeData    INTEGER
-   }       
-
-battManString2ResponseTestChangeIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Index of the entries in the table."
-   ::= { battManString2ResponseTestChangeTableEntry 1 }
-
-battManString2ResponseTestChangeData OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "The battery response test change in percent."
-   ::= { battManString2ResponseTestChangeTableEntry 2 }
-
--- the xPDUIdent group
-
-xPDUIdentProductName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the PDU."
-   ::= { xPDUIdent 1 }
-
-xPDUIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the PDU. 
-       This value is set at the factory."
-   ::= { xPDUIdent 2 }
-
-xPDUIdentFirmwareAppRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ID string identifying the application firmware revision of the  PDU." 
-   ::= {  xPDUIdent 3 }
-
-xPDUIdentFirmwareAppOSRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ID string identifying the application operating system firmware revision of the PDU." 
-   ::= {  xPDUIdent 4 }
-
-xPDUIdentFirmwareControllerRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ID string identifying the PDU controller firmware revision." 
-   ::= {  xPDUIdent 5 }
-
-xPDUIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the PDU was manufactured in mm/dd/yyyy format. 
-       This value is set at the factory." 
-   ::= { xPDUIdent 6 }
-   
-xPDUIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the model number of 
-       the PDU. This value is set at the factory."
-   ::= { xPDUIdent 7 }
-
-xPDUIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the serial number of 
-       the PDU. This value is set at the factory."
-   ::= { xPDUIdent 8 }
-
---  the xPDUDevice group
-
-xPDUDeviceNominalMainInputVoltage OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The nominal main input voltage to the PDU. 
-       Measured in Volts,  line-to-line for a delta service or 
-       line-to-neutral for a wye service."
-   ::= { xPDUDevice 1 }
-
-xPDUDeviceServiceType OBJECT-TYPE
-    SYNTAX INTEGER  {
-        delta (1),
-        wye   (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The type of utility input to the PDU. Either 3 wires (delta), or 4 wires (wye)."
-   ::= { xPDUDevice 2 }
-
-xPDUDeviceNominalOutputVoltage OBJECT-TYPE
-       SYNTAX     INTEGER 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-      "The nominal line-to-neutral output voltage to the load measured in Volts."
-   ::= { xPDUDevice 3 }
-
-xPDUDeviceMainInputBreakerRating OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The rating of the main input breaker measured in Amps."
-   ::= { xPDUDevice 4 }
-
-xPDUDevicePanelBreakerRating OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The rating of the panel breaker measured in Amps."
-   ::= { xPDUDevice 5 }
-
-xPDUDeviceTransformerPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not a transformer is installed in the PDU."
-   ::= { xPDUDevice 6 }
-
-xPDUDeviceLoadTieBreakerPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent (1),
-        present    (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not a load tie breaker is installed in the PDU."
-   ::= { xPDUDevice 7 }
-
-xPDUDeviceLoadTestPortPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not a load test port is installed in the PDU."
-   ::= { xPDUDevice 8 }
-
-xPDUDeviceFusesPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not the UPS feed from the PDU includes fuses."
-   ::= { xPDUDevice 9 }
-
-xPDUDeviceFansPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not cooling fans are installed in the PDU."
-   ::= { xPDUDevice 10 }
-
-xPDUDeviceBypassInputPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not the PDU is equipped with a second feed for
-       the UPS's bypass input."
-   ::= { xPDUDevice 11 }
-
-xPDUDeviceCrossTieOutputPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not the PDU is equipped with a cross-tie output."
-   ::= { xPDUDevice 12 }
-
-xPDUDeviceEarthGroundMonitorPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not the PDU can provide ground current measurements."
-   ::= { xPDUDevice 13 }
-
-xPDUDeviceInfraXureType OBJECT-TYPE
-    SYNTAX INTEGER  {
-        typeB     (1),
-        typeC     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates the configuration of this PDU system. 
-       Type-B PDU is in a distributed UPS system and has bypass capabilities. 
-       Type-C PDU receives power from a larger central UPS."
-   ::= { xPDUDevice 14 }
-
--- Main Input 
-
-xPDUMainInputOverVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..30)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which an input over voltage condition will be generated.
-       Specified as percent deviation from nominal."
-   ::= { xPDUMainInput 1 }
-
-xPDUMainInputUnderVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..30)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which an input under voltage condition will be generated.
-       Specified as percent deviation from nominal."
-   ::= { xPDUMainInput 2 }
-
--- Main Input Voltage Table
-
-xPDUMainInputVoltageTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Main input voltage entries."
-   ::= { xPDUMainInput 3 }
-
-xPDUMainInputVoltageTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XPDUMainInputVoltagePhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of input voltage table entries. The number of 
-           entries are the phase entries.
-           The number of entries is contained in the 
-           xPDUMainInputVoltageTableSize OID."
-       ::= { xPDUMainInput 4 }
-
-   xPDUMainInputVoltagePhaseEntry OBJECT-TYPE
-       SYNTAX     XPDUMainInputVoltagePhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular main input voltage phase."
-       INDEX { xPDUMainInputVoltagePhaseIndex }
-       ::= { xPDUMainInputVoltageTable 1 }
-
-   XPDUMainInputVoltagePhaseEntry ::= SEQUENCE {
-       xPDUMainInputVoltagePhaseIndex      INTEGER,
-       xPDUMainInputVoltageLtoL            INTEGER,
-       xPDUMainInputVoltageLtoN            INTEGER
-      }
-
-   xPDUMainInputVoltagePhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each input phase entry in the table."
-       ::= { xPDUMainInputVoltagePhaseEntry 1 }
-
-   xPDUMainInputVoltageLtoL OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-line PDU input voltage when an isolation transformer is present, 
-           or -1 if no transformer present in this PDU. Measured in tenths of Volts."
-       ::= { xPDUMainInputVoltagePhaseEntry 2 }
-
-   xPDUMainInputVoltageLtoN OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-neutral PDU input voltage when an isolation transformer is not present,
-           or -1 if a transformer is present in this PDU. Measured in tenths of Volts."
-   ::= { xPDUMainInputVoltagePhaseEntry 3 }
-
-
-xPDUBypassInputOverVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..30)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which a bypass input over voltage condition will be generated. 
-       Specified as percent deviation from nominal."
-   ::= { xPDUBypassInput 1 }
-
-xPDUBypassInputUnderVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..30)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which an bypass input under voltage condition will be generated. 
-       Specified as percent deviation from nominal."
-   ::= { xPDUBypassInput 2 }
-
--- Bypass Input  Voltage Table
-
-xPDUBypassInputVoltageTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of bypass input voltage entries."
-   ::= { xPDUBypassInput 3 }
-   
-xPDUBypassInputVoltageTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XPDUBypassInputVoltagePhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of output table entries.  The number of 
-           entries are the phase entries.
-           The number of entries is contained in the 
-           xPDUBypassInputVoltageTableSize OID."
-       ::= { xPDUBypassInput 4 }
-
-   xPDUBypassInputVoltagePhaseEntry OBJECT-TYPE
-       SYNTAX     XPDUBypassInputVoltagePhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular bypass input voltage phase."
-       INDEX { xPDUBypassInputVoltagePhaseIndex }
-       ::= { xPDUBypassInputVoltageTable 1 }
-
-   XPDUBypassInputVoltagePhaseEntry ::= SEQUENCE {
-       xPDUBypassInputVoltagePhaseIndex       INTEGER,
-       xPDUBypassInputVoltageLtoL             INTEGER,
-       xPDUBypassInputVoltageLtoN             INTEGER
-      }
-
-   xPDUBypassInputVoltagePhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Index of each bypass input phase entry in the table."
-       ::= { xPDUBypassInputVoltagePhaseEntry 1 }
-
-   xPDUBypassInputVoltageLtoL OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-line bypass input voltage, or -1 if no bypass 
-           feed is present in this PDU. Measured in tenths of Volts"
-       ::= { xPDUBypassInputVoltagePhaseEntry 2 }
-
-   xPDUBypassInputVoltageLtoN OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-neutral bypass input voltage, or -1 if no bypass
-           feed is present in this PDU. Measured in tenths of Volts"
-       ::= { xPDUBypassInputVoltagePhaseEntry 3 }
-
--- UPS Input Table
-
-xPDUUPSInputVoltageTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of UPS input voltage entries."
-   ::= { xPDUUPSInput 1 }
-   
-xPDUUPSInputVoltageTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XPDUUPSInputVoltagePhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of UPS input table entries.  The number of 
-           entries are the phase entries.
-           The number of entries is contained in the 
-           xPDUUPSInputVoltageTableSize OID."
-       ::= { xPDUUPSInput 2 }
-
-   xPDUUPSInputVoltagePhaseEntry OBJECT-TYPE
-       SYNTAX     XPDUUPSInputVoltagePhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular UPS input voltage phase."
-       INDEX { xPDUUPSInputVoltagePhaseIndex }
-       ::= { xPDUUPSInputVoltageTable 1 }
-
-   XPDUUPSInputVoltagePhaseEntry ::= SEQUENCE {
-       xPDUUPSInputVoltagePhaseIndex      INTEGER,
-       xPDUUPSInputVoltageLtoNPresent     INTEGER
-      }
-
-   xPDUUPSInputVoltagePhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each UPS input phase entry in the table."
-       ::= { xPDUUPSInputVoltagePhaseEntry 1 }
-
-  xPDUUPSInputVoltageLtoNPresent OBJECT-TYPE
-    SYNTAX INTEGER  {
-        notPresent  (1),
-        present     (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether or not voltage is present at the UPS feed."
-       ::= { xPDUUPSInputVoltagePhaseEntry 2 }
-
--- System Output
-
-xPDUSystemOutputFrequency OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "The system output frequency in tenths of Hertz."
-   ::= { xPDUSystemOutput 1 }
-
-xPDUSystemOutputNeutralCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the neutral current measured at the system output in tenths of Amps."
-   ::= { xPDUSystemOutput 2 }
-
-xPDUSystemOutputTotalPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the total system output power in tenths of kW."
-   ::= { xPDUSystemOutput 3 }
-
-xPDUSystemOutputTotalApparentPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the total system output power in tenths of kVA."
-   ::= { xPDUSystemOutput 4 }
-
-xPDUSystemOutputTotalPowerFactor OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates the total power factor of the system output.
-       A value of 100 representing a unity power factor (1.00).
-       Measured in hundredths."
-   ::= { xPDUSystemOutput 5 }
-
-xPDUSystemOutputFrequencyTolerance OBJECT-TYPE
-   SYNTAX     INTEGER{
-      freqToleranceOff              (1),
-      freqTolerancePointTwo         (2),
-      freqTolerancePointFive        (3),
-      freqToleranceOne              (4),
-      freqToleranceOnePointFive     (5),
-      freqToleranceTwo              (6),
-      freqToleranceThree            (7),
-      freqToleranceFour             (8),
-      freqToleranceFive             (9),
-      freqToleranceNine             (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the circuit panel output frequency tolerance in Hertz."
-   ::= { xPDUSystemOutput 6 }
-
-xPDUSystemOutputMaxKWPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Defines 100% load in kW. 
-       Purpose is to set to match UPS capabilities."
-   ::= { xPDUSystemOutput 7 }
-
-xPDUSystemOutputOverVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..30)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which an output over voltage condition will be generated. 
-       Specified as percent deviation from nominal."
-   ::= { xPDUSystemOutput 8 }
-
-xPDUSystemOutputUnderVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..30)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which an output under voltage condition will be generated. 
-       Specified as percent deviation from nominal."
-   ::= { xPDUSystemOutput 9 }
-
-
-xPDUSystemOutputOverCurrentThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which an over current condition will be generated. 
-       Specified as a percent of the panel breaker rating."
-   ::= { xPDUSystemOutput 10 }
-
-xPDUSystemOutputOverCurrentNeutralThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which an Over current neutral condition will be generated. 
-       Specified as a percent of the panel breaker rating."
-   ::= { xPDUSystemOutput 11 }
-
-xPDUSystemOutputUnderCurrentThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which an under current condition will be generated. 
-       Specified as a percent of the panel breaker rating."
-   ::= { xPDUSystemOutput 12 }
-
-xPDUSystemOutputTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of System Output phase entries."
-   ::= { xPDUSystemOutput 13 }
-   
-xPDUSystemOutputTable OBJECT-TYPE
-   SYNTAX     SEQUENCE OF XPDUSystemOutputPhaseEntry
-   ACCESS     not-accessible
-   STATUS     mandatory
-   DESCRIPTION
-      "A list of system output table entries.
-       The number of entries is contained in the 
-       xPDUSystemOutputTableSize OID."
-   ::= { xPDUSystemOutput 14 }
-
-   xPDUSystemOutputPhaseEntry OBJECT-TYPE
-       SYNTAX     XPDUSystemOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular system output phase."
-       INDEX { xPDUSystemOutputPhaseIndex }
-       ::= { xPDUSystemOutputTable 1 }
-
-   XPDUSystemOutputPhaseEntry ::= SEQUENCE {
-       xPDUSystemOutputPhaseIndex      INTEGER,
-       xPDUSystemOutputVoltageLtoL     INTEGER,
-       xPDUSystemOutputVoltageLtoN     INTEGER,
-       xPDUSystemOutputPhaseCurrent    INTEGER,
-       xPDUSystemOutputPower           INTEGER,
-       xPDUSystemOutputApparentPower   INTEGER,
-       xPDUSystemOutputPowerFactor     INTEGER
-      }
-
-   xPDUSystemOutputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each output phase entry in the table."
-       ::= { xPDUSystemOutputPhaseEntry 1 }
-
-   xPDUSystemOutputVoltageLtoL OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-line system output voltage available at the cicuit panel. 
-           Measured in tenths of Volts."
-       ::= { xPDUSystemOutputPhaseEntry 2 }
-
-   xPDUSystemOutputVoltageLtoN OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-neutral system output voltage available at the cicuit panel. 
-           Measured in tenths of Volts."
-       ::= { xPDUSystemOutputPhaseEntry 3 }
-
-
-   xPDUSystemOutputPhaseCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "System load current per phase. Measured in tenths of Amps."
-       ::= { xPDUSystemOutputPhaseEntry 4 }
-
-   xPDUSystemOutputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "System output power per phase. Measured in tenths of kW."
-       ::= { xPDUSystemOutputPhaseEntry 5 }
-
-   xPDUSystemOutputApparentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "System output power per phase. Measured in tenths of kVA."
-       ::= { xPDUSystemOutputPhaseEntry 6 }
-
-   xPDUSystemOutputPowerFactor OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Indicates the Power Factor of the system output per phase.
-           A value of 100 representing a unity Power Factor (1.00).
-           Measured in hundredths."
-       ::= { xPDUSystemOutputPhaseEntry 7 }
-
-xPDUGroundCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the current measured in the earth ground conductor in tenths of Amps."
-   ::= { xPDUGroundMonitorPoint 1 }
-
-xPDUGroundCurrentThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..50)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which a ground current over current 
-       condition will be generated. Measured in tenths of Amps."
-   ::= { xPDUGroundMonitorPoint 2 }
-
--- System Breakers 
-
-xPDUSystemBreakerTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of system breaker entries."
-   ::= { xPDUSystemBreakers 1 }
-   
-xPDUSystemBreakerTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XPDUSystemBreakerTableEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of system breaker entries.
-          The number of entries is contained in the 
-          xPDUSystemBreakerTableSize OID."
-       ::= { xPDUSystemBreakers 2 }
-
-   xPDUSystemBreakerTableEntry OBJECT-TYPE
-       SYNTAX     XPDUSystemBreakerTableEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular system breaker."
-       INDEX { xPDUSystemBreakerTableIndex }
-       ::= { xPDUSystemBreakerTable 1 }
-
-   XPDUSystemBreakerTableEntry ::= SEQUENCE {
-       xPDUSystemBreakerTableIndex    INTEGER,
-       xPDUSystemBreakerDescription   DisplayString,
-       xPDUSystemBreakerPosition      INTEGER
-      }
-
-   xPDUSystemBreakerTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Index of system breaker entries in the table."
-       ::= { xPDUSystemBreakerTableEntry 1 }
-
-xPDUSystemBreakerDescription OBJECT-TYPE
-   SYNTAX  DisplayString (SIZE (0..79))
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "A brief description of the system breakers."
-   ::= { xPDUSystemBreakerTableEntry 2 }
-
-   xPDUSystemBreakerPosition OBJECT-TYPE
-       SYNTAX INTEGER  {
-          open    (1),
-          closed  (2)
-       } 
-       ACCESS read-only
-       STATUS mandatory
-       DESCRIPTION
-          "Indicates whether this breaker is open(1) or closed(2)."
-       ::= { xPDUSystemBreakerTableEntry 3 }
-
--- Branch Breakers (Breaker Panel)
-
-xPDUNumOfBranchBreakers OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of branch breakers in the Panel."
-   ::= { xPDUBranchBreakers 1 }
-
--- Branch Breakers Table
-
-xPDUBranchBreakerTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of branch breaker entries."
-   ::= { xPDUBranchBreakers 2 }
-   
-xPDUBranchBreakerTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XPDUBranchBreakerEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of branch breaker table entries. The 
-           number of entries is given by the value of xPDUBranchBreakerTableSize
-           The number of entries is contained in the 
-           xPDUBranchBreakerTableSize OID."
-       ::= { xPDUBranchBreakers 3 }
-
-   xPDUBranchBreakerEntry OBJECT-TYPE
-       SYNTAX     XPDUBranchBreakerEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular branch breaker."
-       INDEX { xPDUBranchBreakerTableIndex }
-       ::= { xPDUBranchBreakerTable 1 }
-
-   XPDUBranchBreakerEntry ::= SEQUENCE {
-       xPDUBranchBreakerTableIndex             INTEGER,
-       xPDUBranchBreakerRating                 INTEGER,
-       xPDUBranchBreakerRDPFeed                INTEGER,
-       xPDUBranchBreakerTieIndicator           INTEGER,
-       xPDUBranchBreakerCurrent                INTEGER,
-       xPDUBranchBreakerOverCurrentThreshold   INTEGER,
-       xPDUBranchBreakerUnderCurrentThreshold  INTEGER
-       }
-
-   xPDUBranchBreakerTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Index of branch breaker entries in the table."
-       ::= { xPDUBranchBreakerEntry 1 }
-
-   xPDUBranchBreakerRating OBJECT-TYPE
-       SYNTAX INTEGER (0..100)
-       ACCESS read-write
-       STATUS mandatory
-       DESCRIPTION
-          "Indicates current rating of this breaker.  
-           0=Breaker is not present.
-           1=Earth leakage connection.
-		   2=Neutral connection.
-           A value greater than 2 indicates breaker current rating in Amps."
-       ::= { xPDUBranchBreakerEntry 2 }
-
-   xPDUBranchBreakerRDPFeed OBJECT-TYPE
-       SYNTAX INTEGER  {
-          remoteDistribution   (1),
-          noRemoteDistribution (2)
-       } 
-       ACCESS read-write
-       STATUS mandatory
-       DESCRIPTION
-          "Indicates that a breaker position is feeding a remote 
-           distribution panel."
-       ::= { xPDUBranchBreakerEntry 3 }
-
-   xPDUBranchBreakerTieIndicator OBJECT-TYPE
-       SYNTAX INTEGER  {
-          breakerTied   (1),
-          breakerUntied (2)
-       } 
-       ACCESS read-write
-       STATUS mandatory
-       DESCRIPTION
-          "Indicates whether or not the breaker pole is physically 
-           connected to the breaker immediately below."
-       ::= { xPDUBranchBreakerEntry 4 }
-
-    xPDUBranchBreakerCurrent OBJECT-TYPE
-       SYNTAX INTEGER
-       ACCESS read-only
-       STATUS mandatory
-       DESCRIPTION
-          "Indicates the branch current in tenths of  Amps or -1 when not available."
-       ::= { xPDUBranchBreakerEntry 5 }
-
-    xPDUBranchBreakerOverCurrentThreshold OBJECT-TYPE
-       SYNTAX INTEGER (0..100)
-       ACCESS read-write
-       STATUS mandatory
-       DESCRIPTION
-          "Threshold above which a branch circuit over current 
-           condition will be generated. 
-           Specified as a percent of the branch breaker rating."
-       ::= { xPDUBranchBreakerEntry 6 }
-
-    xPDUBranchBreakerUnderCurrentThreshold OBJECT-TYPE
-       SYNTAX INTEGER (0..100)
-       ACCESS read-write
-       STATUS mandatory
-       DESCRIPTION
-          "Threshold below which a branch circuit under current 
-           condition will be generated. 
-           Specified as a percent of the branch breaker rating."
-       ::= { xPDUBranchBreakerEntry 7 }
-
--- the xPDUInputContacts group
-
-xPDUInputContactNumContacts OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts supported by the PDU."
-   ::= { xPDUInputContacts 1 }
-
-xPDUInputContactTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of input contact entries."
-   ::= { xPDUInputContacts 2 }
-
-xPDUInputContactTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF XPDUInputContactEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the PDU.
-       The number of entries is contained in the 
-       xPDUInputContactTableSize OID."
-   ::= { xPDUInputContacts 3 }
-
-xPDUInputContactEntry OBJECT-TYPE
-   SYNTAX XPDUInputContactEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A contact entry containing information for a given contact."
-   INDEX  { xPDUInputContactNumber }
-   ::= { xPDUInputContactTable 1 }
-
-XPDUInputContactEntry ::=
-   SEQUENCE {
-      xPDUInputContactNumber       INTEGER,
-      xPDUInputContactName         DisplayString,
-      xPDUInputContactNormalState  INTEGER,
-      xPDUInputContactCurrentState INTEGER
-   }
-
-xPDUInputContactNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An index identifying the contact on the PDU."
-   ::= { xPDUInputContactEntry 1 }
-
-xPDUInputContactName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The description of the purpose/use of the contact."
-   ::= { xPDUInputContactEntry 2 }
-
-xPDUInputContactNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      open    (1),
-      closed  (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The normal operating position of the contact."
-   ::= { xPDUInputContactEntry 3 }
-
-xPDUInputContactCurrentState OBJECT-TYPE
-   SYNTAX INTEGER {
-      open    (1),
-      closed  (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This value indicates the current state of the contact."
-   ::= { xPDUInputContactEntry 4 }
-
--- the xPDUOutputRelays group
-
-xPDUOutputRelaysNumRelays OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of output relays supported by the PDU."
-   ::= { xPDUOutputRelays 1 }
-
-xPDUOutputRelaysTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of output relay entries."
-   ::= { xPDUOutputRelays 2 }
-
-xPDUOutputRelayTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF XPDUOutputRelayEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of output relays supported by the PDU.
-       The number of entries is contained in the 
-       xPDUOutputRelayTableSize OID."
-   ::= { xPDUOutputRelays 3 }
-
-xPDUOutputRelayEntry OBJECT-TYPE
-   SYNTAX XPDUOutputRelayEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A output relay entry containing information for a given contact."
-   INDEX  { xPDUOutputRelayNumber }
-   ::= { xPDUOutputRelayTable 1 }
-
-XPDUOutputRelayEntry ::=
-   SEQUENCE {
-      xPDUOutputRelayNumber        INTEGER,
-      xPDUOutputRelayName          DisplayString,
-      xPDUOutputRelayNormalState   INTEGER,
-      xPDUOutputRelayCurrentState  INTEGER
-   }
-
-xPDUOutputRelayNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An index identifying the output relay on the PDU."
-   ::= { xPDUOutputRelayEntry 1 }
-
-xPDUOutputRelayName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The description of the purpose/use of the output relay."
-   ::= { xPDUOutputRelayEntry 2 }
-
-xPDUOutputRelayNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      open     (1),
-      closed   (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The normal operating position of the output relay."
-   ::= { xPDUOutputRelayEntry 3 }
-
-xPDUOutputRelayCurrentState OBJECT-TYPE
-   SYNTAX INTEGER {
-      open      (1),
-      closed    (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This value indicates the current state of the output relay."
-   ::= { xPDUOutputRelayEntry 4 }
-
--- the xPDUMiscGroup
-
-xPDUEPOMode OBJECT-TYPE
-    SYNTAX INTEGER  {
-        armed    (1),
-        disarmed (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether the EPO System is armed(1) or disarmed(2)."
-       ::= { xPDUMiscGroup 1 }
-
-xPDUTransformTempStatus OBJECT-TYPE
-    SYNTAX INTEGER  {
-        normal               (1),
-        overtemp             (2),
-		noTransformerPresent (3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates if the PDU's isolation transformer is over temperature."
-   ::= { xPDUMiscGroup 2 }
-
-xPDUCoolingFanStatus OBJECT-TYPE
-    SYNTAX INTEGER  {
-        normal                (1),
-        failed                (2),
-		noCoolingFansPresent  (3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates if one or more of the PDU's cooling fans have failed."
-   ::= { xPDUMiscGroup 3 }
-
--- The xATSIdent group
-
-xATSIdentProductName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the transfer switch unit."
-   ::= { xATSIdent 1 }
-
-xATSIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the transfer switch. 
-       This value is set at the factory."
-   ::= { xATSIdent 2 }
-
-xATSIdentFirmwareAppRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ID string identifying the application firmware revision of the  transfer switch." 
-   ::= {  xATSIdent 3 }
-
-xATSIdentFirmwareAppOSRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ID string identifying the application operating system firmware revision of the transfer switch." 
-   ::= {  xATSIdent 4 }
-
-xATSIdentFirmwareControllerRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ID string identifying the transfer switch controller firmware revision." 
-   ::= {  xATSIdent 5 }
-
-xATSIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the transfer switch was manufactured in mm/dd/yyyy format. 
-       This value is set at the factory." 
-   ::= { xATSIdent 6 }
-   
-xATSIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the model number of the transfer switch.
-       This value is set at the factory."
-   ::= { xATSIdent 7 }
-
-xATSIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the serial number of the transfer switch.
-        This value is set at the factory."
-   ::= { xATSIdent 8 }
-
---  The xATSDevice group
-
-xATSDeviceServiceType OBJECT-TYPE
-    SYNTAX INTEGER  {
-        threeWire  (1),
-        fourWire   (2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The type of utility input to the transfer switch.
-       Either 3 wires (delta), or 4 wires (wye)."
-   ::= { xATSDevice 1 }
-
-xATSDeviceNominalVoltage OBJECT-TYPE
-       SYNTAX     INTEGER 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-      "The nominal line-to-neutral system voltage.
-       Measured in Volts,  line-to-line for a 3-wire service or 
-       line-to-neutral for a 4-wire service. -1 if not available."
-   ::= { xATSDevice 2 }
-
-xATSDeviceNominalFrequency OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "The nominal system frequency. Measured in tenths of Hertz.
-       -1 if not available."
-   ::= { xATSDevice 3 }
-
-xATSDeviceTransferSwitchRating OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The rating of the transfer switch.
-       Measured in Amps."
-   ::= { xATSDevice 4 }
-
-xATSDeviceDCBackUpPresent OBJECT-TYPE
-   SYNTAX     INTEGER{
-      yes     (1),
-      no      (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates if a DC backup is present or not."
-   ::= { xATSDevice 5 }
-
--- The xATS Switch Status group
-
-xATSSwitchStatusSelectedSource OBJECT-TYPE
-   SYNTAX     INTEGER{
-      none         (1),
-      source1      (2),
-      source2      (3),
-      fault        (4),
-      unknown      (5)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The source which is currently selected, i.e. supplying power to the load."
-   ::= { xATSSwitchStatus 1 }
-   
-xATSSwitchStatusOperationalMode OBJECT-TYPE
-   SYNTAX     INTEGER{
-      automatic                 (1),
-      notInAutoAbnormal         (2),
-      notInAuto                 (3),
-      unknown                   (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current operating mode of the transfer switch. When the ATS is in
-       automatic mode, generator starting and ATS transferring is all done automatically
-       as needed based on the state of source 1.  Automatic operation is halted when the
-       ATS is in either of the notInAuto modes.
-       A mode of notInAuto indicates that the automatic operation switch is in the
-       disabled position, as indicated by the xATSSwitchStatusAutomaticOperationSwitch OID.
-       The notInAutoAbnormal condition indicates that an abnormal
-       condition has caused the transfer switch to halt automatic operation.
-       In this case, traps can indicate the exact problem. In the case of
-       notInAutoAbnormal, refer to the operation manual for details
-       on how debug the condition and restore automatic operation."
-   ::= { xATSSwitchStatus 2 }
-
-xATSSwitchStatusAutomaticOperationSwitch OBJECT-TYPE
-   SYNTAX     INTEGER{
-      disabled   (1),
-      enabled    (2),
-      unknown    (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The position of the automatic operation switch on the front of the transfer switch."
-   ::= { xATSSwitchStatus 3 }
-
-xATSSwitchStatusEngineStartSignal OBJECT-TYPE
-   SYNTAX     INTEGER{
-      run     (1),
-      stop    (2),
-      unknown (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The position of the Start/Stop contact which signals the generator
-       engine to start/run. When the ATS is in automatic mode,
-       generator starting/stopping is under ATS control."
-   ::= { xATSSwitchStatus 4 }
-
--- The xATS Switch Setting group
-
-xATSSwitchSettingsLowVoltageTransferPoint OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The lowest acceptable voltage condition at source 1. 
-       When any phase of source 1 is lower than this voltage,
-       source quality is considered bad and the generator run signal
-       is asserted to begin generator operation. 
-       Specified in volts,  line-to-line for a 3-wire service or 
-       line-to-neutral for a 4-wire service.
-       -1 if not available."
-   ::= { xATSSwitchSettings 1 }
-
-xATSSwitchSettingsHighVoltageTransferPoint OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The highest acceptable voltage condition at source 1. 
-       When any phase of source 1 is greater than this voltage,
-       source quality is considered bad and the generator run signal
-       is asserted to begin generator operation. 
-       Specified in volts,  line-to-line for a 3-wire service or 
-       line-to-neutral for a 4-wire service.
-       -1 if not available."
-   ::= { xATSSwitchSettings 2 }
-
-xATSSwitchSettingsMaxFrequencyDeviation OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum acceptable frequency deviation condition from nominal at source 1. 
-       When source 1 frequency is outside the specified range,
-       source quality is considered bad and the generator run signal
-       is asserted to begin generator operation. 
-       Specified in  tenths of Hertz above or below nominal.
-       A value of zero indicates that frequency is ignored when 
-       determining source quality.
-       -1 if not available."
-   ::= { xATSSwitchSettings 3 }
-
-xATSSwitchSettingsMinPhaseBalance OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The minimum required phase balance at source 1. 
-       When the percentage difference between the minimum and maximum 
-       phase voltage measurements at source 1 is greater than this value,
-       source quality is considered bad and the generator run signal
-       is asserted to begin generator operation.
-       Specified as a percentage. A value of zero indicates that phase balance
-        is ignored when determining source quality.
-       -1 if not available."
-   ::= { xATSSwitchSettings 4 }
-
-xATSSwitchSettingsNominalRotation OBJECT-TYPE
-   SYNTAX     INTEGER{
-      abc     (1),
-      cba     (2),
-      any     (3),
-      unknown (4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The nominal phase rotation (or phase sequence) required by the load.
-       For certain types of equipment, such as rotating machinery, phase rotation
-       is critical for proper operation as it determines the direction which motors
-       will rotate (clockwise or counterclockwise).
-       Source quality will be seen as bad if the rotation measured at that
-       ATS input does not match this setting.
-       If this setting is set to any, phase rotation is ignored."
-   ::= { xATSSwitchSettings 5 }
-
-xATSSwitchSettingsAllowClosedTransfer OBJECT-TYPE
-   SYNTAX INTEGER{
-      yes     (1),
-      no      (2),
-      unknown (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This setting enables seemless (closed) transfers between sources. 
-       When possible, both source 1 and source 2 are closed to the output 
-       for a brief time. If closed transfer is not possible within the amount
-       of time specified by the xATSSwitchSettingsMaxSyncTime OID,
-       an open transfer will be executed."
-   ::= { xATSSwitchSettings 6 }
-
-xATSSwitchSettingsMaxSyncTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "When attempting/seeking to perform a closed transfer, this setting defines
-       the maximum time allowed before the transfer switch will give up and perform
-       an open transfer. Specified in seconds.
-       -1 if not available."
-   ::= { xATSSwitchSettings 7 }
-
-xATSSwitchSettingsNeutralTransferTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This setting defines how long both source 1 and source 2 will be 
-       disconnected from the output, during an open transfer. 
-       Specified in seconds.
-       -1 if not available."
-   ::= { xATSSwitchSettings 8 }
-
-xATSSwitchSettingsClearLatchedAlarms OBJECT-TYPE
-   SYNTAX INTEGER{
-      yes        (1),
-      no         (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Clears any latched alarm conditions."
-   ::= { xATSSwitchSettings 9 }
-   
-xATSSwitchSettingsSetToFactoryDefaults OBJECT-TYPE
-   SYNTAX INTEGER{
-      yes        (1),
-      no         (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Sets all transfer switch settings to factory default values."
-   ::= { xATSSwitchSettings 10 }
-
-
--- The xATSSwitchTimers group
-
-   xATSSwitchTimersTableSize OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "The number of transfer switch timer entries."
-     ::= { xATSSwitchTimers 1 }
-
-   xATSSwitchTimersTable OBJECT-TYPE
-     SYNTAX SEQUENCE OF XATSSwitchTimersEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "A list of timers supported by ATS.
-         The number of entries is contained in the xATSSwitchTimersTableSize OID."
-     ::= { xATSSwitchTimers 2 }
-
-   xATSSwitchTimersEntry OBJECT-TYPE
-     SYNTAX XATSSwitchTimersEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "An entry containing information about an individual ATS timer."
-     INDEX  { xATSSwitchTimersIndex }
-     ::= { xATSSwitchTimersTable 1 }
-
-   XATSSwitchTimersEntry ::=
-     SEQUENCE {
-        xATSSwitchTimersIndex                INTEGER,
-        xATSSwitchTimersName                 DisplayString,
-        xATSSwitchTimersAbort                INTEGER,
-        xATSSwitchTimersStatus               INTEGER,
-        xATSSwitchTimersRemainingTime        INTEGER,
-        xATSSwitchTimersDelaySetting         INTEGER
-     }
-
-xATSSwitchTimersIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Index of timer entries in the table."
-   ::= { xATSSwitchTimersEntry 1 }
-
-xATSSwitchTimersName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Name of the individual timer.Refer to ATS operation manual,
-       or on-line help, for detailed descriptions of ATS timers."
-   ::= { xATSSwitchTimersEntry 2 }
-
-xATSSwitchTimersAbort OBJECT-TYPE
-   SYNTAX INTEGER{
-      yes  (1),
-      no   (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This aborts the individual timer."
-   ::= { xATSSwitchTimersEntry 3 }
-
-xATSSwitchTimersStatus OBJECT-TYPE
-   SYNTAX INTEGER{
-      inactive  (1),
-      active    (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the individual timer. Designates whether this timer
-       entry is currently running or inactive."
-   ::= { xATSSwitchTimersEntry 4 }
-   
-xATSSwitchTimersRemainingTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The time remaining for this timer entry.
-       Specified in seconds."
-   ::= { xATSSwitchTimersEntry 5 }
-
-xATSSwitchTimersDelaySetting OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The delay settings associated with this timer entry.
-       When this timer entry is active, the timer value must exceed this setting
-       before the ATS behavior associated with this timer is executed.
-       Refer to ATS operation manual, or on-line help, for detailed 
-       descriptions of ATS timers."
-   ::= { xATSSwitchTimersEntry 6 }
-
--- The xATSSwitchBlockMap group
-
-   xATSSwitchBlockMapTableSize OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "The number of blocking map entries, or how many ATS actions can be blocked."
-     ::= { xATSSwitchBlockMap 1 }
-
-   xATSSwitchBlockMapTable OBJECT-TYPE
-     SYNTAX SEQUENCE OF XATSSwitchBlockMapEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "A list of blocking maps supported by the ATS.
-         The number of entries is contained in the xATSSwitchBlockMapTableSize OID."
-     ::= { xATSSwitchBlockMap 2 }
-
-   xATSSwitchBlockMapEntry OBJECT-TYPE
-     SYNTAX XATSSwitchBlockMapEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "An entry containing information about a specific ATS blocking map."
-     INDEX  { xATSSwitchBlockMapIndex }
-     ::= { xATSSwitchBlockMapTable 1 }
-
-   XATSSwitchBlockMapEntry ::=
-     SEQUENCE {
-        xATSSwitchBlockMapIndex            INTEGER,
-        xATSSwitchBlockMapName             DisplayString,
-        xATSSwitchBlockMapStatus           INTEGER,
-        xATSSwitchBlockMapSetting          INTEGER
-    }
-
-   xATSSwitchBlockMapIndex OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "Index of blocking map entries in the table."
-     ::= { xATSSwitchBlockMapEntry 1 }
-
-   xATSSwitchBlockMapName OBJECT-TYPE
-     SYNTAX DisplayString
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "A string describing the ATS action to be blocked."
-     ::= { xATSSwitchBlockMapEntry 2 }
-     
-   xATSSwitchBlockMapStatus OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-       "Represents the status of this blocking map entry, in bit-mapped format.
-        A non-zero value indicates that this entry's ATS action is currently being blocked.
-        The bit(s) set indicate which input(s) are causing the blocking (bit0, bit1, etc).
-
-        bit 0 - Contact 1
-        bit 1 - Contact 2
-        bit 2 - Contact 3
-        bit 3 - Contact 4."
-     ::= { xATSSwitchBlockMapEntry 3 }
-
-   xATSSwitchBlockMapSetting OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-write
-     STATUS mandatory
-     DESCRIPTION
-       "This setting designates the inputs that block the ATS action
-        The mapping is specified as a bit-field, where each bit set indicates
-        the input that blocks the ATS action associated with the entry.
-
-        bit 0 - Contact 1
-        bit 1 - Contact 2
-        bit 2 - Contact 3
-        bit 3 - Contact 4."
-     ::= { xATSSwitchBlockMapEntry 4 }
-
--- The xATSSwitchStatistics group
-
-   xATSSwitchStatisticsTableSize OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "The number of transfer switch statistics entries."
-     ::= { xATSSwitchStatistics 1 }
-
-   xATSSwitchStatisticsTable OBJECT-TYPE
-     SYNTAX SEQUENCE OF XATSSwitchStatisticsEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "A list of statistics supported by ATS.
-         The number of entries is contained in the xATSSwitchStatisticsTableSize OID."
-     ::= { xATSSwitchStatistics 2 }
-
-   xATSSwitchStatisticsEntry OBJECT-TYPE
-     SYNTAX XATSSwitchStatisticsEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "An entry containing information about an individual ATS statistic."
-     INDEX  { xATSSwitchStatisticsIndex }
-     ::= { xATSSwitchStatisticsTable 1 }
-
-   XATSSwitchStatisticsEntry ::=
-     SEQUENCE {
-        xATSSwitchStatisticsIndex             INTEGER,
-        xATSSwitchStatisticsName              DisplayString,
-        xATSSwitchStatisticsValue             DisplayString,
-        xATSSwitchStatisticsReset             INTEGER
-     }
-
-   xATSSwitchStatisticsIndex OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "Index of ATS statistics entries in the table."
-     ::= { xATSSwitchStatisticsEntry 1 }
-
-   xATSSwitchStatisticsName OBJECT-TYPE
-     SYNTAX     DisplayString
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-       "This is the name of the ATS statistic associated with this entry."
-     ::= { xATSSwitchStatisticsEntry 2 }
-
-   xATSSwitchStatisticsValue OBJECT-TYPE
-     SYNTAX     DisplayString
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-       "This is the value of the ATS statistic associated with this entry."
-     ::= { xATSSwitchStatisticsEntry 3 }
-
-   xATSSwitchStatisticsReset OBJECT-TYPE
-     SYNTAX INTEGER{
-       yes   (1),
-       no    (2)
-     }
-     ACCESS read-write
-     STATUS mandatory
-     DESCRIPTION
-       "This will reset the individual ATS statistic associated with this entry."
-     ::= { xATSSwitchStatisticsEntry 4 }
-
--- The xATS Source 1 group
-
-xATSSource1Name OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "String used to identify source 1."
-   ::= { xATSSource1 1 }
-
-xATSSource1Position OBJECT-TYPE
-   SYNTAX INTEGER{
-      open     (1),
-      closed   (2),
-      tripped  (3),
-      unknown  (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current position of the switch at source 1."
-   ::= { xATSSource1 2 }
-
-xATSSource1Frequency OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frequency at source 1 in tenths of Hertz.
-       -1 if unavailable."
-   ::= { xATSSource1 3 }
-
-xATSSource1Quality OBJECT-TYPE
-   SYNTAX INTEGER{
-      sourceGood        (1),
-      lowVoltage        (2),
-      highVoltage       (3),
-      phaseImbalance    (4),
-      freqOutOfRange    (5),
-      badRotation       (6),
-      unknown           (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current line quality of source 1."
-   ::= { xATSSource1 4 }
-
-xATSSource1Rotation OBJECT-TYPE
-   SYNTAX INTEGER{
-      abc     (1),
-      cba     (2),
-      unknown (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The phase rotation measured at the source 1 input of the ATS.
-       The sequence is a reference to the order in which the three phases 
-       pass the zero-crossing boundary in time."
-   ::= { xATSSource1 5 }
-
-xATSSource1TableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of input voltage entries at the source 1 input of the ATS."
-   ::= { xATSSource1 6 }
-
-   xATSSource1Table OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XATSSource1PhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of voltage table entries for source 1. The number of 
-           entries are the phase entries. The number of entries is contained in the 
-           xATSSource1TableSize OID."
-       ::= { xATSSource1 7 }
-
-   xATSSource1PhaseEntry OBJECT-TYPE
-       SYNTAX     XATSSource1PhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a
-           particular input voltage phase at the source 1 input of the ATS."
-       INDEX { xATSSource1Index }
-       ::= { xATSSource1Table 1 }
-
-   XATSSource1PhaseEntry ::= SEQUENCE {
-       xATSSource1Index        INTEGER,
-       xATSSource1VoltageLtoL  INTEGER,
-       xATSSource1VoltageLtoN  INTEGER
-      }
-
-   xATSSource1Index OBJECT-TYPE
-       SYNTAX INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each phase utilized at source 1."
-       ::= { xATSSource1PhaseEntry 1 }
-
-   xATSSource1VoltageLtoL OBJECT-TYPE
-       SYNTAX INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Source 1 line-to-line input voltage. 
-           Measured in tenths of Volts."
-       ::= { xATSSource1PhaseEntry 2 }
-
-   xATSSource1VoltageLtoN OBJECT-TYPE
-       SYNTAX INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Source 1 line-to-neutral input voltage. 
-           Measured in tenths of Volts. -1 for a 3-wire service type."
-   ::= { xATSSource1PhaseEntry 3 }
-
--- The xATS Source 2 group
-
-xATSSource2Name OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "String used to identify source 2."
-   ::= { xATSSource2 1 }
-
-xATSSource2Position OBJECT-TYPE
-   SYNTAX INTEGER{
-      open     (1),
-      closed   (2),
-      tripped  (3),
-      unknown  (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current position of the switch at source 2."
-   ::= { xATSSource2 2 }
-
-xATSSource2Frequency OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frequency at source 2 in tenths of Hertz.
-       -1 if not available."
-   ::= { xATSSource2 3 }
-
-xATSSource2Quality OBJECT-TYPE
-   SYNTAX INTEGER{
-      sourceGood        (1),
-      lowVoltage        (2),
-      highVoltage       (3),
-      phaseImbalance    (4),
-      freqOutOfRange    (5),
-      badRotation       (6),
-      unknown           (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current line quality of source 2."
-   ::= { xATSSource2 4 }
-
-xATSSource2Rotation OBJECT-TYPE
-   SYNTAX INTEGER{
-      abc     (1),
-      cba     (2),
-      unknown (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The phase rotation measured at the source 2 input of the ATS.
-       -1 if not available."
-   ::= { xATSSource2 5 }
-
-xATSSource2TableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of input voltage entries at the source 2 input of the ATS."
-   ::= { xATSSource2 6 }
-
-   xATSSource2Table OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XATSSource2PhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "A list of voltage table entries for the source 2. The number of
-           entries are the phase entries. The number of entries is contained in the
-           xATSSource2TableSize OID."
-       ::= { xATSSource2 7 }
-
-   xATSSource2PhaseEntry OBJECT-TYPE
-       SYNTAX     XATSSource2PhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a
-           particular input voltage phase at the source 2 input of the ATS."
-       INDEX { xATSSource2Index }
-       ::= { xATSSource2Table 1 }
-
-   XATSSource2PhaseEntry ::= SEQUENCE {
-       xATSSource2Index        INTEGER,
-       xATSSource2VoltageLtoL  INTEGER,
-       xATSSource2VoltageLtoN  INTEGER
-      }
-
-   xATSSource2Index OBJECT-TYPE
-       SYNTAX INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each phase utilized at the source 2."
-       ::= { xATSSource2PhaseEntry 1 }
-
-   xATSSource2VoltageLtoL OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Source 2 line-to-line input voltage. 
-           Measured in tenths of Volts."
-       ::= { xATSSource2PhaseEntry 2 }
-
-   xATSSource2VoltageLtoN OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Source 2 line-to-neutral input voltage. 
-           Measured in tenths of Volts. -1 for a 3-wire service type."
-   ::= { xATSSource2PhaseEntry 3 }
-
--- The xATSSystemOutput
-
-xATSSystemOutputFrequency OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "The system output frequency in tenths of Hertz."
-   ::= { xATSSystemOutput 1 }
-
-xATSSystemOutputTotalPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the total system output power in tenths of kW."
-   ::= { xATSSystemOutput 2 }
-
-xATSSystemOutputTotalApparentPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the total system output power in tenths of kVA."
-   ::= { xATSSystemOutput 3 }
-
-xATSSystemOutputTotalPowerFactor OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates the total power factor of the system output.
-       A value of 100 representing a unity power factor (1.00)
-       Specified in hundredths."
-   ::= { xATSSystemOutput 4 }
-
-xATSSystemOutputFrequencyTolerance OBJECT-TYPE
-   SYNTAX     INTEGER{
-      freqToleranceOff              (1),
-      freqTolerancePointTwo         (2),
-      freqTolerancePointFive        (3),
-      freqToleranceOne              (4),
-      freqToleranceOnePointFive     (5),
-      freqToleranceTwo              (6),
-      freqToleranceThree            (7),
-      freqToleranceFour             (8),
-      freqToleranceFive             (9),
-      freqToleranceNine             (10)
-
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Shows the panel output frequency tolerance in +/- Hertz."
-   ::= { xATSSystemOutput 5 }
-
-xATSSystemOutputOverVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which an output over voltage condition will be generated. 
-       Specified as tenths of percent deviation from nominal.
-       A value of zero indicates that the threshold is disabled."
-   ::= { xATSSystemOutput 6 }
-
-xATSSystemOutputUnderVoltThreshold OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which an output under voltage condition will be generated. 
-       Specified as tenths of percent deviation from nominal.
-       A value of zero indicates that the threshold is disabled."
-   ::= { xATSSystemOutput 7 }
-
-xATSSystemOutputOverCurrentThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold above which an over current condition will be generated. 
-       Specified as a percent of the transfer switch rating (xATSDeviceTransferSwitchRating OID).
-       A value of zero indicates that the threshold is disabled."
-   ::= { xATSSystemOutput 8 }
-
-xATSSystemOutputUnderCurrentThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which an under current condition will be generated. 
-       Specified as a percent of the transfer switch rating (xATSDeviceTransferSwitchRating OID).
-       A value of zero indicates that the threshold is disabled."
-   ::= { xATSSystemOutput 9 }
-
-xATSSystemOutputAlarmDelayThreshold OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Delay the generation of an output alarm.
-       Specified in seconds."
-   ::= { xATSSystemOutput 10 }
-
-xATSSystemOutputTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of system output phase entries."
-   ::= { xATSSystemOutput 11 }
-   
-xATSSystemOutputTable OBJECT-TYPE
-   SYNTAX     SEQUENCE OF XATSSystemOutputPhaseEntry
-   ACCESS     not-accessible
-   STATUS     mandatory
-   DESCRIPTION
-      "A list of system output table entries.
-       The number of entries is contained in the xATSSystemOutputTableSize OID."
-   ::= { xATSSystemOutput 12 }
-
-   xATSSystemOutputPhaseEntry OBJECT-TYPE
-       SYNTAX     XATSSystemOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular system output phase."
-       INDEX { xATSSystemOutputPhaseIndex }
-       ::= { xATSSystemOutputTable 1 }
-
-   XATSSystemOutputPhaseEntry ::= SEQUENCE {
-       xATSSystemOutputPhaseIndex      INTEGER,
-       xATSSystemOutputVoltageLtoL     INTEGER,
-       xATSSystemOutputVoltageLtoN     INTEGER,
-       xATSSystemOutputPhaseCurrent    INTEGER,
-       xATSSystemOutputPower           INTEGER,
-       xATSSystemOutputApparentPower   INTEGER,
-       xATSSystemOutputPowerFactor     INTEGER
-      }
-
-   xATSSystemOutputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each system output phase utilized in this device."
-       ::= { xATSSystemOutputPhaseEntry 1 }
-
-   xATSSystemOutputVoltageLtoL OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-line system output voltage, measured in tenths of Volts, available at the circuit panel. 
-           -1 if not available."
-       ::= { xATSSystemOutputPhaseEntry 2 }
-
-   xATSSystemOutputVoltageLtoN OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-neutral system output voltage, measured in tenths of Volts, available at the circuit panel. 
-           -1 for a 3-wire service type or if not available."
-       ::= { xATSSystemOutputPhaseEntry 3 }
-
-   xATSSystemOutputPhaseCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "System load current per phase. Measured in Amps.
-           -1 if not available."
-       ::= { xATSSystemOutputPhaseEntry 4 }
-
-   xATSSystemOutputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "System output power per phase. Measured in tenths of kW."
-       ::= { xATSSystemOutputPhaseEntry 5 }
-
-   xATSSystemOutputApparentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "system output power per phase. Measured in tenths of kVA."
-       ::= { xATSSystemOutputPhaseEntry 6 }
-
-   xATSSystemOutputPowerFactor OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "indicates the power factor of the system output per phase.
-           A value of 100 representing a unity power factor (1.00).
-           Measured in hundredths."
-       ::= { xATSSystemOutputPhaseEntry 7 }
-
--- xATS TestingStatus group
-
-xATSTestingStatusSelectTestProcess OBJECT-TYPE
-   SYNTAX INTEGER {
-      engineStartTest      (1),
-      systemLoadTest       (2),
-      generatorHoldTest    (3),
-      cancelTest           (4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Type of tests that can be selected when no test has been scheduled.
-       engineStartTest and systemLoadTest may be selected when no tests 
-       are running.  Tests that are selected may be cancelled manually."
-   ::= { xATSTestingStatus 1 }
-   
-xATSTestingStatusTestStatus OBJECT-TYPE
-     SYNTAX INTEGER {
-        noTestInProcess           (1),
-        testPending               (2),
-        startingEngine            (3),
-        engineWarmingUp           (4),
-        awaitingTransferToS2      (5),
-        testingWithLoad           (6),
-        awaitingRetransferToS1    (7),
-        testingWithoutLoad        (8),
-        stoppingEngine            (9),
-        holdingOnGenerator        (10)
-     }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The present system test status/state."
-   ::= { xATSTestingStatus 2 }
-
-xATSTestingStatusProfileWarmupTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time that the generator will warm up during a test.
-       This is portion of the test when the xATSTestingStatusTestStatus 
-       OID returns the value engineWarmingUp.
-       Specified in seconds."
-   ::= { xATSTestingStatus 3 }
-
-xATSTestingStatusProfileLoadedTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time that ATS will apply the system load to the generator
-       during a system load test.
-       This is portion of the test when the xATSTestingStatusTestStatus 
-       OID returns the value testingWithLoad.
-       Specified in minutes."
-   ::= { xATSTestingStatus 4 }
-
-xATSTestingStatusProfileUnloadedTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time that the generator will run following the warm up 
-       portion of a start test, or the loaded portion of a load test.
-       This is portion of the test when the xATSTestingStatusTestStatus 
-       OID returns the value testingWithoutLoad.
-       Specified in seconds."
-   ::= { xATSTestingStatus 5 }
-
--- xATS TestingResults group
-
-xATSTestingResultsLastDateOfTest OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Date of the last test that was performed, either scheduled or manual.
-       Test results are available in the xATSTestingResultsLastResult OID.
-       Specified in the dd/mm/yyyy format, or 'none' if not available."
-   ::= { xATSTestingResults 1 }
-
-xATSTestingResultsLastResult OBJECT-TYPE
-   SYNTAX INTEGER {
-      startTestPassed           (1),
-      loadTestPassed            (2),
-      startSignalFailure        (3),
-      failedGenNotInAuto        (4),
-      failedGenEmerStop         (5),
-      failedGenShutdown         (6),
-      failedGenDidNotStart      (7),
-      failedS2NeverGood         (8),
-      genFailedDuringWarmup     (9),
-      failureOnXferToS1         (10),
-      genFailedLoaded           (11),
-      failureOnRexferToS2       (12),
-      genFailedToStop           (13),
-      failedAtsInternalFault    (14),
-      failedAtsNotInAuto        (15),
-      cancelledManualTest       (16),
-	  cancelledScheduledTest    (17)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The result of the last ATS/generator system test."
-   ::= { xATSTestingResults 2 }
-
-xATSTestingResultsTestLastTestTime OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Time of day at which the last test was performed, either scheduled or manual. 
-       Test results are available in the xATSTestingResultsLastResult OID.
-       Specified in the hh:mm:ss format, or 'none' if not available."
-   ::= { xATSTestingResults 3 }
-
-xATSTestingResultsLastCrankDuration OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The time spent cranking the generator before it started during the last test.
-       Specified in seconds, or -1 if not available."
-   ::= { xATSTestingResults 4 }
-   
-xATSTestingResultsLastWarmupDuration OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The time spent in the engineWarmingUp state during the last system test.
-       Specified in seconds, or -1 if not available."
-   ::= { xATSTestingResults 5 }
-
-xATSTestingResultsLastLoadedDuration OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The time spent in the testingWithLoad state during the last system test.
-       Specified in seconds, or -1 if not available."
-   ::= { xATSTestingResults 6 }
-
-xATSTestingResultsLastUnloadedDuration OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The time spent in the testingWithoutLoad state during the last system test.
-       Specified in seconds, or -1 if not available."
-   ::= { xATSTestingResults 7 }
-
--- xATS TestingSchedule group
-
-xATSTestingScheduleFrequency OBJECT-TYPE
-    SYNTAX INTEGER  {
-        never   (1),
-        daily   (2),
-        weekly  (3),
-        monthly (4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The frequency of running scheduled tests."
-   ::= { xATSTestingSchedule 1 }
-
-xATSTestingScheduleTestDay OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The desired day for the scheduled test. This object applies only
-       when the xATSTestingScheduleFrequency OID is set to weekly or monthly.
-       For weekly test frequency, the string is the day the test will be run.
-       For monthly test frequency, the string indicates the day, 
-       and the instance within the month.
-       For example, for monthly frequency: 2nd sunday, 3rd monday, 4th tuesday,
-                    for weekly frequency: sunday, monday, tuesday."
-   ::= { xATSTestingSchedule 2 }
-
-xATSTestingScheduleTestTime OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The time of day that the scheduled test will occur.
-       Specified in the format hh:mm."
-   ::= { xATSTestingSchedule 3 }
-
-xATSTestingScheduleTestWithLoadInterval OBJECT-TYPE
-   SYNTAX INTEGER {
-      applyLoadEveryTest          (1),
-      neverApplyLoad              (2),
-      applyLoadMonthly            (3),
-      applyLoadMonthlyDetailed    (4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This setting specifies which system tests should include applying the
-       load to the generator. The applyLoadMonthlyDetailed entry
-       in the list will apply load once, for each month represented in the
-       xATSTestingScheduleTestWithLoadSelectMonth OID."
-   ::= { xATSTestingSchedule 4 }
-
-xATSTestingScheduleTestWithLoadSelectMonth OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The detailed selection for testing with load on a month-by-month basis.
-       This object is applicable when the xATSTestingScheduleTestWithLoadInterval
-       is set to applyLoadMonthlyDetailed. Otherwise this selection will be ignored.
-       Format for this string is a comma-separated entry of months.
-       For example: Jan,Mar,Dec.
-       The string will return 'No Months Scheduled' if no months have been selected."
-   ::= { xATSTestingSchedule 5 }
-
-xATSTestingScheduleNextTestDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date of the next scheduled test, in the format dd-mmm-yyyy."
-   ::= { xATSTestingSchedule 6 }
-
--- xATSTestingSimulatePowerFail group
-
-xATSTestingSimulatePowerFailTest OBJECT-TYPE
-   SYNTAX     INTEGER{
-      cancelSimulation         (1),
-      fiveSecondsSimulation    (2),
-      tenSecondsSimulation     (3),
-      thirtySecondsSimulation  (4),
-      oneMinuteSimulation      (5),
-      threeMinutesSimulation   (6),
-      fiveMinutesSimulation    (7),
-      tenMinutesSimulation     (8)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This object executes a simulated power failure for the duration indicated.
-       Simulation can be aborted by selecting cancelSimulation."
-   ::= { xATSTestingSimulatePowerFail 1 }
-
-xATSTestingSimulatePowerFailTimeRemaining OBJECT-TYPE
-   SYNTAX  INTEGER
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "Indicates the time remaining in seconds, for a simulated power failure.
-       a value of zero indicates that simulated power failure is not active."
-   ::= { xATSTestingSimulatePowerFail 2 }
-
--- The xATS Input Contact group
-
-xATSInputContactNumContacts OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts supported by the ATS."
-   ::= { xATSInputContacts 1 }
-
-xATSInputContactTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of input contact entries."
-   ::= { xATSInputContacts 2 }
-
-xATSInputContactTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF XATSContactEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the ATS.
-       The number of entries is contained in the 
-       xATSInputContactTableSize OID."
-   ::= { xATSInputContacts 3 }
-
-   xATSInputContactEntry OBJECT-TYPE
-      SYNTAX XATSContactEntry
-      ACCESS not-accessible
-      STATUS mandatory
-      DESCRIPTION
-         "A contact entry containing information for a given contact."
-      INDEX  { xATSInputContactNumber }
-      ::= { xATSInputContactTable 1 }
-
-   XATSContactEntry ::=
-      SEQUENCE {
-         xATSInputContactNumber    INTEGER,
-         xATSInputContactName      DisplayString,
-         xATSInputContactNormalState           INTEGER,
-         xATSInputContactCurrentState          INTEGER
-      }
-
-   xATSInputContactNumber OBJECT-TYPE
-      SYNTAX INTEGER
-      ACCESS read-only
-      STATUS mandatory
-      DESCRIPTION
-         "An index identifying the contact on the ATS."
-      ::= { xATSInputContactEntry 1 }
-
-   xATSInputContactName OBJECT-TYPE
-     SYNTAX DisplayString
-     ACCESS read-write
-     STATUS mandatory
-     DESCRIPTION
-        "The description of the purpose/use of the contact."
-     ::= { xATSInputContactEntry 2 }
-
-   xATSInputContactNormalState OBJECT-TYPE
-     SYNTAX INTEGER {
-        open   (1),
-        closed (2)
-     }
-     ACCESS read-write
-     STATUS mandatory
-     DESCRIPTION
-        "The normal operating position of the contact."
-     ::= { xATSInputContactEntry 3 }
-
-   xATSInputContactCurrentState OBJECT-TYPE
-     SYNTAX INTEGER {
-        open   (1),
-        closed (2)
-     }
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "This value indicates the current state of the contact."
-     ::= { xATSInputContactEntry 4 }
-
--- the xATS OutputRelays group
-
-   xATSOutputRelayNumRelays OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "The number of output relays supported by the ATS."
-     ::= { xATSOutputRelays 1 }
-
-   xATSOutputRelayTableSize OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "The number of output relay entries."
-     ::= { xATSOutputRelays 2 }
-
-   xATSOutputRelayTable OBJECT-TYPE
-     SYNTAX SEQUENCE OF XATSOutputRelayEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "A list of output relays supported by the ATS.
-        The number of entries is contained in the 
-        xATSOutputRelayTableSize OID."
-     ::= { xATSOutputRelays 3 }
-
-   xATSOutputRelayEntry OBJECT-TYPE
-     SYNTAX XATSOutputRelayEntry
-     ACCESS not-accessible
-     STATUS mandatory
-     DESCRIPTION
-        "A output relay entry containing information for a given contact."
-     INDEX  { xATSOutputRelayNumber }
-     ::= { xATSOutputRelayTable 1 }
-
-   XATSOutputRelayEntry ::=
-     SEQUENCE {
-        xATSOutputRelayNumber           INTEGER,
-        xATSOutputRelayName             DisplayString,
-        xATSOutputRelayNormalState      INTEGER,
-        xATSOutputRelayCurrentState     INTEGER
-     }
-
-   xATSOutputRelayNumber OBJECT-TYPE
-     SYNTAX INTEGER
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-        "An index identifying the output relay on the ATS."
-     ::= { xATSOutputRelayEntry 1 }
-
-   xATSOutputRelayName OBJECT-TYPE
-     SYNTAX DisplayString
-     ACCESS read-write
-     STATUS mandatory
-     DESCRIPTION
-       "The description of the purpose/use of the output relay."
-     ::= { xATSOutputRelayEntry 2 }
-
-   xATSOutputRelayNormalState OBJECT-TYPE
-     SYNTAX INTEGER {
-        open   (1),
-        closed (2)
-     }
-     ACCESS read-write
-     STATUS mandatory
-     DESCRIPTION
-       "The normal operating position of the output relay."
-     ::= { xATSOutputRelayEntry 3 }
-
-   xATSOutputRelayCurrentState OBJECT-TYPE
-     SYNTAX INTEGER {
-        open   (1),
-        closed (2)
-     }
-     ACCESS read-only
-     STATUS mandatory
-     DESCRIPTION
-       "This value indicates the current state of the output relay."
-     ::= { xATSOutputRelayEntry 4 }
-
--- The xATS Generator Ident group
-
-xATSGeneratorIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the model number of the generator. 
-       This value is set at the factory."
-   ::= { xATSGeneratorIdent 1 }
-
-xATSGeneratorIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the serial number of the generator. 
-       This value is set at the factory."
-   ::= { xATSGeneratorIdent 2 }
-
-xATSGeneratorIdentDateofManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying when the generator was manufactured in mm/dd/yyyy format. 
-       This value is set at the factory."
-   ::= { xATSGeneratorIdent 3 }
-
-xATSGeneratorIdentVoltageConfiguration OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The voltage for which the generator's alternator is designed.
-       Specified in Volts line-to-line."
-   ::= { xATSGeneratorIdent 4 }
-
-xATSGeneratorIdentMaxPowerRating OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The max power rating of the generator. Specified in kW."
-   ::= { xATSGeneratorIdent 5 }
-
-xATSGeneratorIdentAlternatorFrequency OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frequency for which the generator's alternator is designed.
-       Specified in Hertz."
-   ::= { xATSGeneratorIdent 6 }
-
--- The xATS Generator Status group
-
-xATSGeneratorStatusGeneratorName OBJECT-TYPE
-   SYNTAX     DisplayString
-   ACCESS     read-write
-   STATUS     mandatory
-   DESCRIPTION
-       "The name or label for the generator connected to the source 2 of the ATS."
-   ::= { xATSGeneratorStatus 1 }
-   
-xATSGeneratorStatusOperational OBJECT-TYPE
-   SYNTAX     INTEGER{
-      nocomm         (1),
-      off            (2),
-      ready          (3),
-      starting       (4),
-      idle           (5),
-      running        (6),
-      normalStop     (7),
-      emergencyStop  (8),
-      notInAuto      (9),
-      shutdown       (10),
-      unknown        (11)
-   }
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-       "The operational status of the generator. unavailable when unrecognized status is received."
-   ::= { xATSGeneratorStatus 2 }
-
-xATSGeneratorStatusModeSwitchPosition OBJECT-TYPE
-   SYNTAX     INTEGER{
-      off        (1),
-      manual     (2),
-      automatic  (3),
-      unknown    (4)
-   }
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-       "The position of the generator's auto-mode switch.
-        In automatic mode, the generator is started and stopped via the
-        remote start contact, which has state indicated in the
-        xATSGeneratorStatusRemoteStart OID.
-        In manual mode generator start/stop control is via local command only.
-        Off prevents the generator from running."
-   ::= { xATSGeneratorStatus 3 }
-
-xATSGeneratorStatusRemoteStart OBJECT-TYPE
-   SYNTAX INTEGER{
-      stop     (1),
-      run      (2),
-      unknown  (3)
-   }
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-       "The status of the generator's remote start contact, which is 
-        provided as an output from the transfer switch to start/stop the 
-        generator when in automatic mode."
-   ::= { xATSGeneratorStatus 4 }
-
--- The xATS Generator Advanced Status group
-
-xATSGeneratorAdvStatusBatteryVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The voltage of the generator's starting battery.
-       Measured in tenths of VDC, or -1 if not available."
-   ::= { xATSGeneratorAdvStatus 1 }
-
-xATSGeneratorAdvStatusOilPressure OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The generator's engine oil pressure.
-       Measured in tenths of Psi or kPa, based on the
-       value of the xATSGeneratorSettingsMetricUnit OID,
-       or -1 if not available."
-   ::= { xATSGeneratorAdvStatus 2 }
-
-xATSGeneratorAdvStatusCoolantTemperature OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Current coolant temperature in the generator.
-       Measured in degrees Celsius or Fahrenheit, based on the
-       value of the xATSGeneratorSettingsMetricUnit OID,
-       or -1 if not available."
-   ::= { xATSGeneratorAdvStatus 3 }
-
-xATSGeneratorAdvStatusEngineRPM OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Current engine speed of the generator. 
-       Measured in RPM, or -1 if not available."
-   ::= { xATSGeneratorAdvStatus 4 }
-
-xATSGeneratorAdvStatusOilLevel OBJECT-TYPE
-   SYNTAX     INTEGER{
-      ok        (1),
-      low       (2),
-      unknown   (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates adequate oil level in the generator."
-   ::= { xATSGeneratorAdvStatus 5 }
-
-xATSGeneratorAdvStatusCoolantLevel OBJECT-TYPE
-   SYNTAX     INTEGER{
-      ok         (1),
-      low        (2),
-      unknown    (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates adequate coolant level in the generator."
-   ::= { xATSGeneratorAdvStatus 6 }
-
--- The xATS Generator Output group
-
-xATSGeneratorOutputFrequency OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The output frequency of the generator.
-       Measured in tenths of Hertz, or -1 if not avaialble."
-   ::= { xATSGeneratorOutput 1 }
-
-xATSGeneratorOutputTotalPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total output power of the generator.
-       Measured in tenths of tenths of kW, or -1 if not avaialble."
-   ::= { xATSGeneratorOutput 2 }
-
-xATSGeneratorOutputTotalApparentPower OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total output power of the generator.
-       Measured in tenths of kVA, or -1 if not avaialble."
-   ::= { xATSGeneratorOutput 3 }
-   
-xATSGeneratorOutputTotalPowerFactor OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-          "Indicates the total load power factor of the generator.
-           A value of 100 representing a unity power factor (1.00),
-           or -1 when if not avaialble."
-   ::= { xATSGeneratorOutput 4 }
-   
-xATSGeneratorOutputTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of generator output phase entries."
-   ::= { xATSGeneratorOutput 5 }
-
-   xATSGeneratorOutputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF XATSGeneratorOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-      "A list of generator output table entries.
-       The number of entries is contained in the xATSGeneratorOutputTableSize OID."
-       ::= { xATSGeneratorOutput 6 }
-
-   xATSGeneratorOutputPhaseEntry OBJECT-TYPE
-       SYNTAX     XATSGeneratorOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-          "An entry containing information applicable to a 
-           particular generator output phase."
-       INDEX { xATSGeneratorOutputPhaseIndex }
-       ::= { xATSGeneratorOutputTable 1 }
-
-   XATSGeneratorOutputPhaseEntry ::= SEQUENCE {
-       xATSGeneratorOutputPhaseIndex      INTEGER,
-       xATSGeneratorOutputVoltageLtoL     INTEGER,
-       xATSGeneratorOutputVoltageLtoN     INTEGER,
-       xATSGeneratorOutputPhaseCurrent    INTEGER,
-       xATSGeneratorOutputPower           INTEGER,
-       xATSGeneratorOutputApparentPower   INTEGER,
-       xATSGeneratorOutputPowerFactor     INTEGER
-      }
-
-   xATSGeneratorOutputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Description of each generator output phase utilized in this device."
-       ::= { xATSGeneratorOutputPhaseEntry 1 }
-
-   xATSGeneratorOutputVoltageLtoL OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-line generator output voltage. 
-           Measured in Volts, or -1 if not available."
-       ::= { xATSGeneratorOutputPhaseEntry 2 }
-
-   xATSGeneratorOutputVoltageLtoN OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Line-to-neutral generator output voltage. 
-           Measured in volts, or -1 if not avaialble."
-       ::= { xATSGeneratorOutputPhaseEntry 3 }
-
-   xATSGeneratorOutputPhaseCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Generator load current per phase.
-           Measured in Amps, or -1 if not avaialble."
-       ::= { xATSGeneratorOutputPhaseEntry 4 }
-
-   xATSGeneratorOutputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Generator output power per phase. 
-           Measured in tenths of kW, or -1 if not avaialble."
-       ::= { xATSGeneratorOutputPhaseEntry 5 }
-
-   xATSGeneratorOutputApparentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Generator output power per phase. 
-           Measured in tenths of kVA, or -1 if not available."
-       ::= { xATSGeneratorOutputPhaseEntry 6 }
-
-   xATSGeneratorOutputPowerFactor OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-          "Indicates the load power factor of the generator output per phase.
-           A value of 100 representing a unity power factor (1.00),
-           or -1 if not avaialble."
-       ::= { xATSGeneratorOutputPhaseEntry 7 }
-
--- xATS Generator Settings group
-
-xATSGeneratorSettingsVoltageAdjust OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The voltage adjust of the generator.
-       Specified in volts line-to-line,
-       or -1 if not available."
-   ::= { xATSGeneratorSettings 1 }
-
-xATSGeneratorSettingsFrequencyAdjust OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frequency adjust of the generator.
-       Specified in tenths of Hertz."
-   ::= { xATSGeneratorSettings 2 }
-
-xATSGeneratorSettingsStartDelay OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The delay, in seconds, after the remote run signal is activated
-       before the generator's engine will be cranked to start, 
-       or -1 if not available."
-   ::= { xATSGeneratorSettings 3 }
-
-xATSGeneratorSettingsStopDelay OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The delay, in seconds, before the generator will stop 
-       after the remote run signal is deactivated,
-       or -1 if not available."
-   ::= { xATSGeneratorSettings 4 }
-
-xATSGeneratorSettingsCrankCycleEnable OBJECT-TYPE
-   SYNTAX     INTEGER{
-      disabled        (1),
-      enabled         (2),
-      unknown         (3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "When Crank Cycle is enabled, the engine will be cranked up to the time 
-       specified by the xATSGeneratorSettingsCrankTime OID. 
-       If the generator's engine does not start, there will be a pause as
-       specified by the xATSGeneratorSettingsCrankRestTime OID before the 
-       engine will be cranked again. This cycle is repeated as specified by
-       the xATSGeneratorSettingsNumberCrank OID.
-       When crank cycle is disabled, the generator's engine will be 
-       cranked continuously until it starts."
-   ::= { xATSGeneratorSettings 5 }
-
-xATSGeneratorSettingsCrankTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The duration of engine cranking, in seconds, when starting the generator. 
-       Applicable when the xATSGeneratorSettingsCrankCycleEnable OID is enabled.
-       -1 if not available."
-   ::= { xATSGeneratorSettings 6 }
-
-xATSGeneratorSettingsCrankRestTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The pause duration, in seconds, following an unsuccessful attempt to start the generator. 
-       Applicable when the xATSGeneratorSettingsCrankCycleEnable OID is enabled.
-       -1 if not available."
-   ::= { xATSGeneratorSettings 7 }
-
-xATSGeneratorSettingsNumberCrank OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of failed crank attempts before giving up on starting the generator. 
-       Applicable when the xATSGeneratorSettingsCrankCycleEnable OID is enabled.
-       -1 if not available."
-   ::= { xATSGeneratorSettings 8 }
-
-xATSGeneratorSettingsMetricUnit OBJECT-TYPE
-   SYNTAX INTEGER{
-      disabled (1),
-      enabled  (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Specifies the use of metric units in generator related OIDs, as well
-       as on all other interfaces including the generator's local interface."
-   ::= { xATSGeneratorSettings 9 }
-
--- xATS generator service group
-
-xATSGeneratorServiceTotalRunHoursLifetime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Total time that the generator engine has been run,
-       over the life of the generator. Measured in hours.
-       -1 if not available."
-   ::= { xATSGeneratorService 1 }
-
-xATSGeneratorServiceEngineStartsLifetime OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "Number of engine starts over the life of the generator.
-      -1 if not available."
-   ::= { xATSGeneratorService 2 }
-
-xATSGeneratorServiceTotalkWhLifetime OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "Total kWh of operation over the life of the generator.
-       -1 if not available."
-   ::= { xATSGeneratorService 3 }
-
-xATSGeneratorServiceTotalRunHoursSinceMaintanence OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "Total time that the generator engine has been run,
-       since last service maintenance. Measured in tenths of hours.
-       -1 if not available."
-   ::= { xATSGeneratorService 4 }
-
-xATSGeneratorServiceEngineStartsSinceMaintanence OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "Number of engine starts since last service maintenance.
-       -1 if not available."
-   ::= { xATSGeneratorService 5 }
-
-xATSGeneratorServiceTotalkWhMaintanence OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-      "Total kWh of operation since last service maintenance.
-       -1 if not available."
-   ::= { xATSGeneratorService 6 }
-
-xATSGeneratorServiceResetRecord OBJECT-TYPE
-   SYNTAX INTEGER{
-      yes        (1),
-      no         (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Resets the engine start counter, engine run-hours, and kWh values that have
-       accumulated in the generator since last maintenance.
-       Also, the last service date will be reset to the current system date, and 
-       any service alarms will be cleared."
-   ::= { xATSGeneratorService 7 }
-
-xATSGeneratorServiceRecordResetDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Date at which the generator's service record was reset, in dd-mmm-yyyy format."
-   ::= { xATSGeneratorService 8 }
-
-xATSGeneratorServiceNextServiceDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Date at which the next generator service is due in dd-mmm-yyyy format. 
-       Based on the xATSGeneratorServiceCalendarIntervalThreshold OID 
-       or '' if the calander-based threshold is set to off."
-   ::= { xATSGeneratorService 9 }
-   
-xATSGeneratorServiceRunHoursUntilServiceDate OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Runhours until the next generator service is due, in hours. 
-       Based on the xATSGeneratorServiceRunHoursThreshold OID 
-       or -1 if the runhour-based threshold is set to off."
-   ::= { xATSGeneratorService 10 }
-      
-xATSGeneratorServiceRunHoursThreshold OBJECT-TYPE
-   SYNTAX INTEGER{
-      disabled                 (1),
-      runThreshold100Hours     (2),
-      runThreshold150Hours     (3),
-      runThreshold200Hours     (4),
-      runThreshold250Hours     (5),
-      runThreshold300Hours     (6),
-      runThreshold400Hours     (7),
-      runThreshold500Hours     (8)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Runhour-based service interval. When the run-hours since
-       service surpasses this threshold, generator service is due."
-   ::= { xATSGeneratorService 11 }
-
-xATSGeneratorServiceCalendarIntervalThreshold OBJECT-TYPE
-   SYNTAX INTEGER{
-      disabled            (1),
-      interval1month      (2),
-      interval2month      (3),
-      interval3month      (4),
-      interval6month      (5),
-      intervalyearly      (6)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Calander-based service interval. When the next service date, 
-       as indicated by the xATSGeneratorServiceNextServiceDate OID
-       is in the past, generator is due for service."
-   ::= { xATSGeneratorService 12 }
-
--- The xATS Generator Fuel system group
-
-xATSGeneratorFuelSystemType OBJECT-TYPE
-   SYNTAX     INTEGER{
-      diesel      (1),
-      propane     (2),
-      naturalGas  (3),
-      unknown     (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The type of fuel used by the generator."
-   ::= { xATSGeneratorFuelSystem 1 }
-
-xATSGeneratorFuelSystemTankSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Size of the generator's fuel tank.
-       Specified in gallons or liters, based on the value of the
-       xATSGeneratorSettingsMetricUnit OID, or -1 if not available."
-   ::= { xATSGeneratorFuelSystem 2 }
-
-xATSGeneratorFuelSystemFuelLevel OBJECT-TYPE
-   SYNTAX  INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Fuel remaining in the generator tank.
-       Measured in percent of tank fill, or -1 if if not available."
-   ::= { xATSGeneratorFuelSystem 3 }
-
-xATSGeneratorFuelSystemRuntimePower OBJECT-TYPE
-   SYNTAX  INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The power value used in the runtime remaining calculation.
-       Measured in tenths of kW, or -1 if not available."
-   ::= { xATSGeneratorFuelSystem 4 }
-
-xATSGeneratorFuelSystemEstimatedRunTime OBJECT-TYPE
-   SYNTAX  INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An estimate of available runtime for the generator, based on
-       available fuel as specified in the xATSGeneratorFuelSystemFuelLevel OID 
-       and kW load as specified in the xATSGeneratorFuelSystemRuntimePower OID.
-       Measured in tenths of hours, or -1 if not available."
-   ::= { xATSGeneratorFuelSystem 5 }
-   
-xATSGeneratorFuelSystemLowRunTimeThreshold OBJECT-TYPE
-   SYNTAX INTEGER{
-      disabled        (1),
-      oneHour         (2),
-      twoHours        (3),
-      threeHours      (4),
-      fourHours       (5),
-      fiveHours       (6),
-      sixHours        (7),
-      twelveHours     (8),
-      oneDay          (9),
-      twoDays         (10),
-      threeDays       (11),
-      fourDays        (12),
-      fiveDays        (13),
-      sixDays         (14),
-      sevenDays       (15)
-      
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which a low runtime alarm will exist."
-   ::= { xATSGeneratorFuelSystem 6 }
-
-xATSGeneratorFuelSystemVeryLowRunTimeThreshold OBJECT-TYPE
-   SYNTAX INTEGER{
-      disabled        (1),
-      oneHour         (2),
-      twoHours        (3),
-      threeHours      (4),
-      fourHours       (5),
-      fiveHours       (6),
-      sixHours        (7),
-      twelveHours     (8),
-      oneDay          (9),
-      twoDays         (10),
-      threeDays       (11),
-      fourDays        (12),
-      fiveDays        (13),
-      sixDays         (14),
-      sevenDays       (15)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which a very low runtime alarm will exist."
-   ::= { xATSGeneratorFuelSystem 7 }
-
-xATSGeneratorFuelSystemLowFuelLevelThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which a low fuel alarm will exist, with a value of 0 indicating disabled. 
-       Specified as percent of tank fill."
-   ::= { xATSGeneratorFuelSystem 8 }
-
-xATSGeneratorFuelSystemVeryLowFuelLevelThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold below which a very low fuel alarm will exist, with a value of 0 indicating disabled.
-       Specified as percent of tank fill."
-   ::= { xATSGeneratorFuelSystem 9 }
-
--- the software group
--- the powerNetSubAgent group
--- the powerNetSoftwareSystem group
-      
-powerNetSoftwareSystemDescription OBJECT-TYPE
-   SYNTAX  DisplayString (SIZE (0..79))
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "A brief description of the PowerNet sub-agent."
-   ::= { powerNetSoftwareSystem 1 }
-
-powerNetSoftwareOid  OBJECT-TYPE
-   SYNTAX  OBJECT IDENTIFIER
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The object identifier of the PowerNet sub-agent."
-   ::= { powerNetSoftwareSystem 2 }
-
--- powerNetSmuxPeer     OBJECT IDENTIFIER ::= { powerNetSoftwareOid 1 }
--- powerNetDPIPeer      OBJECT IDENTIFIER ::= { powerNetSoftwareOid 2 }
-
-powerNetSoftwareSystemUpTime  OBJECT-TYPE
-   SYNTAX  TimeTicks
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-         "The time that the sub-agent has been running."
-   ::= { powerNetSoftwareSystem 3 }
-
-
--- powerNetSoftwareConfig group
-
-powerNetSoftwareTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of software modules supporting the UPS."
-   ::= { powerNetSoftwareConfig 1 }
-
-powerNetSoftwareTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF SoftwareEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION 
-      "A list of the software monitoring the UPS."
-   ::= { powerNetSoftwareConfig 2 }
-
-powerNetSoftwareEntry OBJECT-TYPE
-   SYNTAX SoftwareEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "An entry containing information on a software module."
-   INDEX { moduleNumber }
-   ::= { powerNetSoftwareTable 1 }
-
-SoftwareEntry ::= 
-   SEQUENCE {
-      moduleNumber
-         INTEGER,
-      moduleName
-         DisplayString,
-      moduleVersion
-         DisplayString,
-      moduleDate
-         DisplayString
-   }
-
-moduleNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index into the Software Entry Table"
-   ::= { powerNetSoftwareEntry 1 }
-
-moduleName OBJECT-TYPE
-   SYNTAX DisplayString (SIZE (0..79))
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The name of the software module."
-   ::= { powerNetSoftwareEntry 2 }
-
-moduleVersion OBJECT-TYPE
-   SYNTAX DisplayString (SIZE (0..8))
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The version of the software module." 
-   ::= { powerNetSoftwareEntry 3 }
-
-moduleDate OBJECT-TYPE
-   SYNTAX DisplayString (SIZE (0..9))
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date of the software module represented as mm-dd-yy."
-   ::= { powerNetSoftwareEntry 4 }
-
-
--- the ups group
--- the upsIdent group
--- the upsBasicIdent
-
-upsBasicIdentModel OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The UPS model name (e.g. 'APC Smart-UPS 600')."
-   ::= { upsBasicIdent 1 }
-
-upsBasicIdentName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "An 8 byte ID string identifying the UPS.  This object
-       can be set by the administrator."
-   ::= { upsBasicIdent 2 }
-
-
--- the upsAdvIdent group
-
-upsAdvIdentFirmwareRevision OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the UPS system's microprocessor."
-   ::= { upsAdvIdent 1 }
-
-upsAdvIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the UPS was manufactured in mm/dd/yy format."
-   ::= { upsAdvIdent 2 }
-
-upsAdvIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An 8-character string identifying the serial number of 
-       the UPS internal microprocessor.  This number is set at
-       the factory.  NOTE: This number does NOT correspond to
-       the serial number on the rear of the UPS."
-   ::= { upsAdvIdent 3 }
-
-
-
--- the upsBattery group
--- the upsBasicBattery group
-
-upsBasicBatteryStatus OBJECT-TYPE
-   SYNTAX INTEGER  {
-      unknown(1),
-      batteryNormal(2),
-      batteryLow(3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the UPS batteries.  A batteryLow(3) 
-       value indicates the UPS will be unable to sustain the 
-       current load, and its services will be lost if power is 
-       not restored.  The amount of run time in reserve at the 
-       time of low battery can be configured by the 
-       upsAdvConfigLowBatteryRunTime."
-   ::= { upsBasicBattery 1 }
-
-upsBasicBatteryTimeOnBattery OBJECT-TYPE
-   SYNTAX TimeTicks 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The elapsed time since the UPS has switched to battery 
-       power."
-   ::= { upsBasicBattery 2 }
-
-upsBasicBatteryLastReplaceDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the UPS system's batteries were last replaced 
-       in mm/dd/yy format.   For Smart-UPS models, this value 
-       is originally set in the factory.  When the UPS batteries 
-       are replaced, this value should be reset by the administrator."
-   ::= { upsBasicBattery 3 }
-
-
-
--- the upsAdvBattery group
-
-upsAdvBatteryCapacity OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The remaining battery capacity expressed in 
-       percent of full capacity."
-   ::= { upsAdvBattery 1 }
-
-upsAdvBatteryTemperature OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current internal UPS temperature expressed in 
-       Celsius."
-   ::= { upsAdvBattery 2 }
-
-upsAdvBatteryRunTimeRemaining OBJECT-TYPE
-   SYNTAX TimeTicks 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The UPS battery run time remaining before battery 
-       exhaustion."
-   ::= { upsAdvBattery 3 }
-
-upsAdvBatteryReplaceIndicator OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noBatteryNeedsReplacing(1),
-      batteryNeedsReplacing(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Indicates whether the UPS batteries need replacing."
-   ::= { upsAdvBattery 4 }
-
-upsAdvBatteryNumOfBattPacks OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of external battery packs connected to the UPS. If
-       the UPS does not use smart cells then the agent reports
-       ERROR_NO_SUCH_NAME."
-   ::= { upsAdvBattery 5 }
-
-upsAdvBatteryNumOfBadBattPacks OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of external battery packs connected to the UPS that 
-       are defective. If the UPS does not use smart cells then the
-       agent reports ERROR_NO_SUCH_NAME."
-   ::= { upsAdvBattery 6 }
-
-upsAdvBatteryNominalVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The nominal battery voltage in Volts."
-   ::= { upsAdvBattery 7 }
-
-upsAdvBatteryActualVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The actual battery bus voltage in Volts."
-   ::= { upsAdvBattery 8 }
-
-upsAdvBatteryCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery current in Amps."
-   ::= { upsAdvBattery 9 }
-
-upsAdvTotalDCCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total DC current in Amps."
-   ::= { upsAdvBattery 10 }
-
-
--- the upsBasicInput group
-
-upsBasicInputPhase OBJECT-TYPE
-   SYNTAX INTEGER                  
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current AC input phase."
-   ::= { upsBasicInput 1 }
-
-
--- the upsAdvInput group
-
-upsAdvInputLineVoltage OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current utility line voltage in VAC."
-   ::= { upsAdvInput 1 }
-
-upsAdvInputMaxLineVoltage OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum utility line voltage in VAC over the
-       previous 1 minute period."
-   ::= { upsAdvInput 2 }
-
-upsAdvInputMinLineVoltage OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The minimum utility line voltage in VAC over the
-       previous 1 minute period."
-   ::= { upsAdvInput 3 }
-
-upsAdvInputFrequency OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current input frequency to the UPS system in Hz."
-   ::= { upsAdvInput 4 }
-
-
-upsAdvInputLineFailCause OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noTransfer(1),
-      highLineVoltage(2),
-      brownout(3),
-      blackout(4),
-      smallMomentarySag(5),
-      deepMomentarySag(6),
-      smallMomentarySpike(7),
-      largeMomentarySpike(8),
-      selfTest(9),
-      rateOfVoltageChnage(10)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The reason for the occurrence of the last transfer to UPS
-       battery power.  The variable is set to:
-       - noTransfer(1) -- if there is no transfer yet.
-       - highLineVoltage(2) -- if the transfer to battery is caused
-       by an over voltage greater than the high transfer voltage.
-       - brownout(3) -- if the duration of the outage is greater than
-       five seconds and the line voltage is between 40% of the
-       rated output voltage and the low transfer voltage.
-       - blackout(4) -- if the duration of the outage is greater than five
-       seconds and the line voltage is between 40% of the rated 
-       output voltage and ground.
-       - smallMomentarySag(5) -- if the duration of the outage is less
-       than five seconds and the line voltage is between 40% of the
-       rated output voltage and the low transfer voltage.
-       - deepMomentarySag(6) -- if the duration of the outage is less 
-       than five seconds and the line voltage is between 40% of the 
-       rated output voltage and ground.  The variable is set to 
-       - smallMomentarySpike(7) -- if the line failure is caused by a
-       rate of change of input voltage less than ten volts per cycle.
-       - largeMomentarySpike(8) -- if the line failure is caused by 
-       a rate of change of input voltage greater than ten volts per cycle.
-       - selfTest(9) -- if the UPS was commanded to do a self test.
-       - rateOfVoltageChange(10) -- if the failure is due to the rate of change of
-       the line voltage."
-   ::= { upsAdvInput 5 }
-
-
--- the upsBasicOutput group
-
-upsBasicOutputStatus OBJECT-TYPE
-   SYNTAX INTEGER  {
-      unknown(1),
-      onLine(2),
-      onBattery(3),
-      onSmartBoost(4),
-      timedSleeping(5),
-      softwareBypass(6),
-      off(7),
-      rebooting(8),
-      switchedBypass(9),
-      hardwareFailureBypass(10),
-      sleepingUntilPowerReturn(11),
-      onSmartTrim(12)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current state of the UPS.  If the UPS is unable 
-       to determine the state of the UPS this variable is set 
-       to unknown(1)."
-   ::= { upsBasicOutput 1 }
-
-upsBasicOutputPhase OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current output phase."
-   ::= { upsBasicOutput 2 }
-
-
--- the upsAdvOutput group
-
-upsAdvOutputVoltage OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The output voltage of the UPS system in VAC."
-   ::= { upsAdvOutput 1 }
-
-upsAdvOutputFrequency OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current output frequency of the UPS system in Hz."
-   ::= { upsAdvOutput 2 }
-
-upsAdvOutputLoad OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current UPS load expressed in percent 
-       of rated capacity."
-   ::= { upsAdvOutput 3 }
-
-upsAdvOutputCurrent OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current in amperes drawn by the load on the UPS."
-   ::= { upsAdvOutput 4 }
-
-
--- the upsBasicConfig group
-
-upsBasicConfigNumDevices OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of devices that are plugged into the UPS."
-   ::= { upsBasicConfig 1 }
-
-upsBasicConfigDeviceTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsBasicConfigDeviceEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of devices that are plugged into the UPS.
-       The number of entries is given by the value of
-       upsBasicConfigNumDevices."
-   ::= { upsBasicConfig 2 }
-
-upsBasicConfigDeviceEntry OBJECT-TYPE
-   SYNTAX UpsBasicConfigDeviceEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The devices plugged in to the UPS."
-   INDEX  { deviceIndex }
-   ::= { upsBasicConfigDeviceTable 1 }
-
-UpsBasicConfigDeviceEntry ::=
-   SEQUENCE {
-      deviceIndex 
-         INTEGER,
-      deviceName
-         DisplayString,
-      vaRating
-         INTEGER,
-      acceptThisDevice
-         INTEGER
-   }
-
-deviceIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the device that is plugged into the UPS."
-   ::= { upsBasicConfigDeviceEntry 1 }
-
-deviceName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The name/description of the device plugged into the UPS."
-   ::= { upsBasicConfigDeviceEntry 2 }
-
-vaRating OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The volt-amp rating of the device plugged into the UPS."
-   ::= { upsBasicConfigDeviceEntry 3 }
-
-acceptThisDevice OBJECT-TYPE
-   SYNTAX INTEGER   {
-      yes(1),
-      no(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "An entry is added if yes, the entry is deleted if no."
-   ::= { upsBasicConfigDeviceEntry 4 }
-
-
-
-
--- the upsAdvConfig group
-
-upsAdvConfigRatedOutputVoltage OBJECT-TYPE
-   SYNTAX INTEGER  
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The nominal output voltage from the UPS in VAC. 
-
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-      
-       If a value other than a supported value is provided in a 
-       set request, the UPS interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { upsAdvConfig 1 }
-
-upsAdvConfigHighTransferVolt OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The maximum line voltage in VAC allowed before the
-       UPS system transfers to battery backup.
-
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-
-       If a value other than a supported value is provided in a
-       set request, the UPS interprets it as a the next higher
-       acceptable value.  If the provided value is higher than
-       the highest acceptable value, the highest acceptable 
-       value is used."
-   ::= { upsAdvConfig 2 }
-
-upsAdvConfigLowTransferVolt OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The minimum line voltage in VAC allowed before the
-       UPS system transfers to battery backup.
-      
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-
-       If a value other than a supported value is provided in a 
-       set request, the UPS interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { upsAdvConfig 3 }
-
-upsAdvConfigAlarm OBJECT-TYPE
-   SYNTAX INTEGER  {
-      timed(1),
-      atLowBattery(2),
-      never(3),
-      mute(4)
-   } 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A flag indicating how the UPS should handle audible
-       line fail alarms:
-       timed(1): UPS alarm will sound after a preset timed duration starting
-       from the line fail condition (see OID upsAdvConfigAlarmTimer for the
-       alarm timer value)
-       atLowBattery(2): UPS alarm will sound when the UPS has reached a Low
-       Battery condition during a line fail
-       never(3): Disables the UPS audible alarm
-       mute(4): Mutes the current alarm for some UPSs only when it is in an
-       alarm state and will return to the previously configured option when
-       the UPS recovers from the alarm condition"
-   ::= { upsAdvConfig 4 }
-
-upsAdvConfigAlarmTimer OBJECT-TYPE
-   SYNTAX TimeTicks 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The time after initial line failure at which the UPS
-       begins emitting audible alarms (beeping).  This timer is
-       observed only if the value of extControlAlarm is timed(2).
-       Allowed values are 0 or 30 seconds.
-
-       If a value other than a supported value is provided in a
-       set request, the UPS interprets it as a the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { upsAdvConfig 5 }
-
-upsAdvConfigMinReturnCapacity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The minimum battery capacity required before the UPS will 
-       return from a low battery shutdown condition.  The capacity is
-       measured from 0% battery capacity (or Low Battery) as a percent
-       of full capacity (100%).   In other words, the UPS will not re-energize
-       the output until the battery has charged so that its' capacity is equal 
-       to this value.
-       
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-
-       If a value other than a supported value is provided in a
-       set request, the UPS interprets it as a the next higher
-       acceptable value.  If the provided value is higher than
-       the highest acceptable value, the highest acceptable 
-       value is used."
-   ::= { upsAdvConfig 6 }
-
-upsAdvConfigSensitivity OBJECT-TYPE
-   SYNTAX INTEGER  {
-      auto(1),
-      low(2),
-      medium(3),
-      high(4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The sensitivity of the UPS to utility line abnormalities
-       or noises."
-   ::= { upsAdvConfig 7 }
-
-upsAdvConfigLowBatteryRunTime OBJECT-TYPE
-   SYNTAX TimeTicks 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The desired run time of the UPS, in seconds, once the 
-       low battery condition is reached. During this time the UPS will
-       produce a constant warning tone which can not be disabled.
-       
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-
-       If a value other than a supported value is provided in a set
-       request, the UPS interprets the value as the next higher
-       acceptable value.  If the provided value is higher than the
-       highest acceptable value, the highest acceptable value is used."
-   ::= { upsAdvConfig 8 }
-
-upsAdvConfigReturnDelay OBJECT-TYPE
-   SYNTAX TimeTicks
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The delay in seconds after utility line power returns
-       before the UPS will turn on.  This value is also used 
-       when the UPS comes out of a reboot and before the UPS
-       wakes up from 'sleep' mode.
-
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-      
-       If a value other than a supported value is provided in a
-       set request, the UPS interprets it as a the next higher
-       acceptable value.  If the provided value is higher than
-       the highest acceptable value, the highest acceptable 
-       value is used."
-   ::= { upsAdvConfig 9 }
-
-upsAdvConfigShutoffDelay OBJECT-TYPE
-   SYNTAX TimeTicks 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The delay in seconds the UPS remains on after being told 
-       to turn off.
-
-       For a list of allowed values supported by your UPS model,
-       see the UPS User's Manual.
-
-       If a value other than a supported value is provided in a
-       set request, the UPS interprets it as a the next higher
-       acceptable value.  If the provided value is higher than
-       the highest acceptable value, the highest acceptable 
-       value is used."
-   ::= { upsAdvConfig 10 }
-
-upsAdvConfigUpsSleepTime OBJECT-TYPE
-   SYNTAX TimeTicks 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The time in seconds for the UPS to go to 'sleep' when 
-       instructed.  When in sleep mode, the UPS will not provide
-       output power regardless of the input line state.  Once the
-       specified time has elapsed, output power will be restored.
-
-       This is a configuration setting.  The UPS will not go to
-       sleep until told to do so by the manager from a management
-       station.
-      
-       Any input value is allowed, however the UPS only recognizes
-       1/10 of an hour increments.  The provided value will be 
-       rounded to the closest 1/10 of an hour with one exception:
-       Any value entered between 1 and 540 seconds will be rounded 
-       to 360 seconds (or 6 minutes)."
-   ::= { upsAdvConfig 11 }
-
-
-upsAdvConfigSetEEPROMDefaults OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noSetEEPROMDefaults(1),
-      setEEPROMDefaults(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "WRITE: Resets the UPS EEPROM variables to default values.
-       READ: returns 0"
-   ::= { upsAdvConfig 12 }
-
-upsAdvConfigDipSwitchSetting OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsAdvConfigDipSwitchEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Current settings of UPS dip switches."
-   ::= { upsAdvConfig 13 }
-
-upsAdvConfigDipSwitchEntry OBJECT-TYPE
-   SYNTAX UpsAdvConfigDipSwitchEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The current setting of one dip switch."
-   INDEX  { dipSwitchIndex }
-   ::= { upsAdvConfigDipSwitchSetting 1 }
-
-UpsAdvConfigDipSwitchEntry ::=
-   SEQUENCE {
-      dipSwitchIndex 
-         INTEGER,
-      dipSwitchStatus
-         INTEGER
-   }
-
-dipSwitchIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of a UPS dip switch."
-   ::= { upsAdvConfigDipSwitchEntry 1 }
-
-dipSwitchStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      on(1),
-      off(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The setting of a UPS dip switch."
-   ::= { upsAdvConfigDipSwitchEntry 2 }
-
-upsAdvConfigBattExhaustThresh OBJECT-TYPE
-   SYNTAX TimeTicks
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The number of seconds prior to battery exhaustion when the
-       UPS will switch off power to its load."
-   ::= { upsAdvConfig 14 }
-
-upsAdvConfigPassword OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The password entered at the UPS front panel to enable local
-       configuration of the EEProm. If the password is disabled or 
-       is not supported, then the agent returns a null string."
-   ::= { upsAdvConfig 15 }
-
-upsAdvConfigAllowedSetTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ApcUpsConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The table listing the allowed values for all discrete 
-       configurable UPS variables."
-   ::= { upsAdvConfig 16 }
-
-apcUpsConfigEntry OBJECT-TYPE
-   SYNTAX ApcUpsConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The table entry for a configurable UPS variable."
-   INDEX  { apcUpsConfigFieldIndex }
-   ::= { upsAdvConfigAllowedSetTable 1 }
-
-ApcUpsConfigEntry ::= SEQUENCE {
-   apcUpsConfigFieldIndex        INTEGER,
-   apcUpsConfigFieldOID          OBJECT IDENTIFIER,
-   apcUpsConfigFieldValueRange   DisplayString
-   }
-
-apcUpsConfigFieldIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to an eeprom field entry."
-   ::= { apcUpsConfigEntry 1 }
-
-apcUpsConfigFieldOID OBJECT-TYPE
-   SYNTAX OBJECT IDENTIFIER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The OID of the current configurable value."
-   ::= { apcUpsConfigEntry 2 }
-
-apcUpsConfigFieldValueRange OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The discrete set of allowed values of a configurable 
-       register. Individual values are delimited by a comma."
-   ::= { apcUpsConfigEntry 3 }
-
-upsAdvConfigBattCabAmpHour OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure settings of UPS battery cabinet amp hour setting."
-   ::= { upsAdvConfig 17 }
-
-upsAdvConfigPositionSelector OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown  (1),
-     rack     (2),
-     tower    (3) 
-   }
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure UPS position selector.  If the UPS doesn't
-       support this configuration it will report unknown (1).
-       The positions are either rack (2) for rack mounted or
-       tower (3) for tower unit."
-   ::= { upsAdvConfig 18 }
-
-upsAdvConfigOutputFreqRange OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown          (1),
-     freqRangeAUTO    (2),
-     freqRange60Var1  (3),
-     freqRange60Var3  (4),
-     freqRange50Var1  (5),
-     freqRange50Var3  (6),
-     freqRange60Var10 (7),
-     freqRange50Var10 (8)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure the output frequency tolerance range.
-       unknown(1) indicates the output frequency is unknown.
-       freqRangeAUTO(2) configure the output frequency range for automatic.
-       freqRange60Var1(3) configure the output frequency range for 60 +/- 0.1 Hz
-       freqRange60Var3(4) configure the output frequency range for 60 +/- 3.0 Hz
-       freqRange50Var1(5) configure the output frequency range for 50 +/- 0.1 Hz
-       freqRange50Var3(6) configure the output frequency range for 50 +/- 3.0 Hz
-       freqRange60Var10(7) configure the output frequency range for 60 +/- 10 Hz
-       freqRange50Var10(8) configure the output frequency range for 50 +/- 10 Hz"
-   ::= { upsAdvConfig 19 }
-
-upsAdvConfigUPSFail OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown      (1),
-     gotoBypass   (2),
-     dropLoad     (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure the UPS fail action.  If UPS fails,
-      and frequency or voltage is out of range it will either
-      GotoBypass (2) or DropLoad (3).  This OID will report
-      unknown (1) if it is not supported feature or option."
-   ::= { upsAdvConfig 20 }
-
-upsAdvConfigAlarmRedundancy OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure settings of UPS alarm if the redundancy is
-      under the current redundancy.  Use -1 for never."
-   ::= { upsAdvConfig 21 }
-
-upsAdvConfigAlarmLoadOver OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure settings of UPS alarm if the load is
-      over the current load in kVA.  Use -1 for never."
-   ::= { upsAdvConfig 22 }
-
-upsAdvConfigAlarmRuntimeUnder OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure settings of UPS alarm if the runtime is
-      under the current time of minutes.  Use -1 for never."
-   ::= { upsAdvConfig 23 }
-
-upsAdvConfigVoutReporting OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown    (1),
-     voutAUTO   (2),
-     vout208    (3),
-     vout240    (4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure the way the UPS scales its output voltage readings.
-       unknown(1) indicates the Vout Reporting is unknown.
-       voutAUTO(2) configure the Vout Reporting for automatic scalling.
-       vout208(3) configure the Vout Reporting for 208 Volts.
-       vout240(4) configure the Vout Reporting for 240 Volts."
-   ::= { upsAdvConfig 24 }
-
-upsAdvConfigNumExternalBatteries OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure the number of external batteries connected to the UPS."
-   ::= { upsAdvConfig 25 }
-
-upsAdvConfigSimpleSignalShutdowns OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown    (1),
-     disabled   (2),
-     enabled    (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Configure Simple Signal shutdown commands from the Simple Signal
-       port to be issued to the UPS.
-       unknown(1) indicates the Simple Signal Shutdown setting is unknown.
-       disabled(2) configure to disable Simple Signal Shutdowns.
-       enabled(3) configure to enable Simple Signal Shutdowns."
-   ::= { upsAdvConfig 26 }
-
-
--- the upsSyncCtrlGroupConfig group
-
-upsSCGMembershipGroupNumber OBJECT-TYPE
-   SYNTAX INTEGER  
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION       
-       "The SCG Membership Group number (MGN) is a 16-bit number allowing 
-       up to 65534 separate groups that can be identified and distinguished
-       per IP subnet. Zero and 65535 are not used. The MGN is used in all 
-       communication between members of the SCG and a Network Management Card
-       (NMC) will listen and only respond to commands sent to it using its 
-       configured SCG ID."         
-   ::= { upsSyncCtrlGroupConfig 1 }
-
-upsSCGActiveMembershipStatus OBJECT-TYPE
-    SYNTAX INTEGER  {
-      enabledSCG (1),
-      disabledSCG (2)
-    } 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Membership in the configured SCG can be enabled and 
-      disabled.  If an NMC is configured for an SCG, but 
-      has its membership disabled, all synchronized control commands 
-      received will be ignored."
-   ::= { upsSyncCtrlGroupConfig 2 } 
-   
-upsSCGPowerSynchronizationDelayTime OBJECT-TYPE
-   SYNTAX INTEGER  
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION       
-        "The Power Synchronization Delay Time (PSD) setting is the maximum 
-         number of seconds an SCG Initiator will wait for all SCG members to 
-         recover utility power before completing the reboot sequence of a
-         reboot or sleep command. If all SCG members are ready to proceed, 
-         no additional delay is introduced."
-   ::= { upsSyncCtrlGroupConfig 3 }
-
-upsSCGReturnBatteryCapacityOffset OBJECT-TYPE
-   SYNTAX INTEGER  
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION       
-        "A reboot command uses the Initiator’s Return battery Capacity (RBC) to control
-        when the SCG completes this operation. In a Normal Control Operation (NCC) the 
-        UPS will only complete the reboot if RBC is reached.  Due to normal battery 
-        charge rate variations it may be desirable for the Followers to complete the 
-        reboot if they are within some range of the Initiator’s RBC when the Initiator 
-        is prepared (charged to RBC) to complete the reboot. The Return Battery 
-        Capacity Offset (RBCO) defines a percent battery capacity subtracted from an 
-        RBC above which a Follower’s battery must be charged for it to complete a 
-        reboot.  For example, if the Initiator’s RBC is 50% and the Initiator’s RBCO is
-        5% then a Follower’s battery capacity is within range if it is greater or equal 
-        to 45% (50% - 5%) at the time when the Initiator tries to complete the reboot 
-        command.  The default RBCO is 10%. "
-   ::= { upsSyncCtrlGroupConfig 4 }
-   
-upsSCGMultiCastIP OBJECT-TYPE
-       SYNTAX     IpAddress
-       ACCESS     read-write
-       STATUS     mandatory
-       DESCRIPTION
-               "The MultiCast IP address of the SCG Group."
-       ::= { upsSyncCtrlGroupConfig 5 } 
-         
--- the upsSyncCtrlGroupStatus group
-
-upsSCGNumOfGroupMembers OBJECT-TYPE
-   SYNTAX     INTEGER
-   ACCESS     read-only
-   STATUS     mandatory
-   DESCRIPTION
-       "The number of active, communicating members in the Sync Control Group (SCG).
-        This variable indicates the number of rows in the SCG Status Table."
-       ::= { upsSyncCtrlGroupStatus 1 }
-
--- Sync Control Group Status Table
-
-upsSCGStatusTable OBJECT-TYPE
-   SYNTAX     SEQUENCE OF UpsSCGStatusEntry
-   ACCESS     not-accessible
-   STATUS     mandatory
-   DESCRIPTION
-       "A list of SCG status table entries.  The number of entries
-        is given by the value of upsSCGNumOfGroupMembers."
-       ::= { upsSyncCtrlGroupStatus 2 }
-
-   upsSCGStatusEntry OBJECT-TYPE
-       SYNTAX     UpsSCGStatusEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular SCG Member."
-       INDEX { upsSCGStatusTableIndex }
-       ::= { upsSCGStatusTable 1 }
-
-   UpsSCGStatusEntry ::= SEQUENCE {
-       upsSCGStatusTableIndex           INTEGER,
-       upsSCGMemberIP                   IpAddress,
-       upsSCGACInputStatus              INTEGER,
-       upsSCGACOutputStatus             INTEGER
-   }
-
-   upsSCGStatusTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The index of a status entry for an active, communicating SCG member."
-       ::= { upsSCGStatusEntry 1 }
-
-  upsSCGMemberIP OBJECT-TYPE
-       SYNTAX     IpAddress
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The IP address of an active, communicating SCG Member."
-       ::= { upsSCGStatusEntry 2 }
-
-   upsSCGACInputStatus OBJECT-TYPE
-        SYNTAX INTEGER {
-          acInGood(1),
-          acInBad(2)
-        }
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "This OID indicates the AC Input Status of the SCG Member.
-                acInGood(1) indicates the AC Input is within tolerance.
-                acInBad(2)  indicates the AC Input is not within tolerance."
-       ::= { upsSCGStatusEntry 3 }
-
-    upsSCGACOutputStatus OBJECT-TYPE
-        SYNTAX INTEGER {
-          acOutOn(1),
-          acOutOff(2)
-        }
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "This OID indicates the AC Output Status of the SCG Member.
-                acOutOn(1)  indicates the UPS output is providing power to the load.
-                acOutOff(2) indicates the UPS output is not providing power to the load. "
-       ::= { upsSCGStatusEntry 4 }
-
--- the upsBasicState group
-
-upsBasicStateOutputState OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ASCII string containing the 64 flags representing
-       the current state(s) of the UPS. If the Network Card
-       is unable to determine the state of the UPS, this
-       variable is set to ‘UNKNOWN’.
-
-       The flags are numbered 1 to 64, read from left to
-       right. The flags are defined as follows:
-       
-       Flag  1: Abnormal Condition Present
-       Flag  2: On Battery
-       Flag  3: Low Battery
-       Flag  4: On Line
-            
-       Flag  5: Replace Battery
-       Flag  6: Serial Communication Established
-       Flag  7: AVR Boost Active*
-       Flag  8: AVR Trim Active*
-       
-       Flag  9: Overload
-       Flag 10: Runtime Calibration
-       Flag 11: Batteries Discharged
-       Flag 12: Manual Bypass
-
-       Flag 13: Software Bypass
-       Flag 14: In Bypass due to Internal Fault
-       Flag 15: In Bypass due to Supply Failure*
-       Flag 16: In Bypass due to Fan Failure*
-       
-       Flag 17: Sleeping on a Timer
-       Flag 18: Sleeping until Utility Power Returns
-       Flag 19: On
-       Flag 20: Rebooting
-       
-       Flag 21: Battery Communication Lost*
-       Flag 22: Graceful Shutdown Initiated
-       Flag 23: Smart Boost or Smart Trim Fault*
-       Flag 24: Bad Output Voltage*
-       
-       Flag 25: Battery Charger Failure*
-       Flag 26: High Battery Temperature
-       Flag 27: Self Test In Progress
-       Flag 28: Low Battery / On Battery
-       
-       Flag 29: Graceful Shutdown Issued by Upstream Device
-       Flag 30: Graceful Shutdown Issued by Downstream Device
-       Flag 31: No Batteries Attached*
-       Flag 32: Synchronized command is in progress
-       
-       Flag 33: <Not Used>
-       Flag 34: <Not Used>
-       Flag 35: <Not Used>
-       Flag 36: <Not Used>
-       
-       Flag 37: <Not Used>
-       Flag 38: <Not Used>
-       Flag 39: <Not Used>
-       Flag 40: <Not Used>
-       
-       Flag 41: <Not Used>
-       Flag 42: <Not Used>
-       Flag 43: <Not Used>
-       Flag 44: <Not Used>
-       
-       Flag 45: <Not Used>
-       Flag 46: <Not Used>
-       Flag 47: <Not Used>
-       Flag 48: <Not Used>
-       
-       Flag 49: <Not Used>
-       Flag 50: <Not Used>
-       Flag 51: <Not Used>
-       Flag 52: <Not Used>
-       
-       Flag 53: <Not Used>
-       Flag 54: <Not Used>
-       Flag 55: <Not Used>
-       Flag 56: <Not Used>
-       
-       Flag 57: <Not Used>
-       Flag 58: <Not Used>
-       Flag 59: <Not Used>
-       Flag 60: <Not Used>
-       
-       Flag 61: <Not Used>
-       Flag 62: <Not Used>
-       Flag 63: <Not Used>
-       Flag 64: <Not Used>"
-
-   ::= { upsBasicState 1 }
-
--- the upsAdvState group
-
-upsAdvStateAbnormalConditions OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ASCII string containing the 32 flags representing
-       the current active UPS faults. If the Network Card
-       is unable to determine the values of the flags, this
-       variable is set to ‘UNKNOWN’. If this variable is not
-       supported by the connected UPS, this variable is set to
-       ‘NOT SUPPORTED’.
-       
-       The flags are numbered from 1 to 32, and read from left to
-       right. The flags are defined as follows:
-
-       Flag  1: Power Module Failure
-       Flag  2: Main Intelligence Module Failure
-       Flag  3: Redundant Intelligence Module Failure
-       Flag  4: Battery Failure
-        
-       Flag  5: Load(kVA) Alarm Threshold Violation
-       Flag  6: Redundancy Lost
-       Flag  7: Redundancy Below Alarm Threshold
-       Flag  8: Bypass notin Range; Either Frequency or Voltage
-       
-       Flag  9: Bypass Contactor Stuck in Bypass Condition
-       Flag 10: Bypass Contactor Stuck in On-Line Condition
-       Flag 11: In Bypass due to an Internal Fault
-       Flag 12: In Bypass due to an Overload
-       
-       Flag 13: In Maintanence Bypass
-       Flag 14: Input Circuit Braker Tripped Open
-       Flag 15: System Level Fan Failure
-       Flag 16: Redundant Intelligent Module in Control
-       
-       Flag 17: IIC Inter-Module Communication Failure
-       Flag 18: No Working Power Modules
-       Flag 19: Load Shutdown From Bypass; Input Frequency
-       Flag 20: Runtime Below Alarm Threshold
-       
-       Flag 21: Extended Run Frame Fault
-       Flag 22: Output Voltage out of Range
-       Flag 23: UPS Not Synchronized
-       Flag 24: No Batteries Installed
-       
-       Flag 25: Battery Voltage High
-       Flag 26: UPS Specific Fault Detected
-       Flag 27: Site Wiring Fault
-       Flag 28: Backfeed Protection Relay Opened
-       
-       Flag 29: <Not Used>
-       Flag 30: <Not Used>
-       Flag 31: <Not Used>
-       Flag 32: <Not Used>"
-   ::= { upsAdvState 1 }
-
-upsAdvStateSymmetra3PhaseSpecificFaults OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ASCII string containing the 64 flags representing
-      the current active UPS specific faults for the Symmetra
-      3-Phase UPS models. If the Network Card is unable to
-      determine the values of the flags, this variable is set
-      to ‘UNKNOWN’. If the connected UPS does not use this
-      variable, it is set to ‘NOT SUPPORTED’.
-      
-      The flags are numbered from 1 to 64, and read from left
-      to right. The bits are defined as follows:
-      
-      Flag  1: External Switch Gear Failure
-      Flag  2: External Transformer Over Temperature
-      Flag  3: External DC Circuit Breaker Tripped
-      Flag  4: System Power Supply Failure
-        
-      Flag  5: Battery Monitor Card Failure
-      Flag  6: Battery Monitor Card Removed
-      Flag  7: XR Communication Card Failure
-      Flag  8: XR Communication Card Removed
-      
-      Flag  9: External Switch Gear Monitoring Card Failure
-      Flag 10: External Switch Gear Monitoring Card Removed
-      Flag 11: Internal DC Circiut Breaker Tripped
-      Flag 12: Static Bypass Switch Failure
-      
-      Flag 13: System EEPROM Removed
-      Flag 14: System EEPROM Failure
-      Flag 15: UPS in Forced Bypass
-      Flag 16: <Not Used>
-      
-      Flag 17: <Not Used>
-      Flag 18: <Not Used>
-      Flag 19: <Not Used>
-      Flag 20: <Not Used>
-      
-      Flag 21: <Not Used>
-      Flag 22: <Not Used>
-      Flag 23: <Not Used>
-      Flag 24: <Not Used>
-      
-      Flag 25: <Not Used>
-      Flag 26: <Not Used>
-      Flag 27: <Not Used>
-      Flag 28: <Not Used>
-      
-      Flag 29: <Not Used>
-      Flag 30: <Not Used>
-      Flag 31: <Not Used>
-      Flag 32: <Not Used>
-      
-      Flag 33: <Not Used>
-      Flag 34: <Not Used>
-      Flag 35: <Not Used>
-      Flag 36: <Not Used>
-      
-      Flag 37: <Not Used>
-      Flag 38: <Not Used>
-      Flag 39: <Not Used>
-      Flag 40: <Not Used>
-      
-      Flag 41: <Not Used>
-      Flag 42: <Not Used>
-      Flag 43: <Not Used>
-      Flag 44: <Not Used>
-      
-      Flag 45: <Not Used>
-      Flag 46: <Not Used>
-      Flag 47: <Not Used>
-      Flag 48: <Not Used>
-      
-      Flag 49: <Not Used>
-      Flag 50: <Not Used>
-      Flag 51: <Not Used>
-      Flag 52: <Not Used>
-      
-      Flag 53: <Not Used>
-      Flag 54: <Not Used>
-      Flag 55: <Not Used>
-      Flag 56: <Not Used>
-      
-      Flag 57: <Not Used>
-      Flag 58: <Not Used>
-      Flag 59: <Not Used>
-      Flag 60: <Not Used>
-      
-      Flag 61: <Not Used>
-      Flag 62: <Not Used>
-      Flag 63: <Not Used>
-      Flag 64: <Not Used>"
-   ::= { upsAdvState 2 }
-
-upsAdvStateDP300ESpecificFaults OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ASCII string containing the 64 flags representing
-      the current active UPS specific faults for the Silcon
-      DP300E UPS models. If the Network Card is unable to
-      determine the values of the flags, this variable is set
-      to ‘UNKNOWN’. If the connected UPS does not use this
-      variable, it is set to ‘NOT SUPPORTED’.
-      
-      The flags are numbered from 1 to 64, and read from left
-      to right. The bits are defined as follows:
-      
-      Flag  1: Peak Current Limiter Avtive
-      Flag  2: Bypass Power Supply Fault
-      Flag  3: Delta Current LImiter Active
-      Flag  4: Fan Fault
-        
-      Flag  5: High DC warning
-      Flag  6: Inverter Voltage Error
-      Flag  7: Parallel Synchronization Error
-      Flag  8: Second Power Supply Fault
-      
-      Flag  9: Internal Power Supply Fault
-      Flag 10: <Not Used>
-      Flag 11: <Not Used>
-      Flag 12: <Not Used>
-      
-      Flag 13: <Not Used>
-      Flag 14: Bypass Static Switch High Temperature
-      Flag 15: High Battery Temperature
-      Flag 16: Battery Weak
-      
-      Flag 17: <Not Used>
-      Flag 18: System Locked in Operation Mode
-      Flag 19: RAM1 Memory Write Error
-      Flag 20: Memory Write Error
-      
-      Flag 21: Communication to VQ Bypass Lost
-      Flag 22: Communication to VQ Output Lost
-      Flag 23: Communication to DMU Lost
-      Flag 24: Communication to Controller Lost
-      
-      Flag 25: Communication to Parallel IF Lost
-      Flag 26: External Shutdown Accepted
-      Flag 27: DC Capacitor Charge Error
-      Flag 28: Communication to VQ Mains Lost
-      
-      Flag 29: Bypass Synchronization Error
-      Flag 30: Charge Error
-      Flag 31: <Not Used>
-      Flag 32: <Not Used>
-      
-      Flag 33: <Not Used>
-      Flag 34: <Not Used>
-      Flag 35: <Not Used>
-      Flag 36: <Not Used>
-      
-      Flag 37: <Not Used>
-      Flag 38: <Not Used>
-      Flag 39: <Not Used>
-      Flag 40: <Not Used>
-      
-      Flag 41: <Not Used>
-      Flag 42: <Not Used>
-      Flag 43: <Not Used>
-      Flag 44: <Not Used>
-      
-      Flag 45: <Not Used>
-      Flag 46: <Not Used>
-      Flag 47: <Not Used>
-      Flag 48: <Not Used>
-      
-      Flag 49: <Not Used>
-      Flag 50: <Not Used>
-      Flag 51: <Not Used>
-      Flag 52: <Not Used>
-      
-      Flag 53: <Not Used>
-      Flag 54: <Not Used>
-      Flag 55: <Not Used>
-      Flag 56: <Not Used>
-      
-      Flag 57: <Not Used>
-      Flag 58: <Not Used>
-      Flag 59: <Not Used>
-      Flag 60: <Not Used>
-      
-      Flag 61: <Not Used>
-      Flag 62: <Not Used>
-      Flag 63: <Not Used>
-      Flag 64: <Not Used>"
-   ::= { upsAdvState 3 }
-
-
--- the upsBasicControl group
-
-upsBasicControlConserveBattery OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noTurnOffUps(1),
-      turnOffUpsToConserveBattery(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to turnUpsOffToConserveBattery(2) 
-       causes a UPS on battery to be put into 'sleep' mode.  The 
-       UPS will turn back on when utility power is restored.  
-       Attempting to turn off a UPS that is not on battery will 
-       result in a badValue error.
-
-       Setting this value to noTurnOffUps(1) has no
-       effect.
-
-       The value noTurnOffUps(1) will always be returned
-       when the variable is read."
-::= { upsBasicControl 1 }
-
-
-
--- the upsAdvControl group
-
-upsAdvControlUpsOff OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noTurnUpsOff(1),
-      turnUpsOff(2),
-      turnUpsOffGracefully(3),
-      turnUpsSyncGroupOff(4),
-      turnUpsSyncGroupOffAfterDelay(5),
-      turnUpsSyncGroupOffGracefully(6)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to turnUpsOff(2) causes
-       the UPS to shut off.  When in this state, the UPS 
-       will not provide output power regardless of the input
-       line state.
-
-       Setting this variable to turnUpsOffGracefully(3) causes
-       the UPS to shut off after a delay period. This allows the
-       host to shut down in a graceful manner. When in this state,
-       the UPS will not provide output power regardless of the
-       input line state. 
-              
-       If this UPS is an active member of a Synchronized 
-       Control Group (SCG) the turnUpsSyncGroupOff(4) command 
-       will perform a Synchronized Turn Off of all active Group
-       members regardless of their current AC output status.    
-       
-       If this UPS is an active member of a Synchronized 
-       Control Group (SCG) the turnUpsSyncGroupOffAfterDelay(5)
-       command will perform a Synchronized Turn Off After Delay 
-       of all active Group members regardless of their current 
-       AC output status. This unit's Shutdown Delay will be used 
-       to execute the Turn Off After Delay command.  
-       
-       If this UPS is an active member of an SCG, the 
-       turnUpsSyncGroupOffGracefully(6) command will perform a 
-       Synchronized Turn Off Gracefully of all active Group 
-       members regardless of their current AC output status.  
-       This unit's Maximum Shutdown Time and Shutdown Delay will
-       be used to execute the Turn Off Gracefully command.  
-       
-       Setting this value to noTurnUpsOff(1) has no
-       effect.
-
-       The value noTurnUpsOff(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvControl 1 }
-
-upsAdvControlRebootUps OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noRebootUps(1),
-      rebootUps(2),
-      rebootUpsGracefully(3),
-      rebootSyncGroupUps(4),
-      rebootSyncGroupUpsGracefully(5)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to rebootUps(2) causes the
-       UPS to shut off and turn back on.
-      
-       Setting this variable to rebootUpsGracefully(3) causes the
-       UPS to shut off and turn back on after a delay period. 
-       This allows the host to shut down in a graceful manner.
-       
-       If this UPS is an active member of a Synchronized Control 
-       Group (SCG) the rebootSyncGroupUps(4) command will perform
-       a Synchronized Reboot of all active Group members regardless
-       of their current AC output status.  This unit's Power 
-       Synchronization Delay, Shutdown Delay, Return Delay, 
-       Return Battery Capacity, and Return Battery Capacity Offset 
-       will be used to execute the Reboot command.  
-
-       If this UPS is an active member of a SCG the 
-       rebootSyncGroupUpsGracefully(5) command will perform a 
-       Synchronized Reboot of all active Group members regardless 
-       of their current AC output status.  This unit's Power 
-       Synchronization Delay, Maximum Shutdown Time, 
-       Shutdown Delay, Return Delay, Return Battery Capacity, and 
-       Return Battery Capacity Offset will be used
-       to execute the Reboot command.  
-              
-       Setting this value to noRebootUps(1) has no effect.
-      
-       The value noRebootUps(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvControl 2 }
-
-upsAdvControlUpsSleep OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noPutUpsToSleep(1),
-      putUpsToSleep(2),
-      putUpsToSleepGracefully(3),
-      putUpsSyncGroupToSleep(4),
-      putUpsSyncGroupToSleepGracefully(5)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to putUpsToSleep(2) causes
-       the UPS to go to sleep for the time specified by
-       upsAdvConfigUpsSleepTime.
-      
-       Setting this variable to putUpsToSleepGracefully(3)
-       causes the UPS to go to sleep for the time specified 
-       by upsAdvConfigUpsSleepTime after a delay period. 
-       This allows the host to shut down in a graceful manner.
-
-       If this UPS is an active member of a Synchronized Control 
-       Group (SCG), the putUpsSyncGroupToSleep(4) command will perform
-       a Synchronized Sleep of all active Group members regardless 
-       of their current AC output status.  This unit's Power 
-       Synchronization Delay, Shutdown Delay, Sleep Time, 
-       and Return Delay will be used to execute the sleep command.  
-       
-       If this UPS is an active member of a SCG the 
-       putUpsSyncGroupToSleepGracefully(5) command will perform a 
-       Synchronized Sleep Gracefully of all active Group members 
-       regardless of their current AC output status.  This unit's 
-       Power Synchronization Delay, Maximum Shutdown Time, Shutdown 
-       Delay, Sleep Time, and Return Delay to execute the sleep 
-       command.  
-
-       When in sleep mode, the UPS will not provide output
-       power regardless of the input line state.  Once the
-       specified time has elapsed, output power will be
-       restored. 
-      
-       Setting this value to noPutUpsToSleep(1) has no
-       effect.
-      
-       The value noPutUpsToSleep(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvControl 3 }
-
-
-upsAdvControlSimulatePowerFail OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noSimulatePowerFailure(1),
-      simulatePowerFailure(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to simulatePowerFailure(2) causes
-       the UPS switch to battery power.
-
-       Setting this value to noSimulatePowerFailure(1) has no
-       effect.
-
-       The value noSimulatePowerFailure(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvControl 4 }
-
-
-upsAdvControlFlashAndBeep OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noFlashAndBeep(1),
-      flashAndBeep(2),
-      flashAndBeepSyncGroup(3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to flashAndBeep(2) causes the
-       UPS to beep and simultaneously turn on the UPS front
-       panel lights (Smart-UPS only).
-
-       If this UPS is an active member of a Synchronized Control 
-       Group (SCG), the flashAndBeepSyncGroup(3) command will 
-       Flash and Beep all active Group members regardless of 
-       current AC output status.
-         
-       Setting this value to noFlashAndBeep(1) has no
-       effect.
-
-       The value noFlashAndBeep(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvControl 5 }
-
-
-upsAdvControlTurnOnUPS OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noTurnOnUPS(1),
-      turnOnUPS(2),
-      turnOnUPSSyncGroup(3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to turnOnUPS(2) causes the
-       UPS to be turned on immediately.
-
-       If this UPS is an active member of a Synchronized Control 
-       Group (SCG), the turnOnUPSSyncGroup(3) command will perform 
-       a Synchronized Turn On of all active Group members 
-       regardless of their current AC output status.
-       
-       Setting this value to noTurnOnUPS(1) has no
-       effect.
-
-       The value noTurnOnUPS(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvControl 6 }
-
-upsAdvControlBypassSwitch OBJECT-TYPE
-   SYNTAX INTEGER {
-      noBypassSwitch (1),
-      switchToBypass (2),
-      switchOutOfBypass(3)
-      }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This switch puts the UPS in or out of bypass mode."
-   ::= { upsAdvControl 7 }
-
-
--- the upsTest group
-
--- the upsBasicTest group
-
--- the upsAdvTest group
-
-upsAdvTestDiagnosticSchedule OBJECT-TYPE
-   SYNTAX INTEGER  {
-      unknown(1),
-      biweekly(2),
-      weekly(3),
-      atTurnOn(4),
-      never(5)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The UPS system's automatic battery test schedule."
-   ::= { upsAdvTest 1 }
-
-
-upsAdvTestDiagnostics OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noTestDiagnostics(1),
-      testDiagnostics(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to testDiagnostics(2) causes
-       the UPS to perform a diagnostic self test.
-      
-       Setting this value to noTestDiagnostics(1) has no
-       effect.
-      
-       The value noTestDiagnostics(1) will always be returned
-       when the variable is read."
-   ::= { upsAdvTest 2 }
-
-upsAdvTestDiagnosticsResults OBJECT-TYPE
-   SYNTAX INTEGER {
-      ok(1),
-      failed(2),
-      invalidTest(3),
-      testInProgress(4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The results of the last UPS diagnostics test performed."
-   ::= { upsAdvTest 3 }
-
-upsAdvTestLastDiagnosticsDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date the last UPS diagnostics test was performed in
-       mm/dd/yy format."
-   ::= { upsAdvTest 4 }
-
-upsAdvTestRuntimeCalibration OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noPerformCalibration(1),
-      performCalibration(2),
-      cancelCurrentCalibration(3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to performCalibration(2) causes
-       the UPS to discharge to calibrate the UPS.
-       The test will only start if the battery capacity is 100%.
-       The test runs until capacity is less than 25%.
-      
-       Setting this variable to cancelCurrentCalibration(3)
-       after setting performCalibration(2) will cancel the 
-       current discharge.
-      
-       Setting this variable to noPerformCalibration(1) 
-       will have no effect.
-      
-       The value noPerformCalibration(1) will always be returned
-       when the variable is read.
-      
-       The result of the calibration will be saved in 
-       upsAdvTestCalibrationResult."
-   ::= { upsAdvTest 5 }
-
-upsAdvTestCalibrationResults OBJECT-TYPE
-   SYNTAX INTEGER {
-      ok(1),
-      invalidCalibration(2),
-      calibrationInProgress(3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The results of the last runtime calibration.
-      
-       Value ok(1) means a successful runtime calibration.
-      
-       Value invalidCalibration(2) indicates last calibration did
-       not take place since the battery capacity was below
-       100%.
-      
-       Value calibrationInProgress(3) means a calibration 
-       is occurring now. "
-   ::= { upsAdvTest 6 }
-
-upsAdvTestCalibrationDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date the last UPS runtime calibration was 
-       performed in mm/dd/yy format."
-   ::= { upsAdvTest 7 }
-
--- the upsComm group
-
-upsCommStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      ok(1),
-      noComm(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of agent's communication with UPS. "
-   ::= { upsComm 1 }
-
-
--- the measureUps group
--- the Environ group
-
-mUpsEnvironAmbientTemperature OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The ambient temperature in Celsius for Probe 1."
-   ::= { mUpsEnviron 1 }
-
-mUpsEnvironRelativeHumidity OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The relative humidity as a percentage for Probe 1."
-   ::= { mUpsEnviron 2 }
-
-
-mUpsEnvironAmbientTemperature2 OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The ambient temperature in Celsius for Probe 2."
-   ::= { mUpsEnviron 3 }
-
-mUpsEnvironRelativeHumidity2 OBJECT-TYPE
-   SYNTAX Gauge
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The relative humidity as a percentage for Probe 2."
-   ::= { mUpsEnviron 4 }
-
--- the mUpsContact group
-
-mUpsContactNumContacts OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts supported by the Measure-UPS."
-   ::= { mUpsContact 1 }
-
-mUpsContactTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ContactEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the Measure-UPS."
-   ::= { mUpsContact 2 }
-
-mUpsContactEntry OBJECT-TYPE
-   SYNTAX ContactEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A contact entry containing information for a given contact."
-   INDEX  { contactNumber }
-   ::= { mUpsContactTable 1 }
-
-ContactEntry ::=
-   SEQUENCE {
-      contactNumber
-         INTEGER,
-      normalState
-         INTEGER,
-      description
-         DisplayString,
-      monitoringStatus
-         INTEGER,
-      currentStatus
-         INTEGER
-   }
-
-contactNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An index identifying the contact on the Measure-UPS."
-   ::= { mUpsContactEntry 1 }
-
-normalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      unknown(1),
-      open(2),
-      closed(3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The normal operating position of the contact. If the normal
-       operating position cannot be set then it is controlled via the
-       dip switch on the Measure-UPS and is therefore read-only."
-   ::= { mUpsContactEntry 2 }
-
-description OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The description of the purpose/use of the contact."
-   ::= { mUpsContactEntry 3 }
-
-monitoringStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      unknown(1),
-      enabled(2),
-      disabled(3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A flag indicating whether this contact is 
-       monitored, or not."
-   ::= { mUpsContactEntry 4 }
-
-currentStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      unknown(1),
-      noFault(2),
-      fault(3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This value indicates the current state of the contact.
-       If the contact is not in its normal state.  This value
-       is set to fault(2)."
-   ::= { mUpsContactEntry 5 }
-
--- Three Phase Group
-
---
--- Reset Max/Min Values Group
---
-
-   upsPhaseResetMaxMinValues OBJECT-TYPE
-       SYNTAX INTEGER {
-          none (1),
-          reset (2) 
-       }
-       ACCESS     read-write
-       STATUS     mandatory
-       DESCRIPTION
-               "Reset the maximum and minimum UPS values:
-                upsPhaseInputMaxVoltage, upsPhaseInputMinVoltage,
-                upsPhaseInputMaxCurrent, upsPhaseInputMinCurrent,
-                upsPhaseInputMaxPower, upsPhaseInputMinPower,
-                upsPhaseOutputMaxCurrent, upsPhaseOutputMinCurrent,
-                upsPhaseOutputMaxLoad, upsPhaseOutputMinLoad,
-                upsPhaseOutputMaxPercentLoad, upsPhaseOutputMinPercentLoad,
-                upsPhaseOutputMaxPower, upsPhaseOutputMinPower,
-                upsPhaseOutputMaxPercentPower, upsPhaseOutputMinPercentPower."
-       ::= { upsPhaseResetValues 1 }
-
---
--- Input Group
---
-
--- Number of Inputs
-
-   upsPhaseNumInputs OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of input feeds to this device.
-               This variable indicates the number of rows in the
-               input table."
-       ::= { upsPhaseInput 1 }
-
--- Input Table
-
-   upsPhaseInputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF UpsPhaseInputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of input table entries.  The number of entries
-               is given by the value of upsPhaseNumInputs."
-       ::= { upsPhaseInput 2 }
-
-   upsPhaseInputEntry OBJECT-TYPE
-       SYNTAX     UpsPhaseInputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular input."
-       INDEX { upsPhaseInputTableIndex }
-       ::= { upsPhaseInputTable 1 }
-
-   UpsPhaseInputEntry ::= SEQUENCE {
-       upsPhaseInputTableIndex         INTEGER,
-       upsPhaseNumInputPhases          INTEGER,
-       upsPhaseInputVoltageOrientation INTEGER,
-       upsPhaseInputFrequency          INTEGER,
-       upsPhaseInputType               INTEGER,
-       upsPhaseInputName               DisplayString
-   }
-
-   upsPhaseInputTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input identifier."
-       ::= { upsPhaseInputEntry 1 }
-
-   upsPhaseNumInputPhases OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of input phases utilized in this
-               device.  The sum of all the upsPhaseNumInputPhases
-               variable indicates the number of rows in the 
-               input phase table."
-       ::= { upsPhaseInputEntry 2 }
-
-   upsPhaseInputVoltageOrientation OBJECT-TYPE
-       SYNTAX INTEGER {
-          unknown(1),
-          singlePhase(2),
-          splitPhase(3),
-          threePhasePhaseToNeutral(4),
-          threePhasePhaseToPhase(5)
-       }
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input voltage orientation: 
-               1: unknown for this UPS
-               2: singlePhase - phase 1 voltage is between Phase 1
-               and Neutral.
-               3: splitPhase - phase 1 voltage is between Phase 1 and 
-               Neutral; phase 2 voltage is between Phase 2 and Neutral; 
-               phase 3 voltage is between Phase 1 and Phase2.
-               4: threePhasePhaseToNeutral - phase 1 voltage is between
-               Phase 1 and Neutral; phase 2 voltage is between Phase 2 
-               and Neutral; phase 3 voltage is between Phase3 and
-               Neutral.
-               5: threePhasePhaseToPhase - phase 1 voltage is between 
-               Phase 1 and Phase 2; phase 2 voltage is between Phase 2
-               and Phase 3; phase 3 voltage is between Phase 3 and
-               Phase 1."
-       ::= { upsPhaseInputEntry 3 }
-
-   upsPhaseInputFrequency OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input frequency in 0.1 Hertz, or -1 if it's unsupported
-               by this UPS."
-       ::= { upsPhaseInputEntry 4 }
-
-   upsPhaseInputType OBJECT-TYPE
-       SYNTAX     INTEGER {
-          unknown(1),
-          main(2),
-          bypass(3)
-       }
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input type."
-       ::= { upsPhaseInputEntry 5 }
-
-   upsPhaseInputName OBJECT-TYPE
-       SYNTAX     DisplayString
-       ACCESS     read-write
-       STATUS     mandatory
-       DESCRIPTION
-               "A name given to a particular input."
-       ::= { upsPhaseInputEntry 6 }
-
--- Input Phase Table
-
-   upsPhaseInputPhaseTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF UpsPhaseInputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of input table entries.  The number of entries
-               is given by the sum of the upsPhaseNumInputPhases."
-       ::= { upsPhaseInput 3 }
-
-   upsPhaseInputPhaseEntry OBJECT-TYPE
-       SYNTAX     UpsPhaseInputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular input phase."
-       INDEX { upsPhaseInputPhaseTableIndex, upsPhaseInputPhaseIndex }
-       ::= { upsPhaseInputPhaseTable 1 }
-
-   UpsPhaseInputPhaseEntry ::= SEQUENCE {
-       upsPhaseInputPhaseTableIndex    INTEGER,
-       upsPhaseInputPhaseIndex         INTEGER,
-       upsPhaseInputVoltage            INTEGER,
-       upsPhaseInputMaxVoltage         INTEGER,
-       upsPhaseInputMinVoltage         INTEGER,
-       upsPhaseInputCurrent            INTEGER,
-       upsPhaseInputMaxCurrent         INTEGER,
-       upsPhaseInputMinCurrent         INTEGER,
-       upsPhaseInputPower              INTEGER,
-       upsPhaseInputMaxPower           INTEGER,
-       upsPhaseInputMinPower           INTEGER
-   }
-
-   upsPhaseInputPhaseTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input identifier."
-       ::= { upsPhaseInputPhaseEntry 1 }
-
-   upsPhaseInputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input phase identifier."
-       ::= { upsPhaseInputPhaseEntry 2 }
-
-   upsPhaseInputVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input voltage in VAC, or -1 if it's unsupported
-               by this UPS."
-       ::= { upsPhaseInputPhaseEntry 3 }
-
-   upsPhaseInputMaxVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum input voltage in VAC measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseInputPhaseEntry 4 }
-
-   upsPhaseInputMinVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum input voltage in VAC measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseInputPhaseEntry 5 }
-
-   upsPhaseInputCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input current in 0.1 amperes, or -1 if it's
-               unsupported by this UPS."
-       ::= { upsPhaseInputPhaseEntry 6 }
-
-   upsPhaseInputMaxCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum input current in 0.1 amperes measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseInputPhaseEntry 7 }
-
-   upsPhaseInputMinCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum input current in 0.1 amperes measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseInputPhaseEntry 8 }
-
-   upsPhaseInputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input power in Watts, or -1 if it's unsupported
-               by this UPS."
-       ::= { upsPhaseInputPhaseEntry 9 }
-
-   upsPhaseInputMaxPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum input power in Watts measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseInputPhaseEntry 10 }
-
-   upsPhaseInputMinPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum input power in Watts measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseInputPhaseEntry 11 }
-
-   --
-   -- The Output group.
-   --
-
-   -- Number of Outputs
-
-   upsPhaseNumOutputs OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of output feeds to this device.
-               This variable indicates the number of rows in the
-               output table."
-       ::= { upsPhaseOutput 1 }
-
-   -- Output Table
-
-   upsPhaseOutputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF UpsPhaseOutputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of output table entries.  The number of entries
-               is given by the value of upsOutputNumPhases."
-       ::= { upsPhaseOutput 2 }
-
-   upsPhaseOutputEntry OBJECT-TYPE
-       SYNTAX     UpsPhaseOutputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular output."
-       INDEX { upsPhaseOutputTableIndex }
-       ::= { upsPhaseOutputTable 1 }
-
-   UpsPhaseOutputEntry ::= SEQUENCE {
-       upsPhaseOutputTableIndex         INTEGER,
-       upsPhaseNumOutputPhases          INTEGER,
-       upsPhaseOutputVoltageOrientation INTEGER,
-       upsPhaseOutputFrequency          INTEGER
-   }
-
-   upsPhaseOutputTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output identifier."
-       ::= { upsPhaseOutputEntry 1 }
-
-   upsPhaseNumOutputPhases OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of output phases utilized in this
-               device.  The sum of all the upsPhaseNumOutputPhases
-               variable indicates the number of rows in the 
-               output phase table."
-       ::= { upsPhaseOutputEntry 2 }
-
-   upsPhaseOutputVoltageOrientation OBJECT-TYPE
-       SYNTAX INTEGER {
-          unknown(1),
-          singlePhase(2),
-          splitPhase(3),
-          threePhasePhaseToNeutral(4),
-          threePhasePhaseToPhase(5)
-       }
-       ACCESS read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output voltage orientation: 
-               1: unknown for this UPS
-               2: singlePhase - phase 1 voltage is between Phase 1
-               and Neutral.
-               3: splitPhase - phase 1 voltage is between Phase 1 and 
-               Neutral; phase 2 voltage is between Phase 2 and Neutral; 
-               phase 3 voltage is between Phase 1 and Phase2.
-               4: threePhasePhaseToNeutral - phase 1 voltage is between
-               Phase 1 and Neutral; phase 2 voltage is between Phase 2 
-               and Neutral; phase 3 voltage is between Phase3 and
-               Neutral.
-               5: threePhasePhaseToPhase - phase 1 voltage is between 
-               Phase 1 and Phase 2; phase 2 voltage is between Phase 2
-               and Phase 3; phase 3 voltage is between Phase 3 and
-               Phase 1."
-       ::= { upsPhaseOutputEntry 3 }
-
-   upsPhaseOutputFrequency OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output frequency in 0.1 Hertz, or -1 if it's
-               unsupported by this UPS."
-       ::= { upsPhaseOutputEntry 4 }
-
-   -- Output Phase Table
-
-   upsPhaseOutputPhaseTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF UpsPhaseOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of output table entries.  The number of
-               entries is given by the sum of the upsPhaseNumOutputPhases."
-       ::= { upsPhaseOutput 3 }
-
-   upsPhaseOutputPhaseEntry OBJECT-TYPE
-       SYNTAX     UpsPhaseOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular output phase."
-       INDEX { upsPhaseOutputPhaseTableIndex, upsPhaseOutputPhaseIndex }
-       ::= { upsPhaseOutputPhaseTable 1 }
-
-   UpsPhaseOutputPhaseEntry ::= SEQUENCE {
-       upsPhaseOutputPhaseTableIndex INTEGER,
-       upsPhaseOutputPhaseIndex      INTEGER,
-       upsPhaseOutputVoltage         INTEGER,
-       upsPhaseOutputCurrent         INTEGER,
-       upsPhaseOutputMaxCurrent      INTEGER,
-       upsPhaseOutputMinCurrent      INTEGER,
-       upsPhaseOutputLoad            INTEGER,
-       upsPhaseOutputMaxLoad         INTEGER,
-       upsPhaseOutputMinLoad         INTEGER,
-       upsPhaseOutputPercentLoad     INTEGER,
-       upsPhaseOutputMaxPercentLoad  INTEGER,
-       upsPhaseOutputMinPercentLoad  INTEGER,      
-       upsPhaseOutputPower           INTEGER,
-       upsPhaseOutputMaxPower        INTEGER,
-       upsPhaseOutputMinPower        INTEGER,
-       upsPhaseOutputPercentPower    INTEGER,
-       upsPhaseOutputMaxPercentPower INTEGER,
-       upsPhaseOutputMinPercentPower INTEGER
-   }
-
-   upsPhaseOutputPhaseTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output identifier."
-       ::= { upsPhaseOutputPhaseEntry 1 }
-
-   upsPhaseOutputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output phase identifier."
-       ::= { upsPhaseOutputPhaseEntry 2 }
-
-   upsPhaseOutputVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output voltage in VAC, or -1 if it's unsupported
-               by this UPS."
-       ::= { upsPhaseOutputPhaseEntry 3 }
-
-   upsPhaseOutputCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output current in 0.1 amperes drawn 
-               by the load on the UPS, or -1 if it's unsupported
-               by this UPS."
-       ::= { upsPhaseOutputPhaseEntry 4 }
-
-   upsPhaseOutputMaxCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum output current in 0.1 amperes measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 5 }
-
-   upsPhaseOutputMinCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum output current in 0.1 amperes measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 6 }
-
-   upsPhaseOutputLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output load in VA, or -1 if it's unsupported
-               by this UPS."
-       ::= { upsPhaseOutputPhaseEntry 7 }
-
-   upsPhaseOutputMaxLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum output load in VA measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 8 }
-
-   upsPhaseOutputMinLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum output load in VA measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 9 }
-
-   upsPhaseOutputPercentLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The percentage of the UPS load capacity in VA at 
-               redundancy @ (n + x) presently being used on this 
-               output phase, or -1 if it's unsupported by this UPS."
-       ::= { upsPhaseOutputPhaseEntry 10 }
-
-   upsPhaseOutputMaxPercentLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum percentage of the UPS load capacity in 
-               VA measured at redundancy @ (n + x) presently 
-               being used on this output phase since the last reset
-               (upsPhaseResetMaxMinValues), or -1 if it's unsupported
-               by this UPS. Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 11 }
-
-   upsPhaseOutputMinPercentLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum percentage of the UPS load capacity in 
-               VA measured at redundancy @ (n + x) presently 
-               being used on this output phase since the last reset
-               (upsPhaseResetMaxMinValues), or -1 if it's unsupported
-               by this UPS. Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 12 }
-
-   upsPhaseOutputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output power in Watts, or -1 if it's
-               unsupported by this UPS."
-       ::= { upsPhaseOutputPhaseEntry 13 }
-
-   upsPhaseOutputMaxPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum output power in Watts measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 14 }
-
-   upsPhaseOutputMinPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum output power in Watts measured
-               since the last reset (upsPhaseResetMaxMinValues), or
-               -1 if it's unsupported by this UPS.
-               Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 15 }
-
-   upsPhaseOutputPercentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The percentage of the UPS power capacity in Watts at 
-               redundancy @ (n + x) presently being used on this 
-               output phase, or -1 if it's unsupported by this UPS."
-       ::= { upsPhaseOutputPhaseEntry 16 }
-
-   upsPhaseOutputMaxPercentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum percentage of the UPS power capacity
-               in Watts measured at redundancy @ (n + x) presently
-               being used on this output phase since the last 
-               reset (upsPhaseResetMaxMinValues), or -1 if it's
-               unsupported by this UPS. Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 17 }
-
-   upsPhaseOutputMinPercentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum percentage of the UPS power capacity
-               in Watts measured at redundancy @ (n + x) presently
-               being used on this output phase since the last 
-               reset (upsPhaseResetMaxMinValues), or -1 if it's
-               unsupported by this UPS. Sampled every 30 seconds."
-       ::= { upsPhaseOutputPhaseEntry 18 }
-
--- the upsOutletGroupStatus group
-
-upsOutletGroupStatusTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of outlet groups for the UPS."
-   ::= { upsOutletGroupStatus 1 }
-
-upsOutletGroupStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsOutletGroupStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting status of the outlet groups. The number of
-       entries is contained in the upsOutletGroupStatusTableSize OID."
-   ::= { upsOutletGroupStatus 2 }
-
-upsOutletGroupStatusEntry OBJECT-TYPE
-   SYNTAX UpsOutletGroupStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlet group status to get."
-   INDEX  { upsOutletGroupStatusIndex}
-   ::= { upsOutletGroupStatusTable 1 }
-
-UpsOutletGroupStatusEntry ::=
-   SEQUENCE {
-      upsOutletGroupStatusIndex          INTEGER,
-      upsOutletGroupStatusName           DisplayString,
-      upsOutletGroupStatusGroupState     INTEGER,
-      upsOutletGroupStatusCommandPending INTEGER
-   }      
-
-upsOutletGroupStatusIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet group entry."
-   ::= { upsOutletGroupStatusEntry 1 }
-
-upsOutletGroupStatusName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The name of the outlet group. This OID is provided
-       for informational purposes only. This value is set
-       by the upsOutletGroupConfigName OID."
-   ::= { upsOutletGroupStatusEntry  2 }
-
-upsOutletGroupStatusGroupState OBJECT-TYPE
-   SYNTAX INTEGER {
-        upsOutletGroupStatusOn      (1),
-        upsOutletGroupStatusOff     (2),
-        upsOutletGroupStatusUnknown (3)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this variable will return the outlet group state. If the outlet
-       group is on, the upsOutletGroupStatusOn (1) value will be returned. If
-       the outlet group is off, the upsOutletGroupStatusOff (2) value will be
-       returned. If the state of the outlet group cannot be determined, the
-       upsOutletGroupStatusUnknown (3) value will be returned."
-
-   ::= { upsOutletGroupStatusEntry 3 }
-
-upsOutletGroupStatusCommandPending OBJECT-TYPE
-   SYNTAX INTEGER {
-        upsOutletGroupCommandPending   (1),
-        upsOutletGroupNoCommandPending (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this variable will return the command pending
-       state of the outlet group. If a command is pending on the 
-       outlet group, the upsOutletGroupCommandPending (1) value
-       will be returned. If there is not a command pending
-       on the outlet group, the upsOutletGroupNoCommandPending (2)
-       will be returned."
-   ::= { upsOutletGroupStatusEntry 4 }  
-
--- the upsOutletGroupConfig group
-
-upsOutletGroupConfigTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of outlet groups for the UPS."
-   ::= { upsOutletGroupConfig 1 }
-
-upsOutletGroupConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsOutletGroupConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The list of outlet groups to configure. The number of entries
-       is defined by the upsOutletGroupConfigTableSize OID."
-   ::= { upsOutletGroupConfig 2  }
-
-upsOutletGroupConfigEntry OBJECT-TYPE
-   SYNTAX UpsOutletGroupConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlet groups to configure."
-   INDEX  { upsOutletGroupConfigIndex}
-   ::= { upsOutletGroupConfigTable 1 }
-
-UpsOutletGroupConfigEntry ::=
-   SEQUENCE {
-      upsOutletGroupConfigIndex          INTEGER,
-      upsOutletGroupConfigName           DisplayString,
-      upsOutletGroupConfigPowerOnDelay   INTEGER,
-      upsOutletGroupConfigPowerOffDelay  INTEGER,
-      upsOutletGroupConfigRebootDuration INTEGER
-   }      
-
-upsOutletGroupConfigIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet group entry."
-   ::= { upsOutletGroupConfigEntry 1 }
-
-upsOutletGroupConfigName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The name of the outlet group."
-   ::= { upsOutletGroupConfigEntry 2 }
-   
-upsOutletGroupConfigPowerOnDelay OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet group will delay 
-       powering on when the delayed on or reboot command is applied.
-       Allowed values are -1 (for Never) or 0 to 600 seconds."
-   ::= { upsOutletGroupConfigEntry 3 }
-   
-upsOutletGroupConfigPowerOffDelay OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet group will delay 
-       powering off when the delayed off command is applied.
-       Allowed values are 0 to 600 seconds."
-   ::= { upsOutletGroupConfigEntry 4 }
-
-upsOutletGroupConfigRebootDuration OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "During a reboot sequence, power is turned off and then 
-       back on. This OID defines the amount of time to wait, 
-       in seconds, after turning the power off, at the start
-       of the sequence, before initiating the power on sequence.
-       Allowed values are 0 to 600 seconds."
-   ::= { upsOutletGroupConfigEntry 5 }
-
--- the upsOutletGroupControl group
-
-upsOutletGroupControlTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of outlet groups for the UPS."
-   ::= { upsOutletGroupControl 1 }
-
-upsOutletGroupControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsOutletGroupControlEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual outlet groups. The number of
-       entries is contained in the upsOutletGroupControlTableSize OID."
-   ::= { upsOutletGroupControl 2 }
-
-upsOutletGroupControlEntry OBJECT-TYPE
-   SYNTAX UpsOutletGroupControlEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlet group to control."
-   INDEX  { upsOutletGroupControlIndex}
-   ::= { upsOutletGroupControlTable 1 }
-
-UpsOutletGroupControlEntry ::=
-   SEQUENCE {
-      upsOutletGroupControlIndex   INTEGER,
-      upsOutletGroupControlName    DisplayString,
-      upsOutletGroupControlCommand INTEGER
-   }      
-
-upsOutletGroupControlIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet group entry."
-   ::= { upsOutletGroupControlEntry 1 }
-
-upsOutletGroupControlName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The name of the outlet group. This OID is provided
-       for informational purposes only. This value is set
-       by the upsOutletGroupConfigName OID."
-   ::= { upsOutletGroupControlEntry  2 }
-   
-upsOutletGroupControlCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-        upsOutletGroupImmediateOn          (1),
-        upsOutletGroupImmediateOff         (2),
-        upsOutletGroupImmediateReboot      (3),
-        upsOutletGroupDelayedOn            (4),
-        upsOutletGroupDelayedOff           (5),
-        upsOutletGroupDelayedReboot        (6),
-        upsOutletGroupCancelPendingCommand (7),
-        upsOutletGroupControlUnknown       (8)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this variable will return the outlet group state. If the outlet
-       group is on, the upsOutletGroupImmediateOn (1) value will be returned. If
-       the outlet group is off, the upsOutletGroupImmediateOff (2) value will be
-       returned. 
-       
-       If the state of the outlet group cannot be determined, the
-       upsOutletGroupControlUnknown (8) value will be returned.
-       
-       Setting this variable to upsOutletGroupImmediateOn (1) will turn the
-       outlet group on.
-       
-       Setting this variable to upsOutletGroupImmediateOff (2) will turn the
-       outlet group off. 
-
-       Setting this variable to upsOutletGroupImmediateReboot (3) will turn the outlet
-       group off, wait the upsOutletGroupConfigRebootDuration OID time, wait the
-       upsOutletGroupConfigPowerOnDelay OID, and then turn the outlet group on.
-      
-       Setting this variable to upsOutletGroupDelayedOn (4) will turn the outlet
-       group on after the upsOutletGroupConfigPowerOnDelay OID has elapsed.
-
-       Setting this variable to upsOutletGroupDelayedOff (5) will turn the outlet
-       group off after the upsOutletGroupConfigPowerOffDelay OID has elapsed.
-
-       Setting this variable to upsOutletGroupDelayedReboot (6) will turn the outlet
-       group off after the upsOutletGroupConfigPowerOffDelay OID has elapsed, wait the
-       upsOutletGroupConfigRebootDuration OID time, wait the
-       upsOutletGroupConfigPowerOnDelay OID, and then turn the outlet group on.
-      
-       Setting this variable to upsOutletGroupCancelPendingCommand (7) will
-       cause any pending command to this outlet group to be canceled."
-   ::= { upsOutletGroupControlEntry 3 }
-
--- the upsDiagnosticIM group
-
-upsDiagIMTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Intelligence Modules in or attached to the UPS."
-   ::= { upsDiagnosticIM 1 }
-
-upsDiagIMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagIMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual Intelligence Modules. The number of
-       entries is contained in the upsDiagIMTableSize OID."
-   ::= { upsDiagnosticIM 2 }
-
-upsDiagIMEntry OBJECT-TYPE
-   SYNTAX UpsDiagIMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics and information of an Intelligence Module."
-   INDEX  { upsDiagIMIndex}
-   ::= { upsDiagIMTable 1 }
-
-UpsDiagIMEntry ::=
-   SEQUENCE {
-      upsDiagIMIndex             INTEGER,
-      upsDiagIMType              INTEGER,
-      upsDiagIMStatus            INTEGER,
-      upsDiagIMFirmwareRev       DisplayString,
-      upsDiagIMSlaveFirmwareRev  DisplayString,
-      upsDiagIMHardwareRev       DisplayString,
-      upsDiagIMSerialNum         DisplayString,
-      upsDiagIMManufactureDate   DisplayString
-   }      
-
-upsDiagIMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Intelligence Module entry."
-   ::= { upsDiagIMEntry 1 }
-
-upsDiagIMType OBJECT-TYPE
-   SYNTAX INTEGER {
-     imUnknown    (1),
-     imMIM        (2),
-     imRIM        (3) 
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The type of the Intelligence Module.
-       imUnknown(1) indicates the IM type is unknown.
-       imMIM(2) indicates the IM type is a Main Intelligence Module.
-       imRIM(3) indicates the IM type is Redundant Intelligence Module."
-   ::= { upsDiagIMEntry  2 }
-   
-upsDiagIMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Intelligence Module.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagIMEntry  3 }
-   
-upsDiagIMFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the Intelligence Module."
-   ::= { upsDiagIMEntry  4 }
-   
-upsDiagIMSlaveFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The slave firmware revision of the Intelligence Module."
-   ::= { upsDiagIMEntry  5 }
-   
-upsDiagIMHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the Intelligence Module."
-   ::= { upsDiagIMEntry  6 }
-   
-upsDiagIMSerialNum OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the Intelligence Module."
-   ::= { upsDiagIMEntry  7 }
-   
-upsDiagIMManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The manufacture date of the Intelligence Module."
-   ::= { upsDiagIMEntry  8 }
-   
--- the upsDiagnosticPowerModules group
-
-upsDiagPMTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Power Modules in or attached to the UPS."
-   ::= { upsDiagnosticPowerModules 1 }
-
-upsDiagPMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagPMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of Individual Power modules. The number of
-       entries is contained in the upsDiagPMTableSize OID."
-   ::= { upsDiagnosticPowerModules 2 }
-
-upsDiagPMEntry OBJECT-TYPE
-   SYNTAX UpsDiagPMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of an Power Module."
-   INDEX  { upsDiagPMIndex}
-   ::= { upsDiagPMTable 1 }
-
-UpsDiagPMEntry ::=
-   SEQUENCE {
-      upsDiagPMIndex           INTEGER,
-      upsDiagPMStatus          INTEGER,
-      upsDiagPMFirmwareRev     DisplayString,
-      upsDiagPMHardwareRev     DisplayString,
-      upsDiagPMSerialNum       DisplayString,
-      upsDiagPMManufactureDate DisplayString
-   }      
-
-upsDiagPMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Power Module entry."
-   ::= { upsDiagPMEntry 1 }
-   
-upsDiagPMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Power Module.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagPMEntry  2 }
-   
-upsDiagPMFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the Power Module."
-   ::= { upsDiagPMEntry  3 }
-   
-upsDiagPMHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the Power Module."
-   ::= { upsDiagPMEntry  4 }
-   
-upsDiagPMSerialNum OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the Power Module."
-   ::= { upsDiagPMEntry  5 }
-   
-upsDiagPMManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The manufacture date of the Power Module."
-   ::= { upsDiagPMEntry  6 }
-
--- the upsDiagnosticBatteries group
-
-upsDiagBatteryTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of batteries in or attached to the UPS."
-   ::= { upsDiagnosticBatteries 1 }
-
-upsDiagBatteryTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagBatteryEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual batteries. The number of
-       entries is contained in the upsDiagBattTableSize OID."
-   ::= { upsDiagnosticBatteries 2 }
-
-upsDiagBatteryEntry OBJECT-TYPE
-   SYNTAX UpsDiagBatteryEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of a battery."
-   INDEX  { upsDiagBatteryIndex}
-   ::= { upsDiagBatteryTable 1 }
-
-UpsDiagBatteryEntry ::=
-   SEQUENCE {
-      upsDiagBatteryFrameIndex      INTEGER,
-      upsDiagBatteryIndex           INTEGER,
-      upsDiagBatteryStatus          INTEGER,
-      upsDiagBatterySerialNumber    DisplayString,
-      upsDiagBatteryFirmwareRev     DisplayString,
-      upsDiagBatteryManufactureDate DisplayString,
-      upsDiagBatteryType            DisplayString
-   }      
-
-upsDiagBatteryFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the battery frame entry.
-       Frame 0 indicates the Main frame. Extended Run (XR) frames
-       start from index 1."
-   ::= { upsDiagBatteryEntry 1 }
-   
-upsDiagBatteryIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the battery entry."
-   ::= { upsDiagBatteryEntry 2 }
-   
-upsDiagBatteryStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown            (1),
-     notInstalled       (2),
-     ok                 (3),
-     failed             (4),
-     highTemperature    (5),
-     replaceImmediately (6),
-     lowCapacity        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the battery.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the battery status is OK.
-       failed(4) indicates the battery status is failed.
-       highTemperature(5) indicates the battery has a high temperature condition.
-       replaceImmediately(6) indicates the battery must be replaced immediately.
-       lowCapacity(7) indicates the battery has a low capacity."
-   ::= { upsDiagBatteryEntry  3 }
-   
-upsDiagBatterySerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the battery."
-   ::= { upsDiagBatteryEntry  4 }
-   
-upsDiagBatteryFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the battery."
-   ::= { upsDiagBatteryEntry  5 }
-   
-upsDiagBatteryManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The manufacture date of the battery."
-   ::= { upsDiagBatteryEntry  6 }
-   
-upsDiagBatteryType OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The battery type or rating for the battery."
-   ::= { upsDiagBatteryEntry  7 }
-   
--- the upsDiagnosticSubsystem group
-
-upsDiagSubSysFrameTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of frames attached to the UPS including the Main frame."
-   ::= { upsDiagnosticSubsystem 1 }
-
-upsDiagSubSysFrameTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysFrameEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual XR Frames."
-   ::= { upsDiagnosticSubsystem 2 }
-
-upsDiagSubSysFrameEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysFrameEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of an XR Frame."
-   INDEX  { upsDiagSubSysFrameIndex}
-   ::= { upsDiagSubSysFrameTable 1 }
-
-UpsDiagSubSysFrameEntry ::=
-   SEQUENCE {
-      upsDiagSubSysFrameIndex                 INTEGER,
-      upsDiagSubSysFrameType                  INTEGER,
-      upsDiagSubSysFrameFirmwareRev           DisplayString,
-      upsDiagSubSysFrameHardwareRev           DisplayString,
-      upsDiagSubSysFrameSerialNum             DisplayString,
-      upsDiagSubSysFrameManufactureDate       DisplayString
-   }      
-
-upsDiagSubSysFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysFrameEntry 1 }
-      
-upsDiagSubSysFrameType OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown            (1),
-     notInstalled       (2),
-     frameTypeMain      (3),
-     frameTypeXR        (4),
-     frameTypeLXR       (5)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The type of Frame.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       frameTypeMain(3) indicates the the frame type is the Main Frame.
-       frameTypeXR(4) indicates the frame type is an XR Frame.
-       frameTypeLXR(5) indicates the frame type is an LXR Frame."
-   ::= { upsDiagSubSysFrameEntry 2 }
-      
-upsDiagSubSysFrameFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the frame."
-   ::= { upsDiagSubSysFrameEntry 3 }
-      
-upsDiagSubSysFrameHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the frame."
-   ::= { upsDiagSubSysFrameEntry 4 }
-      
-upsDiagSubSysFrameSerialNum OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the frame."
-   ::= { upsDiagSubSysFrameEntry 5 }
-      
-upsDiagSubSysFrameManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The manufacture date of the frame."
-   ::= { upsDiagSubSysFrameEntry 6 }
-      
-upsDiagSubSysIntBypSwitchTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Internal Bypass switches attached to the UPS."
-   ::= { upsDiagnosticSubsystem 3 }
-
-upsDiagSubSysIntBypSwitchTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysIntBypSwitchEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of the Internal Bypass Switch."
-   ::= { upsDiagnosticSubsystem 4 }
-
-upsDiagSubSysIntBypSwitchEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysIntBypSwitchEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of the Internal Bypass Switch."
-   INDEX  { upsDiagSubSysIntBypSwitchIndex}
-   ::= { upsDiagSubSysIntBypSwitchTable 1 }
-
-UpsDiagSubSysIntBypSwitchEntry ::=
-   SEQUENCE {
-      upsDiagSubSysIntBypSwitchFrameIndex            INTEGER,
-      upsDiagSubSysIntBypSwitchIndex                 INTEGER,
-      upsDiagSubSysIntBypSwitchStatus                INTEGER,
-      upsDiagSubSysIntBypSwitchFirmwareRev           DisplayString,
-      upsDiagSubSysIntBypSwitchHardwareRev           DisplayString,
-      upsDiagSubSysIntBypSwitchSerialNum             DisplayString,
-      upsDiagSubSysIntBypSwitchManufactureDate       DisplayString
-   }      
-
-upsDiagSubSysIntBypSwitchFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysIntBypSwitchEntry 1 }
-      
-upsDiagSubSysIntBypSwitchIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Internal Bypass Switch index entry."
-   ::= { upsDiagSubSysIntBypSwitchEntry 2 }
-      
-upsDiagSubSysIntBypSwitchStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Internal Bypass Switch status.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysIntBypSwitchEntry 3 }
-      
-upsDiagSubSysIntBypSwitchFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the Internal Bypass Switch."
-   ::= { upsDiagSubSysIntBypSwitchEntry 4 }
-      
-upsDiagSubSysIntBypSwitchHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the Internal Bypass Switch."
-   ::= { upsDiagSubSysIntBypSwitchEntry 5 }
-      
-upsDiagSubSysIntBypSwitchSerialNum OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the Internal Bypass Switch."
-   ::= { upsDiagSubSysIntBypSwitchEntry 6 }
-      
-upsDiagSubSysIntBypSwitchManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The manufacture date of the Internal Bypass Switch."
-   ::= { upsDiagSubSysIntBypSwitchEntry 7 }
-      
-upsDiagSubSysBattMonitorTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Battery Monitor Boards attached to the UPS."
-   ::= { upsDiagnosticSubsystem 5 }
-
-upsDiagSubSysBattMonitorTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysBattMonitorEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of the Battery Monitor Board."
-   ::= { upsDiagnosticSubsystem 6 }
-
-upsDiagSubSysBattMonitorEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysBattMonitorEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of the Battery Monitor Board."
-   INDEX  { upsDiagSubSysBattMonitorIndex}
-   ::= { upsDiagSubSysBattMonitorTable 1 }
-
-UpsDiagSubSysBattMonitorEntry ::=
-   SEQUENCE {
-      upsDiagSubSysBattMonitorFrameIndex            INTEGER,
-      upsDiagSubSysBattMonitorIndex                 INTEGER,
-      upsDiagSubSysBattMonitorStatus                INTEGER,
-      upsDiagSubSysBattMonitorFirmwareRev           DisplayString,
-      upsDiagSubSysBattMonitorHardwareRev           DisplayString,
-      upsDiagSubSysBattMonitorSerialNum             DisplayString,
-      upsDiagSubSysBattMonitorManufactureDate       DisplayString
-   }      
-
-upsDiagSubSysBattMonitorFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysBattMonitorEntry 1 }
-      
-upsDiagSubSysBattMonitorIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the Battery Monitor Board."
-   ::= { upsDiagSubSysBattMonitorEntry 2 }
-      
-upsDiagSubSysBattMonitorStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Battery Monitor Board.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysBattMonitorEntry 3 }
-      
-upsDiagSubSysBattMonitorFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the Battery Monitor Board."
-   ::= { upsDiagSubSysBattMonitorEntry 4 }
-      
-upsDiagSubSysBattMonitorHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the Battery Monitor Board."
-   ::= { upsDiagSubSysBattMonitorEntry 5 }
-      
-upsDiagSubSysBattMonitorSerialNum OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the Battery Monitor Board."
-   ::= { upsDiagSubSysBattMonitorEntry 6 }
-      
-upsDiagSubSysBattMonitorManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date of the manufacture for the Battery Monitor Board."
-   ::= { upsDiagSubSysBattMonitorEntry  7 }
-         
-upsDiagSubSysExternalSwitchGearTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of External Switch Gears attached to the UPS."
-   ::= { upsDiagnosticSubsystem 7 }
-
-upsDiagSubSysExternalSwitchGearTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysExternalSwitchGearEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of the individual External Switch Gear."
-   ::= { upsDiagnosticSubsystem 8 }
-
-upsDiagSubSysExternalSwitchGearEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysExternalSwitchGearEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of an individual External Switch Gear."
-   INDEX  { upsDiagSubSysExternalSwitchGearIndex}
-   ::= { upsDiagSubSysExternalSwitchGearTable 1 }
-
-UpsDiagSubSysExternalSwitchGearEntry ::=
-   SEQUENCE {
-      upsDiagSubSysExternalSwitchGearFrameIndex            INTEGER,
-      upsDiagSubSysExternalSwitchGearIndex                 INTEGER,
-      upsDiagSubSysExternalSwitchGearStatus                INTEGER,
-      upsDiagSubSysExternalSwitchGearFirmwareRev           DisplayString,
-      upsDiagSubSysExternalSwitchGearHardwareRev           DisplayString,
-      upsDiagSubSysExternalSwitchGearSerialNum             DisplayString,
-      upsDiagSubSysExternalSwitchGearManufactureDate       DisplayString
-   }      
-
-upsDiagSubSysExternalSwitchGearFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysExternalSwitchGearEntry 1 }
-      
-upsDiagSubSysExternalSwitchGearIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the External Switch Gear."
-   ::= { upsDiagSubSysExternalSwitchGearEntry 2 }
-      
-upsDiagSubSysExternalSwitchGearStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the External Switch Gear.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysExternalSwitchGearEntry 3 }
-      
-upsDiagSubSysExternalSwitchGearFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the External Switch Gear monitor card."
-   ::= { upsDiagSubSysExternalSwitchGearEntry 4 }
-      
-upsDiagSubSysExternalSwitchGearHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the External Switch Gear monitor card."
-   ::= { upsDiagSubSysExternalSwitchGearEntry 5 }
-      
-upsDiagSubSysExternalSwitchGearSerialNum OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The serial number of the External Switch Gear monitor card."
-   ::= { upsDiagSubSysExternalSwitchGearEntry 6 }
-      
-upsDiagSubSysExternalSwitchGearManufactureDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date of the manufacture for the External Switch Gear monitor card."
-   ::= { upsDiagSubSysExternalSwitchGearEntry  7 }
-
-upsDiagSubSysDisplayInterfaceCardTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Display Interface Cards attached to the UPS."
-   ::= { upsDiagnosticSubsystem 9 }
-
-upsDiagSubSysDisplayInterfaceCardTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysDisplayInterfaceCardEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual Display Interface Cards."
-   ::= { upsDiagnosticSubsystem 10 }
-
-upsDiagSubSysDisplayInterfaceCardEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysDisplayInterfaceCardEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of a Display Interface Card."
-   INDEX  { upsDiagSubSysDisplayInterfaceCardIndex}
-   ::= { upsDiagSubSysDisplayInterfaceCardTable 1 }
-
-UpsDiagSubSysDisplayInterfaceCardEntry ::=
-   SEQUENCE {
-      upsDiagSubSysDisplayInterfaceCardFrameIndex            INTEGER,
-      upsDiagSubSysDisplayInterfaceCardIndex                 INTEGER,
-      upsDiagSubSysDisplayInterfaceCardStatus                INTEGER
-   }      
-
-upsDiagSubSysDisplayInterfaceCardFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysDisplayInterfaceCardEntry 1 }
-      
-upsDiagSubSysDisplayInterfaceCardIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the Display Interface Card."
-   ::= { upsDiagSubSysDisplayInterfaceCardEntry 2 }
-      
-upsDiagSubSysDisplayInterfaceCardStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Display Interface Card.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysDisplayInterfaceCardEntry 3 }
-      
-upsDiagSubSysDCCircuitBreakerTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC Circuit Breakers attached to the UPS."
-   ::= { upsDiagnosticSubsystem 11 }
-
-upsDiagSubSysDCCircuitBreakerTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysDCCircuitBreakerEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual DC Circuit Breakers."
-   ::= { upsDiagnosticSubsystem 12 }
-
-upsDiagSubSysDCCircuitBreakerEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysDCCircuitBreakerEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of a DC Circuit Breaker."
-   INDEX  { upsDiagSubSysDCCircuitBreakerIndex}
-   ::= { upsDiagSubSysDCCircuitBreakerTable 1 }
-
-UpsDiagSubSysDCCircuitBreakerEntry ::=
-   SEQUENCE {
-      upsDiagSubSysDCCircuitBreakerFrameIndex            INTEGER,
-      upsDiagSubSysDCCircuitBreakerIndex                 INTEGER,
-      upsDiagSubSysDCCircuitBreakerStatus                INTEGER
-   }      
-
-upsDiagSubSysDCCircuitBreakerFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysDCCircuitBreakerEntry 1 }
-      
-upsDiagSubSysDCCircuitBreakerIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the DC Circuit Breaker."
-   ::= { upsDiagSubSysDCCircuitBreakerEntry 2 }
-      
-upsDiagSubSysDCCircuitBreakerStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     opened          (3),
-     closed          (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the DC Circuit Breaker.
-       unknown(1) indicates the circuit breaker status is unknown.
-       notInstalled(2) indicates the circuit breaker is not installed.
-       opened(3) indicates the circuit breaker is opened.
-       closed(4) indicates the circuit breaker is closed."
-   ::= { upsDiagSubSysDCCircuitBreakerEntry 3 }
-      
-upsDiagSubSysSystemPowerSupplyTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of System Power Supplies attached to the UPS."
-   ::= { upsDiagnosticSubsystem 13 }
-
-upsDiagSubSysSystemPowerSupplyTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysSystemPowerSupplyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual System Power Supplies."
-   ::= { upsDiagnosticSubsystem 14 }
-
-upsDiagSubSysSystemPowerSupplyEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysSystemPowerSupplyEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of a System Power Supply."
-   INDEX  { upsDiagSubSysSystemPowerSupplyIndex}
-   ::= { upsDiagSubSysSystemPowerSupplyTable 1 }
-
-UpsDiagSubSysSystemPowerSupplyEntry ::=
-   SEQUENCE {
-      upsDiagSubSysSystemPowerSupplyFrameIndex            INTEGER,
-      upsDiagSubSysSystemPowerSupplyIndex                 INTEGER,
-      upsDiagSubSysSystemPowerSupplyStatus                INTEGER
-   }      
-
-upsDiagSubSysSystemPowerSupplyFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysSystemPowerSupplyEntry 1 }
-      
-upsDiagSubSysSystemPowerSupplyIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of a System Power Supply."
-   ::= { upsDiagSubSysSystemPowerSupplyEntry 2 }
-      
-upsDiagSubSysSystemPowerSupplyStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the System Power Supply.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysSystemPowerSupplyEntry 3 }
-      
-upsDiagSubSysXRCommunicationCardTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of XR Communication Cards attached to the UPS."
-   ::= { upsDiagnosticSubsystem 15 }
-
-upsDiagSubSysXRCommunicationCardTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysXRCommunicationCardEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual XR Communication Cards."
-   ::= { upsDiagnosticSubsystem 16 }
-
-upsDiagSubSysXRCommunicationCardEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysXRCommunicationCardEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of an XR Communication Card."
-   INDEX  { upsDiagSubSysXRCommunicationCardIndex}
-   ::= { upsDiagSubSysXRCommunicationCardTable 1 }
-
-UpsDiagSubSysXRCommunicationCardEntry ::=
-   SEQUENCE {
-      upsDiagSubSysXRCommunicationCardFrameIndex            INTEGER,
-      upsDiagSubSysXRCommunicationCardIndex                 INTEGER,
-      upsDiagSubSysXRCommunicationCardStatus                INTEGER
-   }      
-
-upsDiagSubSysXRCommunicationCardFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysXRCommunicationCardEntry 1 }
-      
-upsDiagSubSysXRCommunicationCardIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of an XR Communication Card."
-   ::= { upsDiagSubSysXRCommunicationCardEntry 2 }
-      
-upsDiagSubSysXRCommunicationCardStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the XR Communication Card.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysXRCommunicationCardEntry 3 }
-      
-upsDiagSubSysExternalPowerFrameBoardTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of External Power Frame Boards attached to the UPS."
-   ::= { upsDiagnosticSubsystem 17 }
-
-upsDiagSubSysExternalPowerFrameBoardTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysExternalPowerFrameBoardEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual External Power Frame Boards."
-   ::= { upsDiagnosticSubsystem 18 }
-
-upsDiagSubSysExternalPowerFrameBoardEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysExternalPowerFrameBoardEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of an External Power Frame Board."
-   INDEX  { upsDiagSubSysExternalPowerFrameBoardIndex}
-   ::= { upsDiagSubSysExternalPowerFrameBoardTable 1 }
-
-UpsDiagSubSysExternalPowerFrameBoardEntry ::=
-   SEQUENCE {
-      upsDiagSubSysExternalPowerFrameBoardFrameIndex            INTEGER,
-      upsDiagSubSysExternalPowerFrameBoardIndex                 INTEGER,
-      upsDiagSubSysExternalPowerFrameBoardStatus                INTEGER
-   }      
-
-upsDiagSubSysExternalPowerFrameBoardFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysExternalPowerFrameBoardEntry 1 }
-      
-upsDiagSubSysExternalPowerFrameBoardIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of an External Power Frame Board."
-   ::= { upsDiagSubSysExternalPowerFrameBoardEntry 2 }
-      
-upsDiagSubSysExternalPowerFrameBoardStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the External Power Frame Board.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysExternalPowerFrameBoardEntry 3 }
-      
-upsDiagSubSysChargerTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of Chargers attached to the UPS."
-   ::= { upsDiagnosticSubsystem 19 }
-
- upsDiagSubSysChargerTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF UpsDiagSubSysChargerEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for diagnostics of individual chargers."
-   ::= { upsDiagnosticSubsystem 20 }
-
-upsDiagSubSysChargerEntry OBJECT-TYPE
-   SYNTAX UpsDiagSubSysChargerEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The diagnostics of a charger."
-   INDEX  { upsDiagSubSysChargerIndex}
-   ::= { upsDiagSubSysChargerTable 1 }
-
-UpsDiagSubSysChargerEntry ::=
-   SEQUENCE {
-      upsDiagSubSysChargerFrameIndex            INTEGER,
-      upsDiagSubSysChargerIndex                 INTEGER,
-      upsDiagSubSysChargerStatus                INTEGER
-   }      
-
-upsDiagSubSysChargerFrameIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The frame index entry."
-   ::= { upsDiagSubSysChargerEntry 1 }
-      
-upsDiagSubSysChargerIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of a charger."
-   ::= { upsDiagSubSysChargerEntry 2 }
-      
-upsDiagSubSysChargerStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     offOk           (3),
-     onOk            (4),
-     offFail         (5),
-     onFail          (6),
-     lostComm        (7)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Charger.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       offOk(3) indicates the device status is off and OK.
-       onOk(4) indicates the device status is on and OK.
-       offFail(5) indicates the device status is off and failed.
-       onFail(6) indicates the device status is on and failed.
-       lostComm(7) indicates the device has lost communication."
-   ::= { upsDiagSubSysChargerEntry 3 }
-      
--- the upsDiagnosticExternalDevices group
-
-upsDiagSwitchGearStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     fail            (4),
-     lostComm        (5),
-     overtemp        (6)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Switch Gear.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       fail(4) indicates the device status has failed.
-       lostComm(5) indicates the device has lost communication.
-       overtemp(6) indicates the device has an over temperature condition."
-   ::= { upsDiagSwitchGear  1 }
-   
-upsDiagSwitchGearInputSwitchStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     opened          (3),
-     closed          (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Switch Gear Input Switch.
-       unknown(1) indicates the switch status is unknown.
-       notInstalled(2) indicates the switch is not installed.
-       opened(3) indicates the switch is opened.
-       closed(4) indicates the switch is closed."
-   ::= { upsDiagSwitchGear  2 }
-
-upsDiagSwitchGearOutputSwitchStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     opened          (3),
-     closed          (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Switch Gear Output Switch.
-       unknown(1) indicates the switch status is unknown.
-       notInstalled(2) indicates the switch is not installed.
-       opened(3) indicates the switch is opened.
-       closed(4) indicates the switch is closed."
-   ::= { upsDiagSwitchGear  3 }
-
-upsDiagSwitchGearBypassSwitchStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     opened          (3),
-     closed          (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Switch Gear Bypass Switch.
-       unknown(1) indicates the switch status is unknown.
-       notInstalled(2) indicates the switch is not installed.
-       opened(3) indicates the switch is opened.
-       closed(4) indicates the switch is closed."
-   ::= { upsDiagSwitchGear  4 }
-
-upsDiagMCCBBoxStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     opened          (3),
-     closed          (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the MCCB Box (Molded Case Circuit Breaker Box) external device.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       opened(3) indicates the circuit is opened.
-       closed(4) indicates the circuit is closed."
-   ::= { upsDiagMCCBBox  1 }
-
-upsDiagTransformerStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     fail            (4),
-     lostComm        (5),
-     overtemp        (6),
-     opened          (7),
-     closed          (8)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the External Transformer.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       fail(4) indicates the device status has failed.
-       lostComm(5) indicates the device has lost communication.
-       overtemp(6) indicates the device has an over temperature condition.
-       opened(7) indicates the circuit is opened.
-       closed(8) indicates the circuit is closed."
-   ::= { upsDiagTransformer  1 }
-
--- the upsDiagnosticComBus group
-
-upsDiagComBusInternalMIMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     lostComm        (4),
-     rxFailure       (5),
-     txFailure       (6)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the internal MIM communication bus.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       lostComm(4) indicates the device has lost communication.
-       rxFailure(5) indicates the device has a receive failure.
-       txFailure(6) indicates the device has a transmit failure."
-   ::= { upsDiagnosticComBus  1 }
-
-upsDiagComBusInternalRIMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     lostComm        (4),
-     rxFailure       (5),
-     txFailure       (6)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the internal RIM communication bus.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       lostComm(4) indicates the device has lost communication.
-       rxFailure(5) indicates the device has a receive failure.
-       txFailure(6) indicates the device has a transmit failure."
-   ::= { upsDiagnosticComBus  2 }
-
-upsDiagComBusMIMtoRIMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     lostComm        (4),
-     rxFailure       (5),
-     txFailure       (6)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the MIM to RIM communication bus.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       lostComm(4) indicates the device has lost communication.
-       rxFailure(5) indicates the device has a receive failure.
-       txFailure(6) indicates the device has a transmit failure."
-   ::= { upsDiagnosticComBus  3 }
-
-upsDiagComBusExternalMIMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     lostComm        (4),
-     rxFailure       (5),
-     txFailure       (6)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the external MIM communication bus.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       lostComm(4) indicates the device has lost communication.
-       rxFailure(5) indicates the device has a receive failure.
-       txFailure(6) indicates the device has a transmit failure."
-   ::= { upsDiagnosticComBus  4 }
-
-upsDiagComBusExternalRIMStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-     unknown         (1),
-     notInstalled    (2),
-     ok              (3),
-     lostComm        (4),
-     rxFailure       (5),
-     txFailure       (6)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the external RIM communication bus.
-       unknown(1) indicates the device status is unknown.
-       notInstalled(2) indicates the device is not installed.
-       ok(3) indicates the device status is OK.
-       lostComm(4) indicates the device has lost communication.
-       rxFailure(5) indicates the device has a receive failure.
-       txFailure(6) indicates the device has a transmit failure."
-   ::= { upsDiagnosticComBus  5 }
-
--- the serialPort2Config group
-
-serialPort2Mode OBJECT-TYPE
-   SYNTAX INTEGER  {
-      localConsole(1),
-      passthrough(2)
-   }
-   ACCESS read-write
-   STATUS obsolete
-   DESCRIPTION
-      "Setting this variable to passthrough will enable mini's port2
-       behave like a UPS port. Choosing localConsole will enable the port
-       to be used as local console."
-      ::= { serialPort2Config 1 }
--- the serialPort2Control group
-
-setPulseOnTXD OBJECT-TYPE
-   SYNTAX INTEGER  {
-      noSetPulseOnTXD(1),
-      setPulseOnTXD(2),
-      setTXDLow(3),
-      setTXDHigh(4)
-
-   }
-   ACCESS read-write
-   STATUS obsolete
-   DESCRIPTION
-      "Setting this variable to setPulseOnTXD(2) 
-       causes adapter to generate a PULSE on TXD pin of serial port 2.
-       The duration in the prototype implementation will be 1 second.
-
-       Setting this value to noSetPulseOnTXD(1) has no
-       effect.
-      
-       The value noSetPulseOnTXD(1) will always be returned
-       when the variable is read.
-
-       Setting this value to setTXDLow(3), or setTXDHigh(4) will keep TXD
-       always low or high respectively."
-      ::= { serialPort2Control 1 }
-
--- the sPDUIdent group
-
-sPDUIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the PDU. This value 
-       is set at the factory."
-   ::= { sPDUIdent 1 }
-
-sPDUIdentFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An 8 byte ID string identifying the PDU firmware revision. 
-       This value is set at the factory." 
-   ::= {  sPDUIdent 2 }
-
-
-sPDUIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the PDU was manufactured in mm/dd/yy format.
-       This value is set at the factory. The year 2000 will be 
-       represented by 00." 
-   ::= { sPDUIdent 3 }
-   
-sPDUIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 10-character string identifying the model number of 
-       the PDU internal. This value is set at the factory."
-   ::= { sPDUIdent 4 }
-
-sPDUIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 12-character string identifying the serial number of 
-       the PDU internal microprocessor. This value is set at
-       the factory."
-   ::= { sPDUIdent 5 }
-   
-
--- the sPDUMasterControl group
-
-sPDUMasterControlSwitch  OBJECT-TYPE
-  SYNTAX INTEGER       {
-      turnAllOnNow              (1),
-      turnAllOnSequence         (2),
-      turnAllOffNow             (3),
-      rebootAllNow              (4),
-      rebootAllSequence         (5),
-      noCommand                 (6),
-      turnAllOffSequence        (7)
-   }
-   
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to turnAllOnNow (1) will turn all outlets
-       on immediately.
-       
-       Setting this OID to turnAllOnSequence (2) will turn all outlets
-       on as defined by each outlet's sPDUOutletPowerOnTime OID value.
-       
-       Setting this OID to turnAllOff (3) will turn all outlets
-       off immediately.
-       
-       Setting this OID to rebootAllNow (4) will reboot all outlets
-       immediately.
-       
-       For MasterSwitch firmware version 1.X, setting this OID to 
-       rebootAllSequence (5) reboots all outlets, with power returned 
-       to the outlets in the sequence defined by each outlet's 
-       sPDUOutletPowerOnTime OID value.
-       
-       For MasterSwitch firmware version 2.X, setting this OID to 
-       rebootAllSequence (5) will cause a turnAllOffSequence to be performed. 
-       Once all outlets are off, the MasterSwitch will then delay the 
-       sPDUMasterConfigReboot OID time, and then perform a turnAllOnSequence.    
-
-       For MasterSwitch firmware version 2.X, setting this OID to 
-       turnAllOffSequence (7) will turn all outlets off as defined by 
-       each outlet's sPDUOutletPowerOffTime OID value.
-       
-       For MasterSwitch firmware version 1.X, setting this OID to 
-       turnAllOffSequence (7) will have no effect.
-
-       Getting this OID will return the noCommand (6) value."
-              
-   ::= { sPDUMasterControl 1 }
-
-   
-sPDUMasterState  OBJECT-TYPE
-   SYNTAX DisplayString       
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-          "Getting this OID will cause the status of all outlets to be 
-          returned. This OID is provided for informational purposes only.
-          To change the outlet state, the user should use the sPDUOutletCtl
-          OID in the sPDUOutletControlTable.
-
-          The format of the data returned is a character string consisting
-          of the word 'On' if the outlet is on or 'Off' if the outlet is
-          off. At least one space will delimit each outlet entry in the 
-          string. 
-          
-          If the outlet states are unknown, the character string 'Unknown'
-          will be returned. This signifies that there is an inconsistancy 
-          in the PDU. In the rare case that this should happen, the user 
-          is advised to shut down all equipment powered by the PDU and 
-          then cycle the PDU's power. This will put the PDU in a consistent
-          state."
-           
-   ::= { sPDUMasterControl 2 }
-
-sPDUMasterPending    OBJECT-TYPE
-   SYNTAX DisplayString       
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-          "Getting this OID will cause the command pending status of all outlets to be returned.
-
-          The format of the data returned is a character string consisting
-          of the word 'Yes' if a command is pending for the outlet or 'No'
-          if there is no command pending for the outlet. At least one 
-          space will delimit each outlet entry in the string. 
-          
-          If the pending states are unknown, the character string 'Unknown'
-          will be returned. This signifies that there is an inconsistancy 
-          in the PDU. In the rare case that this should happen, the user 
-          is advised to shut down all equipment powered by the PDU and then
-          cycle the PDU's power. This will put the PDU in a consistent state."
-  ::= { sPDUMasterControl 3 }
-
-
--- the sPDUMasterConfig group
-   
-sPDUMasterConfigPowerOn  OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in seconds, between when
-        power is provided to the PDU and when the PDU
-        provides basic master power to the outlets.       
-       
-       Allowed values are:
-
-       -1 never apply power automatically.
-       0 apply power immediately.
-       15 apply power in 15 seconds.
-       30 apply power in 30 seconds.
-       45 apply power in 45 seconds.
-       60 apply power in 60 seconds  (1 minute).
-       120 apply power in 120 seconds (2 minutes).
-       300 apply power in 300 seconds (5 minutes).
-       
-       If a value other than a supported value is provided in a 
-       set request, the PDU interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-       
-   ::= { sPDUMasterConfig 1 }
-
-sPDUMasterConfigReboot   OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "During a reboot sequence, power is turned off and then 
-       back on. This OID defines the amount of time to wait, 
-       in seconds, after turning the power off, at the start
-       of the sequence, before turning power back on, at the
-       end of the reboot sequence.       
-       
-       Allowed values are:
-       
-       5 wait 5 seconds between off/on.
-       10 wait 10 seconds between off/on.
-       15 wait 15 seconds between off/on.
-       20 wait 20 seconds between off/on.
-       30 wait 30 seconds between off/on.
-       45 wait 45 seconds between off/on.
-       60 wait 60 seconds (1 minute) between off/on.
-       
-       If a value other than a supported value is provided in a 
-       set request, the PDU interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used.
-
-       This OID is read-only for the MasterSwitch version 2.X and is the 
-       maximum sPDUOutletRebootDuration OID of the individual outlets."
-       
-   ::= { sPDUMasterConfig 2 }
-   
-sPDUMasterConfigPDUName  OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the PDU. The maximum value is 20 characters."
-   ::= { sPDUMasterConfig 3 }
-
-
-
--- the sPDUOutletControl group
-sPDUOutletControlTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of outlets for the PDU."
-   ::= { sPDUOutletControl 1 }
-
-   
-sPDUOutletControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletControlEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual outlet switches. The number of
-       entries is contained in the sPDUOutletControlTableSize OID."
-   ::= { sPDUOutletControl 2 }
-
-sPDUOutletControlEntry OBJECT-TYPE
-   SYNTAX OutletControlEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to control."
-   INDEX  { sPDUOutletControlIndex}
-   ::= { sPDUOutletControlTable 1 }
-
-OutletControlEntry ::=
-   SEQUENCE {
-      sPDUOutletControlIndex  INTEGER,
-      sPDUOutletPending       INTEGER,
-      sPDUOutletCtl           INTEGER,
-      sPDUOutletCtlName       DisplayString    
-   }      
-
-sPDUOutletControlIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletControlEntry 1 }
-   
-sPDUOutletPending OBJECT-TYPE
-   SYNTAX INTEGER{
-        commandPending        (1),
-        noCommandPending      (2),
-        commandPendingUnknown (3)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Reports whether the current outlet has a pending command.
-      
-       If the commandPendingUnknown (3) value is returned, all 
-       devices powered by the PDU should be shut down. The PDU's
-       power should then be cycled to clear this condition."
-       
-   ::= { sPDUOutletControlEntry 2 }
-   
-sPDUOutletCtl OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletOn              (1),
-        outletOff             (2),
-        outletReboot          (3),
-        outletUnknown         (4),
-        outletOnWithDelay     (5),
-        outletOffWithDelay    (6),
-        outletRebootWithDelay (7)
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the outletOn (1) value will be returned.
-       If the outlet is off, the outletOff (2) value will be
-       returned. 
-       
-       If the state of the outlet cannot be determined, the 
-       outletUnknown (4) value will be returned. If the 
-       outletUnknown condition should occur, all devices 
-       powered by the PDU should be shut down. The PDU's power 
-       should then be cycled to clear this condition.
-       
-       Setting this variable to outletOn (1) will turn the outlet on.
-       
-       Setting this variable to outletOff (2) will turn the outlet off. 
-
-       Setting this variable to outletReboot (3) will reboot the outlet.
-      
-       Setting this variable to outletOnWithDelay (5) will turn the outlet on
-       after the sPDUOutletPowerOnTime OID has elapsed. This option is not
-       valid for MasterSwitch firmware version 1.X.
-
-       Setting this variable to outletOffWithDelay (6) will turn the outlet off
-       after the sPDUOutletPowerOffTime OID has elapsed. This option is not valid
-       for MasterSwitch firmware version 1.X.
-
-       Setting this variable to outletRebootWithDelay (7) will turn the outlet off
-       after the sPDUOutletPowerOffTime OID has elapsed, wait the sPDUOutletRebootDuration
-       OID time, then turn the outlet back on.  
-       This option is not valid for MasterSwitch firmware version 1.X."
-
-   ::= { sPDUOutletControlEntry 3 }
-
-sPDUOutletCtlName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is 20 characters.
-       This OID is provided for informational purposes only.
-       This value is set by the sPDUOutletName OID."
-       
-   ::= { sPDUOutletControlEntry  4 }
-
--- the sPDUOutletConfig group
-sPDUOutletConfigTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of outlets for the PDU."
-   ::= { sPDUOutletConfig 1 }
-
-sPDUOutletConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF SPDUOutletConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The list of outlets to configure. The number of
-       entries is defined by the sPDUOutletConfigTableSize
-       OID."
-       
-   ::= { sPDUOutletConfig 2  }
-
-sPDUOutletConfigEntry OBJECT-TYPE
-   SYNTAX SPDUOutletConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to control."
-   INDEX  { sPDUOutletConfigIndex}
-   ::= { sPDUOutletConfigTable 1 }
-
-SPDUOutletConfigEntry ::=
-   SEQUENCE {
-      sPDUOutletConfigIndex    INTEGER,
-      sPDUOutletPowerOnTime    INTEGER,
-      sPDUOutletName           DisplayString,
-      sPDUOutletPowerOffTime   INTEGER,
-      sPDUOutletRebootDuration INTEGER
-   }      
-
-sPDUOutletConfigIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletConfigEntry 1 }
-   
-sPDUOutletPowerOnTime OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet will delay 
-       powering on when the MasterSwitch is powered on.
-              
-       Allowed values are:
-       
-       -1 never power on automatically.
-       0  power on with the Master Switch.
-       15 power on 15 seconds after the MasterSwitch has power applied.
-       30 power on 30 seconds after the MasterSwitch has power applied.
-       45 power on 45 seconds after the MasterSwitch has power applied.
-       60 power on 60 seconds (1 minute) after the MasterSwitch has power applied.
-       120 power on 120 seconds (2 minutes) after the MasterSwitch has power applied.
-       300 power on 300 seconds (5 minutes) after the MasterSwitch has power applied.
-       
-       If a value other than a supported value is provided in a 
-       set request, the PDU interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-
-   ::= { sPDUOutletConfigEntry 2 }
-   
-sPDUOutletName   OBJECT-TYPE
-   SYNTAX  DisplayString    ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is 20 characters."
-
-   ::= { sPDUOutletConfigEntry  3 }
-
-sPDUOutletPowerOffTime OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet will delay 
-       powering off.
-              
-       Allowed values are:
-       
-       -1 never power off automatically.
-       0  power off with the MasterSwitch.
-       15 power off 15 seconds after being commanded.
-       30 power off 30 seconds after being commanded.
-       45 power off 45 seconds after being commanded.
-       60 power off 60 seconds (1 minute) after being commanded.
-       120 power off 120 seconds (2 minutes) after being commanded.
-       300 power off 300 seconds (5 minutes) after being commanded.
-       
-       If a value other than a supported value is provided in a 
-       set request, the PDU interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used.
-       
-       This OID is not available for MasterSwitch firmware version 1.X."
-
-   ::= { sPDUOutletConfigEntry 4 }
-
-sPDUOutletRebootDuration OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "During a reboot sequence, power is turned off and then 
-       back on. This OID defines the amount of time to wait, 
-       in seconds, after turning the power off, at the start
-       of the sequence, before turning power back on, at the
-       end of the reboot sequence.       
-       
-       Allowed values are:
-       
-       5 wait 5 seconds between off/on.
-       10 wait 10 seconds between off/on.
-       15 wait 15 seconds between off/on.
-       20 wait 20 seconds between off/on.
-       30 wait 30 seconds between off/on.
-       45 wait 45 seconds between off/on.
-       60 wait 60 seconds (1 minute) between off/on.
-       
-       If a value other than a supported value is provided in a 
-       set request, the PDU interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used.
-
-       This OID is not available for MasterSwitch firmware version 1.X."
-       
-   ::= { sPDUOutletConfigEntry 5 }
-
-
--- the sPDUIdentVM group
-
-sPDUIdentVMTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch VMs controllable
-       by this IP address."
-   ::= { sPDUIdentVM 1 }
-
-   
-sPDUIdentVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IdentVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for query of the individual MasterSwitch VMs. 
-       The number of entries is contained in the 
-       sPDUIdentVMTableSize OID."
-   ::= { sPDUIdentVM 2 }
-
-sPDUIdentVMEntry OBJECT-TYPE
-   SYNTAX IdentVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch VMs to query."
-   INDEX  { sPDUIdentVMIndex}
-   ::= { sPDUIdentVMTable 1 }
-
-IdentVMEntry ::=
-   SEQUENCE {
-      sPDUIdentVMIndex                   INTEGER,
-      sPDUIdentNameVM                    DisplayString,
-      sPDUIdentHardwareRevVM             DisplayString,
-      sPDUIdentFirmwareRevVM             DisplayString,
-      sPDUIdentDateOfManufactureVM       DisplayString,
-      sPDUIdentModelNumberVM             DisplayString,
-      sPDUIdentSerialNumberVM            DisplayString
-   }      
-
-sPDUIdentVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM entry."
-   ::= { sPDUIdentVMEntry 1 }
-
-sPDUIdentNameVM OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 23-character string identifying the 
-       MasterSwitch VM. "
-   ::= { sPDUIdentVMEntry 2 }
-
-sPDUIdentHardwareRevVM OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware version of the MasterSwitch VM. 
-       This value is set at the factory."
-   ::= { sPDUIdentVMEntry 3 }
-
-sPDUIdentFirmwareRevVM OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An 6-character ID string identifying the MasterSwitch VM 
-       firmware version. This value is set at the factory." 
-   ::= {  sPDUIdentVMEntry 4 }
-
-
-sPDUIdentDateOfManufactureVM OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the MasterSwitch VM was manufactured in mm/dd/yyyy format.
-       This value is set at the factory. " 
-   ::= { sPDUIdentVMEntry 5 }
-   
-sPDUIdentModelNumberVM OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 17-character string identifying the model number of 
-       the MasterSwitch VM. This value is set at the factory."
-   ::= { sPDUIdentVMEntry 6 }
-
-sPDUIdentSerialNumberVM OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 17-character string identifying the serial number of 
-       the MasterSwitch VM. This value is set at the factory."
-   ::= { sPDUIdentVMEntry 7 }
-   
-
--- the sPDUMasterControlVM group
-
-sPDUMasterControlVMTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch VMs controllable
-       by this IP address."
-   ::= { sPDUMasterControlVM 1 }
-
-   
-sPDUMasterControlVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MasterControlVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of the individual MasterSwitch VMs.
-       The number of entries is contained in the 
-       sPDUMasterControlVMTableSize OID."
-   ::= { sPDUMasterControlVM 2 }
-
-sPDUMasterControlVMEntry OBJECT-TYPE
-   SYNTAX MasterControlVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch VMs to control."
-   INDEX  { sPDUMasterControlVMIndex}
-   ::= { sPDUMasterControlVMTable 1 }
-
-MasterControlVMEntry ::=
-   SEQUENCE {
-      sPDUMasterControlVMIndex           INTEGER,
-      sPDUMasterControlVMName            DisplayString,
-      sPDUMasterControlVMCommand         INTEGER
-   }      
-
-sPDUMasterControlVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM entry."
-   ::= { sPDUMasterControlVMEntry 1 }
-
-sPDUMasterControlVMName  OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch VM. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigVMName OID."
-   ::= { sPDUMasterControlVMEntry 2 }
-
-sPDUMasterControlVMCommand  OBJECT-TYPE
-  SYNTAX INTEGER       {
-      noCommandAllVM               (1),
-      immediateAllOnVM             (2),
-      immediateAllOffVM            (3),
-      immediateAllRebootVM         (4),
-      delayedAllOnVM               (5),
-      delayedAllOffVM              (6),
-      sequencedAllRebootVM         (7),
-      delayedAllRebootVM           (8),
-      delayedSequenceAllRebootVM   (9),
-      cancelAllPendingCommandsVM   (10),
-      audioAlarmMute               (11)
-   }
-   
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to immediateAllOnVM (2) will turn all outlets
-       on immediately.
-       
-       Setting this OID to immediateAllOffVM (3) will turn all outlets
-       off immediately.
-       
-       Setting this OID to immediateAllRebootVM (4) will reboot all outlets
-       immediately.
-
-       Setting this OID to delayedAllOnVM (5) will turn all outlets on as 
-       defined by each outlet's sPDUOutletConfigVMPowerOnTime OID value. 
-             
-       Setting this OID to delayedAllOffVM (6) will turn all outlets 
-       off as defined by each outlet's sPDUOutletConfigVMPowerOffTime OID value.
-      
-       Setting this OID to sequencedAllRebootVM (7) will cause a 
-       immediateAllOffVM command to be performed. The MasterSwitch VM will 
-       then delay the sPDUMasterStatusVMRebootDuration OID time, and then 
-       perform a delayedAllOnVM command.    
-
-       Setting this OID to delayedAllRebootVM (8) will cause a delayedAllOffVM
-       command to be performed. Each outlet will then wait its 
-       sPDUOutletConfigVMRebootDuration before returning power to the outlet.
-       
-       Setting this OID to delayedSequenceAllRebootVM (9) will cause a 
-       delayedAllOffVM command to be performed. Once all outlets are off, 
-       the MasterSwitch VM will then delay the sPDUMasterStatusVMRebootDuration 
-       OID time, and then perform a delayedAllOnVM command.    
-       
-       Setting this OID to cancelAllPendingCommandsVM (10) will cause all pending
-       commands on the MasterSwitch VM to be canceled.
-       
-
-       Setting this OID to audioAlarmMute (11) will temporarily silence the audible
-       alarm for the duration of the current overload condition. The audible alarm
-       will be activated on subsequent overload alarms.
-
-       Getting this OID will return the noCommandAllVM (1) value."
-   ::= { sPDUMasterControlVMEntry 3 }
-
-
--- the sPDUMasterConfigVM group
-
-sPDUMasterConfigVMTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch VMs configurable
-       by this IP address."
-   ::= { sPDUMasterConfigVM 1 }
-
-   
-sPDUMasterConfigVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MasterConfigVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of the individual MasterSwitch VMs.
-       The number of entries is contained in the 
-       sPDUMasterConfigVMTableSize OID."
-   ::= { sPDUMasterConfigVM 2 }
-
-sPDUMasterConfigVMEntry OBJECT-TYPE
-   SYNTAX MasterConfigVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch VMs to configure."
-   INDEX  { sPDUMasterConfigVMIndex}
-   ::= { sPDUMasterConfigVMTable 1 }
-
-MasterConfigVMEntry ::=
-   SEQUENCE {
-      sPDUMasterConfigVMIndex                     INTEGER,
-      sPDUMasterConfigVMName                      DisplayString,
-      sPDUMasterConfigVMColdstartDelay            INTEGER,
-      sPDUMasterConfigVMAudioAlarmActivated       INTEGER,
-      sPDUMasterConfigVMHighLoadWarningThreshold  INTEGER,
-      sPDUMasterConfigVMLowLoadWarningThreshold   INTEGER,
-      sPDUMasterConfigVMOverloadRestriction       INTEGER
-   }      
-   
-sPDUMasterConfigVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM entry."
-   ::= { sPDUMasterConfigVMEntry 1 }
-
-
-sPDUMasterConfigVMName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch VM. Maximum size is 23 characters."
-   ::= { sPDUMasterConfigVMEntry 2 }
-
-sPDUMasterConfigVMColdstartDelay  OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in seconds, between when
-        power is provided to the MasterSwitch VM and 
-        when the MasterSwitch VM provides basic master 
-        power to the outlets.       
-       
-       Allowed values are:
-
-       -1 never apply power automatically.
-       0 apply power immediately.
-       15 apply power in 15 seconds.
-       30 apply power in 30 seconds.
-       45 apply power in 45 seconds.
-       60 apply power in 60 seconds  (1 minute).
-       120 apply power in 120 seconds (2 minutes).
-       300 apply power in 300 seconds (5 minutes).
-       
-       If a value other than a supported value is provided in a 
-       set request, the MasterSwitch VM interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { sPDUMasterConfigVMEntry 3 }
-
-sPDUMasterConfigVMAudioAlarmActivated  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      audioAlarmActiveNever               (1),
-      audioAlarmActiveOnOverload          (2),
-      audioAlarmActiveOnOverloadImminent  (3)
-   }
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to audioAlarmActiveNever (1) will disable
-       the audio alarm on the MasterSwitch VM.
-       
-       Setting this OID to audioAlarmActiveOnOverload (2) will 
-       activate the audio alarm on the MasterSwitch VM when an
-       overload condition is present.       
-
-       Setting this OID to audioAlarmActiveOnOverloadImminent (3) 
-       will activate the audio alarm on the MasterSwitch VM when
-       the load on the MasterSwitch VM has surpassed the
-       sPDUMasterConfigVMHighLoadWarningThreshold OID value."
-   ::= { sPDUMasterConfigVMEntry 4 }
-   
-sPDUMasterConfigVMHighLoadWarningThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load is nearing an overload condition. It is 
-       represented as a percentage of full load."
-   ::= { sPDUMasterConfigVMEntry 5 }
-
-sPDUMasterConfigVMLowLoadWarningThreshold OBJECT-TYPE
-   SYNTAX INTEGER (0..100)               
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load is nearing a low consumption condition. It is 
-       represented as a percentage of full load."
-   ::= { sPDUMasterConfigVMEntry 6 }
-
-sPDUMasterConfigVMOverloadRestriction OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alwaysAllowTurnON         (1),
-      restrictOnWarning         (2),
-      restrictOnOverload        (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID controls the behavior of the MasterSwitch VM
-       when an overload condition is possible and additional 
-       outlets are requested to be turned on. 
-
-       Setting this OID to alwaysAllowTurnON (1) will always allow 
-       the outlets to turn on.
-       
-       Setting this OID to restrictOnWarning (2) will not allow 
-       outlets to turn on if the sPDUMasterConfigVMHighLoadWarningThreshold
-       OID is exceeded.
-              
-       Setting this OID to restrictOnOverload (3) will not allow
-       outlets to turn on if the MasterSwitch Vm is in an 
-       overload condition."
-   ::= { sPDUMasterConfigVMEntry 7 }
-
--- the sPDUMasterStatusVM group
-
-sPDUMasterStatusVMTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch VMs at
-       this IP address."
-   ::= { sPDUMasterStatusVM 1 }
-
-   
-sPDUMasterStatusVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MasterStatusVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for gathering of status from the individual 
-       MasterSwitch VMs. The number of entries is contained 
-       in the sPDUMasterStatusVMTableSize OID."
-   ::= { sPDUMasterStatusVM 2 }
-
-sPDUMasterStatusVMEntry OBJECT-TYPE
-   SYNTAX MasterStatusVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch VMs to gather status from."
-   INDEX  { sPDUMasterStatusVMIndex}
-   ::= { sPDUMasterStatusVMTable 1 }
-
-MasterStatusVMEntry ::=
-   SEQUENCE {
-      sPDUMasterStatusVMIndex                     INTEGER,
-      sPDUMasterStatusVMName                      DisplayString,
-      sPDUMasterStatusVMCommandPending            INTEGER,
-      sPDUMasterStatusVMOverloadCondition         INTEGER,
-      sPDUMasterStatusVMLowLoadCondition          INTEGER,
-      sPDUMasterStatusVMCurrentLoad               INTEGER,
-      sPDUMasterStatusVMMaxLoad                   INTEGER,
-      sPDUMasterStatusVMOutletCount               INTEGER,
-      sPDUMasterStatusVMRebootDuration            INTEGER
-   }      
-   
-sPDUMasterStatusVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM entry."
-   ::= { sPDUMasterStatusVMEntry 1 }
-
-sPDUMasterStatusVMName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch VM. Maximum size is 23 characters."
-   ::= { sPDUMasterStatusVMEntry 2 }
-
-sPDUMasterStatusVMCommandPending OBJECT-TYPE
-   SYNTAX INTEGER       {
-      commandPendingMasterTrueVM      (1),
-      commandPendingMasterFalseVM     (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return commandPendingMasterTrueVM (1)
-       if the MasterSwitch VM has a pending command on any of its
-       outlets.
-
-       commandPendingMasterFalseVM (2) will be returned if there are
-       no pending commands." 
-   ::= { sPDUMasterStatusVMEntry 3 }
-
-sPDUMasterStatusVMOverloadCondition OBJECT-TYPE
-   SYNTAX INTEGER       {
-      overloadConditionTrueVM         (1),
-      overloadConditionFalseVM        (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return overloadConditionTrueVM (1)
-       if the sPDUMasterConfigVMHighLoadWarningThreshold OID is
-       violated.
-
-       overloadConditionFalseVM (2) will be returned if the 
-       sPDUMasterConfigVMHighLoadWarningThreshold OID is not
-       violated."
-   ::= { sPDUMasterStatusVMEntry 4 }
-
-sPDUMasterStatusVMLowLoadCondition OBJECT-TYPE
-   SYNTAX INTEGER       {
-      lowLoadConditionTrueVM            (1),
-      lowLoadConditionFalseVM           (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return lowLoadConditionTrueVM (1)
-       if the sPDUMasterConfigVMLowLoadWarningThreshold OID is
-       violated.
-
-       lowLoadConditionFalseVM (2) will be returned if the 
-       sPDUMasterConfigVMHighLoadWarningThreshold OID is not
-       violated. "
-   ::= { sPDUMasterStatusVMEntry 5 }
-
-sPDUMasterStatusVMCurrentLoad   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the total amount of power
-       being consumed by the load. It is represented as a 
-       percentage of full load."
-   ::= { sPDUMasterStatusVMEntry 6 }
-
-sPDUMasterStatusVMMaxLoad   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the total amount of power
-       that this MasterSwitch VM can provide. It is represented
-       in Amps."  
-   ::= { sPDUMasterStatusVMEntry 7 }
-
-sPDUMasterStatusVMOutletCount   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the number of controllable
-       outlets for this MasterSwitch VM."
-   ::= { sPDUMasterStatusVMEntry 8 }
-
-sPDUMasterStatusVMRebootDuration   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the largest
-       sPDUOutletConfigVMRebootDuration OID time 
-       for this MasterSwitch VM."
-   ::= { sPDUMasterStatusVMEntry 9 }
-
--- the sPDUOutletControlVM group
-
-   
-sPDUOutletControlVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletControlVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual outlet switches. The number of
-       entries is contained in the sPDUMasterStatusOutletCount OID."
-   ::= { sPDUOutletControlVM 1 }
-
-sPDUOutletControlVMEntry OBJECT-TYPE
-   SYNTAX OutletControlVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to control."
-   INDEX  { sPDUOutletControlVMIndex, sPDUOutletControlVMOutletIndex }
-   ::= { sPDUOutletControlVMTable 1 }
-
-OutletControlVMEntry ::=
-   SEQUENCE {
-      sPDUOutletControlVMIndex         INTEGER,
-      sPDUOutletControlVMName          DisplayString,   
-      sPDUOutletControlVMOutletIndex   INTEGER,
-      sPDUOutletControlVMOutletName    DisplayString,
-      sPDUOutletControlVMOutletCommand INTEGER
-   }      
-
-sPDUOutletControlVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM."
-   ::= { sPDUOutletControlVMEntry 1 }
-
-sPDUOutletControlVMName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch VM. Maximum size is 23 characters.
-       This OID is provided for informational purposes only."
-   ::= { sPDUOutletControlVMEntry 2 }
-
-sPDUOutletControlVMOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletControlVMEntry 3 }
-   
-sPDUOutletControlVMOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is 23 characters.
-       This OID is provided for informational purposes only."
-   ::= { sPDUOutletControlVMEntry 4 }
-
-sPDUOutletControlVMOutletCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      immediateOnVM             (1),
-      immediateOffVM            (2),
-      immediateRebootVM         (3),
-      delayedOnVM               (4),
-      delayedOffVM              (5),
-      delayedRebootVM           (6),
-      cancelPendingCommandVM    (7)
-
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the immediateOnVM (1) value will be returned.
-       If the outlet is off, the immediateOffVM (2) value will be
-       returned. 
-       
-       
-       Setting this variable to immediateOnVM (1) will immediately turn the outlet on.
-       
-       Setting this variable to immediateOffVM (2) will immediately turn the outlet off. 
-
-       Setting this variable to immediateRebootVM (3) will immediately reboot the outlet.
-      
-       Setting this variable to delayedOnVM (4) will turn the outlet on
-       after the sPDUOutletConfigVMPowerOnTime OID time has elapsed.   
-
-       Setting this variable to delayedOffVM (5) will turn the outlet off
-       after the sPDUOutletConfigVMPowerOffTime OID time has elapsed.
-
-       Setting this variable to delayedRebootVM  (6) will cause the 
-       MasterSwitch VM to perform a delayedOffVM command, wait the 
-       sPDUOutletConfigVMRebootDuration OID time, and then perform the
-       immediateOnVM command.
-       
-       Setting this variable to cancelPendingCommandVM (7) will cause any
-       pending command to this outlet to be canceled."
-   ::= { sPDUOutletControlVMEntry 5 }
-
--- the sPDUOutletConfigVM group
-  
-sPDUOutletConfigVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletConfigVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusOutletCount OID."
-   ::= { sPDUOutletConfigVM 1 }
-
-sPDUOutletConfigVMEntry OBJECT-TYPE
-   SYNTAX OutletConfigVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to configure."
-   INDEX  { sPDUOutletConfigVMIndex, sPDUOutletConfigVMOutletIndex }
-   ::= { sPDUOutletConfigVMTable 1 }
-
-OutletConfigVMEntry ::=
-   SEQUENCE {
-      sPDUOutletConfigVMIndex          INTEGER,
-      sPDUOutletConfigVMName           DisplayString,   
-      sPDUOutletConfigVMOutletIndex    INTEGER,
-      sPDUOutletConfigVMOutletName     DisplayString,
-      sPDUOutletConfigVMPowerOnTime    INTEGER,
-      sPDUOutletConfigVMPowerOffTime   INTEGER,
-      sPDUOutletConfigVMRebootDuration INTEGER
-   }      
-
-sPDUOutletConfigVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM."
-   ::= { sPDUOutletConfigVMEntry 1 }
-
-sPDUOutletConfigVMName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch VM. Maximum size is 23 characters."
-   ::= { sPDUOutletConfigVMEntry 2 }
-
-sPDUOutletConfigVMOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletConfigVMEntry 3 }
-   
-
-sPDUOutletConfigVMOutletName   OBJECT-TYPE
-   SYNTAX  DisplayString    ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is 23 characters."
-   ::= { sPDUOutletConfigVMEntry 4 }
-
-sPDUOutletConfigVMPowerOnTime OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet will delay 
-       powering on at coldstart or when a command that requires 
-       a turn-on delay is issued.
-              
-       Allowed values are:
-       
-       -1 never power on.
-       0  power on immediately.
-       15 power on 15 seconds after being commanded.
-       30 power on 30 seconds after being commanded.
-       45 power on 45 seconds after being commanded.
-       60 power on 60 seconds (1 minute) after being commanded.
-       120 power on 120 seconds (2 minutes) after being commanded.
-       300 power on 300 seconds (5 minutes) after being commanded.
-       
-       If a value other than a supported value is provided in a 
-       set request, the MasterSwitch VM interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { sPDUOutletConfigVMEntry 5 }
-   
-
-sPDUOutletConfigVMPowerOffTime OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet will delay 
-       powering off when a command that requires 
-       a turn-off delay is issued.
-
-              
-       Allowed values are:
-       
-       -1 never power off automatically.
-       0  power off immediately.
-       15 power off 15 seconds after being commanded.
-       30 power off 30 seconds after being commanded.
-       45 power off 45 seconds after being commanded.
-       60 power off 60 seconds (1 minute) after being commanded.
-       120 power off 120 seconds (2 minutes) after being commanded.
-       300 power off 300 seconds (5 minutes) after being commanded.
-       
-       If a value other than a supported value is provided in a 
-       set request, the MasterSwitch VM interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { sPDUOutletConfigVMEntry 6 }
-
-sPDUOutletConfigVMRebootDuration OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "During a reboot sequence, power is turned off and then 
-       back on. This OID defines the amount of time to wait, 
-       in seconds, after turning the power off, at the start
-       of the sequence, before turning power back on, at the
-       end of the reboot sequence.       
-       
-       Allowed values are:
-       
-       5 wait 5 seconds between off/on.
-       10 wait 10 seconds between off/on.
-       15 wait 15 seconds between off/on.
-       20 wait 20 seconds between off/on.
-       30 wait 30 seconds between off/on.
-       45 wait 45 seconds between off/on.
-       60 wait 60 seconds (1 minute) between off/on.
-       
-       If a value other than a supported value is provided in a 
-       set request, the MasterSwitch VM interprets it as the next lower
-       acceptable value.  If the provided value is lower than
-       the lowest acceptable value, the lowest acceptable 
-       value is used."
-   ::= { sPDUOutletConfigVMEntry 7 }
-
--- the sPDUOutletStatusVM group
-  
-sPDUOutletStatusVMTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletStatusVMEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting of status of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusOutletCount OID."
-   ::= { sPDUOutletStatusVM 1 }
-
-sPDUOutletStatusVMEntry OBJECT-TYPE
-   SYNTAX OutletStatusVMEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to gather status from."
-   INDEX  { sPDUOutletStatusVMIndex, sPDUOutletStatusVMOutletIndex }
-   ::= { sPDUOutletStatusVMTable 1 }
-
-OutletStatusVMEntry ::=
-   SEQUENCE {
-      sPDUOutletStatusVMIndex          INTEGER,
-      sPDUOutletStatusVMName           DisplayString,   
-      sPDUOutletStatusVMOutletIndex    INTEGER,
-      sPDUOutletStatusVMOutletName     DisplayString,
-      sPDUOutletStatusVMOutletState    INTEGER,
-      sPDUOutletStatusVMCommandPending INTEGER
-   }      
-
-sPDUOutletStatusVMIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch VM."
-   ::= { sPDUOutletStatusVMEntry 1 }
-
-sPDUOutletStatusVMName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch VM. Maximum size is 23 characters."
-   ::= { sPDUOutletStatusVMEntry 2 }
-
-sPDUOutletStatusVMOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletStatusVMEntry 3 }
-   
-sPDUOutletStatusVMOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is 23 characters."
-   ::= { sPDUOutletStatusVMEntry 4 }
-
-sPDUOutletStatusVMOutletState OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletStatusVMOn              (1),
-        outletStatusVMOff             (2)
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the outletStatusOnVM (1) value will be returned.
-       If the outlet is off, the outletStatusOffVM (2) value will be
-       returned. "
-   ::= { sPDUOutletStatusVMEntry 5 }
-
-sPDUOutletStatusVMCommandPending    OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletStatusVMCommandPending    (1),
-        outletStatusVMNoCommandPending  (2)
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the command pending
-        state of the outlet. If a command is pending on the 
-        outlet, the outletStatusVMCommandPending (1) value
-        will be returned. If there is not a command pending
-        on the outlet, the outletStatusVMNoCommandPending (2)
-        will be returned."
-   ::= { sPDUOutletStatusVMEntry 6 }
-
--- the sPDUIdentMSP group
-
-sPDUIdentMSPTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch pluses controllable
-       by this IP address."
-   ::= { sPDUIdentMSP 1 }
-
-   
-sPDUIdentMSPTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IdentMSPEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for query of the individual MasterSwitch pluses. 
-       The number of entries is contained in the 
-       sPDUIdentMSPTableSize OID."
-   ::= { sPDUIdentMSP 2 }
-
-sPDUIdentMSPEntry OBJECT-TYPE
-   SYNTAX IdentMSPEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch pluses to query."
-   INDEX  { sPDUIdentMSPIndex}
-   ::= { sPDUIdentMSPTable 1 }
-
-IdentMSPEntry ::=
-   SEQUENCE {
-      sPDUIdentMSPIndex                   INTEGER,
-      sPDUIdentNameMSP                   DisplayString,
-      sPDUIdentHardwareRevMSP            DisplayString,
-      sPDUIdentFirmwareRevMSP            DisplayString,
-      sPDUIdentDateOfManufactureMSP      DisplayString,
-      sPDUIdentModelNumberMSP            DisplayString,
-      sPDUIdentSerialNumberMSP           DisplayString
-   }      
-
-sPDUIdentMSPIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus entry."
-   ::= { sPDUIdentMSPEntry 1 }
-
-sPDUIdentNameMSP OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUIdentMSPEntry 2 }
-
-sPDUIdentHardwareRevMSP OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware version of the MasterSwitch plus. 
-       This value is set at the factory."
-   ::= { sPDUIdentMSPEntry 3 }
-
-sPDUIdentFirmwareRevMSP OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An 6-character ID string identifying the MasterSwitch plus 
-       firmware version. This value is set at the factory." 
-   ::= {  sPDUIdentMSPEntry 4 }
-
-sPDUIdentDateOfManufactureMSP OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the MasterSwitch plus was manufactured in mm/dd/yyyy format.
-       This value is set at the factory. " 
-   ::= { sPDUIdentMSPEntry 5 }
-   
-sPDUIdentModelNumberMSP OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 17-character string identifying the model number of 
-       the MasterSwitch plus. This value is set at the factory."
-   ::= { sPDUIdentMSPEntry 6 }
-
-sPDUIdentSerialNumberMSP OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 17-character string identifying the serial number of 
-       the MasterSwitch plus. This value is set at the factory."
-   ::= { sPDUIdentMSPEntry 7 }
-   
-
--- the sPDUMasterControlMSP group
-
-sPDUMasterControlMSPTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch pluses controllable
-       by this IP address."
-   ::= { sPDUMasterControlMSP 1 }
-
-sPDUMasterControlMSPTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MasterControlMSPEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of the individual MasterSwitch pluses.
-       The number of entries is contained in the 
-       sPDUMasterControlMSPTableSize OID."
-   ::= { sPDUMasterControlMSP 2 }
-
-sPDUMasterControlMSPEntry OBJECT-TYPE
-   SYNTAX MasterControlMSPEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch pluses to control."
-   INDEX  { sPDUMasterControlMSPIndex}
-   ::= { sPDUMasterControlMSPTable 1 }
-
-MasterControlMSPEntry ::=
-   SEQUENCE {
-      sPDUMasterControlMSPIndex           INTEGER,
-      sPDUMasterControlMSPName            DisplayString,
-      sPDUMasterControlMSPCommand         INTEGER
-   }      
-
-sPDUMasterControlMSPIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus entry."
-   ::= { sPDUMasterControlMSPEntry 1 }
-
-sPDUMasterControlMSPName  OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUMasterControlMSPEntry 2 }
-
-sPDUMasterControlMSPCommand  OBJECT-TYPE
-  SYNTAX INTEGER       {
-      noCommandAllMSP              (1),
-      immediateAllOnMSP            (2),
-      sequencedAllOnMSP            (3),
-      immediateAllOffMSP           (4),
-      gracefulAllRebootMSP         (5),
-      immediateAllRebootMSP        (6),
-      gracefulAllShutdownMSP       (7),
-      overrideAllBatCapThreshMSP   (8),
-      cancelAllPendingCommandsMSP  (9),
-      restoreFactoryDefaultsMSP   (10)
-   }
-   
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to immediateAllOnMSP (2) will turn all outlets
-       on immediately.
-       
-       Setting this OID to sequencedAllOnMSP (3) will turn all outlets
-       on as defined by each outlet's sPDUOutletConfigMSPPowerOnDelay OID value.
-
-       Setting this OID to immediateAllOffMSP (4) will turn all outlets
-       off immediately.
-       
-       Setting this OID to gracefulAllRebootMSP (5) will reboot all outlets
-       (after the device running PowerChute confirms shutdown) as defined 
-       by each outlet's sPDUOutletConfigMSPRebootDuration OID time value.
-
-       Setting this OID to immediateAllRebootMSP (6) will reboot all outlets
-       immediately.
-
-       Setting this OID to gracefulAllShutdownMSP (7) will shutdown all outlets
-       (after the device running PowerChute confirms shutdown) as defined 
-       by each outlet's sPDUOutletConfigMSPPowerOffDelay OID time value.  Each 
-       outlet will then turn on after the sum of its 
-       sPDUOutletConfigMSPRestartDelay and sPDUOutletConfigMSPPowerOnDelay OID 
-       values.
-
-       Setting this OID to overrideAllBatCapThreshMSP (8) will cause the 
-       outlet to ignore the Battery Capacity Threshold and proceed turning on
-       the outlets as defined by each outlet's sPDUOutletConfigMSPPowerOnDelay 
-       OID value.
-                    
-       Setting this OID to cancelAllPendingCommandsMSP (9) will cause all pending
-       commands on the MasterSwitch plus to be canceled.
-
-       Setting this OID to restoreFactoryDefaultsMSP (10) will cause the settings of
-       the MasterSwitch plus to be restored to the factory defaults.
-
-       Getting this OID will return the noCommandAllMSP (1) value."
-   ::= { sPDUMasterControlMSPEntry 3 }
-
-
--- the sPDUMasterConfigMSP group
-
-sPDUMasterConfigMSPTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch pluses configurable
-       by this IP address."
-   ::= { sPDUMasterConfigMSP 1 }
-   
-sPDUMasterConfigMSPTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MasterConfigMSPEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of the individual MasterSwitch pluses.
-       The number of entries is contained in the 
-       sPDUMasterConfigMSPTableSize OID."
-   ::= { sPDUMasterConfigMSP 2 }
-
-sPDUMasterConfigMSPEntry OBJECT-TYPE
-   SYNTAX MasterConfigMSPEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch pluses to configure."
-   INDEX  { sPDUMasterConfigMSPIndex}
-   ::= { sPDUMasterConfigMSPTable 1 }
-
-MasterConfigMSPEntry ::=
-   SEQUENCE {
-      sPDUMasterConfigMSPIndex                     INTEGER,
-      sPDUMasterConfigMSPName                      DisplayString,
-      sPDUMasterConfigMSPPowerOnTimeDelay          INTEGER,
-      sPDUMasterConfigMSPManualButton              INTEGER
-   }      
-   
-sPDUMasterConfigMSPIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus entry."
-   ::= { sPDUMasterConfigMSPEntry 1 }
-
-sPDUMasterConfigMSPName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. Maximum size is 23 characters."
-   ::= { sPDUMasterConfigMSPEntry 2 }
-
-sPDUMasterConfigMSPPowerOnTimeDelay  OBJECT-TYPE
-   SYNTAX INTEGER (0..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in seconds, between when
-        power is provided to the MasterSwitch plus and 
-        when the MasterSwitch plus provides basic master 
-        power to the outlets.       
-       
-       Allowed values are:
-
-       0 - 9999 seconds (0 - 2hrs, 46 mins, 39 secs).
-       0 indicates to apply power immediately."
-   ::= { sPDUMasterConfigMSPEntry 3 }
-   
-
-sPDUMasterConfigMSPManualButton  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      manualButtonDisabled              (1),
-      manualButtonEnabled               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to manualButtonDisabled (1) will disable
-       the manual button on the MasterSwitch plus.
-
-       Setting this OID to manualButtonEnabled (2) will enable
-       the manual button on the MasterSwitch plus."
-   ::= { sPDUMasterConfigMSPEntry 4 }
-   
--- the sPDUMasterStatusMSP group
-
-sPDUMasterStatusMSPTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of MasterSwitch pluses at
-       this IP address."
-   ::= { sPDUMasterStatusMSP 1 }
-
-   
-sPDUMasterStatusMSPTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF MasterStatusMSPEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for gathering of status from the individual 
-       MasterSwitch pluses. The number of entries is contained 
-       in the sPDUMasterStatusMSPTableSize OID."
-   ::= { sPDUMasterStatusMSP 2 }
-
-sPDUMasterStatusMSPEntry OBJECT-TYPE
-   SYNTAX MasterStatusMSPEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The MasterSwitch pluses to gather status from."
-   INDEX  { sPDUMasterStatusMSPIndex}
-   ::= { sPDUMasterStatusMSPTable 1 }
-
-MasterStatusMSPEntry ::=
-   SEQUENCE {
-      sPDUMasterStatusMSPIndex                     INTEGER,
-      sPDUMasterStatusMSPName                      DisplayString,
-      sPDUMasterStatusMSPOutletCount               INTEGER
-   }      
-   
-sPDUMasterStatusMSPIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus entry."
-   ::= { sPDUMasterStatusMSPEntry 1 }
-
-sPDUMasterStatusMSPName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUMasterStatusMSPEntry 2 }
-
-sPDUMasterStatusMSPOutletCount   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the number of controllable
-       outlets for this MasterSwitch plus."
-   ::= { sPDUMasterStatusMSPEntry 3 }
-
--- the sPDUOutletControlMSP group
-   
-sPDUOutletControlMSPTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletControlMSPEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual outlet switches. The number of
-       entries is contained in the sPDUMasterStatusMSPOutletCount OID."
-   ::= { sPDUOutletControlMSP 1 }
-
-sPDUOutletControlMSPEntry OBJECT-TYPE
-   SYNTAX OutletControlMSPEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to control."
-   INDEX  { sPDUOutletControlMSPIndex, sPDUOutletControlMSPOutletIndex }
-   ::= { sPDUOutletControlMSPTable 1 }
-
-OutletControlMSPEntry ::=
-   SEQUENCE {
-      sPDUOutletControlMSPIndex         INTEGER,
-      sPDUOutletControlMSPName          DisplayString,   
-      sPDUOutletControlMSPOutletIndex   INTEGER,
-      sPDUOutletControlMSPOutletName    DisplayString,
-      sPDUOutletControlMSPOutletCommand INTEGER
-   }      
-
-sPDUOutletControlMSPIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus."
-   ::= { sPDUOutletControlMSPEntry 1 }
-
-sPDUOutletControlMSPName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUOutletControlMSPEntry 2 }
-
-sPDUOutletControlMSPOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletControlMSPEntry 3 }
-   
-sPDUOutletControlMSPOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. The maximum size is 
-       23 characters. The name is set by using the 
-       sPDUOutletConfigMSPallOutletName OID.
-       This OID is provided for informational purposes only."       
-   ::= { sPDUOutletControlMSPEntry 4 }
-
-sPDUOutletControlMSPOutletCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      immediateOnMSP            (1),
-      delayedOnMSP              (2),
-      immediateOffMSP           (3),
-      gracefulRebootMSP         (4),
-      immediateRebootMSP        (5),
-      gracefulshutdownMSP       (6),
-      overrideBatCapThreshMSP   (7),
-      cancelPendingCommandMSP   (8)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the immediateOnMSP (1) value will be returned.
-       If the outlet is off, the immediateOffMSP (3) value will be
-       returned.  
-       
-       Setting this variable to immediateOnMSP (1) will immediately turn the outlet on.
-       
-       Setting this variable to delayedOnMSP (2) will turn the outlet on
-       after the sPDUOutletConfigMSPPowerOnDelay OID time has elapsed. 
-
-       Setting this variable to immediateOffMSP (3) will immediately turn the outlet off. 
-
-       Setting this variable to gracefulRebootMSP (4) will cause the outlet to wait for
-       device confirmation (if applicable) and then turn the outlet off after the
-       sPDUOutletConfigMSPPowerOffDelay OID time has elapsed.  The outlet will then turn
-       on after the sPDUOutletConfigMSPRebootDuration OID time has elapsed. 
-
-       Setting this variable to immediateRebootMSP (5) will immediately reboot the outlet.
-
-       Setting this variable to gracefulshutdownMSP (6) will cause the outlet to wait for
-       device confirmation (if applicable) and then turn the outlet off after the
-       sPDUOutletConfigMSPPowerOffDelay OID time has elapsed.  The outlet will then turn
-       on after the sum of the sPDUOutletConfigMSPRestartTime OID time and the 
-       sPDUOutletConfigMSPPowerOnDelay OID time has elapsed. 
-      
-       Setting this variable to overrideBatCapThreshMSP (7) will cause the outlet to 
-       ignore the Battery Capacity Threshold and proceed waiting on the
-       sPDUOutletConfigMSPPowerOnDelay OID time before turning the outlet on.
-           
-       Setting this variable to cancelPendingCommandMSP (8) will cause any
-       pending command to this outlet to be canceled."
-   ::= { sPDUOutletControlMSPEntry 5 }
-
--- the sPDUOutletConfigMSPall group
-  
-sPDUOutletConfigMSPallTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletConfigMSPallEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusMSPOutletCount OID."
-   ::= { sPDUOutletConfigMSPall 1 }
-
-sPDUOutletConfigMSPallEntry OBJECT-TYPE
-   SYNTAX OutletConfigMSPallEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to configure."
-   INDEX  { sPDUOutletConfigMSPallIndex, sPDUOutletConfigMSPallOutletIndex }
-   ::= { sPDUOutletConfigMSPallTable 1 }
-
-OutletConfigMSPallEntry ::=
-   SEQUENCE {
-      sPDUOutletConfigMSPallIndex          INTEGER,
-      sPDUOutletConfigMSPallName           DisplayString,   
-      sPDUOutletConfigMSPallOutletIndex    INTEGER,
-      sPDUOutletConfigMSPallOutletName     DisplayString,
-      sPDUOutletConfigMSPallOutletCtrlMode INTEGER
-   }      
-
-sPDUOutletConfigMSPallIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus."
-   ::= { sPDUOutletConfigMSPallEntry 1 }
-
-sPDUOutletConfigMSPallName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUOutletConfigMSPallEntry 2 }
-
-sPDUOutletConfigMSPallOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletConfigMSPallEntry 3 }
-   
-sPDUOutletConfigMSPallOutletName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is 23 characters."
-   ::= { sPDUOutletConfigMSPallEntry 4 }
-
-sPDUOutletConfigMSPallOutletCtrlMode  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      modeGracefulShutdown              (1),
-      modeAnnunciator                   (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to modeGracefulShutdown (1) will put this
-       outlet into the Graceful Shutdown control mode.
-
-       Setting this OID to modeAnnunciator (2) will put this outlet
-       into the Annunciator control mode."
-   ::= { sPDUOutletConfigMSPallEntry 5 }
-
-
--- the sPDUOutConfigMSPgs group
-
-sPDUOutletConfigMSPgsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletConfigMSPgsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusMSPOutletCount OID."
-   ::= { sPDUOutletConfigMSPgs 1 }
-
-sPDUOutletConfigMSPgsEntry OBJECT-TYPE
-   SYNTAX OutletConfigMSPgsEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to configure."
-   INDEX  { sPDUOutletConfigMSPgsIndex, sPDUOutletConfigMSPgsOutletIndex }
-   ::= { sPDUOutletConfigMSPgsTable 1 }
-
-OutletConfigMSPgsEntry ::=
-   SEQUENCE {
-      sPDUOutletConfigMSPgsIndex          INTEGER,
-      sPDUOutletConfigMSPgsName           DisplayString,   
-      sPDUOutletConfigMSPgsOutletIndex    INTEGER,
-      sPDUOutletConfigMSPgsOutletName     DisplayString,
-      sPDUOutletConfigMSPgsOutletCtrlMode INTEGER,
-      sPDUOutletConfigMSPgsDeviceConfirm  INTEGER,
-      sPDUOutletConfigMSPgsLowBattWarning INTEGER,
-      sPDUOutletConfigMSPgsLowBattMult    INTEGER,
-      sPDUOutletConfigMSPgsRestartDelay   INTEGER,
-      sPDUOutletConfigMSPgsPowerOnDelay   INTEGER,
-      sPDUOutletConfigMSPgsPowerOffDelay  INTEGER,
-      sPDUOutletConfigMSPgsBattCapThresh  INTEGER,
-      sPDUOutletConfigMSPgsRebootDuration INTEGER
-   }      
-
-sPDUOutletConfigMSPgsIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus."
-   ::= { sPDUOutletConfigMSPgsEntry 1 }
-
-sPDUOutletConfigMSPgsName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUOutletConfigMSPgsEntry 2 }
-
-sPDUOutletConfigMSPgsOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletConfigMSPgsEntry 3 }
-
-sPDUOutletConfigMSPgsOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. The maximum size is 
-       23 characters. The name is set by using the 
-       sPDUOutletConfigMSPallOutletName OID.
-       This OID is provided for informational purposes only."       
-   ::= { sPDUOutletConfigMSPgsEntry 4 }
-
-sPDUOutletConfigMSPgsOutletCtrlMode  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      modeGracefulShutdown              (1),
-      modeAnnunciator                   (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Control Mode of the outlet.
-       This OID is provided for informational purposes only."
-   ::= { sPDUOutletConfigMSPgsEntry 5 }
-
-sPDUOutletConfigMSPgsDeviceConfirm  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      deviceConfirmNo               (1),
-      deviceConfirmYes              (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to deviceConfirmNo (1) cause the outlet to
-       NOT wait for device confirmation while performing graceful
-       operations.
-
-       Setting this OID to deviceConfirmYes (2) cause the outlet to
-       wait for device confirmation while performing graceful
-       operations."
-   ::= { sPDUOutletConfigMSPgsEntry 6 }
-
-sPDUOutletConfigMSPgsLowBattWarning  OBJECT-TYPE
-   SYNTAX INTEGER (-2..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in 6 second intervals, between 
-        when the UPS goes on battery and the power down sequence for
-        the outlet is initiated.     
-       
-       Allowed values are:
-
-       -2 - Never initiate the power down sequence on low battery warning.
-       -1 - Initiate power down sequence based on remaining runtime.
-       1 - 9999 six second intervals (6 secs - 16hrs, 39 mins, 54 secs).
-       0 indicates to immediately initiate power down sequence on low 
-         battery warning."
-   ::= { sPDUOutletConfigMSPgsEntry 7 }
-   
-sPDUOutletConfigMSPgsLowBattMult  OBJECT-TYPE
-   SYNTAX INTEGER     (1..7)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-     " Only applicable if sPDUOutletConfigMSPgsLowBattWarning OID is 
-       set to -1 (On Runtime Remaining).
-        
-       Allows you to set the value to stagger the shutdown sequence of the outlets.
-       1 provides the longest delay (the outlet to shutoff first), and 7 would
-       provide the shortest delay (the outlet to shut off last).
-        
-       Allowed values are:
-       1 - 7."
-   ::= { sPDUOutletConfigMSPgsEntry 8 }
-
-sPDUOutletConfigMSPgsRestartDelay  OBJECT-TYPE
-   SYNTAX INTEGER (-1..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in 6 minute intervals, between 
-        when the outlet is turned off and the outlet is turned back on
-        when performing a Graceful Shutdown.    
-       
-       Allowed values are:
-
-       -1 - Never turn outlet back on after a Graceful shutdown.
-       0 - 9999 six minute intervals (0 - 999hrs, 54 mins)."
-   ::= { sPDUOutletConfigMSPgsEntry 9 }
-
-sPDUOutletConfigMSPgsPowerOnDelay  OBJECT-TYPE
-   SYNTAX INTEGER (-1..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in seconds, between the UPS entering
-        normal (on-line) state and the outlet being powered on.
-       
-       Allowed values are:
-
-       -1 - Remain Off when the UPS enters the on-line state.
-       0 - 9999 seconds (0 - 2 hrs, 46 mins, 39 secs)."
-   ::= { sPDUOutletConfigMSPgsEntry 10 }
-
-
-sPDUOutletConfigMSPgsPowerOffDelay  OBJECT-TYPE
-   SYNTAX INTEGER (0..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in seconds, between when the server
-        shuts down and the outlet is powered off.
-       
-       Allowed values are:
-
-       0 - 9999 seconds (0 - 2 hrs, 46 mins, 39 secs)."
-   ::= { sPDUOutletConfigMSPgsEntry 11 }
-   
-sPDUOutletConfigMSPgsBattCapThresh  OBJECT-TYPE
-   SYNTAX INTEGER (0..100)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The minimum battery capacity, as a percent (0-100%), required
-        of the UPS before an outlet will be allowed to power on.
-       
-       Allowed values are:
-
-       0 - 100 percent."
-   ::= { sPDUOutletConfigMSPgsEntry 12 }
-
-sPDUOutletConfigMSPgsRebootDuration  OBJECT-TYPE
-   SYNTAX INTEGER (0..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of delay, in seconds, from outlet off until
-        outlet on during a reboot.
-        
-       Allowed values are:
-
-       0 - 9999 seconds (0 - 2 hrs, 46 mins, 39 secs)."
-   ::= { sPDUOutletConfigMSPgsEntry 13 }
-
-
--- the sPDUOutConfigMSPannun group
-
-sPDUOutletConfigMSPannunTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletConfigMSPannunEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusMSPOutletCount OID."
-   ::= { sPDUOutletConfigMSPannun 1 }
-
-sPDUOutletConfigMSPannunEntry OBJECT-TYPE
-   SYNTAX OutletConfigMSPannunEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to configure."
-   INDEX  { sPDUOutletConfigMSPannunIndex, sPDUOutletConfigMSPannunOutletIndex }
-   ::= { sPDUOutletConfigMSPannunTable 1 }
-
-OutletConfigMSPannunEntry ::=
-   SEQUENCE {
-      sPDUOutletConfigMSPannunIndex          INTEGER,
-      sPDUOutletConfigMSPannunName           DisplayString,   
-      sPDUOutletConfigMSPannunOutletIndex    INTEGER,
-      sPDUOutletConfigMSPannunOutletName     DisplayString,
-      sPDUOutletConfigMSPannunOutletCtrlMode INTEGER,     
-      sPDUOutletConfigMSPannunInitialState   INTEGER,
-      sPDUOutletConfigMSPannunAlarmActionDly INTEGER
-   }      
-
-sPDUOutletConfigMSPannunIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus."
-   ::= { sPDUOutletConfigMSPannunEntry 1 }
-
-sPDUOutletConfigMSPannunName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUOutletConfigMSPannunEntry 2 }
-
-sPDUOutletConfigMSPannunOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletConfigMSPannunEntry 3 }
-
-sPDUOutletConfigMSPannunOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. The maximum size is 
-       23 characters. The name is set by using the 
-       sPDUOutletConfigMSPallOutletName OID.
-       This OID is provided for informational purposes only."       
-   ::= { sPDUOutletConfigMSPannunEntry 4 }
-
-sPDUOutletConfigMSPannunOutletCtrlMode  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      modeGracefulShutdown              (1),
-      modeAnnunciator                   (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Control Mode of the outlet.
-       This OID is provided for informational purposes only."
-   ::= { sPDUOutletConfigMSPannunEntry 5 }
-
-sPDUOutletConfigMSPannunInitialState  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      initialStateOff              (1),
-      initialStateOn               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to initialStateOff (1) causes the outlet 
-       to default to off when in the non-alarmed condition.
-
-       Setting this OID to initialStateOn (2) causes the outlet 
-       to default to on when in the non-alarmed condition."
-   ::= { sPDUOutletConfigMSPannunEntry 6 }
-
-sPDUOutletConfigMSPannunAlarmActionDly  OBJECT-TYPE
-   SYNTAX INTEGER (0..9999)                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      " The amount of time, in seconds, that an enabled Measure-UPS
-        alarm must be asserted before an alarm condition is recognized.
-       
-       Allowed values are:
-
-       0 - 9999 seconds (0 - 2 hrs, 46 mins, 39 secs)."
-   ::= { sPDUOutletConfigMSPannunEntry 7 }
-
-
--- the sPDUOutConfigMSPmups group
-
-sPDUOutletConfigMSPmupsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletConfigMSPmupsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusMSPOutletCount OID."
-   ::= { sPDUOutletConfigMSPmups 1 }
-
-sPDUOutletConfigMSPmupsEntry OBJECT-TYPE
-   SYNTAX OutletConfigMSPmupsEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to configure."
-   INDEX  { sPDUOutletConfigMSPmupsIndex, sPDUOutletConfigMSPmupsOutletIndex }
-   ::= { sPDUOutletConfigMSPmupsTable 1 }
-
-OutletConfigMSPmupsEntry ::=
-   SEQUENCE {
-      sPDUOutletConfigMSPmupsIndex          INTEGER,
-      sPDUOutletConfigMSPmupsName           DisplayString,   
-      sPDUOutletConfigMSPmupsOutletIndex    INTEGER,
-      sPDUOutletConfigMSPmupsOutletName     DisplayString,
-      sPDUOutletConfigMSPmupsZone1          INTEGER,
-      sPDUOutletConfigMSPmupsZone2          INTEGER,
-      sPDUOutletConfigMSPmupsZone3          INTEGER,
-      sPDUOutletConfigMSPmupsZone4          INTEGER,
-      sPDUOutletConfigMSPmupsP1LowHum       INTEGER,
-      sPDUOutletConfigMSPmupsP1HiHum        INTEGER,
-      sPDUOutletConfigMSPmupsP1LowTemp      INTEGER,
-      sPDUOutletConfigMSPmupsP1HiTemp       INTEGER,
-      sPDUOutletConfigMSPmupsP2LowHum       INTEGER,
-      sPDUOutletConfigMSPmupsP2HiHum        INTEGER,
-      sPDUOutletConfigMSPmupsP2LowTemp      INTEGER,
-      sPDUOutletConfigMSPmupsP2HiTemp       INTEGER
-   }      
-
-sPDUOutletConfigMSPmupsIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch plus."
-   ::= { sPDUOutletConfigMSPmupsEntry 1 }
-
-sPDUOutletConfigMSPmupsName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUOutletConfigMSPmupsEntry 2 }
-
-sPDUOutletConfigMSPmupsOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletConfigMSPmupsEntry 3 }
-
-sPDUOutletConfigMSPmupsOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. The maximum size is 
-       23 characters. The name is set by using the 
-       sPDUOutletConfigMSPallOutletName OID.
-       This OID is provided for informational purposes only."       
-   ::= { sPDUOutletConfigMSPmupsEntry 4 }
-
-sPDUOutletConfigMSPmupsZone1  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Zone 1 alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Zone 1 alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 5 }
-
-sPDUOutletConfigMSPmupsZone2  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Zone 2 alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Zone 2 alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 6 }
-
-sPDUOutletConfigMSPmupsZone3  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Zone 3 alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Zone 3 alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 7 }
-
-sPDUOutletConfigMSPmupsZone4  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Zone 4 alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Zone 4 alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 8 }
-
-sPDUOutletConfigMSPmupsP1LowHum  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 1 low humidity alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 1 low humidity alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 9 }
-
-sPDUOutletConfigMSPmupsP1HiHum  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 1 high humidity alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 1 high humidity alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 10 }
-
-sPDUOutletConfigMSPmupsP1LowTemp  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 1 low temperature alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 1 low temperature alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 11 }
-
-sPDUOutletConfigMSPmupsP1HiTemp  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 1 high temperature alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 1 high temperature alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 12 }
-
-sPDUOutletConfigMSPmupsP2LowHum  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 2 low humidity alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 2 low humidity alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 13 }
-
-sPDUOutletConfigMSPmupsP2HiHum  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 2 high humidity alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 2 high humidity alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 14 }
-
-sPDUOutletConfigMSPmupsP2LowTemp  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 2 low temperature alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 2 low temperature alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 15 }
-
-sPDUOutletConfigMSPmupsP2HiTemp  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disableAlarm              (1),
-      enableAlarm               (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to disableAlarm (1) disables the
-       Probe 2 high temperature alarm for this outlet.
-
-       Setting this OID to enableAlarm (2) enables the
-       Probe 2 high temperature alarm for this outlet."
-   ::= { sPDUOutletConfigMSPmupsEntry 16 }
-
--- the sPDUOutletStatusMSP group
-  
-sPDUOutletStatusMSPTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletStatusMSPEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting of status of individual outlets. The number of
-       entries is contained in the sPDUMasterStatusOutletCount OID."
-   ::= { sPDUOutletStatusMSP 1 }
-
-sPDUOutletStatusMSPEntry OBJECT-TYPE
-   SYNTAX OutletStatusMSPEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to gather status from."
-   INDEX  { sPDUOutletStatusMSPIndex, sPDUOutletStatusMSPOutletIndex }
-   ::= { sPDUOutletStatusMSPTable 1 }
-
-OutletStatusMSPEntry ::=
-   SEQUENCE {
-      sPDUOutletStatusMSPIndex          INTEGER,
-      sPDUOutletStatusMSPName           DisplayString,   
-      sPDUOutletStatusMSPOutletIndex    INTEGER,
-      sPDUOutletStatusMSPOutletName     DisplayString,
-      sPDUOutletStatusMSPOutletState    INTEGER,
-      sPDUOutletStatusMSPCommandPending INTEGER,
-      sPDUOutletStatusMSPOutletCtrlMode INTEGER
-   }      
-
-sPDUOutletStatusMSPIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the MasterSwitch MSP."
-   ::= { sPDUOutletStatusMSPEntry 1 }
-
-sPDUOutletStatusMSPName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the MasterSwitch plus. The maximum 
-       value is 23 characters. The name is set by
-       using the sPDUMasterConfigMSPName OID."
-   ::= { sPDUOutletStatusMSPEntry 2 }
-
-sPDUOutletStatusMSPOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { sPDUOutletStatusMSPEntry 3 }
-   
-sPDUOutletStatusMSPOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. The maximum size is 
-       23 characters. The name is set by using the 
-       sPDUOutletConfigMSPallOutletName OID.
-       This OID is provided for informational purposes only."       
-   ::= { sPDUOutletStatusMSPEntry 4 }
-
-sPDUOutletStatusMSPOutletState OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletStatusMSPOn              (1),
-        outletStatusMSPOff             (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the outletStatusMSPOn (1) value will be returned.
-       If the outlet is off, the outletStatusMSPOff (2) value will be
-       returned. "
-   ::= { sPDUOutletStatusMSPEntry 5 }
-
-sPDUOutletStatusMSPCommandPending    OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletStatusMSPCommandPending    (1),
-        outletStatusMSPNoCommandPending  (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the command pending
-        state of the outlet. If a command is pending on the 
-        outlet, the outletStatusMSPCommandPending (1) value
-        will be returned. If there is not a command pending
-        on the outlet, the outletStatusMSPNoCommandPending (2)
-        will be returned."
-   ::= { sPDUOutletStatusMSPEntry 6 }
-
-sPDUOutletStatusMSPOutletCtrlMode  OBJECT-TYPE
-   SYNTAX INTEGER       {
-      modeGracefulShutdown              (1),
-      modeAnnunciator                   (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The Control Mode of the outlet.
-       This OID is provided for informational purposes only."
-   ::= { sPDUOutletStatusMSPEntry 7 }
-
-
--- the rPDUIdent group
-
-rPDUIdentName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the Rack PDU. 
-       The maximum string size is device dependent."
-   ::= { rPDUIdent 1 }
-
-rPDUIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the Rack PDU. 
-       This value is set at the factory."
-   ::= { rPDUIdent 2 }
-
-rPDUIdentFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An 8-byte ID string identifying the Rack PDU firmware revision. 
-       This value is set at the factory." 
-   ::= {  rPDUIdent 3 }
-
-
-rPDUIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the Rack PDU was manufactured in mm/dd/yy format.
-       This value is set at the factory. The year 2000 will be 
-       represented by 00." 
-   ::= { rPDUIdent 4 }
-   
-rPDUIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 10-character string identifying the model number of 
-       the Rack PDU. This value is set at the factory."
-   ::= { rPDUIdent 5 }
-
-rPDUIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 12-character string identifying the serial number of 
-       the Rack PDU. This value is set at the factory."
-   ::= { rPDUIdent 6 }
-
-rPDUIdentDeviceRating OBJECT-TYPE
-   SYNTAX INTEGER      
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the electrical rating of the device."
-
-   ::= { rPDUIdent 7 } 
-
-rPDUIdentDeviceNumOutlets OBJECT-TYPE
-   SYNTAX INTEGER      
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the number of outlets contained in the device."
-
-   ::= { rPDUIdent 8 } 
-
-rPDUIdentDeviceNumPhases OBJECT-TYPE
-   SYNTAX INTEGER      
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the number of phases supported by the device."
-
-   ::= { rPDUIdent 9 } 
-
-rPDUIdentDeviceNumBreakers OBJECT-TYPE
-   SYNTAX INTEGER      
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the number of circuit breakers supported by the device.
-       This is the same as the number of banks of outlets."
-
-   ::= { rPDUIdent 10 } 
-
-rPDUIdentDeviceBreakerRating OBJECT-TYPE
-   SYNTAX INTEGER      
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return rating of the circuit breakers on the device if it has any."
-
-   ::= { rPDUIdent 11 } 
-
-rPDUIdentDeviceOrientation OBJECT-TYPE
-   SYNTAX INTEGER       {
-      orientHorizontal            (1),
-      orientVertical              (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the intended physical orientation of the device.
-       
-       OrientHorizonatal(1) indicates Horizontal.
-       OrientVertical(2) indicates Vertical."
-
-   ::= { rPDUIdent 12 } 
-   
-rPDUIdentDeviceOutletLayout OBJECT-TYPE
-   SYNTAX INTEGER       {
-      seqPhaseToNeutral            (1),
-      seqPhaseToPhase              (2),
-      seqPhToNeu21PhToPh           (3),
-      seqPhToPhGrouped             (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return outlet layout for the device.
-       
-       SeqPhaseToNeutral(1) indicates outlet layout as follows:
-       1:1-N,2:2-N,3:3-N,4:1-N,5:2-N,...
-
-       SeqPhaseToPhase(2) indicates outlet layout as follows:
-       1:1-2,2:2-3,3:3-1,4:1-2,5:2-3,...
-
-       SeqPhToNeu21PhToPh(3) indicates outlet layout as follows:
-       1:1-N,2:2-N...21:3-N,22:1-2,23:2-3,24:3-1,...
-
-       SeqPhToPhGrouped(4) indicates outlet layout as follows:
-       Otlts1-8::(3-1),Otlts9-16::(2-3),Otlts17-24::(1-2)."
-   ::= { rPDUIdent 13 } 
-
-
-
--- the rPDULoadDevice group
-
-rPDULoadDevMaxPhaseLoad   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the maximum rated power
-       that each phase of the Rack PDU can provide. It is 
-       represented in Amps."  
-   ::= { rPDULoadDevice 1 }
-
-rPDULoadDevNumPhases OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of phases available with this Rack PDU."
-   ::= { rPDULoadDevice 2 }
-
-rPDULoadDevMaxBankLoad   OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the maximum rated power
-       that each bank of the Rack PDU can provide. It is 
-       represented in Amps.
-       
-       0 will be returned if the device does not have any banks."
-       
-   ::= { rPDULoadDevice 3 }
-
-rPDULoadDevNumBanks OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of banks of outlets available with this Rack PDU.
-       A bank of outlets has a unique circuit breaker for a subset 
-       of the total number of outlets on the rPDU."
-   ::= { rPDULoadDevice 4 }
-
--- the rPDULoadPhaseConfig group
-
-rPDULoadPhaseConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF LoadPhaseConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of each Rack PDU phase.
-       The number of entries is contained in the 
-       rPDULoadDevNumPhases OID."
-   ::= { rPDULoadPhaseConfig 1 }
-
-rPDULoadPhaseConfigEntry OBJECT-TYPE
-   SYNTAX LoadPhaseConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Rack PDU phase to configure."
-   INDEX  { rPDULoadPhaseConfigIndex}
-   ::= { rPDULoadPhaseConfigTable 1 }
-
-LoadPhaseConfigEntry ::=
-   SEQUENCE {
-      rPDULoadPhaseConfigIndex                    INTEGER,
-      rPDULoadPhaseConfigLowLoadThreshold         INTEGER,
-      rPDULoadPhaseConfigNearOverloadThreshold    INTEGER,
-      rPDULoadPhaseConfigOverloadThreshold        INTEGER
-   }      
-
-rPDULoadPhaseConfigIndex OBJECT-TYPE
-   SYNTAX INTEGER {
-      phase1                     (1),
-      phase2                     (2),
-      phase3                     (3)
-   }        
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Rack PDU phase entry."
-   ::= { rPDULoadPhaseConfigEntry 1 }
-
-rPDULoadPhaseConfigLowLoadThreshold OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load is nearing a low consumption condition. It is 
-       represented in amps.  A warning will be issued when the
-       load is less than the threshold value.  
-       
-       A threshold value of 0 amps effectively disables this 
-       warning.  
-       
-       Maximum value must be less than the value returned 
-       by the rPDULoadPhaseConfigNearOverloadThreshold OID."  
-   ::= { rPDULoadPhaseConfigEntry 2 }
-
-rPDULoadPhaseConfigNearOverloadThreshold OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load is nearing an overload condition. It is 
-       represented in amps.  A warning will be issued when the 
-       load is greater than or equal to the threshold value.
-       
-       Minimum value must be greater than the value returned by
-       the rPDULoadPhaseConfigLowLoadThreshold OID.
-       
-       Maximum value must be less than or equal to the value 
-       returned by the rPDULoadPhaseConfigOverloadThreshold OID."
-   ::= { rPDULoadPhaseConfigEntry 3 }
-
-rPDULoadPhaseConfigOverloadThreshold OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load has entered an overload condition. It is 
-       represented in amps.  A warning will be issued when the 
-       load is greater than or equal to the threshold value.
-       
-       Minimum value must be greater than or equal to the value 
-       returned by the rPDULoadPhaseConfigNearOverloadThreshold OID.
-       
-       Maximum value must be less than or equal to the value 
-       returned by the rPDULoadDevMaxPhaseLoad OID."
-   ::= { rPDULoadPhaseConfigEntry 4 }
-
-
--- the rPDULoadStatus group
-
-rPDULoadStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF LoadStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting of status of each Rack PDU phase/bank.
-       The number of entries is calculated by adding
-       the number of phases (rPDULoadDevNumPhases OID) and
-       the number of banks of outlets (rPDULoadDevNumBanks)
-       Number of entries = #phases + #banks.
-       NOTE: If a device has phase and bank information, all phase information
-       shall preceed the bank information."
-   ::= { rPDULoadStatus 1 }
-
-rPDULoadStatusEntry OBJECT-TYPE
-   SYNTAX LoadStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Rack PDU phase/bank to gather status from."
-   INDEX  { rPDULoadStatusIndex}
-   ::= { rPDULoadStatusTable 1 }
-
-LoadStatusEntry ::=
-   SEQUENCE {
-      rPDULoadStatusIndex                 INTEGER,
-      rPDULoadStatusLoad                  Gauge,
-      rPDULoadStatusLoadState             INTEGER,
-      rPDULoadStatusPhaseNumber           INTEGER,
-      rPDULoadStatusBankNumber            INTEGER
-   }      
-
-rPDULoadStatusIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Rack PDU phase/bank entry. All phase information will preceed
-       any bank information"
-   ::= { rPDULoadStatusEntry 1 }
-
-rPDULoadStatusLoad OBJECT-TYPE
-   SYNTAX Gauge       
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the phase/bank load measured
-       in tenths of amps."
-   ::= { rPDULoadStatusEntry 2 }
-
-rPDULoadStatusLoadState OBJECT-TYPE
-   SYNTAX INTEGER       {
-      phaseLoadNormal                 (1),
-      phaseLoadLow                    (2),
-      phaseLoadNearOverload           (3),
-      phaseLoadOverload               (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return the phase/bank load state.
-       
-       phaseLoadNormal(1) indicates that the phase/bank is 
-       operating properly within the rPDULoadConfigLowLoadThreshold 
-       and rPDULoadConfigNearOverloadThreshold OID values.
-       
-       phaseLoadLow(2) indicates that the phase/bank load has
-       dropped below the rPDULoadConfigLowLoadThreshold OID value.
-       An SNMP trap will occur when this state is entered or cleared.
-       
-       phaseLoadNearOverload(3) indicates that the phase/bank load
-       is greater than or equal to the 
-       rPDULoadConfigNearOverloadThreshold OID value.
-       An SNMP trap will occur when this state is entered or cleared.
-       
-       phaseLoadOverload(4) indicates that the phase/bank load is
-       greater than or equal to the rPDULoadConfigOverloadThreshold 
-       OID value.
-       An SNMP trap will occur when this state is entered or cleared."
-   ::= { rPDULoadStatusEntry 3 } 
-
-rPDULoadStatusPhaseNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The phase number to which this record refers.  A value of 0 will be returned if
-       this is bank related information."
-   ::= { rPDULoadStatusEntry 4 }
-
-rPDULoadStatusBankNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The bank number to which this record refers.  A value of 0 will be returned if
-       this is phase related information."
-   ::= { rPDULoadStatusEntry 5 }
-        
--- the rPDULoadBankConfig group
-
-rPDULoadBankConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF LoadBankConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of each Rack PDU bank.
-       The number of entries is contained in the 
-       rPDULoadDevNumBanks OID."
-   ::= { rPDULoadBankConfig 1 }
-
-rPDULoadBankConfigEntry OBJECT-TYPE
-   SYNTAX LoadBankConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Rack PDU bank to configure."
-   INDEX  { rPDULoadBankConfigIndex}
-   ::= { rPDULoadBankConfigTable 1 }
-
-LoadBankConfigEntry ::=
-   SEQUENCE {
-      rPDULoadBankConfigIndex                    INTEGER,
-      rPDULoadBankConfigLowLoadThreshold         INTEGER,
-      rPDULoadBankConfigNearOverloadThreshold    INTEGER,
-      rPDULoadBankConfigOverloadThreshold        INTEGER
-   }      
-
-rPDULoadBankConfigIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Rack PDU bank entry."
-   ::= { rPDULoadBankConfigEntry 1 }
-
-rPDULoadBankConfigLowLoadThreshold OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load is nearing a low consumption condition. It is 
-       represented in amps.  A warning will be issued when the
-       load is less than the threshold value.  
-       
-       A threshold value of 0 amps effectively disables this 
-       warning.  
-       
-       Maximum value must be less than the value returned 
-       by the rPDULoadBankConfigNearOverloadThreshold OID.
-   
-       -1 will be returned if the device has no banks."
-
-   ::= { rPDULoadBankConfigEntry 2 }
-
-rPDULoadBankConfigNearOverloadThreshold OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load is nearing an overload condition. It is 
-       represented in amps.  A warning will be issued when the 
-       load is greater than or equal to the threshold value.
-       
-       Minimum value must be greater than the value returned by
-       the rPDULoadBankConfigLowLoadThreshold OID.
-       
-       Maximum value must be less than or equal to the value 
-       returned by the rPDULoadBankConfigOverloadThreshold OID.
-
-       -1 will be returned if the device has no banks."
-
-   ::= { rPDULoadBankConfigEntry 3 }
-
-rPDULoadBankConfigOverloadThreshold OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A threshold that indicates the power consumption of
-       the load has entered an overload condition. It is 
-       represented in amps.  A warning will be issued when the 
-       load is greater than or equal to the threshold value.
-       
-       Minimum value must be greater than or equal to the value 
-       returned by the rPDULoadBankConfigNearOverloadThreshold OID.
-       
-       Maximum value must be less than or equal to the value 
-       returned by the rPDULoadDevMaxBankLoad OID.
-
-       -1 will be returned if the device has no banks."
-
-   ::= { rPDULoadBankConfigEntry 4 }
-
-
--- the rPDUOutletDevice group
-
-rPDUOutletDevCommand  OBJECT-TYPE
-  SYNTAX INTEGER       {
-      noCommandAll               (1),
-      immediateAllOn             (2),
-      immediateAllOff            (3),
-      immediateAllReboot         (4),
-      delayedAllOn               (5),
-      delayedAllOff              (6),
-      delayedAllReboot           (7),
-      cancelAllPendingCommands   (8),
-      gracefulAllOff             (9),
-      gracefulAllReboot          (10)
-   }
-   
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this OID to immediateAllOn (2) will turn all outlets
-       on immediately.
-       
-       Setting this OID to immediateAllOff (3) will turn all outlets
-       off immediately.
-       
-       Setting this OID to immediateAllReboot (4) will reboot all outlets
-       immediately.
-
-       Setting this OID to delayedAllOn (5) will turn all outlets on as 
-       defined by each outlet's rPDUOutletConfigPowerOnTime OID value. 
-             
-       Setting this OID to delayedAllOff (6) will turn all outlets 
-       off as defined by each outlet's rPDUOutletConfigPowerOffTime OID value.
-      
-       Setting this OID to delayedAllReboot (7) will cause a 
-       delayedAllOff command to be performed. Once all outlets are off, 
-       the Switched Rack PDU will then delay the largest 
-       rPDUOutletConfigRebootDuration OID time, and then perform a 
-       delayedAllOn command.    
-       
-       Setting this OID to cancelAllPendingCommands (8) will cause all pending
-       commands on the Switched Rack PDU to be canceled.
-
-       Setting this variable to gracefulAllOff (9) will cause the
-       Switched Rack PDU to shut all outlets off after it waits the 
-       servers graceful shutdown time and each outlet's shutdown delay.
-
-       Setting this variable to gracefulAllReboot (10) will cause the
-       Switched Rack PDU to shut all outlets off after it waits the 
-       servers graceful shutdown time and each outlet's shutdown delay.
-       Once all outlet are off, it will wait until the UPS reaches the
-       configured minimum return battery capacity, then each outlet's 
-       return delay before it turns the outlet back on.
-
-       Getting this OID will return the noCommandAll (1) value."
-   ::= { rPDUOutletDevice 1 }
-
-rPDUOutletDevColdstartDelay  OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of delay, in seconds, between when
-       power is provided to the Switched Rack PDU and 
-       when the Switched Rack PDU provides basic master 
-       power to the outlets.       
-       
-       Allowed values are:
-
-       -1       - never apply power automatically.
-       0        - apply power immediately.
-       1 to 300 - delay up to 300 seconds (5 minutes)."
-   ::= { rPDUOutletDevice 2 }
-
-rPDUOutletDevNumCntrlOutlets OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of controlled outlets on this Switched Rack PDU."
-   ::= { rPDUOutletDevice 3 }
-
-rPDUOutletDevNumTotalOutlets OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of outlets on this Rack PDU."
-   ::= { rPDUOutletDevice 4 }
-        
-
--- the rPDUOutletPhase group
-
-rPDUOutletPhaseTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletPhaseEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for management of outlets on a per phase basis."
-   ::= { rPDUOutletPhase 1 }
-
-rPDUOutletPhaseEntry OBJECT-TYPE
-   SYNTAX OutletPhaseEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The phase to manage."
-   INDEX  { rPDUOutletPhaseIndex}
-   ::= { rPDUOutletPhaseTable 1 }
-
-OutletPhaseEntry ::=
-   SEQUENCE {
-      rPDUOutletPhaseIndex                INTEGER,
-      rPDUOutletPhaseOverloadRestriction  INTEGER
-   }      
-
-rPDUOutletPhaseIndex OBJECT-TYPE
-   SYNTAX INTEGER {
-      phase1                     (1),
-      phase2                     (2),
-      phase3                     (3)
-   }        
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Switched Rack PDU phase entry."
-   ::= { rPDUOutletPhaseEntry 1 }
-
-rPDUOutletPhaseOverloadRestriction OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alwaysAllowTurnON         (1),
-      restrictOnNearOverload    (2),
-      restrictOnOverload        (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID controls the behavior of a Switched Rack PDU 
-       phase when an overload condition is possible and 
-       additional outlets are requested to be turned on. 
-
-       Setting this OID to alwaysAllowTurnON (1) will always allow 
-       the outlets on the corresponding phase to turn on.
-       
-       Setting this OID to restrictOnNearOverload (2) will not allow 
-       outlets on the corresponding phase to turn on if the 
-       rPDULoadConfigNearOverloadThreshold OID is exceeded.
-              
-       Setting this OID to restrictOnOverload (3) will not allow
-       outlets on the corresponding phase to turn on if the 
-       rPDULoadConfigOverloadThreshold OID is exceeded."
-   ::= { rPDUOutletPhaseEntry 2 }
-
-
--- the rPDUOutletControl group
-
-rPDUOutletControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF RPDUOutletControlEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of the individual outlets.
-       The number of entries is contained in the 
-       rPDUOutletDevNumCntrlOutlets OID."
-   ::= { rPDUOutletControl 1 }
-
-rPDUOutletControlEntry OBJECT-TYPE
-   SYNTAX RPDUOutletControlEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlet to control."
-   INDEX  { rPDUOutletControlIndex}
-   ::= { rPDUOutletControlTable 1 }
-
-RPDUOutletControlEntry ::=
-   SEQUENCE {
-      rPDUOutletControlIndex         INTEGER,
-      rPDUOutletControlOutletName    DisplayString,
-      rPDUOutletControlOutletPhase   INTEGER,
-      rPDUOutletControlOutletCommand INTEGER,
-      rPDUOutletControlOutletBank    INTEGER
-   }      
-
-rPDUOutletControlIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { rPDUOutletControlEntry 1 }
-   
-rPDUOutletControlOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is dependent on device.
-       An error will be returned if the set request exceeds the max size.
-       This OID is provided for informational purposes only."
-   ::= { rPDUOutletControlEntry 2 }
-
-rPDUOutletControlOutletPhase    OBJECT-TYPE
-   SYNTAX INTEGER {
-      phase1                     (1),
-      phase2                     (2),
-      phase3                     (3),
-      phase1-2                   (4),
-      phase2-3                   (5),
-      phase3-1                   (6)
-   }        
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The phase/s associated with this outlet.
-      
-       For single phase devices, this object will always 
-       return phase1(1).
-       
-       For 3-phase devices, this object will return phase1 (1), 
-       phase2 (2), or phase3 (3) for outlets tied to a single 
-       phase.  For outlets tied to two phases, this object will
-       return phase1-2 (4) for phases 1 and 2, phase2-3 (5) for 
-       phases 2 and 3, and phase3-1 (6) for phases 3 and 1."
-   ::= { rPDUOutletControlEntry 3 }
-
-rPDUOutletControlOutletCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      immediateOn             (1),
-      immediateOff            (2),
-      immediateReboot         (3),
-      delayedOn               (4),
-      delayedOff              (5),
-      delayedReboot           (6),
-      cancelPendingCommand    (7),
-      gracefulOff             (8),
-      gracefulReboot          (9)
-
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-        the outlet is on, the immediateOn (1) value will be returned.
-        If the outlet is off, the immediateOff (2) value will be
-        returned. 
-       
-       
-        Setting this variable to immediateOn (1) will immediately turn 
-        the outlet on.
-       
-        Setting this variable to immediateOff (2) will immediately turn 
-        the outlet off. 
-
-        Setting this variable to immediateReboot (3) will immediately 
-        reboot the outlet.
-      
-        Setting this variable to delayedOn (4) will turn the outlet on
-        after the rPDUOutletConfigPowerOnTime OID time has elapsed.   
-
-        Setting this variable to delayedOff (5) will turn the outlet off
-        after the rPDUOutletConfigPowerOffTime OID time has elapsed.
-
-        Setting this variable to delayedReboot  (6) will cause the 
-        Switched Rack PDU to perform a delayedOff command, wait the 
-        rPDUOutletConfigRebootDuration OID time, and then perform a 
-        delayedOn command. 
-       
-        Setting this variable to cancelPendingCommand (7) will cause any
-        pending command to this outlet to be canceled.
-
-        Setting this variable to gracefulOff (8) will cause the
-        Switched Rack PDU to shut the outlet off after it waits the 
-        servers graceful shutdown time and the outlets shutdown delay.
-
-        Setting this variable to gracefulReboot (9) will cause the
-        Switched Rack PDU to shut the outlet off after it waits the 
-        servers graceful shutdown time and the outlets shutdown delay.
-        Once the outlet is off, it will wait until the UPS reaches the
-        configured minimum return battery capacity, then the outlets 
-        return delay before it turns the outlet back on."
-
-    ::= { rPDUOutletControlEntry 4 }
-
-rPDUOutletControlOutletBank    OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The bank associated with this outlet."
-   ::= { rPDUOutletControlEntry 5 }
-
-
--- the rPDUOutletConfig group
-
-rPDUOutletConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF RPDUOutletConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the rPDUOutletDevNumCntrlOutlets OID."
-   ::= { rPDUOutletConfig 1 }
-
-rPDUOutletConfigEntry OBJECT-TYPE
-   SYNTAX RPDUOutletConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlet to configure."
-   INDEX  { rPDUOutletConfigIndex}
-   ::= { rPDUOutletConfigTable 1 }
-
-RPDUOutletConfigEntry ::=
-   SEQUENCE {
-      rPDUOutletConfigIndex          INTEGER,
-      rPDUOutletConfigOutletName     DisplayString,
-      rPDUOutletConfigOutletPhase    INTEGER,
-      rPDUOutletConfigPowerOnTime    INTEGER,
-      rPDUOutletConfigPowerOffTime   INTEGER,
-      rPDUOutletConfigRebootDuration INTEGER,
-      rPDUOutletConfigOutletBank     INTEGER
-   }      
-
-rPDUOutletConfigIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { rPDUOutletConfigEntry 1 }
-   
-rPDUOutletConfigOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is dependent on device.
-       An error will be returned if the set request exceeds the max size."
-   ::= { rPDUOutletConfigEntry 2 }
-
-rPDUOutletConfigOutletPhase    OBJECT-TYPE
-   SYNTAX INTEGER {
-      phase1                     (1),
-      phase2                     (2),
-      phase3                     (3),
-      phase1-2                   (4),
-      phase2-3                   (5),
-      phase3-1                   (6)
-   }        
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The phase/s associated with this outlet.
-      
-       For single phase devices, this object will always 
-       return phase1(1).
-       
-       For 3-phase devices, this object will return phase1 (1), 
-       phase2 (2), or phase3 (3) for outlets tied to a single 
-       phase.  For outlets tied to two phases, this object will
-       return phase1-2 (4) for phases 1 and 2, phase2-3 (5) for 
-       phases 2 and 3, and phase3-1 (6) for phases 3 and 1."
-   ::= { rPDUOutletConfigEntry 3 }
-
-rPDUOutletConfigPowerOnTime OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet will delay 
-       powering on at coldstart or when a command that requires 
-       a turn-on delay is issued.
-              
-       Allowed values are:
-
-       -1       - never power on.
-       0        - power on immediately.
-       1 to 300 - power on up to 300 seconds (5 minutes) after being
-                  commanded."
-   ::= { rPDUOutletConfigEntry 4 }
-
-rPDUOutletConfigPowerOffTime OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The amount of time (in seconds) the outlet will delay 
-       powering off when a command that requires 
-       a turn-off delay is issued.
-
-       Allowed values are:
-
-       -1       - never power off.
-       0        - power off immediately.
-       1 to 300 - power off up to 300 seconds (5 minutes) after being
-                  commanded."
-   ::= { rPDUOutletConfigEntry 5 }
-
-rPDUOutletConfigRebootDuration OBJECT-TYPE
-   SYNTAX INTEGER                
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "During a reboot sequence, power is turned off and then 
-       back on. This OID defines the amount of time to wait, 
-       in seconds, after turning the power off, at the start
-       of the sequence, before turning power back on, at the
-       end of the reboot sequence.       
-       
-       Allowed range is any value between 5 and 60 seconds (1 minute)."
-   ::= { rPDUOutletConfigEntry 6 }
-
-rPDUOutletConfigOutletBank    OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The bank associated with this outlet."
-   ::= { rPDUOutletConfigEntry 7 }
-
-
--- the rPDUOutletStatus group
-
-rPDUOutletStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF RPDUOutletStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting of status of individual outlets. The number of
-       entries is contained in the rPDUOutletDevNumCntrlOutlets OID."
-   ::= { rPDUOutletStatus 1 }
-
-rPDUOutletStatusEntry OBJECT-TYPE
-   SYNTAX RPDUOutletStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlet to gather status from."
-   INDEX  { rPDUOutletStatusIndex}
-   ::= { rPDUOutletStatusTable 1 }
-
-RPDUOutletStatusEntry ::=
-   SEQUENCE {
-      rPDUOutletStatusIndex          INTEGER,
-      rPDUOutletStatusOutletName     DisplayString,
-      rPDUOutletStatusOutletPhase    INTEGER,
-      rPDUOutletStatusOutletState    INTEGER,
-      rPDUOutletStatusCommandPending INTEGER,
-      rPDUOutletStatusOutletBank     INTEGER
-   }      
-
-rPDUOutletStatusIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { rPDUOutletStatusEntry 1 }
-   
-rPDUOutletStatusOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet. Maximum size is dependent on device.
-       An error will be returned if the set request exceeds the max size.
-       This OID is provided for informational purposes only."
-   ::= { rPDUOutletStatusEntry 2 }
-
-rPDUOutletStatusOutletPhase    OBJECT-TYPE
-   SYNTAX INTEGER {
-      phase1                     (1),
-      phase2                     (2),
-      phase3                     (3),
-      phase1-2                   (4),
-      phase2-3                   (5),
-      phase3-1                   (6)
-   }        
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The phase/s associated with this outlet.
-      
-       For single phase devices, this object will always 
-       return phase1(1).
-       
-       For 3-phase devices, this object will return phase1 (1), 
-       phase2 (2), or phase3 (3) for outlets tied to a single 
-       phase.  For outlets tied to two phases, this object will
-       return phase1-2 (4) for phases 1 and 2, phase2-3 (5) for 
-       phases 2 and 3, and phase3-1 (6) for phases 3 and 1."
-   ::= { rPDUOutletStatusEntry 3 }
-
-rPDUOutletStatusOutletState OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletStatusOn              (1),
-        outletStatusOff             (2)
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the outletStatusOn (1) value will be returned.
-       If the outlet is off, the outletStatusOff (2) value will be
-       returned. "
-   ::= { rPDUOutletStatusEntry 4 }
-
-rPDUOutletStatusCommandPending    OBJECT-TYPE
-   SYNTAX INTEGER {
-        outletStatusCommandPending    (1),
-        outletStatusNoCommandPending  (2)
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the command pending
-        state of the outlet. If a command is pending on the 
-        outlet, the outletStatusCommandPending (1) value
-        will be returned. If there is not a command pending
-        on the outlet, the outletStatusNoCommandPending (2)
-        will be returned."
-   ::= { rPDUOutletStatusEntry 5 }
-
-rPDUOutletStatusOutletBank    OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The bank associated with this outlet."
-   ::= { rPDUOutletStatusEntry 6 }
-
-
--- the rPDUOutletBank group
-
-rPDUOutletBankTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletBankEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for management of outlets on a per bank basis."
-   ::= { rPDUOutletBank 1 }
-
-rPDUOutletBankEntry OBJECT-TYPE
-   SYNTAX OutletBankEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The bank to manage."
-   INDEX  { rPDUOutletBankIndex}
-   ::= { rPDUOutletBankTable 1 }
-
-OutletBankEntry ::=
-   SEQUENCE {
-      rPDUOutletBankIndex                INTEGER,
-      rPDUOutletBankOverloadRestriction  INTEGER
-   }      
-
-rPDUOutletBankIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the Switched Rack PDU bank entry."
-   ::= { rPDUOutletBankEntry 1 }
-
-rPDUOutletBankOverloadRestriction OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alwaysAllowTurnON         (1),
-      restrictOnNearOverload    (2),
-      restrictOnOverload        (3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID controls the behavior of a Switched Rack PDU 
-       bank when an overload condition is possible and 
-       additional outlets are requested to be turned on. 
-
-       Setting this OID to alwaysAllowTurnON (1) will always allow 
-       the outlets on the corresponding bank to turn on.
-       
-       Setting this OID to restrictOnNearOverload (2) will not allow 
-       outlets on the corresponding bank to turn on if the 
-       rPDULoadConfigNearOverloadThreshold OID is exceeded.
-              
-       Setting this OID to restrictOnOverload (3) will not allow
-       outlets on the corresponding bank to turn on if the 
-       rPDULoadConfigOverloadThreshold OID is exceeded."
-   ::= { rPDUOutletBankEntry 2 }
-
--- the rPDUPowerSupplyDevice group
-
-rPDUPowerSupply1Status   OBJECT-TYPE
-   SYNTAX INTEGER       {
-      powerSupply1Ok             (1),
-      powerSupply1Failed         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return powerSupply1Ok(1) if power
-       supply 1 is functioning normally.  If not functioning normally, 
-       this OID will return powerSupply1Failed(2)."  
-   ::= { rPDUPowerSupplyDevice 1 }
-
-rPDUPowerSupply2Status   OBJECT-TYPE
-   SYNTAX INTEGER       {
-      powerSupply2Ok             (1),
-      powerSupply2Failed         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return powerSupply2Ok(1) if power
-       supply 2 is functioning normally.  If not functioning normally, 
-       this OID will return powerSupply2Failed(2)."  
-   ::= { rPDUPowerSupplyDevice 2 }
-
-
-
--- the dm3IdentSystem group
- 
-dm3IdentSysDescriptionTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC description records."
-   ::= { dm3IdentSystem 1 }
-
-dm3IdentSysDescriptionTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IdentSysDescriptionEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing description records of the powerplant. The number of
-       entries is contained in the dm3IdentSysDescriptionTableSize OID."
-   ::= { dm3IdentSystem 2 }    
-
-dm3IdentSysDescriptionEntry OBJECT-TYPE
-   SYNTAX IdentSysDescriptionEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The powerplant description record to reference."
-   INDEX { dm3IdentSysDescriptionIndex }
-   ::= { dm3IdentSysDescriptionTable 1 }
-   
-IdentSysDescriptionEntry ::=
-   SEQUENCE {
-      dm3IdentSysDescriptionIndex   INTEGER,
-      dm3IdentSysDescriptionText    DisplayString
-   }
-
-dm3IdentSysDescriptionIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant description record."
-   ::= { dm3IdentSysDescriptionEntry 1 }
-
-dm3IdentSysDescriptionText OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A 16 character text field describing the DC power plant device.
-      This field can be configured from the dm3ConfigSysDescriptionText OID."
-   ::= { dm3IdentSysDescriptionEntry 2 }
-
-dm3IdentSysModel OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Model type of the DC power plant."
-   ::= { dm3IdentSystem 3 }
-
-dm3IdentSysCntrlRev OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Integer representation of the hardware revision of the Master Controller board."
-   ::= { dm3IdentSystem 4 }
-
-dm3IdentSysFWVersion OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Integer representation of the power plant Master Controller firmware revision."
-   ::= { dm3IdentSystem 5 }
-   
--- the dm3ConfigSystem group
-
-dm3ConfigSysDescriptionTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC description records."
-   ::= { dm3ConfigSystem 1 }
-
-dm3ConfigSysDescriptionTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigSysDescriptionEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing description records of the powerplant. The number of
-       entries is contained in the dm3ConfigSysDescriptionTableSize OID."
-   ::= { dm3ConfigSystem 2 }       
-
-dm3ConfigSysDescriptionEntry OBJECT-TYPE
-   SYNTAX ConfigSysDescriptionEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The powerplant description record to reference."
-   INDEX { dm3ConfigSysDescriptionIndex }
-   ::= { dm3ConfigSysDescriptionTable 1 }
-   
-ConfigSysDescriptionEntry ::=
-   SEQUENCE {
-      dm3ConfigSysDescriptionIndex   INTEGER,
-      dm3ConfigSysDescriptionText    DisplayString
-   }
-
-dm3ConfigSysDescriptionIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant description record."
-
-   ::= { dm3ConfigSysDescriptionEntry 1 }
-
-dm3ConfigSysDescriptionText OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "16 character text field describing the DC power plant device."
-
-   ::= { dm3ConfigSysDescriptionEntry 2 }
-
-dm3ConfigSysHighTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Ambient high temperature threshold.  Temperature sensor located on Master
-      Controller board.
-
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dm3StatusSysTempUnits' OID (Celsius or Fahrenheit).
-      
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigSystem 3 }
-
-dm3ConfigSysHighTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the System High Temperature Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-   ::= { dm3ConfigSystem 4 }
-   
-dm3ConfigSysLowTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Ambient low temperature threshold.  Temperature sensor located on Master
-      Controller board.
-      
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dm3StatusSysTempUnits' OID (Celsius or Fahrenheit).
-
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigSystem 5 }
-   
-dm3ConfigSysLowTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the System Low Temperature Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-   ::= { dm3ConfigSystem 6 }
-
-dm3ConfigSysHardwareTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the System Hardware Temperature Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-   ::= { dm3ConfigSystem 7 }
-
-dm3ConfigSysRemoteAccess OBJECT-TYPE
-   SYNTAX INTEGER       {
-      accessEnabled               (1),
-      accessDisabled              (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "
-      This OID is used to disable remote write access to the power plant.
-      Setting this OID to accessEnabled (1) will have no affect.
-      Setting this OID to accessDisabled (2) will disable the ability to 
-      remotely configure the DC powerplant.
-      
-      Once remote access is disabled, it can only be restored from the front
-      panel of the DC power plant."
-   ::= { dm3ConfigSystem 8 }
-    
-
--- the dm3ConfigLVD group
-
-dm3ConfigLVDTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant LVDs controllable
-       by this IP address."
-   ::= { dm3ConfigLVD 1 }
-
-dm3ConfigLVDTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the LVDs. The number of
-       entries is contained in the dm3ConfigLVDTableSize OID."
-   ::= { dm3ConfigLVD 2 }      
-
-dm3ConfigLVDEntry OBJECT-TYPE
-   SYNTAX ConfigLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The LVD to configure."
-   INDEX { dm3ConfigLVDIndex }
-   ::= { dm3ConfigLVDTable 1 }
-   
-ConfigLVDEntry ::=
-   SEQUENCE {
-      dm3ConfigLVDIndex               INTEGER,
-      dm3ConfigLVDName                DisplayString,
-      dm3ConfigLVDEnable              INTEGER,
-      dm3ConfigLVDTripThresh          INTEGER,
-      dm3ConfigLVDResetThresh         INTEGER,
-      dm3ConfigLVDOpenAlarm           INTEGER,
-      dm3ConfigLVDHWAlarm             INTEGER
-   }
-   
-dm3ConfigLVDIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant LVD."
-   ::= { dm3ConfigLVDEntry 1 }
-
-dm3ConfigLVDName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the LVD. The maximum value is 16 characters."
-   ::= { dm3ConfigLVDEntry 2 }
-   
-dm3ConfigLVDEnable OBJECT-TYPE
-   SYNTAX INTEGER       {
-      enabledYes               (1),
-      enabledNo                (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID is used to control and indicate if the LVD is on or off.
-      Setting this OID to enabledYes (1) will enable (turn on) the LVD.
-      Setting this OID to enabledNo (2) will disable (turn off) the LVD."
-   ::= { dm3ConfigLVDEntry 3 }
-
-dm3ConfigLVDTripThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "LVD Trip threshold.  If voltage exceeds threshold, the LVD will trip.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigLVDEntry 4 }
-
-dm3ConfigLVDResetThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "LVD Reset threshold.  If voltage exceeds threshold, the LVD will reset.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigLVDEntry 5 }
-   
-dm3ConfigLVDOpenAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the LVD Open Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-   ::= { dm3ConfigLVDEntry 6 }
-   
-dm3ConfigLVDHWAlarm OBJECT-TYPE   
-SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the LVD Hardware Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-   ::= { dm3ConfigLVDEntry 7 }
-
-
--- the dm3ConfigBattery group
-
-dm3ConfigBattFloatVolt OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Float Voltage.  This setting controls the power plant voltage.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 1 }
-
-dm3ConfigBattMaxRecharge OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Maximum Recharge Rate.  This setting controls the battery max
-      recharge rate.  The value is based on C/20 for 240 AHr battery string.
-      
-      Values are represented in thousandths of Amps (mA).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 2 }
-
-dm3ConfigBattDischargeThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery discharge threshold.  If battery output current exceeds threshold
-      a battery discharge alarm will occur.
-      
-      Values are represented in thousandths of Amps (mA).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 3 }
-   
-dm3ConfigBattDischargeAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery Discharge Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 4 }
-
-dm3ConfigBattHighVoltThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery high voltage threshold.  If system battery voltage exceeds threshold
-      a battery high voltage alarm will occur.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 5 }
-   
-dm3ConfigBattHighVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery High Voltage Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 6 }
-   
-dm3ConfigBattLowVoltThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery low voltage threshold.  If system battery voltage is under threshold
-      a battery low voltage alarm will occur.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 7 }
-   
-dm3ConfigBattLowVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery Low Voltage Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 8 }
-   
-dm3ConfigBattHighTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery high temperature threshold.  If system battery temperature exceeds threshold
-      a battery high temperature alarm will occur.
-      
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dm3StatusSysTempUnits' OID (Celsius or Fahrenheit).
-
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-      
-   ::= { dm3ConfigBattery 9 }
-   
-dm3ConfigBattHighTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery High Temperature Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 10 }
-   
-dm3ConfigBattLowTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery low temperature threshold.  If system battery temperature is under threshold
-      a battery low temperature alarm will occur.
-      
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dm3StatusSysTempUnits' OID (Celsius or Fahrenheit).
-
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-      
-   ::= { dm3ConfigBattery 11 }
-   
-dm3ConfigBattLowTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery Low Temperature Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 12 }
-
-dm3ConfigBattAmpHour OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Amp-Hour Size.  Units are thousandths of Amp hours (mAHr).
-
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 13 }
-
-dm3ConfigCompMethod OBJECT-TYPE
-   SYNTAX INTEGER       {
-      tempcompOn          (1),
-      tempcompOff         (2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID is used to configure and get the state of the battery
-      temperature compensation.
-      
-      Setting this OID to tempcompOn (1) will enable/turn on the battery temperature compensation.
-      Setting this OID to tempcompOff (2) will disable/turn off the battery temperature compensation."
-   ::= { dm3ConfigBattery 14 }
-
-dm3ConfigCompTempCoeff OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Compensation Temperature Coefficient. (uV/degC/cell).
-      
-      Units are presented in microvolts.
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 15 }
-
-dm3ConfigHighKneeTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "High Knee for temperature compensation:  Compensation temperature coefficient 
-      becomes 0mV/degC/cell.
-      
-      Values are represented in thousandths of degrees Celcius.
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 16 }
-
-dm3ConfigLowKneeTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Low Knee for temperature compensation:  Compensation temperature coefficient 
-      becomes 0mV/degC/cell.
-      
-      Values are represented in thousandths of degrees Celcius.
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigBattery 17 }
-   
-dm3ConfigBattHwCurrentAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery Current Hardware Alarm (indicating current is outside realistic
-       limits, or a possible measurement fault;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 18 }
-   
-dm3ConfigBattHwTempAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Battery Temperature Hardware Alarm (indicating temperature is outside realistic
-       limits, or a possible measurement fault;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBattery 19 }
-
-
--- the dm3ConfigRectThresh group
-dm3ConfigRectHighVoltThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Rectifier high voltage threshold.  If rectifier voltage exceeds threshold
-      a rectifier high voltage alarm will occur.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigRectThresh 1 }
-
-
-dm3ConfigRectLowVoltThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Rectifier low voltage threshold.  If rectifier voltage is under threshold
-      a rectifier low voltage alarm will occur.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigRectThresh 2 }
-
-dm3ConfigRectFailSafe OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Rectifier Fail Safe point.  This OID represents the value sent to rectifier controllers
-      to use in the event of communications loss with the Master Controller or Master Controller
-      board failure.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigRectThresh 3 }
-
-dm3ConfigRectFailComm OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Rectifier Communication Fail timeout.  This OID represents the time interval in which there is no 
-      communication between the rectifier and the master controller at which the rectifier will reset 
-      all its values to default.
-      
-      Values are represented in hundredths of Seconds.
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigRectThresh 4 }
-
--- the dm3ConfigRectAlarms group
-
-dm3ConfigRectHighVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier High Voltage Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 1 }
-
-dm3ConfigRectLowVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Low Voltage Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 2 }
-   
-dm3ConfigRectConfigAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This alarm is activated when a new rectifier is detected;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 3 }
-   
-dm3ConfigRect1ofNAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This setting indicates the action if ONE rectifier of a N+1 system has failed;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 4 }
-
-dm3ConfigRect2ofNAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This setting indicates the action if TWO OR MORE rectifiers of a N+1 system have failed;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 5 }
-
-dm3ConfigRectDiagAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Controller Diagnostics Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigRect1ofNAlarm OID
-      to be activated if ONE rectifier fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigRect2ofNAlarm OID to be activated if TWO OR MORE rectifiers fail in an N+1 system."
-
-   ::= { dm3ConfigRectAlarms 6 }
-
-dm3ConfigRectImbalanceAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Imbalance Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 7 }
-
-dm3ConfigRectCurrLimitAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Current Limit Alarm (indicating rectifier in the Current Limit state);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigRect1ofNAlarm OID
-      to be activated if ONE rectifier fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigRect2ofNAlarm OID to be activated if TWO OR MORE rectifiers fail in an N+1 system."
-
-   ::= { dm3ConfigRectAlarms 8 }
-
-dm3ConfigRectStandbyAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Standby Alarm (indicating output DC has been turned off);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigRect1ofNAlarm OID
-      to be activated if ONE rectifier fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigRect2ofNAlarm OID to be activated if TWO OR MORE rectifiers fail in an N+1 system."
-
-   ::= { dm3ConfigRectAlarms 9 }
-   
-dm3ConfigRectFanFailAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Fan Fail Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigRect1ofNAlarm OID
-      to be activated if ONE rectifier fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigRect2ofNAlarm OID to be activated if TWO OR MORE rectifiers fail in an N+1 system."
-
-   ::= { dm3ConfigRectAlarms 10 }
-
-dm3ConfigRectFailAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Fail Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigRect1ofNAlarm OID
-      to be activated if ONE rectifier fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigRect2ofNAlarm OID to be activated if TWO OR MORE rectifiers fail in an N+1 system."
-
-   ::= { dm3ConfigRectAlarms 11 }
-
-dm3ConfigRectHwVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Rectifier Hardware Voltage Alarm (indicating voltage outside realistic limits,
-      or a possible measurement fault);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigRectAlarms 12 }
-
-
--- the dm3ConfigConvThresh group
-
-dm3ConfigConvHighVoltThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter high voltage threshold.  If converter voltage exceeds threshold
-      a converter high voltage alarm will occur.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-
-   ::= { dm3ConfigConvThresh 1 }
-   
-dm3ConfigConvLowVoltThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter low voltage threshold.  If converter voltage exceeds threshold
-      a converter low voltage alarm will occur.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigConvThresh 2 }
-
-dm3ConfigConvFailSafe OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter Fail Safe point.  This OID represents the value sent to converter controllers
-      to use in the event of communications loss with the Master Controller or Master Controller
-      board failure.
-      
-      Values are represented in thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigConvThresh 3 }
-
-dm3ConfigConvSetPoint OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter Set point.  This OID represents the initial set point used in the
-      voltage control loop.
-      
-      Units are thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigConvThresh 4 }
-
-dm3ConfigConvFailMax OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter Fail Maximum limit.  This OID represents the value sent to the converter
-      controllers to define the maximum set point allowed.
-      
-      Units are thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigConvThresh 5 }
-
-dm3ConfigConvFailMin OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter Fail Minimum limit.  This OID represents the value sent to the converter
-      controllers to define the minimum set point allowed.
-      
-      Units are thousandths of Volts (mV).
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigConvThresh 6 }
-
-dm3ConfigConvFailComm OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Converter Communication Fail timeout.  This OID represents the time interval in which there is no 
-      communication between the converter and the master controller at which the converter will reset 
-      all its values to default.
-      
-      Values are represented in hundredths of Seconds.
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigConvThresh 7 }
-
--- the dm3ConfigConvAlarms group
-dm3ConfigConvHighVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter High Voltage Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigConvAlarms 1 }
-
-dm3ConfigConvLowVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Low Voltage Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigConvAlarms 2 }
-
-dm3ConfigConvConfigAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Configuration Alarm (indicating a new converter has been detected);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigConvAlarms 3 }
-
-dm3ConfigConv1ofNAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter 1ofN Alarm (indicating action if ONE converter of a N+1 system has failed);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigConvAlarms 4 }
-
-dm3ConfigConv2ofNAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter 2ofN Alarm (indicating action if TWO OR MORE converters of a N+1 system has failed);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigConvAlarms 5 }
-
-dm3ConfigConvDiagAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Diagnostics Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 6 }
-
-dm3ConfigConvImbalanceAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Imbalance Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 7 }
-
-dm3ConfigConvCurrLimitAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Current Limit Alarm (indicating the converter is in the Current Limit state);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 8 }
-
-dm3ConfigConvStandbyAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Standby Alarm (indicating the converter is in the Standby state);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 9 }
-
-dm3ConfigConvFanFailAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Fan Fail Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 10 }
-   
-dm3ConfigConvFailAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Fail Alarm;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 11 }
-   
-dm3ConfigConvHwVoltAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9),
-      alarmNofN                (10)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "For the Converter Voltage Alarm (indicating voltage outside realistic limits, or a
-      possible measurement fault);
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmNofN (10) causes the alarm specified in the dm3ConfigConv1ofNAlarm OID
-      to be activated if ONE converter fails in an N+1 system.  It causes the alarm specified in the 
-      dm3ConfigConv2ofNAlarm OID to be activated if TWO OR MORE converters fail in an N+1 system."
-
-   ::= { dm3ConfigConvAlarms 12 }
-
-
--- the dm3ConfigOutputRelays group
-
-dm3ConfigOutRlyTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant Output Relays controllable
-       by this IP address."
-   ::= { dm3ConfigOutputRelays 1 }
-
-dm3ConfigOutRlyTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigOutRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the Output Relays. The number of
-       entries is contained in the dm3ConfigOutRlyTableSize OID."
-   ::= { dm3ConfigOutputRelays 2 }     
- 
-dm3ConfigOutRlyEntry OBJECT-TYPE
-   SYNTAX ConfigOutRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The output relay to configure."
-   INDEX { dm3ConfigOutRlyIndex }
-   ::= { dm3ConfigOutRlyTable 1 }
-   
-ConfigOutRlyEntry ::=
-   SEQUENCE {
-      dm3ConfigOutRlyIndex            INTEGER,
-      dm3ConfigOutRlyName             DisplayString,
-      dm3ConfigOutRlyDelay            INTEGER,
-      dm3ConfigOutRlyAlarm            INTEGER
-   }
-   
-dm3ConfigOutRlyIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant output relay."
-   ::= { dm3ConfigOutRlyEntry 1 }
-   
-dm3ConfigOutRlyName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the output relay. The maximum value is 16 characters."
-   ::= { dm3ConfigOutRlyEntry 2 }
-   
-dm3ConfigOutRlyDelay OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Output Relay Delay.  This OID represents the time delay from the initiation of an
-      output relay action to when the output relay action does occur.  If the alarm condition
-      disappears before the end of the delay, no action will occur.  Delay for Major 
-      and Minor alarms is not configurable and is always set to 0.
-      
-      Values are represented in hundredths of seconds.
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigOutRlyEntry 3 }
-   
-dm3ConfigOutRlyAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Output Relay Alarm.  This setting indicates what action to perform in the event of
-      an output relay alarm condition;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition.
-      
-      Relay Alarm for Major and Minor alarms is not configurable and is always set to 
-      alarmMajor and alarmMinor respectively."
-
-   ::= { dm3ConfigOutRlyEntry 4 }
-
-
--- the dm3ConfigInputRelays group
-
-dm3ConfigInRlyTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant Input Relays controllable
-       by this IP address."
-   ::= { dm3ConfigInputRelays 1 }
-
-dm3ConfigInRlyTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigInRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the Input Relays. The number of
-       entries is contained in the dm3ConfigInRlyTableSize OID."
-   ::= { dm3ConfigInputRelays 2 }      
-
-dm3ConfigInRlyEntry OBJECT-TYPE
-   SYNTAX ConfigInRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The input relay to configure."
-   INDEX { dm3ConfigInRlyIndex }
-   ::= { dm3ConfigInRlyTable 1 }
-   
-ConfigInRlyEntry ::=
-   SEQUENCE { 
-      dm3ConfigInRlyIndex             INTEGER,
-      dm3ConfigInRlyName              DisplayString,
-      dm3ConfigInRlyDelay             INTEGER,
-      dm3ConfigInRlyAlarm             INTEGER
-   }
-   
-dm3ConfigInRlyIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant input relay."
-   ::= { dm3ConfigInRlyEntry 1 }
-   
-dm3ConfigInRlyName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the input relay. The maximum value is 16 characters."
-
-   ::= { dm3ConfigInRlyEntry 2 }
-   
-dm3ConfigInRlyDelay OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Input Relay Delay.  This OID represents the time delay from the initiation of an
-      input relay action to when the input relay action does occur.   If the alarm condition
-      disappears before the end of the delay, no action will occur.
-      
-      Values are represented in hundredths of seconds.
-
-      Attempts to set the value above or below the acceptable range of the powerplant
-       will cause the value to be set at the high or low point of the range respectively."
-   ::= { dm3ConfigInRlyEntry 3 }
-   
-dm3ConfigInRlyAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Input Relay Alarm.  This setting indicates what action to perform in the event of
-      an input relay alarm condition;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigInRlyEntry 4 }
-
--- the dm3ConfigBreakers group
-
-dm3ConfigBreakersTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant circuit breakers controllable
-       by this IP address."
-   ::= { dm3ConfigBreakers 1 }
-
-dm3ConfigBreakersTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigBreakersEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the circuit breakers. The number of
-       entries is contained in the dm3ConfigBreakersTableSize OID."
-   ::= { dm3ConfigBreakers 2 }     
-
-dm3ConfigBreakersEntry OBJECT-TYPE
-   SYNTAX ConfigBreakersEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The circuit breaker to configure."
-   INDEX { dm3ConfigBreakersIndex }
-   ::= { dm3ConfigBreakersTable 1 }
-   
-ConfigBreakersEntry ::=
-   SEQUENCE {
-      dm3ConfigBreakersIndex         INTEGER,
-      dm3ConfigBreakersName          DisplayString,
-      dm3ConfigBreakersAlarm         INTEGER
-   }
-   
-dm3ConfigBreakersIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant circuit breaker."
-   ::= { dm3ConfigBreakersEntry 1 }
-   
-dm3ConfigBreakersName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the circuit breaker. The maximum value is 16 characters."
-   ::= { dm3ConfigBreakersEntry 2 }
-   
-dm3ConfigBreakersAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Circuit Breaker Alarm.  This setting indicates what action to perform in the event of
-      a circuit breaker alarm condition;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigBreakersEntry 3 }
-
--- the dm3ConfigFuses group
-
-dm3ConfigFusesTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant Fuses controllable
-       by this IP address."
-   ::= { dm3ConfigFuses 1 }
-
-dm3ConfigFusesTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigFusesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the Fuses. The number of
-       entries is contained in the dm3ConfigFusesTableSize OID."
-   ::= { dm3ConfigFuses 2 }    
-   
-dm3ConfigFusesEntry OBJECT-TYPE
-   SYNTAX ConfigFusesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The fuse to configure."
-   INDEX { dm3ConfigFusesIndex }
-   ::= { dm3ConfigFusesTable 1 }
-   
-ConfigFusesEntry ::=
-   SEQUENCE {
-      dm3ConfigFusesIndex              INTEGER,
-      dm3ConfigFusesName               DisplayString,
-      dm3ConfigFusesAlarm              INTEGER
-   }
-   
-dm3ConfigFusesIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant fuse."
-   ::= { dm3ConfigFusesEntry 1 }
-   
-dm3ConfigFusesName OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the fuse. The maximum value is 16 characters."
-   ::= { dm3ConfigFusesEntry 2 }
-   
-dm3ConfigFusesAlarm OBJECT-TYPE
-   SYNTAX INTEGER       {
-      alarmIgnore               (1),
-      alarmRelay1               (2),
-      alarmRelay2               (3),
-      alarmRelay3               (4),
-      alarmRelay4               (5),
-      alarmRelay5               (6),
-      alarmRelay6               (7),
-      alarmMinor                (8),
-      alarmMajor                (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Fuses Alarm.  This setting indicates what action to perform in the event of
-      a Fuse alarm condition;
-      Setting this OID to alarmIgnore (1) results in the alarm condition being ignored.
-      Setting this OID to alarmRelay1 (2) causes relay 1 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay2 (3) causes relay 2 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay3 (4) causes relay 3 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay4 (5) causes relay 4 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay5 (6) causes relay 5 to be activated for an
-      alarm condition.
-      Setting this OID to alarmRelay6 (7) causes relay 6 to be activated for an
-      alarm condition.
-      Setting this OID to alarmMinor (8) causes the Minor relay to be activated for an
-      alarm condition.
-      Setting this OID to alarmMajor (9) causes the Major relay to be activated for an
-      alarm condition."
-
-   ::= { dm3ConfigFusesEntry 3 }
-
--- the dm3StatusSystem group
-
-dm3StatusSystemTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "System temperature based on sensor on Master Controller PCB.
-
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dm3StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-
-   ::= { dm3StatusSystem 1 }
-
-dm3StatusSystemStart OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Time stamp at DC powerplant initialization.
-       The time is represented as MMM,DD,YYYY,HH:MM:SS."
-   ::= { dm3StatusSystem 2 }
-
-dm3StatusSysRemoteAccess OBJECT-TYPE
-   SYNTAX INTEGER       {
-      accessEnabled              (1),
-      accessDisabled             (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Remote Access indicator
-      This setting indicates if configuration (write) access to the powerplant is enabled or 
-      disabled at the powerplant level.
-      This value will be accessEnabled (1) if remote configuration is enabled, and 
-      accessDisabled (2) if remote configuration is disabled."
-   ::= { dm3StatusSystem 3 }
-
-dm3StatusSysSecurityLevel OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable shows the current active security access level of controller.  This
-      can only be changed directly from the front panel."
-   ::= { dm3StatusSystem 4 }
-
-dm3StatusSysTempSanity OBJECT-TYPE
-   SYNTAX INTEGER{
-      saneYES              (1),
-      saneNO               (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "System temperature sanity indicator.  Indicates if the system temperature is 
-      reasonable.  Reasonable is defined based on powerplant type.  A value of saneYes (1)
-      indicates temperature is reasonable, a value of saneNo (2) indicates it is not."
-   ::= { dm3StatusSystem 5 }
-
-dm3StatusSysAlarmState OBJECT-TYPE
-   SYNTAX INTEGER{
-      alarmMinor           (1),
-      alarmMajor           (2),
-      alarmBoth            (3),
-      alarmNone            (4)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "System Alarm State.  Reflects the alarm status of the overall DC system.
-      If a minor alarm is present, the value will be alarmMinor(1).
-      If a major alarm is present, the value will be alarmMajor(2).
-      If both minor and a major alarm is present, the value will be alarmBoth(3).
-      If no alarm is present, the value will be alarmNone(4)."
-   ::= { dm3StatusSystem 6 }
-
-dm3StatusSysTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       in the DC system, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { dm3StatusSystem 7 }
-
-
--- the dm3StatusAlarms group
-
-dm3StatusAlarmsTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant alarms viewable
-       by this IP address."
-   ::= { dm3StatusAlarms 1 }
-
-dm3StatusAlarmsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusAlarmsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing system alarms. The number of
-       entries is contained in the dm3StatusAlarmsTableSize OID."
-   ::= { dm3StatusAlarms 2 }       
-
-dm3StatusAlarmsEntry OBJECT-TYPE
-   SYNTAX StatusAlarmsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The alarm to display."
-   INDEX { dm3StatusAlarmsIndex }
-   ::= { dm3StatusAlarmsTable 1 }
-   
-StatusAlarmsEntry ::=
-   SEQUENCE {   
-      dm3StatusAlarmsIndex               INTEGER,
-      dm3StatusAlarmsText                DisplayString
-   }
-
-dm3StatusAlarmsIndex OBJECT-TYPE
-   SYNTAX  INTEGER
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The index of the system alarm."       
-   ::= { dm3StatusAlarmsEntry 1 }
-   
-dm3StatusAlarmsText OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The 16 character text describing the active alarm condition."
-   ::= { dm3StatusAlarmsEntry 2 }
-   
--- the dm3StatusBattery group
-
-dm3StatusBattCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Current:  This OID shows the battery current in thousandths of Amps (mA)."
-   ::= { dm3StatusBattery 1 }
-
-dm3StatusBattTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Temperature:
-      
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dm3StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-
-   ::= { dm3StatusBattery 2 }
-
-dm3StatusBattCurrentSanity OBJECT-TYPE
-   SYNTAX INTEGER{
-      saneYES              (1),
-      saneNO               (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery current sanity indicator.  Indicates if the battery current is 
-      reasonable.  Reasonable is defined based on powerplant type.  A value of saneYes (1)
-      indicates current is reasonable, a value of saneNo (2) indicates it is not."
-   ::= { dm3StatusBattery 3 }
-
-dm3StatusBattTempSanity OBJECT-TYPE
-   SYNTAX INTEGER{
-      saneYES              (1),
-      saneNO               (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery temperature sanity indicator.  Indicates if the battery temperature is 
-      reasonable.  Reasonable is defined based on powerplant type.  A value of saneYes (1)
-      indicates temperature is reasonable, a value of saneNo (2) indicates it is not."
-   ::= { dm3StatusBattery 4 }
-
--- the dm3StatusOEM group
-
-dm3StatusOEMrectOffset OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier offset value in thousandths of Volts (mV)."
-   ::= { dm3StatusOEM 1 }
-
-dm3StatusOEMrectGain OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier gain value in thousandths of Volts (mV/V)."
-   ::= { dm3StatusOEM 2 }
-
-dm3StatusOEMconvOffset OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter offset value in thousandths of Volts (mV)."
-   ::= { dm3StatusOEM 3 }
-
-dm3StatusOEMconvGain OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter gain value in thousandths of Volts (mV/V)."
-   ::= { dm3StatusOEM 4 }
-
-dm3StatusOEMshuntOffset OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the shunt offset value in thousandths of Amps (mA)."
-   ::= { dm3StatusOEM 5 }
-
-dm3StatusOEMshuntGain OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the shunt gain value in thousandths of Amps (mA/A)."
-   ::= { dm3StatusOEM 6 }
-
--- the dm3StatusLVD group
-
-dm3StatusLVDTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant LVDs viewable
-       by this IP address."
-   ::= { dm3StatusLVD 1 }
-
-dm3StatusLVDTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the LVDs. The number of
-       entries is contained in the dm3StatusLVDTableSize OID."
-   ::= { dm3StatusLVD 2 }      
-   
-dm3StatusLVDEntry OBJECT-TYPE
-   SYNTAX StatusLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The LVD to gather status from."
-   INDEX { dm3StatusLVDIndex }
-   ::= { dm3StatusLVDTable 1 }
-   
-StatusLVDEntry ::=
-   SEQUENCE {
-      dm3StatusLVDIndex               INTEGER,
-      dm3StatusLVDName                DisplayString,
-      dm3StatusLVDState               INTEGER,
-      dm3StatusLVDHwFault             INTEGER
-   }
-   
-dm3StatusLVDIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant LVD."
-   ::= { dm3StatusLVDEntry 1 }
-   
-dm3StatusLVDName OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the LVD. The maximum size is 
-       16 characters. The name is set by using the 
-       dm3ConfigLVDName OID.
-       This OID is provided for informational purposes only."       
-   ::= { dm3StatusLVDEntry 2 }
-   
-dm3StatusLVDState OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusClosed             (1),
-      statusOpened             (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusClosed (1) if the LVD is closed.
-       statusOpened (2) will be returned if the LVD is opened." 
-   ::= { dm3StatusLVDEntry 3 }
-
-dm3StatusLVDHwFault OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusFault               (1),
-      statusNofault             (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusFault (1) if the LVD is faulted.
-       statusNofault (2) will be returned if the LVD is not faulted." 
-   ::= { dm3StatusLVDEntry 4 }
-
--- the dm3StatusRectifier group
-
-dm3StatusRectTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant rectifiers viewable
-       by this IP address."
-   ::= { dm3StatusRectifier 1 }
-
-dm3StatusRectTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusRectEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the rectifiers. The number of
-       entries is contained in the dm3StatusRectTableSize OID."
-   ::= { dm3StatusRectifier 2 }    
-
-dm3StatusRectEntry OBJECT-TYPE
-   SYNTAX StatusRectEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The rectifier to gather status from."
-   INDEX { dm3StatusRectIndex }
-   ::= { dm3StatusRectTable 1 }
-   
-StatusRectEntry ::=
-   SEQUENCE {
-      dm3StatusRectIndex            INTEGER,
-      dm3StatusRectID               INTEGER,
-      dm3StatusRectDesc             DisplayString,
-      dm3StatusRectCurrent          INTEGER,
-      dm3StatusRectCurrentLimit     INTEGER,
-      dm3StatusRectStandby          INTEGER,
-      dm3StatusRectFanFail          INTEGER,
-      dm3StatusRectFail             INTEGER,
-      dm3StatusRectDevType          INTEGER,
-      dm3StatusRectPhyAddr          INTEGER,
-      dm3StatusRectCfg              INTEGER,
-      dm3StatusRectPcbRev           INTEGER,
-      dm3StatusRectFwVer            INTEGER,
-      dm3StatusRectPresent          INTEGER,
-      dm3StatusRectDiagPass         INTEGER,
-      dm3StatusRectState            INTEGER
-   }
-
-dm3StatusRectIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant rectifier."
-   ::= { dm3StatusRectEntry 1 }
-
-dm3StatusRectID OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier ID.  This enumerates the number of the rectifier within 
-       a group of rectifiers."
-   ::= { dm3StatusRectEntry 2 }
-
-dm3StatusRectDesc OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the 16-character rectifier description."
-   ::= { dm3StatusRectEntry 3 }
-
-dm3StatusRectCurrent OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier current in thousandths of Amps (mA)."
-   ::= { dm3StatusRectEntry 4 }
-
-dm3StatusRectCurrentLimit OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier is in the Current Limit state.
-       statusFalse (2) will be returned if the rectifier is not in the Current Limit state." 
-   ::= { dm3StatusRectEntry 5 }
-
-dm3StatusRectStandby OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier is in the Standby state.
-       statusFalse (2) will be returned if the rectifier is not in the Standby state." 
-   ::= { dm3StatusRectEntry 6 }
-
-dm3StatusRectFanFail OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier Fan has failed.
-       statusFalse (2) will be returned if the rectifier Fan has not failed." 
-   ::= { dm3StatusRectEntry 7 }
-
-dm3StatusRectFail    OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier has failed.
-       statusFalse (2) will be returned if the rectifier has not failed." 
-   ::= { dm3StatusRectEntry 8 }
-
-dm3StatusRectDevType OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier device type."
-   ::= { dm3StatusRectEntry 9 }
-
-dm3StatusRectPhyAddr OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier physical address (the address on the bus)."
-   ::= { dm3StatusRectEntry 10 }
-
-dm3StatusRectCfg OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier is present after
-      power-up or set-configuration.
-       statusFalse (2) will be returned if the rectifier is not configured." 
-   ::= { dm3StatusRectEntry 11 }
-
-dm3StatusRectPcbRev OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier device PCB serial number."
-   ::= { dm3StatusRectEntry 12 }
-
-dm3StatusRectFwVer OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier device firmware revision."
-   ::= { dm3StatusRectEntry 13 }
-
-dm3StatusRectPresent OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier is present.
-       statusFalse (2) will be returned if the rectifier is not present." 
-   ::= { dm3StatusRectEntry 14 }
-
-dm3StatusRectDiagPass OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier diagnostics have passed.
-       statusFalse (2) will be returned if the rectifier diagnostics have not passed." 
-   ::= { dm3StatusRectEntry 15 }
-
-dm3StatusRectState OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier device state as defined by the device status register."
-   ::= { dm3StatusRectEntry 16 }
-
-dm3StatusSysRectVoltSanity OBJECT-TYPE
-   SYNTAX INTEGER {
-      saneYES              (1),
-      saneNO               (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Rectifier voltage sanity indicator.  Indicates if the rectifier voltage is 
-      reasonable.  Reasonable is defined based on powerplant type.  A value of saneYes (1)
-      indicates voltage is reasonable, a value of saneNo (2) indicates it is not."
-   ::= { dm3StatusRectifier 3 }
-
-dm3StatusSysRectAvailable OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier is available.
-       statusFalse (2) will be returned if the rectifier is not available." 
-   ::= { dm3StatusRectifier 4 }
-
-dm3StatusSysRectType OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the type of rectifier the system has.  There can only be a single type of
-      rectifier in the power plant"
-   ::= { dm3StatusRectifier 5 }
-
-dm3StatusSysRectVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the system level rectifier voltage in thousandths of Volts (mV)."
-   ::= { dm3StatusRectifier 6 }
-
-dm3StatusSysRectCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the system level rectifier current in thousandths of Amps (mA)."
-   ::= { dm3StatusRectifier 7 }
-
-
--- the dm3StatusConverter group
-
-dm3StatusConvTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant converters viewable
-       by this IP address."
-   ::= { dm3StatusConverter 1 }
-
-dm3StatusConvTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusConvEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for viewing status of the converters. The number of
-       entries is contained in the dm3StatusConvTableSize OID."
-   ::= { dm3StatusConverter 2 }    
- 
-dm3StatusConvEntry OBJECT-TYPE
-   SYNTAX StatusConvEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The converter to gather status from."
-   INDEX { dm3StatusConvIndex }
-   ::= { dm3StatusConvTable 1 }
-   
-StatusConvEntry ::=
-   SEQUENCE {
-      dm3StatusConvIndex            INTEGER,
-      dm3StatusConvID               INTEGER,
-      dm3StatusConvDesc             DisplayString,
-      dm3StatusConvCurrent          INTEGER,
-      dm3StatusConvCurrentLimit     INTEGER,
-      dm3StatusConvStandby          INTEGER,
-      dm3StatusConvFanFail          INTEGER,
-      dm3StatusConvFail             INTEGER,
-      dm3StatusConvDevType          INTEGER,
-      dm3StatusConvPhyAddr          INTEGER,
-      dm3StatusConvCfg              INTEGER,
-      dm3StatusConvPcbRev           INTEGER,
-      dm3StatusConvFwVer            INTEGER,
-      dm3StatusConvPresent          INTEGER,
-      dm3StatusConvDiagPass         INTEGER,
-      dm3StatusConvState            INTEGER
-   }
-
-dm3StatusConvIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant converter."
-   ::= { dm3StatusConvEntry 1 }
-   
-dm3StatusConvID OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter ID.  This enumerates the number of the converter within 
-       a group of converters."
-   ::= { dm3StatusConvEntry 2 }
-
-dm3StatusConvDesc OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the 16 character converter description."
-   ::= { dm3StatusConvEntry 3 }
-
-dm3StatusConvCurrent OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter current in thousandths of Amps (mA)."
-   ::= { dm3StatusConvEntry 4 }
-
-dm3StatusConvCurrentLimit OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter is in the Current Limit state.
-       statusFalse (2) will be returned if the converter is not in the Current Limit state." 
-   ::= { dm3StatusConvEntry 5 }
-
-dm3StatusConvStandby OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter is in the Standby state.
-       statusFalse (2) will be returned if the converter is not in the Standby state." 
-   ::= { dm3StatusConvEntry 6 }
-
-dm3StatusConvFanFail OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter Fan has failed.
-       statusFalse (2) will be returned if the converter Fan has not failed." 
-   ::= { dm3StatusConvEntry 7 }
-
-dm3StatusConvFail OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter has failed.
-       statusFalse (2) will be returned if the converter has not failed." 
-   ::= { dm3StatusConvEntry 8 }
-
-dm3StatusConvDevType OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter device type."
-   ::= { dm3StatusConvEntry 9 }
-
-dm3StatusConvPhyAddr OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter physical address (the address on the bus)."
-   ::= { dm3StatusConvEntry 10 }
-
-dm3StatusConvCfg OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter is present after
-      power-up or set-configuration.
-       statusFalse (2) will be returned if the converter is not configured." 
-   ::= { dm3StatusConvEntry 11 }
-
-dm3StatusConvPcbRev OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter device PCB serial number."
-   ::= { dm3StatusConvEntry 12 }
-
-dm3StatusConvFwVer OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter device firmware version."
-   ::= { dm3StatusConvEntry 13 }
-
-dm3StatusConvPresent OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter is present.
-       statusFalse (2) will be returned if the converter is not present." 
-   ::= { dm3StatusConvEntry 14 }
-
-dm3StatusConvDiagPass OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter diagnostics have passed.
-       statusFalse (2) will be returned if the converter diagnostics have not passed." 
-   ::= { dm3StatusConvEntry 15 }
-
-dm3StatusConvState OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter state as defined by the device status register."
-   ::= { dm3StatusConvEntry 16 }
-
-dm3StatusSysConvVoltSanity OBJECT-TYPE
-   SYNTAX INTEGER{
-      saneYES              (1),
-      saneNO               (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Converter voltage sanity indicator.  Indicates if the converter voltage is 
-      reasonable.  Reasonable is defined based on powerplant type.  A value of saneYes (1)
-      indicates voltage is reasonable, a value of saneNo (2) indicates it is not."
-   ::= { dm3StatusConverter 3 }
-   
-dm3StatusSysConvAvailable OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the converter is available.
-       statusFalse (2) will be returned if the converter is not available." 
-   ::= { dm3StatusConverter 4 }
-   
-dm3StatusSysConvType OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the converter type."
-   ::= { dm3StatusConverter 5 }
-   
-dm3StatusSysConvVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the system level converter voltage in thousandths of volts (mV)."
-   ::= { dm3StatusConverter 6 }
-   
-dm3StatusSysConvCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the system level converter current in thousandths of Amps (mA)."
-   ::= { dm3StatusConverter 7 }
-
--- the dm3StatusOutputRelays group
-
-dm3StatusOutRlyTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant output relays viewable
-       by this IP address."
-   ::= { dm3StatusOutputRelays 1 }
-
-dm3StatusOutRlyTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusOutRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for viewing status of the output relays. The number of
-       entries is contained in the dm3StatusOutRlyTableSize OID."
-   ::= { dm3StatusOutputRelays 2 }     
-   
-dm3StatusOutRlyEntry OBJECT-TYPE
-   SYNTAX StatusOutRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The output relay to gather status from."
-   INDEX { dm3StatusOutRlyIndex }
-   ::= { dm3StatusOutRlyTable 1 }
-
-StatusOutRlyEntry ::=
-   SEQUENCE {
-      dm3StatusOutRlyIndex            INTEGER,
-      dm3StatusOutRlyName             DisplayString,
-      dm3StatusOutRlyStatus           INTEGER
-   }
-   
-dm3StatusOutRlyIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant output relay."
-   ::= { dm3StatusOutRlyEntry 1 }
-   
-dm3StatusOutRlyName OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the output relay. The maximum size is 
-       16 characters. The name is set by using the 
-       dm3ConfigOutRlyName OID.
-       This OID is provided for informational purposes only."       
-   ::= { dm3StatusOutRlyEntry 2 }
-   
-dm3StatusOutRlyStatus OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusOn          (1),
-      statusOff         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusOn (1) if the output relay is enabled/on.
-       statusOff (2) will be returned if the output relay is disabled/off." 
-   ::= { dm3StatusOutRlyEntry 3 }
-
-
--- the dm3StatusInputRelays group
-
-dm3StatusInRlyTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant input relays viewable
-       by this IP address."
-   ::= { dm3StatusInputRelays 1 }
-
-dm3StatusInRlyTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusInRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for viewing status of the input relays. The number of
-       entries is contained in the dm3StatusInRlyTableSize OID."
-   ::= { dm3StatusInputRelays 2 }      
-
-   
-dm3StatusInRlyEntry OBJECT-TYPE
-   SYNTAX StatusInRlyEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The input relays to gather status from."
-   INDEX { dm3StatusInRlyIndex }
-   ::= { dm3StatusInRlyTable 1 }
-   
-StatusInRlyEntry ::=
-   SEQUENCE {
-      dm3StatusInRlyIndex           INTEGER,
-      dm3StatusInRlyName            DisplayString,
-      dm3StatusInRlyStatus          INTEGER
-   }
-   
-dm3StatusInRlyIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant input relay."
-   ::= { dm3StatusInRlyEntry 1 }
-   
-dm3StatusInRlyName OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the input relay. The maximum size is 
-       16 characters. The name is set by using the 
-       dm3ConfigInRlyName OID.
-       This OID is provided for informational purposes only."       
-   ::= { dm3StatusInRlyEntry 2 }
-   
-dm3StatusInRlyStatus OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusOn          (1),
-      statusOff         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusOn (1) if the input relay is enabled/on.
-       statusOff (2) will be returned if the input relay is disabled/off." 
-   ::= { dm3StatusInRlyEntry 3 }
-
--- the dm3StatusBreakers group
-
-dm3StatusBreakersTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant circuit breakers viewable
-       by this IP address."
-   ::= { dm3StatusBreakers 1 }
-
-dm3StatusBreakersTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusBreakersEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for viewing status of the circuit breakers. The number of
-       entries is contained in the dm3StatusBreakersTableSize OID."
-   ::= { dm3StatusBreakers 2 }     
-
-dm3StatusBreakersEntry OBJECT-TYPE
-   SYNTAX StatusBreakersEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The circuit breaker to gather status from."
-   INDEX { dm3StatusBreakersIndex }
-   ::= { dm3StatusBreakersTable 1 }
-
-StatusBreakersEntry ::=
-   SEQUENCE {
-      dm3StatusBreakersIndex               INTEGER,
-      dm3StatusBreakersName                DisplayString,
-      dm3StatusBreakersStatus              INTEGER
-   }
-   
-dm3StatusBreakersIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant circuit breaker."
-   ::= { dm3StatusBreakersEntry 1 }
-   
-dm3StatusBreakersName OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the circuit breaker. The maximum size is 
-       16 characters. The name is set by using the 
-       dm3ConfigBreakersName OID.
-       This OID is provided for informational purposes only."       
-   ::= { dm3StatusBreakersEntry 2 }
-   
-dm3StatusBreakersStatus OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusClosed          (1),
-      statusOpen            (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusClosed (1) if the circuit breaker is closed.
-       statusOpen (2) will be returned if the circuit breaker is open." 
-   ::= { dm3StatusBreakersEntry 3 }
-   
--- the dm3StatusFuses group
-
-dm3StatusFusesTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant fuses controllable
-       by this IP address."
-   ::= { dm3StatusFuses 1 }
-
-dm3StatusFusesTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusFusesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for viewing status of the fuses. The number of
-       entries is contained in the dm3StatusFusesTableSize OID."
-   ::= { dm3StatusFuses 2 }    
-   
-dm3StatusFusesEntry OBJECT-TYPE
-   SYNTAX StatusFusesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The fuse to gather status from."
-   INDEX { dm3StatusFusesIndex }
-   ::= { dm3StatusFusesTable 1 }
-   
-StatusFusesEntry ::=
-   SEQUENCE {
-      dm3StatusFusesIndex               INTEGER,
-      dm3StatusFusesName                DisplayString,
-      dm3StatusFusesStatus              INTEGER
-   }
-
-dm3StatusFusesIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant fuse."
-   ::= { dm3StatusFusesEntry 1 }
-   
-dm3StatusFusesName OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the fuse. The maximum size is 
-       16 characters. The name is set by using the 
-       dm3ConfigFuseName OID.
-       This OID is provided for informational purposes only."       
-   ::= { dm3StatusFusesEntry 2 }
-
-dm3StatusFusesStatus OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusClosed          (1),
-      statusOpen            (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusClosed (1) if the fuse is closed.
-       statusOpen (2) will be returned if the fuse is open." 
-   ::= { dm3StatusFusesEntry 3 }
-
--- the atsIdent group
-
-atsIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware version of the Automatic Transfer Switch. 
-       This value is set at the factory."
-   ::= { atsIdent 1 }
-
-atsIdentFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A string identifying the Automatic Transfer Switch 
-       firmware version." 
-   ::= {  atsIdent 2 }
-
-atsIdentFirmwareDate OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date of release for this Automatic Transfer Switch 
-       firmware version. " 
-   ::= {  atsIdent 3 }
-
-atsIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the Automatic Transfer Switch was manufactured in mm/dd/yyyy format.
-       This value is set at the factory. " 
-   ::= { atsIdent 4 }
-   
-atsIdentModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A string identifying the model number of the Automatic Transfer Switch. 
-       This value is set at the factory."
-   ::= { atsIdent 5 }
-
-atsIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A string identifying the serial number of 
-       the Automatic Transfer Switch. This value is set at the factory."
-   ::= { atsIdent 6 }
-
-atsIdentNominalLineVoltage OBJECT-TYPE
-       SYNTAX     INTEGER 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-         "RMS Utility Voltage measured in V."
-       ::= { atsIdent 7 }
-
-atsIdentNominalLineFrequency OBJECT-TYPE
-       SYNTAX     INTEGER 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "Utility Power Frequency measured in Hz."
-       ::= { atsIdent 8 }
-
---  the atsCalibration group  
- 
--- Input Voltage Calibration Factor table
-
-   atsCalibrationNumInputs OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of inputs to this device."
-       ::= { atsCalibrationInput 1 }
-
-   atsCalibrationNumInputPhases OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of phases per input for this device."
-       ::= { atsCalibrationInput 2 }
-
-   atsCalibrationInputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSCalibrationInputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of phases per input line to this device."
-       ::= { atsCalibrationInput 3 }
-
-   atsCalibrationInputPhaseEntry OBJECT-TYPE
-       SYNTAX     ATSCalibrationInputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing calibration information applicable to a
-               particular input phase."
-       INDEX { atsCalibrationInputTableIndex, atsCalibrationInputPhaseTableIndex }
-       ::= { atsCalibrationInputTable 1 }
-
-   ATSCalibrationInputPhaseEntry ::= SEQUENCE {
-       atsCalibrationInputTableIndex         INTEGER,
-       atsCalibrationInputPhaseTableIndex    INTEGER,
-       atsLineVoltageCalibrationFactor       INTEGER
-   }
-
-   atsCalibrationInputTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input identifier."
-       ::= { atsCalibrationInputPhaseEntry 1 }
-
-   atsCalibrationInputPhaseTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input phase identifier."
-       ::= { atsCalibrationInputPhaseEntry 2 }
-
-   atsLineVoltageCalibrationFactor  OBJECT-TYPE
-       SYNTAX INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The Line Voltage Calibration factor.
-                This value is set at the factory."
-       ::= { atsCalibrationInputPhaseEntry 3 }
-
--- Power Supply Voltage Calibration table
-
-   atsCalibrationPowerSupplyVoltages OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of power supply voltages supported by this device.
-                This variable indicates the number of rows in the
-                atsCalibrationPowerSupplyTable. There is one entry per
-                supported voltage: 24V, 12V and 5V"
-       ::= { atsCalibrationPowerSupply 1 }
-
-   atsCalibrationPowerSupplyVoltageTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSCalibrationPowerSupplyVoltageEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of Power Supply table entries."
-       ::= { atsCalibrationPowerSupply 2 }
-
-   atsCalibrationPowerSupplyVoltageEntry OBJECT-TYPE
-       SYNTAX     ATSCalibrationPowerSupplyVoltageEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular Power Supply Voltage."
-       INDEX { atsCalibrationPowerSupplyVoltageTableIndex }
-       ::= { atsCalibrationPowerSupplyVoltageTable 1 }
-
-   ATSCalibrationPowerSupplyVoltageEntry ::= SEQUENCE {
-       atsCalibrationPowerSupplyVoltageTableIndex     INTEGER,
-       atsCalibrationPowerSupplyVoltage               INTEGER,
-       atsPowerSupplyVoltageCalibrationFactor         INTEGER
-   }
-
-   atsCalibrationPowerSupplyVoltageTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-           "The power supply voltage identifier.
-            Three power supply voltages are supported by the ATS:
-             24V , 12V and 5V .
-            The value of this index indicates the power supply voltage:
-             1 = 24V
-             2 = 12V
-             3 = 5V"
-       ::= { atsCalibrationPowerSupplyVoltageEntry 1 }
-
-  atsCalibrationPowerSupplyVoltage OBJECT-TYPE
-    SYNTAX INTEGER  {
-      powerSupply24V(1),
-      powerSupply12V(2),
-      powerSupply(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This value describes the power supply voltage."
-   ::= { atsCalibrationPowerSupplyVoltageEntry 2 } 
-
-   atsPowerSupplyVoltageCalibrationFactor  OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The Line Voltage Calibration factor.
-                This value is set at the factory."
-       ::= { atsCalibrationPowerSupplyVoltageEntry 3 }
-
--- Output Current Calibration table
-
-   atsCalibrationNumOutputs OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of output lines from this device.
-               This variable indicates the number of rows in the
-               atsCalibrationOutputTable."
-       ::= { atsCalibrationOutput 1 }
-
-   atsCalibrationNumOutputPhases OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of output phases utilized in this
-               device."
-       ::= { atsCalibrationOutput 2 }
-
-   atsCalibrationOutputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSCalibrationOutputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of output table entries."
-       ::= { atsCalibrationOutput 3 }
-
-   atsCalibrationOutputEntry OBJECT-TYPE
-       SYNTAX     ATSCalibrationOutputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-                particular output."
-       INDEX { atsCalibrationOutputTableIndex, atsCalibrationOutputPhasesTableIndex }
-       ::= { atsCalibrationOutputTable 1 }
-
-   ATSCalibrationOutputEntry ::= SEQUENCE {
-       atsCalibrationOutputTableIndex       INTEGER,
-       atsCalibrationOutputPhasesTableIndex INTEGER,
-       atsOutputCurrentCalibrationFactor    INTEGER
-   }
-
-   atsCalibrationOutputTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output identifier."
-       ::= { atsCalibrationOutputEntry 1 }
-
-   atsCalibrationOutputPhasesTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3),
-          neutral(4)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "Description of each calibration factor for each 
-                output phase utilized in this device and one for neutral. "
-       ::= { atsCalibrationOutputEntry 2 }
-
-   atsOutputCurrentCalibrationFactor OBJECT-TYPE
-       SYNTAX     INTEGER 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output current calibration factor measured in Amps."
-       ::= { atsCalibrationOutputEntry 3 }
-
-
---  the atsControl group  
-           
-atsControlResetATS OBJECT-TYPE
-    SYNTAX INTEGER  {
-          none(1),
-          reset(2) 
-   } 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable will cause the Automatic Transfer Switch to 
-       perform a power-on reset."
-   ::= { atsControl 1 }
-
-atsControlClearAllAlarms OBJECT-TYPE
-    SYNTAX INTEGER  {
-          none(1),
-          clear(2) 
-   } 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable will clear all alarms in the Automatic Transfer Switch."
-   ::= { atsControl 2 }  
-
---  the atsConfig group
-  
-atsConfigProductName OBJECT-TYPE
-       SYNTAX     DisplayString
-       ACCESS     read-write
-       STATUS     mandatory
-       DESCRIPTION
-               "A configurable character string."
-       ::= { atsConfig 1 }
-           
-atsConfigPreferredSource OBJECT-TYPE
-    SYNTAX INTEGER  {
-      sourceA(1),
-      sourceB(2),
-      none(3)
-   } 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the preferred source of power when both sources are OK."
-   ::= { atsConfig 2 } 
-
-atsConfigFrontPanelLockout OBJECT-TYPE
-   SYNTAX INTEGER  {
-      disableFrontPanel(1),
-      enableFrontPanel(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Setting this variable to disableFrontPanel(1) will disallow source 
-       preference configuration of the Automatic Transfer Switch via the
-       Front Panel. Once this value is set, it can only be re-enabled through
-       the serial interface of the ATS.
-       When this variable is set to enableFrontPanel(2), source preference 
-       configuration of the Automatic Transfer Switch via the Front Panel
-       is allowed."
-   ::= { atsConfig 3 }
-
-atsConfigVoltageSensitivity OBJECT-TYPE
-   SYNTAX INTEGER {
-      high(1),
-      low(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This variable defines the sensitivity to changes in voltage: 
-       high(1) for best protection, low(2) for frequent small line 
-       voltage changes."
-   ::= { atsConfig 4 }
-
-atsConfigTransferVoltageRange OBJECT-TYPE
-   SYNTAX INTEGER {
-      wide(1),
-      medium(2),
-      narrow(3)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This variable defines the range of acceptable voltage from a power source.
-       If the voltage measured from the selected input source is not within this
-       range, the Automatic Transfer Switch will switch over (transfer) to the 
-       alternate power source."
-
-   ::= { atsConfig 5 }
-
-atsConfigCurrentLimit OBJECT-TYPE
-   SYNTAX INTEGER (0..20)
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The threshold (in Amps) at which an Over Current Alarm will be generated."
-      
-   ::= { atsConfig 6 }
-
-
-atsConfigResetValues OBJECT-TYPE
-   SYNTAX INTEGER {
-      none(1),
-      reset(2) 
-   }
-   ACCESS     read-write
-   STATUS     mandatory
-   DESCRIPTION
-      "Resets the ATS configuration to its default values."
-
-   ::= { atsConfig 7 }
-
--- the atsStatus  group
-
-   atsStatusCommStatus OBJECT-TYPE
-    SYNTAX INTEGER  {
-      atsNeverDiscovered(1),
-      atsCommEstablished(2),
-      atsCommLost(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the current communication status
-       of the Automatic Transfer Switch. "
-   ::= { atsStatusDeviceStatus 1 }
-
-   atsStatusSelectedSource OBJECT-TYPE
-    SYNTAX INTEGER  {
-      sourceA(1),
-      sourceB(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the current source of power. "
-   ::= { atsStatusDeviceStatus 2 }
-
-   atsStatusRedundancyState OBJECT-TYPE
-    SYNTAX INTEGER  {
-       atsRedundancyLost(1),
-       atsFullyRedundant(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the current redundancy state of the ATS.
-       atsRedundancyLost(1) indicates that the ATS is unable to
-       switch over to the alternate power source if the current source fails.
-       atsFullyRedundant(2) indicates that the ATS will switch over to 
-       the alternate power source if the current source fails."
-   ::= { atsStatusDeviceStatus 3 }
-
-  atsStatusOverCurrentState OBJECT-TYPE
-    SYNTAX INTEGER  {
-        atsOverCurrent(1),
-        atsCurrentOK(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the output current state of the ATS.
-      atsOverCurrent(1) indicates that the ATS has exceeded the output 
-      current threshold and will not allow a switch over to the alternate power
-      source if the current source fails.
-      atsCurrentOK(2) indicates that the output current is below the 
-      output current threshold."
-   ::= { atsStatusDeviceStatus 4 }
-
-  atsStatus5VPowerSupply OBJECT-TYPE
-    SYNTAX INTEGER {
-        atsPowerSupplyFailure(1), 
-        atsPowerSupplyOK(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the current state of the ATS 5-volt power supply.
-       atsPowerSupplyFailure(1) indicates the 5-volt power supply has failed
-       and that the ATS serial port Configuration Menu is not accessible .
-       atsPowerSupplyOK(2) indicates that the ATS 5-volt power supply
-       is operating within tolerance."
-   ::= { atsStatusDeviceStatus 5 }
-
-  atsStatus24VPowerSupply OBJECT-TYPE
-    SYNTAX INTEGER  {
-        atsPowerSupplyFailure(1),
-        atsPowerSupplyOK(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This variable returns the current state of the ATS 24-volt power supply.
-       atsPowerSupplyFailure(1) indicates the 24-volt power supply has failed
-       and the ATS is unable to switch over to the alternate power source if 
-       the current source fails.
-       atsPowerSupplyOK(2) indicates that the ATS 24-volt power supply
-       is operating within tolerance."
-   ::= { atsStatusDeviceStatus 6 }
-
-   atsStatusResetMaxMinValues OBJECT-TYPE
-       SYNTAX INTEGER {
-          none(1),
-          reset(2) 
-       }
-       ACCESS     read-write
-       STATUS     mandatory
-       DESCRIPTION
-               "Resets the maximum and minimum ATS values:
-                atsInputMaxVoltage,       atsInputMinVoltage,
-                atsInputMaxCurrent,       atsInputMinCurrent,
-                atsInputMaxPower,         atsInputMinPower,
-                atsOutputMaxCurrent,      atsOutputMinCurrent,
-                atsOutputMaxLoad,         atsOutputMinLoad,
-                atsOutputMaxPercentLoad,  atsOutputMinPercentLoad,
-                atsOutputMaxPower,        atsOutputMinPower,
-                atsOutputMaxPercentPower, atsOutputMinPercentPower.
-                These variables represent the maximum and minimum ATS values
-                since the last time they were read or reset by this OID.
-                Values unsupported by this ATS will return (-1)."
-       ::= { atsStatusResetValues 1 }
-
---
--- Input Group
---
-
--- Number of Inputs
-
-   atsNumInputs OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of input feeds to this device.
-               This variable indicates the number of rows in the
-               input table."
-       ::= { atsStatusInput 1 }
-
--- Input Table
-
-   atsInputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSPhaseInputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of input table entries.  The number of entries
-               is given by the value of atsNumInputs."
-       ::= { atsStatusInput 2 }
-
-   atsInputEntry OBJECT-TYPE
-       SYNTAX     ATSPhaseInputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular input."
-       INDEX { atsInputTableIndex }
-       ::= { atsInputTable 1 }
-
-   ATSPhaseInputEntry ::= SEQUENCE {
-       atsInputTableIndex         INTEGER,
-       atsNumInputPhases          INTEGER,
-       atsInputVoltageOrientation INTEGER,
-       atsInputFrequency          INTEGER,
-       atsInputType               INTEGER,
-       atsInputName               DisplayString
-   }
-
-   atsInputTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input identifier."
-       ::= { atsInputEntry 1 }
-
-   atsNumInputPhases OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of input phases utilized in this
-               device.  The sum of all the atsNumInputPhases
-               variable indicates the number of rows in the 
-               input phase table."
-       ::= { atsInputEntry 2 }
-
-   atsInputVoltageOrientation OBJECT-TYPE
-       SYNTAX INTEGER {
-          unknown(1),
-          singlePhase(2),
-          splitPhase(3),
-          threePhasePhaseToNeutral(4),
-          threePhasePhaseToPhase(5)
-       }
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input voltage orientation: 
-               1: unknown for this Source
-               2: singlePhase - phase 1 voltage is between Phase 1
-               and Neutral.
-               3: splitPhase - phase 1 voltage is between Phase 1 and 
-               Neutral; phase 2 voltage is between Phase 2 and Neutral; 
-               phase 3 voltage is between Phase 1 and Phase2.
-               4: threePhasePhaseToNeutral - phase 1 voltage is between
-               Phase 1 and Neutral; phase 2 voltage is between Phase 2 
-               and Neutral; phase 3 voltage is between Phase3 and
-               Neutral.
-               5: threePhasePhaseToPhase - phase 1 voltage is between 
-               Phase 1 and Phase 2; phase 2 voltage is between Phase 2
-               and Phase 3; phase 3 voltage is between Phase 3 and
-               Phase 1."
-       ::= { atsInputEntry 3 }
-
-   atsInputFrequency OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input frequency in Hertz, or -1 if it's unsupported
-               by this Source."
-       ::= { atsInputEntry 4 }
-
-   atsInputType OBJECT-TYPE
-       SYNTAX     INTEGER {
-          unknown(1),
-          main(2),
-          bypass(3)
-       }
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input type."
-       ::= { atsInputEntry 5 }
-
-   atsInputName OBJECT-TYPE
-       SYNTAX     DisplayString
-       ACCESS     read-write
-       STATUS     mandatory
-       DESCRIPTION
-               "A name given to a particular input."
-       ::= { atsInputEntry 6 }
-
--- Input Phase Table
-
-   atsInputPhaseTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSPhaseInputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of input table entries.  The number of entries
-               is given by the sum of the atsNumInputPhases."
-       ::= { atsStatusInput 3 }
-
-   atsInputPhaseEntry OBJECT-TYPE
-       SYNTAX     ATSPhaseInputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular input phase."
-       INDEX { atsInputPhaseTableIndex, atsInputPhaseIndex }
-       ::= { atsInputPhaseTable 1 }
-
-   ATSPhaseInputPhaseEntry ::= SEQUENCE {
-       atsInputPhaseTableIndex    INTEGER,
-       atsInputPhaseIndex         INTEGER,
-       atsInputVoltage            INTEGER,
-       atsInputMaxVoltage         INTEGER,
-       atsInputMinVoltage         INTEGER,
-       atsInputCurrent            INTEGER,
-       atsInputMaxCurrent         INTEGER,
-       atsInputMinCurrent         INTEGER,
-       atsInputPower              INTEGER,
-       atsInputMaxPower           INTEGER,
-       atsInputMinPower           INTEGER
-   }
-
-   atsInputPhaseTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input identifier."
-       ::= { atsInputPhaseEntry 1 }
-
-   atsInputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input phase identifier."
-       ::= { atsInputPhaseEntry 2 }
-
-   atsInputVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input voltage in VAC, or -1 if it's unsupported
-               by this Source."
-       ::= { atsInputPhaseEntry 3 }
-
-   atsInputMaxVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum input voltage in VAC measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsInputPhaseEntry 4 }
-
-   atsInputMinVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum input voltage in VAC measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsInputPhaseEntry 5 }
-
-   atsInputCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input current in amperes, or -1 if it's
-               unsupported by this Source."
-       ::= { atsInputPhaseEntry 6 }
-
-   atsInputMaxCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum input current in amperes measured
-                 since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsInputPhaseEntry 7 }
-
-   atsInputMinCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum input current in amperes measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsInputPhaseEntry 8 }
-
-   atsInputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The input power in Watts, or -1 if it's unsupported
-               by this Source."
-       ::= { atsInputPhaseEntry 9 }
-
-   atsInputMaxPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum input power in Watts measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsInputPhaseEntry 10 }
-
-   atsInputMinPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum input power in Watts measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsInputPhaseEntry 11 }
-
-   --
-   -- The Output group.
-   --
-
-   -- Number of Outputs
-
-   atsNumOutputs OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of output feeds to this device.
-               This variable indicates the number of rows in the
-               output table."
-       ::= { atsStatusOutput 1 }
-
-   -- Output Table
-
-   atsOutputTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSPhaseOutputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of output table entries.  The number of entries
-               is given by the value of atsOutputNumPhases."
-       ::= { atsStatusOutput 2 }
-
-   atsOutputEntry OBJECT-TYPE
-       SYNTAX     ATSPhaseOutputEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular output."
-       INDEX { atsOutputTableIndex }
-       ::= { atsOutputTable 1 }
-
-   ATSPhaseOutputEntry ::= SEQUENCE {
-       atsOutputTableIndex         INTEGER,
-       atsNumOutputPhases          INTEGER,
-       atsOutputVoltageOrientation INTEGER,
-       atsOutputFrequency          INTEGER
-   }
-
-   atsOutputTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output identifier."
-       ::= { atsOutputEntry 1 }
-
-   atsNumOutputPhases OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The number of output phases utilized in this
-               device.  The sum of all the atsNumOutputPhases
-               variable indicates the number of rows in the 
-               output phase table."
-       ::= { atsOutputEntry 2 }
-
-   atsOutputVoltageOrientation OBJECT-TYPE
-       SYNTAX INTEGER {
-          unknown(1),
-          singlePhase(2),
-          splitPhase(3),
-          threePhasePhaseToNeutral(4),
-          threePhasePhaseToPhase(5)
-       }
-       ACCESS read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output voltage orientation: 
-               1: unknown for this ATS
-               2: singlePhase - phase 1 voltage is between Phase 1
-               and Neutral.
-               3: splitPhase - phase 1 voltage is between Phase 1 and 
-               Neutral; phase 2 voltage is between Phase 2 and Neutral; 
-               phase 3 voltage is between Phase 1 and Phase2.
-               4: threePhasePhaseToNeutral - phase 1 voltage is between
-               Phase 1 and Neutral; phase 2 voltage is between Phase 2 
-               and Neutral; phase 3 voltage is between Phase3 and
-               Neutral.
-               5: threePhasePhaseToPhase - phase 1 voltage is between 
-               Phase 1 and Phase 2; phase 2 voltage is between Phase 2
-               and Phase 3; phase 3 voltage is between Phase 3 and
-               Phase 1."
-       ::= { atsOutputEntry 3 }
-
-   atsOutputFrequency OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output frequency in Hertz, or -1 if it's
-               unsupported by this ATS."
-       ::= { atsOutputEntry 4 }
-
-   -- Output Phase Table
-
-   atsOutputPhaseTable OBJECT-TYPE
-       SYNTAX     SEQUENCE OF ATSPhaseOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "A list of output table entries.  The number of
-               entries is given by the sum of the atsNumOutputPhases."
-       ::= { atsStatusOutput 3 }
-
-   atsOutputPhaseEntry OBJECT-TYPE
-       SYNTAX     ATSPhaseOutputPhaseEntry
-       ACCESS     not-accessible
-       STATUS     mandatory
-       DESCRIPTION
-               "An entry containing information applicable to a
-               particular output phase."
-       INDEX { atsOutputPhaseTableIndex, atsOutputPhaseIndex }
-       ::= { atsOutputPhaseTable 1 }
-
-   ATSPhaseOutputPhaseEntry ::= SEQUENCE {
-       atsOutputPhaseTableIndex INTEGER,
-       atsOutputPhaseIndex      INTEGER,
-       atsOutputVoltage         INTEGER,
-       atsOutputCurrent         INTEGER,
-       atsOutputMaxCurrent      INTEGER,
-       atsOutputMinCurrent      INTEGER,
-       atsOutputLoad            INTEGER,
-       atsOutputMaxLoad         INTEGER,
-       atsOutputMinLoad         INTEGER,
-       atsOutputPercentLoad     INTEGER,
-       atsOutputMaxPercentLoad  INTEGER,
-       atsOutputMinPercentLoad  INTEGER,       
-       atsOutputPower           INTEGER,
-       atsOutputMaxPower        INTEGER,
-       atsOutputMinPower        INTEGER,
-       atsOutputPercentPower    INTEGER,
-       atsOutputMaxPercentPower INTEGER,
-       atsOutputMinPercentPower INTEGER
-   }
-
-   atsOutputPhaseTableIndex OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output identifier."
-       ::= { atsOutputPhaseEntry 1 }
-
-   atsOutputPhaseIndex OBJECT-TYPE
-       SYNTAX     INTEGER{
-          phase1(1),
-          phase2(2),
-          phase3(3),
-          neutral(4)
-         } 
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-              "Description of each output phase utilized in 
-               this device and one for neutral. "
-       ::= { atsOutputPhaseEntry 2 }
-
-   atsOutputVoltage OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output voltage in VAC, or -1 if it's unsupported
-               by this ATS."
-       ::= { atsOutputPhaseEntry 3 }
-
-   atsOutputCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output current in 0.1 amperes drawn 
-               by the load on the ATS, or -1 if it's unsupported
-               by this ATS."
-       ::= { atsOutputPhaseEntry 4 }
-
-   atsOutputMaxCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum output current in 0.1 amperes measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 5 }
-
-   atsOutputMinCurrent OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum output current in 0.1 amperes measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 6 }
-
-   atsOutputLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output load in VA, or -1 if it's unsupported
-               by this ATS."
-       ::= { atsOutputPhaseEntry 7 }
-
-   atsOutputMaxLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum output load in VA measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1)  if unsupported."
-       ::= { atsOutputPhaseEntry 8 }
-
-   atsOutputMinLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum output load in VA measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 9 }
-
-   atsOutputPercentLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The percentage of the ATS load capacity in VA at 
-               redundancy @ (n + x) presently being used on this 
-               output phase, or -1 if it's unsupported by this ATS."
-       ::= { atsOutputPhaseEntry 10 }
-
-   atsOutputMaxPercentLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum percentage of the ATS load capacity in 
-               VA measured at redundancy @ (n + x) presently 
-               being used on this output phase since the last time
-               this variable was read or reset (atsStatusResetMaxMinValues).
-               Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 11 }
-
-   atsOutputMinPercentLoad OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum percentage of the ATS load capacity in 
-               VA measured at redundancy @ (n + x) presently 
-               being used on this output phase since the last time
-               this variable was read or reset (atsStatusResetMaxMinValues).
-               Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 12 }
-
-   atsOutputPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The output power in Watts, or -1 if it's
-               unsupported by this ATS."
-       ::= { atsOutputPhaseEntry 13 }
-
-   atsOutputMaxPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum output power in Watts measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 14 }
-
-   atsOutputMinPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum output power in Watts measured
-                since the last time this variable was read 
-                or reset (atsStatusResetMaxMinValues).
-                Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 15 }
-
-   atsOutputPercentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The percentage of the ATSpower capacity in Watts at 
-               redundancy @ (n + x) presently being used on this 
-               output phase, or -1 if it's unsupported by this ATS."
-       ::= { atsOutputPhaseEntry 16 }
-
-   atsOutputMaxPercentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The maximum percentage of the ATSpower capacity
-               in Watts measured at redundancy @ (n + x) presently
-               being used on this output phase since the last time
-               this variable was read or reset (atsStatusResetMaxMinValues).
-               Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 17 }
-
-   atsOutputMinPercentPower OBJECT-TYPE
-       SYNTAX     INTEGER
-       ACCESS     read-only
-       STATUS     mandatory
-       DESCRIPTION
-               "The minimum percentage of the ATSpower capacity
-               in Watts measured at redundancy @ (n + x) presently
-               being used on this output phase since the last time
-               this variable was read or reset (atsStatusResetMaxMinValues).
-               Returns (-1) if unsupported."
-       ::= { atsOutputPhaseEntry 18 }
-
--- the dcmim2IdentSystem group
- 
-dcmim2IdentSysFWVersion OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Integer representation of the power plant Master Controller firmware revision."
-   ::= { dcmim2IdentSystem 1 }
-
-
--- the dcmim2ControlSystem group
-
-dcmim2ControlRunFunctBatteryTest OBJECT-TYPE
-   SYNTAX INTEGER {
-      battTestOff             (1),
-      battTestOn              (2)
-}     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this OID will return the battery functional test state. If 
-       the test is off, the battTestOff (1) value will be returned.
-       If the test is on, the battTestOn (2) value will be
-       returned.  
-       
-       Setting this OID to battTestOff (1) will turn the battery functional test off.
-       Setting this OID to battTestOn (2) will turn the battery functional test on."
-
-   ::= { dcmim2ControlSystem 1 }
-
-dcmim2ControlRunCapacityBatteryTest OBJECT-TYPE
-   SYNTAX INTEGER {
-      battTestOff             (1),
-      battTestOn              (2)
-}     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this OID will return the battery capacity test state. If 
-       the test is off, the battTestOff (1) value will be returned.
-       If the test is on, the battTestOn (2) value will be
-       returned.  
-       
-       Setting this OID to battTestOff (1) will turn the battery capacity test off.
-       Setting this OID to battTestOn (2) will turn the battery capacity test on."
-
-   ::= { dcmim2ControlSystem 2 }
-
-
--- the dcmim2ConfigSystem group
-
-dcmim2ConfigSysHighTempTrip OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Trip level (threshold) at which System High Temp alarm condition is created. 
-       Range 28 to 100 (degC).
-
-       Values are represented in thousandths of a degree.
-       Units are displayed in the scale shown in
-       the 'dcmim2StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-       
-      
-   ::= { dcmim2ConfigSystem 1 }
-
-dcmim2ConfigSysHighTempReset OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Level at which System High Temp alarm condition is reset (cleared). 
-       Range 25 to (upper temp - 3) (degC).
-       
-       Values are represented in thousandths of a degree.
-       Units are displayed in the scale shown in
-       the 'dcmim2StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-       
-   ::= { dcmim2ConfigSystem 2 }
-      
-dcmim2ConfigSysLowTempTrip OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Trip level (threshold) at which System Low Temp alarm condition is created. 
-       Range -100 to 10 (degC).
-       Values are represented in thousandths of a degree.
-       Units are displayed in the scale shown in
-       the 'dcmim2StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-      
-   ::= { dcmim2ConfigSystem 3 }
-
-dcmim2ConfigSysLowTempReset OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Level at which System Low Temp alarm condition is reset (cleared). 
-       Range (lower temp + 3) to 13 (degC).
-       Values are represented in thousandths of a degree.
-       Units are displayed in the scale shown in
-       the 'dcmim2StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-      
-   ::= { dcmim2ConfigSystem 4 }
-
--- the dcmim2ConfigBattery group
-
-dcmim2ConfigBattFloatVolt OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Float Voltage defined at 25 degrees Celsius.
-      
-      Values are represented in thousandths of Volts (mV)."
-      
-   ::= { dcmim2ConfigBattery 1 }
-
-dcmim2ConfigBattMaxRecharge OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Maximum Recharge Rate.  This is the maximum current used
-       during battery charging.  
-      
-      Values are represented in thousandths of Amps (mA)."
-      
-   ::= { dcmim2ConfigBattery 2 }
-
-dcmim2ConfigBattMfgCapacity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Battery capacity (Amp-Hour Size) as specified by the battery manufacturer.
-  
-      Values are represented in thousandths of Amp hours (mAHr)."
-      
-   ::= { dcmim2ConfigBattery 3 }
-   
-dcmim2ConfigBattType OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Type of battery in the powerplant
-      
-      Valid values range from 0 to 254."
-      
-   ::= { dcmim2ConfigBattery 4 }
-   
-dcmim2ConfigBattFunctTestDuration OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Duration of the battery functional test.
-      
-      Values are represented in thousandths of seconds (mSecs)."
-      
-   ::= { dcmim2ConfigBattery 5 }
-   
-dcmim2ConfigBattFunctTestThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold the battery voltage of the system must remain above
-       in order to pass the battery functional test.
-      
-      Values are represented in thousandths of Volts (mV)."
-      
-   ::= { dcmim2ConfigBattery 6 }
-   
-dcmim2ConfigBattCapacityTestPercent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Threshold for good battery capacity test results.
-      
-      Values range from 0 to 100 percent."
-      
-   ::= { dcmim2ConfigBattery 7 }
-   
-dcmim2ConfigBattCapacityTestEndThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Safeguard voltage at which battery capacity test will end 
-       if there is a battery problem.
-      
-      Values are represented in thousandths of Volts (mV)."
-      
-   ::= { dcmim2ConfigBattery 8 }
-   
-dcmim2ConfigBattCapacityTestCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Constant current value used during battery capacity testing.
-      
-      Values are represented in thousandths of Amps (mA)."
-      
-   ::= { dcmim2ConfigBattery 9 }
-
-
--- the dcmim2ConfigLVD group
-
-dcmim2ConfigLVDTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant LVDs controllable
-       by this IP address."
-   ::= { dcmim2ConfigLVD 1 }
-
-dcmim2ConfigLVDTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF DC2ConfigLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the LVDs. The number of
-       entries is contained in the dcmim2ConfigLVDTableSize OID."
-   ::= { dcmim2ConfigLVD 2 }      
-
-dcmim2ConfigLVDEntry OBJECT-TYPE
-   SYNTAX DC2ConfigLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The LVD to configure."
-   INDEX { dcmim2ConfigLVDIndex }
-   ::= { dcmim2ConfigLVDTable 1 }
-   
-DC2ConfigLVDEntry ::=
-   SEQUENCE {
-      dcmim2ConfigLVDIndex               INTEGER,
-      dcmim2ConfigLVDTrip                INTEGER,
-      dcmim2ConfigLVDReset               INTEGER,
-      dcmim2ConfigLVDState               INTEGER
-   }
-   
-dcmim2ConfigLVDIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant LVD."
-   ::= { dcmim2ConfigLVDEntry 1 }
-
-dcmim2ConfigLVDTrip OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "LVD Trip threshold.  System bus voltage at which LVD will trip (open)
-       during a battery backup operation.
-      
-      Values are represented in thousandths of Volts (mV)."
-   ::= { dcmim2ConfigLVDEntry 2 }
-
-dcmim2ConfigLVDReset OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "LVD Reset threshold.  System bus voltage at which LVD will reset (close)
-       after AC power has been restored.
-      
-      Values are represented in thousandths of Volts (mV)."
-   ::= { dcmim2ConfigLVDEntry 3 }
-   
-dcmim2ConfigLVDState OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusClosed             (1),
-      statusOpened             (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusClosed (1) if the LVD is closed.
-       statusOpened (2) will be returned if the LVD is opened." 
-   ::= { dcmim2ConfigLVDEntry 4 }
-
-
--- the dcmim2StatusSystem group
-
-dcmim2StatusSysRectCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "System (Total Rectifier) current in thousandths of Amps (mA)."
-   ::= { dcmim2StatusSystem 1 }
-
-dcmim2StatusSysLoadCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Load current in thousandths of Amps (mA)."
-   ::= { dcmim2StatusSystem 2 }
-
-dcmim2StatusSysBusVoltage OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "System bus voltage in thousandths of Volts (mV)."
-   ::= { dcmim2StatusSystem 3 }
-
-dcmim2StatusSysAmbientTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "System temperature based on sensor on Master Controller PCB.
-      
-      Values are represented in thousandths of a degree.
-      Units are displayed in the scale shown in
-      the 'dcmim2StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-   ::= { dcmim2StatusSystem 4 }
-
-dcmim2StatusSysUpTime OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Length of time since the DC Powerplant controller has been powered up."
-   ::= { dcmim2StatusSystem 5 }
-
-dcmim2StatusSysTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       in the DC system, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { dcmim2StatusSystem 6 }
-
-
--- the dcmim2StatusRectifier group
-
-dcmim2StatusRectTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant rectifiers viewable
-       by this IP address."
-   ::= { dcmim2StatusRectifier 1 }
-
-dcmim2StatusRectTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF DC2StatusRectEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing settings of the rectifiers. The number of
-       entries is contained in the dcmim2StatusRectTableSize OID."
-   ::= { dcmim2StatusRectifier 2 }    
-
-dcmim2StatusRectEntry OBJECT-TYPE
-   SYNTAX DC2StatusRectEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The rectifier to gather status from."
-   INDEX { dcmim2StatusRectIndex }
-   ::= { dcmim2StatusRectTable 1 }
-   
-DC2StatusRectEntry ::=
-   SEQUENCE {
-      dcmim2StatusRectIndex            INTEGER,
-      dcmim2StatusRectDevType          INTEGER,
-      dcmim2StatusRectID               INTEGER,
-      dcmim2StatusRectPhyAddr          INTEGER,
-      dcmim2StatusRectFail             INTEGER,
-      dcmim2StatusRectCurrent          INTEGER
-   }
-
-dcmim2StatusRectIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant rectifier."
-   ::= { dcmim2StatusRectEntry 1 }
-
-dcmim2StatusRectDevType OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier device type."
-   ::= { dcmim2StatusRectEntry 2 }
-
-dcmim2StatusRectID OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier ID.  This enumerates the number of the rectifier within 
-       a group of rectifiers."
-   ::= { dcmim2StatusRectEntry 3 }
-
-dcmim2StatusRectPhyAddr OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the rectifier physical address (the address on the bus)."
-   ::= { dcmim2StatusRectEntry 4 }
-
-dcmim2StatusRectFail    OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusTrue          (1),
-      statusFalse         (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusTrue (1) if the rectifier has failed.
-       statusFalse (2) will be returned if the rectifier has not failed." 
-   ::= { dcmim2StatusRectEntry 5 }
-
-dcmim2StatusRectCurrent OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID shows the individual rectifier current in thousandths of Amps (mA)."
-   ::= { dcmim2StatusRectEntry 6 }
-
-
--- the dcmim2StatusBattery group
-
-dcmim2StatusBattFloatVolt OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Float Voltage represented in thousandths of Volts (mV)."   
-   ::= { dcmim2StatusBattery 1 }
-
-dcmim2StatusBattCurrent OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Current:  This OID shows the battery current in thousandths of Amps (mA)."
-   ::= { dcmim2StatusBattery 2 }
-
-dcmim2StatusBattTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery Temperature:  
-      
-       Values are represented in thousandths of a degree.
-       Units are displayed in the scale shown in
-       the 'dcmim2StatusSysTempUnits' OID (Celsius or Fahrenheit)."
-   ::= { dcmim2StatusBattery 3 }
-
-dcmim2StatusBattMfgCapacity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery capacity (Amp-Hour Size) as specified by the battery manufacturer.
-      Values are represented in thousandths of Amp hours (mAHr)."
-   ::= { dcmim2StatusBattery 4 }
-
-dcmim2StatusBattTestCapacity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Battery capacity (Amp-Hour Size) as determined by the battery capacity test.  
-      Values are represented in thousandths of Amp hours (mAHr)."     
-   ::= { dcmim2StatusBattery 5 }
-
-dcmim2StatusBattFunctTestResult OBJECT-TYPE
-   SYNTAX INTEGER{
-      functTestNotPerformed   (1),
-      functTestInProcess      (2),
-      functTestInterrupted    (3),
-      functTestPass           (4),
-      functTestFail           (5)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Results of the last battery functional test that was run."
-   ::= { dcmim2StatusBattery 6 }
-
-dcmim2StatusBattCapacityTestResult OBJECT-TYPE
-   SYNTAX INTEGER{
-      capacityTestNotPerformed   (1),
-      capacityTestInProcess      (2),
-      capacityTestInterrupted    (3),
-      capacityTestPass           (4),
-      capacityTestFail            (5)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Results of the last battery capacity test that was run."
-   ::= { dcmim2StatusBattery 7 }
-
-
--- the dcmim2StatusLVD group
-
-dcmim2StatusLVDTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant LVDs accessible
-       by this IP address."
-   ::= { dcmim2StatusLVD 1 }
-
-dcmim2StatusLVDTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF DC2StatusLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing the LVDs. The number of
-       entries is contained in the dcmim2StatusLVDTableSize OID."
-   ::= { dcmim2StatusLVD 2 }      
-
-dcmim2StatusLVDEntry OBJECT-TYPE
-   SYNTAX DC2StatusLVDEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The LVD to access."
-   INDEX { dcmim2StatusLVDIndex }
-   ::= { dcmim2StatusLVDTable 1 }
-   
-DC2StatusLVDEntry ::=
-   SEQUENCE {
-      dcmim2StatusLVDIndex               INTEGER,
-      dcmim2StatusLVDState               INTEGER
-   }
-   
-dcmim2StatusLVDIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the DC powerplant LVD."
-   ::= { dcmim2StatusLVDEntry 1 }
-  
-dcmim2StatusLVDState OBJECT-TYPE
-   SYNTAX INTEGER       {
-      statusClosed             (1),
-      statusOpened             (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Getting this OID will return statusClosed (1) if the LVD is closed.
-       statusOpened (2) will be returned if the LVD is opened." 
-   ::= { dcmim2StatusLVDEntry 2 }
-
-
--- the dcmim2StatusAlarms group
-
-dcmim2StatusAlarmsTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of DC powerplant alarms viewable
-       by this IP address."
-   ::= { dcmim2StatusAlarms 1 }
-
-dcmim2StatusAlarmsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF DC2StatusAlarmsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for accessing system alarms. The number of
-       entries is contained in the dcmim2StatusAlarmsTableSize OID."
-   ::= { dcmim2StatusAlarms 2 }       
-
-dcmim2StatusAlarmsEntry OBJECT-TYPE
-   SYNTAX DC2StatusAlarmsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The alarm to display."
-   INDEX { dcmim2StatusAlarmsIndex }
-   ::= { dcmim2StatusAlarmsTable 1 }
-   
-DC2StatusAlarmsEntry ::=
-   SEQUENCE {   
-      dcmim2StatusAlarmsIndex               INTEGER,
-      dcmim2StatusAlarmsText                DisplayString
-   }
-
-dcmim2StatusAlarmsIndex OBJECT-TYPE
-   SYNTAX  INTEGER
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The index of the system alarm."       
-   ::= { dcmim2StatusAlarmsEntry 1 }
-   
-dcmim2StatusAlarmsText OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The 16 character text describing the active alarm condition."
-   ::= { dcmim2StatusAlarmsEntry 2 }
-
--- External Environmental Monitor
-
-emIdentFirmwareRevision OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the Environmental Monitor."
-   ::= { emIdent 1 }
-
-emConfigProbesNumProbes OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of temperature and humidity probes available."
-   ::= { emConfig 1 }
-
-emConfigProbesTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EmConfigProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of probes supported by the Environmental Monitor
-       and their configurations."
-   ::= { emConfig 2 }
-
-emConfigProbesEntry OBJECT-TYPE
-   SYNTAX EmConfigProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Environmental Monitor probe configurations."
-   INDEX  { emConfigProbeNumber }
-   ::= { emConfigProbesTable 1 }
-
-EmConfigProbesEntry ::=
-   SEQUENCE {
-      emConfigProbeNumber
-         INTEGER,
-      emConfigProbeName
-         DisplayString,
-      emConfigProbeHighTempThreshold
-         INTEGER,
-      emConfigProbeLowTempThreshold
-         INTEGER,
-      emConfigProbeTempUnits
-         INTEGER,
-      emConfigProbeHighHumidThreshold
-         INTEGER,
-      emConfigProbeLowHumidThreshold
-         INTEGER,
-      emConfigProbeHighTempEnable
-         INTEGER,
-      emConfigProbeLowTempEnable
-         INTEGER,
-      emConfigProbeHighHumidEnable
-         INTEGER,
-      emConfigProbeLowHumidEnable
-         INTEGER
-   }
-
-emConfigProbeNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index into an Environmental Monitor probe entry."
-   ::= { emConfigProbesEntry 1 }
-
-emConfigProbeName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name of the probe set by the user,
-       possibly denoting its location or purpose."
-   ::= { emConfigProbesEntry 2 }
-
-emConfigProbeHighTempThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature alarm threshold for the probe.
-       Units are displayed in the scale selected in
-       the 'emConfigProbeTempUnits' OID (Celsius or Fahrenheit)."
-   ::= { emConfigProbesEntry 3 }
-
-emConfigProbeLowTempThreshold OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low temperature alarm threshold for the probe.
-       Units are displayed in the scale selected in
-       the 'emConfigProbeTempUnits' OID (Celsius or Fahrenheit)."
-   ::= { emConfigProbesEntry 4 }
-
-emConfigProbeTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       thresholds of the probe, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { emConfigProbesEntry 5 }
-
-emConfigProbeHighHumidThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high humidity alarm threshold for the probe in
-      percent relative humidity."
-   ::= { emConfigProbesEntry 6 }
-
-emConfigProbeLowHumidThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low humidity alarm threshold for the probe in
-      percent relative humidity."
-   ::= { emConfigProbesEntry 7 }
-
-emConfigProbeHighTempEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { emConfigProbesEntry 8 }
-
-emConfigProbeLowTempEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low temperature alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { emConfigProbesEntry 9 }
-
-emConfigProbeHighHumidEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high humidity alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { emConfigProbesEntry 10 }
-
-emConfigProbeLowHumidEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low humidity alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { emConfigProbesEntry 11 }
-
-emConfigContactsNumContacts OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts supported by the Environmental
-       Monitor."
-   ::= { emConfig 3 }
-
-emConfigContactsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EmConfigContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the Environmental Monitor
-       and their configurations."
-   ::= { emConfig 4 }
-
-emConfigContactsEntry OBJECT-TYPE
-   SYNTAX EmConfigContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Environmental Monitor contact configurations."
-   INDEX  { emConfigContactNumber }
-   ::= { emConfigContactsTable 1 }
-
-EmConfigContactsEntry ::=
-   SEQUENCE {
-       emConfigContactNumber
-           INTEGER,
-       emConfigContactName
-           DisplayString,
-       emConfigContactEnable
-           INTEGER
-   }
-
-emConfigContactNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of an Environmental Monitor contact."
-   ::= { emConfigContactsEntry 1 }
-
-emConfigContactName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for an Environmental Monitor
-      contact set by the user, possibly denoting its
-      location or purpose."
-   ::= { emConfigContactsEntry 2 }
-
-emConfigContactEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "An Environmental Monitor contact alarm enable/disable.
-       No alarm will be generated if the contact is disabled(1).
-       An alarm will be generated if the contact is enabled(2)
-       and the contact has been faulted."
-   ::= { emConfigContactsEntry 3 }
-
-emStatusCommStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      noComm(1),
-      comm(2),
-      commLost(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The communication status between the agent
-       and the Environmental Monitor.
-       
-       noComm(1),   Communication has never been established.
-       comm(2),     Communication has been established.
-       commLost(3), Communication was established, but was lost."
-   ::= { emStatus 1 }
-
-emStatusProbesNumProbes OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of available probes on the Environmental
-       Monitor."
-   ::= { emStatus 2 }
-
-emStatusProbesTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EmStatusProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of probes supported by the Environmental Monitor
-       and their status."
-   ::= { emStatus 3 }
-
-emStatusProbesEntry OBJECT-TYPE
-   SYNTAX EmStatusProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the probe."
-   INDEX  { emStatusProbeNumber }
-   ::= { emStatusProbesTable 1 }
-
-EmStatusProbesEntry ::=
-   SEQUENCE {
-      emStatusProbeNumber
-         INTEGER,
-      emStatusProbeName
-         DisplayString,
-      emStatusProbeStatus
-         INTEGER,
-      emStatusProbeCurrentTemp
-         INTEGER,
-      emStatusProbeTempUnits
-         INTEGER,
-      emStatusProbeCurrentHumid
-         INTEGER,
-      emStatusProbeHighTempViolation
-         INTEGER,
-      emStatusProbeLowTempViolation
-         INTEGER,
-      emStatusProbeHighHumidViolation
-         INTEGER,
-      emStatusProbeLowHumidViolation
-         INTEGER
-   }
-
-emStatusProbeNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the probe."
-   ::= { emStatusProbesEntry 1 }
-
-emStatusProbeName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the probe set by the user,
-       possibly denoting its location or purpose."
-   ::= { emStatusProbesEntry 2 }
-
-emStatusProbeStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      disconnected(1),
-      connected(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The connected status of the probe, either      
-      disconnected(1) or connected(2)."
-   ::= { emStatusProbesEntry 3 }
-
-emStatusProbeCurrentTemp OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current temperature reading from the probe displayed
-       in the units shown in the 'emStatusProbeTempUnits' OID
-       (Celsius or Fahrenheit)."
-   ::= { emStatusProbesEntry 4 }
-
-emStatusProbeTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       thresholds of the probe, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { emStatusProbesEntry 5 }
-
-emStatusProbeCurrentHumid OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current humidity reading from the probe in
-       percent relative humidity."
-   ::= { emStatusProbesEntry 6 }
-
-emStatusProbeHighTempViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      highTempViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature violation status of the probe
-       temperature reading. This OID will show a highTempViolation(2)
-       if the current temperature reading shown in the
-       'emStatusProbeCurrentTemp' OID is greater than or equal to
-       the high temperature threshold value, the 
-       'emConfigProbeHighTempThreshold' OID, and the value of the
-       'emConfigProbeHighTempEnable' OID is enabled. Otherwise it will show
-       noViolation(1). If the 'emConfigProbeHighTempEnable' OID is disabled,
-       this OID will show disabled(3)."
-   ::= { emStatusProbesEntry 7 }
-
-emStatusProbeLowTempViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      lowTempViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature violation status of the probe
-       temperature reading. This OID will show a lowTempViolation(2)
-       if the current temperature reading shown in the
-       'emStatusProbeCurrentTemp' OID is less than or equal to
-       the low temperature threshold value, the 
-       'emConfigProbeLowTempThreshold' OID, and the value of the
-       'emConfigProbeLowTempEnable' OID is enabled. Otherwise it will show
-       noViolation(1). If the 'emConfigProbeLowTempEnable' OID is disabled,
-       this OID will show disabled(3)."
-   ::= { emStatusProbesEntry 8 }
-
-emStatusProbeHighHumidViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      highHumidViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The high humidity violation status of the probe humidity
-       reading. This OID will show a highTempViolation(2)
-       if the current humidity reading shown in the
-       'emStatusProbeCurrentHumid' OID is greater than or equal to
-       the high humidity threshold value, the 
-       'emConfigProbeHighHumidThreshold' OID, and the value of the
-       'emConfigProbeHighHumidEnable' OID is enabled. Otherwise it will
-       show noViolation(1).  If the 'emConfigProbeHighHumidEnable' OID is
-       disabled, this OID will show disabled(3)"
-   ::= { emStatusProbesEntry 9 }
-
-emStatusProbeLowHumidViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      lowHumidViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The low humidity violation status of the probe humidity
-       reading. This OID will show a lowTempViolation(2)
-       if the current humidity reading shown in the
-       'emStatusProbeCurrentHumid' OID is less than or equal to
-       the low humidity threshold value, the 
-       'emConfigProbeLowHumidThreshold' OID, and the value of the
-       'emConfigProbeLowHumidEnable' OID is enabled. Otherwise it will
-       show noViolation(1). If the 'emConfigProbeLowHumidEnable' OID is
-       disabled, this OID will show disabled(3)."
-   ::= { emStatusProbesEntry 10 }
-
-emStatusContactsNumContacts OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts supported by the
-       Environmental Monitor."
-   ::= { emStatus 4 }
-
-emStatusContactsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EmStatusContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the Environmental Monitor
-       and their status."
-   ::= { emStatus 5 }
-
-emStatusContactsEntry OBJECT-TYPE
-   SYNTAX EmStatusContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the contact."
-   INDEX  { emStatusContactNumber }
-   ::= { emStatusContactsTable 1 }
-
-EmStatusContactsEntry ::=
-   SEQUENCE {
-      emStatusContactNumber
-         INTEGER,
-      emStatusContactName
-         DisplayString,
-      emStatusContactStatus
-         INTEGER
-   }
-
-emStatusContactNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the Environmental Monitor contact."
-   ::= { emStatusContactsEntry 1 }
-
-emStatusContactName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the Environmental Monitor contact
-       set by the user, possibly denoting its location or purpose."
-   ::= { emStatusContactsEntry 2 }
-
-emStatusContactStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      noFault(1),
-      fault(2),
-      disabled(3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Environmental Monitor contact. The status
-       will show noFault(1) if the contact is in the normal state
-       and the 'emConfigContactEnable' OID is enabled. The status will
-       show a fault(2) if the contact is faulted and the 
-       'emContactEnable' OID is enabled. If the 'emConfigContactEnable'
-       OID is disabled, the status will show disabled(3)."
-   ::= { emStatusContactsEntry 3 }
-
--- Integrated Environmental Monitor (IEM)
-
-iemIdentHardwareRevision OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the Integrated Environmental
-       Monitor."
-   ::= { iemIdent 1 }
-
-iemConfigProbesNumProbes OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of temperature and humidity probes available."
-   ::= { iemConfig 1 }
-
-iemConfigProbesTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IemConfigProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of probes supported by the Environmental Monitor
-       and their configurations."
-   ::= { iemConfig 2 }
-
-iemConfigProbesEntry OBJECT-TYPE
-   SYNTAX IemConfigProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Environmental Monitor probe configurations."
-   INDEX  { iemConfigProbeNumber }
-   ::= { iemConfigProbesTable 1 }
-
-IemConfigProbesEntry ::=
-   SEQUENCE {
-      iemConfigProbeNumber
-         INTEGER,
-      iemConfigProbeName
-         DisplayString,
-      iemConfigProbeHighTempThreshold
-         INTEGER,
-      iemConfigProbeLowTempThreshold
-         INTEGER,
-      iemConfigProbeTempUnits
-         INTEGER,
-      iemConfigProbeHighHumidThreshold
-         INTEGER,
-      iemConfigProbeLowHumidThreshold
-         INTEGER,
-      iemConfigProbeHighTempEnable
-         INTEGER,
-      iemConfigProbeLowTempEnable
-         INTEGER,
-      iemConfigProbeHighHumidEnable
-         INTEGER,
-      iemConfigProbeLowHumidEnable
-         INTEGER
-   }
-
-iemConfigProbeNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to a Environmental Monitor probe entry."
-   ::= { iemConfigProbesEntry 1 }
-
-iemConfigProbeName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the probe set by the user,
-       possibly denoting its location or purpose."
-   ::= { iemConfigProbesEntry 2 }
-
-iemConfigProbeHighTempThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature alarm threshold for the probe.
-       Units are displayed in the scale selected in the
-       'iemConfigProbeTempUnits' OID (Celsius or Fahrenheit)."
-   ::= { iemConfigProbesEntry 3 }
-
-iemConfigProbeLowTempThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low temperature alarm threshold for the probe.
-       Units are displayed in the scale selected in the
-       'iemConfigProbeTempUnits' OID (Celsius or Fahrenheit)."
-   ::= { iemConfigProbesEntry 4 }
-
-iemConfigProbeTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       thresholds of the probe, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { iemConfigProbesEntry 5 }
-
-iemConfigProbeHighHumidThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high humidity alarm threshold for the probe in
-      percent relative humidity."
-   ::= { iemConfigProbesEntry 6 }
-
-iemConfigProbeLowHumidThreshold OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low humidity alarm threshold for the probe in
-      percent relative humidity."
-   ::= { iemConfigProbesEntry 7 }
-
-iemConfigProbeHighTempEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { iemConfigProbesEntry 8 }
-
-iemConfigProbeLowTempEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low temperature alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { iemConfigProbesEntry 9 }
-
-iemConfigProbeHighHumidEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The high humidity alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { iemConfigProbesEntry 10 }
-
-iemConfigProbeLowHumidEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The low humidity alarm enable/disable for the
-       probe. No alarm will be generated if this value
-       is set to disabled(1). The alarm will be 
-       generated if this value is set to enabled(2) and
-       the threshold has been violated."
-   ::= { iemConfigProbesEntry 11 }
-
-iemConfigContactsNumContacts OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts available on the Environmental
-       Monitor."
-   ::= { iemConfig 3 }
-
-iemConfigContactsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IemConfigContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the Environmental Monitor
-       and their configurations."
-   ::= { iemConfig 4 }
-
-iemConfigContactsEntry OBJECT-TYPE
-   SYNTAX IemConfigContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The Environmental Monitor contact configurations."
-   INDEX  { iemConfigContactNumber }
-   ::= { iemConfigContactsTable 1 }
-
-IemConfigContactsEntry ::=
-   SEQUENCE {
-       iemConfigContactNumber
-           INTEGER,
-       iemConfigContactName
-           DisplayString,
-       iemConfigContactEnable
-           INTEGER
-   }
-
-iemConfigContactNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of an Environmental Monitor contact."
-   ::= { iemConfigContactsEntry 1 }
-
-iemConfigContactName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the Environmental Monitor contact
-       set by the user, possibly denoting its location or purpose."
-   ::= { iemConfigContactsEntry 2 }
-
-iemConfigContactEnable OBJECT-TYPE
-   SYNTAX INTEGER {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "An Environmental Monitor contact alarm enable/disable."
-   ::= { iemConfigContactsEntry 3 }
-
-
-iemStatusProbesNumProbes OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of available probes on the Environmental
-       Monitor."
-   ::= { iemStatus 1 }
-
-iemStatusProbesTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IemStatusProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of probes supported by the Environmental Monitor
-       and their status."
-   ::= { iemStatus 2 }
-
-iemStatusProbesEntry OBJECT-TYPE
-   SYNTAX IemStatusProbesEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the probe."
-   INDEX  { iemStatusProbeNumber }
-   ::= { iemStatusProbesTable 1 }
-
-IemStatusProbesEntry ::=
-   SEQUENCE {
-      iemStatusProbeNumber
-         INTEGER,
-      iemStatusProbeName
-         DisplayString,
-      iemStatusProbeStatus
-         INTEGER,
-      iemStatusProbeCurrentTemp
-         INTEGER,
-      iemStatusProbeTempUnits
-         INTEGER,
-      iemStatusProbeCurrentHumid
-         INTEGER,
-      iemStatusProbeHighTempViolation
-         INTEGER,
-      iemStatusProbeLowTempViolation
-         INTEGER,
-      iemStatusProbeHighHumidViolation
-         INTEGER,
-      iemStatusProbeLowHumidViolation
-         INTEGER
-   }
-
-iemStatusProbeNumber OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the probe."
-   ::= { iemStatusProbesEntry 1 }
-
-iemStatusProbeName OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the probe set by the user,
-       denoting its location or purpose."
-   ::= { iemStatusProbesEntry 2 }
-
-iemStatusProbeStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      disconnected(1),
-      connected(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The connected status of the probe, either      
-      disconnected(1) or connected(2)."
-   ::= { iemStatusProbesEntry 3 }
-
-iemStatusProbeCurrentTemp OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current temperature reading from the probe displayed
-       in the units shown in the 'iemStatusProbeTempUnits' OID
-       (Celsius or Fahrenheit)."
-   ::= { iemStatusProbesEntry 4 }
-
-iemStatusProbeTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)     
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       thresholds of the probe, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { iemStatusProbesEntry 5 }
-
-iemStatusProbeCurrentHumid OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current humidity reading from the probe in percent
-      relative humidity."
-   ::= { iemStatusProbesEntry 6 }
-
-iemStatusProbeHighTempViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      highTempViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature violation status of the probe
-       temperature reading. This OID will show a highTempViolation(2)
-       if the current temperature reading shown in the
-       'iemStatusProbeCurrentTemp' OID is greater than or equal to
-       the high temperature threshold value, the 
-       'iemConfigProbeHighTempThreshold' OID, and the value of the
-       'iemConfigProbeHighTempEnable' OID is enabled. Otherwise it will show
-       noViolation(1). If the 'iemConfigProbeHighTempEnable' OID is disabled,
-       this OID will show disabled(3)."
-   ::= { iemStatusProbesEntry 7 }
-
-iemStatusProbeLowTempViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      lowTempViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The high temperature violation status of the probe
-       temperature reading. This OID will show a lowTempViolation(2)
-       if the current temperature reading shown in the
-       'iemStatusProbeCurrentTemp' OID is less than or equal to
-       the low temperature threshold value, the 
-       'iemConfigProbeLowTempThreshold' OID, and the value of the
-       'iemPConfigrobeLowTempEnable' OID is enabled. Otherwise it will show
-       noViolation(1). If the 'iemConfigProbeLowTempEnable' OID is disabled,
-       this OID will show disabled(3)."
-   ::= { iemStatusProbesEntry 8 }
-
-iemStatusProbeHighHumidViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      highHumidViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The high humidity violation status of the probe humidity
-       reading. This OID will show a highTempViolation(2)
-       if the current humidity reading shown in the
-       'iemStatusProbeCurrentHumid' OID is greater than or equal to
-       the high humidity threshold value, the 
-       'iemConfigProbeHighHumidThreshold' OID, and the value of the
-       'iemConfigProbeHighHumidEnable' OID is enabled. Otherwise it will
-       show noViolation(1). If the 'iemConfigProbeHighHumidEnable' OID is
-       disabled, this OID will show disabled(3)."
-   ::= { iemStatusProbesEntry 9 }
-
-iemStatusProbeLowHumidViolation OBJECT-TYPE
-   SYNTAX INTEGER {
-      noViolation(1),
-      lowHumidViolation(2),
-      disabled(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The low humidity violation status of the probe humidity
-       reading. This OID will show a lowTempViolation(2)
-       if the current humidity reading shown in the
-       'iemStatusProbeCurrentHumid' OID is less than or equal to
-       the low humidity threshold value, the 
-       'iemConfigProbeLowHumidThreshold' OID, and the value of the
-       'iemConfigProbeLowHumidEnable' OID is enabled. Otherwise it will
-       show noViolation(1). If the 'iemConfigProbeLowHumidEnable' OID is
-       disabled, this OID will show disabled(3)."
-   ::= { iemStatusProbesEntry 10 }
-
-iemStatusContactsNumContacts OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of contacts supported on the
-       Environmental Monitor."
-   ::= { iemStatus 3 }
-
-iemStatusContactsTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IemStatusContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of contacts supported by the Environmental Monitor
-       and their status."
-   ::= { iemStatus 4 }
-
-iemStatusContactsEntry OBJECT-TYPE
-   SYNTAX IemStatusContactsEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the contact."
-   INDEX  { iemStatusContactNumber }
-   ::= { iemStatusContactsTable 1 }
-
-IemStatusContactsEntry ::=
-   SEQUENCE {
-      iemStatusContactNumber
-         INTEGER,
-      iemStatusContactName
-         DisplayString,
-      iemStatusContactStatus
-         INTEGER
-   }
-
-iemStatusContactNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the Environmental Monitor contact."
-   ::= { iemStatusContactsEntry 1 }
-
-iemStatusContactName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the Environmental Monitor contact
-       set by the user, denoting its location or purpose."
-   ::= { iemStatusContactsEntry 2 }
-
-iemStatusContactStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      noFault(1),
-      fault(2),
-      disabled(3)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the Environmental Monitor contact. The status
-       will show noFault(1) if the contact is in the normal state
-       and the 'iemConfigContactEnable' OID is enabled. The status will
-       show a fault(2) if the contact is faulted and the 
-       'iemConfigContactEnable' OID is enabled. If the
-       'iemConfigContactEnable' OID is disabled, the status will show
-       disabled(3)."
-   ::= { iemStatusContactsEntry 3 }
-
-iemStatusRelaysNumRelays OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of output relays supported on the
-       Environmental Monitor."
-   ::= { iemStatus 6 }
-
-iemStatusRelaysTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IemStatusRelaysEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "A list of output relays supported by the
-       Environmental Monitor and their status."
-   ::= { iemStatus 7 }
-
-iemStatusRelaysEntry OBJECT-TYPE
-   SYNTAX IemStatusRelaysEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the relay."
-   INDEX  { iemStatusRelayNumber }
-   ::= { iemStatusRelaysTable 1 }
-
-IemStatusRelaysEntry ::=
-   SEQUENCE {
-      iemStatusRelayNumber
-         INTEGER,
-      iemStatusRelayName
-         DisplayString,
-      iemStatusRelayStatus
-         INTEGER
-   }
-
-iemStatusRelayNumber OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the output relay."
-   ::= { iemStatusRelaysEntry 1 }
-
-iemStatusRelayName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A descriptive name for the output relay set by the
-       user, denoting its location or purpose."
-   ::= { iemStatusRelaysEntry 2 }
-
-iemStatusRelayStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      faultState(1),
-      normalState(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the output relay, either faultState(1) or
-      normalState(2)."
-   ::= { iemStatusRelaysEntry 3 }
-
--- Environmental Management System (EMS)
-
---  EMS IDENT
-
-emsIdentEMSName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       device. "
-   ::= { emsIdent 1 }
-
-emsIdentProductNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the model number of 
-       the device. This value is set at the factory."
-   ::= { emsIdent 2 }
-
-emsIdentFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The firmware revision of the device."
-   ::= { emsIdent 3 }
-
-emsIdentHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The hardware revision of the device. 
-       This value is set at the factory."
-   ::= { emsIdent 4 }
-
-emsIdentDateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The date when the device was manufactured in mm/dd/yyyy format.
-       This value is set at the factory. " 
-   ::= { emsIdent 5 }
-   
-emsIdentSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the serial number of 
-       the device. This value is set at the factory."
-   ::= { emsIdent 6 }
-
---  EMS CONTROL
-
--- EMS OUTPUT RELAY CONTROL STATUS TABLE
-
-emsOutputRelayControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutputRelayControlEMSEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual output relays. The number of
-       entries is contained in the emsStatusOutputRelayCount OID."
-   ::= { emsOutputRelayControl 1 }
-
-emsOutputRelayControlEntry OBJECT-TYPE
-   SYNTAX OutputRelayControlEMSEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The output relays to control."
-   INDEX  { emsOutputRelayControlOutputRelayIndex }
-   ::= { emsOutputRelayControlTable 1 }
-
-OutputRelayControlEMSEntry ::=
-   SEQUENCE {
-      emsOutputRelayControlOutputRelayIndex   INTEGER,
-      emsOutputRelayControlOutputRelayName    DisplayString,
-      emsOutputRelayControlOutputRelayCommand INTEGER
-   }      
-
-emsOutputRelayControlOutputRelayIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the output relay entry."
-   ::= { emsOutputRelayControlEntry 1 }
-   
-emsOutputRelayControlOutputRelayName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the output relay.
-       This OID is provided for informational purposes only."
-   ::= { emsOutputRelayControlEntry 2 }
-
-emsOutputRelayControlOutputRelayCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      immediateCloseEMS           (1),
-      immediateOpenEMS            (2)
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the output relay state. If 
-       the output relay is closed, the immediateCloseEMS (1) value will be returned.
-       If the output relay is open, the immediateOpenEMS (2) value will be
-       returned. 
-              
-       Setting this variable to immediateCloseEMS (1) will immediately close the relay.
-       
-       Setting this variable to immediateOpenEMS (2) will immediately open the relay."
-   ::= { emsOutputRelayControlEntry 3 }
-
--- EMS OUTLET CONTROL TABLE
- 
-emsOutletControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF OutletControlEMSEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual outlet switches. The number of
-       entries is contained in the emsStatusOutletCount OID."
-   ::= { emsOutletControl 1 }
-
-emsOutletControlEntry OBJECT-TYPE
-   SYNTAX OutletControlEMSEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to control."
-   INDEX  { emsOutletControlOutletIndex }
-   ::= { emsOutletControlTable 1 }
-
-OutletControlEMSEntry ::=
-   SEQUENCE {
-      emsOutletControlOutletIndex   INTEGER,
-      emsOutletControlOutletName    DisplayString,
-      emsOutletControlOutletCommand INTEGER
-   }      
-
-emsOutletControlOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { emsOutletControlEntry 1 }
-   
-emsOutletControlOutletName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet.
-       This OID is provided for informational purposes only."
-   ::= { emsOutletControlEntry 2 }
-
-emsOutletControlOutletCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      immediateOnEMS             (1),
-      immediateOffEMS            (2)
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the outlet state. If 
-       the outlet is on, the immediateOnEMS (1) value will be returned.
-       If the outlet is off, the immediateOffEMS (2) value will be
-       returned. 
-       
-       Setting this variable to immediateOnEMS (1) will immediately turn the outlet on.
-       
-       Setting this variable to immediateOffEMS (2) will immediately turn the outlet off."
-   ::= { emsOutletControlEntry 3 }
-
--- EMS SENSOR CONTROL TABLE
-
-emsSensorControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSSensorControlEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control/reset of individual sensors. The number of
-       entries is contained in the emsStatusSensorCount OID."
-   ::= { emsSensorControl 1 }
-
-emsSensorControlEntry OBJECT-TYPE
-   SYNTAX EMSSensorControlEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The sensors to control/reset."
-   INDEX  { emsSensorControlSensorIndex }
-   ::= { emsSensorControlTable 1 }
-
-EMSSensorControlEntry ::=
-   SEQUENCE {
-      emsSensorControlSensorIndex         INTEGER,
-      emsSensorControlSensorSystemName    DisplayString,
-      emsSensorControlSensorUserName      DisplayString,
-      emsSensorControlSensorCommand       INTEGER
-   }      
-
-emsSensorControlSensorIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the sensor entry."
-   ::= { emsSensorControlEntry 1 }
-   
-emsSensorControlSensorSystemName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The system name of the sensor.  This describes the hardware system
-       intent of this sensor."
-   ::= { emsSensorControlEntry 2 }
-
-emsSensorControlSensorUserName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the sensor as given by the system user."
-   ::= { emsSensorControlEntry 3 }
-   
-emsSensorControlSensorCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      noCommandEMS        (1),
-      resetCommandEMS     (2)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return noCommandEMS(1).  
-              
-       Setting this variable to resetCommandEMS(2) will issue a reset command to the
-       sensor.  Some sensors cannot be manually reset and will not be affected 
-       by this command."
-   ::= { emsSensorControlEntry 4 }
-
--- EMS ALARM DEVICE CONTROL TABLE
- 
-emsAlarmDeviceControlTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF AlarmDeviceControlEMSEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for control of individual alarm devices. 
-       Note: Some alarm devices are not controllable.  The number of
-       entries is contained in the emsStatusAlarmDeviceCount OID."
-   ::= { emsAlarmDeviceControl 1 }
-
-emsAlarmDeviceControlEntry OBJECT-TYPE
-   SYNTAX AlarmDeviceControlEMSEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The alarm devices to control."
-   INDEX  { emsAlarmDeviceControlDeviceIndex }
-   ::= { emsAlarmDeviceControlTable 1 }
-
-AlarmDeviceControlEMSEntry ::=
-   SEQUENCE {
-      emsAlarmDeviceControlDeviceIndex   INTEGER,
-      emsAlarmDeviceControlDeviceName    DisplayString,
-      emsAlarmDeviceControlDeviceCommand INTEGER
-   }      
-
-emsAlarmDeviceControlDeviceIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the alarm device entry."
-   ::= { emsAlarmDeviceControlEntry 1 }
-   
-emsAlarmDeviceControlDeviceName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the alarm device.
-       This OID is provided for informational purposes only."
-   ::= { emsAlarmDeviceControlEntry 2 }
-
-emsAlarmDeviceControlDeviceCommand OBJECT-TYPE
-   SYNTAX INTEGER {
-      alarmDeviceOnEMS             (1),
-      alarmDeviceOffEMS            (2),
-      alarmDeviceNotInstalledEMS   (3)
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the device state. If 
-       the device is active, the alarmDeviceOnEMS (1) value will be returned.
-       If the device is inactive, the alarmDeviceOffEMS (2) value will be
-       returned. If the device is not installed, the 
-       alarmDeviceNotInstalledEMS (3) value will be returned.
-       
-       Actions resulting from setting this variable are device-dependent.
-
-       Setting this variable to alarmDeviceOnEMS (1) will turn that device (ex. Beacon) on.       
-       Setting this variable to alarmDeviceOffEMS (2) will turn that device off."
-
-   ::= { emsAlarmDeviceControlEntry 3 }
-
-
---  EMS CONFIG
-
-emsConfigName   OBJECT-TYPE
-   SYNTAX  DisplayString    
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the device."
-   ::= { emsConfig 1 }
-
-emsConfigCheckLogLight   OBJECT-TYPE
-   SYNTAX INTEGER       {
-      lightDisabled          (1),
-      lightOnInformational   (2),
-      lightOnWarning         (3),
-      lightOnSevere          (4)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "The setting of this OID determines the level of event that will
-       trigger the check-log light on the EMS. This is not available on the EMU2.
-
-      lightDisabled (1) disables the check-log light.
-      lightOnInformational (2) lights check-log for any event of 
-        informational severity or above.
-      lightOnWarning (3) lights check-log for any event of 
-        warning severity or above.
-      lightOnSevere (4) lights check-log for any event of severe severity."
-
-   ::= { emsConfig 2 }
-   
--- EMS PROBE CONFIG TABLE
-
-emsProbeConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSProbeConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual probes. The number of
-       entries is contained in the emsStatusProbeCount OID."
-   ::= { emsProbeConfig 1 }
-
-emsProbeConfigEntry OBJECT-TYPE
-   SYNTAX EMSProbeConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The probes to configure."
-   INDEX  { emsProbeConfigProbeIndex }
-   ::= { emsProbeConfigTable 1 }
-
-EMSProbeConfigEntry ::=
-   SEQUENCE {
-      emsProbeConfigProbeIndex                INTEGER,
-      emsProbeConfigProbeName                 DisplayString,
-      emsProbeConfigProbeHighTempThresh       INTEGER,
-      emsProbeConfigProbeLowTempThresh        INTEGER,
-      emsProbeConfigProbeHighHumidityThresh   INTEGER,
-      emsProbeConfigProbeLowHumidityThresh    INTEGER,
-      emsProbeConfigProbeMaxTempThresh        INTEGER,
-      emsProbeConfigProbeMinTempThresh        INTEGER,
-      emsProbeConfigProbeDeltaTemp            INTEGER,
-      emsProbeConfigProbeMaxHumidityThresh    INTEGER,
-      emsProbeConfigProbeMinHumidityThresh    INTEGER,
-      emsProbeConfigProbeDeltaHumidity        INTEGER,
-      emsProbeConfigProbeSTIncTempVariance    INTEGER,
-      emsProbeConfigProbeSTIncTempTime        INTEGER,
-      emsProbeConfigProbeSTDecTempVariance    INTEGER,
-      emsProbeConfigProbeSTDecTempTime        INTEGER,
-      emsProbeConfigProbeLTIncTempVariance    INTEGER,
-      emsProbeConfigProbeLTIncTempTime        INTEGER,
-      emsProbeConfigProbeLTDecTempVariance    INTEGER,
-      emsProbeConfigProbeLTDecTempTime        INTEGER
-   }      
-
-emsProbeConfigProbeIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the probe entry."
-   ::= { emsProbeConfigEntry 1 }
-   
-emsProbeConfigProbeName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the probe."
-   ::= { emsProbeConfigEntry 2 }
-
-emsProbeConfigProbeHighTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe high temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 3 }
-   
-emsProbeConfigProbeLowTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe low temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 4 }
-   
-emsProbeConfigProbeHighHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe high humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeConfigEntry 5 }
-   
-emsProbeConfigProbeLowHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe low humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeConfigEntry 6 }
-
-emsProbeConfigProbeMaxTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe maximum temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 7 }
-   
-emsProbeConfigProbeMinTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe minimum temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 8 }
-   
-emsProbeConfigProbeDeltaTemp OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe delta temperature. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 9 }
-   
-emsProbeConfigProbeMaxHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe maximum humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeConfigEntry 10 }
-   
-emsProbeConfigProbeMinHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe minimum humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeConfigEntry 11 }
-   
-emsProbeConfigProbeDeltaHumidity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe delta humidity. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeConfigEntry 12 }
-   
-emsProbeConfigProbeSTIncTempVariance OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe short-term increasing temperature variance used for rate of change alarms. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 13 }
-   
-emsProbeConfigProbeSTIncTempTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe short-term increasing temperature time used for rate of change alarms. 
-
-      Values are represented in whole number minutes."
-   ::= { emsProbeConfigEntry 14 }
-   
-emsProbeConfigProbeSTDecTempVariance OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe short-term decreasing temperature variance used for rate of change alarms. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 15 }
-   
-emsProbeConfigProbeSTDecTempTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe short-term decreasing temperature time used for rate of change alarms. 
-
-      Values are represented in whole number minutes."
-   ::= { emsProbeConfigEntry 16 }
-   
-emsProbeConfigProbeLTIncTempVariance OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe long-term increasing temperature variance used for rate of change alarms. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 17 }
-   
-emsProbeConfigProbeLTIncTempTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe long-term increasing temperature time used for rate of change alarms. 
-
-      Values are represented in whole number hours."
-   ::= { emsProbeConfigEntry 18 }
-   
-emsProbeConfigProbeLTDecTempVariance OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe long-term decreasing temperature variance used for rate of change alarms. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeConfigEntry 19 }
-   
-emsProbeConfigProbeLTDecTempTime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "Probe long-term decreasing temperature time used for rate of change alarms. 
-
-      Values are represented in whole number hours."
-   ::= { emsProbeConfigEntry 20 }
-   
-
--- EMS INPUT CONTACT CONFIG STATUS TABLE
-
-emsInputContactConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSInputContactConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual input contacts. The number of
-       entries is contained in the emsStatusInputContactCount OID."
-   ::= { emsInputContactConfig 1 }
-
-emsInputContactConfigEntry OBJECT-TYPE
-   SYNTAX EMSInputContactConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The input contacts to configure."
-   INDEX  { emsInputContactConfigInputContactIndex }
-   ::= { emsInputContactConfigTable 1 }
-
-EMSInputContactConfigEntry ::=
-   SEQUENCE {
-      emsInputContactConfigInputContactIndex         INTEGER,
-      emsInputContactConfigInputContactName          DisplayString,
-      emsInputContactConfigInputContactNormalState   INTEGER
-   }      
-
-emsInputContactConfigInputContactIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the input contact entry."
-   ::= { emsInputContactConfigEntry 1 }
-   
-emsInputContactConfigInputContactName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the input contact."
-   ::= { emsInputContactConfigEntry 2 }
-
-emsInputContactConfigInputContactNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyClosedEMS        (1),
-      normallyOpenEMS          (2)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the input contact. If 
-       the normal state is closed, the normallyClosedEMS (1) value will be returned.
-       If the normal state is closed, the normallyOpenEMS (2) value will be
-       returned.
-       
-       Setting this variable will change the normal state of the input contact"
-   ::= { emsInputContactConfigEntry 3 }
-   
--- EMS OUTPUT RELAY CONFIG STATUS TABLE
-
-emsOutputRelayConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSOutputRelayConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual output relays. The number of
-       entries is contained in the emsStatusOutputRelayCount OID."
-   ::= { emsOutputRelayConfig 1 }
-
-emsOutputRelayConfigEntry OBJECT-TYPE
-   SYNTAX EMSOutputRelayConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The output relays to configure."
-   INDEX  { emsOutputRelayConfigOutputRelayIndex }
-   ::= { emsOutputRelayConfigTable 1 }
-
-EMSOutputRelayConfigEntry ::=
-   SEQUENCE {
-      emsOutputRelayConfigOutputRelayIndex          INTEGER,
-      emsOutputRelayConfigOutputRelayName           DisplayString,
-      emsOutputRelayConfigOutputRelayNormalState    INTEGER
-   }      
-
-emsOutputRelayConfigOutputRelayIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the output relay entry."
-   ::= { emsOutputRelayConfigEntry 1 }
-   
-emsOutputRelayConfigOutputRelayName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the output relay."
-   ::= { emsOutputRelayConfigEntry 2 }
-
-emsOutputRelayConfigOutputRelayNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyClosedEMS        (1),
-      normallyOpenEMS          (2)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the output relay. If 
-       the normal state is closed, the normallyClosedEMS (1) value will be returned.
-       If the normal state is closed, the normallyOpenEMS (2) value will be
-       returned.
-              
-       Setting this variable will change the normal state of the output relay"
-   ::= { emsOutputRelayConfigEntry 3 }
-   
--- EMS OUTLET CONFIG TABLE
-  
-emsOutletConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSOutletConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual outlets. The number of
-       entries is contained in the emsStatusOutletCount OID."
-   ::= { emsOutletConfig 1 }
-
-emsOutletConfigEntry OBJECT-TYPE
-   SYNTAX EMSOutletConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to configure."
-   INDEX  { emsOutletConfigOutletIndex }
-   ::= { emsOutletConfigTable 1 }
-
-EMSOutletConfigEntry ::=
-   SEQUENCE {
-      emsOutletConfigOutletIndex          INTEGER,
-      emsOutletConfigOutletName           DisplayString,
-      emsOutletConfigOutletNormalState    INTEGER
-   }      
-
-emsOutletConfigOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { emsOutletConfigEntry 1 }
-   
-emsOutletConfigOutletName   OBJECT-TYPE
-   SYNTAX  DisplayString    ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet."
-   ::= { emsOutletConfigEntry 2 }
-
-emsOutletConfigOutletNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyOnEMS             (1),
-      normallyOffEMS            (2)
-   }     
-
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the outlet. If 
-       the normal state is on, the normallyOnEMS (1) value will be returned.
-       If the normal state is off, the normallyOffEMS (2) value will be
-       returned. 
-       
-       Setting this variable will change the normal state of the outlet"
-   ::= { emsOutletConfigEntry 3 }
-   
--- EMS SENSOR CONFIG TABLE
-
-emsSensorConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSSensorConfigEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual sensors. The number of
-       entries is contained in the emsStatusSensorCount OID."
-   ::= { emsSensorConfig 1 }
-
-emsSensorConfigEntry OBJECT-TYPE
-   SYNTAX EMSSensorConfigEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The sensors to configure."
-   INDEX  { emsSensorConfigSensorIndex }
-   ::= { emsSensorConfigTable 1 }
-
-EMSSensorConfigEntry ::=
-   SEQUENCE {
-      emsSensorConfigSensorIndex         INTEGER,
-      emsSensorConfigSensorSystemName    DisplayString,
-      emsSensorConfigSensorUserName      DisplayString,
-      emsSensorConfigSensorNormalState   INTEGER,
-      emsSensorConfigSensorAlarmDelay    INTEGER
-   }      
-
-emsSensorConfigSensorIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the sensor entry."
-   ::= { emsSensorConfigEntry 1 }
-   
-emsSensorConfigSensorSystemName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The system name of the sensor.  This describes the hardware system
-       intent of this sensor."
-   ::= { emsSensorConfigEntry 2 }
-
-emsSensorConfigSensorUserName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the sensor as given by the system user."
-   ::= { emsSensorConfigEntry 3 }
-   
-emsSensorConfigSensorNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyClosedEMS        (1),
-      normallyOpenEMS          (2)
-   }     
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the sensor. If 
-       the normal state is closed, the normallyClosedEMS (1) value will be returned.
-       If the normal state is closed, the normallyOpenEMS (2) value will be
-       returned.
-       
-       Setting this variable will change the normal state of the sensor.  Note:
-       Only the AUX sensor in the EMS has a configurable Normal State"
-   ::= { emsSensorConfigEntry 4 }
-
-emsSensorConfigSensorAlarmDelay   OBJECT-TYPE
-   SYNTAX  INTEGER 
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The delay (in seconds) after a sensor detects an alarm condition before the
-       condition is reported."
-   ::= { emsSensorConfigEntry 5 }
-
---  EMS STATUS
---- EMS MASTER status
-
-emsStatusEMSName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       device. "
-   ::= { emsStatus 1 }
-
-emsStatusCommStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      noComm(1),
-      comm(2),
-      commLost(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The communication status between the agent
-       and the device.
-       
-       noComm(1),   Communication has never been established.
-       comm(2),     Communication has been established.
-       commLost(3), Communication was established, but was lost."
-   ::= { emsStatus 2 }
-
-emsStatusProbeCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of T/H probes (both local and remote) that
-       is supported by this device."
-   ::= { emsStatus 3 }
-
-emsStatusInputContactCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of Input Contacts that
-       is supported by this device."
-   ::= { emsStatus 4 }
-
-emsStatusOutputRelayCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of Output Relays that
-       is supported by this device."
-   ::= { emsStatus 5 }
-
-emsStatusOutletCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of  AC Outlets that
-       is supported by this device."
-   ::= { emsStatus 6 }
-
-emsStatusSensorCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of Sensors that
-       is supported by this device."
-   ::= { emsStatus 7 }
-   
-emsStatusAlinkAruDeviceCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of remote Aru's supported by this device."
-   ::= { emsStatus 8 }
-
-emsStatusAlinkProbeDeviceCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of remote T/H probes supported by this device."
-   ::= { emsStatus 9 }
-
-emsStatusAlarmDeviceCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of alarm devices supported by this device."
-   ::= { emsStatus 10 }
-
-emsStatusSysTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       in the system, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { emsStatus 11 }
-
-emsStatusCheckLogLight   OBJECT-TYPE
-   SYNTAX INTEGER       {
-      lightOff         (1),
-      lightOn          (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the check-log light on the device.
-      For the EMU2, this will always indicate lightOff(1).
-
-      lightOff (1) indicates the light is off (no new log entries).
-      lightOn (2) indicates the light is on (new log entries present)."
-
-   ::= { emsStatus 12 }
-
-emsStatusHardwareStatus   OBJECT-TYPE
-   SYNTAX INTEGER       
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the EMS hardware.  This integer should be interpreted
-       as a bit map, with each bit representing the presence or absence of
-       a specific hardware error condition.
-       
-       0 indicates there are no error conditions detected in the EMS hardware.
-       1 indicates a Current Limit error condition related to the Alink port.
-       2 indicates incorrect hardware is plugged into an EMS port.
-       3 indicates that both of these error conditions are present."
-
-   ::= { emsStatus 13 }
-
--- EMS PROBE STATUS TABLE
-
-emsProbeStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSProbeStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual probes. The number of
-       entries is contained in the emsStatusProbeCount OID."
-   ::= { emsProbeStatus 1 }
-
-emsProbeStatusEntry OBJECT-TYPE
-   SYNTAX EMSProbeStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The probes to access."
-   INDEX  { emsProbeStatusProbeIndex }
-   ::= { emsProbeStatusTable 1 }
-
-EMSProbeStatusEntry ::=
-   SEQUENCE {
-      emsProbeStatusProbeIndex                INTEGER,
-      emsProbeStatusProbeName                 DisplayString,
-      emsProbeStatusProbeTemperature          INTEGER,
-      emsProbeStatusProbeHighTempThresh       INTEGER,
-      emsProbeStatusProbeLowTempThresh        INTEGER,
-      emsProbeStatusProbeHumidity             INTEGER,
-      emsProbeStatusProbeHighHumidityThresh   INTEGER,
-      emsProbeStatusProbeLowHumidityThresh    INTEGER,
-      emsProbeStatusProbeSerialNumber         DisplayString,
-      emsProbeStatusProbeCommStatus           INTEGER,
-      emsProbeStatusProbeAlarmStatus          INTEGER,
-      emsProbeStatusProbeMaxTempThresh        INTEGER,
-      emsProbeStatusProbeMinTempThresh        INTEGER,
-      emsProbeStatusProbeMaxHumidityThresh    INTEGER,
-      emsProbeStatusProbeMinHumidityThresh    INTEGER
-   }      
-
-emsProbeStatusProbeIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the probe entry."
-   ::= { emsProbeStatusEntry 1 }
-   
-emsProbeStatusProbeName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the probe."
-   ::= { emsProbeStatusEntry 2 }
-
-emsProbeStatusProbeTemperature OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe temperature reading. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeStatusEntry 3 }
-
-emsProbeStatusProbeHighTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe high temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeStatusEntry 4 }
-   
-emsProbeStatusProbeLowTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe low temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeStatusEntry 5 }
-   
-emsProbeStatusProbeHumidity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe humidity reading. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeStatusEntry 6 }
-
-emsProbeStatusProbeHighHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe high humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeStatusEntry 7 }
-   
-emsProbeStatusProbeLowHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe low humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeStatusEntry 8 }
-
-emsProbeStatusProbeSerialNumber   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "A label indicating the type (Local[L] or Remote[R]) and Number
-       of the probe.  For example, the first local probe would be L1 and
-       the third remote probe would be R3."
-   ::= { emsProbeStatusEntry 9 }
-
-emsProbeStatusProbeCommStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      commsNeverDiscovered(1),
-      commsEstablished(2),
-      commsLost(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      " The state of communications to the probe.
-      commNeverDiscovered(1) indicates there has never been communications with this device.
-      commsEstablished(2) indicates communication is normal and active with this device.
-      commsLost(3) indicates communication had been established, but is no longer."
-   ::= { emsProbeStatusEntry 10 }
-
-emsProbeStatusProbeAlarmStatus   OBJECT-TYPE
-   SYNTAX INTEGER       
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The alarm status of the probe.  This integer should be interpreted
-       as a bit map, with each bit representing the presence or absence of
-       the specific alarm conditions listed below.  The bit will be '1' if
-       the condition is present, and '0' if the condition is not present.
-       
-       Bit  Hex. Value  Description
-       1    0x0001      Maximum temperature exceeded.
-       2    0x0002      High temperature exceeded.
-       3    0x0004      Low temperature exceeded.
-       4    0x0008      Minimum temperature exceeded.
-       5    0x0010      Short-term increasing temperature rate exceeded.
-       6    0x0020      Short-term decreasing temperature rate exceeded.
-       7    0x0040      Long-term increasing temperature rate exceeded.
-       8    0x0080      Long-term decreasing temperature rate exceeded.
-       9    0x0100      Maximum humidity exceeded.
-       10   0x0200      High humidity exceeded.
-       11   0x0400      Low humidity exceeded.
-       12   0x0800      Minimum humidity exceeded."
-   ::= { emsProbeStatusEntry 11 }
-
-emsProbeStatusProbeMaxTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe maximum temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeStatusEntry 12 }
-   
-emsProbeStatusProbeMinTempThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe minimum temperature threshold. 
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the emsStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { emsProbeStatusEntry 13 }
-   
-emsProbeStatusProbeMaxHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe maximum humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeStatusEntry 14 }
-   
-emsProbeStatusProbeMinHumidityThresh OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "Probe minimum humidity threshold. 
-
-      Values are represented in whole number percentage."
-   ::= { emsProbeStatusEntry 15 }
-   
-
--- EMS INPUT CONTACT STATUS TABLE
-
-emsInputContactStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSInputContactStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual input contacts. The number of
-       entries is contained in the emsStatusInputContactCount OID."
-   ::= { emsInputContactStatus 1 }
-
-emsInputContactStatusEntry OBJECT-TYPE
-   SYNTAX EMSInputContactStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The input contacts to access."
-   INDEX  { emsInputContactStatusInputContactIndex }
-   ::= { emsInputContactStatusTable 1 }
-
-EMSInputContactStatusEntry ::=
-   SEQUENCE {
-      emsInputContactStatusInputContactIndex         INTEGER,
-      emsInputContactStatusInputContactName          DisplayString,
-      emsInputContactStatusInputContactState         INTEGER,
-      emsInputContactStatusInputContactNormalState   INTEGER
-   }      
-
-emsInputContactStatusInputContactIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the input contact entry."
-   ::= { emsInputContactStatusEntry 1 }
-   
-emsInputContactStatusInputContactName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the input contact."
-   ::= { emsInputContactStatusEntry 2 }
-   
-emsInputContactStatusInputContactState OBJECT-TYPE
-   SYNTAX INTEGER {
-      contactClosedEMS         (1),
-      contactOpenEMS           (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the state of the input contact. If 
-       the input contact is closed, the contactClosedEMS (1) value will be returned.
-       If the input contact state is open, the contactOpenEMS (2) value will be
-       returned. "
-       
-   ::= { emsInputContactStatusEntry 3 }
-
-emsInputContactStatusInputContactNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyClosedEMS         (1),
-      normallyOpenEMS           (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the input contact. If 
-       the normal state is closed, the normallyClosedEMS (1) value will be returned.
-       If the normal state is open, the normallyOpenEMS (2) value will be
-       returned. "
-       
-   ::= { emsInputContactStatusEntry 4 }
-
-
--- EMS OUTPUT RELAY STATUS TABLE
-
-emsOutputRelayStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSOutputRelayStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual output relays. The number of
-       entries is contained in the emsStatusOutputRelayCount OID."
-   ::= { emsOutputRelayStatus 1 }
-
-emsOutputRelayStatusEntry OBJECT-TYPE
-   SYNTAX EMSOutputRelayStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The output relays to access."
-   INDEX  { emsOutputRelayStatusOutputRelayIndex }
-   ::= { emsOutputRelayStatusTable 1 }
-
-EMSOutputRelayStatusEntry ::=
-   SEQUENCE {
-      emsOutputRelayStatusOutputRelayIndex          INTEGER,
-      emsOutputRelayStatusOutputRelayName           DisplayString,
-      emsOutputRelayStatusOutputRelayState          INTEGER,
-      emsOutputRelayStatusOutputRelayNormalState    INTEGER
-   }      
-
-emsOutputRelayStatusOutputRelayIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the output relay entry."
-   ::= { emsOutputRelayStatusEntry 1 }
-   
-emsOutputRelayStatusOutputRelayName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the output relay."
-   ::= { emsOutputRelayStatusEntry 2 }
-
-emsOutputRelayStatusOutputRelayState OBJECT-TYPE
-   SYNTAX INTEGER {
-      relayClosedEMS         (1),
-      relayOpenEMS           (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the state of the output relay. If 
-       the output relay is closed, the relayClosedEMS (1) value will be returned.
-       If the output relay is open, the relayOpenEMS (2) value will be
-       returned. "
-       
-   ::= { emsOutputRelayStatusEntry 3 }
-
-emsOutputRelayStatusOutputRelayNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyClosedEMS         (1),
-      normallyOpenEMS           (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the output relay. If 
-       the normal state is closed, the normallyClosedEMS (1) value will be returned.
-       If the normal state is open, the normallyOpenEMS (2) value will be
-       returned. "
-       
-   ::= { emsOutputRelayStatusEntry 4 }
-   
--- EMS OUTLET STATUS TABLE
-  
-emsOutletStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSOutletStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual outlets. The number of
-       entries is contained in the emsStatusOutletCount OID."
-   ::= { emsOutletStatus 1 }
-
-emsOutletStatusEntry OBJECT-TYPE
-   SYNTAX EMSOutletStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The outlets to access."
-   INDEX  { emsOutletStatusOutletIndex }
-   ::= { emsOutletStatusTable 1 }
-
-EMSOutletStatusEntry ::=
-   SEQUENCE {
-      emsOutletStatusOutletIndex          INTEGER,
-      emsOutletStatusOutletName           DisplayString,
-      emsOutletStatusOutletState          INTEGER,
-      emsOutletStatusOutletNormalState    INTEGER
-   }      
-
-emsOutletStatusOutletIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the outlet entry."
-   ::= { emsOutletStatusEntry 1 }
-   
-emsOutletStatusOutletName   OBJECT-TYPE
-   SYNTAX  DisplayString    ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the outlet."
-   ::= { emsOutletStatusEntry 2 }
-
-emsOutletStatusOutletState OBJECT-TYPE
-   SYNTAX INTEGER {
-      outletOnEMS             (1),
-      outletOffEMS            (2)
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the state of the outlet. If 
-       the outlet is on, the outletOnEMS (1) value will be returned.
-       If the outlet is off, the outletOffEMS (2) value will be
-       returned. "
-       
-   ::= { emsOutletStatusEntry 3 }
-
-emsOutletStatusOutletNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyOnEMS             (1),
-      normallyOffEMS            (2)
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the outlet. If 
-       the normal state is on, the normallyOnEMS (1) value will be returned.
-       If the normal state is off, the normallyOffEMS (2) value will be
-       returned. "
-       
-   ::= { emsOutletStatusEntry 4 }
-
--- EMS ALARM DEVICE STATUS TABLE
- 
-emsAlarmDeviceStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSAlarmDeviceStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual alarm devices. The number of
-       entries is contained in the emsStatusAlarmDeviceCount OID."
-   ::= { emsAlarmDeviceStatus 1 }
-
-emsAlarmDeviceStatusEntry OBJECT-TYPE
-   SYNTAX EMSAlarmDeviceStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The alarm devices to access."
-   INDEX  { emsAlarmDeviceStatusDeviceIndex }
-   ::= { emsAlarmDeviceStatusTable 1 }
-
-EMSAlarmDeviceStatusEntry ::=
-   SEQUENCE {
-      emsAlarmDeviceStatusDeviceIndex   INTEGER,
-      emsAlarmDeviceStatusDeviceName    DisplayString,
-      emsAlarmDeviceStatusDeviceState   INTEGER
-   }      
-
-emsAlarmDeviceStatusDeviceIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the alarm device entry."
-   ::= { emsAlarmDeviceStatusEntry 1 }
-   
-emsAlarmDeviceStatusDeviceName    OBJECT-TYPE
-   SYNTAX  DisplayString
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the alarm device.
-       This OID is provided for informational purposes only."
-   ::= { emsAlarmDeviceStatusEntry 2 }
-
-emsAlarmDeviceStatusDeviceState OBJECT-TYPE
-   SYNTAX INTEGER {
-      alarmDeviceOnEMS             (1),
-      alarmDeviceOffEMS            (2),
-      alarmDeviceNotInstalledEMS   (3)   
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the device state. If 
-       the device is active, the alarmDeviceOnEMS (1) value will be returned.
-       If the device is inactive, the alarmDeviceOffEMS (2) value will be
-       returned.  If the device is not installed, the 
-       alarmDeviceNotInstalledEMS (3) value will be returned."
-
-   ::= { emsAlarmDeviceStatusEntry 3 }
-
-   
--- EMS SENSOR STATUS TABLE
-
-emsSensorStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF EMSSensorStatusEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual sensors. The number of
-       entries is contained in the emsStatusSensorCount OID."
-   ::= { emsSensorStatus 1 }
-
-emsSensorStatusEntry OBJECT-TYPE
-   SYNTAX EMSSensorStatusEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The sensors to access."
-   INDEX  { emsSensorStatusSensorIndex }
-   ::= { emsSensorStatusTable 1 }
-
-EMSSensorStatusEntry ::=
-   SEQUENCE {
-      emsSensorStatusSensorIndex         INTEGER,
-      emsSensorStatusSensorSystemName    DisplayString,
-      emsSensorStatusSensorName          DisplayString,
-      emsSensorStatusSensorState         INTEGER,
-      emsSensorStatusSensorNormalState   INTEGER,
-      emsSensorStatusSensorAlarmDelay    INTEGER
-   }      
-
-emsSensorStatusSensorIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the sensor entry."
-   ::= { emsSensorStatusEntry 1 }
- 
-emsSensorStatusSensorSystemName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The system name of the sensor.  This describes the hardware system
-       intent of this sensor."
-   ::= { emsSensorStatusEntry 2 }
-  
-emsSensorStatusSensorName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the sensor as given by the system user."
-   ::= { emsSensorStatusEntry 3 }
-
-emsSensorStatusSensorState OBJECT-TYPE
-   SYNTAX INTEGER {
-      sensorFaultedEMS       (1),
-      sensorOKEMS            (2),
-      sensorNotInstalledEMS  (3)   
-   }     
-
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the sensor state. If the sensor is faulted, 
-       the sensorFaultedEMS (1) value will be returned.
-       If the sensor is not faulted, the sensorOKEMS (2) value will be
-       returned. If the sensor is not installed, the  sensorNotInstalledEMS (3) 
-       value will be returned."
-   ::= { emsSensorStatusEntry 4 }
- 
-emsSensorStatusSensorNormalState OBJECT-TYPE
-   SYNTAX INTEGER {
-      normallyClosedEMS        (1),
-      normallyOpenEMS          (2)
-   }     
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-       "Getting this variable will return the normal state of the sensor. If 
-       the normal state is closed, the normallyClosedEMS (1) value will be returned.
-       If the normal state is closed, the normallyOpenEMS (2) value will be
-       returned."
-   ::= { emsSensorStatusEntry 5 }
-
-emsSensorStatusSensorAlarmDelay   OBJECT-TYPE
-   SYNTAX  INTEGER 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The delay (in seconds) after a sensor detects an alarm condition before the
-       condition is reported."
-   ::= { emsSensorStatusEntry 6 }
-   
-
-
---  airFM AIR CONDITIONER IDENT
-
-airFMIdentName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       device. "
-   ::= { airFMIdent 1 }
-   
-airFMIdentTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of entries in the airFMIdentTable. "   
-   ::= { airFMIdent 2 } 
-
-airFMIdentTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF AirFMIdentTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting identification information 
-       from each module in the system. "    
-   ::= { airFMIdent 3 }
-
-airFMIdentTableEntry OBJECT-TYPE
-   SYNTAX AirFMIdentTableEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The module to get information from."
-   INDEX  { airFMIdentModuleIndex }
-   ::= { airFMIdentTable 1 }
-
-AirFMIdentTableEntry ::=
-   SEQUENCE {
-      airFMIdentModuleIndex            INTEGER,
-      airFMIdentModuleModelNumber      DisplayString,
-      airFMIdentModuleDateOfMfg        DisplayString,
-      airFMIdentModuleSerialNumber     DisplayString,
-      airFMIdentModuleFirmwareRev      DisplayString,
-      airFMIdentModuleHardwareRev      DisplayString
-   }
-   
-airFMIdentModuleIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the module information."
-   ::= { airFMIdentTableEntry 1 }
-
-airFMIdentModuleModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       model number. "
-   ::= { airFMIdentTableEntry 2 }
-   
-airFMIdentModuleDateOfMfg OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       manufacture date. "
-   ::= { airFMIdentTableEntry 3 }
-   
-airFMIdentModuleSerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       unit serial number. "
-   ::= { airFMIdentTableEntry 4 }
-   
-airFMIdentModuleFirmwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       firmware revision. "
-   ::= { airFMIdentTableEntry 5 }
-   
-airFMIdentModuleHardwareRev OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       hardware revision. "
-   ::= { airFMIdentTableEntry 6 }
-   
---  airFM AIR CONDITIONER STATUS
-
-airFMStatusSystemOn OBJECT-TYPE
-   SYNTAX INTEGER   {
-      statusOn      (1),
-      statusOff     (2)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The operating state of the system. "
-   ::= { airFMStatus 1 }
-   
-airFMStatusSystemAverageRetTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system average return air 
-       temperature in tenths of degrees Celsius. "
-   ::= { airFMStatus 2 }
-   
-airFMStatusSystemAverageRetTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system average return air 
-       temperature in tenths of degrees Fahrenheit. "
-   ::= { airFMStatus 3 }
-   
-airFMStatusSystemAverageRetHum OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system average return air 
-       humidity. "
-   ::= { airFMStatus 4 }
-   
-airFMStatusSystemActionTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system action air 
-       temperature in tenths of degrees Celsius. "
-   ::= { airFMStatus 5 }
-   
-airFMStatusSystemActionTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system action air 
-       temperature in tenths of degrees Fahrenheit. "
-   ::= { airFMStatus 6 }
-   
-airFMStatusSystemActionHum OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system action air humidity. "
-   ::= { airFMStatus 7 }
-   
-airFMStatusSystemRemoteHighTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote high air 
-       temperature in tenths of degrees Celsius. "
-   ::= { airFMStatus 8 }
-   
-airFMStatusSystemRemoteHighTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote high air 
-       temperature in tenths of degrees Fahrenheit. "
-   ::= { airFMStatus 9 }
-   
-airFMStatusSystemRemoteAvgTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote average air 
-       temperature in tenths of degrees Celsius. "
-   ::= { airFMStatus 10 }
-   
-airFMStatusSystemRemoteAvgTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote average air 
-       temperature in tenths of degrees Fahrenheit. "
-   ::= { airFMStatus 11 }
-   
-airFMStatusSystemRemoteAvgHum OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote average air 
-       humidity. "
-   ::= { airFMStatus 12 }
-   
-airFMStatusSystemRemoteLowTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote low air 
-       temperature in tenths of degrees Celsius. "
-   ::= { airFMStatus 13 }
-   
-airFMStatusSystemRemoteLowTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The system remote low air 
-       temperature in tenths of degrees Fahrenheit. "
-   ::= { airFMStatus 14 }
-   
-airFMStatusSystemCoolingEnabled OBJECT-TYPE
-   SYNTAX INTEGER   {
-      enabledYes    (1),
-      enabledNo     (2)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The state of the system cooling
-       function enable. "
-   ::= { airFMStatus 15 }
-   
-airFMStatusSystemReheatingEnabled OBJECT-TYPE
-   SYNTAX INTEGER   {
-      enabledYes    (1),
-      enabledNo     (2)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The state of the system reheating
-       function enable. "
-   ::= { airFMStatus 16 }
-   
-airFMStatusSystemHumidifyEnabled OBJECT-TYPE
-   SYNTAX INTEGER   {
-      enabledYes    (1),
-      enabledNo     (2)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The state of the system humidify
-       function enable. "
-   ::= { airFMStatus 17 }
-   
-airFMStatusSystemDehumidifyEnabled OBJECT-TYPE
-   SYNTAX INTEGER   {
-      enabledYes    (1),
-      enabledNo     (2)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The state of the system dehumidify
-       function enable. "
-   ::= { airFMStatus 18 }
-   
-airFMStatusModuleTableSize OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of entries in the airFMStatusModuleTable. "   
-   ::= { airFMStatus 19 }   
-
-airFMStatusModuleTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF AirFMStatusModuleEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for getting information from each module
-       in the system. " 
-   ::= { airFMStatus 20 }
-
-airFMStatusModuleEntry OBJECT-TYPE
-   SYNTAX AirFMStatusModuleEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The module to get status from."
-   INDEX  { airFMStatusModuleIndex }
-   ::= { airFMStatusModuleTable 1 }
-
-AirFMStatusModuleEntry ::=
-   SEQUENCE {
-      airFMStatusModuleIndex               INTEGER,
-      airFMStatusModuleOutputCapacity      INTEGER,
-      airFMStatusModuleSupplyTempC         INTEGER,
-      airFMStatusModuleSupplyTempF         INTEGER,
-      airFMStatusModuleSupplyHum           INTEGER,
-      airFMStatusModuleReturnTempC         INTEGER, 
-      airFMStatusModuleReturnTempF         INTEGER, 
-      airFMStatusModuleReturnHum           INTEGER
-   }
-   
-airFMStatusModuleIndex OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index of the module information."
-   ::= { airFMStatusModuleEntry 1 }
-
-airFMStatusModuleOutputCapacity OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module output capacity in kilowatts."
-   ::= { airFMStatusModuleEntry 2 }
-   
-airFMStatusModuleSupplyTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module supply air temperature in 
-       tenths of degrees Celsius. "
-   ::= { airFMStatusModuleEntry 3 }
-   
-airFMStatusModuleSupplyTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module supply air temperature in 
-       tenths of degrees Fahrenheit. "
-   ::= { airFMStatusModuleEntry 4 }
-   
-airFMStatusModuleSupplyHum OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module supply air humidity. "
-   ::= { airFMStatusModuleEntry 5 }
-   
-airFMStatusModuleReturnTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module return air temperature in 
-       tenths of degrees Celsius. "
-   ::= { airFMStatusModuleEntry 6 }
-   
-airFMStatusModuleReturnTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module return air temperature in 
-       tenths of degrees Fahrenheit. "
-   ::= { airFMStatusModuleEntry 7 }
-   
-airFMStatusModuleReturnHum OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The module return air humidity. "
-   ::= { airFMStatusModuleEntry 8 }
-   
--- airFM AIR CONDITIONER GROUP DATA
-
-airFMGroupSysStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-        statusOnLine    (1),
-        statusIdle      (2),
-        statusLoadShare (3),
-        statusOffLine   (4),
-        statusFailed    (5)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of this system within the group. "
-   ::= { airFMGroup 1 }
-   
-airFMGroupSysRuntime OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The number of hours the system has been running. "
-   ::= { airFMGroup 2 }
-
-airFMGroupSysRole OBJECT-TYPE
-   SYNTAX INTEGER {
-        rolePrimary     (1),
-        roleBackup      (2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The role of this system within the group. "
-   ::= { airFMGroup 3 }
-
--- airPA Portable Air Conditioner Ident
-
-airPAIdentName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the device name. "
-   ::= { airPAIdent 1 }
-   
-airPAModelNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the device model number. "
-   ::= { airPAIdent 2 }
-   
-airPADateOfManufacture OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying when the device was produced. "
-   ::= { airPAIdent 3 }
-   
-airPASerialNumber OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the device serial number. "
-   ::= { airPAIdent 4 }
-
-airPAFirmwareRevision OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the device firmware revision. "
-   ::= { airPAIdent 5 }
-
-airPAHardwareRevision OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the device hardware revision. "
-   ::= { airPAIdent 6 }
-
--- airPA Portable Air Conditioner Status
-
-airPASystemPower OBJECT-TYPE
-   SYNTAX INTEGER   {
-      powerON   (1),
-      powerOFF  (2)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The status of the unit's system power setting.
-      
-        ON(1)   The system power is turned on.
-        OFF(2)  The system power is turned off. "
-   ::= { airPAStatus 1 }
-
-airPAOperatingMode OBJECT-TYPE
-   SYNTAX INTEGER   {
-      modeOFF       (1),
-      modeVENTING   (2),
-      modeCOOLING   (3)
-   }    
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The current operating mode of the unit.
-
-        OFF(1)      The system is off.
-        VENTING(2)  The system's venting function is active.
-        COOLING(3)  The system's cooling function is active. "
-   ::= { airPAStatus 2 }
-
-airPASetpointTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature setpoint in Fahrenheit to which the unit is controlling. "
-   ::= { airPAStatus 3 }
-
-airPASetpointTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature setpoint in Celsius to which the unity is controlling. "
-   ::= { airPAStatus 4 }
-
-airPABlowerSpeed OBJECT-TYPE
-   SYNTAX INTEGER   {
-        speedLOW    (1),
-        speedHIGH   (2)
-    }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The unit's blower speed setting.
-
-        LOW(1)      The blower speed is low.
-        HIGH(2)     The blower speed is high. "
-   ::= { airPAStatus 5 }
-
-airPACompressor OBJECT-TYPE
-   SYNTAX INTEGER   {
-        statusON    (1),
-        statusOFF   (2)
-    }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The unit's compressor status.
-
-        ON(1)   The compressor is turned on.
-        OFF(2)  The compressor is turned off. "
-   ::= { airPAStatus 6 }
-
-airPACondenserFan OBJECT-TYPE
-   SYNTAX INTEGER   {
-        statusON    (1),
-        statusOFF   (2)
-    }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The unit's condenser fan status.
-
-        ON(1)   The condenser fan is turned on.
-        OFF(2)  The condenser fan is turned off. "
-   ::= { airPAStatus 7 }
-
-airPACondensatePump OBJECT-TYPE
-   SYNTAX INTEGER   {
-        statusON    (1),
-        statusOFF   (2)
-    }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The unit's condensate pump status.
-      
-        ON(1)   The condensate pump is turned on.
-        OFF(2)  The condensate pump is turned off. "
-   ::= { airPAStatus 8 }
-
-airPASupplyTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The supply temperature in degrees Fahrenheit. "
-   ::= { airPAStatus 9 }
-
-airPASupplyTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The supply temperature in degrees Celsius. "
-   ::= { airPAStatus 10 }
-
-airPAReturnTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The return temperature in degrees Fahrenheit. "
-   ::= { airPAStatus 11 }
-
-airPAReturnTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The return temperature in degrees Celsius. "
-   ::= { airPAStatus 12 }
-
-airPARemoteTempF OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The remote temperature in degrees Fahrenheit. "
-   ::= { airPAStatus 13 }
-
-airPARemoteTempC OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The remote temperature in degrees Celsius. "
-   ::= { airPAStatus 14 }
-
-airPARemoteHumidity OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The remote humidity. "
-   ::= { airPAStatus 15 }
-
---  RACK AIR REMOVAL UNIT IDENT
-
-rARUIdentTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF IdentRARUEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for query of the individual devices. 
-       The number of entries is contained in the 
-       rARUStatusAruDeviceCount OID."
-   ::= { rARUIdent 1 }
-
-rARUIdentEntry OBJECT-TYPE
-   SYNTAX IdentRARUEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The device to query."
-   INDEX  { rARUIdentIndex}
-   ::= { rARUIdentTable 1 }
-
-IdentRARUEntry ::=
-   SEQUENCE {
-      rARUIdentIndex                 INTEGER,
-      rARUIdentName                  DisplayString
-   }      
-
-rARUIdentIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the device entry."
-   ::= { rARUIdentEntry 1 }
-
-rARUIdentName OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "A character string identifying the 
-       device. "
-   ::= { rARUIdentEntry 2 }
-
-
--- RACK AIR REMOVAL UNIT CONFIGURATION
-
-rARUConfigTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF ConfigRARUEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for configuration of individual ARUs. The number of
-       entries is contained in the rARUStatusAruDeviceCount OID."
-   ::= { rARUConfig 1 }
-
-rARUConfigEntry OBJECT-TYPE
-   SYNTAX ConfigRARUEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The ARUs to configure."
-   INDEX  { rARUConfigAruIndex }
-   ::= { rARUConfigTable 1 }
-
-ConfigRARUEntry ::=
-   SEQUENCE {
-      rARUConfigAruIndex                  INTEGER,
-      rARUConfigAruName                   DisplayString,
-      rARUConfigAruRemoteSetpoint         INTEGER,
-      rARUConfigAruTempOvrdEnableDisable  INTEGER,
-      rARUConfigAruTempOvrdSetpoint       INTEGER
-   }      
-
-rARUConfigAruIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the device entry."
-   ::= { rARUConfigEntry 1 }
-   
-rARUConfigAruName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-write
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the ARU."
-   ::= { rARUConfigEntry 2 }
-
-rARUConfigAruRemoteSetpoint OBJECT-TYPE
-   SYNTAX INTEGER       {
-      aruOff          (1),
-      aru85F-29C      (2),
-      aru90F-32C      (3),
-      aru95F-35C      (4),
-      aru100F-38C     (5),
-      aru7kW          (6),
-      aru5kW          (7),
-      aru3kW          (8),
-      aru2kW          (9)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID is the Remote setpoint of the ARU.
-       NOTE: -1 will be returned if the ARU is not communicating."
-
-   ::= { rARUConfigEntry 3 }
-
-rARUConfigAruTempOvrdEnableDisable OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID is used to enable/disable the remote temperature override setting of the ARU.
-  
-       If this OID is set to 1, the remote setting for temperature override is disabled.
-       If this OID is set to 2, the remote setting for temperature override is enabled."
-   ::= { rARUConfigEntry 4 }
-
-rARUConfigAruTempOvrdSetpoint OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-write
-   STATUS mandatory
-   DESCRIPTION
-      "This OID is the Temperature Override setpoint of the ARU.
-       NOTE: -1 will be returned if the ARU is not communicating."
-
-   ::= { rARUConfigEntry 5 }
-   
--- RACK AIR REMOVAL UNIT STATUS
-
-rARUStatusAruDeviceCount OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The total number of ARUs accessible from this IP."
-   ::= { rARUStatus 1 }
-
-rARUStatusSysTempUnits OBJECT-TYPE
-   SYNTAX INTEGER {
-      celsius(1),
-      fahrenheit(2)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The temperature scale used to display the temperature
-       in the system, Celsius(1) or Fahrenheit(2).
-       This setting is based on the system preferences
-       configuration in the agent."
-   ::= { rARUStatus 2 }
-
-rARUStatusTable OBJECT-TYPE
-   SYNTAX SEQUENCE OF StatusRARUEntry
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "Allows for access of individual ARUs. The number of
-       entries is contained in the rARUStatusAruDeviceCount OID."
-   ::= { rARUStatus 3 }
-
-rARUStatusEntry OBJECT-TYPE
-   SYNTAX StatusRARUEntry  
-   ACCESS not-accessible
-   STATUS mandatory
-   DESCRIPTION
-      "The ARUs to access."
-   INDEX  { rARUStatusAruIndex }
-   ::= { rARUStatusTable 1 }
-
-StatusRARUEntry ::=
-   SEQUENCE {
-      rARUStatusAruIndex                 INTEGER,
-      rARUStatusAruName                  DisplayString,
-      rARUStatusAruRemoteSetpoint        INTEGER,      
-      rARUStatusAruManualSetpoint        INTEGER,      
-      rARUStatusAruTemp1                 INTEGER,      
-      rARUStatusAruTemp2                 INTEGER,      
-      rARUStatusAruTemp3                 INTEGER,      
-      rARUStatusAruTempOvrdEnableDisable INTEGER,      
-      rARUStatusAruTempOvrdSetpoint      INTEGER,      
-      rARUStatusAruAlarmState            DisplayString,
-      rARUStatusAruCommStatus            INTEGER
-   }
-
-rARUStatusAruIndex OBJECT-TYPE
-   SYNTAX INTEGER 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The index to the ARU entry."
-   ::= { rARUStatusEntry 1 }
-   
-rARUStatusAruName   OBJECT-TYPE
-   SYNTAX  DisplayString 
-   ACCESS  read-only
-   STATUS  mandatory
-   DESCRIPTION
-      "The name of the ARU."
-   ::= { rARUStatusEntry 2 }
-
-rARUStatusAruRemoteSetpoint OBJECT-TYPE
-   SYNTAX INTEGER       {
-      aruOff          (1),
-      aru85F-29C      (2),
-      aru90F-32C      (3),
-      aru95F-35C      (4),
-      aru100F-38C     (5),
-      aru7kW          (6),
-      aru5kW          (7),
-      aru3kW          (8),
-      aru2kW          (9)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "ARU remote setpoint temperature setting.
-
-      NOTE: -1 will be returned if the ARU is not communicating.
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the rARUStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { rARUStatusEntry 3 }
-
-rARUStatusAruManualSetpoint OBJECT-TYPE
-   SYNTAX INTEGER       {
-      aruOff          (1),
-      aru85F-29C      (2),
-      aru90F-32C      (3),
-      aru95F-35C      (4),
-      aru100F-38C     (5),
-      aru7kW          (6),
-      aru5kW          (7),
-      aru3kW          (8),
-      aru2kW          (9),
-      aruRem          (10)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "ARU manual setpoint temperature setting. 
-
-      NOTE: -1 will be returned if the ARU is not communicating.
-
-      Values are represented in whole number degrees.
-      If the manual setpoint is set to Remote, this OID will return 0.
-      Units are displayed in the scale shown in
-      the rARUStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { rARUStatusEntry 4 }
-
-rARUStatusAruTemp1 OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "ARU temperature probe #1 reading. 
-
-      NOTE: -1 will be returned if the ARU is not communicating.
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the rARUStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { rARUStatusEntry 5 }
-
-rARUStatusAruTemp2 OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "ARU temperature probe #2 reading. 
-
-      NOTE: -1 will be returned if the ARU is not communicating.
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the rARUStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { rARUStatusEntry 6 }
-
-rARUStatusAruTemp3 OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "ARU temperature probe #3 reading. 
-
-      NOTE: -1 will be returned if the ARU is not communicating.
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the rARUStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { rARUStatusEntry 7 }
-
-rARUStatusAruTempOvrdEnableDisable OBJECT-TYPE
-   SYNTAX INTEGER       {
-      disabled(1),
-      enabled(2)
-   }
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "This OID indicates whether the ARU remote temperature override is enabled or disabled.
-       If this OID is a 1, the remote setting for temperature override is disabled.
-       If this OID is a 2, the remote setting for temperature override is enabled."
-   ::= { rARUStatusEntry 8 }
-
-rARUStatusAruTempOvrdSetpoint OBJECT-TYPE
-   SYNTAX INTEGER
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "ARU remote temperature override setpoint setting. 
-
-      NOTE: -1 will be returned if the ARU is not communicating.
-
-      Values are represented in whole number degrees.
-      Units are displayed in the scale shown in
-      the rARUStatusSysTempUnits OID (Celsius or Fahrenheit)."
-   ::= { rARUStatusEntry 9 }
-
-rARUStatusAruAlarmState OBJECT-TYPE
-   SYNTAX DisplayString
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "An ASCII string containing the 8 flags representing
-       the current alarm state of the ARU. If the state of 
-       the ARU is unknown, this variable is set to ‘UNKNOWN’.
-
-       The flags are numbered 1 to 8, read from left to
-       right. The flags are defined as follows:
-       
-       Flag  1: Fan Fail 1
-       Flag  2: Fan Fail 2
-       Flag  3: Fan Fail 3
-       Flag  4: Smoke
-            
-       Flag  5: High Temp (Out of Thermal Control)
-       Flag  6: Over Temp (Exhaust Temp. Exceeds Override Setpoint)
-       Flag  7: Reserved
-       Flag  8: Reserved"
-   ::= { rARUStatusEntry 10 }
-
-rARUStatusAruCommStatus OBJECT-TYPE
-   SYNTAX INTEGER {
-      commsNeverDiscovered(1),
-      commsEstablished(2),
-      commsLost(3)
-   } 
-   ACCESS read-only
-   STATUS mandatory
-   DESCRIPTION
-      "The state of communications to the device.
-      commNeverDiscovered(1) indicates there has never been communications with this device.
-      commsEstablished(2) indicates communication is normal and active with this device.
-      commsLost(3) indicates communication had been established, but is no device."
-   ::= { rARUStatusEntry 11 }
-
--- Traps
--- Annotations are provided for Novell's NMS product
---
--- Each trap has at least one variable (mtrapargsString) which always appears
--- as the last variable in the list. This variable contains either a static
--- or dynamically-constructed string which provides an enhanced description of
--- the trap's purpose and any pertinent information about the trap.
-
-communicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Communication to the UPS has been lost.  Steps
-        to reestablish communication are in progress."
-   --#TYPE "APC UPS: Communication lost"
-   --#SUMMARY "Communication lost between the agent and the UPS."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 1
-
-upsOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The UPS has sensed a load greater than 100 percent
-       of its rated capacity."
-   --#TYPE "APC UPS: Overload"
-   --#SUMMARY "The UPS has sensed a load greater than 100 percent of its rated capacity."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 2
-
-upsDiagnosticsFailed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The UPS failed its internal diagnostic self-test."
-   --#TYPE "APC UPS: Failed self-test"
-   --#SUMMARY "The UPS has failed its internal self-test."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 3
-
-upsDischarged TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The UPS batteries are discharged; if utility power fails
-       an immediate low battery condition will exist.  Sufficient runtime 
-       for necessary action cannot be guaranteed."
-   --#TYPE "APC UPS: batteries are discharged"
-   --#SUMMARY "The UPS batteries are discharged."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 4
-
-upsOnBattery TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The UPS has switched to battery backup power."
-   --#TYPE "APC UPS: On battery"
-   --#SUMMARY "The UPS has switched to battery backup power."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 5
-
-smartBoostOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The UPS has enabled SmartBoost(TM)."
-   --#TYPE "APC UPS: SmartBoost(TM)"
-   --#SUMMARY "The UPS has enabled SmartBoost(TM); low incoming line voltage."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 6
-
-lowBattery TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The UPS batteries are low and will soon be exhausted.
-       If utility power is not restored the UPS will put itself 
-       to 'sleep' and immediately cut power to the load."
-   --#TYPE "APC UPS: Low battery"
-   --#SUMMARY "The UPS system's batteries are low and will soon be exhausted."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 7
-
-communicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communication with the UPS has been established."
-   --#TYPE "APC UPS: Communication established"
-   --#SUMMARY "UPS communication has been established."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 8
-
-powerRestored TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Utility power has been restored."
-   --#TYPE "APC UPS: Utility power restored"
-   --#SUMMARY "Returned from battery backup power; utility power restored."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 9
-
-upsDiagnosticsPassed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The UPS passed its internal self-test."
-   --#TYPE "APC UPS: Passed self-test"
-   --#SUMMARY "The UPS passed internal self-test."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 10
-
-returnFromLowBattery TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The UPS has returned from a low battery
-       condition."
-   --#TYPE "APC UPS: Returned from Low-Battery condition"
-   --#SUMMARY "The UPS has returned from a Low-Battery condition."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 11
-
-upsTurnedOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The UPS has been turned 'off' by the management station."
-   --#TYPE "APC UPS: Turned off"
-   --#SUMMARY "The UPS has been switched off by a management station."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 12
-
-upsSleeping   TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The UPS is entering 'sleep' mode.  Power 
-       to the load will be cut off."
-   --#TYPE "APC UPS: Entered sleep mode"
-   --#SUMMARY "The UPS entered sleep mode. Power to the load will be cut off."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 13
-
-upsWokeUp TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATION: The UPS has returned from 'sleep' mode.  Power 
-       to the load has been restored."
-   --#TYPE "APC UPS: Wake up"
-   --#SUMMARY "The UPS has returned from sleep mode. Power to the load has been restored."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 14
-
-upsRebootStarted TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The UPS has started its reboot sequence.
-       The UPS will reboot itself at this time."
-   --#TYPE "APC UPS: Starting reboot"
-   --#SUMMARY "The UPS has started its reboot sequence."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 15 
-
-upsDipSwitchChanged TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The dip switch settings on the UPS have been
-       changed, possibly altering UPS performance."
-   --#TYPE "APC UPS: DIP switch altered"
-   --#SUMMARY "The DIP switch settings on the UPS have been changed."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 16
-
-upsBatteryNeedsReplacement TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The batteries of the UPS need immediate replacement." 
-   --#TYPE "APC UPS: UPS batteries need replacement"
-   --#SUMMARY "The UPS batteries require immediate replacement."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 17
-
-
--- the Environmental Monitor traps
-
-contactFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: One of the contacts on the Environmental Monitor has 
-       changed from its default position. The first variable is
-       the contact number that is faulted."
-   --#TYPE "APC Environment: Contact fault"
-   --#SUMMARY "An Environment contact closure has faulted."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 18
-
-contactFaultResolved TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A fault on one of the Environmental Monitor contacts
-       has been resolved. The first variable is
-       the contact number that has been resolved."
-   --#TYPE "APC Environment: Contact fault cleared."
-   --#SUMMARY "A Environment contact closure has returned to it's default state."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 19
-
--- the Matrix-UPS traps
-
-hardwareFailureBypass TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: UPS on bypass due to internal fault"
-   --#TYPE "APC UPS: On bypass due to internal fault"
-   --#SUMMARY "The UPS is on bypass due to an internal fault."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 20
-
-softwareBypass TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: UPS on bypass - user set via software or panel"
-   --#TYPE "APC UPS: On bypass by user via software or panel"
-   --#SUMMARY "UPS put on bypass by user via software or front UPS panel."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 21
-
-switchedBypass TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: UPS on bypass - initiated by user"
-   --#TYPE "APC UPS: On bypass initiated by user"
-   --#SUMMARY "UPS put on bypass by user."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 22
-
-returnFromBypass TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: UPS has returned from bypass"
-   --#TYPE "APC UPS: UPS has returned from bypass"
-   --#SUMMARY "The UPS has returned from bypass mode."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 23
-
-bypassPowerSupplyFailure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Base module bypass power supply needs repair"
-   --#TYPE "APC UPS: Base module bypass power supply needs repair"
-   --#SUMMARY "The base module bypass power supply needs repair."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 24
-
-baseFanFailure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Base module fan needs repair"
-   --#TYPE "APC UPS: Base module fan needs repair"
-   --#SUMMARY "The base module fan needs repair."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 25
-
-batteryPackCommLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Check installation of external battery packs signal cable"
-   --#TYPE "APC UPS: Communication lost with battery packs"
-   --#SUMMARY "Communication lost with external battery packs, check battery signal cable."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 26
-
-batteryPackCommEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: UPS is communicating with the external battery packs."
-   --#TYPE "APC UPS: Communication established with battery packs"
-   --#SUMMARY "Communication established with external battery packs."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 27
-
-calibrationStart TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A battery calibration test has been initiated on the UPS."
-   --#TYPE "APC UPS: Calibration initiated"
-   --#SUMMARY "A battery run time calibration test has been initiated."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 28
-
--- Misc. Traps
-
-restartAgent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Agent restarting as commanded by manager."
-   --#TYPE "APC SNMP Agent: Agent restarting"
-   --#SUMMARY "Agent restarting as commanded by manager."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 29
-
-upsTurnedOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A UPS is turned on."
-   --#TYPE "APC UPS: A UPS is turned on."
-   --#SUMMARY " A UPS is turned on."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 30
-
-smartAvrReducing TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The UPS is reducing the line voltage via SmartTrim(TM)."
-   --#TYPE "APC UPS: SmartTrim(TM) reducing"
-   --#SUMMARY "The UPS has enabled SmartTrim(TM) voltage reduction."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 31
-
-codeAuthenticationDone TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES   { mconfigTFTPServerIP, newCodeAuthentViaTFTP }
-   DESCRIPTION
-      "INFORMATIONAL: Authentication on agent code image is done."
-   --#TYPE "APC CODE: Authentication on agent code image is done."
-   --#SUMMARY "Authentication on agent code image is done."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 32
-
-upsOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The overload condition has been cleared."
-   --#TYPE "APC UPS: Overload cleared."
-   --#SUMMARY "The overload condition has been cleared. ."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 33
-
-smartBoostOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The UPS has returned from SmartBoost(TM)."
-   --#TYPE "APC UPS: SmartBoost(TM) off."
-   --#SUMMARY "The UPS has returned from SmartBoost(TM)."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 34
-
-smartAvrReducingOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The UPS has returned from SmartTrim(TM)."
-   --#TYPE "APC UPS: SmartTrim(TM) reducing off"
-   --#SUMMARY "The UPS has returned from SmartTrim(TM) voltage reduction."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 35
-   
-upsBatteryReplaced TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A bad battery fault has been cleared."
-   --#TYPE "APC UPS: Bad battery replaced"
-   --#SUMMARY "The UPS has returned from a bad battery fault."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 36
-
-calibrationEnd TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The UPS has finished calibrating."
-   --#TYPE "APC UPS: Calibration end"
-   --#SUMMARY "The UPS has finished calibrating"
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 37
-
-dischargeCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A UPS discharge condition has been cleared."
-   --#TYPE "APC UPS: Discharge cleared."
-   --#SUMMARY "The UPS discharge condition has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 38
-
-gracefullShutdown TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A graceful shutdown has been initiated."
-   --#TYPE "APC UPS: A graceful shutdown has been initiated."
-   --#SUMMARY "A graceful shutdown has been initiated."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 39
-
-   
-outletOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUOutletControlIndex }
-   DESCRIPTION
-       "WARNING: The specified PDU outlet has turned on.
-       If sPDUOutletControlIndex equals zero, then all outlets have 
-       turned on."
-   --#TYPE "APC PDU: Outlet has been turned on."
-   --#SUMMARY "Outlet has been turned on"
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 41
-   
-
-outletOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUOutletControlIndex }
-   DESCRIPTION
-       "WARNING: The specified PDU outlet has turned off.
-       If sPDUOutletControlIndex equals zero, then all outlets 
-       have turned off."
-   --#TYPE "APC PDU: Outlet has turned off."
-   --#SUMMARY "Outlet has turned off."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 42
-   
-outletReboot TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUOutletControlIndex }
-   DESCRIPTION
-       "WARNING: The specified PDU outlet has rebooted.
-       If sPDUOutletControlIndex equals zero, then all outlets 
-       have rebooted."
-   --#TYPE "APC PDU: Outlet has rebooted."
-   --#SUMMARY "Outlet has rebooted."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 43
-
-configChangeSNMP TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The SNMP configuration has been changed."
-   --#TYPE "APC: The SNMP configuration has been changed."
-   --#SUMMARY "The SNMP configuration has been changed."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 44
-   
-   
-configChangeOutlet TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUOutletConfigIndex }
-   DESCRIPTION
-       "WARNING: The specified PDU outlet has changed configuration.
-       If sPDUOutletConfigIndex equals zero, then the Master outlet 
-       has changed configuration."
-   --#TYPE "APC PDU: Outlet configuration has been changed."
-   --#SUMMARY "Outlet configuration has been changed."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 45
-
-accessViolationConsole TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: Someone has attempted to login via the console with the incorrect password."
-   --#TYPE "APC: Access violation via the console."
-   --#SUMMARY "Three unsuccessful logins have been attempted via the console."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 46
-
-accessViolationHTTP TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: Someone has attempted to login via HTTP with the incorrect password."
-   --#TYPE "APC: Access violation via HTTP."
-   --#SUMMARY "An unsuccessful attempt to login via HTTP."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 47
-   
-passwordChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The password for the device has been changed."
-   --#TYPE "APC: Password change for the device."
-   --#SUMMARY "Someone has changed the password on the device."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 48
-
-badVoltage TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The output voltage is not within acceptable range."
-   --#TYPE "APC UPS: Bad output voltage."
-   --#SUMMARY "The output voltage is not within acceptable range."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 49
-   
-badVoltageCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The output voltage has returned to an acceptable level."
-   --#TYPE "APC UPS: The bad voltage output condition has been cleared."
-   --#SUMMARY "The output voltage has returned to an acceptable level."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 50
-   
-chargerFailure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The battery charger has failed."
-   --#TYPE "APC UPS: The battery charger has failed."
-   --#SUMMARY "The battery charger has failed."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 51
-
-chargerFailureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The battery charger failure condition has been cleared."
-   --#TYPE "APC UPS: The battery charger failure condition cleared"
-   --#SUMMARY "The battery charger failure condition has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 52
-
-batteryOverTemperature TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The battery temperature threshold has been violated."
-   --#TYPE "APC UPS: The battery temperature threshold has been violated."
-   --#SUMMARY "The battery temperature threshold has been violated."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 53
-
-batteryOverTemperatureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The battery over temperature has been cleared."
-   --#TYPE "APC UPS: The battery over temperature has been cleared."
-   --#SUMMARY "The battery over temperature has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 54
-   
- smartRelayFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: SmartBoost(TM) or SmartTrim(TM) relay fault."
-   --#TYPE "APC UPS: SmartBoost(TM) or SmartTrim(TM) relay fault."
-   --#SUMMARY "SmartBoost(TM) or SmartTrim(TM) relay fault."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 55
-
-smartRelayFaultCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: SmartBoost(TM) or SmartTrim(TM) relay fault has been cleared."
-   --#TYPE "APC UPS: SmartBoost(TM) or SmartTrim(TM) relay fault cleared."
-   --#SUMMARY "SmartBoost(TM) or SmartTrim(TM) relay fault has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 56
-   
-humidityThresholdViolation1 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Probe 1 humidity threshold violated. The
-       first variable is the current humidity."
-   --#TYPE "APC Environmental Monitor: Probe 1 humidity threshold violation"
-   --#SUMMARY "A humidity threshold has been violated on probe 1."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 57
-
-humidityThresholdViolationCleared1 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Environmental Monitor humidity threshold violation has been cleared on probe 1."
-   --#TYPE "APC Environmental Monitor: Probe 1 humidity violation cleared"
-   --#SUMMARY "A humidity threshold violation has been cleared on probe 1."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 58
-
-temperatureThresholdViolation1 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: An Environmental Monitor temperature threshold has been violated on probe 1.
-      The first variable is the current temperature."
-   --#TYPE "APC Environmental Monitor: Probe 1 temperature violation"
-   --#SUMMARY "A temperature threshold has been violated on probe 1."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 59
-   
-temperatureThresholdViolationCleared1 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Environmental Monitor temperature threshold violation has been cleared on probe 1."
-   --#TYPE "APC Environmental Monitor: Probe 1 temperature violation cleared"
-   --#SUMMARY "A temperature threshold violation has been cleared on probe 1."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 60
-   
-humidityThresholdViolation2 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: An Environmental Monitor humidity threshold has been violated on probe 2.
-      The first variable is the current humidity."
-   --#TYPE "APC Environmental Monitor: Probe 2 humidity violation"
-   --#SUMMARY "A humidity threshold has been violated on probe 2."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 61
-   
-humidityThresholdViolationCleared2 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Environmental Monitor humidity threshold violation has been cleared on probe 2."
-   --#TYPE "APC Environmental Monitor: Probe 2 humidity violation cleared"
-   --#SUMMARY "A humidity threshold violation has been cleared on probe 2."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 62
-
-temperatureThresholdViolation2 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: An Environmental Monitor temperature threshold has been violated on probe 2.
-       The first variable is the current temperature."
-   --#TYPE "APC Environmental Monitor: Probe 2 temperature violation"
-   --#SUMMARY "A temperature threshold has been violated on probe 2."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 63
-   
-temperatureThresholdViolationCleared2 TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Environmental Monitor temperature threshold violation has been cleared on probe 2."
-   --#TYPE "APC Environmental Monitor: Probe 2 temperature violation cleared"
-   --#SUMMARY "A temperature threshold violation has been cleared on probe 2."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 64
-
-mupsCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communication with the Environmental Monitor has been established."
-   --#TYPE "APC Environmental Monitor: Communication established"
-   --#SUMMARY "Communication established between the agent and the Environmental Monitor."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 65
-
-mupsCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Communication to the Environmental Monitor has been lost.  Steps
-        to reestablish communication are in progress."
-   --#TYPE "APC Environmental Monitor: Communication failure"
-   --#SUMMARY "Communication lost between the agent and the Environmental Monitor."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 66
-
-batteryIncrease TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The number of batteries has increased."
-   --#TYPE "APC UPS: The number of batteries has increased."
-   --#SUMMARY "The number of batteries has increased."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 67
-   
-batteryDecrease TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The number of batteries has decreased."
-   --#TYPE "APC UPS: The number of batteries has decreased."
-   --#SUMMARY "The number of batteries has decreased."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 68
-   
-powerModuleIncrease TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The number of power modules has increased."
-   --#TYPE "APC UPS: The number of power modules has increased."
-   --#SUMMARY "The number of power modules has increased."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 69
-
-powerModuleDecrease TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The number of power modules has decreased."
-   --#TYPE "APC UPS: The number of power modules has decreased."
-   --#SUMMARY "The number of power modules has decreased."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 70
-   
-intelligenceModuleInserted TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An intelligence module has been inserted."
-   --#TYPE "APC UPS: An intelligence module has been inserted."
-   --#SUMMARY "An intelligence module has been inserted."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 71
-
-intelligenceModuleRemoved TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An intelligence module has been removed."
-   --#TYPE "APC UPS: An intelligence module has been removed."
-   --#SUMMARY "An intelligence module has been removed."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 72
-   
-rintelligenceModuleInserted TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A redundant intelligence module has been inserted."
-   --#TYPE "APC UPS: A redundant intelligence module has been inserted."
-   --#SUMMARY "A redundant intelligence module has been inserted."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 73
-
-rintelligenceModuleRemoved TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A redundant intelligence module has been removed."
-   --#TYPE "APC UPS: A redundant intelligence module has been removed."
-   --#SUMMARY "A redundant intelligence module has been removed."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 74
-   
-extBatteryFrameIncease TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An external battery frame has been added."
-   --#TYPE "APC UPS: An external battery frame has been added."
-   --#SUMMARY "An external battery frame has been added."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 75
-
-extBatteryFrameDecrease TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An external battery frame has been removed."
-   --#TYPE "APC UPS: An external battery frame has been removed."
-   --#SUMMARY "An external battery frame has been removed."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 76
-   
-abnormalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: An abnormal condition has been detected.
-       The first variable is the fault condition."
-   --#TYPE "APC: An abnormal condition has been detected."
-   --#SUMMARY "An abnormal condition has been detected."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 77
-
-abnormalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An abnormal condition has been cleared.
-      The first variable is the fault condition."
-   --#TYPE "APC: An abnormal condition has been cleared."
-   --#SUMMARY "An abnormal condition has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 78
-
-deviceStatusChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString}
-   DESCRIPTION
-      "INFORMATIONAL: The status of the device being monitored has changed."
-   --#TYPE "APC : The status of the device being monitored has changed."
-   --#SUMMARY "The status of the device being monitored has changed."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 79
-   
-noBatteries TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The UPS has no batteries attached."
-   --#TYPE "APC UPS: No batteries attached."
-   --#SUMMARY "The UPS has no batteries attached."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 80
-   
-noBatteriesCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The UPS's batteries have been attached."
-   --#TYPE "APC UPS: The no batteries attached condition has been cleared."
-   --#SUMMARY "The UPS's batteries have been attached."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 81
-   
-userAdded TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A new user has been added."
-   --#TYPE "APC: A new user has been added."
-   --#SUMMARY "A new user has been added."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 82
-
-userDeleted TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A user has been deleted."
-   --#TYPE "APC: A user has been deleted."
-   --#SUMMARY "A user has been deleted."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 83
-
-userModified TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A user has been modified."
-   --#TYPE "APC: A user has been modified."
-   --#SUMMARY "A user has been modified."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 84
-
--- MasterSwitch Vm Traps
-
-msvmCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communications with the MasterSwitch VM has been established."
-   --#TYPE "APC: Communications established with the MasterSwitch VM."
-   --#SUMMARY "Communications with the MasterSwitch VM has been established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 85
-
-msvmCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communications with the MasterSwitch VM has been lost."
-   --#TYPE "APC: Communications lost with the MasterSwitch VM."
-   --#SUMMARY "Communications with the MasterSwitch VM has been lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 86
-
-msvmOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The MasterSwitch VM in an overload condition."
-   --#TYPE "APC: The MasterSwitch VM is near or at an overload condition."
-   --#SUMMARY "The MasterSwitch VM is near or at an overload condition."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 87
-
-msvmOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The overload condition on the MasterSwitch VM has been cleared."
-   --#TYPE "APC: The overload condition cleared on the MasterSwitch VM."
-   --#SUMMARY "The overload condition on the MasterSwitch VM has been cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 88
-
-msvmOutletOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, 
-               sPDUOutletControlVMOutletIndex, sPDUOutletControlVMOutletName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on the MasterSwitch VM has turned on."
-   --#TYPE "APC: An outlet on the MasterSwitch VM has turned on."
-   --#SUMMARY "An outlet on the MasterSwitch VM has turned on."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 89
-
-msvmOutletOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, 
-               sPDUOutletControlVMOutletIndex, sPDUOutletControlVMOutletName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on the MasterSwitch VM has turned off."
-   --#TYPE "APC: An outlet on the MasterSwitch VM has turned off."
-   --#SUMMARY "An outlet on the MasterSwitch VM has turned off."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 90
-
-msvmDeviceConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A device configuration change has been made on a MasterSwitch VM."
-   --#TYPE "APC: A device configuration change on a MasterSwitch VM."
-   --#SUMMARY "A device configuration change has been made on a MasterSwitch VM."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 91
-
-msvmOutletConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, 
-               sPDUOutletControlVMOutletIndex, sPDUOutletControlVMOutletName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet configuration change has been made on a MasterSwitch VM."
-   --#TYPE "APC: An outlet configuration change on a MasterSwitch VM."
-   --#SUMMARY "An outlet configuration change has been made on a MasterSwitch VM."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 92
-
-msvmLowLoad TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The MasterSwitch VM has violated the low load threshold."
-   --#TYPE "APC: The MasterSwitch VM has violated the low load threshold."
-   --#SUMMARY "The MasterSwitch VM has violated the low load threshold."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 93
-
-msvmLowLoadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The low load condition on the MasterSwitch VM has been cleared."
-   --#TYPE "APC: The low load condition cleared on the MasterSwitch VM."
-   --#SUMMARY "The low load condition on the MasterSwitch VM has been cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 94
-
-msvmNearOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The MasterSwitch VM is approaching an overload condition."
-   --#TYPE "APC: The MasterSwitch VM is near or at an overload condition."
-   --#SUMMARY "The MasterSwitch VM is near or at an overload condition."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 95
-
-msvmNearOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The near overload condition on the MasterSwitch VM has been cleared."
-   --#TYPE "APC: The overload condition cleared on the MasterSwitch VM."
-   --#SUMMARY "The overload condition on the MasterSwitch VM has been cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 96
-
-msvmPowerSupplyStatusChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlVMIndex, sPDUMasterControlVMName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The power supply status of the MasterSwitch VM has changed."
-   --#TYPE "APC: The power supply status changed on MasterSwitch VM"
-   --#SUMMARY "The power supply status of the MasterSwitch VM has changed."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 97
-
--- MasterSwitch plus (MSP) Traps
-
-mspCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlMSPIndex, sPDUMasterControlMSPName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communications with the MasterSwitch plus has been established."
-   --#TYPE "APC: Communications established with the MasterSwitch plus."
-   --#SUMMARY "Communications with the MasterSwitch plus has been established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 98
-
-mspCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlMSPIndex, sPDUMasterControlMSPName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communications with the MasterSwitch plus has been lost."
-   --#TYPE "APC: Communications lost with the MasterSwitch plus."
-   --#SUMMARY "Communications with the MasterSwitch plus has been lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 99
-
-mspOutletOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlMSPIndex, sPDUMasterControlMSPName, 
-               sPDUOutletControlMSPOutletIndex, sPDUOutletControlMSPOutletName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on the MasterSwitch plus has turned on."
-   --#TYPE "APC: An outlet on the MasterSwitch plus has turned on."
-   --#SUMMARY "An outlet on the MasterSwitch plus has turned on."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 100
-
-mspOutletOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlMSPIndex, sPDUMasterControlMSPName, 
-               sPDUOutletControlMSPOutletIndex, sPDUOutletControlMSPOutletName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on the MasterSwitch plus has turned off."
-   --#TYPE "APC: An outlet on the MasterSwitch plus has turned off."
-   --#SUMMARY "An outlet on the MasterSwitch plus has turned off."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 101
-
-mspDeviceConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlMSPIndex, sPDUMasterControlMSPName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A device configuration change has been made on a MasterSwitch plus."
-   --#TYPE "APC: A device configuration change on a MasterSwitch plus."
-   --#SUMMARY "A device configuration change has been made on a MasterSwitch plus."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 102
-
-mspOutletConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { sPDUMasterControlMSPIndex, sPDUMasterControlMSPName, sPDUOutletControlMSPOutletIndex, sPDUOutletControlMSPOutletName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet configuration change has been made on a MasterSwitch plus."
-   --#TYPE "APC: An outlet configuration change on a MasterSwitch plus."
-   --#SUMMARY "An outlet configuration change has been made on a MasterSwitch plus."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 103
-
-rsSourceSwitched TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger02, mtrapargsString03, mtrapargsInteger, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The Redundant Switch has switched source.
-       The first variable is an integer representing the current source: 0=A, 1=B.
-       The second variable is the 32-character name of the current source.
-       The third variable is an integer representing the transfer cause:
-        0=No Transfers Recorded, 1=Due to user action or preferred switching,
-        3=Due to line notch or spike, 5=Due to low line voltage,
-        7=Transfer due to high line voltage,
-        9=Transfer due to frequency out of range.
-       The fourth variable is a character string listing the transfer cause."
-   --#TYPE "APC Redundant Switch: The Redundant Switch has switched source"
-   --#SUMMARY "The Redundant Switch has switched source."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 104
-
-rsLostRedundancy TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The Redundant Switch has lost redundancy.
-       The first variable is an integer representing the source which is no longer available: 0=A, 1=B.
-       The second variable is the 32-character name of the source which is no longer available."
-   --#TYPE "APC Redundant Switch: The Redundant Switch has lost redundancy"
-   --#SUMMARY "The Redundant Switch has has lost redundancy."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 105
-
-rsRedundancyRestored TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString02,  mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Redundancy has been restored to the Redundant Switch .
-       The first variable is an integer representing the source which has been restored: 0=A, 1=B.
-       The second variable is the 32-character name of the source which has been restored."
-   --#TYPE "APC Redundant Switch: Redundancy has been restored."
-   --#SUMMARY "Redundancy has been restored to the Redundant Switch ."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 106
-
-rsConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A configuration change has been made on a Redundant Switch."
-   --#TYPE "APC: A configuration change on a Redundant Switch."
-   --#SUMMARY "A configuration change has been made on a Redundant Switch."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 107
-
-rsCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communications with the Redundant Switch has been established."
-   --#TYPE "APC: Communications established with the Redundant Switch."
-   --#SUMMARY "Communications with the Redundant Switch has been established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 108
-
-rsCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communications with the Redundant Switch has been lost."
-   --#TYPE "APC: Communications lost with the Redundant Switch."
-   --#SUMMARY "Communications with the Redundant Switch has been lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 109
-
-dcCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communications with the DC power plant has been established."
-   --#TYPE "APC: Communications established with the DC power plant."
-   --#SUMMARY "Communications with the DC power plant has been established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 110
-
-dcCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communications with the DC power plant has been lost."
-   --#TYPE "APC: Communications lost with the DC power plant."
-   --#SUMMARY "Communications with the DC power plant has been lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 111
-
-dcPINChanged TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The active PIN on the DC controller has been changed."
-   --#TYPE "APC: The active PIN on the DC controller has been changed."
-   --#SUMMARY "The active PIN on the DC controller has been changed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 112
-
-dcMajorAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Major alarm is active in the DC power plant."
-   --#TYPE "APC: A Major alarm is active in the DC power plant."
-   --#SUMMARY "A Major alarm is active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 113
-   
-dcMajorAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Major alarm is no longer active in the DC power plant."
-   --#TYPE "APC: A Major alarm is no longer active in the DC power plant."
-   --#SUMMARY "A Major alarm is no longer active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 114
-
-dcMinorAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Minor alarm is active in the DC power plant."
-   --#TYPE "APC: A Minor alarm is active in the DC power plant."
-   --#SUMMARY "A Minor alarm is active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 115
-   
-dcMinorAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Minor alarm is no longer active in the DC power plant."
-   --#TYPE "APC: A Minor alarm is no longer active in the DC power plant."
-   --#SUMMARY "A Minor alarm is no longer active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 116
-
-dcOutputRelayOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES {  dm3StatusOutRlyIndex, dm3StatusOutRlyName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An output relay for the powerplant has been activated (state changed to on).
-       The first variable is an integer representing the output relay number that has gone on.
-       The second variable is the 16-character name of the output relay."
-   --#TYPE "APC: An output relay has gone on."
-   --#SUMMARY "An output relay has gone on in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 117
-
-dcOutputRelayOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES {  dm3StatusOutRlyIndex, dm3StatusOutRlyName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An output relay for the powerplant has been deactivated (state changed to off).
-       The first variable is an integer representing the output relay number that has gone off.
-       The second variable is the 16-character name of the output relay."
-   --#TYPE "APC: An output relay has gone off."
-   --#SUMMARY "An output relay has gone off in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 118
-
-dcInputRelayOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES {  dm3StatusInRlyIndex, dm3StatusInRlyName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An input relay for the powerplant has been activated (state changed to on).
-       The first variable is an integer representing the input relay number that has gone on.
-       The second variable is the 16-character name of the input relay."
-   --#TYPE "APC: An input relay has gone on."
-   --#SUMMARY "An input relay has gone on in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 119
-
-dcInputRelayOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES {  dm3StatusInRlyIndex, dm3StatusInRlyName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An input relay for the powerplant has been deactivated (state changed to off).
-       The first variable is an integer representing the input relay number that has gone off.
-       The second variable is the 16-character name of the input relay."
-   --#TYPE "APC: An input relay has gone off."
-   --#SUMMARY "An input relay has gone off in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 120
-
-logicPowerSuppliesIncreased TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The number of system power supplies has increased."
-   --#TYPE "APC UPS: The number of system power supplies has increased."
-   --#SUMMARY "The number of system power supplies has increased."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 121
-
-logicPowerSuppliesDecreased TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The number of system power supplies has decreased."
-   --#TYPE "APC UPS: The number of system power supplies has decreased."
-   --#SUMMARY "The number of system power supplies has decreased."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 122
-
-externalSwitchGearClosed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: External Switch Gear closed."
-   --#TYPE "APC UPS: External Switch Gear closed."
-   --#SUMMARY "External Switch Gear closed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 123
-
-externalSwitchGearOpened TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: External Switch Gear opened."
-   --#TYPE "APC UPS: External Switch Gear opened."
-   --#SUMMARY "External Switch Gear opened."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 124
-
-generalDeviceEvent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: APC Device event."
-   --#TYPE "APC Device event"
-   --#SUMMARY "APC Device event."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 125
-
-atsSourceSwitched TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The Automatic Transfer Switch has switched source.
-       The first variable is an integer representing the current source: 0=A, 1=B.
-       The second variable is the 32-character name of the current source."
-   --#TYPE "APC Automatic Transfer Switch: The ATS has switched source"
-   --#SUMMARY "The Automatic Transfer Switch has switched source."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-  ::= 126
-
-atsLostRedundancy TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The Automatic Transfer Switch has lost redundancy.
-       The first variable is an integer representing the source which is no longer available: 0=A, 1=B.
-       The second variable is the 32-character name of the source which is no longer available."
-   --#TYPE "APC Automatic Transfer Switch: The ATS has lost redundancy. "
-   --#SUMMARY "The Automatic Transfer Switch has has lost redundancy."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 127
-
-atsRedundancyRestored TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString02,  mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Redundancy has been restored to the Automatic Transfer Switch .
-       The first variable is an integer representing the source which has been restored: 0=A, 1=B.
-       The second variable is the 32-character name of the source which has been restored."
-   --#TYPE "APC Automatic Transfer Switch: Redundancy has been restored."
-   --#SUMMARY "Redundancy has been restored to the Automatic Transfer Switch ."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 128
-
-atsConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A configuration change has been made on the Automatic Transfer Switch.
-       The first variable is an integer representing the configuration setting which changed:
-           0=Transfer Voltage Range, 1=Sensitivity 2=Preferred Source
-           3=Front Panel Lockout 4=Current Limit"
-   --#TYPE "APC Automatic Transfer Switch: ATS configuration changed."
-   --#SUMMARY "A configuration change has been made on a Automatic Transfer Switch."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 129
-
-atsCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communications with the Automatic Transfer Switch has been established."
-   --#TYPE "APC Automatic Transfer Switch: Communications established."
-   --#SUMMARY "Communications with the Automatic Transfer Switch has been established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 130
-
-atsCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communications with the Automatic Transfer Switch has been lost."
-   --#TYPE "APC Automatic Transfer Switch: Communications lost."
-   --#SUMMARY "Communications with the Automatic Transfer Switch has been lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 131
-
-atsOverCurrent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Output Current has exceeded threshold."
-   --#TYPE "APC Automatic Transfer Switch: Output Current exceeded threshold"
-   --#SUMMARY "Output Current has exceeded Threshold. "
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 132
-
-atsOverCurrentCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Output Current has returned below threshold."
-   --#TYPE "APC Automatic Transfer Switch: Output Current below threshold."
-   --#SUMMARY "Output Current has returned below threshold."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 133
-
-atsPowerSupplyFailure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The Automatic Transfer Switch Power Supply has failed.
-      The first variable is an integer representing the Power Supply which 
-      has failed: 0=24V, 1=12V 2=5V."
-   --#TYPE "APC Automatic Transfer Switch: The ATS Power Supply has failed."
-   --#SUMMARY "The Automatic Transfer Switch Power Supply has failed."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 134
-
-atsPowerSupplyFailureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The Automatic Transfer Power Supply Failure Cleared.
-       The first variable is an integer representing the Power Supply which 
-       has cleared: 0=24V, 1=12V 2=5V."
-   --#TYPE "APC Automatic Transfer Switch: Power Supply Failure Cleared."
-   --#SUMMARY "The Automatic Transfer Switch Power Supply Failure Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 135
-
-dcMainsFailAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Mains Fail alarm is active in the DC power plant."
-   --#TYPE "APC: A Mains Fail alarm is active in the DC power plant."
-   --#SUMMARY "A Mains Fail alarm is active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 136
-   
-dcMainsFailAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Mains Fail alarm is no longer active in the DC power plant."
-   --#TYPE "APC: Mains Fail alarm is no longer active in the DC power plant."
-   --#SUMMARY "Mains Fail alarm is no longer active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 137
-
-dcFanFailAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Fan Fail alarm is active in the DC power plant."
-   --#TYPE "APC: A Fan Fail alarm is active in the DC power plant."
-   --#SUMMARY "A Fan Fail alarm is active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 138
-   
-dcFanFailAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Fan Fail alarm is no longer active in the DC power plant."
-   --#TYPE "APC: A Fan Fail alarm is no longer active in the DC power plant."
-   --#SUMMARY "A Fan Fail alarm is no longer active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 139
-
-dcRectifierOvertempAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: Rect. Overtemp alarm is active in the power plant."
-   --#TYPE "APC: Rect. Overtemp alarm is active in the power plant."
-   --#SUMMARY "Rect. Overtemp alarm is active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 140
-   
-dcRectifierOvertempAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Rect. Overtemp alarm is no longer active in the power plant."
-   --#TYPE "APC: Rect. Overtmp alarm is no longer active in the power plant."
-   --#SUMMARY "Rect. Overtmp alarm is no longer active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 141
-
-dcCurrentLimitAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Current Limit alarm is active in the power plant."
-   --#TYPE "APC: A Current Limit alarm is active in the power plant."
-   --#SUMMARY "A Current Limit alarm is active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 142
-   
-dcCurrentLimitAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Current Limit alarm is no longer active in the power plant."
-   --#TYPE "APC: Current Limit alarm is no longer active in the power plant."
-   --#SUMMARY "Current Limit alarm is no longer active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 143
-
-dcRectifierFailAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Rect. Fail alarm is active in the power plant."
-   --#TYPE "APC: A Rect. Fail alarm is active in the power plant."
-   --#SUMMARY "A Rect. Fail alarm is active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 144
-   
-dcRectifierFailAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Rect. Fail alarm is no longer active in the power plant."
-   --#TYPE "APC: Rect. Fail alarm is no longer active in the power plant."
-   --#SUMMARY "Rect. Fail alarm is no longer active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 145
-
-dcMultRectFailAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: Multiple Rect. Fail alarm is active in the powerplant."
-   --#TYPE "APC: Multiple Rect. Fail alarm is active in the powerplant."
-   --#SUMMARY "Multiple Rect. Fail alarm is active in the powerplant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 146
-   
-dcMultRectFailAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Mult Rect Fail alarm is no longer active in the powerplant."
-   --#TYPE "APC: Mult Rect Fail alarm is no longer active in the powerplant."
-   --#SUMMARY "Mult Rect Fail alarm is no longer active in the powerplant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 147
-
-dcBatteryBreakerAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: Batt. Breaker alarm is active in the power plant."
-   --#TYPE "APC: Batt. Breaker alarm is active in the power plant."
-   --#SUMMARY "Batt. Breaker alarm is active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 148
-   
-dcBatteryBreakerAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Batt. Breaker alarm is no longer active in the power plant."
-   --#TYPE "APC: Batt. Breaker alarm is no longer active in the power plant."
-   --#SUMMARY "Batt. Breaker alarm is no longer active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 149
-
-dcRectifierOVPAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Rect. OVP alarm is active in the power plant."
-   --#TYPE "APC: A Rect. OVP alarm is active in the power plant."
-   --#SUMMARY "A Rect. OVP alarm is active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 150
-   
-dcRectifierOVPAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Rect. OVP alarm is no longer active in the power plant."
-   --#TYPE "APC: A Rect. OVP alarm is no longer active in the power plant."
-   --#SUMMARY "A Rect. OVP alarm is no longer active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 151
-
-dcLVDImminentAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A LVD Imminent alarm is active in the powerplant."
-   --#TYPE "APC: A LVD Imminent alarm is active in the powerplant."
-   --#SUMMARY "A LVD Imminent alarm is active in the powerplant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 152
-   
-dcLVDImminentAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A LVD Imminent alarm is no longer active in the powerplant."
-   --#TYPE "APC: A LVD Imminent alarm is no longer active in the powerplant."
-   --#SUMMARY "A LVD Imminent alarm is no longer active in the powerplant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 153
-
-dcFuseCBAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Fuse/CB alarm is active in the DC power plant."
-   --#TYPE "APC: A Fuse/CB alarm alarm is active in the DC power plant."
-   --#SUMMARY "A Fuse/CB alarm is active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 154
-   
-dcFuseCBAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Fuse/CB alarm is no longer active in the DC power plant."
-   --#TYPE "APC: A Fuse/CB alarm is no longer active in the DC power plant."
-   --#SUMMARY "A Fuse/CB alarm is no longer active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 155
-
-dcBatteryTestFail TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Battery Test failed in the DC power plant."
-   --#TYPE "APC: A Battery Test failed in the DC power plant."
-   --#SUMMARY "A Battery Test failed in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 156
-
-dcTemperatureAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Temperature is active in the power plant."
-   --#TYPE "APC: A Temperature alarm is active in the power plant."
-   --#SUMMARY "A Temperature alarm is active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 157
-   
-dcTemperatureAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Temperature alarm is no longer active in the power plant."
-   --#TYPE "APC: A Temperature alarm is no longer active in the power plant."
-   --#SUMMARY "A Temperature alarm is no longer active in the power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 158
-
-dcHumidityAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Humidity alarm is active in the DC power plant."
-   --#TYPE "APC: A Humidity alarm is active in the DC power plant."
-   --#SUMMARY "A Humidity alarm is active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 159
-   
-dcHumidityAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Humidity alarm is no longer active in the DC power plant."
-   --#TYPE "APC: A Humidity alarm is no longer active in the DC power plant."
-   --#SUMMARY "A Humidity alarm is no longer active in the DC power plant."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 160
-
-dcBBCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Power plant bridging board communications established."
-   --#TYPE "APC: Power plant bridging board communications established."
-   --#SUMMARY "Power plant bridging board communications established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 161
-
-dcBBCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Power plant bridging board communications lost."
-   --#TYPE "APC: Power plant bridging board communications lost."
-   --#SUMMARY "Power plant bridging board communications lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 162
-
-iemHighTempThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeCurrentTemp, iemStatusProbeTempUnits, iemStatusProbeNumber,
-               iemStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: High temperature threshold violated on Integrated
-        Environmental Monitor probe. The first variable is the
-        current temperature. The second variable is the temperature
-        scale. The third variable is the probe number. The fourth
-        variable is the probe name."
-   --#TYPE "APC IEM: High temperature threshold violation."
-   --#SUMMARY "High temperature threshold violation."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 163
-
-iemHighTempThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeNumber, iemStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: High temperature threshold violated on Integrated
-        Environmental Monitor probe has been cleared. The first variable
-        is the probe number. The second variable is the probe name."
-   --#TYPE "APC IEM: High temperature threshold violation cleared."
-   --#SUMMARY "High temperature threshold violation has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 164
-
-iemLowTempThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeCurrentTemp, iemStatusProbeTempUnits, iemStatusProbeNumber,
-               iemStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Low temperature threshold violated on integrated
-        probe. The first variable is the current temperature. The
-        second variable is the temperature scale. The third
-        variable is the probe number. The fourth variable is the
-        probe name."
-   --#TYPE "APC IEM: Low temperature threshold violation."
-   --#SUMMARY "Low temperature threshold violation."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 165
-
-iemLowTempThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeNumber, iemStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Low temperature threshold violated on integrated
-        probe has been cleared. The first variable is the probe number.
-        The second variable is the probe name."
-   --#TYPE "APC IEM: Low temperature threshold violation cleared."
-   --#SUMMARY "Low temperature threshold violation has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 166
-
-iemHighHumidThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeCurrentHumid, iemStatusProbeNumber, iemStatusProbeName,
-               mtrapargsString }
-   DESCRIPTION
-       "SEVERE: High humidity threshold violated on integrated
-        probe. The first variable is the current humidity. The
-        second variable is the probe number. The third variable
-        is the probe name."
-   --#TYPE "APC IEM: High humidity threshold violation."
-   --#SUMMARY "High humidity threshold violation."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 167
-
-iemHighHumidThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeNumber, iemStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: High humidity threshold violated on integrated
-        probe cleared. The first variable is the probe number. The second
-        variable is the probe name."
-   --#TYPE "APC IEM: High humidity threshold violation cleared."
-   --#SUMMARY "High humidity threshold violation has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 168
-
-iemLowHumidThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeCurrentHumid, iemStatusProbeNumber, iemStatusProbeName,
-               mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Low humidity threshold violated on integrated
-        probe. The first variable is the current humidity. The
-        second variable is the probe number. The third variable
-        is the probe name."
-   --#TYPE "APC IEM: Low humidity threshold violation."
-   --#SUMMARY "Low humidity threshold violation."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 169
-
-iemLowHumidThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusProbeNumber, iemStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Low humidity threshold violated on integrated
-        probe cleared. The first variable is the probe number. The second
-        variable is the probe name."
-   --#TYPE "APC IEM: Low humidity threshold violation cleared."
-   --#SUMMARY "Low humidity threshold violation has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 170
-
-iemProbeDisconnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "WARNING: The temperature/humidity probe on the Integrated
-       Environmental Monitor has been disconnected. This trap is
-       generated when a probe that has been in communication with
-       the Environmental Monitor has been disconnected or can no
-       longer communicate."
-   --#TYPE "APC IEM: Probe disconnected."
-   --#SUMMARY "Probe has been disconnected."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 171
-
-iemProbeConnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The temperature/humidity probe on the Integrated
-       Environmental Monitor has been connected. This trap is generated
-       when the Environmental Monitor establishes communication with a
-       probe that had previously not been connected."
-   --#TYPE "APC IEM: Probe Connected."
-   --#SUMMARY "Probe has been connected."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 172
-
-iemContactFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusContactNumber, iemStatusContactName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: There is a contact fault on the Integrated
-       Environmental Monitor. The first argument is the number
-       of the contact. The second argument is the name of the
-       contact."
-   --#TYPE "APC IEM: Contact fault."
-   --#SUMMARY "Contact fault."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 173
-
-iemContactFaultCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusContactNumber, iemStatusContactName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The contact fault on the Integrated
-       Environmental Monitor has been cleared. The first
-       argument is the number of the contact. The second
-       argument is the name of the contact."
-   --#TYPE "APC IEM: Contact fault."
-   --#SUMMARY "Contact fault cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 174
-
-iemRelayFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusRelayNumber, iemStatusRelayName, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The output relay on the Integrated Environmental
-       Monitor has switched to the fault state. The first
-       argument is the number of the output relay. The second
-       argument is the name of the output relay. The third
-       argument is the event that caused the fault."
-   --#TYPE "APC IEM: Output relay fault."
-   --#SUMMARY "Output relay has faulted."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 175
-
-iemRelayFaultCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { iemStatusRelayNumber, iemStatusRelayName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The fault condition on the output relay on the
-       Integrated Environmental Monitor has cleared. The first
-       argument is the number of the output relay. The second
-       argument is the name of the output relay."
-   --#TYPE "APC IEM: Output relay fault condition cleared."
-   --#SUMMARY "Output relay fault cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 176
-
-bmBatManCommEstab TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Serial Communications Established with Battery Manager."
-   --#TYPE "BatMan : Communications Established."
-   --#SUMMARY "Communications Established."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 177
-
-bmBatManCommLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Serial Communications Lost with Battery Manager."
-   --#TYPE "BatMan : Communications Lost."
-   --#SUMMARY "Communications Lost."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 178
-
-bmBatManKneeAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Battery Voltage Knee Threshold Alarm Detected."
-   --#TYPE "BatMan : Knee Alarm Detected."
-   --#SUMMARY "Knee Alarm Detected."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 179
-
-bmBatManKneeAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Battery Voltage Knee Threshold Alarm Cleared."
-   --#TYPE "BatMan : Knee Alarm Cleared."
-   --#SUMMARY "Knee Alarm Cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 180
-
-bmBatManChargerAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Charger Alarm Detected."
-   --#TYPE "BatMan : Charger Alarm Detected."
-   --#SUMMARY "Charger Alarm Detected."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 181
-
-bmBatManChargerAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Charger Alarm Cleared."
-   --#TYPE "BatMan : Charger Alarm Cleared."
-   --#SUMMARY "Charger Alarm Cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 182
-
-bmBatManBatteryAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Battery Alarm Detected."
-   --#TYPE "BatMan : Battery Alarm Detected."
-   --#SUMMARY "Battery Alarm Detected."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 183
-
-bmBatManBatteryAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Battery Alarm Cleared."
-   --#TYPE "BatMan : Battery Alarm Cleared."
-   --#SUMMARY "Battery Alarm Cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 184
-
-bmBatManEnvironmentAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Environment Alarm Detected."
-   --#TYPE "BatMan : Environment Alarm Detected."
-   --#SUMMARY "Environment Alarm Detected."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 185
-
-bmBatManEnvironmentAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Environment Alarm Cleared."
-   --#TYPE "BatMan : Environment Alarm Cleared."
-   --#SUMMARY "Environment Alarm Cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 186
-
-bmBatManMaintenanceAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Maintenance Alarm Detected."
-   --#TYPE "BatMan : Maintenance Due Alarm Detected."
-   --#SUMMARY "Maintenance Due Alarm Detected."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 187
-
-bmBatManMaintenanceAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Maintenance Alarm Cleared."
-   --#TYPE "BatMan : Maintenance Due Alarm Cleared."
-   --#SUMMARY "Maintenance Due Alarm Cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 188
-
-pduCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communication Established.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Communication Established."
-   --#SUMMARY "Communication Established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 189
-
-pduCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communication Lost.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Communication Lost."
-   --#SUMMARY "Communication Lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 190
-
-pduUtilityLineUndervoltage TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Utility Line Undervoltage. 
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Utility Line Undervoltage."
-   --#SUMMARY "Utility Line Undervoltage."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 191
-
-pduUtilityLineUndervoltageCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Utility Line Undervoltage Cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Utility Line Undervoltage Cleared."
-   --#SUMMARY "Utility Line Undervoltage Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 192
-
-pduUtilityLineOvervoltage TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Utility Line Overvoltage.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Utility Line Overvoltage."
-   --#SUMMARY "Utility Line Overvoltage."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 193
-
-pduUtilityLineOvervoltageCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Utility Line Overvoltage Cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Utility Line Overvoltage Cleared."
-   --#SUMMARY "Utility Line Overvoltage Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 194
-
-pduGroundOvercurrent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Ground Overcurrent.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Ground Overcurrent."
-   --#SUMMARY "Ground Overcurrent."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 195
-
-pduGroundOvercurrentCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Ground Overcurrent Cleared.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Ground Overcurrent Cleared."
-   --#SUMMARY "Ground Overcurrent Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 196
-
-pduCircuitPanelInputUndervoltage TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Circuit Panel Input Undervoltage.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Undervoltage."
-   --#SUMMARY "Circuit Panel Input Undervoltage."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 197
-
-pduCircuitPanelInputUndervoltageCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Circuit Panel Input Undervoltage Cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Undervoltage Cleared."
-   --#SUMMARY "Circuit Panel Input Undervoltage Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 198
-
-pduCircuitPanelInputOvervoltage TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Circuit Panel Input Overvoltage.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Overvoltage."
-   --#SUMMARY "Circuit Panel Input Overvoltage."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 199
-
-pduCircuitPanelInputOvervoltageCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Circuit Panel Input Overvoltage Cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Overvoltage Cleared."
-   --#SUMMARY "Circuit Panel Input Overvoltage Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 200
-
-pduCircuitPanelInputUndercurrent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Circuit Panel Input Undercurrent.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Undercurrent."
-   --#SUMMARY "Circuit Panel Input Undercurrent."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 201
-
-pduCircuitPanelInputUndercurrentCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Circuit Panel Input Undercurrent Cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Undercurrent Cleared."
-   --#SUMMARY "Circuit Panel Input Undercurrent Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 202
-
-pduCircuitPanelInputOvercurrent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Circuit Panel Input Overcurrent.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Overcurrent."
-   --#SUMMARY "Circuit Panel Input Overcurrent."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 203
-
-pduCircuitPanelInputOvercurrentCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Circuit Panel Input Overcurrent Cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: Circuit Panel Input Overcurrent Cleared."
-   --#SUMMARY "Circuit Panel Input Overcurrent Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 204
-
-pduCircuitPanelFrequencyOutOfRange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Circuit Panel Input Frequency Out Of Range.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Circuit Panel Input Frequency Out Of Range."
-   --#SUMMARY "Circuit Panel Input Frequency Out Of Range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 205
-
-pduCircuitPanelFrequencyOutofRangeCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Circuit Panel Input Frequency No Longer Out Of Range.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Circuit Panel Input Frequency No Longer Out Of Range."
-   --#SUMMARY "Circuit Panel Input Frequency No Longer Out Of Range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 206
-
-pduCircuitPanelNeutralOvercurrent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Circuit Panel Input Neutral Overcurrent.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Circuit Panel Input Neutral Overcurrent."
-   --#SUMMARY "Circuit Panel Input Neutral Overcurrent."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 207
-
-pduCircuitPanelNeutralOvercurrentCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Circuit Panel Input Neutral Overcurrent Cleared.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Circuit Panel Input Neutral Overcurrent Cleared."
-   --#SUMMARY "Circuit Panel Input Neutral Overcurrent Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 208
-
-pduSystemOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: PDU System Off.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: System Off."
-   --#SUMMARY "PDU System Off."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 209
-
-pduOnBatteryMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: PDU is in On Battery Mode.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: On Battery Mode."
-   --#SUMMARY "PDU is in On Battery Mode."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 210
-
-pduMaintenanceBypassMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: PDU is in Maintenance Bypass Mode.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Maintenance Bypass Mode."
-   --#SUMMARY "PDU is in Maintenance Bypass Mode."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 211
-
-pduAtypicalBypassMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "WARNING: PDU is in Atypical Bypass Mode.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Atypical Bypass Mode."
-   --#SUMMARY "PDU is in Atypical Bypass Mode."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 212
-
-pduNoPanelFeedMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: PDU is in No Panel Feed Mode.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: No Panel Feed Mode."
-   --#SUMMARY "PDU is in No Panel Feed Mode."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 213
-
-pduUpsOperationMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: PDU is in Ups Operation Mode.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Ups Operation Mode."
-   --#SUMMARY "PDU is in Ups Operation Mode."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 214
-
-pduForcedBypassMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "WARNING: PDU is in Forced Bypass Mode.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Forced Bypass Mode."
-   --#SUMMARY "PDU is in Forced Bypass Mode."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 215
-
-pduInputTransformerOverTemperature TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Input Transformer Over Temperature.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Input Transformer Over Temperature."
-   --#SUMMARY "Input Transformer Over Temperature."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 216
-
-pduInputTransformerOverTemperatureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Input Transformer Over Temperature Cleared.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC PDU: Input Transformer Over Temperature Cleared."
-   --#SUMMARY "Input Transformer Over Temperature Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 217
-
-pduUPSInputVoltageLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: UPS Input Voltage phase-N Lost.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: UPS Input Voltage phase-N Lost."
-   --#SUMMARY "UPS Input Voltage phase-N Lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 218
-
-pduUPSInputVoltageRestored TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: UPS Input Voltage phase-N Restored.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC PDU: UPS Input Voltage phase-N Restored."
-   --#SUMMARY "UPS Input Voltage phase-N Restored."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 219
-
-pduContactFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A contact closure in the PDU is in an abnormal position. 
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the number of the contact."
-   --#TYPE "APC PDU: Contact Abnormal."
-   --#SUMMARY "Contact Abnormal."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 220
-
-pduContactFaultCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A contact closure in the PDU is in a normal position. 
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the number of the contact."
-   --#TYPE "APC PDU: Contact Normal."
-   --#SUMMARY "Contact Normal."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 221
-
-rPDUBankPhaseLowLoad TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusBankNumber, rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A bank or phase on the Rack PDU has violated the low load threshold.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the bank number (0 if this is phase data).
-       The fourth argument is the phase number (0 if this is bank data)."
-   --#TYPE "APC Rack PDU: Violation of bank or phase low load threshold."
-   --#SUMMARY "A bank or phase on the Rack PDU has violated the low load threshold."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 222
-
-rPDUBankPhaseLowLoadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusBankNumber, rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The bank or phase low load condition on a Rack PDU has been 
-       cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the bank number (0 if this is phase data).
-       The fourth argument is the phase number (0 if this is bank data)."
-   --#TYPE "APC Rack PDU: Bank or phase low load condition cleared."
-   --#SUMMARY "The bank or phase low load condition on a Rack PDU has been cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 223
-
-rPDUBankPhaseNearOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusBankNumber, rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A bank or phase of the Rack PDU is near an overload condition.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the bank number (0 if this is phase data).
-       The fourth argument is the phase number (0 if this is bank data)."
-   --#TYPE "APC Rack PDU: Bank or phase near an overload condition."
-   --#SUMMARY "A bank or phase of the Rack PDU is near an overload condition."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 224
-
-rPDUBankPhaseNearOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusBankNumber, rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The bank or phase near overload condition on a Rack PDU has 
-       been cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the bank number (0 if this is phase data).
-       The fourth argument is the phase number (0 if this is bank data)."
-   --#TYPE "APC Rack PDU: Bank or phase near overload condition has cleared."
-   --#SUMMARY "Rack PDU bank or phase near overload condition has cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 225
-
-rPDUBankPhaseOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusBankNumber, rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A bank or phase of the Rack PDU is in an overload condition.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number.
-       The third argument is the bank number (0 if this is phase data).
-       The fourth argument is the phase number (0 if this is bank data)."
-   --#TYPE "APC Rack PDU: Bank or phase overload condition."
-   --#SUMMARY "A bank or phase of the Rack PDU is in an overload condition."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 226
-
-rPDUBankPhaseOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusBankNumber, rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The bank or phase overload condition on a Rack PDU has been 
-       cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the bank number (0 if this is phase data).
-       The fourth argument is the phase number (0 if this is bank data)."
-   --#TYPE "APC Rack PDU: Bank or phase overload condition has cleared."
-   --#SUMMARY "The bank or phase overload condition on a Rack PDU has cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 227
-
-aruDeviceConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote ARU Device Configurtion change.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: ARU Device configuration change."
-   --#SUMMARY "ARU device configuration change."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 228
-
-rmPDUCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString03, mtrapargsString02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communication Lost.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC RM PDU: Communication Lost."
-   --#SUMMARY "Communication Lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 229
-
-emsCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communication Established.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC EMS: Communication Established."
-   --#SUMMARY "Communication Established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 230
-
-emsCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communication Lost.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC EMS: Communication Lost."
-   --#SUMMARY "Communication Lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 231
-
-emsProbeConnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A probe has been connected to the EMS.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the probe number. 
-        The fourth argument is the probe name."
-   --#TYPE "APC EMS: Probe Connected."
-   --#SUMMARY "Probe Connected."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 232
-
-emsProbeDisconnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A probe has been disconnected from the EMS.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the probe number. 
-        The fourth argument is the probe name."
-   --#TYPE "APC EMS: Probe Disconnected."
-   --#SUMMARY "Probe Disconnected."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 233
-
-emsSensorConnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsSensorStatusSensorIndex, emsSensorStatusSensorName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A sensor has been connected to the EMS.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the sensor number. 
-        The fourth argument is the sensor name."
-   --#TYPE "APC EMS: Sensor Connected."
-   --#SUMMARY "Sensor Connected."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 234
-
-emsSensorDisconnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsSensorStatusSensorIndex, emsSensorStatusSensorName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A sensor has been disconnected from the EMS.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the sensor number. 
-        The fourth argument is the sensor name."
-   --#TYPE "APC EMS: Sensor Disconnected."
-   --#SUMMARY "Sensor Disconnected."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 235
-
-emsSensorFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsSensorStatusSensorIndex, emsSensorStatusSensorName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A EMS sensor is in the fault condition.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the sensor number. 
-        The fourth argument is the sensor name."
-   --#TYPE "APC EMS: Sensor Fault."
-   --#SUMMARY "Sensor Fault."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 236
-
-emsSensorFaultCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsSensorStatusSensorIndex, emsSensorStatusSensorName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A EMS sensor fault condition has cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the sensor number. 
-        The fourth argument is the sensor name."
-   --#TYPE "APC EMS: Sensor Fault Cleared."
-   --#SUMMARY "Sensor Fault Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 237
-
-emsBeaconConnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A beacon has been connected to the EMS.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC EMS: Beacon Connected."
-   --#SUMMARY "Beacon Connected."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 238
-
-emsBeaconDisconnected TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A beacon has been disconnected from the EMS.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC EMS: Beacon Disconnected."
-   --#SUMMARY "Beacon Disconnected."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 239
-
-emsBeaconOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A EMS beacon has gone on.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC EMS: Beacon On."
-   --#SUMMARY "Beacon On."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 240
-
-emsBeaconOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A EMS beacon has gone off.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC EMS: Beacon Off."
-   --#SUMMARY "Beacon Off."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 241
-
-emsMajorAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Major Alarm is present in the EMS.
-        The first argument is the EMS serial number.
-        The second argument is the EMS name."
-   --#TYPE "APC EMS: Major Alarm."
-   --#SUMMARY "Major Alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 242
-
-emsMajorAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Major Alarm condition has been cleared in the EMS.
-        The first argument is the EMS serial number.
-        The second argument is the EMS name."
-   --#TYPE "APC EMS: Major Alarm Cleared."
-   --#SUMMARY "Major Alarm Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 243
-
-emsMinorAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Minor Alarm is present in the EMS.
-        The first argument is the EMS serial number.
-        The second argument is the EMS name."
-   --#TYPE "APC EMS: Minor Alarm."
-   --#SUMMARY "Minor Alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 244
-
-emsMinorAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Minor Alarm condition has been cleared in the EMS.
-        The first argument is the EMS serial number.
-        The second argument is the EMS name."
-   --#TYPE "APC EMS: Minor Alarm Cleared."
-   --#SUMMARY "Minor Alarm Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 245
-
-emsOutletStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsOutletStatusOutletIndex, emsOutletStatusOutletName, 
-               emsOutletStatusOutletState, emsOutletStatusOutletNormalState, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An outlet on the EMS has changed to its abnormal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the outlet number. 
-        The fourth argument is the outlet name.
-        The fifth argument is the current outlet state (1=ON, 2=OFF).
-        The sixth argument is the configured normal outlet state (1=ON, 2=OFF)."
-   --#TYPE "APC EMS: Outlet has changed to its abnormal state."
-   --#SUMMARY "Outlet has changed to its abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 246
-
-emsOutletStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsOutletStatusOutletIndex, emsOutletStatusOutletName, 
-               emsOutletStatusOutletState, emsOutletStatusOutletNormalState, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on the EMS has changed to its normal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the outlet number. 
-        The fourth argument is the outlet name.
-        The fifth argument is the current outlet state (1=ON, 2=OFF).
-        The sixth argument is the configured normal outlet state (1=ON, 2=OFF)."
-   --#TYPE "APC EMS: Outlet has changed to its normal state."
-   --#SUMMARY "Outlet has changed to its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 247
-
-emsInputContactStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsInputContactStatusInputContactIndex, 
-               emsInputContactStatusInputContactName, emsInputContactStatusInputContactState, 
-               emsInputContactStatusInputContactNormalState, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An input contact on the EMS has changed to its abnormal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the input contact number. 
-        The fourth argument is the input contact name.
-        The fifth argument is the input contact state (1=CLOSED, 2=OPEN).
-        The sixth argument is the configured normal input contact state (1=CLOSED, 2=OPEN)."
-   --#TYPE "APC EMS: Input contact has changed to its abnormal state."
-   --#SUMMARY "Input contact has changed to its abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 248
-
-emsInputContactStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsInputContactStatusInputContactIndex, 
-               emsInputContactStatusInputContactName, emsInputContactStatusInputContactState, 
-               emsInputContactStatusInputContactNormalState, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An input contact on the EMS has changed to its normal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the input contact number. 
-        The fourth argument is the input contact name.
-        The fifth argument is the input contact state (1=CLOSED, 2=OPEN).
-        The sixth argument is the configured normal input contact state (1=CLOSED, 2=OPEN)."
-   --#TYPE "APC EMS: Input contact has changed to its normal state."
-   --#SUMMARY "Input contact has changed to its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 249
-
-emsOutputRelayStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsOutputRelayStatusOutputRelayIndex, 
-               emsOutputRelayStatusOutputRelayName, emsOutputRelayStatusOutputRelayState, 
-               emsOutputRelayStatusOutputRelayNormalState, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An output relay on the EMS has changed to its abnormal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the output relay number. 
-        The fourth argument is the output relay name.
-        The fifth argument is the current output relay state (1=CLOSED, 2=OPEN).
-        The sixth argument is the configured normal output relay state (1=CLOSED, 2=OPEN)."
-   --#TYPE "APC EMS: Output Relay has changed to its abnormal state."
-   --#SUMMARY "Output Relay has changed to its abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 250
-
-emsOutputRelayStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsOutputRelayStatusOutputRelayIndex, 
-               emsOutputRelayStatusOutputRelayName, emsOutputRelayStatusOutputRelayState, 
-               emsOutputRelayStatusOutputRelayNormalState, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An output relay on the EMS has changed to its normal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the output relay number. 
-        The fourth argument is the output relay name.
-        The fifth argument is the current output relay state (1=CLOSED, 2=OPEN).
-        The sixth argument is the configured normal output relay state (1=CLOSED, 2=OPEN)."
-   --#TYPE "APC EMS: Output Relay has changed to its normal state."
-   --#SUMMARY "Output Relay has changed to its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 251
-
-emsDeviceConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A device configuration change has been made on the EMS.
-        The first argument is the EMS serial number.
-        The second argument is the EMS name."
-   --#TYPE "APC: A device configuration change on a EMS."
-   --#SUMMARY "A device configuration change has been made on a EMS."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 252
-
-envHighTempThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: High temperature threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: High temperature threshold violation."
-   --#SUMMARY "High temperature threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 253
-
-envHighTempThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: High temperature threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: High temperature threshold violation cleared."
-   --#SUMMARY "High temperature threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 254
-
-envLowTempThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Low temperature threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Low temperature threshold violation."
-   --#SUMMARY "Low temperature threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 255
-
-envLowTempThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Low temperature threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Low temperature threshold violation cleared."
-   --#SUMMARY "Low temperature threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 256
-
-envHighHumidityThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: High humidity threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: High humidity threshold violation."
-   --#SUMMARY "High humidity threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 257
-
-envHighHumidityThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: High humidity threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity. 
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: High humidity threshold violation cleared."
-   --#SUMMARY "High humidity threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 258
-
-envLowHumidityThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Low humidity threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: Low humidity threshold violation."
-   --#SUMMARY "Low humidity threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 259
-
-envLowHumidityThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Low humidity threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity. 
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: Low humidity threshold violation cleared."
-   --#SUMMARY "Low humidity threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 260
-
-
--- Switched and Metered Rack PDU Traps
-
-rPDUCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Communication with a Rack PDU has been established.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Communication established."
-   --#SUMMARY "Communication with a Rack PDU established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 266
-
-rPDUCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Communication with a Rack PDU has been lost.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Communication lost."
-   --#SUMMARY "Communication with a Rack PDU has been lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 267
-
-rPDUOutletOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDUOutletControlIndex, rPDUOutletControlOutletName, 
-               mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on a Switched Rack PDU has turned on.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the outlet index number.
-       The fourth argument is the outlet name."
-   --#TYPE "APC Switched Rack PDU: An outlet has turned on."
-   --#SUMMARY "An outlet on a Switched Rack PDU has turned on."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 268
-
-rPDUOutletOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDUOutletControlIndex, rPDUOutletControlOutletName, 
-               mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet on a Switched Rack PDU has turned off.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the outlet index number.
-       The fourth argument is the outlet name."
-   --#TYPE "APC Switched Rack PDU: An outlet has turned off."
-   --#SUMMARY "An outlet on a Switched Rack PDU has turned off."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 269
-
-rPDUDeviceConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A device configuration change has been made on a 
-       Rack PDU.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Device configuration change made."
-   --#SUMMARY "Device configuration change has been made on a Rack PDU."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 270
-
-rPDUOutletConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDUOutletControlIndex, rPDUOutletControlOutletName, 
-               mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An outlet configuration change has been made on a 
-       Switched Rack PDU.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the outlet index number.
-       The fourth argument is the outlet name."
-   --#TYPE "APC Switched Rack PDU: Outlet configuration change made."
-   --#SUMMARY "Outlet configuration change has been made on a Switched Rack PDU."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 271
-
-rPDULowLoad TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Rack PDU has violated the low load threshold.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC Rack PDU: Violation of low load threshold."
-   --#SUMMARY "A Rack PDU has violated the low load threshold."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 272
-
-rPDULowLoadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The low load condition on a Rack PDU has been 
-       cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC Rack PDU: Low load condition cleared."
-   --#SUMMARY "The low load condition on a Rack PDU has been cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 273
-
-rPDUNearOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Rack PDU is near an overload condition.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC Rack PDU: Near an overload condition."
-   --#SUMMARY "A Rack PDU is near an overload condition."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 274
-
-rPDUNearOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The near overload condition on a Rack PDU has 
-       been cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC Rack PDU: Near overload condition has cleared."
-   --#SUMMARY "Rack PDU near overload condition has cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 275
-
-rPDUOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Rack PDU is in an overload condition.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC Rack PDU: Overload condition."
-   --#SUMMARY "A Rack PDU is in an overload condition."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 276
-
-rPDUOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadStatusPhaseNumber, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The overload condition on a Rack PDU has been 
-       cleared.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase number."
-   --#TYPE "APC Rack PDU: Overload condition has cleared."
-   --#SUMMARY "The overload condition on a Rack PDU has cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 277
-
-rPDUPowerSupply1Fail TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Power Supply 1 on Rack PDU is in FAIL state.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Power Supply 1 is in FAIL state."
-   --#SUMMARY "Power Supply 1 on Rack PDU is in FAIL state."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 278
-
-rPDUPowerSupply1Ok TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Power Supply 1 on Rack PDU is operating normally.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Power Supply 1 is operating normally."
-   --#SUMMARY "Power Supply 1 on Rack PDU is operating normally."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 279
-
-rPDUPowerSupply2Fail TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Power Supply 2 on Rack PDU is in FAIL state.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Power Supply 2 is in FAIL state."
-   --#SUMMARY "Power Supply 2 on Rack PDU is in FAIL state."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 280
-
-rPDUPowerSupply2Ok TRAP-TYPE
-   ENTERPRISE apc             
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Power Supply 2 on Rack PDU is operating normally.
-       The first argument is the serial number.
-       The second argument is the device name."
-   --#TYPE "APC Rack PDU: Power Supply 2 is operating normally."
-   --#SUMMARY "Power Supply 2 on Rack PDU is operating normally."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 281
-
-rPDUPhaseConfigChange TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDULoadPhaseConfigIndex, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A phase configuration change has been made on a 
-       Rack PDU.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the phase index number."
-   --#TYPE "APC Rack PDU: Phase configuration change made."
-   --#SUMMARY "Phase configuration change has been made on a Rack PDU."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 282
-
-rPDUCancelPendingCommand TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { rPDUIdentSerialNumber, rPDUIdentName, 
-               rPDUOutletControlIndex, rPDUOutletControlOutletName,
-               mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A cancel pending command has been made on a 
-       Switched Rack PDU.
-       The first argument is the serial number.
-       The second argument is the device name.
-       The third argument is the outlet index number (0 indicates all outlets).
-       The fourth argument is the outlet name (or device name if all outlets)."
-   --#TYPE "APC Switched Rack PDU: Cancel Pending Command made."
-   --#SUMMARY "A Cancel Pending Command has been made on a Switched Rack PDU."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 283
-
-aruAlinkCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote ARU Communication Established.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Communication Established."
-   --#SUMMARY "Communication Established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 284
-
-aruAlinkCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Remote ARU Communication Lost.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Communication Lost."
-   --#SUMMARY "Communication Lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 285
-
-aruFanFail TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Remote ARU Fan Fail.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Fan Fail."
-   --#SUMMARY "Fan Fail."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 286
-
-aruFanFailCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote ARU Fan Fail Cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Fan Fail Cleared."
-   --#SUMMARY "Fan Fail Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 287
-
-aruSmokeAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Remote ARU Smoke Alarm.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Smoke Alarm."
-   --#SUMMARY "Smoke Alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 288
-
-aruSmokeAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote ARU Smoke Alarm Cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Smoke Alarm Cleared."
-   --#SUMMARY "Smoke Alarm Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 289
-
-aruHighTemperatureAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Remote ARU High Temperature Alarm.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: High Temperature Alarm."
-   --#SUMMARY "High Temperature Alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 290
-
-aruHighTemperatureAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote ARU High Temperature Alarm Cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: High Temperature Alarm Cleared."
-   --#SUMMARY "High Temperature Alarm Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 291
-
-aruExhaustTemperatureAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Remote ARU Exhaust Temperature Alarm.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Exhaust Temperature Alarm."
-   --#SUMMARY "Exhaust Temperature Alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 292
-
-aruExhaustTemperatureAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               rARUStatusAruIndex, rARUStatusAruName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote ARU Exhaust Temperature Alarm Cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the ARU number. 
-        The fourth argument is the ARU name."
-   --#TYPE "APC ARU: Exhaust Temperature Alarm Cleared."
-   --#SUMMARY "Exhaust Temperature Alarm Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 293
-
-envAlinkCommunicationEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Remote Probe Communication Established.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the probe number. 
-        The fourth argument is the probe name."
-   --#TYPE "APC ENV: Communication Established."
-   --#SUMMARY "Communication Established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 294
-
-envAlinkCommunicationLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Remote Probe Communication Lost.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the probe number. 
-        The fourth argument is the probe name."
-   --#TYPE "APC ENV: Communication Lost."
-   --#SUMMARY "Communication Lost."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 295
-
-emsAlinkPowerOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Alink Power Overload.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC EMS: Alink Power Overload."
-   --#SUMMARY "Alink Power Overload."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 296
-
-emsAlinkPowerOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Alink Power Overload Cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC EMS: Alink Power Overload Cleared."
-   --#SUMMARY "Alink Power Overload Cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 297
-
-upsOutletGroupTurnedOn TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { upsOutletGroupControlIndex, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The specified Outlet Group turned on."
-   --#TYPE "APC UPS: Outlet Group turned on."
-   --#SUMMARY "Outlet Group turned on"
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 298   
-
-upsOutletGroupTurnedOff TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { upsOutletGroupControlIndex, mtrapargsString }
-   DESCRIPTION
-       "WARNING: The specified Outlet Group turned off."
-   --#TYPE "APC UPS: Outlet Group turned off."
-   --#SUMMARY "Outlet Group turned off."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 299  
-
-smwCriticalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsGauge, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Symmetra MW UPS critical condition has been detected.
-       The first variable is the fault condition."
-   --#TYPE "APC Symmetra MW UPS: A critical condition has been detected."
-   --#SUMMARY "A critical condition has been detected."
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 300
-
-smwCriticalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsGauge, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Symmetra MW UPS critical condition has been cleared.
-      The first variable is the fault condition."
-   --#TYPE "APC Symmetra MW UPS: A critical condition has been cleared."
-   --#SUMMARY "A critical condition has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 301
-
-smwWarningCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsGauge, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Symmetra MW UPS warning condition has been detected.
-       The first variable is the fault condition."
-   --#TYPE "APC Symmetra MW UPS: A warning condition has been detected."
-   --#SUMMARY "A warning condition has been detected."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 302
-
-smwWarningConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsGauge, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Symmetra MW UPS warning condition has been cleared.
-      The first variable is the fault condition."
-   --#TYPE "APC Symmetra MW UPS: A warning condition has been cleared."
-   --#SUMMARY "A warning condition has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 303
-
-smwInformationalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsGauge, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Symmetra MW UPS informational condition has been detected.
-       The first variable is the fault condition."
-   --#TYPE "APC Symmetra MW UPS: Informational condition detected."
-   --#SUMMARY "An informational condition has been detected."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 304
-
-smwInformationalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsGauge, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Symmetra MW UPS informational condition has been cleared.
-      The first variable is the fault condition."
-   --#TYPE "APC Symmetra MW UPS: Informational condition cleared."
-   --#SUMMARY "An informational condition has been cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 305
-
-airCriticalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: An Air critical condition was detected.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC Air: A critical condition was detected. "
-   --#SUMMARY "A critical condition was detected. "
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 306
-
-airCriticalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Air critical condition was cleared.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC Air: A critical condition was cleared. "
-   --#SUMMARY "A critical condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 307
-
-airWarningCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An Air warning condition was detected.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC Air: A warning condition was detected. "
-   --#SUMMARY "A warning condition was detected. "
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 308
-
-airWarningConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An Air warning condition was cleared.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC Air: A warning condition was cleared. "
-   --#SUMMARY "A warning condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 309
-
-airInformationalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Air informational condition was detected.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC Air: Informational condition detected. "
-   --#SUMMARY "An informational condition was detected. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 310
-
-airInformationalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Air informational condition was cleared.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC Air: Informational condition was cleared. "
-   --#SUMMARY "An informational condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 311
-
--- xPDU Traps (part 1)
-
-xPDUInputVoltageLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Three-phase input voltage to the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase
-        (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, from which the alarm was generated."
-   --#TYPE "APC XPDU: Main input voltage out-of-range alarm."
-   --#SUMMARY "Input voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 312
-
-xPDUInputVoltageLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Three-phase input voltage to the device is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XPDU: Main input voltage back in range."
-   --#SUMMARY "Input voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 313
-
-
-xPDUInputVoltageHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Three-phase input voltage to the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase
-        (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, above which the alarm was generated."
-   --#TYPE "APC XPDU: Main input voltage out-of-range alarm."
-   --#SUMMARY "Input voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 314
-
-xPDUInputVoltageHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Three-phase input voltage to the device is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XPDU: Main input voltage back in range."
-   --#SUMMARY "Input voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 315
-
-xPDUBypassVoltageLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Three-phase bypass input voltage to the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, from which the alarm was generated."
-   --#TYPE "APC XPDU: Bypass input voltage out-of-range alarm."
-   --#SUMMARY "Bypass input voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 316
-
-xPDUBypassVoltageLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Three-phase bypass input voltage to the device is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XPDU: Bypass input voltage back in range."
-   --#SUMMARY "Bypass input voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 317
-
-xPDUBypassVoltageHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Three-phase bypass input voltage to the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, above which the alarm was generated."
-   --#TYPE "APC XPDU: Bypass input voltage out-of-range alarm."
-   --#SUMMARY "Bypass input voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 318
-
-xPDUBypassVoltageHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Three-phase bypass input voltage to the device is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XPDU: Bypass input voltage back in range."
-   --#SUMMARY "Bypass input voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 319
-
-xPDUOutputVoltageLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The device three-phase output voltage of the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, from which the alarm was generated."
-   --#TYPE "APC XPDU:  Output voltage out-of-range alarm."
-   --#SUMMARY "Output voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 320
-
-xPDUOutputVoltageLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output voltage is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XPDU: Output voltage back in range."
-   --#SUMMARY "Output voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 321
-
-xPDUOutputVoltageHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The device three-phase output voltage of the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, above which the alarm was generated."
-   --#TYPE "APC XPDU:  Output voltage out-of-range alarm."
-   --#SUMMARY "Output voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 322
-
-xPDUOutputVoltageHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output voltage is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XPDU: Output voltage back in range."
-   --#SUMMARY "Output voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 323
-
-xPDUOutputCurrentLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices three-phase load current is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3).
-        The fourth argument is the measured current in tenths of Amps.
-        The fifth argument is the threshold, in Amps, from which the alarm was generated."
-   --#TYPE "APC XPDU: Output (load) current out-of-range alarm."
-   --#SUMMARY "Output current is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 324
-
-xPDUOutputCurrentLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output current is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3).
-        The fourth argument is the measured current in tenths of Amps."
-   --#TYPE "APC XPDU: Output (load) current back in range."
-   --#SUMMARY "Output current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 325
-
-xPDUOutputCurrentHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices three-phase load current is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3).
-        The fourth argument is the measured current in tenths of Amps.
-        The fifth argument is the threshold, in Amps, above which the alarm was generated."
-   --#TYPE "APC XPDU: Output (load) current out-of-range alarm."
-   --#SUMMARY "Output current is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 326
-
-xPDUOutputCurrentHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output current is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3).
-        The fourth argument is the measured current in tenths of Amps."
-   --#TYPE "APC XPDU: Output (load) current back in range."
-   --#SUMMARY "Output current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 327
-
-xPDUOutputFrequencyAlarm TRAP-TYPE
-  ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices output frequency is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the frequency deviation from the nominal in tenths of Hertz."
-   --#TYPE "APC XPDU: Output frequency out-of-range alarm."
-   --#SUMMARY "Output frequency is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 328
-
-xPDUOutputFrequencyAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices output frequency is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Output frequency back in range."
-   --#SUMMARY "Output frequency in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 329
-
-xPDUSystemGroundCurrentAlarm TRAP-TYPE
-  ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices earth ground current is over the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the measured current in tenths of Amps."
-   --#TYPE "APC XPDU: Earth ground current over range alarm."
-   --#SUMMARY "Earth ground current is over limit."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 330
-
-xPDUSystemGroundCurrentAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices earth ground current is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the measured current in tenths of Amps."
-   --#TYPE "APC XPDU: Earth ground current back in range."
-   --#SUMMARY "Earth ground current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 331
-
-xPDUInputContactStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsString02, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A user input contact on the device has changed to its abnormal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the input contact number. 
-        The fourth argument is the input contact name.
-        The fifth argument is the input contact state (1=OPEN, 2=CLOSED).
-        The sixth argument is the configured normal input contact state (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XPDU: Input contact has changed to its abnormal state."
-   --#SUMMARY "Input contact has changed to its abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 332
-
-xPDUInputContactStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsString02, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A user input contact on the device has changed to its normal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the input contact number. 
-        The fourth argument is the input contact name.
-        The fifth argument is the input contact state (1=CLOSED, 2=OPEN).
-        The sixth argument is the configured normal input contact state (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XPDU: Input contact has changed to its normal state."
-   --#SUMMARY "Input contact has changed to its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 333
-
-xPDUOutputRelayStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsString02, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "WARNING: An Output Relay on the device has changed to its abnormal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the Output Relay number. 
-        The fourth argument is the Output Relay name.
-        The fifth argument is the current Output Relay state (1=OPEN, 2=CLOSED).
-        The sixth argument is the configured normal Output Relay state (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XPDU: Output Relay has changed to its abnormal state."
-   --#SUMMARY "Output Relay has changed to its abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 334
-
-xPDUOutputRelayStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsString02, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: An Output Relay on the device has changed to its normal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the Output Relay number. 
-        The fourth argument is the Output Relay name.
-        The fifth argument is the current Output Relay state (1=OPEN, 2=CLOSED).
-        The sixth argument is the configured normal Output Relay state (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XPDU: Output Relay has changed to its normal state."
-   --#SUMMARY "Output Relay has changed to its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 335
-
-xPDUCoolingFanAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The device's internal cooling fans have failed.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Cooling fan failure alarm."
-   --#SUMMARY "Cooling fan failure."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 336
-
-xPDUCoolingFanAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The device's cooling fans are now functioning properly.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Cooling fan alarm cleared."
-   --#SUMMARY "Cooling fan alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 337
-
-xPDUTransformerTempAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The device's isolation transformer is over temperature.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Isolation transformer over temperature alarm."
-   --#SUMMARY "Transformer temp alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 338
-
-xPDUTransformerTempAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The device's isolation transformer is no longer over temperature.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Isolation transformer over temperature alarm cleared."
-   --#SUMMARY "Transformer temp alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 339
-
-xPDUBranchCurrentLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The current in a branch circuit is outside the limits specified for that
-        branch circuit.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the panel position of the branch circuit (1-based index).
-        The fourth argument is the measured current in tenths of Amps.
-        The fifth argument is the threshold, in tenth of Amps, from which the alarm was generated."
-   --#TYPE "APC XPDU: Branch circuit current out-of-range alarm."
-   --#SUMMARY "Branch circuit current is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 340
-
-xPDUBranchCurrentLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The current in a branch circuit is back within the limits 
-        specified for that branch circuit.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the panel position of the branch circuit (1-based index).
-        The fourth argument is the measured current in tenths of Amps."
-   --#TYPE "APC XPDU: Branch circuit current back in range."
-   --#SUMMARY "Branch circuit current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 341
-
-xPDUBranchCurrentHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The current in a branch circuit is outside the limits specified for that
-        branch circuit.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the panel position of the branch circuit (1-based index).
-        The fourth argument is the measured current in tenths of Amps.
-        The fifth argument is the threshold, in tenth of Amps, above which the alarm was generated."
-   --#TYPE "APC XPDU: Branch circuit current out-of-range alarm."
-   --#SUMMARY "Branch circuit current is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 342
-
-xPDUBranchCurrentHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The current in a branch circuit is back within the limits 
-        specified for that branch circuit.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the panel position of the branch circuit (1-based index).
-        The fourth argument is the measured current in tenths of Amps."
-   --#TYPE "APC XPDU: Branch circuit current back in range."
-   --#SUMMARY "Branch circuit current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 343
-
-
-xPDUInternalCommError TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: There is an internal communication error in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Internal communication error."
-   --#SUMMARY "Internal communication error."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 344
-
-emsHardwareStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The device's hardware is improperly configured and operating outside
-        normal bounds for the hardware.  This can be caused by improper devices being
-        connected to the EMS ports or Alink Current limit detection."
-   --#TYPE "APC EMS: Hardware is in an abnormal state."
-   --#SUMMARY "Hardware is in an abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 345
-
-emsHardwareStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The device's hardware is in its normal operational state.
-        The first argument is the host device serial number."
-   --#TYPE "APC EMS: Hardware is in a normal state."
-   --#SUMMARY "Hardware is in its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 346
-   
-ceSevereCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Custom Event severe condition was detected.
-       The first variable is the custom event text message.
-       The second variable is the custom event number."
-   --#TYPE "APC CustomEvent: A severe condition was detected. "
-   --#SUMMARY "A severe condition was detected. "
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 347
-
-ceSevereConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Custom Event severe condition was cleared.
-       The first variable is the custom event text message.
-       The second variable is the custom event number."
-   --#TYPE "APC CustomEvent: A severe condition was cleared. "
-   --#SUMMARY "A severe condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 348
-
-ceWarningCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Custom Event warning condition was detected.
-       The first variable is the custom event text message.
-       The second variable is the custom event number."
-   --#TYPE "APC CustomEvent: A warning condition was detected. "
-   --#SUMMARY "A warning condition was detected. "
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 349
-
-ceWarningConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Custom Event warning condition was cleared.
-       The first variable is the custom event text message.
-       The second variable is the custom event number."
-   --#TYPE "APC CustomEvent: A warning condition was cleared. "
-   --#SUMMARY "A warning condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 350
-
-ceInformationalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Custom Event informational condition was detected.
-       The first variable is the custom event text message.
-       The second variable is the custom event number."
-   --#TYPE "APC CustomEvent: Informational condition detected. "
-   --#SUMMARY "An informational condition was detected. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 351
-
-ceInformationalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Custom Event informational condition was cleared.
-       The first variable is the custom event text message.
-       The second variable is the custom event number."
-   --#TYPE "APC CustomEvent: Informational condition was cleared. "
-   --#SUMMARY "An informational condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 352
-     
-upsInternalOverTemperature TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "WARNING: The internal over temperature condition exists."
-   --#TYPE "APC UPS: The internal over temperature condition exists."
-   --#SUMMARY "The internal over temperature condition exists."
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 353
-
-upsInternalOverTemperatureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The internal over temperature condition cleared."
-   --#TYPE "APC UPS: The internal over temperature condition cleared."
-   --#SUMMARY "The internal over temperature condition cleared."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 354
-   
-upsMpuReset TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The MPU has been reset."
-   --#TYPE "APC UPS: The MPU has been reset."
-   --#SUMMARY "The MPU has been reset."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 355
-
-upsOutputSwitchClosed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The Output Switch is closed."
-   --#TYPE "APC UPS: The Output Switch is closed."
-   --#SUMMARY "The Output Switch is closed."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 356
-
-upsOutputSwitchOpened TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: The Output Switch is open."
-   --#TYPE "APC UPS: The Output Switch is open."
-   --#SUMMARY "The Output Switch is open."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 357
-
-upsCalibrationStackChanged TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: A calibration value in the stack was changed."
-   --#TYPE "APC UPS: A calibration value in the stack was changed."
-   --#SUMMARY "A calibration value in the stack was changed."
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 358
-
-   
--- Upgraded EMS now has more env traps
-
-envMaxTempThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Max temperature threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Max temperature threshold violation."
-   --#SUMMARY "Max temperature threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 359
-
-envMaxTempThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Max temperature threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Max temperature threshold violation cleared."
-   --#SUMMARY "Max temperature threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 360
-
-envMinTempThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Min temperature threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Min temperature threshold violation."
-   --#SUMMARY "Min temperature threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 361
-
-envMinTempThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Min temperature threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Min temperature threshold violation cleared."
-   --#SUMMARY "Min temperature threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 362
-
-envMaxHumidityThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Max humidity threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: Max humidity threshold violation."
-   --#SUMMARY "Max humidity threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 363
-
-envMaxHumidityThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Max humidity threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity. 
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: Max humidity threshold violation cleared."
-   --#SUMMARY "Max humidity threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 364
-
-envMinHumidityThresholdViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Min humidity threshold violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: Min humidity threshold violation."
-   --#SUMMARY "Min humidity threshold violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 365
-
-envMinHumidityThresholdViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeHumidity, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Min humidity threshold violation cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current humidity. 
-        The fourth argument is the probe number. 
-        The fifth argument is the probe name."
-   --#TYPE "APC ENV: Min humidity threshold violation cleared."
-   --#SUMMARY "Min humidity threshold violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 366
-
-envSTIncTempRateViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Short-term increasing temperature rate violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Short-term inc. temp rate violation."
-   --#SUMMARY "Short-term inc. temp rate violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 367
-
-envSTIncTempRateViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Short-term increasing temperature rate cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Short-term inc. temp rate violation cleared."
-   --#SUMMARY "Short-term inc. temp rate violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 368
-
-envSTDecTempRateViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Short-term decreasing temperature rate violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Short-term dec. temp rate violation."
-   --#SUMMARY "Short-term dec. temp rate violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 369
-
-envSTDecTempRateViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Short-term decreasing temperature rate cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Short-term dec. temp rate violation cleared."
-   --#SUMMARY "Short-term dec. temp rate violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 370
-
-envLTIncTempRateViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Long-term increasing temperature rate violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Long-term inc. temp rate violation."
-   --#SUMMARY "Long-term inc. temp rate violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 371
-
-envLTIncTempRateViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Long-term increasing temperature rate cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Long-term inc. temp rate violation cleared."
-   --#SUMMARY "Long-term inc. temp rate violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 372
-
-envLTDecTempRateViolation TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "SEVERE: Long-term decreasing temperature rate violated on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Long-term dec. temp rate violation."
-   --#SUMMARY "Long-term dec. temp rate violation."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 373
-
-envLTDecTempRateViolationCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { emsIdentSerialNumber, emsIdentEMSName, emsProbeStatusProbeTemperature, emsStatusSysTempUnits, 
-               emsProbeStatusProbeIndex, emsProbeStatusProbeName, mtrapargsString }
-   DESCRIPTION
-       "INFORMATIONAL: Long-term decreasing temperature rate cleared on the probe. 
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the current temperature. 
-        The fourth argument is the temperature scale. 
-        The fifth argument is the probe number. 
-        The sixth argument is the probe name."
-   --#TYPE "APC ENV: Long-term dec. temp rate violation cleared."
-   --#SUMMARY "Long-term dec. temp rate violation cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 374
-
--- Battery Management System Traps
-
-bmsCriticalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A Battery Management System critical condition was detected.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC BMS: A critical condition was detected. "
-   --#SUMMARY "A critical condition was detected. "
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 375
-
-bmsCriticalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Battery Management System critical condition was cleared.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC BMS: A critical condition was cleared. "
-   --#SUMMARY "A critical condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 376
-
-bmsWarningCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Battery Management System warning condition was detected.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC BMS: A warning condition was detected. "
-   --#SUMMARY "A warning condition was detected. "
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 377
-
-bmsWarningConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: A Battery Management System warning condition was cleared.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC BMS: A warning condition was cleared. "
-   --#SUMMARY "A warning condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 378
-
-bmsInformationalCondition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Battery Management System informational condition was detected.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC BMS: Informational condition detected. "
-   --#SUMMARY "An informational condition was detected. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 379
-
-bmsInformationalConditionCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsString02, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A Battery Management System informational condition was cleared.
-       The first variable is the error condition text message.
-       The second variable is the error number."
-   --#TYPE "APC BMS: Informational condition was cleared. "
-   --#SUMMARY "An informational condition was cleared. "
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 380
-
--- xATS Traps
-
-xATSOutputVoltageLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The device three-phase output voltage of the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, from which the alarm was generated."
-   --#TYPE "APC XATS:  Output voltage out-of-range alarm."
-   --#SUMMARY "Output voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 381
-
-xATSOutputVoltageLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output voltage is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XATS: Output voltage back in range."
-   --#SUMMARY "Output voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 382
-
-xATSOutputVoltageHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The device three-phase output voltage of the device is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts.
-        The fifth argument is the threshold, in tenths of Volts, above which the alarm is generated."
-   --#TYPE "APC XATS: Output voltage out-of-range alarm."
-   --#SUMMARY "Output voltage is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 383
-
-xATSOutputVoltageHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output voltage is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1-N, 2=L2-N, 3=L3-N, 4=unused, 5=L1-L2, 6=L2-L3, 7=L3-L1).
-        The fourth argument is the measured voltage in tenths of Volts."
-   --#TYPE "APC XATS: Output voltage back in range."
-   --#SUMMARY "Output voltage in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 384
-
-xATSOutputCurrentLowAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices three-phase load current is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3, 4=Neutral, 5=L1-2, 6=L2-3, 7=L3-1).
-        The fourth argument is the measured current in Amps.
-        The fifth argument is the threshold, in Amps, from which the alarm was generated."
-   --#TYPE "APC XATS: Output (load) current out-of-range alarm."
-   --#SUMMARY "Output current is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 385
-
-xATSOutputCurrentLowAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output current is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3, 4=Neutral).
-        The fourth argument is the measured current in Amps."
-   --#TYPE "APC XATS: Output (load) current back in range."
-   --#SUMMARY "Output current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 386
-
-xATSOutputCurrentHighAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices three-phase load current is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3, 4=Neutral).
-        The fourth argument is the measured current in Amps.
-        The fifth argument is the threshold, in Amps, from which the alarm was generated."
-   --#TYPE "APC XATS: Output (load) current out-of-range alarm."
-   --#SUMMARY "Output current is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 387
-
-xATSOutputCurrentHighAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices three-phase output current is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3, 4=Neutral).
-        The fourth argument is the measured current in Amps."
-   --#TYPE "APC XATS: Output (load) current back in range."
-   --#SUMMARY "Output current in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 388
-
-
-xATSOutputFrequencyAlarm TRAP-TYPE
-  ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The devices output frequency is outside the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the frequency deviation from the nominal in tenths of Hertz.
-        The fourth argument is the frequency deviation threshold in tenths of Hertz, 
-        from which the alarm was generated."
-   --#TYPE "APC XATS: Output frequency out-of-range alarm."
-   --#SUMMARY "Output frequency is out-of-range."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 389
-
-xATSOutputFrequencyAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The devices output frequency is back within the specified limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Output frequency back in range."
-   --#SUMMARY "Output frequency in range."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 390
-
-xATSInternalCommError TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: There is an internal communication error in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Internal communication error."
-   --#SUMMARY "Internal communication error."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 391
-
-xATSInternalCommErrorCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Internal communication has been restored.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Internal Communication error cleared."
-   --#SUMMARY "ATS Communication error cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 392
-
-xATSDataCommMismatchError TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A data incompatibility exists within the device.  This
-        is typically the result of mismatches between firmware revisions
-        of the transfer switch controller and the Network Management interface.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Data mismatch error."
-   --#SUMMARY "ATS data mismatch error."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 393
-
-xATSDataCommMismatchErrorCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The internal data incompatibility has been resolved.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: data mismatch error cleared."
-   --#SUMMARY "ATS data mismatch error cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 394
-
-xATSGenCommLost TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The XATS cannot communicate with the generator.
-        This will make unavailable all the xATSGenerator OIDs.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: No communication with generator."
-   --#SUMMARY "ATS/Generator communication lost."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 395
-
-xATSGenCommEstablished TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The XATS has established communication with the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Communication with generator established."
-   --#SUMMARY "ATS/generator communication established."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 396
-   
-xATSNeutralPosition TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger,
-                mtrapargsString }
-   DESCRIPTION
-      "WARNING: XATS has transferred to neutral position.
-        In this position neither Source 1 nor Source 2 is selected,
-        and the XATS will have no output voltage.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the mode in which the switch is operating
-        (1=Auto, 2=Not-in-Auto, Abnormal Condition  3=Not-in-Auto, manual)."
-   --#TYPE "APC XATS: Transferred to the neutral (no output power) position."
-   --#SUMMARY "Transferred to neutral."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 397
-
-xATSSwitchTransferEvent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger,
-                mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: XATS has transferred from one source to the other.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the mode in which the switch is operating.
-        (1=Auto, 2=Not-in-Auto, Abnormal Condition  3=Not-in-Auto, manual).
-        The fourth argument is the input source selected (1=Source 1, 2=Source 2).
-        The fifth argument is type of transfer that took place. (1=Closed, 2=Open, 3=Unknown)"
-   --#TYPE "APC XATS: Transferred from Source-X to Source-Y."
-   --#SUMMARY "Source-to-Source transfer."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 398
-
-xATSInternalATSFault TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: An internal XATS fault has been detected.
-        The XATS may have forced itself to not-in-auto mode (abnormal condition),
-        as indicated by the xATSSwitchStatusAutoSwitchOperationalMode OID.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument indicates the detected fault.
-
-           1=Cannot Close S1
-           2=Cannot Close S2
-           3=Cannot Open S1
-           4=Cannot Open S2
-           5=Cannot Trip Open S1 
-           6=Cannot Trip Open S2 
-           7=Start Contact Failure
-           8=Voltage Sensing Failure"
-
-   --#TYPE "APC XATS: Internal fault detected."
-   --#SUMMARY "ATS internal fault detected."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 399
-
-xATSInternalATSFaultCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected internal XATS fault has been cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument indicates the detected fault.
-
-           1=Cannot Close S1
-           2=Cannot Close S2
-           3=Cannot Open S1
-           4=Cannot Open S2
-           5=Cannot Trip Open S1 
-           6=Cannot Trip Open S2 
-           7=Start Contact Failure
-           8=Voltage Sensing Failure"
-
-   --#TYPE "APC XATS: Internal fault cleared."
-   --#SUMMARY "ATS internal fault cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 400
-
-xATSEngineStartAsserted TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The XATS has asserted the Engine Start contact.
-        This should result in the generator producing output voltage.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument indicates the reason that the start signal was asserted
-        1=Unknown, 2=S1 Low Voltage, 3=S1 High Voltage, 4=S1 Line Imbalance,
-        5=S1 Freq Range, 6=S1 Bad Rotation."
-   --#TYPE "APC XATS: Engine Start signal asserted."
-   --#SUMMARY "Engine Start asserted."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 401
-
-xATSEngineStopAsserted TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The XATS has de-asserted the Engine Start contact.
-        This should result in the generator shutting down, and producing no output voltage.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Engine Stop signal asserted."
-   --#SUMMARY "Engine Stop asserted."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 402
-
-xATSStartFailure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator failed to start. After assertion of the
-        Engine Start signal, the quality of Source 2 was not seen as good.
-        This alarm can be cleared using the xATSSwitchStatusClearLatchedAlarms OID.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument indicates the line quality at S2
-         1=Unknown, 2=S2 Low Voltage, 3=S2 High Voltage, 4=S2 Line Imbalance,
-         4=S2 Freq Range, 5=S2 Bad Rotation."
-   --#TYPE "APC XATS: Generator failed to start alarm."
-   --#SUMMARY "Generator failed to start."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 403
-
-xATSStopFailure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The generator failed to stop. After de-assertion of the
-        Engine Start signal, the quality of Source 2 continued to be seen as good.
-        This alarm can be cleared using the xATSSwitchStatusClearLatchedAlarms OID.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Generator failed to stop alarm."
-   --#SUMMARY "Generator failed to stop."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 404
-
-xATSNotInAutomaticMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Automatic Transfer Switch is not in automatic mode.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The xATSSwitchStatusAutoSwitchStatus OID and the
-        xATSSwitchStatusAutoSwitchOperationalMode OID
-        can provide more information about the state of the XATS."
-   --#TYPE "APC XATS: XATS is not-in-automatic mode."
-   --#SUMMARY "ATS not in auto."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 405
-
-xATSNotInAutomaticModeCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Automatic Transfer Switch is in automatic mode.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: XATS in auto mode."
-   --#SUMMARY "ATS in auto mode."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 406
-
-xATSEpoTripped TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The device's Emergency Power Off (EPO) circuit is tripped.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Emergency Power Off (EPO) tripped."
-   --#SUMMARY "EPO tripped."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 407
-
-xATSEpoReset TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The device's Emergency Power Off (EPO) circuit has been
-        reset to the armed position.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Emergency Power Off (EPO) reset."
-   --#SUMMARY "EPO armed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 408
-
-xATSEpoTestMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The device's Emergency Power Off (EPO) circuit has been
-        switched back to the test position.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Emergency Power Off (EPO) in test mode."
-   --#SUMMARY "EPO disabled."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 409
-
-xATSEpoArmed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The device's Emergency Power Off (EPO) circuit has been
-        switched back to the armed position.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Emergency Power Off (EPO) enabled."
-   --#SUMMARY "EPO armed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 410
-
-xATSTestInitiated TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A scheduled test has been initiated.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the type of test initiated (1=scheduled, 2=manual)."
-   --#TYPE "APC XATS: Test initiated."
-   --#SUMMARY "Test initiated."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 411
-
-xATSTestCancelled TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The scheduled test has been canceled
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the type of test initiated (1=scheduled, 2=manual)."
-   --#TYPE "APC XATS: Test cancelled."
-   --#SUMMARY "Test cancelled."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 412
-
-xATSTestFailed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The initiated test has failed.
-        This alarm can be cleared using the xATSSwitchStatusClearLatchedAlarms OID.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Initiated test failed."
-   --#SUMMARY "Initiated test failed."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 413
-
-xATSTestPassed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The initiated test has passed
-        switched back to the armed position.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Initiated test passed."
-   --#SUMMARY "Initiated test passed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 414
-
-xATSInputContactStateAbnormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsString02, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A user input contact on the device has changed to its abnormal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the input contact number. 
-        The fourth argument is the input contact name.
-        The fifth argument is the input contact state (1=OPEN, 2=CLOSED).
-        The sixth argument is the configured normal input contact state (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XATS: Input contact has changed to its abnormal state."
-   --#SUMMARY "Input contact has changed to its abnormal state."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 415
-
-xATSInputContactStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, 
-               mtrapargsString02, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A user input contact on the device has changed to its normal state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the input contact number. 
-        The fourth argument is the input contact name.
-        The fifth argument is the input contact state (1=OPEN, 2=CLOSED).
-        The sixth argument is the configured normal input contact state (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XATS: Input contact has changed to its normal state."
-   --#SUMMARY "Input contact has changed to its normal state."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 416
-
-xATSRemoteStartContactMismatch TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The state of the generator's Remote Start input
-        and the ATS's Engine Start output do not match. 
-        This indicates something wrong in the Engine Start wiring,
-        which must be corrected. This condition will prevent the 
-        generator from being started when needed.
-
-          (See also: xATSGeneratorStatusRemoteStart 
-           and xATSSwitchStatusEngineStartSignal OIDs)
-
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Generator/ATS start contact mismatch."
-   --#SUMMARY "Generator/ATS start contact mismatch."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 417
-
-xATSRemoteStartContactMismatchCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Mismatch in the state of the generator's 
-        Remote Start input and the ATS's Engine Start output as been resolved. 
-        This indicates something wrong in the Engine Start wiring,
-        which must be corrected. This condition will prevent the 
-        generator from being started when needed.
-
-          (See also: xATSGeneratorStatusRemoteStart 
-           and xATSSwitchStatusEngineStartSignal OIDs)
-
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Generator/ATS start contact mismatch cleared."
-   --#SUMMARY "Generator/ATS start contact mismatch cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 418
-
-xATSDoorOpenAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The XATS exterior panel door is open.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Panel door is open alarm."
-   --#SUMMARY "Panel door open alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 419
-
-xATSDoorOpenAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The external door to the device is closed.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Panel door open alarm cleared."
-   --#SUMMARY "Panel door open alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 420
-
-xATSDCBackupAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The XATS's DC backup has been lost. The XATS will lose power
-        on Source 1 failure, causing the Engine Start signal to be asserted.
-        The XATS will then restart from Source 2.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: DC backup failure."
-   --#SUMMARY "ATS DC backup failure."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 421
-
-xATSDCBackupAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: DC backup alarm has been cleared in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: DC backup alarm cleared."
-   --#SUMMARY "DC backup alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 422
-
--- xATS Generator Traps
-
-xATSGeneratorLowCoolantLevelAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Low coolant level has been detected in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low coolant level alarm."
-   --#SUMMARY "Generator low coolant level alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 423
-
-xATSGeneratorLowCoolantLevelAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected low coolant level has been cleared in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low coolant level alarm cleared."
-   --#SUMMARY "Generator low coolant level alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 424
-
-xATSGeneratorVeryLowCoolantLevelAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Very low coolant level has been detected in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator very low coolant level alarm."
-   --#SUMMARY "Generator very low coolant level alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 425
-
-xATSGeneratorVeryLowCoolantLevelAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected Very low coolant level has been cleared in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator very low coolant level alarm cleared."
-   --#SUMMARY "Generator very low coolant level alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 426
-
-xATSGeneratorHighCoolantTempAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: High coolant temperature has been detected in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator high coolant temperature alarm."
-   --#SUMMARY "Generator high coolant temperature alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 427
-
-xATSGeneratorHighCoolantTempAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected high coolant temperature has been cleared in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator high coolant temperature alarm cleared."
-   --#SUMMARY "Generator high coolant temperature alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 428
-
-xATSGeneratorVeryHighCoolantTempAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Very high coolant temperature has been detected in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator very high coolant temperature alarm."
-   --#SUMMARY "Generator very high coolant temperature alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 429
-
-xATSGeneratorVeryHighCoolantTempAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The Very high coolant temperature condition has been cleared in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator very high coolant temperature alarm cleared."
-   --#SUMMARY "Generator very high coolant temperature alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 430
-
-xATSGeneratorLowCoolantTempAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Low coolant temperature has been detected in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low coolant temperature alarm."
-   --#SUMMARY "Generator low coolant temperature alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 431
-
-xATSGeneratorLowCoolantTempAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The low coolant temperature condition has been cleared in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low coolant temperature alarm cleared."
-   --#SUMMARY "Generator low coolant temperature alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 432
-
-xATSGeneratorLowOilLevelAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Low oil level has been detected in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low oil level alarm."
-   --#SUMMARY "Generator low oil level alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 433
-
-xATSGeneratorLowOilLevelAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Low oil level alarm has been cleared in the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low oil level alarm cleared."
-   --#SUMMARY "Generator low oil level alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 434
-   
-xATSGeneratorLowBatteryVoltDuringCrankAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator's battery voltage has been detected 
-        as low while cranking the engine.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Low batt. voltage while cranking alarm."
-   --#SUMMARY "Generator low battery volts while cranking alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 435
-
-xATSGeneratorLowBatteryVoltDuringCrankAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator's low battery voltage while
-        cranking condition has been cleared.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "XGEN: Generator low batt. voltage while cranking alarm cleared."
-   --#SUMMARY "Generator low battery volts while cranking alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 436
-
-xATSGeneratorVeryLowBatteryVoltDuringCrankAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator's battery voltage has been detected 
-        as very low while cranking the engine.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "XGEN: Generator v.low battery voltage while cranking alarm."
-   --#SUMMARY "Generator v.low battery volts while cranking alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 437
-
-xATSGeneratorVeryLowBatteryVoltDuringCrankAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator's high battery voltage while
-        cranking condition has been cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "XGEN: Generator v.low batt volt, while cranking alarm cleared."
-   --#SUMMARY "Generator v.low battery volts while cranking alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 438
-
-xATSGeneratorEStop TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator's emergency stop input has been activated.
-        After the emergency stop signal has been removed, the E-Stop condition  
-        must be cleared before the generator can be started again.
-        E-Stop conditions can only be cleared via the generator front panel.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code.
-        The fourth argument is the type of E-Stop (1=LOCAL, 2=REMOTE)."
-   --#TYPE "APC XGEN: Generator emergency stop engaged."
-   --#SUMMARY "Generator emergency stop engaged."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 439
-
-xATSGeneratorEStopCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator's emergency stop condition has been cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code.
-        The fourth argument is the type of E-Stop (1=LOCAL, 2=REMOTE)."
-   --#TYPE "APC XGEN: Generator emergency stop condition cleared."
-   --#SUMMARY "Generator emergency stop condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 440
-
-xATSGeneratorHighBatteryVolt TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The generator's battery voltage has been detected as high.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator high battery voltage."
-   --#SUMMARY "Generator high battery volts."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 441
-
-xATSGeneratorHighBatteryVoltCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected high battery voltage has been cleared, on the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator high battery voltage condition cleared."
-   --#SUMMARY "Generator high battery volts condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 442
-
-xATSGeneratorLowBatteryVolt TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator's battery voltage has been detected as low.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low battery voltage."
-   --#SUMMARY "Generator low battery volts."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 443
-
-xATSGeneratorLowBatteryVoltCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected low battery voltage has been cleared, on the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low battery voltage condition cleared."
-   --#SUMMARY "Generator low battery volts condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 444
-
-xATSGeneratorControlSwitchNotAuto TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The control switch on the generator is not in auto position.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator not-in-automatic mode."
-   --#SUMMARY "Generator not-in-auto."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 445
-
-xATSGeneratorControlSwitchNotAutoCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The control switch on the generator is in auto position.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator automatic mode restored."
-   --#SUMMARY "Generator not-in-auto cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 446
-
-xATSGeneratorLowOilPressure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator's oil pressure has been detected as low.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low oil pressure."
-   --#SUMMARY "Generator low oil pressure."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 447
-
-xATSGeneratorLowOilPressureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected low oil pressure has been cleared, on the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator low oil pressure condition cleared."
-   --#SUMMARY "Generator low oil pressure condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 448
-
-xATSGeneratorVeryLowOilPressure TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator's oil pressure has been detected as very low.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator v.low oil pressure."
-   --#SUMMARY "Generator v.low oil pressure."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 449
-
-xATSGeneratorVeryLowOilPressureCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected v.low oil pressure has been cleared, on the generator.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator v.low oil pressure condition cleared."
-   --#SUMMARY "Generator v.low oil pressure condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 450
-
-xATSGeneratorOverload TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator is overloaded.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator is in overload event."
-   --#SUMMARY "Generator on overload event."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 451
-
-xATSGeneratorOverloadCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator is running within loading limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator is in overload event cleared."
-   --#SUMMARY "Generator on overload event cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 452
-
-xATSGeneratorLowACVEvent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator AC voltage is outside the acceptable bounds.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: State of the Generator ac voltage."
-   --#SUMMARY " State of the Generator ac voltage."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 453
-
-xATSGeneratorLowACVEventCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator AC voltage is within normal bounds.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: State of the Generator ac voltage cleared."
-   --#SUMMARY "State of the Generator ac voltage cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 454
-
-xATSGeneratorHighACVEvent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator AC voltage is outside the acceptable bounds.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: State of the Generator ac voltage."
-   --#SUMMARY " State of the Generator ac voltage."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 455
-
-xATSGeneratorHighACVEventCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator AC voltage is within normal bounds.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: State of the Generator ac voltage cleared."
-   --#SUMMARY "State of the Generator ac voltage cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 456
-
-xATSGeneratorOverspeed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator is running over the acceptable RPM.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator overspeed condition."
-   --#SUMMARY "Generator overspeed condition."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 457
-
-xATSGeneratorOverspeedCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator overspeed shutdown has been cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator overspeed condition cleared."
-   --#SUMMARY "Generator overspeed condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 458
-
-xATSGeneratorEngineCold TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator engine is cold, may not start.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator engine is cold, may not start."
-   --#SUMMARY "Generator engine is cold."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 459
-
-xATSGeneratorEngineColdCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The engine is not cold to start.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Engine is cold to start condition cleared."
-   --#SUMMARY "Engine is cold to start condition cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 460
-
-xATSGeneratorOutputBreakerOpen TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generators output breaker has been detected as open.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator output breaker open alarm."
-   --#SUMMARY "Generator output breaker open."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE NONOPERATIONAL
-   ::= 461
-
-xATSGeneratorOutputBreakerOpenCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The engine is not cold to start.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator output breaker open alarm cleared."
-   --#SUMMARY "Generator output breaker open cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 462
-
-xATSGeneratorLowFuelLevelAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The tank fuel level is below the limits specified
-        in the xATSGeneratorFuelSystemLowFuelLevelThreshold OID.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the measured fuel level in percent of full."
-   --#TYPE "APC XGEN: Low fuel level alarm."
-   --#SUMMARY "Generator low fuel level alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 463
-
-xATSGeneratorLowFuelLevelAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The tank fuel level is back above the specified limit.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XGEN: Low fuel level alarm cleared."
-   --#SUMMARY "Generator low fuel level alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 464
-
-xATSGeneratorVeryLowFuelLevelAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The tank fuel level is below the low threshold limits.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the measured tank fuel level in percent of full."
-   --#TYPE "APC XGEN: Very Low fuel level alarm."
-   --#SUMMARY "Generator very low fuel level alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 465
-
-xATSGeneratorVeryLowFuelLevelAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected low tank level has been cleared in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XGEN: Very low fuel level alarm cleared."
-   --#SUMMARY "Generator very low fuel level alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 466
-
-xATSGeneratorLowRunTimeAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The estimated runtime is below the limits specified.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the estimated runtime in hours."
-   --#TYPE "APC XGEN: Low run time alarm."
-   --#SUMMARY "Generator low run time alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 467
-
-xATSGeneratorLowRunTimeAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected low runtime has been cleared in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XGEN: Low run time alarm cleared."
-   --#SUMMARY "Generator low run time alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 468
-
-xATSGeneratorVeryLowRunTimeAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The estimated runtime is below the limits specified
-        in the xATSGeneratorFuelSystemVeryLowRunTimeThreshold OID.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the estimated runtime in hours."
-   --#TYPE "APC XGEN: Very low run time alarm."
-   --#SUMMARY "Generator very low run time alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 469
-
-xATSGeneratorVeryLowRunTimeAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The detected low runtime has been cleared in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XGEN: Very low run time alarm cleared."
-   --#SUMMARY "Generator very low run time alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 470
-
-xATSGeneratorServiceDueAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The generator is due for scheduled service.
-        Generation of this alarm is based on calender days since 
-        and/or actual generator run-hours since last service.
-        This alarm is cleared using the xATSGeneratorServiceResetRecord OID.
-
-          (See also: xATSGeneratorServiceCalendarIntervalThreshold
-           and xATSGeneratorServiceRunHoursThreshold OIDs)
-
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Generator scheduled maintenance is due."
-   --#SUMMARY "Generator maintenance due."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 471
-
-xATSGeneratorServiceDueAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator's service registers have been reset.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Generator service due alarm is cleared."
-   --#SUMMARY "Generator service alarm is cleard."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 472
-
-xATSGeneratorShutdown TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator is shutdown.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator shutdown."
-   --#SUMMARY "Generator shutdown"
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 473
-
-xATSGeneratorShutdownCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The generator shutdown alarm is cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator shutdown is cleared."
-   --#SUMMARY "Generator shutdown is cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 474
-
-xATSGeneratorBatteryCharger TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: The generator battery charger is nonfunctional.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator batt. charger is nonfunctional."
-   --#SUMMARY "Generator battery charger is nonfunctional"
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 475
-
-xATSGeneratorBatteryChargerCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName, mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: nonfunctionality of the generator battery is cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: " Nonfunctionality of battery charger is cleared."
-   --#SUMMARY "non-functionality of Generator battery charger is cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 476
-
-xATSGeneratorGenericEvent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: Any generic generator event.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generator generic event."
-   --#SUMMARY "Generator generic event."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 477
-
-xATSGeneratorGenericEventCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xATSIdentSerialNumber, xATSIdentProductName,  mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Generated generic generator event is cleared.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the OEM's fault/event code."
-   --#TYPE "APC XGEN: Generic generator event is cleared."
-   --#SUMMARY "Generic generator event is cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 478
-
--- xPDU Traps (part 2)
-
-xPDUInternalCommErrorCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Internal communication has been restored.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Internal Communication error cleared."
-   --#SUMMARY "Communication error cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 479
-
-xPDUSystemStateAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName,
-               mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The PDU's breakers (Q1, Q2 & Q3) are in a configuration that might lead
-        to system unavailability.  it may signify a temporary condition, when the breakers
-		are placed in an atypical manner as the user transitions to (UPS OPERATION or MAINTENANCE BYPASS)
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the type of alarm
-        (1=NO UPS INPUT, 2=NO PANEL FEED, 3=ATYPICAL BYPASS MODE)."
-   --#TYPE "APC XPDU: System state alarm ."
-   --#SUMMARY "PDU state alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 480
-
-xPDUSystemStateNormal TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, 
-               mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The PDU's breakers (Q1, Q2 & Q3) are set in a configuration
-        that is a non-alarm state.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the type of alarm (1=UPS OPERATION, 2=MAINTENANCE BYPASS)."
-   --#TYPE "APC XPDU: System state returned to normal."
-   --#SUMMARY "PDU state normal."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 481
-
-xPDUEpoTestMode TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "WARNING: The device's Emergency Power Off (EPO) circuit has been
-        switched back to the test position.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Emergency Power Off (EPO) in test mode."
-   --#SUMMARY "EPO disabled."
-   --#ARGUMENTS { }
-   --#SEVERITY WARNING
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 482
-
-xPDUEpoArmed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: The device's Emergency Power Off (EPO) circuit has been
-        switched back to the armed position.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Emergency Power Off (EPO) enabled."
-   --#SUMMARY "EPO armed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 483
-
-xPDUFuseBlownAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName,
-               mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: One or more fuses in this PDU have been detected as open.
-        These fuses are in the feed to the UPS associated with this PDU.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3)."
-   --#TYPE "APC XPDU: Check fuse alarm."
-   --#SUMMARY "Fuse detected opened."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 484
-
-xPDUFuseBlownAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName,
-               mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A previous check fuse alarm in this PDU has cleared.
-        These fuses are in the feed to the UPS associated with this PDU.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the phase (1=L1, 2=L2, 3=L3)."
-   --#TYPE "APC XPDU: Check fuse alarm cleared."
-   --#SUMMARY "Fuse alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 485
-
-xPDUBreakerPositionAlarm TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, 
-               mtrapargsInteger, mtrapargsInteger02, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: A PDU breaker is in a state that compromises system availability.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the breaker (1=MAIN INPUT, 2=BYPASS INPUT, 3=CROSS TIE).
-        The fourth argument is the breaker position (1=OPEN, 2=CLOSED)."
-   --#TYPE "APC XPDU: Breaker position alarm."
-   --#SUMMARY "Breaker position alarm."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 486
-
-xPDUBreakerPositionAlarmCleared TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName,
-               mtrapargsInteger, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A PDU breaker is no longer in a state that compromises system availability.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the breaker (1=MAIN INPUT, 2=BYPASS INPUT, 3=CROSS TIE)."
-   --#TYPE "APC XPDU: Breaker position alarm cleared."
-   --#SUMMARY "Breaker alarm cleared."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 487
-
-xPDUBreakerChangeEvent TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsInteger,
-               mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: A system breaker or switch within the device has changed state.
-	    They are generated when any of the Q1, Q2 or Q3 breakers have changed states.
-        The first argument is the host device serial number.
-        The second argument is the host device name.
-        The third argument is the breaker that has changed
-        (1=UPS FEED (Q1), 2=UPS OUTPUT(Q2), 3=MAINTENANCE BYPASS (Q3).
-        The fourth argument is the state of the breaker that has changed (1=OPEN, 2=CLOSED).
-        The fifth argument is a 8-bit field representing the state of all breakers in the system,
-		when any of one of the Q1, Q2 or Q3 breakers have changed state.
-
-        The bit map is represented in the following manner (b7, b6 ... b0)
-		b0 - UPS FEED (Q1)
-		b1 - MAINTENANCE BYPASS (Q3)
-		b2 - UPS OUTPUT (Q2)
-        b3 - MAIN INPUT
-		b4 - BYPASS INPUT
-		b5 - CROSS-TIE OUTPUT
-
-        Example:  value of 60 (0x3C) indicates that the CROSS_TIE, BYPASS and MAIN INPUT, and Q2 breakers 
-        are CLOSED and Q2, Q1 breakers are OPEN." 
-   --#TYPE "APC XPDU: Breaker/switch change event."
-   --#SUMMARY "Breaker/switch change event."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 488
-
-xPDUControllerFirmwareUpdateTransferStart TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Start Controller firmware transfer in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Start controller firmware transfer."
-   --#SUMMARY "Start controller firmware transfer."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 489
-
-xPDUControllerFirmwareUpdateTransferComplete TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Transfer of Controller firmware was completed in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Controller firmware transfer completed."
-   --#SUMMARY "Controller firmware transfer completed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 490
-
-xPDUControllerFirmwareUpdateTransferFailed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Transfer of Controller firmware has failed in the PDU.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XPDU: Controller firmware transfer failed."
-   --#SUMMARY "Controller firmware transfer failed."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 491
-
-xATSControllerFirmwareUpdateTransferStart TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Start Controller firmware transfer in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Start controller firmware transfer."
-   --#SUMMARY "Start controller firmware transfer."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 492
-
-xATSControllerFirmwareUpdateTransferComplete TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "INFORMATIONAL: Transfer of Controller firmware was completed in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Controller firmware transfer completed."
-   --#SUMMARY "Controller firmware transfer completed."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 493
-
-xATSControllerFirmwareUpdateTransferFailed TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { xPDUIdentSerialNumber, xPDUIdentProductName, mtrapargsString }
-   DESCRIPTION
-      "SEVERE: Transfer of Controller firmware has failed in the device.
-        The first argument is the host device serial number.
-        The second argument is the host device name."
-   --#TYPE "APC XATS: Controller firmware transfer failed."
-   --#SUMMARY "Controller firmware transfer failed."
-   --#ARGUMENTS { }
-   --#SEVERITY SEVERE
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE DEGRADED
-   ::= 494
-
-apcDeviceShutdownHeartbeat TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { mtrapargsInteger, mtrapargsTimeTicks, mtrapargsString}
-   DESCRIPTION
-      "INFORMATIONAL: "
-   --#TYPE "APC X:"
-   --#SUMMARY "."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 999
-
-apcDiscoveryAlarmStateTableUpdate TRAP-TYPE
-   ENTERPRISE apc
-   VARIABLES { apcDiscoveryDeviceAlarmStateChangeCount }
-   DESCRIPTION
-      "INTERNAL: A Discovery Alarm State Table Update trap is sent
-       when any data alarm state is added, removed, or its parameters
-       are changed in the condition table.  This trap is
-       only for machine-to-machine communication. "
-   --#TYPE "APC X:"
-   --#SUMMARY "."
-   --#ARGUMENTS { }
-   --#SEVERITY INFORMATIONAL
-   --#TIMEINDEX 1
-   --#HELP ""
-   --#HELPTAG 0
-   --#STATE OPERATIONAL
-   ::= 1000
-   
-END
diff --git a/fence/agents/baytech/Makefile b/fence/agents/baytech/Makefile
deleted file mode 100644
index 23bfe58..0000000
--- a/fence/agents/baytech/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_baytech
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/baytech/fence_baytech.8 b/fence/agents/baytech/fence_baytech.8
deleted file mode 100644
index aa17955..0000000
--- a/fence/agents/baytech/fence_baytech.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_baytech 8
-
-.SH NAME
-fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server
-
-.SH SYNOPSIS
-.B
-fence_baytech
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-
-This fencing agent is written for the Baytech RPC27-20nc in combination with
-a Cyclades terminal server.  The Cyclades TS exports the RPC's serial port
-via a Telnet interface.  Other interfaces, such as SSH, are possible.  
-However, this script relies upon the assumption that Telnet is used.  Future
-features to this agent would allow the agent to work with a multitude of 
-different communication protocols such as Telnet, SSH or Kermit.
-
-The other assumption that is made is that Outlet names do not end in space.
-The name "Foo" and "Foo    " are identical when the RPC prints them with
-the status command.
-
-fence_baytech accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent.  fence_baytech
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.baytech.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIhost\fP
-IP address or hostname to connect to.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The name of the outlet to act upon.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_baytech.
-.TP
-\fIhost = < hostname | ip >\fR
-IP address or hostname to connect to.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIaction = < param >\fR
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIoutlet = < param >\fR
-The name of the outlet to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
deleted file mode 100644
index b625968..0000000
--- a/fence/agents/baytech/fence_baytech.pl
+++ /dev/null
@@ -1,683 +0,0 @@
-#!/usr/bin/perl
-
-# This fencing agent is written for the Baytech RPC27-20nc in conjunction with
-# a Cyclades terminal server.  The Cyclades TS exports the RPC's serial port
-# via a Telnet interface.  Other interfaces, such as SSH, are possible.  
-# However, this script relys upon the assumption that Telnet is used.  Future
-# features to this agent would allow the agent to work with a mulitude of 
-# different communication protocols such as Telnet, SSH or Kermit.
-#
-# The other assumption that is made is that Outlet names do not end in space.
-# The name "Foo" and "Foo    " are identical when the RPC prints them with
-# the status command.
-
-use Net::Telnet;
-use Getopt::Std;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-
-sub rpc_error 
-{
-	if (defined $error_message && $error_message ne "")
-	{
-		chomp $error_message;
-		die "$error_message\n";
-	}
-	else
-	{
-		die "read timed-out\n"
-	}
-}
-
-sub usage 
-{
-
-    print "Usage:\n";
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print " -a host        host to connect to\n";
-    print " -D             debugging output\n";
-    print " -h             usage\n";
-    print " -l string      user name\n";
-    print " -o string      action: on,off,status or reboot (default)\n";
-    print " -n string      outlet name\n";
-    print " -p string      password\n";
-    print " -S path        script to run to retrieve password\n";
-    print " -V             version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg)=@_;
-  print $msg."\n" unless defined $quiet;
-  $t->close if defined $t;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)=@_;
-  print STDERR $msg."\n" if $msg;
-  print STDERR "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-# Get operating paramters, either with getopts or from STDIN
-sub get_options
-{
-   $action = "Reboot";
-   if (@ARGV > 0) {
-      getopts("n:l:p:S:o:a:VhD") || fail_usage ;
-
-      usage if defined $opt_h;
-      version if defined $opt_V;
-
-      fail_usage "Unkown parameter." if (@ARGV > 0);
-
-   } else {
-      get_options_stdin();
-   } 
-
-   fail "failed: must specify hostname" unless defined $opt_a;
-   $host=$opt_a;
-   $port=23 unless ($opt_a =~ /:/);
-
-   $action = $opt_o if defined $opt_o;
-   fail "failed: unrecognised action: $action"
-         unless $action=~ /^(Off|On|Reboot|status)$/i;
-   
-   fail "failed: no outletname" unless defined $opt_n;
-   $outlet = $opt_n;
-
-   $debug=$opt_D if defined $opt_D;
-   $quiet=$opt_q if defined $opt_q;
-   $user=$opt_l if defined $opt_l;
-   $passwd=$opt_p if defined $opt_p;
-   if (defined $opt_S) {
-     $pwd_script_out = `$opt_S`;
-     chomp($pwd_script_out);
-     if ($pwd_script_out) {
-       $passwd=$pwd_script_out;
-     }
-   }
-
-   if(defined $passwd && !defined $user)
-   {
-      fail "failed: password given without username";
-   }
-}
-
-# Get options from STDIN
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-	$_ = $in;
-        chomp;
-
-	# strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-	# skip comments
-	next if /^#/;
-
-        $line+=1;
-        $opt=$_;
-	next unless $opt;
-
-	($name,$val)=split /\s*=\s*/, $opt;
-
-	if ( $name eq "" )
-	{
-	   print STDERR "parse error: illegal name in option $line\n";
-	   exit 2;
-	} 
-
-        # DO NOTHING -- this field is used by fenced 
-	elsif ($name eq "agent" ) { } 
-
-	elsif ($name eq "host" ) 
-	{
-	    $opt_a = $val;
-	} 
-
-	elsif ($name eq "login" ) 
-	{
-	    $opt_l = $val;
-	} 
-
-	elsif ($name eq "passwd" ) 
-	{
-	    $opt_p = $val;
-	} 
-
-    elsif ($name eq "passwd_script") {
-        $opt_S = $val;
-    }
-
-	elsif ($name eq "action" ) 
-	{
-	    $opt_o = $val;
-	} 
-
-	elsif ($name eq "outlet" ) 
-	{
-	    $opt_n = $val;
-	} 
-
-    }
-}
-
-# Get a bunch of lines.  The newlines must terminate complete lines.
-sub getlines
-{
-	my $data=$t->get();
-	return undef unless defined $data;
-	my @chars = split //,$data;
-	my @lines;
-	my $line="";
-
-	for (my $i=0;$i<@chars;$i++)
-	{
-		$line = $line.$chars[$i];
-		next unless $chars[$i] eq "\n";
-		$lines[@lines] = $line;
-		$line = "";
-	}
-	$lines[@lines] = $line unless $line eq "";
-
-	return @lines;
-}
-
-# Fill the global input buffer of lines read.  All lines are terminated with
-# a newline.  If a line is not terminated, the next call to fill buffer will
-# append the last line of the input buffer with the first line that it gets from
-# getlines()
-sub fill_buffer
-{
-	my @lines = getlines();
-	return undef unless @lines;
-
-	if(@buffer)
-	{
-		if ( $buffer[$#buffer]=~/\n/) { }
-		else
-		{
-			$buffer[$#buffer] = $buffer[$#buffer].$lines[0];
-			shift @lines;
-		}
-	}
-
-	foreach (@lines) 
-	{ 
-		push @buffer,$_;
-	}
-}
-
-
-
-#
-# ($p_index, at data) = get_match @patterns;
-#
-# searches the input buffers for the patterns specified by the regeps in 
-# @patterns, when a match is found, all the lines through the matched 
-# pattern line are removed from the global input buffer and returned in the
-# array @data.  The index into @patterns for the matching pattern is also
-# returned.
-sub get_match
-{
-	my (@patterns) = @_;
-	$b_index = 0 unless defined $b_index;
-
-	fill_buffer() unless defined @buffer;
-
-	for(;;)
-	{
-		for(my $bi=$b_index; $bi<@buffer; $bi++)
-		{
-			for(my $pat=0; $pat<@patterns; $pat++)
-			{
-				if($buffer[$bi] =~ /$patterns[$pat]/)
-				{
-					$b_index = 0;
-					my @rtrn = splice(@buffer,0,$bi);
-					shift @buffer;
-				
-					if($debug)
-					{
-						foreach (@rtrn) { print $_ }
-						print "$patterns[$pat] ";
-					}
-					
-					return ($pat, at rtrn);
-				}
-			}
-			$b_index = $bi;
-		}
-
-		fill_buffer();
-	}
-}
-
-#
-# ($bt_num,$bt_name,$bt_state,$bt_locked) = parse_status $outlet, at data;
-#
-# This parses the data @data and searches for an outlet named $outlet.
-# The data will be in the form:
-# 
-#   Average Power:    0 Watts        Apparent Power:   17 VA
-# 
-#   True RMS Voltage: 120.0 Volts
-# 
-#   True RMS Current:   0.1 Amps     Maximum Detected:   0.2 Amps     
-# 
-#   Internal Temperature:  19.5 C
-# 
-#   Outlet Circuit Breaker: Good
-# 
-#    1)...Outlet  1       : Off           2)...Outlet  2       : Off          
-#    3)...Outlet  3       : On            4)...Outlet  4       : On           
-#    5)...Outlet  5       : On            6)...Outlet  6       : On           
-#    7)...Outlet  7       : On            8)...Outlet  8       : On           
-#    9)...Outlet  9       : On           10)...Outlet 10       : On           
-#   11)...Outlet 11       : On           12)...Outlet 12       : On           
-#   13)...Outlet 13       : On           14)...Outlet 14       : On           
-#   15)...Outlet 15       : On           16)...Outlet 16       : On           
-#   17)...Outlet 17       : On           18)...Outlet 18       : On           
-#   19)...Outlet 19       : On           20)...Outlet 20       : On    Locked 
-#
-sub parse_status
-{
-	my $outlet = shift;
-	my @data = @_;
-
-	my $bt_num="";
-	my $bt_name="";
-	my $bt_state="";
-	my $bt_locked="";
-
-	# Verify that the Outlet name exists
-	foreach my $line (@data)
-	{
-		next unless $line =~ /^[ 12][0-9]\)\.\.\./;
-
-		my @entries = split /([ 12][0-9])\)\.\.\./,$line;
-	
-		foreach my $entry (@entries)
-		{
-			next if $entry eq "";
-			
-			if($entry =~ /^([ 12][0-9])$/)
-			{
-				$bt_num = $1;
-			}
-			elsif($entry =~ /^(.{15}) : (On|Off)(.*)/)
-			{
-	
-				$bt_name = $1;
-				$bt_state = $2;
-				$bt_locked = $3;
-	
-				$_ = $bt_name;
-				s/\s*$//;
-				$bt_name = $_;
-	
-				$_ = $bt_locked;
-				s/\s*$//;
-				$bt_locked = $_;
-	
-				last if ($bt_name eq $outlet);
-	
-				$bt_name = "";
-				next;
-			}
-			else
-			{
-				die "parse error: $entry";
-			}
-		}
-		last if ($bt_name ne "");
-	}
-	
-	if ($bt_name eq "")
-	{
-		$bt_num=undef;
-		$bt_name=undef;
-		$bt_state=undef;
-		$bt_locked=undef;
-	}
-
-	return ($bt_num,$bt_name,$bt_state,$bt_locked);
-}
-
-##########################################################################
-#
-# Main
-
-get_options;
-
-
-if (defined $port)
-{
-	$t = new Net::Telnet(Host=>$host, Port=>$port) or 
-		die "Unable to connect to $host:$port: ".($!?$!:$_)."\n";
-}
-else
-{
-	$t = new Net::Telnet(Host=>$host) or 
-		die "Unable to connect to $host: ".($!?$!:$_)."\n";
-}
-
-
-
-#> DEBUG $t->dump_log("LOG");
-
-$t->print("\n");
-
-my @patterns;
-$prompt_user="^Enter user name:";
-$prompt_pass="^Enter Password:";
-$prompt_cmd="^RPC-27>";
-$prompt_confirm_yn="^.*\\(Y/N\\)\\?";
-
-$patterns[0]=$prompt_user;
-$patterns[1]=$prompt_pass;
-$patterns[2]=$prompt_cmd;
-$patterns[3]=$prompt_confirm_yn;
-
-my $p_index;
-my @data;
-
-my $bt_num="";
-my $bt_name="";
-my $bt_state="";
-my $bt_locked="";
-my $exit=1;
-
-($p_index, at data) = get_match @patterns;
-
-#
-# Set errmode after first get_match.  This allows for more descriptive errors
-# when handling unexpected error conditions
-#
-$t->errmode(\&rpc_error);
-
-# At this point, the username is unknown.  We'll just
-# pass in an empty passwd so that we can get back to the 
-# login prompt.  
-#
-# FIXME
-# If this is the third login failure for this switch, an
-# additional newline will need to be made sent.  This script
-# does not handle that case at this time.  This will cause
-# a timeout on read and cause this to fail.  Rerunning the
-# script ought to work though.
-if ($patterns[$p_index] eq $prompt_pass)
-{
-	$t->print("\n");
-	($p_index, at data) = get_match @patterns;
-}
-
-# Enter user name:
-#
-# Depending how the RPC is configured, a user name may not be required.
-# We will only deal with usernames if prompted.  
-#
-# If there is no user/passwd given as a parameter, but the switch
-# expects one, rather than just fail, we will first try to
-# get the switch in a known state 
-my $warn_user="yes";
-my $warn_passwd="yes";
-
-$error_message = "Invalid user/password";
-
-for (my $retrys=0; $patterns[$p_index] eq $prompt_user ; $retrys++)
-{
-	$warn_passwd = "yes";
-	if(defined $user)
-	{
-		$t->print("$user\n");
-		$warn_user = "no";
-	}
-	else
-	{
-		$t->print("\n");
-
-	}
-	($p_index, at data) = get_match @patterns;
-
-	# Enter Password:
-	#
-	# Users don't have to have passwords either.  We will only check
-	# that the user specified a password if we were prompted by the
-	# RPC.
-	if ($patterns[$p_index] eq $prompt_pass)
-	{
-		if(defined $passwd)
-		{
-			$t->print("$passwd\n");
-			$warn_passwd = "no";
-		}
-		else
-		{
-			$t->print("\n");
-		}
-
-		($p_index, at data) = get_match @patterns;
-	}
-
-
-	#
-	# If a valid user name is given, but not a valid password, we
-	# will loop forever unless we limit the number of retries
-	#
-	# set the user to "" so we stop entering a valid username and
-	# force the login proccess to fail
-	#
-	if ($retrys>2)
-	{
-		$user = "";
-	}
-	elsif ($retrys>10)
-	{
-		die "maximum retry count exceeded\n";
-	}
-}
-
-#
-# reset errmode to die()
-#
-$t->errmode("die");
-
-# all through with the login/passwd.  If we see any other prompt it is an 
-# error.
-if ($patterns[$p_index] ne $prompt_cmd)
-{
-	$t->print("\n");
-	die "bad state: '$patterns[$p_index]'";
-}
-
-if (defined $user && ($warn_user eq "yes"))
-{
-	warn "warning: user parameter ignored\n";
-}
-
-if (defined $passwd && ($warn_passwd eq "yes"))
-{
-	warn "warning: passwd parameter ignored\n";
-}
-
-
-
-
-# We are now logged in, no need for these patterns.  We'll strip these
-# so that we don't have to keep searching for patterns that shouldn't
-# appear.
-shift @patterns;
-shift @patterns;
-
-# Get the current status of a particular outlet.  Explicitly pass
-# the status command in case the RPC is not configured to report the
-# status on each command completion.
-$t->print("status\n");
-($p_index, at data) = get_match @patterns;
-($bt_num,$bt_name,$bt_state,$bt_locked) = parse_status $outlet, at data;
-
-if (!defined $bt_name )
-{
-	# We have problems if there is not outlet named $outlet
-	print "Outlet \'$outlet\' not found\n";
-	$exit=1;
-}
-elsif ($action =~ /status/i)
-{
-	print "Outlet '$bt_name' is $bt_state and is ".
-		(($bt_locked eq "")?"not ":"")."Locked\n";
-
-	if ($bt_state =~ /on/i)
-	{
-		$exit=0;
-	} else {
-		$exit=2;
-	}
-}
-elsif ($bt_locked ne "")
-{
-	# Report an error if an outlet is locked since we can't actually 
-	# issue commands on a Locked outlet.  This will prevent false
-	# successes.
-	print "Outlet '$bt_name' is Locked\n";
-	$exit=1;
-}
-elsif (($action =~ /on/i && $bt_state eq "On") ||
-	($action =~ /off/i && $bt_state eq "Off") )
-{
-	# No need to issue the on/off command since we are already in 
-	# the desired state
-	print "Outlet '$bt_name' is already $bt_state\n";
-	$exit=0;
-}
-elsif ($action =~ /o(n|ff)/i)
-{
-	# On/Off command
-	$t->print("$action $bt_num\n");
-	($p_index, at data) = get_match @patterns;
-	
-	# Confirmation prompting maybe enabled in the switch.  If it is,
-	# we enter 'Y' for yes.
-	if ($patterns[$p_index] eq $prompt_confirm_yn)
-	{
-		$t->print("y\n");
-		($p_index, at data) = get_match @patterns;
-	}
-
-	$t->print("status\n");
-	($p_index, at data) = get_match @patterns;
-
-	($bt_num,$bt_name,$bt_state,$bt_locked) = parse_status $outlet, at data;
-	
-	if ($bt_state =~ /$action/i)
-	{
-		print "success: outlet='$outlet' action='$action'\n";
-		$exit=0;
-	}
-	else
-	{	
-		print "fail: outlet='$outlet' action='$action'\n";
-		$exit=1;
-	}
-}
-elsif ($action =~ /reboot/i)
-{
-	# Reboot command
-	$t->print("$action $bt_num\n");
-	($p_index, at data) = get_match @patterns;
-	
-	# Confirmation prompting maybe enabled in the switch.  If it is,
-	# we enter 'Y' for yes.
-	if ($patterns[$p_index] eq $prompt_confirm_yn)
-	{
-		$t->print("y\n");
-		($p_index, at data) = get_match @patterns;
-	}
-
-	# The reboot command is annoying.  It reports that the outlet will
- 	# reboot in 9 seconds.  Then it has a countdown timer.  We first
-	# look for the "Rebooting... 9" message, then we parse the remaining
-	# output to verify that it reaches 0 without skipping anything.
-	my $pass=0;
-	foreach (@data)
-	{
-		chomp;
-		my $line = $_;
-
-		# There is a countdown timer that prints a number, then sleeps a 
-		# second, then prints a backspace and then another number
-		#
-		# /^Rebooting\.\.\. 9\b8\b7\b6\b5\b4\b3\b2\b1\b0\b$/
-		if($line =~/^Rebooting\.\.\..*0[\b]$/)
-		{
-			$pass=1;
-			last;
-		}
-	}
-
-	if ($pass)
-	{
-		print "success: outlet='$outlet' action='$action'\n";
-		$exit=0;
-	}
-	else
-	{
-		print "fail: outlet='$outlet' action='$action'\n";
-		$exit=1;
-	}
-}
-else
-{
-	die "bad state";
-}
-
-# Clean up.  If we don't tell it to logout, then anybody else can log onto 
-# the serial port and have access to the switch without authentication (when 
-# enabled)
-$t->print("logout\n");
-$t->close;
-exit $exit;
diff --git a/fence/agents/bladecenter/Makefile b/fence/agents/bladecenter/Makefile
deleted file mode 100644
index 76b2a2c..0000000
--- a/fence/agents/bladecenter/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_bladecenter
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
deleted file mode 100644
index 8b890e4..0000000
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  Model                 Firmware
-## +--------------------+---------------------------+
-## (1) Main application	  BRET85K, rev 16  
-##     Boot ROM           BRBR67D, rev 16
-##     Remote Control     BRRG67D, rev 16
-##
-#####
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	try:
-		node_cmd = "system:blade\[" + options["-n"] + "\]>"
-
-		conn.send("env -T system:blade[" + options["-n"] + "]\r\n")
-		i = conn.log_expect(options, [ node_cmd, "system>" ] , int(options["-Y"]))
-		if i == 1:
-			## Given blade number does not exist
-			if options.has_key("-M"):
-				return "off"
-			else:
-				fail(EC_STATUS)
-		conn.send("power -state\r\n")
-		conn.log_expect(options, node_cmd, int(options["-Y"]))
-		status = conn.before.splitlines()[-1]
-		conn.send("env -T system\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	return status.lower().strip()
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "powerup",
-		'off': "powerdown"
-	}[options["-o"]]
-
-	try:
-		node_cmd = "system:blade\[" + options["-n"] + "\]>"
-
-		conn.send("env -T system:blade[" + options["-n"] + "]\r\n")
-		conn.log_expect(options, node_cmd, int(options["-Y"]))
-		conn.send("power -"+options["-o"]+"\r\n")
-		conn.log_expect(options, node_cmd, int(options["-Y"]))
-		conn.send("env -T system\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def get_blades_list(conn, options):
-	outlets = { }
-	try:
-		node_cmd = "system>"
-
-		conn.send("env -T system\r\n")
-		conn.log_expect(options, node_cmd, int(options["-Y"]))
-		conn.send("list -l 2\r\n")
-		conn.log_expect(options, node_cmd, int(options["-Y"]))
-
-		lines = conn.before.split("\r\n")
-		filter_re = re.compile("^\s*blade\[(\d+)\]\s+(.*?)\s*$")
-		for x in lines:
-			res = filter_re.search(x)
-			if res != None:
-				outlets[res.group(1)] = (res.group(2), "")
-
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	return outlets
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"cmd_prompt", "secure", "port", "identity_file", "separator",
-			"inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait", "missing_as_off" ]
-
-	atexit.register(atexit_handler)
-
-	all_opt["power_wait"]["default"] = "10"
-	all_opt["cmd_prompt"]["default"] = "system>"
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	docs = { }        
-	docs["shortdesc"] = "Fence agent for IBM BladeCenter"
-	docs["longdesc"] = "fence_bladecenter is an I/O Fencing agent \
-which can be used with IBM Bladecenters with recent enough firmware that \
-includes telnet support. It logs into a Brocade chasis via telnet or ssh \
-and uses the command line interface to power on and off blades."
-	docs["vendorurl"] = "http://www.ibm.com"
-	show_docs(options, docs)
-	
-	##
-	## Operate the fencing device
-	######
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status, get_blades_list)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.send("exit\r\n")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/bladecenter_snmp/Makefile b/fence/agents/bladecenter_snmp/Makefile
deleted file mode 100644
index d98cfa69..0000000
--- a/fence/agents/bladecenter_snmp/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_bladecenter_snmp
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bladecenter_snmp/fence_bladecenter_snmp.py b/fence/agents/bladecenter_snmp/fence_bladecenter_snmp.py
deleted file mode 100644
index deceada..0000000
--- a/fence/agents/bladecenter_snmp/fence_bladecenter_snmp.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/python
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-from fencing_snmp import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="IBM BladeCenter SNMP fence agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-### CONSTANTS ###
-# From fence_ibmblade.pl
-STATUSES_OID=".1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.4" # remoteControlBladePowerState
-CONTROL_OID=".1.3.6.1.4.1.2.3.51.2.22.1.6.1.1.7" # powerOnOffBlade
-
-# Status constants returned as value from SNMP
-STATUS_DOWN=0
-STATUS_UP=1
-
-# Status constants to set as value to SNMP
-STATUS_SET_OFF=0
-STATUS_SET_ON=1
-
-### FUNCTIONS ###
-
-def get_power_status(conn,options):
-	(oid,status)=conn.get("%s.%s"%(STATUSES_OID,options["-n"]))
-	return (status==str(STATUS_UP) and "on" or "off")
-
-def set_power_status(conn, options):
-	conn.set("%s.%s"%(CONTROL_OID,options["-n"]),(options["-o"]=="on" and STATUS_SET_ON or STATUS_SET_OFF))
-
-def get_outlets_status(conn, options):
-	result={}
-
-	res_blades=conn.walk(STATUSES_OID,30)
-
-	for x in res_blades:
-		port_num=x[0].split('.')[-1]
-
-		port_alias=""
-		port_status=(x[1]==str(STATUS_UP) and "on" or "off")
-
-		result[port_num]=(port_alias,port_status)
-
-	return result
-
-# Define new options
-def ibmblade_define_defaults():
-	all_opt["snmp_version"]["default"]="1"
-
-# Main agent method
-def main():
-	global port_oid
-
-	device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
-		       "action", "ipaddr", "login", "passwd", "passwd_script",
-		       "test", "port", "separator", "no_login", "no_password",
-		       "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
-		       "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
-		       "udpport","inet4_only","inet6_only",
-		       "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	snmp_define_defaults ()
-	ibmblade_define_defaults()
-
-	options=check_input(device_opt,process_input(device_opt))
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for IBM BladeCenter over SNMP"
-	docs["longdesc"] = "fence_bladecenter_snmp is an I/O Fencing agent \
-which can be used with IBM BladeCenter chassis. It issues SNMP Set \
-request to BladeCenter chassis, rebooting, powering up or down \
-the specified Blade Server."
-	docs["vendorurl"] = "http://www.ibm.com"
-	show_docs(options, docs)
-
-	# Operate the fencing device
-	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
-
-	sys.exit(result)
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/brocade/Makefile b/fence/agents/brocade/Makefile
deleted file mode 100644
index 6ac510f..0000000
--- a/fence/agents/brocade/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_brocade
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/brocade/fence_brocade.8 b/fence/agents/brocade/fence_brocade.8
deleted file mode 100644
index 812a3f9..0000000
--- a/fence/agents/brocade/fence_brocade.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_brocade 8
-
-.SH NAME
-fence_brocade - I/O Fencing agent for Brocade FC switches
-
-.SH SYNOPSIS
-.B
-fence_brocade
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_brocade is an I/O Fencing agent which can be used with Brocade FC 
-switches.  It logs into a Brocade switch via telnet and disables a specified 
-port.  Disabling the port which a machine is connected to effectively fences 
-that machine.  Lengthy telnet connections to the switch should be avoided 
-while a GFS cluster is running because the connection will block any necessary 
-fencing actions.
-
-fence_brocade accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent.  fence_brocade 
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the Brocade FC switch.  When the fenced machine is ready to be brought back 
-into the GFS cluster (after reboot) the port on the Brocade FC switch needs to 
-be enabled. This can be done by running fence_brocade and specifying the 
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required.  disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_brocade.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required.  disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/brocade/fence_brocade.pl b/fence/agents/brocade/fence_brocade.pl
deleted file mode 100644
index 933cecf..0000000
--- a/fence/agents/brocade/fence_brocade.pl
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-use Net::Telnet ();
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-$opt_o = 'disable';        # Default fence action
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage
-{
-    print "Usage:\n";
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -a <ip>          IP address or hostname of switch\n";
-    print "  -h               usage\n";
-    print "  -l <name>        Login name\n";
-    print "  -n <num>         Port number to operate on\n";
-    print "  -o <string>      Action:  disable (default) or enable\n";
-    print "  -p <string>      Password for login\n";
-    print "  -S <path>        Script to run to retrieve password\n";
-    print "  -q               quiet mode\n";
-    print "  -V               version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg) = @_;
-  print $msg."\n" unless defined $opt_q;
-  $t->close if defined $t;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)=@_;
-  print STDERR $msg."\n" if $msg;
-  print STDERR "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-
-if (@ARGV > 0) {
-   getopts("a:hl:n:o:p:S:qV") || fail_usage ;
-
-   usage if defined $opt_h;
-   version if defined $opt_V;
-
-   fail_usage "Unknown parameter." if (@ARGV > 0);
-
-   if (defined $opt_S) {
-     $pwd_script_out = `$opt_S`;
-     chomp($pwd_script_out);
-     if ($pwd_script_out) {
-       $opt_p = $pwd_script_out;
-     }
-   }
-
-   fail_usage "No '-a' flag specified." unless defined $opt_a;
-   fail_usage "No '-n' flag specified." unless defined $opt_n;
-   fail_usage "No '-l' flag specified." unless defined $opt_l;
-   fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
-   fail_usage "Unrecognised action '$opt_o' for '-o' flag"
-      unless $opt_o =~ /^(disable|enable)$/i;
-
-} else {
-   get_options_stdin();
-
-   fail "failed: no IP address" unless defined $opt_a;
-   fail "failed: no plug number" unless defined $opt_n;
-   fail "failed: no login name" unless defined $opt_l;
-
-   if (defined $opt_S) {
-     $pwd_script_out = `$opt_S`;
-     chomp($pwd_script_out);
-     if ($pwd_script_out) {
-       $opt_p = $pwd_script_out;
-     }
-   }
-
-   fail "failed: no password" unless defined $opt_p;
-   fail "failed: unrecognised action: $opt_o"
-      unless $opt_o =~ /^(disable|enable)$/i;
-}
-
-if ( $opt_o =~ /^(disable|enable)$/i )
-{
-  $opt_o = "port".$1;
-}
-
-
-#
-# Set up and log in
-#
-
-$t = new Net::Telnet;
-
-$t->open($opt_a);
-
-$t->waitfor('/login:/');
-
-$t->print($opt_l);
-
-$t->waitfor('/assword:/');
-
-$t->print($opt_p);
-
-$t->waitfor('/\>/');
-
-
-
-#
-# Do the command
-#
-
-$cmd = "$opt_o $opt_n";
-$t->print($cmd);
-
-
-#
-# Assume here that the word "error" will appear after errors (bad assumption! see next check)
-#
-
-($text, $match) = $t->waitfor('/\>/');
-if ($text =~ /error/)
-{
-  fail "failed: error from switch\n";
-}
-
-
-#
-# Do a portshow on the port and look for the DISABLED string to verify success
-#
-
-$t->print("portshow $opt_n");
-($text, $match) = $t->waitfor('/\>/');
-
-if ( $opt_o eq "portdisable" && !($text =~ /DISABLED/) )
-{
-  fail "failed: portshow $opt_n does not show DISABLED\n";
-}
-elsif ( $opt_o eq "portenable" && ($text =~ /DISABLED/) )
-{
-  fail "failed: portshow $opt_n shows DISABLED\n";
-}
-
-
-print "success: $opt_o $opt_n\n" unless defined $opt_q;
-exit 0;
-
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-        $_ = $in;
-        chomp;
-
-	# strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-	# skip comments
-        next if /^#/;
-
-        $line+=1;
-        $opt=$_;
-        next unless $opt;
-
-        ($name,$val)=split /\s*=\s*/, $opt;
-
-        if ( $name eq "" )
-        {  
-           print STDERR "parse error: illegal name in option $line\n";
-           exit 2;
-	}
-	
-        # DO NOTHING -- this field is used by fenced
-	elsif ($name eq "agent" ) { } 
-
-	# FIXME -- depricated.  use "port" instead.
-        elsif ($name eq "fm" ) 
-	{
-            (my $dummy,$opt_n) = split /\s+/,$val;
-	    print STDERR "Depricated \"fm\" entry detected.  refer to man page.\n";
-	}
-
-        elsif ($name eq "ipaddr" ) 
-	{
-            $opt_a = $val;
-        } 
-	elsif ($name eq "login" ) 
-	{
-            $opt_l = $val;
-        } 
-
-	# FIXME -- depreicated residue of old fencing system
-	elsif ($name eq "name" ) { } 
-
-        elsif ($name eq "option" )
-        {
-            $opt_o = $val;
-        }
-	elsif ($name eq "passwd" ) 
-	{
-            $opt_p = $val;
-        } 
-	elsif ($name eq "passwd_script") {
-		$opt_S = $val;
-	}
-	elsif ($name eq "port" ) 
-	{
-            $opt_n = $val;
-        } 
-	# elsif ($name eq "test" ) 
-	# {
-        #    $opt_T = $val;
-        # } 
-    }
-}
diff --git a/fence/agents/bullpap/Makefile b/fence/agents/bullpap/Makefile
deleted file mode 100644
index b84826a..0000000
--- a/fence/agents/bullpap/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_bullpap
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bullpap/fence_bullpap.8 b/fence/agents/bullpap/fence_bullpap.8
deleted file mode 100644
index 1404c75..0000000
--- a/fence/agents/bullpap/fence_bullpap.8
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH fence_bullpap 8
-
-.SH NAME
-fence_bullpap - I/O Fencing agent for Bull FAME architecture controlled by a 
-PAP management console.
-
-.SH SYNOPSIS
-.B
-fence_bullpap
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_bullpap is an I/O Fencing agent which can be used with Bull's NovaScale
-machines controlled by PAP management consoles.  This agent calls Bull's
-support software provided by the NSMasterHW RPM available from Bull.
-
-fence_bullpap accepts options on the command line as well as from stdin.  
-fenced sends the options through stdin when it execs the agent.  fence_bullpap
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bull.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the PAP management console.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login with administrative privileges.
-.TP
-\fB-d\fP \fIdomain\fP
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fB-o\fP \fIoption\fP
-Action to perform (on, off, reboot, status).
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet operation.  Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the PAP management console.
-.TP
-\fIlogin= < param >\fR
-Login with administrative privileges.
-.TP
-\fIdomain = < param >\fR
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fIoption = < param >\fR
-Action to perform (on, off, reboot, status).
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
deleted file mode 100644
index 6915f57..0000000
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ /dev/null
@@ -1,366 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-use POSIX;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-$action = "reboot"; # Default fence action
-my $bulldir = "/usr/local/bull/NSMasterHW/bin";
-
-stat($bulldir);
-die "NSMasterHW not installed correctly" if ! -d _;
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage
-{
-	print "Usage:\n";
-	print "\n";
-	print "$pname [options]\n";
-	print "\n";
-	print "Options:\n";
-	print "  -a <ip>          IP address or hostname of PAP console\n";
-	print "  -h               usage\n";
-	print "  -l <name>        Login name\n";
-	print "  -d <domain>      Domain to operate on\n";
-	print "  -o <string>      Action:  on, off, reboot (default) or status\n";
-	print "  -p <string>      Password for login\n";
-	print "  -S <path>        Script to run to retrieve password\n";
-	print "  -q               quiet mode\n";
-	print "  -V               version\n";
-	print "\n";
-	print "When run with no arguments, $pname takes arguments from ";
-	print "standard\ninput, one line per option.  They are as follows:\n";
-	print "\n";
-	print "  ipaddr=<ip>          Same as -a command line option\n";
-	print "  login=<name>         Same as -l command line option\n";
-	print "  domain=<domain>      Same as -d command line option\n";
-	print "  option=<string>      Same as -o command line option\n";
-	print "  passwd=<string>      Same as -p command line option\n";
-	print "  passwd_script=<path> Same as -S command line option\n\n";
-
-	exit 0;
-}
-
-sub fail
-{
-	($msg) = @_;
-	print $msg."\n" unless defined $quiet;
-	exit 1;
-}
-
-sub fail_usage
-{
-	($msg)=@_;
-	print STDERR $msg."\n" if $msg;
-	print STDERR "Please use '-h' for usage.\n";
-	exit 1;
-}
-
-sub version
-{
-	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-	exit 0;
-}
-
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-	
-		# skip comments
-		next if /^#/;
-
-		$line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" )
-		{  
-			print STDERR "parse error: illegal name in option $line\n";
-			exit 2;
-		}
-	
-		# DO NOTHING -- this field is used by fenced
-		elsif ($name eq "agent" ) { } 
-
-		elsif ($name eq "ipaddr" ) 
-		{
-			$host = $val;
-		} 
-		elsif ($name eq "login" ) 
-		{
-			$login = $val;
-		} 
-		elsif ($name eq "option" )
-		{
-			$action = $val;
-		}
-		elsif ($name eq "passwd" ) 
-		{
-			$passwd = $val;
-		} 
-		elsif ($name eq "password" ) 
-		{
-			$passwd = $val;
-		} 
-		elsif ($name eq "passwd_script" ) {
-			$passwd_script = $val;
-		}
-		elsif ($name eq "domain" ) 
-		{
-			$domain = $val;
-		} 
-		elsif ($name eq "debuglog" ) 
-		{
-			$verbose = $val;
-		} 
-	}
-}
-
-sub get_power_state
-{
-	my ($ip,$dom,$user,$pass,$junk) = @_;
-	fail "missing IP address in get_power_state()" unless defined $ip;
-	fail "missing domain to get_power_state()" unless defined $dom;
-	fail "illegal argument to get_power_state()" if defined $junk;
-
-	my $state="";
-	my $cmd = $bulldir . "/pampower.pl";
-	
-	$cmd = $cmd . " -a status";
-	$cmd = $cmd . " -M $ip -D $dom";
-	if (defined $user) {
-		$cmd = $cmd . "	-u $user";
-	}
-	if (defined $pass) {
-		$cmd = $cmd . " -p $pass";
-	}
-
-	$state=system($cmd);
-	WIFEXITED($state) || die "child killed abnormally";
-
-	$state=WEXITSTATUS($state);
-	if ($state == 0) {
-		$state = "ON";
-	} elsif ($state == 1) {
-		$state = "OFF";
-	} else {
-		$state = "$state TRANSITION";
-	}
-
-	$_=$state;
-}
-
-sub set_power_state
-{
-	my ($ip,$dom,$set,$user,$pass,$junk) = @_;
-	fail "missing action to set_power_state()" unless defined $set;
-	fail "missing IP address in set_power_state()" unless defined $ip;
-	fail "missing domain to set_power_state()" unless defined $dom;
-	fail "illegal argument to set_power_state()" if defined $junk;
-
-	my $state="";
-	my $cmd = $bulldir . "/pampower.pl";
-	
-	if ($set =~ /on/) {
-		$cmd = $cmd . " -a on";
-	} else {
-		$cmd = $cmd . " -a off_force";
-	}
-	
-	$cmd = $cmd . " -M $ip -D $dom";
-	if (defined $user) {
-		$cmd = $cmd . "	-u $user";
-	}
-	if (defined $pass) {
-		$cmd = $cmd . " -p $pass";
-	}
-
-	$state=system "$cmd";
-
-	$_=$state;
-}
-
-# MAIN
-
-if (@ARGV > 0) 
-{
-	getopts("a:hl:d:o:p:S:qv:V") || fail_usage ;
-
-	usage if defined $opt_h;
-	version if defined $opt_V;
-
-	$host     = $opt_a if defined $opt_a;
-	$login    = $opt_l if defined $opt_l;
-	$passwd   = $opt_p if defined $opt_p;
-	$action   = $opt_o if defined $opt_o;
-	$domain	  = $opt_d if defined $opt_d;
-	$verbose  = $opt_v if defined $opt_v;
-	$quiet    = $opt_q if defined $opt_q;
-
-	if (defined $opt_S) {
-		$pwd_script_out = `$opt_S`;
-		chomp($pwd_script_out);
-		if ($pwd_script_out) {
-			$passwd = $pwd_script_out;
-		}
-	}
-
-	fail_usage "Unknown parameter." if (@ARGV > 0);
-
-	fail_usage "No '-a' flag specified." unless defined $host;
-	fail_usage "No '-d' flag specified." unless defined $domain;
-	fail_usage "No '-l' flag specified." unless defined $login;
-	fail_usage "No '-p' or '-S' flag specified." unless defined $passwd;
-	fail_usage "Unrecognised action '$action' for '-o' flag"
-		unless $action =~ /^(on|off|reboot|status)$/i;
-} 
-else 
-{
-	get_options_stdin();
-
-	fail "failed: no IP address" unless defined $host;
-	fail "failed: no domain" unless defined $domain;
-	fail "failed: no login name" unless defined $login;
-	fail "failed: unrecognized action: $action"
-		unless $action =~ /^(on|off|reboot|status)$/i;
-
-	if (defined $passwd_script) {
-		$pwd_script_out = `$passwd_script`;
-		chomp($pwd_script_out);
-		if ($pwd_script_out) {
-			$passwd = $pwd_script_out;
-		}
-	}
-	fail "failed: no password" unless defined $passwd;
-}
-
-# convert $action to lower case 
-$_=$action;
-if    (/^on$/i)     { $action = "on"; }
-elsif (/^off$/i)    { $action = "off"; }
-elsif (/^reboot$/i) { $action = "reboot"; }
-elsif (/^status$/i) { $action = "status"; }
-
-#
-# If if pampower / pamreset don't exist, we're done.
-#
-# -M -- the maintenance port on the NovaScale Windows 2000 master server
-# -D -- the Domain to reboot
-# -u -- User name
-# -p -- Password
-#
-#/usr/local/bull/NSMasterHW/bin/pamreset.pl 
-#    -M 192.168.78.169 -D Domaine2-8CPU -u Administrator -p administrator
-#
-#/usr/local/bull/NSMasterHW/bin/pampower.pl -a off_force 
-#    -M 192.168.78.169 -D Domaine2-8CPU -u Administrator -p administrator
-#
-#/usr/local/bull/NSMasterHW/bin/pampower.pl -a on 
-#    -M 192.168.78.169 -D Domaine2-8CPU -u Administrator -p administrator
-#
-# Do the command
-#
-$success=0;
-$_ = $action;
-my $exit_code=0;
-if (/(on|off)/)
-{
-	my $timeout = 120; # 120 = max of (60, 120).  Max timeout for "on"
-			   # on 32-way bull machines
-
-	set_power_state $host,$domain,$action,$login,$passwd;
-	do {
-		sleep 5;
-		$state=get_power_state $host,$domain,$login,$passwd;
-		$timeout -= 5;
-	} while ($timeout > 0 && !($state =~ /^$action$/i));
-
-	$success = 1 if ($state=~/^$action$/i);
-}
-elsif (/reboot/)
-{
-	my $timeout = 60; # 60 seconds for "off" for 32-way bull machines
-
-	set_power_state $host,$domain,"off",$login,$passwd;
-	do {
-		sleep 5;
-		$state=get_power_state $host,$domain,$login,$passwd;
-		$timeout -= 5;
-	} while ($timeout > 0 && $state != 0);
-
-	if ($timeout <= 0) {
-		$success = 0;
-	} else  {
-		$timeout = 120; # 120 seconds for on, for 32-way bull machines
-		set_power_state $host,$domain,"on",$login,$passwd;
-		do {
-			sleep 5;
-			$state=get_power_state $host,$domain,$login,$passwd;
-			$timeout -= 5;
-		} while ($timeout > 0 && $state != 0);
-
-		$success = 1 if ($state == 0);
-	}
-}
-elsif (/status/)
-{
-	get_power_state $host,$domain,$login,$passwd;
-	$state=$_;
-	$success = 1 if defined $state;
-	if ($state eq "OFF") {
-		$exit_code = 2;
-	}
-}
-else
-{
-	fail "fail: illegal action";
-}
-
-if ($success)
-{
-	print "success: domain $domain $action". ((defined $state) ? ": $state":"")
-		."\n" unless defined $quiet;
-	exit $exit_code;
-}
-else
-{
-	fail "fail: domain $domain $action";	
-	exit 1
-}
-
-
diff --git a/fence/agents/cisco_mds/Makefile b/fence/agents/cisco_mds/Makefile
deleted file mode 100644
index 6b2cc85..0000000
--- a/fence/agents/cisco_mds/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_cisco_mds
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/cisco_mds/fence_cisco_mds.py b/fence/agents/cisco_mds/fence_cisco_mds.py
deleted file mode 100644
index d20efe4..0000000
--- a/fence/agents/cisco_mds/fence_cisco_mds.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/python
-
-# The Following agent has been tested on:
-# - Cisco MDS UROS 9134 FC (1 Slot) Chassis ("1/2/4 10 Gbps FC/Supervisor-2") Motorola, e500v2
-#   with BIOS 1.0.16, kickstart 4.1(1c), system 4.1(1c)
-# - Cisco MDS 9124 (1 Slot) Chassis ("1/2/4 Gbps FC/Supervisor-2") Motorola, e500
-#   with BIOS 1.0.16, kickstart 4.1(1c), system 4.1(1c)
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-from fencing_snmp import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="Cisco MDS 9xxx SNMP fence agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-### CONSTANTS ###
-# Cisco admin status
-PORT_ADMIN_STATUS_OID=".1.3.6.1.2.1.75.1.2.2.1.1"
-
-# IF-MIB trees for alias, status and port
-ALIASES_OID=".1.3.6.1.2.1.31.1.1.1.18"
-PORTS_OID=".1.3.6.1.2.1.2.2.1.2"
-
-### GLOBAL VARIABLES ###
-# OID converted from fc port name (fc(x)/(y))
-port_oid=""
-
-### FUNCTIONS ###
-
-# Convert cisco port name (fc(x)/(y)) to OID
-def cisco_port2oid(port):
-	port=port.lower()
-
-	nums=re.match('^fc(\d+)/(\d+)$',port)
-
-	if ((nums) and (len(nums.groups()))==2):
-		return "%s.%d.%d"%(PORT_ADMIN_STATUS_OID,int(nums.group(1))+21,int(nums.group(2))-1)
-	else:
-		fail_usage("Mangled port number: %s"%(port))
-
-def get_power_status(conn,options):
-	global port_oid
-
-	(oid,status)=conn.get(port_oid)
-	return (status=="1" and "on" or "off")
-
-def set_power_status(conn, options):
-	global port_oid
-
-	conn.set(port_oid,(options["-o"]=="on" and 1 or 2))
-
-# Convert array of format [[key1, value1], [key2, value2], ... [keyN, valueN]] to dict, where key is
-# in format a.b.c.d...z and returned dict has key only z
-def array_to_dict(ar):
-	return dict(map(lambda y:[y[0].split('.')[-1],y[1]],ar))
-
-def get_outlets_status(conn, options):
-	result={}
-
-	res_fc=conn.walk(PORTS_OID,30)
-	res_aliases=array_to_dict(conn.walk(ALIASES_OID,30))
-
-	fc_re=re.compile('^"fc\d+/\d+"$')
-
-	for x in res_fc:
-		if fc_re.match(x[1]):
-			port_num=x[0].split('.')[-1]
-
-			port_name=x[1].strip('"')
-			port_alias=(res_aliases.has_key(port_num) and res_aliases[port_num].strip('"') or "")
-			port_status=""
-			result[port_name]=(port_alias,port_status)
-
-	return result
-
-# Main agent method
-def main():
-	global port_oid
-
-	device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
-		       "action", "ipaddr", "login", "passwd", "passwd_script",
-		       "test", "port", "separator", "no_login", "no_password",
-		       "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
-		       "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
-		       "udpport","inet4_only","inet6_only",
-		       "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	snmp_define_defaults ()
-	options=process_input(device_opt)
-
-	# Emulate enable/disable functionality
-	if (options.has_key("-o")):
-		options["-o"]=options["-o"].lower()
-
-		if (options["-o"]=="enable"):
-			options["-o"]="on"
-		if (options["-o"]=="disable"):
-			options["-o"]="off"
-	else:
-		options["-o"]="off"
-
-	options = check_input(device_opt, options)
-
-	docs = { }           
-	docs["shortdesc"] = "Fence agent for Cisco MDS"
-	docs["longdesc"] = "fence_cisco_mds is an I/O Fencing agent \
-which can be used with any Cisco MDS 9000 series with SNMP enabled device."
-	docs["vendorurl"] = "http://www.cisco.com"
-	show_docs(options, docs)
-
-	if (not (options["-o"] in ["list","monitor"])):
-		port_oid=cisco_port2oid(options["-n"])
-
-	# Operate the fencing device
-	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/cisco_ucs/Makefile b/fence/agents/cisco_ucs/Makefile
deleted file mode 100644
index eff9945..0000000
--- a/fence/agents/cisco_ucs/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_cisco_ucs
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py
deleted file mode 100755
index a41349a..0000000
--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/usr/bin/python
-
-import sys, re, pexpect, socket
-import pycurl, StringIO
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New Cisco UCS Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-re_cookie = re.compile("<aaaLogin .* outCookie=\"(.*?)\"", re.IGNORECASE);
-re_status = re.compile("<lsPower .*? state=\"(.*?)\"", re.IGNORECASE);
-re_get_dn = re.compile(" dn=\"(.*?)\"", re.IGNORECASE)
-re_get_desc = re.compile(" descr=\"(.*?)\"", re.IGNORECASE)
-
-def get_power_status(conn, options):
-	try:
-		res = send_command(options, "<configResolveDn cookie=\"" + options["cookie"] + "\" inHierarchical=\"false\" dn=\"org-root" + options["-s"] + "/ls-" + options["-n"] + "/power\"/>")
-	except pycurl.error, e:
-		sys.stderr.write(e[1] + "\n")
-		fail(EC_TIMED_OUT)
-
-	result = re_status.search(res)
-	if (result == None):
-		fail(EC_STATUS)
-	else:
-		status = result.group(1)
-
-	if (status == "up"):
-		return "on"
-	else:
-		return "off"
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "up",
-		'off' : "down"
-	}[options["-o"]]
-	
-	try:
-		res = send_command(options, "<configConfMos cookie=\"" + options["cookie"] + "\" inHierarchical=\"no\"><inConfigs><pair key=\"org-root" + options["-s"] + "/ls-" + options["-n"] + "/power\"><lsPower dn=\"org-root/ls-" + options["-n"] + "/power\" state=\"" + action + "\" status=\"modified\" /></pair></inConfigs></configConfMos>")
-	except pycurl.error, e:
-		sys.stderr.write(e[1] + "\n")
-		fail(EC_TIMED_OUT)
-	
-	return
-
-def get_list(conn, options):
-	outlets = { }
-
-	try:
-		try:
-			res = send_command(options, "<configResolveClass cookie=\"" + options["cookie"] + "\" inHierarchical=\"false\" classId=\"lsServer\"/>")
-		except pycurl.error, e:
-			sys.stderr.write(e[1] + "\n")
-			fail(EC_TIMED_OUT)
-
-		lines = res.split("<lsServer ")
-		for i in range(1, len(lines)):
-			dn = re_get_dn.search(lines[i]).group(1)
-			desc = re_get_desc.search(lines[i]).group(1)
-			outlets[dn] = (desc, None)
-	except AttributeError:
-		return { }
-	except IndexError:
-		return { }
-
-	return outlets
-
-def send_command(opt, command):
-	## setup correct URL
-	if opt.has_key("-z"):
-		url = "https:"
-	else:
-		url = "http:"
-
-	url += "//" + opt["-a"] + ":" + str(opt["-u"]) + "/nuova"
-
-	## send command through pycurl
-	c = pycurl.Curl()
-	b = StringIO.StringIO()
-	c.setopt(pycurl.URL, url)
-	c.setopt(pycurl.HTTPHEADER, [ "Content-type: text/xml" ])
-	c.setopt(pycurl.POSTFIELDS, command)
-	c.setopt(pycurl.WRITEFUNCTION, b.write)
-	c.setopt(pycurl.TIMEOUT, int(opt["-Y"]))
-	c.setopt(pycurl.SSL_VERIFYPEER, 0)
-	c.perform()
-	result = b.getvalue()
-
-	if opt["log"] >= LOG_MODE_VERBOSE:
-		opt["debug_fh"].write(command + "\n")
-		opt["debug_fh"].write(result + "\n")
-
-	return result
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"ssl", "inet4_only", "inet6_only", "ipport", "port", 
-			"web", "separator", "power_wait", "power_timeout",
-			"shell_timeout", "suborg" ]
-
-	atexit.register(atexit_handler)
-	
-	options = check_input(device_opt, process_input(device_opt))
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for Cisco UCS"
-	docs["longdesc"] = "fence_cisco_ucs is an I/O Fencing agent which can be \
-used with Cisco UCS to fence machines."
-	docs["vendorurl"] = "http://www.cisco.com"
-	show_docs(options, docs)
-
-	### Login
-	res = send_command(options, "<aaaLogin inName=\"" + options["-l"] + "\" inPassword=\"" + options["-p"] + "\" />")
-	result = re_cookie.search(res)
-	if (result == None):	
-		## Cookie is absenting in response
-		fail(EC_LOGIN_DENIED)
-
-	options["cookie"] = result.group(1);
-
-	##
-	## Modify suborg to format /suborg
-	if options["-s"] != "":
-		if options["-s"].startswith("/") == False:
-			options["-s"] = "/" + options["-s"]
-		if options["-s"].endswith("/") == True:
-			options["-s"] = options["-s"][0:-1]
-
-	##
-	## Fence operations
-	####
-	result = fence_action(None, options, set_power_status, get_power_status, get_list)
-
-	### Logout; we do not care about result as we will end in any case
-	send_command(options, "<aaaLogout inCookie=\"" + options["cookie"] + "\" />")
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/cpint/Makefile b/fence/agents/cpint/Makefile
deleted file mode 100644
index 637ce23..0000000
--- a/fence/agents/cpint/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_cpint
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/cpint/fence_cpint.8 b/fence/agents/cpint/fence_cpint.8
deleted file mode 100644
index e9f1c5d..0000000
--- a/fence/agents/cpint/fence_cpint.8
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH fence_cpint 8
-
-.SH NAME
-fence_cpint - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_cpint
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a
-s390 or zSeries VM cluster.
-It uses the cpint package to send a CP LOGOFF command to the specified virtual
-machine.
-For fence_cpint to execute correctly, you must have the cpint module installed,
-and hcp in your PATH.
-\fBNOTE:\fP for fence_cpint to send a command to another virtual machine, the
-machine executing it must either be a privilege class C user or it must be
-the secondary user of the virtual machine to be fenced.  This means that unless
-all of you GULM server nodes are privilege class C, fence_cpint can only be
-used with SLM.
-
-fence_cpint accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_cpint can be run by itself with command line options which is useful for
-testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_cpint.
-.TP
-\fIuserid = < parm >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
deleted file mode 100644
index dc17eed..0000000
--- a/fence/agents/cpint/fence_cpint.pl
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-$comm_prog = "hcp";
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage
-{
-    print "Usage:\n";  
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -h               usage\n";
-    print "  -u <string>      userid of the virtual machine to fence\n";
-    print "  -q               quiet mode\n";
-    print "  -V               Version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg)=@_;
-  print "failed: " . $msg . "\n" unless defined $opt_q;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)=@_q;
-  print stderr $msg."\n" if $msg;
-  print stderr "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-        $_ = $in;
-	      chomp;
-
-        # strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-        # skip comments
-        next if /^#/;
-
-	      $line+=1;
-        $opt=$_;
-        next unless $opt;
-
-	      ($name,$val)=split /\s*=\s*/, $opt;
-
-	      if ( $name eq "" )
-        {
-           print stderr "parse error: illegal name in option $line\n";
-           exit 2;
-        }
-
-	      # DO NOTHING -- this field is used by fenced or stomithd
-        elsif ($name eq "agent" ) { }
-
-	      # FIXME -- depricated.  use "userid" and "password" instead.
-        elsif ($name eq "fm" )
-        {
-            (my $dummy,$opt_u,$opt_p) = split /\s+/,$val;
-	          print STDERR "Depricated \"fm\" entry detected.  refer to man page.\n";
-        }
-
-        # FIXME -- depreicated residue of old fencing system
-      	elsif ($name eq "name" ) { }
-
-	      elsif ($name eq "userid" )
-        {
-            $opt_u = $val;
-        }
-
-	else
-        {
-           print stderr "parse error: unknown option \"$opt\"\n";
-           #> exit 2;
-        }
-    }
-}
-
-if (@ARGV > 0){
-    getopts("hqu:V") || fail_usage;
-    usage if defined $opt_h;
-    version if defined $opt_V;
-
-    fail_usage "Unkown parameter." if (@ARGV > 0);
-
-    fail_usage "No '-u' flag specified." unless defined $opt_u;
-} else {
-    get_options_stdin();
-
-    fail "no userid" unless defined $opt_u;
-}
-
-$ret_val = system("$comm_prog send cp $opt_u logoff > /dev/null 2>&1") >> 8;
-fail "$comm_prog failed ($ret_val)" unless ($ret_val == 0 || $ret_val == 45);
-$ret_val = system("$comm_prog send cp $opt_u > /dev/null 2>&1") >> 8;
-fail "$userid isn't logged off. $comm_prog return ($ret_val)" unless ($ret_val == 45);
-
-print "success: booted userid $opt_u\n" unless defined $opt_q;
-exit 0;
diff --git a/fence/agents/drac/Makefile b/fence/agents/drac/Makefile
deleted file mode 100644
index 826744e..0000000
--- a/fence/agents/drac/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_drac
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/drac/fence_drac.8 b/fence/agents/drac/fence_drac.8
deleted file mode 100644
index 3660c5a..0000000
--- a/fence/agents/drac/fence_drac.8
+++ /dev/null
@@ -1,105 +0,0 @@
-.TH fence_drac 8
-
-.SH NAME
-fence_drac - fencing agent for Dell Remote Access Card 
-
-.SH SYNOPSIS
-.B 
-fence_drac
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_drac is an I/O Fencing agent which can be used with the Dell Remote
-Access Card (DRAC).  This card provides remote access to controlling 
-power to a server.  It logs into the DRAC through the telnet interface of
-the card.  By default, the telnet interface is not enabled.  To enable the
-interface, you will need to use the racadm command in the racser-devel rpm 
-available from Dell.  To enable telnet on the DRAC:
-
-[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
-
-[root]# racadm racreset
-
-fence_drac accepts options on the command line as well as from stdin.  
-Fenced sends parameters through stdin when it execs the agent.  fence_drac 
-can be run by itself with command line options.  This is useful for testing 
-and for turning outlets on or off from scripts.
-
-Vendor URL: http://www.dell.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the switch.
-.TP
-\fB-c\fP \fIcmd_prompt\fR
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fB-d\fP \fIdracversion\fR
-Force fence_drac to treat the device as though it was for the specified drac version
-.TP
-\fB-D\fP \fIdumpfile\fR
-Debug file of the telnet interaction
-.TP
-\fB-h\fP 
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-m\fP \fImodulename\fR
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fB-o\fP \fIaction\fR
-The action required.  reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required.  reboot (default), off, on or status.
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcmd_prompt = < param >\fr
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fIdrac_version = < param >\fr 
-Force fence_drac to treat the device as though it was for the specified drac version.
-.TP
-\fIdebug = < dumpfile >\fR
-Debug file of the telnet interaction
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fImodulename = < param >\fr
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-.TP
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
deleted file mode 100644
index e28ed98..0000000
--- a/fence/agents/drac/fence_drac.pl
+++ /dev/null
@@ -1,678 +0,0 @@
-#!/usr/bin/perl
-
-# The following agent has been tested on:
-#
-#  Model 		DRAC Version	Firmware
-#  -------------------	--------------	----------------------
-#  PowerEdge 750	DRAC III/XT	3.20 (Build 10.25)
-#  Dell Remote Access Controller - ERA and DRAC III/XT, v.3.20, A00
-#  
-#  PowerEdge 1855	DRAC/MC		1.1  (Build 03.03)
-#  PowerEdge 1855	DRAC/MC		1.2  (Build 03.03)
-#  PowerEdge 1855	DRAC/MC		1.3  (Build 06.12)
-#  PowerEdge 1850	DRAC 4/I	1.35 (Build 09.27)
-#  PowerEdge 1850	DRAC 4/I	1.40 (Build 08.24)
-#  PowerEdge 1950	DRAC 5		1.0  (Build 06.05.12)
-#
-
-use Getopt::Std;
-use Net::Telnet ();
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-my $telnet_timeout = 10;      # Seconds to wait for matching telent response
-my $power_timeout = 20;      # time to wait in seconds for power state changes
-$action = 'reboot';          # Default fence action.  
-
-my $logged_in = 0;
-my $quiet = 0;
-
-my $t = new Net::Telnet;
-
-my $DRAC_VERSION_UNKNOWN	= '__unknown__';
-my $DRAC_VERSION_III_XT		= 'DRAC III/XT';
-my $DRAC_VERSION_MC			= 'DRAC/MC';
-my $DRAC_VERSION_4I			= 'DRAC 4/I';
-my $DRAC_VERSION_4P			= 'DRAC 4/P';
-my $DRAC_VERSION_5			= 'DRAC 5';
-
-my $PWR_CMD_SUCCESS			= "/^OK/";
-my $PWR_CMD_SUCCESS_DRAC5	= "/^Server power operation successful$/";
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-sub usage 
-{
-	print "Usage:\n";
-	print "\n";
-	print "$pname [options]\n";
-	print "\n";
-	print "Options:\n";
-	print "  -a <ip>          IP address or hostname of DRAC\n";
-	print "  -c <cmd_prompt>  force DRAC command prompt\n";
-	print "  -d <dracversion> force DRAC version to use\n";
-	print "  -D <debugfile>   debugging output file\n";
-	print "  -h               usage\n";
-	print "  -l <name>        Login name\n";
-	print "  -m <modulename>  DRAC/MC module name\n";
-	print "  -o <string>      Action: reboot (default), off or on\n";
-	print "  -p <string>      Login password\n";
-	print "  -S <path>        Script to run to retrieve password\n";
-	print "  -f <seconds>     Wait X seconds before fencing is started\n";
-	print "  -q               quiet mode\n";
-	print "  -V               version\n";
-	print "\n";
-	print "CCS Options:\n";
-	print "  action = \"string\"      Action: reboot (default), off or on\n";
-	print "  debug  = \"debugfile\"   debugging output file\n";
-	print "  ipaddr = \"ip\"          IP address or hostname of DRAC\n";
-	print "  login  = \"name\"        Login name\n";
-	print "  passwd = \"string\"      Login password\n";
-	print "  passwd_script = \"path\" Script to run to retrieve password\n";
-	print "  delay = \"seconds\"      Wait X seconds before fencing is started\n";
-
-	exit 0;
-}
-
-sub msg
-{
-	($msg)=@_;
-	print $msg."\n" unless $quiet;
-}
-
-sub fail
-{
-	($msg)=@_;
-	print $msg."\n" unless $quiet;
-
-	if (defined $t)
-	{
-		# make sure we don't get stuck in a loop due to errors
-		$t->errmode('return');  
-
-		logout() if $logged_in;
-		$t->close 
-	}
-	exit 1;
-}
-
-sub fail_usage
-{
-	($msg)=@_;
-	print STDERR $msg."\n" if $msg;
-	print STDERR "Please use '-h' for usage.\n";
-	exit 1;
-}
-
-sub version
-{
-	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-	exit 0;
-}
-
-
-sub login
-{
-	$t->open($address) or 
-		fail "failed: telnet open failed: ". $t->errmsg."\n";
-  
-	# Expect 'Login: ' 
-	($_) = $t->waitfor(Match => "/[Ll]ogin: /", Timeout=>15) or
-		fail "failed: telnet failed: ". $t->errmsg."\n" ;
-
-	# Determine DRAC version
-  if (/Dell Embedded Remote Access Controller \(ERA(\/O)?\)\nFirmware Version/m)
-  {
-    $drac_version = $DRAC_VERSION_III_XT;
-  } else {
-	if (/.*\((DRAC[^)]*)\)/m)
-	{
-		print "detected drac version '$1'\n" if $verbose;
-		$drac_version = $1 unless defined $drac_version;
-		
-		print "WARNING: detected drac version '$1' but using "
-			. "user defined version '$drac_version'\n"
-			if ($drac_version ne $1);
-	}
-	else
-	{
-		$drac_version = $DRAC_VERSION_UNKNOWN;
-	}
-  }
-
-	# Setup prompt
-	if ($drac_version =~ /$DRAC_VERSION_III_XT/)
-	{
-		$cmd_prompt = "/\\[$login\\]# /" 
-			unless defined $cmd_prompt;
-	}
-	elsif ($drac_version =~ /$DRAC_VERSION_MC/)
-	{
-		$cmd_prompt = "/DRAC\\/MC:/" 
-			unless defined $cmd_prompt;
-	}	
-	elsif ($drac_version =~ /$DRAC_VERSION_4I/)
-	{
-		$cmd_prompt = "/\\[$login\\]# /" 
-			unless defined $cmd_prompt;
-	}
-  elsif ($drac_version =~ /$DRAC_VERSION_4P/)
-  {
-        $cmd_prompt = "/\\[$login\\]# /"
-          unless defined $cmd_prompt;
-  } 
-	else
-	{
-		$drac_version = $DRAC_VERSION_UNKNOWN;
-	}
-
-	# Take a guess as to what the prompt might be if not already defined
-	$cmd_prompt="/(\\[$login\\]# |DRAC\\/MC:|\\\$ )/" unless defined $cmd_prompt;
-	
-
-	# Send login
-	$t->print($login);
-
-	# Expect 'Password: ' 
-	$t->waitfor("/Password: /") or 
-		fail "failed: timeout waiting for password";
-
-	# Send password
-	$t->print($passwd);  
-
-	# DRAC5 prints version controller version info
-	# only after you've logged in.
-	if ($drac_version eq $DRAC_VERSION_UNKNOWN) {
-		if ($t->waitfor(Match => "/.*\($DRAC_VERSION_5\)/m")) {
-			$drac_version = $DRAC_VERSION_5;
-			$cmd_prompt = "/\\\$ /";
-			$PWR_CMD_SUCCESS = $PWR_CMD_SUCCESS_DRAC5;
-		} else {
-			print "WARNING: unable to detect DRAC version '$_'\n";
-		}
-	}
-
-	$t->waitfor($cmd_prompt) or
-		fail "failed: invalid username or password";
-
-	if ($drac_version eq $DRAC_VERSION_UNKNOWN) {
-		print "WARNING: unsupported DRAC version '$drac_version'\n";
-	}
-
-	$logged_in = 1;
-}
-
-#
-# Set the power status of the node 
-#
-sub set_power_status
-{
-	my ($state,$dummy) = @_;
-	my $cmd,$svr_action;
-
-	if   ( $state =~ /^on$/)  { $svr_action = "powerup"   }
-	elsif( $state =~ /^off$/) { $svr_action = "powerdown" }
-
-	if ($drac_version eq $DRAC_VERSION_MC)
-	{
-		$cmd = "serveraction -m $modulename  -d 0 $svr_action";
-	}
-	elsif ($drac_version eq $DRAC_VERSION_5) {
-		$cmd = "racadm serveraction $svr_action";
-	} else
-	{
-		$cmd = "serveraction -d 0 $svr_action";
-	}
-
-	$t->print($cmd);
-
-	# Expect /$cmd_prompt/
-	($_) = $t->waitfor($cmd_prompt) or
-		fail "failed: unexpected serveraction response"; 
-
-	my @cmd_out = split /\n/;
-
-	# discard command sent to DRAC
-	$_ = shift @cmd_out;
-        s/\e\[(([0-9]+;)*[0-9]+)*[ABCDfHJKmsu]//g; #strip ansi chars
-        s/^.*\x0D//;
-
-	fail "failed: unkown dialog exception: '$_'" unless (/^$cmd$/);
-
-	# Additional lines of output probably means an error.  
-	# Aborting to be safe.  Note: additional user debugging will be 
-	# necessary,  run with -D and -v flags
-	my $err;
-	while (@cmd_out)
-	{
-		$_ = shift @cmd_out;
-                #firmware vers 1.2 on DRAC/MC sends ansi chars - evil
-                s/\e\[(([0-9]+;)*[0-9]+)*[ABCDfHJKmsu]//g;
-                s/^.*\x0D//;
-
-		next if (/^\s*$/); # skip empty lines
-		if (defined $err)
-		{
-			$err = $err."\n$_";
-		}
-		else
-		{
-			next if ($PWR_CMD_SUCCESS);
-			$err = $_;
-		}
-	}
-	fail "failed: unexpected response: '$err'" if defined $err;
-}
-
-
-#
-# get the power status of the node and return it in $status and $_
-#
-sub get_power_status
-{
-	my $status; 
-	my $modname = $modulename;
-	my $cmd;
-
-	if ($drac_version eq $DRAC_VERSION_5) {
-		$cmd = "racadm serveraction powerstatus";
-	} else {
-		$cmd = "getmodinfo";
-	}
-
-	$t->print($cmd);
-
-	($_) = $t->waitfor($cmd_prompt);
-
-	my $found_header = 0;
-	my $found_module = 0;
-
-	my @cmd_out = split /\n/;
-
-	# discard command sent to DRAC
-	$_ = shift @cmd_out;
-        #strip ansi control chars
-        s/\e\[(([0-9]+;)*[0-9]+)*[ABCDfHJKmsu]//g;
-        s/^.*\x0D//;
-
-	fail "failed: unkown dialog exception: '$_'" unless (/^$cmd$/);
-
-	if ($drac_version ne $DRAC_VERSION_5) {
-		#Expect:
-		#  #<group>     <module>    <presence>  <pwrState>  <health>  <svcTag>
-		#   1  ---->     chassis    Present         ON      Normal    CQXYV61
-		#
-		#  Note: DRAC/MC has many entries in the table whereas DRAC III has only
-		#  a single table entry.
-
-		while (1)
-		{
-			$_ = shift @cmd_out;
-			if (/^#<group>\s*<module>\s*<presence>\s*<pwrState>\s*<health>\s*<svcTag>/)
-			{
-				$found_header = 1;
-				last;
-			}
-		}
-		fail "failed: invalid 'getmodinfo' header: '$_'" unless $found_header;
-	}
-
-	foreach (@cmd_out)
-	{ 
-		s/^\s+//g; #strip leading space
-		s/\s+$//g; #strip training space
-
-		if ($drac_version eq $DRAC_VERSION_5) {
-			if(m/^Server power status: (\w+)/) {
-				$status = lc($1);
-			}
-		} else {
-			my ($group,$arrow,$module,$presence,$pwrstate,$health,
-				$svctag,$junk) = split /\s+/;
-
-			if ($drac_version eq  $DRAC_VERSION_III_XT || $drac_version eq $DRAC_VERSION_4I || $drac_version eq $DRAC_VERSION_4P)
-			{
-				fail "failed: extraneous output detected from 'getmodinfo'" if $found_module;
-				$found_module = 1;
-				$modname = $module;
-			}
-
-			if ($modname eq $module)
-			{
-				fail "failed: duplicate module names detected" if $status;
-				$found_module = 1;
-
-				fail "failed: module not reported present" unless ($presence =~ /Present/);
-				$status = $pwrstate;
-			}
-
-		}
-	}
-
-	if ($drac_version eq $DRAC_VERSION_MC)
-	{
-		fail "failed: module '$modulename' not detected" unless $found_module;
-	}
-
-	$_=$status;
-	if(/^(on|off)$/i)
-	{
-		# valid power states 
-	}
-	elsif ($status) 
-	{
-		fail "failed: unknown power state '$status'";
-	}
-	else
-	{
-		fail "failed: unable to determine power state";
-	}
-}
-
-
-# Wait upto $power_timeout seconds for node power state to change to 
-# $state before erroring out.
-#
-# return 1 on success
-# return 0 on failure
-#
-sub wait_power_status
-{
-	my ($state,$dummy) = @_;
-	my $status;
-
-	$state = lc $state;
-
-	for (my $i=0; $i<$power_timeout ; $i++)
-	{
-		get_power_status;
-		$status = $_;
-		my $check = lc $status;
-
-		if ($state eq $check ) { return 1 }
-		sleep 1;
-	}
-	$_ = "timed out waiting to power $state";
-	return 0;
-}
-
-#
-# logout of the telnet session
-#
-sub logout 
-{
-	$t->print("");
-	$t->print("exit");
-}
-
-#
-# error routine for Net::Telnet instance
-#
-sub telnet_error
-{
-	fail "failed: telnet returned: ".$t->errmsg."\n";
-}
-
-#
-# execute the action.  Valid actions are 'on' 'off' 'reboot' and 'status'.
-# TODO: add 'configure' that uses racadm rpm to enable telnet on the drac
-#
-sub do_action
-{
-	if (($action =~ /^off$/i) || ($action =~ /^reboot$/i)) {
-		sleep ($delay) if defined($delay);
-	}
-
-	get_power_status;
-	my $status = $_;
-
-	if ($action =~ /^on$/i)
-	{
-		if ($status =~ /^on$/i)
-		{
-			msg "success: already on";
-			return 0;
-		}
-			
-		set_power_status on;
-		fail "failed: $_" unless wait_power_status on;
-
-		msg "success: powered on";
-	}
-	elsif ($action =~ /^off$/i)
-	{
-		if ($status =~ /^off$/i)
-		{
-			msg "success: already off";
-			return 0;
-		}
-
-		set_power_status off;
-		fail "failed: $_" unless wait_power_status off;
-	
-		msg "success: powered off";
-	}
-	elsif ($action =~ /^reboot$/i)
-	{
-		if ( !($status =~ /^off$/i) )
-		{
-			set_power_status off;
-		}
-		fail "failed: $_" unless wait_power_status off;
-
-		set_power_status on;
-		fail "failed: $_" unless wait_power_status on;
-
-		msg "success: rebooted";
-	}
-	elsif ($action =~ /^status$/i)
-	{
-		msg "status: $status";
-		if ($status =~ /on/i)
-		{
-			return 0;
-		} else {
-			return 2;
-		}
-	}
-	else 
-	{
-		fail "failed: unrecognised action: '$action'";
-	}
-
-	return 0;
-}
-
-#
-# Decipher STDIN parameters
-#
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-
-		# skip comments
-		next if /^#/;
-	
-		$line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" )
-		{
-			print STDERR "parse error: illegal name in option $line\n";
-			exit 2;
-		} 
-		# DO NOTHING -- this field is used by fenced 
-		elsif ($name eq "agent" ) 
-		{
-		} 
-		elsif ($name eq "ipaddr" ) 
-		{
-			$address = $val;
-		} 
-		elsif ($name eq "login" ) 
-		{
-			$login = $val;
-		} 
-		elsif ($name eq "action" ) 
-		{
-			$action = $val;
-		} 
-		elsif ($name eq "passwd" ) 
-		{
-			$passwd = $val;
-		}
-		elsif ($name eq "passwd_script" )
-		{
-			$passwd_script = $val;
-		}
-		elsif ($name eq "debug" ) 
-		{
-			$debug = $val;
-		} 
-		elsif ($name eq "modulename" ) 
-		{
-			$modulename = $val;
-		} 
-		elsif ($name eq "drac_version" ) 
-		{
-			$drac_version = $val;
-		} 
-		elsif ($name eq "cmd_prompt" ) 
-		{
-			$cmd_prompt = $val;
-		} 
-		elsif ($name eq "delay")
-		{
-			$delay = $val;
-		}
-	}
-}
-
-
-### MAIN #######################################################
-
-#
-# Check parameters
-#
-if (@ARGV > 0) {
-	getopts("a:c:d:D:hl:m:o:p:S:qVvf:") || fail_usage ;
-	
-	usage if defined $opt_h;
-	version if defined $opt_V;
-	
-	$quiet = 1 if defined $opt_q;
-	$debug = $opt_D; 
-
-	fail_usage "Unknown parameter." if (@ARGV > 0);
-
-	fail_usage "No '-a' flag specified." unless defined $opt_a;
-	$address = $opt_a;
-
-	fail_usage "No '-l' flag specified." unless defined $opt_l;
-	$login = $opt_l;
-
-	$modulename = $opt_m if defined $opt_m;
-	$delay = $opt_f if defined $opt_f;
-
-	if (defined $opt_S) {
-		$pwd_script_out = `$opt_S`;
-		chomp($pwd_script_out);
-		if ($pwd_script_out) {
-			$opt_p = $pwd_script_out;
-		}
-	}
-
-	fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
-	$passwd = $opt_p;
-
-	$verbose = $opt_v if defined $opt_v;
-
-	$cmd_prompt = $opt_c if defined $opt_c;
-	$drac_version = $opt_d if defined $opt_d;
-
-	if ($opt_o)
-	{
-		fail_usage "Unrecognised action '$opt_o' for '-o' flag"
-		unless $opt_o =~ /^(Off|On|Reboot|status)$/i;
-		$action = $opt_o;
-	}
-
-} else {
-	get_options_stdin();
-
-	fail "failed: no IP address" unless defined $address;
-	fail "failed: no login name" unless defined $login;
-
-	if (defined $passwd_script) {
-		$pwd_script_out = `$passwd_script`;
-		chomp($pwd_script_out);
-		if ($pwd_script_out) {
-			$passwd = $pwd_script_out;
-		}
-	}
-
-	fail "failed: no password" unless defined $passwd;
-	fail "failed: unrecognised action: $action"
-		unless $action =~ /^(Off|On|Reboot|status)$/i;
-} 
-
-
-$t->timeout($telnet_timeout);
-$t->input_log($debug) if $debug;
-$t->errmode('return');  
-
-login;
-
-# Abort on failure beyond here
-$t->errmode(\&telnet_error);  
-
-if ($drac_version eq $DRAC_VERSION_III_XT)
-{
-	fail "failed: option 'modulename' not compatilble with DRAC version '$drac_version'" 
-		if defined $modulename;
-}
-elsif ($drac_version eq $DRAC_VERSION_MC)
-{
-	fail "failed: option 'modulename' required for DRAC version '$drac_version'"
-		unless  defined $modulename;
-}
-
-my $res = do_action;
-
-logout;
-
-exit $res;
-
-
diff --git a/fence/agents/drac/test_drac.sh b/fence/agents/drac/test_drac.sh
deleted file mode 100644
index 55ebc4d..0000000
--- a/fence/agents/drac/test_drac.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/bash
-
-verbose="-D /dev/stdout -v "
-passwd="calvin"
-login="root"
-
-drac="drac.localhost.localdomain"
-modulename=" -m Server-1 "
-
-
-fence_drac="./fence_drac.pl"
-i=0
-
-cmd()
-{
-	echo $*
-	out=$(echo $*; $*)
-	out_exit=$?
-
-	echo "$out" > out.log.$i
-	echo "Exit $out_exit" >> out.log.$i
-
-	if [ $out_exit -ne 0 ]
-	then
-		echo "ASSERTION FAILURE: command failed: see out.log.$i" >&2
-		exit 1
-	fi
-
-	: $((i++))
-}
-
-pause()
-{
-	echo "press ENTER to continue"
-	read
-}
-
-assert()
-{
-	get_status
-	if [ "$status" != "$1" ]
-	then
-		echo "ASSERTION FAILURE: power status is '$status' not '$1'" >&2
-		exit 1
-	fi
-}
-
-get_status()
-{
-	cmd $fence_drac -o status -a $drac -l $login -p $passwd $modulename $verbose
-	status=$(echo "$out" | awk '($1 == "status:") { print tolower($2)}')
-	echo "status -> $status"
-}
-
-get_status
-pause
-
-cmd $fence_drac -o off -a $drac -l $login -p $passwd $modulename $verbose 
-assert off
-
-cmd $fence_drac -o on -a $drac -l $login -p $passwd $modulename $verbose 
-assert on
-
-cmd $fence_drac -o off -a $drac -l $login -p $passwd $modulename $verbose 
-assert off
-
-cmd $fence_drac -o reboot -a $drac -l $login -p $passwd $modulename $verbose 
-assert on
-
-cmd $fence_drac -o on -a $drac -l $login -p $passwd $modulename $verbose 
-assert on
-
-cmd $fence_drac -o reboot -a $drac -l $login -p $passwd $modulename $verbose 
-assert on
-
-cmd $fence_drac -o off -a $drac -l $login -p $passwd $modulename $verbose 
-assert off
-
-cmd $fence_drac -o off -a $drac -l $login -p $passwd $modulename $verbose 
-assert off
-
-echo SUCCESS
-exit 0
diff --git a/fence/agents/drac5/Makefile b/fence/agents/drac5/Makefile
deleted file mode 100644
index 4f74c52..0000000
--- a/fence/agents/drac5/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_drac5
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
deleted file mode 100755
index 256158a..0000000
--- a/fence/agents/drac5/fence_drac5.py
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  DRAC Version       Firmware
-## +-----------------+---------------------------+
-##  DRAC 5             1.0  (Build 06.05.12)
-##  DRAC 5             1.21 (Build 07.05.04)
-##
-## @note: drac_version was removed
-#####
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New Drac5 Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	try:
-		if options["model"] == "DRAC CMC":
-			conn.sendline("racadm serveraction powerstatus -m " + options["-m"])
-		elif options["model"] == "DRAC 5":
-			conn.sendline("racadm serveraction powerstatus")
-		
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-				
-	status = re.compile("(^|: )(ON|OFF|Powering ON|Powering OFF)\s*$", re.IGNORECASE | re.MULTILINE).search(conn.before).group(2)
-	if status.lower().strip() in ["on", "powering on", "powering off"]:
-		return "on"
-	else:
-		return "off"
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "powerup",
-		'off': "powerdown"
-	}[options["-o"]]
-
-	try:
-		if options["model"] == "DRAC CMC":
-			conn.sendline("racadm serveraction " + action + " -m " + options["-m"])
-		elif options["model"] == "DRAC 5":
-			conn.sendline("racadm serveraction " + action)
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def get_list_devices(conn, options):
-	outlets = { }
-
-	try:
-		if options["model"] == "DRAC CMC":
-			conn.sendline("getmodinfo")
-
-			list_re = re.compile("^([^\s]*?)\s+Present\s*(ON|OFF)\s*.*$")
-			for line in conn.before.splitlines():
-				if (list_re.search(line)):
-					outlets[list_re.search(line).group(1)] = ("", list_re.search(line).group(2))
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-		elif options["model"] == "DRAC 5":
-			## DRAC 5 can be used only for one computer
-			pass
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	return outlets
-	
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"cmd_prompt", "secure", "identity_file", "drac_version", "module_name",
-			"separator", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = "\$"
-
-	docs = { }           
-	docs["shortdesc"] = "Fence agent for Dell DRAC CMC/5" 
-	docs["longdesc"] = "fence_drac5 is an I/O Fencing agent \
-which can be used with the Dell Remote Access Card v5 or CMC (DRAC). \
-This device provides remote access to controlling  power to a server. \
-It logs into the DRAC through the telnet/ssh interface of the card. \
-By default, the telnet interface is not  enabled."
-	docs["vendorurl"] = "http://www.dell.com"
-	show_docs(options, docs)
-
-	##
-	## Operate the fencing device
-	######
-	conn = fence_login(options)
-
-	if conn.before.find("CMC") >= 0:
-		if 0 == options.has_key("-m") and 0 == ["monitor", "list"].count(option["-o"].lower()):
-			fail_usage("Failed: You have to enter module name (-m)")
-			
-		options["model"]="DRAC CMC"		
-	elif conn.before.find("DRAC 5") >= 0:
-		options["model"]="DRAC 5"
-	else:
-		## Assume this is DRAC 5 by default as we don't want to break anything
-		options["model"]="DRAC 5"
-
-	result = fence_action(conn, options, set_power_status, get_power_status, get_list_devices)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.sendline("exit")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/egenera/Makefile b/fence/agents/egenera/Makefile
deleted file mode 100644
index 3949482..0000000
--- a/fence/agents/egenera/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_egenera
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/egenera/fence_egenera.8 b/fence/agents/egenera/fence_egenera.8
deleted file mode 100644
index 3823d7c..0000000
--- a/fence/agents/egenera/fence_egenera.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_egenera 8
-
-.SH NAME
-fence_egenera - I/O Fencing agent for the Egenera BladeFrame
-
-.SH SYNOPSIS
-.B
-fence_egenera
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_egenera is an I/O Fencing agent which can be used with the Egenera
-BladeFrame.  It logs into a control blade (cserver) via ssh and operates
-on a processing blade (pserver) identified by the pserver name and the 
-logical process area network (LPAN) that it is in.  fence_egenera requires
-that ssh keys have been setup so that the fence_egenera does not require
-a password to authenticate.  Refer to ssh(8) for more information on setting
-up ssh keys.
-
-fence_egenera accepts options on the command line as well as from stdin.  
-Fenced sends parameters through stdin when it execs the agent.  fence_egenera 
-can also be run by itself with command line options.  
-
-Vendor URL: http://www.egenera.com
-
-.SH OPTIONS
-.TP
-\fB-c\fP \fIcserver\fR
-The cserver to ssh to.  cserver can be in the form user at hostname to
-specify a different user to login as.
-.TP
-\fB-u\fP \fIuser\fR
-Login name. Default login name is 'root'
-.TP
-\fB-h\fP 
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlpan\fR
-the lpan to operate on
-.TP
-\fB-o\fP \fIaction\fR
-The action required.  reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpserver\fR
-the pserver to operate on
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-q\fP
-quite mode.  suppress output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required.  reboot (default), off, on or status.
-.TP
-\fIuser = < param >\fR
-Login name. Default login name is 'root'
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcserver = < param >\fR
-The cserver to ssh to.  cserver can be in the form user at hostname to
-specify a different user to login as.
-.TP
-\fIlpan = < param >\fR
-The lpan to operate on
-.TP
-\fIpserver = < param >\fR
-The pserver to operate on
-.TP
-\fIesh = < param >\fR
-The path to the esh command on the cserver (default is /opt/panmgr/bin/esh)
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-
-.SH SEE ALSO
-fence(8), fence_node(8), ssh(8)
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
deleted file mode 100644
index f09ff32..0000000
--- a/fence/agents/egenera/fence_egenera.pl
+++ /dev/null
@@ -1,439 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-use IPC::Open3;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-$|=1;
-s/.*\///;
-my $pname = $_;
-
-$esh="/opt/panmgr/bin/esh";
-
-sub usage 
-{
-	print "Usage:\n";
-	print "\n";
-	print "$pname [options]\n";
-	print "\n";
-	print "Options:\n";
-	print "  -c <string>      cserver\n";
-	print "  -h               help\n";
-	print "  -l <string>      lpan\n";
-	print "  -o <string>      Action: reboot (default), off, on or status\n";
-	print "  -p <string>      pserver\n";
-	print "  -u <string>      username (default=root)\n";
-	print "  -f <seconds>     Wait X seconds before fencing is started\n";
-	print "  -q               quiet mode\n";
-	print "  -V               version\n";
-	
-	exit 0;
-}
-
-sub fail
-{
-	($msg)=@_;
-	print $msg."\n" unless defined $opt_q;
-	$t->close if defined $t;
-	exit 1;
-}
-
-sub fail_usage
-{
-	($msg)=@_;
-	print STDERR $msg."\n" if $msg;
-	print STDERR "Please use '-h' for usage.\n";
-	exit 1;
-}
-
-
-sub version
-{
-	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-	exit 0;
-}
-
-if (@ARGV > 0) 
-{
-	getopts("c:hl:o:p:u:qVf:") || fail_usage ;
-
-	usage if defined $opt_h;
-	version if defined $opt_V;
-
-	fail_usage "Unkown parameter." if (@ARGV > 0);
-
-	$cserv  = $opt_c if defined $opt_c;
-	$lpan   = $opt_l if defined $opt_l;
-	$pserv  = $opt_p if defined $opt_p;
-	$action = $opt_o if defined $opt_o;
-	$user   = $opt_u if defined $opt_u;
-	$delay  = $opt_f if defined $opt_f;
-} 
-else 
-{
-	get_options_stdin();
-} 
-
-$action = "reboot" unless defined $action;
-$user = "root" unless defined $user;
-
-fail "failed: no cserver defined" unless defined $cserv;
-fail "failed: no lpan defined" unless defined $lpan;
-fail "failed: no pserver defined" unless defined $pserv;
-
-fail "failed: unrecognised action: $action"
-	unless $action =~ /^(off|on|reboot|status|pblade)$/i;
-
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-
-		# skip comments
-		next if /^#/;
-
-	        $line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" )
-		{
-			print STDERR "parse error: illegal name in option $line\n";
-			exit 2;
-		} 
-
-		elsif ($name eq "agent" )
-		{
-			# DO NOTHING -- this field is used by fenced 
-		}
-
-		elsif ($name eq "cserver" ) 
-		{
-			$cserv = $val;
-		} 
-
-		elsif ($name eq "lpan" ) 
-		{
-			$lpan = $val;
-		} 
-
-		elsif ($name eq "pserver" ) 
-		{
-			$pserv = $val;
-		} 
-
-		elsif ($name eq "action" ) 
-		{
-			$action = $val;
-		} 
-
-		elsif ($name eq "esh" ) 
-		{
-			$esh = $val;
-		} 
-		elsif ($name eq "user" )
-		{
-			$user = $val;
-		}
-		elsif ($name eq "delay" )
-		{
-			$delay = $val;
-		}
-	}
-}
-
-# _pserver_query_field -- query the state of the pBlade or Status field
-# and return it's value in $_.  
-# Return 0 on success, or non-zero on error
-sub _pserver_query_field
-{
-	my ($field,$junk) = @_;
-
-	if ($field ne "pBlade" && $field ne "Status")
-	{
-		$_="Error _pserver_query_field: unknown field of type '$field'";
-		return 1;
-	}
-
-	my $val;
-
-	my $cmd = "ssh -l $user $cserv $esh pserver $lpan/$pserv";
-	my $pid = open3 (\*WTR, \*RDR,\*RDR, $cmd)
-		or die "error open3(): $!";
-
-	while(<RDR>)
-	{
-		chomp;
-		my $line = $_;
-		my @fields = split /\s+/,$line;
-
-		if ($fields[0] eq "Error:")
-		{
-			$val=$line;
-			print "Debug ERROR: $val\n";
-			last;
-		}
-		elsif ($fields[0] eq $pserv)
-		{
-			if ( $field eq "Status" ) 
-			{
-				$val=$fields[1];
-			}
-			elsif ($field eq "pBlade" )
-			{
-				# grrr... Status can be "Shutting down"
-				if ($fields[1] ne "Shutting")
-				{
-					$val=$fields[3];
-				}
-				else
-				{
-					$val=$fields[4];
-				}
-			}
-		}
-	}
-
-	close WTR;
-	close RDR;
-	
-	waitpid $pid,0;
-	my $rtrn = $?>>8;
-	$_=$val if defined $val;
-	return $rtrn;
-}
-
-# return the pBlade of an lpan/pserver in $_.  
-# Return 0 on success or non=zero on error
-sub pserver_pblade
-{
-	_pserver_query_field "pBlade";
-}
-
-# return the Status of an lpan/pserver in $_.  
-# Return 0 on success or non=zero on error
-sub pserver_status
-{
-	_pserver_query_field "Status";
-}
-
-# boot an lpan/pserver.  
-# Return 0  if the status is "Booted" or "Booting" or non-zero on failure.
-# Continue checking the value until the status is "Boot" or "Booting" or
-# until a timeout of 120 seconds has been reached.
-sub pserver_boot
-{
-	my $rtrn=1;
-
-	# It seems it can take a while for a pBlade to 
-	# boot sometimes.  We shall wait for 120 seconds
-	# before giving up on a node returning failure
-	for (my $trys=0; $trys<120; $trys++)
-	{
-		last if (pserver_status != 0);
-
-		my $status = $_;
-		if ( $status eq "Booted"  || $status eq "Booting")
-		{
-			$rtrn=0;
-			last;
-		}
-
-		if(pserver_pblade)
-		{
-			die "error getting pBlade info";
-		}
-
-		# Is there any harm in sending this command multiple times?
-		my $cmd = "ssh -l $user $cserv $esh pserver -b $lpan/$pserv";
-		my $pid = open3 (\*WTR, \*RDR,\*RDR, $cmd)
-			or die "error open3(): $!";
-
-		close WTR;
-		close RDR;
-
-		waitpid $pid,0;
-		$rtrn = $?>>8;
-
-		sleep 1;
-	}
-	return $rtrn;
-}
-
-# boot an lpan/pserver.  
-# Return 0  if the status is "Shutdown" or non-zero on failure.
-# Continue checking the value until the status is "Shutdown" or
-# until a timeout of 20 seconds has been reached.
-sub pserver_shutdown
-{
-	my $rtrn=1;
-	local *egen_log;
-	open(egen_log,">>/@LOGDIR@/fence_egenera.log");
-	print egen_log "Attempting shutdown at ".`date`."\n";
-	for (my $trys=0; $trys<20; $trys++)
-	{
-		last if (pserver_status != 0);
-
-
-		my $status = $_;
-                print egen_log "shutdown: $trys    $status\n";
-		if (/^Shutdown/)
-		{
-			$rtrn=0;
-			last;
-		}
-		elsif (/^Shutting/)
-		{
-			# We are already in the process of shutting down.
-			# do I need to do anything here?  
-			# We'll just wait for now
-		}
-    elsif (/^Booting/)
-    {
-       # Server is already on the way back up. Do nothing
-       $rtrn=0;
-       last;
-    }
-		elsif (/^Booted\(KDB\)/ || /^Debugging/ )
-		{
-			print egen_log "shutdown: crash dump being performed. Waiting\n";
-			$rtrn=0;
-			last;
-		}
-		else
-		{
-			if (pserver_pblade)
-			{
-				die "error getting pBlade info: $_";
-			}
-
-			# is there any harm in sending this command multiple 
-			# times?
-			my $cmd = "ssh -l $user $cserv $esh blade -s $_";
-                        print egen_log "shutdown: $cmd  being called, before open3\n";
-			my $pid = open3 (\*WTR, \*RDR,\*RDR, $cmd)
-				or die "error open3(): $!";
-                        print egen_log "shutdown: after calling open3\n";
-                        @outlines = <RDR>;
-                        print egen_log "shutdown: Open3 result: ", @outlines, "\n";
-
-			close WTR;
-			close RDR;
-
-			waitpid $pid,0;
-			$rtrn = $?>>8;
-		}
-
-		sleep 1;
-	}
-        print egen_log "shutdown: Returning from pserver_shutdown with return code $rtrn\n";
-	return $rtrn;
-}
-
-
-$_=$action;
-if (/^status$/i)
-{
-	if (pserver_status==0)
-	{
-		print "$lpan/$pserv is $_\n" unless defined $opt_q;
-		exit 0;
-	}
-	else
-	{
-		fail "failed to get status of $lpan/$pserv: $_";
-	}
-}
-elsif (/^pblade$/i)
-{
-	if (pserver_pblade==0)
-	{
-		print "$lpan/$pserv is $_\n" unless defined $opt_q;
-		exit 0;
-	}
-	else
-	{
-		fail "failed to get pblade of $lpan/$pserv: $_";
-	}
-}
-elsif (/^off$/i)
-{
-	sleep ($delay) if defined($delay);
-	if (pserver_shutdown==0)
-	{
-		print "success: $lpan/$pserv has been shutdown\n" 
-			unless defined $opt_q;
-		exit 0;
-	}
-	else
-	{
-		fail "failed to shutdown $lpan/$pserv";
-	}
-}
-elsif (/^on$/i)
-{
-	if (pserver_boot==0)
-	{
-		print "success: $lpan/$pserv has been turned on\n" 
-			unless defined $opt_q;
-		exit 0;
-	}
-	else
-	{
-		fail "failed to turn on $lpan/$pserv";
-	}
-}
-elsif (/^reboot$/i)
-{
-	sleep ($delay) if defined($delay);
-	if (pserver_shutdown!=0)
-	{
-		fail "failed to shutdown $lpan/$pserv";
-	}
-
-	if (pserver_boot==0)
-	{
-		print "success: $lpan/$pserv has been rebooted\n" 
-			unless defined $opt_q;
-		exit 0;
-	}
-	else
-	{
-		fail "failed to turn on $lpan/$pserv";
-	}
-}
-else
-{
-	die "unknown action: $action";
-}
diff --git a/fence/agents/eps/Makefile b/fence/agents/eps/Makefile
deleted file mode 100644
index 3d591da..0000000
--- a/fence/agents/eps/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_eps
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/eps/fence_eps.py b/fence/agents/eps/fence_eps.py
deleted file mode 100644
index 21530e6..0000000
--- a/fence/agents/eps/fence_eps.py
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/python
-
-# The Following Agent Has Been Tested On:
-# ePowerSwitch 8M+ version 1.0.0.4
-
-import sys, re, time
-import httplib, base64, string,socket
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="ePowerSwitch 8M+ (eps)"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-# Log actions and results from EPS device
-def eps_log(options,str):
-	if options["log"]>=LOG_MODE_VERBOSE:
-		options["debug_fh"].write(str)
-
-# Run command on EPS device.
-# @param options Device options
-# @param params HTTP GET parameters (without ?)
-def eps_run_command(options, params):
-	try:
-		# New http connection
-		conn = httplib.HTTPConnection(options["-a"])
-
-		request_str="/"+options["-c"]
-
-		if (params!=""):
-			request_str+="?"+params
-
-		eps_log(options,"GET "+request_str+"\n")
-		conn.putrequest('GET', request_str)
-
-		if (options.has_key("-l")):
-			if (not options.has_key("-p")):
-				options["-p"]="" # Default is empty password
-				
-			# String for Authorization header
-			auth_str = 'Basic ' + string.strip(base64.encodestring(options["-l"]+':'+options["-p"]))
-			eps_log(options,"Authorization:"+auth_str+"\n")
-			conn.putheader('Authorization',auth_str)
-
-		conn.endheaders()
-
-		response = conn.getresponse()
-
-		eps_log(options,"%d %s\n"%(response.status,response.reason))
-
-		#Response != OK -> couldn't login
-		if (response.status!=200):
-			fail(EC_LOGIN_DENIED)
-
-		result=response.read()
-		eps_log(options,result+"\n")
-		conn.close()
-
-	except socket.timeout:
-		fail(EC_TIMED_OUT)
-	except socket.error:
-		fail(EC_LOGIN_DENIED)
-
-	return result
-
-def get_power_status(conn, options):
-	ret_val=eps_run_command(options,"")
-
-	result={}
-	status=re.findall("p(\d{2})=(0|1)\s*\<br\>",ret_val.lower())
-	for out_num,out_stat in status:
-		result[out_num]=("",(out_stat=="1" and "on" or "off"))
-
-	if (not (options["-o"] in ['monitor','list'])):
-		if (not (options["-n"] in result)):
-			fail_usage("Failed: You have to enter existing physical plug!")
-		else:
-			return result[options["-n"]][1]
-	else:
-		return result
-
-def set_power_status(conn, options):
-	ret_val=eps_run_command(options,"P%s=%s"%(options["-n"],(options["-o"]=="on" and "1" or "0")))
-
-# Define new option
-def eps_define_new_opts():
-	all_opt["hidden_page"]={
-		"getopt" : "c:",
-		"longopt" : "page",
-		"help":"-c, --page=<page>              Name of hidden page (default hidden.htm)",
-		"required" : "0",
-		"shortdesc" : "Name of hidden page",
-		"default" : "hidden.htm",
-		"order": 1
-		}
-
-# Starting point of fence agent
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"test", "port", "hidden_page", "no_login", "no_password",
-			"separator" ]
-
-	atexit.register(atexit_handler)
-
-	eps_define_new_opts()
-
-	options = check_input(device_opt,process_input(device_opt))
-
-	docs = { }           
-	docs["shortdesc"] = "Fence agent for ePowerSwitch" 
-	docs["longdesc"] = "fence_eps  is an I/O Fencing agent \
-which can be used with the ePowerSwitch 8M+ power switch to fence \
-connected machines. Fence agent works ONLY on 8M+ device, because \
-this is only one, which has support for hidden page feature. \
-\n.TP\n\
-Agent basically works by connecting to hidden page and pass \
-appropriate arguments to GET request. This means, that hidden \
-page feature must be enabled and properly configured."
-	docs["vendorurl"] = "http://www.epowerswitch.com"
-	show_docs(options, docs)
-
-	#Run fence action. Conn is None, beacause we always need open new http connection
-	result = fence_action(None, options, set_power_status, get_power_status,get_power_status)
-
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/ibmblade/Makefile b/fence/agents/ibmblade/Makefile
deleted file mode 100644
index 208ee4b..0000000
--- a/fence/agents/ibmblade/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET = fence_ibmblade
-MANTARGET = $(TARGET).8
-SBINSYMT = $(TARGET)
-
-all: $(TARGET)
-
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-include $(OBJDIR)/make/clean.mk
-
-$(TARGET):
-	ln -sf fence_bladecenter_snmp $@
-
-clean: generalclean
diff --git a/fence/agents/ibmblade/fence_ibmblade.8 b/fence/agents/ibmblade/fence_ibmblade.8
deleted file mode 100644
index f6f7888..0000000
--- a/fence/agents/ibmblade/fence_ibmblade.8
+++ /dev/null
@@ -1 +0,0 @@
-.so man8/fence_bladecenter_snmp.8
diff --git a/fence/agents/ifmib/Makefile b/fence/agents/ifmib/Makefile
deleted file mode 100644
index 64f4448..0000000
--- a/fence/agents/ifmib/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ifmib
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ifmib/README b/fence/agents/ifmib/README
deleted file mode 100644
index cd2a3c1..0000000
--- a/fence/agents/ifmib/README
+++ /dev/null
@@ -1,45 +0,0 @@
-Intro:
-------
-This is an SNMP-based fencing agent for RHCS.  It was designed with the use-case
-of disabling ethernet ports on an iSCSI SAN, but could be used to disable any
-port on any SNMP v1/2c/3 device that implementes the IF-MIB.
-
-The script requires NetSNMP to be installed and working on all nodes
-in the cluster.  There are no requirements for any MIBs to be setup --- all of
-the required OIDs are hard-coded into the script.  Since the IF-MIB is an IETF
-standard, these identifiers are very widely supported and will not change.
-
-
-Typical usage:
---------------
-To use this agen with the switch used on the iSCSI network, you'll require:
-   1) A managed switch running SNMP.
-   2) An SNMP community with write privileges.
-   3) Permission to send SNMP through any ACLs or firewalls from the nodes.
-   4) The ifIndex or ifPort associated with the ports being used by the cluster nodes.
-
-Consider a three-node cluster composed of A, B, and C.  Each node has two
-network interfaces - one used for network and cluster communication, the second
-used for iSCSI traffic.  If A needs to be fenced, B and C will run this script
-to administratively disable the switchport for A's connection to the iSCSI
-storage.
-
-If you are using a single interface for cluster and iSCSI traffic, this will
-still work, but you will lose network connectivity to the fenced host.
-
-
-cluster.conf:
--------------
-There is no GUI support for this fence agent at this time.  To use it, you will
-need something like this cluster.conf
-
-<fencedevice agent="fence_ifmib" name="myswitch" comm="fencing" ipaddr="sw1"/>
-
-In a node's fencing methods, you'll include a line like this:
-
-<device name="myswitch" port="43" option="off"/>
-
-This node will be fenced by disabling the port with ifIndex 43 on the host sw1.
-In SNMP speak, we set IF-MIB::ifAdminStatus.43 = down(2).
-
-If you will use port name (like fc1/1), script will try to find ifIndex.
diff --git a/fence/agents/ifmib/fence_ifmib.py b/fence/agents/ifmib/fence_ifmib.py
deleted file mode 100644
index 2914301..0000000
--- a/fence/agents/ifmib/fence_ifmib.py
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/python
-
-# The Following agent has been tested on:
-# - Cisco MDS UROS 9134 FC (1 Slot) Chassis ("1/2/4 10 Gbps FC/Supervisor-2") Motorola, e500v2
-#   with BIOS 1.0.16, kickstart 4.1(1c), system 4.1(1c)
-# - Cisco MDS 9124 (1 Slot) Chassis ("1/2/4 Gbps FC/Supervisor-2") Motorola, e500
-#   with BIOS 1.0.16, kickstart 4.1(1c), system 4.1(1c)
-# - Partially with APC PDU (Network Management Card AOS v2.7.0, Rack PDU APP v2.7.3)
-#   Only lance if is visible
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-from fencing_snmp import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="IF:MIB SNMP fence agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-### CONSTANTS ###
-# IF-MIB trees for alias, status and port
-ALIASES_OID=".1.3.6.1.2.1.31.1.1.1.18"
-PORTS_OID=".1.3.6.1.2.1.2.2.1.2"
-STATUSES_OID=".1.3.6.1.2.1.2.2.1.7"
-
-# Status constants returned as value from SNMP
-STATUS_UP=1
-STATUS_DOWN=2
-STATUS_TESTING=3
-
-### GLOBAL VARIABLES ###
-# Port number converted from port name or index
-port_num=None
-
-### FUNCTIONS ###
-
-# Convert port index or name to port index
-def port2index(conn,port):
-	res=None
-
-	if (port.isdigit()):
-		res=int(port)
-	else:
-		ports=conn.walk(PORTS_OID,30)
-
-		for x in ports:
-			if (x[1].strip('"')==port):
-				res=int(x[0].split('.')[-1])
-				break
-
-	if (res==None):
-		fail_usage("Can't find port with name %s!"%(port))
-
-	return res
-
-def get_power_status(conn,options):
-	global port_num
-
-	if (port_num==None):
-		port_num=port2index(conn,options["-n"])
-
-	(oid,status)=conn.get("%s.%d"%(STATUSES_OID,port_num))
-	return (status==str(STATUS_UP) and "on" or "off")
-
-def set_power_status(conn, options):
-	global port_num
-
-	if (port_num==None):
-		port_num=port2index(conn,options["-n"])
-
-	conn.set("%s.%d"%(STATUSES_OID,port_num),(options["-o"]=="on" and STATUS_UP or STATUS_DOWN))
-
-# Convert array of format [[key1, value1], [key2, value2], ... [keyN, valueN]] to dict, where key is
-# in format a.b.c.d...z and returned dict has key only z
-def array_to_dict(ar):
-	return dict(map(lambda y:[y[0].split('.')[-1],y[1]],ar))
-
-def get_outlets_status(conn, options):
-	result={}
-
-	res_fc=conn.walk(PORTS_OID,30)
-	res_aliases=array_to_dict(conn.walk(ALIASES_OID,30))
-
-	for x in res_fc:
-		port_num=x[0].split('.')[-1]
-
-		port_name=x[1].strip('"')
-		port_alias=(res_aliases.has_key(port_num) and res_aliases[port_num].strip('"') or "")
-		port_status=""
-		result[port_name]=(port_alias,port_status)
-
-	return result
-
-# Define new options
-def ifmib_define_defaults():
-	all_opt["snmp_version"]["default"]="2c"
-
-# Main agent method
-def main():
-	global port_oid
-
-	device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
-		       "action", "ipaddr", "login", "passwd", "passwd_script",
-		       "test", "port", "separator", "no_login", "no_password",
-		       "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
-		       "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
-		       "udpport","inet4_only","inet6_only",
-		       "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	snmp_define_defaults ()
-
-	options=process_input(device_opt)
-
-	# Emulate enable/disable functionality
-	if (options.has_key("-o")):
-		options["-o"]=options["-o"].lower()
-
-		if (options["-o"]=="enable"):
-			options["-o"]="on"
-		if (options["-o"]=="disable"):
-			options["-o"]="off"
-	else:
-		options["-o"]="off"
-
-	options = check_input(device_opt, options)
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for IF MIB"
-	docs["longdesc"] = "fence_ifmib is an I/O Fencing agent \
-which can be used with any SNMP IF-MIB capable device. \
-\n.P\n\
-It was written with managed ethernet switches in mind, in order to \
-fence iSCSI SAN connections. However, there are many devices that \
-support the IF-MIB interface. The agent uses IF-MIB::ifAdminStatus \
-to control the state of an interface."
-	docs["vendorurl"] = "http://www.ietf.org/wg/concluded/ifmib.html"
-	show_docs(options, docs)
-
-	# Operate the fencing device
-	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/ilo/Makefile b/fence/agents/ilo/Makefile
deleted file mode 100644
index aafe6e4..0000000
--- a/fence/agents/ilo/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ilo
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
deleted file mode 100755
index f70dc9c..0000000
--- a/fence/agents/ilo/fence_ilo.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  iLO Version
-## +---------------------------------------------+
-##  iLO  / firmware 1.91 / RIBCL 2.22
-##  iLO2 / firmware 1.22 / RIBCL 2.22 
-##  iLO2 / firmware 1.50 / RIBCL 2.22
-#####
-
-import sys, re, pexpect, socket
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New ILO Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	conn.send("<LOGIN USER_LOGIN = \"" + options["-l"] + "\"" + \
-		" PASSWORD = \"" + options["-p"] + "\">\r\n")
-	conn.send("<SERVER_INFO MODE = \"read\"><GET_HOST_POWER_STATUS/>\r\n")
-	conn.send("</SERVER_INFO></LOGIN>\r\n")
-	try:
-		conn.log_expect(options, "HOST_POWER=\"(.*?)\"", int(options["-g"]))
-	except pexpect.EOF, e:
-		fail(EC_STATUS)
-	except pexpect.TIMEOUT, e:
-		fail(EC_TIMED_OUT)
-
-	status = conn.match.group(1)
-	return status.lower().strip()
-
-def set_power_status(conn, options):
-	conn.send("<LOGIN USER_LOGIN = \"" + options["-l"] + "\"" + \
-		" PASSWORD = \"" + options["-p"] + "\">\r\n")
-	conn.send("<SERVER_INFO MODE = \"write\">")
-
-	if options.has_key("fw_processor") and options["fw_processor"] == "iLO2":
-		if options["fw_version"] > 1.29:
-			conn.send("<HOLD_PWR_BTN TOGGLE=\"yes\" />\r\n")
-		else:
-			conn.send("<HOLD_PWR_BTN />\r\n")
-	elif options["-r"] < 2.21:
-		conn.send("<SET_HOST_POWER HOST_POWER = \"" + options["-o"] + "\" />\r\n")
-	else:
-		if options["-o"] == "off":
-			conn.send("<HOLD_PWR_BTN/>\r\n")
-		else:
-			conn.send("<PRESS_PWR_BTN/>\r\n")
-	conn.send("</SERVER_INFO></LOGIN>\r\n")
-
-	return
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"ssl", "ribcl", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	all_opt["login_timeout"]["default"] = "10"
-	all_opt["retry_on"]["default"] = "3"
-
-	pinput = process_input(device_opt)
-	pinput["-z"] = 1
-	options = check_input(device_opt, pinput)
-	
-	LOGIN_TIMEOUT = 10
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for HP iLO"
-	docs["longdesc"] = "fence_ilo is an I/O Fencing agent \
-used for HP servers with the Integrated Light Out (iLO) PCI card.\
-The agent opens an SSL connection to the iLO card. Once the SSL \
-connection is established, the agent is able to communicate with \
-the iLO card through an XML stream."
-	docs["vendorurl"] = "http://www.hp.com"
-	show_docs(options, docs)
-
-	##
-	## Login and get version number
-	####
-	conn = fence_login(options)
-	try:
-		conn.send("<?xml version=\"1.0\"?>\r\n")
-		conn.log_expect(options, [ "</RIBCL>", "<END_RIBCL/>" ], int(options["-y"]))
-		version = re.compile("<RIBCL VERSION=\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1)
-		if options.has_key("-r") == 0:
-			options["-r"] = float(version)
-
-		if options["-r"] >= 2:
-			conn.send("<RIBCL VERSION=\"2.0\">\r\n")
-		else:
-			conn.send("<RIBCL VERSION=\"1.2\">\r\n")
-
-		conn.send("<LOGIN USER_LOGIN = \"" + options["-l"] + "\"" + \
-			" PASSWORD = \"" + options["-p"] + "\">\r\n")
-		if options["-r"] >= 2:
-			conn.send("<RIB_INFO MODE=\"read\"><GET_FW_VERSION />\r\n")
-			conn.send("</RIB_INFO>\r\n")
-			conn.log_expect(options, "<GET_FW_VERSION\s*\n", int(options["-Y"]))
-			conn.log_expect(options, "/>", int(options["-Y"]))
-			options["fw_version"] = float(re.compile("FIRMWARE_VERSION\s*=\s*\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1))
-			options["fw_processor"] = re.compile("MANAGEMENT_PROCESSOR\s*=\s*\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1)
-		conn.send("</LOGIN>\r\n")
-	except pexpect.TIMEOUT:
-		fail(EC_LOGIN_DENIED)
-	except pexpect.EOF:
-		fail(EC_LOGIN_DENIED)
-
-	##
-	## Fence operations
-	####
-	result = fence_action(conn, options, set_power_status, get_power_status, None)
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/ilo_mp/Makefile b/fence/agents/ilo_mp/Makefile
deleted file mode 100644
index 42ffb03..0000000
--- a/fence/agents/ilo_mp/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ilo_mp
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py
deleted file mode 100644
index 1618216..0000000
--- a/fence/agents/ilo_mp/fence_ilo_mp.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/python
-
-import sys, re, pexpect, socket
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION=""
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	try:
-		conn.send("show /system1\r\n")
-		
-		re_state = re.compile('EnabledState=(.*)', re.IGNORECASE)
-		conn.log_expect(options, re_state, int(options["-Y"]))
-
-		status = conn.match.group(1).lower()
-
-		if status.startswith("enabled"):
-			return "on"
-		else:
-			return "off"
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def set_power_status(conn, options):
-	try:
-		if options["-o"] == "on":
-			conn.send("start /system1\r\n")
-		else:
-			conn.send("stop -f /system1\r\n")
-
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-
-		return
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure", "identity_file", "cmd_prompt", "ipport", "login_eol_lf",
-			"separator", "inet4_only", "inet6_only",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-	
-	all_opt["cmd_prompt"]["default"] = [ "MP>", "hpiLO->" ]
-	all_opt["power_wait"]["default"] = 5
-	
-	options = check_input(device_opt, process_input(device_opt))
-		
-	docs = { }
-	docs["shortdesc"] = "Fence agent for HP iLO MP"
-	docs["longdesc"] = ""
-	docs["vendorurl"] = "http://www.hp.com"
-	show_docs(options, docs)
-	
-	conn = fence_login(options)
-	conn.send("SMCLP\r\n")
-
-	##
-	## Fence operations
-	####
-	result = fence_action(conn, options, set_power_status, get_power_status)
-
-	try:
-		conn.send("exit\r\n")
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/intelmodular/Makefile b/fence/agents/intelmodular/Makefile
deleted file mode 100644
index e7509e6..0000000
--- a/fence/agents/intelmodular/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_intelmodular
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/intelmodular/fence_intelmodular.py b/fence/agents/intelmodular/fence_intelmodular.py
deleted file mode 100644
index 11ff9bc..0000000
--- a/fence/agents/intelmodular/fence_intelmodular.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-
-# Tested with an Intel MFSYS25 using firmware package 2.6 Should work with an
-# MFSYS35 as well.
-#
-# Notes:
-#
-# The manual and firmware release notes says SNMP is read only. This is not
-# true, as per the MIBs that ship with the firmware you can write to
-# the bladePowerLed oid to control the servers.
-#
-# Thanks Matthew Kent for original agent and testing.
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-from fencing_snmp import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="Intel Modular SNMP fence agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-### CONSTANTS ###
-# From INTELCORPORATION-MULTI-FLEX-SERVER-BLADES-MIB.my that ships with
-# firmware updates
-STATUSES_OID=".1.3.6.1.4.1.343.2.19.1.2.10.202.1.1.6"
-
-# Status constants returned as value from SNMP
-STATUS_UP=2
-STATUS_DOWN=0
-
-# Status constants to set as value to SNMP
-STATUS_SET_ON=2
-STATUS_SET_OFF=3
-
-### FUNCTIONS ###
-
-def get_power_status(conn,options):
-	(oid,status)=conn.get("%s.%s"%(STATUSES_OID,options["-n"]))
-	return (status==str(STATUS_UP) and "on" or "off")
-
-def set_power_status(conn, options):
-	conn.set("%s.%s"%(STATUSES_OID,options["-n"]),(options["-o"]=="on" and STATUS_SET_ON or STATUS_SET_OFF))
-
-def get_outlets_status(conn, options):
-	result={}
-
-	res_blades=conn.walk(STATUSES_OID,30)
-
-	for x in res_blades:
-		port_num=x[0].split('.')[-1]
-
-		port_alias=""
-		port_status=(x[1]==str(STATUS_UP) and "on" or "off")
-
-		result[port_num]=(port_alias,port_status)
-
-	return result
-
-# Main agent method
-def main():
-	global port_oid
-
-	device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
-		       "action", "ipaddr", "login", "passwd", "passwd_script",
-		       "test", "port", "separator", "no_login", "no_password",
-		       "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
-		       "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
-		       "udpport","inet4_only","inet6_only",
-		       "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	snmp_define_defaults ()
-
-	options=check_input(device_opt,process_input(device_opt))
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for Intel Modular"
-	docs["longdesc"] = "fence_intelmodular is an I/O Fencing agent \
-which can be used with Intel Modular device (tested on Intel MFSYS25, should \
-work with MFSYS35 as well). \
-\n.P\n\
-Note: Since firmware update version 2.7, SNMP v2 write support is \
-removed, and replaced by SNMP v3 support. So agent now has default \
-SNMP version 3. If you are using older firmware, please supply -d \
-for command line and snmp_version option for your cluster.conf."
-	docs["vendorurl"] = "http://www.intel.com"
-	show_docs(options, docs)
-
-	# Operate the fencing device
-	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/ipmilan/Makefile b/fence/agents/ipmilan/Makefile
deleted file mode 100644
index e8790af..0000000
--- a/fence/agents/ipmilan/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-TARGET= fence_ipmilan
-
-SBINDIRT=$(TARGET)
-
-MANTARGET=$(TARGET).8
-
-all: ${TARGET} ${MANTARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	expect.o \
-	ipmilan.o
-
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-$(MANTARGET): $(TARGET) ${SRCDIR}/fence/agents/lib/fence2man.xsl
-	set -e && \
-	./$(TARGET) -o metadata > .$@.tmp && \
-	xsltproc ${SRCDIR}/fence/agents/lib/fence2man.xsl .$@.tmp > $@
-
-clean: generalclean
-	rm -f $(MANTARGET) .$(MANTARGET).tmp
-
--include $(OBJS:.o=.d)
diff --git a/fence/agents/ipmilan/expect.c b/fence/agents/ipmilan/expect.c
deleted file mode 100644
index 85ba487..0000000
--- a/fence/agents/ipmilan/expect.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/** @file
- * Simple expect module for the STONITH library.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <errno.h>
-#include <syslog.h>
-#include <libintl.h>
-#include <sys/wait.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/times.h>
-#ifdef _POSIX_PRIORITY_SCHEDULING
-#	include <sched.h>
-#endif
-
-#include "expect.h"
-
-#ifndef EOS
-#	define	EOS '\0'
-#endif
-
-
-/* 
- * Just incase we are on an out of date system 
- */
-#ifndef CLOCKS_PER_SEC
-#  ifndef CLK_TCK
-#    error Neither CLOCKS_PER_SEC nor CLK_TCK (obsolete) are defined
-#  endif /* CLK_TCK */
-#  define CLOCKS_PER_SEC CLK_TCK
-#endif /* CLOCKS_PER_SEC */
-
-
-void close_all_files (void);
-
-/**
- * Look for ('expect') any of a series of tokens in the input
- * Return the token type for the given token or -1 on error.
- *
- * @param fd		The file descriptor to watch.
- * @param toklist	The series of tokens to look for.
- * @param to_secs	Timeout (in seconds).
- * @param buf		Receive buffer (preallocated).
- * @param maxline	Length of receive buffer.
- */
-int
-ExpectToken(int	fd, struct Etoken * toklist, int to_secs, char * buf
-,	int maxline)
-{
-	clock_t		starttime;
-	clock_t		endtime;
-	int		wraparound=0;
-	int		tickstousec = (1000000/CLOCKS_PER_SEC);
-	clock_t		now;
-	clock_t		ticks;
-	int		nchars = 1; /* reserve space for an EOS */
-	struct timeval	tv;
-	struct tms      tms_unused; /*This tms is unused, but cygwin doesn't like NULL in times*/
-	struct Etoken *	this;
-
-	/* Figure out when to give up.  Handle lbolt wraparound */
-	if (fd < 0) {
-		errno = EINVAL;
-		return -1;
-	}
-	
-	starttime = times(&tms_unused);
-	ticks = (to_secs*CLOCKS_PER_SEC);
-	endtime = starttime + ticks;
-
-	if (endtime < starttime) {
-		wraparound = 1;
-	}
-
-	if (buf) {
-		*buf = EOS;
-	}
-
-	for (this=toklist; this->string; ++this) {
-		this->matchto = 0;
-	}
-
-
-	while (now = times(&tms_unused),
-		(wraparound && (now > starttime || now <= endtime))
-		||	(!wraparound && now <= endtime)) {
-
-		fd_set infds;
-		char	ch;
-		clock_t		timeleft;
-		int		retval;
-
-		timeleft = endtime - now;
-
-		tv.tv_sec = timeleft / CLOCKS_PER_SEC;
-		tv.tv_usec = (timeleft % CLOCKS_PER_SEC) * tickstousec;
-
-		if (tv.tv_sec == 0 && tv.tv_usec < tickstousec) {
-			/* Give 'em a little chance */
-			tv.tv_usec = tickstousec;
-		}
-
-		/* Watch our FD to see when it has input. */
-           	FD_ZERO(&infds);
-           	FD_SET(fd, &infds);
-
-		retval = select(fd+1, &infds, NULL, NULL, &tv); 
-		if (retval <= 0) {
-			errno = ETIMEDOUT;
-			return(-1);
-		}
-		/* Whew!  All that work just to read one character! */
-		
-		if (read(fd, &ch, sizeof(ch)) <= 0) {
-			return(-1);
-		}
-		/* Save the text, if we can */
-		if (buf && nchars < maxline-1) {
-			*buf = ch;
-			++buf;
-			*buf = EOS;
-			++nchars;
-		}
-#if 0
-		fprintf(stderr, "%c", ch);
-#endif
-
-		/* See how this character matches our expect strings */
-
-		for (this=toklist; this->string; ++this) {
-
-			if (ch == this->string[this->matchto]) {
-
-				/* It matches the current token */
-
-			 	++this->matchto;
-				if (this->string[this->matchto] == EOS){
-					/* Hallelujah! We matched */
-					return(this->toktype);
-				}
-			}else{
-
-				/* It doesn't appear to match this token */
-
-				int	curlen;
-				int	nomatch=1;
-				/*
-				 * If we already had a match (matchto is
-				 * greater than zero), we look for a match
-				 * of the tail of the pattern matched so far
-				 * (with the current character) against the
-				 * head of the pattern.
-				 */
-
-				/*
-				 * This is to make the string "aab" match
-				 * the pattern "ab" correctly 
-				 * Painful, but nice to do it right.
-				 */
-
-				for (curlen = (this->matchto)
-				;	nomatch && curlen >= 0
-				;	--curlen) 			{
-					const char *	tail;
-					tail=(this->string)
-					+	this->matchto
-					-	curlen;
-
-					if (strncmp(this->string, tail
-					,	curlen) == 0
-					&&	this->string[curlen] == ch)  {
-						
-						if (this->string[curlen+1]==EOS){
-							/* We matched!  */
-							/* (can't happen?) */
-							return(this->toktype);
-						}
-						this->matchto = curlen+1;
-						nomatch=0;
-					}
-				}
-				if (nomatch) {
-					this->matchto = 0;
-				}
-			}
-		}
-	}
-	errno = ETIMEDOUT;
-	return(-1);
-}
-
-/**
- * Start a process with its stdin and stdout redirected to pipes
- * so the parent process can talk to it.
- *
- * @param cmd		Command line to run.
- * @param readfd	Filled with a pipe to the the output of the
- *			new child.
- * @param writefd	Filled with a pipe to the input of the new
- *			child.
- * @param redir_err	0, 1 = stderr, 2 = setsid, 3 = both
- * @return		-1 on failure (with errno set appropriately) or
- *			or the PID of the new child process.
- */
-int
-StartProcess(const char * cmd, int * readfd, int * writefd, int flags)
-{
-	pid_t	pid;
-	int	wrpipe[2];	/* The pipe the parent process writes to */
-				/* (which the child process reads from) */
-	int	rdpipe[2];	/* The pipe the parent process reads from */
-				/* (which the child process writes to) */
-
-	if (pipe(wrpipe) < 0) {
-		perror("cannot create pipe\n");
-		return(-1);
-	}
-	if (pipe(rdpipe) < 0) {
-		perror("cannot create pipe\n");
-		close(wrpipe[0]);
-		close(wrpipe[1]);
-		return(-1);
-	}
-	switch(pid=fork()) {
-	case -1:	
-		perror("cannot StartProcess cmd");
-		close(rdpipe[0]);
-		close(rdpipe[1]);
-		close(wrpipe[0]);
-		close(wrpipe[1]);
-		return(-1);
-
-	case 0:
-		/* We are the child */
-		/* Redirect stdin */
-		if (wrpipe[0] != 0) {
-			close(0);
-			if(dup2(wrpipe[0], 0) < 0) {
-			    syslog(LOG_CRIT,
-			    	   "StartProcess: dup2(%d,0) failed: %s\n",
-			    	   wrpipe[0],
-			    	   strerror(errno));
-			    exit(1);
-			}
-			close(wrpipe[0]);
-		}
-		close(wrpipe[1]);
-
-		/* Redirect stdout */
-		if (rdpipe[1] != 1) {
-			close(1);
-			if(dup2(rdpipe[1], 1) < 0) {
-			    syslog(LOG_CRIT,
-			    	   "StartProcess: dup2(%d,1) failed: %s\n",
-			    	   rdpipe[1],
-			    	   strerror(errno));
-			    exit(1);
-			}
-			close(rdpipe[1]);
-		}
-		close(rdpipe[0]);
-		
-		if (flags & EXP_STDERR) {
-			/* Redirect stderr */
-			close(2);
-			if(dup2(1, 2) < 0) {
-				syslog(LOG_CRIT,
-				       "StartProcess: dup2(1,2) failed: %s\n",
-				       strerror(errno));
-				exit(1);
-			}
-		}
-		
-		if (flags & EXP_NOCTTY)
-			setsid();
-		close_all_files(); /* Workaround telnet bugs */
-#if defined(SCHED_OTHER)
-		{
-			/*
-			 * Try and (re)set our scheduling to "normal"
-			 * Sometimes our callers run in soft
-			 * real-time mode.  The program we exec might
-			 * not be very well behaved - this is bad for
-			 * operation in high-priority (soft real-time)
-			 * mode.  In particular, telnet is prone to
-			 * going into infinite loops when killed.
-			 */
-			struct sched_param	sp;
-			memset(&sp, 0, sizeof(sp));
-			sp.sched_priority = 0;
-			sched_setscheduler(0, SCHED_OTHER, &sp);
-		}
-#endif
-		execlp("/bin/bash", "bash", "-c", cmd, NULL);
-		perror("cannot exec shell!");
-		exit(1);
-
-	default:	/* We are the parent */
-		*readfd = rdpipe[0];
-		close(rdpipe[1]);
-		*writefd = wrpipe[1];
-		close(wrpipe[0]);
-		return(pid);
-	}
-	/*NOTREACHED*/
-	return(-1);
-}
-
-/**
- * Close all file descriptors in a child process.
- *
- * Open fd's are inherited across exec unless they are
- * marked close on exec, which must be done explicitly
- * with fcntl().  While this should not affect the operation of
- * telnet, it was found that in some cases it did.  Its easier to
- * just fix it this way than to fix telnet.
- */
-void
-close_all_files (void)
-{
-	register int i, fd_table_size;
-
-	fd_table_size = getdtablesize ();
-	if (fd_table_size > 256)/* clamp to a reasonable value */
-		fd_table_size = 256;
-	
-	for (i = 3; i < fd_table_size; i++)
-		close (i);
-}
diff --git a/fence/agents/ipmilan/expect.h b/fence/agents/ipmilan/expect.h
deleted file mode 100644
index 41d398a..0000000
--- a/fence/agents/ipmilan/expect.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/** @file
- * Header for expect.c.
- *
- * Expect simple tokens.  Simple expect infrastructure for STONITH API
- *
- */
-
-#ifndef __EXPECT_H
-#	define __EXPECT_H
-/*
- *	If we find any of the given tokens in the input stream,
- *	we return it's "toktype", so we can tell which one was
- *	found.
- *
- */
-
-/**
- * A token we pass to ExpectToken()
- */
-struct Etoken {
-	const char *	string;		/**< The token to look for */
-	int		toktype;	/**< The type to return on match */
-	int		matchto;	/**< Modified during matches */
-};
-
-int ExpectToken(int fd
-,	struct Etoken * toklist	/* List of tokens to match against */
-				/* Final token has NULL string */
-,	int to_secs		/* Timeout value in seconds */
-,	char * buf		/* If non-NULL, then all the text
-				 * matched/skipped over by this match */
-,	int maxline);		/* Size of 'buf' area in bytes */
-
-
-/*
- *	A handy little routine.  It runs the given process
- *	with it's standard output redirected into our *readfd, and
- *	its standard input redirected from our *writefd
- *
- *	Doing this with all the pipes, etc. required for doing this
- *	is harder than it sounds :-)
- */
-
-int StartProcess(const char * cmd, int* readfd, int* writefd, int redir_err);
-
-#define EXP_STDERR 1
-#define EXP_NOCTTY 2
-
-#ifndef EOS
-#	define	EOS '\0'
-#endif
-#endif /*__EXPECT_H*/
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
deleted file mode 100644
index 92009f0..0000000
--- a/fence/agents/ipmilan/ipmilan.c
+++ /dev/null
@@ -1,1203 +0,0 @@
-/** @file
- * clumanager 1.2.x linux-cluster fence and/or GFS fence
- * module for Intel/Bull/Dell Tiger4 machines via IPMI over lan.
- * (Probably works with anything ipmitool can control, though.)
- *
- * Note: REQUIRES ipmitool to operate.  On certain machines, the hardware
- * manufacturer provides this tool for you.  Otherwise, check:
- *
- *  http://ipmitool.sourceforge.net
- *
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <libintl.h>
-
-/* fenced doesn't use the remote calls */
-#define ST_STATUS 0
-#define ST_POWERON 1
-#define ST_POWEROFF 2
-#define ST_GENERIC_RESET 3
-#define ST_CYCLE 4
-#define ST_DIAG 5
-
-#define DEFAULT_TIMEOUT 20
-#define DEFAULT_POWER_WAIT 2
-
-#define DEFAULT_METHOD "onoff"
-
-/* We should follow FenceAgentsAPI standard*/
-#define ERR_OFF_SUCCESSFUL 0
-#define ERR_OFF_FAIL       1
-
-#define ERR_ON_SUCCESSFUL 0
-#define ERR_ON_FAIL       1
-
-#define ERR_STATUS_ON     0
-#define ERR_STATUS_FAIL   1
-#define ERR_STATUS_OFF    2
-
-#define ERR_OK            0
-
-#define log(lvl, fmt, args...) fprintf(stderr, fmt, ##args)
-#include <libgen.h>
-#include "copyright.cf"
-
-#include "expect.h"
-
-#define IPMIID "IPMI over LAN driver"
-#define NOTIPMI "Destroyed IPMI over LAN driver"
-
-
-#define dbg_printf(i, lvl, fmt, args...) \
-do { \
-	if ( (i)->i_verbose >= lvl) { \
-		printf(fmt, ##args); \
-		fflush(stdout); \
-	} \
-} while (0)
-
-
-
-struct ipmi {
-	const char *i_id;
-	const char *i_ipmitool;
-	char *i_host;
-	char *i_user;
-	char *i_authtype;
-	char *i_password;
-	int i_rdfd;
-	int i_wrfd;
-	pid_t i_pid;
-	int i_config;
-	int i_verbose;
-	int i_lanplus;
-	int i_timeout;
-	int i_power_wait;
-	int i_cipher;
-};
-
-
-/*
-   Supported installation paths
- */
-const char *ipmitool_paths[] = {
-	"/usr/local/bull/NSMasterHW/bin/ipmitool",
-	"/usr/bin/ipmitool",
-	"/usr/sbin/ipmitool",
-	"/bin/ipmitool",
-	"/sbin/ipmitool",
-	"/usr/local/bin/ipmitool",
-	"/usr/local/sbin/ipmitool",
-	NULL
-};
-
-
-#define ECIPHER 2048
-#define ESTATE (8192*2)
-static struct Etoken power_on_complete[] = {
-	{"Password:", EPERM, 0},
-	{"Unable to establish LAN", EAGAIN, 0},	/* Retry */
-	{"IPMI mutex", EFAULT, 0},	/* Death */
-	{"Unsupported cipher suite ID", ECIPHER,0},
-	{"read_rakp2_message: no support for", ECIPHER,0},
-	{"Up/On", 0, 0},
-	{NULL, 0, 0}
-};
-
-static struct Etoken power_off_complete[] = {
-	{"Password:", EPERM, 0},
-	{"Unable to establish LAN", EAGAIN, 0},	/* Retry */
-	{"IPMI mutex", EFAULT, 0},	/* Death */
-	{"Unsupported cipher suite ID", ECIPHER,0},
-	{"read_rakp2_message: no support for", ECIPHER,0},
-	{"Down/Off", 0, 0},
-	{NULL, 0, 0}
-};
-
-/** Powercycle operation */
-static struct Etoken power_cycle_complete[] = {
-	{"Password:", EPERM, 0},
-	{"Unable to establish LAN", EAGAIN, 0},	/* Retry */
-	{"IPMI mutex", EFAULT, 0},	/* Death */
-	{"Unsupported cipher suite ID", ECIPHER,0},
-	{"read_rakp2_message: no support for", ECIPHER,0},
-	{"Command not supported in present state", ESTATE, 0},
-	{": Cycle", 0, 0},
-	{NULL, 0, 0}
-};
-
-#define STATE_OFF 4096
-#define STATE_ON  8192
-static struct Etoken power_status[] = {
-	{"Password:", EPERM, 0},
-	{"Unable to establish LAN", EAGAIN, 0},	/* Retry */
-	{"IPMI mutex", EFAULT, 0},	/* Death */
-	{"Unsupported cipher suite ID", ECIPHER,0},
-	{"read_rakp2_message: no support for", ECIPHER,0},
-	{"Chassis Power is off", STATE_OFF, 0},
-	{"Chassis Power is on", STATE_ON, 0},
-	{NULL, 0, 0}
-};
-
-/* Structure describing one xml metadata value*/
-struct xml_parameter_s {
-  const char *name;
-  const char *getopt;
-  const int required;
-  const char *content_type;
-  const char *default_value;
-  const char *description;
-};
-
-/* Array of xml metadatas*/
-struct xml_parameter_s xml_parameters[]={
-  {"auth","-A",0,"string",NULL,"IPMI Lan Auth type (md5, password, or none)"},
-  {"ipaddr","-a",1,"string",NULL,"IPMI Lan IP to talk to"},
-  {"passwd","-p",0,"string",NULL,"Password (if required) to control power on IPMI device"},
-  {"passwd_script","-S",0,"string",NULL,"Script to retrieve password (if required)"},
-  {"lanplus","-P",0,"boolean",NULL,"Use Lanplus"},
-  {"login","-l",0,"string",NULL,"Username/Login (if required) to control power on IPMI device"},
-  {"action","-o",0,"string","reboot","Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata"},
-  {"timeout","-t",0,"string",NULL,"Timeout (sec) for IPMI operation"},
-  {"cipher","-C",0,"string",NULL,"Ciphersuite to use (same as ipmitool -C parameter)"},
-  {"method","-M",0,"string",DEFAULT_METHOD,"Method to fence (onoff or cycle)"},
-  {"power_wait","-T",0,"string","2","Wait X seconds after on/off operation"},
-  {"delay","-f",0,"string",NULL,"Wait X seconds before fencing is started"},
-  {"verbose","-v",0,"boolean",NULL,"Verbose mode"}};
-
-/*
-   Search for ipmitool
- */
-static const char *
-ipmitool_path(void)
-{
-	char *p;
-	int x = 0;
-	struct stat sb;
-
-	for (x = 0; ipmitool_paths[x]; x++) {
-		p = (char *)ipmitool_paths[x];
-		if (stat(p, &sb) != 0)
-			continue;
-
-		if (!S_ISREG(sb.st_mode))
-			continue;
-
-		/* executable? */
-		if ((sb.st_mode & S_IXUSR) == 0)
-			continue;
-
-		return (const char *)p;
-	}
-
-	return NULL;
-}
-
-
-/** Prepare string for use in sh style environment. This function take source
-  string and prepend/append quote (') to start/end of source string to dest
-  string. Any occurence of quote in source string is replaced by '\'' sequence.
-  Dest string must be preallocated.
-
-  @param dest Destination string
-  @param source Source string
-  @param max_len Maximum length of data written to dest string (including end 0)
-  @return Pointer to start of destination string.
-*/
-static char *str_prepare_for_sh(char *dest,char *source,int max_len) {
-  char *dest_p=dest;
-  char *max_dest=dest+max_len;
-
-  if (dest_p+1>=max_dest) {*dest_p=0;return dest;}
-  *dest_p++='\'';
-
-  while (*source) {
-    if (*source=='\'') {
-      if (dest_p+4>=max_dest) {*dest_p=0;return dest;}
-
-      memcpy(dest_p,"'\\''",4);dest_p+=4;
-    } else {
-      if (dest_p+1>=max_dest) {*dest_p=0;return dest;}
-
-      *dest_p++=*source;
-    }
-    source++;
-  }
-
-  if (dest_p+2>=max_dest) {*dest_p=0;return dest;}
-
-  *dest_p++='\'';*dest_p=0;
-
-  return dest;
-}
-
-static int
-build_cmd(char *command, size_t cmdlen, struct ipmi *ipmi, int op)
-{
-	char cmd[2048];
-	char arg[2048];
-	char tmp[2048];
-	int x;
-
-	/* Store path */
-	if (ipmi->i_lanplus) {
-		snprintf(cmd, sizeof(cmd), "%s -I lanplus -H %s",
-				ipmi->i_ipmitool,
-				str_prepare_for_sh(tmp,ipmi->i_host,sizeof(tmp)));
-	} else {
-		snprintf(cmd, sizeof(cmd), "%s -I lan -H %s", ipmi->i_ipmitool,
-				str_prepare_for_sh(tmp,ipmi->i_host,sizeof(tmp)));
-	}
-
-	if (ipmi->i_user) {
-		snprintf(arg, sizeof(arg), " -U %s", str_prepare_for_sh(tmp,ipmi->i_user,sizeof(tmp)));
-		strncat(cmd, arg, sizeof(cmd) - strlen(arg));
-	}
-
-	if (ipmi->i_authtype) {
-		snprintf(arg, sizeof(arg), " -A %s", str_prepare_for_sh(tmp,ipmi->i_authtype,sizeof(tmp)));
-		strncat(cmd, arg, sizeof(cmd) - strlen(arg));
-	}
-
-	if (ipmi->i_cipher>=0) {
-		snprintf(arg, sizeof(arg), " -C %d", ipmi->i_cipher);
-		strncat(cmd, arg, sizeof(cmd) - strlen(arg));
-	}
-
-	if (ipmi->i_password) {
-		snprintf(arg, sizeof(arg), " -P %s", str_prepare_for_sh(tmp,ipmi->i_password,sizeof(tmp)));
-		strncat(cmd, arg, sizeof(cmd) - strlen(arg));
-	} else {
-		snprintf(arg, sizeof(arg), " -P ''");
-		strncat(cmd, arg, sizeof(cmd) - strlen(arg));
-	}
-
-	/* Tack on the -v flags for ipmitool; in most cases, i_verbose
-	   will be 0 */
-	for (x = 0; x < ipmi->i_verbose; x++) {
-		snprintf(arg, sizeof(arg), " -v");
-		strncat(cmd, arg, sizeof(cmd) - strlen(arg));
-	}
-
-	switch(op) {
-	case ST_POWERON:
-		snprintf(arg, sizeof(arg),
-			 "%s chassis power on", cmd);
-		break;
-	case ST_POWEROFF:
-		snprintf(arg, sizeof(arg),
-			 "%s chassis power off", cmd);
-		break;
-	case ST_STATUS:
-		snprintf(arg, sizeof(arg),
-			 "%s chassis power status", cmd);
-		break;
-	case ST_CYCLE:
-		snprintf(arg, sizeof(arg),
-			 "%s chassis power cycle", cmd);
-		break;
-	case ST_DIAG:
-		snprintf(arg, sizeof(arg),
-			 "%s chassis power diag", cmd);
-		break;
-	}
-
-	strncpy(command, arg, cmdlen);
-	return 0;
-}
-
-
-static int
-ipmi_spawn(struct ipmi *ipmi, const char *cmd)
-{
-	dbg_printf(ipmi, 1, "Spawning: '%s'...\n", cmd);
-	if (!ipmi) {
-		errno = EINVAL;
-		return -1;
-	}
-
-	if (ipmi->i_pid != -1)  {
-		dbg_printf(ipmi, 1, "Can't spawn: PID %d running\n",
-			   (int)ipmi->i_pid);
-		errno = EINPROGRESS;
-		return -1;
-	}
-
-	if ((ipmi->i_pid = StartProcess(cmd, &ipmi->i_rdfd,
-					&ipmi->i_wrfd,
-					EXP_STDERR|EXP_NOCTTY)) >= 0) {
-		dbg_printf(ipmi, 2, "Spawned: '%s' - PID %d\n", cmd,
-			   (int)ipmi->i_pid);
-		return 0;
-	}
-	return -1;
-}
-
-
-static int
-ipmi_reap(struct ipmi *ipmi)
-{
-	if (ipmi->i_pid >= 0) {
-		dbg_printf(ipmi, 2, "Reaping pid %d\n", ipmi->i_pid);
-		kill(ipmi->i_pid, 9);
-		waitpid(ipmi->i_pid, NULL, 0);
-	}
-	ipmi->i_pid = -1;
-	if (ipmi->i_rdfd >= 0) {
-		close(ipmi->i_rdfd);
-		ipmi->i_rdfd = -1;
-	}
-	if (ipmi->i_wrfd >= 0) {
-		close(ipmi->i_wrfd);
-		ipmi->i_wrfd = -1;
-	}
-	return 0;
-}
-
-
-static int
-ipmi_expect(struct ipmi *ipmi, struct Etoken *toklist, int timeout)
-{
-	int ret;
-	char buf[32768]; /* XX hope this is enough */
-
-	dbg_printf(ipmi, 3, "Looking for: \n");
-	for (ret = 0; toklist[ret].string; ret++) {
-		dbg_printf(ipmi, 3, "    '%s', val = %d\n",
-			   toklist[ret].string,
-			   toklist[ret].toktype);
-	}
-
-	ret = ExpectToken(ipmi->i_rdfd, toklist, timeout, buf, sizeof(buf));
-	dbg_printf(ipmi, 3, "ExpectToken returned %d\n", ret);
-	if (ret == -1) {
-		ret = errno;
-		dbg_printf(ipmi, 3, "ExpectToken failed.  Info returned:\n");
-		dbg_printf(ipmi, 3, ">>>>>\n%s\n<<<<<\nError = %d (%s)\n",
-			   buf,
-			   ret,
-			   strerror(ret));
-	}
-
-	return ret;
-}
-
-
-static int
-ipmi_op(struct ipmi *ipmi, int op, struct Etoken *toklist)
-{
-	char cmd[2048];
-	int ret;
-
-	build_cmd(cmd, sizeof(cmd), ipmi, op);
-
-	if (ipmi_spawn(ipmi, cmd) != 0)
-		return -1;
-	ret = ipmi_expect(ipmi, toklist, ipmi->i_timeout);
-	ipmi_reap(ipmi);
-
-	if (ret == EFAULT) {
-		log(LOG_CRIT, "ipmilan: ipmitool failed to create "
-		    "mutex; unable to complete operation\n");
-		return ret;
-	}
-
-	if (ret == ECIPHER) {
-		log(LOG_CRIT, "ipmilan: ipmitool failed to operate "
-		    "with ciphersuite %d; unable to complete operation\n",ipmi->i_cipher);
-		return ret;
-	}
-
-	if (ret == ESTATE) {
-		log(LOG_CRIT, "ipmilan: ipmitool failed to complete "
-		    "command in current state\n");
-		return ret;
-	}
-
-	if (ret == ETIMEDOUT) {
-		/*!!! Still couldn't get through?! */
-		log(LOG_WARNING,
-		    "ipmilan: Failed to connect after %d seconds\n",ipmi->i_timeout);
-	}
-
-	return ret;
-}
-
-
-static int
-ipmi_off(struct ipmi *ipmi)
-{
-	int ret, retries = 7;
-
-	ret = ipmi_op(ipmi, ST_STATUS, power_status);
-	switch(ret) {
-	case STATE_ON:
-		break;
-	case STATE_OFF:
-		return 0;
-	default:
-		return ret;
-	}
-
-	while (retries>=0) {
-		ret = ipmi_op(ipmi, ST_POWEROFF, power_off_complete);
-		if (ret != 0)
-			return ret;
-
-		sleep(2);
-		--retries;
-		ret = ipmi_op(ipmi, ST_STATUS, power_status);
-
-		switch(ret) {
-		case STATE_OFF:
-			return 0;
-		case EFAULT:
-			/* We're done. */
-			retries = 0;
-			break;
-		case STATE_ON:
-		default:
-			continue;
-		}
-	}
-	log(LOG_WARNING, "ipmilan: Power still on\n");
-
-	return ret;
-}
-
-
-static int
-ipmi_on(struct ipmi *ipmi)
-{
-	int ret, retries = 7;
-
-	ret = ipmi_op(ipmi, ST_STATUS, power_status);
-	switch(ret) {
-	case STATE_ON:
-		return 0;
-	case STATE_OFF:
-		break;
-	default:
-		return ret;
-	}
-
-	while (retries>=0) {
-		ret = ipmi_op(ipmi, ST_POWERON, power_on_complete);
-		if (ret != 0)
-			return ret;
-
-		sleep(ipmi->i_power_wait);
-		--retries;
-		ret = ipmi_op(ipmi, ST_STATUS, power_status);
-
-		switch(ret) {
-		case STATE_ON:
-			return 0;
-		case EFAULT:
-			/* We're done. */
-			retries = 0;
-			break;
-		case STATE_OFF:
-		default:
-			continue;
-		}
-	}
-	log(LOG_WARNING, "ipmilan: Power still off\n");
-
-	return ret;
-}
-
-static int
-ipmi_cycle(struct ipmi *ipmi)
-{
-	int ret;
-
-	ret = ipmi_op(ipmi, ST_CYCLE, power_cycle_complete);
-
-	return ret;
-}
-
-static int
-ipmi_diag(struct ipmi *ipmi)
-{
-	int ret;
-	
-	ret = ipmi_op(ipmi, ST_DIAG, power_off_complete);
-	
-	return ret;
-}
-
-
-/**
-  Squash all our private data
- */
-static void
-ipmi_destroy(struct ipmi *i)
-{
-	ipmi_reap(i);
-	if (i->i_user) {
-		free(i->i_user);
-		i->i_user = NULL;
-	}
-	if (i->i_password) {
-		free(i->i_password);
-		i->i_password= NULL;
-	}
-	if (i->i_host) {
-		free(i->i_host);
-		i->i_host = NULL;
-	}
-	i->i_config = 0;
-	i->i_id = NOTIPMI;
-}
-
-
-/**
-  Multipurpose initializer.  Used to either create a new, blank ipmi,
-  or update an existing one, or both.
- */
-static struct ipmi *
-ipmi_init(struct ipmi *i, char *host, char *authtype,
-	  char *user, char *password, int lanplus, int verbose,int timeout,
-	  int power_wait,
-	  int cipher)
-{
-	const char *p;
-
-	if (!i || !i->i_ipmitool)
-		p = ipmitool_path();
-	else
-		p = i->i_ipmitool;
-
-	if (!p) {
-		log(LOG_WARNING, "ipmilan: ipmitool not found!\n");
-		return NULL;
-	}
-
-	if (!i)
-		i = malloc (sizeof(*i));
-	if (!i)
-		return NULL;
-
-	if (host && strlen(host)) {
-		i->i_host = strdup(host);
-		if (!i->i_host) {
-			free(i);
-			return NULL;
-		}
-	} else
-		i->i_host = NULL;
-
-	if (password && strlen(password)) {
-		i->i_password = strdup(password);
-		if (!i->i_password) {
-			free(i->i_host);
-			free(i);
-			return NULL;
-		}
-	} else
-		i->i_password = NULL;
-
-	if (authtype && strlen(authtype)) {
-		i->i_authtype = strdup(authtype);
-		if (!i->i_authtype) {
-			free(i->i_host);
-			if (i->i_password)
-				free(i->i_password);
-			free(i);
-			return NULL;
-		}
-	} else
-		i->i_authtype = NULL;
-
-
-	if (user && strlen(user)) {
-		i->i_user= strdup(user);
-		if (!i->i_user) {
-			free(i->i_host);
-			if (i->i_authtype)
-				free(i->i_authtype);
-			if (i->i_password)
-				free(i->i_password);
-			free(i);
-			return NULL;
-		}
-	} else
-		i->i_user = NULL;
-	i->i_ipmitool = p;
-	i->i_rdfd = -1;
-	i->i_wrfd = -1;
-	i->i_pid = -1;
-	i->i_id = IPMIID;
-	i->i_verbose = verbose;
-	i->i_lanplus = lanplus;
-	i->i_timeout = timeout;
-	i->i_power_wait = power_wait;
-	i->i_cipher = cipher;
-
-	return i;
-}
-
-
-/**
-   Remove leading and trailing whitespace from a line of text.
- */
-static int
-cleanup(char *line, size_t linelen)
-{
-	char *p;
-	size_t x;
-
-	/* Remove leading whitespace. */
-	p = line;
-	for (x = 0; x <= linelen; x++) {
-		switch (line[x]) {
-		case '\t':
-		case ' ':
-			break;
-		case '\n':
-		case '\r':
-			return -1;
-		default:
-			goto eol;
-		}
-	}
-eol:
-	/* Move the remainder down by as many whitespace chars as we
-	   chewed up */
-	if (x)
-		memmove(p, &line[x], linelen-x);
-
-	/* Remove trailing whitespace. */
-	for (x=0; x <= linelen; x++) {
-		switch(line[x]) {
-		case '\t':
-		case ' ':
-		case '\r':
-		case '\n':
-			line[x] = 0;
-		case 0:
-		/* End of line */
-			return 0;
-		}
-	}
-
-	return -1;
-}
-
-
-/**
-   Parse args from stdin.  Dev + devlen + op + oplen must be valid.
- */
-static int
-get_options_stdin(char *ip, size_t iplen,
-		  char *authtype, size_t atlen,
-		  char *passwd, size_t pwlen,
-		  char *pwd_script, size_t pwd_script_len,
-		  char *user, size_t userlen,
-		  char *op, size_t oplen,
-		  int *lanplus, int *verbose,int *timeout,
-		  int *power_wait,
-	          int *cipher, char *method, int methodlen,
-	          char *delay, size_t delaylen)
-{
-	char in[256];
-	int line = 0;
-	char *name, *val;
-
-	op[0] = 0;
-	method[0] = 0;
-
-	while (fgets(in, sizeof(in), stdin)) {
-		++line;
-
-		if (in[0] == '#')
-			continue;
-
-		if (cleanup(in, sizeof(in)) == -1)
-			continue;
-
-		name = in;
-		if ((val = strchr(in, '='))) {
-			*val = 0;
-			++val;
-		}
-
-		if (!strcasecmp(name, "agent")) {
-			/* Used by fenced? */
-		} else if (!strcasecmp(name, "verbose")) {
-			*verbose = 1;
-		} else if (!strcasecmp(name, "ipaddr")) {
-			/* IP address to use.  E.g. 10.1.1.2 */
-			if (val)
-				strncpy(ip, val, iplen);
-			else
-				ip[0] = 0;
-
-		} else if (!strcasecmp(name, "auth")) {
-			/* Authtype to use */
-			if (val)
-				strncpy(authtype, val, atlen);
-			else
-				authtype[0] = 0;
-
-		} else if (!strcasecmp(name, "passwd")) {
-			/* password */
-			if (val)
-				strncpy(passwd, val, pwlen);
-			else
-				passwd[0] = 0;
-
-		} else if (!strcasecmp(name, "passwd_script")) {
-			if (val) {
-				strncpy(pwd_script, val, pwd_script_len);
-				pwd_script[pwd_script_len - 1] = '\0';
-			} else
-				pwd_script[0] = '\0';
-		} else if (!strcasecmp(name, "user") || !strcasecmp(name, "login")) {
-			/* username */
-			if (val)
-				strncpy(user, val, userlen);
-			else
-				user[0] = 0;
-		} else if (!strcasecmp(name, "lanplus")) {
-			(*lanplus) = 1;
-		} else if (!strcasecmp(name,"timeout")) {
-			if ((sscanf(val,"%d",timeout)!=1) || *timeout<1) {
-			    *timeout=DEFAULT_TIMEOUT;
-			}
-		} else if (!strcasecmp(name,"power_wait")) {
-			if ((sscanf(val,"%d",power_wait)!=1) || *power_wait<1) {
-			    *power_wait=DEFAULT_POWER_WAIT;
-			}
-		} else if (!strcasecmp(name,"cipher")) {
-			if ((sscanf(val,"%d",cipher)!=1) || *cipher<0) {
-			    *cipher=-1;
-			}
-		} else if (!strcasecmp(name,"method")) {
-			strncpy (method, val, methodlen);
-		} else if (!strcasecmp(name, "option") ||
-			   !strcasecmp(name, "operation") ||
-			   !strcasecmp(name, "action")) {
-			if (val)
-				strncpy(op, val, oplen);
-			else
-				op[0] = 0;
-		} else if (!strcasecmp(name,"delay")) {
-			if (val)
-				strncpy(delay, val, delaylen);
-			else
-				delay[0] = 0;
-		}
-	}
-
-	return 0;
-}
-
-
-/**
-   Print a message to stderr and call exit(1).
- */
-static void
-fail_exit(const char *msg)
-{
-	fprintf(stderr, "failed: %s\n", msg);
-	exit(1);
-}
-
-static void
-usage_exit(char *pname)
-{
-printf("usage: %s <options>\n", pname);
-printf("   -A <authtype>  IPMI Lan Auth type (md5, password, or none)\n");
-printf("   -a <ipaddr>    IPMI Lan IP to talk to\n");
-printf("   -i <ipaddr>    IPMI Lan IP to talk to (deprecated, use -a)\n");
-printf("   -p <password>  Password (if required) to control power on\n"
-       "                  IPMI device\n");
-printf("   -P             Use Lanplus\n");
-printf("   -S <path>      Script to retrieve password (if required)\n");
-printf("   -l <login>     Username/Login (if required) to control power\n"
-       "                  on IPMI device\n");
-printf("   -o <op>        Operation to perform.\n");
-printf("                  Valid operations: on, off, reboot, status,\n");
-printf("                  diag, list or monitor\n");
-printf("   -t <timeout>   Timeout (sec) for IPMI operation (default %d)\n",DEFAULT_TIMEOUT);
-printf("   -T <timeout>   Wait X seconds after on/off operation\n");
-printf("   -f <timeout>   Wait X seconds before fencing is started\n");
-printf("   -C <cipher>    Ciphersuite to use (same as ipmitool -C parameter)\n");
-printf("   -M <method>    Method to fence (onoff or cycle (default %s)\n", DEFAULT_METHOD);
-printf("   -V             Print version and exit\n");
-printf("   -v             Verbose mode\n\n");
-printf("If no options are specified, the following options will be read\n");
-printf("from standard input (one per line):\n\n");
-printf("   auth=<auth>           Same as -A\n");
-printf("   ipaddr=<#>            Same as -a\n");
-printf("   passwd=<pass>         Same as -p\n");
-printf("   passwd_script=<path>  Same as -S\n");
-printf("   lanplus               Same as -P\n");
-printf("   login=<login>         Same as -u\n");
-printf("   option=<op>           Same as -o\n");
-printf("   operation=<op>        Same as -o\n");
-printf("   action=<op>           Same as -o\n");
-printf("   delay=<seconds>       Same as -f\n");
-printf("   timeout=<timeout>     Same as -t\n");
-printf("   power_wait=<time>     Same as -T\n");
-printf("   cipher=<cipher>       Same as -C\n");
-printf("   method=<method>       Same as -M\n");
-printf("   verbose               Same as -v\n\n");
-	exit(1);
-}
-
-
-/** Print XML metadata of fence agent*/
-static void print_xml_metadata(char *pname) {
-  int i;
-
-  printf("%s\n","<?xml version=\"1.0\" ?>");
-  printf("%s%s%s\n","<resource-agent name=\"",pname,"\" shortdesc=\"Fence agent for IPMI over LAN\">");
-  printf("<longdesc>\n");
-  printf("fence_ipmilan is an I/O Fencing agent which can be used with "
-         "machines controlled by IPMI. This agent calls support software "
-         "using ipmitool (http://ipmitool.sf.net/).\n\n"
-         "To use fence_ipmilan with HP iLO 3 you have to enable lanplus "
-         "option (lanplus / -P) and increase wait after operation to "
-         "4 seconds (power_wait=4 / -T 4)");
-  printf("</longdesc>\n");
-  printf("%s\n","<parameters>");
-
-  for (i=0;i<(sizeof(xml_parameters)/sizeof(struct xml_parameter_s));i++) {
-    printf("\t<parameter name=\"%s\" unique=\"1\">\n",xml_parameters[i].name);
-
-    printf("\t\t<getopt mixed=\"%s\" />\n",xml_parameters[i].getopt);
-    if (xml_parameters[i].default_value == NULL) {
-      printf("\t\t<content type=\"%s\" />\n",xml_parameters[i].content_type);
-    } else {
-      printf("\t\t<content type=\"%s\" default=\"%s\"/>\n", \
-          xml_parameters[i].content_type, \
-          xml_parameters[i].default_value );
-    }
-
-    printf("\t\t<shortdesc lang=\"en\">");
-    printf("%s",xml_parameters[i].description);
-    printf("</shortdesc>\n");
-    printf("\t</parameter>\n");
-  }
-  printf("%s\n","</parameters>");
-  printf("%s\n","<actions>");
-  printf("\t<action name=\"%s\" />\n", "on");
-  printf("\t<action name=\"%s\" />\n", "off");
-  printf("\t<action name=\"%s\" />\n", "reboot");
-  printf("\t<action name=\"%s\" />\n", "status");
-  printf("\t<action name=\"%s\" />\n", "diag");
-  printf("\t<action name=\"%s\" />\n", "list");
-  printf("\t<action name=\"%s\" />\n", "monitor");
-  printf("\t<action name=\"%s\" />\n", "metadata");
-  printf("%s\n","</actions>");
-  printf("%s\n","</resource-agent>");
-}
-
-int
-main(int argc, char **argv)
-{
-	extern char *optarg;
-	int opt, ret = -1;
-	char authtype[64];
-	char ip[64];
-	char passwd[64];
-	char user[64];
-	char op[64];
-	char method[64];
-	char delay[64];
-	char pwd_script[PATH_MAX] = { 0, };
-	int lanplus=0;
-	int verbose=0;
-	char *pname = basename(argv[0]);
-	struct ipmi *i;
-	int timeout=DEFAULT_TIMEOUT;
-	int down_sleep=DEFAULT_POWER_WAIT;
-	int cipher=-1;
-	int print_final_status=1;
-	int translated_ret = -1;
-
-	memset(ip, 0, sizeof(ip));
-	memset(authtype, 0, sizeof(authtype));
-	memset(passwd, 0, sizeof(passwd));
-	memset(user, 0, sizeof(user));
-	memset(op, 0, sizeof(op));
-	memset(method, 0, sizeof(method));
-	memset(delay, 0, sizeof(delay));
-
-	if (argc > 1) {
-		/*
-		   Parse command line options if any were specified
-		 */
-		while ((opt = getopt(argc, argv, "A:a:i:l:p:S:Po:vV?hHt:T:C:M:f:")) != EOF) {
-			switch(opt) {
-			case 'A':
-				/* Auth type */
-				strncpy(authtype, optarg, sizeof(authtype));
-				break;
-			case 'a':
-			case 'i':
-				/* IP address */
-				strncpy(ip, optarg, sizeof(ip));
-				break;
-			case 'l':
-				/* user / login */
-				strncpy(user, optarg, sizeof(user));
-				break;
-			case 'p':
-				/* password */
-				strncpy(passwd, optarg, sizeof(passwd));
-				break;
-			case 'P':
-				lanplus = 1;
-				break;
-			case 'S':
-				strncpy(pwd_script, optarg, sizeof(pwd_script));
-				pwd_script[sizeof(pwd_script) - 1] = '\0';
-				break;
-			case 'o':
-				/* Operation */
-				strncpy(op, optarg, sizeof(op));
-				break;
-			case 'f':
-				/* Delay */
-				strncpy(delay, optarg, sizeof(delay));
-				break;
-			case 't':
-				/* Timeout */
-				if ((sscanf(optarg,"%d",&timeout)!=1) || timeout<1) {
-				    fail_exit("Timeout option expects positive number parameter");
-				}
-				break;
-			case 'T':
-				/* Shutdown Sleep Time */
-				if ((sscanf(optarg,"%d",&down_sleep)!=1) || down_sleep<1) {
-				    fail_exit("Shutdown time option expects positive number parameter");
-				}
-				break;
-			case 'C':
-				/* Ciphersuite */
-				if ((sscanf(optarg,"%d",&cipher)!=1) || cipher<0) {
-				    fail_exit("Ciphersuite option expects positive number parameter");
-				}
-				break;
-			case 'M':
-				/* Reboot method */
-				strncpy(method, optarg, sizeof(method));
-				break;
-			case 'v':
-				verbose++;
-				break;
-			case 'V':
-        			printf("%s %s (built %s %s)\n", pname,
-				       RELEASE_VERSION,
-               				__DATE__, __TIME__);
-        			printf("%s\n",
-				       REDHAT_COPYRIGHT);
-				return 0;
-			default:
-				usage_exit(pname);
-			}
-		}
-	} else {
-		/*
-		   No command line args?  Get stuff from stdin
-		 */
-		if (get_options_stdin(ip, sizeof(ip),
-				      authtype, sizeof(authtype),
-				      passwd, sizeof(passwd),
-					  pwd_script, sizeof(pwd_script),
-				      user, sizeof(user),
-				      op, sizeof(op), &lanplus, &verbose,&timeout,
-				      &down_sleep,
-				      &cipher, method, sizeof(method),
-				      delay, sizeof(delay)) != 0)
-			return 1;
-	}
-
-	if (pwd_script[0] != '\0') {
-		char pwd_buf[1024];
-		FILE *fp;
-		fp = popen(pwd_script, "r");
-		if (fp != NULL) {
-			ssize_t len = fread(pwd_buf, 1, sizeof(pwd_buf), fp);
-			if (len > 0) {
-				char *p;
-				p = strchr(pwd_buf, '\n');
-				if (p != NULL)
-					*p = '\0';
-				p = strchr(pwd_buf, '\r');
-				if (p != NULL)
-					*p = '\0';
-				strncpy(passwd, pwd_buf, sizeof(passwd));
-				passwd[sizeof(passwd) - 1] = '\0';
-			}
-			pclose(fp);
-		}
-	}
-
-	if (!strcasecmp(op, "metadata")) {
-	  print_xml_metadata(pname);
-	  translated_ret = ERR_OK;
-	  ret=0;
-	  print_final_status=0;
-	  goto metaout;
-	}
-
-	/*
-	   Validate the operating parameters
-	 */
-	if (strlen(ip) == 0)
-		fail_exit("no IP address specified");
-
-	if (!strlen(op))
-		snprintf(op,sizeof(op), "reboot");
-
-	if (!strlen(method))
-		snprintf(method, sizeof(method), "onoff");
-
-	if (strcasecmp(op, "off") && strcasecmp(op, "on") &&
-	    strcasecmp(op, "status") && strcasecmp(op, "reboot") &&
-	    strcasecmp(op, "monitor") && strcasecmp(op, "list") &&
-	    strcasecmp(op, "metadata") && strcasecmp(op, "diag")) {
-		fail_exit("operation must be 'on', 'off', 'status', "
-			  "'reboot', 'diag', 'list', 'monitor' or 'metadata'");
-	}
-
-	if (strlen(authtype) &&
-	    strcasecmp(authtype, "md5") &&
-	    strcasecmp(authtype, "password") &&
-	    strcasecmp(authtype, "none")) {
-		fail_exit("authtype, if included, must be 'md5', 'password',"
-			  " 'none'.");
-	}
-
-	if (strcasecmp(method, "onoff") &&
-	    strcasecmp(method, "cycle")) {
-		fail_exit("method, if included, muse be 'onoff', 'cycle'.");
-	}
-
-	if (!strcasecmp(method, "cycle") &&
-	    (!strcasecmp(op, "on") || !strcasecmp(op, "off"))) {
-		fail_exit("cycle method supports only 'reboot' operation (not 'on' or 'off').");
-	}
-
-	/* Delay fencing if requested */
-	if (delay) {
-		if (!strcasecmp(op, "reboot") || !strcasecmp(op, "off")) {
-			sleep(atoi(delay));
-		}
-	}
-
-	/* Ok, set up the IPMI struct */
-	i = ipmi_init(NULL, ip, authtype, user, passwd, lanplus, verbose, timeout, down_sleep, cipher);
-	if (!i)
-		fail_exit("Failed to initialize\n");
-
-	/*
-	   Perform the requested operation
-	 */
-	if (!strcasecmp(op, "reboot")) {
-		printf("Rebooting machine @ IPMI:%s...", ip);
-		fflush(stdout);
-		if (!strcasecmp(method, "cycle")) {
-			ret = ipmi_op(i, ST_STATUS, power_status);
-
-			if (ret == STATE_OFF) {
-				/* State is off -> use onoff method because cycle is not able to turn on*/
-				snprintf(method, sizeof(method), "onoff");
-			}
-		}
-
-		if (!strcasecmp(method, "cycle")) {
-			ret = ipmi_cycle(i);
-		} else {
-			/* Original onoff method */
-			ret = ipmi_off(i);
-			translated_ret = (ret==0?ERR_OFF_SUCCESSFUL:ERR_OFF_FAIL);
-			if (ret != 0) {
-				goto out;
-			}
-			ret = ipmi_on(i);
-		}
-	} else if (!strcasecmp(op, "on")) {
-		printf("Powering on machine @ IPMI:%s...", ip);
-		fflush(stdout);
-		ret = ipmi_on(i);
-		translated_ret = (ret==0?ERR_ON_SUCCESSFUL:ERR_ON_FAIL);
-	} else if (!strcasecmp(op, "off")) {
-		printf("Powering off machine @ IPMI:%s...", ip);
-		fflush(stdout);
-		ret = ipmi_off(i);
-		translated_ret = (ret==0?ERR_ON_SUCCESSFUL:ERR_ON_FAIL);
-	} else if (!strcasecmp(op, "status") || !strcasecmp(op, "monitor")) {
-		printf("Getting status of IPMI:%s...",ip);
-		fflush(stdout);
-		ret = ipmi_op(i, ST_STATUS, power_status);
-		switch(ret) {
-		case STATE_ON:
-		  if (!strcasecmp(op, "status"))
-			    printf("Chassis power = On\n");
-			translated_ret = ERR_STATUS_ON;
-			ret = 0;
-			break;
-		case STATE_OFF:
-		  if (!strcasecmp(op, "status"))
-			    printf("Chassis power = Off\n");
-			translated_ret = ERR_STATUS_OFF;
-			ret = 0;
-			break;
-		default:
-		  if (!strcasecmp(op, "status"))
-			    printf("Chassis power = Unknown\n");
-			translated_ret = ERR_STATUS_FAIL;
-			ret = 1;
-			break;
-		}
-	} else if (!strcasecmp(op, "list")) {
-	  printf("%s\n","N/A");
-	  ret=0;
-	  translated_ret = ERR_OK;
-	  print_final_status=0;
-	} else if (!strcasecmp(op, "diag")) {
-	  printf("Pulsing diagnostic interrupt to machine @ IPMI:%s...", ip);
-	  fflush(stdout);
-	  ret = ipmi_diag(i);
-	  translated_ret = (ret==0?ERR_ON_SUCCESSFUL:ERR_ON_FAIL);
-	  ret = 0;
-	}
-
-
-out:
-	ipmi_destroy(i);
-	free(i);
-
-metaout:
-	if (print_final_status) {
-	  if (ret == 0)
-	    printf("Done\n");
-	  else
-	    printf("Failed\n");
-	}
-	
-        if (!strcasecmp(op, "diag")) {
-          /** .. but when a system receive the DIAG signal , it 
-           ** switches to a kdump kernel, but the machine is always
-           ** "on" during the dump phase. It only become temporarily
-           ** "off" at the end of the dump just before rebooting.
-           **/
-          translated_ret = 0;
-        }
-
-	return translated_ret;
-}
diff --git a/fence/agents/ldom/Makefile b/fence/agents/ldom/Makefile
deleted file mode 100644
index fb9de6c..0000000
--- a/fence/agents/ldom/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ldom
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ldom/fence_ldom.py b/fence/agents/ldom/fence_ldom.py
deleted file mode 100644
index 507a97a..0000000
--- a/fence/agents/ldom/fence_ldom.py
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/python
-
-##
-## The Following Agent Has Been Tested On - LDOM 1.0.3
-## The interface is backward compatible so it will work 
-## with 1.0, 1.0.1 and .2 too.
-## 
-#####
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="Logical Domains (LDoms) fence Agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-COMMAND_PROMPT_REG="\[PEXPECT\]$"
-COMMAND_PROMPT_NEW="[PEXPECT]"
-
-# Start comunicating after login. Prepare good environment.
-def start_communication(conn, options):
-	conn.sendline ("PS1='"+COMMAND_PROMPT_NEW+"'")
-	res=conn.expect([pexpect.TIMEOUT, COMMAND_PROMPT_REG],int(options["-Y"]))
-	if res==0:
-		#CSH stuff
-		conn.sendline("set prompt='"+COMMAND_PROMPT_NEW+"'")
-		conn.log_expect(options, COMMAND_PROMPT_REG,int(options["-Y"]))
-	
-
-def get_power_status(conn, options):
-	try:
-		start_communication(conn,options)
-		
-		conn.sendline("ldm ls")
-		    
-		conn.log_expect(options,COMMAND_PROMPT_REG,int(options["-Y"]))
-
-		result={}
-
-		#This is status of mini finite automata. 0 = we didn't found NAME and STATE, 1 = we did
-		fa_status=0
-		
-		for line in conn.before.splitlines():
-			domain=re.search("^(\S+)\s+(\S+)\s+.*$",line)
-
-			if (domain!=None):
-				if ((fa_status==0) and (domain.group(1)=="NAME") and (domain.group(2)=="STATE")):
-					fa_status=1
-				elif (fa_status==1):
-					result[domain.group(1)]=("",(domain.group(2).lower()=="bound" and "off" or "on"))
-
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	if (not (options["-o"] in ['monitor','list'])):
-		if (not (options["-n"] in result)):
-			fail_usage("Failed: You have to enter existing logical domain!")
-		else:
-			return result[options["-n"]][1]
-	else:
-		return result
-
-def set_power_status(conn, options):
-	try:
-		start_communication(conn,options)
-         	
-		cmd_line="ldm "+(options["-o"]=="on" and "start" or "stop -f")+" \""+options["-n"]+"\""
-            	
-		conn.sendline(cmd_line)
-		    
-		conn.log_expect(options,COMMAND_PROMPT_REG,int(options["-g"]))
-		
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-		
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure",  "identity_file", "test" , "port", "cmd_prompt",
-			"separator", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	pinput = process_input(device_opt)
-	pinput["-x"] = 1
-	options = check_input(device_opt, pinput)
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if (not options.has_key("-c")):
-		options["-c"] = "\ $"
-	
-	docs = { }
-	docs["shortdesc"] = "Fence agent for Sun LDOM"
-	docs["longdesc"] = "fence_ldom is an I/O Fencing agent \
-which can be used with LDoms virtual machines. This agent works \
-so, that run ldm command on host machine. So ldm must be directly \
-runnable.\
-\n.P\n\
-Very useful parameter is -c (or cmd_prompt in stdin mode). This \
-must be set to something, what is displayed after successful login \
-to host machine. Default string is space on end of string (default \
-for root in bash). But (for example) csh use ], so in that case you \
-must use parameter -c with argument ]. Very similar situation is, \
-if you use bash and login to host machine with other user than \
-root. Than prompt is $, so again, you must use parameter -c."
-	docs["vendorurl"] = "http://www.sun.com"
-	show_docs(options, docs)
-
-	##
-	## Operate the fencing device
-	####
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status,get_power_status)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.sendline("logout")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-
-	sys.exit(result)		
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/lib/Makefile b/fence/agents/lib/Makefile
deleted file mode 100644
index 2cccd98..0000000
--- a/fence/agents/lib/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fencing.py fencing_snmp.py
-
-FENCEAGENTSLIB= $(TARGET)
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl
deleted file mode 100644
index 563b3a4..0000000
--- a/fence/agents/lib/fence2man.xsl
+++ /dev/null
@@ -1,53 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="no"/>
-<xsl:template match="parameter">
-<xsl:param name="show" />
-.TP
-<xsl:if test="$show = 'getopt'">.B <xsl:value-of select="getopt/@mixed" /></xsl:if>
-<xsl:if test="$show = 'stdin'">.B <xsl:value-of select="@name"/></xsl:if>
-. 
-<xsl:value-of select="normalize-space(shortdesc)"/>
-<xsl:if test="not(content/@default)"><xsl:if test="@required = 1"> This parameter is always required.</xsl:if></xsl:if>
-<xsl:if test="content/@default"> (Default Value: <xsl:value-of select="content/@default"/>)</xsl:if>
-</xsl:template>
-
-<xsl:template match="action">
-.TP
-\fB<xsl:value-of select="@name"/> \fP
-<xsl:choose>
-<xsl:when test="@name = 'on'">Power on machine.</xsl:when>
-<xsl:when test="@name = 'off'">Power off machine.</xsl:when>
-<xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when>
-<xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when>
-<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when>
-<xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when>
-<xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when>
-<!-- Ehhh -->
-<xsl:otherwise> The operational behavior of this is not known.</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template match="/resource-agent">
-.TH FENCE_AGENT 8 2009-10-20 "<xsl:value-of select="@name"/> (Fence Agent)"
-.SH NAME
-<xsl:value-of select="@name" /> - <xsl:value-of select="@shortdesc" />
-.SH DESCRIPTION
-.P
-<xsl:value-of select="longdesc"/>
-.P
-<xsl:value-of select="@name" /> accepts options on the command line as well
-as from stdin. Fenced sends parameters through stdin when it execs the
-agent. <xsl:value-of select="@name" /> can be run by itself with command
-line options.  This is useful for testing and for turning outlets on or off
-from scripts.
-<xsl:if test="vendor-url">
-Vendor URL: <xsl:value-of select="vendor-url" />
-</xsl:if>
-.SH PARAMETERS
-<xsl:apply-templates select="parameters"><xsl:with-param name="show">getopt</xsl:with-param></xsl:apply-templates>
-.SH ACTIONS
-<xsl:apply-templates select="actions"/>
-.SH STDIN PARAMETERS
-<xsl:apply-templates select="parameters"><xsl:with-param name="show">stdin</xsl:with-param></xsl:apply-templates>
-</xsl:template>
-</xsl:stylesheet>
diff --git a/fence/agents/lib/fence2rng.xsl b/fence/agents/lib/fence2rng.xsl
deleted file mode 100644
index 8d23ed9..0000000
--- a/fence/agents/lib/fence2rng.xsl
+++ /dev/null
@@ -1,20 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="yes"/>
-<xsl:template name="capitalize">
-	<xsl:param name="value"/>
-	<xsl:variable name="normalized" select="translate($value, '_abcdefghijklmnopqrstuvwrxyz', '-ABCDEFGHIJKLMNOPQRSTUVWRXYZ')"/>
-	<xsl:value-of select="$normalized"/>
-</xsl:template>
-<xsl:template match="/resource-agent">
-      &lt;!-- <xsl:value-of select="@name"/> --&gt;
-      &lt;group&gt;
-        &lt;optional&gt;
-          &lt;attribute name="option"/&gt; &lt;!-- deprecated; for compatibility.  use "action" --&gt;
-        &lt;/optional&gt;<xsl:for-each select="parameters/parameter">
-        &lt;optional&gt;
-          &lt;attribute name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>" /&gt;
-        &lt;/optional&gt;</xsl:for-each>
-      &lt;/group&gt;
-
-</xsl:template>
-</xsl:stylesheet>
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
deleted file mode 100644
index 055a7f5..0000000
--- a/fence/agents/lib/fencing.py.py
+++ /dev/null
@@ -1,941 +0,0 @@
-#!/usr/bin/python
-
-import sys, getopt, time, os
-import pexpect, re
-import telnetlib
-import atexit
-import __main__
-
-## do not add code here.
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION = "New fence lib agent - test release on steroids"
-REDHAT_COPYRIGHT = ""
-BUILD_DATE = "March, 2008"
-#END_VERSION_GENERATION
-
-LOG_MODE_VERBOSE = 100
-LOG_MODE_QUIET = 0
-
-EC_GENERIC_ERROR   = 1
-EC_BAD_ARGS        = 2
-EC_LOGIN_DENIED    = 3
-EC_CONNECTION_LOST = 4
-EC_TIMED_OUT       = 5
-EC_WAITING_ON      = 6
-EC_WAITING_OFF     = 7
-EC_STATUS          = 8
-EC_STATUS_HMC      = 9
-
-TELNET_PATH = "/usr/bin/telnet"
-SSH_PATH    = "/usr/bin/ssh"
-SSL_PATH    = "@SBINDIR@/fence_nss_wrapper"
-
-all_opt = {
-	"help"    : {
-		"getopt" : "h",
-		"longopt" : "help",
-		"help" : "-h, --help                     Display this help and exit",
-		"required" : "0",
-		"shortdesc" : "Display help and exit",
-		"order" : 54 },
-	"version" : { 
-		"getopt" : "V",
-		"longopt" : "version",
-		"help" : "-V, --version                  Output version information and exit",
-		"required" : "0",
-		"shortdesc" : "Display version information and exit",
-		"order" : 53 },
-	"quiet"   : {
-		"getopt" : "q",
-		"help" : "",
-		"order" : 50 },
-	"verbose" : {
-		"getopt" : "v",
-		"longopt" : "verbose",
-		"help" : "-v, --verbose                  Verbose mode",
-		"required" : "0",
-		"shortdesc" : "Verbose mode",
-		"order" : 51 },
-	"debug" : {
-		"getopt" : "D:",
-		"longopt" : "debug-file", 
-		"help" : "-D, --debug-file=<debugfile>   Debugging to output file",
-		"required" : "0",
-		"shortdesc" : "Write debug information to given file",
-		"order" : 52 },
-	"delay" : {
-		"getopt" : "f:",
-		"longopt" : "delay",
-		"help" : "--delay <seconds>              Wait X seconds before fencing is started",
-		"required" : "0",
-		"shortdesc" : "Wait X seconds before fencing is started",
-		"default" : "0",
-		"order" : 200 },
-	"agent"   : {
-		"getopt" : "",
-		"help" : "",
-		"order" : 1 },
-	"web"    : {
-		"getopt" : "",
-		"help" : "",
-		"order" : 1 },
-	"action" : {
-		"getopt" : "o:",
-		"longopt" : "action",
-		"help" : "-o, --action=<action>          Action: status, reboot (default), off or on",
-		"required" : "1",
-		"shortdesc" : "Fencing Action",
-		"default" : "reboot",
-		"order" : 1 },
-	"io_fencing" : {
-		"getopt" : "o:",
-		"longopt" : "action",
-		"help" : "-o, --action=<action>          Action: status, enable or disable",
-		"required" : "1",
-		"shortdesc" : "Fencing Action",
-		"default" : "disable",
-		"order" : 1 },
-	"ipaddr" : {
-		"getopt" : "a:",
-		"longopt" : "ip",
-		"help" : "-a, --ip=<ip>                  IP address or hostname of fencing device",
-		"required" : "1",
-		"shortdesc" : "IP Address or Hostname",
-		"order" : 1 },
-	"ipport" : {
-		"getopt" : "u:",
-		"longopt" : "ipport",
-		"help" : "-u, --ipport=<port>            TCP port to use",
-		"required" : "0",
-		"shortdesc" : "TCP port to use for connection with device",
-		"order" : 1 },		
-	"login" : {
-		"getopt" : "l:",
-		"longopt" : "username",
-		"help" : "-l, --username=<name>          Login name",
-		"required" : "?",
-		"shortdesc" : "Login Name",
-		"order" : 1 },
-	"no_login" : {
-		"getopt" : "",
-		"help" : "",
-		"order" : 1 },
-	"no_password" : {
-		"getopt" : "",
-		"help" : "",
-		"order" : 1 },
-	"passwd" : {
-		"getopt" : "p:",
-		"longopt" : "password",
-		"help" : "-p, --password=<password>      Login password or passphrase",
-		"required" : "0",
-		"shortdesc" : "Login password or passphrase",
-		"order" : 1 },
-	"passwd_script" : {
-		"getopt" : "S:",
-		"longopt" : "password-script=",
-		"help" : "-S, --password-script=<script> Script to run to retrieve password",
-		"required" : "0",
-		"shortdesc" : "Script to retrieve password",
-		"order" : 1 },
-	"identity_file" : {
-		"getopt" : "k:",
-		"longopt" : "identity-file",
-		"help" : "-k, --identity-file=<filename> Identity file (private key) for ssh ",
-		"required" : "0",
-		"shortdesc" : "Identity file for ssh",
-		"order" : 1 },
-	"module_name" : {
-		"getopt" : "m:",
-		"longopt" : "module-name",
-		"help" : "-m, --module-name=<module>     DRAC/MC module name",
-		"required" : "0",
-		"shortdesc" : "DRAC/MC module name",
-		"order" : 1 },
-	"drac_version" : {
-		"getopt" : "d:",
-		"longopt" : "drac-version",
-		"help" : "-d, --drac-version=<version>   Force DRAC version to use",
-		"required" : "0",
-		"shortdesc" : "Force DRAC version to use",
-		"order" : 1 },
-	"hmc_version" : {
-		"getopt" : "H:",
-		"longopt" : "hmc-version",
-		"help" : "-H, --hmc-version=<version>    Force HMC version to use: 3, 4 (default)",
-		"required" : "0",
-		"shortdesc" : "Force HMC version to use (3 or 4)",
-		"default" : "4", 
-		"order" : 1 },
-	"ribcl" : {
-		"getopt" : "r:",
-		"longopt" : "ribcl-version",
-		"help" : "-r, --ribcl-version=<version>  Force ribcl version to use",
-		"required" : "0",
-		"shortdesc" : "Force ribcl version to use",
-		"order" : 1 },
-	"login_eol_lf" : {
-		"getopt" : "",
-		"help" : "",
-		"order" : 1
-		},
-	"cmd_prompt" : {
-		"getopt" : "c:",
-		"longopt" : "command-prompt",
-		"help" : "-c, --command-prompt=<prompt>  Force command prompt",
-		"shortdesc" : "Force command prompt",
-		"required" : "0",
-		"order" : 1 },
-	"secure" : {
-		"getopt" : "x",
-		"longopt" : "ssh",
-		"help" : "-x, --ssh                      Use ssh connection",
-		"shortdesc" : "SSH connection",
-		"required" : "0",
-		"order" : 1 },
-	"ssl" : {
-		"getopt" : "z",
-		"longopt" : "ssl",
-		"help" : "-z, --ssl                      Use ssl connection",
-		"required" : "0",
-		"shortdesc" : "SSL connection",
-		"order" : 1 },
-	"port" : {
-		"getopt" : "n:",
-		"longopt" : "plug",
-		"help" : "-n, --plug=<id>                Physical plug number on device or\n" + 
-        "                                        name of virtual machine",
-		"required" : "1",
-		"shortdesc" : "Physical plug number or name of virtual machine",
-		"order" : 1 },
-	"switch" : {
-		"getopt" : "s:",
-		"longopt" : "switch",
-		"help" : "-s, --switch=<id>              Physical switch number on device",
-		"required" : "0",
-		"shortdesc" : "Physical switch number on device",
-		"order" : 1 },
-	"suborg" : {
-		"getopt" : "s:",
-		"longopt" : "suborg",
-		"help" : "--suborg=<path>                Additional path needed to access suborganization",
-		"required" : "0",
-		"shortdesc" : "Additional path needed to access suborganization",
-		"default" : "",
-		"order" : 1 },
-	"partition" : {
-		"getopt" : "n:",
-		"help" : "-n <id>                        Name of the partition",
-		"required" : "0",
-		"shortdesc" : "Partition name",
-		"order" : 1 },
-	"managed" : {
-		"getopt" : "s:",
-		"help" : "-s <id>                        Name of the managed system",
-		"required" : "0",
-		"shortdesc" : "Managed system name",
-		"order" : 1 },
-	"test" : {
-		"getopt" : "T",
-		"help" : "",
-		"order" : 1,
-		"obsolete" : "use -o status instead" },
-	"exec" : {
-		"getopt" : "e:",
-		"longopt" : "exec",
-		"help" : "-e, --exec=<command>           Command to execute",
-		"required" : "0",
-		"shortdesc" : "Command to execute",
-		"order" : 1 },
-	"vmware_type" : {
-		"getopt" : "d:",
-		"longopt" : "vmware_type",
-		"help" : "-d, --vmware_type=<type>       Type of VMware to connect",
-		"required" : "0",
-		"shortdesc" : "Type of VMware to connect",
-		"order" : 1 },
-	"vmware_datacenter" : {
-		"getopt" : "s:",
-		"longopt" : "vmware-datacenter",
-		"help" : "-s, --vmware-datacenter=<dc>   VMWare datacenter filter",
-		"required" : "0",
-		"shortdesc" : "Show only machines in specified datacenter",
-		"order" : 2 },
-	"snmp_version" : {
-		"getopt" : "d:",
-		"longopt" : "snmp-version",
-		"help" : "-d, --snmp-version=<ver>       Specifies SNMP version to use",
-		"required" : "0",
-		"shortdesc" : "Specifies SNMP version to use (1,2c,3)",
-		"order" : 1 },
-	"community" : {
-		"getopt" : "c:",
-		"longopt" : "community",
-		"help" : "-c, --community=<community>    Set the community string",
-		"required" : "0",
-		"shortdesc" : "Set the community string",
-		"order" : 1},
-	"snmp_auth_prot" : {
-		"getopt" : "b:",
-		"longopt" : "snmp-auth-prot",
-		"help" : "-b, --snmp-auth-prot=<prot>    Set authentication protocol (MD5|SHA)",
-		"required" : "0",
-		"shortdesc" : "Set authentication protocol (MD5|SHA)",
-		"order" : 1},
-	"snmp_sec_level" : {
-		"getopt" : "E:",
-		"longopt" : "snmp-sec-level",
-		"help" : "-E, --snmp-sec-level=<level>   Set security level\n"+
-		"                                  (noAuthNoPriv|authNoPriv|authPriv)",
-		"required" : "0",
-		"shortdesc" : "Set security level (noAuthNoPriv|authNoPriv|authPriv)",
-		"order" : 1},
-	"snmp_priv_prot" : {
-		"getopt" : "B:",
-		"longopt" : "snmp-priv-prot",
-		"help" : "-B, --snmp-priv-prot=<prot>    Set privacy protocol (DES|AES)",
-		"required" : "0",
-		"shortdesc" : "Set privacy protocol (DES|AES)",
-		"order" : 1},
-	"snmp_priv_passwd" : {
-		"getopt" : "P:",
-		"longopt" : "snmp-priv-passwd",
-		"help" : "-P, --snmp-priv-passwd=<pass>  Set privacy protocol password",
-		"required" : "0",
-		"shortdesc" : "Set privacy protocol password",
-		"order" : 1},
-	"snmp_priv_passwd_script" : {
-		"getopt" : "R:",
-		"longopt" : "snmp-priv-passwd-script",
-		"help" : "-R, --snmp-priv-passwd-script  Script to run to retrieve privacy password",
-		"required" : "0",
-		"shortdesc" : "Script to run to retrieve privacy password",
-		"order" : 1},
-	"inet4_only" : {
-		"getopt" : "4",
-		"longopt" : "inet4-only",
-		"help" : "-4, --inet4-only               Forces agent to use IPv4 addresses only",
-		"required" : "0",
-		"shortdesc" : "Forces agent to use IPv4 addresses only",
-		"order" : 1 },
-	"inet6_only" : {
-		"getopt" : "6",
-		"longopt" : "inet6-only",
-		"help" : "-6, --inet6-only               Forces agent to use IPv6 addresses only",
-		"required" : "0",
-		"shortdesc" : "Forces agent to use IPv6 addresses only",
-		"order" : 1 },
-	"udpport" : {
-		"getopt" : "u:",
-		"longopt" : "udpport",
-		"help" : "-u, --udpport                  UDP/TCP port to use",
-		"required" : "0",
-		"shortdesc" : "UDP/TCP port to use for connection with device",
-		"order" : 1},
-	"separator" : {
-		"getopt" : "C:",
-		"longopt" : "separator",
-		"help" : "-C, --separator=<char>         Separator for CSV created by 'list' operation",
-		"default" : ",", 
-		"required" : "0",
-		"shortdesc" : "Separator for CSV created by operation list",
-		"order" : 100 },
-	"login_timeout" : {
-		"getopt" : "y:",
-		"longopt" : "login-timeout",
-		"help" : "--login-timeout <seconds>      Wait X seconds for cmd prompt after login",
-		"default" : "5", 
-		"required" : "0",
-		"shortdesc" : "Wait X seconds for cmd prompt after login",
-		"order" : 200 },
-	"shell_timeout" : {
-		"getopt" : "Y:",
-		"longopt" : "shell-timeout",
-		"help" : "--shell-timeout <seconds>      Wait X seconds for cmd prompt after issuing command",
-		"default" : "3", 
-		"required" : "0",
-		"shortdesc" : "Wait X seconds for cmd prompt after issuing command",
-		"order" : 200 },
-	"power_timeout" : {
-		"getopt" : "g:",
-		"longopt" : "power-timeout",
-		"help" : "--power-timeout <seconds>      Test X seconds for status change after ON/OFF",
-		"default" : "20", 
-		"required" : "0",
-		"shortdesc" : "Test X seconds for status change after ON/OFF",
-		"order" : 200 },
-	"power_wait" : {
-		"getopt" : "G:",
-		"longopt" : "power-wait",
-		"help" : "--power-wait <seconds>         Wait X seconds after issuing ON/OFF",
-		"default" : "0", 
-		"required" : "0",
-		"shortdesc" : "Wait X seconds after issuing ON/OFF",
-		"order" : 200 },
-	"missing_as_off" : {
-		"getopt" : "M",
-		"longopt" : "missing-as-off",
-		"help" : "--missing-as-off               Missing port returns OFF instead of failure",
-		"required" : "0",
-		"shortdesc" : "Missing port returns OFF instead of failure",
-		"order" : 200 },
-	"retry_on" : {
-		"getopt" : "F:",
-		"longopt" : "retry-on",
-		"help" : "--retry-on <attempts>          Count of attempts to retry power on",
-		"default" : "1",
-		"required" : "0",
-		"shortdesc" : "Count of attempts to retry power on",
-		"order" : 200 }
-}
-
-common_opt = [ "retry_on", "delay" ]
-
-class fspawn(pexpect.spawn):
-	def log_expect(self, options, pattern, timeout):
-		result = self.expect(pattern, timeout)
-		if options["log"] >= LOG_MODE_VERBOSE:
-			options["debug_fh"].write(self.before + self.after)
-		return result
-
-def atexit_handler():
-	try:
-		sys.stdout.close()
-		os.close(1)
-	except IOError:
-		sys.stderr.write("%s failed to close standard output\n"%(sys.argv[0]))
-		sys.exit(EC_GENERIC_ERROR)
-
-def version(command, release, build_date, copyright_notice):
-	print command, " ", release, " ", build_date
-	if len(copyright_notice) > 0:
-		print copyright_notice
-
-def fail_usage(message = ""):
-	if len(message) > 0:
-		sys.stderr.write(message+"\n")
-	sys.stderr.write("Please use '-h' for usage\n")
-	sys.exit(EC_GENERIC_ERROR)
-
-def fail(error_code):
-	message = {
-		EC_LOGIN_DENIED : "Unable to connect/login to fencing device",
-		EC_CONNECTION_LOST : "Connection lost",
-		EC_TIMED_OUT : "Connection timed out",
-		EC_WAITING_ON : "Failed: Timed out waiting to power ON",
-		EC_WAITING_OFF : "Failed: Timed out waiting to power OFF",
-		EC_STATUS : "Failed: Unable to obtain correct plug status or plug is not available",
-		EC_STATUS_HMC : "Failed: Either unable to obtaion correct plug status, partition is not available or incorrect HMC version used"
-	}[error_code] + "\n"
-	sys.stderr.write(message)
-	sys.exit(EC_GENERIC_ERROR)
-
-def usage(avail_opt):
-	global all_opt
-
-	print "Usage:"
-	print "\t" + os.path.basename(sys.argv[0]) + " [options]"
-	print "Options:"
-
-	sorted_list = [ (key, all_opt[key]) for key in avail_opt ]
-	sorted_list.sort(lambda x, y: cmp(x[1]["order"], y[1]["order"]))
-
-	for key, value in sorted_list:
-		if len(value["help"]) != 0:
-			print "   " + value["help"]
-
-def metadata(avail_opt, options, docs):
-	global all_opt
-
-	sorted_list = [ (key, all_opt[key]) for key in avail_opt ]
-	sorted_list.sort(lambda x, y: cmp(x[1]["order"], y[1]["order"]))
-
-	print "<?xml version=\"1.0\" ?>"
-	print "<resource-agent name=\"" + os.path.basename(sys.argv[0]) + "\" shortdesc=\"" + docs["shortdesc"] + "\" >"
-	print "<longdesc>" + docs["longdesc"] + "</longdesc>"
-	if docs.has_key("vendorurl"):
-		print "<vendor-url>" + docs["vendorurl"] + "</vendor-url>"
-	print "<parameters>"
-	for option, value in sorted_list:
-		if all_opt[option].has_key("shortdesc"):
-			print "\t<parameter name=\"" + option + "\" unique=\"1\" required=\"" + all_opt[option]["required"] + "\">"
-
-			default = ""
-			if all_opt[option].has_key("default"):
-				default = "default=\""+str(all_opt[option]["default"])+"\""
-			elif options.has_key("-" + all_opt[option]["getopt"][:-1]):
-				if options["-" + all_opt[option]["getopt"][:-1]]:
-					try:
-						default = "default=\"" + options["-" + all_opt[option]["getopt"][:-1]] + "\""
-					except TypeError:
-						## @todo/@note: Currently there is no clean way how to handle lists
-						## we can create a string from it but we can't set it on command line
-						default = "default=\"" + str(options["-" + all_opt[option]["getopt"][:-1]]) +"\""
-			elif options.has_key("-" + all_opt[option]["getopt"]):
-				default = "default=\"true\" "
-
-			mixed = all_opt[option]["help"]
-			## split it between option and help text
-			res = re.compile("^(.*--\S+)\s+", re.IGNORECASE | re.S).search(mixed)
-			if (None != res):
-				mixed = res.group(1)
-			mixed = mixed.replace("<", "&lt;").replace(">", "&gt;")
-			print "\t\t<getopt mixed=\"" + mixed + "\" />"
-
-			if all_opt[option]["getopt"].count(":") > 0:
-				print "\t\t<content type=\"string\" "+default+" />"
-			else:
-				print "\t\t<content type=\"boolean\" "+default+" />"
-				
-			print "\t\t<shortdesc lang=\"en\">" + all_opt[option]["shortdesc"] + "</shortdesc>"
-			print "\t</parameter>"
-	print "</parameters>"
-	print "<actions>"
-	if avail_opt.count("io_fencing") == 0:
-		print "\t<action name=\"on\" />"
-		print "\t<action name=\"off\" />"
-		print "\t<action name=\"reboot\" />"
-	else:
-		print "\t<action name=\"enable\" />"
-		print "\t<action name=\"disable\" />"	
-
-	print "\t<action name=\"status\" />"
-	print "\t<action name=\"list\" />"
-	print "\t<action name=\"monitor\" />"
-	print "\t<action name=\"metadata\" />"	
-	print "</actions>"
-	print "</resource-agent>"
-
-def process_input(avail_opt):
-	global all_opt
-	global common_opt
-
-	##
-	## Add options which are available for every fence agent
-	#####
-	avail_opt.extend(common_opt)
-
-	##
-	## Set standard environment
-	#####
-	os.putenv("LANG", "C")
-	os.putenv("LC_ALL", "C")
-
-	##
-	## Prepare list of options for getopt
-	#####
-	getopt_string = ""
-	longopt_list = [ ]
-	for k in avail_opt:
-		if all_opt.has_key(k):
-			getopt_string += all_opt[k]["getopt"]
-		else:
-			fail_usage("Parse error: unknown option '"+k+"'")
-
-		if all_opt.has_key(k) and all_opt[k].has_key("longopt"):
-			if all_opt[k]["getopt"].endswith(":"):
-				longopt_list.append(all_opt[k]["longopt"] + "=")
-			else:
-				longopt_list.append(all_opt[k]["longopt"])
-
-	## Compatibility layer
-	if avail_opt.count("module_name") == 1:
-		getopt_string += "n:"
-		longopt_list.append("plug=")
-	
-	##
-	## Read options from command line or standard input
-	#####
-	if len(sys.argv) > 1:
-		try:
-			opt, args = getopt.gnu_getopt(sys.argv[1:], getopt_string, longopt_list)
-		except getopt.GetoptError, error:
-			fail_usage("Parse error: " + error.msg)
-
-		## Transform longopt to short one which are used in fencing agents
-		#####
-		old_opt = opt
-		opt = { }
-		for o in dict(old_opt).keys():
-			if o.startswith("--"):
-				for x in all_opt.keys():
-					if all_opt[x].has_key("longopt") and "--" + all_opt[x]["longopt"] == o:
-						opt["-" + all_opt[x]["getopt"].rstrip(":")] = dict(old_opt)[o]
-			else:
-				opt[o] = dict(old_opt)[o]
-
-		## Compatibility Layer
-		#####
-		z = dict(opt)
-		if z.has_key("-T") == 1:
-			z["-o"] = "status"
-		if z.has_key("-n") == 1:
-			z["-m"] = z["-n"]
-
-		opt = z
-		##
-		#####
-	else:
-		opt = { }
-		name = ""
-		for line in sys.stdin.readlines():
-			line = line.strip()
-			if ((line.startswith("#")) or (len(line) == 0)):
-				continue
-
-			(name, value) = (line + "=").split("=", 1)
-			value = value[:-1]
-
-			## Compatibility Layer
-			######
-			if name == "blade":
-				name = "port"
-			elif name == "option":
-				name = "action"
-			elif name == "fm":
-				name = "port"
-			elif name == "hostname":
-				name = "ipaddr"
-			elif name == "modulename":
-				name = "module_name"
-			elif name == "action" and 1 == avail_opt.count("io_fencing"):
-				name = "io_fencing"
-			elif name == "port" and 1 == avail_opt.count("drac_version"):
-				name = "module_name"
-
-			##
-			######
-			if avail_opt.count(name) == 0:
-				sys.stderr.write("Parse error: Ignoring unknown option '"+line+"'\n")
-				continue
-
-			if all_opt[name]["getopt"].endswith(":"):
-				opt["-"+all_opt[name]["getopt"].rstrip(":")] = value
-			elif ((value == "1") or (value.lower() == "yes") or (value.lower() == "on") or (value.lower() == "true")):
-				opt["-"+all_opt[name]["getopt"]] = "1"
-	return opt
-
-##
-## This function checks input and answers if we want to have same answers 
-## in each of the fencing agents. It looks for possible errors and run
-## password script to set a correct password
-######
-def check_input(device_opt, opt):
-	global all_opt
-	global common_opt
-
-	##
-	## Add options which are available for every fence agent
-	#####
-	device_opt.extend([x for x in common_opt if device_opt.count(x) == 0])
-	
-	options = dict(opt)
-	options["device_opt"] = device_opt
-
-	## Set requirements that should be included in metadata
-	#####
-	if device_opt.count("login") and device_opt.count("no_login") == 0:
-		all_opt["login"]["required"] = "1"
-	else:
-		all_opt["login"]["required"] = "0"
-
-	## In special cases (show help, metadata or version) we don't need to check anything
-	#####
-	if options.has_key("-h") or options.has_key("-V") or (options.has_key("-o") and options["-o"].lower() == "metadata"):
-		return options;
-
-	## Set default values
-	#####
-	for opt in device_opt:
-		if all_opt[opt].has_key("default"):
-			getopt = "-" + all_opt[opt]["getopt"].rstrip(":")
-			if 0 == options.has_key(getopt):
-				options[getopt] = all_opt[opt]["default"]
-
-	options["-o"]=options["-o"].lower()
-
-	if options.has_key("-v"):
-		options["log"] = LOG_MODE_VERBOSE
-	else:
-		options["log"] = LOG_MODE_QUIET
-
-	if 0 == device_opt.count("io_fencing"):
-		if 0 == ["on", "off", "reboot", "status", "list", "monitor"].count(options["-o"].lower()):
-			fail_usage("Failed: Unrecognised action '" + options["-o"] + "'")
-	else:
-		if 0 == ["enable", "disable", "status", "list", "monitor"].count(options["-o"].lower()):
-			fail_usage("Failed: Unrecognised action '" + options["-o"] + "'")
-		
-	if (0 == options.has_key("-l")) and device_opt.count("login") and (device_opt.count("no_login") == 0):
-		fail_usage("Failed: You have to set login name")
-
-	if 0 == options.has_key("-a"):
-		fail_usage("Failed: You have to enter fence address")
-
-	if (device_opt.count("no_password") == 0):
-		if 0 == device_opt.count("identity_file"):
-			if 0 == (options.has_key("-p") or options.has_key("-S")):
-				fail_usage("Failed: You have to enter password or password script")
-			else: 
-				if 0 == (options.has_key("-p") or options.has_key("-S") or options.has_key("-k")):
-					fail_usage("Failed: You have to enter password, password script or identity file")
-
-	if 0 == options.has_key("-x") and 1 == options.has_key("-k"):
-		fail_usage("Failed: You have to use identity file together with ssh connection (-x)")
-
-	if 1 == options.has_key("-k"):
-		if 0 == os.path.isfile(options["-k"]):
-			fail_usage("Failed: Identity file " + options["-k"] + " does not exist")
-
-	if (0 == ["list", "monitor"].count(options["-o"].lower())) and (0 == options.has_key("-n")) and (device_opt.count("port")):
-		fail_usage("Failed: You have to enter plug number")
-
-	if options.has_key("-S"):
-		options["-p"] = os.popen(options["-S"]).read().rstrip()
-
-	if options.has_key("-D"):
-		try:
-			options["debug_fh"] = file (options["-D"], "w")
-		except IOError:
-			fail_usage("Failed: Unable to create file "+options["-D"])
-
-	if options.has_key("-v") and options.has_key("debug_fh") == 0:
-		options["debug_fh"] = sys.stderr
-
-	if options.has_key("-R"):
-		options["-P"] = os.popen(options["-R"]).read().rstrip()
-
-	if options.has_key("-u") == False:
-		if options.has_key("-x"):
-			options["-u"] = 22
-		elif options.has_key("-z"):
-			options["-u"] = 443
-		elif device_opt.count("web"):
-			options["-u"] = 80
-		else:
-			options["-u"] = 23
-
-	return options
-	
-def wait_power_status(tn, options, get_power_fn):
-	for dummy in xrange(int(options["-g"])):
-		if get_power_fn(tn, options) != options["-o"]:
-			time.sleep(1)
-		else:
-			return 1
-	return 0
-
-def show_docs(options, docs = None):
-	device_opt = options["device_opt"]
-
-	if docs == None:
-		docs = { }
-		docs["shortdesc"] = "Fence agent"
-		docs["longdesc"] = ""
-	
-	## Process special options (and exit)
-	#####
-	if options.has_key("-h"): 
-		usage(device_opt)
-		sys.exit(0)
-
-	if options.has_key("-o") and options["-o"].lower() == "metadata":
-		metadata(device_opt, options, docs)
-		sys.exit(0)
-
-	if options.has_key("-V"):
-		print __main__.RELEASE_VERSION, __main__.BUILD_DATE
-		print __main__.REDHAT_COPYRIGHT
-		sys.exit(0)
-
-def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None):
-	result = 0
-	
-	## Process options that manipulate fencing device
-	#####
-	if (options["-o"] == "list") and (0 == options["device_opt"].count("port")) and (0 == options["device_opt"].count("partition")):
-		print "N/A"
-		return
-	elif (options["-o"] == "list" and get_outlet_list == None):
-		## @todo: exception?
-		## This is just temporal solution, we will remove default value
-		## None as soon as all existing agent will support this operation 
-		print "NOTICE: List option is not working on this device yet"
-		return
-	elif (options["-o"] == "list") or ((options["-o"] == "monitor") and 1 == options["device_opt"].count("port")):
-		outlets = get_outlet_list(tn, options)
-		## keys can be numbers (port numbers) or strings (names of VM)
-		for o in outlets.keys():
-			(alias, status) = outlets[o]
-			if options["-o"] != "monitor":
-				print o + options["-C"] + alias	
-		return
-
-	if options["-o"] in ["off", "reboot"]:
-		time.sleep(int(options["-f"]))
-	status = get_power_fn(tn, options)
-
-	if status != "on" and status != "off":  
-		fail(EC_STATUS)
-
-	
-	if options["-o"] == "enable":
-		options["-o"] = "on"
-	if options["-o"] == "disable":
-		options["-o"] = "off"
-
-	if options["-o"] == "on":
-		if status == "on":
-			print "Success: Already ON"
-		else:
-			power_on = False
-			for i in range(1,1 + int(options["-F"])):
-				set_power_fn(tn, options)
-				time.sleep(int(options["-G"]))
-				if wait_power_status(tn, options, get_power_fn):
-					power_on = True
-					break
-
-			if power_on:
-				print "Success: Powered ON"
-			else:
-				fail(EC_WAITING_ON)
-	elif options["-o"] == "off":
-		if status == "off":
-			print "Success: Already OFF"
-		else:
-			set_power_fn(tn, options)
-			time.sleep(int(options["-G"]))
-			if wait_power_status(tn, options, get_power_fn):
-				print "Success: Powered OFF"
-			else:
-				fail(EC_WAITING_OFF)
-	elif options["-o"] == "reboot":
-		if status != "off":
-			options["-o"] = "off"
-			set_power_fn(tn, options)
-			time.sleep(int(options["-G"]))
-			if wait_power_status(tn, options, get_power_fn) == 0:
-				fail(EC_WAITING_OFF)
-		options["-o"] = "on"
-
-		power_on = False
-		for i in range(1,1 + int(options["-F"])):
-			set_power_fn(tn, options)
-			time.sleep(int(options["-G"]))
-			if wait_power_status(tn, options, get_power_fn) == 1:
-				power_on = True
-				break
-
-		if power_on == False:
-			# this should not fail as not was fenced succesfully
-			sys.stderr.write('Timed out waiting to power ON\n')
-
-		print "Success: Rebooted"
-	elif options["-o"] == "status":
-		print "Status: " + status.upper()
-		if status.upper() == "OFF":
-			result = 2
-	elif options["-o"] == "monitor":
-		1
-	
-	return result
-
-def fence_login(options):
-	force_ipvx=""
-
-	if (options.has_key("-6")):
-		force_ipvx="-6 "
-
-	if (options.has_key("-4")):
-		force_ipvx="-4 "
-
-	if (options["device_opt"].count("login_eol_lf")):
-		login_eol = "\n"
-	else:
-		login_eol = "\r\n"
-
-	try:
-		re_login = re.compile("(login\s*: )|(Login Name:  )|(username: )|(User Name :)", re.IGNORECASE)
-		re_pass  = re.compile("password", re.IGNORECASE)
-
-		if options.has_key("-z"):
-			command = '%s %s %s %s' % (SSL_PATH, force_ipvx, options["-a"], options["-u"])
-			try:
-				conn = fspawn(command)
-			except pexpect.ExceptionPexpect, ex:
-			 	## SSL telnet is part of the fencing package
-			 	sys.stderr.write(str(ex) + "\n")
-			 	sys.exit(EC_GENERIC_ERROR)
-		elif options.has_key("-x") and 0 == options.has_key("-k"):
-			command = '%s %s %s@%s -p %s' % (SSH_PATH, force_ipvx, options["-l"], options["-a"], options["-u"])
-			if options.has_key("ssh_options"):
-				command += ' ' + options["ssh_options"]
-			try:
-				conn = fspawn(command)
-			except pexpect.ExceptionPexpect, ex:
-				sys.stderr.write(str(ex) + "\n")
-				sys.stderr.write("Due to limitations, binary dependencies on fence agents "
-				"are not in the spec file and must be installed separately." + "\n")
-				sys.exit(EC_GENERIC_ERROR)
-				
-			if options.has_key("telnet_over_ssh"):
-				#This is for stupid ssh servers (like ALOM) which behave more like telnet (ignore name and display login prompt)
-				result = conn.log_expect(options, [ re_login, "Are you sure you want to continue connecting (yes/no)?" ], int(options["-y"]))
-				if result == 1:
-					conn.sendline("yes") # Host identity confirm
-					conn.log_expect(options, re_login, int(options["-y"]))
-
-				conn.sendline(options["-l"])
-				conn.log_expect(options, re_pass, int(options["-y"]))
-			else:
-				result = conn.log_expect(options, [ "ssword:", "Are you sure you want to continue connecting (yes/no)?" ], int(options["-y"]))
-				if result == 1:
-					conn.sendline("yes")
-					conn.log_expect(options, "ssword:", int(options["-y"]))
-
-			conn.sendline(options["-p"])
-			conn.log_expect(options, options["-c"], int(options["-y"]))
-		elif options.has_key("-x") and 1 == options.has_key("-k"):
-			command = '%s %s %s@%s -i %s -p %s' % (SSH_PATH, force_ipvx, options["-l"], options["-a"], options["-k"], options["-u"])
-			if options.has_key("ssh_options"):
-				command += ' ' + options["ssh_options"]
-			try:
-				conn = fspawn(command)
-			except pexpect.ExceptionPexpect, ex:
-				sys.stderr.write(str(ex) + "\n")
-				sys.stderr.write("Due to limitations, binary dependencies on fence agents "
-				"are not in the spec file and must be installed separately." + "\n")
-				sys.exit(EC_GENERIC_ERROR)
-
-			result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], int(options["-y"]))
-			if result == 1:
-				conn.sendline("yes")
-				conn.log_expect(options, [ options["-c"], "Enter passphrase for key '"+options["-k"]+"':"] , int(options["-y"]))
-			if result != 0:
-				if options.has_key("-p"):
-					conn.sendline(options["-p"])
-					conn.log_expect(options, options["-c"], int(options["-y"]))
-				else:
-					fail_usage("Failed: You have to enter passphrase (-p) for identity file")
-		else:
-			try:
-				conn = fspawn(TELNET_PATH)
-				conn.send("set binary\n")
-				conn.send("open %s -%s\n"%(options["-a"], options["-u"]))
-			except pexpect.ExceptionPexpect, ex:
-				sys.stderr.write(str(ex) + "\n")
-				sys.stderr.write("Due to limitations, binary dependencies on fence agents "
-				"are not in the spec file and must be installed separately." + "\n")
-				sys.exit(EC_GENERIC_ERROR)
-
-			conn.log_expect(options, re_login, int(options["-y"]))
-			conn.send(options["-l"] + login_eol)
-			conn.log_expect(options, re_pass, int(options["-Y"]))
-			conn.send(options["-p"] + login_eol)
-			conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_LOGIN_DENIED) 
-	except pexpect.TIMEOUT:
-		fail(EC_LOGIN_DENIED)
-	return conn
diff --git a/fence/agents/lib/fencing_snmp.py.py b/fence/agents/lib/fencing_snmp.py.py
deleted file mode 100644
index 4f55795..0000000
--- a/fence/agents/lib/fencing_snmp.py.py
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/python
-
-# For example of use please see fence_cisco_mds
-
-import re,pexpect
-from fencing import *
-
-## do not add code here.
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION = ""
-REDHAT_COPYRIGHT = ""
-BUILD_DATE = ""
-#END_VERSION_GENERATION
-
-# Fix for RHBZ#527844
-def snmp_define_defaults ():
-	all_opt["udpport"]["default"]="161"
-	all_opt["ipport"]["default"]="161"
-
-class FencingSnmp:
-	def __init__(self,options):
-		self.options=options
-
-	# Log message if user set verbose option
-	def log_command(self, message):
-		if self.options["log"] >= LOG_MODE_VERBOSE:
-			self.options["debug_fh"].write(message+"\n")
-
-	def quote_for_run(self,str):
-		return ''.join(map(lambda x:x==r"'" and "'\\''" or x,str))
-
-	def complete_missed_params(self):
-		mapping=[
-			[['P','p','!E'],'self.options["-E"]="authPriv"'],
-			[['!d','c','!l','!P','!p'],'self.options["-d"]="2c"']
-			]
-
-		for val in mapping:
-			e=val[0]
-
-			res=True
-
-			for item in e:
-				if ((item[0]=='!') and (self.options.has_key("-"+item[1]))):
-					res=False
-					break
-
-				if ((item[0]!='!') and (not self.options.has_key("-"+item[0]))):
-					res=False
-					break
-
-			if res:
-				exec(val[1])
-
-	def prepare_cmd(self,command):
-		cmd="@SNMPBIN@/%s -m '' -Oeqn "%(command)
-
-		self.complete_missed_params()
-
-		#mapping from our option to snmpcmd option
-		mapping=(('d','v'),('c','c'))
-
-		for item in mapping:
-			if (self.options.has_key("-"+item[0])):
-				cmd+=" -%s '%s'"%(item[1],self.quote_for_run(self.options["-"+item[0]]))
-
-		# Some options make sense only for v3 (and for v1/2c can cause "problems")
-		if (self.options.has_key("-d")) and (self.options["-d"] == "3"):
-			# Mapping from our options to snmpcmd options for v3
-			mapping_v3=(('b','a'),('E','l'),('B','x'),('P','X'),('p','A'),('l','u'))
-			for item in mapping_v3:
-				if (self.options.has_key("-"+item[0])):
-					cmd+=" -%s '%s'"%(item[1],self.quote_for_run(self.options["-"+item[0]]))
-
-		force_ipvx=""
-
-		if (self.options.has_key("-6")):
-			force_ipvx="udp6:"
-
-		if (self.options.has_key("-4")):
-			force_ipvx="udp:"
-
-		cmd+=" '%s%s%s'"%(force_ipvx, self.quote_for_run(self.options["-a"]),
-				self.options.has_key("-u") and self.quote_for_run(":" + str (self.options["-u"])) or "")
-		return cmd
-
-	def run_command(self,command,additional_timemout=0):
-		try:
-			self.log_command(command)
-
-			(res_output,res_code)=pexpect.run(command,int(self.options["-Y"])+int(self.options["-y"])+additional_timemout,True)
-
-			if (res_code==None):
-				fail(EC_TIMED_OUT)
-
-			self.log_command(res_output)
-
-			if (res_code!=0) or (re.search("^Error ", res_output, re.MULTILINE) != None):
-				fail_usage("Returned %d: %s"%(res_code,res_output))
-		except pexpect.ExceptionPexpect:
-			fail_usage("Cannot run command %s"%(command))
-
-		return res_output
-
-	def get(self,oid,additional_timemout=0):
-		cmd="%s '%s'"%(self.prepare_cmd("snmpget"),self.quote_for_run(oid))
-
-		output=self.run_command(cmd,additional_timemout).splitlines()
-
-		return output[len(output)-1].split(None,1)
-
-	def set(self,oid,value,additional_timemout=0):
-		mapping=((int,'i'),(str,'s'))
-
-		type=''
-
-		for item in mapping:
-			if (isinstance(value,item[0])):
-				type=item[1]
-				break
-
-		cmd="%s '%s' %s '%s'"%(self.prepare_cmd("snmpset"),self.quote_for_run(oid),type,self.quote_for_run(str(value)))
-
-		self.run_command(cmd,additional_timemout)
-
-	def walk(self,oid,additional_timemout=0):
-		cmd="%s '%s'"%(self.prepare_cmd("snmpwalk"),self.quote_for_run(oid))
-
-		output=self.run_command(cmd,additional_timemout).splitlines()
-
-		return map(lambda x:x.split(None,1),filter(lambda y:len(y)>0 and y[0]=='.',output))
diff --git a/fence/agents/lpar/Makefile b/fence/agents/lpar/Makefile
deleted file mode 100644
index 2ee6491..0000000
--- a/fence/agents/lpar/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_lpar
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
deleted file mode 100644
index 00ea66c..0000000
--- a/fence/agents/lpar/fence_lpar.py
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  Version       
-## +---------------------------------------------+
-##  Tested on HMC
-##
-#####
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION=""
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	if options["-H"] == "3":
-		try:
-			conn.send("lssyscfg -r lpar -m " + options["-s"] + " -n " + options["-n"] + " -F name,state\n")
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-		except pexpect.EOF:
-			fail(EC_CONNECTION_LOST)
-		except pexpect.TIMEOUT:
-			fail(EC_TIMED_OUT)
-
-		try:
-			status = re.compile("^" + options["-n"] + ",(.*?),.*$", re.IGNORECASE | re.MULTILINE).search(conn.before).group(1)
-		except AttributeError:
-			fail(EC_STATUS_HMC)
-	elif options["-H"] == "4":
-		try:
-			conn.send("lssyscfg -r lpar -m "+ options["-s"] +" --filter 'lpar_names=" + options["-n"] + "'\n")
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-		except pexpect.EOF:
-			fail(EC_CONNECTION_LOST)
-		except pexpect.TIMEOUT:
-			fail(EC_TIMED_OUT)
-
-		try:				
-			status = re.compile(",state=(.*?),", re.IGNORECASE).search(conn.before).group(1)
-		except AttributeError:
-			fail(EC_STATUS_HMC)
-
-	##
-	## Transformation to standard ON/OFF status if possible
-	if status in ["Running", "Open Firmware", "Shutting Down", "Starting"]:
-		status = "on"
-	else:
-		status = "off"
-
-	return status
-
-def set_power_status(conn, options):
-	if options["-H"] == "3":
-		try:
-			conn.send("chsysstate -o " + options["-o"] + " -r lpar -m " + options["-s"]
-				+ " -n " + options["-n"] + "\n")
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-		except pexpect.EOF:
-			fail(EC_CONNECTION_LOST)
-		except pexpect.TIMEOUT:
-			fail(EC_TIMED_OUT)		
-	elif options["-H"] == "4":
-		try:
-			if options["-o"] == "on":
-				conn.send("chsysstate -o on -r lpar -m " + options["-s"] + 
-					" -n " + options["-n"] + 
-					" -f `lssyscfg -r lpar -F curr_profile " +
-					" -m " + options["-s"] +
-					" --filter \"lpar_names="+ options["-n"] +"\"`\n" )
-			else:
-				conn.send("chsysstate -o shutdown -r lpar --immed" +
-					" -m " + options["-s"] + " -n " + options["-n"] + "\n")		
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-		except pexpect.EOF:
-			fail(EC_CONNECTION_LOST)
-		except pexpect.TIMEOUT:
-			fail(EC_TIMED_OUT)
-
-def get_lpar_list(conn, options):
-	outlets = { }
-	if options["-H"] == "3":
-		try:
-			conn.send("query_partition_names -m " + options["-s"] + "\n")
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-
-			## We have to remove first 3 lines (command + header) and last line (part of new prompt)
-			####
-			res = re.search("^.+?\n(.+?\n){2}(.*)\n.*$", conn.before, re.S)
-
-			if res == None:
-				fail_usage("Unable to parse output of list command")
-		
-			lines = res.group(2).split("\n")
-			for x in lines:
-				outlets[x.rstrip()] = ("", "")
-		except pexpect.EOF:
-			fail(EC_CONNECTION_LOST)
-		except pexpect.TIMEOUT:
-			fail(EC_TIMED_OUT)		
-	elif options["-H"] == "4":
-		try:
-			conn.send("lssyscfg -r lpar -m " + options["-s"] + 
-				" -F name:state\n")
-			conn.log_expect(options, options["-c"], int(options["-g"]))
-
-			## We have to remove first line (command) and last line (part of new prompt)
-			####
-			res = re.search("^.+?\n(.*)\n.*$", conn.before, re.S)
-
-			if res == None:
-				fail_usage("Unable to parse output of list command")
-		
-			lines = res.group(1).split("\n")
-			for x in lines:
-				s = x.split(":")
-				outlets[s[0]] = ("", s[1])
-		except pexpect.EOF:
-			fail(EC_CONNECTION_LOST)
-		except pexpect.TIMEOUT:
-			fail(EC_TIMED_OUT)
-
-	return outlets
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure", "identity_file", "partition", "managed", "hmc_version", "cmd_prompt",
-			"separator", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	all_opt["login_timeout"]["default"] = "15"
-	all_opt["secure"]["default"] = "1"
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific settings and default values
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = [ ":~>", "]\$", "\$ " ]
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for IBM LPAR"
-	docs["longdesc"] = ""
-	show_docs(options, docs)
-
-	if 0 == options.has_key("-s"):
-		fail_usage("Failed: You have to enter name of managed system")
-
-        if (0 == ["list", "monitor"].count(options["-o"].lower())) and (0 == options.has_key("-n")):
-                fail_usage("Failed: You have to enter name of the partition")
-
-	if 1 == options.has_key("-H") and (options["-H"] != "3" and options["-H"] != "4"):
-		fail_usage("Failed: You have to enter valid version number: 3 or 4")
-
-	##
-	## Operate the fencing device
-	####
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status, get_lpar_list)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.send("quit\r\n")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass	                                         
-
-	sys.exit(result)
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/manual/Makefile b/fence/agents/manual/Makefile
deleted file mode 100644
index ff4bde2..0000000
--- a/fence/agents/manual/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-TARGET= fence_ack_manual
-
-MANTARGET=$(TARGET).8
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-
-# Using manual override instead of the binary version.
-# (this version does not require any configuration params
-# in cluster.conf, but fencing must fail first)
-${TARGET}: 
-	cp $(S)/$@.sh $@
-
-clean: generalclean
diff --git a/fence/agents/manual/fence_ack_manual.8 b/fence/agents/manual/fence_ack_manual.8
deleted file mode 100644
index 6b4cd14..0000000
--- a/fence/agents/manual/fence_ack_manual.8
+++ /dev/null
@@ -1,39 +0,0 @@
-.TH FENCE_ACK_MANUAL 8 2009-12-21 cluster cluster
-
-.SH NAME
-fence_ack_manual \- a program to override fenced fencing operations
-
-.SH SYNOPSIS
-.B fence_ack_manual
-[OPTIONS]
-.I nodename
-
-.SH DESCRIPTION
-When
-.BR fenced (8)
-fails to fence a node, it retries indefinately.
-.BR fence_ack_manual (8)
-tells fenced to stop retrying and consider the node fenced.
-
-.P
-It is important that this only be done after the node has been manually
-turned off or prevented from writing to shared storage.
-Without this manual action and verification, the storage that fencing
-protects may become corrupted.
-
-.P
-When fenced fences a node that has no fence devices defined in the cluster
-configuration, the fencing operation fails.  This failure will be repeated
-indefinately until fence_ack_manual is run by an operator to indicate
-the node is in a safe state to proceed.
-(Defining no fencing devices for node is the equivalent of using the
-fence_manual agent in previous versions.)
-
-.SH OPTIONS
-.TP
-.B \-h
-Print a help message describing available options, then exit.
-
-.SH SEE ALSO
-.BR fenced (8)
-
diff --git a/fence/agents/manual/fence_ack_manual.sh b/fence/agents/manual/fence_ack_manual.sh
deleted file mode 100644
index 83102aa..0000000
--- a/fence/agents/manual/fence_ack_manual.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# Manual override after fencing has failed.
-#
-
-if [ "$1" = "-n" ]; then
-	shift
-fi
-
-if [ -z "$1" ] || [ "$1" = "-h" ]; then
-	echo "usage:"
-        echo " 	$0 <nodename>"
-        echo " 	$0 -n <nodename>"
-	echo 
-	echo "The -n flag exists to preserve compatibility with previous "
-	echo "releases of $0, and is no longer required."
-	exit 1
-fi
-
-declare answer
-
-echo "About to override fencing for $1."
-echo "Improper use of this command can cause severe file system damage."
-echo
-read -p "Continue [NO/absolutely]? " answer
-
-if [ "$answer" != "absolutely" ]; then
-	echo "Aborted."
-	exit 1
-fi
-
-while ! [ -e /var/run/cluster/fenced_override ]; do
-	sleep 1
-done
-
-echo $1>/var/run/cluster/fenced_override
-echo Done
diff --git a/fence/agents/mcdata/Makefile b/fence/agents/mcdata/Makefile
deleted file mode 100644
index 437ae80..0000000
--- a/fence/agents/mcdata/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_mcdata
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/mcdata/fence_mcdata.8 b/fence/agents/mcdata/fence_mcdata.8
deleted file mode 100644
index c52ffd6..0000000
--- a/fence/agents/mcdata/fence_mcdata.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_mcdata 8
-
-.SH NAME
-fence_mcdata - I/O Fencing agent for McData FC switches
-
-.SH SYNOPSIS
-.B
-fence_mcdata
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_mcdata is an I/O Fencing agent which can be used with McData FC 
-switches.  It logs into a McData switch via telnet and disables a specified 
-port.  Disabling the port which a machine is connected to effectively fences 
-that machine.  Lengthy telnet connections to the switch should be avoided 
-while a GFS cluster is running because the connection will block any necessary 
-fencing actions.
-
-fence_mcdata accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent.  fence_mcdata 
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the McData FC switch.  When the fenced machine is ready to be brought back 
-into the GFS cluster (after reboot) the port on the McData FC switch needs to 
-be enabled. This can be done by running fence_mcdata and specifying the 
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required.  disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_mcdata.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required.  disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
deleted file mode 100644
index 7a01d1d..0000000
--- a/fence/agents/mcdata/fence_mcdata.pl
+++ /dev/null
@@ -1,293 +0,0 @@
-#!/usr/bin/perl
-
-# This works on the following firmware versions:
-#   01.03.00
-#   02.00.00
-#   04.01.00
-#   04.01.02
-
-use Getopt::Std;
-use Net::Telnet ();
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-$opt_o = 'disable';        # Default fence action
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage
-{
-    print "Usage:\n";
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -a <ip>          IP address or hostname of switch\n";
-    print "  -h               usage\n";
-    print "  -l <name>        Login name\n";
-    print "  -n <num>         Port number to disable\n";
-    print "  -o <string>      Action:  disable (default) or enable\n";
-    print "  -p <string>      Password for login\n";
-    print "  -S <path>        Script to run to retrieve login password\n";
-    print "  -q               quiet mode\n";
-    print "  -V               version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg) = @_;
-  print $msg."\n" unless defined $opt_q;
-  $t->close if defined $t;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)=@_;
-  print STDERR $msg."\n" if $msg;
-  print STDERR "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-        $_ = $in;
-        chomp;
-
-	# strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-	# skip comments
-        next if /^#/;
-
-        $line+=1;
-        $opt=$_;
-        next unless $opt;
-
-        ($name,$val)=split /\s*=\s*/, $opt;
-
-        if ( $name eq "" )
-        {  
-           print STDERR "parse error: illegal name in option $line\n";
-           exit 2;
-	}
-	
-        # DO NOTHING -- this field is used by fenced
-	elsif ($name eq "agent" ) { } 
-
-        elsif ($name eq "ipaddr" ) 
-	{
-            $opt_a = $val;
-        } 
-	elsif ($name eq "login" ) 
-	{
-            $opt_l = $val;
-        } 
-        elsif ($name eq "option" )
-        {
-            $opt_o = $val;
-        }
-	elsif ($name eq "passwd" ) 
-	{
-            $opt_p = $val;
-        }
-	elsif ($name eq "passwd_script" )
-	{
-		$opt_S = $val;
-	}
-	elsif ($name eq "port" ) 
-	{
-            $opt_n = $val;
-        } 
-    }
-}
-
-sub telnet_error
-{ 
-  fail "failed: telnet returned: ".$t->errmsg;
-}
-
-######################################################################33
-# MAIN
-
-if (@ARGV > 0) {
-   getopts("a:hl:n:o:p:S:qV") || fail_usage ;
-
-   usage if defined $opt_h;
-   version if defined $opt_V;
-
-   fail_usage "Unknown parameter." if (@ARGV > 0);
-
-   fail_usage "No '-a' flag specified." unless defined $opt_a;
-   fail_usage "No '-n' flag specified." unless defined $opt_n;
-   fail_usage "No '-l' flag specified." unless defined $opt_l;
-
-   if (defined $opt_S) {
-     $pwd_script_out = `$opt_S`;
-     chomp($pwd_script_out);
-     if ($pwd_script_out) {
-        $opt_p = $pwd_script_out;
-     }
-   }
-
-   fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
-   fail_usage "Unrecognised action '$opt_o' for '-o' flag"
-      unless $opt_o =~ /^(disable|enable)$/i;
-
-} else {
-   get_options_stdin();
-
-   fail "failed: no IP address" unless defined $opt_a;
-   fail "failed: no plug number" unless defined $opt_n;
-   fail "failed: no login name" unless defined $opt_l;
-
-   if (defined $opt_S) {
-     $pwd_script_out = `$opt_S`;
-     chomp($pwd_script_out);
-     if ($pwd_script_out) {
-        $opt_p = $pwd_script_out;
-     }
-   }
-
-   fail "failed: no password" unless defined $opt_p;
-   fail "failed: unrecognised action: $opt_o"
-      unless $opt_o =~ /^(disable|enable)$/i;
-}
-
-
-my $block=1;
-$_=$opt_o;
-if(/disable/)
-{
-    $block=1
-}
-elsif(/enable/)
-{
-    $block=0
-}
-else
-{
-    fail "failed: unrecognised action: $opt_o"
-}
-
-#
-# Set up and log in
-#
-
-$t = new Net::Telnet;
-
-$t->errmode(\&telnet_error);
-$t->open($opt_a);
-
-$t->waitfor('/sername:/');
-
-# Send Username
-$t->print($opt_l);
-
-# Send Password
-$t->waitfor('/assword:/');
-$t->print($opt_p);
-$t->waitfor('/\>/');
-
-#> # Set switch to comma delimited output
-#> $t->print("commadelim 1");
-#> $t->waitfor('/\>/');
-
-# Block/Unblock the desired port
-$t->print("config port blocked $opt_n $block");
-($text, $match) = $t->waitfor('/\>/');
-
-# Verfiy that the port has been blocked/unblocked
-$t->print("config port show $opt_n");
-($text, $match) = $t->waitfor('/\>/');
-
-# scan the port configurations to make sure that
-# the port is in the state we told it to be in
-#
-# Output from the prvious command will look like:
-# 
-# Root> config port show 0
-#
-# Port Information
-# Port Number:          0
-# Name:                 name
-# Blocked:              true
-# Extended Distance:    false
-# Type:                 gPort
-# 
-my $fail=1;
-
- at lines = split /\n/,$text;
-foreach my $line (@lines)
-{
-   my $field = "";
-   my $b_state = "";
-
-   if ( $line =~ /^(.*):\s*(\S*)/ )
-   {
-      $field = $1;
-      $b_state = $2;
-   }
-   next unless ( $field eq "Blocked" );
-   if ( ($block && $b_state eq "true") ||
-        (!$block && $b_state eq "false") ||
-        ($block && $b_state eq "Blocked") ||
-        (!$block && $b_state eq "Unblocked") )
-   {
-      $fail = 0;
-   }
-   last;
-}
-
-# log out of the switch
-$t->print("logout");
-$t->close();
-
-if($fail)
-{
-   print "failed: unexpected port state\n" unless $opt_q;
-}
-else
-{
-   print "success: port $opt_n ".($block?"disabled":"enabled")."\n" 
-      unless defined $opt_q;
-}
-
-exit $fail;
-
-
diff --git a/fence/agents/nss_wrapper/Makefile b/fence/agents/nss_wrapper/Makefile
deleted file mode 100644
index bf30a22..0000000
--- a/fence/agents/nss_wrapper/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-TARGET= fence_nss_wrapper
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	$(TARGET).o
-
-CFLAGS += -I${nsprincdir} -I${nssincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${nsslibdir} -lnss3 -lssl3 -lnspr4
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/agents/nss_wrapper/fence_nss_wrapper.c b/fence/agents/nss_wrapper/fence_nss_wrapper.c
deleted file mode 100644
index 9571573..0000000
--- a/fence/agents/nss_wrapper/fence_nss_wrapper.c
+++ /dev/null
@@ -1,482 +0,0 @@
-/** @file fence_nss_wrapper.c - Main source code of hobbit like tool with
-  support for NSS (SSL) connection.
-*/
-#include <stdio.h>
-#include <nss.h>
-#include <ssl.h>
-#include <prio.h>
-#include <prnetdb.h>
-#include <prerror.h>
-#include <prinit.h>
-#include <getopt.h>
-#include <libgen.h>
-
-/*---- CONSTANTS -------------*/
-
-/** Default operation = connect and telnet*/
-#define OPERATION_DEFAULT 0
-/** Operation display help*/
-#define OPERATION_HELP 1
-
-/** Default mode of connection. Try first found working address*/
-#define MODE_DEFAULT 3
-/** Use only IPv4*/
-#define MODE_IP4MODE 1
-/** Use only IPv6*/
-#define MODE_IP6MODE 2
-/** Use RAW mode - no change of \r and \n to \r\n*/
-#define MODE_RAW     4
-/** Use non-secure mode (without SSL, only pure socket)*/
-#define MODE_NO_SSL  8
-
-/*------ Functions ---------------*/
-
-/** Return port inserted in string. Fuction tests, if port is integer, and than return
-  integer value of string. Otherwise, it will use /etc/services.  On fail, it returns
-  port -1.
-  @param port_s Input port or service name
-  @return port number (converted with ntohs) on success, otherwise -1.
-*/
-static int return_port(char *port_s) {
-  char *end_c;
-  int res;
-  struct servent *serv;
-
-  res=strtol(port_s,&end_c,10);
-
-  if (*end_c=='\0') return res;
-
-  /*It's not number, so try service name*/
-  serv=getservbyname(port_s,NULL);
-
-  if (serv==NULL) return -1;
-
-  return ntohs(serv->s_port);
-}
-
-/** Hook handler for bad certificate (because we have no DB, EVERY certificate is bad).
-  Returned value is always SECSuccess = it's ok certificate.
-  @param arg NULL value
-  @param fd socket cased error
-  @return SECSuccess.
-*/
-static SECStatus nss_bad_cert_hook(void *arg,PRFileDesc *fd) {
-  return SECSuccess;
-}
-
-/** Display last NSPR/NSS error code and user readable message.
-*/
-static void print_nspr_error(void) {
-  fprintf(stderr,"Error (%d): %s\n",PR_GetError(),PR_ErrorToString(PR_GetError(),PR_LANGUAGE_I_DEFAULT));
-}
-
-/** Initialize NSS. NSS is initialized without DB and with
-  domnestic policy.
-  @return 1 on success, otherwise 0.
-*/
-static int init_nss(void) {
-  if ((NSS_NoDB_Init(NULL)!=SECSuccess) ||
-      (NSS_SetDomesticPolicy()!=SECSuccess)) {
-    print_nspr_error();
-
-    return 0;
-  }
-
-  SSL_ClearSessionCache();
-
-  return 1;
-}
-
-/** Create socket. If ssl is >0, socket is ssl enabled.
-  @param ssl Enable ssl (Client, SSL2+3, no TLS, compatible hello) if PR_TRUE, otherwise no.
-  @param ipv6 New socket will be IPv4 if this value is 0, otherwise it will be ipv6
-  @return NULL on error, otherwise socket.
-*/
-static PRFileDesc *create_socket(int ssl,int ipv6) {
-  PRFileDesc *res_socket;
-
-  res_socket=PR_OpenTCPSocket((ipv6?PR_AF_INET6:PR_AF_INET));
-  if (res_socket==NULL) {
-    print_nspr_error();
-
-    return NULL;
-  }
-
-  if (!ssl) return res_socket;
-
-  if (!(res_socket=SSL_ImportFD(NULL,res_socket))) {
-    print_nspr_error();
-
-    return NULL;
-  }
-
-  if ((SSL_OptionSet(res_socket,SSL_SECURITY,ssl)!=SECSuccess) ||
-      (SSL_OptionSet(res_socket,SSL_HANDSHAKE_AS_SERVER,PR_FALSE)!=SECSuccess) ||
-      (SSL_OptionSet(res_socket,SSL_HANDSHAKE_AS_CLIENT,PR_TRUE)!=SECSuccess) ||
-      (SSL_OptionSet(res_socket,SSL_ENABLE_SSL2,ssl)!=SECSuccess) ||
-      (SSL_OptionSet(res_socket,SSL_ENABLE_SSL3,ssl)!=SECSuccess) ||
-      (SSL_OptionSet(res_socket,SSL_ENABLE_TLS,PR_FALSE)!=SECSuccess) ||
-      (SSL_OptionSet(res_socket,SSL_V2_COMPATIBLE_HELLO,ssl)!=SECSuccess) ||
-      (SSL_SetPKCS11PinArg(res_socket,NULL)==-1) ||
-      (SSL_AuthCertificateHook(res_socket,SSL_AuthCertificate,CERT_GetDefaultCertDB())!=SECSuccess) ||
-      (SSL_BadCertHook(res_socket,nss_bad_cert_hook,NULL)!=SECSuccess)) {
-    print_nspr_error();
-
-    if (PR_Close(res_socket)!=PR_SUCCESS) {
-      print_nspr_error();
-    }
-
-    return NULL;
-  }
-
-  return res_socket;
-}
-
-/** Create socket and connect to it.
-  @param hostname Hostname to connect
-  @param port Port name/number to connect
-  @param mode Connection mode. Bit-array of MODE_NO_SSL, MODE_IP6MODE, MODE_IP4MODE.
-  @return NULL on error, otherwise connected socket.
-*/
-static PRFileDesc *create_connected_socket(char *hostname,int port,int mode) {
-  PRAddrInfo *addr_info;
-  void *addr_iter;
-  PRNetAddr addr;
-  PRFileDesc *localsocket;
-  int can_exit,valid_socket;
-  PRUint16 af_spec;
-
-  localsocket=NULL;
-
-  addr_info=NULL;
-
-  af_spec=PR_AF_UNSPEC;
-
-  if (!(mode&MODE_IP6MODE)) af_spec=PR_AF_INET;
-
-  addr_info=PR_GetAddrInfoByName(hostname,af_spec,PR_AI_ADDRCONFIG);
-
-  if (addr_info == NULL) {
-    print_nspr_error();
-    return NULL;
-  }
-
-  /*We have socket -> enumerate and try to connect*/
-  addr_iter=NULL;
-  can_exit=0;
-  valid_socket=0;
-
-  while (!can_exit) {
-    addr_iter=PR_EnumerateAddrInfo(addr_iter,addr_info,port,&addr);
-
-    if (addr_iter==NULL) {
-      can_exit=1;
-    } else {
-      if ((PR_NetAddrFamily(&addr)==PR_AF_INET && (mode&MODE_IP4MODE)) ||
-          (PR_NetAddrFamily(&addr)==PR_AF_INET6 && (mode&MODE_IP6MODE))) {
-        /*Type of address is what user want, try to create socket and make connection*/
-
-        /*Create socket*/
-        localsocket=create_socket(!(mode&MODE_NO_SSL),(PR_NetAddrFamily(&addr)==PR_AF_INET6));
-
-        if (localsocket) {
-          /*Try to connect*/
-          if (PR_Connect(localsocket,&addr,PR_INTERVAL_NO_TIMEOUT)==PR_SUCCESS) {
-            /*Force handshake*/
-            if ((!(mode&MODE_NO_SSL)) && SSL_ForceHandshake(localsocket)!=SECSuccess) {
-              /*Handhake failure -> fail*/
-              print_nspr_error();
-              if (PR_Close(localsocket)!=PR_SUCCESS) {
-                print_nspr_error();
-                can_exit=1;
-              }
-              localsocket=NULL;
-            }
-
-            /*Socket is connected -> we can return it*/
-            can_exit=1;
-          } else {
-            /*Try another address*/
-            if (PR_Close(localsocket)!=PR_SUCCESS) {
-              print_nspr_error();
-              can_exit=1;
-            }
-            localsocket=NULL;
-          }
-        }
-      }
-    }
-  }
-
-  if (!localsocket) {
-    /*Socket is unvalid -> we don't found any usable address*/
-    fprintf(stderr,"Can't connect to host %s on port %d!\n",hostname,port);
-  }
-
-  PR_FreeAddrInfo(addr_info);
-
-  return localsocket;
-}
-
-/** Parse arguments from command line.
-  @param argc Number of arguments in argv
-  @param argv Array of arguments
-  @param mode Pointer to int will be filled with OPERATION_DEFAULT or OPERATION_HELP.
-  @param mode Pointer to int will be filled with MODE_DEFAULT, MODE_IP4MODE or MODE_IP4MODE.
-  @return 1 on success, otherwise 0.
-*/
-static int parse_cli(int argc,char *argv[],int *operation,int *mode,char **hostname,char **port) {
-  int opt;
-
-  *operation=OPERATION_DEFAULT;
-  *mode=MODE_DEFAULT;
-  *port=NULL;
-  *hostname=NULL;
-
-  while ((opt=getopt(argc,argv,"h46rz"))!=-1) {
-    switch (opt) {
-      case 'h':
-        *operation=OPERATION_HELP;
-
-        return 0;
-      break;
-
-      case '4':
-        (*mode)&=~MODE_IP6MODE;
-        (*mode)|=MODE_IP4MODE;
-      break;
-
-      case '6':
-        (*mode)&=~MODE_IP4MODE;
-        (*mode)|=MODE_IP6MODE;
-      break;
-
-      case 'r':
-        (*mode)|=MODE_RAW;
-      break;
-
-      case 'z':
-        (*mode)|=MODE_NO_SSL;
-      break;
-
-      default:
-        return 0;
-      break;
-    }
-  }
-
-  if (argc-optind<2) {
-    fprintf(stderr,"Hostname and port is expected!\n");
-
-    return 0;
-  }
-
-  *hostname=argv[optind];
-  *port=argv[optind+1];
-
-  return 1;
-}
-
-/** Show usage of application.
-  @param pname Name of program (usually basename of argv[0])
-*/
-static void show_usage(char *pname) {
-  printf("usage: %s [options] hostname port\n", pname);
-  printf("   -4             Force to use IPv4\n");
-  printf("   -6             Force to use IPv6\n");
-  printf("   -r             Use RAW connection (don't convert \\r and \\n characters)\n");
-  printf("   -z             Don't use SSL connection (use pure socket)\n");
-  printf("   -h             Show this help\n");
-}
-
-/** Convert End Of Lines (Unix \n, Macs \r or DOS/Win \r\n) to \r\n.
-  @param in_buffer Input buffer
-  @param in_size Input buffer size
-  @param out_buffer Output buffer (must be prealocated). Should be (2*in_size) (in worst case)
-  @param out_size There will be size of out_buffer
-  @param in_state Internal state of finite automata. First call should have this 0, other calls
-    shouldn't change this value. After end of file, you may add to this value +100 and call this
-    again, to make sure of proper end (in_buffer can be in this case everything, including NULL).
-*/
-static void convert_eols(char *in_buffer,int in_size,char *out_buffer,int *out_size,int *in_state) {
-  int in_pos,out_pos;
-  int status;
-  char in_char;
-
-  out_pos=0;
-  status=*in_state;
-
-  if (status==100 || status==101) {
-    if (status==101) {
-      out_buffer[out_pos++]='\r';
-      out_buffer[out_pos++]='\n';
-    }
-  } else {
-    for (in_pos=0;in_pos<in_size;in_pos++) {
-      in_char=in_buffer[in_pos];
-
-      switch (status) {
-        case 0:
-          if (in_char=='\r') status=1;
-          if (in_char=='\n') {
-            out_buffer[out_pos++]='\r';
-            out_buffer[out_pos++]='\n';
-          }
-          if ((in_char!='\r') && (in_char!='\n')) out_buffer[out_pos++]=in_char;
-        break;
-
-        case 1:
-          out_buffer[out_pos++]='\r';
-          out_buffer[out_pos++]='\n';
-
-          if (in_char!='\n') out_buffer[out_pos++]=in_char;
-
-          status=0;
-        break;
-      }
-    }
-  }
-
-  *out_size=out_pos;
-  *in_state=status;
-}
-
-/** Start polling cycle.
-  @param socket Network connected socket.
-  @param mode Bit-array of MODE_*. This function take care on MODE_RAW.
-  @return 0 on failure, otherwise 1
-*/
-static int poll_cycle(PRFileDesc *localsocket,int mode) {
-  PRPollDesc pool[2];
-  char buffer[1024],buffer_eol[1024*2];
-  int readed_bytes;
-  int can_exit;
-  int res;
-  int bytes_to_write;
-  int eol_state;
-
-  can_exit=0;
-  eol_state=0;
-
-  /* Fill pool*/
-  pool[1].fd=localsocket;
-  pool[0].fd=PR_STDIN;
-  pool[0].in_flags=pool[1].in_flags=PR_POLL_READ;
-  pool[0].out_flags=pool[1].out_flags=0;
-
-  while (!can_exit) {
-    res=(PR_Poll(pool,sizeof(pool)/sizeof(PRPollDesc),PR_INTERVAL_NO_TIMEOUT));
-
-    if (res==-1) {
-      print_nspr_error();
-
-      return 0;
-    }
-
-    if (pool[1].out_flags&PR_POLL_READ) {
-      /*We have something in socket*/
-      if ((readed_bytes=PR_Read(pool[1].fd,buffer,sizeof(buffer)))>0) {
-        if (PR_Write(PR_STDOUT,buffer,readed_bytes)!=readed_bytes) {
-          print_nspr_error();
-
-          return 0;
-        }
-      } else {
-        /*End of stream -> quit*/
-        can_exit=1;
-      }
-    }
-
-    if (pool[0].out_flags&(PR_POLL_READ|PR_POLL_HUP)) {
-      /*We have something in stdin*/
-      if ((readed_bytes=PR_Read(pool[0].fd,buffer,sizeof(buffer)))>0) {
-
-        if (!(mode&MODE_RAW)) {
-          convert_eols(buffer,readed_bytes,buffer_eol,&bytes_to_write,&eol_state);
-        } else
-          bytes_to_write=readed_bytes;
-
-        if (PR_Write(pool[1].fd,(mode&MODE_RAW?buffer:buffer_eol),bytes_to_write)!=bytes_to_write) {
-          print_nspr_error();
-
-          return 0;
-        }
-      } else {
-        /*End of stream -> send EOL (if needed)*/
-        if (!(mode&MODE_RAW)) {
-          eol_state+=100;
-          convert_eols(NULL,0,buffer_eol,&bytes_to_write,&eol_state);
-          if (PR_Write(pool[1].fd,buffer_eol,bytes_to_write)!=bytes_to_write) {
-            print_nspr_error();
-
-            return 0;
-          }
-        }
-      }
-    }
-
-    pool[0].out_flags=pool[1].out_flags=0;
-  } /*while (!can_exit)*/
-
-  return 1;
-}
-
-static void atexit_handler(void) {
-  if (PR_Initialized())
-    PR_Cleanup();
-
-  if (fclose(stdout)!=0) {
-    fprintf(stderr,"Can't close stdout!\n");
-
-    exit(1);
-  }
-}
-
-/** Entry point of application.
-  @param argc Number of arguments on command line
-  @param argv Array of strings with arguments from command line
-  @return 0 on success, otherwise >0.
-*/
-int main(int argc,char *argv[]) {
-  int mode,operation;
-  char *hostname, *port;
-  char *pname;
-  int port_n;
-  PRFileDesc *fd_socket;
-  int res;
-
-  pname=basename(argv[0]);
-
-  atexit(atexit_handler);
-
-  if (!parse_cli(argc,argv,&operation,&mode,&hostname,&port) || operation==OPERATION_HELP) {
-    show_usage(pname);
-
-    if (operation!=OPERATION_HELP) return 1;
-
-    return 0;
-  }
-
-  if ((port_n=return_port(port))==-1) {
-    fprintf(stderr,"Error. Unknown port number/name %s!\n",port);
-
-    return 1;
-  }
-
-  if (!(mode&MODE_NO_SSL)) {
-    if (!init_nss()) return 1;
-  }
-
-  if (!(fd_socket=create_connected_socket(hostname,port_n,mode)))
-    return 1;
-
-  res=poll_cycle(fd_socket,mode);
-
-  if (PR_Close(fd_socket)!=PR_SUCCESS) {
-    print_nspr_error();
-
-    return 1;
-  }
-
-  return (res?0:1);
-}
diff --git a/fence/agents/rackswitch/Makefile b/fence/agents/rackswitch/Makefile
deleted file mode 100644
index 05ee5af..0000000
--- a/fence/agents/rackswitch/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-TARGET= fence_rackswitch
-
-MANTARGET = fence_rackswitch.8
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	do_rack.o
-
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c
deleted file mode 100644
index 32037c1..0000000
--- a/fence/agents/rackswitch/do_rack.c
+++ /dev/null
@@ -1,752 +0,0 @@
-#include "do_rack.h"
-
-const char *pname = "fence_rack";
-
-int quiet_flag = 0;
-int verbose_flag = 0;
-int debug_flag = 0;
-
-char ipaddr[256];
-char portnumber[256];
-char username[256];
-char password[256];
-char arg[256];
-char name[256];
-char pwd_script[PATH_MAX] = { 0, };
-
-char readbuf[MAXBUF];
-char writebuf[MAXBUF];
-int sock;
-
-char op_login = 0x7e; 	        /* 126*/ 
-char op_action = 0x66;	        /* 102 */
-char ack_login = 0x7D;	        /* 125 */
-
-char action_idle = 0x00;
-char action_reset = 0x01;
-char action_off = 0x02;
-char action_offon = 0x03;
-
-char configuration_request = 0x5b;   /* 91 */
-char config_reply = 0x5c;            /* 92 */
-char config_general = 0x01;
-char config_section1 = 0x02;
-char config_section2 = 0x03;
-char config_section3 = 0x04;
-
-char message_status = 0x65;         /* 101 */
-
-char login_deny = 0xFF;          
-
-int time_out = 60;
-
-void ignore_message_status(void);
-int wait_frame(char);
-
-/*
- * scan input, waiting for a given frame
- */
-int wait_frame(char frame_id)
-{
-  int read_more = 1;
-  int success = 0;
-  int n;
-  char target = frame_id;
-
-  if(debug_flag){printf("%s: Looking for frametype 0x%.2x\n",name,target);}
-  read_more = 1;
-  while(read_more){
-    n = read(sock,readbuf,1);
-    if(debug_flag){printf("%s: Found frametype 0x%.2x\n",name,readbuf[0]);}
-    if(readbuf[0] == target){
-      read_more = 0;
-      success = 1;
-    }
-    else{
-      if(readbuf[0] == message_status){
-	ignore_message_status();
-	read_more = 1;
-      }
-      else{
-	if(debug_flag){printf("%s: Got unexpected frame from switch\n",name);}
-	read_more = 0;
-	success = 0;
-      }
-    }
-  }
-  return(success);
-}  
-
-void ignore_message_status(void)
-{
-  int n,i;
-  int read_more = 1;
-  int number_of_temp;
-  int number_of_config_mobo;
-    
-  if(debug_flag){printf("%s: Ignoring message-status\n",name);}
-  read_more=1;
-  while(read_more){
-    n = read(sock,readbuf,1); /* status */
-    if(n == 1)
-      read_more = 0;
-  }
-
-  read_more = 1;
-  while(read_more){         /* Date & time */
-    n = read(sock,readbuf,1);
-    if(readbuf[0] == '\0'){
-      read_more = 0;
-    }
-    else{
-      read_more = 1;
-    }
-  }
-   
-  read_more = 1;
-  number_of_temp = 0;
-  n = read(sock,readbuf,1); /* Temprature Input count */
-  number_of_temp = (int)readbuf[0];
-  
-  for(i=0;i<number_of_temp;i++){
-    read_more = 1;
-    while(read_more){
-      n = read(sock,readbuf,1); /* Temprature input ID */
-      n = read(sock,readbuf,8); /* Temprature Value, Fahrenheit */
-      n = read(sock,readbuf,8); /* Temprature Vaule, Celcius */
-      n = read(sock,readbuf,1); /* Temprature Alarm */
-    }
-  }
-  number_of_config_mobo = 0;
-  for(i=4;i>0;i--){
-    read_more = 1;	
-    while(read_more){
-      n=read(sock,readbuf,1);
-      if(n == 1){
-	read_more = 0;
-	number_of_config_mobo = number_of_config_mobo + (int)(readbuf[0]<<(8*(i-1)));
-      }
-    }
-  }
-  for(i=0;i<number_of_config_mobo;i++){
-    n = read(sock,readbuf,4); /* Motherboard ID */
-    n = read(sock,readbuf,1); /* Motherboard status */
-  }
-}
-
-
-
-static void print_usage(void)
-{
-  printf("Usage:\n");
-  printf("\n");
-  printf("%s [options]\n"
-         "\n"
-         "Options:\n"
-         "  -h               usage\n"
-	 "  -a <ip>          IP address for RackSwitch\n"
-	 "  -n <dec num>     Physical plug number on RackSwitch\n"
-	 "  -l <string>      Username\n"
-	 "  -p <string>      Password\n"
-	 "  -S <path>        Script to retrieve password\n"
-	 "  -v               Verbose\n"
-	 "  -q               Quiet\n"
-         "  -V               Version information\n", pname);
-}
-
-
-
-static void get_options(int argc, char **argv)
-{
-  int c;
-  char *value;
-
-  if (argc > 1){  
-    /*
-     * Command line input
-     */
-    while ((c = getopt(argc, argv, "ha:n:l:p:S:vqVd")) != -1)
-      {
-	switch(c)
-	  {
-	  case 'h':
-	    print_usage();
-	    exit(DID_SUCCESS);
-	
-	  case 'a':
-	    strncpy(ipaddr,optarg,254);
-	    break;
-
-	  case 'n':
-	    strncpy(portnumber,optarg,254);
-	    break;
-
-	  case 'l':
-	    strncpy(username,optarg,254);	
-	    break;
-
-	  case 'p':
-	    strncpy(password,optarg,254);
-	    break;
-
-	  case 'S':
-		strncpy(pwd_script, optarg, sizeof(pwd_script));
-		pwd_script[sizeof(pwd_script) - 1] = '\0';
-		break;
-
-	  case 'v':
-	    verbose_flag = 1;
-	    break;
-
-	  case 'q':
-	    quiet_flag = 1;
-	    break;
-
-	  case 'd':
-	    debug_flag = 1;
-	    break;
-
-	  case 'V':
-	    printf("%s %s (built %s %s)\n", pname, RELEASE_VERSION,
-		   __DATE__, __TIME__);
-	    printf("%s\n", REDHAT_COPYRIGHT);
-	    exit(DID_SUCCESS);
-	    break;
-
-	  case ':':
-	  case '?':
-	    fprintf(stderr, "Please use '-h' for usage.\n");
-	    exit(DID_FAILURE);
-	    break;
-
-	  default:
-	    fprintf(stderr, "Bad programmer! You forgot to catch the %c flag\n", c);
-	    exit(DID_FAILURE);
-	    break;
-
-	  }
-      }
-    strcpy(name, pname);
-  }
-  else{
-    errno = 0;
-    while(fgets(arg, 256, stdin) != NULL){    
- if( (value = strchr(arg, '\n')) == NULL){
-        fprintf(stderr, "line too long: '%s'\n", arg);
-	exit(DID_FAILURE);
-      }
-      *value = 0;
-      if( (value = strchr(arg, '=')) == NULL){
-        /* in this agent we can ignore options without value
-         * as we don't need any of them, here. But we should
-         * accept and ignore them.
-         */
-        fprintf(stderr, "invalid input: '%s'\n", arg);
-        continue;
-      }
-      *value = 0;
-      value++;
-    /*  bahfuck. "agent" is not passed to us anyway
-     *  if (!strcmp(arg, "agent")){
-      *  strcpy(name, value);
-       * pname = name;
-      *}
-      */
-      strcpy(name, pname);
-      if (!strcmp(arg, "ipaddr"))
-        strcpy(ipaddr, value);
-      
-      if (!strcmp(arg, "portnumber"))
-        strcpy(portnumber, value);
-      
-      if (!strcmp(arg, "username"))
-        strcpy(username, value);
-      
-      if (!strcmp(arg, "password"))
-        strcpy(password, value);
-
-	  if (!strcasecmp(arg, "passwd_script")) {
-		strncpy(pwd_script, optarg, sizeof(pwd_script));
-		pwd_script[sizeof(pwd_script) - 1] = '\0';
-	  }
-    }
-    errno = 0;
-    
-  }
-
-  if (pwd_script[0] != '\0') {
-	FILE *fp;
-	char pwd_buf[1024];
-
-	fp = popen(pwd_script, "r");
-	if (fp != NULL) {
-		ssize_t len = fread(pwd_buf, 1, sizeof(pwd_buf), fp);
-		if (len > 0) {
-			char *p;
-			p = strchr(pwd_buf, '\n');
-			if (p != NULL)
-				*p = '\0';
-			p = strchr(pwd_buf, '\r');
-			if (p != NULL)
-				*p = '\0';
-			strncpy(password, pwd_buf, sizeof(password));
-			password[sizeof(password) - 1] = '\0';
-		}
-		pclose(fp);
-	}
-  }
-}
-
-static void sig_alarm(int sig)
-{
- if(!quiet_flag){
-   fprintf(stderr,"failed: %s: Timeout, nothing happened for %d seconds.\n", pname, time_out);
-   fprintf(stderr,"failed: %s: Perhaps you should inspect the RackSwitch at %s\n",pname,ipaddr);
- }
- exit(DID_FAILURE);	
-}
-
-
-int main(int argc, char **argv)
-{
-  int n,i,j,pnumb;
-  int ip_portnumber = 1025;
-  char boardnum = 0x00;
-  /*char number_of_action = 0x01;*/
-  int number_of_config_mobo = 0;
-  int number_of_section_config_mobo = 0;
-  int exit_status= 0;
-  int success_off = 0;
-  /*int success_on = 0;*/
-  int read_more = 1;
-  struct sockaddr_in rackaddr; 
-  
-  /*char mobo_enabled = 0x01;*/
-  /*char mobo_default_status = 0x00;*/
-  /*char mobo_output_status = 0x00;*/
-  int this_mobo = 0;
-  /*int mobo_id = 0;*/
-  /*int our_mobo = 0;*/
-  int number_of_temp = 0;
-
-  memset(arg, 0, 256);
-  memset(name, 0, 256);
-  memset(ipaddr, 0, 256);
-  memset(portnumber,0,256);
-  memset(username,0,256);
-  memset(password,0,256);
-
-  /*
-   * Ensure that we always get out of the fencing agent
-   * even if things get fucked up and we get no replies
-   */
-  signal(SIGALRM, &sig_alarm);
-  alarm(time_out);
-  get_options(argc, argv);
-
-  if(name[0] == '\0')
-  {
-    if(!quiet_flag)
-      fprintf(stderr,"failed: no name for this program\n");
-    exit(DID_FAILURE);
-  }
-  
-  if(ipaddr[0] == '\0')
-  {
-    if(!quiet_flag)
-      fprintf(stderr,"failed: %s, no IP address given\n",name);
-    exit(DID_FAILURE);
-  }
-  if (portnumber[0] == '\0')
-  {
-    if(!quiet_flag)
-      fprintf(stderr,"failed: %s, no portnumber given\n",name);
-    exit(DID_FAILURE);
-  }
-  if (username[0] == '\0')
-  {
-    if(!quiet_flag)
-      fprintf(stderr,"failed: %s, no username given\n",name);
-    exit(DID_FAILURE);
-  }
-
-  if (password[0] == '\0')
-  {
-    if(!quiet_flag)
-      fprintf(stderr,"failed: %s, no password given\n",name);
-    exit(DID_FAILURE);
-  }
-  /*
-   * Port number given to us as a string.
-   * Does the number make sense?
-   */
-  pnumb = 0;
-  for(n=0;(portnumber[n]!='\0');n++){
-    if((portnumber[n] < 48) || (portnumber[n] > 57)){
-      if(!quiet_flag)
-	fprintf(stderr,"failed: %s, invalid port number\n",name);
-      exit(1);
-    }
-    pnumb = ((pnumb * 10) + ((int)(portnumber[n]) - 48));
-  }
-  /*
-   * what section of the rack is this port part of?
-   * The switch has 4 "subsections", called boardnum here
-   */
-  if((pnumb > 0) && (pnumb < 47))
-    boardnum = 0x02;
-  if((pnumb > 46) && (pnumb < 94))
-    boardnum = 0x03;
-  if((pnumb > 93) && (pnumb < 137))
-    boardnum = 0x04;
-  if((pnumb < 1) || (pnumb> 136)){
-    boardnum = 0x00;
-    if(!quiet_flag)
-      fprintf(stderr,"failed: %s, the portnumber given is not in the range [1 - 136]\n",name);
-    exit(DID_FAILURE);
-  } 
-  /*********************************************
-   ***
-   *** set up TCP connection to the rackswitch
-   ***
-   ********************************************/
-  if ((sock = socket(AF_INET,SOCK_STREAM,0)) < 0){
-    fprintf(stderr,"failed: %s: socket error, %s\n",name,strerror(errno));
-    exit(DID_FAILURE);
-  }
-  
-  bzero(&rackaddr,sizeof(rackaddr));
-  rackaddr.sin_family = AF_INET;
-  rackaddr.sin_port = htons(ip_portnumber);
-
-  if(inet_pton(AF_INET,ipaddr,&rackaddr.sin_addr) <= 0){
-    fprintf(stderr,"failed: %s: inet_pton error\n", name);
-  }
- 
-  if(connect(sock,(SA *) &rackaddr,sizeof(rackaddr)) < 0){
-    fprintf(stderr,"failed: %s: connect error to %s, %s\n", name, ipaddr,strerror(errno));
-    exit(DID_FAILURE);
-  }
-  /**********************************************
-   ***
-   ***	Send Login Frame
-   ***
-   *********************************************/
-  writebuf[0] = op_login;
-   
-  for(n=0;n<=(strlen(username));n++){
-    writebuf[sizeof(char)+n] = username[n];
-  }
-  writebuf[sizeof(char)+(strlen(username))+1] ='\n';
-   
-  for(n=0;n<=(strlen(password))+1;n++){
-    writebuf[sizeof(char)+strlen(username)+1+n] = password[n];
-  }
-  writebuf[sizeof(char)+(strlen(username))+1+(strlen(password))+1] ='\n';
-     
-  if(write(sock,writebuf,sizeof(char)+strlen(username)+strlen(password)+2) < 0) {
-    fprintf(stderr,"failed to write to socket\n");
-    exit(DID_FAILURE);
-  }
-   
-  /********************************************
-   ***
-   ***	Read Login Reply
-   ***
-   *******************************************/
- if(wait_frame(ack_login)){
-   n=read(sock,readbuf,1);
-   if(readbuf[0] == login_deny){
-     if(!quiet_flag){fprintf(stderr,"failed: %s: Not able to log into RackSwitch\n",name);}
-     exit(DID_FAILURE);
-   }
-   else{
-     if(verbose_flag){printf("%s: Successfully logged into RackSwitch\n",name);}
-   }
-  }
-
- /********************************************
-  ***
-  ***	Send Configuration Request Message
-  ***
-  *******************************************/
- 
- writebuf[0] = configuration_request;
- writebuf[1] = config_general;
- if(write(sock,writebuf,2*(sizeof(char))) < 0) {
-   fprintf(stderr,"failed to write to socket\n");
-   exit(DID_FAILURE);
- }
-
- /********************************************
-   ***
-   ***	Read General Configuration Message
-   ***
-   *******************************************/
-
- if(wait_frame(config_reply)){
-   n = read(sock,readbuf,1);
-   if(readbuf[0] == config_general){
-
-     /* Configuration Status, one byte */
-     n = read(sock,readbuf,1);
-     
-     /* Switch description, string */
-     read_more = 1;
-     while(read_more){         
-       n = read(sock,readbuf,1);
-       if(readbuf[0] == '\0'){
-	 read_more = 0;
-       }
-       else{
-	 read_more = 1;
-       }
-     }
-     
-     /* Serial number, string */
-     read_more = 1;
-     while(read_more){
-       n = read(sock,readbuf,1);
-       if(readbuf[0] == '\0'){
-	 read_more = 0;
-       }
-       else{
-	 read_more = 1;
-       }
-     }
-
-       	  /* Version number, string */
-     read_more = 1;
-     while(read_more){
-       n = read(sock,readbuf,1);
-       if(readbuf[0] == '\0'){
-	 read_more = 0;
-       }
-       else{
-	 read_more = 1;
-       }
-     }
-
-     /* number of configured temps, 1 byte */
-     number_of_temp = 0; 
-     n = read(sock,readbuf,1);
-     number_of_temp = (int)readbuf[0];
-     
-     for(i=0;i<number_of_temp;i++){
-
-       /* Temprature description, string */
-       read_more = 1;
-       while(read_more){ 
-	 read_more = 1;
-	 while(read_more){         
-	   n = read(sock,readbuf,1);
-	   if(readbuf[0] == '\0'){
-	     read_more = 0;
-	   }
-	   else{
-	     read_more = 1;
-	   }
-	 }
-       }
-       
-       n = read(sock,readbuf,1); /* Temprature input ID */
-       n = read(sock,readbuf,1); /* Tempratue unit */
-       n = read(sock,readbuf,8); /* Temprature HI alarm */
-       n = read(sock,readbuf,8); /* Temprature LO alarm */
-       n = read(sock,readbuf,1); /* Temprature HI Alarm */
-       n = read(sock,readbuf,1); /* Temprature LO Alarm */
-       n = read(sock,readbuf,1); /* Temprature Alarm email */
-     }
-     /* Number of configured motherboards */
-     number_of_config_mobo = 0;
-     for(i=4;i>0;i--){
-       read_more = 1;	
-       while(read_more){
-	 n=read(sock,readbuf,1);
-	 if(n == 1){
-	   read_more = 0;
-	   number_of_config_mobo = number_of_config_mobo + (int)(readbuf[0]<<(8*(i-1)));
-	 }
-       }
-     }
-     /*
-      * make sure the motherboard we are asked to turn of is configured
-      */
-     if(pnumb > number_of_config_mobo){
-       if(!quiet_flag){
-	 fprintf(stderr,"failed: %s asked to reboot port %d, but there are only %d ports configured\n",name,pnumb,number_of_config_mobo);
-	 exit(DID_FAILURE);
-       }
-     }
-     n = read(sock,readbuf,1); /* email alarms */
-     n = read(sock,readbuf,4); /* email alarm delay */
-
-     /* email addresses, string */
-     read_more = 1;
-     while(read_more){         
-       n = read(sock,readbuf,1);
-       if(readbuf[0] == '\0'){
-	 read_more = 0;
-       }
-       else{
-	 read_more = 1;
-       }
-     }
-     
-     n = read(sock,readbuf,4); /* reset action duration */
-     n = read(sock,readbuf,4); /* power off action duration */
-     n = read(sock,readbuf,4); /* power on action duration */
-   }
-   else{
-     if(debug_flag){fprintf(stderr,"failed: %s: Did not receive general configuration frame when requested\n",name);}
-     exit(DID_FAILURE);
-   }
- }
- else{
-   if(debug_flag){fprintf(stderr,"failed: %s: Did not receive configuration frame when requested\n",name);}
-   exit(DID_FAILURE);
- }
-
-
-
- /******************************************
-  ***
-  ***	Send Action packet to switch
-  ***	Off/On port <portnum>
-  ***
-  *****************************************/
- memset(writebuf,0,sizeof(writebuf));
- writebuf[0] = op_action; 
- writebuf[1] = (char)(number_of_config_mobo >> 24);
- writebuf[2] = (char)(number_of_config_mobo >> 16);
- writebuf[3] = (char)(number_of_config_mobo >> 8);
- writebuf[4] = (char)(number_of_config_mobo);
- 
- writebuf[(pnumb*5)+0] = (char)(pnumb >> 24);
- writebuf[(pnumb*5)+1] = (char)(pnumb >> 16);
- writebuf[(pnumb*5)+2] = (char)(pnumb >> 8);
- writebuf[(pnumb*5)+3] = (char)(pnumb);
- writebuf[(pnumb*5)+4] = action_offon;
-
- if(write(sock,writebuf,(pnumb*5)+5) < 0) {
-   fprintf(stderr,"failed to write to socket\n");
-   exit(DID_FAILURE);
- }
- if(verbose_flag){
-   printf("%s: sending action frame to switch:\n",name);
-   for(i=0;i<(pnumb*5)+5;i++) 
-     printf("0x%.2x ",writebuf[i]);
-   printf("\n");
- }
-
-  /******************************************
-   ***
-   ***	Send Configuration Request packet to switch
-   ***
-   *****************************************/
- memset(writebuf,0,sizeof(writebuf));
- writebuf[0] = configuration_request;
- writebuf[1] = boardnum;
- 
- if(write(sock,writebuf,2*(sizeof(char))) < 0) {
-   fprintf(stderr,"failed to write to socket\n");
-   exit(DID_FAILURE);
- }
- if(verbose_flag){
-   printf("%s: sending Request Configuration Frame from switch:\n",name);
-   printf("0x%.2x 0x%.2x\n",writebuf[0],writebuf[1]);
- }
-
- /*******************************************
-  ***
-  ***	Read Switch Status Message
-  ***
-  ******************************************/
- while(success_off == 0){
-   if(debug_flag){
-     printf("%s: Status does not indicate port %d being rebooted. Looking again\n",name,pnumb);}
-   if(wait_frame(message_status)){
-     n = read(sock,readbuf,1); /* Rackswitch status */
-     
-     read_more = 1;
-     while(read_more){         /* Date & time */
-       n = read(sock,readbuf,1);
-       if(readbuf[0] == '\0'){
-	 read_more = 0;
-       }
-       else{
-	 read_more = 1;
-       }
-     }
-     number_of_temp = 0;
-     n = read(sock,readbuf,1);
-     number_of_temp = readbuf[0];
-     for(i=0;i<number_of_temp;i++){
-       read_more = 1;
-       while(read_more){
-	 n = read(sock,readbuf,1); /* Temprature input ID */
-	 n = read(sock,readbuf,8); /* Temprature Value, Fahrenheit */
-	 n = read(sock,readbuf,8); /* Temprature Vaule, Celcius */
-	 n = read(sock,readbuf,1); /* Temprature Alarm */
-       }
-     }
-     
-     /* number of motherboards, 4 byte */
-     number_of_section_config_mobo = 0;
-     for(i=4;i>0;i--){
-       read_more = 1;	
-       while(read_more){
-	 n=read(sock,readbuf,1);
-	 if(n == 1){
-	   read_more = 0;
-	   number_of_section_config_mobo = number_of_section_config_mobo + (int)(readbuf[0]<<(8*(i-1)));
-	 }
-       }
-     }
-     
-     for(i=0;i<number_of_section_config_mobo;i++){
-       
-       this_mobo = 0;
-       for(j=4;j>0;j--){
-	 read_more = 1;	
-	 while(read_more){
-	   n=read(sock,readbuf,1);
-	   if(n == 1){
-	     read_more = 0;
-	     this_mobo = this_mobo + (int)(readbuf[0]<<(8*(j-1)));
-	   }
-	 }
-       }
-       if(debug_flag){printf("%s: port %d is currently ",name,this_mobo);}
-       n = read(sock,readbuf,1); /* Motherboard status */
-       if(debug_flag){printf("0x%.2x\n",readbuf[0]);}
-       if((pnumb == this_mobo) && ((readbuf[0] == 0x02)||(readbuf[0] == 0x03))){
-	 success_off = 1;
-	 if(verbose_flag){printf("%s: Status shows port %d being rebooted\n",name,this_mobo);}
-       }
-     } /* end number_of_section_mobo loop */
-     if(!success_off){
-       if(verbose_flag){printf("%s: Status shows port %d NOT being rebooted, asking for status again\n",name,pnumb);}
-     }
-   }
-   else{
-     if(debug_flag){fprintf(stderr,"%s: Did not receive Switch Status Message\n",name);}
-     exit(DID_FAILURE);
-   }
- }
-
-
- if(success_off){
-	 if(!quiet_flag){	
-   printf("success: %s: successfully told RackSwitch to reboot port %d\n",name,pnumb);
-	 }   
-   alarm(0);
-   exit_status = DID_SUCCESS;
- }
- return(exit_status);
-}
-/* And that is it. There is no more.
- * Maybe there  should be more?
- * Or maybe not?
- * But there is no more
- */
diff --git a/fence/agents/rackswitch/do_rack.h b/fence/agents/rackswitch/do_rack.h
deleted file mode 100644
index 63c1365..0000000
--- a/fence/agents/rackswitch/do_rack.h
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <ctype.h>
-
-#include <sys/socket.h>
-#include <sys/types.h>
-
-#include <arpa/inet.h>
-
-#include <signal.h>
-
-#include "copyright.cf"
-
-#define SA struct sockaddr
-
-
-#define MAXBUF 1200
-
-#define DID_SUCCESS 0
-#define DID_FAILURE 1 
-
diff --git a/fence/agents/rackswitch/fence_rackswitch.8 b/fence/agents/rackswitch/fence_rackswitch.8
deleted file mode 100644
index fc64a79..0000000
--- a/fence/agents/rackswitch/fence_rackswitch.8
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH fence_rackswitch 8
-
-.SH NAME
-fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch
-
-.SH SYNOPSIS
-.B
-fence_rackswitch
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver 
-RackSwitch.  It logs into the RackSwitch and boots a specified plug.
-Using the http interface to the RackSwitch should be avoided while a GFS cluster is 
-running because the connection may interfere with the operation of this agent.
-
-fence_rackswitch accepts options on the command line as well as from stdin.  
-fenced sends the options through stdin when it execs the agent.  fence_rackswitch 
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bladenetwork.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIplug\fP
-The plug number to power cycle.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-l\fP \fIusername\fP
-Username for login.
-.TP
-\fB-q\fP
-Quiet operation.  Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_rackswitch.
-.TP
-\fIipaddr = < ip >\fR
-IP address of the switch.
-.TP
-\fIusername = < param >\fR
-Username for login.
-.TP
-\fIpassword = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port (outlet) number to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/rhevm/Makefile b/fence/agents/rhevm/Makefile
deleted file mode 100644
index 21f1747..0000000
--- a/fence/agents/rhevm/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_rhevm
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
deleted file mode 100755
index 6d8df4e..0000000
--- a/fence/agents/rhevm/fence_rhevm.py
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/python
-
-import sys, re, pexpect, socket
-import pycurl, StringIO
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New RHEV-M Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-
-re_get_id = re.compile("<vm id=\"(.*?)\"", re.IGNORECASE);
-re_status = re.compile("<status>(.*?)</status>", re.IGNORECASE);
-re_get_name = re.compile("<name>(.*?)</name>", re.IGNORECASE); 
-
-def get_power_status(conn, options):
-	### Obtain real ID from name
-	try:
-		res = send_command(options, "vms/?search=name%3D" + options["-n"])
-	except pycurl.error, e:
-		sys.stderr.write(e[1] + "\n")
-		fail(EC_TIMED_OUT)
-
-	result = re_get_id.search(res)
-	if (result == None):
-		# Unable to obtain ID needed to access virtual machine
-		fail(EC_STATUS)
-
-	options["id"] = result.group(1);
-	
-	re_status.search(res)
-	result = re_status.search(res)
-	if (result == None):
-		# We were able to parse ID so output is correct
-		# in some cases it is possible that RHEV-M output does not
-		# contain <status> line. We can assume machine is OFF then
-		return "off"
-	else:
-		status = result.group(1)
-
-	if (status == "UP"):
-		return "on"
-	else:
-		return "off"
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "start",
-		'off' : "stop"
-	}[options["-o"]]
-
-	url = "vms/" + options["id"] + "/" + action
-	try:
-		res = send_command(options, url, "POST")
-	except pycurl.error, e:
-		sys.stderr.write(e[1] + "\n")
-		fail(EC_TIMED_OUT)
-	
-	return
-
-def get_list(conn, options):
-	outlets = { }
-
-	try:
-		try:
-			res = send_command(options, "vms")
-		except pycurl.error, e:
-			sys.stderr.write(e[1] + "\n")
-			fail(EC_TIMED_OUT)	
-
-		lines = res.split("<vm ")
-		for i in range(1, len(lines)):
-			name = re_get_name.search(lines[i]).group(1)
-			outlets[name] = ("", None)
-	except AttributeError:
-		return { }
-	except IndexError:
-		return { }
-
-	return outlets
-
-def send_command(opt, command, method = "GET"):
-	## setup correct URL
-	if opt.has_key("-z"):
-		url = "https:"
-	else:
-		url = "http:"
-
-	url += "//" + opt["-a"] + ":" + str(opt["-u"]) + "/rhevm-api/" + command
-
-	## send command through pycurl
-	c = pycurl.Curl()
-	b = StringIO.StringIO()
-	c.setopt(pycurl.URL, url)
-	c.setopt(pycurl.HTTPHEADER, [ "Content-type: application/xml", "Accept: application/xml" ])
-	c.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC)
-	c.setopt(pycurl.USERPWD, opt["-l"] + ":" + opt["-p"])
-	c.setopt(pycurl.TIMEOUT, int(opt["-Y"]))
-	c.setopt(pycurl.SSL_VERIFYPEER, 0)
-
-	if (method == "POST"):
-		c.setopt(pycurl.POSTFIELDS, "<action />")
-
-	c.setopt(pycurl.WRITEFUNCTION, b.write)
-	c.perform()
-	result = b.getvalue()
-
-	if opt["log"] >= LOG_MODE_VERBOSE:
-		opt["debug_fh"].write(command + "\n")
-		opt["debug_fh"].write(result + "\n")
-
-	return result
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"ssl", "inet4_only", "inet6_only", "ipport", "port", 
-			"web", "separator", "power_wait", "power_timeout", 
-			"shell_timeout" ]
-
-	atexit.register(atexit_handler)
-
-	all_opt["power_wait"]["default"] = "1"
-	
-	options = check_input(device_opt, process_input(device_opt))
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for RHEV-M REST API"
-	docs["longdesc"] = "fence_rhevm is an I/O Fencing agent which can be \
-used with RHEV-M REST API to fence virtual machines."
-	docs["vendorurl"] = "http://www.redhat.com"
-	show_docs(options, docs)
-
-	##
-	## Fence operations
-	####
-	result = fence_action(None, options, set_power_status, get_power_status, get_list)
-
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/rsa/Makefile b/fence/agents/rsa/Makefile
deleted file mode 100644
index cfbf74b..0000000
--- a/fence/agents/rsa/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_rsa
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py
deleted file mode 100644
index 58ab148..0000000
--- a/fence/agents/rsa/fence_rsa.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##  Main GFEP25A & Boot GFBP25A	
-##
-#####
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New RSA2 Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	try:
-		conn.send("power state\r\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-				
-	status = re.compile("Power: (.*)", re.IGNORECASE).search(conn.before).group(1)
-	return status.lower().strip()
-
-def set_power_status(conn, options):
-	try:
-		conn.send("power " + options["-o"] + "\r\n")
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"cmd_prompt", "secure", "identity_file", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	all_opt["login_timeout"]["default"] = 10
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = ">"
-		
-	# This device will not allow us to login even with LANG=C
-	options["ssh_options"] = "-F /dev/null"
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for IBM RSA"
-	docs["longdesc"] = "fence_rsa is an I/O Fencing agent \
-which can be used with the IBM RSA II management interface. It \
-logs into an RSA II device via telnet and reboots the associated \
-machine. Lengthy telnet connections to the RSA II device should \
-be avoided while a GFS cluster is running because the connection \
-will block any necessary fencing actions."
-	docs["vendorurl"] = "http://www.ibm.com"
-	show_docs(options, docs)
-	
-	##
-	## Operate the fencing device
-	######
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status, None)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.sendline("exit")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/rsb/Makefile b/fence/agents/rsb/Makefile
deleted file mode 100644
index 4022513..0000000
--- a/fence/agents/rsb/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_rsb
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rsb/fence_rsb.8 b/fence/agents/rsb/fence_rsb.8
deleted file mode 100644
index d278271..0000000
--- a/fence/agents/rsb/fence_rsb.8
+++ /dev/null
@@ -1,76 +0,0 @@
-.TH fence_rsb 8
-
-.SH NAME
-fence_rsb - I/O Fencing agent for Fujitsu-Siemens RSB
-
-.SH SYNOPSIS
-.B 
-fence_rsb
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_rsb is an I/O Fencing agent which can be used with the Fujitsu-Siemens
-RSB management interface.  It logs into an RSB device via telnet and reboots
-the associated machine. Lengthy telnet connections to the RSB device 
-should be avoided while a GFS cluster is running because the connection 
-will block any necessary fencing actions.
-
-fence_rsb accepts options on the command line as well as from stdin.  
-Fenced sends parameters through stdin when it execs the agent.  fence_rsb
-can be run by itself with command line options.  This is useful for testing.
-
-Vendor URL: http://www.fujitsu.com
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the RSB device.
-.TP
-\fB-h\fP 
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-n\fP \fItelnet_port\fR
-The port number on which the telnet service listens.
-.TP
-\fB-o\fP \fIaction\fR
-The action required.  This can be reboot (default), off, on, or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-v\fP
-Verbose.  Print informational messages to standard out.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_rsb.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the device.
-.TP
-\fItelnet_port = < port number >\fR
-The port number on which the telnet service listens.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required.  This can be reboot (default), off, on, or status.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/rsb/fence_rsb.py b/fence/agents/rsb/fence_rsb.py
deleted file mode 100644
index 759ae2d..0000000
--- a/fence/agents/rsb/fence_rsb.py
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/usr/bin/python
-
-import getopt, sys
-import os
-import socket
-import time
-import atexit
-
-from telnetlib import Telnet
-
-TELNET_TIMEOUT=30 #How long to wait for a response from a telnet try
-MAX_TRIES = 20
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION=""
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-def usage():
-  print "Usage:"
-  print "fence_rsb [options]"
-  print "Options:"
-  print "   -a <ipaddress>           ip or hostname of rsb"
-  print "   -h                       print out help"
-  print "   -l [login]               login name"
-  print "   -n [telnet port]         telnet port"
-  print "   -p [password]            password"
-  print "   -S [path]                script to run to retrieve password"
-  print "   -o [action]              reboot (default), off, on, or status"
-  print "   -v Verbose               Verbose mode"
-  print "   -V                       Print Version, then exit"
-
-  sys.exit (0)
-
-def version():
-  print "fence_rsb %s  %s\n" % (RELEASE_VERSION, BUILD_DATE)
-  print "%s\n" % REDHAT_COPYRIGHT
-  sys.exit(0)
-
-def atexit_handler():
-	try:
-		sys.stdout.close()
-		os.close(1)
-	except IOError:
-		sys.stderr.write("%s failed to close standard output\n"%(sys.argv[0]))
-		sys.exit(1)
-
-def main():
-  depth = 0
-  POWER_OFF = 0
-  POWER_ON = 1
-  POWER_STATUS = 2
-  POWER_REBOOT = 3
-
-  STATUS_ON = 0
-  STATUS_OFF = 2
-
-  power_command_issued = 0 
-
-  address = ""
-  login = ""
-  passwd = ""
-  passwd_script = ""
-  action = POWER_REBOOT   #default action
-  telnet_port = 3172
-  verbose = False
-  power_state = None
-
-  standard_err = 2
-
-  result = 0
-
-  completed_action = 0
-
-  #set up regex list
-  USERNAME = 0
-  PASSWORD = 1
-  PROMPT = 2
-  STATE = 3
-  ERROR = 4
-  CONT = 5
-  CONFIRM = 6
-  DONE = 7
-
-  regex_list = list()
-  regex_list.append("user name\s*:")
-  regex_list.append("pass phrase\s*:")
-  regex_list.append("[Ee]nter\s+[Ss]election[^\r\n]*:")
-  regex_list.append("[pP]ower Status\s*:")
-  regex_list.append("[Ee]rror\s*:")
-  regex_list.append("[Pp]ress any key to continue")
-  regex_list.append("really want to")
-  regex_list.append("CLOSING TELNET CONNECTION")
-
-  atexit.register(atexit_handler)
-
-  if len(sys.argv) > 1:
-    try:
-      opts, args = getopt.getopt(sys.argv[1:], "a:hl:n:o:p:S:vV", ["help", "output="])
-    except getopt.GetoptError:
-      #print help info and quit
-      usage()
-      sys.exit(2)
-
-    for o, a in opts:
-      if o == "-v":
-        verbose = True
-      if o == "-V":
-        version()
-      if o in ("-h", "--help"):
-        usage()
-        sys.exit(0)
-      if o == "-l":
-        login = a
-      if o == "-n":
-        telnet_port = a
-      if o == "-p":
-        passwd = a
-      if o == "-S":
-        passwd_script = a
-      if o  == "-o":
-        a_lower=a.lower()
-        if a_lower == "off":
-          action = POWER_OFF
-        elif a_lower == "on":
-          action = POWER_ON
-        elif a_lower == "status":
-          action = POWER_STATUS
-        elif a_lower == "reboot":
-          action = POWER_REBOOT
-        else:
-          usage()
-          sys.exit(1)
-      if o == "-a":
-        address = a
-    if address == "" or login == "" or (passwd == "" and passwd_script == ""):
-      usage()
-      sys.exit(1)
-
-  else: #Take args from stdin...
-    params = {}
-    #place params in dict
-    for line in sys.stdin:
-      val = line.split("=")
-      if len(val) == 2:
-        params[val[0].strip()] = val[1].strip()
-
-    try:
-      address = params["ipaddr"]
-    except KeyError, e:
-      os.write(standard_err, "FENCE: Missing ipaddr param for fence_rsb...exiting")
-      sys.exit(1)
-    
-    try:
-      login = params["login"]
-    except KeyError, e:
-      os.write(standard_err, "FENCE: Missing login param for fence_rsb...exiting")
-      sys.exit(1)
-    
-    try:
-      if 'passwd' in params:
-        passwd = params["passwd"]
-      if 'passwd_script' in params:
-        passwd_script = params['passwd_script']
-      if passwd == "" and passwd_script == "":
-        raise Exception, "missing password"
-    except KeyError, e:
-      os.write(standard_err, "FENCE: Missing passwd param for fence_rsb...exiting")
-      sys.exit(1)
-    
-    try:
-      telnet_port = params["telnet_port"]
-    except KeyError, e:
-      pass
-
-    try:
-      a = params["option"]
-      a_lower=a.lower()
-      if a_lower == "off":
-        action = POWER_OFF
-      elif a_lower == "on":
-        action = POWER_ON
-      elif a_lower == "reboot":
-        action = POWER_REBOOT
-    except KeyError, e:
-      action = POWER_REBOOT
-
-    ####End of stdin section
-  
-  
-  # retrieve passwd from passwd_script (if specified)
-  passwd_scr = ''
-  if len(passwd_script):
-    try:
-      if not os.access(passwd_script, os.X_OK):
-        raise Exception, 'script not executable'
-      p = os.popen(passwd_script, 'r', 1024)
-      passwd_scr = p.readline().strip()
-      if p.close() != None:
-        raise Exception, 'script failed'
-    except:
-      sys.stderr.write('password-script "%s" failed\n' % passwd_script)
-      passwd_scr = ''
-  
-  if passwd == "" and passwd_scr == "":
-    sys.stderr.write('password not available, exiting...')
-    sys.exit(1)
-  elif passwd == passwd_scr:
-    pass
-  elif passwd and passwd_scr:
-    # execute self, with password_scr as passwd,
-    # if that fails, continue with "passwd" argument as password
-    if len(sys.argv) > 1:
-      comm = sys.argv[0]
-      skip_next = False
-      for w in sys.argv[1:]:
-        if skip_next:
-          skip_next = False
-        elif w in ['-p', '-S']:
-          skip_next = True
-        else:
-          comm += ' ' + w
-      comm += ' -p ' + passwd_scr
-      ret = os.system(comm)
-      if ret != -1 and os.WIFEXITED(ret) and os.WEXITSTATUS(ret) == 0:
-        # success
-        sys.exit(0)
-      else:
-        sys.stderr.write('Use of password from "passwd_script" failed, trying "passwd" argument\n')
-    else: # use stdin
-      p = os.popen(sys.argv[0], 'w', 1024)
-      for par in params:
-        if par not in ['passwd', 'passwd_script']:
-          p.write(par + '=' + params[par] + '\n')
-      p.write('passwd=' + passwd_scr + '\n')
-      p.flush()
-      if p.close() == None:
-        # success
-        sys.exit(0)
-      else:
-        sys.stderr.write('Use of password from "passwd_script" failed, trying "passwd" argument\n')
-  elif passwd_scr:
-    passwd = passwd_scr
-  # passwd all set
-  
-  
-  
-  try:
-    telnet_port = int(telnet_port)
-  except:
-    os.write(standard_err, ("FENCE: Invalid telnet port: %s\n" % telnet_port))
-    sys.exit(1)
-    
-  ##Time to open telnet session and log in. 
-  try:
-    sock = Telnet(address.strip(), telnet_port)
-  except socket.error, (errno, msg):
-    my_msg = "FENCE: A problem was encountered opening a telnet session with " + address
-    os.write(standard_err, my_msg)
-    os.write(standard_err, ("FENCE: Error number: %d -- Message: %s\n" % (errno, msg)))
-    os.write(standard_err, "Firewall issue? Correct address?\n")
-    sys.exit(1)
-
-  if verbose:
-    #sock.set_debuglevel(10000)
-    print  "socket open to %s %d\n" % (address, telnet_port)
-
-  tries = MAX_TRIES
-  while 1:
-    i, mo, txt = sock.expect(regex_list, TELNET_TIMEOUT)
-    if i == ERROR:
-      os.write(standard_err,("FENCE: An error was encountered when communicating with the rsb device at %s" % address))
-      buf = sock.read_eager()
-      os.write(standard_err,("FENCE: The error message is - %s" % txt + " " + buf))
-      sock.close()
-      sys.exit(1)
-
-    try:
-      buf = sock.read_eager()
-    except EOFError:
-      if completed_action == 1:
-      	# action was completed succesfully, connection closed is OK
-        sys.exit(result)
-      else:
-        raise
-	         
-    if i == USERNAME:
-      if verbose:
-        print "Sending login: %s\n" % login
-      sock.write(login + "\r")
-
-    elif i == PASSWORD:
-      if verbose:
-        print "Sending password: %s\n" % passwd
-      sock.write(passwd + "\r")
-
-    elif i == CONT:
-      if verbose:
-        print "Sending continue char..."
-      sock.write("\r")
-      time.sleep(2)
-
-    elif i == CONFIRM:
-      if verbose:
-        print "Confirming..."
-      sock.write("yes\r")
-
-    elif i == PROMPT:
-      if verbose:
-        print "Evaluating prompt...\n"
-
-      if depth == 0:
-        sock.write("2\r")
-        depth += 1
-      elif depth == 1:
-        if action == POWER_OFF or action == POWER_REBOOT:
-          if power_command_issued == 0:
-            if verbose:
-              print "Sending power off %s" % address
-            sock.write("1\r")
-            power_command_issued += 1
-            time.sleep(2)
-          elif power_command_issued and power_state == 0:
-            if verbose:
-              print "Power off was successful"
-            if action == POWER_OFF:
-              completed_action = 1
-              depth += 1
-              sock.write("0\r")
-            else:
-              action = POWER_ON
-              power_command_issued = 0
-              sock.write("\r")
-          elif tries > 0:
-            if verbose:
-              print "Waiting for power off to complete"
-            tries -= 1
-            sock.write("\r")
-            time.sleep(2)
-          else:
-            os.write(standard_err, "FENCE: Unable to power off server")
-            depth += 1
-            sock.write("0\r")
-
-        elif action == POWER_ON:
-          if power_command_issued == 0:
-            if verbose:
-              print "Sending power on %s" % address
-            sock.write("4\r")
-            power_command_issued += 1
-            time.sleep(2)
-          elif power_command_issued and power_state == 1:
-            if verbose:
-              print "Power on was successful"
-            completed_action = 1
-            depth += 1
-            sock.write("0\r")
-          elif tries > 0:
-            if verbose:
-              print "Waiting for power on to complete"
-            tries -= 1
-            sock.write("\r")
-            time.sleep(2)
-          else:
-            os.write(standard_err, "FENCE: Unable to power on server")
-            depth += 1
-            sock.write("0\r")
-      else:
-        sock.write("0\r")
-
-    elif i == STATE:
-      if buf.find(" On") != (-1):
-        power_state = 1
-      elif buf.find(" Off") != (-1):
-        power_state = 0
-      else:
-        power_state = None
-
-      if action == POWER_STATUS:
-        if verbose:
-          print "Determining power state..."
-        if power_state == 1:
-          print "Server is On"
-          result = STATUS_ON
-        elif power_state == 0:
-          print "Server is Off"
-          result = STATUS_OFF
-        else:
-          os.write(standard_err, ("FENCE: Cannot determine power state: %s" % buf))
-          sys.exit(1)
-        depth = 2
-        completed_action = 1
-
-    elif i == DONE:
-      break
-
-    else:
-      sock.write("\r")
-
-  sock.close()
-  sys.exit(result)
-
-if __name__ == "__main__":
-  main()
diff --git a/fence/agents/sanbox2/Makefile b/fence/agents/sanbox2/Makefile
deleted file mode 100644
index 19ec5db..0000000
--- a/fence/agents/sanbox2/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_sanbox2
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/sanbox2/fence_sanbox2.py b/fence/agents/sanbox2/fence_sanbox2.py
deleted file mode 100644
index 47f3bc8..0000000
--- a/fence/agents/sanbox2/fence_sanbox2.py
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  Version            Firmware
-## +-----------------+---------------------------+
-#####
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New Sanbox2 Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	status_trans = {
-		'online' : "on",
-		'offline' : "off"
-	}
-	try:
-		conn.send("show port " + options["-n"] + "\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		try:
-			conn.send("admin end\n")
-			conn.send("exit\n")
-			conn.close()
-		except:
-			pass
-		fail(EC_TIMED_OUT)
-	
-	status = re.compile(".*AdminState\s+(online|offline)\s+", re.IGNORECASE | re.MULTILINE).search(conn.before).group(1)
-
-	try:
-		return status_trans[status.lower().strip()]
-	except KeyError:
-		return "PROBLEM"
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "online",
-		'off' : "offline"
-	}[options["-o"]]
-
-        try:
-        	conn.send("set port " + options["-n"] + " state " + action + "\n")
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		try:
-			conn.send("admin end\n")
-			conn.send("exit\n")
-			conn.close()
-		except:
-			pass
-		fail(EC_TIMED_OUT)                                                                         	
-
-	try:
-		conn.send("set port " + options["-n"] + " state " + action + "\n")
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		try:
-			conn.send("admin end\n")
-			conn.send("exit\n")
-			conn.close()
-		except:
-			pass
-		fail(EC_TIMED_OUT)
-
-def get_list_devices(conn, options):
-	outlets = { }
-
-	try:
-		conn.send("show port" + "\n")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-
-		list_re = re.compile("^\s+(\d+?)\s+(Online|Offline)\s+", re.IGNORECASE)
-		for line in conn.before.splitlines():
-			if (list_re.search(line)):
-				status = {
-					'online' : "ON",
-					'offline' : "OFF"
-				}[list_re.search(line).group(2).lower()]
-				outlets[list_re.search(line).group(1)] = ("", status)
-
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		try:
-			conn.send("admin end\n")
-			conn.send("exit\n")
-			conn.close()
-		except:
-			pass
-		fail(EC_TIMED_OUT)
-		
-	return outlets
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"io_fencing", "ipaddr", "login", "passwd", "passwd_script",
-			"cmd_prompt", "port", "ipport", "login_eol_lf", "separator",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = [ " #> " ]
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for QLogic SANBox2 FC switches"
-	docs["longdesc"] = "fence_sanbox2 is an I/O Fencing agent which can be used with \
-QLogic SANBox2 FC switches.  It logs into a SANBox2 switch via telnet and disables a specified \
-port. Disabling  the port which a machine is connected to effectively fences that machine. \
-Lengthy telnet connections to the switch should be avoided while a GFS cluster is running \
-because the connection will block any necessary fencing actions."
-	docs["vendorurl"] = "http://www.qlogic.com"
-	show_docs(options, docs)
-
-	##
-	## Operate the fencing device
-	##
-	conn = fence_login(options)
-
-	conn.send("admin start\n")
-	conn.log_expect(options, options["-c"], int(options["-Y"]))
-
-	if (re.search("\(admin\)", conn.before, re.MULTILINE) == None):
-		## Someone else is in admin section, we can't enable/disable
-		## ports so we will rather exit
-		sys.stderr.write("Failed: Unable to switch to admin section\n")
-		sys.exit(EC_GENERIC_ERROR)
-
-	result = fence_action(conn, options, set_power_status, get_power_status, get_list_devices)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.send("admin end\n")
-		conn.send("exit\n")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/scsi/Makefile b/fence/agents/scsi/Makefile
deleted file mode 100644
index 17f31ef..0000000
--- a/fence/agents/scsi/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_scsi
-SBINDIRT=fence_scsi
-
-include $(OBJDIR)/make/fencebuild.mk
-
diff --git a/fence/agents/scsi/fence_scsi.8 b/fence/agents/scsi/fence_scsi.8
deleted file mode 100644
index f1a29ea..0000000
--- a/fence/agents/scsi/fence_scsi.8
+++ /dev/null
@@ -1,109 +0,0 @@
-.TH fence_scsi 8
-
-.SH NAME
-fence_scsi - I/O fencing agent for SCSI persistent reservations
-
-.SH SYNOPSIS
-.B
-fence_scsi
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_scsi is an I/O fencing agent that uses SCSI-3 persistent
-reservations to control access to shared storage devices. These
-devices must support SCSI-3 persistent reservations (SPC-3 or greater)
-as well as the "preempt-and-abort" subcommand.
-
-The fence_scsi agent works by having each node in the cluster register
-a unique key with the SCSI devive(s). Once registered, a single node
-will become the reservation holder by creating a "write exclusive,
-registrants only" reservation on the device(s). The result is that
-only registered nodes may write to the device(s). When a node failure
-occurs, the fence_scsi agent will remove the key belonging to the
-failed node from the device(s). The failed node will no longer be able
-to write to the device(s). A manual reboot is required.
-
-Keys are either be specified manually (see -k option) or generated
-automatically (see -n option). Automatic key generation requires that
-cman be running. Keys will then be generated using the cluster ID and
-node ID such that each node has a unique key that can be determined by
-any other node in the cluster.
-
-Devices can either be specified manually (see -d option) or discovered
-automatically. Multiple devices can be specified manually by using a
-comma-separated list. If no devices are specified, the fence_scsi
-agent will attempt to discover devices by looking for cluster volumes
-and extracting the underlying devices. Devices may be device-mapper
-multipath devices or raw devices. If using a device-mapper multipath
-device, the fence_scsi agent will find the underlying devices (paths)
-and created registrations for each path.
-
-.SH OPTIONS
-.TP
-\fB-o\fP \fIaction\fR
-Fencing action. This value can be "on", "off", or "status". All
-actions require either a key (see -k option) or node name (see -n
-option). For "on", the agent will attempt to register with the
-device(s) and create a reservation if none exists. The "off" action
-will attempt to remove a node's key from the device(s). The "status"
-action will report whether or not a node's key is currently register
-with one or more of the devices. The default action if "off".
-.TP
-\fB-d\fP \fIdevices\fR
-List of devices to use for current operation. Devices can be
-comma-separated list of raw device (eg. /dev/sdc) or device-mapper
-multipath devices (eg. /dev/dm-3). Each device must support SCSI-3
-persistent reservations.
-.TP
-\fB-f\fP \fIlogfile\fR
-Log output to file.
-.TP
-\fB-n\fP \fInodename\fR
-Name of the node to be fenced. The node name is used to generate the
-key value used for the current operation. This option will be ignored
-when used with the -k option.
-.TP
-\fB-k\fP \fIkey\fR
-Key to use for the current operation. This key should be unique to a
-node. For the "on" action, the key specifies the key use to register
-the local node. For the "off" action, this key specifies the key to be
-removed from the device(s).
-.TP
-\fB-a\fP
-Use the APTPL flag for registrations. This option is only used for the
-"on" action.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-v\fP
-Verbose output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = "param"\fR
-This option is used by fence_node(8) and is ignored by fence_scsi.
-.TP
-\fInodename = "param"\fR
-Same as -n option.
-.TP
-\fIaction = "param" \fR
-Same as -o option.
-.TP
-\fIdevices = "param"\fR
-Same as -d option.
-.TP
-\fIlogfile = "param"\fR
-Same as -f option
-.TP
-\fIkey = "param"\fR
-Same as -k option.
-.TP
-\fIaptpl = "1"
-Enable the APTPL flag. Default is 0 (disable).
-
-.SH SEE ALSO
-fence(8), fence_node(8), sg_persist(8), vgs(8), cman_tool(8), cman(5)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
deleted file mode 100644
index 2751bed..0000000
--- a/fence/agents/scsi/fence_scsi.pl
+++ /dev/null
@@ -1,843 +0,0 @@
-#!/usr/bin/perl
-
-use Cwd 'realpath';
-use File::Basename;
-use File::Path;
-use Getopt::Std;
-use POSIX;
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-my $ME = fileparse ($0, ".pl");
-
-################################################################################
-
-sub log_debug ($)
-{
-    my $time = strftime "%b %e %T", localtime;
-    my ($msg) = @_;
-
-    print STDOUT "$time $ME: [debug] $msg\n" unless defined ($opt_q);
-
-    return;
-}
-
-sub log_error ($)
-{
-    my $time = strftime "%b %e %T", localtime;
-    my ($msg) = @_;
-
-    print STDERR "$time $ME: [error] $msg\n" unless defined ($opt_q);
-
-    exit (1);
-}
-
-sub do_action_on ($@)
-{
-    my $self = (caller(0))[3];
-    my ($node_key, @devices) = @_;
-
-    dev_unlink ();
-    key_write ($node_key);
-
-    foreach $dev (@devices) {
-	log_error ("device $dev does not exist") if (! -e $dev);
-	log_error ("device $dev is not a block device") if (! -b $dev);
-
-	do_register_ignore ($node_key, $dev);
-
-	if (!get_reservation_key ($dev)) {
-	    do_reserve ($node_key, $dev);
-	}
-    }
-
-    return;
-}
-
-sub do_action_off ($@)
-{
-    my $self = (caller(0))[3];
-    my ($node_key, @devices) = @_;
-
-    my $host_key = key_read ();
-
-    if ($host_key eq $node_key) {
-	log_error ($self);
-    }
-
-    foreach $dev (@devices) {
-	log_error ("device $dev does not exist") if (! -e $dev);
-	log_error ("device $dev is not a block device") if (! -b $dev);
-
-	my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
-
-	if (scalar (@keys) != 0) {
-	    do_preempt_abort ($host_key, $node_key, $dev);
-	}
-    }
-
-    return;
-}
-
-sub do_action_status ($@)
-{
-    my $self = (caller(0))[3];
-    my ($node_key, @devices) = @_;
-
-    my $dev_count = 0;
-    my $key_count = 0;
-
-    foreach $dev (@devices) {
-	log_error ("device $dev does not exist") if (! -e $dev);
-	log_error ("device $dev is not a block device") if (! -b $dev);
-
-	do_reset ($dev);
-
-	my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
-
-	if (scalar (@keys) != 0) {
-	    $dev_count++;
-	}
-    }
-
-    if ($dev_count != 0) {
-	exit (0);
-    }
-    else {
-	exit (2);
-    }
-}
-
-sub do_verify_on ($@)
-{
-    my $self = (caller(0))[3];
-    my ($node_key, @devices) = @_;
-    my $count = 0;
-
-    for $dev (@devices) {
-        my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
-
-        ## check that our key is registered
-        if (scalar (@keys) == 0) {
-            log_debug ("failed to register key $node_key on device $dev");
-            $count++;
-            next;
-        }
-
-	## write dev to device file once registration is verified
-	dev_write ($dev);
-
-        ## check that a reservation exists
-        if (!get_reservation_key ($dev)) {
-            log_debug ("no reservation exists on device $dev");
-            $count++;
-        }
-    }
-
-    if ($count != 0) {
-        log_error ("$self: failed to verify $count devices");
-    }
-}
-
-sub do_verify_off ($@)
-{
-    my $self = (caller(0))[3];
-    my ($node_key, @devices) = @_;
-    my $count = 0;
-
-    for $dev (@devices) {
-        my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
-
-        ## check that our key is not registered
-        if (scalar (@keys) != 0) {
-            log_debug ("failed to remove key $node_key from device $dev");
-            $count++;
-            next;
-        }
-
-        ## check that a reservation exists
-        if (!get_reservation_key ($dev)) {
-            log_debug ("no reservation exists on device $dev");
-            $count++;
-        }
-    }
-
-    if ($count != 0) {
-        log_error ("$self: failed to verify $count devices");
-    }
-}
-
-sub do_register ($$$)
-{
-    my $self = (caller(0))[3];
-    my ($host_key, $node_key, $dev) = @_;
-
-    $dev = realpath ($dev);
-
-    if (substr ($dev, 5) =~ /^dm/) {
-	my @slaves = get_mpath_slaves ($dev);
-	foreach (@slaves) {
-	    do_register ($node_key, $_);
-	}
-	return;
-    }
-
-    log_debug ("$self (host_key=$host_key, node_key=$node_key, dev=$dev)");
-
-    my $cmd;
-    my $out;
-    my $err;
-
-    do_reset ($dev);
-
-    $cmd = "sg_persist -n -o -G -K $host_key -S $node_key -d $dev";
-    $cmd .= " -Z" if (defined $opt_a);
-    $out = qx { $cmd 2> /dev/null };
-    $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    return;
-}
-
-sub do_register_ignore ($$)
-{
-    my $self = (caller(0))[3];
-    my ($node_key, $dev) = @_;
-
-    $dev = realpath ($dev);
-
-    if (substr ($dev, 5) =~ /^dm/) {
-	my @slaves = get_mpath_slaves ($dev);
-	foreach (@slaves) {
-	    do_register_ignore ($node_key, $_);
-	}
-	return;
-    }
-
-    log_debug ("$self (node_key=$node_key, dev=$dev)");
-
-    my $cmd;
-    my $out;
-    my $err;
-
-    do_reset ($dev);
-
-    $cmd = "sg_persist -n -o -I -S $node_key -d $dev";
-    $cmd .= " -Z" if (defined $opt_a);
-    $out = qx { $cmd 2> /dev/null };
-    $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self ($dev)\n" if ($?>>8);
-
-    return;
-}
-
-sub do_reserve ($$)
-{
-    my $self = (caller(0))[3];
-    my ($host_key, $dev) = @_;
-
-    log_debug ("$self (host_key=$host_key, dev=$dev)");
-
-    my $cmd = "sg_persist -n -o -R -T 5 -K $host_key -d $dev";
-    my $out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    return;
-}
-
-sub do_release ($$)
-{
-    my $self = (caller(0))[3];
-    my ($host_key, $dev) = @_;
-
-    log_debug ("$self (host_key=$host_key, dev=$dev)");
-
-    my $cmd = "sg_persist -n -o -L -T 5 -K $host_key -d $dev";
-    my $out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    return;
-}
-
-sub do_preempt ($$$)
-{
-    my $self = (caller(0))[3];
-    my ($host_key, $node_key, $dev) = @_;
-
-    log_debug ("$self (host_key=$host_key, node_key=$node_key, dev=$dev)");
-
-    my $cmd = "sg_persist -n -o -P -T 5 -K $host_key -S $node_key -d $dev";
-    my $out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    return;
-}
-
-sub do_preempt_abort ($$$)
-{
-    my $self = (caller(0))[3];
-    my ($host_key, $node_key, $dev) = @_;
-
-    log_debug ("$self (host_key=$host_key, node_key=$node_key, dev=$dev)");
-
-    my $cmd = "sg_persist -n -o -A -T 5 -K $host_key -S $node_key -d $dev";
-    my $out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    return;
-}
-
-sub do_reset (S)
-{
-    my $self = (caller(0))[3];
-    my ($dev) = @_;
-
-    my $cmd = "sg_turs $dev";
-    my @out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    ## note that it is not necessarily an error is $err is non-zero,
-    ## so just log the device and status and continue.
-
-    log_debug ("$self (dev=$dev, status=$err)");
-
-    return;
-}
-
-sub dev_unlink ()
-{
-    my $self = (caller(0))[3];
-    my $file = "/var/run/cluster/fence_scsi.dev";
-
-    if (-e $file) {
-	unlink ($file) or die "$!\n";
-    }
-
-    return;
-}
-
-sub dev_write ($)
-{
-    my $self = (caller(0))[3];
-    my $file = "/var/run/cluster/fence_scsi.dev";
-    my $dev = shift;
-
-    if (! -d "/var/run/cluster") {
-	mkpath ("/var/run/cluster");
-    }
-
-    open (\*FILE, ">>$file") or die "$!\n";
-    print FILE "$dev\n";
-    close (FILE);
-
-    return;
-}
-
-sub key_read ()
-{
-    my $self = (caller(0))[3];
-    my $file = "/var/run/cluster/fence_scsi.key";
-    my $key;
-
-    open (\*FILE, "<$file") or die "$!\n";
-    chomp ($key = <FILE>);
-    close (FILE);
-
-    return ($key);
-}
-
-sub key_write ($)
-{
-    my $self = (caller(0))[3];
-    my $file = "/var/run/cluster/fence_scsi.key";
-    my $key = shift;
-
-    if (! -d "/var/run/cluster") {
-	mkpath ("/var/run/cluster");
-    }
-
-    open (\*FILE, ">$file") or die "$!\n";
-    print FILE "$key\n";
-    close (FILE);
-
-    return;
-}
-
-sub get_key ($)
-{
-    my $self = (caller(0))[3];
-
-    my $key = sprintf ("%.4x%.4x", get_cluster_id (), get_node_id ($_[0]));
-
-    return ($key);
-}
-
-sub get_node_id ($)
-{
-    my $self = (caller(0))[3];
-    my $node_id;
-
-    my $cmd = "cman_tool nodes -n $_[0] -F id";
-    my $out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    chomp ($out);
-
-    $node_id = $out;
-
-    return ($node_id);
-}
-
-sub get_cluster_id ()
-{
-    my $self = (caller(0))[3];
-    my $cluster_id;
-
-    my $cmd = "cman_tool status";
-    my @out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    foreach (@out) {
-	chomp;
-	my ($param, $value) = split (/\s*:\s*/, $_);
-	if ($param =~ /^cluster\s+id/i) {
-	    $cluster_id = $value;
-	}
-    }
-
-    return ($cluster_id);
-}
-
-sub get_devices_clvm ()
-{
-    my $self = (caller(0))[3];
-    my @devices;
-
-    my $cmd = "vgs --noheadings " .
-	"    --separator : " .
-	"    --sort pv_uuid " .
-	"    --options vg_attr,pv_name " .
-	"    --config 'global { locking_type = 0 } " .
-	"              devices { preferred_names = [ \"^/dev/dm\" ] }'";
-
-    my @out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    foreach (@out) {
-	chomp;
-	my ($vg_attr, $pv_name) = split (/:/, $_);
-	if ($vg_attr =~ /c$/) {
-	    push (@devices, $pv_name);
-	}
-    }
-
-    return (@devices);
-}
-
-sub get_devices_scsi ()
-{
-    my $self = (caller(0))[3];
-    my @devices;
-
-    opendir (\*DIR, "/sys/block/") or die "$!\n";
-    @devices = grep { /^sd/ } readdir (DIR);
-    closedir (DIR);
-
-    return (@devices);
-}
-
-sub get_mpath_name ($)
-{
-    my $self = (caller(0))[3];
-    my ($dev) = @_;
-    my $name;
-
-    if ($dev =~ /^\/dev\//) {
-	$dev = substr ($dev, 5);
-    }
-
-    open (\*FILE, "/sys/block/$dev/dm/name") or die "$!\n";
-    chomp ($name = <FILE>);
-    close (FILE);
-
-    return ($name);
-}
-
-sub get_mpath_uuid ($)
-{
-    my $self = (caller(0))[3];
-    my ($dev) = @_;
-    my $uuid;
-
-    if ($dev =~ /^\/dev\//) {
-	$dev = substr ($dev, 5);
-    }
-
-    open (\*FILE, "/sys/block/$dev/dm/uuid") or die "$!\n";
-    chomp ($uuid = <FILE>);
-    close (FILE);
-
-    return ($name);
-}
-
-sub get_mpath_slaves ($)
-{
-    my $self = (caller(0))[3];
-    my ($dev) = @_;
-    my @slaves;
-
-    if ($dev =~ /^\/dev\//) {
-	$dev = substr ($dev, 5);
-    }
-
-    opendir (\*DIR, "/sys/block/$dev/slaves/") or die "$!\n";
-
-    @slaves = grep { !/^\./ } readdir (DIR);
-    if ($slaves[0] =~ /^dm/) {
-	@slaves = get_mpath_slaves ($slaves[0]);
-    } else {
-	@slaves = map { "/dev/$_" } @slaves;
-    }
-
-    closedir (DIR);
-
-    return (@slaves);
-}
-
-sub get_registration_keys ($)
-{
-    my $self = (caller(0))[3];
-    my ($dev) = @_;
-    my @keys;
-
-    my $cmd = "sg_persist -n -i -k -d $dev";
-    my @out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    foreach (@out) {
-	chomp;
-	if ($_ =~ s/^\s+0x//i) {
-	    push (@keys, $_);
-	}
-    }
-
-    return (@keys);
-}
-
-sub get_reservation_key ($)
-{
-    my $self = (caller(0))[3];
-    my ($dev) = @_;
-    my $key;
-
-    my $cmd = "sg_persist -n -i -r -d $dev";
-    my @out = qx { $cmd 2> /dev/null };
-    my $err = ($?>>8);
-
-    if ($err != 0) {
-	log_error ("$self (err=$err)");
-    }
-
-    # die "[error]: $self\n" if ($?>>8);
-
-    foreach (@out) {
-	chomp;
-	if ($_ =~ s/^\s+key=0x//i) {
-	    $key = $_;
-	    last;
-	}
-    }
-
-    return ($key)
-}
-
-sub get_options_stdin ()
-{
-    my $num = 0;
-
-    while (<STDIN>) {
-	chomp;
-	s/^\s*//;
-	s/\s*$//;
-
-	next if (/^#/);
-
-	$num++;
-
-	next unless ($_);
-
-	my ($opt, $arg) = split (/\s*=\s*/, $_);
-
-	if ($opt eq "") {
-	    exit (1);
-	}
-	elsif ($opt eq "aptpl") {
-	    $opt_a = $arg;
-	}
-	elsif ($opt eq "devices") {
-	    $opt_d = $arg;
-	}
-	elsif ($opt eq "logfile") {
-	    $opt_f = $arg;
-	}
-	elsif ($opt eq "key") {
-	    $opt_k = $arg;
-	}
-	elsif ($opt eq "nodename") {
-	    $opt_n = $arg;
-	}
-	elsif ($opt eq "action") {
-	    $opt_o = $arg;
-	}
-    }
-}
-
-sub print_usage ()
-{
-    print "Usage:\n";
-    print "\n";
-    print "$ME [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -a               Use APTPL flag\n";
-    print "  -d <devices>     Devices to be used for action\n";
-    print "  -f <logfile>     File to write debug/error output\n";
-    print "  -h               Usage\n";
-    print "  -k <key>         Key to be used for current action\n";
-    print "  -n <nodename>    Name of node to operate on\n";
-    print "  -o <action>      Action: off (default), on, or status\n";
-    print "  -q               Quiet mode\n";
-    print "  -V               Version\n";
-
-    exit (0);
-}
-
-sub print_version ()
-{
-    print "$ME $RELEASE_VERSION $BUILD_DATE\n";
-    print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-    exit (0);
-}
-
-sub print_metadata ()
-{
-    print "<?xml version=\"1.0\" ?>\n";
-    print "<resource-agent name=\"fence_scsi\"" .
-          " shortdesc=\"fence agent for SCSI-3 persistent reservations\">\n";
-    print "<longdesc>fence_scsi</longdesc>\n";
-    print "<parameters>\n";
-    print "\t<parameter name=\"aptpl\" unique=\"1\" required=\"0\">\n";
-    print "\t\t<getopt mixed=\"-a\"/>\n";
-    print "\t\t<content type=\"boolean\"/>\n";
-    print "\t\t<shortdesc lang=\"en\">" .
-          "Use APTPL flag for registrations" .
-          "</shortdesc>\n";
-    print "\t</parameter>\n";
-    print "\t<parameter name=\"devices\" unique=\"1\" required=\"0\">\n";
-    print "\t\t<getopt mixed=\"-d\"/>\n";
-    print "\t\t<content type=\"string\"/>\n";
-    print "\t\t<shortdesc lang=\"en\">" .
-          "List of devices to be used for fencing action" .
-          "</shortdesc>\n";
-    print "\t</parameter>\n";
-    print "\t<parameter name=\"logfile\" unique=\"1\" required=\"0\">\n";
-    print "\t\t<getopt mixed=\"-f\"/>\n";
-    print "\t\t<content type=\"string\"/>\n";
-    print "\t\t<shortdesc lang=\"en\">" .
-          "File to write error/debug messages" .
-          "</shortdesc>\n";
-    print "\t</parameter>\n";
-    print "\t<parameter name=\"key\" unique=\"1\" required=\"0\">\n";
-    print "\t\t<getopt mixed=\"-k\"/>\n";
-    print "\t\t<content type=\"string\"/>\n";
-    print "\t\t<shortdesc lang=\"en\">" .
-          "Key value to be used for fencing action" .
-          "</shortdesc>\n";
-    print "\t</parameter>\n";
-    print "\t<parameter name=\"action\" unique=\"1\" required=\"0\">\n";
-    print "\t\t<getopt mixed=\"-o\"/>\n";
-    print "\t\t<content type=\"string\" default=\"off\"/>\n";
-    print "\t\t<shortdesc lang=\"en\">" .
-          "Fencing action" .
-          "</shortdesc>\n";
-    print "\t</parameter>\n";
-    print "\t<parameter name=\"nodename\" unique=\"1\" required=\"0\">\n";
-    print "\t\t<getopt mixed=\"-n\"/>\n";
-    print "\t\t<content type=\"string\"/>\n";
-    print "\t\t<shortdesc lang=\"en\">" .
-          "Name of node" .
-          "</shortdesc>\n";
-    print "\t</parameter>\n";
-    print "</parameters>\n";
-    print "<actions>\n";
-    print "\t<action name=\"on\"/>\n";
-    print "\t<action name=\"off\"/>\n";
-    print "\t<action name=\"status\"/>\n";
-    print "\t<action name=\"metadata\"/>\n";
-    print "</actions>\n";
-    print "</resource-agent>\n";
-
-    exit (0);
-}
-
-################################################################################
-
-if (@ARGV > 0) {
-    getopts ("ad:f:hk:n:o:qV") or print_usage;
-
-    print_usage if (defined $opt_h);
-    print_version if (defined $opt_V);
-
-    ## handle the metadata action here to avoid other parameter checks
-    ##
-    if ($opt_o =~ /^metadata$/i) {
-	print_metadata;
-    }
-}
-else {
-    get_options_stdin ();
-}
-
-## if the logfile (-f) parameter was specified, open the logfile
-## and redirect STDOUT and STDERR to the logfile.
-##
-if (defined $opt_f) {
-    open (LOG, ">>$opt_f") or die "$!\n";
-    open (STDOUT, ">&LOG");
-    open (STDERR, ">&LOG");
-}
-
-## verify that either key or nodename have been specified
-##
-if ((!defined $opt_n) && (!defined $opt_k)) {
-    print_usage ();
-}
-
-## determine key value
-##
-if (defined $opt_k) {
-    $key = $opt_k;
-}
-else {
-    $key = get_key ($opt_n);
-}
-
-## verify that key is not zero
-##
-if (hex($key) == 0) {
-    log_error ("key cannot be zero");
-}
-
-## remove any leading zeros from key
-##
-if ($key =~ /^0/) {
-    $key =~ s/^0+//;
-}
-
-## get devices
-##
-if (defined $opt_d) {
-    @devices = split (/\s*,\s*/, $opt_d);
-}
-else {
-    @devices = get_devices_clvm ();
-}
-
-## verify that device list is not empty
-##
-if (scalar (@devices) == 0) {
-    log_error ("no devices found");
-}
-
-## default action is "off"
-##
-if (!defined $opt_o) {
-    $opt_o = "off";
-}
-
-## determine the action to perform
-##
-if ($opt_o =~ /^on$/i) {
-    do_action_on ($key, @devices);
-    do_verify_on ($key, @devices);
-}
-elsif ($opt_o =~ /^off$/i) {
-    do_action_off ($key, @devices);
-    do_verify_off ($key, @devices);
-}
-elsif ($opt_o =~ /^status/i) {
-    do_action_status ($key, @devices);
-}
-else {
-    log_error ("unknown action '$opt_o'");
-    exit (1);
-}
-
-## close the logfile
-##
-if (defined $opt_f) {
-    close (LOG);
-}
diff --git a/fence/agents/scsi/fence_scsi_check.pl b/fence/agents/scsi/fence_scsi_check.pl
deleted file mode 100644
index 9ecd7a5..0000000
--- a/fence/agents/scsi/fence_scsi_check.pl
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/perl
-
-use POSIX;
-
-################################################################################
-
-my $dev_file = "/var/run/cluster/fence_scsi.dev";
-my $key_file = "/var/run/cluster/fence_scsi.key";
-
-################################################################################
-
-sub log_debug ($)
-{
-    my $time = strftime ("%b %e %T", localtime);
-    my $msg = shift;
-
-    print STDOUT "$time [$0] debug: $msg\n" if ($verbose);
-
-    return;
-}
-
-sub log_error ($)
-{
-    my $time = strftime ("%b %e %T", localtime);
-    my $msg = shift;
-
-    print STDERR "$time [$0] error: $msg\n";
-
-    return;
-}
-
-sub do_reset ($)
-{
-    my $dev = shift;
-
-    my $cmd = "sg_turs $dev";
-    my @out = qx { $cmd 2> /dev/null };
-
-    return;
-}
-
-sub get_registration_keys ($)
-{
-    my $dev = shift;
-    my @keys = ();
-
-    do_reset ($dev);
-
-    my $cmd = "sg_persist -n -i -k -d $dev";
-    my @out = qx { $cmd 2> /dev/null };
-
-    if ($?>>8 != 0) {
-	log_error ("$cmd");
-	exit (0);
-    }
-
-    foreach (@out) {
-	chomp;
-	if (s/^\s+0x//i) {
-	    push (@keys, $_);
-	}
-    }
-
-    return (@keys);
-}
-
-sub get_reservation_keys ($)
-{
-    my $dev = shift;
-    my @keys = ();
-
-    do_reset ($dev);
-
-    my $cmd = "sg_persist -n -i -r -d $dev";
-    my @out = qx { $cmd 2> /dev/null };
-
-    if ($?>>8 != 0) {
-	log_error ("$cmd");
-	exit (0);
-    }
-
-    foreach (@out) {
-	chomp;
-	if (s/^\s+key=0x//i) {
-	    push (@keys, $_);
-	}
-    }
-
-    return (@keys);
-}
-
-sub get_verbose ()
-{
-    open (\*FILE, "</etc/sysconfig/watchdog") or return;
-    chomp (my @opt = <FILE>);
-    close (FILE);
-
-    foreach (@opt) {
-	next if (/^#/);
-	next unless ($_);
-
-	if (/^verbose=yes$/i) {
-	    return (1);
-	}
-    }
-
-    return (0);
-}
-
-sub key_read ()
-{
-    open (\*FILE, "<$key_file") or exit (0);
-    chomp (my $key = <FILE>);
-    close (FILE);
-
-    return ($key);
-}
-
-sub dev_read ()
-{
-    open (\*FILE, "<$dev_file") or exit (0);
-    chomp (my @dev = <FILE>);
-    close (FILE);
-
-    return (@dev);
-}
-
-################################################################################
-
-if ($ARGV[0] =~ /^repair$/i) {
-    exit ($ARGV[1]);
-}
-
-if (-e "/etc/sysconfig/watchdog") {
-    $verbose = get_verbose ();
-}
-
-if (! -e $dev_file) {
-    log_debug ("$dev_file does not exit");
-    exit (0);
-} elsif (-z $dev_file) {
-    log_debug ("$dev_file is empty");
-    exit (0);
-}
-
-if (! -e $key_file) {
-    log_debug ("$key_file does not exist");
-    exit (0);
-} elsif (-z $key_file) {
-    log_debug ("$key_file is empty");
-    exit (0);
-}
-
-my $key = key_read ();
-my @dev = dev_read ();
-
-foreach (@dev) {
-    my @keys = grep { /^$key$/i } get_registration_keys ($_);
-
-    if (scalar (@keys) != 0) {
-	log_debug ("key $key registered with device $_");
-	exit (0);
-    } else {
-	log_debug ("key $key not registered with device $_");
-    }
-}
-
-log_debug ("key $key not registered with any devices");
-
-exit (2);
diff --git a/fence/agents/virsh/Makefile b/fence/agents/virsh/Makefile
deleted file mode 100644
index 51ef0ca..0000000
--- a/fence/agents/virsh/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_virsh
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py
deleted file mode 100644
index 13099da..0000000
--- a/fence/agents/virsh/fence_virsh.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/python
-
-# The Following Agent Has Been Tested On:
-#
-# Virsh 0.3.3 on RHEL 5.2 with xen-3.0.3-51
-#
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="Virsh fence agent"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-def get_outlets_status(conn, options):
-	try:
-		conn.sendline("virsh list --all")
-		conn.log_expect(options, options["-c"], int(options["-Y"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	result={}
-
-        #This is status of mini finite automata. 0 = we didn't found Id and Name, 1 = we did
-        fa_status=0
-
-        for line in conn.before.splitlines():
-	        domain=re.search("^\s*(\S+)\s+(\S+)\s+(\S+).*$",line)
-
-                if (domain!=None):
-			if ((fa_status==0) and (domain.group(1).lower()=="id") and (domain.group(2).lower()=="name")):
-				fa_status=1
-			elif (fa_status==1):
-				result[domain.group(2)]=("",(domain.group(3).lower() in ["running","blocked","idle","no state","paused"] and "on" or "off"))
-	return result
-
-def get_power_status(conn, options):
-	outlets=get_outlets_status(conn,options)
-
-        if (not (options["-n"] in outlets)):
-                fail_usage("Failed: You have to enter existing name of virtual machine!")
-        else:
-                return outlets[options["-n"]][1]
-
-def set_power_status(conn, options):
-	try:
-		conn.sendline("virsh %s "%(options["-o"] == "on" and "start" or "destroy")+options["-n"])
-
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-                time.sleep(1)
-
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure", "identity_file", "test", "port", "separator",
-			"inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	pinput = process_input(device_opt)
-	pinput["-x"] = 1
-	options = check_input(device_opt, pinput)
-
-	## Defaults for fence agent
-	if 0 == options.has_key("-c"):
-		options["-c"] = "\[EXPECT\]#\ "
-
-	options["ssh_options"]="-t '/bin/bash -c \"PS1=\[EXPECT\]#\  /bin/bash --noprofile --norc\"'"
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for virsh"
-	docs["longdesc"] = "fence_virsh is an I/O Fencing agent \
-which can be used with the virtual machines managed by libvirt. \
-It logs via ssh to a dom0 and there run virsh command, which does \
-all work. \
-\n.P\n\
-By default, virsh needs root account to do properly work. So you \
-must allow ssh login in your sshd_config."
-	show_docs(options, docs)
-
-	## Operate the fencing device
-	conn = fence_login(options)
-	result = fence_action(conn, options, set_power_status, get_power_status, get_outlets_status)
-
-	## Logout from system
-	try:
-		conn.sendline("quit")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-
-	sys.exit(result)
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/vixel/Makefile b/fence/agents/vixel/Makefile
deleted file mode 100644
index 386cb86..0000000
--- a/fence/agents/vixel/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_vixel
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/vixel/fence_vixel.8 b/fence/agents/vixel/fence_vixel.8
deleted file mode 100644
index 83db14f..0000000
--- a/fence/agents/vixel/fence_vixel.8
+++ /dev/null
@@ -1,72 +0,0 @@
-.TH fence_vixel 8
-
-.SH NAME
-fence_vixel - I/O Fencing agent for Vixel FC switches
-
-.SH SYNOPSIS
-.B
-fence_vixel
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches.
-It logs into a Vixel switch via telnet and removes the specified port from the
-zone.  Removing the zone access from the port disables the port from being able
-to access the storage.  
-
-fence_vixel accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent.  fence_vixel 
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer 
-connect to the Vixel FC switch.  When the fenced machine is ready to be brought
-back into the GFS cluster (after reboot) the port on the Vixel FC switch needs 
-to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
-
-config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
-
-Then apply
-
-Consult the Vixel manual for details
-
-Vendor URL: http://www.emulex.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIport\fP
-The port number to remove zoning from on the switch.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_vixel.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to remove zoning from on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/vixel/fence_vixel.pl b/fence/agents/vixel/fence_vixel.pl
deleted file mode 100644
index 470d4c7..0000000
--- a/fence/agents/vixel/fence_vixel.pl
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-use Net::Telnet ();
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage 
-{
-    print "Usage:\n\n"; 
-    print "$pname [options]\n\n";
-    print "Options:\n";
-    print "  -a <ip>          IP address or hostname of switch\n";
-    print "  -h               Usage\n";
-    print "  -n <num>         Port number to disable\n";
-    print "  -p <string>      Password for login\n";
-    print "  -S <path>        Script to run to retrieve login password\n";
-    print "  -V               version\n\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg) = @_;
-  print $msg."\n" unless defined $opt_q;
-  $t->close if defined $t;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg) = @_;
-  print STDERR $msg."\n" if $msg;
-  print STDERR "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-if (@ARGV > 0) {
-    getopts("a:hn:p:S:V") || fail_usage ;
-
-    usage if defined $opt_h;
-    version if defined $opt_V;
-
-    fail_usage "Unknown parameter." if (@ARGV > 0);
-
-    fail_usage "No '-a' flag specified." unless defined $opt_a;
-
-	if (defined $opt_S) {
-		$pwd_script_out = `$opt_S`;
-		chomp($pwd_script_out);
-		if ($pwd_script_out) {
-			$opt_p = $pwd_script_out;
-		}
-	}
-
-    fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
-    fail_usage "No '-n' flag specified." unless defined $opt_n;
-
-} else {
-    get_options_stdin();
-
-    fail "failed: no IP address for the Vixel." unless defined $opt_a;
-
-	if (defined $opt_S) {
-		$pwd_script_out = `$opt_S`;
-		chomp($pwd_script_out);
-		if ($pwd_script_out) {
-			$opt_p = $pwd_script_out;
-		}
-	}
-
-    fail "failed: no password provided." unless defined $opt_p;
-    fail "failed: no port number specified." unless defined $opt_n;
-}
-
-#
-# Set up and log in
-#
-
-$t = new Net::Telnet;
-
-$t->open($opt_a);
-
-$t->waitfor('/assword:/');
-
-$t->print($opt_p);
-
-($out, $match)= $t->waitfor(Match => '/\>/', Match => '/assword:/');
-
-if ($match =~ /assword:/) {
-  fail "failed: incorrect password\n";
-} elsif ( $match !~ />/ ) {
-  fail "failed: timed out waiting for prompt\n";
-}
- 
-$t->print("config");
-
-$t->waitfor('/\(config\)\>/');
-
-$t->print("zone");
-
-$t->waitfor('/\(config\/zone\)\>/');
-
-#
-# Do the command
-#
-
-$cmd = "config $opt_n \"\"";
-$t->print($cmd);
-
-$t->waitfor('/\(config\/zone\)\>/');
-
-$t->print("apply");
-
-($text, $match) = $t->waitfor('/\>/');
-if ($text !~ /[Oo][Kk]/) {
-	fail "failed: error from switch\n";
-}
-
-$t->print("exit");
-
-print "success: zonedisable $opt_n\n";
-exit 0;
-
-
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-
-		# skip comments
-		next if /^#/;
-
-		$line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" ) {
-			print("parse error: illegal name in option $line\n");
-			exit 2;
-		} 
-
-		# DO NOTHING -- this field is used by fenced
-		elsif ($name eq "agent" ) { }
-
-		# FIXME -- depricated.  use "port" instead.
-		elsif ($name eq "fm" ) {
-			(my $dummy,$opt_n) = split /\s+/,$val;
-			print STDERR "Depricated \"fm\" entry detected. Refer to man page.\n";
-		} 
-		elsif ($name eq "ipaddr" ) 
-		{
-			$opt_a = $val;
-		} 
-		elsif ($name eq "name" ) { }
-		elsif ($name eq "passwd" ) 
-		{
-			$opt_p = $val;
-		}
-		elsif ($name eq "passwd_script" )
-		{
-			$opt_S = $val;
-		} 
-		elsif ($name eq "port" ) 
-		{
-			$opt_n = $val;
-		} 
-	}
-}
-
diff --git a/fence/agents/vmware/Makefile b/fence/agents/vmware/Makefile
deleted file mode 100644
index e58aa67..0000000
--- a/fence/agents/vmware/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_vmware_helper fence_vmware
-
-MANTARGET= fence_vmware.8
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
deleted file mode 100644
index 99e5ca9..0000000
--- a/fence/agents/vmware/fence_vmware.py
+++ /dev/null
@@ -1,342 +0,0 @@
-#!/usr/bin/python
-
-#
-# The Following agent has been tested on:
-# vmrun 2.0.0 build-116503 (from VMware Server 2.0) against:
-#	VMware ESX 4.0.0
-#	VMware vCenter 4.0.0
-# 	VMware ESX 3.5
-# 	VMware Server 2.0.0
-#	VMware ESXi 3.5 update 2
-# 	VMware Server 1.0.7 (works but list/status show only running VMs)
-#
-# VI Perl API 1.6 against:
-# 	VMware ESX 4.0.0
-#	VMware vCenter 4.0.0
-# 	VMware ESX 3.5
-#	VMware ESXi 3.5 update 2
-# 	VMware Virtual Center 2.5
-#
-# VMware vSphere SDK for Perl 4.0.0 against:
-# 	VMware ESX 4.0.0
-#	VMware vCenter 4.0.0
-#
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="VMware Agent using VI Perl API and/or VIX vmrun command"
-REDHAT_COPYRIGHT=""
-BUILD_DATE=""
-#END_VERSION_GENERATION
-
-### CONSTANTS ####
-# VMware type is ESX/ESXi/VC
-VMWARE_TYPE_ESX=0
-# VMware type is Server 1.x
-VMWARE_TYPE_SERVER1=1
-# VMware type is Server 2.x and/or ESX 3.5 up2, ESXi 3.5 up2, VC 2.5 up2
-VMWARE_TYPE_SERVER2=2
-
-# Minimum required version of vmrun command
-VMRUN_MINIMUM_REQUIRED_VERSION=2
-
-# Default path to vmhelper command
-VMHELPER_COMMAND="fence_vmware_helper"
-# Default path to vmrun command
-VMRUN_COMMAND="/usr/bin/vmrun"
-# Default type of vmware
-VMWARE_DEFAULT_TYPE="esx"
-
-#### GLOBAL VARIABLES ####
-# Internal type. One of VMWARE_TYPE_, set by #vmware_check_vmware_type
-vmware_internal_type=VMWARE_TYPE_ESX
-
-# If ESX is disconnected, say, that VM is off (don't return previous state)
-vmware_disconnected_hack=False
-
-### FUNCTIONS ####
-
-#Split string in simplified DSV format to array of items
-def dsv_split(dsv_str):
-	delimiter_c=':'
-	escape_c='\\'
-
-	res=[]
-	status=0
-	tmp_str=""
-
-	for x in dsv_str:
-		if (status==0):
-			if (x==delimiter_c):
-				res.append(tmp_str)
-				tmp_str=""
-			elif (x==escape_c):
-				status=1
-			else:
-				tmp_str+=x
-		elif (status==1):
-			if (x==delimiter_c):
-				tmp_str+=delimiter_c
-			elif (x==escape_c):
-				tmp_str+=escape_c
-			else:
-				tmp_str+=escape_c+x
-			status=0
-
-	if (tmp_str!=""):
-		res.append(tmp_str)
-
-	return res
-
-# Quote string for proper existence in quoted string used for pexpect.run function
-# Ex. test'this will return test'\''this. So pexpect run will really pass ' to argument
-def quote_for_run(str):
-	dstr=''
-
-	for c in str:
-		if c==r"'":
-			dstr+="'\\''"
-		else:
-			dstr+=c
-
-	return dstr
-
-# Return string with command and additional parameters (something like vmrun -h 'host'
-def vmware_prepare_command(options,add_login_params,additional_params):
-	res=options["-e"]
-
-	if (add_login_params):
-		if (vmware_internal_type==VMWARE_TYPE_ESX):
-			res+=" --server '%s' --username '%s' --password '%s' "%(quote_for_run(options["-a"]),
-										quote_for_run(options["-l"]),
-										quote_for_run(options["-p"]))
-		elif (vmware_internal_type==VMWARE_TYPE_SERVER2):
-			res+=" -h 'https://%s/sdk' -u '%s' -p '%s' -T server "%(quote_for_run(options["-a"]),
-										quote_for_run(options["-l"]),
-										quote_for_run(options["-p"]))
-		elif (vmware_internal_type==VMWARE_TYPE_SERVER1):
-			host_name_array=options["-a"].split(':')
-
-			res+=" -h '%s' -u '%s' -p '%s' -T server1 "%(quote_for_run(host_name_array[0]),
-								     quote_for_run(options["-l"]),
-								     quote_for_run(options["-p"]))
-			if (len(host_name_array)>1):
-				res+="-P '%s' "%(quote_for_run(host_name_array[1]))
-
-	if ((options.has_key("-s")) and (vmware_internal_type==VMWARE_TYPE_ESX)):
-		res+="--datacenter '%s' "%(quote_for_run(options["-s"]))
-
-	if (additional_params!=""):
-		res+=additional_params
-
-	return res
-
-# Log message if user set verbose option
-def vmware_log(options, message):
-	if options["log"] >= LOG_MODE_VERBOSE:
-		options["debug_fh"].write(message+"\n")
-
-# Run command with timeout and parameters. Internaly uses vmware_prepare_command. Returns string
-# with output from vmrun command. If something fails (command not found, exit code is not 0), fail_usage
-# function is called (and never return).
-def vmware_run_command(options,add_login_params,additional_params,additional_timeout):
-	command=vmware_prepare_command(options,add_login_params,additional_params)
-
-	try:
-		vmware_log(options,command)
-
-		(res_output,res_code)=pexpect.run(command,int(options["-Y"])+int(options["-y"])+additional_timeout,True)
-
-		if (res_code==None):
-			fail(EC_TIMED_OUT)
-		if ((res_code!=0) and (add_login_params)):
-			vmware_log(options,res_output)
-			fail_usage("%s returned %s"%(options["-e"],res_output))
-		else:
-			vmware_log(options,res_output)
-
-	except pexpect.ExceptionPexpect:
-		fail_usage("Cannot run command %s"%(options["-e"]))
-
-	return res_output
-
-# Get outlet list with status as hash table. If you will use add_vm_name, only VM with vmname is
-# returned. This is used in get_status function
-def vmware_get_outlets_vi(conn, options, add_vm_name):
-	outlets={}
-
-	if (add_vm_name):
-		all_machines=vmware_run_command(options,True,("--operation status --vmname '%s'"%(quote_for_run(options["-n"]))),0)
-	else:
-		all_machines=vmware_run_command(options,True,"--operation list",int(options["-g"]))
-
-	all_machines_array=all_machines.splitlines()
-
-	for machine in all_machines_array:
-		machine_array=dsv_split(machine)
-		if (len(machine_array)==4):
-			if (machine_array[0] in outlets):
-				fail_usage("Failed. More machines with same name %s found!"%(machine_array[0]))
-
-			if (vmware_disconnected_hack):
-				outlets[machine_array[0]]=("",(
-						((machine_array[2].lower() in ["poweredon"]) and
-						 (machine_array[3].lower()=="connected"))
-						and "on" or "off"))
-			else:
-				outlets[machine_array[0]]=("",((machine_array[2].lower() in ["poweredon"]) and "on" or "off"))
-	return outlets
-
-# Get outlet list with status as hash table.
-def vmware_get_outlets_vix(conn,options):
-	outlets={}
-
-	running_machines=vmware_run_command(options,True,"list",0)
-	running_machines_array=running_machines.splitlines()[1:]
-
-	if (vmware_internal_type==VMWARE_TYPE_SERVER2):
-		all_machines=vmware_run_command(options,True,"listRegisteredVM",0)
-		all_machines_array=all_machines.splitlines()[1:]
-	elif (vmware_internal_type==VMWARE_TYPE_SERVER1):
-		all_machines_array=running_machines_array
-
-	for machine in all_machines_array:
-		if (machine!=""):
-			outlets[machine]=("",((machine in running_machines_array) and "on" or "off"))
-
-	return outlets
-
-def get_outlets_status(conn, options):
-	if (vmware_internal_type==VMWARE_TYPE_ESX):
-		return vmware_get_outlets_vi(conn,options,False)
-	if ((vmware_internal_type==VMWARE_TYPE_SERVER1) or (vmware_internal_type==VMWARE_TYPE_SERVER2)):
-		return vmware_get_outlets_vix(conn,options)
-
-def get_power_status(conn,options):
-	if (vmware_internal_type==VMWARE_TYPE_ESX):
-		outlets=vmware_get_outlets_vi(conn,options,True)
-	else:
-		outlets=get_outlets_status(conn,options)
-
-	if ((vmware_internal_type==VMWARE_TYPE_SERVER2) or (vmware_internal_type==VMWARE_TYPE_ESX)):
-		if (not (options["-n"] in outlets)):
-			fail_usage("Failed: You have to enter existing name of virtual machine!")
-		else:
-			return outlets[options["-n"]][1]
-	elif (vmware_internal_type==VMWARE_TYPE_SERVER1):
-		return ((options["-n"] in outlets) and "on" or "off")
-
-def set_power_status(conn, options):
-	if (vmware_internal_type==VMWARE_TYPE_ESX):
-		additional_params="--operation %s --vmname '%s'"%((options["-o"]=="on" and "on" or "off"),quote_for_run(options["-n"]))
-	elif ((vmware_internal_type==VMWARE_TYPE_SERVER1) or (vmware_internal_type==VMWARE_TYPE_SERVER2)):
-		additional_params="%s '%s'"%((options["-o"]=="on" and "start" or "stop"),quote_for_run(options["-n"]))
-		if (options["-o"]=="off"):
-			additional_params+=" hard"
-
-	vmware_run_command(options,True,additional_params,int(options["-g"]))
-
-# Returns True, if user uses supported vmrun version (currently >=2.0.0) otherwise False.
-def vmware_is_supported_vmrun_version(options):
-	vmware_help_str=vmware_run_command(options,False,"",0)
-	version_re=re.search("vmrun version (\d\.(\d[\.]*)*)",vmware_help_str.lower())
-	if (version_re==None):
-		    return False   # Looks like this "vmrun" is not real vmrun
-
-	version_array=version_re.group(1).split(".")
-
-	try:
-		if (int(version_array[0])<VMRUN_MINIMUM_REQUIRED_VERSION):
-			return False
-	except Exception:
-		return False
-
-	return True
-
-# Define new options
-def vmware_define_defaults():
-	all_opt["vmware_type"]["default"]=VMWARE_DEFAULT_TYPE
-
-# Check vmware type, set vmware_internal_type to one of VMWARE_TYPE_ value and
-# options["-e"] to path (if not specified)
-def vmware_check_vmware_type(options):
-	global vmware_internal_type
-
-	options["-d"]=options["-d"].lower()
-
-	if (options["-d"]=="esx"):
-		vmware_internal_type=VMWARE_TYPE_ESX
-		if (not options.has_key("-e")):
-			options["-e"]=VMHELPER_COMMAND
-	elif (options["-d"]=="server2"):
-		vmware_internal_type=VMWARE_TYPE_SERVER2
-		if (not options.has_key("-e")):
-			options["-e"]=VMRUN_COMMAND
-	elif (options["-d"]=="server1"):
-		vmware_internal_type=VMWARE_TYPE_SERVER1
-		if (not options.has_key("-e")):
-			options["-e"]=VMRUN_COMMAND
-	else:
-		fail_usage("vmware_type can be esx,server2 or server1!")
-
-# Main agent method
-def main():
-	device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
-		       "action", "ipaddr", "login", "passwd", "passwd_script",
-		       "test", "port", "separator", "exec", "vmware_type",
-		       "vmware_datacenter", "secure", "identity_file",
-		       "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	vmware_define_defaults()
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	# Default is secure connection
-	options["-x"] = 1
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for VMWare"
-	docs["longdesc"] = "fence_vmware is an I/O Fencing agent \
-which can be used with the VMware ESX, VMware ESXi or VMware Server \
-to fence virtual machines.\
-\n.P\n\
-Before you can use this agent, it must be installed VI Perl Toolkit or \
-vmrun command on every node you want to make fencing.\
-\n.P\n\
-VI Perl Toolkit is preferred for VMware ESX/ESXi and Virtual Center. Vmrun \
-command is only solution for VMware Server 1/2 (this command will works against \
-ESX/ESXi 3.5 up2 and VC up2 too, but not cluster aware!) and is available as part \
-of VMware VIX API SDK package. VI Perl and VIX API SDK are both available from \
-VMware web pages (not int RHEL repository!). \
-\n.P\n\
-You can specify type of VMware you are connecting to with \\fB-d\\fP switch \
-(or \\fIvmware_type\\fR for stdin). Possible values are esx, server2 and server1.\
-Default value is esx, which will use VI Perl. With server1 and server2, vmrun \
-command is used.\
-\n.P\n\
-After you have successfully installed VI Perl Toolkit or VIX API, you should \
-be able to run fence_vmware_helper (part of this agent) or vmrun command. \
-This agent supports only vmrun from version 2.0.0 (VIX API 1.6.0)."
-	docs["vendorurl"] = "http://www.vmware.com"
-	show_docs(options, docs)
-
-	# Check vmware type and set path
-	vmware_check_vmware_type(options)
-
-	# Test user vmrun command version
-	if ((vmware_internal_type==VMWARE_TYPE_SERVER1) or (vmware_internal_type==VMWARE_TYPE_SERVER2)):
-		if (not (vmware_is_supported_vmrun_version(options))):
-			fail_usage("Unsupported version of vmrun command! You must use at least version %d!"%(VMRUN_MINIMUM_REQUIRED_VERSION))
-
-	# Operate the fencing device
-	result = fence_action(None, options, set_power_status, get_power_status, get_outlets_status)
-	
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/vmware/fence_vmware_helper.pl b/fence/agents/vmware/fence_vmware_helper.pl
deleted file mode 100644
index a0b5cea..0000000
--- a/fence/agents/vmware/fence_vmware_helper.pl
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-my ($RELEASE_VERSION, $REDHAT_COPYRIGHT, $BUILD_DATE);
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-#### FUNCTIONS #####
-# Show error message
-sub show_error {
-  print STDERR @_;
-}
-
-sub my_exit {
-  my ($exit_code)=@_;
-
-  # Disconnect from server
-  Util::disconnect();
-
-  exit $exit_code;
-}
-
-# Convert one field (string) to format acceptable by DSV. This
-# means replace any : with \: and \ with \\.
-sub convert_field_to_dsv {
-  my ($input_line)=@_;
-
-  $input_line =~ s/([\\:])/\\$1/g;
-  return $input_line
-}
-
-#### Global variables #####
-# Aditional options
-my %opts = (
-   'operation' => {
-      type => "=s",
-      help => "The operation to perform (on,off,list,status). "
-             . "Operations on/off/status require name of the virtual machine",
-      default => "list",
-      required => 0,
-   },
-   'vmname' => {
-      type => "=s",
-      help => "The name of the virtual machine",
-      required => 0,
-   },
-   'datacenter' => {
-      type => "=s",
-      help => "The name of the datacenter",
-      required => 0,
-   }
-);
-
-#################
-##### MAIN ######
-#################
-
-# Conditional use of VIRuntime
-eval "use VMware::VIRuntime;";
-
-if ($@) {
-  show_error "Please install VI Perl API package to use this tool!\nPerl error: $@";
-  exit 1;
-}
-
-# Parse options
-Opts::add_options(%opts);
-Opts::parse();
-Opts::validate();
-
-if (!(Opts::get_option('operation')=~/^(on|off|list|status)$/i)) {
-  show_error "Operation should be on, off, list or status!\n";
-  exit 2;
-}
-
-my $operation=lc(Opts::get_option('operation'));
-
-if (($operation ne 'list') && (!defined Opts::get_option('vmname'))) {
-  show_error "Operation on, off, status require vmname parameter!\n";
-  exit 2;
-}
-
-
-# Try connect to machine
-eval {
-  Util::connect();
-};
-
-if ($@) {
-  show_error "Cannot connect to server!\nVMware error:".$@;
-  exit 3;
-}
-
-my ($datacenter, $datacenter_view, $vm_views,$vm);
-# We are connected to machine
-
-# If user want's datacenter, we must first find datacenter
-my %filter=(view_type => 'VirtualMachine');
-
-if( defined (Opts::get_option('datacenter')) ) {
-  $datacenter = Opts::get_option('datacenter');
-  $datacenter_view = Vim::find_entity_view(view_type => 'Datacenter',
-                                            filter => { name => $datacenter });
-  if (!$datacenter_view) {
-    show_error "Cannot find datacenter ".$datacenter."!\n";
-
-    my_exit 4;
-  }
-
-  $filter{'begin_entity'}=$datacenter_view;
-}
-
-if ($operation ne 'list') {
-  $filter{'filter'}= {"config.name" => Opts::get_option('vmname')};
-}
-
-$vm_views = Vim::find_entity_views(%filter);
-
-my $found=0;
-
-# Traverse all found vm
-foreach $vm(@$vm_views) {
-  if (($operation eq 'list') or ($operation eq 'status')) {
-    if (!$vm->summary->config->template) {
-      print convert_field_to_dsv($vm->name).":".
-            convert_field_to_dsv($vm->summary->config->vmPathName).":".
-            convert_field_to_dsv($vm->runtime->powerState->val).":".
-            convert_field_to_dsv($vm->runtime->connectionState->val)."\n";
-    }
-  } elsif ($operation eq 'on') {
-    eval {
-      $vm->PowerOnVM();
-    };
-
-    if ($@) {
-      # If error is SoapFault with InvalidPowerState, user maybe use some auto power on tool.
-      # This is not error, warning is enought.
-      if (ref($@) eq 'SoapFault') {
-        if (ref($@->detail) eq 'InvalidPowerState') {
-          show_error "Warning: Cannot power on vm (somebody done it before???) ".Opts::get_option('vmname').
-                     "!\nVMware error:".$@."\n";
-        }
-      } else {
-        # Some other more serious problem
-        show_error "Cannot power on vm ".Opts::get_option('vmname')."!\nVMware error:".$@."\n";
-        my_exit 6;
-      }
-    }
-  } elsif ($operation eq 'off') {
-    eval {
-      $vm->PowerOffVM();
-    };
-
-    if ($@) {
-      # If error is SoapFault with InvalidPowerState, user maybe use some auto power off tool.
-      # This is not error, warning is enought.
-      if (ref($@) eq 'SoapFault') {
-        if (ref($@->detail) eq 'InvalidPowerState') {
-          show_error "Warning: Cannot power off vm (somebody done it before???) ".Opts::get_option('vmname').
-                     "!\nVMware error:".$@."\n";
-        }
-      } else {
-        # Some other more serious problem
-        show_error "Cannot power off vm ".Opts::get_option('vmname')."!\nVMware error:".$@."\n";
-        my_exit 6;
-      }
-    }
-  } else {
-    show_error "Operation should be on, off or list!\n";
-    my_exit 2;
-  }
-  $found++;
-}
-
-if ((!$found) && ($operation ne 'list')) {
-  show_error "Cannot find vm ".Opts::get_option('vmname')."!\n";
-  my_exit 5;
-}
-
-# Should be 0 -> success all, or 6 in case of error
-my_exit 0;
-
-__END__
-
-=head1 NAME
-
-fence_vmware_helper - Perform list of virtual machines and
-               poweron, poweroff  of operations on virtual machines.
-
-=head1 SYNOPSIS
-
- fence_vmware_helper --operation <on|off|list|status> [options]
-
-=head1 DESCRIPTION
-
-This VI Perl command-line utility provides an interface for
-seven common provisioning operations on one or more virtual
-machines: powering on, powering off and listing virtual mode.
-
-=head1 OPTIONS
-
-=head2 GENERAL OPTIONS
-
-=over
-
-=item B<operation>
-
-Operation to be performed.  One of the following:
-
-  <on> (power on one or more virtual machines),
-  <off> (power off one  or more virtual machines),
-  <list> (list virtual machines and their status)
-  <status> (same as list, but show only machines with vmname)
-
-=item B<vmname>
-
-Optional. Name of the virtual machine on which the
-operation is to be performed.
-
-=item B<datacenter>
-
-Optional. Name of the  datacenter for the virtual machine(s).
-Operations will be performed on all the virtual machines under the given datacenter.
-
-=back
-
-=head1 EXAMPLES
-
-Power on a virtual machine
-
-   fence_vmware_helper --username administrator --password administrator --operation on
-                --vmname rhel --server win1
-
-   fence_vmware_helper --username administrator --password administrator --operation on
-                --vmname rhel --server win1 --datacenter Datacenter
-
-Power off a virtual machine
-
-   fence_vmware_helper --username administrator --password administrator --operation off
-                --vmname rhel --server win1
-
-   perl fence_vmware_helper --username administrator --password administrator --operation off
-                --vmname rhel --server win1 --datacenter Datacenter
-
-List of virtual machines
-
-   fence_vmware_helper --username administrator --password administrator --server win1
-
-   fence_vmware_helper --username administrator --password administrator --server win1
-                --operation list
-
-Get status of virtual machine
-
-   fence_vmware_helper --username administrator --password administrator --server win1
-	    --vmname rhel --operation status
-
-=head1 SUPPORTED PLATFORMS
-
-All operations supported on ESX 3.0.1
-
-All operations supported on Virtual Center 2.0.1
diff --git a/fence/agents/wti/Makefile b/fence/agents/wti/Makefile
deleted file mode 100644
index c281149..0000000
--- a/fence/agents/wti/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_wti
-
-MAKEMAN = 1
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
deleted file mode 100644
index 8caa4c2..0000000
--- a/fence/agents/wti/fence_wti.py
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/python
-
-#####
-##
-## The Following Agent Has Been Tested On:
-##
-##  Version            Firmware
-## +-----------------+---------------------------+
-##  WTI RSM-8R4         ?? unable to find out ??
-##  WTI MPC-??? 	?? unable to find out ??
-##  WTI IPS-800-CE     v1.40h		(no username) ('list' tested)
-#####
-
-import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New WTI Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	listing = ""
-
-	try:		
-		conn.send("/S"+"\r\n")
-
-		if isinstance(options["-c"], list):
-			re_all = list(options["-c"])
-		else:
-			re_all = [options["-c"]]
-		re_next = re.compile("Enter: ", re.IGNORECASE)
-		re_all.append(re_next)
-
-		result = conn.log_expect(options, re_all, int(options["-Y"]))
-		listing = conn.before
-		if result == (len(re_all) - 1):
-			conn.send("\r\n")
-			conn.log_expect(options, options["-c"], int(options["-Y"]))
-			listing += conn.before
-
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-	
-	plug_section = 0
-	outlets = {}
-	for line in listing.splitlines():
-		if (plug_section == 2) and line.find("|") >= 0 and line.startswith("PLUG") == False:
-			plug_line = [x.strip().lower() for x in line.split("|")]
-			if len(plug_line) < len(plug_header):
-				plug_section = -1
-				pass
-			if ["list", "monitor"].count(options["-o"]) == 0 and options["-n"].lower() == plug_line[plug_index]:
-				return plug_line[status_index]
-			else:
-				## We already believe that first column contains plug number
-				if len(plug_line[0]) != 0:
-					outlets[plug_line[0]] = (plug_line[name_index], plug_line[status_index])
-		elif (plug_section == 1):
-			plug_section = 2
-			pass
-		elif (line.upper().startswith("PLUG")):
-			plug_section = 1
-			plug_header = [x.strip().lower() for x in line.split("|")]
-			plug_index = plug_header.index("plug")
-			name_index = plug_header.index("name")
-			status_index = plug_header.index("status")
-
-	if ["list", "monitor"].count(options["-o"]) == 1:
-		return outlets
-	else:
-		return "PROBLEM"
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "/on",
-		'off': "/off"
-	}[options["-o"]]
-
-	try:
-		conn.send(action + " " + options["-n"] + ",y\r\n")
-		conn.log_expect(options, options["-c"], int(options["-g"]))
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"cmd_prompt", "secure", "identity_file", "port", "no_login", "no_password",
-			"test", "separator", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
-
-	atexit.register(atexit_handler)
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = [ "RSM>", "MPC>", "IPS>", "TPS>", "NBB>", "NPS>", "VMR>" ]
-
-	docs = { }
-	docs["shortdesc"] = "Fence agent for WTI"
-	docs["longdesc"] = "fence_wti is an I/O Fencing agent \
-which can be used with the WTI Network Power Switch (NPS). It logs \
-into an NPS via telnet or ssh and boots a specified plug. \
-Lengthy telnet connections to the NPS should be avoided while a GFS cluster \
-is running because the connection will block any necessary fencing actions."
-	docs["vendorurl"] = "http://www.wti.com"
-	show_docs(options, docs)
-	
-	##
-	## Operate the fencing device
-	##
-	## @note: if it possible that this device does not need either login, password or both of them
-	#####	
-	if 0 == options.has_key("-x"):
-		try:
-			try:
-				conn = fspawn(TELNET_PATH)
-				conn.send("set binary\n")
-				conn.send("open %s -%s\n"%(options["-a"], options["-u"]))
-			except pexpect.ExceptionPexpect, ex:
-				sys.stderr.write(str(ex) + "\n")
-				sys.stderr.write("Due to limitations, binary dependencies on fence agents "
-				"are not in the spec file and must be installed separately." + "\n")
-				sys.exit(EC_GENERIC_ERROR)
-			
-			re_login = re.compile("(login: )|(Login Name:  )|(username: )|(User Name :)", re.IGNORECASE)
-			re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["-c"])), re.IGNORECASE)
-
-			result = conn.log_expect(options, [ re_login, "Password: ", re_prompt ], int(options["-Y"]))
-			if result == 0:
-				if options.has_key("-l"):
-					conn.send(options["-l"]+"\r\n")
-					result = conn.log_expect(options, [ re_login, "Password: ", re_prompt ], int(options["-Y"]))
-				else:
-					fail_usage("Failed: You have to set login name")
-		
-			if result == 1:
-				if options.has_key("-p"):
-					conn.send(options["-p"]+"\r\n")
-					conn.log_expect(options, options["-c"], int(options["-Y"]))	
-				else:
-					fail_usage("Failed: You have to enter password or password script")
-		except pexpect.EOF:
-			fail(EC_LOGIN_DENIED) 
-		except pexpect.TIMEOUT:
-			fail(EC_LOGIN_DENIED)		
-	else:
-		conn = fence_login(options)
-
-	result = fence_action(conn, options, set_power_status, get_power_status, get_power_status)
-
-	##
-	## Logout from system
-	######
-	try:
-		conn.send("/X"+"\r\n")
-		conn.close()
-	except exceptions.OSError:
-		pass
-	except pexpect.ExceptionPexpect:
-		pass
-		
-	sys.exit(result)
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/xcat/Makefile b/fence/agents/xcat/Makefile
deleted file mode 100644
index 13a954c..0000000
--- a/fence/agents/xcat/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_xcat
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/xcat/fence_xcat.8 b/fence/agents/xcat/fence_xcat.8
deleted file mode 100644
index 719f896..0000000
--- a/fence/agents/xcat/fence_xcat.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH fence_xcat 8
-
-.SH NAME
-fence_xcat - I/O Fencing agent for xcat environments
-
-.SH SYNOPSIS
-.B
-fence_xcat
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_xcat is a wrapper to the rpower(1) command that is distributed
-with the xCAT project available at http://www.xcat.org.  Use of 
-fence_xcat requires that xcat has already been properly configured
-for your environment.  Refer to xCAT(1) for more information on 
-configuring xCAT.
-
-fence_xcat accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent.  fence_xcat 
-can be run by itself with command line options which is useful for testing.
-
-NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if
-the bladecenter firmware supports telnet.  This interface is much cleaner and
-easier to setup.
-
-Vendor URL: http://www.xcat.org
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fInodename\fP
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fB-o\fP \fIaction\fP
-The action required.  on, off, reset (default) or stat.
-.TP
-\fB-r\fP \fIrpower\fP
-The path to the rpower binary.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_xcat.
-.TP
-\fInodename = < param >\fR
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fIaction = < param >\fR
-The action required.  on, off, reset (default) or stat.
-.TP
-\fIrpower = < param >\fR
-The path to the rpower binary.
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_bladecenter(8), nodelist.tab(8), rpower(1), xCAT(1)
diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
deleted file mode 100644
index 2d8166a..0000000
--- a/fence/agents/xcat/fence_xcat.pl
+++ /dev/null
@@ -1,197 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-$opt_o = 'reset';        # Default fence action
-$opt_r = 'rpower';        # Default fence action
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage
-{
-    print "Usage:\n";
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -h               usage\n";
-    print "  -n <name>        nodename\n";
-    print "  -o <string>      Action:  on | off | reset (default) | stat\n";
-    print "  -r <rpower>      rpower command\n";
-    print "  -q               quiet mode\n";
-    print "  -V               version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg) = @_;
-  print $msg."\n" unless defined $opt_q;
-  $t->close if defined $t;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)=@_;
-  print STDERR $msg."\n" if $msg;
-  print STDERR "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-        $_ = $in;
-        chomp;
-
-	# strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-	# skip comments
-        next if /^#/;
-
-        $line+=1;
-        $opt=$_;
-        next unless $opt;
-
-        ($name,$val)=split /\s*=\s*/, $opt;
-
-        if ( $name eq "" )
-        {  
-           print STDERR "parse error: illegal name in option $line\n";
-           exit 2;
-	}
-	
-        # DO NOTHING -- this field is used by fenced
-	elsif ($name eq "agent" ) { } 
-
-        elsif ($name eq "action" )
-        {
-            $opt_o = $val;
-        }
-	elsif ($name eq "nodename" ) 
-	{
-            $opt_n = $val;
-        } 
-	elsif ($name eq "rpower" ) 
-	{
-            $opt_r = $val;
-        } 
-
-    }
-}
-
-######################################################################33
-# MAIN
-
-if (@ARGV > 0) {
-   getopts("hn:o:r:qV") || fail_usage ;
-
-   usage if defined $opt_h;
-   version if defined $opt_V;
-
-   fail_usage "Unknown parameter." if (@ARGV > 0);
-
-   fail_usage "No '-n' flag specified." unless defined $opt_n;
-   $opt_o=lc($opt_o);
-   fail_usage "Unrecognised action '$opt_o' for '-o' flag"
-      unless $opt_o =~ /^(on|off|reset|stat)$/;
-
-} else {
-   get_options_stdin();
-
-   fail "failed: no plug number" unless defined $opt_n;
-   $opt_o=lc($opt_o);
-   fail "failed: unrecognised action: $opt_o"
-      unless $opt_o =~ /^(on|off|reset|stat)$/;
-}
-
-pipe (RDR,WTR);
-
-if ( $pid=fork() == 0 )
-{
-   close RDR;
-
-   open STDOUT, ">&WTR";
-   exec "$opt_r $opt_n $opt_o" or die "failed to exec \"$opt_r\"\n";
-}
-
-close WTR;
-
-wait;
-
-if ( $? != 0 )
-{
-   die "failed: rpower error: exit $?\n"
-}
-
-$found=0;
-$status="";
-while (<RDR>)
-{
-   chomp;
-
-   if ( $_ =~ /^(\S+): (\S+)$/)
-   {
-      if ($opt_n eq $1) 
-      {
-         $status = $2;
-
-         if (($opt_o eq $2) || ($opt_o eq "stat"))
-         {
-            $found=1;
-            last;
-         }
-      }
-   }
-}
-
-print (($found ? "success":"failed") . ": $opt_n $status\n")
-   unless defined $opt_q;
-
-exit ($found ? 0 : 1 );
-
-
-
-
-
-
-
-
-
diff --git a/fence/agents/xvm/Makefile b/fence/agents/xvm/Makefile
deleted file mode 100644
index 1ff9e3e..0000000
--- a/fence/agents/xvm/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-TARGET1= fence_xvmd
-TARGET2= testprog
-
-MANTARGET=$(TARGET1).8
-
-SBINDIRT=$(TARGET1)
-
-all: ${TARGET1}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS1=	fence_xvmd.o \
-	virt.o \
-	options-ccs.o \
-	vm_states.o \
-	xml.o \
-	mcast.o \
-	simple_auth.o \
-	tcp.o \
-	options.o \
-	debug.o
-
-
-OBJS2=	xml-standalone.o
-
-CFLAGS += -D_GNU_SOURCE
-CFLAGS += -I${ccsincdir} -I${cmanincdir}
-CFLAGS += -I${corosyncincdir} -I${openaisincdir}
-CFLAGS += -I${logtincdir}
-CFLAGS += -I${virtincdir} -I${nssincdir} -I${nsprincdir}
-CFLAGS += `xml2-config --cflags`
-CFLAGS += -I${incdir}
-
-STANDALONE_CFLAGS += -DSTANDALONE
-
-LDFLAGS += -L${nsslibdir} -lnss3
-LDFLAGS += -L${logtlibdir} -llogthread
-LDFLAGS += -L${libdir}
-LDFLAGS += -L${ccslibdir} -lccs -L${cmanlibdir} -lcman
-LDFLAGS += -L${virtlibdir} -lvirt
-LDFLAGS += -L${openaislibdir} -lSaCkpt
-
-XML_LDFLAGS += `xml2-config --libs`
-
-${TARGET1}: ${SHAREDOBJS} ${OBJS1}
-	$(CC) -o $@ $^ $(XML_LDFLAGS) $(LDFLAGS)
-
-${TARGET2}: ${OBJS2}
-	$(CC) -o $@ $^ $(XML_LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS1:.o=.d)
--include $(OBJS2:.o=.d)
diff --git a/fence/agents/xvm/README b/fence/agents/xvm/README
deleted file mode 100644
index 401666d..0000000
--- a/fence/agents/xvm/README
+++ /dev/null
@@ -1,182 +0,0 @@
-I. Fence_xvm - virtual machine fencing agent
-
-Fence_xvm is an agent which establishes a communications link between
-a cluster of virtual machines (VC) and a cluster of domain0/physical
-nodes which are hosting the virtual cluster.  Its operations are
-fairly simple.
-
-  (a) Start a listener service.
-  (b) Send a multicast packet requesting that a VM be fenced.
-  (c) Authenticate client.
-  (e) Read response.
-  (f) Exit with success/failure, depending on the response received.
-
-If any of the above steps fail, the fencing agent exits with a failure
-code and fencing is retried by the virtual cluster at a later time.
-Because of the simplicty of fence_xvm, it is not necessary that
-fence_xvm be run from within a virtualized guest - all it needs is
-libnspr and libnss and a shared private key (for authentication; we
-would hate to receive a false positive response from a node not in the
-cluster!).
-
-
-II. Fence_xvmd - The virtual machine fencing host
-
-Fence_xvmd is a daemon which runs on physical hosts (e.g. in domain0)
-of the cluster hosting the virtual cluster.  It listens on a port
-for multicast traffic from virtual cluster(s), and takes actions.
-Multiple disjoint virtual clusters can coexist on a single physical
-host cluster, but this requires multiple instances of fence_xvmd.
-
-NOTE: fence_xvmd *MUST* be run on ALL nodes in a given cluster which
-will be hosting virtual machines if fence_xvm is to be used for 
-fencing!
-
-There are a couple of ways the multicast packet is handled,
-depending on the state of the host OS.  It might be hosting the VM,
-or it might not.  Furthermore, the VM might "reside" on a host which
-has failed.
-
-In order to be able to guarantee safe fencing of a VM even if the
-last- known host is down, we must store the last-known locations of
-each virtual machine in some sort of cluster-wide way.  For this, we
-use the AIS Checkpointing API, which is provided by OpenAIS.  Every
-few seconds, fence_xvmd queries the hypervisor via libvirt and
-stores any local VM states in a checkpoint.  In the event of a
-physical node failure (which consequently causes the failure of one
-or more guests), we can then read the checkpoint section corresponding
-to the guest we need to fence to find out the previous
-owner.  With that information, we can then check with CMAN to see if
-the last-known host node has been fenced.  If so, then the VM is
-clean as well.  The physical cluster must, therefore, have fencing
-in order for fence_xvmd to work.
-
-Operation of a node hosting a VM which needs to be fenced:
-  
-  (a) Receive multicast packet
-  (b) Authenticate multicast packet
-  (c) Open connection to host contained within multicast
-      packet.
-  (d) Authenticate server.
-  (e) Carry out fencing operation (e.g. call libvirt to destroy or
-      reboot the VM; there is no "on" method at this point).
-  (f) If operation succeeds, send success response.
-
-Operation of high-node-ID:
-
-  (a) Receive multicast packet
-  (b) Authenticate multicast packet
-  (c) Read VM state from checkpoint
-  (d) Check liveliness of nodeID hosting VM (if alive, do nothing)
-  (e) Open connection to host contained within multicast
-      packet.
-  (f) Check with CMAN to see if last-known host has been fenced.
-      (If it has not; do nothing -- this is why the physical 
-      cluster also needs fencing!)
-  (g) Authenticate server & send response.
-  (h) If last-known host has been fenced, send success response.
-
-NOTE: There is always a possibility that a VM is started again
-before the fencing operation and checkpoint update for that VM
-occurs.  If the VM has booted and rejoined the cluster, fencing will
-not be necessary.  If it is in the process of booting, but has not
-yet joined the cluster, fencing will also not be necessary - because
-it will not be using cluster resources yet.
-
-
-III. Security considerations
-
-While fencing is generally expected to run on a more or less trusted
-network, there are cases where it may not be.
-
-* The multicast packet is subject to replay attacks, but because no
-fencing action is taken based solely on the information contained
-within the packet, this should not allow an attacker to maliciously
-fence a VM from outside the cluster, though it may be possible to
-cause a DoS of fence_xvmd if enough multicast packets are sent.
-
-* The only currently supported authentication mechanisms are simple
-challenge-response based on a shared private key and pseudorandom
-number generation.
-
-* An attacker with access to the shared key(s) can easily fence any
-known VM, even if they are not on a cluster node.
-
-* Different shared keys should be used for different virtual
-clusters on the same subnet (whether in the same physical cluster
-or not).  Additionally, multiple fence_xvmd instances must be run
-(each listening on a different multicast IP + port combination).
-
-IV.  Configuration
-
-Generate a random key file.  An example of how to generate it is:
-
-    dd if=/dev/urandom of=/etc/cluster/fence_xvm.key bs=4096 count=1
-
-Distribute the generated key file to all virtual machines in a
-cluster as well as all physical host nodes which will be hosting
-that particular cluster of guests.  More simply, everything involved
-with hosting the virtual cluster as well as the virtual cluster
-itself must have the same key file; it acts as a password.
-
-The key should not be placed on shared file systems (because shared
-file systems require the cluster, which requires fencing...).  
-Furthermore, it is considered 'unsupported' to join a host cluster
-and a guest cluster in one management domain.
-
-A. Configuring the host (physical) cluster
-
-On the host cluster, you need to add the following tag as a
-child of the <cluster> tag in /etc/cluster/cluster.conf:
-
-    <fence_xvmd/>
-
-(Do not forget to increment the configuration version number and
-run 'ccs_tool update /etc/cluster/cluster.conf' !).
-
-Start fence_xvmd on all host nodes if it isn't already running.
-Just run 'fence_xvmd'.  The next time the cluster is restarted,
-fence_xvmd will start automatically; it is started by the cman
-script if you have the above tag in cluster.conf.
-
-B.  Configuring the guest (virtual) cluster
-
-On the guest cluster, you need to set up per-node fencing.  This
-is a fairly simple task as well.  First, you need to add a fence
-device for 'xvm'.  Simply add the following to the <fencedevices/>
-tag in the guest cluster's cluster.conf:
-
-    <fencedevice name="xvm" agent="fence_xvm"/>
-
-After doing this, each node also needs individual fencing set up.
-For each <clusternode/> tag, you will need to add something like
-the following:
-
-    <fence>
-        <method name="1">
-            <device name="xvm" domain="doman-name"/>
-        </method>
-    </fence>
-
-For example, if you have a virtual host named 'vm1.test.com' with a
-corresponding virtual domain name of 'domU-vm1' in the dom0 cluster,
-and a node ID of 1, the <clusternode> tag for that virtual machine
-would look like so:
-
-    <clusternode name="vm1.test.com" nodeid="1" votes="1">
-        <fence>
-            <method name="1">
-                <device name="xvm" domain="domU-vm1"/>
-            </method>
-        </fence>
-    </clusternode>
-
-C. Advanced configuration
-
-Any advanced configuration parameters (e.g. changing authentication,
-hashing, key file, etc.) should be included in the <fence_xvmd/> tag
-in the host cluster and the <fencedevice .../> tag in the guest
-cluster.  For a complete list of advanced parameters, see:
-
-    fence_xvmd -h
-    fence_xvm -h
diff --git a/fence/agents/xvm/TODO b/fence/agents/xvm/TODO
deleted file mode 100644
index 0158742..0000000
--- a/fence/agents/xvm/TODO
+++ /dev/null
@@ -1,33 +0,0 @@
-High Priority / Blockers:
-
-* Nothing at this time.
-
-Medium Priority:
-
-* Need to add ability for fence_xvmd to forcefully fence the host
-dom0 if it's not responding.  Medium because it should not be the
-default behavior since fencing a host can affect multiple domains
-across potentially multiple domU clusters.  This will be a server-
-side configuration option; domUs will not be able to override it.
-
-* Support multiple authentication keys in fence_xvmd simultaneously
-so that we can fence multiple clusters with only one instance of
-fence_xvmd running on a given dom0.
-
-Low Priority:
-
-* Turn README in to man pages.
-
-* Make sure CMAN is running and/or restart/reconnect if CMAN goes
-away and comes back.  (If CMAN dies, we have big problems anyway)
-
-* Add SSL connection support.  (Challenge/response on a trusted
-network should be okay.)
-
-* Make sure addresses contained in the multicast packet are always
-in network-byte order.  Low because it will be unlikely that the
-host-byte ordering of a domU and its dom0 will be different.
-
-* Make sure node IDs and VM states stored in openais checkpoints
-are in network-byte order and swap back/forth if not.
-
diff --git a/fence/agents/xvm/debug.c b/fence/agents/xvm/debug.c
deleted file mode 100644
index d8bd109..0000000
--- a/fence/agents/xvm/debug.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include "debug.h"
-
-static int _debug = 0;
-
-inline void
-dset(int threshold)
-{
-	_debug = threshold;
-	dbg_printf(3, "Debugging threshold is now %d\n", threshold);
-}
-
-inline int
-dget(void)
-{
-	return _debug;
-}
-
diff --git a/fence/agents/xvm/debug.h b/fence/agents/xvm/debug.h
deleted file mode 100644
index 84a5df9..0000000
--- a/fence/agents/xvm/debug.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _DBG_H
-#define _DBG_H
-
-#include <liblogthread.h>
-
-inline void dset(int);
-inline int dget(void);
-
-#define dbg_printf(level, fmt, args...) \
-do { \
-	if (dget()>=level) \
-		logt_print(LOG_DEBUG, fmt, ##args); \
-} while(0)
-
-#endif
diff --git a/fence/agents/xvm/fence_xvmd.8 b/fence/agents/xvm/fence_xvmd.8
deleted file mode 100644
index 23e7c6e..0000000
--- a/fence/agents/xvm/fence_xvmd.8
+++ /dev/null
@@ -1,124 +0,0 @@
-.TH fence_xvmd 8
-
-.SH NAME
-fence_xvmd - Libvirt-based, general purpose fencing host for virtual machines.
-
-.SH SYNOPSIS
-.B
-fence_xvmd
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_xvmd is an I/O Fencing host which resides on bare metal machines
-and is used in conjunction with the fence_xvm fencing agent.  Together,
-these two programs can be used to fence can be used 
-machines which are part of a cluster.
-
-If the virtual machines are backed by clustered storage or the virtual
-machines may be migrated to other physical machines, all physical
-machines in question must also be a part of their own CMAN/OpenAIS based
-cluster.  Furthermore, the bare metal cluster is required to have
-fencing configured if virtual machine recovery is expected to be automatic.
-
-fence_xvmd accepts options on the command line and from cluster.conf
-
-.SH OPTIONS
-.TP
-\fB-f\fP
-Foreground mode (do not fork)
-.TP
-\fB-d\fP
-Enable debugging output.  The more times you specify this parameter,
-the more debugging output you will receive.
-.TP
-\fB-i\fP \fIfamily\fP
-IP family to use (auto, ipv4, or ipv6; default = auto)
-.TP
-\fB-a\fP \fIaddress\fP
-Multicast address to listen on (default=225.0.0.12 for ipv4, ff02::3:1
-for ipv6)
-.TP
-\fB-p\fP \fIport\fP
-Port to use (default=1229)
-.TP
-\fB-I\fP \fIinterface\fP
-Network interface to listen on, e.g. eth0.
-.TP
-\fB-C\fP \fIauth\fP
-Authentication type (none, sha1, sha256, sha512; default=sha256).  This
-controls the authentication mechanism used to authenticate clients.  The
-three SHA hashes use a key which must be shared between both the virtual
-machines and the host machine or cluster.  The three SHA authentication 
-mechanisms use a simple bidirectional challenge-response based on pseudo-
-random number generation and a shared private key.
-.TP
-\fB-c\fP \fIhash\fP
-Packet hash type (none, sha1, sha256, sha512; default=sha256).  This
-controls the hashing mechanism used to authenticate fencing requests.  The
-three SHA hashes use a key which must be shared between both the virtual
-machines and the host machine or cluster.
-.TP
-\fB-k\fP \fIkey_file\fP
-Use the specified key file for packet hashing / SHA authentication.
-When both the hash type and the authentication type are set to "none",
-this parameter is ignored.
-.TP
-\fB-u\fP
-Fence by UUID instead of virtual machine name.
-.TP
-\fB-?\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-X\fP
-Do not connect to CCS for configuration; only use command line
-parameters.  CCS configuration parameters override command line
-parameters (because they are cluster-wide), so if you need to 
-override a configuration option contained in CCS, you must specify
-this parameter.
-.TP
-\fB-L\fP
-Local-only / non-cluster mode.  When used with -X, this this option
-prevents fence_xvmd from operating as a clustered service, obviating
-the need to configure/run CMAN on the host domain.
-.TP
-\fB-U\fP \fIuri\fP
-Force use of the specified URI for connecting to the hypervisor.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH CCS PARAMETERS
-CCS options are simply attributes of the <fence_xvmd> tag, a
-child of the <cluster> tag in /etc/cluster/cluster.conf.
-.TP
-\fIdebug="1"\fR
-Same as the -d option.  Specify numbers >1 for more debugging information.
-.TP
-\fIfamily="param"\fR
-Same as the -i option.
-.TP
-\fImulticast_address="param"\fR
-Same as the -a option.
-.TP
-\fIport="param"\fR
-Same as the -p option.
-.TP
-\fIauth="param"\fR
-Same as the -C option.
-.TP
-\fIhash="param"\fR
-Same as the -c option.
-.TP
-\fIkey_file="param"\fR
-Same as the -k option.
-.TP
-\fIuse_uuid="1"\fR
-Same as the -u option.
-.TP
-
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_xvm(8)
diff --git a/fence/agents/xvm/fence_xvmd.c b/fence/agents/xvm/fence_xvmd.c
deleted file mode 100644
index f2199d7..0000000
--- a/fence/agents/xvm/fence_xvmd.c
+++ /dev/null
@@ -1,994 +0,0 @@
-/*
- * Author: Lon Hohberger <lhh at redhat.com>
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/un.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <limits.h>
-#include <pthread.h>
-#define SYSLOG_NAMES
-#include <syslog.h>
-#include <virterror.h>
-#include <nss.h>
-#include <libgen.h>
-#include <ccs.h>
-#include <liblogthread.h>
-
-/* Local includes */
-#include "xvm.h"
-#include "simple_auth.h"
-#include "options.h"
-#include "mcast.h"
-#include "tcp.h"
-#include "virt.h"
-#include "libcman.h"
-#include "debug.h"
-
-static int running = 1;
-static int reload_key;
-
-#define LOG_DAEMON_NAME  "xvmd"
-#define LOG_MODE_DEFAULT LOG_MODE_OUTPUT_SYSLOG|LOG_MODE_OUTPUT_FILE
-static int log_mode_default = LOG_MODE_DEFAULT;
-
-extern int cleanup_xml(char *xmldesc, char **ret, size_t *retsz);
-
-static int
-connect_tcp(fence_req_t *req, fence_auth_type_t auth,
-	    void *key, size_t key_len)
-{
-	int fd = -1;
-	struct sockaddr_in sin;
-	struct sockaddr_in6 sin6;
-	char buf[128];
-
-	switch(req->family) {
-	case PF_INET:
-		memset(&sin, 0, sizeof(sin));
-		memcpy(&sin.sin_addr, req->address,
-		       sizeof(sin.sin_addr));
-		sin.sin_family = PF_INET;
-		fd = ipv4_connect(&sin.sin_addr, req->port,
-				  5);
-		if (fd < 0) {
-			logt_print(LOG_ERR,
-				   "Failed to connect to caller: %s\n",
-				   strerror(errno));
-			return -1;
-		}
-		break;
-	case PF_INET6:
-		memset(&sin6, 0, sizeof(sin));
-		memcpy(&sin6.sin6_addr, req->address,
-		       sizeof(sin6.sin6_addr));
-		sin.sin_family = PF_INET6;
-		fd = ipv6_connect(&sin6.sin6_addr, req->port,
-				  5);
-
-		memset(buf,0,sizeof(buf));
-		inet_ntop(PF_INET6, &sin6.sin6_addr, buf, sizeof(buf));
-
-		if (fd < 0) {
-			logt_print(LOG_ERR, "Failed to call back %s\n", buf);
-			return -1;
-		}
-		break;
-	default:
-		dbg_printf(1, "Family = %d\n", req->family);
-		return -1;
-	}
-
-	/* Noops if auth == AUTH_NONE */
-	if (tcp_response(fd, auth, key, key_len, 10) <= 0) {
-		logt_print(LOG_ERR, "Failed to respond to challenge\n");
-		close(fd);
-		return -1;
-	}
-
-	if (tcp_challenge(fd, auth, key, key_len, 10) <= 0) {
-		logt_print(LOG_ERR, "Remote failed challenge\n");
-		close(fd);
-		return -1;
-	}
-	return fd;
-}
-
-
-static int
-do_notify_caller_tcp(fence_req_t *req, fence_auth_type_t auth,
-		     void *key, size_t key_len, char response)
-{
-	int fd;
-
-	fd = connect_tcp(req, auth, key, key_len);
-	if (fd < 0)
-		goto out;
-
-	if (write(fd, &response, 1) < 0) {
-		perror("write");
-	}
-out:
-	if (fd != -1) {
-		close(fd);
-		return 0;
-	}
-
-	return -1;
-}
-
-static inline virDomainPtr
-get_domain(fence_req_t *req, virConnectPtr vp)
-{
-	if (req->flags & RF_UUID) {
-		return virDomainLookupByUUIDString(vp,
-					(const char *)req->domain);
-	}
-
-	return virDomainLookupByName(vp, (const char *)req->domain);
-}
-
-
-static inline int
-wait_domain(fence_req_t *req, virConnectPtr vp, int timeout)
-{
-	int tries = 0;
-	int response = 1;
-	virDomainPtr vdp;
-	virDomainInfo di;
-
-	if (!(vdp = get_domain(req, vp)))
-		return 0;
-
-	/* Check domain liveliness.  If the domain is still here,
-	   we return failure, and the client must then retry */
-	/* XXX On the xen 3.0.4 API, we will be able to guarantee
-	   synchronous virDomainDestroy, so this check will not
-	   be necessary */
-	do {
-		sleep(1);
-		vdp = get_domain(req, vp);
-		if (!vdp) {
-			dbg_printf(2, "Domain no longer exists\n");
-			response = 0;
-			break;
-		}
-
-		memset(&di, 0, sizeof(di));
-		virDomainGetInfo(vdp, &di);
-		virDomainFree(vdp);
-
-		if (di.state == VIR_DOMAIN_SHUTOFF) {
-			dbg_printf(2, "Domain has been shut off\n");
-			response = 0;
-			break;
-		}
-		
-		dbg_printf(4, "Domain still exists (state %d) after %d seconds\n",
-			di.state, tries);
-
-		if (++tries >= timeout)
-			break;
-	} while (1);
-
-	return response;
-}
-
-
-
-
-static int
-do_fence_request_tcp(fence_req_t *req, fence_auth_type_t auth,
-		     void *key, size_t key_len, virConnectPtr vp,
-		     int flags)
-{
-	int fd = -1, ret = -1;
-	virDomainPtr vdp = NULL, nvdp = NULL;
-	virDomainInfo vdi;
-	char response = 1;
-	char *domain_desc, *domain_desc_sanitized;
-	size_t sz;
-
-	if (!(vdp = get_domain(req, vp)) && (!(flags & F_NOCLUSTER))) {
-		dbg_printf(2, "Could not find domain: %s\n", req->domain);
-		goto out;
-	}
-
-	fd = connect_tcp(req, auth, key, key_len);
-	if (fd < 0) {
-		dbg_printf(2, "Could call back for fence request: %s\n", 
-			strerror(errno));
-		goto out;
-	}
-
-	switch(req->request) {
-	case FENCE_NULL:
-		dbg_printf(1, "NULL operation: returning failure\n");
-		response = 1;
-		break;
-	case FENCE_OFF:
-		logt_print(LOG_NOTICE, "Destroying domain %s...\n",
-			   (char *)req->domain);
-		if (flags & F_NOCLUSTER) {
-			if (!vdp ||
-			    ((virDomainGetInfo(vdp, &vdi) == 0) &&
-			     (vdi.state == VIR_DOMAIN_SHUTOFF))) {
-				dbg_printf(2, "[NOCLUSTER] Nothing to "
-					   "do - domain does not exist\n");
-				response = 0;
-				break;
-			}
-		}
-
-
-		dbg_printf(2, "[OFF] Calling virDomainDestroy\n");
-		ret = virDomainDestroy(vdp);
-		if (ret < 0) {
-			logt_print(LOG_ERR,
-				   "virDomainDestroy() failed: %d\n",
-				   ret);
-			break;
-		}
-
-		response = wait_domain(req, vp, 15);
-
-		if (response) {
-			logt_print(LOG_ERR,
-			   "Domain %s still exists; fencing failed\n",
-			   (char *)req->domain);
-		}
-		break;
-	case FENCE_REBOOT:
-		logt_print(LOG_NOTICE, "Rebooting domain %s...\n",
-			   (char *)req->domain);
-
-		if (flags & F_NOCLUSTER) {
-			if (!vdp ||
-			    ((virDomainGetInfo(vdp, &vdi) == 0) &&
-			     (vdi.state == VIR_DOMAIN_SHUTOFF))) {
-				dbg_printf(2, "[NOCLUSTER] Nothing to "
-					   "do - domain does not exist\n");
-				response = 0;
-				break;
-			}
-		}
-
-		domain_desc = virDomainGetXMLDesc(vdp, 0);
-
-		if (domain_desc) {
-			dbg_printf(3, "[[ XML Domain Info ]]\n");
-			dbg_printf(3, "%s\n[[ XML END ]]\n", domain_desc);
-
-			sz = 0;
-			if (cleanup_xml(domain_desc,
-					&domain_desc_sanitized, &sz) == 0) {
-				free(domain_desc);
-				domain_desc = domain_desc_sanitized;
-			}
-
-			dbg_printf(3, "[[ XML Domain Info (modified) ]]\n");
-			dbg_printf(3, "%s\n[[ XML END ]]\n", domain_desc);
-		} else {
-			dbg_printf(1, "Failed getting domain description from "
-				   "libvirt\n");
-		}
-
-		dbg_printf(2, "[REBOOT] Calling virDomainDestroy(%p)\n", vdp);
-		ret = virDomainDestroy(vdp);
-		if (ret < 0) {
-			logt_print(LOG_ERR,
-				   "virDomainDestroy() failed: %d/%d\n",
-				   ret, errno);
-			if (domain_desc)
-				free(domain_desc);
-			break;
-		}
-
-		response = wait_domain(req, vp, 15);
-
-		if (response) {
-			logt_print(LOG_ERR,
-				   "Domain %s still exists; fencing failed\n",
-				   (char *)req->domain);
-		} else if (domain_desc) {
-			/* Recreate the domain if possible */
-			/* Success... or not? */
-			dbg_printf(2, "Calling virDomainCreateLinux()...\n");
-			nvdp = virDomainCreateLinux(vp, domain_desc, 0);
-
-			if (nvdp == NULL) {
-				/* More recent versions of libvirt or perhaps the
- 				   KVM back-end do not let you create a domain from
- 				   XML if there is already a defined domain description
- 				   with the same name that it knows about.  You must
- 				   then call virDomainCreate() */
-				dbg_printf(2, "Failed; Trying virDomainCreate()...\n");
-				if (virDomainCreate(vdp) < 0) {
-					logt_print(LOG_ERR, "Failed to recreate guest"
-						   " %s!\n", (char *)req->domain);
-				}
-			}
-			free(domain_desc);
-		}
-		break;
-	}
-
-	dbg_printf(3, "Sending response to caller...\n");
-	if (write(fd, &response, 1) < 0) {
-		logt_print(LOG_ERR, "Failed to send response to caller: %s\n",
-			   strerror(errno));
-	}
-out:
-	if (vdp)
-		virDomainFree(vdp);
-	if (nvdp)
-		virDomainFree(nvdp);
-	if (fd != -1)
-		close(fd);
-
-	return 1;
-}
-
-
-static int
-virt_list_update(virConnectPtr vp, virt_list_t **vl, int my_id)
-{
-	virt_list_t *list = NULL;
-
-	list = vl_get(vp, my_id);
-	if (!list)
-		return -1;
-
-	if (*vl)
-		vl_free(*vl);
-	*vl = list;
-
-	return 0;
-}
-
-
-static int
-get_cman_ids(cman_handle_t ch, int *my_id, int *high_id)
-{
-	int max_nodes;
-	int actual;
-	cman_node_t *nodes = NULL;
-	cman_node_t me;
-	int high = 0, ret = -1, x, _local = 0;
-
-	if (!my_id && !high_id)
-		return 0;
-
-	if (!ch) {
-		_local = 1;
-		ch = cman_init(NULL);
-	}
-	if (!ch)
-		return -1;
-
-	max_nodes = cman_get_node_count(ch);
-	if (max_nodes <= 0)
-		goto out;
-
-	if (my_id) {
-		memset(&me, 0, sizeof(me));
-		if (cman_get_node(ch, CMAN_NODEID_US, &me) < 0)
-			goto out;
-		*my_id = me.cn_nodeid;
-	}
-
-	if (!high_id) {
-		ret = 0;
-		goto out;
-	}
-
-	nodes = malloc(sizeof(cman_node_t) * max_nodes);
-	if (!nodes)
-		goto out;
-	memset(nodes, 0, sizeof(cman_node_t) * max_nodes);
-
-	if (cman_get_nodes(ch, max_nodes, &actual, nodes) < 0)
-		goto out;
-
-	for (x = 0; x < actual; x++)
-		if (nodes[x].cn_nodeid > high && nodes[x].cn_member)
-			high = nodes[x].cn_nodeid;
-
-	*high_id = high;
-
-	ret = 0;
-out:
-	if (nodes)
-		free(nodes);
-	if (ch && _local)
-		cman_finish(ch);
-	return ret;
-}
-
-
-static int
-get_domain_state_ckpt(void *hp, unsigned char *domain, vm_state_t *state)
-{
-	errno = EINVAL;
-
-	if (!hp || !domain || !state || !strlen((char *)domain))
-		return -1;
-	if (!strcmp(DOMAIN0NAME, (char *)domain))
-		return -1;
-
-	return ckpt_read(hp, (char *)domain, state, sizeof(*state));
-}
-
-
-static void
-store_domains_by_name(void *hp, virt_list_t *vl)
-{
-	int x;
-
-	if (!vl)
-		return;
-
-	for (x = 0; x < vl->vm_count; x++) {
-		if (!strcmp(DOMAIN0NAME, vl->vm_states[x].v_name))
-			continue;
-		dbg_printf(2, "Storing %s\n", vl->vm_states[x].v_name);
-		ckpt_write(hp, vl->vm_states[x].v_name, 
-			   &vl->vm_states[x].v_state,
-			   sizeof(vm_state_t));
-	}
-}
-
-
-static void
-store_domains_by_uuid(void *hp, virt_list_t *vl)
-{
-	int x;
-
-	if (!vl)
-		return;
-
-	for (x = 0; x < vl->vm_count; x++) {
-		if (!strcmp(DOMAIN0UUID, vl->vm_states[x].v_uuid))
-			continue;
-		dbg_printf(2, "Storing %s\n", vl->vm_states[x].v_uuid);
-		ckpt_write(hp, vl->vm_states[x].v_uuid, 
-			   &vl->vm_states[x].v_state,
-			   sizeof(vm_state_t));
-	}
-}
-
-
-static void
-handle_remote_domain(cman_handle_t ch, void *h, fence_req_t *data,
-		     fence_auth_type_t auth, void *key, size_t key_len,
-		     int my_id)
-{
-	vm_state_t vst;
-	int high_id;
-	int fenced;
-	uint64_t fence_time;
-	char ret = 1;
-	cman_node_t node;
-	
-
-	if (get_domain_state_ckpt(h, data->domain, &vst) < 0) {
-		dbg_printf(1, "Evaluating Domain: %s   Last Owner/State Unknown\n",
-		       data->domain);
-		memset(&vst, 0, sizeof(vst));
-	} else {
-		dbg_printf(1, "Evaluating Domain: %s   Last Owner: %d   State %d\n",
-		       data->domain, vst.s_owner, vst.s_state);
-	}
-			
-	if (get_cman_ids(ch, NULL, &high_id) < 0) {
-		logt_print(LOG_ERR,
-			   "Error: Could not determine high node ID; "
-			   "unable to process fencing request\n");
-		return;
-	}
-	
-	if (my_id == high_id && vst.s_owner == 0) {
-		dbg_printf(1, "There is no record of that domain; "
-		       "returning success\n");
-		ret = 0;
-	} else if (my_id == high_id && vst.s_owner != my_id) {
-
-		memset(&node, 0, sizeof(node));
-		cman_get_node(ch, vst.s_owner, &node);
-		if (node.cn_nodeid == 0) {
-			dbg_printf(1, "Node %d does not exist\n",
-				   vst.s_owner);
-			return;
-		}
-
-		if (node.cn_member) {
-			dbg_printf(1,
-				   "Node %d is online - not taking action\n",
-				   vst.s_owner);
-			return;
-		}
-
-		fenced = 0;
-		cman_get_fenceinfo(ch, vst.s_owner, &fence_time, &fenced, NULL);
-		if (fenced == 0) {
-			dbg_printf(1, "Node %d is dead but not fenced - not "
-				   "taking action\n", vst.s_owner);
-			return;
-		}
-
-		dbg_printf(1, "Node %d is dead & fenced\n", vst.s_owner);
-		ret = 0;
-					
-	} else if (vst.s_owner == my_id) {
-		dbg_printf(1, "I am the last owner of the domain\n");
-		ret = 0;
-	}
-
-	if (!ret) {
-		switch(auth) {
-		case AUTH_NONE:
-		case AUTH_SHA1:
-		case AUTH_SHA256:
-		case AUTH_SHA512:
-			dbg_printf(1, "Plain TCP request\n");
-			do_notify_caller_tcp(data, auth, key, key_len, ret);
-			break;
-		default:
-			dbg_printf(1, "XXX Unhandled authentication\n");
-		}
-	}
-}
-
-
-static int
-xvmd_loop(cman_handle_t ch, void *h, int fd, fence_xvm_args_t *args,
-	  void *key, size_t key_len)
-{
-	fd_set rfds;
-	struct timeval tv;
-	struct sockaddr_in sin;
-	int len;
-	int n;
-	int my_id = 1;
-	socklen_t slen;
-	fence_req_t data;
-	virConnectPtr vp = NULL;
-	virt_list_t *vl = NULL;
-	virt_state_t *dom = NULL;
-
-	vp = virConnectOpen(args->uri);
-  	if (!vp)
-		logt_print(LOG_ERR, "virConnectOpen failed: %s\n",
-			   strerror(errno));
-  
-  	if (!(args->flags & F_NOCLUSTER))
-  		get_cman_ids(ch, &my_id, NULL);
-  
-	dbg_printf(1, "My Node ID = %d\n", my_id);
-	
-	if (vp) {
-		vl = vl_get(vp, my_id);
-		vl_print(vl);
-		virt_list_update(vp, &vl, my_id);
-		if (args->flags & F_USE_UUID) 
-			store_domains_by_uuid(h, vl);
-		else
-			store_domains_by_name(h, vl);
-	}
-
-	while (running) {
-		FD_ZERO(&rfds);
-		FD_SET(fd, &rfds);
-		tv.tv_sec = 10;
-		tv.tv_usec = 0;
-
-		/* Close the connection */
-		if (vp) {
-			virConnectClose(vp);
-			vp = NULL;
-		}
-
-		if (reload_key) {
-			char temp_key[MAX_KEY_LEN];
-			int ret;
-
-			reload_key = 0;
-
-			ret = read_key_file(args->key_file, temp_key,
-					    sizeof(temp_key));
-			if (ret < 0) {
-				logt_print(LOG_ERR, "Could not read %s; not updating key",
-					args->key_file);
-			} else {
-				memcpy(key, temp_key, MAX_KEY_LEN);
-				key_len = (size_t) ret;
-
-				if (args->auth == AUTH_NONE)
-					args->auth = AUTH_SHA256;
-				if (args->hash == HASH_NONE)
-					args->hash = HASH_SHA256;
-			}
-		}
-		
-		n = select(fd+1, &rfds, NULL, NULL, &tv);
-		if (n < 0)
-			continue;
-	
-		/* Request and/or timeout: open connection */
-		vp = virConnectOpen(args->uri);
-		if (!vp) {
-			logt_print(LOG_NOTICE, "NOTICE: virConnectOpen(): "
-				   "%s; cannot fence!\n", strerror(errno));
-			continue;
-		}
-			
-		/* Update list of VMs from libvirt. */
-		virt_list_update(vp, &vl, my_id);
-		vl_print(vl);
-
-		/* Store information here */
-		if (!(args->flags & F_NOCLUSTER)) {
-			if (args->flags & F_USE_UUID) 
-				store_domains_by_uuid(h, vl);
-			else
-				store_domains_by_name(h, vl);
-		}
-		
-		/* 
-		 * If no requests, we're done 
-		 */
-		if (n == 0)
-			continue;
-
-		slen = sizeof(sin);
-		len = recvfrom(fd, &data, sizeof(data), 0,
-			       (struct sockaddr *)&sin, &slen);
-		
-		if (len <= 0) {
-			logt_print(LOG_ERR, "recvfrom: %s\n",
-				   strerror(errno));
-			continue;
-		}
-
-		if (!verify_request(&data, args->hash, key, key_len)) {
-			dbg_printf(1, "Key mismatch; dropping packet\n");
-			continue;
-		}
-
-		if ((args->flags & F_USE_UUID) &&
-		    !(data.flags & RF_UUID)) {
-			dbg_printf(1, "Dropping packet: Request to fence by "
-			           "name while using UUIDs\n");
-			continue;
-		}
-
-		if (!(args->flags & F_USE_UUID) &&
-		    (data.flags & RF_UUID)) {
-			dbg_printf(1, "Dropping packet: Request to fence by "
-			           "UUID while using names\n");
-			continue;
-		}
-
-		dbg_printf(1, "Request to fence: %s\n", data.domain);
-		
-		if (args->flags & F_USE_UUID)
-			dom = vl_find_uuid(vl, (char *)data.domain);
-		else
-			dom = vl_find_name(vl, (char *)data.domain);
-		if (!dom && !(args->flags & F_NOCLUSTER)) {
-			handle_remote_domain(ch, h, &data, args->auth,
-					     key, key_len, my_id);
-			continue;
-		}
-
-		dbg_printf(1, "%s is running locally\n", (char *)data.domain);
-
-		switch(args->auth) {
-		case AUTH_NONE:
-		case AUTH_SHA1:
-		case AUTH_SHA256:
-		case AUTH_SHA512:
-			dbg_printf(1, "Plain TCP request\n");
-			do_fence_request_tcp(&data, args->auth, key,
-					     key_len, vp, args->flags);
-			break;
-		default:
-			logt_print(LOG_ERR, "XXX Unhandled authentication\n");
-		}
-	}
-
-	cman_finish(ch);
-	
-	if (vp) {
-		virConnectClose(vp);
-		vp = NULL;
-	}
-
-	return 0;
-}
-
-
-static void
-sigint_handler(int sig)
-{
-	running = 0;
-}
-
-static void
-sighup_handler(int sig)
-{
-	reload_key = 1;
-}
-
-static int
-ccs_read_old_logging(int ccsfd, int *facility, int *priority)
-{
-	char query[256];
-	char *val;
-	int x, ret = 0;
-
-	/* Get log log_facility */
-	snprintf(query, sizeof(query), "/cluster/fence_xvmd/@log_facility");
-	if (ccs_get(ccsfd, query, &val) == 0) {
-		logt_print(LOG_WARNING,
-			   "Use of fence_xvmd/@log_facility is deprecated!\n");
-		for (x = 0; facilitynames[x].c_name; x++) {
-			if (strcasecmp(val, facilitynames[x].c_name))
-				continue;
-			*facility = facilitynames[x].c_val;
-			ret = 1;
-			break;
-		}
-		free(val);
-	}
-
-	/* Get log level */
-	snprintf(query, sizeof(query), "/cluster/fence_xvmd/@log_level");
-	if (ccs_get(ccsfd, query, &val) == 0) {
-		logt_print(LOG_WARNING,
-			   "Use of fence_xvmd/@log_level is deprecated!\n");
-		*priority = atoi(val);
-		free(val);
-		if (*priority < 0)
-			*priority = SYSLOGLEVEL;
-		else
-			ret = 1;
-	}
-
-	return ret;
-}
-
-
-static void
-conf_logging(int debug, int logmode, int facility, int loglevel,
-	     int filelevel, char *fname)
-{
-	static int _log_config = 0;
-
-	if (debug)
-		filelevel = LOG_DEBUG;
-
-	if (_log_config) {
-		logt_conf(LOG_DAEMON_NAME, logmode, facility, loglevel,
-			  filelevel, fname);
-	}
-
-	logt_init(LOG_DAEMON_NAME, logmode, facility, loglevel,
-		  filelevel, fname);
-	_log_config = 1;
-}
-
-
-/**
-  Grab log configuration data from libccs
- */
-static int
-get_log_config_data(int use_ccs, int debug)
-{
-	char fname[PATH_MAX];
-	int logmode = log_mode_default;
-	int facility = SYSLOGFACILITY;
-	int loglevel = SYSLOGLEVEL, filelevel = SYSLOGLEVEL;
-	int need_close = 0, ccsfd = -1;
-
-	logt_print(LOG_DEBUG, "Loading logging configuration\n");
-
-	if (use_ccs) {
-		ccsfd = ccs_connect();
-		if (ccsfd < 0) {
-			logt_print(LOG_ERR, "Failed to gather logging "
-				"configuration; using defaults\n");
-			use_ccs = 0;
-		} else {
-			need_close = 1;
-		}
-	}
-
-	snprintf(fname, sizeof(fname)-1, LOGDIR "/fence_xvmd.log");
-
-	if (use_ccs) {
-		if (ccs_read_old_logging(ccsfd, &facility, &loglevel))
-			filelevel = loglevel;
-
-		ccs_read_logging(ccsfd, LOG_DAEMON_NAME, &debug, &logmode,
-       		 	&facility, &loglevel, &filelevel, (char *)fname);
-	}
-
-	conf_logging(debug, logmode, facility, loglevel, filelevel, fname);
-
-	if (need_close)
-		ccs_disconnect(ccsfd);
-
-	return 0;
-}
-
-
-int
-main(int argc, char **argv)
-{
-	fence_xvm_args_t args;
-	char key[MAX_KEY_LEN];
-	const char *my_options = "dfi:a:p:I:C:U:c:k:u?hLXV";
-	void *h = NULL;
-	char *dbgp = getenv("FENCE_XVMD_DEBUG");
-	cman_handle_t ch = NULL;
-	int key_len = 0, x, mc_sock;
-
-	/* Start w/ stderr output only */
-	conf_logging(0, LOG_MODE_OUTPUT_STDERR, SYSLOGFACILITY,
-		     SYSLOGLEVEL, SYSLOGLEVEL, NULL);
-
-	args_init(&args);
-
-	/* Grab debug level from our environment variable,
-	 * if specified.
-	 */
-	if (dbgp) {
-		x = atoi(dbgp);
-		if (x <= 0)
-			x = 1;	 /* Being set at all implies debug == 1 */
-
-		args.flags |= F_DEBUG;
-		args.debug = x;
-	}
-	args_get_getopt(argc, argv, my_options, &args);
-
-	if (args.flags & F_HELP) {
-		args_usage(argv[0], my_options, 0);
-
-		printf("Arguments may be specified as part of the\n");
-		printf("fence_xvmd tag in cluster.conf in the form of:\n");
-		printf("    <fence_xvmd argname=\"value\" ... />\n\n");
-
-		args_usage(argv[0], my_options, 1);
-		return 0;
-	}
-
-	if (args.flags & F_VERSION) {
-		printf("%s %s\n", basename(argv[0]), XVM_VERSION);
-		printf("fence release %s\n", RELEASE_VERSION);
-		logt_exit();
-		exit(0);
-	}
-
-	if (!(args.flags & F_NOCCS)) {
-		args_get_ccs(my_options, &args);
-	}
-
-	if (args.flags & F_FOREGROUND)
-		log_mode_default |= LOG_MODE_OUTPUT_STDERR;
-	get_log_config_data(!(args.flags & F_NOCCS), args.debug);
-
-	args_finalize(&args);
-	if (args.debug > 0) {
-		dset(args.debug);
-		args_print(&args);
-	}
-
-	if (args.flags & F_ERR)
-		goto out_fail;
-
-	if (args.auth != AUTH_NONE || args.hash != HASH_NONE) {
-		key_len = read_key_file(args.key_file, key, sizeof(key));
-		if (key_len < 0) {
-			logt_print(LOG_WARNING,
-				   "Could not read %s; operating without "
-			           "authentication\n", args.key_file);
-			args.auth = AUTH_NONE;
-			args.hash = HASH_NONE;
-		}
-	}
-
-	/* Fork in to background */
-	/* XXX need to wait for child to successfully start before
-	   exiting... */
-	if (!(args.flags & F_FOREGROUND)) {
-		logt_exit();
-		if(daemon(0,0)) {
-			logt_reinit();
-			logt_print(LOG_ERR, "Could not daemonize\n");
-			goto out_fail;
-		}
-		logt_reinit();
-	}
-
-	if (virInitialize() != 0) {
-		logt_print(LOG_ERR, "Could not initialize libvirt\n");
-		goto out_fail;
-	}
-
-	/* Initialize NSS; required to do hashing, as silly as that
-	   sounds... */
-	if (NSS_NoDB_Init(NULL) != SECSuccess) {
-		logt_print(LOG_ERR, "Could not initialize NSS\n");
-		goto out_fail;
-	}
-	
-	if (!(args.flags & F_NOCLUSTER)) {
-		/* Wait for cman to start. */
-		x = 0;
-		while ((ch = cman_init(NULL)) == NULL) {
-			if (!x) {
-				dbg_printf(1,
-				  "Could not connect to CMAN; retrying...\n");
-				x = 1;
-			}
-			sleep(3);
-		}
-		if (x)
-			dbg_printf(1, "Connected to CMAN\n");
-		/* Wait for quorum */
-		while (!cman_is_quorate(ch))
-			sleep(3);
-
-		/* Wait for openais checkpointing to become available */
-		x = 0;
-		while ((h = ckpt_init("vm_states", 262144, 4096, 64, 10)) == NULL) {
-			if (!x) {
-				dbg_printf(1, "Could not initialize saCkPt; retrying...\n");
-				x = 1;
-			}
-			sleep(3);
-		}
-		if (x)
-			dbg_printf(1, "Checkpoint initialized\n");
-	}
-
-	if (args.family == PF_INET)
-		mc_sock = ipv4_recv_sk(args.addr, args.port, args.ifindex);
-	else
-		mc_sock = ipv6_recv_sk(args.addr, args.port, args.ifindex);
-	if (mc_sock < 0) {
-		logt_print(LOG_ERR,
-			   "Could not set up multicast listen socket\n");
-		goto out_fail;
-	}
-
-
-	signal(SIGHUP, sighup_handler);
-	signal(SIGINT, sigint_handler);
-	signal(SIGTERM, sigint_handler);
-	signal(SIGQUIT, sigint_handler);
-	xvmd_loop(ch, h, mc_sock, &args, key, key_len);
-
-	return 0;
-
-out_fail:
-	logt_exit();
-	return 1;
-}
diff --git a/fence/agents/xvm/mcast.c b/fence/agents/xvm/mcast.c
deleted file mode 100644
index 1effa83..0000000
--- a/fence/agents/xvm/mcast.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Author: Lon Hohberger <lhh at redhat.com>
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/un.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <pthread.h>
-
-/* Local includes */
-#include "mcast.h"
-#include "debug.h"
-
-/** 
-  Sets up a multicast receive socket
- */
-int
-ipv4_recv_sk(char *addr, int port, unsigned int ifindex)
-{
-	int sock;
-	struct ip_mreqn mreq;
-	struct sockaddr_in sin;
-
-	memset(&mreq, 0, sizeof(mreq));
-
-	/* Store multicast address */
-	if (inet_pton(PF_INET, addr,
-		      (void *)&mreq.imr_multiaddr.s_addr) < 0) {
-		printf("Invalid multicast address: %s\n", addr);
-		return -1;
-	}
-
-	/********************************
-	 * SET UP MULTICAST RECV SOCKET *
-	 ********************************/
-	dbg_printf(4, "Setting up ipv4 multicast receive (%s:%d)\n", addr, port);
-	sock = socket(PF_INET, SOCK_DGRAM, 0);
-	if (sock < 0) {
-		printf("socket: %s\n", strerror(errno));
-		close(sock);
-		sock = -1;
-		return 1;
-	}
-
-	/*
-	 * When using Multicast, bind to the LOCAL address, not the MULTICAST
-	 * address.
-	 */
-	sin.sin_family = PF_INET;
-	sin.sin_port = htons(port);
-	sin.sin_addr.s_addr = htonl(INADDR_ANY);
-	if (bind(sock, (struct sockaddr *) &sin,
-		 sizeof(struct sockaddr_in)) < 0) {
-		printf("bind failed: %s\n", strerror(errno));
-		close(sock);
-		return -1;
-	}
-
-	/*
-	 * Join multicast group
-	 */
-	/* mreq.imr_multiaddr.s_addr is set above */
-	if (ifindex <= 0) {
-		dbg_printf(4,"Using 'any' address/interface\n");
-        	mreq.imr_address.s_addr = htonl(INADDR_ANY);
-	} else {
-		dbg_printf(4,"Using interface index %d\n", ifindex);
-		mreq.imr_ifindex = ifindex;
-	}
-	dbg_printf(4, "Joining multicast group\n");
-	if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
-		       &mreq, sizeof(mreq)) == -1) {
-		dbg_printf(1,"Failed to bind multicast receive socket to "
-		       "%s: %s\n", addr, strerror(errno));
-		dbg_printf(1,"Check network configuration.\n");
-		close(sock);
-		return -1;
-	}
-
-	dbg_printf(4, "%s: success, fd = %d\n", __FUNCTION__, sock);
-	return sock;
-}
-
-
-/**
-  Set up multicast send socket
- */
-int
-ipv4_send_sk(char *send_addr, char *addr, int port, struct sockaddr *tgt,
-	     socklen_t tgt_len, int ttl)
-{
-	int val;
-	struct ip_mreq mreq;
-	struct sockaddr_in mcast;
-	struct sockaddr_in src;
-	int sock;
-
-	if (tgt_len < sizeof(struct sockaddr_in)) {
-		errno = EINVAL;
-		return -1;
-	}
-
-	memset(&mreq, 0, sizeof(mreq));
-
-	/* Store multicast address */
-	mcast.sin_family = PF_INET;
-	mcast.sin_port = htons(port);
-	if (inet_pton(PF_INET, addr,
-		      (void *)&mcast.sin_addr.s_addr) < 0) {
-		printf("Invalid multicast address: %s\n", addr);
-		return -1;
-	}
-	mreq.imr_multiaddr.s_addr = mcast.sin_addr.s_addr;
-
-	/* Store sending address */
-	src.sin_family = PF_INET;
-	src.sin_port = htons(port);
-	if (inet_pton(PF_INET, send_addr,
-		      (void *)&src.sin_addr.s_addr) < 0) {
-		printf("Invalid source address: %s\n", send_addr);
-		return -1;
-	}
-	mreq.imr_interface.s_addr = src.sin_addr.s_addr;
-
-
-	/*************************
-	 * SET UP MULTICAST SEND *
-	 *************************/
-	dbg_printf(4, "Setting up ipv4 multicast send (%s:%d)\n", addr, port);
-	sock = socket(PF_INET, SOCK_DGRAM, 0);
-	if (sock < 0) {
-		perror("socket");
-		return -1;
-	}
-
-	/*
-	 * Join Multicast group.
-	 */
-	dbg_printf(4, "Joining IP Multicast group (pass 1)\n");
-	if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq,
-		       sizeof(mreq)) == -1) {
-		printf("Failed to add multicast membership to transmit "
-		       "socket %s: %s\n", addr, strerror(errno));
-		close(sock);
-		return -1;
-	}
-
-	/*
-	 * Join Multicast group.
-	 */
-	dbg_printf(4, "Joining IP Multicast group (pass 2)\n");
-	if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &src.sin_addr,
-		       sizeof(src.sin_addr)) == -1) {
-		printf("Failed to bind multicast transmit socket to "
-		       "%s: %s\n", addr, strerror(errno));
-		close(sock);
-		return -1;
-	}
-
-	/*
-	 * set time to live to 2 hops.
-	 */
-	dbg_printf(4, "Setting TTL to %d for fd%d\n", ttl, sock);
-	val = ttl;
-	if (setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &val,
-		       sizeof(val)))
-		printf("warning: setting TTL failed %s\n", strerror(errno));
-
-	memcpy((struct sockaddr_in *)tgt, &mcast, sizeof(struct sockaddr_in));
-
-	dbg_printf(4, "%s: success, fd = %d\n", __FUNCTION__, sock);
-	return sock;
-}
-
-
-
-/** 
-  Sets up a multicast receive (ipv6) socket
- */
-int
-ipv6_recv_sk(char *addr, int port, unsigned int ifindex)
-{
-	int sock, val;
-	struct ipv6_mreq mreq;
-	struct sockaddr_in6 sin;
-
-	memset(&mreq, 0, sizeof(mreq));
-	memset(&sin, 0, sizeof(sin));
-	sin.sin6_family = PF_INET6;
-	sin.sin6_port = htons(port);
-	if (inet_pton(PF_INET6, addr,
-		      (void *)&sin.sin6_addr) < 0) {
-		printf("Invalid multicast address: %s\n", addr);
-		return -1;
-	}
-
-	memcpy(&mreq.ipv6mr_multiaddr, &sin.sin6_addr,
-	       sizeof(struct in6_addr));
-
-	mreq.ipv6mr_interface = ifindex;
-
-	/********************************
-	 * SET UP MULTICAST RECV SOCKET *
-	 ********************************/
-	dbg_printf(4, "Setting up ipv6 multicast receive (%s:%d)\n", addr, port);
-	sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
-	if (sock < 0) {
-		printf("socket: %s\n", strerror(errno));
-		close(sock);
-		sock = -1;
-		return 1;
-	}
-
-	/*
-	 * When using Multicast, bind to the LOCAL address, not the MULTICAST
-	 * address.
-	 */
-	memset(&sin, 0, sizeof(sin));
-	sin.sin6_family = PF_INET6;
-	sin.sin6_port = htons(port);
-	sin.sin6_addr = in6addr_any;
-	if (bind(sock, (struct sockaddr *) &sin,
-		 sizeof(struct sockaddr_in6)) < 0) {
-		printf("bind failed: %s\n", strerror(errno));
-		close(sock);
-		return -1;
-	}
-
-	dbg_printf(4, "Disabling IP Multicast loopback\n");
-	val = 1;
-	if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &val,
-		       sizeof(val)) != 0) {
-		printf("Failed to disable multicast loopback\n");
-		close(sock);
-		return -1;
-	}
-
-	/*
-	 * Join multicast group
-	 */
-	dbg_printf(4, "Joining IP Multicast group\n");
-	if (setsockopt(sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq,
-		       sizeof(mreq)) == -1) {
-		printf("Failed to add multicast to socket %s: %s\n",
-		       addr, strerror(errno));
-		close(sock);
-		return -1;
-	}
-
-	dbg_printf(4, "%s: success, fd = %d\n", __FUNCTION__, sock);
-	return sock;
-}
-
-
-/**
-  Set up ipv6 multicast send socket
- */
-int
-ipv6_send_sk(char *send_addr, char *addr, int port, struct sockaddr *tgt,
-	     socklen_t tgt_len, int ttl)
-{
-	int val;
-	struct ipv6_mreq mreq;
-	struct sockaddr_in6 mcast;
-	struct sockaddr_in6 src;
-	int sock;
-
-	if (tgt_len < sizeof(struct sockaddr_in6)) {
-		errno = EINVAL;
-		return -1;
-	}
-
-	memset(&mreq, 0, sizeof(mreq));
-
-	/* Store multicast address */
-	mcast.sin6_family = PF_INET6;
-	mcast.sin6_port = htons(port);
-	if (inet_pton(PF_INET6, addr,
-		      (void *)&mcast.sin6_addr) < 0) {
-		printf("Invalid multicast address: %s\n", addr);
-		return -1;
-	}
-
-	memcpy(&mreq.ipv6mr_multiaddr, &mcast.sin6_addr,
-	       sizeof(struct in6_addr));
-
-	/* Store sending address */
-	src.sin6_family = PF_INET6;
-	src.sin6_port = htons(port);
-	if (inet_pton(PF_INET6, send_addr,
-		      (void *)&src.sin6_addr) < 0) {
-		printf("Invalid source address: %s\n", send_addr);
-		return -1;
-	}
-
-	/*************************
-	 * SET UP MULTICAST SEND *
-	 *************************/
-	dbg_printf(4, "Setting up ipv6 multicast send (%s:%d)\n", addr, port);
-	sock = socket(PF_INET6, SOCK_DGRAM, 0);
-	if (sock < 0) {
-		perror("socket");
-		return -1;
-	}
-
-	dbg_printf(4, "Disabling IP Multicast loopback\n");
-	val = 1;
-	if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &val,
-		       sizeof(val)) != 0) {
-		printf("Failed to disable multicast loopback\n");
-		close(sock);
-		return -1;
-	}
-
-	/*
-	 * Join Multicast group.
-	 */
-	dbg_printf(4, "Joining IP Multicast group\n");
-	if (setsockopt(sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq,
-		       sizeof(mreq)) == -1) {
-		printf("Failed to add multicast membership to transmit "
-		       "socket %s: %s\n", addr, strerror(errno));
-		close(sock);
-		return -1;
-	}
-
-	/*
-	 * Join Multicast group (part 2)
-	 */
-	/*
-	if (setsockopt(sock, IPPROTO_IPV6, IP_MULTICAST_IF, &src.sin6_addr,
-		       sizeof(src.sin6_addr)) == -1) {
-		printf("Failed to bind multicast transmit socket to "
-		       "%s: %s\n", addr, strerror(errno));
-		close(sock);
-		return -1;
-	}
-	*/
-
-	/*
-	 * set time to live to 2 hops.
-	 */
-	val = ttl;
-	if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &val,
-		       sizeof(val)))
-		printf("warning: setting TTL failed %s\n", strerror(errno));
-
-	memcpy((struct sockaddr_in *)tgt, &mcast, sizeof(struct sockaddr_in6));
-
-	dbg_printf(4, "%s: success, fd = %d\n", __FUNCTION__, sock);
-	return sock;
-}
diff --git a/fence/agents/xvm/mcast.h b/fence/agents/xvm/mcast.h
deleted file mode 100644
index 08fd6de..0000000
--- a/fence/agents/xvm/mcast.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _XVM_MCAST_H
-#define _XVM_MCAST_H
-
-#define IPV4_MCAST_DEFAULT "225.0.0.12"
-#define IPV6_MCAST_DEFAULT "ff05::3:1"
-
-int ipv4_recv_sk(char *addr, int port, unsigned int ifindex);
-int ipv4_send_sk(char *src_addr, char *addr, int port,
-		 struct sockaddr *src, socklen_t slen,
-		 int ttl);
-int ipv6_recv_sk(char *addr, int port, unsigned int ifindex);
-int ipv6_send_sk(char *src_addr, char *addr, int port,
-		 struct sockaddr *src, socklen_t slen,
-		 int ttl);
-
-#endif
diff --git a/fence/agents/xvm/options-ccs.c b/fence/agents/xvm/options-ccs.c
deleted file mode 100644
index 01ca051..0000000
--- a/fence/agents/xvm/options-ccs.c
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/un.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <errno.h>
-
-/* Local includes */
-#include "xvm.h"
-#include "simple_auth.h"
-#include "mcast.h"
-#include "options.h"
-
-#include <ccs.h>
-
-extern int _debug;
-
-/**
-  Parse args from ccs and assign to the specified args structure.
-  (This should only be called from fence_xvmd; not fence_xvm!!!)
-  
-  @param optstr		Command line option string in getopt(3) format
-  @param args		Args structure to fill in.
- */
-void
-args_get_ccs(const char *optstr, fence_xvm_args_t *args)
-{
-	char buf[256];
-	int ccsfd = -1, x, n;
-	char *val;
-	struct arg_info *arg;
-	
-	if (args->flags & (F_NOCCS | F_HELP | F_VERSION))
-		return;
-
-	ccsfd = ccs_connect();
-	if (ccsfd < 0) {
-		args->flags |= F_CCSFAIL;
-		return;
-	}
-
-	for (x = 0; x < strlen(optstr); x++) {
-		arg = find_arg_by_char(optstr[x]);
-		if (!arg)
-			continue;
-
-		if (!arg || (arg->opt != '\xff' && 
-			     !strchr(optstr, arg->opt))) {
-			continue;
-		}
-
-		if (!arg->stdin_opt)
-			continue;
-
-		n = snprintf(buf, sizeof(buf), "/cluster/fence_xvmd/@%s\n",
-			     arg->stdin_opt);
-		if (n == sizeof(buf)) {
-			args->flags |= F_CCSERR;
-			return;		
-		}
-
-		val = NULL;
-		if (ccs_get(ccsfd, buf, &val) != 0) {
-			if (val) {
-				free(val);
-				val = NULL;
-			}
-			continue;
-		}
-
-		if (!val)
-			continue;
-
-		if (arg->assign)
-			arg->assign(args, arg, val);
-
-		if (val) {
-			free(val);
-			val = NULL;
-		}
-	}
-	
-	ccs_disconnect(ccsfd);
-}
diff --git a/fence/agents/xvm/options.c b/fence/agents/xvm/options.c
deleted file mode 100644
index c0914a5..0000000
--- a/fence/agents/xvm/options.c
+++ /dev/null
@@ -1,774 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/un.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <errno.h>
-
-/* Local includes */
-#include "xvm.h"
-#include "simple_auth.h"
-#include "mcast.h"
-#include "options.h"
-#include "debug.h"
-
-
-/* Assignment functions */
-
-static inline void
-assign_debug(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (!value) {
-		/* GNU getopt sets optarg to NULL for options w/o a param
-		   We rely on this here... */
-		/* Command-line debug sets a special flag */
-		args->flags |= F_DEBUG;
-		args->debug++;
-		return;
-	}
-
-	args->debug = atoi(value);
-	if (args->debug < 0) {
-		args->debug = 1;
-	}
-}
-
-
-static inline void
-assign_foreground(fence_xvm_args_t *args, struct arg_info *arg,
-		  char *value)
-{
-	args->flags |= F_FOREGROUND;
-}
-
-
-static inline void
-assign_family(fence_xvm_args_t *args, struct arg_info *arg,
-	      char *value)
-{
-	if (!strcasecmp(value, "ipv4")) {
-		args->family = PF_INET;
-	} else if (!strcasecmp(value, "ipv6")) {
-		args->family = PF_INET6;
-	} else if (!strcasecmp(value, "auto")) {
-		args->family = 0;
-	} else {
-		logt_print(LOG_ERR, "Unsupported family: '%s'\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_address(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (args->addr)
-		free(args->addr);
-	args->addr = strdup(value);
-}
-
-
-static inline void
-assign_ttl(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	int ttl;
-	ttl = atoi(value);
-	if (ttl < 1 || ttl > 255)
-		ttl = DEFAULT_TTL;
-	args->ttl = ttl;
-}
-
-
-static inline void
-assign_port(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->port = atoi(value);
-	if (args->port <= 0 || args->port >= 65500) {
-		logt_print(LOG_ERR, "Invalid port: '%s'\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_interface(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->ifindex = if_nametoindex(value);
-}
-
-
-static inline void
-assign_retrans(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->retr_time = atoi(value);
-	if (args->retr_time <= 0) {
-		logt_print(LOG_ERR, "Invalid retransmit time: '%s'\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-static inline void
-assign_hash(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (!strcasecmp(value, "none")) {
-		args->hash = HASH_NONE;
-	} else if (!strcasecmp(value, "sha1")) {
-		args->hash = HASH_SHA1;
-	} else if (!strcasecmp(value, "sha256")) {
-		args->hash = HASH_SHA256;
-	} else if (!strcasecmp(value, "sha512")) {
-		args->hash = HASH_SHA512;
-	} else {
-		logt_print(LOG_ERR, "Unsupported hash: %s\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_auth(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (!strcasecmp(value, "none")) {
-		args->auth = AUTH_NONE;
-	} else if (!strcasecmp(value, "sha1")) {
-		args->auth = AUTH_SHA1;
-	} else if (!strcasecmp(value, "sha256")) {
-		args->auth = AUTH_SHA256;
-	} else if (!strcasecmp(value, "sha512")) {
-		args->auth = AUTH_SHA512;
-	} else {
-		logt_print(LOG_ERR, "Unsupported auth type: %s\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-static inline void
-assign_key(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	struct stat st;
-
-	if (args->key_file)
-		free(args->key_file);
-	args->key_file = strdup(value);
-
-	if (stat(value, &st) == -1) {
- 		logt_print(LOG_ERR, "Invalid key file: '%s' (%s)\n", value,
-  		       strerror(errno));
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_op(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (!strcasecmp(value, "null")) {
-		args->op = FENCE_NULL;
-	} else if (!strcasecmp(value, "off")) {
-		args->op = FENCE_OFF;
-	} else if (!strcasecmp(value, "reboot")) {
-		args->op = FENCE_REBOOT;
-	} else if (!strcasecmp(value, "metadata")) {
-		args->flags |= F_METADATA;
-	} else {
-		logt_print(LOG_ERR, "Unsupported operation: %s\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_domain(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (args->domain) {
-		logt_print(LOG_ERR,
-		   "Domain/UUID may not be specified more than once\n");
-		args->flags |= F_ERR;
-		return;
-	}
-
-	if (args->domain)
-		free(args->domain);
-	args->domain = strdup(value);
-
-	if (strlen(value) <= 0) {
-		logt_print(LOG_ERR, "Invalid domain name\n");
-		args->flags |= F_ERR;
-	}
-
-	if (strlen(value) >= MAX_DOMAINNAME_LENGTH) {
-		errno = ENAMETOOLONG;
-		logt_print(LOG_ERR, "Invalid domain name: '%s' (%s)\n",
-		       value, strerror(errno));
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_uuid_lookup(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (!value) {
-		/* GNU getopt sets optarg to NULL for options w/o a param
-		   We rely on this here... */
-		args->flags |= F_USE_UUID;
-		return;
-	}
-
-	args->flags |= ( !!atoi(value) ? F_USE_UUID : 0);
-}
-
-
-static inline void
-assign_timeout(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->timeout = atoi(value);
-	if (args->timeout <= 0) {
-		logt_print(LOG_ERR, "Invalid timeout: '%s'\n", value);
-		args->flags |= F_ERR;
-	}
-}
-
-
-static inline void
-assign_help(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->flags |= F_HELP;
-}
-
-
-static inline void
-assign_version(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->flags |= F_VERSION;
-}
-
-
-static inline void
-assign_noccs(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->flags |= F_NOCCS;
-}
-
-
-static inline void
-assign_nocluster(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	args->flags |= F_NOCCS;
-	args->flags |= F_NOCLUSTER;
-}
-
-
-static inline void
-assign_uri(fence_xvm_args_t *args, struct arg_info *arg, char *value)
-{
-	if (args->uri)
-		free(args->uri);
-
-	/* XXX NO validation yet */
-	args->uri = strdup(value);
-}
-
-
-/** ALL valid command line and stdin arguments for this fencing agent */
-static struct arg_info _arg_info[] = {
-	{ '\xff', NULL, "agent",
-	  0, "boolean", NULL,
-	  "Not user serviceable",
-	  NULL },
-
-	{ '\xff', NULL, "self",
-	  0, "boolean", NULL,
-	  "Not user serviceable", 
-	  NULL },
-
-	{ 'd', "-d", "debug",
-	  0, "boolean", NULL,
-	  "Specify (CCS) / increment (command line) debug level",
-	  assign_debug },
-
-	{ 'f', "-f", NULL,
-	  0, "boolean", NULL,
-	  "Foreground mode (do not fork)",
-	  assign_foreground },
-
-	{ 'i', "-i <family>", "ip_family",
-	  0, "string", "auto",
-	  "IP Family ([auto], ipv4, ipv6)",
-	  assign_family },
-
-	{ 'a', "-a <address>", "multicast_address",
-	  0, "string", NULL,
-	  "Multicast address (default=225.0.0.12 / ff02::3:1)",
-	  assign_address },
-
-	{ 'T', "-T <ttl>", "multicast_ttl",
-	  0, "string", "2",
-	  "Multicast time-to-live (in hops; default=2)",
-	  assign_ttl },
-
-	{ 'p', "-p <port>", "port",
-	  0, "string", "1229",
-	  "IP port (default=1229)",
-	  assign_port },
-
-	{ 'I', "-I <interface>", "interface",
-	  0, "string", NULL,
-	  "Network interface name to listen on",
-	  assign_interface },
-
-	{ 'r', "-r <retrans>", "retrans", 
-	  0, "string", "20",
-	  "Multicast retransmit time (in 1/10sec; default=20)",
-	  assign_retrans },
-
-	{ 'c', "-c <hash>", "hash",
-	  0, "string", "sha256",
-	  "Packet hash strength (none, sha1, [sha256], sha512)",
-	  assign_hash },
-
-	{ 'C', "-C <auth>", "auth",
-	  0, "string", "sha256",
-	  "Authentication (none, sha1, [sha256], sha512)",
-	  assign_auth },
-
-	{ 'k', "-k <file>", "key_file",
-	  0, "string", DEFAULT_KEY_FILE,
-	  "Shared key file (default=" DEFAULT_KEY_FILE ")",
-	  assign_key },
-
-	{ '\xff', NULL, "option",
-	  0, "string", "reboot",
-	  "Fencing operation (null, off, [reboot])",
-	  assign_op },
-
-	{ 'o', "-o <action>", "action",
-	  0, "string", "reboot",
-	  "Fencing action (null, off, [reboot])",
-	  assign_op },
-
-	{ 'H', "-H <domain>", "domain",
-	  1, "string", NULL,
-	  "Virtual machine (domain name) to fence",
-	  assign_domain },
-
-	{ 'u', "-u", "use_uuid",
-	  0, "string", NULL,
-	  "Treat 'domain' as UUID instead of domain name",
-	  assign_uuid_lookup },
-
-	{ 't', "-t <timeout>", "timeout",
-	  0, "string", "30",
-	  "Fencing timeout (in seconds; default=30)",
-	  assign_timeout },
-
-	{ 'h', "-h", NULL,
-	  0, "boolean", NULL,
- 	  "Help",
-	  assign_help },
-
-	{ '?', "-?", NULL,
-	  0, "boolean", NULL,
- 	  "Help (alternate)", 
-	  assign_help },
-
-	{ 'X', "-X", NULL,
-	  0, "boolean", NULL,
- 	  "Do not connect to CCS for configuration", 
-	  assign_noccs }, 
-
-	{ 'L', "-L", NULL,
-	  0, "boolean", NULL,
- 	  "Local mode only (no cluster; implies -X)",
-	  assign_nocluster }, 
-
-	{ 'U', "-U", "uri",
-	  0, "string", DEFAULT_HYPERVISOR_URI,
-	  "URI for Hypervisor (default: " DEFAULT_HYPERVISOR_URI ")",
-	  assign_uri },
-	  
-	{ 'V', "-V", NULL,
-	  0, "string", NULL,
- 	  "Display version and exit", 
-	  assign_version },
-
-	/* Terminator */
-	{ 0, NULL, NULL, 0, NULL, NULL, NULL, NULL }
-};
-
-
-struct arg_info *
-find_arg_by_char(char arg)
-{
-	int x = 0;
-
-	for (x = 0; _arg_info[x].opt != 0; x++) {
-		if (_arg_info[x].opt == arg)
-			return &_arg_info[x];
-	}
-
-	return NULL;
-}
-
-
-struct arg_info *
-find_arg_by_string(char *arg)
-{
-	int x = 0;
-
-	for (x = 0; _arg_info[x].opt != 0; x++) {
-		if (!_arg_info[x].stdin_opt)
-			continue;
-		if (!strcasecmp(_arg_info[x].stdin_opt, arg))
-			return &_arg_info[x];
-	}
-
-	return NULL;
-}
-
-
-/* ============================================================= */
-
-/**
-  Initialize an args structure.
-
-  @param args		Pointer to args structure to initialize.
- */
-void
-args_init(fence_xvm_args_t *args)
-{
-	args->addr = NULL;
-	args->domain = NULL;
-	args->key_file = strdup(DEFAULT_KEY_FILE);
-	args->uri = strdup(DEFAULT_HYPERVISOR_URI);
-	args->op = FENCE_REBOOT;
-	args->hash = DEFAULT_HASH;
-	args->auth = DEFAULT_AUTH;
-	args->port = 1229;
-	args->ifindex = 0;
-	args->family = PF_INET;
-	args->timeout = 30;
-	args->retr_time = 20;
-	args->flags = 0;
-	args->debug = 0;
-	args->ttl = DEFAULT_TTL;
-}
-
-
-#define _pr_int(piece) dbg_printf(1, "  %s = %d\n", #piece, piece)
-#define _pr_str(piece) dbg_printf(1, "  %s = %s\n", #piece, piece)
-
-
-/**
-  Prints out the contents of an args structure for debugging.
-
-  @param args		Pointer to args structure to print out.
- */
-void
-args_print(fence_xvm_args_t *args)
-{
-	dbg_printf(1, "-- args @ %p --\n", args);
-	_pr_str(args->addr);
-	_pr_str(args->domain);
-	_pr_str(args->key_file);
-	_pr_int(args->op);
-	_pr_int(args->hash);
-	_pr_int(args->auth);
-	_pr_int(args->port);
-	_pr_int(args->ifindex);
-	_pr_int(args->family);
-	_pr_int(args->timeout);
-	_pr_int(args->retr_time);
-	_pr_int(args->flags);
-	_pr_int(args->debug);
-	dbg_printf(1, "-- end args --\n");
-}
-
-
-/**
-  Print out arguments and help information based on what is allowed in
-  the getopt string optstr.
-
-  @param progname	Program name.
-  @param optstr		Getopt(3) style options string
-  @param print_stdin	0 = print command line options + description,
-			1 = print fence-style stdin args + description
- */
-void
-args_usage(char *progname, const char *optstr, int print_stdin)
-{
-	int x;
-	struct arg_info *arg;
-
-	if (!print_stdin) {
-		if (progname) {
-			printf("usage: %s [args]\n", progname);
-		} else {
-			printf("usage: fence_xvm [args]\n");
-		}
-	}
-
-	for (x = 0; x < strlen(optstr); x++) {
-		arg = find_arg_by_char(optstr[x]);
-		if (!arg)
-			continue;
-
-		if (print_stdin) {
-			if (arg && arg->stdin_opt)
-				printf("  %-20.20s %-55.55s\n",
-				       arg->stdin_opt, arg->desc);
-		} else {
-			printf("  %-20.20s %-55.55s\n", arg->opt_desc,
-			       arg->desc);
-		}
-	}
-
-	printf("\n");
-}
-
-
-static void
-print_desc_xml(const char *desc)
-{
-	const char *d;
-
-	for (d = desc; *d; d++) {
-		switch (*d) {
-		case '<':
-			printf("&lt;");
-			break;
-		case '>':
-			printf("&gt;");
-			break;
-		default:
-			printf("%c", *d);
-		}
-	}
-}
-
-
-void
-args_metadata(char *progname, const char *optstr)
-{
-	int x;
-	struct arg_info *arg;
-
-	printf("<?xml version=\"1.0\" ?>\n");
-	printf("<resource-agent name=\"%s\" shortdesc=\"Fence agent for virtual machines\">\n", basename(progname));
-	printf("<longdesc>fence_xvm  is  an I/O Fencing agent which can be used with any "
-"virtual machines for which libvirt has a backend.  When used on virtual "
-"machines which are backed by clustered storage (and thus, may "
-"be migrated about several physical machines), there is a "
-"requirement that the host machines are also a part of a CMAN/OpenAIS based "
-"cluster, such as linux-cluster.</longdesc>\n");
-	printf("<parameters>\n");
-
-	for (x = 0; x < strlen(optstr); x++) {
-		arg = find_arg_by_char(optstr[x]);
-		if (!arg)
-			continue;
-		if (!arg->stdin_opt)
-			continue;
-
-		printf("\t<parameter name=\"%s\">\n",arg->stdin_opt);
-                printf("\t\t<getopt mixed=\"-%c\" />\n",arg->opt);
-                if (arg->default_value) {
-                  printf("\t\t<content type=\"%s\" default=\"%s\" />\n", arg->content_type, arg->default_value);
-                } else {
-                  printf("\t\t<content type=\"%s\" />\n", arg->content_type);
-                }
-		printf("\t\t<shortdesc lang=\"en\">");
-		print_desc_xml(arg->desc);
-		printf("</shortdesc>\n");
-		printf("\t</parameter>\n");
-	}
-
-	printf("</parameters>\n");
-	printf("<actions>\n");
-	printf("\t<action name=\"off\" />\n");
-	printf("\t<action name=\"reboot\" />\n");
-	printf("\t<action name=\"metadata\" />\n");	
-	printf("</actions>\n");
-	printf("</resource-agent>\n");
-}
-
-
-/**
-  Remove leading and trailing whitespace from a line of text.
-
-  @param line		Line to clean up
-  @param linelen	Max size of line
-  @return		0 on success, -1 on failure
- */
-static int
-cleanup(char *line, size_t linelen)
-{
-	char *p;
-	int x;
-	
-	/* Remove leading whitespace. */
-	p = line;
-	for (x = 0; x <= linelen; x++) {
-		switch (line[x]) {
-		case '\t':
-		case ' ':
-			break;
-		case '\n':
-		case '\r':
-			return -1;
-		default:
-			goto eol;
-		}
-	}
-eol:
-	/* Move the remainder down by as many whitespace chars as we
-	   chewed up */
-	if (x)
-		memmove(p, &line[x], linelen-x);
-
-	/* Remove trailing whitespace. */
-	for (x=0; x <= linelen; x++) {
-		switch(line[x]) {
-		case '\t':
-		case ' ':
-		case '\r':
-		case '\n':
-			line[x] = 0;
-		case 0:
-		/* End of line */
-			return 0;
-		}
-	}
-
-	return -1;
-}
-
-
-/**
-  Parse args from stdin and assign to the specified args structure.
-  
-  @param optstr		Command line option string in getopt(3) format
-  @param args		Args structure to fill in.
- */
-void
-args_get_stdin(const char *optstr, fence_xvm_args_t *args)
-{
-	char in[256];
-	int line = 0;
-	char *name, *val;
-	struct arg_info *arg;
-
-	while (fgets(in, sizeof(in), stdin)) {
-		++line;
-
-		if (in[0] == '#')
-			continue;
-
-		if (cleanup(in, sizeof(in)) == -1)
-			continue;
-
-		name = in;
-		if ((val = strchr(in, '='))) {
-			*val = 0;
-			++val;
-		}
-
-		arg = find_arg_by_string(name);
-		if (!arg || (arg->opt != '\xff' && 
-			     !strchr(optstr, arg->opt))) {
-			fprintf(stderr,
-				"parse warning: "
-				"illegal variable '%s' on line %d\n", name,
-				line);
-			continue;
-		}
-
-		if (arg->assign)
-			arg->assign(args, arg, val);
-	}
-}
-
-
-/**
-  Parse args from stdin and assign to the specified args structure.
-  
-  @param optstr		Command line option string in getopt(3) format
-  @param args		Args structure to fill in.
- */
-void
-args_get_getopt(int argc, char **argv, const char *optstr, fence_xvm_args_t *args)
-{
-	int opt;
-	struct arg_info *arg;
-
-	while ((opt = getopt(argc, argv, optstr)) != EOF) {
-
-		arg = find_arg_by_char(opt);
-
-		if (!arg) {
-			args->flags |= F_ERR;
-			continue;
-		}
-
-		if (arg->assign)
-			arg->assign(args, arg, optarg);
-	}
-}
-
-
-void
-args_finalize(fence_xvm_args_t *args)
-{
-	const char *addr = NULL;
-
-	if (!args->addr) {
-		switch(args->family) {
-		case 0:
-		case PF_INET:
-			addr = IPV4_MCAST_DEFAULT;
-			break;
-		case PF_INET6:
-			addr = IPV6_MCAST_DEFAULT;
-			break;
-		default:
-			args->flags |= F_ERR;
-		break;
-		}
-	}
-
-	if (!args->addr)
-		args->addr = strdup(addr);
-
-	if (!args->addr) {
-		printf("No multicast address available\n");
-		args->flags |= F_ERR;
-	}
-
-	if (!args->addr)
-		return;
-	if (args->family)
-		return;
-
-	/* Set family */
-	if (strchr(args->addr, ':'))
-		args->family = PF_INET6;
-	if (strchr(args->addr, '.'))
-		args->family = PF_INET;
-	if (!args->family) {
-		printf("Could not determine address family\n");
-		args->flags |= F_ERR;
-	}
-}
diff --git a/fence/agents/xvm/options.h b/fence/agents/xvm/options.h
deleted file mode 100644
index 1a4f8cd..0000000
--- a/fence/agents/xvm/options.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef _XVM_OPTIONS_H
-#define _XVM_OPTIONS_H
-
-typedef enum {
-	F_FOREGROUND	= 0x1,
-	F_NOCCS		= 0x2,
-	F_ERR		= 0x4,
-	F_HELP		= 0x8,
-	F_USE_UUID	= 0x10,
-	F_VERSION	= 0x20,
-	F_CCSERR	= 0x40,
-	F_CCSFAIL	= 0x80,
-	F_NOCLUSTER	= 0x100,
-	F_DEBUG		= 0x200,
-	F_METADATA	= 0x400
-} arg_flags_t;
-
-
-typedef struct {
-	char *addr;
-	char *domain;
-	char *key_file;
-	char *uri;
-	fence_cmd_t op;
-	fence_hash_t hash;
-	fence_auth_type_t auth;
-	int port;
-	unsigned int ifindex;
-	int family;
-	int timeout;
-	int retr_time;
-	arg_flags_t flags;
-	int debug;
-	int ttl;
-} fence_xvm_args_t;
-
-/* Private structure for commandline / stdin fencing args */
-struct arg_info {
-	const char opt;
-	const char *opt_desc;
-	const char *stdin_opt;
-	const int required;
-	const char *content_type;
-	const char *default_value;
-	const char *desc;
-	void (*assign)(fence_xvm_args_t *, struct arg_info *, char *);
-};
-
-
-/* Get options */
-void args_init(fence_xvm_args_t *args);
-void args_finalize(fence_xvm_args_t *args);
-
-void args_get_getopt(int argc, char **argv, const char *optstr,
-		     fence_xvm_args_t *args);
-void args_get_stdin(const char *optstr, fence_xvm_args_t *args);
-void args_get_ccs(const char *optstr, fence_xvm_args_t *args);
-void args_usage(char *progname, const char *optstr, int print_stdin);
-void args_metadata(char *progname, const char *optstr);
-void args_print(fence_xvm_args_t *args);
-
-struct arg_info *find_arg_by_char(char arg);
-struct arg_info *find_arg_by_string(char *arg);
-
-#endif
diff --git a/fence/agents/xvm/simple_auth.c b/fence/agents/xvm/simple_auth.c
deleted file mode 100644
index 2d9b2e7..0000000
--- a/fence/agents/xvm/simple_auth.c
+++ /dev/null
@@ -1,395 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sechash.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-
-/* Local includes */
-#include "xvm.h"
-#include "simple_auth.h"
-#include "debug.h"
-
-static void
-print_hash(unsigned char *hash, size_t hashlen)
-{
-	int x; 
-
-	for (x = 0; x < hashlen; x++)
-		printf("%02x", (hash[x]&0xff));
-}
-
-
-static void
-sha_sign(fence_req_t *req, void *key, size_t key_len)
-{
-	unsigned char hash[SHA512_LENGTH];
-	HASHContext *h;
-	HASH_HashType ht;
-	unsigned int rlen;
-	int devrand;
-
-	switch(req->hashtype) {
-		case HASH_SHA1:
-			ht = HASH_AlgSHA1;
-			break;
-		case HASH_SHA256:
-			ht = HASH_AlgSHA256;
-			break;
-		case HASH_SHA512:
-			ht = HASH_AlgSHA512;
-			break;
-		default:
-			return;
-	}
-
-	dbg_printf(4, "Opening /dev/urandom\n");
-	devrand = open("/dev/urandom", O_RDONLY);
-	if (devrand >= 0) {
-		if (read(devrand, req->random, sizeof(req->random)) < 0) {
-			perror("read /dev/urandom");
-		}
-		close(devrand);
-	}
-
-	memset(hash, 0, sizeof(hash));
-	h = HASH_Create(ht);
-	if (!h)
-		return;
-
-	HASH_Begin(h);
-	HASH_Update(h, key, key_len);
-	HASH_Update(h, (void *)req, sizeof(*req));
-	HASH_End(h, hash, &rlen, sizeof(hash));
-	HASH_Destroy(h);
-
-	memcpy(req->hash, hash, sizeof(req->hash));
-}
-
-
-static int
-sha_verify(fence_req_t *req, void *key, size_t key_len)
-{
-	unsigned char hash[SHA512_LENGTH];
-	unsigned char pkt_hash[SHA512_LENGTH];
-	HASHContext *h = NULL;
-	HASH_HashType ht;
-	unsigned int rlen;
-	int ret;
-
-	switch(req->hashtype) {
-		case HASH_SHA1:
-			ht = HASH_AlgSHA1;
-			break;
-		case HASH_SHA256:
-			ht = HASH_AlgSHA256;
-			break;
-		case HASH_SHA512:
-			ht = HASH_AlgSHA512;
-			break;
-		default:
-			dbg_printf(3, "%s: no-op (HASH_NONE)\n", __FUNCTION__);
-			return 0;
-	}
-
-	memset(hash, 0, sizeof(hash));
-	h = HASH_Create(ht);
-	if (!h)
-		return 0;
-
-	memcpy(pkt_hash, req->hash, sizeof(pkt_hash));
-	memset(req->hash, 0, sizeof(req->hash));
-
-	HASH_Begin(h);
-	HASH_Update(h, key, key_len);
-	HASH_Update(h, (void *)req, sizeof(*req));
-	HASH_End(h, hash, &rlen, sizeof(hash));
-	HASH_Destroy(h);
-
-	memcpy(req->hash, pkt_hash, sizeof(req->hash));
-
-	ret = !memcmp(hash, pkt_hash, sizeof(hash));
-	if (!ret) {
-		printf("Hash mismatch:\nPKT = ");
-		print_hash(pkt_hash, sizeof(pkt_hash));
-		printf("\nEXP = ");
-		print_hash(hash, sizeof(hash));
-		printf("\n");
-	}
-
-	return ret;
-}
-
-
-int
-sign_request(fence_req_t *req, void *key, size_t key_len)
-{
-	memset(req->hash, 0, sizeof(req->hash));
-	switch(req->hashtype) {
-	case HASH_NONE:
-		dbg_printf(3, "%s: no-op (HASH_NONE)\n", __FUNCTION__);
-		return 0;
-	case HASH_SHA1:
-	case HASH_SHA256:
-	case HASH_SHA512:
-		sha_sign(req, key, key_len);
-		return 0;
-	default:
-		break;
-	}
-	return -1;
-}
-
-
-int
-verify_request(fence_req_t *req, fence_hash_t min,
-	       void *key, size_t key_len)
-{
-	if (req->hashtype < min) {
-		printf("Hash type not strong enough (%d < %d)\n",
-		       req->hashtype, min);
-		return 0;
-	}
-	switch(req->hashtype) {
-	case HASH_NONE:
-		return 1;
-	case HASH_SHA1:
-	case HASH_SHA256:
-	case HASH_SHA512:
-		return sha_verify(req, key, key_len);
-	default:
-		break;
-	}
-	return 0;
-}
-
-
-static int
-sha_challenge(int fd, fence_auth_type_t auth, void *key,
-	      size_t key_len, int timeout)
-{
-	fd_set rfds;
-	struct timeval tv;
-	unsigned char hash[MAX_HASH_LENGTH];
-	unsigned char challenge[MAX_HASH_LENGTH];
-	unsigned char response[MAX_HASH_LENGTH];
-	int devrand;
-	int ret;
-	HASHContext *h;
-	HASH_HashType ht;
-	unsigned int rlen;
-
-	devrand = open("/dev/urandom", O_RDONLY);
-	if (read(devrand, challenge, sizeof(challenge)) < 0) {
-		perror("read /dev/urandom");
-		return 0;
-	}
-	close(devrand);
-
-	if (write(fd, challenge, sizeof(challenge)) < 0) {
-		perror("write");
-		return 0;
-	}
-
-	switch(auth) {
-		case HASH_SHA1:
-			ht = HASH_AlgSHA1;
-			break;
-		case HASH_SHA256:
-			ht = HASH_AlgSHA256;
-			break;
-		case HASH_SHA512:
-			ht = HASH_AlgSHA512;
-			break;
-		default:
-			return 0;
-	}
-
-	memset(hash, 0, sizeof(hash));
-	h = HASH_Create(ht);
-	if (!h)
-		return 0;
-
-	HASH_Begin(h);
-	HASH_Update(h, key, key_len);
-	HASH_Update(h, challenge, sizeof(challenge));
-	HASH_End(h, hash, &rlen, sizeof(hash));
-	HASH_Destroy(h);
-
-	memset(response, 0, sizeof(response));
-
-	FD_ZERO(&rfds);
-	FD_SET(fd, &rfds);
-	tv.tv_sec = timeout;
-	tv.tv_usec = 0;
-	if (select(fd + 1, &rfds, NULL, NULL, &tv) <= 0) {
-		perror("select");
-		return 0;
-	}
-
-	if (read(fd, response, sizeof(response)) < sizeof(response)) {
-		perror("read");
-		return 0;
-	}
-
-	ret = !memcmp(response, hash, sizeof(response));
-	if (!ret) {
-		printf("Hash mismatch:\nC = ");
-		print_hash(challenge, sizeof(challenge));
-		printf("\nH = ");
-		print_hash(hash, sizeof(hash));
-		printf("\nR = ");
-		print_hash(response, sizeof(response));
-		printf("\n");
-	}
-
-	return ret;
-}
-
-
-static int
-sha_response(int fd, fence_auth_type_t auth, void *key,
-	     size_t key_len, int timeout)
-{
-	fd_set rfds;
-	struct timeval tv;
-	unsigned char challenge[MAX_HASH_LENGTH];
-	unsigned char hash[MAX_HASH_LENGTH];
-	HASHContext *h;
-	HASH_HashType ht;
-	unsigned int rlen;
-
-	FD_ZERO(&rfds);
-	FD_SET(fd, &rfds);
-	tv.tv_sec = timeout;
-	tv.tv_usec = 0;
-	if (select(fd + 1, &rfds, NULL, NULL, &tv) <= 0) {
-		perror("select");
-		return 0;
-	}
-
-	if (read(fd, challenge, sizeof(challenge)) < 0) {
-		perror("read");
-		return 0;
-	}
-
-	switch(auth) {
-		case AUTH_SHA1:
-			ht = HASH_AlgSHA1;
-			break;
-		case AUTH_SHA256:
-			ht = HASH_AlgSHA256;
-			break;
-		case AUTH_SHA512:
-			ht = HASH_AlgSHA512;
-			break;
-		default:
-			dbg_printf(3, "%s: no-op (AUTH_NONE)\n", __FUNCTION__);
-			return 0;
-	}
-
-	memset(hash, 0, sizeof(hash));
-	h = HASH_Create(ht); /* */
-	if (!h)
-		return 0;
-
-	HASH_Begin(h);
-	HASH_Update(h, key, key_len);
-	HASH_Update(h, challenge, sizeof(challenge));
-	HASH_End(h, hash, &rlen, sizeof(hash));
-	HASH_Destroy(h);
-
-	if (write(fd, hash, sizeof(hash)) < sizeof(hash)) {
-		perror("read");
-		return 0;
-	}
-
-	return 1;
-}
-
-
-int
-tcp_challenge(int fd, fence_auth_type_t auth, void *key, size_t key_len,
-	      int timeout)
-{
-	switch(auth) {
-	case AUTH_NONE:
-		dbg_printf(3, "%s: no-op (AUTH_NONE)\n", __FUNCTION__);
-		return 1;
-	case AUTH_SHA1:
-	case AUTH_SHA256:
-	case AUTH_SHA512:
-		return sha_challenge(fd, auth, key, key_len, timeout);
-	default:
-		break;
-	}
-	return -1;
-}
-
-
-int
-tcp_response(int fd, fence_auth_type_t auth, void *key, size_t key_len,
-	     int timeout)
-{
-	switch(auth) {
-	case AUTH_NONE:
-		dbg_printf(3, "%s: no-op (AUTH_NONE)\n", __FUNCTION__);
-		return 1;
-	case AUTH_SHA1:
-	case AUTH_SHA256:
-	case AUTH_SHA512:
-		return sha_response(fd, auth, key, key_len, timeout);
-	default:
-		break;
-	}
-	return -1;
-}
-
-
-int
-read_key_file(char *file, char *key, size_t max_len)
-{
-	int fd;
-	int nread, remain = max_len;
-	char *p;
-
-	dbg_printf(3, "Reading in key file %s into %p (%d max size)\n",
-		file, key, (int)max_len);
-	fd = open(file, O_RDONLY);
-	if (fd < 0) {
-		dbg_printf(2, "Error opening key file: %s\n", strerror(errno));
-		return -1;
-	}
-
-	memset(key, 0, max_len);
-	p = key;
-	remain = max_len;
-
-	while (remain) {
-		nread = read(fd, p, remain);
-		if (nread < 0) {
-			if (errno == EINTR)
-				continue;
-			dbg_printf(2, "Error from read: %s\n", strerror(errno));
-			close(fd);
-			return -1;
-		}
-
-		if (nread == 0) {
-			dbg_printf(3, "Stopped reading @ %d bytes",
-				(int)max_len-remain);
-			break;
-		}
-		
-		p += nread;
-		remain -= nread;
-	}
-
-	close(fd);	
-	dbg_printf(3, "Actual key length = %d bytes", (int)max_len-remain);
-	
-	return (int)(max_len - remain);
-}
diff --git a/fence/agents/xvm/simple_auth.h b/fence/agents/xvm/simple_auth.h
deleted file mode 100644
index d05526c..0000000
--- a/fence/agents/xvm/simple_auth.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _XVM_SIMPLE_AUTH_H
-#define _XVM_SIMPLE_AUTH_H
-
-#include <sys/types.h>
-
-/* 2-way challenge/response simple auth */
-#define DEFAULT_KEY_FILE DEFAULT_CONFIG_DIR "/fence_xvm.key"
-
-int read_key_file(char *, char *, size_t);
-int tcp_challenge(int, fence_auth_type_t, void *, size_t, int);
-int tcp_response(int, fence_auth_type_t, void *, size_t, int);
-int sign_request(fence_req_t *, void *, size_t);
-int verify_request(fence_req_t *, fence_hash_t, void *, size_t);
-
-/* SSL certificate-based authentication TBD */
-
-#endif
diff --git a/fence/agents/xvm/tcp.c b/fence/agents/xvm/tcp.c
deleted file mode 100644
index 46aa844..0000000
--- a/fence/agents/xvm/tcp.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/** @file
- *
- * @author Lon H. Hohberger <lhh at redhat.com>
- * @author Jeff Moyer <jmoyer at redhat.com>
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <arpa/inet.h>
-
-#include "tcp.h"
-#include "debug.h"
-
-static int connect_nb(int fd, struct sockaddr *dest, socklen_t len, int timeout);
-
-/**
-  Set close-on-exec bit option for a socket.
-
-   @param fd		Socket to set CLOEXEC flag
-   @return		0 on success, -1 on failure
-   @see			fcntl
- */
-static int 
-set_cloexec(int fd)
-{
-	int flags = fcntl(fd, F_GETFD, 0);
-	flags |= FD_CLOEXEC;
-	return fcntl(fd, F_SETFD, flags);
-}
-
-
-/**
-  Bind to a port on the local IPv6 stack
-
-  @param port		Port to bind to
-  @param backlog	same as backlog for listen(2)
-  @return		0 on success, -1 on failure
-  @see			ipv4_bind
- */
-int
-ipv6_listen(uint16_t port, int backlog)
-{
-	struct sockaddr_in6 _sin6;
-	int fd, ret;
-
-	dbg_printf(4, "%s: Setting up ipv6 listen socket\n", __FUNCTION__);
-	fd = socket(PF_INET6, SOCK_STREAM, 0);
-	if (fd < 0)
-		return -1;
-
-	memset(&_sin6, 0, sizeof(_sin6));
-	_sin6.sin6_family = PF_INET6;
-	_sin6.sin6_port = htons(port);
-	_sin6.sin6_flowinfo = 0;
-	_sin6.sin6_addr = in6addr_any;
-
-	ret = 1;
-	setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&ret, sizeof (ret));
-
-	ret = set_cloexec(fd);
-	if (ret < 0) {
-		close(fd);
-		return -1;
-	}
-
-	ret = bind(fd, (struct sockaddr *)&_sin6, sizeof(_sin6));
-	if (ret < 0) {
-		close(fd);
-		return -1;
-	}
-
-	if (listen(fd, backlog) < 0){
-		close(fd);
-		return -1;
-	}
-
-	dbg_printf(4, "%s: Success; fd = %d\n", __FUNCTION__, fd);
-	return fd;
-}
-
-
-/**
-  Bind to a port on the local IPv4 stack
-
-  @param port		Port to bind to
-  @param backlog	same as backlog for listen(2)
-  @return		0 on success, -1 on failure
-  @see			ipv6_bind
- */
-int
-ipv4_listen(uint16_t port, int backlog)
-{
-	struct sockaddr_in _sin;
-	int fd, ret;
-
-	dbg_printf(4, "%s: Setting up ipv4 listen socket\n", __FUNCTION__);
-	fd = socket(PF_INET, SOCK_STREAM, 0);
-	if (fd < 0)
-		return -1;
-
-	_sin.sin_family = PF_INET;
-	_sin.sin_port = htons(port);
-	_sin.sin_addr.s_addr = htonl(INADDR_ANY);
-
-	ret = 1;
-	setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&ret, sizeof (ret));
-	
-	ret = set_cloexec(fd);
-	if (ret < 0) {
-		close(fd);
-		return -1;
-	}
-
-	ret = bind(fd, (struct sockaddr *)&_sin, sizeof(_sin));
-	if (ret < 0) {
-		close(fd);
-		return -1;
-	}
-
-	if (listen(fd, backlog) < 0){
-		close(fd);
-		return -1;
-	}
-
-	dbg_printf(4, "%s: Success; fd = %d\n", __FUNCTION__, fd);
-	return fd;
-}
-
-
-
-/**
-  Connect via ipv6 socket to a given IP address and port.
-
-  @param in6_addr	IPv6 address to connect to
-  @param port		Port to connect to
-  @param timeout	Timeout, in seconds, to wait for a completed
-  			connection
-  @return 		0 on success, -1 on failure
-  @see			connect_nb, ipv4_connect
- */
-int
-ipv6_connect(struct in6_addr *in6_addr, uint16_t port, int timeout)
-{
-	struct sockaddr_in6 _sin6;
-	int fd, ret;
-
-	dbg_printf(4, "%s: Connecting to client\n", __FUNCTION__);
-	fd = socket(PF_INET6, SOCK_STREAM, 0);
-	if (fd < 0)
-		return -1;
-
-	memset(&_sin6, 0, sizeof(_sin6));
-	_sin6.sin6_family = PF_INET6;
-	_sin6.sin6_port = htons(port);
-	_sin6.sin6_flowinfo = 0;
-	memcpy(&_sin6.sin6_addr, in6_addr, sizeof(_sin6.sin6_addr));
-
-	ret = connect_nb(fd, (struct sockaddr *)&_sin6, sizeof(_sin6), timeout);
-	if (ret < 0) {
-		close(fd);
-		return -1;
-	}
-	dbg_printf(4, "%s: Success; fd = %d\n", __FUNCTION__, fd);
-	return fd;
-}
-
-
-/**
-  Connect via ipv4 socket to a given IP address and port.
-
-  @param in_addr	IPv4 address to connect to
-  @param port		Port to connect to
-  @param timeout	Timeout, in seconds, to wait for a completed
-  			connection
-  @return 		0 on success, -1 on failure
-  @see			connect_nb, ipv6_connect
- */
-int
-ipv4_connect(struct in_addr *in_addr, uint16_t port, int timeout)
-{
-	struct sockaddr_in _sin;
-	int fd, ret;
-
-	dbg_printf(4, "%s: Connecting to client\n", __FUNCTION__);
-	fd = socket(PF_INET, SOCK_STREAM, 0);
-	if (fd < 0)
-		return -1;
-
-	_sin.sin_family = PF_INET;
-	_sin.sin_port = htons(port);
-	memcpy(&_sin.sin_addr, in_addr, sizeof(_sin.sin_addr));
-
-	ret = connect_nb(fd, (struct sockaddr *)&_sin, sizeof(_sin), timeout);
-	if (ret < 0) {
-		close(fd);
-		return -1;
-	}
-
-	dbg_printf(4, "%s: Success; fd = %d\n", __FUNCTION__, fd);
-	return fd;
-}
-
-
-/**
-  Connect in a non-blocking fashion to the designated address.
-
-  @param fd		File descriptor to connect
-  @param dest		sockaddr (ipv4 or ipv6) to connect to.
-  @param len		Length of dest
-  @param timeout	Timeout, in seconds, to wait for a completed
-  			connection.
-  @return		0 on success, -1 on failure.
- */
-static int
-connect_nb(int fd, struct sockaddr *dest, socklen_t len, int timeout)
-{
-	int ret, flags = 1, err;
-	unsigned l;
-	fd_set rfds, wfds;
-	struct timeval tv;
-
-	/*
-	 * Use TCP Keepalive
-	 */
-	if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&flags,
-		       sizeof(flags))<0)
-		return -1;
-			
-	/*
-	   Set up non-blocking connect
-	 */
-	flags = fcntl(fd, F_GETFL, 0);
-	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
-
-	ret = connect(fd, dest, len);
-
-	if ((ret < 0) && (errno != EINPROGRESS))
-		return -1;
-
-	if (ret != 0) {
-		FD_ZERO(&rfds);
-		FD_SET(fd, &rfds);
-		FD_ZERO(&wfds);
-		FD_SET(fd, &wfds);
-
-		tv.tv_sec = timeout;
-		tv.tv_usec = 0;
-		
-		if (select(fd + 1, &rfds, &wfds, NULL, &tv) == 0) {
-			errno = ETIMEDOUT;
-			return -1;
-		}
-		/* XXX check for -1 from select */
-
-		if (FD_ISSET(fd, &rfds) || FD_ISSET(fd, &wfds)) {
-			l = sizeof(err);
-			if (getsockopt(fd, SOL_SOCKET, SO_ERROR,
-				       (void *)&err, &l) < 0) {
-				close(fd);
-				return -1;
-			}
-
-			if (err != 0) {
-				close(fd);
-				errno = err;
-				return -1;
-			}
-
-			fcntl(fd, F_SETFL, flags);
-			return 0;
-		}
-	}
-
-	errno = EIO;
-	return -1;
-}
diff --git a/fence/agents/xvm/tcp.h b/fence/agents/xvm/tcp.h
deleted file mode 100644
index ec914e5..0000000
--- a/fence/agents/xvm/tcp.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _XVM_TCP_H
-#define _XVM_TCP_H
-
-int ipv4_connect(struct in_addr *in_addr, uint16_t port, int timeout);
-int ipv6_connect(struct in6_addr *in6_addr, uint16_t port, int timeout);
-int ipv4_listen(uint16_t port, int backlog);
-int ipv6_listen(uint16_t port, int backlog);
-
-#endif
diff --git a/fence/agents/xvm/tests/hvm.xml b/fence/agents/xvm/tests/hvm.xml
deleted file mode 100644
index 4134b24..0000000
--- a/fence/agents/xvm/tests/hvm.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<domain type='xen' id='707'>
-  <name>pjc-xen-06</name>
-  <uuid>081b372c69a68432a13640fa03339353</uuid>
-  <os>
-    <type>hvm</type>
-    <loader>/usr/lib/xen/boot/hvmloader</loader>
-  </os>
-  <memory>524288</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
-  <features>
-    <pae/>
-  </features>
-  <devices>
-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
-    <interface type='bridge'>
-      <source bridge='xenbr0'/>
-      <mac address='02:10:15:84:04:06'/>
-      <script path='vif-bridge'/>
-    </interface>
-    <disk type='file' device='disk'>
-      <driver name='file'/>
-      <source file='/root/pjc6'/>
-      <target dev='hda'/>
-    </disk>
-    <graphics type='vnc' port='5905'/>
-    <console tty='/dev/pts/5'/>
-  </devices>
-</domain>
-
diff --git a/fence/agents/xvm/tests/linux.xml b/fence/agents/xvm/tests/linux.xml
deleted file mode 100644
index 06ac966..0000000
--- a/fence/agents/xvm/tests/linux.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<domain type='xen' id='2'>
-  <name>r5filebacked1</name>
-  <uuid>1a31981a01944fe7b7486a384e93dbae</uuid>
-  <bootloader>/usr/bin/pygrub</bootloader>
-  <os>
-    <type>linux</type>
-    <kernel>/var/lib/xen/boot_kernel.jGsgBH</kernel>
-    <initrd>/var/lib/xen/boot_ramdisk.bYFu-q</initrd>
-    <cmdline>ro root=/dev/VolGroup00/LogVol00</cmdline>
-  </os>
-  <memory>512000</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
-  <devices>
-    <interface type='bridge'>
-      <source bridge='xenbr0'/>
-      <mac address='C0:D1:F1:ED:1D:11'/>
-      <script path='vif-bridge'/>
-    </interface>
-    <graphics type='vnc' port='5900'/>
-    <disk type='file' device='disk'>
-      <driver name='tap' type='aio'/>
-      <source file='/mnt/xen/r5filebacked1'/>
-      <target dev='xvda'/>
-    </disk>
-    <console tty='/dev/pts/0'/>
-  </devices>
-</domain>
-
diff --git a/fence/agents/xvm/virt.c b/fence/agents/xvm/virt.c
deleted file mode 100644
index a836191..0000000
--- a/fence/agents/xvm/virt.c
+++ /dev/null
@@ -1,202 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <libvirt/libvirt.h>
-#include <string.h>
-#include <malloc.h>
-#include <stdint.h>
-#include <errno.h>
-#include "virt.h"
-#include "debug.h"
-
-static int
-_compare_virt(const void *_left, const void *_right)
-{
-	virt_state_t *left = (virt_state_t *)_left,
-		     *right = (virt_state_t *)_right;
-
-	return strcasecmp(left->v_name, right->v_name);
-}
-
-
-virt_list_t *vl_get(virConnectPtr vp, int my_id)
-{
-	virt_list_t *vl = NULL;
-	int *d_ids = NULL;
-	int d_count, x;
-	char *d_name;
-	char d_uuid[MAX_DOMAINNAME_LENGTH];
-	virDomainPtr dom;
-	virDomainInfo d_info;
-
-	errno = EINVAL;
-	if (!vp)
-		return NULL;
-
-	d_count = virConnectNumOfDomains(vp);
-	if (d_count <= 0) {
-		if (d_count == 0) {
-			/* Successful, but no domains running */
-			errno = 0;
-			return NULL;
-		}
-		goto out_fail;
-	}
-
-	vl = malloc(sizeof(uint32_t) + sizeof(virt_state_t) * d_count );
-	if (!vl)
-		goto out_fail;
-
-	d_ids = malloc(sizeof(int) * d_count);
-	if (!d_ids)
-		goto out_fail;
-
-	if (virConnectListDomains(vp, d_ids, d_count) < 0)
-		goto out_fail;
-
-	vl->vm_count = d_count;
-
-	/* Ok, we have the domain IDs - let's get their names and states */
-	for (x = 0; x < d_count; x++) {
-		dom = virDomainLookupByID(vp, d_ids[x]);
-		if (!dom) {
-			/* XXX doom */
-			goto out_fail;
-		}
-
-		if (!(d_name = (char *)virDomainGetName(dom))) {
-			/* XXX no name for the domain?!! */
-			virDomainFree(dom);
-			goto out_fail;
-		}
-
-		if (virDomainGetUUIDString(dom, d_uuid) != 0) {
-			virDomainFree(dom);
-			goto out_fail;
-		}
-
-		if (virDomainGetInfo(dom, &d_info) < 0) {
-			/* XXX no info for the domain?!! */
-			virDomainFree(dom);
-			goto out_fail;
-		}
-
-		/* Store the name & state */
-		strncpy(vl->vm_states[x].v_name, d_name, MAX_DOMAINNAME_LENGTH);
-		strncpy(vl->vm_states[x].v_uuid, d_uuid, MAX_DOMAINNAME_LENGTH);
-		vl->vm_states[x].v_state.s_state = d_info.state;
-		vl->vm_states[x].v_state.s_owner = my_id;
-
-		virDomainFree(dom);
-	}
-
-	/* We have all the locally running domains & states now */
-	/* Sort */
-	free(d_ids);
-	qsort(&vl->vm_states[0], vl->vm_count, sizeof(vl->vm_states[0]),
-	      _compare_virt);
-	return vl;	
-
-out_fail:
-	x = errno;
-	if (d_ids)
-		free(d_ids);
-	if (vl)
-		free(vl);
-	errno = x;
-	return NULL;
-}
-
-
-/* Returns 0 if equal, nonzero if not */
-int
-vl_cmp(virt_list_t *left, virt_list_t *right)
-{
-	int x;
-
-	/* Quick checks */
-	if (!left->vm_count && !right->vm_count)
-		return 1;
-	if (left->vm_count != right->vm_count)
-		return 0;
-
-	for (x = 0; x < left->vm_count; x++) {
-		if (strcmp(left->vm_states[x].v_name,
-			   right->vm_states[x].v_name))
-			return 1;
-		/*
-		if (left->vm_states[x].v_state.s_state !=
-		    right->vm_states[x].v_state.s_state)
-			return 1;
-		 */
-	}
-
-	return 0;
-}
-
-
-void
-vl_print(virt_list_t *vl)
-{
-	int x;
-
-	/* XXX Once the logsys stderr "tag" goes away, the 21s should go back
-	   to 24s. */
-
-	dbg_printf(1, "%-21.21s %-36.36s %-5.5s %-5.5s\n", "Domain", "UUID",
-	       "Owner", "State");
-	dbg_printf(1, "%-21.21s %-36.36s %-5.5s %-5.5s\n", "------", "----",
-	       "-----", "-----");
-
-	if (!vl || !vl->vm_count)
-		return;
-
-	for (x = 0; x < vl->vm_count; x++) {
-		dbg_printf(1, "%-21.21s %-36.36s %-5.5d %-5.5d\n",
-		       vl->vm_states[x].v_name,
-		       vl->vm_states[x].v_uuid,
-		       vl->vm_states[x].v_state.s_owner,
-		       vl->vm_states[x].v_state.s_state);
-	}
-}
-
-
-virt_state_t *
-vl_find_name(virt_list_t *vl, char *name)
-{
-	int x;
-
-	if (!vl || !name || !vl->vm_count)
-		return NULL;
-
-	for (x = 0; x < vl->vm_count; x++) {
-		if (!strcasecmp(vl->vm_states[x].v_name, name))
-			return &vl->vm_states[x];
-	}
-
-	return NULL;
-}
-
-
-virt_state_t *
-vl_find_uuid(virt_list_t *vl, char *uuid)
-{
-	int x;
-
-	if (!vl || !uuid || !vl->vm_count)
-		return NULL;
-
-	for (x = 0; x < vl->vm_count; x++) {
-		if (!strcasecmp(vl->vm_states[x].v_uuid, uuid))
-			return &vl->vm_states[x];
-	}
-
-	return NULL;
-}
-
-
-void
-vl_free(virt_list_t *old)
-{
-	free(old);
-}
diff --git a/fence/agents/xvm/virt.h b/fence/agents/xvm/virt.h
deleted file mode 100644
index f70a0da..0000000
--- a/fence/agents/xvm/virt.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef _VIRT_H
-#define _VIRT_H
-#include <libvirt/libvirt.h>
-#include <stdint.h>
-#include <netinet/in.h>
-
-#include "xvm.h"
-
-/*
-   Owner 0 = no owner.
-
-   checkpoint "xen-vm-states" {
-     section "vm-name0" {
-       owner_nodeid;
-       vm_state;
-     }
-     section "vm-name1" {
-       owner_nodeid;
-       vm_state;
-     }
-     ...
-   }
- */
-
-typedef struct {
-	uint32_t s_owner;
-	int32_t s_state;
-} vm_state_t;
-
-typedef struct {
-	char v_name[MAX_DOMAINNAME_LENGTH];
-	char v_uuid[MAX_DOMAINNAME_LENGTH];
-	vm_state_t v_state;
-} virt_state_t;
-
-/**
-  This is stored in our private checkpoint section.
- */
-typedef struct _virt_list {
-	uint32_t	vm_count;
-	virt_state_t	vm_states[0];
-} virt_list_t;
-
-virt_list_t *vl_get(virConnectPtr vp, int my_id);
-
-int vl_cmp(virt_list_t *left, virt_list_t *right);
-
-void vl_print(virt_list_t *vl);
-void vl_free(virt_list_t *old);
-virt_state_t * vl_find_uuid(virt_list_t *vl, char *name);
-virt_state_t * vl_find_name(virt_list_t *vl, char *name);
-
-int ckpt_read(void *hp, char *secid, void *buf, size_t maxlen);
-int ckpt_finish(void *hp);
-int ckpt_write(void *hp, char *secid, void *buf, size_t maxlen);
-void *ckpt_init(const char *ckpt_name, int maxlen, int maxsec, int maxseclen,
-		int timeout);
-
-
-#endif
diff --git a/fence/agents/xvm/vm_states.c b/fence/agents/xvm/vm_states.c
deleted file mode 100644
index 87d26bf..0000000
--- a/fence/agents/xvm/vm_states.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/** @file
- * Distributed VM states using saCkpt interface
- */
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include <pthread.h>
-#include <openais/saAis.h>
-#include <openais/saCkpt.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include "virt.h"
-
-typedef struct {
-	uint32_t ck_ready;
-	int ck_timeout;
-	SaCkptCheckpointHandleT ck_checkpoint;
-	SaCkptHandleT ck_handle;
-	char *ck_name;
-} ckpt_handle;
-
-
-#define READY_MAGIC 0x13fd237c
-#define VALIDATE(h) \
-do { \
-	if (!h || h->ck_ready != READY_MAGIC) { \
-		errno = EINVAL; \
-		return -1; \
-	} \
-} while(0)
-
-int ais_to_posix(SaAisErrorT err);
-
-int
-ais_to_posix(SaAisErrorT err)
-{
-	switch (err) {
-	case SA_AIS_OK:
-		return 0;
-	case SA_AIS_ERR_LIBRARY:
-		return ELIBBAD;
-	case SA_AIS_ERR_VERSION:
-		return EPROTONOSUPPORT; //XXX
-	case SA_AIS_ERR_INIT:
-		return EFAULT; //XXX
-	case SA_AIS_ERR_TIMEOUT:
-		return ETIMEDOUT;
-	case SA_AIS_ERR_TRY_AGAIN:
-		return EAGAIN;
-	case SA_AIS_ERR_INVALID_PARAM:
-		return EINVAL;
-	case SA_AIS_ERR_NO_MEMORY:
-		return ENOMEM;
-	case SA_AIS_ERR_BAD_HANDLE:
-		return EBADF;
-	case SA_AIS_ERR_BUSY:
-		return EBUSY;
-	case SA_AIS_ERR_ACCESS:
-		return EACCES;
-	case SA_AIS_ERR_NOT_EXIST:
-		return ENOENT;
-	case SA_AIS_ERR_NAME_TOO_LONG:
-		return ENAMETOOLONG;
-	case SA_AIS_ERR_EXIST:
-		return EEXIST;
-	case SA_AIS_ERR_NO_SPACE:
-		return ENOSPC;
-	case SA_AIS_ERR_INTERRUPT:
-		return EINTR;
-	case SA_AIS_ERR_NAME_NOT_FOUND:
-		return ENOENT;
-	case SA_AIS_ERR_NO_RESOURCES:
-		return ENOMEM; //XXX
-	case SA_AIS_ERR_NOT_SUPPORTED:
-		return ENOSYS;
-	case SA_AIS_ERR_BAD_OPERATION:
-		return EINVAL; //XXX
-	case SA_AIS_ERR_FAILED_OPERATION:
-		return EIO; //XXX
-	case SA_AIS_ERR_MESSAGE_ERROR:
-		return EIO; // XXX
-	case SA_AIS_ERR_QUEUE_FULL:
-		return ENOBUFS;
-	case SA_AIS_ERR_QUEUE_NOT_AVAILABLE:
-		return ENOENT;
-	case SA_AIS_ERR_BAD_FLAGS:
-		return EINVAL;
-	case SA_AIS_ERR_TOO_BIG:
-		return E2BIG;
-	case SA_AIS_ERR_NO_SECTIONS:
-		return ENOENT; // XXX
-	case SA_AIS_ERR_SECURITY:
-		return EPERM;
-	}
-
-	return -1;
-}
-
-
-static int 
-ckpt_open(ckpt_handle *h, const char *ckpt_name, int maxsize,
-	  int maxsec, int maxsecsize, int timeout)
-{
-	SaCkptCheckpointCreationAttributesT attrs;
-	SaCkptCheckpointOpenFlagsT flags;
-	SaNameT cpname;
-#if 0
-	SaCkptCheckpointDescriptorT status;
-#endif
-	SaAisErrorT err = SA_AIS_OK;
-
-	VALIDATE(h);
-
-	flags = SA_CKPT_CHECKPOINT_READ |
-		SA_CKPT_CHECKPOINT_WRITE;
-
-	snprintf((char *)cpname.value, SA_MAX_NAME_LENGTH-1,
-		 "%s", ckpt_name);
-	cpname.length = strlen(ckpt_name);
-
-	h->ck_timeout = timeout;
-
-	err = saCkptCheckpointOpen(h->ck_handle,
-				   &cpname,
-				   NULL,	
-				   flags,
-				   timeout,
-				   &h->ck_checkpoint);
-
-	if (err == SA_AIS_OK) {
-#if 0
-		saCkptCheckpointStatusGet(h->ck_handle,
-					  &status);
-
-		printf("Checkpoint Size = %d bytes\n", (int)
-			status.checkpointCreationAttributes.checkpointSize);
-		printf("Flags = ");
-		if (status.checkpointCreationAttributes.creationFlags &
-			SA_CKPT_WR_ALL_REPLICAS) {
-			printf("%s ", "SA_CKPT_WR_ALL_REPLICAS");
-		}
-		if (status.checkpointCreationAttributes.creationFlags &
-			SA_CKPT_WR_ACTIVE_REPLICA) {
-			printf("%s ", "SA_CKPT_WR_ACTIVE_REPLICA");
-		}
-		if (status.checkpointCreationAttributes.creationFlags &
-			SA_CKPT_WR_ACTIVE_REPLICA_WEAK) {
-			printf("%s ", "SA_CKPT_WR_ACTIVE_REPLICA_WEAK");
-		}
-		if (status.checkpointCreationAttributes.creationFlags &
-			SA_CKPT_CHECKPOINT_COLLOCATED) {
-			printf("%s ", "SA_CKPT_CHECKPOINT_COLLOCATED");
-		}
-		printf("\nMax sections = %d\n",
-			(int)status.checkpointCreationAttributes.maxSections);
-		printf("Max section size = %d\n",
-			(int)status.checkpointCreationAttributes.maxSectionSize);
-		printf("Max section ID size = %d\n",
-			(int)status.checkpointCreationAttributes.maxSectionIdSize);
-		printf("Section count = %d\n", status.numberOfSections);
-		printf("\n");
-#endif
-		goto good;
-	}
-
-	attrs.creationFlags = SA_CKPT_WR_ALL_REPLICAS;
-	attrs.checkpointSize = (SaSizeT)maxsize;
-	attrs.retentionDuration = SA_TIME_ONE_HOUR;
-	attrs.maxSections = maxsec;
-	attrs.maxSectionSize = (SaSizeT)maxsecsize;
-	attrs.maxSectionIdSize = (SaSizeT)32;
-
-	flags = SA_CKPT_CHECKPOINT_READ |
-		SA_CKPT_CHECKPOINT_WRITE |
-		SA_CKPT_CHECKPOINT_CREATE;
-
-	err = saCkptCheckpointOpen(h->ck_handle,
-				   &cpname,
-				   &attrs,
-				   flags,
-				   timeout,
-				   &h->ck_checkpoint);
-	if (err == SA_AIS_OK)
-		goto good;
-
-	/* No checkpoint */
-	errno = ais_to_posix(err);
-	return (errno == 0 ? 0 : -1);
-good:
-	printf("Opened ckpt %s\n", ckpt_name);
-	h->ck_name = strdup(ckpt_name);
-
-	errno = ais_to_posix(err);
-	return (errno == 0 ? 0 : -1);
-}
-
-
-void *
-ckpt_init(const char *ckpt_name, int maxlen, int maxsec,
-	  int maxseclen, int timeout)
-{
-	ckpt_handle *h;
-	SaAisErrorT err;
-	SaVersionT ver;
-
-	if (!ckpt_name || !strlen(ckpt_name)) {
-		errno = EINVAL;
-		return NULL;
-	}
-	h = malloc(sizeof(*h));
-	if (!h)
-		return NULL;
-	memset(h, 0, sizeof(*h));
-
-	ver.releaseCode = 'B';
-	ver.majorVersion = 1;
-	ver.minorVersion = 1;
-
-	err = saCkptInitialize(&h->ck_handle, NULL, &ver);
-
-	if (err != SA_AIS_OK) {
-		free(h);
-		return NULL;
-	} else
-		h->ck_ready = READY_MAGIC;
-
-	if (ckpt_open(h, ckpt_name, maxlen, maxsec, maxseclen,
-		      timeout) < 0) {
-		saCkptCheckpointClose(h->ck_checkpoint);
-		if (h->ck_name) 
-			free(h->ck_name);
-		free(h);
-		return NULL;
-	}
-
-	return (void *)h;
-}
-
-
-int
-ckpt_write(void *hp, char *secid, void *buf, size_t maxlen)
-{
-	ckpt_handle *h = (ckpt_handle *)hp;
-	SaCkptIOVectorElementT iov = {SA_CKPT_DEFAULT_SECTION_ID,
-				      NULL, 0, 0, 0};
-	SaAisErrorT err;
-	SaCkptSectionCreationAttributesT attrs;
-
-	VALIDATE(h);
-
-	/* Set section ID here */
-	iov.sectionId.id = (uint8_t *)secid;
-	iov.sectionId.idLen = strlen(secid);
-	iov.dataBuffer = buf;
-	iov.dataSize = (SaSizeT)maxlen;
-	iov.dataOffset = 0;
-	iov.readSize = 0;
-
-	err = saCkptCheckpointWrite(h->ck_checkpoint, &iov, 1, NULL);
-
-	if (err == SA_AIS_ERR_NOT_EXIST) {
-		attrs.sectionId = &iov.sectionId;
-		attrs.expirationTime = SA_TIME_END;
-
-		err = saCkptSectionCreate(h->ck_checkpoint, &attrs, 
-					  buf, maxlen);
-	}
-
-	if (err == SA_AIS_OK)
-		saCkptCheckpointSynchronize(h->ck_checkpoint,
-					    h->ck_timeout);
-
-	errno = ais_to_posix(err);
-	if (errno)
-		return -1;
-	return maxlen; /* XXX */
-}
-
-
-int
-ckpt_read(void *hp, char *secid, void *buf, size_t maxlen)
-{
-	ckpt_handle *h = (ckpt_handle *)hp;
-	SaCkptIOVectorElementT iov = {SA_CKPT_DEFAULT_SECTION_ID,
-				      NULL, 0, 0, 0};
-	SaAisErrorT err;
-
-	VALIDATE(h);
-	//printf("reading ckpt %s\n", keyid);
-
-	iov.sectionId.id = (uint8_t *)secid;
-	iov.sectionId.idLen = strlen(secid);
-	iov.dataBuffer = buf;
-	iov.dataSize = (SaSizeT)maxlen;
-	iov.dataOffset = 0;
-	iov.readSize = 0;
-
-	err = saCkptCheckpointRead(h->ck_checkpoint, &iov, 1, NULL);
-
-	errno = ais_to_posix(err);
-	if (errno)
-		return -1;
-	return iov.readSize; /* XXX */
-}
-
-
-int
-ckpt_finish(void *hp)
-{
-	ckpt_handle *h = (ckpt_handle *)hp;
-	int ret = 0;
-	SaAisErrorT err;
-
-	saCkptCheckpointClose(h->ck_checkpoint);
-	err = saCkptFinalize(h->ck_handle);
-
-	if (err != SA_AIS_OK)
-		ret = -1;
-	else
-		h->ck_ready = 0;
-
-	if (h->ck_name)
-		free(h->ck_name);
-
-	if (ret != 0)
-		errno = ais_to_posix(err);
-	return ret;
-}
-
-
-#ifdef STANDALONE
-void
-usage(int ret)
-{
-	printf("usage: ckpt [-c ckpt_name] <-r key|-w key -d data>\n");
-	exit(ret);
-}
-
-int
-main(int argc, char **argv)
-{
-	char *ckptname = "ckpt_test";
-	char *sec = "default";
-	char *val;
-	void *h;
-	char buf[64];
-	int ret;
-	int op = 0;
-
-	while((ret = getopt(argc, argv, "c:w:r:d:j?")) != EOF) {
-		switch(ret) {
-		case 'c': 
-			ckptname = optarg;
-			break;
-		case 'w': 
-			op = 'w';
-			sec = optarg;
-			break;
-		case 'r':
-			op = 'r';
-			sec = optarg;
-			break;
-		case 'd':
-			val = optarg;
-			break;
-		case '?':
-		case 'h':
-			usage(0);
-		default:
-			usage(1);
-		}
-	}
-
-	if (!op) {
-		usage(1);
-	}
-
-	if (!sec) {
-		usage(1);
-	}
-
-	h = ckpt_init(ckptname, 262144, 4096, 64, 10);
-	if (!h) {
-		perror("ckpt_init");
-		return -1;
-	}
-
-	if (op == 'w') {
-		if (ckpt_write(h, sec, val, strlen(val)+1) < 0) {
-			perror("ckpt_write");
-			return 1;
-		}
-	} else if (op == 'r') {
-		ret = ckpt_read(h, sec, buf, sizeof(buf));
-		if (ret < 0) {
-			perror("ckpt_read");
-			return 1;
-		}
-
-		printf("%d bytes\nDATA for '%s':\n%s\n", ret, sec,
-		       buf);
-	}
-
-	ckpt_finish(h);
-
-	return 0;
-}
-#endif
diff --git a/fence/agents/xvm/xml.c b/fence/agents/xvm/xml.c
deleted file mode 100644
index 2ed4a96..0000000
--- a/fence/agents/xvm/xml.c
+++ /dev/null
@@ -1,316 +0,0 @@
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#ifdef STANDALONE
-#define dbg_printf(x, fmt, args...) printf("<%d> " fmt, x, ##args)
-#else
-#include "debug.h"
-#endif
-
-int cleanup_xml(char *xmldesc, char **ret, size_t *retsz);
-
-static xmlNodePtr
-get_os_node(xmlDocPtr doc)
-{
-	xmlNodePtr node;
-
-	/* Flip the property of the graphics port if it exists */
-	node = xmlDocGetRootElement(doc);
-	node = node->children;
-
-	while (node) {
-		if (!xmlStrcmp(node->name, (xmlChar *)"os"))
-			break;
-		node = node->next;
-	}
-
-	return node;
-}
-
-
-static int
-flip_graphics_port(xmlDocPtr doc)
-{
-	xmlNodePtr node, curr;
-
-	/* Flip the property of the graphics port if it exists */
-	node = xmlDocGetRootElement(doc);
-	node = node->children;
-
-	while (node) {
-		if (!xmlStrcmp(node->name, (xmlChar *)"devices"))
-			break;
-		node = node->next;
-	}
-
-	node = node->children;
-	curr = node;
-	while (curr) {
-		if (!xmlStrcmp(curr->name, (xmlChar *)"graphics"))
-			break;
-		curr = curr->next;
-	}
-
-	if (xmlGetProp(curr, (xmlChar *)"port")) {
-		dbg_printf(5,"Zapping the graphics port\n");
-		xmlSetProp(curr, (xmlChar *)"port", (xmlChar *)"-1");
-	}
-
-	return 0;
-}
-
-
-static int
-cleanup_xml_doc(xmlDocPtr doc)
-{
-	xmlNodePtr os_node, curr;
-	int type = 0;
-	char *val;
-
-	curr = xmlDocGetRootElement(doc);
-	if (xmlStrcmp(curr->name, (xmlChar *)"domain")) {
-		dbg_printf(1, "Invalid XML\n");
-		return -1;
-	}
-
-	flip_graphics_port(doc);
-
-	os_node = get_os_node(doc);
-	if (!os_node)
-		return -1;
-
-	curr = os_node->children;
-	while (curr) {
-		if (!xmlStrcmp(curr->name, (xmlChar *)"type"))
-			break;
-		curr = curr->next;
-	}
-	if (!curr) {
-		dbg_printf(1, "Unable to determine the domain type\n");
-		return -1;
-	}
-
-	val = (char *)xmlNodeGetContent(curr);
-	while (isspace(*val)) val++;
-
-	if (!strcasecmp(val, "hvm")) {
-		type = 1;
-		dbg_printf(2, "Virtual machine is HVM\n");
-	} else if (!strcasecmp(val, "linux")) {
-		type = 2;
-		dbg_printf(2, "Virtual machine is Linux\n");
-	}
-
-	/* Node is still pointing to the <os> block */
-	if (type == 2) {
-		dbg_printf(3, "Unlinking %s block\n", (char *)os_node->name);
-		xmlUnlinkNode(os_node);
-		xmlFreeNode(os_node);
-	}
-
-	return 0;
-}
-
-#ifdef STANDALONE
-static int
-xtree_readfile(const char *filename, xmlDocPtr *xtreep)
-{
-	xmlNodePtr cur;
-
-	xmlKeepBlanksDefault(0);
-	xmlIndentTreeOutput = 1;
-
-	*xtreep = xmlParseFile(filename);
-
-	if (!*xtreep)
-		return -1;
-
-	if (!((cur = xmlDocGetRootElement(*xtreep)))) {
-		xmlFreeDoc(*xtreep);
-		*xtreep = NULL;
-		return -1;
-	}
-
-	return 0;
-}
-#endif
-
-
-static int
-xtree_readbuffer(const char *buffer, size_t size, xmlDocPtr *xtreep)
-{
-	xmlNodePtr cur;
-
-	xmlKeepBlanksDefault(0);
-	xmlIndentTreeOutput = 1;
-
-	*xtreep = xmlParseMemory(buffer, size);
-
-	if (!*xtreep) {
-		dbg_printf(1, "parse failure %p %d\n", buffer, (int)size);
-		return -1;
-	}
-
-	if (!((cur = xmlDocGetRootElement(*xtreep)))) {
-		dbg_printf(1, "root element failure\n");
-		xmlFreeDoc(*xtreep);
-		*xtreep = NULL;
-		return -1;
-	}
-
-	return 0;
-}
-
-#ifdef STANDALONE
-static int
-xtree_writefile(const char *filename, xmlDocPtr xtree)
-{
-	char tmpfn[1024];
-	int fd, tmpfd;
-	xmlChar *buffer;
-	struct flock flock;
-	int n, remain, written, size = 0;
-
-	snprintf(tmpfn, sizeof(tmpfn), "%s.XXXXXX", filename);
-	tmpfd = mkstemp(tmpfn);
-	if (tmpfd == -1)
-		return -1;
-
-	memset(&flock, 0, sizeof(flock));
-	flock.l_type = F_WRLCK;
-
-	fd = open(filename, O_WRONLY | O_CREAT | O_SYNC, S_IRUSR | S_IWUSR );
-	if (fd == -1) {
-		n = errno;
-		close(tmpfd);
-		unlink(tmpfn);
-		errno = n;
-		return -1;
-	}
-
-	while (fcntl(fd, F_SETLKW, &flock) == -1) {
-		if (errno == EINTR)
-			continue;
-		n = errno;
-		close(fd);
-		close(tmpfd);
-		unlink(tmpfn);
-		errno = n;
-		return -1;
-	}
-
-	xmlDocDumpFormatMemory(xtree, (xmlChar **)&buffer, (int *)&size, 1);
-
-	written = 0;
-	remain = size;
-	while (remain) {
-		n = write(tmpfd, buffer + written, remain);
-
-		if (n == -1) {
-			if (errno == EINTR)
-				continue;
-				
-			free(buffer);
-			n = errno;
-			close(fd);
-			close(tmpfd);
-			unlink(tmpfn);
-			errno = n;
-			return -1;
-		}
-			
-		written += n;
-		remain -= n;
-	}
-
-	xmlFree(buffer);
-	if (rename(tmpfn, filename) == -1) {
-		n = errno;
-		close(fd);
-		close(tmpfd);
-		unlink(tmpfn);
-		errno = n;
-		return -1;
-	}
-
-	close(fd);
-	fsync(tmpfd);
-	close(tmpfd);
-	return 0;
-}
-#endif
-
-static int
-xtree_writebuffer(xmlDocPtr xtree, char **buffer, size_t *size)
-{
-	*size = 0;
-	xmlDocDumpFormatMemory(xtree, (xmlChar **)buffer, (int *)size, 1);
-	return 0;
-}
-
-
-int
-cleanup_xml(char *desc, char **ret, size_t *retsz)
-{
-	xmlDocPtr xtree;
-	int rv;
-
-	*ret = NULL;
-	if (xtree_readbuffer(desc, strlen(desc), &xtree) < 0) {
-		xmlCleanupParser();
-		return -1;
-	}
-
-	rv = cleanup_xml_doc(xtree);	
-	if (xtree_writebuffer(xtree, ret, retsz) < 0)
-		rv = -1;
-
-	if (*ret && rv < 0)
-		free(*ret);
-	xmlFreeDoc(xtree);
-	xmlCleanupParser();
-	return rv;
-}
-
-
-#ifdef STANDALONE
-int
-main(int argc, char **argv)
-{
-	char *file = NULL;
-	char *buf;
-	size_t sz;
-	int opt;
-	xmlDocPtr xtree;
-
-	while ((opt = getopt(argc, argv, "f:")) != EOF) {
-		switch(opt) {
-		case 'f':
-			file = optarg;
-			break;
-		}
-	}
-
-	if (!file) {
-		printf("No file specified\n");
-		return 1;
-	}
-
-	if (xtree_readfile(file, &xtree) < 0)
-		return -1;
-
-	cleanup_xml_doc(xtree);
-
-	xtree_writebuffer(xtree, &buf, &sz);
-	write(1, buf, sz);
-
-	return 0;
-}
-#endif
diff --git a/fence/agents/xvm/xvm.h b/fence/agents/xvm/xvm.h
deleted file mode 100644
index de89543..0000000
--- a/fence/agents/xvm/xvm.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef _XVM_H
-#define _XVM_H
-
-#include <stdint.h>
-#include <sechash.h>
-#include <netinet/in.h>
-
-#define XVM_VERSION "0.9.3"
-
-#define MAX_DOMAINNAME_LENGTH 64 /* XXX MAXHOSTNAMELEN */
-#define MAX_ADDR_LEN		sizeof(struct sockaddr_in6)
-#define DOMAIN0NAME "Domain-0"
-#define DOMAIN0UUID "00000000-0000-0000-0000-000000000000"
-
-typedef enum {
-	HASH_NONE = 0x0,	/* No packet signing */
-	HASH_SHA1 = 0x1,	/* SHA1 signing */
-     	HASH_SHA256 = 0x2,      /* SHA256 signing */
-     	HASH_SHA512 = 0x3       /* SHA512 signing */
-} fence_hash_t;
-
-#define DEFAULT_HASH HASH_SHA256
-
-typedef enum {
-	AUTH_NONE = 0x0,	/* Plain TCP */
-	AUTH_SHA1 = 0x1,	/* Challenge-response (SHA1) */
-  	AUTH_SHA256 = 0x2,      /* Challenge-response (SHA256) */
-	AUTH_SHA512 = 0x3,      /* Challenge-response (SHA512) */
-     /* AUTH_SSL_X509 = 0x10        SSL X509 certificates */
-} fence_auth_type_t;
-
-#define DEFAULT_AUTH AUTH_SHA256
-
-typedef enum {
-	FENCE_NULL   = 0x0,	
-	FENCE_OFF    = 0x1,	/* Turn the VM off */
-	FENCE_REBOOT = 0x2	/* Hit the reset button */
-     /* FENCE_ON = 0x3            Turn the VM on */
-} fence_cmd_t;
-
-#define DEFAULT_TTL 4
-
-#ifndef DEFAULT_HYPERVISOR_URI
-#define DEFAULT_HYPERVISOR_URI "qemu:///system"
-#endif
-
-#define MAX_HASH_LENGTH SHA512_LENGTH
-#define MAX_KEY_LEN 4096
-
-typedef struct __attribute__ ((packed)) _fence_req {
-	uint8_t  request;		/* Fence request */
-	uint8_t  hashtype;		/* Hash type used */
-	uint8_t  addrlen;		/* Length of address */
-	uint8_t  flags;			/* Special flags */
-#define RF_UUID 0x1			   /* Flag specifying UUID */
-	uint8_t  domain[MAX_DOMAINNAME_LENGTH]; /* Domain to fence*/
-	uint8_t  address[MAX_ADDR_LEN]; /* We're this IP */
-	uint16_t port;			/* Port we bound to */
-	uint8_t  random[10];		/* Random Data */
-	uint32_t family;		/* Address family */
-	uint8_t  hash[MAX_HASH_LENGTH];	/* Binary hash */
-} fence_req_t;
-
-
-#endif
diff --git a/fence/agents/zvm/Makefile b/fence/agents/zvm/Makefile
deleted file mode 100644
index 81f8889..0000000
--- a/fence/agents/zvm/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_zvm
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/zvm/fence_zvm.8 b/fence/agents/zvm/fence_zvm.8
deleted file mode 100644
index c58d8ae..0000000
--- a/fence/agents/zvm/fence_zvm.8
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH fence_zvm 8
-
-.SH NAME
-fence_zvm - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_zvm
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster.
-It uses the s3270 program to log the specified virtual machine out of VM.
-For fence_zvm to execute correctly, you must have s3270 in your PATH.
-
-fence_zvm accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_zvm can be run by itself with command line options which is useful
-for testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-p\fP \fIpassword\fP
-password of the virtual machine to fence (required).
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fP
-This option is used by fence_node(8) and is ignored by fence_zvm.
-.TP
-\fIipaddr = < hostname | ip >\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fIpasswd = < param >\fP
-password of the virtual machine to fence (required).
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fIuserid = < param >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fenced(8), fence_node(8)
diff --git a/fence/agents/zvm/fence_zvm.pl b/fence/agents/zvm/fence_zvm.pl
deleted file mode 100644
index f90125a..0000000
--- a/fence/agents/zvm/fence_zvm.pl
+++ /dev/null
@@ -1,353 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-use IPC::Open2;
-
-my $ME = $0;
-
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-$comm_program = s3270;
-$debug = 0;
-$max_loops = 10;
-
-sub usage
-{
-    print "Usage:\n";  
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -a <ip>          IP address or hostname of the physical s390\n";
-    print "  -h               usage\n";
-    print "  -u <string>      userid of the virtual machine to fence\n";
-    print "  -p <string>      Password\n";
-    print "  -S <path>        Script to run to retrieve login password\n";
-    print "  -q               quiet mode\n";
-    print "  -r <devnum>      ipl device <devnum>\n";
-    print "  -V               Version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg)=@_;
-  print "failed: " . $msg . "\n" unless defined $opt_q;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)=@_;
-  print stderr $msg."\n" if $msg;
-  print stderr "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-
-sub do_read
-{
-    my($line);
-
-    $line = <READ_H>;
-
-    if ($debug)
-    {
-	my($l) = ($line);
-	$l =~ s/\n//;
-	print "read:  $l\n";
-    }
-    
-    return $line;
-}
-
-sub do_write
-{
-    my($line) = @_;
-
-    if ($debug)
-    {
-	my($l) = ($line);
-	$l =~ s/\n//;
-	print "write:  $l\n";	
-    }
-
-    print WRITE_H $line;
-}
-
-
-sub look_for
-{
-    my ($text, $found);
-    $found = 0;
-    ($text) = @_;
-    &do_write("ascii\n");
-    while(1){
-	$_ = &do_read;
-	last unless (/^data:/);
-	$found = 1 if (/$text/);
-    } 
-    $_ = &do_read; 
-    fail "error while looking for string '$text'." unless (/ok/);
-    return $found;
-}
-
-sub in_cp_read_state
-{
-    my ($prev);
-    $_ = "";
-    &do_write("ascii\n");
-    while (1){
-	$prev = $_;
-	$_ = &do_read;
-	last unless (/^data:/);
-    }
-    $_ = &do_read;
-    fail "error while looking for machine state." unless (/ok/);
-    return 1 if ($prev =~ /CP READ/i);
-    return 0;
-}
-
-sub send_wait
-{ 
-    &do_write("wait\n");
-    $_ = &do_read;
-    $_ = &do_read;
-    if (/ok/){
-	return 1;
-    }
-    return 0;
-}
-
-sub send_string
-{
-    my ($cmd);
-    ($cmd) = @_;
-    &do_write('string "' . $cmd . '\n"' . "\n");
-    $_ = &do_read;
-    $_ = &do_read;
-    if (/ok/){
-	return send_wait;
-    }
-    return 0;
-}
-
-sub send_cmd
-{
-    my ($cmd);
-    ($cmd) = @_;
-    &do_write($cmd . "\n");
-    $_ = &do_read;
-    $_ = &do_read;
-    if (/ok/){
-	return send_wait;
-    }
-    return 0;
-}
-
-sub wait_for_response
-{
-    my ($pass, $failure, $msg, $found, $loops);
-    $loops = 0;
-    $found = 0;
-    ($pass, $failure, $msg) = @_;
-    while (1){
-      $loops = $loops + 1;
-      fail "timed out waiting for '$pass'" if ($loops > $max_loops);
-      &do_write("ascii\n");
-      while(1){
-        $_ = &do_read;
-        chomp;
-        last unless (/^data:/);
-        $found = 1 if (/$pass/);
-        if ($failure){
-          fail("$msg '$_'") if (/$failure/);
-        }
-      }
-      $_ = &do_read;
-      fail "wait for response failed '$_'" unless (/ok/);
-      last if $found;
-      sleep 1;
-    }
-    return 0;
-}
-
-sub check_response
-{
-    ($action) = @_;
-    $_ = &do_read;
-    $_ = &do_read;
-    fail "$action failed." unless (/ok/);
-}
-
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-        $_ = $in;
-	      chomp;
-
-        # strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-        # skip comments
-        next if /^#/;
-
-	      $line+=1;
-        $opt=$_;
-        next unless $opt;
-
-	      ($name,$val)=split /\s*=\s*/, $opt;
-
-	      if ( $name eq "" )
-        {
-           print stderr "parse error: illegal name in option $line\n";
-           exit 2;
-        }
-
-	      # DO NOTHING -- this field is used by fenced or stomithd
-        elsif ($name eq "agent" ) { }
-
-	      # FIXME -- depricated.  use "userid" and "password" instead.
-        elsif ($name eq "fm" )
-        {
-            (my $dummy,$opt_u,$opt_p) = split /\s+/,$val;
-	          print STDERR "Depricated \"fm\" entry detected.  refer to man page.\n";
-        }
-
-	      elsif ($name eq "ipaddr" )
-        {
-            $opt_a = $val;
-        }
-
-        elsif ($name eq "ipl" )
-        {
-            $opt_r = $val;
-        }
-
-        # FIXME -- depreicated residue of old fencing system
-      	elsif ($name eq "name" ) { }
-
-	      elsif ($name eq "passwd" )
-        {
-            $opt_p = $val;
-        }
-		elsif ($name eq "passwd_script" )
-		{
-			$opt_S = $val;
-		}
-	      elsif ($name eq "userid" )
-        {
-            $opt_u = $val;
-        }
-
-	else
-        {
-           print stderr "parse error: unknown option \"$opt\"\n";
-           #> exit 2;
-        }
-    }
-}
-
-if (@ARGV > 0){
-    getopts("a:hp:S:qr:u:V") || fail_usage;
-    usage if defined $opt_h;
-    version if defined $opt_V;
-
-    fail_usage "Unkown parameter." if (@ARGV > 0);
-
-    fail_usage "No '-a' flag specified." unless defined $opt_a;
-
-    if (defined $opt_S) {
-        $pwd_script_out = `$opt_S`;
-        chomp($pwd_script_out);
-        if ($pwd_script_out) {
-            $opt_p = $pwd_script_out;
-        }
-    }
-
-    fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
-    fail_usage "No '-u' flag specified." unless defined $opt_u;
-
-} else {
-    get_options_stdin();
-
-    fail "no IP address" unless defined $opt_a;
-    fail "no userid" unless defined $opt_u;
-
-    if (defined $opt_S) {
-        $pwd_script_out = `$opt_S`;
-        chomp($pwd_script_out);
-        if ($pwd_script_out) {
-            $opt_p = $pwd_script_out;
-        }
-    }
-
-    fail "no password" unless defined $opt_p;
-}
-
-$pid = open2(READ_H, WRITE_H, "$comm_program 2>&1");
-&do_write("connect $opt_a\n");
-$_ = &do_read;
-unless (/^U U U/){
-    chomp;
-    fail "communication program failed with '$_'.";
-}
-$_ = &do_read;
-fail "couldn't connect to $opt_a." unless(/ok/);
-send_wait or fail "couldn't start 3270 session on $opt_a.";
-send_cmd "enter" or fail "couldn't reach logon prompt.";
-look_for "Enter one of the following commands:" or fail "doesn't look like a login prompt\n";
-send_string "logon $opt_u $opt_p norun here" or fail "couldn't login";
-send_cmd "clear" or fail "couldn't send the clear command.";
-send_string "#cp query userid";
-wait_for_response(uc($opt_u),"Enter one of the following commands:", "logon failed");
-fail "machine not in CP READ state" unless in_cp_read_state;
-if (defined $opt_r){
-    send_string "ipl $opt_r" or fail "couldn't send reboot command";
-} else {
-    send_string "stop" or fail "couldn't send stop command\n";
-}
-fail "command failed" if look_for "Unknown CP command";
-if (defined $opt_r && !in_cp_read_state){
-    send_string "#cp disc";
-} else {
-    &do_write("disconnect\n");
-}
-&do_write("quit\n");
-
-print "success: booted userid $opt_u\n" unless defined $opt_q;
-
-exit 0;
diff --git a/gfs-kernel/src/gfs/Makefile b/gfs-kernel/src/gfs/Makefile
deleted file mode 100644
index 5bf891d..0000000
--- a/gfs-kernel/src/gfs/Makefile
+++ /dev/null
@@ -1,72 +0,0 @@
-TARGET= gfs.ko
-
-KMODT=$(TARGET)
-KDIRT=fs/gfs
-KHEADT=gfs_ondisk.h gfs_ioctl.h
-
-all: ${TARGET}
-
-ifndef USING_KBUILD
-include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-endif
-
-PWD := $(shell pwd)
-
-SYMVERFILE := ${KERNEL_BUILD}/Module.symvers
-
-obj-m := gfs.o
-gfs-objs := acl.o \
-	bits.o \
-	bmap.o \
-	daemon.o \
-	dio.o \
-	dir.o \
-	eaops.o \
-	eattr.o \
-	file.o \
-	glock.o \
-	glops.o \
-	inode.o \
-	ioctl.o \
-	lm.o \
-	locking.o \
-	lock_nolock_main.o \
-	lock_dlm_lock.o \
-	lock_dlm_main.o \
-	lock_dlm_mount.o \
-	lock_dlm_sysfs.o \
-	lock_dlm_thread.o \
-	log.o \
-	lops.o \
-	lvb.o \
-	main.o \
-	mount.o \
-	ondisk.o \
-	ops_address.o \
-	ops_dentry.o \
-	ops_export.o \
-	ops_file.o \
-	ops_fstype.o \
-	ops_inode.o \
-	ops_super.o \
-	ops_vm.o \
-	page.o \
-	proc.o \
-	quota.o \
-	recovery.o \
-	rgrp.o \
-	super.o \
-	sys.o \
-	trans.o \
-	unlinked.o \
-	util.o
-
-${TARGET}:
-	${MAKE} -C ${KERNEL_BUILD} M=${PWD} symverfile=${SYMVERFILE} modules USING_KBUILD=yes
-
-clean: generalclean
-
-.PHONY: gfs.ko
diff --git a/gfs-kernel/src/gfs/acl.c b/gfs-kernel/src/gfs/acl.c
deleted file mode 100644
index 3e9d358..0000000
--- a/gfs-kernel/src/gfs/acl.c
+++ /dev/null
@@ -1,398 +0,0 @@
-#include <linux/sched.h>
-#include <linux/fs_struct.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/posix_acl.h>
-#include <linux/posix_acl_xattr.h>
-#include <linux/cred.h>
-
-#include "gfs.h"
-#include "acl.h"
-#include "eattr.h"
-#include "inode.h"
-
-/**
- * gfs_acl_validate_set -
- * @ip:
- * @access:
- * @er:
- * @mode:
- * @remove:
- *
- * Returns: errno
- */
-
-int
-gfs_acl_validate_set(struct gfs_inode *ip, int access,
-		     struct gfs_ea_request *er,
-		     int *remove, mode_t *mode)
-{
-	struct posix_acl *acl;
-	int error;
-
-	error = gfs_acl_validate_remove(ip, access);
-	if (error)
-		return error;
-
-	if (!er->er_data)
-		return -EINVAL;
-
-	acl = posix_acl_from_xattr(er->er_data, er->er_data_len);
-	if (IS_ERR(acl))
-		return PTR_ERR(acl);
-	if (!acl) {
-		*remove = TRUE;
-		return 0;
-	}
-
-	error = posix_acl_valid(acl);
-	if (error)
-		goto out;
-
-	if (access) {
-		error = posix_acl_equiv_mode(acl, mode);
-		if (!error)
-			*remove = TRUE;
-		else if (error > 0)
-			error = 0;
-	}
-
- out:
-	posix_acl_release(acl);
-
-	return error;
-}
-
-/**
- * gfs_acl_validate_remove -
- * @ip:
- * @access:
- *
- * Returns: errno
- */
-
-int
-gfs_acl_validate_remove(struct gfs_inode *ip, int access)
-{
-	if (!ip->i_sbd->sd_args.ar_posix_acls)
-		return -EOPNOTSUPP;
-	if (current_fsuid() != ip->i_di.di_uid && !capable(CAP_FOWNER))
-		return -EPERM;
-	if (ip->i_di.di_type == GFS_FILE_LNK)
-		return -EOPNOTSUPP;
-	if (!access && ip->i_di.di_type != GFS_FILE_DIR)
-		return -EACCES;
-
-	return 0;
-}
-
-/**
- * gfs_acl_get -
- * @ip:
- * @access:
- * @acl:
- *
- * Returns: errno
- */
-
-int
-gfs_acl_get(struct gfs_inode *ip, int access, struct posix_acl **acl)
-{
-	struct gfs_ea_request er;
-	struct gfs_ea_location el;
-	int error;
-
-	if (!ip->i_di.di_eattr)
-		return 0;
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-	if (access) {
-		er.er_name = GFS_POSIX_ACL_ACCESS;
-		er.er_name_len = GFS_POSIX_ACL_ACCESS_LEN;
-	} else {
-		er.er_name = GFS_POSIX_ACL_DEFAULT;
-		er.er_name_len = GFS_POSIX_ACL_DEFAULT_LEN;
-	}
-	er.er_type = GFS_EATYPE_SYS;
-
-	error = gfs_ea_find(ip, &er, &el);
-	if (error)
-		return error;
-	if (!el.el_ea)
-		return 0;
-	if (!GFS_EA_DATA_LEN(el.el_ea))
-		goto out;
-
-	er.er_data = kmalloc(GFS_EA_DATA_LEN(el.el_ea), GFP_NOFS);
-	error = -ENOMEM;
-	if (!er.er_data)
-		goto out;
-
-	error = gfs_ea_get_copy(ip, &el, er.er_data);
-	if (error)
-		goto out_kfree;
-
-	*acl = posix_acl_from_xattr(er.er_data, GFS_EA_DATA_LEN(el.el_ea));
-	if (IS_ERR(*acl))
-		error = PTR_ERR(*acl);
-
- out_kfree:
-	kfree(er.er_data);
-
- out:
-	brelse(el.el_bh);
-
-	return error;
-}
-
-/**
- * gfs_check_acl - Check an ACL for to see if we're allowed to do something
- * @inode: the file we want to do something to
- * @mask: what we want to do
- *
- * Returns: errno
- */
-
-int
-gfs_check_acl(struct inode *inode, int mask)
-{
-	struct posix_acl *acl = NULL;
-	int error;
-
-	error = gfs_acl_get(get_v2ip(inode), TRUE, &acl);
-	if (error)
-		return error;
-
-	if (acl) {
-		error = posix_acl_permission(inode, acl, mask);
-		posix_acl_release(acl);
-		return error;
-	}
-	
-	return -EAGAIN;
-}
-
-/**
- * gfs_acl_new_prep - 
- * @dip:
- * @type:
- * @mode:
- * @a_acl:
- * @d_acl:
- * @blocks:
- * @data:
- *
- * Returns: errno
- */
-
-int
-gfs_acl_new_prep(struct gfs_inode *dip,
-		 unsigned int type, mode_t *mode,
-		 void **a_data, void **d_data,
-		 unsigned int *size,
-		 unsigned int *blocks)
-{
-	struct posix_acl *acl = NULL;
-	int set_a = FALSE, set_d = FALSE;
-	int error;
-
-	if (!dip->i_sbd->sd_args.ar_posix_acls)
-		return 0;
-	if (type == GFS_FILE_LNK)
-		return 0;
-
-	error = gfs_acl_get(dip, FALSE, &acl);
-	if (error)
-		return error;
-	if (!acl) {
-		(*mode) &= ~current->fs->umask;
-		return 0;
-	}
-
-	{
-		struct posix_acl *clone = posix_acl_clone(acl, GFP_NOFS);
-		error = -ENOMEM;
-		if (!clone)
-			goto out;
-		posix_acl_release(acl);
-		acl = clone;
-	}
-
-	error = posix_acl_create_masq(acl, mode);
-	if (error < 0)
-		goto out;
-	if (error > 0) {
-		set_a = TRUE;
-		error = 0;
-	}
-	if (type == GFS_FILE_DIR)
-		set_d = TRUE;
-
-	if (set_a || set_d) {
-		struct gfs_ea_request er;
-		void *d;
-		unsigned int s = posix_acl_xattr_size(acl->a_count);
-		unsigned int b;
-
-		memset(&er, 0, sizeof(struct gfs_ea_request));
-		er.er_name_len = GFS_POSIX_ACL_DEFAULT_LEN;
-		er.er_data_len = s;
-		error = gfs_ea_check_size(dip->i_sbd, &er);
-		if (error)
-			goto out;
-
-		b = DIV_RU(er.er_data_len, dip->i_sbd->sd_jbsize);
-		if (set_a && set_d)
-			b *= 2;
-		b++;
-
-		d = kmalloc(s, GFP_NOFS);
-		error = -ENOMEM;
-		if (!d)
-			goto out;
-		posix_acl_to_xattr(acl, d, s);
-
-		if (set_a)
-			*a_data = d;
-		if (set_d)
-			*d_data = d;
-		*size = s;
-		*blocks = b;
-
-		error = 0;
-	}
-
- out:
-	posix_acl_release(acl);
-
-	return error;
-}
-
-/**
- * gfs_acl_new_init - 
- * @dip:
- * @ip:
- * @a_data:
- * @d_data:
- * @size:
- *
- * Returns: errno
- */
-
-int gfs_acl_new_init(struct gfs_inode *dip, struct gfs_inode *ip,
-		     void *a_data, void *d_data, unsigned int size)
-{
-	void *data = (a_data) ? a_data : d_data;
-	unsigned int x;
-	int error = 0;
-
-	ip->i_alloc = dip->i_alloc; /* Cheesy, but it works. */
-
-	for (x = 0; x < 2; x++) {
-		struct gfs_ea_request er;
-
-		memset(&er, 0, sizeof(struct gfs_ea_request));
-		if (x) {
-			if (!a_data)
-				continue;
-			er.er_name = GFS_POSIX_ACL_ACCESS;
-			er.er_name_len = GFS_POSIX_ACL_ACCESS_LEN;
-		} else {
-			if (!d_data)
-				continue;
-			er.er_name = GFS_POSIX_ACL_DEFAULT;
-			er.er_name_len = GFS_POSIX_ACL_DEFAULT_LEN;
-		}
-		er.er_data = data;
-		er.er_data_len = size;
-		er.er_type = GFS_EATYPE_SYS;
-
-		error = gfs_ea_acl_init(ip, &er);
-		if (error)
-			break;
-	}	
-
-	ip->i_alloc = NULL;
-
-	kfree(data);
-
-	return error;
-}
-
-/**
- * gfs_acl_chmod -
- * @ip:
- * @attr:
- *
- * Returns: errno
- */
-
-int
-gfs_acl_chmod(struct gfs_inode *ip, struct iattr *attr)
-{
-	struct gfs_ea_request er;
-	struct gfs_ea_location el;
-	struct posix_acl *acl;
-	int error;
-
-	if (!ip->i_di.di_eattr)
-		goto simple;
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-	er.er_name = GFS_POSIX_ACL_ACCESS;
-	er.er_name_len = GFS_POSIX_ACL_ACCESS_LEN;
-	er.er_type = GFS_EATYPE_SYS;
-
-	error = gfs_ea_find(ip, &er, &el);
-	if (error)
-		return error;
-	if (!el.el_ea)
-		goto simple;
-	if (!GFS_EA_DATA_LEN(el.el_ea))
-		goto simple;
-
-	er.er_data = kmalloc(GFS_EA_DATA_LEN(el.el_ea), GFP_NOFS);
-	error = -ENOMEM;
-	if (!er.er_data)
-		goto out;
-
-	error = gfs_ea_get_copy(ip, &el, er.er_data);
-	if (error)
-		goto out_kfree;
-
-	acl = posix_acl_from_xattr(er.er_data, GFS_EA_DATA_LEN(el.el_ea));
-	if (IS_ERR(acl)) {
-		error = PTR_ERR(acl);
-		goto out_kfree;
-	} else if (!acl) {
-		kfree(er.er_data);
-		brelse(el.el_bh);
-		goto simple;
-	}
-
-	error = posix_acl_chmod_masq(acl, attr->ia_mode);
-	if (error)
-		goto out_acl;
-
-	posix_acl_to_xattr(acl, er.er_data, GFS_EA_DATA_LEN(el.el_ea));
-
-	error = gfs_ea_acl_chmod(ip, &el, attr, er.er_data);
-
- out_acl:
-	posix_acl_release(acl);
-
- out_kfree:
-	kfree(er.er_data);
-
- out:
-	brelse(el.el_bh);
-
-	return error;
-
- simple:
-	return gfs_setattr_simple(ip, attr);
-}
diff --git a/gfs-kernel/src/gfs/acl.h b/gfs-kernel/src/gfs/acl.h
deleted file mode 100644
index d28fa9c..0000000
--- a/gfs-kernel/src/gfs/acl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef __ACL_DOT_H__
-#define __ACL_DOT_H__
-
-#define GFS_POSIX_ACL_ACCESS  "posix_acl_access"
-#define GFS_POSIX_ACL_ACCESS_LEN (16)
-#define GFS_POSIX_ACL_DEFAULT "posix_acl_default"
-#define GFS_POSIX_ACL_DEFAULT_LEN (17)
-
-#define GFS_ACL_IS_ACCESS(name, len) \
-         ((len) == GFS_POSIX_ACL_ACCESS_LEN && \
-         !memcmp(GFS_POSIX_ACL_ACCESS, (name), (len)))
-
-#define GFS_ACL_IS_DEFAULT(name, len) \
-         ((len) == GFS_POSIX_ACL_DEFAULT_LEN && \
-         !memcmp(GFS_POSIX_ACL_DEFAULT, (name), (len)))
-
-struct gfs_ea_request;
-
-int gfs_acl_validate_set(struct gfs_inode *ip, int access,
-			 struct gfs_ea_request *er,
-			 int *remove, mode_t *mode);
-int gfs_acl_validate_remove(struct gfs_inode *ip, int access);
-int gfs_acl_get(struct gfs_inode *ip, int access, struct posix_acl **acl);
-int gfs_check_acl(struct inode *inode, int mask);
-int gfs_acl_new_prep(struct gfs_inode *dip,
-		     unsigned int type, mode_t *mode,
-		     void **a_data, void **d_data,
-		     unsigned int *size,
-		     unsigned int *blocks);
-int gfs_acl_new_init(struct gfs_inode *dip, struct gfs_inode *ip,
-		     void *a_data, void *d_data, unsigned int size);
-int gfs_acl_chmod(struct gfs_inode *ip, struct iattr *attr);
-
-#endif /* __ACL_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/bits.c b/gfs-kernel/src/gfs/bits.c
deleted file mode 100644
index af84bf0..0000000
--- a/gfs-kernel/src/gfs/bits.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * These routines are used by the resource group routines (rgrp.c)
- * to keep track of block allocation.  Each block is represented by two
- * bits.  One bit indicates whether or not the block is used.  (1=used,
- * 0=free)  The other bit indicates whether or not the block contains a
- * dinode or not.  (1=dinode, 0=data block) So, each byte represents
- * GFS_NBBY (i.e. 4) blocks.  
- */
-
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "bits.h"
-
-#if BITS_PER_LONG == 32
-#define LBITMASK   (0x55555555UL)
-#define LBITSKIP55 (0x55555555UL)
-#define LBITSKIP00 (0x00000000UL)
-#else
-#define LBITMASK   (0x5555555555555555UL)
-#define LBITSKIP55 (0x5555555555555555UL)
-#define LBITSKIP00 (0x0000000000000000UL)
-#endif
-
-static const char valid_change[16] = {
-	        /* current */
-	/* n */ 0, 1, 1, 1,
-	/* e */ 1, 0, 0, 0,
-	/* w */ 1, 0, 0, 1,
-	        0, 0, 1, 0
-};
-
-/**
- * gfs_setbit - Set a bit in the bitmaps
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @block: the block to set
- * @new_state: the new state of the block
- *
- */
-
-void
-gfs_setbit(struct gfs_rgrpd *rgd,
-	   unsigned char *buffer, unsigned int buflen,
-	   uint32_t block, unsigned char new_state)
-{
-	unsigned char *byte, *end, cur_state;
-	unsigned int bit;
-
-	byte = buffer + (block / GFS_NBBY);
-	bit = (block % GFS_NBBY) * GFS_BIT_SIZE;
-	end = buffer + buflen;
-
-	gfs_assert(rgd->rd_sbd, byte < end,);
-
-	cur_state = (*byte >> bit) & GFS_BIT_MASK;
-
-	if (valid_change[new_state * 4 + cur_state]) {
-		*byte ^= cur_state << bit;
-		*byte |= new_state << bit;
-	} else
-		gfs_consist_rgrpd(rgd);
-}
-
-/**
- * gfs_testbit - test a bit in the bitmaps
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @block: the block to read
- *
- */
-
-unsigned char
-gfs_testbit(struct gfs_rgrpd *rgd,
-	    unsigned char *buffer, unsigned int buflen, uint32_t block)
-{
-	unsigned char *byte, *end, cur_state;
-	unsigned int bit;
-
-	byte = buffer + (block / GFS_NBBY);
-	bit = (block % GFS_NBBY) * GFS_BIT_SIZE;
-	end = buffer + buflen;
-
-        gfs_assert(rgd->rd_sbd, byte < end,);
-
-	cur_state = (*byte >> bit) & GFS_BIT_MASK;
-
-	return cur_state;
-}
-
-/**
- * gfs_bitfit - Search an rgrp's bitmap buffer to find a bit-pair representing
- *       a block in a given allocation state.
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @goal: start search at this block's bit-pair (within @buffer)
- * @old_state: GFS_BLKST_XXX the state of the block we're looking for;
- *       bit 0 = alloc(1)/free(0), bit 1 = meta(1)/data(0)
- * 
- * Scope of @goal and returned block number is only within this bitmap buffer,
- *   not entire rgrp or filesystem.
- * @buffer will be offset from the actual beginning of a bitmap block buffer,
- *   skipping any header structures.
- *
- * Return: the block number (bitmap buffer scope) that was found
- */
-
-uint32_t
-gfs_bitfit(unsigned char *buffer, unsigned int buflen,
-	   uint32_t goal, unsigned char old_state)
-{
-	const u8 *byte, *start, *end;
-	int bit, startbit;
-	u32 g1, g2, misaligned;
-	unsigned long *plong;
-	unsigned long lskipval;
-
-	lskipval = (old_state & GFS_BLKST_USED) ? LBITSKIP00 : LBITSKIP55;
-	g1 = (goal / GFS_NBBY);
-	start = buffer + g1;
-	byte = start;
-        end = buffer + buflen;
-	g2 = ALIGN(g1, sizeof(unsigned long));
-	plong = (unsigned long *)(buffer + g2);
-	startbit = bit = (goal % GFS_NBBY) * GFS_BIT_SIZE;
-	misaligned = g2 - g1;
-	if (!misaligned)
-		goto ulong_aligned;
-/* parse the bitmap a byte at a time */
-misaligned:
-	while (byte < end) {
-		if (((*byte >> bit) & GFS_BIT_MASK) == old_state) {
-			return goal +
-				(((byte - start) * GFS_NBBY) +
-				 ((bit - startbit) >> 1));
-		}
-		bit += GFS_BIT_SIZE;
-		if (bit >= GFS_NBBY * GFS_BIT_SIZE) {
-			bit = 0;
-			byte++;
-			misaligned--;
-			if (!misaligned) {
-				plong = (unsigned long *)byte;
-				goto ulong_aligned;
-			}
-		}
-	}
-	return BFITNOENT;
-
-/* parse the bitmap a unsigned long at a time */
-ulong_aligned:
-	/* Stop at "end - 1" or else prefetch can go past the end and segfault.
-	   We could "if" it but we'd lose some of the performance gained.
-	   This way will only slow down searching the very last 4/8 bytes
-	   depending on architecture.  I've experimented with several ways
-	   of writing this section such as using an else before the goto
-	   but this one seems to be the fastest. */
-	while ((unsigned char *)plong < end - sizeof(unsigned long)) {
-		prefetch(plong + 1);
-		if (((*plong) & LBITMASK) != lskipval)
-			break;
-		plong++;
-	}
-	if ((unsigned char *)plong < end) {
-		byte = (const u8 *)plong;
-		misaligned += sizeof(unsigned long) - 1;
-		goto misaligned;
-	}
-	return BFITNOENT;
-}
-
-/**
- * gfs_bitcount - count the number of bits in a certain state
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @state: the state of the block we're looking for
- *
- * Returns: The number of bits
- */
-
-uint32_t
-gfs_bitcount(struct gfs_rgrpd *rgd,
-	     unsigned char *buffer, unsigned int buflen,
-	     unsigned char state)
-{
-	unsigned char *byte = buffer;
-	unsigned char *end = buffer + buflen;
-	unsigned char state1 = state << 2;
-	unsigned char state2 = state << 4;
-	unsigned char state3 = state << 6;
-	uint32_t count = 0;
-
-	for (; byte < end; byte++) {
-		if (((*byte) & 0x03) == state)
-			count++;
-		if (((*byte) & 0x0C) == state1)
-			count++;
-		if (((*byte) & 0x30) == state2)
-			count++;
-		if (((*byte) & 0xC0) == state3)
-			count++;
-	}
-
-	return count;
-}
diff --git a/gfs-kernel/src/gfs/bits.h b/gfs-kernel/src/gfs/bits.h
deleted file mode 100644
index 2a2372c..0000000
--- a/gfs-kernel/src/gfs/bits.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef __BITS_DOT_H__
-#define __BITS_DOT_H__
-
-#define BFITNOENT (0xFFFFFFFF)
-
-void gfs_setbit(struct gfs_rgrpd *rgd,
-		unsigned char *buffer, unsigned int buflen,
-		uint32_t block, unsigned char new_state);
-unsigned char gfs_testbit(struct gfs_rgrpd *rgd,
-			  unsigned char *buffer, unsigned int buflen,
-			  uint32_t block);
-uint32_t gfs_bitfit(unsigned char *buffer, unsigned int buflen,
-		    uint32_t goal, unsigned char old_state);
-uint32_t gfs_bitcount(struct gfs_rgrpd *rgd,
-		      unsigned char *buffer, unsigned int buflen,
-		      unsigned char state);
-
-#endif /* __BITS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/bmap.c b/gfs-kernel/src/gfs/bmap.c
deleted file mode 100644
index 0efd1d1..0000000
--- a/gfs-kernel/src/gfs/bmap.c
+++ /dev/null
@@ -1,1393 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "bmap.h"
-#include "dio.h"
-#include "glock.h"
-#include "inode.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-
-struct metapath {
-	unsigned int mp_list[GFS_MAX_META_HEIGHT];
-};
-
-typedef int (*block_call_t) (struct gfs_inode *ip, struct buffer_head *dibh,
-			     struct buffer_head *bh, uint64_t *top,
-			     uint64_t *bottom, unsigned int height,
-			     void *data);
-
-struct strip_mine {
-	int sm_first;
-	unsigned int sm_height;
-};
-
-/**
- * gfs_unstuffer_sync - unstuff a dinode synchronously
- * @ip: the inode
- * @dibh: the dinode buffer
- * @block: the block number that was allocated
- * @private: not used
- *
- * Returns: errno
- */
-
-int
-gfs_unstuffer_sync(struct gfs_inode *ip, struct buffer_head *dibh,
-		   uint64_t block, void *private)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh;
-	int error;
-
-	error = gfs_get_data_buffer(ip, block, TRUE, &bh);
-	if (error)
-		return error;
-
-	gfs_buffer_copy_tail(bh, 0, dibh, sizeof(struct gfs_dinode));
-
-	error = gfs_dwrite(sdp, bh, DIO_DIRTY | DIO_START | DIO_WAIT);
-
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * gfs_unstuffer_async - unstuff a dinode asynchronously
- * @ip: the inode
- * @dibh: the dinode buffer
- * @block: the block number that was allocated
- * @private: not used
- *
- * Returns: errno
- */
-
-int
-gfs_unstuffer_async(struct gfs_inode *ip, struct buffer_head *dibh,
-		    uint64_t block, void *private)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh;
-	int error;
-
-	error = gfs_get_data_buffer(ip, block, TRUE, &bh);
-	if (error)
-		return error;
-
-	gfs_buffer_copy_tail(bh, 0, dibh, sizeof(struct gfs_dinode));
-
-	error = gfs_dwrite(sdp, bh, DIO_DIRTY);
-
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * gfs_unstuff_dinode - Unstuff a dinode when the data has grown too big
- * @ip: The GFS inode to unstuff
- * @unstuffer: the routine that handles unstuffing a non-zero length file
- * @private: private data for the unstuffer
- *
- * This routine unstuffs a dinode and returns it to a "normal" state such 
- * that the height can be grown in the traditional way.
- *
- * Returns: errno
- */
-
-int
-gfs_unstuff_dinode(struct gfs_inode *ip, gfs_unstuffer_t unstuffer,
-		   void *private)
-{
-	struct buffer_head *bh, *dibh;
-	uint64_t block = 0;
-	int journaled = gfs_is_jdata(ip);
-	int error;
-
-	down_write(&ip->i_rw_mutex);
- 
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto out;
-
-	if (ip->i_di.di_size) {
-		/* Get a free block, fill it with the stuffed data,
-		   and write it out to disk */
-
-		if (journaled) {
-			error = gfs_metaalloc(ip, &block);
-			if (error)
-				goto out_brelse;
-
-			error = gfs_get_data_buffer(ip, block, TRUE, &bh);
-			if (error)
-				goto out_brelse;
-
-			gfs_buffer_copy_tail(bh, sizeof(struct gfs_meta_header),
-					     dibh, sizeof(struct gfs_dinode));
-
-			brelse(bh);
-		} else {
-			gfs_blkalloc(ip, &block);
-
-			error = unstuffer(ip, dibh, block, private);
-			if (error)
-				goto out_brelse;
-		}
-	}
-
-	/*  Set up the pointer to the new block  */
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-
-	gfs_buffer_clear_tail(dibh, sizeof(struct gfs_dinode));
-
-	if (ip->i_di.di_size) {
-		*(uint64_t *)(dibh->b_data + sizeof(struct gfs_dinode)) = cpu_to_gfs64(block);
-		ip->i_di.di_blocks++;
-	}
-
-	ip->i_di.di_height = 1;
-
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-
- out_brelse:
-	brelse(dibh);
-
- out:
- 	up_write(&ip->i_rw_mutex);
-
-	return error;
-}
-
-/**
- * calc_tree_height - Calculate the height of a metadata tree
- * @ip: The GFS inode
- * @size: The proposed size of the file
- *
- * Work out how tall a metadata tree needs to be in order to accommodate a
- * file of a particular size. If size is less than the current size of
- * the inode, then the current size of the inode is used instead of the
- * supplied one.
- *
- * Returns: the height the tree should be
- */
-
-static unsigned int
-calc_tree_height(struct gfs_inode *ip, uint64_t size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	uint64_t *arr;
-	unsigned int max, height;
-
-	if (ip->i_di.di_size > size)
-		size = ip->i_di.di_size;
-
-	if (gfs_is_jdata(ip)) {
-		arr = sdp->sd_jheightsize;
-		max = sdp->sd_max_jheight;
-	} else {
-		arr = sdp->sd_heightsize;
-		max = sdp->sd_max_height;
-	}
-
-	for (height = 0; height < max; height++)
-		if (arr[height] >= size)
-			break;
-
-	return height;
-}
-
-/**
- * build_height - Build a metadata tree of the requested height
- * @ip: The GFS inode
- * @height: The height to build to
- *
- * This routine makes sure that the metadata tree is tall enough to hold
- * "size" bytes of data.
- *
- * Returns: errno
- */
-
-static int
-build_height(struct gfs_inode *ip, int height)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh, *dibh;
-	uint64_t block, *bp;
-	unsigned int x;
-	int new_block;
-	int error;
-
-	while (ip->i_di.di_height < height) {
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (error)
-			return error;
-
-		new_block = FALSE;
-		bp = (uint64_t *)(dibh->b_data + sizeof(struct gfs_dinode));
-		for (x = 0; x < sdp->sd_diptrs; x++, bp++)
-			if (*bp) {
-				new_block = TRUE;
-				break;
-			}
-
-		if (new_block) {
-			/*  Get a new block, fill it with the old direct pointers,
-			    and write it out  */
-
-			error = gfs_metaalloc(ip, &block);
-			if (error)
-				goto fail;
-
-			error = gfs_dread(ip->i_gl, block,
-					  DIO_NEW | DIO_START | DIO_WAIT, &bh);
-			if (error)
-				goto fail;
-
-			gfs_trans_add_bh(ip->i_gl, bh);
-			gfs_metatype_set(bh,
-					 GFS_METATYPE_IN,
-					 GFS_FORMAT_IN);
-			memset(bh->b_data + sizeof(struct gfs_meta_header),
-			       0,
-			       sizeof(struct gfs_indirect) -
-			       sizeof(struct gfs_meta_header));
-			gfs_buffer_copy_tail(bh, sizeof(struct gfs_indirect),
-					     dibh, sizeof(struct gfs_dinode));
-
-			brelse(bh);
-		}
-
-		/*  Set up the new direct pointer and write it out to disk  */
-
-		gfs_trans_add_bh(ip->i_gl, dibh);
-
-		gfs_buffer_clear_tail(dibh, sizeof(struct gfs_dinode));
-
-		if (new_block) {
-			*(uint64_t *)(dibh->b_data + sizeof(struct gfs_dinode)) = cpu_to_gfs64(block);
-			ip->i_di.di_blocks++;
-		}
-
-		ip->i_di.di_height++;
-
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	return 0;
-
- fail:
-	brelse(dibh);
-
-	return error;
-}
-
-/**
- * find_metapath - Find path through the metadata tree
- * @ip: The inode pointer
- * @mp: The metapath to return the result in
- * @block: The disk block to look up
- *
- *   This routine returns a struct metapath structure that defines a path through
- *   the metadata of inode "ip" to get to block "block".
- *
- *   Example:
- *   Given:  "ip" is a height 3 file, "offset" is 101342453, and this is a
- *   filesystem with a blocksize of 4096.
- *
- *   find_metapath() would return a struct metapath structure set to:
- *   mp_offset = 101342453, mp_height = 3, mp_list[0] = 0, mp_list[1] = 48,
- *   and mp_list[2] = 165.
- *
- *   That means that in order to get to the block containing the byte at
- *   offset 101342453, we would load the indirect block pointed to by pointer
- *   0 in the dinode.  We would then load the indirect block pointed to by
- *   pointer 48 in that indirect block.  We would then load the data block
- *   pointed to by pointer 165 in that indirect block.
- *
- *             ----------------------------------------
- *             | Dinode |                             |
- *             |        |                            4|
- *             |        |0 1 2 3 4 5                 9|
- *             |        |                            6|
- *             ----------------------------------------
- *                       |
- *                       |
- *                       V
- *             ----------------------------------------
- *             | Indirect Block                       |
- *             |                                     5|
- *             |            4 4 4 4 4 5 5            1|
- *             |0           5 6 7 8 9 0 1            2|
- *             ----------------------------------------
- *                                |
- *                                |
- *                                V
- *             ----------------------------------------
- *             | Indirect Block                       |
- *             |                         1 1 1 1 1   5|
- *             |                         6 6 6 6 6   1|
- *             |0                        3 4 5 6 7   2|
- *             ----------------------------------------
- *                                           |
- *                                           |
- *                                           V
- *             ----------------------------------------
- *             | Data block containing offset         |
- *             |            101342453                 |
- *             |                                      |
- *             |                                      |
- *             ----------------------------------------
- *
- */
-
-static struct metapath *
-find_metapath(struct gfs_inode *ip, uint64_t block)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct metapath *mp;
-	uint64_t b = block;
-	unsigned int i;
-
-	mp = gmalloc(sizeof(struct metapath));
-	memset(mp, 0, sizeof(struct metapath));
-
-	for (i = ip->i_di.di_height; i--;)
-		mp->mp_list[i] = do_div(b, sdp->sd_inptrs);
-
-	return mp;
-}
-
-/**
- * metapointer - Return pointer to start of metadata in a buffer
- * @bh: The buffer
- * @height: The metadata height (0 = dinode)
- * @mp: The metapath 
- *
- * Return a pointer to the block number of the next height of the metadata
- * tree given a buffer containing the pointer to the current height of the
- * metadata tree.
- */
-
-static __inline__ uint64_t *
-metapointer(struct buffer_head *bh, unsigned int height, struct metapath *mp)
-{
-	unsigned int head_size = (height > 0) ?
-		sizeof(struct gfs_indirect) : sizeof(struct gfs_dinode);
-
-	return ((uint64_t *)(bh->b_data + head_size)) + mp->mp_list[height];
-}
-
-/**
- * get_metablock - Get the next metadata block in metadata tree
- * @ip: The GFS inode
- * @bh: Buffer containing the pointers to metadata blocks
- * @height: The height of the tree (0 = dinode)
- * @mp: The metapath
- * @create: Non-zero if we may create a new meatdata block
- * @new: Used to indicate if we did create a new metadata block
- * @block: the returned disk block number
- *
- * Given a metatree, complete to a particular height, checks to see if the next
- * height of the tree exists. If not the next height of the tree is created.
- * The block number of the next height of the metadata tree is returned.
- *
- * Returns: errno
- */
-
-static int
-get_metablock(struct gfs_inode *ip,
-	      struct buffer_head *bh, unsigned int height, struct metapath *mp,
-	      int create, int *new, uint64_t *block)
-{
-	uint64_t *ptr = metapointer(bh, height, mp);
-	int error;
-
-	if (*ptr) {
-		*block = gfs64_to_cpu(*ptr);
-		return 0;
-	}
-
-	*block = 0;
-
-	if (!create)
-		return 0;
-
-	error = gfs_metaalloc(ip, block);
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(ip->i_gl, bh);
-
-	*ptr = cpu_to_gfs64(*block);
-	ip->i_di.di_blocks++;
-
-	*new = 1;
-
-	return 0;
-}
-
-/**
- * get_datablock - Get datablock number from metadata block
- * @ip: The GFS inode
- * @bh: The buffer containing pointers to datablocks
- * @mp: The metapath
- * @create: Non-zero if we may create a new data block
- * @new: Used to indicate if we created a new data block
- * @block: the returned disk block number
- *
- * Given a fully built metadata tree, checks to see if a particular data
- * block exists. It is created if it does not exist and the block number
- * on disk is returned.
- *
- * Returns: errno
- */
-
-static int
-get_datablock(struct gfs_inode *ip,
-	      struct buffer_head *bh, struct metapath *mp,
-	      int create, int *new, uint64_t *block)
-{
-	uint64_t *ptr = metapointer(bh, ip->i_di.di_height - 1, mp);
-
-	if (*ptr) {
-		*block = gfs64_to_cpu(*ptr);
-		return 0;
-	}
-
-	*block = 0;
-
-	if (!create)
-		return 0;
-
-	if (gfs_is_jdata(ip)) {
-		int error;
-		error = gfs_metaalloc(ip, block);
-		if (error)
-			return error;
-	} else
-		gfs_blkalloc(ip, block);
-
-	gfs_trans_add_bh(ip->i_gl, bh);
-
-	*ptr = cpu_to_gfs64(*block);
-	ip->i_di.di_blocks++;
-
-	*new = 1;
-
-	return 0;
-}
-
-/**
- * gfs_block_map - Map a block from an inode to a disk block
- * @ip: The GFS inode
- * @lblock: The logical block number
- * @new: Value/Result argument (1 = may create/did create new blocks)
- * @dblock: the disk block number of the start of an extent
- * @extlen: the size of the extent
- *
- * Find the block number on the current device which corresponds to an
- * inode's block. If the block had to be created, "new" will be set.
- *
- * Returns: errno
- */
-
-int
-gfs_block_map(struct gfs_inode *ip,
-	      uint64_t lblock, int *new,
-	      uint64_t *dblock, uint32_t *extlen)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh;
-	struct metapath *mp;
-	int create = *new;
-	unsigned int bsize;
-	unsigned int height;
-	unsigned int end_of_metadata;
-	unsigned int x;
-	int error = 0;
-
-	*new = 0;
-	*dblock = 0;
-	if (extlen)
-		*extlen = 0;
-
-	if (create)
-		down_write(&ip->i_rw_mutex);
-	else
-		down_read(&ip->i_rw_mutex);
-
-	if (gfs_assert_warn(sdp, !gfs_is_stuffed(ip)))
-		goto out;
-
-	bsize = (gfs_is_jdata(ip)) ? sdp->sd_jbsize : sdp->sd_sb.sb_bsize;
-
-	height = calc_tree_height(ip, (lblock + 1) * bsize);
-	if (ip->i_di.di_height < height) {
-		if (!create)
-			goto out;
-
-		error = build_height(ip, height);
-		if (error)
-			goto out;
-	}
-
-	mp = find_metapath(ip, lblock);
-	end_of_metadata = ip->i_di.di_height - 1;
-
-	error = gfs_get_inode_buffer(ip, &bh);
-	if (error)
-		goto out_kfree;
-
-	for (x = 0; x < end_of_metadata; x++) {
-		error = get_metablock(ip, bh, x, mp, create, new, dblock);
-		brelse(bh);
-		if (error || !*dblock)
-			goto out_kfree;
-
-		error = gfs_get_meta_buffer(ip, x + 1, *dblock, *new, &bh);
-		if (error)
-			goto out_kfree;
-	}
-
-	error = get_datablock(ip, bh, mp, create, new, dblock);
-	if (error) {
-		brelse(bh);
-		goto out_kfree;
-	}
-
-	if (extlen && *dblock) {
-		*extlen = 1;
-
-		if (!*new) {
-			uint64_t tmp_dblock;
-			int tmp_new;
-			unsigned int nptrs;
-
-			nptrs = (end_of_metadata) ? sdp->sd_inptrs : sdp->sd_diptrs;
-
-			while (++mp->mp_list[end_of_metadata] < nptrs) {
-				get_datablock(ip, bh, mp,
-					      FALSE, &tmp_new,
-					      &tmp_dblock);
-
-				if (*dblock + *extlen != tmp_dblock)
-					break;
-
-				(*extlen)++;
-			}
-		}
-	}
-
-	brelse(bh);
-
-	if (*new) {
-		error = gfs_get_inode_buffer(ip, &bh);
-		if (!error) {
-			gfs_trans_add_bh(ip->i_gl, bh);
-			gfs_dinode_out(&ip->i_di, bh->b_data);
-			brelse(bh);
-		}
-	}
-
- out_kfree:
-	kfree(mp);
-
- out:
-	if (create)
-		up_write(&ip->i_rw_mutex);
-	else
-		up_read(&ip->i_rw_mutex);
- 
-	return error;
-}
-
-/**
- * do_grow - Make a file look bigger than it is
- * @ip: the inode
- * @size: the size to set the file to
- *
- * Called with an exclusive lock on @ip.
- *
- * Returns: errno
- */
-
-static int
-do_grow(struct gfs_inode *ip, uint64_t size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al;
-	struct buffer_head *dibh;
-	unsigned int h;
-	int journaled = gfs_is_jdata(ip);
-	int error;
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_lock_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out;
-
-	error = gfs_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
-	if (error)
-		goto out_gunlock_q;
-
-	if (journaled)
-		al->al_requested_meta = sdp->sd_max_height + 1;
-	else {
-		al->al_requested_meta = sdp->sd_max_height;
-		al->al_requested_data = 1;
-	}
-
-	error = gfs_inplace_reserve(ip);
-	if (error)
-		goto out_gunlock_q;
-
-	/* Trans may require:
-	   Full extention of the metadata tree, block allocation,
-	   a dinode modification, and a quota change */
-
-	error = gfs_trans_begin(sdp,
-				sdp->sd_max_height + al->al_rgd->rd_ri.ri_length +
-				1 + !!journaled,
-				1);
-	if (error)
-		goto out_ipres;
-
-	if (size > sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode)) {
-		if (gfs_is_stuffed(ip)) {
-			error = gfs_unstuff_dinode(ip, gfs_unstuffer_sync, NULL);
-			if (error)
-				goto out_end_trans;
-		}
-
-		h = calc_tree_height(ip, size);
-		if (ip->i_di.di_height < h) {
-			down_write(&ip->i_rw_mutex);
-			error = build_height(ip, h);
-			up_write(&ip->i_rw_mutex);
-			if (error)
-				goto out_end_trans;
-		}
-	}
-
-	ip->i_di.di_size = size;
-	ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto out_end_trans;
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-
- out_end_trans:
-	gfs_trans_end(sdp);
-
- out_ipres:
-	gfs_inplace_release(ip);
-
- out_gunlock_q:
-	gfs_quota_unlock_m(ip);
-
- out:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * recursive_scan - recursively scan through the end of a file
- * @ip: the inode
- * @dibh: the dinode buffer
- * @mp: the path through the metadata to the point to start
- * @height: the height the recursion is at
- * @block: the indirect block to look at
- * @first: TRUE if this is the first block
- * @bc: the call to make for each piece of metadata
- * @data: data opaque to this function to pass to @bc
- *
- * When this is first called @height and @block should be zero and
- * @first should be TRUE.
- *
- * Returns: errno
- */
-
-static int
-recursive_scan(struct gfs_inode *ip, struct buffer_head *dibh,
-	       struct metapath *mp, unsigned int height, uint64_t block,
-	       int first, block_call_t bc, void *data)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh = NULL;
-	uint64_t *top, *bottom;
-	uint64_t bn;
-	int error;
-
-	if (!height) {
-		error = gfs_get_inode_buffer(ip, &bh);
-		if (error)
-			goto fail;
-		dibh = bh;
-
-		top = (uint64_t *)(bh->b_data + sizeof(struct gfs_dinode)) +
-			mp->mp_list[0];
-		bottom = (uint64_t *)(bh->b_data + sizeof(struct gfs_dinode)) +
-			sdp->sd_diptrs;
-	} else {
-		error = gfs_get_meta_buffer(ip, height, block, FALSE, &bh);
-		if (error)
-			goto fail;
-
-		top = (uint64_t *)(bh->b_data + sizeof(struct gfs_indirect)) +
-			((first) ? mp->mp_list[height] : 0);
-		bottom = (uint64_t *)(bh->b_data + sizeof(struct gfs_indirect)) +
-			sdp->sd_inptrs;
-	}
-
-	error = bc(ip, dibh, bh, top, bottom, height, data);
-	if (error)
-		goto fail;
-
-	if (height < ip->i_di.di_height - 1)
-		for (; top < bottom; top++, first = FALSE) {
-			if (!*top)
-				continue;
-
-			bn = gfs64_to_cpu(*top);
-
-			error = recursive_scan(ip, dibh, mp,
-					       height + 1, bn, first,
-					       bc, data);
-			if (error)
-				goto fail;
-		}
-
-	brelse(bh);
-
-	return 0;
-
- fail:
-	if (bh)
-		brelse(bh);
-
-	return error;
-}
-
-/**
- * do_strip - Look for a layer a particular layer of the file and strip it off
- * @ip: the inode
- * @dibh: the dinode buffer
- * @bh: A buffer of pointers
- * @top: The first pointer in the buffer
- * @bottom: One more than the last pointer
- * @height: the height this buffer is at
- * @data: a pointer to a struct strip_mine
- *
- * Returns: errno
- */
-
-static int
-do_strip(struct gfs_inode *ip, struct buffer_head *dibh,
-	 struct buffer_head *bh, uint64_t *top, uint64_t *bottom,
-	 unsigned int height, void *data)
-{
-	struct strip_mine *sm = (struct strip_mine *)data;
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrp_list rlist;
-	uint64_t bn, bstart;
-	uint32_t blen;
-	uint64_t *p;
-	unsigned int rg_blocks = 0;
-	int metadata;
-	int x;
-	int error;
-
-	if (!*top)
-		sm->sm_first = FALSE;
-
-	if (height != sm->sm_height)
-		return 0;
-
-	if (sm->sm_first) {
-		top++;
-		sm->sm_first = FALSE;
-	}
-
-	metadata = (height != ip->i_di.di_height - 1) || gfs_is_jdata(ip);
-
-	error = gfs_rindex_hold(sdp, &ip->i_alloc->al_ri_gh);
-	if (error)
-		return error;
-
-	memset(&rlist, 0, sizeof(struct gfs_rgrp_list));
-	bstart = 0;
-	blen = 0;
-
-	for (p = top; p < bottom; p++) {
-		if (!*p)
-			continue;
-
-		bn = gfs64_to_cpu(*p);
-
-		if (bstart + blen == bn)
-			blen++;
-		else {
-			if (bstart)
-				gfs_rlist_add(sdp, &rlist, bstart);
-
-			bstart = bn;
-			blen = 1;
-		}
-	}
-
-	if (bstart)
-		gfs_rlist_add(sdp, &rlist, bstart);
-	else
-		goto out; /* Nothing to do */
-
-	gfs_rlist_alloc(&rlist, LM_ST_EXCLUSIVE, 0);
-
-	for (x = 0; x < rlist.rl_rgrps; x++) {
-		struct gfs_rgrpd *rgd;
-		rgd = get_gl2rgd(rlist.rl_ghs[x].gh_gl);
-		rg_blocks += rgd->rd_ri.ri_length;
-	}
-
-	error = gfs_glock_nq_m(rlist.rl_rgrps, rlist.rl_ghs);
-	if (error)
-		goto out_rlist;
-
-	/* Trans may require:
-	   All the bitmaps that were reserved. 
-	   One block for the dinode.
-	   One block for the indirect block being cleared.
-	   One block for a quota change. */
-
-	error = gfs_trans_begin(sdp, rg_blocks + 2, 1);
-	if (error)
-		goto out_rg_gunlock;
-
-	down_write(&ip->i_rw_mutex);
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_trans_add_bh(ip->i_gl, bh);
-
-	bstart = 0;
-	blen = 0;
-
-	for (p = top; p < bottom; p++) {
-		if (!*p)
-			continue;
-
-		bn = gfs64_to_cpu(*p);
-
-		if (bstart + blen == bn)
-			blen++;
-		else {
-			if (bstart) {
-				if (metadata)
-					gfs_metafree(ip, bstart, blen);
-				else
-					gfs_blkfree(ip, bstart, blen);
-			}
-
-			bstart = bn;
-			blen = 1;
-		}
-
-		*p = 0;
-		if (!ip->i_di.di_blocks)
-			gfs_consist_inode(ip);
-		ip->i_di.di_blocks--;
-	}
-	if (bstart) {
-		if (metadata)
-			gfs_metafree(ip, bstart, blen);
-		else
-			gfs_blkfree(ip, bstart, blen);
-	}
-
-	ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-
-	up_write(&ip->i_rw_mutex);
-
-	gfs_trans_end(sdp);
-
- out_rg_gunlock:
-	gfs_glock_dq_m(rlist.rl_rgrps, rlist.rl_ghs);
-
- out_rlist:
-	gfs_rlist_free(&rlist);
-
- out:
-	gfs_glock_dq_uninit(&ip->i_alloc->al_ri_gh);
-
-	return error;
-}
-
-/**
- * gfs_truncator_default - truncate a partial data block
- * @ip: the inode
- * @size: the size the file should be
- *
- * Returns: errno
- */
-
-int
-gfs_truncator_default(struct gfs_inode *ip, uint64_t size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh;
-	uint64_t bn;
-	int not_new = 0;
-	int error;
-
-	error = gfs_block_map(ip, size >> sdp->sd_sb.sb_bsize_shift, &not_new,
-			      &bn, NULL);
-	if (error)
-		return error;
-	if (!bn)
-		return 0;
-
-	error = gfs_get_data_buffer(ip, bn, FALSE, &bh);
-	if (error)
-		return error;
-
-	gfs_buffer_clear_tail(bh, size & (sdp->sd_sb.sb_bsize - 1));
-
-	error = gfs_dwrite(sdp, bh, DIO_DIRTY);
-
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * truncator_journaled - truncate a partial data block
- * @ip: the inode
- * @size: the size the file should be
- *
- * Returns: errno
- */
-
-static int
-truncator_journaled(struct gfs_inode *ip, uint64_t size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh;
-	uint64_t lbn, dbn;
-	uint32_t off;
-	int not_new = 0;
-	int error;
-
-	lbn = size;
-	off = do_div(lbn, sdp->sd_jbsize);
-
-	error = gfs_block_map(ip, lbn, &not_new, &dbn, NULL);
-	if (error)
-		return error;
-	if (!dbn)
-		return 0;
-
-	error = gfs_trans_begin(sdp, 1, 0);
-	if (error)
-		return error;
-
-	error = gfs_get_data_buffer(ip, dbn, FALSE, &bh);
-	if (!error) {
-		gfs_trans_add_bh(ip->i_gl, bh);
-		gfs_buffer_clear_tail(bh,
-				      sizeof(struct gfs_meta_header) +
-				      off);
-		brelse(bh);
-	}
-
-	gfs_trans_end(sdp);
-
-	return error;
-}
-
-/**
- * gfs_shrink - make a file smaller
- * @ip: the inode
- * @size: the size to make the file
- * @truncator: function to truncate the last partial block
- *
- * Called with an exclusive lock on @ip.
- *
- * Returns: errno
- */
-
-int
-gfs_shrink(struct gfs_inode *ip, uint64_t size, gfs_truncator_t truncator)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_holder ri_gh;
-	struct gfs_rgrpd *rgd;
-	struct buffer_head *dibh;
-	uint64_t block;
-	unsigned int height;
-	int journaled = gfs_is_jdata(ip);
-	int error;
-
-	if (!size)
-		block = 0;
-	else if (journaled) {
-		block = size - 1;
-		do_div(block, sdp->sd_jbsize);
-	}
-	else
-		block = (size - 1) >> sdp->sd_sb.sb_bsize_shift;
-
-	/*  Get rid of all the data/metadata blocks  */
-
-	height = ip->i_di.di_height;
-	if (height) {
-		struct metapath *mp = find_metapath(ip, block);
-		gfs_alloc_get(ip);
-
-		error = gfs_quota_hold_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-		if (error) {
-			gfs_alloc_put(ip);
-			kfree(mp);
-			return error;
-		}
-
-		while (height--) {
-			struct strip_mine sm;
-
-			sm.sm_first = (size) ? TRUE : FALSE;
-			sm.sm_height = height;
-
-			error = recursive_scan(ip, NULL, mp, 0, 0, TRUE,
-					       do_strip, &sm);
-			if (error) {
-				gfs_quota_unhold_m(ip);
-				gfs_alloc_put(ip);
-				kfree(mp);
-				return error;
-			}
-		}
-
-		gfs_quota_unhold_m(ip);
-		gfs_alloc_put(ip);
-		kfree(mp);
-	}
-
-	/*  If we truncated in the middle of a block, zero out the leftovers.  */
-
-	if (gfs_is_stuffed(ip)) {
-		/*  Do nothing  */
-	} else if (journaled) {
-		if (do_mod(size, sdp->sd_jbsize)) {
-			error = truncator_journaled(ip, size);
-			if (error)
-				return error;
-		}
-	} else if (size & (uint64_t)(sdp->sd_sb.sb_bsize - 1)) {
-		error = truncator(ip, size);
-		if (error)
-			return error;
-	}
-
-	/*  Set the new size (and possibly the height)  */
-
-	if (!size) {
-		error = gfs_rindex_hold(sdp, &ri_gh);
-		if (error)
-			return error;
-	}
-
-	error = gfs_trans_begin(sdp, 1, 0);
-	if (error)
-		goto out;
-
-	down_write(&ip->i_rw_mutex);
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto out_end_trans;
-
-	if (!size) {
-		ip->i_di.di_height = 0;
-
-		rgd = gfs_blk2rgrpd(sdp, ip->i_num.no_addr);
-		if (!rgd) {
-			gfs_consist_inode(ip);
-			error = -EIO;
-			goto out_end_trans;
-		}
-
-		ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-		ip->i_di.di_goal_dblk =
-			ip->i_di.di_goal_mblk =
-			ip->i_num.no_addr - rgd->rd_ri.ri_data1;
-	}
-
-	ip->i_di.di_size = size;
-	ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-
-	if (!ip->i_di.di_height &&
-	    size < sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode))
-		gfs_buffer_clear_tail(dibh, sizeof(struct gfs_dinode) + size);
-
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-
- out_end_trans:
-	up_write(&ip->i_rw_mutex);
-
-	gfs_trans_end(sdp);
-
- out:
-	if (!size)
-		gfs_glock_dq_uninit(&ri_gh);
-
-	return error;
-}
-
-/**
- * do_same - truncate to same size (update time stamps)
- * @ip: 
- *
- * Returns: errno
- */
-
-static int
-do_same(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *dibh;
-	int error;
-
-	error = gfs_trans_begin(sdp, 1, 0);
-	if (error)
-		return error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto out;
-
-	ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-
-	brelse(dibh);
-
- out:
-	gfs_trans_end(sdp);
-
-	return error;
-}
-
-/**
- * gfs_truncatei - make a file a give size
- * @ip: the inode
- * @size: the size to make the file
- * @truncator: function to truncate the last partial block
- *
- * The file size can grow, shrink, or stay the same size.
- *
- * Returns: errno
- */
-
-int
-gfs_truncatei(struct gfs_inode *ip, uint64_t size,
-	      gfs_truncator_t truncator)
-{
-	if (gfs_assert_warn(ip->i_sbd, ip->i_di.di_type == GFS_FILE_REG))
-		return -EINVAL;
-
-	if (size == ip->i_di.di_size)
-		return do_same(ip);
-	else if (size > ip->i_di.di_size)
-		return do_grow(ip, size);
-	else
-		return gfs_shrink(ip, size, truncator);
-}
-
-/**
- * gfs_write_calc_reserv - calculate the number of blocks needed to write to a file
- * @ip: the file
- * @len: the number of bytes to be written to the file
- * @data_blocks: returns the number of data blocks required
- * @ind_blocks: returns the number of indirect blocks required
- *
- */
-
-void
-gfs_write_calc_reserv(struct gfs_inode *ip, unsigned int len,
-		      unsigned int *data_blocks, unsigned int *ind_blocks)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	unsigned int tmp;
-
-	if (gfs_is_jdata(ip)) {
-		*data_blocks = DIV_RU(len, sdp->sd_jbsize) + 2;
-		*ind_blocks = 3 * (sdp->sd_max_jheight - 1);
-	} else {
-		*data_blocks = (len >> sdp->sd_sb.sb_bsize_shift) + 3;
-		*ind_blocks = 3 * (sdp->sd_max_height - 1);
-	}
-
-	for (tmp = *data_blocks; tmp > sdp->sd_diptrs;) {
-		tmp = DIV_RU(tmp, sdp->sd_inptrs);
-		*ind_blocks += tmp;
-	}
-}
-
-/**
- * gfs_write_alloc_required - figure out if a write is going to require an allocation
- * @ip: the file being written to
- * @offset: the offset to write to
- * @len: the number of bytes being written
- * @alloc_required: the int is set to TRUE if an alloc is required, FALSE otherwise
- *
- * Returns: errno
- */
-
-int
-gfs_write_alloc_required(struct gfs_inode *ip,
-			 uint64_t offset, unsigned int len,
-			 int *alloc_required)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	uint64_t lblock, lblock_stop, dblock;
-	uint32_t extlen;
-	int not_new = FALSE;
-	int error = 0;
-
-	*alloc_required = FALSE;
-
-	if (!len)
-		return 0;
-
-	if (gfs_is_stuffed(ip)) {
-		if (offset + len > sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode))
-			*alloc_required = TRUE;
-		return 0;
-	}
-
-	if (gfs_is_jdata(ip)) {
-		unsigned int bsize = sdp->sd_jbsize;
-		lblock = offset;
-		do_div(lblock, bsize);
-		lblock_stop = offset + len + bsize - 1;
-		do_div(lblock_stop, bsize);
-	} else {
-		unsigned int shift = sdp->sd_sb.sb_bsize_shift;
-		lblock = offset >> shift;
-		lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift;
-	}
-
-	for (; lblock < lblock_stop; lblock += extlen) {
-		error = gfs_block_map(ip, lblock, &not_new, &dblock, &extlen);
-		if (error)
-			return error;
-
-		if (!dblock) {
-			*alloc_required = TRUE;
-			return 0;
-		}
-	}
-
-	return 0;
-}
-
-/**
- * do_gfm - Copy out the dinode/indirect blocks of a file
- * @ip: the file
- * @dibh: the dinode buffer
- * @bh: the indirect buffer we're looking at
- * @top: the first pointer in the block
- * @bottom: one more than the last pointer in the block
- * @height: the height the block is at
- * @data: a pointer to a struct gfs_user_buffer structure
- *
- * If this is a journaled file, copy out the data too.
- *
- * Returns: errno
- */
-
-static int
-do_gfm(struct gfs_inode *ip, struct buffer_head *dibh,
-       struct buffer_head *bh, uint64_t *top, uint64_t *bottom,
-       unsigned int height, void *data)
-{
-	struct gfs_user_buffer *ub = (struct gfs_user_buffer *)data;
-	int error;
-
-	error = gfs_add_bh_to_ub(ub, bh);
-	if (error)
-		return error;
-
-	if (ip->i_di.di_type != GFS_FILE_DIR ||
-	    height + 1 != ip->i_di.di_height)
-		return 0;
-
-	for (; top < bottom; top++)
-		if (*top) {
-			struct buffer_head *data_bh;
-
-			error = gfs_dread(ip->i_gl, gfs64_to_cpu(*top),
-					  DIO_START | DIO_WAIT,
-					  &data_bh);
-			if (error)
-				return error;
-
-			error = gfs_add_bh_to_ub(ub, data_bh);
-
-			brelse(data_bh);
-
-			if (error)
-				return error;
-		}
-
-	return 0;
-}
-
-/**
- * gfs_get_file_meta - return all the metadata for a file
- * @ip: the file
- * @ub: the structure representing the meta
- *
- * Returns: errno
- */
-
-int
-gfs_get_file_meta(struct gfs_inode *ip, struct gfs_user_buffer *ub)
-{
-	int error;
-
-	if (gfs_is_stuffed(ip)) {
-		struct buffer_head *dibh;
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (!error) {
-			error = gfs_add_bh_to_ub(ub, dibh);
-			brelse(dibh);
-		}
-	} else {
-		struct metapath *mp = find_metapath(ip, 0);
-		error = recursive_scan(ip, NULL, mp, 0, 0, TRUE, do_gfm, ub);
-		kfree(mp);
-	}
-
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/bmap.h b/gfs-kernel/src/gfs/bmap.h
deleted file mode 100644
index b9ce2e7..0000000
--- a/gfs-kernel/src/gfs/bmap.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef __BMAP_DOT_H__
-#define __BMAP_DOT_H__
-
-typedef int (*gfs_unstuffer_t) (struct gfs_inode * ip,
-				struct buffer_head * dibh, uint64_t block,
-				void *private);
-
-int gfs_unstuffer_sync(struct gfs_inode *ip, struct buffer_head *dibh,
-		       uint64_t block, void *private);
-int gfs_unstuffer_async(struct gfs_inode *ip, struct buffer_head *dibh,
-			uint64_t block, void *private);
-
-int gfs_unstuff_dinode(struct gfs_inode *ip, gfs_unstuffer_t unstuffer,
-		       void *private);
-
-int gfs_block_map(struct gfs_inode *ip,
-		  uint64_t lblock, int *new,
-		  uint64_t *dblock, uint32_t *extlen);
-
-typedef int (*gfs_truncator_t) (struct gfs_inode * ip, uint64_t size);
-
-int gfs_truncator_default(struct gfs_inode *ip, uint64_t size);
-
-int gfs_shrink(struct gfs_inode *ip, uint64_t size, gfs_truncator_t truncator);
-int gfs_truncatei(struct gfs_inode *ip, uint64_t size,
-		  gfs_truncator_t truncator);
-
-void gfs_write_calc_reserv(struct gfs_inode *ip, unsigned int len,
-			   unsigned int *data_blocks, unsigned int *ind_blocks);
-int gfs_write_alloc_required(struct gfs_inode *ip, uint64_t offset,
-			     unsigned int len, int *alloc_required);
-
-int gfs_get_file_meta(struct gfs_inode *ip, struct gfs_user_buffer *ub);
-
-#endif /* __BMAP_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/daemon.c b/gfs-kernel/src/gfs/daemon.c
deleted file mode 100644
index 378e0a7..0000000
--- a/gfs-kernel/src/gfs/daemon.c
+++ /dev/null
@@ -1,181 +0,0 @@
-#include <linux/kthread.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "daemon.h"
-#include "glock.h"
-#include "log.h"
-#include "quota.h"
-#include "recovery.h"
-#include "super.h"
-#include "unlinked.h"
-
-/**
- * gfs_scand - Look for cached glocks and inodes to toss from memory
- * @sdp: Pointer to GFS superblock
- *
- * One of these daemons runs, finding candidates to add to sd_reclaim_list.
- * See gfs_glockd()
- */
-
-int
-gfs_scand(void *data)
-{
-	struct gfs_sbd *sdp = (struct gfs_sbd *)data;
-
-	while (!kthread_should_stop()) {
-		gfs_scand_internal(sdp);
-		schedule_timeout_interruptible(gfs_tune_get(sdp, gt_scand_secs) * HZ);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_glockd - Reclaim unused glock structures
- * @sdp: Pointer to GFS superblock
- *
- * One or more of these daemons run, reclaiming glocks on sd_reclaim_list.
- * sd_glockd_num says how many daemons are running now.
- * Number of daemons can be set by user, with num_glockd mount option.
- * See gfs_scand()
- */
-
-int
-gfs_glockd(void *data)
-{
-	struct gfs_sbd *sdp = (struct gfs_sbd *)data;
-
-	while (!kthread_should_stop()) {
-		while (atomic_read(&sdp->sd_reclaim_count))
-			gfs_reclaim_glock(sdp);
-
-		wait_event_interruptible(sdp->sd_reclaim_wchan,
-								 (atomic_read(&sdp->sd_reclaim_count) ||
-								  kthread_should_stop()));
-	}
-
-	return 0;
-}
-
-/**
- * gfs_recoverd - Recover dead machine's journals
- * @sdp: Pointer to GFS superblock
- *
- */
-
-int
-gfs_recoverd(void *data)
-{
-	struct gfs_sbd *sdp = (struct gfs_sbd *)data;
-
-	while (!kthread_should_stop()) {
-		gfs_check_journals(sdp);
-		schedule_timeout_interruptible(gfs_tune_get(sdp, gt_recoverd_secs) * HZ);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_logd - Update log tail as Active Items get flushed to in-place blocks
- * @sdp: Pointer to GFS superblock
- *
- * Also, periodically check to make sure that we're using the most recent
- * journal index.
- */
-
-int
-gfs_logd(void *data)
-{
-	struct gfs_sbd *sdp = (struct gfs_sbd *)data;
-	struct gfs_holder ji_gh;
-
-	while (!kthread_should_stop()) {
-		/* Advance the log tail */
-		gfs_ail_empty(sdp);
-
-		/* Check for latest journal index */
-		if (time_after_eq(jiffies,
-				  sdp->sd_jindex_refresh_time +
-				  gfs_tune_get(sdp, gt_jindex_refresh_secs) * HZ)) {
-			if (test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags) &&
-			    !gfs_jindex_hold(sdp, &ji_gh))
-				gfs_glock_dq_uninit(&ji_gh);
-			sdp->sd_jindex_refresh_time = jiffies;
-		}
-
-		schedule_timeout_interruptible(gfs_tune_get(sdp, gt_logd_secs) * HZ);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_quotad - Write cached quota changes into the quota file
- * @sdp: Pointer to GFS superblock
- *
- */
-
-int
-gfs_quotad(void *data)
-{
-	struct gfs_sbd *sdp = (struct gfs_sbd *)data;
-	int error;
-
-	while (!kthread_should_stop()) {
-		/* Update statfs file */
-		if (gfs_tune_get(sdp, gt_statfs_fast) &&
-			time_after_eq(jiffies,
-			sdp->sd_statfs_sync_time +
-			gfs_tune_get(sdp, gt_statfs_fast) * HZ)) {
-			error = gfs_statfs_sync(sdp);
-			if (error && error != -EROFS &&
-				!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-				printk("GFS: fsid=%s: statfs: error = %d\n",
-				sdp->sd_fsname, error);
-				sdp->sd_statfs_sync_time = jiffies;
-		}
-		/* Update quota file */
-		if (time_after_eq(jiffies,
-				  sdp->sd_quota_sync_time +
-				  gfs_tune_get(sdp, gt_quota_quantum) * HZ)) {
-			error = gfs_quota_sync(sdp);
-			if (error &&
-			    error != -EROFS &&
-			    !test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-				printk("GFS: fsid=%s: quotad: error = %d\n",
-				       sdp->sd_fsname, error);
-			sdp->sd_quota_sync_time = jiffies;
-		}
-
-		/* Clean up */
-		gfs_quota_scan(sdp);
-		schedule_timeout_interruptible(gfs_tune_get(sdp, gt_quotad_secs) * HZ);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_inoded - Deallocate unlinked inodes
- * @sdp: Pointer to GFS superblock
- *
- */
-
-int
-gfs_inoded(void *data)
-{
-	struct gfs_sbd *sdp = (struct gfs_sbd *)data;
-
-	while (!kthread_should_stop()) {
-		gfs_unlinked_dealloc(sdp);
-		schedule_timeout_interruptible(gfs_tune_get(sdp, gt_inoded_secs) * HZ);
-	}
-
-	return 0;
-}
diff --git a/gfs-kernel/src/gfs/daemon.h b/gfs-kernel/src/gfs/daemon.h
deleted file mode 100644
index 882c72f..0000000
--- a/gfs-kernel/src/gfs/daemon.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __DAEMON_DOT_H__
-#define __DAEMON_DOT_H__
-
-int gfs_scand(void *data);
-int gfs_glockd(void *data);
-int gfs_recoverd(void *data);
-int gfs_logd(void *data);
-int gfs_quotad(void *data);
-int gfs_inoded(void *data);
-
-#endif /* __DAEMON_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/dio.c b/gfs-kernel/src/gfs/dio.c
deleted file mode 100644
index 56cb185..0000000
--- a/gfs-kernel/src/gfs/dio.c
+++ /dev/null
@@ -1,1342 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-#include <linux/writeback.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "log.h"
-#include "lops.h"
-#include "rgrp.h"
-#include "trans.h"
-
-#define buffer_busy(bh) ((bh)->b_state & ((1ul << BH_Dirty) | (1ul << BH_Lock)))
-
-/**
- * aspace_get_block - 
- * @inode:
- * @lblock:
- * @bh_result:
- * @create:
- *
- * Returns: errno
- */
-
-static int
-aspace_get_block(struct inode *inode, sector_t lblock,
-		 struct buffer_head *bh_result, int create)
-{
-	gfs_assert_warn(get_v2sdp(inode->i_sb), FALSE);
-	return -ENOSYS;
-}
-
-/**
- * gfs_aspace_writepage - write an aspace page
- * @page: the page
- * @wbc:
- *
- * Returns: errno
- */
-
-static int 
-gfs_aspace_writepage(struct page *page, struct writeback_control *wbc)
-{
-	return block_write_full_page(page, aspace_get_block, wbc);
-}
-
-/**
- * stuck_releasepage - We're stuck in gfs_releasepage().  Print stuff out.
- * @bh: the buffer we're stuck on
- *
- */
-
-static void
-stuck_releasepage(struct buffer_head *bh)
-{
-	struct gfs_sbd *sdp = get_v2sdp(bh->b_page->mapping->host->i_sb);
-	struct gfs_bufdata *bd = get_v2bd(bh);
-
-	printk("GFS: fsid=%s: stuck in gfs_releasepage()...\n", sdp->sd_fsname);
-	printk("GFS: fsid=%s: blkno = %llu, bh->b_count = %d\n",
-	       sdp->sd_fsname,
-	       (unsigned long long)bh->b_blocknr,
-	       atomic_read(&bh->b_count));
-	printk("GFS: fsid=%s: get_v2bd(bh) = %s\n",
-	       sdp->sd_fsname,
-	       (bd) ? "!NULL" : "NULL");
-
-	if (bd) {
-		struct gfs_glock *gl = bd->bd_gl;
-
-		printk("GFS: fsid=%s: gl = (%u, %llu)\n",
-		       sdp->sd_fsname,
-		       gl->gl_name.ln_type,
-		       (unsigned long long)gl->gl_name.ln_number);
-
-		printk("GFS: fsid=%s: bd_new_le.le_trans = %s\n",
-		       sdp->sd_fsname,
-		       (bd->bd_new_le.le_trans) ? "!NULL" : "NULL");
-		printk("GFS: fsid=%s: bd_incore_le.le_trans = %s\n",
-		       sdp->sd_fsname,
-		       (bd->bd_incore_le.le_trans) ? "!NULL" : "NULL");
-		printk("GFS: fsid=%s: bd_frozen = %s\n",
-		       sdp->sd_fsname,
-		       (bd->bd_frozen) ? "!NULL" : "NULL");
-		printk("GFS: fsid=%s: bd_pinned = %u\n",
-		       sdp->sd_fsname, bd->bd_pinned);
-		printk("GFS: fsid=%s: bd_ail_tr_list = %s\n",
-		       sdp->sd_fsname,
-		       (list_empty(&bd->bd_ail_tr_list)) ? "Empty" : "!Empty");
-
-		if (gl->gl_ops == &gfs_inode_glops) {
-			struct gfs_inode *ip = get_gl2ip(gl);
-
-			if (ip) {
-				unsigned int x;
-
-				printk("GFS: fsid=%s: ip = %llu/%llu\n",
-				       sdp->sd_fsname,
-				       (unsigned long long)ip->i_num.no_formal_ino,
-				       (unsigned long long)ip->i_num.no_addr);
-				printk("GFS: fsid=%s: ip->i_count = %d, ip->i_vnode = %s\n",
-				     sdp->sd_fsname,
-				     atomic_read(&ip->i_count),
-				     (ip->i_vnode) ? "!NULL" : "NULL");
-				for (x = 0; x < GFS_MAX_META_HEIGHT; x++)
-					printk("GFS: fsid=%s: ip->i_cache[%u] = %s\n",
-					       sdp->sd_fsname, x,
-					       (ip->i_cache[x]) ? "!NULL" : "NULL");
-			}
-		}
-	}
-}
-
-/**
- * gfs_aspace_releasepage - free the metadata associated with a page 
- * @page: the page that's being released
- * @gfp_mask: passed from Linux VFS, ignored by us
- *
- * Call try_to_free_buffers() if the buffers in this page can be
- * released.
- *
- * Returns: 0
- */
-
-static int
-gfs_aspace_releasepage(struct page *page, gfp_t gfp_mask)
-{
-	struct inode *aspace = page->mapping->host;
-	struct gfs_sbd *sdp = get_v2sdp(aspace->i_sb);
-	struct buffer_head *bh, *head;
-	struct gfs_bufdata *bd;
-	unsigned long t;
-
-	if (!page_has_buffers(page))
-		goto out;
-
-	head = bh = page_buffers(page);
-	do {
-		t = jiffies;
-
-		while (atomic_read(&bh->b_count)) {
-			if (atomic_read(&aspace->i_writecount)) {
-				if (time_after_eq(jiffies,
-						  t +
-						  gfs_tune_get(sdp, gt_stall_secs) * HZ)) {
-					stuck_releasepage(bh);
-					t = jiffies;
-				}
-
-				yield();
-				continue;
-			}
-
-			return 0;
-		}
-
-		bd = get_v2bd(bh);
-		if (bd) {
-			gfs_assert_warn(sdp, bd->bd_bh == bh);
-			gfs_assert_warn(sdp, !bd->bd_new_le.le_trans);
-		        gfs_assert_warn(sdp, !bd->bd_incore_le.le_trans);
-			gfs_assert_warn(sdp, !bd->bd_frozen);
-			gfs_assert_warn(sdp, !bd->bd_pinned);
-			gfs_assert_warn(sdp, list_empty(&bd->bd_ail_tr_list));
-			kmem_cache_free(gfs_bufdata_cachep, bd);
-			atomic_dec(&sdp->sd_bufdata_count);
-			set_v2bd(bh, NULL);
-		}
-
-		bh = bh->b_this_page;
-	}
-	while (bh != head);
-
- out:
-	return try_to_free_buffers(page);
-}
-
-static struct address_space_operations aspace_aops = {
-	.writepage = gfs_aspace_writepage,
-	.releasepage = gfs_aspace_releasepage,
-};
-
-/**
- * gfs_aspace_get - Create and initialize a struct inode structure
- * @sdp: the filesystem the aspace is in
- *
- * Right now a struct inode is just a struct inode.  Maybe Linux
- * will supply a more lightweight address space construct (that works)
- * in the future.
- *
- * Make sure pages/buffers in this aspace aren't in high memory.
- *
- * Returns: the aspace
- */
-
-struct inode *
-gfs_aspace_get(struct gfs_sbd *sdp)
-{
-	struct inode *aspace;
-
-	aspace = new_inode(sdp->sd_vfs);
-	if (aspace) {
-		mapping_set_gfp_mask(aspace->i_mapping, GFP_KERNEL);
-		aspace->i_mapping->a_ops = &aspace_aops;
-		aspace->i_size = ~0ULL;
-		set_v2ip(aspace, NULL);
-		insert_inode_hash(aspace);
-	}
-
-	return aspace;
-}
-
-/**
- * gfs_aspace_put - get rid of an aspace
- * @aspace:
- *
- */
-
-void
-gfs_aspace_put(struct inode *aspace)
-{
-	remove_inode_hash(aspace);
-	iput(aspace);
-}
-
-/**
- * gfs_ail_start_trans - Start I/O on a part of the AIL
- * @sdp: the filesystem
- * @tr: the part of the AIL
- *
- */
-
-void
-gfs_ail_start_trans(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *head, *tmp, *prev;
-	struct gfs_bufdata *bd;
-	struct buffer_head *bh;
-	int retry;
-
-	do {
-		retry = FALSE;
-
-		spin_lock(&sdp->sd_ail_lock);
-
-		for (head = &tr->tr_ail_bufs, tmp = head->prev, prev = tmp->prev;
-		     tmp != head;
-		     tmp = prev, prev = tmp->prev) {
-			bd = list_entry(tmp, struct gfs_bufdata, bd_ail_tr_list);
-			bh = bd->bd_bh;
-
-			if (gfs_trylock_buffer(bh))
-				continue;
-
-			if (bd->bd_pinned) {
-				gfs_unlock_buffer(bh);
-				continue;
-			}
-
-			if (!buffer_busy(bh)) {
-				if (!buffer_uptodate(bh))
-					gfs_io_error_bh(sdp, bh);
-
-				list_del_init(&bd->bd_ail_tr_list);
-				list_del(&bd->bd_ail_gl_list);
-
-				gfs_unlock_buffer(bh);
-				brelse(bh);
-				continue;
-			}
-
-			if (buffer_dirty(bh)) {
-				list_move(&bd->bd_ail_tr_list, head);
-
-				spin_unlock(&sdp->sd_ail_lock);
-				wait_on_buffer(bh);
-				ll_rw_block(WRITE, 1, &bh);
-				spin_lock(&sdp->sd_ail_lock);
-
-				gfs_unlock_buffer(bh);
-				retry = TRUE;
-				break;
-			}
-
-			gfs_unlock_buffer(bh);
-		}
-
-		spin_unlock(&sdp->sd_ail_lock);
-	} while (retry);
-}
-
-/**
- * gfs_ail_empty_trans - Check whether or not a trans in the AIL has been synced
- * @sdp: the filesystem
- * @tr: the transaction
- *
- */
-
-int
-gfs_ail_empty_trans(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *head, *tmp, *prev;
-	struct gfs_bufdata *bd;
-	struct buffer_head *bh;
-	int ret;
-
-	spin_lock(&sdp->sd_ail_lock);
-
-	for (head = &tr->tr_ail_bufs, tmp = head->prev, prev = tmp->prev;
-	     tmp != head;
-	     tmp = prev, prev = tmp->prev) {
-		bd = list_entry(tmp, struct gfs_bufdata, bd_ail_tr_list);
-		bh = bd->bd_bh;
-
-		if (gfs_trylock_buffer(bh))
-			continue;
-
-		if (bd->bd_pinned || buffer_busy(bh)) {
-			gfs_unlock_buffer(bh);
-			continue;
-		}
-
-		if (!buffer_uptodate(bh))
-			gfs_io_error_bh(sdp, bh);
-
-		list_del_init(&bd->bd_ail_tr_list);
-		list_del(&bd->bd_ail_gl_list);
-
-		gfs_unlock_buffer(bh);
-		brelse(bh);
-	}
-
-	ret = list_empty(head);
-
-	spin_unlock(&sdp->sd_ail_lock);
-
-	return ret;
-}
-
-/**
- * ail_empty_gl - remove all buffers for a given lock from the AIL
- * @gl: the glock
- *
- * None of the buffers should be dirty, locked, or pinned.
- */
-
-static void
-ail_empty_gl(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_bufdata *bd;
-	struct buffer_head *bh;
-
-	spin_lock(&sdp->sd_ail_lock);
-
-	while (!list_empty(&gl->gl_ail_bufs)) {
-		bd = list_entry(gl->gl_ail_bufs.next,
-				struct gfs_bufdata, bd_ail_gl_list);
-		bh = bd->bd_bh;
-
-		gfs_assert_withdraw(sdp, !bd->bd_pinned && !buffer_busy(bh));
-		if (!buffer_uptodate(bh))
-			gfs_io_error_bh(sdp, bh);
-
-		list_del_init(&bd->bd_ail_tr_list);
-		list_del(&bd->bd_ail_gl_list);
-
-		brelse(bh);
-	}
-
-	spin_unlock(&sdp->sd_ail_lock);
-}
-
-/**
- * gfs_inval_buf - Invalidate all buffers associated with a glock
- * @gl: the glock
- *
- */
-
-void
-gfs_inval_buf(struct gfs_glock *gl)
-{
-	struct inode *aspace = gl->gl_aspace;
-	struct address_space *mapping = gl->gl_aspace->i_mapping;
-
-	ail_empty_gl(gl);
-
-	atomic_inc(&aspace->i_writecount);
-	truncate_inode_pages(mapping, 0);
-	atomic_dec(&aspace->i_writecount);
-
-	gfs_assert_withdraw(gl->gl_sbd, !mapping->nrpages);
-}
-
-/**
- * gfs_sync_buf - Sync all buffers associated with a glock
- * @gl: The glock
- * @flags: DIO_START | DIO_WAIT | DIO_CHECK
- *
- */
-
-void
-gfs_sync_buf(struct gfs_glock *gl, int flags)
-{
-	struct address_space *mapping = gl->gl_aspace->i_mapping;
-	int error = 0;
-
-	if (flags & DIO_START)
-		error = filemap_fdatawrite(mapping);
-	if (!error && (flags & DIO_WAIT))
-		error = filemap_fdatawait(mapping);
-	if (!error && (flags & (DIO_INVISIBLE | DIO_CHECK)) == DIO_CHECK)
-		ail_empty_gl(gl);
-
-	if (error)
-		gfs_io_error(gl->gl_sbd);
-}
-
-/**
- * getbuf - Get a buffer with a given address space
- * @sdp: the filesystem
- * @aspace: the address space
- * @blkno: the block number (filesystem scope)
- * @create: TRUE if the buffer should be created
- *
- * Returns: the buffer
- */
-
-static struct buffer_head *
-getbuf(struct gfs_sbd *sdp, struct inode *aspace, uint64_t blkno, int create)
-{
-	struct page *page;
-	struct buffer_head *bh;
-	unsigned int shift;
-	unsigned long index;
-	unsigned int bufnum;
-
-	shift = PAGE_CACHE_SHIFT - sdp->sd_sb.sb_bsize_shift;
-	index = blkno >> shift;             /* convert block to page */
-	bufnum = blkno - (index << shift);  /* block buf index within page */
-
-	if (create) {
-		RETRY_MALLOC(page = grab_cache_page(aspace->i_mapping, index), page);
-	} else {
-		page = find_lock_page(aspace->i_mapping, index);
-		if (!page)
-			return NULL;
-	}
-
-	if (!page_has_buffers(page))
-		create_empty_buffers(page, sdp->sd_sb.sb_bsize, 0);
-
-	/* Locate header for our buffer within our page */
-	for (bh = page_buffers(page); bufnum--; bh = bh->b_this_page)
-		/* Do nothing */;
-	get_bh(bh);
-
-	if (!buffer_mapped(bh))
-		map_bh(bh, sdp->sd_vfs, blkno);
-	else if (gfs_assert_warn(sdp, bh->b_bdev == sdp->sd_vfs->s_bdev &&
-				 bh->b_blocknr == blkno))
-		map_bh(bh, sdp->sd_vfs, blkno);
-
-	unlock_page(page);
-	page_cache_release(page);
-
-	return bh;
-}
-
-/**
- * gfs_dgetblk - Get a block
- * @gl: The glock associated with this block
- * @blkno: The block number
- *
- * Returns: The buffer
- */
-
-struct buffer_head *
-gfs_dgetblk(struct gfs_glock *gl, uint64_t blkno)
-{
-	return getbuf(gl->gl_sbd, gl->gl_aspace, blkno, CREATE);
-}
-
-/**
- * gfs_dread - Read a block from disk
- * @gl: The glock covering the block
- * @blkno: The block number
- * @flags: flags to gfs_dreread()
- * @bhp: the place where the buffer is returned (NULL on failure)
- *
- * Returns: errno
- */
-
-int
-gfs_dread(struct gfs_glock *gl, uint64_t blkno,
-	  int flags, struct buffer_head **bhp)
-{
-	int error;
-
-	*bhp = gfs_dgetblk(gl, blkno);
-	error = gfs_dreread(gl->gl_sbd, *bhp, flags);
-	if (error)
-		brelse(*bhp);
-
-	return error;
-}
-
-/**
- * gfs_prep_new_buffer - Mark a new buffer we just gfs_dgetblk()ed uptodate
- * @bh: the buffer
- *
- */
-
-void
-gfs_prep_new_buffer(struct buffer_head *bh)
-{
-	wait_on_buffer(bh);
-	clear_buffer_dirty(bh);
-	set_buffer_uptodate(bh);
-}
-
-/**
- * gfs_dreread - Reread a block from disk
- * @sdp: the filesystem
- * @bh: The block to read
- * @flags: Flags that control the read
- *
- * Returns: errno
- */
-
-int
-gfs_dreread(struct gfs_sbd *sdp, struct buffer_head *bh, int flags)
-{
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		return -EIO;
-
-	/* Fill in meta-header if we have a cached copy, else read from disk */
-	if (flags & DIO_NEW) {
-		if (gfs_mhc_fish(sdp, bh))
-			return 0;
-		clear_buffer_uptodate(bh);
-	}
-
-	if (flags & DIO_FORCE)
-		clear_buffer_uptodate(bh);
-
-	if ((flags & DIO_START) && !buffer_uptodate(bh))
-		ll_rw_block(READ, 1, &bh);
-
-	if (flags & DIO_WAIT) {
-		wait_on_buffer(bh);
-
-		if (!buffer_uptodate(bh)) {
-			gfs_io_error_bh(sdp, bh);
-			return -EIO;
-		}
-		if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-			return -EIO;
-	}
-
-	return 0;
-}
-
-/**
- * gfs_dwrite - Write a buffer to disk (and/or wait for write to complete)
- * @sdp: the filesystem
- * @bh: The buffer to write
- * @flags:  DIO_XXX The type of write/wait operation to do
- *
- * Returns: errno
- */
-
-int
-gfs_dwrite(struct gfs_sbd *sdp, struct buffer_head *bh, int flags)
-{
-	if (gfs_assert_warn(sdp, !test_bit(SDF_ROFS, &sdp->sd_flags)))
-		return -EIO;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		return -EIO;
-
-	if (flags & DIO_CLEAN) {
-		lock_buffer(bh);
-		clear_buffer_dirty(bh);
-		unlock_buffer(bh);
-	}
-
-	if (flags & DIO_DIRTY) {
-		if (gfs_assert_warn(sdp, buffer_uptodate(bh)))
-			return -EIO;
-		mark_buffer_dirty(bh);
-	}
-
-	if ((flags & DIO_START) && buffer_dirty(bh)) {
-		wait_on_buffer(bh);
-		ll_rw_block(WRITE, 1, &bh);
-	}
-
-	if (flags & DIO_WAIT) {
-		wait_on_buffer(bh);
-
-		if (!buffer_uptodate(bh) || buffer_dirty(bh)) {
-			gfs_io_error_bh(sdp, bh);
-			return -EIO;
-		}
-		if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-			return -EIO;
-	}
-
-	return 0;
-}
-
-/**
- * gfs_attach_bufdata - attach a struct gfs_bufdata structure to a buffer
- * @bh: The buffer to be attached to
- * @gl: the glock the buffer belongs to
- *
- */
-
-void
-gfs_attach_bufdata(struct buffer_head *bh, struct gfs_glock *gl)
-{
-	struct gfs_bufdata *bd;
-
-	lock_page(bh->b_page);
-
-	/* If there's one attached already, we're done */
-	if (get_v2bd(bh)) {
-		unlock_page(bh->b_page);
-		return;
-	}
-
-	RETRY_MALLOC(bd = kmem_cache_alloc(gfs_bufdata_cachep, GFP_KERNEL), bd);
-	atomic_inc(&gl->gl_sbd->sd_bufdata_count);
-
-	memset(bd, 0, sizeof(struct gfs_bufdata));
-
-	bd->bd_bh = bh;
-	bd->bd_gl = gl;
-
-	INIT_LE(&bd->bd_new_le, &gfs_buf_lops);
-	INIT_LE(&bd->bd_incore_le, &gfs_buf_lops);
-
-	init_MUTEX(&bd->bd_lock);
-
-	INIT_LIST_HEAD(&bd->bd_ail_tr_list);
-
-	set_v2bd(bh, bd);
-
-	unlock_page(bh->b_page);
-}
-
-/**
- * gfs_is_pinned - Figure out if a buffer is pinned or not
- * @sdp: the filesystem the buffer belongs to
- * @bh: The buffer to be pinned
- *
- * Returns: TRUE if the buffer is pinned, FALSE otherwise
- */
-
-int
-gfs_is_pinned(struct gfs_sbd *sdp, struct buffer_head *bh)
-{
-	struct gfs_bufdata *bd = get_v2bd(bh);
-	int ret = FALSE;
-
-	if (bd) {
-		gfs_lock_buffer(bh);
-		if (bd->bd_pinned)
-			ret = TRUE;
-		gfs_unlock_buffer(bh);
-	}
-
-	return ret;
-}
-
-/**
- * gfs_dpin - Pin a metadata buffer in memory
- * @sdp: the filesystem the buffer belongs to
- * @bh: The buffer to be pinned
- *
- * "Pinning" means keeping buffer from being written to its in-place location.
- * A buffer should be pinned from the time it is added to a new transaction,
- *   until after it has been written to the log.
- * If an earlier change to this buffer is still pinned, waiting to be written
- *   to on-disk log, we need to keep a "frozen" copy of the old data while this
- *   transaction is modifying the real data.  We keep the frozen copy until
- *   this transaction's incore_commit(), i.e. until the transaction has
- *   finished modifying the real data, at which point we can use the real
- *   buffer for logging, even if the frozen copy didn't get written to the log.
- *
- */
-
-void
-gfs_dpin(struct gfs_sbd *sdp, struct buffer_head *bh)
-{
-	struct gfs_bufdata *bd = get_v2bd(bh);
-	char *data;
-
-	gfs_assert_withdraw(sdp, !test_bit(SDF_ROFS, &sdp->sd_flags));
-
-	gfs_lock_buffer(bh);
-
-	gfs_assert_warn(sdp, !bd->bd_frozen);
-
-	if (!bd->bd_pinned++) {
-		wait_on_buffer(bh);
-
-		/* If this buffer is in the AIL and it has already been written
-		   to in-place disk block, remove it from the AIL. */
-
-		spin_lock(&sdp->sd_ail_lock);
-		if (!list_empty(&bd->bd_ail_tr_list) && !buffer_busy(bh)) {
-			list_del_init(&bd->bd_ail_tr_list);
-			list_del(&bd->bd_ail_gl_list);
-			brelse(bh);
-		}
-		spin_unlock(&sdp->sd_ail_lock);
-
-		clear_buffer_dirty(bh);
-		wait_on_buffer(bh);
-
-		if (!buffer_uptodate(bh))
-			gfs_io_error_bh(sdp, bh);
-	} else {
-		gfs_unlock_buffer(bh);
-
-		gfs_assert_withdraw(sdp, buffer_uptodate(bh));
-
-		data = gmalloc(sdp->sd_sb.sb_bsize);
-
-		gfs_lock_buffer(bh);
-
-		/* Create frozen copy, if needed. */
-		if (bd->bd_pinned > 1) {
-			memcpy(data, bh->b_data, sdp->sd_sb.sb_bsize);
-			bd->bd_frozen = data;
-		} else
-			kfree(data);
-	}
-
-	gfs_unlock_buffer(bh);
-
-	get_bh(bh);
-}
-
-/**
- * gfs_dunpin - Unpin a buffer
- * @sdp: the filesystem the buffer belongs to
- * @bh: The buffer to unpin
- * @tr: The transaction in the AIL that contains this buffer
- *      If NULL, don't attach buffer to any AIL list
- *      (i.e. when dropping a pin reference when merging a new transaction
- *       with an already existing incore transaction)
- *
- * Called for (meta) buffers, after they've been logged to on-disk journal.
- * Make a (meta) buffer writeable to in-place location on-disk, if recursive
- *   pin count is 1 (i.e. no other, later transaction is modifying this buffer).
- * Add buffer to AIL lists of 1) the latest transaction that's modified and
- *   logged (on-disk) the buffer, and of 2) the glock that protects the buffer.
- * A single buffer might have been modified by more than one transaction
- *   since the buffer's previous write to disk (in-place location).  We keep
- *   the buffer on only one transaction's AIL list, i.e. that of the latest
- *   transaction that's completed logging this buffer (no need to write it to
- *   in-place block multiple times for multiple transactions, only once with
- *   the most up-to-date data).
- * A single buffer will be protected by one and only one glock.  If buffer is 
- *   already on a (previous) transaction's AIL, we know that we're already
- *   on buffer's glock's AIL.
- * 
- */
-
-void
-gfs_dunpin(struct gfs_sbd *sdp, struct buffer_head *bh, struct gfs_trans *tr)
-{
-	struct gfs_bufdata *bd = get_v2bd(bh);
-
-	gfs_assert_withdraw(sdp, buffer_uptodate(bh));
-
-	gfs_lock_buffer(bh);
-
-	if (gfs_assert_warn(sdp, bd->bd_pinned)) {
-		gfs_unlock_buffer(bh);
-		return;
-	}
-
-	/* No other (later) transaction is modifying buffer; ready to write */
-	if (bd->bd_pinned == 1)
-		mark_buffer_dirty(bh);
-
-	bd->bd_pinned--;
-
-	gfs_unlock_buffer(bh);
-
-	if (tr) {
-		spin_lock(&sdp->sd_ail_lock);
-
-		if (list_empty(&bd->bd_ail_tr_list)) {
-			/* Buffer not attached to any earlier transaction.  Add
-			   it to glock's AIL, and this trans' AIL (below). */
-			list_add(&bd->bd_ail_gl_list, &bd->bd_gl->gl_ail_bufs);
-		} else {
-			/* Was part of earlier transaction.
-			   Move from that trans' AIL to this newer one's AIL.
-			   Buf is already on glock's AIL. */
-			list_del_init(&bd->bd_ail_tr_list);
-			brelse(bh);
-		}
-		list_add(&bd->bd_ail_tr_list, &tr->tr_ail_bufs);
-
-		spin_unlock(&sdp->sd_ail_lock);
-	} else
-		brelse(bh);
-}
-
-/**
- * logbh_end_io - Called by OS at the end of a logbh ("fake" bh) write to log
- * @bh: the buffer
- * @uptodate: whether or not the write succeeded
- *
- * Interrupt context, no ENTER/RETURN
- *
- */
-
-static void
-logbh_end_io(struct buffer_head *bh, int uptodate)
-{
-	if (uptodate)
-		set_buffer_uptodate(bh);
-	else
-		clear_buffer_uptodate(bh);
-	unlock_buffer(bh);
-}
-
-/**
- * gfs_logbh_init - Initialize a fake buffer head
- * @sdp: the filesystem
- * @bh: the buffer to initialize
- * @blkno: the block address of the buffer
- * @data: the data to be written
- *
- */
-
-void
-gfs_logbh_init(struct gfs_sbd *sdp, struct buffer_head *bh,
-	       uint64_t blkno, char *data)
-{
-	memset(bh, 0, sizeof(struct buffer_head));
-	bh->b_state = (1 << BH_Mapped) | (1 << BH_Uptodate) | (1 << BH_Lock);
-	atomic_set(&bh->b_count, 1);
-	set_bh_page(bh, virt_to_page(data), ((unsigned long)data) & (PAGE_SIZE - 1));
-	bh->b_blocknr = blkno;
-	bh->b_size = sdp->sd_sb.sb_bsize;
-	bh->b_bdev = sdp->sd_vfs->s_bdev;
-	init_buffer(bh, logbh_end_io, NULL);
-	INIT_LIST_HEAD(&bh->b_assoc_buffers);
-}
-
-/**
- * gfs_logbh_uninit - Clean up a fake buffer head
- * @sdp: the filesystem
- * @bh: the buffer to clean
- *
- */
-
-void
-gfs_logbh_uninit(struct gfs_sbd *sdp, struct buffer_head *bh)
-{
-	gfs_assert_warn(sdp, test_bit(SDF_SHUTDOWN, &sdp->sd_flags) ||
-			!buffer_busy(bh));
-	gfs_assert_warn(sdp, atomic_read(&bh->b_count) == 1);
-}
-
-/**
- * gfs_logbh_start - Start writing a fake buffer head
- * @sdp: the filesystem
- * @bh: the buffer to write
- *
- * This starts a block write to our journal.
- */
-
-void
-gfs_logbh_start(struct gfs_sbd *sdp, struct buffer_head *bh)
-{
-	submit_bh(WRITE, bh);
-}
-
-/**
- * gfs_logbh_wait - Wait for the write of a fake buffer head to complete
- * @sdp: the filesystem
- * @bh: the buffer to write
- *
- * This waits for a block write to our journal to complete.
- *
- * Returns: errno
- */
-
-int
-gfs_logbh_wait(struct gfs_sbd *sdp, struct buffer_head *bh)
-{
-	wait_on_buffer(bh);
-
-	if (!buffer_uptodate(bh) || buffer_dirty(bh)) {
-		gfs_io_error_bh(sdp, bh);
-		return -EIO;
-	}
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		return -EIO;
-
-	return 0;
-}
-
-/**
- * gfs_replay_buf - write a log buffer to its inplace location
- * @gl: the journal's glock 
- * @bh: the buffer
- *
- * Returns: errno
- */
-
-int
-gfs_replay_buf(struct gfs_glock *gl, struct buffer_head *bh)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_bufdata *bd;
-
-	bd = get_v2bd(bh);
-	if (!bd) {
-		gfs_attach_bufdata(bh, gl);
-		bd = get_v2bd(bh);
-	}
-
-	mark_buffer_dirty(bh);
-
-	if (list_empty(&bd->bd_ail_tr_list)) {
-		get_bh(bh);
-		list_add(&bd->bd_ail_tr_list, &sdp->sd_recovery_bufs);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_replay_check - Check up on journal replay
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_replay_check(struct gfs_sbd *sdp)
-{
-	struct buffer_head *bh;
-	struct gfs_bufdata *bd;
-
-	while (!list_empty(&sdp->sd_recovery_bufs)) {
-		bd = list_entry(sdp->sd_recovery_bufs.prev,
-				struct gfs_bufdata, bd_ail_tr_list);
-		bh = bd->bd_bh;
-
-		if (buffer_busy(bh)) {
-			list_move(&bd->bd_ail_tr_list,
-				  &sdp->sd_recovery_bufs);
-			break;
-		} else {
-			list_del_init(&bd->bd_ail_tr_list);
-			if (!buffer_uptodate(bh))
-				gfs_io_error_bh(sdp, bh);
-			brelse(bh);
-		}
-	}
-}
-
-/**
- * gfs_replay_wait - Wait for all replayed buffers to hit the disk
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_replay_wait(struct gfs_sbd *sdp)
-{
-	struct list_head *head, *tmp, *prev;
-	struct buffer_head *bh;
-	struct gfs_bufdata *bd;
-
-	for (head = &sdp->sd_recovery_bufs, tmp = head->prev, prev = tmp->prev;
-	     tmp != head;
-	     tmp = prev, prev = tmp->prev) {
-		bd = list_entry(tmp, struct gfs_bufdata, bd_ail_tr_list);
-		bh = bd->bd_bh;
-
-		if (!buffer_busy(bh)) {
-			list_del_init(&bd->bd_ail_tr_list);
-			if (!buffer_uptodate(bh))
-				gfs_io_error_bh(sdp, bh);
-			brelse(bh);
-			continue;
-		}
-
-		if (buffer_dirty(bh)) {
-			wait_on_buffer(bh);
-			ll_rw_block(WRITE, 1, &bh);
-		}
-	}
-
-	while (!list_empty(head)) {
-		bd = list_entry(head->prev, struct gfs_bufdata, bd_ail_tr_list);
-		bh = bd->bd_bh;
-
-		wait_on_buffer(bh);
-
-		gfs_assert_withdraw(sdp, !buffer_busy(bh));
-
-		list_del_init(&bd->bd_ail_tr_list);
-		if (!buffer_uptodate(bh))
-			gfs_io_error_bh(sdp, bh);
-		brelse(bh);
-	}
-}
-
-/**
- * gfs_wipe_buffers - make inode's buffers so they aren't dirty/AILed anymore
- * @ip: the inode who owns the buffers
- * @rgd: the resource group
- * @bstart: the first buffer in the run
- * @blen: the number of buffers in the run
- *
- * Called when de-allocating a contiguous run of meta blocks within an rgrp.
- * Make sure all buffers for de-alloc'd blocks are removed from the AIL, if
- * they can be.  Dirty or pinned blocks are left alone.  Add relevant
- * meta-headers to meta-header cache, so we don't need to read disk
- * if we re-allocate blocks.
- */
-
-void
-gfs_wipe_buffers(struct gfs_inode *ip, struct gfs_rgrpd *rgd,
-		 uint64_t bstart, uint32_t blen)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct inode *aspace = ip->i_gl->gl_aspace;
-	struct buffer_head *bh;
-	struct gfs_bufdata *bd;
-	int busy;
-	int add = FALSE;
-
-	while (blen) {
-		bh = getbuf(sdp, aspace, bstart, NO_CREATE);
-		if (bh) {
-
-			bd = get_v2bd(bh);
-
-			if (buffer_uptodate(bh)) {
-				if (bd) {
-					gfs_lock_buffer(bh);
-					gfs_mhc_add(rgd, &bh, 1);
-					busy = bd->bd_pinned || buffer_busy(bh);
-					gfs_unlock_buffer(bh);
-
-					if (busy)
-						add = TRUE;
-					else {
-						spin_lock(&sdp->sd_ail_lock);
-						if (!list_empty(&bd->bd_ail_tr_list)) {
-							list_del_init(&bd->bd_ail_tr_list);
-							list_del(&bd->bd_ail_gl_list);
-							brelse(bh);
-						}
-						spin_unlock(&sdp->sd_ail_lock);
-					}
-				} else {
-					gfs_assert_withdraw(sdp, !buffer_dirty(bh));
-					wait_on_buffer(bh);
-					gfs_assert_withdraw(sdp, !buffer_busy(bh));
-					gfs_mhc_add(rgd, &bh, 1);
-				}
-			} else {
-				gfs_assert_withdraw(sdp, !bd || !bd->bd_pinned);
-				gfs_assert_withdraw(sdp, !buffer_dirty(bh));
-				wait_on_buffer(bh);
-				gfs_assert_withdraw(sdp, !buffer_busy(bh));
-			}
-
-			brelse(bh);
-		}
-
-		bstart++;
-		blen--;
-	}
-
-	if (add)
-		gfs_depend_add(rgd, ip->i_num.no_formal_ino);
-}
-
-/**
- * gfs_sync_meta - sync all the buffers in a filesystem
- * @sdp: the filesystem
- *
- * Flush metadata blocks to on-disk journal, then
- * Flush metadata blocks (now in AIL) to on-disk in-place locations
- * Periodically keep checking until done (AIL empty)
- */
-
-void
-gfs_sync_meta(struct gfs_sbd *sdp)
-{
-	gfs_log_flush(sdp);
-	for (;;) {
-		gfs_ail_start(sdp, DIO_ALL);
-		if (gfs_ail_empty(sdp))
-			break;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ / 10);
-	}
-}
-
-/**
- * gfs_flush_meta_cache - get rid of any references on buffers for this inode
- * @ip: The GFS inode
- *
- * This releases buffers that are in the most-recently-used array of
- *   blocks used for indirect block addressing for this inode.
- * Don't confuse this with the meta-HEADER cache (mhc)!
- */
-
-void
-gfs_flush_meta_cache(struct gfs_inode *ip)
-{
-	struct buffer_head **bh_slot;
-	unsigned int x;
-
-	spin_lock(&ip->i_spin);
-
-	for (x = 0; x < GFS_MAX_META_HEIGHT; x++) {
-		bh_slot = &ip->i_cache[x];
-		if (*bh_slot) {
-			brelse(*bh_slot);
-			*bh_slot = NULL;
-		}
-	}
-
-	spin_unlock(&ip->i_spin);
-}
-
-/**
- * gfs_get_meta_buffer - Get a metadata buffer
- * @ip: The GFS inode
- * @height: The level of this buf in the metadata (indir addr) tree (if any)
- * @num: The block number (device relative) of the buffer
- * @new: Non-zero if we may create a new buffer
- * @bhp: the buffer is returned here
- *
- * Returns: errno
- */
-
-int
-gfs_get_meta_buffer(struct gfs_inode *ip, int height, uint64_t num, int new,
-		    struct buffer_head **bhp)
-{
-	struct buffer_head *bh, **bh_slot = &ip->i_cache[height];
-	int flags = ((new) ? DIO_NEW : 0) | DIO_START | DIO_WAIT;
-	int error;
-
-	/* Try to use the gfs_inode's MRU metadata tree cache */
-	spin_lock(&ip->i_spin);
-	bh = *bh_slot;
-	if (bh) {
-		if (bh->b_blocknr == num)
-			get_bh(bh);
-		else
-			bh = NULL;
-	}
-	spin_unlock(&ip->i_spin);
-
-	if (bh) {
-		error = gfs_dreread(ip->i_sbd, bh, flags);
-		if (error) {
-			brelse(bh);
-			return error;
-		}
-	} else {
-		error = gfs_dread(ip->i_gl, num, flags, &bh);
-		if (error)
-			return error;
-
-		spin_lock(&ip->i_spin);
-		if (*bh_slot != bh) {
-			if (*bh_slot)
-				brelse(*bh_slot);
-			*bh_slot = bh;
-			get_bh(bh);
-		}
-		spin_unlock(&ip->i_spin);
-	}
-
-	if (new) {
-		if (gfs_assert_warn(ip->i_sbd, height)) {
-			brelse(bh);
-			return -EIO;
-		}
-		gfs_trans_add_bh(ip->i_gl, bh);
-		gfs_metatype_set(bh, GFS_METATYPE_IN, GFS_FORMAT_IN);
-		gfs_buffer_clear_tail(bh, sizeof(struct gfs_meta_header));
-	} else if (gfs_metatype_check(ip->i_sbd, bh,
-				      (height) ? GFS_METATYPE_IN : GFS_METATYPE_DI)) {
-		brelse(bh);
-		return -EIO;
-	}
-
-	*bhp = bh;
-
-	return 0;
-}
-
-/**
- * gfs_get_data_buffer - Get a data buffer
- * @ip: The GFS inode
- * @num: The block number (device relative) of the data block
- * @new: Non-zero if this is a new allocation
- * @bhp: the buffer is returned here
- *
- * Returns: errno
- */
-
-int
-gfs_get_data_buffer(struct gfs_inode *ip, uint64_t block, int new,
-		    struct buffer_head **bhp)
-{
-	struct buffer_head *bh;
-	int error = 0;
-
-	if (block == ip->i_num.no_addr) {
-		if (gfs_assert_warn(ip->i_sbd, !new))
-			return -EIO;
-		error = gfs_dread(ip->i_gl, block, DIO_START | DIO_WAIT, &bh);
-		if (error)
-			return error;
-		if (gfs_metatype_check(ip->i_sbd, bh, GFS_METATYPE_DI)) {
-			brelse(bh);
-			return -EIO;
-		}
-	} else if (gfs_is_jdata(ip)) {
-		if (new) {
-			error = gfs_dread(ip->i_gl, block,
-					  DIO_NEW | DIO_START | DIO_WAIT, &bh);
-			if (error)
-				return error;
-			gfs_trans_add_bh(ip->i_gl, bh);
-			gfs_metatype_set(bh, GFS_METATYPE_JD, GFS_FORMAT_JD);
-			gfs_buffer_clear_tail(bh, sizeof(struct gfs_meta_header));
-		} else {
-			error = gfs_dread(ip->i_gl, block,
-					  DIO_START | DIO_WAIT, &bh);
-			if (error)
-				return error;
-			if (gfs_metatype_check(ip->i_sbd, bh, GFS_METATYPE_JD)) {
-				brelse(bh);
-				return -EIO;
-			}
-		}
-	} else {
-		if (new) {
-			bh = gfs_dgetblk(ip->i_gl, block);
-			gfs_prep_new_buffer(bh);
-		} else {
-			error = gfs_dread(ip->i_gl, block,
-					  DIO_START | DIO_WAIT, &bh);
-			if (error)
-				return error;
-		}
-	}
-
-	*bhp = bh;
-
-	return 0;
-}
-
-/**
- * gfs_start_ra - start readahead on an extent of a file
- * @gl: the glock the blocks belong to
- * @dblock: the starting disk block
- * @extlen: the number of blocks in the extent
- *
- */
-
-void
-gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct inode *aspace = gl->gl_aspace;
-	struct buffer_head *first_bh, *bh;
-	uint32_t max_ra = gfs_tune_get(sdp, gt_max_readahead) >> sdp->sd_sb.sb_bsize_shift;
-	int error;
-
-	if (!extlen)
-		return;
-	if (!max_ra)
-		return;
-	if (extlen > max_ra)
-		extlen = max_ra;
-
-	first_bh = getbuf(sdp, aspace, dblock, CREATE);
-
-	if (buffer_uptodate(first_bh))
-		goto out;
-	if (!buffer_locked(first_bh)) {
-		error = gfs_dreread(sdp, first_bh, DIO_START);
-		if (error)
-			goto out;
-	}
-
-	dblock++;
-	extlen--;
-
-	while (extlen) {
-		bh = getbuf(sdp, aspace, dblock, CREATE);
-
-		if (!buffer_uptodate(bh) && !buffer_locked(bh)) {
-			error = gfs_dreread(sdp, bh, DIO_START);
-			brelse(bh);
-			if (error)
-				goto out;
-		} else
-			brelse(bh);
-
-		dblock++;
-		extlen--;
-
-		if (buffer_uptodate(first_bh))
-			break;
-	}
-
- out:
-	brelse(first_bh);
-}
diff --git a/gfs-kernel/src/gfs/dio.h b/gfs-kernel/src/gfs/dio.h
deleted file mode 100644
index 279642e..0000000
--- a/gfs-kernel/src/gfs/dio.h
+++ /dev/null
@@ -1,157 +0,0 @@
-#ifndef __DIO_DOT_H__
-#define __DIO_DOT_H__
-
-void gfs_ail_start_trans(struct gfs_sbd *sdp, struct gfs_trans *tr);
-int gfs_ail_empty_trans(struct gfs_sbd *sdp, struct gfs_trans *tr);
-
-/*  Asynchronous I/O Routines  */
-
-struct buffer_head *gfs_dgetblk(struct gfs_glock *gl, uint64_t blkno);
-int gfs_dread(struct gfs_glock *gl, uint64_t blkno,
-	      int flags, struct buffer_head **bhp);
-
-void gfs_prep_new_buffer(struct buffer_head *bh);
-int gfs_dreread(struct gfs_sbd *sdp, struct buffer_head *bh, int flags);
-int gfs_dwrite(struct gfs_sbd *sdp, struct buffer_head *bh, int flags);
-
-void gfs_attach_bufdata(struct buffer_head *bh, struct gfs_glock *gl);
-int gfs_is_pinned(struct gfs_sbd *sdp, struct buffer_head *bh);
-void gfs_dpin(struct gfs_sbd *sdp, struct buffer_head *bh);
-void gfs_dunpin(struct gfs_sbd *sdp, struct buffer_head *bh,
-		struct gfs_trans *tr);
-
-static __inline__
-void gfs_lock_buffer(struct buffer_head *bh)
-{
-	struct gfs_bufdata *bd = get_v2bd(bh);
-	down(&bd->bd_lock);
-}
-static __inline__
-int gfs_trylock_buffer(struct buffer_head *bh)
-{
-	struct gfs_bufdata *bd = get_v2bd(bh);
-	return down_trylock(&bd->bd_lock);
-}
-static __inline__
-void gfs_unlock_buffer(struct buffer_head *bh)
-{
-	struct gfs_bufdata *bd = get_v2bd(bh);
-	up(&bd->bd_lock);
-}
-
-void gfs_logbh_init(struct gfs_sbd *sdp, struct buffer_head *bh, uint64_t blkno,
-		    char *data);
-void gfs_logbh_uninit(struct gfs_sbd *sdp, struct buffer_head *bh);
-void gfs_logbh_start(struct gfs_sbd *sdp, struct buffer_head *bh);
-int gfs_logbh_wait(struct gfs_sbd *sdp, struct buffer_head *bh);
-
-int gfs_replay_buf(struct gfs_glock *gl, struct buffer_head *bh);
-void gfs_replay_check(struct gfs_sbd *sdp);
-void gfs_replay_wait(struct gfs_sbd *sdp);
-
-void gfs_wipe_buffers(struct gfs_inode *ip, struct gfs_rgrpd *rgd,
-		      uint64_t bstart, uint32_t blen);
-
-void gfs_sync_meta(struct gfs_sbd *sdp);
-
-/*  Buffer Caching routines  */
-
-int gfs_get_meta_buffer(struct gfs_inode *ip, int height, uint64_t num, int new,
-			struct buffer_head **bhp);
-int gfs_get_data_buffer(struct gfs_inode *ip, uint64_t block, int new,
-			struct buffer_head **bhp);
-void gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen);
-
-static __inline__ int
-gfs_get_inode_buffer(struct gfs_inode *ip, struct buffer_head **bhp)
-{
-	return gfs_get_meta_buffer(ip, 0, ip->i_num.no_addr, FALSE, bhp);
-}
-
-struct inode *gfs_aspace_get(struct gfs_sbd *sdp);
-void gfs_aspace_put(struct inode *aspace);
-
-void gfs_inval_buf(struct gfs_glock *gl);
-void gfs_sync_buf(struct gfs_glock *gl, int flags);
-
-void gfs_flush_meta_cache(struct gfs_inode *ip);
-
-/*  Buffer Content Functions  */
-
-/**
- * gfs_buffer_clear - Zeros out a buffer
- * @ip: The GFS inode
- * @bh: The buffer to zero
- *
- */
-
-static __inline__ void
-gfs_buffer_clear(struct buffer_head *bh)
-{
-	memset(bh->b_data, 0, bh->b_size);
-}
-
-/**
- * gfs_buffer_clear_tail - Clear buffer beyond the dinode
- * @bh: The buffer containing the on-disk inode
- * @head: the size of the head of the buffer
- *
- * Clears the remaining part of an on-disk inode that is not a dinode.
- * i.e. The data part of a stuffed inode, or the top level of metadata
- * of a non-stuffed inode.
- */
-
-static __inline__ void
-gfs_buffer_clear_tail(struct buffer_head *bh, int head)
-{
-	memset(bh->b_data + head, 0, bh->b_size - head);
-}
-
-/**
- * gfs_buffer_clear_ends - Zero out any bits of a buffer which are not being written
- * @bh: The buffer
- * @offset: Offset in buffer where write starts
- * @amount: Amount of data being written
- * @journaled: TRUE if this is a journaled buffer
- *
- */
-
-static __inline__ void
-gfs_buffer_clear_ends(struct buffer_head *bh, int offset, int amount,
-		      int journaled)
-{
-	int z_off1 = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	int z_len1 = offset - z_off1;
-	int z_off2 = offset + amount;
-	int z_len2 = (bh)->b_size - z_off2;
-
-	if (z_len1)
-		memset(bh->b_data + z_off1, 0, z_len1);
-
-	if (z_len2)
-		memset(bh->b_data + z_off2, 0, z_len2);
-}
-
-/**
- * gfs_buffer_copy_tail - copies the tail of one buffer to another
- * @to_bh: the buffer to copy to
- * @to_head: the size of the head of to_bh
- * @from_bh: the buffer to copy from
- * @from_head: the size of the head of from_bh
- *
- * from_head is guaranteed to bigger than to_head 
- */
-
-static __inline__ void
-gfs_buffer_copy_tail(struct buffer_head *to_bh, int to_head,
-		     struct buffer_head *from_bh, int from_head)
-{
-	memcpy(to_bh->b_data + to_head,
-	       from_bh->b_data + from_head,
-	       from_bh->b_size - from_head);
-	memset(to_bh->b_data + to_bh->b_size + to_head - from_head,
-	       0,
-	       from_head - to_head);
-}
-
-#endif /* __DIO_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/dir.c b/gfs-kernel/src/gfs/dir.c
deleted file mode 100644
index 7dadf7f..0000000
--- a/gfs-kernel/src/gfs/dir.c
+++ /dev/null
@@ -1,2394 +0,0 @@
-/*
-* Implements Extendible Hashing as described in:
-*   "Extendible Hashing" by Fagin, et al in
-*     __ACM Trans. on Database Systems__, Sept 1979.
-*
-*
-* Here's the layout of dirents which is essentially the same as that of ext2 
-* within a single block. The field de_name_len is the number of bytes
-* actually required for the name (no null terminator). The field de_rec_len
-* is the number of bytes allocated to the dirent. The offset of the next
-* dirent in the block is (dirent + dirent->de_rec_len). When a dirent is
-* deleted, the preceding dirent inherits its allocated space, ie
-* prev->de_rec_len += deleted->de_rec_len. Since the next dirent is obtained
-* by adding de_rec_len to the current dirent, this essentially causes the
-* deleted dirent to get jumped over when iterating through all the dirents.
-*
-* When deleting the first dirent in a block, there is no previous dirent so
-* the field de_ino is set to zero to designate it as deleted. When allocating
-* a dirent, gfs_dirent_alloc iterates through the dirents in a block. If the
-* first dirent has (de_ino == 0) and de_rec_len is large enough, this first
-* dirent is allocated. Otherwise it must go through all the 'used' dirents
-* searching for one in which the amount of total space minus the amount of
-* used space will provide enough space for the new dirent.
-*
-* There are two types of blocks in which dirents reside. In a stuffed dinode,
-* the dirents begin at offset sizeof(struct gfs_dinode) from the beginning of
-* the block.  In leaves, they begin at offset sizeof (struct gfs_leaf) from the
-* beginning of the leaf block. The dirents reside in leaves when 
-* 
-* dip->i_di.di_flags & GFS_DIF_EXHASH is true
-* 
-* Otherwise, the dirents are "linear", within a single stuffed dinode block.
-*
-* When the dirents are in leaves, the actual contents of the directory file are
-* used as an array of 64-bit block pointers pointing to the leaf blocks. The
-* dirents are NOT in the directory file itself. There can be more than one block
-* pointer in the array that points to the same leaf. In fact, when a directory
-* is first converted from linear to exhash, all of the pointers point to the
-* same leaf. 
-*
-* When a leaf is completely full, the size of the hash table can be
-* doubled unless it is already at the maximum size which is hard coded into 
-* GFS_DIR_MAX_DEPTH. After that, leaves are chained together in a linked list,
-* but never before the maximum hash table size has been reached.
-*/
-
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/vmalloc.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "dir.h"
-#include "file.h"
-#include "glock.h"
-#include "inode.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-
-#if 1
-#define gfs_dir_hash2offset(h) (((uint64_t)(h)) >> 1)
-#define gfs_dir_offset2hash(p) ((uint32_t)(((uint64_t)(p)) << 1))
-#else
-#define gfs_dir_hash2offset(h) (((uint64_t)(h)))
-#define gfs_dir_offset2hash(p) ((uint32_t)(((uint64_t)(p))))
-#endif
-
-typedef int (*leaf_call_t) (struct gfs_inode *dip,
-			    uint32_t index, uint32_t len, uint64_t leaf_no,
-			    void *data);
-
-/**
- * int gfs_filecmp - Compare two filenames
- * @file1: The first filename
- * @file2: The second filename
- * @len_of_file2: The length of the second file
- *
- * This routine compares two filenames and returns TRUE if they are equal.
- *
- * Returns: TRUE (!=0) if the files are the same, otherwise FALSE (0).
- */
-
-int
-gfs_filecmp(struct qstr *file1, char *file2, int len_of_file2)
-{
-	if (file1->len != len_of_file2)
-		return FALSE;
-	if (memcmp(file1->name, file2, file1->len))
-		return FALSE;
-	return TRUE;
-}
-
-/**
- * dirent_first - Return the first dirent
- * @dip: the directory
- * @bh: The buffer
- * @dent: Pointer to list of dirents
- *
- * return first dirent whether bh points to leaf or stuffed dinode
- *
- * Returns: IS_LEAF, IS_DINODE, or -errno
- */
-
-static int
-dirent_first(struct gfs_inode *dip, struct buffer_head *bh,
-	     struct gfs_dirent **dent)
-{
-	struct gfs_meta_header *h = (struct gfs_meta_header *)bh->b_data;
-
-	if (gfs32_to_cpu(h->mh_type) == GFS_METATYPE_LF) {
-		if (gfs_meta_check(dip->i_sbd, bh))
-			return -EIO;
-		*dent = (struct gfs_dirent *)(bh->b_data + sizeof(struct gfs_leaf));
-		return IS_LEAF;
-	} else {
-		if (gfs_metatype_check(dip->i_sbd, bh, GFS_METATYPE_DI))
-			return -EIO;
-		*dent = (struct gfs_dirent *)(bh->b_data + sizeof(struct gfs_dinode));
-		return IS_DINODE;
-	}
-}
-
-/**
- * dirent_next - Next dirent
- * @dip: the directory
- * @bh: The buffer
- * @dent: Pointer to list of dirents
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int
-dirent_next(struct gfs_inode *dip, struct buffer_head *bh,
-	    struct gfs_dirent **dent)
-{
-	struct gfs_dirent *tmp, *cur;
-	char *bh_end;
-	uint32_t cur_rec_len;
-
-	cur = *dent;
-	bh_end = bh->b_data + bh->b_size;
-	cur_rec_len = gfs16_to_cpu(cur->de_rec_len);
-
-	if ((char *)cur + cur_rec_len >= bh_end) {
-		if ((char *)cur + cur_rec_len > bh_end) {
-			gfs_consist_inode(dip);
-			return -EIO;
-		}
-		return -ENOENT;
-	}
-
-	tmp = (struct gfs_dirent *)((char *)cur + cur_rec_len);
-
-	if ((char *)tmp + gfs16_to_cpu(tmp->de_rec_len) > bh_end) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-        /* Only the first dent could ever have de_ino == 0 */
-	if (!tmp->de_inum.no_formal_ino) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	*dent = tmp;
-
-	return 0;
-}
-
-/**
- * dirent_del - Delete a dirent
- * @dip: The GFS inode
- * @bh: The buffer
- * @prev: The previous dirent
- * @cur: The current dirent
- *
- */
-
-static void
-dirent_del(struct gfs_inode *dip, struct buffer_head *bh,
-	   struct gfs_dirent *prev, struct gfs_dirent *cur)
-{
-	uint32_t cur_rec_len, prev_rec_len;
-
-	if (!cur->de_inum.no_formal_ino) {
-		gfs_consist_inode(dip);
-		return;
-	}
-
-	gfs_trans_add_bh(dip->i_gl, bh);
-
-	/* If there is no prev entry, this is the first entry in the block.
-	   The de_rec_len is already as big as it needs to be.  Just zero
-	   out the inode number and return.  */
-
-	if (!prev) {
-		cur->de_inum.no_formal_ino = 0;	/* No endianess worries */
-		return;
-	}
-
-	/*  Combine this dentry with the previous one.  */
-
-	prev_rec_len = gfs16_to_cpu(prev->de_rec_len);
-	cur_rec_len = gfs16_to_cpu(cur->de_rec_len);
-
-	if ((char *)prev + prev_rec_len != (char *)cur)
-		gfs_consist_inode(dip);
-	if ((char *)cur + cur_rec_len > bh->b_data + bh->b_size)
-		gfs_consist_inode(dip);
-
-	prev_rec_len += cur_rec_len;
-	prev->de_rec_len = cpu_to_gfs16(prev_rec_len);
-}
-
-/**
- * gfs_dirent_alloc - Allocate a directory entry
- * @dip: The GFS inode
- * @bh: The buffer
- * @name_len: The length of the name
- * @dent_out: Pointer to list of dirents
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int
-gfs_dirent_alloc(struct gfs_inode *dip, struct buffer_head *bh, int name_len,
-		 struct gfs_dirent **dent_out)
-{
-	struct gfs_dirent *dent, *new;
-	unsigned int rec_len = GFS_DIRENT_SIZE(name_len);
-	unsigned int entries = 0, offset = 0;
-	int type;
-
-	type = dirent_first(dip, bh, &dent);
-	if (type < 0)
-		return type;
-
-	if (type == IS_LEAF) {
-		struct gfs_leaf *leaf = (struct gfs_leaf *)bh->b_data;
-		entries = gfs16_to_cpu(leaf->lf_entries);
-		offset = sizeof(struct gfs_leaf);
-	} else {
-		struct gfs_dinode *dinode = (struct gfs_dinode *)bh->b_data;
-		entries = gfs32_to_cpu(dinode->di_entries);
-		offset = sizeof(struct gfs_dinode);
-	}
-
-	if (!entries) {
-		if (dent->de_inum.no_formal_ino) {
-			gfs_consist_inode(dip);
-			return -EIO;
-		}
-
-		gfs_trans_add_bh(dip->i_gl, bh);
-
-		dent->de_rec_len = bh->b_size - offset;
-		dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-		dent->de_name_len = cpu_to_gfs16(name_len);
-
-		*dent_out = dent;
-		return 0;
-	}
-
-	do {
-		uint32_t cur_rec_len, cur_name_len;
-
-		cur_rec_len = gfs16_to_cpu(dent->de_rec_len);
-		cur_name_len = gfs16_to_cpu(dent->de_name_len);
-
-		if ((!dent->de_inum.no_formal_ino && cur_rec_len >= rec_len) ||
-		    (cur_rec_len >= GFS_DIRENT_SIZE(cur_name_len) + rec_len)) {
-			gfs_trans_add_bh(dip->i_gl, bh);
-
-			if (dent->de_inum.no_formal_ino) {
-				new = (struct gfs_dirent *)((char *)dent +
-							    GFS_DIRENT_SIZE(cur_name_len));
-				memset(new, 0, sizeof(struct gfs_dirent));
-
-				new->de_rec_len = cpu_to_gfs16(cur_rec_len -
-							       GFS_DIRENT_SIZE(cur_name_len));
-				new->de_name_len = cpu_to_gfs16(name_len);
-
-				dent->de_rec_len = cur_rec_len - gfs16_to_cpu(new->de_rec_len);
-				dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-
-				*dent_out = new;
-				return 0;
-			}
-
-			dent->de_name_len = cpu_to_gfs16(name_len);
-
-			*dent_out = dent;
-			return 0;
-		}
-	} while (dirent_next(dip, bh, &dent) == 0);
-
-	return -ENOSPC;
-}
-
-/**
- * dirent_fits - See if we can fit a entry in this buffer
- * @dip: The GFS inode
- * @bh: The buffer
- * @name_len: The length of the name
- *
- * Returns: TRUE if it can fit, FALSE otherwise
- */
-
-static int
-dirent_fits(struct gfs_inode *dip, struct buffer_head *bh, int name_len)
-{
-	struct gfs_dirent *dent;
-	unsigned int rec_len = GFS_DIRENT_SIZE(name_len);
-	unsigned int entries = 0;
-	int type;
-
-	type = dirent_first(dip, bh, &dent);
-	if (type < 0)
-		return type;
-
-	if (type == IS_LEAF) {
-		struct gfs_leaf *leaf = (struct gfs_leaf *)bh->b_data;
-		entries = gfs16_to_cpu(leaf->lf_entries);
-	} else {
-		struct gfs_dinode *dinode = (struct gfs_dinode *)bh->b_data;
-		entries = gfs32_to_cpu(dinode->di_entries);
-	}
-
-	if (!entries)
-		return TRUE;
-
-	do {
-		uint32_t cur_rec_len, cur_name_len;
-
-		cur_rec_len = gfs16_to_cpu(dent->de_rec_len);
-		cur_name_len = gfs16_to_cpu(dent->de_name_len);
-
-		if ((!dent->de_inum.no_formal_ino && cur_rec_len >= rec_len) ||
-		    (cur_rec_len >= GFS_DIRENT_SIZE(cur_name_len) + rec_len))
-			return TRUE;
-	} while (dirent_next(dip, bh, &dent) == 0);
-
-	return FALSE;
-}
-
-/**
- * leaf_search
- * @bh:
- * @filename:
- * @dent_out:
- * @dent_prev:
- *
- * Returns:
- */
-
-static int
-leaf_search(struct gfs_inode *dip,
-	    struct buffer_head *bh, struct qstr *filename,
-	    struct gfs_dirent **dent_out, struct gfs_dirent **dent_prev)
-{
-	uint32_t hash;
-	struct gfs_dirent *dent, *prev = NULL;
-	unsigned int entries = 0;
-	int type;
-
-	type = dirent_first(dip, bh, &dent);
-	if (type < 0)
-		return type;
-
-	if (type == IS_LEAF) {
-		struct gfs_leaf *leaf = (struct gfs_leaf *)bh->b_data;
-		entries = gfs16_to_cpu(leaf->lf_entries);
-	} else if (type == IS_DINODE) {
-		struct gfs_dinode *dinode = (struct gfs_dinode *)bh->b_data;
-		entries = gfs32_to_cpu(dinode->di_entries);
-	}
-
-	hash = gfs_dir_hash(filename->name, filename->len);
-
-	do {
-		if (!dent->de_inum.no_formal_ino) {
-			prev = dent;
-			continue;
-		}
-
-		if (gfs32_to_cpu(dent->de_hash) == hash &&
-		    gfs_filecmp(filename, (char *)(dent + 1),
-				gfs16_to_cpu(dent->de_name_len))) {
-			*dent_out = dent;
-			if (dent_prev)
-				*dent_prev = prev;
-
-			return 0;
-		}
-
-		prev = dent;
-	} while (dirent_next(dip, bh, &dent) == 0);
-
-	return -ENOENT;
-}
-
-/**
- * get_leaf - Get leaf
- * @dip:
- * @leaf_no:
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int
-get_leaf(struct gfs_inode *dip, uint64_t leaf_no, struct buffer_head **bhp)
-{
-	int error;
-
-	error = gfs_dread(dip->i_gl, leaf_no, DIO_START | DIO_WAIT, bhp);
-	if (!error && gfs_metatype_check(dip->i_sbd, *bhp, GFS_METATYPE_LF))
-		error = -EIO;
-
-	return error;
-}
-
-/**
- * get_leaf_nr - Get a leaf number associated with the index
- * @dip: The GFS inode
- * @index:
- * @leaf_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int
-get_leaf_nr(struct gfs_inode *dip, uint32_t index, uint64_t *leaf_out)
-{
-	uint64_t leaf_no;
-	int error;
-
-	error = gfs_internal_read(dip, (char *)&leaf_no,
-				  index * sizeof(uint64_t),
-				  sizeof(uint64_t));
-	if (error != sizeof(uint64_t))
-		return (error < 0) ? error : -EIO;
-
-	*leaf_out = gfs64_to_cpu(leaf_no);
-
-	return 0;
-}
-
-/**
- * get_first_leaf - Get first leaf
- * @dip: The GFS inode
- * @index:
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int
-get_first_leaf(struct gfs_inode *dip, uint32_t index,
-	       struct buffer_head **bh_out)
-{
-	uint64_t leaf_no;
-	int error;
-
-	error = get_leaf_nr(dip, index, &leaf_no);
-	if (!error)
-		error = get_leaf(dip, leaf_no, bh_out);
-
-	return error;
-}
-
-/**
- * get_next_leaf - Get next leaf
- * @dip: The GFS inode
- * @bh_in: The buffer
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int
-get_next_leaf(struct gfs_inode *dip, struct buffer_head *bh_in,
-	      struct buffer_head **bh_out)
-{
-	struct gfs_leaf *leaf;
-	int error;
-
-	leaf = (struct gfs_leaf *)bh_in->b_data;
-
-	if (!leaf->lf_next)
-		error = -ENOENT;
-	else
-		error = get_leaf(dip, gfs64_to_cpu(leaf->lf_next), bh_out);
-
-	return error;
-}
-
-/**
- * linked_leaf_search - Linked leaf search
- * @dip: The GFS inode
- * @filename: The filename to search for
- * @dent_out:
- * @dent_prev:
- * @bh_out:
- *
- * Returns: 0 on sucess, error code otherwise
- */
-
-static int
-linked_leaf_search(struct gfs_inode *dip, struct qstr *filename,
-		   struct gfs_dirent **dent_out, struct gfs_dirent **dent_prev,
-		   struct buffer_head **bh_out)
-{
-	struct buffer_head *bh = NULL, *bh_next;
-	uint32_t hsize, index;
-	uint32_t hash;
-	int error;
-
-	hsize = 1 << dip->i_di.di_depth;
-	if (hsize * sizeof(uint64_t) != dip->i_di.di_size) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	/*  Figure out the address of the leaf node.  */
-
-	hash = gfs_dir_hash(filename->name, filename->len);
-	index = hash >> (32 - dip->i_di.di_depth);
-
-	error = get_first_leaf(dip, index, &bh_next);
-	if (error)
-		return error;
-
-	/*  Find the entry  */
-
-	do {
-		if (bh)
-			brelse(bh);
-
-		bh = bh_next;
-
-		error = leaf_search(dip, bh, filename, dent_out, dent_prev);
-		switch (error) {
-		case 0:
-			*bh_out = bh;
-			return 0;
-
-		case -ENOENT:
-			break;
-
-		default:
-			brelse(bh);
-			return error;
-		}
-
-		error = get_next_leaf(dip, bh, &bh_next);
-	}
-	while (!error);
-
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * dir_make_exhash - Convert a stuffed directory into an ExHash directory
- * @dip: The GFS inode
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int
-dir_make_exhash(struct gfs_inode *dip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_dirent *dent;
-	struct buffer_head *bh, *dibh;
-	struct gfs_leaf *leaf;
-	int y;
-	uint32_t x;
-	uint64_t *lp, bn;
-	int error;
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	/*  Allocate a new block for the first leaf node  */
-
-	error = gfs_metaalloc(dip, &bn);
-	if (error)
-		goto fail;
-
-	/*  Turn over a new leaf  */
-
-	error = gfs_dread(dip->i_gl, bn, DIO_NEW | DIO_START | DIO_WAIT, &bh);
-	if (error)
-		goto fail;
-
-	gfs_trans_add_bh(dip->i_gl, bh);
-	gfs_metatype_set(bh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-	gfs_buffer_clear_tail(bh, sizeof(struct gfs_meta_header));
-
-	/*  Fill in the leaf structure  */
-
-	leaf = (struct gfs_leaf *)bh->b_data;
-
-	gfs_assert(sdp, dip->i_di.di_entries < (1 << 16),);
-
-	leaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-	leaf->lf_entries = cpu_to_gfs16(dip->i_di.di_entries);
-
-	/*  Copy dirents  */
-
-	gfs_buffer_copy_tail(bh, sizeof(struct gfs_leaf), dibh,
-			     sizeof(struct gfs_dinode));
-
-	/*  Find last entry  */
-
-	x = 0;
-	dirent_first(dip, bh, &dent);
-
-	do {
-		if (!dent->de_inum.no_formal_ino)
-			continue;
-		if (++x == dip->i_di.di_entries)
-			break;
-	}
-	while (dirent_next(dip, bh, &dent) == 0);
-
-	/*  Adjust the last dirent's record length
-	   (Remember that dent still points to the last entry.)  */
-
-	dent->de_rec_len = gfs16_to_cpu(dent->de_rec_len) +
-		sizeof(struct gfs_dinode) -
-		sizeof(struct gfs_leaf);
-	dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-
-	brelse(bh);
-
-	/*  We're done with the new leaf block, now setup the new
-	    hash table.  */
-
-	gfs_trans_add_bh(dip->i_gl, dibh);
-	gfs_buffer_clear_tail(dibh, sizeof (struct gfs_dinode));
-
-	lp = (uint64_t *)(dibh->b_data + sizeof(struct gfs_dinode));
-
-	for (x = sdp->sd_hash_ptrs; x--; lp++)
-		*lp = cpu_to_gfs64(bn);
-
-	dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2;
-	dip->i_di.di_blocks++;
-	dip->i_di.di_flags |= GFS_DIF_EXHASH;
-	dip->i_di.di_payload_format = 0;
-
-	for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
-	dip->i_di.di_depth = y;
-
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-
-	brelse(dibh);
-
-	return 0;
-
- fail:
-	brelse(dibh);
-	return error;
-}
-
-/**
- * dir_split_leaf - Split a leaf block into two
- * @dip: The GFS inode
- * @index:
- * @leaf_no:
- *
- * Returns: 0 on success, error code on failure
- */
-
-static int
-dir_split_leaf(struct gfs_inode *dip, uint32_t index, uint64_t leaf_no)
-{
-	struct buffer_head *nbh, *obh, *dibh;
-	struct gfs_leaf *nleaf, *oleaf;
-	struct gfs_dirent *dent, *prev = NULL, *next = NULL, *new;
-	uint32_t start, len, half_len, divider;
-	uint64_t bn, *lp;
-	uint32_t name_len;
-	int x, moved = FALSE;
-	int error, lp_vfree=0;
-
-	/*  Allocate the new leaf block  */
-
-	error = gfs_metaalloc(dip, &bn);
-	if (error)
-		return error;
-
-	/*  Get the new leaf block  */
-
-	error = gfs_dread(dip->i_gl, bn,
-			  DIO_NEW | DIO_START | DIO_WAIT, &nbh);
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(dip->i_gl, nbh);
-	gfs_metatype_set(nbh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-	gfs_buffer_clear_tail(nbh, sizeof (struct gfs_meta_header));
-
-	nleaf = (struct gfs_leaf *)nbh->b_data;
-
-	nleaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-
-	/*  Get the old leaf block  */
-
-	error = get_leaf(dip, leaf_no, &obh);
-	if (error)
-		goto fail;
-
-	gfs_trans_add_bh(dip->i_gl, obh);
-
-	oleaf = (struct gfs_leaf *)obh->b_data;
-
-	/*  Compute the start and len of leaf pointers in the hash table.  */
-
-	len = 1 << (dip->i_di.di_depth - gfs16_to_cpu(oleaf->lf_depth));
-	half_len = len >> 1;
-	if (!half_len) {
-		gfs_consist_inode(dip);
-		error = -EIO;
-		goto fail_brelse;
-	}
-
-	start = (index & ~(len - 1));
-
-	/* Change the pointers.
-	   Don't bother distinguishing stuffed from non-stuffed.
-	   This code is complicated enough already. */
-
-	lp = kmalloc(half_len * sizeof (uint64_t), GFP_KERNEL);
-	if (unlikely(!lp)) {
-		lp = vmalloc(half_len * sizeof (uint64_t));
-		if (!lp) {
-			printk("GFS: dir_split_leaf vmalloc fail - half_len=%d\n", half_len);
-			error = -ENOMEM;
-			goto fail_brelse;
-		} else
-			lp_vfree = 1;
-	}
-
-	error = gfs_internal_read(dip, (char *)lp, start * sizeof(uint64_t),
-				  half_len * sizeof(uint64_t));
-	if (error != half_len * sizeof(uint64_t)) {
-		if (error >= 0)
-			error = -EIO;
-		goto fail_lpfree;
-	}
-
-	/*  Change the pointers  */
-
-	for (x = 0; x < half_len; x++)
-		lp[x] = cpu_to_gfs64(bn);
-
-	error = gfs_internal_write(dip, (char *)lp, start * sizeof(uint64_t),
-				   half_len * sizeof(uint64_t));
-	if (error != half_len * sizeof(uint64_t)) {
-		if (error >= 0)
-			error = -EIO;
-		goto fail_lpfree;
-	}
-
-	if (unlikely(lp_vfree))
-		vfree(lp);
-	else
-		kfree(lp);
-
-	/*  Compute the divider  */
-
-	divider = (start + half_len) << (32 - dip->i_di.di_depth);
-
-	/*  Copy the entries  */
-
-	dirent_first(dip, obh, &dent);
-
-	do {
-		next = dent;
-		if (dirent_next(dip, obh, &next))
-			next = NULL;
-
-		if (dent->de_inum.no_formal_ino &&
-		    gfs32_to_cpu(dent->de_hash) < divider) {
-			name_len = gfs16_to_cpu(dent->de_name_len);
-
-			gfs_dirent_alloc(dip, nbh, name_len, &new);
-
-			new->de_inum = dent->de_inum; /* No endianness worries */
-			new->de_hash = dent->de_hash; /* No endianness worries */
-			new->de_type = dent->de_type; /* No endianness worries */
-			memcpy((char *)(new + 1), (char *)(dent + 1),
-			       name_len);
-
-			nleaf->lf_entries = gfs16_to_cpu(nleaf->lf_entries) + 1;
-			nleaf->lf_entries = cpu_to_gfs16(nleaf->lf_entries);
-
-			dirent_del(dip, obh, prev, dent);
-
-			if (!oleaf->lf_entries)
-				gfs_consist_inode(dip);
-			oleaf->lf_entries = gfs16_to_cpu(oleaf->lf_entries) - 1;
-			oleaf->lf_entries = cpu_to_gfs16(oleaf->lf_entries);
-
-			if (!prev)
-				prev = dent;
-
-			moved = TRUE;
-		} else
-			prev = dent;
-
-		dent = next;
-	}
-	while (dent);
-
-	/* If none of the entries got moved into the new leaf,
-	   artificially fill in the first entry. */
-
-	if (!moved) {
-		gfs_dirent_alloc(dip, nbh, 0, &new);
-		new->de_inum.no_formal_ino = 0;
-	}
-
-	oleaf->lf_depth = gfs16_to_cpu(oleaf->lf_depth) + 1;
-	oleaf->lf_depth = cpu_to_gfs16(oleaf->lf_depth);
-	nleaf->lf_depth = oleaf->lf_depth;
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (!gfs_assert_withdraw(dip->i_sbd, !error)) {
-		dip->i_di.di_blocks++;
-		gfs_dinode_out(&dip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	brelse(obh);
-	brelse(nbh);
-
-	return error;
-
- fail_lpfree:
-	if (unlikely(lp_vfree))
-		vfree(lp);
-	else
-		kfree(lp);
-
- fail_brelse:
-	brelse(obh);
-
- fail:
-	brelse(nbh);
-	return error;
-}
-
-/**
- * dir_double_exhash - Double size of ExHash table
- * @dip: The GFS dinode
- *
- * Returns: 0 on success, error code on failure
- */
-
-static int
-dir_double_exhash(struct gfs_inode *dip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct buffer_head *dibh;
-	uint32_t hsize;
-	uint64_t *buf;
-	uint64_t *from, *to;
-	uint64_t block;
-	int x;
-	int error = 0;
-
-	hsize = 1 << dip->i_di.di_depth;
-	if (hsize * sizeof(uint64_t) != dip->i_di.di_size) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	/*  Allocate both the "from" and "to" buffers in one big chunk  */
-
-	buf = gmalloc(3 * sdp->sd_hash_bsize);
-
-	for (block = dip->i_di.di_size >> sdp->sd_hash_bsize_shift; block--;) {
-		error = gfs_internal_read(dip, (char *)buf,
-					  block * sdp->sd_hash_bsize,
-					  sdp->sd_hash_bsize);
-		if (error != sdp->sd_hash_bsize) {
-			if (error >= 0)
-				error = -EIO;
-			goto fail;
-		}
-
-		from = buf;
-		to = (uint64_t *)((char *)buf + sdp->sd_hash_bsize);
-
-		for (x = sdp->sd_hash_ptrs; x--; from++) {
-			*to++ = *from;	/*  No endianess worries  */
-			*to++ = *from;
-		}
-
-		error = gfs_internal_write(dip, (char *)buf + sdp->sd_hash_bsize,
-					   block * sdp->sd_sb.sb_bsize,
-					   sdp->sd_sb.sb_bsize);
-		if (error != sdp->sd_sb.sb_bsize) {
-			if (error >= 0)
-				error = -EIO;
-			goto fail;
-		}
-	}
-
-	kfree(buf);
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (!gfs_assert_withdraw(sdp, !error)) {
-		dip->i_di.di_depth++;
-		gfs_dinode_out(&dip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	return error;
-
- fail:
-	kfree(buf);
-
-	return error;
-}
-
-/**
- * compare_dents - compare directory entries by hash value
- * @a: first dent
- * @b: second dent
- *
- * When comparing the hash entries of @a to @b:
- *   gt: returns 1
- *   lt: returns -1
- *   eq: returns 0
- */
-
-static int
-compare_dents(const void *a, const void *b)
-{
-	struct gfs_dirent *dent_a, *dent_b;
-	uint32_t hash_a, hash_b;
-	int ret = 0;
-
-	dent_a = *(struct gfs_dirent **)a;
-	hash_a = dent_a->de_hash;
-	hash_a = gfs32_to_cpu(hash_a);
-
-	dent_b = *(struct gfs_dirent **)b;
-	hash_b = dent_b->de_hash;
-	hash_b = gfs32_to_cpu(hash_b);
-
-	if (hash_a > hash_b)
-		ret = 1;
-	else if (hash_a < hash_b)
-		ret = -1;
-	else {
-		unsigned int len_a = gfs16_to_cpu(dent_a->de_name_len);
-		unsigned int len_b = gfs16_to_cpu(dent_b->de_name_len);
-
-		if (len_a > len_b)
-			ret = 1;
-		else if (len_a < len_b)
-			ret = -1;
-		else
-			ret = memcmp((char *)(dent_a + 1),
-				     (char *)(dent_b + 1),
-				     len_a);
-	}
-
-	return ret;
-}
-
-/**
- * do_filldir_main - read out directory entries
- * @dip: The GFS inode
- * @offset: The offset in the file to read from
- * @opaque: opaque data to pass to filldir
- * @filldir: The function to pass entries to 
- * @darr: an array of struct gfs_dirent pointers to read
- * @entries: the number of entries in darr
- * @copied: pointer to int that's non-zero if a entry has been copied out
- *
- * Jump through some hoops to make sure that if there are hash collsions,
- * they are read out at the beginning of a buffer.  We want to minimize
- * the possibility that they will fall into different readdir buffers or
- * that someone will want to seek to that location.
- *
- * Returns: errno, >0 on exception from filldir
- */
-
-static int
-do_filldir_main(struct gfs_inode *dip, uint64_t *offset,
-		void *opaque, gfs_filldir_t filldir,
-		struct gfs_dirent **darr, uint32_t entries, int *copied)
-{
-	struct gfs_dirent *dent, *dent_next;
-	struct gfs_inum inum;
-	uint64_t off, off_next;
-	unsigned int x, y;
-	int run = FALSE;
-	int error = 0;
-
-	gfs_sort(darr, entries, sizeof(struct gfs_dirent *), compare_dents);
-
-	dent_next = darr[0];
-	off_next = gfs32_to_cpu(dent_next->de_hash);
-	off_next = gfs_dir_hash2offset(off_next);
-
-	for (x = 0, y = 1; x < entries; x++, y++) {
-		dent = dent_next;
-		off = off_next;
-
-		if (y < entries) {
-			dent_next = darr[y];
-			off_next = gfs32_to_cpu(dent_next->de_hash);
-			off_next = gfs_dir_hash2offset(off_next);
-
-			if (off < *offset)
-				continue;
-			*offset = off;
-
-			if (off_next == off) {
-				if (*copied && !run)
-					return 1;
-				run = TRUE;
-			} else
-				run = FALSE;
-		} else {
-			if (off < *offset)
-				continue;
-			*offset = off;
-		}
-
-		gfs_inum_in(&inum, (char *)&dent->de_inum);
-
-		error = filldir(opaque, (char *)(dent + 1),
-				gfs16_to_cpu(dent->de_name_len),
-				off, &inum,
-				gfs16_to_cpu(dent->de_type));
-		if (error)
-			return 1;
-
-		*copied = TRUE;
-	}
-
-	/* Increment the *offset by one, so the next time we come into the do_filldir fxn, 
-	   we get the next entry instead of the last one in the current leaf */
-
-	(*offset)++;
-
-	return 0;
-}
-
-/**
- * do_filldir_single - Read directory entries out of a single block
- * @dip: The GFS inode
- * @offset: The offset in the file to read from
- * @opaque: opaque data to pass to filldir
- * @filldir: The function to pass entries to 
- * @bh: the block
- * @entries: the number of entries in the block
- * @copied: pointer to int that's non-zero if a entry has been copied out
- *
- * Returns: errno, >0 on exception from filldir
- */
-
-static int
-do_filldir_single(struct gfs_inode *dip, uint64_t *offset,
-		  void *opaque, gfs_filldir_t filldir,
-		  struct buffer_head *bh, uint32_t entries, int *copied)
-{
-	struct gfs_dirent **darr;
-	struct gfs_dirent *de;
-	unsigned int e = 0;
-	int error, do_vfree=0;
-
-	if (!entries)
-		return 0;
-
-	darr = kmalloc(entries * sizeof(struct gfs_dirent *), GFP_KERNEL);
-	if (unlikely(!darr)) {
-		darr = vmalloc(entries * sizeof (struct gfs_dirent *));
-		if (!darr) {
-			printk("GFS: do_filldir_single vmalloc fails, entries=%d\n", entries);
-			return -ENOMEM;
-		}
-	else
-		do_vfree = 1;
-	}
-
-	dirent_first(dip, bh, &de);
-	do {
-		if (!de->de_inum.no_formal_ino)
-			continue;
-		if (e >= entries) {
-			gfs_consist_inode(dip);
-			error = -EIO;
-			goto out;
-		}
-		darr[e++] = de;
-	}
-	while (dirent_next(dip, bh, &de) == 0);
-
-	if (e != entries) {
-		gfs_consist_inode(dip);
-		error = -EIO;
-		goto out;
-	}
-
-	error = do_filldir_main(dip, offset, opaque, filldir, darr,
-				entries, copied);
-
- out:
-	if (unlikely(do_vfree))
-		vfree(darr);
-	else
-		kfree(darr);
-
-	return error;
-}
-
-/**
- * do_filldir_multi - Read directory entries out of a linked leaf list
- * @dip: The GFS inode
- * @offset: The offset in the file to read from
- * @opaque: opaque data to pass to filldir
- * @filldir: The function to pass entries to 
- * @bh: the first leaf in the list
- * @copied: pointer to int that's non-zero if a entry has been copied out
- *
- * Returns: errno, >0 on exception from filldir
- */
-
-static int
-do_filldir_multi(struct gfs_inode *dip, uint64_t *offset,
-		 void *opaque, gfs_filldir_t filldir,
-		 struct buffer_head *bh, int *copied)
-{
-	struct buffer_head **larr = NULL;
-	struct gfs_dirent **darr;
-	struct gfs_leaf *leaf;
-	struct buffer_head *tmp_bh;
-	struct gfs_dirent *de;
-	unsigned int entries, e = 0;
-	unsigned int leaves = 0, l = 0;
-	unsigned int x;
-	uint64_t ln;
-	int error = 0, leaves_vfree=0, entries_vfree=0;
-
-	/*  Count leaves and entries  */
-
-	leaf = (struct gfs_leaf *)bh->b_data;
-	entries = gfs16_to_cpu(leaf->lf_entries);
-	ln = leaf->lf_next;
-
-	while (ln) {
-		ln = gfs64_to_cpu(ln);
-
-		error = get_leaf(dip, ln, &tmp_bh);
-		if (error)
-			return error;
-
-		leaf = (struct gfs_leaf *)tmp_bh->b_data;
-		if (leaf->lf_entries) {
-			entries += gfs16_to_cpu(leaf->lf_entries);
-			leaves++;
-		}
-		ln = leaf->lf_next;
-
-		brelse(tmp_bh);
-	}
-
-	/*  Bail out if there's nothing to do  */
-
-	if (!entries)
-		return 0;
-
-	/*  Alloc arrays  */
-
-	if (leaves) {
-		larr = kmalloc(leaves * sizeof(struct buffer_head *), GFP_KERNEL);
-		if (unlikely(!larr)) {
-			larr = vmalloc(leaves * sizeof (struct buffer_head *));
-			if (!larr) {
-				printk("GFS: do_filldir_multi vmalloc fails leaves=%d\n", leaves);
-				return -ENOMEM;
-			} else
-				leaves_vfree = 1;
-		}
-	}
-
-	darr = kmalloc(entries * sizeof(struct gfs_dirent *), GFP_KERNEL);
-	if (unlikely(!darr)) {
-		darr = vmalloc(entries * sizeof (struct gfs_dirent *));
-		if (!darr) {
-			printk("GFS: do_filldir_multi vmalloc fails entries=%d\n", entries);
-			if (larr) {
-				if (leaves_vfree) 
-					vfree(larr);
-				else 
-					kfree(larr);
-			}
-			return -ENOMEM;
-		} else
-			entries_vfree = 1;
-	} 
-	if (!darr) {
-		if (larr)
-			kfree(larr);
-		return -ENOMEM;
-	}
-
-	/*  Fill in arrays  */
-
-	leaf = (struct gfs_leaf *)bh->b_data;
-	if (leaf->lf_entries) {
-		dirent_first(dip, bh, &de);
-		do {
-			if (!de->de_inum.no_formal_ino)
-				continue;
-			if (e >= entries) {
-				gfs_consist_inode(dip);
-				error = -EIO;
-				goto out;
-			}
-			darr[e++] = de;
-		}
-		while (dirent_next(dip, bh, &de) == 0);
-	}
-	ln = leaf->lf_next;
-
-	while (ln) {
-		ln = gfs64_to_cpu(ln);
-
-		error = get_leaf(dip, ln, &tmp_bh);
-		if (error)
-			goto out;
-
-		leaf = (struct gfs_leaf *)tmp_bh->b_data;
-		if (leaf->lf_entries) {
-			dirent_first(dip, tmp_bh, &de);
-			do {
-				if (!de->de_inum.no_formal_ino)
-					continue;
-				if (e >= entries) {
-					gfs_consist_inode(dip);
-					error = -EIO;
-					goto out;
-				}
-				darr[e++] = de;
-			}
-			while (dirent_next(dip, tmp_bh, &de) == 0);
-
-			larr[l++] = tmp_bh;
-
-			ln = leaf->lf_next;
-		} else {
-			ln = leaf->lf_next;
-			brelse(tmp_bh);
-		}
-	}
-
-	if (gfs_assert_withdraw(dip->i_sbd, l == leaves)) {
-		error = -EIO;
-		goto out;
-	}
-	if (e != entries) {
-		gfs_consist_inode(dip);
-		error = -EIO;
-		goto out;
-	}
-
-	/*  Do work  */
-
-	error = do_filldir_main(dip, offset, opaque, filldir, darr,
-				entries, copied);
-
-	/*  Clean up  */
-
- out:
-	if (unlikely(entries_vfree))
-		vfree(darr);
-	else
-		kfree(darr);
-
-	for (x = 0; x < l; x++)
-		brelse(larr[x]);
-
-	if (leaves) {
-		if (unlikely(leaves_vfree))
-			vfree(larr);
-		else
-			kfree(larr);
-	}
-
-	return error;
-}
-
-/**
- * dir_e_search - Search exhash (leaf) dir for inode matching name
- * @dip: The GFS inode
- * @filename: Filename string
- * @inode: If non-NULL, function fills with formal inode # and block address
- * @type: If non-NULL, function fills with GFS_FILE_... dinode type
- *
- * Returns:
- */
-
-static int
-dir_e_search(struct gfs_inode *dip, struct qstr *filename,
-	     struct gfs_inum *inum, unsigned int *type)
-{
-	struct buffer_head *bh;
-	struct gfs_dirent *dent;
-	int error;
-
-	error = linked_leaf_search(dip, filename, &dent, NULL, &bh);
-	if (error)
-		return error;
-
-	if (inum)
-		gfs_inum_in(inum, (char *)&dent->de_inum);
-	if (type)
-		*type = gfs16_to_cpu(dent->de_type);
-
-	brelse(bh);
-
-	return 0;
-}
-
-/**
- * dir_e_add -
- * @dip: The GFS inode
- * @filename:
- * @inode:
- * @type:
- *
- */
-
-static int
-dir_e_add(struct gfs_inode *dip, struct qstr *filename,
-	  struct gfs_inum *inum, unsigned int type)
-{
-	struct buffer_head *bh, *nbh, *dibh;
-	struct gfs_leaf *leaf, *nleaf;
-	struct gfs_dirent *dent;
-	uint32_t hsize, index;
-	uint32_t hash;
-	uint64_t leaf_no, bn;
-	int error;
-
- restart:
-	hsize = 1 << dip->i_di.di_depth;
-	if (hsize * sizeof(uint64_t) != dip->i_di.di_size) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	/*  Figure out the address of the leaf node.  */
-
-	hash = gfs_dir_hash(filename->name, filename->len);
-	index = hash >> (32 - dip->i_di.di_depth);
-
-	error = get_leaf_nr(dip, index, &leaf_no);
-	if (error)
-		return error;
-
-	/*  Add entry to the leaf  */
-
-	for (;;) {
-		error = get_leaf(dip, leaf_no, &bh);
-		if (error)
-			return error;
-
-		leaf = (struct gfs_leaf *)bh->b_data;
-
-		if (gfs_dirent_alloc(dip, bh, filename->len, &dent)) {
-
-			if (gfs16_to_cpu(leaf->lf_depth) < dip->i_di.di_depth) {
-				/* Can we split the leaf? */
-
-				brelse(bh);
-
-				error = dir_split_leaf(dip, index, leaf_no);
-				if (error)
-					return error;
-
-				goto restart;
-
-			} else if (dip->i_di.di_depth < GFS_DIR_MAX_DEPTH) {
-				/* Can we double the hash table? */
-
-				brelse(bh);
-
-				error = dir_double_exhash(dip);
-				if (error)
-					return error;
-
-				goto restart;
-
-			} else if (leaf->lf_next) {
-				/* Can we try the next leaf in the list? */
-				leaf_no = gfs64_to_cpu(leaf->lf_next);
-				brelse(bh);
-				continue;
-
-			} else {
-				/* Create a new leaf and add it to the list. */
-
-				error = gfs_metaalloc(dip, &bn);
-				if (error) {
-					brelse(bh);
-					return error;
-				}
-
-				error = gfs_dread(dip->i_gl, bn,
-						  DIO_NEW | DIO_START | DIO_WAIT,
-						  &nbh);
-				if (error) {
-					brelse(bh);
-					return error;
-				}
-
-				gfs_trans_add_bh(dip->i_gl, nbh);
-				gfs_metatype_set(nbh,
-						 GFS_METATYPE_LF,
-						 GFS_FORMAT_LF);
-				gfs_buffer_clear_tail(nbh,
-						      sizeof(struct gfs_meta_header));
-
-				gfs_trans_add_bh(dip->i_gl, bh);
-				leaf->lf_next = cpu_to_gfs64(bn);
-
-				nleaf = (struct gfs_leaf *)nbh->b_data;
-				nleaf->lf_depth = leaf->lf_depth;
-				nleaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-
-				gfs_dirent_alloc(dip, nbh, filename->len, &dent);
-
-				dip->i_di.di_blocks++;
-
-				brelse(bh);
-
-				bh = nbh;
-				leaf = nleaf;
-			}
-		}
-
-		/*  If the gfs_dirent_alloc() succeeded, it pinned the "bh".  */
-
-		gfs_inum_out(inum, (char *)&dent->de_inum);
-		dent->de_hash = cpu_to_gfs32(hash);
-		dent->de_type = cpu_to_gfs16(type);
-		memcpy((char *)(dent + 1), filename->name, filename->len);
-
-		leaf->lf_entries = gfs16_to_cpu(leaf->lf_entries) + 1;
-		leaf->lf_entries = cpu_to_gfs16(leaf->lf_entries);
-
-		brelse(bh);
-
-		error = gfs_get_inode_buffer(dip, &dibh);
-		if (error)
-			return error;
-
-		dip->i_di.di_entries++;
-		dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
-
-		gfs_trans_add_bh(dip->i_gl, dibh);
-		gfs_dinode_out(&dip->i_di, dibh->b_data);
-		brelse(dibh);
-
-		return 0;
-	}
-
-	return -ENOENT;
-}
-
-/**
- * dir_e_del - 
- * @dip: The GFS inode
- * @filename:
- *
- * Returns:
- */
-
-static int
-dir_e_del(struct gfs_inode *dip, struct qstr *filename)
-{
-	struct buffer_head *bh, *dibh;
-	struct gfs_dirent *dent, *prev;
-	struct gfs_leaf *leaf;
-	unsigned int entries;
-	int error;
-
-	error = linked_leaf_search(dip, filename, &dent, &prev, &bh);
-	if (error == -ENOENT) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-	if (error)
-		return error;
-
-	dirent_del(dip, bh, prev, dent); /* Pins bh */
-
-	leaf = (struct gfs_leaf *)bh->b_data;
-	entries = gfs16_to_cpu(leaf->lf_entries);
-	if (!entries)
-		gfs_consist_inode(dip);
-	entries--;
-	leaf->lf_entries = cpu_to_gfs16(entries);
-
-	brelse(bh);
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	if (!dip->i_di.di_entries)
-		gfs_consist_inode(dip);
-	dip->i_di.di_entries--;
-	dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(dip->i_gl, dibh);
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	return 0;
-}
-
-/**
- * dir_e_read - Reads the entries from a directory into a filldir buffer 
- * @dip: dinode pointer
- * @offset: the hash of the last entry read shifted to the right once
- * @opaque: buffer for the filldir function to fill 
- * @filldir: points to the filldir function to use
- *
- * Returns: errno
- */
-
-static int
-dir_e_read(struct gfs_inode *dip, uint64_t *offset, void *opaque,
-	   gfs_filldir_t filldir)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct buffer_head *bh;
-	struct gfs_leaf leaf;
-	uint32_t hsize, len;
-	uint32_t ht_offset, lp_offset, ht_offset_cur = -1;
-	uint32_t hash, index;
-	uint64_t *lp;
-	int copied = FALSE;
-	int error = 0;
-
-	hsize = 1 << dip->i_di.di_depth;
-	if (hsize * sizeof(uint64_t) != dip->i_di.di_size) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	hash = gfs_dir_offset2hash(*offset);
-	index = hash >> (32 - dip->i_di.di_depth);
-
-	lp = kmalloc(sdp->sd_hash_bsize, GFP_KERNEL);
-	if (!lp)
-		return -ENOMEM;
-
-	while (index < hsize) {
-		lp_offset = index & (sdp->sd_hash_ptrs - 1);
-		ht_offset = index - lp_offset;
-
-		if (ht_offset_cur != ht_offset) {
-			error = gfs_internal_read(dip, (char *)lp,
-						  ht_offset * sizeof(uint64_t),
-						  sdp->sd_hash_bsize);
-			if (error != sdp->sd_hash_bsize) {
-				if (error >= 0)
-					error = -EIO;
-				goto out;
-			}
-			ht_offset_cur = ht_offset;
-		}
-
-		error = get_leaf(dip, gfs64_to_cpu(lp[lp_offset]), &bh);
-		if (error)
-			goto out;
-
-		gfs_leaf_in(&leaf, bh->b_data);
-
-		if (leaf.lf_next)
-			error = do_filldir_multi(dip, offset,
-						 opaque, filldir,
-						 bh, &copied);
-		else
-			error = do_filldir_single(dip, offset,
-						  opaque, filldir,
-						  bh, leaf.lf_entries,
-						  &copied);
-
-		brelse(bh);
-
-		if (error) {
-			if (error > 0)
-				error = 0;
-			goto out;
-		}
-
-		len = 1 << (dip->i_di.di_depth - leaf.lf_depth);
-		index = (index & ~(len - 1)) + len;
-	}
-
- out:
-	kfree(lp);
-
-	return error;
-}
-
-/**
- * dir_e_mvino -
- * @dip: The GFS inode
- * @filename:
- * @new_inode:
- *
- * Returns:
- */
-
-static int
-dir_e_mvino(struct gfs_inode *dip, struct qstr *filename,
-	    struct gfs_inum *inum, unsigned int new_type)
-{
-	struct buffer_head *bh, *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	error = linked_leaf_search(dip, filename, &dent, NULL, &bh);
-	if (error == -ENOENT) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(dip->i_gl, bh);
-
-	gfs_inum_out(inum, (char *)&dent->de_inum);
-	dent->de_type = cpu_to_gfs16(new_type);
-
-	brelse(bh);
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(dip->i_gl, dibh);
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	return 0;
-}
-
-/**
- * dir_l_search - Search linear (stuffed dinode) dir for inode matching name
- * @dip: The GFS inode
- * @filename: Filename string
- * @inode: If non-NULL, function fills with formal inode # and block address
- * @type: If non-NULL, function fills with GFS_FILE_... dinode type
- *
- * Returns:
- */
-
-static int
-dir_l_search(struct gfs_inode *dip, struct qstr *filename,
-	     struct gfs_inum *inum, unsigned int *type)
-{
-	struct buffer_head *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	if (!gfs_is_stuffed(dip)) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	error = leaf_search(dip, dibh, filename, &dent, NULL);
-	if (!error) {
-		if (inum)
-			gfs_inum_in(inum, (char *)&dent->de_inum);
-		if (type)
-			*type = gfs16_to_cpu(dent->de_type);
-	}
-
-	brelse(dibh);
-
-	return error;
-}
-
-/**
- * dir_l_add -
- * @dip: The GFS inode
- * @filename:
- * @inode:
- * @type:
- *
- * Returns:
- */
-
-static int
-dir_l_add(struct gfs_inode *dip, struct qstr *filename,
-	  struct gfs_inum *inum, unsigned int type)
-{
-	struct buffer_head *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	if (!gfs_is_stuffed(dip)) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	if (gfs_dirent_alloc(dip, dibh, filename->len, &dent)) {
-		brelse(dibh);
-
-		error = dir_make_exhash(dip);
-		if (!error)
-			error = dir_e_add(dip, filename, inum, type);
-
-		return error;
-	}
-
-	/*  gfs_dirent_alloc() pins  */
-
-	gfs_inum_out(inum, (char *)&dent->de_inum);
-	dent->de_hash = gfs_dir_hash(filename->name, filename->len);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(type);
-	memcpy((char *)(dent + 1), filename->name, filename->len);
-
-	dip->i_di.di_entries++;
-	dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
-
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	return 0;
-}
-
-/**
- * dir_l_del - 
- * @dip: The GFS inode
- * @filename:
- *
- * Returns:
- */
-
-static int
-dir_l_del(struct gfs_inode *dip, struct qstr *filename)
-{
-	struct buffer_head *dibh;
-	struct gfs_dirent *dent, *prev;
-	int error;
-
-	if (!gfs_is_stuffed(dip)) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	error = leaf_search(dip, dibh, filename, &dent, &prev);
-	if (error == -ENOENT) {
-		gfs_consist_inode(dip);
-		error = -EIO;
-		goto out;
-	}
-	if (error)
-		goto out;
-
-	dirent_del(dip, dibh, prev, dent);
-
-	/*  dirent_del() pins  */
-
-	if (!dip->i_di.di_entries)
-		gfs_consist_inode(dip);
-	dip->i_di.di_entries--;
-
-	dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
-
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-
- out:
-	brelse(dibh);
-
-	return error;
-}
-
-/**
- * dir_l_read -
- * @dip:
- * @offset:
- * @opaque:
- * @filldir:
- *
- * Returns:
- */
-
-static int
-dir_l_read(struct gfs_inode *dip, uint64_t *offset, void *opaque,
-	   gfs_filldir_t filldir)
-{
-	struct buffer_head *dibh;
-	int copied = FALSE;
-	int error;
-
-	if (!gfs_is_stuffed(dip)) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	if (!dip->i_di.di_entries)
-		return 0;
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	error = do_filldir_single(dip, offset,
-				  opaque, filldir,
-				  dibh, dip->i_di.di_entries,
-				  &copied);
-	if (error > 0)
-		error = 0;
-
-	brelse(dibh);
-
-	return error;
-}
-
-/**
- * dir_l_mvino -
- * @dip:
- * @filename:
- * @new_inode:
- *
- * Returns:
- */
-
-static int
-dir_l_mvino(struct gfs_inode *dip, struct qstr *filename,
-	    struct gfs_inum *inum, unsigned int new_type)
-{
-	struct buffer_head *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	if (!gfs_is_stuffed(dip)) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		return error;
-
-	error = leaf_search(dip, dibh, filename, &dent, NULL);
-	if (error == -ENOENT) {
-		gfs_consist_inode(dip);
-		error = -EIO;
-		goto out;
-	}
-	if (error)
-		goto out;
-
-	gfs_trans_add_bh(dip->i_gl, dibh);
-
-	gfs_inum_out(inum, (char *)&dent->de_inum);
-	dent->de_type = cpu_to_gfs16(new_type);
-
-	dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
-
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-
- out:
-	brelse(dibh);
-
-	return error;
-}
-
-/**
- * gfs_dir_search - Search a directory
- * @dip: The GFS inode
- * @filename:
- * @inode:
- *
- * This routine searches a directory for a file or another directory.
- * Assumes a glock is held on dip.
- *
- * Returns: errno
- */
-
-int
-gfs_dir_search(struct gfs_inode *dip, struct qstr *filename,
-	       struct gfs_inum *inum, unsigned int *type)
-{
-	int error;
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_search(dip, filename, inum, type);
-	else
-		error = dir_l_search(dip, filename, inum, type);
-
-	return error;
-}
-
-/**
- * gfs_dir_add - Add new filename into directory
- * @dip: The GFS inode
- * @filename: The new name
- * @inode: The inode number of the entry
- * @type: The type of the entry
- *
- * Returns: 0 on success, error code on failure
- */
-
-int
-gfs_dir_add(struct gfs_inode *dip, struct qstr *filename,
-	    struct gfs_inum *inum, unsigned int type)
-{
-	int error;
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_add(dip, filename, inum, type);
-	else
-		error = dir_l_add(dip, filename, inum, type);
-
-	return error;
-}
-
-/**
- * gfs_dir_del - Delete a directory entry
- * @dip: The GFS inode
- * @filename: The filename
- *
- * Returns: 0 on success, error code on failure
- */
-
-int
-gfs_dir_del(struct gfs_inode *dip, struct qstr *filename)
-{
-	int error;
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_del(dip, filename);
-	else
-		error = dir_l_del(dip, filename);
-
-	return error;
-}
-
-/**
- * gfs_dir_read - Translate a GFS filename
- * @dip: The GFS inode
- * @offset:
- * @opaque:
- * @filldir:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int
-gfs_dir_read(struct gfs_inode *dip, uint64_t * offset, void *opaque,
-	     gfs_filldir_t filldir)
-{
-	int error;
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_read(dip, offset, opaque, filldir);
-	else
-		error = dir_l_read(dip, offset, opaque, filldir);
-
-	return error;
-}
-
-/**
- * gfs_dir_mvino - Change inode number of directory entry
- * @dip: The GFS inode
- * @filename:
- * @new_inode:
- *
- * This routine changes the inode number of a directory entry.  It's used
- * by rename to change ".." when a directory is moved.
- * Assumes a glock is held on dvp.
- *
- * Returns: errno
- */
-
-int
-gfs_dir_mvino(struct gfs_inode *dip, struct qstr *filename,
-	      struct gfs_inum *inum, unsigned int new_type)
-{
-	int error;
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_mvino(dip, filename, inum, new_type);
-	else
-		error = dir_l_mvino(dip, filename, inum, new_type);
-
-	return error;
-}
-
-/**
- * foreach_leaf - call a function for each leaf in a directory
- * @dip: the directory
- * @lc: the function to call for each each
- * @data: private data to pass to it
- *
- * Returns: errno
- */
-
-static int
-foreach_leaf(struct gfs_inode *dip, leaf_call_t lc, void *data)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct buffer_head *bh;
-	struct gfs_leaf leaf;
-	uint32_t hsize, len;
-	uint32_t ht_offset, lp_offset, ht_offset_cur = -1;
-	uint32_t index = 0;
-	uint64_t *lp;
-	uint64_t leaf_no;
-	int error = 0;
-
-	hsize = 1 << dip->i_di.di_depth;
-	if (hsize * sizeof(uint64_t) != dip->i_di.di_size) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	lp = kmalloc(sdp->sd_hash_bsize, GFP_KERNEL);
-	if (!lp)
-		return -ENOMEM;
-
-	while (index < hsize) {
-		lp_offset = index & (sdp->sd_hash_ptrs - 1);
-		ht_offset = index - lp_offset;
-
-		if (ht_offset_cur != ht_offset) {
-			error = gfs_internal_read(dip, (char *)lp,
-						  ht_offset * sizeof(uint64_t),
-						  sdp->sd_hash_bsize);
-			if (error != sdp->sd_hash_bsize) {
-				if (error >= 0)
-					error = -EIO;
-				goto out;
-			}
-			ht_offset_cur = ht_offset;
-		}
-
-		leaf_no = gfs64_to_cpu(lp[lp_offset]);
-		if (leaf_no) {
-			error = get_leaf(dip, leaf_no, &bh);
-			if (error)
-				goto out;
-			gfs_leaf_in(&leaf, bh->b_data);
-			brelse(bh);
-
-			len = 1 << (dip->i_di.di_depth - leaf.lf_depth);
-
-			error = lc(dip, index, len, leaf_no, data);
-			if (error)
-				goto out;
-
-			index = (index & ~(len - 1)) + len;
-		} else
-			index++;
-	}
-
-	if (index != hsize) {
-		gfs_consist_inode(dip);
-		error = -EIO;
-	}
-
- out:
-	kfree(lp);
-
-	return error;
-}
-
-/**
- * leaf_free - Deallocate a directory leaf
- * @dip: the directory
- * @index: the hash table offset in the directory
- * @len: the number of pointers to this leaf
- * @leaf_no: the leaf number
- * @data: not used
- *
- * Returns: errno
- */
-
-static int
-leaf_free(struct gfs_inode *dip,
-	  uint32_t index, uint32_t len,
-	  uint64_t leaf_no, void *data)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_leaf tmp_leaf;
-	struct gfs_rgrp_list rlist;
-	struct buffer_head *bh, *dibh;
-	uint64_t blk;
-	unsigned int rg_blocks = 0;
-	char *ht=0;
-	unsigned int x, size = len * sizeof(uint64_t);
-	int error;
-
-	memset(&rlist, 0, sizeof(struct gfs_rgrp_list));
-
-	gfs_alloc_get(dip);
-
-	error = gfs_quota_hold_m(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out;
-
-	error = gfs_rindex_hold(sdp, &dip->i_alloc->al_ri_gh);
-	if (error)
-		goto out_qs;
-
-	/*  Count the number of leaves  */
-
-	for (blk = leaf_no; blk; blk = tmp_leaf.lf_next) {
-		error = get_leaf(dip, blk, &bh);
-		if (error)
-			goto out_rlist;
-		gfs_leaf_in(&tmp_leaf, (bh)->b_data);
-		brelse(bh);
-
-		gfs_rlist_add(sdp, &rlist, blk);
-	}
-
-	gfs_rlist_alloc(&rlist, LM_ST_EXCLUSIVE, 0);
-
-	for (x = 0; x < rlist.rl_rgrps; x++) {
-		struct gfs_rgrpd *rgd;
-		rgd = get_gl2rgd(rlist.rl_ghs[x].gh_gl);
-		rg_blocks += rgd->rd_ri.ri_length;
-	}
-
-	error = gfs_glock_nq_m(rlist.rl_rgrps, rlist.rl_ghs);
-	if (error)
-		goto out_rlist;
-
-	/* Trans may require:
-	   All the bitmaps that were reserved.
-	   One block for the dinode.
-	   All the hash blocks that will be changed.
-	   One block for a quota change. */
-
-	error = gfs_trans_begin(sdp,
-				rg_blocks + 1 + (DIV_RU(size, sdp->sd_jbsize) + 1),
-				1);
-	if (error)
-		goto out_rg_gunlock;
-
-	for (blk = leaf_no; blk; blk = tmp_leaf.lf_next) {
-		error = get_leaf(dip, blk, &bh);
-		if (error)
-			goto out_end_trans;
-		gfs_leaf_in(&tmp_leaf, bh->b_data);
-		brelse(bh);
-
-		gfs_metafree(dip, blk, 1);
-
-		if (!dip->i_di.di_blocks)
-			gfs_consist_inode(dip);
-		dip->i_di.di_blocks--;
-	}
-
-	error = gfs_writei(dip, ht, index * sizeof (uint64_t), size, gfs_zero_blocks, NULL);
-
-	if (error != size) {
-		if (error >= 0)
-			error = -EIO;
-		goto out_end_trans;
-	}
-
-	error = gfs_get_inode_buffer(dip, &dibh);
-	if (error)
-		goto out_end_trans;
-
-	gfs_trans_add_bh(dip->i_gl, dibh);
-	gfs_dinode_out(&dip->i_di, dibh->b_data);
-	brelse(dibh);
-
- out_end_trans:
-	gfs_trans_end(sdp);
-
- out_rg_gunlock:
-	gfs_glock_dq_m(rlist.rl_rgrps, rlist.rl_ghs);
-
- out_rlist:
-	gfs_rlist_free(&rlist);
-	gfs_glock_dq_uninit(&dip->i_alloc->al_ri_gh);
-
- out_qs:
-	gfs_quota_unhold_m(dip);
-
- out:
-	gfs_alloc_put(dip);
-
-	return error;
-}
-
-/**
- * gfs_dir_exhash_free - free all the leaf blocks in a directory
- * @dip: the directory
- *
- * Dealloc all on-disk directory leaves to FREEMETA state
- * Change on-disk inode type to "regular file"
- *
- * Returns: errno
- */
-
-int
-gfs_dir_exhash_free(struct gfs_inode *dip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct buffer_head *bh;
-	int error;
-
-	/* Dealloc on-disk leaves to FREEMETA state */
-	error = foreach_leaf(dip, leaf_free, NULL);
-	if (error)
-		return error;
-
-	/*  Make this a regular file in case we crash.
-	   (We don't want to free these blocks a second time.)  */
-
-	error = gfs_trans_begin(sdp, 1, 0);
-	if (error)
-		return error;
-
-	error = gfs_get_inode_buffer(dip, &bh);
-	if (!error) {
-		gfs_trans_add_bh(dip->i_gl, bh);
-		((struct gfs_dinode *)bh->b_data)->di_type = cpu_to_gfs16(GFS_FILE_REG);
-		brelse(bh);
-	}
-
-	gfs_trans_end(sdp);
-
-	return error;
-}
-
-/**
- * gfs_diradd_alloc_required - figure out if an entry addition is going to require an allocation
- * @ip: the file being written to
- * @filname: the filename that's going to be added
- * @alloc_required: the int is set to TRUE if an alloc is required, FALSE otherwise
- *
- * Returns: errno
- */
-
-int
-gfs_diradd_alloc_required(struct gfs_inode *dip, struct qstr *filename,
-			  int *alloc_required)
-{
-	struct buffer_head *bh = NULL, *bh_next;
-	uint32_t hsize, hash, index;
-	int error = 0;
-
-	*alloc_required = FALSE;
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH) {
-		hsize = 1 << dip->i_di.di_depth;
-		if (hsize * sizeof(uint64_t) != dip->i_di.di_size) {
-			gfs_consist_inode(dip);
-			return -EIO;
-		}
-
-		hash = gfs_dir_hash(filename->name, filename->len);
-		index = hash >> (32 - dip->i_di.di_depth);
-
-		error = get_first_leaf(dip, index, &bh_next);
-		if (error)
-			return error;
-
-		do {
-			if (bh)
-				brelse(bh);
-
-			bh = bh_next;
-
-			if (dirent_fits(dip, bh, filename->len))
-				break;
-
-			error = get_next_leaf(dip, bh, &bh_next);
-			if (error == -ENOENT) {
-				*alloc_required = TRUE;
-				error = 0;
-				break;
-			}
-		}
-		while (!error);
-
-		brelse(bh);
-	} else {
-		error = gfs_get_inode_buffer(dip, &bh);
-		if (error)
-			return error;
-
-		if (!dirent_fits(dip, bh, filename->len))
-			*alloc_required = TRUE;
-
-		brelse(bh);
-	}
-
-	return error;
-}
-
-/**
- * do_gdm - copy out one leaf (or list of leaves)
- * @dip: the directory
- * @index: the hash table offset in the directory
- * @len: the number of pointers to this leaf
- * @leaf_no: the leaf number
- * @data: a pointer to a struct gfs_user_buffer structure
- *
- * Returns: errno
- */
-
-static int
-do_gdm(struct gfs_inode *dip,
-       uint32_t index, uint32_t len, uint64_t leaf_no,
-       void *data)
-{
-	struct gfs_user_buffer *ub = (struct gfs_user_buffer *)data;
-	struct gfs_leaf leaf;
-	struct buffer_head *bh;
-	uint64_t blk;
-	int error = 0;
-
-	for (blk = leaf_no; blk; blk = leaf.lf_next) {
-		error = get_leaf(dip, blk, &bh);
-		if (error)
-			break;
-
-		gfs_leaf_in(&leaf, bh->b_data);
-
-		error = gfs_add_bh_to_ub(ub, bh);
-
-		brelse(bh);
-
-		if (error)
-			break;
-	}
-
-	return error;
-}
-
-/**
- * gfs_get_dir_meta - return all the leaf blocks of a directory
- * @dip: the directory
- * @ub: the structure representing the meta
- *
- * Returns: errno
- */
-
-int
-gfs_get_dir_meta(struct gfs_inode *dip, struct gfs_user_buffer *ub)
-{
-	return foreach_leaf(dip, do_gdm, ub);
-}
diff --git a/gfs-kernel/src/gfs/dir.h b/gfs-kernel/src/gfs/dir.h
deleted file mode 100644
index bbde532..0000000
--- a/gfs-kernel/src/gfs/dir.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __DIR_DOT_H__
-#define __DIR_DOT_H__
-
-/**
- * gfs_filldir_t - Report a directory entry to the caller of gfs_dir_read()
- * @opaque: opaque data used by the function
- * @name: the name of the directory entry
- * @length: the length of the name
- * @offset: the entry's offset in the directory
- * @inum: the inode number the entry points to
- * @type: the type of inode the entry points to
- *
- * Returns: 0 on success, 1 if buffer full
- */
-
-typedef int (*gfs_filldir_t) (void *opaque,
-			      const char *name, unsigned int length,
-			      uint64_t offset,
-			      struct gfs_inum *inum, unsigned int type);
-
-int gfs_filecmp(struct qstr *file1, char *file2, int len_of_file2);
-int gfs_dirent_alloc(struct gfs_inode *dip, struct buffer_head *bh,
-		     int name_len, struct gfs_dirent **dent_out);
-
-int gfs_dir_search(struct gfs_inode *dip, struct qstr *filename,
-		   struct gfs_inum *inum, unsigned int *type);
-int gfs_dir_add(struct gfs_inode *dip, struct qstr *filename,
-		struct gfs_inum *inum, unsigned int type);
-int gfs_dir_del(struct gfs_inode *dip, struct qstr *filename);
-int gfs_dir_read(struct gfs_inode *dip, uint64_t * offset, void *opaque,
-		 gfs_filldir_t filldir);
-int gfs_dir_mvino(struct gfs_inode *dip, struct qstr *filename,
-		  struct gfs_inum *new_inum, unsigned int new_type);
-
-int gfs_dir_exhash_free(struct gfs_inode *dip);
-
-int gfs_diradd_alloc_required(struct gfs_inode *dip, struct qstr *filename,
-			      int *alloc_required);
-
-int gfs_get_dir_meta(struct gfs_inode *ip, struct gfs_user_buffer *ub);
-
-#endif /* __DIR_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/eaops.c b/gfs-kernel/src/gfs/eaops.c
deleted file mode 100644
index dbd0254..0000000
--- a/gfs-kernel/src/gfs/eaops.c
+++ /dev/null
@@ -1,173 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-#include <linux/xattr.h>
-#include <linux/posix_acl.h>
-
-#include "gfs.h"
-#include "acl.h"
-#include "eaops.h"
-#include "eattr.h"
-
-/**
- * gfs_ea_name2type - get the type of the ea, and trucate the type from the name
- * @namep: ea name, possibly with type appended
- *
- * Returns: GFS_EATYPE_XXX
- */
-
-unsigned int
-gfs_ea_name2type(const char *name, char **truncated_name)
-{
-	unsigned int type;
-
-	if (strncmp(name, "system.", 7) == 0) {
-		type = GFS_EATYPE_SYS;
-		if (truncated_name)
-			*truncated_name = strchr(name, '.') + 1;
-	} else if (strncmp(name, "user.", 5) == 0) {
-		type = GFS_EATYPE_USR;
-		if (truncated_name)
-			*truncated_name = strchr(name, '.') + 1;
-	} else if (strncmp(name, "security.", 9) == 0) {
-		type = GFS_EATYPE_SECURITY;
-		if (truncated_name)
-			*truncated_name = strchr(name, '.') + 1;
-	} else {
-		type = GFS_EATYPE_UNUSED;
-		if (truncated_name)
-			*truncated_name = NULL;
-	}
-
-	return type;
-}
-
-/**
- * system_eo_get -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-static int
-system_eo_get(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	if (!GFS_ACL_IS_ACCESS(er->er_name, er->er_name_len) &&
-	    !GFS_ACL_IS_DEFAULT(er->er_name, er->er_name_len) &&
-	    !capable(CAP_SYS_ADMIN))
-		return -EPERM;
-
-	if (ip->i_sbd->sd_args.ar_posix_acls == FALSE &&
-	    (GFS_ACL_IS_ACCESS(er->er_name, er->er_name_len) ||
-	     GFS_ACL_IS_DEFAULT(er->er_name, er->er_name_len)))
-		return -EOPNOTSUPP;
-
-	return gfs_ea_get_i(ip, er);	
-}
-
-/**
- * system_eo_set -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-static int
-system_eo_set(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	int remove = FALSE;
-	int error;
-
-	if (GFS_ACL_IS_ACCESS(er->er_name, er->er_name_len)) {
-		er->er_mode = ip->i_vnode->i_mode;
-		error = gfs_acl_validate_set(ip, TRUE, er,
-					     &remove, &er->er_mode);
-		if (error)
-			return error;
-		error = gfs_ea_set_i(ip, er);
-		if (error)
-			return error;
-		if (remove)
-			gfs_ea_remove_i(ip, er);
-		return 0;
-
-	} else if (GFS_ACL_IS_DEFAULT(er->er_name, er->er_name_len)) {
-		int error = gfs_acl_validate_set(ip, FALSE, er,
-						 &remove, NULL);
-		if (error)
-			return error;
-		if (!remove)
-			error = gfs_ea_set_i(ip, er);
-		else {
-			error = gfs_ea_remove_i(ip, er);
-			if (error == -ENODATA)
-				error = 0;
-		}
-		return error;
-	}
-
-	return -EPERM;
-}
-
-/**
- * system_eo_remove -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-static int
-system_eo_remove(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	if (GFS_ACL_IS_ACCESS(er->er_name, er->er_name_len)) {
-		int error = gfs_acl_validate_remove(ip, TRUE);
-		if (error)
-			return error;
-
-	} else if (GFS_ACL_IS_DEFAULT(er->er_name, er->er_name_len)) {
-		int error = gfs_acl_validate_remove(ip, FALSE);
-		if (error)
-			return error;
-
-	} else
-	        return -EPERM;
-
-	return gfs_ea_remove_i(ip, er);	
-}
-
-struct gfs_eattr_operations gfs_user_eaops = {
-	.eo_get = gfs_ea_get_i,
-	.eo_set = gfs_ea_set_i,
-	.eo_remove = gfs_ea_remove_i,
-	.eo_name = "user",
-};
-
-struct gfs_eattr_operations gfs_system_eaops = {
-	.eo_get = system_eo_get,
-	.eo_set = system_eo_set,
-	.eo_remove = system_eo_remove,
-	.eo_name = "system",
-};
-
-struct gfs_eattr_operations gfs_security_eaops = {
-	.eo_get = gfs_ea_get_i,
-	.eo_set = gfs_ea_set_i,
-	.eo_remove = gfs_ea_remove_i,
-	.eo_name = "security",
-};
-
-struct gfs_eattr_operations *gfs_ea_ops[] = {
-	NULL,
-	&gfs_user_eaops,
-	&gfs_system_eaops,
-	&gfs_security_eaops,
-};
-
diff --git a/gfs-kernel/src/gfs/eaops.h b/gfs-kernel/src/gfs/eaops.h
deleted file mode 100644
index 6ea9123..0000000
--- a/gfs-kernel/src/gfs/eaops.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __EAOPS_DOT_H__
-#define __EAOPS_DOT_H__
-
-struct gfs_ea_request;
-
-struct gfs_eattr_operations {
-	int (*eo_get) (struct gfs_inode *ip, struct gfs_ea_request *er);
-	int (*eo_set) (struct gfs_inode *ip, struct gfs_ea_request *er);
-	int (*eo_remove) (struct gfs_inode *ip, struct gfs_ea_request *er);
-	char *eo_name;
-};
-
-unsigned int gfs_ea_name2type(const char *name, char **truncated_name);
-
-extern struct gfs_eattr_operations gfs_user_eaops;
-extern struct gfs_eattr_operations gfs_system_eaops;
-
-extern struct gfs_eattr_operations *gfs_ea_ops[];
-
-#endif /* __EAOPS_DOT_H__ */
-
diff --git a/gfs-kernel/src/gfs/eattr.c b/gfs-kernel/src/gfs/eattr.c
deleted file mode 100644
index 71f7e70..0000000
--- a/gfs-kernel/src/gfs/eattr.c
+++ /dev/null
@@ -1,2007 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-#include <linux/xattr.h>
-#include <linux/posix_acl.h>
-
-#include "gfs.h"
-#include "acl.h"
-#include "dio.h"
-#include "eaops.h"
-#include "eattr.h"
-#include "glock.h"
-#include "inode.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-
-/**
- * ea_calc_size - returns the acutal number of bytes the request will take up
- *                (not counting any unstuffed data blocks)
- * @sdp:
- * @er:
- * @size:
- *
- * Returns: TRUE if the EA should be stuffed
- */
-
-static int
-ea_calc_size(struct gfs_sbd *sdp,
-	    struct gfs_ea_request *er,
-	    unsigned int *size)
-{
-	*size = GFS_EAREQ_SIZE_STUFFED(er);
-	if (*size <= sdp->sd_jbsize)
-		return TRUE;
-
-	*size = GFS_EAREQ_SIZE_UNSTUFFED(sdp, er);
-	return FALSE;
-}
-
-/**
- * gfs_ea_check_size - 
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_check_size(struct gfs_sbd *sdp, struct gfs_ea_request *er)
-{
-	unsigned int size;
-
-	if (er->er_data_len > GFS_EA_MAX_DATA_LEN)
-		return -ERANGE;
-
-	ea_calc_size(sdp, er, &size);
-	if (size > sdp->sd_jbsize)
-		return -ERANGE; /* This can only happen with 512 byte blocks */
-
-	return 0;
-}
-
-typedef int (*ea_call_t) (struct gfs_inode *ip,
-			  struct buffer_head *bh,
-			  struct gfs_ea_header *ea,
-			  struct gfs_ea_header *prev,
-			  void *private);
-
-/**
- * ea_foreach_i -
- * @ip:
- * @bh:
- * @eabc:
- * @data:
- *
- * Returns: errno
- */
-
-static int
-ea_foreach_i(struct gfs_inode *ip,
-	     struct buffer_head *bh,
-	     ea_call_t ea_call, void *data)
-{
-	struct gfs_ea_header *ea, *prev = NULL;
-	int error = 0;
-
-	if (gfs_metatype_check(ip->i_sbd, bh, GFS_METATYPE_EA))
-		return -EIO;
-
-	for (ea = GFS_EA_BH2FIRST(bh);; prev = ea, ea = GFS_EA2NEXT(ea)) {
-		if (!GFS_EA_REC_LEN(ea))
-			goto fail;
-		if (!(bh->b_data <= (char *)ea &&
-		      (char *)GFS_EA2NEXT(ea) <=
-		      bh->b_data + bh->b_size))
-			goto fail;
-		if (!GFS_EATYPE_VALID(ea->ea_type))
-			goto fail;
-
-		error = ea_call(ip, bh, ea, prev, data);
-		if (error)
-			return error;
-
-		if (GFS_EA_IS_LAST(ea)) {
-			if ((char *)GFS_EA2NEXT(ea) !=
-			    bh->b_data + bh->b_size)
-				goto fail;
-			break;
-		}
-	}
-
-	return error;
-
- fail:
-	gfs_consist_inode(ip);
-	return -EIO;
-}
-
-/**
- * ea_foreach -
- * @ip:
- * @ea_call:
- * @data:
- *
- * Returns: errno
- */
-
-static int
-ea_foreach(struct gfs_inode *ip,
-	   ea_call_t ea_call,
-	   void *data)
-{
-	struct buffer_head *bh;
-	int error;
-
-	error = gfs_dread(ip->i_gl, ip->i_di.di_eattr,
-			  DIO_START | DIO_WAIT, &bh);
-	if (error)
-		return error;
-
-	if (!(ip->i_di.di_flags & GFS_DIF_EA_INDIRECT))
-		error = ea_foreach_i(ip, bh, ea_call, data);
-	else {
-		struct buffer_head *eabh;
-		uint64_t *eablk, *end;
-
-		if (gfs_metatype_check(ip->i_sbd, bh, GFS_METATYPE_IN)) {
-			error = -EIO;
-			goto out;
-		}
-
-		eablk = (uint64_t *)(bh->b_data + sizeof(struct gfs_indirect));
-		end = eablk + ip->i_sbd->sd_inptrs;
-
-		for (; eablk < end; eablk++) {
-			uint64_t bn;
-
-			if (!*eablk)
-				break;
-			bn = gfs64_to_cpu(*eablk);
-
-			error = gfs_dread(ip->i_gl, bn,
-					  DIO_START | DIO_WAIT, &eabh);
-			if (error)
-				break;
-			error = ea_foreach_i(ip, eabh, ea_call, data);
-			brelse(eabh);
-			if (error)
-				break;
-		}
-	}
-
- out:
-	brelse(bh);
-
-	return error;
-}
-
-struct ea_find {
-	struct gfs_ea_request *ef_er;
-	struct gfs_ea_location *ef_el;
-};
-
-/**
- * ea_find_i -
- * @ip:
- * @bh:
- * @ea:
- * @prev:
- * @private:
- *
- * Returns: -errno on error, 1 if search is over,
- *          0 if search should continue
- */
-
-static int
-ea_find_i(struct gfs_inode *ip,
-	  struct buffer_head *bh,
-	  struct gfs_ea_header *ea,
-	  struct gfs_ea_header *prev,
-	  void *private)
-{
-	struct ea_find *ef = (struct ea_find *)private;
-	struct gfs_ea_request *er = ef->ef_er;
-
-	if (ea->ea_type == GFS_EATYPE_UNUSED)
-		return 0;
-
-	if (ea->ea_type == er->er_type) {
-		if (ea->ea_name_len == er->er_name_len &&
-		    !memcmp(GFS_EA2NAME(ea), er->er_name, ea->ea_name_len)) {
-			struct gfs_ea_location *el = ef->ef_el;
-			get_bh(bh);
-			el->el_bh = bh;
-			el->el_ea = ea;
-			el->el_prev = prev;
-			return 1;
-		}
-	}
-
-#if 0
-	else if ((ip->i_di.di_flags & GFS_DIF_EA_PACKED) &&
-		 er->er_type == GFS_EATYPE_SYS)
-		return 1;
-#endif
-
-	return 0;
-}
-
-/**
- * gfs_ea_find - find a matching eattr
- * @ip:
- * @er:
- * @el:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_find(struct gfs_inode *ip,
-	    struct gfs_ea_request *er,
-	    struct gfs_ea_location *el)
-{
-	struct ea_find ef;
-	int error;
-
-	ef.ef_er = er;
-	ef.ef_el = el;
-
-	memset(el, 0, sizeof(struct gfs_ea_location));
-
-	error = ea_foreach(ip, ea_find_i, &ef);
-	if (error > 0)
-		return 0;
-
-	return error;
-}
-
-/**
- * ea_dealloc_unstuffed -
- * @ip:
- * @bh:
- * @ea:
- * @prev:
- * @private:
- *
- * Take advantage of the fact that all unstuffed blocks are
- * allocated from the same RG.  But watch, this may not always
- * be true.
- *
- * Returns: errno
- */
-
-static int
-ea_dealloc_unstuffed(struct gfs_inode *ip,
-		     struct buffer_head *bh,
-		     struct gfs_ea_header *ea,
-		     struct gfs_ea_header *prev,
-		     void *private)
-{
-	int *leave = (int *)private;
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd;
-	struct gfs_holder rg_gh;
-	struct buffer_head *dibh;
-	uint64_t *dataptrs, bn = 0;
-	uint64_t bstart = 0;
-	unsigned int blen = 0;
-	unsigned int x;
-	int error;
-
-	if (GFS_EA_IS_STUFFED(ea))
-		return 0;
-
-	dataptrs = GFS_EA2DATAPTRS(ea);
-	for (x = 0; x < ea->ea_num_ptrs; x++, dataptrs++)
-		if (*dataptrs) {
-			bn = gfs64_to_cpu(*dataptrs);
-			break;
-		}
-	if (!bn)
-		return 0;
-
-	rgd = gfs_blk2rgrpd(sdp, bn);
-	if (!rgd) {
-		gfs_consist_inode(ip);
-		return -EIO;
-	}
-
-	error = gfs_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &rg_gh);
-	if (error)
-		return error;
-
-	error = gfs_trans_begin(sdp, 2 + rgd->rd_ri.ri_length, 1);
-	if (error)
-		goto out_gunlock;
-
-	gfs_trans_add_bh(ip->i_gl, bh);
-
-	dataptrs = GFS_EA2DATAPTRS(ea);
-	for (x = 0; x < ea->ea_num_ptrs; x++, dataptrs++) {
-		if (!*dataptrs)
-			break;
-		bn = gfs64_to_cpu(*dataptrs);
-
-		if (bstart + blen == bn)
-			blen++;
-		else {
-			if (bstart)
-				gfs_metafree(ip, bstart, blen);
-			bstart = bn;
-			blen = 1;
-		}
-
-		*dataptrs = 0;
-		if (!ip->i_di.di_blocks)
-			gfs_consist_inode(ip);
-		ip->i_di.di_blocks--;
-	}
-	if (bstart)
-		gfs_metafree(ip, bstart, blen);
-
-	if (prev && !leave) {
-		uint32_t len;
-
-		len = GFS_EA_REC_LEN(prev) + GFS_EA_REC_LEN(ea);
-		prev->ea_rec_len = cpu_to_gfs32(len);
-
-		if (GFS_EA_IS_LAST(ea))
-			prev->ea_flags |= GFS_EAFLAG_LAST;
-	} else {
-		ea->ea_type = GFS_EATYPE_UNUSED;
-		ea->ea_num_ptrs = 0;
-	}
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		ip->i_di.di_ctime = get_seconds();
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	gfs_trans_end(sdp);
-
- out_gunlock:
-	gfs_glock_dq_uninit(&rg_gh);
-
-	return error;
-}
-
-/**
- * ea_remove_unstuffed -
- * @ip:
- * @bh:
- * @ea:
- * @prev:
- * @leave:
- *
- * Returns: errno
- */
-
-static int
-ea_remove_unstuffed(struct gfs_inode *ip,
-		    struct buffer_head *bh,
-		    struct gfs_ea_header *ea,
-		    struct gfs_ea_header *prev,
-		    int leave)
-{
-	struct gfs_alloc *al;
-	int error;
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_hold_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out_alloc;
-
-	error = gfs_rindex_hold(ip->i_sbd, &al->al_ri_gh);
-	if (error)
-		goto out_quota;
-
-	error = ea_dealloc_unstuffed(ip,
-				     bh, ea, prev,
-				     (leave) ? &error : NULL);
-
-	gfs_glock_dq_uninit(&al->al_ri_gh);
-
- out_quota:
-	gfs_quota_unhold_m(ip);
-
- out_alloc:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**************************************************************************************************/
-
-/**
- * gfs_ea_repack_i -
- * @ip:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_repack_i(struct gfs_inode *ip)
-{
-	return -ENOSYS;
-}
-
-/**
- * gfs_ea_repack -
- * @ip:
- *
- * Returns: errno
- */
-
-int gfs_ea_repack(struct gfs_inode *ip)
-{
-	struct gfs_holder gh;
-	int error;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
-	if (error)
-		return error;
-
-	/* Some sort of permissions checking would be nice */
-
-	error = gfs_ea_repack_i(ip);
-
-	gfs_glock_dq_uninit(&gh);
-
-	return error;
-}
-
-struct ea_list {
-	struct gfs_ea_request *ei_er;
-	unsigned int ei_size;
-};
-
-/**
- * ea_list_i -
- * @ip:
- * @bh:
- * @ea:
- * @prev:
- * @private:
- *
- * Returns: errno
- */
-
-static int
-ea_list_i(struct gfs_inode *ip,
-	  struct buffer_head *bh,
-	  struct gfs_ea_header *ea,
-	  struct gfs_ea_header *prev,
-	  void *private)
-{
-	struct ea_list *ei = (struct ea_list *)private;
-	struct gfs_ea_request *er = ei->ei_er;
-	unsigned int ea_size = gfs_ea_strlen(ea);
-
-	if (ea->ea_type == GFS_EATYPE_UNUSED)
-		return 0;
-
-	if (er->er_data_len) {
-		char *prefix;
-		unsigned int l;
-		char c = 0;
-
-		if (ei->ei_size + ea_size > er->er_data_len)
-			return -ERANGE;
-
-		switch (ea->ea_type) {
-		case GFS_EATYPE_USR:
-			prefix = "user.";
-			l = 5;
-			break;
-		case GFS_EATYPE_SYS:
-			prefix = "system.";
-			l = 7;
-			break;
-		case GFS_EATYPE_SECURITY:
-			prefix = "security.";
-			l = 9;
-			break;
-		default:
-			prefix = NULL;
-			l = 0;
-			break;
-		}
-
-		if (prefix == NULL || l == 0)
-			return -EIO;
-
-		memcpy(er->er_data + ei->ei_size,
-		       prefix, l);
-		memcpy(er->er_data + ei->ei_size + l,
-		       GFS_EA2NAME(ea),
-		       ea->ea_name_len);
-		memcpy(er->er_data + ei->ei_size +
-		       ea_size - 1,
-		       &c, 1);
-	}
-
-	ei->ei_size += ea_size;
-
-	return 0;
-}
-
-/**
- * gfs_ea_list -
- * @ip:
- * @er:
- *
- * Returns: actual size of data on success, -errno on error
- */
-
-int
-gfs_ea_list(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	if (!er->er_data || !er->er_data_len) {
-		er->er_data = NULL;
-		er->er_data_len = 0;
-	}
-
-	error = gfs_glock_nq_init(ip->i_gl,
-				  LM_ST_SHARED, LM_FLAG_ANY,
-				  &i_gh);
-	if (error)
-		return error;
-
-	if (ip->i_di.di_eattr) {
-		struct ea_list ei = { .ei_er = er, .ei_size = 0 };
-
-		error = ea_foreach(ip, ea_list_i, &ei);
-		if (!error)
-			error = ei.ei_size;
-	}
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * ea_get_unstuffed - actually copies the unstuffed data into the
- *                    request buffer
- * @ip:
- * @ea:
- * @data:
- *
- * Returns: errno
- */
-
-static int
-ea_get_unstuffed(struct gfs_inode *ip, struct gfs_ea_header *ea,
-		 char *data)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head **bh;
-	unsigned int amount = GFS_EA_DATA_LEN(ea);
-	unsigned int nptrs = DIV_RU(amount, sdp->sd_jbsize);
-	uint64_t *dataptrs = GFS_EA2DATAPTRS(ea);
-	unsigned int x;
-	int error = 0;
-
-	bh = kmalloc(nptrs * sizeof(struct buffer_head *), GFP_NOFS);
-	if (!bh)
-		return -ENOMEM;
-
-	for (x = 0; x < nptrs; x++) {
-		error = gfs_dread(ip->i_gl, gfs64_to_cpu(*dataptrs),
-				  DIO_START, bh + x);
-		if (error) {
-			while (x--)
-				brelse(bh[x]);
-			goto out;
-		}
-		dataptrs++;
-	}
-
-	for (x = 0; x < nptrs; x++) {
-		error = gfs_dreread(sdp, bh[x], DIO_WAIT);
-		if (error) {
-			for (; x < nptrs; x++)
-				brelse(bh[x]);
-			goto out;
-		}
-		if (gfs_metatype_check2(sdp, bh[x],
-					GFS_METATYPE_ED, GFS_METATYPE_EA)) {
-			for (; x < nptrs; x++)
-				brelse(bh[x]);
-			error = -EIO;
-			goto out;
-		}
-
-		memcpy(data,
-		       bh[x]->b_data + sizeof(struct gfs_meta_header),
-		       (sdp->sd_jbsize > amount) ? amount : sdp->sd_jbsize);
-
-		amount -= sdp->sd_jbsize;
-		data += sdp->sd_jbsize;
-
-		brelse(bh[x]);
-	}
-
- out:
-	kfree(bh);
-
-	return error;
-}
-
-/**
- * gfs_ea_get_copy -
- * @ip:
- * @el:
- * @data:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_get_copy(struct gfs_inode *ip,
-		struct gfs_ea_location *el,
-		char *data)
-{
-	if (GFS_EA_IS_STUFFED(el->el_ea)) {
-		memcpy(data,
-		       GFS_EA2DATA(el->el_ea),
-		       GFS_EA_DATA_LEN(el->el_ea));
-		return 0;
-	} else
-		return ea_get_unstuffed(ip, el->el_ea, data);
-}
-
-/**
- * gfs_ea_get_i -
- * @ip:
- * @er:
- *
- * Returns: actual size of data on success, -errno on error
- */
-
-int
-gfs_ea_get_i(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_ea_location el;
-	int error;
-
-	if (!ip->i_di.di_eattr)
-		return -ENODATA;
-
-	error = gfs_ea_find(ip, er, &el);
-	if (error)
-		return error;
-	if (!el.el_ea)
-		return -ENODATA;
-
-	if (er->er_data_len) {
-		if (GFS_EA_DATA_LEN(el.el_ea) > er->er_data_len)
-			error =  -ERANGE;
-		else
-			error = gfs_ea_get_copy(ip, &el, er->er_data);
-	}
-	if (!error)
-		error = GFS_EA_DATA_LEN(el.el_ea);
-
-	brelse(el.el_bh);
-
-	return error;
-}
-
-/**
- * gfs_ea_get -
- * @ip:
- * @er:
- *
- * Returns: actual size of data on success, -errno on error
- */
-
-int
-gfs_ea_get(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	if (!er->er_name_len ||
-	    er->er_name_len > GFS_EA_MAX_NAME_LEN)
-		return -EINVAL;
-	if (!er->er_data || !er->er_data_len) {
-		er->er_data = NULL;
-		er->er_data_len = 0;
-	}
-
-	error = gfs_glock_nq_init(ip->i_gl,
-				  LM_ST_SHARED, LM_FLAG_ANY,
-				  &i_gh);
-	if (error)
-		return error;
-
-	error = gfs_ea_ops[er->er_type]->eo_get(ip, er);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * ea_alloc_blk - allocates a new block for extended attributes.
- * @ip: A pointer to the inode that's getting extended attributes
- * @bhp:
- *
- * Returns: errno
- */
-
-static int
-ea_alloc_blk(struct gfs_inode *ip,
-	     struct buffer_head **bhp)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_ea_header *ea;
-	uint64_t block;
-	int error;
-
-	error = gfs_metaalloc(ip, &block);
-	if (error)
-		return error;
-
-	error = gfs_dread(ip->i_gl, block,
-			  DIO_NEW | DIO_START | DIO_WAIT, bhp);
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(ip->i_gl, *bhp);
-	gfs_metatype_set(*bhp, GFS_METATYPE_EA, GFS_FORMAT_EA);
-
-	ea = GFS_EA_BH2FIRST(*bhp);
-	ea->ea_rec_len = cpu_to_gfs32(sdp->sd_jbsize);
-	ea->ea_type = GFS_EATYPE_UNUSED;
-	ea->ea_flags = GFS_EAFLAG_LAST;
-	ea->ea_num_ptrs = 0;
-
-	ip->i_di.di_blocks++;
-
-	return 0;
-}
-
-/**
- * ea_write - writes the request info to an ea, creating new blocks if
- *            necessary
- * @ip:  inode that is being modified
- * @ea:  the location of the new ea in a block
- * @er: the write request
- *
- * Note: does not update ea_rec_len or the GFS_EAFLAG_LAST bin of ea_flags
- *
- * returns : errno
- */
-
-static int
-ea_write(struct gfs_inode *ip,
-	 struct gfs_ea_header *ea,
-	 struct gfs_ea_request *er)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-
-	ea->ea_data_len = cpu_to_gfs32(er->er_data_len);
-	ea->ea_name_len = er->er_name_len;
-	ea->ea_type = er->er_type;
-	ea->ea_pad = 0;
-
-	memcpy(GFS_EA2NAME(ea), er->er_name, er->er_name_len);
-
-	if (GFS_EAREQ_SIZE_STUFFED(er) <= sdp->sd_jbsize) {
-		ea->ea_num_ptrs = 0;
-		memcpy(GFS_EA2DATA(ea), er->er_data, er->er_data_len);
-	} else {
-		uint64_t *dataptr = GFS_EA2DATAPTRS(ea);
-		const char *data = er->er_data;
-		unsigned int data_len = er->er_data_len;
-		unsigned int copy;
-		unsigned int x;
-
-		ea->ea_num_ptrs = DIV_RU(er->er_data_len, sdp->sd_jbsize);
-		for (x = 0; x < ea->ea_num_ptrs; x++) {
-			struct buffer_head *bh;
-			uint64_t block;
-			int error;
-
-			error = gfs_metaalloc(ip, &block);
-			if (error)
-				return error;
-
-			error = gfs_dread(ip->i_gl, block,
-					  DIO_NEW | DIO_START | DIO_WAIT, &bh);
-			if (error)
-				return error;
-
-			gfs_trans_add_bh(ip->i_gl, bh);
-			gfs_metatype_set(bh, GFS_METATYPE_ED, GFS_FORMAT_ED);
-			ip->i_di.di_blocks++;
-
-			copy = (data_len > sdp->sd_jbsize) ? sdp->sd_jbsize : data_len;
-			memcpy(bh->b_data + sizeof(struct gfs_meta_header),
-			       data,
-			       copy);
-
-			*dataptr++ = cpu_to_gfs64((uint64_t)bh->b_blocknr);
-			data += copy;
-			data_len -= copy;
-
-			brelse(bh);
-		}
-
-		gfs_assert_withdraw(sdp, !data_len);
-	}
-
-	return 0;
-}
-
-typedef int (*ea_skeleton_call_t) (struct gfs_inode *ip,
-				   struct gfs_ea_request *er,
-				   void *private);
-/**
- * ea_alloc_skeleton -
- * @ip:
- * @er:
- * @blks:
- * @skeleton_call:
- * @private:
- *
- * Returns: errno
- */
-
-static int
-ea_alloc_skeleton(struct gfs_inode *ip, struct gfs_ea_request *er,
-		  unsigned int blks,
-		  ea_skeleton_call_t skeleton_call, void *private)
-{
-	struct gfs_alloc *al;
-	struct buffer_head *dibh;
-	int error;
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_lock_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out;
-
-	error = gfs_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
-	if (error)
-		goto out_gunlock_q;
-
-	al->al_requested_meta = blks;
-
-	error = gfs_inplace_reserve(ip);
-	if (error)
-		goto out_gunlock_q;
-
-	/* Trans may require:
-	   A modified dinode, multiple EA metadata blocks, and all blocks for a RG
-	   bitmap */
-
-	error = gfs_trans_begin(ip->i_sbd,
-				1 + blks + al->al_rgd->rd_ri.ri_length, 1);
-	if (error)
-		goto out_ipres;
-
-	error = skeleton_call(ip, er, private);
-	if (error)
-		goto out_end_trans;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		if (er->er_mode) {
-			ip->i_vnode->i_mode = er->er_mode;
-			gfs_inode_attr_out(ip);
-		}
-		ip->i_di.di_ctime = get_seconds();
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
- out_end_trans:
-	gfs_trans_end(ip->i_sbd);
-
- out_ipres:
-	gfs_inplace_release(ip);
-
- out_gunlock_q:
-	gfs_quota_unlock_m(ip);
-
- out:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * ea_init_i - initializes a new eattr block
- * @ip:
- * @er:
- * @private:
- *
- * Returns: errno
- */
-
-static int
-ea_init_i(struct gfs_inode *ip,
-	  struct gfs_ea_request *er,
-	  void *private)
-{
-	struct buffer_head *bh;
-	int error;
-
-	error = ea_alloc_blk(ip, &bh);
-	if (error)
-		return error;
-
-	ip->i_di.di_eattr = bh->b_blocknr;
-	error = ea_write(ip, GFS_EA_BH2FIRST(bh), er);
-
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * ea_init - initializes a new eattr block
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-static int
-ea_init(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	unsigned int jbsize = ip->i_sbd->sd_jbsize;
-	unsigned int blks = 1;
-
-	if (GFS_EAREQ_SIZE_STUFFED(er) > jbsize)
-		blks += DIV_RU(er->er_data_len, jbsize);
-
-	return ea_alloc_skeleton(ip, er,
-				 blks,
-				 ea_init_i, NULL);
-}
-
-/**
- * ea_split_ea -
- * @ea:
- *
- * Returns: the new ea
- */
-
-static struct gfs_ea_header *
-ea_split_ea(struct gfs_ea_header *ea)
-{
-	uint32_t ea_size = GFS_EA_SIZE(ea);
-	struct gfs_ea_header *new = (struct gfs_ea_header *)((char *)ea + ea_size);
-	uint32_t new_size = GFS_EA_REC_LEN(ea) - ea_size;
-	int last = ea->ea_flags & GFS_EAFLAG_LAST;
-
-	ea->ea_rec_len = cpu_to_gfs32(ea_size);
-	ea->ea_flags ^= last;
-
-	new->ea_rec_len = cpu_to_gfs32(new_size);
-	new->ea_flags = last;
-
-	return new;
-}
-
-/**
- * ea_set_remove_stuffed -
- * @ip:
- * @ea:
- *
- */
-
-static void
-ea_set_remove_stuffed(struct gfs_inode *ip, struct gfs_ea_location *el)
-{
-	struct gfs_ea_header *ea = el->el_ea;
-	struct gfs_ea_header *prev = el->el_prev;
-	uint32_t len;
-
-	gfs_trans_add_bh(ip->i_gl, el->el_bh);
-
-	if (!prev || !GFS_EA_IS_STUFFED(ea)) {
-		ea->ea_type = GFS_EATYPE_UNUSED;
-		return;
-	} else if (GFS_EA2NEXT(prev) != ea) {
-		prev = GFS_EA2NEXT(prev);
-		gfs_assert_withdraw(ip->i_sbd, GFS_EA2NEXT(prev) == ea);
-	}
-
-	len = GFS_EA_REC_LEN(prev) + GFS_EA_REC_LEN(ea);
-	prev->ea_rec_len = cpu_to_gfs32(len);
-
-	if (GFS_EA_IS_LAST(ea))
-		prev->ea_flags |= GFS_EAFLAG_LAST;
-}
-
-struct ea_set {
-	int ea_split;
-
-	struct gfs_ea_request *es_er;
-	struct gfs_ea_location *es_el;
-
-	struct buffer_head *es_bh;
-	struct gfs_ea_header *es_ea;
-};
-
-/**
- * ea_set_simple_noalloc -
- * @ip:
- * @ea:
- * @es:
- *
- * Returns: errno
- */
-
-static int
-ea_set_simple_noalloc(struct gfs_inode *ip,
-		      struct buffer_head *bh,
-		      struct gfs_ea_header *ea,
-		      struct ea_set *es)
-{
-	struct gfs_ea_request *er = es->es_er;
-	int error;
-
-	error = gfs_trans_begin(ip->i_sbd, 3, 0);
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(ip->i_gl, bh);
-
-	if (es->ea_split)
-		ea = ea_split_ea(ea);
-
-	ea_write(ip, ea, er);
-
-	if (es->es_el)
-		ea_set_remove_stuffed(ip, es->es_el);
-
-	{
-		struct buffer_head *dibh;
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (!error) {
-			if (er->er_mode) {
-				ip->i_vnode->i_mode = er->er_mode;
-				gfs_inode_attr_out(ip);
-			}
-			ip->i_di.di_ctime = get_seconds();
-			gfs_trans_add_bh(ip->i_gl, dibh);
-			gfs_dinode_out(&ip->i_di, dibh->b_data);
-			brelse(dibh);
-		}	
-	}
-
-	gfs_trans_end(ip->i_sbd);
-
-	return error;
-}
-
-/**
- * ea_set_simple_alloc -
- * @ip:
- * @er:
- * @private:
- *
- * Returns: errno
- */
-
-static int
-ea_set_simple_alloc(struct gfs_inode *ip,
-		    struct gfs_ea_request *er,
-		    void *private)
-{
-	struct ea_set *es = (struct ea_set *)private;
-	struct gfs_ea_header *ea = es->es_ea;
-	int error;
-
-	gfs_trans_add_bh(ip->i_gl, es->es_bh);
-
-	if (es->ea_split)
-		ea = ea_split_ea(ea);
-
-	error =  ea_write(ip, ea, er);
-	if (error)
-		return error;
-
-	if (es->es_el)
-		ea_set_remove_stuffed(ip, es->es_el);
-
-	return 0;
-}
-
-/**
- * ea_set_simple -
- * @ip:
- * @el:
- *
- * Returns: errno
- */
-
-static int
-ea_set_simple(struct gfs_inode *ip,
-	      struct buffer_head *bh,
-	      struct gfs_ea_header *ea,
-	      struct gfs_ea_header *prev,
-	      void *private)
-{
-	struct ea_set *es = (struct ea_set *)private;
-	unsigned int size;
-	int stuffed;
-	int error;
-
-	stuffed = ea_calc_size(ip->i_sbd, es->es_er, &size);
-
-	if (ea->ea_type == GFS_EATYPE_UNUSED) {
-		if (GFS_EA_REC_LEN(ea) < size)
-			return 0;
-		if (!GFS_EA_IS_STUFFED(ea)) {
-			error = ea_remove_unstuffed(ip, bh, ea, prev, TRUE);
-			if (error)
-				return error;
-		}
-		es->ea_split = FALSE;
-	} else if (GFS_EA_REC_LEN(ea) - GFS_EA_SIZE(ea) >= size)
-		es->ea_split = TRUE;
-	else
-		return 0;
-
-	if (stuffed) {
-		error = ea_set_simple_noalloc(ip, bh, ea, es);
-		if (error)
-			return error;
-	} else {
-		unsigned int blks;
-
-		es->es_bh = bh;
-		es->es_ea = ea;
-		blks = 2 + DIV_RU(es->es_er->er_data_len,
-				  ip->i_sbd->sd_jbsize);
-
-		error = ea_alloc_skeleton(ip, es->es_er,
-					  blks,
-					  ea_set_simple_alloc, es);
-		if (error)
-			return error;
-	}
-
-	return 1;
-}
-
-/**
- * ea_set_block -
- * @ip:
- * @er:
- * @private:
- *
- * Returns: errno
- */
-
-static int
-ea_set_block(struct gfs_inode *ip,
-	     struct gfs_ea_request *er,
-	     void *private)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *indbh, *newbh;
-	uint64_t *eablk;
-	int error;
-
-	if (ip->i_di.di_flags & GFS_DIF_EA_INDIRECT) {
-		uint64_t *end;
-
-		error = gfs_dread(ip->i_gl, ip->i_di.di_eattr,
-				  DIO_START | DIO_WAIT, &indbh);
-		if (error)
-			return error;
-
-		if (gfs_metatype_check(sdp, indbh, GFS_METATYPE_IN)) {
-			error = -EIO;
-			goto out;
-		}
-
-		eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs_indirect));
-		end = eablk + sdp->sd_inptrs;
-
-		for (; eablk < end; eablk++)
-			if (!*eablk)
-				break;
-
-		if (eablk == end) {
-			error = -ENOSPC;
-			goto out;
-		}
-
-		gfs_trans_add_bh(ip->i_gl, indbh);
-	} else {
-		uint64_t blk;
-
-		error = gfs_metaalloc(ip, &blk);
-		if (error)
-			return error;
-
-		error = gfs_dread(ip->i_gl, blk,
-				  DIO_NEW | DIO_START | DIO_WAIT, &indbh);
-		if (error)
-			return error;
-
-		gfs_trans_add_bh(ip->i_gl, indbh);
-		gfs_metatype_set(indbh, GFS_METATYPE_IN, GFS_FORMAT_IN);
-		gfs_buffer_clear_tail(indbh, sizeof(struct gfs_meta_header));
-
-		eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs_indirect));
-		*eablk = cpu_to_gfs64(ip->i_di.di_eattr);
-		ip->i_di.di_eattr = blk;
-		ip->i_di.di_flags |= GFS_DIF_EA_INDIRECT;
-		ip->i_di.di_blocks++;
-
-		eablk++;
-	}
-
-	error = ea_alloc_blk(ip, &newbh);
-	if (error)
-		goto out;
-
-	*eablk = cpu_to_gfs64((uint64_t)newbh->b_blocknr);
-	error = ea_write(ip, GFS_EA_BH2FIRST(newbh), er);
-	brelse(newbh);
-	if (error)
-		goto out;
-
-	if (private)
-		ea_set_remove_stuffed(ip, (struct gfs_ea_location *)private);
-
- out:
-	brelse(indbh);
-
-	return error;
-}
-
-/**
- * ea_set_i -
- * @ip:
- * @el:
- *
- * Returns: errno
- */
-
-static int
-ea_set_i(struct gfs_inode *ip,
-	 struct gfs_ea_request *er,
-	 struct gfs_ea_location *el)
-{
-	{
-		struct ea_set es;
-		int error;
-
-		memset(&es, 0, sizeof(struct ea_set));
-		es.es_er = er;
-		es.es_el = el;
-
-		error = ea_foreach(ip, ea_set_simple, &es);
-		if (error > 0)
-			return 0;
-		if (error)
-			return error;
-	}
-	{
-		unsigned int blks = 2;
-		if (!(ip->i_di.di_flags & GFS_DIF_EA_INDIRECT))
-			blks++;
-		if (GFS_EAREQ_SIZE_STUFFED(er) > ip->i_sbd->sd_jbsize)
-			blks += DIV_RU(er->er_data_len,
-				       ip->i_sbd->sd_jbsize);
-
-		return ea_alloc_skeleton(ip, er, blks, ea_set_block, el);
-	}
-}
-
-/**
- * ea_set_remove_unstuffed -
- * @ip:
- * @el:
- *
- * Returns: errno
- */
-
-static int
-ea_set_remove_unstuffed(struct gfs_inode *ip, struct gfs_ea_location *el)
-{
-	if (el->el_prev && GFS_EA2NEXT(el->el_prev) != el->el_ea) {
-		el->el_prev = GFS_EA2NEXT(el->el_prev);
-		gfs_assert_withdraw(ip->i_sbd,
-				    GFS_EA2NEXT(el->el_prev) == el->el_ea);
-	}
-
-	return ea_remove_unstuffed(ip, el->el_bh, el->el_ea, el->el_prev, FALSE);
-}
-
-/**
- * gfs_ea_set_i -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_set_i(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_ea_location el;
-	int error;
-
-	if (!ip->i_di.di_eattr) {
-		if (er->er_flags & XATTR_REPLACE)
-			return -ENODATA;
-		return ea_init(ip, er);
-	}
-
-	error = gfs_ea_find(ip, er, &el);
-	if (error)
-		return error;
-
-	if (el.el_ea) {
-		if (IS_APPEND(ip->i_vnode)) {
-			brelse(el.el_bh);
-			return -EPERM;
-		}
-
-		error = -EEXIST;
-		if (!(er->er_flags & XATTR_CREATE)) {
-			int unstuffed = !GFS_EA_IS_STUFFED(el.el_ea);
-			error = ea_set_i(ip, er, &el);
-			if (!error && unstuffed)
-				ea_set_remove_unstuffed(ip, &el);
-		}
-
-		brelse(el.el_bh);
-	} else {
-		error = -ENODATA;
-		if (!(er->er_flags & XATTR_REPLACE))
-			error = ea_set_i(ip, er, NULL);
-	}
-
-	return error;
-}
-
-/**
- * gfs_ea_set -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_set(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	if (!er->er_name_len ||
-	    er->er_name_len > GFS_EA_MAX_NAME_LEN)
-		return -EINVAL;
-	if (!er->er_data || !er->er_data_len) {
-		er->er_data = NULL;
-		er->er_data_len = 0;
-	}
-	error = gfs_ea_check_size(ip->i_sbd, er);
-	if (error)
-		return error;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
-	if (error)
-		return error;
-
-	if (IS_IMMUTABLE(ip->i_vnode))
-		error = -EPERM;
-	else
-		error = gfs_ea_ops[er->er_type]->eo_set(ip, er);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * ea_remove_stuffed -
- * @ip:
- * @el:
- * @mode:
- *
- * Returns: errno
- */
-
-static int
-ea_remove_stuffed(struct gfs_inode *ip,
-		  struct gfs_ea_location *el)
-{
-	struct gfs_ea_header *ea = el->el_ea;
-	struct gfs_ea_header *prev = el->el_prev;
-	int error;
-
-	error = gfs_trans_begin(ip->i_sbd, 2, 0);
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(ip->i_gl, el->el_bh);
-
-	if (prev) {
-		uint32_t len;
-
-		len = GFS_EA_REC_LEN(prev) + GFS_EA_REC_LEN(ea);
-		prev->ea_rec_len = cpu_to_gfs32(len);
-
-		if (GFS_EA_IS_LAST(ea))
-			prev->ea_flags |= GFS_EAFLAG_LAST;
-	} else
-		ea->ea_type = GFS_EATYPE_UNUSED;
-
-	{
-		struct buffer_head *dibh;
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (!error) {
-			ip->i_di.di_ctime = get_seconds();
-			gfs_trans_add_bh(ip->i_gl, dibh);
-			gfs_dinode_out(&ip->i_di, dibh->b_data);
-			brelse(dibh);
-		}	
-	}
-
-	gfs_trans_end(ip->i_sbd);
-
-	return error;
-}
-
-/**
- * gfs_ea_remove_i -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-int
-gfs_ea_remove_i(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_ea_location el;
-	int error;
-
-	if (!ip->i_di.di_eattr)
-		return -ENODATA;
-
-	error = gfs_ea_find(ip, er, &el);
-	if (error)
-		return error;
-	if (!el.el_ea)
-		return -ENODATA;
-
-	if (GFS_EA_IS_STUFFED(el.el_ea))
-		error = ea_remove_stuffed(ip, &el);
-	else
-		error = ea_remove_unstuffed(ip, el.el_bh, el.el_ea, el.el_prev, FALSE);
-
-	brelse(el.el_bh);
-
-	return error;
-}
-
-/**
- * gfs_ea_remove - sets (or creates or replaces) an extended attribute
- * @ip: pointer to the inode of the target file
- * @er: request information
- *
- * Returns: errno
- */
-
-int
-gfs_ea_remove(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	if (!er->er_name_len ||
-	    er->er_name_len > GFS_EA_MAX_NAME_LEN)
-		return -EINVAL;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
-	if (error)
-		return error;
-
-	if (IS_IMMUTABLE(ip->i_vnode) || IS_APPEND(ip->i_vnode))
-		error = -EPERM;
-	else
-		error = gfs_ea_ops[er->er_type]->eo_remove(ip, er);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_ea_acl_init -
- * @ip:
- * @er:
- *
- * Returns: errno
- */
-
-int gfs_ea_acl_init(struct gfs_inode *ip, struct gfs_ea_request *er)
-{
-	struct buffer_head *bh;
-	struct gfs_ea_header *ea;
-	unsigned int size;
-	struct buffer_head *dibh;
-	int error;
-
-	if (!ip->i_di.di_eattr)
-		return ea_init_i(ip, er, NULL);
-
-	ea_calc_size(ip->i_sbd, er, &size);
-
-	error = gfs_dread(ip->i_gl, ip->i_di.di_eattr,
-				  DIO_START | DIO_WAIT, &bh);
-	if (error)
-		return error;
-
-	if (gfs_metatype_check(ip->i_sbd, bh, GFS_METATYPE_EA)) {
-		brelse(bh);
-		return -EIO;
-	}
-
-	ea = GFS_EA_BH2FIRST(bh);
-	if (GFS_EA_REC_LEN(ea) - GFS_EA_SIZE(ea) >= size) {
-		ea = ea_split_ea(ea);
-		ea_write(ip, ea, er);
-		brelse(bh);
-		return 0;
-	}
-
-	brelse(bh);
-
-	error = ea_set_block(ip, er, NULL);
-	gfs_assert_withdraw(ip->i_sbd, error != -ENOSPC);
-	if (error)
-		return error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		return error;
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-	return error;
-}
-
-/**
- * ea_acl_chmod_unstuffed -
- * @ip:
- * @ea:
- * @data:
- *
- * Returns: errno
- */
-
-static int ea_acl_chmod_unstuffed(struct gfs_inode *ip,
-				  struct gfs_ea_header *ea, char *data,
-				  int *trans)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head **bh;
-	unsigned int amount = GFS_EA_DATA_LEN(ea);
-	unsigned int nptrs = DIV_RU(amount, sdp->sd_jbsize);
-	uint64_t *dataptrs = GFS_EA2DATAPTRS(ea);
-	unsigned int x;
-	int error;
-
-	bh = kmalloc(nptrs * sizeof(struct buffer_head *), GFP_NOFS);
-	if (!bh)
-		return -ENOMEM;
-
-	if (get_transaction == NULL) {
-		error = gfs_trans_begin(sdp, 1 + nptrs, 0);
-		if (error)
-			goto out;
-		*trans = 1;
-	}
-
-	for (x = 0; x < nptrs; x++) {
-		error = gfs_dread(ip->i_gl, gfs64_to_cpu(*dataptrs),
-				  DIO_START, bh + x);
-		if (error) {
-			while (x--)
-				brelse(bh[x]);
-			goto fail;
-		}
-		dataptrs++;
-	}
-
-	for (x = 0; x < nptrs; x++) {
-		error = gfs_dreread(sdp, bh[x], DIO_WAIT);
-		if (error) {
-			for (; x < nptrs; x++)
-				brelse(bh[x]);
-			goto fail;
-		}
-		if (gfs_metatype_check2(sdp, bh[x],
-					GFS_METATYPE_ED, GFS_METATYPE_EA)) {
-			for (; x < nptrs; x++)
-				brelse(bh[x]);
-			error = -EIO;
-			goto fail;
-		}
-
-		gfs_trans_add_bh(ip->i_gl, bh[x]);
-
-		memcpy(bh[x]->b_data + sizeof(struct gfs_meta_header),
-		       data,
-		       (sdp->sd_jbsize > amount) ? amount : sdp->sd_jbsize);
-
-		amount -= sdp->sd_jbsize;
-		data += sdp->sd_jbsize;
-
-		brelse(bh[x]);
-	}
-
-out:
-	kfree(bh);
-	return error;
-
-fail:
-	gfs_trans_end(sdp);
-	*trans = 0;
-	kfree(bh);
-	return error;
-}
-
-/**
- * gfs_ea_acl_chmod -
- * @ip:
- * @el:
- * @attr:
- * @data:
- *
- * Returns: errno
- */
-
-int gfs_ea_acl_chmod(struct gfs_inode *ip, struct gfs_ea_location *el,
-		     struct iattr *attr, char *data)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *dibh;
-	int error;
-	int trans = 0;
-
-	if (GFS_EA_IS_STUFFED(el->el_ea)) {
-		if (get_transaction == NULL) {
-			error = gfs_trans_begin(ip->i_sbd, 2, 0);
-			if (error)
-				return error;
-			trans = 1;
-		}
-
-		gfs_trans_add_bh(ip->i_gl, el->el_bh);
-		memcpy(GFS_EA2DATA(el->el_ea), data,
-		       GFS_EA_DATA_LEN(el->el_ea));
-	} else {
-		error = ea_acl_chmod_unstuffed(ip, el->el_ea, data, &trans);
-	}
-
-	if (error)
-		return error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		error = inode_setattr(ip->i_vnode, attr);
-		gfs_assert_warn(ip->i_sbd, !error);
-		gfs_inode_attr_out(ip);
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	if (trans)
-		gfs_trans_end(ip->i_sbd);
-
-	return error;
-}
-
-/**
- * ea_dealloc_indirect -
- * @ip:
- *
- * Returns: errno
- */
-
-static int
-ea_dealloc_indirect(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrp_list rlist;
-	struct buffer_head *indbh, *dibh;
-	uint64_t *eablk, *end;
-	unsigned int rg_blocks = 0;
-	uint64_t bstart = 0;
-	unsigned int blen = 0;
-	unsigned int x;
-	int error;
-
-	memset(&rlist, 0, sizeof(struct gfs_rgrp_list));
-
-	error = gfs_dread(ip->i_gl, ip->i_di.di_eattr,
-			  DIO_START | DIO_WAIT, &indbh);
-	if (error)
-		return error;
-
-	if (gfs_metatype_check(sdp, indbh, GFS_METATYPE_IN)) {
-		error = -EIO;
-		goto out;
-	}
-
-	eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs_indirect));
-	end = eablk + sdp->sd_inptrs;
-
-	for (; eablk < end; eablk++) {
-		uint64_t bn;
-
-		if (!*eablk)
-			break;
-		bn = gfs64_to_cpu(*eablk);
-
-		if (bstart + blen == bn)
-			blen++;
-		else {
-			if (bstart)
-				gfs_rlist_add(sdp, &rlist, bstart);
-			bstart = bn;
-			blen = 1;
-		}	
-	}
-	if (bstart)
-		gfs_rlist_add(sdp, &rlist, bstart);
-	else
-		goto out;
-
-	gfs_rlist_alloc(&rlist, LM_ST_EXCLUSIVE, 0);
-
-	for (x = 0; x < rlist.rl_rgrps; x++) {
-		struct gfs_rgrpd *rgd;
-		rgd = get_gl2rgd(rlist.rl_ghs[x].gh_gl);
-		rg_blocks += rgd->rd_ri.ri_length;
-	}
-
-	error = gfs_glock_nq_m(rlist.rl_rgrps, rlist.rl_ghs);
-	if (error)
-		goto out_rlist_free;
-
-	error = gfs_trans_begin(sdp, 2 + rg_blocks, 1);
-	if (error)
-		goto out_gunlock;
-
-	gfs_trans_add_bh(ip->i_gl, indbh);
-
-	eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs_indirect));
-	bstart = 0;
-	blen = 0;
-
-	for (; eablk < end; eablk++) {
-		uint64_t bn;
-
-		if (!*eablk)
-			break;
-		bn = gfs64_to_cpu(*eablk);
-
-		if (bstart + blen == bn)
-			blen++;
-		else {
-			if (bstart)
-				gfs_metafree(ip, bstart, blen);
-			bstart = bn;
-			blen = 1;
-		}
-
-		*eablk = 0;
-		if (!ip->i_di.di_blocks)
-			gfs_consist_inode(ip);
-		ip->i_di.di_blocks--;
-	}
-	if (bstart)
-		gfs_metafree(ip, bstart, blen);
-
-	ip->i_di.di_flags &= ~GFS_DIF_EA_INDIRECT;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	gfs_trans_end(sdp);
-
- out_gunlock:
-	gfs_glock_dq_m(rlist.rl_rgrps, rlist.rl_ghs);
-
- out_rlist_free:
-	gfs_rlist_free(&rlist);
-
- out:
-	brelse(indbh);
-
-	return error;
-}
-
-/**
- * ea_dealloc_block -
- * @ip:
- *
- * Returns: errno
- */
-
-static int
-ea_dealloc_block(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	struct gfs_rgrpd *rgd;
-	struct buffer_head *dibh;
-	int error;
-
-	rgd = gfs_blk2rgrpd(sdp, ip->i_di.di_eattr);
-	if (!rgd) {
-		gfs_consist_inode(ip);
-		return -EIO;
-	}
-
-	error = gfs_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &al->al_rgd_gh);
-	if (error)
-		return error;
-
-	error = gfs_trans_begin(sdp, 1 + rgd->rd_ri.ri_length, 1);
-	if (error)
-		goto out_gunlock;
-
-	gfs_metafree(ip, ip->i_di.di_eattr, 1);
-
-	ip->i_di.di_eattr = 0;
-	if (!ip->i_di.di_blocks)
-		gfs_consist_inode(ip);
-	ip->i_di.di_blocks--;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	gfs_trans_end(sdp);
-
- out_gunlock:
-	gfs_glock_dq_uninit(&al->al_rgd_gh);
-
-	return error;
-}
-
-/**
- * gfs_ea_dealloc - deallocate the extended attribute fork
- * @ip: the inode
- *
- * Returns: errno
- */
-
-int
-gfs_ea_dealloc(struct gfs_inode *ip)
-{
-	struct gfs_alloc *al;
-	int error;
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_hold_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out_alloc;
-
-	error = gfs_rindex_hold(ip->i_sbd, &al->al_ri_gh);
-	if (error)
-		goto out_quota;
-
-	error = ea_foreach(ip, ea_dealloc_unstuffed, NULL);
-	if (error)
-		goto out_rindex;
-
-	if (ip->i_di.di_flags & GFS_DIF_EA_INDIRECT) {
-		error = ea_dealloc_indirect(ip);
-		if (error)
-			goto out_rindex;
-	}
-
-	error = ea_dealloc_block(ip);
-
- out_rindex:
-	gfs_glock_dq_uninit(&al->al_ri_gh);
-
- out_quota:
-	gfs_quota_unhold_m(ip);
-
- out_alloc:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * gfs_get_eattr_meta - return all the eattr blocks of a file
- * @dip: the directory
- * @ub: the structure representing the user buffer to copy to
- *
- * Returns: errno
- */
-
-int
-gfs_get_eattr_meta(struct gfs_inode *ip, struct gfs_user_buffer *ub)
-{
-	struct buffer_head *bh;
-	int error;
-
-	error = gfs_dread(ip->i_gl, ip->i_di.di_eattr,
-			  DIO_START | DIO_WAIT, &bh);
-	if (error)
-		return error;
-
-	gfs_add_bh_to_ub(ub, bh);
-
-	if (ip->i_di.di_flags & GFS_DIF_EA_INDIRECT) {
-		struct buffer_head *eabh;
-		uint64_t *eablk, *end;
-
-		if (gfs_metatype_check(ip->i_sbd, bh, GFS_METATYPE_IN)) {
-			error = -EIO;
-			goto out;
-		}
-
-		eablk = (uint64_t *)(bh->b_data + sizeof(struct gfs_indirect));
-		end = eablk + ip->i_sbd->sd_inptrs;
-
-		for (; eablk < end; eablk++) {
-			uint64_t bn;
-
-			if (!*eablk)
-				break;
-			bn = gfs64_to_cpu(*eablk);
-
-			error = gfs_dread(ip->i_gl, bn,
-					  DIO_START | DIO_WAIT, &eabh);
-			if (error)
-				break;
-			gfs_add_bh_to_ub(ub, eabh);
-			brelse(eabh);
-			if (error)
-				break;
-		}
-	}
-
- out:
-	brelse(bh);
-
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/eattr.h b/gfs-kernel/src/gfs/eattr.h
deleted file mode 100644
index b370c2a..0000000
--- a/gfs-kernel/src/gfs/eattr.h
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef __EATTR_DOT_H__
-#define __EATTR_DOT_H__
-
-#define GFS_EA_REC_LEN(ea) gfs32_to_cpu((ea)->ea_rec_len)
-#define GFS_EA_DATA_LEN(ea) gfs32_to_cpu((ea)->ea_data_len)
-
-#define GFS_EA_SIZE(ea) \
-MAKE_MULT8(sizeof(struct gfs_ea_header) + \
-	   (ea)->ea_name_len + \
-	   ((GFS_EA_IS_STUFFED(ea)) ? \
-	    GFS_EA_DATA_LEN(ea) : \
-	    (sizeof(uint64_t) * (ea)->ea_num_ptrs)))
-#define GFS_EA_STRLEN(ea) \
-((((ea)->ea_type == GFS_EATYPE_USR) ? 5 : 7) + \
- (ea)->ea_name_len + 1)
-
-#define GFS_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs)
-#define GFS_EA_IS_LAST(ea) ((ea)->ea_flags & GFS_EAFLAG_LAST)
-
-#define GFS_EAREQ_SIZE_STUFFED(er) \
-MAKE_MULT8(sizeof(struct gfs_ea_header) + \
-	   (er)->er_name_len + (er)->er_data_len)
-#define GFS_EAREQ_SIZE_UNSTUFFED(sdp, er) \
-MAKE_MULT8(sizeof(struct gfs_ea_header) + \
-	   (er)->er_name_len + \
-	   sizeof(uint64_t) * DIV_RU((er)->er_data_len, (sdp)->sd_jbsize))
-
-#define GFS_EA2NAME(ea) ((char *)((struct gfs_ea_header *)(ea) + 1))
-#define GFS_EA2DATA(ea) (GFS_EA2NAME(ea) + (ea)->ea_name_len)
-#define GFS_EA2DATAPTRS(ea) \
-((uint64_t *)(GFS_EA2NAME(ea) + MAKE_MULT8((ea)->ea_name_len)))
-#define GFS_EA2NEXT(ea) \
-((struct gfs_ea_header *)((char *)(ea) + GFS_EA_REC_LEN(ea)))
-#define GFS_EA_BH2FIRST(bh) \
-((struct gfs_ea_header *)((bh)->b_data + \
-			  sizeof(struct gfs_meta_header)))
-
-struct gfs_ea_request {
-	char *er_name;
-	char *er_data;
-	unsigned int er_name_len;
-	unsigned int er_data_len;
-	unsigned int er_type; /* GFS_EATYPE_... */
-	int er_flags;
-	mode_t er_mode;
-};
-
-struct gfs_ea_location {
-	struct buffer_head *el_bh;
-	struct gfs_ea_header *el_ea;
-	struct gfs_ea_header *el_prev;
-};
-
-static inline unsigned int
-gfs_ea_strlen(struct gfs_ea_header *ea)
-{
-	switch (ea->ea_type) {
-	case GFS_EATYPE_USR:
-		return (5 + (ea->ea_name_len + 1));
-	case GFS_EATYPE_SYS:
-		return (7 + (ea->ea_name_len + 1));
-	case GFS_EATYPE_SECURITY:
-		return (9 + (ea->ea_name_len + 1));
-	default:
-		return (0);
-	}
-}
-
-int gfs_ea_repack(struct gfs_inode *ip);
-
-int gfs_ea_get_i(struct gfs_inode *ip, struct gfs_ea_request *er);
-int gfs_ea_set_i(struct gfs_inode *ip, struct gfs_ea_request *er);
-int gfs_ea_remove_i(struct gfs_inode *ip, struct gfs_ea_request *er);
-
-int gfs_ea_list(struct gfs_inode *ip, struct gfs_ea_request *er);
-int gfs_ea_get(struct gfs_inode *ip, struct gfs_ea_request *er);
-int gfs_ea_set(struct gfs_inode *ip, struct gfs_ea_request *er);
-int gfs_ea_remove(struct gfs_inode *ip, struct gfs_ea_request *er);
-
-int gfs_ea_dealloc(struct gfs_inode *ip);
-
-int gfs_get_eattr_meta(struct gfs_inode *ip, struct gfs_user_buffer *ub);
-
-/* Exported to acl.c */
-
-int gfs_ea_check_size(struct gfs_sbd *sdp, struct gfs_ea_request *er);
-int gfs_ea_find(struct gfs_inode *ip,
-		struct gfs_ea_request *er,
-		struct gfs_ea_location *el);
-int gfs_ea_get_copy(struct gfs_inode *ip,
-		    struct gfs_ea_location *el,
-		    char *data);
-int gfs_ea_acl_init(struct gfs_inode *ip, struct gfs_ea_request *er);
-int gfs_ea_acl_chmod(struct gfs_inode *ip, struct gfs_ea_location *el,
-		     struct iattr *attr, char *data);
-
-#endif /* __EATTR_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/file.c b/gfs-kernel/src/gfs/file.c
deleted file mode 100644
index 3f8e5b9..0000000
--- a/gfs-kernel/src/gfs/file.c
+++ /dev/null
@@ -1,437 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-
-#include "gfs.h"
-#include "bmap.h"
-#include "dio.h"
-#include "file.h"
-#include "inode.h"
-#include "trans.h"
-
-/**
- * gfs_copy2mem - Trivial copy function for gfs_readi()
- * @bh: The buffer to copy from, or NULL meaning zero the buffer
- * @buf: The buffer to copy/zero
- * @offset: The offset in the buffer to copy from
- * @size: The amount of data to copy/zero
- *
- * Returns: errno
- */
-
-int
-gfs_copy2mem(struct buffer_head *bh, void **buf, unsigned int offset,
-	     unsigned int size)
-{
-	char **p = (char **)buf;
-
-	if (bh)
-		memcpy(*p, bh->b_data + offset, size);
-	else
-		memset(*p, 0, size);
-
-	*p += size;
-
-	return 0;
-}
-
-/**
- * gfs_copy2user - Copy data to user space
- * @bh: The buffer
- * @buf: The destination of the data
- * @offset: The offset into the buffer
- * @size: The amount of data to copy
- *
- * Returns: errno
- */
-
-int
-gfs_copy2user(struct buffer_head *bh, void **buf,
-	      unsigned int offset, unsigned int size)
-{
-	char **p = (char **)buf;
-	int error;
-
-	if (bh)
-		error = copy_to_user(*p, bh->b_data + offset, size);
-	else
-		error = clear_user(*p, size);
-
-	if (error)
-		error = -EFAULT;
-	else
-		*p += size;
-
-	return error;
-}
-
-/**
- * gfs_readi - Read a file
- * @ip: The GFS Inode
- * @buf: The buffer to place result into
- * @offset: File offset to begin reading from
- * @size: Amount of data to transfer
- * @copy_fn: Function to actually perform the copy
- *
- * The @copy_fn only copies a maximum of a single block at once so
- * we are safe calling it with int arguments. It is done so that
- * we don't needlessly put 64bit arguments on the stack and it
- * also makes the code in the @copy_fn nicer too.
- *
- * Returns: The amount of data actually copied or the error
- */
-
-int
-gfs_readi(struct gfs_inode *ip, void *buf,
-	  uint64_t offset, unsigned int size,
-	  read_copy_fn_t copy_fn)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *bh;
-	uint64_t lblock, dblock;
-	unsigned int o;
-	uint32_t extlen = 0;
-	unsigned int amount;
-	int not_new = 0;
-	int journaled = gfs_is_jdata(ip);
-	int copied = 0;
-	int error = 0;
-
-	if (offset >= ip->i_di.di_size)
-		return 0;
-
-	if ((offset + size) > ip->i_di.di_size)
-		size = ip->i_di.di_size - offset;
-
-	if (!size)
-		return 0;
-
-	if (journaled) {
-		lblock = offset;
-		o = do_div(lblock, sdp->sd_jbsize);
-	} else {
-		lblock = offset >> sdp->sd_sb.sb_bsize_shift;
-		o = offset & (sdp->sd_sb.sb_bsize - 1);
-	}
-
-	if (gfs_is_stuffed(ip))
-		o += sizeof(struct gfs_dinode);
-	else if (journaled)
-		o += sizeof(struct gfs_meta_header);
-
-	while (copied < size) {
-		amount = size - copied;
-		if (amount > sdp->sd_sb.sb_bsize - o)
-			amount = sdp->sd_sb.sb_bsize - o;
-
-		if (!extlen) {
-			if (!gfs_is_stuffed(ip)) {
-				error = gfs_block_map(ip, lblock, &not_new,
-						      &dblock, &extlen);
-				if (error)
-					goto fail;
-			} else if (!lblock) {
-				dblock = ip->i_num.no_addr;
-				extlen = 1;
-			} else
-				dblock = 0;
-		}
-
-		if (extlen > 1)
-			gfs_start_ra(ip->i_gl, dblock, extlen);
-
-		if (dblock) {
-			error = gfs_get_data_buffer(ip, dblock, not_new, &bh);
-			if (error)
-				goto fail;
-
-			dblock++;
-			extlen--;
-		} else
-			bh = NULL;
-
-		error = copy_fn(bh, &buf, o, amount);
-		if (bh)
-			brelse(bh);
-		if (error)
-			goto fail;
-
-		copied += amount;
-		lblock++;
-
-		o = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
-	return copied;
-
- fail:
-	return (copied) ? copied : error;
-}
-
-/**
- * gfs_copy_from_mem - Trivial copy function for gfs_writei()
- * @ip: The file to write to
- * @bh: The buffer to copy to or clear
- * @buf: The buffer to copy from
- * @offset: The offset in the buffer to write to
- * @size: The amount of data to write
- * @new: Flag indicating that remaining space in the buffer should be zeroed
- *
- * Returns: errno
- */
-
-int
-gfs_copy_from_mem(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
-		  unsigned int offset, unsigned int size, int new)
-{
-	char **p = (char **)buf;
-	int error = 0;
-
-	/* The dinode block always gets journaled */
-	if (bh->b_blocknr == ip->i_num.no_addr) {
-		if (gfs_assert_warn(ip->i_sbd, !new))
-			return -EIO;
-		gfs_trans_add_bh(ip->i_gl, bh);
-		memcpy(bh->b_data + offset, *p, size);
-
-	/* Data blocks for journaled files get written added to the journal */
-	} else if (gfs_is_jdata(ip)) {
-		gfs_trans_add_bh(ip->i_gl, bh);
-		memcpy(bh->b_data + offset, *p, size);
-		if (new)
-			gfs_buffer_clear_ends(bh, offset, size, TRUE);
-
-	/* Non-journaled data blocks get written to in-place disk blocks */
-	} else {
-		memcpy(bh->b_data + offset, *p, size);
-		if (new)
-			gfs_buffer_clear_ends(bh, offset, size, FALSE);
-		error = gfs_dwrite(ip->i_sbd, bh, DIO_DIRTY);
-	}
-
-	if (!error)
-		*p += size;
-
-	return error;
-}
-
-/**
- * gfs_copy_from_user - Copy bytes from user space for gfs_writei()
- * @ip: The file to write to
- * @bh: The buffer to copy to or clear
- * @buf: The buffer to copy from
- * @offset: The offset in the buffer to write to
- * @size: The amount of data to write
- * @new: Flag indicating that remaining space in the buffer should be zeroed
- *
- * Returns: errno
- */
-
-int
-gfs_copy_from_user(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
-		   unsigned int offset, unsigned int size, int new)
-{
-	char **p = (char **)buf;
-	int error = 0;
-
-	/* the dinode block always gets journaled */
-	if (bh->b_blocknr == ip->i_num.no_addr) {
-		if (gfs_assert_warn(ip->i_sbd, !new))
-			return -EIO;
-		gfs_trans_add_bh(ip->i_gl, bh);
-		if (copy_from_user(bh->b_data + offset, *p, size))
-			error = -EFAULT;
-
-	/* Data blocks for journaled files get written added to the journal */
-	} else if (gfs_is_jdata(ip)) {
-		gfs_trans_add_bh(ip->i_gl, bh);
-		if (copy_from_user(bh->b_data + offset, *p, size))
-			error = -EFAULT;
-		if (new) {
-			gfs_buffer_clear_ends(bh, offset, size, TRUE);
-			if (error)
-				memset(bh->b_data + offset, 0, size);
-		}
-
-	/* non-journaled data blocks get written to in-place disk blocks */
-	} else {
-		if (copy_from_user(bh->b_data + offset, *p, size))
-			error = -EFAULT;
-		if (error) {
-			if (new)
-				gfs_buffer_clear(bh);
-			gfs_dwrite(ip->i_sbd, bh, DIO_DIRTY);
-		} else {
-			if (new)
-				gfs_buffer_clear_ends(bh, offset, size, FALSE);
-			error = gfs_dwrite(ip->i_sbd, bh, DIO_DIRTY);
-		}
-	}
-
-	if (!error)
-		*p += size;
-
-	return error;
-}
-
-/**
- * gfs_writei - Write bytes to a file
- * @ip: The GFS inode
- * @buf: The buffer containing information to be written
- * @offset: The file offset to start writing at
- * @size: The amount of data to write
- * @copy_fn: Function to do the actual copying
- *
- * Returns: The number of bytes correctly written or error code
- */
-
-int
-gfs_writei(struct gfs_inode *ip, void *buf,
-	   uint64_t offset, unsigned int size,
-	   write_copy_fn_t copy_fn,
-           struct kiocb *iocb)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct buffer_head *dibh, *bh;
-	uint64_t lblock, dblock;
-	unsigned int o;
-	uint32_t extlen = 0;
-	unsigned int amount;
-	int new;
-	int journaled = gfs_is_jdata(ip);
-	const uint64_t start = offset;
-	int copied = 0;
-	int error = 0;
-
-	if (!size)
-		return 0;
-
-	if (gfs_is_stuffed(ip) &&
-	    ((start + size) > (sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode)))) {
-		error = gfs_unstuff_dinode(ip, gfs_unstuffer_async, NULL);
-		if (error)
-			return error;
-	}
-
-	if (journaled) {
-		lblock = offset;
-		o = do_div(lblock, sdp->sd_jbsize);
-	} else {
-		lblock = offset >> sdp->sd_sb.sb_bsize_shift;
-		o = offset & (sdp->sd_sb.sb_bsize - 1);
-	}
-
-	if (gfs_is_stuffed(ip))
-		o += sizeof(struct gfs_dinode);
-	else if (journaled)
-		o += sizeof(struct gfs_meta_header);
-
-	while (copied < size) {
-		amount = size - copied;
-		if (amount > sdp->sd_sb.sb_bsize - o)
-			amount = sdp->sd_sb.sb_bsize - o;
-
-		if (!extlen) {
-			if (!gfs_is_stuffed(ip)) {
-				new = TRUE;
-				error = gfs_block_map(ip, lblock, &new, &dblock, &extlen);
-				if (error)
-					goto fail;
-			} else {
-				new = FALSE;
-				dblock = ip->i_num.no_addr;
-				extlen = 1;
-			}
-		}
-
-		if (journaled && extlen > 1)
-			gfs_start_ra(ip->i_gl, dblock, extlen);
-
-		error = gfs_get_data_buffer(ip, dblock,
-					    (amount == sdp->sd_sb.sb_bsize) ? TRUE : new,
-					    &bh);
-		if (error)
-			goto fail;
-
-		error = copy_fn(ip, bh, &buf, o, amount, new);
-		brelse(bh);
-		if (error)
-			goto fail;
-
-		copied += amount;
-		lblock++;
-		dblock++;
-		extlen--;
-
-		o = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
- out:
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		return error;
-
-	if (ip->i_di.di_size < start + copied)
-		ip->i_di.di_size = start + copied;
-	ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	return copied;
-
- fail:
-	if (copied)
-		goto out;
-	return error;
-}
-
-/*
- * gfs_zero_blocks - zero out disk blocks via gfs_writei()
- * @ip: The file to write to
- * @bh: The buffer to clear
- * @buf: The pseudo buffer (not used but added to keep interface unchanged)
- * @offset: The offset in the buffer to write to
- * @size: The size to zero out
- * @new: Flag indicating that remaining space in the buffer should be zeroed
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-int
-gfs_zero_blocks(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
-                unsigned int offset, unsigned int size, int new)
-{
-	int error = 0;
-
-	/* The dinode block always gets journaled */
-	if (bh->b_blocknr == ip->i_num.no_addr) {
-		if (gfs_assert_warn(ip->i_sbd, !new))
-			return -EIO;
-		gfs_trans_add_bh(ip->i_gl, bh);
-		memset((bh)->b_data + offset, 0, size);
-
-	/* Data blocks for journaled files get written added to the journal */
-	} else if (gfs_is_jdata(ip)) {
-		gfs_trans_add_bh(ip->i_gl, bh);
-		memset((bh)->b_data + offset, 0, size);
-		if (new)
-			gfs_buffer_clear_ends(bh, offset, size, TRUE);
-
-	/* Non-journaled data blocks get written to in-place disk blocks */
-	} else {
-		memset((bh)->b_data + offset, 0, size);
-		if (new)
-			gfs_buffer_clear_ends(bh, offset, size, FALSE);
-		error = gfs_dwrite(ip->i_sbd, bh, DIO_DIRTY);
-	}
-
-	return error;
-}
-
diff --git a/gfs-kernel/src/gfs/file.h b/gfs-kernel/src/gfs/file.h
deleted file mode 100644
index ef19dc1..0000000
--- a/gfs-kernel/src/gfs/file.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __FILE_DOT_H__
-#define __FILE_DOT_H__
-
-typedef int (*read_copy_fn_t) (struct buffer_head *bh, void **buf,
-			       unsigned int offset, unsigned int size);
-typedef int (*write_copy_fn_t) (struct gfs_inode *ip, struct buffer_head *bh,
-				void **buf, unsigned int offset,
-				unsigned int size, int new);
-
-int gfs_copy2mem(struct buffer_head *bh, void **buf,
-		 unsigned int offset, unsigned int size);
-int gfs_copy2user(struct buffer_head *bh, void **buf,
-		  unsigned int offset, unsigned int size);
-int gfs_readi(struct gfs_inode *ip, void *buf, uint64_t offset,
-	      unsigned int size, read_copy_fn_t copy_fn);
-
-int gfs_copy_from_mem(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
-		      unsigned int offset, unsigned int size, int new);
-int gfs_copy_from_user(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
-		       unsigned int offset, unsigned int size, int new);
-int gfs_writei(struct gfs_inode *ip, void *buf, uint64_t offset,
-               unsigned int size, write_copy_fn_t copy_fn,
-               struct kiocb *iocb);
-
-int gfs_zero_blocks(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
-		    unsigned int offset, unsigned int size, int new);
-
-static __inline__ int
-gfs_internal_read(struct gfs_inode *ip, char *buf, uint64_t offset,
-		  unsigned int size)
-{
-	return gfs_readi(ip, buf, offset, size, gfs_copy2mem);
-}
-
-static __inline__ int
-gfs_internal_write(struct gfs_inode *ip, char *buf, uint64_t offset,
-		   unsigned int size)
-{
-	return gfs_writei(ip, buf, offset, size, gfs_copy_from_mem, NULL);
-}
-
-#endif /* __FILE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/fixed_div64.h b/gfs-kernel/src/gfs/fixed_div64.h
deleted file mode 100644
index 7cc9e71..0000000
--- a/gfs-kernel/src/gfs/fixed_div64.h
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef __FIXED_DIV64_DOT_H__
-#define __FIXED_DIV64_DOT_H__
-
-#include <asm/div64.h>
-
-#if defined __i386__
-/* For ia32 we need to pull some tricks to get past various versions
- * of the compiler which do not like us using do_div in the middle
- * of large functions.
- */
-static inline __u32 fixed_div64_do_div(void *a, __u32 b, int n)
-{
-	__u32	mod;
-
-	switch (n) {
-		case 4:
-			mod = *(__u32 *)a % b;
-			*(__u32 *)a = *(__u32 *)a / b;
-			return mod;
-		case 8:
-			{
-			unsigned long __upper, __low, __high, __mod;
-			__u64	c = *(__u64 *)a;
-			__upper = __high = c >> 32;
-			__low = c;
-			if (__high) {
-				__upper = __high % (b);
-				__high = __high / (b);
-			}
-			asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (b), "0" (__low), "1" (__upper));
-			asm("":"=A" (c):"a" (__low),"d" (__high));
-			*(__u64 *)a = c;
-			return __mod;
-			}
-	}
-
-	/* NOTREACHED */
-	return 0;
-}
-
-/* Side effect free 64 bit mod operation */
-static inline __u32 fixed_div64_do_mod(void *a, __u32 b, int n)
-{
-	switch (n) {
-		case 4:
-			return *(__u32 *)a % b;
-		case 8:
-			{
-			unsigned long __upper, __low, __high, __mod;
-			__u64	c = *(__u64 *)a;
-			__upper = __high = c >> 32;
-			__low = c;
-			if (__high) {
-				__upper = __high % (b);
-				__high = __high / (b);
-			}
-			asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (b), "0" (__low), "1" (__upper));
-			asm("":"=A" (c):"a" (__low),"d" (__high));
-			return __mod;
-			}
-	}
-
-	/* NOTREACHED */
-	return 0;
-}
-#else
-static inline __u32 fixed_div64_do_div(void *a, __u32 b, int n)
-{
-	__u32	mod;
-
-	switch (n) {
-		case 4:
-			mod = *(__u32 *)a % b;
-			*(__u32 *)a = *(__u32 *)a / b;
-			return mod;
-		case 8:
-			mod = do_div(*(__u64 *)a, b);
-			return mod;
-	}
-
-	/* NOTREACHED */
-	return 0;
-}
-
-/* Side effect free 64 bit mod operation */
-static inline __u32 fixed_div64_do_mod(void *a, __u32 b, int n)
-{
-	switch (n) {
-		case 4:
-			return *(__u32 *)a % b;
-		case 8:
-			{
-			__u64	c = *(__u64 *)a;
-			return do_div(c, b);
-			}
-	}
-
-	/* NOTREACHED */
-	return 0;
-}
-#endif
-
-#undef do_div
-#define do_div(a, b)	fixed_div64_do_div(&(a), (b), sizeof(a))
-#define do_mod(a, b)	fixed_div64_do_mod(&(a), (b), sizeof(a))
-
-#endif /* __FIXED_DIV64_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/format.h b/gfs-kernel/src/gfs/format.h
deleted file mode 100644
index 578ca2d..0000000
--- a/gfs-kernel/src/gfs/format.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __FORMAT_DOT_H__
-#define __FORMAT_DOT_H__
-
-static const uint32_t gfs_old_fs_formats[] = {
-	1308,
-	1307,
-	1306,
-	1305,
-	0
-};
-
-static const uint32_t gfs_old_multihost_formats[] = {
-	1400,
-	0
-};
-
-#endif /* __FORMAT_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/gfs.h b/gfs-kernel/src/gfs/gfs.h
deleted file mode 100644
index 3229308..0000000
--- a/gfs-kernel/src/gfs/gfs.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef __GFS_DOT_H__
-#define __GFS_DOT_H__
-
-#define RELEASE_VERSION "<CVS>"
-
-#include "lm_interface.h"
-
-#include "gfs_ondisk.h"
-#include "fixed_div64.h"
-#include "lvb.h"
-#include "incore.h"
-#include "util.h"
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#define NO_CREATE (0)
-#define CREATE (1)
-
-/*  Divide num by den.  Round up if there is a remainder.  */
-#define DIV_RU(num, den) (((num) + (den) - 1) / (den))
-#define MAKE_MULT8(x) (((x) + 7) & ~7)
-
-#define GFS_FAST_NAME_SIZE (8)
-
-#define get_v2sdp(sb) ((struct gfs_sbd *)(sb)->s_fs_info)
-#define set_v2sdp(sb, sdp) (sb)->s_fs_info = (sdp)
-#define get_v2ip(inode) ((struct gfs_inode *)(inode)->i_private)
-#define set_v2ip(inode, ip) (inode)->i_private = (ip)
-#define get_v2fp(file) ((struct gfs_file *)(file)->private_data)
-#define set_v2fp(file, fp) (file)->private_data = (fp)
-#define get_v2bd(bh) ((struct gfs_bufdata *)(bh)->b_private)
-#define set_v2bd(bh, bd) (bh)->b_private = (bd)
-
-#define get_transaction ((struct gfs_trans *)(current->journal_info))
-#define set_transaction(tr) (current->journal_info) = (tr)
-
-#define get_gl2ip(gl) ((struct gfs_inode *)(gl)->gl_object)
-#define set_gl2ip(gl, ip) (gl)->gl_object = (ip)
-#define get_gl2rgd(gl) ((struct gfs_rgrpd *)(gl)->gl_object)
-#define set_gl2rgd(gl, rgd) (gl)->gl_object = (rgd)
-#define get_gl2gl(gl) ((struct gfs_glock *)(gl)->gl_object)
-#define set_gl2gl(gl, gl2) (gl)->gl_object = (gl2)
-
-#define gfs_printf(fmt, args...) \
-do { \
-	if (buf) { \
-		int gspf_left = size - *count, gspf_out; \
-		if (gspf_left <= 0) \
-			goto out; \
-		gspf_out = snprintf(buf + *count, gspf_left, fmt, ##args); \
-		if (gspf_out < gspf_left) \
-			*count += gspf_out; \
-		else \
-			goto out; \
-	} else \
-		printk(fmt, ##args); \
-} while (0)
-
-#endif /* __GFS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/gfs_ioctl.h b/gfs-kernel/src/gfs/gfs_ioctl.h
deleted file mode 100644
index e090cec..0000000
--- a/gfs-kernel/src/gfs/gfs_ioctl.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __GFS_IOCTL_DOT_H__
-#define __GFS_IOCTL_DOT_H__
-
-#define _GFSC_(x)               (('G' << 8) | (x))
-
-/* Ioctls implemented */
-
-#define GFS_IOCTL_IDENTIFY      _GFSC_(35)
-#define GFS_IOCTL_SUPER         _GFSC_(45)
-
-struct gfs_ioctl {
-        unsigned int gi_argc;
-        char **gi_argv;
-
-        char __user *gi_data;
-        unsigned int gi_size;
-        uint64_t gi_offset;
-};
-
-#ifdef CONFIG_COMPAT
-struct gfs_ioctl_compat {
-	unsigned int gi_argc;
-	uint32_t gi_argv;
-
-	uint32_t gi_data;
-	unsigned int gi_size;
-	uint64_t gi_offset;
-};
-#endif
-
-#endif /* ___GFS_IOCTL_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/gfs_ondisk.h b/gfs-kernel/src/gfs/gfs_ondisk.h
deleted file mode 100644
index 11637c6..0000000
--- a/gfs-kernel/src/gfs/gfs_ondisk.h
+++ /dev/null
@@ -1,1904 +0,0 @@
-/*
- * On-disk structures.
- *
- * THE BIG PICTURE of on-disk layout:
- *
- * GFS filesystem code views the entire filesystem, including journals, as
- * one contiguous group of blocks on one (perhaps virtual) storage device.
- * The filesystem space is shared, not distributed; each node in the cluster
- * must see the entire filesystem space.
- *
- * If the filesystem is spread across multiple physical storage devices,
- * volume management (device mapping) must be used to present the fileystem
- * space to GFS as one (virtual) device, with contiguous blocks.
- *
- * The superblock contains basic information about the filesytem, and appears
- * at a location 64 KBytes into the filesystem.  The first 64 KBytes of the
- * filesystem are empty, providing a safety buffer against wayward volume
- * management software (that sometimes write data into the first few bytes of
- * a device) or administrators.
- *
- * After the superblock, the rest of the filesystem is divided into multiple
- * Resource Groups and several journals.
- *
- * The Resource Groups (RGs or rgrps) contain the allocatable blocks that are
- * used for storing files, directories, etc., and all of the associated
- * metadata.  Each RG has its own set of block allocation statistics (within
- * the RG header), a number of blocks containing the block allocation bitmap,
- * and a large number of allocatable blocks for file data and metadata.
- * Multiple RGs allow multiple nodes to simultaneously allocate blocks from the 
- * filesystem (using different RGs), enhancing parallel access.  RG size and
- * number of RGs are determined by gfs_mkfs when creating the filesystem.
- * An administrator can specify RG size (see man gfs_mkfs).
- *
- * The journals contain temporary copies of metadata blocks, along with
- * other data, that allow GFS to recover the filesystem to a consistent state
- * (at least as far as metadata is concerned) if a node fails in the midst
- * of performing a write transaction.  There must be one journal for each node
- * in the cluster.  Since access to the entire filesystem space is shared,
- * if a node crashes, another node will be able to read the crashed node's
- * journal, and perform recovery.
- *
- * Currently, gfs_mkfs places the journals right in the middle of a freshly
- * created filesystem space, between 2 large groups of RGs.  From a filesystem
- * layout perspective, this placement is not a requirement; the journals
- * could be placed anywhere within the filesystem space.
- *
- * New Resource Groups and Journals may be added to the filesystem after the
- * filesystem has been created, if the filesystem's (virtual) device is made
- * larger.  See man gfs_grow and gfs_jadd.
- *
- * A few special hidden inodes are contained in a GFS filesystem.  They do
- * not appear in any directories; instead, the superblock points to them
- * using block numbers for their location.  The special inodes are:
- *
- *   Root inode:  Root directory of the filesystem
- *   Resource Group Index:  A file containing block numbers and sizes of all RGs
- *   Journal Index:  A file containing block numbers and sizes of all journals
- *   Quota:  A file containing all quota information for the filesystem
- *   License:  A file containing license information
- *
- * Note that there is NOTHING RELATED TO INTER-NODE LOCK MANAGEMENT ON-DISK.
- * Locking is handled completely off-disk, typically via LAN.
- *
- * NOTE:
- * If you add 8 byte fields to these structures, they must be 8 byte
- * aligned.  4 byte field must be 4 byte aligned, etc...
- *
- * All structures must be a multiple of 8 bytes long.
- *
- * GRIPES:
- * We should have forgetten about supporting 512B FS block sizes 
- * and made the di_reserved field in the struct gfs_dinode structure
- * much bigger.
- *
- * de_rec_len in struct gfs_dirent should really have been a 32-bit value
- * as it now limits us to a 64k FS block size (with the current code
- * in dir.c).
- */
-
-#ifndef __GFS_ONDISK_DOT_H__
-#define __GFS_ONDISK_DOT_H__
-
-#define GFS_MAGIC               (0x01161970) /* for all on-disk headers */
-#define GFS_BASIC_BLOCK         (512)  /* "basic block" = "sector" = 512B */
-#define GFS_BASIC_BLOCK_SHIFT   (9)
-
-/*  Controls how much data can be logged in-core before dumping log to disk */
-
-#define GFS_DUMPS_PER_LOG       (4)    /* 1/4 of on-disk journal size*/
-
-/*  Lock numbers of the LM_TYPE_NONDISK type.  These protect certain
- *  cluster-wide operations (rather than on-disk entities).
- *  Currently, the LIVE lock is not used for any real purpose.  */
-
-#define GFS_MOUNT_LOCK          (0)    /* only one node can Mount at a time */
-#define GFS_LIVE_LOCK           (1)    /* shared by all mounted nodes */
-#define GFS_TRANS_LOCK          (2)    /* Transaction, protects jrnl recovery */
-#define GFS_RENAME_LOCK         (3)    /* only one node can Rename at a time */
-
-/*  On-disk format (version) numbers for various metadata types,
- *  used in gfs_meta_header  */
-
-#define GFS_FORMAT_SB           (100)  /* Super-Block */
-#define GFS_FORMAT_RG           (200)  /* Resource Group Header */
-#define GFS_FORMAT_RB           (300)  /* Resource Group Block Alloc BitBlock */
-#define GFS_FORMAT_DI           (400)  /* "Disk" inode (dinode) */
-#define GFS_FORMAT_IN           (500)  /* Indirect dinode block list */
-#define GFS_FORMAT_LF           (600)  /* Leaf dinode block list */
-#define GFS_FORMAT_JD           (700)  /* Journal Data */
-#define GFS_FORMAT_LH           (800)  /* Log Header */
-#define GFS_FORMAT_LD           (900)  /* Log Descriptor */
-/*  These don't have actual struct gfs_meta_header structures to go with them */
-#define GFS_FORMAT_JI           (1000) /* Journal Index */
-#define GFS_FORMAT_RI           (1100) /* Resource Group Index */
-#define GFS_FORMAT_DE           (1200) /* Directory Entry */
-#define GFS_FORMAT_QU           (1500) /* Quota */
-#define GFS_FORMAT_EA           (1600) /* Extended Attribute */
-#define GFS_FORMAT_ED           (1700) /* Extended Attribute data */
-/*  These version #s are embedded in the superblock  */
-#define GFS_FORMAT_FS           (1309) /* Filesystem (all-encompassing) */
-#define GFS_FORMAT_MULTI        (1401) /* Multi-Host */
-
-/*
- *  An on-disk inode number
- *  Initially, the on-disk block address of the inode block is assigned as the
- *  formal (permanent) ID as well.  Block address can change (to move inode
- *  on-disk), but formal ID must stay unchanged once assigned.
- */
-
-#define gfs_inum_equal(ino1, ino2) \
-(((ino1)->no_formal_ino == (ino2)->no_formal_ino) && \
- ((ino1)->no_addr == (ino2)->no_addr))
-
-struct gfs_inum {
-	uint64_t no_formal_ino;        /* inode identifier */
-	uint64_t no_addr;              /* block # of dinode block */
-};
-
-/*
- *  Generic metadata head structure
- *
- *  Every inplace buffer logged in the journal must start
- *  with a struct gfs_meta_header.
- *
- *  In addition to telling what kind of metadata is in the block,
- *  the metaheader contains the important generation and incarnation
- *  numbers.
- *
- *  The generation number is used during journal recovery to determine
- *  whether an in-place block on-disk is older than an on-disk journaled copy
- *  of the block.  If so, GFS overwrites the in-place block with the journaled
- *  version of the block.
- *
- *  A meta block's generation number must increment monotonically across the
- *  cluster, each time new contents are committed to the block.  This means
- *  that whenever GFS allocates a pre-existing metadata block, GFS must read
- *  that block from disk (in case another node has incremented it).  It also
- *  means that GFS must sync the block (with incremented generation number)
- *  to disk (both log and in-place blocks), not only after changing contents
- *  of the block, but also after de-allocating the block (GFS can't just throw
- *  away incore metadata for a file that it's just erased).
- *
- *  The incarnation number is used only for on-disk (d)inodes.  GFS increments
- *  it each time it de-allocates a dinode block (i.e. each time the dinode
- *  loses its identity with a particular file, directory, etc.).  When the
- *  dinode is later allocated (i.e. to be identified with a new file, etc.),
- *  GFS copies the incarnation number into the VFS inode's i_generation member.
- *  If GFS is used as the backing store for an NFS server, GFS uses this
- *  i_generation number as part of the NFS filehandle, which differentiates
- *  it from the previous identity of the dinode, and helps protect against
- *  filesystem corruption that could happen with the use of outdated,
- *  invalid, or malicious filehandles.  See ops_export.c.
- *
- *  GFS caches de-allocated meta-headers, to minimize disk reads.
- *  See struct gfs_meta_header_cache.
- */
-
-#define GFS_METATYPE_NONE       (0)
-#define GFS_METATYPE_SB         (1)    /* Super-Block */
-#define GFS_METATYPE_RG         (2)    /* Resource Group Header */
-#define GFS_METATYPE_RB         (3)    /* Resource Group Block Alloc BitBlock */
-#define GFS_METATYPE_DI         (4)    /* "Disk" inode (dinode) */
-#define GFS_METATYPE_IN         (5)    /* Indirect dinode block list */
-#define GFS_METATYPE_LF         (6)    /* Leaf dinode block list */
-#define GFS_METATYPE_JD         (7)    /* Journal Data */
-#define GFS_METATYPE_LH         (8)    /* Log Header (gfs_log_header) */
-#define GFS_METATYPE_LD         (9)    /* Log Descriptor (gfs_log_descriptor) */
-#define GFS_METATYPE_EA         (10)   /* Extended Attribute */
-#define GFS_METATYPE_ED         (11)   /* Extended Attribute data */
-
-#define GFS_META_CLUMP          (64)   /* # blocks to convert fm data to meta */
-
-struct gfs_meta_header {
-	uint32_t mh_magic;      /* GFS_MAGIC sanity check magic number */
-	uint32_t mh_type;       /* GFS_METATYPE_XX type of metadata block */
-	uint64_t mh_generation; /* increment before writing to journal */
-	uint32_t mh_format;     /* GFS_FORMAT_XX (version # for this type) */
-	uint32_t mh_incarn;     /* increment when marking dinode "unused" */
-};
-
-/*
- *  super-block structure
- *
- *  One of these is at beginning of filesystem.
- *  It's probably good if SIZEOF_SB <= GFS_BASIC_BLOCK (512 bytes)
- */
-
-/*  Address of SuperBlock in GFS basic blocks.  1st 64K of filesystem is empty
-    for safety against getting clobbered by wayward volume managers, etc.
-    64k was chosen because it's the largest GFS-supported fs block size.  */
-#define GFS_SB_ADDR             (128)
-
-/*  The lock number for the superblock (must be zero)  */
-#define GFS_SB_LOCK             (0)
-#define GFS_CRAP_LOCK           (1)
-
-/*  Requirement:  GFS_LOCKNAME_LEN % 8 == 0
-    Includes: the fencing zero at the end  */
-#define GFS_LOCKNAME_LEN        (64)
-
-struct gfs_sb {
-	/*  Order is important; need to be able to read old superblocks
-	    in order to support on-disk version upgrades */
-	struct gfs_meta_header sb_header;
-
-	uint32_t sb_fs_format;         /* GFS_FORMAT_FS (on-disk version) */
-	uint32_t sb_multihost_format;  /* GFS_FORMAT_MULTI */
-	uint32_t sb_flags;             /* ?? */
-
-	uint32_t sb_bsize;             /* fundamental FS block size in bytes */
-	uint32_t sb_bsize_shift;       /* log2(sb_bsize) */
-	uint32_t sb_seg_size;          /* Journal segment size in FS blocks */
-
-	/* These special inodes do not appear in any on-disk directory. */
-	struct gfs_inum sb_jindex_di;  /* journal index inode */
-	struct gfs_inum sb_rindex_di;  /* resource group index inode */
-	struct gfs_inum sb_root_di;    /* root directory inode */
-
-	/* Default inter-node locking protocol (lock module) and namespace */
-	char sb_lockproto[GFS_LOCKNAME_LEN]; /* lock protocol name */
-	char sb_locktable[GFS_LOCKNAME_LEN]; /* unique name for this FS */
-
-	/* More special inodes */
-	struct gfs_inum sb_quota_di;   /* quota inode */
-	struct gfs_inum sb_license_di; /* license inode */
-
-	char sb_reserved[96];
-};
-
-/*
- *  journal index structure 
- *
- *  One for each journal used by the filesystem.
- *  These descriptors are packed contiguously within the jindex inode (file).
- */
-
-struct gfs_jindex {
-	uint64_t ji_addr;       /* starting block of the journal */
-	uint32_t ji_nsegment;   /* number (quantity) of segments in journal */
-	uint32_t ji_pad;
-
-	char ji_reserved[64];
-};
-
-/*
- *  resource index structure 
- *
- *  One of these for each resource group in the filesystem.
- *  These descriptors are packed contiguously within the rindex inode (file).
- *  Also see struct gfs_rgrp.
- */
-
-struct gfs_rindex {
-	uint64_t ri_addr;     /* block # of 1st block (header) in rgrp */
-	uint32_t ri_length;   /* # fs blocks containing rgrp header & bitmap */
-	uint32_t ri_pad;
-
-	uint64_t ri_data1;    /* block # of first data/meta block in rgrp */
-	uint32_t ri_data;     /* number (qty) of data/meta blocks in rgrp */
-
-	uint32_t ri_bitbytes; /* total # bytes used by block alloc bitmap */
-
-	char ri_reserved[64];
-};
-
-/*
- *  resource group header structure
- *
- *  One of these at beginning of the first block of an rgrp,
- *     followed by block alloc bitmap data in remainder of first block.
- *  Each resource group contains:
- *    Header block, including block allocation statistics (struct gfs_rgrp)
- *       and first part of block alloc bitmap.
- *    Bitmap block(s), continuing block alloc bitmap started in header block.
- *    Data/meta blocks, allocatable blocks containing file data and metadata.
- *  
- *  In older versions, now-unused (but previously allocated) dinodes were
- *  saved for re-use in an on-disk linked list (chain).  This is no longer
- *  done, but support still exists for reclaiming dinodes from this list,
- *  to support upgrades from older on-disk formats.
- */
-
-/* Each data block within rgrp is represented by 2 bits in the alloc bitmap */
-#define GFS_NBBY                (4)  /* # blocks represented by 1 bitmap byte */
-#define GFS_BIT_SIZE            (2)
-#define GFS_BIT_MASK            (0x00000003)
-
-/*
- * 4 possible block allocation states:
- *   bit 0 = alloc(1)/free(0)
- *   bit 1 = metadata(1)/data(0)
- */
-#define GFS_BLKST_FREE          (0)
-#define GFS_BLKST_USED          (1)
-#define GFS_BLKST_FREEMETA      (2)
-#define GFS_BLKST_USEDMETA      (3)
-
-struct gfs_rgrp {
-	struct gfs_meta_header rg_header;
-
-	uint32_t rg_flags;      /* ?? */
-
-	uint32_t rg_free;       /* Number (qty) of free data blocks */
-
-	/* Dinodes are USEDMETA, but are handled separately from other METAs */
-	uint32_t rg_useddi;     /* Number (qty) of dinodes (used or free) */
-	uint32_t rg_freedi;     /* Number (qty) of unused (free) dinodes */
-	struct gfs_inum rg_freedi_list; /* 1st block in chain of free dinodes */
-
-	/* These META statistics do not include dinodes (used or free) */
-	uint32_t rg_usedmeta;   /* Number (qty) of used metadata blocks */
-	uint32_t rg_freemeta;   /* Number (qty) of unused metadata blocks */
-
-	char rg_reserved[64];
-};
-
-/*
- *  quota structure
- */
-
-struct gfs_quota {
-	uint64_t qu_limit;
-	uint64_t qu_warn;
-	int64_t qu_value;
-
-	char qu_reserved[64];
-};
-
-/*
- *  dinode (disk inode) structure
- *  The ondisk representation of inodes
- *  One for each file, directory, etc.
- *  GFS does not put more than one inode in a single block.
- *  The inode may be "stuffed", carrying file data along with metadata,
- *    if the file data is small enough.
- *  Otherwise, the inode block contains pointers to other blocks that contain
- *    either file data or other pointers to other blocks (indirect addressing
- *    via a metadata tree).
- */
-
-#define GFS_MAX_META_HEIGHT     (10)
-#define GFS_DIR_MAX_DEPTH       (17)
-
-/*  Dinode types  */
-#define GFS_FILE_NON            (0)
-#define GFS_FILE_REG            (1)    /* regular file */
-#define GFS_FILE_DIR            (2)    /* directory */
-#define GFS_FILE_LNK            (5)    /* link */
-#define GFS_FILE_BLK            (7)    /* block device node */
-#define GFS_FILE_CHR            (8)    /* character device node */
-#define GFS_FILE_FIFO           (101)  /* fifo/pipe */
-#define GFS_FILE_SOCK           (102)  /* socket */
-
-/*  Dinode flags  */
-#define GFS_DIF_JDATA             (0x00000001) /* jrnl all data for this file */
-#define GFS_DIF_EXHASH            (0x00000002) /* hashed directory (leaves) */
-#define GFS_DIF_UNUSED            (0x00000004) /* unused dinode */
-#define GFS_DIF_EA_INDIRECT       (0x00000008) /* extended attribute, indirect*/
-#define GFS_DIF_DIRECTIO          (0x00000010)
-#define GFS_DIF_IMMUTABLE         (0x00000020) /* Can't change file */
-#define GFS_DIF_APPENDONLY        (0x00000040) /* Can only add to end of file */
-#define GFS_DIF_NOATIME           (0x00000080) /* Don't update access time
-						  (currently unused/ignored) */
-#define GFS_DIF_SYNC              (0x00000100) /* Flush to disk, don't cache
-						  (currently unused/ignored) */
-#define GFS_DIF_INHERIT_DIRECTIO  (0x40000000) /* new files get DIRECTIO flag */
-#define GFS_DIF_INHERIT_JDATA     (0x80000000) /* new files get JDATA flag */
-
-struct gfs_dinode {
-	struct gfs_meta_header di_header;
-
-	struct gfs_inum di_num; /* formal inode # and block address */
-
-	uint32_t di_mode;	/* mode of file */
-	uint32_t di_uid;	/* owner's user id */
-	uint32_t di_gid;	/* owner's group id */
-	uint32_t di_nlink;	/* number (qty) of links to this file */
-	uint64_t di_size;	/* number (qty) of bytes in file */
-	uint64_t di_blocks;	/* number (qty) of blocks in file */
-	int64_t di_atime;	/* time last accessed */
-	int64_t di_mtime;	/* time last modified */
-	int64_t di_ctime;	/* time last changed */
-
-	/*  Non-zero only for character or block device nodes  */
-	uint32_t di_major;	/* device major number */
-	uint32_t di_minor;	/* device minor number */
-
-	/*  Block allocation strategy  */
-	uint64_t di_rgrp;	/* dinode rgrp block number */
-	uint64_t di_goal_rgrp;	/* rgrp to alloc from next */
-	uint32_t di_goal_dblk;	/* data block goal */
-	uint32_t di_goal_mblk;	/* metadata block goal */
-
-	uint32_t di_flags;	/* GFS_DIF_... */
-
-	/*  struct gfs_rindex, struct gfs_jindex, or struct gfs_dirent */
-	uint32_t di_payload_format;  /* GFS_FORMAT_... */
-	uint16_t di_type;	/* GFS_FILE_... type of file */
-	uint16_t di_height;	/* height of metadata (0 == stuffed) */
-	uint32_t di_incarn;	/* incarnation (unused, see gfs_meta_header) */
-	uint16_t di_pad;
-
-	/*  These only apply to directories  */
-	uint16_t di_depth;	/* Number of bits in the table */
-	uint32_t di_entries;	/* The # (qty) of entries in the directory */
-
-	/*  This formed an on-disk chain of unused dinodes  */
-	struct gfs_inum di_next_unused;  /* used in old versions only */
-
-	uint64_t di_eattr;	/* extended attribute block number */
-
-	char di_reserved[56];
-};
-
-/*
- *  indirect block header
- *
- *  A component of a dinode's indirect addressing metadata tree.
- *  These are pointed to by pointers in dinodes or other indirect blocks.
- */
-
-struct gfs_indirect {
-	struct gfs_meta_header in_header;
-
-	char in_reserved[64];
-};
-
-/*
- *  directory structure - many of these per directory file
- *
- * See comments at beginning of dir.c
- */
-
-#define GFS_FNAMESIZE               (255)
-#define GFS_DIRENT_SIZE(name_len) ((sizeof(struct gfs_dirent) + (name_len) + 7) & ~7)
-#define IS_LEAF     (1) /* Hashed (leaf) directory */
-#define IS_DINODE   (2) /* Linear (stuffed dinode block) directory */
-
-struct gfs_dirent {
-	struct gfs_inum de_inum;    /* formal inode number and block address */
-	uint32_t de_hash;           /* hash of the filename */
-	uint16_t de_rec_len;        /* the length of the dirent */
-	uint16_t de_name_len;       /* the length of the name */
-	uint16_t de_type;           /* GFS_FILE_... type of dinode this points to */
-
-	char de_reserved[14];
-};
-
-/*
- *  Header of leaf directory nodes
- *
- * See comments at beginning of dir.c
- */
-
-struct gfs_leaf {
-	struct gfs_meta_header lf_header;
-
-	uint16_t lf_depth;          /* Depth of leaf */
-	uint16_t lf_entries;        /* Number of dirents in leaf */
-	uint32_t lf_dirent_format;  /* GFS_FORMAT_DE (version #) */
-	uint64_t lf_next;           /* Next leaf, if overflow */
-
-	char lf_reserved[64];
-};
-
-/*
- *  Log header structure
- *
- *  Two of these are in the first block of a transaction log:
- *    1)  at beginning of block
- *    2)  at end of first 512-byte sector within block
- */
-
-#define GFS_LOG_HEAD_UNMOUNT    (0x00000001)  /* log is clean, can unmount fs */
-
-struct gfs_log_header {
-	struct gfs_meta_header lh_header;
-
-	uint32_t lh_flags;	/* GFS_LOG_HEAD_... */
-	uint32_t lh_pad;
-
-	uint64_t lh_first;	/* Block number of first header in this trans */
-	uint64_t lh_sequence;	/* Sequence number of this transaction */
-
-	uint64_t lh_tail;	/* Block number of log tail */
-	uint64_t lh_last_dump;	/* Block number of last dump */
-
-	char lh_reserved[64];
-};
-
-/*
- *  Log type descriptor
- *
- *  One of these for each chunk in a transaction
- */
-
-#define GFS_LOG_DESC_METADATA   (300)    /* metadata */
-/*  ld_data1 is the number (quantity) of metadata blocks in the descriptor.
-    ld_data2 is unused.
-    */
-
-#define GFS_LOG_DESC_IUL        (400)    /* unlinked inode */
-/*  ld_data1 is TRUE if this is a dump.
-    ld_data2 is unused.
-    FixMe!!!  ld_data1 should be the number (quantity) of entries.
-              ld_data2 should be "TRUE if this is a dump".
-    */
-
-#define GFS_LOG_DESC_IDA        (401)    /* de-allocated inode */
-/*  ld_data1 is unused.
-    ld_data2 is unused.
-    FixMe!!!  ld_data1 should be the number (quantity) of entries.
-    */
-
-#define GFS_LOG_DESC_Q          (402)    /* quota */
-/*  ld_data1 is the number of quota changes in the descriptor.
-    ld_data2 is TRUE if this is a dump.
-    */
-
-#define GFS_LOG_DESC_LAST       (500)    /* final in a logged transaction */
-/*  ld_data1 is unused.
-    ld_data2 is unused.
-    */
-
-struct gfs_log_descriptor {
-	struct gfs_meta_header ld_header;
-
-	uint32_t ld_type;	/* GFS_LOG_DESC_... Type of this log chunk */
-	uint32_t ld_length;	/* Number of buffers in this chunk */
-	uint32_t ld_data1;	/* descriptor-specific field */
-	uint32_t ld_data2;	/* descriptor-specific field */
-
-	char ld_reserved[64];
-};
-
-/*
- *  Metadata block tags
- *
- *  One for each logged block.  Tells where block really belongs on-disk.
- *  These descriptor tags are packed contiguously after a gfs_log_descriptor.
- */
-
-struct gfs_block_tag {
-	uint64_t bt_blkno;	/* inplace block number */
-	uint32_t bt_flags;	/* ?? */
-	uint32_t bt_pad;
-};
-
-/*
- *  Quota Journal Tag
- */
-
-#define GFS_QTF_USER            (0x00000001)
-
-struct gfs_quota_tag {
-	int64_t qt_change;
-	uint32_t qt_flags;      /* GFS_QTF_... */
-	uint32_t qt_id;
-};
-
-/*
- *  Extended attribute header format
- */
-
-#define GFS_EA_MAX_NAME_LEN     (255)
-#define GFS_EA_MAX_DATA_LEN     (65536)
-
-#define GFS_EATYPE_UNUSED       (0)
-#define GFS_EATYPE_USR          (1)     /* user attribute */
-#define GFS_EATYPE_SYS          (2)     /* system attribute */
-#define GFS_EATYPE_SECURITY	(3)	/* security attribute */
-
-#define GFS_EATYPE_LAST         (3)
-#define GFS_EATYPE_VALID(x)     ((x) <= GFS_EATYPE_LAST)
-
-#define GFS_EAFLAG_LAST         (0x01)	/* last ea in block */
-
-struct gfs_ea_header {
-	uint32_t ea_rec_len;    /* total record length: hdr + name + data */
-	uint32_t ea_data_len;   /* data length, in bytes */
-	uint8_t ea_name_len;    /* no NULL pointer after the string */
-	uint8_t ea_type;        /* GFS_EATYPE_... */
-	uint8_t ea_flags;       /* GFS_EAFLAG_... */
-	uint8_t ea_num_ptrs;    /* # fs blocks needed for EA */
-	uint32_t ea_pad;
-};
-
-/*
- * Statfs change
- * Describes an change to the pool of free and allocated
- * blocks.
- */
-
-struct gfs_statfs_change {
-	uint64_t sc_total;
-	uint64_t sc_free;
-	uint64_t sc_dinodes;
-};
-
-struct gfs_statfs_change_host {
-	int64_t sc_total;
-	int64_t sc_free;
-	int64_t sc_dinodes;
-};
-
-/*  Endian functions  */
-
-#define GFS_ENDIAN_BIG
-
-#ifdef GFS_ENDIAN_BIG
-
-#define gfs16_to_cpu be16_to_cpu
-#define gfs32_to_cpu be32_to_cpu
-#define gfs64_to_cpu be64_to_cpu
-
-#define cpu_to_gfs16 cpu_to_be16
-#define cpu_to_gfs32 cpu_to_be32
-#define cpu_to_gfs64 cpu_to_be64
-
-#else				/*  GFS_ENDIAN_BIG  */
-
-#define gfs16_to_cpu le16_to_cpu
-#define gfs32_to_cpu le32_to_cpu
-#define gfs64_to_cpu le64_to_cpu
-
-#define cpu_to_gfs16 cpu_to_le16
-#define cpu_to_gfs32 cpu_to_le32
-#define cpu_to_gfs64 cpu_to_le64
-
-#endif				/*  GFS_ENDIAN_BIG  */
-
-/*  Translation functions  */
-
-void gfs_inum_in(struct gfs_inum *no, char *buf);
-void gfs_inum_out(struct gfs_inum *no, char *buf);
-void gfs_meta_header_in(struct gfs_meta_header *mh, char *buf);
-void gfs_meta_header_out(struct gfs_meta_header *mh, char *buf);
-void gfs_sb_in(struct gfs_sb *sb, char *buf);
-void gfs_sb_out(struct gfs_sb *sb, char *buf);
-void gfs_jindex_in(struct gfs_jindex *jindex, char *buf);
-void gfs_jindex_out(struct gfs_jindex *jindex, char *buf);
-void gfs_rindex_in(struct gfs_rindex *rindex, char *buf);
-void gfs_rindex_out(struct gfs_rindex *rindex, char *buf);
-void gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf);
-void gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf);
-void gfs_quota_in(struct gfs_quota *quota, char *buf);
-void gfs_quota_out(struct gfs_quota *quota, char *buf);
-void gfs_dinode_in(struct gfs_dinode *dinode, char *buf);
-void gfs_dinode_out(struct gfs_dinode *dinode, char *buf);
-void gfs_indirect_in(struct gfs_indirect *indirect, char *buf);
-void gfs_indirect_out(struct gfs_indirect *indirect, char *buf);
-void gfs_dirent_in(struct gfs_dirent *dirent, char *buf);
-void gfs_dirent_out(struct gfs_dirent *dirent, char *buf);
-void gfs_leaf_in(struct gfs_leaf *leaf, char *buf);
-void gfs_leaf_out(struct gfs_leaf *leaf, char *buf);
-void gfs_log_header_in(struct gfs_log_header *head, char *buf);
-void gfs_log_header_out(struct gfs_log_header *head, char *buf);
-void gfs_desc_in(struct gfs_log_descriptor *desc, char *buf);
-void gfs_desc_out(struct gfs_log_descriptor *desc, char *buf);
-void gfs_block_tag_in(struct gfs_block_tag *btag, char *buf);
-void gfs_block_tag_out(struct gfs_block_tag *btag, char *buf);
-void gfs_quota_tag_in(struct gfs_quota_tag *qtag, char *buf);
-void gfs_quota_tag_out(struct gfs_quota_tag *qtag, char *buf);
-void gfs_ea_header_in(struct gfs_ea_header *qtag, char *buf);
-void gfs_ea_header_out(struct gfs_ea_header *qtag, char *buf);
-
-/*  Printing functions  */
-
-void gfs_inum_print(struct gfs_inum *no);
-void gfs_meta_header_print(struct gfs_meta_header *mh);
-void gfs_sb_print(struct gfs_sb *sb);
-void gfs_jindex_print(struct gfs_jindex *jindex);
-void gfs_rindex_print(struct gfs_rindex *rindex);
-void gfs_rgrp_print(struct gfs_rgrp *rgrp);
-void gfs_quota_print(struct gfs_quota *quota);
-void gfs_dinode_print(struct gfs_dinode *dinode);
-void gfs_indirect_print(struct gfs_indirect *indirect);
-void gfs_dirent_print(struct gfs_dirent *dirent, const char *name);
-void gfs_leaf_print(struct gfs_leaf *leaf);
-void gfs_log_header_print(struct gfs_log_header *head);
-void gfs_desc_print(struct gfs_log_descriptor *desc);
-void gfs_block_tag_print(struct gfs_block_tag *tag);
-void gfs_quota_tag_print(struct gfs_quota_tag *tag);
-void gfs_ea_header_print(struct gfs_ea_header *ea, char *name);
-
-/*  The hash function for ExHash directories  */
-
-uint32_t gfs_dir_hash(const char *data, int len);
-
-#endif /* __GFS_ONDISK_DOT_H__ */
-
-
-
-#ifdef WANT_GFS_CONVERSION_FUNCTIONS
-
-#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
-#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
-#define CPIN_16(s1, s2, member) {(s1->member) = gfs16_to_cpu((s2->member));}
-#define CPOUT_16(s1, s2, member) {(s2->member) = cpu_to_gfs16((s1->member));}
-#define CPIN_32(s1, s2, member) {(s1->member) = gfs32_to_cpu((s2->member));}
-#define CPOUT_32(s1, s2, member) {(s2->member) = cpu_to_gfs32((s1->member));}
-#define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));}
-#define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));}
-
-#define pa(struct, member, count) print_array(#member, struct->member, count);
-
-/**
- * print_array - Print out an array of bytes
- * @title: what to print before the array
- * @buf: the array
- * @count: the number of bytes
- *
- */
-
-static void
-print_array(const char *title, char *buf, int count)
-{
-	int x;
-
-	printk("  %s =\n", title);
-	for (x = 0; x < count; x++) {
-		printk("%.2X ", (unsigned char)buf[x]);
-		if (x % 16 == 15)
-			printk("\n");
-	}
-	if (x % 16)
-		printk("\n");
-}
-
-/**
- * gfs_inum_in - Read in an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_in(struct gfs_inum *no, char *buf)
-{
-	struct gfs_inum *str = (struct gfs_inum *)buf;
-
-	CPIN_64(no, str, no_formal_ino);
-	CPIN_64(no, str, no_addr);
-}
-
-/**
- * gfs_inum_out - Write out an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_out(struct gfs_inum *no, char *buf)
-{
-	struct gfs_inum *str = (struct gfs_inum *)buf;
-
-	CPOUT_64(no, str, no_formal_ino);
-	CPOUT_64(no, str, no_addr);
-}
-
-/**
- * gfs_inum_print - Print out a inode number
- * @no: the cpu-order buffer
- *
- */
-
-void
-gfs_inum_print(struct gfs_inum *no)
-{
-	pv(no, no_formal_ino, "%llu");
-	pv(no, no_addr, "%llu");
-}
-
-/**
- * gfs_meta_header_in - Read in a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_meta_header_in(struct gfs_meta_header *mh, char *buf)
-{
-	struct gfs_meta_header *str = (struct gfs_meta_header *)buf;
-
-	CPIN_32(mh, str, mh_magic);
-	CPIN_32(mh, str, mh_type);
-	CPIN_64(mh, str, mh_generation);
-	CPIN_32(mh, str, mh_format);
-	CPIN_32(mh, str, mh_incarn);
-}
-
-/**
- * gfs_meta_header_in - Write out a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- * Don't ever change the generation number in this routine.
- * It's done manually in increment_generation().
- */
-
-void
-gfs_meta_header_out(struct gfs_meta_header *mh, char *buf)
-{
-	struct gfs_meta_header *str = (struct gfs_meta_header *)buf;
-
-	CPOUT_32(mh, str, mh_magic);
-	CPOUT_32(mh, str, mh_type);
-#if 0
-	/* Don't do this!
-	   Mh_generation should only be change manually. */
-	CPOUT_64(mh, str, mh_generation);
-#endif
-	CPOUT_32(mh, str, mh_format);
-	CPOUT_32(mh, str, mh_incarn);
-}
-
-/**
- * gfs_meta_header_print - Print out a metadata header
- * @mh: the cpu-order buffer
- *
- */
-
-void
-gfs_meta_header_print(struct gfs_meta_header *mh)
-{
-	pv(mh, mh_magic, "0x%.8X");
-	pv(mh, mh_type, "%u");
-	pv(mh, mh_generation, "%llu");
-	pv(mh, mh_format, "%u");
-	pv(mh, mh_incarn, "%u");
-}
-
-/**
- * gfs_sb_in - Read in a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_in(struct gfs_sb *sb, char *buf)
-{
-	struct gfs_sb *str = (struct gfs_sb *)buf;
-
-	gfs_meta_header_in(&sb->sb_header, buf);
-
-	CPIN_32(sb, str, sb_fs_format);
-	CPIN_32(sb, str, sb_multihost_format);
-	CPIN_32(sb, str, sb_flags);
-
-	CPIN_32(sb, str, sb_bsize);
-	CPIN_32(sb, str, sb_bsize_shift);
-	CPIN_32(sb, str, sb_seg_size);
-
-	gfs_inum_in(&sb->sb_jindex_di, (char *)&str->sb_jindex_di);
-	gfs_inum_in(&sb->sb_rindex_di, (char *)&str->sb_rindex_di);
-	gfs_inum_in(&sb->sb_root_di, (char *)&str->sb_root_di);
-
-	CPIN_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPIN_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_in(&sb->sb_quota_di, (char *)&str->sb_quota_di);
-	gfs_inum_in(&sb->sb_license_di, (char *)&str->sb_license_di);
-
-	CPIN_08(sb, str, sb_reserved, 96);
-}
-
-/**
- * gfs_sb_out - Write out a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_out(struct gfs_sb *sb, char *buf)
-{
-	struct gfs_sb *str = (struct gfs_sb *)buf;
-
-	gfs_meta_header_out(&sb->sb_header, buf);
-
-	CPOUT_32(sb, str, sb_fs_format);
-	CPOUT_32(sb, str, sb_multihost_format);
-	CPOUT_32(sb, str, sb_flags);
-
-	CPOUT_32(sb, str, sb_bsize);
-	CPOUT_32(sb, str, sb_bsize_shift);
-	CPOUT_32(sb, str, sb_seg_size);
-
-	gfs_inum_out(&sb->sb_jindex_di, (char *)&str->sb_jindex_di);
-	gfs_inum_out(&sb->sb_rindex_di, (char *)&str->sb_rindex_di);
-	gfs_inum_out(&sb->sb_root_di, (char *)&str->sb_root_di);
-
-	CPOUT_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPOUT_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_out(&sb->sb_quota_di, (char *)&str->sb_quota_di);
-	gfs_inum_out(&sb->sb_license_di, (char *)&str->sb_license_di);
-
-	CPOUT_08(sb, str, sb_reserved, 96);
-}
-
-/**
- * gfs_sb_print - Print out a superblock
- * @sb: the cpu-order buffer
- *
- */
-
-void
-gfs_sb_print(struct gfs_sb *sb)
-{
-	gfs_meta_header_print(&sb->sb_header);
-
-	pv(sb, sb_fs_format, "%u");
-	pv(sb, sb_multihost_format, "%u");
-	pv(sb, sb_flags, "%u");
-
-	pv(sb, sb_bsize, "%u");
-	pv(sb, sb_bsize_shift, "%u");
-	pv(sb, sb_seg_size, "%u");
-
-	gfs_inum_print(&sb->sb_jindex_di);
-	gfs_inum_print(&sb->sb_rindex_di);
-	gfs_inum_print(&sb->sb_root_di);
-
-	pv(sb, sb_lockproto, "%s");
-	pv(sb, sb_locktable, "%s");
-
-	gfs_inum_print(&sb->sb_quota_di);
-	gfs_inum_print(&sb->sb_license_di);
-
-	pa(sb, sb_reserved, 96);
-}
-
-/**
- * gfs_jindex_in - Read in a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_in(struct gfs_jindex *jindex, char *buf)
-{
-	struct gfs_jindex *str = (struct gfs_jindex *)buf;
-
-	CPIN_64(jindex, str, ji_addr);
-	CPIN_32(jindex, str, ji_nsegment);
-	CPIN_32(jindex, str, ji_pad);
-
-	CPIN_08(jindex, str, ji_reserved, 64);
-}
-
-/**
- * gfs_jindex_out - Write out a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_out(struct gfs_jindex *jindex, char *buf)
-{
-	struct gfs_jindex *str = (struct gfs_jindex *)buf;
-
-	CPOUT_64(jindex, str, ji_addr);
-	CPOUT_32(jindex, str, ji_nsegment);
-	CPOUT_32(jindex, str, ji_pad);
-
-	CPOUT_08(jindex, str, ji_reserved, 64);
-}
-
-/**
- * gfs_jindex_print - Print out a journal index structure
- * @ji: the cpu-order buffer
- *
- */
-
-void
-gfs_jindex_print(struct gfs_jindex *ji)
-{
-	pv(ji, ji_addr, "%llu");
-	pv(ji, ji_nsegment, "%u");
-	pv(ji, ji_pad, "%u");
-
-	pa(ji, ji_reserved, 64);
-}
-
-/**
- * gfs_rindex_in - Read in a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_in(struct gfs_rindex *grindex, char *buf)
-{
-	struct gfs_rindex *str = (struct gfs_rindex *)buf;
-
-	CPIN_64(grindex, str, ri_addr);
-	CPIN_32(grindex, str, ri_length);
-	CPIN_32(grindex, str, ri_pad);
-
-	CPIN_64(grindex, str, ri_data1);
-	CPIN_32(grindex, str, ri_data);
-
-	CPIN_32(grindex, str, ri_bitbytes);
-
-	CPIN_08(grindex, str, ri_reserved, 64);
-}
-
-/**
- * gfs_rindex_out - Write out a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_out(struct gfs_rindex *grindex, char *buf)
-{
-	struct gfs_rindex *str = (struct gfs_rindex *)buf;
-
-	CPOUT_64(grindex, str, ri_addr);
-	CPOUT_32(grindex, str, ri_length);
-	CPOUT_32(grindex, str, ri_pad);
-
-	CPOUT_64(grindex, str, ri_data1);
-	CPOUT_32(grindex, str, ri_data);
-
-	CPOUT_32(grindex, str, ri_bitbytes);
-
-	CPOUT_08(grindex, str, ri_reserved, 64);
-}
-
-/**
- * gfs_rindex_print - Print out a resource index structure
- * @ri: the cpu-order buffer
- *
- */
-
-void
-gfs_rindex_print(struct gfs_rindex *ri)
-{
-	pv(ri, ri_addr, "%llu");
-	pv(ri, ri_length, "%u");
-	pv(ri, ri_pad, "%u");
-
-	pv(ri, ri_data1, "%llu");
-	pv(ri, ri_data, "%u");
-
-	pv(ri, ri_bitbytes, "%u");
-
-	pa(ri, ri_reserved, 64);
-}
-
-/**
- * gfs_rgrp_in - Read in a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf)
-{
-	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
-
-	gfs_meta_header_in(&rgrp->rg_header, buf);
-
-	CPIN_32(rgrp, str, rg_flags);
-
-	CPIN_32(rgrp, str, rg_free);
-
-	CPIN_32(rgrp, str, rg_useddi);
-	CPIN_32(rgrp, str, rg_freedi);
-	gfs_inum_in(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
-
-	CPIN_32(rgrp, str, rg_usedmeta);
-	CPIN_32(rgrp, str, rg_freemeta);
-
-	CPIN_08(rgrp, str, rg_reserved, 64);
-}
-
-/**
- * gfs_rgrp_out - Write out a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf)
-{
-	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
-
-	gfs_meta_header_out(&rgrp->rg_header, buf);
-
-	CPOUT_32(rgrp, str, rg_flags);
-
-	CPOUT_32(rgrp, str, rg_free);
-
-	CPOUT_32(rgrp, str, rg_useddi);
-	CPOUT_32(rgrp, str, rg_freedi);
-	gfs_inum_out(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
-
-	CPOUT_32(rgrp, str, rg_usedmeta);
-	CPOUT_32(rgrp, str, rg_freemeta);
-
-	CPOUT_08(rgrp, str, rg_reserved, 64);
-}
-
-/**
- * gfs_rgrp_print - Print out a resource group header
- * @rg: the cpu-order buffer
- *
- */
-
-void
-gfs_rgrp_print(struct gfs_rgrp *rg)
-{
-	gfs_meta_header_print(&rg->rg_header);
-
-	pv(rg, rg_flags, "%u");
-
-	pv(rg, rg_free, "%u");
-
-	pv(rg, rg_useddi, "%u");
-	pv(rg, rg_freedi, "%u");
-	gfs_inum_print(&rg->rg_freedi_list);
-
-	pv(rg, rg_usedmeta, "%u");
-	pv(rg, rg_freemeta, "%u");
-
-	pa(rg, rg_reserved, 64);
-}
-
-/**
- * gfs_quota_in - Read in a quota structures
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_in(struct gfs_quota *quota, char *buf)
-{
-	struct gfs_quota *str = (struct gfs_quota *)buf;
-
-	CPIN_64(quota, str, qu_limit);
-	CPIN_64(quota, str, qu_warn);
-	CPIN_64(quota, str, qu_value);
-
-	CPIN_08(quota, str, qu_reserved, 64);
-}
-
-/**
- * gfs_quota_out - Write out a quota structure
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_out(struct gfs_quota *quota, char *buf)
-{
-	struct gfs_quota *str = (struct gfs_quota *)buf;
-
-	CPOUT_64(quota, str, qu_limit);
-	CPOUT_64(quota, str, qu_warn);
-	CPOUT_64(quota, str, qu_value);
-
-	CPOUT_08(quota, str, qu_reserved, 64);
-}
-
-/**
- * gfs_quota_print - Print out a quota structure
- * @quota: the cpu-order buffer
- *
- */
-
-void
-gfs_quota_print(struct gfs_quota *quota)
-{
-	pv(quota, qu_limit, "%llu");
-	pv(quota, qu_warn, "%llu");
-	pv(quota, qu_value, "%llu");
-
-	pa(quota, qu_reserved, 64);
-}
-
-/**
- * gfs_dinode_in - Read in a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_in(struct gfs_dinode *dinode, char *buf)
-{
-	struct gfs_dinode *str = (struct gfs_dinode *)buf;
-
-	gfs_meta_header_in(&dinode->di_header, buf);
-
-	gfs_inum_in(&dinode->di_num, (char *)&str->di_num);
-
-	CPIN_32(dinode, str, di_mode);
-	CPIN_32(dinode, str, di_uid);
-	CPIN_32(dinode, str, di_gid);
-	CPIN_32(dinode, str, di_nlink);
-	CPIN_64(dinode, str, di_size);
-	CPIN_64(dinode, str, di_blocks);
-	CPIN_64(dinode, str, di_atime);
-	CPIN_64(dinode, str, di_mtime);
-	CPIN_64(dinode, str, di_ctime);
-	CPIN_32(dinode, str, di_major);
-	CPIN_32(dinode, str, di_minor);
-
-	CPIN_64(dinode, str, di_rgrp);
-	CPIN_64(dinode, str, di_goal_rgrp);
-	CPIN_32(dinode, str, di_goal_dblk);
-	CPIN_32(dinode, str, di_goal_mblk);
-	CPIN_32(dinode, str, di_flags);
-	CPIN_32(dinode, str, di_payload_format);
-	CPIN_16(dinode, str, di_type);
-	CPIN_16(dinode, str, di_height);
-	CPIN_32(dinode, str, di_incarn);
-	CPIN_16(dinode, str, di_pad);
-
-	CPIN_16(dinode, str, di_depth);
-	CPIN_32(dinode, str, di_entries);
-
-	gfs_inum_in(&dinode->di_next_unused, (char *)&str->di_next_unused);
-
-	CPIN_64(dinode, str, di_eattr);
-
-	CPIN_08(dinode, str, di_reserved, 56);
-}
-
-/**
- * gfs_dinode_out - Write out a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_out(struct gfs_dinode *dinode, char *buf)
-{
-	struct gfs_dinode *str = (struct gfs_dinode *)buf;
-
-	gfs_meta_header_out(&dinode->di_header, buf);
-
-	gfs_inum_out(&dinode->di_num, (char *)&str->di_num);
-
-	CPOUT_32(dinode, str, di_mode);
-	CPOUT_32(dinode, str, di_uid);
-	CPOUT_32(dinode, str, di_gid);
-	CPOUT_32(dinode, str, di_nlink);
-	CPOUT_64(dinode, str, di_size);
-	CPOUT_64(dinode, str, di_blocks);
-	CPOUT_64(dinode, str, di_atime);
-	CPOUT_64(dinode, str, di_mtime);
-	CPOUT_64(dinode, str, di_ctime);
-	CPOUT_32(dinode, str, di_major);
-	CPOUT_32(dinode, str, di_minor);
-
-	CPOUT_64(dinode, str, di_rgrp);
-	CPOUT_64(dinode, str, di_goal_rgrp);
-	CPOUT_32(dinode, str, di_goal_dblk);
-	CPOUT_32(dinode, str, di_goal_mblk);
-	CPOUT_32(dinode, str, di_flags);
-	CPOUT_32(dinode, str, di_payload_format);
-	CPOUT_16(dinode, str, di_type);
-	CPOUT_16(dinode, str, di_height);
-	CPOUT_32(dinode, str, di_incarn);
-	CPOUT_16(dinode, str, di_pad);
-
-	CPOUT_16(dinode, str, di_depth);
-	CPOUT_32(dinode, str, di_entries);
-
-	gfs_inum_out(&dinode->di_next_unused, (char *)&str->di_next_unused);
-
-	CPOUT_64(dinode, str, di_eattr);
-
-	CPOUT_08(dinode, str, di_reserved, 56);
-}
-
-/**
- * gfs_dinode_print - Print out a dinode
- * @di: the cpu-order buffer
- *
- */
-
-void
-gfs_dinode_print(struct gfs_dinode *di)
-{
-	gfs_meta_header_print(&di->di_header);
-
-	gfs_inum_print(&di->di_num);
-
-	pv(di, di_mode, "0%o");
-	pv(di, di_uid, "%u");
-	pv(di, di_gid, "%u");
-	pv(di, di_nlink, "%u");
-	pv(di, di_size, "%llu");
-	pv(di, di_blocks, "%llu");
-	pv(di, di_atime, "%lld");
-	pv(di, di_mtime, "%llu");
-	pv(di, di_ctime, "%llu");
-	pv(di, di_major, "%u");
-	pv(di, di_minor, "%u");
-
-	pv(di, di_rgrp, "%llu");
-	pv(di, di_goal_rgrp, "%llu");
-	pv(di, di_goal_dblk, "%u");
-	pv(di, di_goal_mblk, "%u");
-	pv(di, di_flags, "0x%.8X");
-	pv(di, di_payload_format, "%u");
-	pv(di, di_type, "%u");
-	pv(di, di_height, "%u");
-	pv(di, di_incarn, "%u");
-	pv(di, di_pad, "%u");
-
-	pv(di, di_depth, "%u");
-	pv(di, di_entries, "%u");
-
-	gfs_inum_print(&di->di_next_unused);
-
-	pv(di, di_eattr, "%llu");
-
-	pa(di, di_reserved, 56);
-}
-
-/**
- * gfs_indirect_in - copy in the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_in(struct gfs_indirect *indirect, char *buf)
-{
-	struct gfs_indirect *str = (struct gfs_indirect *)buf;
-
-	gfs_meta_header_in(&indirect->in_header, buf);
-
-	CPIN_08(indirect, str, in_reserved, 64);
-}
-
-/**
- * gfs_indirect_out - copy out the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_out(struct gfs_indirect *indirect, char *buf)
-{
-	struct gfs_indirect *str = (struct gfs_indirect *)buf;
-
-	gfs_meta_header_out(&indirect->in_header, buf);
-
-	CPOUT_08(indirect, str, in_reserved, 64);
-}
-
-/**
- * gfs_indirect_print - Print out a indirect block header
- * @indirect: the cpu-order buffer
- *
- */
-
-void
-gfs_indirect_print(struct gfs_indirect *indirect)
-{
-	gfs_meta_header_print(&indirect->in_header);
-
-	pa(indirect, in_reserved, 64);
-}
-
-/**
- * gfs_dirent_in - Read in a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_in(struct gfs_dirent *dirent, char *buf)
-{
-	struct gfs_dirent *str = (struct gfs_dirent *)buf;
-
-	gfs_inum_in(&dirent->de_inum, (char *)&str->de_inum);
-	CPIN_32(dirent, str, de_hash);
-	CPIN_16(dirent, str, de_rec_len);
-	CPIN_16(dirent, str, de_name_len);
-	CPIN_16(dirent, str, de_type);
-
-	CPIN_08(dirent, str, de_reserved, 14);
-}
-
-/**
- * gfs_dirent_out - Write out a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_out(struct gfs_dirent *dirent, char *buf)
-{
-	struct gfs_dirent *str = (struct gfs_dirent *)buf;
-
-	gfs_inum_out(&dirent->de_inum, (char *)&str->de_inum);
-	CPOUT_32(dirent, str, de_hash);
-	CPOUT_16(dirent, str, de_rec_len);
-	CPOUT_16(dirent, str, de_name_len);
-	CPOUT_16(dirent, str, de_type);
-
-	CPOUT_08(dirent, str, de_reserved, 14);
-}
-
-/**
- * gfs_dirent_print - Print out a directory entry
- * @de: the cpu-order buffer
- * @name: the filename
- *
- */
-
-void
-gfs_dirent_print(struct gfs_dirent *de, const char *name)
-{
-	char buf[GFS_FNAMESIZE + 1];
-
-	gfs_inum_print(&de->de_inum);
-	pv(de, de_hash, "0x%.8X");
-	pv(de, de_rec_len, "%u");
-	pv(de, de_name_len, "%u");
-	pv(de, de_type, "%u");
-
-	pa(de, de_reserved, 14);
-
-	memset(buf, 0, GFS_FNAMESIZE + 1);
-	memcpy(buf, name, de->de_name_len);
-	printk("  name = %s\n", buf);
-}
-
-/**
- * gfs_leaf_in - Read in a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_in(struct gfs_leaf *leaf, char *buf)
-{
-	struct gfs_leaf *str = (struct gfs_leaf *)buf;
-
-	gfs_meta_header_in(&leaf->lf_header, buf);
-
-	CPIN_16(leaf, str, lf_depth);
-	CPIN_16(leaf, str, lf_entries);
-	CPIN_32(leaf, str, lf_dirent_format);
-	CPIN_64(leaf, str, lf_next);
-
-	CPIN_08(leaf, str, lf_reserved, 64);
-}
-
-/**
- * gfs_leaf_out - Write out a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_out(struct gfs_leaf *leaf, char *buf)
-{
-	struct gfs_leaf *str = (struct gfs_leaf *)buf;
-
-	gfs_meta_header_out(&leaf->lf_header, buf);
-
-	CPOUT_16(leaf, str, lf_depth);
-	CPOUT_16(leaf, str, lf_entries);
-	CPOUT_32(leaf, str, lf_dirent_format);
-	CPOUT_64(leaf, str, lf_next);
-
-	CPOUT_08(leaf, str, lf_reserved, 64);
-}
-
-/**
- * gfs_leaf_print - Print out a directory leaf header
- * @lf: the cpu-order buffer
- *
- */
-
-void
-gfs_leaf_print(struct gfs_leaf *lf)
-{
-	gfs_meta_header_print(&lf->lf_header);
-
-	pv(lf, lf_depth, "%u");
-	pv(lf, lf_entries, "%u");
-	pv(lf, lf_dirent_format, "%u");
-	pv(lf, lf_next, "%llu");
-
-	pa(lf, lf_reserved, 64);
-}
-
-/**
- * gfs_log_header_in - Read in a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_in(struct gfs_log_header *head, char *buf)
-{
-	struct gfs_log_header *str = (struct gfs_log_header *)buf;
-
-	gfs_meta_header_in(&head->lh_header, buf);
-
-	CPIN_32(head, str, lh_flags);
-	CPIN_32(head, str, lh_pad);
-
-	CPIN_64(head, str, lh_first);
-	CPIN_64(head, str, lh_sequence);
-
-	CPIN_64(head, str, lh_tail);
-	CPIN_64(head, str, lh_last_dump);
-
-	CPIN_08(head, str, lh_reserved, 64);
-}
-
-/**
- * gfs_log_header_out - Write out a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_out(struct gfs_log_header *head, char *buf)
-{
-	struct gfs_log_header *str = (struct gfs_log_header *)buf;
-
-	gfs_meta_header_out(&head->lh_header, buf);
-
-	CPOUT_32(head, str, lh_flags);
-	CPOUT_32(head, str, lh_pad);
-
-	CPOUT_64(head, str, lh_first);
-	CPOUT_64(head, str, lh_sequence);
-
-	CPOUT_64(head, str, lh_tail);
-	CPOUT_64(head, str, lh_last_dump);
-
-	CPOUT_08(head, str, lh_reserved, 64);
-}
-
-/**
- * gfs_log_header_print - Print out a log header
- * @head: the cpu-order buffer
- *
- */
-
-void
-gfs_log_header_print(struct gfs_log_header *lh)
-{
-	gfs_meta_header_print(&lh->lh_header);
-
-	pv(lh, lh_flags, "0x%.8X");
-	pv(lh, lh_pad, "%u");
-
-	pv(lh, lh_first, "%llu");
-	pv(lh, lh_sequence, "%llu");
-
-	pv(lh, lh_tail, "%llu");
-	pv(lh, lh_last_dump, "%llu");
-
-	pa(lh, lh_reserved, 64);
-}
-
-/**
- * gfs_desc_in - Read in a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_in(struct gfs_log_descriptor *desc, char *buf)
-{
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *)buf;
-
-	gfs_meta_header_in(&desc->ld_header, buf);
-
-	CPIN_32(desc, str, ld_type);
-	CPIN_32(desc, str, ld_length);
-	CPIN_32(desc, str, ld_data1);
-	CPIN_32(desc, str, ld_data2);
-
-	CPIN_08(desc, str, ld_reserved, 64);
-}
-
-/**
- * gfs_desc_out - Write out a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_out(struct gfs_log_descriptor *desc, char *buf)
-{
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *)buf;
-
-	gfs_meta_header_out(&desc->ld_header, buf);
-
-	CPOUT_32(desc, str, ld_type);
-	CPOUT_32(desc, str, ld_length);
-	CPOUT_32(desc, str, ld_data1);
-	CPOUT_32(desc, str, ld_data2);
-
-	CPOUT_08(desc, str, ld_reserved, 64);
-}
-
-/**
- * gfs_desc_print - Print out a log descriptor
- * @ld: the cpu-order buffer
- *
- */
-
-void
-gfs_desc_print(struct gfs_log_descriptor *ld)
-{
-	gfs_meta_header_print(&ld->ld_header);
-
-	pv(ld, ld_type, "%u");
-	pv(ld, ld_length, "%u");
-	pv(ld, ld_data1, "%u");
-	pv(ld, ld_data2, "%u");
-
-	pa(ld, ld_reserved, 64);
-}
-
-/**
- * gfs_block_tag_in - Read in a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_in(struct gfs_block_tag *tag, char *buf)
-{
-	struct gfs_block_tag *str = (struct gfs_block_tag *)buf;
-
-	CPIN_64(tag, str, bt_blkno);
-	CPIN_32(tag, str, bt_flags);
-	CPIN_32(tag, str, bt_pad);
-}
-
-/**
- * gfs_block_tag_out - Write out a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_out(struct gfs_block_tag *tag, char *buf)
-{
-	struct gfs_block_tag *str = (struct gfs_block_tag *)buf;
-
-	CPOUT_64(tag, str, bt_blkno);
-	CPOUT_32(tag, str, bt_flags);
-	CPOUT_32(tag, str, bt_pad);
-}
-
-/**
- * gfs_block_tag_print - Print out a block tag
- * @tag: the cpu-order buffer
- *
- */
-
-void
-gfs_block_tag_print(struct gfs_block_tag *tag)
-{
-	pv(tag, bt_blkno, "%llu");
-	pv(tag, bt_flags, "%u");
-	pv(tag, bt_pad, "%u");
-}
-
-/**
- * gfs_quota_tag_in - Read in a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_in(struct gfs_quota_tag *tag, char *buf)
-{
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *)buf;
-
-	CPIN_64(tag, str, qt_change);
-	CPIN_32(tag, str, qt_flags);
-	CPIN_32(tag, str, qt_id);
-}
-
-/**
- * gfs_quota_tag_out - Write out a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_out(struct gfs_quota_tag *tag, char *buf)
-{
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *)buf;
-
-	CPOUT_64(tag, str, qt_change);
-	CPOUT_32(tag, str, qt_flags);
-	CPOUT_32(tag, str, qt_id);
-}
-
-/**
- * gfs_quota_tag_print - Print out a quota tag
- * @tag: the cpu-order buffer
- *
- */
-
-void
-gfs_quota_tag_print(struct gfs_quota_tag *tag)
-{
-	pv(tag, qt_change, "%llu");
-	pv(tag, qt_flags, "0x%.8X");
-	pv(tag, qt_id, "%u");
-}
-
-/**
- * gfs_ea_header_in - Read in a Extended Attribute header
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_in(struct gfs_ea_header *ea, char *buf)
-{
-	struct gfs_ea_header *str = (struct gfs_ea_header *)buf;
-
-	CPIN_32(ea, str, ea_rec_len);
-	CPIN_32(ea, str, ea_data_len);
-	ea->ea_name_len = str->ea_name_len;
-	ea->ea_type = str->ea_type;
-	ea->ea_flags = str->ea_flags;
-	ea->ea_num_ptrs = str->ea_num_ptrs;
-	CPIN_32(ea, str, ea_pad);
-}
-
-/**
- * gfs_ea_header_out - Write out a Extended Attribute header
- * @ea: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_out(struct gfs_ea_header *ea, char *buf)
-{
-	struct gfs_ea_header *str = (struct gfs_ea_header *)buf;
-
-	CPOUT_32(ea, str, ea_rec_len);
-	CPOUT_32(ea, str, ea_data_len);
-	str->ea_name_len = ea->ea_name_len;
-	str->ea_type = ea->ea_type;
-	str->ea_flags = ea->ea_flags;
-	str->ea_num_ptrs = ea->ea_num_ptrs;
-	CPOUT_32(ea, str, ea_pad);
-}
-
-/**
- * gfs_ea_header_printt - Print out a Extended Attribute header
- * @ea: the cpu-order buffer
- *
- */
-
-void
-gfs_ea_header_print(struct gfs_ea_header *ea, char *name)
-{
-	char buf[GFS_EA_MAX_NAME_LEN + 1];
-
-	pv(ea, ea_rec_len, "%u");
-	pv(ea, ea_data_len, "%u");
-	pv(ea, ea_name_len, "%u");
-	pv(ea, ea_type, "%u");
-	pv(ea, ea_flags, "%u");
-	pv(ea, ea_num_ptrs, "%u");
-	pv(ea, ea_pad, "%u");
-
-	memset(buf, 0, GFS_EA_MAX_NAME_LEN + 1);
-	memcpy(buf, name, ea->ea_name_len);
-	printk("  name = %s\n", buf);
-}
-
-static const uint32_t crc_32_tab[] =
-{
-  0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
-  0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
-  0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-  0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
-  0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
-  0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-  0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
-  0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
-  0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-  0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
-  0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
-  0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-  0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
-  0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
-  0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-  0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
-  0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
-  0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-  0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
-  0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
-  0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-  0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
-  0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
-  0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-  0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
-  0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
-  0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-  0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
-  0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
-  0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-  0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
-  0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
-/**
- * gfs_dir_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * The hash function is a 32-bit CRC of the data.  The algorithm uses
- * the crc_32_tab table above.
- *
- * This may not be the fastest hash function, but it does a fair bit better
- * at providing uniform results than the others I've looked at.  That's
- * really important for efficient directories.
- *
- * Returns: the hash
- */
-
-uint32_t
-gfs_dir_hash(const char *data, int len)
-{
-	uint32_t hash = 0xFFFFFFFF;
-
-	for (; len--; data++)
-		hash = crc_32_tab[(hash ^ *data) & 0xFF] ^ (hash >> 8);
-
-	hash = ~hash;
-
-	return hash;
-}
-
-#endif  /* WANT_GFS_CONVERSION_FUNCTIONS */
-
diff --git a/gfs-kernel/src/gfs/glock.c b/gfs-kernel/src/gfs/glock.c
deleted file mode 100644
index 80f4466..0000000
--- a/gfs-kernel/src/gfs/glock.c
+++ /dev/null
@@ -1,3035 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "lm.h"
-#include "lops.h"
-#include "quota.h"
-#include "recovery.h"
-
-/*  Must be kept in sync with the beginning of struct gfs_glock  */
-struct glock_plug {
-	struct list_head gl_list;
-	unsigned long gl_flags;
-};
-
-struct greedy {
-	struct gfs_holder gr_gh;
-	struct delayed_work gr_work;
-};
-
-typedef void (*glock_examiner) (struct gfs_glock * gl, unsigned int *cnt);
-
-/**
- * relaxed_state_ok - is a requested lock compatible with the current lock mode?
- * @actual: the current state of the lock
- * @requested: the lock state that was requested by the caller
- * @flags: the modifier flags passed in by the caller
- *
- * Returns: TRUE if the locks are compatible, FALSE otherwise
- *
- * It's often possible that a holder B may request the lock in SHARED mode,
- * while another holder A (on this same node) has the lock in EXCLUSIVE mode
- * (node must hold the glock in EXCLUSIVE mode for this situation, of course).
- * This is okay to grant, in some cases, since both holders would have access
- * to the in-core up-to-date cached data that the EX holder would write to disk.
- * This is the default behavior.
- *
- * The EXACT flag disallows this behavior, though.  A SHARED request would
- * compatible only with a SHARED lock with this flag.
- *
- * The ANY flag provides broader permission to grant the lock to a holder,
- * whatever the requested state is, as long as the lock is locked in any mode.
- */
-
-static __inline__ int
-relaxed_state_ok(unsigned int actual, unsigned requested, int flags)
-{
-	if (actual == requested)
-		return TRUE;
-
-	if (flags & GL_EXACT)
-		return FALSE;
-
-	if (actual == LM_ST_EXCLUSIVE && requested == LM_ST_SHARED)
-		return TRUE;
-
-	if (actual != LM_ST_UNLOCKED && (flags & LM_FLAG_ANY))
-		return TRUE;
-
-	return FALSE;
-}
-
-/**
- * gl_hash() - Turn glock number into hash bucket number
- * @lock: The glock number
- *
- * Returns: The number of the corresponding hash bucket
- */
-
-static unsigned int
-gl_hash(struct lm_lockname *name)
-{
-	unsigned int h;
-
-	h = gfs_hash(&name->ln_number, sizeof(uint64_t));
-	h = gfs_hash_more(&name->ln_type, sizeof(unsigned int), h);
-	h &= GFS_GL_HASH_MASK;
-
-	return h;
-}
-
-/**
- * glock_hold() - increment reference count on glock
- * @gl: The glock to hold
- *
- */
-
-static __inline__ void
-glock_hold(struct gfs_glock *gl)
-{
-	gfs_assert(gl->gl_sbd, atomic_read(&gl->gl_count) > 0,);
-	atomic_inc(&gl->gl_count);
-}
-
-/**
- * glock_put() - Decrement reference count on glock
- * @gl: The glock to put
- *
- */
-
-static __inline__ void
-glock_put(struct gfs_glock *gl)
-{
-	if (atomic_read(&gl->gl_count) == 1)
-		gfs_glock_schedule_for_reclaim(gl);
-	gfs_assert(gl->gl_sbd, atomic_read(&gl->gl_count) > 0,);
-	atomic_dec(&gl->gl_count);
-}
-
-/**
- * queue_empty - check to see if a glock's queue is empty
- * @gl: the glock
- * @head: the head of the queue to check
- *
- * Returns: TRUE if the queue is empty
- */
-
-static __inline__ int
-queue_empty(struct gfs_glock *gl, struct list_head *head)
-{
-	int empty;
-	spin_lock(&gl->gl_spin);
-	empty = list_empty(head);
-	spin_unlock(&gl->gl_spin);
-	return empty;
-}
-
-/**
- * search_bucket() - Find struct gfs_glock by lock number
- * @bucket: the bucket to search
- * @name: The lock name
- *
- * Returns: NULL, or the struct gfs_glock with the requested number
- */
-
-static struct gfs_glock *
-search_bucket(struct gfs_gl_hash_bucket *bucket, struct lm_lockname *name)
-{
-	struct list_head *tmp, *head;
-	struct gfs_glock *gl;
-
-	for (head = &bucket->hb_list, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gl = list_entry(tmp, struct gfs_glock, gl_list);
-
-		if (test_bit(GLF_PLUG, &gl->gl_flags))
-			continue;
-		if (!lm_name_equal(&gl->gl_name, name))
-			continue;
-
-		atomic_inc(&gl->gl_count);
-
-		return gl;
-	}
-
-	return NULL;
-}
-
-/**
- * gfs_glock_find() - Find glock by lock number
- * @sdp: The GFS superblock
- * @name: The lock name
- *
- * Figure out what bucket the lock is in, acquire the read lock on
- * it and call search_bucket().
- *
- * Returns: NULL, or the struct gfs_glock with the requested number
- */
-
-struct gfs_glock *
-gfs_glock_find(struct gfs_sbd *sdp, struct lm_lockname *name)
-{
-	struct gfs_gl_hash_bucket *bucket = &sdp->sd_gl_hash[gl_hash(name)];
-	struct gfs_glock *gl;
-
-	read_lock(&bucket->hb_lock);
-	gl = search_bucket(bucket, name);
-	read_unlock(&bucket->hb_lock);
-
-	return gl;
-}
-
-/**
- * glock_free() - Perform a few checks and then release struct gfs_glock
- * @gl: The glock to release
- *
- * Also calls lock module to release its internal structure for this glock.
- *
- */
-
-static void
-glock_free(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct inode *aspace = gl->gl_aspace;
-
-	gfs_assert_warn(sdp, list_empty(&gl->gl_list));
-	gfs_assert_warn(sdp, atomic_read(&gl->gl_count) == 1);
-	gfs_assert_warn(sdp, list_empty(&gl->gl_holders));
-	gfs_assert_warn(sdp, list_empty(&gl->gl_waiters1));
-        gfs_assert_warn(sdp, list_empty(&gl->gl_waiters2));
-	gfs_assert_warn(sdp, list_empty(&gl->gl_waiters3));
-	gfs_assert_warn(sdp, gl->gl_state == LM_ST_UNLOCKED);
-	gfs_assert_warn(sdp, !gl->gl_object);
-	gfs_assert_warn(sdp, !gl->gl_lvb);
-	gfs_assert_warn(sdp, list_empty(&gl->gl_reclaim));
-
-	gfs_lm_put_lock(sdp, gl->gl_lock);
-
-	if (aspace)
-		gfs_aspace_put(aspace);
-
-	kmem_cache_free(gfs_glock_cachep, gl);
-
-	atomic_dec(&sdp->sd_glock_count);
-}
-
-/**
- * gfs_glock_get() - Get a glock, or create one if one doesn't exist
- * @sdp: The GFS superblock
- * @number: the lock number
- * @glops: The glock_operations to use
- * @create: If FALSE, don't create the glock if it doesn't exist
- * @glp: the glock is returned here
- *
- * This does not lock a glock, just finds/creates structures for one.
- * 
- * Returns: errno
- */
-
-int
-gfs_glock_get(struct gfs_sbd *sdp,
-	      uint64_t number, struct gfs_glock_operations *glops,
-	      int create, struct gfs_glock **glp)
-{
-	struct lm_lockname name;
-	struct gfs_glock *gl, *tmp;
-	struct gfs_gl_hash_bucket *bucket;
-	int error;
-
-	/* Look for pre-existing glock in hash table */
-	name.ln_number = number;
-	name.ln_type = glops->go_type;
-	bucket = &sdp->sd_gl_hash[gl_hash(&name)];
-
-	read_lock(&bucket->hb_lock);
-	gl = search_bucket(bucket, &name);
-	read_unlock(&bucket->hb_lock);
-
-	if (gl || !create) {
-		*glp = gl;
-		return 0;
-	}
-
-	/* None found; create a new one */
-	gl = kmem_cache_alloc(gfs_glock_cachep, GFP_KERNEL);
-	if (!gl)
-		return -ENOMEM;
-
-	memset(gl, 0, sizeof(struct gfs_glock));
-
-	INIT_LIST_HEAD(&gl->gl_list);
-	gl->gl_name = name;
-	atomic_set(&gl->gl_count, 1);
-
-	spin_lock_init(&gl->gl_spin);
-
-	gl->gl_state = LM_ST_UNLOCKED;
-	INIT_LIST_HEAD(&gl->gl_holders);
-	INIT_LIST_HEAD(&gl->gl_waiters1);
-	INIT_LIST_HEAD(&gl->gl_waiters2);
-	INIT_LIST_HEAD(&gl->gl_waiters3);
-
-	gl->gl_ops = glops;
-
-	INIT_LE(&gl->gl_new_le, &gfs_glock_lops);
-	INIT_LE(&gl->gl_incore_le, &gfs_glock_lops);
-
-	gl->gl_bucket = bucket;
-	INIT_LIST_HEAD(&gl->gl_reclaim);
-
-	gl->gl_sbd = sdp;
-
-	INIT_LIST_HEAD(&gl->gl_ail_bufs);
-
-	/* If this glock protects actual on-disk data or metadata blocks,
-	   create a VFS inode to manage the pages/buffers holding them. */
-	if (glops == &gfs_inode_glops ||
-	    glops == &gfs_rgrp_glops ||
-	    glops == &gfs_meta_glops) {
-		gl->gl_aspace = gfs_aspace_get(sdp);
-		if (!gl->gl_aspace) {
-			error = -ENOMEM;
-			goto fail;
-		}
-	}
-
-	/* Ask lock module to find/create its structure for this lock
-	   (but this doesn't lock the inter-node lock yet) */
-	error = gfs_lm_get_lock(sdp, &name, &gl->gl_lock);
-	if (error)
-		goto fail_aspace;
-
-	atomic_inc(&sdp->sd_glock_count);
-
-	/* Double-check, in case another process created the glock, and has
-	   put it in the hash table while we were preparing this one */
-	write_lock(&bucket->hb_lock);
-	tmp = search_bucket(bucket, &name);
-	if (tmp) {
-		/* Somebody beat us to it; forget the one we prepared */
-		write_unlock(&bucket->hb_lock);
-		glock_free(gl);
-		gl = tmp;
-	} else {
-		/* Add our glock to hash table */
-		list_add_tail(&gl->gl_list, &bucket->hb_list);
-		write_unlock(&bucket->hb_lock);
-	}
-
-	*glp = gl;
-
-	return 0;
-
- fail_aspace:
-	if (gl->gl_aspace)
-		gfs_aspace_put(gl->gl_aspace);
-
- fail:
-	kmem_cache_free(gfs_glock_cachep, gl);	
-
-	return error;
-}
-
-/**
- * gfs_glock_hold() - As glock_hold(), but suitable for exporting
- * @gl: The glock to hold
- *
- */
-
-void
-gfs_glock_hold(struct gfs_glock *gl)
-{
-	glock_hold(gl);
-}
-
-/**
- * gfs_glock_put() - As glock_put(), but suitable for exporting
- * @gl: The glock to put
- *
- */
-
-void
-gfs_glock_put(struct gfs_glock *gl)
-{
-	glock_put(gl);
-}
-
-/**
- * gfs_holder_init - initialize a struct gfs_holder in the default way
- * @gl: the glock 
- * @state: the state we're requesting
- * @flags: the modifier flags
- * @gh: the holder structure
- *
- */
-
-void
-gfs_holder_init(struct gfs_glock *gl, unsigned int state, int flags,
-		struct gfs_holder *gh)
-{
-	memset(gh, 0, sizeof(struct gfs_holder));
-
-	INIT_LIST_HEAD(&gh->gh_list);
-	gh->gh_gl = gl;
-	gh->gh_owner = current;
-	gh->gh_state = state;
-	gh->gh_flags = flags;
-
-	if (gh->gh_state == LM_ST_EXCLUSIVE)
-		gh->gh_flags |= GL_LOCAL_EXCL;
-
-	init_completion(&gh->gh_wait);
-
-	glock_hold(gl);
-}
-
-/**
- * gfs_holder_reinit - reinitialize a struct gfs_holder so we can requeue it
- * @state: the state we're requesting
- * @flags: the modifier flags
- * @gh: the holder structure
- *
- * Preserve holder's associated glock and owning process.
- * Reset all holder state flags (we're starting a new request from scratch),
- *   except for HIF_ALLOCED.
- * Don't do glock_hold() again (it was done in gfs_holder_init()).
- * Don't mess with the glock.
- *
- * Rules:
- *   Holder must have been gfs_holder_init()d already
- *   Holder must *not* be in glock's holder list or wait queues now
- */
-
-void
-gfs_holder_reinit(unsigned int state, int flags, struct gfs_holder *gh)
-{
-	int alloced;
-
-	gfs_assert_warn(gh->gh_gl->gl_sbd,
-			list_empty(&gh->gh_list));
-
-	gh->gh_state = state;
-	gh->gh_flags = flags;
-
-	if (gh->gh_state == LM_ST_EXCLUSIVE)
-		gh->gh_flags |= GL_LOCAL_EXCL;
-
-	alloced = test_bit(HIF_ALLOCED, &gh->gh_iflags);
-	memset(&gh->gh_iflags, 0, sizeof(unsigned long));
-	if (alloced)
-		set_bit(HIF_ALLOCED, &gh->gh_iflags);
-}
-
-/**
- * gfs_holder_uninit - uninitialize a holder structure (drop reference on glock)
- * @gh: the holder structure
- *
- */
-
-void
-gfs_holder_uninit(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-
-	gfs_assert_warn(gl->gl_sbd, list_empty(&gh->gh_list));
-	gh->gh_gl = NULL;
-
-	glock_put(gl);
-}
-
-/**
- * gfs_holder_get - get a struct gfs_holder structure
- * @gl: the glock 
- * @state: the state we're requesting
- * @flags: the modifier flags
- *
- * Figure out how big an impact this function has.  Either:
- * 1) Replace it with a cache of structures hanging off the struct gfs_sbd
- * 2) Leave it like it is
- *
- * Returns: the holder structure, NULL on ENOMEM
- */
-
-struct gfs_holder *
-gfs_holder_get(struct gfs_glock *gl, unsigned int state, int flags)
-{
-	struct gfs_holder *gh;
-
-	gh = kmalloc(sizeof(struct gfs_holder), GFP_KERNEL);
-	if (!gh)
-		return NULL;
-
-	gfs_holder_init(gl, state, flags, gh);
-	set_bit(HIF_ALLOCED, &gh->gh_iflags);
-
-	return gh;
-}
-
-/**
- * gfs_holder_put - get rid of a struct gfs_holder structure
- * @gh: the holder structure
- *
- */
-
-void
-gfs_holder_put(struct gfs_holder *gh)
-{
-	if (gfs_assert_warn(gh->gh_gl->gl_sbd,
-			    test_bit(HIF_ALLOCED, &gh->gh_iflags)))
-		return;
-	gfs_holder_uninit(gh);
-	kfree(gh);
-}
-
-/**
- * handle_recurse - put other holder structures (marked recursive) into the holders list
- * @gh: the holder structure
- *
- */
-
-static void
-handle_recurse(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct list_head *tmp, *head, *next;
-	struct gfs_holder *tmp_gh;
-	int found = FALSE;
-
-	if (gfs_assert_warn(sdp, gh->gh_owner))
-		return;
-
-	for (head = &gl->gl_waiters3, tmp = head->next, next = tmp->next;
-	     tmp != head;
-	     tmp = next, next = tmp->next) {
-		tmp_gh = list_entry(tmp, struct gfs_holder, gh_list);
-		if (tmp_gh->gh_owner != gh->gh_owner)
-			continue;
-
-		gfs_assert_warn(sdp, test_bit(HIF_RECURSE, &tmp_gh->gh_iflags));
-
-		list_move_tail(&tmp_gh->gh_list, &gl->gl_holders);
-		tmp_gh->gh_error = 0;
-		set_bit(HIF_HOLDER, &tmp_gh->gh_iflags);
-
-		complete(&tmp_gh->gh_wait);
-
-		found = TRUE;
-	}
-
-	gfs_assert_warn(sdp, found);
-}
-
-/**
- * do_unrecurse - a recursive holder was just dropped of the waiters3 list
- * @gh: the holder
- *
- * If there is only one other recursive holder, clear its HIF_RECURSE bit
- *   (it's no longer a recursive request).
- * If there is more than one, leave them alone (they're recursive!).
- *
- */
-
-static void
-do_unrecurse(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct list_head *tmp, *head;
-	struct gfs_holder *tmp_gh, *last_gh = NULL;
-	int found = FALSE;
-
-	if (gfs_assert_warn(sdp, gh->gh_owner))
-		return;
-
-	for (head = &gl->gl_waiters3, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		tmp_gh = list_entry(tmp, struct gfs_holder, gh_list);
-		if (tmp_gh->gh_owner != gh->gh_owner)
-			continue;
-
-		gfs_assert_warn(sdp, test_bit(HIF_RECURSE, &tmp_gh->gh_iflags));
-
-		/* found more than one */
-		if (found)
-			return;
-
-		found = TRUE;
-		last_gh = tmp_gh;
-	}
-
-	/* found just one */
-	if (!gfs_assert_warn(sdp, found))
-		clear_bit(HIF_RECURSE, &last_gh->gh_iflags);
-}
-
-/**
- * rq_mutex - process a mutex request in the queue
- * @gh: the glock holder
- *
- * Returns: TRUE if the queue is blocked (always, since there can be only one
- *      holder of the mutex).
- *
- * See lock_on_glock()
- */
-
-static int
-rq_mutex(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-
-	list_del_init(&gh->gh_list);
-	/*  gh->gh_error never examined.  */
-	set_bit(GLF_LOCK, &gl->gl_flags);
-	complete(&gh->gh_wait);
-
-	return TRUE;
-}
-
-/**
- * rq_promote - process a promote request in the queue
- * @gh: the glock holder
- *
- * Acquire a new inter-node lock, or change a lock state to more restrictive.
- *
- * Returns: TRUE if the queue is blocked
- */
-
-static int
-rq_promote(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	int recurse;
-
-	if (!relaxed_state_ok(gl->gl_state, gh->gh_state, gh->gh_flags)) {
-		if (list_empty(&gl->gl_holders)) {
-			gl->gl_req_gh = gh;
-			set_bit(GLF_LOCK, &gl->gl_flags);
-			spin_unlock(&gl->gl_spin);
-
-			/* If we notice a lot of glocks in reclaim list, free
-			   up memory for 2 of them before locking a new one */
-			if (atomic_read(&sdp->sd_reclaim_count) >
-			    gfs_tune_get(sdp, gt_reclaim_limit) &&
-			    !(gh->gh_flags & LM_FLAG_PRIORITY)) {
-				gfs_reclaim_glock(sdp);
-				gfs_reclaim_glock(sdp);
-			}
-
-			glops->go_xmote_th(gl, gh->gh_state,
-					   gh->gh_flags);
-
-			spin_lock(&gl->gl_spin);
-		}
-		return TRUE;
-	}
-
-	if (list_empty(&gl->gl_holders)) {
-		set_bit(HIF_FIRST, &gh->gh_iflags);
-		set_bit(GLF_LOCK, &gl->gl_flags);
-		recurse = FALSE;
-	} else {
-		struct gfs_holder *next_gh;
-		if (gh->gh_flags & GL_LOCAL_EXCL)
-			return TRUE;
-		next_gh = list_entry(gl->gl_holders.next, struct gfs_holder, gh_list);
-		if (next_gh->gh_flags & GL_LOCAL_EXCL)
-			 return TRUE;
-		recurse = test_bit(HIF_RECURSE, &gh->gh_iflags);
-	}
-
-	list_move_tail(&gh->gh_list, &gl->gl_holders);
-	gh->gh_error = 0;
-	set_bit(HIF_HOLDER, &gh->gh_iflags);
-
-	if (recurse)
-		handle_recurse(gh);
-
-	complete(&gh->gh_wait);
-
-	return FALSE;
-}
-
-/**
- * rq_demote - process a demote request in the queue
- * @gh: the glock holder
- *
- * Returns: TRUE if the queue is blocked
- *
- * Unlock an inter-node lock, or change a lock state to less restrictive.
- * If the glock is already the same as the holder's requested state, or is
- *   UNLOCKED, no lock module request is required.
- * Otherwise, we need to ask lock module to unlock or change locked state
- *   of the glock.
- * If requested state is UNLOCKED, or current glock state is SHARED or
- *   DEFERRED (neither of which have a less restrictive state other than
- *   UNLOCK), we call go_drop_th() to unlock the lock.
- * Otherwise (i.e. requested is SHARED or DEFERRED, and current is EXCLUSIVE),
- *   we can continue to hold the lock, and just ask for a new state;
- *   we call go_xmote_th() to change state.
- *
- * Must be called with glock's gl->gl_spin locked.
- */
-
-static int
-rq_demote(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-
-	if (!list_empty(&gl->gl_holders))
-		return TRUE;
-
-	if (gl->gl_state == gh->gh_state || gl->gl_state == LM_ST_UNLOCKED) {
-		list_del_init(&gh->gh_list);
-		gh->gh_error = 0;
-		spin_unlock(&gl->gl_spin);
-		if (test_bit(HIF_DEALLOC, &gh->gh_iflags))
-			gfs_holder_put(gh);
-		else
-			complete(&gh->gh_wait);
-		spin_lock(&gl->gl_spin);
-	} else {
-		gl->gl_req_gh = gh;
-		set_bit(GLF_LOCK, &gl->gl_flags);
-		spin_unlock(&gl->gl_spin);
-
-		if (gh->gh_state == LM_ST_UNLOCKED ||
-		    gl->gl_state != LM_ST_EXCLUSIVE)
-			/* Unlock */
-			glops->go_drop_th(gl);
-		else
-			/* Change state while holding lock */
-			glops->go_xmote_th(gl, gh->gh_state, gh->gh_flags);
-
-		spin_lock(&gl->gl_spin);
-	}
-
-	return FALSE;
-}
-
-/**
- * rq_greedy - process a queued request to drop greedy status
- * @gh: the glock holder
- *
- * Returns: TRUE if the queue is blocked
- */
-
-static int
-rq_greedy(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-
-	list_del_init(&gh->gh_list);
-	/*  gh->gh_error never examined.  */
-	clear_bit(GLF_GREEDY, &gl->gl_flags);
-	spin_unlock(&gl->gl_spin);
-
-	gfs_holder_uninit(gh);
-	kfree(container_of(gh, struct greedy, gr_gh));
-
-	spin_lock(&gl->gl_spin);		
-
-	return FALSE;
-}
-
-/**
- * run_queue - process holder structures on the glock's wait queues
- * @gl: the glock
- *
- * Rules:
- *   Caller must hold gl->gl_spin.
- */
-
-static void
-run_queue(struct gfs_glock *gl)
-{
-	struct gfs_holder *gh;
-	int blocked = TRUE;
-
-	for (;;) {
-		/* Another process is manipulating the glock structure;
-		   we can't do anything now */
-		if (test_bit(GLF_LOCK, &gl->gl_flags))
-			break;
-
-		/* Waiting to manipulate the glock structure */
-		if (!list_empty(&gl->gl_waiters1)) {
-			gh = list_entry(gl->gl_waiters1.next,
-					struct gfs_holder, gh_list);
-
-			if (test_bit(HIF_MUTEX, &gh->gh_iflags))
-				blocked = rq_mutex(gh);
-			else
-				gfs_assert_warn(gl->gl_sbd, FALSE);
-
-		/* Waiting to demote the lock, or drop greedy status */
-		} else if (!list_empty(&gl->gl_waiters2) &&
-			   !test_bit(GLF_SKIP_WAITERS2, &gl->gl_flags)) {
-			gh = list_entry(gl->gl_waiters2.next,
-					struct gfs_holder, gh_list);
-
-			if (test_bit(HIF_DEMOTE, &gh->gh_iflags))
-				blocked = rq_demote(gh);
-			else if (test_bit(HIF_GREEDY, &gh->gh_iflags))
-				blocked = rq_greedy(gh);
-			else
-				gfs_assert_warn(gl->gl_sbd, FALSE);
-
-		/* Waiting to promote the lock */
-		} else if (!list_empty(&gl->gl_waiters3)) {
-			gh = list_entry(gl->gl_waiters3.next,
-					struct gfs_holder, gh_list);
-
-			if (test_bit(HIF_PROMOTE, &gh->gh_iflags))
-				blocked = rq_promote(gh);
-			else
-				gfs_assert_warn(gl->gl_sbd, FALSE);
-
-		} else
-			break;
-
-		if (blocked)
-			break;
-	}
-}
-
-/**
- * lock_on_glock - acquire a local lock on a glock (structure)
- * @gl: the glock
- *
- * Gives caller exclusive access to manipulate a glock structure.
- * Has nothing to do with inter-node lock state or GL_LOCAL_EXCL!
- *
- * If structure already locked, places temporary holder structure on glock's
- * wait-for-exclusive-access queue, and blocks until exclusive access granted.
- */
-
-static void
-lock_on_glock(struct gfs_glock *gl)
-{
-	struct gfs_holder gh;
-
-	gfs_holder_init(gl, 0, 0, &gh);
-	set_bit(HIF_MUTEX, &gh.gh_iflags);
-
-	spin_lock(&gl->gl_spin);
-	if (test_and_set_bit(GLF_LOCK, &gl->gl_flags))
-		list_add_tail(&gh.gh_list, &gl->gl_waiters1);
-	else
-		complete(&gh.gh_wait);
-	spin_unlock(&gl->gl_spin);
-
-	wait_for_completion(&gh.gh_wait);
-	gfs_holder_uninit(&gh);
-}
-
-/**
- * trylock_on_glock - try to acquire a local lock on a glock (structure)
- * @gl: the glock
- *
- * Returns: TRUE if the glock is acquired
- *
- * Tries to give caller exclusive access to manipulate a glock structure.
- * Has nothing to do with inter-node lock state or LOCAL_EXCL!
- *
- * If structure already locked, does not block to wait; returns FALSE.
- */
-
-static int
-trylock_on_glock(struct gfs_glock *gl)
-{
-	int acquired = TRUE;
-
-	spin_lock(&gl->gl_spin);
-	if (test_and_set_bit(GLF_LOCK, &gl->gl_flags))
-		acquired = FALSE;
-	spin_unlock(&gl->gl_spin);
-
-	return acquired;
-}
-
-/**
- * unlock_on_glock - release a local lock on a glock (structure)
- * @gl: the glock
- *
- * Caller is done manipulating glock structure.
- * Service any others waiting for exclusive access.
- */
-
-static void
-unlock_on_glock(struct gfs_glock *gl)
-{
-	spin_lock(&gl->gl_spin);
-	clear_bit(GLF_LOCK, &gl->gl_flags);
-	run_queue(gl);
-	spin_unlock(&gl->gl_spin);
-}
-
-/**
- * handle_callback - add a demote request to a lock's queue
- * @gl: the glock
- * @state: the state the caller wants us to change to
- *
- * Called when we learn that another node needs a lock held by this node,
- *   or when this node simply wants to drop a lock as soon as it's done with
- *   it (NOCACHE flag), or dump a glock out of glock cache (reclaim it).
- *
- * We are told the @state that will satisfy the needs of the caller, so
- *   we can ask for a demote to that state.
- *
- * If another demote request is already on the queue for a different state, just
- *   set its request to UNLOCK (and don't bother queueing a request for us).
- *   This consolidates LM requests and moves the lock to the least restrictive
- *   state, so it will be compatible with whatever reason we were called.
- *   No need to be too smart here.  Demotes between the shared and deferred
- *   states will often fail, so don't even try.
- *
- * Otherwise, queue a demote request to the requested state.
- */
-
-static void
-handle_callback(struct gfs_glock *gl, unsigned int state)
-{
-	struct list_head *tmp, *head;
-	struct gfs_holder *gh, *new_gh = NULL;
-
-	if (gfs_assert_warn(gl->gl_sbd, state != LM_ST_EXCLUSIVE))
-		return;
-
- restart:
-	spin_lock(&gl->gl_spin);
-
-	/* If another queued demote request is for a different state,
-	   set its request to UNLOCKED */
-	for (head = &gl->gl_waiters2, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gh = list_entry(tmp, struct gfs_holder, gh_list);
-		if (test_bit(HIF_DEMOTE, &gh->gh_iflags) &&
-		    gl->gl_req_gh != gh) {
-			if (gh->gh_state != state)
-				gh->gh_state = LM_ST_UNLOCKED;
-			goto out;
-		}
-	}
-
-	/* pass 2; add new holder to glock's demote request queue */
-	if (new_gh) {
-		list_add_tail(&new_gh->gh_list, &gl->gl_waiters2);
-		new_gh = NULL;
-
-	/* pass 1; set up a new holder struct for a demote request, then
-	   check again to see if another process added a demote request
-	   while we were preparing this one. */
-	} else {
-		spin_unlock(&gl->gl_spin);
-
-		RETRY_MALLOC(new_gh = gfs_holder_get(gl, state, LM_FLAG_TRY),
-			     new_gh);
-		set_bit(HIF_DEMOTE, &new_gh->gh_iflags);
-		set_bit(HIF_DEALLOC, &new_gh->gh_iflags);
-		new_gh->gh_owner = NULL;
-
-		goto restart;
-	}
-
- out:
-	spin_unlock(&gl->gl_spin);
-
-	if (new_gh)
-		gfs_holder_put(new_gh);
-}
-
-/**
- * state_change - record that the glock is now in a different state
- * @gl: the glock
- * @new_state the new state
- *
- */
-
-static void
-state_change(struct gfs_glock *gl, unsigned int new_state)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	int held1, held2;
-
-	held1 = (gl->gl_state != LM_ST_UNLOCKED);
-	held2 = (new_state != LM_ST_UNLOCKED);
-
-	if (held1 != held2) {
-		if (held2) {
-			atomic_inc(&sdp->sd_glock_held_count);
-			glock_hold(gl);
-		} else {
-			atomic_dec(&sdp->sd_glock_held_count);
-			glock_put(gl);
-		}
-	}
-
-	gl->gl_state = new_state;
-}
-
-static int gfs_glock_demote_wait(void *word)
-{
-	schedule();
-	return 0;
-}
-
-static void gfs_wait_on_demote(struct gfs_glock *gl)
-{
-	might_sleep();
-	wait_on_bit(&gl->gl_flags, GLF_DEMOTE, gfs_glock_demote_wait, TASK_UNINTERRUPTIBLE);
-}
-
-static void gfs_demote_wake(struct gfs_glock *gl)
-{
-	clear_bit(GLF_DEMOTE, &gl->gl_flags);
-	smp_mb__after_clear_bit();
-	wake_up_bit(&gl->gl_flags, GLF_DEMOTE);
-}
-
-void gfs_glock_dq_wait(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	set_bit(GLF_DEMOTE, &gl->gl_flags);
-	gfs_glock_dq(gh);
-	gfs_wait_on_demote(gl);
-}
-
-/**
- * xmote_bh - Called after the lock module is done acquiring a lock
- * @gl: The glock in question
- * @ret: the int returned from the lock module
- *
- */
-
-static void
-xmote_bh(struct gfs_glock *gl, unsigned int ret)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	struct gfs_holder *gh = gl->gl_req_gh;
-	int prev_state = gl->gl_state;
-	int op_done = TRUE;
-
-	gfs_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
-	gfs_assert_warn(sdp, queue_empty(gl, &gl->gl_holders));
-	gfs_assert_warn(sdp, !(ret & LM_OUT_ASYNC));
-
-	state_change(gl, ret & LM_OUT_ST_MASK);
-
-	if (prev_state != LM_ST_UNLOCKED && !(ret & LM_OUT_CACHEABLE)) {
-		if (glops->go_inval)
-			glops->go_inval(gl, DIO_METADATA | DIO_DATA);
-	} else if (gl->gl_state == LM_ST_DEFERRED) {
-		/* We might not want to do this here.
-		   Look at moving to the inode glops. */
-		if (glops->go_inval)
-			glops->go_inval(gl, DIO_DATA);
-	}
-
-	/*  Deal with each possible exit condition  */
-
-	if (!gh)
-		gl->gl_stamp = jiffies;
-
-	else if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
-		spin_lock(&gl->gl_spin);
-		list_del_init(&gh->gh_list);
-		gh->gh_error = -EIO;
-		if (test_bit(HIF_RECURSE, &gh->gh_iflags))
-			do_unrecurse(gh);
-		spin_unlock(&gl->gl_spin);
-
-	} else if (test_bit(HIF_DEMOTE, &gh->gh_iflags)) {
-		spin_lock(&gl->gl_spin);
-		list_del_init(&gh->gh_list);
-		if (gl->gl_state == gh->gh_state ||
-		    gl->gl_state == LM_ST_UNLOCKED)
-			gh->gh_error = 0;
-		else {
-			if (gfs_assert_warn(sdp, gh->gh_flags &
-					    (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) == -1)
-				printk("GFS: fsid=%s: ret = 0x%.8X\n",
-				       sdp->sd_fsname, ret);
-			gh->gh_error = GLR_TRYFAILED;
-		}
-		spin_unlock(&gl->gl_spin);
-
-		if (ret & LM_OUT_CANCELED)
-			handle_callback(gl, LM_ST_UNLOCKED); /* Lame */
-
-	} else if (ret & LM_OUT_CANCELED) {
-		spin_lock(&gl->gl_spin);
-		list_del_init(&gh->gh_list);
-		gh->gh_error = GLR_CANCELED;
-		if (test_bit(HIF_RECURSE, &gh->gh_iflags))
-			do_unrecurse(gh);
-		spin_unlock(&gl->gl_spin);
-
-	} else if (relaxed_state_ok(gl->gl_state, gh->gh_state, gh->gh_flags)) {
-		spin_lock(&gl->gl_spin);
-		list_move_tail(&gh->gh_list, &gl->gl_holders);
-		gh->gh_error = 0;
-		set_bit(HIF_HOLDER, &gh->gh_iflags);
-		spin_unlock(&gl->gl_spin);
-
-		set_bit(HIF_FIRST, &gh->gh_iflags);
-
-		op_done = FALSE;
-
-	} else if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) {
-		spin_lock(&gl->gl_spin);
-		list_del_init(&gh->gh_list);
-		gh->gh_error = GLR_TRYFAILED;
-		if (test_bit(HIF_RECURSE, &gh->gh_iflags))
-			do_unrecurse(gh);
-		spin_unlock(&gl->gl_spin);
-
-	} else {
-		if (gfs_assert_withdraw(sdp, FALSE) == -1)
-			printk("GFS: fsid=%s: ret = 0x%.8X\n",
-			       sdp->sd_fsname, ret);
-	}
-
-	if (glops->go_xmote_bh)
-		glops->go_xmote_bh(gl);
-
-	if (op_done) {
-		spin_lock(&gl->gl_spin);
-		gl->gl_req_gh = NULL;
-		gl->gl_req_bh = NULL;
-		clear_bit(GLF_LOCK, &gl->gl_flags);
-		run_queue(gl);
-		if (test_bit(GLF_DEMOTE, &gl->gl_flags))
-			gfs_demote_wake(gl);
-		spin_unlock(&gl->gl_spin);
-	}
-
-	glock_put(gl);
-
-	if (gh) {
-		if (test_bit(HIF_DEALLOC, &gh->gh_iflags))
-			gfs_holder_put(gh);
-		else
-			complete(&gh->gh_wait);
-	}
-}
-
-/**
- * gfs_glock_xmote_th - Call into the lock module to acquire or change a glock
- * @gl: The glock in question
- * @state: the requested state
- * @flags: modifier flags to the lock call
- *
- * Used to acquire a new glock, or to change an already-acquired glock to
- *   more/less restrictive state (other than LM_ST_UNLOCKED).
- *
- * *Not* used to unlock a glock; use gfs_glock_drop_th() for that.
- */
-
-void
-gfs_glock_xmote_th(struct gfs_glock *gl, unsigned int state, int flags)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	int lck_flags = flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB |
-				 LM_FLAG_NOEXP | LM_FLAG_ANY |
-				 LM_FLAG_PRIORITY);
-	unsigned int lck_ret;
-
-	gfs_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
-	gfs_assert_warn(sdp, queue_empty(gl, &gl->gl_holders));
-	gfs_assert_warn(sdp, state != LM_ST_UNLOCKED);
-	gfs_assert_warn(sdp, state != gl->gl_state);
-
-	/* Current state EX, may need to sync log/data/metadata to disk */
-	if (gl->gl_state == LM_ST_EXCLUSIVE) {
-		if (glops->go_sync)
-			glops->go_sync(gl, DIO_METADATA | DIO_DATA);
-	}
-
-	glock_hold(gl);
-	gl->gl_req_bh = xmote_bh;
-
-	atomic_inc(&sdp->sd_lm_lock_calls);
-
-	lck_ret = gfs_lm_lock(sdp, gl->gl_lock,
-			      gl->gl_state, state,
-			      lck_flags);
-
-	if (gfs_assert_withdraw(sdp, !(lck_ret & LM_OUT_ERROR)))
-		goto out;
-
-	if (lck_ret & LM_OUT_ASYNC)
-		gfs_assert_warn(sdp, lck_ret == LM_OUT_ASYNC);
-	else
-		xmote_bh(gl, lck_ret);
- out:
-	return;
-}
-
-/**
- * drop_bh - Called after a lock module unlock completes
- * @gl: the glock
- * @ret: the return status
- *
- * Doesn't wake up the process waiting on the struct gfs_holder (if any)
- * Doesn't drop the reference on the glock the top half took out
- *
- */
-
-static void
-drop_bh(struct gfs_glock *gl, unsigned int ret)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	struct gfs_holder *gh = gl->gl_req_gh;
-
-	clear_bit(GLF_PREFETCH, &gl->gl_flags);
-
-	gfs_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
-	gfs_assert_warn(sdp, queue_empty(gl, &gl->gl_holders));
-	gfs_assert_warn(sdp, !ret);
-
-	state_change(gl, LM_ST_UNLOCKED);
-
-	if (glops->go_inval)
-		glops->go_inval(gl, DIO_METADATA | DIO_DATA);
-
-	if (gh) {
-		spin_lock(&gl->gl_spin);
-		list_del_init(&gh->gh_list);
-		gh->gh_error = 0;
-		spin_unlock(&gl->gl_spin);
-	}
-
-	if (glops->go_drop_bh)
-		glops->go_drop_bh(gl);
-
-	spin_lock(&gl->gl_spin);
-	gl->gl_req_gh = NULL;
-	gl->gl_req_bh = NULL;
-	clear_bit(GLF_LOCK, &gl->gl_flags);
-	run_queue(gl);
-	if (test_bit(GLF_DEMOTE, &gl->gl_flags))
-		gfs_demote_wake(gl);
-	spin_unlock(&gl->gl_spin);	
-	glock_put(gl);
-
-	if (gh) {
-		if (test_bit(HIF_DEALLOC, &gh->gh_iflags))
-			gfs_holder_put(gh);
-		else
-			complete(&gh->gh_wait);
-	}
-}
-
-/**
- * gfs_glock_drop_th - call into the lock module to unlock a lock 
- * @gl: the glock
- *
- */
-
-void
-gfs_glock_drop_th(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	unsigned int ret;
-
-	gfs_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
-	gfs_assert_warn(sdp, queue_empty(gl, &gl->gl_holders));
-	gfs_assert_warn(sdp, gl->gl_state != LM_ST_UNLOCKED);
-
-	/* Leaving state EX, may need to sync log/data/metadata to disk */
-	if (gl->gl_state == LM_ST_EXCLUSIVE) {
-		if (glops->go_sync)
-			glops->go_sync(gl, DIO_METADATA | DIO_DATA);
-	}
-
-	glock_hold(gl);
-	gl->gl_req_bh = drop_bh;
-
-	atomic_inc(&sdp->sd_lm_unlock_calls);
-
-	ret = gfs_lm_unlock(sdp, gl->gl_lock, gl->gl_state);
-
-	if (gfs_assert_withdraw(sdp, !(ret & LM_OUT_ERROR)))
-		goto out;
-
-	if (!ret)
-		drop_bh(gl, ret);
-	else
-		gfs_assert_warn(sdp, ret == LM_OUT_ASYNC);
- out:
-	return;
-}
-
-/**
- * do_cancels - cancel requests for locks stuck waiting on an expire flag
- * @gh: the LM_FLAG_PRIORITY holder waiting to acquire the lock
- *
- * Don't cancel GL_NOCANCEL requests.
- */
-
-static void
-do_cancels(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-
-	spin_lock(&gl->gl_spin);
-
-	while (gl->gl_req_gh != gh &&
-	       !test_bit(HIF_HOLDER, &gh->gh_iflags) &&
-	       !list_empty(&gh->gh_list)) {
-		if (gl->gl_req_bh &&
-		    !(gl->gl_req_gh &&
-		      (gl->gl_req_gh->gh_flags & GL_NOCANCEL))) {
-			spin_unlock(&gl->gl_spin);
-			gfs_lm_cancel(gl->gl_sbd, gl->gl_lock);
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ / 10);
-			spin_lock(&gl->gl_spin);
-		} else {
-			spin_unlock(&gl->gl_spin);
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ / 10);
-			spin_lock(&gl->gl_spin);
-		}
-	}
-
-	spin_unlock(&gl->gl_spin);
-}
-
-/**
- * glock_wait_internal - wait on a glock acquisition
- * @gh: the glock holder
- *
- * Returns: 0 on success
- */
-
-static int
-glock_wait_internal(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	int error = 0;
-
-	if (test_bit(HIF_ABORTED, &gh->gh_iflags))
-		return -EIO;
-
-	if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) {
-		spin_lock(&gl->gl_spin);
-		if (gl->gl_req_gh != gh &&
-		    !test_bit(HIF_HOLDER, &gh->gh_iflags) &&
-		    !list_empty(&gh->gh_list)) {
-			if (gh->gh_flags & GL_FLOCK &&
-			    list_empty(&gl->gl_holders)) {
-				spin_unlock(&gl->gl_spin);
-				goto skip_try_flag;
-			}
-			list_del_init(&gh->gh_list);
-			gh->gh_error = GLR_TRYFAILED;
-			if (test_bit(HIF_RECURSE, &gh->gh_iflags))
-				do_unrecurse(gh);
-			run_queue(gl);
-			spin_unlock(&gl->gl_spin);
-			return GLR_TRYFAILED;
-		}
-		spin_unlock(&gl->gl_spin);
-	}
-
-skip_try_flag:
-	if ((gh->gh_flags & LM_FLAG_PRIORITY) &&
-	    !(gh->gh_flags & GL_NOCANCEL_OTHER))
-		do_cancels(gh);
-
-	wait_for_completion(&gh->gh_wait);
-
-	if (gh->gh_error)
-		return gh->gh_error;
-
-	gfs_assert_withdraw(sdp, test_bit(HIF_HOLDER, &gh->gh_iflags));
-	gfs_assert_withdraw(sdp, relaxed_state_ok(gl->gl_state,
-						  gh->gh_state,
-						  gh->gh_flags));
-
-	if (test_bit(HIF_FIRST, &gh->gh_iflags)) {
-		gfs_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
-
-		if (glops->go_lock) {
-			error = glops->go_lock(gl, gh->gh_flags);
-			if (error) {
-				spin_lock(&gl->gl_spin);
-				list_del_init(&gh->gh_list);
-				gh->gh_error = error;
-				if (test_and_clear_bit(HIF_RECURSE, &gh->gh_iflags))
-					do_unrecurse(gh);
-				spin_unlock(&gl->gl_spin);
-			}
-		}
-
-		spin_lock(&gl->gl_spin);
-		gl->gl_req_gh = NULL;
-		gl->gl_req_bh = NULL;
-		clear_bit(GLF_LOCK, &gl->gl_flags);
-		if (test_bit(HIF_RECURSE, &gh->gh_iflags))
-			handle_recurse(gh);
-		run_queue(gl);
-		spin_unlock(&gl->gl_spin);
-	}
-
-	return error;
-}
-
-/**
- * add_to_queue - Add a holder to the wait-for-promotion queue or holder list
- *       (according to recursion)
- * @gh: the holder structure to add
- *
- * If the hold requestor's process already has a granted lock (on holder list),
- *   and this new request is compatible, go ahead and grant it, adding this
- *   new holder to the glock's holder list. 
- *
- * If the hold requestor's process has earlier requested a lock, and is still
- *   waiting for it to be granted, and this new request is compatible with
- *   the earlier one, they can be handled at the same time when the request
- *   is finally granted.  Mark both (all) with RECURSE flags, and add new
- *   holder to wait-for-promotion queue.
- *
- * If there is no previous holder from this process (on holder list or wait-
- *   for-promotion queue), simply add new holder to wait-for-promotion queue.
- */
-
-static void
-add_to_queue(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct list_head *tmp, *head;
-	struct gfs_holder *tmp_gh;
-
-	if (gh->gh_owner) {
-		/* Search through glock's holders list to see if this process
-		     already holds a granted lock. */
-		for (head = &gl->gl_holders, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			tmp_gh = list_entry(tmp, struct gfs_holder, gh_list);
-			if (tmp_gh->gh_owner == gh->gh_owner) {
-				/* Make sure pre-existing holder is compatible
-				   with this new one. */
-				if (!(gh->gh_flags & GL_FLOCK) && 
-				    (gfs_assert_warn(sdp, (gh->gh_flags & LM_FLAG_ANY) ||
-						     !(tmp_gh->gh_flags & LM_FLAG_ANY)) ||
-				     gfs_assert_warn(sdp, (tmp_gh->gh_flags & GL_LOCAL_EXCL) ||
-						     !(gh->gh_flags & GL_LOCAL_EXCL)) ||
-				     gfs_assert_warn(sdp, relaxed_state_ok(gl->gl_state,
-									   gh->gh_state,
-									   gh->gh_flags))))
-					goto fail;
-
-				/* We're good!  Grant the hold. */
-				list_add_tail(&gh->gh_list, &gl->gl_holders);
-				set_bit(HIF_HOLDER, &gh->gh_iflags);
-
-				gh->gh_error = 0;
-				complete(&gh->gh_wait);
-
-				return;
-			}
-		}
-
-		/* If not, Search through glock's wait-for-promotion list to
-		   see if this process already is waiting for a grant. */
-		for (head = &gl->gl_waiters3, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			tmp_gh = list_entry(tmp, struct gfs_holder, gh_list);
-			if (tmp_gh->gh_owner == gh->gh_owner) {
-				/* Yes, make sure it is compatible with new */
-				if (!(gh->gh_flags & GL_FLOCK) &&
-				    (gfs_assert_warn(sdp, test_bit(HIF_PROMOTE,
-								   &tmp_gh->gh_iflags)) ||
-				     gfs_assert_warn(sdp, (gh->gh_flags & LM_FLAG_ANY) ||
-						     !(tmp_gh->gh_flags & LM_FLAG_ANY)) ||
-				     gfs_assert_warn(sdp, (tmp_gh->gh_flags & GL_LOCAL_EXCL) ||
-						     !(gh->gh_flags & GL_LOCAL_EXCL)) ||
-				     gfs_assert_warn(sdp, relaxed_state_ok(tmp_gh->gh_state,
-									   gh->gh_state,
-									   gh->gh_flags))))
-					goto fail;
-
-				/* OK, make sure they're marked, so
-				 * when one gets granted, the other will too. */
-				set_bit(HIF_RECURSE, &gh->gh_iflags);
-				set_bit(HIF_RECURSE, &tmp_gh->gh_iflags);
-
-				list_add_tail(&gh->gh_list, &gl->gl_waiters3);
-
-				return;
-			}
-		}
-	}
-
-	/* Else, no recursion ...
-	   If high priority request, add to head of promote queue, else tail */
-	if (gh->gh_flags & LM_FLAG_PRIORITY)
-		list_add(&gh->gh_list, &gl->gl_waiters3);
-	else
-		list_add_tail(&gh->gh_list, &gl->gl_waiters3);
-
-	return;
-
- fail:
-	set_bit(HIF_ABORTED, &gh->gh_iflags);
-}
-
-/**
- * gfs_glock_nq - enqueue a struct gfs_holder onto a glock (acquire a glock)
- * @gh: the holder structure
- *
- * if (gh->gh_flags & GL_ASYNC), this never returns an error
- *
- * Returns: 0, GLR_TRYFAILED, or errno on failure
- *
- * Rules:
- *   @gh must not be already attached to a glock.
- *   Don't ask for UNLOCKED state (use gfs_glock_dq() for that).
- *   LM_FLAG_ANY (liberal) and GL_EXACT (restrictive) are mutually exclusive.
- */
-
-int
-gfs_glock_nq(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	int error = 0;
-
-	atomic_inc(&sdp->sd_glock_nq_calls);
-
- restart:
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) ||
-	    gfs_assert_warn(sdp, list_empty(&gh->gh_list)) ||
-	    gfs_assert_warn(sdp, gh->gh_state != LM_ST_UNLOCKED) ||
-	    gfs_assert_warn(sdp, (gh->gh_flags & (LM_FLAG_ANY | GL_EXACT)) !=
-			    (LM_FLAG_ANY | GL_EXACT))) {
-		set_bit(HIF_ABORTED, &gh->gh_iflags);
-		return -EIO;
-	}
-
-	set_bit(HIF_PROMOTE, &gh->gh_iflags);
-
-	spin_lock(&gl->gl_spin);
-	add_to_queue(gh);
-	run_queue(gl);
-	spin_unlock(&gl->gl_spin);
-
-	if (!(gh->gh_flags & GL_ASYNC)) {
-		error = glock_wait_internal(gh);
-		if (error == GLR_CANCELED) {
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ);
-			goto restart;
-		}
-	}
-
-	clear_bit(GLF_PREFETCH, &gl->gl_flags);
-
-	return error;
-}
-
-/**
- * gfs_glock_poll - poll to see if an async request has been completed
- * @gh: the holder
- *
- * Returns: TRUE if the request is ready to be gfs_glock_wait()ed on
- */
-
-int
-gfs_glock_poll(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	int ready = FALSE;
-
-	gfs_assert_warn(gl->gl_sbd, gh->gh_flags & GL_ASYNC);
-
-	spin_lock(&gl->gl_spin);
-
-	if (test_bit(HIF_HOLDER, &gh->gh_iflags))
-		ready = TRUE;
-	else if (list_empty(&gh->gh_list)) {
-		if (gh->gh_error == GLR_CANCELED) {
-			spin_unlock(&gl->gl_spin);
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ);
-			if (gfs_glock_nq(gh))
-				return TRUE;
-			return FALSE;
-		} else
-			ready = TRUE;
-	}
-
-	spin_unlock(&gl->gl_spin);
-
-	return ready;
-}
-
-/**
- * gfs_glock_wait - wait for a lock acquisition that ended in a GLR_ASYNC
- * @gh: the holder structure
- *
- * Returns: 0, GLR_TRYFAILED, or errno on failure
- */
-
-int
-gfs_glock_wait(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	int error;
-
-        gfs_assert_warn(gl->gl_sbd, gh->gh_flags & GL_ASYNC);
-
-	error = glock_wait_internal(gh);
-	if (error == GLR_CANCELED) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ);
-		gh->gh_flags &= ~GL_ASYNC;
-		error = gfs_glock_nq(gh);
-	}
-
-	return error;
-}
-
-/**
- * gfs_glock_dq - dequeue a struct gfs_holder from a glock (release a glock)
- * @gh: the glock holder
- *
- * This releases a local process' hold on a glock, and services other waiters.
- * If this is the last holder on this node, calls glock operation go_unlock(),
- *    and go_sync() if requested by glock's GL_SYNC flag.
- * If glock's GL_NOCACHE flag is set, requests demotion to unlock the inter-
- *    node lock now, rather than caching the glock for later use.
- * Otherwise, this function does *not* release the glock at inter-node scope.
- *   The glock will stay in glock cache until:
- *   --  This node uses it again (extending residence in glock cache), or
- *   --  Another node asks (via callback) for the lock, or
- *   --  The glock sits unused in glock cache for a while, and the cleanup
- *         daemons (gfs_scand and gfs_glockd) reclaim it.
- */
-
-void
-gfs_glock_dq(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-
-	atomic_inc(&gl->gl_sbd->sd_glock_dq_calls);
-
-	gfs_assert_withdraw(sdp, !queue_empty(gl, &gh->gh_list));
-	gfs_assert_withdraw(sdp, test_bit(HIF_HOLDER, &gh->gh_iflags));
-
-	if (gh->gh_flags & GL_SYNC)
-		set_bit(GLF_SYNC, &gl->gl_flags);
-
-	/* Don't cache glock; request demote to unlock at inter-node scope */
-	if (gh->gh_flags & GL_NOCACHE && gl->gl_holders.next == &gh->gh_list &&
-	    gl->gl_holders.prev == &gh->gh_list)
-		/* There's a race here.  If there are two holders, and both
- 		 * are dq'ed at almost the same time, you can't guarantee that
- 		 * you will call handle_callback. Fixing this will require
- 		 * some refactoring */
-		handle_callback(gl, LM_ST_UNLOCKED);
-
-	lock_on_glock(gl);
-
-	spin_lock(&gl->gl_spin);
-	list_del_init(&gh->gh_list);
-
-	/* If last holder, do appropriate glock operations, set cache timer */
-	if (list_empty(&gl->gl_holders)) {
-		spin_unlock(&gl->gl_spin);
-
-		if (glops->go_unlock)
-			glops->go_unlock(gl, gh->gh_flags);
-
-		/* Do "early" sync, if requested by holder */
-		if (test_bit(GLF_SYNC, &gl->gl_flags)) {
-			if (glops->go_sync)
-				glops->go_sync(gl,
-					       DIO_METADATA |
-					       DIO_DATA |
-					       DIO_INVISIBLE);
-		}
-
-		gl->gl_stamp = jiffies;
-
-		spin_lock(&gl->gl_spin);
-	}
-
-	clear_bit(GLF_LOCK, &gl->gl_flags);
-	run_queue(gl);
-	spin_unlock(&gl->gl_spin);
-}
-
-/**
- * gfs_glock_prefetch - Try to prefetch a glock
- * @gl: the glock
- * @state: the state to prefetch in 
- * @flags: flags passed to go_xmote_th()
- *
- * Bypass request queues of glock (i.e. no holder involved), and directly call
- *   go_xmote_th() to ask lock module for lock, to put in glock cache for
- *   later use.
- *
- * Will not prefetch the lock (no need to) if a process on this node is already
- *   interested in the lock, or if it's sitting in glock cache in a compatible
- *   state.
- *
- * Rules:
- *   Don't ask for UNLOCKED state (use gfs_glock_dq() for that).
- *   LM_FLAG_ANY (liberal) and GL_EXACT (restrictive) are mutually exclusive.
- */
-
-void
-gfs_glock_prefetch(struct gfs_glock *gl, unsigned int state, int flags)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-
-	if (gfs_assert_warn(sdp, state != LM_ST_UNLOCKED) ||
-	    gfs_assert_warn(sdp, (flags & (LM_FLAG_ANY | GL_EXACT)) !=
-			    (LM_FLAG_ANY | GL_EXACT)))
-		return;
-
-	spin_lock(&gl->gl_spin);
-
-	/* Should we prefetch? */
-	if (test_bit(GLF_LOCK, &gl->gl_flags) ||
-	    !list_empty(&gl->gl_holders) ||
-	    !list_empty(&gl->gl_waiters1) ||
-	    !list_empty(&gl->gl_waiters2) ||
-	    !list_empty(&gl->gl_waiters3) ||
-	    relaxed_state_ok(gl->gl_state, state, flags)) {
-		spin_unlock(&gl->gl_spin);
-		return;
-	}
-
-	/* Let bottom half know we're prefetching, ask lock module for lock */
-	set_bit(GLF_PREFETCH, &gl->gl_flags);
-
-	if (gfs_assert_warn(sdp, !gl->gl_req_gh))
-		gl->gl_req_gh = NULL;
-	set_bit(GLF_LOCK, &gl->gl_flags);
-	spin_unlock(&gl->gl_spin);
-
-	glops->go_xmote_th(gl, state, flags);
-
-	atomic_inc(&gl->gl_sbd->sd_glock_prefetch_calls);
-}
-
-/**
- * gfs_glock_force_drop - Force a glock to be uncached
- * @gl: the glock
- *
- */
-
-void
-gfs_glock_force_drop(struct gfs_glock *gl)
-{
-	struct gfs_holder gh;
-
-	gfs_holder_init(gl, LM_ST_UNLOCKED, 0, &gh);
-	set_bit(HIF_DEMOTE, &gh.gh_iflags);
-	gh.gh_owner = NULL;
-
-	spin_lock(&gl->gl_spin);
-	list_add_tail(&gh.gh_list, &gl->gl_waiters2);
-	run_queue(gl);
-	spin_unlock(&gl->gl_spin);
-
-	wait_for_completion(&gh.gh_wait);
-	gfs_holder_uninit(&gh);
-}
-
-/**
- * greedy_work -
- * @data:
- *
- */
-
-static void
-greedy_work(struct work_struct *work)
-{
-	struct greedy *gr = container_of(work, struct greedy, gr_work.work);
-	struct gfs_holder *gh = &gr->gr_gh;
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-
-	clear_bit(GLF_SKIP_WAITERS2, &gl->gl_flags);
-
-	if (glops->go_greedy)
-		glops->go_greedy(gl);
-
-	spin_lock(&gl->gl_spin);
-
-	if (list_empty(&gl->gl_waiters2)) {
-		clear_bit(GLF_GREEDY, &gl->gl_flags);
-		spin_unlock(&gl->gl_spin);
-		gfs_holder_uninit(gh);
-		kfree(gr);
-	} else {
-		glock_hold(gl);
-		list_add_tail(&gh->gh_list, &gl->gl_waiters2);
-		run_queue(gl);
-		spin_unlock(&gl->gl_spin);
-		glock_put(gl);
-	}
-}
-
-/**
- * gfs_glock_be_greedy -
- * @gl:
- * @time:
- *
- * Returns: 0 if go_greedy will be called, 1 otherwise
- */
-
-int
-gfs_glock_be_greedy(struct gfs_glock *gl, unsigned int time)
-{
-	struct greedy *gr;
-	struct gfs_holder *gh;
-
-	if (!time ||
-	    gl->gl_sbd->sd_args.ar_localcaching ||
-	    test_and_set_bit(GLF_GREEDY, &gl->gl_flags))
-		return 1;
-
-	gr = kmalloc(sizeof(struct greedy), GFP_KERNEL);
-	if (!gr) {
-		clear_bit(GLF_GREEDY, &gl->gl_flags);
-		return 1;
-	}
-	gh = &gr->gr_gh;
-
-	gfs_holder_init(gl, 0, 0, gh);
-	set_bit(HIF_GREEDY, &gh->gh_iflags);
-	gh->gh_owner = NULL;
-	INIT_DELAYED_WORK(&gr->gr_work, greedy_work);
-
-	set_bit(GLF_SKIP_WAITERS2, &gl->gl_flags);
-	schedule_delayed_work(&gr->gr_work, time);
-
-	return 0;
-}
-
-/**
- * gfs_glock_nq_init - intialize a holder and enqueue it on a glock
- * @gl: the glock 
- * @state: the state we're requesting
- * @flags: the modifier flags
- * @gh: the holder structure
- *
- * Returns: 0, GLR_*, or errno
- */
-
-int
-gfs_glock_nq_init(struct gfs_glock *gl, unsigned int state, int flags,
-		  struct gfs_holder *gh)
-{
-	int error;
-
-	gfs_holder_init(gl, state, flags, gh);
-
-	error = gfs_glock_nq(gh);
-	if (error)
-		gfs_holder_uninit(gh);
-
-	return error;
-}
-
-/**
- * gfs_glock_dq_uninit - dequeue a holder from a glock and initialize it
- * @gh: the holder structure
- *
- */
-
-void
-gfs_glock_dq_uninit(struct gfs_holder *gh)
-{
-	gfs_glock_dq(gh);
-	gfs_holder_uninit(gh);
-}
-
-/**
- * gfs_glock_nq_num - acquire a glock based on lock number
- * @sdp: the filesystem
- * @number: the lock number
- * @glops: the glock operations for the type of glock
- * @state: the state to acquire the glock in
- * @flags: modifier flags for the aquisition
- * @gh: the struct gfs_holder
- *
- * Returns: errno
- */
-
-int
-gfs_glock_nq_num(struct gfs_sbd *sdp,
-		 uint64_t number, struct gfs_glock_operations *glops,
-		 unsigned int state, int flags, struct gfs_holder *gh)
-{
-	struct gfs_glock *gl;
-	int error;
-
-	error = gfs_glock_get(sdp, number, glops, CREATE, &gl);
-	if (!error) {
-		error = gfs_glock_nq_init(gl, state, flags, gh);
-		glock_put(gl);
-	}
-
-	return error;
-}
-
-/**
- * glock_compare - Compare two struct gfs_glock structures for sorting
- * @arg_a: the first structure
- * @arg_b: the second structure
- *
- */
-
-static int
-glock_compare(const void *arg_a, const void *arg_b)
-{
-	struct gfs_holder *gh_a = *(struct gfs_holder **)arg_a;
-	struct gfs_holder *gh_b = *(struct gfs_holder **)arg_b;
-	struct lm_lockname *a = &gh_a->gh_gl->gl_name;
-	struct lm_lockname *b = &gh_b->gh_gl->gl_name;
-	int ret = 0;
-
-	if (a->ln_number > b->ln_number)
-		ret = 1;
-	else if (a->ln_number < b->ln_number)
-		ret = -1;
-	else {
-		if (gh_a->gh_state == LM_ST_SHARED &&
-		    gh_b->gh_state == LM_ST_EXCLUSIVE)
-			ret = 1;
-		else if (!(gh_a->gh_flags & GL_LOCAL_EXCL) &&
-			 (gh_b->gh_flags & GL_LOCAL_EXCL))
-			ret = 1;
-	}
-
-	return ret;
-}
-
-/**
- * nq_m_sync - synchonously acquire more than one glock in deadlock free order
- * @num_gh: the number of structures
- * @ghs: an array of struct gfs_holder structures
- *
- * Returns: 0 on success (all glocks acquired), errno on failure (no glocks acquired)
- */
-
-static int
-nq_m_sync(unsigned int num_gh, struct gfs_holder *ghs, struct gfs_holder **p)
-{
-	unsigned int x;
-	int error = 0;
-
-	for (x = 0; x < num_gh; x++)
-		p[x] = &ghs[x];
-
-	gfs_sort(p, num_gh, sizeof(struct gfs_holder *), glock_compare);
-
-	for (x = 0; x < num_gh; x++) {
-		p[x]->gh_flags &= ~(LM_FLAG_TRY | GL_ASYNC);
-
-		error = gfs_glock_nq(p[x]);
-		if (error) {
-			while (x--)
-				gfs_glock_dq(p[x]);
-			break;
-		}
-	}
-
-	return error;
-}
-
-/**
- * gfs_glock_nq_m - acquire multiple glocks
- * @num_gh: the number of structures
- * @ghs: an array of struct gfs_holder structures
- *
- * Figure out how big an impact this function has.  Either:
- * 1) Replace this code with code that calls gfs_glock_prefetch()
- * 2) Forget async stuff and just call nq_m_sync()
- * 3) Leave it like it is
- *
- * Returns: 0 on success (all glocks acquired), errno on failure (no glocks acquired)
- */
-
-int
-gfs_glock_nq_m(unsigned int num_gh, struct gfs_holder *ghs)
-{
-	int *e;
-	unsigned int x;
-	int borked = FALSE, serious = 0;
-	int error = 0;
-
-	if (!num_gh)
-		return 0;
-
-	/* For just one gh, do request synchronously */
-	if (num_gh == 1) {
-		ghs->gh_flags &= ~(LM_FLAG_TRY | GL_ASYNC);
-		return gfs_glock_nq(ghs);
-	}
-
-	/* using sizeof(struct gfs_holder *) instead of sizeof(int), because
-	 * we're also using this memory for nq_m_sync and ints should never be
-	 * larger than pointers.... I hope
-	 */
-	e = kmalloc(num_gh * sizeof(struct gfs_holder *), GFP_KERNEL);
-	if (!e)
-		return -ENOMEM;
-
-	/* Send off asynchronous requests */
-	for (x = 0; x < num_gh; x++) {
-		ghs[x].gh_flags |= LM_FLAG_TRY | GL_ASYNC;
-		error = gfs_glock_nq(&ghs[x]);
-		if (error) {
-			borked = TRUE;
-			serious = error;
-			num_gh = x;
-			break;
-		}
-	}
-
-	/* Wait for all to complete */
-	for (x = 0; x < num_gh; x++) {
-		error = e[x] = glock_wait_internal(&ghs[x]);
-		if (error) {
-			borked = TRUE;
-			if (error != GLR_TRYFAILED && error != GLR_CANCELED)
-				serious = error;
-		}
-	}
-
-	/* If all good, done! */
-	if (!borked) {
-		kfree(e);
-		return 0;
-	}
-
-	for (x = 0; x < num_gh; x++)
-		if (!e[x])
-			gfs_glock_dq(&ghs[x]);
-
-	if (serious)
-		error = serious;
-	else {
-		for (x = 0; x < num_gh; x++)
-			gfs_holder_reinit(ghs[x].gh_state, ghs[x].gh_flags,
-					  &ghs[x]);
-		error = nq_m_sync(num_gh, ghs, (struct gfs_holder **)e);
-	}
-
-	kfree(e);
-	return error;
-}
-
-/**
- * gfs_glock_dq_m - release multiple glocks
- * @num_gh: the number of structures
- * @ghs: an array of struct gfs_holder structures
- *
- */
-
-void
-gfs_glock_dq_m(unsigned int num_gh, struct gfs_holder *ghs)
-{
-	unsigned int x;
-
-	for (x = 0; x < num_gh; x++)
-		gfs_glock_dq(&ghs[x]);
-}
-
-/**
- * gfs_glock_prefetch_num - prefetch a glock based on lock number
- * @sdp: the filesystem
- * @number: the lock number
- * @glops: the glock operations for the type of glock
- * @state: the state to acquire the glock in
- * @flags: modifier flags for the aquisition
- *
- * Returns: errno
- */
-
-void
-gfs_glock_prefetch_num(struct gfs_sbd *sdp,
-		       uint64_t number, struct gfs_glock_operations *glops,
-		       unsigned int state, int flags)
-{
-	struct gfs_glock *gl;
-	int error;
-
-	if (atomic_read(&sdp->sd_reclaim_count) < gfs_tune_get(sdp, gt_reclaim_limit)) {
-		error = gfs_glock_get(sdp, number, glops, CREATE, &gl);
-		if (!error) {
-			gfs_glock_prefetch(gl, state, flags);
-			glock_put(gl);
-		}
-	}
-}
-
-/**
- * gfs_lvb_hold - attach a LVB from a glock
- * @gl: The glock in question
- *
- */
-
-int
-gfs_lvb_hold(struct gfs_glock *gl)
-{
-	int error;
-
-	lock_on_glock(gl);
-
-	if (!atomic_read(&gl->gl_lvb_count)) {
-		gfs_assert_warn(gl->gl_sbd, !gl->gl_lvb);
-		error = gfs_lm_hold_lvb(gl->gl_sbd, gl->gl_lock, &gl->gl_lvb);
-		if (error) {
-			unlock_on_glock(gl);
-			return error;
-		}
-		glock_hold(gl);
-	}
-	atomic_inc(&gl->gl_lvb_count);
-
-	unlock_on_glock(gl);
-
-	return 0;
-}
-
-/**
- * gfs_lvb_unhold - detach a LVB from a glock
- * @gl: The glock in question
- * 
- */
-
-void
-gfs_lvb_unhold(struct gfs_glock *gl)
-{
-	glock_hold(gl);
-
-	lock_on_glock(gl);
-
-	if (!gfs_assert_warn(gl->gl_sbd, atomic_read(&gl->gl_lvb_count) > 0) &&
-	    atomic_dec_and_test(&gl->gl_lvb_count)) {
-		gfs_assert_warn(gl->gl_sbd, gl->gl_lvb);
-		gfs_lm_unhold_lvb(gl->gl_sbd, gl->gl_lock, gl->gl_lvb);
-		gl->gl_lvb = NULL;
-		glock_put(gl);
-	}
-
-	unlock_on_glock(gl);
-
-	glock_put(gl);
-}
-
-#if 0
-/**
- * gfs_lvb_sync - sync a LVB
- * @gl: The glock in question
- * 
- */
-
-void
-gfs_lvb_sync(struct gfs_glock *gl)
-{
-	if (gfs_assert_warn(gl->gl_sbd, atomic_read(&gl->gl_lvb_count)))
-		return;
-
-	lock_on_glock(gl);
-
-	if (!gfs_assert_warn(gl->gl_sbd, gfs_glock_is_held_excl(gl)))
-		gfs_lm_sync_lvb(gl->gl_sbd, gl->gl_lock, gl->gl_lvb);
-
-	unlock_on_glock(gl);
-}
-#endif
-
-/**
- * blocking_cb -
- * @sdp:
- * @name:
- * @state:
- *
- */
-
-void
-blocking_cb(struct gfs_sbd *sdp, struct lm_lockname *name, unsigned int state)
-{
-	struct gfs_glock *gl;
-
-	gl = gfs_glock_find(sdp, name);
-	if (!gl)
-		return;
-
-	if (gl->gl_ops->go_callback)
-		gl->gl_ops->go_callback(gl, state);
-	handle_callback(gl, state);
-
-	spin_lock(&gl->gl_spin);
-	run_queue(gl);
-	spin_unlock(&gl->gl_spin);
-
-	glock_put(gl);
-}
-
-/**
- * gfs_glock_cb - Callback used by locking module
- * @fsdata: Pointer to the superblock
- * @type: Type of callback
- * @data: Type dependent data pointer
- *
- * Called by the locking module when it wants to tell us something.
- * Either we need to drop a lock, one of our ASYNC requests completed, or
- *   another client expired (crashed/died) and we need to recover its journal.
- * If another node needs a lock held by this node, we queue a request to demote
- *   our lock to a state compatible with that needed by the other node.  
- *   For example, if the other node needs EXCLUSIVE, we request UNLOCKED.
- *   SHARED and DEFERRED modes can be shared with other nodes, so we request
- *   accordingly.
- * Once all incompatible holders on this node are done with the lock, the
- *   queued request will cause run_queue() to call the lock module to demote
- *   our lock to a compatible state, allowing the other node to grab the lock.
- */
-
-void
-gfs_glock_cb(void *fsdata, unsigned int type, void *data)
-{
-	struct gfs_sbd *sdp = fsdata;
-
-	atomic_inc(&sdp->sd_lm_callbacks);
-
-	switch (type) {
-	case LM_CB_NEED_E:
-		blocking_cb(sdp, (struct lm_lockname *)data, LM_ST_UNLOCKED);
-		return;
-
-	case LM_CB_NEED_D:
-		blocking_cb(sdp, (struct lm_lockname *)data, LM_ST_DEFERRED);
-		return;
-
-	case LM_CB_NEED_S:
-		blocking_cb(sdp, (struct lm_lockname *)data, LM_ST_SHARED);
-		return;
-
-	case LM_CB_ASYNC: {
-		struct lm_async_cb *async = (struct lm_async_cb *)data;
-		struct gfs_glock *gl;
-
-		gl = gfs_glock_find(sdp, &async->lc_name);
-		if (gfs_assert_warn(sdp, gl))
-			return;
-		if (!gfs_assert_warn(sdp, gl->gl_req_bh))
-			gl->gl_req_bh(gl, async->lc_ret);
-		glock_put(gl);
-
-		return;
-	}
-
-	case LM_CB_NEED_RECOVERY:
-		gfs_add_dirty_j(sdp, *(unsigned int *)data);
-		if (sdp->sd_recoverd_process)
-			wake_up_process(sdp->sd_recoverd_process);
-		return;
-
-	case LM_CB_DROPLOCKS:
-		gfs_gl_hash_clear(sdp, FALSE);
-		gfs_quota_scan(sdp);
-		return;
-
-	default:
-		gfs_assert_warn(sdp, FALSE);
-		return;
-	}
-}
-
-/**
- * gfs_try_toss_inode - try to remove a particular GFS inode struct from cache
- * sdp: the filesystem
- * inum: the inode number
- *
- * Look for the glock protecting the inode of interest.
- * If no process is manipulating or holding the glock, see if the glock
- *   has a gfs_inode attached.
- * If gfs_inode has no references, unhold its iopen glock, release any
- *   indirect addressing buffers, and destroy the gfs_inode.
- */
-
-void
-gfs_try_toss_inode(struct gfs_sbd *sdp, struct gfs_inum *inum)
-{
-	struct gfs_glock *gl;
-	struct gfs_inode *ip;
-	int error;
-
-	error = gfs_glock_get(sdp,
-			      inum->no_formal_ino, &gfs_inode_glops,
-			      NO_CREATE, &gl);
-	if (error || !gl)
-		return;
-
-	if (!trylock_on_glock(gl))
-		goto out;
-
-	if (!queue_empty(gl, &gl->gl_holders))
-		goto out_unlock;
-
-	ip = get_gl2ip(gl);
-	if (!ip)
-		goto out_unlock;
-
-	if (atomic_read(&ip->i_count))
-		goto out_unlock;
-
-	gfs_inode_destroy(ip);
-
- out_unlock:
-	unlock_on_glock(gl);
-
- out:
-	glock_put(gl);
-}
-
-/**
- * gfs_iopen_go_callback - Try to kick the inode/vnode associated with an iopen glock from memory
- * @io_gl: the iopen glock
- * @state: the state into which the glock should be put
- *
- */
-
-void
-gfs_iopen_go_callback(struct gfs_glock *io_gl, unsigned int state)
-{
-	struct gfs_glock *i_gl;
-	struct gfs_inode *ip;
-
-	if (state != LM_ST_UNLOCKED)
-		return;
-
-	spin_lock(&io_gl->gl_spin);
-	i_gl = get_gl2gl(io_gl);
-	if (i_gl) {
-		glock_hold(i_gl);
-		spin_unlock(&io_gl->gl_spin);
-	} else {
-		spin_unlock(&io_gl->gl_spin);
-		return;
-	}
-
-	if (trylock_on_glock(i_gl)) {
-		if (queue_empty(i_gl, &i_gl->gl_holders)) {
-			ip = get_gl2ip(i_gl);
-			if (ip) {
-				gfs_try_toss_vnode(ip);
-				unlock_on_glock(i_gl);
-				gfs_glock_schedule_for_reclaim(i_gl);
-				goto out;
-			}
-		}
-		unlock_on_glock(i_gl);
-	}
-
- out:
-	glock_put(i_gl);
-}
-
-/**
- * demote_ok - Check to see if it's ok to unlock a glock (to remove it
- *       from glock cache)
- * @gl: the glock
- *
- * Called when trying to reclaim glocks, once it's determined that the glock
- *   has no holders on this node.
- *
- * Returns: TRUE if it's ok
- *
- * It's not okay if:
- * --  glock is STICKY
- * --  PREFETCHed glock has not been given enough chance to be used
- * --  glock-type-specific test says "no"
- */
-
-static int
-demote_ok(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock_operations *glops = gl->gl_ops;
-	int demote = TRUE;
-
-	if (test_bit(GLF_STICKY, &gl->gl_flags))
-		demote = FALSE;
-	else if (test_bit(GLF_PREFETCH, &gl->gl_flags))
-		demote = time_after_eq(jiffies,
-				       gl->gl_stamp +
-				       gfs_tune_get(sdp, gt_prefetch_secs) * HZ);
-	else if (glops->go_demote_ok)
-		demote = glops->go_demote_ok(gl);
-
-	return demote;
-}
-
-/**
- * gfs_glock_schedule_for_reclaim - Add a glock to the reclaim list
- * @gl: the glock
- *
- */
-
-void
-gfs_glock_schedule_for_reclaim(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-
-	spin_lock(&sdp->sd_reclaim_lock);
-	if (list_empty(&gl->gl_reclaim)) {
-		glock_hold(gl);
-		list_add(&gl->gl_reclaim, &sdp->sd_reclaim_list);
-		atomic_inc(&sdp->sd_reclaim_count);
-	}
-	spin_unlock(&sdp->sd_reclaim_lock);
-
-	wake_up(&sdp->sd_reclaim_wchan);
-}
-
-/**
- * gfs_reclaim_glock - process the next glock on the filesystem's reclaim list
- * @sdp: the filesystem
- *
- * Called from gfs_glockd() glock reclaim daemon, or when promoting a
- *   (different) glock and we notice that there are a lot of glocks in the
- *   reclaim list.
- *
- * Remove glock from filesystem's reclaim list, update reclaim statistics.
- * If no holders (might have gotten added since glock was placed on reclaim
- *   list):
- *   --  Destroy any now-unused inode protected by glock
- *         (and release hold on iopen glock).
- *   --  Ask for demote to UNLOCKED to enable removal of glock from glock cache.
- *
- * If no further interest in glock struct, remove it from glock cache, and
- *   free it from memory.  (During normal operation, this is the only place
- *   that this is done).
- *
- * Glock-type-specific considerations for permission to demote are handled
- *   in demote_ok().  This includes how long to retain a glock in cache after it
- *   is no longer held by any process.
- */
-
-void
-gfs_reclaim_glock(struct gfs_sbd *sdp)
-{
-	struct gfs_glock *gl;
-	struct gfs_gl_hash_bucket *bucket;
-
-	spin_lock(&sdp->sd_reclaim_lock);
-
-	/* Nothing to reclaim?  Done! */
-	if (list_empty(&sdp->sd_reclaim_list)) {
-		spin_unlock(&sdp->sd_reclaim_lock);
-		return;
-	}
-
-	/* Remove next victim from reclaim list */
-	gl = list_entry(sdp->sd_reclaim_list.next,
-			struct gfs_glock, gl_reclaim);
-	list_del_init(&gl->gl_reclaim);
-
-	spin_unlock(&sdp->sd_reclaim_lock);
-
-	atomic_dec(&sdp->sd_reclaim_count);
-	atomic_inc(&sdp->sd_reclaimed);
-
-	if (trylock_on_glock(gl)) {
-		if (queue_empty(gl, &gl->gl_holders)) {
-			/* Inode glock-type-specific; free unused gfs inode,
-			   and release hold on iopen glock */
-			if (gl->gl_ops == &gfs_inode_glops) {
-				struct gfs_inode *ip = get_gl2ip(gl);
-				if (ip && !atomic_read(&ip->i_count))
-					gfs_inode_destroy(ip);
-			}
-			/* Generic (including inodes); try to unlock glock */
-			if (gl->gl_state != LM_ST_UNLOCKED &&
-			    demote_ok(gl))
-				handle_callback(gl, LM_ST_UNLOCKED);
-		}
-		unlock_on_glock(gl);
-	}
-
-	bucket = gl->gl_bucket;
-
-	/* If glock struct's only remaining reference is from being put on
-	   the reclaim list, remove glock from hash table (sd_gl_hash),
-	   and free the glock's memory */
-	write_lock(&bucket->hb_lock);
-	if (atomic_read(&gl->gl_count) == 1) {
-		list_del_init(&gl->gl_list);
-		write_unlock(&bucket->hb_lock);
-		glock_free(gl);
-	} else {
-		write_unlock(&bucket->hb_lock);
-		glock_put(gl);  /* see gfs_glock_schedule_for_reclaim() */
-	}
-}
-
-/**
- * examine_bucket - Call a function for glock in a hash bucket
- * @examiner: the function 
- * @sdp: the filesystem
- * @bucket: the bucket
- *
- * Returns: TRUE if the bucket has entries
- */
-
-static int
-examine_bucket(glock_examiner examiner,
-		struct gfs_sbd *sdp, struct gfs_gl_hash_bucket *bucket,
-		unsigned int *purge_nr)
-{
-	struct glock_plug plug;
-	struct list_head *tmp;
-	struct gfs_glock *gl;
-	int entries;
-
-	/* Add "plug" to end of bucket list, work back up list from there */
-	memset(&plug.gl_flags, 0, sizeof(unsigned long));
-	set_bit(GLF_PLUG, &plug.gl_flags);
-
-	write_lock(&bucket->hb_lock);
-	list_add(&plug.gl_list, &bucket->hb_list);
-	write_unlock(&bucket->hb_lock);
-
-	/* Look at each bucket entry */
-	for (;;) {
-		write_lock(&bucket->hb_lock);
-
-		/* Work back up list from plug */
-		for (;;) {
-			tmp = plug.gl_list.next;
-
-			/* Top of list; we're done */
-			if (tmp == &bucket->hb_list) {
-				list_del(&plug.gl_list);
-				entries = !list_empty(&bucket->hb_list);
-				write_unlock(&bucket->hb_lock);
-				return entries;
-			}
-			gl = list_entry(tmp, struct gfs_glock, gl_list);
-
-			/* Move plug up list */
-			list_move(&plug.gl_list, &gl->gl_list);
-
-			if (test_bit(GLF_PLUG, &gl->gl_flags))
-				continue;
-
-			/* glock_hold; examiner must glock_put() */
-			atomic_inc(&gl->gl_count);
-
-			break;
-		}
-
-		write_unlock(&bucket->hb_lock);
-
-		examiner(gl, purge_nr);
-	}
-}
-
-static void
-try_purge_iopen(struct gfs_glock *gl, unsigned int *p_count)
-{
-	struct gfs_glock *i_gl;
-
-	if (*p_count == 0)
-		return;
-
-	/* find the associated inode glock */
-	i_gl = get_gl2gl(gl);
-	if (!i_gl) 
-		return;
-
-	/* 
-	 * If the associated inode glock has been in unlocked 
-	 * state, try to purge it.
-	 */
-	if (trylock_on_glock(i_gl)) {
-		if (i_gl->gl_state == LM_ST_UNLOCKED) {
-			*p_count = *p_count - 1;
-			unlock_on_glock(i_gl);
-			atomic_inc(&gl->gl_count);
-			gfs_iopen_go_callback(gl, LM_ST_UNLOCKED);
-			handle_callback(gl, LM_ST_UNLOCKED);
-			spin_lock(&gl->gl_spin);
-			run_queue(gl);
-			spin_unlock(&gl->gl_spin);
-			glock_put(gl);
-		} else 
-			unlock_on_glock(i_gl);
-	}
-
-	return;
-}
-
-/**
- * scan_glock - look at a glock and see if we can reclaim it
- * @gl: the glock to look at
- *
- * Called via examine_bucket() when trying to release glocks from glock cache,
- *   during normal operation (i.e. not unmount time).
- * 
- * Place glock on filesystem's reclaim list if, on this node:
- * --  No process is manipulating glock struct, and
- * --  No current holders, and either:
- *     --  GFS incore inode, protected by glock, is no longer in use, or
- *     --  Glock-type-specific demote_ok glops gives permission
- */
-
-static void
-scan_glock(struct gfs_glock *gl,  unsigned int *p_count)
-{
-	if (trylock_on_glock(gl)) {
-		if (queue_empty(gl, &gl->gl_holders)) {
-			/* Inode glock-type-specific; reclaim glock if gfs inode
-			   no longer in use. */
-			if (gl->gl_ops == &gfs_inode_glops) {
-				struct gfs_inode *ip = get_gl2ip(gl);
-				if (ip && !atomic_read(&ip->i_count)) {
-					unlock_on_glock(gl);
-					gfs_glock_schedule_for_reclaim(gl);
-					goto out;
-				}
-			}
-			/* Generic (including inodes not scheduled above) */
-			if (gl->gl_state != LM_ST_UNLOCKED &&
-			    demote_ok(gl)) {
-				unlock_on_glock(gl);
-				gfs_glock_schedule_for_reclaim(gl);
-				goto out;
-			}
-		}
-		/* iopen always has holder(s) */
-		if (gl->gl_name.ln_type == LM_TYPE_IOPEN) {
-			unlock_on_glock(gl);
-			try_purge_iopen(gl, p_count);
-			goto out;
-		}
-		unlock_on_glock(gl);
-	}
-
- out:
-	glock_put(gl);  /* see examine_bucket() */
-}
-
-/**
- * gfs_scand_internal - Look for glocks and inodes to toss from memory
- * @sdp: the filesystem
- *
- * Invokes scan_glock() for each glock in each cache bucket.
- *
- * Steps of reclaiming a glock:
- * --  scan_glock() places eligible glocks on filesystem's reclaim list.
- * --  gfs_reclaim_glock() processes list members, attaches demotion requests
- *     to wait queues of glocks still locked at inter-node scope.
- * --  Demote to UNLOCKED state (if not already unlocked).
- * --  gfs_reclaim_lock() cleans up glock structure.
- */
-
-void
-gfs_scand_internal(struct gfs_sbd *sdp)
-{
-	unsigned int x, purge_nr;
-
-	if (!sdp->sd_tune.gt_glock_purge)
-		purge_nr = 0;
-	else
-		purge_nr = atomic_read(&sdp->sd_glock_count) *
-			sdp->sd_tune.gt_glock_purge / 100;
-
-	for (x = 0; x < GFS_GL_HASH_SIZE; x++) {
-		examine_bucket(scan_glock, sdp, &sdp->sd_gl_hash[x], &purge_nr);
-		cond_resched();
-	}
-}
-
-/**
- * clear_glock - look at a glock and see if we can free it from glock cache
- * @gl: the glock to look at
- *
- * Called via examine_bucket() when unmounting the filesystem, or
- *   when inter-node lock manager requests DROPLOCKS because it is running
- *   out of capacity.
- *
- * Similar to gfs_reclaim_glock(), except does *not*:
- *   --  Consult demote_ok() for permission
- *   --  Increment sdp->sd_reclaimed statistic
- *
- */
-
-static void
-clear_glock(struct gfs_glock *gl, unsigned int *unused)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_gl_hash_bucket *bucket = gl->gl_bucket;
-
-	spin_lock(&sdp->sd_reclaim_lock);
-	if (!list_empty(&gl->gl_reclaim)) {
-		list_del_init(&gl->gl_reclaim);
-		atomic_dec(&sdp->sd_reclaim_count);
-		glock_put(gl);  /* see gfs_glock_schedule_for_reclaim() */
-	}
-	spin_unlock(&sdp->sd_reclaim_lock);
-
-	if (trylock_on_glock(gl)) {
-		if (queue_empty(gl, &gl->gl_holders)) {
-			/* Inode glock-type-specific; free unused gfs inode,
-			   and release hold on iopen glock */
-			if (gl->gl_ops == &gfs_inode_glops) {
-				struct gfs_inode *ip = get_gl2ip(gl);
-				if (ip && !atomic_read(&ip->i_count))
-					gfs_inode_destroy(ip);
-			}
-			/* Generic (including inodes); unlock glock */
-			if (gl->gl_state != LM_ST_UNLOCKED)
-				handle_callback(gl, LM_ST_UNLOCKED);
-		}
-
-		unlock_on_glock(gl);
-	}
-
-	/* If glock struct's only remaining reference is from examine_bucket(),
-	   remove glock from hash table (sd_gl_hash), and free glock's memory */
-	write_lock(&bucket->hb_lock);
-	if (atomic_read(&gl->gl_count) == 1) {
-		list_del_init(&gl->gl_list);
-		write_unlock(&bucket->hb_lock);
-		glock_free(gl);
-	} else {
-		write_unlock(&bucket->hb_lock);
-		glock_put(gl);   /* see examine_bucket() */
-	}
-}
-
-/**
- * gfs_gl_hash_clear - Empty out the glock hash table
- * @sdp: the filesystem
- * @wait: wait until it's all gone
- *
- * Called when unmounting the filesystem, or when inter-node lock manager
- *   requests DROPLOCKS because it is running out of capacity.
- */
-
-void
-gfs_gl_hash_clear(struct gfs_sbd *sdp, int wait)
-{
-	unsigned long t;
-	unsigned int x;
-	int cont;
-
-	t = jiffies;
-
-	for (;;) {
-		cont = FALSE;
-
-		for (x = 0; x < GFS_GL_HASH_SIZE; x++)
-			if (examine_bucket(clear_glock, sdp, &sdp->sd_gl_hash[x], 0))
-				cont = TRUE;
-
-		if (!wait || !cont)
-			break;
-
-		if (time_after_eq(jiffies, t + gfs_tune_get(sdp, gt_stall_secs) * HZ)) {
-			printk("GFS: fsid=%s: Unmount seems to be stalled. Dumping lock state...\n",
-			       sdp->sd_fsname);
-			gfs_dump_lockstate(sdp, NULL);
-			t = jiffies;
-		}
-
-		invalidate_inodes(sdp->sd_vfs);
-		schedule_timeout_interruptible(HZ / 10);
-	}
-}
-
-/*
- *  Diagnostic routines to help debug distributed deadlock
- */
-
-/**
- * dump_holder - print information about a glock holder
- * @str: a string naming the type of holder
- * @gh: the glock holder
- * @buf: the buffer
- * @size: the size of the buffer
- * @count: where we are in the buffer
- *
- * Returns: 0 on success, -ENOBUFS when we run out of space
- */
-
-static int
-dump_holder(char *str, struct gfs_holder *gh,
-	    char *buf, unsigned int size, unsigned int *count)
-{
-	unsigned int x;
-	int error = -ENOBUFS;
-
-	gfs_printf("  %s\n", str);
-	gfs_printf("    owner = %ld\n",
-		   (gh->gh_owner) ? (long)gh->gh_owner->pid : -1);
-	gfs_printf("    gh_state = %u\n", gh->gh_state);
-	gfs_printf("    gh_flags =");
-	for (x = 0; x < 32; x++)
-		if (gh->gh_flags & (1 << x))
-			gfs_printf(" %u", x);
-	gfs_printf(" \n");
-	gfs_printf("    error = %d\n", gh->gh_error);
-	gfs_printf("    gh_iflags =");
-	for (x = 0; x < 32; x++)
-		if (test_bit(x, &gh->gh_iflags))
-			gfs_printf(" %u", x);
-	gfs_printf(" \n");
-
-	error = 0;
-
- out:
-	return error;
-}
-
-/**
- * dump_inode - print information about an inode
- * @ip: the inode
- * @buf: the buffer
- * @size: the size of the buffer
- * @count: where we are in the buffer
- *
- * Returns: 0 on success, -ENOBUFS when we run out of space
- */
-
-static int
-dump_inode(struct gfs_inode *ip,
-	   char *buf, unsigned int size, unsigned int *count)
-{
-	unsigned int x;
-	int error = -ENOBUFS;
-
-	gfs_printf("  Inode:\n");
-	gfs_printf("    num = %llu/%llu\n",
-		   (unsigned long long)ip->i_num.no_formal_ino,
-		   (unsigned long long)ip->i_num.no_addr);
-	gfs_printf("    type = %u\n", ip->i_di.di_type);
-	gfs_printf("    i_count = %d\n", atomic_read(&ip->i_count));
-	gfs_printf("    i_flags =");
-	for (x = 0; x < 32; x++)
-		if (test_bit(x, &ip->i_flags))
-			gfs_printf(" %u", x);
-	gfs_printf(" \n");
-	gfs_printf("    vnode = %s\n", (ip->i_vnode) ? "yes" : "no");
-
-	error = 0;
-
- out:
-	return error;
-}
-
-/**
- * dump_glock - print information about a glock
- * @gl: the glock
- * @buf: the buffer
- * @size: the size of the buffer
- * @count: where we are in the buffer
- *
- * Returns: 0 on success, -ENOBUFS when we run out of space
- */
-
-static int
-dump_glock(struct gfs_glock *gl,
-	   char *buf, unsigned int size, unsigned int *count)
-{
-	struct list_head *head, *tmp;
-	struct gfs_holder *gh;
-	unsigned int x;
-	int error = -ENOBUFS;
-
-	spin_lock(&gl->gl_spin);
-
-	gfs_printf("Glock (%u, %llu)\n",
-		    gl->gl_name.ln_type,
-		    (unsigned long long)gl->gl_name.ln_number);
-	gfs_printf("  gl_flags =");
-	for (x = 0; x < 32; x++)
-		if (test_bit(x, &gl->gl_flags))
-			gfs_printf(" %u", x);
-	gfs_printf(" \n");
-	gfs_printf("  gl_count = %d\n", atomic_read(&gl->gl_count));
-	gfs_printf("  gl_state = %u\n", gl->gl_state);
-	gfs_printf("  req_gh = %s\n", (gl->gl_req_gh) ? "yes" : "no");
-	gfs_printf("  req_bh = %s\n", (gl->gl_req_bh) ? "yes" : "no");
-	gfs_printf("  lvb_count = %d\n", atomic_read(&gl->gl_lvb_count));
-	gfs_printf("  object = %s\n", (gl->gl_object) ? "yes" : "no");
-	gfs_printf("  new_le = %s\n", (gl->gl_new_le.le_trans) ? "yes" : "no");
-	gfs_printf("  incore_le = %s\n", (gl->gl_incore_le.le_trans) ? "yes" : "no");
-	gfs_printf("  reclaim = %s\n",
-		    (list_empty(&gl->gl_reclaim)) ? "no" : "yes");
-	if (gl->gl_aspace)
-		gfs_printf("  aspace = %lu\n",
-			    gl->gl_aspace->i_mapping->nrpages);
-	else
-		gfs_printf("  aspace = no\n");
-	gfs_printf("  ail_bufs = %s\n",
-		   (list_empty(&gl->gl_ail_bufs)) ? "no" : "yes");
-	if (gl->gl_req_gh) {
-		error = dump_holder("Request", gl->gl_req_gh, buf, size, count);
-		if (error)
-			goto out;
-	}
-	for (head = &gl->gl_holders, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gh = list_entry(tmp, struct gfs_holder, gh_list);
-		error = dump_holder("Holder", gh, buf, size, count);
-		if (error)
-			goto out;
-	}
-	for (head = &gl->gl_waiters1, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gh = list_entry(tmp, struct gfs_holder, gh_list);
-		error = dump_holder("Waiter1", gh, buf, size, count);
-		if (error)
-			goto out;
-	}
-	for (head = &gl->gl_waiters2, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gh = list_entry(tmp, struct gfs_holder, gh_list);
-		error = dump_holder("Waiter2", gh, buf, size, count);
-		if (error)
-			goto out;
-	}
-	for (head = &gl->gl_waiters3, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gh = list_entry(tmp, struct gfs_holder, gh_list);
-		error = dump_holder("Waiter3", gh, buf, size, count);
-		if (error)
-			goto out;
-	}
-	if (gl->gl_ops == &gfs_inode_glops && get_gl2ip(gl)) {
-		if (!test_bit(GLF_LOCK, &gl->gl_flags) &&
-		    list_empty(&gl->gl_holders)) {
-			error = dump_inode(get_gl2ip(gl), buf, size, count);
-			if (error)
-				goto out;
-		} else {
-			error = -ENOBUFS;
-			gfs_printf("  Inode: busy\n");
-		}
-	}
-
-	error = 0;
-
- out:
-	spin_unlock(&gl->gl_spin);
-
-	return error;
-}
-
-/**
- * gfs_dump_lockstate - print out the current lockstate
- * @sdp: the filesystem
- * @ub: the buffer to copy the information into
- *
- * If @ub is NULL, dump the lockstate to the console.
- *
- */
-
-int
-gfs_dump_lockstate(struct gfs_sbd *sdp, struct gfs_user_buffer *ub)
-{
-	struct gfs_gl_hash_bucket *bucket;
-	struct list_head *tmp, *head;
-	struct gfs_glock *gl;
-	char *buf = NULL;
-	unsigned int size = gfs_tune_get(sdp, gt_lockdump_size);
-	unsigned int x, count;
-	int error = 0;
-
-	if (ub) {
-		buf = kmalloc(size, GFP_KERNEL);
-		if (!buf)
-			return -ENOMEM;
-	}
-
-	for (x = 0; x < GFS_GL_HASH_SIZE; x++) {
-		bucket = &sdp->sd_gl_hash[x];
-		count = 0;
-
-		read_lock(&bucket->hb_lock);
-
-		for (head = &bucket->hb_list, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			gl = list_entry(tmp, struct gfs_glock, gl_list);
-
-			if (test_bit(GLF_PLUG, &gl->gl_flags))
-				continue;
-
-			error = dump_glock(gl, buf, size, &count);
-			if (error)
-				break;
-		}
-
-		read_unlock(&bucket->hb_lock);
-
-		if (error)
-			break;
-
-		if (ub) {
-			if (ub->ub_count + count > ub->ub_size) {
-				error = -ENOMEM;
-				break;
-			}
-			if (copy_to_user(ub->ub_data + ub->ub_count, buf, count)) {
-				error = -EFAULT;
-				break;
-			}
-			ub->ub_count += count;
-		}
-	}
-
-	if (ub)
-		kfree(buf);
-
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/glock.h b/gfs-kernel/src/gfs/glock.h
deleted file mode 100644
index 9de5e94..0000000
--- a/gfs-kernel/src/gfs/glock.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#ifndef __GFS_GLOCK_DOT_H__
-#define __GFS_GLOCK_DOT_H__
-
-/* Flags for lock requests; used in gfs_holder gh_flag field. */
-/*	These are defined in lm_interface.h, commented out here.
-#define LM_FLAG_TRY       (0x00000001)
-#define LM_FLAG_TRY_1CB   (0x00000002)
-#define LM_FLAG_NOEXP     (0x00000004)
-#define LM_FLAG_ANY       (0x00000008)
-#define LM_FLAG_PRIORITY  (0x00000010)
-	These are defined here. */
-#define GL_LOCAL_EXCL     (0x00000020) /* Only one holder may be granted the
-                                        * lock on this node, even if SHARED */
-#define GL_ASYNC          (0x00000040) /* Don't block waiting for lock ...
-                                        * must poll to wait for grant */
-#define GL_EXACT          (0x00000080) /* Requested state must == current state
-                                        * for lock to be granted */
-#define GL_SKIP           (0x00000100) /* Don't read from disk after grant */
-#define GL_ATIME          (0x00000200) /* Update inode's ATIME after grant */
-#define GL_NOCACHE        (0x00000400) /* Release glock when done, don't cache */
-#define GL_SYNC           (0x00000800) /* Sync to disk when no more holders */
-#define GL_NOCANCEL       (0x00001000) /* Don't ever cancel this request */
-#define GL_NOCANCEL_OTHER (0x00004000) /* Don't cancel other locks for this */
-#define GL_FLOCK          (0x00008000) /* This is an flock */
-
-#define GLR_TRYFAILED     (13)
-#define GLR_CANCELED      (14)
-
-static __inline__ int
-gfs_glock_is_locked_by_me(struct gfs_glock *gl)
-{
-	struct list_head *tmp, *head;
-	struct gfs_holder *gh;
-	int locked = FALSE;
-
-	/* Look in glock's list of holders for one with current task as owner */
-	spin_lock(&gl->gl_spin);
-	for (head = &gl->gl_holders, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gh = list_entry(tmp, struct gfs_holder, gh_list);
-		if (gh->gh_owner == current) {
-			locked = TRUE;
-			break;
-		}
-	}
-	spin_unlock(&gl->gl_spin);
-
-	return locked;
-}
-static __inline__ int
-gfs_glock_is_held_excl(struct gfs_glock *gl)
-{
-	return (gl->gl_state == LM_ST_EXCLUSIVE);
-}
-static __inline__ int
-gfs_glock_is_held_dfrd(struct gfs_glock *gl)
-{
-	return (gl->gl_state == LM_ST_DEFERRED);
-}
-static __inline__ int
-gfs_glock_is_held_shrd(struct gfs_glock *gl)
-{
-	return (gl->gl_state == LM_ST_SHARED);
-}
-
-static __inline__ int
-gfs_glock_is_blocking(struct gfs_glock *gl)
-{
-	int ret;
-	spin_lock(&gl->gl_spin);
-	ret = !list_empty(&gl->gl_waiters2) || !list_empty(&gl->gl_waiters3);
-	spin_unlock(&gl->gl_spin);
-	return ret;
-}
-
-struct gfs_glock *gfs_glock_find(struct gfs_sbd *sdp,
-				 struct lm_lockname *name);
-int gfs_glock_get(struct gfs_sbd *sdp,
-		  uint64_t number, struct gfs_glock_operations *glops,
-		  int create, struct gfs_glock **glp);
-void gfs_glock_hold(struct gfs_glock *gl);
-void gfs_glock_put(struct gfs_glock *gl);
-
-void gfs_holder_init(struct gfs_glock *gl, unsigned int state, int flags,
-		     struct gfs_holder *gh);
-void gfs_holder_reinit(unsigned int state, int flags, struct gfs_holder *gh);
-void gfs_holder_uninit(struct gfs_holder *gh);
-struct gfs_holder *gfs_holder_get(struct gfs_glock *gl, unsigned int state,
-				  int flags);
-void gfs_holder_put(struct gfs_holder *gh);
-
-void gfs_glock_xmote_th(struct gfs_glock *gl, unsigned int state, int flags);
-void gfs_glock_drop_th(struct gfs_glock *gl);
-
-int gfs_glock_nq(struct gfs_holder *gh);
-int gfs_glock_poll(struct gfs_holder *gh);
-int gfs_glock_wait(struct gfs_holder *gh);
-void gfs_glock_dq(struct gfs_holder *gh);
-void gfs_glock_dq_wait(struct gfs_holder *gh);
-
-void gfs_glock_prefetch(struct gfs_glock *gl, unsigned int state, int flags);
-void gfs_glock_force_drop(struct gfs_glock *gl);
-
-int gfs_glock_be_greedy(struct gfs_glock *gl, unsigned int time);
-
-int gfs_glock_nq_init(struct gfs_glock *gl, unsigned int state, int flags,
-		      struct gfs_holder *gh);
-void gfs_glock_dq_uninit(struct gfs_holder *gh);
-int gfs_glock_nq_num(struct gfs_sbd *sdp,
-		     uint64_t number, struct gfs_glock_operations *glops,
-		     unsigned int state, int flags, struct gfs_holder *gh);
-
-int gfs_glock_nq_m(unsigned int num_gh, struct gfs_holder *ghs);
-void gfs_glock_dq_m(unsigned int num_gh, struct gfs_holder *ghs);
-
-void gfs_glock_prefetch_num(struct gfs_sbd *sdp,
-			    uint64_t number, struct gfs_glock_operations *glops,
-			    unsigned int state, int flags);
-
-/*  Lock Value Block functions  */
-
-int gfs_lvb_hold(struct gfs_glock *gl);
-void gfs_lvb_unhold(struct gfs_glock *gl);
-void gfs_lvb_sync(struct gfs_glock *gl);
-
-void gfs_glock_cb(void *fsdata, unsigned int type, void *data);
-
-void gfs_try_toss_inode(struct gfs_sbd *sdp, struct gfs_inum *inum);
-void gfs_iopen_go_callback(struct gfs_glock *gl, unsigned int state);
-
-void gfs_glock_schedule_for_reclaim(struct gfs_glock *gl);
-void gfs_reclaim_glock(struct gfs_sbd *sdp);
-
-void gfs_scand_internal(struct gfs_sbd *sdp);
-void gfs_gl_hash_clear(struct gfs_sbd *sdp, int wait);
-
-int gfs_dump_lockstate(struct gfs_sbd *sdp, struct gfs_user_buffer *ub);
-
-#endif /* __GFS_GLOCK_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/glops.c b/gfs-kernel/src/gfs/glops.c
deleted file mode 100644
index 708291d..0000000
--- a/gfs-kernel/src/gfs/glops.c
+++ /dev/null
@@ -1,664 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "log.h"
-#include "page.h"
-#include "recovery.h"
-#include "rgrp.h"
-
-/**
- * meta_go_sync - sync out the metadata for this glock
- * @gl: the glock
- * @flags: DIO_*
- *
- * Used for meta and rgrp glocks.
- *
- * Called when demoting (gfs_glock_xmote_th()) or unlocking
- * (gfs_glock_drop_th() an EX glock at inter-node scope.  We must flush
- * to disk all dirty buffers/pages relating to this glock, and must not
- * not return to caller to demote/unlock the glock until I/O is complete.
- *
- * This is *not* called from gfs_glock_dq(), because GL_SYNC flag is not
- * currently used for anything but inode glocks.
- */
-
-static void
-meta_go_sync(struct gfs_glock *gl, int flags)
-{
-	if (!(flags & DIO_METADATA))
-		return;
-
-	if (test_bit(GLF_DIRTY, &gl->gl_flags)) {
-		gfs_log_flush_glock(gl);
-		gfs_sync_buf(gl, flags | DIO_START | DIO_WAIT | DIO_CHECK);
-	}
-
-	/* We've synced everything, clear SYNC request and DIRTY flags */
-	clear_bit(GLF_DIRTY, &gl->gl_flags);
-	clear_bit(GLF_SYNC, &gl->gl_flags);
-}
-
-/**
- * meta_go_inval - invalidate the metadata for this glock
- * @gl: the glock
- * @flags: 
- *
- */
-
-static void
-meta_go_inval(struct gfs_glock *gl, int flags)
-{
-	if (!(flags & DIO_METADATA))
-		return;
-
-	gfs_inval_buf(gl);
-	gl->gl_vn++;
-}
-
-/**
- * meta_go_demote_ok - Check to see if it's ok to unlock a meta glock
- * @gl: the glock
- *
- * Returns: TRUE if we have no cached data; ok to demote meta glock
- *
- * Called when trying to dump (reclaim) a glock from the glock cache, after
- *   determining that there is currently no holder on this node for this glock,
- *   and before placing LM_ST_UNLOCKED request on glock's wait-for-demote queue.
- * Note that callbacks from other nodes that need a lock do *not*
- *   seek permission from this function before requesting a demote.
- *   Nor do glocks obtained with the following flags (see demote_ok()):
- *   --  GL_NOCACHE:  gets unlocked (and not cached) immediately after use
- *   --  GLF_STICKY:  equivalent to always getting "FALSE" from this function
- *   --  GLF_PREFETCH:  uses its own timeout
- *
- * For glocks that protect on-disk data (meta, inode, and rgrp glocks), disk
- *   accesses are slow, while lock manipulation is usually fast.  Releasing
- *   a lock means that we:
- *   --  Must sync memory-cached write data to disk immediately, before another
- *       node can be granted the lock (at which point that node must read the
- *       data from disk).
- *   --  Must invalidate memory-cached data that we had read from or written
- *       to disk.  Another node can change it if we don't have a lock, so it's
- *       now useless to us.
- *
- * Then, if we re-acquire the lock again in the future, we:
- *   --  Must (re-)read (perhaps unchanged) data from disk into memory.
- *
- * All of these are painful, so it pays to retain a glock in our glock cache
- *   as long as we have cached data (even though we have no active holders
- *   for this lock on this node currently), unless/until another node needs
- *   to change it.  This allows Linux block I/O to sync write data to disk in
- *   a "lazy" way, rather than forcing an immediate sync (and resultant WAIT),
- *   and retains current data in memory as long as possible.
- *
- * This also helps GFS respond to memory pressure.  There is no mechanism for
- *   the Linux virtual memory manager to directly call into GFS to ask it to
- *   drop locks.  So, we take a hint from what the VM does to the page cache.
- *   When that cache is trimmed (and we see no more pages relating to this
- *   glock), we trim the glock cache as well, by releasing this lock.
- */
-
-static int
-meta_go_demote_ok(struct gfs_glock *gl)
-{
-	return (gl->gl_aspace->i_mapping->nrpages) ? FALSE : TRUE;
-}
-
-/**
- * inode_go_xmote_th - promote/demote (but don't unlock) an inode glock
- * @gl: the glock
- * @state: the requested state
- * @flags: the flags passed into gfs_glock()
- *
- * Acquire a new glock, or change an already-acquired glock to
- *   more/less restrictive state (other than LM_ST_UNLOCKED).
- */
-
-static void
-inode_go_xmote_th(struct gfs_glock *gl, unsigned int state, int flags)
-{
-	if (gl->gl_state != LM_ST_UNLOCKED)
-		gfs_inval_pte(gl);
-	gfs_glock_xmote_th(gl, state, flags);
-}
-
-/**
- * inode_go_xmote_bh - After promoting/demoting (but not unlocking)
- *      an inode glock
- * @gl: the glock
- *
- * FIXME: This will be really broken when (no_formal_ino != no_addr)
- *        and gl_name.ln_number no longer refers to the dinode block #.
- *
- * If we've just acquired the inter-node lock for an inode,
- *   read the dinode block from disk (but don't wait for I/O completion).
- * Exceptions (don't read if):
- *    Glock state is UNLOCKED.
- *    Glock's requesting holder's GL_SKIP flag is set.
- */
-
-static void
-inode_go_xmote_bh(struct gfs_glock *gl)
-{
-	struct gfs_holder *gh = gl->gl_req_gh;
-	struct buffer_head *bh;
-	int error;
-
-	if (gl->gl_state != LM_ST_UNLOCKED &&
-	    (!gh || !(gh->gh_flags & GL_SKIP))) {
-		error = gfs_dread(gl, gl->gl_name.ln_number, DIO_START, &bh);
-		if (!error)
-			brelse(bh);
-	}
-}
-
-/**
- * inode_go_drop_th - unlock an inode glock
- * @gl: the glock
- *
- * Invoked from rq_demote().
- * Another node needs the lock in EXCLUSIVE mode, or lock (unused for too long)
- *   is being purged from our node's glock cache; we're dropping lock.
- */
-
-static void
-inode_go_drop_th(struct gfs_glock *gl)
-{
-	gfs_inval_pte(gl);
-	gfs_glock_drop_th(gl);
-}
-
-/**
- * inode_go_sync - Sync the dirty data and/or metadata for an inode glock
- * @gl: the glock protecting the inode
- * @flags: DIO_METADATA -- sync inode's metadata
- *         DIO_DATA     -- sync inode's data
- *         DIO_INVISIBLE --  don't clear glock's DIRTY flag when done
- *
- * If DIO_INVISIBLE:
- *   1) Called from gfs_glock_dq(), when releasing the last holder for an EX
- *   glock (but glock is still in our glock cache in EX state, and might
- *   stay there for a few minutes).  Holder had GL_SYNC flag set, asking
- *   for early sync (i.e. now, instead of later when we release the EX at
- *   inter-node scope).  GL_SYNC is currently used only for inodes in
- *   special cases, so inode is the only type of glock for which
- *   DIO_INVISIBLE would apply.
- *   2) Called from depend_sync_one() to sync deallocated inode metadata
- *   before it can be reallocated by another process or machine.  Since
- *   this call can happen at any time during the lifetime of the
- *   glock, don't clear the sync bit (more data might be dirtied
- *   momentarily).
- * Else (later):
- *   Called when demoting (gfs_glock_xmote_th()) or unlocking
- *   (gfs_glock_drop_th() an EX glock at inter-node scope.  We must flush
- *   to disk all dirty buffers/pages relating to this glock, and must not
- *   return to caller to demote/unlock the glock until I/O is complete.
- *
- * Syncs go in following order:
- *   Start data page writes
- *   Sync metadata to log (wait to complete I/O)
- *   Sync metadata to in-place location (wait to complete I/O)
- *   Wait for data page I/O to complete
- * 
- */
-
-static void
-inode_go_sync(struct gfs_glock *gl, int flags)
-{
-	int meta = (flags & DIO_METADATA);
-	int data = (flags & DIO_DATA);
-
-	if (test_bit(GLF_DIRTY, &gl->gl_flags)) {
-		if (meta && data) {
-			gfs_sync_page(gl, flags | DIO_START);
-			gfs_log_flush_glock(gl);
-			gfs_sync_buf(gl, flags | DIO_START | DIO_WAIT | DIO_CHECK);
-			gfs_sync_page(gl, flags | DIO_WAIT | DIO_CHECK);
-		} else if (meta) {
-			gfs_log_flush_glock(gl);
-			gfs_sync_buf(gl, flags | DIO_START | DIO_WAIT | DIO_CHECK);
-		} else if (data)
-			gfs_sync_page(gl, flags | DIO_START | DIO_WAIT | DIO_CHECK);
-	}
-
-	/* If we've synced everything, clear the SYNC request.
-	   If we're doing the final (not early) sync, clear DIRTY */
-	if (meta && data) {
-		if (!(flags & DIO_INVISIBLE))
-			clear_bit(GLF_DIRTY, &gl->gl_flags);
-		clear_bit(GLF_SYNC, &gl->gl_flags);
-	}
-}
-
-/**
- * inode_go_inval - prepare a inode glock to be released
- * @gl: the glock
- * @flags: 
- *
- */
-
-static void
-inode_go_inval(struct gfs_glock *gl, int flags)
-{
-	int meta = (flags & DIO_METADATA);
-	int data = (flags & DIO_DATA);
-
-	if (meta) {
-		gfs_inval_buf(gl);
-		gl->gl_vn++;
-	}
-	if (data)
-		gfs_inval_page(gl);
-}
-
-/**
- * inode_go_demote_ok - Check to see if it's ok to unlock an inode glock
- * @gl: the glock
- *
- * See comments for meta_go_demote_ok().
- *
- * While other glock types (meta, rgrp) that protect disk data can be retained
- *   indefinitely, GFS imposes a timeout (overridden when using no_lock lock
- *   module) for inode glocks, even if there is still data in page cache for
- *   this inode.
- *
- * Returns: TRUE if it's ok
- */
-
-static int
-inode_go_demote_ok(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	int demote = FALSE;
-
-	if (!get_gl2ip(gl) && !gl->gl_aspace->i_mapping->nrpages)
-		demote = TRUE;
-	else if (!sdp->sd_args.ar_localcaching &&
-		 time_after_eq(jiffies, gl->gl_stamp + gfs_tune_get(sdp, gt_demote_secs) * HZ))
-		demote = TRUE;
-
-	return demote;
-}
-
-/**
- * inode_go_lock - operation done after an inode lock is locked by
- *      a first holder on this node
- * @gl: the glock
- * @flags: the flags passed into gfs_glock()
- *
- * Returns: errno
- */
-
-static int
-inode_go_lock(struct gfs_glock *gl, int flags)
-{
-	struct gfs_inode *ip = get_gl2ip(gl);
-	int error = 0;
-
-	if (ip && ip->i_vn != gl->gl_vn) {
-		error = gfs_copyin_dinode(ip);
-		if (!error)
-			gfs_inode_attr_in(ip);
-	}
-
-	return error;
-}
-
-/**
- * inode_go_unlock - operation done when an inode lock is unlocked by
- *     a last holder on this node
- * @gl: the glock
- * @flags: the flags passed into gfs_gunlock()
- *
- */
-
-static void
-inode_go_unlock(struct gfs_glock *gl, int flags)
-{
-	struct gfs_inode *ip = get_gl2ip(gl);
-
-	if (ip && test_bit(GLF_DIRTY, &gl->gl_flags))
-		gfs_inode_attr_in(ip);
-
-	if (ip)
-		gfs_flush_meta_cache(ip);
-}
-
-/**
- * inode_greedy -
- * @gl: the glock
- *
- */
-
-static void
-inode_greedy(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_inode *ip = get_gl2ip(gl);
-	unsigned int quantum = gfs_tune_get(sdp, gt_greedy_quantum);
-	unsigned int max = gfs_tune_get(sdp, gt_greedy_max);
-	unsigned int new_time;
-
-	spin_lock(&ip->i_spin);
-
-	if (time_after(ip->i_last_pfault + quantum, jiffies)) {
-		new_time = ip->i_greedy + quantum;
-		if (new_time > max)
-			new_time = max;
-	} else {
-		new_time = ip->i_greedy - quantum;
-		if (!new_time || new_time > max)
-			new_time = 1;
-	}
-
-	ip->i_greedy = new_time;
-
-	spin_unlock(&ip->i_spin);
-
-	gfs_inode_put(ip);
-}
-
-/**
- * rgrp_go_xmote_th - promote/demote (but don't unlock) a resource group glock
- * @gl: the glock
- * @state: the requested state
- * @flags: the flags passed into gfs_glock()
- *
- * Acquire a new glock, or change an already-acquired glock to
- *   more/less restrictive state (other than LM_ST_UNLOCKED).
- *
- * We're going to lock the lock in SHARED or EXCLUSIVE state, or
- *   demote it from EXCLUSIVE to SHARED (because another node needs it SHARED).
- * When locking, gfs_mhc_zap() and gfs_depend_sync() are basically no-ops;
- *   meta-header cache and dependency lists should be empty.
- *
- */
-
-static void
-rgrp_go_xmote_th(struct gfs_glock *gl, unsigned int state, int flags)
-{
-	struct gfs_rgrpd *rgd = get_gl2rgd(gl);
-
-	gfs_mhc_zap(rgd);
-	gfs_depend_sync(rgd);
-	gfs_glock_xmote_th(gl, state, flags);
-}
-
-/**
- * rgrp_go_drop_th - unlock a resource group glock
- * @gl: the glock
- *
- * Invoked from rq_demote().
- * Another node needs the lock in EXCLUSIVE mode, or lock (unused for too long)
- *   is being purged from our node's glock cache; we're dropping lock.
- */
-
-static void
-rgrp_go_drop_th(struct gfs_glock *gl)
-{
-	struct gfs_rgrpd *rgd = get_gl2rgd(gl);
-
-	gfs_mhc_zap(rgd);
-	gfs_depend_sync(rgd);
-	gfs_glock_drop_th(gl);
-}
-
-/**
- * rgrp_go_demote_ok - Check to see if it's ok to unlock a RG's glock
- * @gl: the glock
- *
- * See comments for meta_go_demote_ok().
- *
- * In addition to Linux page cache, we also check GFS meta-header-cache.
- *
- * Returns: TRUE if it's ok
- */
-
-static int
-rgrp_go_demote_ok(struct gfs_glock *gl)
-{
-	struct gfs_rgrpd *rgd = get_gl2rgd(gl);
-	int demote = TRUE;
-
-	if (gl->gl_aspace->i_mapping->nrpages)
-		demote = FALSE;
-	else if (rgd && !list_empty(&rgd->rd_mhc)) /* Don't bother with lock here */
-		demote = FALSE;
-
-	return demote;
-}
-
-/**
- * rgrp_go_lock - operation done after an rgrp lock is locked by
- *    a first holder on this node.
- * @gl: the glock
- * @flags: the flags passed into gfs_glock()
- *
- * Returns: errno
- *
- * Read rgrp's header and block allocation bitmaps from disk.
- */
-
-static int
-rgrp_go_lock(struct gfs_glock *gl, int flags)
-{
-	if (flags & GL_SKIP)
-		return 0;
-	return gfs_rgrp_read(get_gl2rgd(gl));
-}
-
-/**
- * rgrp_go_unlock - operation done when an rgrp lock is unlocked by
- *    a last holder on this node.
- * @gl: the glock
- * @flags: the flags passed into gfs_gunlock()
- *
- * Release rgrp's bitmap buffers (read in when lock was first obtained).
- * Make sure rgrp's glock's Lock Value Block has up-to-date block usage stats,
- *   so other nodes can see them.
- */
-
-static void
-rgrp_go_unlock(struct gfs_glock *gl, int flags)
-{
-	struct gfs_rgrpd *rgd = get_gl2rgd(gl);
-	if (flags & GL_SKIP)
-		return;
-	gfs_rgrp_relse(rgd);
-	if (test_bit(GLF_DIRTY, &gl->gl_flags))
-		gfs_rgrp_lvb_fill(rgd);
-}
-
-/**
- * trans_go_xmote_th - promote/demote (but don't unlock) the transaction glock
- * @gl: the glock
- * @state: the requested state
- * @flags: the flags passed into gfs_glock()
- *
- * Acquire a new glock, or change an already-acquired glock to
- *   more/less restrictive state (other than LM_ST_UNLOCKED).
- */
-
-static void
-trans_go_xmote_th(struct gfs_glock *gl, unsigned int state, int flags)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-
-	if (gl->gl_state != LM_ST_UNLOCKED &&
-	    test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
-		gfs_sync_meta(sdp);
-		gfs_log_shutdown(sdp);
-	}
-
-	gfs_glock_xmote_th(gl, state, flags);
-}
-
-/**
- * trans_go_xmote_bh - After promoting/demoting (but not unlocking)
- *       the transaction glock
- * @gl: the glock
- *
- */
-
-static void
-trans_go_xmote_bh(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_glock *j_gl = sdp->sd_journal_gh.gh_gl;
-	struct gfs_log_header head;
-	int error;
-
-	if (gl->gl_state != LM_ST_UNLOCKED &&
-	    test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
-		j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA);
-
-		error = gfs_find_jhead(sdp, &sdp->sd_jdesc, j_gl, &head);
-		if (error)
-			gfs_consist(sdp);
-		if (!(head.lh_flags & GFS_LOG_HEAD_UNMOUNT))
-			gfs_consist(sdp);
-
-		/*  Initialize some head of the log stuff  */
-		if (!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) {
-			sdp->sd_sequence = head.lh_sequence;
-			sdp->sd_log_head = head.lh_first + 1;
-		}
-	}
-}
-
-/**
- * trans_go_drop_th - unlock the transaction glock
- * @gl: the glock
- *
- * Invoked from rq_demote().
- * Another node needs the lock in EXCLUSIVE mode to quiesce the filesystem
- *   (for journal replay, etc.).
- *
- * We want to sync the device even with localcaching.  Remember
- * that localcaching journal replay only marks buffers dirty.
- */
-
-static void
-trans_go_drop_th(struct gfs_glock *gl)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-
-	if (test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
-		gfs_sync_meta(sdp);
-		gfs_log_shutdown(sdp);
-	}
-
-	gfs_glock_drop_th(gl);
-}
-
-/**
- * nondisk_go_demote_ok - Check to see if it's ok to unlock a non-disk glock
- * @gl: the glock
- *
- * See comments for meta_go_demote_ok().
- *
- * We never give up a non-disk glock (unless another node needs it).
- * Non-disk type used for GFS_MOUNT_LOCK, GFS_LIVE_LOCK, GFS_RENAME_LOCK.
- * GFS_MOUNT_LOCK is always requested GL_NOCACHE, however, so it never uses
- *   this function.
- *
- * Returns: TRUE if it's ok
- */
-
-static int
-nondisk_go_demote_ok(struct gfs_glock *gl)
-{
-	return FALSE;
-}
-
-/**
- * quota_go_demote_ok - Check to see if it's ok to unlock a quota glock
- * @gl: the glock
- *
- * See comments for meta_go_demote_ok().
- *
- * Returns: TRUE if it's ok
- */
-
-static int
-quota_go_demote_ok(struct gfs_glock *gl)
-{
-	return !atomic_read(&gl->gl_lvb_count);
-}
-
-struct gfs_glock_operations gfs_meta_glops = {
-      .go_xmote_th = gfs_glock_xmote_th,
-      .go_drop_th = gfs_glock_drop_th,
-      .go_sync = meta_go_sync,
-      .go_inval = meta_go_inval,
-      .go_demote_ok = meta_go_demote_ok,
-      .go_type = LM_TYPE_META
-};
-
-struct gfs_glock_operations gfs_inode_glops = {
-      .go_xmote_th = inode_go_xmote_th,
-      .go_xmote_bh = inode_go_xmote_bh,
-      .go_drop_th = inode_go_drop_th,
-      .go_sync = inode_go_sync,
-      .go_inval = inode_go_inval,
-      .go_demote_ok = inode_go_demote_ok,
-      .go_lock = inode_go_lock,
-      .go_unlock = inode_go_unlock,
-      .go_greedy = inode_greedy,
-      .go_type = LM_TYPE_INODE
-};
-
-struct gfs_glock_operations gfs_rgrp_glops = {
-      .go_xmote_th = rgrp_go_xmote_th,
-      .go_drop_th = rgrp_go_drop_th,
-      .go_sync = meta_go_sync,
-      .go_inval = meta_go_inval,
-      .go_demote_ok = rgrp_go_demote_ok,
-      .go_lock = rgrp_go_lock,
-      .go_unlock = rgrp_go_unlock,
-      .go_type = LM_TYPE_RGRP
-};
-
-struct gfs_glock_operations gfs_trans_glops = {
-      .go_xmote_th = trans_go_xmote_th,
-      .go_xmote_bh = trans_go_xmote_bh,
-      .go_drop_th = trans_go_drop_th,
-      .go_type = LM_TYPE_NONDISK
-};
-
-struct gfs_glock_operations gfs_iopen_glops = {
-      .go_xmote_th = gfs_glock_xmote_th,
-      .go_drop_th = gfs_glock_drop_th,
-      .go_callback = gfs_iopen_go_callback,
-      .go_type = LM_TYPE_IOPEN
-};
-
-struct gfs_glock_operations gfs_flock_glops = {
-      .go_xmote_th = gfs_glock_xmote_th,
-      .go_drop_th = gfs_glock_drop_th,
-      .go_type = LM_TYPE_FLOCK
-};
-
-struct gfs_glock_operations gfs_nondisk_glops = {
-      .go_xmote_th = gfs_glock_xmote_th,
-      .go_drop_th = gfs_glock_drop_th,
-      .go_demote_ok = nondisk_go_demote_ok,
-      .go_type = LM_TYPE_NONDISK
-};
-
-struct gfs_glock_operations gfs_quota_glops = {
-      .go_xmote_th = gfs_glock_xmote_th,
-      .go_drop_th = gfs_glock_drop_th,
-      .go_demote_ok = quota_go_demote_ok,
-      .go_type = LM_TYPE_QUOTA
-};
diff --git a/gfs-kernel/src/gfs/glops.h b/gfs-kernel/src/gfs/glops.h
deleted file mode 100644
index 4d897c8..0000000
--- a/gfs-kernel/src/gfs/glops.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __GLOPS_DOT_H__
-#define __GLOPS_DOT_H__
-
-extern struct gfs_glock_operations gfs_meta_glops;
-extern struct gfs_glock_operations gfs_inode_glops;
-extern struct gfs_glock_operations gfs_rgrp_glops;
-extern struct gfs_glock_operations gfs_trans_glops;
-extern struct gfs_glock_operations gfs_iopen_glops;
-extern struct gfs_glock_operations gfs_flock_glops;
-extern struct gfs_glock_operations gfs_nondisk_glops;
-extern struct gfs_glock_operations gfs_quota_glops;
-
-#endif /* __GLOPS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/incore.h b/gfs-kernel/src/gfs/incore.h
deleted file mode 100644
index 921b79d..0000000
--- a/gfs-kernel/src/gfs/incore.h
+++ /dev/null
@@ -1,1218 +0,0 @@
-/*
- *  In-core (memory/RAM) structures.
- *  These do not appear on-disk.  See gfs_ondisk.h for on-disk structures.
- */
-
-#ifndef __INCORE_DOT_H__
-#define __INCORE_DOT_H__
-
-/*  flags used in function call parameters  */
-
-#define DIO_NEW           (0x00000001)  /* Newly allocated metadata */
-#define DIO_FORCE         (0x00000002)  /* Force read of block from disk */
-#define DIO_CLEAN         (0x00000004)  /* Don't write to disk */
-#define DIO_DIRTY         (0x00000008)  /* Data changed, must write to disk */
-#define DIO_START         (0x00000010)  /* Start disk read or write */
-#define DIO_WAIT          (0x00000020)  /* Wait for disk r/w to complete */
-
-#define DIO_METADATA      (0x00000040)  /* Process glock's protected metadata */
-#define DIO_DATA          (0x00000080)  /* Process glock's protected filedata */
-#define DIO_INVISIBLE     (0x00000100)  /* Don't monkey with glock's dirty bit */
-#define DIO_CHECK         (0x00000200)  /* Make sure all metadata has been synced */
-#define DIO_ALL           (0x00000400)  /* Flush all AIL transactions to disk */
-
-/*  Structure prototypes  */
-
-struct gfs_log_operations;
-struct gfs_log_element;
-struct gfs_meta_header_cache;
-struct gfs_depend;
-struct gfs_bitmap;
-struct gfs_rgrpd;
-struct gfs_bufdata;
-struct gfs_glock_operations;
-struct gfs_holder;
-struct gfs_glock;
-struct gfs_alloc;
-struct gfs_inode;
-struct gfs_file;
-struct gfs_unlinked;
-struct gfs_quota_le;
-struct gfs_quota_data;
-struct gfs_log_buf;
-struct gfs_trans;
-struct gfs_gl_hash_bucket;
-struct gfs_sbd;
-
-typedef void (*gfs_glop_bh_t) (struct gfs_glock * gl, unsigned int ret);
-
-/*
- *  Structure of operations that are associated with each
- *  type of element in the log.
- */
-struct gfs_log_operations {
-	/*
-	 * Operations specific to a given log element (LE).
-	 * These are typically executed individually via macros such as LO_ADD.
-	 */
-
-	/* Add new LE to transaction */
-	void (*lo_add) (struct gfs_sbd * sdp, struct gfs_log_element * le);
-
-	/* Do any cleanup, etc., needed just before commit to incore log */
-	void (*lo_trans_end) (struct gfs_sbd * sdp,
-			      struct gfs_log_element * le);
-
-	/* Print LE-specific info via printk() */
-	void (*lo_print) (struct gfs_sbd * sdp, struct gfs_log_element * le,
-			  unsigned int where);
-
-	/* Find any incore transactions that overlap through this LE (e.g.
-	 * share glocks), to determine if any transactions can be combined. */
-	struct gfs_trans *(*lo_overlap_trans) (struct gfs_sbd * sdp,
-					       struct gfs_log_element * le);
-
-	/* Change LE from "new" to "incore" status, before write to log */
-	void (*lo_incore_commit) (struct gfs_sbd * sdp, struct gfs_trans * tr,
-				  struct gfs_log_element * le);
-
-	/* Allow writes to in-place locations, after log is on-disk */
-	void (*lo_add_to_ail) (struct gfs_sbd * sdp,
-			       struct gfs_log_element * le);
-
-	/* Clean up LE after log dump */
-	void (*lo_clean_dump) (struct gfs_sbd * sdp,
-			       struct gfs_log_element * le);
-
-	/*
-	 * Operations specific to a class of log elements.
-	 * These are typically executed over a whole transaction by
-	 * macros such as LO_TRANS_SIZE.  Each LE-type-specific operation
-	 * for each LE contributes its part to the overall result.
-	 */
-
-	/* Determine LE-type-specific quantities of blocks of various types
-	 * required for writing the log */
-	void (*lo_trans_size) (struct gfs_sbd * sdp, struct gfs_trans * tr,
-			       unsigned int *mblks, unsigned int *eblks,
-			       unsigned int *blocks, unsigned int *bmem);
-
-	/* Combine LE-type-specific values in new_tr and tr, result is in tr */
-	void (*lo_trans_combine) (struct gfs_sbd * sdp, struct gfs_trans * tr,
-				  struct gfs_trans * new_tr);
-
-	/* Create control and metadata buffers that will make up the log */
-	void (*lo_build_bhlist) (struct gfs_sbd * sdp, struct gfs_trans * tr);
-
-	/* Calculate log space needed for this LE in a log dump */
-	void (*lo_dump_size) (struct gfs_sbd * sdp, unsigned int *elements,
-			      unsigned int *blocks, unsigned int *bmem);
-
-	/* Add LE to log dump */
-	void (*lo_build_dump) (struct gfs_sbd * sdp, struct gfs_trans * tr);
-
-	/*
-	 * Operations that happen at recovery time
-	 */
-
-	/* Reset/init whatever before doing recovery */
-	void (*lo_before_scan) (struct gfs_sbd * sdp, unsigned int jid,
-				struct gfs_log_header * head,
-				unsigned int pass);
-
-	/* LE-specific recovery procedure */
-	int (*lo_scan_elements) (struct gfs_sbd * sdp,
-				 struct gfs_jindex * jdesc,
-				 struct gfs_glock * gl, uint64_t start,
-				 struct gfs_log_descriptor * desc,
-				 unsigned int pass);
-
-	/* Verify and report recovery results/statistics */
-	void (*lo_after_scan) (struct gfs_sbd * sdp, unsigned int jid,
-			       unsigned int pass);
-
-
-	/* 
-	 * Type of element (glock/buf/unlinked/quota)
-	 */
-	char *lo_name;
-};
-
-/*
- *  Structure that gets added to struct gfs_trans->tr_elements.  They
- *  make up the "stuff" in each transaction.
- */
-struct gfs_log_element {
-	struct gfs_log_operations *le_ops; /* Vector of functions */
-
-	struct gfs_trans *le_trans;     /* We're part of this transaction */
-	struct list_head le_list;       /* Link to transaction's element list */
-};
-
-/*
- * Meta-header cache structure.
- * One for each metadata block that we've de-allocated.
- * Used to temporarily store gfs_meta_header structs for meta blocks that
- *   have been freshly turned into FREEMETA (alloc'd or de-alloc'd).  Storing
- *   these (small) structures in-core allows us to release the (large) buffers,
- *   and not need to re-read the header from disk if/when we re-allocate the
- *   blocks to USEDMETA, as long as this node holds the EXCLUSIVE lock for the
- *   resource group containing the blocks.  If we release the EX lock, we must
- *   throw away the rgrp's cached meta headers, since another node could change
- *   the blocks' contents.
- * In-core superblock structure hosts the hashed cache, as well as a
- *   linear list of all cached, in most-recently-added order.
- * Also, each resource group keeps a list of cached blocks within its scope.
- */
-struct gfs_meta_header_cache {
-	/* Links to various lists */
-	struct list_head mc_list_hash;   /* Superblock's hashed list */
-	struct list_head mc_list_single; /* Superblock's list, MRU order */
-	struct list_head mc_list_rgd;    /* Resource group's list */
-
-	uint64_t mc_block;               /* Block # (in-place address) */
-	struct gfs_meta_header mc_mh;    /* Payload: the block's meta-header */
-};
-
-/*
- * Dependency cache structure.
- * In-core superblock structure hosts the actual cache.
- * Also, each resource group keeps a list of dependency blocks within its scope.
- */
-struct gfs_depend {
-	/* Links to various lists */
-	struct list_head gd_list_hash;  /* Superblock's hashed list */
-	struct list_head gd_list_rgd;   /* Resource group's list */
-
-	struct gfs_rgrpd *gd_rgd;       /* Resource group descriptor */
-	uint64_t gd_formal_ino;         /* Inode ID */
-	unsigned long gd_time;          /* Time (jiffies) when put on list */
-};
-
-/*
- *  Block allocation bitmap descriptor structure.
- *  One of these for each FS block that contains bitmap data
- *    (i.e. the resource group header blocks and their following bitmap blocks).
- *  Each allocatable FS data block is represented by 2 bits (4 alloc states).
- */
-struct gfs_bitmap {
-	uint32_t bi_offset;  /* Byte offset of bitmap within this bit block
-	                        (non-zero only for an rgrp header block) */
-	uint32_t bi_start;   /* Data block (rgrp scope, 32-bit) represented
-	                        by the first bit-pair in this bit block */
-	uint32_t bi_len;     /* The number of bitmap bytes in this bit block */
-};
-
-/*
- *  Resource Group (Rgrp) descriptor structure.
- *  There is one of these for each resource (block) group in the FS.
- *  The filesystem is divided into a number of resource groups to allow
- *    simultaneous block alloc operations by a number of nodes.
- */
-struct gfs_rgrpd {
-	/* Links to superblock lists */
-	struct list_head rd_list;       /* On-disk-order list of all rgrps */
-	struct list_head rd_list_mru;   /* Most Recently Used list of all rgs */
-	struct list_head rd_recent;     /* recently used rgrps */
-	uint32_t rd_try_counter;        /* # of times we fail a try lock */
-
-	struct gfs_glock *rd_gl;        /* Glock for this rgrp */
-
-	struct gfs_rindex rd_ri;        /* Resource Index (on-disk) structure */
-	struct gfs_rgrp rd_rg;          /* Resource Group (on-disk) structure */
-	uint64_t rd_rg_vn;              /* Version #: if != glock's gl_vn,
-	                                   we need to read rgrp fm disk */
-
-	/* Block alloc bitmap cache */
-	struct gfs_bitmap *rd_bits;     /* Array of block bitmap descriptors */
-	struct buffer_head **rd_bh;     /* Array of ptrs to block bitmap bh's */
-
-	/* Block allocation strategy, rgrp scope. Start at these blocks when
-	   searching for next data/meta block to alloc */
-	uint32_t rd_last_alloc_data;    /* Most recent data block allocated */
-	uint32_t rd_last_alloc_meta;    /* Most recent meta block allocated */
-
-	struct list_head rd_mhc;        /* Cached meta-headers for this rgrp */
-	struct list_head rd_depend;     /* Dependent inodes (MRU order) */
-
-	struct gfs_sbd *rd_sbd;		/* FS incore superblock (fs instance) */
-};
-
-/*
- *  Per-buffer data
- *  One of these is attached as GFS private data to each FS block's buffer_head.
- *  These keep track of a buffer's progress through the transaction pipeline,
- *    using the "new" embedded log element to attach it to a being-built
- *    transaction, and moving the attachment point to the "incore" LE once
- *    the transaction completes (at which time the buffer becomes a candidate
- *    to be written to the on-disk log).
- *  A buffer may be attached simultaneously to a new and an incore transaction,
- *    but no more than one of each:  Only one new trans may be built at a time
- *    for a given buffer, obviously, since the buffer's contents are protected
- *    by an EXclusive glock when writing.  And, when a transaction is completely
- *    built, GFS combines incore transactions that share glocks (see
- *    incore_commit()), i.e. the glock that protects the buffer, so a buffer
- *    never needs to be attached to more than one (combined) incore trans.
- *  Note that multiple transactions can modify the buffer since its most
- *    recent writes to disk.  This principle applies to both in-place and
- *    journal block locations on-disk, allowing this node to keep modifying the
- *    cached data without writing it to disk, unless/until another node needs
- *    to access the data, or the Linux OS tells us to sync to disk.
- *  If a transaction follows another transaction before the first transaction's
- *    log completes (indicated by the in-place buffer head still being pinned
- *    in RAM), GFS copies the first transaction's results to a "frozen"
- *    image of the buffer, so the first transaction results (an atomic
- *    snapshot) can be logged properly, while the second transaction is
- *    modifying the "real" buffer.  This frozen copy lives only until the new
- *    transaction is complete, at which point one of two things has occurred:
- *    1).  Buffer was logged successfully; frozen copy's job is done.
- *    2).  Buffer was not yet logged; frozen copy no longer needed, newer
- *         buffer becomes the log candidate.
- *
- *  gfs_bufdata structs also link into the Active Items Lists (AIL) (buffers
- *    flushed to on-disk log, but not yet flushed to on-disk in-place locations)
- *    attached to:
- *    1).  The latest transaction to modify and log (on-disk) the buffer, and
- *    2).  The glock that protects the buffer's contents.
- *  The buffer is attached to only the most recent transaction's AIL
- *    list for a couple of reasons.  One is that only the most up-to-date
- *    buffer content needs to be written to the in-place block on-disk.  The
- *    other is that since there is a more recent copy of the block in
- *    the log, we don't need to keep the older copies in the log.  We can
- *    remove them from the AIL and let the log space be reused for new
- *    transactions (GFS advances the log tail when removing buffers from AIL).
- */
-struct gfs_bufdata {
-	struct buffer_head *bd_bh;  /* We belong to this Linux buffer_head */
-	struct gfs_glock *bd_gl;    /* This glock protects buffer's payload */
-
-	/* Log elements map us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element bd_new_le;     /* New, incomplete transaction */
-	struct gfs_log_element bd_incore_le;  /* Complete (committed) trans */
-
-	char *bd_frozen;            /* "Frozen" copy of buffer's data */
-	struct semaphore bd_lock;   /* Protects access to this structure */
-
-	/* "Pin" means keep buffer in RAM, don't write to disk (yet) */
-	unsigned int bd_pinned;	         /* Recursive pin count */
-
-	/* Links to Active Items Lists */
-	struct list_head bd_ail_tr_list; /* This buf's most recent trans' AIL */
-	struct list_head bd_ail_gl_list; /* This buf's glock's AIL */
-};
-
-/*
- *  Glock operations
- *  One set of operations for each glock, the set selected by type of glock.
- *  These functions get called at various points in a glock's lifetime.
- *  "xmote" = promote or demote (change lock state) a glock at inter-node scope.
- *  "th" = top half, "bh" = bottom half
- *  Some operations/fields are required (GFS assumes they are there):
- *     go_xmote_th
- *     go_drop_th
- *     go_type
- *  Other operations are optional (GFS checks for presence before calling).
- */
-struct gfs_glock_operations {
-
-	/* Acquire lock or change lock state at inter-node scope:
-	     Does type-specific preparation (if any)
-	     Uses gfs_glock_xmote_th to call lock module. */
-	void (*go_xmote_th) (struct gfs_glock * gl, unsigned int state,
-			     int flags);
-
-	/* After acquiring or changing a lock at inter-node scope */
-	void (*go_xmote_bh) (struct gfs_glock * gl);
-
-	/* Release (unlock) a lock at inter-node scope:
-	     Does type-specific preparation (if any)
-	     Uses gfs_glock_drop_th to call lock module. */
-	void (*go_drop_th) (struct gfs_glock * gl);
-
-	/* After releasing a lock at inter-node scope */
-	void (*go_drop_bh) (struct gfs_glock * gl);
-
-	/* Sync dirty data to disk (e.g. before demoting an EX inter-node lock)
-	   (another node needs to read the updated data from disk) */
-	void (*go_sync) (struct gfs_glock * gl, int flags);
-
-	/* Invalidate local cached data just after releasing an inter-node lock
-	   (another node may change the on-disk data, so it's no good to us) */
-	void (*go_inval) (struct gfs_glock * gl, int flags);
-
-	/* Lock-type-specific check to see if it's okay to unlock a glock
-	   at inter-node scope (and remove it from our glock cache) */
-	int (*go_demote_ok) (struct gfs_glock * gl);
-
-	/* After getting lock for first holder (within this node) */
-	int (*go_lock) (struct gfs_glock * gl, int flags);
-
-	/* After last holder (within this node) gives up lock (glock may
-	   remain in glock cache, though) */
-	void (*go_unlock) (struct gfs_glock * gl, int flags);
-
-	/* After receiving a callback: another node needs the lock */
-	void (*go_callback) (struct gfs_glock * gl, unsigned int state);
-
-        /* Called when the glock layer marks a lock as being not greedy
-	   anymore */
-	void (*go_greedy) (struct gfs_glock * gl);
-
-	/* Lock type: locks with same lock # (often an FS block #),
-	   but different types, are different locks */
-	int go_type;
-};
-
-/*
- *  Glock holder structure
- *  One for each holder of a glock.
- *  These coordinate the use, within this node, of an acquired inter-node glock.
- *  Once a node has acquired a glock, it may be shared within that node by
- *    several processes, or even by several recursive requests from the same
- *    process.  Each is a separate "holder".  Different holders may co-exist
- *    having requested different lock states, as long as the node holds the
- *    glock in a state that is compatible.  A hold requestor may select, via
- *    flags, the rules by which sharing within the node is granted:
- *      LM_FLAG_ANY:  Grant if glock state is any other than UNLOCKED.
- *      GL_EXACT:     Grant only if glock state is exactly the requested state.
- *      GL_LOCAL_EXCL:  Grant only one holder at a time within this node.
- *    With no flags, a hold will be granted to a SHARED request even if the
- *    node holds the glock in EXCLUSIVE mode.  See relaxed_state_ok().
- *  When a process needs to manipulate a lock, it requests it via one of
- *    these holder structures.  If the request cannot be satisfied immediately,
- *    the holder structure gets queued on one of these lists in gfs_glock:
- *    1) waiters1, for gaining exclusive access to the (local) glock structure.
- *    2) waiters2, for demoting a lock (unlocking a glock, or changing its state
- *       to be less restrictive) or relenquishing "greedy" status.
- *    3) waiters3, for promoting (locking a new glock, or changing a glock state
- *       to be more restrictive).
- *  When holding a lock, gfs_holder struct stays on glock's holder list.
- *  See gfs-kernel/src/harness/lm_interface.h for gh_state (LM_ST_...)
- *    and gh_flags (LM_FLAG...) fields.
- *  Also see glock.h for gh_flags field (GL_...) flags.
- */
-
-/*  Action requests  */
-#define HIF_MUTEX       (0)  /* Exclusive (local) access to glock struct */
-#define HIF_PROMOTE     (1)  /* Change lock to more restrictive state */
-#define HIF_DEMOTE      (2)  /* Change lock to less restrictive state */
-#define HIF_GREEDY      (3)  /* Wait for the glock to be unlocked */
-
-/*  States  */
-#define HIF_ALLOCED     (4)  /* Holder structure is or was in use */
-#define HIF_DEALLOC     (5)  /* Toss holder struct as soon as queued request
-                              *   is satisfied */
-#define HIF_HOLDER      (6)  /* We have been granted a hold on the lock */
-#define HIF_FIRST       (7)  /* We are first holder to get the lock */
-#define HIF_RECURSE     (8)  /* >1 hold requests on same glock by same process*/
-#define HIF_ABORTED     (9) /* Aborted before being submitted */
-
-struct gfs_holder {
-	struct list_head gh_list;      /* Link to one of glock's holder lists */
-
-	struct gfs_glock *gh_gl;       /* Glock that we're holding */
-	struct task_struct *gh_owner;  /* Linux process that is the holder */
-
-	/* request to change lock state */
-	unsigned int gh_state;         /* LM_ST_... requested lock state */
-	int gh_flags;                  /* GL_... or LM_FLAG_... req modifiers */
-
-	int gh_error;                  /* GLR_... CANCELLED/TRYFAILED/-errno */
-	unsigned long gh_iflags;       /* HIF_... holder state, see above */
-	struct completion gh_wait;     /* Wait for completion of ... */
-};
-
-/*
- *  Glock Structure
- *  One for each inter-node lock held by this node.
- *  A glock is a local representation/abstraction of an inter-node lock.
- *    Inter-node locks are managed by a "lock module" (LM) which plugs in to
- *    the lock harness / glock interface (see gfs-kernel/harness).  Different
- *    lock modules support different lock protocols (e.g. GULM, GDLM, no_lock).
- *  A glock may have one or more holders within a node.  See gfs_holder above.
- *  Glocks are managed within a hash table hosted by the in-core superblock.
- *  After all holders have released a glock, it will stay in the hash table
- *    cache for a time (depending on lock type), during which the inter-node
- *    lock will not be released unless another node needs the lock (lock
- *    manager requests this via callback to GFS through LM on this node).  This
- *    provides better performance in case this node needs the glock again soon.
- *    See comments for meta_go_demote_ok(), glops.c.
- *  Each glock has an associated vector of lock-type-specific "glops" functions
- *    which are called at important times during the life of a glock, and
- *    which define the type of lock (e.g. dinode, rgrp, non-disk, etc).
- *    See gfs_glock_operations above.
- *  A glock, at inter-node scope, is identified by the following dimensions:
- *    1)  lock number (usually a block # for on-disk protected entities,
- *           or a fixed assigned number for non-disk locks, e.g. MOUNT).
- *    2)  lock type (actually, the type of entity protected by the lock).
- *    3)  lock namespace, to support multiple GFS filesystems simultaneously.
- *           Namespace (usually cluster:filesystem) is specified when mounting.
- *           See man page for gfs_mount.
- *  Glocks require support of Lock Value Blocks (LVBs) by the inter-node lock
- *    manager.  LVBs are small (32-byte) chunks of data associated with a given
- *    lock, that can be quickly shared between cluster nodes.  Used for certain
- *    purposes such as sharing an rgroup's block usage statistics without
- *    requiring the overhead of:
- *      -- sync-to-disk by one node, then a
- *      -- read from disk by another node.
- *  
- */
-
-#define GLF_PLUG                (0)  /* Dummy */
-#define GLF_LOCK                (1)  /* Exclusive (local) access to glock
-                                      *   structure */
-#define GLF_STICKY              (2)  /* Don't release this inter-node lock
-                                      *   unless another node explicitly asks */
-#define GLF_PREFETCH            (3)  /* This lock has been (speculatively)
-                                      *   prefetched, demote if not used soon */
-#define GLF_SYNC                (4)  /* Sync lock's protected data as soon as
-                                      *   there are no more holders */
-#define GLF_DIRTY               (5)  /* There is dirty data for this lock,
-                                      *   sync before releasing inter-node */
-#define GLF_SKIP_WAITERS2       (6)  /* Make run_queue() ignore gl_waiters2
-                                      *   (demote/greedy) holders */
-#define GLF_GREEDY              (7)  /* This lock is ignoring callbacks
-                                      *   (requests from other nodes) for now */
-#define GLF_DEMOTE              (8)  /* This is used to check for unflock completion
-				      * different from HIF_DEMOTE */
-
-struct gfs_glock {
-	struct list_head gl_list;    /* Link to hb_list in one of superblock's
-	                              * sd_gl_hash glock hash table buckets */
-	unsigned long gl_flags;      /* GLF_... see above */
-	struct lm_lockname gl_name;  /* Lock number and lock type */
-	atomic_t gl_count;           /* Usage count */
-
-	spinlock_t gl_spin;          /* Protects some members of this struct */
-
-	/* Lock state reflects inter-node manager's lock state */
-	unsigned int gl_state;       /* LM_ST_... see harness/lm_interface.h */
-
-	/* Lists of gfs_holders */
-	struct list_head gl_holders;  /* all current holders of the glock */
-	struct list_head gl_waiters1; /* HIF_MUTEX */
-	struct list_head gl_waiters2; /* HIF_DEMOTE, HIF_GREEDY */
-	struct list_head gl_waiters3; /* HIF_PROMOTE */
-
-	struct gfs_glock_operations *gl_ops; /* function vector, defines type */
-
-	/* State to remember for async lock requests */
-	struct gfs_holder *gl_req_gh; /* Holder for request being serviced */
-	gfs_glop_bh_t gl_req_bh;  /* The bottom half to execute */
-
-	void *gl_lock;            /* Lock module's private lock data */
-	char *gl_lvb;             /* Lock Value Block */
-	atomic_t gl_lvb_count;    /* LVB recursive usage (hold/unhold) count */
-
-	uint64_t gl_vn;           /* Incremented when protected data changes */
-	unsigned long gl_stamp;   /* Glock cache retention timer */
-	void *gl_object;          /* The protected entity (e.g. a dinode) */
-
-	/* Incore transaction stuff */
-	/* Log elements map us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element gl_new_le;     /* New, incomplete transaction */
-	struct gfs_log_element gl_incore_le;  /* Complete (committed) trans */ 
-
-	struct gfs_gl_hash_bucket *gl_bucket; /* Our bucket in sd_gl_hash */
-	struct list_head gl_reclaim;          /* Link to sd_reclaim_list */
-
-	struct gfs_sbd *gl_sbd;               /* Superblock (FS instance) */
-
-	struct inode *gl_aspace;              /* The buffers protected by this lock */
-	struct list_head gl_ail_bufs;         /* AIL buffers protected by us */
-};
-
-/*
- *  In-Place Reservation structure
- *  Coordinates allocation of "in-place" (as opposed to journal) FS blocks,
- *     which contain persistent inode/file/directory data and metadata.
- *     These blocks are the allocatable blocks within resource groups (i.e.
- *     not including rgrp header and block alloc bitmap blocks).
- *  gfs_inplace_reserve() calculates a fulfillment plan for allocating blocks,
- *     based on block statistics in the resource group headers.
- *  Then, gfs_blkalloc() or gfs_metaalloc() walks the block alloc bitmaps
- *     to do the actual allocation.
- */
-struct gfs_alloc {
-	/* Up to 4 quotas (including an inode's user and group quotas)
-	   can track changes in block allocation */
-
-	unsigned int al_qd_num;          /* # of quotas tracking changes */
-	struct gfs_quota_data *al_qd[4]; /* Ptrs to quota structures */
-	struct gfs_holder al_qd_ghs[4];  /* Holders for quota glocks */
-
-	/* Request, filled in by the caller to gfs_inplace_reserve() */
-
-	uint32_t al_requested_di;     /* Number of dinodes to reserve */
-	uint32_t al_requested_meta;   /* Number of metadata blocks to reserve */
-	uint32_t al_requested_data;   /* Number of data blocks to reserve */
-
-	/* Fulfillment plan, filled in by gfs_inplace_reserve() */
-
-	char *al_file;                /* Debug info, .c file making request */
-	unsigned int al_line;         /* Debug info, line of code making req */
-	struct gfs_holder al_ri_gh;   /* Glock holder for resource grp index */
-	struct gfs_holder al_rgd_gh;  /* Glock holder for al_rgd rgrp */
-	struct gfs_rgrpd *al_rgd;     /* Resource group from which to alloc */
-	uint32_t al_reserved_meta;    /* Alloc up to this # meta blocks from al_rgd */
-	uint32_t al_reserved_data;    /* Alloc up to this # data blocks from al_rgd */
-
-	/* Actual alloc, filled in by gfs_blkalloc()/gfs_metaalloc(), etc. */
-
-	uint32_t al_alloced_di;       /* # dinode blocks allocated */
-	uint32_t al_alloced_meta;     /* # meta blocks allocated */
-	uint32_t al_alloced_data;     /* # data blocks allocated */
-
-	/* Dinode allocation crap */
-
-	struct gfs_unlinked *al_ul;   /* Unlinked dinode log entry */
-};
-
-/*
- *  Incore inode structure
- */
-
-#define GIF_QD_LOCKED           (0)
-#define GIF_PAGED               (1)
-#define GIF_SW_PAGED            (2)
-
-struct gfs_inode {
-	struct gfs_inum i_num;   /* Formal inode # and block address */
-
-	atomic_t i_count;        /* Usage count */
-	unsigned long i_flags;   /* GIF_...  see above */
-
-	uint64_t i_vn;           /* Version #: if different from glock's vn,
-	                            we need to read inode from disk */
-	struct gfs_dinode i_di;  /* Dinode (on-disk) structure */
-
-	struct gfs_glock *i_gl;  /* This glock protects this inode */
-	struct gfs_sbd *i_sbd;   /* Superblock (fs instance structure) */
-	struct inode *i_vnode;   /* Linux VFS inode structure */
-
-	struct gfs_holder i_iopen_gh;  /* Glock holder for Inode Open lock */
-
-	/* Block allocation strategy, inode scope */
-	struct gfs_alloc *i_alloc; /* In-place block reservation structure */
-	uint64_t i_last_rg_alloc;  /* Most recent blk alloc was fm this rgrp */
-
-	spinlock_t i_spin;
-	struct rw_semaphore i_rw_mutex;
-
-	/* Cache of most-recently used buffers in indirect addressing chain */
-	struct buffer_head *i_cache[GFS_MAX_META_HEIGHT];
-
-	unsigned int i_greedy; /* The amount of time to be greedy */
-	unsigned long i_last_pfault; /* The time of the last page fault */
-
-	struct timeval i_dir_stat_st; /* Start time of stat counter */
-	unsigned long i_dir_stats; /* stat counter for this directory */
-	struct address_space_operations gfs_file_aops;
-};
-
-/*
- *  GFS per-fd structure
- */
-
-#define GFF_DID_DIRECT_ALLOC    (0)
-
-struct gfs_file {
-	unsigned long f_flags; /* GFF_...  see above */
-
-	struct semaphore f_fl_lock; /* Lock to protect flock operations */
-	struct gfs_holder f_fl_gh; /* Holder for this f_vfile's flock */
-
-	struct gfs_inode *f_inode;        /* Incore GFS inode */
-	struct file *f_vfile;             /* Linux file struct */
-};
-
-/*
- *  Unlinked inode log entry incore structure
- */
-
-#define ULF_NEW_UL              (0)  /* Part of new (being built) trans */
-#define ULF_INCORE_UL           (1)  /* Part of incore-committed trans */
-#define ULF_IC_LIST             (2)
-#define ULF_OD_LIST             (3)
-#define ULF_LOCK                (4)  /* Protects access to this structure */
-
-struct gfs_unlinked {
-	struct list_head ul_list;    /* Link to superblock's sd_unlinked_list */
-	unsigned int ul_count;       /* Usage count */
-
-	struct gfs_inum ul_inum;     /* Formal inode #, block addr */
-	unsigned long ul_flags;      /* ULF_... */
-
-	/* Log elements map us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element ul_new_le;    /* New, not yet committed */
-	struct gfs_log_element ul_incore_le; /* Committed to incore log */
-	struct gfs_log_element ul_ondisk_le; /* Committed to ondisk log */
-};
-
-/*
- *  Quota log element
- *  One for each logged change in a block alloc value affecting a given quota.
- *  Only one of these for a given quota within a given transaction;
- *    multiple changes, within one transaction, for a given quota will be
- *    combined into one log element.
- */
-struct gfs_quota_le {
-	/* Log element maps us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element ql_le;    /* Generic log element structure */
-
-	struct gfs_quota_data *ql_data;  /* The quota we're changing */
-	struct list_head ql_data_list;   /* Link to quota's log element list */
-
-	int64_t ql_change;           /* # of blocks alloc'd (+) or freed (-) */
-};
-
-/*
- *  Quota structure
- *  One for each user or group quota.
- *  Summarizes all block allocation activity for a given quota, and supports
- *    recording updates of current block alloc values in GFS' special quota
- *    file, including the journaling of these updates, encompassing
- *    multiple transactions and log dumps.
- */
-
-#define QDF_USER                (0)   /* User (1) vs. group (0) quota */
-#define QDF_OD_LIST             (1)   /* Waiting for sync to quota file */
-#define QDF_LOCK                (2)   /* Protects access to this structure */
-
-struct gfs_quota_data {
-	struct list_head qd_list;     /* Link to superblock's sd_quota_list */
-	unsigned int qd_count;        /* Usage count */
-
-	uint32_t qd_id;               /* User or group ID number */
-	unsigned long qd_flags;       /* QDF_... */
-
-	/* This list is for non-log-dump transactions */
-	struct list_head qd_le_list;  /* List of gfs_quota_le log elements */
-
-	/* Summary of block alloc changes affecting this quota, in various
-	   stages of logging & syncing changes to the special quota file */
-	int64_t qd_change_new;  /* New, not yet committed to in-core log*/
-	int64_t qd_change_ic;   /* Committed to in-core log */
-	int64_t qd_change_od;   /* Committed to on-disk log */
-	int64_t qd_change_sync; /* Being synced to the in-place quota file */
-
-	struct gfs_quota_le qd_ondisk_ql; /* Log element for log dump */
-	uint64_t qd_sync_gen;         /* Sync-to-quota-file generation # */
-
-	/* Glock provides protection for quota, *and* provides
-	   lock value block (LVB) communication, between nodes, of current
-	   quota values.  Shared lock -> LVB read.  EX lock -> LVB write. */
-	struct gfs_glock *qd_gl;      /* glock for this quota */
-	struct gfs_quota_lvb qd_qb;   /* LVB (limit/warn/value) */
-
-	unsigned long qd_last_warn;   /* Jiffies of last warning to user */
-};
-
-/*
- * Log Buffer descriptor structure.
- * One for each block buffer recorded in the log.
- * When beginning a new transaction, GFS pre-allocates a number of these,
- *   and puts them on transaction's tr_free_bufs list.
- * Logged buffers are of two types:
- *   1).  Exact copies of buffers to be written to in-place location in FS.
- *   2).  Log-only buffers such as log headers and control blocks (e.g. tags).
- * A gfs_log_buf is required for both types; the ones for log-only buffers
- *   contain NULL in lb_unlock, and get cleaned up after the log write.
- * lb_bh is a "fake" buffer head that directs Linux block I/O to write the buf
- *   to the on-disk log location, rather than the on-disk in-place location.
- *   Used for both types.
- * lb_unlock points to the "real" buffer head that directs Linux to write the
- *   buf to its regular on-disk in-place filesystem location.  Once the commit
- *   to the on-disk log is finished, GFS unlocks the "real" buffer so it can be
- *   written to in-place block, or modified by another transaction.
- *   Used only for type 1).
- */
-struct gfs_log_buf {
-	/* Link to one of the transaction structure's lists */
-	struct list_head lb_list;      /* Link to tr_free_bufs or tr_list */
-
-	struct buffer_head lb_bh;      /* "Fake" bh; for the log block */
-	struct buffer_head *lb_unlock; /* "Real" bh; for the in-place block */
-};
-
-/*
- *  Transaction structure
- *  One for each transaction
- *  This coordinates the logging and flushing of written metadata.
- */
-
-#define TRF_LOG_DUMP            (0x00000001)
-#define TRF_DUMMY               (0x00000002)
-
-struct gfs_trans {
-
-	/* Link to various lists */
-	struct list_head tr_list;      /* Superblk's incore trans or AIL list*/
-
-	/* Initial creation stuff */
-
-	char *tr_file;                 /* Debug info: .c file creating trans */
-	unsigned int tr_line;          /* Debug info: codeline creating trans */
-
-	/* Reservations for on-disk space in journal.
-	   Meta blocks are copies of in-place filesystem blocks.  
-	   Extra blocks are log-only (log header and control blocks) */
-	unsigned int tr_mblks_asked;   /* # of meta log blocks requested */
-	unsigned int tr_eblks_asked;   /* # of extra log blocks requested */
-	unsigned int tr_seg_reserved;  /* # of segments actually reserved */
-
-	struct gfs_holder *tr_t_gh;    /* Glock holder for this transaction */
-
-	/* Stuff filled in during creation */
-
-	unsigned int tr_flags;         /* TRF_... */
-	struct list_head tr_elements;  /* List of this trans' log elements */
-
-	/* Stuff modified during the commit */
-
-	/* When creating a new transaction, GFS pre-allocates as many of
-	   these buffers and descriptor structures as it might need for
-	   all loggable filesystem (meta)data, and log-control (log-only, not
-	   going to filesystem in-place location) data going to on-disk log.
-	   It keeps them on these "free" lists until they get used (and linked
-	   into tr_bufs list, below) or "refunded" if not needed. */
-	unsigned int tr_num_free_bufs; /* List of free gfs_log_buf structs */
-	struct list_head tr_free_bufs; /* .. 1 for each log block */
-	unsigned int tr_num_free_bmem; /* List of free fs-block-size buffers */
-	struct list_head tr_free_bmem; /* .. for log-only (e.g. tag) blocks */
-
-	/* Logged transaction starts with a (first) log header at a segment
-	   boundary, and fills contiguous blocks after that.  Each segment
-	   boundary block gets another log header. */
-	uint64_t tr_log_head;          /* The next log block # to fill */
-	uint64_t tr_first_head;	       /* Trans' first log header's block # */
-
-	/* gfs_log_buf structs move from tr_free_bufs to here when being used */
-	struct list_head tr_bufs;      /* List of buffers going to the log */
-
-	/* Stuff that's part of the Active Items List (AIL) */
-
-	struct list_head tr_ail_bufs;  /* List of buffers on AIL list */
-
-	/* # log elements of various types on tr_elements list */
-
-	unsigned int tr_num_gl;        /* Glocks */
-	unsigned int tr_num_buf;       /* Buffers */
-	unsigned int tr_num_iul;       /* Unlinked inodes */
-	unsigned int tr_num_ida;       /* De-allocated inodes */
-	unsigned int tr_num_q;         /* Quotas */
-};
-
-#define GFS_GLOCKD_DEFAULT (1)
-#define GFS_GLOCKD_MAX (32)
-
-#define GFS_QUOTA_DEFAULT      GFS_QUOTA_OFF
-#define GFS_QUOTA_OFF          0
-#define GFS_QUOTA_ACCOUNT      1
-#define GFS_QUOTA_ON           2
-
-#define GFS_DATA_DEFAULT       GFS_DATA_ORDERED
-#define GFS_DATA_WRITEBACK     1
-#define GFS_DATA_ORDERED       2
-
-#define GFS_ERRORS_WITHDRAW    0
-#define GFS_ERRORS_CONTINUE    1 /* place holder for future feature */
-#define GFS_ERRORS_RO          2 /* place holder for future feature */
-#define GFS_ERRORS_PANIC       3
-
-struct gfs_args {
-	char ar_lockproto[GFS_LOCKNAME_LEN]; /* The name of the Lock Protocol */
-	char ar_locktable[GFS_LOCKNAME_LEN]; /* The name of the Lock Table */
-	char ar_hostdata[GFS_LOCKNAME_LEN]; /* The host specific data */
-
-	int ar_spectator; /* Don't get a journal because we're always RO. */
-	/*
-	 * GFS can invoke some flock and disk caching optimizations if it is
-	 * not in a cluster, i.e. is a local filesystem.  The chosen lock
-	 * module tells GFS, at mount time, if it supports clustering.
-	 * The nolock module is the only one that does not support clustering;
-	 * it sets to TRUE the local_fs field in the struct lm_lockops.
-	 * GFS can either optimize, or ignore the opportunity.
-	 * The user controls behavior via the following mount options.
-	 */
-	int ar_ignore_local_fs; /* Don't optimize even if local_fs is TRUE */
-	int ar_localflocks; /* Let the VFS do flock|fcntl locks for us */
-	int ar_localcaching; /* Local-style caching (dangerous on multihost) */
-	int ar_oopses_ok; /* Allow oopses */
-
-	int ar_debug; /* Oops on errors instead of trying to be graceful */
-	int ar_errors; /* errors=default | panic */
-	int ar_upgrade; /* Upgrade ondisk/multihost format */
-
-	unsigned int ar_num_glockd; /* # of glock cleanup daemons to run
-				       (more daemons => faster cleanup)  */
-	int ar_posix_acls; /* Enable posix acls */
-	int ar_suiddir; /* suiddir support */
-	int ar_noquota; /* Turn off quota support */
-	int ar_noatime; /* Turn off atime updates */
-};
-
-struct gfs_tune {
-	spinlock_t gt_spin;
-
-	unsigned int gt_ilimit1;
-	unsigned int gt_ilimit1_tries;
-	unsigned int gt_ilimit1_min;
-	unsigned int gt_ilimit2;
-	unsigned int gt_ilimit2_tries;
-	unsigned int gt_ilimit2_min;
-	unsigned int gt_demote_secs; /* Cache retention for unheld glock */
-	unsigned int gt_incore_log_blocks;
-	unsigned int gt_jindex_refresh_secs; /* Check for new journal index */
-	unsigned int gt_depend_secs;
-
-	/* How often various daemons run (seconds) */
-	unsigned int gt_scand_secs; /* Find unused glocks and inodes */
-	unsigned int gt_recoverd_secs; /* Recover journal of crashed node */
-	unsigned int gt_logd_secs; /* Update log tail as AIL flushes */
-	unsigned int gt_quotad_secs; /* Sync changes to quota file, clean*/
-	unsigned int gt_inoded_secs; /* Toss unused inodes */
-	unsigned int gt_glock_purge; /* Purge glock */
-
-	unsigned int gt_quota_simul_sync; /* Max # quotavals to sync at once */
-	unsigned int gt_quota_warn_period; /* Secs between quota warn msgs */
-	unsigned int gt_atime_quantum; /* Min secs between atime updates */
-	unsigned int gt_quota_quantum; /* Secs between syncs to quota file */
-	unsigned int gt_quota_scale_num; /* Numerator */
-	unsigned int gt_quota_scale_den; /* Denominator */
-	unsigned int gt_quota_enforce;
-	unsigned int gt_quota_account;
-	unsigned int gt_new_files_jdata;
-	unsigned int gt_new_files_directio;
-	unsigned int gt_max_atomic_write; /* Split large writes into this size*/
-	unsigned int gt_max_readahead; /* Max bytes to read-ahead from disk */
-	unsigned int gt_lockdump_size;
-	unsigned int gt_stall_secs; /* Detects trouble! */
-	unsigned int gt_complain_secs;
-	unsigned int gt_reclaim_limit; /* Max # glocks in reclaim list */
-	unsigned int gt_entries_per_readdir;
-	unsigned int gt_prefetch_secs; /* Usage window for prefetched glocks */
-	unsigned int gt_statfs_slots;
-	unsigned int gt_max_mhc; /* Max # of meta headers in mhc cache */
-	unsigned int gt_greedy_default;
-	unsigned int gt_greedy_quantum;
-	unsigned int gt_greedy_max;
-	unsigned int gt_rgrp_try_threshold;
-	unsigned int gt_statfs_fast;
-};
-
-/*
- *  One bucket of the filesystem's sd_gl_hash glock hash table.
- *
- *  A gfs_glock links into a bucket's list via glock's gl_list member.
- *
- */
-struct gfs_gl_hash_bucket {
-	rwlock_t hb_lock;              /* Protects list */
-	struct list_head hb_list;      /* List of glocks in this bucket */
-};
-
-/*
- *  "Super Block" Data Structure
- *  One per mounted filesystem.
- *  This is the big instance structure that ties everything together for
- *    a given mounted filesystem.  Each GFS mount has its own, supporting
- *    mounts of multiple GFS filesystems on each node.
- *  Pointer to this is usually seen as "sdp" throughout code.
- *  This is a very large structure, as structures go, in part because it
- *    contains arrays of hash buckets for various in-core caches.
- */
-
-#define SDF_JOURNAL_LIVE        (0)  /* Journaling is active (journal is writeable)*/
-#define SDF_SHUTDOWN            (1)  /* FS abnormaly shutdown */
-
-/* (Re)mount options from Linux VFS */
-#define SDF_NOATIME             (8)  /* Don't change access time */
-#define SDF_ROFS                (9)  /* Read-only mode */
-
-/* Journal log dump support */
-#define SDF_NEED_LOG_DUMP       (10) /* Need to rewrite unlink and quota tags */
-#define SDF_FOUND_UL_DUMP       (11) /* Recovery found unlinked tags */
-#define SDF_FOUND_Q_DUMP        (12) /* Recovery found qutoa tags */
-#define SDF_IN_LOG_DUMP         (13) /* Serializes log dumps */
-
-/* Glock cache */
-#define GFS_GL_HASH_SHIFT       (13)    /* # hash buckets = 8K */
-#define GFS_GL_HASH_SIZE        (1 << GFS_GL_HASH_SHIFT)
-#define GFS_GL_HASH_MASK        (GFS_GL_HASH_SIZE - 1)
-
-/* Meta header cache */
-#define GFS_MHC_HASH_SHIFT      (10)    /* # hash buckets = 1K */
-#define GFS_MHC_HASH_SIZE       (1 << GFS_MHC_HASH_SHIFT)
-#define GFS_MHC_HASH_MASK       (GFS_MHC_HASH_SIZE - 1)
-
-/* Dependency cache */
-#define GFS_DEPEND_HASH_SHIFT   (10)    /* # hash buckets = 1K */
-#define GFS_DEPEND_HASH_SIZE    (1 << GFS_DEPEND_HASH_SHIFT)
-#define GFS_DEPEND_HASH_MASK    (GFS_DEPEND_HASH_SIZE - 1)
-
-struct gfs_sbd {
-	struct gfs_sb sd_sb;            /* GFS on-disk Super Block image */
-
-	struct super_block *sd_vfs;     /* Linux VFS device independent sb */
-
-	struct gfs_args sd_args;        /* Mount arguments */
-	unsigned long sd_flags;         /* SDF_... see above */
-
-	struct gfs_tune sd_tune;	/* Filesystem tuning structure */
-
-	/* statfs */
-	struct inode *sd_statfs_inode;
-	spinlock_t sd_statfs_spin;
-	struct gfs_statfs_change_host sd_statfs_master;
-	struct gfs_statfs_change_host sd_statfs_local;
-	unsigned long sd_statfs_sync_time;
-
-	/* Resource group stuff */
-
-	struct gfs_inode *sd_riinode;	/* Resource Index (rindex) inode */
-	uint64_t sd_riinode_vn;	        /* Resource Index version # (detects
-	                                   whether new rgrps have been added) */
-
-	struct list_head sd_rglist;	/* List of all resource groups,
-					   on-disk order */
-	struct semaphore sd_rindex_lock;/* Serializes RIndex rereads */
-	struct list_head sd_rg_mru_list;/* List of all resource groups,
-					   most-recently-used (MRU) order */
-	spinlock_t sd_rg_mru_lock;      /* Protect mru list */
-	struct list_head sd_rg_recent;	/* List of rgrps from which blocks
-					   were recently allocated */
-	spinlock_t sd_rg_recent_lock;   /* Protect recent list */
-	struct gfs_rgrpd *sd_rg_forward;/* Next rgrp from which to attempt
-					   a block alloc */
-	spinlock_t sd_rg_forward_lock;  /* Protect forward pointer */
-
-	unsigned int sd_rgcount;	/* Total # of resource groups */
-
-	/*  Constants computed on mount  */
-
-	/* "bb" == "basic block" == 512Byte sector */
-	uint32_t sd_fsb2bb;             /* # 512B basic blocks in a FS block */
-	uint32_t sd_fsb2bb_shift;       /* Shift sector # to the right by 
-	                                   this to get FileSystem block addr */
-	uint32_t sd_diptrs;     /* Max # of block pointers in a dinode */
-	uint32_t sd_inptrs;     /* Max # of block pointers in an indirect blk */
-	uint32_t sd_jbsize;     /* Payload size (bytes) of a journaled metadata
-	                               block (GFS journals all meta blocks) */
-	uint32_t sd_hash_bsize; /* sizeof(exhash hash block) */
-	uint32_t sd_hash_bsize_shift;
-	uint32_t sd_hash_ptrs;  /* Number of points in a hash block */
-	uint32_t sd_max_dirres; /* Max blocks needed to add a directory entry */
-	uint32_t sd_max_height;	/* Max height of a file's tree */
-	uint64_t sd_heightsize[GFS_MAX_META_HEIGHT];
-	uint32_t sd_max_jheight; /* Max height, journaled file's tree */
-	uint64_t sd_jheightsize[GFS_MAX_META_HEIGHT];
-
-	/*  Lock Stuff  */
-
-	/* Glock cache (all glocks currently held by this node for this FS) */
-	struct gfs_gl_hash_bucket sd_gl_hash[GFS_GL_HASH_SIZE];
-
-	/* Glock reclaim support for scand and glockd */
-	struct list_head sd_reclaim_list;   /* List of glocks to reclaim */
-	spinlock_t sd_reclaim_lock;
-	wait_queue_head_t sd_reclaim_wchan;
-	atomic_t sd_reclaim_count;          /* # glocks on reclaim list */
-
-	/* Lock module tells us if we're first-to-mount, 
-	   which journal to use, etc. */
-	struct lm_lockstruct sd_lockstruct; /* Info provided by lock module */
-
-	/*  Other caches */
-
-	/* Meta-header cache (incore copies of on-disk meta headers) */
-	struct list_head sd_mhc[GFS_MHC_HASH_SIZE]; /* hash buckets */
-	struct list_head sd_mhc_single;     /* Non-hashed list of all MHCs */
-	spinlock_t sd_mhc_lock;
-	atomic_t sd_mhc_count;              /* # MHCs in cache */
-
-	/* Dependency cache */
-	struct list_head sd_depend[GFS_DEPEND_HASH_SIZE];  /* Hash buckets */
-	spinlock_t sd_depend_lock;
-	atomic_t sd_depend_count;           /* # dependencies in cache */
-
-	/* LIVE inter-node lock indicates that FS is mounted on at least
-	   one node */
-	struct gfs_holder sd_live_gh;       /* Glock holder for LIVE lock */
-
-	/* For quiescing the filesystem */
-	struct gfs_holder sd_freeze_gh;
-	struct semaphore sd_freeze_lock;
-	unsigned int sd_freeze_count;
-
-	/*  Inode Stuff  */
-
-	struct gfs_inode *sd_rooti;         /* FS's root inode */
-
-	/* Only 1 node at a time may rename (e.g. mv) directory from
-	   one directory to another. */
-	struct gfs_glock *sd_rename_gl;     /* Rename glock */
-
-	/*  Daemon stuff  */
-
-	/* Scan for glocks and inodes to toss from memory */
-	struct task_struct *sd_scand_process; /* Scand places on reclaim list*/
-	struct task_struct *sd_glockd_process[GFS_GLOCKD_MAX];
-	unsigned int sd_glockd_num;    /* # of glockd procs to do reclaiming*/
-
-	/* Recover journal of a crashed node */
-	struct task_struct *sd_recoverd_process;
-
-	/* Update log tail as AIL gets flushed to in-place on-disk blocks */
-	struct task_struct *sd_logd_process;
-
-	/* Sync quota updates to disk, and clean up unused quota structs */
-	struct task_struct *sd_quotad_process;
-
-	/* Clean up unused inode structures */
-	struct task_struct *sd_inoded_process;
-
-	/*  Log stuff  */
-
-	/* Transaction lock protects the following from one another:
-	   normal write transaction, journal replay (recovery), fs upgrade,
-	   fs read-only => read/write and read/write => read-only conversions.
-	   Also, acquiring the transaction lock in a state other than shared
-	   causes all other machines in the cluster to sync out their dirty
-	   data, mark their journal as being clean, and prevent any new FS
-	   modifications from occuring (i.e. quiesces the FS). */
-	struct gfs_glock *sd_trans_gl;	/* Transaction glock structure */
-
-	struct gfs_inode *sd_jiinode;	/* Journal index inode */
-	uint64_t sd_jiinode_vn;         /* Journal index version # (detects
-	                                   if new journals have been added) */
-
-	unsigned int sd_journals;	/* Number of journals in the FS */
-	struct gfs_jindex *sd_jindex;	/* Array of journal descriptors */
-	struct semaphore sd_jindex_lock;
-	unsigned long sd_jindex_refresh_time; /* Poll for new journals (secs) */
-
-	struct gfs_jindex sd_jdesc;	 /* This machine's journal descriptor */
-	struct gfs_holder sd_journal_gh; /* This machine's jrnl glock holder */
-
-	uint64_t sd_sequence;	/* Assigned to xactions in order they commit */
-	uint64_t sd_log_head;	/* Block number of next journal write */
-	uint64_t sd_log_wrap;
-
-	spinlock_t sd_log_seg_lock;
-	unsigned int sd_log_seg_free;	/* # of free segments in the log */
-	unsigned int sd_log_seg_ail2; /* # of freeable segments in the log */
-	struct list_head sd_log_seg_list;
-	wait_queue_head_t sd_log_seg_wait;
-
-	/* "Active Items List" of transactions that have been flushed to
-	   on-disk log, and are waiting for flush to in-place on-disk blocks */
-	struct list_head sd_log_ail;	/* "next" is head, "prev" is tail */
-
-	/* Transactions committed incore, but not yet flushed to on-disk log */
-	struct list_head sd_log_incore;	/* "Next" is newest, "prev" is oldest */
-	unsigned int sd_log_buffers;	/* # of buffers in the incore log */
-
-	struct rw_semaphore sd_log_lock;	/* Lock for access to log values */
-
-	uint64_t sd_log_dump_last;
-	uint64_t sd_log_dump_last_wrap;
-
-	/*
-	 * Unlinked inode crap.
-	 * List includes newly created, not-yet-linked inodes,
-	 *   as well as inodes that have been unlinked and are waiting
-         *   to be de-allocated.
-	 */
-	struct list_head sd_unlinked_list; /* List of unlinked inodes */
-	spinlock_t sd_unlinked_lock;       /* Protects list and members */
-
-	atomic_t sd_unlinked_ic_count;
-	atomic_t sd_unlinked_od_count;
-
-	/* Quota crap */
-
-	struct list_head sd_quota_list; /* List of all gfs_quota_data structs */
-	spinlock_t sd_quota_lock;
-
-	atomic_t sd_quota_count;        /* # quotas on sd_quota_list */
-	atomic_t sd_quota_od_count;     /* # quotas waiting for sync to
-	                                   special on-disk quota file */
-
-	struct gfs_inode *sd_qinode;    /* Special on-disk quota file */
-
-	uint64_t sd_quota_sync_gen;     /* Generation, incr when sync to file */
-	unsigned long sd_quota_sync_time; /* Jiffies, last sync to quota file */
-
-	/* License crap */
-
-	struct gfs_inode *sd_linode;    /* Special on-disk license file */
-
-	/* Recovery stuff */
-
-	/* Lock module tells GFS, via callback, when a journal needs recovery.
-	   It stays on this list until recovery daemon performs recovery. */
-	struct list_head sd_dirty_j;    /* List of dirty journals */
-	spinlock_t sd_dirty_j_lock;     /* Protects list */
-
-	/* Statistics for 3 possible recovery actions for each buffer in log,
-	     determined by comparing generation #s of logged block and
-	     in-place block.  Scope of stats is for one journal. */
-	unsigned int sd_recovery_replays; /* newer than in-place; copy it */
-	unsigned int sd_recovery_skips;   /* older than in-place; ignore it */
-	unsigned int sd_recovery_sames;   /* same as in-place; ignore it */
-
-	/* Counters */
-
-	/* current quantities of various things */
-	atomic_t sd_glock_count;      /* # of gfs_glock structs alloc'd */
-	atomic_t sd_glock_held_count; /* # of glocks locked by this node */
-	atomic_t sd_inode_count;      /* # of gfs_inode structs alloc'd */
-	atomic_t sd_bufdata_count;    /* # of gfs_bufdata structs alloc'd */
-
-	atomic_t sd_fh2dentry_misses; /* total # get_dentry misses */
-	atomic_t sd_reclaimed;        /* total # glocks reclaimed since mount */
-
-	/* total lock-related calls handled since mount */
-	atomic_t sd_glock_nq_calls;
-	atomic_t sd_glock_dq_calls;
-	atomic_t sd_glock_prefetch_calls;
-	atomic_t sd_lm_lock_calls;
-	atomic_t sd_lm_unlock_calls;
-	atomic_t sd_lm_callbacks;
-
-	atomic_t sd_lm_outstanding;
-	atomic_t sd_bio_reads;
-	atomic_t sd_bio_writes;
-	atomic_t sd_bio_outstanding;
-
-	/* total calls from Linux VFS handled since mount */
-	atomic_t sd_ops_address;
-	atomic_t sd_ops_dentry;
-	atomic_t sd_ops_export;
-	atomic_t sd_ops_file;
-	atomic_t sd_ops_inode;
-	atomic_t sd_ops_super;
-	atomic_t sd_ops_vm;
-
-	char sd_fsname[256];
-	char sd_table_name[256];
-	char sd_proto_name[256];
-
-	struct kobject sd_kobj;
-
-	/* Debugging crud */
-
-	unsigned long sd_last_warning;
-
-	spinlock_t sd_ail_lock;
-	struct list_head sd_recovery_bufs;
-
-	struct list_head sd_list;
-};
-
-#endif /* __INCORE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/inode.c b/gfs-kernel/src/gfs/inode.c
deleted file mode 100644
index 68c94e6..0000000
--- a/gfs-kernel/src/gfs/inode.c
+++ /dev/null
@@ -1,2224 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/posix_acl.h>
-#include <linux/cred.h>
-
-#include "gfs.h"
-#include "acl.h"
-#include "bmap.h"
-#include "dio.h"
-#include "dir.h"
-#include "eattr.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "log.h"
-#include "ops_address.h"
-#include "ops_file.h"
-#include "ops_inode.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-#include "unlinked.h"
-
-/**
- * inode_attr_in - Copy attributes from the dinode into the VFS inode
- * @ip: The GFS inode (with embedded disk inode data)
- * @inode:  The Linux VFS inode
- *
- */
-
-static void
-inode_attr_in(struct gfs_inode *ip, struct inode *inode)
-{
-	unsigned int mode;
-
-	inode->i_ino = ip->i_num.no_formal_ino;
-
-	switch (ip->i_di.di_type) {
-	case GFS_FILE_REG:
-		mode = S_IFREG;
-		inode->i_rdev = 0;
-		break;
-	case GFS_FILE_DIR:
-		mode = S_IFDIR;
-		inode->i_rdev = 0;
-		break;
-	case GFS_FILE_LNK:
-		mode = S_IFLNK;
-		inode->i_rdev = 0;
-		break;
-	case GFS_FILE_BLK:
-		mode = S_IFBLK;
-		inode->i_rdev = MKDEV(ip->i_di.di_major, ip->i_di.di_minor);
-		break;
-	case GFS_FILE_CHR:
-		mode = S_IFCHR;
-		inode->i_rdev = MKDEV(ip->i_di.di_major, ip->i_di.di_minor);
-		break;
-	case GFS_FILE_FIFO:
-		mode = S_IFIFO;
-		inode->i_rdev = 0;
-		break;
-	case GFS_FILE_SOCK:
-		mode = S_IFSOCK;
-		inode->i_rdev = 0;
-		break;
-	default:
-		if (gfs_consist_inode(ip))
-			printk("GFS: fsid=%s: type = %u\n",
-			       ip->i_sbd->sd_fsname, ip->i_di.di_type);
-		return;
-	};
-
-	inode->i_mode = mode | (ip->i_di.di_mode & S_IALLUGO);
-	inode->i_nlink = ip->i_di.di_nlink;
-	inode->i_uid = ip->i_di.di_uid;
-	inode->i_gid = ip->i_di.di_gid;
-	i_size_write(inode, ip->i_di.di_size);
-	inode->i_atime.tv_sec = ip->i_di.di_atime;
-	inode->i_mtime.tv_sec = ip->i_di.di_mtime;
-	inode->i_ctime.tv_sec = ip->i_di.di_ctime;
-	inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0;
-	inode->i_blocks = ip->i_di.di_blocks <<
-		(ip->i_sbd->sd_sb.sb_bsize_shift - GFS_BASIC_BLOCK_SHIFT);
-	inode->i_generation = ip->i_di.di_header.mh_incarn;
-
-	if (ip->i_di.di_flags & GFS_DIF_IMMUTABLE)
-		inode->i_flags |= S_IMMUTABLE;
-	else
-		inode->i_flags &= ~S_IMMUTABLE;
-
-	if (ip->i_di.di_flags & GFS_DIF_APPENDONLY)
-		inode->i_flags |= S_APPEND;
-	else
-		inode->i_flags &= ~S_APPEND;
-}
-
-/**
- * gfs_inode_attr_in - Copy attributes from the dinode into the VFS inode
- * @ip: The GFS inode (with embedded disk inode data)
- *
- */
-
-void
-gfs_inode_attr_in(struct gfs_inode *ip)
-{
-	struct inode *inode;
-
-	inode = gfs_iget(ip, NO_CREATE);
-	if (inode) {
-		inode_attr_in(ip, inode);
-		iput(inode);
-	}
-
-}
-
-/**
- * gfs_inode_attr_out - Copy attributes from VFS inode into the dinode
- * @ip: The GFS inode
- *
- * Only copy out the attributes that we want the VFS layer
- * to be able to modify.
- */
-
-void
-gfs_inode_attr_out(struct gfs_inode *ip)
-{
-	struct inode *inode = ip->i_vnode;
-
-	ip->i_di.di_mode = inode->i_mode & S_IALLUGO;
-	ip->i_di.di_uid = inode->i_uid;
-	ip->i_di.di_gid = inode->i_gid;
-	ip->i_di.di_atime = inode->i_atime.tv_sec;
-	ip->i_di.di_mtime = inode->i_mtime.tv_sec;
-	ip->i_di.di_ctime = inode->i_ctime.tv_sec;
-}
-
-/**
- * gfs_iget - Get/Create a struct inode for a struct gfs_inode
- * @ip: the struct gfs_inode to get the struct inode for
- * @create: CREATE -- create a new struct inode if one does not already exist
- *          NO_CREATE -- return NULL if inode doesn't exist
- *
- * Returns: A VFS inode, or NULL if NO_CREATE and none in existance
- *
- * If this function creates a new inode, it:
- *   Copies fields from the GFS on-disk (d)inode to the VFS inode
- *   Attaches the appropriate ops vectors to the VFS inode and address_space
- *   Attaches the VFS inode to the gfs_inode
- *   Inserts the new inode in the VFS inode hash, while avoiding races
- */
-
-struct inode *
-gfs_iget(struct gfs_inode *ip, int create)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct inode *inode = NULL, *tmp;
-
-	spin_lock(&ip->i_spin);
-	if (ip->i_vnode)
-		inode = igrab(ip->i_vnode);
-	spin_unlock(&ip->i_spin);
-
-	if (inode || !create)
-		return inode;
-
-	tmp = new_inode(ip->i_sbd->sd_vfs);
-	if (!tmp)
-		return NULL;
-
-	inode_attr_in(ip, tmp);
-
-	/* Attach GFS-specific ops vectors */
-	if (ip->i_di.di_type == GFS_FILE_REG) {
-		tmp->i_op = &gfs_file_iops;
-		memcpy(&ip->gfs_file_aops, &gfs_file_aops,
-			   sizeof(struct address_space_operations));
-		tmp->i_mapping->a_ops = &ip->gfs_file_aops;
-		if (sdp->sd_args.ar_localflocks) {
-			if (gfs_is_jdata(ip))
-				tmp->i_fop = &gfs_file_fops_nolock_jdata;
-			else
-				tmp->i_fop = &gfs_file_fops_nolock;
-		} else {
-			if (gfs_is_jdata(ip))
-				tmp->i_fop = &gfs_file_fops_jdata;
-			else
-				tmp->i_fop = &gfs_file_fops;
-		}
-	} else if (ip->i_di.di_type == GFS_FILE_DIR) {
-		tmp->i_op = &gfs_dir_iops;
-		if (sdp->sd_args.ar_localflocks)
-			tmp->i_fop = &gfs_dir_fops_nolock;
-		else
-			tmp->i_fop = &gfs_dir_fops;
-	} else if (ip->i_di.di_type == GFS_FILE_LNK) {
-		tmp->i_op = &gfs_symlink_iops;
-	} else {
-		tmp->i_op = &gfs_dev_iops;
-		init_special_inode(tmp, tmp->i_mode, tmp->i_rdev);
-	}
-
-	set_v2ip(tmp, NULL);
-
-	/* Did another process successfully create an inode while we were
-	   preparing this (tmp) one?  If so, we can use that other one, and
-	   trash the one we were preparing. 
-	   The other process might not be done inserting the inode in the
-	   VFS hash table.  If so, we need to wait until it is done, then
-	   we can use it.  */
-	for (;;) {
-		spin_lock(&ip->i_spin);
-		if (!ip->i_vnode)
-			break;
-		inode = igrab(ip->i_vnode);
-		spin_unlock(&ip->i_spin);
-
-		if (inode) {
-			iput(tmp);
-			return inode;
-		}
-		yield();
-	}
-
-	inode = tmp;
-
-	gfs_inode_hold(ip);
-	ip->i_vnode = inode;
-	set_v2ip(inode, ip);
-
-	spin_unlock(&ip->i_spin);
-
-	insert_inode_hash(inode);
-
-	return inode;
-}
-
-/**
- * gfs_copyin_dinode - Refresh the incore copy of the dinode
- * @ip: The GFS inode
- *
- * Returns: errno
- */
-
-int
-gfs_copyin_dinode(struct gfs_inode *ip)
-{
-	struct buffer_head *dibh;
-	int error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		return error;
-
-	if (gfs_metatype_check(ip->i_sbd, dibh, GFS_METATYPE_DI)) {
-		brelse(dibh);
-		return -EIO;
-	}
-
-	gfs_dinode_in(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	if (ip->i_num.no_formal_ino != ip->i_di.di_num.no_formal_ino) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		return -EIO;
-	}
-
-	/* Handle a moved inode (not implemented yet) */
-	if (ip->i_num.no_addr != ip->i_di.di_num.no_addr) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		return -EIO;
-	}
-
-	ip->i_vn = ip->i_gl->gl_vn;
-
-	return 0;
-}
-
-/**
- * inode_create - create a struct gfs_inode, acquire Inode-Open (iopen) glock,
- *      read dinode from disk
- * @i_gl: The (already held) glock covering the inode
- * @inum: The inode number
- * @io_gl: the iopen glock to acquire/hold (using holder in new gfs_inode)
- * @io_state: the state the iopen glock should be acquired in
- * @ipp: pointer to put the returned inode in
- *
- * Returns: errno
- */
-
-static int
-inode_create(struct gfs_glock *i_gl, struct gfs_inum *inum,
-	     struct gfs_glock *io_gl, unsigned int io_state,
-	     struct gfs_inode **ipp)
-{
-	struct gfs_sbd *sdp = i_gl->gl_sbd;
-	struct gfs_inode *ip;
-	int error = 0;
-
-	RETRY_MALLOC(ip = kmem_cache_alloc(gfs_inode_cachep, GFP_KERNEL), ip);
-	memset(ip, 0, sizeof(struct gfs_inode));
-
-	ip->i_num = *inum;
-
-	atomic_set(&ip->i_count, 1);
-
-	ip->i_gl = i_gl;
-	ip->i_sbd = sdp;
-
-	spin_lock_init(&ip->i_spin);
-	init_rwsem(&ip->i_rw_mutex);
-
-	ip->i_greedy = gfs_tune_get(sdp, gt_greedy_default);
-
-	/* Lock the iopen glock (may be recursive) */
-	error = gfs_glock_nq_init(io_gl,
-				  io_state, GL_LOCAL_EXCL | GL_EXACT,
-				  &ip->i_iopen_gh);
-	if (error)
-		goto fail;
-
-	ip->i_iopen_gh.gh_owner = NULL;
-
-	/* Assign the inode's glock as this iopen glock's protected object */
-	spin_lock(&io_gl->gl_spin);
-	gfs_glock_hold(i_gl);
-	set_gl2gl(io_gl, i_gl);
-	spin_unlock(&io_gl->gl_spin);
-
-	/* Read dinode from disk */
-	error = gfs_copyin_dinode(ip);
-	if (error)
-		goto fail_iopen;
-
-	gfs_glock_hold(i_gl);
-	set_gl2ip(i_gl, ip);
-
-	/* initialize stat counter and timestamp */
-	ip->i_dir_stats = 0;
-	do_gettimeofday(&ip->i_dir_stat_st);
-
-	atomic_inc(&sdp->sd_inode_count);
-
-	*ipp = ip;
-
-	return 0;
-
- fail_iopen:
-	spin_lock(&io_gl->gl_spin);
-	set_gl2gl(io_gl, NULL);
-	gfs_glock_put(i_gl);
-	spin_unlock(&io_gl->gl_spin);
-
-	gfs_glock_dq_uninit(&ip->i_iopen_gh);
-
- fail:
-	gfs_flush_meta_cache(ip);
-	kmem_cache_free(gfs_inode_cachep, ip);
-	*ipp = NULL;
-
-	return error;
-}
-
-/**
- * gfs_inode_get - Get an inode given its number
- * @i_gl: The glock covering the inode
- * @inum: The inode number
- * @create: Flag to say if we are allowed to create a new struct gfs_inode
- * @ipp: pointer to put the returned inode in
- *
- * Returns: errno
- *
- * If creating a new gfs_inode structure, reads dinode from disk.
- */
-
-int
-gfs_inode_get(struct gfs_glock *i_gl, struct gfs_inum *inum, int create,
-		struct gfs_inode **ipp)
-{
-	struct gfs_glock *io_gl;
-	int error = 0;
-
-	*ipp = get_gl2ip(i_gl);
-	if (*ipp) {
-		atomic_inc(&(*ipp)->i_count);
-		gfs_assert_warn(i_gl->gl_sbd, 
-				(*ipp)->i_num.no_formal_ino ==
-				inum->no_formal_ino);
-	} else if (create) {
-		error = gfs_glock_get(i_gl->gl_sbd,
-				      inum->no_addr, &gfs_iopen_glops,
-				      CREATE, &io_gl);
-		if (!error) {
-			error = inode_create(i_gl, inum, io_gl,
-					     LM_ST_SHARED, ipp);
-			gfs_glock_put(io_gl);
-		}
-	}
-
-	return error;
-}
-
-/**
- * gfs_inode_hold - hold a struct gfs_inode structure
- * @ip: The GFS inode
- *
- */
-
-void
-gfs_inode_hold(struct gfs_inode *ip)
-{
-	gfs_assert(ip->i_sbd, atomic_read(&ip->i_count) > 0,);
-	atomic_inc(&ip->i_count);
-}
-
-/**
- * gfs_inode_put - put a struct gfs_inode structure
- * @ip: The GFS inode
- *
- */
-
-void
-gfs_inode_put(struct gfs_inode *ip)
-{
-	gfs_assert(ip->i_sbd, atomic_read(&ip->i_count) > 0,);
-	atomic_dec(&ip->i_count);
-}
-
-/**
- * gfs_inode_destroy - Destroy a GFS inode structure with no references on it
- * @ip: The GFS inode
- *
- * Also, unhold the iopen glock and release indirect addressing buffers.
- * This function must be called with a glocks held on the inode and 
- *   the associated iopen.
- *
- */
-
-void
-gfs_inode_destroy(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_glock *io_gl = ip->i_iopen_gh.gh_gl;
-	struct gfs_glock *i_gl = ip->i_gl;
-
-	gfs_assert_warn(sdp, !atomic_read(&ip->i_count));
-	gfs_assert(sdp, get_gl2gl(io_gl) == i_gl,);
-
-	/* Unhold the iopen glock */
-	spin_lock(&io_gl->gl_spin);
-	set_gl2gl(io_gl, NULL);
-	gfs_glock_put(i_gl);
-	spin_unlock(&io_gl->gl_spin);
-
-	gfs_glock_dq_uninit(&ip->i_iopen_gh);
-
-	/* Release indirect addressing buffers, destroy the GFS inode struct */
-	gfs_flush_meta_cache(ip);
-	kmem_cache_free(gfs_inode_cachep, ip);
-
-	set_gl2ip(i_gl, NULL);
-	gfs_glock_put(i_gl);
-
-	atomic_dec(&sdp->sd_inode_count);
-}
-
-/**
- * dinode_mark_unused - Set UNUSED flag in on-disk dinode
- * @ip:
- *
- * Also:
- * --  Increment incarnation number, to indicate that it no longer
- *       represents the old inode.
- * --  Update change time (ctime)
- *
- * Returns: errno
- */
-
-static int
-dinode_mark_unused(struct gfs_inode *ip)
-{
-	struct buffer_head *dibh;
-	struct gfs_dinode *di;
-	uint32_t incarn;
-	uint64_t ctime;
-	uint32_t flags;
-	int error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		return error;
-
-	di = (struct gfs_dinode *)dibh->b_data;
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-
-	incarn = gfs32_to_cpu(di->di_header.mh_incarn) + 1;
-	di->di_header.mh_incarn = cpu_to_gfs32(incarn);
-
-	ctime = get_seconds();
-	di->di_ctime = cpu_to_gfs64(ctime);
-
-	flags = (gfs32_to_cpu(di->di_flags)) | GFS_DIF_UNUSED;
-	di->di_flags = cpu_to_gfs32(flags);
-
-	brelse(dibh);
-
-	return 0;
-}
-
-/**
- * dinode_dealloc - Put deallocate a dinode
- * @ip: The GFS inode
- *
- * Returns: errno
- */
-
-static int
-dinode_dealloc(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al;
-	struct gfs_rgrpd *rgd;
-	int error;
-
-	if (ip->i_di.di_blocks != 1) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		return -EIO;
-	}
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_hold_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out;
-
-	error = gfs_rindex_hold(sdp, &al->al_ri_gh);
-	if (error)
-		goto out_qs;
-
-	rgd = gfs_blk2rgrpd(sdp, ip->i_num.no_addr);
-	if (!rgd) {
-		gfs_consist_inode(ip);
-		error = -EIO;
-		goto out_rindex_relse;
-	}
-
-	error = gfs_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &al->al_rgd_gh);
-	if (error)
-		goto out_rindex_relse;
-
-	/* Trans may require:
-	   One block for the RG header.
-	   One block for the dinode bit.
-	   One block for the dinode.
-	   We also need a block for the unlinked change.
-	   One block for the quota change. */
-
-	error = gfs_trans_begin(sdp, 3, 2);
-	if (error)
-		goto out_rg_gunlock;
-
-	/* Set the UNUSED flag in the on-disk dinode block, increment incarn */
-	error = dinode_mark_unused(ip);
-	if (error)
-		goto out_end_trans;
-
-	/* De-allocate on-disk dinode block to FREEMETA */
-	gfs_difree(rgd, ip);
-
-	gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IDA, &ip->i_num);
-	clear_bit(GLF_STICKY, &ip->i_gl->gl_flags);
-
- out_end_trans:
-	gfs_trans_end(sdp);
-
- out_rg_gunlock:
-	gfs_glock_dq_uninit(&al->al_rgd_gh);
-
- out_rindex_relse:
-	gfs_glock_dq_uninit(&al->al_ri_gh);
-
- out_qs:
-	gfs_quota_unhold_m(ip);
-
- out:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * inode_dealloc - Deallocate all on-disk blocks for an inode (dinode)
- * @sdp: the filesystem
- * @inum: the inode number to deallocate
- * @io_gh: a holder for the iopen glock for this inode
- *
- * De-allocates all on-disk blocks, data and metadata, associated with an inode.
- * All metadata blocks become GFS_BLKST_FREEMETA.
- * All data blocks become GFS_BLKST_FREE.
- * Also de-allocates incore gfs_inode structure.
- *
- * Returns: errno
- */
-
-static int
-inode_dealloc(struct gfs_sbd *sdp, struct gfs_inum *inum,
-		struct gfs_holder *io_gh)
-{
-	struct gfs_inode *ip;
-	struct gfs_holder i_gh;
-	int error;
-
-	/* Lock the inode as we blow it away */
-	error = gfs_glock_nq_num(sdp,
-				 inum->no_formal_ino, &gfs_inode_glops,
-				 LM_ST_EXCLUSIVE, 0, &i_gh);
-	if (error)
-		return error;
-
-	/* We reacquire the iopen lock here to avoid a race with the NFS server
-	   calling gfs_read_inode() with the inode number of a inode we're in
-	   the process of deallocating.  And we can't keep our hold on the lock
-	   from inode_dealloc_init() for deadlock reasons.  We do, however,
-	   overlap this iopen lock with the one to be acquired EX within
-	   inode_create(), below (recursive EX locks will be granted to same
-	   holder process, i.e. this process). */
-
-	gfs_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY, io_gh);
-	error = gfs_glock_nq(io_gh);
-	switch (error) {
-	case 0:
-		break;
-	case GLR_TRYFAILED:
-		error = 0;
-		goto fail;
-	default:
-		goto fail;
-	}
-
-	gfs_assert_warn(sdp, !get_gl2ip(i_gh.gh_gl));
-	error = inode_create(i_gh.gh_gl, inum, io_gh->gh_gl, LM_ST_EXCLUSIVE,
-			     &ip);
-
-	gfs_glock_dq(io_gh);
-
-	if (error)
-		goto fail;
-
-	/* Verify disk (d)inode, gfs inode, and VFS (v)inode are unused */
-	if (ip->i_di.di_nlink) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		error = -EIO;
-		goto fail_iput;
-	}
-	gfs_assert_warn(sdp, atomic_read(&ip->i_count) == 1);
-	gfs_assert_warn(sdp, !ip->i_vnode);
-
-	/* Free all on-disk directory leaves (if any) to FREEMETA state */
-	if (ip->i_di.di_type == GFS_FILE_DIR &&
-	    (ip->i_di.di_flags & GFS_DIF_EXHASH)) {
-		error = gfs_dir_exhash_free(ip);
-		if (error)
-			goto fail_iput;
-	}
-
-	/* Free all on-disk extended attribute blocks to FREEMETA state */
-	if (ip->i_di.di_eattr) {
-		error = gfs_ea_dealloc(ip);
-		if (error)
-			goto fail_iput;
-	}
-
-	/* Free all data blocks to FREE state, and meta blocks to FREEMETA */
-	error = gfs_shrink(ip, 0, NULL);
-	if (error)
-		goto fail_iput;
-
-	/* Set UNUSED flag and increment incarn # in on-disk dinode block,
-	   and de-alloc the block to FREEMETA */
-	error = dinode_dealloc(ip);
-	if (error)
-		goto fail_iput;
-
-	/* Free the GFS inode structure, unhold iopen and inode glocks */
-	gfs_inode_put(ip);
-	gfs_inode_destroy(ip);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return 0;
-
- fail_iput:
-	gfs_inode_put(ip);
-	gfs_inode_destroy(ip);
-
- fail:
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * inode_dealloc_init - Try to deallocate an initialized on-disk inode (dinode)
- *      and all of its associated data and meta blocks
- * @sdp: the filesystem
- *
- * Returns: 0 on success, -errno on error, 1 on busy (inode open)
- */
-
-static int
-inode_dealloc_init(struct gfs_sbd *sdp, struct gfs_inum *inum)
-{
-	struct gfs_holder io_gh;
-	int error = 0;
-
-	/* If not busy (on this node), de-alloc GFS incore inode, releasing
-	   any indirect addressing buffers, and unholding iopen glock */
-	gfs_try_toss_inode(sdp, inum);
-
-	/* Does another process (cluster-wide) have this inode open? */
-	error = gfs_glock_nq_num(sdp,
-				 inum->no_addr, &gfs_iopen_glops,
-				 LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB, &io_gh);
-	switch (error) {
-	case 0:
-		break;
-	case GLR_TRYFAILED:
-		return 1;
-	default:
-		return error;
-	}
-
-	/* Unlock here to prevent deadlock */
-	gfs_glock_dq(&io_gh);
-
-	/* No other process in the entire cluster has this inode open;
-	   we can remove it and all of its associated blocks from disk */
-	error = inode_dealloc(sdp, inum, &io_gh);
-	gfs_holder_uninit(&io_gh);
-
-	return error;
-}
-
-/**
- * inode_dealloc_uninit - dealloc an uninitialized on-disk inode (dinode) block
- * @sdp: the filesystem
- *
- * Create a transaction to change dinode block's alloc state to FREEMETA
- *
- * Returns: 0 on success, -errno on error, 1 on busy
- */
-
-static int
-inode_dealloc_uninit(struct gfs_sbd *sdp, struct gfs_inum *inum)
-{
-	struct gfs_rgrpd *rgd;
-	struct gfs_holder ri_gh, rgd_gh;
-	int error;
-
-	error = gfs_rindex_hold(sdp, &ri_gh);
-	if (error)
-		return error;
-
-	rgd = gfs_blk2rgrpd(sdp, inum->no_addr);
-	if (!rgd) {
-		gfs_consist(sdp);
-		error = -EIO;
-		goto fail;
-	}
-
-	error = gfs_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &rgd_gh);
-	if (error)
-		goto fail;
-
-	/* Trans may require:
-	   One block for the RG header.
-	   One block for the dinode bit.
-	   We also need a block for the unlinked change. */
-
-	error = gfs_trans_begin(sdp, 2, 1);
-	if (error)
-		goto fail_gunlock;
-
-	gfs_difree_uninit(rgd, inum->no_addr);
-	gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IDA, inum);
-
-	gfs_trans_end(sdp);
-
-	gfs_glock_dq_uninit(&rgd_gh);
-	gfs_glock_dq_uninit(&ri_gh);
-
-	return 0;
-
- fail_gunlock:
-	gfs_glock_dq_uninit(&rgd_gh);
-
- fail:
-	gfs_glock_dq_uninit(&ri_gh);
-
-	return error;
-}
-
-/**
- * gfs_inode_dealloc - Grab an unlinked inode off the list and try to free it.
- * @sdp: the filesystem
- *
- * Returns: 0 on success, -errno on error, 1 on busy
- */
-
-int
-gfs_inode_dealloc(struct gfs_sbd *sdp, struct gfs_inum *inum)
-{
-	if (inum->no_formal_ino)
-		return inode_dealloc_init(sdp, inum);
-	else
-		return inode_dealloc_uninit(sdp, inum);
-}
-
-/**
- * gfs_change_nlink - Change nlink count on inode
- * @ip: The GFS inode
- * @diff: The change in the nlink count required
- *
- * Returns: errno
- */
-
-int
-gfs_change_nlink(struct gfs_inode *ip, int diff)
-{
-	struct buffer_head *dibh;
-	uint32_t nlink;
-	int error;
-
-	nlink = ip->i_di.di_nlink + diff;
-
-	/* Tricky.  If we are reducing the nlink count,
-	   but the new value ends up being bigger than the
-	   old one, we must have underflowed. */
-	if (diff < 0 && nlink > ip->i_di.di_nlink) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		return -EIO;
-	}
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		return error;
-
-	ip->i_di.di_nlink = nlink;
-	ip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	return 0;
-}
-
-/**
- * gfs_lookupi - Look up a filename in a directory and return its inode
- * @d_gh: An initialized holder for the directory glock
- * @name: The name of the inode to look for
- * @is_root: If TRUE, ignore the caller's permissions
- * @i_gh: An uninitialized holder for the new inode glock
- *
- * There will always be a vnode (Linux VFS inode) for the d_gh inode unless
- *   @is_root is true.
- *
- * Returns: errno
- */
-
-int
-gfs_lookupi(struct gfs_holder *d_gh, struct qstr *name,
-	    int is_root, struct gfs_holder *i_gh)
-{
-	struct gfs_inode *dip = get_gl2ip(d_gh->gh_gl);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_glock *gl;
-	struct gfs_inode *ip;
-	struct gfs_inum inum, inum2;
-	unsigned int type;
-	int error;
-
-	i_gh->gh_gl = NULL;
-
-	if (!name->len || name->len > GFS_FNAMESIZE)
-		return -ENAMETOOLONG;
-
-	if (gfs_filecmp(name, ".", 1) ||
-	    (gfs_filecmp(name, "..", 2) && dip == sdp->sd_rooti)) {
-		gfs_holder_reinit(LM_ST_SHARED, 0, d_gh);
-		error = gfs_glock_nq(d_gh);
-		if (!error) {
-			error = gfs_glock_nq_init(dip->i_gl,
-						  LM_ST_SHARED, 0,
-						  i_gh);
-			if (error) {
-				gfs_glock_dq(d_gh);
-				return error;
-			}
-			gfs_inode_hold(dip);
-		}
-		return error;
-	}
-
-	if (gfs_assert_warn(sdp, !gfs_glock_is_locked_by_me(d_gh->gh_gl)))
-		return -EINVAL;
-
-	gfs_holder_reinit(LM_ST_SHARED, 0, d_gh);
-	error = gfs_glock_nq(d_gh);
-	if (error)
-		return error;
-
-	if (!is_root) {
-		error = inode_permission(dip->i_vnode, MAY_EXEC);
-		if (error) {
-			gfs_glock_dq(d_gh);
-			return error;
-		}
-	}
-
-	error = gfs_dir_search(dip, name, &inum, &type);
-	if (error) {
-		gfs_glock_dq(d_gh);
-		if (error == -ENOENT)
-			error = 0;
-		return error;
-	}
-
- restart:
-	error = gfs_glock_get(sdp, inum.no_formal_ino, &gfs_inode_glops,
-			      CREATE, &gl);
-	if (error) {
-		gfs_glock_dq(d_gh);
-		return error;
-	}
-
-	/*  Acquire the second lock  */
-
-	if (gl->gl_name.ln_number < dip->i_gl->gl_name.ln_number) {
-		gfs_glock_dq(d_gh);
-
-		error = gfs_glock_nq_init(gl, LM_ST_SHARED,
-					  LM_FLAG_ANY | GL_LOCAL_EXCL,
-					  i_gh);
-		if (error)
-			goto out;
-
-		gfs_holder_reinit(LM_ST_SHARED, 0, d_gh);
-		error = gfs_glock_nq(d_gh);
-		if (error) {
-			gfs_glock_dq_uninit(i_gh);
-			goto out;
-		}
-
-		if (!is_root) {
-			error = inode_permission(dip->i_vnode, MAY_EXEC);
-			if (error) {
-				gfs_glock_dq(d_gh);
-				gfs_glock_dq_uninit(i_gh);
-				goto out;
-			}
-		}
-
-		error = gfs_dir_search(dip, name, &inum2, &type);
-		if (error) {
-			gfs_glock_dq(d_gh);
-			gfs_glock_dq_uninit(i_gh);
-			if (error == -ENOENT)
-				error = 0;
-			goto out;
-		}
-
-		if (!gfs_inum_equal(&inum, &inum2)) {
-			gfs_glock_dq_uninit(i_gh);
-			gfs_glock_put(gl);
-			inum = inum2;
-			goto restart;
-		}
-	} else {
-		error = gfs_glock_nq_init(gl, LM_ST_SHARED,
-					  LM_FLAG_ANY | GL_LOCAL_EXCL,
-					  i_gh);
-		if (error) {
-			gfs_glock_dq(d_gh);
-			goto out;
-		}
-	}
-
-	error = gfs_inode_get(gl, &inum, CREATE, &ip);
-	if (error) {
-		gfs_glock_dq(d_gh);
-		gfs_glock_dq_uninit(i_gh);
-	} else if (ip->i_di.di_type != type) {
-		gfs_consist_inode(dip);
-		gfs_inode_put(ip);
-		gfs_glock_dq(d_gh);
-		gfs_glock_dq_uninit(i_gh);
-		error = -EIO;
-	}
-
- out:
-	gfs_glock_put(gl);
-
-	return error;
-}
-
-/**
- * create_ok - OK to create a new on-disk inode here?
- * @dip:  Directory in which dinode is to be created
- * @name:  Name of new dinode
- * @type:  GFS_FILE_XXX (regular file, dir, etc.)
- *
- * Returns: errno
- */
-
-static int
-create_ok(struct gfs_inode *dip, struct qstr *name, unsigned int type)
-{
-	int error;
-
-	error = inode_permission(dip->i_vnode, MAY_WRITE | MAY_EXEC);
-	if (error)
-		return error;
-
-	/*  Don't create entries in an unlinked directory  */
-
-	if (!dip->i_di.di_nlink)
-		return -EPERM;
-
-	error = gfs_dir_search(dip, name, NULL, NULL);
-	switch (error) {
-	case -ENOENT:
-		error = 0;
-		break;
-	case 0:
-		return -EEXIST;
-	default:
-		return error;
-	}
-
-	if (dip->i_di.di_entries == (uint32_t)-1)
-		return -EFBIG;
-	if (type == GFS_FILE_DIR && dip->i_di.di_nlink == (uint32_t)-1)
-		return -EMLINK;
-
-	return 0;
-}
-
-/**
- * dinode_alloc - Create an on-disk inode
- * @dip:  Directory in which to create the dinode
- * @ul:
- *
- * Since this dinode is not yet linked, we also create an unlinked inode
- *   descriptor.
- *
- * Returns: errno
- */
-
-static int
-dinode_alloc(struct gfs_inode *dip, struct gfs_unlinked **ul)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_alloc *al;
-	struct gfs_inum inum;
-	int error;
-
-	/* Create in-place allocation structure, reserve 1 dinode */
-	al = gfs_alloc_get(dip);
-	al->al_requested_di = 1;
-	error = gfs_inplace_reserve(dip);
-	if (error)
-		goto out;
-
-	error = gfs_trans_begin(sdp, al->al_rgd->rd_ri.ri_length, 1);
-	if (error)
-		goto out_inplace;
-
-	inum.no_formal_ino = 0;
-	error = gfs_dialloc(dip, &inum.no_addr);
-	if (error)
-		goto out_end_trans;
-
-	*ul = gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IUL, &inum);
-	gfs_unlinked_lock(sdp, *ul);
-
-	gfs_trans_add_gl(dip->i_gl);
-
- out_end_trans:
-	gfs_trans_end(sdp);
-
- out_inplace:
-	gfs_inplace_release(dip);
-
- out:
-	gfs_alloc_put(dip);
-
-	return error;
-}
-
-/**
- * pick_formal_ino - Pick a formal inode number for a given inode
- * @sdp: the filesystem
- * @inum: the inode number structure
- *
- */
-
-static void
-pick_formal_ino(struct gfs_sbd *sdp, struct gfs_inum *inum)
-{
-	/*  This won't always be true  */
-	inum->no_formal_ino = inum->no_addr;
-}
-
-/**
- * make_dinode - Fill in a new dinode structure
- * @dip: the directory this inode is being created in
- * @gl: The glock covering the new inode
- * @inum: the inode number
- * @type: the file type
- * @mode: the file permissions
- * @uid:
- * @gid:
- *
- */
-
-static int
-make_dinode(struct gfs_inode *dip,
-	    struct gfs_glock *gl, struct gfs_inum *inum,
-	    unsigned int type, unsigned int mode,
-	    unsigned int uid, unsigned int gid)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_dinode di;
-	struct buffer_head *dibh;
-	struct gfs_rgrpd *rgd;
-	int error;
-
-	error = gfs_dread(gl, inum->no_addr,
-			  DIO_NEW | DIO_START | DIO_WAIT,
-			  &dibh);
-	if (error)
-		return error;
-
-	gfs_trans_add_bh(gl, dibh);
-	gfs_metatype_set(dibh, GFS_METATYPE_DI, GFS_FORMAT_DI);
-	gfs_buffer_clear_tail(dibh, sizeof(struct gfs_dinode));
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-
-	gfs_meta_header_in(&di.di_header, dibh->b_data);
-
-	di.di_num = *inum;
-
-	di.di_mode = mode & S_IALLUGO;
-	di.di_uid = uid;
-	di.di_gid = gid;
-	di.di_nlink = 1;
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = get_seconds();
-
-	rgd = gfs_blk2rgrpd(sdp, inum->no_addr);
-	if (!rgd) {
-		if (gfs_consist(sdp))
-			printk("GFS: fsid=%s: block = %llu\n",
-			       sdp->sd_fsname,
-			       (unsigned long long)inum->no_addr);
-		brelse(dibh);
-		return -EIO;
-	}
-
-	di.di_rgrp = rgd->rd_ri.ri_addr;
-	di.di_goal_rgrp = di.di_rgrp;
-	di.di_goal_dblk = di.di_goal_mblk = inum->no_addr - rgd->rd_ri.ri_data1;
-
-	if (type == GFS_FILE_REG) {
-		if ((dip->i_di.di_flags & GFS_DIF_INHERIT_JDATA) ||
-		    gfs_tune_get(sdp, gt_new_files_jdata))
-			di.di_flags |= GFS_DIF_JDATA;
-		if ((dip->i_di.di_flags & GFS_DIF_INHERIT_DIRECTIO) ||
-		    gfs_tune_get(sdp, gt_new_files_directio))
-			di.di_flags |= GFS_DIF_DIRECTIO;
-	} else if (type == GFS_FILE_DIR) {
-		di.di_flags |= (dip->i_di.di_flags & GFS_DIF_INHERIT_DIRECTIO);
-		di.di_flags |= (dip->i_di.di_flags & GFS_DIF_INHERIT_JDATA);
-	}
-
-	di.di_type = type;
-
-	gfs_dinode_out(&di, dibh->b_data);
-	brelse(dibh);
-
-	return 0;
-}
-
-/**
- * inode_init_and_link -
- * @dip:
- * @name:
- * @inum:
- * @gl:
- * @type:
- * @mode:
- *
- * Returns: errno
- */
-
-static int
-inode_init_and_link(struct gfs_inode *dip, struct qstr *name,
-		    struct gfs_inum *inum, struct gfs_glock *gl,
-		    unsigned int type, mode_t mode)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_alloc *al;
-	struct gfs_inode *ip;
-	unsigned int uid, gid;
-	int alloc_required;
-	void *acl_a_data = NULL, *acl_d_data = NULL;
-	unsigned int acl_size = 0, acl_blocks = 0;
-	int error;
-
-	if (sdp->sd_args.ar_suiddir &&
-	    (dip->i_di.di_mode & S_ISUID) &&
-	    dip->i_di.di_uid) {
-		if (type == GFS_FILE_DIR)
-			mode |= S_ISUID;
-		else if (dip->i_di.di_uid != current_fsuid())
-			mode &= ~07111;
-		uid = dip->i_di.di_uid;
-	} else
-		uid = current_fsuid();
-	if (dip->i_di.di_mode & S_ISGID) {
-		if (type == GFS_FILE_DIR)
-			mode |= S_ISGID;
-		gid = dip->i_di.di_gid;
-	} else
-		gid = current_fsgid();
-
-	error = gfs_acl_new_prep(dip, type, &mode,
-				 &acl_a_data, &acl_d_data,
-				 &acl_size, &acl_blocks);
-	if (error)
-		return error;
-
-	al = gfs_alloc_get(dip);
-
-	error = gfs_quota_lock_m(dip, uid, gid);
-	if (error)
-		goto fail;
-
-	error = gfs_quota_check(dip, uid, gid);
-	if (error)
-		goto fail_gunlock_q;
-
-	if (acl_blocks)
-		alloc_required = TRUE;
-	else {
-		error = gfs_diradd_alloc_required(dip, name, &alloc_required);
-		if (error)
-			goto fail_gunlock_q;
-	}
-
-	if (alloc_required) {
-		error = gfs_quota_check(dip, dip->i_di.di_uid, dip->i_di.di_gid);
-		if (error)
-			goto fail_gunlock_q;
-
-		al->al_requested_meta = sdp->sd_max_dirres + acl_blocks;
-
-		error = gfs_inplace_reserve(dip);
-		if (error)
-			goto fail_gunlock_q;
-
-		/* Trans may require:
-		   blocks for two dinodes, the directory blocks necessary for
-		   a new entry, RG bitmap blocks for an allocation,
-		   and one block for a quota change and
-		   one block for an unlinked tag. */
-
-		error = gfs_trans_begin(sdp,
-					2 + sdp->sd_max_dirres + acl_blocks +
-					al->al_rgd->rd_ri.ri_length, 2);
-		if (error)
-			goto fail_inplace;
-	} else {
-		error = gfs_rindex_hold(sdp, &al->al_ri_gh);
-		if (error)
-			goto fail_gunlock_q;
-
-		/* Trans may require:
-		   blocks for two dinodes, a leaf block,
-		   and one block for a quota change and
-		   one block for an unlinked tag. */
-
-		error = gfs_trans_begin(sdp, 3, 2);
-		if (error)
-			goto fail_inplace;
-	}
-
-	error = gfs_dir_add(dip, name, inum, type);
-	if (error)
-		goto fail_end_trans;
-
-	error = make_dinode(dip, gl, inum, type, mode, uid, gid);
-	if (error)
-		goto fail_end_trans;
-
-	al->al_ul = gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IDA,
-					   &(struct gfs_inum){0, inum->no_addr});
-	gfs_trans_add_quota(sdp, +1, uid, gid);
-
-	error = gfs_inode_get(gl, inum, CREATE, &ip);
-
-	/* This should only fail if we are already shutdown. */
-	if (gfs_assert_withdraw(sdp, !error))
-		goto fail_end_trans;
-
-	if (acl_blocks)
-		error = gfs_acl_new_init(dip, ip,
-					 acl_a_data, acl_d_data,
-					 acl_size);
-
-	if (!alloc_required)
-		gfs_glock_dq_uninit(&al->al_ri_gh);
-
-	return error;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_inplace:
-	if (alloc_required)
-		gfs_inplace_release(dip);
-	else
-		gfs_glock_dq_uninit(&al->al_ri_gh);
-
- fail_gunlock_q:
-	gfs_quota_unlock_m(dip);
-
- fail:
-	gfs_alloc_put(dip);
-	if (acl_a_data)
-		kfree(acl_a_data);
-	else if (acl_d_data)
-		kfree(acl_d_data);
-
-	return error;
-}
-
-/**
- * gfs_createi - Create a new inode
- * @d_gh: An initialized holder for the directory glock
- * @name: The name of the new file
- * @type: The type of dinode (GFS_FILE_REG, GFS_FILE_DIR, GFS_FILE_LNK, ...)
- * @mode: the permissions on the new inode
- * @i_gh: An uninitialized holder for the new inode glock
- *
- * If the return value is 0, the glocks on both the directory and the new
- * file are held.  A transaction has been started and an inplace reservation
- * is held, as well.
- *
- * Returns: errno
- */
-
-int
-gfs_createi(struct gfs_holder *d_gh, struct qstr *name,
-	    unsigned int type, unsigned int mode,
-	    struct gfs_holder *i_gh)
-{
-	struct gfs_inode *dip = get_gl2ip(d_gh->gh_gl);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_unlinked *ul;
-	struct gfs_inum inum;
-	struct gfs_holder io_gh;
-	int error;
-
-	if (!name->len || name->len > GFS_FNAMESIZE)
-		return -ENAMETOOLONG;
-
-	gfs_holder_reinit(LM_ST_EXCLUSIVE, 0, d_gh);
-	error = gfs_glock_nq(d_gh);
-	if (error)
-		return error;
-
-	error = create_ok(dip, name, type);
-	if (error)
-		goto fail;
-
-	error = dinode_alloc(dip, &ul);
-	if (error)
-		goto fail;
-
-	inum.no_addr = ul->ul_inum.no_addr;
-	pick_formal_ino(sdp, &inum);
-
-	if (inum.no_formal_ino < dip->i_num.no_formal_ino) {
-		gfs_glock_dq(d_gh);
-
-		error = gfs_glock_nq_num(sdp,
-					 inum.no_formal_ino, &gfs_inode_glops,
-					 LM_ST_EXCLUSIVE, GL_SKIP, i_gh);
-		if (error) {
-			gfs_unlinked_unlock(sdp, ul);
-			return error;
-		}
-
-		gfs_holder_reinit(LM_ST_EXCLUSIVE, 0, d_gh);
-		error = gfs_glock_nq(d_gh);
-		if (error) {
-			gfs_glock_dq_uninit(i_gh);
-			gfs_unlinked_unlock(sdp, ul);
-			return error;
-		}
-
-		error = create_ok(dip, name, type);
-		if (error)
-			goto fail_gunlock_i;
-	} else {
-		error = gfs_glock_nq_num(sdp,
-					 inum.no_formal_ino, &gfs_inode_glops,
-					 LM_ST_EXCLUSIVE, GL_SKIP, i_gh);
-		if (error)
-			goto fail_ul;
-	}
-
-	error = gfs_glock_nq_num(sdp,
-				 inum.no_addr, &gfs_iopen_glops,
-				 LM_ST_SHARED, GL_LOCAL_EXCL | GL_EXACT,
-				 &io_gh);
-	if (error)
-		goto fail_gunlock_i;
-
-	error = inode_init_and_link(dip, name, &inum, i_gh->gh_gl, type, mode);
-	if (error)
-		goto fail_gunlock_io;
-
-	gfs_glock_dq_uninit(&io_gh);
-
-	return 0;
-
- fail_gunlock_io:
-	gfs_glock_dq_uninit(&io_gh);
-
- fail_gunlock_i:
-	gfs_glock_dq_uninit(i_gh);
-
- fail_ul:
-	gfs_unlinked_unlock(sdp, ul);
-
- fail:
-	gfs_glock_dq(d_gh);
-
-	return error;
-}
-
-/**
- * gfs_unlinki - Unlink a file
- * @dip: The inode of the directory
- * @name: The name of the file to be unlinked
- * @ip: The inode of the file to be removed
- *
- * Assumes Glocks on both dip and ip are held.
- *
- * Returns: errno
- */
-
-int
-gfs_unlinki(struct gfs_inode *dip, struct qstr *name, struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	int error;
-
-	error = gfs_dir_del(dip, name);
-	if (error)
-		return error;
-
-	error = gfs_change_nlink(ip, -1);
-	if (error)
-		return error;
-
-	/* If this inode is being unlinked from the directory structure,
-	   we need to mark that in the log so that it isn't lost during
-	   a crash. */
-
-	if (!ip->i_di.di_nlink) {
-		gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IUL, &ip->i_num);
-		set_bit(GLF_STICKY, &ip->i_gl->gl_flags);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_rmdiri - Remove a directory
- * @dip: The parent directory of the directory to be removed
- * @name: The name of the directory to be removed
- * @ip: The GFS inode of the directory to be removed
- *
- * Assumes Glocks on dip and ip are held
- *
- * Returns: errno
- */
-
-int
-gfs_rmdiri(struct gfs_inode *dip, struct qstr *name, struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct qstr dotname;
-	int error;
-
-	if (ip->i_di.di_entries != 2) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		return -EIO;
-	}
-
-	error = gfs_dir_del(dip, name);
-	if (error)
-		return error;
-
-	error = gfs_change_nlink(dip, -1);
-	if (error)
-		return error;
-
-	dotname.len = 1;
-	dotname.name = ".";
-	error = gfs_dir_del(ip, &dotname);
-	if (error)
-		return error;
-
-	dotname.len = 2;
-	dotname.name = "..";
-	error = gfs_dir_del(ip, &dotname);
-	if (error)
-		return error;
-
-	error = gfs_change_nlink(ip, -2);
-	if (error)
-		return error;
-
-	/* This inode is being unlinked from the directory structure and
-	   we need to mark that in the log so that it isn't lost during
-	   a crash. */
-
-	gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IUL, &ip->i_num);
-	set_bit(GLF_STICKY, &ip->i_gl->gl_flags);
-
-	return 0;
-}
-
-/*
- * gfs_unlink_ok - check to see that a inode is still in a directory
- * @dip: the directory
- * @name: the name of the file
- * @ip: the inode
- *
- * Assumes that the lock on (at least) @dip is held.
- *
- * Returns: 0 if the parent/child relationship is correct, errno if it isn't
- */
-
-int
-gfs_unlink_ok(struct gfs_inode *dip, struct qstr *name, struct gfs_inode *ip)
-{
-	struct gfs_inum inum;
-	unsigned int type;
-	int error;
-
-	if (IS_IMMUTABLE(ip->i_vnode) || IS_APPEND(ip->i_vnode))
-		return -EPERM;
-
-	if ((dip->i_di.di_mode & S_ISVTX) &&
-	    dip->i_di.di_uid != current_fsuid() &&
-	    ip->i_di.di_uid != current_fsuid() &&
-	    !capable(CAP_FOWNER))
-		return -EPERM;
-
-	if (IS_APPEND(dip->i_vnode))
-		return -EPERM;
-
-	error = inode_permission(dip->i_vnode, MAY_WRITE | MAY_EXEC);
-	if (error)
-		return error;
-
-	error = gfs_dir_search(dip, name, &inum, &type);
-	if (error)
-		return error;
-
-	if (inum.no_formal_ino != ip->i_num.no_formal_ino)
-		return -ENOENT;
-
-	if (ip->i_di.di_type != type) {
-		gfs_consist_inode(dip);
-		return -EIO;
-	}
-
-	return 0;
-}
-
-/*
- * gfs_ok_to_move - check if it's ok to move a directory to another directory
- * @this: move this
- * @to: to here
- *
- * Follow @to back to the root and make sure we don't encounter @this
- * Assumes we already hold the rename lock.
- *
- * Returns: errno
- */
-
-int
-gfs_ok_to_move(struct gfs_inode *this, struct gfs_inode *to)
-{
-	struct gfs_sbd *sdp = this->i_sbd;
-	struct gfs_inode *tmp;
-	struct gfs_holder to_gh, tmp_gh;
-	struct qstr dotdot;
-	int error = 0;
-
-	memset(&dotdot, 0, sizeof (struct qstr));
-	dotdot.name = "..";
-	dotdot.len = 2;
-
-	gfs_inode_hold(to);
-
-	for (;;) {
-		if (to == this) {
-			error = -EINVAL;
-			break;
-		}
-		if (to == sdp->sd_rooti) {
-			error = 0;
-			break;
-		}
-
-		gfs_holder_init(to->i_gl, 0, 0, &to_gh);
-
-		error = gfs_lookupi(&to_gh, &dotdot, TRUE, &tmp_gh);
-		if (error) {
-			gfs_holder_uninit(&to_gh);
-			break;
-		}
-		if (!tmp_gh.gh_gl) {
-			gfs_holder_uninit(&to_gh);
-			error = -ENOENT;
-			break;
-		}
-
-		tmp = get_gl2ip(tmp_gh.gh_gl);
-
-		gfs_glock_dq_uninit(&to_gh);
-		gfs_glock_dq_uninit(&tmp_gh);
-
-		gfs_inode_put(to);
-		to = tmp;
-	}
-
-	gfs_inode_put(to);
-
-	return error;
-}
-
-/**
- * gfs_readlinki - return the contents of a symlink
- * @ip: the symlink's inode
- * @buf: a pointer to the buffer to be filled
- * @len: a pointer to the length of @buf
- *
- * If @buf is too small, a piece of memory is kmalloc()ed and needs
- * to be freed by the caller.
- *
- * Returns: errno
- */
-
-int
-gfs_readlinki(struct gfs_inode *ip, char **buf, unsigned int *len)
-{
-	struct gfs_holder i_gh;
-	struct buffer_head *dibh;
-	unsigned int x;
-	int error;
-
-	gfs_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &i_gh);
-	error = gfs_glock_nq_atime(&i_gh);
-	if (error) {
-		gfs_holder_uninit(&i_gh);
-		return error;
-	}
-
-	if (!ip->i_di.di_size) {
-		gfs_consist_inode(ip);
-		error = -EIO;
-		goto out;
-	}
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto out;
-
-	x = ip->i_di.di_size + 1;
-	if (x > *len) {
-		*buf = kmalloc(x, GFP_KERNEL);
-		if (!*buf) {
-			error = -ENOMEM;
-			goto out_brelse;
-		}
-	}
-
-	memcpy(*buf, dibh->b_data + sizeof(struct gfs_dinode), x);
-	*len = x;
-
- out_brelse:
-	brelse(dibh);
-
- out:
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_glock_nq_atime - Acquire a hold on an inode's glock, and
- *       conditionally update the inode's atime
- * @gh: the holder to acquire
- *
- * Tests atime (access time) for gfs_read, gfs_readdir and gfs_mmap
- * Update if the difference between the current time and the inode's current
- * atime is greater than an interval specified at mount (or default).
- *
- * Will not update if GFS mounted NOATIME (this is *the* place where NOATIME
- *   has an effect) or Read-Only.
- *
- * Returns: errno
- */
-
-int
-gfs_glock_nq_atime(struct gfs_holder *gh)
-{
-	struct gfs_glock *gl = gh->gh_gl;
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_inode *ip = get_gl2ip(gl);
-	int64_t curtime, quantum = gfs_tune_get(sdp, gt_atime_quantum);
-	unsigned int state;
-	int flags;
-	int error;
-
-	if (gfs_assert_warn(sdp, gh->gh_flags & GL_ATIME) ||
-	    gfs_assert_warn(sdp, !(gh->gh_flags & GL_ASYNC)) ||
-	    gfs_assert_warn(sdp, gl->gl_ops == &gfs_inode_glops))
-		return -EINVAL;
-
-	/* Save original request state of lock holder */
-	state = gh->gh_state;
-	flags = gh->gh_flags;
-
-	error = gfs_glock_nq(gh);
-	if (error)
-		return error;
-
-	if (test_bit(SDF_NOATIME, &sdp->sd_flags) ||
-	    test_bit(SDF_ROFS, &sdp->sd_flags))
-		return 0;
-
-	curtime = get_seconds();
-	if (curtime - ip->i_di.di_atime >= quantum) {
-		/* Get EX hold (force EX glock via !ANY) to write the dinode */
-		gfs_glock_dq(gh);
-		gfs_holder_reinit(LM_ST_EXCLUSIVE,
-				  gh->gh_flags & ~LM_FLAG_ANY,
-				  gh);
-		error = gfs_glock_nq(gh);
-		if (error)
-			return error;
-
-		/* Verify that atime hasn't been updated while we were
-		   trying to get exclusive lock. */
-
-		curtime = get_seconds();
-		if (curtime - ip->i_di.di_atime >= quantum) {
-			struct buffer_head *dibh;
-
-			error = gfs_trans_begin(sdp, 1, 0);
-			if (error == -EROFS)
-				return 0;
-			if (error)
-				goto fail;
-
-			error = gfs_get_inode_buffer(ip, &dibh);
-			if (error)
-				goto fail_end_trans;
-
-			ip->i_di.di_atime = curtime;
-
-			gfs_trans_add_bh(ip->i_gl, dibh);
-			gfs_dinode_out(&ip->i_di, dibh->b_data);
-			brelse(dibh);
-
-			gfs_trans_end(sdp);
-		}
-
-		/* If someone else has asked for the glock,
-		   unlock and let them have it. Then reacquire
-		   in the original state. */
-		if (gfs_glock_is_blocking(gl)) {
-			gfs_glock_dq(gh);
-			gfs_holder_reinit(state, flags, gh);
-			return gfs_glock_nq(gh);
-		}
-	}
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail:
-	gfs_glock_dq(gh);
-
-	return error;
-}
-
-/**
- * glock_compare_atime - Compare two struct gfs_glock structures for gfs_sort()
- * @arg_a: the first structure
- * @arg_b: the second structure
- *
- * Sort order determined by (in order of priority):
- * -- lock number
- * -- lock state (SHARED > EXCLUSIVE or GL_ATIME, which can demand EXCLUSIVE)
- *
- * Returns: 1 if A > B
- *         -1 if A < B
- *          0 if A = B
- */
-
-static int
-glock_compare_atime(const void *arg_a, const void *arg_b)
-{
-	struct gfs_holder *gh_a = *(struct gfs_holder **)arg_a;
-	struct gfs_holder *gh_b = *(struct gfs_holder **)arg_b;
-	struct lm_lockname *a = &gh_a->gh_gl->gl_name;
-	struct lm_lockname *b = &gh_b->gh_gl->gl_name;
-	int ret = 0;
-
-	if (a->ln_number > b->ln_number)
-		ret = 1;
-	else if (a->ln_number < b->ln_number)
-		ret = -1;
-	else {
-		if (gh_a->gh_state == LM_ST_SHARED &&
-		    gh_b->gh_state == LM_ST_EXCLUSIVE)
-			ret = 1;
-		else if (gh_a->gh_state == LM_ST_SHARED &&
-			 (gh_b->gh_flags & GL_ATIME))
-			ret = 1;
-	}
-
-	return ret;
-}
-
-/**
- * gfs_glock_nq_m_atime - acquire multiple glocks where one may need an
- *      atime update
- * @num_gh: the number of structures
- * @ghs: an array of struct gfs_holder structures
- *
- * Returns: 0 on success (all glocks acquired),
- *          errno on failure (no glocks acquired)
- */
-
-int
-gfs_glock_nq_m_atime(unsigned int num_gh, struct gfs_holder *ghs)
-{
-	struct gfs_holder **p;
-	unsigned int x;
-	int error = 0;
-
-	if (!num_gh)
-		return 0;
-
-	if (num_gh == 1) {
-		ghs->gh_flags &= ~(LM_FLAG_TRY | GL_ASYNC);
-		if (ghs->gh_flags & GL_ATIME)
-			error = gfs_glock_nq_atime(ghs);
-		else
-			error = gfs_glock_nq(ghs);
-		return error;
-	}
-
-	p = kmalloc(num_gh * sizeof(struct gfs_holder *), GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
-
-	for (x = 0; x < num_gh; x++)
-		p[x] = &ghs[x];
-
-	gfs_sort(p, num_gh, sizeof(struct gfs_holder *), glock_compare_atime);
-
-	for (x = 0; x < num_gh; x++) {
-		p[x]->gh_flags &= ~(LM_FLAG_TRY | GL_ASYNC);
-
-		if (p[x]->gh_flags & GL_ATIME)
-			error = gfs_glock_nq_atime(p[x]);
-		else
-			error = gfs_glock_nq(p[x]);
-
-		if (error) {
-			while (x--)
-				gfs_glock_dq(p[x]);
-			break;
-		}
-	}
-
-	kfree(p);
-	return error;
-}
-
-/**
- * gfs_try_toss_vnode - See if we can toss a vnode from memory
- * @ip: the inode
- *
- * Returns:  TRUE if the vnode was tossed
- */
-
-void
-gfs_try_toss_vnode(struct gfs_inode *ip)
-{
-	struct inode *inode;
-
-	inode = gfs_iget(ip, NO_CREATE);
-	if (!inode)
-		return;
-
-	d_prune_aliases(inode);
-
-	if (ip->i_di.di_type == GFS_FILE_DIR) {
-		struct list_head *head = &inode->i_dentry;
-		struct dentry *d = NULL;
-
-		spin_lock(&dcache_lock);
-		if (list_empty(head))
-			spin_unlock(&dcache_lock);
-		else {
-			d = list_entry(head->next, struct dentry, d_alias);
-			dget_locked(d);
-			spin_unlock(&dcache_lock);
-
-			if (have_submounts(d))
-				dput(d);
-			else {
-				shrink_dcache_parent(d);
-				dput(d);
-				d_prune_aliases(inode);
-			}
-		}
-	}
-
-	inode->i_nlink = 0;
-	iput(inode);
-}
-
-
-static int
-__gfs_setattr_simple(struct gfs_inode *ip, struct iattr *attr)
-{
-	struct buffer_head *dibh;
-	int error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		error = inode_setattr(ip->i_vnode, attr);
-		gfs_assert_warn(ip->i_sbd, !error);
-		gfs_inode_attr_out(ip);
-
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	return error;
-}
-
-/**
- * gfs_setattr_simple -
- * @ip:
- * @attr:
- *
- * Called with a reference on the vnode.
- *
- * Returns: errno
- */
-
-int
-gfs_setattr_simple(struct gfs_inode *ip, struct iattr *attr)
-{
-	int error;
-
-	if (get_transaction)
-		return __gfs_setattr_simple(ip, attr);
-
-	/* Trans may require:
-	   one dinode block. */
-
-	error = gfs_trans_begin(ip->i_sbd, 1, 0);
-	if (error)
-		return error;
-
-	error = __gfs_setattr_simple(ip, attr);
-
-	gfs_trans_end(ip->i_sbd);
-
-	return error;
-}
-
-/**
- * iah_make_jdata -
- * @gl:
- * @inum:
- *
- */
-
-static void
-iah_make_jdata(struct gfs_glock *gl, struct gfs_inum *inum)
-{
-	struct buffer_head *bh;
-	struct gfs_dinode *di;
-	uint32_t flags;
-	int error;
-
-	error = gfs_dread(gl, inum->no_addr, DIO_START | DIO_WAIT, &bh);
-
-	/* This should only fail if we are already shutdown. */
-	if (gfs_assert_withdraw(gl->gl_sbd, !error))
-		return;
-
-	di = (struct gfs_dinode *)bh->b_data;
-
-	flags = di->di_flags;
-	flags = gfs32_to_cpu(flags) | GFS_DIF_JDATA;
-	di->di_flags = cpu_to_gfs32(flags);
-
-	brelse(bh);
-}
-
-/**
- * iah_super_update - Write superblock to disk
- * @sdp:  filesystem instance structure
- *
- * Returns: errno
- *
- * Update on-disk superblock, using (modified) data in sdp->sd_sb
- */
-
-static int
-iah_super_update(struct gfs_sbd *sdp)
-{
-	struct gfs_glock *gl;
-	struct buffer_head *bh;
-	int error;
-
-	error = gfs_glock_get(sdp,
-			      GFS_SB_LOCK, &gfs_meta_glops,
-			      NO_CREATE, &gl);
-	if (gfs_assert_withdraw(sdp, !error && gl)) /* This should already be held. */
-		return -EINVAL;
-
-	error = gfs_dread(gl, GFS_SB_ADDR >> sdp->sd_fsb2bb_shift,
-			  DIO_START | DIO_WAIT, &bh);
-	if (!error) {
-		gfs_trans_add_bh(gl, bh);
-		gfs_sb_out(&sdp->sd_sb, bh->b_data);
-		brelse(bh);
-	}
-
-	gfs_glock_put(gl);
-
-	return error;
-}
-
-/**
- * inode_alloc_hidden - allocate on-disk inode for a special (hidden) file
- * @sdp:  the filesystem instance structure
- * @inum:  new dinode's block # and formal inode #, to be filled
- *         in by this function.
- *
- * Returns: errno
- *
- * This function is called only very rarely, when the first-to-mount
- * node can't find a pre-existing special file (e.g. license or quota file) that
- * it expects to find.  This should happen only when upgrading from an older
- * version of the filesystem.
- *
- * The @inum must be a member of sdp->sd_sb in order to get updated to on-disk
- * superblock properly.
- */
-
-static int
-inode_alloc_hidden(struct gfs_sbd *sdp, struct gfs_inum *inum)
-{
-	struct gfs_inode *dip = sdp->sd_rooti;
-	struct gfs_holder d_gh, i_gh;
-	struct gfs_unlinked *ul;
-	int error;
-
-	error = gfs_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh);
-	if (error)
-		return error;
-
-	error = dinode_alloc(dip, &ul);
-	if (error)
-		goto fail;
-
-	inum->no_addr = ul->ul_inum.no_addr;
-	pick_formal_ino(sdp, inum);
-
-	/* Don't worry about deadlock ordering here.  We're the first
-	   mounter and still under the mount lock (i.e. there is no
-	   contention). */
-
-	error = gfs_glock_nq_num(sdp,
-				 inum->no_formal_ino, &gfs_inode_glops,
-				 LM_ST_EXCLUSIVE, GL_SKIP, &i_gh);
-	if (error)
-		goto fail_ul;
-
-	gfs_alloc_get(dip);
-
-	error = gfs_quota_hold_m(dip, 0, 0);
-	if (error)
-		goto fail_al;
-
-	/* Trans may require:
-	   The new inode, the superblock,
-	   and one block for a quota change and
-	   one block for an unlinked tag. */
-      
-	error = gfs_trans_begin(sdp, 2, 2);
-	if (error)
-		goto fail_unhold;
-	
-	error = make_dinode(dip, i_gh.gh_gl, inum, GFS_FILE_REG, 0600, 0, 0);
-	if (error)
-		goto fail_end_trans;
-
-	/* Hidden files get all of their data (not just metadata) journaled */
-	iah_make_jdata(i_gh.gh_gl, inum);
-
-	error = iah_super_update(sdp);
-	if (error)
-		goto fail_end_trans;
-
-	gfs_trans_add_unlinked(sdp, GFS_LOG_DESC_IDA,
-			       &(struct gfs_inum){0, inum->no_addr});
-	gfs_trans_add_quota(sdp, +1, 0, 0);
-	gfs_trans_add_gl(dip->i_gl);
-
-	gfs_trans_end(sdp);
-	gfs_quota_unhold_m(dip);
-	gfs_alloc_put(dip);
-
-	gfs_glock_dq_uninit(&i_gh);
-	gfs_glock_dq_uninit(&d_gh);
-
-	gfs_unlinked_unlock(sdp, ul);
-
-	gfs_log_flush(sdp);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_unhold:
-	gfs_quota_unhold_m(dip);
-
- fail_al:
-	gfs_alloc_put(dip);
-	gfs_glock_dq_uninit(&i_gh);
-
- fail_ul:
-	gfs_unlinked_unlock(sdp, ul);
-
- fail:
-	gfs_glock_dq_uninit(&d_gh);
-
-	return error;
-}
-
-/**
- * gfs_alloc_qinode - allocate a quota inode
- * @sdp: The GFS superblock
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int
-gfs_alloc_qinode(struct gfs_sbd *sdp)
-{
-	return inode_alloc_hidden(sdp, &sdp->sd_sb.sb_quota_di);
-}
-
-/**
- * gfs_alloc_linode - allocate a license inode
- * @sdp: The GFS superblock
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int
-gfs_alloc_linode(struct gfs_sbd *sdp)
-{
-	return inode_alloc_hidden(sdp, &sdp->sd_sb.sb_license_di);
-}
diff --git a/gfs-kernel/src/gfs/inode.h b/gfs-kernel/src/gfs/inode.h
deleted file mode 100644
index 01f80b7..0000000
--- a/gfs-kernel/src/gfs/inode.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef __INODE_DOT_H__
-#define __INODE_DOT_H__
-
-void gfs_inode_attr_in(struct gfs_inode *ip);
-void gfs_inode_attr_out(struct gfs_inode *ip);
-struct inode *gfs_iget(struct gfs_inode *ip, int create);
-
-int gfs_copyin_dinode(struct gfs_inode *ip);
-
-int gfs_inode_get(struct gfs_glock *i_gl, struct gfs_inum *inum, int create,
-		    struct gfs_inode **ipp);
-void gfs_inode_hold(struct gfs_inode *ip);
-void gfs_inode_put(struct gfs_inode *ip);
-void gfs_inode_destroy(struct gfs_inode *ip);
-
-int gfs_inode_dealloc(struct gfs_sbd *sdp, struct gfs_inum *inum);
-
-int gfs_change_nlink(struct gfs_inode *ip, int diff);
-int gfs_lookupi(struct gfs_holder *d_gh, struct qstr *name,
-		int is_root, struct gfs_holder *i_gh);
-int gfs_createi(struct gfs_holder *d_gh, struct qstr *name,
-		unsigned int type, unsigned int mode,
-		struct gfs_holder *i_gh);
-int gfs_unlinki(struct gfs_inode *dip, struct qstr *name, struct gfs_inode *ip);
-int gfs_rmdiri(struct gfs_inode *dip, struct qstr *name, struct gfs_inode *ip);
-int gfs_unlink_ok(struct gfs_inode *dip, struct qstr *name,
-		  struct gfs_inode *ip);
-int gfs_ok_to_move(struct gfs_inode *this, struct gfs_inode *to);
-int gfs_readlinki(struct gfs_inode *ip, char **buf, unsigned int *len);
-
-int gfs_glock_nq_atime(struct gfs_holder *gh);
-int gfs_glock_nq_m_atime(unsigned int num_gh, struct gfs_holder *ghs);
-
-void gfs_try_toss_vnode(struct gfs_inode *ip);
-
-int gfs_setattr_simple(struct gfs_inode *ip, struct iattr *attr);
-
-/*  Backwards compatibility functions  */
-
-int gfs_alloc_qinode(struct gfs_sbd *sdp);
-int gfs_alloc_linode(struct gfs_sbd *sdp);
-
-/*  Inlines  */
-
-static __inline__ int
-gfs_is_stuffed(struct gfs_inode *ip)
-{
-	return !ip->i_di.di_height;
-}
-
-static __inline__ int
-gfs_is_jdata(struct gfs_inode *ip)
-{
-	return ip->i_di.di_flags & GFS_DIF_JDATA;
-}
-
-#endif /* __INODE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ioctl.c b/gfs-kernel/src/gfs/ioctl.c
deleted file mode 100644
index afc08f0..0000000
--- a/gfs-kernel/src/gfs/ioctl.c
+++ /dev/null
@@ -1,1607 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-#include <linux/compat.h>
-#include <linux/cred.h>
-#include <linux/vmalloc.h>
-
-#include "gfs_ioctl.h"
-#include "gfs.h"
-#include "bmap.h"
-#include "dio.h"
-#include "dir.h"
-#include "eattr.h"
-#include "file.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "ioctl.h"
-#include "log.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "super.h"
-#include "trans.h"
-
-typedef int (*gi_filler_t) (struct gfs_inode *ip,
-			    struct gfs_ioctl *gi,
-			    char *buf,
-			    unsigned int size,
-			    unsigned int *count);
-
-#define ARG_SIZE (32)
-
-/**
- * gi_skeleton - Setup a buffer that functions can print into
- * @ip:
- * @gi:
- * @filler:
- *
- * Returns: -errno or count of bytes copied to userspace
- */
-
-static int
-gi_skeleton(struct gfs_inode *ip, struct gfs_ioctl *gi,
-	    gi_filler_t filler)
-{
-	unsigned int size = gfs_tune_get(ip->i_sbd, gt_lockdump_size);
-        char *buf;
-	unsigned int count = 0;
-        int error;
-
-	if (size > gi->gi_size)
-		size = gi->gi_size;
-
-        buf = vmalloc(size);
-        if (!buf)
-                return -ENOMEM;
-
-        error = filler(ip, gi, buf, size, &count);
-	if (error)
-		goto out;
-
-	if (copy_to_user(gi->gi_data, buf, count + 1))
-		error = -EFAULT;
-	else
-		error = count + 1;
-
- out:
-	vfree(buf);
-
-	return error;
-}
-
-/**
- * gi_get_cookie - Return the "cookie" (identifying string) for a
- *                 filesystem mount
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_get_cookie(struct gfs_inode *ip,
-	      struct gfs_ioctl *gi,
-	      char *buf,
-	      unsigned int size,
-	      unsigned int *count)
-{
-        int error = -ENOBUFS;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	gfs_printf("version 0\n");
-        gfs_printf("%lu", (unsigned long)ip->i_sbd);
-
-        error = 0;
-
- out:
-        return error;
-}
-
-/**
- * gi_get_super - Return the "struct gfs_sb" for a filesystem
- * @sdp:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_get_super(struct gfs_sbd *sdp, struct gfs_ioctl *gi)
-{
-	struct gfs_holder sb_gh;
-	struct buffer_head *bh;
-	struct gfs_sb *sb;
-	int error;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-	if (gi->gi_size != sizeof(struct gfs_sb))
-		return -EINVAL;
-
-	sb = kmalloc(sizeof(struct gfs_sb), GFP_KERNEL);
-	if (!sb)
-		return -ENOMEM;
-
-	error = gfs_glock_nq_num(sdp,
-				 GFS_SB_LOCK, &gfs_meta_glops,
-				 LM_ST_SHARED, 0, &sb_gh);
-	if (error)
-		goto out;
-
-	error = gfs_dread(sb_gh.gh_gl, GFS_SB_ADDR >> sdp->sd_fsb2bb_shift,
-			  DIO_START | DIO_WAIT, &bh);
-	if (error) {
-		gfs_glock_dq_uninit(&sb_gh);
-		goto out;
-	}
-	gfs_sb_in(sb, bh->b_data);
-	brelse(bh);
-
-	gfs_glock_dq_uninit(&sb_gh);
-
-	if (copy_to_user(gi->gi_data, sb,
-			 sizeof(struct gfs_sb)))
-	        error = -EFAULT;
-	else
-		error = sizeof(struct gfs_sb);
-
- out:
-	kfree(sb);
-
-	return error;
-}
-
-/**
- * gi_get_args - Return the mount arguments
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_get_args(struct gfs_inode *ip,
-	    struct gfs_ioctl *gi,
-	    char *buf,
-	    unsigned int size,
-	    unsigned int *count)
-{
-	struct gfs_args *args = &ip->i_sbd->sd_args;
-	int error = -ENOBUFS;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	gfs_printf("version 0\n");
-	gfs_printf("lockproto %s\n", args->ar_lockproto);
-	gfs_printf("locktable %s\n", args->ar_locktable);
-	gfs_printf("hostdata %s\n", args->ar_hostdata);
-	gfs_printf("ignore_local_fs %d\n", args->ar_ignore_local_fs);
-	gfs_printf("localcaching %d\n", args->ar_localcaching);
-        gfs_printf("localflocks %d\n", args->ar_localflocks);
-        gfs_printf("oopses_ok %d\n", args->ar_oopses_ok);
-        gfs_printf("upgrade %d\n", args->ar_upgrade);
-	gfs_printf("num_glockd %u\n", args->ar_num_glockd);
-        gfs_printf("posix_acls %d\n", args->ar_posix_acls);
-        gfs_printf("suiddir %d\n", args->ar_suiddir);
-
-	error = 0;
-	
- out:
-	return error;
-}
-
-/**
- * gi_get_lockstruct - Return the information in the FS' lockstruct
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_get_lockstruct(struct gfs_inode *ip,
-		  struct gfs_ioctl *gi,
-		  char *buf,
-		  unsigned int size,
-		  unsigned int *count)
-{
-	struct lm_lockstruct *ls = &ip->i_sbd->sd_lockstruct;
-        int error = -ENOBUFS;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	gfs_printf("version 0\n");
-        gfs_printf("jid %u\n", ls->ls_jid);
-        gfs_printf("first %u\n", ls->ls_first);
-        gfs_printf("lvb_size %u\n", ls->ls_lvb_size);
-        gfs_printf("flags %d\n", ls->ls_flags);
-
-	error = 0;
-
- out:
-        return error;
-}
-
-/**
- * gi_get_stat_gfs - Return a filesystem's space usage information
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_get_stat_gfs(struct gfs_inode *ip,
-		struct gfs_ioctl *gi,
-		char *buf,
-		unsigned int size,
-		unsigned int *count)
-{
-	struct gfs_stat_gfs sg;
-        int error;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	error = gfs_stat_gfs(ip->i_sbd, &sg, TRUE);
-	if (error)
-		return error;
-
-	error = -ENOBUFS;
-
-	gfs_printf("version 0\n");
-	gfs_printf("bsize %u\n", ip->i_sbd->sd_sb.sb_bsize);
-        gfs_printf("total_blocks %llu\n", (unsigned long long)sg.sg_total_blocks);
-        gfs_printf("free %llu\n", (unsigned long long)sg.sg_free);
-        gfs_printf("used_dinode %llu\n", (unsigned long long)sg.sg_used_dinode);
-        gfs_printf("free_dinode %llu\n", (unsigned long long)sg.sg_free_dinode);
-        gfs_printf("used_meta %llu\n", (unsigned long long)sg.sg_used_meta);
-        gfs_printf("free_meta %llu\n", (unsigned long long)sg.sg_free_meta);
-
-	error = 0;
-
- out:
-        return error;
-}
-
-/**
- * handle_roll - Read a atomic_t as an unsigned int
- * @a: a counter
- *
- * if @a is negative, reset it to zero
- *
- * Returns: the value of the counter
- */
-
-static unsigned int
-handle_roll(atomic_t *a)
-{
-	int x = atomic_read(a);
-	if (x < 0) {
-		atomic_set(a, 0);
-		return 0;
-	}
-	return (unsigned int)x;
-}
-
-/**
- * gi_get_counters - Return usage counters
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_get_counters(struct gfs_inode *ip,
-		struct gfs_ioctl *gi,
-		char *buf,
-		unsigned int size,
-		unsigned int *count)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-        int error = -ENOBUFS;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	gfs_printf("version 0\n");
-	gfs_printf("sd_glock_count:locks::%d\n",
-		   atomic_read(&sdp->sd_glock_count));
-	gfs_printf("sd_glock_held_count:locks held::%d\n",
-		   atomic_read(&sdp->sd_glock_held_count));
-	gfs_printf("sd_freeze_count:freeze count::%d\n",
-		   sdp->sd_freeze_count);
-	gfs_printf("sd_inode_count:incore inodes::%d\n",
-		   atomic_read(&sdp->sd_inode_count));
-	gfs_printf("sd_bufdata_count:metadata buffers::%d\n",
-		   atomic_read(&sdp->sd_bufdata_count));
-	gfs_printf("sd_unlinked_ic_count:unlinked inodes::%d\n",
-		   atomic_read(&sdp->sd_unlinked_ic_count));
-	gfs_printf("sd_quota_count:quota IDs::%d\n",
-		   atomic_read(&sdp->sd_quota_count));
-	gfs_printf("sd_log_buffers:incore log buffers::%u\n",
-		   sdp->sd_log_buffers);
-	gfs_printf("sd_log_seg_free:log segments free::%u\n",
-		   sdp->sd_log_seg_free);
-	gfs_printf("ji_nsegment:log segments total::%u\n",
-		   sdp->sd_jdesc.ji_nsegment);
-	gfs_printf("sd_mhc_count:meta header cache entries::%d\n",
-		   atomic_read(&sdp->sd_mhc_count));
-	gfs_printf("sd_depend_count:glock dependencies::%d\n",
-		   atomic_read(&sdp->sd_depend_count));
-	gfs_printf("sd_reclaim_count:glocks on reclaim list::%d\n",
-		   atomic_read(&sdp->sd_reclaim_count));
-	gfs_printf("sd_log_wrap:log wraps::%llu\n",
-		   (unsigned long long)sdp->sd_log_wrap);
-	gfs_printf("sd_lm_outstanding:outstanding LM calls::%d\n",
-		   atomic_read(&sdp->sd_lm_outstanding));
-	gfs_printf("sd_bio_outstanding:outstanding BIO calls::%u\n",
-		   atomic_read(&sdp->sd_bio_outstanding));
-	gfs_printf("sd_fh2dentry_misses:fh2dentry misses:diff:%u\n",
-		   handle_roll(&sdp->sd_fh2dentry_misses));
-	gfs_printf("sd_reclaimed:glocks reclaimed:diff:%u\n",
-		   handle_roll(&sdp->sd_reclaimed));
-	gfs_printf("sd_glock_nq_calls:glock nq calls:diff:%u\n",
-		   handle_roll(&sdp->sd_glock_nq_calls));
-	gfs_printf("sd_glock_dq_calls:glock dq calls:diff:%u\n",
-		   handle_roll(&sdp->sd_glock_dq_calls));
-	gfs_printf("sd_glock_prefetch_calls:glock prefetch calls:diff:%u\n",
-		   handle_roll(&sdp->sd_glock_prefetch_calls));
-	gfs_printf("sd_lm_lock_calls:lm_lock calls:diff:%u\n",
-		   handle_roll(&sdp->sd_lm_lock_calls));
-	gfs_printf("sd_lm_unlock_calls:lm_unlock calls:diff:%u\n",
-		   handle_roll(&sdp->sd_lm_unlock_calls));
-	gfs_printf("sd_lm_callbacks:lm callbacks:diff:%u\n",
-		   handle_roll(&sdp->sd_lm_callbacks));
-	gfs_printf("sd_ops_address:address operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_address));
-	gfs_printf("sd_ops_dentry:dentry operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_dentry));
-	gfs_printf("sd_ops_export:export operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_export));
-	gfs_printf("sd_ops_file:file operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_file));
-	gfs_printf("sd_ops_inode:inode operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_inode));
-	gfs_printf("sd_ops_super:super operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_super));
-	gfs_printf("sd_ops_vm:vm operations:diff:%u\n",
-		   handle_roll(&sdp->sd_ops_vm));
-	gfs_printf("sd_bio_reads:block I/O reads:diff:%u\n",
-		   handle_roll(&sdp->sd_bio_reads) >>
-		   (sdp->sd_sb.sb_bsize_shift - 9));
-	gfs_printf("sd_bio_writes:block I/O writes:diff:%u\n",
-		   handle_roll(&sdp->sd_bio_writes) >>
-		   (sdp->sd_sb.sb_bsize_shift - 9));
-
-        error = 0;
-
- out:
-        return error;
-}
-
-/**
- * gi_get_tune - Return current values of the tuneable parameters
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_get_tune(struct gfs_inode *ip,
-	    struct gfs_ioctl *gi,
-	    char *buf,
-	    unsigned int size,
-	    unsigned int *count)
-{
-	struct gfs_tune *gt = &ip->i_sbd->sd_tune;
-	int error = -ENOBUFS;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	spin_lock(&gt->gt_spin);
-
-	gfs_printf("version 0\n");
-        gfs_printf("ilimit1 %u\n", gt->gt_ilimit1);
-        gfs_printf("ilimit1_tries %u\n", gt->gt_ilimit1_tries);
-        gfs_printf("ilimit1_min %u\n", gt->gt_ilimit1_min);
-        gfs_printf("ilimit2 %u\n", gt->gt_ilimit2);
-        gfs_printf("ilimit2_tries %u\n", gt->gt_ilimit2_tries);
-        gfs_printf("ilimit2_min %u\n", gt->gt_ilimit2_min);
-        gfs_printf("demote_secs %u\n", gt->gt_demote_secs);
-        gfs_printf("incore_log_blocks %u\n", gt->gt_incore_log_blocks);
-        gfs_printf("jindex_refresh_secs %u\n", gt->gt_jindex_refresh_secs);
-        gfs_printf("depend_secs %u\n", gt->gt_depend_secs);
-        gfs_printf("scand_secs %u\n", gt->gt_scand_secs);
-        gfs_printf("recoverd_secs %u\n", gt->gt_recoverd_secs);
-        gfs_printf("logd_secs %u\n", gt->gt_logd_secs);
-        gfs_printf("quotad_secs %u\n", gt->gt_quotad_secs);
-        gfs_printf("inoded_secs %u\n", gt->gt_inoded_secs);
-        gfs_printf("glock_purge %u\n", gt->gt_glock_purge);
-        gfs_printf("quota_simul_sync %u\n", gt->gt_quota_simul_sync);
-        gfs_printf("quota_warn_period %u\n", gt->gt_quota_warn_period);
-        gfs_printf("atime_quantum %u\n", gt->gt_atime_quantum);
-        gfs_printf("quota_quantum %u\n", gt->gt_quota_quantum);
-        gfs_printf("quota_scale_num %u\n", gt->gt_quota_scale_num);
-        gfs_printf("quota_scale_den %u\n", gt->gt_quota_scale_den);
-        gfs_printf("quota_enforce %u\n", gt->gt_quota_enforce);
-        gfs_printf("quota_account %u\n", gt->gt_quota_account);
-        gfs_printf("new_files_jdata %u\n", gt->gt_new_files_jdata);
-        gfs_printf("new_files_directio %u\n", gt->gt_new_files_directio);
-        gfs_printf("max_atomic_write %u\n", gt->gt_max_atomic_write);
-        gfs_printf("max_readahead %u\n", gt->gt_max_readahead);
-        gfs_printf("lockdump_size %u\n", gt->gt_lockdump_size);
-        gfs_printf("stall_secs %u\n", gt->gt_stall_secs);
-        gfs_printf("complain_secs %u\n", gt->gt_complain_secs);
-        gfs_printf("reclaim_limit %u\n", gt->gt_reclaim_limit);
-        gfs_printf("entries_per_readdir %u\n", gt->gt_entries_per_readdir);
-        gfs_printf("prefetch_secs %u\n", gt->gt_prefetch_secs);
-        gfs_printf("statfs_slots %u\n", gt->gt_statfs_slots);
-        gfs_printf("max_mhc %u\n", gt->gt_max_mhc);
-        gfs_printf("greedy_default %u\n", gt->gt_greedy_default);
-        gfs_printf("greedy_quantum %u\n", gt->gt_greedy_quantum);
-        gfs_printf("greedy_max %u\n", gt->gt_greedy_max);
-        gfs_printf("rgrp_try_threshold %u\n", gt->gt_rgrp_try_threshold);
-        gfs_printf("statfs_fast %u\n", gt->gt_statfs_fast);
-
-        error = 0;
-
- out:
-	spin_unlock(&gt->gt_spin);
-
-        return error;
-}
-
-#define tune_set(f, v) \
-do { \
-	spin_lock(&gt->gt_spin); \
-	gt->f = (v); \
-	spin_unlock(&gt->gt_spin); \
-} while (0)
-
-/**
- * gi_set_tune - Set a tuneable parameter
- * @sdp:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_set_tune(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	struct gfs_tune *gt = &sdp->sd_tune;
- 	char param[ARG_SIZE], value[ARG_SIZE];
-	unsigned int x;
-	int error;
-
-	if (!capable(CAP_SYS_ADMIN))
-                return -EACCES;
-	if (gi->gi_argc != 3)
-		return -EINVAL;
-
-	if (from_user) {
-		if (strncpy_from_user(param, gi->gi_argv[1], ARG_SIZE) < 0)
-			return -EFAULT;
-	} else {
-		strncpy(param, gi->gi_argv[1], ARG_SIZE);
-	}
-	param[ARG_SIZE - 1] = 0;
-
-	if (from_user) {
-		if (strncpy_from_user(value, gi->gi_argv[2], ARG_SIZE) < 0)
-			return -EFAULT;
-	} else {
-		strncpy(value, gi->gi_argv[2], ARG_SIZE);
-	}
-
-	value[ARG_SIZE - 1] = 0;
-
-	if (strcmp(param, "ilimit1") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_ilimit1, x);
-
-	} else if (strcmp(param, "ilimit1_tries") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_ilimit1_tries, x);
-
-	} else if (strcmp(param, "ilimit1_min") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_ilimit1_min, x);
-
-	} else if (strcmp(param, "ilimit2") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_ilimit2, x);
-
-	} else if (strcmp(param, "ilimit2_tries") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_ilimit2_tries, x);
-
-	} else if (strcmp(param, "ilimit2_min") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_ilimit2_min, x);
-
-	} else if (strcmp(param, "demote_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_demote_secs, x);
-
-	} else if (strcmp(param, "incore_log_blocks") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_incore_log_blocks, x);
-
-	} else if (strcmp(param, "jindex_refresh_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_jindex_refresh_secs, x);
-
-	} else if (strcmp(param, "depend_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_depend_secs, x);
-
-	} else if (strcmp(param, "scand_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_scand_secs, x);
-		wake_up_process(sdp->sd_scand_process);
-
-	} else if (strcmp(param, "recoverd_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_recoverd_secs, x);
-		wake_up_process(sdp->sd_recoverd_process);
-
-	} else if (strcmp(param, "logd_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_logd_secs, x);
-		wake_up_process(sdp->sd_logd_process);
-
-	} else if (strcmp(param, "quotad_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_quotad_secs, x);
-		wake_up_process(sdp->sd_quotad_process);
-
-	} else if (strcmp(param, "inoded_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_inoded_secs, x);
-		wake_up_process(sdp->sd_inoded_process);
-
-	} else if (strcmp(param, "glock_purge") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_glock_purge, x);
-
-	} else if (strcmp(param, "quota_simul_sync") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_quota_simul_sync, x);
-
-	} else if (strcmp(param, "quota_warn_period") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_quota_warn_period, x);
-
-	} else if (strcmp(param, "atime_quantum") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_atime_quantum, x);
-
-	} else if (strcmp(param, "quota_quantum") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_quota_quantum, x);
-
-	} else if (strcmp(param, "quota_scale") == 0) {
-		unsigned int y;
-		if (sscanf(value, "%u %u", &x, &y) != 2 || !y)
-			return -EINVAL;
-		spin_lock(&gt->gt_spin);
-		gt->gt_quota_scale_num = x;
-		gt->gt_quota_scale_den = y;
-		spin_unlock(&gt->gt_spin);
-
-	} else if (strcmp(param, "quota_enforce") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		x = !!x;
-		spin_lock(&gt->gt_spin);
-		gt->gt_quota_enforce = x;
-		if (x)
-			gt->gt_quota_account = 1;
-		spin_unlock(&gt->gt_spin);
-
-	} else if (strcmp(param, "quota_account") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		x = !!x;
-		spin_lock(&gt->gt_spin);
-		gt->gt_quota_account = x;
-		if (x)
-			spin_unlock(&gt->gt_spin);
-		else {
-			unsigned int y;
-			gt->gt_quota_enforce = 0;
-			spin_unlock(&gt->gt_spin);
-			for (y = 0; y < 2; y++) {
-				gfs_log_flush(sdp);
-				gfs_sync_meta(sdp);
-				gfs_quota_sync(sdp);
-			}
-		}
-
-	} else if (strcmp(param, "new_files_jdata") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		x = !!x;
-		tune_set(gt_new_files_jdata, x);
-
-	} else if (strcmp(param, "new_files_directio") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		x = !!x;
-		tune_set(gt_new_files_directio, x);
-
-	} else if (strcmp(param, "max_atomic_write") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_max_atomic_write, x);
-
-	} else if (strcmp(param, "max_readahead") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_max_readahead, x);
-
-	} else if (strcmp(param, "lockdump_size") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_lockdump_size, x);
-
-	} else if (strcmp(param, "stall_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_stall_secs, x);
-
-	} else if (strcmp(param, "complain_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_complain_secs, x);
-
-	} else if (strcmp(param, "reclaim_limit") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_reclaim_limit, x);
-
-	} else if (strcmp(param, "entries_per_readdir") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_entries_per_readdir, x);
-
-	} else if (strcmp(param, "prefetch_secs") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_prefetch_secs, x);
-
-	} else if (strcmp(param, "statfs_slots") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_statfs_slots, x);
-
-	} else if (strcmp(param, "max_mhc") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_max_mhc, x);
-
-	} else if (strcmp(param, "greedy_default") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_greedy_default, x);
-
-	} else if (strcmp(param, "greedy_quantum") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_greedy_quantum, x);
-
-	} else if (strcmp(param, "greedy_max") == 0) {
-		if (sscanf(value, "%u", &x) != 1 || !x)
-			return -EINVAL;
-		tune_set(gt_greedy_max, x);
-
-	} else if (strcmp(param, "rgrp_try_threshold") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		tune_set(gt_rgrp_try_threshold, x);
-
-	} else if (strcmp(param, "statfs_fast") == 0) {
-		if (sscanf(value, "%u", &x) != 1)
-			return -EINVAL;
-		error = gfs_statfs_init(sdp, x);
-		if (error)
-			return error;
-		else
-			tune_set(gt_statfs_fast, x);
-
-
-	} else
-		return -EINVAL;
-
-	return 0;
-}
-
-/**
- * gi_do_reclaim - Reclaim unused metadata
- * @ip:
- * @gi:
- * @buf:
- * @size:
- * @count:
- *
- * Returns: errno
- */ 
-
-static int
-gi_do_reclaim(struct gfs_inode *ip,
-	      struct gfs_ioctl *gi,
-	      char *buf,
-	      unsigned int size,
-	      unsigned int *count)
-{
-	uint64_t inodes, metadata;
-        int error;
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	error = gfs_reclaim_metadata(ip->i_sbd,
-				     &inodes,
-				     &metadata);
-	if (error)
-		return error;
-
-	error = -ENOBUFS;
-
-	gfs_printf("version 0\n");
-        gfs_printf("inodes %llu\n", (unsigned long long)inodes);
-        gfs_printf("metadata %llu\n", (unsigned long long)metadata);
-
-        error = 0;
-
- out:
-        return error;
-}
-
-/**
- * gi_do_shrink - throw out unused glocks
- * @sdp:
- * @gi:
- *
- * Returns: 0
- */
-
-static int
-gi_do_shrink(struct gfs_sbd *sdp, struct gfs_ioctl *gi)
-{
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-	gfs_gl_hash_clear(sdp, FALSE);
-	return 0;
-}
-
-/**
- * gi_get_file_stat -
- * @ip:
- * @gi:
- *
- * Returns: the number of bytes copied, or -errno
- */
-
-static int
-gi_get_file_stat(struct gfs_inode *ip, struct gfs_ioctl *gi)
-{
-	struct gfs_holder i_gh;
-	struct gfs_dinode *di;
-	int error;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-	if (gi->gi_size != sizeof(struct gfs_dinode))
-		return -EINVAL;
-
-	di = kmalloc(sizeof(struct gfs_dinode), GFP_KERNEL);
-	if (!di)
-		return -ENOMEM;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-	if (error)
-		goto out;
-	memcpy(di, &ip->i_di, sizeof(struct gfs_dinode));
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (copy_to_user(gi->gi_data, di,
-			 sizeof(struct gfs_dinode)))
-		error = -EFAULT;
-	else
-		error = sizeof(struct gfs_dinode);
-
- out:
-	kfree(di);
-
-	return error;
-}
-
-/**
- * gi_set_file_flag - set or clear a flag on a file
- * @ip:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_set_file_flag(struct gfs_inode *ip, struct gfs_ioctl *gi, int from_user)
-{
-	char buf[ARG_SIZE];
-	int set;
-	uint32_t flag;
-	struct gfs_holder i_gh;
-	struct buffer_head *dibh;
-	int error;
-
-	if (gi->gi_argc != 3)
-		return -EINVAL;
-
-	if (from_user) {
-		if (strncpy_from_user(buf, gi->gi_argv[1], ARG_SIZE) < 0)
-			return -EFAULT;
-	} else {
-		strncpy(buf, gi->gi_argv[1], ARG_SIZE);
-	}
-	buf[ARG_SIZE - 1] = 0;
-
-	if (strcmp(buf, "set") == 0)
-		set = TRUE;
-	else if (strcmp(buf, "clear") == 0)
-		set = FALSE;
-	else
-		return -EINVAL;
-
-	if (from_user) {
-		if (strncpy_from_user(buf, gi->gi_argv[2], ARG_SIZE) < 0)
-			return -EFAULT;
-	} else {
-		strncpy(buf, gi->gi_argv[2], ARG_SIZE);
-	}
-        buf[ARG_SIZE - 1] = 0;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
-	if (error)
-		return error;
-
-	error = -EACCES;
-	if (ip->i_di.di_uid != current_fsuid() && !capable(CAP_FOWNER))
-		goto out;
-
-	error = -EINVAL;
-
-	if (strcmp(buf, "jdata") == 0) {
-		if (ip->i_di.di_type != GFS_FILE_REG ||
-		    ip->i_di.di_size)
-			goto out;
-		flag = GFS_DIF_JDATA;
-	} else if (strcmp(buf, "directio") == 0) {
-		if (ip->i_di.di_type != GFS_FILE_REG)
-			goto out;
-		flag = GFS_DIF_DIRECTIO;
-	} else if (strcmp(buf, "immutable") == 0) {
-		/* The IMMUTABLE flag can only be changed by
-		   the relevant capability. */
-		error = -EPERM;
-		if (!capable(CAP_LINUX_IMMUTABLE))
-			goto out;
-		flag = GFS_DIF_IMMUTABLE;
-	} else if (strcmp(buf, "appendonly") == 0) {
-                /* The APPENDONLY flag can only be changed by
-                   the relevant capability. */
-                error = -EPERM;
-                if (!capable(CAP_LINUX_IMMUTABLE))
-                        goto out;
-		flag = GFS_DIF_APPENDONLY;
-	} else if (strcmp(buf, "inherit_jdata") == 0) {
-		if (ip->i_di.di_type != GFS_FILE_DIR) 
-			goto out;
-		flag = GFS_DIF_INHERIT_JDATA;
-	} else if (strcmp(buf, "inherit_directio") == 0) {
-		if (ip->i_di.di_type != GFS_FILE_DIR)
-			goto out;
-                flag = GFS_DIF_INHERIT_DIRECTIO;
-	} else
-		goto out;
-
-	error = gfs_trans_begin(ip->i_sbd, 1, 0);
-	if (error)
-		goto out;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto out_trans_end;
-
-	if (set)
-		ip->i_di.di_flags |= flag;
-	else
-		ip->i_di.di_flags &= ~flag;
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-
-	brelse(dibh);
-
- out_trans_end:
-	gfs_trans_end(ip->i_sbd);
-
- out:
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-
-}
-
-/**
- * gi_get_file_meta - Return all the metadata for a file
- * @ip:
- * @gi:
- *
- * Returns: the number of bytes copied, or -errno
- */
-
-static int
-gi_get_file_meta(struct gfs_inode *ip, struct gfs_ioctl *gi)
-{
-	struct gfs_holder i_gh;
-	struct gfs_user_buffer ub;
-	int error;
-
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-
-	ub.ub_data = gi->gi_data;
-	ub.ub_size = gi->gi_size;
-	ub.ub_count = 0;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-	if (error)
-		return error;
-
-        error = -EACCES;
-        if (ip->i_di.di_uid != current_fsuid() && !capable(CAP_FOWNER))
-                goto out;
-
-	error = gfs_get_file_meta(ip, &ub);
-	if (error)
-		goto out;
-
-	if (ip->i_di.di_type == GFS_FILE_DIR &&
-	    (ip->i_di.di_flags & GFS_DIF_EXHASH)) {
-		error = gfs_get_dir_meta(ip, &ub);
-		if (error)
-			goto out;
-	}
-
-	if (ip->i_di.di_eattr) {
-		error = gfs_get_eattr_meta(ip, &ub);
-		if (error)
-			goto out;
-	}
-
-	error = ub.ub_count;
-
- out:
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gi_do_file_flush - sync out all dirty data and
- *                    drop the cache (and lock) for a file.
- * @ip:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_do_file_flush(struct gfs_inode *ip, struct gfs_ioctl *gi)
-{
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-	gfs_glock_force_drop(ip->i_gl);
-	return 0;
-}
-
-/**
- * gi2hip - return the "struct gfs_inode" for a hidden file
- * @sdp:
- * @gi:
- *
- * Returns: the "struct gfs_inode"
- */
-
-static struct gfs_inode *
-gi2hip(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	char buf[ARG_SIZE];
-
-	if (gi->gi_argc != 2)
-		return ERR_PTR(-EINVAL);
-
-	if (from_user) {
-		if (strncpy_from_user(buf, gi->gi_argv[1], ARG_SIZE) < 0)
-			return ERR_PTR(-EFAULT);
-	} else {
-		strncpy(buf, gi->gi_argv[1], ARG_SIZE);
-	}
-        buf[ARG_SIZE - 1] = 0;
-
-	if (strcmp(buf, "jindex") == 0)
-		return sdp->sd_jiinode;
-	else if (strcmp(buf, "rindex") == 0)
-		return sdp->sd_riinode;
-	else if (strcmp(buf, "quota") == 0)
-		return sdp->sd_qinode;
-	else if (strcmp(buf, "license") == 0)
-		return sdp->sd_linode;
-	else
-		return ERR_PTR(-EINVAL);
-}
-
-/**
- * gi_get_hfile_stat - get stat info on a hidden file
- * @sdp:
- * @gi:
- *
- * Returns: the number of bytes copied, or -errno
- */
-
-static int
-gi_get_hfile_stat(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	struct gfs_inode *ip;
-	struct gfs_dinode *di;
-	struct gfs_holder i_gh;
-	int error;
-
-	ip = gi2hip(sdp, gi, from_user);
-	if (IS_ERR(ip))
-		return PTR_ERR(ip);
-
-	if (gi->gi_size != sizeof(struct gfs_dinode))
-		return -EINVAL;
-
-        di = kmalloc(sizeof(struct gfs_dinode), GFP_KERNEL);
-        if (!di)
-                return -ENOMEM;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-	if (error)
-		goto out;
-	memcpy(di, &ip->i_di, sizeof(struct gfs_dinode));
-	gfs_glock_dq_uninit(&i_gh);
-
-        if (copy_to_user(gi->gi_data, di,
-                         sizeof(struct gfs_dinode)))
-                error = -EFAULT;
-        else
-                error = sizeof(struct gfs_dinode);
-
- out:
-	kfree(di);
-
-	return error;
-}
-
-/**
- * gi_do_hfile_read - Read data from a hidden file
- * @sdp:
- * @gi:
- *
- * Returns: the number of bytes read, or -errno
- */
-
-static int
-gi_do_hfile_read(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	struct gfs_inode *ip;
-	struct gfs_holder i_gh;
-	int error;
-
-        if (!capable(CAP_SYS_ADMIN))
-                return -EACCES;
-
-	ip = gi2hip(sdp, gi, from_user);
-	if (IS_ERR(ip))
-		return PTR_ERR(ip);
-
-	if (!access_ok(VERIFY_WRITE, gi->gi_data, gi->gi_size))
-		return -EFAULT;
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &i_gh);
-	if (error)
-		return error;
-
-	error = gfs_readi(ip, gi->gi_data, gi->gi_offset, gi->gi_size,
-			  gfs_copy2user);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gi_do_hfile_write - Write data to a hidden file
- * @sdp:
- * @gi:
- *
- * Returns: the number of bytes written, or -errno
- */
-
-static int
-gi_do_hfile_write(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	struct gfs_inode *ip;
-	struct gfs_alloc *al = NULL;
-	struct gfs_holder i_gh;
-	unsigned int data_blocks, ind_blocks;
-	int alloc_required;
-	int error;
-
-        if (!capable(CAP_SYS_ADMIN))
-                return -EACCES;
-
-	ip = gi2hip(sdp, gi, from_user);
-	if (IS_ERR(ip))
-		return PTR_ERR(ip);
-
-	if (!access_ok(VERIFY_READ, gi->gi_data, gi->gi_size))
-		return -EFAULT;
-
-	gfs_write_calc_reserv(ip, gi->gi_size, &data_blocks, &ind_blocks);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE,
-				 LM_FLAG_PRIORITY | GL_SYNC | GL_NOCANCEL_OTHER,
-				 &i_gh);
-	if (error)
-		return error;
-
-        if (!gfs_is_jdata(ip)) {
-                gfs_consist_inode(ip);
-		error = -EIO;
-		goto out;
-        }
-
-	error = gfs_write_alloc_required(ip, gi->gi_offset, gi->gi_size,
-					 &alloc_required);
-	if (error)
-		goto out;
-
-	if (alloc_required) {
-		al = gfs_alloc_get(ip);
-
-		error = gfs_quota_hold_m(ip, NO_QUOTA_CHANGE,
-					 NO_QUOTA_CHANGE);
-		if (error)
-			goto out_alloc;
-
-		al->al_requested_meta = ind_blocks + data_blocks;
-
-		error = gfs_inplace_reserve(ip);
-		if (error)
-			goto out_qs;
-
-		/* Trans may require:
-		   All blocks for a RG bitmap, all the "data" blocks, whatever
-		   indirect blocks we need, a modified dinode, and a quota change */
-
-		error = gfs_trans_begin(sdp,
-					1 + al->al_rgd->rd_ri.ri_length +
-					ind_blocks + data_blocks, 1);
-		if (error)
-			goto out_relse;
-	} else {
-		/* Trans may require:
-		   All the "data" blocks and a modified dinode. */
-
-		error = gfs_trans_begin(sdp, 1 + data_blocks, 0);
-		if (error)
-			goto out_relse;
-	}
-
-	if (from_user)
-		error = gfs_writei(ip, gi->gi_data, gi->gi_offset, gi->gi_size,
-				   gfs_copy_from_user, NULL);
-	else
-		error = gfs_writei(ip, gi->gi_data, gi->gi_offset, gi->gi_size,
-				   gfs_copy_from_mem, NULL);
-
-	gfs_trans_end(sdp);
-
- out_relse:
-	if (alloc_required) {
-		gfs_assert_warn(sdp, error || al->al_alloced_meta);
-		gfs_inplace_release(ip);
-	}
-
- out_qs:
-	if (alloc_required)
-		gfs_quota_unhold_m(ip);
-
- out_alloc:
-	if (alloc_required)
-		gfs_alloc_put(ip);
-
- out:
-	ip->i_gl->gl_vn++;
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gi_do_hfile_trunc - truncate a hidden file
- * @sdp:
- * @gi:
- *
- * Returns: the number of bytes copied, or -errno
- */
-
-static int
-gi_do_hfile_trunc(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	struct gfs_inode *ip;
-	struct gfs_holder i_gh;
-	int error;
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-
-	ip = gi2hip(sdp, gi, from_user);
-	if (IS_ERR(ip))
-		return PTR_ERR(ip);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SYNC, &i_gh);
-	if (error)
-		return error;
-
-	error = gfs_truncatei(ip, gi->gi_offset, NULL);
-
-	ip->i_gl->gl_vn++;
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gi_do_quota_sync - sync the outstanding quota changes for a FS
- * @sdp:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_do_quota_sync(struct gfs_sbd *sdp, struct gfs_ioctl *gi)
-{
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-	if (gi->gi_argc != 1)
-		return -EINVAL;
-	return gfs_quota_sync(sdp);
-}
-
-/**
- * gi_do_quota_refresh - Refresh the a quota LVB from the quota file
- * @sdp:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_do_quota_refresh(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	char buf[ARG_SIZE];
-	int user;
-	uint32_t id;
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-	if (gi->gi_argc != 2)
-		return -EINVAL;
-
-	if (from_user) {
-		if (strncpy_from_user(buf, gi->gi_argv[1], ARG_SIZE) < 0)
-			return -EFAULT;
-	} else {
-		strncpy(buf, gi->gi_argv[1], ARG_SIZE);
-	}
-        buf[ARG_SIZE - 1] = 0;
-
-	switch (buf[0]) {
-	case 'u':
-		user = TRUE;
-		break;
-	case 'g':
-		user = FALSE;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	if (buf[1] != ':')
-		return -EINVAL;
-
-	if (sscanf(buf + 2, "%u", &id) != 1)
-		return -EINVAL;
-
-	return gfs_quota_refresh(sdp, user, id);
-}
-
-/**
- * gi_do_quota_read - read quota values from the quota file
- * @sdp:
- * @gi:
- *
- * Returns: errno
- */
-
-static int
-gi_do_quota_read(struct gfs_sbd *sdp, struct gfs_ioctl *gi, int from_user)
-{
-	char buf[ARG_SIZE];
-	int user;
-	uint32_t id;
-	struct gfs_quota q;
-	int error;
-
-	if (gi->gi_argc != 2)
-		return -EINVAL;
-	if (gi->gi_size != sizeof(struct gfs_quota))
-		return -EINVAL;
-
-	if (from_user) {
-		if (strncpy_from_user(buf, gi->gi_argv[1], ARG_SIZE) < 0)
-			return -EFAULT;
-	} else {
-		strncpy(buf, gi->gi_argv[1], ARG_SIZE);
-	}
-        buf[ARG_SIZE - 1] = 0;
-
-	switch (buf[0]) {
-	case 'u':
-		user = TRUE;
-		break;
-	case 'g':
-		user = FALSE;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	if (buf[1] != ':')
-		return -EINVAL;
-
-	if (sscanf(buf + 2, "%u", &id) != 1)
-		return -EINVAL;
-
-	error = gfs_quota_read(sdp, user, id, &q);
-	if (error)
-		return error;
-
-	if (copy_to_user(gi->gi_data, &q, sizeof(struct gfs_quota)))
-		return -EFAULT;
-
-	return 0;
-}
-
-int
-gfs_ioctl_i_local(struct gfs_inode *ip, struct gfs_ioctl *gi, const char *arg0,
-	int from_user)
-{
-	int error = -EFAULT;
-
-	if (strcmp(arg0, "get_cookie") == 0)
-		error = gi_skeleton(ip, gi, gi_get_cookie);
-	else if (strcmp(arg0, "get_super") == 0)
-		error = gi_get_super(ip->i_sbd, gi);
-	else if (strcmp(arg0, "get_args") == 0)
-		error = gi_skeleton(ip, gi, gi_get_args);
-	else if (strcmp(arg0, "get_lockstruct") == 0)
-		error = gi_skeleton(ip, gi, gi_get_lockstruct);
-	else if (strcmp(arg0, "get_stat_gfs") == 0)
-		error = gi_skeleton(ip, gi, gi_get_stat_gfs);
-	else if (strcmp(arg0, "get_counters") == 0)
-		error = gi_skeleton(ip, gi, gi_get_counters);
-	else if (strcmp(arg0, "get_tune") == 0)
-		error = gi_skeleton(ip, gi, gi_get_tune);
-	else if (strcmp(arg0, "set_tune") == 0)
-		error = gi_set_tune(ip->i_sbd, gi, from_user);
-	else if (strcmp(arg0, "do_reclaim") == 0)
-		error = gi_skeleton(ip, gi, gi_do_reclaim);
-	else if (strcmp(arg0, "do_shrink") == 0)
-		error = gi_do_shrink(ip->i_sbd, gi);
-	else if (strcmp(arg0, "get_file_stat") == 0)
-		error = gi_get_file_stat(ip, gi);
-	else if (strcmp(arg0, "set_file_flag") == 0)
-		error = gi_set_file_flag(ip, gi, from_user);
-	else if (strcmp(arg0, "get_file_meta") == 0)
-		error = gi_get_file_meta(ip, gi);
-	else if (strcmp(arg0, "get_file_meta_quota") == 0)
-		error = gi_get_file_meta(ip->i_sbd->sd_qinode, gi);
-	else if (strcmp(arg0, "do_file_flush") == 0)
-		error = gi_do_file_flush(ip, gi);
-	else if (strcmp(arg0, "get_hfile_stat") == 0)
-		error = gi_get_hfile_stat(ip->i_sbd, gi, from_user);
-	else if (strcmp(arg0, "do_hfile_read") == 0)
-		error = gi_do_hfile_read(ip->i_sbd, gi, from_user);
-	else if (strcmp(arg0, "do_hfile_write") == 0)
-		error = gi_do_hfile_write(ip->i_sbd, gi, from_user);
-	else if (strcmp(arg0, "do_hfile_trunc") == 0)
-		error = gi_do_hfile_trunc(ip->i_sbd, gi, from_user);
-	else if (strcmp(arg0, "do_quota_sync") == 0)
-		error = gi_do_quota_sync(ip->i_sbd, gi);
-	else if (strcmp(arg0, "do_quota_refresh") == 0)
-		error = gi_do_quota_refresh(ip->i_sbd, gi, from_user);
-	else if (strcmp(arg0, "do_quota_read") == 0)
-		error = gi_do_quota_read(ip->i_sbd, gi, from_user);
-	else
-		error = -ENOTTY;
-
-	return error;
-}
-
-/**
- * gfs_ioctl_i - Normal ioctls
- * @ip:
- * @arg:
- *
- * Returns: -errno or positive byte count
- */
-
-int
-gfs_ioctl_i(struct gfs_inode *ip, void *arg)
-{
-	struct gfs_ioctl *gi_user = (struct gfs_ioctl *)arg;
-	struct gfs_ioctl gi;
-	char **argv;
-	char arg0[ARG_SIZE];
-	int error = -EFAULT;
-
-	if (copy_from_user(&gi, gi_user, sizeof(struct gfs_ioctl)))
-		return -EFAULT;
-	if (!gi.gi_argc)
-		return -EINVAL;
-	argv = kmalloc(gi.gi_argc * sizeof(char *), GFP_KERNEL);
-	if (!argv)
-		return -ENOMEM;
-	if (copy_from_user(argv, gi.gi_argv,
-			   gi.gi_argc * sizeof(char *)))
-		goto out;
-	gi.gi_argv = argv;
-
-	if (strncpy_from_user(arg0, argv[0], ARG_SIZE) < 0)
-		goto out;
-	arg0[ARG_SIZE - 1] = 0;
-	error = gfs_ioctl_i_local(ip, &gi, arg0, 1);
- out:
-	kfree(argv);
-
-	return error;
-}
-
-#ifdef CONFIG_COMPAT
-/**
- * gfs_ioctl_i_compat - compatibility ioctls
- *                      These ioctls are used to provide ioctls for situations
- *                      where userland and kernel arch is different.
- *                      For example, userland may be 32-bit ppc whereas the
- *                      kernel may be ppc64.  In this case, we need to do
- *                      extra translation between the addresses.
- * @ip:
- * @arg:
- *
- * Returns: -errno or positive byte count
- */
-
-int
-gfs_ioctl_i_compat(struct gfs_inode *ip, unsigned long arg)
-{
-	struct gfs_ioctl_compat *src;
-	struct gfs_ioctl dst;
-	char **argv, *argptr;
-	uint32_t *ptr;
-	char arg0[ARG_SIZE];
-	char *tmparg;
-	int i;
-	int error = -EFAULT;
-
-	src = (struct gfs_ioctl_compat *)compat_ptr(arg);
-
-	memset(&dst, 0, sizeof(dst));
-	dst.gi_argc = src->gi_argc;
-	dst.gi_size = src->gi_size;
-	dst.gi_offset = src->gi_offset;
-
-	argv = kmalloc(dst.gi_argc * sizeof(char *), GFP_KERNEL);
-	if (!argv)
-		return -ENOMEM;
-
-	memset(argv, 0, dst.gi_argc * sizeof(char *));
-	ptr = (uint32_t *)compat_ptr(src->gi_argv);
-
-	for (i = 0; i < dst.gi_argc; i++) { /* for each parm */
-		tmparg = kmalloc(ARG_SIZE * sizeof(char *), GFP_KERNEL);
-		if (!tmparg)
-			goto out;
-		argptr = (char *)compat_ptr(*ptr);
-		if (strncpy_from_user(tmparg, argptr, ARG_SIZE) < 0)
-			goto out;
-		argv[i] = tmparg;
-		ptr++;
-	}
-
-	strncpy(arg0, argv[0], ARG_SIZE);
-	arg0[ARG_SIZE - 1] = 0;
-	dst.gi_argv = argv;
-	dst.gi_data = compat_ptr(src->gi_data);
-	error = gfs_ioctl_i_local(ip, &dst, arg0, 0);
- out:
-	for (i = 0; i < dst.gi_argc; i++)
-		kfree(argv[i]);
-	kfree(argv);
-	return error;
-}
-#endif
diff --git a/gfs-kernel/src/gfs/ioctl.h b/gfs-kernel/src/gfs/ioctl.h
deleted file mode 100644
index 8377496..0000000
--- a/gfs-kernel/src/gfs/ioctl.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __IOCTL_DOT_H__
-#define __IOCTL_DOT_H__
-
-int gfs_ioctl_i_local(struct gfs_inode *ip, struct gfs_ioctl *gi,
-		      const char *arg0, int from_user);
-int gfs_ioctl_i_compat(struct gfs_inode *ip, unsigned long arg);
-int gfs_ioctl_i(struct gfs_inode *ip, void *arg);
-
-#endif /* __IOCTL_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/lm.c b/gfs-kernel/src/gfs/lm.c
deleted file mode 100644
index bff0806..0000000
--- a/gfs-kernel/src/gfs/lm.c
+++ /dev/null
@@ -1,237 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/delay.h>
-
-#include "gfs_ondisk.h"
-#include "gfs.h"
-#include "incore.h"
-#include "glock.h"
-#include "lm.h"
-#include "super.h"
-#include "util.h"
-#include "lvb.h"
-
-/**
- * gfs_lm_mount - mount a locking protocol
- * @sdp: the filesystem
- * @args: mount arguements
- * @silent: if 1, don't complain if the FS isn't a GFS fs
- *
- * Returns: errno
- */
-
-int gfs_lm_mount(struct gfs_sbd *sdp, int silent)
-{
-	char *proto = sdp->sd_proto_name;
-	char *table = sdp->sd_table_name;
-	int flags = 0;
-	int error;
-
-	if (sdp->sd_args.ar_spectator)
-		flags |= LM_MFLAG_SPECTATOR;
-
-	printk("Trying to join cluster \"%s\", \"%s\"\n", proto, table);
-
-	error = gfs_mount_lockproto(proto, table, sdp->sd_args.ar_hostdata,
-				     gfs_glock_cb, sdp,
-				     GFS_MIN_LVB_SIZE, flags,
-				     &sdp->sd_lockstruct, &sdp->sd_kobj);
-	if (error) {
-		printk("can't mount proto=%s, table=%s, hostdata=%s\n",
-			   proto, table, sdp->sd_args.ar_hostdata);
-		goto out;
-	}
-
-	if (gfs_assert_warn(sdp, sdp->sd_lockstruct.ls_lockspace) ||
-	    gfs_assert_warn(sdp, sdp->sd_lockstruct.ls_ops) ||
-	    gfs_assert_warn(sdp, sdp->sd_lockstruct.ls_lvb_size >=
-				  GFS_MIN_LVB_SIZE)) {
-		gfs_unmount_lockproto(&sdp->sd_lockstruct);
-		goto out;
-	}
-
-	if (sdp->sd_args.ar_spectator)
-		snprintf(sdp->sd_fsname, 256, "%s.s", table);
-	else
-		snprintf(sdp->sd_fsname, 256, "%s.%u", table,
-			 sdp->sd_lockstruct.ls_jid);
-
-	printk("Joined cluster. Now mounting FS...\n");
-	if ((sdp->sd_lockstruct.ls_flags & LM_LSFLAG_LOCAL) &&
-	    !sdp->sd_args.ar_ignore_local_fs) {
-		sdp->sd_args.ar_localflocks = 1;
-		sdp->sd_args.ar_localcaching = 1;
-	}
-
- out:
-	return error;
-}
-
-void gfs_lm_others_may_mount(struct gfs_sbd *sdp)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		sdp->sd_lockstruct.ls_ops->lm_others_may_mount(
-					sdp->sd_lockstruct.ls_lockspace);
-}
-
-void gfs_lm_unmount(struct gfs_sbd *sdp)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		gfs_unmount_lockproto(&sdp->sd_lockstruct);
-}
-
-int gfs_lm_withdraw(struct gfs_sbd *sdp, char *fmt, ...)
-{
-	va_list args;
-
-	if (sdp->sd_args.ar_errors == GFS_ERRORS_WITHDRAW &&
-	    test_and_set_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-		return 0;
-
-	va_start(args, fmt);
-	vprintk(fmt, args);
-	va_end(args);
-
-	if (sdp->sd_args.ar_errors == GFS_ERRORS_WITHDRAW) {
-		printk("GFS: fsid=%s: about to withdraw from the cluster\n",
-		       sdp->sd_fsname);
-
-		BUG_ON(sdp->sd_args.ar_debug);
-
-		printk("GFS: fsid=%s: telling LM to withdraw\n",
-		       sdp->sd_fsname);
-
-		gfs_withdraw_lockproto(&sdp->sd_lockstruct);
-
-		printk("GFS: fsid=%s: withdrawn\n", sdp->sd_fsname);
-	}
-	dump_stack();
-	if (sdp->sd_args.ar_errors == GFS_ERRORS_PANIC)
-		panic("GFS: fsid=%s: panic requested.\n", sdp->sd_fsname);
-
-	return -1;
-}
-
-int gfs_lm_get_lock(struct gfs_sbd *sdp, struct lm_lockname *name,
-		     void **lockp)
-{
-	int error;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		error = -EIO;
-	else
-		error = sdp->sd_lockstruct.ls_ops->lm_get_lock(
-				sdp->sd_lockstruct.ls_lockspace, name, lockp);
-	return error;
-}
-
-void gfs_lm_put_lock(struct gfs_sbd *sdp, void *lock)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		sdp->sd_lockstruct.ls_ops->lm_put_lock(lock);
-}
-
-unsigned int gfs_lm_lock(struct gfs_sbd *sdp, void *lock,
-			  unsigned int cur_state, unsigned int req_state,
-			  unsigned int flags)
-{
-	int ret;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		ret = 0;
-	else
-		ret = sdp->sd_lockstruct.ls_ops->lm_lock(lock,
-							 cur_state,
-							 req_state, flags);
-	return ret;
-}
-
-unsigned int gfs_lm_unlock(struct gfs_sbd *sdp, void *lock,
-			    unsigned int cur_state)
-{
-	int ret;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		ret = 0;
-	else
-		ret = sdp->sd_lockstruct.ls_ops->lm_unlock(lock, cur_state);
-	return ret;
-}
-
-void gfs_lm_cancel(struct gfs_sbd *sdp, void *lock)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		sdp->sd_lockstruct.ls_ops->lm_cancel(lock);
-}
-
-int gfs_lm_hold_lvb(struct gfs_sbd *sdp, void *lock, char **lvbp)
-{
-	int error;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		error = -EIO;
-	else
-		error = sdp->sd_lockstruct.ls_ops->lm_hold_lvb(lock, lvbp);
-	return error;
-}
-
-void gfs_lm_unhold_lvb(struct gfs_sbd *sdp, void *lock, char *lvb)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		sdp->sd_lockstruct.ls_ops->lm_unhold_lvb(lock, lvb);
-}
-
-#if 0
-void gfs_lm_sync_lvb(struct gfs_sbd *sdp, void *lock, char *lvb)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		sdp->sd_lockstruct.ls_ops->lm_sync_lvb(lock, lvb);
-}
-#endif
-
-int gfs_lm_plock_get(struct gfs_sbd *sdp, struct lm_lockname *name,
-		      struct file *file, struct file_lock *fl)
-{
-	int error;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		error = -EIO;
-	else
-		error = sdp->sd_lockstruct.ls_ops->lm_plock_get(
-			sdp->sd_lockstruct.ls_lockspace,
-			name, file, fl);
-	return error;
-}
-
-int gfs_lm_plock(struct gfs_sbd *sdp, struct lm_lockname *name,
-		  struct file *file, int cmd, struct file_lock *fl)
-{
-	int error;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		error = -EIO;
-	else
-		error = sdp->sd_lockstruct.ls_ops->lm_plock(
-			sdp->sd_lockstruct.ls_lockspace,
-			name, file, cmd, fl);
-	return error;
-}
-
-int gfs_lm_punlock(struct gfs_sbd *sdp, struct lm_lockname *name,
-		    struct file *file, struct file_lock *fl)
-{
-	int error;
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		error = -EIO;
-	else
-		error = sdp->sd_lockstruct.ls_ops->lm_punlock(
-			sdp->sd_lockstruct.ls_lockspace,
-			name, file, fl);
-	return error;
-}
-
-void gfs_lm_recovery_done(struct gfs_sbd *sdp, unsigned int jid,
-			   unsigned int message)
-{
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		sdp->sd_lockstruct.ls_ops->lm_recovery_done(
-			sdp->sd_lockstruct.ls_lockspace, jid, message);
-}
-
diff --git a/gfs-kernel/src/gfs/lm.h b/gfs-kernel/src/gfs/lm.h
deleted file mode 100644
index 40ddf2b..0000000
--- a/gfs-kernel/src/gfs/lm.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __LM_DOT_H__
-#define __LM_DOT_H__
-
-int gfs_lm_mount(struct gfs_sbd *sdp, int silent);
-void gfs_lm_others_may_mount(struct gfs_sbd *sdp);
-void gfs_lm_unmount(struct gfs_sbd *sdp);
-int gfs_lm_withdraw(struct gfs_sbd *sdp, char *fmt, ...)
-__attribute__ ((format(printf, 2, 3)));
-int gfs_lm_get_lock(struct gfs_sbd *sdp,
-		    struct lm_lockname *name, void **lockp);
-void gfs_lm_put_lock(struct gfs_sbd *sdp, void *lock);
-unsigned int gfs_lm_lock(struct gfs_sbd *sdp, void *lock,
-			 unsigned int cur_state, unsigned int req_state,
-			 unsigned int flags);
-unsigned int gfs_lm_unlock(struct gfs_sbd *sdp, void *lock,
-			   unsigned int cur_state);
-void gfs_lm_cancel(struct gfs_sbd *sdp, void *lock);
-int gfs_lm_hold_lvb(struct gfs_sbd *sdp, void *lock, char **lvbp);
-void gfs_lm_unhold_lvb(struct gfs_sbd *sdp, void *lock, char *lvb);
-int gfs_lm_plock_get(struct gfs_sbd *sdp,
-		     struct lm_lockname *name,
-		     struct file *file, struct file_lock *fl);
-int gfs_lm_plock(struct gfs_sbd *sdp,
-		 struct lm_lockname *name,
-		 struct file *file, int cmd, struct file_lock *fl);
-int gfs_lm_punlock(struct gfs_sbd *sdp,
-		   struct lm_lockname *name,
-		   struct file *file, struct file_lock *fl);
-void gfs_lm_recovery_done(struct gfs_sbd *sdp,
-			  unsigned int jid, unsigned int message);
-
-#endif /* __LM_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/lm_interface.h b/gfs-kernel/src/gfs/lm_interface.h
deleted file mode 100644
index fd07379..0000000
--- a/gfs-kernel/src/gfs/lm_interface.h
+++ /dev/null
@@ -1,269 +0,0 @@
-#ifndef __LM_INTERFACE_DOT_H__
-#define __LM_INTERFACE_DOT_H__
-
-
-typedef void (*lm_callback_t) (void *ptr, unsigned int type, void *data);
-
-/*
- * lm_mount() flags
- *
- * LM_MFLAG_SPECTATOR
- * GFS is asking to join the filesystem's lockspace, but it doesn't want to
- * modify the filesystem.  The lock module shouldn't assign a journal to the FS
- * mount.  It shouldn't send recovery callbacks to the FS mount.  If the node
- * dies or withdraws, all locks can be wiped immediately.
- */
-
-#define LM_MFLAG_SPECTATOR	0x00000001
-
-/*
- * lm_lockstruct flags
- *
- * LM_LSFLAG_LOCAL
- * The lock_nolock module returns LM_LSFLAG_LOCAL to GFS, indicating that GFS
- * can make single-node optimizations.
- */
-
-#define LM_LSFLAG_LOCAL		0x00000001
-
-/*
- * lm_lockname types
- */
-
-#define LM_TYPE_RESERVED	0x00
-#define LM_TYPE_NONDISK		0x01
-#define LM_TYPE_INODE		0x02
-#define LM_TYPE_RGRP		0x03
-#define LM_TYPE_META		0x04
-#define LM_TYPE_IOPEN		0x05
-#define LM_TYPE_FLOCK		0x06
-#define LM_TYPE_PLOCK		0x07
-#define LM_TYPE_QUOTA		0x08
-#define LM_TYPE_JOURNAL		0x09
-
-/*
- * lm_lock() states
- *
- * SHARED is compatible with SHARED, not with DEFERRED or EX.
- * DEFERRED is compatible with DEFERRED, not with SHARED or EX.
- */
-
-#define LM_ST_UNLOCKED		0
-#define LM_ST_EXCLUSIVE		1
-#define LM_ST_DEFERRED		2
-#define LM_ST_SHARED		3
-
-/*
- * lm_lock() flags
- *
- * LM_FLAG_TRY
- * Don't wait to acquire the lock if it can't be granted immediately.
- *
- * LM_FLAG_TRY_1CB
- * Send one blocking callback if TRY is set and the lock is not granted.
- *
- * LM_FLAG_NOEXP
- * GFS sets this flag on lock requests it makes while doing journal recovery.
- * These special requests should not be blocked due to the recovery like
- * ordinary locks would be.
- *
- * LM_FLAG_ANY
- * A SHARED request may also be granted in DEFERRED, or a DEFERRED request may
- * also be granted in SHARED.  The preferred state is whichever is compatible
- * with other granted locks, or the specified state if no other locks exist.
- *
- * LM_FLAG_PRIORITY
- * Override fairness considerations.  Suppose a lock is held in a shared state
- * and there is a pending request for the deferred state.  A shared lock
- * request with the priority flag would be allowed to bypass the deferred
- * request and directly join the other shared lock.  A shared lock request
- * without the priority flag might be forced to wait until the deferred
- * requested had acquired and released the lock.
- */
-
-#define LM_FLAG_TRY		0x00000001
-#define LM_FLAG_TRY_1CB		0x00000002
-#define LM_FLAG_NOEXP		0x00000004
-#define LM_FLAG_ANY		0x00000008
-#define LM_FLAG_PRIORITY	0x00000010
-
-/*
- * lm_lock() and lm_async_cb return flags
- *
- * LM_OUT_ST_MASK
- * Masks the lower two bits of lock state in the returned value.
- *
- * LM_OUT_CACHEABLE
- * The lock hasn't been released so GFS can continue to cache data for it.
- *
- * LM_OUT_CANCELED
- * The lock request was canceled.
- *
- * LM_OUT_ASYNC
- * The result of the request will be returned in an LM_CB_ASYNC callback.
- */
-
-#define LM_OUT_ST_MASK		0x00000003
-#define LM_OUT_CACHEABLE	0x00000004
-#define LM_OUT_CANCELED		0x00000008
-#define LM_OUT_ASYNC		0x00000080
-#define LM_OUT_ERROR		0x00000100
-
-/*
- * lm_callback_t types
- *
- * LM_CB_NEED_E LM_CB_NEED_D LM_CB_NEED_S
- * Blocking callback, a remote node is requesting the given lock in
- * EXCLUSIVE, DEFERRED, or SHARED.
- *
- * LM_CB_NEED_RECOVERY
- * The given journal needs to be recovered.
- *
- * LM_CB_DROPLOCKS
- * Reduce the number of cached locks.
- *
- * LM_CB_ASYNC
- * The given lock has been granted.
- */
-
-#define LM_CB_NEED_E		257
-#define LM_CB_NEED_D		258
-#define LM_CB_NEED_S		259
-#define LM_CB_NEED_RECOVERY	260
-#define LM_CB_DROPLOCKS		261
-#define LM_CB_ASYNC		262
-
-/*
- * lm_recovery_done() messages
- */
-
-#define LM_RD_GAVEUP		308
-#define LM_RD_SUCCESS		309
-
-
-struct lm_lockname {
-	u64 ln_number;
-	unsigned int ln_type;
-};
-
-#define lm_name_equal(name1, name2) \
-	(((name1)->ln_number == (name2)->ln_number) && \
-	 ((name1)->ln_type == (name2)->ln_type)) \
-
-struct lm_async_cb {
-	struct lm_lockname lc_name;
-	int lc_ret;
-};
-
-struct lm_lockstruct;
-
-struct lm_lockops {
-	const char *lm_proto_name;
-
-	/*
-	 * Mount/Unmount
-	 */
-
-	int (*lm_mount) (char *table_name, char *host_data,
-			 lm_callback_t cb, void *cb_data,
-			 unsigned int min_lvb_size, int flags,
-			 struct lm_lockstruct *lockstruct,
-			 struct kobject *fskobj);
-
-	void (*lm_others_may_mount) (void *lockspace);
-
-	void (*lm_unmount) (void *lockspace);
-
-	void (*lm_withdraw) (void *lockspace);
-
-	/*
-	 * Lock oriented operations
-	 */
-
-	int (*lm_get_lock) (void *lockspace, struct lm_lockname *name, void **lockp);
-
-	void (*lm_put_lock) (void *lock);
-
-	unsigned int (*lm_lock) (void *lock, unsigned int cur_state,
-				 unsigned int req_state, unsigned int flags);
-
-	unsigned int (*lm_unlock) (void *lock, unsigned int cur_state);
-
-	void (*lm_cancel) (void *lock);
-
-	int (*lm_hold_lvb) (void *lock, char **lvbp);
-	void (*lm_unhold_lvb) (void *lock, char *lvb);
-
-	/*
-	 * Posix Lock oriented operations
-	 */
-
-	int (*lm_plock_get) (void *lockspace, struct lm_lockname *name,
-			     struct file *file, struct file_lock *fl);
-
-	int (*lm_plock) (void *lockspace, struct lm_lockname *name,
-			 struct file *file, int cmd, struct file_lock *fl);
-
-	int (*lm_punlock) (void *lockspace, struct lm_lockname *name,
-			   struct file *file, struct file_lock *fl);
-
-	/*
-	 * Client oriented operations
-	 */
-
-	void (*lm_recovery_done) (void *lockspace, unsigned int jid,
-				  unsigned int message);
-
-	struct module *lm_owner;
-};
-
-/*
- * lm_mount() return values
- *
- * ls_jid - the journal ID this node should use
- * ls_first - this node is the first to mount the file system
- * ls_lvb_size - size in bytes of lock value blocks
- * ls_lockspace - lock module's context for this file system
- * ls_ops - lock module's functions
- * ls_flags - lock module features
- */
-
-struct lm_lockstruct {
-	unsigned int ls_jid;
-	unsigned int ls_first;
-	unsigned int ls_lvb_size;
-	void *ls_lockspace;
-	const struct lm_lockops *ls_ops;
-	int ls_flags;
-};
-
-/*
- * Lock module bottom interface.  A lock module makes itself available to GFS
- * with these functions.
- */
-
-int gfs_register_lockproto(const struct lm_lockops *proto);
-void gfs_unregister_lockproto(const struct lm_lockops *proto);
-
-/*
- * Lock module top interface.  GFS calls these functions when mounting or
- * unmounting a file system.
- */
-
-int gfs_mount_lockproto(char *proto_name, char *table_name, char *host_data,
-			 lm_callback_t cb, void *cb_data,
-			 unsigned int min_lvb_size, int flags,
-			 struct lm_lockstruct *lockstruct,
-			 struct kobject *fskobj);
-
-void gfs_unmount_lockproto(struct lm_lockstruct *lockstruct);
-
-void gfs_withdraw_lockproto(struct lm_lockstruct *lockstruct);
-
-int init_lock_dlm(void);
-void exit_lock_dlm(void);
-int init_nolock(void);
-void exit_nolock(void);
-
-#endif /* __LM_INTERFACE_DOT_H__ */
-
diff --git a/gfs-kernel/src/gfs/lock_dlm.h b/gfs-kernel/src/gfs/lock_dlm.h
deleted file mode 100644
index 15908cd..0000000
--- a/gfs-kernel/src/gfs/lock_dlm.h
+++ /dev/null
@@ -1,173 +0,0 @@
-#ifndef LOCK_DLM_DOT_H
-#define LOCK_DLM_DOT_H
-
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include <linux/types.h>
-#include <linux/string.h>
-#include <linux/list.h>
-#include <linux/socket.h>
-#include <linux/delay.h>
-#include <linux/kthread.h>
-#include <linux/kobject.h>
-#include <linux/fcntl.h>
-#include <linux/wait.h>
-#include <net/sock.h>
-
-#include <linux/dlm.h>
-#include <linux/dlm_plock.h>
-#include "lm_interface.h"
-
-/*
- * Internally, we prefix things with gdlm_ and GDLM_ (for gfs-dlm) since a
- * prefix of lock_dlm_ gets awkward.  Externally, GFS refers to this module
- * as "lock_dlm".
- */
-
-#define GDLM_STRNAME_BYTES	24
-#define GDLM_LVB_SIZE		32
-#define GDLM_DROP_COUNT		0
-#define GDLM_DROP_PERIOD	60
-#define GDLM_NAME_LEN		128
-
-/* GFS uses 12 bytes to identify a resource (32 bit type + 64 bit number).
-   We sprintf these numbers into a 24 byte string of hex values to make them
-   human-readable (to make debugging simpler.) */
-
-struct gdlm_strname {
-	unsigned char		name[GDLM_STRNAME_BYTES];
-	unsigned short		namelen;
-};
-
-enum {
-	DFL_BLOCK_LOCKS		= 0,
-	DFL_SPECTATOR		= 1,
-	DFL_WITHDRAW		= 2,
-};
-
-struct gdlm_ls {
-	u32		id;
-	int			jid;
-	int			first;
-	int			first_done;
-	unsigned long		flags;
-	struct kobject		kobj;
-	char			clustername[GDLM_NAME_LEN];
-	char			fsname[GDLM_NAME_LEN];
-	int			fsflags;
-	dlm_lockspace_t		*dlm_lockspace;
-	lm_callback_t		fscb;
-	struct gfs_sbd		*sdp;
-	int			recover_jid;
-	int			recover_jid_done;
-	int			recover_jid_status;
-	spinlock_t		async_lock;
-	struct list_head	complete;
-	struct list_head	blocking;
-	struct list_head	delayed;
-	struct list_head	submit;
-	struct list_head	all_locks;
-	u32		all_locks_count;
-	wait_queue_head_t	wait_control;
-	struct task_struct	*thread1;
-	struct task_struct	*thread2;
-	wait_queue_head_t	thread_wait;
-	unsigned long		drop_time;
-	int			drop_locks_count;
-	int			drop_locks_period;
-};
-
-enum {
-	LFL_NOBLOCK		= 0,
-	LFL_NOCACHE		= 1,
-	LFL_DLM_UNLOCK		= 2,
-	LFL_DLM_CANCEL		= 3,
-	LFL_SYNC_LVB		= 4,
-	LFL_FORCE_PROMOTE	= 5,
-	LFL_REREQUEST		= 6,
-	LFL_ACTIVE		= 7,
-	LFL_INLOCK		= 8,
-	LFL_CANCEL		= 9,
-	LFL_NOBAST		= 10,
-	LFL_HEADQUE		= 11,
-	LFL_UNLOCK_DELETE	= 12,
-	LFL_AST_WAIT		= 13,
-};
-
-struct gdlm_lock {
-	struct gdlm_ls		*ls;
-	struct lm_lockname	lockname;
-	struct gdlm_strname	strname;
-	char			*lvb;
-	struct dlm_lksb		lksb;
-
-	s16			cur;
-	s16			req;
-	s16			prev_req;
-	u32			lkf;		/* dlm flags DLM_LKF_ */
-	unsigned long		flags;		/* lock_dlm flags LFL_ */
-
-	int			bast_mode;	/* protected by async_lock */
-
-	struct list_head	clist;		/* complete */
-	struct list_head	blist;		/* blocking */
-	struct list_head	delay_list;	/* delayed */
-	struct list_head	all_list;	/* all locks for the fs */
-	struct gdlm_lock	*hold_null;	/* NL lock for hold_lvb */
-};
-
-#define gdlm_assert(assertion, fmt, args...)                                  \
-do {                                                                          \
-	if (unlikely(!(assertion))) {                                         \
-		printk(KERN_EMERG "lock_dlm: fatal assertion failed \"%s\"\n" \
-				  "lock_dlm:  " fmt "\n",                     \
-				  #assertion, ##args);                        \
-		BUG();                                                        \
-	}                                                                     \
-} while (0)
-
-#define log_print(lev, fmt, arg...) printk(lev "lock_dlm: " fmt "\n" , ## arg)
-#define log_info(fmt, arg...)  log_print(KERN_INFO , fmt , ## arg)
-#define log_error(fmt, arg...) log_print(KERN_ERR , fmt , ## arg)
-#ifdef LOCK_DLM_LOG_DEBUG
-#define log_debug(fmt, arg...) log_print(KERN_DEBUG , fmt , ## arg)
-#else
-#define log_debug(fmt, arg...)
-#endif
-
-/* sysfs.c */
-
-int gdlm_sysfs_init(void);
-void gdlm_sysfs_exit(void);
-int gdlm_kobject_setup(struct gdlm_ls *, struct kobject *);
-void gdlm_kobject_release(struct gdlm_ls *);
-
-/* thread.c */
-
-int gdlm_init_threads(struct gdlm_ls *);
-void gdlm_release_threads(struct gdlm_ls *);
-
-/* lock.c */
-
-s16 gdlm_make_lmstate(s16);
-void gdlm_queue_delayed(struct gdlm_lock *);
-void gdlm_submit_delayed(struct gdlm_ls *);
-int gdlm_release_all_locks(struct gdlm_ls *);
-void gdlm_delete_lp(struct gdlm_lock *);
-unsigned int gdlm_do_lock(struct gdlm_lock *);
-
-int gdlm_get_lock(void *, struct lm_lockname *, void **);
-void gdlm_put_lock(void *);
-unsigned int gdlm_lock(void *, unsigned int, unsigned int, unsigned int);
-unsigned int gdlm_unlock(void *, unsigned int);
-void gdlm_cancel(void *);
-int gdlm_hold_lvb(void *, char **);
-void gdlm_unhold_lvb(void *, char *);
-
-/* mount.c */
-
-extern const struct lm_lockops gdlm_ops;
-
-#endif
-
diff --git a/gfs-kernel/src/gfs/lock_dlm_lock.c b/gfs-kernel/src/gfs/lock_dlm_lock.c
deleted file mode 100644
index 65ef0bd..0000000
--- a/gfs-kernel/src/gfs/lock_dlm_lock.c
+++ /dev/null
@@ -1,518 +0,0 @@
-#include "lock_dlm.h"
-
-static char junk_lvb[GDLM_LVB_SIZE];
-
-static void queue_complete(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-
-	clear_bit(LFL_ACTIVE, &lp->flags);
-
-	spin_lock(&ls->async_lock);
-	list_add_tail(&lp->clist, &ls->complete);
-	spin_unlock(&ls->async_lock);
-	wake_up(&ls->thread_wait);
-}
-
-static inline void gdlm_ast(void *astarg)
-{
-	queue_complete(astarg);
-}
-
-static inline void gdlm_bast(void *astarg, int mode)
-{
-	struct gdlm_lock *lp = astarg;
-	struct gdlm_ls *ls = lp->ls;
-
-	if (!mode) {
-		printk(KERN_INFO "lock_dlm: bast mode zero %x,%llx\n",
-			lp->lockname.ln_type,
-			(unsigned long long)lp->lockname.ln_number);
-		return;
-	}
-
-	spin_lock(&ls->async_lock);
-	if (!lp->bast_mode) {
-		list_add_tail(&lp->blist, &ls->blocking);
-		lp->bast_mode = mode;
-	} else if (lp->bast_mode < mode)
-		lp->bast_mode = mode;
-	spin_unlock(&ls->async_lock);
-	wake_up(&ls->thread_wait);
-}
-
-void gdlm_queue_delayed(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-
-	spin_lock(&ls->async_lock);
-	list_add_tail(&lp->delay_list, &ls->delayed);
-	spin_unlock(&ls->async_lock);
-}
-
-/* convert gfs lock-state to dlm lock-mode */
-
-static s16 make_mode(s16 lmstate)
-{
-	switch (lmstate) {
-	case LM_ST_UNLOCKED:
-		return DLM_LOCK_NL;
-	case LM_ST_EXCLUSIVE:
-		return DLM_LOCK_EX;
-	case LM_ST_DEFERRED:
-		return DLM_LOCK_CW;
-	case LM_ST_SHARED:
-		return DLM_LOCK_PR;
-	}
-	gdlm_assert(0, "unknown LM state %d", lmstate);
-	return -1;
-}
-
-/* convert dlm lock-mode to gfs lock-state */
-
-s16 gdlm_make_lmstate(s16 dlmmode)
-{
-	switch (dlmmode) {
-	case DLM_LOCK_IV:
-	case DLM_LOCK_NL:
-		return LM_ST_UNLOCKED;
-	case DLM_LOCK_EX:
-		return LM_ST_EXCLUSIVE;
-	case DLM_LOCK_CW:
-		return LM_ST_DEFERRED;
-	case DLM_LOCK_PR:
-		return LM_ST_SHARED;
-	}
-	gdlm_assert(0, "unknown DLM mode %d", dlmmode);
-	return -1;
-}
-
-/* verify agreement with GFS on the current lock state, NB: DLM_LOCK_NL and
-   DLM_LOCK_IV are both considered LM_ST_UNLOCKED by GFS. */
-
-static void check_cur_state(struct gdlm_lock *lp, unsigned int cur_state)
-{
-	s16 cur = make_mode(cur_state);
-	if (lp->cur != DLM_LOCK_IV)
-		gdlm_assert(lp->cur == cur, "%d, %d", lp->cur, cur);
-}
-
-static inline unsigned int make_flags(struct gdlm_lock *lp,
-				      unsigned int gfs_flags,
-				      s16 cur, s16 req)
-{
-	unsigned int lkf = 0;
-
-	if (gfs_flags & LM_FLAG_TRY)
-		lkf |= DLM_LKF_NOQUEUE;
-
-	if (gfs_flags & LM_FLAG_TRY_1CB) {
-		lkf |= DLM_LKF_NOQUEUE;
-		lkf |= DLM_LKF_NOQUEUEBAST;
-	}
-
-	if (gfs_flags & LM_FLAG_PRIORITY) {
-		lkf |= DLM_LKF_NOORDER;
-		lkf |= DLM_LKF_HEADQUE;
-	}
-
-	if (gfs_flags & LM_FLAG_ANY) {
-		if (req == DLM_LOCK_PR)
-			lkf |= DLM_LKF_ALTCW;
-		else if (req == DLM_LOCK_CW)
-			lkf |= DLM_LKF_ALTPR;
-	}
-
-	if (lp->lksb.sb_lkid != 0) {
-		lkf |= DLM_LKF_CONVERT;
-
-		/* Conversion deadlock avoidance by DLM */
-
-		if (!test_bit(LFL_FORCE_PROMOTE, &lp->flags) &&
-		    !(lkf & DLM_LKF_NOQUEUE) &&
-		    cur > DLM_LOCK_NL && req > DLM_LOCK_NL && cur != req)
-			lkf |= DLM_LKF_CONVDEADLK;
-	}
-
-	if (lp->lvb)
-		lkf |= DLM_LKF_VALBLK;
-
-	return lkf;
-}
-
-/* make_strname - convert GFS lock numbers to a string */
-
-static inline void make_strname(const struct lm_lockname *lockname,
-				struct gdlm_strname *str)
-{
-	sprintf(str->name, "%8x%16llx", lockname->ln_type,
-		(unsigned long long)lockname->ln_number);
-	str->namelen = GDLM_STRNAME_BYTES;
-}
-
-static int gdlm_create_lp(struct gdlm_ls *ls, struct lm_lockname *name,
-			  struct gdlm_lock **lpp)
-{
-	struct gdlm_lock *lp;
-
-	lp = kzalloc(sizeof(struct gdlm_lock), GFP_NOFS);
-	if (!lp)
-		return -ENOMEM;
-
-	lp->lockname = *name;
-	make_strname(name, &lp->strname);
-	lp->ls = ls;
-	lp->cur = DLM_LOCK_IV;
-	lp->lvb = NULL;
-	lp->hold_null = NULL;
-	INIT_LIST_HEAD(&lp->clist);
-	INIT_LIST_HEAD(&lp->blist);
-	INIT_LIST_HEAD(&lp->delay_list);
-
-	spin_lock(&ls->async_lock);
-	list_add(&lp->all_list, &ls->all_locks);
-	ls->all_locks_count++;
-	spin_unlock(&ls->async_lock);
-
-	*lpp = lp;
-	return 0;
-}
-
-void gdlm_delete_lp(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-
-	spin_lock(&ls->async_lock);
-	if (!list_empty(&lp->clist))
-		list_del_init(&lp->clist);
-	if (!list_empty(&lp->blist))
-		list_del_init(&lp->blist);
-	if (!list_empty(&lp->delay_list))
-		list_del_init(&lp->delay_list);
-	gdlm_assert(!list_empty(&lp->all_list), "%x,%llx", lp->lockname.ln_type,
-		    (unsigned long long)lp->lockname.ln_number);
-	list_del_init(&lp->all_list);
-	ls->all_locks_count--;
-	spin_unlock(&ls->async_lock);
-
-	kfree(lp);
-}
-
-int gdlm_get_lock(void *lockspace, struct lm_lockname *name,
-		  void **lockp)
-{
-	struct gdlm_lock *lp;
-	int error;
-
-	error = gdlm_create_lp(lockspace, name, &lp);
-
-	*lockp = lp;
-	return error;
-}
-
-void gdlm_put_lock(void *lock)
-{
-	gdlm_delete_lp(lock);
-}
-
-unsigned int gdlm_do_lock(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-	int error, bast = 1;
-
-	/*
-	 * When recovery is in progress, delay lock requests for submission
-	 * once recovery is done.  Requests for recovery (NOEXP) and unlocks
-	 * can pass.
-	 */
-
-	if (test_bit(DFL_BLOCK_LOCKS, &ls->flags) &&
-	    !test_bit(LFL_NOBLOCK, &lp->flags) && lp->req != DLM_LOCK_NL) {
-		gdlm_queue_delayed(lp);
-		return LM_OUT_ASYNC;
-	}
-
-	/*
-	 * Submit the actual lock request.
-	 */
-
-	if (test_bit(LFL_NOBAST, &lp->flags))
-		bast = 0;
-
-	set_bit(LFL_ACTIVE, &lp->flags);
-
-	log_debug("lk %x,%llx id %x %d,%d %x", lp->lockname.ln_type,
-		  (unsigned long long)lp->lockname.ln_number, lp->lksb.sb_lkid,
-		  lp->cur, lp->req, lp->lkf);
-
-	error = dlm_lock(ls->dlm_lockspace, lp->req, &lp->lksb, lp->lkf,
-			 lp->strname.name, lp->strname.namelen, 0, gdlm_ast,
-			 lp, bast ? gdlm_bast : NULL);
-
-	if ((error == -EAGAIN) && (lp->lkf & DLM_LKF_NOQUEUE)) {
-		lp->lksb.sb_status = -EAGAIN;
-		queue_complete(lp);
-		error = 0;
-	}
-
-	if (error) {
-		log_error("%s: gdlm_lock %x,%llx err=%d cur=%d req=%d lkf=%x "
-			  "flags=%lx", ls->fsname, lp->lockname.ln_type,
-			  (unsigned long long)lp->lockname.ln_number, error,
-			  lp->cur, lp->req, lp->lkf, lp->flags);
-		return LM_OUT_ERROR;
-	}
-	return LM_OUT_ASYNC;
-}
-
-static unsigned int gdlm_do_unlock(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-	unsigned int lkf = 0;
-	int error;
-
-	set_bit(LFL_DLM_UNLOCK, &lp->flags);
-	set_bit(LFL_ACTIVE, &lp->flags);
-
-	if (lp->lvb)
-		lkf = DLM_LKF_VALBLK;
-
-	log_debug("un %x,%llx %x %d %x", lp->lockname.ln_type,
-		  (unsigned long long)lp->lockname.ln_number,
-		  lp->lksb.sb_lkid, lp->cur, lkf);
-
-	error = dlm_unlock(ls->dlm_lockspace, lp->lksb.sb_lkid, lkf, NULL, lp);
-
-	if (error) {
-		log_error("%s: gdlm_unlock %x,%llx err=%d cur=%d req=%d lkf=%x "
-			  "flags=%lx", ls->fsname, lp->lockname.ln_type,
-			  (unsigned long long)lp->lockname.ln_number, error,
-			  lp->cur, lp->req, lp->lkf, lp->flags);
-		return LM_OUT_ERROR;
-	}
-	return LM_OUT_ASYNC;
-}
-
-unsigned int gdlm_lock(void *lock, unsigned int cur_state,
-		       unsigned int req_state, unsigned int flags)
-{
-	struct gdlm_lock *lp = lock;
-
-	clear_bit(LFL_DLM_CANCEL, &lp->flags);
-	if (flags & LM_FLAG_NOEXP)
-		set_bit(LFL_NOBLOCK, &lp->flags);
-
-	check_cur_state(lp, cur_state);
-	lp->req = make_mode(req_state);
-	lp->lkf = make_flags(lp, flags, lp->cur, lp->req);
-
-	return gdlm_do_lock(lp);
-}
-
-unsigned int gdlm_unlock(void *lock, unsigned int cur_state)
-{
-	struct gdlm_lock *lp = lock;
-
-	clear_bit(LFL_DLM_CANCEL, &lp->flags);
-	if (lp->cur == DLM_LOCK_IV)
-		return 0;
-	return gdlm_do_unlock(lp);
-}
-
-void gdlm_cancel(void *lock)
-{
-	struct gdlm_lock *lp = lock;
-	struct gdlm_ls *ls = lp->ls;
-	int error, delay_list = 0;
-
-	if (test_bit(LFL_DLM_CANCEL, &lp->flags))
-		return;
-
-	log_info("gdlm_cancel %x,%llx flags %lx", lp->lockname.ln_type,
-		 (unsigned long long)lp->lockname.ln_number, lp->flags);
-
-	spin_lock(&ls->async_lock);
-	if (!list_empty(&lp->delay_list)) {
-		list_del_init(&lp->delay_list);
-		delay_list = 1;
-	}
-	spin_unlock(&ls->async_lock);
-
-	if (delay_list) {
-		set_bit(LFL_CANCEL, &lp->flags);
-		set_bit(LFL_ACTIVE, &lp->flags);
-		queue_complete(lp);
-		return;
-	}
-
-	if (!test_bit(LFL_ACTIVE, &lp->flags) ||
-	    test_bit(LFL_DLM_UNLOCK, &lp->flags)) {
-		log_info("gdlm_cancel skip %x,%llx flags %lx",
-		 	 lp->lockname.ln_type,
-			 (unsigned long long)lp->lockname.ln_number, lp->flags);
-		return;
-	}
-
-	/* the lock is blocked in the dlm */
-
-	set_bit(LFL_DLM_CANCEL, &lp->flags);
-	set_bit(LFL_ACTIVE, &lp->flags);
-
-	error = dlm_unlock(ls->dlm_lockspace, lp->lksb.sb_lkid, DLM_LKF_CANCEL,
-			   NULL, lp);
-
-	log_info("gdlm_cancel rv %d %x,%llx flags %lx", error,
-		 lp->lockname.ln_type,
-		 (unsigned long long)lp->lockname.ln_number, lp->flags);
-
-	if (error == -EBUSY)
-		clear_bit(LFL_DLM_CANCEL, &lp->flags);
-}
-
-static int gdlm_add_lvb(struct gdlm_lock *lp)
-{
-	char *lvb;
-
-	lvb = kzalloc(GDLM_LVB_SIZE, GFP_NOFS);
-	if (!lvb)
-		return -ENOMEM;
-
-	lp->lksb.sb_lvbptr = lvb;
-	lp->lvb = lvb;
-	return 0;
-}
-
-static void gdlm_del_lvb(struct gdlm_lock *lp)
-{
-	kfree(lp->lvb);
-	lp->lvb = NULL;
-	lp->lksb.sb_lvbptr = NULL;
-}
-
-static int gdlm_ast_wait(void *word)
-{
-	schedule();
-	return 0;
-}
-
-/* This can do a synchronous dlm request (requiring a lock_dlm thread to get
-   the completion) because gfs won't call hold_lvb() during a callback (from
-   the context of a lock_dlm thread). */
-
-static int hold_null_lock(struct gdlm_lock *lp)
-{
-	struct gdlm_lock *lpn = NULL;
-	int error;
-
-	if (lp->hold_null) {
-		printk(KERN_INFO "lock_dlm: lvb already held\n");
-		return 0;
-	}
-
-	error = gdlm_create_lp(lp->ls, &lp->lockname, &lpn);
-	if (error)
-		goto out;
-
-	lpn->lksb.sb_lvbptr = junk_lvb;
-	lpn->lvb = junk_lvb;
-
-	lpn->req = DLM_LOCK_NL;
-	lpn->lkf = DLM_LKF_VALBLK | DLM_LKF_EXPEDITE;
-	set_bit(LFL_NOBAST, &lpn->flags);
-	set_bit(LFL_INLOCK, &lpn->flags);
-	set_bit(LFL_AST_WAIT, &lpn->flags);
-
-	gdlm_do_lock(lpn);
-	wait_on_bit(&lpn->flags, LFL_AST_WAIT, gdlm_ast_wait, TASK_UNINTERRUPTIBLE);
-	error = lpn->lksb.sb_status;
-	if (error) {
-		printk(KERN_INFO "lock_dlm: hold_null_lock dlm error %d\n",
-		       error);
-		gdlm_delete_lp(lpn);
-		lpn = NULL;
-	}
-out:
-	lp->hold_null = lpn;
-	return error;
-}
-
-/* This cannot do a synchronous dlm request (requiring a lock_dlm thread to get
-   the completion) because gfs may call unhold_lvb() during a callback (from
-   the context of a lock_dlm thread) which could cause a deadlock since the
-   other lock_dlm thread could be engaged in recovery. */
-
-static void unhold_null_lock(struct gdlm_lock *lp)
-{
-	struct gdlm_lock *lpn = lp->hold_null;
-
-	gdlm_assert(lpn, "%x,%llx", lp->lockname.ln_type,
-		    (unsigned long long)lp->lockname.ln_number);
-	lpn->lksb.sb_lvbptr = NULL;
-	lpn->lvb = NULL;
-	set_bit(LFL_UNLOCK_DELETE, &lpn->flags);
-	gdlm_do_unlock(lpn);
-	lp->hold_null = NULL;
-}
-
-/* Acquire a NL lock because gfs requires the value block to remain
-   intact on the resource while the lvb is "held" even if it's holding no locks
-   on the resource. */
-
-int gdlm_hold_lvb(void *lock, char **lvbp)
-{
-	struct gdlm_lock *lp = lock;
-	int error;
-
-	error = gdlm_add_lvb(lp);
-	if (error)
-		return error;
-
-	*lvbp = lp->lvb;
-
-	error = hold_null_lock(lp);
-	if (error)
-		gdlm_del_lvb(lp);
-
-	return error;
-}
-
-void gdlm_unhold_lvb(void *lock, char *lvb)
-{
-	struct gdlm_lock *lp = lock;
-
-	unhold_null_lock(lp);
-	gdlm_del_lvb(lp);
-}
-
-void gdlm_submit_delayed(struct gdlm_ls *ls)
-{
-	struct gdlm_lock *lp, *safe;
-
-	spin_lock(&ls->async_lock);
-	list_for_each_entry_safe(lp, safe, &ls->delayed, delay_list) {
-		list_del_init(&lp->delay_list);
-		list_add_tail(&lp->delay_list, &ls->submit);
-	}
-	spin_unlock(&ls->async_lock);
-	wake_up(&ls->thread_wait);
-}
-
-int gdlm_release_all_locks(struct gdlm_ls *ls)
-{
-	struct gdlm_lock *lp, *safe;
-	int count = 0;
-
-	spin_lock(&ls->async_lock);
-	list_for_each_entry_safe(lp, safe, &ls->all_locks, all_list) {
-		list_del_init(&lp->all_list);
-
-		if (lp->lvb && lp->lvb != junk_lvb)
-			kfree(lp->lvb);
-		kfree(lp);
-		count++;
-	}
-	spin_unlock(&ls->async_lock);
-
-	return count;
-}
-
diff --git a/gfs-kernel/src/gfs/lock_dlm_main.c b/gfs-kernel/src/gfs/lock_dlm_main.c
deleted file mode 100644
index be7c625..0000000
--- a/gfs-kernel/src/gfs/lock_dlm_main.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <linux/init.h>
-
-#include "lock_dlm.h"
-
-int init_lock_dlm()
-{
-	int error;
-
-	error = gfs_register_lockproto(&gdlm_ops);
-	if (error) {
-		printk(KERN_WARNING "lock_dlm:  can't register protocol: %d\n",
-		       error);
-		return error;
-	}
-
-	error = gdlm_sysfs_init();
-	if (error) {
-		gfs_unregister_lockproto(&gdlm_ops);
-		return error;
-	}
-
-	printk(KERN_INFO
-	       "Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__);
-	return 0;
-}
-
-void exit_lock_dlm()
-{
-	gdlm_sysfs_exit();
-	gfs_unregister_lockproto(&gdlm_ops);
-}
diff --git a/gfs-kernel/src/gfs/lock_dlm_mount.c b/gfs-kernel/src/gfs/lock_dlm_mount.c
deleted file mode 100644
index ce5906a..0000000
--- a/gfs-kernel/src/gfs/lock_dlm_mount.c
+++ /dev/null
@@ -1,278 +0,0 @@
-#include "lock_dlm.h"
-
-const struct lm_lockops gdlm_ops;
-
-
-static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs_sbd *sdp,
-				 int flags, char *table_name)
-{
-	struct gdlm_ls *ls;
-	char buf[256], *p;
-
-	ls = kzalloc(sizeof(struct gdlm_ls), GFP_KERNEL);
-	if (!ls)
-		return NULL;
-
-	ls->drop_locks_count = GDLM_DROP_COUNT;
-	ls->drop_locks_period = GDLM_DROP_PERIOD;
-	ls->fscb = cb;
-	ls->sdp = sdp;
-	ls->fsflags = flags;
-	spin_lock_init(&ls->async_lock);
-	INIT_LIST_HEAD(&ls->complete);
-	INIT_LIST_HEAD(&ls->blocking);
-	INIT_LIST_HEAD(&ls->delayed);
-	INIT_LIST_HEAD(&ls->submit);
-	INIT_LIST_HEAD(&ls->all_locks);
-	init_waitqueue_head(&ls->thread_wait);
-	init_waitqueue_head(&ls->wait_control);
-	ls->thread1 = NULL;
-	ls->thread2 = NULL;
-	ls->drop_time = jiffies;
-	ls->jid = -1;
-
-	strncpy(buf, table_name, 256);
-	buf[255] = '\0';
-
-	p = strchr(buf, ':');
-	if (!p) {
-		log_info("invalid table_name \"%s\"", table_name);
-		kfree(ls);
-		return NULL;
-	}
-	*p = '\0';
-	p++;
-
-	strncpy(ls->clustername, buf, GDLM_NAME_LEN);
-	strncpy(ls->fsname, p, GDLM_NAME_LEN);
-
-	return ls;
-}
-
-static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir)
-{
-	char data[256];
-	char *options, *x, *y;
-	int error = 0;
-
-	memset(data, 0, 256);
-	strncpy(data, data_arg, 255);
-
-	if (!strlen(data)) {
-		log_error("no mount options, (u)mount helpers not installed");
-		return -EINVAL;
-	}
-
-	for (options = data; (x = strsep(&options, ":")); ) {
-		if (!*x)
-			continue;
-
-		y = strchr(x, '=');
-		if (y)
-			*y++ = 0;
-
-		if (!strcmp(x, "jid")) {
-			if (!y) {
-				log_error("need argument to jid");
-				error = -EINVAL;
-				break;
-			}
-			sscanf(y, "%u", &ls->jid);
-
-		} else if (!strcmp(x, "first")) {
-			if (!y) {
-				log_error("need argument to first");
-				error = -EINVAL;
-				break;
-			}
-			sscanf(y, "%u", &ls->first);
-
-		} else if (!strcmp(x, "id")) {
-			if (!y) {
-				log_error("need argument to id");
-				error = -EINVAL;
-				break;
-			}
-			sscanf(y, "%u", &ls->id);
-
-		} else if (!strcmp(x, "nodir")) {
-			if (!y) {
-				log_error("need argument to nodir");
-				error = -EINVAL;
-				break;
-			}
-			sscanf(y, "%u", nodir);
-
-		} else {
-			log_error("unkonwn option: %s", x);
-			error = -EINVAL;
-			break;
-		}
-	}
-
-	return error;
-}
-
-static int gdlm_mount(char *table_name, char *host_data,
-			lm_callback_t cb, void *cb_data,
-			unsigned int min_lvb_size, int flags,
-			struct lm_lockstruct *lockstruct,
-			struct kobject *fskobj)
-{
-	struct gdlm_ls *ls;
-	int error = -ENOMEM, nodir = 0;
-
-	if (min_lvb_size > GDLM_LVB_SIZE)
-		goto out;
-
-	ls = init_gdlm(cb, cb_data, flags, table_name);
-	if (!ls)
-		goto out;
-
-	error = make_args(ls, host_data, &nodir);
-	if (error)
-		goto out;
-
-	error = gdlm_init_threads(ls);
-	if (error)
-		goto out_free;
-
-	error = gdlm_kobject_setup(ls, fskobj);
-	if (error)
-		goto out_thread;
-
-	error = dlm_new_lockspace(ls->fsname, strlen(ls->fsname),
-				  &ls->dlm_lockspace,
-				  DLM_LSFL_FS | (nodir ? DLM_LSFL_NODIR : 0),
-				  GDLM_LVB_SIZE);
-	if (error) {
-		log_error("dlm_new_lockspace error %d", error);
-		goto out_kobj;
-	}
-
-	lockstruct->ls_jid = ls->jid;
-	lockstruct->ls_first = ls->first;
-	lockstruct->ls_lockspace = ls;
-	lockstruct->ls_ops = &gdlm_ops;
-	lockstruct->ls_flags = 0;
-	lockstruct->ls_lvb_size = GDLM_LVB_SIZE;
-	return 0;
-
-out_kobj:
-	gdlm_kobject_release(ls);
-out_thread:
-	gdlm_release_threads(ls);
-out_free:
-	kfree(ls);
-out:
-	return error;
-}
-
-static void gdlm_unmount(void *lockspace)
-{
-	struct gdlm_ls *ls = lockspace;
-	int rv;
-
-	log_debug("unmount flags %lx", ls->flags);
-
-	/* FIXME: serialize unmount and withdraw in case they
-	   happen at once.  Also, if unmount follows withdraw,
-	   wait for withdraw to finish. */
-
-	if (test_bit(DFL_WITHDRAW, &ls->flags))
-		goto out;
-
-	gdlm_kobject_release(ls);
-	dlm_release_lockspace(ls->dlm_lockspace, 2);
-	gdlm_release_threads(ls);
-	rv = gdlm_release_all_locks(ls);
-	if (rv)
-		log_info("gdlm_unmount: %d stray locks freed", rv);
-out:
-	kfree(ls);
-}
-
-static void gdlm_recovery_done(void *lockspace, unsigned int jid,
-                               unsigned int message)
-{
-	char env_jid[20];
-	char env_status[20];
-	char *envp[] = { env_jid, env_status, NULL };
-	struct gdlm_ls *ls = lockspace;
-	ls->recover_jid_done = jid;
-	ls->recover_jid_status = message;
-	sprintf(env_jid, "JID=%d", jid);
-	sprintf(env_status, "RECOVERY=%s",
-		message == LM_RD_SUCCESS ? "Done" : "Failed");
-	kobject_uevent_env(&ls->kobj, KOBJ_CHANGE, envp);
-}
-
-static void gdlm_others_may_mount(void *lockspace)
-{
-	char *message = "FIRSTMOUNT=Done";
-	char *envp[] = { message, NULL };
-	struct gdlm_ls *ls = lockspace;
-	ls->first_done = 1;
-	kobject_uevent_env(&ls->kobj, KOBJ_CHANGE, envp);
-}
-
-/* Userspace gets the offline uevent, blocks new gfs locks on
-   other mounters, and lets us know (sets WITHDRAW flag).  Then,
-   userspace leaves the mount group while we leave the lockspace. */
-
-static void gdlm_withdraw(void *lockspace)
-{
-	struct gdlm_ls *ls = lockspace;
-
-	kobject_uevent(&ls->kobj, KOBJ_OFFLINE);
-
-	wait_event_interruptible(ls->wait_control,
-				 test_bit(DFL_WITHDRAW, &ls->flags));
-
-	dlm_release_lockspace(ls->dlm_lockspace, 2);
-	gdlm_release_threads(ls);
-	gdlm_release_all_locks(ls);
-	gdlm_kobject_release(ls);
-}
-
-static int gdlm_plock(void *lockspace, struct lm_lockname *name,
-	       struct file *file, int cmd, struct file_lock *fl)
-{
-	struct gdlm_ls *ls = lockspace;
-	return dlm_posix_lock(ls->dlm_lockspace, name->ln_number, file, cmd, fl);
-}
-
-static int gdlm_punlock(void *lockspace, struct lm_lockname *name,
-		 struct file *file, struct file_lock *fl)
-{
-	struct gdlm_ls *ls = lockspace;
-	return dlm_posix_unlock(ls->dlm_lockspace, name->ln_number, file, fl);
-}
-
-static int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
-		   struct file *file, struct file_lock *fl)
-{
-	struct gdlm_ls *ls = lockspace;
-	return dlm_posix_get(ls->dlm_lockspace, name->ln_number, file, fl);
-}
-
-const struct lm_lockops gdlm_ops = {
-	.lm_proto_name = "lock_dlm",
-	.lm_mount = gdlm_mount,
-	.lm_others_may_mount = gdlm_others_may_mount,
-	.lm_unmount = gdlm_unmount,
-	.lm_withdraw = gdlm_withdraw,
-	.lm_get_lock = gdlm_get_lock,
-	.lm_put_lock = gdlm_put_lock,
-	.lm_lock = gdlm_lock,
-	.lm_unlock = gdlm_unlock,
-	.lm_plock = gdlm_plock,
-	.lm_punlock = gdlm_punlock,
-	.lm_plock_get = gdlm_plock_get,
-	.lm_cancel = gdlm_cancel,
-	.lm_hold_lvb = gdlm_hold_lvb,
-	.lm_unhold_lvb = gdlm_unhold_lvb,
-	.lm_recovery_done = gdlm_recovery_done,
-	.lm_owner = THIS_MODULE,
-};
-
diff --git a/gfs-kernel/src/gfs/lock_dlm_sysfs.c b/gfs-kernel/src/gfs/lock_dlm_sysfs.c
deleted file mode 100644
index 01445a5..0000000
--- a/gfs-kernel/src/gfs/lock_dlm_sysfs.c
+++ /dev/null
@@ -1,229 +0,0 @@
-#include <linux/ctype.h>
-#include <linux/stat.h>
-
-#include "lock_dlm.h"
-
-static ssize_t proto_name_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%s\n", gdlm_ops.lm_proto_name);
-}
-
-static ssize_t block_show(struct gdlm_ls *ls, char *buf)
-{
-	ssize_t ret;
-	int val = 0;
-
-	if (test_bit(DFL_BLOCK_LOCKS, &ls->flags))
-		val = 1;
-	ret = sprintf(buf, "%d\n", val);
-	return ret;
-}
-
-static ssize_t block_store(struct gdlm_ls *ls, const char *buf, size_t len)
-{
-	ssize_t ret = len;
-	int val;
-
-	val = simple_strtol(buf, NULL, 0);
-
-	if (val == 1)
-		set_bit(DFL_BLOCK_LOCKS, &ls->flags);
-	else if (val == 0) {
-		clear_bit(DFL_BLOCK_LOCKS, &ls->flags);
-		gdlm_submit_delayed(ls);
-	} else {
-		ret = -EINVAL;
-	}
-	return ret;
-}
-
-static ssize_t withdraw_show(struct gdlm_ls *ls, char *buf)
-{
-	ssize_t ret;
-	int val = 0;
-
-	if (test_bit(DFL_WITHDRAW, &ls->flags))
-		val = 1;
-	ret = sprintf(buf, "%d\n", val);
-	return ret;
-}
-
-static ssize_t withdraw_store(struct gdlm_ls *ls, const char *buf, size_t len)
-{
-	ssize_t ret = len;
-	int val;
-
-	val = simple_strtol(buf, NULL, 0);
-
-	if (val == 1)
-		set_bit(DFL_WITHDRAW, &ls->flags);
-	else
-		ret = -EINVAL;
-	wake_up(&ls->wait_control);
-	return ret;
-}
-
-static ssize_t id_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%u\n", ls->id);
-}
-
-static ssize_t jid_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->jid);
-}
-
-static ssize_t first_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->first);
-}
-
-static ssize_t first_done_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->first_done);
-}
-
-static ssize_t recover_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->recover_jid);
-}
-
-static ssize_t recover_store(struct gdlm_ls *ls, const char *buf, size_t len)
-{
-	ls->recover_jid = simple_strtol(buf, NULL, 0);
-	ls->fscb(ls->sdp, LM_CB_NEED_RECOVERY, &ls->recover_jid);
-	return len;
-}
-
-static ssize_t recover_done_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->recover_jid_done);
-}
-
-static ssize_t recover_status_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->recover_jid_status);
-}
-
-static ssize_t drop_count_show(struct gdlm_ls *ls, char *buf)
-{
-	return sprintf(buf, "%d\n", ls->drop_locks_count);
-}
-
-static ssize_t drop_count_store(struct gdlm_ls *ls, const char *buf, size_t len)
-{
-	ls->drop_locks_count = simple_strtol(buf, NULL, 0);
-	return len;
-}
-
-struct gdlm_attr {
-	struct attribute attr;
-	ssize_t (*show)(struct gdlm_ls *, char *);
-	ssize_t (*store)(struct gdlm_ls *, const char *, size_t);
-};
-
-#define GDLM_ATTR(_name,_mode,_show,_store) \
-static struct gdlm_attr gdlm_attr_##_name = __ATTR(_name,_mode,_show,_store)
-
-GDLM_ATTR(proto_name,     0444, proto_name_show,     NULL);
-GDLM_ATTR(block,          0644, block_show,          block_store);
-GDLM_ATTR(withdraw,       0644, withdraw_show,       withdraw_store);
-GDLM_ATTR(id,             0444, id_show,             NULL);
-GDLM_ATTR(jid,            0444, jid_show,            NULL);
-GDLM_ATTR(first,          0444, first_show,          NULL);
-GDLM_ATTR(first_done,     0444, first_done_show,     NULL);
-GDLM_ATTR(recover,        0644, recover_show,        recover_store);
-GDLM_ATTR(recover_done,   0444, recover_done_show,   NULL);
-GDLM_ATTR(recover_status, 0444, recover_status_show, NULL);
-GDLM_ATTR(drop_count,     0644, drop_count_show,     drop_count_store);
-
-static struct attribute *gdlm_attrs[] = {
-	&gdlm_attr_proto_name.attr,
-	&gdlm_attr_block.attr,
-	&gdlm_attr_withdraw.attr,
-	&gdlm_attr_id.attr,
-	&gdlm_attr_jid.attr,
-	&gdlm_attr_first.attr,
-	&gdlm_attr_first_done.attr,
-	&gdlm_attr_recover.attr,
-	&gdlm_attr_recover_done.attr,
-	&gdlm_attr_recover_status.attr,
-	&gdlm_attr_drop_count.attr,
-	NULL,
-};
-
-static ssize_t gdlm_attr_show(struct kobject *kobj, struct attribute *attr,
-			      char *buf)
-{
-	struct gdlm_ls *ls = container_of(kobj, struct gdlm_ls, kobj);
-	struct gdlm_attr *a = container_of(attr, struct gdlm_attr, attr);
-	return a->show ? a->show(ls, buf) : 0;
-}
-
-static ssize_t gdlm_attr_store(struct kobject *kobj, struct attribute *attr,
-			       const char *buf, size_t len)
-{
-	struct gdlm_ls *ls = container_of(kobj, struct gdlm_ls, kobj);
-	struct gdlm_attr *a = container_of(attr, struct gdlm_attr, attr);
-	return a->store ? a->store(ls, buf, len) : len;
-}
-
-static struct sysfs_ops gdlm_attr_ops = {
-	.show  = gdlm_attr_show,
-	.store = gdlm_attr_store,
-};
-
-static struct kobj_type gdlm_ktype = {
-	.default_attrs = gdlm_attrs,
-	.sysfs_ops     = &gdlm_attr_ops,
-};
-
-static struct kset *gdlm_kset;
-
-int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj)
-{
-	int error;
-
-	ls->kobj.kset = gdlm_kset;
-	error = kobject_init_and_add(&ls->kobj, &gdlm_ktype, fskobj,
-				     "lock_module");
-	if (error)
-		log_error("can't register kobj %d", error);
-	kobject_uevent(&ls->kobj, KOBJ_ADD);
-
-	return error;
-}
-
-void gdlm_kobject_release(struct gdlm_ls *ls)
-{
-	kobject_put(&ls->kobj);
-}
-
-static int gdlm_uevent(struct kset *kset, struct kobject *kobj,
-		       struct kobj_uevent_env *env)
-{
-	struct gdlm_ls *ls = container_of(kobj, struct gdlm_ls, kobj);
-	add_uevent_var(env, "LOCKTABLE=%s:%s", ls->clustername, ls->fsname);
-	add_uevent_var(env, "LOCKPROTO=lock_dlm");
-	return 0;
-}
-
-static struct kset_uevent_ops gdlm_uevent_ops = {
-	.uevent = gdlm_uevent,
-};
-
-int gdlm_sysfs_init(void)
-{
-	gdlm_kset = kset_create_and_add("lock_dlm_gfs", &gdlm_uevent_ops, kernel_kobj);
-	if (!gdlm_kset) {
-		printk(KERN_WARNING "%s: can not create kset\n", __FUNCTION__);
-		return -ENOMEM;
-	}
-	return 0;
-}
-
-void gdlm_sysfs_exit(void)
-{
-	kset_unregister(gdlm_kset);
-}
-
diff --git a/gfs-kernel/src/gfs/lock_dlm_thread.c b/gfs-kernel/src/gfs/lock_dlm_thread.c
deleted file mode 100644
index 58641c7..0000000
--- a/gfs-kernel/src/gfs/lock_dlm_thread.c
+++ /dev/null
@@ -1,358 +0,0 @@
-#include "lock_dlm.h"
-
-/* A lock placed on this queue is re-submitted to DLM as soon as the lock_dlm
-   thread gets to it. */
-
-static void queue_submit(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-
-	spin_lock(&ls->async_lock);
-	list_add_tail(&lp->delay_list, &ls->submit);
-	spin_unlock(&ls->async_lock);
-	wake_up(&ls->thread_wait);
-}
-
-static void process_blocking(struct gdlm_lock *lp, int bast_mode)
-{
-	struct gdlm_ls *ls = lp->ls;
-	unsigned int cb = 0;
-
-	switch (gdlm_make_lmstate(bast_mode)) {
-	case LM_ST_EXCLUSIVE:
-		cb = LM_CB_NEED_E;
-		break;
-	case LM_ST_DEFERRED:
-		cb = LM_CB_NEED_D;
-		break;
-	case LM_ST_SHARED:
-		cb = LM_CB_NEED_S;
-		break;
-	default:
-		gdlm_assert(0, "unknown bast mode %u", lp->bast_mode);
-	}
-
-	ls->fscb(ls->sdp, cb, &lp->lockname);
-}
-
-static void wake_up_ast(struct gdlm_lock *lp)
-{
-	clear_bit(LFL_AST_WAIT, &lp->flags);
-	smp_mb__after_clear_bit();
-	wake_up_bit(&lp->flags, LFL_AST_WAIT);
-}
-
-static void process_complete(struct gdlm_lock *lp)
-{
-	struct gdlm_ls *ls = lp->ls;
-	struct lm_async_cb acb;
-	s16 prev_mode = lp->cur;
-
-	memset(&acb, 0, sizeof(acb));
-
-	if (lp->lksb.sb_status == -DLM_ECANCEL) {
-		log_info("complete dlm cancel %x,%llx flags %lx",
-		 	 lp->lockname.ln_type,
-			 (unsigned long long)lp->lockname.ln_number,
-			 lp->flags);
-
-		lp->req = lp->cur;
-		acb.lc_ret |= LM_OUT_CANCELED;
-		if (lp->cur == DLM_LOCK_IV)
-			lp->lksb.sb_lkid = 0;
-		goto out;
-	}
-
-	if (test_and_clear_bit(LFL_DLM_UNLOCK, &lp->flags)) {
-		if (lp->lksb.sb_status != -DLM_EUNLOCK) {
-			log_info("unlock sb_status %d %x,%llx flags %lx",
-				 lp->lksb.sb_status, lp->lockname.ln_type,
-				 (unsigned long long)lp->lockname.ln_number,
-				 lp->flags);
-			return;
-		}
-
-		lp->cur = DLM_LOCK_IV;
-		lp->req = DLM_LOCK_IV;
-		lp->lksb.sb_lkid = 0;
-
-		if (test_and_clear_bit(LFL_UNLOCK_DELETE, &lp->flags)) {
-			gdlm_delete_lp(lp);
-			return;
-		}
-		goto out;
-	}
-
-	if (lp->lksb.sb_flags & DLM_SBF_VALNOTVALID)
-		memset(lp->lksb.sb_lvbptr, 0, GDLM_LVB_SIZE);
-
-	if (lp->lksb.sb_flags & DLM_SBF_ALTMODE) {
-		if (lp->req == DLM_LOCK_PR)
-			lp->req = DLM_LOCK_CW;
-		else if (lp->req == DLM_LOCK_CW)
-			lp->req = DLM_LOCK_PR;
-	}
-
-	/*
-	 * A canceled lock request.  The lock was just taken off the delayed
-	 * list and was never even submitted to dlm.
-	 */
-
-	if (test_and_clear_bit(LFL_CANCEL, &lp->flags)) {
-		log_info("complete internal cancel %x,%llx",
-		 	 lp->lockname.ln_type,
-			 (unsigned long long)lp->lockname.ln_number);
-		lp->req = lp->cur;
-		acb.lc_ret |= LM_OUT_CANCELED;
-		goto out;
-	}
-
-	/*
-	 * An error occured.
-	 */
-
-	if (lp->lksb.sb_status) {
-		/* a "normal" error */
-		if ((lp->lksb.sb_status == -EAGAIN) &&
-		    (lp->lkf & DLM_LKF_NOQUEUE)) {
-			lp->req = lp->cur;
-			if (lp->cur == DLM_LOCK_IV)
-				lp->lksb.sb_lkid = 0;
-			goto out;
-		}
-
-		/* this could only happen with cancels I think */
-		log_info("ast sb_status %d %x,%llx flags %lx",
-			 lp->lksb.sb_status, lp->lockname.ln_type,
-			 (unsigned long long)lp->lockname.ln_number,
-			 lp->flags);
-		return;
-	}
-
-	/*
-	 * This is an AST for an EX->EX conversion for sync_lvb from GFS.
-	 */
-
-	if (test_and_clear_bit(LFL_SYNC_LVB, &lp->flags)) {
-		wake_up_ast(lp);
-		return;
-	}
-
-	/*
-	 * A lock has been demoted to NL because it initially completed during
-	 * BLOCK_LOCKS.  Now it must be requested in the originally requested
-	 * mode.
-	 */
-
-	if (test_and_clear_bit(LFL_REREQUEST, &lp->flags)) {
-		gdlm_assert(lp->req == DLM_LOCK_NL, "%x,%llx",
-			    lp->lockname.ln_type,
-			    (unsigned long long)lp->lockname.ln_number);
-		gdlm_assert(lp->prev_req > DLM_LOCK_NL, "%x,%llx",
-			    lp->lockname.ln_type,
-			    (unsigned long long)lp->lockname.ln_number);
-
-		lp->cur = DLM_LOCK_NL;
-		lp->req = lp->prev_req;
-		lp->prev_req = DLM_LOCK_IV;
-		lp->lkf &= ~DLM_LKF_CONVDEADLK;
-
-		set_bit(LFL_NOCACHE, &lp->flags);
-
-		if (test_bit(DFL_BLOCK_LOCKS, &ls->flags) &&
-		    !test_bit(LFL_NOBLOCK, &lp->flags))
-			gdlm_queue_delayed(lp);
-		else
-			queue_submit(lp);
-		return;
-	}
-
-	/*
-	 * A request is granted during dlm recovery.  It may be granted
-	 * because the locks of a failed node were cleared.  In that case,
-	 * there may be inconsistent data beneath this lock and we must wait
-	 * for recovery to complete to use it.  When gfs recovery is done this
-	 * granted lock will be converted to NL and then reacquired in this
-	 * granted state.
-	 */
-
-	if (test_bit(DFL_BLOCK_LOCKS, &ls->flags) &&
-	    !test_bit(LFL_NOBLOCK, &lp->flags) &&
-	    lp->req != DLM_LOCK_NL) {
-
-		lp->cur = lp->req;
-		lp->prev_req = lp->req;
-		lp->req = DLM_LOCK_NL;
-		lp->lkf |= DLM_LKF_CONVERT;
-		lp->lkf &= ~DLM_LKF_CONVDEADLK;
-
-		log_debug("rereq %x,%llx id %x %d,%d",
-			  lp->lockname.ln_type,
-			  (unsigned long long)lp->lockname.ln_number,
-			  lp->lksb.sb_lkid, lp->cur, lp->req);
-
-		set_bit(LFL_REREQUEST, &lp->flags);
-		queue_submit(lp);
-		return;
-	}
-
-	/*
-	 * DLM demoted the lock to NL before it was granted so GFS must be
-	 * told it cannot cache data for this lock.
-	 */
-
-	if (lp->lksb.sb_flags & DLM_SBF_DEMOTED)
-		set_bit(LFL_NOCACHE, &lp->flags);
-
-out:
-	/*
-	 * This is an internal lock_dlm lock
-	 */
-
-	if (test_bit(LFL_INLOCK, &lp->flags)) {
-		clear_bit(LFL_NOBLOCK, &lp->flags);
-		lp->cur = lp->req;
-		wake_up_ast(lp);
-		return;
-	}
-
-	/*
-	 * Normal completion of a lock request.  Tell GFS it now has the lock.
-	 */
-
-	clear_bit(LFL_NOBLOCK, &lp->flags);
-	lp->cur = lp->req;
-
-	acb.lc_name = lp->lockname;
-	acb.lc_ret |= gdlm_make_lmstate(lp->cur);
-
-	if (!test_and_clear_bit(LFL_NOCACHE, &lp->flags) &&
-	    (lp->cur > DLM_LOCK_NL) && (prev_mode > DLM_LOCK_NL))
-		acb.lc_ret |= LM_OUT_CACHEABLE;
-
-	ls->fscb(ls->sdp, LM_CB_ASYNC, &acb);
-}
-
-static inline int no_work(struct gdlm_ls *ls, int blocking)
-{
-	int ret;
-
-	spin_lock(&ls->async_lock);
-	ret = list_empty(&ls->complete) && list_empty(&ls->submit);
-	if (ret && blocking)
-		ret = list_empty(&ls->blocking);
-	spin_unlock(&ls->async_lock);
-
-	return ret;
-}
-
-static inline int check_drop(struct gdlm_ls *ls)
-{
-	if (!ls->drop_locks_count)
-		return 0;
-
-	if (time_after(jiffies, ls->drop_time + ls->drop_locks_period * HZ)) {
-		ls->drop_time = jiffies;
-		if (ls->all_locks_count >= ls->drop_locks_count)
-			return 1;
-	}
-	return 0;
-}
-
-static int gdlm_thread(void *data, int blist)
-{
-	struct gdlm_ls *ls = (struct gdlm_ls *) data;
-	struct gdlm_lock *lp = NULL;
-	uint8_t complete, blocking, submit, drop;
-
-	/* Only thread1 is allowed to do blocking callbacks since gfs
-	   may wait for a completion callback within a blocking cb. */
-
-	while (!kthread_should_stop()) {
-		wait_event_interruptible(ls->thread_wait,
-				!no_work(ls, blist) || kthread_should_stop());
-
-		complete = blocking = submit = drop = 0;
-
-		spin_lock(&ls->async_lock);
-
-		if (blist && !list_empty(&ls->blocking)) {
-			lp = list_entry(ls->blocking.next, struct gdlm_lock,
-					blist);
-			list_del_init(&lp->blist);
-			blocking = lp->bast_mode;
-			lp->bast_mode = 0;
-		} else if (!list_empty(&ls->complete)) {
-			lp = list_entry(ls->complete.next, struct gdlm_lock,
-					clist);
-			list_del_init(&lp->clist);
-			complete = 1;
-		} else if (!list_empty(&ls->submit)) {
-			lp = list_entry(ls->submit.next, struct gdlm_lock,
-					delay_list);
-			list_del_init(&lp->delay_list);
-			submit = 1;
-		}
-
-		drop = check_drop(ls);
-		spin_unlock(&ls->async_lock);
-
-		if (complete)
-			process_complete(lp);
-
-		else if (blocking)
-			process_blocking(lp, blocking);
-
-		else if (submit)
-			gdlm_do_lock(lp);
-
-		if (drop)
-			ls->fscb(ls->sdp, LM_CB_DROPLOCKS, NULL);
-
-		schedule();
-	}
-
-	return 0;
-}
-
-static int gdlm_thread1(void *data)
-{
-	return gdlm_thread(data, 1);
-}
-
-static int gdlm_thread2(void *data)
-{
-	return gdlm_thread(data, 0);
-}
-
-int gdlm_init_threads(struct gdlm_ls *ls)
-{
-	struct task_struct *p;
-	int error;
-
-	p = kthread_run(gdlm_thread1, ls, "lock_dlm1");
-	error = IS_ERR(p);
-	if (error) {
-		log_error("can't start lock_dlm1 thread %d", error);
-		return error;
-	}
-	ls->thread1 = p;
-
-	p = kthread_run(gdlm_thread2, ls, "lock_dlm2");
-	error = IS_ERR(p);
-	if (error) {
-		log_error("can't start lock_dlm2 thread %d", error);
-		kthread_stop(ls->thread1);
-		return error;
-	}
-	ls->thread2 = p;
-
-	return 0;
-}
-
-void gdlm_release_threads(struct gdlm_ls *ls)
-{
-	kthread_stop(ls->thread1);
-	kthread_stop(ls->thread2);
-}
-
diff --git a/gfs-kernel/src/gfs/lock_nolock_main.c b/gfs-kernel/src/gfs/lock_nolock_main.c
deleted file mode 100644
index 18315ef..0000000
--- a/gfs-kernel/src/gfs/lock_nolock_main.c
+++ /dev/null
@@ -1,221 +0,0 @@
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/fs.h>
-#include "lm_interface.h"
-
-struct nolock_lockspace {
-	unsigned int nl_lvb_size;
-};
-
-static const struct lm_lockops nolock_ops;
-
-static int nolock_mount(char *table_name, char *host_data,
-			lm_callback_t cb, void *cb_data,
-			unsigned int min_lvb_size, int flags,
-			struct lm_lockstruct *lockstruct,
-			struct kobject *fskobj)
-{
-	char *c;
-	unsigned int jid;
-	struct nolock_lockspace *nl;
-
-	c = strstr(host_data, "jid=");
-	if (!c)
-		jid = 0;
-	else {
-		c += 4;
-		sscanf(c, "%u", &jid);
-	}
-
-	nl = kzalloc(sizeof(struct nolock_lockspace), GFP_KERNEL);
-	if (!nl)
-		return -ENOMEM;
-
-	nl->nl_lvb_size = min_lvb_size;
-
-	lockstruct->ls_jid = jid;
-	lockstruct->ls_first = 1;
-	lockstruct->ls_lvb_size = min_lvb_size;
-	lockstruct->ls_lockspace = nl;
-	lockstruct->ls_ops = &nolock_ops;
-	lockstruct->ls_flags = LM_LSFLAG_LOCAL;
-
-	return 0;
-}
-
-static void nolock_others_may_mount(void *lockspace)
-{
-}
-
-static void nolock_unmount(void *lockspace)
-{
-	struct nolock_lockspace *nl = lockspace;
-	kfree(nl);
-}
-
-static void nolock_withdraw(void *lockspace)
-{
-}
-
-/**
- * nolock_get_lock - get a lm_lock_t given a descripton of the lock
- * @lockspace: the lockspace the lock lives in
- * @name: the name of the lock
- * @lockp: return the lm_lock_t here
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static int nolock_get_lock(void *lockspace, struct lm_lockname *name,
-			   void **lockp)
-{
-	*lockp = lockspace;
-	return 0;
-}
-
-/**
- * nolock_put_lock - get rid of a lock structure
- * @lock: the lock to throw away
- *
- */
-
-static void nolock_put_lock(void *lock)
-{
-}
-
-/**
- * nolock_lock - acquire a lock
- * @lock: the lock to manipulate
- * @cur_state: the current state
- * @req_state: the requested state
- * @flags: modifier flags
- *
- * Returns: A bitmap of LM_OUT_*
- */
-
-static unsigned int nolock_lock(void *lock, unsigned int cur_state,
-				unsigned int req_state, unsigned int flags)
-{
-	return req_state | LM_OUT_CACHEABLE;
-}
-
-/**
- * nolock_unlock - unlock a lock
- * @lock: the lock to manipulate
- * @cur_state: the current state
- *
- * Returns: 0
- */
-
-static unsigned int nolock_unlock(void *lock, unsigned int cur_state)
-{
-	return 0;
-}
-
-static void nolock_cancel(void *lock)
-{
-}
-
-/**
- * nolock_hold_lvb - hold on to a lock value block
- * @lock: the lock the LVB is associated with
- * @lvbp: return the lm_lvb_t here
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static int nolock_hold_lvb(void *lock, char **lvbp)
-{
-	struct nolock_lockspace *nl = lock;
-	int error = 0;
-
-	*lvbp = kzalloc(nl->nl_lvb_size, GFP_NOFS);
-	if (!*lvbp)
-		error = -ENOMEM;
-
-	return error;
-}
-
-/**
- * nolock_unhold_lvb - release a LVB
- * @lock: the lock the LVB is associated with
- * @lvb: the lock value block
- *
- */
-
-static void nolock_unhold_lvb(void *lock, char *lvb)
-{
-	kfree(lvb);
-}
-
-static int nolock_plock_get(void *lockspace, struct lm_lockname *name,
-			    struct file *file, struct file_lock *fl)
-{
-	posix_test_lock(file, fl);
-
-	return 0;
-}
-
-static int nolock_plock(void *lockspace, struct lm_lockname *name,
-			struct file *file, int cmd, struct file_lock *fl)
-{
-	int error;
-	error = posix_lock_file_wait(file, fl);
-	return error;
-}
-
-static int nolock_punlock(void *lockspace, struct lm_lockname *name,
-			  struct file *file, struct file_lock *fl)
-{
-	int error;
-	error = posix_lock_file_wait(file, fl);
-	return error;
-}
-
-static void nolock_recovery_done(void *lockspace, unsigned int jid,
-				 unsigned int message)
-{
-}
-
-static const struct lm_lockops nolock_ops = {
-	.lm_proto_name = "lock_nolock",
-	.lm_mount = nolock_mount,
-	.lm_others_may_mount = nolock_others_may_mount,
-	.lm_unmount = nolock_unmount,
-	.lm_withdraw = nolock_withdraw,
-	.lm_get_lock = nolock_get_lock,
-	.lm_put_lock = nolock_put_lock,
-	.lm_lock = nolock_lock,
-	.lm_unlock = nolock_unlock,
-	.lm_cancel = nolock_cancel,
-	.lm_hold_lvb = nolock_hold_lvb,
-	.lm_unhold_lvb = nolock_unhold_lvb,
-	.lm_plock_get = nolock_plock_get,
-	.lm_plock = nolock_plock,
-	.lm_punlock = nolock_punlock,
-	.lm_recovery_done = nolock_recovery_done,
-	.lm_owner = THIS_MODULE,
-};
-
-int init_nolock()
-{
-	int error;
-
-	error = gfs_register_lockproto(&nolock_ops);
-	if (error) {
-		printk(KERN_WARNING
-		       "lock_nolock: can't register protocol: %d\n", error);
-		return error;
-	}
-
-	printk(KERN_INFO
-	       "Lock_Nolock (built %s %s) installed\n", __DATE__, __TIME__);
-	return 0;
-}
-
-void exit_nolock()
-{
-	gfs_unregister_lockproto(&nolock_ops);
-}
diff --git a/gfs-kernel/src/gfs/locking.c b/gfs-kernel/src/gfs/locking.c
deleted file mode 100644
index 26c3c51..0000000
--- a/gfs-kernel/src/gfs/locking.c
+++ /dev/null
@@ -1,171 +0,0 @@
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/wait.h>
-#include <linux/sched.h>
-#include <linux/kmod.h>
-#include <linux/fs.h>
-#include <linux/delay.h>
-#include "lm_interface.h"
-
-struct lmh_wrapper {
-	struct list_head lw_list;
-	const struct lm_lockops *lw_ops;
-};
-
-/* List of registered low-level locking protocols.  A file system selects one
-   of them by name at mount time, e.g. lock_nolock, lock_dlm. */
-
-static LIST_HEAD(lmh_list);
-static DEFINE_MUTEX(lmh_lock);
-
-/**
- * gfs_register_lockproto - Register a low-level locking protocol
- * @proto: the protocol definition
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-int gfs_register_lockproto(const struct lm_lockops *proto)
-{
-	struct lmh_wrapper *lw;
-
-	mutex_lock(&lmh_lock);
-
-	list_for_each_entry(lw, &lmh_list, lw_list) {
-		if (!strcmp(lw->lw_ops->lm_proto_name, proto->lm_proto_name)) {
-			mutex_unlock(&lmh_lock);
-			printk(KERN_INFO "GFS2: protocol %s already exists\n",
-			       proto->lm_proto_name);
-			return -EEXIST;
-		}
-	}
-
-	lw = kzalloc(sizeof(struct lmh_wrapper), GFP_KERNEL);
-	if (!lw) {
-		mutex_unlock(&lmh_lock);
-		return -ENOMEM;
-	}
-
-	lw->lw_ops = proto;
-	list_add(&lw->lw_list, &lmh_list);
-
-	mutex_unlock(&lmh_lock);
-
-	return 0;
-}
-
-/**
- * gfs_unregister_lockproto - Unregister a low-level locking protocol
- * @proto: the protocol definition
- *
- */
-
-void gfs_unregister_lockproto(const struct lm_lockops *proto)
-{
-	struct lmh_wrapper *lw;
-
-	mutex_lock(&lmh_lock);
-
-	list_for_each_entry(lw, &lmh_list, lw_list) {
-		if (!strcmp(lw->lw_ops->lm_proto_name, proto->lm_proto_name)) {
-			list_del(&lw->lw_list);
-			mutex_unlock(&lmh_lock);
-			kfree(lw);
-			return;
-		}
-	}
-
-	mutex_unlock(&lmh_lock);
-
-	printk(KERN_WARNING "GFS2: can't unregister lock protocol %s\n",
-	       proto->lm_proto_name);
-}
-
-/**
- * gfs_mount_lockproto - Mount a lock protocol
- * @proto_name - the name of the protocol
- * @table_name - the name of the lock space
- * @host_data - data specific to this host
- * @cb - the callback to the code using the lock module
- * @sdp - The GFS2 superblock
- * @min_lvb_size - the mininum LVB size that the caller can deal with
- * @flags - LM_MFLAG_*
- * @lockstruct - a structure returned describing the mount
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-int gfs_mount_lockproto(char *proto_name, char *table_name, char *host_data,
-			 lm_callback_t cb, void *cb_data,
-			 unsigned int min_lvb_size, int flags,
-			 struct lm_lockstruct *lockstruct,
-			 struct kobject *fskobj)
-{
-	struct lmh_wrapper *lw = NULL;
-	int try = 0;
-	int error, found;
-
-retry:
-	mutex_lock(&lmh_lock);
-
-	found = 0;
-	list_for_each_entry(lw, &lmh_list, lw_list) {
-		if (!strcmp(lw->lw_ops->lm_proto_name, proto_name)) {
-			found = 1;
-			break;
-		}
-	}
-
-	if (!found) {
-		if (!try && capable(CAP_SYS_MODULE)) {
-			try = 1;
-			mutex_unlock(&lmh_lock);
-			request_module(proto_name);
-			goto retry;
-		}
-		printk(KERN_INFO "GFS2: can't find protocol %s\n", proto_name);
-		error = -ENOENT;
-		goto out;
-	}
-
-	if (!try_module_get(lw->lw_ops->lm_owner)) {
-		try = 0;
-		mutex_unlock(&lmh_lock);
-		msleep(1000);
-		goto retry;
-	}
-
-	error = lw->lw_ops->lm_mount(table_name, host_data, cb, cb_data,
-				     min_lvb_size, flags, lockstruct, fskobj);
-	if (error)
-		module_put(lw->lw_ops->lm_owner);
-out:
-	mutex_unlock(&lmh_lock);
-	return error;
-}
-
-void gfs_unmount_lockproto(struct lm_lockstruct *lockstruct)
-{
-	mutex_lock(&lmh_lock);
-	lockstruct->ls_ops->lm_unmount(lockstruct->ls_lockspace);
-	if (lockstruct->ls_ops->lm_owner)
-		module_put(lockstruct->ls_ops->lm_owner);
-	mutex_unlock(&lmh_lock);
-}
-
-/**
- * gfs_withdraw_lockproto - abnormally unmount a lock module
- * @lockstruct: the lockstruct passed into mount
- *
- */
-
-void gfs_withdraw_lockproto(struct lm_lockstruct *lockstruct)
-{
-	mutex_lock(&lmh_lock);
-	lockstruct->ls_ops->lm_withdraw(lockstruct->ls_lockspace);
-	if (lockstruct->ls_ops->lm_owner)
-		module_put(lockstruct->ls_ops->lm_owner);
-	mutex_unlock(&lmh_lock);
-}
diff --git a/gfs-kernel/src/gfs/log.c b/gfs-kernel/src/gfs/log.c
deleted file mode 100644
index f8f2f6c..0000000
--- a/gfs-kernel/src/gfs/log.c
+++ /dev/null
@@ -1,1424 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "log.h"
-#include "lops.h"
-
-/**
- * gfs_struct2blk - compute stuff
- * @sdp: the filesystem
- * @nstruct: the number of structures
- * @ssize: the size of the structures
- *
- * Compute the number of log descriptor blocks needed to hold a certain number
- * of structures of a certain size.
- *
- * Returns: the number of blocks needed (minimum is always 1)
- */
-
-unsigned int
-gfs_struct2blk(struct gfs_sbd *sdp, unsigned int nstruct, unsigned int ssize)
-{
-	unsigned int blks;
-	unsigned int first, second;
-
-	blks = 1;
-	first = (sdp->sd_sb.sb_bsize - sizeof(struct gfs_log_descriptor)) / ssize;
-
-	if (nstruct > first) {
-		second = sdp->sd_sb.sb_bsize / ssize;
-		blks += DIV_RU(nstruct - first, second);
-	}
-
-	return blks;
-}
-
-/**
- * gfs_blk2seg - Convert number of blocks into number of segments
- * @sdp: The GFS superblock
- * @blocks: The number of blocks
- *
- * Returns: The number of journal segments
- */
-
-unsigned int
-gfs_blk2seg(struct gfs_sbd *sdp, unsigned int blocks)
-{
-	return DIV_RU(blocks, sdp->sd_sb.sb_seg_size - 1);
-}
-
-/**
- * log_distance - Compute distance between two journal blocks
- * @sdp: The GFS superblock
- * @newer: The most recent journal block of the pair
- * @older: The older journal block of the pair
- *
- *   Compute the distance (in the journal direction) between two
- *   blocks in the journal
- *
- * Returns: the distance in blocks
- */
-
-static __inline__ unsigned int
-log_distance(struct gfs_sbd *sdp, uint64_t newer, uint64_t older)
-{
-	int64_t dist;
-
-	dist = newer - older;
-	if (dist < 0)
-		dist += sdp->sd_jdesc.ji_nsegment * sdp->sd_sb.sb_seg_size;
-
-	return dist;
-}
-
-/**
- * log_incr_head - Increment journal head (next block to fill in journal)
- * @sdp: The GFS superblock
- * @head: the variable holding the head of the journal
- *
- * Increment journal head by one. 
- * At the end of the journal, wrap head back to the start.
- * Don't confuse journal/log head with a gfs_log_header!
- */
-
-static __inline__ void
-log_incr_head(struct gfs_sbd *sdp, uint64_t * head)
-{
-	struct gfs_jindex *jdesc = &sdp->sd_jdesc;
-
-	if (++*head ==
-	    jdesc->ji_addr + jdesc->ji_nsegment * sdp->sd_sb.sb_seg_size)
-		*head = jdesc->ji_addr;
-}
-
-/**
- * gfs_ail_start - Start I/O on the AIL
- * @sdp: the filesystem
- * @flags:  DIO_ALL -- flush *all* AIL transactions to disk
- *          default -- flush first-on-list AIL transaction to disk
- *
- */
-
-void
-gfs_ail_start(struct gfs_sbd *sdp, int flags)
-{
-	struct list_head *head = &sdp->sd_log_ail;
-	struct list_head *first, *tmp;
-	struct gfs_trans *first_tr, *tr;
-
-	gfs_log_lock(sdp);
-
-	if (list_empty(head)) {
-		gfs_log_unlock(sdp);
-		return;
-	}
-
-	first = head->prev;
-	first_tr = list_entry(first, struct gfs_trans, tr_list);
-	gfs_ail_start_trans(sdp, first_tr);
-
-	if (flags & DIO_ALL)
-		first_tr = NULL;
-
-	for (tmp = first->prev; tmp != head; tmp = tmp->prev) {
-		if (first_tr && gfs_ail_empty_trans(sdp, first_tr))
-			break;
-
-		tr = list_entry(tmp, struct gfs_trans, tr_list);
-		gfs_ail_start_trans(sdp, tr);
-	}
-
-	gfs_log_unlock(sdp);
-}
-
-/**
- * current_tail - Find block number of current log tail
- * @sdp: The GFS superblock
- *
- * Find the block number of the current tail of the log.
- * Assumes that the log lock is held.
- *
- * Returns: The tail's block number (must be on a log segment boundary)
- */
-
-static uint64_t
-current_tail(struct gfs_sbd *sdp)
-{
-	struct gfs_trans *tr;
-	uint64_t tail;
-
-	if (list_empty(&sdp->sd_log_ail)) {
-		tail = sdp->sd_log_head;
-
-		if (!gfs_log_is_header(sdp, tail)) {
-			tail--;
-			gfs_assert(sdp, gfs_log_is_header(sdp, tail), );
-		}
-	} else {
-		tr = list_entry(sdp->sd_log_ail.prev,
-				struct gfs_trans, tr_list);
-		tail = tr->tr_first_head;
-	}
-
-	return tail;
-}
-
-/**
- * gfs_ail_empty - move the tail of the log forward (if possible)
- * @sdp: the filesystem
- *
- * Returns: TRUE if the AIL is empty
- *
- * Checks each transaction on sd_log_ail, to see if it has been successfully
- *   flushed to in-place blocks on disk.  If so, removes trans from sd_log_ail,
- *   effectively advancing the tail of the log (freeing log segments so they
- *   can be overwritten).
- * Adds # freed log segments to sd_log_seg_free.
- */
-
-int
-gfs_ail_empty(struct gfs_sbd *sdp)
-{
-	struct list_head *head, *tmp, *prev;
-	struct gfs_trans *tr;
-	uint64_t oldtail, newtail;
-	unsigned int dist;
-	unsigned int segments;
-	int ret;
-
-	gfs_log_lock(sdp);
-
-	oldtail = current_tail(sdp);
-
-	for (head = &sdp->sd_log_ail, tmp = head->prev, prev = tmp->prev;
-	     tmp != head;
-	     tmp = prev, prev = tmp->prev) {
-		tr = list_entry(tmp, struct gfs_trans, tr_list);
-		if (gfs_ail_empty_trans(sdp, tr)) {
-			list_del(&tr->tr_list);
-			kfree(tr);
-		}
-	}
-
-	newtail = current_tail(sdp);
-
-	if (oldtail != newtail) {
-		dist = log_distance(sdp, newtail, oldtail);
-
-		segments = dist / sdp->sd_sb.sb_seg_size;
-		gfs_assert(sdp, segments * sdp->sd_sb.sb_seg_size == dist,);
-
-		sdp->sd_log_seg_ail2 += segments;
-		gfs_assert(sdp, sdp->sd_log_seg_free + sdp->sd_log_seg_ail2 <=
-			   sdp->sd_jdesc.ji_nsegment,); 
-	}
-
-	ret = list_empty(head);
-
-	gfs_log_unlock(sdp);
-
-	return ret;
-}
-
-/**
- * gfs_log_reserve - Make a log reservation
- * @sdp: The GFS superblock
- * @segments: The number of segments to reserve
- * @jump_queue: if TRUE, don't care about fairness ordering
- *
- * Returns: errno
- */
-
-int
-gfs_log_reserve(struct gfs_sbd *sdp, unsigned int segments, int jump_queue)
-{
-	struct list_head list;
-	unsigned int try = 0;
-
-	if (gfs_assert_warn(sdp, segments))
-		return -EINVAL;
-	if (gfs_assert_warn(sdp, segments < sdp->sd_jdesc.ji_nsegment))
-		return -EINVAL;
-
-	INIT_LIST_HEAD(&list);
-
-	for (;;) {
-		spin_lock(&sdp->sd_log_seg_lock);
-
-		if (list_empty(&list)) {
-			if (jump_queue)
-				list_add(&list, &sdp->sd_log_seg_list);
-			else {
-				list_add_tail(&list, &sdp->sd_log_seg_list);
-				while (sdp->sd_log_seg_list.next != &list) {
-					DECLARE_WAITQUEUE(__wait_chan, current);
-					set_current_state(TASK_UNINTERRUPTIBLE);
-					add_wait_queue(&sdp->sd_log_seg_wait,
-						       &__wait_chan);
-					spin_unlock(&sdp->sd_log_seg_lock);
-					schedule();
-					spin_lock(&sdp->sd_log_seg_lock);
-					remove_wait_queue(&sdp->sd_log_seg_wait,
-							  &__wait_chan);
-					set_current_state(TASK_RUNNING);
-				}
-			}
-		}
-
-		if (sdp->sd_log_seg_free > segments) {
-			sdp->sd_log_seg_free -= segments;
-			list_del(&list);
-			spin_unlock(&sdp->sd_log_seg_lock);
-			wake_up(&sdp->sd_log_seg_wait);
-			break;
-		}
-
-		spin_unlock(&sdp->sd_log_seg_lock);
-
-		if (try) {
-			gfs_log_flush(sdp);
-			gfs_ail_start(sdp, 0);
-		}
-
-		gfs_ail_empty(sdp);
-
-		try++;
-		yield();
-	}
-
-	return 0;
-}
-
-/**
- * gfs_log_release - Release a given number of log segments
- * @sdp: The GFS superblock
- * @segments: The number of segments
- *
- */
-
-void
-gfs_log_release(struct gfs_sbd *sdp, unsigned int segments)
-{
-	spin_lock(&sdp->sd_log_seg_lock);
-	sdp->sd_log_seg_free += segments;
-	gfs_assert(sdp, sdp->sd_log_seg_free + sdp->sd_log_seg_ail2 <=
-		   sdp->sd_jdesc.ji_nsegment,);
-	spin_unlock(&sdp->sd_log_seg_lock);
-}
-
-/**
- * log_get_header - Get and initialize a journal header buffer
- * @sdp: The GFS superblock
- * @tr: The transaction that needs a log header
- * @next: FALSE if this log header appears in midst of current transaction
- *        TRUE if this starts next transaction (and commits current trans)
- *
- * Returns: the initialized log buffer descriptor
- *
- * Initialize one of the transaction's pre-allocated buffers (and associated
- *   log buffer descriptor) to be a log header for this transaction.
- * A log header gets written to *each* log segment boundary block, so journal
- *   recovery will quickly be able to get its bearings.  A single transaction
- *   may span several log segments, which means that log headers will appear
- *   in the midst of that transaction (@next == FALSE).  These headers get
- *   added to trans' list of buffers to write to log.
- * Log commit is accomplished by writing the log header for the next
- *   transaction (@next == TRUE), with pre-incremented sequence number,
- *   and updated first-in-transaction block number.  These headers do *not* get
- *   added to trans' buffer list, since they are written separately to disk
- *   *after* the trans gets completely flushed to on-disk log.
- * NOTE:  This buffer will *not* get written to an in-place location in the
- *        filesystem; it is for use only within the log.
- */
-
-static struct gfs_log_buf *
-log_get_header(struct gfs_sbd *sdp, struct gfs_trans *tr, int next)
-{
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-	struct gfs_log_header header;
-
-	/* Make sure we're on a log segment boundary block */
-	gfs_assert(sdp, gfs_log_is_header(sdp, tr->tr_log_head),);
-
-	/* Grab a free log buffer descriptor (attached to trans) */
-	gfs_assert(sdp, tr->tr_num_free_bufs &&
-		   !list_empty(&tr->tr_free_bufs),);
-	lb = list_entry(tr->tr_free_bufs.next, struct gfs_log_buf, lb_list);
-	list_del(&lb->lb_list);
-	tr->tr_num_free_bufs--;
-
-	/* Grab a free log buffer (attached to trans) */
-	gfs_assert(sdp, tr->tr_num_free_bmem &&
-		   !list_empty(&tr->tr_free_bmem),);
-	bmem = tr->tr_free_bmem.next;
-	list_del(bmem);
-	tr->tr_num_free_bmem--;
-
-	/* Create "fake" bh to write bmem to log header block */
-	gfs_logbh_init(sdp, &lb->lb_bh, tr->tr_log_head, (char *)bmem);
-	memset(bmem, 0, sdp->sd_sb.sb_bsize);
-
-	memset(&header, 0, sizeof (header));
-
-	if (next) {
-		/* Fill in header for next transaction, committing previous */
-		header.lh_header.mh_magic = GFS_MAGIC;
-		header.lh_header.mh_type = GFS_METATYPE_LH;
-		header.lh_header.mh_format = GFS_FORMAT_LH;
-		header.lh_first = tr->tr_log_head;
-		header.lh_sequence = sdp->sd_sequence + 1;
-		header.lh_tail = current_tail(sdp);
-		header.lh_last_dump = sdp->sd_log_dump_last;
-	} else {
-		/* Fill in another header for this transaction */
-		header.lh_header.mh_magic = GFS_MAGIC;
-		header.lh_header.mh_type = GFS_METATYPE_LH;
-		header.lh_header.mh_format = GFS_FORMAT_LH;
-		header.lh_first = tr->tr_first_head;
-		header.lh_sequence = sdp->sd_sequence;
-		header.lh_tail = current_tail(sdp);
-		header.lh_last_dump = sdp->sd_log_dump_last;
-
-		/* Attach log header buf to trans' list of bufs going to log */
-		list_add(&lb->lb_list, &tr->tr_bufs);
-	}
-
-	/* Copy log header struct to beginning and end of buffer's 1st 512B */
-	gfs_log_header_out(&header, lb->lb_bh.b_data);
-	gfs_log_header_out(&header,
-			   lb->lb_bh.b_data + GFS_BASIC_BLOCK -
-			   sizeof(struct gfs_log_header));
-
-	/* Find next log buffer to fill */
-	log_incr_head(sdp, &tr->tr_log_head);
-
-	return lb;
-}
-
-/**
- * gfs_log_get_buf - Get and initialize a buffer to use for log control data
- * @sdp: The GFS superblock
- * @tr: The GFS transaction
- *
- * Initialize one of the transaction's pre-allocated buffers (and associated
- *   log buffer descriptor) to be used for log control data (e.g. log tags).
- * Make sure this buffer is attached to the transaction, to be logged to disk.
- * NOTE:  This buffer will *not* get written to an in-place location in the
- *        filesystem; it is for use only within the log.
- *
- * Returns: the log buffer descriptor
- */
-
-struct gfs_log_buf *
-gfs_log_get_buf(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-
-	/* If next block in log is on a segment boundary, we need to
-	    write a log header */
-	if (gfs_log_is_header(sdp, tr->tr_log_head))
-		log_get_header(sdp, tr, FALSE);
-
-	/* Grab a free buffer descriptor (attached to trans) */
-	gfs_assert(sdp, tr->tr_num_free_bufs &&
-		   !list_empty(&tr->tr_free_bufs),);
-	lb = list_entry(tr->tr_free_bufs.next, struct gfs_log_buf, lb_list);
-	list_del(&lb->lb_list);
-	tr->tr_num_free_bufs--;
-
-	/* Grab a free buffer (attached to trans) */
-	gfs_assert(sdp, tr->tr_num_free_bmem
-		   && !list_empty(&tr->tr_free_bmem),);
-	bmem = tr->tr_free_bmem.next;
-	list_del(bmem);
-	tr->tr_num_free_bmem--;
-
-	/* Create "fake" bh to write bmem to log block */
-	gfs_logbh_init(sdp, &lb->lb_bh, tr->tr_log_head, (char *)bmem);
-	memset(bmem, 0, sdp->sd_sb.sb_bsize);
-
-	list_add(&lb->lb_list, &tr->tr_bufs);
-
-	/* Find next log buffer to fill */
-	log_incr_head(sdp, &tr->tr_log_head);
-
-	return lb;
-}
-
-/**
- * gfs_log_fake_buf - Build a fake buffer head to write metadata buffer to log
- * @sdp: the filesystem
- * @tr: the transaction this is part of
- * @data: the data the buffer_head should point to
- * @unlock: a buffer_head to be unlocked when struct gfs_log_buf is torn down
- *    (i.e. the "real" buffer_head that will write to in-place location)
- *
- * Initialize one of the transaction's pre-allocated log buffer descriptors
- *   to be used for writing a metadata buffer into the log.
- * Make sure this buffer is attached to the transaction, to be logged to disk.
- * NOTE:  This buffer *will* be written to in-place location within filesytem,
- *        in addition to being written into the log.
- * 
- */
-
-void
-gfs_log_fake_buf(struct gfs_sbd *sdp, struct gfs_trans *tr, char *data,
-		 struct buffer_head *unlock)
-{
-	struct gfs_log_buf *lb;
-
-	if (gfs_log_is_header(sdp, tr->tr_log_head))
-		log_get_header(sdp, tr, FALSE);
-
-	/* Grab a free buffer descriptor (attached to trans) */
-	gfs_assert(sdp, tr->tr_num_free_bufs &&
-		   !list_empty(&tr->tr_free_bufs),);
-	lb = list_entry(tr->tr_free_bufs.next, struct gfs_log_buf, lb_list);
-	list_del(&lb->lb_list);
-	tr->tr_num_free_bufs--;
-
-	/* Create "fake" bh to write data to log block */
-	gfs_logbh_init(sdp, &lb->lb_bh, tr->tr_log_head, data);
-	lb->lb_unlock = unlock;
-
-	list_add(&lb->lb_list, &tr->tr_bufs);
-
-	/* Find next log buffer to fill */
-	log_incr_head(sdp, &tr->tr_log_head);
-}
-
-/**
- * check_seg_usage - Check that we didn't use too many segments
- * @sdp: The GFS superblock
- * @tr: The transaction
- *
- * Also, make sure we don't write ever get to a point where there are
- * no dumps in the log (corrupting the log).  Panic before we let
- * that happen.
- * 
- */
-
-static void
-check_seg_usage(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_jindex *jdesc = &sdp->sd_jdesc;
-	unsigned int dist;
-	unsigned int segments;
-	uint64_t head_off, head_wrap;
-	uint64_t dump_off, dump_wrap;
-
-	dist = log_distance(sdp, tr->tr_log_head, tr->tr_first_head);
-
-	segments = dist / sdp->sd_sb.sb_seg_size;
-	gfs_assert(sdp, segments * sdp->sd_sb.sb_seg_size == dist,);
-	gfs_assert(sdp, segments == tr->tr_seg_reserved,);
-
-	if (sdp->sd_log_dump_last) {
-		int diff;
-
-		head_off = tr->tr_first_head +
-			tr->tr_seg_reserved * sdp->sd_sb.sb_seg_size;
-		head_wrap = sdp->sd_log_wrap;
-		if (head_off >= jdesc->ji_addr +
-		    jdesc->ji_nsegment * sdp->sd_sb.sb_seg_size) {
-			head_off -= jdesc->ji_nsegment * sdp->sd_sb.sb_seg_size;
-			head_wrap++;
-		}
-
-		dump_off = sdp->sd_log_dump_last;
-		dump_wrap = sdp->sd_log_dump_last_wrap;
-
-		diff = (int)(head_wrap - dump_wrap);
-		switch (diff) {
-		case 0:
-			break;
-
-		case 1:
-			if (head_off < dump_off - sdp->sd_sb.sb_seg_size)
-				break;
-			else if (head_off <= dump_off &&
-				 (tr->tr_flags & TRF_LOG_DUMP))
-				break;
-
-		default:
-			gfs_assert(sdp, FALSE,
-				   printk("GFS: fsid=%s: head_off = %llu, head_wrap = %llu\n"
-					  "GFS: fsid=%s: dump_off = %llu, dump_wrap = %llu\n",
-					  sdp->sd_fsname,
-					  (unsigned long long)head_off,
-					  (unsigned long long)head_wrap,
-					  sdp->sd_fsname,
-					  (unsigned long long)dump_off,
-					  (unsigned long long)dump_wrap););
-			break;
-		}
-	}
-}
-
-/**
- * log_free_buf - Free a struct gfs_log_buf (and possibly the data it points to)
- * @sdp: the filesystem
- * @lb: the log buffer descriptor
- *
- * If buffer contains (meta)data to be written into filesystem in-place block,
- *   descriptor will point to the "real" (lb_unlock) buffer head.  Unlock it.
- * If buffer was used only for log header or control data (e.g. tags), we're
- *   done with it as soon as it gets written to on-disk log.  Free it.
- * Either way, we can free the log descriptor structure.
- */
-
-static void
-log_free_buf(struct gfs_sbd *sdp, struct gfs_log_buf *lb)
-{
-	char *bmem;
-
-	bmem = lb->lb_bh.b_data;
-	gfs_logbh_uninit(sdp, &lb->lb_bh);
-
-	if (lb->lb_unlock)
-		gfs_unlock_buffer(lb->lb_unlock);
-	else
-		kfree(bmem);
-
-	kfree(lb);
-}
-
-/**
- * sync_trans - Add "last" descriptor, sync transaction to on-disk log
- * @sdp: The GFS superblock
- * @tr: The transaction
- *
- * Add the "last" descriptor onto the end of the current transaction
- *   and sync the whole transaction out to on-disk log.
- * Don't log-commit (i.e. write next transaction's log header) yet, though.
- *
- * Returns: errno
- */
-
-static int
-sync_trans(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *tmp, *head, *prev;
-	struct gfs_log_descriptor desc;
-	struct gfs_log_buf *lb;
-	uint64_t blk;
-	int error = 0, e;
-
-	/*  Build LAST descriptor  */
-
-	lb = gfs_log_get_buf(sdp, tr);
-
-	memset(&desc, 0, sizeof(struct gfs_log_descriptor));
-	desc.ld_header.mh_magic = GFS_MAGIC;
-	desc.ld_header.mh_type = GFS_METATYPE_LD;
-	desc.ld_header.mh_format = GFS_FORMAT_LD;
-	desc.ld_type = GFS_LOG_DESC_LAST;
-	desc.ld_length = 1;
-	for (blk = tr->tr_log_head; !gfs_log_is_header(sdp, blk); blk++)
-		desc.ld_length++;
-	gfs_desc_out(&desc, lb->lb_bh.b_data);
-
-	while (!gfs_log_is_header(sdp, tr->tr_log_head))
-		log_incr_head(sdp, &tr->tr_log_head);
-
-	check_seg_usage(sdp, tr);
-
-	/* Start I/O
-	   Go in "prev" direction to start the I/O in order. */
-
-	for (head = &tr->tr_bufs, tmp = head->prev, prev = tmp->prev;
-	     tmp != head;
-	     tmp = prev, prev = tmp->prev) {
-		lb = list_entry(tmp, struct gfs_log_buf, lb_list);
-		if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
-			gfs_logbh_start(sdp, &lb->lb_bh);
-		} else {
-			list_del(&lb->lb_list);
-			log_free_buf(sdp, lb);
-			error = -EIO;
-		}
-	}
-
-	/* Wait on I/O
-	   Go in "next" direction to minimize sleeps/wakeups. */
-
-	while (!list_empty(&tr->tr_bufs)) {
-		lb = list_entry(tr->tr_bufs.next, struct gfs_log_buf, lb_list);
-
-		e = gfs_logbh_wait(sdp, &lb->lb_bh);
-		if (e)
-			error = e;
-
-		list_del(&lb->lb_list);
-		log_free_buf(sdp, lb);
-	}
-
-	return error;
-}
-
-/**
- * commit_trans - Commit the current transaction
- * @sdp: The GFS superblock
- * @tr: The transaction
- *
- * Write next header to commit
- *
- * Returns: errno
- */
-
-static int
-commit_trans(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_log_buf *lb;
-	int error = 0;
-
-	lb = log_get_header(sdp, tr, TRUE);
-
-	if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
-		gfs_logbh_start(sdp, &lb->lb_bh);
-		error = gfs_logbh_wait(sdp, &lb->lb_bh);
-	}
-	if (!error) {
-		spin_lock(&sdp->sd_log_seg_lock);
-		if (!(tr->tr_flags & TRF_DUMMY))
-			sdp->sd_log_seg_free += sdp->sd_log_seg_ail2;
-		else
-			sdp->sd_log_seg_free += (sdp->sd_log_seg_ail2 - 1);
-		sdp->sd_log_seg_ail2 = 0;
-		spin_unlock(&sdp->sd_log_seg_lock);
-	}
-	log_free_buf(sdp, lb);
-
-	return error;
-}
-
-/**
- * disk_commit - Write a transaction to the on-disk journal
- * @sdp: The GFS superblock
- * @tr: The transaction
- *
- * Returns: errno
- */
-
-static int
-disk_commit(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	uint64_t last_dump, last_dump_wrap;
-	int error = 0;
-
-	gfs_assert(sdp, !test_bit(SDF_ROFS, &sdp->sd_flags),);
-	tr->tr_log_head = sdp->sd_log_head;
-	tr->tr_first_head = tr->tr_log_head - 1;
-	gfs_assert(sdp, gfs_log_is_header(sdp, tr->tr_first_head),);
-
-	LO_BUILD_BHLIST(sdp, tr);
-
-	if (!(tr->tr_flags & TRF_DUMMY))
-		gfs_assert(sdp, !list_empty(&tr->tr_bufs),);
-
-	error = sync_trans(sdp, tr);
-	if (error) {
-		/* Eat unusable commit buffer */
-		log_free_buf(sdp, log_get_header(sdp, tr, TRUE));
-		goto out;
-	}
-
-	if (tr->tr_flags & TRF_LOG_DUMP) {
-		/* This commit header should point to the log dump we're
-		   commiting as the current one.  But save the copy of the
-		   old one in case we have problems commiting the dump. */
-
-		last_dump = sdp->sd_log_dump_last;
-		last_dump_wrap = sdp->sd_log_dump_last_wrap;
-
-		sdp->sd_log_dump_last = tr->tr_first_head;
-		sdp->sd_log_dump_last_wrap = sdp->sd_log_wrap;
-
-		error = commit_trans(sdp, tr);
-		if (error) {
-			sdp->sd_log_dump_last = last_dump;
-			sdp->sd_log_dump_last_wrap = last_dump_wrap;
-			goto out;
-		}
-	} else {
-		error = commit_trans(sdp, tr);
-		if (error)
-			goto out;
-	}
-
-	if (sdp->sd_log_head > tr->tr_log_head)
-		sdp->sd_log_wrap++;
-   sdp->sd_log_head = tr->tr_log_head;
-   sdp->sd_sequence++;
-
- out:
-	gfs_assert_warn(sdp, !tr->tr_num_free_bufs &&
-			list_empty(&tr->tr_free_bufs));
-	gfs_assert_warn(sdp, !tr->tr_num_free_bmem &&
-			list_empty(&tr->tr_free_bmem));
-
-	return error;
-}
-
-/**
- * add_trans_to_ail - Add a ondisk commited transaction to the AIL
- * @sdp: the filesystem
- * @tr: the transaction 
- *
- */
-
-static void
-add_trans_to_ail(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_log_element *le;
-
-	while (!list_empty(&tr->tr_elements)) {
-		le = list_entry(tr->tr_elements.next,
-				struct gfs_log_element, le_list);
-		LO_ADD_TO_AIL(sdp, le);
-	}
-
-	list_add(&tr->tr_list, &sdp->sd_log_ail);
-}
-
-/**
- * log_refund - Refund log segments to the free pool
- * @sdp: The GFS superblock
- * @tr: The transaction to examine
- *
- * Look at the number of segments reserved for this transaction and the
- * number of segments actually needed for it.  If they aren't the
- * same, refund the difference to the free segment pool.
- *
- * De-alloc any unneeded log buffers and log buffer descriptors.
- *
- * Called with the log lock held.
- */
-
-static void
-log_refund(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-	unsigned int num_bufs = 0, num_bmem = 0;
-	unsigned int segments;
-
-	LO_TRANS_SIZE(sdp, tr, NULL, NULL, &num_bufs, &num_bmem);
-
-	segments = gfs_blk2seg(sdp, num_bufs + 1);
-	num_bufs += segments + 1;
-	num_bmem += segments + 1;
-
-	/* Unreserve unneeded log segments */
-	if (tr->tr_seg_reserved > segments) {
-		spin_lock(&sdp->sd_log_seg_lock);
-		sdp->sd_log_seg_free += tr->tr_seg_reserved - segments;
-		gfs_assert(sdp, sdp->sd_log_seg_free + sdp->sd_log_seg_ail2 <=
-			   sdp->sd_jdesc.ji_nsegment,);
-		spin_unlock(&sdp->sd_log_seg_lock);
-
-		tr->tr_seg_reserved = segments;
-	} else
-		gfs_assert(sdp, tr->tr_seg_reserved == segments,);
-
-	/* De-alloc unneeded log buffer descriptors */
-	gfs_assert(sdp, tr->tr_num_free_bufs >= num_bufs,);
-	while (tr->tr_num_free_bufs > num_bufs) {
-		lb = list_entry(tr->tr_free_bufs.next,
-				struct gfs_log_buf, lb_list);
-		list_del(&lb->lb_list);
-		kfree(lb);
-		tr->tr_num_free_bufs--;
-	}
-
-	/* De-alloc unneeded log buffers */
-	gfs_assert(sdp, tr->tr_num_free_bmem >= num_bmem,);
-	while (tr->tr_num_free_bmem > num_bmem) {
-		bmem = tr->tr_free_bmem.next;
-		list_del(bmem);
-		kfree(bmem);
-		tr->tr_num_free_bmem--;
-	}
-}
-
-/**
- * trans_combine - combine two transactions
- * @sdp: the filesystem
- * @tr: the surviving transaction
- * @new_tr: the transaction that gets freed
- *
- * Assumes that the two transactions are independent.
- */
-
-static void
-trans_combine(struct gfs_sbd *sdp, struct gfs_trans *tr,
-	      struct gfs_trans *new_tr)
-{
-	struct gfs_log_element *le;
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-
-	tr->tr_file = __FILE__;
-	tr->tr_line = __LINE__;
-	tr->tr_seg_reserved += new_tr->tr_seg_reserved;
-	tr->tr_flags |= new_tr->tr_flags;
-	tr->tr_num_free_bufs += new_tr->tr_num_free_bufs;
-	tr->tr_num_free_bmem += new_tr->tr_num_free_bmem;
-
-	/*  Combine the log elements of the two transactions  */
-
-	while (!list_empty(&new_tr->tr_elements)) {
-		le = list_entry(new_tr->tr_elements.next,
-				struct gfs_log_element, le_list);
-		gfs_assert(sdp, le->le_trans == new_tr,);
-		le->le_trans = tr;
-		list_move(&le->le_list, &tr->tr_elements);
-	}
-
-	LO_TRANS_COMBINE(sdp, tr, new_tr);
-
-	/* Move free log buffer descriptors to surviving trans */
-	while (!list_empty(&new_tr->tr_free_bufs)) {
-		lb = list_entry(new_tr->tr_free_bufs.next,
-				struct gfs_log_buf, lb_list);
-		list_move(&lb->lb_list, &tr->tr_free_bufs);
-		new_tr->tr_num_free_bufs--;
-	}
-	/* Move free log buffers to surviving trans */
-	while (!list_empty(&new_tr->tr_free_bmem)) {
-		bmem = new_tr->tr_free_bmem.next;
-		list_move(bmem, &tr->tr_free_bmem);
-		new_tr->tr_num_free_bmem--;
-	}
-
-	gfs_assert_warn(sdp, !new_tr->tr_num_free_bufs);
-	gfs_assert_warn(sdp, !new_tr->tr_num_free_bmem);
-
-	kfree(new_tr);
-}
-
-static void
-make_dummy_transaction(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-
-	memset(tr, 0, sizeof(struct gfs_trans));
-	INIT_LIST_HEAD(&tr->tr_list);
-	INIT_LIST_HEAD(&tr->tr_elements);
-	INIT_LIST_HEAD(&tr->tr_free_bufs);
-	INIT_LIST_HEAD(&tr->tr_free_bmem);
-	INIT_LIST_HEAD(&tr->tr_bufs);
-	INIT_LIST_HEAD(&tr->tr_ail_bufs);
-	tr->tr_flags = TRF_DUMMY;
-	tr->tr_file = __FILE__;
-	tr->tr_line = __LINE__;
-	tr->tr_seg_reserved = 1;
-	while (tr->tr_num_free_bufs < 2) {
-		lb = gmalloc(sizeof(struct gfs_log_buf));
-		memset(lb, 0, sizeof(struct gfs_log_buf));
-		list_add(&lb->lb_list, &tr->tr_free_bufs);
-		tr->tr_num_free_bufs++;
-	}
-	while (tr->tr_num_free_bmem < 2) {
-		bmem = gmalloc(sdp->sd_sb.sb_bsize);
-		list_add(bmem, &tr->tr_free_bmem);
-		tr->tr_num_free_bmem++;
-	}
-}
-
-
-/**
- * log_flush_internal - flush incore transaction(s)
- * @sdp: the filesystem
- * @gl: The glock structure to flush.  If NULL, flush the whole incore log
- *
- * If a glock is provided, we flush, to on-disk log, all of the metadata for
- *   the one incore-committed (complete, but not-yet-flushed-to-log)
- *   transaction that the glock protects.
- * If NULL, we combine *all* of the filesystem's incore-committed
- *   transactions into one big transaction, and flush it to the log.
- */
-
-static void
-log_flush_internal(struct gfs_sbd *sdp, struct gfs_glock *gl)
-{
-	
-	struct gfs_trans *trans = NULL, *tr;
-	int error;
-
-	gfs_log_lock(sdp);
-
-	if (!gl && list_empty(&sdp->sd_log_incore)) {
-		if (sdp->sd_log_seg_ail2) {
-			trans = gmalloc(sizeof(struct gfs_trans));
-			make_dummy_transaction(sdp, trans);
-		}
-		else
-			goto out;
-	}
-
-	if (gl) {
-		if (!gl->gl_incore_le.le_trans)
-			goto out;
-
-		trans = gl->gl_incore_le.le_trans;
-
-		list_del(&trans->tr_list);
-	} else {
-		/* combine *all* transactions in incore list */
-		while (!list_empty(&sdp->sd_log_incore)) {
-			tr = list_entry(sdp->sd_log_incore.next,
-					struct gfs_trans, tr_list);
-
-			list_del(&tr->tr_list);
-
-			if (trans)
-				trans_combine(sdp, trans, tr);
-			else
-				trans = tr;
-		}
-	}
-
-	log_refund(sdp, trans);
-
-	/*  Actually do the stuff to commit the transaction  */
-
-	error = disk_commit(sdp, trans);
-	if (error)
-		gfs_io_error(sdp);
-
-	add_trans_to_ail(sdp, trans);
-
-	if (log_distance(sdp, sdp->sd_log_head, sdp->sd_log_dump_last) * GFS_DUMPS_PER_LOG >=
-	    sdp->sd_jdesc.ji_nsegment * sdp->sd_sb.sb_seg_size)
-		set_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags);
-
- out:
-	if (list_empty(&sdp->sd_log_incore))
-		sdp->sd_vfs->s_dirt = FALSE;
-
-	gfs_log_unlock(sdp);
-
-	/*  Dump if we need to.  */
-
-	if (test_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags))
-		gfs_log_dump(sdp, FALSE);
-}
-
-/**
- * gfs_log_flush - flush the whole incore log
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_log_flush(struct gfs_sbd *sdp)
-{
-	log_flush_internal(sdp, NULL);
-}
-
-/**
- * gfs_log_flush_glock - flush the incore log for a glock
- * @gl: the glock
- *
- */
-
-void
-gfs_log_flush_glock(struct gfs_glock *gl)
-{
-	log_flush_internal(gl->gl_sbd, gl);
-}
-
-/**
- * incore_commit - commit a transaction in-core
- * @sdp: the filesystem
- * @new_tr: the transaction to commit
- *
- * Add the transaction @new_tr to the end of the incore commit list.
- * Pull up and merge any previously committed transactions that share
- * locks.  Also pull up any rename transactions that need it.
- */
-
-static void
-incore_commit(struct gfs_sbd *sdp, struct gfs_trans *new_tr)
-{
-	struct gfs_log_element *le;
-	struct gfs_trans *trans = NULL, *exist_tr;
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-	struct list_head *tmp, *head, *next;
-
-	for (head = &new_tr->tr_elements, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-
-		/* Do overlap_trans log-op, if any, to find another
-		   incore transaction with which we can combine new_tr */
-		exist_tr = LO_OVERLAP_TRANS(sdp, le);
-		if (!exist_tr)
-			continue;
-
-		if (exist_tr != trans) {
-			/* remove trans from superblock's sd_log_incore list */
-			list_del(&exist_tr->tr_list);
-
-			/* Maybe there's more than one that can be combined.
-			   If so, combine them together before merging new_tr */
-			if (trans)
-				trans_combine(sdp, trans, exist_tr);
-			else
-				trans = exist_tr;
-		}
-	}
-
-	/* Yes, we can combine new_tr with pre-existing transaction(s) */
-	if (trans) {
-		trans->tr_file = __FILE__;
-		trans->tr_line = __LINE__;
-		trans->tr_seg_reserved += new_tr->tr_seg_reserved;
-		trans->tr_flags |= new_tr->tr_flags;
-		trans->tr_num_free_bufs += new_tr->tr_num_free_bufs;
-		trans->tr_num_free_bmem += new_tr->tr_num_free_bmem;
-
-		/* Move free log buffer descriptors to surviving trans */
-		while (!list_empty(&new_tr->tr_free_bufs)) {
-			lb = list_entry(new_tr->tr_free_bufs.next,
-					struct gfs_log_buf, lb_list);
-			list_move(&lb->lb_list, &trans->tr_free_bufs);
-			new_tr->tr_num_free_bufs--;
-		}
-
-		/* Move free log buffers to surviving trans */
-		while (!list_empty(&new_tr->tr_free_bmem)) {
-			bmem = new_tr->tr_free_bmem.next;
-			list_move(bmem, &trans->tr_free_bmem);
-			new_tr->tr_num_free_bmem--;
-		}
-	} else
-		trans = new_tr;
-
-	/* Do incore_commit log-op for each *new* log element (in new_tr).
-	   Each commit log-op removes its log element from "new_tr" LE list,
-	   and attaches an LE to "trans" LE list; if there was no trans
-	   combining, "new_tr" is the same transaction as "trans". */
-	for (head = &new_tr->tr_elements, tmp = head->next, next = tmp->next;
-	     tmp != head;
-	     tmp = next, next = next->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-		LO_INCORE_COMMIT(sdp, trans, le);
-	}
-
-	/* If we successfully combined transactions, new_tr should be empty */
-	if (trans != new_tr) {
-		gfs_assert_warn(sdp, !new_tr->tr_num_free_bufs);
-		gfs_assert_warn(sdp, !new_tr->tr_num_free_bmem);
-		gfs_assert_warn(sdp, list_empty(&new_tr->tr_elements));
-		kfree(new_tr);
-	}
-
-	/* If we successfully combined transactions, we might have some log
-	   segments that we reserved, and log buffers and buffer descriptors
-	   that we allocated, but now don't need. */
-	log_refund(sdp, trans);
-
-	list_add(&trans->tr_list, &sdp->sd_log_incore);
-}
-
-/**
- * gfs_log_commit - Commit a transaction to the log
- * @sdp: the filesystem
- * @tr: the transaction
- *
- * Returns: errno
- */
-
-void
-gfs_log_commit(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-	unsigned int num_mblks = 0, num_eblks = 0, num_bufs = 0, num_bmem = 0;
-	unsigned int segments;
-
-	/* Calculate actual log area needed for this trans */
-	LO_TRANS_SIZE(sdp, tr, &num_mblks, &num_eblks, &num_bufs, &num_bmem);
-
-	gfs_assert(sdp, num_mblks <= tr->tr_mblks_asked &&
-		   num_eblks <= tr->tr_eblks_asked,
-		   printk("GFS: fsid=%s: type = (%s, %u)\n"
-			  "GFS: fsid=%s: num_mblks = %u, tr->tr_mblks_asked = %u\n"
-			  "GFS: fsid=%s: num_eblks = %u, tr->tr_eblks_asked = %u\n",
-			  sdp->sd_fsname, tr->tr_file, tr->tr_line,
-			  sdp->sd_fsname, num_mblks, tr->tr_mblks_asked,
-			  sdp->sd_fsname, num_eblks, tr->tr_eblks_asked););
-
-	segments = gfs_blk2seg(sdp, num_bufs + 1);
-	num_bufs += segments + 1;
-	num_bmem += segments + 1;
-
-	/* Alloc log buffer descriptors */
-	while (num_bufs--) {
-		lb = gmalloc(sizeof(struct gfs_log_buf));
-		memset(lb, 0, sizeof(struct gfs_log_buf));
-		list_add(&lb->lb_list, &tr->tr_free_bufs);
-		tr->tr_num_free_bufs++;
-	}
-	/* Alloc log buffers */
-	while (num_bmem--) {
-		bmem = gmalloc(sdp->sd_sb.sb_bsize);
-		list_add(bmem, &tr->tr_free_bmem);
-		tr->tr_num_free_bmem++;
-	}
-
-	gfs_log_lock(sdp);
-
-	incore_commit(sdp, tr);
-
-	/* Flush log buffers to disk if we're over the threshold */
-	if (sdp->sd_log_buffers > gfs_tune_get(sdp, gt_incore_log_blocks)) {
-		gfs_log_unlock(sdp);
-		gfs_log_flush(sdp);
-	} else {
-		sdp->sd_vfs->s_dirt = TRUE;
-		gfs_log_unlock(sdp);
-	}
-
-}
-
-/**
- * gfs_log_dump - make a Log Dump entry in the log
- * @sdp: the filesystem
- * @force: if TRUE, always make the dump even if one has been made recently
- *
- */
-
-void
-gfs_log_dump(struct gfs_sbd *sdp, int force)
-{
-	struct gfs_log_element *le;
-	struct gfs_trans tr;
-	struct gfs_log_buf *lb;
-	struct list_head *bmem;
-	unsigned int num_bufs, num_bmem;
-	unsigned int segments;
-	int error;
-
-	if (test_and_set_bit(SDF_IN_LOG_DUMP, &sdp->sd_flags)) {
-		gfs_assert(sdp, !force,);
-		return;
-	}
-
-	memset(&tr, 0, sizeof(struct gfs_trans));
-	INIT_LIST_HEAD(&tr.tr_elements);
-	INIT_LIST_HEAD(&tr.tr_free_bufs);
-	INIT_LIST_HEAD(&tr.tr_free_bmem);
-	INIT_LIST_HEAD(&tr.tr_bufs);
-	tr.tr_flags = TRF_LOG_DUMP;
-	tr.tr_file = __FILE__;
-	tr.tr_line = __LINE__;
-
-	for (;;) {
-		gfs_log_lock(sdp);
-
-		if (!force && !test_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags))
-			goto out;
-
-		num_bufs = num_bmem = 0;
-		LO_DUMP_SIZE(sdp, NULL, &num_bufs, &num_bmem);
-		gfs_assert(sdp, num_bufs,);
-		segments = gfs_blk2seg(sdp, num_bufs + 1);
-		num_bufs += segments + 1;
-		num_bmem += segments + 1;
-
-		if (tr.tr_seg_reserved >= segments &&
-		    tr.tr_num_free_bufs >= num_bufs &&
-		    tr.tr_num_free_bmem >= num_bmem)
-			break;
-
-		gfs_log_unlock(sdp);
-
-		if (tr.tr_seg_reserved < segments) {
-			error = gfs_log_reserve(sdp,
-						segments - tr.tr_seg_reserved,
-						TRUE);
-			gfs_assert(sdp, !error,);
-			tr.tr_seg_reserved = segments;
-		}
-		while (tr.tr_num_free_bufs < num_bufs) {
-			lb = gmalloc(sizeof(struct gfs_log_buf));
-			memset(lb, 0, sizeof(struct gfs_log_buf));
-			list_add(&lb->lb_list, &tr.tr_free_bufs);
-			tr.tr_num_free_bufs++;
-		}
-		while (tr.tr_num_free_bmem < num_bmem) {
-			bmem = gmalloc(sdp->sd_sb.sb_bsize);
-			list_add(bmem, &tr.tr_free_bmem);
-			tr.tr_num_free_bmem++;
-		}
-	}
-
-	if (tr.tr_seg_reserved > segments) {
-		spin_lock(&sdp->sd_log_seg_lock);
-		sdp->sd_log_seg_free += tr.tr_seg_reserved - segments;
-		gfs_assert(sdp, sdp->sd_log_seg_free + sdp->sd_log_seg_ail2 <=
-			   sdp->sd_jdesc.ji_nsegment,);
-		spin_unlock(&sdp->sd_log_seg_lock);
-		tr.tr_seg_reserved = segments;
-	}
-	while (tr.tr_num_free_bufs > num_bufs) {
-		lb = list_entry(tr.tr_free_bufs.next,
-				struct gfs_log_buf, lb_list);
-		list_del(&lb->lb_list);
-		kfree(lb);
-		tr.tr_num_free_bufs--;
-	}
-	while (tr.tr_num_free_bmem > num_bmem) {
-		bmem = tr.tr_free_bmem.next;
-		list_del(bmem);
-		kfree(bmem);
-		tr.tr_num_free_bmem--;
-	}
-
-	LO_BUILD_DUMP(sdp, &tr);
-
-	error = disk_commit(sdp, &tr);
-	if (error)
-		gfs_io_error(sdp);
-
-	while (!list_empty(&tr.tr_elements)) {
-		le = list_entry(tr.tr_elements.next,
-				struct gfs_log_element, le_list);
-		LO_CLEAN_DUMP(sdp, le);
-	}
-
-	/* If there isn't anything in the AIL, we won't get back the log
-	   space we reserved unless we do it ourselves. */
-
-	if (list_empty(&sdp->sd_log_ail)) {
-		spin_lock(&sdp->sd_log_seg_lock);
-		sdp->sd_log_seg_free += tr.tr_seg_reserved;
-		gfs_assert(sdp, sdp->sd_log_seg_free + sdp->sd_log_seg_ail2 <=
-			   sdp->sd_jdesc.ji_nsegment,);
-		spin_unlock(&sdp->sd_log_seg_lock);
-	}
-
-	clear_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags);
-
- out:
-	gfs_log_unlock(sdp);
-	clear_bit(SDF_IN_LOG_DUMP, &sdp->sd_flags);
-}
-
-/**
- * gfs_log_shutdown - write a shutdown header into a journal
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_log_shutdown(struct gfs_sbd *sdp)
-{
-	struct gfs_log_buf *lb;
-	char *bmem;
-	struct gfs_log_header head;
-	struct gfs_log_descriptor desc;
-	unsigned int elements = 0;
-	int error;
-
-	lb = gmalloc(sizeof(struct gfs_log_buf));
-	memset(lb, 0, sizeof(struct gfs_log_buf));
-	bmem = gmalloc(sdp->sd_sb.sb_bsize);
-
-	gfs_log_lock(sdp);
-
-	gfs_assert_withdraw(sdp, list_empty(&sdp->sd_log_ail));
-	gfs_assert_withdraw(sdp, sdp->sd_log_seg_free + sdp->sd_log_seg_ail2 ==
-			    sdp->sd_jdesc.ji_nsegment);
-	gfs_assert_withdraw(sdp, !sdp->sd_log_buffers);
-	gfs_assert_withdraw(sdp, gfs_log_is_header(sdp, sdp->sd_log_head - 1));
-	if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-		goto out;
-
-	/*  Build a "last" log descriptor  */
-
-	memset(&desc, 0, sizeof(struct gfs_log_descriptor));
-	desc.ld_header.mh_magic = GFS_MAGIC;
-	desc.ld_header.mh_type = GFS_METATYPE_LD;
-	desc.ld_header.mh_format = GFS_FORMAT_LD;
-	desc.ld_type = GFS_LOG_DESC_LAST;
-	desc.ld_length = sdp->sd_sb.sb_seg_size - 1;
-
-	/*  Write the descriptor  */
-
-	gfs_logbh_init(sdp, &lb->lb_bh, sdp->sd_log_head, bmem);
-	memset(bmem, 0, sdp->sd_sb.sb_bsize);
-	gfs_desc_out(&desc, lb->lb_bh.b_data);
-	if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-		goto out;
-	gfs_logbh_start(sdp, &lb->lb_bh);
-	error = gfs_logbh_wait(sdp, &lb->lb_bh);
-	gfs_logbh_uninit(sdp, &lb->lb_bh);
-
-	if (error)
-		goto out;
-
-	/*  Move to the next header  */
-
-	while (!gfs_log_is_header(sdp, sdp->sd_log_head))
-		log_incr_head(sdp, &sdp->sd_log_head);
-
-	LO_DUMP_SIZE(sdp, &elements, NULL, NULL);
-
-	/*  Build the shutdown header  */
-
-	memset(&head, 0, sizeof (struct gfs_log_header));
-	head.lh_header.mh_magic = GFS_MAGIC;
-	head.lh_header.mh_type = GFS_METATYPE_LH;
-	head.lh_header.mh_format = GFS_FORMAT_LH;
-	head.lh_flags = GFS_LOG_HEAD_UNMOUNT;
-	head.lh_first = sdp->sd_log_head;
-	head.lh_sequence = sdp->sd_sequence + 1;
-	/*  Don't care about tail  */
-	head.lh_last_dump = (elements) ? sdp->sd_log_dump_last : 0;
-
-	/*  Write out the shutdown header  */
-
-	gfs_logbh_init(sdp, &lb->lb_bh, sdp->sd_log_head, bmem);
-	memset(bmem, 0, sdp->sd_sb.sb_bsize);
-	gfs_log_header_out(&head, lb->lb_bh.b_data);
-	gfs_log_header_out(&head,
-			   lb->lb_bh.b_data + GFS_BASIC_BLOCK -
-			   sizeof(struct gfs_log_header));
-	if (!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) {
-		gfs_logbh_start(sdp, &lb->lb_bh);
-		gfs_logbh_wait(sdp, &lb->lb_bh);
-		gfs_logbh_uninit(sdp, &lb->lb_bh);
-	}
-   /* If a withdraw is called before we've a chance to relock the trans
-    * lock, the sd_log_head points to the wrong place, and a umount will
-    * fail on asserts because of this.
-    * Adding one puts sd_log_head at a value that passes the assert.  The
-    * value may not be correct for on disk, but we've withdrawn so there is
-    * no more disk io.
-    * If we're not withdrawn, the next io will grab the trans lock, which
-    * will fill sd_log_head with the correct value.
-    */
-   sdp->sd_log_head += 1;
-
- out:
-	gfs_log_unlock(sdp);
-
-	kfree(lb);
-	kfree(bmem);
-}
diff --git a/gfs-kernel/src/gfs/log.h b/gfs-kernel/src/gfs/log.h
deleted file mode 100644
index 649d43d..0000000
--- a/gfs-kernel/src/gfs/log.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef __LOG_DOT_H__
-#define __LOG_DOT_H__
-
-/**
- * gfs_log_lock - acquire the right to mess with the log manager
- * @sdp: the filesystem
- *
- */
-
-static __inline__ void
-gfs_log_lock(struct gfs_sbd *sdp)
-{
-	down_write(&sdp->sd_log_lock);
-}
-
-/**
- * gfs_log_unlock - release the right to mess with the log manager
- * @sdp: the filesystem
- *
- */
-
-static __inline__ void
-gfs_log_unlock(struct gfs_sbd *sdp)
-{
-	up_write(&sdp->sd_log_lock);
-}
-
-unsigned int gfs_struct2blk(struct gfs_sbd *sdp, unsigned int nstruct,
-			    unsigned int ssize);
-unsigned int gfs_blk2seg(struct gfs_sbd *sdp, unsigned int blocks);
-
-int gfs_log_reserve(struct gfs_sbd *sdp, unsigned int segments, int jump_queue);
-void gfs_log_release(struct gfs_sbd *sdp, unsigned int segments);
-
-void gfs_ail_start(struct gfs_sbd *sdp, int flags);
-int gfs_ail_empty(struct gfs_sbd *sdp);
-
-void gfs_log_commit(struct gfs_sbd *sdp, struct gfs_trans *trans);
-void gfs_log_flush(struct gfs_sbd *sdp);
-void gfs_log_flush_glock(struct gfs_glock *gl);
-
-void gfs_log_shutdown(struct gfs_sbd *sdp);
-
-void gfs_log_dump(struct gfs_sbd *sdp, int force);
-
-/*  Internal crap used the log operations  */
-
-/**
- * gfs_log_is_header - Discover if block is on journal header
- * @sdp: The GFS superblock
- * @block: The block number
- *
- * Returns: TRUE if the block is on a journal segment boundary, FALSE otherwise
- */
-
-static __inline__ int
-gfs_log_is_header(struct gfs_sbd *sdp, uint64_t block)
-{
-	return !do_mod(block, sdp->sd_sb.sb_seg_size);
-}
-
-struct gfs_log_buf *gfs_log_get_buf(struct gfs_sbd *sdp, struct gfs_trans *tr);
-void gfs_log_fake_buf(struct gfs_sbd *sdp, struct gfs_trans *tr, char *data,
-		      struct buffer_head *unlock);
-
-#endif /* __LOG_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/lops.c b/gfs-kernel/src/gfs/lops.c
deleted file mode 100644
index 70f2a32..0000000
--- a/gfs-kernel/src/gfs/lops.c
+++ /dev/null
@@ -1,1649 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "log.h"
-#include "lops.h"
-#include "quota.h"
-#include "recovery.h"
-#include "trans.h"
-#include "unlinked.h"
-
-/**
- * generic_le_add - generic routine to add a log element to a transaction
- * @sdp: the filesystem
- * @le: the log entry
- *
- */
-
-static void
-generic_le_add(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	struct gfs_trans *tr;
-
-	/* Make sure it's not attached to a transaction already */
-	gfs_assert(sdp, le->le_ops &&
-		   !le->le_trans &&
-		   list_empty(&le->le_list),);
-
-	/* Attach it to the (one) transaction being built by this process */
-	tr = get_transaction;
-	gfs_assert(sdp, tr,);
-
-	le->le_trans = tr;
-	list_add(&le->le_list, &tr->tr_elements);
-}
-
-/**
- * glock_trans_end - drop a glock reference
- * @sdp: the filesystem
- * @le: the log element
- *
- * Called before incore-committing a transaction
- * Release reference that was taken in gfs_trans_add_gl()
- */
-
-static void
-glock_trans_end(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	struct gfs_glock *gl = container_of(le, struct gfs_glock, gl_new_le);
-
-	gfs_assert(sdp, gfs_glock_is_locked_by_me(gl) &&
-		   gfs_glock_is_held_excl(gl),);
-	gfs_glock_put(gl);
-}
-
-/**
- * glock_print - print debug info about a log element
- * @sdp: the filesystem
- * @le: the log element
- * @where: is this a new transaction or a incore transaction
- *
- */
-
-static void
-glock_print(struct gfs_sbd *sdp, struct gfs_log_element *le, unsigned int where)
-{
-	struct gfs_glock *gl;
-
-	switch (where) {
-	case TRANS_IS_NEW:
-		gl = container_of(le, struct gfs_glock, gl_new_le);
-		break;
-	case TRANS_IS_INCORE:
-		gl = container_of(le, struct gfs_glock, gl_incore_le);
-		break;
-	default:
-		gfs_assert_warn(sdp, FALSE);
-		return;
-	}
-
-	printk("  Glock:  (%u, %llu)\n",
-	       gl->gl_name.ln_type,
-	       (unsigned long long)gl->gl_name.ln_number);
-}
-
-/**
- * glock_overlap_trans - Find any incore transactions that might overlap with
- *   (i.e. be combinable with the transaction containing) this LE
- * @sdp: the filesystem
- * @le: the log element
- *
- * Transactions that share a given glock are combinable.
- *
- * For a glock, the scope of the "search" is just the (max) one unique incore
- *   committed transaction to which the glock may be attached via its
- *   gl->gl_incore_le embedded log element.  This trans may have previously
- *   been combined with other transactions, though (i.e. previous
- *   incore committed transactions that shared the same glock).
- *  
- * Called as a beginning part of the incore commit of a transaction.
- */
-
-static struct gfs_trans *
-glock_overlap_trans(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	struct gfs_glock *gl = container_of(le, struct gfs_glock, gl_new_le);
-
-	return gl->gl_incore_le.le_trans;
-}
-
-/**
- * glock_incore_commit - commit this LE to the incore log
- * @sdp: the filesystem
- * @tr: the being-incore-committed transaction this LE is to be a part of
- * @le: the log element (should be a gl->gl_new_le), which is attached
- *      to a "new" (just-ended) transaction.
- *      
- * Attach glock's gl_incore_le to the being-incore-committed trans' LE list.
- * Remove glock's gl_new_le from the just-ended new trans' LE list.
- * If the just-ended new trans (le->le_trans) was combined (in incore_commit())
- *   with a pre-existing incore trans (tr), this function effectively moves
- *   the LE from the new to the combined incore trans.
- * If there was no combining, then the new trans itself is being committed
- *   (le->le_trans == tr); this function simply replaces the gl_new_le with a
- *   gl_incore_le on the trans' LE list.
- * 
- * Make sure that this glock's gl_incore_le is attached to one and only one
- *   incore-committed transaction's (this one's) tr_elements list.
- *   One transaction (instead of a list of transactions) is sufficient,
- *   because incore_commit() combines multiple transactions that share a glock
- *   into one trans.
- * Since transactions can contain multiple glocks, there are multiple
- *   possibilities for shared glocks, therefore multiple potential "bridges"
- *   for combining transactions.
- */
-
-static void
-glock_incore_commit(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		    struct gfs_log_element *le)
-{
-	struct gfs_glock *gl = container_of(le, struct gfs_glock, gl_new_le);
-
-	/* Transactions were combined, based on this glock */
-	if (gl->gl_incore_le.le_trans)
-		gfs_assert(sdp, gl->gl_incore_le.le_trans == tr,);
-	else {
-		/* Attach gl->gl_incore_le to being-committed trans */
-		gl->gl_incore_le.le_trans = tr;
-		list_add(&gl->gl_incore_le.le_list, &tr->tr_elements);
-
-		/* If transactions were combined (via another shared glock),
-		   the combined trans is getting a new glock log element */
-		if (tr != le->le_trans)
-			tr->tr_num_gl++;
-	}
-
-	/* Remove gl->gl_new_le from "new" trans */
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-}
-
-/**
- * glock_add_to_ail - Add this LE to the AIL
- * @sdp: the filesystem
- * @le: the log element
- *
- * Glocks don't really get added to AIL (there's nothing to write to disk),
- * they just get removed from the transaction at this time.
- */
-
-static void
-glock_add_to_ail(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-}
-
-/**
- * glock_trans_combine - combine two incore transactions
- * @sdp: the filesystem
- * @tr: the surviving transaction
- * @new_tr: the transaction that's going to disappear
- *
- */
-
-static void
-glock_trans_combine(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		    struct gfs_trans *new_tr)
-{
-	tr->tr_num_gl += new_tr->tr_num_gl;
-}
-
-/**
- * buf_print - print debug info about a log element
- * @sdp: the filesystem
- * @le: the log element
- * @where: is this a new transaction or a incore transaction
- *
- */
-
-static void
-buf_print(struct gfs_sbd *sdp, struct gfs_log_element *le, unsigned int where)
-{
-	struct gfs_bufdata *bd;
-
-	switch (where) {
-	case TRANS_IS_NEW:
-		bd = container_of(le, struct gfs_bufdata, bd_new_le);
-		break;
-	case TRANS_IS_INCORE:
-		bd = container_of(le, struct gfs_bufdata, bd_incore_le);
-		break;
-	default:
-		gfs_assert_warn(sdp, FALSE);
-		return;
-	}
-
-	printk("  Buffer:  %llu\n", (unsigned long long)bd->bd_bh->b_blocknr);
-}
-
-/**
- * buf_incore_commit - commit this buffer LE to the incore log
- * @sdp: the filesystem
- * @tr: the incore transaction this LE is a part of
- * @le: the log element for the "new" (just now complete) trans
- *
- * Invoked from incore_commit().
- * Move this buffer from "new" stage to "incore committed" stage of the
- *   transaction pipeline.
- * If this buffer was already attached to a pre-existing incore trans, GFS is
- *   combining the new and incore transactions; decrement buffer's recursive
- *   pin count that was incremented when it was added to the new transaction,
- *   and remove the reference to the "new" (being swallowed) trans.
- * Else, move this buffer's attach point from "new" to "incore" embedded LE
- *   (same transaction, just new status) and add this buf to (incore) trans'
- *   LE list.
- */
-
-static void
-buf_incore_commit(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		  struct gfs_log_element *le)
-{
-	struct gfs_bufdata *bd = container_of(le, struct gfs_bufdata, bd_new_le);
-
-	/* We've completed our (atomic) changes to this buffer for this trans.
-	   We no longer need the frozen copy.  If frozen copy was not written
-	   to on-disk log already, there's no longer a need to; we can now
-	   write the "real" buffer (with more up-to-date content) instead. */
-	if (bd->bd_frozen) {
-		kfree(bd->bd_frozen);
-		bd->bd_frozen = NULL;
-	}
-
-	/* New trans being combined with pre-existing incore trans? */
-	if (bd->bd_incore_le.le_trans) {
-		gfs_assert(sdp, bd->bd_incore_le.le_trans == tr,);
-		gfs_dunpin(sdp, bd->bd_bh, NULL);
-	} else {
-		bd->bd_incore_le.le_trans = tr;
-		list_add(&bd->bd_incore_le.le_list, &tr->tr_elements);
-		if (tr != le->le_trans)
-			tr->tr_num_buf++;
-
-		sdp->sd_log_buffers++;
-	}
-
-	/* Reset buffer's bd_new_le */
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-}
-
-/**
- * buf_add_to_ail - Add this LE to the AIL
- * @sdp: the filesystem
- * @le: the log element
- *
- */
-
-static void
-buf_add_to_ail(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	struct gfs_bufdata *bd = container_of(le,
-					       struct gfs_bufdata,
-					       bd_incore_le);
-
-	gfs_dunpin(sdp, bd->bd_bh, le->le_trans);
-
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-
-	gfs_assert(sdp, sdp->sd_log_buffers,);
-	sdp->sd_log_buffers--;
-}
-
-/**
- * buf_trans_size - compute how much space the LE class takes up in a transaction
- * @sdp: the filesystem
- * @tr: the transaction
- * @mblks: the number of regular metadata blocks
- * @eblks: the number of extra blocks
- * @blocks: the number of log blocks
- * @bmem: the number of buffer-sized chunks of memory we need
- *
- */
-
-static void
-buf_trans_size(struct gfs_sbd *sdp, struct gfs_trans *tr,
-	       unsigned int *mblks, unsigned int *eblks,
-	       unsigned int *blocks, unsigned int *bmem)
-{
-	unsigned int cblks;
-
-	if (tr->tr_num_buf) {
-		cblks = gfs_struct2blk(sdp, tr->tr_num_buf,
-				       sizeof(struct gfs_block_tag));
-
-		if (mblks)
-			*mblks += tr->tr_num_buf;
-		if (blocks)
-			*blocks += tr->tr_num_buf + cblks;
-		if (bmem)
-			*bmem += cblks;
-	}
-}
-
-/**
- * buf_trans_combine - combine two incore transactions
- * @sdp: the filesystem
- * @tr: the surviving transaction
- * @new_tr: the transaction that's going to disappear
- *
- */
-
-static void
-buf_trans_combine(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		  struct gfs_trans *new_tr)
-{
-	tr->tr_num_buf += new_tr->tr_num_buf;
-}
-
-/**
- * increment_generation - increment the generation number in metadata buffer
- * @sdp: the filesystem
- * @bd: the struct gfs_bufdata structure associated with the buffer
- *
- * Increment the generation # of the most recent buffer contents, as well as
- *   that of frozen buffer, if any.  If there is a frozen buffer, only *it*
- *   will be going to the log now ... in this case, the current buffer will
- *   have its gen # incremented again later, when it gets written to log.
- * Gen # is used by journal recovery (replay_block()) to determine whether
- *   to overwrite an inplace block with the logged block contents.
- */
-
-static void
-increment_generation(struct gfs_sbd *sdp, struct gfs_bufdata *bd)
-{
-	struct gfs_meta_header *mh, *mh2;
-	uint64_t tmp64;
-
-	mh = (struct gfs_meta_header *)bd->bd_bh->b_data;
-
-	tmp64 = gfs64_to_cpu(mh->mh_generation) + 1;
-	tmp64 = cpu_to_gfs64(tmp64);
-
-	if (bd->bd_frozen) {
-		mh2 = (struct gfs_meta_header *)bd->bd_frozen;
-		gfs_assert(sdp, mh->mh_generation == mh2->mh_generation,);
-		mh2->mh_generation = tmp64;
-	}
-	mh->mh_generation = tmp64;
-}
-
-/**
- * buf_build_bhlist - create the buffers that will make up the ondisk part of a transaction
- * @sdp: the filesystem
- * @tr: the transaction
- *
- * Create the log (transaction) descriptor block
- */
-
-static void
-buf_build_bhlist(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *tmp, *head;
-	struct gfs_log_element *le;
-	struct gfs_bufdata *bd;
-	struct gfs_log_descriptor desc;
-	struct gfs_block_tag tag;
-	struct gfs_log_buf *clb = NULL;
-	unsigned int num_ctl;
-	unsigned int offset = sizeof(struct gfs_log_descriptor);
-	unsigned int x, bufs;
-
-	if (!tr->tr_num_buf)
-		return;
-
-	/* set up control buffers for descriptor and tags */
-
-	num_ctl = gfs_struct2blk(sdp, tr->tr_num_buf,
-				 sizeof(struct gfs_block_tag));
-
-	for (x = 0; x < num_ctl; x++) {
-		if (clb)
-			gfs_log_get_buf(sdp, tr);
-		else
-			clb = gfs_log_get_buf(sdp, tr);
-	}
-
-	/* Init and copy log descriptor into 1st control block */
-	memset(&desc, 0, sizeof(struct gfs_log_descriptor));
-	desc.ld_header.mh_magic = GFS_MAGIC;
-	desc.ld_header.mh_type = GFS_METATYPE_LD;
-	desc.ld_header.mh_format = GFS_FORMAT_LD;
-	desc.ld_type = GFS_LOG_DESC_METADATA;
-	desc.ld_length = num_ctl + tr->tr_num_buf;
-	desc.ld_data1 = tr->tr_num_buf;
-	gfs_desc_out(&desc, clb->lb_bh.b_data);
-
-	x = 1;
-	bufs = 0;
-
-	for (head = &tr->tr_elements, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-
-		/* Skip over non-buffer (e.g. glock, unlinked, etc.) LEs */
-		if (le->le_ops != &gfs_buf_lops)
-			continue;
-
-		bd = container_of(le, struct gfs_bufdata, bd_incore_le);
-
-		gfs_meta_check(sdp, bd->bd_bh);
-
-		gfs_lock_buffer(bd->bd_bh);
-
-		increment_generation(sdp, bd);
-
-		/* Create "fake" buffer head to write block to on-disk log.  Use
-		   frozen copy if another transaction is modifying the "real"
-		   buffer contents.  Unlock real bh after log write completes,
-		   so Linux can write real contents to inplace block. */
-		gfs_log_fake_buf(sdp, tr,
-				 (bd->bd_frozen) ? bd->bd_frozen : bd->bd_bh->b_data,
-				 bd->bd_bh);
-
-		/* find another buffer for tags if we're overflowing this one */
-		if (offset + sizeof(struct gfs_block_tag) > sdp->sd_sb.sb_bsize) {
-			clb = list_entry(clb->lb_list.prev,
-					 struct gfs_log_buf, lb_list);
-			if (gfs_log_is_header(sdp, clb->lb_bh.b_blocknr))
-				clb = list_entry(clb->lb_list.prev,
-						 struct gfs_log_buf, lb_list);
-			x++;
-			offset = 0;
-		}
-
-		/* Write this LE's tag into a control buffer */
-		memset(&tag, 0, sizeof(struct gfs_block_tag));
-		tag.bt_blkno = bd->bd_bh->b_blocknr;
-
-		gfs_block_tag_out(&tag, clb->lb_bh.b_data + offset);
-
-		offset += sizeof(struct gfs_block_tag);
-		bufs++;
-	}
-
-	gfs_assert(sdp, x == num_ctl,);
-	gfs_assert(sdp, bufs == tr->tr_num_buf,);
-}
-
-/**
- * buf_before_scan - called before journal replay
- * @sdp: the filesystem
- * @jid: the journal ID about to be replayed
- * @head: the current head of the log
- * @pass: the pass through the journal
- *
- */
-
-static void
-buf_before_scan(struct gfs_sbd *sdp, unsigned int jid,
-		struct gfs_log_header *head, unsigned int pass)
-{
-	if (pass == GFS_RECPASS_A1)
-		sdp->sd_recovery_replays =
-			sdp->sd_recovery_skips =
-			sdp->sd_recovery_sames = 0;
-}
-
-/**
- * replay_block - Replay a single metadata block
- * @sdp: the filesystem
- * @jdesc: the struct gfs_jindex structure for the journal being replayed
- * @gl: the journal's glock
- * @tag: the block tag describing the inplace location of the block
- * @blkno: the location of the log's copy of the block
- *
- * Returns: errno
- *
- * Read in-place block from disk
- * Read log (journal) block from disk
- * Compare generation numbers
- * Copy log block to in-place block on-disk if:
- *   log generation # > in-place generation #
- *   OR generation #s are ==, but data contained in block is different (corrupt)
- */
-
-static int
-replay_block(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-	     struct gfs_glock *gl, struct gfs_block_tag *tag, uint64_t blkno)
-{
-	struct buffer_head *inplace_bh, *log_bh;
-	struct gfs_meta_header inplace_mh, log_mh;
-	int replay_block = TRUE;
-	int error = 0;
-
-	gfs_replay_check(sdp);
-
-	/* Warning:  Using a real buffer here instead of a tempbh can be bad
-	   on a OS that won't support multiple simultaneous buffers for the
-	   same block on different glocks. */
-
-	error = gfs_dread(gl, tag->bt_blkno,
-			  DIO_START | DIO_WAIT, &inplace_bh);
-	if (error)
-		return error;
-	if (gfs_meta_check(sdp, inplace_bh)) {
-		brelse(inplace_bh);
-		return -EIO;
-	}
-	gfs_meta_header_in(&inplace_mh, inplace_bh->b_data);
-
-	error = gfs_dread(gl, blkno, DIO_START | DIO_WAIT, &log_bh);
-	if (error) {
-		brelse(inplace_bh);
-		return error;
-	}
-	if (gfs_meta_check(sdp, log_bh)) {
-		brelse(inplace_bh);
-		brelse(log_bh);
-		return -EIO;
-	}
-	gfs_meta_header_in(&log_mh, log_bh->b_data);
-
-	if (log_mh.mh_generation < inplace_mh.mh_generation) {
-		replay_block = FALSE;
-		sdp->sd_recovery_skips++;
-	} else if (log_mh.mh_generation == inplace_mh.mh_generation) {
-		if (memcmp(log_bh->b_data,
-			   inplace_bh->b_data,
-			   sdp->sd_sb.sb_bsize) == 0) {
-			replay_block = FALSE;
-			sdp->sd_recovery_sames++;
-		}
-	}
-
-	if (replay_block) {
-		memcpy(inplace_bh->b_data,
-		       log_bh->b_data,
-		       sdp->sd_sb.sb_bsize);
-
-		error = gfs_replay_buf(gl, inplace_bh);
-		if (!error)
-			sdp->sd_recovery_replays++;
-	}
-
-	brelse(log_bh);
-	brelse(inplace_bh);
-
-	return error;
-}
-
-/**
- * buf_scan_elements - Replay a metadata log descriptor
- * @sdp: the filesystem
- * @jdesc: the struct gfs_jindex structure for the journal being replayed
- * @gl: the journal's glock
- * @start: the starting block of the descriptor
- * @desc: the descriptor structure
- * @pass: the pass through the journal
- *
- * Returns: errno
- */
-
-static int
-buf_scan_elements(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		  struct gfs_glock *gl, uint64_t start,
-		  struct gfs_log_descriptor *desc, unsigned int pass)
-{
-	struct gfs_block_tag tag;
-	struct buffer_head *bh;
-	uint64_t cblk = start;
-	unsigned int num_tags = desc->ld_data1;
-	unsigned int offset = sizeof(struct gfs_log_descriptor);
-	unsigned int x;
-	int error;
-
-	if (pass != GFS_RECPASS_A1)
-		return 0;
-	if (desc->ld_type != GFS_LOG_DESC_METADATA)
-		return 0;
-
-	x = gfs_struct2blk(sdp, num_tags, sizeof(struct gfs_block_tag));
-	while (x--) {
-		error = gfs_increment_blkno(sdp, jdesc, gl, &start, TRUE);
-		if (error)
-			return error;
-	}
-
-	for (;;) {
-		gfs_assert(sdp, num_tags,);
-
-		error = gfs_dread(gl, cblk, DIO_START | DIO_WAIT, &bh);
-		if (error)
-			return error;
-
-		/* Do readahead for the inplace blocks in this control block */
-		{
-			unsigned int o2 = offset;
-			unsigned int nt2 = num_tags;
-
-			while (o2 + sizeof(struct gfs_block_tag) <=
-			       sdp->sd_sb.sb_bsize) {
-				gfs_block_tag_in(&tag, bh->b_data + o2);
-				gfs_start_ra(gl, tag.bt_blkno, 1);
-				if (!--nt2)
-					break;
-				o2 += sizeof(struct gfs_block_tag);
-			}
-		}
-
-		while (offset + sizeof(struct gfs_block_tag) <=
-		       sdp->sd_sb.sb_bsize) {
-			gfs_block_tag_in(&tag, bh->b_data + offset);
-
-			error = replay_block(sdp, jdesc, gl, &tag, start);
-			if (error)
-				goto out_drelse;
-
-			if (!--num_tags)
-				goto out_drelse;
-
-			error = gfs_increment_blkno(sdp, jdesc, gl, &start, TRUE);
-			if (error)
-				goto out_drelse;
-
-			offset += sizeof(struct gfs_block_tag);
-		}
-
-		brelse(bh);
-
-		error = gfs_increment_blkno(sdp, jdesc, gl, &cblk, TRUE);
-		if (error)
-			return error;
-
-		offset = 0;
-	}
-
-	return 0;
-
- out_drelse:
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * buf_after_scan - called after journal replay
- * @sdp: the filesystem
- * @jid: the journal ID about to be replayed
- * @pass: the pass through the journal
- *
- */
-
-static void
-buf_after_scan(struct gfs_sbd *sdp, unsigned int jid, unsigned int pass)
-{
-	if (pass == GFS_RECPASS_A1) {
-		printk("GFS: fsid=%s: jid=%u: Replayed %u of %u blocks\n",
-		       sdp->sd_fsname, jid,
-		       sdp->sd_recovery_replays,
-		       sdp->sd_recovery_replays + sdp->sd_recovery_skips +
-		       sdp->sd_recovery_sames);
-		printk("GFS: fsid=%s: jid=%u: replays = %u, skips = %u, sames = %u\n",
-		       sdp->sd_fsname, jid, sdp->sd_recovery_replays,
-		       sdp->sd_recovery_skips, sdp->sd_recovery_sames);
-	}
-}
-
-/**
- * unlinked_print - print debug info about a log element
- * @sdp: the filesystem
- * @le: the log element
- * @where: is this a new transaction or a incore transaction
- *
- */
-
-static void
-unlinked_print(struct gfs_sbd *sdp, struct gfs_log_element *le,
-	       unsigned int where)
-{
-	struct gfs_unlinked *ul;
-	char *type;
-
-	switch (where) {
-	case TRANS_IS_NEW:
-		ul = container_of(le, struct gfs_unlinked, ul_new_le);
-		type = (test_bit(ULF_NEW_UL, &ul->ul_flags)) ?
-			"unlink" : "dealloc";
-		break;
-	case TRANS_IS_INCORE:
-		ul = container_of(le, struct gfs_unlinked, ul_incore_le);
-		type = (test_bit(ULF_INCORE_UL, &ul->ul_flags)) ?
-			"unlink" : "dealloc";
-		break;
-	default:
-		gfs_assert_warn(sdp, FALSE);
-		return;
-	}
-
-	printk("  unlinked:  %llu/%llu, %s\n",
-	       (unsigned long long)ul->ul_inum.no_formal_ino,
-	       (unsigned long long)ul->ul_inum.no_addr,
-	       type);
-}
-
-/**
- * unlinked_incore_commit - commit this LE to the incore log
- * @sdp: the filesystem
- * @tr: the incore transaction this LE is a part of
- * @le: the log element
- *
- */
-
-static void
-unlinked_incore_commit(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		       struct gfs_log_element *le)
-{
-	struct gfs_unlinked *ul = container_of(le,
-					       struct gfs_unlinked,
-					       ul_new_le);
-	int n = !!test_bit(ULF_NEW_UL, &ul->ul_flags);
-	int i = !!test_bit(ULF_INCORE_UL, &ul->ul_flags);
-
-	if (ul->ul_incore_le.le_trans) {
-		gfs_assert(sdp, ul->ul_incore_le.le_trans == tr,);
-		gfs_assert(sdp, n != i,);
-
-		ul->ul_incore_le.le_trans = NULL;
-		list_del_init(&ul->ul_incore_le.le_list);
-		gfs_unlinked_put(sdp, ul);
-
-		if (i) {
-			gfs_assert(sdp, tr->tr_num_iul,);
-			tr->tr_num_iul--;
-		} else {
-			gfs_assert(sdp, tr->tr_num_ida,);
-			tr->tr_num_ida--;
-		}
-	} else {
-		gfs_unlinked_hold(sdp, ul);
-		ul->ul_incore_le.le_trans = tr;
-		list_add(&ul->ul_incore_le.le_list, &tr->tr_elements);
-
-		if (n) {
-			set_bit(ULF_INCORE_UL, &ul->ul_flags);
-			if (tr != le->le_trans)
-				tr->tr_num_iul++;
-		} else {
-			clear_bit(ULF_INCORE_UL, &ul->ul_flags);
-			if (tr != le->le_trans)
-				tr->tr_num_ida++;
-		}
-	}
-
-	if (n) {
-		gfs_unlinked_hold(sdp, ul);
-		gfs_assert(sdp, !test_bit(ULF_IC_LIST, &ul->ul_flags),);
-		set_bit(ULF_IC_LIST, &ul->ul_flags);
-		atomic_inc(&sdp->sd_unlinked_ic_count);
-	} else {
-		gfs_assert(sdp, test_bit(ULF_IC_LIST, &ul->ul_flags),);
-		clear_bit(ULF_IC_LIST, &ul->ul_flags);
-		gfs_unlinked_put(sdp, ul);
-		gfs_assert(sdp, atomic_read(&sdp->sd_unlinked_ic_count),);
-		atomic_dec(&sdp->sd_unlinked_ic_count);
-	}
-
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-	gfs_unlinked_put(sdp, ul);
-}
-
-/**
- * unlinked_add_to_ail - Add this LE to the AIL
- * @sdp: the filesystem
- * @le: the log element
- *
- */
-
-static void
-unlinked_add_to_ail(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	struct gfs_unlinked *ul = container_of(le,
-						struct gfs_unlinked,
-						ul_incore_le);
-	int i = !!test_bit(ULF_INCORE_UL, &ul->ul_flags);
-
-	if (i) {
-		gfs_unlinked_hold(sdp, ul);
-		gfs_assert(sdp, !test_bit(ULF_OD_LIST, &ul->ul_flags),);
-		set_bit(ULF_OD_LIST, &ul->ul_flags);
-		atomic_inc(&sdp->sd_unlinked_od_count);
-	} else {
-		gfs_assert(sdp, test_bit(ULF_OD_LIST, &ul->ul_flags),);
-		clear_bit(ULF_OD_LIST, &ul->ul_flags);
-		gfs_unlinked_put(sdp, ul);
-		gfs_assert(sdp, atomic_read(&sdp->sd_unlinked_od_count),);
-		atomic_dec(&sdp->sd_unlinked_od_count);
-	}
-
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-	gfs_unlinked_put(sdp, ul);
-}
-
-/**
- * unlinked_clean_dump - clean up a LE after a log dump
- * @sdp: the filesystem
- * @le: the log element
- *
- */
-
-static void
-unlinked_clean_dump(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-}
-
-/**
- * unlinked_trans_size - compute how much space the LE class takes up in a transaction
- * @sdp: the filesystem
- * @tr: the transaction
- * @mblks: the number of regular metadata blocks
- * @eblks: the number of extra blocks
- * @blocks: the number of log blocks
- * @bmem: the number of buffer-sized chunks of memory we need
- *
- */
-
-static void
-unlinked_trans_size(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		    unsigned int *mblks, unsigned int *eblks,
-		    unsigned int *blocks, unsigned int *bmem)
-{
-	unsigned int ublks = 0;
-
-	if (tr->tr_num_iul)
-		ublks = gfs_struct2blk(sdp, tr->tr_num_iul,
-				       sizeof(struct gfs_inum));
-	if (tr->tr_num_ida)
-		ublks += gfs_struct2blk(sdp, tr->tr_num_ida,
-					sizeof(struct gfs_inum));
-
-	if (eblks)
-		*eblks += ublks;
-	if (blocks)
-		*blocks += ublks;
-	if (bmem)
-		*bmem += ublks;
-}
-
-/**
- * unlinked_trans_combine - combine two incore transactions
- * @sdp: the filesystem
- * @tr: the surviving transaction
- * @new_tr: the transaction that's going to disappear
- *
- */
-
-static void
-unlinked_trans_combine(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		       struct gfs_trans *new_tr)
-{
-	tr->tr_num_iul += new_tr->tr_num_iul;
-	tr->tr_num_ida += new_tr->tr_num_ida;
-}
-
-/**
- * unlinked_build_bhlist - create the buffers that will make up the ondisk part of a transaction
- * @sdp: the filesystem
- * @tr: the transaction
- *
- * For unlinked and/or deallocated inode log elements (separately):
- *   Get a log block
- *   Create a log descriptor in beginning of that block
- *   Fill rest of block with gfs_inum structs to identify each inode
- *     that became unlinked/deallocated during this transaction.
- *   Get another log block if needed, continue filling with gfs_inums.
- */
-
-static void
-unlinked_build_bhlist(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *tmp, *head;
-	struct gfs_log_element *le;
-	struct gfs_unlinked *ul;
-	struct gfs_log_descriptor desc;
-	struct gfs_log_buf *lb;
-	unsigned int pass = 2;
-	unsigned int type, number;
-	unsigned int offset, entries;
-
-	/* 2 passes:  1st for Unlinked, 2nd for De-Alloced inodes,
-	     unless this is a log dump:  just 1 pass, for Unlinked */
-	while (pass--) {
-		if (tr->tr_flags & TRF_LOG_DUMP) {
-			if (pass) {
-				type = GFS_LOG_DESC_IUL;
-				number = tr->tr_num_iul;
-			} else
-				break;
-		} else {
-			if (pass) {
-				type = GFS_LOG_DESC_IUL;
-				number = tr->tr_num_iul;
-			} else {
-				type = GFS_LOG_DESC_IDA;
-				number = tr->tr_num_ida;
-			}
-
-			if (!number)
-				continue;
-		}
-
-		lb = gfs_log_get_buf(sdp, tr);
-
-		/* Header:  log descriptor */
-		memset(&desc, 0, sizeof(struct gfs_log_descriptor));
-		desc.ld_header.mh_magic = GFS_MAGIC;
-		desc.ld_header.mh_type = GFS_METATYPE_LD;
-		desc.ld_header.mh_format = GFS_FORMAT_LD;
-		desc.ld_type = type;
-		desc.ld_length = gfs_struct2blk(sdp, number, sizeof(struct gfs_inum));
-		desc.ld_data1 = (tr->tr_flags & TRF_LOG_DUMP) ? TRUE : FALSE;
-		gfs_desc_out(&desc, lb->lb_bh.b_data);
-
-		offset = sizeof(struct gfs_log_descriptor);
-		entries = 0;
-
-		/* Look through transaction's log elements for Unlinked LEs */
-		for (head = &tr->tr_elements, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			le = list_entry(tmp, struct gfs_log_element, le_list);
-			if (le->le_ops != &gfs_unlinked_lops)
-				continue;
-			if (tr->tr_flags & TRF_LOG_DUMP)
-				ul = container_of(le,
-						  struct gfs_unlinked,
-						  ul_ondisk_le);
-			else {
-				ul = container_of(le,
-						  struct gfs_unlinked,
-						  ul_incore_le);
-				if (!!test_bit(ULF_INCORE_UL, &ul->ul_flags) != pass)
-					continue;
-			}
-
-			if (offset + sizeof(struct gfs_inum) > sdp->sd_sb.sb_bsize) {
-				offset = 0;
-				lb = gfs_log_get_buf(sdp, tr);
-			}
-
-			/* Payload:  write the inode identifier */
-			gfs_inum_out(&ul->ul_inum,
-				     lb->lb_bh.b_data + offset);
-
-			offset += sizeof(struct gfs_inum);
-			entries++;
-		}
-
-		gfs_assert(sdp, entries == number,);
-	}
-}
-
-/**
- * unlinked_dump_size - compute how much space the LE class takes up in a log dump
- * @sdp: the filesystem
- * @elements: the number of log elements in the dump
- * @blocks: the number of blocks in the dump
- * @bmem: the number of buffer-sized chunks of memory we need
- *
- */
-
-static void
-unlinked_dump_size(struct gfs_sbd *sdp, unsigned int *elements,
-		   unsigned int *blocks, unsigned int *bmem)
-{
-	unsigned int c = atomic_read(&sdp->sd_unlinked_od_count);
-	unsigned int b = gfs_struct2blk(sdp, c, sizeof(struct gfs_inum));
-
-	if (elements)
-		*elements += c;
-	if (blocks)
-		*blocks += b;
-	if (bmem)
-		*bmem += b;
-}
-
-/**
- * unlinked_build_dump - create a transaction that represents a log dump for this LE class
- * @sdp: the filesystem
- * @tr: the transaction to fill
- *
- */
-
-static void
-unlinked_build_dump(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *tmp, *head;
-	struct gfs_unlinked *ul;
-	unsigned int x = 0;
-
-	tr->tr_num_iul = atomic_read(&sdp->sd_unlinked_od_count);
-
-	spin_lock(&sdp->sd_unlinked_lock);
-
-	for (head = &sdp->sd_unlinked_list, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		ul = list_entry(tmp, struct gfs_unlinked, ul_list);
-		if (!test_bit(ULF_OD_LIST, &ul->ul_flags))
-			continue;
-
-		gfs_assert(sdp, !ul->ul_ondisk_le.le_trans,);
-		ul->ul_ondisk_le.le_trans = tr;
-		list_add(&ul->ul_ondisk_le.le_list, &tr->tr_elements);
-
-		x++;
-	}
-
-	spin_unlock(&sdp->sd_unlinked_lock);
-
-	gfs_assert(sdp, x == atomic_read(&sdp->sd_unlinked_od_count),);
-}
-
-/**
- * unlinked_before_scan - called before a log dump is recovered
- * @sdp: the filesystem
- * @jid: the journal ID about to be scanned
- * @head: the current head of the log
- * @pass: the pass through the journal
- *
- */
-
-static void
-unlinked_before_scan(struct gfs_sbd *sdp, unsigned int jid,
-		     struct gfs_log_header *head, unsigned int pass)
-{
-	if (pass == GFS_RECPASS_B1)
-		clear_bit(SDF_FOUND_UL_DUMP, &sdp->sd_flags);
-}
-
-/**
- * unlinked_scan_elements - scan unlinked inodes from the journal
- * @sdp: the filesystem
- * @jdesc: the struct gfs_jindex structure for the journal being scaned
- * @gl: the journal's glock
- * @start: the starting block of the descriptor
- * @desc: the descriptor structure
- * @pass: the pass through the journal
- *
- * Returns: errno
- */
-
-static int
-unlinked_scan_elements(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		       struct gfs_glock *gl, uint64_t start,
-		       struct gfs_log_descriptor *desc, unsigned int pass)
-{
-	struct gfs_inum inum;
-	struct buffer_head *bh;
-	unsigned int offset = sizeof(struct gfs_log_descriptor);
-	unsigned int x;
-	int error;
-
-	if (pass != GFS_RECPASS_B1)
-		return 0;
-
-	switch (desc->ld_type) {
-	case GFS_LOG_DESC_IUL:
-		if (test_bit(SDF_FOUND_UL_DUMP, &sdp->sd_flags))
-			gfs_assert(sdp, !desc->ld_data1,);
-		else {
-			gfs_assert(sdp, desc->ld_data1,);
-			set_bit(SDF_FOUND_UL_DUMP, &sdp->sd_flags);
-		}
-		break;
-
-	case GFS_LOG_DESC_IDA:
-		gfs_assert(sdp, test_bit(SDF_FOUND_UL_DUMP, &sdp->sd_flags),);
-		break;
-
-	default:
-		return 0;
-	}
-
-	for (x = 0; x < desc->ld_length; x++) {
-		error = gfs_dread(gl, start, DIO_START | DIO_WAIT, &bh);
-		if (error)
-			return error;
-
-		for (;
-		     offset + sizeof(struct gfs_inum) <= sdp->sd_sb.sb_bsize;
-		     offset += sizeof(struct gfs_inum)) {
-			gfs_inum_in(&inum, bh->b_data + offset);
-
-			if (inum.no_addr)
-				gfs_unlinked_merge(sdp, desc->ld_type, &inum);
-		}
-
-		brelse(bh);
-
-		error = gfs_increment_blkno(sdp, jdesc, gl, &start, TRUE);
-		if (error)
-			return error;
-
-		offset = 0;
-	}
-
-	return 0;
-}
-
-/**
- * unlinked_after_scan - called after a log dump is recovered
- * @sdp: the filesystem
- * @jid: the journal ID about to be scanned
- * @pass: the pass through the journal
- *
- */
-
-static void
-unlinked_after_scan(struct gfs_sbd *sdp, unsigned int jid, unsigned int pass)
-{
-	if (pass == GFS_RECPASS_B1) {
-		gfs_assert(sdp, test_bit(SDF_FOUND_UL_DUMP, &sdp->sd_flags),);
-		printk("GFS: fsid=%s: Found %d unlinked inodes\n",
-		       sdp->sd_fsname, atomic_read(&sdp->sd_unlinked_ic_count));
-	}
-}
-
-/**
- * quota_print - print debug info about a log element
- * @sdp: the filesystem
- * @le: the log element
- * @where: is this a new transaction or a incore transaction
- *
- */
-
-static void
-quota_print(struct gfs_sbd *sdp, struct gfs_log_element *le, unsigned int where)
-{
-	struct gfs_quota_le *ql;
-
-	ql = container_of(le, struct gfs_quota_le, ql_le);
-	printk("  quota:  %s %u:  %lld blocks\n",
-	       (test_bit(QDF_USER, &ql->ql_data->qd_flags)) ? "user" : "group",
-	       ql->ql_data->qd_id, (long long)ql->ql_change);
-}
-
-/**
- * quota_incore_commit - commit this LE to the incore log
- * @sdp: the filesystem
- * @tr: the incore transaction this LE is a part of
- * @le: the log element
- *
- */
-
-static void
-quota_incore_commit(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		    struct gfs_log_element *le)
-{
-	struct gfs_quota_le *ql = container_of(le, struct gfs_quota_le, ql_le);
-	struct gfs_quota_data *qd = ql->ql_data;
-
-	gfs_assert(sdp, ql->ql_change,);
-
-	/*  Make this change under the sd_quota_lock, so other processes
-	   checking qd_change_ic don't have to acquire the log lock.  */
-
-	spin_lock(&sdp->sd_quota_lock);
-	qd->qd_change_new -= ql->ql_change;
-	qd->qd_change_ic += ql->ql_change;
-	spin_unlock(&sdp->sd_quota_lock);
-
-	if (le->le_trans == tr)
-		list_add(&ql->ql_data_list, &qd->qd_le_list);
-	else {
-		struct list_head *tmp, *head;
-		struct gfs_quota_le *tmp_ql;
-		int found = FALSE;
-
-		for (head = &qd->qd_le_list, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			tmp_ql = list_entry(tmp, struct gfs_quota_le, ql_data_list);
-			if (tmp_ql->ql_le.le_trans != tr)
-				continue;
-
-			tmp_ql->ql_change += ql->ql_change;
-
-			list_del(&le->le_list);
-			gfs_quota_put(sdp, qd);
-			kfree(ql);
-
-			if (!tmp_ql->ql_change) {
-				list_del(&tmp_ql->ql_data_list);
-				list_del(&tmp_ql->ql_le.le_list);
-				gfs_quota_put(sdp, tmp_ql->ql_data);
-				kfree(tmp_ql);
-				tr->tr_num_q--;
-			}
-
-			found = TRUE;
-			break;
-		}
-
-		if (!found) {
-			le->le_trans = tr;
-			list_move(&le->le_list, &tr->tr_elements);
-			tr->tr_num_q++;
-			list_add(&ql->ql_data_list, &qd->qd_le_list);
-		}
-	}
-}
-
-/**
- * quota_add_to_ail - Add this LE to the AIL
- * @sdp: the filesystem
- * @le: the log element
- *
- */
-
-static void
-quota_add_to_ail(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	struct gfs_quota_le *ql = container_of(le, struct gfs_quota_le, ql_le);
-	struct gfs_quota_data *qd = ql->ql_data;
-
-	qd->qd_change_od += ql->ql_change;
-	if (qd->qd_change_od) {
-		if (!test_bit(QDF_OD_LIST, &qd->qd_flags)) {
-			gfs_quota_hold(sdp, qd);
-			set_bit(QDF_OD_LIST, &qd->qd_flags);
-			atomic_inc(&sdp->sd_quota_od_count);
-		}
-	} else {
-		gfs_assert(sdp, test_bit(QDF_OD_LIST, &qd->qd_flags),);
-		clear_bit(QDF_OD_LIST, &qd->qd_flags);
-		gfs_quota_put(sdp, qd);
-		gfs_assert(sdp, atomic_read(&sdp->sd_quota_od_count),);
-		atomic_dec(&sdp->sd_quota_od_count);
-	}
-
-	list_del(&ql->ql_data_list);
-	list_del(&le->le_list);
-	gfs_quota_put(sdp, qd);
-	kfree(ql);
-}
-
-/**
- * quota_clean_dump - clean up a LE after a log dump
- * @sdp: the filesystem
- * @le: the log element
- *
- */
-
-static void
-quota_clean_dump(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	le->le_trans = NULL;
-	list_del_init(&le->le_list);
-}
-
-/**
- * quota_trans_size - compute how much space the LE class takes up in a transaction
- * @sdp: the filesystem
- * @tr: the transaction
- * @mblks: the number of regular metadata blocks
- * @eblks: the number of extra blocks
- * @blocks: the number of log blocks
- * @bmem: the number of buffer-sized chunks of memory we need
- *
- */
-
-static void
-quota_trans_size(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		 unsigned int *mblks, unsigned int *eblks,
-		 unsigned int *blocks, unsigned int *bmem)
-{
-	unsigned int qblks;
-
-	if (tr->tr_num_q) {
-		qblks = gfs_struct2blk(sdp, tr->tr_num_q,
-				       sizeof(struct gfs_quota_tag));
-
-		if (eblks)
-			*eblks += qblks;
-		if (blocks)
-			*blocks += qblks;
-		if (bmem)
-			*bmem += qblks;
-	}
-}
-
-/**
- * quota_trans_combine - combine two incore transactions
- * @sdp: the filesystem
- * @tr: the surviving transaction
- * @new_tr: the transaction that's going to disappear
- *
- */
-
-static void
-quota_trans_combine(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		    struct gfs_trans *new_tr)
-{
-	tr->tr_num_q += new_tr->tr_num_q;
-}
-
-/**
- * quota_build_bhlist - create the buffers that will make up the ondisk part of a transaction
- * @sdp: the filesystem
- * @tr: the transaction
- *
- */
-
-static void
-quota_build_bhlist(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *tmp, *head;
-	struct gfs_log_element *le;
-	struct gfs_quota_le *ql;
-	struct gfs_log_descriptor desc;
-	struct gfs_quota_tag tag;
-	struct gfs_log_buf *lb;
-	unsigned int offset = sizeof(struct gfs_log_descriptor), entries = 0;
-
-	if (!tr->tr_num_q && !(tr->tr_flags & TRF_LOG_DUMP))
-		return;
-
-	lb = gfs_log_get_buf(sdp, tr);
-
-	memset(&desc, 0, sizeof(struct gfs_log_descriptor));
-	desc.ld_header.mh_magic = GFS_MAGIC;
-	desc.ld_header.mh_type = GFS_METATYPE_LD;
-	desc.ld_header.mh_format = GFS_FORMAT_LD;
-	desc.ld_type = GFS_LOG_DESC_Q;
-	desc.ld_length = gfs_struct2blk(sdp, tr->tr_num_q,
-					sizeof(struct gfs_quota_tag));
-	desc.ld_data1 = tr->tr_num_q;
-	desc.ld_data2 = (tr->tr_flags & TRF_LOG_DUMP) ? TRUE : FALSE;
-	gfs_desc_out(&desc, lb->lb_bh.b_data);
-
-	for (head = &tr->tr_elements, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-		if (le->le_ops != &gfs_quota_lops)
-			continue;
-
-		ql = container_of(le, struct gfs_quota_le, ql_le);
-
-		if (offset + sizeof(struct gfs_quota_tag) >
-		    sdp->sd_sb.sb_bsize) {
-			offset = 0;
-			lb = gfs_log_get_buf(sdp, tr);
-		}
-
-		memset(&tag, 0, sizeof(struct gfs_quota_tag));
-		tag.qt_change = ql->ql_change;
-		tag.qt_flags = (test_bit(QDF_USER, &ql->ql_data->qd_flags)) ?
-			GFS_QTF_USER : 0;
-		tag.qt_id = ql->ql_data->qd_id;
-
-		gfs_quota_tag_out(&tag, lb->lb_bh.b_data + offset);
-
-		offset += sizeof(struct gfs_quota_tag);
-		entries++;
-	}
-
-	gfs_assert(sdp, entries == tr->tr_num_q,);
-}
-
-/**
- * quota_dump_size - compute how much space the LE class takes up in a log dump
- * @sdp: the filesystem
- * @elements: the number of log elements in the dump
- * @blocks: the number of blocks in the dump
- * @bmem: the number of buffer-sized chunks of memory we need
- *
- */
-
-static void
-quota_dump_size(struct gfs_sbd *sdp, unsigned int *elements,
-		unsigned int *blocks, unsigned int *bmem)
-{
-	unsigned int c = atomic_read(&sdp->sd_quota_od_count);
-	unsigned int b = gfs_struct2blk(sdp, c, sizeof(struct gfs_quota_tag));
-
-	if (elements)
-		*elements += c;
-	if (blocks)
-		*blocks += b;
-	if (bmem)
-		*bmem += b;
-}
-
-/**
- * quota_build_dump - create a transaction that represents a log dump for this LE class
- * @sdp: the filesystem
- * @tr: the transaction to fill
- *
- */
-
-static void
-quota_build_dump(struct gfs_sbd *sdp, struct gfs_trans *tr)
-{
-	struct list_head *tmp, *head;
-	struct gfs_quota_data *qd;
-	struct gfs_quota_le *ql;
-	unsigned int x = 0;
-
-	tr->tr_num_q = atomic_read(&sdp->sd_quota_od_count);
-
-	spin_lock(&sdp->sd_quota_lock);
-
-	for (head = &sdp->sd_quota_list, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		qd = list_entry(tmp, struct gfs_quota_data, qd_list);
-		if (!test_bit(QDF_OD_LIST, &qd->qd_flags))
-			continue;
-
-		ql = &qd->qd_ondisk_ql;
-
-		ql->ql_le.le_ops = &gfs_quota_lops;
-		gfs_assert(sdp, !ql->ql_le.le_trans,);
-		ql->ql_le.le_trans = tr;
-		list_add(&ql->ql_le.le_list, &tr->tr_elements);
-
-		ql->ql_data = qd;
-		ql->ql_change = qd->qd_change_od;
-
-		x++;
-	}
-
-	spin_unlock(&sdp->sd_quota_lock);
-
-	gfs_assert(sdp, x == atomic_read(&sdp->sd_quota_od_count),);
-}
-
-/**
- * quota_before_scan - called before a log dump is recovered
- * @sdp: the filesystem
- * @jid: the journal ID about to be scanned
- * @head: the current head of the log
- * @pass: the pass through the journal
- *
- */
-
-static void
-quota_before_scan(struct gfs_sbd *sdp, unsigned int jid,
-		  struct gfs_log_header *head, unsigned int pass)
-{
-	if (pass == GFS_RECPASS_B1)
-		clear_bit(SDF_FOUND_Q_DUMP, &sdp->sd_flags);
-}
-
-/**
- * quota_scan_elements - scan quota inodes from the journal
- * @sdp: the filesystem
- * @jdesc: the struct gfs_jindex structure for the journal being scaned
- * @gl: the journal's glock
- * @start: the starting block of the descriptor
- * @desc: the descriptor structure
- * @pass: the pass through the journal
- *
- * Returns: errno
- */
-
-static int
-quota_scan_elements(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		    struct gfs_glock *gl, uint64_t start,
-		    struct gfs_log_descriptor *desc, unsigned int pass)
-{
-	struct gfs_quota_tag tag;
-	struct buffer_head *bh;
-	unsigned int num_tags = desc->ld_data1;
-	unsigned int offset = sizeof(struct gfs_log_descriptor);
-	unsigned int x;
-	int error;
-
-	if (pass != GFS_RECPASS_B1)
-		return 0;
-	if (desc->ld_type != GFS_LOG_DESC_Q)
-		return 0;
-
-	if (test_bit(SDF_FOUND_Q_DUMP, &sdp->sd_flags))
-		gfs_assert(sdp, !desc->ld_data2,);
-	else {
-		gfs_assert(sdp, desc->ld_data2,);
-		set_bit(SDF_FOUND_Q_DUMP, &sdp->sd_flags);
-	}
-
-	if (!num_tags)
-		return 0;
-
-	for (x = 0; x < desc->ld_length; x++) {
-		error = gfs_dread(gl, start, DIO_START | DIO_WAIT, &bh);
-		if (error)
-			return error;
-
-		while (offset + sizeof(struct gfs_quota_tag) <=
-		       sdp->sd_sb.sb_bsize) {
-			gfs_quota_tag_in(&tag, bh->b_data + offset);
-
-			error = gfs_quota_merge(sdp, &tag);
-			if (error)
-				goto out_drelse;
-
-			if (!--num_tags)
-				goto out_drelse;
-
-			offset += sizeof(struct gfs_quota_tag);
-		}
-
-		brelse(bh);
-
-		error = gfs_increment_blkno(sdp, jdesc, gl, &start, TRUE);
-		if (error)
-			return error;
-
-		offset = 0;
-	}
-
-	return 0;
-
- out_drelse:
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * quota_after_scan - called after a log dump is recovered
- * @sdp: the filesystem
- * @jid: the journal ID about to be scanned
- * @pass: the pass through the journal
- *
- */
-
-static void
-quota_after_scan(struct gfs_sbd *sdp, unsigned int jid, unsigned int pass)
-{
-	if (pass == GFS_RECPASS_B1) {
-		gfs_assert(sdp, !sdp->sd_sb.sb_quota_di.no_formal_ino ||
-			   test_bit(SDF_FOUND_Q_DUMP, &sdp->sd_flags),);
-		printk("GFS: fsid=%s: Found quota changes for %d IDs\n",
-		       sdp->sd_fsname, atomic_read(&sdp->sd_quota_od_count));
-	}
-}
-
-struct gfs_log_operations gfs_glock_lops = {
-	.lo_add = generic_le_add,
-	.lo_trans_end = glock_trans_end,
-	.lo_print = glock_print,
-	.lo_overlap_trans = glock_overlap_trans,
-	.lo_incore_commit = glock_incore_commit,
-	.lo_add_to_ail = glock_add_to_ail,
-	.lo_trans_combine = glock_trans_combine,
-	.lo_name = "glock"
-};
-
-struct gfs_log_operations gfs_buf_lops = {
-	.lo_add = generic_le_add,
-	.lo_print = buf_print,
-	.lo_incore_commit = buf_incore_commit,
-	.lo_add_to_ail = buf_add_to_ail,
-	.lo_trans_size = buf_trans_size,
-	.lo_trans_combine = buf_trans_combine,
-	.lo_build_bhlist = buf_build_bhlist,
-	.lo_before_scan = buf_before_scan,
-	.lo_scan_elements = buf_scan_elements,
-	.lo_after_scan = buf_after_scan,
-	.lo_name = "buf"
-};
-
-struct gfs_log_operations gfs_unlinked_lops = {
-	.lo_add = generic_le_add,
-	.lo_print = unlinked_print,
-	.lo_incore_commit = unlinked_incore_commit,
-	.lo_add_to_ail = unlinked_add_to_ail,
-	.lo_clean_dump = unlinked_clean_dump,
-	.lo_trans_size = unlinked_trans_size,
-	.lo_trans_combine = unlinked_trans_combine,
-	.lo_build_bhlist = unlinked_build_bhlist,
-	.lo_dump_size = unlinked_dump_size,
-	.lo_build_dump = unlinked_build_dump,
-	.lo_before_scan = unlinked_before_scan,
-	.lo_scan_elements = unlinked_scan_elements,
-	.lo_after_scan = unlinked_after_scan,
-	.lo_name = "unlinked"
-};
-
-struct gfs_log_operations gfs_quota_lops = {
-	.lo_add = generic_le_add,
-	.lo_print = quota_print,
-	.lo_incore_commit = quota_incore_commit,
-	.lo_add_to_ail = quota_add_to_ail,
-	.lo_clean_dump = quota_clean_dump,
-	.lo_trans_size = quota_trans_size,
-	.lo_trans_combine = quota_trans_combine,
-	.lo_build_bhlist = quota_build_bhlist,
-	.lo_dump_size = quota_dump_size,
-	.lo_build_dump = quota_build_dump,
-	.lo_before_scan = quota_before_scan,
-	.lo_scan_elements = quota_scan_elements,
-	.lo_after_scan = quota_after_scan,
-	.lo_name = "quota"
-};
-
-struct gfs_log_operations *gfs_log_ops[] = {
-	&gfs_glock_lops,
-	&gfs_buf_lops,
-	&gfs_unlinked_lops,
-	&gfs_quota_lops,
-	NULL
-};
diff --git a/gfs-kernel/src/gfs/lops.h b/gfs-kernel/src/gfs/lops.h
deleted file mode 100644
index 2b752f1..0000000
--- a/gfs-kernel/src/gfs/lops.h
+++ /dev/null
@@ -1,166 +0,0 @@
-#ifndef __LOPS_DOT_H__
-#define __LOPS_DOT_H__
-
-extern struct gfs_log_operations gfs_glock_lops;
-extern struct gfs_log_operations gfs_buf_lops;
-extern struct gfs_log_operations gfs_unlinked_lops;
-extern struct gfs_log_operations gfs_quota_lops;
-
-extern struct gfs_log_operations *gfs_log_ops[];
-
-#define INIT_LE(le, lops) \
-do \
-{ \
-  (le)->le_ops = (lops); \
-  (le)->le_trans = NULL; \
-  INIT_LIST_HEAD(&(le)->le_list); \
-} \
-while (0)
-
-#define LO_ADD(sdp, le) \
-do \
-{ \
-  if ((le)->le_ops->lo_add) \
-    (le)->le_ops->lo_add((sdp), (le)); \
-} \
-while (0)
-
-#define LO_TRANS_END(sdp, le) \
-do \
-{ \
-  if ((le)->le_ops->lo_trans_end) \
-    (le)->le_ops->lo_trans_end((sdp), (le)); \
-} \
-while (0)
-
-#define LO_PRINT(sdp, le, where) \
-do \
-{ \
-  if ((le)->le_ops->lo_print) \
-    (le)->le_ops->lo_print((sdp), (le), (where)); \
-} \
-while (0)
-
-static __inline__ struct gfs_trans *
-LO_OVERLAP_TRANS(struct gfs_sbd *sdp, struct gfs_log_element *le)
-{
-	if (le->le_ops->lo_overlap_trans)
-		return le->le_ops->lo_overlap_trans(sdp, le);
-	else
-		return NULL;
-}
-
-#define LO_INCORE_COMMIT(sdp, tr, le) \
-do \
-{ \
-  if ((le)->le_ops->lo_incore_commit) \
-    (le)->le_ops->lo_incore_commit((sdp), (tr), (le)); \
-} \
-while (0)
-
-#define LO_ADD_TO_AIL(sdp, le) \
-do \
-{ \
-  if ((le)->le_ops->lo_add_to_ail) \
-    (le)->le_ops->lo_add_to_ail((sdp), (le)); \
-} \
-while (0)
-
-#define LO_CLEAN_DUMP(sdp, le) \
-do \
-{ \
-  if ((le)->le_ops->lo_clean_dump) \
-    (le)->le_ops->lo_clean_dump((sdp), (le)); \
-} \
-while (0)
-
-#define LO_TRANS_SIZE(sdp, tr, mblks, eblks, blocks, bmem) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_trans_size) \
-      gfs_log_ops[__lops_x]->lo_trans_size((sdp), (tr), (mblks), (eblks), (blocks), (bmem)); \
-} \
-while (0)
-
-#define LO_TRANS_COMBINE(sdp, tr, new_tr) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_trans_combine) \
-      gfs_log_ops[__lops_x]->lo_trans_combine((sdp), (tr), (new_tr)); \
-} \
-while (0)
-
-#define LO_BUILD_BHLIST(sdp, tr) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_build_bhlist) \
-      gfs_log_ops[__lops_x]->lo_build_bhlist((sdp), (tr)); \
-} \
-while (0)
-
-#define LO_DUMP_SIZE(sdp, elements, blocks, bmem) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_dump_size) \
-      gfs_log_ops[__lops_x]->lo_dump_size((sdp), (elements), (blocks), (bmem)); \
-} \
-while (0)
-
-#define LO_BUILD_DUMP(sdp, tr) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_build_dump) \
-      gfs_log_ops[__lops_x]->lo_build_dump((sdp), (tr)); \
-} \
-while (0)
-
-#define LO_BEFORE_SCAN(sdp, jid, head, pass) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_before_scan) \
-      gfs_log_ops[__lops_x]->lo_before_scan((sdp), (jid), (head), (pass)); \
-} \
-while (0)
-
-static __inline__ int
-LO_SCAN_ELEMENTS(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		 struct gfs_glock *gl, uint64_t start,
-		 struct gfs_log_descriptor *desc, unsigned int pass)
-{
-	int x;
-	int error;
-
-	for (x = 0; gfs_log_ops[x]; x++)
-		if (gfs_log_ops[x]->lo_scan_elements) {
-			error = gfs_log_ops[x]->lo_scan_elements(sdp, jdesc, gl,
-								 start, desc, pass);
-			if (error)
-				return error;
-		}
-
-	return 0;
-}
-
-#define LO_AFTER_SCAN(sdp, jid, pass) \
-do \
-{ \
-  int __lops_x; \
-  for (__lops_x = 0; gfs_log_ops[__lops_x]; __lops_x++) \
-    if (gfs_log_ops[__lops_x]->lo_after_scan) \
-      gfs_log_ops[__lops_x]->lo_after_scan((sdp), (jid), (pass)); \
-} \
-while (0)
-
-#endif /* __LOPS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/lvb.c b/gfs-kernel/src/gfs/lvb.c
deleted file mode 100644
index 8e7d75d..0000000
--- a/gfs-kernel/src/gfs/lvb.c
+++ /dev/null
@@ -1,135 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-
-#define pv(struct, member, fmt) printk("  "#member" = "fmt"\n", struct->member);
-
-#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
-#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
-#define CPIN_16(s1, s2, member) {(s1->member) = gfs16_to_cpu((s2->member));}
-#define CPOUT_16(s1, s2, member) {(s2->member) = cpu_to_gfs16((s1->member));}
-#define CPIN_32(s1, s2, member) {(s1->member) = gfs32_to_cpu((s2->member));}
-#define CPOUT_32(s1, s2, member) {(s2->member) = cpu_to_gfs32((s1->member));}
-#define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));}
-#define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));}
-
-/**
- * gfs_rgrp_lvb_in - Read in rgrp data
- * @rb: the cpu-order structure
- * @lvb: the lvb
- *
- */
-
-void
-gfs_rgrp_lvb_in(struct gfs_rgrp_lvb *rb, char *lvb)
-{
-	struct gfs_rgrp_lvb *str = (struct gfs_rgrp_lvb *)lvb;
-
-	CPIN_32(rb, str, rb_magic);
-	CPIN_32(rb, str, rb_free);
-	CPIN_32(rb, str, rb_useddi);
-	CPIN_32(rb, str, rb_freedi);
-	CPIN_32(rb, str, rb_usedmeta);
-	CPIN_32(rb, str, rb_freemeta);
-}
-
-/**
- * gfs_rgrp_lvb_out - Write out rgrp data
- * @rb: the cpu-order structure
- * @lvb: the lvb
- *
- */
-
-void
-gfs_rgrp_lvb_out(struct gfs_rgrp_lvb *rb, char *lvb)
-{
-	struct gfs_rgrp_lvb *str = (struct gfs_rgrp_lvb *)lvb;
-
-	CPOUT_32(rb, str, rb_magic);
-	CPOUT_32(rb, str, rb_free);
-	CPOUT_32(rb, str, rb_useddi);
-	CPOUT_32(rb, str, rb_freedi);
-	CPOUT_32(rb, str, rb_usedmeta);
-	CPOUT_32(rb, str, rb_freemeta);
-}
-
-/**
- * gfs_rgrp_lvb_print - Print out rgrp data
- * @rb: the cpu-order structure
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- */
-
-void
-gfs_rgrp_lvb_print(struct gfs_rgrp_lvb *rb)
-{
-	pv(rb, rb_magic, "%u");
-	pv(rb, rb_free, "%u");
-	pv(rb, rb_useddi, "%u");
-	pv(rb, rb_freedi, "%u");
-	pv(rb, rb_usedmeta, "%u");
-	pv(rb, rb_freemeta, "%u");
-}
-
-/**
- * gfs_quota_lvb_in - Read in quota data
- * @rb: the cpu-order structure
- * @lvb: the lvb
- *
- */
-
-void
-gfs_quota_lvb_in(struct gfs_quota_lvb *qb, char *lvb)
-{
-	struct gfs_quota_lvb *str = (struct gfs_quota_lvb *)lvb;
-
-	CPIN_32(qb, str, qb_magic);
-	CPIN_32(qb, str, qb_pad);
-	CPIN_64(qb, str, qb_limit);
-	CPIN_64(qb, str, qb_warn);
-	CPIN_64(qb, str, qb_value);
-}
-
-/**
- * gfs_quota_lvb_out - Write out quota data
- * @rb: the cpu-order structure
- * @lvb: the lvb
- *
- */
-
-void
-gfs_quota_lvb_out(struct gfs_quota_lvb *qb, char *lvb)
-{
-	struct gfs_quota_lvb *str = (struct gfs_quota_lvb *)lvb;
-
-	CPOUT_32(qb, str, qb_magic);
-	CPOUT_32(qb, str, qb_pad);
-	CPOUT_64(qb, str, qb_limit);
-	CPOUT_64(qb, str, qb_warn);
-	CPOUT_64(qb, str, qb_value);
-}
-
-/**
- * gfs_quota_lvb_print - Print out quota data
- * @rb: the cpu-order structure
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- */
-
-void
-gfs_quota_lvb_print(struct gfs_quota_lvb *qb)
-{
-	pv(qb, qb_magic, "%u");
-	pv(qb, qb_pad, "%u");
-	pv(qb, qb_limit, "%llu");
-	pv(qb, qb_warn, "%llu");
-	pv(qb, qb_value, "%lld");
-}
diff --git a/gfs-kernel/src/gfs/lvb.h b/gfs-kernel/src/gfs/lvb.h
deleted file mode 100644
index e729491..0000000
--- a/gfs-kernel/src/gfs/lvb.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Formats of Lock Value Blocks (LVBs) for various types of locks.
- * These 32-bit data chunks can be shared quickly between nodes
- *   via the inter-node lock manager (via LAN instead of on-disk).
- */
-
-#ifndef __LVB_DOT_H__
-#define __LVB_DOT_H__
-
-#define GFS_MIN_LVB_SIZE (32)
-
-/*
- * Resource Group block allocation statistics
- * Each resource group lock contains one of these in its LVB.
- * Used for sharing approximate current statistics for statfs.
- * Not used for actual block allocation.
- */
-struct gfs_rgrp_lvb {
-	uint32_t rb_magic;      /* GFS_MAGIC sanity check value */
-	uint32_t rb_free;       /* # free data blocks */
-	uint32_t rb_useddi;     /* # used dinode blocks */
-	uint32_t rb_freedi;     /* # free dinode blocks */
-	uint32_t rb_usedmeta;   /* # used metadata blocks */
-	uint32_t rb_freemeta;   /* # free metadata blocks */
-};
-
-/*
- * Quota
- * Each quota lock contains one of these in its LVB.
- * Keeps track of block allocation limits and current block allocation
- *   for either a cluster-wide user or a cluster-wide group.
- */
-struct gfs_quota_lvb {
-	uint32_t qb_magic;      /* GFS_MAGIC sanity check value */
-	uint32_t qb_pad;
-	uint64_t qb_limit;      /* Hard limit of # blocks to alloc */
-	uint64_t qb_warn;       /* Warn user when alloc is above this # */
-	int64_t qb_value;       /* Current # blocks allocated */
-};
-
-/*  Translation functions  */
-
-void gfs_rgrp_lvb_in(struct gfs_rgrp_lvb *rb, char *lvb);
-void gfs_rgrp_lvb_out(struct gfs_rgrp_lvb *rb, char *lvb);
-void gfs_quota_lvb_in(struct gfs_quota_lvb *qb, char *lvb);
-void gfs_quota_lvb_out(struct gfs_quota_lvb *qb, char *lvb);
-
-/*  Printing functions  */
-
-void gfs_rgrp_lvb_print(struct gfs_rgrp_lvb *rb);
-void gfs_quota_lvb_print(struct gfs_quota_lvb *qb);
-
-#endif /* __LVB_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/main.c b/gfs-kernel/src/gfs/main.c
deleted file mode 100644
index 16b520b..0000000
--- a/gfs-kernel/src/gfs/main.c
+++ /dev/null
@@ -1,134 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/proc_fs.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/time.h>
-
-#include "gfs.h"
-#include "ops_fstype.h"
-#include "sys.h"
-#include "proc.h"
-
-/**
- * init_gfs_fs - Register GFS as a filesystem
- *
- * Returns: 0 on success, error code on failure
- */
-
-int __init init_gfs_fs(void)
-{
-	int error;
-	struct timespec tv;
-
-/*	gfs2_init_lmh(); gfs2 should do this for us*/
-
-	error = gfs_sys_init();
-	if (error)
-		return error;
-	error = gfs_proc_init();
-	if (error)
-		goto fail;
-
-	getnstimeofday(&tv);
-	gfs_random_number = tv.tv_nsec;
-
-	gfs_glock_cachep = kmem_cache_create("gfs_glock", sizeof(struct gfs_glock),
-					     0, 0,
-					     NULL);
-	gfs_inode_cachep = NULL;
-	gfs_bufdata_cachep = NULL;
-	gfs_mhc_cachep = NULL;
-	error = -ENOMEM;
-	if (!gfs_glock_cachep)
-		goto fail1;
-
-	gfs_inode_cachep = kmem_cache_create("gfs_inode", sizeof(struct gfs_inode),
-					     0, 0,
-					     NULL);
-	if (!gfs_inode_cachep)
-		goto fail1;
-
-	gfs_bufdata_cachep = kmem_cache_create("gfs_bufdata", sizeof(struct gfs_bufdata),
-					       0, 0,
-					       NULL);
-	if (!gfs_bufdata_cachep)
-		goto fail1;
-
-	gfs_mhc_cachep = kmem_cache_create("gfs_meta_header_cache", sizeof(struct gfs_meta_header_cache),
-					   0, 0,
-					   NULL);
-	if (!gfs_mhc_cachep)
-		goto fail;
-
-	error = register_filesystem(&gfs_fs_type);
-	if (error)
-		goto fail;
-
-	printk("GFS %s (built %s %s) installed\n",
-	       RELEASE_VERSION, __DATE__, __TIME__);
-
-	error = init_lock_dlm();
-	if (error)
-		goto fail1;
-
-	error = init_nolock();
-	if (error)
-		goto fail1;
-
-	return 0;
-
- fail1:
-	if (gfs_mhc_cachep)
-		kmem_cache_destroy(gfs_mhc_cachep);
-
-	if (gfs_bufdata_cachep)
-		kmem_cache_destroy(gfs_bufdata_cachep);
-
-	if (gfs_inode_cachep)
-		kmem_cache_destroy(gfs_inode_cachep);
-
-	if (gfs_glock_cachep)
-		kmem_cache_destroy(gfs_glock_cachep);
-
-	gfs_proc_uninit();
-	
- fail:
-	gfs_sys_uninit();
-
-	return error;
-}
-
-/**
- * exit_gfs_fs - Unregister the file system
- *
- */
-
-void __exit
-exit_gfs_fs(void)
-{
-	exit_nolock();
-	exit_lock_dlm();
-	unregister_filesystem(&gfs_fs_type);
-
-	kmem_cache_destroy(gfs_mhc_cachep);
-	kmem_cache_destroy(gfs_bufdata_cachep);
-	kmem_cache_destroy(gfs_inode_cachep);
-	kmem_cache_destroy(gfs_glock_cachep);
-
-	gfs_proc_uninit();
-	gfs_sys_uninit();
-}
-
-MODULE_DESCRIPTION("Global File System " RELEASE_VERSION);
-MODULE_AUTHOR("Red Hat, Inc.");
-MODULE_LICENSE("GPL");
-
-module_init(init_gfs_fs);
-module_exit(exit_gfs_fs);
-
diff --git a/gfs-kernel/src/gfs/mount.c b/gfs-kernel/src/gfs/mount.c
deleted file mode 100644
index 51e40c8..0000000
--- a/gfs-kernel/src/gfs/mount.c
+++ /dev/null
@@ -1,209 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "mount.h"
-#include "proc.h"
-#include "sys.h"
-
-/**
- * gfs_make_args - Parse mount arguments
- * @data:
- * @args:
- *
- * Return: errno
- */
-
-int
-gfs_make_args(char *data_arg, struct gfs_args *args, int remount)
-{
-	char *data = data_arg;
-	char *options, *x, *y;
-	int error = 0;
-
-	/*  If someone preloaded options, use those instead  */
-
-	spin_lock(&gfs_proc_margs_lock);
-	if (!remount && gfs_proc_margs) {
-		data = gfs_proc_margs;
-		gfs_proc_margs = NULL;
-	}
-	spin_unlock(&gfs_proc_margs_lock);
-
-	/*  Set some defaults  */
-
-	memset(args, 0, sizeof(struct gfs_args));
-	args->ar_num_glockd = GFS_GLOCKD_DEFAULT;
-	args->ar_errors = GFS_ERRORS_WITHDRAW;
-
-	if (!remount) {
-		/*  If someone preloaded options, use those instead  */
-		spin_lock(&gfs_sys_margs_lock);
-		if (gfs_sys_margs) {
-			data = gfs_sys_margs;
-			gfs_sys_margs = NULL;
-		}
-		spin_unlock(&gfs_sys_margs_lock);
-		
-		/*  Set some defaults  */
-		args->ar_num_glockd = GFS_GLOCKD_DEFAULT;
-	}
-
-	/*  Split the options into tokens with the "," character and
-	    process them  */
-
-	for (options = data; (x = strsep(&options, ",")); ) {
-		if (!*x)
-			continue;
-
-		y = strchr(x, '=');
-		if (y)
-			*y++ = 0;
-
-		if (!strcmp(x, "lockproto")) {
-			if (!y) {
-				printk("GFS: need argument to lockproto\n");
-				error = -EINVAL;
-				break;
-			}
-			strncpy(args->ar_lockproto, y, GFS_LOCKNAME_LEN);
-			args->ar_lockproto[GFS_LOCKNAME_LEN - 1] = 0;
-		}
-
-		else if (!strcmp(x, "locktable")) {
-			if (!y) {
-				printk("GFS: need argument to locktable\n");
-				error = -EINVAL;
-				break;
-			}
-			strncpy(args->ar_locktable, y, GFS_LOCKNAME_LEN);
-			args->ar_locktable[GFS_LOCKNAME_LEN - 1] = 0;
-		}
-
-		else if (!strcmp(x, "hostdata")) {
-			if (!y) {
-				printk("GFS: need argument to hostdata\n");
-				error = -EINVAL;
-				break;
-			}
-			strncpy(args->ar_hostdata, y, GFS_LOCKNAME_LEN);
-			args->ar_hostdata[GFS_LOCKNAME_LEN - 1] = 0;
-		}
-
-		else if (!strcmp(x, "spectator"))
-			args->ar_spectator = TRUE;
-
-		else if (!strcmp(x, "ignore_local_fs"))
-			args->ar_ignore_local_fs = TRUE;
-
-		else if (!strcmp(x, "localflocks"))
-			args->ar_localflocks = TRUE;
-
-		else if (!strcmp(x, "localcaching"))
-			args->ar_localcaching = TRUE;
-
-		else if (!strcmp(x, "oopses_ok")) {
-			if (args->ar_errors == GFS_ERRORS_PANIC) {
-				printk("GFS: -o oopses_ok and -o errors=panic "
-				       "are mutually exclusive.\n");
-				error = -EINVAL;
-				break;
-			}
-			args->ar_oopses_ok = TRUE;
-		} else if (!strcmp(x, "debug")) {
-			if (args->ar_errors == GFS_ERRORS_PANIC) {
-				printk("GFS: -o debug and -o errors=panic "
-				       "are mutually exclusive.\n");
-				error = -EINVAL;
-				break;
-			}
-			args->ar_oopses_ok = TRUE;
-			args->ar_debug = TRUE;
-
-		} else if (!strcmp(x, "upgrade"))
-			args->ar_upgrade = TRUE;
-
-		else if (!strcmp(x, "num_glockd")) {
-			if (!y) {
-				printk("GFS: need argument to num_glockd\n");
-				error = -EINVAL;
-				break;
-			}
-			sscanf(y, "%u", &args->ar_num_glockd);
-			if (!args->ar_num_glockd || args->ar_num_glockd > GFS_GLOCKD_MAX) {
-				printk("GFS: 0 < num_glockd <= %u  (not %u)\n",
-				       GFS_GLOCKD_MAX, args->ar_num_glockd);
-				error = -EINVAL;
-				break;
-			}
-		}
-
-		else if (!strcmp(x, "acl"))
-			args->ar_posix_acls = TRUE;
-
-		else if (!strcmp(x, "noacl"))
-			args->ar_posix_acls = FALSE;
-
-		else if (!strcmp(x, "suiddir"))
-			args->ar_suiddir = TRUE;
-
-		else if (!strcmp(x, "noquota"))
-			args->ar_noquota = TRUE;
-
-		else if (!strcmp(x, "gfs_noatime"))
-			args->ar_noatime = TRUE;
-
-		else if (!strcmp(x, "errors")) {
-			if (!y) {
-				printk("GFS: need argument to errors\n");
-				error = -EINVAL;
-				break;
-			}
-			if (!strcmp(y, "withdraw"))
-				args->ar_errors = GFS_ERRORS_WITHDRAW;
-			else if (!strcmp(y, "panic")) {
-				if (args->ar_debug) {
-					printk("GFS: -o debug and -o errors="
-					       "panic are mutually "
-					       "exclusive.\n");
-					error = -EINVAL;
-					break;
-				} else if (args->ar_oopses_ok) {
-					printk("GFS: -o oopses_ok and -o "
-					       "errors=panic are mutually "
-					       "exclusive.\n");
-					error = -EINVAL;
-					break;
-				}
-				args->ar_errors = GFS_ERRORS_PANIC;
-			} else {
-				printk("GFS: errors= must be either withdraw "
-				       "or panic.\n");
-				error = -EINVAL;
-				break;
-			}
-		}
-
-		/*  Unknown  */
-
-		else {
-			printk("GFS: unknown option: %s\n", x);
-			error = -EINVAL;
-			break;
-		}
-	}
-
-	if (error)
-		printk("GFS: invalid mount option(s)\n");
-
-	if (data != data_arg)
-		kfree(data);
-
-	return error;
-}
-
diff --git a/gfs-kernel/src/gfs/mount.h b/gfs-kernel/src/gfs/mount.h
deleted file mode 100644
index d3d09c9..0000000
--- a/gfs-kernel/src/gfs/mount.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __MOUNT_DOT_H__
-#define __MOUNT_DOT_H__
-
-int gfs_make_args(char *data, struct gfs_args *args, int remount);
-
-#endif /* __MOUNT_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ondisk.c b/gfs-kernel/src/gfs/ondisk.c
deleted file mode 100644
index 1d169eb..0000000
--- a/gfs-kernel/src/gfs/ondisk.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-
-#define pv(struct, member, fmt) printk("  "#member" = "fmt"\n", struct->member);
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
-
diff --git a/gfs-kernel/src/gfs/ops_address.c b/gfs-kernel/src/gfs/ops_address.c
deleted file mode 100644
index 5e55477..0000000
--- a/gfs-kernel/src/gfs/ops_address.c
+++ /dev/null
@@ -1,504 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/pagemap.h>
-
-#include "gfs.h"
-#include "bmap.h"
-#include "dio.h"
-#include "file.h"
-#include "glock.h"
-#include "inode.h"
-#include "ops_address.h"
-#include "page.h"
-#include "quota.h"
-#include "trans.h"
-
-static int
-gfs_write_end(struct file *file, struct address_space *mapping,
-	      loff_t pos, unsigned len, unsigned copied,
-	      struct page *page, void *fsdata);
-
-/**
- * get_block - Fills in a buffer head with details about a block
- * @inode: The inode
- * @lblock: The block number to look up
- * @bh_result: The buffer head to return the result in
- * @create: Non-zero if we may add block to the file
- *
- * Returns: errno
- */
-
-static int
-get_block(struct inode *inode, sector_t lblock, 
-	  struct buffer_head *bh_result, int create)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-	int new = create;
-	uint64_t dblock;
-	int error;
-
-	error = gfs_block_map(ip, lblock, &new, &dblock, NULL);
-	if (error)
-		return error;
-
-	if (!dblock)
-		return 0;
-
-	map_bh(bh_result, inode->i_sb, dblock);
-	if (new)
-		set_buffer_new(bh_result);
-
-	return 0;
-}
-
-/**
- * get_block_noalloc - Fills in a buffer head with details about a block
- * @inode: The inode
- * @lblock: The block number to look up
- * @bh_result: The buffer head to return the result in
- * @create: Non-zero if we may add block to the file
- *
- * Returns: errno
- */
-
-static int
-get_block_noalloc(struct inode *inode, sector_t lblock,
-		  struct buffer_head *bh_result, int create)
-{
-	int error;
-
-	error = get_block(inode, lblock, bh_result, FALSE);
-	if (error)
-		return error;
-
-	if (gfs_assert_withdraw(get_v2sdp(inode->i_sb),
-				!create || buffer_mapped(bh_result)))
-		return -EIO;
-
-	return 0;
-}
-
-/**
- * get_blocks - 
- * @inode:
- * @lblock:
- * @max_blocks:
- * @bh_result:
- * @create:
- *
- * Returns: errno
- */
-
-static int
-get_blocks(struct inode *inode, sector_t lblock,
-		   struct buffer_head *bh_result, int create)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-	int new = create;
-	uint64_t dblock;
-	int error;
-
-	error = gfs_block_map(ip, lblock, &new, &dblock, NULL);
-	if (error)
-		return error;
-
-	if (!dblock)
-		return 0;
-
-	map_bh(bh_result, inode->i_sb, dblock);
-	if (new)
-		set_buffer_new(bh_result);
-
-	return 0;
-}
-
-/**
- * get_blocks_noalloc - 
- * @inode:
- * @lblock:
- * @max_blocks:
- * @bh_result:
- * @create:
- *
- * Returns: errno
- */
-
-static int
-get_blocks_noalloc(struct inode *inode, sector_t lblock,
-		   struct buffer_head *bh_result, int create)
-{
-	int error;
-
-	error = get_blocks(inode, lblock, bh_result, FALSE);
-	if (error)
-		return error;
-
-	if (gfs_assert_withdraw(get_v2sdp(inode->i_sb),
-							!create || buffer_mapped(bh_result)))
-		return -EIO;
-
-	return 0;
-}
-
-/**
- * gfs_writepage - Write complete page
- * @page: Page to write
- *
- * Returns: errno
- *
- * Use Linux VFS block_write_full_page() to write one page,
- *   using GFS's get_block_noalloc to find which blocks to write.
- */
-
-static int
-gfs_writepage(struct page *page, struct writeback_control *wbc)
-{
-	struct gfs_inode *ip = get_v2ip(page->mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_address);
-
-	if (gfs_assert_withdraw(sdp, gfs_glock_is_held_excl(ip->i_gl))) {
-		unlock_page(page);
-		return -EIO;
-	}
-	if (get_transaction) {
-		redirty_page_for_writepage(wbc, page);
-		unlock_page(page);
-		return 0;
-	}
-
-	error = block_write_full_page(page, get_block_noalloc, wbc);
-
-	gfs_flush_meta_cache(ip);
-
-	return error;
-}
-
-/**
- * stuffed_readpage - Fill in a Linux page with stuffed file data
- * @ip: the inode
- * @page: the page
- *
- * Returns: errno
- */
-
-static int
-stuffed_readpage(struct gfs_inode *ip, struct page *page)
-{
-	struct buffer_head *dibh;
-	void *kaddr;
-	int error;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (!error) {
-		kaddr = kmap(page);
-		memcpy((char *)kaddr,
-		       dibh->b_data + sizeof(struct gfs_dinode),
-		       ip->i_di.di_size);
-		memset((char *)kaddr + ip->i_di.di_size,
-		       0,
-		       PAGE_CACHE_SIZE - ip->i_di.di_size);
-		kunmap(page);
-
-		brelse(dibh);
-
-		SetPageUptodate(page);
-	}
-
-	return error;
-}
-
-/**
- * readi_readpage - readpage that goes through gfs_internal_read()
- * @page: The page to read
- *
- * Returns: errno
- */
-
-static int
-readi_readpage(struct page *page)
-{
-	struct gfs_inode *ip = get_v2ip(page->mapping->host);
-	void *kaddr;
-	int ret;
-
-	kaddr = kmap(page);
-
-	ret = gfs_internal_read(ip, kaddr,
-				(uint64_t)page->index << PAGE_CACHE_SHIFT,
-				PAGE_CACHE_SIZE);
-	if (ret >= 0) {
-		if (ret < PAGE_CACHE_SIZE)
-			memset(kaddr + ret, 0, PAGE_CACHE_SIZE - ret);
-		SetPageUptodate(page);
-		ret = 0;
-	}
-
-	kunmap(page);
-
-	unlock_page(page);
-
-	return ret;
-}
-
-/**
- * gfs_readpage - readpage with locking
- * @file: The file to read a page for
- * @page: The page to read
- *
- * Returns: errno
- */
-
-static int
-gfs_readpage(struct file *file, struct page *page)
-{
-	struct gfs_inode *ip = get_v2ip(page->mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_address);
-
-	if (!gfs_glock_is_locked_by_me(ip->i_gl)) {
-		unlock_page(page);
-		return -ENOSYS;
-	}
-
-	if (!gfs_is_jdata(ip)) {
-		if (gfs_is_stuffed(ip) && !page->index) {
-			error = stuffed_readpage(ip, page);
-			unlock_page(page);
-		} else
-			error = block_read_full_page(page, get_block);
-	} else
-		error = readi_readpage(page);
-
-	if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-		error = -EIO;
-
-	return error;
-}
-
-/**
- * gfs_write_begin - Begin to write to a file
- * @file: The file to write to
- * @mapping: The mapping in which to write
- * @pos: The file offset at which to start writing
- * @len: Length of the write
- * @flags: Various flags
- * @pagep: Pointer to return the page
- * @fsdata: Pointer to return fs data (unused by GFS)
- *
- * Returns: errno
- *
- * Make sure file's inode is glocked; we shouldn't write without that!
- * If GFS dinode is currently stuffed (small enough that all data fits within
- *   the dinode block), and new file size is too large, unstuff it.
- * Use Linux VFS block_prepare_write() to write blocks, using GFS' get_block()
- *   to find which blocks to write.
- */
-
-static int
-gfs_write_begin(struct file *file, struct address_space *mapping,
-		loff_t pos, unsigned len, unsigned flags,
-		struct page **pagep, void **fsdata)
-{
-	struct gfs_inode *ip = get_v2ip(mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	int error = 0;
-	pgoff_t index = pos >> PAGE_CACHE_SHIFT;
-	unsigned from = pos & (PAGE_CACHE_SIZE - 1);
-	unsigned to = from + len;
-	struct page *page;
-
-	atomic_inc(&sdp->sd_ops_address);
-
-	/* We can't set write_end in the structure in the declare         */
-	/* because if we do, loopback (loop.c) will interpret that to mean   */
-	/* it's okay to do buffered writes without locking through sendfile. */
-	/* This is a kludge to get around the problem with loop.c because    */
-	/* the upstream community rejected my changes to loop.c.             */
-	ip->gfs_file_aops.write_end = gfs_write_end;
-
-	if (gfs_assert_warn(sdp, gfs_glock_is_locked_by_me(ip->i_gl)))
-		return -ENOSYS;
-
-	error = -ENOMEM;
-	page = grab_cache_page_write_begin(mapping, index, flags);
-	*pagep = page;
-	if (!page)
-		goto out;
-
-	if (gfs_is_stuffed(ip)) {
-		if (pos + len > sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode)) {
-			error = gfs_unstuff_dinode(ip, gfs_unstuffer_page, page);
-			if (!error)
-				error = block_prepare_write(page, from, to, get_block);
-		} else if (!PageUptodate(page))
-			error = stuffed_readpage(ip, page);
-	} else
-		error = block_prepare_write(page, from, to, get_block);
-
-	if (error)
-		page_cache_release(page);
-
-out:
-	return error;
-}
-
-/**
- * gfs_write_end
- * @file: The file to write to
- * @mapping: The address space to write to
- * @pos: The file position
- * @len: The length of the data
- * @copied:
- * @page: The page that has been written
- * @fsdata: The fsdata (unused in GFS)
- * 
- * The main write_end function for GFS. We have a separate one for
- * stuffed files as they are slightly different, otherwise we just
- * put our locking around the VFS provided functions
- *
- * Returns: errno
- */
-
-static int
-gfs_write_end(struct file *file, struct address_space *mapping,
-	      loff_t pos, unsigned len, unsigned copied,
-	      struct page *page, void *fsdata)
-{
-	struct inode *inode = page->mapping->host;
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	int ret;
-
-	atomic_inc(&sdp->sd_ops_address);
-	BUG_ON(gfs_glock_is_locked_by_me(ip->i_gl) == 0);
-
-	if (gfs_is_stuffed(ip)) {
-		struct buffer_head *dibh;
-		u64 to = pos + copied;
-		void *kaddr;
-		unsigned char *buf;
-
-		ret = gfs_get_inode_buffer(ip, &dibh);
-		if (ret)
-			goto fail;
-		buf = dibh->b_data + sizeof(struct gfs_dinode);
-		BUG_ON((pos + len) > (dibh->b_size - sizeof(struct gfs_dinode)));
-
-		kaddr = kmap(page);
-		memcpy(buf + pos, kaddr + pos, copied);
-		memset(kaddr + pos + copied, 0, len - copied);
-		flush_dcache_page(page);
-		kunmap(page);
-
-		brelse(dibh);
-		if (!PageUptodate(page))
-			SetPageUptodate(page);
-		unlock_page(page);
-		page_cache_release(page);
-
-		if (inode->i_size < to)
-			i_size_write(inode, to);
-	} else {
-		ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata);
-	}
-
-	ip->gfs_file_aops.write_end = NULL;
-	return ret;
-
-fail:
-	ClearPageUptodate(page);
-	unlock_page(page);
-	page_cache_release(page);
-	return ret;
-}
-
-/**
- * gfs_bmap - Block map function
- * @mapping: Address space info
- * @lblock: The block to map
- *
- * Returns: The disk address for the block or 0 on hole or error
- */
-
-static sector_t
-gfs_bmap(struct address_space *mapping, sector_t lblock)
-{
-	struct gfs_inode *ip = get_v2ip(mapping->host);
-	struct gfs_holder i_gh;
-	int dblock = 0;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_address);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-	if (error)
-		return 0;
-
-	if (!gfs_is_stuffed(ip))
-		dblock = generic_block_bmap(mapping, lblock, get_block);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return dblock;
-}
-
-/**
- * gfs_direct_IO - 
- * @rw:
- * @iocb:
- * @iov:
- * @offset:
- * @nr_segs:
- *
- * Returns: errno
- */
-
-static ssize_t
-gfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
-	      loff_t offset, unsigned long nr_segs)
-{
-	struct file *file = iocb->ki_filp;
-	struct inode *inode = file->f_mapping->host;
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	get_block_t *gb = get_blocks;
-
-	atomic_inc(&sdp->sd_ops_address);
-
-	if (gfs_assert_warn(sdp, gfs_glock_is_locked_by_me(ip->i_gl)) ||
-	    gfs_assert_warn(sdp, !gfs_is_stuffed(ip)))
-		return -EINVAL;
-
-	if (rw == WRITE && !get_transaction)
-		gb = get_blocks_noalloc;
-
-	if (rw == WRITE)
-		return blockdev_direct_IO(rw, iocb, inode,
-				  inode->i_sb->s_bdev, iov,
-				  offset, nr_segs, gb, NULL);
-	else
-		return blockdev_direct_IO_no_locking(rw, iocb, inode,
-				  inode->i_sb->s_bdev, iov,
-				  offset, nr_segs, gb, NULL);
-
-}
-
-struct address_space_operations gfs_file_aops = {
-	.writepage = gfs_writepage,
-	.readpage = gfs_readpage,
-	.sync_page = block_sync_page,
-	.write_begin = gfs_write_begin,
-	.bmap = gfs_bmap,
-	.direct_IO = gfs_direct_IO,
-};
diff --git a/gfs-kernel/src/gfs/ops_address.h b/gfs-kernel/src/gfs/ops_address.h
deleted file mode 100644
index f847a7a..0000000
--- a/gfs-kernel/src/gfs/ops_address.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __OPS_ADDRESS_DOT_H__
-#define __OPS_ADDRESS_DOT_H__
-
-extern struct address_space_operations gfs_file_aops;
-
-#endif /* __OPS_ADDRESS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_dentry.c b/gfs-kernel/src/gfs/ops_dentry.c
deleted file mode 100644
index 48efd34..0000000
--- a/gfs-kernel/src/gfs/ops_dentry.c
+++ /dev/null
@@ -1,111 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "dir.h"
-#include "glock.h"
-#include "ops_dentry.h"
-
-/**
- * gfs_drevalidate - Check directory lookup consistency
- * @dentry: the mapping to check
- * @nd:
- *
- * Check to make sure the lookup necessary to arrive at this inode from its
- * parent is still good.
- *
- * Returns: 1 if the dentry is ok, 0 if it isn't
- */
-
-static int
-gfs_drevalidate(struct dentry *dentry, struct nameidata *nd)
-{
-	struct dentry *parent = dget_parent(dentry);
-	struct gfs_inode *dip = get_v2ip(parent->d_inode);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct inode *inode;
-	struct gfs_holder d_gh;
-	struct gfs_inode *ip;
-	struct gfs_inum inum;
-	unsigned int type;
-	int error;
-
-	lock_kernel();
-
-	atomic_inc(&sdp->sd_ops_dentry);
-
-	if (sdp->sd_args.ar_localcaching)
-		goto valid;
-
-	inode = dentry->d_inode;
-	if (inode && is_bad_inode(inode))
-		goto invalid;
-
-	error = gfs_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh);
-	if (error)
-		goto fail;
-
-	error = gfs_dir_search(dip, &dentry->d_name, &inum, &type);
-	switch (error) {
-	case 0:
-		if (!inode)
-			goto invalid_gunlock;
-		break;
-	case -ENOENT:
-		if (!inode)
-			goto valid_gunlock;
-		goto invalid_gunlock;
-	default:
-		goto fail_gunlock;
-	}
-
-	ip = get_v2ip(inode);
-
-	if (ip->i_num.no_formal_ino != inum.no_formal_ino)
-		goto invalid_gunlock;
-
-	if (ip->i_di.di_type != type) {
-		gfs_consist_inode(dip);
-		goto fail_gunlock;
-	}
-
- valid_gunlock:
-	gfs_glock_dq_uninit(&d_gh);
-
- valid:
-	unlock_kernel();
-	dput(parent);
-	return 1;
-
- invalid_gunlock:
-	gfs_glock_dq_uninit(&d_gh);
-
- invalid:
-	if (inode && S_ISDIR(inode->i_mode)) {
-		if (have_submounts(dentry))
-			goto valid;
-		shrink_dcache_parent(dentry);
-	}
-	d_drop(dentry);
-
-	unlock_kernel();
-	dput(parent);
-	return 0;
-
- fail_gunlock:
-	gfs_glock_dq_uninit(&d_gh);
-
- fail:
-	unlock_kernel();
-	dput(parent);
-	return 0;
-}
-
-struct dentry_operations gfs_dops = {
-	.d_revalidate = gfs_drevalidate,
-};
diff --git a/gfs-kernel/src/gfs/ops_dentry.h b/gfs-kernel/src/gfs/ops_dentry.h
deleted file mode 100644
index a6e7a75..0000000
--- a/gfs-kernel/src/gfs/ops_dentry.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __OPS_DENTRY_DOT_H__
-#define __OPS_DENTRY_DOT_H__
-
-extern struct dentry_operations gfs_dops;
-
-#endif /* __OPS_DENTRY_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_export.c b/gfs-kernel/src/gfs/ops_export.c
deleted file mode 100644
index ca5e648..0000000
--- a/gfs-kernel/src/gfs/ops_export.c
+++ /dev/null
@@ -1,395 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/exportfs.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "dir.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "ops_dentry.h"
-#include "ops_export.h"
-#include "rgrp.h"
-
-struct inode_cookie
-{
-	uint64_t formal_ino;
-	uint32_t gen;
-	int gen_valid;
-};
-
-struct get_name_filldir
-{
-	uint64_t formal_ino;
-	char *name;
-};
-
-/**
- * gfs_encode_fh -
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-int 
-gfs_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
-	      int connectable)
-{
-	struct inode *inode = dentry->d_inode;
-	struct gfs_inode *ip = get_v2ip(inode);
-	int maxlen = *len;
-
-	atomic_inc(&ip->i_sbd->sd_ops_export);
-
-	if (maxlen < 3)
-		return 255;
-
-	fh[0] = cpu_to_gfs32((uint32_t)(ip->i_num.no_formal_ino >> 32));
-	fh[1] = cpu_to_gfs32((uint32_t)(ip->i_num.no_formal_ino & 0xFFFFFFFF));
-	fh[2] = cpu_to_gfs32(inode->i_generation);  /* dinode's mh_incarn */
-	*len = 3;
-
-	if (maxlen < 5 || !connectable)
-		return 3;
-
-	spin_lock(&dentry->d_lock);
-
-	inode = dentry->d_parent->d_inode;
-	ip = get_v2ip(inode);
-
-	fh[3] = cpu_to_gfs32((uint32_t)(ip->i_num.no_formal_ino >> 32));
-	fh[4] = cpu_to_gfs32((uint32_t)(ip->i_num.no_formal_ino & 0xFFFFFFFF));
-	*len = 5;
-
-	if (maxlen < 6) {
-		spin_unlock(&dentry->d_lock);
-		return 5;
-	}
-
-	fh[5] = cpu_to_gfs32(inode->i_generation);  /* dinode's mh_incarn */
-
-	spin_unlock(&dentry->d_lock);
-
-	*len = 6;
-
-	return 6;
-}
-
-/**
- * get_name_filldir - 
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-static int
-get_name_filldir(void *opaque,
-		 const char *name, unsigned int length,
-		 uint64_t offset,
-		 struct gfs_inum *inum, unsigned int type)
-{
-	struct get_name_filldir *gnfd = (struct get_name_filldir *)opaque;
-
-	if (inum->no_formal_ino != gnfd->formal_ino)
-		return 0;
-
-	memcpy(gnfd->name, name, length);
-	gnfd->name[length] = 0;
-
-	return 1;
-}
-
-/**
- * gfs_get_name -
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-int gfs_get_name(struct dentry *parent, char *name,
-		 struct dentry *child)
-{
-	struct inode *dir = parent->d_inode;
-	struct inode *inode = child->d_inode;
-	struct gfs_inode *dip, *ip;
-	struct get_name_filldir gnfd;
-	struct gfs_holder gh;
-	uint64_t offset = 0;
-	int error;
-
-	if (!dir)
-		return -EINVAL;
-
-	atomic_inc(&get_v2sdp(dir->i_sb)->sd_ops_export);
-
-	if (!S_ISDIR(dir->i_mode) || !inode)
-		return -EINVAL;
-
-	dip = get_v2ip(dir);
-	ip = get_v2ip(inode);
-
-	*name = 0;
-	gnfd.formal_ino = ip->i_num.no_formal_ino;
-	gnfd.name = name;
-
-	error = gfs_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &gh);
-	if (error)
-		return error;
-
-	error = gfs_dir_read(dip, &offset, &gnfd, get_name_filldir);
-
-	gfs_glock_dq_uninit(&gh);
-
-	if (!error & !*name)
-		error = -ENOENT;
-
-	return error;
-}
-
-/**
- * gfs_get_parent -
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-struct dentry *
-gfs_get_parent(struct dentry *child)
-{
-	struct gfs_inode *dip = get_v2ip(child->d_inode);
-	struct gfs_holder d_gh, i_gh;
-	struct qstr dotdot = { .name = "..", .len = 2 };
-	struct gfs_inode *ip;
-	struct inode *inode;
-	struct dentry *dentry;
-	int error;
-
-	atomic_inc(&dip->i_sbd->sd_ops_export);
-
-	gfs_holder_init(dip->i_gl, 0, 0, &d_gh);
-	error = gfs_lookupi(&d_gh, &dotdot, TRUE, &i_gh);
-	if (error)
-		goto fail;
-
-	error = -ENOENT;
-	if (!i_gh.gh_gl)
-		goto fail;
-
-	ip = get_gl2ip(i_gh.gh_gl);
-
-	inode = gfs_iget(ip, CREATE);
-	gfs_inode_put(ip);
-
-	gfs_glock_dq_uninit(&d_gh);
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (!inode)
-		return ERR_PTR(-ENOMEM);
-
-	dentry = d_obtain_alias(inode);
-	if (!IS_ERR(dentry))
-		dentry->d_op = &gfs_dops;
-	return dentry;
-
- fail:
-	gfs_holder_uninit(&d_gh);
-	return ERR_PTR(error);
-}
-
-/**
- * gfs_get_dentry -
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-struct dentry *
-gfs_get_dentry(struct super_block *sb, struct inode_cookie *cookie)
-{
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-	struct gfs_inum inum;
-	struct gfs_holder i_gh, ri_gh, rgd_gh;
-	struct gfs_rgrpd *rgd;
-	struct buffer_head *bh;
-	struct gfs_dinode *di;
-	struct gfs_inode *ip;
-	struct inode *inode;
-	struct dentry *dentry;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_export);
-
-	if (!cookie->formal_ino ||
-	    cookie->formal_ino == sdp->sd_jiinode->i_num.no_formal_ino ||
-	    cookie->formal_ino == sdp->sd_riinode->i_num.no_formal_ino ||
-	    cookie->formal_ino == sdp->sd_qinode->i_num.no_formal_ino)
-		return ERR_PTR(-EINVAL);
-
-	inum.no_formal_ino = cookie->formal_ino;
-	inum.no_addr = cookie->formal_ino;
-
-	error = gfs_glock_nq_num(sdp,
-				 inum.no_formal_ino, &gfs_inode_glops,
-				 LM_ST_SHARED, LM_FLAG_ANY | GL_LOCAL_EXCL,
-				 &i_gh);
-	if (error)
-		return ERR_PTR(error);
-
-	error = gfs_inode_get(i_gh.gh_gl, &inum, NO_CREATE, &ip);
-	if (error)
-		goto fail;
-	if (ip)
-		goto out;
-
-	error = gfs_rindex_hold(sdp, &ri_gh);
-	if (error)
-		goto fail;
-
-	error = -EINVAL;
-	rgd = gfs_blk2rgrpd(sdp, inum.no_addr);
-	if (!rgd)
-		goto fail_rindex;
-
-	error = gfs_glock_nq_init(rgd->rd_gl, LM_ST_SHARED, 0, &rgd_gh);
-	if (error)
-		goto fail_rindex;
-
-	error = -ESTALE;
-	if (gfs_get_block_type(rgd, inum.no_addr) != GFS_BLKST_USEDMETA)
-		goto fail_rgd;
-
-	error = gfs_dread(i_gh.gh_gl, inum.no_addr,
-			  DIO_START | DIO_WAIT, &bh);
-	if (error)
-		goto fail_rgd;
-
-	di = (struct gfs_dinode *)bh->b_data;
-
-	error = -ESTALE;
-	if (gfs32_to_cpu(di->di_header.mh_magic) != GFS_MAGIC ||
-	    gfs32_to_cpu(di->di_header.mh_type) != GFS_METATYPE_DI ||
-	    (gfs32_to_cpu(di->di_flags) & GFS_DIF_UNUSED))
-		goto fail_relse;
-
-	brelse(bh);
-	gfs_glock_dq_uninit(&rgd_gh);
-	gfs_glock_dq_uninit(&ri_gh);
-
-	error = gfs_inode_get(i_gh.gh_gl, &inum, CREATE, &ip);
-	if (error)
-		goto fail;
-
-	atomic_inc(&sdp->sd_fh2dentry_misses);
-
- out:
-	inode = gfs_iget(ip, CREATE);
-	gfs_inode_put(ip);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (!inode)
-		return ERR_PTR(-ENOMEM);
-
-	/* inode->i_generation is GFS dinode's mh_incarn value */
-	if (cookie->gen_valid && cookie->gen != inode->i_generation) {
-		iput(inode);
-		return ERR_PTR(-ESTALE);
-	}
-
-	dentry = d_obtain_alias(inode);
-	if (!IS_ERR(dentry))
-		dentry->d_op = &gfs_dops;
-	return dentry;
-
- fail_relse:
-        brelse(bh);
-
- fail_rgd:
-	gfs_glock_dq_uninit(&rgd_gh);
-
- fail_rindex:
-	gfs_glock_dq_uninit(&ri_gh);
-
- fail:
-	gfs_glock_dq_uninit(&i_gh);
-	return ERR_PTR(error);
-}
-
-static struct dentry *gfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
-		int fh_len, int fh_type)
-{
-	struct inode_cookie this;
-	__u32 *fh = fid->raw;
-
-	atomic_inc(&get_v2sdp(sb)->sd_ops_export);
-
-	switch (fh_type) {
-	case 6:
-	case 5:
-	case 3:
-		this.gen_valid = TRUE;
-		this.gen = gfs32_to_cpu(fh[2]);
-		this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32;
-		this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]);
-		return gfs_get_dentry(sb, &this);
-	default:
-		return NULL;
-	}
-}
-
-static struct dentry *gfs_fh_to_parent(struct super_block *sb, struct fid *fid,
-		int fh_len, int fh_type)
-{
-	struct inode_cookie parent;
-	__u32 *fh = fid->raw;
-
-	atomic_inc(&get_v2sdp(sb)->sd_ops_export);
-
-	switch (fh_type) {
-	case 6:
-		parent.gen_valid = TRUE;
-		parent.gen = gfs32_to_cpu(fh[5]);
-	case 5:
-		parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32;
-		parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]);
-	default:
-		return NULL;
-	}
-
-	return gfs_get_dentry(sb, &parent);
-}
-
-const struct export_operations gfs_export_ops = {
-	.encode_fh = gfs_encode_fh,
-	.fh_to_dentry = gfs_fh_to_dentry,
-	.fh_to_parent = gfs_fh_to_parent,
-	.get_name = gfs_get_name,
-	.get_parent = gfs_get_parent,
-};
-
diff --git a/gfs-kernel/src/gfs/ops_export.h b/gfs-kernel/src/gfs/ops_export.h
deleted file mode 100644
index 778ca9e..0000000
--- a/gfs-kernel/src/gfs/ops_export.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __OPS_EXPORT_DOT_H__
-#define __OPS_EXPORT_DOT_H__
-
-extern const struct export_operations gfs_export_ops;
-
-#endif /* __OPS_EXPORT_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c
deleted file mode 100644
index e675772..0000000
--- a/gfs-kernel/src/gfs/ops_file.c
+++ /dev/null
@@ -1,1913 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-#include <linux/pagemap.h>
-#include <linux/uio.h>
-#include <linux/blkdev.h>
-#include <linux/mm.h>
-#include <linux/aio.h>
-#include <linux/writeback.h>
-#include <asm/uaccess.h>
-#include <linux/compat.h>
-
-#include "gfs_ioctl.h"
-#include "gfs.h"
-#include "bmap.h"
-#include "dio.h"
-#include "dir.h"
-#include "file.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "ioctl.h"
-#include "lm.h"
-#include "log.h"
-#include "ops_file.h"
-#include "ops_vm.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-
-/* "bad" is for NFS support */
-struct filldir_bad_entry {
-	char *fbe_name;
-	unsigned int fbe_length;
-	uint64_t fbe_offset;
-	struct gfs_inum fbe_inum;
-	unsigned int fbe_type;
-};
-
-struct filldir_bad {
-	struct gfs_sbd *fdb_sbd;
-
-	struct filldir_bad_entry *fdb_entry;
-	unsigned int fdb_entry_num;
-	unsigned int fdb_entry_off;
-
-	char *fdb_name;
-	unsigned int fdb_name_size;
-	unsigned int fdb_name_off;
-};
-
-/* For regular, non-NFS */
-struct filldir_reg {
-	struct gfs_sbd *fdr_sbd;
-	int fdr_prefetch;
-
-	filldir_t fdr_filldir;
-	void *fdr_opaque;
-};
-
-typedef ssize_t(*do_rw_t) (struct file * file,
-			   char *buf,
-			   size_t size, loff_t * offset,
-                           struct kiocb *iocb,
-			   unsigned int num_gh, struct gfs_holder * ghs);
-
-/**
- * gfs_llseek - seek to a location in a file
- * @file: the file
- * @offset: the offset
- * @origin: Where to seek from (SEEK_SET, SEEK_CUR, or SEEK_END)
- *
- * SEEK_END requires the glock for the file because it references the
- * file's size.
- *
- * Returns: The new offset, or errno
- */
-
-static loff_t
-gfs_llseek(struct file *file, loff_t offset, int origin)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_holder i_gh;
-	loff_t error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	if (origin == 2) {
-		error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-		if (!error) {
-			error = generic_file_llseek_unlocked(file, offset, origin);
-			gfs_glock_dq_uninit(&i_gh);
-		}
-	} else
-		error = generic_file_llseek_unlocked(file, offset, origin);
-
-	return error;
-}
-
-#define vma2state(vma) \
-((((vma)->vm_flags & (VM_MAYWRITE | VM_MAYSHARE)) == \
- (VM_MAYWRITE | VM_MAYSHARE)) ? \
- LM_ST_EXCLUSIVE : LM_ST_SHARED) \
-
-/**
- * functionname - summary
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-static ssize_t
-walk_vm_hard(struct file *file, char *buf, size_t size, loff_t *offset,
-             struct kiocb *iocb, do_rw_t operation)
-{
-	struct gfs_holder *ghs;
-	unsigned int num_gh = 0;
-	ssize_t count;
-
-	{
-		struct super_block *sb = file->f_dentry->d_inode->i_sb;
-		struct mm_struct *mm = current->mm;
-		struct vm_area_struct *vma;
-		unsigned long start = (unsigned long)buf;
-		unsigned long end = start + size;
-		int dumping = (current->flags & PF_DUMPCORE);
-		unsigned int x = 0;
-
-		for (vma = find_vma(mm, start); vma; vma = vma->vm_next) {
-			if (end <= vma->vm_start)
-				break;
-			if (vma->vm_file &&
-			    vma->vm_file->f_dentry->d_inode->i_sb == sb) {
-				num_gh++;
-			}
-		}
-
-		ghs = kmalloc((num_gh + 1) * sizeof(struct gfs_holder), GFP_KERNEL);
-		if (!ghs) {
-			if (!dumping)
-				up_read(&mm->mmap_sem);
-			return -ENOMEM;
-		}
-
-		for (vma = find_vma(mm, start); vma; vma = vma->vm_next) {
-			if (end <= vma->vm_start)
-				break;
-			if (vma->vm_file) {
-				struct inode *inode = vma->vm_file->f_dentry->d_inode;
-				if (inode->i_sb == sb)
-					gfs_holder_init(get_v2ip(inode)->i_gl,
-							vma2state(vma),
-							0, &ghs[x++]);
-			}
-		}
-
-		if (!dumping)
-			up_read(&mm->mmap_sem);
-
-		gfs_assert(get_v2sdp(sb), x == num_gh,);
-	}
-
-	count = operation(file, buf, size, offset, iocb, num_gh, ghs);
-
-	while (num_gh--)
-		gfs_holder_uninit(&ghs[num_gh]);
-	kfree(ghs);
-
-	return count;
-}
-
-/**
- * walk_vm - Walk the vmas associated with a buffer for read or write.
- *    If any of them are gfs, pass the gfs inode down to the read/write
- *    worker function so that locks can be acquired in the correct order.
- * @file: The file to read/write from/to
- * @buf: The buffer to copy to/from
- * @size: The amount of data requested
- * @offset: The current file offset
- * @operation: The read or write worker function
- *
- * Outputs: Offset - updated according to number of bytes written
- *
- * Returns: The number of bytes written, errno on failure
- */
-
-static ssize_t
-walk_vm(struct file *file, char *buf, size_t size, loff_t *offset,
-	struct kiocb *iocb,	
-	do_rw_t operation)
-{
-	if (current->mm) {
-		struct super_block *sb = file->f_dentry->d_inode->i_sb;
-		struct mm_struct *mm = current->mm;
-		struct vm_area_struct *vma;
-		unsigned long start = (unsigned long)buf;
-		unsigned long end = start + size;
-		int dumping = (current->flags & PF_DUMPCORE);
-
-		if (!dumping)
-			down_read(&mm->mmap_sem);
-
-		for (vma = find_vma(mm, start); vma; vma = vma->vm_next) {
-			if (end <= vma->vm_start)
-				break;
-			if (vma->vm_file &&
-			    vma->vm_file->f_dentry->d_inode->i_sb == sb)
-				goto do_locks;
-		}
-
-		if (!dumping)
-			up_read(&mm->mmap_sem);
-	}
-
-	{
-		struct gfs_holder gh;
-		return operation(file, buf, size, offset, iocb, 0, &gh);
-	}
-
- do_locks:
-	return walk_vm_hard(file, buf, size, offset, iocb, operation);
-}
-
-/**
- * functionname - summary
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-static ssize_t
-do_read_readi(struct file *file, char *buf, size_t size, loff_t *offset,
-              struct kiocb *iocb)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	ssize_t count = 0;
-
-	if (*offset < 0)
-		return -EINVAL;
-	if (!access_ok(VERIFY_WRITE, buf, size))
-		return -EFAULT;
-
-	if (!(file->f_flags & O_LARGEFILE)) {
-		if (*offset >= 0x7FFFFFFFull)
-			return -EFBIG;
-		if (*offset + size > 0x7FFFFFFFull)
-			size = 0x7FFFFFFFull - *offset;
-	}
-
-	/* ToDo: not sure about iocb .. wcheng
-	 */
-	count = gfs_readi(ip, buf, *offset, size, gfs_copy2user);
-
-	if (count > 0)
-		*offset += count;
-
-	return count;
-}
-
-/**
- * grope_mapping - feel up a mapping that needs to be written
- * @buf: the start of the memory to be written
- * @size: the size of the memory to be written
- *
- * We do this after acquiring the locks on the mapping,
- * but before starting the write transaction.  We need to make
- * sure that we don't cause recursive transactions if blocks
- * need to be allocated to the file backing the mapping.
- *
- * Returns: errno
- */
-
-static int
-grope_mapping(char *buf, size_t size)
-{
-	unsigned long start = (unsigned long)buf;
-	unsigned long stop = start + size;
-	char c;
-
-	while (start < stop) {
-		if (copy_from_user(&c, (char *)start, 1))
-			return -EFAULT;
-
-		start += PAGE_CACHE_SIZE;
-		start &= PAGE_CACHE_MASK;
-	}
-
-	return 0;
-}
-
-/**
- * do_read_direct - Read bytes from a file
- * @file: The file to read from
- * @buf: The buffer to copy into
- * @size: The amount of data requested
- * @offset: The current file offset
- * @num_gh: The number of other locks we need to do the read
- * @ghs: the locks we need plus one for our lock
- *
- * Outputs: Offset - updated according to number of bytes read
- *
- * Returns: The number of bytes read, errno on failure
- */
-
-static ssize_t
-do_read_direct(struct file *file, char *buf, size_t size, loff_t *offset,
-		struct kiocb *iocb,
-		unsigned int num_gh, struct gfs_holder *ghs)
-{
-	struct inode *inode = file->f_mapping->host;
-	struct gfs_inode *ip = get_v2ip(inode);
-	unsigned int state = LM_ST_DEFERRED;
-	int flags = 0;
-	unsigned int x;
-	ssize_t count = 0;
-	int error;
-
-	for (x = 0; x < num_gh; x++)
-		if (ghs[x].gh_gl == ip->i_gl) {
-			state = LM_ST_SHARED;
-			flags |= GL_LOCAL_EXCL;
-			break;
-		}
-
-	gfs_holder_init(ip->i_gl, state, flags, &ghs[num_gh]);
-
-	if (num_gh && atomic_read(&current->mm->mm_users) > 1) {
-		error = grope_mapping(buf, size);
-		if (error)
-			goto out;
-	}
-
-	error = gfs_glock_nq_m(num_gh + 1, ghs);
-	if (error)
-		goto out;
-
-	error = -EINVAL;
-	if (gfs_is_jdata(ip))
-		goto out_gunlock;
-
-	if (gfs_is_stuffed(ip)) {
-		size_t mask = bdev_logical_block_size(inode->i_sb->s_bdev) - 1;
-
-		if (((*offset) & mask) || (((unsigned long)buf) & mask))
-			goto out_gunlock;
-
-		count = do_read_readi(file, buf, size & ~mask, offset, iocb);
-        }
-        else {
-                if (!iocb) 
-                        count = do_sync_read(file, buf, size, offset);
-                else {
-                        struct iovec local_iov = { .iov_base = buf, .iov_len = size};
-
-                        count = generic_file_aio_read(iocb, &local_iov, 1, *offset);
-                        iocb->ki_pos = *offset;
-                }
-        }
-
-	error = 0;
-
- out_gunlock:
-	gfs_glock_dq_m(num_gh + 1, ghs);
-
- out:
-	gfs_holder_uninit(&ghs[num_gh]);
-
-	return (count) ? count : error;
-}
-
-/**
- * do_read_buf - Read bytes from a file
- * @file: The file to read from
- * @buf: The buffer to copy into
- * @size: The amount of data requested
- * @offset: The current file offset
- * @num_gh: The number of other locks we need to do the read
- * @ghs: the locks we need plus one for our lock
- *
- * Outputs: Offset - updated according to number of bytes read
- *
- * Returns: The number of bytes read, errno on failure
- */
-
-static ssize_t
-do_read_buf(struct file *file, char *buf, size_t size, loff_t *offset,
-		struct kiocb *iocb,
-		unsigned int num_gh, struct gfs_holder *ghs)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	ssize_t count = 0;
-	int error;
-
-	gfs_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &ghs[num_gh]);
-
-	if (num_gh && atomic_read(&current->mm->mm_users) > 1) {
-		error = grope_mapping(buf, size);
-		if (error)
-			goto out;
-	}
-
-	error = gfs_glock_nq_m_atime(num_gh + 1, ghs);
-	if (error)
-		goto out;
-
-	if (gfs_is_jdata(ip) ||
-	    (gfs_is_stuffed(ip) && !test_bit(GIF_PAGED, &ip->i_flags)))
-                count = do_read_readi(file, buf, size, offset, iocb);
-        else {
-                if (!iocb) {
-                        count = do_sync_read(file, buf, size, offset);
-                } else {
-                        struct iovec local_iov = { .iov_base = buf, .iov_len = size};
-
-                        count = generic_file_aio_read(iocb, &local_iov, 1, *offset);
-                        iocb->ki_pos = *offset;
-                }
-        }
-
-	gfs_glock_dq_m(num_gh + 1, ghs);
-
- out:
-	gfs_holder_uninit(&ghs[num_gh]);
-
-	return (count) ? count : error;
-}
-
-static ssize_t
-__gfs_read(struct file *file, char *buf, size_t size, loff_t *offset, struct kiocb *iocb)
-{
-	atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file);
-
-	if (file->f_flags & O_DIRECT)
-		return walk_vm(file, buf, size, offset, iocb, do_read_direct);
-	else
-		return walk_vm(file, buf, size, offset, iocb, do_read_buf);
-}
-
-/**
- * gfs_read - Read bytes from a file
- * @file: The file to read from
- * @buf: The buffer to copy into
- * @size: The amount of data requested
- * @offset: The current file offset
- *
- * Outputs: Offset - updated according to number of bytes read
- *
- * Returns: The number of bytes read, errno on failure
- */
-
-static ssize_t
-gfs_read(struct file *file, char *buf, size_t size, loff_t *offset)
-{
-	return(__gfs_read(file, buf, size, offset, NULL));
-}
-
-/*
- * gfs_aio_read: match with vfs generic_file_aio_read as:
- *	(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos)
- */
-static ssize_t
-gfs_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long count,
-		loff_t pos)
-{
-	struct file *filp = iocb->ki_filp;
-
-	BUG_ON(iocb->ki_pos != pos);
-	return(__gfs_read(filp, iov->iov_base, iov->iov_len, &iocb->ki_pos, iocb));
-}
-
-/**
- * gfs_file_aio_write_nolock - Call vfs aio layer to write bytes to a file
- * @file: The file to write to
- * @buf: The buffer to copy from
- * @size: The amount of data requested
- * @offset: The offset in the file to write
- * @iocb: The io control block.  If NULL, a temporary one will be used.
- *
- * Returns: The number of bytes written, errno on failure
- */
-static ssize_t
-gfs_file_aio_write_nolock(struct file *file, char *buf, size_t size,
-                                                  loff_t *offset, struct kiocb *iocb)
-{
-        struct iovec local_iov = { .iov_base = buf, .iov_len = size };
-        struct kiocb local_iocb, *kiocb = NULL;
-        ssize_t count;
-
-        if (!iocb) {
-                init_sync_kiocb(&local_iocb, file);
-                local_iocb.ki_nr_segs = 1;
-                kiocb = &local_iocb;
-        }
-        else
-                kiocb = iocb;
-        
-        kiocb->ki_pos = *offset;
-        count = generic_file_aio_write_nolock(kiocb, &local_iov, kiocb->ki_nr_segs,
-                                                                                  kiocb->ki_pos);
-        *offset = kiocb->ki_pos;
-        if (kiocb == &local_iocb && count == -EIOCBQUEUED)
-                count = wait_on_sync_kiocb(kiocb);
-        return count;
-}
-
-/**
- * do_write_direct_alloc - Write bytes to a file
- * @file: The file to write to
- * @buf: The buffer to copy from
- * @size: The amount of data requested
- * @offset: The current file offset
- *
- * Outputs: Offset - updated according to number of bytes written
- *
- * Returns: The number of bytes written, errno on failure
- */
-
-static ssize_t
-do_write_direct_alloc(struct file *file, char *buf, size_t size, loff_t *offset,
-			struct kiocb *iocb)
-{
-	struct inode *inode = file->f_mapping->host;
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = NULL;
-	struct buffer_head *dibh;
-	unsigned int data_blocks, ind_blocks;
-	ssize_t count;
-	int error;
-
-	gfs_write_calc_reserv(ip, size, &data_blocks, &ind_blocks);
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_lock_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto fail;
-
-	error = gfs_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
-	if (error)
-		goto fail_gunlock_q;
-
-	al->al_requested_meta = ind_blocks;
-	al->al_requested_data = data_blocks;
-
-	error = gfs_inplace_reserve(ip);
-	if (error)
-		goto fail_gunlock_q;
-
-	/* Trans may require:
-	   All blocks for a RG bitmap, whatever indirect blocks we
-	   need, a modified dinode, and a quota change. */
-
-	error = gfs_trans_begin(sdp,
-				1 + al->al_rgd->rd_ri.ri_length + ind_blocks,
-				1);
-	if (error)
-		goto fail_ipres;
-
-	if ((ip->i_di.di_mode & (S_ISUID | S_ISGID)) && !capable(CAP_FSETID)) {
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (error)
-			goto fail_end_trans;
-
-		ip->i_di.di_mode &= (ip->i_di.di_mode & S_IXGRP) ? (~(S_ISUID | S_ISGID)) : (~S_ISUID);
-
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	if (gfs_is_stuffed(ip)) { error = gfs_unstuff_dinode(ip, gfs_unstuffer_sync, NULL); if (error)
-			goto fail_end_trans;
-	}
-
-	count = gfs_file_aio_write_nolock(file, buf, size, offset, iocb);
-	if (count < 0) {
-		error = count;
-		goto fail_end_trans;
-	}
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-	if (error)
-		goto fail_end_trans;
-
-	if (ip->i_di.di_size < inode->i_size)
-		ip->i_di.di_size = inode->i_size;
-	ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-	gfs_trans_add_bh(ip->i_gl, dibh);
-	gfs_dinode_out(&ip->i_di, dibh->b_data);
-	brelse(dibh);
-
-	gfs_trans_end(sdp);
-
-	/* Question (wcheng)
-	 * 1. should IS_SYNC flush glock ?
-	 * 2. does gfs_log_flush_glock flush data ?
-	 */
-	if (file->f_flags & O_SYNC)
-		gfs_log_flush_glock(ip->i_gl);
-
-	gfs_inplace_release(ip);
-	gfs_quota_unlock_m(ip);
-	gfs_alloc_put(ip);
-
-	if (file->f_mapping->nrpages) {
-		error = filemap_fdatawrite(file->f_mapping);
-		if (!error)
-			error = filemap_fdatawait(file->f_mapping);
-	}
-	if (error)
-		return error;
-
-	return count;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_ipres:
-	gfs_inplace_release(ip);
-
- fail_gunlock_q:
-	gfs_quota_unlock_m(ip);
-
- fail:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * do_write_direct - Write bytes to a file
- * @file: The file to write to
- * @buf: The buffer to copy from
- * @size: The amount of data requested
- * @offset: The current file offset
- * @num_gh: The number of other locks we need to do the read
- * @gh: the locks we need plus one for our lock
- *
- * Outputs: Offset - updated according to number of bytes written
- *
- * Returns: The number of bytes written, errno on failure
- */
-
-static ssize_t
-do_write_direct(struct file *file, char *buf, size_t size, loff_t *offset,
-		struct kiocb *iocb,
-		unsigned int num_gh, struct gfs_holder *ghs)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_file *fp = get_v2fp(file);
-	unsigned int state = LM_ST_DEFERRED;
-	int alloc_required;
-	unsigned int x;
-	size_t s;
-	ssize_t count = 0;
-	int error;
-
-	if (test_bit(GFF_DID_DIRECT_ALLOC, &fp->f_flags))
-		state = LM_ST_EXCLUSIVE;
-	else
-		for (x = 0; x < num_gh; x++)
-			if (ghs[x].gh_gl == ip->i_gl) {
-				state = LM_ST_EXCLUSIVE;
-				break;
-			}
-
- restart:
-	gfs_holder_init(ip->i_gl, state, 0, &ghs[num_gh]);
-
-	if (num_gh && atomic_read(&current->mm->mm_users) > 1) {
-		error = grope_mapping(buf, size);
-		if (error)
-			goto out;
-	}
-
-	error = gfs_glock_nq_m(num_gh + 1, ghs);
-	if (error)
-		goto out;
-
-	error = -EINVAL;
-	if (gfs_is_jdata(ip))
-		goto out_gunlock;
-
-	if (num_gh) {
-		error = grope_mapping(buf, size);
-		if (error)
-			goto out_gunlock;
-	}
-
-	if (file->f_flags & O_APPEND)
-		*offset = ip->i_di.di_size;
-
-	if (!(file->f_flags & O_LARGEFILE)) {
-		error = -EFBIG;
-		if (*offset >= 0x7FFFFFFFull)
-			goto out_gunlock;
-		if (*offset + size > 0x7FFFFFFFull)
-			size = 0x7FFFFFFFull - *offset;
-	}
-
-	if (gfs_is_stuffed(ip) ||
-	    *offset + size > ip->i_di.di_size ||
-	    ((ip->i_di.di_mode & (S_ISUID | S_ISGID)) && !capable(CAP_FSETID)))
-		alloc_required = TRUE;
-	else {
-		error = gfs_write_alloc_required(ip, *offset, size,
-						 &alloc_required);
-		if (error)
-			goto out_gunlock;
-	}
-
-	if (alloc_required && state != LM_ST_EXCLUSIVE) {
-		gfs_glock_dq_m(num_gh + 1, ghs);
-		gfs_holder_uninit(&ghs[num_gh]);
-		state = LM_ST_EXCLUSIVE;
-		goto restart;
-	}
-
-	if (alloc_required) {
-		set_bit(GFF_DID_DIRECT_ALLOC, &fp->f_flags);
-
-		/* for asynchronous IO, the buffer can not be splitted */
-		if (iocb) {
-			count = do_write_direct_alloc(file, buf, size, offset, iocb);
-			goto out_iocb_write;
-		}
-
-		/* split large writes into smaller atomic transactions */
-		while (size) {
-			s = gfs_tune_get(sdp, gt_max_atomic_write);
-			if (s > size)
-				s = size;
-
-			error = do_write_direct_alloc(file, buf, s, offset, iocb);
-			if (error < 0)
-				goto out_gunlock;
-
-			buf += error;
-			size -= error;
-			count += error;
-		}
-	} else {
-		struct gfs_holder t_gh;
-
-		clear_bit(GFF_DID_DIRECT_ALLOC, &fp->f_flags);
-
-		error = gfs_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, 0, &t_gh);
-		if (error)
-			goto out_gunlock;
-
-		/* Todo: It would be nice if init_sync_kiocb is exported.
-		 *  .. wcheng
-		 */
-		count = gfs_file_aio_write_nolock(file, buf, size, offset, iocb);
-		gfs_glock_dq_uninit(&t_gh);
-	}
-
-out_iocb_write:
-	error = 0;
-
-out_gunlock:
-	gfs_glock_dq_m(num_gh + 1, ghs);
-
-out:
-	gfs_holder_uninit(&ghs[num_gh]);
-
-	return (count) ? count : error;
-}
-
-/**
- * do_do_write_buf - Write bytes to a file
- * @file: The file to write to
- * @buf: The buffer to copy from
- * @size: The amount of data requested
- * @offset: The current file offset
- *
- * Outputs: Offset - updated according to number of bytes written
- *
- * Returns: The number of bytes written, errno on failure
- */
-
-static ssize_t
-do_do_write_buf(struct file *file, char *buf, size_t size, loff_t *offset,
-		struct kiocb *iocb)
-{
-	struct inode *inode = file->f_mapping->host;
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = NULL;
-	struct buffer_head *dibh;
-	unsigned int data_blocks, ind_blocks;
-	int alloc_required, journaled;
-	ssize_t count;
-	int error;
-	unsigned int posix = sdp->sd_args.ar_posix_acls ? 4 : 0;
-
-	journaled = gfs_is_jdata(ip);
-
-	gfs_write_calc_reserv(ip, size, &data_blocks, &ind_blocks);
-
-	error = gfs_write_alloc_required(ip, *offset, size, &alloc_required);
-	if (error)
-		return error;
-
-	if (alloc_required) {
-		al = gfs_alloc_get(ip);
-
-		error = gfs_quota_lock_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-		if (error)
-			goto fail;
-
-		error = gfs_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
-		if (error)
-			goto fail_gunlock_q;
-
-		if (journaled)
-			al->al_requested_meta = ind_blocks + data_blocks;
-		else {
-			al->al_requested_meta = ind_blocks;
-			al->al_requested_data = data_blocks;
-		}
-
-		error = gfs_inplace_reserve(ip);
-		if (error)
-			goto fail_gunlock_q;
-
-		/* Trans may require:
-		   All blocks for a RG bitmap, whatever indirect blocks we
-		   need, a modified dinode, and a quota change. */
-
-		error = gfs_trans_begin(sdp,
-					1 + al->al_rgd->rd_ri.ri_length +
-					ind_blocks + posix +
-					((journaled) ? data_blocks : 0), 1);
-		if (error)
-			goto fail_ipres;
-	} else {
-		/* Trans may require:
-		   A modified dinode. */
-
-		error = gfs_trans_begin(sdp, posix +
-					1 + ((journaled) ? data_blocks : 0), 0);
-		if (error)
-			goto fail_ipres;
-	}
-
-	if ((ip->i_di.di_mode & (S_ISUID | S_ISGID)) && !capable(CAP_FSETID)) {
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (error)
-			goto fail_end_trans;
-
-		ip->i_di.di_mode &= (ip->i_di.di_mode & S_IXGRP) ? (~(S_ISUID | S_ISGID)) : (~S_ISUID);
-
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	if (journaled ||
-	    (gfs_is_stuffed(ip) && !test_bit(GIF_PAGED, &ip->i_flags) &&
-	     *offset + size <= sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode))) {
-
-		count = gfs_writei(ip, buf, *offset, size, gfs_copy_from_user, iocb);
-		if (count < 0) {
-			error = count;
-			goto fail_end_trans;
-		}
-		if (gfs_is_stuffed(ip)){
-			struct page *page;
-			page = find_get_page(file->f_mapping, 0);
-			if (page) {
-				ClearPageUptodate(page);
-				page_cache_release(page);
-			}
-		}
-		*offset += count;
-	} else {
-		count = gfs_file_aio_write_nolock(file, buf, size, offset, iocb);
-		if (count < 0) {
-			error = count;
-			goto fail_end_trans;
-		}
-
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (error)
-			goto fail_end_trans;
-
-		if (ip->i_di.di_size < inode->i_size)
-			ip->i_di.di_size = inode->i_size;
-		ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
-
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	gfs_trans_end(sdp);
-
-	if (file->f_flags & O_SYNC || IS_SYNC(inode)) {
-		gfs_log_flush_glock(ip->i_gl);
-		error = filemap_fdatawrite(file->f_mapping);
-		if (error == 0)
-			error = filemap_fdatawait(file->f_mapping);
-		if (error)
-			goto fail_ipres;
-	}
-
-	if (alloc_required) {
-		gfs_assert_warn(sdp, count != size ||
-				al->al_alloced_meta ||
-				al->al_alloced_data);
-		gfs_inplace_release(ip);
-		gfs_quota_unlock_m(ip);
-		gfs_alloc_put(ip);
-	}
-
-	return count;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_ipres:
-	if (alloc_required)
-		gfs_inplace_release(ip);
-
- fail_gunlock_q:
-	if (alloc_required)
-		gfs_quota_unlock_m(ip);
-
- fail:
-	if (alloc_required)
-		gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * do_write_buf - Write bytes to a file
- * @file: The file to write to
- * @buf: The buffer to copy from
- * @size: The amount of data requested
- * @offset: The current file offset
- * @num_gh: The number of other locks we need to do the read
- * @gh: the locks we need plus one for our lock
- *
- * Outputs: Offset - updated according to number of bytes written
- *
- * Returns: The number of bytes written, errno on failure
- */
-
-static ssize_t
-do_write_buf(struct file *file,
-		char *buf, size_t size, loff_t *offset,
-		struct kiocb *iocb,
-		unsigned int num_gh, struct gfs_holder *ghs)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	size_t s;
-	ssize_t count = 0;
-	int error;
-
-	gfs_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[num_gh]);
-
-	if (num_gh && atomic_read(&current->mm->mm_users) > 1) {
-		error = grope_mapping(buf, size);
-		if (error)
-			goto out;
-	}
-
-	error = gfs_glock_nq_m(num_gh + 1, ghs);
-	if (error)
-		goto out;
-
-	if (num_gh) {
-		error = grope_mapping(buf, size);
-		if (error)
-			goto out_gunlock;
-	}
-
-	if (file->f_flags & O_APPEND)
-		*offset = ip->i_di.di_size;
-
-	if (!(file->f_flags & O_LARGEFILE)) {
-		error = -EFBIG;
-		if (*offset >= 0x7FFFFFFFull)
-			goto out_gunlock;
-		if (*offset + size > 0x7FFFFFFFull)
-			size = 0x7FFFFFFFull - *offset;
-	}
-
-	/* split large writes into smaller atomic transactions */
-	while (size) {
-		s = gfs_tune_get(sdp, gt_max_atomic_write);
-		if (s > size)
-			s = size;
-
-		error = do_do_write_buf(file, buf, s, offset, iocb);
-		if (error < 0)
-			goto out_gunlock;
-
-		buf += error;
-		size -= error;
-		count += error;
-	}
-
-	error = 0;
-
- out_gunlock:
-	gfs_glock_dq_m(num_gh + 1, ghs);
-
- out:
-	gfs_holder_uninit(&ghs[num_gh]);
-
-	return (count) ? count : error;
-}
-
-/**
- * gfs_write - Write bytes to a file
- * @file: The file to write to
- * @buf: The buffer to copy from
- * @size: The amount of data requested
- * @offset: The current file offset
- *
- * Outputs: Offset - updated according to number of bytes written
- *
- * Returns: The number of bytes written, errno on failure
- */
-
-static ssize_t
-__gfs_write(struct file *file, const char *buf, size_t size, loff_t *offset, struct kiocb *iocb)
-{
-	struct inode *inode = file->f_mapping->host;
-	ssize_t count;
-
-	atomic_inc(&get_v2sdp(inode->i_sb)->sd_ops_file);
-
-	if (*offset < 0)
-		return -EINVAL;
-	if (!access_ok(VERIFY_READ, buf, size))
-		return -EFAULT;
-
-	mutex_lock(&inode->i_mutex);
-	if (file->f_flags & O_DIRECT)
-		count = walk_vm(file, (char *)buf, size, offset, iocb, do_write_direct);
-	else
-		count = walk_vm(file, (char *)buf, size, offset, iocb, do_write_buf);
-	mutex_unlock(&inode->i_mutex);
-
-	return count;
-}
-
-static ssize_t
-gfs_write(struct file *file, const char *buf, size_t size, loff_t *offset)
-{
-	return(__gfs_write(file, buf, size, offset, NULL));
-}
-
-static ssize_t
-gfs_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long segs,
-			loff_t pos)
-{
-	struct file *file = iocb->ki_filp;
-
-	BUG_ON(iocb->ki_pos != pos);
-
-	return(__gfs_write(file, iov->iov_base, iov->iov_len, &iocb->ki_pos,
-					iocb));
-}
-
-/**
- * filldir_reg_func - Report a directory entry to the caller of gfs_dir_read()
- * @opaque: opaque data used by the function
- * @name: the name of the directory entry
- * @length: the length of the name
- * @offset: the entry's offset in the directory
- * @inum: the inode number the entry points to
- * @type: the type of inode the entry points to
- *
- * Returns: 0 on success, 1 if buffer full
- */
-
-static int
-filldir_reg_func(void *opaque,
-		 const char *name, unsigned int length,
-		 uint64_t offset,
-		 struct gfs_inum *inum, unsigned int type)
-{
-	struct filldir_reg *fdr = (struct filldir_reg *)opaque;
-	struct gfs_sbd *sdp = fdr->fdr_sbd;
-	unsigned int vfs_type;
-	int error;
-
-	switch (type) {
-	case GFS_FILE_NON:
-		vfs_type = DT_UNKNOWN;
-		break;
-	case GFS_FILE_REG:
-		vfs_type = DT_REG;
-		break;
-	case GFS_FILE_DIR:
-		vfs_type = DT_DIR;
-		break;
-	case GFS_FILE_LNK:
-		vfs_type = DT_LNK;
-		break;
-	case GFS_FILE_BLK:
-		vfs_type = DT_BLK;
-		break;
-	case GFS_FILE_CHR:
-		vfs_type = DT_CHR;
-		break;
-	case GFS_FILE_FIFO:
-		vfs_type = DT_FIFO;
-		break;
-	case GFS_FILE_SOCK:
-		vfs_type = DT_SOCK;
-		break;
-	default:
-		if (gfs_consist(sdp))
-			printk("GFS: fsid=%s: type = %u\n",
-			       sdp->sd_fsname, type);
-		return -EIO;
-	}
-
-	error = fdr->fdr_filldir(fdr->fdr_opaque, name, length, offset,
-				 inum->no_formal_ino, vfs_type);
-	if (error)
-		return 1;
-
-	/* Prefetch locks */
-	if (fdr->fdr_prefetch && !(length == 1 && *name == '.')) {
-		gfs_glock_prefetch_num(sdp,
-				       inum->no_formal_ino, &gfs_inode_glops,
-				       LM_ST_SHARED, LM_FLAG_TRY | LM_FLAG_ANY);
-		gfs_glock_prefetch_num(sdp,
-				       inum->no_addr, &gfs_iopen_glops,
-				       LM_ST_SHARED, LM_FLAG_TRY);
-	}
-
-	return 0;
-}
-
-static inline int
-high_stat_rate(struct gfs_inode *ip)
-{
-	struct timeval now, diff;
-	unsigned long milli = 0;
-	unsigned int rate = 0; /* stats per second in this dir */
-
-	do_gettimeofday(&now);
-	diff.tv_sec = now.tv_sec - ip->i_dir_stat_st.tv_sec;
-	diff.tv_usec = now.tv_usec - ip->i_dir_stat_st.tv_usec;
-	if (diff.tv_usec < 0) {
-		diff.tv_usec += 1000000;
-		diff.tv_sec--;
-	}
-	milli = (diff.tv_sec * 1000) + (diff.tv_usec / 1000);
-	if (milli)
-		rate = (ip->i_dir_stats * 1000) / milli;
-
-	if (rate > 10) /* More than 10 stats/sec */
-		return 1;
-	return 0;
-}
-
-/**
- * readdir_reg - Read directory entries from a directory
- * @file: The directory to read from
- * @dirent: Buffer for dirents
- * @filldir: Function used to do the copying
- *
- * Returns: errno
- */
-
-static int
-readdir_reg(struct file *file, void *dirent, filldir_t filldir)
-{
-	struct gfs_inode *dip = get_v2ip(file->f_mapping->host);
-	struct filldir_reg fdr;
-	struct gfs_holder d_gh;
-	uint64_t offset = file->f_pos;
-	int error;
-
-	fdr.fdr_sbd = dip->i_sbd;
-	fdr.fdr_prefetch = high_stat_rate(dip) ? TRUE : FALSE;
-	fdr.fdr_filldir = filldir;
-	fdr.fdr_opaque = dirent;
-
-	/* reset stat counter and timestamp */
-	dip->i_dir_stats = 0;
-	do_gettimeofday(&dip->i_dir_stat_st);
-
-	gfs_holder_init(dip->i_gl, LM_ST_SHARED, GL_ATIME, &d_gh);
-	error = gfs_glock_nq_atime(&d_gh);
-	if (error) {
-		gfs_holder_uninit(&d_gh);
-		return error;
-	}
-
-	error = gfs_dir_read(dip, &offset, &fdr, filldir_reg_func);
-
-	gfs_glock_dq_uninit(&d_gh);
-
-	file->f_pos = offset;
-
-	return error;
-}
-
-/**
- * filldir_bad_func - Report a directory entry to the caller of gfs_dir_read()
- * @opaque: opaque data used by the function
- * @name: the name of the directory entry
- * @length: the length of the name
- * @offset: the entry's offset in the directory
- * @inum: the inode number the entry points to
- * @type: the type of inode the entry points to
- *
- * For supporting NFS.
- *
- * Returns: 0 on success, 1 if buffer full
- */
-
-static int
-filldir_bad_func(void *opaque,
-		 const char *name, unsigned int length,
-		 uint64_t offset,
-		 struct gfs_inum *inum, unsigned int type)
-{
-	struct filldir_bad *fdb = (struct filldir_bad *)opaque;
-	struct gfs_sbd *sdp = fdb->fdb_sbd;
-	struct filldir_bad_entry *fbe;
-
-	if (fdb->fdb_entry_off == fdb->fdb_entry_num ||
-	    fdb->fdb_name_off + length > fdb->fdb_name_size)
-		return 1;
-
-	fbe = &fdb->fdb_entry[fdb->fdb_entry_off];
-	fbe->fbe_name = fdb->fdb_name + fdb->fdb_name_off;
-	memcpy(fbe->fbe_name, name, length);
-	fbe->fbe_length = length;
-	fbe->fbe_offset = offset;
-	fbe->fbe_inum = *inum;
-	fbe->fbe_type = type;
-
-	fdb->fdb_entry_off++;
-	fdb->fdb_name_off += length;
-
-	/* Prefetch locks */
-	if (!(length == 1 && *name == '.')) {
-		gfs_glock_prefetch_num(sdp,
-				       inum->no_formal_ino, &gfs_inode_glops,
-				       LM_ST_SHARED, LM_FLAG_TRY | LM_FLAG_ANY);
-		gfs_glock_prefetch_num(sdp,
-				       inum->no_addr, &gfs_iopen_glops,
-				       LM_ST_SHARED, LM_FLAG_TRY);
-	}
-
-	return 0;
-}
-
-/**
- * readdir_bad - Read directory entries from a directory
- * @file: The directory to read from
- * @dirent: Buffer for dirents
- * @filldir: Function used to do the copying
- *
- * For supporting NFS.
- *
- * Returns: errno
- */
-
-static int
-readdir_bad(struct file *file, void *dirent, filldir_t filldir)
-{
-	struct gfs_inode *dip = get_v2ip(file->f_mapping->host);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct filldir_reg fdr;
-	unsigned int entries, size;
-	struct filldir_bad *fdb;
-	struct gfs_holder d_gh;
-	uint64_t offset = file->f_pos;
-	unsigned int x;
-	struct filldir_bad_entry *fbe;
-	int error;
-
-	entries = gfs_tune_get(sdp, gt_entries_per_readdir);
-	size = sizeof(struct filldir_bad) +
-	    entries * (sizeof(struct filldir_bad_entry) + GFS_FAST_NAME_SIZE);
-
-	fdb = kmalloc(size, GFP_KERNEL);
-	if (!fdb)
-		return -ENOMEM;
-	memset(fdb, 0, size);
-
-	fdb->fdb_sbd = sdp;
-	fdb->fdb_entry = (struct filldir_bad_entry *)(fdb + 1);
-	fdb->fdb_entry_num = entries;
-	fdb->fdb_name = ((char *)fdb) + sizeof(struct filldir_bad) +
-		entries * sizeof(struct filldir_bad_entry);
-	fdb->fdb_name_size = entries * GFS_FAST_NAME_SIZE;
-
-	gfs_holder_init(dip->i_gl, LM_ST_SHARED, GL_ATIME, &d_gh);
-	error = gfs_glock_nq_atime(&d_gh);
-	if (error) {
-		gfs_holder_uninit(&d_gh);
-		goto out;
-	}
-
-	error = gfs_dir_read(dip, &offset, fdb, filldir_bad_func);
-
-	gfs_glock_dq_uninit(&d_gh);
-
-	fdr.fdr_sbd = sdp;
-	fdr.fdr_prefetch = FALSE;
-	fdr.fdr_filldir = filldir;
-	fdr.fdr_opaque = dirent;
-
-	for (x = 0; x < fdb->fdb_entry_off; x++) {
-		fbe = &fdb->fdb_entry[x];
-
-		error = filldir_reg_func(&fdr,
-					 fbe->fbe_name, fbe->fbe_length,
-					 fbe->fbe_offset,
-					 &fbe->fbe_inum, fbe->fbe_type);
-		if (error) {
-			file->f_pos = fbe->fbe_offset;
-			error = 0;
-			goto out;
-		}
-	}
-
-	file->f_pos = offset;
-
- out:
-	kfree(fdb);
-
-	return error;
-}
-
-/**
- * gfs_readdir - Read directory entries from a directory
- * @file: The directory to read from
- * @dirent: Buffer for dirents
- * @filldir: Function used to do the copying
- *
- * Returns: errno
- */
-
-static int
-gfs_readdir(struct file *file, void *dirent, filldir_t filldir)
-{
-	int error;
-
-	atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file);
-
-	/* Use "bad" one if we're called from NFS daemon */
-	if (strcmp(current->comm, "nfsd") != 0)
-		error = readdir_reg(file, dirent, filldir);
-	else
-		error = readdir_bad(file, dirent, filldir);
-
-	return error;
-}
-
-/**
- * gfs_ioctl - do an ioctl on a file
- * @inode: the inode
- * @file: the file pointer
- * @cmd: the ioctl command
- * @arg: the argument
- *
- * Returns: errno
- */
-
-static int
-gfs_ioctl(struct inode *inode, struct file *file,
-	  unsigned int cmd, unsigned long arg)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	switch (cmd) {
-	case GFS_IOCTL_IDENTIFY: {
-                unsigned int x = GFS_MAGIC;
-                if (copy_to_user((unsigned int *)arg, &x, sizeof(unsigned int)))
-                        return -EFAULT;
-		return 0;
-        }
-
-	case GFS_IOCTL_SUPER:
-		return gfs_ioctl_i(ip, (void *)arg);
-
-	default:
-		return -ENOTTY;
-	}
-}
-
-#ifdef CONFIG_COMPAT
-/**
- * gfs_compat_ioctl - do an ioctl on a file - compatible between 32-64 bit
- * @inode: the inode
- * @file: the file pointer
- * @cmd: the ioctl command
- * @arg: the argument
- *
- * Returns: errno
- */
-
-static long
-gfs_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	switch (cmd) {
-	case GFS_IOCTL_IDENTIFY: {
-                unsigned int x = GFS_MAGIC;
-                if (copy_to_user((unsigned int *)arg, &x, sizeof(unsigned int)))
-                        return -EFAULT;
-		return 0;
-        }
-
-	case GFS_IOCTL_SUPER:
-		return gfs_ioctl_i_compat(ip, arg);
-
-	default:
-		return -ENOTTY;
-	}
-}
-#endif
-
-/**
- * gfs_mmap - We don't support shared writable mappings right now
- * @file: The file to map
- * @vma: The VMA which described the mapping
- *
- * Returns: 0 or error code
- */
-
-static int
-gfs_mmap(struct file *file, struct vm_area_struct *vma)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_holder i_gh;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	gfs_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &i_gh);
-	error = gfs_glock_nq_atime(&i_gh);
-	if (error) {
-		gfs_holder_uninit(&i_gh);
-		return error;
-	}
-
-	if (gfs_is_jdata(ip)) {
-		if (vma->vm_flags & VM_MAYSHARE)
-			error = -ENOSYS;
-		else
-			vma->vm_ops = &gfs_vm_ops_private;
-	} else {
-		/* This is VM_MAYWRITE instead of VM_WRITE because a call
-		   to mprotect() can turn on VM_WRITE later. */
-
-		if ((vma->vm_flags & (VM_MAYSHARE | VM_MAYWRITE)) == (VM_MAYSHARE | VM_MAYWRITE))
-			vma->vm_ops = &gfs_vm_ops_sharewrite;
-		else
-			vma->vm_ops = &gfs_vm_ops_private;
-	}
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_open - open a file
- * @inode: the inode to open
- * @file: the struct file for this opening
- *
- * Returns: errno
- */
-
-static int
-gfs_open(struct inode *inode, struct file *file)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_holder i_gh;
-	struct gfs_file *fp;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	fp = kmalloc(sizeof(struct gfs_file), GFP_KERNEL);
-	if (!fp)
-		return -ENOMEM;
-	memset(fp, 0, sizeof(struct gfs_file));
-
-	init_MUTEX(&fp->f_fl_lock);
-
-	fp->f_inode = ip;
-	fp->f_vfile = file;
-
-	gfs_assert_warn(ip->i_sbd, !get_v2fp(file));
-	set_v2fp(file, fp);
-
-	if (ip->i_di.di_type == GFS_FILE_REG) {
-		error = gfs_glock_nq_init(ip->i_gl,
-					  LM_ST_SHARED, LM_FLAG_ANY,
-					  &i_gh);
-		if (error)
-			goto fail;
-
-		if (!(file->f_flags & O_LARGEFILE) &&
-		    ip->i_di.di_size > 0x7FFFFFFFull) {
-			error = -EFBIG;
-			goto fail_gunlock;
-		}
-
-		/* Listen to the Direct I/O flag */
-
-		if (ip->i_di.di_flags & GFS_DIF_DIRECTIO)
-			file->f_flags |= O_DIRECT;
-
-		/* Don't let the user open O_DIRECT on a jdata file */
-
-		if ((file->f_flags & O_DIRECT) && gfs_is_jdata(ip)) {
-			error = -EINVAL;
-			goto fail_gunlock;
-		}
-
-		gfs_glock_dq_uninit(&i_gh);
-	}
-
-	return 0;
-
- fail_gunlock:
-	gfs_glock_dq_uninit(&i_gh);
-
- fail:
-	set_v2fp(file, NULL);
-	kfree(fp);
-
-	return error;
-}
-
-/**
- * gfs_close - called to close a struct file
- * @inode: the inode the struct file belongs to
- * @file: the struct file being closed
- *
- * Returns: errno
- */
-
-static int
-gfs_close(struct inode *inode, struct file *file)
-{
-	struct gfs_sbd *sdp = get_v2sdp(inode->i_sb);
-	struct gfs_file *fp;
-
-	atomic_inc(&sdp->sd_ops_file);
-
-	fp = get_v2fp(file);
-	set_v2fp(file, NULL);
-
-	if (!gfs_assert_warn(sdp, fp))
-		kfree(fp);
-
-	return 0;
-}
-
-/**
- * gfs_fsync - sync the dirty data for a file (across the cluster)
- * @file: the file that points to the dentry (we ignore this)
- * @dentry: the dentry that points to the inode to sync
- *
- * Returns: errno
- *
- * Obtain a SHARED lock on the file, to force any node with an EXCLUSIVE lock
- *   to sync file's dirty data to disk, as it releases the EXCLUSIVE lock.
- */
-
-static int
-gfs_fsync(struct file *file, struct dentry *dentry, int datasync)
-{
-	struct gfs_inode *ip = get_v2ip(dentry->d_inode);
-	struct gfs_holder i_gh;
-	struct inode *inode = dentry->d_inode;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-	if (error)
-		return error;
-
-	if (gfs_is_jdata(ip))
-		gfs_log_flush_glock(ip->i_gl);
-	else {
-		if ((!datasync) || (inode->i_state & I_DIRTY_DATASYNC)) {
-			struct writeback_control wbc = {
-				.sync_mode = WB_SYNC_ALL,
-				.nr_to_write = 0,
-			};
-			error = sync_inode(inode, &wbc);
-		}
-		if (gfs_is_stuffed(ip))
-			gfs_log_flush_glock(ip->i_gl);
-	}
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_lock - acquire/release a posix lock on a file
- * @file: the file pointer
- * @cmd: either modify or retrieve lock state, possibly wait
- * @fl: type and range of lock
- *
- * Returns: errno
- */
-
-static int
-gfs_lock(struct file *file, int cmd, struct file_lock *fl)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct lm_lockname name =
-		{ .ln_number = ip->i_num.no_formal_ino,
-		  .ln_type = LM_TYPE_PLOCK };
-
-	atomic_inc(&sdp->sd_ops_file);
-
-	if (!(fl->fl_flags & FL_POSIX))
-		return -ENOLCK;
-	if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
-		return -ENOLCK;
-
-	if (cmd == F_CANCELLK) {
-		/* Hack: */
-		cmd = F_SETLK;
-		fl->fl_type = F_UNLCK;
-	}
-
-	if (IS_GETLK(cmd))
-		return gfs_lm_plock_get(sdp, &name, file, fl);
-	else if (fl->fl_type == F_UNLCK)
-		return gfs_lm_punlock(sdp, &name, file, fl);
-	else
-		return gfs_lm_plock(sdp, &name, file, cmd, fl);
-}
-
-/**
- * gfs_splice_read - Send bytes to a file or socket
- * @in_file: The file to read from
- * @out_file: The file to write to
- * @count: The amount of data
- * @ppos: The beginning file offset
- *
- * Outputs: offset - updated according to number of bytes read
- *
- * Returns: The number of bytes sent, errno on failure
- */
-
-static ssize_t
-gfs_splice_read(struct file *in_file, loff_t *ppos, struct pipe_inode_info *pipe, size_t count, unsigned int flags)
-{
-	struct gfs_inode *ip = get_v2ip(in_file->f_mapping->host);
-	struct gfs_holder gh;
-	ssize_t retval;
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	gfs_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &gh);
-
-	retval = gfs_glock_nq_atime(&gh);
-	if (retval)
-		goto out;
-
-	if (gfs_is_jdata(ip))
-		retval = -ENOSYS;
-	else 
-		retval = generic_file_splice_read(in_file, ppos, pipe, count, flags);
-
-	gfs_glock_dq(&gh);
-
- out:
-	gfs_holder_uninit(&gh);
-
-	return retval;
-}
-
-/**
- * do_flock - Acquire a flock on a file
- * @file:
- * @cmd:
- * @fl:
- *
- * Returns: errno
- */
-
-static int
-do_flock(struct file *file, int cmd, struct file_lock *fl)
-{
-	struct gfs_file *fp = get_v2fp(file);
-	struct gfs_holder *fl_gh = &fp->f_fl_gh;
-	struct gfs_inode *ip = fp->f_inode;
-	struct gfs_glock *gl;
-	unsigned int state;
-	int flags;
-	int error = 0;
-
-	state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
-	flags = ((IS_SETLKW(cmd)) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE
-		| GL_FLOCK;
-
-	down(&fp->f_fl_lock);
-
-	gl = fl_gh->gh_gl;
-	if (gl) {
-		if (fl_gh->gh_state == state)
-			goto out;
-		flock_lock_file_wait(file,
-				     &(struct file_lock){.fl_type = F_UNLCK});
-		gfs_glock_dq_wait(fl_gh);
-		gfs_holder_reinit(state, flags, fl_gh);
-	} else {
-		error = gfs_glock_get(ip->i_sbd,
-				      ip->i_num.no_formal_ino, &gfs_flock_glops,
-				      CREATE, &gl);
-		if (error)
-			goto out;
-		gfs_holder_init(gl, state, flags, fl_gh);
-		gfs_glock_put(gl);
-	}
-	error = gfs_glock_nq(fl_gh);
-	if (error) {
-		gfs_holder_uninit(fl_gh);
-		if (error == GLR_TRYFAILED)
-			error = -EAGAIN;
-	} else {
-		error = flock_lock_file_wait(file, fl);
-		gfs_assert_warn(ip->i_sbd, !error);
-	}
-
- out:
-	up(&fp->f_fl_lock);
-
-	return error;
-}
-
-/**
- * do_unflock - Release a flock on a file
- * @file: the file
- * @fl:
- *
- */
-
-static void
-do_unflock(struct file *file, struct file_lock *fl)
-{
-	struct gfs_file *fp = get_v2fp(file);
-	struct gfs_holder *fl_gh = &fp->f_fl_gh;
-
-	down(&fp->f_fl_lock);
-	flock_lock_file_wait(file, fl);
-	if (fl_gh->gh_gl)
-		gfs_glock_dq_uninit(fl_gh);
-	up(&fp->f_fl_lock);
-}
-
-/**
- * gfs_flock - acquire/release a flock lock on a file
- * @file: the file pointer
- * @cmd: either modify or retrieve lock state, possibly wait
- * @fl: type and range of lock
- *
- * Returns: errno
- */
-
-static int
-gfs_flock(struct file *file, int cmd, struct file_lock *fl)
-{
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-
-	atomic_inc(&ip->i_sbd->sd_ops_file);
-
-	if (!(fl->fl_flags & FL_FLOCK))
-		return -ENOLCK;
-	if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
-		return -ENOLCK;
-
-	if (fl->fl_type == F_UNLCK) {
-		do_unflock(file, fl);
-		return 0;
-	} else
-		return do_flock(file, cmd, fl);
-}
-
-struct file_operations gfs_file_fops = {
-	.llseek = gfs_llseek,
-	.read = gfs_read,
-	.write = gfs_write,
-	.aio_read = gfs_aio_read,
-	.aio_write = gfs_aio_write,
-	.ioctl = gfs_ioctl,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl   = gfs_compat_ioctl,
-#endif
-	.mmap = gfs_mmap,
-	.open = gfs_open,
-	.release = gfs_close,
-	.fsync = gfs_fsync,
-	.lock = gfs_lock,
-	.splice_read = gfs_splice_read,
-	.flock = gfs_flock,
-};
-
-struct file_operations gfs_file_fops_jdata = {
-	.llseek = gfs_llseek,
-	.read = gfs_read,
-	.write = gfs_write,
-	.aio_read = gfs_aio_read,
-	.aio_write = gfs_aio_write,
-	.ioctl = gfs_ioctl,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl   = gfs_compat_ioctl,
-#endif
-	.mmap = gfs_mmap,
-	.open = gfs_open,
-	.release = gfs_close,
-	.fsync = gfs_fsync,
-	.lock = gfs_lock,
-	.flock = gfs_flock,
-};
-
-struct file_operations gfs_dir_fops = {
-	.readdir = gfs_readdir,
-	.ioctl = gfs_ioctl,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl   = gfs_compat_ioctl,
-#endif
-	.open = gfs_open,
-	.release = gfs_close,
-	.fsync = gfs_fsync,
-	.lock = gfs_lock,
-	.flock = gfs_flock,
-};
-
-struct file_operations gfs_file_fops_nolock = {
-	.llseek = gfs_llseek,
-	.read = gfs_read,
-	.write = gfs_write,
-	.aio_read = gfs_aio_read,
-	.aio_write = gfs_aio_write,
-	.ioctl = gfs_ioctl,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl = gfs_compat_ioctl,
-#endif
-	.mmap = gfs_mmap,
-	.open = gfs_open,
-	.release = gfs_close,
-	.fsync = gfs_fsync,
-	.splice_read = gfs_splice_read,
-};
-
-struct file_operations gfs_file_fops_nolock_jdata = {
-	.llseek = gfs_llseek,
-	.read = gfs_read,
-	.write = gfs_write,
-	.aio_read = gfs_aio_read,
-	.aio_write = gfs_aio_write,
-	.ioctl = gfs_ioctl,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl = gfs_compat_ioctl,
-#endif
-	.mmap = gfs_mmap,
-	.open = gfs_open,
-	.release = gfs_close,
-	.fsync = gfs_fsync,
-};
-
-struct file_operations gfs_dir_fops_nolock = {
-	.readdir = gfs_readdir,
-	.ioctl = gfs_ioctl,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl = gfs_compat_ioctl,
-#endif
-	.open = gfs_open,
-	.release = gfs_close,
-	.fsync = gfs_fsync,
-};
diff --git a/gfs-kernel/src/gfs/ops_file.h b/gfs-kernel/src/gfs/ops_file.h
deleted file mode 100644
index 4e7e15f..0000000
--- a/gfs-kernel/src/gfs/ops_file.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __OPS_FILE_DOT_H__
-#define __OPS_FILE_DOT_H__
-
-extern struct file_operations gfs_file_fops;
-extern struct file_operations gfs_file_fops_jdata;
-extern struct file_operations gfs_dir_fops;
-extern struct file_operations gfs_file_fops_nolock;
-extern struct file_operations gfs_file_fops_nolock_jdata;
-extern struct file_operations gfs_dir_fops_nolock;
-
-#endif /* __OPS_FILE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_fstype.c b/gfs-kernel/src/gfs/ops_fstype.c
deleted file mode 100644
index 8bc76bf..0000000
--- a/gfs-kernel/src/gfs/ops_fstype.c
+++ /dev/null
@@ -1,828 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/vmalloc.h>
-#include <linux/blkdev.h>
-#include <linux/kthread.h>
-
-#include "gfs.h"
-#include "daemon.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "lm.h"
-#include "mount.h"
-#include "ops_export.h"
-#include "ops_fstype.h"
-#include "ops_super.h"
-#include "proc.h"
-#include "quota.h"
-#include "recovery.h"
-#include "rgrp.h"
-#include "super.h"
-#include "sys.h"
-#include "unlinked.h"
-
-#define DO 0
-#define UNDO 1
-
-extern struct dentry_operations gfs_dops;
-
-static struct gfs_sbd *init_sbd(struct super_block *sb)
-{
-	struct gfs_sbd *sdp;
-	unsigned int x;
-
-	sdp = vmalloc(sizeof(struct gfs_sbd));
-	if (!sdp)
-		return NULL;
-
-	memset(sdp, 0, sizeof(struct gfs_sbd));
-
-	set_v2sdp(sb, sdp);
-	sdp->sd_vfs = sb;
-	gfs_tune_init(&sdp->sd_tune);
-
-	/*  Init rgrp variables  */
-
-	INIT_LIST_HEAD(&sdp->sd_rglist);
-	init_MUTEX(&sdp->sd_rindex_lock);
-	INIT_LIST_HEAD(&sdp->sd_rg_mru_list);
-	spin_lock_init(&sdp->sd_rg_mru_lock);
-	INIT_LIST_HEAD(&sdp->sd_rg_recent);
-	spin_lock_init(&sdp->sd_rg_recent_lock);
-	spin_lock_init(&sdp->sd_rg_forward_lock);
-
-	spin_lock_init(&sdp->sd_statfs_spin);
-
-	for (x = 0; x < GFS_GL_HASH_SIZE; x++) {
-		sdp->sd_gl_hash[x].hb_lock = RW_LOCK_UNLOCKED;
-		INIT_LIST_HEAD(&sdp->sd_gl_hash[x].hb_list);
-	}
-
-	INIT_LIST_HEAD(&sdp->sd_reclaim_list);
-	spin_lock_init(&sdp->sd_reclaim_lock);
-	init_waitqueue_head(&sdp->sd_reclaim_wchan);
-
-	for (x = 0; x < GFS_MHC_HASH_SIZE; x++)
-		INIT_LIST_HEAD(&sdp->sd_mhc[x]);
-	INIT_LIST_HEAD(&sdp->sd_mhc_single);
-	spin_lock_init(&sdp->sd_mhc_lock);
-
-	for (x = 0; x < GFS_DEPEND_HASH_SIZE; x++)
-		INIT_LIST_HEAD(&sdp->sd_depend[x]);
-	spin_lock_init(&sdp->sd_depend_lock);
-
-	init_MUTEX(&sdp->sd_freeze_lock);
-
-	spin_lock_init(&sdp->sd_log_seg_lock);
-	INIT_LIST_HEAD(&sdp->sd_log_seg_list);
-	init_waitqueue_head(&sdp->sd_log_seg_wait);
-	INIT_LIST_HEAD(&sdp->sd_log_ail);
-	INIT_LIST_HEAD(&sdp->sd_log_incore);
-	init_rwsem(&sdp->sd_log_lock);
-	INIT_LIST_HEAD(&sdp->sd_unlinked_list);
-	spin_lock_init(&sdp->sd_unlinked_lock);
-	INIT_LIST_HEAD(&sdp->sd_quota_list);
-	spin_lock_init(&sdp->sd_quota_lock);
-
-	INIT_LIST_HEAD(&sdp->sd_dirty_j);
-	spin_lock_init(&sdp->sd_dirty_j_lock);
-
-	spin_lock_init(&sdp->sd_ail_lock);
-	INIT_LIST_HEAD(&sdp->sd_recovery_bufs);
-
-	return sdp;
-}
-
-static void init_vfs(struct super_block *sb, unsigned noatime)
-{
-	struct gfs_sbd *sdp = sb->s_fs_info;
-
-	/*  Set up Linux Virtual (VFS) Super Block  */
-
-	sb->s_magic = GFS_MAGIC;
-	sb->s_op = &gfs_super_ops;
-	sb->s_export_op = &gfs_export_ops;
-
-	/*  Don't let the VFS update atimes.  GFS handles this itself. */
-	sb->s_flags |= MS_NOATIME | MS_NODIRATIME;
-	sb->s_maxbytes = MAX_LFS_FILESIZE;
-
-	/*  If we were mounted with -o acl (to support POSIX access control
-	    lists), tell VFS */
-	if (sdp->sd_args.ar_posix_acls)
-		sb->s_flags |= MS_POSIXACL;
-}
-
-int init_names(struct gfs_sbd *sdp, int silent)
-{
-	struct gfs_sb *sb = NULL;
-	char *proto, *table;
-	int error = 0;
-
-	proto = sdp->sd_args.ar_lockproto;
-	table = sdp->sd_args.ar_locktable;
-
-	/*  Try to autodetect  */
-
-	if (!proto[0] || !table[0]) {
-		struct buffer_head *bh;
-
-		bh = sb_getblk(sdp->sd_vfs,
-			       GFS_SB_ADDR >> sdp->sd_fsb2bb_shift);
-		lock_buffer(bh);
-		clear_buffer_uptodate(bh);
-		clear_buffer_dirty(bh);
-		unlock_buffer(bh);
-		ll_rw_block(READ, 1, &bh);
-		wait_on_buffer(bh);
-
-		if (!buffer_uptodate(bh)) {
-			brelse(bh);
-			return -EIO;
-		}
-
-		sb = kmalloc(sizeof(struct gfs_sb), GFP_KERNEL);
-		if (!sb) {
-			brelse(bh);
-			return -ENOMEM;
-		}
-		gfs_sb_in(sb, bh->b_data); 
-		brelse(bh);
-
-		error = gfs_check_sb(sdp, sb, silent);
-		if (error)
-			goto out;
-
-		if (!proto[0])
-			proto = sb->sb_lockproto;
-		if (!table[0])
-			table = sb->sb_locktable;
-	}
-
-	if (!table[0])
-		table = sdp->sd_vfs->s_id;
-
-	snprintf(sdp->sd_proto_name, 256, "%s", proto);
-	snprintf(sdp->sd_table_name, 256, "%s", table);
-
-	while ((table = strchr(sdp->sd_table_name, '/')))
-		*table = '_';
-
- out:
-	kfree(sb);
-
-	return error;
-}
-
-static int init_locking(struct gfs_sbd *sdp, struct gfs_holder *mount_gh,
-						int undo)
-{
-	struct task_struct *p;
-	int error = 0;
-
-	if (undo)
-		goto fail_live;
-
-	if ((sdp->sd_lockstruct.ls_flags & LM_LSFLAG_LOCAL) &&
-	    !sdp->sd_args.ar_ignore_local_fs) {
-		/* Force local [p|f]locks */
-		sdp->sd_args.ar_localflocks = TRUE;
-
-		/* Force local read ahead and caching */
-		sdp->sd_args.ar_localcaching = TRUE;
-
-		/* Allow the machine to oops */
-		sdp->sd_args.ar_oopses_ok = TRUE;
-	}
-
-	/*  Start up the scand thread  */
-
-	p = kthread_run(gfs_scand, sdp, "gfs_scand");
-	error = IS_ERR(p);
-	if (error) {
-		printk("GFS: fsid=%s: can't start scand thread: %d\n",
-		       sdp->sd_fsname, error);
-		return error;
-	}
-	sdp->sd_scand_process = p;
-
-	/*  Start up the glockd thread  */
-
-	for (sdp->sd_glockd_num = 0;
-	     sdp->sd_glockd_num < sdp->sd_args.ar_num_glockd;
-	     sdp->sd_glockd_num++) {
-		p = kthread_run(gfs_glockd, sdp, "gfs_glockd");
-		error = IS_ERR(p);
-		if (error) {
-			printk("GFS: fsid=%s: can't start glockd thread: %d\n",
-			       sdp->sd_fsname, error);
-			goto fail;
-		}
-		sdp->sd_glockd_process[sdp->sd_glockd_num] = p;
-	}
-
-	/*  Only one node may mount at a time */
-	error = gfs_glock_nq_num(sdp,
-				 GFS_MOUNT_LOCK, &gfs_nondisk_glops,
-				 LM_ST_EXCLUSIVE, LM_FLAG_NOEXP | GL_NOCACHE,
-				 mount_gh);
-	if (error) {
-		printk("GFS: fsid=%s: can't acquire mount glock: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail;
-	}
-
-	/*  Show that cluster is alive */
-	error = gfs_glock_nq_num(sdp,
-				 GFS_LIVE_LOCK, &gfs_nondisk_glops,
-				 LM_ST_SHARED, LM_FLAG_NOEXP | GL_EXACT,
-				 &sdp->sd_live_gh);
-	if (error) {
-		printk("GFS: fsid=%s: can't acquire live glock: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_mount;
-	}
-
-	sdp->sd_live_gh.gh_owner = NULL;
-	return 0;
-
-fail_live:
-	gfs_glock_dq_uninit(&sdp->sd_live_gh);
-
-fail_mount:
-	gfs_glock_dq_uninit(mount_gh);
-
-fail:
-	while (sdp->sd_glockd_num--)
-		kthread_stop(sdp->sd_glockd_process[sdp->sd_glockd_num]);
-
-	kthread_stop(sdp->sd_scand_process);
-
-	return error;
-}
-
-static int init_sb(struct gfs_sbd *sdp, int silent, int undo)
-{
-	struct super_block *sb = sdp->sd_vfs;
-	struct gfs_holder sb_gh;
-	int error = 0;
-	struct inode *inode;
-
-	if (undo)
-		goto fail_dput;
-
-	/*  Read the SuperBlock from disk, get enough info to enable us
-	    to read-in the journal index and replay all journals. */
-
-	error = gfs_glock_nq_num(sdp,
-				 GFS_SB_LOCK, &gfs_meta_glops,
-				 (sdp->sd_args.ar_upgrade) ? LM_ST_EXCLUSIVE : LM_ST_SHARED,
-				 0, &sb_gh);
-	if (error) {
-		printk("GFS: fsid=%s: can't acquire superblock glock: %d\n",
-		       sdp->sd_fsname, error);
-		return error;
-	}
-
-	error = gfs_read_sb(sdp, sb_gh.gh_gl, silent);
-	if (error) {
-		printk("GFS: fsid=%s: can't read superblock: %d\n",
-		       sdp->sd_fsname, error);
-		goto out;
-	}
-
-	/*  Set up the buffer cache and SB for real, now that we know block
-	      sizes, version #s, locations of important on-disk inodes, etc.  */
-
-	error = -EINVAL;
-	if (sdp->sd_sb.sb_bsize < bdev_logical_block_size(sb->s_bdev)) {
-		printk("GFS: fsid=%s: FS block size (%u) is too small for device block size (%u)\n",
-		       sdp->sd_fsname, sdp->sd_sb.sb_bsize, bdev_logical_block_size(sb->s_bdev));
-		goto fail;
-	}
-	if (sdp->sd_sb.sb_bsize > PAGE_SIZE) {
-		printk("GFS: fsid=%s: FS block size (%u) is too big for machine page size (%u)\n",
-		       sdp->sd_fsname, sdp->sd_sb.sb_bsize,
-		       (unsigned int)PAGE_SIZE);
-		goto fail;
-	}
-
-	/*  Get rid of buffers from the original block size  */
-	sb_gh.gh_gl->gl_ops->go_inval(sb_gh.gh_gl, DIO_METADATA | DIO_DATA);
-	sb_gh.gh_gl->gl_aspace->i_blkbits = sdp->sd_sb.sb_bsize_shift;
-
-	sb_set_blocksize(sb, sdp->sd_sb.sb_bsize);
-
-	/*  Read in the resource index inode  */
-
-	error = gfs_get_riinode(sdp);
-	if (error) {
-		printk("GFS: fsid=%s: can't get resource index inode: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail;
-	}
-
-	/*  Get the root inode  */
-	error = gfs_get_rootinode(sdp);
-	if (error) {
-		printk("GFS: fsid=%s: can't read in root inode: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_ri_free;
-	}
-	/*  Get the root inode/dentry  */
-
-	inode = gfs_iget(sdp->sd_rooti, CREATE);
-	if (!inode) {
-		printk("GFS: fsid=%s: can't get root inode\n", sdp->sd_fsname);
-		error = -ENOMEM;
-		goto fail_ri_free;
-	}
-	sb->s_root = d_alloc_root(inode);
-	if (!sb->s_root) {
-		iput(inode);
-		printk("GFS: fsid=%s: can't get root dentry\n", sdp->sd_fsname);
-		error = -ENOMEM;
-		goto fail_root_free;
-	}
-	sb->s_root->d_op = &gfs_dops;
-
-	/*  Read in the quota inode  */
-	error = gfs_get_qinode(sdp);
-	if (error) {
-		printk("GFS: fsid=%s: can't get quota file inode: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_root_free;
-	}
-
-	/* Implement fast statfs on the unused license inode location.
-	 * sb->sb_quota_di.no_formal_ino = jindex_dinode + 2;
-	 * sb->sb_quota_di.no_addr = jindex_dinode + 2;
-	 * sb->sb_license_di.no_formal_ino = jindex_dinode + 3;
-	 * sb->sb_license_di.no_addr = jindex_dinode + 3;
-	 */
-	error = gfs_get_linode(sdp);
-	if (error) {
-		printk("GFS: fsid=%s: can't get statfs file inode: %d\n",
-				sdp->sd_fsname, error);
-		goto fail_qi_free;
-	}
-
-	/*  We're through with the superblock lock  */
-out:
-	gfs_glock_dq_uninit(&sb_gh);
-	return error;
-
-fail_dput:
-	gfs_inode_put(sdp->sd_linode);
-	if (sb->s_root) {
-		dput(sb->s_root);
-		sb->s_root = NULL;
-	}
-fail_qi_free:
-	gfs_inode_put(sdp->sd_qinode);
-fail_root_free:
-	gfs_inode_put(sdp->sd_rooti);
-fail_ri_free:
-	gfs_inode_put(sdp->sd_riinode);
-	gfs_clear_rgrpd(sdp);
-fail:
-	if (!undo)
-		gfs_glock_dq_uninit(&sb_gh);
-	return error;
-}
-
-static int init_journal(struct gfs_sbd *sdp, int undo)
-{
-	struct gfs_holder ji_gh;
-	int error = 0;
-	unsigned int x;
-	int jindex = TRUE;
-	struct task_struct *p;
-
-	if (undo) {
-		jindex = 0;
-		goto fail_recoverd;
-	}
-
-	init_MUTEX(&sdp->sd_jindex_lock);
-
-	/*  Get a handle on the transaction glock; we need this for disk format
-	    upgrade and journal replays, as well as normal operation.  */
-
-	error = gfs_glock_get(sdp, GFS_TRANS_LOCK, &gfs_trans_glops,
-			      CREATE, &sdp->sd_trans_gl);
-	if (error)
-		return error;
-	set_bit(GLF_STICKY, &sdp->sd_trans_gl->gl_flags);
-
-	/*  Load in the journal index special file */
-
-	error = gfs_jindex_hold(sdp, &ji_gh);
-	if (error) {
-		printk("GFS: fsid=%s: can't read journal index: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_jhold;
-	}
-
-	if (sdp->sd_args.ar_spectator) {
-		sdp->sd_jdesc = sdp->sd_jindex[0];
-		sdp->sd_log_seg_free = sdp->sd_jdesc.ji_nsegment;
-		sdp->sd_log_seg_ail2 = 0;
-	}
-	else {
-		/*  Discover this node's journal number (lock module tells us
-		    which one to use), and lock it */
-		error = -EUSERS;
-		if (sdp->sd_lockstruct.ls_jid >= sdp->sd_journals) {
-			printk("GFS: fsid=%s: can't mount journal #%u\n",
-			       sdp->sd_fsname, sdp->sd_lockstruct.ls_jid);
-			printk("GFS: fsid=%s: there are only %u journals (0 - %u)\n",
-			       sdp->sd_fsname, sdp->sd_journals, sdp->sd_journals - 1);
-			goto fail_jindex;
-		}
-		sdp->sd_jdesc = sdp->sd_jindex[sdp->sd_lockstruct.ls_jid];
-		sdp->sd_log_seg_free = sdp->sd_jdesc.ji_nsegment;
-		sdp->sd_log_seg_ail2 = 0;
-
-		error = gfs_glock_nq_num(sdp,
-					 sdp->sd_jdesc.ji_addr, &gfs_meta_glops,
-					 LM_ST_EXCLUSIVE, LM_FLAG_NOEXP,
-					 &sdp->sd_journal_gh);
-		if (error) {
-			printk("GFS: fsid=%s: can't acquire the journal glock: %d\n",
-			       sdp->sd_fsname, error);
-			goto fail_jindex;
-		}
-	}
-
-	if (sdp->sd_lockstruct.ls_first) {
-		/*  We're first node within cluster to mount this filesystem,
-		    replay ALL of the journals, then let lock module know
-		    that we're done. */
-		for (x = 0; x < sdp->sd_journals; x++) {
-			error = gfs_recover_journal(sdp,
-						    x, sdp->sd_jindex + x,
-						    FALSE);
-			if (error) {
-				printk("GFS: fsid=%s: error recovering journal %u: %d\n",
-				       sdp->sd_fsname, x, error);
-				goto fail_journal_gh;
-			}
-		}
-
-		gfs_lm_others_may_mount(sdp);
-	} else if (!sdp->sd_args.ar_spectator) {
-		/*  We're not the first; replay only our own journal. */
-		error = gfs_recover_journal(sdp, sdp->sd_lockstruct.ls_jid,
-									&sdp->sd_jdesc, TRUE);
-		if (error) {
-			printk("GFS: fsid=%s: error recovering my journal: %d\n",
-			       sdp->sd_fsname, error);
-			goto fail_journal_gh;
-		}
-	}
-
-	gfs_glock_dq_uninit(&ji_gh);
-	jindex = FALSE;
-
-	/*  Disown my Journal glock  */
-	sdp->sd_journal_gh.gh_owner = NULL;
-
-	/*  Make the FS read/write  */
-
-	if (!test_bit(SDF_ROFS, &sdp->sd_flags)) {
-		error = gfs_make_fs_rw(sdp);
-		if (error) {
-			printk("GFS: fsid=%s: can't make file system RW: %d\n",
-			       sdp->sd_fsname, error);
-			goto fail_journal_gh;
-		}
-	}
-
-	/*  Start up the journal recovery thread  */
-
-	p = kthread_run(gfs_recoverd, sdp, "gfs_recoverd");
-	error = IS_ERR(p);
-	if (error) {
-		printk("GFS: fsid=%s: can't start recoverd thread: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_journal_gh;
-	}
-	sdp->sd_recoverd_process = p;
-
-	return 0;
-
-fail_recoverd:
-	kthread_stop(sdp->sd_recoverd_process);
-	sdp->sd_recoverd_process = NULL;
-
-fail_journal_gh:
-	if (!sdp->sd_args.ar_spectator)
-		gfs_glock_dq_uninit(&sdp->sd_journal_gh);
-
-fail_jindex:
-	if (jindex)
-		gfs_glock_dq_uninit(&ji_gh);
-
-fail_jhold:
-	gfs_glock_put(sdp->sd_trans_gl);
-	return error;
-}
-
-static int init_threads(struct gfs_sbd *sdp, int undo)
-{
-	struct task_struct *p;
-	int error = 0;
-
-	if (undo)
-		goto fail_logd;
-
-	sdp->sd_jindex_refresh_time = jiffies;
-
-	/*  Start up the logd thread  */
-	p = kthread_run(gfs_logd, sdp, "gfs_logd");
-	error = IS_ERR(p);
-	if (error) {
-		printk("GFS: fsid=%s: can't start logd thread: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail;
-	}
-	sdp->sd_logd_process = p;
-
-	/*  Start up the quotad thread  */
-
-	p = kthread_run(gfs_quotad, sdp, "gfs_quotad");
-	if (error < 0) {
-		printk("GFS: fsid=%s: can't start quotad thread: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_quotad;
-	}
-	sdp->sd_quotad_process = p;
-
-	/*  Start up the inoded thread  */
-
-	p = kthread_run(gfs_inoded, sdp, "gfs_inoded");
-	if (error < 0) {
-		printk("GFS: fsid=%s: can't start inoded thread: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_inoded;
-	}
-	sdp->sd_inoded_process = p;
-	return 0;
-
-fail_logd:
-	kthread_stop(sdp->sd_inoded_process);
-fail_inoded:
-	kthread_stop(sdp->sd_quotad_process);
-fail_quotad:
-	kthread_stop(sdp->sd_logd_process);
-fail:
-	return error;
-}
-
-void gfs_online_uevent(struct gfs_sbd *sdp)
-{
-	struct super_block *sb = sdp->sd_vfs;
-	char ro[20];
-	char spectator[20];
-	char *envp[] = { ro, spectator, NULL };
-	sprintf(ro, "RDONLY=%d", (sb->s_flags & MS_RDONLY) ? 1 : 0);
-	sprintf(spectator, "SPECTATOR=%d", sdp->sd_args.ar_spectator ? 1 : 0);
-	kobject_uevent_env(&sdp->sd_kobj, KOBJ_ONLINE, envp);
-}
-
-/**
- * fill_super - Read in superblock
- * @sb: The VFS superblock
- * @data: Mount options
- * @silent: Don't complain if it's not a GFS filesystem
- *
- * Returns: errno
- *
- * After cross-linking Linux VFS incore superblock and our GFS incore
- *   superblock (filesystem instance structures) to one another, we:
- * -- Init some of our GFS incore superblock, including some temporary
- *       block-size values (enough to read on-disk superblock).
- * -- Set up some things in Linux VFS superblock.
- * -- Mount a lock module, init glock system (incl. glock reclaim daemons),
- *       and init some important inter-node locks (MOUNT, LIVE, SuperBlock).
- * -- Read-in the GFS on-disk superblock (1st time, to get enough info
- *       to do filesystem upgrade and journal replay, incl. journal index).
- * -- Upgrade on-disk filesystem format (rarely needed).
- * -- Replay journals (always; replay *all* journals if we're first-to-mount).
- * -- Read-in on-disk superblock and journal index special file again
- *       (2nd time, assumed 100% valid now after journal replay).
- * -- Read-in info on other special (hidden) files (root inode, resource index,
- *       quota inode, license inode).
- * -- Start other daemons (journal/log recovery, log tail, quota updates, inode
- *       reclaim) for periodic maintenance.
- * 
- */
-
-static int fill_super(struct super_block *sb, void *data, int silent)
-{
-	struct gfs_sbd *sdp;
-	struct gfs_holder mount_gh;
-	int error;
-
-	sdp = init_sbd(sb);
-	if (!sdp) {
-		printk(KERN_WARNING "GFS: can't alloc struct gfs_sbd\n");
-		return -ENOMEM;
-	}
-
-	error = gfs_make_args((char *)data, &sdp->sd_args, FALSE);
-	if (error) {
-		printk("GFS: can't parse mount arguments\n");
-		goto fail;
-	}
-
-	if (sdp->sd_args.ar_spectator) {
-		sb->s_flags |= MS_RDONLY;
-		set_bit(SDF_ROFS, &sdp->sd_flags);
-	}
-
-	/*  Copy VFS mount flags  */
-
-	if (sdp->sd_args.ar_noatime)
-		set_bit(SDF_NOATIME, &sdp->sd_flags);
-	if (sb->s_flags & MS_RDONLY)
-		set_bit(SDF_ROFS, &sdp->sd_flags);
-
-	init_vfs(sb, SDF_NOATIME);
-
-	/*  Turn off quota stuff if we get the noquota mount option, don't 
-	    need to grab the sd_tune lock here since its before anything 
-	    touches the sd_tune values */
-	if (sdp->sd_args.ar_noquota) {
-		sdp->sd_tune.gt_quota_enforce = 0;
-		sdp->sd_tune.gt_quota_account = 0;
-	}
-
-	/*  Set up the buffer cache and fill in some fake block size values
-	   to allow us to read-in the on-disk superblock.  */
-
-	sdp->sd_sb.sb_bsize = sb_min_blocksize(sb, GFS_BASIC_BLOCK);
-	sdp->sd_sb.sb_bsize_shift = sb->s_blocksize_bits;
-	sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - GFS_BASIC_BLOCK_SHIFT;
-	sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
-
-	if (sizeof(struct gfs_sb) > sdp->sd_sb.sb_bsize) {
-		printk("GFS: sizeof(struct gfs_sb) > sdp->sd_sb.sb_bsize\n"
-		       "GFS: %u > %u\n",
-		       (unsigned int)sizeof(struct gfs_sb), sdp->sd_sb.sb_bsize);
-		error = -EINVAL;
-		goto fail;
-	}
-	error = init_names(sdp, silent);
-	if (error)
-		goto fail;
-
-	error = gfs_sys_fs_add(sdp);
-	if (error)
-		goto fail;
-
-	/*  Mount an inter-node lock module, check for local optimizations */
-
-	error = gfs_lm_mount(sdp, silent);
-	if (error)
-		goto fail_sys;
-
-	error = init_locking(sdp, &mount_gh, DO);
-	if (error)
-		goto fail_lm;
-
-	error = init_sb(sdp, silent, DO);
-	if (error)
-		goto fail_locking;
-
-	/*  Read-in journal index inode (but not the file contents, yet)  */
-
-	error = gfs_get_jiinode(sdp);
-	if (error) {
-		printk("GFS: fsid=%s: can't get journal index inode: %d\n",
-		       sdp->sd_fsname, error);
-		goto fail_jiinode;
-	}
-
-	error = init_journal(sdp, DO);
-	if (error)
-		goto fail_sb;
-	/*  Get a handle on the rename lock  */
-
-	error = gfs_glock_get(sdp, GFS_RENAME_LOCK, &gfs_nondisk_glops,
-						  CREATE, &sdp->sd_rename_gl);
-	if (error)
-		goto fail_journal;
-
-	error = init_threads(sdp, DO);
-	if (error)
-		goto fail_journal;
-
-	gfs_proc_fs_add(sdp);
-	gfs_glock_dq_uninit(&mount_gh);
-	gfs_online_uevent(sdp);
-
-	return 0;
-
-fail_journal:
-	init_journal(sdp, UNDO);
-
-fail_sb:
-	gfs_inode_put(sdp->sd_jiinode);
-
-fail_jiinode:
-	init_sb(sdp, 0, UNDO);
-
-fail_locking:
-	init_locking(sdp, &mount_gh, UNDO);
-
-fail_lm:
-	gfs_gl_hash_clear(sdp, TRUE);
-	gfs_lm_unmount(sdp);
-	gfs_clear_dirty_j(sdp);
-	while (invalidate_inodes(sb))
-		yield();
-
-fail_sys:
-	gfs_sys_fs_del(sdp);
-
-fail:
-	vfree(sdp);
-	sb->s_fs_info = NULL;
-
-	return error;
-}
-
-/**
- * gfs_test_bdev_super - 
- * @sb:
- * @data:
- *
- */
-
-int
-gfs_test_bdev_super(struct super_block *sb, void *data)
-{
-	return (void *)sb->s_bdev == data;
-}
-
-/**
- * gfs_test_bdev_super -
- * @sb:
- * @data:
- *
- */
-
-int
-gfs_set_bdev_super(struct super_block *sb, void *data)
-{
-	sb->s_bdev = data;
-	sb->s_dev = sb->s_bdev->bd_dev;
-	return 0;
-}
-
-/**
- * gfs_get_sb - 
- * @fs_type:
- * @flags:
- * @dev_name:
- * @data:
- *
- * Rip off of get_sb_bdev().
- *
- * Returns: the new superblock
- */
-
-static int gfs_get_sb(struct file_system_type *fs_type, int flags,
-					  const char *dev_name, void *data, struct vfsmount *mnt)
-{
-	return get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt);
-}
-
-/**
- * gfs_kill_sb - 
- * @sb:
- *
- * Rip off of kill_block_super().
- *
- */
-
-void
-gfs_kill_sb(struct super_block *sb)
-{
-	kill_block_super(sb);
-}
-
-struct file_system_type gfs_fs_type = {
-	.name = "gfs",
-	.fs_flags = FS_REQUIRES_DEV,
-	.get_sb = gfs_get_sb,
-	.kill_sb = gfs_kill_sb,
-	.owner = THIS_MODULE,
-};
diff --git a/gfs-kernel/src/gfs/ops_fstype.h b/gfs-kernel/src/gfs/ops_fstype.h
deleted file mode 100644
index 6d97022..0000000
--- a/gfs-kernel/src/gfs/ops_fstype.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __OPS_FSTYPE_DOT_H__
-#define __OPS_FSTYPE_DOT_H__
-
-int gfs_sys_init(void);
-void gfs_sys_uninit(void);
-void gfs_sys_fs_del(struct gfs_sbd *sdp);
-int gfs_test_bdev_super(struct super_block *sb, void *data);
-int gfs_set_bdev_super(struct super_block *sb, void *data);
-int init_names(struct gfs_sbd *sdp, int silent);
-
-extern struct file_system_type gfs_fs_type;
-
-#endif /* __OPS_FSTYPE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_inode.c b/gfs-kernel/src/gfs/ops_inode.c
deleted file mode 100644
index bac215c..0000000
--- a/gfs-kernel/src/gfs/ops_inode.c
+++ /dev/null
@@ -1,1680 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/namei.h>
-#include <linux/utsname.h>
-#include <asm/uaccess.h>
-#include <linux/mm.h>
-#include <linux/xattr.h>
-#include <linux/posix_acl.h>
-#include <linux/security.h>
-#include <linux/cred.h>
-
-#include "gfs.h"
-#include "acl.h"
-#include "bmap.h"
-#include "dio.h"
-#include "dir.h"
-#include "eaops.h"
-#include "eattr.h"
-#include "glock.h"
-#include "inode.h"
-#include "ops_dentry.h"
-#include "ops_inode.h"
-#include "page.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-#include "unlinked.h"
-
-/**
- * gfs_security_init -
- * @dip:
- * @ip:
- *
- * Returns: errno
- */
-
-static int
-gfs_security_init(struct gfs_inode *dip, struct gfs_inode *ip)
-{
-	int err;
-	size_t len;
-	void *value;
-	char *name;
-	struct gfs_ea_request er;
-
-	err = security_inode_init_security(ip->i_vnode, dip->i_vnode,
-					   &name, &value, &len);
-
-	if (err) {
-		if (err == -EOPNOTSUPP)
-			return 0;
-		return err;
-	}
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-
-	er.er_type = GFS_EATYPE_SECURITY;
-	er.er_name = name;
-	er.er_data = value;
-	er.er_name_len = strlen(name);
-	er.er_data_len = len;
-
-	err = gfs_ea_set_i(ip, &er);
-
-	kfree(value);
-	kfree(name);
-
-	return err;
-}
-
-/**
- * gfs_create - Create a file
- * @dir: The directory in which to create the file
- * @dentry: The dentry of the new file
- * @mode: The mode of the new file
- *
- * Returns: errno
- */
-
-static int
-gfs_create(struct inode *dir, struct dentry *dentry,
-	   int mode, struct nameidata *nd)
-{
-	struct gfs_inode *dip = get_v2ip(dir), *ip;
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_holder d_gh, i_gh;
-	struct inode *inode;
-	int new = TRUE;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	gfs_holder_init(dip->i_gl, 0, 0, &d_gh);
-
-	for (;;) {
-		error = gfs_createi(&d_gh, &dentry->d_name,
-				    GFS_FILE_REG, mode,
-				    &i_gh);
-		if (!error)
-			break;
-		else if (error != -EEXIST ||
-			 (nd && (nd->intent.open.flags & O_EXCL))) {
-			gfs_holder_uninit(&d_gh);
-			return error;
-		}
-
-		error = gfs_lookupi(&d_gh, &dentry->d_name,
-				    FALSE, &i_gh);
-		if (!error) {
-			if (i_gh.gh_gl) {
-				new = FALSE;
-				break;
-			}
-		} else {
-			gfs_holder_uninit(&d_gh);
-			return error;
-		}
-	}
-
-	ip = get_gl2ip(i_gh.gh_gl);
-
-	if (new) {
-		gfs_trans_end(sdp);
-		if (dip->i_alloc->al_rgd)
-			gfs_inplace_release(dip);
-		gfs_quota_unlock_m(dip);
-		gfs_unlinked_unlock(sdp, dip->i_alloc->al_ul);
-		gfs_alloc_put(dip);
-	}
-
-	inode = gfs_iget(ip, CREATE);
-	gfs_inode_put(ip);
-
-	if (!inode)
-		error = -ENOMEM;
-	else if (new)
-		error = gfs_security_init(dip, ip);
-
-	gfs_glock_dq_uninit(&d_gh);
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (error)
-		return error;
-
-	d_instantiate(dentry, inode);
-	if (new)
-		mark_inode_dirty(inode);
-
-	return 0;
-}
-
-/**
- * lookup_cdpn_sub_at - Maybe lookup a Context Dependent Pathname
- * @sdp: the filesystem
- * @dentry: the original dentry to lookup
- * @new_dentry: the new dentry, if this was a substitutable path.
- *
- * Returns: the new dentry, a ERR_PTR, or NULL
- */
-
-static struct dentry *
-lookup_cdpn_sub_at(struct gfs_sbd *sdp, struct dentry *dentry)
-{
-	struct dentry *parent, *new = NULL;
-	char *buf;
-
-	buf = kmalloc(2 * __NEW_UTS_LEN + 2, GFP_KERNEL);
-	if (!buf)
-		return ERR_PTR(-ENOMEM);
-
-	parent = dget_parent(dentry);
-
-	if (gfs_filecmp(&dentry->d_name, "@hostname", 9))
-		new = lookup_one_len(init_utsname()->nodename,
-				     parent,
-				     strlen(init_utsname()->nodename));
-	else if (gfs_filecmp(&dentry->d_name, "@mach", 5))
-		new = lookup_one_len(init_utsname()->machine,
-				     parent,
-				     strlen(init_utsname()->machine));
-	else if (gfs_filecmp(&dentry->d_name, "@os", 3))
-		new = lookup_one_len(init_utsname()->sysname,
-				     parent,
-				     strlen(init_utsname()->sysname));
-	else if (gfs_filecmp(&dentry->d_name, "@uid", 4))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%u", current_fsuid()));
-	else if (gfs_filecmp(&dentry->d_name, "@gid", 4))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%u", current_fsgid()));
-	else if (gfs_filecmp(&dentry->d_name, "@sys", 4))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%s_%s",
-					     init_utsname()->machine,
-					     init_utsname()->sysname));
-	else if (gfs_filecmp(&dentry->d_name, "@jid", 4))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%u",
-					     sdp->sd_lockstruct.ls_jid));
-
-	dput(parent);
-	kfree(buf);
-
-	return new;
-}
-
-/**
- * lookup_cdpn_sub_brace - Maybe lookup a Context Dependent Pathname
- * @sdp: the filesystem
- * @dentry: the original dentry to lookup
- * @new_dentry: the new dentry, if this was a substitutable path.
- *
- * Returns: the new dentry, a ERR_PTR, or NULL
- */
-
-static struct dentry *
-lookup_cdpn_sub_brace(struct gfs_sbd *sdp, struct dentry *dentry)
-{
-	struct dentry *parent, *new = NULL;
-	char *buf;
-
-	buf = kmalloc(2 * __NEW_UTS_LEN + 2, GFP_KERNEL);
-	if (!buf)
-		return ERR_PTR(-ENOMEM);
-
-	parent = dget_parent(dentry);
-
-	if (gfs_filecmp(&dentry->d_name, "{hostname}", 10))
-		new = lookup_one_len(init_utsname()->nodename,
-				     parent,
-				     strlen(init_utsname()->nodename));
-	else if (gfs_filecmp(&dentry->d_name, "{mach}", 6))
-		new = lookup_one_len(init_utsname()->machine,
-				     parent,
-				     strlen(init_utsname()->machine));
-	else if (gfs_filecmp(&dentry->d_name, "{os}", 4))
-		new = lookup_one_len(init_utsname()->sysname,
-				     parent,
-				     strlen(init_utsname()->sysname));
-	else if (gfs_filecmp(&dentry->d_name, "{uid}", 5))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%u", current_fsuid()));
-	else if (gfs_filecmp(&dentry->d_name, "{gid}", 5))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%u", current_fsgid()));
-	else if (gfs_filecmp(&dentry->d_name, "{sys}", 5))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%s_%s",
-					     init_utsname()->machine,
-					     init_utsname()->sysname));
-	else if (gfs_filecmp(&dentry->d_name, "{jid}", 5))
-		new = lookup_one_len(buf,
-				     parent,
-				     sprintf(buf, "%u",
-					     sdp->sd_lockstruct.ls_jid));
-
-	dput(parent);
-	kfree(buf);
-
-	return new;
-}
-
-/**
- * gfs_lookup - Look up a filename in a directory and return its inode
- * @dir: The directory inode
- * @dentry: The dentry of the new inode
- * @nd: passed from Linux VFS, ignored by us
- *
- * Called by the VFS layer. Lock dir and call gfs_lookupi()
- *
- * Returns: errno
- */
-
-static struct dentry *
-gfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
-{
-	struct gfs_inode *dip = get_v2ip(dir), *ip;
-	struct gfs_holder d_gh, i_gh;
-	struct inode *inode = NULL;
-	int error;
-
-	atomic_inc(&dip->i_sbd->sd_ops_inode);
-
-	/*  Do Context Dependent Path Name expansion  */
-
-	if (*dentry->d_name.name == '@' && dentry->d_name.len > 1) {
-		struct dentry *new_dentry;
-		new_dentry = lookup_cdpn_sub_at(dip->i_sbd, dentry);
-		if (new_dentry)
-			return new_dentry;
-	} else if (*dentry->d_name.name == '{' && dentry->d_name.len > 2) {
-		struct dentry *new_dentry;
-		new_dentry = lookup_cdpn_sub_brace(dip->i_sbd, dentry);
-		if (new_dentry)
-			return new_dentry;
-	}
-
-	dentry->d_op = &gfs_dops;
-
-	gfs_holder_init(dip->i_gl, 0, 0, &d_gh);
-
-	error = gfs_lookupi(&d_gh, &dentry->d_name, FALSE, &i_gh);
-	if (error) {
-		gfs_holder_uninit(&d_gh);
-		return ERR_PTR(error);
-	}
-
-	if (i_gh.gh_gl) {
-		ip = get_gl2ip(i_gh.gh_gl);
-
-		inode = gfs_iget(ip, CREATE);
-		gfs_inode_put(ip);
-
-		gfs_glock_dq_uninit(&d_gh);
-		gfs_glock_dq_uninit(&i_gh);
-
-		if (!inode)
-			return ERR_PTR(-ENOMEM);
-	} else
-		gfs_holder_uninit(&d_gh);
-
-	if (inode)
-		return d_splice_alias(inode, dentry);
-	d_add(dentry, inode);
-
-	return NULL;
-}
-
-/**
- * gfs_link - Link to a file
- * @old_dentry: The inode to link
- * @dir: Add link to this directory
- * @dentry: The name of the link
- *
- * Link the inode in "old_dentry" into the directory "dir" with the
- * name in "dentry".
- *
- * Returns: errno
- */
-
-static int
-gfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
-{
-	struct gfs_inode *dip = get_v2ip(dir);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct inode *inode = old_dentry->d_inode;
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_alloc *al = NULL;
-	struct gfs_holder ghs[2];
-	int alloc_required;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	if (ip->i_di.di_type == GFS_FILE_DIR)
-		return -EPERM;
-
-	gfs_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[0]);
-	gfs_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[1]);
-
-	error = gfs_glock_nq_m(2, ghs);
-	if (error)
-		goto fail;
-
-	error = inode_permission(dir, MAY_WRITE | MAY_EXEC);
-	if (error)
-		goto fail_gunlock;
-
-	error = gfs_dir_search(dip, &dentry->d_name, NULL, NULL);
-	switch (error) {
-	case -ENOENT:
-		break;
-	case 0:
-		error = -EEXIST;
-	default:
-		goto fail_gunlock;
-	}
-
-	if (!dip->i_di.di_nlink) {
-		error = -EINVAL;
-		goto fail_gunlock;
-	}
-	if (dip->i_di.di_entries == (uint32_t)-1) {
-		error = -EFBIG;
-		goto fail_gunlock;
-	}
-	if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) {
-		error = -EPERM;
-		goto fail_gunlock;
-	}
-	if (!ip->i_di.di_nlink) {
-		error = -EINVAL;
-		goto fail_gunlock;
-	}
-	if (ip->i_di.di_nlink == (uint32_t)-1) {
-		error = -EMLINK;
-		goto fail_gunlock;
-	}
-
-	error = gfs_diradd_alloc_required(dip, &dentry->d_name, &alloc_required);
-	if (error)
-		goto fail_gunlock;
-
-	if (alloc_required) {
-		al = gfs_alloc_get(dip);
-
-		error = gfs_quota_lock_m(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-		if (error)
-			goto fail_alloc;
-
-		error = gfs_quota_check(dip, dip->i_di.di_uid, dip->i_di.di_gid);
-		if (error)
-			goto fail_gunlock_q;
-
-		al->al_requested_meta = sdp->sd_max_dirres;
-
-		error = gfs_inplace_reserve(dip);
-		if (error)
-			goto fail_gunlock_q;
-
-		/* Trans may require:
-		   two dinode blocks, directory modifications to add an entry,
-		   RG bitmap blocks to allocate from, and quota change */
-
-		error = gfs_trans_begin(sdp,
-					2 + sdp->sd_max_dirres +
-					al->al_rgd->rd_ri.ri_length,
-					1);
-		if (error)
-			goto fail_ipres;
-	} else {
-		/*  Trans may require:
-		    Two dinode blocks and a leaf block.  */
-
-		error = gfs_trans_begin(sdp, 3, 0);
-		if (error)
-			goto fail_ipres;
-	}
-
-	error = gfs_dir_add(dip, &dentry->d_name, &ip->i_num, ip->i_di.di_type);
-	if (error)
-		goto fail_end_trans;
-
-	error = gfs_change_nlink(ip, +1);
-	if (error)
-		goto fail_end_trans;
-
-	gfs_trans_end(sdp);
-
-	if (alloc_required) {
-		gfs_assert_warn(sdp, al->al_alloced_meta);
-		gfs_inplace_release(dip);
-		gfs_quota_unlock_m(dip);
-		gfs_alloc_put(dip);
-	}
-
-	gfs_glock_dq_m(2, ghs);
-
-	gfs_holder_uninit(&ghs[0]);
-	gfs_holder_uninit(&ghs[1]);
-
-	atomic_inc(&inode->i_count);
-
-	d_instantiate(dentry, inode);
-	mark_inode_dirty(inode);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_ipres:
-	if (alloc_required)
-		gfs_inplace_release(dip);
-
- fail_gunlock_q:
-	if (alloc_required)
-		gfs_quota_unlock_m(dip);
-
- fail_alloc:
-	if (alloc_required)
-		gfs_alloc_put(dip);
-
- fail_gunlock:
-	gfs_glock_dq_m(2, ghs);
-
- fail:
-	gfs_holder_uninit(&ghs[0]);
-	gfs_holder_uninit(&ghs[1]);
-
-	return error;
-}
-
-/**
- * gfs_unlink - Unlink a file
- * @dir: The inode of the directory containing the file to unlink
- * @dentry: The file itself
- *
- * Unlink a file.  Call gfs_unlinki()
- *
- * Returns: errno
- */
-
-static int
-gfs_unlink(struct inode *dir, struct dentry *dentry)
-{
-	struct gfs_inode *dip = get_v2ip(dir);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_inode *ip = get_v2ip(dentry->d_inode);
-	struct gfs_holder ghs[2];
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	gfs_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[0]);
-	gfs_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[1]);
-
-	error = gfs_glock_nq_m(2, ghs);
-	if (error)
-		goto fail;
-
-	error = gfs_unlink_ok(dip, &dentry->d_name, ip);
-	if (error)
-		goto fail_gunlock;
-
-	/*  Trans may require:
-	    Two dinode blocks and one modified directory leaf block
-	    and one unlinked tag.  */
-
-	error = gfs_trans_begin(sdp, 3, 1);
-	if (error)
-		goto fail_gunlock;
-
-	error = gfs_unlinki(dip, &dentry->d_name, ip);
-	if (error)
-		goto fail_end_trans;
-
-	gfs_trans_end(sdp);
-
-	gfs_glock_dq_m(2, ghs);
-
-	gfs_holder_uninit(&ghs[0]);
-	gfs_holder_uninit(&ghs[1]);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_gunlock:
-	gfs_glock_dq_m(2, ghs);
-
- fail:
-	gfs_holder_uninit(&ghs[0]);
-	gfs_holder_uninit(&ghs[1]);
-
-	return error;
-}
-
-/**
- * gfs_symlink - Create a symlink
- * @dir: The directory to create the symlink in
- * @dentry: The dentry to put the symlink in
- * @symname: The thing which the link points to
- *
- * Returns: errno
- */
-
-static int
-gfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
-{
-	struct gfs_inode *dip = get_v2ip(dir), *ip;
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_holder d_gh, i_gh;
-	struct inode *inode;
-	struct buffer_head *dibh;
-	int size;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	/* Must be stuffed with a null terminator for gfs_follow_link() */
-	size = strlen(symname);
-	if (size > sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode) - 1)
-	        return -ENAMETOOLONG;
-
-	gfs_holder_init(dip->i_gl, 0, 0, &d_gh);
-
-	error = gfs_createi(&d_gh, &dentry->d_name,
-			    GFS_FILE_LNK, S_IFLNK | S_IRWXUGO,
-			    &i_gh);
-	if (error) {
-		gfs_holder_uninit(&d_gh);
-		return error;
-	}
-
-	ip = get_gl2ip(i_gh.gh_gl);
-
-	ip->i_di.di_size = size;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-
-	if (!gfs_assert_withdraw(sdp, !error)) {
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		memcpy(dibh->b_data + sizeof(struct gfs_dinode), symname, size);
-		brelse(dibh);
-	}
-
-	gfs_trans_end(sdp);
-	if (dip->i_alloc->al_rgd)
-		gfs_inplace_release(dip);
-	gfs_quota_unlock_m(dip);
-	gfs_unlinked_unlock(sdp, dip->i_alloc->al_ul);
-	gfs_alloc_put(dip);
-
-	inode = gfs_iget(ip, CREATE);
-	gfs_inode_put(ip);
-
-	error = gfs_security_init(dip, ip);
-
-	gfs_glock_dq_uninit(&d_gh);
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (error)
-		return error;
-
-	if (!inode)
-		return -ENOMEM;
-
-	d_instantiate(dentry, inode);
-	mark_inode_dirty(inode);
-
-	return 0;
-}
-
-/**
- * gfs_mkdir - Make a directory
- * @dir: The parent directory of the new one
- * @dentry: The dentry of the new directory
- * @mode: The mode of the new directory
- *
- * Returns: errno
- */
-
-static int
-gfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
-{
-	struct gfs_inode *dip = get_v2ip(dir), *ip;
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_holder d_gh, i_gh;
-	struct inode *inode;
-	struct buffer_head *dibh;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	gfs_holder_init(dip->i_gl, 0, 0, &d_gh);
-
-	error = gfs_createi(&d_gh, &dentry->d_name,
-			    GFS_FILE_DIR, S_IFDIR | mode,
-			    &i_gh);
-	if (error) {
-		gfs_holder_uninit(&d_gh);
-		return error;
-	}
-
-	ip = get_gl2ip(i_gh.gh_gl);
-
-	ip->i_di.di_nlink = 2;
-	ip->i_di.di_size = sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode);
-	ip->i_di.di_flags |= GFS_DIF_JDATA;
-	ip->i_di.di_payload_format = GFS_FORMAT_DE;
-	ip->i_di.di_entries = 2;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-
-	if (!gfs_assert_withdraw(sdp, !error)) {
-		struct gfs_dinode *di = (struct gfs_dinode *)dibh->b_data;
-		struct gfs_dirent *dent;
-
-		gfs_dirent_alloc(ip, dibh, 1, &dent);
-
-		dent->de_inum = di->di_num; /* already GFS endian */
-		dent->de_hash = gfs_dir_hash(".", 1);
-		dent->de_hash = cpu_to_gfs32(dent->de_hash);
-		dent->de_type = cpu_to_gfs16(GFS_FILE_DIR);
-		memcpy((char *) (dent + 1), ".", 1);
-		di->di_entries = cpu_to_gfs32(1);
-
-		gfs_dirent_alloc(ip, dibh, 2, &dent);
-
-		gfs_inum_out(&dip->i_num, (char *) &dent->de_inum);
-		dent->de_hash = gfs_dir_hash("..", 2);
-		dent->de_hash = cpu_to_gfs32(dent->de_hash);
-		dent->de_type = cpu_to_gfs16(GFS_FILE_DIR);
-		memcpy((char *) (dent + 1), "..", 2);
-
-		gfs_dinode_out(&ip->i_di, (char *)di);
-
-		brelse(dibh);
-	}
-
-	error = gfs_change_nlink(dip, +1);
-	gfs_assert_withdraw(sdp, !error); /* dip already pinned */
-
-	gfs_trans_end(sdp);
-	if (dip->i_alloc->al_rgd)
-		gfs_inplace_release(dip);
-	gfs_quota_unlock_m(dip);
-	gfs_unlinked_unlock(sdp, dip->i_alloc->al_ul);
-	gfs_alloc_put(dip);
-
-	inode = gfs_iget(ip, CREATE);
-	gfs_inode_put(ip);
-
-	if (!inode)
-		return -ENOMEM;
-
-	error = gfs_security_init(dip, ip);
-
-	gfs_glock_dq_uninit(&d_gh);
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (error)
-		return error;
-
-	d_instantiate(dentry, inode);
-	mark_inode_dirty(inode);
-
-	return 0;
-}
-
-/**
- * gfs_rmdir - Remove a directory
- * @dir: The parent directory of the directory to be removed
- * @dentry: The dentry of the directory to remove
- *
- * Remove a directory. Call gfs_rmdiri()
- *
- * Returns: errno
- */
-
-static int
-gfs_rmdir(struct inode *dir, struct dentry *dentry)
-{
-	struct gfs_inode *dip = get_v2ip(dir);
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_inode *ip = get_v2ip(dentry->d_inode);
-	struct gfs_holder ghs[2];
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	gfs_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[0]);
-	gfs_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[1]);
-
-	error = gfs_glock_nq_m(2, ghs);
-	if (error)
-		goto fail;
-
-	error = gfs_unlink_ok(dip, &dentry->d_name, ip);
-	if (error)
-		goto fail_gunlock;
-
-	if (ip->i_di.di_entries < 2) {
-		if (gfs_consist_inode(ip))
-			gfs_dinode_print(&ip->i_di);
-		error = -EIO;
-		goto fail_gunlock;
-	}
-	if (ip->i_di.di_entries > 2) {
-		error = -ENOTEMPTY;
-		goto fail_gunlock;
-	}
-
-	/* Trans may require:
-	   Two dinode blocks, one directory leaf block containing the
-	   entry to be rmdired, two leaf blocks containing . and .. of
-	   the directory being rmdired, and one unlinked tag */
-
-	error = gfs_trans_begin(sdp, 5, 1);
-	if (error)
-		goto fail_gunlock;
-
-	error = gfs_rmdiri(dip, &dentry->d_name, ip);
-	if (error)
-		goto fail_end_trans;
-
-	gfs_trans_end(sdp);
-
-	gfs_glock_dq_m(2, ghs);
-
-	gfs_holder_uninit(&ghs[0]);
-	gfs_holder_uninit(&ghs[1]);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_gunlock:
-	gfs_glock_dq_m(2, ghs);
-
- fail:
-	gfs_holder_uninit(&ghs[0]);
-	gfs_holder_uninit(&ghs[1]);
-
-	return error;
-}
-
-/**
- * gfs_mknod - Make a special file
- * @dir: The directory in which the special file will reside
- * @dentry: The dentry of the special file
- * @mode: The mode of the special file
- * @rdev: The device specification of the special file
- *
- */
-
-static int
-gfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
-{
-	struct gfs_inode *dip = get_v2ip(dir), *ip;
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_holder d_gh, i_gh;
-	struct inode *inode;
-	struct buffer_head *dibh;
-	uint16_t type = 0;
-	uint32_t major = 0, minor = 0;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	switch (mode & S_IFMT) {
-	case S_IFBLK:
-		type = GFS_FILE_BLK;
-		major = MAJOR(dev);
-		minor = MINOR(dev);
-		break;
-	case S_IFCHR:
-		type = GFS_FILE_CHR;
-		major = MAJOR(dev);
-		minor = MINOR(dev);
-		break;
-	case S_IFIFO:
-		type = GFS_FILE_FIFO;
-		break;
-	case S_IFSOCK:
-		type = GFS_FILE_SOCK;
-		break;
-	default:
-		printk("GFS: fsid=%s: mknod() with invalid type (%d)\n",
-		       sdp->sd_fsname, mode);
-		return -EINVAL;
-	};
-
-	gfs_holder_init(dip->i_gl, 0, 0, &d_gh);
-
-	error = gfs_createi(&d_gh, &dentry->d_name,
-			    type, mode,
-			    &i_gh);
-	if (error) {
-		gfs_holder_uninit(&d_gh);
-		return error;
-	}
-
-	ip = get_gl2ip(i_gh.gh_gl);
-
-	ip->i_di.di_major = major;
-	ip->i_di.di_minor = minor;
-
-	error = gfs_get_inode_buffer(ip, &dibh);
-
-	if (!gfs_assert_withdraw(sdp, !error)) {
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-	}
-
-	gfs_trans_end(sdp);
-	if (dip->i_alloc->al_rgd)
-		gfs_inplace_release(dip);
-	gfs_quota_unlock_m(dip);
-	gfs_unlinked_unlock(sdp, dip->i_alloc->al_ul);
-	gfs_alloc_put(dip);
-
-	inode = gfs_iget(ip, CREATE);
-	gfs_inode_put(ip);
-
-	error = gfs_security_init(dip, ip);
-
-	gfs_glock_dq_uninit(&d_gh);
-	gfs_glock_dq_uninit(&i_gh);
-
-	if (error)
-		return error;
-
-	if (!inode)
-		return -ENOMEM;
-
-	d_instantiate(dentry, inode);
-	mark_inode_dirty(inode);
-
-	return 0;
-}
-
-/**
- * gfs_rename - Rename a file
- * @odir: Parent directory of old file name
- * @odentry: The old dentry of the file
- * @ndir: Parent directory of new file name
- * @ndentry: The new dentry of the file
- *
- * Returns: errno
- */
-
-static int
-gfs_rename(struct inode *odir, struct dentry *odentry,
-	   struct inode *ndir, struct dentry *ndentry)
-{
-	struct gfs_inode *odip = get_v2ip(odir);
-	struct gfs_inode *ndip = get_v2ip(ndir);
-	struct gfs_inode *ip = get_v2ip(odentry->d_inode);
-	struct gfs_inode *nip = NULL;
-	struct gfs_sbd *sdp = odip->i_sbd;
-	struct qstr name;
-	struct gfs_alloc *al;
-	struct gfs_holder ghs[4], r_gh;
-	unsigned int num_gh;
-	int dir_rename = FALSE;
-	int alloc_required;
-	unsigned int x;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	gfs_unlinked_limit(sdp);
-
-	if (ndentry->d_inode) {
-		nip = get_v2ip(ndentry->d_inode);
-		if (ip == nip)
-			return 0;
-	}
-
-	/*  Make sure we aren't trying to move a dirctory into it's subdir  */
-
-	if (ip->i_di.di_type == GFS_FILE_DIR && odip != ndip) {
-		dir_rename = TRUE;
-
-		error = gfs_glock_nq_init(sdp->sd_rename_gl,
-					  LM_ST_EXCLUSIVE, 0,
-					  &r_gh);
-		if (error)
-			return error;
-
-		error = gfs_ok_to_move(ip, ndip);
-		if (error)
-			goto fail;
-	}
-
-	gfs_holder_init(odip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[0]);
-	gfs_holder_init(ndip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[1]);
-	num_gh = 2;
-
-	if (nip)
-		gfs_holder_init(nip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[num_gh++]);
-
-	if (dir_rename)
-		gfs_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &ghs[num_gh++]);
-
-	error = gfs_glock_nq_m(num_gh, ghs);
-	if (error)
-		goto fail_uninit;
-
-	/*  Check out the old directory  */
-
-	error = gfs_unlink_ok(odip, &odentry->d_name, ip);
-	if (error)
-		goto fail_gunlock;
-
-	/*  Check out the new directory  */
-
-	if (nip) {
-		error = gfs_unlink_ok(ndip, &ndentry->d_name, nip);
-		if (error)
-			goto fail_gunlock;
-
-		if (nip->i_di.di_type == GFS_FILE_DIR) {
-			if (nip->i_di.di_entries < 2) {
-				if (gfs_consist_inode(nip))
-					gfs_dinode_print(&nip->i_di);
-				error = -EIO;
-				goto fail_gunlock;
-			}
-			if (nip->i_di.di_entries > 2) {
-				error = -ENOTEMPTY;
-				goto fail_gunlock;
-			}
-		}
-	} else {
-		error = inode_permission(ndir, MAY_WRITE | MAY_EXEC);
-		if (error)
-			goto fail_gunlock;
-
-		error = gfs_dir_search(ndip, &ndentry->d_name, NULL, NULL);
-		switch (error) {
-		case -ENOENT:
-			error = 0;
-			break;
-		case 0:
-			error = -EEXIST;
-		default:
-			goto fail_gunlock;
-		};
-
-		if (odip != ndip) {
-			if (!ndip->i_di.di_nlink) {
-				error = -EINVAL;
-				goto fail_gunlock;
-			}
-			if (ndip->i_di.di_entries == (uint32_t)-1) {
-				error = -EFBIG;
-				goto fail_gunlock;
-			}
-			if (ip->i_di.di_type == GFS_FILE_DIR &&
-			    ndip->i_di.di_nlink == (uint32_t)-1) {
-				error = -EMLINK;
-				goto fail_gunlock;
-			}
-		}
-	}
-
-	error = gfs_diradd_alloc_required(ndip, &ndentry->d_name, &alloc_required);
-	if (error)
-		goto fail_gunlock;
-
-	if (alloc_required) {
-		al = gfs_alloc_get(ndip);
-
-		error = gfs_quota_lock_m(ndip,
-					    NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-		if (error)
-			goto fail_alloc;
-
-		error = gfs_quota_check(ndip, ndip->i_di.di_uid, ndip->i_di.di_gid);
-		if (error)
-			goto fail_gunlock_q;
-
-		al->al_requested_meta = sdp->sd_max_dirres;
-
-		error = gfs_inplace_reserve(ndip);
-		if (error)
-			goto fail_gunlock_q;
-
-		/* Trans may require:
-		   Dinodes for the srcdir, srcino, dstdir, dstino.  Blocks for
-		   adding the entry to dstdir.  RG bitmaps for that allocation.
-		   One leaf block in the srcdir for removal of the entry.
-		   One leaf block for changing .. in srcino (if it's a directory).
-		   Two leaf blocks for removing . and .. from dstino (if it exists
-		   and it's a directory), one unlinked tag, and one quota block. */
-
-		error = gfs_trans_begin(sdp,
-					8 + sdp->sd_max_dirres +
-					al->al_rgd->rd_ri.ri_length,
-					2);
-		if (error)
-			goto fail_ipres;
-	} else {
-		/* Trans may require:
-		   Dinodes for the srcdir, srcino, dstdir, dstino.  One block for
-		   adding the entry to dstdir.
-		   One leaf block in the srcdir for removal of the entry.
-		   One leaf block for changing .. in srcino (if it's a directory).
-		   Two leaf blocks for removing . and .. from dstino (if it exists
-		   and it's a directory), and one unlinked tag. */
-
-		error = gfs_trans_begin(sdp, 9, 1);
-		if (error)
-			goto fail_ipres;
-	}
-
-	/*  Remove the target file, if it exists  */
-
-	if (nip) {
-		if (nip->i_di.di_type == GFS_FILE_DIR)
-			error = gfs_rmdiri(ndip, &ndentry->d_name, nip);
-		else
-			error = gfs_unlinki(ndip, &ndentry->d_name, nip);
-
-		if (error)
-			goto fail_end_trans;
-	}
-
-	if (dir_rename) {
-		error = gfs_change_nlink(ndip, +1);
-		if (error)
-			goto fail_end_trans;
-		error = gfs_change_nlink(odip, -1);
-		if (error)
-			goto fail_end_trans;
-
-		name.len = 2;
-		name.name = "..";
-
-		error = gfs_dir_mvino(ip, &name, &ndip->i_num, GFS_FILE_DIR);
-		if (error)
-			goto fail_end_trans;
-	}
-
-	error = gfs_dir_del(odip, &odentry->d_name);
-	if (error)
-		goto fail_end_trans;
-
-	error = gfs_dir_add(ndip, &ndentry->d_name, &ip->i_num, ip->i_di.di_type);
-	if (error)
-		goto fail_end_trans;
-
-	if (dir_rename)
-		gfs_trans_add_gl(sdp->sd_rename_gl);
-
-	gfs_trans_end(sdp);
-
-	if (alloc_required) {
-		/*  Don't check al->al_alloced_meta and friends.  */
-		gfs_inplace_release(ndip);
-		gfs_quota_unlock_m(ndip);
-		gfs_alloc_put(ndip);
-	}
-
-	gfs_glock_dq_m(num_gh, ghs);
-
-	for (x = 0; x < num_gh; x++)
-		gfs_holder_uninit(&ghs[x]);
-
-	if (dir_rename)
-		gfs_glock_dq_uninit(&r_gh);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_ipres:
-	if (alloc_required)
-		gfs_inplace_release(ndip);
-
- fail_gunlock_q:
-	if (alloc_required)
-		gfs_quota_unlock_m(ndip);
-
- fail_alloc:
-	if (alloc_required)
-		gfs_alloc_put(ndip);
-
- fail_gunlock:
-	gfs_glock_dq_m(num_gh, ghs);
-
- fail_uninit:
-	for (x = 0; x < num_gh; x++)
-		gfs_holder_uninit(&ghs[x]);
-
- fail:
-	if (dir_rename)
-		gfs_glock_dq_uninit(&r_gh);
-
-	return error;
-}
-
-/**
- * gfs_readlink - Read the value of a symlink
- * @dentry: the symlink
- * @buf: the buffer to read the symlink data into
- * @size: the size of the buffer
- *
- * Returns: errno
- */
-
-static int
-gfs_readlink(struct dentry *dentry, char *user_buf, int user_size)
-{
-	struct gfs_inode *ip = get_v2ip(dentry->d_inode);
-	char array[GFS_FAST_NAME_SIZE], *buf = array;
-	unsigned int len = GFS_FAST_NAME_SIZE;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_inode);
-
-	error = gfs_readlinki(ip, &buf, &len);
-	if (error)
-		return error;
-
-	if (user_size > len - 1)
-		user_size = len - 1;
-
-	if (copy_to_user(user_buf, buf, user_size))
-		error = -EFAULT;
-	else
-		error = user_size;
-
-	if (buf != array)
-		kfree(buf);
-
-	return error;
-}
-
-/**
- * gfs_follow_link - Follow a symbolic link
- * @dentry: The dentry of the link
- * @nd: Data that we pass to vfs_follow_link()
- *
- * This can handle symlinks of any size. It is optimised for symlinks
- * under GFS_FAST_NAME_SIZE.
- *
- * Returns: 0 on success or error code
- */
-
-static void *
-gfs_follow_link(struct dentry *dentry, struct nameidata *nd)
-{
-	struct gfs_inode *ip = get_v2ip(dentry->d_inode);
-	char array[GFS_FAST_NAME_SIZE], *buf = array;
-	unsigned int len = GFS_FAST_NAME_SIZE;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_inode);
-
-	error = gfs_readlinki(ip, &buf, &len);
-	if (!error) {
-		error = vfs_follow_link(nd, buf);
-		if (buf != array)
-			kfree(buf);
-	}
-
-	return ERR_PTR(error);
-}
-
-/**
- * gfs_permission_i -
- * @inode:
- * @mask:
- *
- * Shamelessly ripped from ext3
- *
- * Returns: errno
- */
-
-static int
-gfs_permission_i(struct inode *inode, int mask)
-{
-	return generic_permission(inode, mask, gfs_check_acl);
-}
-
-/**
- * gfs_permission -
- * @inode:
- * @mask:
- *
- * Returns: errno
- */
-
-static int
-gfs_permission(struct inode *inode, int mask)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_holder i_gh;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_inode);
-
-	error = gfs_glock_nq_init(ip->i_gl,
-				  LM_ST_SHARED, LM_FLAG_ANY,
-				  &i_gh);
-	if (error)
-		return error;
-
-	error = gfs_permission_i(inode, mask);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_setattr - Change attributes on an inode
- * @dentry: The dentry which is changing
- * @attr: The structure describing the change
- *
- * The VFS layer wants to change one or more of an inodes attributes.  Write
- * that change out to disk.
- *
- * Returns: errno
- */
-
-static int
-gfs_setattr(struct dentry *dentry, struct iattr *attr)
-{
-	struct inode *inode = dentry->d_inode;
-	struct gfs_inode *ip = get_v2ip(inode);
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_holder i_gh;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_inode);
-
-	/* Bugzilla 203170: we'll have the same deadlock as described 
-	 * in bugzilla 173912 if
-	 * 1. without RHEL4's DIO_CLUSTER_LOCKING, and
-	 * 2. we come down to this line of code from do_truncate()
-	 *    where i_sem(i_mutex) and i_alloc_sem have been taken, and
-	 * 3. grab the exclusive glock here.
-	 * To avoid this to happen, i_alloc_sem must be dropped and trust
-	 * be put into glock that it can carry the same protection. 
-	 *
-	 * One issue with dropping i_alloc_sem is that the gfs_setattr() 
-	 * can be invoked from other code path without this sempaphore. 
-	 * We'll need a new rwsem function that can "up" the semaphore 
-	 * only when it is needed. Before that happens (will research the 
-	 * possibility), i_alloc_sem (now) is a meaningless lock within 
-	 * GFS. If it is ever been used by other non-directIO code, this
-	 * hack will fall apart.
-	 *
-	 * wcheng at redhat.com 10/14/06  
-	 */ 
-	if (attr->ia_valid & ATTR_SIZE) {
-		up_write(&dentry->d_inode->i_alloc_sem); 
-	}
-	
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
-
-	if (attr->ia_valid & ATTR_SIZE) {
-		down_write(&dentry->d_inode->i_alloc_sem); 
-	}
-	
-	if (error)
-		return error;
-
-	if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) {
-		error = -EPERM;
-		goto fail;
-	}
-
-	error = inode_change_ok(inode, attr);
-	if (error)
-		goto fail;
-
-	if (attr->ia_valid & ATTR_SIZE) {
-		error = inode_permission(inode, MAY_WRITE);
-		if (error)
-			goto fail;
-
-		if (attr->ia_size != ip->i_di.di_size) {
-			error = vmtruncate(inode, attr->ia_size);
-			if (error)
-				goto fail;
-		}
-
-		error = gfs_truncatei(ip, attr->ia_size, gfs_truncator_page);
-		if (error) {
-			if (inode->i_size != ip->i_di.di_size)
-				i_size_write(inode, ip->i_di.di_size);
-			goto fail;
-		}
-
-		if ((sdp->sd_vfs->s_flags & MS_SYNCHRONOUS) &&
-		    !gfs_is_jdata(ip))
-			i_gh.gh_flags |= GL_SYNC;
-	}
-
-	else if (attr->ia_valid & (ATTR_UID | ATTR_GID)) {
-		struct gfs_alloc *al;
-		struct buffer_head *dibh;
-		uint32_t ouid, ogid, nuid, ngid;
-
-		ouid = ip->i_di.di_uid;
-		ogid = ip->i_di.di_gid;
-		nuid = attr->ia_uid;
-		ngid = attr->ia_gid;
-
-		if (!(attr->ia_valid & ATTR_UID) || ouid == nuid)
-			ouid = nuid = NO_QUOTA_CHANGE;
-		if (!(attr->ia_valid & ATTR_GID) || ogid == ngid)
-			ogid = ngid = NO_QUOTA_CHANGE;
-
-		al = gfs_alloc_get(ip);
-
-		error = gfs_quota_lock_m(ip, nuid, ngid);
-		if (error)
-			goto fail_alloc;
-
-		if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) {
-			error = gfs_quota_check(ip, nuid, ngid);
-			if (error)
-				goto fail_gunlock_q;
-		}
-
-		/* Trans may require:
-		   one dinode block and one quota change block */
-
-		error = gfs_trans_begin(sdp, 1, 1);
-		if (error)
-			goto fail_gunlock_q;
-
-		error = gfs_get_inode_buffer(ip, &dibh);
-		if (error)
-			goto fail_end_trans;
-
-		if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) {
-			gfs_trans_add_quota(sdp, -ip->i_di.di_blocks,
-					    ouid, ogid);
-			gfs_trans_add_quota(sdp, ip->i_di.di_blocks,
-					    nuid, ngid);
-		}
-
-		error = inode_setattr(inode, attr);
-		gfs_assert_warn(sdp, !error);
-		gfs_inode_attr_out(ip);
-
-		gfs_trans_add_bh(ip->i_gl, dibh);
-		gfs_dinode_out(&ip->i_di, dibh->b_data);
-		brelse(dibh);
-
-		gfs_trans_end(sdp);
-
-		gfs_quota_unlock_m(ip);
-		gfs_alloc_put(ip);
-	}
-
-	else if ((attr->ia_valid & ATTR_MODE) && IS_POSIXACL(inode)) {
-		error = gfs_acl_chmod(ip, attr);
-		if (error)
-			goto fail;
-	}
-
-	else {
-		error = gfs_setattr_simple(ip, attr);
-		if (error)
-			goto fail;
-	}
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	mark_inode_dirty(inode);
-
-	return error;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_gunlock_q:
-	gfs_quota_unlock_m(ip);
-
- fail_alloc:
-	gfs_alloc_put(ip);
-
- fail:
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_getattr - Read out an inode's attributes
- * @mnt: ?
- * @dentry: The dentry to stat
- * @stat: The inode's stats
- *
- * Returns: errno
- */
-
-static int
-gfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
-{
-	struct inode *inode = dentry->d_inode, *p_inode = NULL;
-	struct gfs_inode *ip = get_v2ip(inode), *pi = NULL;
-	struct gfs_holder gh;
-	int error;
-
-	atomic_inc(&ip->i_sbd->sd_ops_inode);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh);
-	if (!error) {
-		generic_fillattr(inode, stat);
-		if (S_ISREG(inode->i_mode) && dentry->d_parent 
-		    && dentry->d_parent->d_inode) {
-			p_inode = igrab(dentry->d_parent->d_inode);
-			if (p_inode) {
-				pi = get_v2ip(p_inode);
-				pi->i_dir_stats++;
-				iput(p_inode);
-			}
-		}
-		gfs_glock_dq_uninit(&gh);
-	}
-
-	return error;
-}
-
-/**
- * gfs_setxattr - Set (or create or replace) an inode's extended attribute
- * @dentry: 
- * @name: 
- * @data: 
- * @size: 
- * @flags: 
- *
- * Returns: errno
- */
-
-int
-gfs_setxattr(struct dentry *dentry, const char *name,
-	     const void *data, size_t size,
-	     int flags)
-{
-	struct gfs_ea_request er;
-
-	atomic_inc(&get_v2sdp(dentry->d_inode->i_sb)->sd_ops_inode);
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-	er.er_type = gfs_ea_name2type(name, &er.er_name);
-	if (er.er_type == GFS_EATYPE_UNUSED)
-	        return -EOPNOTSUPP;
-	er.er_data = (char *)data;
-	er.er_name_len = strlen(er.er_name);
-	er.er_data_len = size;
-	er.er_flags = flags;
-
-	return gfs_ea_set(get_v2ip(dentry->d_inode), &er);
-}
-
-/**
- * gfs_getxattr -
- * @dentry:
- * @name:
- * @data:
- * @size:
- *
- * Returns: The number of bytes put into data, or -errno
- */
-
-ssize_t
-gfs_getxattr(struct dentry *dentry, const char *name,
-	     void *data, size_t size)
-{
-	struct gfs_ea_request er;
-
-	atomic_inc(&get_v2sdp(dentry->d_inode->i_sb)->sd_ops_inode);
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-	er.er_type = gfs_ea_name2type(name, &er.er_name);
-	if (er.er_type == GFS_EATYPE_UNUSED)
-	        return -EOPNOTSUPP;
-	er.er_data = data;
-	er.er_name_len = strlen(er.er_name);
-	er.er_data_len = size;
-
-	return gfs_ea_get(get_v2ip(dentry->d_inode), &er);
-}
-
-/**
- * gfs_listxattr - 
- * @dentry:
- * @buffer:
- * @size:
- *
- * Returns: The number of bytes put into data, or -errno
- */
-
-ssize_t
-gfs_listxattr(struct dentry *dentry, char *buffer, size_t size)
-{
-	struct gfs_ea_request er;
-
-	atomic_inc(&get_v2sdp(dentry->d_inode->i_sb)->sd_ops_inode);
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-	er.er_data = (size) ? buffer : NULL;
-	er.er_data_len = size;
-
-	return gfs_ea_list(get_v2ip(dentry->d_inode), &er);
-}
-
-/**
- * gfs_removexattr -
- * @dentry:
- * @name:
- *
- * Returns: errno
- */
-
-int
-gfs_removexattr(struct dentry *dentry, const char *name)
-{
-	struct gfs_ea_request er;
-
-	atomic_inc(&get_v2sdp(dentry->d_inode->i_sb)->sd_ops_inode);
-
-	memset(&er, 0, sizeof(struct gfs_ea_request));
-	er.er_type = gfs_ea_name2type(name, &er.er_name);
-	if (er.er_type == GFS_EATYPE_UNUSED)
-	        return -EOPNOTSUPP;
-	er.er_name_len = strlen(er.er_name);
-
-	return gfs_ea_remove(get_v2ip(dentry->d_inode), &er);
-}
-
-struct inode_operations gfs_file_iops = {
-	.permission = gfs_permission,
-	.setattr = gfs_setattr,
-	.getattr = gfs_getattr,
-	.setxattr = gfs_setxattr,
-	.getxattr = gfs_getxattr,
-	.listxattr = gfs_listxattr,
-	.removexattr = gfs_removexattr,
-};
-
-struct inode_operations gfs_dev_iops = {
-	.permission = gfs_permission,
-	.setattr = gfs_setattr,
-	.getattr = gfs_getattr,
-	.setxattr = gfs_setxattr,
-	.getxattr = gfs_getxattr,
-	.listxattr = gfs_listxattr,
-	.removexattr = gfs_removexattr,
-};
-
-struct inode_operations gfs_dir_iops = {
-	.create = gfs_create,
-	.lookup = gfs_lookup,
-	.link = gfs_link,
-	.unlink = gfs_unlink,
-	.symlink = gfs_symlink,
-	.mkdir = gfs_mkdir,
-	.rmdir = gfs_rmdir,
-	.mknod = gfs_mknod,
-	.rename = gfs_rename,
-	.permission = gfs_permission,
-	.setattr = gfs_setattr,
-	.getattr = gfs_getattr,
-	.setxattr = gfs_setxattr,
-	.getxattr = gfs_getxattr,
-	.listxattr = gfs_listxattr,
-	.removexattr = gfs_removexattr,
-};
-
-struct inode_operations gfs_symlink_iops = {
-	.readlink = gfs_readlink,
-	.follow_link = gfs_follow_link,
-	.permission = gfs_permission,
-	.setattr = gfs_setattr,
-	.getattr = gfs_getattr,
-	.setxattr = gfs_setxattr,
-	.getxattr = gfs_getxattr,
-	.listxattr = gfs_listxattr,
-	.removexattr = gfs_removexattr,
-};
-
diff --git a/gfs-kernel/src/gfs/ops_inode.h b/gfs-kernel/src/gfs/ops_inode.h
deleted file mode 100644
index a753396..0000000
--- a/gfs-kernel/src/gfs/ops_inode.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __OPS_INODE_DOT_H__
-#define __OPS_INODE_DOT_H__
-
-extern struct inode_operations gfs_file_iops;
-extern struct inode_operations gfs_dir_iops;
-extern struct inode_operations gfs_symlink_iops;
-extern struct inode_operations gfs_dev_iops;
-
-#endif /* __OPS_INODE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_super.c b/gfs-kernel/src/gfs/ops_super.c
deleted file mode 100644
index 621973e..0000000
--- a/gfs-kernel/src/gfs/ops_super.c
+++ /dev/null
@@ -1,463 +0,0 @@
-#include <linux/kthread.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/buffer_head.h>
-#include <linux/vmalloc.h>
-#include <linux/statfs.h>
-#include <linux/seq_file.h>
-#include <linux/mount.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "inode.h"
-#include "lm.h"
-#include "log.h"
-#include "ops_fstype.h"
-#include "ops_super.h"
-#include "page.h"
-#include "proc.h"
-#include "quota.h"
-#include "recovery.h"
-#include "rgrp.h"
-#include "super.h"
-#include "sys.h"
-#include "mount.h"
-
-/**
- * gfs_write_inode - Make sure the inode is stable on the disk
- * @inode: The inode
- * @sync: synchronous write flag
- *
- * Returns: errno
- */
-
-static int
-gfs_write_inode(struct inode *inode, int sync)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-
-	atomic_inc(&ip->i_sbd->sd_ops_super);
-
-	if (ip && sync)
-		gfs_log_flush_glock(ip->i_gl);
-
-	return 0;
-}
-
-/**
- * gfs_drop_inode - drop an inode
- * @inode: The inode
- *
- * If i_nlink is zero, any dirty data for the inode is thrown away.
- * If a process on another machine has the file open, it may need that
- * data.  So, sync it out.
- */
-
-static void
-gfs_drop_inode(struct inode *inode)
-{
-	struct gfs_sbd *sdp = get_v2sdp(inode->i_sb);
-	struct gfs_inode *ip = get_v2ip(inode);
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	if (ip &&
-	    !inode->i_nlink &&
-	    S_ISREG(inode->i_mode) &&
-	    !sdp->sd_args.ar_localcaching)
-		gfs_sync_page_i(inode, DIO_START | DIO_WAIT);
-	generic_drop_inode(inode);
-}
-
-/**
- * gfs_put_super - Unmount the filesystem
- * @sb: The VFS superblock
- *
- */
-
-static void
-gfs_put_super(struct super_block *sb)
-{
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-	int error;
-
-        if (!sdp)
-                return;
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	gfs_proc_fs_del(sdp);
-
-	/*  Unfreeze the filesystem, if we need to  */
-
-	down(&sdp->sd_freeze_lock);
-	if (sdp->sd_freeze_count)
-		gfs_glock_dq_uninit(&sdp->sd_freeze_gh);
-	up(&sdp->sd_freeze_lock);
-
-	/*  Kill off the inode thread  */
-	kthread_stop(sdp->sd_inoded_process);
-
-	/*  Kill off the quota thread  */
-	kthread_stop(sdp->sd_quotad_process);
-
-	/*  Kill off the log thread  */
-	kthread_stop(sdp->sd_logd_process);
-
-	/*  Kill off the recoverd thread  */
-	kthread_stop(sdp->sd_recoverd_process);
-
-	/*  Kill off the glockd threads  */
-	while (sdp->sd_glockd_num--)
-		kthread_stop(sdp->sd_glockd_process[sdp->sd_glockd_num]);
-
-	/*  Kill off the scand thread  */
-	kthread_stop(sdp->sd_scand_process);
-
-	if (!test_bit(SDF_ROFS, &sdp->sd_flags)) {
-		error = gfs_make_fs_ro(sdp);
-		if (error)
-			gfs_io_error(sdp);
-	}
-
-	/*  At this point, we're through modifying the disk  */
-
-	/*  Release stuff  */
-
-	gfs_inode_put(sdp->sd_riinode);
-	gfs_inode_put(sdp->sd_jiinode);
-	gfs_inode_put(sdp->sd_rooti);
-	gfs_inode_put(sdp->sd_qinode);
-	gfs_inode_put(sdp->sd_linode);
-	gfs_glock_put(sdp->sd_trans_gl);
-	gfs_glock_put(sdp->sd_rename_gl);
-
-	if (!sdp->sd_args.ar_spectator)
-		gfs_glock_dq_uninit(&sdp->sd_journal_gh);
-
-	gfs_glock_dq_uninit(&sdp->sd_live_gh);
-
-	/*  Get rid of rgrp bitmap structures  */
-	gfs_clear_rgrpd(sdp);
-	gfs_clear_journals(sdp);
-
-	/*  Take apart glock structures and buffer lists  */
-	gfs_gl_hash_clear(sdp, TRUE);
-
-	/*  Unmount the locking protocol  */
-	gfs_lm_unmount(sdp);
-
-	/*  At this point, we're through participating in the lockspace  */
-
-	gfs_sys_fs_del(sdp);
-
-	gfs_clear_dirty_j(sdp);
-
-	/*  Get rid of any extra inodes  */
-	while (invalidate_inodes(sb))
-		yield();
-
-	vfree(sdp);
-
-	set_v2sdp(sb, NULL);
-}
-
-/**
- * gfs_write_super - disk commit all incore transactions
- * @sb: the filesystem
- *
- * This function is called every time sync(2) is called.
- * After this exits, all dirty buffers and synced.
- */
-
-static void
-gfs_write_super(struct super_block *sb)
-{
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-	atomic_inc(&sdp->sd_ops_super);
-	gfs_log_flush(sdp);
-}
-
-/**
- * gfs_freeze - prevent further writes to the filesystem
- * @sb: the VFS structure for the filesystem
- *
- */
-
-static int
-gfs_freeze(struct super_block *sb)
-{
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-	int error;
-
-	if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-		return -EINVAL;
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	for (;;) {
-		error = gfs_freeze_fs(sdp);
-		if (!error)
-			break;
-
-		switch (error) {
-		case -EBUSY:
-			printk("GFS: fsid=%s: waiting for recovery before freeze\n",
-			       sdp->sd_fsname);
-			break;
-
-		default:
-			printk("GFS: fsid=%s: error freezing FS: %d\n",
-			       sdp->sd_fsname, error);
-			break;
-		}
-
-		printk("GFS: fsid=%s: retrying...\n", sdp->sd_fsname);
-
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ);
-	}
-	return 0;
-}
-
-/**
- * gfs_unfreeze - reallow writes to the filesystem
- * @sb: the VFS structure for the filesystem
- *
- */
-
-static int
-gfs_unfreeze(struct super_block *sb)
-{
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	gfs_unfreeze_fs(sdp);
-	return 0;
-}
-
-/**
- * gfs_statfs - Gather and return stats about the filesystem
- * @sb: The superblock
- * @statfsbuf: The buffer
- *
- * Returns: 0 on success or error code
- */
-
-static int gfs_statfs(struct dentry *dentry, struct kstatfs *buf)
-{
-	struct super_block *sb = dentry->d_inode->i_sb;
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-	struct gfs_stat_gfs sg;
-	int error;
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	if (gfs_tune_get(sdp, gt_statfs_fast))
-		return(gfs_statfs_fast(sdp, (void *)buf));
-
-	error = gfs_stat_gfs(sdp, &sg, TRUE);
-	if (error)
-		return error;
-
-	memset(buf, 0, sizeof(struct kstatfs));
-
-	buf->f_type = GFS_MAGIC;
-	buf->f_bsize = sdp->sd_sb.sb_bsize;
-	buf->f_blocks = sg.sg_total_blocks;
-	buf->f_bfree = sg.sg_free + sg.sg_free_dinode + sg.sg_free_meta;
-	buf->f_bavail = sg.sg_free + sg.sg_free_dinode + sg.sg_free_meta;
-	buf->f_files = sg.sg_used_dinode + sg.sg_free_dinode +
-		sg.sg_free_meta + sg.sg_free;
-	buf->f_ffree = sg.sg_free_dinode + sg.sg_free_meta + sg.sg_free;
-	buf->f_namelen = GFS_FNAMESIZE;
-
-	return 0;
-}
-
-/**
- * gfs_remount_fs - called when the FS is remounted
- * @sb:  the filesystem
- * @flags:  the remount flags
- * @data:  extra data passed in (not used right now)
- *
- * Returns: errno
- */
-
-static int
-gfs_remount_fs(struct super_block *sb, int *flags, char *data)
-{
-	struct gfs_sbd *sdp = get_v2sdp(sb);
-	struct gfs_tune *gt = &sdp->sd_tune;
-	int error = 0;
-	struct gfs_args *args;
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	args = kmalloc(sizeof(struct gfs_args), GFP_KERNEL);
-	if (!args)
-		return -ENOMEM;
-
-	error = gfs_make_args(data, args, TRUE);
-	if (error) {
-		printk("GFS: can't parse remount arguments\n");
-		goto out;
-	}
-	if (args->ar_posix_acls) {
-		sdp->sd_args.ar_posix_acls = TRUE;
-		sb->s_flags |= MS_POSIXACL;
-	}
-	else {
-		sdp->sd_args.ar_posix_acls = FALSE;
-		sb->s_flags &= ~MS_POSIXACL;
-	}
-
-	if (*flags & (MS_NOATIME | MS_NODIRATIME))
-		set_bit(SDF_NOATIME, &sdp->sd_flags);
-	else
-		clear_bit(SDF_NOATIME, &sdp->sd_flags);
-
-	if (sdp->sd_args.ar_spectator)
-		*flags |= MS_RDONLY;
-	else {
-		if (*flags & MS_RDONLY) {
-			if (!test_bit(SDF_ROFS, &sdp->sd_flags))
-				error = gfs_make_fs_ro(sdp);
-		} else if (!(*flags & MS_RDONLY) &&
-			   test_bit(SDF_ROFS, &sdp->sd_flags)) {
-			error = gfs_make_fs_rw(sdp);
-		}
-	}
-
-	if (args->ar_noquota) {
-		if (sdp->sd_args.ar_noquota == FALSE)
-			printk("GFS: remounting without quota\n");
-		sdp->sd_args.ar_noquota = TRUE;
-		spin_lock(&gt->gt_spin);
-		gt->gt_quota_enforce = 0;
-		gt->gt_quota_account = 0;
-		spin_unlock(&gt->gt_spin);
-	}
-	else {
-		if (sdp->sd_args.ar_noquota == TRUE)
-			printk("GFS: remounting with quota\n");
-		sdp->sd_args.ar_noquota = FALSE;
-		spin_lock(&gt->gt_spin);
-		gt->gt_quota_enforce = 1;
-		gt->gt_quota_account = 1;
-		spin_unlock(&gt->gt_spin);
-	}
-
-	/*  Don't let the VFS update atimes.  GFS handles this itself. */
-	*flags |= MS_NOATIME | MS_NODIRATIME;
-
-	if (error == 0)
-		gfs_online_uevent(sdp);
-out:
-	kfree(args);
-	return error;
-}
-
-/**
- * gfs_clear_inode - Deallocate an inode when VFS is done with it
- * @inode: The VFS inode
- *
- * If there's a GFS incore inode structure attached to the VFS inode:
- * --  Detach them from one another.
- * --  Schedule reclaim of GFS inode struct, the glock protecting it, and
- *     the associated iopen glock.
- */
-
-static void
-gfs_clear_inode(struct inode *inode)
-{
-	struct gfs_inode *ip = get_v2ip(inode);
-
-	atomic_inc(&get_v2sdp(inode->i_sb)->sd_ops_super);
-
-	if (ip) {
-		spin_lock(&ip->i_spin);
-		ip->i_vnode = NULL;
-		set_v2ip(inode, NULL);
-		spin_unlock(&ip->i_spin);
-
-		gfs_glock_schedule_for_reclaim(ip->i_gl);
-		gfs_inode_put(ip);
-	}
-}
-
-/**
- * gfs_show_options - Show mount options for /proc/mounts
- * @s: seq_file structure
- * @mnt: vfsmount
- *
- * Returns: 0 on success or error code
- */
-
-static int
-gfs_show_options(struct seq_file *s, struct vfsmount *mnt)
-{
-	struct gfs_sbd *sdp = get_v2sdp(mnt->mnt_sb);
-	struct gfs_args *args = &sdp->sd_args;
-
-	atomic_inc(&sdp->sd_ops_super);
-
-	if (args->ar_lockproto[0]) {
-		seq_printf(s, ",lockproto=");
-		seq_puts(s, args->ar_lockproto);
-	}
-	if (args->ar_locktable[0]) {
-		seq_printf(s, ",locktable=");
-		seq_puts(s, args->ar_locktable);
-	}
-	if (args->ar_hostdata[0]) {
-		seq_printf(s, ",hostdata=");
-		seq_puts(s, args->ar_hostdata);
-	}
-	if (args->ar_spectator)
-		seq_printf(s, ",spectator");
-	if (args->ar_ignore_local_fs)
-		seq_printf(s, ",ignore_local_fs");
-	if (args->ar_localflocks)
-		seq_printf(s, ",localflocks");
-	if (args->ar_localcaching)
-		seq_printf(s, ",localcaching");
-	if (args->ar_oopses_ok)
-		seq_printf(s, ",oopses_ok");
-	if (args->ar_debug)
-		seq_printf(s, ",debug");
-	if (args->ar_upgrade)
-		seq_printf(s, ",upgrade");
-	if (args->ar_num_glockd != GFS_GLOCKD_DEFAULT)
-		seq_printf(s, ",num_glockd=%u", args->ar_num_glockd);
-	if (args->ar_posix_acls)
-		seq_printf(s, ",acl");
-	if (args->ar_noquota)
-		seq_printf(s, ",noquota");
-	if (args->ar_suiddir)
-		seq_printf(s, ",suiddir");
-	if (args->ar_errors) {
-		seq_printf(s, ",errors=");
-		if (args->ar_errors == GFS_ERRORS_PANIC)
-			seq_printf(s, "panic");
-	}
-	return 0;
-}
-
-struct super_operations gfs_super_ops = {
-	.write_inode = gfs_write_inode,
-	.drop_inode = gfs_drop_inode,
-	.put_super = gfs_put_super,
-	.write_super = gfs_write_super,
-	.freeze_fs = gfs_freeze,
-	.unfreeze_fs = gfs_unfreeze,
-	.statfs = gfs_statfs,
-	.remount_fs = gfs_remount_fs,
-	.clear_inode = gfs_clear_inode,
-	.show_options = gfs_show_options,
-};
diff --git a/gfs-kernel/src/gfs/ops_super.h b/gfs-kernel/src/gfs/ops_super.h
deleted file mode 100644
index d3dad88..0000000
--- a/gfs-kernel/src/gfs/ops_super.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __OPS_SUPER_DOT_H__
-#define __OPS_SUPER_DOT_H__
-
-extern struct super_operations gfs_super_ops;
-
-#endif /* __OPS_SUPER_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/ops_vm.c b/gfs-kernel/src/gfs/ops_vm.c
deleted file mode 100644
index 423435e..0000000
--- a/gfs-kernel/src/gfs/ops_vm.c
+++ /dev/null
@@ -1,233 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-
-#include "gfs.h"
-#include "bmap.h"
-#include "glock.h"
-#include "inode.h"
-#include "ops_vm.h"
-#include "page.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "trans.h"
-
-/**
- * pfault_be_greedy -
- * @ip:
- *
- */
-
-static void
-pfault_be_greedy(struct gfs_inode *ip)
-{
-	unsigned int time;
-
-	spin_lock(&ip->i_spin);
-	time = ip->i_greedy;
-	ip->i_last_pfault = jiffies;
-	spin_unlock(&ip->i_spin);
-
-	gfs_inode_hold(ip);
-	if (gfs_glock_be_greedy(ip->i_gl, time))
-		gfs_inode_put(ip);
-}
-
-/**
- * gfs_private_fault -
- * @area:
- * @address:
- * @type:
- *
- * Returns: the page
- */
-
-static int gfs_private_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-{
-	struct gfs_inode *ip = get_v2ip(vma->vm_file->f_mapping->host);
-	struct gfs_holder i_gh;
-	int error;
-	int ret = 0;
-
-	atomic_inc(&ip->i_sbd->sd_ops_vm);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &i_gh);
-	if (error)
-		goto out;
-
-	set_bit(GIF_PAGED, &ip->i_flags);
-
-	ret = filemap_fault(vma, vmf);
-
-	if (ret && ret != VM_FAULT_OOM)
-		pfault_be_greedy(ip);
-
-	gfs_glock_dq_uninit(&i_gh);
- out:
-	return ret;
-}
-
-/**
- * alloc_page_backing -
- * @ip:
- * @index:
- *
- * Returns: errno
- */
-
-static int
-alloc_page_backing(struct gfs_inode *ip, struct page *page)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	unsigned long index = page->index;
-	uint64_t lblock = index << (PAGE_CACHE_SHIFT - sdp->sd_sb.sb_bsize_shift);
-	unsigned int blocks = PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift;
-	struct gfs_alloc *al;
-	unsigned int x;
-	int error;
-
-	al = gfs_alloc_get(ip);
-
-	error = gfs_quota_lock_m(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
-	if (error)
-		goto out;
-
-	error = gfs_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
-	if (error)
-		goto out_gunlock_q;
-
-	gfs_write_calc_reserv(ip, PAGE_CACHE_SIZE,
-			      &al->al_requested_data, &al->al_requested_meta);
-
-	error = gfs_inplace_reserve(ip);
-	if (error)
-		goto out_gunlock_q;
-
-	/* Trans may require:
-	   a dinode block, RG bitmaps to allocate from,
-	   indirect blocks, and a quota block */
-
-	error = gfs_trans_begin(sdp,
-				1 + al->al_rgd->rd_ri.ri_length +
-				al->al_requested_meta, 1);
-	if (error)
-		goto out_ipres;
-
-	if (gfs_is_stuffed(ip)) {
-		error = gfs_unstuff_dinode(ip, gfs_unstuffer_page, NULL);
-		if (error)
-			goto out_trans;
-	}
-
-	for (x = 0; x < blocks; ) {
-		uint64_t dblock;
-		unsigned int extlen;
-		int new = TRUE;
-
-		error = gfs_block_map(ip, lblock, &new, &dblock, &extlen);
-		if (error)
-			goto out_trans;
-
-		lblock += extlen;
-		x += extlen;
-	}
-
-	gfs_assert_warn(sdp, al->al_alloced_meta || al->al_alloced_data);
-
- out_trans:
-	gfs_trans_end(sdp);
-
- out_ipres:
-	gfs_inplace_release(ip);
-
- out_gunlock_q:
-	gfs_quota_unlock_m(ip);
-
- out:
-	gfs_alloc_put(ip);
-
-	return error;
-}
-
-/**
- * gfs_sharewrite_fault -
- * @area:
- * @address:
- * @type:
- *
- * Returns: the page
- */
-
-static int gfs_sharewrite_fault(struct vm_area_struct *vma,
-				struct vm_fault *vmf)
-{
-	struct file *file = vma->vm_file;
-	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_holder i_gh;
-	int alloc_required;
-	int error;
-	int ret = 0;
-
-	atomic_inc(&ip->i_sbd->sd_ops_vm);
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
-	if (error)
-		goto out;
-
-	if (gfs_is_jdata(ip))
-		goto out_unlock;
-
-	set_bit(GIF_PAGED, &ip->i_flags);
-	set_bit(GIF_SW_PAGED, &ip->i_flags);
-
-	error = gfs_write_alloc_required(ip,
-					 (u64)vmf->pgoff << PAGE_CACHE_SHIFT,
-					 PAGE_CACHE_SIZE, &alloc_required);
-	if (error) {
-		ret = VM_FAULT_OOM; /* XXX: are these right? */
-		goto out_unlock;
-	}
-
-	ret = filemap_fault(vma, vmf);
-	if (ret & VM_FAULT_ERROR)
-		goto out_unlock;
-
-	if (alloc_required) {
-		/* XXX: do we need to drop page lock around alloc_page_backing?*/
-		error = alloc_page_backing(ip, vmf->page);
-		if (error) {
-                        /*
-                         * VM_FAULT_LOCKED should always be the case for
-                         * filemap_fault, but it may not be in a future
-                         * implementation.
-                         */
-			if (ret & VM_FAULT_LOCKED)
-				unlock_page(vmf->page);
-			page_cache_release(vmf->page);
-			ret = VM_FAULT_OOM;
-			goto out_unlock;
-		}
-		set_page_dirty(vmf->page);
-	}
-
-	pfault_be_greedy(ip);
-
- out_unlock:
-	gfs_glock_dq_uninit(&i_gh);
- out:
-	return ret;
-}
-
-struct vm_operations_struct gfs_vm_ops_private = {
-	.fault = gfs_private_fault,
-};
-
-struct vm_operations_struct gfs_vm_ops_sharewrite = {
-	.fault = gfs_sharewrite_fault,
-};
-
diff --git a/gfs-kernel/src/gfs/ops_vm.h b/gfs-kernel/src/gfs/ops_vm.h
deleted file mode 100644
index 0361c97..0000000
--- a/gfs-kernel/src/gfs/ops_vm.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __OPS_VM_DOT_H__
-#define __OPS_VM_DOT_H__
-
-extern struct vm_operations_struct gfs_vm_ops_private;
-extern struct vm_operations_struct gfs_vm_ops_sharewrite;
-
-#endif /* __OPS_VM_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/page.c b/gfs-kernel/src/gfs/page.c
deleted file mode 100644
index 4c5cdb3..0000000
--- a/gfs-kernel/src/gfs/page.c
+++ /dev/null
@@ -1,266 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/pagemap.h>
-#include <linux/mm.h>
-
-#include "gfs.h"
-#include "bmap.h"
-#include "inode.h"
-#include "page.h"
-
-/**
- * gfs_inval_pte - Sync and invalidate all PTEs associated with a glock
- * @gl: the glock
- *
- */
-
-void
-gfs_inval_pte(struct gfs_glock *gl)
-{
-	struct gfs_inode *ip;
-	struct inode *inode;
-
-	ip = get_gl2ip(gl);
-	if (!ip ||
-	    ip->i_di.di_type != GFS_FILE_REG)
-		return;
-
-	if (!test_bit(GIF_PAGED, &ip->i_flags))
-		return;
-
-	inode = gfs_iget(ip, NO_CREATE);
-	if (inode) {
-		unmap_shared_mapping_range(inode->i_mapping, 0, 0);
-		iput(inode);
-
-		if (test_bit(GIF_SW_PAGED, &ip->i_flags))
-			set_bit(GLF_DIRTY, &gl->gl_flags);
-	}
-
-	clear_bit(GIF_SW_PAGED, &ip->i_flags);
-}
-
-/**
- * gfs_inval_page - Invalidate all pages associated with a glock
- * @gl: the glock
- *
- */
-
-void
-gfs_inval_page(struct gfs_glock *gl)
-{
-	struct gfs_inode *ip;
-	struct inode *inode;
-
-	ip = get_gl2ip(gl);
-	if (!ip ||
-	    ip->i_di.di_type != GFS_FILE_REG)
-		return;
-
-	inode = gfs_iget(ip, NO_CREATE);
-	if (inode) {
-		struct address_space *mapping = inode->i_mapping;
-
-		truncate_inode_pages(mapping, 0);
-		gfs_assert_withdraw(ip->i_sbd, !mapping->nrpages);
-
-		iput(inode);
-	}
-
-	clear_bit(GIF_PAGED, &ip->i_flags);
-}
-
-/**
- * gfs_sync_page_i - Sync the data pages (not metadata) for a struct inode
- * @inode: the inode
- * @flags: DIO_START | DIO_WAIT
- *
- */
-
-void
-gfs_sync_page_i(struct inode *inode, int flags)
-{
-	struct address_space *mapping = inode->i_mapping;
-	int error = 0;
-
-	if (flags & DIO_START)
-		error = filemap_fdatawrite(mapping);
-	if (!error && (flags & DIO_WAIT))
-		error = filemap_fdatawait(mapping);
-
-	/* Find a better way to report this to the user. */
-	if (error)
-		gfs_io_error_inode(get_v2ip(inode));
-}
-
-/**
- * gfs_sync_page - Sync the data pages (not metadata) associated with a glock
- * @gl: the glock
- * @flags: DIO_START | DIO_WAIT
- *
- * Syncs data (not metadata) for a regular file.
- * No-op for all other types.
- */
-
-void
-gfs_sync_page(struct gfs_glock *gl, int flags)
-{
-	struct gfs_inode *ip;
-	struct inode *inode;
-
-	ip = get_gl2ip(gl);
-	if (!ip ||
-	    ip->i_di.di_type != GFS_FILE_REG)
-		return;
-
-	inode = gfs_iget(ip, NO_CREATE);
-	if (inode) {
-		gfs_sync_page_i(inode, flags);
-		iput(inode);
-	}
-}
-
-/**
- * gfs_unstuffer_page - unstuff a stuffed inode into a block cached by a page
- * @ip: the inode
- * @dibh: the dinode buffer
- * @block: the block number that was allocated
- * @private: any locked page held by the caller process
- *
- * Returns: errno
- */
-
-int
-gfs_unstuffer_page(struct gfs_inode *ip, struct buffer_head *dibh,
-		   uint64_t block, void *private)
-{
-	struct inode *inode = ip->i_vnode;
-	struct page *page = (struct page *)private;
-	struct buffer_head *bh;
-	int release = FALSE;
-
-	if (!page || page->index) {
-		page = grab_cache_page(inode->i_mapping, 0);
-		if (!page)
-			return -ENOMEM;
-		release = TRUE;
-	}
-
-	if (!PageUptodate(page)) {
-		void *kaddr = kmap(page);
-
-		memcpy(kaddr,
-		       dibh->b_data + sizeof(struct gfs_dinode),
-		       ip->i_di.di_size);
-		memset(kaddr + ip->i_di.di_size,
-		       0,
-		       PAGE_CACHE_SIZE - ip->i_di.di_size);
-		kunmap(page);
-
-		SetPageUptodate(page);
-	}
-
-	if (!page_has_buffers(page))
-		create_empty_buffers(page, 1 << inode->i_blkbits,
-				     (1 << BH_Uptodate));
-
-	bh = page_buffers(page);
-
-	if (!buffer_mapped(bh))
-		map_bh(bh, inode->i_sb, block);
-	else if (gfs_assert_warn(ip->i_sbd,
-				 bh->b_bdev == inode->i_sb->s_bdev &&
-				 bh->b_blocknr == block))
-                map_bh(bh, inode->i_sb, block);
-
-	set_buffer_uptodate(bh);
-	mark_buffer_dirty(bh);
-
-	if (release) {
-		unlock_page(page);
-		page_cache_release(page);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_truncator_page - truncate a partial data block in the page cache
- * @ip: the inode
- * @size: the size the file should be
- *
- * Returns: errno
- */
-
-int
-gfs_truncator_page(struct gfs_inode *ip, uint64_t size)
-{
-	struct inode *inode = ip->i_vnode;
-	struct page *page;
-	struct buffer_head *bh;
-	void *kaddr;
-	uint64_t lbn, dbn;
-	unsigned long index;
-	unsigned int offset;
-	unsigned int bufnum;
-	int not_new = 0;
-	int error;
-
-	lbn = size >> inode->i_blkbits;
-	error = gfs_block_map(ip,
-			      lbn, &not_new,
-			      &dbn, NULL);
-	if (error || !dbn)
-		return error;
-
-	index = size >> PAGE_CACHE_SHIFT;
-	offset = size & (PAGE_CACHE_SIZE - 1);
-	bufnum = lbn - (index << (PAGE_CACHE_SHIFT - inode->i_blkbits));
-
-	/* Not in a transaction here -- a non-disk-I/O error is ok. */
-
-	page = read_cache_page(inode->i_mapping, index,
-			       (filler_t *)inode->i_mapping->a_ops->readpage,
-			       NULL);
-	if (IS_ERR(page))
-		return PTR_ERR(page);
-
-	lock_page(page);
-
-	if (!PageUptodate(page) || PageError(page)) {
-		error = -EIO;
-		goto out;
-	}
-
-	kaddr = kmap(page);
-	memset(kaddr + offset, 0, PAGE_CACHE_SIZE - offset);
-	kunmap(page);
-
-	if (!page_has_buffers(page))
-		create_empty_buffers(page, 1 << inode->i_blkbits,
-				     (1 << BH_Uptodate));
-
-	for (bh = page_buffers(page); bufnum--; bh = bh->b_this_page)
-		/* Do nothing */;
-
-	if (!buffer_mapped(bh))
-		map_bh(bh, inode->i_sb, dbn);
-	else if (gfs_assert_warn(ip->i_sbd,
-				 bh->b_bdev == inode->i_sb->s_bdev &&
-				 bh->b_blocknr == dbn))
-		map_bh(bh, inode->i_sb, dbn);
-
-	set_buffer_uptodate(bh);
-	mark_buffer_dirty(bh);
-
- out:
-	unlock_page(page);
-	page_cache_release(page);
-
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/page.h b/gfs-kernel/src/gfs/page.h
deleted file mode 100644
index c9e0d55..0000000
--- a/gfs-kernel/src/gfs/page.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __PAGE_DOT_H__
-#define __PAGE_DOT_H__
-
-void gfs_inval_pte(struct gfs_glock *gl);
-void gfs_inval_page(struct gfs_glock *gl);
-void gfs_sync_page_i(struct inode *inode, int flags);
-void gfs_sync_page(struct gfs_glock *gl, int flags);
-
-int gfs_unstuffer_page(struct gfs_inode *ip, struct buffer_head *dibh,
-		       uint64_t block, void *private);
-int gfs_truncator_page(struct gfs_inode *ip, uint64_t size);
-
-#endif /* __PAGE_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/proc.c b/gfs-kernel/src/gfs/proc.c
deleted file mode 100644
index 069b39d..0000000
--- a/gfs-kernel/src/gfs/proc.c
+++ /dev/null
@@ -1,490 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/proc_fs.h>
-#include <linux/module.h>
-#include <asm/uaccess.h>
-
-#include "gfs.h"
-#include "glock.h"
-#include "lm.h"
-#include "proc.h"
-#include "super.h"
-
-struct list_head gfs_fs_list;
-struct semaphore gfs_fs_lock;
-char *gfs_proc_margs;
-spinlock_t gfs_proc_margs_lock;
-spinlock_t gfs_req_lock;
-
-/**
- * gfs_proc_fs_add - Add a FS to the list of mounted FSs
- * @sdp:
- *
- */
-
-void
-gfs_proc_fs_add(struct gfs_sbd *sdp)
-{
-	down(&gfs_fs_lock);
-	list_add(&sdp->sd_list, &gfs_fs_list);
-	up(&gfs_fs_lock);
-}
-
-/**
- * gfs_proc_fs_del - Remove a FS from the list of mounted FSs
- * @sdp:
- *
- */
-
-void
-gfs_proc_fs_del(struct gfs_sbd *sdp)
-{
-	down(&gfs_fs_lock);
-	list_del(&sdp->sd_list);
-	up(&gfs_fs_lock);
-}
-
-/**
- * do_list - Copy the list of mountes FSs to userspace
- * @user_buf:
- * @size:
- *
- * @Returns: -errno, or the number of bytes copied to userspace
- */
-
-static ssize_t
-do_list(char *user_buf, size_t size)
-{
-	struct list_head *tmp;
-	struct gfs_sbd *sdp = NULL;
-	unsigned int x;
-	char num[21];
-	char device_id[32];
-	char *buf;
-	int error = 0;
-
-	down(&gfs_fs_lock);
-
-	x = 0;
-	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
-		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
-		sprintf(device_id, "%u:%u", MAJOR(sdp->sd_vfs->s_dev),
-			MINOR(sdp->sd_vfs->s_dev));
-		x += sprintf(num, "%lu", (unsigned long)sdp) +
-			strlen(device_id) +
-			strlen(sdp->sd_fsname) + 3;
-	}
-
-	if (!x)
-		goto out;
-
-	error = -EFBIG;
-	if (x > size)
-		goto out;
-
-	error = -ENOMEM;
-	buf = kmalloc(x + 1, GFP_KERNEL);
-	if (!buf)
-		goto out;
-
-	x = 0;
-	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
-		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
-		sprintf(device_id, "%u:%u", MAJOR(sdp->sd_vfs->s_dev),
-			MINOR(sdp->sd_vfs->s_dev));
-		x += sprintf(buf + x, "%lu %s %s\n",
-			     (unsigned long)sdp, device_id, sdp->sd_fsname);
-	}
-
-	if (copy_to_user(user_buf, buf, x))
-		error = -EFAULT;
-	else
-		error = x;
-
-	kfree(buf);
-
- out:
-	up(&gfs_fs_lock);
-
-	return error;
-}
-
-/**
- * find_argument - 
- * @p:
- *
- * Returns:
- */
-
-static char *
-find_argument(char *p)
-{
-	char *p2;
-
-	while (*p == ' ' || *p == '\n')
-		p++;
-	if (!*p)
-		return NULL;
-	for (p2 = p; *p2; p2++) /* do nothing */;
-	p2--;
-	while (*p2 == ' ' || *p2 == '\n')
-		*p2-- = 0;
-
-	return p;
-}
-
-/**
- * do_freeze - freeze a filesystem
- * @p: the freeze command
- *
- * Returns: errno
- */
-
-static int
-do_freeze(char *p)
-{
-	struct list_head *tmp;
-	struct gfs_sbd *sdp;
-	char num[21];
-	int error = 0;
-
-	p = find_argument(p + 6);
-	if (!p)
-		return -ENOENT;
-
-	down(&gfs_fs_lock);
-
-	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
-		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
-		sprintf(num, "%lu", (unsigned long)sdp);
-		if (strcmp(num, p) == 0)
-			break;
-	}
-
-	if (tmp == &gfs_fs_list)
-		error = -ENOENT;
-	else
-		error = gfs_freeze_fs(sdp);
-
-	up(&gfs_fs_lock);
-
-	return error;
-}
-
-/**
- * do_unfreeze - unfreeze a filesystem
- * @p: the unfreeze command
- *
- * Returns: errno
- */
-
-static int
-do_unfreeze(char *p)
-{
-	struct list_head *tmp;
-	struct gfs_sbd *sdp;
-	char num[21];
-	int error = 0;
-
-	p = find_argument(p + 8);
-	if (!p)
-		return -ENOENT;
-
-	down(&gfs_fs_lock);
-
-	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
-		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
-		sprintf(num, "%lu", (unsigned long)sdp);
-		if (strcmp(num, p) == 0)
-			break;
-	}
-
-	if (tmp == &gfs_fs_list)
-		error = -ENOENT;
-	else
-		gfs_unfreeze_fs(sdp);
-
-	up(&gfs_fs_lock);
-
-	return error;
-}
-
-/**
- * do_margs - Pass in mount arguments
- * @p: the margs command
- *
- * Returns: errno
- */
-
-static int
-do_margs(char *p)
-{
-	char *new_buf, *old_buf;
-
-	p = find_argument(p + 5);
-	if (!p)
-		return -ENOENT;
-
-	new_buf = kmalloc(strlen(p) + 1, GFP_KERNEL);
-	if (!new_buf)
-		return -ENOMEM;
-	strcpy(new_buf, p);
-
-	spin_lock(&gfs_proc_margs_lock);
-	old_buf = gfs_proc_margs;
-	gfs_proc_margs = new_buf;
-	spin_unlock(&gfs_proc_margs_lock);
-
-	if (old_buf)
-		kfree(old_buf);
-
-	return 0;
-}
-
-/**
- * do_withdraw - withdraw a from the cluster for one filesystem
- * @p: the cookie of the filesystem
- *
- * Returns: errno
- */
-
-static int
-do_withdraw(char *p)
-{
-	struct list_head *tmp;
-	struct gfs_sbd *sdp;
-	char num[21];
-	int error = 0;
-
-	p = find_argument(p + 8);
-	if (!p)
-		return -ENOENT;
-
-	down(&gfs_fs_lock);
-
-	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
-		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
-		sprintf(num, "%lu", (unsigned long)sdp);
-		if (strcmp(num, p) == 0)
-			break;
-	}
-
-	if (tmp == &gfs_fs_list)
-		error = -ENOENT;
-	else 
-		gfs_lm_withdraw(sdp,
-				"GFS: fsid=%s: withdrawing from cluster at user's request\n",
-				sdp->sd_fsname);
-
-	up(&gfs_fs_lock);
-
-	return error;
-}
-
-/**
- * do_lockdump - Copy out the lock hash table to userspace
- * @p: the cookie of the filesystem
- * @buf:
- * @size:
- *
- * Returns: errno
- */
-
-static int
-do_lockdump(char *p, char *buf, size_t size)
-{
-	struct list_head *tmp;
-	struct gfs_sbd *sdp;
-	char num[21];
-	struct gfs_user_buffer ub;
-	int error = 0;
-
-	p = find_argument(p + 8);
-	if (!p)
-		return -ENOENT;
-
-	down(&gfs_fs_lock);
-
-	for (tmp = gfs_fs_list.next; tmp != &gfs_fs_list; tmp = tmp->next) {
-		sdp = list_entry(tmp, struct gfs_sbd, sd_list);
-		sprintf(num, "%lu", (unsigned long)sdp);
-		if (strcmp(num, p) == 0)
-			break;
-	}
-
-	if (tmp == &gfs_fs_list)
-		error = -ENOENT;
-	else {
-		ub.ub_data = buf;
-		ub.ub_size = size;
-		ub.ub_count = 0;
-
-		error = gfs_dump_lockstate(sdp, &ub);
-		if (!error)
-			error = ub.ub_count;
-	}
-
-	up(&gfs_fs_lock);
-
-	return error;
-}
-
-/**
- * gfs_proc_write - take a command from userspace
- * @file:
- * @buf:
- * @size:
- * @offset:
- *
- * Returns: -errno or the number of bytes taken
- */
-
-static ssize_t
-gfs_proc_write(struct file *file, const char *buf, size_t size, loff_t *offset)
-{
-	char *p;
-
-	spin_lock(&gfs_req_lock);
-	p = file->private_data;
-	file->private_data = NULL;
-	spin_unlock(&gfs_req_lock);
-
-	if (p)
-		kfree(p);
-
-	if (!size)
-		return -EINVAL;
-
-	p = kmalloc(size + 1, GFP_KERNEL);
-	if (!p)
-		return -ENOMEM;
-	p[size] = 0;
-
-	if (copy_from_user(p, buf, size)) {
-		kfree(p);
-		return -EFAULT;
-	}
-
-	spin_lock(&gfs_req_lock);
-	file->private_data = p;
-	spin_unlock(&gfs_req_lock);
-
-	return size;
-}
-
-/**
- * gfs_proc_read - return the results of a command
- * @file:
- * @buf:
- * @size:
- * @offset:
- *
- * Returns: -errno or the number of bytes returned
- */
-
-static ssize_t
-gfs_proc_read(struct file *file, char *buf, size_t size, loff_t *offset)
-{
-	char *p;
-	int error;
-
-	spin_lock(&gfs_req_lock);
-	p = file->private_data;
-	file->private_data = NULL;
-	spin_unlock(&gfs_req_lock);
-
-	if (!p)
-		return -ENOENT;
-
-	if (!size) {
-		kfree(p);
-		return -EINVAL;
-	}
-
-	if (strncmp(p, "list", 4) == 0)
-		error = do_list(buf, size);
-	else if (strncmp(p, "freeze", 6) == 0)
-		error = do_freeze(p);
-	else if (strncmp(p, "unfreeze", 8) == 0)
-		error = do_unfreeze(p);
-	else if (strncmp(p, "margs", 5) == 0)
-		error = do_margs(p);
-	else if (strncmp(p, "withdraw", 8) == 0)
-		error = do_withdraw(p);
-	else if (strncmp(p, "lockdump", 8) == 0)
-		error = do_lockdump(p, buf, size);
-	else
-		error = -ENOSYS;
-
-	kfree(p);
-
-	return error;
-}
-
-/**
- * gfs_proc_close - free any mismatches writes
- * @inode:
- * @file:
- *
- * Returns: 0
- */
-
-static int
-gfs_proc_close(struct inode *inode, struct file *file)
-{
-	if (file->private_data)
-		kfree(file->private_data);
-	return 0;
-}
-
-static struct file_operations gfs_proc_fops =
-{
-	.owner = THIS_MODULE,
-	.write = gfs_proc_write,
-	.read = gfs_proc_read,
-	.release = gfs_proc_close,
-};
-
-/**
- * gfs_proc_init - initialize GFS' proc interface
- *
- */
-
-int
-gfs_proc_init(void)
-{
-	struct proc_dir_entry *pde;
-
-	INIT_LIST_HEAD(&gfs_fs_list);
-	init_MUTEX(&gfs_fs_lock);
-	gfs_proc_margs = NULL;
-	spin_lock_init(&gfs_proc_margs_lock);
-	spin_lock_init(&gfs_req_lock);
-
-	pde = create_proc_entry("fs/gfs", S_IFREG | 0600, NULL);
-	if (!pde)
-		return -ENOMEM;
-
-	pde->proc_fops = &gfs_proc_fops;
-
-	return 0;
-}
-
-/**
- * gfs_proc_uninit - uninitialize GFS' proc interface
- *
- */
-
-void
-gfs_proc_uninit(void)
-{
-	if (gfs_proc_margs)
-		kfree(gfs_proc_margs);
-	remove_proc_entry("fs/gfs", NULL);
-}
-
diff --git a/gfs-kernel/src/gfs/proc.h b/gfs-kernel/src/gfs/proc.h
deleted file mode 100644
index ea8c261..0000000
--- a/gfs-kernel/src/gfs/proc.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __PROC_DOT_H__
-#define __PROC_DOT_H__
-
-/* Allow args to be passed to GFS when using an initial ram disk */
-extern char *gfs_proc_margs;
-extern spinlock_t gfs_proc_margs_lock;
-
-void gfs_proc_fs_add(struct gfs_sbd *sdp);
-void gfs_proc_fs_del(struct gfs_sbd *sdp);
-
-int gfs_proc_init(void);
-void gfs_proc_uninit(void);
-
-#endif /* __PROC_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/quota.c b/gfs-kernel/src/gfs/quota.c
deleted file mode 100644
index df45487..0000000
--- a/gfs-kernel/src/gfs/quota.c
+++ /dev/null
@@ -1,1140 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/tty.h>
-#include <linux/cred.h>
-
-#include "gfs.h"
-#include "bmap.h"
-#include "file.h"
-#include "glock.h"
-#include "glops.h"
-#include "log.h"
-#include "quota.h"
-#include "rgrp.h"
-#include "super.h"
-#include "trans.h"
-
-/**
- * gfs_quota_get - Get a structure to represent a quota change
- * @sdp: the filesystem
- * @user: TRUE if this is a user quota
- * @id: the uid or gid
- * @create: if TRUE, create the structure, otherwise return NULL
- * @qdp: the returned quota structure
- *
- * Returns: errno
- */
-
-int
-gfs_quota_get(struct gfs_sbd *sdp, int user, uint32_t id, int create,
-	      struct gfs_quota_data **qdp)
-{
-	struct gfs_quota_data *qd = NULL, *new_qd = NULL;
-	struct list_head *tmp, *head;
-	int error;
-
-	*qdp = NULL;
-
-	for (;;) {
-		spin_lock(&sdp->sd_quota_lock);
-
-		for (head = &sdp->sd_quota_list, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			qd = list_entry(tmp, struct gfs_quota_data, qd_list);
-			if (qd->qd_id == id &&
-			    !test_bit(QDF_USER, &qd->qd_flags) == !user) {
-				qd->qd_count++;
-				break;
-			}
-		}
-
-		if (tmp == head)
-			qd = NULL;
-
-		if (!qd && new_qd) {
-			qd = new_qd;
-			list_add(&qd->qd_list, &sdp->sd_quota_list);
-			new_qd = NULL;
-		}
-
-		spin_unlock(&sdp->sd_quota_lock);
-
-		if (qd || !create) {
-			if (new_qd) {
-				gfs_lvb_unhold(new_qd->qd_gl);
-				kfree(new_qd);
-				atomic_dec(&sdp->sd_quota_count);
-			}
-			*qdp = qd;
-			return 0;
-		}
-
-		new_qd = kmalloc(sizeof(struct gfs_quota_data), GFP_KERNEL);
-		if (!new_qd)
-			return -ENOMEM;
-		memset(new_qd, 0, sizeof(struct gfs_quota_data));
-
-		new_qd->qd_count = 1;
-
-		new_qd->qd_id = id;
-		if (user)
-			set_bit(QDF_USER, &new_qd->qd_flags);
-
-		INIT_LIST_HEAD(&new_qd->qd_le_list);
-
-		error = gfs_glock_get(sdp, 2 * (uint64_t)id + ((user) ? 0 : 1),
-				      &gfs_quota_glops, CREATE,
-				      &new_qd->qd_gl);
-		if (error) {
-			kfree(new_qd);
-			return error;
-		}
-
-		error = gfs_lvb_hold(new_qd->qd_gl);
-
-		gfs_glock_put(new_qd->qd_gl);
-
-		if (error) {
-			kfree(new_qd);
-			return error;
-		}
-
-		atomic_inc(&sdp->sd_quota_count);
-	}
-}
-
-/**
- * gfs_quota_hold - increment the usage count on a struct gfs_quota_data
- * @sdp: the filesystem
- * @qd: the structure
- *
- */
-
-void
-gfs_quota_hold(struct gfs_sbd *sdp, struct gfs_quota_data *qd)
-{
-	spin_lock(&sdp->sd_quota_lock);
-	gfs_assert(sdp, qd->qd_count,);
-	qd->qd_count++;
-	spin_unlock(&sdp->sd_quota_lock);
-}
-
-/**
- * gfs_quota_put - decrement the usage count on a struct gfs_quota_data
- * @sdp: the filesystem
- * @qd: the structure
- *
- * Free the structure if its reference count hits zero.
- *
- */
-
-void
-gfs_quota_put(struct gfs_sbd *sdp, struct gfs_quota_data *qd)
-{
-	spin_lock(&sdp->sd_quota_lock);
-	gfs_assert(sdp, qd->qd_count,);
-	qd->qd_count--;
-	spin_unlock(&sdp->sd_quota_lock);
-}
-
-/**
- * quota_find - Find a quota change to sync to the quota file
- * @sdp: the filesystem
- *
- * The returned structure is locked and needs to be unlocked
- * with quota_unlock().
- *
- * Returns: A quota structure, or NULL
- */
-
-static struct gfs_quota_data *
-quota_find(struct gfs_sbd *sdp)
-{
-	struct list_head *tmp, *head;
-	struct gfs_quota_data *qd = NULL;
-
-	if (test_bit(SDF_ROFS, &sdp->sd_flags))
-		return NULL;
-
-	gfs_log_lock(sdp);
-	spin_lock(&sdp->sd_quota_lock);
-
-	if (!atomic_read(&sdp->sd_quota_od_count))
-		goto out;
-
-	for (head = &sdp->sd_quota_list, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		qd = list_entry(tmp, struct gfs_quota_data, qd_list);
-
-		if (test_bit(QDF_LOCK, &qd->qd_flags))
-			continue;
-		if (!test_bit(QDF_OD_LIST, &qd->qd_flags))
-			continue;
-		if (qd->qd_sync_gen >= sdp->sd_quota_sync_gen)
-			continue;
-
-		list_move_tail(&qd->qd_list, &sdp->sd_quota_list);
-
-		set_bit(QDF_LOCK, &qd->qd_flags);
-		qd->qd_count++;
-		qd->qd_change_sync = qd->qd_change_od;
-
-		goto out;
-	}
-
-	qd = NULL;
-
- out:
-	spin_unlock(&sdp->sd_quota_lock);
-	gfs_log_unlock(sdp);
-
-	return qd;
-}
-
-/**
- * quota_trylock - Try to lock a given quota entry
- * @sdp: the filesystem
- * @qd: the quota data structure
- *
- * Returns: TRUE if the lock was successful, FALSE, otherwise
- */
-
-static int
-quota_trylock(struct gfs_sbd *sdp, struct gfs_quota_data *qd)
-{
-	int ret = FALSE;
-
-	if (test_bit(SDF_ROFS, &sdp->sd_flags))
-		return FALSE;
-
-	gfs_log_lock(sdp);
-	spin_lock(&sdp->sd_quota_lock);
-
-	if (test_bit(QDF_LOCK, &qd->qd_flags))
-		goto out;
-	if (!test_bit(QDF_OD_LIST, &qd->qd_flags))
-		goto out;
-
-	list_move_tail(&qd->qd_list, &sdp->sd_quota_list);
-
-	set_bit(QDF_LOCK, &qd->qd_flags);
-	qd->qd_count++;
-	qd->qd_change_sync = qd->qd_change_od;
-
-	ret = TRUE;
-
- out:
-	spin_unlock(&sdp->sd_quota_lock);
-	gfs_log_unlock(sdp);
-
-	return ret;
-}
-
-/**
- * quota_unlock - drop and a reference on a quota structure
- * @sdp: the filesystem
- * @qd: the quota inode structure
- *
- */
-
-static void
-quota_unlock(struct gfs_sbd *sdp, struct gfs_quota_data *qd)
-{
-	spin_lock(&sdp->sd_quota_lock);
-
-	gfs_assert_warn(sdp, test_bit(QDF_LOCK, &qd->qd_flags));
-	clear_bit(QDF_LOCK, &qd->qd_flags);
-
-	gfs_assert(sdp, qd->qd_count,);
-	qd->qd_count--;
-
-	spin_unlock(&sdp->sd_quota_lock);
-}
-
-/**
- * gfs_quota_merge - add/remove a quota change from the in-memory list
- * @sdp: the filesystem
- * @tag: the quota change tag
- *
- * Returns: errno
- */
-
-int
-gfs_quota_merge(struct gfs_sbd *sdp, struct gfs_quota_tag *tag)
-{
-	struct gfs_quota_data *qd;
-	int error;
-
-	error = gfs_quota_get(sdp,
-			      tag->qt_flags & GFS_QTF_USER, tag->qt_id,
-			      CREATE, &qd);
-	if (error)
-		return error;
-
-	gfs_assert(sdp, qd->qd_change_ic == qd->qd_change_od,);
-
-	gfs_log_lock(sdp);
-
-	qd->qd_change_ic += tag->qt_change;
-	qd->qd_change_od += tag->qt_change;
-
-	if (qd->qd_change_od) {
-		if (!test_bit(QDF_OD_LIST, &qd->qd_flags)) {
-			gfs_quota_hold(sdp, qd);
-			set_bit(QDF_OD_LIST, &qd->qd_flags);
-			atomic_inc(&sdp->sd_quota_od_count);
-		}
-	} else {
-		gfs_assert_warn(sdp, test_bit(QDF_OD_LIST, &qd->qd_flags));
-		clear_bit(QDF_OD_LIST, &qd->qd_flags);
-		gfs_quota_put(sdp, qd);
-		gfs_assert(sdp, atomic_read(&sdp->sd_quota_od_count) > 0,);
-		atomic_dec(&sdp->sd_quota_od_count);
-	}
-
-	gfs_log_unlock(sdp);
-
-	gfs_quota_put(sdp, qd);
-
-	return 0;
-}
-
-/**
- * gfs_quota_scan - Look for unused struct gfs_quota_data structures to throw away
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_quota_scan(struct gfs_sbd *sdp)
-{
-	struct list_head *head, *tmp, *next;
-	struct gfs_quota_data *qd;
-	LIST_HEAD(dead);
-
-	spin_lock(&sdp->sd_quota_lock);
-
-	for (head = &sdp->sd_quota_list, tmp = head->next, next = tmp->next;
-	     tmp != head;
-	     tmp = next, next = next->next) {
-		qd = list_entry(tmp, struct gfs_quota_data, qd_list);
-		if (!qd->qd_count)
-			list_move(&qd->qd_list, &dead);
-	}
-
-	spin_unlock(&sdp->sd_quota_lock);
-
-	while (!list_empty(&dead)) {
-		qd = list_entry(dead.next, struct gfs_quota_data, qd_list);
-
-		gfs_assert_warn(sdp, !qd->qd_count);
-		gfs_assert_warn(sdp, !test_bit(QDF_OD_LIST, &qd->qd_flags) &&
-				!test_bit(QDF_LOCK, &qd->qd_flags));
-		gfs_assert_warn(sdp, !qd->qd_change_new && !qd->qd_change_ic &&
-				!qd->qd_change_od);
-
-		list_del(&qd->qd_list);
-		gfs_lvb_unhold(qd->qd_gl);
-		kfree(qd);
-		atomic_dec(&sdp->sd_quota_count);
-	}
-}
-
-/**
- * gfs_quota_cleanup - get rid of any extra struct gfs_quota_data structures
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_quota_cleanup(struct gfs_sbd *sdp)
-{
-	struct gfs_quota_data *qd;
-
- restart:
-	gfs_log_lock(sdp);
-
-	spin_lock(&sdp->sd_quota_lock);
-
-	while (!list_empty(&sdp->sd_quota_list)) {
-		qd = list_entry(sdp->sd_quota_list.next,
-				struct gfs_quota_data,
-				qd_list);
-
-		if (qd->qd_count > 1) {
-			spin_unlock(&sdp->sd_quota_lock);
-			gfs_log_unlock(sdp);
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ);
-			goto restart;
-
-		} else if (qd->qd_count) {
-			gfs_assert_warn(sdp,
-					test_bit(QDF_OD_LIST, &qd->qd_flags) &&
-					!test_bit(QDF_LOCK, &qd->qd_flags));
-			gfs_assert_warn(sdp, qd->qd_change_od &&
-					qd->qd_change_od == qd->qd_change_ic);
-			gfs_assert_warn(sdp, !qd->qd_change_new);
-
-			list_del(&qd->qd_list);
-			atomic_dec(&sdp->sd_quota_od_count);
-
-			spin_unlock(&sdp->sd_quota_lock);
-			gfs_lvb_unhold(qd->qd_gl);
-			kfree(qd);
-			atomic_dec(&sdp->sd_quota_count);
-			spin_lock(&sdp->sd_quota_lock);
-
-		} else {
-			gfs_assert_warn(sdp,
-					!test_bit(QDF_OD_LIST, &qd->qd_flags) &&
-					!test_bit(QDF_LOCK, &qd->qd_flags));
-			gfs_assert_warn(sdp, !qd->qd_change_new &&
-					!qd->qd_change_ic &&
-					!qd->qd_change_od);
-
-			list_del(&qd->qd_list);
-
-			spin_unlock(&sdp->sd_quota_lock);
-			gfs_lvb_unhold(qd->qd_gl);
-			kfree(qd);
-			atomic_dec(&sdp->sd_quota_count);
-			spin_lock(&sdp->sd_quota_lock);
-		}
-	}
-
-	spin_unlock(&sdp->sd_quota_lock);
-
-	gfs_assert(sdp, !atomic_read(&sdp->sd_quota_od_count),);
-
-	gfs_log_unlock(sdp);
-}
-
-/**
- * sort_qd - figure out the order between two quota data structures
- * @a: first quota data structure
- * @b: second quota data structure
- *
- * Returns: -1 if @a comes before @b, 0 if @a equals @b, 1 if @b comes before @a
- */
-
-static int
-sort_qd(const void *a, const void *b)
-{
-	struct gfs_quota_data *qd_a = *(struct gfs_quota_data **)a;
-	struct gfs_quota_data *qd_b = *(struct gfs_quota_data **)b;
-	int ret = 0;
-
-	if (!test_bit(QDF_USER, &qd_a->qd_flags) !=
-	    !test_bit(QDF_USER, &qd_b->qd_flags)) {
-		if (test_bit(QDF_USER, &qd_a->qd_flags))
-			ret = -1;
-		else
-			ret = 1;
-	} else {
-		if (qd_a->qd_id < qd_b->qd_id)
-			ret = -1;
-		else if (qd_a->qd_id > qd_b->qd_id)
-			ret = 1;
-	}
-
-	return ret;
-}
-
-/**
- * do_quota_sync - Sync a bunch quota changes to the quota file
- * @sdp: the filesystem
- * @qda: an array of struct gfs_quota_data structures to be synced
- * @num_qd: the number of elements in @qda
- *
- * Returns: errno
- */
-
-static int
-do_quota_sync(struct gfs_sbd *sdp, struct gfs_quota_data **qda,
-	      unsigned int num_qd)
-{
-	struct gfs_inode *ip = sdp->sd_qinode;
-	struct gfs_alloc *al = NULL;
-	struct gfs_holder i_gh, *ghs;
-	struct gfs_quota q;
-	char buf[sizeof(struct gfs_quota)];
-	uint64_t offset;
-	unsigned int qx, x;
-	int ar;
-	unsigned int nalloc = 0;
-	unsigned int data_blocks, ind_blocks;
-	int error;
-
-	gfs_write_calc_reserv(ip, sizeof(struct gfs_quota), &data_blocks,
-			      &ind_blocks);
-
-	ghs = kmalloc(num_qd * sizeof(struct gfs_holder), GFP_KERNEL);
-	if (!ghs)
-		return -ENOMEM;
-
-	gfs_sort(qda, num_qd, sizeof (struct gfs_quota_data *), sort_qd);
-	for (qx = 0; qx < num_qd; qx++) {
-		error = gfs_glock_nq_init(qda[qx]->qd_gl,
-					  LM_ST_EXCLUSIVE,
-					  GL_NOCACHE, &ghs[qx]);
-		if (error)
-			goto fail;
-	}
-
-	error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
-	if (error)
-		goto fail;
-
-	for (x = 0; x < num_qd; x++) {
-		offset = (2 * (uint64_t)qda[x]->qd_id +
-			  ((test_bit(QDF_USER, &qda[x]->qd_flags)) ? 0 : 1)) *
-			sizeof(struct gfs_quota);
-
-		error = gfs_write_alloc_required(ip, offset,
-						 sizeof(struct gfs_quota),
-						 &ar);
-		if (error)
-			goto fail_gunlock;
-
-		if (ar)
-			nalloc++;
-	}
-
-	if (nalloc) {
-		al = gfs_alloc_get(ip);
-
-		error =
-		    gfs_quota_hold_m(ip, NO_QUOTA_CHANGE,
-					   NO_QUOTA_CHANGE);
-		if (error)
-			goto fail_alloc;
-
-		al->al_requested_meta = nalloc * (data_blocks + ind_blocks);
-
-		error = gfs_inplace_reserve(ip);
-		if (error)
-			goto fail_qs;
-
-		/* Trans may require:
-		   two (journaled) data blocks, a dinode block, RG bitmaps to allocate from,
-		   indirect blocks, and a quota block */
-
-		error = gfs_trans_begin(sdp,
-					1 + al->al_rgd->rd_ri.ri_length +
-					num_qd * data_blocks +
-					nalloc * ind_blocks,
-					gfs_struct2blk(sdp, num_qd + 2,
-						       sizeof(struct gfs_quota_tag)));
-		if (error)
-			goto fail_ipres;
-	} else {
-		/* Trans may require:
-		   Data blocks, a dinode block, and quota blocks */
-
-		error = gfs_trans_begin(sdp,
-					1 + data_blocks * num_qd,
-					gfs_struct2blk(sdp, num_qd,
-						       sizeof(struct gfs_quota_tag)));
-		if (error)
-			goto fail_gunlock;
-	}
-
-	for (x = 0; x < num_qd; x++) {
-		offset = (2 * (uint64_t)qda[x]->qd_id +
-			  ((test_bit(QDF_USER, &qda[x]->qd_flags)) ? 0 : 1)) *
-			sizeof(struct gfs_quota);
-
-		/*  The quota file may not be a multiple of sizeof(struct gfs_quota) bytes.  */
-		memset(buf, 0, sizeof(struct gfs_quota));
-
-		error = gfs_internal_read(ip, buf, offset,
-					  sizeof(struct gfs_quota));
-		if (error < 0)
-			goto fail_end_trans;
-
-		gfs_quota_in(&q, buf);
-		q.qu_value += qda[x]->qd_change_sync;
-		gfs_quota_out(&q, buf);
-
-		error = gfs_internal_write(ip, buf, offset,
-					   sizeof(struct gfs_quota));
-		if (error < 0)
-			goto fail_end_trans;
-		else if (error != sizeof(struct gfs_quota)) {
-			error = -EIO;
-			goto fail_end_trans;
-		}
-
-		if (test_bit(QDF_USER, &qda[x]->qd_flags))
-			gfs_trans_add_quota(sdp, -qda[x]->qd_change_sync,
-					    qda[x]->qd_id, NO_QUOTA_CHANGE);
-		else
-			gfs_trans_add_quota(sdp, -qda[x]->qd_change_sync,
-					    NO_QUOTA_CHANGE, qda[x]->qd_id);
-
-		memset(&qda[x]->qd_qb, 0, sizeof(struct gfs_quota_lvb));
-		qda[x]->qd_qb.qb_magic = GFS_MAGIC;
-		qda[x]->qd_qb.qb_limit = q.qu_limit;
-		qda[x]->qd_qb.qb_warn = q.qu_warn;
-		qda[x]->qd_qb.qb_value = q.qu_value;
-
-		gfs_quota_lvb_out(&qda[x]->qd_qb, qda[x]->qd_gl->gl_lvb);
-	}
-
-	gfs_trans_end(sdp);
-
-	if (nalloc) {
-		gfs_assert_warn(sdp, al->al_alloced_meta);
-		gfs_inplace_release(ip);
-		gfs_quota_unhold_m(ip);
-		gfs_alloc_put(ip);
-	}
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	for (x = 0; x < num_qd; x++)
-		gfs_glock_dq_uninit(&ghs[x]);
-
-	kfree(ghs);
-
-	gfs_log_flush_glock(ip->i_gl);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_ipres:
-	if (nalloc)
-		gfs_inplace_release(ip);
-
- fail_qs:
-	if (nalloc)
-		gfs_quota_unhold_m(ip);
-
- fail_alloc:
-	if (nalloc)
-		gfs_alloc_put(ip);
-
- fail_gunlock:
-	gfs_glock_dq_uninit(&i_gh);
-
- fail:
-	while (qx--)
-		gfs_glock_dq_uninit(&ghs[qx]);
-
-	kfree(ghs);
-
-	return error;
-}
-
-/**
- * glock_q - Acquire a lock for a quota entry
- * @sdp: the filesystem
- * @qd: the quota data structure to glock
- * @force_refresh: If TRUE, always read from the quota file
- * @q_gh: the glock holder for the quota lock
- *
- * Returns: errno
- */
-
-static int
-glock_q(struct gfs_sbd *sdp, struct gfs_quota_data *qd, int force_refresh,
-	struct gfs_holder *q_gh)
-{
-	struct gfs_holder i_gh;
-	struct gfs_quota q;
-	char buf[sizeof(struct gfs_quota)];
-	int error;
-
- restart:
-	error = gfs_glock_nq_init(qd->qd_gl, LM_ST_SHARED, 0, q_gh);
-	if (error)
-		return error;
-
-	gfs_quota_lvb_in(&qd->qd_qb, qd->qd_gl->gl_lvb);
-
-	if (force_refresh ||
-	    qd->qd_qb.qb_magic != GFS_MAGIC) {
-		gfs_glock_dq_uninit(q_gh);
-		error = gfs_glock_nq_init(qd->qd_gl,
-					  LM_ST_EXCLUSIVE, GL_NOCACHE,
-					  q_gh);
-		if (error)
-			return error;
-
-		error = gfs_glock_nq_init(sdp->sd_qinode->i_gl,
-					  LM_ST_SHARED, 0,
-					  &i_gh);
-		if (error)
-			goto fail;
-
-		memset(buf, 0, sizeof(struct gfs_quota));
-
-		error = gfs_internal_read(sdp->sd_qinode, buf,
-					  (2 * (uint64_t)qd->qd_id +
-					   ((test_bit(QDF_USER, &qd->qd_flags)) ? 0 : 1)) *
-					  sizeof(struct gfs_quota),
-					  sizeof(struct gfs_quota));
-		if (error < 0)
-			goto fail_gunlock;
-
-		gfs_glock_dq_uninit(&i_gh);
-
-		gfs_quota_in(&q, buf);
-
-		memset(&qd->qd_qb, 0, sizeof(struct gfs_quota_lvb));
-		qd->qd_qb.qb_magic = GFS_MAGIC;
-		qd->qd_qb.qb_limit = q.qu_limit;
-		qd->qd_qb.qb_warn = q.qu_warn;
-		qd->qd_qb.qb_value = q.qu_value;
-
-		gfs_quota_lvb_out(&qd->qd_qb, qd->qd_gl->gl_lvb);
-
-		gfs_glock_dq_uninit(q_gh);
-		force_refresh = FALSE;
-		goto restart;
-	}
-
-	return 0;
-
- fail_gunlock:
-	gfs_glock_dq_uninit(&i_gh);
-
- fail:
-	gfs_glock_dq_uninit(q_gh);
-
-	return error;
-}
-
-/**
- * gfs_quota_hold_m - Hold the quota structures for up to 4 IDs
- * @ip: Two of the IDs are the UID and GID from this file
- * @uid: a UID or the constant NO_QUOTA_CHANGE
- * @gid: a GID or the constant NO_QUOTA_CHANGE
- *
- * The struct gfs_quota_data structures representing the locks are
- * stored in the ip->i_alloc->al_qd array.
- * 
- * Returns:  errno
- */
-
-int
-gfs_quota_hold_m(struct gfs_inode *ip, uint32_t uid, uint32_t gid)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	unsigned int x = 0;
-	int error;
-
-	if (gfs_assert_warn(sdp, !al->al_qd_num &&
-			    !test_bit(GIF_QD_LOCKED, &ip->i_flags)))
-		return -EIO;
-
-	if (!gfs_tune_get(sdp, gt_quota_account))
-		return 0;
-
-	error = gfs_quota_get(sdp, TRUE, ip->i_di.di_uid,
-			      CREATE, &al->al_qd[x]);
-	if (error)
-		goto fail;
-	x++;
-
-	error = gfs_quota_get(sdp, FALSE, ip->i_di.di_gid,
-			      CREATE, &al->al_qd[x]);
-	if (error)
-		goto fail;
-	x++;
-
-	if (uid != NO_QUOTA_CHANGE) {
-		error = gfs_quota_get(sdp, TRUE, uid,
-				      CREATE, &al->al_qd[x]);
-		if (error)
-			goto fail;
-		x++;
-	}
-
-	if (gid != NO_QUOTA_CHANGE) {
-		error = gfs_quota_get(sdp, FALSE, gid,
-				      CREATE, &al->al_qd[x]);
-		if (error)
-			goto fail;
-		x++;
-	}
-
-	al->al_qd_num = x;
-
-	return 0;
-
- fail:
-	if (x) {
-		al->al_qd_num = x;
-		gfs_quota_unhold_m(ip);
-	}
-
-	return error;
-}
-
-/**
- * gfs_quota_unhold_m - throw away some quota locks
- * @ip: the inode who's ip->i_alloc->al_qd array holds the structures
- *
- */
-
-void
-gfs_quota_unhold_m(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	unsigned int x;
-
-	gfs_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags));
-
-	for (x = 0; x < al->al_qd_num; x++) {
-		gfs_quota_put(sdp, al->al_qd[x]);
-		al->al_qd[x] = NULL;
-	}
-	al->al_qd_num = 0;
-}
-
-/**
- * gfs_quota_lock_m - Acquire the quota locks for up to 4 IDs
- * @ip: Two of the IDs are the UID and GID from this file
- * @uid: a UID or the constant NO_QUOTA_CHANGE
- * @gid: a GID or the constant NO_QUOTA_CHANGE
- *
- * The struct gfs_quota_data structures representing the locks are
- * stored in the ip->i_alloc->al_qd array.
- * 
- * Returns:  errno
- */
-
-int
-gfs_quota_lock_m(struct gfs_inode *ip, uint32_t uid, uint32_t gid)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	unsigned int x;
-	int error;
-
-	gfs_quota_hold_m(ip, uid, gid);
-
-	if (!gfs_tune_get(sdp, gt_quota_enforce))
-		return 0;
-	if (capable(CAP_SYS_RESOURCE))
-		return 0;
-
-	gfs_sort(al->al_qd, al->al_qd_num,
-		 sizeof(struct gfs_quota_data *), sort_qd);
-
-	for (x = 0; x < al->al_qd_num; x++) {
-		error = glock_q(sdp, al->al_qd[x], FALSE, &al->al_qd_ghs[x]);
-		if (error)
-			goto fail;
-	}
-
-	set_bit(GIF_QD_LOCKED, &ip->i_flags);
-
-	return 0;
-
-      fail:
-	while (x--)
-		gfs_glock_dq_uninit(&al->al_qd_ghs[x]);
-
-	return error;
-}
-
-/**
- * gfs_quota_unlock_m - drop some quota locks
- * @ip: the inode who's ip->i_alloc->al_qd array holds the locks
- *
- */
-
-void
-gfs_quota_unlock_m(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	struct gfs_quota_data *qd, *qda[4];
-	int64_t value;
-	unsigned int count = 0;
-	unsigned int x;
-	int do_sync;
-
-	if (!test_and_clear_bit(GIF_QD_LOCKED, &ip->i_flags))
-		goto out;
-
-	for (x = 0; x < al->al_qd_num; x++) {
-		qd = al->al_qd[x];
-
-		spin_lock(&sdp->sd_quota_lock);
-		value = qd->qd_change_new + qd->qd_change_ic;
-		spin_unlock(&sdp->sd_quota_lock);
-
-		do_sync = TRUE;
-		if (!qd->qd_qb.qb_limit)
-			do_sync = FALSE;
-		else if (qd->qd_qb.qb_value >= (int64_t)qd->qd_qb.qb_limit)
-			do_sync = FALSE;
-		else {
-			struct gfs_tune *gt = &sdp->sd_tune;
-			unsigned int num, den;
-			int64_t v;
-
-			spin_lock(&gt->gt_spin);
-			num = gt->gt_quota_scale_num;
-			den = gt->gt_quota_scale_den;
-			spin_unlock(&gt->gt_spin);
-
-			v = value * gfs_num_journals(sdp) * num;
-			do_div(v, den);
-			v += qd->qd_qb.qb_value;
-			if (v < (int64_t)qd->qd_qb.qb_limit)
-				do_sync = FALSE;
-		}
-
-		gfs_glock_dq_uninit(&al->al_qd_ghs[x]);
-
-		if (do_sync) {
-			gfs_log_flush(sdp);
-			if (quota_trylock(sdp, qd))
-				qda[count++] = qd;
-		}
-	}
-
-	if (count) {
-		do_quota_sync(sdp, qda, count);
-
-		for (x = 0; x < count; x++)
-			quota_unlock(sdp, qda[x]);
-	}
-
- out:
-	gfs_quota_unhold_m(ip);
-}
-
-/**
- * print_quota_message - print a message to the user's tty about quotas
- * @sdp: the filesystem
- * @qd: the quota ID that the message is about
- * @type: the type of message ("exceeded" or "warning")
- *
- * Returns: errno
- */
-
-static int
-print_quota_message(struct gfs_sbd *sdp, struct gfs_quota_data *qd, char *type)
-{
-	struct tty_struct *tty;
-	char *line;
-	int len;
-
-	line = kmalloc(256, GFP_KERNEL);
-	if (!line)
-		return -ENOMEM;
-
-	len = snprintf(line, 256, "GFS: fsid=%s: quota %s for %s %u\r\n",
-		       sdp->sd_fsname, type,
-		       (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group",
-		       qd->qd_id);
-
-	if (current->signal) {
-		tty = current->signal->tty;
-		if (tty && tty->ops->write)
-			tty->ops->write(tty, line, len);
-	}
-
-	kfree(line);
-
-	return 0;
-}
-
-/**
- * gfs_quota_check - Check to see if a block allocation is possible
- * @ip: the inode who's ip->i_res.ir_qd array holds the quota locks
- * @uid: the UID the block is allocated for
- * @gid: the GID the block is allocated for
- *
- */
-
-int
-gfs_quota_check(struct gfs_inode *ip, uint32_t uid, uint32_t gid)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	struct gfs_quota_data *qd;
-	int64_t value;
-	unsigned int x;
-	int error = 0;
-
-	if (!al)
-		return 0;
-
-	if (!gfs_tune_get(sdp, gt_quota_enforce))
-		return 0;
-
-	for (x = 0; x < al->al_qd_num; x++) {
-		qd = al->al_qd[x];
-
-		if (!((qd->qd_id == uid && test_bit(QDF_USER, &qd->qd_flags)) ||
-		      (qd->qd_id == gid && !test_bit(QDF_USER, &qd->qd_flags))))
-			continue;
-
-		spin_lock(&sdp->sd_quota_lock);
-		value = qd->qd_change_new + qd->qd_change_ic;
-		spin_unlock(&sdp->sd_quota_lock);
-		value += qd->qd_qb.qb_value;
-
-		if (qd->qd_qb.qb_limit && (int64_t)qd->qd_qb.qb_limit < value) {
-			print_quota_message(sdp, qd, "exceeded");
-			error = -EDQUOT;
-			break;
-		} else if (qd->qd_qb.qb_warn &&
-			   (int64_t)qd->qd_qb.qb_warn < value &&
-			   time_after_eq(jiffies,
-					 qd->qd_last_warn +
-					 gfs_tune_get(sdp, gt_quota_warn_period) * HZ)) {
-			error = print_quota_message(sdp, qd, "warning");
-			qd->qd_last_warn = jiffies;
-		}
-	}
-
-	return error;
-}
-
-/**
- * gfs_quota_sync - Sync quota changes to the quota file
- * @sdp: the filesystem
- *
- * Returns: errno
- */
-
-int
-gfs_quota_sync(struct gfs_sbd *sdp)
-{
-	struct gfs_quota_data **qda;
-	unsigned int max_qd = gfs_tune_get(sdp, gt_quota_simul_sync);
-	unsigned int num_qd;
-	unsigned int x;
-	int error = 0;
-
-	sdp->sd_quota_sync_gen++;
-
-	qda = kmalloc(max_qd * sizeof(struct gfs_quota_data *), GFP_KERNEL);
-	if (!qda)
-		return -ENOMEM;
-	memset(qda, 0, max_qd * sizeof(struct gfs_quota_data *));
-
-	do {
-		num_qd = 0;
-
-		for (;;) {
-			qda[num_qd] = quota_find(sdp);
-			if (!qda[num_qd])
-				break;
-
-			if (++num_qd == max_qd)
-				break;
-		}
-
-		if (num_qd) {
-			error = do_quota_sync(sdp, qda, num_qd);
-			if (!error)
-				for (x = 0; x < num_qd; x++)
-					qda[x]->qd_sync_gen =
-						sdp->sd_quota_sync_gen;
-
-			for (x = 0; x < num_qd; x++)
-				quota_unlock(sdp, qda[x]);
-		}
-	}
-	while (!error && num_qd == max_qd);
-
-	kfree(qda);
-
-	return error;
-}
-
-/**
- * gfs_quota_refresh - Refresh the LVB for a given quota ID
- * @sdp: the filesystem
- * @user:
- * @id:
- *
- * Returns: errno
- */
-
-int
-gfs_quota_refresh(struct gfs_sbd *sdp, int user, uint32_t id)
-{
-	struct gfs_quota_data *qd;
-	struct gfs_holder q_gh;
-	int error;
-
-	error = gfs_quota_get(sdp, user, id, CREATE, &qd);
-	if (error)
-		return error;
-
-	error = glock_q(sdp, qd, TRUE, &q_gh);
-	if (!error)
-		gfs_glock_dq_uninit(&q_gh);
-
-	gfs_quota_put(sdp, qd);
-
-	return error;
-}
-
-/**
- * gfs_quota_read - Read the info a given quota ID
- * @sdp: the filesystem
- * @user:
- * @id:
- * @q:
- *
- * Returns: errno
- */
-
-int
-gfs_quota_read(struct gfs_sbd *sdp, int user, uint32_t id,
-	       struct gfs_quota *q)
-{
-	struct gfs_quota_data *qd;
-	struct gfs_holder q_gh;
-	int error;
-
-	if (((user) ? (id != current_fsuid()) : (!in_group_p(id))) &&
-	    !capable(CAP_SYS_ADMIN))
-		return -EACCES;
-
-	error = gfs_quota_get(sdp, user, id, CREATE, &qd);
-	if (error)
-		return error;
-
-	error = glock_q(sdp, qd, FALSE, &q_gh);
-	if (error)
-		goto out;
-
-	memset(q, 0, sizeof(struct gfs_quota));
-	q->qu_limit = qd->qd_qb.qb_limit;
-	q->qu_warn = qd->qd_qb.qb_warn;
-	q->qu_value = qd->qd_qb.qb_value;
-
-	spin_lock(&sdp->sd_quota_lock);
-	q->qu_value += qd->qd_change_new + qd->qd_change_ic;
-	spin_unlock(&sdp->sd_quota_lock);
-
-	gfs_glock_dq_uninit(&q_gh);
-
- out:
-	gfs_quota_put(sdp, qd);
-
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/quota.h b/gfs-kernel/src/gfs/quota.h
deleted file mode 100644
index 62620ec..0000000
--- a/gfs-kernel/src/gfs/quota.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __QUOTA_DOT_H__
-#define __QUOTA_DOT_H__
-
-#define NO_QUOTA_CHANGE ((uint32_t)-1)
-
-int gfs_quota_get(struct gfs_sbd *sdp, int user, uint32_t id, int create,
-		     struct gfs_quota_data **qdp);
-void gfs_quota_hold(struct gfs_sbd *sdp, struct gfs_quota_data *qd);
-void gfs_quota_put(struct gfs_sbd *sdp, struct gfs_quota_data *qd);
-
-int gfs_quota_merge(struct gfs_sbd *sdp, struct gfs_quota_tag *tag);
-void gfs_quota_scan(struct gfs_sbd *sdp);
-void gfs_quota_cleanup(struct gfs_sbd *sdp);
-
-int gfs_quota_hold_m(struct gfs_inode *ip, uint32_t uid, uint32_t gid);
-void gfs_quota_unhold_m(struct gfs_inode *ip);
-
-int gfs_quota_lock_m(struct gfs_inode *ip, uint32_t uid, uint32_t gid);
-void gfs_quota_unlock_m(struct gfs_inode *ip);
-
-int gfs_quota_check(struct gfs_inode *ip, uint32_t uid, uint32_t gid);
-
-int gfs_quota_sync(struct gfs_sbd *sdp);
-int gfs_quota_refresh(struct gfs_sbd *sdp, int user, uint32_t id);
-int gfs_quota_read(struct gfs_sbd *sdp, int user, uint32_t id,
-		   struct gfs_quota *q);
-
-#endif /* __QUOTA_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/recovery.c b/gfs-kernel/src/gfs/recovery.c
deleted file mode 100644
index d014272..0000000
--- a/gfs-kernel/src/gfs/recovery.c
+++ /dev/null
@@ -1,780 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "glops.h"
-#include "lm.h"
-#include "lops.h"
-#include "recovery.h"
-
-#define bn2seg(bn) (((uint32_t)((bn) - jdesc->ji_addr)) / sdp->sd_sb.sb_seg_size)
-#define seg2bn(seg) ((seg) * sdp->sd_sb.sb_seg_size + jdesc->ji_addr)
-
-struct dirty_j {
-	struct list_head dj_list;
-	unsigned int dj_jid;
-	struct gfs_jindex dj_desc;
-};
-
-/**
- * gfs_add_dirty_j - add a jid to the list of dirty journals
- * @sdp: the filesystem
- * @jid: the journal ID number
- *
- */
-
-void
-gfs_add_dirty_j(struct gfs_sbd *sdp, unsigned int jid)
-{
-	struct dirty_j *dj;
-
-	dj = gmalloc(sizeof(struct dirty_j));
-	memset(dj, 0, sizeof(struct dirty_j));
-
-	dj->dj_jid = jid;
-
-	spin_lock(&sdp->sd_dirty_j_lock);
-	list_add(&dj->dj_list, &sdp->sd_dirty_j);
-	spin_unlock(&sdp->sd_dirty_j_lock);
-}
-
-/**
- * get_dirty_j - return a dirty journal from the list
- * @sdp: the filesystem
- *
- * Returns: a struct dirty_j or NULL
- */
-
-static struct dirty_j *
-get_dirty_j(struct gfs_sbd *sdp)
-{
-	struct dirty_j *dj = NULL;
-
-	spin_lock(&sdp->sd_dirty_j_lock);
-	if (!list_empty(&sdp->sd_dirty_j)) {
-		dj = list_entry(sdp->sd_dirty_j.prev, struct dirty_j, dj_list);
-		list_del(&dj->dj_list);
-	}
-	spin_unlock(&sdp->sd_dirty_j_lock);
-
-	return dj;
-}
-
-/**
- * gfs_clear_dirty_j - destroy the list of dirty journals
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_clear_dirty_j(struct gfs_sbd *sdp)
-{
-	struct dirty_j *dj;
-	for (;;) {
-		dj = get_dirty_j(sdp);
-		if (!dj)
-			break;
-		kfree(dj);
-	}
-}
-
-/**
- * gfs_log_header - read the log header for a given segment
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @seg: the segment to look at
- * @lh: the log header to return
- *
- * Read the log header for a given segement in a given journal.  Do a few
- * sanity checks on it.
- *
- * Returns: 0 on success, 1 if the header was invalid or incomplete and, errno on error
- */
-
-static int
-get_log_header(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-	       struct gfs_glock *gl, uint32_t seg, struct gfs_log_header *lh)
-{
-	struct buffer_head *bh;
-	struct gfs_log_header lh2;
-	int error;
-
-	error = gfs_dread(gl, seg2bn(seg), DIO_START | DIO_WAIT, &bh);
-	if (error)
-		return error;
-
-	gfs_log_header_in(lh, bh->b_data);
-	gfs_log_header_in(&lh2,
-			  bh->b_data + GFS_BASIC_BLOCK -
-			  sizeof(struct gfs_log_header));
-
-	brelse(bh);
-
-	if (memcmp(lh, &lh2, sizeof(struct gfs_log_header)) != 0 ||
-	    lh->lh_header.mh_magic != GFS_MAGIC ||
-	    lh->lh_header.mh_type != GFS_METATYPE_LH)
-		error = 1;
-
-	return error;
-}
-
-/**
- * find_good_lh - find a good log header
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @seg: the segment to start searching from (it's also filled in with a new value.) 
- * @lh: the log header to fill in
- * @forward: if true search forward in the log, else search backward
- *
- * Call get_log_header() to get a log header for a segment, but if the
- * segment is bad, either scan forward or backward until we find a good one.
- *
- * Returns: errno
- */
-
-static int
-find_good_lh(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-	     struct gfs_glock *gl, uint32_t *seg, struct gfs_log_header *lh,
-	     int forward)
-{
-	int error;
-	uint32_t orig_seg = *seg;
-
-	for (;;) {
-		error = get_log_header(sdp, jdesc, gl, *seg, lh);
-		if (error <= 0)
-			return error;
-
-		if (forward) {
-			if (++*seg == jdesc->ji_nsegment)
-				*seg = 0;
-		} else {
-			if ((*seg)-- == 0)
-				*seg = jdesc->ji_nsegment - 1;
-		}
-
-		if (*seg == orig_seg) {
-			gfs_consist(sdp);
-			return -EIO;
-		}
-	}
-}
-
-/**
- * verify_jhead - make sure we've found the head of the log
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @head: this is filled in with the log descriptor of the head
- *
- * At this point, seg and lh should be either the head of the log or just
- * before.  Scan forward until we find the head.
- *
- * Returns: errno
- */
-
-static int
-verify_jhead(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-	     struct gfs_glock *gl, struct gfs_log_header *head)
-{
-	struct gfs_log_header lh;
-	uint32_t seg;
-	int error;
-
-	seg = bn2seg(head->lh_first);
-
-	for (;;) {
-		if (++seg == jdesc->ji_nsegment)
-			seg = 0;
-
-		error = get_log_header(sdp, jdesc, gl, seg, &lh);
-		if (error < 0)
-			return error;
-
-		if (error == 1)
-			continue;
-		if (lh.lh_sequence == head->lh_sequence)
-			continue;
-
-		if (lh.lh_sequence < head->lh_sequence)
-			break;
-
-		memcpy(head, &lh, sizeof(struct gfs_log_header));
-	}
-
-	return 0;
-}
-
-/**
- * gfs_find_jhead - find the head of a log
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @head: the log descriptor for the head of the log is returned here
- *
- * Do a binary search of a journal and find the valid log entry with the
- * highest sequence number.  (i.e. the log head)
- *
- * Returns: errno
- */
-
-int
-gfs_find_jhead(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-	       struct gfs_glock *gl, struct gfs_log_header *head)
-{
-	struct gfs_log_header lh;
-	uint32_t seg1, seg2, seg_m;
-	int error;
-	uint64_t lh1_sequence;
-
-	seg1 = 0;
-	seg2 = jdesc->ji_nsegment - 1;
-
-	for (;;) {
-		seg_m = (seg1 + seg2) / 2;
-
-		error = find_good_lh(sdp, jdesc, gl, &seg1, &lh, TRUE);
-		if (error)
-			break;
-
-		if (seg1 == seg_m) {
-			error = verify_jhead(sdp, jdesc, gl, &lh);
-			if (unlikely(error)) 
-				printk("GFS: verify_jhead error=%d\n", error);
-			else
-				memcpy(head, &lh, sizeof(struct gfs_log_header));
-			break;
-		}
-
-		lh1_sequence = lh.lh_sequence;
-
-		error = find_good_lh(sdp, jdesc, gl, &seg_m, &lh, FALSE);
-		if (error)
-			break;
-
-		if (lh1_sequence <= lh.lh_sequence)
-			seg1 = seg_m;
-		else
-			seg2 = seg_m;
-	}
-
-	return error;
-}
-
-/**
- * gfs_increment_blkno - move to the next block in a journal
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @addr: the block number to increment
- * @skip_header: if this is TRUE, skip log headers
- *
- * Replace @addr with the location of the next block in the log.
- * Take care of journal wrap and skip of log header if necessary.
- *
- * Returns: errno
- */
-
-int
-gfs_increment_blkno(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		    struct gfs_glock *gl, uint64_t *addr, int skip_headers)
-{
-	struct gfs_log_header header;
-	int error;
-
-	(*addr)++;
-
-	/* Handle journal wrap */
-
-	if (*addr == seg2bn(jdesc->ji_nsegment))
-		*addr -= jdesc->ji_nsegment * sdp->sd_sb.sb_seg_size;
-
-	gfs_start_ra(gl, *addr,
-		     jdesc->ji_addr +
-		     jdesc->ji_nsegment * sdp->sd_sb.sb_seg_size - *addr);
-
-	/* Handle landing on a header block */
-
-	if (skip_headers && !do_mod(*addr, sdp->sd_sb.sb_seg_size)) {
-		error = get_log_header(sdp, jdesc, gl, bn2seg(*addr), &header);
-		if (error < 0)
-			return error;
-
-		if (error) { /* Corrupt headers here are bad */
-			if (gfs_consist(sdp))
-				printk("GFS: fsid=%s: *addr = %llu\n",
-				       sdp->sd_fsname, (unsigned long long)*addr);
-			return -EIO;
-		}
-		if (header.lh_first == *addr) {
-			if (gfs_consist(sdp))
-				printk("GFS: fsid=%s: *addr = %llu\n",
-				       sdp->sd_fsname, (unsigned long long)*addr);
-			gfs_log_header_print(&header);
-			return -EIO;
-		}
-
-		(*addr)++;
-		/* Can't wrap here */
-	}
-
-	return 0;
-}
-
-/**
- * foreach_descriptor - go through the active part of the log
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @start: the first log header in the active region
- * @end: the last log header (don't process the contents of this entry))
- * @pass: the recovery pass
- *
- * Call a given function once for every log descriptor in the active
- * portion of the log.
- *
- * Returns: errno
- */
-
-static int
-foreach_descriptor(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		   struct gfs_glock *gl, uint64_t start, uint64_t end,
-		   unsigned int pass)
-{
-	struct gfs_log_header header;
-	struct gfs_log_descriptor desc;
-	struct buffer_head *bh;
-	int error = 0;
-
-	while (start != end) {
-		if (do_mod(start, sdp->sd_sb.sb_seg_size)) {
-			gfs_consist(sdp);
-			return -EIO;
-		}
-
-		error = get_log_header(sdp, jdesc, gl, bn2seg(start), &header);
-		if (error < 0)
-			return error;
-
-		if (error) { /* Corrupt headers here are bad */
-			if (gfs_consist(sdp))
-				printk("GFS: fsid=%s: start = %llu\n",
-				       sdp->sd_fsname, (unsigned long long)start);
-			return -EIO;
-		}
-		if (header.lh_first != start) {
-			if (gfs_consist(sdp))
-				printk("GFS: fsid=%s: start = %llu\n",
-				       sdp->sd_fsname, (unsigned long long)start);
-			gfs_log_header_print(&header);
-			return -EIO;
-		}
-
-		start++;
-
-		for (;;) {
-			error = gfs_dread(gl, start, DIO_START | DIO_WAIT, &bh);
-			if (error)
-				return error;
-
-			if (gfs_metatype_check(sdp, bh, GFS_METATYPE_LD)) {
-				brelse(bh);
-				return -EIO;
-			}
-
-			gfs_desc_in(&desc, bh->b_data);
-			brelse(bh);
-
-			if (desc.ld_type != GFS_LOG_DESC_LAST) {
-				error = LO_SCAN_ELEMENTS(sdp, jdesc, gl, start,
-							 &desc, pass);
-				if (error)
-					return error;
-
-				while (desc.ld_length--) {
-					error = gfs_increment_blkno(sdp, jdesc, gl,
-								    &start, TRUE);
-					if (error)
-						return error;
-				}
-			} else {
-				while (desc.ld_length--) {
-					error = gfs_increment_blkno(sdp, jdesc, gl,
-								    &start,
-								    !!desc.ld_length);
-					if (error)
-						return error;
-				}
-
-				break;
-			}
-		}
-	}
-
-	return error;
-}
-
-/**
- * clean_journal - mark a dirty journal as being clean
- * @sdp: the filesystem
- * @jdesc: the journal
- * @gl: the journal's glock
- * @head: the head journal to start from
- *
- * Returns: errno
- */
-
-static int noinline
-clean_journal(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-	      struct gfs_glock *gl, struct gfs_log_header *head)
-{
-	struct gfs_log_header lh;
-	struct gfs_log_descriptor desc;
-	struct buffer_head *bh;
-	uint32_t seg;
-	uint64_t blkno;
-	int error;
-
-	seg = bn2seg(head->lh_first);
-
-	for (;;) {
-		if (++seg == jdesc->ji_nsegment)
-			seg = 0;
-
-		error = get_log_header(sdp, jdesc, gl, seg, &lh);
-		if (error < 0)
-			return error;
-
-		/* Rewrite corrupt header blocks */
-
-		if (error == 1) {
-			bh = gfs_dgetblk(gl, seg2bn(seg));
-
-			gfs_prep_new_buffer(bh);
-			gfs_buffer_clear(bh);
-			gfs_log_header_out(head, bh->b_data);
-			gfs_log_header_out(head,
-					   bh->b_data + GFS_BASIC_BLOCK -
-					   sizeof(struct gfs_log_header));
-
-			error = gfs_dwrite(sdp, bh, DIO_DIRTY | DIO_START | DIO_WAIT);
-			brelse(bh);
-			if (error)
-				return error;
-		}
-
-		/* Stop when we get to the end of the log. */
-
-		if (lh.lh_sequence < head->lh_sequence)
-			break;
-	}
-
-	/*  Build a "last" descriptor for the transaction we are
-	   about to commit by writing the shutdown header.  */
-
-	memset(&desc, 0, sizeof(struct gfs_log_descriptor));
-	desc.ld_header.mh_magic = GFS_MAGIC;
-	desc.ld_header.mh_type = GFS_METATYPE_LD;
-	desc.ld_header.mh_format = GFS_FORMAT_LD;
-	desc.ld_type = GFS_LOG_DESC_LAST;
-	desc.ld_length = 0;
-
-	for (blkno = head->lh_first + 1; blkno != seg2bn(seg);) {
-		if (do_mod(blkno, sdp->sd_sb.sb_seg_size))
-			desc.ld_length++;
-		if (++blkno == seg2bn(jdesc->ji_nsegment))
-			blkno -= jdesc->ji_nsegment * sdp->sd_sb.sb_seg_size;
-	}
-
-	/*  Write the descriptor  */
-
-	bh = gfs_dgetblk(gl, head->lh_first + 1);
-
-	gfs_prep_new_buffer(bh);
-	gfs_buffer_clear(bh);
-	gfs_desc_out(&desc, bh->b_data);
-
-	error = gfs_dwrite(sdp, bh, DIO_DIRTY | DIO_START | DIO_WAIT);
-	brelse(bh);
-	if (error)
-		return error;
-
-	/*  Build a log header that says the journal is clean  */
-
-	memset(&lh, 0, sizeof(struct gfs_log_header));
-	lh.lh_header.mh_magic = GFS_MAGIC;
-	lh.lh_header.mh_type = GFS_METATYPE_LH;
-	lh.lh_header.mh_format = GFS_FORMAT_LH;
-	lh.lh_flags = GFS_LOG_HEAD_UNMOUNT;
-	lh.lh_first = seg2bn(seg);
-	lh.lh_sequence = head->lh_sequence + 1;
-	/*  Don't care about tail  */
-	lh.lh_last_dump = head->lh_last_dump;
-
-	/*  Write the header  */
-
-	bh = gfs_dgetblk(gl, lh.lh_first);
-
-	gfs_prep_new_buffer(bh);
-	gfs_buffer_clear(bh);
-	gfs_log_header_out(&lh, bh->b_data);
-	gfs_log_header_out(&lh,
-			   bh->b_data + GFS_BASIC_BLOCK -
-			   sizeof(struct gfs_log_header));
-
-	error = gfs_dwrite(sdp, bh, DIO_DIRTY | DIO_START | DIO_WAIT);
-	brelse(bh);
-
-	return error;
-}
-
-/**
- * gfs_recover_journal - recover a given journal
- * @sdp: the filesystem
- * @jid: the number of the journal to recover
- * @jdesc: the struct gfs_jindex describing the journal
- * @wait: Don't return until the journal is clean (or an error is encountered)
- *
- * Acquire the journal's lock, check to see if the journal is clean, and
- * do recovery if necessary.
- *
- * Returns: errno
- */
-
-int
-gfs_recover_journal(struct gfs_sbd *sdp,
-		    unsigned int jid, struct gfs_jindex *jdesc,
-		    int wait)
-{
-	struct gfs_log_header *head;
-	struct gfs_holder j_gh, t_gh;
-	unsigned long t;
-	int error;
-
-	printk("GFS: fsid=%s: jid=%u: Trying to acquire journal lock...\n",
-	       sdp->sd_fsname, jid);
-
-	/*  Acquire the journal lock so we can do recovery  */
-
-	error = gfs_glock_nq_num(sdp,
-				 jdesc->ji_addr, &gfs_meta_glops,
-				 LM_ST_EXCLUSIVE,
-				 LM_FLAG_NOEXP |
-				 ((wait) ? 0 : LM_FLAG_TRY) |
-				 GL_NOCACHE, &j_gh);
-	switch (error) {
-	case 0:
-		break;
-
-	case GLR_TRYFAILED:
-		printk("GFS: fsid=%s: jid=%u: Busy\n", sdp->sd_fsname, jid);
-		error = 0;
-
-	default:
-		goto fail;
-	};
-
-	printk("GFS: fsid=%s: jid=%u: Looking at journal...\n",
-	       sdp->sd_fsname, jid);
-
-	head = kmalloc(sizeof(struct gfs_log_header), GFP_KERNEL);
-	if (!head) {
-		printk("GFS: fsid=%s jid=%u: Can't replay: Not enough memory",
-		       sdp->sd_fsname, jid);
-		goto fail_gunlock;
-	}
-
-	error = gfs_find_jhead(sdp, jdesc, j_gh.gh_gl, head);
-	if (error)
-		goto fail_header;
-
-	if (!(head->lh_flags & GFS_LOG_HEAD_UNMOUNT)) {
-		if (test_bit(SDF_ROFS, &sdp->sd_flags)) {
-			printk("GFS: fsid=%s: jid=%u: Can't replay: read-only FS\n",
-			       sdp->sd_fsname, jid);
-			error = -EROFS;
-			goto fail_header;
-		}
-
-		printk("GFS: fsid=%s: jid=%u: Acquiring the transaction lock...\n",
-		       sdp->sd_fsname, jid);
-
-		t = jiffies;
-
-		/*  Acquire an exclusive hold on the transaction lock  */
-
-		error = gfs_glock_nq_init(sdp->sd_trans_gl,
-					  LM_ST_EXCLUSIVE,
-					  LM_FLAG_NOEXP |
-					  LM_FLAG_PRIORITY |
-					  GL_NOCANCEL |
-					  GL_NOCACHE,
-					  &t_gh);
-		if (error)
-			goto fail_header;
-
-		if (test_bit(SDF_ROFS, &sdp->sd_flags)) {
-			printk("GFS: fsid=%s: jid=%u: Can't replay: read-only FS\n",
-			       sdp->sd_fsname, jid);
-			error = -EROFS;
-			goto fail_gunlock_tr;
-		}
-
-		printk("GFS: fsid=%s: jid=%u: Replaying journal...\n",
-		       sdp->sd_fsname, jid);
-
-		set_bit(GLF_DIRTY, &j_gh.gh_gl->gl_flags);
-
-		LO_BEFORE_SCAN(sdp, jid, head, GFS_RECPASS_A1);
-
-		error = foreach_descriptor(sdp, jdesc, j_gh.gh_gl,
-					   head->lh_tail, head->lh_first,
-					   GFS_RECPASS_A1);
-		if (error)
-			goto fail_gunlock_tr;
-
-		LO_AFTER_SCAN(sdp, jid, GFS_RECPASS_A1);
-
-		gfs_replay_wait(sdp);
-
-		error = clean_journal(sdp, jdesc, j_gh.gh_gl, head);
-		if (error)
-			goto fail_gunlock_tr;
-
-		gfs_glock_dq_uninit(&t_gh);
-
-		t = DIV_RU(jiffies - t, HZ);
-		
-		printk("GFS: fsid=%s: jid=%u: Journal replayed in %lus\n",
-		       sdp->sd_fsname, jid, t);
-	}
-
-	gfs_lm_recovery_done(sdp, jid, LM_RD_SUCCESS);
-
-	kfree(head);
-
-	gfs_glock_dq_uninit(&j_gh);
-
-	printk("GFS: fsid=%s: jid=%u: Done\n", sdp->sd_fsname, jid);
-
-	return 0;
-
- fail_gunlock_tr:
-	gfs_replay_wait(sdp);
-	gfs_glock_dq_uninit(&t_gh);
-
- fail_header:
-	kfree(head);
-
- fail_gunlock:
-	gfs_glock_dq_uninit(&j_gh);
-
-	printk("GFS: fsid=%s: jid=%u: %s\n",
-	       sdp->sd_fsname, jid, (error) ? "Failed" : "Done");
-
- fail:
-	gfs_lm_recovery_done(sdp, jid, LM_RD_GAVEUP);
-
-	return error;
-}
-
-/**
- * gfs_check_journals - Recover any dirty journals
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_check_journals(struct gfs_sbd *sdp)
-{
-	struct dirty_j *dj;
-
-	for (;;) {
-		dj = get_dirty_j(sdp);
-		if (!dj)
-			break;
-
-		down(&sdp->sd_jindex_lock);
-
-		if (dj->dj_jid != sdp->sd_lockstruct.ls_jid &&
-		    dj->dj_jid < sdp->sd_journals) {
-			memcpy(&dj->dj_desc,
-			       sdp->sd_jindex + dj->dj_jid,
-			       sizeof(struct gfs_jindex));
-			up(&sdp->sd_jindex_lock);
-
-			gfs_recover_journal(sdp,
-					    dj->dj_jid, &dj->dj_desc,
-					    FALSE);
-			
-		} else {
-			up(&sdp->sd_jindex_lock);
-			gfs_lm_recovery_done(sdp, dj->dj_jid, LM_RD_GAVEUP);
-		}
-
-		kfree(dj);
-	}
-}
-
-/**
- * gfs_recover_dump - recover the log elements in this machine's journal
- * @sdp: the filesystem
- *
- * Returns: errno
- */
-
-int
-gfs_recover_dump(struct gfs_sbd *sdp)
-{
-	struct gfs_log_header head;
-	int error;
-
-	error = gfs_find_jhead(sdp, &sdp->sd_jdesc, sdp->sd_journal_gh.gh_gl,
-			       &head);
-	if (error)
-		goto fail;
-
-	if (!(head.lh_flags & GFS_LOG_HEAD_UNMOUNT)) {
-		gfs_consist(sdp);
-		return -EIO;
-	}
-	if (!head.lh_last_dump)
-		return error;
-
-	printk("GFS: fsid=%s: Scanning for log elements...\n",
-	       sdp->sd_fsname);
-
-	LO_BEFORE_SCAN(sdp, sdp->sd_lockstruct.ls_jid, &head, GFS_RECPASS_B1);
-
-	error = foreach_descriptor(sdp, &sdp->sd_jdesc, sdp->sd_journal_gh.gh_gl,
-				   head.lh_last_dump, head.lh_first,
-				   GFS_RECPASS_B1);
-	if (error)
-		goto fail;
-
-	LO_AFTER_SCAN(sdp, sdp->sd_lockstruct.ls_jid, GFS_RECPASS_B1);
-
-	/* We need to make sure if we crash during the next log dump that
-	   all intermediate headers in the transaction point to the last
-	   log dump before the one we're making so we don't lose it. */
-
-	sdp->sd_log_dump_last = head.lh_last_dump;
-
-	printk("GFS: fsid=%s: Done\n", sdp->sd_fsname);
-
-	return 0;
-
- fail:
-	printk("GFS: fsid=%s: Failed\n", sdp->sd_fsname);
-
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/recovery.h b/gfs-kernel/src/gfs/recovery.h
deleted file mode 100644
index 369cb38..0000000
--- a/gfs-kernel/src/gfs/recovery.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __RECOVERY_DOT_H__
-#define __RECOVERY_DOT_H__
-
-#define GFS_RECPASS_A1  (12)
-#define GFS_RECPASS_B1  (14)
-
-void gfs_add_dirty_j(struct gfs_sbd *sdp, unsigned int jid);
-void gfs_clear_dirty_j(struct gfs_sbd *sdp);
-
-int gfs_find_jhead(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-		   struct gfs_glock *gl, struct gfs_log_header *head);
-int gfs_increment_blkno(struct gfs_sbd *sdp, struct gfs_jindex *jdesc,
-			struct gfs_glock *gl, uint64_t *addr,
-			int skip_headers);
-
-int gfs_recover_journal(struct gfs_sbd *sdp,
-			unsigned int jid, struct gfs_jindex *jdesc,
-			int wait);
-void gfs_check_journals(struct gfs_sbd *sdp);
-
-int gfs_recover_dump(struct gfs_sbd *sdp);
-
-#endif /* __RECOVERY_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/rgrp.c b/gfs-kernel/src/gfs/rgrp.c
deleted file mode 100644
index e0c670f..0000000
--- a/gfs-kernel/src/gfs/rgrp.c
+++ /dev/null
@@ -1,2152 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "bits.h"
-#include "dio.h"
-#include "file.h"
-#include "glock.h"
-#include "glops.h"
-#include "rgrp.h"
-#include "super.h"
-#include "trans.h"
-
-/**
- * mhc_hash: find the mhc hash bucket for a buffer
- * @bh: the buffer
- *
- * Returns: The bucket number
- */
-
-static unsigned int
-mhc_hash(struct buffer_head *bh)
-{
-	uint64_t blkno;
-	unsigned int h;
-
-	blkno = bh->b_blocknr;
-	h = gfs_hash(&blkno, sizeof(uint64_t)) & GFS_MHC_HASH_MASK;
-
-	return h;
-}
-
-/**
- * mhc_trim - Throw away cached meta-headers, if there are too many of them
- * @sdp:  The filesystem instance
- * @max:  Max # of cached meta-headers allowed to survive
- *
- * Walk filesystem's list of cached meta-headers, in least-recently-used order,
- *   and keep throwing them away until we're under the max threshold. 
- */
-
-static void
-mhc_trim(struct gfs_sbd *sdp, unsigned int max)
-{
-	struct gfs_meta_header_cache *mc;
-
-	for (;;) {
-		spin_lock(&sdp->sd_mhc_lock);
-		if (list_empty(&sdp->sd_mhc_single)) {
-			spin_unlock(&sdp->sd_mhc_lock);
-			return;
-		} else {
-			mc = list_entry(sdp->sd_mhc_single.prev,
-					struct gfs_meta_header_cache,
-					mc_list_single);
-			list_del(&mc->mc_list_hash);
-			list_del(&mc->mc_list_single);
-			list_del(&mc->mc_list_rgd);
-			spin_unlock(&sdp->sd_mhc_lock);
-
-			kmem_cache_free(gfs_mhc_cachep, mc);
-			atomic_dec(&sdp->sd_mhc_count);
-
-			if (atomic_read(&sdp->sd_mhc_count) <= max)
-				return;
-		}
-	}
-}
-
-/**
- * gfs_mhc_add - add buffer(s) to the cache of metadata headers
- * @rgd: Resource Group in which the buffered block(s) reside
- * @bh: an array of buffer_head pointers
- * @num: the number of bh pointers in the array
- *
- * Increment each meta-header's generation # by 2.
- * Alloc and add each gfs_meta-header_cache to 3 lists/caches:
- *   Filesystem's meta-header cache (hash)
- *   Filesystem's list of cached meta-headers
- *   Resource Group's list of cached meta-headers
- * If we now have too many cached, throw some older ones away
- */
-
-void
-gfs_mhc_add(struct gfs_rgrpd *rgd,
-	    struct buffer_head **bh, unsigned int num)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	unsigned int x;
-
-	for (x = 0; x < num; x++) {
-		struct gfs_meta_header_cache *mc;
-		struct list_head *head;
-		uint64_t gen;
-
-		if (gfs_meta_check(sdp, bh[x]))
-			return;
-
-		mc = kmem_cache_alloc(gfs_mhc_cachep, GFP_KERNEL);
-		if (!mc)
-			return;
-		memset(mc, 0, sizeof(struct gfs_meta_header_cache));
-
-		mc->mc_block = bh[x]->b_blocknr;
-		memcpy(&mc->mc_mh, bh[x]->b_data,
-		       sizeof(struct gfs_meta_header));
-
-		gen = gfs64_to_cpu(mc->mc_mh.mh_generation) + 2;
-		mc->mc_mh.mh_generation = cpu_to_gfs64(gen);
-
-		head = &sdp->sd_mhc[mhc_hash(bh[x])];
-
-		spin_lock(&sdp->sd_mhc_lock);
-		list_add(&mc->mc_list_hash, head);
-		list_add(&mc->mc_list_single, &sdp->sd_mhc_single);
-		list_add(&mc->mc_list_rgd, &rgd->rd_mhc);
-		spin_unlock(&sdp->sd_mhc_lock);
-
-		atomic_inc(&sdp->sd_mhc_count);
-	}
-
-	x = gfs_tune_get(sdp, gt_max_mhc);
-
-	/* If we've got too many cached, throw some older ones away */
-	if (atomic_read(&sdp->sd_mhc_count) > x)
-		mhc_trim(sdp, x);
-}
-
-/**
- * gfs_mhc_fish - Try to fill in a meta buffer with meta-header from the cache
- * @sdp: the filesystem
- * @bh: the buffer to fill in
- *
- * Returns: TRUE if the buffer was cached, FALSE otherwise
- *
- * If buffer is referenced in meta-header cache (search using hash):
- *   Copy the cached meta-header into the buffer (instead of reading from disk).
- *     Note that only the meta-header portion of the buffer will have valid data
- *     (as would be on disk), rest of buffer does *not* reflect disk contents.
- *   Remove cached gfs_meta_header_cache from all cache lists, free its memory.
- */
-
-int
-gfs_mhc_fish(struct gfs_sbd *sdp, struct buffer_head *bh)
-{
-	struct list_head *tmp, *head;
-	struct gfs_meta_header_cache *mc;
-
-	head = &sdp->sd_mhc[mhc_hash(bh)];
-
-	spin_lock(&sdp->sd_mhc_lock);
-
-	for (tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		mc = list_entry(tmp, struct gfs_meta_header_cache, mc_list_hash);
-		if (mc->mc_block != bh->b_blocknr)
-			continue;
-
-		list_del(&mc->mc_list_hash);
-		list_del(&mc->mc_list_single);
-		list_del(&mc->mc_list_rgd);
-		spin_unlock(&sdp->sd_mhc_lock);
-
-		gfs_prep_new_buffer(bh);
-		memcpy(bh->b_data, &mc->mc_mh,
-		       sizeof(struct gfs_meta_header));
-
-		kmem_cache_free(gfs_mhc_cachep, mc);
-		atomic_dec(&sdp->sd_mhc_count);
-
-		return TRUE;
-	}
-
-	spin_unlock(&sdp->sd_mhc_lock);
-
-	return FALSE;
-}
-
-/**
- * gfs_mhc_zap - Throw away an RG's list of cached metadata headers
- * @rgd: The resource group whose list we want to clear
- *
- * Simply throw away all cached metadata headers on RG's list,
- *   and free their memory.
- */
-
-void
-gfs_mhc_zap(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_meta_header_cache *mc;
-
-	spin_lock(&sdp->sd_mhc_lock);
-
-	while (!list_empty(&rgd->rd_mhc)) {
-		mc = list_entry(rgd->rd_mhc.next,
-				struct gfs_meta_header_cache,
-				mc_list_rgd);
-
-		list_del(&mc->mc_list_hash);
-		list_del(&mc->mc_list_single);
-		list_del(&mc->mc_list_rgd);
-		spin_unlock(&sdp->sd_mhc_lock);
-
-		kmem_cache_free(gfs_mhc_cachep, mc);
-		atomic_dec(&sdp->sd_mhc_count);
-
-		spin_lock(&sdp->sd_mhc_lock);
-	}
-
-	spin_unlock(&sdp->sd_mhc_lock);
-}
-
-/**
- * depend_hash() - Turn glock number into hash bucket number
- * @formal_ino:
- *
- * Returns: The number of the corresponding hash bucket
- */
-
-static unsigned int
-depend_hash(uint64_t formal_ino)
-{
-	unsigned int h;
-
-	h = gfs_hash(&formal_ino, sizeof(uint64_t));
-	h &= GFS_DEPEND_HASH_MASK;
-
-	return h;
-}
-
-/**
- * depend_sync_one - Sync metadata (not data) for a dependency inode
- * @sdp: filesystem instance
- * @gd: dependency descriptor
- *
- * Remove dependency from superblock's hash table and rgrp's list.
- * Sync dependency inode's metadata to log and in-place location.
- */
-
-static void
-depend_sync_one(struct gfs_sbd *sdp, struct gfs_depend *gd)
-{
-	struct gfs_glock *gl;
-
-	spin_lock(&sdp->sd_depend_lock);
-	list_del(&gd->gd_list_hash);
-	spin_unlock(&sdp->sd_depend_lock);
-	list_del(&gd->gd_list_rgd);
-
-	gl = gfs_glock_find(sdp,
-			    &(struct lm_lockname){gd->gd_formal_ino,
-						  LM_TYPE_INODE});
-	if (gl) {
-		if (gl->gl_ops->go_sync)
-			gl->gl_ops->go_sync(gl,
-					    DIO_METADATA |
-					    DIO_INVISIBLE);
-		gfs_glock_put(gl);
-	}
-
-	kfree(gd);
-	atomic_dec(&sdp->sd_depend_count);
-}
-
-/**
- * depend_sync_old - Sync older rgrp-dependent inodes to disk.
- * @rgd: Resource group containing dependent inodes
- *
- * Look at oldest entries in resource group's dependency list,
- *   sync 'em if they're older than timeout threshold.
- */
-
-static void
-depend_sync_old(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_depend *gd;
-
-	while (!list_empty(&rgd->rd_depend)) {
-		/* Oldest entries are in prev direction */
-		gd = list_entry(rgd->rd_depend.prev,
-				struct gfs_depend,
-				gd_list_rgd);
-
-		if (time_before(jiffies,
-				gd->gd_time +
-				gfs_tune_get(sdp, gt_depend_secs) * HZ))
-			return;
-
-		depend_sync_one(sdp, gd);
-	}
-}
-
-/**
- * gfs_depend_add - Add a dependent inode to rgrp's and filesystem's list
- * @rgd: Resource group containing blocks associated with inode
- * @formal_ino: inode
- *
- * Dependent inodes must be flushed to log and in-place blocks before
- *   releasing an EXCLUSIVE rgrp lock.
- * Find pre-existing dependency for this inode/rgrp combination in
- *   incore superblock struct's sd_depend hash table, or create a new one.
- * Either way, move or attach dependency to head of superblock's hash bucket
- *   and top of rgrp's list.
- * If we create a new one, take a moment to sync older dependencies to disk.
- */
-
-void
-gfs_depend_add(struct gfs_rgrpd *rgd, uint64_t formal_ino)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct list_head *head, *tmp;
-	struct gfs_depend *gd;
-
-	head = &sdp->sd_depend[depend_hash(formal_ino)];
-
-	spin_lock(&sdp->sd_depend_lock);
-
-	for (tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		gd = list_entry(tmp, struct gfs_depend, gd_list_hash);
-		if (gd->gd_rgd == rgd &&
-		    gd->gd_formal_ino == formal_ino) {
-			list_move(&gd->gd_list_hash, head);
-			spin_unlock(&sdp->sd_depend_lock);
-			list_move(&gd->gd_list_rgd, &rgd->rd_depend);
-			gd->gd_time = jiffies;
-			return;
-		}
-	}
-
-	spin_unlock(&sdp->sd_depend_lock);
-
-	gd = gmalloc(sizeof(struct gfs_depend));
-	memset(gd, 0, sizeof(struct gfs_depend));
-
-	gd->gd_rgd = rgd;
-	gd->gd_formal_ino = formal_ino;
-	gd->gd_time = jiffies;
-
-	spin_lock(&sdp->sd_depend_lock);
-	list_add(&gd->gd_list_hash, head);
-	spin_unlock(&sdp->sd_depend_lock);
-	list_add(&gd->gd_list_rgd, &rgd->rd_depend);
-
-	atomic_inc(&sdp->sd_depend_count);
-
-	depend_sync_old(rgd);
-}
-
-/**
- * gfs_depend_sync - Sync metadata (not data) for an rgrp's dependent inodes
- * @rgd: Resource group containing the dependent inodes
- *
- * As long as this node owns an EXCLUSIVE lock on the rgrp, we can keep
- *   rgrp's modified metadata blocks in buffer cache.
- *
- * When this node releases the EX lock, we must flush metadata, so other
- *   nodes can read the modified content from disk.
- */
-
-void
-gfs_depend_sync(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_depend *gd;
-
-	while (!list_empty(&rgd->rd_depend)) {
-		gd = list_entry(rgd->rd_depend.next,
-				struct gfs_depend,
-				gd_list_rgd);
-		depend_sync_one(sdp, gd);
-	}
-}
-
-/**
- * rgrp_verify - Verify that a resource group is consistent
- * @sdp: the filesystem
- * @rgd: the rgrp
- *
- * Somebody should have already called gfs_glock_rg() on this RG.
- */
-
-static void
-rgrp_verify(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_bitmap *bits = NULL;
-	uint32_t length = rgd->rd_ri.ri_length;
-	uint32_t count[4], tmp;
-	int buf, x;
-
-	memset(count, 0, 4 * sizeof(uint32_t));
-
-	/* Count # blocks in each of 4 possible allocation states */
-	for (buf = 0; buf < length; buf++) {
-		bits = &rgd->rd_bits[buf];
-		for (x = 0; x < 4; x++)
-			count[x] += gfs_bitcount(rgd,
-						 rgd->rd_bh[buf]->b_data +
-						 bits->bi_offset,
-						 bits->bi_len, x);
-	}
-
-	if (count[0] != rgd->rd_rg.rg_free) {
-		if (gfs_consist_rgrpd(rgd))
-			printk("GFS: fsid=%s: free data mismatch:  %u != %u\n",
-			       sdp->sd_fsname, count[0], rgd->rd_rg.rg_free);
-		return;
-	}
-
-	tmp = rgd->rd_ri.ri_data -
-		(rgd->rd_rg.rg_usedmeta + rgd->rd_rg.rg_freemeta) -
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi) -
-		rgd->rd_rg.rg_free;
-	if (count[1] != tmp) {
-		if (gfs_consist_rgrpd(rgd))
-			printk("GFS: fsid=%s: used data mismatch:  %u != %u\n",
-			       sdp->sd_fsname, count[1], tmp);
-		return;
-	}
-
-	if (count[2] != rgd->rd_rg.rg_freemeta) {
-		if (gfs_consist_rgrpd(rgd))
-			printk("GFS: fsid=%s: free metadata mismatch:  %u != %u\n",
-			       sdp->sd_fsname, count[2], rgd->rd_rg.rg_freemeta);
-		return;
-	}
-
-	tmp = rgd->rd_rg.rg_usedmeta +
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi);
-	if (count[3] != tmp) {
-		if (gfs_consist_rgrpd(rgd))
-			printk("GFS: fsid=%s: used metadata mismatch:  %u != %u\n",
-			       sdp->sd_fsname, count[3], tmp);
-		return;
-	}
-}
-
-/**
- * gfs_blk2rgrpd - Find resource group for a given data/meta block number
- * @sdp: The GFS superblock
- * @n: The data block number
- *
- * Returns: The resource group, or NULL if not found
- *
- * Don't try to use this for non-allocatable block numbers (i.e. rgrp header
- *   or bitmap blocks); it's for allocatable (data/meta) blocks only.
- */
-
-struct gfs_rgrpd *
-gfs_blk2rgrpd(struct gfs_sbd *sdp, uint64_t blk)
-{
-	struct list_head *tmp, *head;
-	struct gfs_rgrpd *rgd = NULL;
-	struct gfs_rindex *ri;
-
-	spin_lock(&sdp->sd_rg_mru_lock);
-
-	for (head = &sdp->sd_rg_mru_list, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		rgd = list_entry(tmp, struct gfs_rgrpd, rd_list_mru);
-		ri = &rgd->rd_ri;
-
-		if (ri->ri_data1 <= blk && blk < ri->ri_data1 + ri->ri_data) {
-			list_move(&rgd->rd_list_mru, &sdp->sd_rg_mru_list);
-			spin_unlock(&sdp->sd_rg_mru_lock);
-			return rgd;
-		}
-	}
-
-	spin_unlock(&sdp->sd_rg_mru_lock);
-
-	return NULL;
-}
-
-/**
- * gfs_rgrpd_get_first - get the first Resource Group in the filesystem
- * @sdp: The GFS superblock
- *
- * Returns: The first rgrp in the filesystem
- */
-
-struct gfs_rgrpd *
-gfs_rgrpd_get_first(struct gfs_sbd *sdp)
-{
-	gfs_assert(sdp, !list_empty(&sdp->sd_rglist),);
-	return list_entry(sdp->sd_rglist.next, struct gfs_rgrpd, rd_list);
-}
-
-/**
- * gfs_rgrpd_get_next - get the next RG
- * @rgd: A RG
- *
- * Returns: The next rgrp
- */
-
-struct gfs_rgrpd *
-gfs_rgrpd_get_next(struct gfs_rgrpd *rgd)
-{
-	if (rgd->rd_list.next == &rgd->rd_sbd->sd_rglist)
-		return NULL;
-	return list_entry(rgd->rd_list.next, struct gfs_rgrpd, rd_list);
-}
-
-/**
- * clear_rgrpdi - Clear up rgrps
- * @sdp: The GFS superblock
- *
- */
-
-void
-clear_rgrpdi(struct gfs_sbd *sdp)
-{
-	struct gfs_rgrpd *rgd;
-	struct gfs_glock *gl;
-
-	spin_lock(&sdp->sd_rg_forward_lock);
-	sdp->sd_rg_forward = NULL;
-	spin_unlock(&sdp->sd_rg_forward_lock);
-
-	spin_lock(&sdp->sd_rg_recent_lock);
-	while (!list_empty(&sdp->sd_rg_recent)) {
-		rgd = list_entry(sdp->sd_rg_recent.next,
-				 struct gfs_rgrpd, rd_recent);
-		list_del(&rgd->rd_recent);
-	}
-	spin_unlock(&sdp->sd_rg_recent_lock);
-
-	while (!list_empty(&sdp->sd_rglist)) {
-		rgd = list_entry(sdp->sd_rglist.next,
-				 struct gfs_rgrpd, rd_list);
-		gl = rgd->rd_gl;
-
-		list_del(&rgd->rd_list);
-		list_del(&rgd->rd_list_mru);
-
-		if (gl) {
-			gfs_glock_force_drop(gl);
-			if (atomic_read(&gl->gl_lvb_count))
-				gfs_lvb_unhold(gl);
-			set_gl2rgd(gl, NULL);
-			gfs_glock_put(gl);
-		}
-
-		if (rgd->rd_bits)
-			kfree(rgd->rd_bits);
-		if (rgd->rd_bh)
-			kfree(rgd->rd_bh);
-
-		kfree(rgd);
-	}
-}
-
-/**
- * gfs_clear_rgrpd - Clear up rgrps
- * @sdp: The GFS superblock
- *
- */
-
-void
-gfs_clear_rgrpd(struct gfs_sbd *sdp)
-{
-	down(&sdp->sd_rindex_lock);
-	clear_rgrpdi(sdp);
-	up(&sdp->sd_rindex_lock);
-}
-
-/**
- * gfs_compute_bitstructs - Compute the bitmap sizes
- * @rgd: The resource group descriptor
- *
- * Calculates bitmap descriptors, one for each block that contains bitmap data
- *
- * Returns: errno
- */
-
-static int
-compute_bitstructs(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_bitmap *bits;
-	uint32_t length = rgd->rd_ri.ri_length; /* # blocks in hdr & bitmap */
-	uint32_t bytes_left, bytes;
-	int x;
-
-	rgd->rd_bits = kmalloc(length * sizeof(struct gfs_bitmap), GFP_KERNEL);
-	if (!rgd->rd_bits)
-		return -ENOMEM;
-	memset(rgd->rd_bits, 0, length * sizeof(struct gfs_bitmap));
-
-	bytes_left = rgd->rd_ri.ri_bitbytes;
-
-	for (x = 0; x < length; x++) {
-		bits = &rgd->rd_bits[x];
-
-		/* small rgrp; bitmap stored completely in header block */
-		if (length == 1) {
-			bytes = bytes_left;
-			bits->bi_offset = sizeof(struct gfs_rgrp);
-			bits->bi_start = 0;
-			bits->bi_len = bytes;
-		/* header block */
-		} else if (x == 0) {
-			bytes = sdp->sd_sb.sb_bsize - sizeof(struct gfs_rgrp);
-			bits->bi_offset = sizeof(struct gfs_rgrp);
-			bits->bi_start = 0;
-			bits->bi_len = bytes;
-		/* last block */
-		} else if (x + 1 == length) {
-			bytes = bytes_left;
-			bits->bi_offset = sizeof(struct gfs_meta_header);
-			bits->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
-			bits->bi_len = bytes;
-		/* other blocks */
-		} else {
-			bytes = sdp->sd_sb.sb_bsize - sizeof(struct gfs_meta_header);
-			bits->bi_offset = sizeof(struct gfs_meta_header);
-			bits->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
-			bits->bi_len = bytes;
-		}
-
-		bytes_left -= bytes;
-	}
-
-	if (bytes_left) {
-		gfs_consist_rgrpd(rgd);
-		return -EIO;
-	}
-        if ((rgd->rd_bits[length - 1].bi_start +
-	     rgd->rd_bits[length - 1].bi_len) * GFS_NBBY !=
-	    rgd->rd_ri.ri_data) {
-		if (gfs_consist_rgrpd(rgd)) {
-			gfs_rindex_print(&rgd->rd_ri);
-			printk("GFS: fsid=%s: start=%u len=%u offset=%u\n",
-			       sdp->sd_fsname,
-			       rgd->rd_bits[length - 1].bi_start,
-			       rgd->rd_bits[length - 1].bi_len,
-			       rgd->rd_bits[length - 1].bi_offset);
-		}
-		return -EIO;
-	}
-
-	rgd->rd_bh = kmalloc(length * sizeof(struct buffer_head *), GFP_KERNEL);
-	if (!rgd->rd_bh) {
-		kfree(rgd->rd_bits);
-		rgd->rd_bits = NULL;
-		return -ENOMEM;
-	}
-	memset(rgd->rd_bh, 0, length * sizeof(struct buffer_head *));
-
-	return 0;
-}
-
-/**
- * gfs_ri_update - Pull in a new resource index from the disk
- * @gl: The glock covering the rindex inode
- *
- * Returns: 0 on successful update, error code otherwise
- */
-
-static int
-gfs_ri_update(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd;
-	char buf[sizeof(struct gfs_rindex)];
-	int error;
-
-	if (do_mod(ip->i_di.di_size, sizeof(struct gfs_rindex))) {
-		gfs_consist_inode(ip);
-		return -EIO;
-	}
-
-	clear_rgrpdi(sdp);
-
-	for (sdp->sd_rgcount = 0;; sdp->sd_rgcount++) {
-		error = gfs_internal_read(ip, buf,
-					  sdp->sd_rgcount *
-					  sizeof(struct gfs_rindex),
-					  sizeof(struct gfs_rindex));
-		if (!error)
-			break;
-		if (error != sizeof(struct gfs_rindex)) {
-			if (error > 0)
-				error = -EIO;
-			goto fail;
-		}
-
-		rgd = kmalloc(sizeof(struct gfs_rgrpd), GFP_KERNEL);
-		error = -ENOMEM;
-		if (!rgd)
-			goto fail;
-		memset(rgd, 0, sizeof(struct gfs_rgrpd));
-
-		INIT_LIST_HEAD(&rgd->rd_mhc);
-		INIT_LIST_HEAD(&rgd->rd_depend);
-		rgd->rd_sbd = sdp;
-
-		list_add_tail(&rgd->rd_list, &sdp->sd_rglist);
-		list_add_tail(&rgd->rd_list_mru, &sdp->sd_rg_mru_list);
-
-		gfs_rindex_in(&rgd->rd_ri, buf);
-
-		error = compute_bitstructs(rgd);
-		if (error)
-			goto fail;
-
-		error = gfs_glock_get(sdp, rgd->rd_ri.ri_addr, &gfs_rgrp_glops,
-				      CREATE, &rgd->rd_gl);
-		if (error)
-			goto fail;
-
-		error = gfs_lvb_hold(rgd->rd_gl);
-		if (error)
-			goto fail;
-
-		set_gl2rgd(rgd->rd_gl, rgd);
-		rgd->rd_rg_vn = rgd->rd_gl->gl_vn - 1;
-	}
-
-	sdp->sd_riinode_vn = ip->i_gl->gl_vn;
-
-	return 0;
-
- fail:
-	clear_rgrpdi(sdp);
-
-	return error;
-}
-
-/**
- * gfs_rindex_hold - Grab a lock on the rindex
- * @sdp: The GFS superblock
- * @ri_gh: the glock holder
- *
- * We grab a lock on the rindex inode to make sure that it doesn't
- * change whilst we are performing an operation. We keep this lock
- * for quite long periods of time compared to other locks. This
- * doesn't matter, since it is shared and it is very, very rarely
- * accessed in the exclusive mode (i.e. only when expanding the filesystem).
- *
- * This makes sure that we're using the latest copy of the resource index
- *   special file, which might have been updated if someone expanded the
- *   filesystem (via gfs_grow utility), which adds new resource groups.
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int
-gfs_rindex_hold(struct gfs_sbd *sdp, struct gfs_holder *ri_gh)
-{
-	struct gfs_inode *ip = sdp->sd_riinode;
-	struct gfs_glock *gl = ip->i_gl;
-	int error;
-
-	error = gfs_glock_nq_init(gl, LM_ST_SHARED, 0, ri_gh);
-	if (error)
-		return error;
-
-	/* Read new copy from disk if we don't have the latest */
-	if (sdp->sd_riinode_vn != gl->gl_vn) {
-		down(&sdp->sd_rindex_lock);
-		if (sdp->sd_riinode_vn != gl->gl_vn) {
-			error = gfs_ri_update(ip);
-			if (error)
-				gfs_glock_dq_uninit(ri_gh);
-		}
-		up(&sdp->sd_rindex_lock);
-	}
-
-	return error;
-}
-
-/**
- * gfs_rgrp_read - Read in a RG's header and bitmaps
- * @rgd: the struct gfs_rgrpd describing the RG to read in
- *
- * Read in all of a Resource Group's header and bitmap blocks.
- * Caller must eventually call gfs_rgrp_relse() to free the bitmaps.
- *
- * Returns: errno
- */
-
-int
-gfs_rgrp_read(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_glock *gl = rgd->rd_gl;
-	unsigned int x, length = rgd->rd_ri.ri_length;
-	int error;
-
-	for (x = 0; x < length; x++) {
-		gfs_assert_warn(sdp, !rgd->rd_bh[x]);
-		rgd->rd_bh[x] = gfs_dgetblk(gl, rgd->rd_ri.ri_addr + x);
-	}
-
-	for (x = 0; x < length; x++) {
-		error = gfs_dreread(sdp, rgd->rd_bh[x], DIO_START);
-		if (error)
-			goto fail;
-	}
-
-	for (x = length; x--;) {
-		error = gfs_dreread(sdp, rgd->rd_bh[x], DIO_WAIT);
-		if (error)
-			goto fail;
-		if (gfs_metatype_check(sdp, rgd->rd_bh[x],
-				       (x) ? GFS_METATYPE_RB : GFS_METATYPE_RG)) {
-			error = -EIO;
-			goto fail;
-		}
-	}
-
-	if (rgd->rd_rg_vn != gl->gl_vn) {
-		gfs_rgrp_in(&rgd->rd_rg, (rgd->rd_bh[0])->b_data);
-		rgd->rd_rg_vn = gl->gl_vn;
-	}
-
-	return 0;
-
- fail:
-	for (x = 0; x < length; x++) {
-		brelse(rgd->rd_bh[x]);
-		rgd->rd_bh[x] = NULL;
-	}
-
-	return error;
-}
-
-/**
- * gfs_rgrp_relse - Release RG bitmaps read in with gfs_rgrp_read()
- * @rgd: the struct gfs_rgrpd describing the RG to read in
- *
- */
-
-void
-gfs_rgrp_relse(struct gfs_rgrpd *rgd)
-{
-	int x, length = rgd->rd_ri.ri_length;
-
-	for (x = 0; x < length; x++) {
-		brelse(rgd->rd_bh[x]);
-		rgd->rd_bh[x] = NULL;
-	}
-}
-
-/**
- * gfs_rgrp_lvb_fill - copy RG usage data out of the struct gfs_rgrp into the struct gfs_rgrp_lvb
- * @rgd: the resource group data structure
- *
- */
-
-void
-gfs_rgrp_lvb_fill(struct gfs_rgrpd *rgd)
-{
-	struct gfs_rgrp *rg = &rgd->rd_rg;
-	struct gfs_rgrp_lvb *rb = (struct gfs_rgrp_lvb *)rgd->rd_gl->gl_lvb;
-
-	rb->rb_magic = cpu_to_gfs32(GFS_MAGIC);
-	rb->rb_free = cpu_to_gfs32(rg->rg_free);
-	rb->rb_useddi = cpu_to_gfs32(rg->rg_useddi);
-	rb->rb_freedi = cpu_to_gfs32(rg->rg_freedi);
-	rb->rb_usedmeta = cpu_to_gfs32(rg->rg_usedmeta);
-	rb->rb_freemeta = cpu_to_gfs32(rg->rg_freemeta);
-}
-
-/**
- * gfs_rgrp_lvb_init - Init the data of a RG LVB
- * @rgd: the resource group data structure
- *
- * Returns:  errno
- */
-
-int
-gfs_rgrp_lvb_init(struct gfs_rgrpd *rgd)
-{
-	struct gfs_glock *gl = rgd->rd_gl;
-	struct gfs_holder rgd_gh;
-	int error;
-
-	error = gfs_glock_nq_init(gl, LM_ST_EXCLUSIVE, 0, &rgd_gh);
-	if (!error) {
-		gfs_rgrp_lvb_fill(rgd);
-		gfs_glock_dq_uninit(&rgd_gh);
-	}
-
-	return error;
-}
-
-/**
- * gfs_alloc_get - allocate a struct gfs_alloc structure for an inode
- * @ip: the incore GFS inode structure
- *
- * Alloc and zero an in-place reservation structure,
- *   and attach it to the GFS incore inode.
- *
- * FIXME: Don't use gmalloc()
- *
- * Returns: the struct gfs_alloc
- */
-
-struct gfs_alloc *
-gfs_alloc_get(struct gfs_inode *ip)
-{
-	struct gfs_alloc *al = ip->i_alloc;
-
-	gfs_assert_warn(ip->i_sbd, !al);
-
-	al = gmalloc(sizeof(struct gfs_alloc));
-	memset(al, 0, sizeof(struct gfs_alloc));
-
-	ip->i_alloc = al;
-
-	return al;
-}
-
-/**
- * gfs_alloc_put - throw away the struct gfs_alloc for an inode
- * @ip: the inode
- *
- */
-
-void
-gfs_alloc_put(struct gfs_inode *ip)
-{
-	struct gfs_alloc *al = ip->i_alloc;
-
-	if (gfs_assert_warn(ip->i_sbd, al))
-		return;
-
-	ip->i_alloc = NULL;
-	kfree(al);
-}
-
-/**
- * try_rgrp_fit - See if a given reservation will fit in a given RG
- * @rgd: the RG data
- * @al: the struct gfs_alloc structure describing the reservation
- *
- * If there's room for the requested blocks to be allocated from the RG:
- *   Sets the $al_reserved_data field in @al.
- *   Sets the $al_reserved_meta field in @al.
- *   Sets the $al_rgd field in @al.
- *
- * Returns: 1 on success (it fits), 0 on failure (it doesn't fit)
- */
-
-static int
-try_rgrp_fit(struct gfs_rgrpd *rgd, struct gfs_alloc *al)
-{
-	uint32_t freeblks = rgd->rd_rg.rg_free;
-	uint32_t freemeta = rgd->rd_rg.rg_freemeta;
-	uint32_t metares = al->al_requested_meta;
-	uint32_t datares = al->al_requested_data;
-
-	/* First take care of the data blocks required */
-
-	if (freeblks < al->al_requested_data)
-		return 0;
-
-	freeblks -= al->al_requested_data;
-
-	/* Then take care of the dinodes */
-
-	metares += al->al_requested_di;
-
-	/* Then take care of the metadata blocks */
-
-	while (freemeta < metares) {
-		if (freeblks < GFS_META_CLUMP)
-			return 0;
-
-		freeblks -= GFS_META_CLUMP;
-		freemeta += GFS_META_CLUMP;
-
-		datares += GFS_META_CLUMP;
-	}
-
-	al->al_rgd = rgd;
-	al->al_reserved_meta = metares;
-	al->al_reserved_data = datares;
-
-	return 1;
-}
-
-/**
- * recent_rgrp_first - get first RG from "recent" list
- * @sdp: The GFS superblock
- * @rglast: address of the rgrp used last
- *
- * Returns: The first rgrp in the recent list
- */
-
-static struct gfs_rgrpd *
-recent_rgrp_first(struct gfs_sbd *sdp, uint64_t rglast)
-{
-	struct list_head *tmp, *head;
-	struct gfs_rgrpd *rgd = NULL;
-
-	spin_lock(&sdp->sd_rg_recent_lock);
-
-	if (list_empty(&sdp->sd_rg_recent))
-		goto out;
-
-	if (!rglast)
-		goto first;
-
-	for (head = &sdp->sd_rg_recent, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		rgd = list_entry(tmp, struct gfs_rgrpd, rd_recent);
-		if (rgd->rd_ri.ri_addr == rglast)
-			goto out;
-	}
-
- first:
-	rgd = list_entry(sdp->sd_rg_recent.next, struct gfs_rgrpd, rd_recent);
-
- out:
-	spin_unlock(&sdp->sd_rg_recent_lock);
-
-	return rgd;
-}
-
-/**
- * recent_rgrp_next - get next RG from "recent" list
- * @cur_rgd: current rgrp
- * @remove:
- *
- * Returns: The next rgrp in the recent list
- */
-
-static struct gfs_rgrpd *
-recent_rgrp_next(struct gfs_rgrpd *cur_rgd, int remove)
-{
-	struct gfs_sbd *sdp = cur_rgd->rd_sbd;
-	struct list_head *tmp, *head;
-	struct gfs_rgrpd *rgd;
-
-	spin_lock(&sdp->sd_rg_recent_lock);
-
-	for (head = &sdp->sd_rg_recent, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		rgd = list_entry(tmp, struct gfs_rgrpd, rd_recent);
-		if (rgd == cur_rgd) {
-			if (cur_rgd->rd_recent.next != head)
-				rgd = list_entry(cur_rgd->rd_recent.next,
-						 struct gfs_rgrpd, rd_recent);
-			else
-				rgd = NULL;
-
-			if (remove)
-				list_del(&cur_rgd->rd_recent);
-
-			goto out;
-		}
-	}
-
-	rgd = NULL;
-	if (!list_empty(head))
-		rgd = list_entry(head->next, struct gfs_rgrpd, rd_recent);
-
- out:
-	spin_unlock(&sdp->sd_rg_recent_lock);
-
-	return rgd;
-}
-
-/**
- * recent_rgrp_add - add an RG to tail of "recent" list
- * @new_rgd: The rgrp to add
- *
- * Before adding, make sure that:
- *   1) it's not already on the list
- *   2) there's still room for more entries
- * The capacity limit imposed on the "recent" list is basically a node's "share"
- *   of rgrps within a cluster, i.e. (total # rgrps) / (# nodes (journals))
- */
-
-static void
-recent_rgrp_add(struct gfs_rgrpd *new_rgd)
-{
-	struct gfs_sbd *sdp = new_rgd->rd_sbd;
-	struct list_head *tmp, *head;
-	struct gfs_rgrpd *rgd = NULL;
-	unsigned int count = 0;
-	unsigned int max = sdp->sd_rgcount / gfs_num_journals(sdp);
-
-	spin_lock(&sdp->sd_rg_recent_lock);
-
-	for (head = &sdp->sd_rg_recent, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		rgd = list_entry(tmp, struct gfs_rgrpd, rd_recent);
-		if (rgd == new_rgd)
-			goto out;
-
-		if (++count >= max)
-			goto out;
-	}
-	new_rgd->rd_try_counter = 0;
-	list_add_tail(&new_rgd->rd_recent, &sdp->sd_rg_recent);
-
- out:
-	spin_unlock(&sdp->sd_rg_recent_lock);
-}
-
-/**
- * forward_rgrp_get - get an rgrp to try next from full list
- * @sdp: The GFS superblock
- *
- * Returns: The rgrp to try next
- */
-
-static struct gfs_rgrpd *
-forward_rgrp_get(struct gfs_sbd *sdp)
-{
-	struct gfs_rgrpd *rgd;
-	unsigned int journals = gfs_num_journals(sdp);
-	unsigned int rg = 0, x;
-
-	spin_lock(&sdp->sd_rg_forward_lock);
-
-	rgd = sdp->sd_rg_forward;
-	if (!rgd) {
-		if (sdp->sd_rgcount >= journals)
-			rg = sdp->sd_rgcount *
-				sdp->sd_lockstruct.ls_jid /
-				journals;
-
-		for (x = 0, rgd = gfs_rgrpd_get_first(sdp);
-		     x < rg;
-		     x++, rgd = gfs_rgrpd_get_next(rgd))
-			/* Do Nothing */;
-
-		sdp->sd_rg_forward = rgd;
-	}
-
-	spin_unlock(&sdp->sd_rg_forward_lock);
-
-	return rgd;
-}
-
-/**
- * forward_rgrp_set - set the forward rgrp pointer
- * @sdp: the filesystem
- * @rgd: The new forward rgrp
- *
- */
-
-static void
-forward_rgrp_set(struct gfs_sbd *sdp, struct gfs_rgrpd *rgd)
-{
-	spin_lock(&sdp->sd_rg_forward_lock);
-	sdp->sd_rg_forward = rgd;
-	spin_unlock(&sdp->sd_rg_forward_lock);
-}
-
-/**
- * get_local_rgrp - Choose and lock a rgrp for allocation
- * @ip: the inode to reserve space for
- * @rgp: the chosen and locked rgrp
- *
- * Try to acquire rgrp in way which avoids contending with others.
- *
- * Returns: errno
- */
-
-static int
-get_local_rgrp(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd, *begin = NULL;
-	struct gfs_alloc *al = ip->i_alloc;
-	int flags = LM_FLAG_TRY;
-	int skipped = 0;
-	int loops = 0;
-	int error;
-	int try_flag;
-	unsigned int try_threshold = gfs_tune_get(sdp, gt_rgrp_try_threshold);
-
-	/* Try recently successful rgrps */
-
-	rgd = recent_rgrp_first(sdp, ip->i_last_rg_alloc);
-
-	while (rgd) {
-		try_flag = (rgd->rd_try_counter >= try_threshold) ?
-			0: LM_FLAG_TRY;
-		error = gfs_glock_nq_init(rgd->rd_gl,
-					  LM_ST_EXCLUSIVE, try_flag,
-					  &al->al_rgd_gh);
-		switch (error) {
-		case 0:
-			if (try_rgrp_fit(rgd, al)) {
-				rgd->rd_try_counter = 0;
-				goto out;
-			}
-			gfs_glock_dq_uninit(&al->al_rgd_gh);
-			rgd = recent_rgrp_next(rgd, TRUE);
-			break;
-
-		case GLR_TRYFAILED:
-			rgd->rd_try_counter++;
-			rgd = recent_rgrp_next(rgd, FALSE);
-			break;
-
-		default:
-			return error;
-		}
-	}
-
-	/* Go through full list of rgrps */
-
-	begin = rgd = forward_rgrp_get(sdp);
-
-	for (;;) {
-		error = gfs_glock_nq_init(rgd->rd_gl,
-					  LM_ST_EXCLUSIVE, flags,
-					  &al->al_rgd_gh);
-		switch (error) {
-		case 0:
-			if (try_rgrp_fit(rgd, al))
-				goto out;
-			gfs_glock_dq_uninit(&al->al_rgd_gh);
-			break;
-
-		case GLR_TRYFAILED:
-			skipped++;
-			break;
-
-		default:
-			return error;
-		}
-
-		rgd = gfs_rgrpd_get_next(rgd);
-		if (!rgd)
-			rgd = gfs_rgrpd_get_first(sdp);
-
-		if (rgd == begin) {
-			if (++loops >= 2 || !skipped)
-				return -ENOSPC;
-			flags = 0;
-		}
-	}
-
- out:
-	ip->i_last_rg_alloc = rgd->rd_ri.ri_addr;
-
-	if (begin) {
-		recent_rgrp_add(rgd);
-		rgd = gfs_rgrpd_get_next(rgd);
-		if (!rgd)
-			rgd = gfs_rgrpd_get_first(sdp);
-		forward_rgrp_set(sdp, rgd);
-	}
-
-	return 0;
-}
-
-/**
- * gfs_inplace_reserve_i - Reserve space in the filesystem
- * @ip: the inode to reserve space for
- *
- * Acquire resource group locks to allow for the maximum allocation
- * described by "res".
- *
- * This should probably become more complex again, but for now, let's go
- * for simple (one resource group) reservations.
- *
- * Returns: errno
- */
-
-int
-gfs_inplace_reserve_i(struct gfs_inode *ip,
-		     char *file, unsigned int line)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	int error;
-
-        if (gfs_assert_warn(sdp,
-			    al->al_requested_di ||
-			    al->al_requested_data ||
-			    al->al_requested_meta))
-		return -EINVAL;
-
-	error = gfs_rindex_hold(sdp, &al->al_ri_gh);
-	if (error)
-		return error;
-
-	error = get_local_rgrp(ip);
-	if (error) {
-		gfs_glock_dq_uninit(&al->al_ri_gh);
-		return error;
-	}
-
-	gfs_depend_sync(al->al_rgd);
-
-	al->al_file = file;
-	al->al_line = line;
-
-	return 0;
-}
-
-/**
- * gfs_inplace_release - release an inplace reservation
- * @ip: the inode the reservation was taken out on
- *
- * Release a reservation made by gfs_inplace_reserve().
- */
-
-void
-gfs_inplace_release(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-
-	if (gfs_assert_warn(sdp, al->al_alloced_di <= al->al_requested_di) == -1)
-		printk("GFS: fsid=%s: al_alloced_di = %u, al_requested_di = %u\n"
-		       "GFS: fsid=%s: al_file = %s, al_line = %u\n",
-		       sdp->sd_fsname, al->al_alloced_di, al->al_requested_di,
-		       sdp->sd_fsname, al->al_file, al->al_line);
-	if (gfs_assert_warn(sdp, al->al_alloced_meta <= al->al_reserved_meta) == -1)
-		printk("GFS: fsid=%s: al_alloced_meta = %u, al_reserved_meta = %u\n"
-		       "GFS: fsid=%s: al_file = %s, al_line = %u\n",
-		       sdp->sd_fsname, al->al_alloced_meta, al->al_reserved_meta,
-		       sdp->sd_fsname, al->al_file, al->al_line);
-	if (gfs_assert_warn(sdp, al->al_alloced_data <= al->al_reserved_data) == -1)
-		printk("GFS: fsid=%s: al_alloced_data = %u, al_reserved_data = %u\n"
-		       "GFS: fsid=%s: al_file = %s, al_line = %u\n",
-		       sdp->sd_fsname, al->al_alloced_data, al->al_reserved_data,
-		       sdp->sd_fsname, al->al_file, al->al_line);
-
-	al->al_rgd = NULL;
-	gfs_glock_dq_uninit(&al->al_rgd_gh);
-	gfs_glock_dq_uninit(&al->al_ri_gh);
-}
-
-/**
- * gfs_get_block_type - Check a block in a RG is of given type
- * @rgd: the resource group holding the block
- * @block: the block number
- *
- * Returns: The block type (GFS_BLKST_*)
- */
-
-unsigned char
-gfs_get_block_type(struct gfs_rgrpd *rgd, uint64_t block)
-{
-	struct gfs_bitmap *bits = NULL;
-	uint32_t length, rgrp_block, buf_block;
-	unsigned int buf;
-	unsigned char type;
-
-	length = rgd->rd_ri.ri_length;
-	rgrp_block = block - rgd->rd_ri.ri_data1;
-
-	for (buf = 0; buf < length; buf++) {
-		bits = &rgd->rd_bits[buf];
-		if (rgrp_block < (bits->bi_start + bits->bi_len) * GFS_NBBY)
-			break;
-	}
-
-	gfs_assert(rgd->rd_sbd, buf < length,);
-	buf_block = rgrp_block - bits->bi_start * GFS_NBBY;
-
-	type = gfs_testbit(rgd,
-			   rgd->rd_bh[buf]->b_data + bits->bi_offset,
-			   bits->bi_len, buf_block);
-
-	return type;
-}
-
-/**
- * blkalloc_internal - find a block in @old_state, change allocation
- *           state to @new_state
- * @rgd: the resource group descriptor
- * @goal: the goal block within the RG (start here to search for avail block)
- * @old_state: GFS_BLKST_XXX the before-allocation state to find
- * @new_state: GFS_BLKST_XXX the after-allocation block state
- *
- * Walk rgrp's bitmap to find bits that represent a block in @old_state.
- * Add the found bitmap buffer to the transaction.
- * Set the found bits to @new_state to change block's allocation state.
- *
- * This function never fails, because we wouldn't call it unless we
- *   know (from reservation results, etc.) that a block is available.
- *
- * Scope of @goal and returned block is just within rgrp (32-bit),
- *   not the whole filesystem (64-bit).
- *
- * Returns:  the block # allocated (32-bit rgrp scope)
- */
-
-static uint32_t
-blkalloc_internal(struct gfs_rgrpd *rgd,
-		  uint32_t goal,
-		  unsigned char old_state, unsigned char new_state)
-{
-	struct gfs_bitmap *bits = NULL;
-	uint32_t length = rgd->rd_ri.ri_length;
-	uint32_t blk = 0;
-	unsigned int buf, x;
-
-	/* Find bitmap block that contains bits for goal block */
-	for (buf = 0; buf < length; buf++) {
-		bits = &rgd->rd_bits[buf];
-		if (goal < (bits->bi_start + bits->bi_len) * GFS_NBBY)
-			break;
-	}
-
-	gfs_assert(rgd->rd_sbd, buf < length,);
-
-	/* Convert scope of "goal" from rgrp-wide to within found bit block */
-	goal -= bits->bi_start * GFS_NBBY;
-
-	/* Search (up to entire) bitmap in this rgrp for allocatable block.
-	   "x <= length", instead of "x < length", because we typically start
-	   the search in the middle of a bit block, but if we can't find an
-	   allocatable block anywhere else, we want to be able wrap around and
-	   search in the first part of our first-searched bit block.  */
-	for (x = 0; x <= length; x++) {
-		blk = gfs_bitfit(rgd->rd_bh[buf]->b_data + bits->bi_offset,
-				 bits->bi_len, goal, old_state);
-		if (blk != BFITNOENT)
-			break;
-
-		/* Try next bitmap block (wrap back to rgrp header if at end) */
-		buf = (buf + 1) % length;
-		bits = &rgd->rd_bits[buf];
-		goal = 0;
-	}
-
-	if (unlikely(x > length)) {
-		printk("GFS error: possible RG corruption\n");
-		printk("    please run gfs_fsck after withdraw\n");
-		dump_stack();
-		if (gfs_assert_withdraw(rgd->rd_sbd, x <= length))
-			blk = 0;
-	}
-
-	/* Attach bitmap buffer to trans, modify bits to do block alloc */
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[buf]);
-	gfs_setbit(rgd,
-		   rgd->rd_bh[buf]->b_data + bits->bi_offset,
-		   bits->bi_len, blk, new_state);
-
-	/* Return allocated block #, rgrp scope (32-bit) */
-	return bits->bi_start * GFS_NBBY + blk;
-}
-
-/**
- * blkfree_internal - Change alloc state of given block(s)
- * @sdp: the filesystem
- * @bstart: first block (64-bit filesystem scope) of a run of contiguous blocks
- * @blen: the length of the block run (all must lie within ONE RG!)
- * @new_state: GFS_BLKST_XXX the after-allocation block state
- *
- * Returns:  Resource group containing the block(s)
- *
- * Find rgrp containing @bstart.
- * For each block in run:
- *   Find allocation bitmap buffer.
- *   Add bitmap buffer to transaction.
- *   Set bits to new state.
- * Typically used to free blocks to GFS_BLKST_FREE or GFS_BLKST_FREEMETA,
- *   but @new_state can be any GFS_BLKST_XXX
- * 
- */
-
-static struct gfs_rgrpd *
-blkfree_internal(struct gfs_sbd *sdp, uint64_t bstart, uint32_t blen,
-		 unsigned char new_state)
-{
-	struct gfs_rgrpd *rgd;
-	struct gfs_bitmap *bits = NULL;
-	uint32_t length, rgrp_blk, buf_blk;
-	unsigned int buf;
-
-	/* Find rgrp */
-	rgd = gfs_blk2rgrpd(sdp, bstart);
-	if (!rgd) {
-		if (gfs_consist(sdp))
-			printk("GFS: fsid=%s: block = %llu\n",
-			       sdp->sd_fsname, bstart);
-		return NULL;
-	}
-
-	length = rgd->rd_ri.ri_length;
-
-	/* Convert blk # from filesystem scope (64-bit) to RG scope (32-bit) */
-	rgrp_blk = bstart - rgd->rd_ri.ri_data1;
-
-	while (blen--) {
-		/* Find bitmap buffer for this block */
-		for (buf = 0; buf < length; buf++) {
-			bits = &rgd->rd_bits[buf];
-			if (rgrp_blk < (bits->bi_start + bits->bi_len) * GFS_NBBY)
-				break;
-		}
-
-		gfs_assert(rgd->rd_sbd, buf < length,);
-
-		/* Find bits and set 'em */
-		buf_blk = rgrp_blk - bits->bi_start * GFS_NBBY;
-		rgrp_blk++;
-
-		gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[buf]);
-		gfs_setbit(rgd,
-			   rgd->rd_bh[buf]->b_data + bits->bi_offset,
-			   bits->bi_len, buf_blk, new_state);
-	}
-
-	return rgd;
-}
-
-/**
- * clump_alloc - Allocate a clump of metadata blocks
- * @rgd: the resource group in which to allocate
- * @first: returns the first block allocated
- *
- * Returns: errno
- *
- * Bitmap-allocate a clump of metadata blocks
- * Write metadata blocks to disk with dummy meta-headers
- * Add meta-headers to incore meta-header cache
- */
-
-static int
-clump_alloc(struct gfs_rgrpd *rgd, uint32_t *first)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_meta_header mh;
-	struct buffer_head **bh;
-	uint32_t goal, blk;
-	unsigned int x;
-	int error = 0;
-
-	/* Dummy meta-header template */
-	memset(&mh, 0, sizeof(struct gfs_meta_header));
-	mh.mh_magic = GFS_MAGIC;
-	mh.mh_type = GFS_METATYPE_NONE;
-
-	/* Array of bh pointers used in several steps */
-	bh = gmalloc(GFS_META_CLUMP * sizeof(struct buffer_head *));
-	memset(bh, 0, GFS_META_CLUMP * sizeof(struct buffer_head *));
-
-	/* Since we're looking for data blocks to change into meta blocks,
-	   use last alloc'd *data* (not meta) block as start point */
-	goal = rgd->rd_last_alloc_data;
-
-	for (x = 0; x < GFS_META_CLUMP; x++) {
-		blk = blkalloc_internal(rgd, goal, GFS_BLKST_FREE,
-					GFS_BLKST_FREEMETA);
-		if (!x)
-			*first = blk;
-
-		bh[x] = gfs_dgetblk(rgd->rd_gl, rgd->rd_ri.ri_data1 + blk);
-
-		gfs_prep_new_buffer(bh[x]);
-
-		gfs_meta_header_out(&mh, bh[x]->b_data);
-		((struct gfs_meta_header *)bh[x]->b_data)->mh_generation = 0;
-
-		/* start write of new meta-buffer to disk */
-		error = gfs_dwrite(sdp, bh[x], DIO_DIRTY | DIO_START);
-		if (error)
-			goto out;
-
-		goal = blk;
-	}
-
-	/* Block alloc start point for next time */
-	rgd->rd_last_alloc_data = goal;
-
-	/* Wait for all new meta-buffers to get on-disk */
-	for (x = 0; x < GFS_META_CLUMP; x++) {
-		error = gfs_dwrite(sdp, bh[x], DIO_WAIT);
-		if (error)
-			goto out;
-	}
-
-	/* Add all new meta-headers to meta-header cache */
-	gfs_mhc_add(rgd, bh, GFS_META_CLUMP);
-
-	gfs_assert_withdraw(sdp, rgd->rd_rg.rg_free >= GFS_META_CLUMP);
-	rgd->rd_rg.rg_free -= GFS_META_CLUMP;
-	rgd->rd_rg.rg_freemeta += GFS_META_CLUMP;
-
- out:
-	for (x = 0; x < GFS_META_CLUMP; x++)
-		if (bh[x]) {
-			gfs_dwrite(sdp, bh[x], DIO_WAIT);
-			brelse(bh[x]);
-		}
-	kfree(bh);
-
-	return error;
-}
-
-/**
- * gfs_blkalloc - Allocate a data block
- * @ip: the inode to allocate the data block for
- * @block: the block allocated
- *
- */
-
-void
-gfs_blkalloc(struct gfs_inode *ip, uint64_t *block)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	struct gfs_rgrpd *rgd = al->al_rgd;
-	uint32_t goal, blk;
-	int same;
-
-	same = (rgd->rd_ri.ri_addr == ip->i_di.di_goal_rgrp);
-	goal = (same) ? ip->i_di.di_goal_dblk : rgd->rd_last_alloc_data;
-
-	blk = blkalloc_internal(rgd, goal,
-				GFS_BLKST_FREE, GFS_BLKST_USED);
-	rgd->rd_last_alloc_data = blk;
-
-	if (!same) {
-		ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-		ip->i_di.di_goal_mblk = 0;
-	}
-	ip->i_di.di_goal_dblk = blk;
-
-	*block = rgd->rd_ri.ri_data1 + blk;
-
-	gfs_assert_withdraw(sdp, rgd->rd_rg.rg_free);
-	rgd->rd_rg.rg_free--;
-
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-	gfs_rgrp_out(&rgd->rd_rg, rgd->rd_bh[0]->b_data);
-
-	al->al_alloced_data++;
-
-	gfs_trans_add_quota(sdp, +1, ip->i_di.di_uid, ip->i_di.di_gid);
-
-	/* total=0, free=-1, dinodes=0 */
-	gfs_statfs_modify(sdp, 0, -1, 0);
-}
-
-/**
- * gfs_metaalloc - Allocate a metadata block to a file
- * @ip:  the file
- * @block: the block allocated
- *
- * Returns: errno
- */
-
-int
-gfs_metaalloc(struct gfs_inode *ip, uint64_t *block)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_alloc *al = ip->i_alloc;
-	struct gfs_rgrpd *rgd = al->al_rgd;
-	uint32_t goal, blk;
-	int same;
-	int error;
-
-	same = (rgd->rd_ri.ri_addr == ip->i_di.di_goal_rgrp);
-
-	if (!rgd->rd_rg.rg_freemeta) {
-		error = clump_alloc(rgd, &goal);
-		if (error)
-			return error;
-
-		al->al_alloced_data += GFS_META_CLUMP;
-	} else
-		goal = (same) ? ip->i_di.di_goal_mblk : rgd->rd_last_alloc_meta;
-
-	blk = blkalloc_internal(rgd, goal,
-				GFS_BLKST_FREEMETA, GFS_BLKST_USEDMETA);
-	rgd->rd_last_alloc_meta = blk;
-
-	if (!same) {
-		ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-		ip->i_di.di_goal_dblk = 0;
-	}
-	ip->i_di.di_goal_mblk = blk;
-
-	*block = rgd->rd_ri.ri_data1 + blk;
-
-	gfs_assert_withdraw(sdp, rgd->rd_rg.rg_freemeta);
-	rgd->rd_rg.rg_freemeta--;
-	rgd->rd_rg.rg_usedmeta++;
-
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-	gfs_rgrp_out(&rgd->rd_rg, rgd->rd_bh[0]->b_data);
-
-	al->al_alloced_meta++;
-
-	gfs_trans_add_quota(sdp, +1, ip->i_di.di_uid, ip->i_di.di_gid);
-
-	/* total=0, free=-1, dinode=0 */
-	gfs_statfs_modify(sdp, 0, -1, 0);
-
-	return 0;
-}
-
-/**
- * gfs_dialloc - Allocate a dinode
- * @dip: the directory that the inode is going in
- * @block: the block (result) which this function allocates as the dinode
- *     (64-bit filesystem scope)
- *
- * Returns: errno
- */
-
-int
-gfs_dialloc(struct gfs_inode *dip, uint64_t *block)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_alloc *al = dip->i_alloc;
-	struct gfs_rgrpd *rgd = al->al_rgd;
-	uint32_t goal, blk;
-	int error = 0;
-
-	if (rgd->rd_rg.rg_freemeta)
-		/* pick up where we left off last time */
-		goal = rgd->rd_last_alloc_meta;
-	else {
-		/* no free meta blocks, allocate a bunch more */
-		error = clump_alloc(rgd, &goal);
-		if (error)
-			return error;
-
-		al->al_alloced_data += GFS_META_CLUMP;
-	}
-
-	/* Alloc the dinode; 32-bit "blk" is block offset within rgrp */
-	blk = blkalloc_internal(rgd, goal,
-				GFS_BLKST_FREEMETA, GFS_BLKST_USEDMETA);
-
-	/* remember where we left off, for next time */
-	rgd->rd_last_alloc_meta = blk;
-
-	/* convert from rgrp scope (32-bit) to filesystem scope (64-bit) */
-	*block = rgd->rd_ri.ri_data1 + blk;
-
-	gfs_assert_withdraw(rgd->rd_sbd, rgd->rd_rg.rg_freemeta);
-	rgd->rd_rg.rg_freemeta--;
-	rgd->rd_rg.rg_useddi++;
-
-	/* Attach rgrp header to trans, update freemeta and useddi stats */
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-	gfs_rgrp_out(&rgd->rd_rg, rgd->rd_bh[0]->b_data);
-
-	/* Update stats in in-place reservation struct */
-	al->al_alloced_di++;
-	al->al_alloced_meta++;
-
-	/* total=0, free=-1, dinodes=1 */
-	gfs_statfs_modify(sdp, 0, -1, +1);
-
-	return error;
-}
-
-/**
- * gfs_blkfree - free a contiguous run of data block(s)
- * @ip: the inode these blocks are being freed from
- * @bstart: first block (64-bit filesystem scope) of a run of contiguous blocks
- * @blen: the length of the block run (all must lie within ONE RG!)
- *
- * Bitmap-deallocate the blocks (to FREE data state), add bitmap blks to trans
- * Update rgrp alloc statistics in rgrp header, add rgrp header buf to trans
- * Update quotas, add to trans.
- */
-
-void
-gfs_blkfree(struct gfs_inode *ip, uint64_t bstart, uint32_t blen)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd;
-
-	rgd = blkfree_internal(sdp, bstart, blen, GFS_BLKST_FREE);
-	if (!rgd)
-		return;
-
-	rgd->rd_rg.rg_free += blen;
-
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-	gfs_rgrp_out(&rgd->rd_rg, rgd->rd_bh[0]->b_data);
-
-	gfs_trans_add_quota(sdp, -(int64_t)blen,
-			    ip->i_di.di_uid,
-			    ip->i_di.di_gid);
-
-	/* total=0, free=+blen, dinodes=0 */
-	gfs_statfs_modify(sdp, 0, blen, 0);
-}
-
-/**
- * gfs_metafree - free a contiguous run of metadata block(s)
- * @ip: the inode these blocks are being freed from
- * @bstart: first block (64-bit filesystem scope) of a run of contiguous blocks
- * @blen: the length of the block run (all must lie within ONE RG!)
- *
- * Bitmap-deallocate the blocks (to FREEMETA state), add bitmap blks to trans.
- * Update rgrp alloc statistics in rgrp header, add rgrp header to trans.
- * Update quotas (quotas include metadata, not just data block usage),
- *    add to trans.
- * Release deallocated buffers, add to meta-header cache (we save these in-core
- *    so we don't need to re-read meta blocks if/when they are re-alloc'd).
- */
-
-void
-gfs_metafree(struct gfs_inode *ip, uint64_t bstart, uint32_t blen)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd;
-
-	rgd = blkfree_internal(sdp, bstart, blen, GFS_BLKST_FREEMETA);
-	if (!rgd)
-		return;
-
-	if (rgd->rd_rg.rg_usedmeta < blen)
-		gfs_consist_rgrpd(rgd);
-	rgd->rd_rg.rg_usedmeta -= blen;
-	rgd->rd_rg.rg_freemeta += blen;
-
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-	gfs_rgrp_out(&rgd->rd_rg, rgd->rd_bh[0]->b_data);
-
-	/* total=0, free=blen, dinode=0 */
-	gfs_statfs_modify(sdp, 0, blen, 0);
-
-	gfs_trans_add_quota(sdp, -(int64_t)blen,
-			    ip->i_di.di_uid,
-			    ip->i_di.di_gid);
-	gfs_wipe_buffers(ip, rgd, bstart, blen);
-}
-
-/**
- * gfs_difree_uninit - free a dinode block
- * @rgd: the resource group that contains the dinode
- * @addr: the dinode address
- *
- * De-allocate the dinode to FREEMETA using block alloc bitmap.
- * Update rgrp's block usage statistics (used dinode--, free meta++).
- * Add rgrp header to transaction.
- */
-
-void
-gfs_difree_uninit(struct gfs_rgrpd *rgd, uint64_t addr)
-{
-	struct gfs_rgrpd *tmp_rgd;
-
-	tmp_rgd = blkfree_internal(rgd->rd_sbd, addr, 1,
-				   GFS_BLKST_FREEMETA);
-	if (!tmp_rgd)
-		return;
-	gfs_assert_withdraw(rgd->rd_sbd, rgd == tmp_rgd);
-
-	if (!rgd->rd_rg.rg_useddi)
-		gfs_consist_rgrpd(rgd);
-	rgd->rd_rg.rg_useddi--;
-	rgd->rd_rg.rg_freemeta++;
-
-	gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-	gfs_rgrp_out(&rgd->rd_rg, rgd->rd_bh[0]->b_data);
-
-	/* total=0, free=1, dinodes=-1 */
-	gfs_statfs_modify(rgd->rd_sbd, 0, +1, -1);
-}
-
-/**
- * gfs_difree - free a dinode block
- * @rgd: the resource group that contains the dinode
- * @ip: the inode representing the dinode to free
- *
- * Free the dinode block to FREEMETA, update rgrp's block usage stats.
- * Update quotas (quotas include metadata, not just data block usage),
- *    add to trans.
- * Release deallocated buffers, add to meta-header cache (we save these in-core
- *    so we don't need to re-read meta blocks if/when they are re-alloc'd).
- */
-
-void
-gfs_difree(struct gfs_rgrpd *rgd, struct gfs_inode *ip)
-{
-	gfs_difree_uninit(rgd, ip->i_num.no_addr);
-	gfs_trans_add_quota(ip->i_sbd, -1, ip->i_di.di_uid, ip->i_di.di_gid);
-	gfs_wipe_buffers(ip, rgd, ip->i_num.no_addr, 1);
-}
-
-/**
- * gfs_rlist_add - add a RG to a list of RGs
- * @sdp: the filesystem
- * @rlist: the list of resource groups
- * @block: the block
- *
- * Figure out what RG a block belongs to and add that RG to the list
- *
- * FIXME: Don't use gmalloc()
- *
- */
-
-void
-gfs_rlist_add(struct gfs_sbd *sdp, struct gfs_rgrp_list *rlist, uint64_t block)
-{
-	struct gfs_rgrpd *rgd;
-	struct gfs_rgrpd **tmp;
-	unsigned int new_space;
-	unsigned int x;
-
-	if (gfs_assert_warn(sdp, !rlist->rl_ghs))
-		return;
-
-	rgd = gfs_blk2rgrpd(sdp, block);
-	if (!rgd) {
-		if (gfs_consist(sdp))
-			printk("GFS: fsid=%s: block = %llu\n",
-			       sdp->sd_fsname, block);
-		return;
-	}
-
-	for (x = 0; x < rlist->rl_rgrps; x++)
-		if (rlist->rl_rgd[x] == rgd)
-			return;
-
-	if (rlist->rl_rgrps == rlist->rl_space) {
-		new_space = rlist->rl_space + 10;
-
-		tmp = gmalloc(new_space * sizeof(struct gfs_rgrpd *));
-
-		if (rlist->rl_rgd) {
-			memcpy(tmp, rlist->rl_rgd,
-			       rlist->rl_space * sizeof(struct gfs_rgrpd *));
-			kfree(rlist->rl_rgd);
-		}
-
-		rlist->rl_space = new_space;
-		rlist->rl_rgd = tmp;
-	}
-
-	rlist->rl_rgd[rlist->rl_rgrps++] = rgd;
-}
-
-/**
- * gfs_rlist_alloc - all RGs have been added to the rlist, now allocate
- *      and initialize an array of glock holders for them
- * @rlist: the list of resource groups
- * @state: the lock state to acquire the RG lock in
- * @flags: the modifier flags for the holder structures
- *
- * FIXME: Don't use gmalloc()
- *
- */
-
-void
-gfs_rlist_alloc(struct gfs_rgrp_list *rlist, unsigned int state, int flags)
-{
-	unsigned int x;
-
-	rlist->rl_ghs = gmalloc(rlist->rl_rgrps * sizeof(struct gfs_holder));
-	for (x = 0; x < rlist->rl_rgrps; x++)
-		gfs_holder_init(rlist->rl_rgd[x]->rd_gl,
-				state, flags,
-				&rlist->rl_ghs[x]);
-}
-
-/**
- * gfs_rlist_free - free a resource group list
- * @list: the list of resource groups
- *
- */
-
-void
-gfs_rlist_free(struct gfs_rgrp_list *rlist)
-{
-	unsigned int x;
-
-	if (rlist->rl_rgd)
-		kfree(rlist->rl_rgd);
-
-	if (rlist->rl_ghs) {
-		for (x = 0; x < rlist->rl_rgrps; x++)
-			gfs_holder_uninit(&rlist->rl_ghs[x]);
-		kfree(rlist->rl_ghs);
-	}
-}
-
-/**
- * gfs_reclaim_metadata - reclaims unused metadata
- * @sdp: the file system
- * @inodes:
- * @metadata:
- *
- * This function will look through the resource groups and
- * free the unused metadata.
- *
- * Returns: errno
- */
-
-int
-gfs_reclaim_metadata(struct gfs_sbd *sdp, 
-		     uint64_t *inodes,
-		     uint64_t *metadata)
-{
-	struct gfs_holder ji_gh, ri_gh, rgd_gh, t_gh;
-	struct gfs_rgrpd *rgd;
-	struct gfs_rgrp *rg;
-	struct gfs_dinode *di;
-	struct gfs_inum next;
-	struct buffer_head *bh;
-	uint32_t flags;
-	uint32_t goal;
-	unsigned int x;
-	int error = 0;
-
-	*inodes = *metadata = 0;
-
-	/* Acquire the jindex lock here so we don't deadlock with a
-	   process writing the the jindex inode. :-( */
-
-	error = gfs_jindex_hold(sdp, &ji_gh);
-	if (error)
-		goto fail;
-
-	error = gfs_rindex_hold(sdp, &ri_gh);
-	if (error)
-		goto fail_jindex_relse;
-
-	for (rgd = gfs_rgrpd_get_first(sdp);
-	     rgd;
-	     rgd = gfs_rgrpd_get_next(rgd)) {
-		error = gfs_glock_nq_init(rgd->rd_gl,
-					  LM_ST_EXCLUSIVE, GL_NOCACHE,
-					  &rgd_gh);
-		if (error)
-			goto fail_rindex_relse;
-
-		rgrp_verify(rgd);
-
-		rg = &rgd->rd_rg;
-
-		if (!rg->rg_freedi && !rg->rg_freemeta) {
-			gfs_glock_dq_uninit(&rgd_gh);
-			continue;
-		}
-
-		gfs_mhc_zap(rgd);
-		gfs_depend_sync(rgd);
-
-		error = gfs_lock_fs_check_clean(sdp, LM_ST_EXCLUSIVE, &t_gh);
-		if (error)
-			goto fail_gunlock_rg;
-
-		error = gfs_trans_begin(sdp, rgd->rd_ri.ri_length, 0);
-		if (error)
-			goto fail_unlock_fs;
-
-		next = rg->rg_freedi_list;
-
-		for (x = rg->rg_freedi; x--;) {
-			if (!next.no_formal_ino || !next.no_addr) {
-				gfs_consist_rgrpd(rgd);
-				error = -EIO;
-				goto fail_end_trans;
-			}
-
-			blkfree_internal(sdp, next.no_addr, 1, GFS_BLKST_FREE);
-
-			error = gfs_dread(rgd->rd_gl, next.no_addr,
-					  DIO_FORCE | DIO_START | DIO_WAIT, &bh);
-			if (error)
-				goto fail_end_trans;
-
-			di = (struct gfs_dinode *)bh->b_data;
-			flags = di->di_flags;
-			flags = gfs32_to_cpu(flags);
-			if (!(flags & GFS_DIF_UNUSED)) {
-				gfs_consist_rgrpd(rgd);
-				brelse(bh);
-				error = -EIO;
-				goto fail_end_trans;
-			}
-
-			gfs_inum_in(&next, (char *)&di->di_next_unused);
-
-			brelse(bh);
-
-			rg->rg_freedi--;
-			rg->rg_free++;
-			(*inodes)++;
-		}
-
-		if (next.no_formal_ino || next.no_addr) {
-			gfs_consist_rgrpd(rgd);
-			error = -EIO;
-			goto fail_end_trans;
-		}
-		rg->rg_freedi_list = next;
-
-		goal = 0;
-		for (x = rg->rg_freemeta; x--;) {
-			goal = blkalloc_internal(rgd, goal,
-						 GFS_BLKST_FREEMETA, GFS_BLKST_FREE);
-			rg->rg_freemeta--;
-			rg->rg_free++;
-			(*metadata)++;
-		}
-
-		gfs_trans_add_bh(rgd->rd_gl, rgd->rd_bh[0]);
-		gfs_rgrp_out(rg, rgd->rd_bh[0]->b_data);
-
-		gfs_trans_end(sdp);
-
-		gfs_glock_dq_uninit(&t_gh);
-
-		gfs_glock_dq_uninit(&rgd_gh);
-	}
-
-	gfs_glock_dq_uninit(&ri_gh);
-
-	gfs_glock_dq_uninit(&ji_gh);
-
-	return 0;
-
- fail_end_trans:
-	gfs_trans_end(sdp);
-
- fail_unlock_fs:
-	gfs_glock_dq_uninit(&t_gh);
-
- fail_gunlock_rg:
-	gfs_glock_dq_uninit(&rgd_gh);
-
- fail_rindex_relse:
-	gfs_glock_dq_uninit(&ri_gh);
-
- fail_jindex_relse:
-	gfs_glock_dq_uninit(&ji_gh);
-
- fail:
-	return error;
-}
diff --git a/gfs-kernel/src/gfs/rgrp.h b/gfs-kernel/src/gfs/rgrp.h
deleted file mode 100644
index 0f5c620..0000000
--- a/gfs-kernel/src/gfs/rgrp.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef __RGRP_DOT_H__
-#define __RGRP_DOT_H__
-
-void gfs_mhc_add(struct gfs_rgrpd *rgd, struct buffer_head **bh,
-			 unsigned int num);
-int gfs_mhc_fish(struct gfs_sbd *sdp, struct buffer_head *bh);
-void gfs_mhc_zap(struct gfs_rgrpd *rgd);
-
-void gfs_depend_add(struct gfs_rgrpd *rgd, uint64_t formal_ino);
-void gfs_depend_sync(struct gfs_rgrpd *rgd);
-
-struct gfs_rgrpd *gfs_blk2rgrpd(struct gfs_sbd *sdp, uint64_t blk);
-struct gfs_rgrpd *gfs_rgrpd_get_first(struct gfs_sbd *sdp);
-struct gfs_rgrpd *gfs_rgrpd_get_next(struct gfs_rgrpd *rgd);
-
-void gfs_clear_rgrpd(struct gfs_sbd *sdp);
-
-int gfs_rindex_hold(struct gfs_sbd *sdp, struct gfs_holder *ri_gh);
-
-int gfs_rgrp_read(struct gfs_rgrpd *rgd);
-void gfs_rgrp_relse(struct gfs_rgrpd *rgd);
-
-void gfs_rgrp_lvb_fill(struct gfs_rgrpd *rgd);
-int gfs_rgrp_lvb_init(struct gfs_rgrpd *rgd);
-
-struct gfs_alloc *gfs_alloc_get(struct gfs_inode *ip);
-void gfs_alloc_put(struct gfs_inode *ip);
-
-int gfs_inplace_reserve_i(struct gfs_inode *ip,
-			 char *file, unsigned int line);
-#define gfs_inplace_reserve(ip) \
-gfs_inplace_reserve_i((ip), __FILE__, __LINE__)
-
-void gfs_inplace_release(struct gfs_inode *ip);
-
-unsigned char gfs_get_block_type(struct gfs_rgrpd *rgd, uint64_t block);
-
-void gfs_blkalloc(struct gfs_inode *ip, uint64_t *block);
-int gfs_metaalloc(struct gfs_inode *ip, uint64_t *block);
-int gfs_dialloc(struct gfs_inode *dip, uint64_t *block);
-
-void gfs_blkfree(struct gfs_inode *ip, uint64_t bstart, uint32_t blen);
-void gfs_metafree(struct gfs_inode *ip, uint64_t bstart, uint32_t blen);
-void gfs_difree_uninit(struct gfs_rgrpd *rgd, uint64_t addr);
-void gfs_difree(struct gfs_rgrpd *rgd, struct gfs_inode *ip);
-
-extern void gfs_statfs_modify(struct gfs_sbd *sdp,
-                                int64_t total,
-                                int64_t free,
-                                int64_t dinodes);
-
-/*
- * gfs_rgrp_list
- *
- * Used to collect a list of all resource groups spanned by a given
- *   inode/file/directory
- */
-struct gfs_rgrp_list {
-	unsigned int rl_rgrps;      /* # (qty) of rgrps in list (array) */
-	unsigned int rl_space;      /* Current capacity in list for rgrps */
-	struct gfs_rgrpd **rl_rgd;  /* Array of ptrs to rgrp descriptors */
-	struct gfs_holder *rl_ghs;  /* Array of glock holders for rgrps */
-};
-
-void gfs_rlist_add(struct gfs_sbd *sdp, struct gfs_rgrp_list *rlist,
-		   uint64_t block);
-void gfs_rlist_alloc(struct gfs_rgrp_list *rlist, unsigned int state,
-		     int flags);
-void gfs_rlist_free(struct gfs_rgrp_list *rlist);
-
-int gfs_reclaim_metadata(struct gfs_sbd *sdp,
-			 uint64_t *inodes,
-			 uint64_t *metadata);
-
-#endif /* __RGRP_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/super.c b/gfs-kernel/src/gfs/super.c
deleted file mode 100644
index 781350e..0000000
--- a/gfs-kernel/src/gfs/super.c
+++ /dev/null
@@ -1,1274 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/vmalloc.h>
-#include <linux/statfs.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "file.h"
-#include "format.h"
-#include "glock.h"
-#include "glops.h"
-#include "inode.h"
-#include "log.h"
-#include "quota.h"
-#include "recovery.h"
-#include "rgrp.h"
-#include "super.h"
-#include "unlinked.h"
-#include "trans.h"
-
-/**
- * gfs_tune_init - Fill a gfs_tune structure with default values
- * @gt: tune
- *
- */
-
-void
-gfs_tune_init(struct gfs_tune *gt)
-{
-	spin_lock_init(&gt->gt_spin);
-
-	gt->gt_ilimit1 = 100;
-	gt->gt_ilimit1_tries = 3;
-	gt->gt_ilimit1_min = 1;
-	gt->gt_ilimit2 = 500;
-	gt->gt_ilimit2_tries = 10;
-	gt->gt_ilimit2_min = 3;
-	gt->gt_demote_secs = 300;
-	gt->gt_incore_log_blocks = 1024;
-	gt->gt_jindex_refresh_secs = 60;
-	gt->gt_depend_secs = 60;
-	gt->gt_scand_secs = 5;
-	gt->gt_recoverd_secs = 60;
-	gt->gt_logd_secs = 1;
-	gt->gt_quotad_secs = 5;
-	gt->gt_inoded_secs = 15;
-	gt->gt_glock_purge = 0;
-	gt->gt_quota_simul_sync = 64;
-	gt->gt_quota_warn_period = 10;
-	gt->gt_atime_quantum = 3600;
-	gt->gt_quota_quantum = 60;
-	gt->gt_quota_scale_num = 1;
-	gt->gt_quota_scale_den = 1;
-	gt->gt_quota_enforce = 1;
-	gt->gt_quota_account = 1;
-	gt->gt_new_files_jdata = 0;
-	gt->gt_new_files_directio = 0;
-	gt->gt_max_atomic_write = 4 << 20;
-	gt->gt_max_readahead = 1 << 18;
-	gt->gt_lockdump_size = 131072;
-	gt->gt_stall_secs = 600;
-	gt->gt_complain_secs = 10;
-	gt->gt_reclaim_limit = 5000;
-	gt->gt_entries_per_readdir = 32;
-	gt->gt_prefetch_secs = 10;
-	gt->gt_statfs_slots = 64;
-	gt->gt_max_mhc = 10000;
-	gt->gt_greedy_default = HZ / 10;
-	gt->gt_greedy_quantum = HZ / 40;
-	gt->gt_greedy_max = HZ / 4;
-	gt->gt_rgrp_try_threshold = 100;
-	gt->gt_statfs_fast = 0;
-}
-
-/**
- * gfs_check_sb - Check superblock
- * @sdp: the filesystem
- * @sb: The superblock
- * @silent: Don't print a message if the check fails
- *
- * Checks the version code of the FS is one that we understand how to
- * read and that the sizes of the various on-disk structures have not
- * changed.
- */
-
-int
-gfs_check_sb(struct gfs_sbd *sdp, struct gfs_sb *sb, int silent)
-{
-	unsigned int x;
-
-	if (sb->sb_header.mh_magic != GFS_MAGIC ||
-	    sb->sb_header.mh_type != GFS_METATYPE_SB) {
-		if (!silent)
-			printk("GFS: not a GFS filesystem\n");
-		return -EINVAL;
-	}
-
-	/*  If format numbers match exactly, we're done.  */
-
-	if (sb->sb_fs_format == GFS_FORMAT_FS &&
-	    sb->sb_multihost_format == GFS_FORMAT_MULTI)
-		return 0;
-
-	if (sb->sb_fs_format != GFS_FORMAT_FS) {
-		for (x = 0; gfs_old_fs_formats[x]; x++)
-			if (gfs_old_fs_formats[x] == sb->sb_fs_format)
-				break;
-
-		if (!gfs_old_fs_formats[x]) {
-			printk("GFS: code version (%u, %u) is incompatible with ondisk format (%u, %u)\n",
-			       GFS_FORMAT_FS, GFS_FORMAT_MULTI,
-			       sb->sb_fs_format, sb->sb_multihost_format);
-			printk("GFS: I don't know how to upgrade this FS\n");
-			return -EINVAL;
-		}
-	}
-
-	if (sb->sb_multihost_format != GFS_FORMAT_MULTI) {
-		for (x = 0; gfs_old_multihost_formats[x]; x++)
-			if (gfs_old_multihost_formats[x] == sb->sb_multihost_format)
-				break;
-
-		if (!gfs_old_multihost_formats[x]) {
-			printk("GFS: code version (%u, %u) is incompatible with ondisk format (%u, %u)\n",
-			     GFS_FORMAT_FS, GFS_FORMAT_MULTI,
-			       sb->sb_fs_format, sb->sb_multihost_format);
-			printk("GFS: I don't know how to upgrade this FS\n");
-			return -EINVAL;
-		}
-	}
-
-	if (!sdp->sd_args.ar_upgrade) {
-		printk("GFS: code version (%u, %u) is incompatible with ondisk format (%u, %u)\n",
-		       GFS_FORMAT_FS, GFS_FORMAT_MULTI,
-		       sb->sb_fs_format, sb->sb_multihost_format);
-		printk("GFS: Use the \"upgrade\" mount option to upgrade the FS\n");
-		printk("GFS: See the manual for more details\n");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * gfs_read_sb - Read super block
- * @sdp: The GFS superblock
- * @gl: the glock for the superblock (assumed to be held)
- * @silent: Don't print message if mount fails
- *
- */
-
-int
-gfs_read_sb(struct gfs_sbd *sdp, struct gfs_glock *gl, int silent)
-{
-	struct buffer_head *bh;
-	uint32_t hash_blocks, ind_blocks, leaf_blocks;
-	uint32_t tmp_blocks;
-	unsigned int x;
-	int error;
-
-	error = gfs_dread(gl, GFS_SB_ADDR >> sdp->sd_fsb2bb_shift,
-			  DIO_FORCE | DIO_START | DIO_WAIT, &bh);
-	if (error) {
-		if (!silent)
-			printk("GFS: fsid=%s: can't read superblock\n",
-			       sdp->sd_fsname);
-		return error;
-	}
-
-	gfs_assert(sdp, sizeof(struct gfs_sb) <= bh->b_size,);
-	gfs_sb_in(&sdp->sd_sb, bh->b_data);
-	brelse(bh);
-
-	error = gfs_check_sb(sdp, &sdp->sd_sb, silent);
-	if (error)
-		return error;
-
-	sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift -
-		GFS_BASIC_BLOCK_SHIFT;
-	sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
-	sdp->sd_diptrs = (sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode)) /
-		sizeof(uint64_t);
-	sdp->sd_inptrs = (sdp->sd_sb.sb_bsize - sizeof(struct gfs_indirect)) /
-		sizeof(uint64_t);
-	sdp->sd_jbsize = sdp->sd_sb.sb_bsize - sizeof(struct gfs_meta_header);
-	sdp->sd_hash_bsize = sdp->sd_sb.sb_bsize / 2;
-	sdp->sd_hash_bsize_shift = sdp->sd_sb.sb_bsize_shift - 1;
-	sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(uint64_t);
-
-	/*  Compute maximum reservation required to add a entry to a directory  */
-
-	hash_blocks = DIV_RU(sizeof(uint64_t) * (1 << GFS_DIR_MAX_DEPTH),
-			     sdp->sd_jbsize);
-
-	ind_blocks = 0;
-	for (tmp_blocks = hash_blocks; tmp_blocks > sdp->sd_diptrs;) {
-		tmp_blocks = DIV_RU(tmp_blocks, sdp->sd_inptrs);
-		ind_blocks += tmp_blocks;
-	}
-
-	leaf_blocks = 2 + GFS_DIR_MAX_DEPTH;
-
-	sdp->sd_max_dirres = hash_blocks + ind_blocks + leaf_blocks;
-
-	sdp->sd_heightsize[0] = sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode);
-	sdp->sd_heightsize[1] = sdp->sd_sb.sb_bsize * sdp->sd_diptrs;
-	for (x = 2;; x++) {
-		uint64_t space, d;
-		uint32_t m;
-
-		space = sdp->sd_heightsize[x - 1] * sdp->sd_inptrs;
-		d = space;
-		m = do_div(d, sdp->sd_inptrs);
-
-		if (d != sdp->sd_heightsize[x - 1] || m)
-			break;
-		sdp->sd_heightsize[x] = space;
-	}
-	sdp->sd_max_height = x;
-	gfs_assert(sdp, sdp->sd_max_height <= GFS_MAX_META_HEIGHT,);
-
-	sdp->sd_jheightsize[0] = sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode);
-	sdp->sd_jheightsize[1] = sdp->sd_jbsize * sdp->sd_diptrs;
-	for (x = 2;; x++) {
-		uint64_t space, d;
-		uint32_t m;
-
-		space = sdp->sd_jheightsize[x - 1] * sdp->sd_inptrs;
-		d = space;
-		m = do_div(d, sdp->sd_inptrs);
-
-		if (d != sdp->sd_jheightsize[x - 1] || m)
-			break;
-		sdp->sd_jheightsize[x] = space;
-	}
-	sdp->sd_max_jheight = x;
-	gfs_assert(sdp, sdp->sd_max_jheight <= GFS_MAX_META_HEIGHT,);
-
-	return 0;
-}
-
-/**
- * gfs_do_upgrade - upgrade a filesystem
- * @sdp: The GFS superblock
- *
- */
-
-int
-gfs_do_upgrade(struct gfs_sbd *sdp, struct gfs_glock *sb_gl)
-{
-	struct gfs_holder ji_gh, t_gh, j_gh;
-	struct gfs_log_header lh;
-	struct buffer_head *bh;
-	unsigned int x;
-	int error;
-
-	/*  If format numbers match exactly, we're done.  */
-
-	if (sdp->sd_sb.sb_fs_format == GFS_FORMAT_FS &&
-	    sdp->sd_sb.sb_multihost_format == GFS_FORMAT_MULTI) {
-		printk("GFS: fsid=%s: no upgrade necessary\n",
-		       sdp->sd_fsname);
-		sdp->sd_args.ar_upgrade = FALSE;
-		return 0;
-	}
-
-	error = gfs_jindex_hold(sdp, &ji_gh);
-	if (error)
-		goto fail;
-
-	error = gfs_glock_nq_init(sdp->sd_trans_gl,
-				  LM_ST_EXCLUSIVE, GL_NOCACHE,
-				  &t_gh);
-	if (error)
-		goto fail_ji_relse;
-
-	if (test_bit(SDF_ROFS, &sdp->sd_flags)) {
-		printk("GFS: fsid=%s: can't upgrade: read-only FS\n",
-		       sdp->sd_fsname);
-		error = -EROFS;
-		goto fail_gunlock_tr;
-	}
-
-	for (x = 0; x < sdp->sd_journals; x++) {
-		error = gfs_glock_nq_num(sdp,
-					 sdp->sd_jindex[x].ji_addr,
-					 &gfs_meta_glops, LM_ST_SHARED,
-					 LM_FLAG_TRY | GL_NOCACHE, &j_gh);
-		switch (error) {
-		case 0:
-			break;
-
-		case GLR_TRYFAILED:
-			printk("GFS: fsid=%s: journal %u is busy\n",
-			       sdp->sd_fsname, x);
-			error = -EBUSY;
-
-		default:
-			goto fail_gunlock_tr;
-		}
-
-		error = gfs_find_jhead(sdp, &sdp->sd_jindex[x],
-				       j_gh.gh_gl, &lh);
-
-		gfs_glock_dq_uninit(&j_gh);
-
-		if (error)
-			goto fail_gunlock_tr;
-
-		if (!(lh.lh_flags & GFS_LOG_HEAD_UNMOUNT) || lh.lh_last_dump) {
-			printk("GFS: fsid=%s: journal %u is busy\n",
-			       sdp->sd_fsname, x);
-			error = -EBUSY;
-			goto fail_gunlock_tr;
-		}
-	}
-
-	/* We don't need to journal this change because we're changing
-	   only one sector of one block.  We definitely don't want to have
-	   the journaling code running at this point. */
-
-	error = gfs_dread(sb_gl, GFS_SB_ADDR >> sdp->sd_fsb2bb_shift,
-			  DIO_START | DIO_WAIT, &bh);
-	if (error)
-		goto fail_gunlock_tr;
-
-	gfs_sb_in(&sdp->sd_sb, bh->b_data);
-
-	error = gfs_check_sb(sdp, &sdp->sd_sb, FALSE);
-	if (error) {
-		gfs_consist(sdp);
-		brelse(bh);
-		goto fail_gunlock_tr;
-	}
-
-	sdp->sd_sb.sb_fs_format = GFS_FORMAT_FS;
-	sdp->sd_sb.sb_multihost_format = GFS_FORMAT_MULTI;
-
-	gfs_sb_out(&sdp->sd_sb, bh->b_data);
-
-	set_bit(GLF_DIRTY, &sb_gl->gl_flags);
-	error = gfs_dwrite(sdp, bh, DIO_DIRTY | DIO_START | DIO_WAIT);
-
-	brelse(bh);
-
-	gfs_glock_dq_uninit(&t_gh);
-
-	gfs_glock_dq_uninit(&ji_gh);
-
-	if (!error) {
-		printk("GFS: fsid=%s: upgrade successful\n",
-		       sdp->sd_fsname);
-		sdp->sd_args.ar_upgrade = FALSE;
-	}
-
-	return error;
-
- fail_gunlock_tr:
-	gfs_glock_dq_uninit(&t_gh);
-
- fail_ji_relse:
-	gfs_glock_dq_uninit(&ji_gh);
-
- fail:
-	if (error == -EBUSY)
-		printk("GFS: fsid=%s: can't upgrade: the FS is still busy or contains dirty journals\n",
-		       sdp->sd_fsname);
-	else
-		printk("GFS: fsid=%s: can't upgrade: %d\n",
-		       sdp->sd_fsname, error);
-
-	return error;
-}
-
-/**
- * clear_journalsi - Clear all the journal index information (without locking)
- * @sdp: The GFS superblock
- *
- */
-
-static void
-clear_journalsi(struct gfs_sbd *sdp)
-{
-	if (sdp->sd_jindex) {
-		kfree(sdp->sd_jindex);
-		sdp->sd_jindex = NULL;
-	}
-	sdp->sd_journals = 0;
-}
-
-/**
- * gfs_clear_journals - Clear all the journal index information
- * @sdp: The GFS superblock
- *
- */
-
-void
-gfs_clear_journals(struct gfs_sbd *sdp)
-{
-	down(&sdp->sd_jindex_lock);
-	clear_journalsi(sdp);
-	up(&sdp->sd_jindex_lock);
-}
-
-/**
- * gfs_ji_update - Update the journal index information
- * @ip: The journal index inode
- *
- * Returns: errno
- */
-
-static int
-gfs_ji_update(struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	char buf[sizeof(struct gfs_jindex)];
-	unsigned int j;
-	int error;
-
-	if (do_mod(ip->i_di.di_size, sizeof(struct gfs_jindex))) {
-		gfs_consist_inode(ip);
-		return -EIO;
-	}
-
-	clear_journalsi(sdp);
-
-	sdp->sd_jindex = kmalloc(ip->i_di.di_size, GFP_KERNEL);
-	if (!sdp->sd_jindex)
-		return -ENOMEM;
-	memset(sdp->sd_jindex, 0, ip->i_di.di_size);
-
-	for (j = 0;; j++) {
-		error = gfs_internal_read(ip, buf,
-					  j * sizeof(struct gfs_jindex),
-					  sizeof(struct gfs_jindex));
-		if (!error)
-			break;
-		if (error != sizeof(struct gfs_jindex)) {
-			if (error > 0)
-				error = -EIO;
-			goto fail;
-		}
-
-		gfs_jindex_in(sdp->sd_jindex + j, buf);
-	}
-
-	sdp->sd_journals = j;
-	sdp->sd_jiinode_vn = ip->i_gl->gl_vn;
-
-	return 0;
-
- fail:
-	clear_journalsi(sdp);
-	return error;
-}
-
-/**
- * gfs_jindex_hold - Grab a lock on the jindex
- * @sdp: The GFS superblock
- * @ji_gh: the holder for the jindex glock
- *
- * This makes sure that we're using the latest copy of the journal index
- *   special file (this describes all of the journals for this filesystem),
- *   which might have been updated if someone added journals
- *   (via gfs_jadd utility).
- *
- * This is very similar to the gfs_rindex_hold() function, except that
- * in general we hold the jindex lock for longer periods of time and
- * we grab it far less frequently (in general) then the rgrp lock.
- *
- * Returns: errno
- */
-
-int
-gfs_jindex_hold(struct gfs_sbd *sdp, struct gfs_holder *ji_gh)
-{
-	struct gfs_inode *ip = sdp->sd_jiinode;
-	struct gfs_glock *gl = ip->i_gl;
-	int error;
-
-	error = gfs_glock_nq_init(gl, LM_ST_SHARED, 0, ji_gh);
-	if (error)
-		return error;
-
-	/* Read new copy from disk if we don't have the latest */
-	if (sdp->sd_jiinode_vn != gl->gl_vn) {
-		down(&sdp->sd_jindex_lock);
-		if (sdp->sd_jiinode_vn != gl->gl_vn)
-			error = gfs_ji_update(ip);
-		up(&sdp->sd_jindex_lock);
-	}
-
-	if (error)
-		gfs_glock_dq_uninit(ji_gh);
-
-	return error;
-}
-
-/**
- * gfs_get_jiinode - Read-in the special (hidden) journal index inode
- * @sdp: The GFS superblock
- *
- * Returns: errno
- *
- * This reads-in just the dinode, not the special file contents that describe
- *   the journals themselves (see gfs_jindex_hold()).
- */
-
-int
-gfs_get_jiinode(struct gfs_sbd *sdp)
-{
-	struct gfs_holder ji_gh;
-	int error;
-
-	error = gfs_glock_nq_num(sdp,
-				 sdp->sd_sb.sb_jindex_di.no_formal_ino,
-				 &gfs_inode_glops,
-				 LM_ST_SHARED, GL_LOCAL_EXCL,
-				 &ji_gh);
-	if (error)
-		return error;
-
-	error = gfs_inode_get(ji_gh.gh_gl, &sdp->sd_sb.sb_jindex_di,
-			      CREATE, &sdp->sd_jiinode);
-	if (!error) {
-		sdp->sd_jiinode_vn = ji_gh.gh_gl->gl_vn - 1;
-		set_bit(GLF_STICKY, &ji_gh.gh_gl->gl_flags);
-	}
-
-	gfs_glock_dq_uninit(&ji_gh);
-
-	return error;
-}
-
-/**
- * gfs_get_riinode - Read in the special (hidden) resource group index inode
- * @sdp: The GFS superblock
- *
- * Returns: errno
- *
- * This reads-in just the dinode, not the special file contents that describe
- *   the resource groups themselves (see gfs_rindex_hold()).
- */
-
-int
-gfs_get_riinode(struct gfs_sbd *sdp)
-{
-	struct gfs_holder ri_gh;
-	int error;
-
-	error = gfs_glock_nq_num(sdp,
-				 sdp->sd_sb.sb_rindex_di.no_formal_ino,
-				 &gfs_inode_glops,
-				 LM_ST_SHARED, GL_LOCAL_EXCL,
-				 &ri_gh);
-	if (error)
-		return error;
-
-	error = gfs_inode_get(ri_gh.gh_gl, &sdp->sd_sb.sb_rindex_di,
-			      CREATE, &sdp->sd_riinode);
-	if (!error) {
-		sdp->sd_riinode_vn = ri_gh.gh_gl->gl_vn - 1;
-		set_bit(GLF_STICKY, &ri_gh.gh_gl->gl_flags);
-	}
-
-	gfs_glock_dq_uninit(&ri_gh);
-
-	return error;
-}
-
-/**
- * gfs_get_rootinode - Read in the filesystem's root inode
- * @sdp: The GFS superblock
- *
- * Returns: errno
- */
-
-int
-gfs_get_rootinode(struct gfs_sbd *sdp)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	error = gfs_glock_nq_num(sdp,
-				 sdp->sd_sb.sb_root_di.no_formal_ino,
-				 &gfs_inode_glops,
-				 LM_ST_SHARED, GL_LOCAL_EXCL,
-				 &i_gh);
-	if (error)
-		return error;
-
-	error = gfs_inode_get(i_gh.gh_gl, &sdp->sd_sb.sb_root_di,
-			      CREATE, &sdp->sd_rooti);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_get_qinode - Read in the special (hidden) quota inode
- * @sdp: The GFS superblock
- *
- * If one is not on-disk already, create a new one.
- * Does not read in file contents, just the dinode.
- *
- * Returns: errno
- */
-
-int
-gfs_get_qinode(struct gfs_sbd *sdp)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	/* Create, if not on-disk already */
-	if (!sdp->sd_sb.sb_quota_di.no_formal_ino) {
-		error = gfs_alloc_qinode(sdp);
-		if (error)
-			return error;
-	}
-
-	error = gfs_glock_nq_num(sdp,
-				 sdp->sd_sb.sb_quota_di.no_formal_ino,
-				 &gfs_inode_glops,
-				 LM_ST_SHARED, GL_LOCAL_EXCL,
-				 &i_gh);
-	if (error)
-		return error;
-
-	error = gfs_inode_get(i_gh.gh_gl, &sdp->sd_sb.sb_quota_di,
-			      CREATE, &sdp->sd_qinode);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_get_linode - Read in the special (hidden) license inode
- * @sdp: The GFS superblock
- *
- * If one is not on-disk already, create a new one.
- * Does not read in file contents, just the dinode.
- *
- * Returns: errno
- */
-
-int
-gfs_get_linode(struct gfs_sbd *sdp)
-{
-	struct gfs_holder i_gh;
-	int error;
-
-	/* Create, if not on-disk already */
-	if (!sdp->sd_sb.sb_license_di.no_formal_ino) {
-		error = gfs_alloc_linode(sdp);
-		if (error)
-			return error;
-	}
-
-	error = gfs_glock_nq_num(sdp,
-				 sdp->sd_sb.sb_license_di.no_formal_ino,
-				 &gfs_inode_glops,
-				 LM_ST_SHARED, GL_LOCAL_EXCL,
-				 &i_gh);
-	if (error)
-		return error;
-
-	/* iopen obtained in via  gfs_glock_get(..gfs_iopen_glops) */
-	error = gfs_inode_get(i_gh.gh_gl, &sdp->sd_sb.sb_license_di,
-			      CREATE, &sdp->sd_linode);
-
-	gfs_glock_dq_uninit(&i_gh);
-
-	return error;
-}
-
-/**
- * gfs_make_fs_rw - Turn a Read-Only FS into a Read-Write one
- * @sdp: the filesystem
- *
- * Returns: errno
- */
-
-int
-gfs_make_fs_rw(struct gfs_sbd *sdp)
-{
-	struct gfs_glock *j_gl = sdp->sd_journal_gh.gh_gl;
-	struct gfs_holder t_gh;
-	struct gfs_log_header head;
-	int error;
-
-	error = gfs_glock_nq_init(sdp->sd_trans_gl,
-				  LM_ST_SHARED,
-				  GL_LOCAL_EXCL | GL_EXACT,
-				  &t_gh);
-	if (error)
-		return error;
-
-	j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA);
-
-	error = gfs_find_jhead(sdp, &sdp->sd_jdesc, j_gl, &head);
-	if (error)
-		goto fail;
-
-	if (!(head.lh_flags & GFS_LOG_HEAD_UNMOUNT)) {
-		gfs_consist(sdp);
-		error = -EIO;
-		goto fail;
-	}
-
-	/*  Initialize some head of the log stuff  */
-	sdp->sd_sequence = head.lh_sequence;
-	sdp->sd_log_head = head.lh_first + 1;
-
-	error = gfs_recover_dump(sdp);
-	if (error)
-		goto fail;
-
-	set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
-	clear_bit(SDF_ROFS, &sdp->sd_flags);
-
-	set_bit(GLF_DIRTY, &j_gl->gl_flags);
-	gfs_log_dump(sdp, TRUE);
-
-	gfs_glock_dq_uninit(&t_gh);
-
-	return 0;
-
- fail:
-	t_gh.gh_flags |= GL_NOCACHE;
-	gfs_glock_dq_uninit(&t_gh);
-
-	return error;
-}
-
-/**
- * gfs_make_fs_ro - Turn a Read-Write FS into a Read-Only one
- * @sdp: the filesystem
- *
- * Returns: errno
- */
-
-int
-gfs_make_fs_ro(struct gfs_sbd *sdp)
-{
-	struct gfs_holder t_gh;
-	int error;
-
-	error = gfs_glock_nq_init(sdp->sd_trans_gl,
-				  LM_ST_SHARED,
-				  GL_LOCAL_EXCL | GL_EXACT | GL_NOCACHE,
-				  &t_gh);
-	if (error &&
-	    !test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-		return error;
-
-	gfs_statfs_sync(sdp);
-
-	gfs_log_flush(sdp);
-	gfs_quota_sync(sdp);
-	gfs_quota_scan(sdp);
-
-	gfs_sync_meta(sdp);
-	gfs_log_dump(sdp, TRUE);
-	gfs_log_shutdown(sdp);
-
-	set_bit(SDF_ROFS, &sdp->sd_flags);
-	clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
-
-	if (t_gh.gh_gl)
-		gfs_glock_dq_uninit(&t_gh);
-
-	gfs_unlinked_cleanup(sdp);
-	gfs_quota_cleanup(sdp);
-
-	return error;
-}
-
-/**
- * stat_gfs_fill - fill in the sg for a given RG
- * @rgd: the RG
- * @sg: the sg structure
- *
- * Returns: 0 on success, -ESTALE if the LVB is invalid
- */
-
-static int
-stat_gfs_fill(struct gfs_rgrpd *rgd, struct gfs_stat_gfs *sg)
-{
-	struct gfs_rgrp_lvb *rb = (struct gfs_rgrp_lvb *)rgd->rd_gl->gl_lvb;
-
-	if (gfs32_to_cpu(rb->rb_magic) != GFS_MAGIC)
-		return -ESTALE;
-
-	sg->sg_total_blocks += rgd->rd_ri.ri_data;
-	sg->sg_free += gfs32_to_cpu(rb->rb_free);
-	sg->sg_used_dinode += gfs32_to_cpu(rb->rb_useddi);
-	sg->sg_free_dinode += gfs32_to_cpu(rb->rb_freedi);
-	sg->sg_used_meta += gfs32_to_cpu(rb->rb_usedmeta);
-	sg->sg_free_meta += gfs32_to_cpu(rb->rb_freemeta);
-
-	return 0;
-}
-
-/**
- * stat_gfs_async - Stat a filesystem using asynchronous locking
- * @sdp: the filesystem
- * @sg: the sg info that will be returned
- * @interruptible: TRUE if we should look for signals.
- *
- * Any error (other than a signal) will cause this routine to fall back
- * to the synchronous version.
- *
- * FIXME: This really shouldn't busy wait like this.
- *
- * Returns: errno
- */
-
-static int
-stat_gfs_async(struct gfs_sbd *sdp, struct gfs_stat_gfs *sg, int interruptible)
-{
-	struct gfs_rgrpd *rgd_next = gfs_rgrpd_get_first(sdp);
-	struct gfs_holder *gha, *gh;
-	unsigned int slots = gfs_tune_get(sdp, gt_statfs_slots);
-	unsigned int x;
-	int done;
-	int error = 0, err;
-
-	memset(sg, 0, sizeof(struct gfs_stat_gfs));
-
-	gha = vmalloc(slots * sizeof(struct gfs_holder));
-	if (!gha)
-		return -ENOMEM;
-	memset(gha, 0, slots * sizeof(struct gfs_holder));
-
-	for (;;) {
-		done = TRUE;
-
-		for (x = 0; x < slots; x++) {
-			gh = gha + x;
-
-			if (gh->gh_gl && gfs_glock_poll(gh)) {
-				err = gfs_glock_wait(gh);
-				if (err) {
-					gfs_holder_uninit(gh);
-					error = err;
-				} else {
-					if (!error)
-						error = stat_gfs_fill(get_gl2rgd(gh->gh_gl), sg);
-					gfs_glock_dq_uninit(gh);
-				}
-			}
-
-			if (gh->gh_gl)
-				done = FALSE;
-			else if (rgd_next && !error) {
-				error = gfs_glock_nq_init(rgd_next->rd_gl,
-							  LM_ST_SHARED,
-							  GL_LOCAL_EXCL | GL_SKIP | GL_ASYNC,
-							  gh);
-				rgd_next = gfs_rgrpd_get_next(rgd_next);
-				done = FALSE;
-			}
-
-			if (interruptible && signal_pending(current))
-				error = -ERESTARTSYS;
-		}
-
-		if (done)
-			break;
-
-		yield();
-	}
-
-	vfree(gha);
-
-	return error;
-}
-
-/**
- * stat_gfs_sync - Stat a filesystem using synchronous locking
- * @sdp: the filesystem
- * @sg: the sg info that will be returned
- * @interruptible: TRUE if we should look for signals.
- *
- * Returns: errno
- */
-
-static int
-stat_gfs_sync(struct gfs_sbd *sdp, struct gfs_stat_gfs *sg, int interruptible)
-{
-	struct gfs_holder rgd_gh;
-	struct gfs_rgrpd *rgd;
-	int error;
-
-	memset(sg, 0, sizeof(struct gfs_stat_gfs));
-
-	for (rgd = gfs_rgrpd_get_first(sdp);
-	     rgd;
-	     rgd = gfs_rgrpd_get_next(rgd)) {
-		for (;;) {
-			error = gfs_glock_nq_init(rgd->rd_gl,
-						  LM_ST_SHARED,
-						  GL_LOCAL_EXCL | GL_SKIP,
-						  &rgd_gh);
-			if (error)
-				return error;
-
-			error = stat_gfs_fill(rgd, sg);
-			
-			gfs_glock_dq_uninit(&rgd_gh);
-
-			if (!error)
-				break;
-
-			error = gfs_rgrp_lvb_init(rgd);
-			if (error)
-				return error;
-		}
-
-		if (interruptible && signal_pending(current))
-			return -ERESTARTSYS;
-	}
-
-	return 0;
-}
-
-/**
- * gfs_stat_gfs - Do a statfs
- * @sdp: the filesystem
- * @sg: the sg structure
- * @interruptible:  Stop if there is a signal pending
- *
- * Returns: errno
- */
-
-int
-gfs_stat_gfs(struct gfs_sbd *sdp, struct gfs_stat_gfs *sg, int interruptible)
-{
-	struct gfs_holder ri_gh;
-	int error;
-
-	error = gfs_rindex_hold(sdp, &ri_gh);
-	if (error)
-		return error;
-
-	error = stat_gfs_async(sdp, sg, interruptible);
-	if (error == -ESTALE)
-		error = stat_gfs_sync(sdp, sg, interruptible);
-
-	gfs_glock_dq_uninit(&ri_gh);
-
-	return error;
-}
-
-/**
- * gfs_lock_fs_check_clean - Stop all writes to the FS and check that all journals are clean
- * @sdp: the file system
- * @state: the state to put the transaction lock into
- * @t_gh: the hold on the transaction lock
- *
- * Returns: errno
- */
-
-int
-gfs_lock_fs_check_clean(struct gfs_sbd *sdp, unsigned int state,
-			struct gfs_holder *t_gh)
-{
-	struct gfs_holder ji_gh, cl_gh;
-	struct gfs_log_header lh;
-	unsigned int x;
-	int error;
-
-	error = gfs_jindex_hold(sdp, &ji_gh);
-	if (error)
-		return error;
-
-	error = gfs_glock_nq_num(sdp,
-				 GFS_CRAP_LOCK, &gfs_meta_glops,
-				 LM_ST_SHARED, GL_NOCACHE,
-				 &cl_gh);
-	if (error)
-		goto fail;
-
-	error = gfs_glock_nq_init(sdp->sd_trans_gl, state,
-				  LM_FLAG_PRIORITY | GL_EXACT | GL_NOCACHE,
-				  t_gh);
-	if (error)
-		goto fail_gunlock_craplock;
-
-	for (x = 0; x < sdp->sd_journals; x++) {
-		error = gfs_find_jhead(sdp, &sdp->sd_jindex[x],
-				       cl_gh.gh_gl, &lh);
-		if (error)
-			goto fail_gunlock_trans;
-
-		if (!(lh.lh_flags & GFS_LOG_HEAD_UNMOUNT)) {
-			error = -EBUSY;
-			goto fail_gunlock_trans;
-		}
-	}
-
-	gfs_glock_dq_uninit(&cl_gh);
-	gfs_glock_dq_uninit(&ji_gh);
-
-	return 0;
-
- fail_gunlock_trans:
-	gfs_glock_dq_uninit(t_gh);
-
- fail_gunlock_craplock:
-	gfs_glock_dq_uninit(&cl_gh);
-
- fail:
-	gfs_glock_dq_uninit(&ji_gh);
-
-	return error;
-}
-
-/**
- * gfs_freeze_fs - freezes the file system
- * @sdp: the file system
- *
- * This function flushes data and meta data for all machines by
- * aquiring the transaction log exclusively.  All journals are
- * ensured to be in a clean state as well.
- *
- * Returns: errno
- */
-
-int
-gfs_freeze_fs(struct gfs_sbd *sdp)
-{
-	int error = 0;
-
-	down(&sdp->sd_freeze_lock);
-
-	if (!sdp->sd_freeze_count++) {
-		error = gfs_lock_fs_check_clean(sdp, LM_ST_DEFERRED,
-						&sdp->sd_freeze_gh);
-		if (error)
-			sdp->sd_freeze_count--;
-		else
-			sdp->sd_freeze_gh.gh_owner = NULL;
-	}
-
-	up(&sdp->sd_freeze_lock);
-
-	return error;
-}
-
-/**
- * gfs_unfreeze_fs - unfreezes the file system
- * @sdp: the file system
- *
- * This function allows the file system to proceed by unlocking
- * the exclusively held transaction lock.  Other GFS nodes are
- * now free to acquire the lock shared and go on with their lives.
- *
- */
-
-void
-gfs_unfreeze_fs(struct gfs_sbd *sdp)
-{
-	down(&sdp->sd_freeze_lock);
-
-	if (sdp->sd_freeze_count && !--sdp->sd_freeze_count)
-		gfs_glock_dq_uninit(&sdp->sd_freeze_gh);
-
-	up(&sdp->sd_freeze_lock);
-}
-
-/*
- * Fast statfs implementation - mostly based on GFS2 implementation.
- */
-
-void gfs_statfs_change_in(struct gfs_statfs_change_host *sc, const void *buf)
-{
-	const struct gfs_statfs_change *str = buf;
-
-	sc->sc_total = be64_to_cpu(str->sc_total);
-	sc->sc_free = be64_to_cpu(str->sc_free);
-	sc->sc_dinodes = be64_to_cpu(str->sc_dinodes);
-}
-
-void gfs_statfs_change_out(const struct gfs_statfs_change_host *sc, void *buf)
-{
-	struct gfs_statfs_change *str = buf;
-
-	str->sc_total = cpu_to_be64(sc->sc_total);
-	str->sc_free = cpu_to_be64(sc->sc_free);
-	str->sc_dinodes = cpu_to_be64(sc->sc_dinodes);
-}
-
-int gfs_statfs_start(struct gfs_sbd *sdp)
-{
-	struct gfs_stat_gfs sg;
-	struct gfs_inode *m_ip;
-	struct gfs_statfs_change_host *m_sc = &sdp->sd_statfs_master;
-	struct gfs_statfs_change_host *l_sc = &sdp->sd_statfs_local;
-	struct buffer_head *m_bh;
-	struct gfs_holder gh;
-	int error;
-
-	printk("GFS: fsid=%s: fast statfs start time = %lu\n",
-                       sdp->sd_fsname, get_seconds());
-
-	/* created via gfs_get_linode() in fill_super(). */
-	/* gfs_inode_glops */
-	m_ip = sdp->sd_linode;
-
-	/* get real statistics */ 
-	error = gfs_stat_gfs(sdp, &sg, TRUE);
-        if (error)
-                return error;
-
-	/* make sure the page is refreshed via glock flushing */
-	error = gfs_glock_nq_init(m_ip->i_gl, LM_ST_EXCLUSIVE, GL_NOCACHE, 
-					&gh);
-	if (error)
-		goto gfs_statfs_start_out;
-
-	error = gfs_get_inode_buffer(m_ip, &m_bh);
-	if (error)
-		goto gfs_statfs_start_unlock;
-
-	error = gfs_trans_begin(sdp, 1, 0);
-	if (error)
-		goto gfs_statfs_start_bh;
-
-	spin_lock(&sdp->sd_statfs_spin);
-	m_sc->sc_total = sg.sg_total_blocks;
-	m_sc->sc_free = sg.sg_free + sg.sg_free_dinode + sg.sg_free_meta;
-	m_sc->sc_dinodes = sg.sg_used_dinode;
-	memset(l_sc, 0, sizeof(struct gfs_statfs_change_host));
-	spin_unlock(&sdp->sd_statfs_spin);
-
-	gfs_trans_add_bh(m_ip->i_gl, m_bh);
-	gfs_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs_dinode));
-
-	gfs_trans_end(sdp);
-
-gfs_statfs_start_bh:
-	brelse(m_bh);
-
-gfs_statfs_start_unlock:
-	gfs_glock_dq_uninit(&gh);
-
-gfs_statfs_start_out:
-	return 0;
-}
-
-int gfs_statfs_init(struct gfs_sbd *sdp, int flag)
-{
-	int error;
-
-	/* if flag == 0, do we want to turn this off ?  */
-	if (!flag)
-		return 0;
-
-	error = gfs_statfs_start(sdp);
-	if (error) 
-		printk("GFS: fsid=%s: can't initialize statfs subsystem: %d\n",
-			sdp->sd_fsname, error);
-
-	return error;
-}
-
-void gfs_statfs_modify(struct gfs_sbd *sdp, 
-			int64_t total, 
-			int64_t free,
-			int64_t dinodes)
-{
-	struct gfs_statfs_change_host *l_sc = &sdp->sd_statfs_local;
-
-	spin_lock(&sdp->sd_statfs_spin);
-	l_sc->sc_total += total;
-	l_sc->sc_free += free;
-	l_sc->sc_dinodes += dinodes;
-	spin_unlock(&sdp->sd_statfs_spin);
-}
-
-int gfs_statfs_sync(struct gfs_sbd *sdp)
-{
-	struct gfs_inode *m_ip = sdp->sd_linode;
-	struct gfs_statfs_change_host *m_sc = &sdp->sd_statfs_master;
-	struct gfs_statfs_change_host *l_sc = &sdp->sd_statfs_local;
-	struct gfs_holder gh;
-	struct buffer_head *m_bh;
-	int error;
-
-	error = gfs_glock_nq_init(m_ip->i_gl, LM_ST_EXCLUSIVE, GL_NOCACHE,
-				&gh);
-	if (error)
-		return error;
-
-	error = gfs_get_inode_buffer(m_ip, &m_bh);
-	if (error)
-		goto gfs_statfs_sync_out;
-
-	/* if no change, simply return */
-	spin_lock(&sdp->sd_statfs_spin);
-        gfs_statfs_change_in(m_sc, m_bh->b_data +
-                              sizeof(struct gfs_dinode));
-	if (!l_sc->sc_total && !l_sc->sc_free && !l_sc->sc_dinodes) {
-		spin_unlock(&sdp->sd_statfs_spin);
-		goto out_bh;
-	}
-	spin_unlock(&sdp->sd_statfs_spin);
-
-	error = gfs_trans_begin(sdp, 1, 0);
-	if (error)
-		goto out_bh;
-
-	spin_lock(&sdp->sd_statfs_spin);
-	m_sc->sc_total += l_sc->sc_total;
-	m_sc->sc_free += l_sc->sc_free;
-	m_sc->sc_dinodes += l_sc->sc_dinodes;
-	memset(l_sc, 0, sizeof(struct gfs_statfs_change_host));
-	spin_unlock(&sdp->sd_statfs_spin);
-
-	gfs_trans_add_bh(m_ip->i_gl, m_bh);
-	gfs_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs_dinode));
-
-	gfs_trans_end(sdp);
-
-out_bh:
-	brelse(m_bh);
-
-gfs_statfs_sync_out:
-	gfs_glock_dq_uninit(&gh);
-	return error;
-}
-
-int gfs_statfs_fast(struct gfs_sbd *sdp, void *b)
-{
-	struct kstatfs *buf = (struct kstatfs *)b;
-	struct gfs_statfs_change_host sc, *m_sc = &sdp->sd_statfs_master;
-	struct gfs_statfs_change_host *l_sc = &sdp->sd_statfs_local;
-
-	spin_lock(&sdp->sd_statfs_spin);
-
-	sc.sc_total   = m_sc->sc_total + l_sc->sc_total;
-	sc.sc_free    = m_sc->sc_free + l_sc->sc_free;
-	sc.sc_dinodes = m_sc->sc_dinodes + l_sc->sc_dinodes;
-	spin_unlock(&sdp->sd_statfs_spin);
-
-	if (sc.sc_free < 0)
-		sc.sc_free = 0;
-	if (sc.sc_free > sc.sc_total)
-		sc.sc_free = sc.sc_total;
-	if (sc.sc_dinodes < 0)
-		sc.sc_dinodes = 0;
-
-	/* fill in the statistics */
-	memset(buf, 0, sizeof(struct kstatfs));
-
-	buf->f_type = GFS_MAGIC; buf->f_bsize = sdp->sd_sb.sb_bsize;
-	buf->f_blocks = sc.sc_total;
-	buf->f_bfree = sc.sc_free;
-	buf->f_bavail = sc.sc_free;
-	buf->f_files = sc.sc_dinodes + sc.sc_free;
-	buf->f_ffree = sc.sc_free;
-	buf->f_namelen = GFS_FNAMESIZE;
-
-	return 0;
-}
diff --git a/gfs-kernel/src/gfs/super.h b/gfs-kernel/src/gfs/super.h
deleted file mode 100644
index 2ffbb9f..0000000
--- a/gfs-kernel/src/gfs/super.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef __SUPER_DOT_H__
-#define __SUPER_DOT_H__
-
-void gfs_tune_init(struct gfs_tune *gt);
-
-int gfs_check_sb(struct gfs_sbd *sdp, struct gfs_sb *sb, int silent);
-int gfs_read_sb(struct gfs_sbd *sdp, struct gfs_glock *gl, int silent);
-int gfs_do_upgrade(struct gfs_sbd *sdp, struct gfs_glock *gl_sb);
-
-static __inline__ unsigned int
-gfs_num_journals(struct gfs_sbd *sdp)
-{
-	unsigned int num;
-	down(&sdp->sd_jindex_lock);
-	num = sdp->sd_journals;
-	up(&sdp->sd_jindex_lock);
-	return num;
-}
-
-int gfs_jindex_hold(struct gfs_sbd *sdp, struct gfs_holder *ji_gh);
-void gfs_clear_journals(struct gfs_sbd *sdp);
-
-int gfs_get_jiinode(struct gfs_sbd *sdp);
-int gfs_get_riinode(struct gfs_sbd *sdp);
-int gfs_get_rootinode(struct gfs_sbd *sdp);
-int gfs_get_qinode(struct gfs_sbd *sdp);
-int gfs_get_linode(struct gfs_sbd *sdp);
-
-int gfs_make_fs_rw(struct gfs_sbd *sdp);
-int gfs_make_fs_ro(struct gfs_sbd *sdp);
-
-int gfs_statfs_init(struct gfs_sbd *sdp, int flag);
-int gfs_statfs_sync(struct gfs_sbd *sdp);
-int gfs_statfs_fast(struct gfs_sbd *sdp, void *buf);
-
-struct gfs_stat_gfs {
-	uint64_t sg_total_blocks;
-	uint64_t sg_free;
-	uint64_t sg_used_dinode;
-	uint64_t sg_free_dinode;
-	uint64_t sg_used_meta;
-	uint64_t sg_free_meta;
-};
-
-int gfs_stat_gfs(struct gfs_sbd *sdp, struct gfs_stat_gfs *sg,
-		 int interruptible);
-
-int gfs_lock_fs_check_clean(struct gfs_sbd *sdp, unsigned int state,
-			    struct gfs_holder *t_gh);
-int gfs_freeze_fs(struct gfs_sbd *sdp);
-void gfs_unfreeze_fs(struct gfs_sbd *sdp);
-void gfs_online_uevent(struct gfs_sbd *sdp);
-
-#endif /* __SUPER_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/sys.c b/gfs-kernel/src/gfs/sys.c
deleted file mode 100644
index f20d302..0000000
--- a/gfs-kernel/src/gfs/sys.c
+++ /dev/null
@@ -1,145 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <linux/proc_fs.h>
-#include <linux/module.h>
-#include <asm/uaccess.h>
-#include <linux/genhd.h>
-
-#include "gfs.h"
-#include "glock.h"
-#include "lm.h"
-#include "sys.h"
-#include "super.h"
-
-char *gfs_sys_margs;
-spinlock_t gfs_sys_margs_lock;
-
-static ssize_t id_show(struct gfs_sbd *sdp, char *buf)
-{
-	return sprintf(buf, "%s\n", sdp->sd_vfs->s_id);
-}
-
-static ssize_t fsname_show(struct gfs_sbd *sdp, char *buf)
-{
-	return sprintf(buf, "%s\n", sdp->sd_fsname);
-}
-
-struct gfs_attr {
-	struct attribute attr;
-	ssize_t (*show)(struct gfs_sbd *, char *);
-	ssize_t (*store)(struct gfs_sbd *, const char *, size_t);
-};
-
-#define GFS_ATTR(name, mode, show, store) \
-static struct gfs_attr gfs_attr_##name = __ATTR(name, mode, show, store)
-
-GFS_ATTR(id,                  0444, id_show,       NULL);
-GFS_ATTR(fsname,              0444, fsname_show,   NULL);
-
-static struct attribute *gfs_attrs[] = {
-	&gfs_attr_id.attr,
-	&gfs_attr_fsname.attr,
-	NULL,
-};
-
-static ssize_t gfs_attr_show(struct kobject *kobj, struct attribute *attr,
-			      char *buf)
-{
-	struct gfs_sbd *sdp = container_of(kobj, struct gfs_sbd, sd_kobj);
-	struct gfs_attr *a = container_of(attr, struct gfs_attr, attr);
-	return a->show ? a->show(sdp, buf) : 0;
-}
-
-static ssize_t gfs_attr_store(struct kobject *kobj, struct attribute *attr,
-			       const char *buf, size_t len)
-{
-	struct gfs_sbd *sdp = container_of(kobj, struct gfs_sbd, sd_kobj);
-	struct gfs_attr *a = container_of(attr, struct gfs_attr, attr);
-	return a->store ? a->store(sdp, buf, len) : len;
-}
-
-static struct sysfs_ops gfs_attr_ops = {
-	.show  = gfs_attr_show,
-	.store = gfs_attr_store,
-};
-
-static struct kobj_type gfs_ktype = {
-	.default_attrs = gfs_attrs,
-	.sysfs_ops     = &gfs_attr_ops,
-};
-
-static struct kset *gfs_kset;
-
-int gfs_sys_fs_add(struct gfs_sbd *sdp)
-{
-	struct super_block *sb = sdp->sd_vfs;
-	int error;
-	char ro[20];
-	char spectator[20];
-	char *envp[] = { ro, spectator, NULL };
-
-	sprintf(ro, "RDONLY=%d", (sb->s_flags & MS_RDONLY) ? 1 : 0);
-	sprintf(spectator, "SPECTATOR=%d", sdp->sd_args.ar_spectator ? 1 : 0);
-
-	sdp->sd_kobj.kset = gfs_kset;
-	error = kobject_init_and_add(&sdp->sd_kobj, &gfs_ktype, NULL,
-				     "%s", sdp->sd_table_name);
-	if (error)
-		goto fail;
-
-	error = sysfs_create_link(&sdp->sd_kobj,
-				  &disk_to_dev(sb->s_bdev->bd_disk)->kobj,
-				  "device");
-	if (error)
-		goto fail_put;
-
-	kobject_uevent_env(&sdp->sd_kobj, KOBJ_ADD, envp);
-
-	return 0;
-
-fail_put:
-	kobject_put(&sdp->sd_kobj);
-fail:
-	return error;
-}
-
-void gfs_sys_fs_del(struct gfs_sbd *sdp)
-{
-	kobject_put(&sdp->sd_kobj);
-}
-
-static int gfs_uevent(struct kset *kset, struct kobject *kobj,
-		       struct kobj_uevent_env *env)
-{
-	struct gfs_sbd *sdp = container_of(kobj, struct gfs_sbd, sd_kobj);
-	add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name);
-	add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name);
-	if (!sdp->sd_args.ar_spectator)
-		add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid);
-	return 0;
-}
-
-static struct kset_uevent_ops gfs_uevent_ops = {
-	.uevent = gfs_uevent,
-};
-
-int gfs_sys_init(void)
-{
-	gfs_sys_margs = NULL;
-	spin_lock_init(&gfs_sys_margs_lock);
-	gfs_kset = kset_create_and_add("gfs", &gfs_uevent_ops, fs_kobj);
-	if (!gfs_kset)
-		return -ENOMEM;
-	return 0;
-}
-
-void gfs_sys_uninit(void)
-{
-	kfree(gfs_sys_margs);
-	kset_unregister(gfs_kset);
-}
diff --git a/gfs-kernel/src/gfs/sys.h b/gfs-kernel/src/gfs/sys.h
deleted file mode 100644
index 0afa549..0000000
--- a/gfs-kernel/src/gfs/sys.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __SYS_DOT_H__
-#define __SYS_DOT_H__
-
-/* Allow args to be passed to GFS when using an initial ram disk */
-extern char *gfs_sys_margs;
-extern spinlock_t gfs_sys_margs_lock;
-
-int gfs_sys_fs_add(struct gfs_sbd *sdp);
-void gfs_sys_fs_del(struct gfs_sbd *sdp);
-
-int gfs_sys_init(void);
-void gfs_sys_uninit(void);
-
-#endif /* __SYS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/trans.c b/gfs-kernel/src/gfs/trans.c
deleted file mode 100644
index 985533e..0000000
--- a/gfs-kernel/src/gfs/trans.c
+++ /dev/null
@@ -1,453 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "dio.h"
-#include "glock.h"
-#include "log.h"
-#include "lops.h"
-#include "quota.h"
-#include "trans.h"
-#include "unlinked.h"
-
-/**
- * gfs_trans_print - Print a transaction to the console
- * @sdp: the filesystem
- * @tr: The GFS transaction
- * @where: Situation of transaction
- *
- */
-
-void
-gfs_trans_print(struct gfs_sbd *sdp, struct gfs_trans *tr, unsigned int where)
-{
-	struct gfs_log_element *le;
-	struct list_head *tmp, *head;
-	unsigned int mblks = 0, eblks = 0;
-
-	LO_TRANS_SIZE(sdp, tr, &mblks, &eblks, NULL, NULL);
-
-	printk("Transaction:  (%s, %u)\n", tr->tr_file, tr->tr_line);
-	printk("  tr_mblks_asked = %u, tr_eblks_asked = %u, tr_seg_reserved = %u\n",
-	       tr->tr_mblks_asked, tr->tr_eblks_asked, tr->tr_seg_reserved);
-	printk("  mblks = %u, eblks = %u\n", mblks, eblks);
-	printk("  tr_flags = 0x%.8X\n", tr->tr_flags);
-
-	for (head = &tr->tr_elements, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-		LO_PRINT(sdp, le, where);
-	}
-
-	printk("End Trans\n");
-}
-
-/**
- * gfs_trans_begin_i - Prepare to start a transaction
- * @sdp: The GFS superblock
- * @meta_blocks: Reserve this many metadata blocks in the log
- * @extra_blocks: Number of non-metadata blocks to reserve
- *
- * Allocate the struct gfs_trans struct.
- * Grab a shared TRANSaction lock (protects this transaction from
- *   overlapping with unusual fs writes, e.g. journal replay, fs upgrade,
- *   while allowing simultaneous transaction writes throughout cluster).
- * Reserve space in the log.  @meta_blocks and @extra_blocks must indicate
- *   the worst case (maximum) size of the transaction.
- * Record this transaction as the *one* transaction being built by this
- *   Linux process, in current->journal_info.
- *
- * Returns: errno
- */
-
-int
-gfs_trans_begin_i(struct gfs_sbd *sdp,
-		  unsigned int meta_blocks, unsigned int extra_blocks,
-		  char *file, unsigned int line)
-{
-	struct gfs_trans *tr;
-	unsigned int blocks;
-	int error;
-
-	tr = kmalloc(sizeof(struct gfs_trans), GFP_KERNEL);
-	if (!tr)
-		return -ENOMEM;
-	memset(tr, 0, sizeof(struct gfs_trans));
-
-	INIT_LIST_HEAD(&tr->tr_elements);
-	INIT_LIST_HEAD(&tr->tr_free_bufs);
-	INIT_LIST_HEAD(&tr->tr_free_bmem);
-	INIT_LIST_HEAD(&tr->tr_bufs);
-	INIT_LIST_HEAD(&tr->tr_ail_bufs);
-	tr->tr_file = file;
-	tr->tr_line = line;
-
-	error = -ENOMEM;
-	tr->tr_t_gh = gfs_holder_get(sdp->sd_trans_gl, LM_ST_SHARED, 0);
-	if (!tr->tr_t_gh)
-		goto fail;
-
-	error = gfs_glock_nq(tr->tr_t_gh);
-	if (error)
-		goto fail_holder_put;
-
-	if (test_bit(SDF_ROFS, &sdp->sd_flags)) {
-		tr->tr_t_gh->gh_flags |= GL_NOCACHE;
-		error = -EROFS;
-		goto fail_gunlock;
-	}
-
-	/*  Do log reservation  */
-
-	tr->tr_mblks_asked = meta_blocks;
-	tr->tr_eblks_asked = extra_blocks;
-
-	blocks = 1;
-	if (meta_blocks)
-		blocks += gfs_struct2blk(sdp, meta_blocks,
-					 sizeof(struct gfs_block_tag)) +
-			meta_blocks;
-	blocks += extra_blocks;
-	tr->tr_seg_reserved = gfs_blk2seg(sdp, blocks);
-
-	error = gfs_log_reserve(sdp, tr->tr_seg_reserved, FALSE);
-	if (error)
-		goto fail_gunlock;
-
-	gfs_assert(sdp, !get_transaction,);
-	set_transaction(tr);
-
-	return 0;
-
- fail_gunlock:
-	gfs_glock_dq(tr->tr_t_gh);
-
- fail_holder_put:
-	gfs_holder_put(tr->tr_t_gh);
-
- fail:
-	kfree(tr);
-
-	return error;
-}
-
-/**
- * gfs_trans_end - End a transaction
- * @sdp: The GFS superblock
- *
- * If buffers were actually added to the transaction,
- * commit it.
- *
- */
-
-void
-gfs_trans_end(struct gfs_sbd *sdp)
-{
-	struct gfs_trans *tr;
-	struct gfs_holder *t_gh;
-	struct list_head *tmp, *head;
-	struct gfs_log_element *le;
-
-	/* Linux task struct indicates current new trans for this process.
-	 * We're done building it, so set it to NULL */
-	tr = get_transaction;
-	gfs_assert(sdp, tr,);
-	set_transaction(NULL);
-
-	t_gh = tr->tr_t_gh;
-	tr->tr_t_gh = NULL;
-
-	/* If no buffers were ever added to trans, forget it */
-	if (list_empty(&tr->tr_elements)) {
-		gfs_log_release(sdp, tr->tr_seg_reserved);
-		kfree(tr);
-
-		gfs_glock_dq(t_gh);
-		gfs_holder_put(t_gh);
-
-		return;
-	}
-
-	/* Do trans_end log-operation for each log element */
-	for (head = &tr->tr_elements, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-		LO_TRANS_END(sdp, le);
-	}
-
-	gfs_log_commit(sdp, tr);
-
-	gfs_glock_dq(t_gh);
-	gfs_holder_put(t_gh);
-
-	if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS)
-		gfs_log_flush(sdp);
-}
-
-/**
- * gfs_trans_add_gl - Add a glock to a transaction
- * @gl: the glock
- *
- * If not already attached, add the given glock to this process's transaction.
- *
- * Even though no glock info will be written to the on-disk log, the glocks
- *   associated with a transaction provide bridges by which to combine
- *   a just-built transaction with an earlier incore committed transaction
- *   that was protected by the same glock.  See incore_commit().
- *   Combining transactions makes for more efficient logging.
- *
- * Note that more than one glock may be associated with a single transaction.
- *   However, a given glock protects no more than *one* transaction at a
- *   given stage in the transaction pipeline (i.e. new or incore-committed).
- *   After all, the process holds the glock EX (so no other process can be
- *   building a separate trans protected by this glock), and the process can
- *   build only one transaction at a time.
- *
- * Rules:
- *   This process must hold the glock in EXclusive mode, since we're going
- *   to be writing to something protected by this glock.
- */
-
-void
-gfs_trans_add_gl(struct gfs_glock *gl)
-{
-	if (!gl->gl_new_le.le_trans) {
-		gfs_assert_withdraw(gl->gl_sbd,
-				    gfs_glock_is_locked_by_me(gl) &&
-				    gfs_glock_is_held_excl(gl));
-		gfs_glock_hold(gl); /* Released in glock_trans_end() */
-
-		/* Ask for eventual flush of (meta)data protected by this glock,
-		   once trans is complete and logged.  */
-		set_bit(GLF_DIRTY, &gl->gl_flags);
-
-		/* Invoke generic_le_add() */
-		LO_ADD(gl->gl_sbd, &gl->gl_new_le);
-		gl->gl_new_le.le_trans->tr_num_gl++;
-	}
-}
-
-/**
- * gfs_trans_add_bh - Add a to-be-modified buffer to the current transaction
- * @gl: the glock the buffer belongs to
- * @bh: The buffer to add
- *
- * Add a to-be-modified buffer to the current being-built (i.e. new) trans,
- *   and pin the buffer in memory.
- *
- * Caller must hold the glock protecting this buffer.
- *
- * Call this as many times as you want during transaction formation.  It does
- * its attachment work only once.  After buffer is attached to trans, the
- * process building the trans can modify the buffer again and again (calling
- * this function before each change).  Only the final result (within this trans)
- * will be written to log.  A good example is when allocating blocks in an RG,
- * a given bitmap buffer may be updated many times within a transaction.
- *
- * Note:  This final result will also be written to its in-place location,
- *  unless this transaction gets combined with a later transaction,
- *  in which case only the later result will go to in-place.
- *
- */
-
-void
-gfs_trans_add_bh(struct gfs_glock *gl, struct buffer_head *bh)
-{
-	struct gfs_sbd *sdp = gl->gl_sbd;
-	struct gfs_bufdata *bd;
-
-	/* Make sure GFS private info struct is attached to buffer head */
-	bd = get_v2bd(bh);
-	if (!bd) {
-		gfs_attach_bufdata(bh, gl);
-		bd = get_v2bd(bh);
-	}
-
-	/* If buffer has already been attached to trans, we're done */
-	if (bd->bd_new_le.le_trans)
-		return;
-
-	gfs_meta_check(sdp, bh);
-
-	gfs_assert(sdp, bd->bd_gl == gl,);
-
-	/* Make sure glock is attached to trans */
-	if (!gl->gl_new_le.le_trans)
-		gfs_trans_add_gl(gl);
-
-	gfs_dpin(sdp, bh);
-
-	/* Attach buffer to trans */
-	LO_ADD(sdp, &bd->bd_new_le);
-	bd->bd_new_le.le_trans->tr_num_buf++;
-}
-
-/**
- * gfs_trans_add_unlinked - Add an unlinked or dealloced tag to
- *      the current transaction
- * @sdp: the filesystem
- * @type: the type of entry
- * @inum: the inode number
- *
- * Returns: the unlinked structure
- */
-
-struct gfs_unlinked *
-gfs_trans_add_unlinked(struct gfs_sbd *sdp, unsigned int type,
-		       struct gfs_inum *inum)
-{
-	struct gfs_unlinked *ul;
-
-	/* Find in fileystem's unlinked list, or create */
-	ul = gfs_unlinked_get(sdp, inum, CREATE);
-
-	LO_ADD(sdp, &ul->ul_new_le);
-
-	switch (type) {
-	case GFS_LOG_DESC_IUL:
-		set_bit(ULF_NEW_UL, &ul->ul_flags);
-		ul->ul_new_le.le_trans->tr_num_iul++;
-		break;
-	case GFS_LOG_DESC_IDA:
-		clear_bit(ULF_NEW_UL, &ul->ul_flags);
-		ul->ul_new_le.le_trans->tr_num_ida++;
-		break;
-	default:
-		gfs_assert(sdp, FALSE,);
-		break;
-	}
-
-	return ul;
-}
-
-/**
- * gfs_trans_add_quota - Add quota changes to a transaction
- * @sdp: the filesystem
- * @change: The number of blocks allocated (positive) or freed (negative)
- * @uid: the user ID doing the change
- * @gid: the group ID doing the change
- *
- */
-
-void
-gfs_trans_add_quota(struct gfs_sbd *sdp, int64_t change,
-		    uint32_t uid, uint32_t gid)
-{
-	struct gfs_trans *tr;
-	struct list_head *tmp, *head, *next;
-	struct gfs_log_element *le;
-	struct gfs_quota_le *ql;
-	int found_uid, found_gid;
-	int error;
-
-	if (!gfs_tune_get(sdp, gt_quota_account))
-		return;
-	if (gfs_assert_warn(sdp, change))
-		return;
-
-	found_uid = (uid == NO_QUOTA_CHANGE);
-	found_gid = (gid == NO_QUOTA_CHANGE);
-
-	if (gfs_assert_warn(sdp, !found_uid || !found_gid))
-		return;
-
-	tr = get_transaction;
-	gfs_assert(sdp, tr,);
-
-	for (head = &tr->tr_elements, tmp = head->next, next = tmp->next;
-	     tmp != head;
-	     tmp = next, next = next->next) {
-		le = list_entry(tmp, struct gfs_log_element, le_list);
-		if (le->le_ops != &gfs_quota_lops)
-			continue;
-
-		ql = container_of(le, struct gfs_quota_le, ql_le);
-
-		if (test_bit(QDF_USER, &ql->ql_data->qd_flags)) {
-			if (ql->ql_data->qd_id == uid) {
-				ql->ql_change += change;
-
-				spin_lock(&sdp->sd_quota_lock);
-				ql->ql_data->qd_change_new += change;
-				spin_unlock(&sdp->sd_quota_lock);
-
-				list_del(&le->le_list);
-
-				if (ql->ql_change)
-					list_add(&le->le_list,
-						 &tr->tr_elements);
-				else {
-					gfs_quota_put(sdp, ql->ql_data);
-					kfree(ql);
-					tr->tr_num_q--;
-				}
-
-				gfs_assert(sdp, !found_uid,);
-				found_uid = TRUE;
-				if (found_gid)
-					break;
-			}
-		} else {
-			if (ql->ql_data->qd_id == gid) {
-				ql->ql_change += change;
-
-				spin_lock(&sdp->sd_quota_lock);
-				ql->ql_data->qd_change_new += change;
-				spin_unlock(&sdp->sd_quota_lock);
-
-				list_del(&le->le_list);
-
-				if (ql->ql_change)
-					list_add(&le->le_list,
-						 &tr->tr_elements);
-				else {
-					gfs_quota_put(sdp, ql->ql_data);
-					kfree(ql);
-					tr->tr_num_q--;
-				}
-
-				gfs_assert(sdp, !found_gid,);
-				found_gid = TRUE;
-				if (found_uid)
-					break;
-			}
-		}
-	}
-
-	while (!found_uid || !found_gid) {
-		ql = gmalloc(sizeof(struct gfs_quota_le));
-		memset(ql, 0, sizeof(struct gfs_quota_le));
-
-		INIT_LE(&ql->ql_le, &gfs_quota_lops);
-
-		if (found_uid) {
-			error = gfs_quota_get(sdp, FALSE, gid,
-					      NO_CREATE,
-					      &ql->ql_data);
-			found_gid = TRUE;
-		} else {
-			error = gfs_quota_get(sdp, TRUE, uid,
-					      NO_CREATE,
-					      &ql->ql_data);
-			found_uid = TRUE;
-		}
-
-		gfs_assert(sdp, !error && ql->ql_data,);
-
-		ql->ql_change = change;
-
-		spin_lock(&sdp->sd_quota_lock);
-		ql->ql_data->qd_change_new += change;
-		spin_unlock(&sdp->sd_quota_lock);
-
-		LO_ADD(sdp, &ql->ql_le);
-		tr->tr_num_q++;
-	}
-}
diff --git a/gfs-kernel/src/gfs/trans.h b/gfs-kernel/src/gfs/trans.h
deleted file mode 100644
index 5d62b39..0000000
--- a/gfs-kernel/src/gfs/trans.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __TRANS_DOT_H__
-#define __TRANS_DOT_H__
-
-#define TRANS_IS_NEW            (53)
-#define TRANS_IS_INCORE         (54)
-void gfs_trans_print(struct gfs_sbd *sdp, struct gfs_trans *tr,
-		     unsigned int where);
-
-int gfs_trans_begin_i(struct gfs_sbd *sdp,
-		      unsigned int meta_blocks, unsigned int extra_blocks,
-		      char *file, unsigned int line);
-#define gfs_trans_begin(sdp, mb, eb) \
-gfs_trans_begin_i((sdp), (mb), (eb), __FILE__, __LINE__)
-
-void gfs_trans_end(struct gfs_sbd *sdp);
-
-void gfs_trans_add_gl(struct gfs_glock *gl);
-void gfs_trans_add_bh(struct gfs_glock *gl, struct buffer_head *bh);
-struct gfs_unlinked *gfs_trans_add_unlinked(struct gfs_sbd *sdp, unsigned int type,
-					    struct gfs_inum *inum);
-void gfs_trans_add_quota(struct gfs_sbd *sdp, int64_t change, uint32_t uid,
-			 uint32_t gid);
-
-#endif /* __TRANS_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/unlinked.c b/gfs-kernel/src/gfs/unlinked.c
deleted file mode 100644
index d41c48a..0000000
--- a/gfs-kernel/src/gfs/unlinked.c
+++ /dev/null
@@ -1,432 +0,0 @@
-#include <linux/kthread.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-
-#include "gfs.h"
-#include "inode.h"
-#include "log.h"
-#include "lops.h"
-#include "unlinked.h"
-
-/**
- * gfs_unlinked_get - Get a structure to represent an unlinked inode
- * @sdp: the filesystem
- * @inum: identifies the inode that's unlinked
- * @create: if TRUE, we're allowed to create the structure if we can't find it,
- *      otherwise return NULL
- *
- * Returns: the structure, or NULL
- *
- * Search the filesystem's list of gfs_unlinked to find a match.
- * If none found, create a new one and place on list.
- */
-
-struct gfs_unlinked *
-gfs_unlinked_get(struct gfs_sbd *sdp, struct gfs_inum *inum, int create)
-{
-	struct gfs_unlinked *ul = NULL, *new_ul = NULL;
-	struct list_head *tmp, *head;
-
-	for (;;) {
-		spin_lock(&sdp->sd_unlinked_lock);
-
-		for (head = &sdp->sd_unlinked_list, tmp = head->next;
-		     tmp != head;
-		     tmp = tmp->next) {
-			ul = list_entry(tmp, struct gfs_unlinked, ul_list);
-			if (gfs_inum_equal(&ul->ul_inum, inum)) {
-				ul->ul_count++;
-				break;
-			}
-		}
-
-		if (tmp == head)
-			ul = NULL;
-
-		/* 2nd pass, still not there; add the new_ul we prepared */
-		if (!ul && new_ul) {
-			ul = new_ul;
-			list_add(&ul->ul_list, &sdp->sd_unlinked_list);
-			new_ul = NULL;
-		}
-
-		spin_unlock(&sdp->sd_unlinked_lock);
-
-		/* 1st pass; we found pre-existing, OR not allowed to create.
-		   2nd pass; another process added it, or we did */
-		if (ul || !create) {
-			if (new_ul)
-				/* someone beat us to it; forget our new_ul */
-				kfree(new_ul);
-			return ul;
-		}
-
-		/* No match on list, 1st time through loop.
-		   Prepare new_ul, then repeat loop to find out if another
-		   process has created or unlinked an inode and put its
-		   gfs_unlinked on list while we've been preparing this one. */
-		new_ul = gmalloc(sizeof(struct gfs_unlinked));
-		memset(new_ul, 0, sizeof(struct gfs_unlinked));
-
-		new_ul->ul_count = 1;
-		new_ul->ul_inum = *inum;
-
-		INIT_LE(&new_ul->ul_new_le, &gfs_unlinked_lops);
-		INIT_LE(&new_ul->ul_incore_le, &gfs_unlinked_lops);
-		INIT_LE(&new_ul->ul_ondisk_le, &gfs_unlinked_lops);
-	}
-}
-
-/**
- * gfs_unlinked_hold - increment the usage count on a struct gfs_unlinked
- * @sdp: the filesystem
- * @ul: the structure
- *
- */
-
-void
-gfs_unlinked_hold(struct gfs_sbd *sdp, struct gfs_unlinked *ul)
-{
-	spin_lock(&sdp->sd_unlinked_lock);
-	gfs_assert(sdp, ul->ul_count,);
-	ul->ul_count++;
-	spin_unlock(&sdp->sd_unlinked_lock);
-}
-
-/**
- * gfs_unlinked_put - decrement the usage count on a struct gfs_unlinked
- * @sdp: the filesystem
- * @ul: the structure
- *
- * Free the structure if its reference count hits zero.
- *
- */
-
-void
-gfs_unlinked_put(struct gfs_sbd *sdp, struct gfs_unlinked *ul)
-{
-	spin_lock(&sdp->sd_unlinked_lock);
-
-	gfs_assert(sdp, ul->ul_count,);
-	ul->ul_count--;
-
-	if (!ul->ul_count) {
-		gfs_assert_warn(sdp,
-				!test_bit(ULF_IC_LIST, &ul->ul_flags) &&
-				!test_bit(ULF_OD_LIST, &ul->ul_flags) &&
-				!test_bit(ULF_LOCK, &ul->ul_flags));
-		list_del(&ul->ul_list);
-		spin_unlock(&sdp->sd_unlinked_lock);
-		kfree(ul);
-	} else
-		spin_unlock(&sdp->sd_unlinked_lock);
-}
-
-/**
- * unlinked_find - Find a inode to try to deallocate
- * @sdp: the filesystem
- *
- * The returned structure is locked and needs to be unlocked
- * with gfs_unlinked_unlock().
- *
- * Returns: A unlinked structure, or NULL
- */
-
-struct gfs_unlinked *
-unlinked_find(struct gfs_sbd *sdp)
-{
-	struct list_head *tmp, *head;
-	struct gfs_unlinked *ul = NULL;
-
-	if (test_bit(SDF_ROFS, &sdp->sd_flags))
-		return NULL;
-
-	gfs_log_lock(sdp);
-	spin_lock(&sdp->sd_unlinked_lock);
-
-	if (!atomic_read(&sdp->sd_unlinked_ic_count))
-		goto out;
-
-	for (head = &sdp->sd_unlinked_list, tmp = head->next;
-	     tmp != head;
-	     tmp = tmp->next) {
-		ul = list_entry(tmp, struct gfs_unlinked, ul_list);
-
-		if (test_bit(ULF_LOCK, &ul->ul_flags))
-			continue;
-		if (!test_bit(ULF_IC_LIST, &ul->ul_flags))
-			continue;
-
-		list_move_tail(&ul->ul_list, &sdp->sd_unlinked_list);
-
-		set_bit(ULF_LOCK, &ul->ul_flags);
-		ul->ul_count++;
-
-		goto out;
-	}
-
-	ul = NULL;
-
- out:
-	spin_unlock(&sdp->sd_unlinked_lock);
-	gfs_log_unlock(sdp);
-
-	return ul;
-}
-
-/**
- * gfs_unlinked_lock - lock a unlinked structure
- * @sdp: the filesystem
- * @ul: the unlinked inode structure
- *
- */
-
-void
-gfs_unlinked_lock(struct gfs_sbd *sdp, struct gfs_unlinked *ul)
-{
-	spin_lock(&sdp->sd_unlinked_lock);
-
-	gfs_assert_warn(sdp, !test_bit(ULF_LOCK, &ul->ul_flags));
-	set_bit(ULF_LOCK, &ul->ul_flags);
-
-	ul->ul_count++;
-
-	spin_unlock(&sdp->sd_unlinked_lock);	
-}
-
-/**
- * gfs_unlinked_unlock - drop a reference on a unlinked structure
- * @sdp: the filesystem
- * @ul: the unlinked inode structure
- *
- */
-
-void
-gfs_unlinked_unlock(struct gfs_sbd *sdp, struct gfs_unlinked *ul)
-{
-	spin_lock(&sdp->sd_unlinked_lock);
-
-	gfs_assert_warn(sdp, test_bit(ULF_LOCK, &ul->ul_flags));
-	clear_bit(ULF_LOCK, &ul->ul_flags);
-
-	gfs_assert(sdp, ul->ul_count,);
-	ul->ul_count--;
-
-	if (!ul->ul_count) {
-		gfs_assert_warn(sdp, !test_bit(ULF_IC_LIST, &ul->ul_flags) &&
-				!test_bit(ULF_OD_LIST, &ul->ul_flags));
-		list_del(&ul->ul_list);
-		spin_unlock(&sdp->sd_unlinked_lock);
-		kfree(ul);
-	} else
-		spin_unlock(&sdp->sd_unlinked_lock);
-}
-
-/**
- * gfs_unlinked_merge - add/remove a unlinked inode from the in-memory list
- * @sdp: the filesystem
- * @type: is this a unlink tag or a dealloc tag
- * @inum: the inode number
- *
- * Called during journal recovery.
- */
-
-void
-gfs_unlinked_merge(struct gfs_sbd *sdp, unsigned int type,
-		   struct gfs_inum *inum)
-{
-	struct gfs_unlinked *ul;
-
-	gfs_assert(sdp, atomic_read(&sdp->sd_unlinked_ic_count) ==
-		   atomic_read(&sdp->sd_unlinked_od_count),);
-
-	ul = gfs_unlinked_get(sdp, inum, CREATE);
-
-	gfs_log_lock(sdp);
-
-	switch (type) {
-	case GFS_LOG_DESC_IUL:
-		gfs_unlinked_hold(sdp, ul);
-		gfs_unlinked_hold(sdp, ul);
-		gfs_assert(sdp, !test_bit(ULF_IC_LIST, &ul->ul_flags) &&
-			   !test_bit(ULF_OD_LIST, &ul->ul_flags),);
-		set_bit(ULF_IC_LIST, &ul->ul_flags);
-		set_bit(ULF_OD_LIST, &ul->ul_flags);
-		atomic_inc(&sdp->sd_unlinked_ic_count);
-		atomic_inc(&sdp->sd_unlinked_od_count);
-
-		break;
-
-	case GFS_LOG_DESC_IDA:
-		gfs_assert(sdp, test_bit(ULF_IC_LIST, &ul->ul_flags) &&
-			   test_bit(ULF_OD_LIST, &ul->ul_flags),);
-		clear_bit(ULF_IC_LIST, &ul->ul_flags);
-		clear_bit(ULF_OD_LIST, &ul->ul_flags);
-		gfs_unlinked_put(sdp, ul);
-		gfs_unlinked_put(sdp, ul);
-		gfs_assert(sdp, atomic_read(&sdp->sd_unlinked_ic_count) > 0,);
-		atomic_dec(&sdp->sd_unlinked_ic_count);
-		gfs_assert(sdp, atomic_read(&sdp->sd_unlinked_od_count) > 0,);
-		atomic_dec(&sdp->sd_unlinked_od_count);
-
-		break;
-	}
-
-	gfs_log_unlock(sdp);
-
-	gfs_unlinked_put(sdp, ul);
-}
-
-/**
- * gfs_unlinked_cleanup - get rid of any extra struct gfs_unlinked structures
- * @sdp: the filesystem
- *
- */
-
-void
-gfs_unlinked_cleanup(struct gfs_sbd *sdp)
-{
-	struct gfs_unlinked *ul;
-
- restart:
-	gfs_log_lock(sdp);
-
-	gfs_assert(sdp, atomic_read(&sdp->sd_unlinked_ic_count) ==
-		   atomic_read(&sdp->sd_unlinked_od_count),);
-
-	spin_lock(&sdp->sd_unlinked_lock);
-
-	while (!list_empty(&sdp->sd_unlinked_list)) {
-		ul = list_entry(sdp->sd_unlinked_list.next,
-				struct gfs_unlinked, ul_list);
-
-		if (ul->ul_count > 2) {
-			spin_unlock(&sdp->sd_unlinked_lock);
-			gfs_log_unlock(sdp);
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ);
-			goto restart;
-		}
-		gfs_assert(sdp, ul->ul_count == 2,);
-
-		gfs_assert_warn(sdp,
-				test_bit(ULF_IC_LIST, &ul->ul_flags) &&
-				test_bit(ULF_OD_LIST, &ul->ul_flags) &&
-				!test_bit(ULF_LOCK, &ul->ul_flags));
-
-		list_del(&ul->ul_list);
-
-		atomic_dec(&sdp->sd_unlinked_ic_count);
-		atomic_dec(&sdp->sd_unlinked_od_count);
-
-		spin_unlock(&sdp->sd_unlinked_lock);
-		kfree(ul);
-		spin_lock(&sdp->sd_unlinked_lock);
-	}
-
-	spin_unlock(&sdp->sd_unlinked_lock);
-
-	gfs_assert(sdp, !atomic_read(&sdp->sd_unlinked_ic_count) &&
-		   !atomic_read(&sdp->sd_unlinked_od_count),);
-
-	gfs_log_unlock(sdp);
-}
-
-/**
- * gfs_unlinked_limit - limit the number of inodes waiting to be deallocated
- * @sdp: the filesystem
- *
- * Returns: errno
- */
-
-void
-gfs_unlinked_limit(struct gfs_sbd *sdp)
-{
-	unsigned int tries = 0, min = 0;
-	int error;
-
-	if (atomic_read(&sdp->sd_unlinked_ic_count) >=
-	    gfs_tune_get(sdp, gt_ilimit2)) {
-		tries = gfs_tune_get(sdp, gt_ilimit2_tries);
-		min = gfs_tune_get(sdp, gt_ilimit2_min);
-	} else if (atomic_read(&sdp->sd_unlinked_ic_count) >=
-		   gfs_tune_get(sdp, gt_ilimit1)) {
-		tries = gfs_tune_get(sdp, gt_ilimit1_tries);
-		min = gfs_tune_get(sdp, gt_ilimit1_min);
-	}
-
-	while (tries--) {
-		struct gfs_unlinked *ul = unlinked_find(sdp);
-		if (!ul)
-			break;
-
-		error = gfs_inode_dealloc(sdp, &ul->ul_inum);
-
-		gfs_unlinked_unlock(sdp, ul);
-
-		if (!error) {
-			if (!--min)
-				break;
-		} else if (error != 1)
-			break;
-	}
-}
-
-/**
- * gfs_unlinked_dealloc - Go through the list of inodes to be deallocated
- * @sdp: the filesystem
- *
- * Returns: errno
- */
-
-void
-gfs_unlinked_dealloc(struct gfs_sbd *sdp)
-{
-	unsigned int hits, strikes;
-	int error;
-
-	for (;;) {
-		hits = 0;
-		strikes = 0;
-
-		for (;;) {
-			struct gfs_unlinked *ul = unlinked_find(sdp);
-			if (!ul)
-				return;
-
-			error = gfs_inode_dealloc(sdp, &ul->ul_inum);
-
-			gfs_unlinked_unlock(sdp, ul);
-
-			if (!error) {
-				hits++;
-				if (strikes)
-					strikes--;
-			} else if (error == 1) {
-				strikes++;
-				if (strikes >= atomic_read(&sdp->sd_unlinked_ic_count)) {
-					error = 0;
-					break;
-				}
-			} else
-				goto out;
-		}
-
-		if (!hits || kthread_should_stop())
-			break;
-
-		cond_resched();
-	}
-
- out:
-	if (error &&
-	    error != -EROFS &&
-	    !test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-		printk("GFS: fsid=%s: error deallocating inodes: %d\n",
-		       sdp->sd_fsname, error);
-}
diff --git a/gfs-kernel/src/gfs/unlinked.h b/gfs-kernel/src/gfs/unlinked.h
deleted file mode 100644
index 1881bad..0000000
--- a/gfs-kernel/src/gfs/unlinked.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef __UNLINKED_DOT_H__
-#define __UNLINKED_DOT_H__
-
-struct gfs_unlinked *gfs_unlinked_get(struct gfs_sbd *sdp,
-				      struct gfs_inum *inum, int create);
-void gfs_unlinked_hold(struct gfs_sbd *sdp, struct gfs_unlinked *ul);
-void gfs_unlinked_put(struct gfs_sbd *sdp, struct gfs_unlinked *ul);
-
-void gfs_unlinked_lock(struct gfs_sbd *sdp, struct gfs_unlinked *ul);
-void gfs_unlinked_unlock(struct gfs_sbd *sdp, struct gfs_unlinked *ul);
-
-void gfs_unlinked_merge(struct gfs_sbd *sdp, unsigned int type,
-			struct gfs_inum *inum);
-void gfs_unlinked_cleanup(struct gfs_sbd *sdp);
-
-void gfs_unlinked_limit(struct gfs_sbd *sdp);
-void gfs_unlinked_dealloc(struct gfs_sbd *sdp);
-
-#endif /* __UNLINKED_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/util.c b/gfs-kernel/src/gfs/util.c
deleted file mode 100644
index 869e479..0000000
--- a/gfs-kernel/src/gfs/util.c
+++ /dev/null
@@ -1,590 +0,0 @@
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/buffer_head.h>
-#include <asm/uaccess.h>
-
-#include "gfs.h"
-#include "glock.h"
-#include "lm.h"
-#include "super.h"
-
-uint32_t gfs_random_number;
-
-struct kmem_cache *gfs_glock_cachep = NULL;
-struct kmem_cache *gfs_inode_cachep = NULL;
-struct kmem_cache *gfs_bufdata_cachep = NULL;
-struct kmem_cache *gfs_mhc_cachep = NULL;
-
-/**
- * gfs_random - Generate a random 32-bit number
- *
- * Generate a semi-crappy 32-bit pseudo-random number without using
- * floating point.
- *
- * The PRNG is from "Numerical Recipes in C" (second edition), page 284.
- *
- * Returns: a 32-bit random number
- */
-
-uint32_t
-gfs_random(void)
-{
-	gfs_random_number = 0x0019660D * gfs_random_number + 0x3C6EF35F;
-	return gfs_random_number;
-}
-
-/**
- * hash_more_internal - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- * @hash: the hash from a previous call
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * Hash guts
- *
- * Returns: the hash
- */
-
-static __inline__ uint32_t
-hash_more_internal(const void *data, unsigned int len, uint32_t hash)
-{
-	unsigned char *p = (unsigned char *)data;
-	unsigned char *e = p + len;
-	uint32_t h = hash;
-
-	while (p < e) {
-		h ^= (uint32_t)(*p++);
-		h *= 0x01000193;
-	}
-
-	return h;
-}
-
-/**
- * gfs_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * Returns: the hash
- */
-
-uint32_t
-gfs_hash(const void *data, unsigned int len)
-{
-	uint32_t h = 0x811C9DC5;
-	h = hash_more_internal(data, len, h);
-	return h;
-}
-
-/**
- * gfs_hash_more - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- * @hash: the hash from a previous call
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * This version let's you hash together discontinuous regions.
- * For example, to compute the combined hash of the memory in
- * (data1, len1), (data2, len2), and (data3, len3) you:
- *
- *   h = gfs_hash(data1, len1);
- *   h = gfs_hash_more(data2, len2, h);
- *   h = gfs_hash_more(data3, len3, h);
- *
- * Returns: the hash
- */
-
-uint32_t
-gfs_hash_more(const void *data, unsigned int len, uint32_t hash)
-{
-	uint32_t h;
-	h = hash_more_internal(data, len, hash);
-	return h;
-}
-
-/* Byte-wise swap two items of size SIZE. */
-
-#define SWAP(a, b, size) \
-do { \
-	register size_t __size = (size); \
-        register char *__a = (a), *__b = (b); \
-        do { \
-		char __tmp = *__a; \
-		*__a++ = *__b; \
-		*__b++ = __tmp; \
-	} while (__size-- > 1); \
-} while (0)
-
-/**
- * gfs_sort - Sort base array using shell sort algorithm
- * @base: the input array
- * @num_elem: number of elements in array
- * @size: size of each element in array
- * @compar: fxn to compare array elements (returns negative
- *          for lt, 0 for eq, and positive for gt
- *
- * Sorts the array passed in using the compar fxn to compare elements using
- * the shell sort algorithm
- */
-
-void
-gfs_sort(void *base, unsigned int num_elem, unsigned int size,
-	 int (*compar) (const void *, const void *))
-{
-	register char *pbase = (char *)base;
-	int i, j, k, h;
-	static int cols[16] = {1391376, 463792, 198768, 86961,
-			       33936, 13776, 4592, 1968,
-			       861, 336, 112, 48,
-			       21, 7, 3, 1};
-	
-	for (k = 0; k < 16; k++) {
-		h = cols[k];
-		for (i = h; i < num_elem; i++) {
-			j = i;
-			while (j >= h &&
-			       (*compar)((void *)(pbase + size * (j - h)),
-					 (void *)(pbase + size * j)) > 0) {
-				SWAP(pbase + size * j,
-				     pbase + size * (j - h),
-				     size);
-				j = j - h;
-			}
-		}
-	}
-}
-
-/**
- * gfs_assert_i - Cause the machine to panic if @assertion is false
- * @sdp:
- * @assertion:
- * @function:
- * @file:
- * @line:
- *
- */
-
-void
-gfs_assert_i(struct gfs_sbd *sdp,
-	     char *assertion,
-	     const char *function,
-	     char *file, unsigned int line)
-{
-	if (sdp->sd_args.ar_oopses_ok) {
-		printk("GFS: fsid=%s: assertion \"%s\" failed\n"
-		       "GFS: fsid=%s:   function = %s\n"
-		       "GFS: fsid=%s:   file = %s, line = %u\n"
-		       "GFS: fsid=%s:   time = %lu\n",
-		       sdp->sd_fsname, assertion,
-		       sdp->sd_fsname, function,
-		       sdp->sd_fsname, file, line,
-		       sdp->sd_fsname, get_seconds());
-		if (sdp->sd_args.ar_errors == GFS_ERRORS_WITHDRAW)
-			BUG();
-	}
-	dump_stack();
-	panic("GFS: fsid=%s: assertion \"%s\" failed\n"
-	      "GFS: fsid=%s:   function = %s\n"
-	      "GFS: fsid=%s:   file = %s, line = %u\n"
-	      "GFS: fsid=%s:   time = %lu\n",
-	      sdp->sd_fsname, assertion,
-	      sdp->sd_fsname, function,
-	      sdp->sd_fsname, file, line,
-	      sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gfs_assert_withdraw_i - Cause the machine to withdraw if @assertion is false
- * @sdp:
- * @assertion:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-int
-gfs_assert_withdraw_i(struct gfs_sbd *sdp,
-		      char *assertion,
-		      const char *function,
-		      char *file, unsigned int line)
-{
-	int me;
-	me = gfs_lm_withdraw(sdp,
-			     "GFS: fsid=%s: fatal: assertion \"%s\" failed\n"
-			     "GFS: fsid=%s:   function = %s\n"
-			     "GFS: fsid=%s:   file = %s, line = %u\n"
-			     "GFS: fsid=%s:   time = %lu\n",
-			     sdp->sd_fsname, assertion,
-			     sdp->sd_fsname, function,
-			     sdp->sd_fsname, file, line,
-			     sdp->sd_fsname, get_seconds());
-	return (me) ? -1 : -2;
-}
-
-/**
- * gfs_assert_warn_i - Print a message to the console if @assertion is false
- * @sdp:
- * @assertion:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if we printed something
- *          -2 if we didn't
- */
-
-int
-gfs_assert_warn_i(struct gfs_sbd *sdp,
-		  char *assertion,
-		  const char *function,
-		  char *file, unsigned int line)
-{
-	if (time_before(jiffies,
-			sdp->sd_last_warning +
-			gfs_tune_get(sdp, gt_complain_secs) * HZ))
-		return -2;
-
-	if (sdp->sd_args.ar_errors == GFS_ERRORS_WITHDRAW)
-		printk("GFS: fsid=%s: warning: assertion \"%s\" failed\n"
-		       "GFS: fsid=%s:   function = %s\n"
-		       "GFS: fsid=%s:   file = %s, line = %u\n"
-		       "GFS: fsid=%s:   time = %lu\n",
-		       sdp->sd_fsname, assertion,
-		       sdp->sd_fsname, function,
-		       sdp->sd_fsname, file, line,
-		       sdp->sd_fsname, get_seconds());
-
-	if (sdp->sd_args.ar_errors != GFS_ERRORS_WITHDRAW)
-		dump_stack();
-	sdp->sd_last_warning = jiffies;
-	if (sdp->sd_args.ar_debug)
-		BUG();
-	if (sdp->sd_args.ar_errors == GFS_ERRORS_PANIC)
-		panic("GFS: fsid=%s: assertion \"%s\" failed\n"
-		      "GFS: fsid=%s:   function = %s\n"
-		      "GFS: fsid=%s:   file = %s, line = %u\n"
-		      "GFS: fsid=%s:   time = %lu\n",
-		      sdp->sd_fsname, assertion,
-		      sdp->sd_fsname, function,
-		      sdp->sd_fsname, file, line,
-		      sdp->sd_fsname, get_seconds());
-
-	return -1;
-}
-
-/**
- * gfs_consist_i - Flag a filesystem consistency error and withdraw
- * @sdp:
- * @cluster_wide:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int
-gfs_consist_i(struct gfs_sbd *sdp, int cluster_wide,
-	      const char *function,
-	      char *file, unsigned int line)
-{
-	return gfs_lm_withdraw(sdp,
-			       "GFS: fsid=%s: fatal: filesystem consistency error\n"
-			       "GFS: fsid=%s:   function = %s\n"
-			       "GFS: fsid=%s:   file = %s, line = %u\n"
-			       "GFS: fsid=%s:   time = %lu\n",
-			       sdp->sd_fsname,
-			       sdp->sd_fsname, function,
-			       sdp->sd_fsname, file, line,
-			       sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gfs_consist_inode_i - Flag an inode consistency error and withdraw
- * @ip:
- * @cluster_wide:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int
-gfs_consist_inode_i(struct gfs_inode *ip, int cluster_wide,
-		    const char *function,
-		    char *file, unsigned int line)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-        return gfs_lm_withdraw(sdp,
-			       "GFS: fsid=%s: fatal: filesystem consistency error\n"
-			       "GFS: fsid=%s:   inode = %llu/%llu\n"
-			       "GFS: fsid=%s:   function = %s\n"
-			       "GFS: fsid=%s:   file = %s, line = %u\n"
-			       "GFS: fsid=%s:   time = %lu\n",
-			       sdp->sd_fsname,
-			       sdp->sd_fsname,
-			       (unsigned long long)ip->i_num.no_formal_ino,
-			       (unsigned long long)ip->i_num.no_addr,
-			       sdp->sd_fsname, function,
-			       sdp->sd_fsname, file, line,
-			       sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gfs_consist_rgrpd_i - Flag a RG consistency error and withdraw
- * @rgd:
- * @cluster_wide:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int
-gfs_consist_rgrpd_i(struct gfs_rgrpd *rgd, int cluster_wide,
-		    const char *function,
-		    char *file, unsigned int line)
-{
-        struct gfs_sbd *sdp = rgd->rd_sbd;
-        return gfs_lm_withdraw(sdp,
-			       "GFS: fsid=%s: fatal: filesystem consistency error\n"
-			       "GFS: fsid=%s:   RG = %llu\n"
-			       "GFS: fsid=%s:   function = %s\n"
-			       "GFS: fsid=%s:   file = %s, line = %u\n"
-			       "GFS: fsid=%s:   time = %lu\n",
-			       sdp->sd_fsname,
-			       sdp->sd_fsname,
-			       (unsigned long long)rgd->rd_ri.ri_addr,
-			       sdp->sd_fsname, function,
-			       sdp->sd_fsname, file, line,
-			       sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gfs_meta_check_ii - Flag a magic number consistency error and withdraw
- * @sdp:
- * @bh:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-int
-gfs_meta_check_ii(struct gfs_sbd *sdp, struct buffer_head *bh,
-                  const char *function,
-                  char *file, unsigned int line)
-{
-	int me;
-        me = gfs_lm_withdraw(sdp,
-			     "GFS: fsid=%s: fatal: invalid metadata block\n"
-			     "GFS: fsid=%s:   bh = %llu (magic)\n"
-			     "GFS: fsid=%s:   function = %s\n"
-			     "GFS: fsid=%s:   file = %s, line = %u\n"
-			     "GFS: fsid=%s:   time = %lu\n",
-			     sdp->sd_fsname,
-			     sdp->sd_fsname, (unsigned long long)bh->b_blocknr,
-			     sdp->sd_fsname, function,
-			     sdp->sd_fsname, file, line,
-			     sdp->sd_fsname, get_seconds());
-	return (me) ? -1 : -2;
-}
-
-/**
- * gfs_metatype_check_ii - Flag a metadata type consistency error and withdraw
- * @sdp:
- * @bh:
- * @type:
- * @t:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-int
-gfs_metatype_check_ii(struct gfs_sbd *sdp, struct buffer_head *bh,
-		      uint32_t type, uint32_t t,
-		      const char *function,
-		      char *file, unsigned int line)
-{
-	int me;
-        me = gfs_lm_withdraw(sdp,
-			     "GFS: fsid=%s: fatal: invalid metadata block\n"
-			     "GFS: fsid=%s:   bh = %llu (type: exp=%u, found=%u)\n"
-			     "GFS: fsid=%s:   function = %s\n"
-			     "GFS: fsid=%s:   file = %s, line = %u\n"
-			     "GFS: fsid=%s:   time = %lu\n",
-			     sdp->sd_fsname,
-			     sdp->sd_fsname, (unsigned long long)bh->b_blocknr,
-			     type, t, sdp->sd_fsname, function,
-			     sdp->sd_fsname, file, line,
-			     sdp->sd_fsname, get_seconds());
-	return (me) ? -1 : -2;
-}
-
-/**
- * gfs_io_error_i - Flag an I/O error and withdraw
- * @sdp:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int
-gfs_io_error_i(struct gfs_sbd *sdp,
-	       const char *function,
-	       char *file, unsigned int line)
-{
-        return gfs_lm_withdraw(sdp,
-			       "GFS: fsid=%s: fatal: I/O error\n"
-			       "GFS: fsid=%s:   function = %s\n"
-			       "GFS: fsid=%s:   file = %s, line = %u\n"
-			       "GFS: fsid=%s:   time = %lu\n",
-			       sdp->sd_fsname,
-			       sdp->sd_fsname, function,
-			       sdp->sd_fsname, file, line,
-			       sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gfs_io_error_inode_i - Flag an inode I/O error and withdraw
- * @ip:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int
-gfs_io_error_inode_i(struct gfs_inode *ip,
-		     const char *function,
-		     char *file, unsigned int line)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-        return gfs_lm_withdraw(sdp,
-			       "GFS: fsid=%s: fatal: I/O error\n"
-			       "GFS: fsid=%s:   inode = %llu/%llu\n"
-			       "GFS: fsid=%s:   function = %s\n"
-			       "GFS: fsid=%s:   file = %s, line = %u\n"
-			       "GFS: fsid=%s:   time = %lu\n",
-			       sdp->sd_fsname,
-			       sdp->sd_fsname,
-			       (unsigned long long)ip->i_num.no_formal_ino,
-			       (unsigned long long)ip->i_num.no_addr,
-			       sdp->sd_fsname, function,
-			       sdp->sd_fsname, file, line,
-			       sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gfs_io_error_bh_i - Flag a buffer I/O error and withdraw
- * @sdp:
- * @bh:
- * @function:
- * @file:
- * @line:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int
-gfs_io_error_bh_i(struct gfs_sbd *sdp, struct buffer_head *bh,
-		  const char *function,
-		  char *file, unsigned int line)
-{
-        return gfs_lm_withdraw(sdp,
-			       "GFS: fsid=%s: fatal: I/O error\n"
-			       "GFS: fsid=%s:   block = %llu\n"
-			       "GFS: fsid=%s:   function = %s\n"
-			       "GFS: fsid=%s:   file = %s, line = %u\n"
-			       "GFS: fsid=%s:   time = %lu\n",
-			       sdp->sd_fsname,
-			       sdp->sd_fsname,
-			       (unsigned long long)bh->b_blocknr,
-			       sdp->sd_fsname, function,
-			       sdp->sd_fsname, file, line,
-			       sdp->sd_fsname, get_seconds());
-}
-
-/**
- * gmalloc - malloc a small amount of memory
- * @size: the number of bytes to malloc
- *
- * Returns: the memory
- */
-
-void *
-gmalloc(unsigned int size)
-{
-	void *p;
-	RETRY_MALLOC(p = kmalloc(size, GFP_KERNEL), p);
-	return p;
-}
-
-/**
- * gfs_add_bh_to_ub - copy a buffer up to user space
- * @ub: the structure representing where to copy
- * @bh: the buffer
- *
- * Returns: errno
- */
-
-int
-gfs_add_bh_to_ub(struct gfs_user_buffer *ub, struct buffer_head *bh)
-{
-	uint64_t blkno = bh->b_blocknr;
-
-	if (ub->ub_count + sizeof(uint64_t) + bh->b_size > ub->ub_size)
-		return -ENOMEM;
-
-	if (copy_to_user(ub->ub_data + ub->ub_count,
-			  &blkno,
-			  sizeof(uint64_t)))
-		return -EFAULT;
-	ub->ub_count += sizeof(uint64_t);
-
-	if (copy_to_user(ub->ub_data + ub->ub_count,
-			  bh->b_data,
-			  bh->b_size))
-		return -EFAULT;
-	ub->ub_count += bh->b_size;
-
-	return 0;
-}
-
diff --git a/gfs-kernel/src/gfs/util.h b/gfs-kernel/src/gfs/util.h
deleted file mode 100644
index 4849f55..0000000
--- a/gfs-kernel/src/gfs/util.h
+++ /dev/null
@@ -1,330 +0,0 @@
-#ifndef __UTIL_DOT_H__
-#define __UTIL_DOT_H__
-
-
-/* Utility functions */
-
-extern uint32_t gfs_random_number;
-uint32_t gfs_random(void);
-
-uint32_t gfs_hash(const void *data, unsigned int len);
-uint32_t gfs_hash_more(const void *data, unsigned int len, uint32_t hash);
-
-void gfs_sort(void *base, unsigned int num_elem, unsigned int size,
-	      int (*compar) (const void *, const void *));
-
-
-/* Error handling */
-
-/**
- * gfs_assert - Cause the machine to panic if @assertion is false
- * @sdp:
- * @assertion:
- * @todo:
- *
- */
-
-void gfs_assert_i(struct gfs_sbd *sdp,
-                  char *assertion,
-                  const char *function,
-                  char *file, unsigned int line)
-__attribute__ ((noreturn));
-#define gfs_assert(sdp, assertion, todo) \
-do { \
-	if (unlikely(!(assertion))) { \
-		{todo} \
-		gfs_assert_i((sdp), #assertion, \
-			     __FUNCTION__, __FILE__, __LINE__); \
-	} \
-} while (0)
-
-/**
- * gfs_assert_withdraw - Cause the machine to withdraw if @assertion is false
- * @sdp:
- * @assertion:
- *
- * Returns: 0 if things are ok,
- *          -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-int gfs_assert_withdraw_i(struct gfs_sbd *sdp,
-			  char *assertion,
-			  const char *function,
-			  char *file, unsigned int line);
-#define gfs_assert_withdraw(sdp, assertion) \
-((likely(assertion)) ? 0 : \
- gfs_assert_withdraw_i((sdp), #assertion, \
-		       __FUNCTION__, __FILE__, __LINE__))
-
-/**
- * gfs_assert_warn - Print a message to the console if @assertion is false
- * @sdp:
- * @assertion:
- *
- * Returns: 0 if things are ok,
- *          -1 if we printed something
- *          -2 if we didn't
- */
-
-int gfs_assert_warn_i(struct gfs_sbd *sdp,
-		      char *assertion,
-		      const char *function,
-		      char *file, unsigned int line);
-#define gfs_assert_warn(sdp, assertion) \
-((likely(assertion)) ? 0 : \
- gfs_assert_warn_i((sdp), #assertion, \
-		   __FUNCTION__, __FILE__, __LINE__))
-
-/**
- * gfs_consist - Flag a filesystem consistency error and withdraw
- * gfs_cconsist - Flag a filesystem consistency error and withdraw cluster
- * @sdp:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int gfs_consist_i(struct gfs_sbd *sdp, int cluster_wide,
-		  const char *function,
-		  char *file, unsigned int line);
-#define gfs_consist(sdp)\
-gfs_consist_i((sdp), FALSE, __FUNCTION__, __FILE__, __LINE__)
-#define gfs_cconsist(sdp)\
-gfs_consist_i((sdp), TRUE, __FUNCTION__, __FILE__, __LINE__)
-
-/**
- * gfs_consist_inode - Flag an inode consistency error and withdraw
- * gfs_cconsist_inode - Flag an inode consistency error and withdraw cluster
- * @ip:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int gfs_consist_inode_i(struct gfs_inode *ip, int cluster_wide,
-			const char *function,
-			char *file, unsigned int line);
-#define gfs_consist_inode(ip) \
-gfs_consist_inode_i((ip), FALSE, __FUNCTION__, __FILE__, __LINE__)
-#define gfs_cconsist_inode(ip) \
-gfs_consist_inode_i((ip), TRUE, __FUNCTION__, __FILE__, __LINE__)
-
-/**
- * gfs_consist_rgrpd - Flag a RG consistency error and withdraw
- * gfs_cconsist_rgrpd - Flag a RG consistency error and withdraw cluster
- * @rgd:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int gfs_consist_rgrpd_i(struct gfs_rgrpd *rgd, int cluster_wide,
-			const char *function,
-			char *file, unsigned int line);
-#define gfs_consist_rgrpd(rgd) \
-gfs_consist_rgrpd_i((rgd), FALSE, __FUNCTION__, __FILE__, __LINE__)
-#define gfs_cconsist_rgrpd(rgd) \
-gfs_consist_rgrpd_i((rgd), TRUE, __FUNCTION__, __FILE__, __LINE__)
-
-/**
- * gfs_meta_check - Flag a magic number consistency error and withdraw
- * @sdp:
- * @bh:
- *
- * Returns: 0 if things are ok,
- *          -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-int gfs_meta_check_ii(struct gfs_sbd *sdp, struct buffer_head *bh,
-		      const char *function,
-		      char *file, unsigned int line);
-static __inline__ int
-gfs_meta_check_i(struct gfs_sbd *sdp, struct buffer_head *bh,
-		 const char *function,
-		 char *file, unsigned int line)
-{
-	uint32_t magic;
-	magic = ((struct gfs_meta_header *)(bh)->b_data)->mh_magic;
-	magic = gfs32_to_cpu(magic);
-	if (likely(magic == GFS_MAGIC))
-		return 0;
-	return gfs_meta_check_ii(sdp, bh, function, file, line);
-}
-#define gfs_meta_check(sdp, bh) \
-gfs_meta_check_i((sdp), (bh), \
-		 __FUNCTION__, __FILE__, __LINE__)
-
-/**
- * gfs_metatype_check - Flag a metadata type consistency error and withdraw
- * @sdp:
- * @bh:
- * @type:
- *
- * Returns: 0 if things are ok,
- *          -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-int gfs_metatype_check_ii(struct gfs_sbd *sdp, struct buffer_head *bh,
-			  uint32_t type, uint32_t t,
-			  const char *function,
-			  char *file, unsigned int line);
-static __inline__ int
-gfs_metatype_check_i(struct gfs_sbd *sdp, struct buffer_head *bh,
-		     uint32_t type,
-		     const char *function,
-		     char *file, unsigned int line)
-{
-        uint32_t magic, t;
-        magic = ((struct gfs_meta_header *)(bh)->b_data)->mh_magic;
-        magic = gfs32_to_cpu(magic);
-	if (unlikely(magic != GFS_MAGIC))
-		return gfs_meta_check_ii(sdp, bh, function, file, line);
-	t = ((struct gfs_meta_header *)(bh)->b_data)->mh_type;
-	t = gfs32_to_cpu(t);
-        if (unlikely(t != type))
-		return gfs_metatype_check_ii(sdp, bh, type, t, function, file, line);
-	return 0;
-}
-#define gfs_metatype_check(sdp, bh, type) \
-gfs_metatype_check_i((sdp), (bh), (type), \
-		     __FUNCTION__, __FILE__, __LINE__)
-
-/**
- * gfs_metatype_check2 - Flag a metadata type consistency error and withdraw
- * @sdp:
- * @bh:
- * @type1:
- * @type2:
- *
- * Returns: 0 if things are ok,
- *          -1 if this call withdrew the machine,
- *          -2 if it was already withdrawn
- */
-
-static __inline__ int
-gfs_metatype_check2_i(struct gfs_sbd *sdp, struct buffer_head *bh,
-		      uint32_t type1, uint32_t type2,
-		      const char *function,
-		      char *file, unsigned int line)
-{
-        uint32_t magic, t;
-        magic = ((struct gfs_meta_header *)(bh)->b_data)->mh_magic;
-        magic = gfs32_to_cpu(magic);
-        if (unlikely(magic != GFS_MAGIC))
-                return gfs_meta_check_ii(sdp, bh, function, file, line);
-        t = ((struct gfs_meta_header *)(bh)->b_data)->mh_type;
-        t = gfs32_to_cpu(t);
-        if (unlikely(t != type1 && t != type2))
-                return gfs_metatype_check_ii(sdp, bh, type1, t, function, file, line);
-        return 0;
-}
-#define gfs_metatype_check2(sdp, bh, type1, type2) \
-gfs_metatype_check2_i((sdp), (bh), (type1), (type2), \
-                     __FUNCTION__, __FILE__, __LINE__)
-
-/**
- * gfs_metatype_set - set the metadata type on a buffer
- * @bh:
- * @type:
- * @format:
- *
- */
-
-static __inline__ void
-gfs_metatype_set(struct buffer_head *bh, uint32_t type, uint32_t format)
-{
-	struct gfs_meta_header *mh;
-	mh = (struct gfs_meta_header *)bh->b_data;
-	mh->mh_type = cpu_to_gfs32(type);
-	mh->mh_format = cpu_to_gfs32(format);
-}
-
-/**
- * gfs_io_error - Flag an I/O error and withdraw
- * @sdp:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int gfs_io_error_i(struct gfs_sbd *sdp,
-		   const char *function,
-		   char *file, unsigned int line);
-#define gfs_io_error(sdp) \
-gfs_io_error_i((sdp), __FUNCTION__, __FILE__, __LINE__);
-
-/**
- * gfs_io_error_inode - Flag an inode I/O error and withdraw
- * @ip:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int gfs_io_error_inode_i(struct gfs_inode *ip,
-			 const char *function,
-			 char *file, unsigned int line);
-#define gfs_io_error_inode(ip) \
-gfs_io_error_inode_i((ip), __FUNCTION__, __FILE__, __LINE__);
-
-/**
- * gfs_io_error_bh - Flag a buffer I/O error and withdraw
- * @sdp:
- * @bh:
- *
- * Returns: -1 if this call withdrew the machine,
- *          0 if it was already withdrawn
- */
-
-int gfs_io_error_bh_i(struct gfs_sbd *sdp, struct buffer_head *bh,
-		      const char *function,
-		      char *file, unsigned int line);
-#define gfs_io_error_bh(sdp, bh) \
-gfs_io_error_bh_i((sdp), (bh), __FUNCTION__, __FILE__, __LINE__);
-
-
-/* Memory stuff */
-
-#define RETRY_MALLOC(do_this, until_this) \
-for (;;) { \
-	{ do_this; } \
-	if (until_this) \
-		break; \
-	printk("GFS: out of memory: %s, %u\n", __FILE__, __LINE__); \
-	dump_stack(); \
-	yield(); \
-}
-
-extern struct kmem_cache *gfs_glock_cachep;
-extern struct kmem_cache *gfs_inode_cachep;
-extern struct kmem_cache *gfs_bufdata_cachep;
-extern struct kmem_cache *gfs_mhc_cachep;
-
-void *gmalloc(unsigned int size);
-
-
-struct gfs_user_buffer {
-	char *ub_data;
-	unsigned int ub_size;
-	unsigned int ub_count;
-};
-int gfs_add_bh_to_ub(struct gfs_user_buffer *ub, struct buffer_head *bh);
-
-
-static __inline__ unsigned int
-gfs_tune_get_i(struct gfs_tune *gt, unsigned int *p)
-{
-	unsigned int x;
-	spin_lock(&gt->gt_spin);
-	x = *p;
-	spin_unlock(&gt->gt_spin);
-	return x;
-}
-#define gfs_tune_get(sdp, field) \
-gfs_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)
-
-
-#endif /* __UTIL_DOT_H__ */
diff --git a/gfs/Makefile b/gfs/Makefile
deleted file mode 100644
index 510e181..0000000
--- a/gfs/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-include ../make/defines.mk
-
-SUBDIRS=libgfs gfs_debug gfs_fsck gfs_grow gfs_jadd gfs_mkfs gfs_quota gfs_tool man init.d
-
-all: ${SUBDIRS}
-
-%:
-	set -e && \
-	for i in ${SUBDIRS}; do \
-		${MAKE} -C $$i $@; \
-	done; \
-	if [ "$@" = "install" ]; then \
-		mkdir -p ${DESTDIR}/sbin; \
-		cd ${DESTDIR}/sbin; \
-			ln -sf mount.gfs2 mount.gfs; \
-		mkdir -p ${sbindir}; \
-		cd ${sbindir}; \
-			ln -sf gfs2_edit gfs_edit; \
-	fi; \
-	if [ "$@" = "uninstall" ]; then \
-		cd ${DESTDIR}/sbin; rm -f mount.gfs; \
-		cd ${sbindir}; rm -f gfs_edit; \
-	fi
diff --git a/gfs/gfs_debug/Makefile b/gfs/gfs_debug/Makefile
deleted file mode 100644
index 29ce963..0000000
--- a/gfs/gfs_debug/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-TARGET= gfs_debug
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	block_device.o \
-	basic.o \
-	main.o \
-	ondisk.o \
-	readfile.o \
-	util.o
-
-CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${gfskincdir}
-CFLAGS += -I$(S)/../include
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_debug/basic.c b/gfs/gfs_debug/basic.c
deleted file mode 100644
index 8422767..0000000
--- a/gfs/gfs_debug/basic.c
+++ /dev/null
@@ -1,436 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-#include "linux_endian.h"
-
-#include "gfs_debug.h"
-#include "basic.h"
-#include "block_device.h"
-
-/**
- * verify_block_size -
- * @bsize:
- *
- */
-
-static int
-verify_block_size(unsigned int bsize)
-{
-	unsigned int x = 512;
-
-	for (;;) {
-		if (!x)
-			return -1;
-		if (x == bsize)
-			return 0;
-		x <<= 1;
-	}
-}
-
-/**
- * verify_gfs -
- *
- */
-
-void
-verify_gfs(void)
-{
-	char buf[GFS_BASIC_BLOCK];
-	struct gfs_sb sb;
-
-	if (device_size < (GFS_SB_ADDR + 1) * GFS_BASIC_BLOCK)
-		return;
-
-	do_lseek(device_fd, GFS_SB_ADDR * GFS_BASIC_BLOCK);
-	do_read(device_fd, buf, GFS_BASIC_BLOCK);
-
-	gfs_sb_in(&sb, buf);
-
-	if (sb.sb_header.mh_magic != GFS_MAGIC ||
-	    sb.sb_header.mh_type != GFS_METATYPE_SB ||
-	    sb.sb_bsize != 1 << sb.sb_bsize_shift ||
-	    verify_block_size(sb.sb_bsize))
-		return;
-
-	if (!block_size || block_size == sb.sb_bsize) {
-		unsigned int x;
-
-		is_gfs = TRUE;
-		block_size = sb.sb_bsize;
-		block_size_shift = sb.sb_bsize_shift;
-
-		sd_diptrs = (block_size - sizeof(struct gfs_dinode)) / sizeof(uint64_t);
-		sd_inptrs = (block_size - sizeof(struct gfs_indirect)) / sizeof(uint64_t);
-		sd_jbsize = block_size - sizeof(struct gfs_meta_header);
-		sd_hash_bsize = block_size / 2;
-		sd_hash_ptrs = sd_hash_bsize / sizeof(uint64_t);
-
-		sd_heightsize[0] = block_size - sizeof(struct gfs_dinode);
-		sd_heightsize[1] = block_size * sd_diptrs;
-		for (x = 2;; x++) {
-			uint64_t space = sd_heightsize[x - 1] * sd_inptrs;
-			uint64_t d = space / sd_inptrs;
-			uint32_t m = space % sd_inptrs;
-
-			if (d != sd_heightsize[x - 1] || m)
-				break;
-			sd_heightsize[x] = space;
-		}
-		sd_max_height = x;
-
-		sd_jheightsize[0] = block_size - sizeof(struct gfs_dinode);
-		sd_jheightsize[1] = sd_jbsize * sd_diptrs;
-		for (x = 2;; x++) {
-			uint64_t space = sd_jheightsize[x - 1] * sd_inptrs;
-			uint64_t d = space / sd_inptrs;
-			uint32_t m = space % sd_inptrs;
-
-			if (d != sd_jheightsize[x - 1] || m)
-				break;
-			sd_jheightsize[x] = space;
-		}
-		sd_max_jheight = x;
-	}
-}
-
-/**
- * must_be_gfs -
- *
- */
-
-void
-must_be_gfs(void)
-{
-	if (!is_gfs)
-		die("not a gfs filesystem\n");
-}
-
-/**
- * scan_device -
- *
- */
-
-void
-scan_device(void)
-{
-	char data[GFS_BASIC_BLOCK];
-	uint64_t bb;
-	struct gfs_meta_header mh;
-
-	for (bb = 0; (bb + 1) * GFS_BASIC_BLOCK <= device_size; bb++) {
-		do_lseek(device_fd, bb * GFS_BASIC_BLOCK);
-		do_read(device_fd, data, GFS_BASIC_BLOCK);
-		gfs_meta_header_in(&mh, data);
-
-		if (mh.mh_magic == GFS_MAGIC &&
-		    mh.mh_type && mh.mh_type <= GFS_METATYPE_EA)
-			printf("sector %"PRIu64": type %u\n",
-			       bb, mh.mh_type);
-	}
-}
-
-/**
- * print_superblock -
- *
- */
-
-void
-print_superblock(void)
-{
-	char *data;
-	struct gfs_sb sb;
-
-	must_be_gfs();
-
-	data = get_block(GFS_SB_ADDR * GFS_BASIC_BLOCK / block_size, TRUE);
-	gfs_sb_in(&sb, data);
-	free(data);
-
-	gfs_sb_print(&sb);
-}
-
-/**
- * print_bitmaps -
- * @data:
- * @offset:
- *
- */
-
-static void
-print_bitmaps(char *data, unsigned int offset)
-{
-	unsigned int bn = 0;
-	unsigned int bit;
-	unsigned char value;
-	const char *type;
-
-	printf("\n");
-
-	for (; offset < block_size; offset++) {
-		for (bit = 0; bit < GFS_NBBY; bit++) {
-			value = data[offset];
-			value = (value >> (bit * GFS_BIT_SIZE)) & GFS_BIT_MASK;
-			switch (value) {
-			case GFS_BLKST_FREE:
-				type = "free";
-				break;
-			case GFS_BLKST_USED:
-				type = "used data";
-				break;
-			case GFS_BLKST_FREEMETA:
-				type = "free meta";
-				break;
-			case GFS_BLKST_USEDMETA:
-				type = "used meta";
-				break;
-			default:
-				ASSERT(FALSE,);
-			}
-			printf("  block %u: %s\n", bn, type);
-			bn++;
-		}
-	}
-}
-
-/**
- * print_stuffed_hash -
- * @data:
- *
- */
-
-static void
-print_stuffed_hash(char *data)
-{
-	uint64_t *p = (uint64_t *)(data + sizeof(struct gfs_dinode));
-	uint64_t *end = (uint64_t *)(((char *)p) + block_size / 2);
-	uint64_t this, last = 0;
-	unsigned int run = 0;
-	int first = TRUE;
-
-	printf("\n");
-
-	for (; p < end; p++) {
-		this = gfs64_to_cpu(*p);
-
-		if (first) {
-			first = FALSE;
-			run = 1;
-		} else {
-			if (this == last)
-				run++;
-			else {
-				printf("  pointer: %"PRIu64" (%u)\n",
-				       last, run);
-				run = 1;
-			}
-		}
-			
-		last = this;
-	}
-
-	printf("  pointer: %"PRIu64" (%u)\n",
-	       last, run);
-}
-
-/**
- * print_dirents -
- * @data:
- * @offset:
- *
- * Make this more robust
- *
- */
-
-void
-print_dirents(char *data, unsigned int offset)
-{
-	struct gfs_dirent de;
-
-	for (; offset < block_size; offset += de.de_rec_len) {
-		printf("\n");
-		gfs_dirent_in(&de, data + offset);
-
-		if (sizeof(struct gfs_dirent) + de.de_name_len > de.de_rec_len)
-			continue;
-		if (offset + sizeof(struct gfs_dirent) + de.de_name_len > block_size)
-			break;
-		if (de.de_inum.no_formal_ino)
-			gfs_dirent_print(&de, data + offset + sizeof(struct gfs_dirent));
-	}
-}
-
-/**
- * print_pointers -
- * @data:
- * @offset:
- *
- */
-
-static void
-print_pointers(char *data, unsigned int offset)
-{
-	uint64_t *p = (uint64_t *)(data + offset);
-	uint64_t *end = (uint64_t *)(data + block_size);
-	unsigned int x = 0;
-
-	printf("\n");
-
-	for (; p < end; p++, x++)
-		if (*p)
-			printf("  pointer #%u: %"PRIu64"\n",
-			       x, gfs64_to_cpu(*p));
-}
-
-/**
- * identify_block -
- *
- */
-
-void
-identify_block(void)
-{
-	char *data;
-	struct gfs_meta_header mh;
-
-	must_be_gfs();
-
-	data = get_block(block_number, TRUE);
-	gfs_meta_header_in(&mh, data);
-
-	if (mh.mh_magic != GFS_MAGIC) {
-		printf("Not GFS metadata\n");
-		free(data);
-		return;
-	}
-
-	switch (mh.mh_type) {
-	case GFS_METATYPE_NONE:
-		printf("GFS_METATYPE_NONE\n");
-		break;
-
-	case GFS_METATYPE_SB:
-		printf("Super\n");
-		if (verbose) {
-			struct gfs_sb sb;
-			gfs_sb_in(&sb, data);
-			gfs_sb_print(&sb);
-		}
-		break;
-
-	case GFS_METATYPE_RG:
-		printf("Resource Group Header\n");
-		if (verbose) {
-			struct gfs_rgrp rg;
-			gfs_rgrp_in(&rg, data);
-			gfs_rgrp_print(&rg);
-			if (verbose > 1)
-				print_bitmaps(data, sizeof(struct gfs_rgrp));
-		}
-		break;
-
-	case GFS_METATYPE_RB:
-		printf("Resource Group Bitmap\n");
-		if (verbose) {
-			gfs_meta_header_print(&mh);
-			if (verbose > 1)
-				print_bitmaps(data, sizeof(struct gfs_meta_header));
-		}
-		break;
-
-	case GFS_METATYPE_DI:
-		printf("Dinode\n");
-		if (verbose) {
-			struct gfs_dinode di;
-			gfs_dinode_in(&di, data);
-			gfs_dinode_print(&di);
-			if (verbose > 1) {
-				if (di.di_height)
-					print_pointers(data, sizeof(struct gfs_dinode));
-				else {
-					if (di.di_type == GFS_FILE_REG)
-						printf("\n  stuffed data\n");
-					else if (di.di_type == GFS_FILE_DIR &&
-						(di.di_flags & GFS_DIF_EXHASH))
-						print_stuffed_hash(data);
-					else if (di.di_type == GFS_FILE_DIR)
-						print_dirents(data, sizeof(struct gfs_dinode));
-					else if (di.di_type == GFS_FILE_LNK)
-						printf("\nsymlink to %s\n",
-						       data + sizeof(struct gfs_dinode));
-				}
-			}
-		}
-		break;
-
-	case GFS_METATYPE_IN:
-		printf("Indirect\n");
-		if (verbose) {
-			struct gfs_indirect in;
-			gfs_indirect_in(&in, data);
-			gfs_indirect_print(&in);
-			if (verbose > 1) {
-				print_pointers(data, sizeof(struct gfs_indirect));
-			}
-		}
-		break;
-
-	case GFS_METATYPE_LF:
-		printf("Directory Leaf\n");
-		if (verbose) {
-			struct gfs_leaf lf;
-			gfs_leaf_in(&lf, data);
-			gfs_leaf_print(&lf);
-			if (verbose > 1)
-				print_dirents(data, sizeof(struct gfs_leaf));
-		}
-		break;
-
-	case GFS_METATYPE_JD:
-		printf("Journaled Data\n");
-		if (verbose)
-			gfs_meta_header_print(&mh);
-		break;
-
-	case GFS_METATYPE_LH:
-		printf("Log Header\n");
-		if (verbose) {
-			struct gfs_log_header lh;
-			gfs_log_header_in(&lh, data);
-			gfs_log_header_print(&lh);
-		}
-		break;
-
-	case GFS_METATYPE_LD:
-		printf("Lock Descriptor\n");
-		if (verbose) {
-			struct gfs_log_descriptor ld;
-			gfs_desc_in(&ld, data);
-			gfs_desc_print(&ld);
-		}
-		break;
-
-	case GFS_METATYPE_EA:
-		printf("Extended Attribute\n");
-		if (verbose)
-			gfs_meta_header_print(&mh);
-		break;
-
-	default:
-		printf("Unknown metadata type\n");
-		if (verbose)
-			gfs_meta_header_print(&mh);
-		break;
-	}
-
-	free(data);
-}
-
diff --git a/gfs/gfs_debug/basic.h b/gfs/gfs_debug/basic.h
deleted file mode 100644
index 56d4a77..0000000
--- a/gfs/gfs_debug/basic.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __BASIC_DOT_H__
-#define __BASIC_DOT_H__
-
-
-EXTERN unsigned int sd_diptrs INIT(0);
-EXTERN unsigned int sd_inptrs INIT(0);
-EXTERN unsigned int sd_jbsize INIT(0);
-EXTERN unsigned int sd_hash_bsize INIT(0);
-EXTERN unsigned int sd_hash_ptrs INIT(0);
-EXTERN uint32_t sd_max_height INIT(0);
-EXTERN uint64_t sd_heightsize[GFS_MAX_META_HEIGHT];
-EXTERN uint32_t sd_max_jheight INIT(0);
-EXTERN uint64_t sd_jheightsize[GFS_MAX_META_HEIGHT];
-
-
-void verify_gfs(void);
-void must_be_gfs(void);
-void scan_device(void);
-void print_superblock(void);
-void identify_block(void);
-
-void print_dirents(char *data, unsigned int offset);
-
-
-#endif /* __BASIC_DOT_H__ */
-
diff --git a/gfs/gfs_debug/block_device.c b/gfs/gfs_debug/block_device.c
deleted file mode 100644
index 8640f6f..0000000
--- a/gfs/gfs_debug/block_device.c
+++ /dev/null
@@ -1,117 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_debug.h"
-#include "block_device.h"
-
-/**
- * find_device_size -
- *
- */
-
-void
-find_device_size(void)
-{
-	device_size = lseek(device_fd, 0, SEEK_END);
-	if (device_size < 0)
-		die("can't determine device size: %s\n",
-		    strerror(errno));
-}
-
-/**
- * get_block -
- * @bn:
- * @fatal:
- *
- * Returns: the data in the block (needs to be freed)
- */
-
-char *
-get_block(uint64_t bn, int fatal)
-{
-	char *data;
-
-	if (device_size < (bn + 1) * block_size) {
-		fprintf(stderr, "%s: block %"PRIu64" is off the end of the device\n",
-			prog_name, bn);
-		if (fatal)
-			exit(EXIT_FAILURE);
-	}
-
-	data = malloc(block_size);
-	if (!data)
-		die("out of memory (%s, %u)\n",
-		    __FILE__, __LINE__);
-
-	do_lseek(device_fd, bn * block_size);
-	do_read(device_fd, data, block_size);
-
-	return data;
-}
-
-/**
- * print_size -
- *
- */
-
-void
-print_size(void)
-{
-	printf("%"PRIu64"\n", device_size);
-}
-
-/**
- * print_hexblock -
- *
- */
-
-void
-print_hexblock(void)
-{
-	char *data;
-	unsigned int x;
-
-	if (!block_size)
-		die("no block size set\n");
-
-	data = get_block(block_number, TRUE);
-
-	for (x = 0; x < block_size; x++) {
-		printf("%.2X", ((unsigned char *)data)[x]);
-		if (x % 16 == 15)
-			printf("\n");
-		else
-			printf(" ");
-	}
-
-	if (x % 16)
-		printf("\n");
-
-	free(data);
-}
-
-/**
- * print_rawblock -
- *
- */
-
-void
-print_rawblock(void)
-{
-	char *data;
-
-	if (!block_size)
-		die("no block size set\n");
-
-	data = get_block(block_number, TRUE);
-	do_write(STDOUT_FILENO, data, block_size);
-	free(data);
-}
diff --git a/gfs/gfs_debug/block_device.h b/gfs/gfs_debug/block_device.h
deleted file mode 100644
index 6af5437..0000000
--- a/gfs/gfs_debug/block_device.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __BLOCK_DEVICE_DOT_H__
-#define __BLOCK_DEVICE_DOT_H__
-
-
-void find_device_size(void);
-char *get_block(uint64_t bn, int fatal);
-
-void print_size(void);
-void print_hexblock(void);
-void print_rawblock(void);
-
-
-#endif /* __BLOCK_DEVICE_DOT_H__ */
-
diff --git a/gfs/gfs_debug/gfs_debug.h b/gfs/gfs_debug/gfs_debug.h
deleted file mode 100644
index 2f675b2..0000000
--- a/gfs/gfs_debug/gfs_debug.h
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef __GFS_DEBUG_DOT_H__
-#define __GFS_DEBUG_DOT_H__
-
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef EXTERN
-#define EXTERN extern
-#define INIT(X)
-#else
-#undef EXTERN
-#define EXTERN
-#define INIT(X) =X 
-#endif
-
-
-#define die(fmt, args...) \
-do { \
-	fprintf(stderr, "%s: ", prog_name); \
-	fprintf(stderr, fmt, ##args); \
-	exit(EXIT_FAILURE); \
-} while (0)
-
-#define ASSERT(x, todo) \
-do { \
-	if (!(x)) { \
-		{todo} \
-		die("assertion failed on line %d of file %s\n", \
-		    __LINE__, __FILE__); \
-	} \
-} while (0)
-
-EXTERN char *prog_name;
-
-#define do_lseek(fd, off) \
-do { \
-	if (lseek((fd), (off), SEEK_SET) != (off)) \
-		die("bad seek on line %d of file %s: %s\n", \
-		    __LINE__, __FILE__, strerror(errno)); \
-} while (0)
-
-#define do_read(fd, buff, len) \
-do { \
-	if (read((fd), (buff), (len)) != (len)) \
-		die("bad read on line %d of file %s: %s\n", \
-		    __LINE__, __FILE__, strerror(errno)); \
-} while (0)
-
-#define do_write(fd, buff, len) \
-do { \
-	if (write((fd), (buff), (len)) != (len)) \
-		die("bad write on line %d of file %s: %s\n", \
-		    __LINE__, __FILE__, strerror(errno)); \
-} while (0)
-
-#define DIV_RU(x, y) (((x) + (y) - 1) / (y))
-
-
-/* Command line arguments */
-
-EXTERN unsigned int verbose INIT(0);
-
-EXTERN char *action INIT(NULL);
-
-EXTERN char *device INIT(NULL);
-EXTERN int device_fd INIT(-1);
-EXTERN off_t device_size INIT(-1);
-
-EXTERN int is_gfs INIT(FALSE);
-EXTERN unsigned int block_size INIT(0);
-EXTERN unsigned int block_size_shift INIT(0);
-
-EXTERN uint64_t block_number INIT(0);
-
-
-#endif /* __GFS_DEBUG_DOT_H__ */
-
diff --git a/gfs/gfs_debug/main.c b/gfs/gfs_debug/main.c
deleted file mode 100644
index b42d34a..0000000
--- a/gfs/gfs_debug/main.c
+++ /dev/null
@@ -1,179 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-#include "copyright.cf"
-
-#define EXTERN
-#include "gfs_debug.h"
-#include "basic.h"
-#include "block_device.h"
-#include "readfile.h"
-
-/**
- * print_usage - print out usage information
- *
- */
-
-static void
-print_usage(void)
-{
-	printf("Usage:\n");
-	printf("\n");
-	printf("%s [options] <action>\n", prog_name);
-	printf("\n");
-	printf("Actions:\n");
-	printf("  size             print the device size\n");
-	printf("  hexread          print a block in hex\n");
-	printf("  rawread          print a block raw\n");
-	printf("\n");
-	printf("GFS-specific Actions:\n");
-	printf("  scan             scan the device looking for GFS blocks\n");
-	printf("  identify         identify the contents of a block\n");
-	printf("  sb               print superblock\n");
-	printf("  jindex           print journal index\n");
-	printf("  rindex           print resource index\n");
-	printf("  quota            print quota file\n");
-	printf("  root             print root directory\n");
-	printf("  readfile         print the contents of a file\n");
-	printf("  readdir          print the contents of a directory\n");
-	printf("\n");
-	printf("Options:\n");
-	printf("\n");
-	printf("  -B <bytes>       Set the block size\n");
-	printf("  -b <number>      Block number\n");
-	printf("  -d <device>      Device to look at\n");
-	printf("  -h               Print this help, then exit\n");
-	printf("  -v               Verbose\n");
-	printf("  -V               Print program version information, then exit\n");
-}
-
-/**
- * decode_arguments -
- * @argc:
- * @argv:
- *
- */
-
-static void
-decode_arguments(int argc, char *argv[])
-{
-	int cont = TRUE;
-	int optchar;
-
-	while (cont) {
-		optchar = getopt(argc, argv, "B:b:d:hVv");
-
-		switch (optchar) {
-		case 'B':
-			sscanf(optarg, "%u", &block_size);
-			if (!block_size)
-				die("can't have a zero block size\n");
-			break;
-
-		case 'b':
-			sscanf(optarg, "%"SCNu64, &block_number);
-			break;
-
-		case 'd':
-			device = optarg;
-			break;
-
-		case 'h':
-			print_usage();
-			exit(EXIT_SUCCESS);
-
-		case 'V':
-			printf("gfs_mkfs %s (built %s %s)\n", RELEASE_VERSION, __DATE__, __TIME__);
-			printf("%s\n", REDHAT_COPYRIGHT);
-			exit(EXIT_SUCCESS);
-
-		case 'v':
-			verbose++;
-			break;
-
-		case EOF:
-			cont = FALSE;
-			break;
-
-		default:
-			die("unknown option: %c\n", optchar);
-		};
-	}
-
-	if (optind < argc) {
-		action = argv[optind];
-		optind++;
-	} else
-		die("no action specified\n");
-
-	if (optind < argc) 
-		die("Unrecognized option: %s\n", argv[optind]);
-
-	if (!device)
-		die("no device specified\n");
-}
-
-/**
- * main - 
- * @argc:
- * @argv:
- *
- * Returns: exit status
- */
-
-int
-main(int argc, char *argv[])
-{
-	prog_name = argv[0];
-
-	decode_arguments(argc, argv);
-
-	device_fd = open(device, O_RDWR);
-	if (device_fd < 0)
-		die("can't open device %s: %s\n",
-		    device, strerror(errno));
-
-	find_device_size();
-	verify_gfs();
-
-	if (!strcmp(action, "size"))
-		print_size();
-	else if (!strcmp(action, "hexread"))
-		print_hexblock();
-	else if (!strcmp(action, "rawread"))
-		print_rawblock();
-	else if (!strcmp(action, "scan"))
-		scan_device();
-	else if (!strcmp(action, "identify"))
-		identify_block();
-	else if (!strcmp(action, "sb"))
-		print_superblock();
-	else if (!strcmp(action, "jindex"))
-		print_jindex();
-	else if (!strcmp(action, "rindex"))
-		print_rindex();
-	else if (!strcmp(action, "quota"))
-		print_quota();
-	else if (!strcmp(action, "root"))
-		print_root();
-	else if (!strcmp(action, "readfile"))
-		readfile();
-	else if (!strcmp(action, "readdir"))
-		readdir();
-	else
-		die("unknown action %s\n", action);
-		
-	close(device_fd);
-
-	exit(EXIT_SUCCESS);
-}
-
diff --git a/gfs/gfs_debug/ondisk.c b/gfs/gfs_debug/ondisk.c
deleted file mode 100644
index 248cb77..0000000
--- a/gfs/gfs_debug/ondisk.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#define ENTER(x)
-#define EXIT(x)
-#define RET(x) return
-#define RETURN(x, y) return y
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
-
diff --git a/gfs/gfs_debug/readfile.c b/gfs/gfs_debug/readfile.c
deleted file mode 100644
index 75e9c66..0000000
--- a/gfs/gfs_debug/readfile.c
+++ /dev/null
@@ -1,236 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-#include "linux_endian.h"
-
-#include "gfs_debug.h"
-#include "basic.h"
-#include "block_device.h"
-#include "readfile.h"
-#include "util.h"
-
-void
-print_jindex(void)
-{
-	struct gfs_sb sb;
-	struct gfs_dinode di;
-	struct gfs_jindex ji;
-	char *data;
-	char buf[sizeof(struct gfs_jindex)];
-	uint64_t o;
-	unsigned int x;
-	int error;
-
-	must_be_gfs();
-
-	data = get_block(GFS_SB_ADDR * GFS_BASIC_BLOCK / block_size, TRUE);
-	gfs_sb_in(&sb, data);
-	free(data);
-
-	data = get_block(sb.sb_jindex_di.no_addr, TRUE);
-	gfs_dinode_in(&di, data);
-	free(data);
-
-	if (di.di_size % sizeof(struct gfs_jindex))
-		fprintf(stderr, "%s: strange size for journal index %"PRIu64"\n",
-			prog_name, di.di_size);
-
-	for (o = 0, x = 0;; o += sizeof(struct gfs_jindex), x++) {
-		error = gfs_readi(&di, buf, o, sizeof(struct gfs_jindex));
-		if (!error)
-			break;
-		if (error < sizeof(struct gfs_jindex))
-			continue;
-		gfs_jindex_in(&ji, buf);
-		printf("Journal %u:\n", x);
-		gfs_jindex_print(&ji);
-		printf("\n");
-	}
-}
-
-void
-print_rindex(void)
-{
-	struct gfs_sb sb;
-	struct gfs_dinode di;
-	struct gfs_rindex ri;
-	char *data;
-	char buf[sizeof(struct gfs_rindex)];
-	uint64_t o;
-	unsigned int x;
-	int error;
-
-	must_be_gfs();
-
-	data = get_block(GFS_SB_ADDR * GFS_BASIC_BLOCK / block_size, TRUE);
-	gfs_sb_in(&sb, data);
-	free(data);
-
-	data = get_block(sb.sb_rindex_di.no_addr, TRUE);
-	gfs_dinode_in(&di, data);
-	free(data);
-
-	if (di.di_size % sizeof(struct gfs_rindex))
-		fprintf(stderr, "%s: strange size for resource index %"PRIu64"\n",
-			prog_name, di.di_size);
-
-	for (o = 0, x = 0;; o += sizeof(struct gfs_rindex), x++) {
-		error = gfs_readi(&di, buf, o, sizeof(struct gfs_rindex));
-		if (!error)
-			break;
-		if (error < sizeof(struct gfs_rindex))
-			continue;
-		gfs_rindex_in(&ri, buf);
-		printf("Resource Group %u:\n", x);
-		gfs_rindex_print(&ri);
-		printf("\n");
-	}
-}
-
-void
-print_quota(void)
-{
-	struct gfs_sb sb;
-	struct gfs_dinode di;
-	struct gfs_quota qu;
-	char *data;
-	char buf[sizeof(struct gfs_quota)];
-	uint64_t o;
-	unsigned int x;
-	int error;
-
-	must_be_gfs();
-
-	data = get_block(GFS_SB_ADDR * GFS_BASIC_BLOCK / block_size, TRUE);
-	gfs_sb_in(&sb, data);
-	free(data);
-
-	data = get_block(sb.sb_quota_di.no_addr, TRUE);
-	gfs_dinode_in(&di, data);
-	free(data);
-
-	for (o = 0, x = 0;; o += sizeof(struct gfs_quota), x++) {
-		error = gfs_readi(&di, buf, o, sizeof(struct gfs_quota));
-		if (!error)
-			break;
-		if (error < 0)
-			continue;
-		gfs_quota_in(&qu, buf);
-
-		if (!qu.qu_limit && !qu.qu_warn && !qu.qu_value)
-			continue;
-
-		printf("Quota (%s, %u):\n", (x % 2) ? "group" : "user", x / 2);
-		gfs_quota_print(&qu);
-		printf("\n");
-	}
-}
-
-void
-print_root(void)
-{
-	struct gfs_sb sb;
-	char *data;
-
-	must_be_gfs();
-
-	data = get_block(GFS_SB_ADDR * GFS_BASIC_BLOCK / block_size, TRUE);
-	gfs_sb_in(&sb, data);
-	free(data);
-
-	block_number = sb.sb_root_di.no_addr;
-
-	readdir();
-}
-
-#define CHUNKSIZE (65536)
-
-void
-readfile(void)
-{
-	struct gfs_dinode di;
-	char *data;
-	char buf[CHUNKSIZE];
-	uint64_t o = 0;
-	int error, rc;
-
-	must_be_gfs();
-
-	data = get_block(block_number, TRUE);
-	gfs_dinode_in(&di, data);
-	free(data);
-
-	if (di.di_header.mh_magic != GFS_MAGIC ||
-	    di.di_header.mh_type != GFS_METATYPE_DI)
-		die("block %"PRIu64" isn't an inode\n",
-		    block_number);
-
-	if (di.di_type != GFS_FILE_REG)
-		die("block %"PRIu64" isn't a regular file\n",
-		    block_number);
-
-	for (;;) {
-		error = gfs_readi(&di, buf, o, CHUNKSIZE);
-		if (error <= 0)
-			break;
-		rc = write(STDOUT_FILENO, buf, error);
-		o += error;
-	}
-}
-
-static void
-do_readdir(struct gfs_dinode *di, char *data,
-	   uint32_t lindex, uint32_t len, uint64_t leaf_no,
-	   void *opaque)
-{
-	struct gfs_leaf leaf;
-
-	print_dirents(data, sizeof(struct gfs_leaf));
-	gfs_leaf_in(&leaf, data);
-
-	while (leaf.lf_next) {
-		data = get_block(leaf.lf_next, FALSE);
-		if (!data)
-			return;
-		print_dirents(data, sizeof(struct gfs_leaf));
-		gfs_leaf_in(&leaf, data);
-		free(data);
-	}
-}
-
-void
-readdir(void)
-{
-	struct gfs_dinode di;
-	char *data;
-
-	must_be_gfs();
-
-	data = get_block(block_number, TRUE);
-	gfs_dinode_in(&di, data);
-
-	if (di.di_header.mh_magic != GFS_MAGIC ||
-	    di.di_header.mh_type != GFS_METATYPE_DI)
-		die("block %"PRIu64" isn't an inode\n",
-		    block_number);
-
-	if (di.di_type != GFS_FILE_DIR)
-		die("block %"PRIu64" isn't a directory\n",
-		    block_number);
-
-	if (di.di_flags & GFS_DIF_EXHASH)
-		foreach_leaf(&di, do_readdir, NULL);
-	else
-		print_dirents(data, sizeof(struct gfs_dinode));
-
-	free(data);
-}
diff --git a/gfs/gfs_debug/readfile.h b/gfs/gfs_debug/readfile.h
deleted file mode 100644
index e4e84e9..0000000
--- a/gfs/gfs_debug/readfile.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __READFILE_DOT_H__
-#define __READFILE_DOT_H__
-
-
-void print_jindex(void);
-void print_rindex(void);
-void print_quota(void);
-void print_root(void);
-void readfile(void);
-void readdir(void);
-
-
-#endif /* __READFILE_DOT_H__ */
-
diff --git a/gfs/gfs_debug/util.c b/gfs/gfs_debug/util.c
deleted file mode 100644
index ab4f0ee..0000000
--- a/gfs/gfs_debug/util.c
+++ /dev/null
@@ -1,334 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-#include "linux_endian.h"
-
-#include "gfs_debug.h"
-#include "basic.h"
-#include "block_device.h"
-#include "util.h"
-
-int
-check_type(char *data, unsigned int type)
-{
-	struct gfs_meta_header mh;
-
-	gfs_meta_header_in(&mh, data);
-	if (mh.mh_magic != GFS_MAGIC ||
-	    mh.mh_type != type) {
-		fprintf(stderr, "%s: expected metadata type %u\n",
-			prog_name, type);
-		return -1;
-	}
-	return 0;
-}
-
-/**
- * recursive_scan - call a function for each block pointer in a file
- * @di:
- * @height:
- * @bn:
- * @pc:
- * @opaque:
- *
- */
-
-void
-recursive_scan(struct gfs_dinode *di,
-	       unsigned int height, uint64_t bn,
-	       pointer_call_t pc, void *opaque)
-{
-	char *data = NULL;
-	uint64_t *top, *bottom;
-	uint64_t x;
-	
-	if (!height) {
-		data = get_block(di->di_num.no_addr, TRUE);
-
-		top = (uint64_t *)(data + sizeof(struct gfs_dinode));
-		bottom = (uint64_t *)(data + sizeof(struct gfs_dinode)) + sd_diptrs;
-	} else {
-		data = get_block(bn, FALSE);
-		if (!data)
-			return;
-		if (check_type(data, GFS_METATYPE_IN))
-			return;
-
-		top = (uint64_t *)(data + sizeof(struct gfs_indirect));
-		bottom = (uint64_t *)(data + sizeof(struct gfs_indirect)) + sd_inptrs;
-	}
-
-	for ( ; top < bottom; top++) {
-		x = gfs64_to_cpu(*top);
-
-		pc(di, height, x, opaque);
-
-		if (x && height < di->di_height - 1)
-			recursive_scan(di,
-				       height + 1, x,
-				       pc, opaque);
-	}
-
-	free(data);
-}
-
-void
-foreach_leaf(struct gfs_dinode *di,
-	     leaf_call_t lc, void *opaque)
-{
-	char *data;
-	struct gfs_leaf leaf;
-	uint32_t hsize, len;
-	uint32_t ht_offset, lp_offset, ht_offset_cur = -1;
-	uint32_t lindex = 0;
-	uint64_t lp[sd_hash_ptrs];
-	uint64_t leaf_no;
-	int error;
-
-	hsize = 1 << di->di_depth;
-	if (hsize * sizeof(uint64_t) != di->di_size)
-		die("bad hash table size\n");
-
-	while (lindex < hsize) {
-		lp_offset = lindex % sd_hash_ptrs;
-		ht_offset = lindex - lp_offset;
-
-		if (ht_offset_cur != ht_offset) {
-			error = gfs_readi(di, (char *)lp, ht_offset * sizeof(uint64_t), sd_hash_bsize);
-			if (error != sd_hash_bsize)
-				die("FixMe!!!\n");
-			ht_offset_cur = ht_offset;
-		}
-
-		leaf_no = gfs64_to_cpu(lp[lp_offset]);
-		if (!leaf_no)
-			die("NULL leaf pointer\n");
-
-		data = get_block(leaf_no, TRUE);
-		gfs_leaf_in(&leaf, data);
-		len = 1 << (di->di_depth - leaf.lf_depth);
-
-		lc(di, data, lindex, len, leaf_no, opaque);
-
-		free(data);
-		lindex += len;
-	}
-
-	if (lindex != hsize)
-		die("screwed up directory\n");
-}
-
-static unsigned int
-calc_tree_height(struct gfs_dinode *di, uint64_t size)
-{
-	uint64_t *arr;
-	unsigned int max, height;
-
-	if (di->di_size > size)
-		size = di->di_size;
-
-	if (di->di_flags & GFS_DIF_JDATA) {
-		arr = sd_jheightsize;
-		max = sd_max_jheight;
-	} else {
-		arr = sd_heightsize;
-		max = sd_max_height;
-	}
-
-	for (height = 0; height < max; height++)
-		if (arr[height] >= size)
-			break;
-
-	return height;
-}
-
-struct metapath {
-	unsigned int mp_list[GFS_MAX_META_HEIGHT];
-};
-
-static struct metapath *
-find_metapath(struct gfs_dinode *di, uint64_t block)
-{
-	struct metapath *mp;
-	uint64_t b = block;
-	unsigned int i;
-
-	mp = malloc(sizeof(struct metapath));
-	if (!mp)
-		die("out of memory (%s, %u)\n",
-		    __FILE__, __LINE__);
-	memset(mp, 0, sizeof(struct metapath));
-
-	for (i = di->di_height; i--;) {
-		mp->mp_list[i] = b % sd_inptrs;
-		b /= sd_inptrs;
-	}
-
-	return mp;
-}
-
-static uint64_t
-lookup_block(char *data, unsigned int height,
-	     struct metapath *mp)
-{
-	unsigned int head_size;
-	uint64_t block;
-
-	head_size = (height > 0) ?
-		sizeof(struct gfs_indirect) : sizeof(struct gfs_dinode);
-	block = *(((uint64_t *)(data + head_size)) + mp->mp_list[height]);
-
-	if (block)
-		return gfs64_to_cpu(block);
-	else
-		return 0;
-}
-
-int
-gfs_block_map(struct gfs_dinode *di,
-	      uint64_t lblock, uint64_t *dblock)
-{
-	unsigned int bsize;
-	unsigned int height;
-	struct metapath *mp;
-	unsigned int end_of_metadata;
-	char *data;
-	unsigned int x;
-	int error = 0;
-
-	*dblock = 0;
-
-	if (!di->di_height) {
-		if (!lblock)
-			*dblock = di->di_num.no_addr;
-		return 0;
-	}
-
-	bsize = (di->di_flags & GFS_DIF_JDATA) ? sd_jbsize : block_size;
-
-	height = calc_tree_height(di, (lblock + 1) * bsize);
-	if (di->di_height < height)
-		return 0;
-
-	mp = find_metapath(di, lblock);
-	end_of_metadata = di->di_height - 1;
-
-	data = get_block(di->di_num.no_addr, TRUE);
-
-	for (x = 0; x < end_of_metadata; x++) {
-		*dblock = lookup_block(data, x, mp);
-		free(data);
-		if (!*dblock)
-			goto out;
-
-		data = get_block(*dblock, FALSE);
-		if (!data) {
-			error = -1;
-			goto out;
-		}
-	}
-
-	*dblock = lookup_block(data, x, mp);
-
-	free(data);
-
- out:
-	free(mp);
-
-	return error;
-}
-
-static int
-copy2mem(char *data, void **buf,
-	     unsigned int offset, unsigned int size)
-{
-	char **p = (char **)buf;
-
-	if (data)
-		memcpy(*p, data + offset, size);
-	else
-		memset(*p, 0, size);
-
-	*p += size;
-
-	return 0;
-}
-
-int
-gfs_readi(struct gfs_dinode *di, void *buf,
-	  uint64_t offset, unsigned int size)
-{
-	int journaled = (di->di_flags & GFS_DIF_JDATA);
-	uint64_t lblock, dblock;
-	unsigned int o;
-	unsigned int amount;
-	char *data;
-	int copied = 0;
-	int error = 0;
-
-	if (offset >= di->di_size)
-		return 0;
-
-	if ((offset + size) > di->di_size)
-		size = di->di_size - offset;
-
-	if (!size)
-		return 0;
-
-	if (journaled) {
-		lblock = offset / sd_jbsize;
-		o = offset % sd_jbsize;
-	} else {
-		lblock = offset >> block_size_shift;
-		o = offset & (block_size - 1);
-	}
-
-	if (!di->di_height)
-		o += sizeof(struct gfs_dinode);
-	else if (journaled)
-		o += sizeof(struct gfs_meta_header);
-
-	while (copied < size) {
-		amount = size - copied;
-		if (amount > block_size - o)
-			amount = block_size - o;
-
-		error = gfs_block_map(di, lblock, &dblock);
-		if (error)
-			goto fail;
-
-		if (dblock) {
-			data = get_block(dblock, FALSE);
-			if (!data) {
-				error = -1;
-				goto fail;
-			}
-		} else
-			data = NULL;
-
-		copy2mem(data, &buf, o, amount);
-
-		if (data)
-			free(data);
-
-		copied += amount;
-		lblock++;
-
-		o = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
-	return copied;
-
- fail:
-	return (copied) ? copied : error;
-}
-
diff --git a/gfs/gfs_debug/util.h b/gfs/gfs_debug/util.h
deleted file mode 100644
index 6f0489a..0000000
--- a/gfs/gfs_debug/util.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __UTIL_DOT_H__
-#define __UTIL_DOT_H__
-
-
-int check_type(char *data, unsigned int type);
-
-
-typedef void (*pointer_call_t)(struct gfs_dinode *di,
-			       unsigned int height, uint64_t bn,
-			       void *opaque);
-void recursive_scan(struct gfs_dinode *di,
-		    unsigned int height, uint64_t bn,
-		    pointer_call_t pc, void *opaque);
-
-typedef void (*leaf_call_t)(struct gfs_dinode *di, char *data,
-			    uint32_t index, uint32_t len, uint64_t leaf_no,
-			    void *opaque);
-void foreach_leaf(struct gfs_dinode *di,
-		  leaf_call_t lc, void *opaque);
-
-
-int gfs_block_map(struct gfs_dinode *di,
-		  uint64_t lblock, uint64_t *dblock);
-int gfs_readi(struct gfs_dinode *di, void *buf,
-	      uint64_t offset, unsigned int size);
-
-
-#endif /* __UTIL_DOT_H__ */
-
diff --git a/gfs/gfs_fsck/FEATURES b/gfs/gfs_fsck/FEATURES
deleted file mode 100644
index 8a63591..0000000
--- a/gfs/gfs_fsck/FEATURES
+++ /dev/null
@@ -1,25 +0,0 @@
-This is a completely rewritten filesystem checker for GFS.  Performance
-characteristics are significantly improved.  The design follows the 5-pass
-fsck design found in "Fsck - The UNIX File System Check Program"
-by McKusick & Kowalkski (1994)
-  - http://citeseer.ist.psu.edu/mckusick94fsck.html
-
-
-Line item list of supported features:
-
-1. Detects and replaces missing/bad root inode
-2. Detects and relinks unlinked inodes to l+f
-   o If a file is zero length, it is not relinked to l+f - unless it
-     has an extended attribute attached to it.
-3. Detects duplicate blocks and removes inodes containing them
-4. Detects bad blocks (block number out of range) and removes inodes
-   containing them - Currently EAs that have blocks are removed but
-   the inode containing them is left.
-5. Detects bad metadata headers and clears the structure
-6. Fixes bad resource group bitmaps
-7. Fixes incorrect resource group counts
-8. Creates l+f directory if missing
-9. Detects and removes duplicate '.' and '..' entries
-10. Creates '.' if missing
-11. Beginning of support for internationalization
-12. Checks extended attributes
diff --git a/gfs/gfs_fsck/Makefile b/gfs/gfs_fsck/Makefile
deleted file mode 100644
index 4832872..0000000
--- a/gfs/gfs_fsck/Makefile
+++ /dev/null
@@ -1,60 +0,0 @@
-TARGET= fsck.gfs
-
-FORCESBINT= $(TARGET)
-
-all: ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	bio.o \
-	bitmap.o \
-	block_list.o \
-	eattr.o \
-	file.o \
-	fs_bits.o \
-	fs_bmap.o \
-	fs_dir.o \
-	fs_inode.o \
-	fs_recovery.o \
-	hash.o \
-	initialize.o \
-	inode.o \
-	inode_hash.o \
-	link.o \
-	log.o \
-	lost_n_found.o \
-	main.o \
-	metawalk.o \
-	ondisk.o \
-	pass1.o \
-	pass1b.o \
-	pass1c.o \
-	pass2.o \
-	pass3.o \
-	pass4.o \
-	pass5.o \
-	rgrp.o \
-	super.o \
-	util.o
-
-CFLAGS += -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM
-CFLAGS += -I$(S)/../include
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: $(OBJS)
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
-${TARGET}.pot: $(OBJS:.o=.c)
-	xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \
-	 --keyword=log_notice --keyword=log_warn --keyword=log_err --keyword=log_crit \
-	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(OBJS:.o=.c) > ${TARGET}.pot
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_fsck/TODO b/gfs/gfs_fsck/TODO
deleted file mode 100644
index 2b2e762..0000000
--- a/gfs/gfs_fsck/TODO
+++ /dev/null
@@ -1,49 +0,0 @@
-
-TODO:
-
-Current
- x fs_mkdir appears to be grabbing blocks that are in use - need to
-   figure out why - had to fix fs_blkalloc_internal in fs_bits.c to
-   use the incore bitmaps instead of ondisk.
- o Make sure that all blocks in an inode get marked cleared when an
-   inode is cleared.
- x If a directory is unlinked from pass2 on, make sure that any
-   directories that have it as a parent have their
-   dir_info->treewalk_parent entries cleared - handled by pass3
-   checking if parents inodes are valid in the bitmap
- o If an directory is unlinked from pass2 on, make sure that inodes
-   have their link count decremented (this may be difficult - i'll
-   have to reread the dirents and decrement the counts for all dirents
-   up to the error...).
- x 'Add in UI for interactive mode
- o Check hash of directory name against name given (Would be nice -
-   not in old fsck, but can cause problems if it is not verified.)
- x Unstuffed EA blocks have type GFS_METATYPE_ED in 6.1, but
-   GFS_METATYPE_EA in 6.0 - handle this.
-
----
-
-Future
- o internationalization
- o Check GFS special files (quota, resource group index inode, journal
-   index inode, license inode?)
- o convert dir_info list to a hash table like the inode_info hash
- o Fix up the bitmap enums and #defines in block_list.[ch]
- o Go through all fxns that have NEEDS_CHECKING in them and verify
-   them (and remove NEEDS_CHECKING)
- o Add 'preen' option?
- o Add disk-based bitmaps option in case system doesn't have enough
-   memory to handle all the bitmaps
- o currently rgrp bitmaps are loaded into memory on initialization -
-   need to see if this is necessary or not - we're using them in pass1
-   and again in pass5 - if memory is tight we might be able to free
-   them in between
- o Offer exhaustive search capability if superblock or rgs are missing
-   or broken that checks block by block for fs info.
- o If we encounter a directory entry in pass2 that points to a block
-   marked free, shove it into a queue, and then at the end of pass2,
-   clear all results, then rerun from pass1 including the blocks in
-   the queue as well as those marked in the RG bitmaps.  With this, we
-   can rebuild the entire fs with a valid root inode, it'll just take
-   several iterations.
-
diff --git a/gfs/gfs_fsck/bio.c b/gfs/gfs_fsck/bio.c
deleted file mode 100644
index 2331325..0000000
--- a/gfs/gfs_fsck/bio.c
+++ /dev/null
@@ -1,168 +0,0 @@
-#include "util.h"
-#include "fsck.h"
-#include "bio.h"
-
-/*
- * get_buf - get a buffer
- * @sdp: the super block
- * @blkno: blk # that this buffer will be associated with
- * @bhp: the location where the buffer is returned
- *
- * This function allocates space for a buffer head structure
- * and the corresponding data.  It does not fill in the
- * actual data - that is done by read_buf.
- *
- * Returns: 0 on success, -1 on error
- */
-int get_buf(struct fsck_sb *sdp, uint64 blkno, osi_buf_t **bhp){
-	osi_buf_t *bh = NULL;
-
-	*bhp = NULL;
-	bh = (osi_buf_t *)malloc(sizeof(osi_buf_t));
-	if(!bh){
-		log_err("Unable to allocate memory for new buffer head.\n");
-		return -1;
-	}
-	if(!memset(bh, 0, sizeof(osi_buf_t))) {
-		log_err("Unable to zero buffer head\n");
-		return -1;
-	}
-
-	/* FIXME: Not sure how this will work on all
-	 * architectures without the casts */
-	bh->b_blocknr = blkno;
-	bh->b_size = sdp->sb.sb_bsize;
-	bh->b_state = 0;
-	if(!(bh->b_data = malloc(BH_SIZE(bh)))) {
-		free(bh);
-		log_err("Unable to allocate memory for new buffer "
-			"blkno = %"PRIu64", size = %u\n", blkno, BH_SIZE(bh));
-		return -1;
-	}
-	if(!memset(BH_DATA(bh), 0, BH_SIZE(bh))) {
-		free(bh);
-		log_err("Unable to zero memory for new buffer "
-			"blkno = %"PRIu64", size = %u\n", blkno, BH_SIZE(bh));
-	}
-
-	*bhp = bh;
-
-	return 0;
-}
-
-
-/*
- * relse_buf - release a buffer
- * @sdp: the super block
- * @bh: the buffer to release
- *
- * This function will release the memory of the buffer
- * and associated buffer head.
- *
- * Returns: nothing
- */
-void relse_buf(struct fsck_sb *sdp, osi_buf_t *bh){
-	if(bh){
-		if(BH_DATA(bh)) {
-			free(BH_DATA(bh));
-			bh->b_data = NULL;
-		}
-		free(bh);
-		bh = NULL;
-	}
-}
-
-
-/*
- * read_buf - read a buffer
- * @sdp: the super block
- * @blkno: block number
- * @bhp: place where buffer is returned
- * @flags:
- *
- * Returns 0 on success, -1 on error
- */
-int read_buf(struct fsck_sb *sdp, osi_buf_t *bh, int flags){
-	int disk_fd = sdp->diskfd;
-
-	if(do_lseek(disk_fd, (uint64)(BH_BLKNO(bh)*BH_SIZE(bh)))){
-		log_err("Unable to seek to position %"PRIu64" "
-			"(%"PRIu64" * %u) on storage device.\n",
-			(uint64)(BH_BLKNO(bh) * BH_SIZE(bh)),
-			BH_BLKNO(bh), BH_SIZE(bh));
-		return -1;
-	}
-
-	if(do_read(disk_fd, BH_DATA(bh), BH_SIZE(bh))){
-		log_err("Unable to read %u bytes from position %"PRIu64"\n",
-			BH_SIZE(bh), (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)));
-		return -1;
-	}
-
-	return 0;
-}
-
-
-/*
- * write_buf - write a buffer
- * @sdp: the super block
- * @bh: buffer head that describes buffer to write
- * @flags: flags that determine usage
- *
- * Returns: 0 on success, -1 on failure
- */
-int write_buf(struct fsck_sb *sdp, osi_buf_t *bh, int flags){
-	int disk_fd = sdp->diskfd;
-
-	if(do_lseek(disk_fd, (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)))) {
-		log_err("Unable to seek to position %"PRIu64
-			"(%"PRIu64" * %u) on storage device.\n",
-			(uint64)(BH_BLKNO(bh) * BH_SIZE(bh)),
-			BH_BLKNO(bh), BH_SIZE(bh));
-		return -1;
-	}
-
-	log_debug("Writing to %"PRIu64" - %"PRIu64" %u\n",
-		  (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)),
-		  BH_BLKNO(bh), BH_SIZE(bh));
-	if(do_write(disk_fd, BH_DATA(bh), BH_SIZE(bh))) {
-		log_err("Unable to write %u bytes to position %"PRIu64"\n",
-			BH_SIZE(bh), (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)));
-		return -1;
-	}
-
-	if(flags & BW_WAIT){
-		fsync(disk_fd);
-	}
-
-	return 0;
-}
-
-
-/*
- * get_and_read_buf - combines get_buf and read_buf functions
- * @sdp
- * @blkno
- * @bhp
- * @flags
- *
- * Returns: 0 on success, -1 on error
- */
-int get_and_read_buf(struct fsck_sb *sdp, uint64 blkno, osi_buf_t **bhp,
-		     int flags)
-{
-	if(get_buf(sdp, blkno, bhp)) {
-		stack;
-		return -1;
-	}
-
-	if(read_buf(sdp, *bhp, flags)){
-		stack;
-		relse_buf(sdp, *bhp);
-		*bhp = NULL;  /* guarantee that ptr is NULL in failure cases */
-		return -1;
-	}
-
-	return 0;
-}
-
diff --git a/gfs/gfs_fsck/bio.h b/gfs/gfs_fsck/bio.h
deleted file mode 100644
index 08ceefa..0000000
--- a/gfs/gfs_fsck/bio.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __BIO_H
-#define __BIO_H
-
-#include "osi_user.h"
-#include "fsck_incore.h"
-/* buf_write flags */
-#define BW_WAIT 1
-
-
-#define BH_DATA(bh) ((char *)(bh)->b_data)
-#define BH_BLKNO(bh) ((uint64)(bh)->b_blocknr)
-#define BH_SIZE(bh) ((uint32)(bh)->b_size)
-#define BH_STATE(bh) ((uint32)(bh)->b_state)
-
-int get_buf(struct fsck_sb *sdp, uint64 blkno, osi_buf_t **bhp);
-void relse_buf(struct fsck_sb *sdp, osi_buf_t *bh);
-int read_buf(struct fsck_sb *sdp, osi_buf_t *bh, int flags);
-int write_buf(struct fsck_sb *sdp, osi_buf_t *bh, int flags);
-int get_and_read_buf(struct fsck_sb *sdp, uint64 blkno, osi_buf_t **bhp, int flags);
-
-#endif  /*  __BIO_H  */
-
-
diff --git a/gfs/gfs_fsck/bitmap.c b/gfs/gfs_fsck/bitmap.c
deleted file mode 100644
index 12da279..0000000
--- a/gfs/gfs_fsck/bitmap.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Basic bitmap manipulation */
-#include <stdint.h>
-#include <stdio.h>
-#include <errno.h>
-#include "osi_user.h"
-#include "bitmap.h"
-#include "block_list.h"
-#include "fsck_incore.h"
-#include "log.h"
-
-
-#define BITMAP_SIZE(size, cpb) (size / cpb)
-
-#define BITMAP_BYTE_OFFSET(x, map) ((x % map->chunks_per_byte) \
-                                    * map->chunksize )
-
-#define BITMAP_MASK(chunksize) ((2 << (chunksize - 1)) - 1)
-
-uint64_t bitmap_size(struct bmap *bmap) {
-	return bmap->size;
-}
-
-int bitmap_create(struct bmap *bmap, uint64_t size, uint8_t chunksize)
-{
-	if((((chunksize >> 1) << 1) != chunksize) && chunksize != 1) {
-		log_err("chunksize must be a power of 2\n");
-		return -1;
-	}
-	if(chunksize > 8) {
-		log_err("chunksize must be <= 8\n");
-		return -1;
-	}
-	bmap->chunksize = chunksize;
-	bmap->chunks_per_byte = 8 / chunksize;
-
-	bmap->size = size;
-
-	/* Have to add 1 to BITMAP_SIZE since it's 0-based and mallocs
-	 * must be 1-based */
-	bmap->mapsize = BITMAP_SIZE(size, bmap->chunks_per_byte)+1;
-
-	if(!(bmap->map = malloc(sizeof(char) * bmap->mapsize))) {
-		log_err("Unable to allocate bitmap of size %"PRIu64"\n",
-			bmap->mapsize);
-		return -ENOMEM;
-	}
-	if(!memset(bmap->map, 0, sizeof(char) * bmap->mapsize)) {
-		log_err("Unable to zero bitmap of size %"PRIu64"\n",
-			bmap->mapsize);
-		free(bmap->map);
-		bmap->map = NULL;
-		return -ENOMEM;
-	}
-	log_debug("Allocated bitmap of size %"PRIu64
-		  " with %d chunks per byte\n",
-		  bmap->mapsize, bmap->chunks_per_byte);
-	return 0;
-}
-
-int bitmap_set(struct bmap *bmap, uint64_t offset, uint8_t val)
-{
-	char *byte = NULL;
-	uint64_t b = offset;
-
-	if(offset < bmap->size) {
-		byte = bmap->map + BITMAP_SIZE(offset, bmap->chunks_per_byte);
-		b = BITMAP_BYTE_OFFSET(offset, bmap);
-
-		*byte |= (val & BITMAP_MASK(bmap->chunksize)) << b;
-		return 0;
-	}
-	log_debug("offset %d out of bounds\n", offset);
-	return -1;
-}
-
-int bitmap_get(struct bmap *bmap, uint64_t bit, uint8_t *val)
-{
-	char *byte = NULL;
-	uint64_t b = bit;
-
-	if(bit < bmap->size) {
-		byte = bmap->map + BITMAP_SIZE(bit, bmap->chunks_per_byte);
-		b = BITMAP_BYTE_OFFSET(bit, bmap);
-
-		*val = (*byte & (BITMAP_MASK(bmap->chunksize) << b )) >> b;
-		return 0;
-	}
-	log_debug("offset %d out of bounds\n", bit);
-	return -1;
-}
-
-
-int bitmap_clear(struct bmap *bmap, uint64_t offset)
-{
-	char *byte = NULL;
-	uint64_t b = offset;
-
-	if(offset < bmap->size) {
-		byte = bmap->map + BITMAP_SIZE(offset, bmap->chunks_per_byte);
-		b = BITMAP_BYTE_OFFSET(offset, bmap);
-
-		*byte &= ~(BITMAP_MASK(bmap->chunksize) << b);
-		return 0;
-	}
-	log_debug("offset %d out of bounds\n", offset);
-	return -1;
-
-}
-
-void bitmap_destroy(struct bmap *bmap)
-{
-	if(bmap->map)
-		free(bmap->map);
-	bmap->size = 0;
-	bmap->mapsize = 0;
-	bmap->chunksize = 0;
-	bmap->chunks_per_byte = 0;
-}
diff --git a/gfs/gfs_fsck/bitmap.h b/gfs/gfs_fsck/bitmap.h
deleted file mode 100644
index c634a06..0000000
--- a/gfs/gfs_fsck/bitmap.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _BITMAP_H
-#define _BITMAP_H
-
-struct bmap {
-	uint64_t size;
-	uint64_t mapsize;
-	int chunksize;
-	int chunks_per_byte;
-	char *map;
-};
-
-int bitmap_create(struct bmap *bmap, uint64_t size, uint8_t bitsize);
-int bitmap_set(struct bmap *bmap, uint64_t offset, uint8_t val);
-int bitmap_get(struct bmap *bmap, uint64_t bit, uint8_t *val);
-int bitmap_clear(struct bmap *bmap, uint64_t offset);
-void bitmap_destroy(struct bmap *bmap);
-uint64_t bitmap_size(struct bmap *bmap);
-
-
-#endif /* _BITMAP_H */
diff --git a/gfs/gfs_fsck/block_list.c b/gfs/gfs_fsck/block_list.c
deleted file mode 100644
index 2e9017f..0000000
--- a/gfs/gfs_fsck/block_list.c
+++ /dev/null
@@ -1,283 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "bitmap.h"
-#include "block_list.h"
-#include "fsck.h"
-
-/* Must be kept in sync with mark_block enum in block_list.h */
-static int mark_to_gbmap[16] = {
-	block_free, block_used, indir_blk, inode_dir, inode_file,
-	inode_lnk, inode_blk, inode_chr, inode_fifo, inode_sock,
-	leaf_blk, journal_blk, meta_other, meta_free,
-	meta_eattr, meta_inval
-};
-
-struct block_list *block_list_create(uint64_t size, enum block_list_type type)
-{
-	struct block_list *il;
-	uint64_t addl_mem_needed = 0L;
-	log_info("Creating a block list of size %"PRIu64"...\n", size);
-
-	if ((il = malloc(sizeof(*il)))) {
-		memset(il, 0, sizeof(*il));
-		il->type = type;
-
-		switch(type) {
-		case gbmap:
-			if(bitmap_create(&il->list.gbmap.group_map, size, 4)) {
-				/* Note on addl_mem_needed: We've tried to allocate ram   */
-				/* for our bitmaps, but we failed.  The fs is too big.    */
-				/* We should tell them how much to allocate.  This first  */
-				/* bitmap is the biggest, but we need three more smaller  */
-				/* for the code that immediately follows.  I'm rounding   */
-				/* up to twice the memory for this bitmap, even though    */
-				/* it's actually 1 + 3/4.  That will allow for future     */
-				/* mallocs that happen after this point in the code.      */
-				/* For the bad_map, we have two more to go (total of 3)   */
-				/* but again I'm rounding it up to 4 smaller ones.        */
-				/* For the dup_map, I'm rounding from 2 to 3, and for     */
-				/* eattr_map, I'm rounding up from 1 to 2.                */
-				addl_mem_needed = il->list.gbmap.group_map.mapsize * 2;
-				stack;
-				free(il);
-				il = NULL;
-			}
-			else if(bitmap_create(&il->list.gbmap.bad_map, size, 1)) {
-				addl_mem_needed = il->list.gbmap.group_map.mapsize * 4;
-				stack;
-				free(il);
-				il = NULL;
-			}
-			else if(bitmap_create(&il->list.gbmap.dup_map, size, 1)) {
-				addl_mem_needed = il->list.gbmap.group_map.mapsize * 3;
-				stack;
-				free(il);
-				il = NULL;
-			}
-			else if(bitmap_create(&il->list.gbmap.eattr_map, size, 1)) {
-				addl_mem_needed = il->list.gbmap.group_map.mapsize * 2;
-				stack;
-				free(il);
-				il = NULL;
-			}
-			if (addl_mem_needed) {
-				log_err("This system doesn't have enough memory + swap space to fsck this file system.\n");
-				log_err("Additional memory needed is approximately: %ldMB\n", addl_mem_needed / 1048576);
-				log_err("Please increase your swap space by that amount and run gfs_fsck again.\n");
-			}
-			break;
-		default:
-			log_crit("Block list type %d not implemented\n",
-				type);
-			break;
-		}
-	}
-
-	return il;
-}
-
-int block_mark(struct block_list *il, uint64_t block, enum mark_block mark)
-{
-	int err = 0;
-
-	switch(il->type) {
-	case gbmap:
-		if(mark == bad_block) {
-			err = bitmap_set(&il->list.gbmap.bad_map, block, 1);
-		}
-		else if(mark == dup_block) {
-			err = bitmap_set(&il->list.gbmap.dup_map, block, 1);
-		}
-		else if(mark == eattr_block) {
-			err = bitmap_set(&il->list.gbmap.eattr_map, block, 1);
-		}
-		else {
-			err = bitmap_set(&il->list.gbmap.group_map, block,
-					 mark_to_gbmap[mark]);
-		}
-
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-	return err;
-}
-
-int block_set(struct block_list *il, uint64_t block, enum mark_block mark)
-{
-	int err = 0;
-	err = block_clear(il, block);
-	if(!err)
-		err = block_mark(il, block, mark);
-	return err;
-}
-
-int block_unmark(struct block_list *il, uint64_t block, enum mark_block m)
-{
-	int err = 0;
-
-	switch(il->type) {
-	case gbmap:
-		switch (m) {
-		case dup_block:
-			err = bitmap_clear(&il->list.gbmap.dup_map, block);
-			break;
-		case bad_block:
-			err = bitmap_clear(&il->list.gbmap.bad_map, block);
-			break;
-		case eattr_block:
-			err = bitmap_clear(&il->list.gbmap.eattr_map, block);
-			break;
-		default:
-			/* FIXME: check types */
-			err = bitmap_clear(&il->list.gbmap.group_map, block);
-			break;
-		}
-
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-	return err;
-}
-
-int block_clear(struct block_list *il, uint64_t block)
-{
-	int err = 0;
-
-	switch(il->type) {
-	case gbmap:
-		err = bitmap_clear(&il->list.gbmap.dup_map, block);
-		err = bitmap_clear(&il->list.gbmap.bad_map, block);
-		err = bitmap_clear(&il->list.gbmap.eattr_map, block);
-		err = bitmap_clear(&il->list.gbmap.group_map, block);
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-	return err;
-}
-
-int block_check(struct block_list *il, uint64_t block, struct block_query *val)
-{
-	int err = 0;
-	val->block_type = 0;
-	val->bad_block = 0;
-	val->dup_block = 0;
-	switch(il->type) {
-	case gbmap:
-		if((err = bitmap_get(&il->list.gbmap.group_map, block,
-				     &val->block_type))) {
-			log_err("Unable to get block type for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		if((err = bitmap_get(&il->list.gbmap.bad_map, block,
-				     &val->bad_block))) {
-			log_err("Unable to get bad block status for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		if((err = bitmap_get(&il->list.gbmap.dup_map, block,
-				     &val->dup_block))) {
-			log_err("Unable to get duplicate status for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		if((err = bitmap_get(&il->list.gbmap.eattr_map, block,
-				     &val->eattr_block))) {
-			log_err("Unable to get eattr status for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-
-	return err;
-}
-
-void *block_list_destroy(struct block_list *il)
-{
-	if(il) {
-		switch(il->type) {
-		case gbmap:
-			bitmap_destroy(&il->list.gbmap.group_map);
-			bitmap_destroy(&il->list.gbmap.bad_map);
-			bitmap_destroy(&il->list.gbmap.dup_map);
-			bitmap_destroy(&il->list.gbmap.eattr_map);
-			break;
-		default:
-			break;
-		}
-		free(il);
-		il = NULL;
-	}
-	return il;
-}
-
-
-int find_next_block_type(struct block_list *il, enum mark_block m, uint64_t *b)
-{
-	uint64_t i;
-	uint8_t val;
-	int found = 0;
-	for(i = *b; ; i++) {
-		switch(il->type) {
-		case gbmap:
-			if(i >= bitmap_size(&il->list.gbmap.dup_map))
-				return -1;
-
-			switch(m) {
-			case dup_block:
-				if(bitmap_get(&il->list.gbmap.dup_map, i, &val)) {
-					stack;
-					return -1;
-				}
-
-				if(val)
-					found = 1;
-				break;
-			case eattr_block:
-				if(bitmap_get(&il->list.gbmap.eattr_map, i, &val)) {
-					stack;
-					return -1;
-				}
-
-				if(val)
-					found = 1;
-				break;
-			default:
-				/* FIXME: add support for getting
-				 * other types */
-				log_err("Unhandled block type\n");
-			}
-			break;
-		default:
-			log_err("Unhandled block list type\n");
-			break;
-		}
-		if(found) {
-			*b = i;
-			return 0;
-		}
-	}
-	return -1;
-}
diff --git a/gfs/gfs_fsck/block_list.h b/gfs/gfs_fsck/block_list.h
deleted file mode 100644
index 71c5642..0000000
--- a/gfs/gfs_fsck/block_list.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef _BLOCK_LIST_H
-#define _BLOCK_LIST_H
-
-#include "bitmap.h"
-
-#define BMAP_COUNT 13
-
-enum block_list_type {
-	gbmap = 0,  /* Grouped bitmap */
-	dbmap,	    /* Ondisk bitmap - like grouped bitmap, but mmaps
-		     * the bitmaps onto file(s) ondisk - not implemented */
-};
-
-/* Must be kept in sync with mark_to_bitmap array in block_list.c */
-enum mark_block {
-	block_free = 0,
-	block_used = 1,
-	indir_blk = 2,
-	inode_dir = 3,
-	inode_file = 4,
-	inode_lnk = 5,
-	inode_blk = 6,
-	inode_chr = 7,
-	inode_fifo = 8,
-	inode_sock = 9,
-	leaf_blk = 10,
-	journal_blk = 11,
-	meta_other = 12,
-	meta_free = 13,
-	meta_eattr = 14,
-	meta_inval = 15,
-	/* above this are nibble-values 0x0-0xf */
-	bad_block = 16,	/* Contains at least one bad block */
-	dup_block = 17,	/* Contains at least one duplicate block */
-	eattr_block = 18,	/* Contains an eattr */
-};
-
-struct block_query {
-	uint8_t block_type;
-	uint8_t bad_block;
-	uint8_t dup_block;
-	uint8_t eattr_block;
-};
-
-struct gbmap {
-	struct bmap group_map;
-	struct bmap bad_map;
-	struct bmap dup_map;
-	struct bmap eattr_map;
-};
-
-struct dbmap {
-	struct bmap group_map;
-	char *group_file;
-	struct bmap bad_map;
-	char *bad_file;
-	struct bmap dup_map;
-	char *dup_file;
-	struct bmap eattr_map;
-	char *eattr_file;
-};
-
-union block_lists {
-	struct gbmap gbmap;
-	struct dbmap dbmap;
-};
-
-
-/* bitmap implementation */
-struct block_list {
-	enum block_list_type type;
-	/* Union of bitmap, rle */
-	union block_lists list;
-};
-
-
-struct block_list *block_list_create(uint64_t size, enum block_list_type type);
-int block_mark(struct block_list *il, uint64_t block, enum mark_block mark);
-int block_set(struct block_list *il, uint64_t block, enum mark_block mark);
-int block_unmark(struct block_list *il, uint64_t block, enum mark_block m);
-int block_clear(struct block_list *il, uint64_t block);
-int block_check(struct block_list *il, uint64_t block,
-		struct block_query *val);
-int block_check_for_mark(struct block_list *il, uint64_t block,
-			 enum mark_block mark);
-void *block_list_destroy(struct block_list *il);
-int find_next_block_type(struct block_list *il, enum mark_block m, uint64_t *b);
-
-#endif /* _BLOCK_LIST_H */
diff --git a/gfs/gfs_fsck/eattr.c b/gfs/gfs_fsck/eattr.c
deleted file mode 100644
index 2891c33..0000000
--- a/gfs/gfs_fsck/eattr.c
+++ /dev/null
@@ -1,100 +0,0 @@
-#include <stdint.h>
-
-#include "fsck_incore.h"
-#include "eattr.h"
-
-static int clear_blk_nodup(struct fsck_sb *sbp, uint64_t block)
-{
-	struct block_query q;
-
-	if(block_check(sbp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-
-	if(q.dup_block) {
-		log_debug("Not clearing block with marked as a duplicate\n");
-		return 1;
-	}
-
-	block_set(sbp->bl, block, block_free);
-
-	return 0;
-
-}
-
-int clear_eattr_indir(struct fsck_inode *ip, uint64_t block,
-		      uint64_t parent, osi_buf_t **bh,
-		      void *private)
-{
-	return clear_blk_nodup(ip->i_sbd, block);
-}
-
-
-int clear_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-		     uint64_t parent, osi_buf_t **bh,
-		     void *private)
-{
-
-	return clear_blk_nodup(ip->i_sbd, block);
-
-}
-
-
-int clear_eattr_entry (struct fsck_inode *ip,
-		       osi_buf_t *leaf_bh,
-		       struct gfs_ea_header *ea_hdr,
-		       struct gfs_ea_header *ea_hdr_prev,
-		       void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	char ea_name[256];
-
-	if(!ea_hdr->ea_name_len){
-		/* Skip this entry for now */
-		return 1;
-	}
-
-	memset(ea_name, 0, sizeof(ea_name));
-	strncpy(ea_name, (char *)ea_hdr + sizeof(struct gfs_ea_header),
-		ea_hdr->ea_name_len);
-
-	if(!GFS_EATYPE_VALID(ea_hdr->ea_type) &&
-	   ((ea_hdr_prev) || (!ea_hdr_prev && ea_hdr->ea_type))){
-		/* Skip invalid entry */
-		return 1;
-	}
-
-	if(ea_hdr->ea_num_ptrs){
-		uint32 avail_size;
-		int max_ptrs;
-
-		avail_size = sdp->sb.sb_bsize - sizeof(struct gfs_meta_header);
-		max_ptrs = (gfs32_to_cpu(ea_hdr->ea_data_len)+avail_size-1)/avail_size;
-
-		if(max_ptrs > ea_hdr->ea_num_ptrs) {
-			return 1;
-		} else {
-			log_debug("  Pointers Required: %d\n"
-				  "  Pointers Reported: %d\n",
-				  max_ptrs,
-				  ea_hdr->ea_num_ptrs);
-		}
-
-
-	}
-	return 0;
-}
-
-int clear_eattr_extentry(struct fsck_inode *ip, uint64_t *ea_data_ptr,
-			 osi_buf_t *leaf_bh, struct gfs_ea_header *ea_hdr,
-			 struct gfs_ea_header *ea_hdr_prev, void *private)
-{
-	uint64_t block = gfs64_to_cpu(*ea_data_ptr);
-
-	return clear_blk_nodup(ip->i_sbd, block);
-
-}
-
-
-
diff --git a/gfs/gfs_fsck/eattr.h b/gfs/gfs_fsck/eattr.h
deleted file mode 100644
index c1cbfea..0000000
--- a/gfs/gfs_fsck/eattr.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _EATTR_H
-#define _EATTR_H
-
-int clear_eattr_indir(struct fsck_inode *ip, uint64_t block,
-		      uint64_t parent, osi_buf_t **bh,
-		      void *private);
-int clear_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-		     uint64_t parent, osi_buf_t **bh,
-		     void *private);
-int clear_eattr_entry (struct fsck_inode *ip,
-		       osi_buf_t *leaf_bh,
-		       struct gfs_ea_header *ea_hdr,
-		       struct gfs_ea_header *ea_hdr_prev,
-		       void *private);
-int clear_eattr_extentry(struct fsck_inode *ip, uint64_t *ea_data_ptr,
-			 osi_buf_t *leaf_bh, struct gfs_ea_header *ea_hdr,
-			 struct gfs_ea_header *ea_hdr_prev, void *private);
-
-
-
-#endif /* _EATTR_H */
diff --git a/gfs/gfs_fsck/file.c b/gfs/gfs_fsck/file.c
deleted file mode 100644
index a76d359..0000000
--- a/gfs/gfs_fsck/file.c
+++ /dev/null
@@ -1,231 +0,0 @@
-#include "util.h"
-#include "bio.h"
-#include "fs_bmap.h"
-#include "fs_inode.h"
-#include "fsck.h"
-#include "file.h"
-
-/**
- * readi - Read a file
- * @ip: The GFS Inode
- * @buf: The buffer to place result into
- * @offset: File offset to begin reading from
- * @size: Amount of data to transfer
- *
- * Returns: The amount of data actually copied or the error
- */
-int readi(struct fsck_inode *ip, void *bufin, uint64 offset, unsigned int size)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	osi_buf_t *bh;
-	uint64_t lblock, dblock=0;
-	uint32_t extlen = 0;
-	unsigned int amount;
-	int not_new = 0;
-	int journaled = fs_is_jdata(ip);
-	int copied = 0;
-	int error = 0;
-	char *buf = bufin;
-
-	if (offset >= ip->i_di.di_size){
-		log_debug("readi:  Offset (%"PRIu64") is >= "
-			"the file size (%"PRIu64").\n",
-			offset, ip->i_di.di_size);
-		goto out;
-	}
-
-	if ((offset + size) > ip->i_di.di_size)
-		size = ip->i_di.di_size - offset;
-
-	if (!size){
-		log_err("readi:  Nothing to be read.\n");
-		goto out;
-	}
-
-	if (journaled){
-		lblock = offset / sdp->jbsize;
-		offset %= sdp->jbsize;
-	}
-	else{
-		lblock = offset >> sdp->sb.sb_bsize_shift;
-		offset &= sdp->sb.sb_bsize - 1;
-	}
-
-	if (fs_is_stuffed(ip))
-		offset += sizeof(struct gfs_dinode);
-	else if (journaled)
-		offset += sizeof(struct gfs_meta_header);
-
-
-	while (copied < size){
-		amount = size - copied;
-		if (amount > sdp->sb.sb_bsize - offset)
-			amount = sdp->sb.sb_bsize - offset;
-
-		if (!extlen){
-			error = fs_block_map(ip, lblock, &not_new, &dblock, &extlen);
-			if (error){
-				log_err("readi:  The call to fs_block_map() failed.\n");
-				goto out;
-			}
-		}
-
-		if (dblock){
-			error = get_and_read_buf(ip->i_sbd, dblock, &bh, 0);
-			if (error){
-				log_err("readi:  Unable to perform get_and_read_buf()\n");
-				goto out;
-			}
-
-			dblock++;
-			extlen--;
-		}
-		else
-			bh = NULL;
-
-		if (bh){
-			memcpy(buf+copied, BH_DATA(bh)+offset, amount);
-			relse_buf(ip->i_sbd, bh);
-		} else {
-			memset(buf+copied, 0, amount);
-		}
-		copied += amount;
-		lblock++;
-
-		offset = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
- out:
-
-	return (error < 0) ? error : copied;
-}
-
-
-
-/**
- * writei - Write bytes to a file
- * @ip: The GFS inode
- * @buf: The buffer containing information to be written
- * @offset: The file offset to start writing at
- * @size: The amount of data to write
- *
- * Returns: The number of bytes correctly written or error code
- */
-int writei(struct fsck_inode *ip, void *bufin, uint64_t offset, unsigned int size)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	osi_buf_t *dibh, *bh;
-	uint64_t lblock, dblock;
-	uint32_t extlen = 0;
-	unsigned int amount;
-	int new;
-	int journaled = fs_is_jdata(ip);
-	const uint64_t start = offset;
-	int copied = 0;
-	int error = 0;
-	char *buf = bufin;
-
-	/*  Bomb out on writing nothing.
-	    Posix says we can't change the time here.  */
-
-	if (!size)
-		goto fail;  /*  Not really an error  */
-
-
-	if (fs_is_stuffed(ip) &&
-	    ((start + size) > (sdp->sb.sb_bsize - sizeof(struct gfs_dinode)))){
-		error = fs_unstuff_dinode(ip);
-		if (error)
-			goto fail;
-	}
-
-
-	if (journaled){
-		lblock = offset / sdp->jbsize;
-		offset %= sdp->jbsize;
-	}
-	else{
-		lblock = offset >> sdp->sb.sb_bsize_shift;
-		offset &= sdp->sb.sb_bsize - 1;
-	}
-
-	if (fs_is_stuffed(ip))
-		offset += sizeof(struct gfs_dinode);
-	else if (journaled)
-		offset += sizeof(struct gfs_meta_header);
-
-
-	while (copied < size){
-		amount = size - copied;
-		if (amount > sdp->sb.sb_bsize - offset)
-			amount = sdp->sb.sb_bsize - offset;
-
-		if (!extlen){
-			new = TRUE;
-			error = fs_block_map(ip, lblock, &new, &dblock, &extlen);
-			if (error)
-				goto fail;
-			if(!dblock){
-				log_crit("fs_writei:  "
-					"Unable to map logical block to real block.\n");
-				log_crit("Uncircumventable error.\n");
-				exit(FSCK_ERROR);
-			}
-		}
-
-		error = get_and_read_buf(ip->i_sbd, dblock, &bh, 0);
-		if (error)
-			goto fail;
-
-		if(journaled && dblock != ip->i_di.di_num.no_addr ) {
-			set_meta(bh, GFS_METATYPE_JD, GFS_FORMAT_JD);
-		}
-
-		memcpy(BH_DATA(bh)+offset, buf+copied, amount);
-		write_buf(ip->i_sbd, bh, 0);
-		relse_buf(ip->i_sbd, bh);
-
-		copied += amount;
-		lblock++;
-		dblock++;
-		extlen--;
-
-		offset = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
-
- out:
-	error = get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &dibh, 0);
-	if (error){
-		log_err("fs_writei:  "
-			"Unable to get inode buffer.\n");
-		return -1;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error){
-		log_err("fs_writei:  "
-			"Buffer is not a valid inode.\n");
-		relse_buf(ip->i_sbd, dibh);
-		return -1;
-	}
-
-	if (ip->i_di.di_size < start + copied)
-		ip->i_di.di_size = start + copied;
-	ip->i_di.di_mtime = ip->i_di.di_ctime = osi_current_time();
-
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-	write_buf(ip->i_sbd, dibh, 0);
-	relse_buf(ip->i_sbd, dibh);
-
-	return copied;
-
-
-
- fail:
-	if (copied)
-		goto out;
-
-	return error;
-}
-
diff --git a/gfs/gfs_fsck/file.h b/gfs/gfs_fsck/file.h
deleted file mode 100644
index dfccb00..0000000
--- a/gfs/gfs_fsck/file.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _FILE_H
-#define _FILE_H
-
-#include <stdint.h>
-#include "fsck_incore.h"
-
-int readi(struct fsck_inode *ip, void *buf, uint64_t offset, unsigned int size);
-int writei(struct fsck_inode *ip, void *buf, uint64_t offset, unsigned int size);
-
-#endif /* _FILE_H */
diff --git a/gfs/gfs_fsck/fs_bits.c b/gfs/gfs_fsck/fs_bits.c
deleted file mode 100644
index b0edfe1..0000000
--- a/gfs/gfs_fsck/fs_bits.c
+++ /dev/null
@@ -1,350 +0,0 @@
-#include "util.h"
-#include "bio.h"
-#include "rgrp.h"
-
-#include "fsck_incore.h"
-#include "fs_bits.h"
-/**
- * fs_setbit - Set a bit in the bitmaps
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @block: the block to set
- * @new_state: the new state of the block
- *
- */
-static void fs_setbit(unsigned char *buffer, unsigned int buflen,
-		      uint32_t block, unsigned char new_state)
-{
-	unsigned char *byte, *end, cur_state;
-	unsigned int bit;
-
-	byte = buffer + (block / GFS_NBBY);
-	bit = (block % GFS_NBBY) * GFS_BIT_SIZE;
-	end = buffer + buflen;
-
-	if(byte >= end){
-		log_err("fs_setbit:  byte >= end\n");
-		exit(FSCK_ERROR);
-	}
-	cur_state = (*byte >> bit) & GFS_BIT_MASK;
-
-	*byte ^= cur_state << bit;
-	*byte |= new_state << bit;
-}
-
-static uint32_t fs_bitfit_core(struct fsck_sb *sbp, uint64_t goal, uint64_t start, uint64_t len,
-		   unsigned char old_state)
-{
-	uint64_t block;
-	struct block_query q;
-
-	log_debug("Goal: %"PRIu64", Start: %"PRIu64" len: %"PRIu64"\n",
-		  goal, start, len);
-	for(block = start+goal; block < start+len; block++) {
-		block_check(sbp->bl, block, &q);
-		switch(old_state) {
-		case GFS_BLKST_FREE:
-			switch(q.block_type) {
-			case block_free:
-				return block - start;
-			}
-			break;
-		case GFS_BLKST_FREEMETA:
-			switch(q.block_type) {
-			case meta_free:
-				return block - start;
-			}
-			break;
-		case GFS_BLKST_USEDMETA:
-			switch(q.block_type) {
-			case inode_dir:
-			case inode_file:
-			case inode_lnk:
-			case inode_blk:
-			case inode_chr:
-			case inode_fifo:
-			case inode_sock:
-			case indir_blk:
-			case leaf_blk:
-			case journal_blk:
-			case meta_other:
-			case meta_eattr:
-				return block - start;
-			}
-			break;
-		case GFS_BLKST_USED:
-			switch(q.block_type) {
-			case block_used:
-				return block - start;
-			}
-			break;
-		default:
-			log_err("Invalid type");
-			break;
-		}
-	}
-	return BFITNOENT;
-}
-/**
- * fs_bitfit - Find a free block in the bitmaps
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @goal: the block to try to allocate
- * @old_state: the state of the block we're looking for
- *
- * Return: the block number that was allocated
- */
-uint32_t fs_bitfit(unsigned char *buffer, unsigned int buflen,
-		   uint32_t goal, unsigned char old_state)
-{
-	unsigned char *byte, *end, alloc;
-	uint32_t blk = goal;
-	unsigned int bit;
-
-
-	byte = buffer + (goal / GFS_NBBY);
-	bit = (goal % GFS_NBBY) * GFS_BIT_SIZE;
-	end = buffer + buflen;
-	alloc = (old_state & 1) ? 0 : 0x55;
-
-	while (byte < end){
-		if ((*byte & 0x55) == alloc){
-			blk += (8 - bit) >> 1;
-
-			bit = 0;
-			byte++;
-
-			continue;
-		}
-
-		if (((*byte >> bit) & GFS_BIT_MASK) == old_state){
-			return blk;
-		}
-
-		bit += GFS_BIT_SIZE;
-		if (bit >= 8){
-			bit = 0;
-			byte++;
-		}
-
-		blk++;
-	}
-	return BFITNOENT;
-}
-
-/**
- * fs_bitcount - count the number of bits in a certain state
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @state: the state of the block we're looking for
- *
- * Returns: The number of bits
- */
-uint32_t fs_bitcount(unsigned char *buffer, unsigned int buflen,
-		     unsigned char state)
-{
-	unsigned char *byte, *end;
-	unsigned int bit;
-	uint32_t count = 0;
-
-	byte = buffer;
-	bit = 0;
-	end = buffer + buflen;
-
-	while (byte < end){
-		if (((*byte >> bit) & GFS_BIT_MASK) == state)
-			count++;
-
-		bit += GFS_BIT_SIZE;
-		if (bit >= 8){
-			bit = 0;
-			byte++;
-		}
-	}
-	return count;
-}
-
-
-/**
- * fs_blkalloc_internal - allocate a single block
- * @rgd: the resource group descriptor
- * @goal: the goal block in the RG
- * @old_state: the type of block to find
- * @new_state: the resulting block type
- * @do_it: if FALSE, we just find the block we would allocate
- *
- *
- * Returns:  returns the block allocated, or BFITNOENT on failure
- */
-uint32_t fs_blkalloc_internal(struct fsck_rgrp *rgd, uint32_t goal,
-			      unsigned char old_state,
-			      unsigned char new_state, int do_it)
-{
-	struct fsck_sb *sdp = rgd->rd_sbd;
-	uint32_t block = 0;
-	log_debug("fs_blkalloc_internal got %u as goal\n", goal);
-	goal = ((int)(goal - rgd->rd_ri.ri_data1) < 0)
-		? 0
-		: goal - rgd->rd_ri.ri_data1;
-
-
-	block = fs_bitfit_core(sdp, goal, rgd->rd_ri.ri_data1,
-			       rgd->rd_ri.ri_data, old_state);
-
-
-	if(block == BFITNOENT) {
-		log_debug("No bits left in old_state?\n"
-			  "\told_state   = %u\n"
-			  "\tnew_state   = %u\n"
-			  "\trg_free     = %u\n"
-			  "\trg_freemeta = %u\n",
-			old_state, new_state,
-			rgd->rd_rg.rg_free,
-			rgd->rd_rg.rg_freemeta);
-		return BFITNOENT;
-	}
-
-	log_debug("fs_blkalloc_internal found block %u\n", block);
-	switch(new_state) {
-	case GFS_BLKST_FREE:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, block_free);
-		break;
-	case GFS_BLKST_USED:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, block_used);
-		break;
-	case GFS_BLKST_USEDMETA:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, meta_other);
-		break;
-	case GFS_BLKST_FREEMETA:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, meta_free);
-		break;
-	}
-	return  block;
-}
-
-
-/*
- * fs_get_bitmap - get value of FS bitmap
- * @sdp: super block
- * @blkno: block number relative to file system
- *
- * This function gets the value of a bit of the
- * file system bitmap.
- * Possible state values for a block in the bitmap are:
- *  GFS_BLKST_FREE     (0)
- *  GFS_BLKST_USED     (1)
- *  GFS_BLKST_FREEMETA (2)
- *  GFS_BLKST_USEDMETA (3)
- *
- * Returns: state on success, -1 on error
- */
-int fs_get_bitmap(struct fsck_sb *sdp, uint64 blkno, struct fsck_rgrp *rgd){
-	int           buf, val;
-	uint32_t        rgrp_block;
-/*  struct fsck_rgrp	*rgd;*/
-	fs_bitmap_t	*bits = NULL;
-	unsigned int  bit;
-	unsigned char *byte;
-	int local_rgd = 0;
-
-	if(check_range(sdp, blkno)){
-		log_warn("Block #%"PRIu64" is out of range.\n", blkno);
-		return -1;
-	}
-	if(rgd == NULL) {
-		local_rgd = 1;
-		rgd = fs_blk2rgrpd(sdp, blkno);
-	}
-	if(rgd == NULL){
-		log_err( "Unable to get rgrp for block #%"PRIu64"\n", blkno);
-		return -1;
-	}
-	if(fs_rgrp_read(rgd, FALSE)){ /* FALSE:don't try to fix (done elsewhere) */
-		log_err( "Unable to read rgrp.\n");
-		return -1;
-	}
-
-	rgrp_block = (uint32_t)(blkno - rgd->rd_ri.ri_data1);
-
-	for(buf= 0; buf < rgd->rd_ri.ri_length; buf++){
-		bits = &(rgd->rd_bits[buf]);
-		if(rgrp_block < ((bits->bi_start + bits->bi_len)*GFS_NBBY)){
-			break;
-		}
-	}
-
-	if(buf >= rgd->rd_ri.ri_length){
-		log_err( "Unable to locate bitmap entry for block #%"PRIu64"\n",
-			blkno);
-		fs_rgrp_relse(rgd);
-		return -1;
-	}
-
-	byte = (unsigned char *)((BH_DATA(rgd->rd_bh[buf]) + bits->bi_offset) +
-				 (rgrp_block/GFS_NBBY - bits->bi_start));
-	bit = (rgrp_block % GFS_NBBY) * GFS_BIT_SIZE;
-
-	val = ((*byte >> bit) & GFS_BIT_MASK);
-	if(local_rgd) {
-		fs_rgrp_relse(rgd);
-	}
-
-	return val;
-}
-
-
-/*
- * fs_set_bitmap
- * @sdp: super block
- * @blkno: block number relative to file system
- * @state: one of 4 possible states
- *
- * This function sets the value of a bit of the
- * file system bitmap.
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_set_bitmap(struct fsck_sb *sdp, uint64 blkno, int state){
-	int           buf;
-	uint32_t        rgrp_block;
-	fs_bitmap_t	*bits = NULL;
-	struct fsck_rgrp	*rgd;
-
-	if((state != GFS_BLKST_FREE) && (state != GFS_BLKST_USED) &&
-	   (state != GFS_BLKST_FREEMETA) && (state != GFS_BLKST_USEDMETA)){
-		return -1;
-	}
-
-	rgd = fs_blk2rgrpd(sdp, blkno);
-
-	if(!rgd) {
-		log_err("Unable to get resource group for blkno %"PRIu64"\n",
-			blkno);
-		return -1;
-	}
-
-	if(fs_rgrp_read(rgd, FALSE)) {
-		stack;
-		return -1;
-	}
-	rgrp_block = (uint32_t)(blkno - rgd->rd_ri.ri_data1);
-	for(buf= 0; buf < rgd->rd_ri.ri_length; buf++){
-		bits = &(rgd->rd_bits[buf]);
-		if(rgrp_block < ((bits->bi_start + bits->bi_len)*GFS_NBBY)){
-			break;
-		}
-	}
-	if (buf < rgd->rd_ri.ri_length) {
-		fs_setbit((unsigned char *)BH_DATA(rgd->rd_bh[buf]) +
-			  bits->bi_offset,
-			  bits->bi_len,
-			  (rgrp_block - (bits->bi_start*GFS_NBBY)),
-			  state);
-		if(write_buf(sdp, rgd->rd_bh[buf], 0)){
-			fs_rgrp_relse(rgd);
-			return -1;
-		}
-	}
-	fs_rgrp_relse(rgd);
-	return 0;
-}
diff --git a/gfs/gfs_fsck/fs_bits.h b/gfs/gfs_fsck/fs_bits.h
deleted file mode 100644
index 7d889bc..0000000
--- a/gfs/gfs_fsck/fs_bits.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef __FS_BITS_H__
-#define __FS_BITS_H__
-
-#include "global.h"
-#include "rgrp.h"
-#include "fsck_incore.h"
-#include "fsck.h"
-
-#define BFITNOENT (0xFFFFFFFF)
-
-struct fs_bitmap
-{
-	uint32   bi_offset;	/* The offset in the buffer of the first byte */
-	uint32   bi_start;      /* The position of the first byte in this block */
-	uint32   bi_len;        /* The number of bytes in this block */
-};
-typedef struct fs_bitmap fs_bitmap_t;
-
-/* functions with blk #'s that are buffer relative */
-uint32_t fs_bitcount(unsigned char *buffer, unsigned int buflen,
-		     unsigned char state);
-uint32_t fs_bitfit(unsigned char *buffer, unsigned int buflen,
-		   uint32_t goal, unsigned char old_state);
-
-/* functions with blk #'s that are rgrp relative */
-uint32_t fs_blkalloc_internal(struct fsck_rgrp *rgd, uint32_t goal,
-			      unsigned char old_state,
-			      unsigned char new_state, int do_it);
-
-/* functions with blk #'s that are file system relative */
-int fs_get_bitmap(struct fsck_sb *sdp, uint64_t blkno, struct fsck_rgrp *rgd);
-int fs_set_bitmap(struct fsck_sb *sdp, uint64_t blkno, int state);
-
-#endif /* __FS_BITS_H__ */
diff --git a/gfs/gfs_fsck/fs_bmap.c b/gfs/gfs_fsck/fs_bmap.c
deleted file mode 100644
index ad4f8ac..0000000
--- a/gfs/gfs_fsck/fs_bmap.c
+++ /dev/null
@@ -1,529 +0,0 @@
-#include "util.h"
-#include "rgrp.h"
-#include "fs_inode.h"
-#include "bio.h"
-
-#include "fs_bmap.h"
-
-typedef struct metapath
-{
-	uint64              mp_list[GFS_MAX_META_HEIGHT];
-}metapath_t;
-
-
-/**
- * fs_unstuff_dinode - Unstuff a dinode when the data has grown too big
- * @ip: The GFS inode to unstuff
- * * This routine unstuffs a dinode and returns it to a "normal" state such
- * that the height can be grown in the traditional way.
- *
- * Returns: 0 on success, -EXXXX on failure
- */
-int fs_unstuff_dinode(struct fsck_inode *ip)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	osi_buf_t *bh = NULL;
-	osi_buf_t *dibh = NULL;
-	int journaled = fs_is_jdata(ip);
-	uint64 block = 0;
-	int error;
-
-	log_debug("Unstuffing inode %"PRIu64" - %u\n", ip->i_di.di_num.no_addr,
-		  journaled);
-
-	if(!fs_is_stuffed(ip)){
-		log_err("Trying to unstuff a dinode that is already unstuffed.\n");
-		return -1;
-	}
-
-
-	error = get_and_read_buf(sdp, ip->i_num.no_addr, &dibh, 0);
-	if (error) {
-		stack;
-		goto fail;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error) {
-		stack;
-		goto fail;
-	}
-
-	if (ip->i_di.di_size){
-		log_err("Allocating new block for unstuffed dinode\n");
-		if(journaled){
-			error = fs_metaalloc(ip, &block);
-			if (error) {
-				stack;
-				goto fail;
-			}
-			log_err("Got block %"PRIu64"\n", block);
-			error = get_buf(sdp, block, &bh);
-			if (error) {
-				stack;
-				goto fail;
-			}
-
-			set_meta(bh, GFS_METATYPE_JD, GFS_FORMAT_JD);
-
-			memcpy(BH_DATA(bh)+sizeof(struct gfs_meta_header),
-			       BH_DATA(dibh)+sizeof(struct gfs_dinode),
-			       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-			error = write_buf(sdp, bh, 0);
-			if(error) {
-				stack;
-				goto fail;
-			}
-			relse_buf(sdp, bh);
-			block_set(sdp->bl, block, journal_blk);
-		}
-		else{
-			error = fs_blkalloc(ip, &block);
-
-			if(error) {
-				stack;
-				goto fail;
-			}
-
-			error = get_buf(sdp, block, &bh);
-			if (error) {
-				stack;
-				goto fail;
-			}
-
-			memcpy(BH_DATA(bh)+sizeof(struct gfs_meta_header),
-			       BH_DATA(dibh)+sizeof(struct gfs_dinode),
-			       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-			error = write_buf(sdp, bh, 0);
-			if(error) {
-				stack;
-				goto fail;
-			}
-			relse_buf(sdp, bh);
-			block_set(sdp->bl, block, block_used);
-		}
-	}
-
-	bh = NULL;
-	/*  Set up the pointer to the new block  */
-
-	memset(BH_DATA(dibh)+sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-	if (ip->i_di.di_size){
-		((uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode)))[0] = cpu_to_gfs64(block);
-		ip->i_di.di_blocks++;
-	}
-
-	ip->i_di.di_height = 1;
-
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-	if(write_buf(sdp, dibh, 0)){
-		log_err("Dinode unstuffed, but unable to write back dinode.\n");
-		goto fail;
-	}
-	relse_buf(sdp, dibh);
-
-	return 0;
-
-
-
- fail:
-	if(bh) relse_buf(sdp, bh);
-	if(dibh) relse_buf(sdp, dibh);
-
-	return error;
-}
-
-
-/**
- * calc_tree_height - Calculate the height of a metadata tree
- * @ip: The GFS inode
- * @size: The proposed size of the file
- *
- * Work out how tall a metadata tree needs to be in order to accommodate a
- * file of a particular size. If size is less than the current size of
- * the inode, then the current size of the inode is used instead of the
- * supplied one.
- *
- * Returns: the height the tree should be
- */
-
-static unsigned int calc_tree_height(struct fsck_inode *ip, uint64 size)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	uint64 *arr;
-	unsigned int max, height;
-
-	if (ip->i_di.di_size > size)
-		size = ip->i_di.di_size;
-
-	if (fs_is_jdata(ip)){
-		arr = sdp->jheightsize;
-		max = sdp->max_jheight;
-	}
-	else{
-		arr = sdp->heightsize;
-		max = sdp->max_height;
-	}
-	for (height = 0; height < max; height++)
-		if (arr[height] >= size)
-			break;
-
-	return height;
-}
-
-
-/**
- * build_height - Build a metadata tree of the requested height
- * @ip: The GFS inode
- * @height: The height to build to
- *
- *
- * Returns: 0 on success, -EXXXX on failure
- */
-static int build_height(struct fsck_inode *ip, int height)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	osi_buf_t *bh, *dibh;
-	uint64 block, *bp;
-	unsigned int x;
-	int new_block;
-	int error;
-
-	while (ip->i_di.di_height < height){
-		error = get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &dibh, 0);
-		if (error)
-			goto fail;
-
-		new_block = FALSE;
-		bp = (uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode));
-		for (x = 0; x < sdp->diptrs; x++, bp++)
-			if (*bp){
-				new_block = TRUE;
-				break;
-			}
-
-
-		if (new_block){
-			/*  Get a new block, fill it with the old direct pointers and write it out  */
-			error = fs_metaalloc(ip, &block);
-			if (error)
-				goto fail_drelse;
-
-			error = get_and_read_buf(sdp, block, &bh, 0);
-			if (error)
-				goto fail_drelse;
-
-			set_meta(bh, GFS_METATYPE_IN, GFS_FORMAT_IN);
-			/*
-			  gfs_buffer_copy_tail(bh, sizeof(struct gfs_indirect),
-			  dibh, sizeof(struct gfs_dinode));
-			*/
-			log_err("ATTENTION -- Not doing copy_tail...\n");
-			exit(FSCK_ERROR);
-			error = -1;
-			goto fail_drelse;
-			if((error = write_buf(sdp, bh, 0))){
-				log_err( "Unable to write new buffer #%"PRIu64".\n",
-					BH_BLKNO(bh));
-				goto fail_drelse;
-			}
-			relse_buf(sdp, bh);
-		}
-
-
-		/*  Set up the new direct pointer and write it out to disk  */
-
-		memset(BH_DATA(dibh)+sizeof(struct gfs_dinode), 0,
-		       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-		if (new_block){
-			((uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode)))[0] = cpu_to_gfs64(block);
-			ip->i_di.di_blocks++;
-		}
-
-		ip->i_di.di_height++;
-
-		gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-		write_buf(sdp, dibh, 0);
-		relse_buf(sdp, dibh);
-	}
-
-	return 0;
-
-
-
- fail_drelse:
-	relse_buf(sdp, dibh);
-
- fail:
-	return error;
-}
-
-
-static void find_metapath(struct fsck_inode *ip, metapath_t *mp, uint64 block)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	unsigned int i;
-
-	for (i = ip->i_di.di_height; i--; ){
-		mp->mp_list[i] = block % sdp->inptrs;
-		block /= sdp->inptrs;
-	}
-}
-
-
-/**
- * metapointer - Return pointer to start of metadata in a buffer
- * @bh: The buffer
- * @level: The metadata level (0 = dinode)
- * @mp: The metapath
- *
- * Return a pointer to the block number of the next level of the metadata
- * tree given a buffer containing the pointer to the current level of the
- * metadata tree.
- */
-
-static uint64 *metapointer(osi_buf_t *bh, unsigned int level, metapath_t *mp)
-{
-	int head_size = (level > 0) ? sizeof(struct gfs_indirect) : sizeof(struct gfs_dinode);
-	return ((uint64 *)(BH_DATA(bh) + head_size)) + mp->mp_list[level];
-}
-
-
-/**
- * get_metablock - Get the next metadata block in metadata tree
- * @ip: The GFS inode
- * @bh: Buffer containing the pointers to metadata blocks
- * @level: The level of the tree (0 = dinode)
- * @mp: The metapath
- * @create: Non-zero if we may create a new meatdata block
- * @new: Used to indicate if we did create a new metadata block
- * @block: the returned disk block number
- *
- * Given a metatree, complete to a particular level, checks to see if the next
- * level of the tree exists. If not the next level of the tree is created.
- * The block number of the next level of the metadata tree is returned.
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static int get_metablock(struct fsck_inode *ip,
-			 osi_buf_t *bh, unsigned int level, metapath_t *mp,
-			 int create, int *new, uint64 *block)
-{
-	uint64 *ptr = metapointer(bh, level, mp);
-	int error = 0;
-
-	*new = 0;
-	*block = 0;
-
-	if (*ptr){
-		*block = gfs64_to_cpu(*ptr);
-		goto out;
-	}
-
-	if (!create)
-		goto out;
-
-	error = fs_metaalloc(ip, block);
-	if (error)
-		goto out;
-
-	*ptr = cpu_to_gfs64(*block);
-	ip->i_di.di_blocks++;
-	write_buf(ip->i_sbd, bh, 0);
-
-	*new = 1;
-
- out:
-	return error;
-}
-
-
-/**
- * get_datablock - Get datablock number from metadata block
- * @rgd: rgrp to allocate from if necessary
- * @ip: The GFS inode
- * @bh: The buffer containing pointers to datablocks
- * @mp: The metapath
- * @create: Non-zero if we may create a new data block
- * @new: Used to indicate if we created a new data block
- * @block: the returned disk block number
- *
- * Given a fully built metadata tree, checks to see if a particular data
- * block exists. It is created if it does not exist and the block number
- * on disk is returned.
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static int get_datablock(struct fsck_inode *ip,
-			 osi_buf_t *bh, metapath_t *mp,
-			 int create, int *new, uint64 *block)
-{
-	uint64 *ptr = metapointer(bh, ip->i_di.di_height - 1, mp);
-	int error = 0;
-
-	*new = 0;
-	*block = 0;
-
-
-	if (*ptr){
-		*block = gfs64_to_cpu(*ptr);
-		goto out;
-	}
-
-	if (!create)
-		goto out;
-
-	if (fs_is_jdata(ip)){
-		error = fs_metaalloc(ip, block);
-		if (error)
-			goto out;
-	}
-	else {
-		error = fs_blkalloc(ip, block);
-		if (error)
-			goto out;
-	}
-
-	*ptr = cpu_to_gfs64(*block);
-	ip->i_di.di_blocks++;
-	write_buf(ip->i_sbd, bh, 0);
-
-	*new = 1;
-
- out:
-	return error;
-}
-
-
-/**
- * fs_block_map - Map a block from an inode to a disk block
- * @ip: The GFS inode
- * @lblock: The logical block number
- * @new: Value/Result argument (1 = may create/did create new blocks)
- * @dblock: the disk block number of the start of an extent
- * @extlen: the size of the extent
- *
- * Find the block number on the current device which corresponds to an
- * inode's block. If the block had to be created, "new" will be set.
- *
- * Returns: 0 on success, -EXXX on failure
- */
-int fs_block_map(struct fsck_inode *ip, uint64 lblock, int *new,
-		 uint64 *dblock, uint32 *extlen)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	osi_buf_t *bh = NULL;
-	metapath_t mp;
-	int create = *new;
-	unsigned int bsize;
-	unsigned int height;
-	unsigned int x, end_of_metadata;
-	unsigned int nptrs;
-	uint64 tmp_dblock;
-	int tmp_new;
-	int error = 0;
-
-	*new = 0;
-	*dblock = 0;
-	if (extlen)
-		*extlen = 0;
-
-	if (fs_is_stuffed(ip)){
-		*dblock = ip->i_num.no_addr;
-		if (extlen)
-			*extlen = 1;
-		goto out;
-	}
-	bsize = (fs_is_jdata(ip)) ? sdp->jbsize : sdp->sb.sb_bsize;
-
-	height = calc_tree_height(ip, (lblock + 1) * bsize);
-	if (ip->i_di.di_height < height){
-		if (!create){
-			error = 0;
-			goto fail;
-		}
-
-		error = build_height(ip, height);
-		if (error)
-			goto fail;
-	}
-
-
-	error = get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &bh, 0);
-	if (error)
-		goto fail;
-
-
-	find_metapath(ip, &mp, lblock);
-	end_of_metadata = ip->i_di.di_height - 1;
-
-	for (x = 0; x < end_of_metadata; x++){
-		error = get_metablock(ip, bh, x, &mp, create, new, dblock);
-		relse_buf(ip->i_sbd, bh); bh = NULL;
-		if (error)
-			goto fail;
-		if (!*dblock)
-			goto out;
-
-		error = get_and_read_buf(ip->i_sbd, *dblock, &bh, 0);
-		if (error)
-			goto fail;
-	}
-
-
-	error = get_datablock(ip, bh, &mp, create, new, dblock);
-	if (error)
-		goto fail_drelse;
-
-	if (extlen && *dblock){
-		*extlen = 1;
-
-		if (!*new){
-			nptrs = (end_of_metadata) ? sdp->inptrs : sdp->diptrs;
-			while (++mp.mp_list[end_of_metadata] < nptrs){
-				error = get_datablock(ip, bh, &mp, 0, &tmp_new,
-						      &tmp_dblock);
-				if(error){
-					log_err( "Unable to perform get_datablock.\n");
-					goto fail;
-				}
-
-				if (*dblock + *extlen != tmp_dblock)
-					break;
-
-				(*extlen)++;
-			}
-		}
-	}
-
-
-	relse_buf(sdp, bh);
-
-
- out:
-	if (*new){
-		error = get_and_read_buf(sdp, ip->i_num.no_addr, &bh, 0);
-		if (error)
-			goto fail;
-		gfs_dinode_out(&ip->i_di, BH_DATA(bh));
-		write_buf(sdp, bh, 0);
-		relse_buf(sdp, bh);
-	}
-	return 0;
-
-
-
- fail_drelse:
-	if(bh)
-		relse_buf(sdp, bh);
-
- fail:
-	return error;
-}
diff --git a/gfs/gfs_fsck/fs_bmap.h b/gfs/gfs_fsck/fs_bmap.h
deleted file mode 100644
index 658a62e..0000000
--- a/gfs/gfs_fsck/fs_bmap.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __FS_BMAP_H__
-#define __FS_BMAP_H__
-
-#include "fsck_incore.h"
-
-int fs_unstuff_dinode(struct fsck_inode *ip);
-int fs_block_map(struct fsck_inode *ip, uint64 lblock, int *new,
-		 uint64 *dblock, uint32 *extlen);
-
-#endif /* __FS_BMAP_H__ */
diff --git a/gfs/gfs_fsck/fs_dir.c b/gfs/gfs_fsck/fs_dir.c
deleted file mode 100644
index c3db529..0000000
--- a/gfs/gfs_fsck/fs_dir.c
+++ /dev/null
@@ -1,1775 +0,0 @@
-#include "util.h"
-#include "file.h"
-#include "rgrp.h"
-#include "fsck_incore.h"
-#include "fs_inode.h"
-#include "bio.h"
-#include "link.h"
-#include "limits.h"
-#include "metawalk.h"
-#include "fs_dir.h"
-
-#define IS_LEAF     (1)
-#define IS_DINODE   (2)
-
-#define dir_hash(qstr) (gfs_dir_hash((char *)(qstr)->name, (qstr)->len))
-
-/* Detect directory is a stuffed inode */
-int fsck_inode_is_stuffed(struct fsck_inode *ip)
-{
-	return !ip->i_di.di_height;
-}
-
-/**
- * dirent_first - Return the first dirent
- * @bh: The buffer
- * @dent: Pointer to list of dirents
- *
- * return first dirent whether bh points to leaf or stuffed dinode
- *
- * Returns: IS_LEAF or IS_DINODE
- */
-int dirent_first(osi_buf_t *bh, struct gfs_dirent **dent)
-{
-	struct gfs_leaf *leaf;
-	struct gfs_dinode *dinode;
-
-	leaf = (struct gfs_leaf *)BH_DATA(bh);
-
-	if (gfs32_to_cpu(leaf->lf_header.mh_type) == GFS_METATYPE_LF)
-	{
-		*dent = (struct gfs_dirent *)(BH_DATA(bh) + sizeof(struct gfs_leaf));
-
-		return IS_LEAF;
-	}
-	else
-	{
-		dinode = (struct gfs_dinode *)BH_DATA(bh);
-		if(gfs32_to_cpu(dinode->di_header.mh_type) != GFS_METATYPE_DI){
-			log_err("buffer is not GFS_METATYPE_[DI | LF]\n");
-			return -1;
-		}
-
-		*dent = (struct gfs_dirent *)(BH_DATA(bh) + sizeof(struct gfs_dinode));
-
-		return IS_DINODE;
-	}
-}
-
-
-/**
- * dirent_next - Next dirent
- * @bh: The buffer
- * @dent: Pointer to list of dirents
- *
- * Returns: 0 on success, error code otherwise
- */
-static int dirent_next(osi_buf_t *bh, struct gfs_dirent **dent)
-{
-	struct gfs_dirent *tmp, *cur;
-	char *bh_end;
-	uint32 cur_rec_len;
-
-	cur = *dent;
-	bh_end = BH_DATA(bh) + BH_SIZE(bh);
-
-	cur_rec_len = gfs16_to_cpu(cur->de_rec_len);
-
-	if ((char *)cur + cur_rec_len >= bh_end){
-		if((char *)cur + cur_rec_len != bh_end){
-			log_err("Bad record length causing failure in dirent_next()\n");
-			return -1;
-		}
-		return -ENOENT;
-	}
-
-	tmp = (struct gfs_dirent *)((char *)cur + cur_rec_len);
-
-	if((char *)tmp + gfs16_to_cpu(tmp->de_rec_len) > bh_end){
-		log_err("Bad record length causing failure in dirent_next\n");
-		return -1;
-	}
-
-	/*  only the first dent could ever have de_ino == 0  */
-	if(!tmp->de_inum.no_formal_ino){
-		char tmp_name[256];
-
-		memcpy(tmp_name, cur+sizeof(struct gfs_dirent), gfs16_to_cpu(cur->de_name_len));
-		tmp_name[gfs16_to_cpu(cur->de_name_len)] = '\0';
-		log_err("dirent_next:  "
-			"A non-first dir entry has zero formal inode.\n");
-		log_err("\tFaulty dirent after (%s) in block #%"PRIu64".\n",
-			tmp_name, BH_BLKNO(bh));
-
-		return -1;
-	}
-
-	*dent = tmp;
-
-	return 0;
-}
-
-
-/**
- * dirent_del - Delete a dirent
- * @dip: The GFS inode
- * @bh: The buffer
- * @prev: The previous dirent
- * @cur: The current dirent
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int dirent_del(struct fsck_inode *dip, osi_buf_t *bh,
-	       struct gfs_dirent *prev, struct gfs_dirent *cur){
-	uint32 cur_rec_len, prev_rec_len;
-
-	dip->i_di.di_entries--;
-	if(!cur->de_inum.no_formal_ino){
-		log_err("dirent_del:  "
-			"Can not delete dirent with !no_formal_ino.\n");
-		return -1;
-	}
-
-	/*  If there is no prev entry, this is the first entry in the block.
-	    The de_rec_len is already as big as it needs to be.  Just zero
-	    out the inode number and return.  */
-
-	if (!prev){
-		cur->de_inum.no_formal_ino = 0;  /*  No endianess worries  */
-		if(write_buf(dip->i_sbd, bh, 0)){
-			log_err("dirent_del: Bad write_buf.\n");
-			return -EIO;
-		}
-		return 0;
-	}
-
-	/*  Combine this dentry with the previous one.  */
-
-	prev_rec_len = gfs16_to_cpu(prev->de_rec_len);
-	cur_rec_len = gfs16_to_cpu(cur->de_rec_len);
-
-	if((char *)prev + prev_rec_len != (char *)cur){
-		log_err("dirent_del: Bad bounds for directory entries.\n");
-		return -1;
-	}
-
-	if((char *)cur + cur_rec_len > BH_DATA(bh) + BH_SIZE(bh)){
-		log_err("dirent_del: Directory entry has record length"
-			" longer than buffer.\n");
-		return -1;
-	}
-
-	log_debug("Updating previous record from %u to %u\n",
-		  prev_rec_len, prev_rec_len+cur_rec_len);
-	prev_rec_len += cur_rec_len;
-	prev->de_rec_len = cpu_to_gfs16(prev_rec_len);
-
-	if(write_buf(dip->i_sbd, bh, 0)){
-		log_err("dirent_del: Bad write_buf.\n");
-		return -EIO;
-	}
-
-	return 0;
-}
-
-
-/**
- * get_leaf - Get leaf
- * @dip:
- * @leaf_no:
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int get_leaf(struct fsck_inode *dip, uint64 leaf_no, osi_buf_t **bhp)
-{
-	int error;
-
-	error = get_and_read_buf(dip->i_sbd, leaf_no, bhp, 0);
-
-	if (error) {
-		log_err("Unable to read leaf buffer #%"PRIu64"\n", leaf_no);
-		return error;
-	}
-
-	error = check_meta(*bhp, GFS_METATYPE_LF);
-
-	if(error) {
-		log_err("Metatype for block #%"PRIu64" is not type 'leaf'\n",
-			leaf_no);
-		relse_buf(dip->i_sbd, *bhp);
-	}
-	return error;
-}
-
-
-/**
- * get_first_leaf - Get first leaf
- * @dip: The GFS inode
- * @lindex:
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int get_first_leaf(struct fsck_inode *dip, uint32 lindex, osi_buf_t **bh_out)
-{
-	uint64 leaf_no;
-	int error;
-
-	error = get_leaf_nr(dip, lindex, &leaf_no);
-	if (!error)
-		error = get_leaf(dip, leaf_no, bh_out);
-
-	return error;
-}
-
-
-/**
- * get_next_leaf - Get next leaf
- * @dip: The GFS inode
- * @bh_in: The buffer
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int get_next_leaf(struct fsck_inode *dip,osi_buf_t *bh_in,osi_buf_t **bh_out)
-{
-	struct gfs_leaf *leaf;
-	int error;
-
-	leaf = (struct gfs_leaf *)BH_DATA(bh_in);
-
-	if (!leaf->lf_next)
-		error = -ENOENT;
-	else
-		error = get_leaf(dip, gfs64_to_cpu(leaf->lf_next), bh_out);
-	return error;
-}
-
-/**
- * leaf_search
- * @bh:
- * @id:
- * @dent_out:
- * @dent_prev:
- *
- * Returns:
- */
-static int leaf_search(osi_buf_t *bh, identifier_t *id,
-                       struct gfs_dirent **dent_out,
-		       struct gfs_dirent **dent_prev)
-{
-	uint32 hash;
-	struct gfs_dirent *dent, *prev = NULL;
-	unsigned int entries = 0, x = 0;
-	int type;
-
-	type = dirent_first(bh, &dent);
-
-	if (type == IS_LEAF){
-		struct gfs_leaf *leaf = (struct gfs_leaf *)BH_DATA(bh);
-		entries = gfs16_to_cpu(leaf->lf_entries);
-	} else if (type == IS_DINODE) {
-		struct gfs_dinode *dinode = (struct gfs_dinode *)(BH_DATA(bh));
-		entries = gfs32_to_cpu(dinode->di_entries);
-	} else {
-		log_err("type != IS_LEAF && type != IS_DINODE\n");
-		return -1;
-	}
-
-	if(id->type == ID_FILENAME){
-		hash = dir_hash(id->filename);
-
-		do{
-			if (!dent->de_inum.no_formal_ino){
-				prev = dent;
-				continue;
-			}
-
-			if (gfs32_to_cpu(dent->de_hash) == hash &&
-			    fs_filecmp(id->filename, (char *)(dent + 1),
-				       gfs16_to_cpu(dent->de_name_len))){
-				*dent_out = dent;
-				if (dent_prev)
-					*dent_prev = prev;
-				return 0;
-			}
-
-			if(x >= entries){
-				log_err("x >= entries (%u >= %u)\n", x, entries);
-				return -1;
-			}
-			x++;
-			prev = dent;
-		} while (dirent_next(bh, &dent) == 0);
-	} else if(id->type == ID_INUM){
-		struct gfs_inum inum;
-
-		do{
-			if (!dent->de_inum.no_formal_ino){
-				prev = dent;
-				continue;
-			}
-
-			gfs_inum_in(&inum, (char *)&dent->de_inum);
-
-			if(inum.no_addr == id->inum->no_addr){
-				*dent_out = dent;
-				if(dent_prev)
-					*dent_prev = prev;
-				return 0;
-			}
-
-			if(x >= entries){
-				log_err("x >= entries (%u >= %u)\n", x, entries);
-				return -1;
-			}
-			x++;
-			prev = dent;
-		} while (dirent_next(bh, &dent) == 0);
-	} else {
-		log_err("leaf_search:  Invalid type for identifier.\n");
-		exit(FSCK_ERROR);
-	}
-
-	return -ENOENT;
-}
-
-
-/**
- * linked_leaf_search - Linked leaf search
- * @dip: The GFS inode
- * @id:
- * @dent_out:
- * @dent_prev:
- * @bh_out:
- *
- * Returns: 0 on sucess, error code otherwise
- */
-
-static int linked_leaf_search(struct fsck_inode *dip, identifier_t *id,
-                              struct gfs_dirent **dent_out,
-			      struct gfs_dirent **dent_prev, osi_buf_t **bh_out)
-{
-	osi_buf_t *bh = NULL, *bh_next;
-	uint32 hsize, lindex;
-	uint32 hash;
-	int error = 0;
-
-	hsize = 1 << dip->i_di.di_depth;
-	if(hsize * sizeof(uint64) != dip->i_di.di_size){
-		log_err("hsize * sizeof(uint64) != dip->i_di.di_size\n");
-		return -1;
-	}
-
-	/*  Figure out the address of the leaf node.  */
-
-	if(id->type == ID_FILENAME){
-		hash = dir_hash(id->filename);
-		lindex = hash >> (32 - dip->i_di.di_depth);
-
-		error = get_first_leaf(dip, lindex, &bh_next);
-		if (error){
-			return error;
-		}
-
-		/*  Find the entry  */
-		do{
-			if (bh)
-				relse_buf(dip->i_sbd, bh);
-
-			bh = bh_next;
-
-			error = leaf_search(bh, id, dent_out, dent_prev);
-			switch (error){
-			case 0:
-				*bh_out = bh;
-				return 0;
-
-			case -ENOENT:
-				break;
-
-			default:
-				relse_buf(dip->i_sbd, bh);
-				return error;
-			}
-
-			error = get_next_leaf(dip, bh, &bh_next);
-		}while (!error);
-
-		relse_buf(dip->i_sbd, bh);
-	} else if(id->type == ID_INUM){
-		for(lindex=0; lindex < (1 << dip->i_di.di_depth); lindex++){
-			error = get_first_leaf(dip, lindex, &bh_next);
-			if (error){
-				return error;
-			}
-
-			/*  Find the entry  */
-			do{
-				if (bh)
-					relse_buf(dip->i_sbd, bh);
-
-				bh = bh_next;
-
-				error = leaf_search(bh, id, dent_out, dent_prev);
-				switch (error){
-				case 0:
-					*bh_out = bh;
-					return 0;
-
-				case -ENOENT:
-					break;
-
-				default:
-					relse_buf(dip->i_sbd, bh);
-					return error;
-				}
-
-				error = get_next_leaf(dip, bh, &bh_next);
-			}while (!error);
-		}
-	} else {
-		log_err("linked_leaf_search:  Invalid type for identifier.\n");
-		exit(FSCK_ERROR);
-	}
-	return error;
-}
-
-
-/**
- * dir_e_search -
- * @dip: The GFS inode
- * @id:
- * @inode:
- *
- * Returns:
- */
-static int dir_e_search(struct fsck_inode *dip, identifier_t *id, unsigned int *type)
-{
-	osi_buf_t *bh = NULL;
-	struct gfs_dirent *dent;
-	int error;
-
-	error = linked_leaf_search(dip, id, &dent, NULL, &bh);
-	if (error){
-		return error;
-	}
-
-	if(id->type == ID_FILENAME){
-		if(id->inum){
-			log_err("dir_e_search:  Illegal parameter.  inum must be NULL.\n");
-			exit(FSCK_ERROR);
-		}
-		if(!(id->inum = (struct gfs_inum *)malloc(sizeof(struct gfs_inum)))) {
-			log_err("Unable to allocate inum structure\n");
-			return -1;
-		}
-		if(!memset(id->inum, 0, sizeof(struct gfs_inum))) {
-			log_err("Unable to zero inum structure\n");
-			return -1;
-		}
-
-		gfs_inum_in(id->inum, (char *)&dent->de_inum);
-	} else {
-		if(id->filename){
-			log_err("dir_e_search:  Illegal parameter.  name must be NULL.\n");
-			exit(FSCK_ERROR);
-		}
-		if(!(id->filename = (osi_filename_t *)malloc(sizeof(osi_filename_t)))) {
-			log_err("Unable to allocate osi_filename structure\n");
-			return -1;
-		}
-		if(!(memset(id->filename, 0, sizeof(osi_filename_t)))) {
-			log_err("Unable to zero osi_filename structure\n");
-			return -1;
-		}
-
-		id->filename->len = gfs16_to_cpu(dent->de_name_len);
-		if(!(id->filename->name = malloc(id->filename->len))) {
-			log_err("Unable to allocate name in osi_filename structure\n");
-			free(id->filename);
-			return -1;
-		}
-		if(!(memset(id->filename->name, 0, id->filename->len))) {
-			log_err("Unable to zero name in osi_filename structure\n");
-			free(id->inum);
-			free(id->filename);
-			return -1;
-		}
-
-		memcpy(id->filename->name, (char *)dent+sizeof(struct gfs_dirent),
-		       id->filename->len);
-	}
-	if (type)
-		*type = gfs16_to_cpu(dent->de_type);
-
-	relse_buf(dip->i_sbd, bh);
-
-	return 0;
-}
-
-
-/**
- * dir_l_search -
- * @dip: The GFS inode
- * @id:
- * @inode:
- *
- * Returns:
- */
-static int dir_l_search(struct fsck_inode *dip, identifier_t *id, unsigned int *type)
-{
-	osi_buf_t *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	if(!fs_is_stuffed(dip)){
-		log_err("A linear search was attempted on a directory "
-			"that is not stuffed.\n");
-		return -1;
-	}
-
-	error = get_and_read_buf(dip->i_sbd, dip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-
-	error = leaf_search(dibh, id, &dent, NULL);
-	if (error)
-		goto out_drelse;
-
-	if(id->type == ID_FILENAME){
-		if(id->inum){
-			log_err("dir_l_search:  Illegal parameter.  inum must be NULL.\n");
-			exit(FSCK_ERROR);
-		}
-		id->inum = (struct gfs_inum *)malloc(sizeof(struct gfs_inum));
-		// FIXME: don't dereference NULL on failed malloc
-		memset(id->inum, 0, sizeof(struct gfs_inum));
-
-		gfs_inum_in(id->inum, (char *)&dent->de_inum);
-	} else {
-		if(id->filename){
-			log_err("dir_l_search:  Illegal parameter.  name must be NULL.\n");
-			exit(FSCK_ERROR);
-		}
-		id->filename = (osi_filename_t *)malloc(sizeof(osi_filename_t));
-		// FIXME: don't dereference NULL on failed malloc
-		memset(id->filename, 0, sizeof(osi_filename_t));
-
-		id->filename->len = gfs16_to_cpu(dent->de_name_len);
-		id->filename->name = malloc(id->filename->len);
-		// FIXME: don't dereference NULL on failed malloc
-		memset(id->filename->name, 0, id->filename->len);
-
-		memcpy(id->filename->name, (char *)dent+sizeof(struct gfs_dirent),
-		       id->filename->len);
-	}
-	if(type)
-		*type = gfs16_to_cpu(dent->de_type);
-
-
- out_drelse:
-	relse_buf(dip->i_sbd, dibh);
-
- out:
-	return error;
-}
-
-
-/**
- * dir_make_exhash - Convet a stuffed directory into an ExHash directory
- * @dip: The GFS inode
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int dir_make_exhash(struct fsck_inode *dip)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	struct gfs_dirent *dent;
-	osi_buf_t *bh = NULL, *dibh = NULL;
-	struct gfs_leaf *leaf;
-	int y;
-	uint32 x;
-	uint64 *lp, bn;
-	int error;
-
-	/*  Sanity checks  */
-
-	if(sizeof(struct gfs_leaf) > sizeof(struct gfs_dinode)){
-		log_err(
-			"dir_make_exhash:  on-disk leaf is larger than on-disk dinode.\n"
-			"                  Unable to expand directory.\n");
-		return -1;
-	}
-
-	error = get_and_read_buf(dip->i_sbd, dip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto fail;
-
-
-	error = fs_metaalloc(dip, &bn);
-
-	if (error)
-		goto fail_drelse;
-
-
-	/*  Turn over a new leaf  */
-
-	error = get_and_read_buf(sdp, bn, &bh, 0);
-	if (error)
-		goto fail_drelse;
-
-	if(check_meta(bh, 0)){
-		log_err("dir_make_exhash:  Buffer has bad meta header.\n");
-		goto fail_drelse;
-	}
-
-	set_meta(bh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-	memset(BH_DATA(bh) + sizeof(struct gfs_meta_header), 0,
-	       BH_SIZE(bh) - sizeof(struct gfs_meta_header));
-
-	/*  Fill in the leaf structure  */
-
-	leaf = (struct gfs_leaf *)BH_DATA(bh);
-
-	if(dip->i_di.di_entries >= (1 << 16)){
-		log_err(
-			"dir_make_exhash:  Too many directory entries.\n"
-			"                  Unable to expand directory.\n");
-		goto fail_drelse;
-	}
-	leaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-	leaf->lf_entries = cpu_to_gfs16(dip->i_di.di_entries);
-
-
-	/*  Copy dirents  */
-	memset(BH_DATA(bh)+sizeof(struct gfs_leaf), 0, BH_SIZE(bh)-sizeof(struct gfs_leaf));
-	memcpy(BH_DATA(bh)+sizeof(struct gfs_leaf),
-	       BH_DATA(dibh)+sizeof(struct gfs_dinode),
-	       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-	/*  Find last entry  */
-
-	x = 0;
-	dirent_first(bh, &dent);
-
-	do
-	{
-		if (!dent->de_inum.no_formal_ino)
-			continue;
-
-		if (++x == dip->i_di.di_entries)
-			break;
-	}
-	while (dirent_next(bh, &dent) == 0);
-
-
-	/*  Adjust the last dirent's record length
-	    (Remember that dent still points to the last entry.)  */
-
-	dent->de_rec_len = gfs16_to_cpu(dent->de_rec_len) +
-		sizeof(struct gfs_dinode) - sizeof(struct gfs_leaf);
-	dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-
-	if(write_buf(dip->i_sbd, bh, 0)){
-		log_err("dir_make_exhash:  bad write_buf()\n");
-		goto fail_drelse;
-	}
-	relse_buf(dip->i_sbd, bh); bh=NULL;
-
-	log_debug("Created a new leaf block at %"PRIu64"\n", bn);
-
-	block_set(dip->i_sbd->bl, bn, leaf_blk);
-	/*  We're done with the new leaf block, now setup the new
-	    hash table.  */
-
-	memset(BH_DATA(dibh) + sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh) - sizeof(struct gfs_dinode));
-
-	lp = (uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode));
-
-	for (x = sdp->hash_ptrs; x--; lp++)
-		*lp = cpu_to_gfs64(bn);
-
-	dip->i_di.di_size = sdp->sb.sb_bsize / 2;
-	dip->i_di.di_blocks++;
-	dip->i_di.di_flags |= GFS_DIF_EXHASH;
-	dip->i_di.di_payload_format = 0;
-
-	for (x = sdp->hash_ptrs, y = -1; x; x >>= 1, y++) ;
-	dip->i_di.di_depth = y;
-
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-
-	if(write_buf(dip->i_sbd, dibh, 0)){
-		log_err("dir_make_exhash: bad write_buf()\n");
-		goto fail_drelse;
-	}
-	relse_buf(dip->i_sbd, dibh); dibh = NULL;
-
-	return 0;
-
-
-
- fail_drelse:
-	if(bh)
-		relse_buf(dip->i_sbd, bh);
-	if(dibh)
-		relse_buf(dip->i_sbd, dibh);
-
- fail:
-	return error;
-}
-
-
-/**
- * dir_split_leaf - Split a leaf block into two
- * @dip: The GFS inode
- * @lindex:
- * @leaf_no:
- *
- * Returns: 0 on success, error code on failure
- */
-static int dir_split_leaf(struct fsck_inode *dip, uint32 lindex, uint64 leaf_no)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	osi_buf_t *nbh, *obh, *dibh;
-	struct gfs_leaf *nleaf, *oleaf;
-	struct gfs_dirent *dent, *prev = NULL, *next = NULL, *new;
-	uint32 start, len, half_len, divider;
-	uint64 bn, *lp;
-	uint32 name_len;
-	int x, moved = FALSE;
-	int error;
-
-	/*  Allocate the new leaf block  */
-
-	error = fs_metaalloc(dip, &bn);
-	if (error)
-		goto fail;
-
-
-	/*  Get the new leaf block  */
-	error = get_and_read_buf(sdp, bn, &nbh, 0);
-	if (error)
-		goto fail;
-
-	if(check_meta(nbh, 0)){
-		log_err("dir_split_leaf:  Buffer is not a meta buffer.\n");
-		relse_buf(sdp, nbh);
-		return -1;
-	}
-
-	set_meta(nbh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-
-	memset(BH_DATA(nbh)+sizeof(struct gfs_meta_header), 0,
-	       BH_SIZE(nbh)-sizeof(struct gfs_meta_header));
-
-	nleaf = (struct gfs_leaf *)BH_DATA(nbh);
-
-	nleaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-
-
-	/*  Get the old leaf block  */
-
-	error = get_leaf(dip, leaf_no, &obh);
-	if (error)
-		goto fail_nrelse;
-
-	oleaf = (struct gfs_leaf *)BH_DATA(obh);
-
-
-	/*  Compute the start and len of leaf pointers in the hash table.  */
-
-	len = 1 << (dip->i_di.di_depth - gfs16_to_cpu(oleaf->lf_depth));
-	if(len == 1){
-		log_err("dir_split_leaf:  Corrupted leaf block encountered.\n");
-		goto fail_orelse;
-	}
-	half_len = len >> 1;
-
-	start = (lindex & ~(len - 1));
-
-	log_debug("Splitting leaf: len = %u, half_len = %u\n", len, half_len);
-
-	/*  Change the pointers.
-	    Don't bother distinguishing stuffed from non-stuffed.
-	    This code is complicated enough already.  */
-
-	lp = (uint64 *)malloc(half_len * sizeof(uint64));
-	// FIXME: don't dereference NULL on failed malloc
-	memset(lp, 0, half_len * sizeof(uint64));
-
-	error = readi(dip, (char *)lp, start * sizeof(uint64),
-		      half_len * sizeof(uint64));
-	if (error != half_len * sizeof(uint64)){
-		if (error >= 0)
-			error = -EIO;
-		goto fail_lpfree;
-	}
-
-	/*  Change the pointers  */
-
-	for (x = 0; x < half_len; x++)
-		lp[x] = cpu_to_gfs64(bn);
-
-	error = writei(dip, (char *)lp, start * sizeof(uint64),
-		       half_len * sizeof(uint64));
-
-	if (error != half_len * sizeof(uint64)){
-		if (error >= 0)
-			error = -EIO;
-		goto fail_lpfree;
-	}
-
-	free(lp); lp = NULL;  /* need to set lp for failure cases */
-
-
-	/*  Compute the divider  */
-
-	divider = (start + half_len) << (32 - dip->i_di.di_depth);
-
-	/*  Copy the entries  */
-
-	dirent_first(obh, &dent);
-
-	do{
-		next = dent;
-		if (dirent_next(obh, &next))
-			next = NULL;
-
-		if (dent->de_inum.no_formal_ino &&
-		    (gfs32_to_cpu(dent->de_hash) < divider)){
-			name_len = gfs16_to_cpu(dent->de_name_len);
-
-			error = fs_dirent_alloc(dip, nbh, name_len, &new);
-			if(error){
-				log_err("dir_split_leaf:  fs_dirent_alloc failed.\n");
-				goto fail_orelse;
-			}
-
-			new->de_inum = dent->de_inum;  /*  No endianness worries  */
-			new->de_hash = dent->de_hash;  /*  No endianness worries  */
-			new->de_type = dent->de_type;  /*  No endianness worries  */
-			memcpy((char *)(new + 1), (char *)(dent + 1), name_len);
-
-			nleaf->lf_entries = gfs16_to_cpu(nleaf->lf_entries) + 1;
-			nleaf->lf_entries = cpu_to_gfs16(nleaf->lf_entries);
-
-			dirent_del(dip, obh, prev, dent);
-			/* Dirent del decrements entries, but we're
-			 * just shifting entries around, so increment
-			 * it again */
-			dip->i_di.di_entries++;
-
-			if(!gfs16_to_cpu(oleaf->lf_entries)){
-				log_err("dir_split_leaf:  old leaf contains no entries.\n");
-				goto fail_orelse;
-			}
-			oleaf->lf_entries = gfs16_to_cpu(oleaf->lf_entries) - 1;
-			oleaf->lf_entries = cpu_to_gfs16(oleaf->lf_entries);
-
-			if (!prev)
-				prev = dent;
-
-			moved = TRUE;
-		}
-		else
-			prev = dent;
-
-		dent = next;
-	}
-	while (dent);
-
-
-	/*  If none of the entries got moved into the new leaf,
-	    artificially fill in the first entry.  */
-
-	if (!moved){
-		error = fs_dirent_alloc(dip, nbh, 0, &new);
-		if(error){
-			log_err("dir_split_leaf:  fs_dirent_alloc failed..\n");
-			goto fail_orelse;
-		}
-		new->de_inum.no_formal_ino = 0;
-	}
-
-
-	oleaf->lf_depth = gfs16_to_cpu(oleaf->lf_depth) + 1;
-	oleaf->lf_depth = cpu_to_gfs16(oleaf->lf_depth);
-	nleaf->lf_depth = oleaf->lf_depth;
-
-
-	error = get_and_read_buf(dip->i_sbd, dip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err("dir_split_leaf:  Unable to get inode buffer.\n");
-		goto fail_orelse;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error){
-		log_err("dir_split_leaf:  Buffer #%"PRIu64" is not a directory "
-			"inode.\n", BH_BLKNO(dibh));
-		goto fail_drelse;
-	}
-
-	dip->i_di.di_blocks++;
-
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-	if(write_buf(sdp, dibh, 0)){
-		log_err("dir_split_leaf:  Failed to write new directory inode.\n");
-		goto fail_drelse;
-	}
-	relse_buf(sdp, dibh);
-
-
-	if(write_buf(sdp, obh, 0)){
-		log_err("dir_split_leaf:  Failed to write back old leaf block.\n");
-		goto fail_orelse;
-	}
-	relse_buf(sdp, obh);
-	if(write_buf(sdp, nbh, 0)){
-		log_err("dir_split_leaf:  Failed to write new leaf block.\n");
-		goto fail_nrelse;
-	}
-
-	log_debug("Created a new leaf block at %"PRIu64"\n", BH_BLKNO(nbh));
-
-	block_set(dip->i_sbd->bl, BH_BLKNO(nbh), leaf_blk);
-
-	relse_buf(sdp, nbh);
-
-	return 0;
-
-
-
- fail_drelse:
-	relse_buf(sdp, dibh);
-
- fail_lpfree:
-	if(lp) free(lp);
-
- fail_orelse:
-	relse_buf(sdp, obh);
-
- fail_nrelse:
-	relse_buf(sdp, nbh);
-
- fail:
-	return -1;
-}
-
-
-/**
- * dir_double_exhash - Double size of ExHash table
- * @dip: The GFS dinode
- *
- * Returns: 0 on success, -1 on failure
- */
-static int dir_double_exhash(struct fsck_inode *dip)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	osi_buf_t *dibh;
-	uint32 hsize;
-	uint64 *buf;
-	uint64 *from, *to;
-	uint64 block;
-	int x;
-	int error = 0;
-
-	/*  Sanity Checks  */
-
-	hsize = 1 << dip->i_di.di_depth;
-	if(hsize * sizeof(uint64) != dip->i_di.di_size){
-		log_err("dir_double_exhash:  "
-			"hash size does not correspond to di_size.\n");
-		return -1;
-	}
-
-
-	/*  Allocate both the "from" and "to" buffers in one big chunk  */
-
-	buf = (uint64 *)malloc(3 * sdp->hash_bsize);
-	if(!buf){
-		log_err("dir_double_exhash:  "
-			"Unable to allocate memory for blk ptr list.\n");
-		return -1;
-	}
-	memset(buf, 0, 3 * sdp->hash_bsize);
-
-	for (block = dip->i_di.di_size / sdp->hash_bsize; block--;){
-		error = readi(dip, (char *)buf, block * sdp->hash_bsize,
-			      sdp->hash_bsize);
-		if (error != sdp->hash_bsize){
-			if (error >= 0)
-				error = -EIO;
-			goto out;
-		}
-
-		from = buf;
-		to = (uint64 *)((char *)buf + sdp->hash_bsize);
-
-		for (x = sdp->hash_ptrs; x--; from++){
-			*to++ = *from;  /*  No endianess worries  */
-			*to++ = *from;
-		}
-
-		error = writei(dip, (char *)buf + sdp->hash_bsize,
-			       block * sdp->sb.sb_bsize, sdp->sb.sb_bsize);
-		if (error != sdp->sb.sb_bsize){
-			if (error >= 0)
-				error = -EIO;
-			goto out;
-		}
-	}
-
-	free(buf); buf=NULL;
-
-
-	error = get_and_read_buf(sdp, dip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err("dir_double_exhash:  "
-			"Unable to get inode buffer.\n");
-		return -1;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error){
-		log_err("dir_double_exhash:  "
-			"Buffer does not contain directory inode.\n");
-		relse_buf(sdp, dibh);
-		return -1;
-	}
-
-	dip->i_di.di_depth++;
-
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-	if(write_buf(sdp, dibh, 0)){
-		log_err("dir_double_exhash:  "
-			"Unable to write out directory inode.\n");
-		relse_buf(sdp, dibh);
-		return -1;
-	}
-
-	relse_buf(sdp, dibh);
-
-	return 0;
-
-
- out:
-	if(buf) free(buf);
-
-	return error;
-}
-
-
-static int dir_e_del(struct fsck_inode *dip, osi_filename_t *filename){
-	int lindex;
-	int error;
-	int found = 0;
-	uint64 leaf_no;
-	osi_buf_t *bh;
-	identifier_t id;
-	struct gfs_dirent *cur, *prev;
-
-	id.type = ID_FILENAME;
-	id.filename = filename;
-	id.inum = NULL;
-
-	lindex = (1 << (dip->i_di.di_depth))-1;
-
-	for(; (lindex >= 0) && !found; lindex--){
-		error = get_leaf_nr(dip, lindex, &leaf_no);
-		if (error){
-			log_err("dir_e_del:  Unable to get leaf number.\n");
-			return error;
-		}
-
-		while(leaf_no && !found){
-			if(get_leaf(dip, leaf_no, &bh)){
-				stack;
-				return -1;
-			}
-
-			error = leaf_search(bh, &id, &cur, &prev);
-			if(id.inum) free(id.inum);
-
-			if(error){
-				if(error != -ENOENT){
-					log_err("dir_e_del:  leaf_search failed.\n");
-					relse_buf(dip->i_sbd, bh);
-					return -1;
-				}
-				leaf_no = gfs64_to_cpu(((struct gfs_leaf *)BH_DATA(bh))->lf_next);
-				relse_buf(dip->i_sbd, bh);
-			} else {
-				found = 1;
-			}
-		}
-	}
-
-	if(!found)
-		return 1;
-
-	if(dirent_del(dip, bh, prev, cur)){
-		log_err("dir_e_del:  dirent_del failed.\n");
-		relse_buf(dip->i_sbd, bh);
-		return -1;
-	}
-
-	relse_buf(dip->i_sbd, bh);
-	return 0;
-}
-
-
-static int dir_l_del(struct fsck_inode *dip, osi_buf_t *dibh,
-		     osi_filename_t *filename){
-	int error=0;
-	int got_buf = 0;
-	struct gfs_dirent *cur, *prev;
-	identifier_t id;
-
-	id.type = ID_FILENAME;
-	id.filename = filename;
-	id.inum = NULL;
-
-	if(!fs_is_stuffed(dip)){
-		log_crit("dir_l_del: Attempting linear delete on unstuffed"
-			 " dinode.\n");
-		return -1;
-	}
-
-	if(!dibh) {
-		error = get_and_read_buf(dip->i_sbd, dip->i_num.no_addr,
-					 &dibh, 0);
-		if (error){
-			log_err("dir_l_del:  Failed to read in dinode buffer.\n");
-			return -1;
-		}
-		got_buf = 1;
-	}
-
-	error = leaf_search(dibh, &id, &cur, &prev);
-	if(id.inum) free(id.inum);
-
-	if(error){
-		if(error == -ENOENT){
-			log_debug("dir_l_del found no entry\n");
-			if(got_buf)
-				relse_buf(dip->i_sbd, dibh);
-			return 1;
-		} else {
-			log_err("dir_l_del:  leaf_search failed.\n");
-			if(got_buf)
-				relse_buf(dip->i_sbd, dibh);
-			return -1;
-		}
-	}
-
-	if(dirent_del(dip, dibh, prev, cur)){
-		stack;
-		if(got_buf)
-			relse_buf(dip->i_sbd, dibh);
-		return -1;
-	}
-
-	if(got_buf)
-		relse_buf(dip->i_sbd, dibh);
-	return 0;
-}
-
-
-/*
- * fs_dirent_del
- * @dip
- * filename
- *
- * Delete a directory entry from a directory.  This _only_
- * removes the directory entry - leaving the dinode in
- * place.  (Likely without a link.)
- *
- * Returns: 0 on success (or if it doesn't already exist), -1 on failure
- */
-int fs_dirent_del(struct fsck_inode *dip, osi_buf_t *bh, osi_filename_t *filename){
-	int error;
-
-	if(dip->i_di.di_type != GFS_FILE_DIR){
-		log_err("fs_dirent_del:  parent inode is not a directory.\n");
-		return -1;
-	}
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_del(dip, filename);
-	else
-		error = dir_l_del(dip, bh, filename);
-
-	return error;
-
-}
-
-
-/**
- * dir_e_add -
- * @dip: The GFS inode
- * @filename:
- * @inode:
- * @type:
- *
- */
-static int dir_e_add(struct fsck_inode *dip, osi_filename_t *filename,
-                     struct gfs_inum *inum, unsigned int type)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	osi_buf_t *bh, *nbh, *dibh;
-	struct gfs_leaf *leaf, *nleaf;
-	struct gfs_dirent *dent;
-	uint32 hsize, lindex;
-	uint32 hash;
-	uint64 leaf_no, bn;
-	int error;
-
- restart:
-
-	/*  Sanity Checks  */
-
-	hsize = 1 << dip->i_di.di_depth;
-	if(hsize * sizeof(uint64) != dip->i_di.di_size){
-		log_err("dir_e_add:  hash size and di_size do not correspond.\n");
-		return -1;
-	}
-
-	/*  Figure out the address of the leaf node.  */
-
-	hash = dir_hash(filename);
-	lindex = hash >> (32 - dip->i_di.di_depth);
-
-
-	error = get_leaf_nr(dip, lindex, &leaf_no);
-	if (error){
-		log_err("dir_e_add:  Unable to get leaf number.\n");
-		return error;
-	}
-
-
-	/*  Add entry to the leaf  */
-
-	while (TRUE){
-		error = get_leaf(dip, leaf_no, &bh);
-		if (error){
-			log_err("dir_e_add:  Unable to get leaf #%"PRIu64"\n", leaf_no);
-			return error;
-		}
-
-		leaf = (struct gfs_leaf *)BH_DATA(bh);
-
-
-		if (fs_dirent_alloc(dip, bh, filename->len, &dent)){
-			if (gfs16_to_cpu(leaf->lf_depth) < dip->i_di.di_depth){
-				/*  Can we split the leaf?  */
-				relse_buf(sdp, bh);
-
-				error = dir_split_leaf(dip, lindex, leaf_no);
-				if (error){
-					log_err("dir_e_add:  Unable to split leaf.\n");
-					return error;
-				}
-
-				goto restart;
-			}
-			else if (dip->i_di.di_depth < GFS_DIR_MAX_DEPTH){
-				/*  Can we double the hash table?  */
-				relse_buf(sdp, bh);
-
-				error = dir_double_exhash(dip);
-				if (error){
-					log_err("dir_e_add:  Unable to double exhash.\n");
-					return error;
-				}
-
-				goto restart;
-			}
-			else if (leaf->lf_next){
-				/*  Can we try the next leaf in the list?  */
-				leaf_no = gfs64_to_cpu(leaf->lf_next);
-				relse_buf(sdp, bh);
-				continue;
-			}
-			else {
-				/*  Create a new leaf and add it to the list.  */
-				error = fs_metaalloc(dip, &bn);
-				if (error){
-					relse_buf(sdp, bh);
-					log_err("dir_e_add:  "
-						"Unable to allocate space for meta block.\n");
-					return error;
-				}
-
-				error = get_and_read_buf(sdp, bn, &nbh, 0);
-				if (error){
-					relse_buf(sdp, bh);
-					return error;
-				}
-
-				/*gfs_trans_add_bh(sdp, dip->i_gl, nbh);*/
-				if(check_meta(nbh, 0)){
-					log_err("dir_e_add:  Buffer is not a meta buffer.\n");
-					relse_buf(sdp, bh);
-					relse_buf(sdp, nbh);
-					return -1;
-				}
-				set_meta(nbh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-				/* Make sure the bitmap is updated */
-				log_debug("Setting leaf block at %"PRIu64"\n",
-					  bn);
-				block_set(dip->i_sbd->bl, bn, leaf_blk);
-				memset(BH_DATA(nbh)+sizeof(struct gfs_meta_header), 0,
-				       BH_SIZE(nbh)-sizeof(struct gfs_meta_header));
-
-				/*gfs_trans_add_bh(sdp, dip->i_gl, bh);*/
-				leaf->lf_next = cpu_to_gfs64(bn);
-
-				nleaf = (struct gfs_leaf *)BH_DATA(nbh);
-				nleaf->lf_depth = leaf->lf_depth;
-				nleaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-
-				if (fs_dirent_alloc(dip, nbh, filename->len, &dent)){
-					log_err("dir_e_add:  Uncircumventible error!\n");
-					exit(FSCK_ERROR);
-				}
-
-				dip->i_di.di_blocks++;
-
-				/* ATTENTION -- check for errors */
-				write_buf(sdp, nbh, BW_WAIT);
-				write_buf(sdp, bh, 0);
-				relse_buf(sdp, bh);
-
-				bh = nbh;
-				leaf = nleaf;
-			}
-		}
-
-
-		gfs_inum_out(inum, (char *)&dent->de_inum);
-		dent->de_hash = cpu_to_gfs32(hash);
-		dent->de_type = cpu_to_gfs16(type);
-		memcpy((char *)(dent + 1), filename->name, filename->len);
-
-		leaf->lf_entries = gfs16_to_cpu(leaf->lf_entries) + 1;
-		leaf->lf_entries = cpu_to_gfs16(leaf->lf_entries);
-
-		write_buf(sdp, bh, 0);
-		relse_buf(sdp, bh);
-
-		error = get_and_read_buf(dip->i_sbd, dip->i_num.no_addr, &dibh, 0);
-		if(error){
-			log_err("dir_e_add:  Unable to get inode buffer.\n");
-			return error;
-		}
-
-		error = check_meta(dibh, GFS_METATYPE_DI);
-		if(error){
-			log_err("dir_e_add:  Buffer #%"PRIu64" is not a directory "
-				"inode.\n", BH_BLKNO(dibh));
-			relse_buf(sdp, dibh);
-			return error;
-		}
-
-		dip->i_di.di_entries++;
-		dip->i_di.di_mtime = dip->i_di.di_ctime = osi_current_time();
-		log_debug("Entries for %"PRIu64" is %u\n", dip->i_di.di_num.no_addr,
-			dip->i_di.di_entries);
-
-		gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-		write_buf(sdp, dibh, 0);
-		relse_buf(sdp, dibh);
-
-		return 0;
-	}
-
-	return -ENOENT;
-}
-
-
-/**
- * dir_l_add -
- * @dip: The GFS inode
- * @filename:
- * @inode:
- * @type:
- *
- * Returns:
- */
-
-static int dir_l_add(struct fsck_inode *dip, osi_filename_t *filename,
-                     struct gfs_inum *inum, unsigned int type)
-{
-	osi_buf_t *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	/*  Sanity checks  */
-
-	if(!fs_is_stuffed(dip)){
-		log_err("dir_l_add:  Attempting linear add on unstuffed dinode.\n");
-		return -1;
-	}
-
-	error = get_and_read_buf(dip->i_sbd, dip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-
-	if (fs_dirent_alloc(dip, dibh, filename->len, &dent))
-	{
-		/* no need to write buffer, it hasn't changed. */
-		relse_buf(dip->i_sbd, dibh);
-
-		error = dir_make_exhash(dip);
-		/* DEBUG */
-		log_debug("Changing Linear dir to Exhash dir - %s\n",
-			  (error)? "UNSUCCESSFUL": "SUCCESSFUL");
-		if (!error)
-			error = dir_e_add(dip, filename, inum, type);
-
-		goto out;
-	}
-
-
-	gfs_inum_out(inum, (char *)&dent->de_inum);
-	dent->de_hash = dir_hash(filename);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(type);
-	memcpy((char *)(dent + 1), filename->name, filename->len);
-
-
-	dip->i_di.di_entries++;
-	dip->i_di.di_mtime = dip->i_di.di_ctime = osi_current_time();
-	log_debug("Entries for %"PRIu64" is %u\n", dip->i_di.di_num.no_addr,
-		dip->i_di.di_entries);
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-	if(write_buf(dip->i_sbd, dibh, 0)){
-		log_err("dir_l_add:  bad write_buf()\n");
-		error = -EIO;
-	}
-
-	relse_buf(dip->i_sbd, dibh);
-
- out:
-	if(error){
-		char tmp_name[256];
-		memset(tmp_name, 0, sizeof(tmp_name));
-		memcpy(tmp_name, filename->name, filename->len);
-		log_err("Unable to add \"%s\" to directory #%"PRIu64"\n",
-			tmp_name, dip->i_num.no_addr);
-	}
-	return error;
-}
-
-
-
-/**
- * fs_dir_add - Add new filename into directory
- * @dip: The GFS inode
- * @filename: The new name
- * @inode: The inode number of the entry
- * @type: The type of the entry
- *
- * Returns: 0 on success, error code on failure
- */
-int fs_dir_add(struct fsck_inode *dip, osi_filename_t *filename,
-	       struct gfs_inum *inum, unsigned int type)
-{
-	int error;
-
-	if(dip->i_di.di_type != GFS_FILE_DIR){
-		log_err("fs_dir_add:  parent inode is not a directory.\n");
-		return -1;
-	}
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_add(dip, filename, inum, type);
-	else
-		error = dir_l_add(dip, filename, inum, type);
-
-	return error;
-}
-
-
-/**
- * fs_dirent_alloc - Allocate a directory entry
- * @dip: The GFS inode
- * @bh: The buffer
- * @name_len: The length of the name
- * @dent_out: Pointer to list of dirents
- *
- * Returns: 0 on success, error code otherwise
- */
-int fs_dirent_alloc(struct fsck_inode *dip, osi_buf_t *bh,
-		    int name_len, struct gfs_dirent **dent_out)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	struct gfs_dirent *dent, *new;
-	struct gfs_leaf *leaf;
-	struct gfs_dinode *dinode;
-	unsigned int rec_len = GFS_DIRENT_SIZE(name_len);
-	unsigned int entries = 0, offset = 0, x = 0;
-	int type;
-
-	type = dirent_first(bh, &dent);
-
-	if (type == IS_LEAF){
-		leaf = (struct gfs_leaf *)BH_DATA(bh);
-		entries = gfs16_to_cpu(leaf->lf_entries);
-		offset = sizeof(struct gfs_leaf);
-	}
-	else if (type == IS_DINODE) {
-		dinode = (struct gfs_dinode *)BH_DATA(bh);
-		entries = gfs32_to_cpu(dinode->di_entries);
-		offset = sizeof(struct gfs_dinode);
-	} else {
-		log_err("fs_dirent_alloc:  Buffer has bad metatype.\n");
-		return -1;
-	}
-
-	if (!entries){
-		dent->de_rec_len = BH_SIZE(bh) - offset;
-		dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-		dent->de_name_len = cpu_to_gfs16(name_len);
-
-		*dent_out = dent;
-		write_buf(sdp, bh, 0);
-		goto success;
-	}
-
-
-	do{
-		uint32 cur_rec_len, cur_name_len;
-
-		cur_rec_len = gfs16_to_cpu(dent->de_rec_len);
-		cur_name_len = gfs16_to_cpu(dent->de_name_len);
-
-		if ((!dent->de_inum.no_formal_ino && cur_rec_len >= rec_len) ||
-		    (cur_rec_len >= GFS_DIRENT_SIZE(cur_name_len) + rec_len)){
-			if (dent->de_inum.no_formal_ino){
-				new = (struct gfs_dirent *)((char *)dent + GFS_DIRENT_SIZE(cur_name_len));
-				memset(new, 0, sizeof(struct gfs_dirent));
-
-				new->de_rec_len = cpu_to_gfs16(cur_rec_len - GFS_DIRENT_SIZE(cur_name_len));
-				new->de_name_len = cpu_to_gfs16(name_len);
-
-				dent->de_rec_len = cur_rec_len - gfs16_to_cpu(new->de_rec_len);
-				dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-
-				*dent_out = new;
-				write_buf(sdp, bh, 0);
-				goto success;
-			}
-
-			dent->de_name_len = cpu_to_gfs16(name_len);
-
-			*dent_out = dent;
-			write_buf(sdp, bh, 0);
-			goto success;
-		}
-
-		if(x >= entries){
-			log_err("fs_dirent_alloc:  dirents contain bad length information.\n");
-			return -1;
-		}
-
-		if (dent->de_inum.no_formal_ino)
-			x++;
-	}
-	while(dirent_next(bh, &dent) == 0);
-
-	return -ENOSPC;
-
- success:
-	return 0;
-}
-
-
-/**
- * get_leaf_nr - Get a leaf number associated with the lindex
- * @dip: The GFS inode
- * @lindex:
- * @leaf_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int get_leaf_nr(struct fsck_inode *dip, uint32 lindex, uint64 *leaf_out)
-{
-	uint64 leaf_no;
-	int error = -1;
-	error = readi(dip, (char *)&leaf_no,
-		      lindex * sizeof(uint64), sizeof(uint64));
-	if (error != sizeof(uint64)){
-		log_debug("get_leaf_nr:  Bad internal read.  (rtn = %d)\n",
-			  error);
-		return (error < 0) ? error : -EIO;
-	}
-
-	*leaf_out = gfs64_to_cpu(leaf_no);
-
-	return 0;
-}
-
-
-/**
- * put_leaf_nr - Put a leaf number associated with the lindex
- * @dip: The GFS inode
- * @lindex:
- * @leaf_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int put_leaf_nr(struct fsck_inode *dip, uint32 lindex, uint64 leaf_out)
-{
-	uint64 leaf_no;
-	int error = -1;
-
-	leaf_no = cpu_to_gfs64(leaf_out);
-
-	error = writei(dip, (char *)&leaf_no,
-		       lindex * sizeof(uint64), sizeof(uint64));
-	if (error != sizeof(uint64)){
-		log_debug("put_leaf_nr:  Bad internal write.  (rtn = %d)\n",
-			  error);
-		return (error < 0) ? error : -EIO;
-	}
-
-	return 0;
-}
-
-
-/**
- * fs_filecmp - Compare two filenames
- * @file1: The first filename
- * @file2: The second filename
- * @len_of_file2: The length of the second file
- *
- * This routine compares two filenames and returns TRUE if they are equal.
- *
- * Returns: TRUE (!=0) if the files are the same, otherwise FALSE (0).
- */
-int fs_filecmp(osi_filename_t *file1, char *file2, int len_of_file2)
-{
-	if (file1->len != len_of_file2){
-		return FALSE;
-	}
-
-	if (osi_memcmp(file1->name, file2, file1->len)){
-		return FALSE;
-	}
-	return TRUE;
-}
-
-
-/**
- * fs_dir_search - Search a directory
- * @dip: The GFS inode
- * @id
- * @type:
- *
- * This routine searches a directory for a file or another directory
- * given its identifier.  The component of the identifier that is
- * not being used to search will be filled in and must be freed by
- * the caller.
- *
- * Returns: 0 if found, -1 on failure, -ENOENT if not found.
- */
-int fs_dir_search(struct fsck_inode *dip, identifier_t *id,  unsigned int *type)
-{
-	int error;
-
-	if(dip->i_di.di_type != GFS_FILE_DIR){
-		log_err("An attempt was made to search an inode "
-			"that is not a directory.\n");
-		return -1;
-	}
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_search(dip, id, type);
-	else
-		error = dir_l_search(dip, id, type);
-
-	return error;
-}
-
-/**
- * dirent_repair - attempt to repair a corrupt directory entry.
- * @bh - The buffer header that contains the bad dirent
- * @de - The directory entry in native format
- * @dent - The directory entry in on-disk format
- * @type - Type of directory (DIR_LINEAR or DIR_EXHASH)
- * @first - TRUE if this is the first dirent in the buffer
- *
- * This function tries to repair a corrupt directory entry.  All we
- * know at this point is that the length field is wrong.
- */
-int dirent_repair(struct fsck_inode *ip, osi_buf_t *bh, struct gfs_dirent *de, 
-		  struct gfs_dirent *dent, int type, int first)
-{
-	char *bh_end, *p;
-	int calc_de_name_len = 0;
-	
-	/* If this is a sentinel, just fix the length and move on */
-	if (first && !de->de_inum.no_formal_ino) { /* Is it a sentinel? */
-		if (type == DIR_LINEAR)
-			de->de_rec_len = BH_SIZE(bh) -
-				sizeof(struct gfs_dinode);
-		else
-			de->de_rec_len = BH_SIZE(bh) - sizeof(struct gfs_leaf);
-	} else {
-		bh_end = BH_DATA(bh) + BH_SIZE(bh);
-		/* first, figure out a probable name length */
-		p = (char *)dent + sizeof(struct gfs_dirent);
-		while (*p &&         /* while there's a non-zero char and */
-		       p < bh_end) { /* not past end of buffer */
-			calc_de_name_len++;
-			p++;
-		}
-		if (!calc_de_name_len)
-			return 1;
-		/* There can often be noise at the end, so only          */
-		/* Trust the shorter of the two in case we have too much */
-		/* Or rather, only trust ours if it's shorter.           */
-		if (!de->de_name_len || de->de_name_len > NAME_MAX ||
-		    calc_de_name_len < de->de_name_len) /* if dent is hosed */
-			de->de_name_len = calc_de_name_len; /* use ours */
-		de->de_rec_len = GFS_DIRENT_SIZE(de->de_name_len);
-	}
-	gfs_dirent_out(de, (char *)dent);
-	write_buf(ip->i_sbd, bh, 0);
-	return 0;
-}
-
-/**
- * dirblk_truncate - truncate a directory block
- */
-void dirblk_truncate(struct fsck_inode *ip, struct gfs_dirent *fixb,
-		     osi_buf_t *bh)
-{
-	char *bh_end;
-	struct gfs_dirent de;
-	uint16_t old_rec_len;
-
-	bh_end = BH_DATA(bh) + BH_SIZE(bh);
-	/* truncate the block to save the most dentries.  To do this we
-	   have to patch the previous dent. */
-	gfs_dirent_in(&de, (char *)fixb);
-	old_rec_len = de.de_rec_len;
-	de.de_rec_len = bh_end - (char *)fixb;
-	gfs_dirent_out(&de, (char *)fixb);
-	write_buf(ip->i_sbd, bh, 0);
-}
diff --git a/gfs/gfs_fsck/fs_dir.h b/gfs/gfs_fsck/fs_dir.h
deleted file mode 100644
index f741723..0000000
--- a/gfs/gfs_fsck/fs_dir.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef __FS_DIR_H__
-#define __FS_DIR_H__
-
-#include "osi_user.h"
-#include "fsck_incore.h"
-
-#define ID_FILENAME 0
-#define ID_INUM     1
-typedef struct identifier_s {
-	int type;
-
-	osi_filename_t *filename;
-	struct gfs_inum *inum;
-} identifier_t;
-
-int dirent_del(struct fsck_inode *dip, osi_buf_t *bh,
-	       struct gfs_dirent *prev, struct gfs_dirent *cur);
-int fsck_inode_is_stuffed(struct fsck_inode *ip);
-int dirent_first(osi_buf_t *bh, struct gfs_dirent **dent);
-int get_leaf_nr(struct fsck_inode *dip, uint32 index, uint64 *leaf_out);
-int put_leaf_nr(struct fsck_inode *dip, uint32 index, uint64 leaf_out);
-int fs_filecmp(osi_filename_t *file1, char *file2, int len_of_file2);
-int fs_dirent_del(struct fsck_inode *dip, osi_buf_t *bh, osi_filename_t *filename);
-int fs_dir_add(struct fsck_inode *dip, osi_filename_t *filename,
-	       struct gfs_inum *inum, unsigned int type);
-int fs_dirent_alloc(struct fsck_inode *dip, osi_buf_t *bh,
-		    int name_len, struct gfs_dirent **dent_out);
-
-int fs_dir_search(struct fsck_inode *dip, identifier_t *id, unsigned int *type);
-int dirent_repair(struct fsck_inode *ip, osi_buf_t *bh, struct gfs_dirent *de, 
-		  struct gfs_dirent *dent, int type, int first);
-void dirblk_truncate(struct fsck_inode *ip, struct gfs_dirent *fixb,
-		     osi_buf_t *bh);
-
-#endif /* __FS_DIR_H__ */
diff --git a/gfs/gfs_fsck/fs_inode.c b/gfs/gfs_fsck/fs_inode.c
deleted file mode 100644
index 61529a3..0000000
--- a/gfs/gfs_fsck/fs_inode.c
+++ /dev/null
@@ -1,602 +0,0 @@
-#include "util.h"
-#include "bio.h"
-#include "fs_bits.h"
-#include "fs_dir.h"
-#include "rgrp.h"
-#include "log.h"
-
-#include "fs_inode.h"
-
-#define ST_CREATE 1
-
-/**
- * fs_get_istruct - Get an inode given its number
- * @sdp: The GFS superblock
- * @inum: The inode number
- * @create: Flag to say if we are allowed to create a new struct fsck_inode
- * @ipp: pointer to put the returned inode in
- *
- * Returns: 0 on success, -1 on error
- */
-static int fs_get_istruct(struct fsck_sb *sdp, struct gfs_inum *inum,
-			  int create, struct fsck_inode **ipp)
-{
-	struct fsck_inode *ip = NULL;
-	int error = 0;
-
-	if (!create){
-		/* we are not currently tracking which inodes we already have */
-		error = -1;
-		goto out;
-	}
-
-	if(!(ip = (struct fsck_inode *)malloc(sizeof(struct fsck_inode)))) {
-		log_err("Unable to allocate fsck_inode structure\n");
-		error = -1;
-		goto out;
-	}
-	if(!memset(ip, 0, sizeof(struct fsck_inode))) {
-		log_err("Unable to zero fsck_inode structure\n");
-		error = -1;
-		goto out;
-	}
-
-	ip->i_num = *inum;
-
-	ip->i_sbd = sdp;
-
-	error = fs_copyin_dinode(ip, NULL);
-	if (error){
-		free(ip);
-		ip = NULL;
-		goto out;
-	}
-
- out:
-	*ipp = ip;
-
-	return error;
-}
-
-
-/*
- * fs_copyin_dinode - read dinode from disk and store in inode
- * @ip: inode, sdp and inum must be set
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_copyin_dinode(struct fsck_inode *ip, osi_buf_t *dibh)
-{
-/*	osi_buf_t *dibh;*/
-	int do_relse = 0;
-	int error = 0;
-
-	if(!dibh) {
-		error = get_and_read_buf(ip->i_sbd,
-					 ip->i_num.no_addr, &dibh, 0);
-		if (error) {
-			stack;
-			goto out;
-		}
-
-		if(check_meta(dibh, GFS_METATYPE_DI)){
-			log_err("Block #%"PRIu64" is not a dinode.\n",
-				ip->i_num.no_addr);
-			relse_buf(ip->i_sbd, dibh);
-			return -1;
-		}
-		do_relse = 1;
-	}
-	gfs_dinode_in(&ip->i_di, BH_DATA(dibh));
-
-	if(do_relse)
-		relse_buf(ip->i_sbd, dibh);
-
-	
-
- out:
-	return error;
-}
-
-
-/*
- * fs_copyout_dinode - given an inode, copy its dinode data to disk
- * @ip: the inode
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_copyout_dinode(struct fsck_inode *ip){
-	osi_buf_t *dibh;
-	int error;
-
-	error = get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err( "Unable to get a buffer to write dinode to disk.\n");
-		return -1;
-	}
-
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-
-	if(write_buf(ip->i_sbd, dibh, 0)){
-		log_err( "Unable to commit dinode buffer to disk.\n");
-		relse_buf(ip->i_sbd, dibh);
-		return -1;
-	}
-
-	relse_buf(ip->i_sbd, dibh);
-	return 0;
-}
-
-/**
- * make_dinode - Fill in a new dinode structure
- * @dip: the directory this inode is being created in
- * @inum: the inode number
- * @type: the file type
- * @mode: the file permissions
- * @cred: a credentials structure
- *
- */
-
-static int make_dinode(struct fsck_inode *dip, struct gfs_inum *inum,
-                       unsigned int type, unsigned int mode, osi_cred_t *cred)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	struct gfs_dinode di;
-	osi_buf_t *dibh;
-	struct fsck_rgrp *rgd;
-	int error;
-
-	error = get_and_read_buf(sdp, inum->no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-	if(check_meta(dibh, 0)){
-		log_err("make_dinode:  Buffer #%"PRIu64" has no meta header.\n",
-			BH_BLKNO(dibh));
-		errors_found++;
-		if(query(dip->i_sbd, "Add header? (y/n) ")){
-			struct gfs_meta_header mh;
-			memset(&mh, 0, sizeof(struct gfs_meta_header));
-			mh.mh_magic = GFS_MAGIC;
-			mh.mh_type = GFS_METATYPE_NONE;
-			gfs_meta_header_out(&mh, BH_DATA(dibh));
-			log_warn("meta header added.\n");
-			errors_corrected++;
-		} else {
-			log_err("meta header not added.  Failing make_dinode.\n");
-			relse_buf(sdp, dibh);
-			return -1;
-		}
-	}
-
-	((struct gfs_meta_header *)BH_DATA(dibh))->mh_type =
-		cpu_to_gfs32(GFS_METATYPE_DI);
-	((struct gfs_meta_header *)BH_DATA(dibh))->mh_format =
-		cpu_to_gfs32(GFS_FORMAT_DI);
-
-	memset(BH_DATA(dibh) + sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh) - sizeof(struct gfs_dinode));
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-
-	gfs_meta_header_in(&di.di_header, BH_DATA(dibh));
-
-	di.di_num = *inum;
-
-	if (dip->i_di.di_mode & 02000)
-	{
-		di.di_mode = mode | ((type == GFS_FILE_DIR) ? 02000 : 0);
-		di.di_gid = dip->i_di.di_gid;
-	}
-	else
-	{
-		di.di_mode = mode;
-		di.di_gid = osi_cred_to_gid(cred);
-	}
-
-	di.di_uid = osi_cred_to_uid(cred);
-	di.di_nlink = 1;
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = osi_current_time();
-
-	rgd = fs_blk2rgrpd(sdp, inum->no_addr);
-	if(!rgd){
-		log_err( "Unable to map block #%"PRIu64" to rgrp\n", inum->no_addr);
-		exit(FSCK_ERROR);
-	}
-
-	di.di_rgrp = rgd->rd_ri.ri_addr;
-	di.di_goal_rgrp = di.di_rgrp;
-	di.di_goal_dblk = di.di_goal_mblk = inum->no_addr - rgd->rd_ri.ri_data1;
-
-	di.di_type = type;
-
-	gfs_dinode_out(&di, BH_DATA(dibh));
-	if(write_buf(dip->i_sbd, dibh, 0)){
-		log_err( "make_dinode:  bad write_buf()\n");
-		error = -EIO;
-	}
-
-	relse_buf(dip->i_sbd, dibh);
-
-
- out:
-
-	return error;
-}
-
-#if 0
-/**
- * fs_change_nlink - Change nlink count on inode
- * @ip: The GFS inode
- * @diff: The change in the nlink count required
- *
- * Returns: 0 on success, -EXXXX on failure.
- */
-static int fs_change_nlink(struct fsck_inode *ip, int diff)
-{
-	osi_buf_t *dibh;
-	uint32 nlink;
-	int error=0;
-
-	nlink = ip->i_di.di_nlink + diff;
-
-	if (diff < 0)
-		if(nlink >= ip->i_di.di_nlink)
-			log_err( "fs_change_nlink:  Bad link count detected in dinode.\n");
-
-	error = get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-	ip->i_di.di_nlink = nlink;
-	ip->i_di.di_ctime = osi_current_time();
-
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-	write_buf(ip->i_sbd, dibh, 0);
-	relse_buf(ip->i_sbd,dibh);
-
- out:
-	return error;
-}
-#endif
-/**
- * fs_lookupi - Look up a filename in a directory and return its inode
- * @dip: The directory to search
- * @name: The name of the inode to look for
- * @cred: The caller's credentials
- * @ipp: Used to return the found inode if any
- *
- * Returns: 0 on success, -EXXXX on failure
- */
-static int fs_lookupi(struct fsck_inode *dip, osi_filename_t *name,
-		      osi_cred_t *cred, struct fsck_inode **ipp)
-{
-	struct fsck_sb *sdp = dip->i_sbd;
-	int error = 0;
-	identifier_t id;
-
-	memset(&id, 0, sizeof(identifier_t));
-	id.filename = name;
-	id.type = ID_FILENAME;
-
-	*ipp = NULL;
-
-	if (!name->len || name->len > GFS_FNAMESIZE)
-	{
-		error = -ENAMETOOLONG;
-		goto out;
-	}
-
-	if (fs_filecmp(name, (char *)".", 1))
-	{
-		*ipp = dip;
-		goto out;
-	}
-
-	error = fs_dir_search(dip, &id, NULL);
-	if (error){
-		if (error == -ENOENT)
-			error = 0;
-		goto out;
-	}
-
-	error = fs_get_istruct(sdp, id.inum, ST_CREATE, ipp);
-
- out:
-
-	if(id.inum) free(id.inum);
-	return error;
-}
-
-static int fs_createi(struct fsck_inode *dip, osi_filename_t *name,
-	       unsigned int type, unsigned int mode, osi_cred_t *cred,
-	       int *new, struct fsck_inode **ipp)
-{
-	osi_list_t *tmp=NULL;
-	struct fsck_sb *sdp = dip->i_sbd;
-	struct gfs_inum inum;
-	int error;
-	int allocate=0;
-	identifier_t id;
-
-	memset(&id, 0, sizeof(identifier_t));
-
-	if (!name->len || name->len > GFS_FNAMESIZE){
-		error = -ENAMETOOLONG;
-		goto fail;
-	}
-
- restart:
-
-	/*  Don't create entries in an unlinked directory  */
-	if (!dip->i_di.di_nlink){
-		error = -EPERM;
-		goto fail;
-	}
-
-	id.filename = name;
-	id.type = ID_FILENAME;
-
-	error = fs_dir_search(dip, &id, NULL);
-	if(id.inum) free(id.inum);
-	switch (error)
-	{
-	case -ENOENT:
-		break;
-
-	case 0:
-		if (!new){
-			error = -EEXIST;
-			goto fail;
-		} else {
-			error = fs_lookupi(dip, name, cred, ipp);
-			if (error)
-				goto fail;
-
-			if (*ipp){
-				*new = FALSE;
-				return 0;
-			} else
-				goto restart;
-		}
-		break;
-
-	default:
-		goto fail;
-	}
-
-	if (dip->i_di.di_entries == (uint32)-1){
-		error = -EFBIG;
-		goto fail;
-	}
-	if (type == GFS_FILE_DIR && dip->i_di.di_nlink == (uint32)-1){
-		error = -EMLINK;
-		goto fail;
-	}
-
- retry:
-	inum.no_addr = inum.no_formal_ino = 0;
-	for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next){
-		uint64 block;
-		struct fsck_rgrp *rgd;
-
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-		if(fs_rgrp_read(rgd, FALSE))
-			return -1;
-		if(rgd->rd_rg.rg_freemeta){
-			block = fs_blkalloc_internal(rgd, dip->i_num.no_addr,
-						     GFS_BLKST_FREEMETA,
-						     GFS_BLKST_USEDMETA, 1);
-			log_debug("Got block %"PRIu64"\n", block);
-			if(block == BFITNOENT) {
-				fs_rgrp_relse(rgd);
-				continue;
-			}
-			block += rgd->rd_ri.ri_data1;
-			log_debug("Got block #%"PRIu64"\n", block);
-			inum.no_addr = inum.no_formal_ino = block;
-			rgd->rd_rg.rg_freemeta--;
-			rgd->rd_rg.rg_useddi++;
-
-			if(fs_rgrp_recount(rgd)){
-				log_err(  "fs_createi:  Unable to recount rgrp blocks.\n");
-				fs_rgrp_relse(rgd);
-				error = -EIO;
-				goto fail;
-			}
-
-			/* write out the rgrp */
-			gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-			write_buf(sdp, rgd->rd_bh[0], 0);
-			fs_rgrp_relse(rgd);
-			break;
-		} else {
-			if(allocate){
-				if(!clump_alloc(rgd, 0)){
-					block = fs_blkalloc_internal(rgd, dip->i_num.no_addr,
-								     GFS_BLKST_FREEMETA,
-								     GFS_BLKST_USEDMETA, 1);
-					log_debug("Got block %"PRIu64"\n",
-						  block);
-					if(block == BFITNOENT) {
-						fs_rgrp_relse(rgd);
-						continue;
-					}
-					block += rgd->rd_ri.ri_data1;
-
-					inum.no_addr = inum.no_formal_ino = block;
-					rgd->rd_rg.rg_freemeta--;
-					rgd->rd_rg.rg_useddi++;
-
-					if(fs_rgrp_recount(rgd)){
-						log_err( "fs_createi:  Unable to recount rgrp blocks.\n");
-						fs_rgrp_relse(rgd);
-						error = -EIO;
-						goto fail;
-					}
-
-					/* write out the rgrp */
-					gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-					write_buf(sdp, rgd->rd_bh[0], 0);
-					fs_rgrp_relse(rgd);
-					break;
-				}
-			}
-			fs_rgrp_relse(rgd);
-		}
-	}
-
-	if(!inum.no_addr){
-		if(allocate){
-			log_err( "No space available for new file or directory.\n");
-			return -1;
-		} else {
-			allocate = 1;
-			goto retry;
-		}
-	}
-
-	error = fs_dir_add(dip, name, &inum, type);
-	if (error)
-		goto fail;
-
-	error = make_dinode(dip, &inum, type, mode, cred);
-	if (error)
-		goto fail;
-
-
-	error = fs_get_istruct(sdp, &inum, ST_CREATE, ipp);
-	if (error)
-		goto fail;
-
-	if (new)
-		*new = TRUE;
-
-	return 0;
-
- fail:
-	return error;
-}
-
-
-/*
- * fs_mkdir - make a directory
- * @dip - dir inode that is the parent of the new dir
- * @new_dir - name of the new dir
- * @mode - mode of new dir
- * @nip - returned inode ptr to the new directory
- *
- * This function has one main difference from the way a normal mkdir
- * works.  It will not return an error if the directory already
- * exists.  Instead it will return success and nip will point to the
- * inode that exists with the same name as new_dir.
- *
- * Returns: 0 on success, -1 on failure.
- */
-int fs_mkdir(struct fsck_inode *dip, const char *new_dir, int mode, struct fsck_inode **nip){
-	int error;
-	osi_cred_t creds;
-	osi_buf_t *dibh;
-	struct gfs_dinode *di;
-	struct gfs_dirent *dent;
-	struct fsck_inode *ip= NULL;
-	struct fsck_sb *sdp = dip->i_sbd;
-	osi_filename_t name;
-	int new = 0;
-
-	name.name = (unsigned char *)new_dir;
-	name.len = strlen(new_dir);
-	creds.cr_uid = getuid();
-	creds.cr_gid = getgid();
-
-	error = fs_createi(dip, &name, GFS_FILE_DIR, mode, &creds, &new, &ip);
-
-	if (error)
-		goto fail;
-
-	if(!new){
-		goto out;
-	}
-
-	if(!ip){
-		log_err(  "fs_mkdir:  fs_createi() failed.\n");
-		error = -1;
-		goto fail;
-	}
-
-	ip->i_di.di_nlink = 2;
-	ip->i_di.di_size = sdp->sb.sb_bsize - sizeof(struct gfs_dinode);
-	ip->i_di.di_flags |= GFS_DIF_JDATA;
-	ip->i_di.di_payload_format = GFS_FORMAT_DE;
-	ip->i_di.di_entries = 2;
-
-	error = get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err( "fs_mkdir:  Unable to aquire directory buffer.\n");
-		goto fail;
-	}
-
-	di = (struct gfs_dinode *)BH_DATA(dibh);
-
-	error = fs_dirent_alloc(ip, dibh, 1, &dent);
-	if(error){  /*  This should never fail  */
-		log_err( "fs_mkdir:  fs_dirent_alloc() failed for \".\" entry.\n");
-		goto fail;
-	}
-
-	dent->de_inum = di->di_num;  /*  already GFS endian  */
-	dent->de_hash = gfs_dir_hash(".", 1);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(GFS_FILE_DIR);
-	memcpy((char *)(dent + 1), ".", 1);
-	di->di_entries = cpu_to_gfs32(1);
-
-	error = fs_dirent_alloc(ip, dibh, 2, &dent);
-	if(error){  /*  This should never fail  */
-		log_err( "fs_mkdir:  fs_dirent_alloc() failed for \"..\" entry.\n");
-		goto fail;
-	}
-	gfs_inum_out(&dip->i_num, (char *)&dent->de_inum);
-	dent->de_hash = gfs_dir_hash("..", 2);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(GFS_FILE_DIR);
-	memcpy((char *)(dent + 1), "..", 2);
-
-	gfs_dinode_out(&ip->i_di, (char *)di);
-	if(write_buf(ip->i_sbd, dibh, 0)){
-		log_err( "fs_mkdir:  Bad write_buf()\n");
-		error = -EIO;
-		goto fail;
-	}
-
-	relse_buf(ip->i_sbd, dibh);
-
-
-	/* FIXME: this may break stuff elsewhere, but since I'm
-	 * keeping track of the linkcount in-core, we shouldn't need
-	 * to do this...
-
-	error = fs_change_nlink(dip, +1);
-	if(error){
-		log_err( "fs_mkdir:  fs_change_nlink() failed.\n");
-		goto fail;
-		} */
-
- out:
-	error=0;
-	if(nip) {
-		*nip = ip;
-	}
-	else if(ip) {
-		free(ip);
-		ip = NULL;
-	}
-	return 0;
- fail:
-	if(ip)
-		free(ip);
-	return error;
-}
-
-
diff --git a/gfs/gfs_fsck/fs_inode.h b/gfs/gfs_fsck/fs_inode.h
deleted file mode 100644
index d1d2c2b..0000000
--- a/gfs/gfs_fsck/fs_inode.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __FS_INODE_H__
-#define __FS_INODE_H__
-
-#include "fsck_incore.h"
-
-int fs_copyin_dinode(struct fsck_inode *ip, osi_buf_t *bh);
-int fs_copyout_dinode(struct fsck_inode *ip);
-int fs_mkdir(struct fsck_inode *dip, const char *new_dir, int mode, struct fsck_inode **nip);
-int fs_remove(struct fsck_inode *ip);
-
-static __inline__ int fs_is_stuffed(struct fsck_inode *ip)
-{
-	return !ip->i_di.di_height;
-}
-
-static __inline__ int fs_is_jdata(struct fsck_inode *ip)
-{
-	return ip->i_di.di_flags & GFS_DIF_JDATA;
-}
-
-
-#endif /*  __FS_INODE_H__ */
diff --git a/gfs/gfs_fsck/fs_recovery.c b/gfs/gfs_fsck/fs_recovery.c
deleted file mode 100644
index 76980a2..0000000
--- a/gfs/gfs_fsck/fs_recovery.c
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "util.h"
-#include "bio.h"
-
-#include "fs_recovery.h"
-
-/*
- * reconstruct_single_journal - write a fresh journal
- * @sdp: superblock
- * @jnum: journal number
- *
- * This function will write a fresh journal over the top of
- * the previous journal.  All journal information is lost.  This
- * process is basically stolen from write_journals() in the mkfs code.
- *
- * Returns: -1 on error, 0 otherwise
- */
-static int reconstruct_single_journal(struct fsck_sb *sdp, int jnum){
-  struct gfs_log_header	lh;
-  struct gfs_jindex    	*jdesc = &(sdp->jindex[jnum]);
-  uint32		seg, sequence;
-  char			buf[sdp->sb.sb_bsize];
-
-  srandom(time(NULL));
-  sequence = jdesc->ji_nsegment / (RAND_MAX + 1.0) * random();
-
-  log_info("Clearing journal %d\n", jnum);
-
-  for (seg = 0; seg < jdesc->ji_nsegment; seg++){
-    memset(buf, 0, sdp->sb.sb_bsize);
-    memset(&lh, 0, sizeof(struct gfs_log_header));
-
-    lh.lh_header.mh_magic = GFS_MAGIC;
-    lh.lh_header.mh_type = GFS_METATYPE_LH;
-    lh.lh_header.mh_format = GFS_FORMAT_LH;
-    lh.lh_header.mh_generation = 0x101674;
-    lh.lh_flags = GFS_LOG_HEAD_UNMOUNT;
-    lh.lh_first = jdesc->ji_addr + seg * sdp->sb.sb_seg_size;
-    lh.lh_sequence = sequence;
-
-    gfs_log_header_out(&lh, buf);
-    gfs_log_header_out(&lh,
-		       buf + GFS_BASIC_BLOCK - sizeof(struct gfs_log_header));
-
-    if(do_lseek(sdp->diskfd, lh.lh_first * sdp->sb.sb_bsize) ||
-       do_write(sdp->diskfd, buf, sdp->sb.sb_bsize)){
-      log_err("Unable to reconstruct journal %d.\n", jnum);
-      return -1;
-    }
-
-    if (++sequence == jdesc->ji_nsegment)
-      sequence = 0;
-  }
-  return 0;
-}
-
-
-/*
- * reconstruct_journals - write fresh journals
- * sdp: the super block
- *
- * Returns: 0 on success, -1 on failure
- */
-int reconstruct_journals(struct fsck_sb *sdp){
-	int i;
-
-	log_notice("Clearing journals (this may take a while)");
-	for(i=0; i < sdp->journals; i++) {
-		if((i % 2) == 0)
-			log_at_notice(".");
-		if(reconstruct_single_journal(sdp, i))
-			return -1;
-	}
-	log_notice("\nJournals cleared.\n");
-	return 0;
-}
diff --git a/gfs/gfs_fsck/fs_recovery.h b/gfs/gfs_fsck/fs_recovery.h
deleted file mode 100644
index 7460310..0000000
--- a/gfs/gfs_fsck/fs_recovery.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __FS_RECOVERY_H__
-#define __FS_RECOVERY_H__
-
-#include "fsck_incore.h"
-
-int reconstruct_journals(struct fsck_sb *sdp);
-
-#endif /* __FS_RECOVERY_H__ */
-
diff --git a/gfs/gfs_fsck/fsck.h b/gfs/gfs_fsck/fsck.h
deleted file mode 100644
index d9d0e57..0000000
--- a/gfs/gfs_fsck/fsck.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _FSCK_H
-#define _FSCK_H
-
-
-#include "fsck_incore.h"
-#include "log.h"
-
-/*
- * Exit codes used by fsck-type programs
- * Copied from e2fsck's e2fsck.h
- */
-#define FSCK_OK          0      /* No errors */
-#define FSCK_NONDESTRUCT 1      /* File system errors corrected */
-#define FSCK_REBOOT      2      /* System should be rebooted */
-#define FSCK_UNCORRECTED 4      /* File system errors left uncorrected */
-#define FSCK_ERROR       8      /* Operational error */
-#define FSCK_USAGE       16     /* Usage or syntax error */
-#define FSCK_CANCELED    32     /* Aborted with a signal or ^C */
-#define FSCK_LIBRARY     128    /* Shared library error */
-
-struct gfs_sb;
-struct fsck_sb;
-
-struct options {
-	char *device;
-	int yes:1;
-	int no:1;
-};
-
-extern uint64_t last_fs_block, last_reported_block;
-extern int skip_this_pass, fsck_abort, fsck_query;
-extern int errors_found, errors_corrected;
-
-int initialize(struct fsck_sb *sbp);
-void destroy(struct fsck_sb *sbp);
-int block_mounters(struct fsck_sb *sbp, int block_em);
-int pass1(struct fsck_sb *sbp);
-int pass1b(struct fsck_sb *sbp);
-int pass1c(struct fsck_sb *sbp);
-int pass2(struct fsck_sb *sbp, struct options *opts);
-int pass3(struct fsck_sb *sbp, struct options *opts);
-int pass4(struct fsck_sb *sbp, struct options *opts);
-int pass5(struct fsck_sb *sbp, struct options *opts);
-
-/* FIXME: Hack to get this going for pass2 - this should be pulled out
- * of pass1 and put somewhere else... */
-int add_to_dir_list(struct fsck_sb *sbp, uint64_t block);
-
-#endif /* _FSCK_H */
diff --git a/gfs/gfs_fsck/fsck_incore.h b/gfs/gfs_fsck/fsck_incore.h
deleted file mode 100644
index 3b46b8a..0000000
--- a/gfs/gfs_fsck/fsck_incore.h
+++ /dev/null
@@ -1,137 +0,0 @@
-#ifndef _FSCK_INCORE_H
-#define _FSCK_INCORE_H
-
-#include <stdint.h>
-#include "ondisk.h"
-#include "osi_list.h"
-#include "osi_user.h"
-#include "fs_bits.h"
-#include "block_list.h"
-
-#define SBF_RECONSTRUCT_JOURNALS (1)
-
-#define FSCK_HASH_SHIFT         (13)
-#define FSCK_HASH_SIZE          (1 << FSCK_HASH_SHIFT)
-#define FSCK_HASH_MASK          (FSCK_HASH_SIZE - 1)
-
-struct fsck_sb;
-
-struct inode_info
-{
-	osi_list_t list;
-	uint64_t   inode;
-	uint32_t   link_count;   /* the number of links the inode
-				  * thinks it has */
-	uint32_t   counted_links; /* the number of links we've found */
-};
-
-struct dir_info
-{
-	osi_list_t list;
-	uint64_t dinode;
-	uint64_t treewalk_parent;
-	uint64_t dotdot_parent;
-	uint8_t  checked:1;
-
-};
-
-/*  Use to manage in core bitmaps  */
-
-struct bitmap_list
-{
-  osi_list_t list;
-  char *bm;
-  struct fsck_rgrp *rgd;
-};
-
-/*
- *  Incore inode structure
- */
-
-struct fsck_inode
-{
-	struct fsck_sb           *i_sbd;           /* GFS superblock pointer */
-	struct gfs_inum          i_num;
-	struct gfs_dinode         i_di;             /* Dinode Structure */
-};
-
-struct fsck_rgrp
-{
-	struct fsck_sb            *rd_sbd;        /* ptr to in-core super block */
-	osi_list_t          rd_list;        /* Link with superblock */
-
-	struct gfs_rindex        rd_ri;          /* Resource Index structure */
-	struct gfs_rgrp          rd_rg;          /* Resource Group structure */
-
-	int32_t               rd_open_count;  /* # of open references on this rgrpd */
-
-	fs_bitmap_t         *rd_bits;
-	osi_buf_t           **rd_bh;
-};
-
-
-
-struct fsck_sb {
-	struct gfs_sb	sb;            /* Super Block */
-	int		diskfd;
-	uint32_t	flags;
-	char		fsname[256];
-
-	/* Special inodes */
-	struct fsck_inode	*lf_dip;       /* lost-n-found dir inode */
-	struct fsck_inode       *jiinode;
-        struct fsck_inode       *riinode;
-	struct fsck_inode       *rooti;
-
-	/* rgrp stuff */
-	osi_list_t	rglist;        /* List of resource groups */
-	unsigned int	rgcount;       /* Count of resource groups */
-
-	/* journal stuff */
-	unsigned int  journals;  /* Number of journals in the FS */
-	uint32_t ji_nsegment;    /* number of journal segments per journal */
-	struct gfs_jindex  *jindex;   /* Array of Jindex structs for
-				       * this FS's journals */
-	struct gfs_jindex  jdesc;     /* Jindex struct for this
-				       * machine's journal */
-
-	/*  Constants computed on mount  */
-	uint32_t fsb2bb_shift;  /* Shift FS Block numbers to the left by
-				   this to get buffer cache blocks  */
-	uint32_t diptrs;        /* Number of pointers in a dinode */
-	uint32_t inptrs;        /* Number of pointers in a indirect block */
-	uint32_t jbsize;        /* Size of a journaled data block */
-	uint32_t hash_bsize;    /* sizeof(exhash block) */
-	uint32_t hash_ptrs;     /* Number of points in a hash block */
-	uint32_t max_height;    /* Maximum height of a file's metadata tree */
-	uint64_t heightsize[GFS_MAX_META_HEIGHT];
-	uint32_t max_jheight;   /* Max height of a journaled file's metadata tree */
-	uint64_t jheightsize[GFS_MAX_META_HEIGHT];
-
-	uint64_t last_fs_block;
-	uint64_t last_data_block;
-	uint64_t first_data_block;
-
-	/* dir_list is used to keep track of directory inodes and
-	 * their parents */
-	osi_list_t dir_hash[FSCK_HASH_SIZE];
-
-	/* inode_list is used to keep track of the link count of
-	 * inodes */
-	osi_list_t inode_hash[FSCK_HASH_SIZE];
-
-	/* contains list of data and metadata blocks and various info
-	 * about each */
-	struct block_list *bl;
-
-	osi_list_t dup_list;
-
-	/* fsck_opts is used to pass command line params around */
-	struct options *opts;
-
-};
-
-
-
-
-#endif /* _FSCK_INCORE_H */
diff --git a/gfs/gfs_fsck/hash.c b/gfs/gfs_fsck/hash.c
deleted file mode 100644
index b151021..0000000
--- a/gfs/gfs_fsck/hash.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This is the same hash algorithm used by the glocks in gfs */
-
-#include <stdint.h>
-#include <unistd.h>
-#include "fsck_incore.h"
-#include "hash.h"
-#include "osi_list.h"
-
-/**
- * hash_more_internal - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- * @hash: the hash from a previous call
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * Hash guts
- *
- * Returns: the hash
- */
-
-static __inline__ uint32_t
-hash_more_internal(const void *data, unsigned int len, uint32_t hash)
-{
-	unsigned char *p = (unsigned char *) data;
-	unsigned char *e = p + len;
-	uint32_t h = hash;
-
-	while (p < e) {
-		h ^= (uint32_t) (*p++);
-		h *= 0x01000193;
-	}
-
-	return h;
-}
-
-/**
- * fsck_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * Returns: the hash
- */
-
-uint32_t
-fsck_hash(const void *data, unsigned int len)
-{
-	uint32_t h = 0x811C9DC5;
-	h = hash_more_internal(data, len, h);
-	return h;
-}
-
-/**
- * fsck_hash_more - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- * @hash: the hash from a previous call
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * This is the 32-bit FNV-1a hash from:
- * http://www.isthe.com/chongo/tech/comp/fnv/
- *
- * This version let's you hash together discontinuous regions.
- * For example, to compute the combined hash of the memory in
- * (data1, len1), (data2, len2), and (data3, len3) you:
- *
- *   h = fsck_hash(data1, len1);
- *   h = fsck_hash_more(data2, len2, h);
- *   h = fsck_hash_more(data3, len3, h);
- *
- * Returns: the hash
- */
-
-uint32_t
-fsck_hash_more(const void *data, unsigned int len, uint32_t hash)
-{
-	uint32_t h;
-	h = hash_more_internal(data, len, hash);
-	return h;
-}
-
-
diff --git a/gfs/gfs_fsck/hash.h b/gfs/gfs_fsck/hash.h
deleted file mode 100644
index d5fe8e9..0000000
--- a/gfs/gfs_fsck/hash.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _HASH_H
-#define _HASH_H
-
-uint32_t fsck_hash(const void *data, unsigned int len);
-uint32_t fsck_hash_more(const void *data, unsigned int len, uint32_t hash);
-
-#endif				/* _HASH_H  */
diff --git a/gfs/gfs_fsck/initialize.c b/gfs/gfs_fsck/initialize.c
deleted file mode 100644
index 34233b5..0000000
--- a/gfs/gfs_fsck/initialize.c
+++ /dev/null
@@ -1,421 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "util.h"
-#include "super.h"
-#include "fs_inode.h"
-#include "fs_recovery.h"
-#include "inode.h"
-#include "bio.h"
-
-/**
- * init_journals
- *
- * Go through journals and replay them - then clear them
- */
-static int init_journals(struct fsck_sb *sbp)
-{
-
-	if(!sbp->opts->no) {
-		/* Next, Replay the journals */
-		if(sbp->flags & SBF_RECONSTRUCT_JOURNALS){
-			if(reconstruct_journals(sbp)){
-				stack;
-				return 1;
-			}
-		} else {
-			/* ATTENTION -- Journal replay is not supported */
-			if(reconstruct_journals(sbp)){
-				stack;
-				return 1;
-			}
-		}
-	}
-	return 0;
-}
-
-/**
- * block_mounters
- *
- * Change the lock protocol so nobody can mount the fs
- *
- */
-int block_mounters(struct fsck_sb *sbp, int block_em)
-{
-	if(block_em) {
-		/* verify it starts with lock_ */
-		if(!strncmp(sbp->sb.sb_lockproto, "lock_", 5)) {
-			/* Change lock_ to fsck_ */
-			memcpy(sbp->sb.sb_lockproto, "fsck_", 5);
-		}
-		/* FIXME: Need to do other verification in the else
-		 * case */
-	} else {
-		/* verify it starts with fsck_ */
-		/* verify it starts with lock_ */
-		if(!strncmp(sbp->sb.sb_lockproto, "fsck_", 5)) {
-			/* Change fsck_ to lock_ */
-			memcpy(sbp->sb.sb_lockproto, "lock_", 5);
-		}
-	}
-
-	if(write_sb(sbp)) {
-		stack;
-		return -1;
-	}
-	return 0;
-}
-
-
-/*
- * empty_super_block - free all structures in the super block
- * sdp: the in-core super block
- *
- * This function frees all allocated structures within the
- * super block.  It does not free the super block itself.
- *
- * Returns: Nothing
- */
-static void empty_super_block(struct fsck_sb *sdp)
-{
-	uint32_t i;
-
-	log_info("Freeing buffers.\n");
-	if(sdp->riinode){
-		free(sdp->riinode);
-		sdp->riinode = NULL;
-	}
-	if(sdp->jiinode){
-		free(sdp->jiinode);
-		sdp->jiinode = NULL;
-	}
-	if(sdp->rooti){
-		free(sdp->rooti);
-		sdp->rooti = NULL;
-	}
-
-	if(sdp->jindex){
-		free(sdp->jindex);
-		sdp->jindex = NULL;
-	}
-	if(sdp->lf_dip) {
-		free(sdp->lf_dip);
-		sdp->lf_dip = NULL;
-	}
-	while(!osi_list_empty(&sdp->rglist)){
-		struct fsck_rgrp *rgd;
-		unsigned int x;
-		rgd = osi_list_entry(sdp->rglist.next,
-				     struct fsck_rgrp, rd_list);
-		osi_list_del(&rgd->rd_list);
-		if(rgd->rd_bits)
-			free(rgd->rd_bits);
-		if(rgd->rd_bh) {
-			for(x = 0; x < rgd->rd_ri.ri_length; x++) {
-				if(rgd->rd_bh[x]) {
-					if(BH_DATA(rgd->rd_bh[x])) {
-						free(BH_DATA(rgd->rd_bh[x]));
-					}
-					free(rgd->rd_bh[x]);
-				}
-			}
-			free(rgd->rd_bh);
-		}
-		free(rgd);
-	}
-
-	for(i = 0; i < FSCK_HASH_SIZE; i++) {
-		while(!osi_list_empty(&sdp->inode_hash[i])) {
-			struct inode_info *ii;
-			ii = osi_list_entry(sdp->inode_hash[i].next,
-					    struct inode_info, list);
-			osi_list_del(&ii->list);
-			free(ii);
-		}
-		while(!osi_list_empty(&sdp->dir_hash[i])) {
-			struct dir_info *di;
-			di = osi_list_entry(sdp->dir_hash[i].next,
-					    struct dir_info, list);
-			osi_list_del(&di->list);
-			free(di);
-		}
-	}
-
-	block_list_destroy(sdp->bl);
-}
-
-
-/**
- * set_block_ranges
- * @sdp: superblock
- *
- * Uses info in rgrps and jindex to determine boundaries of the
- * file system.
- *
- * Returns: 0 on success, -1 on failure
- */
-static int set_block_ranges(struct fsck_sb *sdp)
-{
-	struct gfs_jindex *jdesc;
-	struct fsck_rgrp *rgd;
-	struct gfs_rindex *ri;
-	osi_list_t *tmp;
-	char buf[sdp->sb.sb_bsize];
-	uint64 rmax = 0;
-	uint64 jmax = 0;
-	uint64 rmin = 0;
-	uint64 i;
-	int error;
-
-	log_info("Setting block ranges...\n");
-
-	for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next)
-	{
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-		ri = &rgd->rd_ri;
-		if (ri->ri_data1 + ri->ri_data - 1 > rmax)
-			rmax = ri->ri_data1 + ri->ri_data - 1;
-		if (!rmin || ri->ri_data1 < rmin)
-			rmin = ri->ri_data1;
-	}
-
-	last_fs_block = rmax;
-
-	for (i = 0; i < sdp->journals; i++)
-	{
-		jdesc = &sdp->jindex[i];
-
-		if ((jdesc->ji_addr+jdesc->ji_nsegment*sdp->sb.sb_seg_size-1)
-		    > jmax)
-			jmax = jdesc->ji_addr + jdesc->ji_nsegment
-				* sdp->sb.sb_seg_size - 1;
-	}
-
-	sdp->last_fs_block = (jmax > rmax) ? jmax : rmax;
-	if (sdp->last_fs_block > 0xffffffff && sizeof(unsigned long) <= 4) {
-		log_crit("This file system is too big for this computer to handle.\n");
-		log_crit("Last fs block = 0x%llx, but sizeof(unsigned long) is %d bytes.\n",
-				 sdp->last_fs_block, sizeof(unsigned long));
-		goto fail;
-	}
-
-	sdp->last_data_block = rmax;
-	sdp->first_data_block = rmin;
-
-	if(do_lseek(sdp->diskfd, (sdp->last_fs_block * sdp->sb.sb_bsize))){
-		log_crit("Can't seek to last block in file system: %"
-			 PRIu64"\n", sdp->last_fs_block);
-		goto fail;
-	}
-
-	memset(buf, 0, sdp->sb.sb_bsize);
-	error = read(sdp->diskfd, buf, sdp->sb.sb_bsize);
-	if (error != sdp->sb.sb_bsize){
-		log_crit("Can't read last block in file system (%u), "
-			 "last_fs_block: %"PRIu64"\n",
-			 error, sdp->last_fs_block);
-		goto fail;
-	}
-
-	return 0;
-
- fail:
-	return -1;
-}
-
-
-/**
- * read_super_block
- * @sdp:
- *
- * Returns: 0 on success, -1 on failure
- */
-static int read_super_block(struct fsck_sb *sdp)
-{
-	uint32_t i;
-
-	sync();
-
-	/********************************************************************
-	 ***************** First, initialize all lists **********************
-	 ********************************************************************/
-	log_info("Initializing lists...\n");
-	osi_list_init(&sdp->rglist);
-	for(i = 0; i < FSCK_HASH_SIZE; i++) {
-		osi_list_init(&sdp->dir_hash[i]);
-		osi_list_init(&sdp->inode_hash[i]);
-	}
-
-	/********************************************************************
-	 ************  next, read in on-disk SB and set constants  **********
-	 ********************************************************************/
-	sdp->sb.sb_bsize = 512;
-	if (sdp->sb.sb_bsize < GFS_BASIC_BLOCK)
-		sdp->sb.sb_bsize = GFS_BASIC_BLOCK;
-
-	if(sizeof(struct gfs_sb) > sdp->sb.sb_bsize){
-		log_crit("GFS superblock is larger than the blocksize!\n");
-		log_debug("sizeof(struct gfs_sb) > sdp->sb.sb_bsize\n");
-		return -1;
-	}
-
-	if(read_sb(sdp) < 0){
-		return -1;
-	}
-
-	return 0;
-}
-
-/**
- * fill_super_block
- * @sdp:
- *
- * Returns: 0 on success, -1 on failure
- */
-static int fill_super_block(struct fsck_sb *sdp)
-{
-        struct fsck_inode *ip = NULL;
-	/*******************************************************************
-	 ******************  Initialize important inodes  ******************
-	 *******************************************************************/
-
-	log_info("Initializing special inodes...\n");
-	/* get ri inode */
-	if(load_inode(sdp, sdp->sb.sb_rindex_di.no_addr, &ip)) {
-		stack;
-		return -1;
-	}
-	sdp->riinode = ip;
-
-	/* get ji inode */
-	if(load_inode(sdp, sdp->sb.sb_jindex_di.no_addr, &ip)) {
-		stack;
-		return -1;
-	}
-	sdp->jiinode = ip;
-
-	/* get root dinode */
-	if(!load_inode(sdp, sdp->sb.sb_root_di.no_addr, &ip)) {
-		if(!check_inode(ip)) {
-			sdp->rooti = ip;
-		}
-		else {
-			free(ip);
-		}
-	} else {
-		log_warn("Unable to load root inode\n");
-	}
-
-	/*******************************************************************
-	 *******  Fill in rgrp and journal indexes and related fields  *****
-	 *******************************************************************/
-
-	/* read in the ji data */
-	if (ji_update(sdp)){
-		log_err("Unable to read in ji inode.\n");
-		return -1;
-	}
-
-	if(ri_update(sdp)){
-		log_err("Unable to fill in resource group information.\n");
-		goto fail;
-	}
-
-	/*******************************************************************
-	 *******  Now, set boundary fields in the super block  *************
-	 *******************************************************************/
-	if(set_block_ranges(sdp)){
-		log_err("Unable to determine the boundaries of the"
-			" file system.\n");
-		goto fail;
-	}
-
-	sdp->bl = block_list_create(sdp->last_fs_block+1, gbmap);
-	if (!sdp->bl)
-		goto fail;
-
-	return 0;
-
- fail:
-	empty_super_block(sdp);
-
-	return -1;
-}
-
-/**
- * initialize - initialize superblock pointer
- *
- */
-int initialize(struct fsck_sb *sbp)
-{
-	if(sbp->opts->no) {
-		if ((sbp->diskfd = open(sbp->opts->device, O_RDONLY)) < 0) {
-			log_crit("Unable to open device: %s\n", sbp->opts->device);
-			return FSCK_USAGE;
-		}
-	} else {
-		/* read in sb from disk */
-		if ((sbp->diskfd = open(sbp->opts->device, O_RDWR)) < 0){
-			log_crit("Unable to open device: %s\n", sbp->opts->device);
-			return FSCK_USAGE;
-		}
-	}
-
-	/* initialize lists and read in the sb */
-	if(read_super_block(sbp)) {
-		stack;
-		return FSCK_ERROR;
-	}
-
-	/* Change lock protocol to be fsck_* instead of lock_* */
-	if(!sbp->opts->no) {
-		if(block_mounters(sbp, 1)) {
-			log_err("Unable to block other mounters\n");
-			return FSCK_ERROR;
-		}
-	}
-
-	/* initialize important inodes, fill the rgrp and journal indexes, etc */
-	if(fill_super_block(sbp)) {
-		if(!sbp->opts->no)
-			block_mounters(sbp, 0);
-		stack;
-		return FSCK_ERROR;
-	}
-
-	/* verify various things */
-
-	if(init_journals(sbp)) {
-		if(!sbp->opts->no)
-			block_mounters(sbp, 0);
-		stack;
-		return FSCK_ERROR;
-	}
-
-	return FSCK_OK;
-}
-
-static void destroy_sbp(struct fsck_sb *sbp)
-{
-	if(!sbp->opts->no) {
-		if(block_mounters(sbp, 0)) {
-			log_warn("Unable to unblock other mounters - manual intevention required\n");
-			log_warn("Use 'gfs_tool sb <device> proto' to fix\n");
-		}
-		log_info("Syncing the device.\n");
-		fsync(sbp->diskfd);
-	}
-	empty_super_block(sbp);
-	close(sbp->diskfd);
-}
-
-void destroy(struct fsck_sb *sbp)
-{
-	destroy_sbp(sbp);
-
-}
diff --git a/gfs/gfs_fsck/inode.c b/gfs/gfs_fsck/inode.c
deleted file mode 100644
index b900429..0000000
--- a/gfs/gfs_fsck/inode.c
+++ /dev/null
@@ -1,335 +0,0 @@
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "osi_user.h"
-#include "bio.h"
-#include "fs_inode.h"
-#include "inode.h"
-#include "rgrp.h"
-#include "util.h"
-#include "fs_dir.h"
-
-/* FIXME: Not crazy about this name vs. load_inode, but I'm not very
- * creative ATM */
-/* replaces fs_copyin_dinode */
-int copyin_inode(struct fsck_sb *sbp, osi_buf_t *bh, struct fsck_inode **inode)
-{
-	struct fsck_inode *ip;
-
-	if(!(ip = (struct fsck_inode *)malloc(sizeof(struct fsck_inode)))) {
-		log_err("Unable to allocate memory for inode\n");
-		return -1;
-	}
-	if(!memset(ip, 0, sizeof(struct fsck_inode))) {
-		log_err("Unable to zero inode memory\n");
-		return -1;
-	}
-	ip->i_sbd = sbp;
-
-	ip->i_num.no_addr = ip->i_num.no_formal_ino = BH_BLKNO(bh);
-	memset(&ip->i_di, 0, sizeof(struct gfs_dinode));
-
-	gfs_dinode_in(&ip->i_di, BH_DATA(bh));
-
-	*inode = ip;
-
-	return 0;
-}
-
-int load_inode(struct fsck_sb *sbp, uint64_t block, struct fsck_inode **inode)
-{
-	osi_buf_t *bh;
-
-	if(get_and_read_buf(sbp, block, &bh, 0)){
-		stack;
-		log_err("Unable to retrieve block %"PRIu64"\n",
-			block);
-		return -1;
-	}
-
-	if(copyin_inode(sbp, bh, inode)) {
-		stack;
-		relse_buf(sbp, bh);
-		return -1;
-	}
-
-	relse_buf(sbp, bh);
-	return 0;
-}
-
-
-void free_inode(struct fsck_inode **inode)
-{
-	free(*inode);
-	inode = NULL;
-}
-
-
-int check_inode(struct fsck_inode *ip)
-{
-	int error = 0;
-	if(ip->i_di.di_header.mh_type != GFS_METATYPE_DI) {
-		return -1;
-	}
-
-	if(ip->i_num.no_formal_ino != ip->i_di.di_num.no_formal_ino){
-		log_err(
-			"In-core and on-disk formal inode"
-			"numbers do not match. %"PRIu64" %"PRIu64"\n",
-			ip->i_num.no_formal_ino,
-			ip->i_di.di_num.no_formal_ino);
-		error = -1;
-	}
-
-	/*  Handle a moved inode  */
-
-	if (ip->i_num.no_addr != ip->i_di.di_num.no_addr){
-		log_err("\tBlock # used to read disk inode: %"PRIu64"\n"
-			"\tBlock # recorded in disk inode : %"PRIu64"\n",
-			ip->i_num.no_addr, ip->i_di.di_num.no_addr);
-		error = -1;
-	}
-
-	return error;
-
-}
-
-
-
-/*int remove_inode(struct fsck_sb *sbp, uint64_t block)
-{
-	struct fsck_inode *ip;
-	load_inode(sbp, block, &ip);
-	check_metatree(ip, &fxns);
-	free_inode(&ip);
-	return 0;
-}*/
-
-/**
- * fs_get_istruct - Get an inode given its number
- * @sdp: The GFS superblock
- * @inum: The inode number
- * @create: Flag to say if we are allowed to create a new struct fsck_inode
- * @ipp: pointer to put the returned inode in
- *
- * Returns: 0 on success, -1 on error
- */
-static int fs_get_istruct(struct fsck_sb *sdp, struct gfs_inum *inum,
-			  int create, struct fsck_inode **ipp)
-{
-	struct fsck_inode *ip = NULL;
-	int error = 0;
-
-	if (!create){
-		/* we are not currently tracking which inodes we already have */
-		error = -1;
-		goto out;
-	}
-
-	if(!(ip = (struct fsck_inode *)malloc(sizeof(struct fsck_inode)))) {
-		log_err("Unable to allocate memory for inode\n");
-		error = -1;
-		goto out;
-	}
-	ip->i_num = *inum;
-
-	ip->i_sbd = sdp;
-
-	error = fs_copyin_dinode(ip, NULL);
-	if (error){
-		free(ip);
-		ip = NULL;
-		goto out;
-	}
-
- out:
-	*ipp = ip;
-
-	return error;
-}
-
-
-
-/**
- * make_dinode - Fill in a new dinode structure
- * @dip: the directory this inode is being created in
- * @inum: the inode number
- * @type: the file type
- * @mode: the file permissions
- * @cred: a credentials structure
- *
- */
-
-static int make_dinode(struct fsck_inode *dip, struct fsck_sb *sdp,
-		       struct gfs_inum *inum,
-                       unsigned int type, unsigned int mode, osi_cred_t *cred)
-{
-	struct gfs_dinode di;
-	osi_buf_t *dibh;
-	struct fsck_rgrp *rgd;
-	int error;
-
-	error = get_and_read_buf(sdp, inum->no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-	if(check_meta(dibh, 0)){
-		struct gfs_meta_header mh;
-	        log_debug("Buffer #%"PRIu64" has no meta header.\n",
-			  BH_BLKNO(dibh));
-		memset(&mh, 0, sizeof(struct gfs_meta_header));
-		mh.mh_magic = GFS_MAGIC;
-		mh.mh_type = GFS_METATYPE_NONE;
-		gfs_meta_header_out(&mh, BH_DATA(dibh));
-		log_debug("meta header added.\n");
-	}
-
-	((struct gfs_meta_header *)BH_DATA(dibh))->mh_type =
-		cpu_to_gfs32(GFS_METATYPE_DI);
-	((struct gfs_meta_header *)BH_DATA(dibh))->mh_format =
-		cpu_to_gfs32(GFS_FORMAT_DI);
-
-	memset(BH_DATA(dibh) + sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh) - sizeof(struct gfs_dinode));
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-
-	gfs_meta_header_in(&di.di_header, BH_DATA(dibh));
-
-	di.di_num = *inum;
-
-	if (dip && (dip->i_di.di_mode & 02000))
-	{
-		di.di_mode = mode | ((type == GFS_FILE_DIR) ? 02000 : 0);
-		di.di_gid = dip->i_di.di_gid;
-	}
-	else
-	{
-		di.di_mode = mode;
-		di.di_gid = osi_cred_to_gid(cred);
-	}
-
-	di.di_uid = osi_cred_to_uid(cred);
-	di.di_nlink = 1;
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = osi_current_time();
-
-	rgd = fs_blk2rgrpd(sdp, inum->no_addr);
-	if(!rgd){
-		log_crit("Unable to map block #%"PRIu64" to rgrp\n", inum->no_addr);
-		exit(FSCK_ERROR);
-	}
-
-	di.di_rgrp = rgd->rd_ri.ri_addr;
-	di.di_goal_rgrp = di.di_rgrp;
-	di.di_goal_dblk = di.di_goal_mblk = inum->no_addr - rgd->rd_ri.ri_data1;
-
-	di.di_type = type;
-
-	gfs_dinode_out(&di, BH_DATA(dibh));
-	if(write_buf(sdp, dibh, 0)){
-		log_err("make_dinode:  bad write_buf()\n");
-		error = -EIO;
-	}
-
-	relse_buf(sdp, dibh);
-
-
- out:
-
-	return error;
-}
-
-
-int create_inode(struct fsck_sb *sbp, unsigned int type, struct fsck_inode **ip)
-{
-	uint64_t block;
-	struct fsck_rgrp *rgd;
-	osi_list_t *tmp;
-	struct gfs_inum inum;
-	int allocate=0;
-	unsigned int mode = 0755;
-	osi_cred_t cred;
-	cred.cr_uid = getuid();
-	cred.cr_gid = getgid();
- retry:
-	inum.no_addr = inum.no_formal_ino = 0;
-	/* Search for a resource group that has free space */
-	osi_list_foreach(tmp, &sbp->rglist) {
-		/* Create a new inode in that rgd */
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-		if(fs_rgrp_read(rgd, FALSE)) {
-			stack;
-			return -1;
-		}
-		if(rgd->rd_rg.rg_freemeta){
-			block = fs_blkalloc_internal(rgd, 0,
-						     GFS_BLKST_FREEMETA, GFS_BLKST_USEDMETA, 1);
-			log_debug("Got block %"PRIu64"\n", block);
-			if(block == BFITNOENT) {
-				fs_rgrp_relse(rgd);
-				continue;
-			}
-			block += rgd->rd_ri.ri_data1;
-
-			inum.no_addr = inum.no_formal_ino = block;
-			/* FIXME: type isn't right */
-			block_set(sbp->bl, block, type);
-			/* write out the rgrp */
-			gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-			write_buf(sbp, rgd->rd_bh[0], 0);
-			fs_rgrp_relse(rgd);
-			break;
-		}
-		else {
-			if(allocate && !clump_alloc(rgd, 0)){
-				block = fs_blkalloc_internal(rgd, 0,
-							     GFS_BLKST_FREEMETA,
-							     GFS_BLKST_USEDMETA, 1);
-				log_debug("Got block %"PRIu64"\n", block);
-
-				if(block == BFITNOENT) {
-					fs_rgrp_relse(rgd);
-					continue;
-				}
-				block += rgd->rd_ri.ri_data1;
-
-				inum.no_addr = inum.no_formal_ino = block;
-
-				/* FIXME: type isn't right */
-				block_set(sbp->bl, block, type);
-
-				/* write out the rgrp */
-				gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-				write_buf(sbp, rgd->rd_bh[0], 0);
-				fs_rgrp_relse(rgd);
-				break;
-			}
-			fs_rgrp_relse(rgd);
-		}
-	}
-
-	if(!inum.no_addr){
-		if(allocate){
-			log_err("No space available for new file or directory.\n");
-			return -1;
-		} else {
-			allocate = 1;
-			goto retry;
-		}
-	}
-
-        /* We need to setup the inode without attaching it to a directory */
-	if(make_dinode(NULL, sbp, &inum, type, mode, &cred)) {
-		stack;
-		return -1;
-	}
-	if(fs_get_istruct(sbp, &inum, 1, ip)) {
-		stack;
-		return -1;
-	}
-
-	return 0;
-
-
-}
-
diff --git a/gfs/gfs_fsck/inode.h b/gfs/gfs_fsck/inode.h
deleted file mode 100644
index 3670c05..0000000
--- a/gfs/gfs_fsck/inode.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _INODE_H
-#define _INODE_H
-
-
-int copyin_inode(struct fsck_sb *sbp, osi_buf_t *bh, struct fsck_inode **ip);
-int load_inode(struct fsck_sb *sbp, uint64_t block, struct fsck_inode **ip);
-void free_inode(struct fsck_inode **inode);
-int check_inode(struct fsck_inode *ip);
-int create_inode(struct fsck_sb *sbp, unsigned int type,
-		 struct fsck_inode **ip);
-
-
-#endif /* _INODE_H */
diff --git a/gfs/gfs_fsck/inode_hash.c b/gfs/gfs_fsck/inode_hash.c
deleted file mode 100644
index 8173dcc..0000000
--- a/gfs/gfs_fsck/inode_hash.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include <stdint.h>
-#include "osi_list.h"
-#include "fsck_incore.h"
-#include "hash.h"
-#include "inode_hash.h"
-
-static uint32_t inode_hash(uint64_t block_no)
-{
-	unsigned int h;
-
-	h = fsck_hash(&block_no, sizeof (uint64_t));
-	h &= FSCK_HASH_MASK;
-
-	return h;
-}
-
-struct inode_info *inode_hash_search(osi_list_t *buckets, uint64_t key)
-{
-	struct inode_info *ii;
-	osi_list_t *tmp;
-	osi_list_t *bucket = &buckets[inode_hash(key)];
-
-	osi_list_foreach(tmp, bucket) {
-		ii = osi_list_entry(tmp, struct inode_info, list);
-		if(ii->inode == key) {
-			return ii;
-		}
-	}
-	return NULL;
-}
-
-int inode_hash_insert(osi_list_t *buckets, uint64_t key, struct inode_info *ii)
-{
-	osi_list_t *tmp;
-	osi_list_t *bucket = &buckets[inode_hash(key)];
-	struct inode_info *itmp = NULL;
-
-	if(osi_list_empty(bucket)) {
-		osi_list_add(&ii->list, bucket);
-		return 0;
-	}
-
-	osi_list_foreach(tmp, bucket) {
-		itmp = osi_list_entry(tmp, struct inode_info, list);
-		if(itmp->inode < key) {
-			continue;
-		} else {
-			osi_list_add_prev(&ii->list, tmp);
-			return 0;
-		}
-	}
-	osi_list_add_prev(&ii->list, bucket);
-	return 0;
-}
-
-
-int inode_hash_remove(osi_list_t *buckets, uint64_t key)
-{
-	osi_list_t *tmp;
-	osi_list_t *bucket = &buckets[inode_hash(key)];
-	struct inode_info *itmp = NULL;
-
-	if(osi_list_empty(bucket)) {
-		return -1;
-	}
-	osi_list_foreach(tmp, bucket) {
-		itmp = osi_list_entry(tmp, struct inode_info, list);
-		if(itmp->inode == key) {
-			osi_list_del(tmp);
-			return 0;
-		}
-	}
-	return -1;
-}
diff --git a/gfs/gfs_fsck/inode_hash.h b/gfs/gfs_fsck/inode_hash.h
deleted file mode 100644
index bd463c7..0000000
--- a/gfs/gfs_fsck/inode_hash.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _INODE_HASH_H
-#define _INODE_HASH_H
-
-struct inode_info *inode_hash_search(osi_list_t *buckets, uint64_t block_no);
-int inode_hash_insert(osi_list_t *buckets, uint64_t key, struct inode_info *ii);int inode_hash_remove(osi_list_t *buckets, uint64_t key);
-
-#endif /* _INODE_HASH_H */
diff --git a/gfs/gfs_fsck/link.c b/gfs/gfs_fsck/link.c
deleted file mode 100644
index d303937..0000000
--- a/gfs/gfs_fsck/link.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <stdint.h>
-#include "fsck_incore.h"
-#include "inode_hash.h"
-#include "link.h"
-
-int set_link_count(struct fsck_sb *sbp, uint64_t inode_no, uint32_t count)
-{
-	struct inode_info *ii = NULL;
-	log_debug("Setting link count to %u for %"PRIu64"\n", count, inode_no);
-	/* If the list has entries, look for one that matches
-	 * inode_no */
-	ii = inode_hash_search(sbp->inode_hash, inode_no);
-	if(ii) {
-		if(ii->link_count) {
-			log_err("Link count already set for inode #%"
-				PRIu64"!\n");
-			stack;
-			return -1;
-		}
-		else {
-			ii->link_count = count;
-		}
-	}
-	else {
-		/* If not match was found, add a new entry and set it's
-		 * link count to count*/
-		if(!(ii = (struct inode_info *) malloc(sizeof(*ii)))) {
-			log_err("Unable to allocate inode_info structure\n");
-			stack;
-			return -1;
-		}
-		memset(ii, 0, sizeof(*ii));
-		ii->inode = inode_no;
-		ii->link_count = count;
-		inode_hash_insert(sbp->inode_hash, inode_no, ii);
-	}
-	return 0;
-
-
-}
-
-int increment_link(struct fsck_sb *sbp, uint64_t inode_no)
-{
-	struct inode_info *ii = NULL;
-
-	ii = inode_hash_search(sbp->inode_hash, inode_no);
-	/* If the list has entries, look for one that matches
-	 * inode_no */
-	if(ii) {
-		ii->counted_links++;
-		log_debug("Incremented counted links to %u for %"PRIu64"\n",
-			  ii->counted_links, inode_no);
-		return 0;
-	}
-	log_debug("No match found when incrementing link for %"PRIu64"!\n",
-		  inode_no);
-	/* If no match was found, add a new entry and set its
-	 * counted links to 1 */
-	if(!(ii = (struct inode_info *) malloc(sizeof(*ii)))) {
-		log_err("Unable to allocate inode_info structure\n");
-		stack;
-		return -1;
-	}
-	if(!memset(ii, 0, sizeof(*ii))) {
-		log_err("Unable to zero inode_info structure\n");
-		stack;
-		return -1;
-	}
-	ii->inode = inode_no;
-	ii->counted_links = 1;
-	inode_hash_insert(sbp->inode_hash, inode_no, ii);
-
-	return 0;
-}
-
-int decrement_link(struct fsck_sb *sbp, uint64_t inode_no)
-{
-	struct inode_info *ii = NULL;
-
-	ii = inode_hash_search(sbp->inode_hash, inode_no);
-	/* If the list has entries, look for one that matches
-	 * inode_no */
-	log_err("Decrementing %"PRIu64"\n", inode_no);
-	if(ii) {
-		ii->counted_links--;
-		return 0;
-	}
-	log_debug("No match found when decrementing link for %"PRIu64"!\n",
-		  inode_no);
-	return -1;
-
-}
-
-
diff --git a/gfs/gfs_fsck/link.h b/gfs/gfs_fsck/link.h
deleted file mode 100644
index 460bc26..0000000
--- a/gfs/gfs_fsck/link.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _LINK_H
-#define _LINK_H
-
-int set_link_count(struct fsck_sb *sbp, uint64_t inode_no, uint32_t count);
-int increment_link(struct fsck_sb *sbp, uint64_t inode_no);
-int decrement_link(struct fsck_sb *sbp, uint64_t inode_no);
-
-#endif /* _LINK_H */
diff --git a/gfs/gfs_fsck/log.c b/gfs/gfs_fsck/log.c
deleted file mode 100644
index 2d6476c..0000000
--- a/gfs/gfs_fsck/log.c
+++ /dev/null
@@ -1,148 +0,0 @@
-#include <stdio.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <libintl.h>
-
-#include <sys/select.h>
-#include <unistd.h>
-
-#include "fsck_incore.h"
-#include "log.h"
-
-#define _(String) gettext(String)
-
-struct log_state {
-	int print_level;
-};
-static struct log_state _state = {MSG_NOTICE};
-
-void increase_verbosity(void)
-{
-	_state.print_level++;
-}
-
-void decrease_verbosity(void)
-{
-	_state.print_level--;
-}
-
-static void __attribute__((format(printf, 4, 0)))
-print_msg(int priority, const char *file, int line, const char *format, va_list args) {
-
-	switch (priority) {
-
-	case MSG_DEBUG:
-		printf("(%s:%d)\t", file, line);
-		vprintf(format, args);
-		fflush(stdout);
-		break;
-	case MSG_INFO:
-	case MSG_NOTICE:
-	case MSG_WARN:
-		vprintf(format, args);
-		fflush(stdout);
-		break;
-	case MSG_ERROR:
-	case MSG_CRITICAL:
-	default:
-		vfprintf(stderr, format, args);
-		break;
-	}
-	return;
-}
-
-
-void __attribute__((format(printf, 5, 6)))
-print_fsck_log(int iif, int priority, const char *file, int line, const char *format, ...)
-{
-
-	va_list args;
-	const char *transform;
-
-        va_start(args, format);
-
-	transform = _(format);
-
-	if((_state.print_level == priority) ||
-	   (!iif && (_state.print_level >= priority)))
-		print_msg(priority, file, line, transform, args);
-
-	va_end(args);
-}
-
-
-
-int __attribute__((format(printf, 2, 3)))
-query(struct fsck_sb *sbp, const char *format, ...)
-{
-
-	va_list args;
-	const char *transform;
-	char response;
-	fd_set rfds;
-	struct timeval tv;
-	int err = 0;
-	int ret = 0;
-
-	if(sbp->opts->yes)
-		return 1;
-	if(sbp->opts->no)
-		return 0;
-
-	fsck_query = TRUE;
-    /* Watch stdin (fd 0) to see when it has input. */
-	FD_ZERO(&rfds);
-	FD_SET(STDIN_FILENO, &rfds);
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-	/* Make sure there isn't extraneous input before asking the
-	 * user the question */
-	while((err = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv))) {
-		if(err < 0) {
-			log_debug("Error in select() on stdin\n");
-			break;
-		}
-		err = read(STDIN_FILENO, &response, sizeof(char));
-
-	}
- query:
-	va_start(args, format);
-
-	transform = _(format);
-
-	vprintf(transform, args);
-
-	/* Make sure query is printed out */
-	fflush(NULL);
-
- rescan:
-	err = read(STDIN_FILENO, &response, sizeof(char));
-
-	if(tolower(response) == 'y') {
-		ret = 1;
-	} else if (tolower(response) == 'n') {
-		ret = 0;
-	} else if ((response == ' ') || (response == '\t')) {
-		goto rescan;
-	} else {
-		while(response != '\n')
-			err = read(STDIN_FILENO, &response, sizeof(char));
-		printf("Bad response, please type 'y' or 'n'.\n");
-		va_end(args);
-		goto query;
-	}
-
-	/* Clip the input */
-	while((err = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv))) {
-		if(err < 0) {
-			log_debug("Error in select() on stdin\n");
-			break;
-		}
-		err = read(STDIN_FILENO, &response, sizeof(char));
-	}
-
-	va_end(args);
-	fsck_query = FALSE;
-	return ret;
-}
diff --git a/gfs/gfs_fsck/log.h b/gfs/gfs_fsck/log.h
deleted file mode 100644
index 725d2ee..0000000
--- a/gfs/gfs_fsck/log.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef __LOG_H
-#define __LOG_H
-
-#define MSG_DEBUG	7
-#define MSG_INFO	6
-#define MSG_NOTICE	5
-#define MSG_WARN	4
-#define MSG_ERROR	3
-#define MSG_CRITICAL	2
-#define MSG_NULL	1
-
-
-
-#define print_log(iif, priority, format...)	\
-do { \
-	print_fsck_log(iif, priority, __FILE__, __LINE__, ## format);	\
-} while(0)
-
-#define log_debug(format...) \
-do { \
-	print_log(0, MSG_DEBUG, format);		\
-} while(0)
-
-#define log_info(format...) \
-do { \
-	print_log(0, MSG_INFO, format);		\
-} while(0)
-
-#define log_notice(format...) \
-do { \
-	print_log(0, MSG_NOTICE, format);	\
-} while(0)
-
-#define log_warn(format...) \
-do { \
-	print_log(0, MSG_WARN, format);		\
-} while(0)
-
-#define log_err(format...) \
-do { \
-	print_log(0, MSG_ERROR, format);		\
-} while(0)
-
-#define log_crit(format...) \
-do { \
-	print_log(0, MSG_CRITICAL, format);	\
-} while(0)
-
-#define stack log_debug("<backtrace> - %s()\n", __func__)
-
-#define log_at_debug(format...)		\
-do { \
-	print_log(1, MSG_DEBUG, format);	\
-} while(0)
-
-#define log_at_info(format...) \
-do { \
-	print_log(1, MSG_INFO, format);		\
-} while(0)
-
-#define log_at_notice(format...) \
-do { \
-	print_log(1, MSG_NOTICE, format);	\
-} while(0)
-
-#define log_at_warn(format...) \
-do { \
-	print_log(1, MSG_WARN, format);		\
-} while(0)
-
-#define log_at_err(format...) \
-do { \
-	print_log(1, MSG_ERROR, format);		\
-} while(0)
-
-#define log_at_crit(format...) \
-do { \
-	print_log(1, MSG_CRITICAL, format);	\
-} while(0)
-
-void increase_verbosity(void);
-void decrease_verbosity(void);
-void print_fsck_log(int iif, int priority, const char *file, int line, const char *format, ...);
-int query(struct fsck_sb *sbp, const char *format, ...);
-
-
-#endif /* __LOG_H */
diff --git a/gfs/gfs_fsck/lost_n_found.c b/gfs/gfs_fsck/lost_n_found.c
deleted file mode 100644
index 648e567..0000000
--- a/gfs/gfs_fsck/lost_n_found.c
+++ /dev/null
@@ -1,133 +0,0 @@
-#include "fs_dir.h"
-
-#include "lost_n_found.h"
-#include "link.h"
-#include "fs_inode.h"
-#include "bio.h"
-#include "inode.h"
-/* add_inode_to_lf - Add dir entry to lost+found for the inode
- * @ip: inode to add to lost + found
- *
- * This function adds an entry into the lost and found dir
- * for the given inode.  The name of the entry will be
- * "lost_<ip->i_num.no_addr>".
- *
- * Returns: 0 on success, -1 on failure.
- */
-int add_inode_to_lf(struct fsck_inode *ip){
-	char tmp_name[256];
-	struct fsck_inode *lf_ip, *ri;
-	osi_filename_t filename;
-	struct block_query q;
-
-	if(!ip->i_sbd->lf_dip) {
-		log_info("Locating/Creating lost and found directory\n");
-
-		load_inode(ip->i_sbd, ip->i_sbd->sb.sb_root_di.no_addr, &ri);
-
-		if(fs_mkdir(ri, "l+f", 00700, &lf_ip)){
-			log_err("Unable to create/locate l+f directory.\n");
-		}
-		free_inode(&ri);
-		if(!lf_ip){
-			log_warn("No l+f directory, can not add inode.\n");
-			return -1;
-		}
-		log_notice("l+f directory at %"PRIu64"\n", lf_ip->i_num.no_addr);
-
-		ip->i_sbd->lf_dip = lf_ip;
-		if(block_check(ip->i_sbd->bl, lf_ip->i_num.no_addr, &q)) {
-			stack;
-			return -1;
-		}
-		if(q.block_type != inode_dir) {
-			/* This is a new l+f directory, so set its
-			 * block type and increment link counts for
-			 * the directories */
-			/* FIXME: i'd feel better about this if
-			 * fs_mkdir returned whether it created a new
-			 * directory or just found an old one, and we
-			 * used that instead of the block_type to run
-			 * this */
-			block_set(ip->i_sbd->bl, lf_ip->i_num.no_addr, inode_dir);
-			increment_link(ip->i_sbd, ip->i_sbd->sb.sb_root_di.no_addr);
-			increment_link(ip->i_sbd, lf_ip->i_num.no_addr);
-			increment_link(ip->i_sbd, lf_ip->i_num.no_addr);
-		}
-	} else {
-		lf_ip = ip->i_sbd->lf_dip;
-	}
-
-	if(ip->i_num.no_addr == lf_ip->i_num.no_addr) {
-		log_err("Trying to add l+f to itself...skipping");
-		return 0;
-	}
-	switch(ip->i_di.di_type){
-	case GFS_FILE_DIR:
-		log_info("Adding .. entry pointing to l+f for %"PRIu64"\n",
-			 ip->i_num.no_addr);
-		sprintf(tmp_name, "..");
-		filename.len = strlen(tmp_name);  /* no trailing NULL */
-		if(!(filename.name = malloc(sizeof(char) * filename.len))) {
-			log_err("Unable to allocate name\n");
-			stack;
-			return -1;
-		}
-		if(!memset(filename.name, 0, sizeof(char) * filename.len)) {
-			log_err("Unable to zero name\n");
-			stack;
-			return -1;
-		}
-		memcpy(filename.name, tmp_name, filename.len);
-
-		if(fs_dirent_del(ip, NULL, &filename)){
-			log_warn("add_inode_to_lf:  "
-				"Unable to remove \"..\" directory entry.\n");
-		}
-
-		if(fs_dir_add(ip, &filename, &(lf_ip->i_num),
-			      lf_ip->i_di.di_type)){
-			log_err("Failed to link \"..\" entry to l+f directory.\n");
-			block_set(ip->i_sbd->bl, ip->i_num.no_addr, meta_inval);
-			return 0;
-		}
-
-		free(filename.name);
-		sprintf(tmp_name, "lost_dir_%"PRIu64, ip->i_num.no_addr);
-		break;
-	case GFS_FILE_REG:
-		sprintf(tmp_name, "lost_file_%"PRIu64, ip->i_num.no_addr);
-		break;
-	default:
-		sprintf(tmp_name, "lost_%"PRIu64, ip->i_num.no_addr);
-		break;
-	}
-	filename.len = strlen(tmp_name);  /* no trailing NULL */
-	if(!(filename.name = malloc(sizeof(char) * filename.len))) {
-		log_err("Unable to allocate name\n");
-			stack;
-			return -1;
-		}
-	if(!memset(filename.name, 0, sizeof(char) * filename.len)) {
-		log_err("Unable to zero name\n");
-		stack;
-		return -1;
-	}
-	memcpy(filename.name, tmp_name, filename.len);
-
-	if(fs_dir_add(lf_ip, &filename, &(ip->i_num), ip->i_di.di_type)){
-		log_err("Failed to add inode #%"PRIu64" to l+f dir.\n",
-			ip->i_num.no_addr);
-		/* FIXME: don't return -1 here, just mark the inode bad */
-		free(filename.name);
-		block_set(ip->i_sbd->bl, ip->i_num.no_addr, meta_inval);
-		return 0;
-	}
-  	increment_link(ip->i_sbd, ip->i_num.no_addr);
-	if(ip->i_di.di_type == GFS_FILE_DIR) {
-		increment_link(ip->i_sbd, lf_ip->i_num.no_addr);
-	}
-	free(filename.name);
-	log_notice("Added inode #%"PRIu64" to l+f dir\n", ip->i_num.no_addr);
-	return 0;
-}
diff --git a/gfs/gfs_fsck/lost_n_found.h b/gfs/gfs_fsck/lost_n_found.h
deleted file mode 100644
index dde343a..0000000
--- a/gfs/gfs_fsck/lost_n_found.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __LOST_N_FOUND_H__
-#define __LOST_N_FOUND_H__
-
-#include "fsck_incore.h"
-
-int add_inode_to_lf(struct fsck_inode *ip);
-
-#endif /* __LOST_N_FOUND_H__ */
diff --git a/gfs/gfs_fsck/main.c b/gfs/gfs_fsck/main.c
deleted file mode 100644
index 78c8e4d..0000000
--- a/gfs/gfs_fsck/main.c
+++ /dev/null
@@ -1,290 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <libgen.h>
-#include <ctype.h>
-#include <signal.h>
-
-#include "copyright.cf"
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "log.h"
-
-uint64_t last_fs_block, last_reported_block = -1;
-int skip_this_pass = FALSE, fsck_abort = FALSE, fsck_query = FALSE;
-int errors_found = 0, errors_corrected = 0;
-const char *pass = "";
-
-#if 0
-static void print_map(struct block_list *il, int count)
-{
-	int i, j;
-	struct block_query k;
-
-	log_info("Printing map of blocks - 80 blocks per row\n");
-	j = 0;
-	for(i = 0; i < count; i++) {
-		if(j > 79) {
-			log_info("\n");
-			j = 0;
-		}
-		else if(!(j %10) && j != 0) {
-			log_info(" ");
-		}
-		j++;
-		block_check(il, i, &k);
-		log_info("%X", k.block_type);
-
-	}
-	log_info("\n");
-}
-#endif
-
-static void usage(char *name)
-{
-	printf("Usage: %s [-hnqvVy] <device> \n", basename(name));
-}
-
-static void version(void)
-{
-	printf("GFS fsck %s (built %s %s)\n",
-	       RELEASE_VERSION, __DATE__, __TIME__);
-	printf("%s\n", REDHAT_COPYRIGHT);
-}
-
-static int read_cmdline(int argc, char **argv, struct options *opts)
-{
-	int c;
-
-	while((c = getopt(argc, argv, "hnqvyV")) != -1) {
-		switch(c) {
-
-		case 'h':
-			usage(argv[0]);
-			exit(FSCK_OK);
-			break;
-		case 'n':
-			opts->no = 1;
-			break;
-		case 'q':
-			decrease_verbosity();
-			break;
-		case 'v':
-			increase_verbosity();
-			break;
-		case 'V':
-			version();
-			exit(FSCK_OK);
-			break;
-		case 'y':
-			opts->yes = 1;
-			break;
-		case ':':
-		case '?':
-			fprintf(stderr, "Please use '-h' for usage.\n");
-			exit(FSCK_USAGE);
-			break;
-		default:
-			fprintf(stderr, "Bad programmer! You forgot to catch"
-				" the %c flag\n", c);
-			exit(FSCK_USAGE);
-			break;
-
-		}
-	}
-	if(argc > optind) {
-		opts->device = (argv[optind]);
-		if(!opts->device) {
-			fprintf(stderr, "Please use '-h' for usage.\n");
-			exit(FSCK_USAGE);
-		}
-	} else {
-		fprintf(stderr, "No device specified.  Use '-h' for usage.\n");
-		exit(FSCK_USAGE);
-	}
-	return 0;
-}
-
-static void interrupt(int sig)
-{
-	fd_set rfds;
-	struct timeval tv;
-	char response;
-	int err;
-	ssize_t amtread;
-
-	if (fsck_query) /* if we're asking them a question */
-		return;     /* ignore the interrupt signal */
-	FD_ZERO(&rfds);
-	FD_SET(STDIN_FILENO, &rfds);
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-	/* Make sure there isn't extraneous input before asking the
-	 * user the question */
-	while((err = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv))) {
-		if(err < 0) {
-			log_debug("Error in select() on stdin\n");
-			break;
-		}
-		err = read(STDIN_FILENO, &response, sizeof(char));
-	}
-	while (TRUE) {
-		printf("\ngfs_fsck interrupted in %s:  ", pass);
-		if (!last_reported_block || last_reported_block == last_fs_block)
-			printf("progress unknown.\n");
-		else
-			printf("processing block %" PRIu64 " out of %" PRIu64 "\n",
-				   last_reported_block, last_fs_block);
-		printf("Do you want to abort gfs_fsck, skip the rest of %s or continue (a/s/c)?", pass);
-
-		/* Make sure query is printed out */
-		fflush(stdout);
-		amtread = read(STDIN_FILENO, &response, sizeof(char));
-
-		if(amtread && tolower(response) == 's') {
-			skip_this_pass = TRUE;
-			return;
-		}
-		else if (amtread && tolower(response) == 'a') {
-			fsck_abort = TRUE;
-			return;
-		}
-		else if (amtread && tolower(response) == 'c')
-			return;
-		else {
-			while(response != '\n')
-				amtread = read(STDIN_FILENO, &response,
-					       sizeof(char));
-			printf("Bad response, please type 'c', 'a' or 's'.\n");
-			continue;
-		}
-	}
-}
-
-int main(int argc, char **argv)
-{
-	struct fsck_sb sb;
-	struct options opts = {0};
-	struct fsck_sb *sbp = &sb;
-	int error = 0;
-
-	memset(sbp, 0, sizeof(*sbp));
-	sbp->opts = &opts;
-
-	if((error = read_cmdline(argc, argv, &opts)))
-		exit(error);
-	setbuf(stdout, NULL);
-	log_notice("Initializing fsck\n");
-	if ((error = initialize(sbp)))
-		exit(error);
-
-	signal(SIGINT, interrupt);
-	log_notice("Starting pass1\n");
-	pass = "pass 1";
-	last_reported_block = 0;
-	if ((error = pass1(sbp)))
-		exit(error);
-	if (skip_this_pass || fsck_abort) {
-		skip_this_pass = FALSE;
-		log_notice("Pass1 interrupted   \n");
-	}
-	else
-		log_notice("Pass1 complete      \n");
-
-	if (!fsck_abort) {
-		last_reported_block = 0;
-		pass = "pass 1b";
-		log_notice("Starting pass1b\n");
-		if((error = pass1b(sbp)))
-			exit(error);
-		if (skip_this_pass || fsck_abort) {
-			skip_this_pass = FALSE;
-			log_notice("Pass1b interrupted   \n");
-		}
-		else
-			log_notice("Pass1b complete      \n");
-	}
-	if (!fsck_abort) {
-		last_reported_block = 0;
-		pass = "pass 1c";
-		log_notice("Starting pass1c\n");
-		if((error = pass1c(sbp)))
-			exit(error);
-		if (skip_this_pass || fsck_abort) {
-			skip_this_pass = FALSE;
-			log_notice("Pass1c interrupted   \n");
-		}
-		else
-			log_notice("Pass1c complete      \n");
-	}
-	if (!fsck_abort) {
-		last_reported_block = 0;
-		pass = "pass 2";
-		log_notice("Starting pass2\n");
-		if ((error = pass2(sbp, &opts)))
-			exit(error);
-		if (skip_this_pass || fsck_abort) {
-			skip_this_pass = FALSE;
-			log_notice("Pass2 interrupted   \n");
-		}
-		else
-			log_notice("Pass2 complete      \n");
-	}
-	if (!fsck_abort) {
-		last_reported_block = 0;
-		pass = "pass 3";
-		log_notice("Starting pass3\n");
-		if ((error = pass3(sbp, &opts)))
-			exit(error);
-		if (skip_this_pass || fsck_abort) {
-			skip_this_pass = FALSE;
-			log_notice("Pass3 interrupted   \n");
-		}
-		else
-			log_notice("Pass3 complete      \n");
-	}
-	if (!fsck_abort) {
-		last_reported_block = 0;
-		pass = "pass 4";
-		log_notice("Starting pass4\n");
-		if ((error = pass4(sbp, &opts)))
-			exit(error);
-		if (skip_this_pass || fsck_abort) {
-			skip_this_pass = FALSE;
-			log_notice("Pass4 interrupted   \n");
-		}
-		else
-			log_notice("Pass4 complete      \n");
-	}
-	if (!fsck_abort) {
-		last_reported_block = 0;
-		pass = "pass 5";
-		log_notice("Starting pass5\n");
-		if ((error = pass5(sbp, &opts)))
-			exit(error);
-		if (skip_this_pass || fsck_abort) {
-			skip_this_pass = FALSE;
-			log_notice("Pass5 interrupted   \n");
-		}
-		else
-			log_notice("Pass5 complete      \n");
-		log_notice("Writing changes to disk\n");
-	} else {
-		error = FSCK_CANCELED;
-	}
-
-	destroy(sbp);
-	if (!error) {
-		if (!errors_found)
-			error = FSCK_OK;
-		else if (errors_found == errors_corrected)
-			error = FSCK_NONDESTRUCT;
-		else
-			error = FSCK_UNCORRECTED;
-	}
-	exit(error);
-}
-
-
-
diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c
deleted file mode 100644
index 9ae00db..0000000
--- a/gfs/gfs_fsck/metawalk.c
+++ /dev/null
@@ -1,1088 +0,0 @@
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "bio.h"
-#include "fs_dir.h"
-#include "inode.h"
-#include "util.h"
-#include "hash.h"
-
-#include "metawalk.h"
-
-/*
- * check_entries - check directory entries for a given block
- *
- * @ip - dinode associated with this leaf block
- * bh - buffer for the leaf block
- * type - type of block this is (linear or exhash)
- * @update - set to 1 if the block was updated
- * @count - set to the count entries
- * @pass - structure pointing to pass-specific functions
- *
- * returns: 0 - good block or it was repaired to be good
- *         -1 - error occurred
- */
-static int check_entries(struct fsck_inode *ip, osi_buf_t *bh, int type,
-			 int *update, uint16_t *count,
-			 struct metawalk_fxns *pass)
-{
-	struct gfs_leaf *leaf = NULL;
-	struct gfs_dirent *dent;
-	struct gfs_dirent de, *prev;
-	int error = 0;
-	char *bh_end;
-	char *filename;
-	int first = 1;
-
-	bh_end = BH_DATA(bh) + BH_SIZE(bh);
-
-	if(type == DIR_LINEAR) {
-		dent = (struct gfs_dirent *)(BH_DATA(bh)
-					     + sizeof(struct gfs_dinode));
-	}
-	else if (type == DIR_EXHASH) {
-		dent = (struct gfs_dirent *)(BH_DATA(bh)
-					     + sizeof(struct gfs_leaf));
-		leaf = (struct gfs_leaf *)BH_DATA(bh);
-		log_debug("Checking leaf %"PRIu64"\n", BH_BLKNO(bh));
-	}
-	else {
-		log_err("Invalid directory type %d specified\n", type);
-		return -1;
-	}
-
-	prev = NULL;
-	if(!pass->check_dentry)
-		return 0;
-
-	while(1) {
-		if (skip_this_pass || fsck_abort)
-			return FSCK_OK;
-		memset(&de, 0, sizeof(struct gfs_dirent));
-		gfs_dirent_in(&de, (char *)dent);
-		filename = (char *)dent + sizeof(struct gfs_dirent);
-
-		if (de.de_rec_len < sizeof(struct gfs_dirent) +
-		    de.de_name_len ||
-		    (de.de_inum.no_formal_ino && !de.de_name_len && !first)) {
-			log_err("Directory block %"
-				PRIu64 ", entry %d of directory %"
-				PRIu64 " is corrupt.\n", BH_BLKNO(bh),
-				(*count) + 1, ip->i_di.di_num.no_addr);
-			errors_found++;
-			if (query(ip->i_sbd, "Attempt to repair it? (y/n) ")) {
-				if (dirent_repair(ip, bh, &de, dent, type,
-						  first)) {
-					if (first) /* make a new sentinel */
-						dirblk_truncate(ip, dent, bh);
-					else
-						dirblk_truncate(ip, prev, bh);
-					*update = 1;
-					log_err("Unable to repair corrupt "
-						"directory entry; the entry "
-						"was removed instead.\n");
-					errors_corrected++;
-					return 0;
-				} else {
-					log_err("Corrupt directory entry "
-						"repaired.\n");
-					errors_corrected++;
-					*update = 1;
-					/* keep looping through dentries */
-				}
-			} else {
-				log_err("Corrupt directory entry ignored, "
-					"stopped after checking %d entries.\n",
-					*count);
-				return 0;
-			}
-		}
-		if (!de.de_inum.no_formal_ino){
-			if(first){
-				log_debug("First dirent is a sentinel (place holder).\n");
-				first = 0;
-			} else {
-				log_err("Directory entry with inode number of "
-					"zero in leaf %"PRIu64" of directory "
-					"%"PRIu64"!\n", BH_BLKNO(bh),
-					ip->i_di.di_num.no_addr);
-				errors_found++;
-				if (query(ip->i_sbd,
-					  "Attempt to remove it? (y/n) ")) {
-					dirblk_truncate(ip, prev, bh);
-					*update = 1;
-					log_err("The corrupt directory entry "
-						"was removed.\n");
-					errors_corrected++;
-				} else {
-					log_err("Corrupt directory entry "
-						"ignored, stopped after "
-						"checking %d entries.\n",
-						*count);
-				}
-				return 0;
-			}
-		} else {
-
-			error = pass->check_dentry(ip, dent, prev, bh,
-						   filename, update,
-						   count,
-						   pass->private);
-			if(error < 0) {
-				stack;
-				return -1;
-			}
-		}
-
-		if ((char *)dent + de.de_rec_len >= bh_end){
-			log_debug("Last entry processed.\n");
-			break;
-		}
-
-		/* If we didn't clear the dentry, or if we did, but it
-		 * was the first dentry, set prev  */
-		if(!error || first)
-			prev = dent;
-		first = 0;
-		dent = (struct gfs_dirent *)((char *)dent + de.de_rec_len);
-	}
-	return 0;
-}
-
-/* Process a bad leaf pointer and ask to repair the first time.      */
-/* The repair process involves extending the previous leaf's entries */
-/* so that they replace the bad ones.  We have to hack up the old    */
-/* leaf a bit, but it's better than deleting the whole directory,    */
-/* which is what used to happen before.                              */
-static void warn_and_patch(struct fsck_inode *ip, uint64_t *leaf_no,
-		    uint64_t *bad_leaf, uint64_t old_leaf,
-		    uint64_t first_ok_leaf, int lindex, const char *msg)
-{
-	if (*bad_leaf != *leaf_no) {
-		log_err("Directory Inode %" PRIu64 " points to leaf %"
-			PRIu64 " %s.\n", ip->i_di.di_num.no_addr, *leaf_no,
-			msg);
-	}
-	errors_found++;
-	if (*leaf_no == *bad_leaf ||
-	    query(ip->i_sbd, "Attempt to patch around it? (y/n) ")) {
-		errors_corrected++;
-		if (check_range(ip->i_sbd, old_leaf) == 0)
-			put_leaf_nr(ip, lindex, old_leaf);
-		else
-			put_leaf_nr(ip, lindex, first_ok_leaf);
-		log_err("Directory Inode %" PRIu64 ") repaired.\n",
-			ip->i_di.di_num.no_addr);
-	}
-	else
-		log_err("Bad leaf left in place.\n");
-	*bad_leaf = *leaf_no;
-	*leaf_no = old_leaf;
-}
-
-/* Checks all exhash directory leaf blocks (and their directory entries) */
-static int check_leaf_blks(struct fsck_inode *ip, int *update,
-			   struct metawalk_fxns *pass)
-{
-	int error;
-	struct gfs_leaf leaf, oldleaf;
-	uint64_t leaf_no, old_leaf, bad_leaf = -1;
-	uint64_t first_leaf_ptr = -1, first_ok_leaf = -1;
-	osi_buf_t *lbh;
-	int lindex;
-	struct fsck_sb *sbp = ip->i_sbd;
-	uint16_t count;
-	int ref_count = 0, exp_count = 0;
-
-	/* Find the first valid leaf pointer in range and use it as our "old"
-	   leaf. That way, bad blocks at the beginning will be overwritten
-	   with the first valid leaf. */
-	first_ok_leaf = -1;
-	for(lindex = 0; lindex < (1 << ip->i_di.di_depth); lindex++) {
-		get_leaf_nr(ip, lindex, &first_ok_leaf);
-		if (first_leaf_ptr == -1)
-			first_leaf_ptr = first_ok_leaf;
-		if(check_range(sbp, first_ok_leaf) == 0) {
-			get_and_read_buf(sbp, first_ok_leaf, &lbh, 0);
-			/* Make sure it's really a valid leaf block. */
-			if (check_meta(lbh, GFS_METATYPE_LF) == 0) {
-				relse_buf(sbp, lbh);
-				break;
-			}
-			relse_buf(sbp, lbh);
-		}
-	}
-	old_leaf = -1;
-	memset(&oldleaf, 0, sizeof(oldleaf));
-	for(lindex = 0; lindex < (1 << ip->i_di.di_depth); lindex++) {
-		if (fsck_abort)
-			break;
-		if(get_leaf_nr(ip, lindex, &leaf_no)) {
-			log_err("Unable to get leaf block number in dir %"
-				PRIu64"\n"
-				"\tDepth = %u\n"
-				"\tlindex = %u\n",
-				ip->i_num.no_addr,
-				ip->i_di.di_depth,
-				lindex);
-			return -1;
-		}
-
-		/* GFS has multiple indirect pointers to the same leaf
-		 * until those extra pointers are needed, so skip the
-		 * dups */
-		if (leaf_no == bad_leaf) {
-			put_leaf_nr(ip, lindex, old_leaf); /* fill w/old leaf */
-			ref_count++;
-			continue;
-		}
-		else if(old_leaf == leaf_no) {
-			ref_count++;
-			continue;
-		}
-		if(check_range(sbp, old_leaf) == 0 && ref_count != exp_count){
-			log_err("Dir #%"PRIu64" has an incorrect number "
-				"of pointers to leaf #%"PRIu64"\n"
-				"\tFound: %u,  Expected: %u\n",
-				ip->i_num.no_addr, old_leaf, ref_count,
-				exp_count);
-			errors_found++;
-			if (query(ip->i_sbd, "Attempt to fix it? (y/n) ")) {
-				int factor = 0, divisor = ref_count;
-
-				errors_corrected++;
-				get_and_read_buf(sbp, old_leaf, &lbh, 0);
-				while (divisor > 1) {
-					factor++;
-					divisor /= 2;
-				}
-				gfs_leaf_in(&oldleaf, BH_DATA(lbh));
-				oldleaf.lf_depth = ip->i_di.di_depth - factor;
-				gfs_leaf_out(&oldleaf, BH_DATA(lbh));
-				write_buf(sbp, lbh, 0);
-				relse_buf(sbp, lbh);
-			}
-			else
-				return 1;
-		}
-		ref_count = 1;
-
-		count = 0;
-		do {
-			if (fsck_abort)
-				break;
-			/* Make sure the block number is in range. */
-			if(check_range(ip->i_sbd, leaf_no)){
-				log_err("Leaf block #%"PRIu64" is out of "
-					"range for directory #%"PRIu64".\n",
-					leaf_no, ip->i_di.di_num.no_addr);
-				warn_and_patch(ip, &leaf_no, &bad_leaf,
-					       old_leaf,  first_ok_leaf, lindex,
-					       "that is out of range");
-				memcpy(&leaf, &oldleaf, sizeof(oldleaf));
-				break;
-			}
-			*update = 0;
-			/* Try to read in the leaf block. */
-			if(get_and_read_buf(sbp, leaf_no, &lbh, 0)){
-				log_err("Unable to read leaf block #%"
-					PRIu64" for "
-					"directory #%"PRIu64".\n",
-					leaf_no, ip->i_di.di_num.no_addr);
-				warn_and_patch(ip, &leaf_no, &bad_leaf,
-					       old_leaf, first_ok_leaf, lindex,
-					       "that cannot be read");
-				memcpy(&leaf, &oldleaf, sizeof(oldleaf));
-				relse_buf(sbp, lbh);
-				break;
-			}
-			/* Make sure it's really a valid leaf block. */
-			if (check_meta(lbh, GFS_METATYPE_LF)) {
-				warn_and_patch(ip, &leaf_no, &bad_leaf,
-					       old_leaf, first_ok_leaf, lindex,
-					       "that is not really a leaf");
-				memcpy(&leaf, &oldleaf, sizeof(oldleaf));
-				relse_buf(sbp, lbh);
-				break;
-			}
-			gfs_leaf_in(&leaf, BH_DATA(lbh));
-			if(pass->check_leaf) {
-				error = pass->check_leaf(ip, leaf_no, lbh,
-							 pass->private);
-			}
-
-			/* Make sure it's really a leaf. */
-			if (leaf.lf_header.mh_type != GFS_METATYPE_LF) {
-				log_err("Inode %" PRIu64 " points to bad leaf "
-					PRIu64 ".\n", ip->i_di.di_num.no_addr,
-					leaf_no);
-				relse_buf(sbp, lbh);
-				break;
-			}
-
-			exp_count = (1 << (ip->i_di.di_depth - leaf.lf_depth));
-			log_debug("expected count %u - %u %u\n", exp_count,
-				  ip->i_di.di_depth, leaf.lf_depth);
-			if(pass->check_dentry && 
-			   ip->i_di.di_type == GFS_FILE_DIR) {
-				error = check_entries(ip, lbh, DIR_EXHASH,
-						      update, &count, pass);
-
-				/* Since the buffer possibly got
-				 * updated directly, release it now,
-				 * and grab it again later if we need it. */
-
-				relse_buf(sbp, lbh);
-
-				if(error < 0) {
-					stack;
-					return -1;
-				}
-
-				if(update && (count != leaf.lf_entries)) {
-
-					if(get_and_read_buf(sbp, leaf_no,
-							    &lbh, 0)){
-						log_err("Unable to read leaf block #%"
-							PRIu64" for "
-							"directory #%"PRIu64".\n",
-							leaf_no,
-							ip->i_di.di_num.no_addr);
-						return -1;
-					}
-					gfs_leaf_in(&leaf, BH_DATA(lbh));
-
-					log_err("Leaf(%"PRIu64") entry count in directory %"PRIu64" doesn't match number of entries found - is %u, found %u\n", leaf_no, ip->i_num.no_addr, leaf.lf_entries, count);
-					errors_found++;
-					if(query(sbp, "Update leaf entry count? (y/n) ")) {
-						errors_corrected++;
-						leaf.lf_entries = count;
-						gfs_leaf_out(&leaf, BH_DATA(lbh));
-						write_buf(sbp, lbh, 0);
-						log_warn("Leaf entry count updated\n");
-					} else {
-						log_err("Leaf entry count left in inconsistant state\n");
-					}
-					relse_buf(sbp, lbh);
-				}
-				/* FIXME: Need to get entry count and
-				 * compare it against leaf->lf_entries */
-				break; /* not a chain; go back to outer loop */
-			} else {
-				relse_buf(sbp, lbh);
-				if(!leaf.lf_next)
-					break;
-				leaf_no = leaf.lf_next;
-				log_debug("Leaf chain detected.\n");
-			}
-		} while(1); /* while we have chained leaf blocks */
-		old_leaf = leaf_no;
-		memcpy(&oldleaf, &leaf, sizeof(oldleaf));
-	} /* for every leaf block */
-	return 0;
-}
-
-static int check_eattr_entries(struct fsck_inode *ip, osi_buf_t *bh,
-			       struct metawalk_fxns *pass)
-{
-	struct gfs_ea_header *ea_hdr, *ea_hdr_prev = NULL;
-	uint64_t *ea_data_ptr = NULL;
-	int i;
-	int error = 0;
-	uint32_t offset = (uint32_t)sizeof(struct gfs_meta_header);
-
-	if(!pass->check_eattr_entry) {
-		return 0;
-	}
-
-	ea_hdr = (struct gfs_ea_header *)(BH_DATA(bh) +
-					  sizeof(struct gfs_meta_header));
-
-	while(1){
-		if (ea_hdr->ea_type == GFS_EATYPE_UNUSED)
-			error = 0;
-		else
-			error = pass->check_eattr_entry(ip, bh, ea_hdr,
-							ea_hdr_prev,
-							pass->private);
-		if(error < 0) {
-			stack;
-			return -1;
-		}
-		if(error == 0 && pass->check_eattr_extentry &&
-		   ea_hdr->ea_num_ptrs) {
-			uint32_t tot_ealen = 0;
-			struct fsck_sb *sdp = ip->i_sbd;
-
-			ea_data_ptr = ((uint64_t *)((char *)ea_hdr +
-						    sizeof(struct gfs_ea_header) +
-						    ((ea_hdr->ea_name_len + 7) & ~7)));
-
-			/* It is possible when a EA is shrunk
-			** to have ea_num_ptrs be greater than
-			** the number required for ** data.
-			** In this case, the EA ** code leaves
-			** the blocks ** there for **
-			** reuse...........  */
-
-			for(i = 0; i < ea_hdr->ea_num_ptrs; i++){
-				if(pass->check_eattr_extentry(ip,
-							      ea_data_ptr,
-							      bh, ea_hdr,
-							      ea_hdr_prev,
-							      pass->private)) {
-					errors_found++;
-					if (query(ip->i_sbd,
-						  "Repair the bad Extended "
-						  "Attribute? (y/n) ")) {
-						errors_corrected++;
-						ea_hdr->ea_num_ptrs = i;
-						ea_hdr->ea_data_len =
-							cpu_to_be32(tot_ealen);
-						*ea_data_ptr = 0;
-						/* Endianness doesn't matter
-						   in this case because it's
-						   a single byte. */
-						block_set(sdp->bl,
-							  ip->i_di.di_eattr,
-							  meta_eattr);
-						write_buf(sdp, bh, 0);
-						log_err("The EA was fixed.\n");
-					} else {
-						error = 1;
-						log_err("The bad EA was not "
-							"fixed.\n");
-					}
-				}
-				tot_ealen += sdp->sb.sb_bsize -
-					sizeof(struct gfs_meta_header);
-				ea_data_ptr++;
-			}
-		}
-		offset += gfs32_to_cpu(ea_hdr->ea_rec_len);
-		if(ea_hdr->ea_flags & GFS_EAFLAG_LAST ||
-		   offset >= ip->i_sbd->sb.sb_bsize || ea_hdr->ea_rec_len == 0){
-			break;
-		}
-		ea_hdr_prev = ea_hdr;
-		ea_hdr = (struct gfs_ea_header *)
-			((char *)(ea_hdr) +
-			 gfs32_to_cpu(ea_hdr->ea_rec_len));
-	}
-
-	return error;
-}
-
-/**
- * check_leaf_eattr
- * @ip: the inode the eattr comes from
- * @block: block number of the leaf
- *
- * Returns: 0 on success, 1 if removal is needed, -1 on error
- */
-static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, struct metawalk_fxns *pass)
-{
-	osi_buf_t *bh = NULL;
-	int error = 0;
-	log_debug("Checking EA leaf block #%"PRIu64".\n", block);
-
-	if(pass->check_eattr_leaf) {
-		error = pass->check_eattr_leaf(ip, block, parent,
-					       &bh, pass->private);
-		if(error < 0) {
-			stack;
-			return -1;
-		}
-		if(error > 0) {
-			if (bh)
-				relse_buf(ip->i_sbd, bh);
-			return 1;
-		}
-		if (bh) {
-			error = check_eattr_entries(ip, bh, pass);
-			relse_buf(ip->i_sbd, bh);
-		}
-		return error;
-	}
-
-	return 0;
-}
-
-/**
- * check_indirect_eattr
- * @ip: the inode the eattr comes from
- * @indirect_block
- *
- * Returns: 0 on success -1 on error
- */
-static int check_indirect_eattr(struct fsck_inode *ip, uint64_t indirect,
-				struct metawalk_fxns *pass)
-{
-	int error = 0;
-	uint64_t *ea_leaf_ptr, *end;
-	uint64_t block;
-	osi_buf_t *indirect_buf = NULL;
-	struct fsck_sb *sdp = ip->i_sbd;
-	int update_indir_block = 0;
-	int first_ea_is_bad = 0;
-	uint64_t di_eattr_save = ip->i_di.di_eattr;
-
-	log_debug("Checking EA indirect block #%"PRIu64".\n", indirect);
-
-	if (!pass->check_eattr_indir)
-		return 0;
-	error = pass->check_eattr_indir(ip, indirect, ip->i_di.di_num.no_addr,
-					&indirect_buf, pass->private);
-	if (!error) {
-		int leaf_pointers = 0, leaf_pointer_errors = 0;
-
-		ea_leaf_ptr = (uint64 *)(BH_DATA(indirect_buf)
-					 + sizeof(struct gfs_indirect));
-		end = ea_leaf_ptr + ((sdp->sb.sb_bsize
-				      - sizeof(struct gfs_indirect)) / 8);
-
-		while(*ea_leaf_ptr && (ea_leaf_ptr < end)){
-			block = gfs64_to_cpu(*ea_leaf_ptr);
-			leaf_pointers++;
-			error = check_leaf_eattr(ip, block, indirect, pass);
-			if (error) {
-				leaf_pointer_errors++;
-				if (!update_indir_block) {
-					errors_found++;
-					if (query(sdp, "Fix the indirect "
-						  "block too? (y/n) ")) {
-						update_indir_block = 1;
-						errors_corrected++;
-						*ea_leaf_ptr = 0;
-					}
-				} else
-					*ea_leaf_ptr = 0;
-			}
-			/* If the first eattr lead is bad, we can't have
-			   a hole, so we have to treat this as an unrecoverable
-			   eattr error and delete all eattr info. Calling
-			   finish_eattr_indir here causes ip->i_di.di_eattr = 0
-			   and that ensures that subsequent calls to
-			   check_leaf_eattr result in the eattr
-			   check_leaf_block nuking them all "due to previous
-			   errors" */
-			if (leaf_pointers == 1 && leaf_pointer_errors == 1) {
-				first_ea_is_bad = 1;
-				if (pass->finish_eattr_indir)
-					pass->finish_eattr_indir(ip,
-							leaf_pointers,
-							leaf_pointer_errors,
-							pass->private);
-			} else if (leaf_pointer_errors) {
-				/* This is a bit tricky.  We can't have eattr
-				   holes. So if we have 4 good eattrs, 1 bad
-				   eattr and 5 more good ones: GGGGBGGGGG,
-				   we need to tell check_leaf_eattr to delete
-				   all eattrs after the bad one.  So we want:
-				   GGGG when we finish.  To do that, we set
-				   di_eattr to 0 temporarily. */
-				ip->i_di.di_eattr = 0;
-			}
-			ea_leaf_ptr++;
-		}
-		if (pass->finish_eattr_indir) {
-			if (!first_ea_is_bad) {
-				/* If the first ea is good but subsequent ones
-				   were bad and deleted, we need to restore
-				   the saved di_eattr block. */
-				if (leaf_pointer_errors)
-					ip->i_di.di_eattr = di_eattr_save;
-				pass->finish_eattr_indir(ip, leaf_pointers,
-							 leaf_pointer_errors,
-							 pass->private);
-			}
-			if (leaf_pointer_errors == leaf_pointers) {
-				fs_set_bitmap(sdp, indirect, GFS_BLKST_FREE);
-				block_set(sdp->bl, indirect, block_free);
-				error = 1;
-			}
-		}
-	}
-	if (indirect_buf)
-		relse_buf(sdp, indirect_buf);
-
-	return error;
-}
-
-/**
- * check_inode_eattr - check the EA's for a single inode
- * @ip: the inode whose EA to check
- *
- * Returns: 0 on success, -1 on error
- */
-int check_inode_eattr(struct fsck_inode *ip, struct metawalk_fxns *pass)
-{
-	int error = 0;
-
-	if(!ip->i_di.di_eattr)
-		return 0;
-
-	log_debug("Extended attributes exist for inode #%"PRIu64".\n",
-		ip->i_num.no_formal_ino);
-
-	if(ip->i_di.di_flags & GFS_DIF_EA_INDIRECT){
-		if((error = check_indirect_eattr(ip, ip->i_di.di_eattr, pass)))
-			stack;
-	} else {
-		error = check_leaf_eattr(ip, ip->i_di.di_eattr,
-					 ip->i_di.di_num.no_addr, pass);
-		if (error)
-			stack;
-	}
-
-	return error;
-}
-
-/**
- * build_metalist
- * @ip:
- * @mlp:
- */
-static int build_metalist(struct fsck_inode *ip, osi_list_t *mlp,
-			  struct metawalk_fxns *pass)
-{
-	uint32 height = ip->i_di.di_height;
-	osi_buf_t *bh, *nbh, *metabh;
-	osi_list_t *prev_list, *cur_list, *tmp;
-	int i, head_size;
-	uint64 *ptr, block;
-	int err;
-
-	if(get_and_read_buf(ip->i_sbd, ip->i_di.di_num.no_addr, &metabh, 0)) {
-		stack;
-		return -1;
-	}
-
-	osi_list_add(&metabh->b_list, &mlp[0]);
-
-	/* if(<there are no indirect blocks to check>) */
-	if (height < 2)
-		return 0;
-	for (i = 1; i < height; i++){
-		prev_list = &mlp[i - 1];
-		cur_list = &mlp[i];
-
-		for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next){
-			bh = osi_list_entry(tmp, osi_buf_t, b_list);
-
-			if (i > 1) {
-				/* if this isn't really a block list skip it */
-				if (check_meta(bh, GFS_METATYPE_IN))
-					continue;
-				head_size = sizeof(struct gfs_indirect);
-			} else {
-				/* if this isn't really a dinode, skip it */
-				if (check_meta(bh, GFS_METATYPE_DI))
-					continue;
-				head_size = sizeof(struct gfs_dinode);
-			}
-
-			for (ptr = (uint64 *)(bh->b_data + head_size);
-			     (char *)ptr < (bh->b_data + bh->b_size);
-			     ptr++) {
-				nbh = NULL;
-
-				if (!*ptr)
-					continue;
-
-				block = gfs64_to_cpu(*ptr);
-				err = pass->check_metalist(ip, block, &nbh,
-							   pass->private);
-				if(err < 0) {
-					stack;
-					goto fail;
-				}
-				if(err > 0) {
-					log_debug("Skipping block %"PRIu64
-						  "\n", block);
-					continue;
-				}
-				if(!nbh) {
-					if(get_and_read_buf(ip->i_sbd, block,
-							    &nbh, 0)) {
-						stack;
-						goto fail;
-					}
-				}
-				osi_list_add(&nbh->b_list, cur_list);
-			}
-		}
-	}
-	return 0;
-
- fail:
-	for (i = 0; i < GFS_MAX_META_HEIGHT; i++) {
-		osi_list_t *list;
-		list = &mlp[i];
-		while (!osi_list_empty(list))
-		{
-			bh = osi_list_entry(list->next, osi_buf_t, b_list);
-			osi_list_del(&bh->b_list);
-			relse_buf(ip->i_sbd, bh);
-		}
-	}
-	/* This is an error path, so we need to release the buffer here: */
-	relse_buf(ip->i_sbd, metabh);
-	return -1;
-}
-
-/**
- * check_metatree
- * @ip:
- * @rgd:
- *
- */
-int check_metatree(struct fsck_inode *ip, struct metawalk_fxns *pass)
-{
-	osi_list_t metalist[GFS_MAX_META_HEIGHT];
-	osi_list_t *list, *tmp;
-	osi_buf_t *bh;
-	uint64_t block, *ptr;
-	uint32_t height = ip->i_di.di_height;
-	int  i, head_size;
-	int update = 0;
-	int error = 0;
-
-	if (!height)
-		goto end;
-
-	for (i = 0; i < GFS_MAX_META_HEIGHT; i++)
-		osi_list_init(&metalist[i]);
-
-	/* create metalist for each level */
-	if(build_metalist(ip, &metalist[0], pass)){
-		stack;
-		return -1;
-	}
-
-	/* We don't need to record directory blocks - they will be
-	 * recorded later...i think... */
-	if (ip->i_di.di_type == GFS_FILE_DIR) {
-		log_debug("Directory with height > 0 at %"PRIu64"\n",
-			  ip->i_di.di_num.no_addr);
-	}
-
-	/* check data blocks */
-	list = &metalist[height - 1];
-
-	for (tmp = list->next; tmp != list; tmp = tmp->next) {
-		bh = osi_list_entry(tmp, osi_buf_t, b_list);
-
-		if (height > 1) {
-			/* if this isn't really a block list skip it */
-			if (check_meta(bh, GFS_METATYPE_IN))
-				continue;
-			head_size = sizeof(struct gfs_indirect);
-		} else {
-			/* if this isn't really a dinode, skip it */
-			if (check_meta(bh, GFS_METATYPE_DI))
-				continue;
-			head_size = sizeof(struct gfs_dinode);
-		}
-		ptr = (uint64 *)(bh->b_data + head_size);
-
-		for ( ; (char *)ptr < (bh->b_data + bh->b_size); ptr++) {
-			if (!*ptr)
-				continue;
-
-			block =  gfs64_to_cpu(*ptr);
-
-			if(pass->check_data &&
-			   (pass->check_data(ip, block, pass->private) < 0)) {
-				stack;
-				return -1;
-			}
-		}
-	}
-
-	/* free metalists */
-	for (i = 0; i < GFS_MAX_META_HEIGHT; i++)
-	{
-		list = &metalist[i];
-		while (!osi_list_empty(list))
-		{
-			bh = osi_list_entry(list->next, osi_buf_t, b_list);
-			osi_list_del(&bh->b_list);
-			relse_buf(ip->i_sbd, bh);
-		}
-	}
-
-end:
-	if (ip->i_di.di_type == GFS_FILE_DIR) {
-		/* check validity of leaf blocks and leaf chains */
-		if (ip->i_di.di_flags & GFS_DIF_EXHASH) {
-			error = check_leaf_blks(ip, &update, pass);
-			if(error < 0)
-				return -1;
-			if(error > 0)
-				return 1;
-		}
-	}
-
-	return 0;
-}
-
-/* Checks stuffed inode directories */
-static int check_linear_dir(struct fsck_inode *ip, osi_buf_t *bh, int *update,
-		     struct metawalk_fxns *pass)
-{
-	int error = 0;
-	uint16_t count = 0;
-
-	error = check_entries(ip, bh, DIR_LINEAR, update, &count, pass);
-	if(error < 0) {
-		stack;
-		return -1;
-	}
-
-	return error;
-}
-
-
-int check_dir(struct fsck_sb *sbp, uint64_t block, struct metawalk_fxns *pass)
-{
-	osi_buf_t *bh;
-	struct fsck_inode *ip;
-	int update = 0;
-	int error = 0;
-
-	if(get_and_read_buf(sbp, block, &bh, 0)){
-		log_err("Unable to retrieve block #%"PRIu64"\n",
-			block);
-		block_set(sbp->bl, block, meta_inval);
-		return -1;
-	}
-
-	if(copyin_inode(sbp, bh, &ip)) {
-		stack;
-		relse_buf(sbp, bh);
-		return -1;
-	}
-
-	if(ip->i_di.di_flags & GFS_DIF_EXHASH) {
-		error = check_leaf_blks(ip, &update, pass);
-		if(error < 0) {
-			stack;
-			free_inode(&ip);
-			relse_buf(sbp, bh);
-			return -1;
-		}
-	}
-	else {
-		error = check_linear_dir(ip, bh, &update, pass);
-		if(error < 0) {
-			stack;
-			free_inode(&ip);
-			relse_buf(sbp, bh);
-			return -1;
-		}
-	}
-
-	free_inode(&ip);
-	relse_buf(sbp, bh);
-
-	return error;
-}
-
-static int remove_dentry(struct fsck_inode *ip, struct gfs_dirent *dent,
-		  struct gfs_dirent *prev_de,
-		  osi_buf_t *bh, char *filename, int *update,
-		  uint16_t *count,
-		  void *private)
-{
-	/* the metawalk_fxn's private field must be set to the dentry
-	 * block we want to clear */
-	uint64_t *dentryblock = (uint64_t *) private;
-	struct gfs_dirent dentry, *de;
-
-	memset(&dentry, 0, sizeof(struct gfs_dirent));
-	gfs_dirent_in(&dentry, (char *)dent);
-	de = &dentry;
-
-	if(de->de_inum.no_addr == *dentryblock) {
-		*update = 1;
-		if(dirent_del(ip, bh, prev_de, dent)) {
-			stack;
-			return -1;
-		}
-	}
-	else {
-		(*count)++;
-		*update = 1;
-	}
-
-	return 0;
-
-}
-
-int remove_dentry_from_dir(struct fsck_sb *sbp, uint64_t dir,
-			   uint64_t dentryblock)
-{
-	struct metawalk_fxns remove_dentry_fxns = {0};
-	struct block_query q;
-	int error;
-
-	log_debug("Removing dentry %"PRIu64" from directory %"PRIu64"\n",
-		  dentryblock, dir);
-	if(check_range(sbp, dir)) {
-		log_err("Parent directory out of range\n");
-		return 1;
-	}
-	remove_dentry_fxns.private = &dentryblock;
-	remove_dentry_fxns.check_dentry = remove_dentry;
-
-	if(block_check(sbp->bl, dir, &q)) {
-		stack;
-		return -1;
-	}
-	if(q.block_type != inode_dir) {
-		log_info("Parent block is not a directory...ignoring\n");
-		return 1;
-	}
-	/* Need to run check_dir with a private var of dentryblock,
-	 * and fxns that remove that dentry if found */
-	error = check_dir(sbp, dir, &remove_dentry_fxns);
-
-	return error;
-}
-
-/* FIXME: These should be merged with the hash routines in inode_hash.c */
-static uint32_t dinode_hash(uint64_t block_no)
-{
-	unsigned int h;
-
-	h = fsck_hash(&block_no, sizeof (uint64_t));
-	h &= FSCK_HASH_MASK;
-
-	return h;
-}
-
-int find_di(struct fsck_sb *sbp, uint64_t childblock, struct dir_info **dip)
-{
-	osi_list_t *bucket = &sbp->dir_hash[dinode_hash(childblock)];
-	osi_list_t *tmp;
-	struct dir_info *di = NULL;
-
-	osi_list_foreach(tmp, bucket) {
-		di = osi_list_entry(tmp, struct dir_info, list);
-		if(di->dinode == childblock) {
-			*dip = di;
-			return 0;
-		}
-	}
-	*dip = NULL;
-	return -1;
-
-}
-
-int dinode_hash_insert(osi_list_t *buckets, uint64_t key, struct dir_info *di)
-{
-	osi_list_t *tmp;
-	osi_list_t *bucket = &buckets[dinode_hash(key)];
-	struct dir_info *dtmp = NULL;
-
-	if(osi_list_empty(bucket)) {
-		osi_list_add(&di->list, bucket);
-		return 0;
-	}
-
-	osi_list_foreach(tmp, bucket) {
-		dtmp = osi_list_entry(tmp, struct dir_info, list);
-		if(dtmp->dinode < key) {
-			continue;
-		}
-		else {
-			osi_list_add_prev(&di->list, tmp);
-			return 0;
-		}
-	}
-	osi_list_add_prev(&di->list, bucket);
-	return 0;
-}
-
-int dinode_hash_remove(osi_list_t *buckets, uint64_t key)
-{
-	osi_list_t *tmp;
-	osi_list_t *bucket = &buckets[dinode_hash(key)];
-	struct dir_info *dtmp = NULL;
-
-	if(osi_list_empty(bucket)) {
-		return -1;
-	}
-	osi_list_foreach(tmp, bucket) {
-		dtmp = osi_list_entry(tmp, struct dir_info, list);
-		if(dtmp->dinode == key) {
-			osi_list_del(tmp);
-			return 0;
-		}
-	}
-	return -1;
-}
-
-/**
- * free_block - free up a block given its block number
- */
-void free_block(struct fsck_sb *sdp, uint64_t block)
-{
-	osi_buf_t *bh;
-	struct fsck_rgrp *rgd;
-
-	fs_set_bitmap(sdp, block, GFS_BLKST_FREE);
-	/* Adjust the free space count for the freed block */
-	rgd = fs_blk2rgrpd(sdp, block); /* find the rg for indir block */
-	get_and_read_buf(sdp, rgd->rd_ri.ri_addr, &bh, 0);
-	rgd->rd_rg.rg_free++; /* adjust the free count */
-	gfs_rgrp_out(&rgd->rd_rg, bh->b_data); /* back to the buffer */
-	relse_buf(sdp, bh); /* release the buffer */
-}
-
-/**
- * delete_blocks - delete blocks associated with an inode
- */
-int delete_blocks(struct fsck_inode *ip, uint64_t block, osi_buf_t **bh,
-		  const char *btype, void *private)
-{
-	struct block_query q = {0};
-
-	if (check_range(ip->i_sbd, block) == 0) {
-		if (block_check(ip->i_sbd->bl, block, &q))
-			return 0;
-		if (!q.dup_block) {
-			log_info("Deleting %s block %lld as part "
-				 "of inode %lld \n",
-				 btype, block, ip->i_di.di_num.no_addr);
-			block_set(ip->i_sbd->bl, block, block_free);
-			free_block(ip->i_sbd, block);
-		}
-	}
-	return 0;
-}
-
-int delete_metadata(struct fsck_inode *ip, uint64_t block, osi_buf_t **bh,
-		    void *private)
-{
-	return delete_blocks(ip, block, bh, "metadata", private);
-}
-
-int delete_data(struct fsck_inode *ip, uint64_t block, void *private)
-{
-	return delete_blocks(ip, block, NULL, "data", private);
-}
-
-int delete_eattr_indir(struct fsck_inode *ip, uint64_t block, uint64_t parent,
-		       osi_buf_t **bh, void *private)
-{
-	return delete_blocks(ip, block, NULL, "indirect extended attribute",
-			     private);
-}
-
-int delete_eattr_leaf(struct fsck_inode *ip, uint64_t block, uint64_t parent,
-		      osi_buf_t **bh, void *private)
-{
-	return delete_blocks(ip, block, NULL, "extended attribute", private);
-}
diff --git a/gfs/gfs_fsck/metawalk.h b/gfs/gfs_fsck/metawalk.h
deleted file mode 100644
index 2d4eed2..0000000
--- a/gfs/gfs_fsck/metawalk.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef _METAWALK_H
-#define _METAWALK_H
-
-#define DIR_LINEAR 1
-#define DIR_EXHASH 2
-
-struct metawalk_fxns;
-
-int check_inode_eattr(struct fsck_inode *ip, struct metawalk_fxns *pass);
-int check_metatree(struct fsck_inode *ip, struct metawalk_fxns *pass);
-int check_dir(struct fsck_sb *sbp, uint64_t block, struct metawalk_fxns *pass);
-int remove_dentry_from_dir(struct fsck_sb *sbp, uint64_t dir,
-			   uint64_t dentryblock);
-int find_di(struct fsck_sb *sbp, uint64_t childblock, struct dir_info **dip);
-int dinode_hash_insert(osi_list_t *buckets, uint64_t key, struct dir_info *di);
-int dinode_hash_remove(osi_list_t *buckets, uint64_t key);
-void free_block(struct fsck_sb *sdp, uint64_t block);
-int delete_blocks(struct fsck_inode *ip, uint64_t block, osi_buf_t **bh,
-		  const char *btype, void *private);
-int delete_metadata(struct fsck_inode *ip, uint64_t block, osi_buf_t **bh,
-		    void *private);
-int delete_data(struct fsck_inode *ip, uint64_t block, void *private);
-int delete_eattr_indir(struct fsck_inode *ip, uint64_t block, uint64_t parent,
-		       osi_buf_t **bh, void *private);
-int delete_eattr_leaf(struct fsck_inode *ip, uint64_t block, uint64_t parent,
-		      osi_buf_t **bh, void *private);
-
-/* metawalk_fxns: function pointers to check various parts of the fs
- *
- * The functions should return -1 on fatal errors, 1 if the block
- * should be skipped, and 0 on success
- *
- * private: Data that should be passed to the fxns
- * check_leaf:
- * check_metalist:
- * check_data:
- * check_eattr_indir:
- * check_eattr_leaf:
- * check_dentry:
- * check_eattr_entry:
- * check_eattr_extentry:
- */
-struct metawalk_fxns {
-	void *private;
-	int (*check_leaf) (struct fsck_inode *ip, uint64_t block,
-			   osi_buf_t *bh, void *private);
-	int (*check_metalist) (struct fsck_inode *ip, uint64_t block,
-			       osi_buf_t **bh, void *private);
-	int (*check_data) (struct fsck_inode *ip, uint64_t block,
-			   void *private);
-	int (*check_eattr_indir) (struct fsck_inode *ip, uint64_t block,
-				  uint64_t parent, osi_buf_t **bh,
-				  void *private);
-	int (*check_eattr_leaf) (struct fsck_inode *ip, uint64_t block,
-				 uint64_t parent, osi_buf_t **bh,
-				 void *private);
-	int (*check_dentry) (struct fsck_inode *ip, struct gfs_dirent *de,
-			     struct gfs_dirent *prev,
-			     osi_buf_t *bh, char *filename, int *update,
-			     uint16_t *count,
-			     void *private);
-	int (*check_eattr_entry) (struct fsck_inode *ip,
-				  osi_buf_t *leaf_bh,
-				  struct gfs_ea_header *ea_hdr,
-				  struct gfs_ea_header *ea_hdr_prev,
-				  void *private);
-	int (*check_eattr_extentry) (struct fsck_inode *ip,
-				     uint64_t *ea_data_ptr,
-				     osi_buf_t *leaf_bh,
-				     struct gfs_ea_header *ea_hdr,
-				     struct gfs_ea_header *ea_hdr_prev,
-				     void *private);
-	int (*finish_eattr_indir) (struct fsck_inode *ip, int leaf_pointers,
-				   int leaf_pointer_errors,
-				   void *private);
-};
-
-#endif /* _METAWALK_H */
diff --git a/gfs/gfs_fsck/ondisk.c b/gfs/gfs_fsck/ondisk.c
deleted file mode 100644
index d3a4938..0000000
--- a/gfs/gfs_fsck/ondisk.c
+++ /dev/null
@@ -1,1342 +0,0 @@
-#ifndef HELPER_PROGRAM
-
-#include "gfs.h"
-
-#define pv(struct, member, fmt) printk("  "#member" = "fmt"\n", struct->member);
-
-#else
-
-#include <stdio.h>
-#include <string.h>
-
-#include "global.h"
-#include "linux_endian.h"
-#include "ondisk.h"
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#endif				/*  !HELPER_PROGRAM  */
-
-#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
-#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
-#define CPIN_16(s1, s2, member) {(s1->member) = gfs16_to_cpu((s2->member));}
-#define CPOUT_16(s1, s2, member) {(s2->member) = cpu_to_gfs16((s1->member));}
-#define CPIN_32(s1, s2, member) {(s1->member) = gfs32_to_cpu((s2->member));}
-#define CPOUT_32(s1, s2, member) {(s2->member) = cpu_to_gfs32((s1->member));}
-#define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));}
-#define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));}
-
-#define pa(struct, member, count) print_array(#member, struct->member, count, console);
-
-/**
- * print_array - Print out an array of bytes
- * @title: what to print before the array
- * @buf: the array
- * @count: the number of bytes
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-static void
-print_array(const char *title, char *buf, int count, int console)
-{
-	int x;
-
-	printk("  %s =\n", title);
-	for (x = 0; x < count; x++) {
-		printk("%.2X ", (unsigned char) buf[x]);
-		if (x % 16 == 15)
-			printk("\n");
-	}
-	if (x % 16)
-		printk("\n");
-
-}
-
-/**
- * gfs_inum_in - Read in an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_in(struct gfs_inum *no, char *buf)
-{
-	struct gfs_inum *str = (struct gfs_inum *) buf;
-
-	CPIN_64(no, str, no_formal_ino);
-	CPIN_64(no, str, no_addr);
-
-}
-
-/**
- * gfs_inum_out - Write out an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_out(struct gfs_inum *no, char *buf)
-{
-	struct gfs_inum *str = (struct gfs_inum *) buf;
-
-	CPOUT_64(no, str, no_formal_ino);
-	CPOUT_64(no, str, no_addr);
-
-}
-
-/**
- * gfs_inum_print - Print out a inode number
- * @no: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_inum_print(struct gfs_inum *no, int console)
-{
-
-	pv(no, no_formal_ino, "%" PRIu64);
-	pv(no, no_addr, "%" PRIu64);
-
-}
-
-/**
- * gfs_meta_header_in - Read in a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_meta_header_in(struct gfs_meta_header *mh, char *buf)
-{
-	struct gfs_meta_header *str = (struct gfs_meta_header *) buf;
-
-	CPIN_32(mh, str, mh_magic);
-	CPIN_32(mh, str, mh_type);
-	CPIN_64(mh, str, mh_generation);
-	CPIN_32(mh, str, mh_format);
-	CPIN_32(mh, str, mh_incarn);
-
-}
-
-/**
- * gfs_meta_header_in - Write out a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- * Don't ever change the generation number in this routine.
- * It's done manually in increment_generation().
- */
-
-void
-gfs_meta_header_out(struct gfs_meta_header *mh, char *buf)
-{
-	struct gfs_meta_header *str = (struct gfs_meta_header *) buf;
-
-	CPOUT_32(mh, str, mh_magic);
-	CPOUT_32(mh, str, mh_type);
-	/*CPOUT_64(mh, str, mh_generation); */
-	CPOUT_32(mh, str, mh_format);
-	CPOUT_32(mh, str, mh_incarn);
-
-}
-
-/**
- * gfs_meta_header_print - Print out a metadata header
- * @mh: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_meta_header_print(struct gfs_meta_header *mh, int console)
-{
-
-	pv(mh, mh_magic, "0x%.8X");
-	pv(mh, mh_type, "%u");
-	pv(mh, mh_generation, "%" PRIu64);
-	pv(mh, mh_format, "%u");
-	pv(mh, mh_incarn, "%u");
-
-}
-
-/**
- * gfs_sb_in - Read in a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_in(struct gfs_sb *sb, char *buf)
-{
-	struct gfs_sb *str = (struct gfs_sb *) buf;
-
-	gfs_meta_header_in(&sb->sb_header, buf);
-
-	CPIN_32(sb, str, sb_fs_format);
-	CPIN_32(sb, str, sb_multihost_format);
-	CPIN_32(sb, str, sb_flags);
-
-	CPIN_32(sb, str, sb_bsize);
-	CPIN_32(sb, str, sb_bsize_shift);
-	CPIN_32(sb, str, sb_seg_size);
-
-	gfs_inum_in(&sb->sb_jindex_di, (char *) &str->sb_jindex_di);
-	gfs_inum_in(&sb->sb_rindex_di, (char *) &str->sb_rindex_di);
-	gfs_inum_in(&sb->sb_root_di, (char *) &str->sb_root_di);
-
-	CPIN_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPIN_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_in(&sb->sb_quota_di, (char *) &str->sb_quota_di);
-	gfs_inum_in(&sb->sb_license_di, (char *) &str->sb_license_di);
-
-	CPIN_08(sb, str, sb_reserved, 96);
-
-}
-
-/**
- * gfs_sb_out - Write out a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_out(struct gfs_sb *sb, char *buf)
-{
-	struct gfs_sb *str = (struct gfs_sb *) buf;
-
-	gfs_meta_header_out(&sb->sb_header, buf);
-
-	CPOUT_32(sb, str, sb_fs_format);
-	CPOUT_32(sb, str, sb_multihost_format);
-	CPOUT_32(sb, str, sb_flags);
-
-	CPOUT_32(sb, str, sb_bsize);
-	CPOUT_32(sb, str, sb_bsize_shift);
-	CPOUT_32(sb, str, sb_seg_size);
-
-	gfs_inum_out(&sb->sb_jindex_di, (char *) &str->sb_jindex_di);
-	gfs_inum_out(&sb->sb_rindex_di, (char *) &str->sb_rindex_di);
-	gfs_inum_out(&sb->sb_root_di, (char *) &str->sb_root_di);
-
-	CPOUT_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPOUT_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_out(&sb->sb_quota_di, (char *) &str->sb_quota_di);
-	gfs_inum_out(&sb->sb_license_di, (char *) &str->sb_license_di);
-
-	CPOUT_08(sb, str, sb_reserved, 96);
-
-}
-
-/**
- * gfs_sb_print - Print out a superblock
- * @sb: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_sb_print(struct gfs_sb *sb, int console)
-{
-
-	gfs_meta_header_print(&sb->sb_header, console);
-
-	pv(sb, sb_fs_format, "%u");
-	pv(sb, sb_multihost_format, "%u");
-	pv(sb, sb_flags, "%u");
-
-	pv(sb, sb_bsize, "%u");
-	pv(sb, sb_bsize_shift, "%u");
-	pv(sb, sb_seg_size, "%u");
-
-	gfs_inum_print(&sb->sb_jindex_di, console);
-	gfs_inum_print(&sb->sb_rindex_di, console);
-	gfs_inum_print(&sb->sb_root_di, console);
-
-	pv(sb, sb_lockproto, "%s");
-	pv(sb, sb_locktable, "%s");
-
-	gfs_inum_print(&sb->sb_quota_di, console);
-	gfs_inum_print(&sb->sb_license_di, console);
-
-	pa(sb, sb_reserved, 96);
-
-}
-
-/**
- * gfs_jindex_in - Read in a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_in(struct gfs_jindex *jindex, char *buf)
-{
-	struct gfs_jindex *str = (struct gfs_jindex *) buf;
-
-	CPIN_64(jindex, str, ji_addr);
-	CPIN_32(jindex, str, ji_nsegment);
-	CPIN_32(jindex, str, ji_pad);
-
-	CPIN_08(jindex, str, ji_reserved, 64);
-
-}
-
-/**
- * gfs_jindex_out - Write out a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_out(struct gfs_jindex *jindex, char *buf)
-{
-	struct gfs_jindex *str = (struct gfs_jindex *) buf;
-
-	CPOUT_64(jindex, str, ji_addr);
-	CPOUT_32(jindex, str, ji_nsegment);
-	CPOUT_32(jindex, str, ji_pad);
-
-	CPOUT_08(jindex, str, ji_reserved, 64);
-
-}
-
-/**
- * gfs_jindex_print - Print out a journal index structure
- * @ji: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_jindex_print(struct gfs_jindex *ji, int console)
-{
-
-	pv(ji, ji_addr, "%" PRIu64);
-	pv(ji, ji_nsegment, "%u");
-	pv(ji, ji_pad, "%u");
-
-	pa(ji, ji_reserved, 64);
-
-}
-
-/**
- * gfs_rindex_in - Read in a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_in(struct gfs_rindex *grindex, char *buf)
-{
-	struct gfs_rindex *str = (struct gfs_rindex *) buf;
-
-	CPIN_64(grindex, str, ri_addr);
-	CPIN_32(grindex, str, ri_length);
-	CPIN_32(grindex, str, ri_pad);
-
-	CPIN_64(grindex, str, ri_data1);
-	CPIN_32(grindex, str, ri_data);
-
-	CPIN_32(grindex, str, ri_bitbytes);
-
-	CPIN_08(grindex, str, ri_reserved, 64);
-
-}
-
-/**
- * gfs_rindex_out - Write out a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_out(struct gfs_rindex *grindex, char *buf)
-{
-	struct gfs_rindex *str = (struct gfs_rindex *) buf;
-
-	CPOUT_64(grindex, str, ri_addr);
-	CPOUT_32(grindex, str, ri_length);
-	CPOUT_32(grindex, str, ri_pad);
-
-	CPOUT_64(grindex, str, ri_data1);
-	CPOUT_32(grindex, str, ri_data);
-
-	CPOUT_32(grindex, str, ri_bitbytes);
-
-	CPOUT_08(grindex, str, ri_reserved, 64);
-
-}
-
-/**
- * gfs_rindex_print - Print out a resource index structure
- * @ri: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_rindex_print(struct gfs_rindex *ri, int console)
-{
-
-	pv(ri, ri_addr, "%" PRIu64);
-	pv(ri, ri_length, "%u");
-	pv(ri, ri_pad, "%u");
-
-	pv(ri, ri_data1, "%" PRIu64);
-	pv(ri, ri_data, "%u");
-
-	pv(ri, ri_bitbytes, "%u");
-
-	pa(ri, ri_reserved, 64);
-
-}
-
-/**
- * gfs_rgrp_in - Read in a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf)
-{
-	struct gfs_rgrp *str = (struct gfs_rgrp *) buf;
-
-	gfs_meta_header_in(&rgrp->rg_header, buf);
-
-	CPIN_32(rgrp, str, rg_flags);
-
-	CPIN_32(rgrp, str, rg_free);
-
-	CPIN_32(rgrp, str, rg_useddi);
-	CPIN_32(rgrp, str, rg_freedi);
-	gfs_inum_in(&rgrp->rg_freedi_list, (char *) &str->rg_freedi_list);
-
-	CPIN_32(rgrp, str, rg_usedmeta);
-	CPIN_32(rgrp, str, rg_freemeta);
-
-	CPIN_08(rgrp, str, rg_reserved, 64);
-
-}
-
-/**
- * gfs_rgrp_out - Write out a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf)
-{
-	struct gfs_rgrp *str = (struct gfs_rgrp *) buf;
-
-	gfs_meta_header_out(&rgrp->rg_header, buf);
-
-	CPOUT_32(rgrp, str, rg_flags);
-
-	CPOUT_32(rgrp, str, rg_free);
-
-	CPOUT_32(rgrp, str, rg_useddi);
-	CPOUT_32(rgrp, str, rg_freedi);
-	gfs_inum_out(&rgrp->rg_freedi_list, (char *) &str->rg_freedi_list);
-
-	CPOUT_32(rgrp, str, rg_usedmeta);
-	CPOUT_32(rgrp, str, rg_freemeta);
-
-	CPOUT_08(rgrp, str, rg_reserved, 64);
-
-}
-
-/**
- * gfs_rgrp_print - Print out a resource group header
- * @rg: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_rgrp_print(struct gfs_rgrp *rg, int console)
-{
-
-	gfs_meta_header_print(&rg->rg_header, console);
-
-	pv(rg, rg_flags, "%u");
-
-	pv(rg, rg_free, "%u");
-
-	pv(rg, rg_useddi, "%u");
-	pv(rg, rg_freedi, "%u");
-	gfs_inum_print(&rg->rg_freedi_list, console);
-
-	pv(rg, rg_usedmeta, "%u");
-	pv(rg, rg_freemeta, "%u");
-
-	pa(rg, rg_reserved, 64);
-
-}
-
-/**
- * gfs_quota_in - Read in a quota structures
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_in(struct gfs_quota *quota, char *buf)
-{
-	struct gfs_quota *str = (struct gfs_quota *) buf;
-
-	CPIN_64(quota, str, qu_limit);
-	CPIN_64(quota, str, qu_warn);
-	CPIN_64(quota, str, qu_value);
-
-	CPIN_08(quota, str, qu_reserved, 64);
-
-}
-
-/**
- * gfs_quota_out - Write out a quota structure
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_out(struct gfs_quota *quota, char *buf)
-{
-	struct gfs_quota *str = (struct gfs_quota *) buf;
-
-	CPOUT_64(quota, str, qu_limit);
-	CPOUT_64(quota, str, qu_warn);
-	CPOUT_64(quota, str, qu_value);
-
-	CPOUT_08(quota, str, qu_reserved, 64);
-
-}
-
-/**
- * gfs_quota_print - Print out a quota structure
- * @quota: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_quota_print(struct gfs_quota *quota, int console)
-{
-
-	pv(quota, qu_limit, "%" PRIu64);
-	pv(quota, qu_warn, "%" PRIu64);
-	pv(quota, qu_value, "%" PRId64);
-
-	pa(quota, qu_reserved, 64);
-
-}
-
-/**
- * gfs_dinode_in - Read in a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_in(struct gfs_dinode *dinode, char *buf)
-{
-	struct gfs_dinode *str = (struct gfs_dinode *) buf;
-
-	gfs_meta_header_in(&dinode->di_header, buf);
-
-	gfs_inum_in(&dinode->di_num, (char *) &str->di_num);
-
-	CPIN_32(dinode, str, di_mode);
-	CPIN_32(dinode, str, di_uid);
-	CPIN_32(dinode, str, di_gid);
-	CPIN_32(dinode, str, di_nlink);
-	CPIN_64(dinode, str, di_size);
-	CPIN_64(dinode, str, di_blocks);
-	CPIN_64(dinode, str, di_atime);
-	CPIN_64(dinode, str, di_mtime);
-	CPIN_64(dinode, str, di_ctime);
-	CPIN_32(dinode, str, di_major);
-	CPIN_32(dinode, str, di_minor);
-
-	CPIN_64(dinode, str, di_rgrp);
-	CPIN_64(dinode, str, di_goal_rgrp);
-	CPIN_32(dinode, str, di_goal_dblk);
-	CPIN_32(dinode, str, di_goal_mblk);
-	CPIN_32(dinode, str, di_flags);
-	CPIN_32(dinode, str, di_payload_format);
-	CPIN_16(dinode, str, di_type);
-	CPIN_16(dinode, str, di_height);
-	CPIN_32(dinode, str, di_incarn);
-	CPIN_16(dinode, str, di_pad);
-
-	CPIN_16(dinode, str, di_depth);
-	CPIN_32(dinode, str, di_entries);
-
-	gfs_inum_in(&dinode->di_next_unused, (char *) &str->di_next_unused);
-
-	CPIN_64(dinode, str, di_eattr);
-
-	CPIN_08(dinode, str, di_reserved, 56);
-
-}
-
-/**
- * gfs_dinode_out - Write out a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_out(struct gfs_dinode *dinode, char *buf)
-{
-	struct gfs_dinode *str = (struct gfs_dinode *) buf;
-
-	gfs_meta_header_out(&dinode->di_header, buf);
-
-	gfs_inum_out(&dinode->di_num, (char *) &str->di_num);
-
-	CPOUT_32(dinode, str, di_mode);
-	CPOUT_32(dinode, str, di_uid);
-	CPOUT_32(dinode, str, di_gid);
-	CPOUT_32(dinode, str, di_nlink);
-	CPOUT_64(dinode, str, di_size);
-	CPOUT_64(dinode, str, di_blocks);
-	CPOUT_64(dinode, str, di_atime);
-	CPOUT_64(dinode, str, di_mtime);
-	CPOUT_64(dinode, str, di_ctime);
-	CPOUT_32(dinode, str, di_major);
-	CPOUT_32(dinode, str, di_minor);
-
-	CPOUT_64(dinode, str, di_rgrp);
-	CPOUT_64(dinode, str, di_goal_rgrp);
-	CPOUT_32(dinode, str, di_goal_dblk);
-	CPOUT_32(dinode, str, di_goal_mblk);
-	CPOUT_32(dinode, str, di_flags);
-	CPOUT_32(dinode, str, di_payload_format);
-	CPOUT_16(dinode, str, di_type);
-	CPOUT_16(dinode, str, di_height);
-	CPOUT_32(dinode, str, di_incarn);
-	CPOUT_16(dinode, str, di_pad);
-
-	CPOUT_16(dinode, str, di_depth);
-	CPOUT_32(dinode, str, di_entries);
-
-	gfs_inum_out(&dinode->di_next_unused, (char *) &str->di_next_unused);
-
-	CPOUT_64(dinode, str, di_eattr);
-
-	CPOUT_08(dinode, str, di_reserved, 56);
-
-}
-
-/**
- * gfs_dinode_print - Print out a dinode
- * @di: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_dinode_print(struct gfs_dinode *di, int console)
-{
-
-	gfs_meta_header_print(&di->di_header, console);
-
-	gfs_inum_print(&di->di_num, console);
-
-	pv(di, di_mode, "0%o");
-	pv(di, di_uid, "%u");
-	pv(di, di_gid, "%u");
-	pv(di, di_nlink, "%u");
-	pv(di, di_size, "%" PRIu64);
-	pv(di, di_blocks, "%" PRIu64);
-	pv(di, di_atime, "%" PRId64);
-	pv(di, di_mtime, "%" PRId64);
-	pv(di, di_ctime, "%" PRId64);
-	pv(di, di_major, "%u");
-	pv(di, di_minor, "%u");
-
-	pv(di, di_rgrp, "%" PRIu64);
-	pv(di, di_goal_rgrp, "%" PRIu64);
-	pv(di, di_goal_dblk, "%u");
-	pv(di, di_goal_mblk, "%u");
-	pv(di, di_flags, "0x%.8X");
-	pv(di, di_payload_format, "%u");
-	pv(di, di_type, "%u");
-	pv(di, di_height, "%u");
-	pv(di, di_incarn, "%u");
-	pv(di, di_pad, "%u");
-
-	pv(di, di_depth, "%u");
-	pv(di, di_entries, "%u");
-
-	gfs_inum_print(&di->di_next_unused, console);
-
-	pv(di, di_eattr, "%" PRIu64);
-
-	pa(di, di_reserved, 56);
-
-}
-
-/**
- * gfs_indirect_in - copy in the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_in(struct gfs_indirect *indirect, char *buf)
-{
-	struct gfs_indirect *str = (struct gfs_indirect *) buf;
-
-	gfs_meta_header_in(&indirect->in_header, buf);
-
-	CPIN_08(indirect, str, in_reserved, 64);
-
-}
-
-/**
- * gfs_indirect_out - copy out the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_out(struct gfs_indirect *indirect, char *buf)
-{
-	struct gfs_indirect *str = (struct gfs_indirect *) buf;
-
-	gfs_meta_header_out(&indirect->in_header, buf);
-
-	CPOUT_08(indirect, str, in_reserved, 64);
-
-}
-
-/**
- * gfs_indirect_print - Print out a indirect block header
- * @indirect: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_indirect_print(struct gfs_indirect *indirect, int console)
-{
-
-	gfs_meta_header_print(&indirect->in_header, console);
-
-	pa(indirect, in_reserved, 64);
-
-}
-
-/**
- * gfs_dirent_in - Read in a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_in(struct gfs_dirent *dirent, char *buf)
-{
-	struct gfs_dirent *str = (struct gfs_dirent *) buf;
-
-	gfs_inum_in(&dirent->de_inum, (char *) &str->de_inum);
-	CPIN_32(dirent, str, de_hash);
-	CPIN_16(dirent, str, de_rec_len);
-	CPIN_16(dirent, str, de_name_len);
-	CPIN_16(dirent, str, de_type);
-
-	CPIN_08(dirent, str, de_reserved, 14);
-
-}
-
-/**
- * gfs_dirent_out - Write out a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_out(struct gfs_dirent *dirent, char *buf)
-{
-	struct gfs_dirent *str = (struct gfs_dirent *) buf;
-
-	gfs_inum_out(&dirent->de_inum, (char *) &str->de_inum);
-	CPOUT_32(dirent, str, de_hash);
-	CPOUT_16(dirent, str, de_rec_len);
-	CPOUT_16(dirent, str, de_name_len);
-	CPOUT_16(dirent, str, de_type);
-
-	CPOUT_08(dirent, str, de_reserved, 14);
-
-}
-
-/**
- * gfs_dirent_print - Print out a directory entry
- * @de: the cpu-order buffer
- * @name: the filename
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_dirent_print(struct gfs_dirent *de, char *name, int console)
-{
-	char buf[GFS_FNAMESIZE + 1];
-
-	gfs_inum_print(&de->de_inum, console);
-	pv(de, de_hash, "0x%.8X");
-	pv(de, de_rec_len, "%u");
-	pv(de, de_name_len, "%u");
-	pv(de, de_type, "%u");
-
-	pa(de, de_reserved, 14);
-
-	memset(buf, 0, GFS_FNAMESIZE + 1);
-	memcpy(buf, name, de->de_name_len);
-	printk("  name = %s\n", buf);
-
-}
-
-/**
- * gfs_leaf_in - Read in a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_in(struct gfs_leaf *leaf, char *buf)
-{
-	struct gfs_leaf *str = (struct gfs_leaf *) buf;
-
-	gfs_meta_header_in(&leaf->lf_header, buf);
-
-	CPIN_16(leaf, str, lf_depth);
-	CPIN_16(leaf, str, lf_entries);
-	CPIN_32(leaf, str, lf_dirent_format);
-	CPIN_64(leaf, str, lf_next);
-
-	CPIN_08(leaf, str, lf_reserved, 64);
-
-}
-
-/**
- * gfs_leaf_out - Write out a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_out(struct gfs_leaf *leaf, char *buf)
-{
-	struct gfs_leaf *str = (struct gfs_leaf *) buf;
-
-	gfs_meta_header_out(&leaf->lf_header, buf);
-
-	CPOUT_16(leaf, str, lf_depth);
-	CPOUT_16(leaf, str, lf_entries);
-	CPOUT_32(leaf, str, lf_dirent_format);
-	CPOUT_64(leaf, str, lf_next);
-
-	CPOUT_08(leaf, str, lf_reserved, 64);
-
-}
-
-/**
- * gfs_leaf_print - Print out a directory leaf header
- * @lf: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_leaf_print(struct gfs_leaf *lf, int console)
-{
-
-	gfs_meta_header_print(&lf->lf_header, console);
-
-	pv(lf, lf_depth, "%u");
-	pv(lf, lf_entries, "%u");
-	pv(lf, lf_dirent_format, "%u");
-	pv(lf, lf_next, "%" PRIu64);
-
-	pa(lf, lf_reserved, 64);
-
-}
-
-/**
- * gfs_log_header_in - Read in a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_in(struct gfs_log_header *head, char *buf)
-{
-	struct gfs_log_header *str = (struct gfs_log_header *) buf;
-
-	gfs_meta_header_in(&head->lh_header, buf);
-
-	CPIN_32(head, str, lh_flags);
-	CPIN_32(head, str, lh_pad);
-
-	CPIN_64(head, str, lh_first);
-	CPIN_64(head, str, lh_sequence);
-
-	CPIN_64(head, str, lh_tail);
-	CPIN_64(head, str, lh_last_dump);
-
-	CPIN_08(head, str, lh_reserved, 64);
-
-}
-
-/**
- * gfs_log_header_out - Write out a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_out(struct gfs_log_header *head, char *buf)
-{
-	struct gfs_log_header *str = (struct gfs_log_header *) buf;
-
-	gfs_meta_header_out(&head->lh_header, buf);
-
-	CPOUT_32(head, str, lh_flags);
-	CPOUT_32(head, str, lh_pad);
-
-	CPOUT_64(head, str, lh_first);
-	CPOUT_64(head, str, lh_sequence);
-
-	CPOUT_64(head, str, lh_tail);
-	CPOUT_64(head, str, lh_last_dump);
-
-	CPOUT_08(head, str, lh_reserved, 64);
-
-}
-
-/**
- * gfs_log_header_print - Print out a log header
- * @head: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_log_header_print(struct gfs_log_header *lh, int console)
-{
-
-	gfs_meta_header_print(&lh->lh_header, console);
-
-	pv(lh, lh_flags, "0x%.8X");
-	pv(lh, lh_pad, "%u");
-
-	pv(lh, lh_first, "%" PRIu64);
-	pv(lh, lh_sequence, "%" PRIu64);
-
-	pv(lh, lh_tail, "%" PRIu64);
-	pv(lh, lh_last_dump, "%" PRIu64);
-
-	pa(lh, lh_reserved, 64);
-
-}
-
-/**
- * gfs_desc_in - Read in a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_in(struct gfs_log_descriptor *desc, char *buf)
-{
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *) buf;
-
-	gfs_meta_header_in(&desc->ld_header, buf);
-
-	CPIN_32(desc, str, ld_type);
-	CPIN_32(desc, str, ld_length);
-	CPIN_32(desc, str, ld_data1);
-	CPIN_32(desc, str, ld_data2);
-
-	CPIN_08(desc, str, ld_reserved, 64);
-
-}
-
-/**
- * gfs_desc_out - Write out a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_out(struct gfs_log_descriptor *desc, char *buf)
-{
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *) buf;
-
-	gfs_meta_header_out(&desc->ld_header, buf);
-
-	CPOUT_32(desc, str, ld_type);
-	CPOUT_32(desc, str, ld_length);
-	CPOUT_32(desc, str, ld_data1);
-	CPOUT_32(desc, str, ld_data2);
-
-	CPOUT_08(desc, str, ld_reserved, 64);
-
-}
-
-/**
- * gfs_desc_print - Print out a log descriptor
- * @ld: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_desc_print(struct gfs_log_descriptor *ld, int console)
-{
-
-	gfs_meta_header_print(&ld->ld_header, console);
-
-	pv(ld, ld_type, "%u");
-	pv(ld, ld_length, "%u");
-	pv(ld, ld_data1, "%u");
-	pv(ld, ld_data2, "%u");
-
-	pa(ld, ld_reserved, 64);
-
-}
-
-/**
- * gfs_block_tag_in - Read in a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_in(struct gfs_block_tag *tag, char *buf)
-{
-	struct gfs_block_tag *str = (struct gfs_block_tag *) buf;
-
-	CPIN_64(tag, str, bt_blkno);
-	CPIN_32(tag, str, bt_flags);
-	CPIN_32(tag, str, bt_pad);
-
-}
-
-/**
- * gfs_block_tag_out - Write out a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_out(struct gfs_block_tag *tag, char *buf)
-{
-	struct gfs_block_tag *str = (struct gfs_block_tag *) buf;
-
-	CPOUT_64(tag, str, bt_blkno);
-	CPOUT_32(tag, str, bt_flags);
-	CPOUT_32(tag, str, bt_pad);
-
-}
-
-/**
- * gfs_block_tag_print - Print out a block tag
- * @tag: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_block_tag_print(struct gfs_block_tag *tag, int console)
-{
-
-	pv(tag, bt_blkno, "%" PRIu64);
-	pv(tag, bt_flags, "%u");
-	pv(tag, bt_pad, "%u");
-
-}
-
-/**
- * gfs_quota_tag_in - Read in a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_in(struct gfs_quota_tag *tag, char *buf)
-{
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *) buf;
-
-	CPIN_64(tag, str, qt_change);
-	CPIN_32(tag, str, qt_flags);
-	CPIN_32(tag, str, qt_id);
-
-}
-
-/**
- * gfs_quota_tag_out - Write out a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_out(struct gfs_quota_tag *tag, char *buf)
-{
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *) buf;
-
-	CPOUT_64(tag, str, qt_change);
-	CPOUT_32(tag, str, qt_flags);
-	CPOUT_32(tag, str, qt_id);
-
-}
-
-/**
- * gfs_quota_tag_print - Print out a quota tag
- * @tag: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_quota_tag_print(struct gfs_quota_tag *tag, int console)
-{
-
-	pv(tag, qt_change, "%" PRId64);
-	pv(tag, qt_flags, "0x%.8X");
-	pv(tag, qt_id, "%u");
-
-}
-
-/**
- * gfs_ea_header_in - Read in a Extended Attribute header
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_in(struct gfs_ea_header *ea, char *buf)
-{
-	struct gfs_ea_header *str = (struct gfs_ea_header *) buf;
-
-	CPIN_32(ea, str, ea_rec_len);
-	CPIN_32(ea, str, ea_data_len);
-	ea->ea_name_len = str->ea_name_len;
-	ea->ea_type = str->ea_type;
-	ea->ea_flags = str->ea_flags;
-	ea->ea_num_ptrs = str->ea_num_ptrs;
-	CPIN_32(ea, str, ea_pad);
-
-}
-
-/**
- * gfs_ea_header_out - Write out a Extended Attribute header
- * @ea: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_out(struct gfs_ea_header *ea, char *buf)
-{
-	struct gfs_ea_header *str = (struct gfs_ea_header *) buf;
-
-	CPOUT_32(ea, str, ea_rec_len);
-	CPOUT_32(ea, str, ea_data_len);
-	str->ea_name_len = ea->ea_name_len;
-	str->ea_type = ea->ea_type;
-	str->ea_flags = ea->ea_flags;
-	str->ea_num_ptrs = ea->ea_num_ptrs;
-	CPOUT_32(ea, str, ea_pad);
-
-}
-
-/**
- * gfs_ea_header_printt - Print out a Extended Attribute header
- * @ea: the cpu-order buffer
- * @console - TRUE if this should be printed to the console,
- *            FALSE if it should be just printed to the incore debug
- *            buffer
- *
- */
-
-void
-gfs_ea_header_print(struct gfs_ea_header *ea, int console)
-{
-
-	pv(ea, ea_rec_len, "%u");
-	pv(ea, ea_data_len, "%u");
-	pv(ea, ea_name_len, "%u");
-	pv(ea, ea_type, "%u");
-	pv(ea, ea_flags, "%u");
-	pv(ea, ea_num_ptrs, "%u");
-	pv(ea, ea_pad, "%u");
-
-}
-
-static const uint32_t crc_32_tab[] = {
-	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
-	0xe963a535, 0x9e6495a3,
-	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,
-	0xe7b82d07, 0x90bf1d91,
-	0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb,
-	0xf4d4b551, 0x83d385c7,
-	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
-	0xfa0f3d63, 0x8d080df5,
-	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447,
-	0xd20d85fd, 0xa50ab56b,
-	0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75,
-	0xdcd60dcf, 0xabd13d59,
-	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
-	0xcfba9599, 0xb8bda50f,
-	0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11,
-	0xc1611dab, 0xb6662d3d,
-	0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
-	0x9fbfe4a5, 0xe8b8d433,
-	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
-	0x91646c97, 0xe6635c01,
-	0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b,
-	0x8208f4c1, 0xf50fc457,
-	0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49,
-	0x8cd37cf3, 0xfbd44c65,
-	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
-	0xa4d1c46d, 0xd3d6f4fb,
-	0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
-	0xaa0a4c5f, 0xdd0d7cc9,
-	0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3,
-	0xb966d409, 0xce61e49f,
-	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
-	0xb7bd5c3b, 0xc0ba6cad,
-	0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af,
-	0x04db2615, 0x73dc1683,
-	0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d,
-	0x0a00ae27, 0x7d079eb1,
-	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
-	0x196c3671, 0x6e6b06e7,
-	0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9,
-	0x17b7be43, 0x60b08ed5,
-	0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767,
-	0x3fb506dd, 0x48b2364b,
-	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
-	0x316e8eef, 0x4669be79,
-	0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703,
-	0x220216b9, 0x5505262f,
-	0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
-	0x2cd99e8b, 0x5bdeae1d,
-	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
-	0x72076785, 0x05005713,
-	0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d,
-	0x7cdcefb7, 0x0bdbdf21,
-	0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b,
-	0x6fb077e1, 0x18b74777,
-	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
-	0x616bffd3, 0x166ccf45,
-	0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
-	0x4969474d, 0x3e6e77db,
-	0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5,
-	0x47b2cf7f, 0x30b5ffe9,
-	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
-	0x54de5729, 0x23d967bf,
-	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1,
-	0x5a05df1b, 0x2d02ef8d
-};
-
-/**
- * gfs_dir_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * The hash function is a 32-bit CRC of the data.  The algorithm uses
- * the crc_32_tab table above.
- *
- * This may not be the fastest hash function, but it does a fair bit better
- * at providing uniform results than the others I've looked at.  That's
- * really important for efficient directories.
- *
- * Returns: the hash
- */
-
-uint32_t
-gfs_dir_hash(const char *data, int len)
-{
-	uint32_t hash = 0xFFFFFFFF;
-
-	for (; len--; data++)
-		hash = crc_32_tab[(hash ^ *data) & 0xFF] ^ (hash >> 8);
-
-	hash = ~hash;
-
-	return hash;
-}
diff --git a/gfs/gfs_fsck/ondisk.h b/gfs/gfs_fsck/ondisk.h
deleted file mode 100644
index 01875c0..0000000
--- a/gfs/gfs_fsck/ondisk.h
+++ /dev/null
@@ -1,2045 +0,0 @@
-/*
- * On-disk structures.
- *
- * THE BIG PICTURE of on-disk layout:
- *
- * GFS filesystem code views the entire filesystem, including journals, as
- * one contiguous group of blocks on one (perhaps virtual) storage device.
- * The filesystem space is shared, not distributed; each node in the cluster
- * must see the entire filesystem space.
- *
- * If the filesystem is spread across multiple physical storage devices,
- * volume management (device mapping) must be used to present the fileystem
- * space to GFS as one (virtual) device, with contiguous blocks.
- *
- * The superblock contains basic information about the filesytem, and appears
- * at a location 64 KBytes into the filesystem.  The first 64 KBytes of the
- * filesystem are empty, providing a safety buffer against wayward volume
- * management software (that sometimes write data into the first few bytes of
- * a device) or administrators.
- *
- * After the superblock, the rest of the filesystem is divided into multiple
- * Resource Groups and several journals.
- *
- * The Resource Groups (RGs or rgrps) contain the allocatable blocks that are
- * used for storing files, directories, etc., and all of the associated
- * metadata.  Each RG has its own set of block allocation statistics (within
- * the RG header), a number of blocks containing the block allocation bitmap,
- * and a large number of allocatable blocks for file data and metadata.
- * Multiple RGs allow multiple nodes to simultaneously allocate blocks from the 
- * filesystem (using different RGs), enhancing parallel access.  RG size and
- * number of RGs are determined by gfs_mkfs when creating the filesystem.
- * An administrator can specify RG size (see man gfs_mkfs).
- *
- * The journals contain temporary copies of metadata blocks, along with
- * other data, that allow GFS to recover the filesystem to a consistent state
- * (at least as far as metadata is concerned) if a node fails in the midst
- * of performing a write transaction.  There must be one journal for each node
- * in the cluster.  Since access to the entire filesystem space is shared,
- * if a node crashes, another node will be able to read the crashed node's
- * journal, and perform recovery.
- *
- * Currently, gfs_mkfs places the journals right in the middle of a freshly
- * created filesystem space, between 2 large groups of RGs.  From a filesystem
- * layout perspective, this placement is not a requirement; the journals
- * could be placed anywhere within the filesystem space.
- *
- * New Resource Groups and Journals may be added to the filesystem after the
- * filesystem has been created, if the filesystem's (virtual) device is made
- * larger.  See man gfs_grow and gfs_jadd.
- *
- * A few special hidden inodes are contained in a GFS filesystem.  They do
- * not appear in any directories; instead, the superblock points to them
- * using block numbers for their location.  The special inodes are:
- *
- *   Root inode:  Root directory of the filesystem
- *   Resource Group Index:  A file containing block numbers and sizes of all RGs
- *   Journal Index:  A file containing block numbers and sizes of all journals
- *   Quota:  A file containing all quota information for the filesystem
- *   License:  A file containing license information
- *
- * Note that there is NOTHING RELATED TO INTER-NODE LOCK MANAGEMENT ON-DISK.
- * Locking is handled completely off-disk, typically via LAN.
- *
- * NOTE:
- * If you add 8 byte fields to these structures, they must be 8 byte
- * aligned.  4 byte field must be 4 byte aligned, etc...
- *
- * All structures must be a multiple of 8 bytes long.
- *
- * GRIPES:
- * We should have forgetten about supporting 512B FS block sizes 
- * and made the di_reserved field in the struct gfs_dinode structure
- * much bigger.
- *
- * de_rec_len in struct gfs_dirent should really have been a 32-bit value
- * as it now limits us to a 64k FS block size (with the current code
- * in dir.c).
- */
-
-#ifndef __GFS_ONDISK_DOT_H__
-#define __GFS_ONDISK_DOT_H__
-
-#define GFS_MAGIC               (0x01161970) /* for all on-disk headers */
-#define GFS_BASIC_BLOCK         (512)  /* "basic block" = "sector" = 512B */
-#define GFS_BASIC_BLOCK_SHIFT   (9)
-
-/*  Controls how much data can be logged in-core before dumping log to disk */
-
-#define GFS_DUMPS_PER_LOG       (4)    /* 1/4 of on-disk journal size*/
-
-/*  Lock numbers of the LM_TYPE_NONDISK type.  These protect certain
- *  cluster-wide operations (rather than on-disk entities).
- *  Currently, the LIVE lock is not used for any real purpose.  */
-
-#define GFS_MOUNT_LOCK          (0)    /* only one node can Mount at a time */
-#define GFS_LIVE_LOCK           (1)    /* shared by all mounted nodes */
-#define GFS_TRANS_LOCK          (2)    /* Transaction, protects jrnl recovery */
-#define GFS_RENAME_LOCK         (3)    /* only one node can Rename at a time */
-
-/*  On-disk format (version) numbers for various metadata types,
- *  used in gfs_meta_header  */
-
-#define GFS_FORMAT_SB           (100)  /* Super-Block */
-#define GFS_FORMAT_RG           (200)  /* Resource Group Header */
-#define GFS_FORMAT_RB           (300)  /* Resource Group Block Alloc BitBlock */
-#define GFS_FORMAT_DI           (400)  /* "Disk" inode (dinode) */
-#define GFS_FORMAT_IN           (500)  /* Indirect dinode block list */
-#define GFS_FORMAT_LF           (600)  /* Leaf dinode block list */
-#define GFS_FORMAT_JD           (700)  /* Journal Data */
-#define GFS_FORMAT_LH           (800)  /* Log Header */
-#define GFS_FORMAT_LD           (900)  /* Log Descriptor */
-/*  These don't have actual struct gfs_meta_header structures to go with them */
-#define GFS_FORMAT_JI           (1000) /* Journal Index */
-#define GFS_FORMAT_RI           (1100) /* Resource Group Index */
-#define GFS_FORMAT_DE           (1200) /* Directory Entry */
-#define GFS_FORMAT_QU           (1500) /* Quota */
-#define GFS_FORMAT_EA           (1600) /* Extended Attribute */
-#define GFS_FORMAT_ED           (1700) /* Extended Attribute data */
-/*  These version #s are embedded in the superblock  */
-#define GFS_FORMAT_FS           (1309) /* Filesystem (all-encompassing) */
-#define GFS_FORMAT_MULTI        (1401) /* Multi-Host */
-
-/*
- *  An on-disk inode number
- *  Initially, the on-disk block address of the inode block is assigned as the
- *  formal (permanent) ID as well.  Block address can change (to move inode
- *  on-disk), but formal ID must stay unchanged once assigned.
- */
-
-#define gfs_inum_equal(ino1, ino2) \
-(((ino1)->no_formal_ino == (ino2)->no_formal_ino) && \
- ((ino1)->no_addr == (ino2)->no_addr))
-
-struct gfs_inum {
-	uint64_t no_formal_ino;        /* inode identifier */
-	uint64_t no_addr;              /* block # of dinode block */
-};
-
-/*
- *  Generic metadata head structure
- *
- *  Every inplace buffer logged in the journal must start
- *  with a struct gfs_meta_header.
- *
- *  In addition to telling what kind of metadata is in the block,
- *  the metaheader contains the important generation and incarnation
- *  numbers.
- *
- *  The generation number is used during journal recovery to determine
- *  whether an in-place block on-disk is older than an on-disk journaled copy
- *  of the block.  If so, GFS overwrites the in-place block with the journaled
- *  version of the block.
- *
- *  A meta block's generation number must increment monotonically across the
- *  cluster, each time new contents are committed to the block.  This means
- *  that whenever GFS allocates a pre-existing metadata block, GFS must read
- *  that block from disk (in case another node has incremented it).  It also
- *  means that GFS must sync the block (with incremented generation number)
- *  to disk (both log and in-place blocks), not only after changing contents
- *  of the block, but also after de-allocating the block (GFS can't just throw
- *  away incore metadata for a file that it's just erased).
- *
- *  The incarnation number is used only for on-disk (d)inodes.  GFS increments
- *  it each time it de-allocates a dinode block (i.e. each time the dinode
- *  loses its identity with a particular file, directory, etc.).  When the
- *  dinode is later allocated (i.e. to be identified with a new file, etc.),
- *  GFS copies the incarnation number into the VFS inode's i_generation member.
- *  If GFS is used as the backing store for an NFS server, GFS uses this
- *  i_generation number as part of the NFS filehandle, which differentiates
- *  it from the previous identity of the dinode, and helps protect against
- *  filesystem corruption that could happen with the use of outdated,
- *  invalid, or malicious filehandles.  See ops_export.c.
- *
- *  GFS caches de-allocated meta-headers, to minimize disk reads.
- *  See struct gfs_meta_header_cache.
- */
-
-#define GFS_METATYPE_NONE       (0)
-#define GFS_METATYPE_SB         (1)    /* Super-Block */
-#define GFS_METATYPE_RG         (2)    /* Resource Group Header */
-#define GFS_METATYPE_RB         (3)    /* Resource Group Block Alloc BitBlock */
-#define GFS_METATYPE_DI         (4)    /* "Disk" inode (dinode) */
-#define GFS_METATYPE_IN         (5)    /* Indirect dinode block list */
-#define GFS_METATYPE_LF         (6)    /* Leaf dinode block list */
-#define GFS_METATYPE_JD         (7)    /* Journal Data */
-#define GFS_METATYPE_LH         (8)    /* Log Header (gfs_log_header) */
-#define GFS_METATYPE_LD         (9)    /* Log Descriptor (gfs_log_descriptor) */
-#define GFS_METATYPE_EA         (10)   /* Extended Attribute */
-#define GFS_METATYPE_ED         (11)   /* Extended Attribute data */
-
-
-#define GFS_META_CLUMP          (64)   /* # blocks to convert fm data to meta */
-
-struct gfs_meta_header {
-	uint32_t mh_magic;      /* GFS_MAGIC sanity check magic number */
-	uint32_t mh_type;       /* GFS_METATYPE_XX type of metadata block */
-	uint64_t mh_generation; /* increment before writing to journal */
-	uint32_t mh_format;     /* GFS_FORMAT_XX (version # for this type) */
-	uint32_t mh_incarn;     /* increment when marking dinode "unused" */
-};
-
-/*
- *  super-block structure
- *
- *  One of these is at beginning of filesystem.
- *  It's probably good if SIZEOF_SB <= GFS_BASIC_BLOCK (512 bytes)
- */
-
-/*  Address of SuperBlock in GFS basic blocks.  1st 64K of filesystem is empty
-    for safety against getting clobbered by wayward volume managers, etc.
-    64k was chosen because it's the largest GFS-supported fs block size.  */
-#define GFS_SB_ADDR             (128)
-
-/*  The lock number for the superblock (must be zero)  */
-#define GFS_SB_LOCK             (0)
-#define GFS_CRAP_LOCK           (1)
-
-/*  Requirement:  GFS_LOCKNAME_LEN % 8 == 0
-    Includes: the fencing zero at the end  */
-#define GFS_LOCKNAME_LEN        (64)
-
-struct gfs_sb {
-	/*  Order is important; need to be able to read old superblocks
-	    in order to support on-disk version upgrades */
-	struct gfs_meta_header sb_header;
-
-	uint32_t sb_fs_format;         /* GFS_FORMAT_FS (on-disk version) */
-	uint32_t sb_multihost_format;  /* GFS_FORMAT_MULTI */
-	uint32_t sb_flags;             /* ?? */
-
-	uint32_t sb_bsize;             /* fundamental FS block size in bytes */
-	uint32_t sb_bsize_shift;       /* log2(sb_bsize) */
-	uint32_t sb_seg_size;          /* Journal segment size in FS blocks */
-
-	/* These special inodes do not appear in any on-disk directory. */
-	struct gfs_inum sb_jindex_di;  /* journal index inode */
-	struct gfs_inum sb_rindex_di;  /* resource group index inode */
-	struct gfs_inum sb_root_di;    /* root directory inode */
-
-	/* Default inter-node locking protocol (lock module) and namespace */
-	char sb_lockproto[GFS_LOCKNAME_LEN]; /* lock protocol name */
-	char sb_locktable[GFS_LOCKNAME_LEN]; /* unique name for this FS */
-
-	/* More special inodes */
-	struct gfs_inum sb_quota_di;   /* quota inode */
-	struct gfs_inum sb_license_di; /* license inode */
-
-	char sb_reserved[96];
-};
-
-/*
- *  journal index structure 
- *
- *  One for each journal used by the filesystem.
- *  These descriptors are packed contiguously within the jindex inode (file).
- */
-
-struct gfs_jindex {
-	uint64_t ji_addr;       /* starting block of the journal */
-	uint32_t ji_nsegment;   /* number (quantity) of segments in journal */
-	uint32_t ji_pad;
-
-	char ji_reserved[64];
-};
-
-/*
- *  resource index structure 
- *
- *  One of these for each resource group in the filesystem.
- *  These descriptors are packed contiguously within the rindex inode (file).
- *  Also see struct gfs_rgrp.
- */
-
-struct gfs_rindex {
-	uint64_t ri_addr;     /* block # of 1st block (header) in rgrp */
-	uint32_t ri_length;   /* # fs blocks containing rgrp header & bitmap */
-	uint32_t ri_pad;
-
-	uint64_t ri_data1;    /* block # of first data/meta block in rgrp */
-	uint32_t ri_data;     /* number (qty) of data/meta blocks in rgrp */
-
-	uint32_t ri_bitbytes; /* total # bytes used by block alloc bitmap */
-
-	char ri_reserved[64];
-};
-
-/*
- *  resource group header structure
- *
- *  One of these at beginning of the first block of an rgrp,
- *     followed by block alloc bitmap data in remainder of first block.
- *  Each resource group contains:
- *    Header block, including block allocation statistics (struct gfs_rgrp)
- *       and first part of block alloc bitmap.
- *    Bitmap block(s), continuing block alloc bitmap started in header block.
- *    Data/meta blocks, allocatable blocks containing file data and metadata.
- *  
- *  In older versions, now-unused (but previously allocated) dinodes were
- *  saved for re-use in an on-disk linked list (chain).  This is no longer
- *  done, but support still exists for reclaiming dinodes from this list,
- *  to support upgrades from older on-disk formats.
- */
-
-/* Each data block within rgrp is represented by 2 bits in the alloc bitmap */
-#define GFS_NBBY                (4)  /* # blocks represented by 1 bitmap byte */
-#define GFS_BIT_SIZE            (2)
-#define GFS_BIT_MASK            (0x00000003)
-
-/*
- * 4 possible block allocation states:
- *   bit 0 = alloc(1)/free(0)
- *   bit 1 = metadata(1)/data(0)
- */
-#define GFS_BLKST_FREE          (0)
-#define GFS_BLKST_USED          (1)
-#define GFS_BLKST_FREEMETA      (2)
-#define GFS_BLKST_USEDMETA      (3)
-
-struct gfs_rgrp {
-	struct gfs_meta_header rg_header;
-
-	uint32_t rg_flags;      /* ?? */
-
-	uint32_t rg_free;       /* Number (qty) of free data blocks */
-
-	/* Dinodes are USEDMETA, but are handled separately from other METAs */
-	uint32_t rg_useddi;     /* Number (qty) of dinodes (used or free) */
-	uint32_t rg_freedi;     /* Number (qty) of unused (free) dinodes */
-	struct gfs_inum rg_freedi_list; /* 1st block in chain of free dinodes */
-
-	/* These META statistics do not include dinodes (used or free) */
-	uint32_t rg_usedmeta;   /* Number (qty) of used metadata blocks */
-	uint32_t rg_freemeta;   /* Number (qty) of unused metadata blocks */
-
-	char rg_reserved[64];
-};
-
-/*
- *  quota structure
- */
-
-struct gfs_quota {
-	uint64_t qu_limit;
-	uint64_t qu_warn;
-	int64_t qu_value;
-
-	char qu_reserved[64];
-};
-
-/*
- *  dinode (disk inode) structure
- *  The ondisk representation of inodes
- *  One for each file, directory, etc.
- *  GFS does not put more than one inode in a single block.
- *  The inode may be "stuffed", carrying file data along with metadata,
- *    if the file data is small enough.
- *  Otherwise, the inode block contains pointers to other blocks that contain
- *    either file data or other pointers to other blocks (indirect addressing
- *    via a metadata tree).
- */
-
-#define GFS_MAX_META_HEIGHT     (10)
-#define GFS_DIR_MAX_DEPTH       (17)
-
-/*  Dinode types  */
-#define GFS_FILE_NON            (0)
-#define GFS_FILE_REG            (1)    /* regular file */
-#define GFS_FILE_DIR            (2)    /* directory */
-#define GFS_FILE_LNK            (5)    /* link */
-#define GFS_FILE_BLK            (7)    /* block device node */
-#define GFS_FILE_CHR            (8)    /* character device node */
-#define GFS_FILE_FIFO           (101)  /* fifo/pipe */
-#define GFS_FILE_SOCK           (102)  /* socket */
-
-/*  Dinode flags  */
-#define GFS_DIF_JDATA             (0x00000001) /* jrnl all data for this file */
-#define GFS_DIF_EXHASH            (0x00000002) /* hashed directory (leaves) */
-#define GFS_DIF_UNUSED            (0x00000004) /* unused dinode */
-#define GFS_DIF_EA_INDIRECT       (0x00000008) /* extended attribute, indirect*/
-#define GFS_DIF_DIRECTIO          (0x00000010)
-#define GFS_DIF_IMMUTABLE         (0x00000020) /* Can't change file */
-#define GFS_DIF_APPENDONLY        (0x00000040) /* Can only add to end of file */
-#define GFS_DIF_NOATIME           (0x00000080) /* Don't update access time
-						  (currently unused/ignored) */
-#define GFS_DIF_SYNC              (0x00000100) /* Flush to disk, don't cache
-						  (currently unused/ignored) */
-#define GFS_DIF_INHERIT_DIRECTIO  (0x40000000) /* new files get DIRECTIO flag */
-#define GFS_DIF_INHERIT_JDATA     (0x80000000) /* new files get JDATA flag */
-
-struct gfs_dinode {
-	struct gfs_meta_header di_header;
-
-	struct gfs_inum di_num; /* formal inode # and block address */
-
-	uint32_t di_mode;	/* mode of file */
-	uint32_t di_uid;	/* owner's user id */
-	uint32_t di_gid;	/* owner's group id */
-	uint32_t di_nlink;	/* number (qty) of links to this file */
-	uint64_t di_size;	/* number (qty) of bytes in file */
-	uint64_t di_blocks;	/* number (qty) of blocks in file */
-	int64_t di_atime;	/* time last accessed */
-	int64_t di_mtime;	/* time last modified */
-	int64_t di_ctime;	/* time last changed */
-
-	/*  Non-zero only for character or block device nodes  */
-	uint32_t di_major;	/* device major number */
-	uint32_t di_minor;	/* device minor number */
-
-	/*  Block allocation strategy  */
-	uint64_t di_rgrp;	/* dinode rgrp block number */
-	uint64_t di_goal_rgrp;	/* rgrp to alloc from next */
-	uint32_t di_goal_dblk;	/* data block goal */
-	uint32_t di_goal_mblk;	/* metadata block goal */
-
-	uint32_t di_flags;	/* GFS_DIF_... */
-
-	/*  struct gfs_rindex, struct gfs_jindex, or struct gfs_dirent */
-	uint32_t di_payload_format;  /* GFS_FORMAT_... */
-	uint16_t di_type;	/* GFS_FILE_... type of file */
-	uint16_t di_height;	/* height of metadata (0 == stuffed) */
-	uint32_t di_incarn;	/* incarnation (unused, see gfs_meta_header) */
-	uint16_t di_pad;
-
-	/*  These only apply to directories  */
-	uint16_t di_depth;	/* Number of bits in the table */
-	uint32_t di_entries;	/* The # (qty) of entries in the directory */
-
-	/*  This formed an on-disk chain of unused dinodes  */
-	struct gfs_inum di_next_unused;  /* used in old versions only */
-
-	uint64_t di_eattr;	/* extended attribute block number */
-
-	char di_reserved[56];
-};
-
-/*
- *  indirect block header
- *
- *  A component of a dinode's indirect addressing metadata tree.
- *  These are pointed to by pointers in dinodes or other indirect blocks.
- */
-
-struct gfs_indirect {
-	struct gfs_meta_header in_header;
-
-	char in_reserved[64];
-};
-
-/*
- *  directory structure - many of these per directory file
- *
- * See comments at beginning of dir.c
- */
-
-#define GFS_FNAMESIZE               (255)
-#define GFS_DIRENT_SIZE(name_len) ((sizeof(struct gfs_dirent) + (name_len) + 7) & ~7)
-
-struct gfs_dirent {
-	struct gfs_inum de_inum;    /* formal inode number and block address */
-	uint32_t de_hash;           /* hash of the filename */
-	uint16_t de_rec_len;        /* the length of the dirent */
-	uint16_t de_name_len;       /* the length of the name */
-	uint16_t de_type;           /* GFS_FILE_... type of dinode this points to */
-
-	char de_reserved[14];
-};
-
-/*
- *  Header of leaf directory nodes
- *
- * See comments at beginning of dir.c
- */
-
-struct gfs_leaf {
-	struct gfs_meta_header lf_header;
-
-	uint16_t lf_depth;          /* Depth of leaf */
-	uint16_t lf_entries;        /* Number of dirents in leaf */
-	uint32_t lf_dirent_format;  /* GFS_FORMAT_DE (version #) */
-	uint64_t lf_next;           /* Next leaf, if overflow */
-
-	char lf_reserved[64];
-};
-
-/*
- *  Log header structure
- *
- *  Two of these are in the first block of a transaction log:
- *    1)  at beginning of block
- *    2)  at end of first 512-byte sector within block
- */
-
-#define GFS_LOG_HEAD_UNMOUNT    (0x00000001)  /* log is clean, can unmount fs */
-
-struct gfs_log_header {
-	struct gfs_meta_header lh_header;
-
-	uint32_t lh_flags;	/* GFS_LOG_HEAD_... */
-	uint32_t lh_pad;
-
-	uint64_t lh_first;	/* Block number of first header in this trans */
-	uint64_t lh_sequence;	/* Sequence number of this transaction */
-
-	uint64_t lh_tail;	/* Block number of log tail */
-	uint64_t lh_last_dump;	/* Block number of last dump */
-
-	char lh_reserved[64];
-};
-
-/*
- *  Log type descriptor
- *
- *  One of these for each chunk in a transaction
- */
-
-#define GFS_LOG_DESC_METADATA   (300)    /* metadata */
-/*  ld_data1 is the number (quantity) of metadata blocks in the descriptor.
-    ld_data2 is unused.
-    */
-
-#define GFS_LOG_DESC_IUL        (400)    /* unlinked inode */
-/*  ld_data1 is TRUE if this is a dump.
-    ld_data2 is unused.
-    FixMe!!!  ld_data1 should be the number (quantity) of entries.
-              ld_data2 should be "TRUE if this is a dump".
-    */
-
-#define GFS_LOG_DESC_IDA        (401)    /* de-allocated inode */
-/*  ld_data1 is unused.
-    ld_data2 is unused.
-    FixMe!!!  ld_data1 should be the number (quantity) of entries.
-    */
-
-#define GFS_LOG_DESC_Q          (402)    /* quota */
-/*  ld_data1 is the number of quota changes in the descriptor.
-    ld_data2 is TRUE if this is a dump.
-    */
-
-#define GFS_LOG_DESC_LAST       (500)    /* final in a logged transaction */
-/*  ld_data1 is unused.
-    ld_data2 is unused.
-    */
-
-struct gfs_log_descriptor {
-	struct gfs_meta_header ld_header;
-
-	uint32_t ld_type;	/* GFS_LOG_DESC_... Type of this log chunk */
-	uint32_t ld_length;	/* Number of buffers in this chunk */
-	uint32_t ld_data1;	/* descriptor-specific field */
-	uint32_t ld_data2;	/* descriptor-specific field */
-
-	char ld_reserved[64];
-};
-
-/*
- *  Metadata block tags
- *
- *  One for each logged block.  Tells where block really belongs on-disk.
- *  These descriptor tags are packed contiguously after a gfs_log_descriptor.
- */
-
-struct gfs_block_tag {
-	uint64_t bt_blkno;	/* inplace block number */
-	uint32_t bt_flags;	/* ?? */
-	uint32_t bt_pad;
-};
-
-/*
- *  Quota Journal Tag
- */
-
-#define GFS_QTF_USER            (0x00000001)
-
-struct gfs_quota_tag {
-	int64_t qt_change;
-	uint32_t qt_flags;      /* GFS_QTF_... */
-	uint32_t qt_id;
-};
-
-/*
- *  Extended attribute header format
- */
-
-#define GFS_EA_MAX_NAME_LEN     (255)
-#define GFS_EA_MAX_DATA_LEN     (65536)
-
-#define GFS_EATYPE_UNUSED       (0)
-#define GFS_EATYPE_USR          (1)     /* user attribute */
-#define GFS_EATYPE_SYS          (2)     /* system attribute */
-#define GFS_EATYPE_SECURITY     (3)	/* security attribute */
-
-#define GFS_EATYPE_LAST         (3)
-#define GFS_EATYPE_VALID(x)     ((x) <= GFS_EATYPE_LAST)
-
-#define GFS_EAFLAG_LAST         (0x01)	/* last ea in block */
-
-struct gfs_ea_header {
-	uint32_t ea_rec_len;    /* total record length: hdr + name + data */
-	uint32_t ea_data_len;   /* data length, in bytes */
-	uint8_t ea_name_len;    /* no NULL pointer after the string */
-	uint8_t ea_type;        /* GFS_EATYPE_... */
-	uint8_t ea_flags;       /* GFS_EAFLAG_... */
-	uint8_t ea_num_ptrs;    /* # fs blocks needed for EA */
-	uint32_t ea_pad;
-};
-
-/*  Endian functions  */
-
-#define GFS_ENDIAN_BIG
-
-#ifdef GFS_ENDIAN_BIG
-
-#define gfs16_to_cpu be16_to_cpu
-#define gfs32_to_cpu be32_to_cpu
-#define gfs64_to_cpu be64_to_cpu
-
-#define cpu_to_gfs16 cpu_to_be16
-#define cpu_to_gfs32 cpu_to_be32
-#define cpu_to_gfs64 cpu_to_be64
-
-#else				/*  GFS_ENDIAN_BIG  */
-
-#define gfs16_to_cpu le16_to_cpu
-#define gfs32_to_cpu le32_to_cpu
-#define gfs64_to_cpu le64_to_cpu
-
-#define cpu_to_gfs16 cpu_to_le16
-#define cpu_to_gfs32 cpu_to_le32
-#define cpu_to_gfs64 cpu_to_le64
-
-#endif				/*  GFS_ENDIAN_BIG  */
-
-/*  Translation functions  */
-
-void gfs_inum_in(struct gfs_inum *no, char *buf);
-void gfs_inum_out(struct gfs_inum *no, char *buf);
-void gfs_meta_header_in(struct gfs_meta_header *mh, char *buf);
-void gfs_meta_header_out(struct gfs_meta_header *mh, char *buf);
-void gfs_sb_in(struct gfs_sb *sb, char *buf);
-void gfs_sb_out(struct gfs_sb *sb, char *buf);
-void gfs_jindex_in(struct gfs_jindex *jindex, char *buf);
-void gfs_jindex_out(struct gfs_jindex *jindex, char *buf);
-void gfs_rindex_in(struct gfs_rindex *rindex, char *buf);
-void gfs_rindex_out(struct gfs_rindex *rindex, char *buf);
-void gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf);
-void gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf);
-void gfs_quota_in(struct gfs_quota *quota, char *buf);
-void gfs_quota_out(struct gfs_quota *quota, char *buf);
-void gfs_dinode_in(struct gfs_dinode *dinode, char *buf);
-void gfs_dinode_out(struct gfs_dinode *dinode, char *buf);
-void gfs_indirect_in(struct gfs_indirect *indirect, char *buf);
-void gfs_indirect_out(struct gfs_indirect *indirect, char *buf);
-void gfs_dirent_in(struct gfs_dirent *dirent, char *buf);
-void gfs_dirent_out(struct gfs_dirent *dirent, char *buf);
-void gfs_leaf_in(struct gfs_leaf *leaf, char *buf);
-void gfs_leaf_out(struct gfs_leaf *leaf, char *buf);
-void gfs_log_header_in(struct gfs_log_header *head, char *buf);
-void gfs_log_header_out(struct gfs_log_header *head, char *buf);
-void gfs_desc_in(struct gfs_log_descriptor *desc, char *buf);
-void gfs_desc_out(struct gfs_log_descriptor *desc, char *buf);
-void gfs_block_tag_in(struct gfs_block_tag *btag, char *buf);
-void gfs_block_tag_out(struct gfs_block_tag *btag, char *buf);
-void gfs_quota_tag_in(struct gfs_quota_tag *qtag, char *buf);
-void gfs_quota_tag_out(struct gfs_quota_tag *qtag, char *buf);
-void gfs_ea_header_in(struct gfs_ea_header *qtag, char *buf);
-void gfs_ea_header_out(struct gfs_ea_header *qtag, char *buf);
-
-/*  Printing functions  */
-
-void gfs_inum_print(struct gfs_inum *no, int console);
-void gfs_meta_header_print(struct gfs_meta_header *mh, int console);
-void gfs_sb_print(struct gfs_sb *sb, int console);
-void gfs_jindex_print(struct gfs_jindex *jindex, int console);
-void gfs_rindex_print(struct gfs_rindex *rindex, int console);
-void gfs_rgrp_print(struct gfs_rgrp *rgrp, int console);
-void gfs_quota_print(struct gfs_quota *quota, int console);
-void gfs_dinode_print(struct gfs_dinode *dinode, int console);
-void gfs_indirect_print(struct gfs_indirect *indirect, int console);
-void gfs_dirent_print(struct gfs_dirent *dirent, char *name, int console);
-void gfs_leaf_print(struct gfs_leaf *leaf, int console);
-void gfs_log_header_print(struct gfs_log_header *head, int console);
-void gfs_desc_print(struct gfs_log_descriptor *desc, int console);
-void gfs_block_tag_print(struct gfs_block_tag *tag, int console);
-void gfs_quota_tag_print(struct gfs_quota_tag *tag, int console);
-void gfs_ea_header_print(struct gfs_ea_header *ea, int console);
-
-/*  The hash function for ExHash directories  */
-
-uint32_t gfs_dir_hash(const char *data, int len);
-
-#endif /* __GFS_ONDISK_DOT_H__ */
-
-
-
-#ifdef WANT_GFS_CONVERSION_FUNCTIONS
-
-#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
-#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
-#define CPIN_16(s1, s2, member) {(s1->member) = gfs16_to_cpu((s2->member));}
-#define CPOUT_16(s1, s2, member) {(s2->member) = cpu_to_gfs16((s1->member));}
-#define CPIN_32(s1, s2, member) {(s1->member) = gfs32_to_cpu((s2->member));}
-#define CPOUT_32(s1, s2, member) {(s2->member) = cpu_to_gfs32((s1->member));}
-#define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));}
-#define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));}
-
-#define pa(struct, member, count) print_array(#member, struct->member, count);
-
-/**
- * print_array - Print out an array of bytes
- * @title: what to print before the array
- * @buf: the array
- * @count: the number of bytes
- *
- */
-
-static void
-print_array(char *title, char *buf, int count)
-{
-	ENTER(GFN_PRINT_ARRAY)
-	int x;
-
-	printk("  %s =\n", title);
-	for (x = 0; x < count; x++) {
-		printk("%.2X ", (unsigned char)buf[x]);
-		if (x % 16 == 15)
-			printk("\n");
-	}
-	if (x % 16)
-		printk("\n");
-
-	RET(GFN_PRINT_ARRAY);
-}
-
-/**
- * gfs_inum_in - Read in an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_in(struct gfs_inum *no, char *buf)
-{
-	ENTER(GFN_INUM_IN)
-	struct gfs_inum *str = (struct gfs_inum *)buf;
-
-	CPIN_64(no, str, no_formal_ino);
-	CPIN_64(no, str, no_addr);
-
-	RET(GFN_INUM_IN);
-}
-
-/**
- * gfs_inum_out - Write out an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_out(struct gfs_inum *no, char *buf)
-{
-	ENTER(GFN_INUM_OUT)
-	struct gfs_inum *str = (struct gfs_inum *)buf;
-
-	CPOUT_64(no, str, no_formal_ino);
-	CPOUT_64(no, str, no_addr);
-
-	RET(GFN_INUM_OUT);
-}
-
-/**
- * gfs_inum_print - Print out a inode number
- * @no: the cpu-order buffer
- *
- */
-
-void
-gfs_inum_print(struct gfs_inum *no)
-{
-	ENTER(GFN_INUM_PRINT)
-	pv(no, no_formal_ino, "%"PRIu64);
-	pv(no, no_addr, "%"PRIu64);
-	RET(GFN_INUM_PRINT);
-}
-
-/**
- * gfs_meta_header_in - Read in a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_meta_header_in(struct gfs_meta_header *mh, char *buf)
-{
-	ENTER(GFN_META_HEADER_IN)
-	struct gfs_meta_header *str = (struct gfs_meta_header *)buf;
-
-	CPIN_32(mh, str, mh_magic);
-	CPIN_32(mh, str, mh_type);
-	CPIN_64(mh, str, mh_generation);
-	CPIN_32(mh, str, mh_format);
-	CPIN_32(mh, str, mh_incarn);
-
-	RET(GFN_META_HEADER_IN);
-}
-
-/**
- * gfs_meta_header_in - Write out a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- * Don't ever change the generation number in this routine.
- * It's done manually in increment_generation().
- */
-
-void
-gfs_meta_header_out(struct gfs_meta_header *mh, char *buf)
-{
-	ENTER(GFN_META_HEADER_OUT)
-	struct gfs_meta_header *str = (struct gfs_meta_header *)buf;
-
-	CPOUT_32(mh, str, mh_magic);
-	CPOUT_32(mh, str, mh_type);
-#if 0
-	/* Don't do this!
-	   Mh_generation should only be change manually. */
-	CPOUT_64(mh, str, mh_generation);
-#endif
-	CPOUT_32(mh, str, mh_format);
-	CPOUT_32(mh, str, mh_incarn);
-
-	RET(GFN_META_HEADER_OUT);
-}
-
-/**
- * gfs_meta_header_print - Print out a metadata header
- * @mh: the cpu-order buffer
- *
- */
-
-void
-gfs_meta_header_print(struct gfs_meta_header *mh)
-{
-	ENTER(GFN_META_HEADER_PRINT)
-
-	pv(mh, mh_magic, "0x%.8X");
-	pv(mh, mh_type, "%u");
-	pv(mh, mh_generation, "%"PRIu64);
-	pv(mh, mh_format, "%u");
-	pv(mh, mh_incarn, "%u");
-
-	RET(GFN_META_HEADER_PRINT);
-}
-
-/**
- * gfs_sb_in - Read in a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_in(struct gfs_sb *sb, char *buf)
-{
-	ENTER(GFN_SB_IN)
-	struct gfs_sb *str = (struct gfs_sb *)buf;
-
-	gfs_meta_header_in(&sb->sb_header, buf);
-
-	CPIN_32(sb, str, sb_fs_format);
-	CPIN_32(sb, str, sb_multihost_format);
-	CPIN_32(sb, str, sb_flags);
-
-	CPIN_32(sb, str, sb_bsize);
-	CPIN_32(sb, str, sb_bsize_shift);
-	CPIN_32(sb, str, sb_seg_size);
-
-	gfs_inum_in(&sb->sb_jindex_di, (char *)&str->sb_jindex_di);
-	gfs_inum_in(&sb->sb_rindex_di, (char *)&str->sb_rindex_di);
-	gfs_inum_in(&sb->sb_root_di, (char *)&str->sb_root_di);
-
-	CPIN_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPIN_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_in(&sb->sb_quota_di, (char *)&str->sb_quota_di);
-	gfs_inum_in(&sb->sb_license_di, (char *)&str->sb_license_di);
-
-	CPIN_08(sb, str, sb_reserved, 96);
-
-	RET(GFN_SB_IN);
-}
-
-/**
- * gfs_sb_out - Write out a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_out(struct gfs_sb *sb, char *buf)
-{
-	ENTER(GFN_SB_OUT)
-	struct gfs_sb *str = (struct gfs_sb *)buf;
-
-	gfs_meta_header_out(&sb->sb_header, buf);
-
-	CPOUT_32(sb, str, sb_fs_format);
-	CPOUT_32(sb, str, sb_multihost_format);
-	CPOUT_32(sb, str, sb_flags);
-
-	CPOUT_32(sb, str, sb_bsize);
-	CPOUT_32(sb, str, sb_bsize_shift);
-	CPOUT_32(sb, str, sb_seg_size);
-
-	gfs_inum_out(&sb->sb_jindex_di, (char *)&str->sb_jindex_di);
-	gfs_inum_out(&sb->sb_rindex_di, (char *)&str->sb_rindex_di);
-	gfs_inum_out(&sb->sb_root_di, (char *)&str->sb_root_di);
-
-	CPOUT_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPOUT_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_out(&sb->sb_quota_di, (char *)&str->sb_quota_di);
-	gfs_inum_out(&sb->sb_license_di, (char *)&str->sb_license_di);
-
-	CPOUT_08(sb, str, sb_reserved, 96);
-
-	RET(GFN_SB_OUT);
-}
-
-/**
- * gfs_sb_print - Print out a superblock
- * @sb: the cpu-order buffer
- *
- */
-
-void
-gfs_sb_print(struct gfs_sb *sb)
-{
-	ENTER(GFN_SB_PRINT)
-
-	gfs_meta_header_print(&sb->sb_header);
-
-	pv(sb, sb_fs_format, "%u");
-	pv(sb, sb_multihost_format, "%u");
-	pv(sb, sb_flags, "%u");
-
-	pv(sb, sb_bsize, "%u");
-	pv(sb, sb_bsize_shift, "%u");
-	pv(sb, sb_seg_size, "%u");
-
-	gfs_inum_print(&sb->sb_jindex_di);
-	gfs_inum_print(&sb->sb_rindex_di);
-	gfs_inum_print(&sb->sb_root_di);
-
-	pv(sb, sb_lockproto, "%s");
-	pv(sb, sb_locktable, "%s");
-
-	gfs_inum_print(&sb->sb_quota_di);
-	gfs_inum_print(&sb->sb_license_di);
-
-	pa(sb, sb_reserved, 96);
-
-	RET(GFN_SB_PRINT);
-}
-
-/**
- * gfs_jindex_in - Read in a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_in(struct gfs_jindex *jindex, char *buf)
-{
-	ENTER(GFN_JINDEX_IN)
-	struct gfs_jindex *str = (struct gfs_jindex *)buf;
-
-	CPIN_64(jindex, str, ji_addr);
-	CPIN_32(jindex, str, ji_nsegment);
-	CPIN_32(jindex, str, ji_pad);
-
-	CPIN_08(jindex, str, ji_reserved, 64);
-
-	RET(GFN_JINDEX_IN);
-}
-
-/**
- * gfs_jindex_out - Write out a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_out(struct gfs_jindex *jindex, char *buf)
-{
-	ENTER(GFN_JINDEX_OUT)
-	struct gfs_jindex *str = (struct gfs_jindex *)buf;
-
-	CPOUT_64(jindex, str, ji_addr);
-	CPOUT_32(jindex, str, ji_nsegment);
-	CPOUT_32(jindex, str, ji_pad);
-
-	CPOUT_08(jindex, str, ji_reserved, 64);
-
-	RET(GFN_JINDEX_OUT);
-}
-
-/**
- * gfs_jindex_print - Print out a journal index structure
- * @ji: the cpu-order buffer
- *
- */
-
-void
-gfs_jindex_print(struct gfs_jindex *ji)
-{
-	ENTER(GFN_JINDEX_PRINT)
-
-	pv(ji, ji_addr, "%"PRIu64);
-	pv(ji, ji_nsegment, "%u");
-	pv(ji, ji_pad, "%u");
-
-	pa(ji, ji_reserved, 64);
-
-	RET(GFN_JINDEX_PRINT);
-}
-
-/**
- * gfs_rindex_in - Read in a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_in(struct gfs_rindex *rindex, char *buf)
-{
-	ENTER(GFN_RINDEX_IN)
-	struct gfs_rindex *str = (struct gfs_rindex *)buf;
-
-	CPIN_64(rindex, str, ri_addr);
-	CPIN_32(rindex, str, ri_length);
-	CPIN_32(rindex, str, ri_pad);
-
-	CPIN_64(rindex, str, ri_data1);
-	CPIN_32(rindex, str, ri_data);
-
-	CPIN_32(rindex, str, ri_bitbytes);
-
-	CPIN_08(rindex, str, ri_reserved, 64);
-
-	RET(GFN_RINDEX_IN);
-}
-
-/**
- * gfs_rindex_out - Write out a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_out(struct gfs_rindex *rindex, char *buf)
-{
-	ENTER(GFN_RINDEX_OUT)
-	struct gfs_rindex *str = (struct gfs_rindex *)buf;
-
-	CPOUT_64(rindex, str, ri_addr);
-	CPOUT_32(rindex, str, ri_length);
-	CPOUT_32(rindex, str, ri_pad);
-
-	CPOUT_64(rindex, str, ri_data1);
-	CPOUT_32(rindex, str, ri_data);
-
-	CPOUT_32(rindex, str, ri_bitbytes);
-
-	CPOUT_08(rindex, str, ri_reserved, 64);
-
-	RET(GFN_RINDEX_OUT);
-}
-
-/**
- * gfs_rindex_print - Print out a resource index structure
- * @ri: the cpu-order buffer
- *
- */
-
-void
-gfs_rindex_print(struct gfs_rindex *ri)
-{
-	ENTER(GFN_RINDEX_PRINT)
-
-	pv(ri, ri_addr, "%"PRIu64);
-	pv(ri, ri_length, "%u");
-	pv(ri, ri_pad, "%u");
-
-	pv(ri, ri_data1, "%"PRIu64);
-	pv(ri, ri_data, "%u");
-
-	pv(ri, ri_bitbytes, "%u");
-
-	pa(ri, ri_reserved, 64);
-
-	RET(GFN_RINDEX_PRINT);
-}
-
-/**
- * gfs_rgrp_in - Read in a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf)
-{
-	ENTER(GFN_RGRP_IN)
-	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
-
-	gfs_meta_header_in(&rgrp->rg_header, buf);
-
-	CPIN_32(rgrp, str, rg_flags);
-
-	CPIN_32(rgrp, str, rg_free);
-
-	CPIN_32(rgrp, str, rg_useddi);
-	CPIN_32(rgrp, str, rg_freedi);
-	gfs_inum_in(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
-
-	CPIN_32(rgrp, str, rg_usedmeta);
-	CPIN_32(rgrp, str, rg_freemeta);
-
-	CPIN_08(rgrp, str, rg_reserved, 64);
-
-	RET(GFN_RGRP_IN);
-}
-
-/**
- * gfs_rgrp_out - Write out a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf)
-{
-	ENTER(GFN_RGRP_OUT)
-	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
-
-	gfs_meta_header_out(&rgrp->rg_header, buf);
-
-	CPOUT_32(rgrp, str, rg_flags);
-
-	CPOUT_32(rgrp, str, rg_free);
-
-	CPOUT_32(rgrp, str, rg_useddi);
-	CPOUT_32(rgrp, str, rg_freedi);
-	gfs_inum_out(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
-
-	CPOUT_32(rgrp, str, rg_usedmeta);
-	CPOUT_32(rgrp, str, rg_freemeta);
-
-	CPOUT_08(rgrp, str, rg_reserved, 64);
-
-	RET(GFN_RGRP_OUT);
-}
-
-/**
- * gfs_rgrp_print - Print out a resource group header
- * @rg: the cpu-order buffer
- *
- */
-
-void
-gfs_rgrp_print(struct gfs_rgrp *rg)
-{
-	ENTER(GFN_RGRP_PRINT)
-
-	gfs_meta_header_print(&rg->rg_header);
-
-	pv(rg, rg_flags, "%u");
-
-	pv(rg, rg_free, "%u");
-
-	pv(rg, rg_useddi, "%u");
-	pv(rg, rg_freedi, "%u");
-	gfs_inum_print(&rg->rg_freedi_list);
-
-	pv(rg, rg_usedmeta, "%u");
-	pv(rg, rg_freemeta, "%u");
-
-	pa(rg, rg_reserved, 64);
-
-	RET(GFN_RGRP_PRINT);
-}
-
-/**
- * gfs_quota_in - Read in a quota structures
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_in(struct gfs_quota *quota, char *buf)
-{
-	ENTER(GFN_QUOTA_IN)
-	struct gfs_quota *str = (struct gfs_quota *)buf;
-
-	CPIN_64(quota, str, qu_limit);
-	CPIN_64(quota, str, qu_warn);
-	CPIN_64(quota, str, qu_value);
-
-	CPIN_08(quota, str, qu_reserved, 64);
-
-	RET(GFN_QUOTA_IN);
-}
-
-/**
- * gfs_quota_out - Write out a quota structure
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_out(struct gfs_quota *quota, char *buf)
-{
-	ENTER(GFN_QUOTA_OUT)
-	struct gfs_quota *str = (struct gfs_quota *)buf;
-
-	CPOUT_64(quota, str, qu_limit);
-	CPOUT_64(quota, str, qu_warn);
-	CPOUT_64(quota, str, qu_value);
-
-	CPOUT_08(quota, str, qu_reserved, 64);
-
-	RET(GFN_QUOTA_OUT);
-}
-
-/**
- * gfs_quota_print - Print out a quota structure
- * @quota: the cpu-order buffer
- *
- */
-
-void
-gfs_quota_print(struct gfs_quota *quota)
-{
-	ENTER(GFN_QUOTA_PRINT)
-
-	pv(quota, qu_limit, "%"PRIu64);
-	pv(quota, qu_warn, "%"PRIu64);
-	pv(quota, qu_value, "%"PRId64);
-
-	pa(quota, qu_reserved, 64);
-
-	RET(GFN_QUOTA_PRINT);
-}
-
-/**
- * gfs_dinode_in - Read in a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_in(struct gfs_dinode *dinode, char *buf)
-{
-	ENTER(GFN_DINODE_IN)
-	struct gfs_dinode *str = (struct gfs_dinode *)buf;
-
-	gfs_meta_header_in(&dinode->di_header, buf);
-
-	gfs_inum_in(&dinode->di_num, (char *)&str->di_num);
-
-	CPIN_32(dinode, str, di_mode);
-	CPIN_32(dinode, str, di_uid);
-	CPIN_32(dinode, str, di_gid);
-	CPIN_32(dinode, str, di_nlink);
-	CPIN_64(dinode, str, di_size);
-	CPIN_64(dinode, str, di_blocks);
-	CPIN_64(dinode, str, di_atime);
-	CPIN_64(dinode, str, di_mtime);
-	CPIN_64(dinode, str, di_ctime);
-	CPIN_32(dinode, str, di_major);
-	CPIN_32(dinode, str, di_minor);
-
-	CPIN_64(dinode, str, di_rgrp);
-	CPIN_64(dinode, str, di_goal_rgrp);
-	CPIN_32(dinode, str, di_goal_dblk);
-	CPIN_32(dinode, str, di_goal_mblk);
-	CPIN_32(dinode, str, di_flags);
-	CPIN_32(dinode, str, di_payload_format);
-	CPIN_16(dinode, str, di_type);
-	CPIN_16(dinode, str, di_height);
-	CPIN_32(dinode, str, di_incarn);
-	CPIN_16(dinode, str, di_pad);
-
-	CPIN_16(dinode, str, di_depth);
-	CPIN_32(dinode, str, di_entries);
-
-	gfs_inum_in(&dinode->di_next_unused, (char *)&str->di_next_unused);
-
-	CPIN_64(dinode, str, di_eattr);
-
-	CPIN_08(dinode, str, di_reserved, 56);
-
-	RET(GFN_DINODE_IN);
-}
-
-/**
- * gfs_dinode_out - Write out a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_out(struct gfs_dinode *dinode, char *buf)
-{
-	ENTER(GFN_DINODE_OUT)
-	struct gfs_dinode *str = (struct gfs_dinode *)buf;
-
-	gfs_meta_header_out(&dinode->di_header, buf);
-
-	gfs_inum_out(&dinode->di_num, (char *)&str->di_num);
-
-	CPOUT_32(dinode, str, di_mode);
-	CPOUT_32(dinode, str, di_uid);
-	CPOUT_32(dinode, str, di_gid);
-	CPOUT_32(dinode, str, di_nlink);
-	CPOUT_64(dinode, str, di_size);
-	CPOUT_64(dinode, str, di_blocks);
-	CPOUT_64(dinode, str, di_atime);
-	CPOUT_64(dinode, str, di_mtime);
-	CPOUT_64(dinode, str, di_ctime);
-	CPOUT_32(dinode, str, di_major);
-	CPOUT_32(dinode, str, di_minor);
-
-	CPOUT_64(dinode, str, di_rgrp);
-	CPOUT_64(dinode, str, di_goal_rgrp);
-	CPOUT_32(dinode, str, di_goal_dblk);
-	CPOUT_32(dinode, str, di_goal_mblk);
-	CPOUT_32(dinode, str, di_flags);
-	CPOUT_32(dinode, str, di_payload_format);
-	CPOUT_16(dinode, str, di_type);
-	CPOUT_16(dinode, str, di_height);
-	CPOUT_32(dinode, str, di_incarn);
-	CPOUT_16(dinode, str, di_pad);
-
-	CPOUT_16(dinode, str, di_depth);
-	CPOUT_32(dinode, str, di_entries);
-
-	gfs_inum_out(&dinode->di_next_unused, (char *)&str->di_next_unused);
-
-	CPOUT_64(dinode, str, di_eattr);
-
-	CPOUT_08(dinode, str, di_reserved, 56);
-
-	RET(GFN_DINODE_OUT);
-}
-
-/**
- * gfs_dinode_print - Print out a dinode
- * @di: the cpu-order buffer
- *
- */
-
-void
-gfs_dinode_print(struct gfs_dinode *di)
-{
-	ENTER(GFN_DINODE_PRINT)
-
-	gfs_meta_header_print(&di->di_header);
-
-	gfs_inum_print(&di->di_num);
-
-	pv(di, di_mode, "0%o");
-	pv(di, di_uid, "%u");
-	pv(di, di_gid, "%u");
-	pv(di, di_nlink, "%u");
-	pv(di, di_size, "%"PRIu64);
-	pv(di, di_blocks, "%"PRIu64);
-	pv(di, di_atime, "%"PRId64);
-	pv(di, di_mtime, "%"PRId64);
-	pv(di, di_ctime, "%"PRId64);
-	pv(di, di_major, "%u");
-	pv(di, di_minor, "%u");
-
-	pv(di, di_rgrp, "%"PRIu64);
-	pv(di, di_goal_rgrp, "%"PRIu64);
-	pv(di, di_goal_dblk, "%u");
-	pv(di, di_goal_mblk, "%u");
-	pv(di, di_flags, "0x%.8X");
-	pv(di, di_payload_format, "%u");
-	pv(di, di_type, "%u");
-	pv(di, di_height, "%u");
-	pv(di, di_incarn, "%u");
-	pv(di, di_pad, "%u");
-
-	pv(di, di_depth, "%u");
-	pv(di, di_entries, "%u");
-
-	gfs_inum_print(&di->di_next_unused);
-
-	pv(di, di_eattr, "%"PRIu64);
-
-	pa(di, di_reserved, 56);
-
-	RET(GFN_DINODE_PRINT);
-}
-
-/**
- * gfs_indirect_in - copy in the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_in(struct gfs_indirect *indirect, char *buf)
-{
-	ENTER(GFN_INDIRECT_IN)
-	struct gfs_indirect *str = (struct gfs_indirect *)buf;
-
-	gfs_meta_header_in(&indirect->in_header, buf);
-
-	CPIN_08(indirect, str, in_reserved, 64);
-
-	RET(GFN_INDIRECT_IN);
-}
-
-/**
- * gfs_indirect_out - copy out the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_out(struct gfs_indirect *indirect, char *buf)
-{
-	ENTER(GFN_INDIRECT_OUT)
-	struct gfs_indirect *str = (struct gfs_indirect *)buf;
-
-	gfs_meta_header_out(&indirect->in_header, buf);
-
-	CPOUT_08(indirect, str, in_reserved, 64);
-
-	RET(GFN_INDIRECT_OUT);
-}
-
-/**
- * gfs_indirect_print - Print out a indirect block header
- * @indirect: the cpu-order buffer
- *
- */
-
-void
-gfs_indirect_print(struct gfs_indirect *indirect)
-{
-	ENTER(GFN_INDIRECT_PRINT)
-
-	gfs_meta_header_print(&indirect->in_header);
-
-	pa(indirect, in_reserved, 64);
-
-	RET(GFN_INDIRECT_PRINT);
-}
-
-/**
- * gfs_dirent_in - Read in a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_in(struct gfs_dirent *dirent, char *buf)
-{
-	ENTER(GFN_DIRENT_IN)
-	struct gfs_dirent *str = (struct gfs_dirent *)buf;
-
-	gfs_inum_in(&dirent->de_inum, (char *)&str->de_inum);
-	CPIN_32(dirent, str, de_hash);
-	CPIN_16(dirent, str, de_rec_len);
-	CPIN_16(dirent, str, de_name_len);
-	CPIN_16(dirent, str, de_type);
-
-	CPIN_08(dirent, str, de_reserved, 14);
-
-	RET(GFN_DIRENT_IN);
-}
-
-/**
- * gfs_dirent_out - Write out a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_out(struct gfs_dirent *dirent, char *buf)
-{
-	ENTER(GFN_DIRENT_OUT)
-	struct gfs_dirent *str = (struct gfs_dirent *)buf;
-
-	gfs_inum_out(&dirent->de_inum, (char *)&str->de_inum);
-	CPOUT_32(dirent, str, de_hash);
-	CPOUT_16(dirent, str, de_rec_len);
-	CPOUT_16(dirent, str, de_name_len);
-	CPOUT_16(dirent, str, de_type);
-
-	CPOUT_08(dirent, str, de_reserved, 14);
-
-	RET(GFN_DIRENT_OUT);
-}
-
-/**
- * gfs_dirent_print - Print out a directory entry
- * @de: the cpu-order buffer
- * @name: the filename
- *
- */
-
-void
-gfs_dirent_print(struct gfs_dirent *de, char *name)
-{
-	ENTER(GFN_DIRENT_PRINT)
-	char buf[GFS_FNAMESIZE + 1];
-
-	gfs_inum_print(&de->de_inum);
-	pv(de, de_hash, "0x%.8X");
-	pv(de, de_rec_len, "%u");
-	pv(de, de_name_len, "%u");
-	pv(de, de_type, "%u");
-
-	pa(de, de_reserved, 14);
-
-	memset(buf, 0, GFS_FNAMESIZE + 1);
-	memcpy(buf, name, de->de_name_len);
-	printk("  name = %s\n", buf);
-
-	RET(GFN_DIRENT_PRINT);
-}
-
-/**
- * gfs_leaf_in - Read in a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_in(struct gfs_leaf *leaf, char *buf)
-{
-	ENTER(GFN_LEAF_IN)
-	struct gfs_leaf *str = (struct gfs_leaf *)buf;
-
-	gfs_meta_header_in(&leaf->lf_header, buf);
-
-	CPIN_16(leaf, str, lf_depth);
-	CPIN_16(leaf, str, lf_entries);
-	CPIN_32(leaf, str, lf_dirent_format);
-	CPIN_64(leaf, str, lf_next);
-
-	CPIN_08(leaf, str, lf_reserved, 64);
-
-	RET(GFN_LEAF_IN);
-}
-
-/**
- * gfs_leaf_out - Write out a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_out(struct gfs_leaf *leaf, char *buf)
-{
-	ENTER(GFN_LEAF_OUT)
-	struct gfs_leaf *str = (struct gfs_leaf *)buf;
-
-	gfs_meta_header_out(&leaf->lf_header, buf);
-
-	CPOUT_16(leaf, str, lf_depth);
-	CPOUT_16(leaf, str, lf_entries);
-	CPOUT_32(leaf, str, lf_dirent_format);
-	CPOUT_64(leaf, str, lf_next);
-
-	CPOUT_08(leaf, str, lf_reserved, 64);
-
-	RET(GFN_LEAF_OUT);
-}
-
-/**
- * gfs_leaf_print - Print out a directory leaf header
- * @lf: the cpu-order buffer
- *
- */
-
-void
-gfs_leaf_print(struct gfs_leaf *lf)
-{
-	ENTER(GFN_LEAF_PRINT)
-
-	gfs_meta_header_print(&lf->lf_header);
-
-	pv(lf, lf_depth, "%u");
-	pv(lf, lf_entries, "%u");
-	pv(lf, lf_dirent_format, "%u");
-	pv(lf, lf_next, "%"PRIu64);
-
-	pa(lf, lf_reserved, 64);
-
-	RET(GFN_LEAF_PRINT);
-}
-
-/**
- * gfs_log_header_in - Read in a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_in(struct gfs_log_header *head, char *buf)
-{
-	ENTER(GFN_LOG_HEADER_IN)
-	struct gfs_log_header *str = (struct gfs_log_header *)buf;
-
-	gfs_meta_header_in(&head->lh_header, buf);
-
-	CPIN_32(head, str, lh_flags);
-	CPIN_32(head, str, lh_pad);
-
-	CPIN_64(head, str, lh_first);
-	CPIN_64(head, str, lh_sequence);
-
-	CPIN_64(head, str, lh_tail);
-	CPIN_64(head, str, lh_last_dump);
-
-	CPIN_08(head, str, lh_reserved, 64);
-
-	RET(GFN_LOG_HEADER_IN);
-}
-
-/**
- * gfs_log_header_out - Write out a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_out(struct gfs_log_header *head, char *buf)
-{
-	ENTER(GFN_LOG_HEADER_OUT)
-	struct gfs_log_header *str = (struct gfs_log_header *)buf;
-
-	gfs_meta_header_out(&head->lh_header, buf);
-
-	CPOUT_32(head, str, lh_flags);
-	CPOUT_32(head, str, lh_pad);
-
-	CPOUT_64(head, str, lh_first);
-	CPOUT_64(head, str, lh_sequence);
-
-	CPOUT_64(head, str, lh_tail);
-	CPOUT_64(head, str, lh_last_dump);
-
-	CPOUT_08(head, str, lh_reserved, 64);
-
-	RET(GFN_LOG_HEADER_OUT);
-}
-
-/**
- * gfs_log_header_print - Print out a log header
- * @head: the cpu-order buffer
- *
- */
-
-void
-gfs_log_header_print(struct gfs_log_header *lh)
-{
-	ENTER(GFN_LOG_HEADER_PRINT)
-
-	gfs_meta_header_print(&lh->lh_header);
-
-	pv(lh, lh_flags, "0x%.8X");
-	pv(lh, lh_pad, "%u");
-
-	pv(lh, lh_first, "%"PRIu64);
-	pv(lh, lh_sequence, "%"PRIu64);
-
-	pv(lh, lh_tail, "%"PRIu64);
-	pv(lh, lh_last_dump, "%"PRIu64);
-
-	pa(lh, lh_reserved, 64);
-
-	RET(GFN_LOG_HEADER_PRINT);
-}
-
-/**
- * gfs_desc_in - Read in a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_in(struct gfs_log_descriptor *desc, char *buf)
-{
-	ENTER(GFN_DESC_IN)
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *)buf;
-
-	gfs_meta_header_in(&desc->ld_header, buf);
-
-	CPIN_32(desc, str, ld_type);
-	CPIN_32(desc, str, ld_length);
-	CPIN_32(desc, str, ld_data1);
-	CPIN_32(desc, str, ld_data2);
-
-	CPIN_08(desc, str, ld_reserved, 64);
-
-	RET(GFN_DESC_IN);
-}
-
-/**
- * gfs_desc_out - Write out a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_out(struct gfs_log_descriptor *desc, char *buf)
-{
-	ENTER(GFN_DESC_OUT)
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *)buf;
-
-	gfs_meta_header_out(&desc->ld_header, buf);
-
-	CPOUT_32(desc, str, ld_type);
-	CPOUT_32(desc, str, ld_length);
-	CPOUT_32(desc, str, ld_data1);
-	CPOUT_32(desc, str, ld_data2);
-
-	CPOUT_08(desc, str, ld_reserved, 64);
-
-	RET(GFN_DESC_OUT);
-}
-
-/**
- * gfs_desc_print - Print out a log descriptor
- * @ld: the cpu-order buffer
- *
- */
-
-void
-gfs_desc_print(struct gfs_log_descriptor *ld)
-{
-	ENTER(GFN_DESC_PRINT)
-
-	gfs_meta_header_print(&ld->ld_header);
-
-	pv(ld, ld_type, "%u");
-	pv(ld, ld_length, "%u");
-	pv(ld, ld_data1, "%u");
-	pv(ld, ld_data2, "%u");
-
-	pa(ld, ld_reserved, 64);
-
-	RET(GFN_DESC_PRINT);
-}
-
-/**
- * gfs_block_tag_in - Read in a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_in(struct gfs_block_tag *tag, char *buf)
-{
-	ENTER(GFN_BLOCK_TAG_IN)
-	struct gfs_block_tag *str = (struct gfs_block_tag *)buf;
-
-	CPIN_64(tag, str, bt_blkno);
-	CPIN_32(tag, str, bt_flags);
-	CPIN_32(tag, str, bt_pad);
-
-	RET(GFN_BLOCK_TAG_IN);
-}
-
-/**
- * gfs_block_tag_out - Write out a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_out(struct gfs_block_tag *tag, char *buf)
-{
-	ENTER(GFN_BLOCK_TAG_OUT)
-	struct gfs_block_tag *str = (struct gfs_block_tag *)buf;
-
-	CPOUT_64(tag, str, bt_blkno);
-	CPOUT_32(tag, str, bt_flags);
-	CPOUT_32(tag, str, bt_pad);
-
-	RET(GFN_BLOCK_TAG_OUT);
-}
-
-/**
- * gfs_block_tag_print - Print out a block tag
- * @tag: the cpu-order buffer
- *
- */
-
-void
-gfs_block_tag_print(struct gfs_block_tag *tag)
-{
-	ENTER(GFN_BLOCK_TAG_PRINT)
-
-	pv(tag, bt_blkno, "%"PRIu64);
-	pv(tag, bt_flags, "%u");
-	pv(tag, bt_pad, "%u");
-
-	RET(GFN_BLOCK_TAG_PRINT);
-}
-
-/**
- * gfs_quota_tag_in - Read in a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_in(struct gfs_quota_tag *tag, char *buf)
-{
-	ENTER(GFN_QUOTA_TAG_IN)
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *)buf;
-
-	CPIN_64(tag, str, qt_change);
-	CPIN_32(tag, str, qt_flags);
-	CPIN_32(tag, str, qt_id);
-
-	RET(GFN_QUOTA_TAG_IN);
-}
-
-/**
- * gfs_quota_tag_out - Write out a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_out(struct gfs_quota_tag *tag, char *buf)
-{
-	ENTER(GFN_QUOTA_TAG_OUT)
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *)buf;
-
-	CPOUT_64(tag, str, qt_change);
-	CPOUT_32(tag, str, qt_flags);
-	CPOUT_32(tag, str, qt_id);
-
-	RET(GFN_QUOTA_TAG_OUT);
-}
-
-/**
- * gfs_quota_tag_print - Print out a quota tag
- * @tag: the cpu-order buffer
- *
- */
-
-void
-gfs_quota_tag_print(struct gfs_quota_tag *tag)
-{
-	ENTER(GFN_QUOTA_TAG_PRINT)
-
-	pv(tag, qt_change, "%"PRId64);
-	pv(tag, qt_flags, "0x%.8X");
-	pv(tag, qt_id, "%u");
-
-	RET(GFN_QUOTA_TAG_PRINT);
-}
-
-/**
- * gfs_ea_header_in - Read in a Extended Attribute header
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_in(struct gfs_ea_header *ea, char *buf)
-{
-	ENTER(GFN_EA_HEADER_IN)
-	struct gfs_ea_header *str = (struct gfs_ea_header *)buf;
-
-	CPIN_32(ea, str, ea_rec_len);
-	CPIN_32(ea, str, ea_data_len);
-	ea->ea_name_len = str->ea_name_len;
-	ea->ea_type = str->ea_type;
-	ea->ea_flags = str->ea_flags;
-	ea->ea_num_ptrs = str->ea_num_ptrs;
-	CPIN_32(ea, str, ea_pad);
-
-	RET(GFN_EA_HEADER_IN);
-}
-
-/**
- * gfs_ea_header_out - Write out a Extended Attribute header
- * @ea: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_out(struct gfs_ea_header *ea, char *buf)
-{
-	ENTER(GFN_EA_HEADER_OUT)
-	struct gfs_ea_header *str = (struct gfs_ea_header *)buf;
-
-	CPOUT_32(ea, str, ea_rec_len);
-	CPOUT_32(ea, str, ea_data_len);
-	str->ea_name_len = ea->ea_name_len;
-	str->ea_type = ea->ea_type;
-	str->ea_flags = ea->ea_flags;
-	str->ea_num_ptrs = ea->ea_num_ptrs;
-	CPOUT_32(ea, str, ea_pad);
-
-	RET(GFN_EA_HEADER_OUT);
-}
-
-/**
- * gfs_ea_header_printt - Print out a Extended Attribute header
- * @ea: the cpu-order buffer
- *
- */
-
-void
-gfs_ea_header_print(struct gfs_ea_header *ea, char *name)
-{
-	ENTER(GFN_EA_HEADER_PRINT)
-	char buf[GFS_EA_MAX_NAME_LEN + 1];
-
-	pv(ea, ea_rec_len, "%u");
-	pv(ea, ea_data_len, "%u");
-	pv(ea, ea_name_len, "%u");
-	pv(ea, ea_type, "%u");
-	pv(ea, ea_flags, "%u");
-	pv(ea, ea_num_ptrs, "%u");
-	pv(ea, ea_pad, "%u");
-
-	memset(buf, 0, GFS_EA_MAX_NAME_LEN + 1);
-	memcpy(buf, name, ea->ea_name_len);
-	printk("  name = %s\n", buf);
-
-	RET(GFN_EA_HEADER_PRINT);
-}
-
-static const uint32_t crc_32_tab[] =
-{
-  0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
-  0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
-  0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-  0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
-  0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
-  0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-  0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
-  0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
-  0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-  0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
-  0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
-  0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-  0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
-  0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
-  0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-  0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
-  0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
-  0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-  0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
-  0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
-  0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-  0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
-  0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
-  0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-  0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
-  0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
-  0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-  0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
-  0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
-  0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-  0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
-  0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
-/**
- * gfs_dir_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * The hash function is a 32-bit CRC of the data.  The algorithm uses
- * the crc_32_tab table above.
- *
- * This may not be the fastest hash function, but it does a fair bit better
- * at providing uniform results than the others I've looked at.  That's
- * really important for efficient directories.
- *
- * Returns: the hash
- */
-
-uint32_t
-gfs_dir_hash(const char *data, int len)
-{
-	ENTER(GFN_DIR_HASH)
-	uint32_t hash = 0xFFFFFFFF;
-
-	for (; len--; data++)
-		hash = crc_32_tab[(hash ^ *data) & 0xFF] ^ (hash >> 8);
-
-	hash = ~hash;
-
-	RETURN(GFN_DIR_HASH, hash);
-}
-
-#endif  /* WANT_GFS_CONVERSION_FUNCTIONS */
-
diff --git a/gfs/gfs_fsck/pass1.c b/gfs/gfs_fsck/pass1.c
deleted file mode 100644
index 386041b..0000000
--- a/gfs/gfs_fsck/pass1.c
+++ /dev/null
@@ -1,1124 +0,0 @@
-/* pass1 checks inodes for format & type, duplicate blocks, & incorrect
- * block count.
- *
- * It builds up tables that contains the state of each block (free,
- * block in use, metadata type, etc), as well as bad blocks and
- * duplicate blocks.  (See block_list.[ch] for more info)
- *
- */
-
-#include <stdio.h>
-
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "bio.h"
-#include "fs_dir.h"
-#include "fs_inode.h"
-#include "util.h"
-#include "block_list.h"
-#include "log.h"
-#include "inode_hash.h"
-#include "inode.h"
-#include "link.h"
-#include "metawalk.h"
-
-struct block_count {
-	uint64_t indir_count;
-	uint64_t data_count;
-	uint64_t ea_count;
-};
-
-static int leaf(struct fsck_inode *ip, uint64_t block, osi_buf_t *bh,
-		void *private);
-static int check_metalist(struct fsck_inode *ip, uint64_t block,
-			  osi_buf_t **bh, void *private);
-static int check_data(struct fsck_inode *ip, uint64_t block, void *private);
-static int check_eattr_indir(struct fsck_inode *ip, uint64_t indirect,
-			     uint64_t parent, osi_buf_t **bh,
-			     void *private);
-static int check_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, osi_buf_t **bh,
-			    void *private);
-static int check_eattr_entries(struct fsck_inode *ip, osi_buf_t *leaf_bh,
-			       struct gfs_ea_header *ea_hdr,
-			       struct gfs_ea_header *ea_hdr_prev,
-			       void *private);
-static int check_extended_leaf_eattr(struct fsck_inode *ip, uint64_t *data_ptr,
-				     osi_buf_t *leaf_bh,
-				     struct gfs_ea_header *ea_hdr,
-				     struct gfs_ea_header *ea_hdr_prev,
-				     void *private);
-static int finish_eattr_indir(struct fsck_inode *ip, int leaf_pointers,
-			      int leaf_pointer_errors, void *private);
-
-struct metawalk_fxns pass1_fxns = {
-	.private = NULL,
-	.check_leaf = leaf,
-	.check_metalist = check_metalist,
-	.check_data = check_data,
-	.check_eattr_indir = check_eattr_indir,
-	.check_eattr_leaf = check_eattr_leaf,
-	.check_dentry = NULL,
-	.check_eattr_entry = check_eattr_entries,
-	.check_eattr_extentry = check_extended_leaf_eattr,
-	.finish_eattr_indir = finish_eattr_indir,
-};
-
-static int leaf(struct fsck_inode *ip, uint64_t block, osi_buf_t *bh,
-		void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct block_count *bc = (struct block_count *) private;
-
-	log_debug("\tLeaf block at %15"PRIu64"\n", BH_BLKNO(bh));
-	block_set(sdp->bl, BH_BLKNO(bh), leaf_blk);
-	bc->indir_count++;
-	return 0;
-}
-
-static int check_metalist(struct fsck_inode *ip, uint64_t block,
-			  osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct block_query q = {0};
-	int found_dup = 0;
-	osi_buf_t *nbh;
-	struct block_count *bc = (struct block_count *)private;
-
-	*bh = NULL;
-
-	if (check_range(ip->i_sbd, block)){ /* blk outside of FS */
-		block_set(sdp->bl, ip->i_di.di_num.no_addr, bad_block);
-		log_debug("Bad indirect block pointer (out of range).\n");
-
-		return 1;
-	}
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	if(q.block_type != block_free) {
-		log_err("Found duplicate block referenced as metadata in "
-			"indirect block - was marked %d\n", q.block_type);
-		block_mark(sdp->bl, block, dup_block);
-		found_dup = 1;
-	}
-        get_and_read_buf(ip->i_sbd, block, &nbh, 0);
-
-	if (check_meta(nbh, GFS_METATYPE_IN)){
-		log_debug("Bad indirect block pointer (points to "
-			"something that is not an indirect block).\n");
-		if(!found_dup) {
-			block_set(sdp->bl, block, meta_inval);
-			relse_buf(ip->i_sbd, nbh);
-			return 1;
-		}
-
-		relse_buf(ip->i_sbd, nbh);
-	} else /* blk check ok */
-		*bh = nbh;
-
-	if (!found_dup) {
-		log_debug("Setting %" PRIu64 " to indirect block.\n", block);
-		block_set(sdp->bl, block, indir_blk);
-	}
-	bc->indir_count++;
-
-	return 0;
-}
-
-static int check_data(struct fsck_inode *ip, uint64_t block, void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct block_query q = {0};
-	osi_buf_t *data_bh;
-	struct block_count *bc = (struct block_count *) private;
-	int error = 0, btype;
-
-	if (check_range(ip->i_sbd, block)) {
-		log_err("inode %lld has a bad data block pointer "
-			"%lld (out of range)\n",
-			ip->i_di.di_num.no_addr, block);
-		/* Mark the owner of this block with the bad_block
-		 * designator so we know to check it for out of range
-		 * blocks later */
-		block_set(ip->i_sbd->bl, ip->i_di.di_num.no_addr, bad_block);
-
-		return 1;
-	}
-
-	if(get_and_read_buf(ip->i_sbd, block, &data_bh, 0)) {
-		stack;
-		block_set(sdp->bl, ip->i_di.di_num.no_addr, meta_inval);
-		return 1;
-	}
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		log_err("Found bad block referenced as data at %"
-			PRIu64 " (0x%"PRIx64 ")\n", block, block);
-		relse_buf(sdp, data_bh);
-		return -1;
-	}
-	if (ip->i_di.di_flags & GFS_DIF_JDATA){
-		if(check_meta(data_bh, GFS_METATYPE_JD)) {
-			log_err("Block #%"PRIu64" in inode %"PRIu64" does not have "
-				"correct meta header. Is %u should be %u\n",
-				block, ip->i_di.di_num.no_addr,
-				gfs32_to_cpu(((struct gfs_meta_header *)
-					      BH_DATA((data_bh)))->mh_type),
-				GFS_METATYPE_JD);
-			block_set(sdp->bl, ip->i_di.di_num.no_addr,
-				  meta_inval);
-			relse_buf(sdp, data_bh);
-			return 1;
-		}
-
-		if(q.block_type != block_free) {
-			log_err("Found duplicate block referenced as "
-				"journaled data at %" PRIu64"\n", block);
-			if (q.block_type != meta_inval) {
-				block_mark(sdp->bl, block, dup_block);
-				relse_buf(sdp, data_bh);
-				/* If the prev ref was as data, this is likely
-				   a data block, so keep the block count for
-				   both refs. */
-				if (q.block_type == block_used)
-					bc->data_count++;
-				return 1;
-			}
-			/* An explanation is in order here.  At this point we
-			   found a duplicate block, a block that was already
-			   referenced somewhere else.  We'll resolve those
-			   duplicates in pass1b. However, if the block is
-			   marked "invalid" that's a special case.  It's likely
-			   that the block was discovered to be invalid
-			   metadata--i.e. doesn't have a metadata header.
-			   However, it still may be a valid data block, since
-			   they won't have metadata headers.  In that case,
-			   the block is marked as duplicate, but also as a
-			   journaled data block. */
-			error = 1;
-			log_debug("Marking %" PRIu64 " as journaled data "
-				  "block\n", block);
-			block_unmark(sdp->bl, block, meta_inval);
-			block_mark(sdp->bl, block, dup_block);
-		}
-		block_mark(sdp->bl, block, journal_blk);
-	} else {
-		if(q.block_type != block_free) {
-			log_err("Found duplicate block referenced as data "
-				"at %" PRIu64"\n", block);
-			if (q.block_type != meta_inval) {
-				block_mark(sdp->bl, block, dup_block);
-				bc->data_count++;
-				relse_buf(sdp, data_bh);
-				return 1;
-			}
-			error = 1;
-			log_debug("Marking %"PRIu64 " as data block\n", block);
-			block_unmark(sdp->bl, block, meta_inval);
-			block_mark(sdp->bl, block, dup_block);
-		}
-		block_mark(sdp->bl, block, block_used);
-	}
-	relse_buf(sdp, data_bh);
-	/* This is also confusing, so I'll clarify.  There are two bitmaps:
-	   (1) The bitmap that fsck uses to keep track of what block
-	   type has been discovered, and (2) The rgrp bitmap.  Function
-	   gfs_block_set is used to set the former and set_bitmap
-	   is used to set the latter.  In this function we need to set both
-	   because we found a "data" block that could be "meta" in the rgrp
-	   bitmap.  If we don't we could run into the data block again as
-	   metadata when we're traversing the metadata with next_rg_meta
-	   in func pass1().  If that happens, it will look at the block,
-	   say "hey this isn't metadata" and mark it incorrectly as an
-	   invalid metadata block and free it.  Ordinarily, fsck will wait
-	   until pass5 to sync (2) so that it agrees with (1).  However, in
-	   this case, it's better to do it upfront.  The duplicate solving
-	   code in pass1b.c is better at resolving metadata referencing a
-	   data block than it is at resolving a data block referencing a
-	   metadata block. */
-	btype = fs_get_bitmap(ip->i_sbd, block, NULL);
-	if (btype != GFS_BLKST_USED && btype != GFS_BLKST_USEDMETA) {
-		const char *allocdesc[] = {"free space", "data",
-					   "free metadata", "metadata",
-					   "reserved"};
-
-		if (ip->i_di.di_flags & GFS_DIF_JDATA) {
-			log_err("Block #%llu seems to be journaled data, but "
-				"is marked as %s.\n",
-				(unsigned long long)block, allocdesc[btype]);
-			errors_found++;
-			if(query(sdp, "Okay to mark it as 'journaled data'? "
-				 "(y/n)")) {
-				errors_corrected++;
-				fs_set_bitmap(sdp, block, GFS_BLKST_USEDMETA);
-				log_err("The block was reassigned as "
-					"journaled data.\n");
-			} else {
-				log_err("The invalid block was ignored.\n");
-			}
-		} else {
-			log_err("Block #%llu seems to be data, but "
-				"is marked as %s.\n",
-				(unsigned long long)block, allocdesc[btype]);
-			errors_found++;
-			if(query(sdp, "Okay to mark it as 'data'? "
-				 "(y/n)")) {
-				errors_corrected++;
-				fs_set_bitmap(sdp, block, GFS_BLKST_USED);
-				log_err("The block was reassigned as "
-					"journaled data.\n");
-			} else {
-				log_err("The invalid block was ignored.\n");
-			}
-		}
-	}
-	bc->data_count++;
-	return error;
-}
-
-static int remove_inode_eattr(struct fsck_inode *ip, struct block_count *bc,
-			      int duplicate)
-{
-	osi_buf_t *dibh = NULL;
-
-	if (!duplicate) {
-		fs_set_bitmap(ip->i_sbd, ip->i_di.di_eattr,
-				GFS_BLKST_FREEMETA);
-		block_set(ip->i_sbd->bl, ip->i_di.di_eattr, meta_free);
-	}
-	ip->i_di.di_eattr = 0;
-	bc->ea_count = 0;
-	ip->i_di.di_blocks = 1 + bc->indir_count + bc->data_count;
-	ip->i_di.di_flags &= ~GFS_DIF_EA_INDIRECT;
-	if (get_and_read_buf(ip->i_sbd, ip->i_num.no_addr, &dibh, 0)) {
-		log_err("The bad Extended Attribute could not be fixed.\n");
-		bc->ea_count++;
-		return 1;
-	}
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-	if (write_buf(ip->i_sbd, dibh, 0) < 0) {
-		stack;
-		log_crit("The bad Extended Attribute remains.\n");
-		relse_buf(ip->i_sbd, dibh);
-		return -1;
-	} else {
-		log_warn("The bad Extended Attribute was removed.\n");
-	}
-	relse_buf(ip->i_sbd, dibh);
-	return 0;
-}
-
-static int ask_remove_inode_eattr(struct fsck_inode *ip,
-				  struct block_count *bc)
-{
-	log_err("Inode %lld has unrecoverable Extended Attribute "
-		"errors.\n", (unsigned long long)ip->i_di.di_num.no_addr);
-	errors_found++;
-	if (query(ip->i_sbd, "Clear all Extended Attributes from the "
-		  "inode? (y/n) ")) {
-		struct block_query q;
-
-		if(block_check(ip->i_sbd->bl, ip->i_di.di_eattr, &q)) {
-			stack;
-			return -1;
-		}
-		if (!remove_inode_eattr(ip, bc, q.dup_block)) {
-			errors_corrected++;
-			log_err("Extended attributes were removed.\n");
-		} else
-			log_err("Unable to remove inode eattr pointer; "
-				"the error remains.\n");
-	} else {
-		log_err("Extended attributes were not removed.\n");
-	}
-	return 0;
-}
-
-/* clear_eas - clear the extended attributes for an inode
- *
- * @ip       - in core inode pointer
- * @bc       - pointer to a block count structure
- * block     - the block that had the problem
- * duplicate - if this is a duplicate block, don't set it "free"
- * emsg      - what to tell the user about the eas being checked
- * Returns: 1 if the EA is fixed, else 0 if it was not fixed.
- */
-static int clear_eas(struct fsck_inode *ip, struct block_count *bc,
-		     uint64_t block, int duplicate, const char *emsg)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-
-	log_err("Inode #%" PRIu64 " (0x%" PRIx64 "): %s",
-		ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, emsg);
-	log_err(" at block #%" PRIu64 ".\n", block);
-	errors_found++;
-	if (query(sdp, "Clear the bad Extended Attribute? (y/n) ")) {
-		if (block == ip->i_di.di_eattr) {
-			remove_inode_eattr(ip, bc, duplicate);
-			log_warn("The bad Extended Attribute was removed.\n");
-		} else if (!duplicate) {
-			block_set(sdp->bl, block, meta_free);
-			fs_set_bitmap(sdp, block, GFS_BLKST_FREEMETA);
-			log_err("The bad Extended Attribute was "
-				"removed.\n");
-		}
-		errors_corrected++;
-		return 1;
-	} else {
-		log_err("The bad Extended Attribute was not fixed.\n");
-		bc->ea_count++;
-		return 0;
-	}
-}
-
-static int check_eattr_indir(struct fsck_inode *ip, uint64_t indirect,
-			     uint64_t parent, osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	int ret = 0;
-	struct block_query q = {0};
-	struct block_count *bc = (struct block_count *) private;
-
-	/* This inode contains an eattr - it may be invalid, but the
-	 * eattr attributes points to a non-zero block */
-	if(check_range(sdp, indirect)) {
-		/*log_warn("EA indirect block #%"PRIu64" is out of range.\n",
-			indirect);
-			block_set(sdp->bl, parent, bad_block);*/
-		/* Doesn't help to mark this here - this gets checked
-		 * in pass1c */
-		return 1;
-	}
-	if(block_check(sdp->bl, indirect, &q)) {
-		stack;
-		return -1;
-	}
-
-	/* Special duplicate processing:  If we have an EA block,
-	   check if it really is an EA.  If it is, let duplicate
-	   handling sort it out.  If it isn't, clear it but don't
-	   count it as a duplicate. */
-	if(get_and_read_buf(sdp, indirect, bh, 0)) {
-		log_warn("Unable to read Extended Attribute indirect block "
-			 "#%"PRIu64".\n", indirect);
-		block_set(sdp->bl, indirect, meta_inval);
-		return 1;
-	}
-	if(check_meta(*bh, GFS_METATYPE_IN)) {
-		if(q.block_type != block_free) {
-			if (!clear_eas(ip, bc, indirect, 1,
-				       "Bad indirect Extended Attribute "
-				       "duplicate found")) {
-				block_mark(sdp->bl, indirect, dup_block);
-				bc->ea_count++;
-			}
-			return 1;
-		}
-		clear_eas(ip, bc, indirect, 0,
-			  "Extended Attribute indirect block has incorrect "
-			  "type");
-		return 1;
-	}
-	if(q.block_type != block_free) { /* Duplicate? */
-		log_err("Inode #%" PRIu64 "Duplicate Extended Attribute "
-			"indirect block found at #%"PRIu64".\n",
-			ip->i_di.di_num.no_addr, indirect);
-		block_mark(sdp->bl, indirect, dup_block);
-		bc->ea_count++;
-		ret = 1;
-	} else {
-		log_debug("Setting #%" PRIu64
-			  ") to indirect Extended Attribute block\n",
-			  indirect);
-		block_set(sdp->bl, BH_BLKNO(*bh), indir_blk);
-		bc->ea_count++;
-	}
-	return ret;
-}
-
-static int finish_eattr_indir(struct fsck_inode *ip, int leaf_pointers,
-			      int leaf_pointer_errors, void *private)
-{
-	struct block_count *bc = (struct block_count *) private;
-
-	if (leaf_pointer_errors == leaf_pointers) /* All eas were bad */
-		return ask_remove_inode_eattr(ip, bc);
-	log_debug("Marking inode #%lld with extended attribute block\n",
-		  (unsigned long long)ip->i_di.di_num.no_addr);
-	/* Mark the inode as having an eattr in the block map
-	   so pass1c can check it. */
-	block_mark(ip->i_sbd->bl, ip->i_di.di_num.no_addr, eattr_block);
-	if (!leaf_pointer_errors)
-		return 0;
-	log_err("Inode %lld has recoverable indirect "
-		"Extended Attribute errors.\n",
-		(unsigned long long)ip->i_di.di_num.no_addr);
-	errors_found++;
-	if (query(ip->i_sbd, "Okay to fix the block count for the inode? "
-		  "(y/n) ")) {
-		ip->i_di.di_blocks = 1 + bc->indir_count +
-			bc->data_count + bc->ea_count;
-		errors_corrected++;
-		log_err("Block count fixed.\n");
-		return 1;
-	}
-	log_err("Block count not fixed.\n");
-	return 1;
-}
-
-static int check_leaf_block(struct fsck_inode *ip, uint64_t block, int btype,
-			    osi_buf_t **bh, void *private)
-{
-	osi_buf_t *leaf_bh = NULL;
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct block_query q = {0};
-	struct block_count *bc = (struct block_count *) private;
-
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	/* Special duplicate processing:  If we have an EA block, check if it
-	   really is an EA.  If it is, let duplicate handling sort it out.
-	   If it isn't, clear it but don't count it as a duplicate. */
-	if(get_and_read_buf(sdp, block, &leaf_bh, 0)){
-		log_err("Unable to read leaf block %lld.\n", block);
-		return -1;
-	}
-	if(check_meta(leaf_bh, btype)) {
-		if(q.block_type != block_free) { /* Duplicate? */
-			clear_eas(ip, bc, block, 1,
-				  "Bad Extended Attribute duplicate found");
-		} else {
-			clear_eas(ip, bc, block, 0,
-				  "Extended Attribute leaf block "
-				  "has incorrect type");
-		}
-		relse_buf(sdp, leaf_bh);
-		return 1;
-	}
-	if(q.block_type != block_free) { /* Duplicate? */
-		log_debug("Duplicate block found at #%lld.\n",
-			  (unsigned long long)block);
-		block_mark(sdp->bl, block, dup_block);
-		bc->ea_count++;
-		relse_buf(sdp, leaf_bh);
-		return 1;
-	}
-	if (ip->i_di.di_eattr == 0) {
-		/* Can only get in here if there were unrecoverable ea
-		   errors that caused clear_eas to be called.  What we
-		   need to do here is remove the subsequent ea blocks. */
-		clear_eas(ip, bc, block, 0,
-			  "Extended Attribute block removed due to "
-			  "previous errors.\n");
-		relse_buf(sdp, leaf_bh);
-		return 1;
-	}
-	log_debug("Setting block #%lld (0x%llx) to eattr block\n",
-		  (unsigned long long)block, (unsigned long long)block);
-	/* Point of confusion: We've got to set the ea block itself to
-	   gfs2_meta_eattr here.  Elsewhere we mark the inode with
-	   gfs2_eattr_block meaning it contains an eattr for pass1c. */
-	block_set(sdp->bl, block, meta_eattr);
-	bc->ea_count++;
-	*bh = leaf_bh;
-	return 0;
-}
-
-/**
- * check_extended_leaf_eattr
- * @ip
- * @el_blk: block number of the extended leaf
- *
- * An EA leaf block can contain EA's with pointers to blocks
- * where the data for that EA is kept.  Those blocks still
- * have the gfs meta header of type GFS_METATYPE_EA
- *
- * Returns: 0 if correct[able], -1 if removal is needed
- */
-static int check_extended_leaf_eattr(struct fsck_inode *ip, uint64_t *data_ptr,
-				     osi_buf_t *leaf_bh,
-				     struct gfs_ea_header *ea_hdr,
-				     struct gfs_ea_header *ea_hdr_prev,
-				     void *private)
-{
-	uint64_t el_blk = gfs64_to_cpu(*data_ptr);
-	struct fsck_sb *sdp = ip->i_sbd;
-	osi_buf_t *bh = NULL;
-	int error;
-
-	if(check_range(sdp, el_blk)){
-		log_err("Inode #%" PRIu64 ": Extended Attribute block %" PRIu64
-			" has an extended leaf block #%" PRIu64 " that is out "
-			"of range.\n", ip->i_di.di_num.no_addr,
-			ip->i_di.di_eattr, el_blk);
-		block_set(sdp->bl, ip->i_di.di_eattr, bad_block);
-		return 1;
-	}
-	error = check_leaf_block(ip, el_blk, GFS_METATYPE_ED, &bh, private);
-	if (bh)
-		relse_buf(sdp, bh);
-	return error;
-}
-
-static int check_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-
-	/* This inode contains an eattr - it may be invalid, but the
-	 * eattr attributes points to a non-zero block.
-	 * Clarification: If we're here we're checking a leaf block, and the
-	 * source dinode needs to be marked as having extended attributes.
-	 * That instructs pass1c to check the contents of the ea blocks. */
-	log_debug("Setting inode %" PRIu64 ") as having eattr "
-		  "block\n", ip->i_num.no_addr);
-	block_mark(sdp->bl, ip->i_num.no_addr, eattr_block);
-	if(check_range(sdp, block)){
-		log_warn("Inode #%" PRIu64 " Extended Attribute leaf block "
-			 "#%" PRIu64 " is out of range.\n",
-			 ip->i_num.no_addr, block);
-		block_set(sdp->bl, ip->i_di.di_eattr, bad_block);
-		return 1;
-	}
-	return check_leaf_block(ip, block, GFS_METATYPE_EA, bh, private);
-}
-
-static int check_eattr_entries(struct fsck_inode *ip,
-			       osi_buf_t *leaf_bh,
-			       struct gfs_ea_header *ea_hdr,
-			       struct gfs_ea_header *ea_hdr_prev,
-			       void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	char ea_name[256];
-
-	if(!ea_hdr->ea_name_len){
-		/* Skip this entry for now */
-		return 1;
-	}
-
-	memset(ea_name, 0, sizeof(ea_name));
-	strncpy(ea_name, (char *)ea_hdr + sizeof(struct gfs_ea_header),
-		ea_hdr->ea_name_len);
-
-	if(!GFS_EATYPE_VALID(ea_hdr->ea_type) &&
-	   ((ea_hdr_prev) || (!ea_hdr_prev && ea_hdr->ea_type))){
-		/* Skip invalid entry */
-		return 1;
-	}
-
-	if(ea_hdr->ea_num_ptrs){
-		uint32_t avail_size;
-		int max_ptrs;
-
-		avail_size = sdp->sb.sb_bsize - sizeof(struct gfs_meta_header);
-		max_ptrs = (gfs32_to_cpu(ea_hdr->ea_data_len)+avail_size-1)/avail_size;
-
-		if(max_ptrs > ea_hdr->ea_num_ptrs) {
-			return 1;
-		} else {
-			log_debug("  Pointers Required: %d\n"
-				  "  Pointers Reported: %d\n",
-				  max_ptrs, ea_hdr->ea_num_ptrs);
-		}
-	}
-	return 0;
-}
-
-static int clear_metalist(struct fsck_inode *ip, uint64_t block,
-		   osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct block_query q = {0};
-
-	*bh = NULL;
-
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	if(!q.dup_block) {
-		block_set(sdp->bl, block, block_free);
-		return 0;
-	}
-	return 0;
-}
-
-static int clear_data(struct fsck_inode *ip, uint64_t block, void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct block_query q = {0};
-
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	if(!q.dup_block) {
-		block_set(sdp->bl, block, block_free);
-		return 0;
-	}
-	return 0;
-
-}
-
-static int clear_leaf(struct fsck_inode *ip, uint64_t block,
-	       osi_buf_t *bh, void *private)
-{
-	struct block_query q = {0};
-	struct fsck_sb *sdp = ip->i_sbd;
-
-	log_crit("Clearing leaf %"PRIu64"\n", block);
-
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	if(!q.dup_block) {
-		log_crit("Setting leaf #%" PRIu64 " invalid\n", block);
-		if(block_set(sdp->bl, block, block_free)) {
-			stack;
-			return -1;
-		}
-		return 0;
-	}
-	return 0;
-}
-
-int add_to_dir_list(struct fsck_sb *sbp, uint64_t block)
-{
-	struct dir_info *di = NULL;
-	struct dir_info *newdi;
-
-	/* FIXME: This list should probably be a b-tree or
-	 * something...but since most of the time we're going to be
-	 * tacking the directory onto the end of the list, it doesn't
-	 * matter too much */
-	find_di(sbp, block, &di);
-	if(di) {
-		log_err("Attempting to add directory block %"PRIu64
-			" which is already in list\n", block);
-		return -1;
-	}
-
-	if(!(newdi = (struct dir_info *) malloc(sizeof(*newdi)))) {
-		log_crit("Unable to allocate dir_info structure\n");
-		return -1;
-	}
-	if(!memset(newdi, 0, sizeof(*newdi))) {
-		log_crit("Error while zeroing dir_info structure\n");
-		return -1;
-	}
-
-	newdi->dinode = block;
-	dinode_hash_insert(sbp->dir_hash, block, newdi);
-	return 0;
-}
-
-
-static int handle_di(struct fsck_sb *sdp, osi_buf_t *bh, uint64_t block, int mfree)
-{
-	struct block_query q = {0};
-	struct fsck_inode *ip;
-	int error;
-	struct block_count bc = {0};
-	struct metawalk_fxns invalidate_metatree = {0};
-	invalidate_metatree.check_metalist = clear_metalist;
-	invalidate_metatree.check_data = clear_data;
-	invalidate_metatree.check_leaf = clear_leaf;
-
-	if(copyin_inode(sdp, bh, &ip)) {
-		stack;
-		return -1;
-	}
-
-	if (ip->i_di.di_flags & GFS_DIF_UNUSED){
-		if(mfree) {
-			if(block_set(sdp->bl, block, meta_free)) {
-				stack;
-				goto fail;
-			}
-			goto success;
-		} else {
-			log_err("Found unused inode marked in-use\n");
-			errors_found++;
-			if(query(sdp, "Clear unused inode at block %"
-				 PRIu64"? (y/n) ", block)) {
-				if(block_set(sdp->bl, block, meta_inval)) {
-					stack;
-					goto fail;
-				}
-				errors_corrected++;
-				goto success;
-			} else {
-				log_err("Unused inode still marked in-use\n");
-			}
-		}
-
-	} else {
-		if(mfree) {
-			if(block_set(sdp->bl, block, meta_free)) {
-				stack;
-				goto fail;
-			}
-			goto success;
-		}
-	}
-
-	if (ip->i_di.di_num.no_addr != block) {
-		log_err("Bad dinode Address.  "
-			"Found %"PRIu64", "
-			"Expected %"PRIu64"\n",
-			ip->i_di.di_num.no_addr, block);
-		errors_found++;
-		if(query(sdp, "Fix address in inode at block %"
-			 PRIu64"? (y/n) ", block)) {
-			ip->i_di.di_num.no_addr =
-				ip->i_di.di_num.no_formal_ino =
-				block;
-			if(fs_copyout_dinode(ip)){
-				log_crit("Bad dinode address can not be reset.\n");
-				goto fail;
-			} else {
-				errors_corrected++;
-				log_err("Bad dinode address reset.\n");
-			}
-		} else {
-			log_err("Address in inode at block %"PRIu64
-				 " not fixed\n", block);
-		}
-
-	}
-
-	if(block_check(sdp->bl, block, &q)) {
-		stack;
-		goto fail;
-	}
-	if(q.block_type != block_free) {
-		log_err("Found duplicate block referenced as an inode at #%"
-			PRIu64"\n", block);
-		if(block_mark(sdp->bl, block, dup_block)) {
-			stack;
-			goto fail;
-		}
-		goto success;
-	}
-
-	switch(ip->i_di.di_type) {
-
-	case GFS_FILE_DIR:
-		if(block_set(sdp->bl, block, inode_dir)) {
-			stack;
-			goto fail;
-		}
-		if(add_to_dir_list(sdp, block)) {
-			stack;
-			goto fail;
-		}
-		break;
-	case GFS_FILE_REG:
-		if(block_set(sdp->bl, block, inode_file)) {
-			stack;
-			goto fail;
-		}
-		break;
-	case GFS_FILE_LNK:
-		if(block_set(sdp->bl, block, inode_lnk)) {
-			stack;
-			goto fail;
-		}
-		break;
-	case GFS_FILE_BLK:
-		if(block_set(sdp->bl, block, inode_blk)) {
-			stack;
-			goto fail;
-		}
-		break;
-	case GFS_FILE_CHR:
-		if(block_set(sdp->bl, block, inode_chr)) {
-			stack;
-			goto fail;
-		}
-		break;
-	case GFS_FILE_FIFO:
-		if(block_set(sdp->bl, block, inode_fifo)) {
-			stack;
-			goto fail;
-		}
-		break;
-	case GFS_FILE_SOCK:
-		if(block_set(sdp->bl, block, inode_sock)) {
-			stack;
-			goto fail;
-		}
-		break;
-	default:
-		if(block_set(sdp->bl, block, meta_inval)) {
-			stack;
-			goto fail;
-		}
-		fs_set_bitmap(sdp, block, GFS_BLKST_FREE);
-		goto success;
-	}
-	if(set_link_count(ip->i_sbd, ip->i_num.no_formal_ino,
-			  ip->i_di.di_nlink)) {
-		stack;
-		goto fail;
-	}
-
-	/* FIXME: fix height and depth here - wasn't implemented in
-	 * old fsck either, so no biggy... */
-	if (ip->i_di.di_height < compute_height(sdp, ip->i_di.di_size)){
-		log_warn("Dinode #%"PRIu64" has bad height  "
-			 "Found %u, Expected >= %u\n",
-			 ip->i_di.di_num.no_addr, ip->i_di.di_height,
-			 compute_height(sdp, ip->i_di.di_size));
-			/* once implemented, remove continue statement */
-		log_warn("Marking inode %lld invalid\n",
-			 ip->i_di.di_num.no_addr);
-		if(block_set(sdp->bl, block, meta_inval)) {
-			stack;
-			goto fail;
-		}
-		fs_set_bitmap(sdp, block, GFS_BLKST_FREE);
-		goto success;
-	}
-
-	if (ip->i_di.di_type == (GFS_FILE_DIR &&
-				 (ip->i_di.di_flags & GFS_DIF_EXHASH))) {
-		if (((1 << ip->i_di.di_depth) * sizeof(uint64_t)) !=
-		    ip->i_di.di_size) {
-			log_warn("Directory dinode #%"PRIu64" has bad depth.  "
-				 "Found %u, Expected %u\n",
-				 ip->i_di.di_num.no_addr, ip->i_di.di_depth,
-				 (1 >> (ip->i_di.di_size/sizeof(uint64))));
-			/* once implemented, remove continue statement */
-			log_warn("Marking inode %lld invalid\n",
-				 ip->i_di.di_num.no_addr);
-			if(block_set(sdp->bl, block, meta_inval)) {
-				stack;
-				goto fail;
-			}
-			fs_set_bitmap(sdp, block, GFS_BLKST_FREE);
-			goto success;
-		}
-	}
-
-	pass1_fxns.private = &bc;
-
-	error = check_metatree(ip, &pass1_fxns);
-	if(fsck_abort || error < 0) {
-		return 0;
-	}
-	if(error > 0) {
-		log_warn("Marking inode %lld invalid\n",
-			 ip->i_di.di_num.no_addr);
-		/* FIXME: Must set all leaves invalid as well */
-		check_metatree(ip, &invalidate_metatree);
-		block_set(ip->i_sbd->bl, ip->i_di.di_num.no_addr, meta_inval);
-		fs_set_bitmap(sdp, block, GFS_BLKST_FREE);
-		free(ip);
-		return 0;
-	}
-
-	error = check_inode_eattr(ip, &pass1_fxns);
-
-	if (error && !(ip->i_di.di_flags & GFS_DIF_EA_INDIRECT))
-		ask_remove_inode_eattr(ip, &bc);
-
-	if (ip->i_di.di_blocks !=
-	    (1 + bc.indir_count + bc.data_count + bc.ea_count)) {
-		osi_buf_t	*di_bh;
-
-		log_err("Ondisk block count does not match what fsck"
-			" found for inode %"PRIu64"\n", ip->i_di.di_num.no_addr);
-		log_info("inode has: %lld, but fsck counts: Dinode:1 + indir:"
-			 "%lld + data: %lld + ea: %lld\n",
-			 ip->i_di.di_blocks, bc.indir_count, bc.data_count,
-			 bc.ea_count);
-		errors_found++;
-		if(query(sdp, "Fix ondisk block count? (y/n) ")) {
-			ip->i_di.di_blocks = 1 + bc.indir_count +
-				bc.data_count + bc.ea_count;
-			if(get_and_read_buf(sdp, ip->i_di.di_num.no_addr,
-					    &di_bh, 0)){
-				stack;
-				log_crit("Bad block count remains\n");
-			} else {
-				gfs_dinode_out(&ip->i_di, BH_DATA(di_bh));
-				if(write_buf(ip->i_sbd, di_bh, 0) < 0){
-					stack;
-					log_crit("Bad block count remains\n");
-				} else {
-					errors_corrected++;
-					log_err("Bad block count fixed\n");
-				}
-				relse_buf(sdp, di_bh);
-			}
-		} else {
-			log_err("Bad block count for %"PRIu64" not fixed\n",
-				ip->i_di.di_num.no_addr);
-		}
-	}
-
- success:
-	free(ip);
-	return 0;
-
- fail:
-	free(ip);
-	return -1;
-
-}
-
-
-static int scan_meta(struct fsck_sb *sdp, osi_buf_t *bh, uint64_t block, int mfree)
-{
-	if (check_meta(bh, 0)) {
-		errors_found++;
-		log_err("Found invalid metadata block at %"PRIu64"\n", block);
-		if(block_set(sdp->bl, block, meta_inval)) {
-			stack;
-			return -1;
-		}
-		if(query(sdp, "Okay to free the invalid block? (y/n)")) {
-			errors_corrected++;
-			fs_set_bitmap(sdp, block, GFS_BLKST_FREE);
-			log_err("The invalid block was freed.\n");
-		} else {
-			log_err("The invalid block was ignored.\n");
-		}
-		return 0;
-	}
-
-	log_debug("Checking metadata block %"PRIu64"\n", block);
-
-	if (!check_type(bh, GFS_METATYPE_DI)) {
-		if(handle_di(sdp, bh, block, mfree)) {
-			stack;
-			return -1;
-		}
-	}
-	/* Ignore everything else - they should be hit by the handle_di step.
-	 * Don't check NONE either, because check_meta passes everything if
-	 * GFS_METATYPE_NONE is specified.
-	 * Hopefully, other metadata types such as indirect blocks will be
-	 * handled when the inode itself is processed, and if it's not, it
-	 * should be caught in pass5. */
-	return 0;
-}
-
-/**
- * pass1 - walk through inodes and check inode state
- *
- * this walk can be done using root inode and depth first search,
- * watching for repeat inode numbers
- *
- * format & type
- * link count
- * duplicate blocks
- * bad blocks
- * inodes size
- * dir info
- */
-int pass1(struct fsck_sb *sbp)
-{
-	osi_buf_t *bh;
-	osi_list_t *tmp;
-	uint64_t block;
-	struct fsck_rgrp *rgd;
-	int first;
-	uint64_t i;
-	uint64_t j;
-	uint64_t blk_count;
-	uint64_t offset;
-	uint64_t rg_count = 0;
-	int mfree = 0;
-
-	/* FIXME: What other metadata should we look for? */
-
-	/* Mark the journal blocks as 'other metadata' */
-	for (i = 0; i < sbp->journals; i++) {
-		struct gfs_jindex *ji;
-		ji = &sbp->jindex[i];
-		for(j = ji->ji_addr;
-		    j < ji->ji_addr + (ji->ji_nsegment * sbp->sb.sb_seg_size);
-		    j++) {
-			if(block_set(sbp->bl, j, journal_blk)) {
-				stack;
-				return FSCK_ERROR;
-			}
-		}
-	}
-
-
-	/* So, do we do a depth first search starting at the root
-	 * inode, or use the rg bitmaps, or just read every fs block
-	 * to find the inodes?  If we use the depth first search, why
-	 * have pass3 at all - if we use the rg bitmaps, pass5 is at
-	 * least partially invalidated - if we read every fs block,
-	 * things will probably be intolerably slow.  The current fsck
-	 * uses the rg bitmaps, so maybe that's the best way to start
-	 * things - we can change the method later if necessary.
-	 */
-
-	for (tmp = sbp->rglist.next; tmp != &sbp->rglist;
-	     tmp = tmp->next, rg_count++){
-		log_info("Checking metadata in Resource Group %"PRIu64"\n",
-			 rg_count);
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-		if(fs_rgrp_read(rgd, FALSE)){
-			stack;
-			return FSCK_ERROR;
-		}
-		log_debug("RG at %"PRIu64" is %u long\n", rgd->rd_ri.ri_addr,
-				  rgd->rd_ri.ri_length);
-		for (i = 0; i < rgd->rd_ri.ri_length; i++) {
-			if(block_set(sbp->bl, rgd->rd_ri.ri_addr + i,
-				     meta_other)){
-				stack;
-				return FSCK_ERROR;
-			}
-		}
-
-		offset = sizeof(struct gfs_rgrp);
-		blk_count = 1;
-		first = 1;
-
-		while (1) {
-			/* "block" is relative to the entire file system */
-			if(next_rg_meta_free(rgd, &block, first, &mfree))
-				break;
-			warm_fuzzy_stuff(block);
-			if (fsck_abort) /* if asked to abort */
-				return FSCK_OK;
-			if (skip_this_pass) {
-				printf("Skipping pass 1 is not a good idea.\n");
-				skip_this_pass = FALSE;
-				fflush(stdout);
-			}
-			if(get_and_read_buf(sbp, block, &bh, 0)){
-				stack;
-				log_crit("Unable to retrieve block %"PRIu64
-					 "\n", block);
-				fs_rgrp_relse(rgd);
-				return FSCK_ERROR;
-			}
-
-			if(scan_meta(sbp, bh, block, mfree)) {
-				stack;
-				relse_buf(sbp, bh);
-				fs_rgrp_relse(rgd);
-				return FSCK_ERROR;
-			}
-			relse_buf(sbp, bh);
-			first = 0;
-		}
-		fs_rgrp_relse(rgd);
-	}
-
-	return FSCK_OK;
-}
diff --git a/gfs/gfs_fsck/pass1b.c b/gfs/gfs_fsck/pass1b.c
deleted file mode 100644
index 7a89d32..0000000
--- a/gfs/gfs_fsck/pass1b.c
+++ /dev/null
@@ -1,563 +0,0 @@
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "osi_list.h"
-#include "bio.h"
-#include "fs_inode.h"
-#include "block_list.h"
-#include "util.h"
-#include "inode.h"
-#include "inode_hash.h"
-#include "metawalk.h"
-
-struct inode_with_dups {
-	osi_list_t list;
-	uint64_t block_no;
-	int dup_count;
-	int ea_only;
-	uint64_t parent;
-	char *name;
-};
-
-struct blocks {
-	osi_list_t list;
-	uint64_t block_no;
-	osi_list_t ref_inode_list;
-};
-
-struct fxn_info {
-	uint64_t block;
-	int found;
-	int ea_only;    /* The only dups were found in EAs */
-};
-
-struct dup_handler {
-	struct blocks *b;
-	struct inode_with_dups *id;
-	int ref_inode_count;
-	int ref_count;
-};
-
-static inline void inc_if_found(uint64_t block, int not_ea, void *private) {
-	struct fxn_info *fi = (struct fxn_info *) private;
-	if(block == fi->block) {
-		(fi->found)++;
-		if(not_ea)
-			fi->ea_only = 0;
-	}
-}
-
-static int check_metalist(struct fsck_inode *ip, uint64_t block,
-			  osi_buf_t **bh, void *private)
-{
-	inc_if_found(block, 1, private);
-
-	return 0;
-}
-
-static int check_data(struct fsck_inode *ip, uint64_t block, void *private)
-{
-	inc_if_found(block, 1, private);
-
-	return 0;
-}
-
-static int check_eattr_indir(struct fsck_inode *ip, uint64_t block,
-			     uint64_t parent, osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sbp = ip->i_sbd;
-	osi_buf_t *indir_bh = NULL;
-
-	inc_if_found(block, 0, private);
-	if(get_and_read_buf(sbp, block, &indir_bh, 0)){
-		log_warn("Unable to read EA leaf block #%"PRIu64".\n",
-			 block);
-		return 1;
-	}
-
-	*bh = indir_bh;
-
-	return 0;
-}
-
-static int check_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sbp = ip->i_sbd;
-	osi_buf_t *leaf_bh = NULL;
-
-	inc_if_found(block, 0, private);
-	if(get_and_read_buf(sbp, block, &leaf_bh, 0)){
-		log_err("Unable to read EA leaf block #%"PRIu64".\n",
-			 block);
-		return 1;
-	}
-
-	*bh = leaf_bh;
-	return 0;
-}
-
-static int check_eattr_entry(struct fsck_inode *ip, osi_buf_t *leaf_bh,
-			     struct gfs_ea_header *ea_hdr,
-			     struct gfs_ea_header *ea_hdr_prev,
-			     void *private)
-{
-	return 0;
-}
-
-static int check_eattr_extentry(struct fsck_inode *ip, uint64_t *ea_data_ptr,
-				osi_buf_t *leaf_bh,
-				struct gfs_ea_header *ea_hdr,
-				struct gfs_ea_header *ea_hdr_prev,
-				void *private)
-{
-	uint64_t block = gfs64_to_cpu(*ea_data_ptr);
-
-	inc_if_found(block, 0, private);
-
-	return 0;
-}
-
-static int find_dentry(struct fsck_inode *ip, struct gfs_dirent *de,
-		       struct gfs_dirent *prev,
-		       osi_buf_t *bh, char *filename, int *update,
-		       uint16_t *count, void *priv)
-{
-	osi_list_t *tmp1, *tmp2;
-	struct blocks *b;
-	struct inode_with_dups *id;
-	struct gfs_leaf leaf;
-
-	osi_list_foreach(tmp1, &ip->i_sbd->dup_list) {
-		b = osi_list_entry(tmp1, struct blocks, list);
-		osi_list_foreach(tmp2, &b->ref_inode_list) {
-			id = osi_list_entry(tmp2, struct inode_with_dups,
-					    list);
-			if(id->name)
-				/* We can only have one parent of
-				 * inodes that contain duplicate
-				 * blocks... */
-				continue;
-			if(id->block_no == de->de_inum.no_addr) {
-				id->name = strdup(filename);
-				id->parent = ip->i_di.di_num.no_addr;
-				log_debug("Duplicate block %"PRIu64
-					  " is in file or directory %"PRIu64
-					  " named %s\n", id->block_no,
-					  ip->i_di.di_num.no_addr, filename);
-				/* If there are duplicates of
-				 * duplicates, I guess we'll miss them
-				 * here */
-				break;
-			}
-		}
-	}
-	/* Return the number of leaf entries so metawalk doesn't flag this
-	   leaf as having none. */
-	gfs_leaf_in(&leaf, bh->b_data);
-	*count = leaf.lf_entries;
-	return 0;
-}
-
-static int clear_dup_metalist(struct fsck_inode *ip, uint64_t block,
-			      osi_buf_t **bh, void *private)
-{
-	struct dup_handler *dh = (struct dup_handler *) private;
-
-	if(dh->ref_count == 1)
-		return 1;
-	if(block == dh->b->block_no) {
-		log_err("Found duplicate reference in inode \"%s\" at block #%"
-			PRIu64 " to block #%"PRIu64"\n",
-			dh->id->name ? dh->id->name : "unknown name",
-			ip->i_di.di_num.no_addr, block);
-		log_err("Inode %s is in directory %"PRIu64"\n",
-			dh->id->name ? dh->id->name : "",
-			dh->id->parent);
-		inode_hash_remove(ip->i_sbd->inode_hash, ip->i_di.di_num.no_addr);
-		/* Setting the block to invalid means the inode is
-		 * cleared in pass2 */
-		block_set(ip->i_sbd->bl, ip->i_di.di_num.no_addr, meta_inval);
-	}
-	return 0;
-}
-static int clear_dup_data(struct fsck_inode *ip, uint64_t block, void *private)
-{
-	return clear_dup_metalist(ip, block, NULL, private);
-}
-static int clear_dup_eattr_indir(struct fsck_inode *ip, uint64_t block,
-				 uint64_t parent, osi_buf_t **bh,
-				 void *private)
-{
-	struct dup_handler *dh = (struct dup_handler *) private;
-	/* Can't use fxns from eattr.c since we need to check the ref
-	 * count */
-	*bh = NULL;
-	if(dh->ref_count == 1)
-		return 1;
-	if(block == dh->b->block_no) {
-		log_err("Found dup in inode \"%s\" (block #%"PRIu64
-			") with block #%"PRIu64"\n",
-			dh->id->name ? dh->id->name : "unknown name",
-			ip->i_di.di_num.no_addr, block);
-		log_err("inode %s is in directory %"PRIu64"\n",
-			dh->id->name ? dh->id->name : "",
-			dh->id->parent);
-		block_set(ip->i_sbd->bl, ip->i_di.di_eattr, meta_inval);
-	}
-
-	return 0;
-}
-static int clear_dup_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-				uint64_t parent, osi_buf_t **bh, void *private)
-{
-	struct dup_handler *dh = (struct dup_handler *) private;
-	if(dh->ref_count == 1)
-		return 1;
-	if(block == dh->b->block_no) {
-		log_err("Found dup in inode \"%s\" (block #%"PRIu64
-			") with block #%"PRIu64"\n",
-			dh->id->name ? dh->id->name : "unknown name",
-			ip->i_di.di_num.no_addr, block);
-		log_err("inode %s is in directory %"PRIu64"\n",
-			dh->id->name ? dh->id->name : "",
-			dh->id->parent);
-
-		/* mark the main eattr block invalid */
-		block_set(ip->i_sbd->bl, ip->i_di.di_eattr, meta_inval);
-	}
-
-	return 0;
-}
-
-static int clear_eattr_entry (struct fsck_inode *ip,
-		       osi_buf_t *leaf_bh,
-		       struct gfs_ea_header *ea_hdr,
-		       struct gfs_ea_header *ea_hdr_prev,
-		       void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	char ea_name[256];
-
-	if(!ea_hdr->ea_name_len){
-		/* Skip this entry for now */
-		return 1;
-	}
-
-	memset(ea_name, 0, sizeof(ea_name));
-	strncpy(ea_name, (char *)ea_hdr + sizeof(struct gfs_ea_header),
-		ea_hdr->ea_name_len);
-
-	if(!GFS_EATYPE_VALID(ea_hdr->ea_type) &&
-	   ((ea_hdr_prev) || (!ea_hdr_prev && ea_hdr->ea_type))){
-		/* Skip invalid entry */
-		return 1;
-	}
-
-	if(ea_hdr->ea_num_ptrs){
-		uint32 avail_size;
-		int max_ptrs;
-
-		avail_size = sdp->sb.sb_bsize - sizeof(struct gfs_meta_header);
-		max_ptrs = (gfs32_to_cpu(ea_hdr->ea_data_len)+avail_size-1)/avail_size;
-
-		if(max_ptrs > ea_hdr->ea_num_ptrs) {
-			return 1;
-		} else {
-			log_debug("  Pointers Required: %d\n"
-				  "  Pointers Reported: %d\n",
-				  max_ptrs,
-				  ea_hdr->ea_num_ptrs);
-		}
-	}
-	return 0;
-}
-
-static int clear_eattr_extentry(struct fsck_inode *ip, uint64_t *ea_data_ptr,
-			 osi_buf_t *leaf_bh, struct gfs_ea_header *ea_hdr,
-			 struct gfs_ea_header *ea_hdr_prev, void *private)
-{
-	uint64_t block = gfs64_to_cpu(*ea_data_ptr);
-	struct dup_handler *dh = (struct dup_handler *) private;
-	if(dh->ref_count == 1)
-		return 1;
-	if(block == dh->b->block_no) {
-		log_err("Found dup in inode \"%s\" (block #%"PRIu64
-			") with block #%"PRIu64"\n",
-			dh->id->name ? dh->id->name : "unknown name",
-			ip->i_di.di_num.no_addr, block);
-		log_err("inode %s is in directory %"PRIu64"\n",
-			dh->id->name ? dh->id->name : "",
-			dh->id->parent);
-		/* mark the main eattr block invalid */
-		block_set(ip->i_sbd->bl, ip->i_di.di_eattr, meta_inval);
-	}
-
-	return 0;
-
-}
-
-/* Finds all references to duplicate blocks in the metadata */
-static int find_block_ref(struct fsck_sb *sbp, uint64_t inode, struct blocks *b)
-{
-	struct fsck_inode *ip;
-	struct fxn_info myfi = {b->block_no, 0, 1};
-	struct inode_with_dups *id = NULL;
-	struct metawalk_fxns find_refs = {
-		.private = (void*) &myfi,
-		.check_leaf = NULL,
-		.check_metalist = check_metalist,
-		.check_data = check_data,
-		.check_eattr_indir = check_eattr_indir,
-		.check_eattr_leaf = check_eattr_leaf,
-		.check_dentry = NULL,
-		.check_eattr_entry = check_eattr_entry,
-		.check_eattr_extentry = check_eattr_extentry,
-	};
-
-	if(load_inode(sbp, inode, &ip)) {
-		stack;
-		return -1;
-	}
-	log_debug("Checking inode %"PRIu64"'s metatree for references to "
-		  "block %"PRIu64"\n", inode, b->block_no);
-	if(check_metatree(ip, &find_refs)) {
-		stack;
-		free_inode(&ip);
-		return -1;
-	}
-	log_debug("Done checking metatree\n");
-	/* Check for ea references in the inode */
-	if(check_inode_eattr(ip, &find_refs) < 0){
-		stack;
-		free_inode(&ip);
-		return -1;
-	}
-	if (myfi.found) {
-		if(!(id = malloc(sizeof(*id)))) {
-			log_crit("Unable to allocate inode_with_dups structure\n");
-			return -1;
-		}
-		if(!(memset(id, 0, sizeof(*id)))) {
-			log_crit("Unable to zero inode_with_dups structure\n");
-			return -1;
-		}
-		log_debug("Found %d entries with block %"PRIu64
-			  " in inode #%"PRIu64"\n",
-			  myfi.found, b->block_no, inode);
-		id->dup_count = myfi.found;
-		id->block_no = inode;
-		id->ea_only = myfi.ea_only;
-		osi_list_add_prev(&id->list, &b->ref_inode_list);
-	}
-	free_inode(&ip);
-	return 0;
-}
-
-/* Finds all blocks marked in the duplicate block bitmap */
-static int find_dup_blocks(struct fsck_sb *sbp)
-{
-	uint64_t block_no = 0;
-	struct blocks *b;
-
-	while (!find_next_block_type(sbp->bl, dup_block, &block_no)) {
-		if(!(b = malloc(sizeof(*b)))) {
-			log_crit("Unable to allocate blocks structure\n");
-			return -1;
-		}
-		if(!memset(b, 0, sizeof(*b))) {
-			log_crit("Unable to zero blocks structure\n");
-			return -1;
-		}
-		b->block_no = block_no;
-		osi_list_init(&b->ref_inode_list);
-		log_notice("Found dup block at %"PRIu64"\n", block_no);
-		osi_list_add(&b->list, &sbp->dup_list);
-		block_no++;
-	}
-	return 0;
-}
-
-static int handle_dup_blk(struct fsck_sb *sbp, struct blocks *b)
-{
-	osi_list_t *tmp;
-	struct inode_with_dups *id;
-	struct metawalk_fxns clear_dup_fxns = {
-		.private = NULL,
-		.check_leaf = NULL,
-		.check_metalist = clear_dup_metalist,
-		.check_data = clear_dup_data,
-		.check_eattr_indir = clear_dup_eattr_indir,
-		.check_eattr_leaf = clear_dup_eattr_leaf,
-		.check_dentry = NULL,
-		.check_eattr_entry = clear_eattr_entry,
-		.check_eattr_extentry = clear_eattr_extentry,
-	};
-	struct fsck_inode *ip;
-	struct dup_handler dh = {0};
-
-	osi_list_foreach(tmp, &b->ref_inode_list) {
-		id = osi_list_entry(tmp, struct inode_with_dups, list);
-		dh.ref_inode_count++;
-		dh.ref_count += id->dup_count;
-	}
-	/* A single reference to the block implies a possible situation where
-	   a data pointer points to a metadata block.  In other words, the
-	   duplicate reference in the file system is (1) Metadata block X and
-	   (2) A dinode reference such as a data pointer pointing to block X.
-	   We can't really check for that in pass1 because user data might
-	   just _look_ like metadata by coincidence, and at the time we're
-	   checking, we might not have processed the referenced block.
-	   Here in pass1b we're sure. */
-	if (dh.ref_count == 1) {
-		osi_buf_t *bh;
-		uint32_t cmagic;
-
-		get_and_read_buf(sbp, b->block_no, &bh, 0);
-		cmagic = ((struct gfs_meta_header *)(bh->b_data))->mh_magic;
-		relse_buf(sbp, bh);
-		if (be32_to_cpu(cmagic) == GFS_MAGIC) {
-			tmp = b->ref_inode_list.next;
-			id = osi_list_entry(tmp, struct inode_with_dups, list);
-			log_warn("Inode %s (%lld) has a reference to "
-				 "data block %"PRIu64", but "
-				 "the block is really metadata.\n",
-				 id->name, id->block_no, b->block_no);
-			errors_found++;
-			if (query(sbp, "Clear the inode? (y/n) ")) {
-				errors_corrected++;
-				log_warn("Clearing inode %lld...\n",
-					 id->block_no);
-				load_inode(sbp, id->block_no, &ip);
-				inode_hash_remove(ip->i_sbd->inode_hash,
-						  ip->i_di.di_num.no_addr);
-				/* Setting the block to invalid means the inode
-				   is cleared in pass2 */
-				block_set(sbp->bl, ip->i_di.di_num.no_addr,
-					  meta_inval);
-				free_inode(&ip);
-			} else {
-				log_warn("The bad inode was not cleared.");
-			}
-			return 0;
-		}
-	}
-
-	log_notice("Block %"PRIu64" has %d inodes referencing it for "
-		   "a total of %d duplicate references.\n",
-		   b->block_no, dh.ref_inode_count, dh.ref_count);
-
-	osi_list_foreach(tmp, &b->ref_inode_list) {
-		id = osi_list_entry(tmp, struct inode_with_dups, list);
-		log_warn("Inode %s (%lld) has %d reference(s) to block %"PRIu64
-			 "\n", id->name, id->block_no, id->dup_count,
-			 b->block_no);
-	}
-	osi_list_foreach(tmp, &b->ref_inode_list) {
-		id = osi_list_entry(tmp, struct inode_with_dups, list);
-		errors_found++;
-		if (!query(sbp, "Okay to clear inode %lld? (y/n) ",
-			   id->block_no)) {
-			log_warn("The inode %lld was not cleared...\n",
-				 id->block_no);
-			continue;
-		}
-		errors_corrected++;
-		log_warn("Clearing inode %lld...\n", id->block_no);
-		load_inode(sbp, id->block_no, &ip);
-		dh.b = b;
-		dh.id = id;
-		clear_dup_fxns.private = (void *) &dh;
-		/* Clear the EAs for the inode first */
-		check_inode_eattr(ip, &clear_dup_fxns);
-		/* If the dup wasn't only in the EA, clear the inode */
-		if(!id->ea_only)
-			check_metatree(ip, &clear_dup_fxns);
-
-		block_set(sbp->bl, id->block_no, meta_inval);
-		free_inode(&ip);
-		dh.ref_inode_count--;
-		if(dh.ref_inode_count == 1)
-			break;
-		/* Inode is marked invalid and is removed in pass2 */
-		/* FIXME: other option should be to duplicate the
-		 * block for each duplicate and point the metadata at
-		 * the cloned blocks */
-	}
-	return 0;
-
-}
-
-/* Pass 1b handles finding the previous inode for a duplicate block
- * When found, store the inodes pointing to the duplicate block for
- * use in pass2 */
-int pass1b(struct fsck_sb *sbp)
-{
-	struct blocks *b;
-	uint64_t i;
-	struct block_query q;
-	osi_list_t *tmp = NULL, *x;
-	struct metawalk_fxns find_dirents = {0};
-	int rc = FSCK_OK;
-
-	find_dirents.check_dentry = &find_dentry;
-
-	osi_list_init(&sbp->dup_list);
-	/* Shove all blocks marked as duplicated into a list */
-	log_info("Looking for duplicate blocks...\n");
-	find_dup_blocks(sbp);
-
-	/* If there were no dups in the bitmap, we don't need to do anymore */
-	if(osi_list_empty(&sbp->dup_list)) {
-		log_info("No duplicate blocks found\n");
-		return FSCK_OK;
-	}
-
-	/* Rescan the fs looking for pointers to blocks that are in
-	 * the duplicate block map */
-	log_info("Scanning filesystem for inodes containing duplicate blocks...\n");
-	log_debug("Filesystem has %"PRIu64" blocks total\n", sbp->last_fs_block);
-	for(i = 0; i < sbp->last_fs_block; i += 1) {
-		warm_fuzzy_stuff(i);
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			goto out;
-		log_debug("Scanning block %"PRIu64" for inodes\n", i);
-		if(block_check(sbp->bl, i, &q)) {
-			stack;
-			rc = FSCK_ERROR;
-			goto out;
-		}
-		if((q.block_type == inode_dir) ||
-		   (q.block_type == inode_file) ||
-		   (q.block_type == inode_lnk) ||
-		   (q.block_type == inode_blk) ||
-		   (q.block_type == inode_chr) ||
-		   (q.block_type == inode_fifo) ||
-		   (q.block_type == inode_sock)) {
-			osi_list_foreach_safe(tmp, &sbp->dup_list, x) {
-				b = osi_list_entry(tmp, struct blocks, list);
-				if(find_block_ref(sbp, i, b)) {
-					stack;
-					rc = FSCK_ERROR;
-					goto out;
-				}
-			}
-		}
-		if(q.block_type == inode_dir) {
-			check_dir(sbp, i, &find_dirents);
-		}
-	}
-
-	/* Fix dups here - it's going to slow things down a lot to fix
-	 * it later */
-	log_info("Handling duplicate blocks\n");
-out:
-	/*osi_list_foreach(tmp, &sbp->dup_list) {*/
-	while (!osi_list_empty(&sbp->dup_list)) {
-		b = osi_list_entry(sbp->dup_list.next, struct blocks, list);
-		if (!skip_this_pass && !rc) /* no error & not asked to skip the rest */
-			handle_dup_blk(sbp, b);
-		osi_list_del(&b->list);
-		free(b);
-	}
-	return rc;
-}
diff --git a/gfs/gfs_fsck/pass1c.c b/gfs/gfs_fsck/pass1c.c
deleted file mode 100644
index 2e68173..0000000
--- a/gfs/gfs_fsck/pass1c.c
+++ /dev/null
@@ -1,290 +0,0 @@
-#include "fsck.h"
-#include "fsck_incore.h"
-#include "fs_inode.h"
-#include "bio.h"
-#include "inode.h"
-#include "util.h"
-#include "block_list.h"
-#include "metawalk.h"
-
-static int remove_eattr_entry(struct fsck_sb *sdp, osi_buf_t *leaf_bh,
-			struct gfs_ea_header *curr,
-			struct gfs_ea_header *prev)
-{
-	if(!prev)
-		curr->ea_type = GFS_EATYPE_UNUSED;
-	else {
-		uint32_t tmp32 = gfs32_to_cpu(curr->ea_rec_len) +
-			gfs32_to_cpu(prev->ea_rec_len);
-		prev->ea_rec_len = cpu_to_gfs32(tmp32);
-		if (curr->ea_flags & GFS_EAFLAG_LAST)
-			prev->ea_flags |= GFS_EAFLAG_LAST;
-	}
-	if(write_buf(sdp, leaf_bh, 0)){
-		stack;
-		log_err("EA removal failed.\n");
-		return -1;
-	}
-	log_err("Bad Extended Attribute at block #%"PRIu64" removed.\n",
-		 BH_BLKNO(leaf_bh));
-	return 0;
-}
-
-static int ask_remove_eattr_entry(struct fsck_sb *sdp, osi_buf_t *leaf_bh,
-				  struct gfs_ea_header *curr,
-				  struct gfs_ea_header *prev,
-				  int fix_curr, int fix_curr_len)
-{
-	errors_found++;
-	if (query(sdp, "Remove the bad Extended Attribute? (y/n) ")) {
-		if (fix_curr)
-			curr->ea_flags |= GFS_EAFLAG_LAST;
-		if (fix_curr_len) {
-			uint32_t max_size = sdp->sb.sb_bsize;
-			uint32_t offset = (uint32_t)(((unsigned long)curr) -
-					     ((unsigned long)leaf_bh->b_data));
-			curr->ea_rec_len = cpu_to_be32(max_size - offset);
-		}
-		if (remove_eattr_entry(sdp, leaf_bh, curr, prev)) {
-			stack;
-			return -1;
-		}
-		errors_corrected++;
-	} else {
-		log_err("Bad Extended Attribute not removed.\n");
-	}
-	return 1;
-}
-
-static int ask_remove_eattr(struct fsck_inode *ip)
-{
-	errors_found++;
-	if (query(ip->i_sbd, "Remove the bad Extended Attribute? (y/n) ")) {
-		ip->i_di.di_eattr = 0;
-		if (fs_copyout_dinode(ip))
-			log_err("Bad Extended Attribute could not be "
-				"removed.\n");
-		else {
-			errors_corrected++;
-			log_err("Bad Extended Attribute removed.\n");
-		}
-	} else
-		log_err("Bad Extended Attribute not removed.\n");
-	return 1;
-}
-
-static int check_eattr_indir(struct fsck_inode *ip, uint64_t block,
-			     uint64_t parent, osi_buf_t **bh,
-			     void *private)
-{
-	int *update = (int *) private;
-	struct fsck_sb *sbp = ip->i_sbd;
-	struct block_query q;
-	osi_buf_t *indir_bh = NULL;
-
-	*update = 0;
-	if(check_range(sbp, block)) {
-		log_err("Extended attributes indirect block #%llu"
-			" for inode #%llu is out of range.\n",
-			(unsigned long long)block,
-			(unsigned long long)ip->i_num.no_addr);
-		return ask_remove_eattr(ip);
-	}
-	else if (block_check(sbp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	else if(q.block_type != indir_blk) {
-		log_err("Extended attributes indirect block #%llu"
-			" for inode #%llu is invalid.\n",
-			(unsigned long long)block,
-			(unsigned long long)ip->i_num.no_addr);
-		return ask_remove_eattr(ip);
-	}
-	else if(get_and_read_buf(sbp, block, &indir_bh, 0)){
-		log_warn("Unable to read Extended Attribute leaf block "
-			 "#%"PRIu64".\n", block);
-		return ask_remove_eattr(ip);
-	}
-
-	*bh = indir_bh;
-	return 0;
-}
-
-static int check_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, osi_buf_t **bh, void *private)
-{
-	struct fsck_sb *sbp = ip->i_sbd;
-	struct block_query q;
-	osi_buf_t *leaf_bh;
-
-	if(check_range(sbp, block)) {
-		log_err("Extended attributes leaf block #%"PRIu64
-			" for inode #%" PRIu64 " is out of range.\n",
-			block, ip->i_num.no_addr);
-		return ask_remove_eattr(ip);
-	}
-	else if (block_check(sbp->bl, block, &q)) {
-		stack;
-		return -1;
-	}
-	else if(q.block_type != meta_eattr) {
-		log_err("Extended attributes leaf block #%"PRIu64
-			" for inode #%" PRIu64 " is invalid.\n",
-			block, ip->i_num.no_addr);
-		return ask_remove_eattr(ip);
-	}
-	else if(get_and_read_buf(sbp, block, &leaf_bh, 0)){
-		log_warn("Unable to read Extended attributes leaf block "
-			 "#%"PRIu64".\n", block);
-		return ask_remove_eattr(ip);
-	}
-
-	*bh = leaf_bh;
-	return 0;
-}
-
-static int check_eattr_entry(struct fsck_inode *ip,
-			     osi_buf_t *leaf_bh,
-			     struct gfs_ea_header *ea_hdr,
-			     struct gfs_ea_header *ea_hdr_prev,
-			     void *private)
-{
-	struct fsck_sb *sdp = ip->i_sbd;
-	char ea_name[256];
-	uint32_t offset = (uint32_t)(((unsigned long)ea_hdr) -
-			                  ((unsigned long)BH_DATA(leaf_bh)));
-	uint32_t max_size = sdp->sb.sb_bsize;
-	if(!ea_hdr->ea_rec_len){
-		log_err("EA has rec length == 0\n");
-		return ask_remove_eattr_entry(sdp, leaf_bh, ea_hdr,
-					      ea_hdr_prev, 1, 1);
-	}
-	if(offset + gfs32_to_cpu(ea_hdr->ea_rec_len) > max_size){
-		log_err("EA rec length too long\n");
-		return ask_remove_eattr_entry(sdp, leaf_bh, ea_hdr,
-					      ea_hdr_prev, 1, 1);
-	}
-	if(offset + gfs32_to_cpu(ea_hdr->ea_rec_len) == max_size &&
-	   (ea_hdr->ea_flags & GFS_EAFLAG_LAST) == 0){
-		log_err("last EA has no last entry flag\n");
-		return ask_remove_eattr_entry(sdp, leaf_bh, ea_hdr,
-					      ea_hdr_prev, 0, 0);
-	}
-	if(!ea_hdr->ea_name_len){
-		log_err("EA has name length == 0\n");
-		return ask_remove_eattr_entry(sdp, leaf_bh, ea_hdr,
-					      ea_hdr_prev, 0, 0);
-	}
-
-	memset(ea_name, 0, sizeof(ea_name));
-	strncpy(ea_name, (char *)ea_hdr + sizeof(struct gfs_ea_header),
-		ea_hdr->ea_name_len);
-
-	if(!GFS_EATYPE_VALID(ea_hdr->ea_type) &&
-	   ((ea_hdr_prev) || (!ea_hdr_prev && ea_hdr->ea_type))){
-		log_err("EA (%s) type is invalid (%d > %d).\n",
-			ea_name, ea_hdr->ea_type, GFS_EATYPE_LAST);
-		return ask_remove_eattr_entry(sdp, leaf_bh, ea_hdr,
-					      ea_hdr_prev, 0, 0);
-	}
-
-	if(ea_hdr->ea_num_ptrs){
-		uint32 avail_size;
-		int max_ptrs;
-
-		avail_size = sdp->sb.sb_bsize - sizeof(struct gfs_meta_header);
-		max_ptrs = (gfs32_to_cpu(ea_hdr->ea_data_len)+avail_size-1)/avail_size;
-
-		if(max_ptrs > ea_hdr->ea_num_ptrs){
-			log_err("EA (%s) has incorrect number of pointers.\n", ea_name);
-			log_err("  Required:  %d\n"
-				"  Reported:  %d\n",
-				max_ptrs, ea_hdr->ea_num_ptrs);
-			return ask_remove_eattr_entry(sdp, leaf_bh, ea_hdr,
-						      ea_hdr_prev, 0, 0);
-		} else {
-			log_debug("  Pointers Required: %d\n"
-				  "  Pointers Reported: %d\n",
-				  max_ptrs, ea_hdr->ea_num_ptrs);
-		}
-	}
-	return 0;
-}
-
-static int check_eattr_extentry(struct fsck_inode *ip, uint64_t *ea_ptr,
-			 osi_buf_t *leaf_bh,
-			 struct gfs_ea_header *ea_hdr,
-			 struct gfs_ea_header *ea_hdr_prev,
-			 void *private)
-{
-	struct block_query q;
-	struct fsck_sb *sbp = ip->i_sbd;
-
-	if(block_check(sbp->bl, gfs64_to_cpu(*ea_ptr), &q)) {
-		stack;
-		return -1;
-	}
-	if(q.block_type != meta_eattr) {
-		if(remove_eattr_entry(sbp, leaf_bh, ea_hdr, ea_hdr_prev)){
-			stack;
-			return -1;
-		}
-		return 1;
-	}
-	return 0;
-}
-
-/* Go over all inodes with extended attributes and verify the EAs are
- * valid */
-int pass1c(struct fsck_sb *sbp)
-{
-	uint64_t block_no = 0;
-	osi_buf_t *bh;
-	struct fsck_inode *ip = NULL;
-	int update = 0;
-	struct metawalk_fxns pass1c_fxns = { 0 };
-	int error = 0;
-
-	pass1c_fxns.check_eattr_indir = &check_eattr_indir;
-	pass1c_fxns.check_eattr_leaf = &check_eattr_leaf;
-	pass1c_fxns.check_eattr_entry = &check_eattr_entry;
-	pass1c_fxns.check_eattr_extentry = &check_eattr_extentry;
-	pass1c_fxns.private = (void *) &update;
-
-	log_info("Looking for inodes containing ea blocks...\n");
-	while (!find_next_block_type(sbp->bl, eattr_block, &block_no)) {
-
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return FSCK_OK;
-		log_info("EA in inode %"PRIu64"\n", block_no);
-		if(get_and_read_buf(sbp, block_no, &bh, 0)) {
-			stack;
-			return FSCK_ERROR;
-		}
-		if(copyin_inode(sbp, bh, &ip)) {
-			stack;
-			return FSCK_ERROR;
-		}
-
-		block_unmark(sbp->bl, block_no, eattr_block);
-		log_debug("Found eattr at %"PRIu64"\n", ip->i_di.di_eattr);
-		/* FIXME: Handle walking the eattr here */
-		error = check_inode_eattr(ip, &pass1c_fxns);
-		if(error < 0) {
-			stack;
-			return FSCK_ERROR;
-		}
-
-		if(update) {
-			gfs_dinode_out(&ip->i_di, BH_DATA(bh));
-			write_buf(sbp, bh, 0);
-		}
-
-		free_inode(&ip);
-		relse_buf(sbp, bh);
-
-		block_no++;
-	}
-	return FSCK_OK;
-}
diff --git a/gfs/gfs_fsck/pass2.c b/gfs/gfs_fsck/pass2.c
deleted file mode 100644
index 31c5ad7..0000000
--- a/gfs/gfs_fsck/pass2.c
+++ /dev/null
@@ -1,962 +0,0 @@
-#include "stdio.h"
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "block_list.h"
-#include "bio.h"
-#include "fs_inode.h"
-#include "fs_dir.h"
-#include "util.h"
-#include "log.h"
-#include "inode_hash.h"
-#include "inode.h"
-#include "link.h"
-#include "metawalk.h"
-#include "eattr.h"
-
-#define MAX_FILENAME 256
-
-struct dir_status {
-	uint8_t dotdir:1;
-	uint8_t dotdotdir:1;
-	struct block_query q;
-	uint32_t entry_count;
-};
-
-
-/* Set children's parent inode in dir_info structure - ext2 does not set
- * dotdot inode here, but instead in pass3 - should we? */
-static int set_parent_dir(struct fsck_sb *sbp, uint64_t childblock,
-		   uint64_t parentblock)
-{
-	struct dir_info *di;
-
-	if(!find_di(sbp, childblock, &di)) {
-		if(di->dinode == childblock) {
-			if (di->treewalk_parent) {
-				log_err("Another directory (%"PRIu64
-					") already contains"
-					" this child - checking %"PRIu64"\n",
-					di->treewalk_parent, parentblock);
-				return 1;
-			}
-			di->treewalk_parent = parentblock;
-		}
-	} else {
-		log_err("Unable to find block %"PRIu64" in dir_info list\n",
-			childblock);
-		return -1;
-	}
-
-	return 0;
-}
-
-/* Set's the child's '..' directory inode number in dir_info structure */
-static int set_dotdot_dir(struct fsck_sb *sbp, uint64_t childblock,
-		   uint64_t parentblock)
-{
-	struct dir_info *di;
-
-	if(!find_di(sbp, childblock, &di)) {
-		if(di->dinode == childblock) {
-			/* Special case for root inode because we set
-			 * it earlier */
-			if(di->dotdot_parent && sbp->sb.sb_root_di.no_addr
-			   != di->dinode) {
-				/* This should never happen */
-				log_crit("dotdot parent already set for"
-					 " block %"PRIu64" -> %"PRIu64"\n",
-					 childblock, di->dotdot_parent);
-				return -1;
-			}
-			di->dotdot_parent = parentblock;
-		}
-	} else {
-		log_err("Unable to find block %"PRIu64" in dir_info list\n",
-			childblock);
-		return -1;
-	}
-
-	return 0;
-
-}
-
-static int check_eattr_indir(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, osi_buf_t **bh, void *private)
-{
-
-	osi_buf_t *indir_bh;
-
-	if(get_and_read_buf(ip->i_sbd, block, &indir_bh, 0)){
-		log_warn("Unable to read EA indir block #%"PRIu64".\n",
-			 block);
-		block_set(ip->i_sbd->bl, block, meta_inval);
-		return 1;
-	}
-	*bh = indir_bh;
-
-	return 0;
-}
-static int check_eattr_leaf(struct fsck_inode *ip, uint64_t block,
-			    uint64_t parent, osi_buf_t **bh, void *private)
-{
-	osi_buf_t *leaf_bh = NULL;
-
-	if(get_and_read_buf(ip->i_sbd, block, &leaf_bh, 0)){
-		log_warn("Unable to read EA leaf block #%"PRIu64".\n",
-			 block);
-		block_set(ip->i_sbd->bl, block, meta_inval);
-		return 1;
-	}
-	*bh = leaf_bh;
-
-	return 0;
-}
-
-static int check_file_type(uint16_t de_type, uint8_t block_type)
-{
-	switch(block_type) {
-	case inode_dir:
-		if(de_type != GFS_FILE_DIR)
-			return 1;
-		break;
-	case inode_file:
-		if(de_type != GFS_FILE_REG)
-			return 1;
-		break;
-	case inode_lnk:
-		if(de_type != GFS_FILE_LNK)
-			return 1;
-		break;
-	case inode_blk:
-		if(de_type != GFS_FILE_BLK)
-			return 1;
-		break;
-	case inode_chr:
-		if(de_type != GFS_FILE_CHR)
-			return 1;
-		break;
-	case inode_fifo:
-		if(de_type != GFS_FILE_FIFO)
-			return 1;
-		break;
-	case inode_sock:
-		if(de_type != GFS_FILE_SOCK)
-			return 1;
-		break;
-	default:
-		log_err("Invalid block type\n");
-		return -1;
-		break;
-	}
-	return 0;
-}
-
-struct metawalk_fxns pass2_fxns_delete = {
-	.private = NULL,
-	.check_metalist = delete_metadata,
-	.check_data = delete_data,
-	.check_eattr_indir = delete_eattr_indir,
-	.check_eattr_leaf = delete_eattr_leaf,
-};
-
-/* FIXME: should maybe refactor this a bit - but need to deal with
- * FIXMEs internally first */
-static int check_dentry(struct fsck_inode *ip, struct gfs_dirent *dent,
-		 struct gfs_dirent *prev_de,
-		 osi_buf_t *bh, char *filename, int *update,
-		 uint16_t *count, void *priv)
-{
-	struct fsck_sb *sbp = ip->i_sbd;
-	struct block_query q = {0};
-	char tmp_name[MAX_FILENAME];
-	uint64_t entryblock;
-	struct dir_status *ds = (struct dir_status *) priv;
-	int error;
-	struct fsck_inode *entry_ip = NULL;
-	struct metawalk_fxns clear_eattrs = {0};
-	struct gfs_dirent dentry, *de;
-
-	memset(&dentry, 0, sizeof(struct gfs_dirent));
-	gfs_dirent_in(&dentry, (char *)dent);
-	de = &dentry;
-
-	clear_eattrs.check_eattr_indir = clear_eattr_indir;
-	clear_eattrs.check_eattr_leaf = clear_eattr_leaf;
-	clear_eattrs.check_eattr_entry = clear_eattr_entry;
-	clear_eattrs.check_eattr_extentry = clear_eattr_extentry;
-
-	entryblock = de->de_inum.no_addr;
-
-	/* Start of checks */
-	if (de->de_rec_len < GFS_DIRENT_SIZE(de->de_name_len)){
-		log_err("Dir entry with bad record or name length\n"
-			"\tRecord length = %u\n"
-			"\tName length = %u\n",
-			de->de_rec_len,
-			de->de_name_len);
-		block_set(sbp->bl, ip->i_num.no_addr, meta_inval);
-		return 1;
-		/* FIXME: should probably delete the entry here at the
-		 * very least - maybe look at attempting to fix it */
-	}
-
-	if (de->de_hash != gfs_dir_hash(filename, de->de_name_len)){
-	        log_err("Dir entry with bad hash or name length\n"
-			 "\tHash found         = %u\n"
-			 "\tName found         = %s\n"
-			 "\tName length found  = %u\n"
-			 "\tHash expected      = %u\n",
-			 de->de_hash,
-			 filename,
-			 de->de_name_len,
-			 gfs_dir_hash(filename, de->de_name_len));
-		return 1;
-	}
-	/* FIXME: This should probably go to the top of the fxn, and
-	 * references to filename should be replaced with tmp_name */
-	memset(tmp_name, 0, MAX_FILENAME);
-	if(de->de_name_len < MAX_FILENAME)
-		strncpy(tmp_name, filename, de->de_name_len);
-	else
-		strncpy(tmp_name, filename, MAX_FILENAME - 1);
-
-	if(check_range(ip->i_sbd, entryblock)) {
-		log_err("Block # referenced by directory entry %s is out of range\n",
-			tmp_name);
-		errors_found++;
-		if(query(ip->i_sbd, "Clear directory entry tp out of range block? (y/n) ")) {
-			log_err("Clearing %s\n", tmp_name);
-			if(dirent_del(ip, bh, prev_de, dent))
-				log_err("Error encountered while removing bad "
-					"directory entry.  Skipping.\n");
-			else
-				errors_corrected++;
-			*update = 1;
-			return 1;
-		} else {
-			log_err("Directory entry to out of range block remains\n");
-			(*count)++;
-			ds->entry_count++;
-			return 0;
-		}
-	}
-	if(block_check(sbp->bl, de->de_inum.no_addr, &q)) {
-		stack;
-		return -1;
-	}
-	/* Get the status of the directory inode */
-	if(q.bad_block) {
-		/* This entry's inode has bad blocks in it */
-
-		/* Handle bad blocks */
-		log_err("Found a bad directory entry: %s at block %lld.\n",
-			filename, de->de_inum.no_addr);
-
-		errors_found++;
-		if(query(sbp, "Delete the inode containing bad blocks? "
-			 "(y/n)")) {
-			errors_corrected++;
-			if (!load_inode(sbp, de->de_inum.no_addr, &entry_ip)) {
-				check_inode_eattr(entry_ip,
-						  &pass2_fxns_delete);
-				check_metatree(entry_ip, &pass2_fxns_delete);
-				free_inode(&entry_ip);
-			}
-			dirent_del(ip, bh, prev_de, dent);
-			block_set(sbp->bl, de->de_inum.no_addr, meta_free);
-			*update = 1;
-			log_warn("The inode containing bad blocks was "
-				 "deleted.\n");
-			return 1;
-		} else {
-			log_warn("Entry to inode containing bad blocks remains\n");
-			(*count)++;
-			ds->entry_count++;
-			return 0;
-		}
-
-	}
-	if(q.block_type != inode_dir && q.block_type != inode_file &&
-	   q.block_type != inode_lnk && q.block_type != inode_blk &&
-	   q.block_type != inode_chr && q.block_type != inode_fifo &&
-	   q.block_type != inode_sock) {
-		log_err("Directory entry '%s' for block %" PRIu64
-			" in dir inode %" PRIu64 " block type %d: %s.\n",
-			tmp_name, de->de_inum.no_addr, ip->i_num.no_addr,
-			q.block_type, q.block_type == meta_inval ?
-			"previously marked invalid" : "is not an inode");
-
-		errors_found++;
-		if(query(sbp, "Clear directory entry to non-inode block? "
-			 "(y/n) ")) {
-			osi_buf_t *bhi;
-
-			if(dirent_del(ip, bh, prev_de, dent)) {
-				log_err("Error encountered while removing bad "
-					"directory entry.  Skipping.\n");
-				return -1;
-			}
-			errors_corrected++;
-			*update = 1;
-			log_warn("Directory entry '%s' cleared\n", tmp_name);
-
-			/* If it was previously marked invalid (i.e. known
-			   to be bad, not just a free block, etc.) then
-			   delete any metadata it holds.  If not, return. */
-			if (q.block_type != meta_inval)
-				return 1;
-
-			/* Now try to clear the dinode, if it is an dinode */
-			get_and_read_buf(sbp, de->de_inum.no_addr, &bhi, 0);
-			error = check_meta(bhi, GFS_METATYPE_DI);
-			relse_buf(sbp, bhi);
-			if (error)
-				return 1; /* not a dinode: nothing to delete */
-
-			if (!load_inode(sbp, de->de_inum.no_addr, &entry_ip)) {
-				check_inode_eattr(entry_ip,
-						  &pass2_fxns_delete);
-				check_metatree(entry_ip, &pass2_fxns_delete);
-				free_inode(&entry_ip);
-			}
-			block_set(sbp->bl, de->de_inum.no_addr, block_free);
-			return 1;
-		} else {
-			log_err("Directory entry to non-inode block remains\n");
-			(*count)++;
-			ds->entry_count++;
-			return 0;
-		}
-	}
-
-	error = check_file_type(de->de_type, q.block_type);
-	if(error < 0) {
-		stack;
-		return -1;
-	}
-	if(error > 0) {
-		log_warn("Type in dir entry (%s, %"PRIu64") conflicts with "
-			 "type in dinode. (Dir entry is stale.)\n",
-			 tmp_name, de->de_inum.no_addr);
-		errors_found++;
-		if(query(sbp, "Clear stale directory entry? (y/n) ")) {
-			load_inode(sbp, de->de_inum.no_addr, &entry_ip);
-			check_inode_eattr(entry_ip, &clear_eattrs);
-			free_inode(&entry_ip);
-
-			if(dirent_del(ip, bh, prev_de, dent))
-				log_err("Error encountered while removing bad "
-					"directory entry.  Skipping.\n");
-			else {
-				errors_corrected++;
-				*update = 1;
-				log_err("Stale directory entry deleted\n");
-			}
-			return 1;
-		} else {
-			log_err("Stale directory entry remains\n");
-			(*count)++;
-			ds->entry_count++;
-			return 0;
-		}
-	}
-
-	if(!strcmp(".", tmp_name)) {
-		log_debug("Found . dentry\n");
-
-		if(ds->dotdir) {
-			log_err("already found '.' entry\n");
-			errors_found++;
-			if(query(sbp, "Clear duplicate '.' entry? (y/n) ")) {
-
-				errors_corrected++;
-				load_inode(sbp, de->de_inum.no_addr, &entry_ip);
-				check_inode_eattr(entry_ip, &clear_eattrs);
-				free_inode(&entry_ip);
-
-				dirent_del(ip, bh, prev_de, dent);
-				*update  = 1;
-				return 1;
-			} else {
-				log_err("Duplicate '.' entry remains\n");
-				/* FIXME: Should we continue on here
-				 * and check the rest of the '.'
-				 * entry? */
-				increment_link(sbp, de->de_inum.no_addr);
-				(*count)++;
-				ds->entry_count++;
-				return 0;
-			}
-		}
-
-		/* GFS does not rely on '.' being in a certain
-		 * location */
-
-		/* check that '.' refers to this inode */
-		if(de->de_inum.no_addr != ip->i_num.no_addr) {
-			log_err("'.' entry's value incorrect."
-				"  Points to %"PRIu64
-				" when it should point to %"
-				PRIu64".\n",
-				de->de_inum.no_addr,
-				ip->i_num.no_addr);
-			errors_found++;
-			if(query(sbp, "remove '.' reference? (y/n) ")) {
-				errors_corrected++;
-				load_inode(sbp, de->de_inum.no_addr, &entry_ip);
-				check_inode_eattr(entry_ip, &clear_eattrs);
-				free_inode(&entry_ip);
-
-				dirent_del(ip, bh, prev_de, dent);
-				*update = 1;
-				return 1;
-
-			} else {
-				log_err("Invalid '.' reference remains\n");
-				/* Not setting ds->dotdir here since
-				 * this '.' entry is invalid */
-				increment_link(sbp, de->de_inum.no_addr);
-				(*count)++;
-				ds->entry_count++;
-				return 0;
-			}
-		}
-
-		ds->dotdir = 1;
-		increment_link(sbp, de->de_inum.no_addr);
-		(*count)++;
-		ds->entry_count++;
-
-		return 0;
-	}
-	if(!strcmp("..", tmp_name)) {
-		log_debug("Found .. dentry\n");
-		if(ds->dotdotdir) {
-			log_err("already found '..' entry\n");
-			errors_found++;
-			if(query(sbp, "Clear duplicate '..' entry? (y/n) ")) {
-
-				errors_corrected++;
-				load_inode(sbp, de->de_inum.no_addr, &entry_ip);
-				check_inode_eattr(entry_ip, &clear_eattrs);
-				free_inode(&entry_ip);
-
-				dirent_del(ip, bh, prev_de, dent);
-				*update = 1;
-				return 1;
-			} else {
-				log_err("Duplicate '..' entry remains\n");
-				/* FIXME: Should we continue on here
-				 * and check the rest of the '..'
-				 * entry? */
-				increment_link(sbp, de->de_inum.no_addr);
-				(*count)++;
-				ds->entry_count++;
-				return 0;
-			}
-		}
-
-		if(q.block_type != inode_dir) {
-			log_err("Found '..' entry pointing to"
-				" something that's not a directory");
-			errors_found++;
-			if(query(sbp, "Clear bad '..' directory entry? (y/n) ")) {
-				errors_corrected++;
-				load_inode(sbp, de->de_inum.no_addr, &entry_ip);
-				check_inode_eattr(entry_ip, &clear_eattrs);
-				free_inode(&entry_ip);
-
-				dirent_del(ip, bh, prev_de, dent);
-				*update = 1;
-				return 1;
-			} else {
-				log_err("Bad '..' directory entry remains\n");
-				increment_link(sbp, de->de_inum.no_addr);
-				(*count)++;
-				ds->entry_count++;
-				return 0;
-			}
-		}
-		/* GFS does not rely on '..' being in a
-		 * certain location */
-
-		/* Add the address this entry is pointing to
-		 * to this inode's dotdot_parent in
-		 * dir_info */
-		if(set_dotdot_dir(sbp, ip->i_num.no_addr,
-				  entryblock)) {
-			stack;
-			return -1;
-		}
-
-		ds->dotdotdir = 1;
-		increment_link(sbp, de->de_inum.no_addr);
-		*update = (sbp->opts->no ? 0 : 1);
-		(*count)++;
-		ds->entry_count++;
-		return 0;
-	}
-
-	/* After this point we're only concerned with
-	 * directories */
-	if(q.block_type != inode_dir) {
-		log_debug("Found non-dir inode dentry\n");
-		increment_link(sbp, de->de_inum.no_addr);
-		*update = (sbp->opts->no ? 0 : 1);
-		(*count)++;
-		ds->entry_count++;
-		return 0;
-	}
-
-	log_debug("Found plain directory dentry\n");
-	error = set_parent_dir(sbp, entryblock, ip->i_num.no_addr);
-	if(error > 0) {
-		log_err("Hard link to block %"PRIu64" detected.\n", filename, entryblock);
-
-		errors_found++;
-		if(query(sbp, "Clear hard link to directory? (y/n) ")) {
-			errors_corrected++;
-			*update = 1;
-
-			dirent_del(ip, bh, prev_de, dent);
-			log_warn("Directory entry %s cleared\n", filename);
-
-			return 1;
-		} else {
-			log_err("Hard link to directory remains\n");
-			(*count)++;
-			ds->entry_count++;
-			return 0;
-		}
-	}
-	else if (error < 0) {
-		stack;
-		return -1;
-	}
-	increment_link(sbp, de->de_inum.no_addr);
-	*update = (sbp->opts->no ? 0 : 1);
-	(*count)++;
-	ds->entry_count++;
-	/* End of checks */
-	return 0;
-}
-
-
-struct metawalk_fxns pass2_fxns = {
-	.private = NULL,
-	.check_leaf = NULL,
-	.check_metalist = NULL,
-	.check_data = NULL,
-	.check_eattr_indir = check_eattr_indir,
-	.check_eattr_leaf = check_eattr_leaf,
-	.check_dentry = check_dentry,
-	.check_eattr_entry = NULL,
-};
-
-
-
-
-static int build_rooti(struct fsck_sb *sbp)
-{
-	struct fsck_inode *ip;
-	osi_buf_t *bh;
-	get_and_read_buf(sbp, GFS_SB_ADDR >> sbp->fsb2bb_shift, &bh, 0);
-	/* Create a new inode ondisk */
-	create_inode(sbp, GFS_FILE_DIR, &ip);
-	/* Attach it to the superblock's sb_root_di address */
-	sbp->sb.sb_root_di.no_addr =
-		sbp->sb.sb_root_di.no_formal_ino = ip->i_num.no_addr;
-	/* Write out sb change */
-	gfs_sb_out(&sbp->sb, BH_DATA(bh));
-	write_buf(sbp, bh, 1);
-	relse_buf(sbp, bh);
-	sbp->rooti = ip;
-
-	if(fs_dir_add(ip, &(osi_filename_t){(unsigned char *)".", 1},
-		      &(ip->i_num), ip->i_di.di_type)){
-		stack;
-		log_err("Unable to add \".\" entry to new root inode\n");
-		return -1;
-	}
-
-	if(fs_dir_add(ip, &(osi_filename_t){(unsigned char *)"..", 2},
-		      &ip->i_num, ip->i_di.di_type)){
-		stack;
-		log_err("Unable to add \"..\" entry to new root inode\n");
-		return -1;
-	}
-
-	block_set(sbp->bl, ip->i_num.no_addr, inode_dir);
-	add_to_dir_list(sbp, ip->i_num.no_addr);
-
-	/* Attach l+f to it */
-	if(fs_mkdir(sbp->rooti, "l+f", 00700, &(sbp->lf_dip))){
-		log_err("Unable to create/locate l+f directory.\n");
-		return -1;
-	}
-
-	if(sbp->lf_dip){
-		log_debug("Lost and Found directory inode is at "
-			  "block #%"PRIu64".\n",
-			  sbp->lf_dip->i_num.no_addr);
-	}
-	block_set(sbp->bl, sbp->lf_dip->i_num.no_addr, inode_dir);
-
-	add_to_dir_list(sbp, sbp->lf_dip->i_num.no_addr);
-
-	return 0;
-}
-
-/* Check root inode and verify it's in the bitmap */
-static int check_root_dir(struct fsck_sb *sbp)
-{
-	uint64_t rootblock;
-	struct dir_status ds = {0};
-	struct fsck_inode *ip;
-	osi_buf_t b, *bh = &b;
-	osi_filename_t filename;
-	char tmp_name[256];
-	int update=0, error = 0;
-	/* Read in the root inode, look at its dentries, and start
-	 * reading through them */
-	rootblock = sbp->sb.sb_root_di.no_addr;
-
-	/* FIXME: check this block's validity */
-
-	if(block_check(sbp->bl, rootblock, &ds.q)) {
-		log_crit("Can't get root block %"PRIu64" from block list\n",
-			 rootblock);
-		/* FIXME: Need to check if the root block is out of
-		 * the fs range and if it is, rebuild it.  Still can
-		 * error out if the root block number is valid, but
-		 * block_check fails */
-		return -1;
-/*		if(build_rooti(sbp)) {
-			stack;
-			return -1;
-			}*/
-	}
-
-	/* if there are errors with the root inode here, we need to
-	 * create a new root inode and get it all setup - of course,
-	 * everything will be in l+f then, but we *need* a root inode
-	 * before we can do any of that.
-	 */
-	if(ds.q.block_type != inode_dir) {
-		log_err("Block %"PRIu64" marked as root inode in"
-			" superblock not a directory\n", rootblock);
-		errors_found++;
-		if(query(sbp, "Create new root inode? (y/n) ")) {
-			if(build_rooti(sbp)) {
-				stack;
-				return -1;
-			}
-			errors_corrected++;
-		} else {
-			log_err("Cannot continue without valid root inode\n");
-			return -1;
-		}
-	}
-
-	rootblock = sbp->sb.sb_root_di.no_addr;
-	pass2_fxns.private = (void *) &ds;
-	if(ds.q.bad_block) {
-		/* First check that the directory's metatree is valid */
-		load_inode(sbp, rootblock, &ip);
-		if(check_metatree(ip, &pass2_fxns)) {
-			stack;
-			free_inode(&ip);
-			return -1;
-		}
-		free_inode(&ip);
-	}
-	error = check_dir(sbp, rootblock, &pass2_fxns);
-	if(error < 0) {
-		stack;
-		return -1;
-	}
-	if (error > 0) {
-		block_set(sbp->bl, rootblock, meta_inval);
-	}
-
-	if(get_and_read_buf(sbp, rootblock, &bh, 0)){
-		log_err("Unable to retrieve block #%"PRIu64"\n",
-			rootblock);
-		block_set(sbp->bl, rootblock, meta_inval);
-		return -1;
-	}
-
-	if(copyin_inode(sbp, bh, &ip)) {
-		stack;
-		relse_buf(sbp, bh);
-		return -1;
-	}
-
-	if(check_inode_eattr(ip, &pass2_fxns)) {
-		stack;
-		return -1;
-	}
-	/* FIXME: Should not have to do this here - fs_dir_add reads
-	 * the buffer too though, and commits the change to disk, so I
-	 * have to reread the buffer after calling it if I'm going to
-	 * make more changes */
-	relse_buf(sbp, bh);
-
-	if(!ds.dotdir) {
-		log_err("No '.' entry found\n");
-		errors_found++;
-		if (query(sbp, "Is it okay to add '.' entry? (y/n) ")) {
-			sprintf(tmp_name, ".");
-			filename.len = strlen(tmp_name); /* no trailing NULL */
-			if(!(filename.name =
-			     malloc(sizeof(char) * filename.len))) {
-				log_err("Unable to allocate name string\n");
-				stack;
-				return -1;
-			}
-			if(!(memset(filename.name, 0, sizeof(char) *
-				    filename.len))) {
-				log_err("Unable to zero name string\n");
-				stack;
-				return -1;
-			}
-			memcpy(filename.name, tmp_name, filename.len);
-			log_warn("Adding '.' entry\n");
-			if(fs_dir_add(ip, &filename, &(ip->i_num),
-				      ip->i_di.di_type)){
-				log_err("Failed to link \".\" entry to "
-					"directory.\n");
-				return -1;
-			}
-			errors_corrected++;
-			increment_link(ip->i_sbd, ip->i_num.no_addr);
-			ds.entry_count++;
-			free(filename.name);
-			update = 1;
-		} else
-			log_err("The directory was not fixed.\n");
-	}
-	free_inode(&ip);
-	if(get_and_read_buf(sbp, rootblock, &bh, 0)){
-		log_err("Unable to retrieve block #%"PRIu64"\n",
-			rootblock);
-		block_set(sbp->bl, rootblock, meta_inval);
-		return -1;
-	}
-
-	if(copyin_inode(sbp, bh, &ip)) {
-		stack;
-		relse_buf(sbp, bh);
-		return -1;
-	}
-
-	if(ip->i_di.di_entries != ds.entry_count) {
-		log_err("Entries is %d - should be %d for %"PRIu64"\n",
-			ip->i_di.di_entries, ds.entry_count, ip->i_di.di_num.no_addr);
-		errors_found++;
-		if(query(sbp, "Fix entries for %"PRIu64"? (y/n) ",
-			 ip->i_di.di_num.no_addr)) {
-			ip->i_di.di_entries = ds.entry_count;
-			log_err("Entries updated\n");
-			errors_corrected++;
-			update = 1;
-		} else {
-			log_err("Entries for %"PRIu64" left out of sync\n",
-				ip->i_di.di_num.no_addr);
-		}
-	}
-
-	if(update) {
-		gfs_dinode_out(&ip->i_di, BH_DATA(bh));
-		write_buf(sbp, bh, 0);
-	}
-
-	free_inode(&ip);
-	relse_buf(sbp, bh);
-	return 0;
-}
-
-/* What i need to do in this pass is check that the dentries aren't
- * pointing to invalid blocks...and verify the contents of each
- * directory. and start filling in the directory info structure*/
-
-/**
- * pass2 - check pathnames
- *
- * verify root inode
- * directory name length
- * entries in range
- */
-int pass2(struct fsck_sb *sbp, struct options *opts)
-{
-	uint64_t i;
-	struct block_query q;
-	struct dir_status ds = {0};
-	struct fsck_inode *ip;
-	osi_buf_t b, *bh = &b;
-	osi_filename_t filename;
-	char tmp_name[256];
-	int error = 0;
-	int need_update = 0;
-
-	if(check_root_dir(sbp)) {
-		stack;
-		return FSCK_ERROR;
-	}
-
-	log_info("Checking directory inodes.\n");
-	/* Grab each directory inode, and run checks on it */
-	for(i = 0; i < sbp->last_fs_block; i++) {
-		need_update = 0;
-		warm_fuzzy_stuff(i);
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return FSCK_OK;
-
-		/* Skip the root inode - it's checked above */
-		if(i == sbp->sb.sb_root_di.no_addr)
-			continue;
-
-		if(block_check(sbp->bl, i, &q)) {
-			log_err("Can't get block %"PRIu64 " from block list\n",
-				i);
-			return FSCK_ERROR;
-		}
-
-		if(q.block_type != inode_dir)
-			continue;
-
-		log_debug("Checking directory inode at block %"PRIu64"\n", i);
-
-
-		memset(&ds, 0, sizeof(ds));
-		pass2_fxns.private = (void *) &ds;
-		if(ds.q.bad_block) {
-			/* First check that the directory's metatree
-			 * is valid */
-			load_inode(sbp, i, &ip);
-			if(check_metatree(ip, &pass2_fxns)) {
-				stack;
-				free_inode(&ip);
-				return FSCK_ERROR;
-			}
-			free_inode(&ip);
-		}
-		error = check_dir(sbp, i, &pass2_fxns);
-		if(error < 0) {
-			stack;
-			return FSCK_ERROR;
-		}
-		if (error > 0) {
-			struct dir_info *di = NULL;
-			error = find_di(sbp, i, &di);
-			if(error < 0) {
-				stack;
-				return FSCK_ERROR;
-			}
-			if(error == 0) {
-				/* FIXME: factor */
-				errors_found++;
-				if(query(sbp, "Remove directory entry for bad"
-					 " inode %"PRIu64" in %"PRIu64
-					 "? (y/n)", i, di->treewalk_parent)) {
-					error = remove_dentry_from_dir(sbp,
-								       di->treewalk_parent,
-								       i);
-					if(error < 0) {
-						stack;
-						return FSCK_ERROR;
-					}
-					if(error > 0) {
-						log_warn("Unable to find dentry for %"
-							 PRIu64" in %"PRIu64"\n",
-							 i, di->treewalk_parent);
-					}
-					errors_corrected++;
-					log_warn("Directory entry removed\n");
-				} else {
-					log_err("Directory entry to invalid inode remains\n");
-				}
-			}
-			block_set(sbp->bl, i, meta_inval);
-		}
-		if(get_and_read_buf(sbp, i, &bh, 0)){
-			/* This shouldn't happen since we were able to
-			 * read it before */
-			log_err("Unable to retrieve block #%"PRIu64
-				" for directory\n",
-				i);
-			return FSCK_ERROR;
-		}
-
-		if(copyin_inode(sbp, bh, &ip)) {
-			stack;
-			relse_buf(sbp, bh);
-			return FSCK_ERROR;
-		}
-
-		if(!ds.dotdir) {
-			log_err("No '.' entry found for directory inode at "
-				"block %" PRIu64 "\n", i);
-			errors_found++;
-			if (query(sbp,
-				  "Is it okay to add '.' entry? (y/n) ")) {
-				sprintf(tmp_name, ".");
-				filename.len = strlen(tmp_name); /* no trailing
-								    NULL */
-				if(!(filename.name = malloc(sizeof(char) *
-							    filename.len))) {
-					log_err("Unable to allocate name\n");
-					stack;
-					return FSCK_ERROR;
-				}
-				if(!memset(filename.name, 0, sizeof(char) *
-					   filename.len)) {
-					log_err("Unable to zero name\n");
-					stack;
-					return FSCK_ERROR;
-				}
-				memcpy(filename.name, tmp_name, filename.len);
-
-				if(fs_dir_add(ip, &filename, &(ip->i_num),
-					      ip->i_di.di_type)){
-					log_err("Failed to link \".\" entry "
-						"to directory.\n");
-					return FSCK_ERROR;
-				}
-				errors_corrected++;
-				increment_link(ip->i_sbd, ip->i_num.no_addr);
-				ds.entry_count++;
-				free(filename.name);
-				log_err("The directory was fixed.\n");
-				need_update = 1;
-			} else {
-				log_err("The directory was not fixed.\n");
-			}
-		}
-
-		if(ip->i_di.di_entries != ds.entry_count) {
-			log_err("Entries is %d - should be %d for inode "
-				"block %" PRIu64 "\n",
-				ip->i_di.di_entries, ds.entry_count,
-				ip->i_di.di_num.no_addr);
-			errors_found++;
-			if (query(sbp, "Fix the entry count? (y/n) ")) {
-				errors_corrected++;
-				ip->i_di.di_entries = ds.entry_count;
-				need_update = 1;
-			} else {
-				log_err("The entry count was not fixed.\n");
-			}
-		}
-		if (need_update) {
-			gfs_dinode_out(&ip->i_di, BH_DATA(bh));
-			write_buf(sbp, bh, 0);
-			free_inode(&ip);
-			relse_buf(sbp, bh);
-		}
-	}
-	return FSCK_OK;
-}
-
-
-
diff --git a/gfs/gfs_fsck/pass3.c b/gfs/gfs_fsck/pass3.c
deleted file mode 100644
index 08ee24f..0000000
--- a/gfs/gfs_fsck/pass3.c
+++ /dev/null
@@ -1,281 +0,0 @@
-#include <stdio.h>
-#include "osi_list.h"
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "inode.h"
-#include "lost_n_found.h"
-#include "block_list.h"
-#include "fs_dir.h"
-#include "link.h"
-#include "metawalk.h"
-
-static int attach_dotdot_to(struct fsck_sb *sbp, uint64_t newdotdot,
-			    uint64_t olddotdot, uint64_t block)
-{
-	osi_filename_t filename;
-	struct fsck_inode *ip, *pip;
-
-	load_inode(sbp, block, &ip);
-	load_inode(sbp, newdotdot, &pip);
-	/* FIXME: Need to add some interactive
-	 * options here and come up with a
-	 * good default for non-interactive */
-	/* FIXME: do i need to correct the
-	 * '..' entry for this directory in
-	 * this case? */
-
-	filename.len = strlen("..");
-	if(!(filename.name = malloc(sizeof(char) * filename.len + 1))) {
-		log_err("Unable to allocate name\n");
-		free_inode(&ip);
-		free_inode(&pip);
-		stack;
-		return -1;
-	}
-	if(!memset(filename.name, 0, (sizeof(char) * filename.len + 1))) {
-		log_err("Unable to zero name\n");
-		free_inode(&ip);
-		free_inode(&pip);
-		stack;
-		return -1;
-	}
-	memcpy(filename.name, "..", filename.len);
-	if(fs_dirent_del(ip, NULL, &filename))
-		log_warn("Unable to remove \"..\" directory entry.\n");
-	else
-		decrement_link(sbp, olddotdot);
-	if(fs_dir_add(ip, &filename, &pip->i_num,
-		      pip->i_di.di_type)){
-		log_err("Failed to link \"..\" entry to directory.\n");
-		block_set(ip->i_sbd->bl, ip->i_num.no_addr, meta_inval);
-		free_inode(&ip);
-		free_inode(&pip);
-		return -1;
-	}
-	increment_link(sbp, newdotdot);
-	free_inode(&ip);
-	free_inode(&pip);
-	return 0;
-}
-
-static struct dir_info *mark_and_return_parent(struct fsck_sb *sbp,
-					struct dir_info *di)
-{
-	struct dir_info *pdi;
-
-	struct block_query q_dotdot, q_treewalk;
-
-	di->checked = 1;
-
-	if(!di->treewalk_parent)
-		return NULL;
-
-	if(di->dotdot_parent != di->treewalk_parent) {
-		log_warn(".. and treewalk conections are not the same for %"PRIu64
-			 "\n", di->dinode);
-		log_notice("%"PRIu64" %"PRIu64"\n", di->dotdot_parent, di->treewalk_parent);
-		if(block_check(sbp->bl, di->dotdot_parent, &q_dotdot)) {
-			log_err("Unable to find block %"PRIu64
-				" in block map\n",
-				di->dotdot_parent);
-			return NULL;
-		}
-		if(block_check(sbp->bl, di->treewalk_parent, &q_treewalk)) {
-			log_err("Unable to find block %"PRIu64
-				" in block map\n",
-				di->treewalk_parent);
-			return NULL;
-		}
-		/* if the dotdot entry isn't a directory, but the
-		 * treewalk is, treewalk is correct - if the treewalk
-		 * entry isn't a directory, but the dotdot is, dotdot
-		 * is correct - if both are directories, which do we
-		 * choose? if neither are directories, we have a
-		 * problem - need to move this directory into l+f
-		 */
-		if(q_dotdot.block_type != inode_dir) {
-			if(q_treewalk.block_type != inode_dir) {
-				log_err( "Orphaned directory, move to l+f\n");
-				return NULL;
-			}
-			else {
-				log_warn("Treewalk parent is correct,"
-					 " fixing dotdot -> %"PRIu64"\n",
-					 di->treewalk_parent);
-				attach_dotdot_to(sbp, di->treewalk_parent,
-						 di->dotdot_parent, di->dinode);
-				di->dotdot_parent = di->treewalk_parent;
-			}
-		}
-		else {
-			if(q_treewalk.block_type != inode_dir) {
-				int error = 0;
-				log_warn(".. parent is valid, but treewalk"
-					 "is bad - reattaching to l+f");
-
-				/* FIXME: add a dinode for this entry instead? */
-				errors_found++;
-				if(query(sbp, "Remove directory entry for bad"
-					 " inode %"PRIu64" in %"PRIu64
-					 "? (y/n)", di->dinode,
-					 di->treewalk_parent)) {
-					error = remove_dentry_from_dir(sbp,
-								       di->treewalk_parent,
-								       di->dinode);
-					if(error < 0) {
-						stack;
-						return NULL;
-					}
-					if(error > 0) {
-						log_warn("Unable to find dentry for %"
-							 PRIu64" in %"PRIu64"\n",
-							 di->dinode, di->treewalk_parent);
-					}
-					errors_corrected++;
-					log_warn("Directory entry removed\n");
-				} else {
-					log_err("Directory entry to invalid inode remains\n");
-				}
-				log_info("Marking directory unlinked\n");
-
-				return NULL;
-			}
-			else {
-				log_err("Both .. and treewalk parents are "
-					"directories, going with treewalk for "
-					"now...\n");
-				attach_dotdot_to(sbp, di->treewalk_parent,
-						 di->dotdot_parent, di->dinode);
-				di->dotdot_parent = di->treewalk_parent;
-			}
-		}
-	}
-	else {
-		if(block_check(sbp->bl, di->dotdot_parent, &q_dotdot)) {
-			log_err("Unable to find parent block %"PRIu64
-				" in block map\n",
-				di->dotdot_parent);
-			return NULL;
-		}
-		if(q_dotdot.block_type != inode_dir) {
-			log_err("Orphaned directory, move to l+f (Block #%"
-				PRIu64")\n", di->dinode);
-			return NULL;
-		}
-	}
-	find_di(sbp, di->dotdot_parent, &pdi);
-
-	return pdi;
-}
-
-/**
- * pass3 - check connectivity of directories
- *
- * handle disconnected directories
- * handle lost+found directory errors (missing, not a directory, no space)
- */
-int pass3(struct fsck_sb *sbp, struct options *opts)
-{
-	osi_list_t *tmp;
-	struct dir_info *di, *tdi;
-	struct fsck_inode *ip;
-	struct block_query q;
-	int i;
-
-	find_di(sbp, sbp->sb.sb_root_di.no_addr, &di);
-	if(di) {
-		log_info("Marking root inode connected\n");
-		di->checked = 1;
-	}
-
-	/* Go through the directory list, working up through the parents
-	 * until we find one that's been checked already.  If we don't
-	 * find a parent, put in lost+found.
-	 */
-	log_info("Checking directory linkage.\n");
-	for(i = 0; i < FSCK_HASH_SIZE; i++) {
-	osi_list_foreach(tmp, &sbp->dir_hash[i]) {
-		di = osi_list_entry(tmp, struct dir_info, list);
-		while(!di->checked) {
-			/* FIXME: Change this so it returns success or
-			 * failure and put the parent inode in a
-			 * param */
-			if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-				return FSCK_OK;
-			tdi = mark_and_return_parent(sbp, di);
-
-			/* FIXME: Factor this ? */
-			if(!tdi) {
-				if(block_check(sbp->bl, di->dinode, &q)) {
-					stack;
-					return FSCK_ERROR;
-				}
-				if(q.bad_block) {
-					log_err("Found unlinked directory containing"
-						"bad block\n");
-					errors_found++;
-					if(query(sbp, "Clear unlinked directory with bad blocks? (y/n) ")) {
-						block_set(sbp->bl, di->dinode, block_free);
-						errors_corrected++;
-						break;
-					} else {
-						log_err("Unlinked directory with bad blocks remains\n");
-					}
-				}
-				if(q.block_type != inode_dir &&
-				   q.block_type != inode_file &&
-				   q.block_type != inode_lnk &&
-				   q.block_type != inode_blk &&
-				   q.block_type != inode_chr &&
-				   q.block_type != inode_fifo &&
-				   q.block_type != inode_sock) {
-					log_err("Unlinked block marked as inode not an inode\n");
-					block_set(sbp->bl, di->dinode, block_free);
-					log_err("Cleared\n");
-					break;
-				}
-
-				log_err("Found unlinked directory %"PRIu64"\n", di->dinode);
-				load_inode(sbp, di->dinode, &ip);
-				/* Don't skip zero size directories
-				 * with eattrs */
-				if(!ip->i_di.di_size && !ip->i_di.di_eattr){
-					log_err("Unlinked directory has zero size.\n");
-					errors_found++;
-					if(query(sbp, "Remove zero-size unlinked directory? (y/n) ")) {
-						errors_corrected++;
-						block_set(sbp->bl, di->dinode, block_free);
-						free_inode(&ip);
-						break;
-					} else {
-						log_err("Zero-size unlinked directory remains\n");
-					}
-				}
-				errors_found++;
-				if(query(sbp, "Add unlinked directory to l+f? (y/n) ")) {
-					errors_corrected++;
-					if(add_inode_to_lf(ip)) {
-						stack;
-						free_inode(&ip);
-						return FSCK_ERROR;
-					}
-					log_warn("Directory relinked to l+f\n");
-				} else {
-					log_err("Unlinked directory remains unlinked\n");
-				}
-				free_inode(&ip);
-				break;
-			}
-			else {
-				log_debug("Directory at block %" PRIu64 " connected\n",
-						 di->dinode);
-			}
-			di = tdi;
-		}
-	}
-	}
-	if(sbp->lf_dip)
-		log_debug("At end of pass3, l+f entries is %u\n",
-			  sbp->lf_dip->i_di.di_entries);
-	return FSCK_OK;
-}
diff --git a/gfs/gfs_fsck/pass4.c b/gfs/gfs_fsck/pass4.c
deleted file mode 100644
index cb4255e..0000000
--- a/gfs/gfs_fsck/pass4.c
+++ /dev/null
@@ -1,233 +0,0 @@
-#include "stdio.h"
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "bio.h"
-#include "fs_inode.h"
-#include "inode_hash.h"
-#include "inode.h"
-#include "lost_n_found.h"
-#include "metawalk.h"
-
-struct metawalk_fxns pass4_fxns_delete = {
-	.private = NULL,
-	.check_metalist = delete_metadata,
-	.check_data = delete_data,
-	.check_eattr_indir = delete_eattr_indir,
-	.check_eattr_leaf = delete_eattr_leaf,
-};
-
-/* Updates the link count of an inode to what the fsck has seen for
- * link count */
-static int fix_inode_count(struct fsck_sb *sbp, struct inode_info *ii,
-		    struct fsck_inode *ip)
-{
-	log_info("Fixing inode count for %"PRIu64"\n",
-		 ip->i_di.di_num.no_addr);
-	if(ip->i_di.di_nlink == ii->counted_links)
-		return 0;
-	ip->i_di.di_nlink = ii->counted_links;
-
-	log_debug("Changing inode %"PRIu64" to have %u links\n",
-		  ip->i_di.di_num.no_addr, ii->counted_links);
-
-	fs_copyout_dinode(ip);
-
-	return 0;
-}
-
-static int scan_inode_list(struct fsck_sb *sbp, osi_list_t *list) {
-	osi_list_t *tmp;
-	struct inode_info *ii;
-	struct fsck_inode *ip;
-	int lf_addition = 0;
-	struct block_query q;
-
-	/* FIXME: should probably factor this out into a generic
-	 * scanning fxn */
-	osi_list_foreach(tmp, list) {
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return 0;
-		if(!(ii = osi_list_entry(tmp, struct inode_info, list))) {
-			log_crit("osi_list_foreach broken in scan_info_list!!\n");
-			exit(FSCK_ERROR);
-		}
-		/* Don't check reference counts on the special gfs files */
-		if((ii->inode == sbp->sb.sb_rindex_di.no_addr) ||
-		   (ii->inode == sbp->sb.sb_jindex_di.no_addr) ||
-		   (ii->inode == sbp->sb.sb_quota_di.no_addr) ||
-		   (ii->inode == sbp->sb.sb_license_di.no_addr))
-			continue;
-		log_debug("Checking reference count on inode at block %"PRIu64
-				  "\n", ii->inode);
-		if(ii->counted_links == 0) {
-			log_err("Found unlinked inode at %"PRIu64"\n",
-				ii->inode);
-			if(block_check(sbp->bl, ii->inode, &q)) {
-				stack;
-				return -1;
-			}
-			if(q.bad_block) {
-				log_err("Unlinked inode contains"
-					"bad blocks\n",
-					ii->inode);
-				errors_found++;
-				if(query(sbp, "Delete unlinked inode with bad "
-					 "blocks? (y/n) ")) {
-					errors_corrected++;
-					load_inode(sbp, ii->inode, &ip);
-					check_inode_eattr(ip,
-							  &pass4_fxns_delete);
-					check_metatree(ip, &pass4_fxns_delete);
-					free_inode(&ip);
-					block_set(sbp->bl, ii->inode,
-						  block_free);
-					log_err("Unlinked inode with bad blocks cleared\n");
-					continue;
-				} else
-					log_err("Unlinked inode with bad blocks not cleared\n");
-			}
-			if(q.block_type != inode_dir &&
-			   q.block_type != inode_file &&
-			   q.block_type != inode_lnk &&
-			   q.block_type != inode_blk &&
-			   q.block_type != inode_chr &&
-			   q.block_type != inode_fifo &&
-			   q.block_type != inode_sock) {
-				log_err("Unlinked block marked as an inode is "
-					"not an inode (%d)\n", q.block_type);
-				errors_found++;
-				if(query(sbp, "Delete unlinked inode"
-					 "? (y/n) ")) {
-					errors_corrected++;
-					if (!load_inode(sbp, ii->inode, &ip)) {
-						check_inode_eattr(ip,
-							   &pass4_fxns_delete);
-						check_metatree(ip,
-							   &pass4_fxns_delete);
-					}
-					block_set(sbp->bl, ii->inode,
-						  block_free);
-					free_inode(&ip);
-					log_err("The inode was deleted\n");
-				} else
-					log_err("The inode was not deleted\n");
-
-				continue;
-			}
-			if(load_inode(sbp, ii->inode, &ip)) {
-				stack;
-				return -1;
-			}
-			if(!sbp->opts->no) {
-				/* We don't want to clear zero-size files with
-				 * eattrs - there might be relevent info in
-				 * them. */
-				if(!ip->i_di.di_size && !ip->i_di.di_eattr){
-					log_err("Unlinked inode has zero "
-						"size\n");
-					errors_found++;
-					if(query(sbp, "Clear zero-size "
-						 "unlinked inode? (y/n) ")) {
-						errors_corrected++;
-						block_set(sbp->bl, ii->inode,
-							  block_free);
-						free_inode(&ip);
-						log_err("Unlinked inode with "
-							"zero size cleared\n");
-						continue;
-					} else
-						log_err("Unlinked inode with "
-							"zero size not "
-							"cleared\n");
-				}
-				errors_found++;
-				if(query(sbp, "Add unlinked inode to l+f? "
-					 "(y/n)")) {
-					if(add_inode_to_lf(ip)) {
-						stack;
-						free_inode(&ip);
-						log_err("Unable to unlinked "
-							"inode to l+f\n");
-						return -1;
-					} else {
-						fix_inode_count(sbp, ii, ip);
-						lf_addition = 1;
-						errors_corrected++;
-						log_err("Unlinked inode added "
-							"to l+f\n");
-					}
-				} else
-					log_err("Unlinked inode left "
-						"unlinked\n");
-			}
-			free_inode(&ip);
-		}
-		else if(ii->link_count != ii->counted_links) {
-			log_err("Link count inconsistent for inode %"PRIu64
-				" - %u %u\n",
-				ii->inode, ii->link_count, ii->counted_links);
-			/* Read in the inode, adjust the link count,
-			 * and write it back out */
-			errors_found++;
-			if(query(sbp, "Update link count for inode %"
-				 PRIu64"? (y/n) ", ii->inode)) {
-				errors_corrected++;
-				load_inode(sbp, ii->inode, &ip);
-				fix_inode_count(sbp, ii, ip);
-				free_inode(&ip);
-				log_warn("Link count updated for inode %"
-					 PRIu64"\n", ii->inode);
-			} else {
-				log_err("Link count for inode %"
-					PRIu64" still incorrect\n", ii->inode);
-			}
-		}
-		log_debug("block %"PRIu64" has link count %d\n", ii->inode,
-			  ii->link_count);
-	}
-
-	if (lf_addition) {
-		if(!(ii = inode_hash_search(sbp->inode_hash,
-					    sbp->lf_dip->i_num.no_addr))) {
-			log_crit("Unable to find l+f inode in inode_hash!!\n");
-			return -1;
-		} else {
-			fix_inode_count(sbp, ii, sbp->lf_dip);
-		}
-	}
-
-	return 0;
-}
-
-/**
- * pass4 - Check reference counts (pass 2 & 6 in current fsck)
- *
- * handle unreferenced files
- * lost+found errors (missing, not a directory, no space)
- * adjust link count
- * handle unreferenced inodes of other types
- * handle bad blocks
- */
-int pass4(struct fsck_sb *sbp, struct options *opts)
-{
-	uint32_t i;
-	osi_list_t *list;
-	if(sbp->lf_dip)
-		log_debug("At beginning of pass4, l+f entries is %u\n",
-			  sbp->lf_dip->i_di.di_entries);
-	log_info("Checking inode reference counts.\n");
-	for (i = 0; i < FSCK_HASH_SIZE; i++) {
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return FSCK_OK;
-		list = &sbp->inode_hash[i];
-		if(scan_inode_list(sbp, list)) {
-			stack;
-			return FSCK_ERROR;
-		}
-	}
-
-	if(sbp->lf_dip)
-		log_debug("At end of pass4, l+f entries is %u\n",
-			  sbp->lf_dip->i_di.di_entries);
-	return FSCK_OK;
-}
diff --git a/gfs/gfs_fsck/pass5.c b/gfs/gfs_fsck/pass5.c
deleted file mode 100644
index 9916664..0000000
--- a/gfs/gfs_fsck/pass5.c
+++ /dev/null
@@ -1,394 +0,0 @@
-#include <stdio.h>
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "ondisk.h"
-#include "fs_bits.h"
-#include "bio.h"
-#include "util.h"
-
-#ifdef DEBUG
-int rgrp_countbits(unsigned char *buffer, unsigned int buflen,
-		   uint32_t *bit_array)
-{
-	unsigned char *byte, *end;
-	unsigned int bit;
-	unsigned char state;
-
-	byte = buffer;
-	bit = 0;
-	end = buffer + buflen;
-
-	while (byte < end){
-		state = ((*byte >> bit) & GFS_BIT_MASK);
-		switch (state) {
-		case GFS_BLKST_FREE:
-			bit_array[0]++;
-			break;
-		case GFS_BLKST_USED:
-			bit_array[1]++;
-			break;
-		case GFS_BLKST_FREEMETA:
-			bit_array[2]++;
-			break;
-		case GFS_BLKST_USEDMETA:
-			bit_array[3]++;
-			break;
-		default:
-			log_err("Invalid state %d found at byte %u, bit %u\n",
-				state, byte, bit);
-			return -1;
-			break;
-		}
-
-		bit += GFS_BIT_SIZE;
-		if (bit >= 8){
-			bit = 0;
-			byte++;
-		}
-	}
-	return 0;
-}
-
-int fsck_countbits(struct fsck_sb *sbp, uint64_t start_blk, uint64_t count,
-		   uint32_t *bit_array)
-{
-	uint64_t i;
-	struct block_query q;
-	for(i = start_blk; i < start_blk+count; i++) {
-		block_check(sbp->bl, i, &q);
-		switch(q.block_type) {
-		case block_free:
-			bit_array[0]++;
-			break;
-		case block_used:
-			bit_array[1]++;
-			break;
-		case meta_free:
-		case meta_inval:
-			bit_array[2]++;
-			break;
-		case indir_blk:
-		case inode_dir:
-		case inode_file:
-		case leaf_blk:
-		case journal_blk:
-		case meta_other:
-		case meta_eattr:
-			bit_array[3]++;
-			break;
-		default:
-			log_err("Invalid state %d found at block%"PRIu64"\n",
-				q.block_type, i);
-			return -1;
-			break;
-		}
-	}
-	return 0;
-}
-
-
-int count_bmaps(struct fsck_rgrp *rgp)
-{
-	uint32_t i;
-	uint32_t bit_array_rgrp[4] = {0};
-	uint32_t bit_array_fsck[4] = {0};
-	fs_bitmap_t *bits;
-
-	for(i = 0; i < rgp->rd_ri.ri_length; i++) {
-		bits = &rgp->rd_bits[i];
-		rgrp_countbits(BH_DATA(rgp->rd_bh[i]) + bits->bi_offset,
-			       bits->bi_len, bit_array_rgrp);
-	}
-	log_err("rgrp: free %u used %u meta_free %u meta_used %u\n",
-		bit_array_rgrp[0], bit_array_rgrp[1],
-		bit_array_rgrp[2], bit_array_rgrp[3]);
-	fsck_countbits(rgp->rd_sbd, rgp->rd_ri.ri_data1,
-		       rgp->rd_ri.ri_data, bit_array_fsck);
-	log_err("fsck: free %u used %u meta_free %u meta_used %u\n",
-		bit_array_fsck[0], bit_array_fsck[1],
-		bit_array_fsck[2], bit_array_fsck[3]);
-
-	for(i = 0; i < 4; i++) {
-		if(bit_array_rgrp[i] != bit_array_fsck[i]) {
-			log_err("Bitmap count in index %d differ: "
-				"ondisk %d, fsck %d\n", i,
-				bit_array_rgrp[i], bit_array_fsck[i]);
-		}
-	}
-	return 0;
-}
-#endif /* DEBUG */
-
-static int convert_mark(enum mark_block mark, uint32_t *count)
-{
-	switch(mark) {
-
-	case meta_inval:
-		/* Convert invalid metadata to free blocks */
-	case block_free:
-		count[0]++;
-		return GFS_BLKST_FREE;
-
-	case meta_free:
-		count[4]++;
-		return GFS_BLKST_FREEMETA;
-
-	case block_used:
-		return GFS_BLKST_USED;
-
-	case inode_dir:
-	case inode_file:
-	case inode_lnk:
-	case inode_blk:
-	case inode_chr:
-	case inode_fifo:
-	case inode_sock:
-		count[1]++;
-		return GFS_BLKST_USEDMETA;
-
-	case indir_blk:
-	case leaf_blk:
-	case journal_blk:
-	case meta_other:
-	case meta_eattr:
-		count[3]++;
-		return GFS_BLKST_USEDMETA;
-
-	default:
-		log_err("Invalid state %d found\n", mark);
-		return -1;
-
-	}
-	return -1;
-}
-
-static const char *block_type_string(struct block_query *q)
-{
-	const char *blktyp[] = {"free", "used", "indirect data", "directory",
-				"file", "symlink", "block dev", "char dev",
-				"fifo", "socket", "dir leaf", "journ data",
-				"other meta", "free meta", "meta eattr",
-				"bad blk", "dup block", "eattr", "invalid"};
-	if (q->block_type < 18)
-		return (blktyp[q->block_type]);
-	return blktyp[18];
-}
-
-static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int buflen,
-		       uint64_t *rg_block, uint64_t rg_data, uint32_t *count)
-{
-	unsigned char *byte, *end;
-	unsigned int bit;
-	unsigned char rg_status, block_status;
-	struct block_query q;
-	uint64_t block;
-
-	byte = (unsigned char *)buffer;
-	bit = 0;
-	end = (unsigned char *)buffer + buflen;
-
-	while(byte < end) {
-		rg_status = ((*byte >> bit) & GFS_BIT_MASK);
-		block = rg_data + *rg_block;
-		warm_fuzzy_stuff(block);
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return 0;
-		block_check(sbp->bl, block, &q);
-
-		block_status = convert_mark(q.block_type, count);
-
-		if(rg_status != block_status) {
-			log_debug("Ondisk is %u - FSCK thinks it is %u (%u)\n",
-				  rg_status, block_status, q.block_type);
-			if((rg_status == GFS_BLKST_FREEMETA) &&
-			   (block_status == GFS_BLKST_FREE)) {
-				if(!sbp->opts->no) {
-					errors_found++;
-					log_info("Converting free metadata "
-						 "block at %" PRIu64 " to a "
-						 "free data block\n", block);
-					if(fs_set_bitmap(sbp, block, block_status)) {
-						log_warn("Failed to convert free metadata block to free data block at %PRIu64.\n", block);
-					}
-					else {
-						log_err("Succeeded.\n");
-						errors_corrected++;
-					}
-				}
-				/* If we have free_meta blocks but -n was
-				   specified, we can't convert them.  But it's
-				   also not technically an error. */
-			}
-			else {
-				const char *blockstatus[] = {"Free", "Data",
-							     "Free Meta",
-							     "Metadata"};
-
-				log_err("ondisk and fsck bitmaps differ at"
-					" block %"PRIu64"\n", block);
-				log_err("Ondisk status is %u (%s) but FSCK "
-					"thinks it should be ",
-					rg_status, blockstatus[rg_status]);
-				log_err("%u (%s)\n", block_status,
-					blockstatus[block_status]);
-				log_err("Metadata type is %u (%s)\n",
-					q.block_type,
-					block_type_string(&q));
-
-				errors_found++;
-				if(query(sbp, "Fix bitmap for block %"
-					 PRIu64"? (y/n) ", block)) {
-					if(fs_set_bitmap(sbp, block, block_status))
-						log_err("Failed.\n");
-					else {
-						log_err("Succeeded.\n");
-						errors_corrected++;
-					}
-				} else
-					log_err("Bitmap at block %"PRIu64
-						" left inconsistent\n", block);
-			}
-		}
-		(*rg_block)++;
-		bit += GFS_BIT_SIZE;
-		if (bit >= 8){
-			bit = 0;
-			byte++;
-		}
-	}
-
-	return 0;
-}
-
-#define FREE_COUNT       1
-#define USED_INODE_COUNT 2
-#define FREE_INODE_COUNT 4
-#define USED_META_COUNT  8
-#define FREE_META_COUNT  16
-#define CONVERT_FREEMETA_TO_FREE (FREE_COUNT | FREE_META_COUNT)
-
-static int update_rgrp(struct fsck_rgrp *rgp, uint32_t *count, int rgcount)
-{
-	uint32_t i;
-	fs_bitmap_t *bits;
-	uint64_t rg_block = 0;
-	uint8_t bmap = 0;
-
-	for(i = 0; i < rgp->rd_ri.ri_length; i++) {
-		bits = &rgp->rd_bits[i];
-
-		/* update the bitmaps */
-		check_block_status(rgp->rd_sbd,
-				   BH_DATA(rgp->rd_bh[i]) + bits->bi_offset,
-				   bits->bi_len, &rg_block,
-				   rgp->rd_ri.ri_data1, count);
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return 0;
-	}
-
-	/* Compare the rgrps counters with what we found */
-	if(rgp->rd_rg.rg_free != count[0]) {
-		bmap |= FREE_COUNT;
-	}
-	if(rgp->rd_rg.rg_useddi != count[1]) {
-		bmap |= USED_INODE_COUNT;
-	}
-	if(rgp->rd_rg.rg_freedi != count[2]) {
-		bmap |= FREE_INODE_COUNT;
-	}
-	if(rgp->rd_rg.rg_usedmeta != count[3]) {
-		bmap |= USED_META_COUNT;
-	}
-	if(rgp->rd_rg.rg_freemeta != count[4]) {
-		bmap |= FREE_META_COUNT;
-	}
-
-	if(bmap && !(bmap & ~CONVERT_FREEMETA_TO_FREE)) {
-		log_notice("Converting %d unused metadata blocks to free data blocks...\n",
-			   rgp->rd_rg.rg_freemeta - count[4]);
-		rgp->rd_rg.rg_free = count[0];
-		rgp->rd_rg.rg_freemeta = count[4];
-		gfs_rgrp_out(&rgp->rd_rg, BH_DATA(rgp->rd_bh[0]));
-		if(!rgp->rd_sbd->opts->no) {
-			write_buf(rgp->rd_sbd, rgp->rd_bh[0], 0);
-		}
-	} else if(bmap) {
-		/* actually adjust counters and write out to disk */
-		if(bmap & FREE_COUNT) {
-			log_err("RG #%d free count inconsistent: is %u should be %u\n",
-					rgcount, rgp->rd_rg.rg_free, count[0] );
-			rgp->rd_rg.rg_free = count[0];
-		}
-		if(bmap & USED_INODE_COUNT) {
-			log_err("RG #%d used inode count inconsistent: is %u should be %u\n",
-				rgcount, rgp->rd_rg.rg_useddi, count[1]);
-			rgp->rd_rg.rg_useddi = count[1];
-		}
-		if(bmap & FREE_INODE_COUNT) {
-			log_err("RG #%d free inode count inconsistent: is %u should be %u\n",
-				rgcount, rgp->rd_rg.rg_freedi, count[2]);
-			rgp->rd_rg.rg_freedi = count[2];
-		}
-		if(bmap & USED_META_COUNT) {
-			log_err("RG #%d used meta count inconsistent: is %u should be %u\n",
-				rgcount, rgp->rd_rg.rg_usedmeta, count[3]);
-			rgp->rd_rg.rg_usedmeta = count[3];
-		}
-		if(bmap & FREE_META_COUNT) {
-			log_err("RG #%d free meta count inconsistent: is %u should be %u\n",
-				rgcount, rgp->rd_rg.rg_freemeta, count[4]);
-			rgp->rd_rg.rg_freemeta = count[4];
-		}
-
-		errors_found++;
-		if(query(rgp->rd_sbd,
-			 "Update resource group counts? (y/n) ")) {
-			errors_corrected++;
-			log_warn("Resource group counts updated\n");
-			/* write out the rgrp */
-			gfs_rgrp_out(&rgp->rd_rg, BH_DATA(rgp->rd_bh[0]));
-			write_buf(rgp->rd_sbd, rgp->rd_bh[0], 0);
-		} else {
-			log_err("Resource group counts left inconsistent\n");
-		}
-	}
-
-	return 0;
-}
-
-/**
- * pass5 - check resource groups
- *
- * fix free block maps
- * fix used inode maps
- */
-int pass5(struct fsck_sb *sbp, struct options *opts)
-{
-	osi_list_t *tmp;
-	struct fsck_rgrp *rgp = NULL;
-	uint32_t count[5];
-	uint64_t rg_count = 1;
-
-	/* Reconcile RG bitmaps with fsck bitmap */
-	for(tmp = sbp->rglist.next; tmp != &sbp->rglist; tmp = tmp->next){
-		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return FSCK_OK;
-		log_info("Updating Resource Group %"PRIu64"\n", rg_count);
-		memset(count, 0, sizeof(*count) * 5);
-		rgp = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-
-		if(fs_rgrp_read(rgp, FALSE)){
-			stack;
-			return FSCK_ERROR;
-		}
-		/* Compare the bitmaps and report the differences */
-		update_rgrp(rgp, count, rg_count);
-		rg_count++;
-		fs_rgrp_relse(rgp);
-	}
-	/* Fix up superblock info based on this - don't think there's
-	 * anything to do here... */
-
-
-	return FSCK_OK;
-}
diff --git a/gfs/gfs_fsck/rgrp.c b/gfs/gfs_fsck/rgrp.c
deleted file mode 100644
index 68d405e..0000000
--- a/gfs/gfs_fsck/rgrp.c
+++ /dev/null
@@ -1,633 +0,0 @@
-#include "util.h"
-#include "bio.h"
-#include "fs_bits.h"
-#include "fs_inode.h"
-#include "fsck_incore.h"
-#include "fsck.h"
-#include "rgrp.h"
-#include "inode.h"
-
-/**
- * fs_compute_bitstructs - Compute the bitmap sizes
- * @rgd: The resource group descriptor
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_compute_bitstructs(struct fsck_rgrp *rgd)
-{
-	struct fsck_sb *sdp = rgd->rd_sbd;
-	fs_bitmap_t *bits;
-	uint32 length = rgd->rd_ri.ri_length;
-	uint32 bytes_left, bytes;
-	int x;
-
-	/* Max size of an rg is 2GB.  A 2GB RG with (minimum) 512-byte blocks
-	   has 4194304 blocks.  We can represent 4 blocks in one bitmap byte.
-	   Therefore, all 4194304 blocks can be represented in 1048576 bytes.
-	   Subtract a metadata header for each 512-byte block and we get
-	   488 bytes of bitmap per block.  Divide 1048576 by 488 and we can
-	   be assured we should never have more than 2149 of them. */
-	if (length > 2149 || length == 0) {
-		log_err("Invalid length %u found in rindex.\n", length);
-		return -1;
-	}
-	if(!(rgd->rd_bits = (fs_bitmap_t *)malloc(length * sizeof(fs_bitmap_t)))) {
-		log_err("Unable to allocate bitmap structure\n");
-		stack;
-		return -1;
-	}
-	if(!memset(rgd->rd_bits, 0, length * sizeof(fs_bitmap_t))) {
-		free(rgd->rd_bits);
-		log_err("Unable to zero bitmap structure\n");
-		stack;
-		return -1;
-	}
-	
-	bytes_left = rgd->rd_ri.ri_bitbytes;
-
-	for (x = 0; x < length; x++){
-		bits = &rgd->rd_bits[x];
-
-		if (length == 1){
-			bytes = bytes_left;
-			bits->bi_offset = sizeof(struct gfs_rgrp);
-			bits->bi_start = 0;
-			bits->bi_len = bytes;
-		}
-		else if (x == 0){
-			bytes = sdp->sb.sb_bsize - sizeof(struct gfs_rgrp);
-			bits->bi_offset = sizeof(struct gfs_rgrp);
-			bits->bi_start = 0;
-			bits->bi_len = bytes;
-		}
-		else if (x + 1 == length){
-			bytes = bytes_left;
-			bits->bi_offset = sizeof(struct gfs_meta_header);
-			bits->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
-			bits->bi_len = bytes;
-		}
-		else{
-			bytes = sdp->sb.sb_bsize - sizeof(struct gfs_meta_header);
-			bits->bi_offset = sizeof(struct gfs_meta_header);
-			bits->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
-			bits->bi_len = bytes;
-		}
-
-		bytes_left -= bytes;
-	}
-
-	if(bytes_left){
-		log_err( "fs_compute_bitstructs:  Too many blocks in rgrp to "
-			"fit into available bitmap.\n");
-		free(rgd->rd_bits);
-		return -1;
-	}
-
-	if((rgd->rd_bits[length - 1].bi_start +
-	    rgd->rd_bits[length - 1].bi_len) * GFS_NBBY != rgd->rd_ri.ri_data){
-		log_err( "fs_compute_bitstructs:  # of blks in rgrp do not equal "
-			"# of blks represented in bitmap.\n"
-			"\tbi_start = %u\n"
-			"\tbi_len   = %u\n"
-			"\tGFS_NBBY = %u\n"
-			"\tri_data  = %u\n",
-			rgd->rd_bits[length - 1].bi_start,
-			rgd->rd_bits[length - 1].bi_len,
-			GFS_NBBY,
-			rgd->rd_ri.ri_data);
-		free(rgd->rd_bits);
-		return -1;
-	}
-
-
-	if(!(rgd->rd_bh = (osi_buf_t **)malloc(length * sizeof(osi_buf_t *)))) {
-		log_err("Unable to allocate osi_buf structure\n");
-		stack;
-		free(rgd->rd_bits);
-		return -1;
-	}
-	if(!memset(rgd->rd_bh, 0, length * sizeof(osi_buf_t *))) {
-		log_err("Unable to zero osi_buf structure\n");
-		stack;
-		free(rgd->rd_bits);
-		return -1;
-	}
-
-	return 0;
-}
-
-
-/**
- * blk2rgrpd - Find resource group for a given data block number
- * @sdp: The GFS superblock
- * @n: The data block number
- *
- * Returns: Ths resource group, or NULL if not found
- */
-struct fsck_rgrp *fs_blk2rgrpd(struct fsck_sb *sdp, uint64 blk)
-{
-	osi_list_t *tmp;
-	struct fsck_rgrp *rgd = NULL;
-	struct gfs_rindex *ri;
-
-	for(tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next){
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-		ri = &rgd->rd_ri;
-
-		if (ri->ri_data1 <= blk && blk < ri->ri_data1 + ri->ri_data){
-			break;
-		} else
-			rgd = NULL;
-	}
-	return rgd;
-}
-
-/**
- * fs_rgrp_read - read in the resource group information from disk.
- * @rgd - resource group structure
- * @repair_if_corrupted - If TRUE, rgrps found to be corrupt should be repaired
- *                 according to the index.  If FALSE, no corruption is fixed.
- */
-int fs_rgrp_read(struct fsck_rgrp *rgd, int repair_if_corrupted)
-{
-	struct fsck_sb *sdp = rgd->rd_sbd;
-	unsigned int x, length = rgd->rd_ri.ri_length;
-	int error;
-
-	if(rgd->rd_open_count){
-		rgd->rd_open_count++;
-		return 0;
-	}
-
-	for (x = 0; x < length; x++){
-		if(rgd->rd_bh[x]){
-			log_err("Programmer error!  Bitmaps are already present in rgrp.\n");
-			exit(FSCK_ERROR);
-		}
-		error = get_and_read_buf(sdp, rgd->rd_ri.ri_addr + x,
-								 &(rgd->rd_bh[x]), 0);
-		if (error) {
-		  	log_err("Unable to read rgrp from disk.\n"); 
-		  	goto fail;
-		}
-
-		if(check_meta(rgd->rd_bh[x], (x) ? GFS_METATYPE_RB : GFS_METATYPE_RG)){
-			log_err("Block #%"PRIu64" (0x%"PRIx64") (%d of %d) is neither"
-					" GFS_METATYPE_RB nor GFS_METATYPE_RG.\n",
-					BH_BLKNO(rgd->rd_bh[x]), BH_BLKNO(rgd->rd_bh[x]),
-					(int)x+1, (int)length);
-			if (repair_if_corrupted) {
-				errors_found++;
-				if (query(sdp, "Fix the RG? (y/n)")) {
-					log_err("Attempting to repair the RG.\n");
-					if (x) {
-						struct gfs_meta_header mh;
-
-						memset(&mh, 0, sizeof(mh));
-						mh.mh_magic = GFS_MAGIC;
-						mh.mh_type = GFS_METATYPE_RB;
-						mh.mh_format = GFS_FORMAT_RB;
-						gfs_meta_header_out(&mh,
-								    BH_DATA(rgd->rd_bh[x]));
-					} else {
-						memset(&rgd->rd_rg, 0,
-						       sizeof(struct gfs_rgrp));
-						rgd->rd_rg.rg_header.mh_magic =
-							GFS_MAGIC;
-						rgd->rd_rg.rg_header.mh_type =
-							GFS_METATYPE_RG;
-						rgd->rd_rg.rg_header.mh_format =
-							GFS_FORMAT_RG;
-						rgd->rd_rg.rg_free =
-							rgd->rd_ri.ri_data;
-						gfs_rgrp_out(&rgd->rd_rg,
-							     BH_DATA(rgd->rd_bh[x]));
-					}
-					write_buf(sdp, rgd->rd_bh[x], BW_WAIT);
-					errors_corrected++;
-				}
-			}
-			else {
-				error = -1;
-				goto fail;
-			}
-		}
-	}
-
-	gfs_rgrp_in(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-	rgd->rd_open_count = 1;
-
-	return 0;
-
- fail:
-	for (x = 0; x < length; x++){
-		if (rgd->rd_bh[x]) {
-			relse_buf(sdp, rgd->rd_bh[x]);
-			rgd->rd_bh[x] = NULL;
-		}
-	}
-
-	log_err("Resource group or index is corrupted.\n");
-	return error;
-}
-
-void fs_rgrp_relse(struct fsck_rgrp *rgd)
-{
-	int x, length = rgd->rd_ri.ri_length;
-
-	rgd->rd_open_count--;
-	if(rgd->rd_open_count){
-		;
-	} else {
-		for (x = 0; x < length; x++){
-			if (rgd->rd_bh[x]) {
-				relse_buf(rgd->rd_sbd, rgd->rd_bh[x]);
-				rgd->rd_bh[x] = NULL;
-			}
-		}
-	}
-}
-
-#if 0 /* no one calls this, so don't waste memory for it: */
-/**
- * rgrp_verify - Verify that a resource group is consistent
- * @sdp: the filesystem
- * @rgd: the rgrp
- *
- * Returns: 0 if ok, -1 on error
- */
-int fs_rgrp_verify(struct fsck_rgrp *rgd)
-{
-	fs_bitmap_t *bits = NULL;
-	uint32 length = rgd->rd_ri.ri_length;
-	uint32 count[4], tmp;
-	int buf, x;
-
-	for (x = 0; x < 4; x++){
-		count[x] = 0;
-
-		for (buf = 0; buf < length; buf++){
-			bits = &rgd->rd_bits[buf];
-			count[x] += fs_bitcount(BH_DATA(rgd->rd_bh[buf]) + bits->bi_offset,
-						bits->bi_len, x);
-		}
-	}
-
-	if(count[0] != rgd->rd_rg.rg_free){
-		log_err("free data mismatch:  %u != %u\n",
-			count[0], rgd->rd_rg.rg_free);
-		return -1;
-	}
-
-	tmp = rgd->rd_ri.ri_data -
-		(rgd->rd_rg.rg_usedmeta + rgd->rd_rg.rg_freemeta) -
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi) -
-		rgd->rd_rg.rg_free;
-
-	if(count[1] != tmp){
-		log_err("used data mismatch:  %u != %u\n",
-			count[1], tmp);
-		return -1;
-	}
-	if(count[2] != rgd->rd_rg.rg_freemeta){
-		log_err("free metadata mismatch:  %u != %u\n",
-			count[2], rgd->rd_rg.rg_freemeta);
-		return -1;
-	}
-
-	tmp = rgd->rd_rg.rg_usedmeta +
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi);
-
-	if(count[3] != tmp){
-		log_err("used metadata mismatch:  %u != %u\n",
-			count[3], tmp);
-		return -1;
-	}
-	return 0;
-}
-#endif
-
-/**
- * fs_rgrp_recount - adjust block tracking numbers
- * rgd: resource group
- *
- * The resource groups keep track of how many free blocks, used blocks,
- * etc there are.  This function readjusts those numbers based on the
- * current state of the bitmap.
- *
- * Returns: 0 on success, -1 on failure
- */
-int fs_rgrp_recount(struct fsck_rgrp *rgd){
-	int i,j;
-	fs_bitmap_t *bits = NULL;
-	uint32 length = rgd->rd_ri.ri_length;
-	uint32 count[4], tmp;
-
-	for(i=0; i < 4; i++){
-		count[i] = 0;
-		for(j = 0; j < length; j++){
-			bits = &rgd->rd_bits[j];
-			count[i] += fs_bitcount((unsigned char *)
-						BH_DATA(rgd->rd_bh[j]) +
-						bits->bi_offset,
-						bits->bi_len, i);
-		}
-	}
-	if(count[0] != rgd->rd_rg.rg_free){
-		log_warn("\tAdjusting free block count (%u -> %u).\n",
-			rgd->rd_rg.rg_free, count[0]);
-		rgd->rd_rg.rg_free = count[0];
-	}
-	if(count[2] != rgd->rd_rg.rg_freemeta){
-		log_warn("\tAdjusting freemeta block count (%u -> %u).\n",
-		       rgd->rd_rg.rg_freemeta, count[2]);
-		rgd->rd_rg.rg_freemeta = count[2];
-	}
-	tmp = rgd->rd_rg.rg_usedmeta +
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi);
-
-	if(count[3] != tmp){
-		int first = 1;
-		struct fsck_sb *sdp = rgd->rd_sbd;
-		uint32 useddi = 0;
-		uint32 freedi = 0;
-		uint64 block;
-		struct fsck_inode *ip;
-
-		while (1){  /* count the used dinodes */
-			if(next_rg_metatype(rgd, &block,
-					    GFS_METATYPE_DI, first)){
-				break;
-			}
-			first = 0;
-			if(load_inode(sdp, block, &ip)) {
-				stack;
-				continue;
-			}
-
-			if (ip->i_di.di_flags & GFS_DIF_UNUSED){
-				freedi++;
-				continue;
-			}
-			free_inode(&ip);
-			useddi++;
-		}
-
-		if(useddi != rgd->rd_rg.rg_useddi){
-			log_warn("\tAdjusting used dinode block count (%u -> %u).\n",
-				rgd->rd_rg.rg_useddi, useddi);
-			rgd->rd_rg.rg_useddi = useddi;
-		}
-		if(freedi != rgd->rd_rg.rg_freedi){
-			log_warn("\tAdjusting free dinode block count (%u -> %u).\n",
-				rgd->rd_rg.rg_freedi, freedi);
-			rgd->rd_rg.rg_freedi = freedi;
-		}
-		if(rgd->rd_rg.rg_usedmeta != count[3] - (freedi + useddi)){
-			log_warn("\tAdjusting used meta block count (%u -> %u).\n",
-				rgd->rd_rg.rg_usedmeta,
-				(count[3] - (freedi + useddi)));
-			rgd->rd_rg.rg_usedmeta = count[3] - (freedi + useddi);
-		}
-	}
-
-	tmp = rgd->rd_ri.ri_data -
-		(rgd->rd_rg.rg_usedmeta + rgd->rd_rg.rg_freemeta) -
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi) -
-		rgd->rd_rg.rg_free;
-
-	if(count[1] != tmp){
-		log_err("Could not reconcile rgrp block counts.\n");
-		return -1;
-	}
-	return 0;
-}
-
-
-
-/**
- * clump_alloc - Allocate a clump of metadata
- * @rgd: the resource group descriptor
- * @goal: the goal block in the RG
- *
- * Returns: 0 on success, -1 on failure
- */
-int clump_alloc(struct fsck_rgrp *rgd, uint32 goal)
-{
-	struct fsck_sb *sdp = rgd->rd_sbd;
-	struct gfs_meta_header mh;
-	osi_buf_t *bh[GFS_META_CLUMP] = {0};
-	uint32 block;
-	int i,j;
-	int error = 0;
-
-	memset(&mh, 0, sizeof(struct gfs_meta_header));
-	mh.mh_magic = GFS_MAGIC;
-	mh.mh_type = GFS_METATYPE_NONE;
-
-	if(rgd->rd_rg.rg_free < GFS_META_CLUMP){
-		log_debug(" Not enough free blocks in rgrp.\n");
-		return -1;
-	}
-
-	for (i = 0; i < GFS_META_CLUMP; i++){
-		block = fs_blkalloc_internal(rgd, goal,
-					     GFS_BLKST_FREE,
-					     GFS_BLKST_FREEMETA, TRUE);
-		log_debug("Got block %u\n", block);
-
-		if(block == BFITNOENT) {
-			log_err("Unable to get enough blocks\n");
-			goto fail;
-		}
-		block += rgd->rd_ri.ri_data1;
-		block_set(rgd->rd_sbd->bl, block, meta_free);
-		if(get_buf(sdp, block, &(bh[i]))){
-			log_err("Unable to allocate new buffer.\n");
-			goto fail;
-		}
-		gfs_meta_header_out(&mh, BH_DATA(bh[i]));
-
-		goal = block;
-	}
-
-	log_debug("64 Meta blocks (%"PRIu64" - %"PRIu64"), allocated in rgrp 0x%lx\n",
-		(rgd->rd_ri.ri_data1 + block)-63,
-		(rgd->rd_ri.ri_data1 + block),
-		(unsigned long)rgd);
-	for (j = 0; j < GFS_META_CLUMP; j++){
-
-		error = write_buf(sdp, bh[j], BW_WAIT);
-		if (error){
-			log_err("Unable to write allocated metablock to disk.\n");
-			goto fail;
-		}
-	}
-
-	if(rgd->rd_rg.rg_free < GFS_META_CLUMP){
-		log_err("More blocks were allocated from rgrp "
-			"than are available.\n");
-		goto fail;
-	}
-	rgd->rd_rg.rg_free -= GFS_META_CLUMP;
-	rgd->rd_rg.rg_freemeta += GFS_META_CLUMP;
-
-	for (i = 0; i < GFS_META_CLUMP; i++)
-		relse_buf(sdp, bh[i]);
-
-	return 0;
-
- fail:
-	log_debug("clump_alloc failing...\n");
-	for(--i; i >=0; i--){
-		fs_set_bitmap(sdp, BH_BLKNO(bh[i]), GFS_BLKST_FREE);
-		/*relse_buf(sdp, bh[i]);*/
-	}
-	return -1;
-}
-
-
-/**
- * fs_blkalloc - Allocate a data block
- * @ip: the inode to allocate the data block for
- * @block: the block allocated
- *
- * Returns: 0 on success, -1 on failure
- */
-int fs_blkalloc(struct fsck_inode *ip, uint64 *block)
-{
-	osi_list_t *tmp;
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct fsck_rgrp *rgd;
-	uint32 goal;
-	int same;
-
-	for(tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next){
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-
-		if(!rgd){
-			log_err( "fs_blkalloc:  Bad rgrp list!\n");
-			return -1;
-		}
-
-		if(fs_rgrp_read(rgd, FALSE)){
-			log_err( "fs_blkalloc:  Unable to read rgrp.\n");
-			return -1;
-		}
-
-		if(!rgd->rd_rg.rg_free){
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-
-		same = (rgd->rd_ri.ri_addr == ip->i_di.di_goal_rgrp);
-		goal = (same) ? ip->i_di.di_goal_dblk : 0;
-
-		*block = fs_blkalloc_internal(rgd, goal,
-					      GFS_BLKST_FREE,
-					      GFS_BLKST_USED, TRUE);
-
-		log_debug("Got block %"PRIu64"\n", *block);
-		if(*block == BFITNOENT) {
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-		if (!same){
-			ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-			ip->i_di.di_goal_mblk = 0;
-		}
-
-		*block += rgd->rd_ri.ri_data1;
-		ip->i_di.di_goal_dblk = *block;
-
-		rgd->rd_rg.rg_free--;
-
-		gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-		if(write_buf(sdp, rgd->rd_bh[0], 0)){
-			log_err( "Unable to write out rgrp block #%"
-				PRIu64".\n",
-				BH_BLKNO(rgd->rd_bh[0]));
-			fs_rgrp_relse(rgd);
-			return -1;
-		}
-		fs_rgrp_relse(rgd);
-		return 0;
-	}
-
-	return 1;
-}
-
-
-/**
- * fs_metaalloc - Allocate a metadata block to a file
- * @ip:  the file
- * @block: the block allocated
- *
- * Returns: 0 on success, -1 on failure
- */
-int fs_metaalloc(struct fsck_inode *ip, uint64 *block)
-{
-	osi_list_t *tmp;
-	struct fsck_sb *sdp = ip->i_sbd;
-	struct fsck_rgrp *rgd;
-	uint32 goal;
-	int same;
-	int error = 0;
-
-	/* ATTENTION -- maybe we should try to allocate from goal rgrp first */
-	for(tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next){
-		rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-
-		if(!rgd){
-			log_err( "fs_metaalloc:  Bad rgrp list!\n");
-			return -1;
-		}
-
-		if(fs_rgrp_read(rgd, FALSE)){
-			log_err( "fs_metaalloc:  Unable to read rgrp.\n");
-			return -1;
-		}
-
-		same = (rgd->rd_ri.ri_addr == ip->i_di.di_goal_rgrp);
-		goal = (same) ? ip->i_di.di_goal_mblk : 0;
-
-		if (!rgd->rd_rg.rg_freemeta){
-			error = clump_alloc(rgd, goal);
-			if (error){
-				fs_rgrp_relse(rgd);
-				continue;
-			}
-		}
-
-
-		if(!rgd->rd_rg.rg_freemeta){
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-		*block = fs_blkalloc_internal(rgd, goal,
-					      GFS_BLKST_FREEMETA,
-					      GFS_BLKST_USEDMETA, TRUE);
-		log_debug("Got block %"PRIu64"\n", *block);
-		if(*block == BFITNOENT) {
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-		if (!same){
-			ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-			ip->i_di.di_goal_dblk = 0;
-		}
-		*block += rgd->rd_ri.ri_data1;
-		ip->i_di.di_goal_mblk = *block;
-
-		rgd->rd_rg.rg_freemeta--;
-		rgd->rd_rg.rg_usedmeta++;
-
-		gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-		write_buf(sdp, rgd->rd_bh[0], 0);
-		fs_rgrp_relse(rgd);
-		/* if we made it this far, then we are ok */
-		return 0;
-	}
-
-	return -1;
-}
diff --git a/gfs/gfs_fsck/rgrp.h b/gfs/gfs_fsck/rgrp.h
deleted file mode 100644
index 1312ba6..0000000
--- a/gfs/gfs_fsck/rgrp.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _RGRP_H
-#define _RGRP_H
-
-struct fsck_sb;
-struct fsck_rgrp;
-struct fsck_inode;
-
-int fs_compute_bitstructs(struct fsck_rgrp *rgd);
-struct fsck_rgrp *fs_blk2rgrpd(struct fsck_sb *sdp, uint64_t blk);
-
-int fs_rgrp_read(struct fsck_rgrp *rgd, int repair_if_corrupted);
-void fs_rgrp_relse(struct fsck_rgrp *rgd);
-int fs_rgrp_verify(struct fsck_rgrp *rgd);
-int fs_rgrp_recount(struct fsck_rgrp *rgd);
-
-int clump_alloc(struct fsck_rgrp *rgd, uint32_t goal);
-int fs_blkalloc(struct fsck_inode *ip, uint64_t *block);
-int fs_metaalloc(struct fsck_inode *ip, uint64_t *block);
-
-#endif /* _RGRP_H */
diff --git a/gfs/gfs_fsck/super.c b/gfs/gfs_fsck/super.c
deleted file mode 100644
index 0a13ce2..0000000
--- a/gfs/gfs_fsck/super.c
+++ /dev/null
@@ -1,1435 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <errno.h>
-
-#include "osi_list.h"
-#include "osi_user.h"
-#include "bio.h"
-#include "util.h"
-#include "file.h"
-#include "rgrp.h"
-#include "fsck.h"
-#include "ondisk.h"
-#include "super.h"
-#include "fsck_incore.h"
-
-#ifndef BLKGETSIZE64
-#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
-#endif
-
-#define DIV_RU(x, y) (((x) + (y) - 1) / (y))
-#define ri_compare(rg, ondisk, expected, field, fmt)	\
-	if (ondisk.field != expected.field) { \
-		log_warn("rgindex #%d " #field " discrepancy: index 0x%" fmt \
-				 " != expected: 0x%" fmt "\n", \
-				 rg + 1, ondisk.field, expected.field);	\
-		ondisk.field = expected.field; \
-		rgindex_modified = TRUE; \
-	}
-
-struct mkfs_subdevice
-{
-	uint64 start;
-	uint64 length;
-	int is_journal;
-};
-
-struct mkfs_device
-{
-	unsigned int nsubdev;
-	struct mkfs_subdevice *subdev;
-};
-
-static uint64 total_journal_space;
-
-/**
- * check_sb - Check superblock
- * @sdp: the filesystem
- * @sb: The superblock
- *
- * Checks the version code of the FS is one that we understand how to
- * read and that the sizes of the various on-disk structures have not
- * changed.
- *
- * Returns: 0 on success, -1 on failure
- */
-static int check_sb(struct fsck_sb *sdp, struct gfs_sb *sb)
-{
-	int error = 0;
-	if (sb->sb_header.mh_magic != GFS_MAGIC ||
-	    sb->sb_header.mh_type != GFS_METATYPE_SB){
-		log_crit("Either the super block is corrupted, or this "
-			 "is not a GFS filesystem\n");
-		log_debug("Header magic: %X Header Type: %X\n",
-			  sb->sb_header.mh_magic,
-			  sb->sb_header.mh_type);
-		error = -EINVAL;
-		goto out;
-	}
-
-	/*  If format numbers match exactly, we're done.  */
-	if (sb->sb_fs_format != GFS_FORMAT_FS ||
-	    sb->sb_multihost_format != GFS_FORMAT_MULTI){
-		log_warn("Old file system detected.\n");
-	}
-
- out:
-	return error;
-}
-
-
-/*
- * read_sb: read the super block from disk
- * sdp: in-core super block
- *
- * This function reads in the super block from disk and
- * initializes various constants maintained in the super
- * block
- *
- * Returns: 0 on success, -1 on failure.
- */
-int read_sb(struct fsck_sb *sdp)
-{
-	osi_buf_t *bh;
-	uint64 space = 0;
-	unsigned int x;
-	int error;
-	error = get_and_read_buf(sdp, GFS_SB_ADDR >> sdp->fsb2bb_shift, &bh, 0);
-	if (error){
-		log_crit("Unable to read superblock\n");
-		goto out;
-	}
-
-	gfs_sb_in(&sdp->sb, BH_DATA(bh));
-
-	relse_buf(sdp, bh);
-
-	error = check_sb(sdp, &sdp->sb);
-	if (error)
-		goto out;
-
-/* FIXME: Need to verify all this */
-	/* FIXME: What's this 9? */
-	sdp->fsb2bb_shift = sdp->sb.sb_bsize_shift - 9;
-	sdp->diptrs =
-		(sdp->sb.sb_bsize - sizeof(struct gfs_dinode)) /
-		sizeof(uint64);
-	sdp->inptrs =
-		(sdp->sb.sb_bsize - sizeof(struct gfs_indirect)) /
-		sizeof(uint64);
-	sdp->jbsize = sdp->sb.sb_bsize - sizeof(struct gfs_meta_header);
-	/* FIXME: Why is this /2 */
-	sdp->hash_bsize = sdp->sb.sb_bsize / 2;
-	sdp->hash_ptrs = sdp->hash_bsize / sizeof(uint64);
-	sdp->heightsize[0] = sdp->sb.sb_bsize -
-		sizeof(struct gfs_dinode);
-	sdp->heightsize[1] = sdp->sb.sb_bsize * sdp->diptrs;
-	for (x = 2; ; x++){
-		space = sdp->heightsize[x - 1] * sdp->inptrs;
-		/* FIXME: Do we really need this first check?? */
-		if (space / sdp->inptrs != sdp->heightsize[x - 1] ||
-		    space % sdp->inptrs != 0)
-			break;
-		sdp->heightsize[x] = space;
-	}
-	sdp->max_height = x;
-	if(sdp->max_height > GFS_MAX_META_HEIGHT){
-		log_err("Bad max metadata height.\n");
-		error = -1;
-		goto out;
-	}
-
-	sdp->jheightsize[0] = sdp->sb.sb_bsize -
-		sizeof(struct gfs_dinode);
-	sdp->jheightsize[1] = sdp->jbsize * sdp->diptrs;
-	for (x = 2; ; x++){
-		space = sdp->jheightsize[x - 1] * sdp->inptrs;
-		if (space / sdp->inptrs != sdp->jheightsize[x - 1] ||
-		    space % sdp->inptrs != 0)
-			break;
-		sdp->jheightsize[x] = space;
-	}
-	sdp->max_jheight = x;
-	if(sdp->max_jheight > GFS_MAX_META_HEIGHT){
-		log_err("Bad max jheight.\n");
-		error = -1;
-	}
-
- out:
-
-	return error;
-}
-
-
-/*
- * ji_update - fill in journal info
- * ip: the journal index inode
- *
- * Given the inode for the journal index, read in all
- * the journal indexes.
- *
- * Returns: 0 on success, -1 on failure
- */
-int ji_update(struct fsck_sb *sdp)
-{
-	struct fsck_inode *ip = sdp->jiinode;
-	char buf[sizeof(struct gfs_jindex)];
-	unsigned int j;
-	int error=0;
-
-
-	if(ip->i_di.di_size % sizeof(struct gfs_jindex) != 0){
-		log_err("The size reported in the journal index"
-			" inode is not a\n"
-			 "\tmultiple of the size of a journal index.\n");
-		return -1;
-	}
-
-	if(!(sdp->jindex = (struct gfs_jindex *)malloc(ip->i_di.di_size))) {
-		log_err("Unable to allocate journal index\n");
-		return -1;
-	}
-	if(!memset(sdp->jindex, 0, ip->i_di.di_size)) {
-		log_err("Unable to zero journal index\n");
-		return -1;
-	}
-	total_journal_space = 0;
-
-	for (j = 0; ; j++) {
-		struct gfs_jindex *journ;
-		error = readi(ip, buf, j * sizeof(struct gfs_jindex),
-				 sizeof(struct gfs_jindex));
-		if(!error)
-			break;
-		if (error != sizeof(struct gfs_jindex)){
-			log_err("An error occurred while reading the"
-				" journal index file.\n");
-			goto fail;
-		}
-
-		journ = sdp->jindex + j;
-		gfs_jindex_in(journ, buf);
-		sdp->ji_nsegment = journ->ji_nsegment;
-		total_journal_space += journ->ji_nsegment * sdp->sb.sb_seg_size;
-	}
-
-
-	if(j * sizeof(struct gfs_jindex) != ip->i_di.di_size){
-		log_err("journal inode size invalid\n");
-		log_debug("j * sizeof(struct gfs_jindex) !="
-			  " ip->i_di.di_size\n");
-		log_debug("%d != %d\n",
-			  j * sizeof(struct gfs_jindex), ip->i_di.di_size);
-		goto fail;
-	}
-	sdp->journals = j;
-	log_debug("%d journals found.\n", j);
-
-	return 0;
-
- fail:
-	free(sdp->jindex);
-	return -1;
-}
-
-/**
- * rgrplength2bitblocks - Stolen from gfs_mkfs.
- *
- * @sdp:    the superblock
- * @length: the number of blocks in a RG
- *
- * Give a number of blocks in a RG, figure out the number of blocks
- * needed for bitmaps.
- *
- * Returns: the number of bitmap blocks
- */
-
-static uint32 rgrplength2bitblocks(struct fsck_sb *sdp, uint32 length)
-{
-	uint32 bitbytes;
-	uint32 old_blocks = 0, blocks;
-	int tries = 0;
-	
-	for (;;) {
-		bitbytes = (length - old_blocks) / GFS_NBBY;
-		blocks = 1;
-
-		if (bitbytes > sdp->sb.sb_bsize - sizeof(struct gfs_rgrp)) {
-			bitbytes -= sdp->sb.sb_bsize - sizeof(struct gfs_rgrp);
-			blocks += DIV_RU(bitbytes, (sdp->sb.sb_bsize -
-					      sizeof(struct gfs_meta_header)));
-		}
-		if (blocks == old_blocks)
-			break;
-		old_blocks = blocks;
-		if (tries++ > 10) {
-			blocks = 0;
-			break;
-		}
-	}
-	return blocks;
-}
-
-/*
- * gfs_rgindex_rebuild - rebuild a corrupt Resource Group (RG) index manually
- *                       where trust_lvl == distrust
- *
- * If this routine is called, it means we have RGs in odd/unexpected places,
- * and there is a corrupt RG.  In other words, we can't trust the RG index
- * is completely sane, and the RGs don't fit on nice neat fs boundaries.
- * So we have no choice but to go through the count them by hand.
- * We've tried twice to recover the RGs and RG index, and failed.  This is
- * our last chance to remedy the situation.
- *
- * In some cases, we have no choice but to trust the rgindex file.  Since
- * it is completely hidden from the users, if we find an inconsistency,
- * it's safer to assume the index is correct and the RG is corrupt rather
- * than the RG is correct and the index is bad.  This routine goes to great
- * lengths to determine which is the case and figure it out regardless.
- *
- * This routine tries to minimize performance impact by:
- * 1. Skipping through the filesystem at known increments when possible.
- * 2. Shuffle through every block when RGs are not found at the predicted
- *    locations.
- *
- * Note: A GFS filesystem is built by gfs_mkfs into several "subdevices."
- * These are just logical divisions of the logical volume.  The gfs_mkfs
- * program considers two types of subdevices: RG-subdevices and journal
- * subdevices.  RG subdevices contain one or more RGs.  Journal subdevices
- * contain one or more journals.  For the purposes of gfs_fsck, when I talk
- * about subdevices, I'm talking about RG-subdevices only.  For a freshly
- * created GFS filesystem, the logical volume will be broken apart like this:
- *
- * RG-subdevice 0: n Resource Groups
- * Journal subdevice
- * RG-subdevice 1: n Resource Groups (same as RG-subdevice 0)
- *
- * If the filesystem has been resized via gfs_grow, there will be more
- * RG-subdevices containing more RGs.  However, gfs_fsck treats them all
- * as "subdevice 2."
- *
- * NOTE: When giving messages to the users, I am referring to them as
- * "sections" 1, 2, and 3 because "subdevice" sounds too confusing.
- *
- * If an RG is not found at a predicted location, it either means that
- * there is a corrupted RG, or else the RG has been added after the fact
- * by gfs_grow.  We can only predict the locations for RGs within a subdevice,
- * but the subdevice boundaries are not that predictable.  (Actually, they
- * are, but since we're dealing with a likely corrupt filesystem, I don't
- * want to rely on good data too much to do it this way.)
- *
- * I am, however, going to rely on the fact that the first original subdevice
- * will have the same number of RGs as the second original subdevice.
- * Other RGs found after that will be considered "extra."
- */
-static int gfs_rgindex_rebuild(struct fsck_sb *sdp, osi_list_t *ret_list,
-			unsigned int *num_rgs)
-{
-	osi_buf_t *bh; /* buffer handle */
-	uint64 subdevice_size, fs_total_size;
-	int number_of_rgs; /* #RGs this subdevice.
-						  min of 2 per segment * 2 segments = 4 */
-	int rg_number; /* real RG number (0 - x) */
-	int subd;
-	int error, corrupt_rgs;
-	int rgi, rgs_per_subd;
-	uint64 blok, block_of_last_rg;
-	uint64 block_bump;
-	uint64 shortest_dist_btwn_rgs[2]; /* one for each subdevice */
-	uint64 first_rg_dist[2], initial_first_rg_dist[2];
-	struct fsck_rgrp *calc_rgd, *prev_rgd;
-	struct gfs_rgrp tmp_rgrp;
-	osi_list_t *tmp;
-	int rg_was_fnd = FALSE;
-	struct gfs_rindex buf, tmpndx;
-	uint64 fs_size_from_rgindex = 0;
-	int index_entries_per_subd = 0, subd_ndx_entry, rg;
-	uint64_t last_known_ri_addr = 0, prev_known_ri_addr = 0;
-	uint32_t last_known_ri_length = 0;
-	uint32_t last_known_ri_data = 0;
-	int section3_bump_size = 0;
-	uint64 start_block, end_block = 0;
-
-	osi_list_init(ret_list);
-	*num_rgs = 0;
-	/* Get the total size of the device */
-	error = ioctl(sdp->diskfd, BLKGETSIZE64,
-				  &fs_total_size); /* Size in bytes */
-	fs_total_size /= sdp->sb.sb_bsize;
-	log_debug("fs_total_size = 0x%" PRIX64 " blocks.\n", fs_total_size);
-	block_of_last_rg = 0;
-	subdevice_size = 0;
-	rgs_per_subd = 0;
-	/* ----------------------------------------------------------------- */
-	/* First, figure out the exact end of the second subdevice.          */
-	/* That will tell us where the third RG-subdevice should start.      */
-	/* We need to keep track of how many entries are in the index before */
-	/* we hit the journal blocks.  That will tell us how many index      */
-	/* entries will be in the first subdevice, and the second subdevice  */
-	/* should have the same number.  After that, we don't care.          */
-	/* Note: we're using values in the rgindex, even though we don't     */
-	/* trust it.  We're relatively okay because we're just trying to     */
-	/* find the highest RG value for the second subdevice.               */
-	/* ----------------------------------------------------------------- */
-	subd = 0;
-	index_entries_per_subd = 0;
-	subd_ndx_entry = 0;
-	for (rg = 0; ; rg++) {
-		uint64 end_of_rg;
-		
-		error = readi(sdp->riinode,
-					  (char *)&buf, rg * sizeof(struct gfs_rindex),
-					  sizeof(struct gfs_rindex));
-		if (!error) /* if end of file */
-			break; /* stop looking */
-		gfs_rindex_in(&tmpndx, (char *)&buf); /* read in the index */
-		subd_ndx_entry++;
-		if (!subd) { /* if we're still in the first subdevice */
-			if (tmpndx.ri_addr >= sdp->jindex->ji_addr + total_journal_space) {
-				subd++; /* this rgindex belongs to the second subdevice */
-				prev_known_ri_addr = 0;
-				last_known_ri_addr = 0;
-				subd_ndx_entry = 1;
-			}
-			else {
-				index_entries_per_subd++;
-				/* Check if this is the last index entry for subdevice */
-				if (tmpndx.ri_addr + tmpndx.ri_length + tmpndx.ri_data >= 
-					sdp->jindex->ji_addr - GFS_NBBY) {
-					subd++; /* NEXT rgindex belongs to the second subdevice */
-					subd_ndx_entry = 0;
-					prev_known_ri_addr = 0;
-					last_known_ri_addr = 0;
-					continue;
-				}
-			}
-		}
-		end_of_rg = tmpndx.ri_addr + tmpndx.ri_length + tmpndx.ri_data;
-		/* ----------------------------------------------------------------- */
-		/* Make sure the rgindex looks relatively sane.  After all,          */
-		/* at this stage of the game, we don't trust it.                     */
-		/* ----------------------------------------------------------------- */
-		if (subd && end_of_rg > sdp->jindex->ji_addr + total_journal_space &&
-			end_of_rg <= fs_total_size) { /* looks relatively sane */
-			/* Save some data values we can fall back on: */
-			prev_known_ri_addr = last_known_ri_addr;
-			last_known_ri_addr = tmpndx.ri_addr;
-			last_known_ri_length = tmpndx.ri_length;
-			last_known_ri_data = tmpndx.ri_data;
-			if (fs_size_from_rgindex < end_of_rg)
-				fs_size_from_rgindex = end_of_rg;
-			/* Quit after we hit the same number of entries as 1st subdevice */
-			if (subd_ndx_entry >= index_entries_per_subd)
-				break;
-		}
-		else if (!subd && end_of_rg < sdp->jindex->ji_addr &&
-				 end_of_rg > 0) { /* looks relatively sane */
-			/* Save some data values we can fall back on: */
-			prev_known_ri_addr = last_known_ri_addr;
-			last_known_ri_addr = tmpndx.ri_addr;
-			last_known_ri_length = tmpndx.ri_length;
-			last_known_ri_data = tmpndx.ri_data;
-			if (fs_size_from_rgindex < end_of_rg)
-				fs_size_from_rgindex = end_of_rg;
-		}
-		else { /* Otherwise we have a corrupt index entry */
-			log_debug("Likely damage to rgindex entry %d.\n",
-					  subd_ndx_entry + (subd * index_entries_per_subd));
-			if (prev_known_ri_addr) {
-				/* Try to extrapolate from the previous one */
-				tmpndx.ri_addr = last_known_ri_addr + 
-					(last_known_ri_addr - prev_known_ri_addr);
-				tmpndx.ri_length = last_known_ri_length;
-				tmpndx.ri_data = last_known_ri_data;
-				log_debug("Extrapolating addr=0x%" PRIx64 ", length=0x%x, "
-						  "data=%x\n", tmpndx.ri_addr,
-						  tmpndx.ri_length, tmpndx.ri_data);
-				end_of_rg = tmpndx.ri_addr + tmpndx.ri_length +
-					tmpndx.ri_data;
-				if (end_of_rg > sdp->jindex->ji_addr +
-					total_journal_space &&
-					end_of_rg <= fs_total_size) { /* looks relatively okay */
-					/* Adjust data values we can fall back on: */
-					last_known_ri_addr = tmpndx.ri_addr;
-					if (fs_size_from_rgindex < end_of_rg)
-						fs_size_from_rgindex = end_of_rg;
-					/* Quit after we hit the same number of entries as
-					   the first subdevice/section */
-					if (subd_ndx_entry >= index_entries_per_subd)
-						break;
-				}
-			} /* if we have a good previous */
-			else {
-				log_debug("Not enough data to figure it out--skipped.\n");
-			}
-		} /* corrupt RG index entry */
-	} /* for all RGs in the index */
-	log_debug("Index entries/section=%d, third section addr = 0x%"PRIx64"\n",
-			  index_entries_per_subd, fs_size_from_rgindex);
-	initial_first_rg_dist[0] = first_rg_dist[0] = sdp->jindex->ji_addr -
-		((GFS_SB_ADDR >> sdp->fsb2bb_shift) + 1);
-	initial_first_rg_dist[1] = first_rg_dist[1] = sdp->jindex->ji_addr;
-	/* ----------------------------------------------------------------- */
-	/* Now let's figure out the space between RGs for the first subd,    */
-	/* and the second subd.  Subsequent RGs will be unpredictable.       */
-	/* We need to know the distance between RGs because if one is        */
-	/* corrupt or overwritten, we need to salvage it at the correct      */
-	/* location.  For example, if RG #2 is nuked, at first glance, it    */
-	/* appears as if our RGs are twice as far apart as they should be.   */
-	/* So we should chase down a couple to get more than one opinion.    */
-	/* If several RGs are nuked, sorry, I'll only go so far to recover.  */
-	/* This check will be slower because we have to read blocks 1 by 1.  */
-	/* Luckily, we only have to do a few this way.                       */
-	/* Later, we can bump ahead by the amount we find here.              */
-	/* ----------------------------------------------------------------- */
-	subdevice_size = sdp->jindex->ji_addr; /* addr of first journal */;
-	for (subd = 0; subd < 2; subd++) {
-		if (!subd)
-			start_block = (GFS_SB_ADDR >> sdp->fsb2bb_shift) + 1;
-		else
-			start_block = sdp->jindex->ji_addr + total_journal_space;
-		block_of_last_rg = start_block;
-		number_of_rgs = 0;
-		shortest_dist_btwn_rgs[subd] = subdevice_size;
-		for (blok = start_block; blok < fs_total_size; blok++) {
-			error = get_and_read_buf(sdp, blok, &bh, 0);
-			if (error){
-				log_crit("Unable to read block 0x%" PRIX64 "\n", blok);
-				return -1;
-			}
-			if ((blok == start_block) || /* If first RG block or */
-				!check_type(bh, GFS_METATYPE_RG)) { /* we found an RG */
-				log_debug("%d:RG found at block 0x%" PRIx64 "\n", subd + 1,
-						  blok);
-				/* If we spilled into the next subdevice, quit. */
-				if (blok + GFS_NBBY >= start_block + subdevice_size) {
-					log_debug("This is in the next subdevice--skipping.\n");
-					break;
-				}
-				gfs_rgrp_in(&tmp_rgrp, BH_DATA(bh));
-				if (blok == start_block) {
-					shortest_dist_btwn_rgs[subd] = subdevice_size;
-					log_debug("Start of section %d.\n", subd + 1);
-				}
-				else {
-					uint64 rgdist;
-
-					rgdist = blok - block_of_last_rg;
-					log_debug("%d:dist 0x%" PRIx64 " = 0x% " PRIx64
-							  " - 0x%" PRIx64, subd + 1, rgdist,
-							  blok, block_of_last_rg);
-					/* ----------------------------------------------------- */
-					/* We found another RG.  Check to see if we need to set  */
-					/* the first_rg_dist based on whether it's still at its  */
-					/* initial value (i.e. the whole subdevice size).        */
-					/* The first rg distance is different from the rest      */
-					/* because of the superblock and 64K dead space          */
-					/* ----------------------------------------------------- */
-					if (first_rg_dist[subd] == initial_first_rg_dist[subd])
-						first_rg_dist[subd] = rgdist;
-					if (rgdist < shortest_dist_btwn_rgs[subd])
-					{
-						shortest_dist_btwn_rgs[subd] = rgdist;
-						log_debug("(shortest so far)\n");
-					}
-					else
-						log_debug("\n");
-				}
-				number_of_rgs++; /* number of RGs this subdevice */
-				/* --------------------------------------------------------- */
-				/* Check to see if we're the last RG we want to examine.     */
-				/* If so, forget checking the next index entry and exit.     */
-				/* (The next index entry may be for the next RG anyway).     */
-				/* --------------------------------------------------------- */
-				if (number_of_rgs >= 4 ||
-					number_of_rgs >= index_entries_per_subd)
-					break;
-				/* --------------------------------------------------------- */
-				/* Read in the index entry for the NEXT RG in line and       */
-				/* compare the RG size difference with what we know.         */
-				/* --------------------------------------------------------- */
-				rg_number = number_of_rgs + (subd * index_entries_per_subd);
-				error = readi(sdp->riinode, (char *)&buf,
-							  rg_number * sizeof(struct gfs_rindex),
-							  sizeof(struct gfs_rindex));
-				if (error) { /* if we read some data (no error really) */
-					gfs_rindex_in(&tmpndx, (char *)&buf);
-					if (tmpndx.ri_addr > start_block &&
-						tmpndx.ri_addr < fs_total_size &&
-						tmpndx.ri_addr != blok &&
-						tmpndx.ri_addr - blok < 
-						shortest_dist_btwn_rgs[subd]) {
-						shortest_dist_btwn_rgs[subd] =
-							tmpndx.ri_addr - blok;
-						log_debug("Section %d RG %d(%d): shortest=0x%"PRIx64
-								  "\n", subd + 1, number_of_rgs, rg_number,
-								  shortest_dist_btwn_rgs[subd]);
-					}
-				}
-				block_of_last_rg = blok;
-				/* --------------------------------------------------------- */
-				/* We can't just check every block because some of the files */
-				/* in the fs (i.e. inside an RG) might have data that looks  */
-				/* exactly like a valid RG. Sounds farfetched, but it's not, */
-				/* based on my own experiences.                              */
-				/* In my experience, the RG locations are spaced differently */
-				/* from their used and free space numbers because of the way */
-				/* gfs_mkfs puts them.  In other words, the RG locations     */
-				/* according to the index will be different from the sum of  */
-				/* the space they take.  Why?  I don't know, but maybe it    */
-				/* has to do with the variable size of bitmaps.              */
-				/* At any rate, used+free can get us close, but not exact.   */
-				/* Therefore, we have to search for the RG after that.       */
-				/* --------------------------------------------------------- */
-				if (!error &&
-					((tmp_rgrp.rg_useddi + tmp_rgrp.rg_free + 1) >> 2) ==
-					(tmpndx.ri_addr >> 2)) {
-					blok = tmpndx.ri_addr - 1; /* go by the index */
-					log_debug("I(0x%" PRIx64 ")\n", blok);
-				}
-				/* If this is the second section, we know for sure that */
-				/* the block length can't be smaller than section 1's   */
-				/* rg length. Might as well skip ahead.                 */
-				else if (subd == 1) {
-					blok += shortest_dist_btwn_rgs[0];
-					log_debug("2(0x%" PRIx64 ")\n", blok);
-				} else {
-					blok += tmp_rgrp.rg_useddi + tmp_rgrp.rg_free;
-					log_debug("R(0x%" PRIx64 ")\n", blok);
-				}
-			} /* If first RG block or RG */
-			relse_buf(sdp, bh); /* release the read buffer */
-		} /* for blok */
-		/* -------------------------------------------------------------- */
-		/* Sanity-check our first_rg_dist. If RG #2 got nuked, the        */
-		/* first_rg_dist would measure from #1 to #3, which would be bad. */
-		/* We need to take remedial measures to fix it (from the index).  */
-		/* -------------------------------------------------------------- */
-		if (first_rg_dist[subd] >= shortest_dist_btwn_rgs[subd] +
-			(shortest_dist_btwn_rgs[subd] / 4)) {
-			log_debug("%d:Shortest dist is: 0x%" PRIx64 "\n", subd + 1,
-					  shortest_dist_btwn_rgs[subd]);
-			/* read in the second RG index entry for this subd. */
-			readi(sdp->riinode, (char *)&buf,
-				  (1 + (subd * index_entries_per_subd)) *
-				  sizeof(struct gfs_rindex),
-				  sizeof(struct gfs_rindex));
-			gfs_rindex_in(&tmpndx, (char *)&buf);
-			if (tmpndx.ri_addr > start_block) { /* sanity check */
-				log_warn("RG %d is damaged: recomputing RG dist from index: ",
-						 2 + (subd * index_entries_per_subd));
-				first_rg_dist[subd] = tmpndx.ri_addr - start_block;
-				log_warn("0x%" PRIx64 "\n", first_rg_dist[subd]);
-			}
-			else {
-				log_warn("RG index %d is damaged: extrapolating RG dist: ",
-						 2 + (subd * index_entries_per_subd));
-				first_rg_dist[subd] = (subdevice_size - start_block) %
-					((index_entries_per_subd - 1) * 
-					 shortest_dist_btwn_rgs[subd]);
-				log_warn("0x%" PRIx64 "\n", first_rg_dist[subd]);
-			}
-		} /* if first RG distance is within tolerance */
-		log_debug("First RG distance: 0x%" PRIx64 "\n", first_rg_dist[subd]);
-		log_debug("Section %d: distance between RGs: 0x%" PRIx64 "\n",
-				 subd + 1, shortest_dist_btwn_rgs[subd]);
-		log_debug("Section size: 0x%" PRIx64 "\n", subdevice_size);
-		/* If our rindex was all bad, we may have an improper count of RGs per
-		   section.  We may also not know where the third section should start.
-		   We need those for later. */
-		if (subd == 0) {
-			if (shortest_dist_btwn_rgs[subd] != 0) {
-				unsigned long long blocks_b4_sb;
-				unsigned long long index_entries;
-
-				blocks_b4_sb = (16 * (4096 / sdp->sb.sb_bsize));
-				index_entries = (subdevice_size - blocks_b4_sb) /
-					shortest_dist_btwn_rgs[subd];
-				if (index_entries_per_subd != index_entries) {
-					log_debug("rindex entries per section "
-						  "changed from %lld to %lld\n",
-						  index_entries_per_subd,
-						  index_entries);
-					index_entries_per_subd = index_entries;
-				}
-			}
-			if (fs_size_from_rgindex == 0) {
-				fs_size_from_rgindex = (sdp->jindex->ji_addr +
-							total_journal_space) +
-					subdevice_size;
-				log_debug("Fixed zero fs_size_from_rgindex "
-					  "due to rindex corruption.\n");
-				log_debug("New fs_size_from_rgindex value: "
-					  "%lld (0x%" PRIx64 ")\n",
-					  fs_size_from_rgindex,
-					  fs_size_from_rgindex);
-			}
-		}
-	} /* for subd */
-	number_of_rgs = 0; /* reset this because it is reused below */
-	/* ----------------------------------------------------------------- */
-	/* Start reading the filesystem starting with the block after the    */
-	/* superblock, which should be the first RG.                         */
-	/* The problem is that gfs_grow puts the RGs at unpredictable        */
-	/* locations.  If the fs was only grown once, that would be          */
-	/* predictable.  But if it grows twice, by different amounts, then   */
-	/* our RGs could be anywhere.  After carefully studying the problem  */
-	/* I've determined that the best thing we can do is to trust the     */
-	/* rgindex and hope to God it's correct.  That's the only way we're  */
-	/* going to be able to recover RGs in the third section.             */
-	/* ----------------------------------------------------------------- */
-	/* I know it looks like prev_rgd should be set to NULL inside the
-	   following for loop, but that actually causes the last rindex
-	   entry to be improperly left with 0 values for ri_data and
-	   ri_bitbytes.  So leave "prev_rgd = NULL" right here:  */
-	prev_rgd = NULL;
-	block_bump = first_rg_dist[0];
-	corrupt_rgs = 0;
-	for (subd = 0; subd < 3; subd++) { /* third subdevice is for all RGs
-					      extended past the normal 2 with
-					      gfs_grow, etc. */
-		if (subd == 0) {
-			start_block = (GFS_SB_ADDR >> sdp->fsb2bb_shift) + 1;
-			end_block = subdevice_size - 1;
-		}
-		else if (subd == 1) {
-			start_block = sdp->jindex->ji_addr + total_journal_space;
-			/* Moral dilemma: should we go to the last block or should */
-			/* we trust the index?  If they're close to one another,   */
-			/* let's use the index.                                    */
-			if ((fs_size_from_rgindex >> 2) ==
-				((start_block + subdevice_size - 1) >> 2)) /* if we're close */
-				end_block = fs_size_from_rgindex - 1;  /* trust the index */
-			else                                       /* otherwise */
-				end_block = start_block + subdevice_size - 1; /* go to end */
-		}
-		else {
-			/* Section 3 should start the block after section 2.  However,     */
-			/* gfs_grow sometimes foolishly decides to put it as much as three */
-			/* blocks early. So we need to check for this special case.        */
-			for (start_block = end_block - 2;
-			     start_block < end_block + 1; start_block++) {
-				error = get_and_read_buf(sdp, start_block, &bh, 0);
-				rg_was_fnd = (!check_type(bh, GFS_METATYPE_RG));
-				relse_buf(sdp, bh); /* release the read buffer */
-				if (rg_was_fnd)
-					break;
-			}
-			end_block = fs_total_size - 1;
-			if (start_block + GFS_NBBY >= end_block)
-				break;
-		}
-		log_warn("Section %d: 0x%" PRIx64 " - 0x%" PRIx64 "\n", subd + 1,
-				 start_block, end_block);
-		for (blok = start_block; blok <= end_block; blok += block_bump) {
-			uint64 fwd_block;
-			int bitmap_was_fnd;
-
-			log_debug("Block 0x%" PRIx64 "\n", blok);
-			error = get_and_read_buf(sdp, blok, &bh, 0);
-			if (error) {
-				log_crit("Unable to read block 0x%" PRIX64 "\n", blok);
-				return -1;
-			}
-			rg_was_fnd = (!check_type(bh, GFS_METATYPE_RG));
-			relse_buf(sdp, bh); /* release the read buffer */
-			if (!rg_was_fnd && subd == 2) {
-				if (section3_bump_size) {
-					log_warn("Lost track of Section 3 rg length.\n");
-					blok -= block_bump; /* back up in case we overshot it */
-					section3_bump_size = 0;
-					block_bump = 1;
-				}
-				if (block_bump == 1)
-					continue;
-			}
-			/* ------------------------------------------------------------- */
-			/* For the first and second subdevice, we know the RG size.      */
-			/* Since we're bumping by that amount, this better be an RG.     */
-			/* ------------------------------------------------------------- */
-			/* Allocate a new RG and index. */
-			calc_rgd = (struct fsck_rgrp *)malloc(sizeof(struct fsck_rgrp));
-			// FIXME: handle failed malloc
-			memset(calc_rgd, 0, sizeof(struct fsck_rgrp));
-			calc_rgd->rd_sbd = sdp; /* hopefully this is not used */
-			osi_list_add_prev(&calc_rgd->rd_list, ret_list);
-			calc_rgd->rd_ri.ri_length = 1;
-			calc_rgd->rd_ri.ri_addr = blok;
-			if (!rg_was_fnd) { /* if not an RG */
-				/* ----------------------------------------------------- */
-				/* This SHOULD be an RG but isn't.                       */
-				/* ----------------------------------------------------- */
-				corrupt_rgs++;
-				if (corrupt_rgs < 5)
-					log_debug("Missing or damaged RG at block 0x%" PRIx64 \
-							  "\n", blok);
-				else {
-					log_crit("Error: too many bad RGs.\n");
-					return -1;
-				}
-			}
-			/* ------------------------------------------------ */
-			/* Now go through and count the bitmaps for this RG */
-			/* ------------------------------------------------ */
-			bitmap_was_fnd = FALSE;
-			for (fwd_block = blok + 1; fwd_block < fs_total_size; 
-				 fwd_block++) {
-				error = get_and_read_buf(sdp, fwd_block, &bh, 0);
-				if (error){
-					log_crit("Unable to read block 0x%" PRIX64 "\n",
-							 fwd_block);
-					return -1;
-				}
-				bitmap_was_fnd = (!check_type(bh, GFS_METATYPE_RB));
-				relse_buf(sdp, bh);
-				if (bitmap_was_fnd) /* if a bitmap */
-					calc_rgd->rd_ri.ri_length++;
-				else
-					break; /* end of bitmap, so call it quits. */
-			} /* for subsequent bitmaps */
-			calc_rgd->rd_ri.ri_data1 = calc_rgd->rd_ri.ri_addr +
-				calc_rgd->rd_ri.ri_length;
-			if (prev_rgd) {
-				prev_rgd->rd_ri.ri_data = block_bump -
-					rgrplength2bitblocks(sdp, block_bump);
-				prev_rgd->rd_ri.ri_data -= prev_rgd->rd_ri.ri_data %
-					GFS_NBBY;
-				prev_rgd->rd_ri.ri_bitbytes = prev_rgd->rd_ri.ri_data /
-					GFS_NBBY;
-				log_debug("Prev ri_data set to: %" PRIx32 ".\n",
-						  prev_rgd->rd_ri.ri_data);
-				/*prev_rgd->rd_ri.ri_data = block_bump;*/
-			}
-			number_of_rgs++;
-			rgs_per_subd++;
-			block_of_last_rg = blok;
-			if (subd == 2) { /* if beyond the normal RGs into gfs_grow RGs  */
-				/* -------------------------------------------------------- */
-				/* RG location is rounded down to the nearest multiple of   */
-				/* GFS_NBBY, so RG location is only known within a 4 block  */
-				/* range.  It's better to use the rgindex to figure out     */
-				/* the address of the next RG and bump by the difference.   */
-				/* However, there's another complication:  gfs_grow has     */
-				/* been known to add RGs to the index in a non-ascending    */
-				/* order.  Therefore, we can't assume the Nth entry in the  */
-				/* index corresponds to the Nth RG on disk.  Wish it was.   */
-				/* Instead, we have to read all of the rgindex until we     */
-				/* find an entry that has the smallest address greater than */
-				/* the block we're on (blok).                               */
-				/* -------------------------------------------------------- */
-				if (section3_bump_size == 0) {
-					uint64_t rgndx_next_block, highest_riaddr;
-
-					rgndx_next_block = end_block;
-					highest_riaddr = 0;
-					for (rgi = 0; ; rgi++) {
-						error = readi(sdp->riinode, (char *)&buf,
-							      rgi * sizeof(struct gfs_rindex),
-							      sizeof(struct gfs_rindex));
-						if (!error)      /* if end of the rgindex */
-							break;        /* stop processing for more RGs */
-						gfs_rindex_in(&tmpndx, (char *)&buf);
-						/* if this index entry is the next RG physically */
-						if (tmpndx.ri_addr > blok &&
-						    tmpndx.ri_addr < rgndx_next_block) {
-							rgndx_next_block = tmpndx.ri_addr; /* remember it */
-						}
-						if (tmpndx.ri_addr > highest_riaddr)
-							highest_riaddr= tmpndx.ri_addr;
-					}
-					/* A special exception must be made for the last RG because we */
-					/* won't have a "next highest" entry in the rindex.            */
-					if (blok == highest_riaddr)
-						block_bump = end_block - blok + 1;
-					else if (rgndx_next_block == end_block) {
-						if (block_bump != 1) {
-							log_warn("\nUnable to use rindex; "
-								 "doing block-by-block search.\n");
-							log_warn("This will be slow, so be patient.\n");
-							rgndx_next_block = blok + 1;
-							block_bump = 1;
-						} else {
-							if (prev_rgd &&
-							    block_bump != blok -
-							    prev_rgd->rd_ri.ri_addr) {
-								log_warn("I think I figured it out.\n");
-								block_bump = blok -
-									prev_rgd->rd_ri.ri_addr;
-								section3_bump_size = block_bump;
-							}
-						}
-					} else
-						block_bump = rgndx_next_block - blok;
-				}
-			}
-			else {
-				if (blok == start_block)
-					block_bump = first_rg_dist[subd];
-				else
-					block_bump = shortest_dist_btwn_rgs[subd];
-			}
-			if (block_bump == 1 && prev_rgd && subd == 2) {
-				uint64_t last_distance = blok - prev_rgd->rd_ri.ri_addr;
-
-				error = get_and_read_buf(sdp, blok + last_distance, &bh, 0);
-				rg_was_fnd = (!check_type(bh, GFS_METATYPE_RG));
-				relse_buf(sdp, bh); /* release the read buffer */
-				if (rg_was_fnd)
-					block_bump = last_distance;
-			}
-			log_warn("%c RG %d at block 0x%" PRIX64 " %s",
-					 (rg_was_fnd ? ' ' : '*'), number_of_rgs, blok,
-					 (rg_was_fnd ? "intact" : "*** DAMAGED ***"));
-			log_warn(" [length 0x%" PRIx64 "]\n", block_bump);
-			prev_rgd = calc_rgd;
-		} /* for blocks in subdevice */
-	} /* for subdevices */
-	/* ------------------------------------------------------------------- */
-	/* if we got to the end of the fs, we still need to fix the allocation */
-	/* information for the very last RG.                                   */
-	/* ------------------------------------------------------------------- */
-	if (prev_rgd && !prev_rgd->rd_ri.ri_data) {
-		log_debug("Prev ri_data set to: %" PRIx32 ".\n", block_bump);
-		prev_rgd->rd_ri.ri_data = block_bump -
-			rgrplength2bitblocks(sdp, block_bump);
-		prev_rgd->rd_ri.ri_data -= prev_rgd->rd_ri.ri_data % GFS_NBBY;
-		prev_rgd->rd_ri.ri_bitbytes = prev_rgd->rd_ri.ri_data / GFS_NBBY;
-		prev_rgd = NULL; /* make sure we don't use it later */
-	}
-	/* else No previous to fix. */
-	/* ---------------------------- */
-	/* Now dump out the information */	
-	/* ---------------------------- */
-	log_debug("RG index rebuilt as follows:\n");
-	for (tmp = ret_list->next, rgi = 0; tmp != ret_list;
-		 tmp = tmp->next, rgi++) {
-		calc_rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-		log_debug("%d: %x / 0x%" PRIx64 " / 0x%08X / 0x%08X\n",
-				 rgi + 1, calc_rgd->rd_ri.ri_length, calc_rgd->rd_ri.ri_data1,
-				 calc_rgd->rd_ri.ri_data, calc_rgd->rd_ri.ri_bitbytes);
-	}
-	*num_rgs = number_of_rgs;
-	log_debug("Number of RGs = %d.\n", number_of_rgs);
-	return 0;
-}
-
-/**
- * calc_device_journals - morphed from gfs_mkfs's add_journals_to_device()
- * journals: The number of journals
- * jsize: The journal size
- * @dvice: The mkfs device structure to be used
- *
- */
-static void calc_device_journals(struct fsck_sb *sdp, uint32 jsize,
-				 struct mkfs_device *dvice)
-{
-	struct mkfs_subdevice *old;
-	unsigned int x;
-
-	jsize = jsize * (1 << 20) / GFS_BASIC_BLOCK;
-	old = dvice->subdev;
-
-	dvice->nsubdev = sdp->journals + 2;
-	dvice->subdev = malloc(dvice->nsubdev * sizeof(struct mkfs_subdevice));
-	memset(dvice->subdev, 0, (dvice->nsubdev *
-				  sizeof(struct mkfs_subdevice)));
-
-	dvice->subdev[0].start = old->start;
-	dvice->subdev[0].length = (old->length - sdp->journals * jsize) / 2;
-
-	for (x = 1; x <= sdp->journals; x++) {
-		dvice->subdev[x].start = dvice->subdev[x - 1].start +
-			dvice->subdev[x - 1].length;
-		dvice->subdev[x].length = jsize;
-		dvice->subdev[x].is_journal = TRUE;
-	}
-
-	dvice->subdev[x].start = dvice->subdev[x - 1].start +
-		dvice->subdev[x - 1].length;
-	dvice->subdev[x].length = dvice->subdev[0].length;
-
-	free(old);
-}
-
-/**
- * fix_device_geometry - round off address and lengths and convert to FS blocks
- * @comline: the command line
- * @device: the description of the underlying device
- *
- */
-
-static void fix_device_geometry(struct fsck_sb *sdp, struct mkfs_device *dvice)
-{
-	unsigned int x;
-	uint64 offset, len;
-	uint32 bbsize = sdp->sb.sb_bsize >> GFS_BASIC_BLOCK_SHIFT;
-
-	/*  Make sure all the subdevices are aligned  */
-	for (x = 0; x < dvice->nsubdev; x++) {
-		offset = dvice->subdev[x].start;
-		len = dvice->subdev[x].length;
-
-		if (offset % bbsize) {
-			len -= bbsize - (offset % bbsize);
-			offset += bbsize - (offset % bbsize);
-		}
-
-		dvice->subdev[x].start = offset / bbsize;
-		dvice->subdev[x].length = len / bbsize;
-	}
-}
-
-/*
- * gfs_rgindex_calculate - calculate what the rgindex should look like
- *                         in a perfect world (trust_lvl == open_minded)
- *
- * Calculate what the rgindex should look like if no gfs_grow-like operations
- * were performed, so we can later check if all RG index entries are sane.
- *
- * This function goes in blind, assuming the entire rgindex is destroyed.
- * That way, we can rebuild it if really is trashed.
- *
- * However, this won't work if the filesystem has been extended or shrunk.
- * If the RGs aren't where we expect them to be, we have to take more drastic
- * measures to recover them.
- *
- * Assumes: journal index file is minimally sane.
- *
- * We need to check if the address and length values are okay.
- * First RG should start after the superblock at block #x11
- * Number of RGs=subdevice size / (2^rgsize/block size)
- *
- * Returns: 0 on success, -1 on failure
- * Sets:    ret_list to a linked list of fsck_rgrp structs representing
- *          what we think the rgindex should really look like.
- */
-static int gfs_rgindex_calculate(struct fsck_sb *sdp, osi_list_t *ret_list,
-			  unsigned int *num_rgs)
-{
-	osi_buf_t *bh; /* buffer handle */
-	uint64 subdevice_size, fs_total_size;
-	int number_of_rgs; /* min of 4 per segment * 2 segments = 8 */
-	int error;
-	int rgi, rgs_per_subd;
-	uint64 subdevice_start;
-	uint64 prev_addr = 0, prev_length = 0, length = 0;
-	uint64 blocks;
-	struct fsck_rgrp *calc_rgd;
-	struct gfs_rindex buf, tmpndx;
-	struct mkfs_device dvice;
-	uint32 jsize;
-	struct mkfs_subdevice *sdev;
-	int x;
-
-	memset(&dvice, 0, sizeof(dvice));
-
-	osi_list_init(ret_list);
-	*num_rgs = 0;
-	/* Get the total size of the device */
-	error = ioctl(sdp->diskfd, BLKGETSIZE64,
-				  &fs_total_size); /* Size in bytes */
-
-	dvice.subdev = malloc(sizeof(struct mkfs_subdevice));
-	dvice.subdev->start = 0;
-	dvice.subdev->length = fs_total_size >> GFS_BASIC_BLOCK_SHIFT;
-	dvice.subdev->is_journal = 0;
-
-	fs_total_size /= sdp->sb.sb_bsize;
-	log_debug("fs_total_size = 0x%" PRIX64 " blocks.\n", fs_total_size);
-
-	/* The end of the first subdevice is also where the first journal is.*/
-	subdevice_size = sdp->jindex->ji_addr; /* addr of 1st journal (blks) */
-	jsize = sdp->ji_nsegment * sdp->sb.sb_seg_size * sdp->sb.sb_bsize;
-	/* Round up to the nearest megabyte */
-	jsize = (jsize + (1024*1024) - 1) / (1024*1024);
-
-	log_debug("subdevice_size = 0x%" PRIX64 ".\n", subdevice_size);
-	log_debug("jsize = 0x%x\n", jsize);
-
-	calc_device_journals(sdp, jsize, &dvice);
-	fix_device_geometry(sdp, &dvice);
-
-	/* ----------------------------------------------------------------- */
-	/* Read the first block of the subdevice and make sure it's an RG.   */
-	/* ----------------------------------------------------------------- */
-	subdevice_start = dvice.subdev[sdp->journals + 1].start;
-	error = get_and_read_buf(sdp, subdevice_start, &bh, 0);
-	if (error){
-		log_crit("Unable to read start of last subdevice.\n");
-		return -1;
-	}
-	if(check_type(bh, GFS_METATYPE_RG)){
-		log_warn("The middle RG is not on an even boundary (fs has grown?)\n");
-		relse_buf(sdp, bh);
-		return -1;
-	}
-	log_debug("First RG is okay.\n");
-	/* --------------------------------------------------------------------- */
-	/* Calculate how many RGs there are supposed to be based on the          */
-	/* rgindex filesize.  Remember that our trust level is open-minded here. */
-	/* If the filesize of the rgindex file is not a multiple of our rgindex  */
-	/* structures, then something's wrong and we can't trust the index.      */
-	/* --------------------------------------------------------------------- */
-	number_of_rgs = sdp->riinode->i_di.di_size / sizeof(struct gfs_rindex);
-	*num_rgs = number_of_rgs;
-	log_warn("number_of_rgs = %d.\n", number_of_rgs);
-	if (sdp->riinode->i_di.di_size % sizeof(struct gfs_rindex)) {
-		log_warn("WARNING: rgindex file is corrupt.\n");
-		return -1;
-	}
-	/* --------------------------------------------------------------------- */
-	/* Check to see if the filesystem has been extended via gfs_grow.        */
-	/* If so, our assumptions will be wrong and we can't continue.           */
-	/* Instead, we need to progress to level 3 and dig deeper for the RGs.   */
-	/* We'll know if the filesystem has been extended by whether or not the  */
-	/* RG that's midway is on the wrong side of the journals.                */
-	/* For example, if we have 50 RGs, we'd expect 25 to be on one side of   */
-	/* the journals, and 25 to be on the other side.  If we find out that    */
-	/* RG number 25 (index 1, or 24 index 0) is on the other side, we grew.  */
-	/* --------------------------------------------------------------------- */
-	rgi = (number_of_rgs / 2) - 1;
-	error = readi(sdp->riinode,
-				  (char *)&buf, rgi * sizeof(struct gfs_rindex),
-				  sizeof(struct gfs_rindex));
-	if (!error) { /* if end of file */
-		log_warn("Error reading RG index.\n");
-		return -1; /* stop looking */
-	}
-	gfs_rindex_in(&tmpndx, (char *)&buf); /* read in the index entry. */
-	if (tmpndx.ri_addr >= sdp->jindex->ji_addr) { /* wrong side of journals */
-		log_warn("This filesystem has probably been resized by gfs_grow.\n");
-		return -1; /* stop looking */
-	}
-	/* --------------------------------------------------------------------- */
-	/* Now that we know how many RGs there should be, we can calculate       */
-	/* exactly where we think they should be and build our index with it.    */
-	/* --------------------------------------------------------------------- */
-	rgs_per_subd = (number_of_rgs / 2);
-	for (x = 0; x < dvice.nsubdev; x++) {
-		sdev = &dvice.subdev[x];
-
-		if (sdev->is_journal)
-			continue;
-		/* If this is the first subdevice reserve space for the
-		   superblock */
-
-		if (!x)
-			sdev->length -= (GFS_SB_ADDR * GFS_BASIC_BLOCK /
-					 sdp->sb.sb_bsize) + 1;
-		for (rgi = 0; rgi < rgs_per_subd; rgi++) {
-			calc_rgd = (struct fsck_rgrp *)
-				malloc(sizeof(struct fsck_rgrp));
-			memset(calc_rgd, 0, sizeof(struct fsck_rgrp));
-			calc_rgd->rd_sbd = sdp; /* this may not be used */
-			if (rgi) {
-				calc_rgd->rd_ri.ri_addr = prev_addr +
-					prev_length;
-				length = sdev->length / rgs_per_subd;
-			} else {
-				calc_rgd->rd_ri.ri_addr = sdev->start;
-				length = sdev->length - (rgs_per_subd - 1) *
-					(sdev->length / rgs_per_subd);
-				if (!x)
-					calc_rgd->rd_ri.ri_addr +=
-						(GFS_SB_ADDR *
-						 GFS_BASIC_BLOCK /
-						 sdp->sb.sb_bsize) + 1;
-			}
-			osi_list_add_prev(&calc_rgd->rd_list, ret_list);
-
-			log_info("ri_addr[%d] = 0x%"PRIx64 " / ", rgi,
-				  calc_rgd->rd_ri.ri_addr);
-			blocks = length - rgrplength2bitblocks(sdp, length);
-			blocks -= blocks % GFS_NBBY;
-			calc_rgd->rd_ri.ri_length =
-				rgrplength2bitblocks(sdp, length);
-			calc_rgd->rd_ri.ri_data1 = calc_rgd->rd_ri.ri_addr +
-				calc_rgd->rd_ri.ri_length;
-			calc_rgd->rd_ri.ri_data = blocks;
-			calc_rgd->rd_ri.ri_bitbytes =
-				calc_rgd->rd_ri.ri_data / GFS_NBBY;
-			log_info("%d / %08x / %08x / %08x\n",
-				 calc_rgd->rd_ri.ri_length,
-				 calc_rgd->rd_ri.ri_data1,
-				 calc_rgd->rd_ri.ri_data,
-				 calc_rgd->rd_ri.ri_bitbytes);
-			prev_addr = calc_rgd->rd_ri.ri_addr;
-			prev_length = length;
-		}
-	} /* for */
-	relse_buf(sdp, bh); /* release the read buffer if we have one */
-	return 0;
-}
-
-/*
- * ri_cleanup - free up the memory we previously allocated.
- */
-static void ri_cleanup(osi_list_t *rglist)
-{
-	struct fsck_rgrp *rgd;
-
-	while(!osi_list_empty(rglist)){
-		rgd = osi_list_entry(rglist->next, struct fsck_rgrp, rd_list);
-		if(rgd->rd_bits)
-			free(rgd->rd_bits);
-		if(rgd->rd_bh)
-			free(rgd->rd_bh);
-		osi_list_del(&rgd->rd_list);
-		free(rgd);
-	}
-}
-
-/**
- * ri_update - attach rgrps to the super block
- * @sdp:
- *
- * Given the rgrp index inode, link in all rgrps into the super block
- * and be sure that they can be read.
- *
- * If we encounter problems with any RGs, it either means we have a corrupt
- * RG or a corrupt RG file entry (which is less likely).  We make up to three
- * attempts to do this.  First, we trust that the RG index is correct and
- * read the RGs.  If that fails, we become a little less trusting and
- * try to calculate what the RG index should look like in a perfect world.
- * If that doesn't work, we become even less trusting and go to great lengths
- * to figure out exactly where those RGs should be and what the index should
- * look like.
- *
- * Returns: 0 on success, -1 on failure.
- */
-int ri_update(struct fsck_sb *sdp)
-{
-	struct fsck_rgrp *rgd, *expected_rgd;
-	osi_list_t expected_rglist; /* List of expected resource groups */
-	osi_list_t *tmp;
-	struct gfs_rindex buf;
-	unsigned int rg, calc_rg_count = 0;
-	int error, count1 = 0, count2 = 0;
-	int fix_grow_problems = 0, grow_problems = 0;
-	enum rgindex_trust_level { /* how far can we trust our RG index? */
-		blind_faith = 0, /* We'd like to trust the rgindex. We always used to
-							before bz 179069. This should cover most cases. */
-		open_minded = 1, /* At least 1 RG is corrupt. Try to calculate what it
-							should be, in a perfect world where our RGs are all
-							on even boundaries. Blue sky. Chirping birds. */
-		distrust = 2   /* The world isn't perfect, our RGs are not on nice neat
-						  boundaries.  The fs must have been messed with by
-						  gfs_grow or something.  Count the RGs by hand. */
-	} trust_lvl;
-
-	log_info("Validating Resource Group index.\n");
-	for (trust_lvl = blind_faith; trust_lvl <= distrust; trust_lvl++) {
-		log_info("Level %d check.\n", trust_lvl + 1);
-		count1 = count2 = 0;
-		/* ---------------------------------------------------------------- */
-		/* Step 1 - Calculate or figure out our own RG index                */
-		/* ---------------------------------------------------------------- */
-		if (trust_lvl == blind_faith) { /* For now, assume rgindex is gospel */
-			osi_list_init(&expected_rglist);
-			error = FALSE;
-		}
-		else if (trust_lvl == open_minded) { /* If we can't trust RG index */
-			/* Calculate our own RG index for comparison */
-			error = gfs_rgindex_calculate(sdp, &expected_rglist,
-										  &calc_rg_count);
-			if (error) { /* If calculated RGs don't reasonably match the fs */
-				log_info("(failed--trying again at level 3)\n");
-				ri_cleanup(&sdp->rglist);
-				continue; /* Try again, this time counting them manually */
-			}
-		}
-		else if (trust_lvl == distrust) { /* If we can't trust RG index */
-			error = gfs_rgindex_rebuild(sdp, &expected_rglist,
-										&calc_rg_count); /* count the RGs. */
-			if (error) { /* If calculated RGs don't reasonably match the fs */
-				log_info("(failed--giving up)\n");
-				goto fail; /* try again, this time counting them manually */
-			}
-		}
-		/* ---------------------------------------------------------------- */
-		/* Step 2 - Read the real RG index and check its integrity          */
-		/* ---------------------------------------------------------------- */
-		for (rg = 0; ; rg++) {
-			int rgindex_modified;
-
-			rgindex_modified = FALSE;
-			error = readi(sdp->riinode, (char *)&buf,
-						  rg * sizeof(struct gfs_rindex),
-						  sizeof(struct gfs_rindex));
-			if (!error) /* if no data was read */
-				break;  /* we found the end of the rg index file */
-			if (error != sizeof(struct gfs_rindex)) {
-				log_err("Unable to read resource group index #%u.\n", rg);
-				goto fail;
-			}
-			if (trust_lvl != blind_faith && osi_list_empty(&expected_rglist))
-				break;
-			
-			rgd = (struct fsck_rgrp *)malloc(sizeof(struct fsck_rgrp));
-			// FIXME: handle failed malloc
-			memset(rgd, 0, sizeof(struct fsck_rgrp));
-			rgd->rd_sbd = sdp;
-			osi_list_add_prev(&rgd->rd_list, &sdp->rglist);
-			gfs_rindex_in(&rgd->rd_ri, (char *)&buf);
-			if (trust_lvl != blind_faith) {
-				expected_rgd = osi_list_entry(expected_rglist.next,
-											  struct fsck_rgrp, rd_list);
-				/* --------------------------------------------------------- */
-				/* Now compare the index to the one we calculated / rebuilt  */
-				/* Since this is fsck and fsck's job is to fix filesystem    */
-				/* corruption, it's probably better to trust the calculated  */
-				/* value and discard what's reported on disk.                */
-				/* --------------------------------------------------------- */
-				ri_compare(rg, rgd->rd_ri, expected_rgd->rd_ri,
-						   ri_addr, PRIx64);
-				ri_compare(rg, rgd->rd_ri, expected_rgd->rd_ri,
-						   ri_length, PRIx32);
-				ri_compare(rg, rgd->rd_ri, expected_rgd->rd_ri,
-						   ri_data1, PRIx64);
-				ri_compare(rg, rgd->rd_ri, expected_rgd->rd_ri,
-						   ri_data, PRIx32);
-				ri_compare(rg, rgd->rd_ri, expected_rgd->rd_ri,
-						   ri_bitbytes, PRIx32);
-				/* If we modified the index, write it back to disk. */
-				if (rgindex_modified) {
-					errors_found++;
-					if(query(sdp, "Fix the index? (y/n)")) {
-						gfs_rindex_out(&rgd->rd_ri, (char *)&buf);
-						error = writei(sdp->riinode, (char *)&buf,
-									   rg * sizeof(struct gfs_rindex),
-									   sizeof(struct gfs_rindex));
-						if (error != sizeof(struct gfs_rindex)) {
-							log_err("Unable to fix resource group index %u.\n",
-									rg + 1);
-							goto fail;
-						} else {
-							errors_corrected++;
-						}
-					}
-					else
-						log_err("RG index not fixed.\n");
-				}
-				osi_list_del(&expected_rgd->rd_list);
-				free(expected_rgd);
-			} /* if we can't trust the rg index */
-			else { /* blind faith -- just check for the gfs_grow problem */
-				if (rgd->rd_ri.ri_data == (uint32_t)-4) {
-					if (!fix_grow_problems) {
-						log_err("A problem with the rindex file caused by gfs_grow was detected.\n");
-						errors_found++;
-						if(query(sdp, "Fix the rindex problem? (y/n)")) {
-							errors_corrected++;
-							fix_grow_problems = 1;
-						}
-					}
-					/* Keep a counter in case we hit it more than once. */
-					grow_problems++;
-					osi_list_del(&rgd->rd_list); /* take it out of the equation */
-					free(rgd);
-					continue;
-				} else if (fix_grow_problems) {
-					/* Once we detect the gfs_grow rindex problem, we have to */
-					/* rewrite the entire rest of the rindex file, starting   */
-					/* with the entry AFTER the one that has the problem.     */
-					gfs_rindex_out(&rgd->rd_ri, (char *)&buf);
-					error = writei(sdp->riinode, (char *)&buf,
-						       (rg - grow_problems) *
-						       sizeof(struct gfs_rindex),
-						       sizeof(struct gfs_rindex));
-					if (error != sizeof(struct gfs_rindex)) {
-						log_err("Unable to fix rindex entry %u.\n",
-							rg + 1);
-						goto fail;
-					}
-				}
-			}
-			error = fs_compute_bitstructs(rgd);
-			if (error)
-				break;
-			rgd->rd_open_count = 0;
-			count1++;
-		} /* for all RGs in the index */
-		rg -= grow_problems;
-		if (!error) {
-			log_info("%u resource groups found.\n", rg);
-			if (trust_lvl != blind_faith && rg != calc_rg_count)
-				log_warn("Resource group count discrepancy. Index says %d. " \
-						 "Should be %d.\n", rg, calc_rg_count);
-			/* ------------------------------------------------------------- */
-			/* Step 3 - Read the real RGs and check their integrity.         */
-			/* Now we can somewhat trust the rgindex and the RG addresses,   */
-			/* so let's read them in, check them and optionally fix them.    */
-			/* ------------------------------------------------------------- */
-			error = FALSE;
-			for (tmp = sdp->rglist.next; !error && tmp != &sdp->rglist;
-				 tmp = tmp->next) {
-				rgd = osi_list_entry(tmp, struct fsck_rgrp, rd_list);
-				error = fs_rgrp_read(rgd, trust_lvl);
-				if (error)
-					log_err("Unable to read in rgrp descriptor.\n");
-				else
-					fs_rgrp_relse(rgd);
-				count2++;
-			}
-			if (!error && count1 != count2){
-				log_err("Rgrps allocated (%d) does not equal"
-						" rgrps read (%d).\n", count1, count2);
-				error = -1;
-			}
-			sdp->rgcount = count1;
-		}
-		if (fix_grow_problems) {
-			osi_buf_t *dibh;
-
-			get_and_read_buf(sdp, sdp->sb.sb_rindex_di.no_addr, &dibh, 0);
-			sdp->riinode->i_di.di_size = rg * sizeof(struct gfs_rindex);
-			gfs_dinode_out(&sdp->riinode->i_di, BH_DATA(dibh));
-			write_buf(sdp, dibh, 0);
-			grow_problems = fix_grow_problems = 0;
-			relse_buf(sdp, dibh);
-		}
-		if (!error) { /* if no problems encountered with the rgs */
-			log_info("(passed)\n");
-			break;  /* no reason to distrust what we saw. Otherwise, we
-					   reiterate and become a little less trusting. */
-		}
-		else {
-			if (trust_lvl < distrust)
-				log_info("(failed--trying again at level 2)\n");
-			else
-				log_info("(failed--recovery impossible)\n");
-		}
-		ri_cleanup(&sdp->rglist);
-	} /* for trust_lvl */
-	return 0;
-
- fail:
-	ri_cleanup(&sdp->rglist);
-	return -1;
-}
-
-int write_sb(struct fsck_sb *sbp)
-{
-	int error = 0;
-	osi_buf_t *bh;
-
-	error = get_and_read_buf(sbp, GFS_SB_ADDR >> sbp->fsb2bb_shift, &bh, 0);
-	if (error){
-		log_crit("Unable to read superblock\n");
-		goto out;
-	}
-
-	gfs_sb_out(&sbp->sb, BH_DATA(bh));
-
-	if((error = write_buf(sbp, bh, BW_WAIT))) {
-		stack;
-		goto out;
-	}
-
-	relse_buf(sbp, bh);
-out:
-	return error;
-
-}
-
diff --git a/gfs/gfs_fsck/super.h b/gfs/gfs_fsck/super.h
deleted file mode 100644
index 702c804..0000000
--- a/gfs/gfs_fsck/super.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _SUPER_H
-#define _SUPER_H
-
-#include "fsck_incore.h"
-
-int read_sb(struct fsck_sb *sdp);
-int ji_update(struct fsck_sb *sdp);
-int ri_update(struct fsck_sb *sdp);
-int write_sb(struct fsck_sb *sdp);
-
-#endif /* _SUPER_H */
diff --git a/gfs/gfs_fsck/util.c b/gfs/gfs_fsck/util.c
deleted file mode 100644
index 81aeb69..0000000
--- a/gfs/gfs_fsck/util.c
+++ /dev/null
@@ -1,333 +0,0 @@
-#include "bio.h"
-#include "fs_bits.h"
-
-#include "util.h"
-#include "log.h"
-
-/**
- * compute_height
- * @sdp:
- * @sz:
- *
- */
-int compute_height(struct fsck_sb *sdp, uint64 sz)
-{
-  unsigned int height;
-  uint64 space, old_space;
-  unsigned int bsize = sdp->sb.sb_bsize;
-
-  if (sz <= (bsize - sizeof(struct gfs_dinode)))
-    return 0;
-
-  height = 1;
-  space = sdp->diptrs * bsize;
-
-  while (sz > space)
-  {
-    old_space = space;
-
-    height++;
-    space *= sdp->inptrs;
-
-    if (space / sdp->inptrs != old_space ||
-        space % sdp->inptrs != 0)
-      break;
-  }
-
-  return height;
-}
-
-
-/*
- * check_range - check if blkno is within FS limits
- * @sdp: super block
- * @blkno: block number
- *
- * Returns: 0 if ok, -1 if out of bounds
- */
-int check_range(struct fsck_sb *sdp, uint64 blkno){
-	if((blkno > sdp->last_fs_block) ||
-	   (blkno < sdp->first_data_block))
-		return -1;
-	return 0;
-}
-
-
-/*
- * set_meta - set the meta header of a buffer
- * @bh
- * @type
- *
- * Returns: 0 if ok, -1 on error
- */
-int set_meta(osi_buf_t *bh, int type, int format){
-  struct gfs_meta_header header;
-
-  if(!check_meta(bh, 0)){
-	  log_debug("Setting metadata\n");
-    ((struct gfs_meta_header *)BH_DATA(bh))->mh_type = cpu_to_gfs32(type);
-    ((struct gfs_meta_header *)BH_DATA(bh))->mh_format = cpu_to_gfs32(format);
-  } else {
-    memset(&header, 0, sizeof(struct gfs_meta_header));
-    header.mh_magic = GFS_MAGIC;
-    header.mh_type = type;
-    header.mh_format = format;
-
-    gfs_meta_header_out(&header, BH_DATA(bh));
-  }
-  return 0;
-}
-
-
-
-
-/*
- * check_meta - check the meta header of a buffer
- * @bh: buffer to check
- * @type: meta type (or 0 if don't care)
- *
- * Returns: 0 if ok, -1 on error
- */
-int check_meta(osi_buf_t *bh, int type){
-  uint32 check_magic = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_magic;
-  uint32 check_metatype = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_type;
- 
-  check_magic = gfs32_to_cpu(check_magic);
-  check_metatype = gfs32_to_cpu(check_metatype);
-  if((check_magic != GFS_MAGIC) || (type && (check_metatype != type))){
-	  log_debug("For %"PRIu64" Expected %X:%X - got %X:%X\n", BH_BLKNO(bh), GFS_MAGIC, type,
-		    check_magic, check_metatype);
-    return -1;
-  }
-  return 0;
-}
-
-/*
- * check_type - check the meta type of a buffer
- * @bh: buffer to check
- * @type: meta type
- *
- * Returns: 0 if ok, -1 on error
- */
-int check_type(osi_buf_t *bh, int type){
-  uint32 check_magic = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_magic;
-  uint32 check_metatype = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_type;
- 
-  check_magic = gfs32_to_cpu(check_magic);
-  check_metatype = gfs32_to_cpu(check_metatype);
-  if((check_magic != GFS_MAGIC) || (check_metatype != type)){
-    return -1;
-  }
-  return 0;
-}
-
-/**
- * next_rg_meta
- * @rgd:
- * @block:
- * @first: if set, start at zero and ignore block
- *
- * The position to start looking from is *block.  When a block
- * is found, it is returned in block.
- *
- * Returns: 0 on success, -1 when finished
- */
-int next_rg_meta(struct fsck_rgrp *rgd, uint64 *block, int first)
-{
-  fs_bitmap_t *bits = NULL;
-  uint32 length = rgd->rd_ri.ri_length;
-  uint32 blk = (first)? 0: (uint32)((*block+1)-rgd->rd_ri.ri_data1);
-  int i;
-
-  if(!first && (*block < rgd->rd_ri.ri_data1)){
-    log_err("next_rg_meta:  Start block is outside rgrp bounds.\n");
-    exit(FSCK_ERROR);
-  }
-
-  for(i=0; i < length; i++){
-    bits = &rgd->rd_bits[i];
-    if(blk < bits->bi_len*GFS_NBBY){
-      break;
-    }
-    blk -= bits->bi_len*GFS_NBBY;
-  }
-
-
-  for(; i < length; i++){
-    bits = &rgd->rd_bits[i];
-
-    blk = fs_bitfit((unsigned char *)BH_DATA(rgd->rd_bh[i]) + bits->bi_offset,
-                    bits->bi_len, blk, GFS_BLKST_USEDMETA);
-
-    if(blk != BFITNOENT){
-	    *block = blk + (bits->bi_start * GFS_NBBY) + rgd->rd_ri.ri_data1;
-	    break;
-    }
-
-    blk=0;
-  }
-
-  if(i == length){
-    return -1;
-  }
-  return 0;
-}
-
-/**
- * next_rg_meta_free - finds free or used metadata
- * @rgd:
- * @block:
- * @first: if set, start at zero and ignore block
- *
- * The position to start looking from is *block.  When a block
- * is found, it is returned in block.
- *
- * Returns: 0 on success, -1 when finished
- */
-int next_rg_meta_free(struct fsck_rgrp *rgd, uint64 *block, int first, int *mfree)
-{
-  fs_bitmap_t *bits = NULL;
-  uint32 length = rgd->rd_ri.ri_length;
-  uint32 blk = (first)? 0: (uint32)((*block+1)-rgd->rd_ri.ri_data1);
-  uint32 ublk, fblk;
-  int i;
-
-  if(!first && (*block < rgd->rd_ri.ri_data1)){
-    log_err("next_rg_meta:  Start block is outside rgrp bounds.\n");
-    exit(FSCK_ERROR);
-  }
-
-  for(i=0; i < length; i++){
-    bits = &rgd->rd_bits[i];
-    if(blk < bits->bi_len*GFS_NBBY){
-      break;
-    }
-    blk -= bits->bi_len*GFS_NBBY;
-  }
-
-
-  for(; i < length; i++){
-    bits = &rgd->rd_bits[i];
-
-    ublk = fs_bitfit((unsigned char *)BH_DATA(rgd->rd_bh[i]) + bits->bi_offset,
-                    bits->bi_len, blk, GFS_BLKST_USEDMETA);
-
-    fblk = fs_bitfit((unsigned char *)BH_DATA(rgd->rd_bh[i]) + bits->bi_offset,
-			     bits->bi_len, blk, GFS_BLKST_FREEMETA);
-    if(ublk < fblk) {
-	    blk = ublk;
-	    *mfree = 0;
-    } else {
-	    blk = fblk;
-	    *mfree = 1;
-    }
-    if(blk != BFITNOENT){
-	    *block = blk + (bits->bi_start * GFS_NBBY) + rgd->rd_ri.ri_data1;
-	    break;
-    }
-
-    blk=0;
-  }
-
-  if(i == length){
-    return -1;
-  }
-  return 0;
-}
-
-
-/**
- * next_rg_metatype
- * @rgd:
- * @block:
- * @type: the type of metadata we're looking for
- * @first: if set we should start at block zero and block is ignored
- *
- * Returns: 0 on success, -1 on error or finished
- */
-int next_rg_metatype(struct fsck_rgrp *rgd, uint64 *block, uint32 type, int first)
-{
-  struct fsck_sb *sdp = rgd->rd_sbd;
-  osi_buf_t *bh=NULL;
-
-  do{
-    relse_buf(sdp, bh);
-    if(next_rg_meta(rgd, block, first))
-      return -1;
-
-    if(get_and_read_buf(sdp, *block, &bh, 0)){
-      log_err("next_rg_metatype:  Unable to read meta block "
-	      "#%"PRIu64" from disk\n", *block);
-      exit(FSCK_ERROR);
-    }
-
-    if(check_meta(bh,0)){
-      log_err("next_rg_metatype:  next_rg_meta returned block #%"PRIu64",\n"
-	      "                   which is not a valid meta block.\n", *block);
-      exit(FSCK_ERROR);
-    }
-
-    first = 0;
-  } while(check_meta(bh, type));
-  relse_buf(sdp, bh);
-
-  return 0;
-}
-
-
-
-#if 0
-/**
- * search_list
- * @list
- * @addr
- *
- * Returns: di_info_t ptr if found, NULL otherwise
- */
-struct di_info *search_list(osi_list_t *list, uint64 addr)
-{
-  osi_list_t *tmp;
-  struct di_info *dinfo;
-
-  for (tmp = list->next; tmp != list; tmp = tmp->next)
-  {
-    dinfo = osi_list_entry(tmp, struct di_info, din_list);
-
-    if (dinfo->din_addr == addr)
-      return(dinfo);
-  }
-
-  return NULL;
-}
-#endif
-
-/* Put out a warm, fuzzy message every second so the user     */
-/* doesn't think we hung.  (This may take a long time).       */
-/* We only check whether to report every one percent because  */
-/* checking every block kills performance.  We only report    */
-/* every second because we don't need 100 extra messages in   */
-/* logs made from verbose mode.                               */
-void warm_fuzzy_stuff(uint64_t block)
-{
-	static uint64_t one_percent = 0;
-	static struct timeval tv;
-	static uint32_t seconds = 0;
-	
-	if (!one_percent)
-		one_percent = last_fs_block / 100;
-	if (block - last_reported_block >= one_percent) {
-		last_reported_block = block;
-		gettimeofday(&tv, NULL);
-		if (!seconds)
-			seconds = tv.tv_sec;
-		if (tv.tv_sec - seconds) {
-			static uint64_t percent;
-
-			seconds = tv.tv_sec;
-			if (last_fs_block) {
-				percent = (block * 100) / last_fs_block;
-				log_notice("\r%" PRIu64 " percent complete.\r", percent);
-			}
-		}
-	}
-}
diff --git a/gfs/gfs_fsck/util.h b/gfs/gfs_fsck/util.h
deleted file mode 100644
index 7a4a041..0000000
--- a/gfs/gfs_fsck/util.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __UTIL_H__
-#define __UTIL_H__
-
-#include "fsck_incore.h"
-
-#define do_lseek(fd, off) \
-  ((lseek((fd), (off), SEEK_SET) == (off)) ? 0 : -1)
-
-#define do_read(fd, buff, len) \
-  ((read((fd), (buff), (len)) == (len)) ? 0 : -1)
-
-#define do_write(fd, buff, len) \
-  ((write((fd), (buff), (len)) == (len)) ? 0 : -1)
-
-
-int compute_height(struct fsck_sb *sdp, uint64 sz);
-int check_range(struct fsck_sb *sdp, uint64 blkno);
-int set_meta(osi_buf_t *bh, int type, int format);
-int check_type(osi_buf_t *bh, int type);
-int check_meta(osi_buf_t *bh, int type);
-int next_rg_meta(struct fsck_rgrp *rgd, uint64 *block, int first);
-int next_rg_meta_free(struct fsck_rgrp *rgd, uint64 *block, int first, int *free);
-int next_rg_metatype(struct fsck_rgrp *rgd, uint64 *block, uint32 type, int first);
-struct di_info *search_list(osi_list_t *list, uint64 addr);
-void warm_fuzzy_stuff(uint64_t block);
-
-#endif /* __UTIL_H__ */
diff --git a/gfs/gfs_grow/Makefile b/gfs/gfs_grow/Makefile
deleted file mode 100644
index 9c54b12..0000000
--- a/gfs/gfs_grow/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-TARGET= gfs_grow
-
-SBINDIRT=$(TARGET)
-
-all: depends ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS= main.o \
-      ondisk.o
-
-CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${gfskincdir}
-CFLAGS += -I$(S)/../include -I$(S)/../libgfs
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L../libgfs -lgfs
-LDFLAGS += -L${libdir}
-
-LDDEPS += ../libgfs/libgfs.a
-
-${TARGET}: ${OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-depends:
-	$(MAKE) -C ../libgfs all
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_grow/main.c b/gfs/gfs_grow/main.c
deleted file mode 100644
index ecb8b36..0000000
--- a/gfs/gfs_grow/main.c
+++ /dev/null
@@ -1,974 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <sys/ioctl.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-#define __user
-#include "gfs_ioctl.h"
-#include "osi_list.h"
-#include "libgfs.h"
-
-#include "copyright.cf"
-
-struct rglist_entry {
-	osi_list_t list;
-	struct gfs_rindex ri;
-	struct gfs_rgrp rg;
-};
-
-struct jilist_entry {
-	osi_list_t list;
-	struct gfs_jindex ji;
-};
-
-/*
- * verbose: 0 = no messages, 1 = normal, 2 = everything
- * test: 0 = normal, 1 = don't actually write data, but do everything else
- * fspath: path to root of mounted GFS filesystem
- * device: the device upon which the GFS filesystem is mounted
- * fsoptions: the mount options used
- * devsize: the size of the device (in filesystem blocks, rounded down)
- * fssize: the size of the filesystem (in filesystem blocks, rounded down)
- * override_device_size: if non-zero, this is used for the device size
- */
-static int verbose = 1;
-static int test = 0;
-static char fspath[4096];
-static char device[1024];
-static char fsoptions[4096];
-static uint64_t devsize;
-static uint64_t fssize;
-static uint64_t override_device_size = 0;
-
-/*
- * fs_sb: the superblock read from the mounted filesystem
- * rglist_current: list of resource groups currently making up the filesystem
- * rglist_new: where we put the new resource groups to be written
- * jilist_current: list of current journals in the filesystem
- */
-static struct gfs_sb fs_sb;
-static osi_list_decl(rglist_current);
-static osi_list_decl(rglist_new);
-static osi_list_decl(jilist_current);
-
-/**
- * device_geometry - Find out the size of a block device
- * @device: The name of the device
- *
- * Returns: The size of the device in FS blocks
- */
-
-static uint64_t
-device_geometry(char *device_g)
-{
-	int fd;
-	uint64_t bytes;
-	int error;
-
-	if (override_device_size)
-		bytes = override_device_size;
-	else {
-		fd = open(device_g, O_RDONLY);
-		if (fd < 0) {
-			fprintf(stderr, "gfs_grow: can't open %s: %s\n",
-				device_g, strerror(errno));
-			exit(EXIT_FAILURE);
-		}
-
-		error = device_size(fd, &bytes);
-		if (error) {
-			fprintf(stderr,
-				"gfs_grow: can't determine size of %s: %s\n",
-				device_g, strerror(errno));
-			exit(EXIT_FAILURE);
-		}
-
-		close(fd);
-	}
-
-	return bytes >> fs_sb.sb_bsize_shift;
-}
-
-/**
- * jread - Read from journaled file using ioctl()
- * @fd: The fd to read from
- * @file: The file to read
- * @buf: The buffer to fill
- * @size: The amount of data to read
- * @offset: The offset to read from
- *
- * Returns: Error code, or amount of data read
- */
-
-static int
-jread(int fd, const char *file, void *buf, uint64_t size, uint64_t *offset)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"do_hfile_read",
-		(char *)file
-	};
-	int error;
-
-	gi.gi_argc = 2;
-	gi.gi_argv = argv;
-	gi.gi_data = buf;
-	gi.gi_size = size;
-	gi.gi_offset = *offset;
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error > 0)
-		*offset += error;
-
-	return error;
-}
-
-/**
- * jwrite - Write to journaled file using ioctl()
- * @fd: The fd to write to
- * @file: The file to write
- * @buf: The buffer to write
- * @size: The amount of data to write
- * @offset: The offset at which to write the data
- *
- * Returns: Error code, or the amount of data written
- */
-
-static int
-jwrite(int fd, const char *file, void *buf, uint64_t size, uint64_t *offset)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"do_hfile_write",
-		(char *)file
-	};
-	int error;
-
-	gi.gi_argc = 2;
-	gi.gi_argv = argv;
-	gi.gi_data = buf;
-	gi.gi_size = size;
-	gi.gi_offset = *offset;
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error > 0)
-		*offset += error;
-
-	return error;
-}
-
-/**
- * filesystem_size - Calculate the size of the filesystem
- *
- * Reads the lists of journals and resource groups in order to
- * work out where the last block of the filesystem is located.
- *
- * Returns: The calculated size
- */
-
-static uint64_t
-filesystem_size(void)
-{
-	osi_list_t *tmp, *head;
-	struct rglist_entry *rgl;
-	struct jilist_entry *jil;
-	uint64_t size = 0;
-	uint64_t extent;
-
-	tmp = head = &rglist_current;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		rgl = osi_list_entry(tmp, struct rglist_entry, list);
-		extent = rgl->ri.ri_addr + rgl->ri.ri_length + rgl->ri.ri_data;
-		if (extent > size)
-			size = extent;
-	}
-
-	tmp = head = &jilist_current;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		jil = osi_list_entry(tmp, struct jilist_entry, list);
-		extent = jil->ji.ji_addr + jil->ji.ji_nsegment * fs_sb.sb_seg_size;
-		if (extent > size)
-			size = extent;
-	}
-
-	return size;
-}
-
-/**
- * gfs_jientry - Get journal index entry
- * @fd: The fd of the journal index
- * @offset: The offset at which the journal entry appears
- *
- * Reads a single entry from the journal index file and
- * adds it to the list of current journal entries.
- *
- * Returns: 1 on EOF, 0 otherwise
- */
-
-static int
-get_jientry(int fd, uint64_t *offset)
-{
-	char buffer[sizeof(struct gfs_jindex)];
-	int len = jread(fd, "jindex", buffer,
-			sizeof(struct gfs_jindex), offset);
-	struct jilist_entry *jil;
-
-	if (len != sizeof(struct gfs_jindex)) {
-		if (len == 0)
-			return 1;
-		fprintf(stderr, "Erk! Read odd size from jindex (%d)\n", len);
-		exit(EXIT_FAILURE);
-	}
-	if ((jil = malloc(sizeof(struct jilist_entry))) == NULL) {
-		perror("jilist_entry");
-		exit(EXIT_FAILURE);
-	}
-	memset(jil, 0, sizeof(struct jilist_entry));
-	gfs_jindex_in(&jil->ji, buffer);
-	osi_list_add(&jil->list, &jilist_current);
-	return 0;
-}
-
-/**
- * read_journals - Read the whole journal index
- * @fs_fd: An fd for some file or directory within the mounted GFS filesystem
- *
- */
-
-static void
-read_journals(int fs_fd)
-{
-	uint64_t offset = 0;
-	while (get_jientry(fs_fd, &offset) == 0)
-		/* do nothing */;
-}
-
-/**
- * get_rgrp - Read a single rindex entry
- * @fd: The fd for the rindex file
- * @offset: The offset at which to read the rindex entry
- *
- * Reads a single rindex entry and adds it to the list of current
- * resource group entries.
- *
- * Returns: 1 on EOF, 0 otherwise
- */
-
-static int
-get_rgrp(int fd, uint64_t *offset)
-{
-	char buffer[sizeof(struct gfs_rindex)];
-	int len = jread(fd, "rindex", buffer,
-			sizeof(struct gfs_rindex), offset);
-	struct rglist_entry *rgl;
-
-	if (len != sizeof(struct gfs_rindex)) {
-		if (len == 0)
-			return 1;
-		fprintf(stderr, "Erk! Read odd size from rindex (%d)\n", len);
-		exit(EXIT_FAILURE);
-	}
-	if ((rgl = malloc(sizeof(struct rglist_entry))) == NULL) {
-		perror("rglist_entry");
-		exit(EXIT_FAILURE);
-	}
-	memset(rgl, 0, sizeof(struct rglist_entry));
-	gfs_rindex_in(&rgl->ri, buffer);
-	osi_list_add(&rgl->list, &rglist_current);
-	return 0;
-}
-
-/**
- * read_rgrps - Reads the contents of the rindex file
- * @fs_fd: An fd for any file or directory within the mounted GFS filesytem
- *
- */
-
-static void
-read_rgrps(int fs_fd)
-{
-	uint64_t offset = 0;
-	while (get_rgrp(fs_fd, &offset) == 0)
-		/* do nothing */;
-}
-
-/**
- * write_a_block - Write a block to the current device
- * @where: The position to write the block (in filesystem blocks)
- * @rg: The (optional) resource group to write
- *
- * Writes a single disk block to the device. It has a safety check which
- * prevents it writing to the device at a position within the control of
- * the active filesystem. If @rg is NULL, it writes a single block of
- * zeros with a meta_header, otherwise the resource group is copied 
- * into the start of the block.
- */
-
-static void
-write_a_block(int fd, struct gfs_rgrp *rg)
-{
-	char buffer[4096];
-
-	memset(buffer, 0, fs_sb.sb_bsize);
-	if (rg)
-		gfs_rgrp_out(rg, buffer);
-	else {
-		struct gfs_meta_header mh;
-
-		mh.mh_magic = GFS_MAGIC;
-		mh.mh_type = GFS_METATYPE_RB;
-		mh.mh_format = GFS_FORMAT_RB;
-		gfs_meta_header_out(&mh, buffer);
-	}
-	if (write(fd, buffer, fs_sb.sb_bsize) != fs_sb.sb_bsize) {
-		perror("write_zero_block");
-		exit(EXIT_FAILURE);
-	}
-}
-
-/**
- * write_whole_rgrp - Write a complete rgrp, including bitmaps
- * @rgl: The information about the resource group
- *
- * Writes a complete rgrp, including any bitmap blocks required
- * by calling write_a_block() a number of times. Calls sync() to
- * ensure data really reached disk.
- */
-
-static void
-write_whole_rgrp(int fd, struct rglist_entry *rgl)
-{
-	uint32_t l;
-	uint32_t nzb = rgl->ri.ri_length;
-	uint64_t fsoffset = rgl->ri.ri_addr * (uint64_t) fs_sb.sb_bsize;
-
-	if (fsoffset < fssize) {
-		fprintf(stderr,
-			"Sanity check failed: Caught trying to write to live filesystem!\n");
-		exit(EXIT_FAILURE);
-	}
-	if (lseek(fd, fsoffset, SEEK_SET) != fsoffset) {
-		perror(device);
-		exit(EXIT_FAILURE);
-	}
-	write_a_block(fd, &rgl->rg);
-	for (l = 1; l < nzb; l++)
-		write_a_block(fd, NULL);
-}
-
-/**
- * get_length - Use stat() to get the length of a file
- * @fd: The fd of the file whose length we wish to know
- *
- * Returns: The length
- */
-
-static uint64_t
-get_length(int fd, const char *file)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"get_hfile_stat",
-		(char *)file
-	};
-	struct gfs_dinode di;
-	int error;
-
-	gi.gi_argc = 2;
-	gi.gi_argv = argv;
-	gi.gi_data = (char *)&di;
-	gi.gi_size = sizeof(struct gfs_dinode);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size) {
-		perror("stat");
-		fprintf(stderr, "Failed to get size of file. Aborting.\n");
-		exit(EXIT_FAILURE);
-	}
-
-	return di.di_size;
-}
-
-/**
- * write_rindex - Writes new records to the end of the rindex file
- * @fs_fd: A fd of any file or directory withint the GFS filesystem
- *
- * This is the critical function in expanding a filesystem. It does the
- * actual write to the rindex which causes the GFS filesystem to see the
- * new resource groups which were previously added.
- */
-
-static void
-write_rindex(int fs_fd)
-{
-	osi_list_t *tmp, *head;
-	struct rglist_entry *rgl;
-	char *buffer;
-	int b, data_per_blk, data_per_page, firstblock;
-	int chunks_this_page, page_freebytes, data_this_page;
-	long page_size;
-	uint64_t offset, size;
-
-	page_size = sysconf(_SC_PAGESIZE);
-	buffer = malloc(page_size * 2);
-	if (!buffer) {
-		fprintf(stderr, "Error: out of memory.\n");
-		exit(EXIT_FAILURE);
-	}
-	offset = get_length(fs_fd, "rindex");
-
-	/*
-	 * This is the critical section.
-	 * If things mess up here, it could be very difficult to put right
-	 */
-	tmp = head = &rglist_new;
-	firstblock = 1;
-	data_per_blk = fs_sb.sb_bsize - sizeof(struct gfs_meta_header);
-	data_per_page = (page_size / fs_sb.sb_bsize) * data_per_blk;
-	for (;;) {
-		size = 0;
-		/* We used to write new rindex entries out one by one.
-		   However, that can be very slow, especially if there's a
-		   load on the file system.  That's because each write is
-		   done with the glock sync option and the journal will need
-		   to be synced before the glock is freed up for the next
-		   write.  (The rindex file is journaled data). If the block
-		   size matches the page size, the syncs happen much faster.
-		   If the block size is smaller, it takes a huge amount of
-		   time to get all the blocks to settle within the page.
-
-		   What I'm trying to do here is optimize our writes so
-		   that multiple blocks may be allocated during a single
-		   write request, all under the same glock, in order to
-		   get a page-full of data written.  This makes the syncing
-		   go much faster.  The exception is the very first write
-		   (see note below). */
-		data_this_page = offset % data_per_page;
-		page_freebytes = page_size - data_this_page;
-		if (page_freebytes < sizeof(struct gfs_rindex))
-			page_freebytes = data_per_page;
-		chunks_this_page = (page_freebytes /
-				    sizeof(struct gfs_rindex)) + 1;
-		for (b = 0; b < chunks_this_page; b++) {
-			tmp = tmp->next;
-			if (tmp == head)
-				break;
-			rgl = osi_list_entry(tmp, struct rglist_entry, list);
-			gfs_rindex_out(&rgl->ri, buffer + size);
-			size += sizeof(struct gfs_rindex);
-			/* Write the first block on its own.  This minimizes
-			   the chance of running out of blocks on a nearly
-			   full file system.  Once that first block is written,
-			   the file system should have more free blocks to
-			   allocate in chunks. */
-			if (firstblock) {
-				firstblock = 0;
-				break;
-			}
-		}
-		if (size &&
-		    jwrite(fs_fd, "rindex", buffer, size, &offset) != size) {
-			perror("write: rindex");
-			fprintf(stderr, "Aborting...\n");
-			exit(EXIT_FAILURE);
-		}
-		if (tmp == head)
-			break;
-	}
-	/*
-	 * This is the end of the critical section
-	 */
-	free(buffer);
-}
-
-/**
- * write_rgrps - Write the new resource groups to disk
- * @fs_fd: An fd from any file or directory on the GFS mounted filesystem
- *
- * This first writes out the new resource group information to the
- * area of the disk beyond the area the filesystem is currently
- * using and then calls write_rindex() to make the filesystem see
- * the newly written resource groups.
- */
-
-static void
-write_rgrps(int fs_fd)
-{
-	osi_list_t *tmp, *head;
-	struct rglist_entry *rgl;
-	int fd = open(device, O_RDWR);
-
-	if (fd < 0) {
-		perror(device);
-		exit(EXIT_FAILURE);
-	}
-	tmp = head = &rglist_new;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		rgl = osi_list_entry(tmp, struct rglist_entry, list);
-		write_whole_rgrp(fd, rgl);
-	}
-	sync();
-	close(fd);
-
-	sync();
-	sync();
-	sync();
-
-	write_rindex(fs_fd);
-
-	sync();
-	sync();
-	sync();
-}
-
-/**
- * gather_info - Gathers all the information about the existing filesystem
- *
- */
-
-static void
-gather_info(void)
-{
-	int fd;
-	struct gfs_ioctl gi;
-	char *argv[] = { (char *)"get_super" };
-	int error;
-
-	fd = open(fspath, O_RDONLY);
-	if (fd < 0) {
-		perror(fspath);
-		exit(EXIT_FAILURE);
-	}
-
-	gi.gi_argc = 1;
-	gi.gi_argv = argv;
-	gi.gi_data = (char *)&fs_sb;
-	gi.gi_size = sizeof(struct gfs_sb);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size) {
-		perror("ioctl: GFS_GET_SUPER");
-		exit(EXIT_FAILURE);
-	}
-
-	read_rgrps(fd);
-	read_journals(fd);
-	close(fd);
-	devsize = device_geometry(device);
-	fssize = filesystem_size();
-}
-
-/**
- * print_rgrps - Print information about resource groups
- * @lh: The list of resource groups to print
- *
- */
-
-static void
-print_rgrps(osi_list_t *lh)
-{
-	osi_list_t *tmp, *head;
-	struct rglist_entry *rgl;
-	int n = 0;
-
-	tmp = head = lh;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		rgl = osi_list_entry(tmp, struct rglist_entry, list);
-		n++;
-		printf("RI: Addr %"PRIu64", RgLen %u, Start %"PRIu64", DataLen %u, BmapLen %u\n",
-		       rgl->ri.ri_addr, rgl->ri.ri_length,
-		       rgl->ri.ri_data1, rgl->ri.ri_data, rgl->ri.ri_bitbytes);
-	}
-	printf("RGRP: %d Resource groups in total\n", n);
-}
-
-/**
- * print_journals - Print a list of journals
- *
- */
-
-static void
-print_journals(osi_list_t *lh)
-{
-	osi_list_t *tmp, *head;
-	struct jilist_entry *jil;
-	int n = 0;
-
-	tmp = head = lh;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		jil = osi_list_entry(tmp, struct jilist_entry, list);
-		n++;
-		printf("JI: Addr %"PRIu64" NumSeg %u SegSize %u\n",
-		       jil->ji.ji_addr, jil->ji.ji_nsegment, fs_sb.sb_seg_size);
-	}
-	printf("JRNL: %d Journals in total\n", n);
-}
-
-/**
- * print_info - Print out various bits of (interesting?) information
- *
- */
-
-static void
-print_info(void)
-{
-	printf("FS: Mount Point: %s\n", fspath);
-	printf("FS: Device: %s\n", device);
-	printf("FS: Options: %s\n", fsoptions);
-	printf("FS: Size: %"PRIu64"\n", fssize);
-	if (verbose > 1) {
-		printf("RGRP: Current Resource Group List:\n");
-		print_rgrps(&rglist_current);
-		printf("JRNL: Current Journal List:\n");
-		print_journals(&jilist_current);
-	}
-	printf("DEV: Size: %"PRIu64"\n", devsize);
-	if (verbose > 1) {
-		printf("RGRP: New Resource Group List:\n");
-		print_rgrps(&rglist_new);
-	}
-}
-
-#define RGRP_STUFFED_BLKS(sb) (((sb)->sb_bsize - sizeof(struct gfs_rgrp)) * GFS_NBBY)
-#define RGRP_BITMAP_BLKS(sb) (((sb)->sb_bsize - sizeof(struct gfs_meta_header)) * GFS_NBBY)
-
-/**
- * rgrp_length - Calculate the length of a resource group
- * @size: The total size of the resource group
- *
- */
-
-static uint64_t
-rgrp_length(uint64_t size)
-{
-	uint64_t bitbytes = RGRP_BITMAP_BLKS(&fs_sb) + 1;
-	uint64_t stuff = RGRP_STUFFED_BLKS(&fs_sb) + 1;
-	uint64_t blocks = 1;
-
-	if (size < stuff)
-		goto out;
-	size -= stuff;
-	while (size > bitbytes) {
-		blocks++;
-		size -= bitbytes;
-	}
-	if (size)
-		blocks++;
- out:
-	return blocks;
-}
-
-/**
- * make_rgrp - Make a new rglist_entry
- * @offset: The offset at which the new rgrp will go
- * @size: The size of the new rgrp
- *
- * Returns: The end of the new resource group
- */
-
-static uint64_t
-make_rgrp(uint64_t offset, uint64_t size)
-{
-	struct rglist_entry *rgl = malloc(sizeof(struct rglist_entry));
-	if (rgl == NULL)
-		exit(EXIT_FAILURE);
-	memset(rgl, 0, sizeof(struct rglist_entry));
-
-	rgl->ri.ri_addr = offset;
-	rgl->ri.ri_length = rgrp_length(size);
-	rgl->ri.ri_data1 = offset + rgl->ri.ri_length;
-	rgl->ri.ri_data = size - rgl->ri.ri_length;
-
-	/* Round down to nearest multiple of GFS_NBBY */
-	while (rgl->ri.ri_data & 0x03)
-		rgl->ri.ri_data--;
-
-	rgl->ri.ri_bitbytes = rgl->ri.ri_data / GFS_NBBY;
-
-	rgl->rg.rg_header.mh_magic = GFS_MAGIC;
-	rgl->rg.rg_header.mh_type = GFS_METATYPE_RG;
-	rgl->rg.rg_header.mh_format = GFS_FORMAT_RG;
-	rgl->rg.rg_free = rgl->ri.ri_data;
-
-	osi_list_add_prev(&rgl->list, &rglist_new);
-	return offset + size;
-}
-
-/**
- * create_rgrps - Create a list of the new rgrps
- * 
- */
-
-static void
-create_rgrps(void)
-{
-	uint64_t space = devsize - fssize;
-	uint64_t optimal_rgrp_size = RGRP_STUFFED_BLKS(&fs_sb) +
-		14 * RGRP_BITMAP_BLKS(&fs_sb) + 15;
-	uint64_t rgrps = space / optimal_rgrp_size;
-	uint64_t offset = fssize;
-	uint64_t rgsize;
-	uint64_t n;
-
-	if (space % optimal_rgrp_size)
-		rgrps++;
-	rgsize = optimal_rgrp_size;
-
-	for (n = 0; n < rgrps; n++)
-		offset = make_rgrp(offset, (n != 0) ? rgsize :
-				   (space - ((rgrps - 1) * rgsize)));
-
-	if (offset > devsize) {
-		fprintf(stderr, "Calculation error: Out of bounds\n");
-		exit(EXIT_FAILURE);
-	}
-}
-
-/**
- * update_fs - Actually perform the filesystem update
- *
- */
-
-static void
-update_fs(void)
-{
-	int fd = open(fspath, O_RDONLY);
-	if (fd < 0) {
-		perror(fspath);
-		exit(EXIT_FAILURE);
-	}
-	if (verbose)
-		printf("Preparing to write new FS information...\n");
-	write_rgrps(fd);
-	if (verbose)
-		printf("Done.\n");
-	close(fd);
-}
-
-/**
- * find_fs - Find the filesystem which the user specified
- * @name: The name of a device or mount point
- *
- * Returns: 0 if the filesystem is located, 1 otherwise
- */
-
-static int
-find_fs(const char *name)
-{
-	FILE *fp = fopen("/proc/mounts", "r");
-	char buffer[4096];
-	char fstype[80];
-	int fsdump, fspass;
-	char *realname;
-
-	realname = realpath(name, NULL);
-	if (!realname) {
-		perror(name);
-		return -1;
-	}
-	if (fp == NULL) {
-		perror("open: /proc/mounts");
-		exit(EXIT_FAILURE);
-	}
-	while ((fgets(buffer, 4095, fp)) != NULL) {
-		buffer[4095] = 0;
-		if (strstr(buffer, realname) == 0)
-			continue;
-		if (sscanf(buffer, "%s %s %s %s %d %d", device, fspath, fstype,
-			   fsoptions, &fsdump, &fspass) != 6)
-			continue;
-		if (strcmp(fstype, "gfs") != 0)
-			continue;
-		if ((strcmp(device, realname) != 0) &&
-		    (strcmp(fspath, realname) != 0))
-			continue;
-		fclose(fp);
-		free(realname);
-		return 0;
-	}
-	fprintf(stderr, "GFS Filesystem %s not found\n", name);
-	fclose(fp);
-	free(realname);
-	return 1;
-}
-
-/**
- * delete_rgrp_list - Delete a list of rgrps
- * @list: The list to delete
- *
- */
-
-static void
-delete_rgrp_list(osi_list_t *list)
-{
-	struct rglist_entry *rg;
-
-	while (!osi_list_empty(list)) {
-		rg = osi_list_entry(list->next, struct rglist_entry, list);
-		osi_list_del(&rg->list);
-		free(rg);
-	}
-}
-
-/**
- * delete_jrnl_list - Delete a list of journals
- * @list: the list to delete
- *
- */
-
-static void
-delete_jrnl_list(osi_list_t *list)
-{
-	struct jilist_entry *ji;
-
-	while (!osi_list_empty(list)) {
-		ji = osi_list_entry(list->next, struct jilist_entry, list);
-		osi_list_del(&ji->list);
-		free(ji);
-	}
-}
-
-/**
- * usage - Print out the usage message
- *
- * This function does not include documentation for the -D option
- * since normal users have no use for it at all. The -D option is
- * only for developers. It intended use is in combination with the
- * -T flag to find out what the result would be of trying different
- * device sizes without actually having to try them manually.
- */
-
-static void
-usage(void)
-{
-	fprintf(stdout,
-		"Usage:\n"
-		"\n"
-		"gfs_grow [options] /path/to/filesystem\n"
-		"\n"
-		"Options:\n"
-		"  -h               Usage information\n"
-		"  -q               Quiet, reduce verbosity\n"
-		"  -T               Test, do everything except update FS\n"
-		"  -V               Version information\n"
-		"  -v               Verbose, increase verbosity\n");
-}
-
-/**
- * main - Tha main function
- * @argc: The argument count
- * @argv: The argument vector
- *
- * Runs through the filesystem expansion code for each of the specified
- * filesystems. Each filesystem specified on the command line has the
- * same options applied to it. You'll need to run the program multiple times
- * if you want to use it on several different filesystems with different
- * options for each. If you forget to specify a filesystem, then it is
- * assumed that the program has run successfully, since its done everything
- * asked of it, and it exits without printing a message.
- *
- * Returns: 0 on success, -1 otherwise
- */
-
-int
-main(int argc, char *argv[])
-{
-	int opt;
-	int error = 0;
-
-	while ((opt = getopt(argc, argv, "VD:hqTv?")) != EOF) {
-		switch (opt) {
-		case 'D':	/* This option is for testing only */
-			override_device_size = atoi(optarg);
-			override_device_size <<= 20;
-			break;
-		case 'V':
-			printf("%s %s (built %s %s)\n", argv[0],
-			       RELEASE_VERSION, __DATE__, __TIME__);
-			printf("%s\n", REDHAT_COPYRIGHT);
-			exit(0);
-		case 'h':
-			usage();
-			exit(0);
-		case 'q':
-			if (verbose)
-				verbose--;
-			break;
-		case 'T':
-			test = 1;
-			break;
-		case 'v':
-			verbose++;
-			break;
-		case ':':
-		case '?':
-			/* Unknown flag */
-			fprintf(stderr, "Please use '-h' for usage.\n");
-			exit(EXIT_FAILURE);
-		default:
-			fprintf(stderr, "Bad programmer! You forgot"
-				" to catch the %c flag\n", opt);
-			exit(EXIT_FAILURE);
-			break;
-		}
-	}
-
-	if (optind == argc) {
-		usage();
-		exit(EXIT_FAILURE);
-	}
-
-	while ((argc - optind) > 0) {
-		if (find_fs(argv[optind++])) {
-			error = 1;
-			continue;
-		}
-		gather_info();
-		if (fssize > devsize) {
-			error = 1;
-			fprintf(stderr,
-				"Filesystem thinks device is bigger than it really is.... skipping\n");
-			continue;
-		}
-		if ((devsize - fssize) < 100) {
-			error = 1;
-			fprintf(stderr,
-				"Device has grown by less than 100 blocks.... skipping\n");
-			continue;
-		}
-		create_rgrps();
-		if (verbose)
-			print_info();
-		if (!test)
-			update_fs();
-		delete_rgrp_list(&rglist_current);
-		delete_rgrp_list(&rglist_new);
-		delete_jrnl_list(&jilist_current);
-	}
-
-	return error;
-}
diff --git a/gfs/gfs_grow/ondisk.c b/gfs/gfs_grow/ondisk.c
deleted file mode 100644
index 191c688..0000000
--- a/gfs/gfs_grow/ondisk.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-#include "gfs_ondisk.h"
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#define ENTER(x)
-#define EXIT(x)
-#define RET(x) return
-#define RETURN(x, y) return y
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
diff --git a/gfs/gfs_jadd/Makefile b/gfs/gfs_jadd/Makefile
deleted file mode 100644
index 0d41942..0000000
--- a/gfs/gfs_jadd/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-TARGET= gfs_jadd
-
-SBINDIRT=$(TARGET)
-
-all: depends ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS= main.o \
-      ondisk.o
-
-CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${gfskincdir}
-CFLAGS += -I$(S)/../include -I$(S)/../libgfs
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L../libgfs -lgfs
-LDFLAGS += -L${libdir}
-
-LDDEPS += ../libgfs/libgfs.a
-
-${TARGET}: ${OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-depends:
-	$(MAKE) -C ../libgfs all
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_jadd/main.c b/gfs/gfs_jadd/main.c
deleted file mode 100644
index 5f0affd..0000000
--- a/gfs/gfs_jadd/main.c
+++ /dev/null
@@ -1,928 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <sys/ioctl.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-#define __user
-#include "gfs_ioctl.h"
-#include "osi_list.h"
-#include "libgfs.h"
-
-#include "copyright.cf"
-
-#define BLOCK_END(buffer, type) ((buffer) + GFS_BASIC_BLOCK - sizeof(type))
-
-struct rglist_entry {
-	osi_list_t list;
-	struct gfs_rindex ri;
-	struct gfs_rgrp rg;
-};
-
-struct jilist_entry {
-	osi_list_t list;
-	struct gfs_jindex ji;
-};
-
-/*
- * verbose: 0 = no messages, 1 = normal, 2 = everything
- * test: 0 = normal, 1 = don't actually write data, but do everything else
- * fspath: path to root of mounted GFS filesystem
- * device: the device upon which the GFS filesystem is mounted
- * fsoptions: the mount options used
- * devsize: the size of the device (in filesystem blocks, rounded down)
- * fssize: the size of the filesystem (in filesystem blocks, rounded down)
- * override_device_size: if non-zero, this is used for the device size
- * number_of_journals: Number of journals to add to each fs
- * journal_size: The size of each journal, in MB
- * journal_size_blocks: The size of each journal in fs blocks
- */
-static int verbose = 1;
-static int test = 0;
-static char fspath[4096];
-static char device[1024];
-static char fsoptions[4096];
-static uint64_t devsize;
-static uint64_t fssize;
-static uint64_t override_device_size = 0;
-static unsigned int number_of_journals = 1;
-static uint64_t journal_size = 128;
-static uint64_t journal_size_blocks;
-
-/*
- * fs_sb: the superblock read from the mounted filesystem
- * rglist_current: list of resource groups currently making up the filesystem
- * jilist_current: list of current journals in the filesystem
- * jilist_new: where we put the new resource groups to be written
- */
-static struct gfs_sb fs_sb;
-static osi_list_decl(rglist_current);
-static osi_list_decl(jilist_current);
-static osi_list_decl(jilist_new);
-
-/**
- * device_geometry - Find out the size of a block device
- * @device: The name of the device
- *
- * Returns: The size of the device in FS blocks
- */
-
-static uint64_t
-device_geometry(char *device_g)
-{
-	int fd;
-	uint64_t bytes;
-	int error;
-
-	if (override_device_size)
-		bytes = override_device_size;
-	else {
-		fd = open(device_g, O_RDONLY);
-		if (fd < 0) {
-			fprintf(stderr, "gfs_jadd: can't open %s: %s\n",
-				device_g, strerror(errno));
-			exit(EXIT_FAILURE);
-		}
-
-		error = device_size(fd, &bytes);
-		if (error) {
-			fprintf(stderr,
-				"gfs_grow: can't determine size of %s: %s\n",
-				device_g, strerror(errno));
-			exit(EXIT_FAILURE);
-		}
-
-		close(fd);
-	}
-
-	return bytes >> fs_sb.sb_bsize_shift;
-}
-
-/**
- * jread - Read from journaled file using ioctl()
- * @fd: The fd to read from
- * @file: The file to read
- * @buf: The buffer to fill
- * @size: The amount of data to read
- * @offset: The offset to read from
- *
- * Returns: Error code, or amount of data read
- */
-
-static int
-jread(int fd, const char *file, void *buf, uint64_t size, uint64_t *offset)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"do_hfile_read",
-		(char *)file
-	};
-	int error;
-
-	gi.gi_argc = 2;
-	gi.gi_argv = argv;
-	gi.gi_data = buf;
-	gi.gi_size = size;
-	gi.gi_offset = *offset;
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error > 0)
-		*offset += error;
-
-	return error;
-}
-
-/**
- * jwrite - Write to journaled file using ioctl()
- * @fd: The fd to write to
- * @file: The file to write
- * @buf: The buffer to write
- * @size: The amount of data to write
- * @offset: The offset at which to write the data
- *
- * Returns: Error code, or the amount of data written
- */
-
-static int
-jwrite(int fd, const char *file, void *buf, uint64_t size, uint64_t *offset)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"do_hfile_write",
-		(char *)file
-	};
-	int error;
-
-	gi.gi_argc = 2;
-	gi.gi_argv = argv;
-	gi.gi_data = buf;
-	gi.gi_size = size;
-	gi.gi_offset = *offset;
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error > 0)
-		*offset += error;
-
-	return error;
-}
-
-/**
- * filesystem_size - Calculate the size of the filesystem
- *
- * Reads the lists of journals and resource groups in order to
- * work out where the last block of the filesystem is located.
- *
- * Returns: The calculated size
- */
-
-static uint64_t
-filesystem_size(void)
-{
-	osi_list_t *tmp, *head;
-	struct rglist_entry *rgl;
-	struct jilist_entry *jil;
-	uint64_t size = 0;
-	uint64_t extent;
-
-	tmp = head = &rglist_current;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		rgl = osi_list_entry(tmp, struct rglist_entry, list);
-		extent = rgl->ri.ri_addr + rgl->ri.ri_length + rgl->ri.ri_data;
-		if (extent > size)
-			size = extent;
-	}
-
-	tmp = head = &jilist_current;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		jil = osi_list_entry(tmp, struct jilist_entry, list);
-		extent = jil->ji.ji_addr + jil->ji.ji_nsegment * fs_sb.sb_seg_size;
-		if (extent > size)
-			size = extent;
-	}
-
-	return size;
-}
-
-/**
- * gfs_jientry - Get journal index entry
- * @fd: The fd of the journal index
- * @offset: The offset at which the journal entry appears
- *
- * Reads a single entry from the journal index file and
- * adds it to the list of current journal entries.
- *
- * Returns: 1 on EOF, 0 otherwise
- */
-
-static int
-get_jientry(int fd, uint64_t *offset)
-{
-	char buffer[sizeof(struct gfs_jindex)];
-	int len = jread(fd, "jindex", buffer,
-			sizeof(struct gfs_jindex), offset);
-	struct jilist_entry *jil;
-
-	if (len != sizeof(struct gfs_jindex)) {
-		if (len == 0)
-			return 1;
-		fprintf(stderr, "Erk! Read odd size from jindex (%d)\n", len);
-		exit(EXIT_FAILURE);
-	}
-	if ((jil = malloc(sizeof(struct jilist_entry))) == NULL) {
-		perror("jilist_entry");
-		exit(EXIT_FAILURE);
-	}
-	memset(jil, 0, sizeof(struct jilist_entry));
-	gfs_jindex_in(&jil->ji, buffer);
-	osi_list_add(&jil->list, &jilist_current);
-	return 0;
-}
-
-/**
- * read_journals - Read the whole journal index
- * @fs_fd: An fd for some file or directory within the mounted GFS filesystem
- *
- */
-
-static void
-read_journals(int fs_fd)
-{
-	uint64_t offset = 0;
-	while (get_jientry(fs_fd, &offset) == 0)
-		/* do nothing */;
-}
-
-/**
- * get_rgrp - Read a single rindex entry
- * @fd: The fd for the rindex file
- * @offset: The offset at which to read the rindex entry
- *
- * Reads a single rindex entry and adds it to the list of current
- * resource group entries.
- *
- * Returns: 1 on EOF, 0 otherwise
- */
-
-static int
-get_rgrp(int fd, uint64_t *offset)
-{
-	char buffer[sizeof(struct gfs_rindex)];
-	int len = jread(fd, "rindex", buffer,
-			sizeof(struct gfs_rindex), offset);
-	struct rglist_entry *rgl;
-
-	if (len != sizeof(struct gfs_rindex)) {
-		if (len == 0)
-			return 1;
-		fprintf(stderr, "Erk! Read odd size from rindex (%d)\n", len);
-		exit(EXIT_FAILURE);
-	}
-	if ((rgl = malloc(sizeof(struct rglist_entry))) == NULL) {
-		perror("rglist_entry");
-		exit(EXIT_FAILURE);
-	}
-	memset(rgl, 0, sizeof(struct rglist_entry));
-	gfs_rindex_in(&rgl->ri, buffer);
-	osi_list_add(&rgl->list, &rglist_current);
-	return 0;
-}
-
-/**
- * read_rgrps - Reads the contents of the rindex file
- * @fs_fd: An fd for any file or directory within the mounted GFS filesytem
- *
- */
-
-static void
-read_rgrps(int fs_fd)
-{
-	uint64_t offset = 0;
-	while (get_rgrp(fs_fd, &offset) == 0)
-		/* do nothing */;
-}
-
-/**
- * write_a_block - Write a block to the current device
- * @where: The position to write the block (in filesystem blocks)
- *
- * Writes a single disk block to the device. It has a safety check which
- * prevents it writing to the device at a position within the control of
- * the active filesystem. 
- */
-
-static void
-write_a_block(uint64_t where, uint64_t seq)
-{
-	char buffer[4096];
-	uint64_t fsoffset = where * (uint64_t) fs_sb.sb_bsize;
-	int fd = open(device, O_RDWR);
-	struct gfs_log_header lh;
-
-	memset(&lh, 0, sizeof(struct gfs_log_header));
-
-	lh.lh_header.mh_magic = GFS_MAGIC;
-	lh.lh_header.mh_type = GFS_METATYPE_LH;
-	lh.lh_header.mh_format = GFS_FORMAT_LH;
-	lh.lh_flags = GFS_LOG_HEAD_UNMOUNT;
-	lh.lh_first = where;
-	lh.lh_sequence = seq;
-
-	if (fd < 0) {
-		perror(device);
-		exit(EXIT_FAILURE);
-	}
-	if (where < fssize) {
-		fprintf(stderr,
-			"Sanity check failed: Caught trying to write to live filesystem!\n");
-		exit(EXIT_FAILURE);
-	}
-
-	memset(buffer, 0, 4096);
-	gfs_log_header_out(&lh, buffer);
-	gfs_log_header_out(&lh, BLOCK_END(buffer, struct gfs_log_header));
-
-	if (lseek(fd, fsoffset, SEEK_SET) != fsoffset) {
-		perror(device);
-		exit(EXIT_FAILURE);
-	}
-	if (write(fd, buffer, fs_sb.sb_bsize) != fs_sb.sb_bsize) {
-		perror("write_a_block");
-		exit(EXIT_FAILURE);
-	}
-	close(fd);
-}
-
-/**
- * write_whole_journal - Write a complete journal to the disk
- * @jil: The information about the journal
- *
- * Write a complete new journal on disk.
- */
-
-static void
-write_whole_journal(struct jilist_entry *jil)
-{
-	uint64_t seg;
-	uint64_t offset;
-
-	for (seg = 0; seg < jil->ji.ji_nsegment; seg++) {
-		offset = seg * fs_sb.sb_seg_size;
-		write_a_block(jil->ji.ji_addr + offset, offset);
-	}
-
-	sync();
-}
-
-/**
- * get_length - Use stat() to get the length of a file
- * @fd: The fd of the file whose length we wish to know
- *
- * Returns: The length
- */
-
-static uint64_t
-get_length(int fd, const char *file)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"get_hfile_stat",
-		(char *)file
-	};
-	struct gfs_dinode di;
-	int error;
-
-	gi.gi_argc = 2;
-	gi.gi_argv = argv;
-	gi.gi_data = (char *)&di;
-	gi.gi_size = sizeof(struct gfs_dinode);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size) {
-		perror("stat");
-		fprintf(stderr, "Failed to get size of file. Aborting.\n");
-		exit(EXIT_FAILURE);
-	}
-
-	return di.di_size;
-}
-
-/**
- * write_jindex - Writes new records to the end of the jindex file
- * @fs_fd: A fd of any file or directory withint the GFS filesystem
- *
- * This is the critical function in adding journals. It does the
- * actual write to the jindex which causes the GFS filesystem to see the
- * new journals which were previously added.
- */
-
-static void
-write_jindex(int fs_fd)
-{
-	osi_list_t *tmp, *head;
-	struct jilist_entry *jil;
-	char buffer[sizeof(struct gfs_jindex)];
-	uint64_t offset;
-
-	offset = get_length(fs_fd, "jindex");
-
-	/*
-	 * This is the critical section.
-	 * If things mess up here, it could be very difficult to put right
-	 */
-	tmp = head = &jilist_new;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		jil = osi_list_entry(tmp, struct jilist_entry, list);
-		gfs_jindex_out(&jil->ji, buffer);
-		if (jwrite(fs_fd, "jindex", buffer,
-			   sizeof(struct gfs_jindex), &offset) !=
-		    sizeof(struct gfs_jindex)) {
-			perror("write: jindex");
-			fprintf(stderr, "Aborting...\n");
-			exit(EXIT_FAILURE);
-		}
-	}
-	/*
-	 * This is the end of the critical section
-	 */
-}
-
-/**
- * write_journals - Write the new journals to disk
- * @fs_fd: An fd from any file or directory on the GFS mounted filesystem
- *
- * This first writes out the new journal information to the
- * area of the disk beyond the area the filesystem is currently
- * using and then calls write_jindex() to make the filesystem see
- * the newly written journal.
- */
-
-static void
-write_journals(int fs_fd)
-{
-	osi_list_t *tmp, *head;
-	struct jilist_entry *jil;
-
-	tmp = head = &jilist_new;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		jil = osi_list_entry(tmp, struct jilist_entry, list);
-		write_whole_journal(jil);
-	}
-
-	sync();
-	sync();
-	sync();
-
-	write_jindex(fs_fd);
-
-	sync();
-	sync();
-	sync();
-}
-
-/**
- * gather_info - Gathers all the information about the existing filesystem
- *
- */
-
-static void
-gather_info(void)
-{
-	int fd;
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"get_super"
-	};
-	int error;
-
-	fd = open(fspath, O_RDONLY);
-	if (fd < 0) {
-		perror(fspath);
-		exit(EXIT_FAILURE);
-	}
-
-	gi.gi_argc = 1;
-	gi.gi_argv = argv;
-	gi.gi_data = (char *)&fs_sb;
-	gi.gi_size = sizeof(struct gfs_sb);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size) {
-		perror("ioctl: GFS_GET_SUPER");
-		exit(EXIT_FAILURE);
-	}
-
-	read_rgrps(fd);
-	read_journals(fd);
-	close(fd);
-	devsize = device_geometry(device);
-	fssize = filesystem_size();
-
-	journal_size_blocks = journal_size << (20 - fs_sb.sb_bsize_shift);
-	/*
-	 * Round size down to integer number of segments
-	 */
-	while (journal_size_blocks % fs_sb.sb_seg_size) {
-		journal_size_blocks--;
-		journal_size -= fs_sb.sb_bsize;
-	}
-}
-
-/**
- * print_rgrps - Print information about resource groups
- * @lh: The list of resource groups to print
- *
- */
-
-static void
-print_rgrps(osi_list_t *lh)
-{
-	osi_list_t *tmp, *head;
-	struct rglist_entry *rgl;
-	int n = 0;
-
-	tmp = head = lh;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		rgl = osi_list_entry(tmp, struct rglist_entry, list);
-		n++;
-		printf("RI: Addr %"PRIu64", RgLen %u, Start %"PRIu64", DataLen %u, BmapLen %u\n",
-		       rgl->ri.ri_addr, rgl->ri.ri_length,
-		       rgl->ri.ri_data1, rgl->ri.ri_data, rgl->ri.ri_bitbytes);
-	}
-	printf("RGRP: %d Resource groups in total\n", n);
-}
-
-/**
- * print_journals - Print a list of journals
- *
- */
-
-static void
-print_journals(osi_list_t *lh)
-{
-	osi_list_t *tmp, *head;
-	struct jilist_entry *jil;
-	int n = 0;
-
-	tmp = head = lh;
-	for (;;) {
-		tmp = tmp->next;
-		if (tmp == head)
-			break;
-		jil = osi_list_entry(tmp, struct jilist_entry, list);
-		n++;
-		printf("JI: Addr %"PRIu64" NumSeg %u SegSize %u\n",
-		       jil->ji.ji_addr, jil->ji.ji_nsegment, fs_sb.sb_seg_size);
-	}
-	printf("JRNL: %d Journals in total\n", n);
-}
-
-/**
- * print_info - Print out various bits of (interesting?) information
- *
- */
-
-static void
-print_info(void)
-{
-	printf("FS: Mount Point: %s\n", fspath);
-	printf("FS: Device: %s\n", device);
-	printf("FS: Options: %s\n", fsoptions);
-	printf("FS: Size: %"PRIu64"\n", fssize);
-	if (verbose > 1) {
-		printf("RGRP: Current Resource Group List:\n");
-		print_rgrps(&rglist_current);
-		printf("JRNL: Current Journal List:\n");
-		print_journals(&jilist_current);
-	}
-	printf("DEV: Size: %"PRIu64"\n", devsize);
-	if (verbose > 1) {
-		printf("JRNL: New Journal List:\n");
-		print_journals(&jilist_new);
-	}
-}
-
-/**
- * make_journal - Make a new jilist_entry
- * @offset: The offset at which the new journal will go
- * @size: The size of the new journal in fs blocks
- *
- */
-
-static uint64_t
-make_journal(uint64_t offset, uint64_t size)
-{
-	struct jilist_entry *jil = malloc(sizeof(struct jilist_entry));
-	if (jil == NULL) {
-		perror("jilist_entry");
-		exit(EXIT_FAILURE);
-	}
-	memset(jil, 0, sizeof(struct jilist_entry));
-
-	if (offset % fs_sb.sb_seg_size) {
-		size -= fs_sb.sb_seg_size - (offset % fs_sb.sb_seg_size);
-		offset += fs_sb.sb_seg_size - (offset % fs_sb.sb_seg_size);
-	}
-
-	jil->ji.ji_addr = offset;
-	jil->ji.ji_nsegment = size / fs_sb.sb_seg_size;
-
-	osi_list_add(&jil->list, &jilist_new);
-	return offset + size;
-}
-
-/**
- * create_journals - Create a list of the new journals
- * 
- */
-
-static int
-create_journals(void)
-{
-	uint64_t offset = fssize;
-	int n;
-
-	if ((journal_size_blocks * number_of_journals) > (devsize - fssize)) {
-		fprintf(stderr,
-			"Requested size (%" PRIu64
-			" blocks) greater than available space (%" PRIu64
-			" blocks)\n", journal_size_blocks * number_of_journals,
-			devsize - fssize);
-		return -1;
-	}
-
-	for (n = 0; n < number_of_journals; n++)
-		offset = make_journal(offset, journal_size_blocks);
-
-	if (offset > devsize) {
-		fprintf(stderr, "Calculation error: Out of bounds\n");
-		exit(EXIT_FAILURE);
-	}
-
-	return 0;
-}
-
-/**
- * update_fs - Actually perform the filesystem update
- *
- */
-
-static void
-update_fs(void)
-{
-	int fd = open(fspath, O_RDONLY);
-	if (fd < 0) {
-		perror(fspath);
-		exit(EXIT_FAILURE);
-	}
-	if (verbose)
-		printf("Preparing to write new FS information...\n");
-	write_journals(fd);
-	if (verbose)
-		printf("Done.\n");
-	close(fd);
-}
-
-/**
- * find_fs - Find the filesystem which the user specified
- * @name: The name of a device or mount point
- *
- * Returns: 0 if the filesystem is located, 1 otherwise
- */
-
-static int
-find_fs(const char *name)
-{
-	FILE *fp = fopen("/proc/mounts", "r");
-	char buffer[4096];
-	char fstype[80];
-	int fsdump, fspass;
-	char *realname;
-
-	realname = realpath(name, NULL);
-	if (!realname) {
-		perror(name);
-		return -1;
-	}
-	if (fp == NULL) {
-		perror("open: /proc/mounts");
-		exit(EXIT_FAILURE);
-	}
-	while ((fgets(buffer, 4095, fp)) != NULL) {
-		buffer[4095] = 0;
-		if (strstr(buffer, realname) == 0)
-			continue;
-		if (sscanf(buffer, "%s %s %s %s %d %d", device, fspath, fstype,
-			   fsoptions, &fsdump, &fspass) != 6)
-			continue;
-		if (strcmp(fstype, "gfs") != 0)
-			continue;
-		if ((strcmp(device, realname) != 0) &&
-		    (strcmp(fspath, realname) != 0))
-			continue;
-		fclose(fp);
-		free(realname);
-		return 0;
-	}
-	fprintf(stderr, "GFS Filesystem %s not found\n", name);
-	fclose(fp);
-	free(realname);
-	return 1;
-}
-
-/**
- * delete_rgrp_list - Delete a list of rgrps
- * @list: The list to delete
- *
- */
-
-static void
-delete_rgrp_list(osi_list_t *list)
-{
-	struct rglist_entry *rg;
-
-	while (!osi_list_empty(list)) {
-		rg = osi_list_entry(list->next, struct rglist_entry, list);
-		osi_list_del(&rg->list);
-		free(rg);
-	}
-}
-
-/**
- * delete_jrnl_list - Delete a list of journals
- * @list: The list to delete
- *
- */
-
-static void
-delete_jrnl_list(osi_list_t *list)
-{
-	struct jilist_entry *ji;
-
-	while (!osi_list_empty(list)) {
-		ji = osi_list_entry(list->next, struct jilist_entry, list);
-		osi_list_del(&ji->list);
-		free(ji);
-	}
-}
-
-/**
- * usage - Print out the usage message
- *
- * This function does not include documentation for the -D option
- * since normal users have no use for it at all. The -D option is
- * only for developers. It intended use is in combination with the
- * -T flag to find out what the result would be of trying different
- * device sizes without actually having to try them manually.
- */
-
-static void
-usage(void)
-{
-	fprintf(stdout,
-		"Usage:\n"
-		"\n"
-		"gfs_jadd [options] /path/to/filesystem\n"
-		"\n"
-		"Options:\n"
-		"  -h               Print this usage information.\n"
-		"  -J <MB>          Size of journals in MB (minimum 32, default 128)\n"
-		"  -j <num>         Number of journals to add (default 1)\n"
-		"  -q               Quiet, reduce verbosity\n"
-		"  -T               Test, do everything except update FS\n"
-		"  -V               Version information\n"
-		"  -v               Verbose, increase verbosity\n");
-}
-
-/**
- * main - Tha main function
- * @argc: The argument count
- * @argv: The argument vector
- *
- * Runs through the filesystem expansion code for each of the specified
- * filesystems. Each filesystem specified on the command line has the
- * same options applied to it. You'll need to run the program multiple times
- * if you want to use it on several different filesystems with different
- * options for each. If you forget to specify a filesystem, then it is
- * assumed that the program has run successfully, since its done everything
- * asked of it, and it exits without printing a message.
- *
- * Returns: 0 on success, -1 otherwise
- */
-
-int
-main(int argc, char *argv[])
-{
-	int opt;
-	int error = 0;
-
-	while ((opt = getopt(argc, argv, "D:Vhj:J:vqT?")) != EOF) {
-		switch (opt) {
-		case 'D':	/* This option is for testing only */
-			override_device_size = atoi(optarg);
-			override_device_size <<= 20;
-			break;
-		case 'V':
-			printf("%s %s (built %s %s)\n", argv[0],
-			       RELEASE_VERSION, __DATE__, __TIME__);
-			printf("%s\n", REDHAT_COPYRIGHT);
-			exit(0);
-		case 'h':
-			usage();
-			exit(0);
-		case 'j':
-			number_of_journals = atoi(optarg);
-			if (number_of_journals < 1) {
-				fprintf(stderr,
-					"Erk! Number of journals must be 1 or greater.\n");
-				usage();
-				exit(EXIT_FAILURE);
-			}
-			break;
-		case 'J':
-			journal_size = atoi(optarg);
-			if (journal_size < 32) {
-				fprintf(stderr,
-					"Erk! Specified journal size of %"
-					PRIu64 " is too small.\n",
-					journal_size);
-				usage();
-				exit(EXIT_FAILURE);
-			}
-			break;
-		case 'q':
-			if (verbose)
-				verbose--;
-			break;
-		case 'T':
-			test = 1;
-			break;
-		case 'v':
-			verbose++;
-			break;
-		case ':':
-		case '?':
-			fprintf(stderr, "Please use '-h' for usage.\n");
-			exit(EXIT_FAILURE);
-		default:
-			fprintf(stderr, "Bad programmer! You forgot"
-				" to catch the %c flag\n", opt);
-			exit(EXIT_FAILURE);
-			break;
-		}
-	}
-
-	if (optind == argc) {
-		usage();
-		exit(EXIT_FAILURE);
-	}
-
-	while ((argc - optind) > 0) {
-		if (find_fs(argv[optind++])) {
-			error = 1;
-			continue;
-		}
-		gather_info();
-		if (fssize > devsize) {
-			fprintf(stderr,
-				"Filesystem thinks device is bigger than it really is.... skipping\n");
-			error = 1;
-			continue;
-		}
-		if (create_journals()) {
-			error = 1;
-			continue;
-		}
-		if (verbose)
-			print_info();
-		if (!test)
-			update_fs();
-		delete_rgrp_list(&rglist_current);
-		delete_jrnl_list(&jilist_current);
-		delete_jrnl_list(&jilist_new);
-	}
-
-	return error;
-}
diff --git a/gfs/gfs_jadd/ondisk.c b/gfs/gfs_jadd/ondisk.c
deleted file mode 100644
index 191c688..0000000
--- a/gfs/gfs_jadd/ondisk.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-#include "gfs_ondisk.h"
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#define ENTER(x)
-#define EXIT(x)
-#define RET(x) return
-#define RETURN(x, y) return y
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
diff --git a/gfs/gfs_mkfs/Makefile b/gfs/gfs_mkfs/Makefile
deleted file mode 100644
index 93f9093..0000000
--- a/gfs/gfs_mkfs/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-TARGET= mkfs.gfs
-
-FORCESBINT= $(TARGET)
-
-all: depends ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	device_geometry.o \
-	fs_geometry.o \
-	locking.o \
-	main.o \
-	ondisk.o \
-	structures.o
-
-CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-CFLAGS += -I${gfskincdir}
-CFLAGS += -I$(S)/../include -I$(S)/../libgfs
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L../libgfs -lgfs
-LDFLAGS += -L${libdir}
-
-LDDEPS += ../libgfs/libgfs.a
-
-${TARGET}: ${OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-depends:
-	$(MAKE) -C ../libgfs all
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_mkfs/device_geometry.c b/gfs/gfs_mkfs/device_geometry.c
deleted file mode 100644
index 6152bca..0000000
--- a/gfs/gfs_mkfs/device_geometry.c
+++ /dev/null
@@ -1,153 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/param.h>
-
-#include "global.h"
-#include "gfs_ondisk.h"
-#include "osi_list.h"
-#include "mkfs_gfs.h"
-#include "libgfs.h"
-
-/**
- * device_geometry - Get the size of a device
- * @comline: the command line
- * @device: the structure the geometry is returned in
- *
- */
-
-void device_geometry(commandline_t *comline, mkfs_device_t *device)
-{
-	int fd;
-	uint64 bytes;
-	int error;
-
-	fd = open(comline->device, O_RDONLY | O_CLOEXEC);
-	if (fd < 0)
-		die("can't open %s: %s\n", comline->device, strerror(errno));
-
-	error = device_size(fd, &bytes);
-	if (error)
-		die("can't determine size of %s: %s\n", comline->device, strerror(errno));
-
-	close(fd);
-
-	if (comline->debug)
-		printf("\nPartition size = %"PRIu64"\n", bytes >> 9);
-
-	device->nsubdev = 1;
-
-	type_zalloc(device->subdev, mkfs_subdevice_t, 1);
-
-	device->subdev->start = 0;
-	device->subdev->length = bytes >> 9;
-}
-
-/**
- * add_journals_to_device - carve space out of a mkfs_device_t to add journals
- * @comline: the command line arguments
- * @device: the mkfs_device_t
- *
- */
-
-void add_journals_to_device(commandline_t *comline, mkfs_device_t *device)
-{
-	mkfs_subdevice_t *old;
-	uint64 jsize;
-	unsigned int x;
-
-	MKFS_ASSERT(device->nsubdev == 1 &&
-				!device->subdev->is_journal, );
-
-	if (!comline->journals)
-		die("No journals specified (use -j)\n");
-
-	if (!comline->jsize)
-		die("journal size is zero (use -J)\n");
-
-	jsize = comline->jsize * (1 << 20) / GFS_BASIC_BLOCK;
-
-	if (comline->journals * jsize > device->subdev->length)
-		die("Partition too small for number/size of journals\n");
-
-	old = device->subdev;
-
-	device->nsubdev = comline->journals + 2;
-	type_zalloc(device->subdev, mkfs_subdevice_t, device->nsubdev);
-	
-	device->subdev[0].start = old->start;
-	device->subdev[0].length = (old->length - comline->journals * jsize) / 2;
-
-	for (x = 1; x <= comline->journals; x++) {
-		device->subdev[x].start = device->subdev[x - 1].start + device->subdev[x - 1].length;
-		device->subdev[x].length = jsize;
-		device->subdev[x].is_journal = TRUE;
-	}
-
-	device->subdev[x].start = device->subdev[x - 1].start + device->subdev[x - 1].length;
-	device->subdev[x].length = device->subdev[0].length;
-
-	free(old);
-}
-
-/**
- * fix_device_geometry - round off address and lengths and convert to FS blocks
- * @comline: the command line
- * @device: the description of the underlying device
- *
- */
-
-void fix_device_geometry(commandline_t *comline, mkfs_device_t *device)
-{
-	unsigned int x;
-	uint64 offset, len;
-	uint32 bbsize = comline->bsize >> 9;
-	
-	if (comline->debug) {
-		printf("\nDevice Geometry:  (in basic blocks)\n");
-		for (x = 0; x < device->nsubdev; x++)
-			printf("  SubDevice #%d:  %s:  start = %"PRIu64", len = %"PRIu64"\n",
-				   x,
-				   (device->subdev[x].is_journal) ? "journal" : "data",
-				   device->subdev[x].start,
-				   device->subdev[x].length);
-	}
-
-	/*  Make sure all the subdevices are aligned  */
-
-	for (x = 0; x < device->nsubdev; x++) {
-		offset = device->subdev[x].start;
-		len = device->subdev[x].length;
-
-		if (len < 100 * bbsize)
-			die("subdevice %d is way too small (%"PRIu64" bytes)\n", x, len * GFS_BASIC_BLOCK); 
-
-		if (offset % bbsize) {
-			len -= bbsize - (offset % bbsize);
-			offset += bbsize - (offset % bbsize);
-		}
-
-		device->subdev[x].start = offset / bbsize;
-		device->subdev[x].length = len / bbsize;
-	}
-
-	if (comline->debug) {
-		printf("\nDevice Geometry:  (in FS blocks)\n");
-		for (x = 0; x < device->nsubdev; x++)
-			printf("  SubDevice #%d:  %s:  start = %"PRIu64", len = %"PRIu64"\n",
-				   x,
-				   (device->subdev[x].is_journal) ? "journal" : "data",
-				   device->subdev[x].start,
-				   device->subdev[x].length);
-
-		printf("\njournals = %u\n", comline->journals);
-	}
-}
diff --git a/gfs/gfs_mkfs/fs_geometry.c b/gfs/gfs_mkfs/fs_geometry.c
deleted file mode 100644
index dc9857a..0000000
--- a/gfs/gfs_mkfs/fs_geometry.c
+++ /dev/null
@@ -1,180 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <assert.h>
-#include <time.h>
-
-#include "global.h"
-#include "gfs_ondisk.h"
-#include "osi_list.h"
-
-#include "mkfs_gfs.h"
-
-/**
- * how_many_rgrps - figure out how many RG to put in a subdevice
- * @comline: the command line
- * @sdev: the subdevice
- *
- * Returns: the number of RGs
- */
-
-static uint64 how_many_rgrps(commandline_t *comline, mkfs_subdevice_t *sdev)
-{
-	uint64 nrgrp;
-	unsigned int min = (comline->expert) ? 1 : 4;
-
-	while (TRUE) {
-		nrgrp = DIV_RU(sdev->length, (comline->rgsize << 20) / comline->bsize);
-
-		if (nrgrp < min)
-			nrgrp = min;
-
-		if (comline->rgsize_specified || /* If user specified an rg size or */
-			nrgrp <= MKFS_EXCESSIVE_RGS || /* not an excessive # of rgs or  */
-			comline->rgsize >= 2048)     /* we've reached the max rg size */
-			break;
-
-		comline->rgsize += MKFS_DEFAULT_RGSIZE; /* Try again w/bigger rgs */
-	}
-
-	if (comline->debug)
-		printf("  rg sz = %"PRIu32"\n  nrgrp = %"PRIu64"\n", comline->rgsize,
-			   nrgrp);
-
-	return nrgrp;
-}
-
-/**
- * compute_rgrp_layout - figure out where the RG in a FS are
- * @comline: the command line
- * @device: the device layout
- * @rlist: the list of resource groups
- *
- * Returns: a list of rgrp_list_t structures
- */
-
-void compute_rgrp_layout(commandline_t *comline, mkfs_device_t *device, osi_list_t *rlist)
-{
-	mkfs_subdevice_t *sdev;
-	rgrp_list_t *rl, *rlast = NULL;
-	osi_list_t *tmp;
-	uint64 rgrp, nrgrp;
-	unsigned int x;
-	int first_sdev = TRUE;
-
-	for (x = 0; x < device->nsubdev; x++) {
-		sdev = &device->subdev[x];
-
-		if (!sdev->is_journal) {
-			/* If this is the 1st subdevice reserve space for the superblock */
-
-			if (first_sdev)
-				sdev->length -= comline->sb_addr + 1;
-
-			if (comline->debug)
-				printf("\nData Subdevice %u\n", x);
-
-			nrgrp = how_many_rgrps(comline, sdev);
-
-			for (rgrp = 0; rgrp < nrgrp; rgrp++) {
-				type_zalloc(rl, rgrp_list_t, 1);
-
-				rl->subdevice = x;
-
-				if (rgrp) {
-					rl->rg_offset = rlast->rg_offset + rlast->rg_length;
-					rl->rg_length = sdev->length / nrgrp;
-				}
-				else {
-					rl->rg_offset = sdev->start;
-					rl->rg_length = sdev->length - (nrgrp - 1) * (sdev->length / nrgrp);
-
-					if (first_sdev)
-						rl->rg_offset += comline->sb_addr + 1;
-				}
-
-				osi_list_add_prev(&rl->list, rlist);
-
-				rlast = rl;
-			}
-
-			first_sdev = FALSE;
-
-			comline->rgrps += nrgrp;
-		}
-	}
-
-	if (comline->debug) {
-		printf("\n");
-
-		for (tmp = rlist->next; tmp != rlist; tmp = tmp->next) {
-			rl = osi_list_entry(tmp, rgrp_list_t, list);
-			printf("subdevice %u:  rg_o = %"PRIu64", rg_l = %"PRIu64" blocks (%"PRIu64"MB)\n",
-				   rl->subdevice, rl->rg_offset, rl->rg_length, 
-				   rl->rg_length * comline->bsize / (1024 * 1024));
-		}
-	}
-}
-
-/**
- * compute_journal_layout - figure out where the journals in a FS are
- * @comline: the command line
- * @device: the device layout
- * @jlist: the list of journals
- *
- * Returns: a list of journal_list_t structures
- */
-
-void compute_journal_layout(commandline_t *comline, mkfs_device_t *device, osi_list_t *jlist)
-{
-	mkfs_subdevice_t *sdev;
-	journal_list_t *jl;
-	osi_list_t *tmp;
-	unsigned int x, j = 0;
-	uint64 boffset, bcount;
-	unsigned int min_jsize = (comline->expert) ? 1 : 32;
-
-	for (x = 0; x < device->nsubdev; x++) {
-		sdev = &device->subdev[x];
-
-		if (sdev->is_journal) {
-			type_zalloc(jl, journal_list_t, 1);
-
-			/*  Align the journals on seg_size boundries  */
-
-			boffset = sdev->start;
-			bcount = sdev->length;
-
-			if ((bcount + comline->seg_size) * comline->bsize < min_jsize << 20)
-				die("journal %d is too small (minimum size is %u MB)\n", j, min_jsize);
-
-			if (boffset % comline->seg_size) {
-				bcount -= comline->seg_size - (boffset % comline->seg_size);
-				boffset += comline->seg_size - (boffset % comline->seg_size);
-			}
-
-			jl->start = boffset;
-			jl->segments = bcount / comline->seg_size;
-			
-			osi_list_add_prev(&jl->list, jlist);
-
-			j++;
-		}
-	}
-
-	if (comline->debug) {
-		printf("\n");
-		
-		for (tmp = jlist->next, j = 0; tmp != jlist; tmp = tmp->next, j++) {
-			jl = osi_list_entry(tmp, journal_list_t, list);
-			printf("journal %u:  start = %"PRIu64", segments = %u\n",
-				   j, jl->start, jl->segments);
-		}
-	}
-}
diff --git a/gfs/gfs_mkfs/locking.c b/gfs/gfs_mkfs/locking.c
deleted file mode 100644
index 4f66836..0000000
--- a/gfs/gfs_mkfs/locking.c
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "global.h"
-#include "gfs_ondisk.h"
-#include "osi_list.h"
-
-#include "mkfs_gfs.h"
-
-
-
-
-
-/**
- * test_locking - Make sure the GFS is set up to use the right lock protocol
- * @lockproto: the lock protocol to mount
- * @locktable: the locktable name
- * @estr: returns the a string describing the error
- * @elen: the length of @estr
- *
- * Returns: 0 if things are ok, -1 on error (with estr set)
- */
-
-int test_locking(char *lockproto, char *locktable, char *estr, unsigned int elen)
-{
-  char *c;
-
-  if (strcmp(lockproto, "lock_nolock") == 0)
-  {
-    /*  Nolock is always ok.  */
-  }
-  else if (strcmp(lockproto, "lock_gulm") == 0 ||
-           strcmp(lockproto, "lock_dlm") == 0)
-  {
-    for (c = locktable; *c; c++)
-    {
-      if (isspace(*c))
-      {
-	snprintf(estr, elen, "locktable error: contains space characters");
-	return -1;
-      }
-      if (!isprint(*c))
-      {
-	snprintf(estr, elen, "locktable error: contains unprintable characters");
-	return -1;
-      }
-    }
-
-    c = strstr(locktable, ":");
-    if (!c)
-    {
-      snprintf(estr, elen, "locktable error: missing colon in the locktable");
-      return -1;
-    }
-
-    if (c == locktable)
-    {
-      snprintf(estr, elen, "locktable error: missing cluster name");
-      return -1;
-    }
-
-    if (c - locktable > 16)
-    {
-      snprintf(estr, elen, "locktable error: cluster name too long");
-      return -1;
-    }
-
-    c++;
-    if (!c)
-    {
-      snprintf(estr, elen, "locktable error: missing filesystem name");
-      return -1;
-    }
-
-    if (strstr(c, ":"))
-    {
-      snprintf(estr, elen, "locktable error: more than one colon present");
-      return -1;
-    }
-
-    if (!strlen(c))
-    {
-      snprintf(estr, elen, "locktable error: missing filesystem name");
-      return -1;
-    }
-
-    if (strlen(c) > 16)
-    {
-      snprintf(estr, elen, "locktable error: filesystem name too long");
-      return -1;
-    }
-  }
-  else
-  {
-    snprintf(estr, elen, "lockproto error: %s unknown", lockproto);
-    return -1;
-  }
-
-  return 0;
-}
diff --git a/gfs/gfs_mkfs/main.c b/gfs/gfs_mkfs/main.c
deleted file mode 100644
index 4c8a8e0..0000000
--- a/gfs/gfs_mkfs/main.c
+++ /dev/null
@@ -1,504 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <assert.h>
-#include <time.h>
-#include <mntent.h>
-#include <poll.h>
-#include <signal.h>
-
-#include "global.h"
-#include "gfs_ondisk.h"
-#include "osi_list.h"
-#include "libgfs.h"
-#include "copyright.cf"
-
-#define EXTERN
-#include "mkfs_gfs.h"
-
-
-
-#define OPTION_STRING               ("b:DhJ:j:Op:qr:s:t:VX")
-
-
-
-
-
-/**
- * print_usage - print out usage information
- *
- */
-
-static void print_usage(void)
-{
-  printf("Usage:\n");
-  printf("\n");
-  printf("%s [options] <device>\n", prog_name);
-  printf("\n");
-  printf("Options:\n");
-  printf("\n");
-  printf("  -b <bytes>       Filesystem block size\n");
-  printf("  -D               Enable debugging code\n");
-  printf("  -h               Print this help, then exit\n");
-  printf("  -J <MB>          Size of journals\n");
-  printf("  -j <num>         Number of journals\n");
-  printf("  -O               Don't ask for confirmation\n");
-  printf("  -p <name>        Name of the locking protocol\n");
-  printf("  -q               Don't print anything\n");
-  printf("  -r <MB>          Resource Group Size\n");
-  printf("  -s <blocks>      Journal segment size\n");
-  printf("  -t <name>        Name of the lock table\n");
-  printf("  -V               Print program version information, then exit\n");
-}
-
-
-/**
- * decode_arguments - decode command line arguments and fill in the commandline_t
- * @argc:
- * @argv:
- * @comline: the decoded command line arguments
- *
- */
-
-static void decode_arguments(int argc, char *argv[], commandline_t *comline)
-{
-  int cont = TRUE;
-  int optchar;
-
-  while (cont)
-  {
-    optchar = getopt(argc, argv, OPTION_STRING);
-
-    switch (optchar)
-    {
-    case 'b':
-      comline->bsize = atoi(optarg);
-      break;
-
-
-    case 'D':
-      comline->debug = TRUE;
-      break;
-
-
-    case 'h':
-      print_usage();
-      exit(EXIT_SUCCESS);
-      break;
-
-
-    case 'J':
-      comline->jsize = atoi(optarg);
-      break;
-
-
-    case 'j':
-      comline->journals = atoi(optarg);
-      break;
-
-
-    case 'O':
-      comline->override = TRUE;
-      break;
-
-
-    case 'p':
-      if (strlen(optarg) >= GFS_LOCKNAME_LEN)
-	die("lock protocol name %s is too long\n", optarg);
-      strcpy(comline->lockproto, optarg);
-      break;
-
-
-    case 'q':
-      comline->quiet = TRUE;
-      break;
-
-
-    case 'r':
-      comline->rgsize_specified = TRUE;
-      comline->rgsize = atoi(optarg);
-      break;
-
-
-    case 's':
-      comline->seg_size = atoi(optarg);
-      break;
-
-
-    case 't':
-      if (strlen(optarg) >= GFS_LOCKNAME_LEN)
-	die("lock table name %s is too long\n", optarg);
-      strcpy(comline->locktable, optarg);
-      break;
-
-
-    case 'V':
-      printf("gfs_mkfs %s (built %s %s)\n", RELEASE_VERSION, __DATE__, __TIME__);
-      printf("%s\n", REDHAT_COPYRIGHT);
-      exit(EXIT_SUCCESS);
-      break;
-
-
-    case 'X':
-      comline->expert = TRUE;
-      break;
-
-
-    case ':':
-    case '?':
-      fprintf(stderr, "Please use '-h' for usage.\n");
-      exit(EXIT_FAILURE);      
-      break;
-
-
-    case EOF:
-      cont = FALSE;
-      break;
-
-
-    default:
-      die("unknown option: %c\n", optchar);
-      break;
-    };
-  }
-
-
-  if (optind < argc)
-  {
-    comline->device = argv[optind];
-    optind++;
-  }
-  else
-    die("no device specified (try -h for help)\n");
-
-
-
-  if (optind < argc) 
-    die("Unrecognized option: %s\n", argv[optind]);
-
-
-  if (comline->debug)
-  {
-    printf("Command Line Arguments:\n");
-    printf("  proto = %s\n", comline->lockproto);
-    printf("  table = %s\n", comline->locktable);
-    printf("  bsize = %u\n", comline->bsize);
-    printf("  seg_size = %u\n", comline->seg_size);
-    printf("  journals = %u\n", comline->journals);
-    printf("  jsize = %u\n", comline->jsize);
-    printf("  rgsize = %u\n", comline->rgsize);
-    printf("  debug = %d\n", comline->debug);
-    printf("  device = %s\n", comline->device);
-  }
-}
-
-static int get_file_output(int fd, char *buffer, size_t buflen)
-{
-	struct pollfd pf = { .fd = fd, .events = POLLIN|POLLRDHUP };
-	int flags;
-	int pos = 0;
-	int rv;
-
-	flags = fcntl(fd, F_GETFL, 0);
-	if (flags < 0)
-		return flags;
-
-	flags |= O_NONBLOCK;
-	rv = fcntl(fd, F_SETFL, flags);
-	if (rv < 0)
-		return rv;
-
-	while (1) {
-		rv = poll(&pf, 1, 10 * 1000);
-		if (rv == 0)
-			break;
-		if (rv < 0)
-			return rv;
-		if (pf.revents & POLLIN) {
-			rv = read(fd, buffer + pos,
-				   buflen - pos);
-			if (rv < 0) {
-				if (errno == EAGAIN)
-					continue;
-				return rv;
-			}
-			if (rv == 0)
-				break;
-			pos += rv;
-			if (pos >= buflen)
-				return -1;
-			buffer[pos] = 0;
-			continue;
-		}
-		if (pf.revents & (POLLRDHUP | POLLHUP | POLLERR))
-			break;
-	}
-	return 0;
-}
-
-static void check_dev_content(const char *devname)
-{
-	struct sigaction sa;
-	char content[1024] = { 0, };
-	char * const args[] = {
-		(char *)"/usr/bin/file",
-		(char *)"-bs",
-		(char *)devname,
-		NULL };
-	int p[2];
-	int ret;
-	int pid;
-
-	ret = sigaction(SIGCHLD, NULL, &sa);
-	if  (ret)
-		return;
-	sa.sa_handler = SIG_IGN;
-	sa.sa_flags |= (SA_NOCLDSTOP | SA_NOCLDWAIT);
-	ret = sigaction(SIGCHLD, &sa, NULL);
-	if (ret)
-		goto fail;
-
-	ret = pipe(p);
-	if (ret)
-		goto fail;
-
-	pid = fork();
-
-	if (pid < 0) {
-		close(p[1]);
-		goto fail;
-	}
-
-	if (pid) {
-		close(p[1]);
-		ret = get_file_output(p[0], content, sizeof(content));
-		if (ret) {
-fail:
-			printf("Content of file or device unknown (do you have GNU fileutils installed?)\n");
-		} else {
-			if (*content == 0)
-				goto fail;
-			printf("It appears to contain: %s", content);
-		}
-		close(p[0]);
-		return;
-	}
-
-	close(p[0]);
-	dup2(p[1], STDOUT_FILENO);
-	close(STDIN_FILENO);
-	exit(execv(args[0], args));
-}
-
-/**
- * are_you_sure - protect lusers from themselves
- * @comline: the command line
- *
- */
-
-static void are_you_sure(commandline_t *comline)
-{
-	char input[32];
-	int fd;
-
-	fd = open(comline->device, O_RDONLY | O_CLOEXEC);
-	if (fd < 0)
-		die("Error: device %s not found.\n", comline->device);
-	printf("This will destroy any data on %s.\n",
-	       comline->device);
-	check_dev_content(comline->device);
-	close(fd);
-	printf("\nAre you sure you want to proceed? [y/n] ");
-	if (fgets(input, 32, stdin) == NULL || input[0] != 'y')
-		die("aborted\n");
-	else
-		printf("\n");
-}
-
-
-/**
- * check_mount - check to see if device is mounted/busy
- * @
- *
- */
-
-static void check_mount(char *device)
-{
-	struct stat st_buf;
-	int fd;
-
-	if (stat(device, &st_buf) < 0)
-		die("could not stat device %s\n", device);
-	if (!S_ISBLK(st_buf.st_mode))
-		die("%s is not a block device\n", device);
-
-	fd = open(device, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
-
-	if (fd < 0) {
-		if (errno == EBUSY) {
-			die("device %s is busy\n", device);
-		}
-	}
-	else {
-		close(fd);
-	}
-
-	return;
-}
-
-
-/**
- * print_results - print out summary information
- * @comline: the command line
- *
- */
-
-static void print_results(commandline_t *comline)
-{
-  if (comline->quiet)
-    return;
-
-  if (comline->expert)
-    printf("Expert mode:               on\n");
-
-  printf("Device:                    %s\n", comline->device);
-
-  printf("Blocksize:                 %u\n", comline->bsize);
-  printf("Filesystem Size:           %"PRIu64"\n", comline->fssize);
-
-  printf("Journals:                  %u\n", comline->journals);
-  printf("Resource Groups:           %"PRIu64"\n", comline->rgrps);
-
-  printf("Locking Protocol:          %s\n", comline->lockproto);
-  printf("Lock Table:                %s\n", comline->locktable);
-
-  printf("\nSyncing...\n");
-
-  sync();
-
-  printf("All Done\n");
-}
-
-
-/**
- * main - do everything
- * @argc:
- * @argv:
- *
- * Returns: 0 on success, non-0 on failure
- */
-
-int main(int argc, char *argv[])
-{
-	commandline_t comline;
-	mkfs_device_t device;
-	osi_list_t rlist;
-	osi_list_t jlist;
-	unsigned int x;
-
-	prog_name = argv[0];
-
-	osi_list_init(&rlist);
-	osi_list_init(&jlist);
-
-	/*  Process the command line arguments  */
-
-	memset(&comline, 0, sizeof(commandline_t));
-	comline.bsize = MKFS_DEFAULT_BSIZE;
-	comline.seg_size = MKFS_DEFAULT_SEG_SIZE;
-	comline.jsize = MKFS_DEFAULT_JSIZE;
-	comline.rgsize = MKFS_DEFAULT_RGSIZE;
-	comline.rgsize_specified = FALSE;
-	strcpy(comline.lockproto, MKFS_DEFAULT_LOCKPROTO);
-
-	decode_arguments(argc, argv, &comline);
-
-	check_mount(comline.device);
-
-	if (!comline.expert) {
-		char buf[256];
-		if (test_locking(comline.lockproto, comline.locktable, buf, 256))
-			die("%s\n", buf);
-	}
-
-	/*  Block sizes must be a power of two from 512 to 65536  */
-
-	for (x = 512; x; x <<= 1)
-		if (x == comline.bsize)
-			break;
-
-	if (!x || comline.bsize > 65536)
-		die("block size must be a power of two between 512 and 65536\n");
-
-	comline.sb_addr = GFS_SB_ADDR * GFS_BASIC_BLOCK / comline.bsize;
-
-	if (comline.seg_size < 2)
-		die("segment size too small\n");
-
-	if (!comline.expert && (uint64)comline.seg_size * comline.bsize > 4194304)
-		die("segment size too large\n");
-
-	if (comline.expert) {
-		if (1 > comline.rgsize || comline.rgsize > 2048)
-			die("bad resource group size\n");
-	}
-	else {
-		if (32 > comline.rgsize || comline.rgsize > 2048)
-			die("bad resource group size\n");
-	}
-
-	/*  Get the device geometry  */
-
-	memset(&device, 0, sizeof(mkfs_device_t));
-
-	device_geometry(&comline, &device);
-	add_journals_to_device(&comline, &device);
-
-	fix_device_geometry(&comline, &device);
-
-	/*  Compute the resource group layouts  */
-
-	compute_rgrp_layout(&comline, &device, &rlist);
-
-	compute_journal_layout(&comline, &device, &jlist);
-
-	/*  Start writing stuff out  */
-
-	comline.fd = open(comline.device, O_RDWR | O_CLOEXEC);
-	if (comline.fd < 0)
-		die("can't open device %s\n", comline.device);
-
-	if (!comline.override)
-		are_you_sure(&comline);
-
-	write_mkfs_sb(&comline, &rlist);
-
-	/*  Figure out where we start allocating in rgrp 0  */
-	comline.rgrp0_next = comline.sbd->sd_sb.sb_root_di.no_addr + 1;
-
-	write_jindex(&comline, &jlist);
-
-	write_rindex(&comline, &rlist);
-
-	write_root(&comline);
-
-	write_quota(&comline);
-
-	write_license(&comline);
-
-	write_rgrps(&comline, &rlist);
-
-	write_journals(&comline, &jlist);
-
-	close(comline.fd);
-	free(comline.sbd);
-	print_results(&comline);
-
-	exit(EXIT_SUCCESS);
-}
diff --git a/gfs/gfs_mkfs/mkfs_gfs.h b/gfs/gfs_mkfs/mkfs_gfs.h
deleted file mode 100644
index cb00342..0000000
--- a/gfs/gfs_mkfs/mkfs_gfs.h
+++ /dev/null
@@ -1,181 +0,0 @@
-#ifndef __MKFS_GFS_DOT_H__
-#define __MKFS_GFS_DOT_H__
-
-
-/*  Extern Macro  */
-
-#ifndef EXTERN
-#define EXTERN extern
-#define INIT(X)
-#else
-#undef EXTERN
-#define EXTERN
-#define INIT(X) =X 
-#endif
-
-
-#define die(fmt, args...) \
-do \
-{ \
-  fprintf(stderr, "%s: ", prog_name); \
-  fprintf(stderr, fmt, ##args); \
-  exit(EXIT_FAILURE); \
-} \
-while (0)
-
-#define MKFS_ASSERT(x, todo) \
-do \
-{ \
-  if (!(x)) \
-  { \
-    {todo} \
-    die("assertion failed on line %d of file %s\n", __LINE__, __FILE__); \
-  } \
-} \
-while (0)
-
-#define type_zalloc(ptr, type, count) \
-do \
-{ \
-  (ptr) = (type *)malloc(sizeof(type) * (count)); \
-  if ((ptr)) \
-    memset((char *)(ptr), 0, sizeof(type) * (count)); \
-  else \
-    die("unable to allocate memory on line %d of file %s\n", \
-	__LINE__, __FILE__); \
-} \
-while (0)
-
-#define type_alloc(ptr, type, count) \
-do \
-{ \
-  (ptr) = (type *)malloc(sizeof(type) * (count)); \
-  if (!(ptr)) \
-    die("unable to allocate memory on line %d of file %s\n", \
-	__LINE__, __FILE__); \
-} \
-while (0)
-
-#define DIV_RU(x, y) (((x) + (y) - 1) / (y))
-
-
-
-
-
-struct mkfs_subdevice
-{
-  uint64 start;
-  uint64 length;
-  int is_journal;
-};
-typedef struct mkfs_subdevice mkfs_subdevice_t;
-
-
-struct mkfs_device
-{
-  unsigned int nsubdev;
-  mkfs_subdevice_t *subdev; 
-};
-typedef struct mkfs_device mkfs_device_t;
-
-
-struct commandline
-{
-  char lockproto[GFS_LOCKNAME_LEN];
-  char locktable[GFS_LOCKNAME_LEN];
-
-  uint32 bsize;             /*  The block size of the FS  */
-  uint32 seg_size;          /*  The journal segment size  */
-  uint32 journals;          /*  Number of journals  */
-  uint32 jsize;             /*  Size of journals  */
-  uint32 rgsize;            /*  The Resource Group size  */
-  int rgsize_specified;     /*  Did the user specify a rg size? */
-
-  int debug;                /*  Print out debugging information?  */
-  int quiet;                /*  No messages  */
-  int expert;
-  int override;
-
-  char *device;             /*  device  */
-
-
-  /*  Not specified on the command line, but...  */
-
-  uint64 rgrps;             /*  Number of rgrps  */
-  int fd;                   /*  fd of the device  */
-  struct gfs_sbd *sbd;      /*  A copy of the superblock */
-  uint64 fssize;            /*  size of the filesystem  */
-
-  uint64 sb_addr;
-
-  uint64 rgrp0_next;        /*  The address of the next available block in rgrp 0  */
-};
-typedef struct commandline commandline_t;
-
-
-struct rgrp_list
-{
-  osi_list_t list;
-
-  uint32 subdevice;         /*  The subdevice who holds this resource group  */
-
-  uint64 rg_offset;         /*  The offset of the beginning of this resource group  */
-  uint64 rg_length;         /*  The length of this resource group  */
-
-  struct gfs_rindex *ri;
-};
-typedef struct rgrp_list rgrp_list_t;
-
-
-struct journal_list
-{
-  osi_list_t list;
-
-  uint64 start;
-  uint32 segments;
-};
-typedef struct journal_list journal_list_t;
-
-
-EXTERN char *prog_name;
-
-
-#define MKFS_DEFAULT_BSIZE          (4096)
-#define MKFS_DEFAULT_SEG_SIZE       (16)
-#define MKFS_DEFAULT_JSIZE          (128)
-#define MKFS_DEFAULT_RGSIZE         (256)
-#define MKFS_DEFAULT_LOCKPROTO      "lock_dlm"
-#define MKFS_EXCESSIVE_RGS          (10000)
-
-/*  device_geometry.c  */
-
-void device_geometry(commandline_t *comline, mkfs_device_t *device);
-void add_journals_to_device(commandline_t *comline, mkfs_device_t *device);
-void fix_device_geometry(commandline_t *comline, mkfs_device_t *device);
-
-
-/*  fs_geometry.c  */
-
-void compute_rgrp_layout(commandline_t *comline, mkfs_device_t *device, osi_list_t *rlist);
-void compute_journal_layout(commandline_t *comline, mkfs_device_t *device, osi_list_t *jlist);
-
-
-/*  locking.c  */
-
-int test_locking(char *lockproto, char *locktable, char *estr, unsigned int elen);
-
-
-/*  structures.c  */
-
-void write_mkfs_sb(commandline_t *comline, osi_list_t *rlist);
-void write_jindex(commandline_t *comline, osi_list_t *jlist);
-void write_rindex(commandline_t *comline, osi_list_t *rlist);
-void write_root(commandline_t *comline);
-void write_quota(commandline_t *comline);
-void write_license(commandline_t *comline);
-void write_rgrps(commandline_t *comline, osi_list_t *rlist);
-void write_journals(commandline_t *comline, osi_list_t *jlist);
-
-
-#endif  /*  __MKFS_GFS_DOT_H__  */
-
diff --git a/gfs/gfs_mkfs/ondisk.c b/gfs/gfs_mkfs/ondisk.c
deleted file mode 100644
index f0955a5..0000000
--- a/gfs/gfs_mkfs/ondisk.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-
-#include "global.h"
-#include "linux_endian.h"
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#define ENTER(x)
-#define EXIT(x)
-#define RET(x) return
-#define RETURN(x, y) return y
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
-
diff --git a/gfs/gfs_mkfs/structures.c b/gfs/gfs_mkfs/structures.c
deleted file mode 100644
index 2376f27..0000000
--- a/gfs/gfs_mkfs/structures.c
+++ /dev/null
@@ -1,845 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <assert.h>
-#include <time.h>
-
-#include "global.h"
-#include "gfs_ondisk.h"
-#include "osi_list.h"
-#include "linux_endian.h"
-#include "libgfs.h"
-#include "mkfs_gfs.h"
-
-
-#define MKFS_ROOT_MODE              (0755)
-#define MKFS_HIDDEN_MODE            (0600)
-
-/**
- * rgblocks2bitblocks - blerg
- * @bsize: the FS block size
- * @rgblocks: The total number of the blocks in the RG
- *            Also, returns the number of allocateable blocks
- * @bitblocks: Returns the number of bitmap blocks
- *
- * Give a number of blocks in a RG, figure out the number of blocks
- * needed for bitmaps.
- *
- */
-
-static void
-rgblocks2bitblocks(unsigned int bsize,
-		   uint32_t *rgblocks,
-		   uint32_t *bitblocks)
-{
-	unsigned int bitbytes_provided, last = 0;
-	unsigned int bitbytes_needed;
-
-	*bitblocks = 1;
-	bitbytes_provided = bsize - sizeof(struct gfs_rgrp);
-
-	for (;;) {
-	        bitbytes_needed = (*rgblocks - *bitblocks) / GFS_NBBY;
-
-		if (bitbytes_provided >= bitbytes_needed) {
-			if (last >= bitbytes_needed)
-				(*bitblocks)--;
-			break;
-		}
-
-		last = bitbytes_provided;
-		(*bitblocks)++;
-		bitbytes_provided += bsize - sizeof(struct gfs_meta_header);
-	}
-
-	*rgblocks = bitbytes_needed * GFS_NBBY;
-}
-
-
-/**
- * write_mkfs_sb - write the superblock
- * @comline: the command line
- * @rlist: the list of RGs
- *
- */
-
-void write_mkfs_sb(commandline_t *comline, osi_list_t *rlist)
-{
-	struct gfs_sbd *sbd;
-	uint64 jindex_dinode;
-	char buf[comline->bsize];
-	int x;
-
-	memset(buf, 0, comline->bsize);
-
-	for (x = 0; x < comline->sb_addr; x++) {
-		do_lseek(comline->fd, x * comline->bsize);
-		do_write(comline->fd, buf, comline->bsize);
-	}
-
-	/*  Figure out the location of the journal index inode  */
-	{
-		rgrp_list_t *rl = osi_list_entry(rlist->next, rgrp_list_t, list);
-		uint32_t rgblocks, bitblocks;
-		
-		rgblocks = rl->rg_length;
-		rgblocks2bitblocks(comline->bsize, &rgblocks, &bitblocks);
-		
-		jindex_dinode = rl->rg_offset + bitblocks;
-	}
-
-	/*  Now, fill in the superblock  */
-
-	type_zalloc(sbd, struct gfs_sbd, 1);
-	comline->sbd = sbd;
-
-	sbd->sd_sb.sb_header.mh_magic = GFS_MAGIC;
-	sbd->sd_sb.sb_header.mh_type = GFS_METATYPE_SB;
-	sbd->sd_sb.sb_header.mh_format = GFS_FORMAT_SB;
-
-	sbd->sd_sb.sb_fs_format = GFS_FORMAT_FS;
-	sbd->sd_sb.sb_multihost_format = GFS_FORMAT_MULTI;
-
-	sbd->sd_sb.sb_bsize = comline->bsize;
-	sbd->sd_sb.sb_bsize_shift = ffs(comline->bsize) - 1;
-	sbd->sd_sb.sb_seg_size = comline->seg_size;
-	
-	compute_constants(sbd);
-
-	sbd->sd_sb.sb_jindex_di.no_formal_ino = jindex_dinode;
-	sbd->sd_sb.sb_jindex_di.no_addr = jindex_dinode;
-	sbd->sd_sb.sb_rindex_di.no_formal_ino = jindex_dinode + 1;
-	sbd->sd_sb.sb_rindex_di.no_addr = jindex_dinode + 1;
-	sbd->sd_sb.sb_root_di.no_formal_ino = jindex_dinode + 4;
-	sbd->sd_sb.sb_root_di.no_addr = jindex_dinode + 4;
-
-	strcpy(sbd->sd_sb.sb_lockproto, comline->lockproto);
-	strcpy(sbd->sd_sb.sb_locktable, comline->locktable);
-
-	sbd->sd_sb.sb_quota_di.no_formal_ino = jindex_dinode + 2;
-	sbd->sd_sb.sb_quota_di.no_addr = jindex_dinode + 2;
-	sbd->sd_sb.sb_license_di.no_formal_ino = jindex_dinode + 3;
-	sbd->sd_sb.sb_license_di.no_addr = jindex_dinode + 3;
-	sbd->sd_fsb2bb_shift = sbd->sd_sb.sb_bsize_shift - GFS_BASIC_BLOCK_SHIFT;
-
-	write_sb(comline->fd, sbd);
-	if (comline->debug) {
-		printf("\nSuperblock:\n");
-		gfs_sb_print(&sbd->sd_sb);
-	}
-}
-
-/**
- * build_tree - build the pointers and indirect blocks for a file
- * @comline: the command line
- * @di: the dinode
- * @addr: the start of the file
- * @blocks: the number of blocks in the file
- *
- */
-
-static void build_tree(commandline_t *comline, struct gfs_dinode *di, uint64 addr, unsigned int blocks)
-{
-	struct gfs_indirect ind;
-	char *buf;
-	unsigned int x, offset;
-	unsigned int height;
-	unsigned int indblocks;
-	uint64 tmp_addr;
-	unsigned int tmp_blocks;
-  
-	di->di_height = compute_height(comline->sbd, di->di_size);
-
-	if (di->di_height == 1) {
-		type_zalloc(buf, char, comline->bsize);
-
-		for (x = 0; x < blocks; x++)
-			((uint64 *)(buf + sizeof(struct gfs_dinode)))[x] = cpu_to_gfs64(addr + x);
-
-		gfs_dinode_out(di, buf);
-
-		do_lseek(comline->fd, di->di_num.no_addr * comline->bsize);
-		do_write(comline->fd, buf, comline->bsize);
-
-		free(buf);
-	}
-	else {
-		tmp_addr = addr;
-		tmp_blocks = blocks;
-
-		for (height = di->di_height; height > 1; height--) {
-			memset(&ind, 0, sizeof(struct gfs_indirect));
-			ind.in_header.mh_magic = GFS_MAGIC;
-			ind.in_header.mh_type = GFS_METATYPE_IN;
-			ind.in_header.mh_format = GFS_FORMAT_IN;
-
-			indblocks = DIV_RU((tmp_blocks * sizeof(uint64)),
-							   (comline->bsize - sizeof(struct gfs_indirect)));
-
-			type_zalloc(buf, char, indblocks * comline->bsize);
-
-			offset = 0;
-			for (x = 0; x < tmp_blocks; x++) {
-				if (!(offset % comline->bsize)) {
-					gfs_indirect_out(&ind, buf + offset);
-					offset += sizeof(struct gfs_indirect);
-				}
-				
-				*((uint64 *)(buf + offset)) = cpu_to_gfs64(tmp_addr + x);
-				offset += sizeof(uint64);
-			}
-
-			do_lseek(comline->fd, comline->rgrp0_next * comline->bsize);
-			do_write(comline->fd, buf, indblocks * comline->bsize);
-
-			free(buf);
-
-			tmp_addr = comline->rgrp0_next;
-			tmp_blocks = indblocks;
-
-			di->di_blocks += indblocks;
-			
-			comline->rgrp0_next += indblocks;
-		}
-		type_zalloc(buf, char, comline->bsize);
-
-		for (x = 0; x < tmp_blocks; x++)
-			((uint64 *)(buf + sizeof(struct gfs_dinode)))[x] = cpu_to_gfs64(tmp_addr + x);
-
-		gfs_dinode_out(di, buf);
-
-		do_lseek(comline->fd, di->di_num.no_addr * comline->bsize);
-		do_write(comline->fd, buf, comline->bsize);    
-
-		free(buf);
-	}
-}
-
-
-/**
- * fill_jindex - create the journal index data
- * @comline: the command line
- * @jlist: the list of journals
- *
- * Returns: a pointer data for the jindex
- */
-
-static char *fill_jindex(commandline_t *comline, osi_list_t *jlist)
-{
-	journal_list_t *jl;
-	struct gfs_jindex ji;
-	osi_list_t *tmp;
-	char *buf;
-	unsigned int j = 0;
-	
-	type_alloc(buf, char, comline->journals * sizeof(struct gfs_jindex));
-
-	for (tmp = jlist->next; tmp != jlist; tmp = tmp->next) {
-		jl = osi_list_entry(tmp, journal_list_t, list);
-
-		memset(&ji, 0, sizeof(struct gfs_jindex));
-
-		ji.ji_addr = jl->start;
-		ji.ji_nsegment = jl->segments;
-
-		gfs_jindex_out(&ji, buf + j * sizeof(struct gfs_jindex));
-
-		j++;
-	}
-
-	if (comline->debug) {
-		printf("\nJournal Index data:\n");
-
-		for (j = 0; j < comline->journals; j++) {
-			gfs_jindex_in(&ji, buf + j * sizeof(struct gfs_jindex));
-			
-			printf("\n  Journal %d\n", j);
-			gfs_jindex_print(&ji);
-		}
-	}
-
-	return buf;
-}
-
-/**
- * write_jindex - write out the journal index
- * @comline: the command line
- * @jlist: the list of journals
- *
- */
-
-void write_jindex(commandline_t *comline, osi_list_t *jlist)
-{
-	struct gfs_dinode di;
-	struct gfs_meta_header jd;
-	char *buf, *data;
-	uint64 addr;
-	unsigned int blocks;
-	unsigned int x, left, jbsize = comline->bsize - sizeof(struct gfs_meta_header);
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
- 
-	di.di_header.mh_magic = GFS_MAGIC;
-	di.di_header.mh_type = GFS_METATYPE_DI;
-	di.di_header.mh_format = GFS_FORMAT_DI;
-
-	di.di_num = comline->sbd->sd_sb.sb_jindex_di;
-
-	di.di_mode = MKFS_HIDDEN_MODE;
-	di.di_nlink = 1;
-	di.di_size = comline->journals * sizeof(struct gfs_jindex);
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = time(NULL);
-
-	di.di_flags = GFS_DIF_JDATA;
-	di.di_payload_format = GFS_FORMAT_JI;
-	di.di_type = GFS_FILE_REG;
-
-	data = fill_jindex(comline, jlist);
-
-	if (di.di_size < comline->bsize - sizeof(struct gfs_dinode)) {
-		type_zalloc(buf, char, comline->bsize);
-
-		gfs_dinode_out(&di, buf);
-
-		memcpy(buf + sizeof(struct gfs_dinode), data, comline->journals * sizeof(struct gfs_jindex));
-
-		do_lseek(comline->fd, di.di_num.no_addr * comline->bsize);
-		do_write(comline->fd, buf, comline->bsize);
-
-		free(buf);
-	}
-	else {
-		blocks = DIV_RU(di.di_size, (comline->bsize - sizeof(struct gfs_meta_header)));
-		di.di_blocks += blocks;
-
-		addr = comline->rgrp0_next;
-		memset(&jd, 0, sizeof(struct gfs_meta_header));
-		jd.mh_magic = GFS_MAGIC;
-		jd.mh_type = GFS_METATYPE_JD;
-		jd.mh_format = GFS_FORMAT_JD;
-
-		type_zalloc(buf, char, blocks * comline->bsize);
-
-		left = comline->journals * sizeof(struct gfs_jindex);
-		for (x = 0; x < blocks; x++) {
-			gfs_meta_header_out(&jd, buf + x * comline->bsize);
-			memcpy(buf + x * comline->bsize + sizeof(struct gfs_meta_header),
-				   data + x * jbsize,
-				   (left > jbsize) ? jbsize : left);
-			left -= jbsize;
-		}
-
-		do_lseek(comline->fd, addr * comline->bsize);
-		do_write(comline->fd, buf, blocks * comline->bsize);
-
-		free(buf);
-
-		comline->rgrp0_next += blocks;
-
-		build_tree(comline, &di, addr, blocks);
-	}
-
-	free(data);
-
-	if (comline->debug) {
-		printf("\nJournal index dinode:\n");
-		gfs_dinode_print(&di);
-	}
-}
-
-
-/**
- * fill_rindex - create the resource group index data
- * @comline: the command line
- * @rlist: the list of RGs
- *
- * Returns: a pointer data for the rindex
- */
-
-static char *fill_rindex(commandline_t *comline, osi_list_t *rlist)
-{
-	struct gfs_rindex *ri, grindex;
-	rgrp_list_t *rl;
-	osi_list_t *tmp;
-	char *buf;
-	unsigned int r = 0;
-	uint32 rgblocks, bitblocks;
-
-	type_alloc(buf, char, comline->rgrps * sizeof(struct gfs_rindex));
-
-	for (tmp = rlist->next; tmp != rlist; tmp = tmp->next) {
-		rl = osi_list_entry(tmp, rgrp_list_t, list);
-	
-		rgblocks = rl->rg_length;
-		rgblocks2bitblocks(comline->bsize, &rgblocks, &bitblocks);
-
-		type_zalloc(ri, struct gfs_rindex, 1);
-		rl->ri = ri;
-		
-		ri->ri_addr = rl->rg_offset;
-		ri->ri_length = bitblocks;
-
-		ri->ri_data1 = rl->rg_offset + bitblocks;
-		ri->ri_data = rgblocks;
-
-		ri->ri_bitbytes = rgblocks / GFS_NBBY;
-
-		gfs_rindex_out(ri, buf + r * sizeof(struct gfs_rindex));
-		
-		comline->fssize += rgblocks;
-
-		r++;
-	}
-
-	if (comline->debug) {
-		printf("\nResource Index data:\n");
-
-		for (r = 0; r < comline->rgrps; r++) {
-			gfs_rindex_in(&grindex, buf + r * sizeof(struct gfs_rindex));
-
-			printf("\n  Resource index %d\n", r);
-			gfs_rindex_print(&grindex);
-		}
-	}
-	return buf;
-}
-
-/**
- * write_rindex - write out the resource group index
- * @comline: the command line
- * @jlist: the list of RGs
- *
- */
-
-void write_rindex(commandline_t *comline, osi_list_t *rlist)
-{
-	struct gfs_dinode di;
-	struct gfs_meta_header jd;
-	char *buf, *data;
-	uint64 addr;
-	unsigned int blocks;
-	unsigned int x, left, jbsize = comline->bsize - sizeof(struct gfs_meta_header);
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-
-	di.di_header.mh_magic = GFS_MAGIC;
-	di.di_header.mh_type = GFS_METATYPE_DI;
-	di.di_header.mh_format = GFS_FORMAT_DI;
-
-	di.di_num = comline->sbd->sd_sb.sb_rindex_di;
-
-	di.di_mode = MKFS_HIDDEN_MODE;
-	di.di_nlink = 1;
-	di.di_size = comline->rgrps * sizeof(struct gfs_rindex);
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = time(NULL);
-
-	di.di_flags = GFS_DIF_JDATA;
-	di.di_payload_format = GFS_FORMAT_RI;
-	di.di_type = GFS_FILE_REG;
-
-	data = fill_rindex(comline, rlist);
-
-	if (di.di_size < comline->bsize - sizeof(struct gfs_dinode)) {
-		type_zalloc(buf, char, comline->bsize);
-
-		gfs_dinode_out(&di, buf);
-    
-		memcpy(buf + sizeof(struct gfs_dinode), data, comline->rgrps * sizeof(struct gfs_rindex));
-
-		do_lseek(comline->fd, di.di_num.no_addr * comline->bsize);
-		do_write(comline->fd, buf, comline->bsize);
-
-		free(buf);
-	}
-	else {
-		blocks = DIV_RU(di.di_size, (comline->bsize - sizeof(struct gfs_meta_header)));
-		di.di_blocks += blocks;
-
-		addr = comline->rgrp0_next;
-
-		memset(&jd, 0, sizeof(struct gfs_meta_header));
-		jd.mh_magic = GFS_MAGIC;
-		jd.mh_type = GFS_METATYPE_JD;
-		jd.mh_format = GFS_FORMAT_JD;
-
-		type_zalloc(buf, char, blocks * comline->bsize);
-
-		left = comline->rgrps * sizeof(struct gfs_rindex);
-		for (x = 0; x < blocks; x++) {
-			gfs_meta_header_out(&jd, buf + x * comline->bsize);
-			memcpy(buf + x * comline->bsize + sizeof(struct gfs_meta_header),
-				   data + x * jbsize,
-				   (left > jbsize) ? jbsize : left);
-			left -= jbsize;
-		}
-
-		do_lseek(comline->fd, addr * comline->bsize);
-		do_write(comline->fd, buf, blocks * comline->bsize);
-
-		free(buf);
-
-		comline->rgrp0_next += blocks;
-
-		build_tree(comline, &di, addr, blocks);
-	}
-
-	free(data);
-
-	if (comline->debug) {
-		printf("\nResource index dinode:\n");
-		gfs_dinode_print(&di);
-	}
-}
-
-
-/**
- * write_root - write out the root dinode
- * @comline: the command line
- *
- */
-
-void write_root(commandline_t *comline)
-{
-	struct gfs_dinode di;
-	struct gfs_dirent de;
-	char buf[comline->bsize];
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-	memset(buf, 0, comline->bsize);
-
-	di.di_header.mh_magic = GFS_MAGIC;
-	di.di_header.mh_type = GFS_METATYPE_DI;
-	di.di_header.mh_format = GFS_FORMAT_DI;
-
-	di.di_num = comline->sbd->sd_sb.sb_root_di;
-
-	di.di_mode = MKFS_ROOT_MODE;
-	di.di_nlink = 2;
-	di.di_size = comline->bsize - sizeof(struct gfs_dinode);
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = time(NULL);
-
-	di.di_flags = GFS_DIF_JDATA;
-	di.di_payload_format = GFS_FORMAT_DE;
-	di.di_type = GFS_FILE_DIR;
-
-	di.di_entries = 2;
-
-	gfs_dinode_out(&di, buf);
-
-	/*  Fill in .  */
-
-	memset(&de, 0, sizeof(struct gfs_dirent));
-
-	de.de_inum = comline->sbd->sd_sb.sb_root_di;
-	de.de_hash = gfs_dir_hash(".", 1);
-	de.de_rec_len = GFS_DIRENT_SIZE(1);
-	de.de_name_len = 1;
-	de.de_type = GFS_FILE_DIR;
-
-	gfs_dirent_out(&de, buf + sizeof(struct gfs_dinode));
-	memcpy(buf + sizeof(struct gfs_dinode) + sizeof(struct gfs_dirent), ".", 1);
-
-	if (comline->debug) {
-		printf("\nRoot Dinode dirent:\n");
-		gfs_dirent_print(&de, ".");
-	}
-
-	/*  Fill in ..  */
-
-	memset(&de, 0, sizeof(struct gfs_dirent));
-
-	de.de_inum = comline->sbd->sd_sb.sb_root_di;
-	de.de_hash = gfs_dir_hash("..", 2);
-	de.de_rec_len = comline->bsize - GFS_DIRENT_SIZE(1) - sizeof(struct gfs_dinode);
-	de.de_name_len = 2;
-	de.de_type = GFS_FILE_DIR;
-
-	gfs_dirent_out(&de, buf + sizeof(struct gfs_dinode) + GFS_DIRENT_SIZE(1));
-	memcpy(buf + sizeof(struct gfs_dinode) + GFS_DIRENT_SIZE(1) + sizeof(struct gfs_dirent), "..", 2);
-
-	if (comline->debug) {
-		printf("\nRoot Dinode dirent:\n");
-		gfs_dirent_print(&de, "..");
-	}
-
-	do_lseek(comline->fd, di.di_num.no_addr * comline->bsize);
-	do_write(comline->fd, buf, comline->bsize);
-
-	if (comline->debug) {
-		printf("\nRoot dinode:\n");
-		gfs_dinode_print(&di);
-	}
-}
-
-/**
- * write_quota - write out the quota dinode
- * @comline: the command line
- *
- */
-
-void write_quota(commandline_t *comline)
-{
-	struct gfs_dinode di;
-	struct gfs_quota qu;
-
-	char buf[comline->bsize];
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-	memset(buf, 0, comline->bsize);
-
-	di.di_header.mh_magic = GFS_MAGIC;
-	di.di_header.mh_type = GFS_METATYPE_DI;
-	di.di_header.mh_format = GFS_FORMAT_DI;
-
-	di.di_num = comline->sbd->sd_sb.sb_quota_di;
-
-	di.di_mode = MKFS_HIDDEN_MODE;
-	di.di_nlink = 1;
-	di.di_size = 2 * sizeof(struct gfs_quota);
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = time(NULL);
-
-	di.di_flags = GFS_DIF_JDATA;
-	di.di_payload_format = GFS_FORMAT_QU;
-	di.di_type = GFS_FILE_REG;
-
-	gfs_dinode_out(&di, buf);
-
-	/*  Fill in the root user quota  */
-
-	memset(&qu, 0, sizeof(struct gfs_quota));
-	qu.qu_value = comline->rgrp0_next - comline->sbd->sd_sb.sb_jindex_di.no_addr;
-
-	gfs_quota_out(&qu, buf + sizeof(struct gfs_dinode));
-
-	if (comline->debug) {
-		printf("\nRoot user quota:\n");
-		gfs_quota_print(&qu);
-	}
-
-	/*  Fill in the root group quota  */
-
-	memset(&qu, 0, sizeof(struct gfs_quota));
-	qu.qu_value = comline->rgrp0_next - comline->sbd->sd_sb.sb_jindex_di.no_addr;
-
-	gfs_quota_out(&qu, buf + sizeof(struct gfs_dinode) + sizeof(struct gfs_quota));
-
-	if (comline->debug) {
-		printf("\nRoot group quota:\n");
-		gfs_quota_print(&qu);
-	}
-
-	do_lseek(comline->fd, di.di_num.no_addr * comline->bsize);
-	do_write(comline->fd, buf, comline->bsize);
-
-	if (comline->debug) {
-		printf("\nQuota dinode:\n");
-		gfs_dinode_print(&di);
-	}
-}
-
-/**
- * write_license - write out the quota dinode
- * @comline: the command line
- *
- */
-
-void write_license(commandline_t *comline)
-{
-	struct gfs_dinode di;
-
-	char buf[comline->bsize];
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-	memset(buf, 0, comline->bsize);
-
-	di.di_header.mh_magic = GFS_MAGIC;
-	di.di_header.mh_type = GFS_METATYPE_DI;
-	di.di_header.mh_format = GFS_FORMAT_DI;
-
-	di.di_num = comline->sbd->sd_sb.sb_license_di;
-
-	di.di_mode = MKFS_HIDDEN_MODE;
-	di.di_nlink = 1;
-	di.di_size = 0;
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = time(NULL);
-
-	di.di_flags = GFS_DIF_JDATA;
-	di.di_payload_format = GFS_FORMAT_QU;
-	di.di_type = GFS_FILE_REG;
-
-	gfs_dinode_out(&di, buf);
-
-	do_lseek(comline->fd, di.di_num.no_addr * comline->bsize);
-	do_write(comline->fd, buf, comline->bsize);
-
-
-	if (comline->debug) {
-		printf("\nLicense dinode:\n");
-		gfs_dinode_print(&di);
-	}
-}
-
-/**
- * write_rgrps - write out the resource group headers
- * @comline: the command line
- * @rlist: the RG list
- *
- */
-
-void write_rgrps(commandline_t *comline, osi_list_t *rlist)
-{
-	struct gfs_rgrp rg;
-	struct gfs_meta_header rb;
-	rgrp_list_t *rl;
-	osi_list_t *tmp;
-	char *buf, *data;
-	unsigned int x, offset;
-	unsigned int byte, bit;
-	unsigned int blk_count;
-	unsigned int r = 0;
-
-	memset(&rb, 0, sizeof(struct gfs_meta_header));
-	rb.mh_magic = GFS_MAGIC;
-	rb.mh_type = GFS_METATYPE_RB;
-	rb.mh_format = GFS_FORMAT_RB;
-
-	for (tmp = rlist->next; tmp != rlist; tmp = tmp->next) {
-		rl = osi_list_entry(tmp, rgrp_list_t, list);
-		
-		memset(&rg, 0, sizeof(struct gfs_rgrp));
-		rg.rg_header.mh_magic = GFS_MAGIC;
-		rg.rg_header.mh_type = GFS_METATYPE_RG;
-		rg.rg_header.mh_format = GFS_FORMAT_RG;
-		rg.rg_free = rl->ri->ri_data;
-
-		type_zalloc(data, char, rl->ri->ri_bitbytes);
-		type_zalloc(buf, char, rl->ri->ri_length * comline->bsize);
-
-		/*  Deal with the special case of the first dinode  */
-
-		if (!r) {
-			if (comline->rgrp0_next > rl->ri->ri_data1 + rl->ri->ri_data)
-				die("RG 0 is full.\n");
-			
-			/*  Compensate for the hidden dinodes  */
-
-			*data = (GFS_BLKST_USEDMETA << 3 * GFS_BIT_SIZE) |
-				(GFS_BLKST_USEDMETA << 2 * GFS_BIT_SIZE) |
-				(GFS_BLKST_USEDMETA << GFS_BIT_SIZE) |
-				GFS_BLKST_USEDMETA;
-			*(data + 1) = GFS_BLKST_USEDMETA;
-			rg.rg_free -= 5;
-			rg.rg_useddi = 5;
-
-			/*  Compensate for the data the hidden dinodes point to  */
-
-			for (x = rl->ri->ri_data1 + 5; x < comline->rgrp0_next; x++) {
-				byte = (x - rl->ri->ri_data1) / GFS_NBBY;
-				bit = (x - rl->ri->ri_data1) % GFS_NBBY;
-				
-				data[byte] |= GFS_BLKST_USEDMETA << (bit * GFS_BIT_SIZE);
-				
-				rg.rg_free--;
-				rg.rg_usedmeta++;
-			}
-		}
-
-		gfs_rgrp_out(&rg, buf);
-		offset = sizeof(struct gfs_rgrp);
-		blk_count = 1;
-
-		for (x = 0; x < rl->ri->ri_bitbytes; x++) {
-			if (!(offset % comline->bsize)) {
-				gfs_meta_header_out(&rb, buf + offset);
-				offset += sizeof(struct gfs_meta_header);
-				blk_count++;
-			}
-
-			buf[offset] = data[x];
-			offset++;
-		}
-
-		if (blk_count != rl->ri->ri_length)
-			die("RG underflow (rg = %u, blk_count = %u, rl->ri->ri_length = %u)\n",
-				r, blk_count, rl->ri->ri_length);
-		
-		do_lseek(comline->fd, rl->ri->ri_addr * comline->bsize);
-		do_write(comline->fd, buf, rl->ri->ri_length * comline->bsize);
-
-		free(buf);
-		free(data);
-
-		if (comline->debug) {
-			printf("\nResource group header %d\n", r);
-			gfs_rgrp_print(&rg);
-		}
-
-		r++;
-	}
-}
-
-/**
- * write_journals - write out the journal log headers
- * @comline: the command line
- * @rlist: the RG list
- *
- */
-
-void write_journals(commandline_t *comline, osi_list_t *jlist)
-{
-	struct gfs_log_header lh;
-	journal_list_t *jl;
-	osi_list_t *tmp;
-	char buf[comline->bsize];
-	uint32 seg, sequence;
-	int x = 0;
-
-	srandom(time(NULL));
-
-	for (tmp = jlist->next; tmp != jlist; tmp = tmp->next) {
-		jl = osi_list_entry(tmp, journal_list_t, list);
-
-		if (comline->debug)
-			printf("Starting journal %d\n", x++);
-
-		sequence = jl->segments / (RAND_MAX + 1.0) * random();
-
-		for (seg = 0; seg < jl->segments; seg++) {
-			memset(buf, 0, comline->bsize);
-			memset(&lh, 0, sizeof(struct gfs_log_header));
-
-			lh.lh_header.mh_magic = GFS_MAGIC;
-			lh.lh_header.mh_type = GFS_METATYPE_LH;
-			lh.lh_header.mh_format = GFS_FORMAT_LH;
-			lh.lh_flags = GFS_LOG_HEAD_UNMOUNT;
-			lh.lh_first = jl->start + seg * comline->seg_size;
-			lh.lh_sequence = sequence;
-			/*  Don't care about tail  */
-			/*  Don't care about log dump  */
-
-			gfs_log_header_out(&lh, buf);
-			gfs_log_header_out(&lh, buf + GFS_BASIC_BLOCK - sizeof(struct gfs_log_header));
-
-			do_lseek(comline->fd, lh.lh_first * comline->bsize);
-			do_write(comline->fd, buf, comline->bsize);
-
-			if (++sequence == jl->segments)
-				sequence = 0;
-
-			if (!(seg % 100))
-				if (comline->debug)
-					printf("seg #%u\n", seg);
-		}
-	}
-}
diff --git a/gfs/gfs_quota/Makefile b/gfs/gfs_quota/Makefile
deleted file mode 100644
index 3a4e114..0000000
--- a/gfs/gfs_quota/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-TARGET= gfs_quota
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	check.o \
-	main.o \
-	names.o \
-	ondisk.o \
-	layout.o
-
-CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${gfskincdir}
-CFLAGS += -I$(S)/../include
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_quota/check.c b/gfs/gfs_quota/check.c
deleted file mode 100644
index a8fca14..0000000
--- a/gfs/gfs_quota/check.c
+++ /dev/null
@@ -1,651 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <time.h>
-#include <dirent.h>
-#include <limits.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-#include "gfs_ondisk.h"
-#define __user
-#include "gfs_ioctl.h"
-#include "osi_list.h"
-
-#include "gfs_quota.h"
-
-struct values {
-	osi_list_t v_list;
-
-	uint32_t v_id;
-	int64_t v_blocks;
-};
-typedef struct values values_t;
-
-struct hardlinks {
-	osi_list_t hl_list;
-
-	ino_t hl_ino;
-};
-typedef struct hardlinks hardlinks_t;
-
-/**
- * add_value - add a ID / Allocated Blocks pair to the list
- * @list: the list
- * @id: the ID number
- * @blocks: the number of blocks to add
- *
- */
-
-static void
-add_value(osi_list_t *list, uint32_t id, int64_t blocks)
-{
-	osi_list_t *tmp;
-	values_t *v;
-
-	for (tmp = list->next; tmp != list; tmp = tmp->next) {
-		v = osi_list_entry(tmp, values_t, v_list);
-		if (v->v_id != id)
-			continue;
-
-		v->v_blocks += blocks;
-
-		osi_list_del(&v->v_list);
-		osi_list_add(&v->v_list, list);
-
-		return;
-	}
-
-	type_zalloc(v, values_t, 1);
-
-	v->v_id = id;
-	v->v_blocks = blocks;
-
-	osi_list_add(&v->v_list, list);
-}
-
-/**
- * test_and_add_hard_link - Add a inode that has hard links to the list
- * @list: the list of inodes with hard links
- * @ino: the number of the inode to add
- *
- * Returns: Returns TRUE if the inode was already on the list, FALSE if it wasn't
- */
-
-static int
-test_and_add_hard_link(osi_list_t *list, ino_t ino)
-{
-	osi_list_t *tmp;
-	hardlinks_t *hl;
-
-	for (tmp = list->next; tmp != list; tmp = tmp->next) {
-		hl = osi_list_entry(tmp, hardlinks_t, hl_list);
-		if (hl->hl_ino != ino)
-			continue;
-
-		return TRUE;
-	}
-
-	type_zalloc(hl, hardlinks_t, 1);
-
-	hl->hl_ino = ino;
-
-	osi_list_add(&hl->hl_list, list);
-
-	return FALSE;
-}
-
-/**
- * scan_fs - recursively scan a filesystem and figure out what IDs have what
- * @device: the device the filesystem is on
- * @dirname: the name of the directory to read
- * @uid: returned list of UIDs for this FS
- * @gid: returned list of GIDs for this FS
- * @hl: returned list of hard links for this FS
- *
- */
-
-static void
-scan_fs(dev_t device, char *dirname,
-	osi_list_t *uid, osi_list_t *gid, osi_list_t *hl)
-{
-	DIR *dir;
-	struct dirent *de;
-	struct stat st;
-	char *name;
-	int error;
-
-	dir = opendir(dirname);
-	if (!dir)
-		die("can't open directory %s: %s\n", dirname, strerror(errno));
-
-	while ((de = readdir(dir))) {
-		if (strcmp(de->d_name, "..") == 0)
-			continue;
-
-		type_alloc(name, char,
-			   strlen(dirname) + strlen(de->d_name) + 2);
-		if (dirname[strlen(dirname) - 1] == '/')
-			sprintf(name, "%s%s", dirname, de->d_name);
-		else
-			sprintf(name, "%s/%s", dirname, de->d_name);
-
-		error = lstat(name, &st);
-		if (error)
-			die("can't stat file %s: %s\n", name, strerror(errno));
-
-		if (st.st_dev != device)
-			die("umount %s and try again\n", name);
-
-		if (S_ISDIR(st.st_mode)) {
-			if (strcmp(de->d_name, ".") == 0) {
-				add_value(uid, st.st_uid, st.st_blocks);
-				add_value(gid, st.st_gid, st.st_blocks);
-			} else
-				scan_fs(device, name, uid, gid, hl);
-		} else if (st.st_nlink == 1 ||
-			   !test_and_add_hard_link(hl, st.st_ino)) {
-			add_value(uid, st.st_uid, st.st_blocks);
-			add_value(gid, st.st_gid, st.st_blocks);
-		}
-
-		free(name);
-	}
-
-	closedir(dir);
-}
-
-/**
- * read_quota_file - read the quota file and return list of its contents
- * @comline: the command line arguments
- * @uid: returned list of UIDs for the filesystem
- * @gid: returned list of GIDs for the filesystem
- *
- */
-
-static void
-read_quota_file(commandline_t *comline, osi_list_t *uid, osi_list_t *gid)
-{
-	int fd;
-	struct gfs_sb sb;
-	uint64_t hidden_blocks;
-	struct gfs_ioctl gi;
-	char buf[sizeof(struct gfs_quota)];
-	struct gfs_quota q;
-	uint64_t offset = 0;
-	uint32_t id;
-	int error;
-
-	fd = open(comline->filesystem, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", comline->filesystem,
-		    strerror(errno));
-
-	check_for_gfs(fd, comline->filesystem);
-
-	do_get_super(fd, &sb);
-
-	hidden_blocks = compute_hidden_blocks(comline, fd);
-
-	do {
-		char *argv[] = {
-			(char *)"do_hfile_read",
-			(char *)"quota"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;
-		gi.gi_data = buf;
-		gi.gi_size = sizeof(struct gfs_quota);
-		gi.gi_offset = offset;
-
-		memset(buf, 0, sizeof(struct gfs_quota));
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error < 0)
-			die("can't read quota file (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_quota_in(&q, buf);
-
-		id = (offset / sizeof(struct gfs_quota)) >> 1;
-		if (!id)
-			q.qu_value -= hidden_blocks;
-		q.qu_value <<= sb.sb_bsize_shift - 9;
-
-		if (q.qu_value) {
-			if (id * sizeof(struct gfs_quota) * 2 == offset)
-				add_value(uid, id, q.qu_value);
-			else
-				add_value(gid, id, q.qu_value);
-		}
-
-		offset += sizeof(struct gfs_quota);
-	} while (error == sizeof(struct gfs_quota));
-
-	close(fd);
-}
-
-/**
- * print_list - print the contents of an ID list
- * @str: a string describing the list
- * @list: the list
- *
- */
-
-static void
-print_list(const char *str, osi_list_t *list)
-{
-#if 0
-	osi_list_t *tmp;
-	values_t *v;
-
-	for (tmp = list->next; tmp != list; tmp = tmp->next) {
-		v = osi_list_entry(tmp, values_t, v_list);
-		printf("%s %10u: %"PRId64"\n", str, v->v_id, v->v_blocks);
-	}
-#endif
-}
-
-/**
- * do_compare - compare to ID lists and see if they match
- * @type: the type of list (UID or GID)
- * @fs_list: the list derived from scaning the FS
- * @qf_list: the list derived from reading the quota file
- *
- * Returns: TRUE if there was a mismatch
- */
-
-static int
-do_compare(const char *type, osi_list_t *fs_list, osi_list_t *qf_list)
-{
-	osi_list_t *tmp1, *tmp2;
-	values_t *v1, *v2;
-	int found;
-	int mismatch = FALSE;
-
-	for (tmp1 = fs_list->next; tmp1 != fs_list; tmp1 = tmp1->next) {
-		v1 = osi_list_entry(tmp1, values_t, v_list);
-
-		found = FALSE;
-
-		for (tmp2 = qf_list->next; tmp2 != qf_list; tmp2 = tmp2->next) {
-			v2 = osi_list_entry(tmp2, values_t, v_list);
-			if (v1->v_id != v2->v_id)
-				continue;
-
-			if (v1->v_blocks != v2->v_blocks) {
-				printf("mismatch: %s %u: scan = %"PRId64", quotafile = %"PRId64"\n",
-				       type, v1->v_id,
-				       v1->v_blocks, v2->v_blocks);
-				mismatch = TRUE;
-			}
-
-			osi_list_del(&v2->v_list);
-			free(v2);
-
-			found = TRUE;
-			break;
-		}
-
-		if (!found) {
-			printf("mismatch: %s %u: scan = %"PRId64", quotafile = %"PRId64"\n",
-			       type, v1->v_id,
-			       v1->v_blocks, (int64_t)0);
-			mismatch = TRUE;
-		}
-	}
-
-	for (tmp2 = qf_list->next; tmp2 != qf_list; tmp2 = tmp2->next) {
-		v2 = osi_list_entry(tmp2, values_t, v_list);
-
-		printf("mismatch: %s %u: scan = %"PRId64", quotafile = %"PRId64"\n",
-		       type, v2->v_id,
-		       (int64_t)0, v2->v_blocks);
-		mismatch = TRUE;
-	}
-
-	return mismatch;
-}
-
-/**
- * verify_pathname - make sure the path on the command line is a mount point
- * @comline: the command line arguments
- *
- * Returns: the device the filesystem is on
- */
-
-static dev_t
-verify_pathname(commandline_t *comline)
-{
-	struct stat st1, st2;
-	dev_t device;
-	char *name;
-	int error;
-
-	if (!*comline->filesystem)
-		die("need a filesystem to work on\n");
-
-	error = lstat(comline->filesystem, &st1);
-	if (error)
-		die("can't stat %s: %s\n", comline->filesystem,
-		    strerror(errno));
-
-	if (!S_ISDIR(st1.st_mode))
-		die("%s must be a directory\n", comline->filesystem);
-
-	device = st1.st_dev;
-
-	for (;;) {
-		type_alloc(name, char, strlen(comline->filesystem) + 4);
-		sprintf(name, "%s/..", comline->filesystem);
-
-		error = lstat(name, &st2);
-		if (error)
-			die("can't stat %s: %s\n", name, strerror(errno));
-
-		if (st2.st_dev != device || st2.st_ino == st1.st_ino) {
-			free(name);
-			break;
-		}
-
-		if (!realpath(name, comline->filesystem))
-			die("error resolving filesystem pathname: %s\n",
-			    strerror(errno));
-
-		free(name);
-
-		st1 = st2;
-	}
-
-	return device;
-}
-
-/**
- * do_check - Check what's in the quota file
- * @comline: the struct containing the parsed command line arguments
- *
- */
-
-void
-do_check(commandline_t *comline)
-{
-	dev_t device;
-	osi_list_t fs_uid, fs_gid, qf_uid, qf_gid;
-	osi_list_t hl;
-	int mismatch;
-
-	osi_list_init(&fs_uid);
-	osi_list_init(&fs_gid);
-	osi_list_init(&qf_uid);
-	osi_list_init(&qf_gid);
-	osi_list_init(&hl);
-
-	device = verify_pathname(comline);
-
-	scan_fs(device, comline->filesystem, &fs_uid, &fs_gid, &hl);
-	read_quota_file(comline, &qf_uid, &qf_gid);
-
-	print_list("fs user ", &fs_uid);
-	print_list("fs group", &fs_gid);
-	print_list("qf user ", &qf_uid);
-	print_list("qf group", &qf_gid);
-
-	mismatch = do_compare("user", &fs_uid, &qf_uid);
-	mismatch |= do_compare("group", &fs_gid, &qf_gid);
-
-	if (mismatch)
-		exit(EXIT_FAILURE);
-}
-
-/**
- * set_list - write a list of IDs into the quota file
- * @comline: the command line arguments
- * @user: TRUE if this is a list of UIDs, FALSE if it is a list of GIDs
- * @list: the list of IDs and block counts
- * @multiplier: multiply block counts by this
- *
- */
-
-static void
-set_list(commandline_t *comline, int user, osi_list_t *list, int64_t multiplier)
-{
-	int fd;
-	struct gfs_sb sb;
-	osi_list_t *tmp;
-	values_t *v;
-	uint64_t offset;
-	int64_t value;
-	struct gfs_ioctl gi;
-	char buf[256];
-	int error;
-
-	fd = open(comline->filesystem, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", comline->filesystem,
-		    strerror(errno));
-
-	check_for_gfs(fd, comline->filesystem);
-	do_get_super(fd, &sb);
-
-	for (tmp = list->next; tmp != list; tmp = tmp->next) {
-		v = osi_list_entry(tmp, values_t, v_list);
-
-		offset = (2 * (uint64_t)v->v_id + ((user) ? 0 : 1)) *
-			sizeof(struct gfs_quota);
-		offset += (unsigned long)(&((struct gfs_quota *)NULL)->qu_value);
-
-		value = v->v_blocks * multiplier;
-		value >>= sb.sb_bsize_shift - 9;
-		value = cpu_to_gfs64(value);
-
-		{
-			char *argv[] = {
-				(char *)"do_hfile_write",
-				(char *)"quota"
-			};
-
-			gi.gi_argc = 2;
-			gi.gi_argv = argv;
-			gi.gi_data = (char *)&value;
-			gi.gi_size = sizeof(int64_t);
-			gi.gi_offset = offset;
-
-			error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-			if (error != sizeof(int64_t))
-				die("can't write quota file (%d): %s\n",
-				    error, strerror(errno));
-		}
-
-		sprintf(buf, "%s:%u",
-			(user) ? "u" : "g",
-			v->v_id);
-
-		{
-			char *argv[] = {
-				(char *)"do_quota_refresh",
-				(char *)buf
-			};
-
-			gi.gi_argc = 2;
-			gi.gi_argv = argv;
-
-			error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-			if (error)
-				die("can't refresh the quota LVB 1: %s\n",
-				    strerror(errno));
-		}
-	}
-
-	close(fd);
-}
-
-/**
- * add_hidden - add in the hidden file block count into the root UID and GID
- * @comline: the command line arguments
- *
- */
-
-static void
-add_hidden(commandline_t *comline)
-{
-	int fd;
-	uint64_t hidden_blocks;
-	uint64_t offset = (unsigned long)(&((struct gfs_quota *)NULL)->qu_value);
-	struct gfs_ioctl gi;
-	int64_t value;
-	unsigned int pass = 0;
-	char buf[256];
-	int error;
-
-	fd = open(comline->filesystem, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", comline->filesystem,
-		    strerror(errno));
-
-	check_for_gfs(fd, comline->filesystem);
-
-	hidden_blocks = compute_hidden_blocks(comline, fd);
-
-	for (;;) {
-		{
-			char *argv[] = {
-				(char *)"do_hfile_read",
-				(char *)"quota"
-			};
-
-			gi.gi_argc = 2;
-			gi.gi_argv = argv;
-			gi.gi_data = (char *)&value;
-			gi.gi_size = sizeof(int64_t);
-			gi.gi_offset = offset;
-
-			error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-			if (error != sizeof(int64_t))
-				die("can't read quota file (%d): %s\n",
-				    error, strerror(errno));
-		}
-
-		value = gfs64_to_cpu(value);
-		value += hidden_blocks;
-		value = cpu_to_gfs64(value);
-
-		{
-			char *argv[] = {
-				(char *)"do_hfile_write",
-				(char *)"quota"
-			};
-
-			gi.gi_argc = 2;
-			gi.gi_argv = argv;
-			gi.gi_data = (char *)&value;
-			gi.gi_size = sizeof(int64_t);
-			gi.gi_offset = offset;
-
-			error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-			if (error != sizeof(int64_t))
-				die("can't write quota file (%d): %s\n",
-				    error, strerror(errno));
-		}
-
-		sprintf(buf, "%s:%u",
-			(pass) ? "g" : "u",
-			0);
-
-		{
-			char *argv[] = {
-				(char *)"do_quota_refresh",
-				(char *)buf
-			};
-
-			gi.gi_argc = 2;
-			gi.gi_argv = argv;
-
-			error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-			if (error)
-				die("can't refresh the quota LVB 2: %s\n",
-				    strerror(errno));
-		}
-
-		if (!pass) {
-			offset += sizeof(struct gfs_quota);
-			pass = 1;
-		} else
-			break;
-	}
-
-	close(fd);
-}
-
-/**
- * do_init - initialize the quota file
- * @comline: the command line arguments
- *
- */
-
-void
-do_init(commandline_t *comline)
-{
-	dev_t device;
-	osi_list_t fs_uid, fs_gid, qf_uid, qf_gid;
-	osi_list_t hl;
-	values_t *v;
-
-	osi_list_init(&fs_uid);
-	osi_list_init(&fs_gid);
-	osi_list_init(&qf_uid);
-	osi_list_init(&qf_gid);
-	osi_list_init(&hl);
-
-	device = verify_pathname(comline);
-
-	scan_fs(device, comline->filesystem, &fs_uid, &fs_gid, &hl);
-	read_quota_file(comline, &qf_uid, &qf_gid);
-
-	type_zalloc(v, values_t, 1);
-	v->v_id = 0;
-	v->v_blocks = 0;
-	osi_list_add(&v->v_list, &qf_uid);
-
-	type_zalloc(v, values_t, 1);
-	v->v_id = 0;
-	v->v_blocks = 0;
-	osi_list_add(&v->v_list, &qf_gid);
-
-	print_list("fs user ", &fs_uid);
-	print_list("fs group", &fs_gid);
-	print_list("qf user ", &qf_uid);
-	print_list("qf group", &qf_gid);
-
-	/* Yes, do the set_list() calls twice.  Gotta get around
-	   the fact that writing to the quota file causes
-	   quota changes  */
-
-	set_list(comline, TRUE, &qf_uid, 0);
-	set_list(comline, FALSE, &qf_gid, 0);
-	set_list(comline, TRUE, &fs_uid, 1);
-	set_list(comline, FALSE, &fs_gid, 1);
-
-	do_sync(comline);
-	do_sync(comline);
-
-	set_list(comline, TRUE, &qf_uid, 0);
-	set_list(comline, FALSE, &qf_gid, 0);
-	set_list(comline, TRUE, &fs_uid, 1);
-	set_list(comline, FALSE, &fs_gid, 1);
-
-	do_sync(comline);
-
-	add_hidden(comline);
-
-	do_sync(comline);
-
-	do_check(comline);
-}
diff --git a/gfs/gfs_quota/gfs_quota.h b/gfs/gfs_quota/gfs_quota.h
deleted file mode 100644
index ea224b1..0000000
--- a/gfs/gfs_quota/gfs_quota.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef __GFS_QUOTA_DOT_H__
-#define __GFS_QUOTA_DOT_H__
-
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#define die(fmt, args...) \
-do { \
-	fprintf(stderr, "%s: ", prog_name); \
-	fprintf(stderr, fmt, ##args); \
-	exit(EXIT_FAILURE); \
-} while (0)
-
-#define type_zalloc(ptr, type, count) \
-do { \
-	(ptr) = (type *)malloc(sizeof(type) * (count)); \
-	if ((ptr)) \
-		memset((char *)(ptr), 0, sizeof(type) * (count)); \
-	else \
-		die("unable to allocate memory on line %d of file %s\n", \
-		    __LINE__, __FILE__); \
-} while (0)
-
-#define type_alloc(ptr, type, count) \
-do { \
-	(ptr) = (type *)malloc(sizeof(type) * (count)); \
-	if (!(ptr)) \
-		die("unable to allocate memory on line %d of file %s\n", \
-		    __LINE__, __FILE__); \
-} while (0)
-
-#define GQ_OP_LIST           (12)
-#define GQ_OP_SYNC           (13)
-#define GQ_OP_GET            (14)
-#define GQ_OP_LIMIT          (15)
-#define GQ_OP_WARN           (16)
-#define GQ_OP_CHECK          (17)
-#define GQ_OP_INIT           (18)
-
-#define GQ_ID_USER           (23)
-#define GQ_ID_GROUP          (24)
-
-#define GQ_UNITS_MEGABYTE    (0)
-#define GQ_UNITS_KILOBYTE    (34)
-#define GQ_UNITS_FSBLOCK     (35)
-#define GQ_UNITS_BASICBLOCK  (36)
-
-struct commandline {
-	unsigned int operation;
-
-	uint64_t new_value;
-	int new_value_set;
-
-	unsigned int id_type;
-	uint32_t id;
-
-	unsigned int units;
-
-	int no_hidden_file_blocks;
-	int numbers;
-
-	char filesystem[PATH_MAX];
-};
-typedef struct commandline commandline_t;
-
-extern char *prog_name;
-
-/*  main.c  */
-
-void check_for_gfs(int fd, char *path);
-void do_get_super(int fd, struct gfs_sb *sb);
-void do_sync(commandline_t *comline);
-uint64_t compute_hidden_blocks(commandline_t *comline, int fd);
-void print_quota(commandline_t *comline,
-            int user, uint32_t id,
-            struct gfs_quota *q,
-            struct gfs_sb *sb);
-
-/*  check.c  */
-
-void do_check(commandline_t *comline);
-void do_init(commandline_t *comline);
-
-/*  names.c  */
-
-uint32_t name_to_id(int user, char *name, int numbers);
-char *id_to_name(int user, uint32_t id, int numbers);
-
-/* layout.c */
-
-void print_quota_file(commandline_t *comline);
-#endif /* __GFS_QUOTA_DOT_H__ */
diff --git a/gfs/gfs_quota/layout.c b/gfs/gfs_quota/layout.c
deleted file mode 100644
index f629bbb..0000000
--- a/gfs/gfs_quota/layout.c
+++ /dev/null
@@ -1,601 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#define __user
-#include "gfs_ioctl.h"
-#include "gfs_ondisk.h"
-
-#include "osi_list.h"
-#include "linux_endian.h"
-
-#include "gfs_quota.h"
-
-#define LAYOUT_DATA_QUANTUM (4194304)
-
-struct extent {
-        osi_list_t list;
-
-        uint64_t offset;
-        uint64_t start;
-        unsigned int len;
-};
-typedef struct extent extent_t;
-
-struct buffer {
-        osi_list_t list;
-        uint64_t blkno;
-        char *data;
-
-        int touched;
-};
-typedef struct buffer buffer_t;
-
-struct lblk_range {
-        osi_list_t list;
-        
-        uint64_t start;
-        unsigned int len;
-};
-typedef struct lblk_range lblk_range_t;
-
-struct world {
-        char *buf_data;
-        unsigned int buf_size;
-        int buf_count;
-        osi_list_t blist;
-        osi_list_t elist;
-
-        struct gfs_sb sb;
-        unsigned int diptrs;
-        unsigned int inptrs;
-        unsigned int jbsize;
-        unsigned int hash_bsize;
-        unsigned int hash_ptrs;
-
-        buffer_t *dibh;
-        struct gfs_dinode di;
-};
-typedef struct world world_t;
-
-typedef void (*pointer_call_t) (world_t *w,
-                                unsigned int height, uint64_t bn, void *data);
-
-static lblk_range_t *lblk_range_list;
-static unsigned int j_blk_size;
-
-/**
- * add_lblk_range - Add a range of logical block numbers to lblk_list
- * @lblk_list: the list to add to
- * @start: the starting block number of the range
- * @len: the length of the range
- *
- */
-
-static void 
-add_lblk_range(lblk_range_t *lblk_list, uint64_t start, unsigned int len)
-{
-        lblk_range_t *tmp;
-
-        tmp = malloc(sizeof(lblk_range_t));
-        if (!tmp)
-                die("out of memory\n");
-        
-        tmp->start = start;
-        tmp->len = len;
-        
-        osi_list_add_prev(&tmp->list, &lblk_list->list);
-}
-
-/**
- * build_list - build a list of buffer_t's to represent the data from the kernel
- * @w: the world structure
- *
- */
-
-static void
-build_list(world_t *w)
-{
-        buffer_t *b;
-        unsigned int x;
-
-        for (x = 0; x < w->buf_count; x += sizeof(uint64_t) + w->sb.sb_bsize) {
-                b = malloc(sizeof(buffer_t));
-                if (!b)
-                        die("out of memory\n");
-
-                memset(b, 0, sizeof(buffer_t));
-
-                b->blkno = *(uint64_t *) (w->buf_data + x);
-                b->data = w->buf_data + x + sizeof(uint64_t);
-
-                osi_list_add_prev(&b->list, &w->blist);
-        }
-
-        if (x != w->buf_count)
-                die("the kernel passed back unaligned data\n");
-}
-
-/**
- * check_list - check the buffers passed back by the kernel
- * @w: the world
- *
- */
-
-static void
-check_list(world_t *w)
-{
-        osi_list_t *tmp;
-        buffer_t *b;
-        struct gfs_meta_header mh;
-        const char *type;
-
-        for (tmp = w->blist.next; tmp != &w->blist; tmp = tmp->next) {
-                b = osi_list_entry(tmp, buffer_t, list);
-
-                gfs_meta_header_in(&mh, b->data);
-
-                if (mh.mh_magic != GFS_MAGIC)
-                        die("bad magic number on block\n");
-
-                switch (mh.mh_type) {
-                case GFS_METATYPE_DI:
-                        type = "GFS_METATYPE_DI";
-
-                        if (w->dibh)
-                                die("more than one dinode in file\n");
-                        else {
-                                w->dibh = b;
-                                gfs_dinode_in(&w->di, b->data);
-
-                                b->touched = TRUE;
-                        }
-                        break;
-                case GFS_METATYPE_IN:
-                        type = "GFS_METATYPE_IN";
-                        break;
-                case GFS_METATYPE_LF:
-                        type = "GFS_METATYPE_LF";
-                        break;
-                case GFS_METATYPE_JD:
-                        type = "GFS_METATYPE_JD";
-                        break;
-                case GFS_METATYPE_EA:
-                        type = "GFS_METATYPE_EA";
-                        break;
-                case GFS_METATYPE_ED:
-                        die("GFS_METATYPE_ED shouldn't be present\n");
-                default:
-                        die("strange meta type\n");
-                }
-        }
-
-        if (!w->dibh)
-                die("no dinode\n");
-}
-
-/**
- * getbuf - get the buffer_t for a given block number
- * @w: the world
- * @blkno: the block number
- *
- * Returns: the buffer_t
- */
-
-static buffer_t *
-getbuf(world_t *w, uint64_t blkno)
-{
-        osi_list_t *tmp;
-        buffer_t *b;
-
-        for (tmp = w->blist.next; tmp != &w->blist; tmp = tmp->next) {
-                b = osi_list_entry(tmp, buffer_t, list);
-                if (b->blkno == blkno) {
-                        osi_list_del(&b->list);
-                        osi_list_add(&b->list, &w->blist);
-
-                        b->touched = TRUE;
-
-                        return b;
-                }
-        }
-
-        die("buffer not found\n");
-}
-
-/**
- * recursive_scan - call a function for each block pointer in a file
- * @w: the world
- * @height: the height of the block being pointed to
- * @block: the block being pointed to
- * @pc: the function to call
- * @data: private data for the @pc function
- *
- */
-
-static void
-recursive_scan(world_t *w, unsigned int height, 
-               uint64_t block, pointer_call_t pc, void *data)
-{
-        buffer_t *b = NULL;
-        uint64_t *top, *bottom;
-        uint64_t bn;
-
-        if (!height) {
-                b = w->dibh;
-
-                top = (uint64_t *) (b->data + sizeof(struct gfs_dinode));
-                bottom =
-                    (uint64_t *) (b->data + sizeof(struct gfs_dinode)) +
-                    w->diptrs;
-        } else {
-                b = getbuf(w, block);
-
-                top = (uint64_t *) (b->data + sizeof(struct gfs_indirect));
-                bottom =
-                    (uint64_t *) (b->data + sizeof(struct gfs_indirect)) +
-                    w->inptrs;
-        }
-
-        for (; top < bottom; top++) {
-                bn = gfs64_to_cpu(*top);
-
-                pc(w, height, bn, data);
-
-                if (bn && height < w->di.di_height - 1)
-                        recursive_scan(w, height + 1, bn, pc, data);
-        }
-}
-
-/**
- * add_extent - add an extend to the list of the file's data extents
- * @w: the world
- * @offset: the starting logical block of the extent
- * @start: the starting disk block of the extent
- * @len: the number of blocks in the extent
- *
- */
-
-static void
-add_extent(world_t *w, uint64_t offset, uint64_t start, unsigned int len)
-{
-        extent_t *e;
-
-        e = malloc(sizeof(extent_t));
-        if (!e)
-                die("out of memory\n");
-
-        memset(e, 0, sizeof(extent_t));
-
-        e->offset = offset;
-        e->start = start;
-        e->len = len;
-
-        osi_list_add_prev(&e->list, &w->elist);
-}
-
-struct do_pf_s {
-        unsigned int height;
-        uint64_t offset;
-        uint64_t start;
-        uint64_t skip;
-        unsigned int len;
-};
-typedef struct do_pf_s do_pf_t;
-
-/**
- * do_pf: called for every pointer in the file (prints/collects extent info)
- * @w: the world
- * @height: the height of the block containing the pointer
- * @bn: the contents of the pointer
- * @data: a do_pf_t structure
- *
- */
-
-static void
-do_pf(world_t *w, unsigned int height, uint64_t bn, void *data)
-{
-        do_pf_t *pf = (do_pf_t *) data;
-        unsigned int x;
-        uint64_t skip;
-
-        if (pf->height < height + 1)
-                return;
-
-        if (!bn) {
-                if (pf->height == height + 1)
-                        pf->skip++;
-                else {
-                        x = pf->height - height - 1;
-                        skip = w->inptrs;
-                        while (--x)
-                                skip *= w->inptrs;
-                        pf->skip += skip;
-                }
-
-                return;
-        }
-
-        if (pf->height == height + 1) {
-                if (pf->start + pf->len == bn && pf->len == pf->skip) {
-                        pf->len++;
-                        pf->skip++;
-                } else {
-                        if (pf->start) {
-                                if (pf->height == w->di.di_height) {
-                                        add_extent(w, pf->offset, pf->start,
-                                                   pf->len);
-                                        add_lblk_range(lblk_range_list, 
-                                                       pf->offset, pf->len);
-                                }
-                        }
-
-                        pf->offset += pf->skip;
-                        pf->start = bn;
-                        pf->len = 1;
-                        pf->skip = 1;
-                }
-        }
-}
-
-/**
- * get_dblk_ranges - Run through the file and add valid data block ranges to 
- *                   lblk_range_list
- * @w: the world
- *
- */
-
-static void
-get_dblk_ranges(world_t *w)
-{
-        do_pf_t pf;
-        unsigned int h;
-
-        for (h = 1; h <= w->di.di_height; h++) {
-
-                memset(&pf, 0, sizeof(do_pf_t));
-                pf.height = h;
-
-                recursive_scan(w, 0, 0, do_pf, &pf);
-
-                if (pf.start) {
-                        if (h == w->di.di_height) {
-                                add_extent(w, pf.offset, pf.start, pf.len);
-                                add_lblk_range(lblk_range_list, pf.offset, 
-                                               pf.len);
-                        }
-                }
-        }
-}
-
-/**
- * compute_layout - Computes the layout and store the valid data page ranges 
- *                  in lblk_range_list
- * @argc:
- * @argv:
- *
- */
-
-static void
-compute_layout(char *path)
-{
-        world_t w;
-        int fd;
-        int retry = TRUE;
-        struct gfs_ioctl gi;
-        int error;
-
-        memset(&w, 0, sizeof(world_t));
-        w.buf_size = LAYOUT_DATA_QUANTUM;
-        osi_list_init(&w.blist);
-        osi_list_init(&w.elist);
-
-
-        fd = open(path, O_RDONLY);
-        if (fd < 0)
-                die("can't open %s: %s\n", path, strerror(errno));
-
-        check_for_gfs(fd, path);
-
-        {
-                char *argv[] = {
-			(char *)"get_super"
-		};
-
-                gi.gi_argc = 1;
-                gi.gi_argv = argv;
-                gi.gi_data = (char *)&w.sb;
-                gi.gi_size = sizeof(struct gfs_sb);
-
-                error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-                if (error != gi.gi_size)
-                        die("error doing get_super (%d): %s\n",
-                            error, strerror(errno));
-        }
-
-        w.diptrs = (w.sb.sb_bsize - sizeof(struct gfs_dinode)) /
-                sizeof(uint64_t);
-        w.inptrs = (w.sb.sb_bsize - sizeof(struct gfs_indirect)) /
-                sizeof(uint64_t);
-        w.jbsize = w.sb.sb_bsize - sizeof(struct gfs_meta_header);
-        j_blk_size = w.jbsize;
-        w.hash_bsize = w.sb.sb_bsize / 2;
-        w.hash_ptrs = w.hash_bsize / sizeof(uint64_t);
-
-        for (;;) {
-                char *argv[] = {
-			(char *)"get_file_meta_quota"
-		};
-
-                w.buf_data = malloc(w.buf_size);
-                if (!w.buf_data)
-                        die("out of memory\n");
-
-                gi.gi_argc = 1;
-                gi.gi_argv = argv;
-                gi.gi_data = w.buf_data;
-                gi.gi_size = w.buf_size;
-
-                w.buf_count = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-                if (w.buf_count >= 0)
-                        break;
-
-                if (errno == ENOMEM) {
-                        if (retry) {
-                                free(w.buf_data);
-                                w.buf_size += LAYOUT_DATA_QUANTUM;
-                                continue;
-                        } else
-                                die("%u bytes isn't enough memory\n",
-                                    w.buf_size);
-                }
-                die("error doing get_file_meta: %s\n",
-                    strerror(errno));
-        }
-
-        build_list(&w);
-        check_list(&w);
-
-        get_dblk_ranges(&w);
-
-        close(fd);
-}
-
-/**
- * print_quota_range - print the quota information in the given sequence of 
- *                     blocks
- * @argc:
- * @argv:
- *
- */
-static void 
-print_quota_range(commandline_t *comline, int type, uint64_t start, 
-                  unsigned int len)
-{
-        uint64_t blk_offt, blk_end_offt, offset;
-        uint64_t quo;
-        unsigned int rem;
-        int fd;
-        struct gfs_sb sb;
-        struct gfs_ioctl gi;
-        char buf[sizeof(struct gfs_quota)];
-        struct gfs_quota q;
-        uint64_t hidden_blocks = 0;
-        uint32_t id;
-        int error;
-
-        blk_offt = start * (uint64_t)j_blk_size;
-        blk_end_offt = blk_offt + (uint64_t)(len * j_blk_size);
-
-        quo = blk_offt / (uint64_t)(2 * sizeof(struct gfs_quota));
-        rem = blk_offt % (uint64_t)(2 * sizeof(struct gfs_quota));
-        
-        offset = type == GQ_ID_USER ? blk_offt : 
-                blk_offt + sizeof(struct gfs_quota);
-        
-        if (rem && type == GQ_ID_USER)
-                offset = (quo + 1) * (uint64_t)(2 * sizeof(struct gfs_quota));
-        
-        if (rem && type == GQ_ID_GROUP) {
-                if (rem <= sizeof(struct gfs_quota))
-                        offset = quo * (uint64_t)(2 * sizeof(struct gfs_quota))
-                                + sizeof(struct gfs_quota);
-                else
-                        offset = (quo + 1) * 
-                                (uint64_t)(2 * sizeof(struct gfs_quota)) + 
-                                sizeof(struct gfs_quota);
-        }
-
-        fd = open(comline->filesystem, O_RDONLY);
-        if (fd < 0)
-                die("can't open file %s: %s\n", comline->filesystem, 
-                    strerror(errno));
-
-        check_for_gfs(fd, comline->filesystem);
-        do_get_super(fd, &sb);
-        
-        if (comline->no_hidden_file_blocks)
-                hidden_blocks = compute_hidden_blocks(comline, fd);
-
-        do {
-                char *argv[] = {
-			(char *)"do_hfile_read",
-			(char *)"quota"
-		};
-
-                gi.gi_argc = 2;
-                gi.gi_argv = argv;
-                gi.gi_data = buf;
-                gi.gi_size = sizeof(struct gfs_quota);
-                gi.gi_offset = offset;
-                
-                memset(buf, 0, sizeof(struct gfs_quota));
-                
-                error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-                if (error < 0)
-                        die("can't read quota file: %s\n",
-                            strerror(errno));
-                
-                gfs_quota_in(&q, buf);
-                
-                id = (offset / sizeof(struct gfs_quota)) >> 1;
-                if (!id && comline->no_hidden_file_blocks)
-                        q.qu_value -= hidden_blocks;
-                
-                if (q.qu_limit || q.qu_warn || q.qu_value)
-                        print_quota(comline, type == GQ_ID_GROUP ? FALSE : TRUE,
-                                    id, &q, &sb);
-
-                offset += 2 * sizeof(struct gfs_quota);
-        } while ((error == sizeof(struct gfs_quota)) && 
-                 (offset < blk_end_offt));
-        
-        close(fd);
-}
-
-void 
-print_quota_file(commandline_t *comline)
-{
-        lblk_range_t lblk_range, *bar;
-        osi_list_t *t, *x;
-
-        lblk_range_list = &lblk_range;
-
-        osi_list_init(&lblk_range_list->list);
-        
-        compute_layout(comline->filesystem);
-        
-        if (osi_list_empty(&lblk_range_list->list)) {
-                /* stuffed quota inode */
-                print_quota_range(comline, GQ_ID_USER, 0, 1);
-                print_quota_range(comline, GQ_ID_GROUP, 0, 1);
-        } else {
-                /* print the user quotas */
-                osi_list_foreach(t, &lblk_range_list->list) {
-                        bar = osi_list_entry(t, lblk_range_t, list);
-                        print_quota_range(comline, GQ_ID_USER, bar->start, 
-                                          bar->len);
-                }
-                /* print the group quotas */
-                osi_list_foreach(t, &lblk_range_list->list) {
-                        bar = osi_list_entry(t, lblk_range_t, list);
-                        print_quota_range(comline, GQ_ID_GROUP, bar->start, 
-                                          bar->len);
-                }
-                /* free the list */
-                osi_list_foreach_safe(t, &lblk_range_list->list, x) {
-                        bar = osi_list_entry(t, lblk_range_t, list);
-                        osi_list_del(&bar->list);
-                        free(bar);
-                }
-        }
-}
diff --git a/gfs/gfs_quota/main.c b/gfs/gfs_quota/main.c
deleted file mode 100644
index 0bc6d51..0000000
--- a/gfs/gfs_quota/main.c
+++ /dev/null
@@ -1,759 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <time.h>
-#include <limits.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-#include "gfs_ondisk.h"
-#define __user
-#include "gfs_ioctl.h"
-
-#include "copyright.cf"
-
-#include "gfs_quota.h"
-
-/*  Constants  */
-
-#define OPTION_STRING ("bdf:g:hkl:mnsu:V")
-
-char *prog_name;
-
-/**
- * print_usage - print usage info to the user
- *
- */
-
-static void
-print_usage(void)
-{
-	printf("Usage:\n");
-	printf("\n");
-	printf("%s <list|sync|get|limit|warn|check|init> [options]\n",
-	       prog_name);
-	printf("\n");
-	printf("Actions:\n");
-	printf("  list             list the whole quota file\n");
-	printf("  sync             sync out unsynced quotas\n");
-	printf("  get              get quota values for an ID\n");
-	printf("  limit            set a quota limit value for an ID\n");
-	printf("  warn             set a quota warning value for an ID\n");
-	printf("  check            check the quota file\n");
-	printf("  init             initialize the quota file\n");
-	printf("\n");
-	printf("Options:\n");
-	printf("  -b               sizes are in FS blocks\n");
-	printf("  -d               don't include hidden inode blocks\n");
-	printf("  -f <directory>   the filesystem to work on\n");
-	printf("  -g <gid>         get/set a group ID\n");
-	printf("  -h               Print this help, then exit\n");
-	printf("  -k               sizes are in KB\n");
-	printf("  -l <size>        the new limit or warn value\n");
-	printf("  -m               sizes are in MB\n");
-	printf("  -n               print out UID/GID numbers instead of names\n");
-	printf("  -s               sizes are in 512-byte blocks\n");
-	printf("  -u <uid>         get/set a user ID\n");
-	printf("  -V               Print program version information, then exit\n");
-}
-
-/**
- * check_for_gfs - Check to see if a descriptor is a file on a GFS filesystem
- * @fd: the file descriptor
- * @path: the path used to open the descriptor
- *
- */
-
-void
-check_for_gfs(int fd, char *path)
-{
-	unsigned int magic = 0;
-	int error;
-
-	error = ioctl(fd, GFS_IOCTL_IDENTIFY, &magic);
-	if (error || magic != GFS_MAGIC)
-		die("%s is not a GFS file/filesystem\n", path);
-}
-
-/**
- * do_get_super
- * fd:
- * sb:
- *
- */
-
-void
-do_get_super(int fd, struct gfs_sb *sb)
-{
-	struct gfs_ioctl gi;
-	char *argv[] = {
-		(char *)"get_super"
-	};
-	int error;
-
-	gi.gi_argc = 1;
-	gi.gi_argv = argv;
-	gi.gi_data = (char *)sb;
-	gi.gi_size = sizeof(struct gfs_sb);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size)
-		die("can't read the superblock (%d): %s\n",
-		    error, strerror(errno));
-}
-
-/**
- * decode_arguments - parse command line arguments
- * @argc: well, it's argc...
- * @argv: well, it's argv...
- * @comline: the structure filled in with the parsed arguments
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-static void
-decode_arguments(int argc, char *argv[], commandline_t *comline)
-{
-	int cont = TRUE;
-	int optchar;
-
-	while (cont) {
-		optchar = getopt(argc, argv, OPTION_STRING);
-
-		switch (optchar) {
-		case 'u':
-			comline->id_type = GQ_ID_USER;
-			comline->id = name_to_id(TRUE, optarg, comline->numbers);
-			break;
-
-		case 'g':
-			comline->id_type = GQ_ID_GROUP;
-			comline->id = name_to_id(FALSE, optarg, comline->numbers);
-			break;
-
-		case 'l':
-			if (!isdigit(*optarg))
-				die("argument to -l must be a number\n");
-			sscanf(optarg, "%"SCNu64, &comline->new_value);
-			comline->new_value_set = TRUE;
-			break;
-
-		case 'f':
-			if (!realpath(optarg, comline->filesystem))
-				die("can't find %s: %s\n", optarg,
-				    strerror(errno));
-			break;
-
-		case 'm':
-			comline->units = GQ_UNITS_MEGABYTE;
-			break;
-
-		case 'k':
-			comline->units = GQ_UNITS_KILOBYTE;
-			break;
-
-		case 'b':
-			comline->units = GQ_UNITS_FSBLOCK;
-			break;
-
-		case 's':
-			comline->units = GQ_UNITS_BASICBLOCK;
-			break;
-
-		case 'd':
-			comline->no_hidden_file_blocks = TRUE;
-			break;
-
-		case 'n':
-			comline->numbers = TRUE;
-			break;
-
-		case 'V':
-			printf("gfs_quota %s (built %s %s)\n", RELEASE_VERSION,
-			       __DATE__, __TIME__);
-			printf("%s\n", REDHAT_COPYRIGHT);
-			exit(EXIT_SUCCESS);
-			break;
-
-		case 'h':
-			print_usage();
-			exit(EXIT_SUCCESS);
-			break;
-
-		case ':':
-		case '?':
-			fprintf(stderr, "Please use '-h' for usage.\n");
-			exit(EXIT_FAILURE);
-			break;
-
-		case EOF:
-			cont = FALSE;
-			break;
-
-		default:
-			die("unknown option: %c\n", optchar);
-			break;
-		};
-	}
-
-	while (optind < argc) {
-		if (strcmp(argv[optind], "list") == 0 ||
-		    strcmp(argv[optind], "dump") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_LIST;
-		} else if (strcmp(argv[optind], "sync") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_SYNC;
-		} else if (strcmp(argv[optind], "get") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_GET;
-		} else if (strcmp(argv[optind], "limit") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_LIMIT;
-		} else if (strcmp(argv[optind], "warn") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_WARN;
-		} else if (strcmp(argv[optind], "check") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_CHECK;
-		} else if (strcmp(argv[optind], "init") == 0) {
-			if (comline->operation)
-				die("can't specify two operations\n");
-			comline->operation = GQ_OP_INIT;
-		} else
-			die("unknown option %s\n", argv[optind]);
-
-		optind++;
-	}
-}
-
-/**
- * compute_hidden_blocks - figure out how much space the hidden inodes use
- * @comline: the struct containing the parsed command line arguments
- * @fd: the filedescriptor to the filesystem
- *
- * Returns: the number of hidden blocks
- */
-
-uint64_t
-compute_hidden_blocks(commandline_t *comline, int fd)
-{
-	struct gfs_dinode di;
-	struct gfs_ioctl gi;
-	uint64_t hidden_blocks = 0;
-	int error;
-
-	{
-		char *argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"jindex"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;	
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("can't stat jindex (%d): %s\n",
-			    error, strerror(errno));
-		hidden_blocks += di.di_blocks;
-	}
-
-	{
-		char *argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"rindex"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;	
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("can't stat rindex (%d): %s\n",
-			    error, strerror(errno));
-		hidden_blocks += di.di_blocks;
-	}
-
-	{
-		char *argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"quota"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;	
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("can't stat quota file (%d): %s\n",
-			    error, strerror(errno));
-		hidden_blocks += di.di_blocks;
-	}
-
-	{
-		char *argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"license"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;	
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("can't stat license file (%d): %s\n",
-			    error, strerror(errno));
-		hidden_blocks += di.di_blocks;
-	}
-
-	return hidden_blocks;
-}
-
-/**
- * print_quota - Print out a quota entry
- * @comline: the struct containing the parsed command line arguments
- * @user: TRUE if this is a user quota, FALSE if it's a group quota
- * @id: the ID
- * @q: the quota value
- * @sb: the superblock of the filesystem this quota belongs to
- *
- */
-
-void
-print_quota(commandline_t *comline,
-	    int user, uint32_t id,
-	    struct gfs_quota *q,
-	    struct gfs_sb *sb)
-{
-	printf("%-5s %10s:  ", (user) ? "user" : "group",
-	       id_to_name(user, id, comline->numbers));
-
-	switch (comline->units) {
-	case GQ_UNITS_MEGABYTE:
-		printf("limit: %-10.1f warn: %-10.1f value: %-10.1f\n",
-		       (double) q->qu_limit * sb->sb_bsize / 1048576,
-		       (double) q->qu_warn * sb->sb_bsize / 1048576,
-		       (double) q->qu_value * sb->sb_bsize / 1048576);
-		break;
-
-	case GQ_UNITS_KILOBYTE:
-		if (sb->sb_bsize == 512)
-			printf("limit: %-10"PRIu64" warn: %-10"PRIu64"value: %-10"PRId64"\n",
-			       q->qu_limit / 2,
-			       q->qu_warn / 2,
-			       q->qu_value / 2);
-		else
-			printf("limit: %-10"PRIu64" warn: %-10"PRIu64"value: %-10"PRId64"\n",
-			       q->qu_limit << (sb->sb_bsize_shift - 10),
-			       q->qu_warn << (sb->sb_bsize_shift - 10),
-			       q->qu_value << (sb->sb_bsize_shift - 10));
-		break;
-
-	case GQ_UNITS_FSBLOCK:
-		printf("limit: %-10"PRIu64" warn: %-10"PRIu64" value: %-10"PRId64"\n",
-		       q->qu_limit, q->qu_warn, q->qu_value);
-		break;
-
-	case GQ_UNITS_BASICBLOCK:
-		printf("limit: %-10"PRIu64" warn: %-10"PRIu64" value: %-10"PRId64"\n",
-		       q->qu_limit << (sb->sb_bsize_shift - 9),
-		       q->qu_warn << (sb->sb_bsize_shift - 9),
-		       q->qu_value << (sb->sb_bsize_shift - 9));
-		break;
-
-	default:
-		die("bad units\n");
-		break;
-	}
-}
-
-/**
- * do_list - List all the quota data for a filesystem
- * @comline: the struct containing the parsed command line arguments
- *
- */
-
-static void
-do_list(commandline_t *comline)
-{
-	print_quota_file(comline);
-}
-
-/**
- * do_sync_one - sync the quotas on one GFS filesystem
- * @path: a file/directory in the filesystem
- *
- */
-
-static void
-do_sync_one(char *filesystem)
-{
-	int fd;
-	char *argv[] = {
-		(char *)"do_quota_sync"
-	};
-	struct gfs_ioctl gi;
-	int error;
-
-	fd = open(filesystem, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", filesystem, strerror(errno));
-
-	check_for_gfs(fd, filesystem);
-
-	gi.gi_argc = 1;
-	gi.gi_argv = argv;
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error)
-		die("can't sync quotas: %s\n", strerror(errno));
-
-	close(fd);
-}
-
-/**
- * do_sync - sync out unsyned quotas
- * @comline: the struct containing the parsed command line arguments
- *
- */
-
-void
-do_sync(commandline_t *comline)
-{
-	sync();
-
-	if (*comline->filesystem)
-		do_sync_one(comline->filesystem);
-	else {
-		char buf[256], device[256], path[256], type[256];
-		FILE *file;
-
-		file = fopen("/proc/mounts", "r");
-		if (!file)
-			die("can't open /proc/mounts: %s\n", strerror(errno));
-
-		while (fgets(buf, 256, file)) {
-			if (sscanf(buf, "%s %s %s", device, path, type) != 3)
-				continue;
-			if (strcmp(type, "gfs") != 0)
-				continue;
-
-			do_sync_one(path);
-		}
-
-		fclose(file);
-	}
-}
-
-/**
- * do_get_one - Get a quota value from one FS
- * @comline: the struct containing the parsed command line arguments
- * @filesystem: the filesystem to get from
- *
- */
-
-static void
-do_get_one(commandline_t *comline, char *filesystem)
-{
-	int fd;
-	char buf[256];
-	struct gfs_ioctl gi;
-	struct gfs_quota q;
-	struct gfs_sb sb;
-	int error;
-
-	fd = open(filesystem, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", comline->filesystem,
-		    strerror(errno));
-
-	check_for_gfs(fd, filesystem);
-
-	sprintf(buf, "%s:%u",
-		(comline->id_type == GQ_ID_USER) ? "u" : "g",
-		comline->id);
-
-	{
-		char *argv[] = {
-			(char *)"do_quota_read",
-			(char *)buf
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;
-		gi.gi_data = (char *)&q;
-		gi.gi_size = sizeof(struct gfs_quota);
-
-		memset(&q, 0, sizeof(struct gfs_quota));
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error < 0)
-			die("can't get quota info (%d): %s\n",
-			    error, strerror(errno));
-	}
-
-	if (comline->no_hidden_file_blocks && !comline->id)
-		q.qu_value -= compute_hidden_blocks(comline, fd);
-
-	do_get_super(fd, &sb);
-
-	print_quota(comline,
-		    (comline->id_type == GQ_ID_USER), comline->id,
-		    &q, &sb);
-
-	close(fd);
-}
-
-/**
- * do_get - Get a quota value
- * @comline: the struct containing the parsed command line arguments
- *
- */
-
-static void
-do_get(commandline_t *comline)
-{
-	int first = TRUE;
-
-	if (*comline->filesystem)
-		do_get_one(comline, comline->filesystem);
-	else {
-		char buf[256], device[256], path[256], type[256];
-		FILE *file;
-
-		file = fopen("/proc/mounts", "r");
-		if (!file)
-			die("can't open /proc/mounts: %s\n", strerror(errno));
-
-		while (fgets(buf, 256, file)) {
-			if (sscanf(buf, "%s %s %s", device, path, type) != 3)
-				continue;
-			if (strcmp(type, "gfs") != 0)
-				continue;
-
-			if (first)
-				first = FALSE;
-			else
-				printf("\n");
-
-			printf("%s:\n", path);
-			do_get_one(comline, path);
-		}
-
-		fclose(file);
-	}
-}
-
-/**
- * do_set - Set a quota value
- * @comline: the struct containing the parsed command line arguments
- *
- */
-
-static void
-do_set(commandline_t *comline)
-{
-	int fd;
-	uint64_t offset;
-	struct gfs_ioctl gi;
-	struct gfs_sb sb;
-	uint64_t new_value;
-	char buf[256];
-	int error;
-
-	if (!*comline->filesystem)
-		die("need a filesystem to work on\n");
-	if (!comline->new_value_set)
-		die("need a new value\n");
-
-	fd = open(comline->filesystem, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", comline->filesystem,
-		    strerror(errno));
-
-	check_for_gfs(fd, comline->filesystem);
-
-	switch (comline->id_type) {
-	case GQ_ID_USER:
-		offset = (2 * (uint64_t)comline->id) * sizeof(struct gfs_quota);
-		break;
-
-	case GQ_ID_GROUP:
-		offset = (2 * (uint64_t)comline->id + 1) * sizeof(struct gfs_quota);
-		break;
-
-	default:
-		die("invalid user/group ID\n");
-		break;
-	}
-
-	switch (comline->operation) {
-	case GQ_OP_LIMIT:
-		offset += (unsigned long)(&((struct gfs_quota *) NULL)->qu_limit);
-		break;
-
-	case GQ_OP_WARN:
-		offset += (unsigned long)(&((struct gfs_quota *) NULL)->qu_warn);
-		break;
-
-	default:
-		die("invalid operation\n");
-		break;
-	};
-
-	do_get_super(fd, &sb);
-
-	switch (comline->units) {
-	case GQ_UNITS_MEGABYTE:
-		new_value = comline->new_value << (20 - sb.sb_bsize_shift);
-		break;
-
-	case GQ_UNITS_KILOBYTE:
-		if (sb.sb_bsize == 512)
-			new_value = comline->new_value * 2;
-		else
-			new_value = comline->new_value >> (sb.sb_bsize_shift - 10);
-		break;
-
-	case GQ_UNITS_FSBLOCK:
-		new_value = comline->new_value;
-		break;
-
-	case GQ_UNITS_BASICBLOCK:
-		new_value = comline->new_value >> (sb.sb_bsize_shift - 9);
-		break;
-
-	default:
-		die("bad units\n");
-		break;
-	}
-
-	new_value = cpu_to_gfs64(new_value);
-
-	{
-		char *argv[] = {
-			(char *)"do_hfile_write",
-			(char *)"quota"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;
-		gi.gi_data = (char *)&new_value;
-		gi.gi_size = sizeof(uint64_t);
-		gi.gi_offset = offset;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("can't write quota file (%d): %s\n",
-			    error, strerror(errno));
-	}
-
-	sprintf(buf, "%s:%u",
-		(comline->id_type == GQ_ID_USER) ? "u" : "g",
-		comline->id);
-
-	{
-		char *argv[] = {
-			(char *)"do_quota_refresh",
-			(char *)buf
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error)
-			die("can't refresh the quota LVB: %s\n",
-			    strerror(errno));
-	}
-
-	close(fd);
-}
-
-/**
- * main - Do everything
- * @argc: well, it's argc...
- * @argv: well, it's argv...
- *
- * Returns: exit status
- */
-
-int
-main(int argc, char *argv[])
-{
-	commandline_t comline;
-
-	prog_name = argv[0];
-
-	memset(&comline, 0, sizeof(commandline_t));
-
-	decode_arguments(argc, argv, &comline);
-
-	switch (comline.operation) {
-	case GQ_OP_LIST:
-		do_list(&comline);
-		break;
-
-	case GQ_OP_SYNC:
-		do_sync(&comline);
-		break;
-
-	case GQ_OP_GET:
-		do_get(&comline);
-		break;
-
-	case GQ_OP_LIMIT:
-	case GQ_OP_WARN:
-		do_set(&comline);
-		break;
-
-	case GQ_OP_CHECK:
-		do_sync(&comline);
-		do_sync(&comline);
-		do_check(&comline);
-		break;
-
-	case GQ_OP_INIT:
-		do_sync(&comline);
-		do_sync(&comline);
-		do_init(&comline);
-		break;
-
-	default:
-		if (!comline.id_type) {
-			comline.id_type = GQ_ID_USER;
-			comline.id = geteuid();
-		}
-		do_get(&comline);
-		break;
-	}
-
-	exit(EXIT_SUCCESS);
-}
diff --git a/gfs/gfs_quota/names.c b/gfs/gfs_quota/names.c
deleted file mode 100644
index fd4ade8..0000000
--- a/gfs/gfs_quota/names.c
+++ /dev/null
@@ -1,84 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <time.h>
-#include <dirent.h>
-#include <limits.h>
-#include <pwd.h>
-#include <grp.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "gfs_ondisk.h"
-
-#include "gfs_quota.h"
-
-uint32_t
-name_to_id(int user, char *name, int numbers)
-{
-	struct passwd *u;
-	struct group *g;
-	uint32_t id;
-	int ok = FALSE;
-
-	if (numbers) {
-	} else if (user) {
-		u = getpwnam(name);
-		if (u) {
-			id = u->pw_uid;
-			ok = TRUE;
-		}
-	} else {
-		g = getgrnam(name);
-		if (g) {
-			id = g->gr_gid;
-			ok = TRUE;
-		}
-	}
-
-	if (!ok) {
-		if (!isdigit(name[0]))
-			die("can't find %s %s\n",
-			    (user) ? "user" : "group",
-			    name);
-		sscanf(name, "%u", &id);
-	}
-
-	return id;
-}
-
-char *
-id_to_name(int user, uint32_t id, int numbers)
-{
-	struct passwd *u;
-	struct group *g;
-	static char name[256];
-	int ok = FALSE;
-
-	if (numbers) {
-	} else if (user) {
-		u = getpwuid(id);
-		if (u) {
-			strcpy(name, u->pw_name);
-			ok = TRUE;
-		}
-	} else {
-		g = getgrgid(id);
-		if (g) {
-			strcpy(name, g->gr_name);
-			ok = TRUE;
-		}
-	}
-
-	if (!ok)
-		sprintf(name, "%u", id);
-
-	return name;
-}
diff --git a/gfs/gfs_quota/ondisk.c b/gfs/gfs_quota/ondisk.c
deleted file mode 100644
index 191c688..0000000
--- a/gfs/gfs_quota/ondisk.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-#include "gfs_ondisk.h"
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#define ENTER(x)
-#define EXIT(x)
-#define RET(x) return
-#define RETURN(x, y) return y
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
diff --git a/gfs/gfs_tool/Makefile b/gfs/gfs_tool/Makefile
deleted file mode 100644
index 31a8cf8..0000000
--- a/gfs/gfs_tool/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-TARGET= gfs_tool
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	counters.o \
-	df.o \
-	layout.o \
-	main.o \
-	misc.o \
-	ondisk.o \
-	sb.o \
-	tune.o \
-	util.o
-
-CFLAGS += -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${gfskincdir}
-CFLAGS += -I$(S)/../include
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/gfs_tool/counters.c b/gfs/gfs_tool/counters.c
deleted file mode 100644
index 80f3de3..0000000
--- a/gfs/gfs_tool/counters.c
+++ /dev/null
@@ -1,204 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#define __user
-#include "gfs_ioctl.h"
-#include "osi_list.h"
-
-#include "gfs_tool.h"
-
-#define SIZE (4096)
-
-struct token_list {
-	osi_list_t list;
-	char *token;
-	unsigned int last;
-};
-
-static osi_list_decl(token_list);
-
-/**
- * find_update_last - find and update the last value of a token
- * @token: the token to look for
- * @this: the current value of the token
- *
- * Returns: the last value of the token
- */
-
-static unsigned int
-find_update_last(char *token, unsigned int this)
-{
-	osi_list_t *tmp, *head;
-	struct token_list *tl;
-	unsigned int last;
-
-	for (head = &token_list, tmp = head->next; tmp != head; tmp = tmp->next) {
-		tl = osi_list_entry(tmp, struct token_list, list);
-		if (strcmp(tl->token, token))
-			continue;
-
-		last = tl->last;
-		tl->last = this;
-		return last;
-	}
-
-	tl = malloc(sizeof (struct token_list) + strlen(token) + 1);
-	if (!tl)
-		die("out of memory\n");
-	tl->token = (char *) (tl + 1);
-	strcpy(tl->token, token);
-	tl->last = this;
-	osi_list_add(&tl->list, &token_list);
-
-	return 0;
-}
-
-/**
- * print_line - print out a counter
- * @token: the name of the counter
- * @description: the text description of the counter
- * @option: an optional modifier
- * @value: the value of the counter
- *
- */
-
-static void
-print_line(char *token, char *description, char *option, char *value)
-{
-	static unsigned int sd_log_seg_free;
-	unsigned int this, last;
-
-	if (!strcmp(token, "sd_log_seg_free"))
-		sscanf(value, "%u", &sd_log_seg_free);
-
-	else if (!strcmp(token, "ji_nsegment")) {
-		sscanf(value, "%u", &this);
-		printf("%39s %.2f%%\n",
-		       "log space used",
-		       100.0 * (this - sd_log_seg_free) / this);
-
-	} else if (continuous && !strcmp(option, "diff")) {
-		sscanf(value, "%u", &this);
-		last = find_update_last(token, this);
-		printf("%39s %-10s %d/s\n",
-		       description, value,
-		       (this - last + interval - 1) / interval);
-
-	} else
-		printf("%39s %s\n", description, value);
-}
-
-/**
- * parse_line: break up a chunk of data into counter fields
- * @buf: the data
- * @count: the number of bytes of data
- *
- */
-
-static void
-parse_lines(char *buf, unsigned int count)
-{
-	char line[SIZE];
-	char part1[SIZE], part2[SIZE], part3[SIZE], part4[SIZE];
-	char *c, *c2;
-	unsigned int x;
-
-	printf("\n");
-
-	while (count) {
-		for (c = line; count; c++) {
-			*c = *buf;
-			buf++;
-			count--;
-			if (*c == '\n')
-				break;
-		}
-		*c = 0;
-
-		*part1 = *part2 = *part3 = *part4 = 0;
-
-		for (c = line, x = 0; (c2 = strsep(&c, ":")); x++) {
-			if (!*c2)
-				continue;
-
-			if (x == 0)
-				strcpy(part1, c2);
-			else if (x == 1)
-				strcpy(part2, c2);
-			else if (x == 2)
-				strcpy(part3, c2);
-			else
-				strcpy(part4, c2);
-		}
-
-		if (x == 4)
-			print_line(part1, part2, part3, part4);
-	}
-}
-
-/**
- * print_counters - print out the current countersable parameters for a filesystem
- * @argc:
- * @argv:
- *
- */
-
-void
-print_counters(int argc, char **argv)
-{
-	char *fs;
-	int fd;
-
-	if (optind < argc)
-		fs = argv[optind++];
-	else
-		die("Usage: gfs_tool counters <mountpoint>\n");
-
-	fd = open(fs, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n", fs, strerror(errno));
-
-	check_for_gfs(fd, fs);
-
-	for (;;) {
-		struct gfs_ioctl gi;
-		char *local_argv[] = {
-			(char *)"get_counters"
-		};
-		char data[SIZE];
-		int error;
-
-		gi.gi_argc = 1;
-		gi.gi_argv = local_argv;
-		gi.gi_data = data;
-		gi.gi_size = SIZE;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error < 0)
-			die("can't get counters: %s\n", strerror(errno));
-
-		if (debug)
-			error = write(STDOUT_FILENO, data, error);
-
-		parse_lines(data, error);
-
-		if (!continuous)
-			break;
-
-		fflush(stdout);
-
-		sleep(interval);
-	}
-
-	close(fd);
-}
diff --git a/gfs/gfs_tool/decipher_lockstate_dump b/gfs/gfs_tool/decipher_lockstate_dump
deleted file mode 100644
index 10080a5..0000000
--- a/gfs/gfs_tool/decipher_lockstate_dump
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/perl
-
-foreach $arg (@ARGV)
-{
-    if ($arg eq '-nosort')
-    {
-	$nosort = 1;
-    }
-    else
-    {
-	push(@files, $arg);
-    }
-}
-
-
-foreach $file (@files)
-{
-    open(FILE, "< $file") || die "decipher_lockstate_dump: can't open file %s: $!\n";
-
-    while ($line = <FILE>)
-    {
-	$line =~ s/\n/ \n/;
-
-	if ($line =~ /^Glock/)
-	{
-	    $locks[$ln++] .= "\n" if (!$nosort && $notfirst++);
-	    $line =~ s/\((0),/\(reserved[$1],/;
-	    $line =~ s/\((1),/\(nondisk[$1],/;
-	    $line =~ s/\((2),/\(inode[$1],/;
-	    $line =~ s/\((3),/\(rgrp[$1],/;
-	    $line =~ s/\((4),/\(meta[$1],/;
-	    $line =~ s/\((5),/\(iopen[$1],/;
-	    $line =~ s/\((6),/\(flock[$1],/;
-	    $line =~ s/\((7),/\(jid[$1],/;
-	    $line =~ s/\((8),/\(quota[$1],/;
-
-	    $line =~ s/\(nondisk(\S+), (0)\)/\(nondisk$1, mount[$2]\)/;
-	    $line =~ s/\(nondisk(\S+), (1)\)/\(nondisk$1, live[$2]\)/;
-	    $line =~ s/\(nondisk(\S+), (2)\)/\(nondisk$1, trans[$2]\)/;
-	    $line =~ s/\(nondisk(\S+), (3)\)/\(nondisk$1, rename[$2]\)/;
-
-	    $line =~ s/\(meta(\S+), (0)\)/\(meta$1, super[$2]\)/;
-	    $line =~ s/\(meta(\S+), (1)\)/\(meta$1, crap[$2]\)/;
-
-	    if ($line =~ /\(quota\S+, (\d+)\)/)
-	    {
-		$qid = (($1 % 2) ? "Group" : "User") . int($1 / 2) . "[$1]";
-		$line =~ s/\(quota(\S+), \d+\)/\(quota$1, $qid\)/;
-	    }
-	}
-	if ($line =~ /gl_flags/)
-	{
-	    $line =~ s/ (0) / plug[$1] /;
-	    $line =~ s/ (1) / lock[$1] /;
-	    $line =~ s/ (2) / sticky[$1] /;
-	    $line =~ s/ (3) / prefetch[$1]/;
-	    $line =~ s/ (4) / sync[$1] /;
-	    $line =~ s/ (5) / dirty[$1] /;
-	    $line =~ s/ (6) / skip_waiters2[$1] /;
-	    $line =~ s/ (7) / greedy[$1] /;
-	}
-	if ($line =~ /state/)
-	{
-	    $line =~ s/(0)/unlocked[$1]/;
-	    $line =~ s/(1)/exclusive[$1]/;
-	    $line =~ s/(2)/deferred[$1]/;
-	    $line =~ s/(3)/shared[$1]/;
-	}
-	if ($line =~ /gh_flags/)
-	{
-	    $line =~ s/ (0) / try[$1] /;
-	    $line =~ s/ (1) / try_1cb[$1] /;
-	    $line =~ s/ (2) / noexp[$1] /;
-	    $line =~ s/ (3) / any[$1] /;
-	    $line =~ s/ (4) / priority[$1] /;
-	    $line =~ s/ (5) / local_excl[$1] /;
-	    $line =~ s/ (6) / async[$1] /;
-	    $line =~ s/ (7) / exact[$1] /;
-	    $line =~ s/ (8) / skip[$1] /;
-	    $line =~ s/ (9) / atime[$1] /;
-	    $line =~ s/ (10) / nocache[$1] /;
-	    $line =~ s/ (11) / sync[$1] /;
-	    $line =~ s/ (12) / nocancel[$1] /;
-	}
-	if ($line =~ /gh_iflags/)
-	{
-	    $line =~ s/ (0) / mutex[$1] /;
-	    $line =~ s/ (1) / promote[$1] /;
-	    $line =~ s/ (2) / demote[$1] /;
-	    $line =~ s/ (3) / greedy[$1] /;
-	    $line =~ s/ (4) / alloced[$1] /;
-	    $line =~ s/ (5) / dealloc[$1] /;
-	    $line =~ s/ (6) / holder[$1] /;
-	    $line =~ s/ (7) / first[$1] /;
-	    $line =~ s/ (8) / recurse[$1] /;
-	    $line =~ s/ (9) / aborted[$1] /;
-	}
-	if ($line =~ /owner/)
-	{
-	    $line =~ s/(-1)/none[$1]/;
-	}
-	if ($line =~ /type/)
-	{
-	    $line =~ s/(0)/none[$1]/;
-	    $line =~ s/(1)/regular[$1]/;
-	    $line =~ s/(2)/directory[$1]/;
-	    $line =~ s/(5)/symbolic link[$1]/;
-	    $line =~ s/(7)/block device[$1]/;
-	    $line =~ s/(8)/character device[$1]/;
-	    $line =~ s/(101)/fifo[$1]/;
-	    $line =~ s/(102)/socket[$1]/;
-	}
-	if ($line =~ /i_flags/)
-	{
-	    $line =~ s/ (0) / qd_locked[$1] /;
-	    $line =~ s/ (1) / paged[$1] /;
-	    $line =~ s/ (2) / sw_paged[$1] /;
-	}
-    
-	$locks[$ln] .= $line;
-	$ln++ if ($nosort);
-    }
-
-    close(FILE);
-}
-
-
- at locks = sort funky @locks unless ($nosort);
-
-
-foreach $lock (@locks)
-{
-    print $lock;
-}
-
-
-
-sub funky
-{
-    my($a_iopen, $b_iopen) = (0, 0);
-    my($a_locked, $b_locked) = (0, 0);
-    my($a_queued, $b_queued) = (0, 0);
-    my($a_unlocked, $b_unlocked) = (0, 0);
-
-
-    $a_iopen = 1 if ($a =~ /iopen/);
-    $b_iopen = 1 if ($b =~ /iopen/);
-
-    $a_locked = 1 if ($a =~ /gl_flags.*lock.*\n/);
-    $b_locked = 1 if ($b =~ /gl_flags.*lock.*\n/);
-
-    $a_queued = 1 if ($a =~ /Request/ ||
-		      $a =~ /Holder/ ||
-		      $a =~ /Waiter/);
-    $b_queued = 1 if ($b =~ /Request/ ||
-		      $b =~ /Holder/ ||
-		      $b =~ /Waiter/);
-
-    $a_unlocked = 1 if ($a =~ /gl_state.*unlocked.*\n/);
-    $b_unlocked = 1 if ($b =~ /gl_state.*unlocked.*\n/);
-
-
-    return ($a_iopen <=> $b_iopen) if ($a_iopen != $b_iopen);
-    return -($a_locked <=> $b_locked) if ($a_locked != $b_locked);
-    return -($a_queued <=> $b_queued) if ($a_queued != $b_queued);
-    return ($a_unlocked <=> $b_unlocked) if ($a_unlocked != $b_unlocked);
- 
-
-    return 0;
-}
-
-
diff --git a/gfs/gfs_tool/df.c b/gfs/gfs_tool/df.c
deleted file mode 100644
index 2bedb11..0000000
--- a/gfs/gfs_tool/df.c
+++ /dev/null
@@ -1,318 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#define __user
-#include "gfs_ioctl.h"
-#include "gfs_ondisk.h"
-
-#include "gfs_tool.h"
-
-#define SIZE (4096)
-
-/**
- * anthropomorphize - make a uint64_t number more human
- */
-static const char *anthropomorphize(uint64_t inhuman_value)
-{
-	const char *symbols = " KMGTPE";
-	int i;
-	uint64_t val = inhuman_value;
-	static char out_val[32];
-
-	memset(out_val, 0, sizeof(out_val));
-	for (i = 0; i < 6 && val > 1024; i++)
-		val /= 1024;
-	sprintf(out_val, "%"PRIu64"%c", val, symbols[i]);
-	return out_val;
-}
-
-/**
- * printit - parse out and print values according to the output type
- */
-static void printit(char *stat_gfs, const char *label, uint64_t used,
-		    uint64_t free_space, unsigned int percentage)
-{
-	uint64_t block_size = name2u64(stat_gfs, "bsize");
-
-	switch (output_type) {
-	case OUTPUT_BLOCKS:
-		printf("  %-15s%-15"PRIu64"%-15"PRIu64"%-15"PRIu64"%u%%\n",
-		       label, used + free_space, used, free_space, percentage);
-		break;
-	case OUTPUT_K:
-		printf("  %-15s%-15"PRIu64"%-15"PRIu64"%-15"PRIu64"%u%%\n",
-		       label, ((used + free_space) * block_size) / 1024,
-		       (used * block_size) / 1024, (free_space * block_size) / 1024,
-		       percentage);
-		break;
-	case OUTPUT_HUMAN:
-		/* Need to do three separate printfs here because function
-		   anthropomorphize re-uses the same static space. */
-		printf("  %-15s%-15s", label,
-		       anthropomorphize((used + free_space) * block_size));
-		printf("%-15s", anthropomorphize(used * block_size));
-		printf("%-15s%u%%\n", anthropomorphize(free_space * block_size),
-		       percentage);
-		break;
-	}
-}
-
-/**
- * do_df_one - print out information about one filesystem
- * @path: the path to the filesystem
- *
- */
-
-static void
-do_df_one(char *path)
-{
-	int fd;
-	struct gfs_ioctl gi;
-	char stat_gfs[SIZE], args[SIZE], lockstruct[SIZE];
-	struct gfs_sb sb;
-	struct gfs_dinode ji, ri;
-	uint64_t journals, rgrps;
-	uint64_t used_data;
-	unsigned int flags;
-	unsigned int percentage;
- 	int error;
-
-
-	fd = open(path, O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", path, strerror(errno));
-
-	check_for_gfs(fd, path);
-
-
-	{
-		char *argv[] = {
-			(char *)"get_stat_gfs"
-		};
-
-		gi.gi_argc = 1;
-		gi.gi_argv = argv;
-		gi.gi_data = stat_gfs;
-		gi.gi_size = SIZE;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error < 0)
-			die("error doing get_stat_gfs (%d): %s\n",
-			    error, strerror(errno));
-	}
-	{
-		char *argv[] = {
-			(char *)"get_super"
-		};
-
-		gi.gi_argc = 1;
-		gi.gi_argv = argv;
-		gi.gi_data = (char *)&sb;
-		gi.gi_size = sizeof(struct gfs_sb);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_super (%d): %s\n",
-			    error, strerror(errno));
-	}
-	{
-		char *argv[] = {
-			(char *)"get_args"
-		};
-
-		gi.gi_argc = 1;
-		gi.gi_argv = argv;
-		gi.gi_data = args;
-		gi.gi_size = SIZE;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error < 0)
-			die("error doing get_args (%d): %s\n",
-			    error, strerror(errno));
-	}
-	{
-		char *argv[] = {
-			(char *)"get_lockstruct"
-		};
-
-		gi.gi_argc = 1;
-		gi.gi_argv = argv;
-		gi.gi_data = lockstruct;
-		gi.gi_size = SIZE;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error < 0)
-			die("error doing get_lockstruct (%d): %s\n",
-			    error, strerror(errno));
-	}
-	{
-		char *argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"jindex"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;
-		gi.gi_data = (char *)&ji;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_hfile_stat for jindex (%d): %s\n",
-			    error, strerror(errno));
-	}
-	{
-		char *argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"rindex"
-		};
-
-		gi.gi_argc = 2;
-		gi.gi_argv = argv;
-		gi.gi_data = (char *)&ri;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_hfile_stat for rindex (%d): %s\n",
-			    error, strerror(errno));
-	}
-
-
-	close(fd);
-
-
-	journals = ji.di_size;
-	if (journals % sizeof(struct gfs_jindex))
-		die("bad jindex size\n");
-	journals /= sizeof(struct gfs_jindex);
-
-	rgrps = ri.di_size;
-	if (rgrps % sizeof(struct gfs_rindex))
-		die("bad rindex size\n");
-	rgrps /= sizeof(struct gfs_rindex);
-
-
-	used_data = name2u64(stat_gfs, "total_blocks") -
-		name2u64(stat_gfs, "free") -
-		(name2u64(stat_gfs, "used_dinode") + name2u64(stat_gfs, "free_dinode")) -
-		(name2u64(stat_gfs, "used_meta") + name2u64(stat_gfs, "free_meta"));
-
-
-	printf("%s:\n", path);
-	printf("  SB lock proto = \"%s\"\n", sb.sb_lockproto);
-	printf("  SB lock table = \"%s\"\n", sb.sb_locktable);
-	printf("  SB ondisk format = %u\n", sb.sb_fs_format);
-	printf("  SB multihost format = %u\n", sb.sb_multihost_format);
-	printf("  Block size = %u\n", name2u32(stat_gfs, "bsize"));
-	printf("  Journals = %"PRIu64"\n", journals);
-	printf("  Resource Groups = %"PRIu64"\n", rgrps);
-	printf("  Mounted lock proto = \"%s\"\n",
-	       (name2value(args, "lockproto")[0]) ?
-	       name2value(args, "lockproto") : sb.sb_lockproto);
-	printf("  Mounted lock table = \"%s\"\n",
-	       (name2value(args, "locktable")[0]) ?
-	       name2value(args, "locktable") : sb.sb_locktable);
-	printf("  Mounted host data = \"%s\"\n", name2value(args, "hostdata"));
-	printf("  Journal number = %u\n", name2u32(lockstruct, "jid"));
-	flags = name2u32(lockstruct, "flags");
-	printf("  Lock module flags = %x", flags);
-	printf("\n");
-	printf("  Local flocks = %s\n", (name2u32(args, "localflocks")) ? "TRUE" : "FALSE");
-	printf("  Local caching = %s\n", (name2u32(args, "localcaching")) ? "TRUE" : "FALSE");
-	printf("  Oopses OK = %s\n", (name2u32(args, "oopses_ok")) ? "TRUE" : "FALSE");
-	printf("\n");
-	switch (output_type) {
-	case OUTPUT_BLOCKS:
-		printf("  %-15s%-15s%-15s%-15s%-15s\n", "Type", "Total Blocks",
-		       "Used Blocks", "Free Blocks", "use%");
-		break;
-	case OUTPUT_K:
-		printf("  %-15s%-15s%-15s%-15s%-15s\n", "Type", "Total K",
-		       "Used K", "Free K", "use%");
-		break;
-	case OUTPUT_HUMAN:
-		printf("  %-15s%-15s%-15s%-15s%-15s\n", "Type", "Total",
-		       "Used", "Free", "use%");
-		break;
-	}
-	printf("  ------------------------------------------------------------------------\n");
-
-	percentage = (name2u64(stat_gfs, "used_dinode") + name2u64(stat_gfs, "free_dinode")) ?
-		(100.0 * name2u64(stat_gfs, "used_dinode") / (name2u64(stat_gfs, "used_dinode") +
-							      name2u64(stat_gfs, "free_dinode")) + 0.5) : 0;
-	printit(stat_gfs, "inodes", name2u64(stat_gfs, "used_dinode"),
-		name2u64(stat_gfs, "free_dinode"), percentage);
-
-	percentage = (name2u64(stat_gfs, "used_meta") + name2u64(stat_gfs, "free_meta")) ?
-		(100.0 * name2u64(stat_gfs, "used_meta") / (name2u64(stat_gfs, "used_meta") +
-							    name2u64(stat_gfs, "free_meta")) + 0.5) : 0;
-	printit(stat_gfs, "metadata", name2u64(stat_gfs, "used_meta"),
-		name2u64(stat_gfs, "free_meta"), percentage);
-
-	percentage = (used_data + name2u64(stat_gfs, "free")) ?
-		(100.0 * used_data / (used_data + name2u64(stat_gfs, "free")) + 0.5) : 0;
-	printit(stat_gfs, "data", used_data, name2u64(stat_gfs, "free"),
-		percentage);
-}
-
-
-/**
- * print_df - print out information about filesystems
- * @argc:
- * @argv:
- *
- */
-
-void
-print_df(int argc, char **argv)
-{
-	if (optind < argc) {
-		char buf[PATH_MAX];
-
-		if (!realpath(argv[optind], buf))
-			die("can't determine real path: %s\n", strerror(errno));
-
-		do_df_one(buf);
-
-		return;
-	}
-
-	{
-		FILE *file;
-		char buf[256], device[256], path[256], type[256];
-		int first = TRUE;
-
-		file = fopen("/proc/mounts", "r");
-		if (!file)
-			die("can't open /proc/mounts: %s\n", strerror(errno));
-
-		while (fgets(buf, 256, file)) {
-			if (sscanf(buf, "%s %s %s", device, path, type) != 3)
-				continue;
-			if (strcmp(type, "gfs") != 0)
-				continue;
-
-			if (first)
-				first = FALSE;
-			else
-				printf("\n");
-
-			do_df_one(path);
-		}
-
-		fclose(file);
-	}
-}
-
-
diff --git a/gfs/gfs_tool/gfs_tool.h b/gfs/gfs_tool/gfs_tool.h
deleted file mode 100644
index db9cdf4..0000000
--- a/gfs/gfs_tool/gfs_tool.h
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef __GFS_TOOL_DOT_H__
-#define __GFS_TOOL_DOT_H__
-
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#define die(fmt, args...) \
-do { \
-	fprintf(stderr, "%s: ", prog_name); \
-	fprintf(stderr, fmt, ##args); \
-	exit(EXIT_FAILURE); \
-} while (0)
-
-
-#define OUTPUT_BLOCKS 0
-#define OUTPUT_K      1
-#define OUTPUT_HUMAN  2
-
-extern char *prog_name;
-extern char *action;
-extern int override;
-extern int expert;
-extern int debug;
-extern int continuous;
-extern int interval;
-extern int output_type;
-
-/* From counters.c */
-
-void print_counters(int argc, char **argv);
-
-
-/* From df.c */
-
-void print_df(int argc, char **argv);
-
-
-/* From layout.c */
-
-void print_layout(int argc, char **argv);
-
-
-/* From main.c */
-
-void print_usage(void);
-
-
-/* From misc.c */
-
-void do_file_flush(int argc, char **argv);
-void do_freeze(int argc, char **argv);
-void margs(int argc, char **argv);
-void print_lockdump(int argc, char **argv);
-void set_flag(int argc, char **argv);
-void print_stat(int argc, char **argv);
-void print_sb(int argc, char **argv);
-void print_jindex(int argc, char **argv);
-void print_rindex(int argc, char **argv);
-void print_quota(int argc, char **argv);
-void print_list(void);
-void reclaim_metadata(int argc, char **argv);
-void do_shrink(int argc, char **argv);
-void do_withdraw(int argc, char **argv);
-
-
-/* From sb.c */
-
-void do_sb(int argc, char **argv);
-
-
-/* From tune.c */
-
-void get_tune(int argc, char **argv);
-void set_tune(int argc, char **argv);
-
-
-/* From util.c */
-
-void check_for_gfs(int fd, char *path);
-char *get_list(void);
-char **str2lines(char *str);
-char *mp2cookie(char *mp, int ioctl_ok);
-char *name2value(char *str, const char *name);
-uint32_t name2u32(char *str, const char *name);
-uint64_t name2u64(char *str, const char *name);
-
-
-#endif /* __GFS_TOOL_DOT_H__ */
diff --git a/gfs/gfs_tool/layout.c b/gfs/gfs_tool/layout.c
deleted file mode 100644
index ad6411d..0000000
--- a/gfs/gfs_tool/layout.c
+++ /dev/null
@@ -1,845 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#define __user
-#include "gfs_ioctl.h"
-#include "gfs_ondisk.h"
-
-#include "osi_list.h"
-#include "linux_endian.h"
-
-#include "gfs_tool.h"
-
-#define LAYOUT_DATA_QUANTUM (4194304)
-
-struct extent {
-	osi_list_t list;
-
-	uint64_t offset;
-	uint64_t start;
-	unsigned int len;
-};
-typedef struct extent extent_t;
-
-struct buffer {
-	osi_list_t list;
-	uint64_t blkno;
-	char *data;
-
-	int touched;
-};
-typedef struct buffer buffer_t;
-
-struct world {
-	char *buf_data;
-	unsigned int buf_size;
-	int buf_count;
-	osi_list_t blist;
-	osi_list_t elist;
-
-	struct gfs_sb sb;
-	unsigned int diptrs;
-	unsigned int inptrs;
-	unsigned int jbsize;
-	unsigned int hash_bsize;
-	unsigned int hash_ptrs;
-
-	buffer_t *dibh;
-	struct gfs_dinode di;
-};
-typedef struct world world_t;
-
-typedef void (*pointer_call_t) (world_t *w,
-				unsigned int height, uint64_t bn, void *data);
-typedef void (*leaf_call_t) (world_t *w,
-			     uint32_t index, uint32_t len, uint64_t leaf_no,
-			     void *data);
-
-/**
- * build_list - build a list of buffer_t's to represent the data from the kernel
- * @w: the world structure
- *
- */
-
-static void
-build_list(world_t *w)
-{
-	buffer_t *b;
-	unsigned int x;
-
-	for (x = 0; x < w->buf_count; x += sizeof(uint64_t) + w->sb.sb_bsize) {
-		b = malloc(sizeof(buffer_t));
-		if (!b)
-			die("out of memory\n");
-
-		memset(b, 0, sizeof(buffer_t));
-
-		b->blkno = *(uint64_t *) (w->buf_data + x);
-		b->data = w->buf_data + x + sizeof(uint64_t);
-
-		osi_list_add_prev(&b->list, &w->blist);
-	}
-
-	if (x != w->buf_count)
-		die("the kernel passed back unaligned data\n");
-}
-
-/**
- * check_list - check the buffers passed back by the kernel
- * @w: the world
- *
- */
-
-static void
-check_list(world_t *w)
-{
-	osi_list_t *tmp;
-	buffer_t *b;
-	struct gfs_meta_header mh;
-	const char *type;
-
-	for (tmp = w->blist.next; tmp != &w->blist; tmp = tmp->next) {
-		b = osi_list_entry(tmp, buffer_t, list);
-
-		gfs_meta_header_in(&mh, b->data);
-
-		if (mh.mh_magic != GFS_MAGIC)
-			die("bad magic number on block\n");
-
-		switch (mh.mh_type) {
-		case GFS_METATYPE_DI:
-			type = "GFS_METATYPE_DI";
-
-			if (w->dibh)
-				die("more than one dinode in file\n");
-			else {
-				w->dibh = b;
-				gfs_dinode_in(&w->di, b->data);
-
-				b->touched = TRUE;
-			}
-
-			break;
-		case GFS_METATYPE_IN:
-			type = "GFS_METATYPE_IN";
-			break;
-		case GFS_METATYPE_LF:
-			type = "GFS_METATYPE_LF";
-			break;
-		case GFS_METATYPE_JD:
-			type = "GFS_METATYPE_JD";
-			break;
-		case GFS_METATYPE_EA:
-			type = "GFS_METATYPE_EA";
-			break;
-		case GFS_METATYPE_ED:
-			die("GFS_METATYPE_ED shouldn't be present\n");
-		default:
-			die("strange meta type\n");
-		}
-	}
-
-	if (!w->dibh)
-		die("no dinode\n");
-}
-
-/**
- * getbuf - get the buffer_t for a given block number
- * @w: the world
- * @blkno: the block number
- *
- * Returns: the buffer_t
- */
-
-static buffer_t *
-getbuf(world_t *w, uint64_t blkno)
-{
-	osi_list_t *tmp;
-	buffer_t *b;
-
-	for (tmp = w->blist.next; tmp != &w->blist; tmp = tmp->next) {
-		b = osi_list_entry(tmp, buffer_t, list);
-		if (b->blkno == blkno) {
-			osi_list_del(&b->list);
-			osi_list_add(&b->list, &w->blist);
-
-			b->touched = TRUE;
-
-			return b;
-		}
-	}
-
-	die("buffer not found\n");
-}
-
-/**
- * recursive_scan - call a function for each block pointer in a file
- * @w: the world
- * @height: the height of the block being pointed to
- * @block: the block being pointed to
- * @pc: the function to call
- * @data: private data for the @pc function
- *
- */
-
-static void
-recursive_scan(world_t *w,
-	       unsigned int height, uint64_t block, pointer_call_t pc, void *data)
-{
-	buffer_t *b = NULL;
-	uint64_t *top, *bottom;
-	uint64_t bn;
-
-	if (!height) {
-		b = w->dibh;
-
-		top = (uint64_t *) (b->data + sizeof(struct gfs_dinode));
-		bottom =
-		    (uint64_t *) (b->data + sizeof(struct gfs_dinode)) +
-		    w->diptrs;
-	} else {
-		b = getbuf(w, block);
-
-		top = (uint64_t *) (b->data + sizeof(struct gfs_indirect));
-		bottom =
-		    (uint64_t *) (b->data + sizeof(struct gfs_indirect)) +
-		    w->inptrs;
-	}
-
-	for (; top < bottom; top++) {
-		bn = gfs64_to_cpu(*top);
-
-		pc(w, height, bn, data);
-
-		if (bn && height < w->di.di_height - 1)
-			recursive_scan(w, height + 1, bn, pc, data);
-	}
-}
-
-/**
- * bmap - return the buffer_t for a given logical block in the file
- * @w: the world
- * @lbn: the logical block number
- *
- * Returns: the buffer_t
- */
-
-static buffer_t *
-bmap(world_t *w, uint64_t lbn)
-{
-	osi_list_t *tmp;
-	extent_t *e;
-
-	for (tmp = w->elist.next; tmp != &w->elist; tmp = tmp->next) {
-		e = osi_list_entry(tmp, extent_t, list);
-
-		if (e->offset <= lbn && lbn < e->offset + e->len)
-			return getbuf(w, e->start + lbn - e->offset);
-	}
-
-	return NULL;
-}
-
-/**
- * journaled_read - read some of the contents of a journaled file
- * @w: the world
- * @buf: the buffer to read into
- * @offset: the offset to read from
- * @size: the number of bytes to read
- *
- */
-
-static void
-journaled_read(world_t *w, char *buf, uint64_t offset, unsigned int size)
-{
-	buffer_t *b;
-	uint64_t lbn;
-	unsigned int o, chunk;
-
-	if (!(w->di.di_flags & GFS_DIF_JDATA))
-		die("not a journaled file\n");
-
-	if (!w->di.di_height) {
-		if (offset >= w->sb.sb_bsize - sizeof(struct gfs_dinode))
-			memset(buf, 0, size);
-		else {
-			chunk =
-			    w->sb.sb_bsize - sizeof(struct gfs_dinode) -
-			    offset;
-			if (chunk > size)
-				chunk = size;
-			memcpy(buf,
-			       w->dibh->data + sizeof(struct gfs_dinode) +
-			       offset, chunk);
-			if (chunk < size)
-				memset(buf + chunk, 0, size - chunk);
-		}
-	} else
-		while (size) {
-			lbn = offset / w->jbsize;
-			o = offset % w->jbsize;
-			chunk = (size > w->jbsize - o) ? (w->jbsize - o) : size;
-
-			b = bmap(w, lbn);
-			if (b)
-				memcpy(buf,
-				       b->data +
-				       sizeof(struct gfs_meta_header) + o,
-				       chunk);
-			else
-				memset(buf, 0, chunk);
-
-			buf += chunk;
-			offset += chunk;
-			size -= chunk;
-		}
-}
-
-/**
- * foreach_leaf - call a function for each leaf in a directory
- * @w: the world
- * @lc: the function to call for each each
- * @data: private data to pass to it
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static void
-foreach_leaf(world_t *w, leaf_call_t lc, void *data)
-{
-	buffer_t *b;
-	struct gfs_leaf leaf;
-	uint32_t hsize, len;
-	uint32_t ht_offset, lp_offset, ht_offset_cur = -1;
-	uint32_t lindex = 0;
-	uint64_t lp[w->hash_ptrs];
-	uint64_t leaf_no;
-
-	hsize = 1 << w->di.di_depth;
-	if (hsize * sizeof(uint64_t) != w->di.di_size)
-		die("bad hash table size\n");
-
-	while (lindex < hsize) {
-		lp_offset = lindex % w->hash_ptrs;
-		ht_offset = lindex - lp_offset;
-
-		if (ht_offset_cur != ht_offset) {
-			journaled_read(w, (char *) lp,
-				       ht_offset * sizeof(uint64_t),
-				       w->hash_bsize);
-			ht_offset_cur = ht_offset;
-		}
-
-		leaf_no = gfs64_to_cpu(lp[lp_offset]);
-		if (!leaf_no)
-			die("NULL leaf pointer\n");
-
-		b = getbuf(w, leaf_no);
-		gfs_leaf_in(&leaf, b->data);
-
-		len = 1 << (w->di.di_depth - leaf.lf_depth);
-
-		lc(w, lindex, len, leaf_no, data);
-
-		lindex += len;
-	}
-
-	if (lindex != hsize)
-		die("screwed up directory\n");
-}
-
-/**
- * add_extent - add an extend to the list of the file's data extents
- * @w: the world
- * @offset: the starting logical block of the extent
- * @start: the starting disk block of the extent
- * @len: the number of blocks in the extent
- *
- */
-
-static void
-add_extent(world_t *w, uint64_t offset, uint64_t start, unsigned int len)
-{
-	extent_t *e;
-
-	e = malloc(sizeof(extent_t));
-	if (!e)
-		die("out of memory\n");
-
-	memset(e, 0, sizeof(extent_t));
-
-	e->offset = offset;
-	e->start = start;
-	e->len = len;
-
-	osi_list_add_prev(&e->list, &w->elist);
-}
-
-struct do_pf_s {
-	unsigned int height;
-	uint64_t offset;
-	uint64_t start;
-	uint64_t skip;
-	unsigned int len;
-};
-typedef struct do_pf_s do_pf_t;
-
-/**
- * do_pf: called for every pointer in the file (prints/collects extent info)
- * @w: the world
- * @height: the height of the block containing the pointer
- * @bn: the contents of the pointer
- * @data: a do_pf_t structure
- *
- */
-
-static void
-do_pf(world_t *w, unsigned int height, uint64_t bn, void *data)
-{
-	do_pf_t *pf = (do_pf_t *) data;
-	unsigned int x;
-	uint64_t skip;
-
-	if (pf->height < height + 1)
-		return;
-
-	if (!bn) {
-		if (pf->height == height + 1)
-			pf->skip++;
-		else {
-			x = pf->height - height - 1;
-			skip = w->inptrs;
-			while (--x)
-				skip *= w->inptrs;
-			pf->skip += skip;
-		}
-
-		return;
-	}
-
-	if (pf->height == height + 1) {
-		if (pf->start + pf->len == bn && pf->len == pf->skip) {
-			pf->len++;
-			pf->skip++;
-		} else {
-			if (pf->start) {
-				printf("  %-20" PRIu64 " %-20" PRIu64 " %-20"
-				       PRIu64 " %u\n", pf->offset,
-				       pf->offset + pf->len - 1, pf->start,
-				       pf->len);
-				if (pf->height == w->di.di_height)
-					add_extent(w, pf->offset, pf->start,
-						   pf->len);
-			}
-
-			pf->offset += pf->skip;
-			pf->start = bn;
-			pf->len = 1;
-			pf->skip = 1;
-		}
-	}
-}
-
-/**
- * print_file - print out the extent lists for all the heights of a file
- * @w: the world
- *
- */
-
-static void
-print_file(world_t *w)
-{
-	do_pf_t pf;
-	unsigned int h;
-	const char *type;
-
-	switch (w->di.di_type) {
-	case GFS_FILE_REG:
-		type = "File";
-		break;
-	case GFS_FILE_DIR:
-		type = "Directory";
-		break;
-	case GFS_FILE_LNK:
-		type = "Symbolic Link";
-		break;
-	case GFS_FILE_BLK:
-		type = "Block Device";
-		break;
-	case GFS_FILE_CHR:
-		type = "Character Device";
-		break;
-	case GFS_FILE_FIFO:
-		type = "FIFO";
-		break;
-	case GFS_FILE_SOCK:
-		type = "Socket";
-		break;
-	default:
-		die("strange file type\n");
-	};
-
-	printf("%s dinode:\n", type);
-	printf("  %" PRIu64 "\n", w->di.di_num.no_addr);
-
-	if (!w->di.di_height) {
-		if (w->di.di_type == GFS_FILE_DIR) {
-			if (w->di.di_flags & GFS_DIF_EXHASH)
-				printf("\nStuffed hash table\n");
-		} else
-			printf("\nStuffed file data\n");
-
-		return;
-	}
-
-	for (h = 1; h <= w->di.di_height; h++) {
-		if (w->di.di_type == GFS_FILE_DIR)
-			type =
-			    (h == w->di.di_height) ? "hash table" : "indirect";
-		else
-			type = (h == w->di.di_height) ? "data" : "indirect";
-
-		printf("\n");
-		printf("At height %u (%s):\n", h, type);
-		printf("  %-20s %-20s %-20s %s\n",
-		       "From LBlock", "To LBlock", "DBlock", "Blocks");
-
-		memset(&pf, 0, sizeof(do_pf_t));
-		pf.height = h;
-
-		recursive_scan(w, 0, 0, do_pf, &pf);
-
-		if (pf.start) {
-			printf("  %-20" PRIu64 " %-20" PRIu64 " %-20" PRIu64
-			       " %u\n", pf.offset, pf.offset + pf.len - 1,
-			       pf.start, pf.len);
-			if (h == w->di.di_height)
-				add_extent(w, pf.offset, pf.start, pf.len);
-		}
-	}
-}
-
-/**
- * do_lc - print out info about a leaf block
- * @w: the world
- * @index: the index of the leaf
- * @len: the number of pointers to the leaf
- * @leaf_no: the leaf block number
- * @data: unused
- *
- */
-
-static void
-do_lc(world_t *w, uint32_t lindex, uint32_t len, uint64_t leaf_no, void *data)
-{
-	buffer_t *b;
-	struct gfs_leaf leaf;
-	uint64_t blk;
-
-	for (blk = leaf_no; blk; blk = leaf.lf_next) {
-		b = getbuf(w, blk);
-		gfs_leaf_in(&leaf, b->data);
-
-		printf("  %.8X             %.8X             %-20" PRIu64
-		       " %u\n", lindex << (32 - w->di.di_depth),
-		       ((lindex + len) << (32 - w->di.di_depth)) - 1, blk,
-		       leaf.lf_entries);
-	}
-
-}
-
-/**
- * print_leaves - print out the location of the exhash leaves
- * @w: the world
- *
- */
-
-static void
-print_leaves(world_t *w)
-{
-	printf("\n");
-
-	if (w->di.di_flags & GFS_DIF_EXHASH) {
-		printf("Leaves:\n");
-		printf("  %-20s %-20s %-20s %s\n",
-		       "From Hash", "To Hash", "DBlock", "Entries");
-		foreach_leaf(w, do_lc, NULL);
-	} else
-		printf("Stuffed directory data\n");
-}
-
-/**
- * print_eattr_data - print out the locations of the eattr data blocks
- * @w: the world
- *
- */
-
-#define MAKE_MULT8(x) (((x) + 7) & ~7)
-#define GFS_EA_REC_LEN(ea) gfs32_to_cpu((ea)->ea_rec_len)
-#define GFS_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs)
-#define GFS_EA_IS_LAST(ea) ((ea)->ea_flags & GFS_EAFLAG_LAST)
-#define GFS_EA2NAME(ea) ((char *)((struct gfs_ea_header *)(ea) + 1))
-#define GFS_EA2DATAPTRS(ea) \
-((uint64_t *)(GFS_EA2NAME(ea) + MAKE_MULT8((ea)->ea_name_len)))
-#define GFS_EA2NEXT(ea) \
-((struct gfs_ea_header *)((char *)(ea) + GFS_EA_REC_LEN(ea)))
-#define GFS_EA_BH2FIRST(b) \
-((struct gfs_ea_header *)((b)->data + \
-			  sizeof(struct gfs_meta_header)))
-
-static void
-print_eattr_data(world_t *w, uint64_t eblkno, int *first)
-{
-	struct gfs_ea_header *ea;
-
-	ea = GFS_EA_BH2FIRST(getbuf(w, eblkno));
-	for (;;) {
-		if (!GFS_EA_IS_STUFFED(ea)) {
-			char name[300];
-			uint64_t *p, blkno;
-			uint64_t d;
-			unsigned int l;
-			unsigned int x;
-			int c;
-
-			if (*first) {
-				printf("\nExtended Attributes data blocks:\n");
-				printf("  %-20s %-10s %s\n",
-				       "DBlock", "Blocks", "Name");
-				*first = FALSE;
-			}
-
-			if (ea->ea_type == GFS_EATYPE_UNUSED)
-				strcpy(name, "unused");
-			else {
-				switch (ea->ea_type) {
-				case GFS_EATYPE_USR:
-					strcpy(name, "user.");
-					break;
-				case GFS_EATYPE_SYS:
-					strcpy(name, "system.");
-					break;
-				default:
-					strcpy(name, "unknown.");
-					break;
-				}
-				x = strlen(name);
-				memcpy(name + x,
-				       GFS_EA2NAME(ea), ea->ea_name_len);
-				name[x + ea->ea_name_len] = 0;
-			}
-
-			d = 0;
-			l = 0;
-			x = 0;
-			c = FALSE;
-
-			p = GFS_EA2DATAPTRS(ea);
-			for (x = 0; x < ea->ea_num_ptrs; x++) {
-				blkno = gfs64_to_cpu(*p);
-				if (d + l == blkno)
-					l++;
-				else {
-					if (d) {
-						printf("  %-20" PRIu64
-						       " %-10u %s\n", d, l,
-						       name);
-						if (!c) {
-							strcat(name, " (cont)");
-							c = TRUE;
-						}
-					}
-					d = blkno;
-					l = 1;
-				}
-				p++;
-			}
-			printf("  %-20" PRIu64 " %-10u %s\n", d, l, name);
-		}
-		if (GFS_EA_IS_LAST(ea))
-			break;
-		ea = GFS_EA2NEXT(ea);
-	}
-}
-
-/**
- * print_eattr - print out the locations of the eattr blocks
- * @w: the world
- *
- */
-
-static void
-print_eattr(world_t *w)
-{
-	int first = TRUE;
-
-	if (w->di.di_flags & GFS_DIF_EA_INDIRECT) {
-		buffer_t *b = getbuf(w, w->di.di_eattr);
-		uint64_t *blkno;
-		unsigned int x;
-
-		printf("\nExtended Attribute indirect block:\n");
-		printf("  %" PRIu64 "\n", w->di.di_eattr);
-
-		printf("\nExtended Attribute blocks:\n");
-		blkno = (uint64_t *) (b->data + sizeof(struct gfs_indirect));
-		for (x = 0; x < w->inptrs; x++) {
-			if (!*blkno)
-				break;
-			printf("  %" PRIu64 "\n", gfs64_to_cpu(*blkno));
-			blkno++;
-		}
-
-		blkno = (uint64_t *) (b->data + sizeof(struct gfs_indirect));
-		for (x = 0; x < w->inptrs; x++) {
-			if (!*blkno)
-				break;
-			print_eattr_data(w, gfs64_to_cpu(*blkno), &first);
-			blkno++;
-		}
-	} else {
-		printf("\nExtended Attribute block:\n");
-		printf("  %" PRIu64 "\n", w->di.di_eattr);
-
-		print_eattr_data(w, w->di.di_eattr, &first);
-	}
-}
-
-/**
- * check_for_untouched_buffers - 
- * @w: the world
- *
- */
-
-static void
-check_for_untouched_buffers(world_t *w)
-{
-	osi_list_t *tmp;
-	buffer_t *b;
-
-	for (tmp = w->blist.next; tmp != &w->blist; tmp = tmp->next) {
-		b = osi_list_entry(tmp, buffer_t, list);
-		if (b->touched)
-			continue;
-
-		printf("Buffer %" PRIu64 " untouched\n", b->blkno);
-	}
-}
-
-/**
- * print_layout - print out the ondisk layout of a file
- * @argc:
- * @argv:
- *
- */
-
-void
-print_layout(int argc, char **argv)
-{
-	world_t w;
-	char *path;
-	int fd;
-	int retry = TRUE;
-	struct gfs_ioctl gi;
-	int error;
-
-	memset(&w, 0, sizeof(world_t));
-	w.buf_size = LAYOUT_DATA_QUANTUM;
-	osi_list_init(&w.blist);
-	osi_list_init(&w.elist);
-
-	if (optind == argc)
-		die("Usage: gfs_tool layout <filename> [buffersize]\n");
-
-	path = argv[optind++];
-	if (optind < argc ) {
-		w.buf_size = atoi(argv[3]);
-		retry = FALSE;
-	}
-
-	fd = open(path, O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", path, strerror(errno));
-
-	check_for_gfs(fd, path);
-
-	{
-		char *local_argv[] = {
-			(char *)"get_super"
-		};
-
-		gi.gi_argc = 1;
-		gi.gi_argv = local_argv;
-		gi.gi_data = (char *)&w.sb;
-		gi.gi_size = sizeof(struct gfs_sb);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_super (%d): %s\n",
-			    error, strerror(errno));
-	}
-
-	w.diptrs = (w.sb.sb_bsize - sizeof(struct gfs_dinode)) /
-		sizeof(uint64_t);
-	w.inptrs = (w.sb.sb_bsize - sizeof(struct gfs_indirect)) /
-		sizeof(uint64_t);
-	w.jbsize = w.sb.sb_bsize - sizeof(struct gfs_meta_header);
-	w.hash_bsize = w.sb.sb_bsize / 2;
-	w.hash_ptrs = w.hash_bsize / sizeof(uint64_t);
-
-	for (;;) {
-		char *local_argv[] = {
-			(char *)"get_file_meta"
-		};
-
-		w.buf_data = malloc(w.buf_size);
-		if (!w.buf_data)
-			die("out of memory\n");
-
-		gi.gi_argc = 1;
-		gi.gi_argv = local_argv;
-		gi.gi_data = w.buf_data;
-		gi.gi_size = w.buf_size;
-
-		w.buf_count = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (w.buf_count >= 0)
-			break;
-
-		if (errno == ENOMEM) {
-			if (retry) {
-				free(w.buf_data);
-				w.buf_size += LAYOUT_DATA_QUANTUM;
-				continue;
-			} else
-				die("%u bytes isn't enough memory\n",
-				    w.buf_size);
-		}
-		die("error doing get_file_meta: %s\n",
-		    strerror(errno));
-	}
-
-	build_list(&w);
-	check_list(&w);
-
-	print_file(&w);
-
-	if (w.di.di_type == GFS_FILE_DIR)
-		print_leaves(&w);
-
-	if (w.di.di_eattr)
-		print_eattr(&w);
-
-	check_for_untouched_buffers(&w);
-
-	close(fd);
-}
diff --git a/gfs/gfs_tool/main.c b/gfs/gfs_tool/main.c
deleted file mode 100644
index 03b88d5..0000000
--- a/gfs/gfs_tool/main.c
+++ /dev/null
@@ -1,274 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#include "copyright.cf"
-
-#include "gfs_tool.h"
-
-char *prog_name;
-char *action = NULL;
-int override = FALSE;
-int expert = FALSE;
-int debug = FALSE;
-int continuous = FALSE;
-int interval = 1;
-int output_type = OUTPUT_BLOCKS;
-
-static const char *usage[] = {
-	"Clear a flag on a inode\n",
-	"  gfs_tool clearflag flag <filenames>\n",
-	"\n",
-	"Print the counters for a filesystem\n",
-	"  gfs_tool counters <mountpoint>\n",
-	"\n",
-	"Do a GFS specific \"df\"\n",
-	"  gfs_tool df <mountpoint>\n",
-	"\n",
-	"Force files from a machine's cache\n",
-	"  gfs_tool flush <filenames>\n",
-	"\n",
-	"Freeze a GFS cluster:\n",
-	"  gfs_tool freeze <mountpoint>\n",
-	"\n",
-	"Print the superblock of a mounted filesystem:\n",
-	"  gfs_tool getsb <mountpoint>\n",
-	"\n",
-	"Get tuneable parameters for a filesystem\n",
-	"  gfs_tool gettune <mountpoint>\n",
-	"\n",
-	"Print the journal index of a mounted filesystem:\n",
-	"  gfs_tool jindex <mountpoint>\n",
-	"\n",
-	"Print out the ondisk layout for a file:\n",
-	"  gfs_tool layout <filename> [buffersize]\n",
-	"\n",
-	"List filesystems:\n",
-	"  gfs_tool list\n",
-	"\n",
-	"Have GFS dump its lock state:\n",
-	"  gfs_tool lockdump <mountpoint> [buffersize]\n",
-	"\n",
-	"Provide arguments for next mount:\n",
-	"  gfs_tool margs <mountarguments>\n",
-	"\n",
-	"Print the quota file of a mounted filesystem:\n",
-	"  gfs_tool quota <mountpoint>\n",
-	"\n",
-	"Free unused disk inodes:\n",
-	"  gfs_tool reclaim <mountpoint>\n",
-	"\n",
-	"Print the resource group index of a mounted filesystem:\n",
-	"  gfs_tool rindex <mountpoint>\n",
-	"\n",
-	"Tune a GFS superblock\n",
-	"  gfs_tool sb <device> proto [newval]\n",
-	"  gfs_tool sb <device> table [newval]\n",
-	"  gfs_tool sb <device> ondisk [newval]\n",
-	"  gfs_tool sb <device> multihost [newval]\n",
-	"  gfs_tool sb <device> all\n",
-	"\n",
-	"Set a flag on a inode\n",
-	"  gfs_tool setflag flag <filenames>\n",
-	"\n",
-	"Tune a running filesystem\n",
-	"  gfs_tool settune <mountpoint> <parameter> <value>\n",
-	"\n",
-	"Shrink a filesystem's inode cache:\n",
-	"  gfs_tool shrink <mountpoint>\n",
-	"\n",
-	"Print file stat data:\n",
-	"  gfs_tool stat <filename>\n",
-	"\n",
-	"Unfreeze a GFS cluster:\n",
-	"  gfs_tool unfreeze <mountpoint>\n",
-	"\n",
-	"Print tool version information\n",
-	"  gfs_tool version\n",
-	"\n",
-	"Withdraw this machine from participating in a filesystem:\n",
-	"  gfs_tool withdraw <mountpoint>\n",
-	"",
-};
-
-/**
- * print_usage - print out usage information
- *
- */
-
-void
-print_usage(void)
-{
-	int x;
-
-	for (x = 0; usage[x][0]; x++)
-		printf("%s", usage[x]);
-}
-
-/**
- * print_version -
- *
- */
-
-static void
-print_version(void)
-{
-	printf("gfs_tool %s (built %s %s)\n",
-	       RELEASE_VERSION,
-	       __DATE__, __TIME__);
-	printf("%s\n",
-	       REDHAT_COPYRIGHT);
-}
-
-/**
- * decode_arguments -
- * @argc:
- * @argv:
- *
- */
-
-static void
-decode_arguments(int argc, char *argv[])
-{
-	int cont = TRUE;
-	int optchar;
-
-	output_type = OUTPUT_BLOCKS;
-	while (cont) {
-		optchar = getopt(argc, argv, "cDhHki:OVX");
-
-		switch (optchar) {
-		case 'c':
-			continuous = TRUE;
-			break;
-
-		case 'D':
-			debug = TRUE;
-			break;
-
-		case 'h':
-			print_usage();
-			exit(EXIT_SUCCESS);
-
-		case 'H':
-			output_type = OUTPUT_HUMAN;
-			break;
-
-		case 'i':
-			sscanf(optarg, "%u", &interval);
-			break;
-
-		case 'k':
-			output_type = OUTPUT_K;
-			break;
-
-		case 'O':
-			override = TRUE;
-			break;
-
-		case 'V':
-			print_version();
-			exit(EXIT_SUCCESS);
-
-		case 'X':
-			expert = TRUE;
-			break;
-
-		case EOF:
-			cont = FALSE;
-			break;
-
-		default:
-			die("unknown option: %c\n", optchar);
-		};
-	}
-
-	if (optind < argc) {
-		action = argv[optind];
-		optind++;
-	} else
-		die("no action specified\n");
-}
-
-/**
- * main - Do everything
- * @argc:
- * @argv:
- *
- */
-
-int
-main(int argc, char *argv[])
-{
-	prog_name = argv[0];
-
-	if (argc < 2) {
-		print_usage();
-		exit(EXIT_SUCCESS);
-	}
-
-	decode_arguments(argc, argv);
-
-	if (FALSE) {
-		/* Do Nothing */
-	} else if (strcmp(action, "clearflag") == 0)
-		set_flag(argc, argv);
-	else if (strcmp(action, "counters") == 0)
-		print_counters(argc, argv);
-	else if (strcmp(action, "df") == 0)
-		print_df(argc, argv);
-	else if (strcmp(action, "flush") == 0)
-		do_file_flush(argc, argv);
-	else if (strcmp(action, "freeze") == 0)
-		do_freeze(argc, argv);
-	else if (strcmp(action, "getsb") == 0)
-		print_sb(argc, argv);
-	else if (strcmp(action, "gettune") == 0)
-		get_tune(argc, argv);
-	else if (strcmp(action, "jindex") == 0)
-		print_jindex(argc, argv);
-	else if (strcmp(action, "layout") == 0)
-		print_layout(argc, argv);
-	else if (strcmp(action, "list") == 0)
-		print_list();
-	else if (strcmp(action, "lockdump") == 0)
-		print_lockdump(argc, argv);
-	else if (strcmp(action, "margs") == 0)
-		margs(argc, argv);
-	else if (strcmp(action, "quota") == 0)
-		print_quota(argc, argv);
-	else if (strcmp(action, "reclaim") == 0)
-		reclaim_metadata(argc, argv);
-	else if (strcmp(action, "rindex") == 0)
-		print_rindex(argc, argv);
-	else if (strcmp(action, "sb") == 0)
-		do_sb(argc, argv);
-	else if (strcmp(action, "setflag") == 0)
-		set_flag(argc, argv);
-	else if (strcmp(action, "settune") == 0)
-		set_tune(argc, argv);
-	else if (strcmp(action, "shrink") == 0)
-		do_shrink(argc, argv);
-	else if (strcmp(action, "stat") == 0)
-		print_stat(argc, argv);
-	else if (strcmp(action, "unfreeze") == 0)
-		do_freeze(argc, argv);
-	else if (strcmp(action, "version") == 0)
-		print_version();
-	else if (strcmp(action, "withdraw") == 0)
-		do_withdraw(argc, argv);
-	else
-		die("unknown action: %s\n",
-		    action);
-
-	exit(EXIT_SUCCESS);
-}
diff --git a/gfs/gfs_tool/misc.c b/gfs/gfs_tool/misc.c
deleted file mode 100644
index 08b14d2..0000000
--- a/gfs/gfs_tool/misc.c
+++ /dev/null
@@ -1,755 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#define __user
-#include "gfs_ioctl.h"
-#include "gfs_ondisk.h"
-
-#include "gfs_tool.h"
-
-/**
- * do_file_flush - 
- * @argc:
- * @argv:
- *
- */
-
-void
-do_file_flush(int argc, char **argv)
-{
-	char *gi_argv[] = {
-		(char *)"do_file_flush"
-	};
-	struct gfs_ioctl gi;
-	int fd;
-	int error;
-
-	if (optind == argc)
-		die("Usage: gfs_tool flush <filenames>\n");
-
-	gi.gi_argc = 1;
-	gi.gi_argv = gi_argv;
-
-	for (; optind < argc; optind++) {
-		fd = open(argv[optind], O_RDONLY);
-		if (fd < 0)
-			die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-		check_for_gfs(fd, argv[optind]);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error)
-			die("error doing do_file_flush (%d): %s\n",
-			    error, strerror(errno));
-
-		close(fd);
-	}
-}
-
-/**
- * do_freeze - freeze a GFS filesystem
- * @argc:
- * @argv:
- *
- */
-
-void
-do_freeze(int argc, char **argv)
-{
-	char *command = argv[optind - 1];
-	char *cookie;
-	int fd;
-	char buf[256];
-	int x;
-
-	if (optind == argc)
-		die("Usage: gfs_tool %s <mountpoint>\n",
-		    command);
-
-	cookie = mp2cookie(argv[optind], FALSE);
-	x = sprintf(buf, "%s %s\n", command, cookie);
-
-	fd = open("/proc/fs/gfs", O_RDWR);
-	if (fd < 0)
-		die("can't open /proc/fs/gfs: %s\n",
-		    strerror(errno));
-
-	if (write(fd, buf, x) != x)
-		die("can't write %s command: %s\n",
-		    command, strerror(errno));
-	if (read(fd, buf, 256))
-		die("can't %s %s: %s\n",
-		    command, argv[optind], strerror(errno));
-
-	close(fd);
-	sync();
-}
-
-/**
- * print_lockdump -
- * @argc:
- * @argv:
- *
- */
-
-void
-print_lockdump(int argc, char **argv)
-{
-	int fd;
-	char *mp, *cookie;
-	unsigned int size = 4194304;
-	char *data;
-	char command[256];
-	int retry = TRUE;
-	int x, count;
-
-
-	if (optind < argc)
-		mp = argv[optind++];
-	else
-		die("Usage: gfs_tool lockdump <mountpoint> [buffersize]\n");
-
-	if (optind < argc) {
-		sscanf(argv[optind++], "%u", &size);
-		retry = FALSE;
-	}
-
-	cookie = mp2cookie(mp, FALSE);
-	x = sprintf(command, "lockdump %s\n", cookie);
-
-
-	fd = open("/proc/fs/gfs", O_RDWR);
-	if (fd < 0)
-		die("can't open /proc/fs/gfs: %s\n",
-		    strerror(errno));
-
-	for (;;) {
-		data = malloc(size);
-		if (!data)
-			die("out of memory\n");
-
-		if (write(fd, command, x) != x)
-			die("can't write lockdump command: %s\n",
-			    strerror(errno));
-		count = read(fd, data, size);
-		if (count >= 0)
-			break;
-
-		if (errno == ENOMEM) {
-			if (retry) {
-				free(data);
-				size += 4194304;
-				continue;
-			} else
-				die("%u bytes isn't enough memory\n", size);
-		}
-		die("error doing lockdump: %s\n",
-		    strerror(errno));
-	}
-
-	close(fd);
-
-
-	x = write(STDOUT_FILENO, data, count);
-
-	free(data);
-}
-
-/**
- * margs -
- * @argc:
- * @argv:
- *
- */
-
-void
-margs(int argc, char **argv)
-{
-	int fd;
-	char *buf;
-	unsigned int x;
-
-	if (optind == argc)
-		die("Usage: gfs_tool margs <mountarguments>\n");
-
-	x = strlen(argv[optind]) + 7;
-	buf = malloc(x + 1);
-	if (!buf)
-		die("out of memory\n");
-	sprintf(buf, "margs %s\n", argv[optind]);
-
-	fd = open("/proc/fs/gfs", O_RDWR);
-	if (fd < 0)
-		die("can't open /proc/fs/gfs: %s\n",
-		    strerror(errno));
- 
-	if (write(fd, buf, x) != x)
-		die("can't write margs command: %s\n",
-		    strerror(errno));
-	if (read(fd, buf, x))
-		die("can't set mount args: %s\n",
-		    strerror(errno));
-
-	close(fd);
-}
-
-/**
- * print_flags - print the flags in a dinode's di_flags field
- * @di: the dinode structure
- *
- */
-
-static void
-print_flags(struct gfs_dinode *di)
-{
-	if (di->di_flags) {
-		printf("Flags:\n");
-		if (di->di_flags & GFS_DIF_JDATA)
-			printf("  jdata\n");
-		if (di->di_flags & GFS_DIF_EXHASH)
-			printf("  exhash\n");
-		if (di->di_flags & GFS_DIF_UNUSED)
-			printf("  unused\n");
-		if (di->di_flags & GFS_DIF_EA_INDIRECT)
-			printf("  ea_indirect\n");
-		if (di->di_flags & GFS_DIF_DIRECTIO)
-			printf("  directio\n");
-		if (di->di_flags & GFS_DIF_IMMUTABLE)
-			printf("  immutable\n");
-		if (di->di_flags & GFS_DIF_APPENDONLY)
-			printf("  appendonly\n");
-#if 0
-		if (di->di_flags & GFS_DIF_NOATIME)
-			printf("  noatime\n");
-		if (di->di_flags & GFS_DIF_SYNC)
-			printf("  sync\n");
-#endif
-		if (di->di_flags & GFS_DIF_INHERIT_DIRECTIO)
-			printf("  inherit_directio\n");
-		if (di->di_flags & GFS_DIF_INHERIT_JDATA)
-			printf("  inherit_jdata\n");
-	}
-}
-
-/**
- * set_flag - set or clear flags in some dinodes
- * @argc:
- * @argv:
- *
- */
-
-void
-set_flag(int argc, char **argv)
-{
-	struct gfs_dinode di;
-	const char *set;
-	char *flag;
-	struct gfs_ioctl gi;
-	int fd;
-	int error;
-
-	if (optind == argc) {
-		di.di_flags = 0xFFFFFFFF;
-		print_flags(&di);
-		return;
-	}
-
-	set = (strcmp(argv[optind - 1], "setflag") == 0) ? "set" : "clear";
-	flag = argv[optind++];
-
-	for (; optind < argc; optind++) {
-		fd = open(argv[optind], O_RDONLY);
-		if (fd < 0)
-			die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-		check_for_gfs(fd, argv[optind]);
-
-		{
-			char *gi_argv[] = {
-				(char *)"set_file_flag",
-				(char *)set,
-				(char *)flag
-			};
-			gi.gi_argc = 3;
-			gi.gi_argv = gi_argv;
-
-			error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-			if (error)
-				die("can't change flag on %s: %s\n", argv[optind], strerror(errno));
-		}
-
-		close(fd);
-	}
-}
-
-/**
- * print_stat - print out the struct gfs_dinode for a file
- * @argc:
- * @argv:
- *
- */
-
-void
-print_stat(int argc, char **argv)
-{
-	int fd;
-	char *gi_argv[] = {
-		(char *)"get_file_stat"
-	};
-	struct gfs_ioctl gi;
-	struct gfs_dinode di;
-	int error;
-
-	if (optind == argc)
-		die("Usage: gfs_tool stat <filename>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-	gi.gi_argc = 1;
-	gi.gi_argv = gi_argv;
-	gi.gi_data = (char *)&di;
-	gi.gi_size = sizeof(struct gfs_dinode);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size)
-		die("error doing get_file_stat (%d): %s\n",
-		    error, strerror(errno));
-
-	close(fd);
-
-	gfs_dinode_print(&di);
-	printf("\n");
-	print_flags(&di);
-}
-
-/**
- * print_sb - the superblock
- * @argc:
- * @argv:
- *
- */
-
-void
-print_sb(int argc, char **argv)
-{
-	int fd;
-	char *gi_argv[] = {
-		(char *)"get_super"
-	};
-	struct gfs_ioctl gi;
-	struct gfs_sb sb;
-	int error;
-
-	if (optind == argc)
-		die("Usage: gfs_tool getsb <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", argv[optind], strerror(errno));
-	
-	check_for_gfs(fd, argv[optind]);
-
-	gi.gi_argc = 1;
-	gi.gi_argv = gi_argv;
-	gi.gi_data = (char *)&sb;
-	gi.gi_size = sizeof(struct gfs_sb);
-
-	error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-	if (error != gi.gi_size)
-		die("error doing get_super (%d): %s\n",
-		    error, strerror(errno));
-
-	close(fd);
-
-	gfs_sb_print(&sb);
-}
-
-/**
- * print_jindex - print out the journal index
- * @argc:
- * @argv:
- *
- */
-
-void
-print_jindex(int argc, char **argv)
-{
-	int fd;
-	struct gfs_ioctl gi;
-	uint64_t offset;
-	unsigned int x;
-	int error;
-
-
-	if (optind == argc)
-		die("Usage: gfs_tool jindex <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-
-	{
-		char *local_argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"jindex"
-		};
-		struct gfs_dinode di;
-
-		gi.gi_argc = 2;
-		gi.gi_argv = local_argv;
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_hfile_stat (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_dinode_print(&di);
-	}
-
-
-	for (offset = 0, x = 0; ; offset += sizeof(struct gfs_jindex), x++) {
-		char *local_argv[] = {
-			(char *)"do_hfile_read",
-			(char *)"jindex"
-		};
-		char buf[sizeof(struct gfs_jindex)];
-		struct gfs_jindex ji;
-		
-		gi.gi_argc = 2;
-		gi.gi_argv = local_argv;
-		gi.gi_data = buf;
-		gi.gi_size = sizeof(struct gfs_jindex);
-		gi.gi_offset = offset;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (!error)
-			break;
-		if (error != sizeof(struct gfs_jindex))
-			die("error doing do_hfile_read (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_jindex_in(&ji, buf);
-
-		printf("\nJournal %u:\n\n", x);
-		gfs_jindex_print(&ji);
-	}
-
-
-	close(fd);
-}
-
-/**
- * print_rindex - print out the journal index
- * @argc:
- * @argv:
- *
- */
-
-void
-print_rindex(int argc, char **argv)
-{
-	int fd;
-	struct gfs_ioctl gi;
-	uint64_t offset;
-	unsigned int x;
-	int error;
-
-
-	if (optind == argc)
-		die("Usage: gfs_tool rindex <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-
-	{
-		char *local_argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"rindex"
-		};
-		struct gfs_dinode di;
-
-		gi.gi_argc = 2;
-		gi.gi_argv = local_argv;
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_hfile_stat (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_dinode_print(&di);
-	}
-
-
-	for (offset = 0, x = 0; ; offset += sizeof(struct gfs_rindex), x++) {
-		char *local_argv[] = {
-			(char *)"do_hfile_read",
-			(char *)"rindex"
-		};
-		char buf[sizeof(struct gfs_rindex)];
-		struct gfs_rindex ri;
-		
-		gi.gi_argc = 2;
-		gi.gi_argv = local_argv;
-		gi.gi_data = buf;
-		gi.gi_size = sizeof(struct gfs_rindex);
-		gi.gi_offset = offset;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (!error)
-			break;
-		if (error != sizeof(struct gfs_rindex))
-			die("error doing do_hfile_read (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_rindex_in(&ri, buf);
-
-		printf("\nRG %u:\n\n", x);
-		gfs_rindex_print(&ri);
-	}
-
-
-	close(fd);
-}
-
-/**
- * print_quota - print out the journal index
- * @argc:
- * @argv:
- *
- */
-
-void
-print_quota(int argc, char **argv)
-{
-	int fd;
-	struct gfs_ioctl gi;
-	uint64_t offset;
-	unsigned int x;
-	int error;
-
-
-	if (optind == argc)
-		die("Usage: gfs_tool quota <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-
-	{
-		char *local_argv[] = {
-			(char *)"get_hfile_stat",
-			(char *)"quota"
-		};
-		struct gfs_dinode di;
-
-		gi.gi_argc = 2;
-		gi.gi_argv = local_argv;
-		gi.gi_data = (char *)&di;
-		gi.gi_size = sizeof(struct gfs_dinode);
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (error != gi.gi_size)
-			die("error doing get_hfile_stat (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_dinode_print(&di);
-	}
-
-
-	for (offset = 0, x = 0; ; offset += sizeof(struct gfs_quota), x++) {
-		char *local_argv[] = {
-			(char *)"do_hfile_read",
-			(char *)"quota"
-		};
-		char buf[sizeof(struct gfs_quota)];
-		struct gfs_quota q;
-		
-		gi.gi_argc = 2;
-		gi.gi_argv = local_argv;
-		gi.gi_data = buf;
-		gi.gi_size = sizeof(struct gfs_quota);
-		gi.gi_offset = offset;
-
-		error = ioctl(fd, GFS_IOCTL_SUPER, &gi);
-		if (!error)
-			break;
-		if (error != sizeof(struct gfs_quota))
-			die("error doing do_hfile_read (%d): %s\n",
-			    error, strerror(errno));
-
-		gfs_quota_in(&q, buf);
-
-		if (q.qu_limit || q.qu_warn || q.qu_value) {
-			printf("\nQuota %s %u:\n\n", (x & 1) ? "group" : "user", x >> 1);
-			gfs_quota_print(&q);
-		}
-	}
-
-
-	close(fd);
-}
-
-/**
- * print_list - print the list of mounted filesystems
- *
- */
-
-void
-print_list(void)
-{
-	char *list = get_list();
-	printf("%s", list);
-}
-
-/**
- * reclaim_metadata - reclaim unused metadata blocks
- * @argc:
- * @argv:
- *
- * This routine uses an ioctl command to quiesce the cluster and then
- * hunt down and free all disk inodes that have been freed.  This will
- * gain back meta data blocks to be used for data (or metadata) again.
- *
- */
-
-void
-reclaim_metadata(int argc, char **argv)
-{
-	int fd;
-	char *gi_argv[] = {
-		(char *)"do_reclaim"
-	};
-	struct gfs_ioctl gi;
-	char buf[256];
-
-	if (optind == argc)
-		die("Usage: gfs_tool reclaim <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-	if (!override) {
-		printf("Don't do this if this file system is being exported by NFS (on any machine).\n");
-		printf("\nAre you sure you want to proceed? [y/n] ");
-		if (fgets(buf, 255, stdin) == NULL || buf[0] != 'y')
-			die("aborted\n");
-
-		printf("\n");
-	}
-
-	gi.gi_argc = 1;
-	gi.gi_argv = gi_argv;
-	gi.gi_data = buf;
-	gi.gi_size = 256;
-
-	if (ioctl(fd, GFS_IOCTL_SUPER, &gi) < 0)
-		die("error doing do_reclaim: %s\n", strerror(errno));
-
-	close(fd);
-
-	printf("Reclaimed:\n");
-	printf("%s", buf);
-}
-
-/**
- * do_shrink - shrink the inode cache for a filesystem
- * @argc:
- * @argv:
- *
- */
-
-void
-do_shrink(int argc, char **argv)
-{
-	int fd;
-	char *gi_argv[] = {
-		(char *)"do_shrink"
-	};
-	struct gfs_ioctl gi;
-
-	if (optind == argc)
-		die("Usage: gfs_tool shrink <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n",
-		    argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-	gi.gi_argc = 1;
-	gi.gi_argv = gi_argv;
-
-	if (ioctl(fd, GFS_IOCTL_SUPER, &gi))
-		die("error doing ioctl: %s\n",
-		    strerror(errno));
-
-	close(fd);
-}
-
-/**
- * do_withdraw - freeze a GFS filesystem
- * @argc:
- * @argv:
- *
- */
-
-void
-do_withdraw(int argc, char **argv)
-{
-	char *cookie;
-	int fd;
-	char buf[256];
-	int x;
-
-	if (optind == argc)
-		die("Usage: gfs_tool withdraw <mountpoint>\n");
-
-	cookie = mp2cookie(argv[optind], FALSE);
-	x = sprintf(buf, "withdraw %s\n", cookie);
-
-	fd = open("/proc/fs/gfs", O_RDWR);
-	if (fd < 0)
-		die("can't open /proc/fs/gfs: %s\n",
-		    strerror(errno));
-
-	if (write(fd, buf, x) != x)
-		die("can't write withdraw command: %s\n",
-		    strerror(errno));
-	if (read(fd, buf, 256))
-		die("can't withdraw %s: %s\n",
-		    argv[optind], strerror(errno));
-
-	close(fd);
-}
diff --git a/gfs/gfs_tool/ondisk.c b/gfs/gfs_tool/ondisk.c
deleted file mode 100644
index eeda916..0000000
--- a/gfs/gfs_tool/ondisk.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "linux_endian.h"
-#include "gfs_ondisk.h"
-
-#define printk printf
-#define pv(struct, member, fmt) \
-printf("  "#member" = "fmt"\n", struct->member);
-
-#define ENTER(x)
-#define EXIT(x)
-#define RET(x) return
-#define RETURN(x, y) return y
-
-#define WANT_GFS_CONVERSION_FUNCTIONS
-#include "gfs_ondisk.h"
-
-
diff --git a/gfs/gfs_tool/parse_lockdump b/gfs/gfs_tool/parse_lockdump
deleted file mode 100644
index 9e77599..0000000
--- a/gfs/gfs_tool/parse_lockdump
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/perl
-
-&do_input(@ARGV);
-
-print 'Entries:  ', scalar(@gl), "\n";
-print 'Glocks:  ', scalar(keys(%gl)), "\n";
-print 'PIDs:  ', scalar(keys(%pid)), "\n";
-print "\n";
-
-for ($x = 0; $x < @gl; $x++)
-{
-    if (!$done[$x])
-    {
-	@chain = &find_chain($x);
-	$req = 0;
-
-	print scalar(@chain), " chain:\n";
-
-	foreach $y (@chain)
-	{
-	    print $gl[$y];
-	    $req++ if ($gl[$y] =~ /request/i);
-	    $done[$y]++;
-	}
-	
-	print "$req requests\n";
-	print "\n";
-
-	$chains++;
-    }
-}
-
-for ($x = 0; $x < @gl; $x++)
-{
-    die "parse_lockdump: something is hosed\n" unless ($done[$x] == 1);
-}
-
-print "Chains:  $chains\n";
-
-
-
-
-
-sub do_input
-{
-    my(@host) = @_;
-    my($host);
-    local(*FILE);
-    my($line);
-    my($gl);
-
-    foreach $host (@host)
-    {
-	open(FILE, "< $host") || die;
-
-	while ($line = <FILE>)
-	{
-	    if ($line eq "\n")
-	    {
-		&file($host, $gl);
-		$gl = '';
-	    }
-	    else
-	    {
-		$gl .= $line;
-	    }
-	}
-
-	if ($gl ne '')
-	{
-	    &file($host, $gl);
-	    $gl = '';
-	}
-
-	close(FILE);
-    }
-}
-
-
-#  Builds:
-#
-#  @gl:      A list of all the glock sections read in
-#  @name:    Contains the name of the glock of each member of @gl
-#  @pid:     Contains the pids contained in each member of @gl
-#  %gl:      Maps a lockname to the members of @gl that coorespond to that name
-#  %pid:     Maps a pid to the members of @gl that correspond to that pid
-
-sub file
-{
-    my($host, $gl) = @_;
-    my($x);
-    my($name, $pid);
-
-    ($name) = $gl =~ /^Glock (\(.*\))/;
-
-    push(@gl, "$host $gl");
-    $x = @gl - 1;
-    push(@name, $name);
-
-    $gl{$name} .= "$x ";
-
-    foreach (split("\n", $gl))
-    {
-	if (/owner = (\d+)/)
-	{
-	    $pid = "$host:$1";
-
-	    if (!&is_in($pid, split(' ', $pid[$x])))
-	    {
-		$pid[$x] .= "$pid ";
-		$pid{$pid} .= "$x ";
-	    }
-	}
-    }
-}
-
-
-sub find_chain
-{
-    my($x, @chain) = @_;
-    my($y, $z);
-    my($name, $pid);
-
-    $name = $name[$x];
-
-    foreach $y (split(' ', $gl{$name}))
-    {
-	push(@chain, $y);
-    }
-
-    foreach $y (split(' ', $gl{$name}))
-    {
-	foreach $pid (split(' ', $pid[$y]))
-	{
-	    foreach $z (split(' ', $pid{$pid}))
-	    {
-		@chain = &find_chain($z, @chain) unless (&is_in($z, @chain));
-	    }
-	}
-    }
-
-    return @chain;
-}
-
-
-sub is_in
-{
-    my($val, @list) = @_;
-
-    foreach (@list)
-    {
-        return 1 if ($_ eq $val);
-    }
-
-    return 0;
-}
-
-
diff --git a/gfs/gfs_tool/sb.c b/gfs/gfs_tool/sb.c
deleted file mode 100644
index 130e039..0000000
--- a/gfs/gfs_tool/sb.c
+++ /dev/null
@@ -1,152 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#include "gfs_ondisk.h"
-
-#include "gfs_tool.h"
-
-#define do_lseek(fd, off) \
-do { \
-	if (lseek((fd), (off), SEEK_SET) != (off)) \
-		die("bad seek: %s on line %d of file %s\n", \
-		    strerror(errno),__LINE__, __FILE__); \
-} while (0)
-
-#define do_read(fd, buff, len) \
-do { \
-	if (read((fd), (buff), (len)) != (len)) \
-		die("bad read: %s on line %d of file %s\n", \
-		    strerror(errno), __LINE__, __FILE__); \
-} while (0)
-
-#define do_write(fd, buff, len) \
-do { \
-	if (write((fd), (buff), (len)) != (len)) \
-		die("bad write: %s on line %d of file %s\n", \
-		    strerror(errno), __LINE__, __FILE__); \
-} while (0)
-
-/**
- * do_sb - examine/modify a unmounted FS' superblock
- * @argc:
- * @argv:
- *
- */
-
-void
-do_sb(int argc, char **argv)
-{
-	char *device, *field, *newval = NULL;
-	int fd;
-	unsigned char buf[GFS_BASIC_BLOCK];
-	char input[256];
-	struct gfs_sb sb;
-
-	if (optind == argc)
-		die("Usage: gfs_tool sb <device> <field> [newval]\n");
-
-	device = argv[optind++];
-
-	if (optind == argc)
-		die("Usage: gfs_tool sb <device> <field> [newval]\n");
-
-	field = argv[optind++];
-
-	if (optind < argc) {
-		if (strcmp(field, "all") == 0)
-			die("can't specify new value for \"all\"\n");
-		newval = argv[optind++];
-	}
-
-
-	fd = open(device, (newval) ? O_RDWR : O_RDONLY);
-	if (fd < 0)
-		die("can't open %s: %s\n", device, strerror(errno));
-
-	if (newval && !override) {
-		printf("You shouldn't change any of these values if the filesystem is mounted.\n");
-		printf("\nAre you sure? [y/n] ");
-		if (fgets(input, 255, stdin) == NULL || input[0] != 'y')
-			die("aborted\n");
-
-		printf("\n");
-	}
-
-	do_lseek(fd, GFS_SB_ADDR * GFS_BASIC_BLOCK);
-	do_read(fd, buf, GFS_BASIC_BLOCK);
-
-	gfs_sb_in(&sb, (char *)buf);
-
-	if (sb.sb_header.mh_magic != GFS_MAGIC ||
-	    sb.sb_header.mh_type != GFS_METATYPE_SB)
-		die("there isn't a GFS filesystem on %s\n", device);
-
-	if (strcmp(field, "proto") == 0) {
-		printf("current lock protocol name = \"%s\"\n",
-		       sb.sb_lockproto);
-
-		if (newval) {
-			if (strlen(newval) >= GFS_LOCKNAME_LEN)
-				die("new lockproto name is too long\n");
-			strcpy(sb.sb_lockproto, newval);
-			printf("new lock protocol name = \"%s\"\n",
-			       sb.sb_lockproto);
-		}
-	} else if (strcmp(field, "table") == 0) {
-		printf("current lock table name = \"%s\"\n",
-		       sb.sb_locktable);
-
-		if (newval) {
-			if (strlen(newval) >= GFS_LOCKNAME_LEN)
-				die("new locktable name is too long\n");
-			strcpy(sb.sb_locktable, newval);
-			printf("new lock table name = \"%s\"\n",
-			       sb.sb_locktable);
-		}
-	} else if (strcmp(field, "ondisk") == 0) {
-		printf("current ondisk format = %u\n",
-		       sb.sb_fs_format);
-
-		if (newval) {
-			sb.sb_fs_format = atoi(newval);
-			printf("new ondisk format = %u\n",
-			       sb.sb_fs_format);
-		}
-	} else if (strcmp(field, "multihost") == 0) {
-		printf("current multihost format = %u\n",
-		       sb.sb_multihost_format);
-
-		if (newval) {
-			sb.sb_multihost_format = atoi(newval);
-			printf("new multihost format = %u\n",
-			       sb.sb_multihost_format);
-		}
-	} else if (strcmp(field, "all") == 0) {
-		gfs_sb_print(&sb);
-		newval = FALSE;
-	} else
-		die("unknown field %s\n", field);
-
-	if (newval) {
-		gfs_sb_out(&sb, (char *)buf);
-
-		do_lseek(fd, GFS_SB_ADDR * GFS_BASIC_BLOCK);
-		do_write(fd, buf, GFS_BASIC_BLOCK);
-
-		fsync(fd);
-
-		printf("Done\n");
-	}
-
-	close(fd);
-}
diff --git a/gfs/gfs_tool/tune.c b/gfs/gfs_tool/tune.c
deleted file mode 100644
index 9e3af67..0000000
--- a/gfs/gfs_tool/tune.c
+++ /dev/null
@@ -1,141 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-
-#define __user
-#include "gfs_ioctl.h"
-
-#include "gfs_tool.h"
-
-#define SIZE (4096)
-
-/**
- * get_tune - print out the current tuneable parameters for a filesystem
- * @argc:
- * @argv:
- *
- */
-
-void
-get_tune(int argc, char **argv)
-{
-	int fd;
-	char *gi_argv[] = {
-		(char *)"get_tune"
-	};
-	struct gfs_ioctl gi;
-	char str[SIZE], str2[SIZE];
-	char **lines, **l;
-
-	if (optind == argc)
-		die("Usage: gfs_tool gettune <mountpoint>\n");
-
-	fd = open(argv[optind], O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n",
-		    argv[optind], strerror(errno));
-
-	check_for_gfs(fd, argv[optind]);
-
-	gi.gi_argc = 1;
-	gi.gi_argv = gi_argv;
-	gi.gi_data = str;
-	gi.gi_size = SIZE;
-
-	if (ioctl(fd, GFS_IOCTL_SUPER, &gi) < 0)
-		die("error doing get_tune: %s\n",
-		    strerror(errno));
-
-	close(fd);
-
-	strcpy(str2, str);
-	lines = str2lines(str2);
-
-	for (l = lines; **l; l++) {
-		char *p;
-		for (p = *l; *p; p++)
-			if (*p == ' ') {
-				*p++ = 0;
-				break;
-			}
-
-		if (strcmp(*l, "version") == 0)
-			continue;
-		if (strcmp(*l, "quota_scale_num") == 0) {
-			printf("quota_scale = %.4f   (%u, %u)\n",
-			       (double)name2u32(str, "quota_scale_num") / name2u32(str, "quota_scale_den"),
-			       name2u32(str, "quota_scale_num"), name2u32(str, "quota_scale_den"));
-			continue;
-		}
-		if (strcmp(*l, "quota_scale_den") == 0)
-			continue;
-
-		printf("%s = %s\n", *l, p);
-	}
-}
-
-/**
- * set_tune - set a tuneable parameter
- * @argc:
- * @argv:
- *
- */
-
-void
-set_tune(int argc, char **argv)
-{
-	char *mp, *param, *value;
-	int fd;
-	struct gfs_ioctl gi;
-	char buf[256];
-
-	if (optind == argc)
-		die("Usage: gfs_tool settune <mountpoint> <parameter> <value>\n");
-	mp = argv[optind++];
-	if (optind == argc)
-		die("Usage: gfs_tool settune <mountpoint> <parameter> <value>\n");
-	param = argv[optind++];
-	if (optind == argc)
-		die("Usage: gfs_tool settune <mountpoint> <parameter> <value>\n");
-	value = argv[optind++];
-
-	fd = open(mp, O_RDONLY);
-	if (fd < 0)
-		die("can't open file %s: %s\n",
-		    mp, strerror(errno));
-
-	check_for_gfs(fd, mp);
-
-	if (strcmp(param, "quota_scale") == 0) {
-		float s;
-		sscanf(value, "%f", &s);
-		sprintf(buf, "%u %u", (unsigned int)(s * 10000.0 + 0.5), 10000);
-		value = buf;
-	}
-
-	{
-		char *local_argv[] = {
-			(char *)"set_tune",
-			(char *)param,
-			(char *)value
-		};
-
-		gi.gi_argc = 3;
-		gi.gi_argv = local_argv;
-
-		if (ioctl(fd, GFS_IOCTL_SUPER, &gi))
-			die("can't change tunable parameter %s: %s\n",
-			    param, strerror(errno));
-	}
-
-	close(fd);
-}
diff --git a/gfs/gfs_tool/util.c b/gfs/gfs_tool/util.c
deleted file mode 100644
index f467b7e..0000000
--- a/gfs/gfs_tool/util.c
+++ /dev/null
@@ -1,272 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <limits.h>
-#include <errno.h>
-#include <libgen.h>
-
-#define __user
-#include "gfs_ioctl.h"
-#include "gfs_ondisk.h"
-
-#include "gfs_tool.h"
-
-/**
- * check_for_gfs - Check to see if a descriptor is a file on a GFS filesystem
- * @fd: the file descriptor
- * @path: the path used to open the descriptor
- *
- */
-
-void
-check_for_gfs(int fd, char *path)
-{
-	unsigned int magic = 0;
-	int error;
-
-	error = ioctl(fd, GFS_IOCTL_IDENTIFY, &magic);
-	if (error || magic != GFS_MAGIC)
-		die("%s is not a GFS file/filesystem\n",
-		    path);
-}
-
-/**
- * get_list - Get the list of GFS filesystems
- *
- * Returns: a NULL terminated string
- */
-
-#define LIST_SIZE (1048576)
-
-char *
-get_list(void)
-{
-	char *list;
-	int fd;
-	int x;
-
-	list = malloc(LIST_SIZE);
-	if (!list)
-		die("out of memory\n");
-
-	fd = open("/proc/fs/gfs", O_RDWR);
-	if (fd < 0)
-		die("can't open /proc/fs/gfs: %s\n",
-		    strerror(errno));
-
-	if (write(fd, "list", 4) != 4)
-		die("can't write list command: %s\n",
-		    strerror(errno));
-	x = read(fd, list, LIST_SIZE - 1);
-	if (x < 0)
-		die("can't get list of filesystems: %s\n",
-		    strerror(errno));
-
-	close(fd);
-
-	list[x] = 0;
-
-	return list;
-}
-
-/**
- * str2lines - parse a string into lines
- * @list: the list
- *
- * Returns: An array of character pointers
- */
-
-char **
-str2lines(char *str)
-{
-	char *p;
-	unsigned int n = 0;
-	char **lines;
-	unsigned int x = 0;
-
-	for (p = str; *p; p++)
-		if (*p == '\n')
-			n++;
-
-	lines = malloc((n + 1) * sizeof(char *));
-	if (!lines)
-		die("out of memory\n");
-
-	for (lines[x] = p = str; *p; p++)
-		if (*p == '\n') {
-			*p = 0;
-			lines[++x] = p + 1;
-		}
-
-	return lines;
-}
-
-/**
- * mp2cookie - Find the cookie for a filesystem given its mountpoint
- * @mp:
- * @ioctl_ok: If this is FALSE, it's not acceptable to open() the mountpoint
- *
- * Returns: the cookie
- */
-
-char *
-mp2cookie(char *mp, int ioctl_ok)
-{
-	char *cookie;
-	char *list, **lines;
-	FILE *file;
-	char line[256], device[256], dev_id[256];
-	unsigned int x;
-	struct stat st;
-
-	cookie = malloc(256);
-	if (!cookie)
-		die("out of memory\n");
-	list = get_list();
-	lines = str2lines(list);
-
-	file = fopen("/proc/mounts", "r");
-	if (!file)
-		die("can't open /proc/mounts: %s\n",
-		    strerror(errno));
-
-	memset(dev_id, 0, sizeof(dev_id));
-	while (fgets(line, 256, file)) {
-		char path[256], type[256];
-
-		if (sscanf(line, "%s %s %s", device, path, type) != 3)
-			continue;
-		if (strcmp(path, mp))
-			continue;
-		if (strcmp(type, "gfs"))
-			die("%s is not a GFS filesystem\n", mp);
-
-		if (stat(device, &st))
-			continue;
-		sprintf(dev_id, "%u:%u", major(st.st_rdev),minor(st.st_rdev));
-		break;
-	}
-
-	fclose(file);
-
-	for (x = 0; *lines[x]; x++) {
-		char device_id[256];
-		sscanf(lines[x], "%s %s", cookie, device_id);
-		if (dev_id[0]) {
-			if (strcmp(device_id, dev_id) == 0)
-				return cookie;
-		} else {
-			if (strcmp(cookie, mp) == 0)
-				return cookie;
-		}
-	}
-
-	if (ioctl_ok) {
-		struct gfs_ioctl gi;
-		char *argv[] = {
-			(char *)"get_cookie"
-		};
-		int fd;
-
-		gi.gi_argc = 1;
-		gi.gi_argv = argv;
-		gi.gi_data = cookie;
-		gi.gi_size = 256;
-
-		fd = open(mp, O_RDONLY);
-		if (fd < 0)
-			die("can't open %s: %s\n",
-			    mp, strerror(errno));
-
-		check_for_gfs(fd, mp);
-
-		if (ioctl(fd, GFS_IOCTL_SUPER, &gi) < 0)
-			die("can't get cookie for %s: %s\n",
-			    mp, strerror(errno));
-
-		close(fd);
-
-		return cookie;
-	}
-
-	die("unknown mountpoint %s\n", mp);
-}
-
-/**
- * name2value - find the value of a name-value pair in a string
- * @str_in:
- * @name:
- *
- * Returns: the value string in a static buffer
- */
-
-char *
-name2value(char *str_in, const char *name)
-{
-	char str[strlen(str_in) + 1];
-	static char value[256];
-	char **lines;
-	unsigned int x;
-	unsigned int len = strlen(name);
-
-	strcpy(str, str_in);
-	value[0] = 0;
-
-	lines = str2lines(str);
-
-	for (x = 0; *lines[x]; x++)
-		if (memcmp(lines[x], name, len) == 0 &&
-		    lines[x][len] == ' ') {
-			strcpy(value, lines[x] + len + 1);
-			break;
-		}
-
-	free(lines);
-
-	return value;
-}
-
-/**
- * name2u32 - find the value of a name-value pair in a string
- * @str_in:
- * @name:
- *
- * Returns: the value uint32
- */
-
-uint32_t
-name2u32(char *str, const char *name)
-{
-	char *value = name2value(str, name);
-	uint32_t x = 0;
-
-	sscanf(value, "%u", &x);
-
-	return x;
-}
-
-/**
- * name2u64 - find the value of a name-value pair in a string
- * @str_in:
- * @name:
- *
- * Returns: the value uint64
- */
-
-uint64_t
-name2u64(char *str, const char *name)
-{
-	char *value = name2value(str, name);
-	uint64_t x = 0;
-
-	sscanf(value, "%"SCNu64, &x);
-
-	return x;
-}
diff --git a/gfs/include/global.h b/gfs/include/global.h
deleted file mode 100644
index 02c3eff..0000000
--- a/gfs/include/global.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __GLOBAL_DOT_H__
-#define __GLOBAL_DOT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if defined(__KERNEL__) || defined(_KERNEL)
-#error "don't use global.h in kernel space"
-#endif
-
-
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-
-
-#include <inttypes.h>
-
-typedef uint64_t          uint64;
-typedef uint32_t          uint32;
-typedef uint16_t          uint16;
-typedef uint8_t           uint8;
-typedef int64_t           int64;
-typedef int32_t           int32;
-typedef int16_t           int16;
-typedef int8_t            int8;
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __GLOBAL_H__ */
diff --git a/gfs/include/linux_endian.h b/gfs/include/linux_endian.h
deleted file mode 100644
index 43089d2..0000000
--- a/gfs/include/linux_endian.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef __LINUX_ENDIAN_DOT_H__
-#define __LINUX_ENDIAN_DOT_H__
-
-
-#include <endian.h>
-#include <byteswap.h>
-
-
-/*  I'm not sure which versions of alpha glibc/gcc are broken,
-    so fix all of them.  */
-#ifdef __alpha__
-#undef bswap_64
-static __inline__ unsigned long bswap_64(unsigned long x)
-{
-  unsigned int h = x >> 32;
-  unsigned int l = x;
-
-  h = bswap_32(h);
-  l = bswap_32(l);
-
-  return ((unsigned long)l << 32) | h;
-}
-#endif  /*  __alpha__  */
-
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-
-#define be16_to_cpu(x) (x)
-#define be32_to_cpu(x) (x)
-#define be64_to_cpu(x) (x)
-
-#define cpu_to_be16(x) (x)
-#define cpu_to_be32(x) (x)
-#define cpu_to_be64(x) (x)
-
-#define le16_to_cpu(x) (bswap_16((x)))
-#define le32_to_cpu(x) (bswap_32((x)))
-#define le64_to_cpu(x) (bswap_64((x)))
-
-#define cpu_to_le16(x) (bswap_16((x)))
-#define cpu_to_le32(x) (bswap_32((x)))
-#define cpu_to_le64(x) (bswap_64((x)))
-
-#endif  /*  __BYTE_ORDER == __BIG_ENDIAN  */
-
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-
-#define be16_to_cpu(x) (bswap_16((x)))
-#define be32_to_cpu(x) (bswap_32((x)))
-#define be64_to_cpu(x) (bswap_64((x)))
-
-#define cpu_to_be16(x) (bswap_16((x)))
-#define cpu_to_be32(x) (bswap_32((x)))
-#define cpu_to_be64(x) (bswap_64((x))) 
-
-#define le16_to_cpu(x) (x)
-#define le32_to_cpu(x) (x)
-#define le64_to_cpu(x) (x)
-
-#define cpu_to_le16(x) (x)
-#define cpu_to_le32(x) (x)
-#define cpu_to_le64(x) (x)
-
-#endif  /*  __BYTE_ORDER == __LITTLE_ENDIAN  */
-
-
-#endif  /*  __LINUX_ENDIAN_DOT_H__  */
diff --git a/gfs/include/list.h b/gfs/include/list.h
deleted file mode 100644
index 566b377..0000000
--- a/gfs/include/list.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/* Copied from include/linux/list.h */
-
-#ifndef _LINUX_LIST_H
-#define _LINUX_LIST_H
-
-/**
- * container_of - cast a member of a structure out to the containing structure
- *
- * @ptr:        the pointer to the member.
- * @type:       the type of the container struct this is embedded in.
- * @member:     the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({                      \
-	const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
-	(type *)( (char *)__mptr - offsetof(type,member) );})
-
-
-/*
- * These are non-NULL pointers that will result in page faults
- * under normal circumstances, used to verify that nobody uses
- * non-initialized list entries.
- */
-#define LIST_POISON1  ((void *) 0x00100100)
-#define LIST_POISON2  ((void *) 0x00200200)
-
-/*
- * Simple doubly linked list implementation.
- *
- * Some of the internal functions ("__xxx") are useful when
- * manipulating whole lists rather than single entries, as
- * sometimes we already know the next/prev entries and we can
- * generate better code by using them directly rather than
- * using the generic single-entry routines.
- */
-
-struct list_head {
-	struct list_head *next, *prev;
-};
-
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
-	struct list_head name = LIST_HEAD_INIT(name)
-
-#define INIT_LIST_HEAD(ptr) do { \
-	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
-
-/*
- * Insert a new entry between two known consecutive entries. 
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static inline void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next)
-{
-	next->prev = new;
-	new->next = next;
-	new->prev = prev;
-	prev->next = new;
-}
-
-/**
- * list_add - add a new entry
- * @new: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-static inline void list_add(struct list_head *new, struct list_head *head)
-{
-	__list_add(new, head, head->next);
-}
-
-/**
- * list_add_tail - add a new entry
- * @new: new entry to be added
- * @head: list head to add it before
- *
- * Insert a new entry before the specified head.
- * This is useful for implementing queues.
- */
-static inline void list_add_tail(struct list_head *new, struct list_head *head)
-{
-	__list_add(new, head->prev, head);
-}
-
-/*
- * Delete a list entry by making the prev/next entries
- * point to each other.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static inline void __list_del(struct list_head * prev, struct list_head * next)
-{
-	next->prev = prev;
-	prev->next = next;
-}
-
-/**
- * list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is
- * in an undefined state.
- */
-static inline void list_del(struct list_head *entry)
-{
-	__list_del(entry->prev, entry->next);
-	entry->next = LIST_POISON1;
-	entry->prev = LIST_POISON2;
-}
-
-/**
- * list_del_init - deletes entry from list and reinitialize it.
- * @entry: the element to delete from the list.
- */
-static inline void list_del_init(struct list_head *entry)
-{
-	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry); 
-}
-
-/**
- * list_move - delete from one list and add as another's head
- * @list: the entry to move
- * @head: the head that will precede our entry
- */
-static inline void list_move(struct list_head *list, struct list_head *head)
-{
-        __list_del(list->prev, list->next);
-        list_add(list, head);
-}
-
-/**
- * list_move_tail - delete from one list and add as another's tail
- * @list: the entry to move
- * @head: the head that will follow our entry
- */
-static inline void list_move_tail(struct list_head *list,
-				  struct list_head *head)
-{
-        __list_del(list->prev, list->next);
-        list_add_tail(list, head);
-}
-
-/**
- * list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static inline int list_empty(const struct list_head *head)
-{
-	return head->next == head;
-}
-
-/**
- * list_empty_careful - tests whether a list is
- * empty _and_ checks that no other CPU might be
- * in the process of still modifying either member
- *
- * NOTE: using list_empty_careful() without synchronization
- * can only be safe if the only activity that can happen
- * to the list entry is list_del_init(). Eg. it cannot be used
- * if another CPU could re-list_add() it.
- *
- * @head: the list to test.
- */
-static inline int list_empty_careful(const struct list_head *head)
-{
-	struct list_head *next = head->next;
-	return (next == head) && (next == head->prev);
-}
-
-static inline void __list_splice(struct list_head *list,
-				 struct list_head *head)
-{
-	struct list_head *first = list->next;
-	struct list_head *last = list->prev;
-	struct list_head *at = head->next;
-
-	first->prev = head;
-	head->next = first;
-
-	last->next = at;
-	at->prev = last;
-}
-
-/**
- * list_splice - join two lists
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- */
-static inline void list_splice(struct list_head *list, struct list_head *head)
-{
-	if (!list_empty(list))
-		__list_splice(list, head);
-}
-
-/**
- * list_splice_init - join two lists and reinitialise the emptied list.
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- *
- * The list at @list is reinitialised
- */
-static inline void list_splice_init(struct list_head *list,
-				    struct list_head *head)
-{
-	if (!list_empty(list)) {
-		__list_splice(list, head);
-		INIT_LIST_HEAD(list);
-	}
-}
-
-/**
- * list_entry - get the struct for this entry
- * @ptr:	the &struct list_head pointer.
- * @type:	the type of the struct this is embedded in.
- * @member:	the name of the list_struct within the struct.
- */
-#define list_entry(ptr, type, member) \
-	container_of(ptr, type, member)
-
-/**
- * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop counter.
- * @head:	the head for your list.
- */
-#define list_for_each(pos, head) \
-	for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * __list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop counter.
- * @head:	the head for your list.
- *
- * This variant differs from list_for_each() in that it's the
- * simplest possible list iteration code, no prefetching is done.
- * Use this for code that knows the list to be very short (empty
- * or 1 entry) most of the time.
- */
-#define __list_for_each(pos, head) \
-	for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop counter.
- * @head:	the head for your list.
- */
-#define list_for_each_prev(pos, head) \
-	for (pos = (head)->prev; pos != (head); pos = pos->prev)
-        	
-/**
- * list_for_each_safe	-	iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop counter.
- * @n:		another &struct list_head to use as temporary storage
- * @head:	the head for your list.
- */
-#define list_for_each_safe(pos, n, head) \
-	for (pos = (head)->next, n = pos->next; pos != (head); \
-		pos = n, n = pos->next)
-
-/**
- * list_for_each_entry	-	iterate over list of given type
- * @pos:	the type * to use as a loop counter.
- * @head:	the head for your list.
- * @member:	the name of the list_struct within the struct.
- */
-#define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member);	\
-	     &pos->member != (head); 					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
-
-/**
- * list_for_each_entry_reverse - iterate backwards over list of given type.
- * @pos:	the type * to use as a loop counter.
- * @head:	the head for your list.
- * @member:	the name of the list_struct within the struct.
- */
-#define list_for_each_entry_reverse(pos, head, member)			\
-	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
-	     &pos->member != (head); 					\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
-
-/**
- * list_prepare_entry - prepare a pos entry for use as a start point in
- *			list_for_each_entry_continue
- * @pos:	the type * to use as a start point
- * @head:	the head of the list
- * @member:	the name of the list_struct within the struct.
- */
-#define list_prepare_entry(pos, head, member) \
-	((pos) ? : list_entry(head, typeof(*pos), member))
-
-/**
- * list_for_each_entry_continue -	iterate over list of given type
- *			continuing after existing point
- * @pos:	the type * to use as a loop counter.
- * @head:	the head for your list.
- * @member:	the name of the list_struct within the struct.
- */
-#define list_for_each_entry_continue(pos, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member);  \
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
-
-/**
- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- * @pos:	the type * to use as a loop counter.
- * @n:		another type * to use as temporary storage
- * @head:	the head for your list.
- * @member:	the name of the list_struct within the struct.
- */
-#define list_for_each_entry_safe(pos, n, head, member)			\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member);	\
-	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
-
-
-#endif
diff --git a/gfs/include/osi_list.h b/gfs/include/osi_list.h
deleted file mode 100644
index 3b1483b..0000000
--- a/gfs/include/osi_list.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef __OSI_LIST_DOT_H__
-#define __OSI_LIST_DOT_H__
-
-
-
-struct osi_list
-{
-  struct osi_list *next, *prev;
-};
-typedef struct osi_list osi_list_t;
-
-
-
-#define osi_list_decl(var) osi_list_t var = { &var, &var }
-
-#define osi_list_empty(var) ((var)->next == (var))
-#define osi_list_entry(var, type, mem) ((type *)((unsigned long)(var) - (unsigned long)(&((type *)NULL)->mem)))
-
-
-
-#define osi_list_init(head) \
-do \
-{ \
-  osi_list_t *osi_list_var = (head); \
-  osi_list_var->next = osi_list_var->prev = osi_list_var; \
-} \
-while (0)
-
-#define osi_list_add(new, head) \
-do \
-{ \
-  osi_list_t *osi_list_var_new = (new); \
-  osi_list_t *osi_list_var_head = (head); \
-  osi_list_var_new->next = osi_list_var_head->next; \
-  osi_list_var_new->prev = osi_list_var_head; \
-  osi_list_var_head->next->prev = osi_list_var_new; \
-  osi_list_var_head->next = osi_list_var_new; \
-} \
-while (0)
-
-#define osi_list_add_next osi_list_add
-
-#define osi_list_add_prev(new, head) \
-do \
-{ \
-  osi_list_t *osi_list_var_new = (new); \
-  osi_list_t *osi_list_var_head = (head); \
-  osi_list_var_new->prev = osi_list_var_head->prev; \
-  osi_list_var_new->next = osi_list_var_head; \
-  osi_list_var_head->prev->next = osi_list_var_new; \
-  osi_list_var_head->prev = osi_list_var_new; \
-} \
-while (0)
-
-#define osi_list_del(var) \
-do \
-{ \
-  osi_list_t *osi_list_var = (var); \
-  osi_list_var->next->prev = osi_list_var->prev; \
-  osi_list_var->prev->next = osi_list_var->next; \
-} \
-while (0)
-
-#define osi_list_del_init(var) \
-do \
-{ \
-  osi_list_t *osi_list_var = (var); \
-  osi_list_var->next->prev = osi_list_var->prev; \
-  osi_list_var->prev->next = osi_list_var->next; \
-  osi_list_var->next = osi_list_var->prev = osi_list_var; \
-} \
-while (0)
-
-#define osi_list_foreach(tmp, head) \
-  for ((tmp) = (head)->next; (tmp) != (head); (tmp) = (tmp)->next) 
-
-#define osi_list_foreach_safe(tmp, head, x) \
-  for ((tmp) = (head)->next, (x) = (tmp)->next; \
-       (tmp) != (head); \
-       (tmp) = (x), (x) = (x)->next)
-
-
-
-#endif  /*  __OSI_LIST_DOT_H__  */
diff --git a/gfs/include/osi_user.h b/gfs/include/osi_user.h
deleted file mode 100644
index 34964ed..0000000
--- a/gfs/include/osi_user.h
+++ /dev/null
@@ -1,421 +0,0 @@
-#ifndef __OSI_USER_DOT_H__
-#define __OSI_USER_DOT_H__
-
-/*  Include Files
-    These should only be the ones necessary to compile the common code.  */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <time.h>
-#include <sys/ioctl.h>
-
-#include "global.h"
-#include "osi_list.h"
-
-
-
-/*  Memory allocation abstraction  */
-
-static __inline__ void *osi_malloc(unsigned int size)
-{
-  return malloc(size);
-}
-
-static __inline__ void osi_free(void *data, unsigned int size)
-{
-  free(data);
-}
-
-
-
-/*  Memory copy abstraction  */
-
-#define osi_copy_to_user(uaddr, kaddr, len) (memcpy((uaddr), (kaddr), (len)) ? 0 : -EFAULT)
-#define osi_clear_user(uaddr, len) ((memset((uaddr), 0, (len))) ? 0 : -EFAULT)
-#define osi_copy_from_user(kaddr, uaddr, len) ((memcpy((kaddr), (uaddr), (len))) ? 0 : -EFAULT)
-#define osi_strncpy_from_user(kaddr, uaddr, len) ((strncpy((kaddr), (uaddr), (len))) ? 0 : -EFAULT)
-
-#define osi_read_access_ok(uaddr, len) (TRUE)
-#define osi_write_access_ok(uaddr, len) (TRUE)
-
-#define osi_memset memset
-#define osi_memcpy memcpy
-#define osi_memcmp memcmp
-
-#define osi_strlen strlen
-#define osi_strstr strstr
-#define osi_strcmp strcmp
-#define osi_strncmp strncmp
-#define osi_strtok strtok
-#define osi_strchr strchr
-#define osi_strcpy strcpy
-#define osi_strncpy strncpy
-#define osi_strcasecmp strcasecmp
-#define osi_strtod strtod
-#define osi_strtol strtol
-
-
-
-/*  printf() abstraction  */
-
-#define osi_printf printf
-#define osi_sprintf sprintf
-#define osi_snprintf snprintf
-#define osi_vsnprintf vsnprintf
-
-#define osi_sscanf sscanf
-
-#define osi_fprintf fprintf
-
-#define osi_tty_printf printf
-
-
-
-/*  panic abstractions  */
-
-#define panic(fmt, args...) \
-{ \
-  fprintf(stderr, "%s: ", prog_name); \
-  fprintf(stderr, fmt, ## args); \
-  exit(-1); \
-}
-
-#define osi_panic panic
-#define osi_bug(x) \
-{ \
-  fprintf(stderr, "%s: BUG: %s\n", prog_name, (x)); \
-  exit(-1); \
-}
-
-
-
-/*  GFS to VFS abstraction  */
-
-typedef int osi_vfs_t;
-typedef int osi_vnode_t;
-typedef int osi_vfile_t;
-
-#define vf2vn(vfile) ((osi_vnode_t *)(vfile))
-#define vn2vfs(vnode) ((osi_vfs_t *)(vnode))
-
-
-
-/*  I/O abstraction  */
-
-struct buffer_head
-{
-  unsigned long b_blocknr;
-  unsigned long b_size;
-  unsigned long b_state;
-  char *b_data;
-  char *b_pdata;
-  osi_list_t b_list;
-};
-typedef struct buffer_head osi_buf_t;
-
-
-
-/*  Device type abstraction  */
-
-typedef unsigned short osi_dev_t;
-
-#define osi_make_dev MKDEV
-#define osi_u2k_dev
-#define osi_k2u_dev
-
-
-
-/*  Atomic Bit Manipulation interface  */
-
-struct osi_bitfield
-{
-  unsigned long bitfield;
-};
-typedef struct osi_bitfield osi_bitfield_t;
-
-#define osi_test_bit(nr, addr) ((addr)->bitfield & (1 << nr))
-#define osi_set_bit(nr, addr) ((addr)->bitfield |= (1 << nr))
-#define osi_clear_bit(nr, addr) ((addr)->bitfield &= ~(1 << nr))
-#define osi_test_and_set_bit(nr, addr) ((addr)->bitfield |= (1 << nr))
-#define osi_test_and_clear_bit(nr, addr) ((addr)->bitfield &= ~(1 << nr))
-
-
-
-/*  Atomic Counter Interface  */
-
-struct osi_atomic
-{
-  int atomic;
-};
-typedef struct osi_atomic osi_atomic_t;
-
-#define osi_atomic_inc(x) ((x)->atomic += 1)
-#define osi_atomic_dec(x) ((x)->atomic -= 1)
-#define osi_atomic_read(x) ((x)->atomic)
-#define osi_atomic_dec_and_test(x) ((x)->atomic -= 1)
-#define osi_atomic_set(x, y) ((x)->atomic = (y))
-
-
-
-/*  Endianness conversion abstraction  */
-
-#include "linux_endian.h"
-
-
-
-/*  Filename structure  */
-
-struct osi_filename
-{
-  unsigned char *name;
-  unsigned int len;
-};
-typedef struct osi_filename osi_filename_t;
-
-
-
-/*  Sleeping mutual exclusion primitive abstraction
-
-    All macros take a pointer to a osi_mutex_t structure.
-    osi_mutex_down_try() returns TRUE if the down() succeeds 
-    */
-
-typedef int osi_mutex_t;
-
-#define osi_mutex_init(x)
-#define osi_mutex_init_lkd(x)
-
-#define osi_mutex_lock(x) 
-#define osi_mutex_lock_intr(x)
-#define osi_mutex_trylock(x) (TRUE)
-#define osi_mutex_unlock(x)
-
-
-
-/*  Reader/writer Sleeping mutual exclusion primitive abstraction  */
-
-typedef int osi_mutex_rw_t;
-
-#define osi_mutex_rw_init(x)
-
-#define osi_mutex_read_lock(x)
-#define osi_mutex_write_lock(x)
-#define osi_mutex_read_trylock(x) (0)
-#define osi_mutex_write_trylock(x) (0)
-#define osi_mutex_read_unlock(x)
-#define osi_mutex_write_unlock(x)
-
-
-
-/*  Spinlock abstraction  */
-
-typedef int osi_spin_t;
-
-#define osi_spin_init(lock)
-
-#define osi_spin_lock(lock)
-#define osi_spin_unlock(lock)
-#define osi_spin_trylock(lock) (TRUE)
-
-
-
-/*  RW-Spinlock abstraction  */
-
-typedef int osi_spin_rw_t;
-
-#define osi_spin_rw_init(lock)
-
-#define osi_spin_read_lock(lock)
-#define osi_spin_write_lock(lock)
-#define osi_spin_read_unlock(lock)
-#define osi_spin_write_unlock(lock)
-#define osi_spin_write_trylock(lock) (TRUE)
-
-
-
-/*  Process abstraction  */
-
-#define osi_pid() 1
-#define osi_pname() ("main")
-
-typedef int osi_task_t;
-
-#define osi_task_is_set(taskp) (*(taskp))
-#define osi_task_is_me(taskp) (TRUE)
-#define osi_task_is_equal(task1p, task2p) (TRUE)
-#define osi_task_to_pid(taskp) (1)
-#define osi_task_to_pname(taskp) ("main")
-
-#define osi_task_clear(taskp) do { *(taskp) = 0; } while (0)
-#define osi_task_remember_me(taskp) do { *(taskp) = 1; } while (0)
-#define osi_task_sleep(taskp, x) do { } while (0)
-#define osi_task_wakeup(taskp) do { } while (0)
-
-
-
-/*  Kernel Thead code  */
-
-#define osi_daemonize(thread_name)
-#define osi_undaemonize()
-
-
-
-/*  Time abstraction  */
-
-#define osi_current_time() time(NULL)
-
-static __inline__ uint64 osi_gettimeofday(void)
-{
-  struct timeval tv;
-  gettimeofday(&tv, NULL);
-  return (uint64)tv.tv_sec * 1000000 + tv.tv_usec;
-}
-
-struct osi_clock_ticks
-{
-  unsigned long value;
-};
-typedef struct osi_clock_ticks osi_clock_ticks_t;
-
-static __inline__ void osi_time_stamp(osi_clock_ticks_t *stamp)
-{
-}
-
-static __inline__ int osi_check_timeout(osi_clock_ticks_t *stamp, int seconds)
-{
-  return 0;
-}
-
-static __inline__ unsigned int osi_time_diff(osi_clock_ticks_t *stamp)
-{
-  return FALSE;
-}
-
-static __inline__ int osi_time_valid(osi_clock_ticks_t *stamp)
-{
-  return FALSE;
-}
-
-
-
-/*  Timer abstraction  */
-
-
-typedef int osi_timer_t;
-typedef void (osi_timer_func)(void *);
-typedef void (linux_timer_func)(unsigned long);
-
-static __inline__ void osi_init_timer(osi_timer_t *t, osi_timer_func *fp, void *data)
-{
-}
-
-static __inline__ void osi_del_timer(osi_timer_t *t)
-{
-}
-
-static __inline__ void osi_set_timer(osi_timer_t *t, unsigned long sec)
-{
-}
-
-static __inline__ void osi_set_deci_timer(osi_timer_t *t, unsigned long dsec)
-{
-}
-
-static __inline__ int osi_timer_pending(osi_timer_t *t)
-{
-  return -ENOSYS;
-}
-
-
-
-/*  Schedule abstraction - Macro that makes a process temporarily
-    give up control of the processor and lets other processes have
-    a change to run. 
-    Sleep abstraction - Sleep for x number of sections.  */
-
-#define osi_schedule()
-#define osi_sleep(x)
-#define osi_sleep_intr(x)
-
-
-
-/*  Wait queue abstraction  */
-
-typedef int osi_wchan_t;
-
-#define osi_wchan_init(x) do { } while (0)
-#define osi_wchan_cond_sleep(chan, sleep_cond) do { } while (0)
-#define osi_wchan_cond_sleep_intr(chan, sleep_cond) do { } while (0)
-#define osi_wchan_wakeup(x) do { } while (0)
-
-
-
-/*  Completion events  */
-
-struct osi_completion
-{
-};
-typedef struct osi_completion osi_completion_t;
-
-#define osi_completion_init(x) do { } while (0)
-
-#define osi_wait_for_completion(x) do { } while (0)
-#define osi_complete(x) do { } while (0)
-
-
-
-/*  Credentials structure  */
-
-struct osi_cred
-{
-  uint32 cr_uid;
-  uint32 cr_gid;
-};
-typedef struct osi_cred osi_cred_t;
-
-#define osi_cred_to_uid(credp) ((credp) ? (credp)->cr_uid : 0)
-#define osi_cred_to_gid(credp) ((credp) ? (credp)->cr_gid : 0)
-#define osi_cred_in_group(credp, gid) ((credp) ? ((cred)->cr_gid == (gid)) : FALSE)
-
-
-
-/*  Signals abstraction  */
-
-#define osi_pending_signals() FALSE
-
-
-
-/*  Weird errnos  */
-
-#define ERESTARTSYS EINTR
-
-
-
-/*  Module stuff  */
-
-typedef int osi_module_t;
-
-#define osi_module_this (NULL)
-
-#define osi_module_init(mod) do { } while (0)
-#define osi_module_inc(mod) do { } while (0)
-#define osi_module_inc_cond(mod) (FALSE)
-#define osi_module_dec(mod) do { } while (0)
-#define osi_module_busy(mod) (TRUE)
-
-
-
-/*  Other Stuff  */
-
-extern char *prog_name;
-
-#define OSI_CACHE_ALIGNED
-
-
-
-#endif  /*  __OSI_USER_DOT_H__  */
-
diff --git a/gfs/init.d/Makefile b/gfs/init.d/Makefile
deleted file mode 100644
index 097d83c..0000000
--- a/gfs/init.d/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-TARGET= gfs
-
-INITDT=$(TARGET)
-
-all: $(TARGET)
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-$(TARGET): $(S)/$(TARGET).in
-	cat $(S)/$(TARGET).in | sed \
-		-e 's#@SBINDIR@#${sbindir}#g' \
-		-e 's#@INITDDIR@#${initddir}#g' \
-	> $(TARGET)
-
-clean: generalclean
diff --git a/gfs/init.d/gfs.in b/gfs/init.d/gfs.in
deleted file mode 100644
index 31104b4..0000000
--- a/gfs/init.d/gfs.in
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/bin/bash
-#
-# gfs mount/unmount helper 
-#
-# chkconfig: - 26 74
-# description: mount/unmount gfs filesystems configured in /etc/fstab
-
-### BEGIN INIT INFO
-# Provides:		gfs
-# Required-Start:	$network cman
-# Required-Stop:	$network cman
-# Default-Start:
-# Default-Stop:
-# Short-Description:	mount/unmount gfs filesystems configured in /etc/fstab
-# Description:		mount/unmount gfs filesystems configured in /etc/fstab
-### END INIT INFO
-
-# set secure PATH
-PATH="/bin:/usr/bin:/sbin:/usr/sbin:@SBINDIR@"
-
-success()
-{
-    echo -ne "[  OK  ]\r"
-}
-
-failure()
-{
-    echo -ne "[FAILED]\r"
-}
-
-# rpm based distros
-if [ -d /etc/sysconfig ]; then
-	[ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
-	[ -f /etc/sysconfig/cluster ] && . /etc/sysconfig/cluster
-	[ -f /etc/sysconfig/gfs ] && . /etc/sysconfig/gfs
-	[ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/subsys/gfs"
-fi
-
-# deb based distros
-if [ -d /etc/default ]; then
-	[ -f /etc/default/cluster ] && . /etc/default/cluster
-	[ -f /etc/default/gfs ] && . /etc/default/gfs
-	[ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/gfs"
-fi
-
-#
-# This script's behavior is modeled closely after the netfs script.  
-#
-GFSFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "gfs" && $4 !~ /noauto/ { print $2 }' /etc/fstab)
-GFSMTAB=$(LC_ALL=C awk '!/^#/ && $3 == "gfs" && $2 != "/" { print $2 }' /proc/mounts)
-
-# See how we were called.
-case "$1" in
-  start)
-        if [ -n "$GFSFSTAB" ] 
-	then
-		echo -n "Mounting GFS filesystems: "
-		mount -a -t gfs
-		rtrn=$?
-		if [ $rtrn = 0 ]; then
-			touch $LOCK_FILE
-			success
-			echo
-		else
-			failure
-			echo
-		fi
-	fi
-	;;
-
-  stop)
-  	if [ -n "$GFSMTAB" ] 
-	then
-		sig=
-		retry=6
-		remaining=`LC_ALL=C awk '!/^#/ && $3 == "gfs" && $2 != "/" {print $2}' /proc/mounts`
-		while [ -n "$remaining" -a "$retry" -gt 0 ]
-		do
-			echo -n "Unmounting GFS filesystems: "
-			umount -a -t gfs
-			rtrn=$?
-			if [ $rtrn = 0 ]; then
-				success
-				echo
-			else
-				failure
-				echo
-			fi
-
-			if [ $retry -eq 0 ] 
-			then
-				echo -n "Unmounting GFS filesystems (lazy): "
-				umount -l -a -t gfs
-				rtrn=$?
-				if [ $rtrn = 0 ]; then
-					success
-					echo
-				else
-					failure
-					echo
-				fi
-				break
-			fi
-
-			sleep 2
-			remaining=`LC_ALL=C awk '!/^#/ && $3 == "gfs" && $2 != "/" {print $2}' /proc/mounts`
-			[ -z "$remaining" ] && break
-			fuser -k -m $sig $remaining > /dev/null 2>&1
-			sleep 10
-			retry=$(($retry - 1))
-			sig=-9
-		done
-	fi
-
-	modprobe -r gfs
-	rm -f $LOCK_FILE
-	;;
-
-  status)
-	if [ -f /proc/mounts ]
-	then
-	        [ -n "$GFSFSTAB" ] && {
-		     echo "Configured GFS mountpoints: "
-		     for fs in $GFSFSTAB; do echo $fs ; done
-		}
-		[ -n "$GFSMTAB" ] && {
-                      echo "Active GFS mountpoints: "
-		      for fs in $GFSMTAB; do echo $fs ; done
-		}
-	else
-		echo "/proc filesystem unavailable"
-	fi
-	;;
-
-  restart)
-	$0 stop
-	$0 start
-	;;
-
-  reload|force-reload)
-        $0 start
-	;;
-  *)
-	echo $"Usage: $0 {start|stop|restart|reload|status}"
-	exit 1
-esac
-
-exit 0
diff --git a/gfs/libgfs/Makefile b/gfs/libgfs/Makefile
deleted file mode 100644
index bae9954..0000000
--- a/gfs/libgfs/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-TARGET=libgfs
-
-MAKESTATICLIB = 1
-
-OBJS=	bio.o \
-	bitmap.o \
-	block_list.o \
-	file.o \
-	fs_bits.o \
-	fs_bmap.o \
-	fs_dir.o \
-	fs_inode.o \
-	inode.o \
-	log.o \
-	ondisk.o \
-	rgrp.o \
-	size.o \
-	super.o \
-	util.o
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/libs.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
-CFLAGS += -D_GNU_SOURCE -DHELPER_PROGRAM
-CFLAGS += -c
-CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
-CFLAGS += -I${gfskincdir} -I$(S)/../include
-CFLAGS += -I${incdir}
diff --git a/gfs/libgfs/bio.c b/gfs/libgfs/bio.c
deleted file mode 100644
index 673fc1a..0000000
--- a/gfs/libgfs/bio.c
+++ /dev/null
@@ -1,167 +0,0 @@
-#include <stdint.h>
-#include "list.h"
-#include "gfs_ondisk.h"
-#include "libgfs.h"
-
-/*
- * get_buf - get a buffer
- * @sdp: the super block
- * @blkno: blk # that this buffer will be associated with
- * @bhp: the location where the buffer is returned
- *
- * This function allocates space for a buffer head structure
- * and the corresponding data.  It does not fill in the
- * actual data - that is done by read_buf.
- *
- * Returns: 0 on success, -1 on error
- */
-int get_buf(uint32_t sb_bsize, uint64 blkno, osi_buf_t **bhp)
-{
-	osi_buf_t *bh = NULL;
-
-	*bhp = NULL;
-	bh = (osi_buf_t *)malloc(sizeof(osi_buf_t));
-	if(!bh){
-		log_err("Unable to allocate memory for new buffer head.\n");
-		return -1;
-	}
-	if(!memset(bh, 0, sizeof(osi_buf_t))) {
-		log_err("Unable to zero buffer head\n");
-		return -1;
-	}
-
-	/* FIXME: Not sure how this will work on all
-	 * architectures without the casts */
-	bh->b_blocknr = blkno;
-	bh->b_size = sb_bsize;
-	bh->b_state = 0;
-	if(!(bh->b_data = malloc(BH_SIZE(bh)))) {
-		free(bh);
-		log_err("Unable to allocate memory for new buffer "
-			"blkno = %"PRIu64", size = %u\n", blkno, BH_SIZE(bh));
-		return -1;
-	}
-	if(!memset(BH_DATA(bh), 0, BH_SIZE(bh))) {
-		free(bh);
-		log_err("Unable to zero memory for new buffer "
-			"blkno = %"PRIu64", size = %u\n", blkno, BH_SIZE(bh));
-	}
-
-	*bhp = bh;
-
-	return 0;
-}
-
-
-/*
- * relse_buf - release a buffer
- * @sdp: the super block
- * @bh: the buffer to release
- *
- * This function will release the memory of the buffer
- * and associated buffer head.
- *
- * Returns: nothing
- */
-void relse_buf(osi_buf_t *bh){
-	if(bh){
-		if(BH_DATA(bh)) {
-			free(BH_DATA(bh));
-			bh->b_data = NULL;
-		}
-		free(bh);
-		bh = NULL;
-	}
-}
-
-
-/*
- * read_buf - read a buffer
- * @sdp: the super block
- * @blkno: block number
- * @bhp: place where buffer is returned
- * @flags:
- *
- * Returns 0 on success, -1 on error
- */
-int read_buf(int disk_fd, osi_buf_t *bh, int flags){
-
-	if(do_lseek(disk_fd, (uint64)(BH_BLKNO(bh)*BH_SIZE(bh)))){
-		log_err("Unable to seek to position %"PRIu64" "
-			"(%"PRIu64" * %u) on storage device.\n",
-			(uint64)(BH_BLKNO(bh) * BH_SIZE(bh)),
-			BH_BLKNO(bh), BH_SIZE(bh));
-		return -1;
-	}
-
-	if(do_read(disk_fd, BH_DATA(bh), BH_SIZE(bh))){
-		log_err("Unable to read %u bytes from position %"PRIu64"\n",
-			BH_SIZE(bh), (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)));
-		return -1;
-	}
-
-	return 0;
-}
-
-
-/*
- * write_buf - write a buffer
- * @sdp: the super block
- * @bh: buffer head that describes buffer to write
- * @flags: flags that determine usage
- *
- * Returns: 0 on success, -1 on failure
- */
-int write_buf(int disk_fd, osi_buf_t *bh, int flags){
-
-	if(do_lseek(disk_fd, (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)))) {
-		log_err("Unable to seek to position %"PRIu64
-			"(%"PRIu64" * %u) on storage device.\n",
-			(uint64)(BH_BLKNO(bh) * BH_SIZE(bh)),
-			BH_BLKNO(bh), BH_SIZE(bh));
-		return -1;
-	}
-
-	log_debug("Writing to %"PRIu64" - %"PRIu64" %u\n",
-		  (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)),
-		  BH_BLKNO(bh), BH_SIZE(bh));
-	if(do_write(disk_fd, BH_DATA(bh), BH_SIZE(bh))) {
-		log_err("Unable to write %u bytes to position %"PRIu64"\n",
-			BH_SIZE(bh), (uint64)(BH_BLKNO(bh) * BH_SIZE(bh)));
-		return -1;
-	}
-
-	if(flags & BW_WAIT){
-		fsync(disk_fd);
-	}
-
-	return 0;
-}
-
-
-/*
- * get_and_read_buf - combines get_buf and read_buf functions
- * @sdp
- * @blkno
- * @bhp
- * @flags
- *
- * Returns: 0 on success, -1 on error
- */
-int get_and_read_buf(int disk_fd, uint32_t sb_bsize, uint64 blkno,
-					 osi_buf_t **bhp, int flags)
-{
-	if(get_buf(sb_bsize, blkno, bhp)) {
-		stack;
-		return -1;
-	}
-
-	if(read_buf(disk_fd, *bhp, flags)){
-		stack;
-		relse_buf(*bhp);
-		*bhp = NULL;  /* guarantee that ptr is NULL in failure cases */
-		return -1;
-	}
-
-	return 0;
-}
diff --git a/gfs/libgfs/bitmap.c b/gfs/libgfs/bitmap.c
deleted file mode 100644
index 4d983a3..0000000
--- a/gfs/libgfs/bitmap.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Basic bitmap manipulation */
-#include <stdint.h>
-#include <stdio.h>
-#include <errno.h>
-#include "osi_user.h"
-#include "libgfs.h"
-#include "incore.h"
-
-
-#define BITMAP_SIZE(size, cpb) (size / cpb)
-
-#define BITMAP_BYTE_OFFSET(x, map) ((x % map->chunks_per_byte) \
-                                    * map->chunksize )
-
-#define BITMAP_MASK(chunksize) ((2 << (chunksize - 1)) - 1)
-
-uint64_t bitmap_size(struct bmap *bmap) {
-	return bmap->size;
-}
-
-int bitmap_create(struct bmap *bmap, uint64_t size, uint8_t chunksize)
-{
-	if((((chunksize >> 1) << 1) != chunksize) && chunksize != 1) {
-		log_err("chunksize must be a power of 2\n");
-		return -1;
-	}
-	if(chunksize > 8) {
-		log_err("chunksize must be <= 8\n");
-		return -1;
-	}
-	bmap->chunksize = chunksize;
-	bmap->chunks_per_byte = 8 / chunksize;
-
-	bmap->size = size;
-
-	/* Have to add 1 to BITMAP_SIZE since it's 0-based and mallocs
-	 * must be 1-based */
-	bmap->mapsize = BITMAP_SIZE(size, bmap->chunks_per_byte)+1;
-
-	if(!(bmap->map = malloc(sizeof(char) * bmap->mapsize))) {
-		log_err("Unable to allocate bitmap of size %"PRIu64"\n",
-			bmap->mapsize);
-		return ENOMEM;
-	}
-	if(!memset(bmap->map, 0, sizeof(char) * bmap->mapsize)) {
-		log_err("Unable to zero bitmap of size %"PRIu64"\n",
-			bmap->mapsize);
-		free(bmap->map);
-		bmap->map = NULL;
-		return ENOMEM;
-	}
-	log_debug("Allocated bitmap of size %"PRIu64
-		  " with %d chunks per byte\n",
-		  bmap->mapsize, bmap->chunks_per_byte);
-	return 0;
-}
-
-int bitmap_set(struct bmap *bmap, uint64_t offset, uint8_t val)
-{
-	char *byte = NULL;
-	uint64_t b = offset;
-
-	if(offset < bmap->size) {
-		byte = bmap->map + BITMAP_SIZE(offset, bmap->chunks_per_byte);
-		b = BITMAP_BYTE_OFFSET(offset, bmap);
-
-		*byte |= (val & BITMAP_MASK(bmap->chunksize)) << b;
-		return 0;
-	}
-	log_debug("offset %d out of bounds\n", offset);
-	return -1;
-}
-
-int bitmap_get(struct bmap *bmap, uint64_t bit, uint8_t *val)
-{
-	char *byte = NULL;
-	uint64_t b = bit;
-
-	if(bit < bmap->size) {
-		byte = bmap->map + BITMAP_SIZE(bit, bmap->chunks_per_byte);
-		b = BITMAP_BYTE_OFFSET(bit, bmap);
-
-		*val = (*byte & (BITMAP_MASK(bmap->chunksize) << b )) >> b;
-		return 0;
-	}
-	log_debug("offset %d out of bounds\n", bit);
-	return -1;
-}
-
-
-int bitmap_clear(struct bmap *bmap, uint64_t offset)
-{
-	char *byte = NULL;
-	uint64_t b = offset;
-
-	if(offset < bmap->size) {
-		byte = bmap->map + BITMAP_SIZE(offset, bmap->chunks_per_byte);
-		b = BITMAP_BYTE_OFFSET(offset, bmap);
-
-		*byte &= ~(BITMAP_MASK(bmap->chunksize) << b);
-		return 0;
-	}
-	log_debug("offset %d out of bounds\n", offset);
-	return -1;
-
-}
-
-void bitmap_destroy(struct bmap *bmap)
-{
-	if(bmap->map)
-		free(bmap->map);
-	bmap->size = 0;
-	bmap->mapsize = 0;
-	bmap->chunksize = 0;
-	bmap->chunks_per_byte = 0;
-}
diff --git a/gfs/libgfs/block_list.c b/gfs/libgfs/block_list.c
deleted file mode 100644
index 28047a6..0000000
--- a/gfs/libgfs/block_list.c
+++ /dev/null
@@ -1,267 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <inttypes.h>
-#include "libgfs.h"
-#include "gfs_ondisk.h"
-
-#define FREE		(0x0)  /*   0000 */
-#define BLOCK_IN_USE	(0x1)  /*   0001 */
-
-#define DIR_INDIR_BLK	(0x2)  /*   0010 */
-#define DIR_INODE	(0x3)  /*   0011 */
-#define FILE_INODE	(0x4)  /*   0100 */
-#define LNK_INODE	(0x5)
-#define BLK_INODE	(0x6)
-#define CHR_INODE	(0x7)
-#define FIFO_INODE	(0x8)
-#define SOCK_INODE	(0x9)
-#define DIR_LEAF_INODE  (0xA)  /*   1010 */
-#define JOURNAL_BLK     (0xB)  /*   1011 */
-#define OTHER_META	(0xC)  /*   1100 */
-#define FREE_META	(0xD)  /*   1101 */
-#define EATTR_META	(0xE)  /*   1110 */
-
-#define INVALID_META	(0xF)  /*   1111 */
-
-
-/* Must be kept in sync with mark_block enum in block_list.h */
-/* FIXME: Fragile */
-static int mark_to_gbmap[16] = {
-	FREE, BLOCK_IN_USE, DIR_INDIR_BLK, DIR_INODE, FILE_INODE,
-	LNK_INODE, BLK_INODE, CHR_INODE, FIFO_INODE, SOCK_INODE,
-	DIR_LEAF_INODE, JOURNAL_BLK, OTHER_META, FREE_META,
-	EATTR_META, INVALID_META
-};
-
-struct block_list *block_list_create(uint64_t size, enum block_list_type type)
-{
-	struct block_list *il;
-	log_info("Creating a block list of size %"PRIu64"...\n", size);
-
-	if ((il = malloc(sizeof(*il)))) {
-		if(!memset(il, 0, sizeof(*il))) {
-			log_err("Cannot set block list to zero\n");
-			return NULL;
-		}
-		il->type = type;
-
-		switch(type) {
-		case gbmap:
-			if(bitmap_create(&il->list.gbmap.group_map, size, 4)) {
-				stack;
-				free(il);
-				il = NULL;
-			}
-			if(bitmap_create(&il->list.gbmap.bad_map, size, 1)) {
-				stack;
-				free(il);
-				il = NULL;
-			}
-			if(bitmap_create(&il->list.gbmap.dup_map, size, 1)) {
-				stack;
-				free(il);
-				il = NULL;
-			}
-			if(bitmap_create(&il->list.gbmap.eattr_map, size, 1)) {
-				stack;
-				free(il);
-				il = NULL;
-			}
-			break;
-		default:
-			log_crit("Block list type %d not implemented\n",
-				type);
-			break;
-		}
-	}
-
-	return il;
-}
-
-int block_mark(struct block_list *il, uint64_t block, enum mark_block mark)
-{
-	int err = 0;
-
-	switch(il->type) {
-	case gbmap:
-		if(mark == bad_block) {
-			err = bitmap_set(&il->list.gbmap.bad_map, block, 1);
-		}
-		else if(mark == dup_block) {
-			err = bitmap_set(&il->list.gbmap.dup_map, block, 1);
-		}
-		else if(mark == eattr_block) {
-			err = bitmap_set(&il->list.gbmap.eattr_map, block, 1);
-		}
-		else {
-			err = bitmap_set(&il->list.gbmap.group_map, block,
-					 mark_to_gbmap[mark]);
-		}
-
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-	return err;
-}
-
-int block_set(struct block_list *il, uint64_t block, enum mark_block mark)
-{
-	int err = 0;
-	err = block_clear(il, block, mark);
-	if(!err)
-		err = block_mark(il, block, mark);
-	return err;
-}
-
-int block_clear(struct block_list *il, uint64_t block, enum mark_block m)
-{
-	int err = 0;
-
-	switch(il->type) {
-	case gbmap:
-		switch (m) {
-		case dup_block:
-			err = bitmap_clear(&il->list.gbmap.dup_map, block);
-			break;
-		case bad_block:
-			err = bitmap_clear(&il->list.gbmap.bad_map, block);
-			break;
-		case eattr_block:
-			err = bitmap_clear(&il->list.gbmap.eattr_map, block);
-			break;
-		default:
-			/* FIXME: check types */
-			err = bitmap_clear(&il->list.gbmap.group_map, block);
-			break;
-		}
-
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-	return err;
-}
-
-int block_check(struct block_list *il, uint64_t block, struct block_query *val)
-{
-	int err = 0;
-	val->block_type = 0;
-	val->bad_block = 0;
-	val->dup_block = 0;
-	switch(il->type) {
-	case gbmap:
-		if((err = bitmap_get(&il->list.gbmap.group_map, block,
-				     &val->block_type))) {
-			log_err("Unable to get block type for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		if((err = bitmap_get(&il->list.gbmap.bad_map, block,
-				     &val->bad_block))) {
-			log_err("Unable to get bad block status for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		if((err = bitmap_get(&il->list.gbmap.dup_map, block,
-				     &val->dup_block))) {
-			log_err("Unable to get duplicate status for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		if((err = bitmap_get(&il->list.gbmap.eattr_map, block,
-				     &val->eattr_block))) {
-			log_err("Unable to get eattr status for block %"
-				PRIu64"\n", block);
-			break;
-		}
-		break;
-	default:
-		log_err("block list type %d not implemented\n",
-			il->type);
-		err = -1;
-		break;
-	}
-
-	return err;
-}
-
-void *block_list_destroy(struct block_list *il)
-{
-	if(il) {
-		switch(il->type) {
-		case gbmap:
-			bitmap_destroy(&il->list.gbmap.group_map);
-			bitmap_destroy(&il->list.gbmap.bad_map);
-			bitmap_destroy(&il->list.gbmap.dup_map);
-			bitmap_destroy(&il->list.gbmap.eattr_map);
-			break;
-		default:
-			break;
-		}
-		free(il);
-		il = NULL;
-	}
-	return il;
-}
-
-
-int find_next_block_type(struct block_list *il, enum mark_block m, uint64_t *b)
-{
-	uint64_t i;
-	uint8_t val;
-	int found = 0;
-	for(i = *b; ; i++) {
-		switch(il->type) {
-		case gbmap:
-			if(i >= bitmap_size(&il->list.gbmap.dup_map))
-				return -1;
-
-			switch(m) {
-			case dup_block:
-				if(bitmap_get(&il->list.gbmap.dup_map, i,
-					      &val)) {
-					stack;
-					return -1;
-				}
-
-				if(val)
-					found = 1;
-				break;
-			case eattr_block:
-				if(bitmap_get(&il->list.gbmap.eattr_map, i,
-					      &val)) {
-					stack;
-					return -1;
-				}
-
-				if(val)
-					found = 1;
-				break;
-			default:
-				/* FIXME: add support for getting
-				 * other types */
-				log_err("Unhandled block type\n");
-			}
-			break;
-		default:
-			log_err("Unhandled block list type\n");
-			break;
-		}
-		if(found) {
-			*b = i;
-			return 0;
-		}
-	}
-	return -1;
-}
diff --git a/gfs/libgfs/file.c b/gfs/libgfs/file.c
deleted file mode 100644
index 7707cdf..0000000
--- a/gfs/libgfs/file.c
+++ /dev/null
@@ -1,233 +0,0 @@
-#include <stdint.h>
-#include "gfs_ondisk.h"
-#include "libgfs.h"
-
-/**
- * readi - Read a file
- * @ip: The GFS Inode
- * @buf: The buffer to place result into
- * @offset: File offset to begin reading from
- * @size: Amount of data to transfer
- *
- * Returns: The amount of data actually copied or the error
- */
-int readi(int disk_fd, struct gfs_inode *ip, void *bufin, uint64 offset,
-		  unsigned int size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	osi_buf_t *bh;
-	uint64_t lblock, dblock=0;
-	uint32_t extlen = 0;
-	unsigned int amount;
-	int not_new = 0;
-	int journaled = fs_is_jdata(ip);
-	int copied = 0;
-	int error = 0;
-	char *buf = bufin;
-
-	if (offset >= ip->i_di.di_size){
-		log_debug("readi:  Offset (%"PRIu64") is >= "
-			"the file size (%"PRIu64").\n",
-			offset, ip->i_di.di_size);
-		goto out;
-	}
-
-	if ((offset + size) > ip->i_di.di_size)
-		size = ip->i_di.di_size - offset;
-
-	if (!size){
-		log_err("readi:  Nothing to be read.\n");
-		goto out;
-	}
-
-	if (journaled){
-		lblock = offset / sdp->sd_jbsize;
-		offset %= sdp->sd_jbsize;
-	}
-	else{
-		lblock = offset >> sdp->sd_sb.sb_bsize_shift;
-		offset &= sdp->sd_sb.sb_bsize - 1;
-	}
-
-	if (fs_is_stuffed(ip))
-		offset += sizeof(struct gfs_dinode);
-	else if (journaled)
-		offset += sizeof(struct gfs_meta_header);
-
-
-	while (copied < size){
-		amount = size - copied;
-		if (amount > sdp->sd_sb.sb_bsize - offset)
-			amount = sdp->sd_sb.sb_bsize - offset;
-
-		if (!extlen){
-			error = fs_block_map(disk_fd, ip, lblock, &not_new, &dblock, &extlen);
-			if (error){
-				log_err("readi:  The call to fs_block_map() failed.\n");
-				goto out;
-			}
-		}
-
-		if (dblock){
-			error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize,
-									 dblock, &bh, 0);
-			if (error){
-				log_err("readi:  Unable to perform get_and_read_buf()\n");
-				goto out;
-			}
-
-			dblock++;
-			extlen--;
-		}
-		else
-			bh = NULL;
-
-		if (bh){
-			memcpy(buf+copied, BH_DATA(bh)+offset, amount);
-			relse_buf(bh);
-		} else {
-			memset(buf+copied, 0, amount);
-		}
-		copied += amount;
-		lblock++;
-
-		offset = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
- out:
-
-	return (error < 0) ? error : copied;
-}
-
-
-
-/**
- * writei - Write bytes to a file
- * @ip: The GFS inode
- * @buf: The buffer containing information to be written
- * @offset: The file offset to start writing at
- * @size: The amount of data to write
- *
- * Returns: The number of bytes correctly written or error code
- */
-int writei(int disk_fd, struct gfs_inode *ip, void *bufin, uint64_t offset,
-		   unsigned int size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	osi_buf_t *dibh, *bh;
-	uint64_t lblock, dblock;
-	uint32_t extlen = 0;
-	unsigned int amount;
-	int new;
-	int journaled = fs_is_jdata(ip);
-	const uint64_t start = offset;
-	int copied = 0;
-	int error = 0;
-	char *buf = bufin;
-
-	/*  Bomb out on writing nothing.
-	    Posix says we can't change the time here.  */
-
-	if (!size)
-		goto fail;  /*  Not really an error  */
-
-
-	if (fs_is_stuffed(ip) &&
-	    ((start + size) > (sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode)))){
-		error = fs_unstuff_dinode(disk_fd, ip);
-		if (error)
-			goto fail;
-	}
-
-
-	if (journaled){
-		lblock = offset / sdp->sd_jbsize;
-		offset %= sdp->sd_jbsize;
-	}
-	else{
-		lblock = offset >> sdp->sd_sb.sb_bsize_shift;
-		offset &= sdp->sd_sb.sb_bsize - 1;
-	}
-
-	if (fs_is_stuffed(ip))
-		offset += sizeof(struct gfs_dinode);
-	else if (journaled)
-		offset += sizeof(struct gfs_meta_header);
-
-
-	while (copied < size){
-		amount = size - copied;
-		if (amount > sdp->sd_sb.sb_bsize - offset)
-			amount = sdp->sd_sb.sb_bsize - offset;
-
-		if (!extlen){
-			new = TRUE;
-			error = fs_block_map(disk_fd, ip, lblock, &new, &dblock, &extlen);
-			if (error)
-				goto fail;
-			if(!dblock){
-				log_crit("fs_writei:  "
-					"Unable to map logical block to real block.\n");
-				log_crit("Uncircumventable error.\n");
-				exit(EXIT_FAILURE);
-			}
-		}
-
-		error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize, dblock,
-								 &bh, 0);
-		if (error)
-			goto fail;
-
-		if(journaled && dblock != ip->i_di.di_num.no_addr ) {
-			set_meta(bh, GFS_METATYPE_JD, GFS_FORMAT_JD);
-		}
-
-		memcpy(BH_DATA(bh)+offset, buf+copied, amount);
-		write_buf(disk_fd, bh, 0);
-		relse_buf(bh);
-
-		copied += amount;
-		lblock++;
-		dblock++;
-		extlen--;
-
-		offset = (journaled) ? sizeof(struct gfs_meta_header) : 0;
-	}
-
-
- out:
-	error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize,
-							 ip->i_num.no_addr, &dibh, 0);
-	if (error){
-		log_err("fs_writei:  "
-			"Unable to get inode buffer.\n");
-		return -1;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error){
-		log_err("fs_writei:  "
-			"Buffer is not a valid inode.\n");
-		relse_buf(dibh);
-		return -1;
-	}
-
-	if (ip->i_di.di_size < start + copied)
-		ip->i_di.di_size = start + copied;
-	ip->i_di.di_mtime = ip->i_di.di_ctime = osi_current_time();
-
-	gfs_dinode_out(&ip->i_di, (char *)BH_DATA(dibh));
-	write_buf(disk_fd, dibh, 0);
-	relse_buf(dibh);
-
-	return copied;
-
-
-
- fail:
-	if (copied)
-		goto out;
-
-	return error;
-}
-
diff --git a/gfs/libgfs/fs_bits.c b/gfs/libgfs/fs_bits.c
deleted file mode 100644
index db6f36d..0000000
--- a/gfs/libgfs/fs_bits.c
+++ /dev/null
@@ -1,348 +0,0 @@
-#include "incore.h"
-#include "libgfs.h"
-/**
- * fs_setbit - Set a bit in the bitmaps
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @block: the block to set
- * @new_state: the new state of the block
- *
- */
-static void fs_setbit(unsigned char *buffer, unsigned int buflen,
-		      uint32_t block, unsigned char new_state)
-{
-	unsigned char *byte, *end, cur_state;
-	unsigned int bit;
-
-	byte = buffer + (block / GFS_NBBY);
-	bit = (block % GFS_NBBY) * GFS_BIT_SIZE;
-	end = buffer + buflen;
-
-	if(byte >= end){
-		log_err("fs_setbit:  byte >= end\n");
-		exit(1);
-	}
-	cur_state = (*byte >> bit) & GFS_BIT_MASK;
-
-	*byte ^= cur_state << bit;
-	*byte |= new_state << bit;
-}
-
-static uint32_t fs_bitfit_core(struct gfs_sbd *sbp, uint64_t goal, uint64_t start,
-						uint64_t len, unsigned char old_state)
-{
-	uint64_t block;
-	struct block_query q;
-
-	log_debug("Goal: %"PRIu64", Start: %"PRIu64" len: %"PRIu64"\n",
-		  goal, start, len);
-	for(block = start+goal; block < start+len; block++) {
-		block_check(sbp->bl, block, &q);
-		switch(old_state) {
-		case GFS_BLKST_FREE:
-			switch(q.block_type) {
-			case block_free:
-				return block - start;
-			}
-			break;
-		case GFS_BLKST_FREEMETA:
-			switch(q.block_type) {
-			case meta_free:
-				return block - start;
-			}
-			break;
-		case GFS_BLKST_USEDMETA:
-			switch(q.block_type) {
-			case inode_dir:
-			case inode_file:
-			case inode_lnk:
-			case inode_blk:
-			case inode_chr:
-			case inode_fifo:
-			case inode_sock:
-			case indir_blk:
-			case leaf_blk:
-			case journal_blk:
-			case meta_other:
-			case meta_eattr:
-				return block - start;
-			}
-			break;
-		case GFS_BLKST_USED:
-			switch(q.block_type) {
-			case block_used:
-				return block - start;
-			}
-			break;
-		default:
-			log_err("Invalid type");
-			break;
-		}
-	}
-	return BFITNOENT;
-}
-/**
- * fs_bitfit - Find a free block in the bitmaps
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @goal: the block to try to allocate
- * @old_state: the state of the block we're looking for
- *
- * Return: the block number that was allocated
- */
-uint32_t fs_bitfit(unsigned char *buffer, unsigned int buflen,
-		   uint32_t goal, unsigned char old_state)
-{
-	unsigned char *byte, *end, alloc;
-	uint32_t blk = goal;
-	unsigned int bit;
-
-
-	byte = buffer + (goal / GFS_NBBY);
-	bit = (goal % GFS_NBBY) * GFS_BIT_SIZE;
-	end = buffer + buflen;
-	alloc = (old_state & 1) ? 0 : 0x55;
-
-	while (byte < end){
-		if ((*byte & 0x55) == alloc){
-			blk += (8 - bit) >> 1;
-
-			bit = 0;
-			byte++;
-
-			continue;
-		}
-
-		if (((*byte >> bit) & GFS_BIT_MASK) == old_state){
-			return blk;
-		}
-
-		bit += GFS_BIT_SIZE;
-		if (bit >= 8){
-			bit = 0;
-			byte++;
-		}
-
-		blk++;
-	}
-	return BFITNOENT;
-}
-
-/**
- * fs_bitcount - count the number of bits in a certain state
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @state: the state of the block we're looking for
- *
- * Returns: The number of bits
- */
-uint32_t fs_bitcount(unsigned char *buffer, unsigned int buflen,
-		     unsigned char state)
-{
-	unsigned char *byte, *end;
-	unsigned int bit;
-	uint32_t count = 0;
-
-	byte = buffer;
-	bit = 0;
-	end = buffer + buflen;
-
-	while (byte < end){
-		if (((*byte >> bit) & GFS_BIT_MASK) == state)
-			count++;
-
-		bit += GFS_BIT_SIZE;
-		if (bit >= 8){
-			bit = 0;
-			byte++;
-		}
-	}
-	return count;
-}
-
-
-/**
- * fs_blkalloc_internal - allocate a single block
- * @rgd: the resource group descriptor
- * @goal: the goal block in the RG
- * @old_state: the type of block to find
- * @new_state: the resulting block type
- * @do_it: if FALSE, we just find the block we would allocate
- *
- *
- * Returns:  returns the block allocated, or BFITNOENT on failure
- */
-uint32_t fs_blkalloc_internal(struct gfs_rgrpd *rgd, uint32_t goal,
-			      unsigned char old_state,
-			      unsigned char new_state, int do_it)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	uint32_t block = 0;
-	log_debug("fs_blkalloc_internal got %u as goal\n", goal);
-	goal = ((int)(goal - rgd->rd_ri.ri_data1) < 0)
-		? 0
-		: goal - rgd->rd_ri.ri_data1;
-
-
-	block = fs_bitfit_core(sdp, goal, rgd->rd_ri.ri_data1,
-			       rgd->rd_ri.ri_data, old_state);
-
-
-	if(block == BFITNOENT) {
-		log_debug("No bits left in old_state?\n"
-			  "\told_state   = %u\n"
-			  "\tnew_state   = %u\n"
-			  "\trg_free     = %u\n"
-			  "\trg_freemeta = %u\n",
-			old_state, new_state,
-			rgd->rd_rg.rg_free,
-			rgd->rd_rg.rg_freemeta);
-		return BFITNOENT;
-	}
-
-	log_debug("fs_blkalloc_internal found block %u\n", block);
-	switch(new_state) {
-	case GFS_BLKST_FREE:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, block_free);
-		break;
-	case GFS_BLKST_USED:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, block_used);
-		break;
-	case GFS_BLKST_USEDMETA:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, meta_other);
-		break;
-	case GFS_BLKST_FREEMETA:
-		block_set(sdp->bl, block + rgd->rd_ri.ri_data1, meta_free);
-		break;
-	}
-	return  block;
-}
-
-
-/*
- * fs_get_bitmap - get value of FS bitmap
- * @sdp: super block
- * @blkno: block number relative to file system
- *
- * This function gets the value of a bit of the
- * file system bitmap.
- * Possible state values for a block in the bitmap are:
- *  GFS_BLKST_FREE     (0)
- *  GFS_BLKST_USED     (1)
- *  GFS_BLKST_FREEMETA (2)
- *  GFS_BLKST_USEDMETA (3)
- *
- * Returns: state on success, -1 on error
- */
-int fs_get_bitmap(int disk_fd, struct gfs_sbd *sdp, uint64 blkno, struct gfs_rgrpd *rgd){
-	int           buf, val;
-	uint32_t        rgrp_block;
-/*  struct gfs_rgrpd	*rgd;*/
-	struct gfs_bitmap	*bits = NULL;
-	unsigned int  bit;
-	unsigned char *byte;
-	int local_rgd = 0;
-
-	if(check_range(sdp, blkno)){
-		log_warn("Block #%"PRIu64" is out of range.\n", blkno);
-		return -1;
-	}
-	if(rgd == NULL) {
-		local_rgd = 1;
-		rgd = fs_blk2rgrpd(sdp, blkno);
-	}
-	if(rgd == NULL){
-		log_err( "Unable to get rgrp for block #%"PRIu64"\n", blkno);
-		return -1;
-	}
-	if(fs_rgrp_read(disk_fd, rgd, FALSE)){ /* FALSE:don't try to fix (done elsewhere) */
-		log_err( "Unable to read rgrp.\n");
-		return -1;
-	}
-
-	rgrp_block = (uint32_t)(blkno - rgd->rd_ri.ri_data1);
-
-	for(buf= 0; buf < rgd->rd_ri.ri_length; buf++){
-		bits = &(rgd->rd_bits[buf]);
-		if(rgrp_block < ((bits->bi_start + bits->bi_len)*GFS_NBBY)){
-			break;
-		}
-	}
-
-	if(buf >= rgd->rd_ri.ri_length){
-		log_err( "Unable to locate bitmap entry for block #%"PRIu64"\n",
-			blkno);
-		fs_rgrp_relse(rgd);
-		return -1;
-	}
-
-	byte = (unsigned char *)((BH_DATA(rgd->rd_bh[buf]) + bits->bi_offset) +
-				 (rgrp_block/GFS_NBBY - bits->bi_start));
-	bit = (rgrp_block % GFS_NBBY) * GFS_BIT_SIZE;
-
-	val = ((*byte >> bit) & GFS_BIT_MASK);
-	if(local_rgd) {
-		fs_rgrp_relse(rgd);
-	}
-
-	return val;
-}
-
-
-/*
- * fs_set_bitmap
- * @sdp: super block
- * @blkno: block number relative to file system
- * @state: one of 4 possible states
- *
- * This function sets the value of a bit of the
- * file system bitmap.
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_set_bitmap(int disk_fd, struct gfs_sbd *sdp, uint64 blkno, int state)
-{
-	int           buf;
-	uint32_t        rgrp_block;
-	struct gfs_bitmap	*bits = NULL;
-	struct gfs_rgrpd	*rgd;
-
-	if((state != GFS_BLKST_FREE) && (state != GFS_BLKST_USED) &&
-	   (state != GFS_BLKST_FREEMETA) && (state != GFS_BLKST_USEDMETA)){
-		return -1;
-	}
-
-	rgd = fs_blk2rgrpd(sdp, blkno);
-
-	if(!rgd) {
-		log_err("Unable to get resource group for blkno %"PRIu64"\n",
-			blkno);
-		return -1;
-	}
-
-	if(fs_rgrp_read(disk_fd, rgd, FALSE)) {
-		stack;
-		return -1;
-	}
-	rgrp_block = (uint32_t)(blkno - rgd->rd_ri.ri_data1);
-	for(buf= 0; buf < rgd->rd_ri.ri_length; buf++){
-		bits = &(rgd->rd_bits[buf]);
-		if(rgrp_block < ((bits->bi_start + bits->bi_len)*GFS_NBBY)){
-			break;
-		}
-	}
-
-	fs_setbit((unsigned char *)BH_DATA(rgd->rd_bh[buf]) + bits->bi_offset,
-		  bits->bi_len,
-		  (rgrp_block - (bits->bi_start*GFS_NBBY)),
-		  state);
-
-
-	if(write_buf(disk_fd, rgd->rd_bh[buf], 0)){
-		fs_rgrp_relse(rgd);
-		return -1;
-	}
-
-	fs_rgrp_relse(rgd);
-	return 0;
-}
diff --git a/gfs/libgfs/fs_bmap.c b/gfs/libgfs/fs_bmap.c
deleted file mode 100644
index a75f774..0000000
--- a/gfs/libgfs/fs_bmap.c
+++ /dev/null
@@ -1,522 +0,0 @@
-#include "libgfs.h"
-
-typedef struct metapath
-{
-	uint64              mp_list[GFS_MAX_META_HEIGHT];
-}metapath_t;
-
-
-/**
- * fs_unstuff_dinode - Unstuff a dinode when the data has grown too big
- * @ip: The GFS inode to unstuff
- * * This routine unstuffs a dinode and returns it to a "normal" state such
- * that the height can be grown in the traditional way.
- *
- * Returns: 0 on success, -EXXXX on failure
- */
-int fs_unstuff_dinode(int disk_fd, struct gfs_inode *ip)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	osi_buf_t *bh = NULL;
-	osi_buf_t *dibh = NULL;
-	int journaled = fs_is_jdata(ip);
-	uint64 block = 0;
-	int error;
-
-	log_debug("Unstuffing inode %"PRIu64" - %u\n", ip->i_di.di_num.no_addr,
-		  journaled);
-
-	if(!fs_is_stuffed(ip)){
-		log_err("Trying to unstuff a dinode that is already unstuffed.\n");
-		return -1;
-	}
-	error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, ip->i_num.no_addr,
-							 &dibh, 0);
-	if (error) {
-		stack;
-		goto fail;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error) {
-		stack;
-		goto fail;
-	}
-
-	if (ip->i_di.di_size){
-		log_err("Allocating new block for unstuffed dinode\n");
-		if(journaled){
-			error = fs_metaalloc(disk_fd, ip, &block);
-			if (error) {
-				stack;
-				goto fail;
-			}
-			log_err("Got block %"PRIu64"\n", block);
-			error = get_buf(sdp->sd_sb.sb_bsize, block, &bh);
-			if (error) {
-				stack;
-				goto fail;
-			}
-
-			set_meta(bh, GFS_METATYPE_JD, GFS_FORMAT_JD);
-
-			memcpy(BH_DATA(bh)+sizeof(struct gfs_meta_header),
-			       BH_DATA(dibh)+sizeof(struct gfs_dinode),
-			       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-			error = write_buf(disk_fd, bh, 0);
-			if(error) {
-				stack;
-				goto fail;
-			}
-			relse_buf(bh);
-			block_set(sdp->bl, block, journal_blk);
-		}
-		else{
-			error = fs_blkalloc(disk_fd, ip, &block);
-
-			if(error) {
-				stack;
-				goto fail;
-			}
-
-			error = get_buf(sdp->sd_sb.sb_bsize, block, &bh);
-			if (error) {
-				stack;
-				goto fail;
-			}
-
-			memcpy(BH_DATA(bh)+sizeof(struct gfs_meta_header),
-			       BH_DATA(dibh)+sizeof(struct gfs_dinode),
-			       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-			error = write_buf(disk_fd, bh, 0);
-			if(error) {
-				stack;
-				goto fail;
-			}
-			relse_buf(bh);
-			block_set(sdp->bl, block, block_used);
-		}
-	}
-
-	bh = NULL;
-	/*  Set up the pointer to the new block  */
-
-	memset(BH_DATA(dibh)+sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-	if (ip->i_di.di_size){
-		((uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode)))[0] = cpu_to_gfs64(block);
-		ip->i_di.di_blocks++;
-	}
-
-	ip->i_di.di_height = 1;
-
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err("Dinode unstuffed, but unable to write back dinode.\n");
-		goto fail;
-	}
-	relse_buf(dibh);
-
-	return 0;
-
-
-
- fail:
-	if(bh) relse_buf(bh);
-	if(dibh) relse_buf(dibh);
-
-	return error;
-}
-
-
-/**
- * calc_tree_height - Calculate the height of a metadata tree
- * @ip: The GFS inode
- * @size: The proposed size of the file
- *
- * Work out how tall a metadata tree needs to be in order to accommodate a
- * file of a particular size. If size is less than the current size of
- * the inode, then the current size of the inode is used instead of the
- * supplied one.
- *
- * Returns: the height the tree should be
- */
-
-static unsigned int calc_tree_height(struct gfs_inode *ip, uint64 size)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	uint64 *arr;
-	unsigned int max, height;
-
-	if (ip->i_di.di_size > size)
-		size = ip->i_di.di_size;
-
-	if (fs_is_jdata(ip)){
-		arr = sdp->sd_jheightsize;
-		max = sdp->sd_max_jheight;
-	}
-	else{
-		arr = sdp->sd_heightsize;
-		max = sdp->sd_max_height;
-	}
-	for (height = 0; height < max; height++)
-		if (arr[height] >= size)
-			break;
-
-	return height;
-}
-
-
-/**
- * build_height - Build a metadata tree of the requested height
- * @ip: The GFS inode
- * @height: The height to build to
- *
- *
- * Returns: 0 on success, -EXXXX on failure
- */
-static int build_height(int disk_fd, struct gfs_inode *ip, int height)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	osi_buf_t *bh, *dibh;
-	uint64 block, *bp;
-	unsigned int x;
-	int new_block;
-	int error;
-
-	while (ip->i_di.di_height < height){
-		error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize,
-								 ip->i_num.no_addr, &dibh, 0);
-		if (error)
-			goto fail;
-
-		new_block = FALSE;
-		bp = (uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode));
-		for (x = 0; x < sdp->sd_diptrs; x++, bp++)
-			if (*bp){
-				new_block = TRUE;
-				break;
-			}
-
-
-		if (new_block){
-			/*  Get a new block, fill it with the old direct pointers and write it out  */
-			error = fs_metaalloc(disk_fd, ip, &block);
-			if (error)
-				goto fail_drelse;
-
-			error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, block, &bh, 0);
-			if (error)
-				goto fail_drelse;
-
-			set_meta(bh, GFS_METATYPE_IN, GFS_FORMAT_IN);
-			/*
-			  gfs_buffer_copy_tail(bh, sizeof(struct gfs_indirect),
-			  dibh, sizeof(struct gfs_dinode));
-			*/
-			log_err("ATTENTION -- Not doing copy_tail...\n");
-			exit(1);
-			error = -1;
-			goto fail_drelse;
-			if((error = write_buf(disk_fd, bh, 0))){
-				log_err( "Unable to write new buffer #%"PRIu64".\n",
-					BH_BLKNO(bh));
-				goto fail_drelse;
-			}
-			relse_buf(bh);
-		}
-
-
-		/*  Set up the new direct pointer and write it out to disk  */
-
-		memset(BH_DATA(dibh)+sizeof(struct gfs_dinode), 0,
-		       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-		if (new_block){
-			((uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode)))[0] = cpu_to_gfs64(block);
-			ip->i_di.di_blocks++;
-		}
-
-		ip->i_di.di_height++;
-
-		gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-		write_buf(disk_fd, dibh, 0);
-		relse_buf(dibh);
-	}
-
-	return 0;
-
-
-
- fail_drelse:
-	relse_buf(dibh);
-
- fail:
-	return error;
-}
-
-
-static void find_metapath(struct gfs_inode *ip, metapath_t *mp, uint64 block)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	unsigned int i;
-
-	for (i = ip->i_di.di_height; i--; ){
-		mp->mp_list[i] = block % sdp->sd_inptrs;
-		block /= sdp->sd_inptrs;
-	}
-}
-
-
-/**
- * metapointer - Return pointer to start of metadata in a buffer
- * @bh: The buffer
- * @level: The metadata level (0 = dinode)
- * @mp: The metapath
- *
- * Return a pointer to the block number of the next level of the metadata
- * tree given a buffer containing the pointer to the current level of the
- * metadata tree.
- */
-
-static uint64 *metapointer(osi_buf_t *bh, unsigned int level, metapath_t *mp)
-{
-	int head_size = (level > 0) ? sizeof(struct gfs_indirect) : sizeof(struct gfs_dinode);
-	return ((uint64 *)(BH_DATA(bh) + head_size)) + mp->mp_list[level];
-}
-
-
-/**
- * get_metablock - Get the next metadata block in metadata tree
- * @ip: The GFS inode
- * @bh: Buffer containing the pointers to metadata blocks
- * @level: The level of the tree (0 = dinode)
- * @mp: The metapath
- * @create: Non-zero if we may create a new meatdata block
- * @new: Used to indicate if we did create a new metadata block
- * @block: the returned disk block number
- *
- * Given a metatree, complete to a particular level, checks to see if the next
- * level of the tree exists. If not the next level of the tree is created.
- * The block number of the next level of the metadata tree is returned.
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static int get_metablock(int disk_fd, struct gfs_inode *ip,
-			 osi_buf_t *bh, unsigned int level, metapath_t *mp,
-			 int create, int *new, uint64 *block)
-{
-	uint64 *ptr = metapointer(bh, level, mp);
-	int error = 0;
-
-	*new = 0;
-	*block = 0;
-
-	if (*ptr){
-		*block = gfs64_to_cpu(*ptr);
-		goto out;
-	}
-
-	if (!create)
-		goto out;
-
-	error = fs_metaalloc(disk_fd, ip, block);
-	if (error)
-		goto out;
-
-	*ptr = cpu_to_gfs64(*block);
-	ip->i_di.di_blocks++;
-	write_buf(disk_fd, bh, 0);
-
-	*new = 1;
-
- out:
-	return error;
-}
-
-
-/**
- * get_datablock - Get datablock number from metadata block
- * @rgd: rgrp to allocate from if necessary
- * @ip: The GFS inode
- * @bh: The buffer containing pointers to datablocks
- * @mp: The metapath
- * @create: Non-zero if we may create a new data block
- * @new: Used to indicate if we created a new data block
- * @block: the returned disk block number
- *
- * Given a fully built metadata tree, checks to see if a particular data
- * block exists. It is created if it does not exist and the block number
- * on disk is returned.
- *
- * Returns: 0 on success, -EXXX on failure
- */
-
-static int get_datablock(int disk_fd, struct gfs_inode *ip,
-			 osi_buf_t *bh, metapath_t *mp,
-			 int create, int *new, uint64 *block)
-{
-	uint64 *ptr = metapointer(bh, ip->i_di.di_height - 1, mp);
-	int error = 0;
-
-	*new = 0;
-	*block = 0;
-
-	if (*ptr){
-		*block = gfs64_to_cpu(*ptr);
-		goto out;
-	}
-
-	if (!create)
-		goto out;
-
-	if (fs_is_jdata(ip)){
-		error = fs_metaalloc(disk_fd, ip, block);
-		if (error)
-			goto out;
-	}
-	else {
-		error = fs_blkalloc(disk_fd, ip, block);
-		if (error)
-			goto out;
-	}
-
-	*ptr = cpu_to_gfs64(*block);
-	ip->i_di.di_blocks++;
-	write_buf(disk_fd, bh, 0);
-
-	*new = 1;
-
- out:
-	return error;
-}
-
-
-/**
- * fs_block_map - Map a block from an inode to a disk block
- * @ip: The GFS inode
- * @lblock: The logical block number
- * @new: Value/Result argument (1 = may create/did create new blocks)
- * @dblock: the disk block number of the start of an extent
- * @extlen: the size of the extent
- *
- * Find the block number on the current device which corresponds to an
- * inode's block. If the block had to be created, "new" will be set.
- *
- * Returns: 0 on success, -EXXX on failure
- */
-int fs_block_map(int disk_fd, struct gfs_inode *ip, uint64 lblock, int *new,
-				 uint64 *dblock, uint32 *extlen)
-{
-	struct gfs_sbd *sdp = ip->i_sbd;
-	osi_buf_t *bh = NULL;
-	metapath_t mp;
-	int create = *new;
-	unsigned int bsize;
-	unsigned int height;
-	unsigned int x, end_of_metadata;
-	unsigned int nptrs;
-	uint64 tmp_dblock;
-	int tmp_new;
-	int error = 0;
-
-	*new = 0;
-	*dblock = 0;
-	if (extlen)
-		*extlen = 0;
-
-	if (fs_is_stuffed(ip)){
-		*dblock = ip->i_num.no_addr;
-		if (extlen)
-			*extlen = 1;
-		goto out;
-	}
-	bsize = (fs_is_jdata(ip)) ? sdp->sd_jbsize : sdp->sd_sb.sb_bsize;
-
-	height = calc_tree_height(ip, (lblock + 1) * bsize);
-	if (ip->i_di.di_height < height){
-		if (!create){
-			error = 0;
-			goto fail;
-		}
-
-		error = build_height(disk_fd, ip, height);
-		if (error)
-			goto fail;
-	}
-
-	error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize,
-							 ip->i_num.no_addr, &bh, 0);
-	if (error)
-		goto fail;
-
-	find_metapath(ip, &mp, lblock);
-	end_of_metadata = ip->i_di.di_height - 1;
-
-	for (x = 0; x < end_of_metadata; x++){
-		error = get_metablock(disk_fd, ip, bh, x, &mp, create, new, dblock);
-		relse_buf(bh); bh = NULL;
-		if (error)
-			goto fail;
-		if (!*dblock)
-			goto out;
-
-		error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize,
-								 *dblock, &bh, 0);
-		if (error)
-			goto fail;
-	}
-
-	error = get_datablock(disk_fd, ip, bh, &mp, create, new, dblock);
-	if (error)
-		goto fail_drelse;
-
-	if (extlen && *dblock){
-		*extlen = 1;
-
-		if (!*new){
-			nptrs = (end_of_metadata) ? sdp->sd_inptrs : sdp->sd_diptrs;
-			while (++mp.mp_list[end_of_metadata] < nptrs){
-				error = get_datablock(disk_fd, ip, bh, &mp, 0, &tmp_new,
-						      &tmp_dblock);
-				if(error){
-					log_err( "Unable to perform get_datablock.\n");
-					goto fail;
-				}
-
-				if (*dblock + *extlen != tmp_dblock)
-					break;
-
-				(*extlen)++;
-			}
-		}
-	}
-
-	relse_buf(bh);
-
-
- out:
-	if (*new){
-		error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, ip->i_num.no_addr,
-								 &bh, 0);
-		if (error)
-			goto fail;
-		gfs_dinode_out(&ip->i_di, BH_DATA(bh));
-		write_buf(disk_fd, bh, 0);
-		relse_buf(bh);
-	}
-	return 0;
-
-
-
- fail_drelse:
-	if(bh)
-		relse_buf(bh);
-
- fail:
-	return error;
-}
diff --git a/gfs/libgfs/fs_dir.c b/gfs/libgfs/fs_dir.c
deleted file mode 100644
index 63187a0..0000000
--- a/gfs/libgfs/fs_dir.c
+++ /dev/null
@@ -1,1683 +0,0 @@
-#include "incore.h"
-#include "link.h"
-#include "libgfs.h"
-
-#define dir_hash(qstr) (gfs_dir_hash((char *)(qstr)->name, (qstr)->len))
-
-/* Detect directory is a stuffed inode */
-int gfs_inode_is_stuffed(struct gfs_inode *ip)
-{
-	return !ip->i_di.di_height;
-}
-
-/**
- * dirent_first - Return the first dirent
- * @bh: The buffer
- * @dent: Pointer to list of dirents
- *
- * return first dirent whether bh points to leaf or stuffed dinode
- *
- * Returns: IS_LEAF or IS_DINODE
- */
-int dirent_first(osi_buf_t *bh, struct gfs_dirent **dent)
-{
-	struct gfs_leaf *leaf;
-	struct gfs_dinode *dinode;
-
-	leaf = (struct gfs_leaf *)BH_DATA(bh);
-
-	if (gfs32_to_cpu(leaf->lf_header.mh_type) == GFS_METATYPE_LF)
-	{
-		*dent = (struct gfs_dirent *)(BH_DATA(bh) + sizeof(struct gfs_leaf));
-
-		return IS_LEAF;
-	}
-	else
-	{
-		dinode = (struct gfs_dinode *)BH_DATA(bh);
-		if(gfs32_to_cpu(dinode->di_header.mh_type) != GFS_METATYPE_DI){
-			log_err("buffer is not GFS_METATYPE_[DI | LF]\n");
-			return -1;
-		}
-
-		*dent = (struct gfs_dirent *)(BH_DATA(bh) + sizeof(struct gfs_dinode));
-
-		return IS_DINODE;
-	}
-}
-
-
-/**
- * dirent_next - Next dirent
- * @bh: The buffer
- * @dent: Pointer to list of dirents
- *
- * Returns: 0 on success, error code otherwise
- */
-int dirent_next(osi_buf_t *bh, struct gfs_dirent **dent)
-{
-	struct gfs_dirent *tmp, *cur;
-	char *bh_end;
-	uint32 cur_rec_len;
-
-	cur = *dent;
-	bh_end = BH_DATA(bh) + BH_SIZE(bh);
-
-	cur_rec_len = gfs16_to_cpu(cur->de_rec_len);
-
-	if ((char *)cur + cur_rec_len >= bh_end){
-		if((char *)cur + cur_rec_len != bh_end){
-			log_err("Bad record length causing failure in dirent_next()\n");
-			return -1;
-		}
-		return -ENOENT;
-	}
-
-	tmp = (struct gfs_dirent *)((char *)cur + cur_rec_len);
-
-	if((char *)tmp + gfs16_to_cpu(tmp->de_rec_len) > bh_end){
-		log_err("Bad record length causing failure in dirent_next\n");
-		return -1;
-	}
-
-	/*  only the first dent could ever have de_ino == 0  */
-	if(!tmp->de_inum.no_formal_ino){
-		char tmp_name[256];
-
-		memcpy(tmp_name, cur+sizeof(struct gfs_dirent), gfs16_to_cpu(cur->de_name_len));
-		tmp_name[gfs16_to_cpu(cur->de_name_len)] = '\0';
-		log_err("dirent_next:  "
-			"A non-first dir entry has zero formal inode.\n");
-		log_err("\tFaulty dirent after (%s) in block #%"PRIu64".\n",
-			tmp_name, BH_BLKNO(bh));
-
-		return -1;
-	}
-
-	*dent = tmp;
-
-	return 0;
-}
-
-
-/**
- * dirent_del - Delete a dirent
- * @dip: The GFS inode
- * @bh: The buffer
- * @prev: The previous dirent
- * @cur: The current dirent
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int dirent_del(int disk_fd, struct gfs_inode *dip, osi_buf_t *bh,
-	       struct gfs_dirent *prev, struct gfs_dirent *cur){
-	uint32 cur_rec_len, prev_rec_len;
-
-	dip->i_di.di_entries--;
-	if(!cur->de_inum.no_formal_ino){
-		log_err("dirent_del:  "
-			"Can not delete dirent with !no_formal_ino.\n");
-		return -1;
-	}
-
-	/*  If there is no prev entry, this is the first entry in the block.
-	    The de_rec_len is already as big as it needs to be.  Just zero
-	    out the inode number and return.  */
-
-	if (!prev){
-		cur->de_inum.no_formal_ino = 0;  /*  No endianess worries  */
-		if (write_buf(disk_fd, bh, 0)){
-			log_err("dirent_del: Bad write_buf.\n");
-			return -EIO;
-		}
-		return 0;
-	}
-
-	/*  Combine this dentry with the previous one.  */
-
-	prev_rec_len = gfs16_to_cpu(prev->de_rec_len);
-	cur_rec_len = gfs16_to_cpu(cur->de_rec_len);
-
-	if((char *)prev + prev_rec_len != (char *)cur){
-		log_err("dirent_del: Bad bounds for directory entries.\n");
-		return -1;
-	}
-
-	if((char *)(cur) + cur_rec_len > BH_DATA(bh) + BH_SIZE(bh)){
-		log_err("dirent_del: Directory entry has record length"
-			" longer than buffer.\n");
-		return -1;
-	}
-
-	log_debug("Updating previous record from %u to %u\n",
-		  prev_rec_len, prev_rec_len+cur_rec_len);
-	prev_rec_len += cur_rec_len;
-	prev->de_rec_len = cpu_to_gfs16(prev_rec_len);
-
-	if(write_buf(disk_fd, bh, 0)){
-		log_err("dirent_del: Bad write_buf.\n");
-		return -EIO;
-	}
-
-	return 0;
-}
-
-
-/**
- * get_leaf - Get leaf
- * @dip:
- * @leaf_no:
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int get_leaf(int disk_fd, struct gfs_inode *dip, uint64 leaf_no,
-			 osi_buf_t **bhp)
-{
-	int error;
-
-	error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize, leaf_no,
-							 bhp, 0);
-	if (error) {
-		log_err("Unable to read leaf buffer #%"PRIu64"\n", leaf_no);
-		return error;
-	}
-
-	error = check_meta(*bhp, GFS_METATYPE_LF);
-
-	if(error) {
-		log_err("Metatype for block #%"PRIu64" is not type 'leaf'\n",
-			leaf_no);
-		relse_buf(*bhp);
-	}
-	return error;
-}
-
-
-/**
- * get_first_leaf - Get first leaf
- * @dip: The GFS inode
- * @lindex:
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int get_first_leaf(int disk_fd, struct gfs_inode *dip, uint32 lindex,
-				   osi_buf_t **bh_out)
-{
-	uint64 leaf_no;
-	int error;
-
-	error = get_leaf_nr(disk_fd, dip, lindex, &leaf_no);
-	if (!error)
-		error = get_leaf(disk_fd, dip, leaf_no, bh_out);
-
-	return error;
-}
-
-
-/**
- * get_next_leaf - Get next leaf
- * @dip: The GFS inode
- * @bh_in: The buffer
- * @bh_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int get_next_leaf(int disk_fd, struct gfs_inode *dip,osi_buf_t *bh_in,osi_buf_t **bh_out)
-{
-	struct gfs_leaf *leaf;
-	int error;
-
-	leaf = (struct gfs_leaf *)BH_DATA(bh_in);
-
-	if (!leaf->lf_next)
-		error = -ENOENT;
-	else
-		error = get_leaf(disk_fd, dip, gfs64_to_cpu(leaf->lf_next), bh_out);
-	return error;
-}
-
-/**
- * leaf_search
- * @bh:
- * @id:
- * @dent_out:
- * @dent_prev:
- *
- * Returns:
- */
-static int leaf_search(osi_buf_t *bh, identifier_t *id,
-                       struct gfs_dirent **dent_out,
-		       struct gfs_dirent **dent_prev)
-{
-	uint32 hash;
-	struct gfs_dirent *dent, *prev = NULL;
-	unsigned int entries = 0, x = 0;
-	int type;
-
-	type = dirent_first(bh, &dent);
-
-	if (type == IS_LEAF){
-		struct gfs_leaf *leaf = (struct gfs_leaf *)BH_DATA(bh);
-		entries = gfs16_to_cpu(leaf->lf_entries);
-	} else if (type == IS_DINODE) {
-		struct gfs_dinode *dinode = (struct gfs_dinode *)(BH_DATA(bh));
-		entries = gfs32_to_cpu(dinode->di_entries);
-	} else {
-		log_err("type != IS_LEAF && type != IS_DINODE\n");
-		return -1;
-	}
-
-	if(id->type == ID_FILENAME){
-		hash = dir_hash(id->filename);
-
-		do{
-			if (!dent->de_inum.no_formal_ino){
-				prev = dent;
-				continue;
-			}
-
-			if (gfs32_to_cpu(dent->de_hash) == hash &&
-			    fs_filecmp(id->filename, (char *)(dent + 1),
-				       gfs16_to_cpu(dent->de_name_len))){
-				*dent_out = dent;
-				if (dent_prev)
-					*dent_prev = prev;
-				return 0;
-			}
-
-			if(x >= entries){
-				log_err("x >= entries (%u >= %u)\n", x, entries);
-				return -1;
-			}
-			x++;
-			prev = dent;
-		} while (dirent_next(bh, &dent) == 0);
-	} else if(id->type == ID_INUM){
-		struct gfs_inum inum;
-
-		do{
-			if (!dent->de_inum.no_formal_ino){
-				prev = dent;
-				continue;
-			}
-
-			gfs_inum_in(&inum, (char *)&dent->de_inum);
-
-			if(inum.no_addr == id->inum->no_addr){
-				*dent_out = dent;
-				if(dent_prev)
-					*dent_prev = prev;
-				return 0;
-			}
-
-			if(x >= entries){
-				log_err("x >= entries (%u >= %u)\n", x, entries);
-				return -1;
-			}
-			x++;
-			prev = dent;
-		} while (dirent_next(bh, &dent) == 0);
-	} else {
-		log_err("leaf_search:  Invalid type for identifier.\n");
-		exit(1);
-	}
-
-	return -ENOENT;
-}
-
-
-/**
- * linked_leaf_search - Linked leaf search
- * @dip: The GFS inode
- * @id:
- * @dent_out:
- * @dent_prev:
- * @bh_out:
- *
- * Returns: 0 on sucess, error code otherwise
- */
-
-static int linked_leaf_search(int disk_fd, struct gfs_inode *dip,
-							  identifier_t *id, struct gfs_dirent **dent_out,
-			      struct gfs_dirent **dent_prev, osi_buf_t **bh_out)
-{
-	osi_buf_t *bh = NULL, *bh_next;
-	uint32 hsize, lindex;
-	uint32 hash;
-	int error = 0;
-
-	hsize = 1 << dip->i_di.di_depth;
-	if(hsize * sizeof(uint64) != dip->i_di.di_size){
-		log_err("hsize * sizeof(uint64) != dip->i_di.di_size\n");
-		return -1;
-	}
-
-	/*  Figure out the address of the leaf node.  */
-
-	if(id->type == ID_FILENAME){
-		hash = dir_hash(id->filename);
-		lindex = hash >> (32 - dip->i_di.di_depth);
-
-		error = get_first_leaf(disk_fd, dip, lindex, &bh_next);
-		if (error){
-			return error;
-		}
-
-		/*  Find the entry  */
-		do{
-			if (bh)
-				relse_buf(bh);
-
-			bh = bh_next;
-
-			error = leaf_search(bh, id, dent_out, dent_prev);
-			switch (error){
-			case 0:
-				*bh_out = bh;
-				return 0;
-
-			case -ENOENT:
-				break;
-
-			default:
-				relse_buf(bh);
-				return error;
-			}
-
-			error = get_next_leaf(disk_fd, dip, bh, &bh_next);
-		}while (!error);
-
-		relse_buf(bh);
-	} else if(id->type == ID_INUM){
-		for(lindex=0; lindex < (1 << dip->i_di.di_depth); lindex++){
-			error = get_first_leaf(disk_fd, dip, lindex, &bh_next);
-			if (error){
-				return error;
-			}
-
-			/*  Find the entry  */
-			do{
-				if (bh)
-					relse_buf(bh);
-
-				bh = bh_next;
-
-				error = leaf_search(bh, id, dent_out, dent_prev);
-				switch (error){
-				case 0:
-					*bh_out = bh;
-					return 0;
-
-				case -ENOENT:
-					break;
-
-				default:
-					relse_buf(bh);
-					return error;
-				}
-
-				error = get_next_leaf(disk_fd, dip, bh, &bh_next);
-			}while (!error);
-		}
-	} else {
-		log_err("linked_leaf_search:  Invalid type for identifier.\n");
-		exit(1);
-	}
-	return error;
-}
-
-
-/**
- * dir_e_search -
- * @dip: The GFS inode
- * @id:
- * @inode:
- *
- * Returns:
- */
-static int dir_e_search(int disk_fd, struct gfs_inode *dip,
-						identifier_t *id, unsigned int *type)
-{
-	osi_buf_t *bh = NULL;
-	struct gfs_dirent *dent;
-	int error;
-
-	error = linked_leaf_search(disk_fd, dip, id, &dent, NULL, &bh);
-	if (error){
-		return error;
-	}
-
-	if(id->type == ID_FILENAME){
-		if(id->inum){
-			log_err("dir_e_search:  Illegal parameter.  inum must be NULL.\n");
-			exit(1);
-		}
-		if(!(id->inum = (struct gfs_inum *)malloc(sizeof(struct gfs_inum)))) {
-			log_err("Unable to allocate inum structure\n");
-			return -1;
-		}
-		if(!memset(id->inum, 0, sizeof(struct gfs_inum))) {
-			log_err("Unable to zero inum structure\n");
-			return -1;
-		}
-
-		gfs_inum_in(id->inum, (char *)&dent->de_inum);
-	} else {
-		if(id->filename){
-			log_err("dir_e_search:  Illegal parameter.  name must be NULL.\n");
-			exit(1);
-		}
-		if(!(id->filename = (osi_filename_t *)malloc(sizeof(osi_filename_t)))) {
-			log_err("Unable to allocate osi_filename structure\n");
-			return -1;
-		}
-		if(!(memset(id->filename, 0, sizeof(osi_filename_t)))) {
-			log_err("Unable to zero osi_filename structure\n");
-			return -1;
-		}
-
-		id->filename->len = gfs16_to_cpu(dent->de_name_len);
-		if(!(id->filename->name = malloc(id->filename->len))) {
-			log_err("Unable to allocate name in osi_filename structure\n");
-			free(id->filename);
-			return -1;
-		}
-		if(!(memset(id->filename->name, 0, id->filename->len))) {
-			log_err("Unable to zero name in osi_filename structure\n");
-			free(id->inum);
-			free(id->filename);
-			return -1;
-		}
-
-		memcpy(id->filename->name, (char *)dent+sizeof(struct gfs_dirent),
-		       id->filename->len);
-	}
-	if (type)
-		*type = gfs16_to_cpu(dent->de_type);
-
-	relse_buf(bh);
-
-	return 0;
-}
-
-
-/**
- * dir_l_search -
- * @dip: The GFS inode
- * @id:
- * @inode:
- *
- * Returns:
- */
-static int dir_l_search(int disk_fd, struct gfs_inode *dip, identifier_t *id,
-						unsigned int *type)
-{
-	osi_buf_t *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	if(!fs_is_stuffed(dip)){
-		log_err("A linear search was attempted on a directory "
-			"that is not stuffed.\n");
-		return -1;
-	}
-
-	error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize,
-							 dip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-
-	error = leaf_search(dibh, id, &dent, NULL);
-	if (error)
-		goto out_drelse;
-
-	if(id->type == ID_FILENAME){
-		if(id->inum){
-			log_err("dir_l_search:  Illegal parameter.  inum must be NULL.\n");
-			exit(1);
-		}
-		id->inum = (struct gfs_inum *)malloc(sizeof(struct gfs_inum));
-		// FIXME: handle failed malloc
-		memset(id->inum, 0, sizeof(struct gfs_inum));
-
-		gfs_inum_in(id->inum, (char *)&dent->de_inum);
-	} else {
-		if(id->filename){
-			log_err("dir_l_search:  Illegal parameter.  name must be NULL.\n");
-			exit(1);
-		}
-		id->filename = (osi_filename_t *)malloc(sizeof(osi_filename_t));
-		// FIXME: handle failed malloc
-		memset(id->filename, 0, sizeof(osi_filename_t));
-
-		id->filename->len = gfs16_to_cpu(dent->de_name_len);
-		id->filename->name = malloc(id->filename->len);
-		// FIXME: handle failed malloc
-		memset(id->filename->name, 0, id->filename->len);
-
-		memcpy(id->filename->name, (char *)dent+sizeof(struct gfs_dirent),
-		       id->filename->len);
-	}
-	if(type)
-		*type = gfs16_to_cpu(dent->de_type);
-
-
- out_drelse:
-	relse_buf(dibh);
-
- out:
-	return error;
-}
-
-
-/**
- * dir_make_exhash - Convet a stuffed directory into an ExHash directory
- * @dip: The GFS inode
- *
- * Returns: 0 on success, error code otherwise
- */
-
-static int dir_make_exhash(int disk_fd, struct gfs_inode *dip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_dirent *dent;
-	osi_buf_t *bh = NULL, *dibh = NULL;
-	struct gfs_leaf *leaf;
-	int y;
-	uint32 x;
-	uint64 *lp, bn;
-	int error;
-
-	/*  Sanity checks  */
-
-	if(sizeof(struct gfs_leaf) > sizeof(struct gfs_dinode)){
-		log_err(
-			"dir_make_exhash:  on-disk leaf is larger than on-disk dinode.\n"
-			"                  Unable to expand directory.\n");
-		return -1;
-	}
-
-	error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize,
-							 dip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto fail;
-
-
-	error = fs_metaalloc(disk_fd, dip, &bn);
-
-	if (error)
-		goto fail_drelse;
-
-
-	/*  Turn over a new leaf  */
-
-	error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, bn, &bh, 0);
-	if (error)
-		goto fail_drelse;
-
-	if(check_meta(bh, 0)){
-		log_err("dir_make_exhash:  Buffer has bad meta header.\n");
-		goto fail_drelse;
-	}
-
-	set_meta(bh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-	memset(BH_DATA(bh) + sizeof(struct gfs_meta_header), 0,
-	       BH_SIZE(bh) - sizeof(struct gfs_meta_header));
-
-	/*  Fill in the leaf structure  */
-
-	leaf = (struct gfs_leaf *)BH_DATA(bh);
-
-	if(dip->i_di.di_entries >= (1 << 16)){
-		log_err(
-			"dir_make_exhash:  Too many directory entries.\n"
-			"                  Unable to expand directory.\n");
-		goto fail_drelse;
-	}
-	leaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-	leaf->lf_entries = cpu_to_gfs16(dip->i_di.di_entries);
-
-
-	/*  Copy dirents  */
-	memset(BH_DATA(bh)+sizeof(struct gfs_leaf), 0, BH_SIZE(bh)-sizeof(struct gfs_leaf));
-	memcpy(BH_DATA(bh)+sizeof(struct gfs_leaf),
-	       BH_DATA(dibh)+sizeof(struct gfs_dinode),
-	       BH_SIZE(dibh)-sizeof(struct gfs_dinode));
-
-	/*  Find last entry  */
-
-	x = 0;
-	dirent_first(bh, &dent);
-
-	do
-	{
-		if (!dent->de_inum.no_formal_ino)
-			continue;
-
-		if (++x == dip->i_di.di_entries)
-			break;
-	}
-	while (dirent_next(bh, &dent) == 0);
-
-
-	/*  Adjust the last dirent's record length
-	    (Remember that dent still points to the last entry.)  */
-
-	dent->de_rec_len = gfs16_to_cpu(dent->de_rec_len) +
-		sizeof(struct gfs_dinode) - sizeof(struct gfs_leaf);
-	dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-
-	if(write_buf(disk_fd, bh, 0)){
-		log_err("dir_make_exhash:  bad write_buf()\n");
-		goto fail_drelse;
-	}
-	relse_buf(bh); bh=NULL;
-
-	log_debug("Created a new leaf block at %"PRIu64"\n", bn);
-
-	block_set(dip->i_sbd->bl, bn, leaf_blk);
-	/*  We're done with the new leaf block, now setup the new
-	    hash table.  */
-
-	memset(BH_DATA(dibh) + sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh) - sizeof(struct gfs_dinode));
-
-	lp = (uint64 *)(BH_DATA(dibh) + sizeof(struct gfs_dinode));
-
-	for (x = sdp->sd_hash_ptrs; x--; lp++)
-		*lp = cpu_to_gfs64(bn);
-
-	dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2;
-	dip->i_di.di_blocks++;
-	dip->i_di.di_flags |= GFS_DIF_EXHASH;
-	dip->i_di.di_payload_format = 0;
-
-	for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
-	dip->i_di.di_depth = y;
-
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err("dir_make_exhash: bad write_buf()\n");
-		goto fail_drelse;
-	}
-	relse_buf(dibh); dibh = NULL;
-
-	return 0;
-
-
-
- fail_drelse:
-	if(bh)
-		relse_buf(bh);
-	if(dibh)
-		relse_buf(dibh);
-
- fail:
-	return error;
-}
-
-
-/**
- * dir_split_leaf - Split a leaf block into two
- * @dip: The GFS inode
- * @lindex:
- * @leaf_no:
- *
- * Returns: 0 on success, error code on failure
- */
-static int dir_split_leaf(int disk_fd, struct gfs_inode *dip, uint32 lindex,
-						  uint64 leaf_no)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	osi_buf_t *nbh, *obh, *dibh;
-	struct gfs_leaf *nleaf, *oleaf;
-	struct gfs_dirent *dent, *prev = NULL, *next = NULL, *new;
-	uint32 start, len, half_len, divider;
-	uint64 bn, *lp;
-	uint32 name_len;
-	int x, moved = FALSE;
-	int error;
-
-	/*  Allocate the new leaf block  */
-
-	error = fs_metaalloc(disk_fd, dip, &bn);
-	if (error)
-		goto fail;
-
-
-	/*  Get the new leaf block  */
-	error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, bn, &nbh, 0);
-	if (error)
-		goto fail;
-
-	if(check_meta(nbh, 0)){
-		log_err("dir_split_leaf:  Buffer is not a meta buffer.\n");
-		relse_buf(nbh);
-		return -1;
-	}
-
-	set_meta(nbh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-
-	memset(BH_DATA(nbh)+sizeof(struct gfs_meta_header), 0,
-	       BH_SIZE(nbh)-sizeof(struct gfs_meta_header));
-
-	nleaf = (struct gfs_leaf *)BH_DATA(nbh);
-
-	nleaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-
-
-	/*  Get the old leaf block  */
-
-	error = get_leaf(disk_fd, dip, leaf_no, &obh);
-	if (error)
-		goto fail_nrelse;
-
-	oleaf = (struct gfs_leaf *)BH_DATA(obh);
-
-
-	/*  Compute the start and len of leaf pointers in the hash table.  */
-
-	len = 1 << (dip->i_di.di_depth - gfs16_to_cpu(oleaf->lf_depth));
-	if(len == 1){
-		log_err("dir_split_leaf:  Corrupted leaf block encountered.\n");
-		goto fail_orelse;
-	}
-	half_len = len >> 1;
-
-	start = (lindex & ~(len - 1));
-
-	log_debug("Splitting leaf: len = %u, half_len = %u\n", len, half_len);
-
-	/*  Change the pointers.
-	    Don't bother distinguishing stuffed from non-stuffed.
-	    This code is complicated enough already.  */
-
-	lp = (uint64 *)malloc(half_len * sizeof(uint64));
-	// FIXME: handle failed malloc
-	memset(lp, 0, half_len * sizeof(uint64));
-
-	error = readi(disk_fd, dip, (char *)lp, start * sizeof(uint64),
-		      half_len * sizeof(uint64));
-	if (error != half_len * sizeof(uint64)){
-		if (error >= 0)
-			error = -EIO;
-		goto fail_lpfree;
-	}
-
-	/*  Change the pointers  */
-
-	for (x = 0; x < half_len; x++)
-		lp[x] = cpu_to_gfs64(bn);
-
-	error = writei(disk_fd, dip, (char *)lp, start * sizeof(uint64),
-		       half_len * sizeof(uint64));
-
-	if (error != half_len * sizeof(uint64)){
-		if (error >= 0)
-			error = -EIO;
-		goto fail_lpfree;
-	}
-
-	free(lp); lp = NULL;  /* need to set lp for failure cases */
-
-
-	/*  Compute the divider  */
-
-	divider = (start + half_len) << (32 - dip->i_di.di_depth);
-
-	/*  Copy the entries  */
-
-	dirent_first(obh, &dent);
-
-	do{
-		next = dent;
-		if (dirent_next(obh, &next))
-			next = NULL;
-
-		if (dent->de_inum.no_formal_ino &&
-		    (gfs32_to_cpu(dent->de_hash) < divider)){
-			name_len = gfs16_to_cpu(dent->de_name_len);
-
-			error = fs_dirent_alloc(disk_fd, dip, nbh, name_len, &new);
-			if(error){
-				log_err("dir_split_leaf:  fs_dirent_alloc failed.\n");
-				goto fail_orelse;
-			}
-
-			new->de_inum = dent->de_inum;  /*  No endianness worries  */
-			new->de_hash = dent->de_hash;  /*  No endianness worries  */
-			new->de_type = dent->de_type;  /*  No endianness worries  */
-			memcpy((char *)(new + 1), (char *)(dent + 1), name_len);
-
-			nleaf->lf_entries = gfs16_to_cpu(nleaf->lf_entries) + 1;
-			nleaf->lf_entries = cpu_to_gfs16(nleaf->lf_entries);
-
-			dirent_del(disk_fd, dip, obh, prev, dent);
-			/* Dirent del decrements entries, but we're
-			 * just shifting entries around, so increment
-			 * it again */
-			dip->i_di.di_entries++;
-
-			if(!gfs16_to_cpu(oleaf->lf_entries)){
-				log_err("dir_split_leaf:  old leaf contains no entries.\n");
-				goto fail_orelse;
-			}
-			oleaf->lf_entries = gfs16_to_cpu(oleaf->lf_entries) - 1;
-			oleaf->lf_entries = cpu_to_gfs16(oleaf->lf_entries);
-
-			if (!prev)
-				prev = dent;
-
-			moved = TRUE;
-		}
-		else
-			prev = dent;
-
-		dent = next;
-	}
-	while (dent);
-
-
-	/*  If none of the entries got moved into the new leaf,
-	    artificially fill in the first entry.  */
-
-	if (!moved){
-		error = fs_dirent_alloc(disk_fd, dip, nbh, 0, &new);
-		if(error){
-			log_err("dir_split_leaf:  fs_dirent_alloc failed..\n");
-			goto fail_orelse;
-		}
-		new->de_inum.no_formal_ino = 0;
-	}
-
-
-	oleaf->lf_depth = gfs16_to_cpu(oleaf->lf_depth) + 1;
-	oleaf->lf_depth = cpu_to_gfs16(oleaf->lf_depth);
-	nleaf->lf_depth = oleaf->lf_depth;
-
-
-	error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize,
-							 dip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err("dir_split_leaf:  Unable to get inode buffer.\n");
-		goto fail_orelse;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error){
-		log_err("dir_split_leaf:  Buffer #%"PRIu64" is not a directory "
-			"inode.\n", BH_BLKNO(dibh));
-		goto fail_drelse;
-	}
-
-	dip->i_di.di_blocks++;
-
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err("dir_split_leaf:  Failed to write new directory inode.\n");
-		goto fail_drelse;
-	}
-	relse_buf(dibh);
-
-
-	if(write_buf(disk_fd, obh, 0)){
-		log_err("dir_split_leaf:  Failed to write back old leaf block.\n");
-		goto fail_orelse;
-	}
-	relse_buf(obh);
-	if(write_buf(disk_fd, nbh, 0)){
-		log_err("dir_split_leaf:  Failed to write new leaf block.\n");
-		goto fail_nrelse;
-	}
-
-	log_debug("Created a new leaf block at %"PRIu64"\n", BH_BLKNO(nbh));
-
-	block_set(dip->i_sbd->bl, BH_BLKNO(nbh), leaf_blk);
-
-	relse_buf(nbh);
-
-	return 0;
-
-
-
- fail_drelse:
-	relse_buf(dibh);
-
- fail_lpfree:
-	if(lp) free(lp);
-
- fail_orelse:
-	relse_buf(obh);
-
- fail_nrelse:
-	relse_buf(nbh);
-
- fail:
-	return -1;
-}
-
-
-/**
- * dir_double_exhash - Double size of ExHash table
- * @dip: The GFS dinode
- *
- * Returns: 0 on success, -1 on failure
- */
-static int dir_double_exhash(int disk_fd, struct gfs_inode *dip)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	osi_buf_t *dibh;
-	uint32 hsize;
-	uint64 *buf;
-	uint64 *from, *to;
-	uint64 block;
-	int x;
-	int error = 0;
-
-	/*  Sanity Checks  */
-
-	hsize = 1 << dip->i_di.di_depth;
-	if(hsize * sizeof(uint64) != dip->i_di.di_size){
-		log_err("dir_double_exhash:  "
-			"hash size does not correspond to di_size.\n");
-		return -1;
-	}
-
-
-	/*  Allocate both the "from" and "to" buffers in one big chunk  */
-
-	buf = (uint64 *)malloc(3 * sdp->sd_hash_bsize);
-	if(!buf){
-		log_err("dir_double_exhash:  "
-			"Unable to allocate memory for blk ptr list.\n");
-		return -1;
-	}
-	memset(buf, 0, 3 * sdp->sd_hash_bsize);
-
-	for (block = dip->i_di.di_size / sdp->sd_hash_bsize; block--;){
-		error = readi(disk_fd, dip, (char *)buf, block * sdp->sd_hash_bsize,
-			      sdp->sd_hash_bsize);
-		if (error != sdp->sd_hash_bsize){
-			if (error >= 0)
-				error = -EIO;
-			goto out;
-		}
-
-		from = buf;
-		to = (uint64 *)((char *)buf + sdp->sd_hash_bsize);
-
-		for (x = sdp->sd_hash_ptrs; x--; from++){
-			*to++ = *from;  /*  No endianess worries  */
-			*to++ = *from;
-		}
-
-		error = writei(disk_fd, dip, (char *)buf + sdp->sd_hash_bsize,
-			       block * sdp->sd_sb.sb_bsize, sdp->sd_sb.sb_bsize);
-		if (error != sdp->sd_sb.sb_bsize){
-			if (error >= 0)
-				error = -EIO;
-			goto out;
-		}
-	}
-
-	free(buf); buf=NULL;
-
-
-	error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize,
-							 dip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err("dir_double_exhash:  "
-			"Unable to get inode buffer.\n");
-		return -1;
-	}
-
-	error = check_meta(dibh, GFS_METATYPE_DI);
-	if(error){
-		log_err("dir_double_exhash:  "
-			"Buffer does not contain directory inode.\n");
-		relse_buf(dibh);
-		return -1;
-	}
-
-	dip->i_di.di_depth++;
-
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err("dir_double_exhash:  "
-			"Unable to write out directory inode.\n");
-		relse_buf(dibh);
-		return -1;
-	}
-
-	relse_buf(dibh);
-
-	return 0;
-
-
- out:
-	if(buf) free(buf);
-
-	return error;
-}
-
-
-static int dir_e_del(int disk_fd, struct gfs_inode *dip, osi_filename_t *filename){
-	int lindex;
-	int error;
-	int found = 0;
-	uint64 leaf_no;
-	osi_buf_t *bh;
-	identifier_t id;
-	struct gfs_dirent *cur, *prev;
-
-	id.type = ID_FILENAME;
-	id.filename = filename;
-	id.inum = NULL;
-
-	lindex = (1 << (dip->i_di.di_depth))-1;
-
-	for(; (lindex >= 0) && !found; lindex--){
-		error = get_leaf_nr(disk_fd, dip, lindex, &leaf_no);
-		if (error){
-			log_err("dir_e_del:  Unable to get leaf number.\n");
-			return error;
-		}
-
-		while(leaf_no && !found){
-			if(get_leaf(disk_fd, dip, leaf_no, &bh)){
-				stack;
-				return -1;
-			}
-
-			error = leaf_search(bh, &id, &cur, &prev);
-			if(id.inum) free(id.inum);
-
-			if(error){
-				if(error != -ENOENT){
-					log_err("dir_e_del:  leaf_search failed.\n");
-					relse_buf(bh);
-					return -1;
-				}
-				leaf_no = gfs64_to_cpu(((struct gfs_leaf *)BH_DATA(bh))->lf_next);
-				relse_buf(bh);
-			} else {
-				found = 1;
-			}
-		}
-	}
-
-	if(!found)
-		return 1;
-
-	if(dirent_del(disk_fd, dip, bh, prev, cur)){
-		log_err("dir_e_del:  dirent_del failed.\n");
-		relse_buf(bh);
-		return -1;
-	}
-
-	relse_buf(bh);
-	return 0;
-}
-
-
-static int dir_l_del(int disk_fd, struct gfs_inode *dip, osi_buf_t *dibh,
-		     osi_filename_t *filename){
-	int error=0;
-	int got_buf = 0;
-	struct gfs_dirent *cur, *prev;
-	identifier_t id;
-
-	id.type = ID_FILENAME;
-	id.filename = filename;
-	id.inum = NULL;
-
-	if(!fs_is_stuffed(dip)){
-		log_crit("dir_l_del: Attempting linear delete on unstuffed"
-			 " dinode.\n");
-		return -1;
-	}
-
-	if(!dibh) {
-		error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize,
-								 dip->i_num.no_addr, &dibh, 0);
-		if (error){
-			log_err("dir_l_del:  Failed to read in dinode buffer.\n");
-			return -1;
-		}
-		got_buf = 1;
-	}
-
-	error = leaf_search(dibh, &id, &cur, &prev);
-	if(id.inum) free(id.inum);
-
-	if(error){
-		if(error == -ENOENT){
-			log_debug("dir_l_del found no entry\n");
-			if(got_buf)
-				relse_buf(dibh);
-			return 1;
-		} else {
-			log_err("dir_l_del:  leaf_search failed.\n");
-			if(got_buf)
-				relse_buf(dibh);
-			return -1;
-		}
-	}
-
-	if(dirent_del(disk_fd, dip, dibh, prev, cur)){
-		stack;
-		if(got_buf)
-			relse_buf(dibh);
-		return -1;
-	}
-
-	if(got_buf)
-		relse_buf(dibh);
-	return 0;
-}
-
-
-/*
- * fs_dirent_del
- * @dip
- * filename
- *
- * Delete a directory entry from a directory.  This _only_
- * removes the directory entry - leaving the dinode in
- * place.  (Likely without a link.)
- *
- * Returns: 0 on success (or if it doesn't already exist), -1 on failure
- */
-int fs_dirent_del(int disk_fd, struct gfs_inode *dip, osi_buf_t *bh, osi_filename_t *filename){
-	int error;
-
-	if(dip->i_di.di_type != GFS_FILE_DIR){
-		log_err("fs_dirent_del:  parent inode is not a directory.\n");
-		return -1;
-	}
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_del(disk_fd, dip, filename);
-	else
-		error = dir_l_del(disk_fd, dip, bh, filename);
-
-	return error;
-
-}
-
-
-/**
- * dir_e_add -
- * @dip: The GFS inode
- * @filename:
- * @inode:
- * @type:
- *
- */
-static int dir_e_add(int disk_fd, struct gfs_inode *dip,
-					 osi_filename_t *filename, struct gfs_inum *inum,
-					 unsigned int type)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	osi_buf_t *bh, *nbh, *dibh;
-	struct gfs_leaf *leaf, *nleaf;
-	struct gfs_dirent *dent;
-	uint32 hsize, lindex;
-	uint32 hash;
-	uint64 leaf_no, bn;
-	int error;
-
- restart:
-
-	/*  Sanity Checks  */
-
-	hsize = 1 << dip->i_di.di_depth;
-	if(hsize * sizeof(uint64) != dip->i_di.di_size){
-		log_err("dir_e_add:  hash size and di_size do not correspond.\n");
-		return -1;
-	}
-
-	/*  Figure out the address of the leaf node.  */
-
-	hash = dir_hash(filename);
-	lindex = hash >> (32 - dip->i_di.di_depth);
-
-
-	error = get_leaf_nr(disk_fd, dip, lindex, &leaf_no);
-	if (error){
-		log_err("dir_e_add:  Unable to get leaf number.\n");
-		return error;
-	}
-
-
-	/*  Add entry to the leaf  */
-
-	while (TRUE){
-		error = get_leaf(disk_fd, dip, leaf_no, &bh);
-		if (error){
-			log_err("dir_e_add:  Unable to get leaf #%"PRIu64"\n", leaf_no);
-			return error;
-		}
-
-		leaf = (struct gfs_leaf *)BH_DATA(bh);
-
-
-		if (fs_dirent_alloc(disk_fd, dip, bh, filename->len, &dent)){
-			if (gfs16_to_cpu(leaf->lf_depth) < dip->i_di.di_depth){
-				/*  Can we split the leaf?  */
-				relse_buf(bh);
-
-				error = dir_split_leaf(disk_fd, dip, lindex, leaf_no);
-				if (error){
-					log_err("dir_e_add:  Unable to split leaf.\n");
-					return error;
-				}
-
-				goto restart;
-			}
-			else if (dip->i_di.di_depth < GFS_DIR_MAX_DEPTH){
-				/*  Can we double the hash table?  */
-				relse_buf(bh);
-
-				error = dir_double_exhash(disk_fd, dip);
-				if (error){
-					log_err("dir_e_add:  Unable to double exhash.\n");
-					return error;
-				}
-
-				goto restart;
-			}
-			else if (leaf->lf_next){
-				/*  Can we try the next leaf in the list?  */
-				leaf_no = gfs64_to_cpu(leaf->lf_next);
-				relse_buf(bh);
-				continue;
-			}
-			else {
-				/*  Create a new leaf and add it to the list.  */
-				error = fs_metaalloc(disk_fd, dip, &bn);
-				if (error){
-					relse_buf(bh);
-					log_err("dir_e_add:  "
-						"Unable to allocate space for meta block.\n");
-					return error;
-				}
-
-				error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, bn,
-										 &nbh, 0);
-				if (error){
-					relse_buf(bh);
-					return error;
-				}
-
-				/*gfs_trans_add_bh(sdp, dip->i_gl, nbh);*/
-				if(check_meta(nbh, 0)){
-					log_err("dir_e_add:  Buffer is not a meta buffer.\n");
-					relse_buf(bh);
-					relse_buf(nbh);
-					return -1;
-				}
-				set_meta(nbh, GFS_METATYPE_LF, GFS_FORMAT_LF);
-				/* Make sure the bitmap is updated */
-				log_debug("Setting leaf block at %"PRIu64"\n",
-					  bn);
-				block_set(dip->i_sbd->bl, bn, leaf_blk);
-				memset(BH_DATA(nbh)+sizeof(struct gfs_meta_header), 0,
-				       BH_SIZE(nbh)-sizeof(struct gfs_meta_header));
-
-				/*gfs_trans_add_bh(sdp, dip->i_gl, bh);*/
-				leaf->lf_next = cpu_to_gfs64(bn);
-
-				nleaf = (struct gfs_leaf *)BH_DATA(nbh);
-				nleaf->lf_depth = leaf->lf_depth;
-				nleaf->lf_dirent_format = cpu_to_gfs32(GFS_FORMAT_DE);
-
-				if (fs_dirent_alloc(disk_fd, dip, nbh, filename->len, &dent)){
-					log_err("dir_e_add:  Uncircumventible error!\n");
-					exit(EXIT_FAILURE);
-				}
-
-				dip->i_di.di_blocks++;
-
-				/* ATTENTION -- check for errors */
-				write_buf(disk_fd, nbh, BW_WAIT);
-				write_buf(disk_fd, bh, 0);
-				relse_buf(bh);
-
-				bh = nbh;
-				leaf = nleaf;
-			}
-		}
-
-
-		gfs_inum_out(inum, (char *)&dent->de_inum);
-		dent->de_hash = cpu_to_gfs32(hash);
-		dent->de_type = cpu_to_gfs16(type);
-		memcpy((char *)(dent + 1), filename->name, filename->len);
-
-		leaf->lf_entries = gfs16_to_cpu(leaf->lf_entries) + 1;
-		leaf->lf_entries = cpu_to_gfs16(leaf->lf_entries);
-
-		write_buf(disk_fd, bh, 0);
-		relse_buf(bh);
-
-		error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize,
-								 dip->i_num.no_addr, &dibh, 0);
-		if(error){
-			log_err("dir_e_add:  Unable to get inode buffer.\n");
-			return error;
-		}
-
-		error = check_meta(dibh, GFS_METATYPE_DI);
-		if(error){
-			log_err("dir_e_add:  Buffer #%"PRIu64" is not a directory "
-				"inode.\n", BH_BLKNO(dibh));
-			relse_buf(dibh);
-			return error;
-		}
-
-		dip->i_di.di_entries++;
-		dip->i_di.di_mtime = dip->i_di.di_ctime = osi_current_time();
-		log_debug("Entries for %"PRIu64" is %u\n", dip->i_di.di_num.no_addr,
-			dip->i_di.di_entries);
-
-		gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-		write_buf(disk_fd, dibh, 0);
-		relse_buf(dibh);
-
-		return 0;
-	}
-
-	return -ENOENT;
-}
-
-
-/**
- * dir_l_add -
- * @dip: The GFS inode
- * @filename:
- * @inode:
- * @type:
- *
- * Returns:
- */
-
-static int dir_l_add(int disk_fd, struct gfs_inode *dip, osi_filename_t *filename,
-                     struct gfs_inum *inum, unsigned int type)
-{
-	osi_buf_t *dibh;
-	struct gfs_dirent *dent;
-	int error;
-
-	/*  Sanity checks  */
-
-	if(!fs_is_stuffed(dip)){
-		log_err("dir_l_add:  Attempting linear add on unstuffed dinode.\n");
-		return -1;
-	}
-
-	error = get_and_read_buf(disk_fd, dip->i_sbd->sd_sb.sb_bsize,
-							 dip->i_num.no_addr, &dibh, 0);
-	if (error)
-		goto out;
-
-
-	if (fs_dirent_alloc(disk_fd, dip, dibh, filename->len, &dent))
-	{
-		/* no need to write buffer, it hasn't changed. */
-		relse_buf(dibh);
-
-		error = dir_make_exhash(disk_fd, dip);
-		/* DEBUG */
-		log_debug("Changing Linear dir to Exhash dir - %s\n",
-			  (error)? "UNSUCCESSFUL": "SUCCESSFUL");
-		if (!error)
-			error = dir_e_add(disk_fd, dip, filename, inum, type);
-
-		goto out;
-	}
-
-
-	gfs_inum_out(inum, (char *)&dent->de_inum);
-	dent->de_hash = dir_hash(filename);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(type);
-	memcpy((char *)(dent + 1), filename->name, filename->len);
-
-
-	dip->i_di.di_entries++;
-	dip->i_di.di_mtime = dip->i_di.di_ctime = osi_current_time();
-	log_debug("Entries for %"PRIu64" is %u\n", dip->i_di.di_num.no_addr,
-		dip->i_di.di_entries);
-	gfs_dinode_out(&dip->i_di, BH_DATA(dibh));
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err("dir_l_add:  bad write_buf()\n");
-		error = -EIO;
-	}
-
-	relse_buf(dibh);
-
- out:
-	if(error){
-		char tmp_name[256];
-		memset(tmp_name, 0, sizeof(tmp_name));
-		memcpy(tmp_name, filename->name, filename->len);
-		log_err("Unable to add \"%s\" to directory #%"PRIu64"\n",
-			tmp_name, dip->i_num.no_addr);
-	}
-	return error;
-}
-
-
-
-/**
- * fs_dir_add - Add new filename into directory
- * @dip: The GFS inode
- * @filename: The new name
- * @inode: The inode number of the entry
- * @type: The type of the entry
- *
- * Returns: 0 on success, error code on failure
- */
-int fs_dir_add(int disk_fd, struct gfs_inode *dip, osi_filename_t *filename,
-			   struct gfs_inum *inum, unsigned int type)
-{
-	int error;
-
-	if(dip->i_di.di_type != GFS_FILE_DIR){
-		log_err("fs_dir_add:  parent inode is not a directory.\n");
-		return -1;
-	}
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_add(disk_fd, dip, filename, inum, type);
-	else
-		error = dir_l_add(disk_fd, dip, filename, inum, type);
-
-	return error;
-}
-
-
-/**
- * fs_dirent_alloc - Allocate a directory entry
- * @dip: The GFS inode
- * @bh: The buffer
- * @name_len: The length of the name
- * @dent_out: Pointer to list of dirents
- *
- * Returns: 0 on success, error code otherwise
- */
-int fs_dirent_alloc(int disk_fd, struct gfs_inode *dip, osi_buf_t *bh,
-		    int name_len, struct gfs_dirent **dent_out)
-{
-	struct gfs_dirent *dent, *new;
-	struct gfs_leaf *leaf;
-	struct gfs_dinode *dinode;
-	unsigned int rec_len = GFS_DIRENT_SIZE(name_len);
-	unsigned int entries = 0, offset = 0, x = 0;
-	int type;
-
-	type = dirent_first(bh, &dent);
-
-	if (type == IS_LEAF){
-		leaf = (struct gfs_leaf *)BH_DATA(bh);
-		entries = gfs16_to_cpu(leaf->lf_entries);
-		offset = sizeof(struct gfs_leaf);
-	}
-	else if (type == IS_DINODE) {
-		dinode = (struct gfs_dinode *)BH_DATA(bh);
-		entries = gfs32_to_cpu(dinode->di_entries);
-		offset = sizeof(struct gfs_dinode);
-	} else {
-		log_err("fs_dirent_alloc:  Buffer has bad metatype.\n");
-		return -1;
-	}
-
-	if (!entries){
-		dent->de_rec_len = BH_SIZE(bh) - offset;
-		dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-		dent->de_name_len = cpu_to_gfs16(name_len);
-
-		*dent_out = dent;
-		write_buf(disk_fd, bh, 0);
-		goto success;
-	}
-
-
-	do{
-		uint32 cur_rec_len, cur_name_len;
-
-		cur_rec_len = gfs16_to_cpu(dent->de_rec_len);
-		cur_name_len = gfs16_to_cpu(dent->de_name_len);
-
-		if ((!dent->de_inum.no_formal_ino && cur_rec_len >= rec_len) ||
-		    (cur_rec_len >= GFS_DIRENT_SIZE(cur_name_len) + rec_len)){
-			if (dent->de_inum.no_formal_ino){
-				new = (struct gfs_dirent *)((char *)dent + GFS_DIRENT_SIZE(cur_name_len));
-				memset(new, 0, sizeof(struct gfs_dirent));
-
-				new->de_rec_len = cpu_to_gfs16(cur_rec_len - GFS_DIRENT_SIZE(cur_name_len));
-				new->de_name_len = cpu_to_gfs16(name_len);
-
-				dent->de_rec_len = cur_rec_len - gfs16_to_cpu(new->de_rec_len);
-				dent->de_rec_len = cpu_to_gfs16(dent->de_rec_len);
-
-				*dent_out = new;
-				write_buf(disk_fd, bh, 0);
-				goto success;
-			}
-
-			dent->de_name_len = cpu_to_gfs16(name_len);
-
-			*dent_out = dent;
-			write_buf(disk_fd, bh, 0);
-			goto success;
-		}
-
-		if(x >= entries){
-			log_err("fs_dirent_alloc:  dirents contain bad length information.\n");
-			return -1;
-		}
-
-		if (dent->de_inum.no_formal_ino)
-			x++;
-	}
-	while(dirent_next(bh, &dent) == 0);
-
-	return -ENOSPC;
-
- success:
-	return 0;
-}
-
-
-/**
- * get_leaf_nr - Get a leaf number associated with the lindex
- * @dip: The GFS inode
- * @lindex:
- * @leaf_out:
- *
- * Returns: 0 on success, error code otherwise
- */
-
-int get_leaf_nr(int disk_fd, struct gfs_inode *dip, uint32 lindex,
-				uint64 *leaf_out)
-{
-	uint64 leaf_no;
-	int error = -1;
-	error = readi(disk_fd, dip, (char *)&leaf_no,
-				  lindex * sizeof(uint64), sizeof(uint64));
-	if (error != sizeof(uint64)){
-		log_debug("get_leaf_nr:  Bad internal read.  (rtn = %d)\n",
-			  error);
-		return (error < 0) ? error : -EIO;
-	}
-
-	*leaf_out = gfs64_to_cpu(leaf_no);
-
-	return 0;
-}
-
-
-/**
- * fs_filecmp - Compare two filenames
- * @file1: The first filename
- * @file2: The second filename
- * @len_of_file2: The length of the second file
- *
- * This routine compares two filenames and returns TRUE if they are equal.
- *
- * Returns: TRUE (!=0) if the files are the same, otherwise FALSE (0).
- */
-int fs_filecmp(osi_filename_t *file1, char *file2, int len_of_file2)
-{
-	if (file1->len != len_of_file2){
-		return FALSE;
-	}
-
-	if (osi_memcmp(file1->name, file2, file1->len)){
-		return FALSE;
-	}
-	return TRUE;
-}
-
-
-/**
- * fs_dir_search - Search a directory
- * @dip: The GFS inode
- * @id
- * @type:
- *
- * This routine searches a directory for a file or another directory
- * given its identifier.  The component of the identifier that is
- * not being used to search will be filled in and must be freed by
- * the caller.
- *
- * Returns: 0 if found, -1 on failure, -ENOENT if not found.
- */
-int fs_dir_search(int disk_fd, struct gfs_inode *dip, identifier_t *id,
-				  unsigned int *type)
-{
-	int error;
-
-	if(dip->i_di.di_type != GFS_FILE_DIR){
-		log_err("An attempt was made to search an inode "
-			"that is not a directory.\n");
-		return -1;
-	}
-
-	if (dip->i_di.di_flags & GFS_DIF_EXHASH)
-		error = dir_e_search(disk_fd, dip, id, type);
-	else
-		error = dir_l_search(disk_fd, dip, id, type);
-
-	return error;
-}
diff --git a/gfs/libgfs/fs_inode.c b/gfs/libgfs/fs_inode.c
deleted file mode 100644
index 2b8d2ca..0000000
--- a/gfs/libgfs/fs_inode.c
+++ /dev/null
@@ -1,470 +0,0 @@
-#include "libgfs.h"
-
-#define ST_CREATE 1
-
-/**
- * fs_get_istruct - Get an inode given its number
- * @sdp: The GFS superblock
- * @inum: The inode number
- * @create: Flag to say if we are allowed to create a new struct gfs_inode
- * @ipp: pointer to put the returned inode in
- *
- * Returns: 0 on success, -1 on error
- */
-static int fs_get_istruct(int disk_fd, struct gfs_sbd *sdp,
-						  struct gfs_inum *inum, int create,
-						  struct gfs_inode **ipp)
-{
-	struct gfs_inode *ip = NULL;
-	int error = 0;
-
-	if (!create){
-		/* we are not currently tracking which inodes we already have */
-		error = -1;
-		goto out;
-	}
-
-	if(!(ip = (struct gfs_inode *)malloc(sizeof(struct gfs_inode)))) {
-		log_err("Unable to allocate gfs_inode structure\n");
-		error = -1;
-		goto out;
-	}
-	if(!memset(ip, 0, sizeof(struct gfs_inode))) {
-		log_err("Unable to zero gfs_inode structure\n");
-		error = -1;
-		goto out;
-	}
-
-	ip->i_num = *inum;
-
-	ip->i_sbd = sdp;
-
-	error = fs_copyin_dinode(disk_fd, sdp->sd_sb.sb_bsize, ip, NULL);
-	if (error){
-		free(ip);
-		ip = NULL;
-		goto out;
-	}
-
- out:
-	*ipp = ip;
-
-	return error;
-}
-
-
-/*
- * fs_copyin_dinode - read dinode from disk and store in inode
- * @ip: inode, sdp and inum must be set
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_copyin_dinode(int disk_fd, uint32_t sb_bsize, struct gfs_inode *ip,
-					 osi_buf_t *dibh)
-{
-/*	osi_buf_t *dibh;*/
-	int do_relse = 0;
-	int error = 0;
-
-	if(!dibh) {
-		error = get_and_read_buf(disk_fd, sb_bsize,
-								 ip->i_num.no_addr, &dibh, 0);
-		if (error) {
-			stack;
-			goto out;
-		}
-
-		if(check_meta(dibh, GFS_METATYPE_DI)){
-			log_err("Block #%"PRIu64" is not a dinode.\n",
-				ip->i_num.no_addr);
-			relse_buf(dibh);
-			return -1;
-		}
-		do_relse = 1;
-	}
-	gfs_dinode_in(&ip->i_di, BH_DATA(dibh));
-
-	if(do_relse)
-		relse_buf(dibh);
-
-	
-
- out:
-	return error;
-}
-
-
-/*
- * fs_copyout_dinode - given an inode, copy its dinode data to disk
- * @ip: the inode
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_copyout_dinode(int disk_fd, uint32_t sb_bsize, struct gfs_inode *ip)
-{
-	osi_buf_t *dibh;
-	int error;
-
-	error = get_and_read_buf(disk_fd, sb_bsize, ip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err( "Unable to get a buffer to write dinode to disk.\n");
-		return -1;
-	}
-
-	gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
-
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err( "Unable to commit dinode buffer to disk.\n");
-		relse_buf(dibh);
-		return -1;
-	}
-
-	relse_buf(dibh);
-	return 0;
-}
-
-/**
- * fs_lookupi - Look up a filename in a directory and return its inode
- * @dip: The directory to search
- * @name: The name of the inode to look for
- * @cred: The caller's credentials
- * @ipp: Used to return the found inode if any
- *
- * Returns: 0 on success, -EXXXX on failure
- */
-static int fs_lookupi(int disk_fd, struct gfs_inode *dip,
-					  osi_filename_t *name, osi_cred_t *cred, 
-					  struct gfs_inode **ipp)
-{
-	struct gfs_sbd *sdp = dip->i_sbd;
-	int error = 0;
-	identifier_t id;
-
-	memset(&id, 0, sizeof(identifier_t));
-	id.filename = name;
-	id.type = ID_FILENAME;
-
-	*ipp = NULL;
-
-	if (!name->len || name->len > GFS_FNAMESIZE)
-	{
-		error = -ENAMETOOLONG;
-		goto out;
-	}
-
-	if (fs_filecmp(name, (char *)".", 1))
-	{
-		*ipp = dip;
-		goto out;
-	}
-
-	error = fs_dir_search(disk_fd, dip, &id, NULL);
-	if (error){
-		if (error == -ENOENT)
-			error = 0;
-		goto out;
-	}
-
-	error = fs_get_istruct(disk_fd, sdp, id.inum, ST_CREATE, ipp);
-
- out:
-
-	if(id.inum) free(id.inum);
-	return error;
-}
-
-static int fs_createi(int disk_fd, struct gfs_inode *dip, osi_filename_t *name,
-	       unsigned int type, unsigned int mode, osi_cred_t *cred,
-	       int *new, struct gfs_inode **ipp)
-{
-	osi_list_t *tmp=NULL;
-	struct gfs_sbd *sdp = dip->i_sbd;
-	struct gfs_inum inum;
-	int error;
-	int allocate=0;
-	identifier_t id;
-
-	memset(&id, 0, sizeof(identifier_t));
-
-	if (!name->len || name->len > GFS_FNAMESIZE){
-		error = -ENAMETOOLONG;
-		goto fail;
-	}
-
- restart:
-
-	/*  Don't create entries in an unlinked directory  */
-	if (!dip->i_di.di_nlink){
-		error = -EPERM;
-		goto fail;
-	}
-
-	id.filename = name;
-	id.type = ID_FILENAME;
-
-	error = fs_dir_search(disk_fd, dip, &id, NULL);
-	if(id.inum) free(id.inum);
-	switch (error)
-	{
-	case -ENOENT:
-		break;
-
-	case 0:
-		if (!new){
-			error = -EEXIST;
-			goto fail;
-		} else {
-			error = fs_lookupi(disk_fd, dip, name, cred, ipp);
-			if (error)
-				goto fail;
-
-			if (*ipp){
-				*new = FALSE;
-				return 0;
-			} else
-				goto restart;
-		}
-		break;
-
-	default:
-		goto fail;
-	}
-
-	if (dip->i_di.di_entries == (uint32)-1){
-		error = -EFBIG;
-		goto fail;
-	}
-	if (type == GFS_FILE_DIR && dip->i_di.di_nlink == (uint32)-1){
-		error = -EMLINK;
-		goto fail;
-	}
-
- retry:
-	inum.no_addr = inum.no_formal_ino = 0;
-	for (tmp = (osi_list_t *)sdp->sd_rglist.next;
-		 tmp != (osi_list_t *)&sdp->sd_rglist; tmp = tmp->next){
-		uint64 block;
-		struct gfs_rgrpd *rgd;
-
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-		if(fs_rgrp_read(disk_fd, rgd, FALSE))
-			return -1;
-		if(rgd->rd_rg.rg_freemeta){
-			block = fs_blkalloc_internal(rgd, dip->i_num.no_addr,
-						     GFS_BLKST_FREEMETA,
-						     GFS_BLKST_USEDMETA, 1);
-			log_debug("Got block %"PRIu64"\n", block);
-			if(block == BFITNOENT) {
-				fs_rgrp_relse(rgd);
-				continue;
-			}
-			block += rgd->rd_ri.ri_data1;
-			log_debug("Got block #%"PRIu64"\n", block);
-			inum.no_addr = inum.no_formal_ino = block;
-			rgd->rd_rg.rg_freemeta--;
-			rgd->rd_rg.rg_useddi++;
-
-			if(fs_rgrp_recount(disk_fd, rgd)){
-				log_err(  "fs_createi:  Unable to recount rgrp blocks.\n");
-				fs_rgrp_relse(rgd);
-				error = -EIO;
-				goto fail;
-			}
-
-			/* write out the rgrp */
-			gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-			write_buf(disk_fd, rgd->rd_bh[0], 0);
-			fs_rgrp_relse(rgd);
-			break;
-		} else {
-			if(allocate){
-				if(!clump_alloc(disk_fd, rgd, 0)){
-					block = fs_blkalloc_internal(rgd, dip->i_num.no_addr,
-								     GFS_BLKST_FREEMETA,
-								     GFS_BLKST_USEDMETA, 1);
-					log_debug("Got block %"PRIu64"\n",
-						  block);
-					if(block == BFITNOENT) {
-						fs_rgrp_relse(rgd);
-						continue;
-					}
-					block += rgd->rd_ri.ri_data1;
-
-					inum.no_addr = inum.no_formal_ino = block;
-					rgd->rd_rg.rg_freemeta--;
-					rgd->rd_rg.rg_useddi++;
-
-					if(fs_rgrp_recount(disk_fd, rgd)){
-						log_err( "fs_createi:  Unable to recount rgrp blocks.\n");
-						fs_rgrp_relse(rgd);
-						error = -EIO;
-						goto fail;
-					}
-
-					/* write out the rgrp */
-					gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-					write_buf(disk_fd, rgd->rd_bh[0], 0);
-					fs_rgrp_relse(rgd);
-					break;
-				}
-			}
-			fs_rgrp_relse(rgd);
-		}
-	}
-
-	if(!inum.no_addr){
-		if(allocate){
-			log_err( "No space available for new file or directory.\n");
-			return -1;
-		} else {
-			allocate = 1;
-			goto retry;
-		}
-	}
-
-	error = fs_dir_add(disk_fd, dip, name, &inum, type);
-	if (error)
-		goto fail;
-
-	error = make_dinode(disk_fd, dip, sdp, &inum, type, mode, cred);
-	if (error)
-		goto fail;
-
-
-	error = fs_get_istruct(disk_fd, sdp, &inum, ST_CREATE, ipp);
-	if (error)
-		goto fail;
-
-	if (new)
-		*new = TRUE;
-
-	return 0;
-
- fail:
-	return error;
-}
-
-
-/*
- * fs_mkdir - make a directory
- * @dip - dir inode that is the parent of the new dir
- * @new_dir - name of the new dir
- * @mode - mode of new dir
- * @nip - returned inode ptr to the new directory
- *
- * This function has one main difference from the way a normal mkdir
- * works.  It will not return an error if the directory already
- * exists.  Instead it will return success and nip will point to the
- * inode that exists with the same name as new_dir.
- *
- * Returns: 0 on success, -1 on failure.
- */
-int fs_mkdir(int disk_fd, struct gfs_inode *dip, char *new_dir, 
-			 int mode, struct gfs_inode **nip){
-	int error;
-	osi_cred_t creds;
-	osi_buf_t *dibh;
-	struct gfs_dinode *di;
-	struct gfs_dirent *dent;
-	struct gfs_inode *ip= NULL;
-	struct gfs_sbd *sdp = dip->i_sbd;
-	osi_filename_t name;
-	int new = 0;
-
-	name.name = (unsigned char *)new_dir;
-	name.len = strlen(new_dir);
-	creds.cr_uid = getuid();
-	creds.cr_gid = getgid();
-
-	error = fs_createi(disk_fd, dip, &name, GFS_FILE_DIR, mode, &creds,
-					   &new, &ip);
-
-	if (error)
-		goto fail;
-
-	if(!new){
-		goto out;
-	}
-
-	if(!ip){
-		log_err(  "fs_mkdir:  fs_createi() failed.\n");
-		error = -1;
-		goto fail;
-	}
-
-	ip->i_di.di_nlink = 2;
-	ip->i_di.di_size = sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode);
-	ip->i_di.di_flags |= GFS_DIF_JDATA;
-	ip->i_di.di_payload_format = GFS_FORMAT_DE;
-	ip->i_di.di_entries = 2;
-
-	error = get_and_read_buf(disk_fd, ip->i_sbd->sd_sb.sb_bsize,
-							 ip->i_num.no_addr, &dibh, 0);
-	if(error){
-		log_err( "fs_mkdir:  Unable to aquire directory buffer.\n");
-		goto fail;
-	}
-
-	di = (struct gfs_dinode *)BH_DATA(dibh);
-
-	error = fs_dirent_alloc(disk_fd, ip, dibh, 1, &dent);
-	if(error){  /*  This should never fail  */
-		log_err( "fs_mkdir:  fs_dirent_alloc() failed for \".\" entry.\n");
-		goto fail;
-	}
-
-	dent->de_inum = di->di_num;  /*  already GFS endian  */
-	dent->de_hash = gfs_dir_hash(".", 1);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(GFS_FILE_DIR);
-	memcpy((char *)(dent + 1), ".", 1);
-	di->di_entries = cpu_to_gfs32(1);
-
-	error = fs_dirent_alloc(disk_fd, ip, dibh, 2, &dent);
-	if(error){  /*  This should never fail  */
-		log_err( "fs_mkdir:  fs_dirent_alloc() failed for \"..\" entry.\n");
-		goto fail;
-	}
-	gfs_inum_out(&dip->i_num, (char *)&dent->de_inum);
-	dent->de_hash = gfs_dir_hash("..", 2);
-	dent->de_hash = cpu_to_gfs32(dent->de_hash);
-	dent->de_type = cpu_to_gfs16(GFS_FILE_DIR);
-	memcpy((char *)(dent + 1), "..", 2);
-
-	gfs_dinode_out(&ip->i_di, (char *)di);
-	if(write_buf(disk_fd, dibh, 0)){
-		log_err( "fs_mkdir:  Bad write_buf()\n");
-		error = -EIO;
-		goto fail;
-	}
-
-	relse_buf(dibh);
-
-
-	/* FIXME: this may break stuff elsewhere, but since I'm
-	 * keeping track of the linkcount in-core, we shouldn't need
-	 * to do this...
-
-	error = fs_change_nlink(dip, +1);
-	if(error){
-		log_err( "fs_mkdir:  fs_change_nlink() failed.\n");
-		goto fail;
-		} */
-
- out:
-	error=0;
-	if(nip) {
-		*nip = ip;
-	}
-	else if(ip) {
-		free(ip);
-		ip = NULL;
-	}
-	return 0;
- fail:
-	if(ip)
-		free(ip);
-	return error;
-}
-
-
diff --git a/gfs/libgfs/incore.h b/gfs/libgfs/incore.h
deleted file mode 100644
index 5a25076..0000000
--- a/gfs/libgfs/incore.h
+++ /dev/null
@@ -1,1271 +0,0 @@
-/*
- *  In-core (memory/RAM) structures.
- *  These do not appear on-disk.  See gfs_ondisk.h for on-disk structures.
- */
-
-#ifndef __INCORE_DOT_H__
-#define __INCORE_DOT_H__
-
-#ifndef __KERNEL__ /* if called from userland */
-#include <stdint.h>
-#include "list.h"
-#include "gfs_ondisk.h"
-#include "osi_user.h"
-
-#define FSCK_HASH_SHIFT         (13)
-#define FSCK_HASH_SIZE          (1 << FSCK_HASH_SHIFT)
-#define FSCK_HASH_MASK          (FSCK_HASH_SIZE - 1)
-
-struct semaphore {
-	void *nothing;
-};
-struct completion {
-	void *nothing;
-};
-struct lm_lockname {
-	void *nothing;
-};
-struct rw_semaphore {
-	void *nothing;
-};
-struct gfs_quota_lvb {
-	void *nothing;
-};
-struct lm_lockstruct {
-	void *nothing;
-};
-typedef int atomic_t;
-typedef int spinlock_t;
-typedef int lm_lock_t;
-typedef int rwlock_t;
-typedef int wait_queue_head_t;
-#endif
-
-/*  flags used in function call parameters  */
-
-#define DIO_NEW           (0x00000001)  /* Newly allocated metadata */
-#define DIO_FORCE         (0x00000002)  /* Force read of block from disk */
-#define DIO_CLEAN         (0x00000004)  /* Don't write to disk */
-#define DIO_DIRTY         (0x00000008)  /* Data changed, must write to disk */
-#define DIO_START         (0x00000010)  /* Start disk read or write */
-#define DIO_WAIT          (0x00000020)  /* Wait for disk r/w to complete */
-
-#define DIO_METADATA      (0x00000040)  /* Process glock's protected metadata */
-#define DIO_DATA          (0x00000080)  /* Process glock's protected filedata */
-#define DIO_INVISIBLE     (0x00000100)  /* Don't monkey with glock's dirty bit */
-#define DIO_CHECK         (0x00000200)  /* Make sure all metadata has been synced */
-#define DIO_ALL           (0x00000400)  /* Flush all AIL transactions to disk */
-
-/*  Structure prototypes  */
-
-struct gfs_log_operations;
-struct gfs_log_element;
-struct gfs_meta_header_cache;
-struct gfs_depend;
-struct gfs_bitmap;
-struct gfs_rgrpd;
-struct gfs_bufdata;
-struct gfs_glock_operations;
-struct gfs_holder;
-struct gfs_glock;
-struct gfs_alloc;
-struct gfs_inode;
-struct gfs_file;
-struct gfs_unlinked;
-struct gfs_quota_le;
-struct gfs_quota_data;
-struct gfs_log_buf;
-struct gfs_trans;
-struct gfs_gl_hash_bucket;
-struct gfs_sbd;
-
-typedef void (*gfs_glop_bh_t) (struct gfs_glock * gl, unsigned int ret);
-
-/*
- *  Structure of operations that are associated with each
- *  type of element in the log.
- */
-struct gfs_log_operations {
-	/*
-	 * Operations specific to a given log element (LE).
-	 * These are typically executed individually via macros such as LO_ADD.
-	 */
-
-	/* Add new LE to transaction */
-	void (*lo_add) (struct gfs_sbd * sdp, struct gfs_log_element * le);
-
-	/* Do any cleanup, etc., needed just before commit to incore log */
-	void (*lo_trans_end) (struct gfs_sbd * sdp,
-			      struct gfs_log_element * le);
-
-	/* Print LE-specific info via printk() */
-	void (*lo_print) (struct gfs_sbd * sdp, struct gfs_log_element * le,
-			  unsigned int where);
-
-	/* Find any incore transactions that overlap through this LE (e.g.
-	 * share glocks), to determine if any transactions can be combined. */
-	struct gfs_trans *(*lo_overlap_trans) (struct gfs_sbd * sdp,
-					       struct gfs_log_element * le);
-
-	/* Change LE from "new" to "incore" status, before write to log */
-	void (*lo_incore_commit) (struct gfs_sbd * sdp, struct gfs_trans * tr,
-				  struct gfs_log_element * le);
-
-	/* Allow writes to in-place locations, after log is on-disk */
-	void (*lo_add_to_ail) (struct gfs_sbd * sdp,
-			       struct gfs_log_element * le);
-
-	/* Clean up LE after log dump */
-	void (*lo_clean_dump) (struct gfs_sbd * sdp,
-			       struct gfs_log_element * le);
-
-	/*
-	 * Operations specific to a class of log elements.
-	 * These are typically executed over a whole transaction by
-	 * macros such as LO_TRANS_SIZE.  Each LE-type-specific operation
-	 * for each LE contributes its part to the overall result.
-	 */
-
-	/* Determine LE-type-specific quantities of blocks of various types
-	 * required for writing the log */
-	void (*lo_trans_size) (struct gfs_sbd * sdp, struct gfs_trans * tr,
-			       unsigned int *mblks, unsigned int *eblks,
-			       unsigned int *blocks, unsigned int *bmem);
-
-	/* Combine LE-type-specific values in new_tr and tr, result is in tr */
-	void (*lo_trans_combine) (struct gfs_sbd * sdp, struct gfs_trans * tr,
-				  struct gfs_trans * new_tr);
-
-	/* Create control and metadata buffers that will make up the log */
-	void (*lo_build_bhlist) (struct gfs_sbd * sdp, struct gfs_trans * tr);
-
-	/* Calculate log space needed for this LE in a log dump */
-	void (*lo_dump_size) (struct gfs_sbd * sdp, unsigned int *elements,
-			      unsigned int *blocks, unsigned int *bmem);
-
-	/* Add LE to log dump */
-	void (*lo_build_dump) (struct gfs_sbd * sdp, struct gfs_trans * tr);
-
-	/*
-	 * Operations that happen at recovery time
-	 */
-
-	/* Reset/init whatever before doing recovery */
-	void (*lo_before_scan) (struct gfs_sbd * sdp, unsigned int jid,
-				struct gfs_log_header * head,
-				unsigned int pass);
-
-	/* LE-specific recovery procedure */
-	int (*lo_scan_elements) (struct gfs_sbd * sdp,
-				 struct gfs_jindex * jdesc,
-				 struct gfs_glock * gl, uint64_t start,
-				 struct gfs_log_descriptor * desc,
-				 unsigned int pass);
-
-	/* Verify and report recovery results/statistics */
-	void (*lo_after_scan) (struct gfs_sbd * sdp, unsigned int jid,
-			       unsigned int pass);
-
-
-	/* 
-	 * Type of element (glock/buf/unlinked/quota)
-	 */
-	char *lo_name;
-};
-
-/*
- *  Structure that gets added to struct gfs_trans->tr_elements.  They
- *  make up the "stuff" in each transaction.
- */
-struct gfs_log_element {
-	struct gfs_log_operations *le_ops; /* Vector of functions */
-
-	struct gfs_trans *le_trans;     /* We're part of this transaction */
-	osi_list_t le_list;       /* Link to transaction's element list */
-};
-
-/*
- * Meta-header cache structure.
- * One for each metadata block that we've de-allocated.
- * Used to temporarily store gfs_meta_header structs for meta blocks that
- *   have been freshly turned into FREEMETA (alloc'd or de-alloc'd).  Storing
- *   these (small) structures in-core allows us to release the (large) buffers,
- *   and not need to re-read the header from disk if/when we re-allocate the
- *   blocks to USEDMETA, as long as this node holds the EXCLUSIVE lock for the
- *   resource group containing the blocks.  If we release the EX lock, we must
- *   throw away the rgrp's cached meta headers, since another node could change
- *   the blocks' contents.
- * In-core superblock structure hosts the hashed cache, as well as a
- *   linear list of all cached, in most-recently-added order.
- * Also, each resource group keeps a list of cached blocks within its scope.
- */
-struct gfs_meta_header_cache {
-	/* Links to various lists */
-	osi_list_t mc_list_hash;   /* Superblock's hashed list */
-	osi_list_t mc_list_single; /* Superblock's list, MRU order */
-	osi_list_t mc_list_rgd;    /* Resource group's list */
-
-	uint64_t mc_block;               /* Block # (in-place address) */
-	struct gfs_meta_header mc_mh;    /* Payload: the block's meta-header */
-};
-
-/*
- * Dependency cache structure.
- * In-core superblock structure hosts the actual cache.
- * Also, each resource group keeps a list of dependency blocks within its scope.
- */
-struct gfs_depend {
-	/* Links to various lists */
-	osi_list_t gd_list_hash;  /* Superblock's hashed list */
-	osi_list_t gd_list_rgd;   /* Resource group's list */
-
-	struct gfs_rgrpd *gd_rgd;       /* Resource group descriptor */
-	uint64_t gd_formal_ino;         /* Inode ID */
-	unsigned long gd_time;          /* Time (jiffies) when put on list */
-};
-
-/*
- *  Block allocation bitmap descriptor structure.
- *  One of these for each FS block that contains bitmap data
- *    (i.e. the resource group header blocks and their following bitmap blocks).
- *  Each allocatable FS data block is represented by 2 bits (4 alloc states).
- */
-struct gfs_bitmap {
-	uint32_t bi_offset;  /* Byte offset of bitmap within this bit block
-	                        (non-zero only for an rgrp header block) */
-	uint32_t bi_start;   /* Data block (rgrp scope, 32-bit) represented
-	                        by the first bit-pair in this bit block */
-	uint32_t bi_len;     /* The number of bitmap bytes in this bit block */
-};
-
-/*
- *  Resource Group (Rgrp) descriptor structure.
- *  There is one of these for each resource (block) group in the FS.
- *  The filesystem is divided into a number of resource groups to allow
- *    simultaneous block alloc operations by a number of nodes.
- */
-struct gfs_rgrpd {
-	/* Links to superblock lists */
-	osi_list_t rd_list;       /* On-disk-order list of all rgrps */
-	osi_list_t rd_list_mru;   /* Most Recently Used list of all rgs */
-	osi_list_t rd_recent;     /* recently used rgrps */
-	uint32_t rd_try_counter;        /* # of times we fail a try lock */
-
-	struct gfs_glock *rd_gl;        /* Glock for this rgrp */
-
-	struct gfs_rindex rd_ri;        /* Resource Index (on-disk) structure */
-	struct gfs_rgrp rd_rg;          /* Resource Group (on-disk) structure */
-	uint64_t rd_rg_vn;              /* Version #: if != glock's gl_vn,
-	                                   we need to read rgrp fm disk */
-
-	/* Block alloc bitmap cache */
-	struct gfs_bitmap *rd_bits;     /* Array of block bitmap descriptors */
-	struct buffer_head **rd_bh;     /* Array of ptrs to block bitmap bh's */
-
-	/* Block allocation strategy, rgrp scope. Start at these blocks when
-	   searching for next data/meta block to alloc */
-	uint32_t rd_last_alloc_data;    /* Most recent data block allocated */
-	uint32_t rd_last_alloc_meta;    /* Most recent meta block allocated */
-
-	osi_list_t rd_mhc;        /* Cached meta-headers for this rgrp */
-	osi_list_t rd_depend;     /* Dependent inodes (MRU order) */
-
-	struct gfs_sbd *rd_sbd;		/* FS incore superblock (fs instance) */
-#ifndef __KERNEL__
-	int32_t rd_open_count;  /* # of open references on this rgrpd */
-#endif
-};
-
-/*
- *  Per-buffer data
- *  One of these is attached as GFS private data to each FS block's buffer_head.
- *  These keep track of a buffer's progress through the transaction pipeline,
- *    using the "new" embedded log element to attach it to a being-built
- *    transaction, and moving the attachment point to the "incore" LE once
- *    the transaction completes (at which time the buffer becomes a candidate
- *    to be written to the on-disk log).
- *  A buffer may be attached simultaneously to a new and an incore transaction,
- *    but no more than one of each:  Only one new trans may be built at a time
- *    for a given buffer, obviously, since the buffer's contents are protected
- *    by an EXclusive glock when writing.  And, when a transaction is completely
- *    built, GFS combines incore transactions that share glocks (see
- *    incore_commit()), i.e. the glock that protects the buffer, so a buffer
- *    never needs to be attached to more than one (combined) incore trans.
- *  Note that multiple transactions can modify the buffer since its most
- *    recent writes to disk.  This principle applies to both in-place and
- *    journal block locations on-disk, allowing this node to keep modifying the
- *    cached data without writing it to disk, unless/until another node needs
- *    to access the data, or the Linux OS tells us to sync to disk.
- *  If a transaction follows another transaction before the first transaction's
- *    log completes (indicated by the in-place buffer head still being pinned
- *    in RAM), GFS copies the first transaction's results to a "frozen"
- *    image of the buffer, so the first transaction results (an atomic
- *    snapshot) can be logged properly, while the second transaction is
- *    modifying the "real" buffer.  This frozen copy lives only until the new
- *    transaction is complete, at which point one of two things has occurred:
- *    1).  Buffer was logged successfully; frozen copy's job is done.
- *    2).  Buffer was not yet logged; frozen copy no longer needed, newer
- *         buffer becomes the log candidate.
- *
- *  gfs_bufdata structs also link into the Active Items Lists (AIL) (buffers
- *    flushed to on-disk log, but not yet flushed to on-disk in-place locations)
- *    attached to:
- *    1).  The latest transaction to modify and log (on-disk) the buffer, and
- *    2).  The glock that protects the buffer's contents.
- *  The buffer is attached to only the most recent transaction's AIL
- *    list for a couple of reasons.  One is that only the most up-to-date
- *    buffer content needs to be written to the in-place block on-disk.  The
- *    other is that since there is a more recent copy of the block in
- *    the log, we don't need to keep the older copies in the log.  We can
- *    remove them from the AIL and let the log space be reused for new
- *    transactions (GFS advances the log tail when removing buffers from AIL).
- */
-struct gfs_bufdata {
-	struct buffer_head *bd_bh;  /* We belong to this Linux buffer_head */
-	struct gfs_glock *bd_gl;    /* This glock protects buffer's payload */
-
-	/* Log elements map us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element bd_new_le;     /* New, incomplete transaction */
-	struct gfs_log_element bd_incore_le;  /* Complete (committed) trans */
-
-	char *bd_frozen;            /* "Frozen" copy of buffer's data */
-	struct semaphore bd_lock;   /* Protects access to this structure */
-
-	/* "Pin" means keep buffer in RAM, don't write to disk (yet) */
-	unsigned int bd_pinned;	         /* Recursive pin count */
-
-	/* Links to Active Items Lists */
-	osi_list_t bd_ail_tr_list; /* This buf's most recent trans' AIL */
-	osi_list_t bd_ail_gl_list; /* This buf's glock's AIL */
-};
-
-/*
- *  Glock operations
- *  One set of operations for each glock, the set selected by type of glock.
- *  These functions get called at various points in a glock's lifetime.
- *  "xmote" = promote or demote (change lock state) a glock at inter-node scope.
- *  "th" = top half, "bh" = bottom half
- *  Some operations/fields are required (GFS assumes they are there):
- *     go_xmote_th
- *     go_drop_th
- *     go_type
- *  Other operations are optional (GFS checks for presence before calling).
- */
-struct gfs_glock_operations {
-
-	/* Acquire lock or change lock state at inter-node scope:
-	     Does type-specific preparation (if any)
-	     Uses gfs_glock_xmote_th to call lock module. */
-	void (*go_xmote_th) (struct gfs_glock * gl, unsigned int state,
-			     int flags);
-
-	/* After acquiring or changing a lock at inter-node scope */
-	void (*go_xmote_bh) (struct gfs_glock * gl);
-
-	/* Release (unlock) a lock at inter-node scope:
-	     Does type-specific preparation (if any)
-	     Uses gfs_glock_drop_th to call lock module. */
-	void (*go_drop_th) (struct gfs_glock * gl);
-
-	/* After releasing a lock at inter-node scope */
-	void (*go_drop_bh) (struct gfs_glock * gl);
-
-	/* Sync dirty data to disk (e.g. before demoting an EX inter-node lock)
-	   (another node needs to read the updated data from disk) */
-	void (*go_sync) (struct gfs_glock * gl, int flags);
-
-	/* Invalidate local cached data just after releasing an inter-node lock
-	   (another node may change the on-disk data, so it's no good to us) */
-	void (*go_inval) (struct gfs_glock * gl, int flags);
-
-	/* Lock-type-specific check to see if it's okay to unlock a glock
-	   at inter-node scope (and remove it from our glock cache) */
-	int (*go_demote_ok) (struct gfs_glock * gl);
-
-	/* After getting lock for first holder (within this node) */
-	int (*go_lock) (struct gfs_glock * gl, int flags);
-
-	/* After last holder (within this node) gives up lock (glock may
-	   remain in glock cache, though) */
-	void (*go_unlock) (struct gfs_glock * gl, int flags);
-
-	/* After receiving a callback: another node needs the lock */
-	void (*go_callback) (struct gfs_glock * gl, unsigned int state);
-
-        /* Called when the glock layer marks a lock as being not greedy
-	   anymore */
-	void (*go_greedy) (struct gfs_glock * gl);
-
-	/* Lock type: locks with same lock # (often an FS block #),
-	   but different types, are different locks */
-	int go_type;
-};
-
-/*
- *  Glock holder structure
- *  One for each holder of a glock.
- *  These coordinate the use, within this node, of an acquired inter-node glock.
- *  Once a node has acquired a glock, it may be shared within that node by
- *    several processes, or even by several recursive requests from the same
- *    process.  Each is a separate "holder".  Different holders may co-exist
- *    having requested different lock states, as long as the node holds the
- *    glock in a state that is compatible.  A hold requestor may select, via
- *    flags, the rules by which sharing within the node is granted:
- *      LM_FLAG_ANY:  Grant if glock state is any other than UNLOCKED.
- *      GL_EXACT:     Grant only if glock state is exactly the requested state.
- *      GL_LOCAL_EXCL:  Grant only one holder at a time within this node.
- *    With no flags, a hold will be granted to a SHARED request even if the
- *    node holds the glock in EXCLUSIVE mode.  See relaxed_state_ok().
- *  When a process needs to manipulate a lock, it requests it via one of
- *    these holder structures.  If the request cannot be satisfied immediately,
- *    the holder structure gets queued on one of these lists in gfs_glock:
- *    1) waiters1, for gaining exclusive access to the (local) glock structure.
- *    2) waiters2, for demoting a lock (unlocking a glock, or changing its state
- *       to be less restrictive) or relenquishing "greedy" status.
- *    3) waiters3, for promoting (locking a new glock, or changing a glock state
- *       to be more restrictive).
- *  When holding a lock, gfs_holder struct stays on glock's holder list.
- *  See gfs-kernel/src/harness/lm_interface.h for gh_state (LM_ST_...)
- *    and gh_flags (LM_FLAG...) fields.
- *  Also see glock.h for gh_flags field (GL_...) flags.
- */
-
-/*  Action requests  */
-#define HIF_MUTEX       (0)  /* Exclusive (local) access to glock struct */
-#define HIF_PROMOTE     (1)  /* Change lock to more restrictive state */
-#define HIF_DEMOTE      (2)  /* Change lock to less restrictive state */
-#define HIF_GREEDY      (3)  /* Wait for the glock to be unlocked */
-
-/*  States  */
-#define HIF_ALLOCED     (4)  /* Holder structure is or was in use */
-#define HIF_DEALLOC     (5)  /* Toss holder struct as soon as queued request
-                              *   is satisfied */
-#define HIF_HOLDER      (6)  /* We have been granted a hold on the lock */
-#define HIF_FIRST       (7)  /* We are first holder to get the lock */
-#define HIF_RECURSE     (8)  /* >1 hold requests on same glock by same process*/
-#define HIF_ABORTED     (9) /* Aborted before being submitted */
-
-struct gfs_holder {
-	osi_list_t gh_list;      /* Link to one of glock's holder lists */
-
-	struct gfs_glock *gh_gl;       /* Glock that we're holding */
-	struct task_struct *gh_owner;  /* Linux process that is the holder */
-
-	/* request to change lock state */
-	unsigned int gh_state;         /* LM_ST_... requested lock state */
-	int gh_flags;                  /* GL_... or LM_FLAG_... req modifiers */
-
-	int gh_error;                  /* GLR_... CANCELLED/TRYFAILED/-errno */
-	unsigned long gh_iflags;       /* HIF_... holder state, see above */
-	struct completion gh_wait;     /* Wait for completion of ... */
-};
-
-/*
- *  Glock Structure
- *  One for each inter-node lock held by this node.
- *  A glock is a local representation/abstraction of an inter-node lock.
- *    Inter-node locks are managed by a "lock module" (LM) which plugs in to
- *    the lock harness / glock interface (see gfs-kernel/harness).  Different
- *    lock modules support different lock protocols (e.g. GULM, GDLM, no_lock).
- *  A glock may have one or more holders within a node.  See gfs_holder above.
- *  Glocks are managed within a hash table hosted by the in-core superblock.
- *  After all holders have released a glock, it will stay in the hash table
- *    cache for a time (depending on lock type), during which the inter-node
- *    lock will not be released unless another node needs the lock (lock
- *    manager requests this via callback to GFS through LM on this node).  This
- *    provides better performance in case this node needs the glock again soon.
- *    See comments for meta_go_demote_ok(), glops.c.
- *  Each glock has an associated vector of lock-type-specific "glops" functions
- *    which are called at important times during the life of a glock, and
- *    which define the type of lock (e.g. dinode, rgrp, non-disk, etc).
- *    See gfs_glock_operations above.
- *  A glock, at inter-node scope, is identified by the following dimensions:
- *    1)  lock number (usually a block # for on-disk protected entities,
- *           or a fixed assigned number for non-disk locks, e.g. MOUNT).
- *    2)  lock type (actually, the type of entity protected by the lock).
- *    3)  lock namespace, to support multiple GFS filesystems simultaneously.
- *           Namespace (usually cluster:filesystem) is specified when mounting.
- *           See man page for gfs_mount.
- *  Glocks require support of Lock Value Blocks (LVBs) by the inter-node lock
- *    manager.  LVBs are small (32-byte) chunks of data associated with a given
- *    lock, that can be quickly shared between cluster nodes.  Used for certain
- *    purposes such as sharing an rgroup's block usage statistics without
- *    requiring the overhead of:
- *      -- sync-to-disk by one node, then a
- *      -- read from disk by another node.
- *  
- */
-
-#define GLF_PLUG                (0)  /* Dummy */
-#define GLF_LOCK                (1)  /* Exclusive (local) access to glock
-                                      *   structure */
-#define GLF_STICKY              (2)  /* Don't release this inter-node lock
-                                      *   unless another node explicitly asks */
-#define GLF_PREFETCH            (3)  /* This lock has been (speculatively)
-                                      *   prefetched, demote if not used soon */
-#define GLF_SYNC                (4)  /* Sync lock's protected data as soon as
-                                      *   there are no more holders */
-#define GLF_DIRTY               (5)  /* There is dirty data for this lock,
-                                      *   sync before releasing inter-node */
-#define GLF_SKIP_WAITERS2       (6)  /* Make run_queue() ignore gl_waiters2
-                                      *   (demote/greedy) holders */
-#define GLF_GREEDY              (7)  /* This lock is ignoring callbacks
-                                      *   (requests from other nodes) for now */
-
-struct gfs_glock {
-	osi_list_t gl_list;    /* Link to hb_list in one of superblock's
-	                              * sd_gl_hash glock hash table buckets */
-	unsigned long gl_flags;      /* GLF_... see above */
-	struct lm_lockname gl_name;  /* Lock number and lock type */
-	atomic_t gl_count;           /* Usage count */
-
-	spinlock_t gl_spin;          /* Protects some members of this struct */
-
-	/* Lock state reflects inter-node manager's lock state */
-	unsigned int gl_state;       /* LM_ST_... see harness/lm_interface.h */
-
-	/* Lists of gfs_holders */
-	osi_list_t gl_holders;  /* all current holders of the glock */
-	osi_list_t gl_waiters1; /* HIF_MUTEX */
-	osi_list_t gl_waiters2; /* HIF_DEMOTE, HIF_GREEDY */
-	osi_list_t gl_waiters3; /* HIF_PROMOTE */
-
-	struct gfs_glock_operations *gl_ops; /* function vector, defines type */
-
-	/* State to remember for async lock requests */
-	struct gfs_holder *gl_req_gh; /* Holder for request being serviced */
-	gfs_glop_bh_t gl_req_bh;  /* The bottom half to execute */
-
-	lm_lock_t *gl_lock;       /* Lock module's private lock data */
-	char *gl_lvb;             /* Lock Value Block */
-	atomic_t gl_lvb_count;    /* LVB recursive usage (hold/unhold) count */
-
-	uint64_t gl_vn;           /* Incremented when protected data changes */
-	unsigned long gl_stamp;   /* Glock cache retention timer */
-	void *gl_object;          /* The protected entity (e.g. a dinode) */
-
-	/* Incore transaction stuff */
-	/* Log elements map us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element gl_new_le;     /* New, incomplete transaction */
-	struct gfs_log_element gl_incore_le;  /* Complete (committed) trans */ 
-
-	struct gfs_gl_hash_bucket *gl_bucket; /* Our bucket in sd_gl_hash */
-	osi_list_t gl_reclaim;          /* Link to sd_reclaim_list */
-
-	struct gfs_sbd *gl_sbd;               /* Superblock (FS instance) */
-
-	struct inode *gl_aspace;              /* The buffers protected by this lock */
-	osi_list_t gl_ail_bufs;         /* AIL buffers protected by us */
-};
-
-/*
- *  In-Place Reservation structure
- *  Coordinates allocation of "in-place" (as opposed to journal) FS blocks,
- *     which contain persistent inode/file/directory data and metadata.
- *     These blocks are the allocatable blocks within resource groups (i.e.
- *     not including rgrp header and block alloc bitmap blocks).
- *  gfs_inplace_reserve() calculates a fulfillment plan for allocating blocks,
- *     based on block statistics in the resource group headers.
- *  Then, gfs_blkalloc() or gfs_metaalloc() walks the block alloc bitmaps
- *     to do the actual allocation.
- */
-struct gfs_alloc {
-	/* Up to 4 quotas (including an inode's user and group quotas)
-	   can track changes in block allocation */
-
-	unsigned int al_qd_num;          /* # of quotas tracking changes */
-	struct gfs_quota_data *al_qd[4]; /* Ptrs to quota structures */
-	struct gfs_holder al_qd_ghs[4];  /* Holders for quota glocks */
-
-	/* Request, filled in by the caller to gfs_inplace_reserve() */
-
-	uint32_t al_requested_di;     /* Number of dinodes to reserve */
-	uint32_t al_requested_meta;   /* Number of metadata blocks to reserve */
-	uint32_t al_requested_data;   /* Number of data blocks to reserve */
-
-	/* Fulfillment plan, filled in by gfs_inplace_reserve() */
-
-	char *al_file;                /* Debug info, .c file making request */
-	unsigned int al_line;         /* Debug info, line of code making req */
-	struct gfs_holder al_ri_gh;   /* Glock holder for resource grp index */
-	struct gfs_holder al_rgd_gh;  /* Glock holder for al_rgd rgrp */
-	struct gfs_rgrpd *al_rgd;     /* Resource group from which to alloc */
-	uint32_t al_reserved_meta;    /* Alloc up to this # meta blocks from al_rgd */
-	uint32_t al_reserved_data;    /* Alloc up to this # data blocks from al_rgd */
-
-	/* Actual alloc, filled in by gfs_blkalloc()/gfs_metaalloc(), etc. */
-
-	uint32_t al_alloced_di;       /* # dinode blocks allocated */
-	uint32_t al_alloced_meta;     /* # meta blocks allocated */
-	uint32_t al_alloced_data;     /* # data blocks allocated */
-
-	/* Dinode allocation crap */
-
-	struct gfs_unlinked *al_ul;   /* Unlinked dinode log entry */
-};
-
-/*
- *  Incore inode structure
- */
-
-#define GIF_QD_LOCKED           (0)
-#define GIF_PAGED               (1)
-#define GIF_SW_PAGED            (2)
-
-struct gfs_inode {
-	struct gfs_inum i_num;   /* Formal inode # and block address */
-
-	atomic_t i_count;        /* Usage count */
-	unsigned long i_flags;   /* GIF_...  see above */
-
-	uint64_t i_vn;           /* Version #: if different from glock's vn,
-	                            we need to read inode from disk */
-	struct gfs_dinode i_di;  /* Dinode (on-disk) structure */
-
-	struct gfs_glock *i_gl;  /* This glock protects this inode */
-	struct gfs_sbd *i_sbd;   /* Superblock (fs instance structure) */
-	struct inode *i_vnode;   /* Linux VFS inode structure */
-
-	struct gfs_holder i_iopen_gh;  /* Glock holder for Inode Open lock */
-
-	/* Block allocation strategy, inode scope */
-	struct gfs_alloc *i_alloc; /* In-place block reservation structure */
-	uint64_t i_last_rg_alloc;  /* Most recent blk alloc was fm this rgrp */
-
-	spinlock_t i_spin;
-	struct rw_semaphore i_rw_mutex;
-
-	/* Cache of most-recently used buffers in indirect addressing chain */
-	struct buffer_head *i_cache[GFS_MAX_META_HEIGHT];
-
-	unsigned int i_greedy; /* The amount of time to be greedy */
-	unsigned long i_last_pfault; /* The time of the last page fault */
-};
-
-struct inode_info
-{
-        osi_list_t list;
-        uint64_t   inode;
-        uint32_t   link_count;   /* the number of links the inode
-                                  * thinks it has */
-        uint32_t   counted_links; /* the number of links we've found */
-};
-
-struct dir_info
-{
-	osi_list_t list;
-	uint64_t dinode;
-	uint64_t treewalk_parent;
-	uint64_t dotdot_parent;
-	uint8_t  checked:1;
-
-};
-
-/*
- *  GFS per-fd structure
- */
-
-#define GFF_DID_DIRECT_ALLOC    (0)
-
-struct gfs_file {
-	unsigned long f_flags; /* GFF_...  see above */
-
-	struct semaphore f_fl_lock; /* Lock to protect flock operations */
-	struct gfs_holder f_fl_gh; /* Holder for this f_vfile's flock */
-
-	struct gfs_inode *f_inode;        /* Incore GFS inode */
-	struct file *f_vfile;             /* Linux file struct */
-};
-
-/*
- *  Unlinked inode log entry incore structure
- */
-
-#define ULF_NEW_UL              (0)  /* Part of new (being built) trans */
-#define ULF_INCORE_UL           (1)  /* Part of incore-committed trans */
-#define ULF_IC_LIST             (2)
-#define ULF_OD_LIST             (3)
-#define ULF_LOCK                (4)  /* Protects access to this structure */
-
-struct gfs_unlinked {
-	osi_list_t ul_list;    /* Link to superblock's sd_unlinked_list */
-	unsigned int ul_count;       /* Usage count */
-
-	struct gfs_inum ul_inum;     /* Formal inode #, block addr */
-	unsigned long ul_flags;      /* ULF_... */
-
-	/* Log elements map us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element ul_new_le;    /* New, not yet committed */
-	struct gfs_log_element ul_incore_le; /* Committed to incore log */
-	struct gfs_log_element ul_ondisk_le; /* Committed to ondisk log */
-};
-
-/*
- *  Quota log element
- *  One for each logged change in a block alloc value affecting a given quota.
- *  Only one of these for a given quota within a given transaction;
- *    multiple changes, within one transaction, for a given quota will be
- *    combined into one log element.
- */
-struct gfs_quota_le {
-	/* Log element maps us to a particular set of log operations functions,
-	   and to a particular transaction */
-	struct gfs_log_element ql_le;    /* Generic log element structure */
-
-	struct gfs_quota_data *ql_data;  /* The quota we're changing */
-	osi_list_t ql_data_list;   /* Link to quota's log element list */
-
-	int64_t ql_change;           /* # of blocks alloc'd (+) or freed (-) */
-};
-
-/*
- *  Quota structure
- *  One for each user or group quota.
- *  Summarizes all block allocation activity for a given quota, and supports
- *    recording updates of current block alloc values in GFS' special quota
- *    file, including the journaling of these updates, encompassing
- *    multiple transactions and log dumps.
- */
-
-#define QDF_USER                (0)   /* User (1) vs. group (0) quota */
-#define QDF_OD_LIST             (1)   /* Waiting for sync to quota file */
-#define QDF_LOCK                (2)   /* Protects access to this structure */
-
-struct gfs_quota_data {
-	osi_list_t qd_list;     /* Link to superblock's sd_quota_list */
-	unsigned int qd_count;        /* Usage count */
-
-	uint32_t qd_id;               /* User or group ID number */
-	unsigned long qd_flags;       /* QDF_... */
-
-	/* This list is for non-log-dump transactions */
-	osi_list_t qd_le_list;  /* List of gfs_quota_le log elements */
-
-	/* Summary of block alloc changes affecting this quota, in various
-	   stages of logging & syncing changes to the special quota file */
-	int64_t qd_change_new;  /* New, not yet committed to in-core log*/
-	int64_t qd_change_ic;   /* Committed to in-core log */
-	int64_t qd_change_od;   /* Committed to on-disk log */
-	int64_t qd_change_sync; /* Being synced to the in-place quota file */
-
-	struct gfs_quota_le qd_ondisk_ql; /* Log element for log dump */
-	uint64_t qd_sync_gen;         /* Sync-to-quota-file generation # */
-
-	/* Glock provides protection for quota, *and* provides
-	   lock value block (LVB) communication, between nodes, of current
-	   quota values.  Shared lock -> LVB read.  EX lock -> LVB write. */
-	struct gfs_glock *qd_gl;      /* glock for this quota */
-	struct gfs_quota_lvb qd_qb;   /* LVB (limit/warn/value) */
-
-	unsigned long qd_last_warn;   /* Jiffies of last warning to user */
-};
-
-/*
- * Log Buffer descriptor structure.
- * One for each block buffer recorded in the log.
- * When beginning a new transaction, GFS pre-allocates a number of these,
- *   and puts them on transaction's tr_free_bufs list.
- * Logged buffers are of two types:
- *   1).  Exact copies of buffers to be written to in-place location in FS.
- *   2).  Log-only buffers such as log headers and control blocks (e.g. tags).
- * A gfs_log_buf is required for both types; the ones for log-only buffers
- *   contain NULL in lb_unlock, and get cleaned up after the log write.
- * lb_bh is a "fake" buffer head that directs Linux block I/O to write the buf
- *   to the on-disk log location, rather than the on-disk in-place location.
- *   Used for both types.
- * lb_unlock points to the "real" buffer head that directs Linux to write the
- *   buf to its regular on-disk in-place filesystem location.  Once the commit
- *   to the on-disk log is finished, GFS unlocks the "real" buffer so it can be
- *   written to in-place block, or modified by another transaction.
- *   Used only for type 1).
- */
-struct gfs_log_buf {
-	/* Link to one of the transaction structure's lists */
-	osi_list_t lb_list;      /* Link to tr_free_bufs or tr_list */
-
-	struct buffer_head lb_bh;      /* "Fake" bh; for the log block */
-	struct buffer_head *lb_unlock; /* "Real" bh; for the in-place block */
-};
-
-/*
- *  Transaction structure
- *  One for each transaction
- *  This coordinates the logging and flushing of written metadata.
- */
-
-#define TRF_LOG_DUMP            (0x00000001)
-#define TRF_DUMMY               (0x00000002)
-
-struct gfs_trans {
-
-	/* Link to various lists */
-	osi_list_t tr_list;      /* Superblk's incore trans or AIL list*/
-
-	/* Initial creation stuff */
-
-	char *tr_file;                 /* Debug info: .c file creating trans */
-	unsigned int tr_line;          /* Debug info: codeline creating trans */
-
-	/* Reservations for on-disk space in journal.
-	   Meta blocks are copies of in-place filesystem blocks.  
-	   Extra blocks are log-only (log header and control blocks) */
-	unsigned int tr_mblks_asked;   /* # of meta log blocks requested */
-	unsigned int tr_eblks_asked;   /* # of extra log blocks requested */
-	unsigned int tr_seg_reserved;  /* # of segments actually reserved */
-
-	struct gfs_holder *tr_t_gh;    /* Glock holder for this transaction */
-
-	/* Stuff filled in during creation */
-
-	unsigned int tr_flags;         /* TRF_... */
-	osi_list_t tr_elements;  /* List of this trans' log elements */
-
-	/* Stuff modified during the commit */
-
-	/* When creating a new transaction, GFS pre-allocates as many of
-	   these buffers and descriptor structures as it might need for
-	   all loggable filesystem (meta)data, and log-control (log-only, not
-	   going to filesystem in-place location) data going to on-disk log.
-	   It keeps them on these "free" lists until they get used (and linked
-	   into tr_bufs list, below) or "refunded" if not needed. */
-	unsigned int tr_num_free_bufs; /* List of free gfs_log_buf structs */
-	osi_list_t tr_free_bufs; /* .. 1 for each log block */
-	unsigned int tr_num_free_bmem; /* List of free fs-block-size buffers */
-	osi_list_t tr_free_bmem; /* .. for log-only (e.g. tag) blocks */
-
-	/* Logged transaction starts with a (first) log header at a segment
-	   boundary, and fills contiguous blocks after that.  Each segment
-	   boundary block gets another log header. */
-	uint64_t tr_log_head;          /* The next log block # to fill */
-	uint64_t tr_first_head;	       /* Trans' first log header's block # */
-
-	/* gfs_log_buf structs move from tr_free_bufs to here when being used */
-	osi_list_t tr_bufs;      /* List of buffers going to the log */
-
-	/* Stuff that's part of the Active Items List (AIL) */
-
-	osi_list_t tr_ail_bufs;  /* List of buffers on AIL list */
-
-	/* # log elements of various types on tr_elements list */
-
-	unsigned int tr_num_gl;        /* Glocks */
-	unsigned int tr_num_buf;       /* Buffers */
-	unsigned int tr_num_iul;       /* Unlinked inodes */
-	unsigned int tr_num_ida;       /* De-allocated inodes */
-	unsigned int tr_num_q;         /* Quotas */
-};
-
-#define GFS_GLOCKD_DEFAULT (1)
-#define GFS_GLOCKD_MAX (32)
-
-struct gfs_args {
-	char ar_lockproto[GFS_LOCKNAME_LEN]; /* The name of the Lock Protocol */
-	char ar_locktable[GFS_LOCKNAME_LEN]; /* The name of the Lock Table */
-	char ar_hostdata[GFS_LOCKNAME_LEN]; /* The host specific data */
-
-        /*
-	 * GFS can invoke some flock and disk caching optimizations if it is
-	 * not in a cluster, i.e. is a local filesystem.  The chosen lock
-	 * module tells GFS, at mount time, if it supports clustering.
-	 * The nolock module is the only one that does not support clustering;
-	 * it sets to TRUE the local_fs field in the struct lm_lockops.
-	 * GFS can either optimize, or ignore the opportunity.
-	 * The user controls behavior via the following mount options.
-	 */
-	int ar_ignore_local_fs; /* Don't optimize even if local_fs is TRUE */
-	int ar_localflocks; /* Let the VFS do flock|fcntl locks for us */
-	int ar_localcaching; /* Local-style caching (dangerous on multihost) */
-	int ar_oopses_ok; /* Allow oopses */
-
-	int ar_debug; /* Oops on errors instead of trying to be graceful */
-	int ar_upgrade; /* Upgrade ondisk/multihost format */
-
-	unsigned int ar_num_glockd; /* # of glock cleanup daemons to run
-				       (more daemons => faster cleanup)  */
-	int ar_posix_acls; /* Enable posix acls */
-	int ar_suiddir; /* suiddir support */
-};
-
-struct gfs_tune {
-	spinlock_t gt_spin;
-
-	unsigned int gt_ilimit1;
-	unsigned int gt_ilimit1_tries;
-	unsigned int gt_ilimit1_min;
-	unsigned int gt_ilimit2;
-	unsigned int gt_ilimit2_tries;
-	unsigned int gt_ilimit2_min;
-	unsigned int gt_demote_secs; /* Cache retention for unheld glock */
-	unsigned int gt_incore_log_blocks;
-	unsigned int gt_jindex_refresh_secs; /* Check for new journal index */
-	unsigned int gt_depend_secs;
-
-	/* How often various daemons run (seconds) */
-	unsigned int gt_scand_secs; /* Find unused glocks and inodes */
-	unsigned int gt_recoverd_secs; /* Recover journal of crashed node */
-	unsigned int gt_logd_secs; /* Update log tail as AIL flushes */
-	unsigned int gt_quotad_secs; /* Sync changes to quota file, clean*/
-	unsigned int gt_inoded_secs; /* Toss unused inodes */
-
-	unsigned int gt_quota_simul_sync; /* Max # quotavals to sync at once */
-	unsigned int gt_quota_warn_period; /* Secs between quota warn msgs */
-	unsigned int gt_atime_quantum; /* Min secs between atime updates */
-	unsigned int gt_quota_quantum; /* Secs between syncs to quota file */
-	unsigned int gt_quota_scale_num; /* Numerator */
-	unsigned int gt_quota_scale_den; /* Denominator */
-	unsigned int gt_quota_enforce;
-	unsigned int gt_quota_account;
-	unsigned int gt_new_files_jdata;
-	unsigned int gt_new_files_directio;
-	unsigned int gt_max_atomic_write; /* Split large writes into this size*/
-	unsigned int gt_max_readahead; /* Max bytes to read-ahead from disk */
-	unsigned int gt_lockdump_size;
-	unsigned int gt_stall_secs; /* Detects trouble! */
-	unsigned int gt_complain_secs;
-	unsigned int gt_reclaim_limit; /* Max # glocks in reclaim list */
-	unsigned int gt_entries_per_readdir;
-	unsigned int gt_prefetch_secs; /* Usage window for prefetched glocks */
-	unsigned int gt_statfs_slots;
-	unsigned int gt_max_mhc; /* Max # of meta headers in mhc cache */
-	unsigned int gt_greedy_default;
-	unsigned int gt_greedy_quantum;
-	unsigned int gt_greedy_max;
-	unsigned int gt_rgrp_try_threshold;
-};
-
-/*
- *  One bucket of the filesystem's sd_gl_hash glock hash table.
- *
- *  A gfs_glock links into a bucket's list via glock's gl_list member.
- *
- */
-struct gfs_gl_hash_bucket {
-	rwlock_t hb_lock;              /* Protects list */
-	osi_list_t hb_list;      /* List of glocks in this bucket */
-};
-
-struct options {
-	char *device;
-	int yes:1;
-	int no:1;
-};
-
-/*
- *  "Super Block" Data Structure
- *  One per mounted filesystem.
- *  This is the big instance structure that ties everything together for
- *    a given mounted filesystem.  Each GFS mount has its own, supporting
- *    mounts of multiple GFS filesystems on each node.
- *  Pointer to this is usually seen as "sdp" throughout code.
- *  This is a very large structure, as structures go, in part because it
- *    contains arrays of hash buckets for various in-core caches.
- */
-
-#define SDF_JOURNAL_LIVE        (0)  /* Journaling is active (journal is writeable)*/
-#define SDF_SHUTDOWN            (1)  /* FS abnormaly shutdown */
-
-/* Run (1) / stop (0) flags for various daemons */
-#define SDF_SCAND_RUN           (2)  /* Put unused glocks on reclaim queue */
-#define SDF_GLOCKD_RUN          (3)  /* Reclaim (dealloc) unused glocks */
-#define SDF_RECOVERD_RUN        (4)  /* Recover journal of a crashed node */
-#define SDF_LOGD_RUN            (5)  /* Update log tail after AIL flushed */
-#define SDF_QUOTAD_RUN          (6)  /* Sync quota changes to file, cleanup */
-#define SDF_INODED_RUN          (7)  /* Deallocate unlinked inodes */
-
-/* (Re)mount options from Linux VFS */
-#define SDF_NOATIME             (8)  /* Don't change access time */
-#define SDF_ROFS                (9)  /* Read-only mode */
-
-/* Journal log dump support */
-#define SDF_NEED_LOG_DUMP       (10) /* Need to rewrite unlink and quota tags */
-#define SDF_FOUND_UL_DUMP       (11) /* Recovery found unlinked tags */
-#define SDF_FOUND_Q_DUMP        (12) /* Recovery found qutoa tags */
-#define SDF_IN_LOG_DUMP         (13) /* Serializes log dumps */
-
-/* Glock cache */
-#define GFS_GL_HASH_SHIFT       (13)    /* # hash buckets = 8K */
-#define GFS_GL_HASH_SIZE        (1 << GFS_GL_HASH_SHIFT)
-#define GFS_GL_HASH_MASK        (GFS_GL_HASH_SIZE - 1)
-
-/* Meta header cache */
-#define GFS_MHC_HASH_SHIFT      (10)    /* # hash buckets = 1K */
-#define GFS_MHC_HASH_SIZE       (1 << GFS_MHC_HASH_SHIFT)
-#define GFS_MHC_HASH_MASK       (GFS_MHC_HASH_SIZE - 1)
-
-/* Dependency cache */
-#define GFS_DEPEND_HASH_SHIFT   (10)    /* # hash buckets = 1K */
-#define GFS_DEPEND_HASH_SIZE    (1 << GFS_DEPEND_HASH_SHIFT)
-#define GFS_DEPEND_HASH_MASK    (GFS_DEPEND_HASH_SIZE - 1)
-
-struct gfs_sbd {
-	struct gfs_sb sd_sb;            /* GFS on-disk Super Block image */
-
-	struct super_block *sd_vfs;     /* Linux VFS device independent sb */
-
-	struct gfs_args sd_args;        /* Mount arguments */
-	unsigned long sd_flags;         /* SDF_... see above */
-
-	struct gfs_tune sd_tune;	/* Filesystem tuning structure */
-
-	/* Resource group stuff */
-
-	struct gfs_inode *sd_riinode;	/* Resource Index (rindex) inode */
-	uint64_t sd_riinode_vn;	        /* Resource Index version # (detects
-	                                   whether new rgrps have been added) */
-
-	osi_list_t sd_rglist;	/* List of all resource groups,
-					   on-disk order */
-	struct semaphore sd_rindex_lock;/* Serializes RIndex rereads */
-	osi_list_t sd_rg_mru_list;/* List of all resource groups,
-					   most-recently-used (MRU) order */
-	spinlock_t sd_rg_mru_lock;      /* Protect mru list */
-	osi_list_t sd_rg_recent;	/* List of rgrps from which blocks
-					   were recently allocated */
-	spinlock_t sd_rg_recent_lock;   /* Protect recent list */
-	struct gfs_rgrpd *sd_rg_forward;/* Next rgrp from which to attempt
-					   a block alloc */
-	spinlock_t sd_rg_forward_lock;  /* Protect forward pointer */
-
-	unsigned int sd_rgcount;	/* Total # of resource groups */
-
-	/*  Constants computed on mount  */
-
-	/* "bb" == "basic block" == 512Byte sector */
-	uint32_t sd_fsb2bb;             /* # 512B basic blocks in a FS block */
-	uint32_t sd_fsb2bb_shift;       /* Shift sector # to the right by 
-	                                   this to get FileSystem block addr */
-	uint32_t sd_diptrs;     /* Max # of block pointers in a dinode */
-	uint32_t sd_inptrs;     /* Max # of block pointers in an indirect blk */
-	uint32_t sd_jbsize;     /* Payload size (bytes) of a journaled metadata
-	                               block (GFS journals all meta blocks) */
-	uint32_t sd_hash_bsize; /* sizeof(exhash hash block) */
-	uint32_t sd_hash_bsize_shift;
-	uint32_t sd_hash_ptrs;  /* Number of points in a hash block */
-	uint32_t sd_max_dirres; /* Max blocks needed to add a directory entry */
-	uint32_t sd_max_height;	/* Max height of a file's tree */
-	uint64_t sd_heightsize[GFS_MAX_META_HEIGHT];
-	uint32_t sd_max_jheight; /* Max height, journaled file's tree */
-	uint64_t sd_jheightsize[GFS_MAX_META_HEIGHT];
-
-	/*  Lock Stuff  */
-
-	/* Glock cache (all glocks currently held by this node for this FS) */
-	struct gfs_gl_hash_bucket sd_gl_hash[GFS_GL_HASH_SIZE];
-
-	/* Glock reclaim support for scand and glockd */
-	osi_list_t sd_reclaim_list;   /* List of glocks to reclaim */
-	spinlock_t sd_reclaim_lock;
-	wait_queue_head_t sd_reclaim_wchan;
-	atomic_t sd_reclaim_count;          /* # glocks on reclaim list */
-
-	/* Lock module tells us if we're first-to-mount, 
-	   which journal to use, etc. */
-	struct lm_lockstruct sd_lockstruct; /* Info provided by lock module */
-
-	/*  Other caches */
-
-	/* Meta-header cache (incore copies of on-disk meta headers) */
-	osi_list_t sd_mhc[GFS_MHC_HASH_SIZE]; /* hash buckets */
-	osi_list_t sd_mhc_single;     /* Non-hashed list of all MHCs */
-	spinlock_t sd_mhc_lock;
-	atomic_t sd_mhc_count;              /* # MHCs in cache */
-
-	/* Dependency cache */
-	osi_list_t sd_depend[GFS_DEPEND_HASH_SIZE];  /* Hash buckets */
-	spinlock_t sd_depend_lock;
-	atomic_t sd_depend_count;           /* # dependencies in cache */
-
-	/* LIVE inter-node lock indicates that FS is mounted on at least
-	   one node */
-	struct gfs_holder sd_live_gh;       /* Glock holder for LIVE lock */
-
-	/* For quiescing the filesystem */
-	struct gfs_holder sd_freeze_gh;
-	struct semaphore sd_freeze_lock;
-	unsigned int sd_freeze_count;
-
-	/*  Inode Stuff  */
-
-	struct gfs_inode *sd_rooti;         /* FS's root inode */
-
-	/* Only 1 node at a time may rename (e.g. mv) directory from
-	   one directory to another. */
-	struct gfs_glock *sd_rename_gl;     /* Rename glock */
-
-	/*  Daemon stuff  */
-
-	/* Scan for glocks and inodes to toss from memory */
-	struct task_struct *sd_scand_process; /* Scand places on reclaim list*/
-	unsigned int sd_glockd_num;    /* # of glockd procs to do reclaiming*/
-
-	/* Recover journal of a crashed node */
-	struct task_struct *sd_recoverd_process;
-
-	/* Update log tail as AIL gets flushed to in-place on-disk blocks */
-	struct task_struct *sd_logd_process;
-
-	/* Sync quota updates to disk, and clean up unused quota structs */
-	struct task_struct *sd_quotad_process;
-
-	/* Clean up unused inode structures */
-	struct task_struct *sd_inoded_process;
-
-	/* Support for starting/stopping daemons */
-	struct semaphore sd_thread_lock;
-	struct completion sd_thread_completion;
-
-	/*  Log stuff  */
-
-	/* Transaction lock protects the following from one another:
-	   normal write transaction, journal replay (recovery), fs upgrade,
-	   fs read-only => read/write and read/write => read-only conversions.
-	   Also, acquiring the transaction lock in a state other than shared
-	   causes all other machines in the cluster to sync out their dirty
-	   data, mark their journal as being clean, and prevent any new FS
-	   modifications from occuring (i.e. quiesces the FS). */
-	struct gfs_glock *sd_trans_gl;	/* Transaction glock structure */
-
-	struct gfs_inode *sd_jiinode;	/* Journal index inode */
-	uint64_t sd_jiinode_vn;         /* Journal index version # (detects
-	                                   if new journals have been added) */
-
-	unsigned int sd_journals;	/* Number of journals in the FS */
-	struct gfs_jindex *sd_jindex;	/* Array of journal descriptors */
-	struct semaphore sd_jindex_lock;
-	unsigned long sd_jindex_refresh_time; /* Poll for new journals (secs) */
-
-	struct gfs_jindex sd_jdesc;	 /* This machine's journal descriptor */
-	struct gfs_holder sd_journal_gh; /* This machine's jrnl glock holder */
-
-	uint64_t sd_sequence;	/* Assigned to xactions in order they commit */
-	uint64_t sd_log_head;	/* Block number of next journal write */
-	uint64_t sd_log_wrap;
-
-	spinlock_t sd_log_seg_lock;
-	unsigned int sd_log_seg_free;	/* # of free segments in the log */
-	unsigned int sd_log_seg_ail2; /* # of freeable segments in the log */
-	osi_list_t sd_log_seg_list;
-	wait_queue_head_t sd_log_seg_wait;
-
-	/* "Active Items List" of transactions that have been flushed to
-	   on-disk log, and are waiting for flush to in-place on-disk blocks */
-	osi_list_t sd_log_ail;	/* "next" is head, "prev" is tail */
-
-	/* Transactions committed incore, but not yet flushed to on-disk log */
-	osi_list_t sd_log_incore;	/* "Next" is newest, "prev" is oldest */
-	unsigned int sd_log_buffers;	/* # of buffers in the incore log */
-
-	struct rw_semaphore sd_log_lock;	/* Lock for access to log values */
-
-	uint64_t sd_log_dump_last;
-	uint64_t sd_log_dump_last_wrap;
-
-	/*
-	 * Unlinked inode crap.
-	 * List includes newly created, not-yet-linked inodes,
-	 *   as well as inodes that have been unlinked and are waiting
-         *   to be de-allocated.
-	 */
-	osi_list_t sd_unlinked_list; /* List of unlinked inodes */
-	spinlock_t sd_unlinked_lock;       /* Protects list and members */
-
-	atomic_t sd_unlinked_ic_count;
-	atomic_t sd_unlinked_od_count;
-
-	/* Quota crap */
-
-	osi_list_t sd_quota_list; /* List of all gfs_quota_data structs */
-	spinlock_t sd_quota_lock;
-
-	atomic_t sd_quota_count;        /* # quotas on sd_quota_list */
-	atomic_t sd_quota_od_count;     /* # quotas waiting for sync to
-	                                   special on-disk quota file */
-
-	struct gfs_inode *sd_qinode;    /* Special on-disk quota file */
-
-	uint64_t sd_quota_sync_gen;     /* Generation, incr when sync to file */
-	unsigned long sd_quota_sync_time; /* Jiffies, last sync to quota file */
-
-	/* License crap */
-
-	struct gfs_inode *sd_linode;    /* Special on-disk license file */
-
-	/* Recovery stuff */
-
-	/* Lock module tells GFS, via callback, when a journal needs recovery.
-	   It stays on this list until recovery daemon performs recovery. */
-	osi_list_t sd_dirty_j;    /* List of dirty journals */
-	spinlock_t sd_dirty_j_lock;     /* Protects list */
-
-	/* Statistics for 3 possible recovery actions for each buffer in log,
-	     determined by comparing generation #s of logged block and
-	     in-place block.  Scope of stats is for one journal. */
-	unsigned int sd_recovery_replays; /* newer than in-place; copy it */
-	unsigned int sd_recovery_skips;   /* older than in-place; ignore it */
-	unsigned int sd_recovery_sames;   /* same as in-place; ignore it */
-
-	/* Counters */
-
-	/* current quantities of various things */
-	atomic_t sd_glock_count;      /* # of gfs_glock structs alloc'd */
-	atomic_t sd_glock_held_count; /* # of glocks locked by this node */
-	atomic_t sd_inode_count;      /* # of gfs_inode structs alloc'd */
-	atomic_t sd_bufdata_count;    /* # of gfs_bufdata structs alloc'd */
-
-	atomic_t sd_fh2dentry_misses; /* total # get_dentry misses */
-	atomic_t sd_reclaimed;        /* total # glocks reclaimed since mount */
-
-	/* total lock-related calls handled since mount */
-	atomic_t sd_glock_nq_calls;
-	atomic_t sd_glock_dq_calls;
-	atomic_t sd_glock_prefetch_calls;
-	atomic_t sd_lm_lock_calls;
-	atomic_t sd_lm_unlock_calls;
-	atomic_t sd_lm_callbacks;
-
-	atomic_t sd_lm_outstanding;
-	atomic_t sd_bio_reads;
-	atomic_t sd_bio_writes;
-	atomic_t sd_bio_outstanding;
-
-	/* total calls from Linux VFS handled since mount */
-	atomic_t sd_ops_address;
-	atomic_t sd_ops_dentry;
-	atomic_t sd_ops_export;
-	atomic_t sd_ops_file;
-	atomic_t sd_ops_inode;
-	atomic_t sd_ops_super;
-	atomic_t sd_ops_vm;
-
-	char sd_fsname[256];
-
-	/* Debugging crud */
-
-	unsigned long sd_last_warning;
-
-	spinlock_t sd_ail_lock;
-	osi_list_t sd_recovery_bufs;
-
-	osi_list_t sd_list;
-#ifndef __KERNEL__ /* if called from userland */
-	uint64_t last_fs_block;
-	uint64_t last_data_block;
-	uint64_t first_data_block;
-    /* contains list of data and metadata blocks and various info about each */
-	struct block_list *bl;
-	struct gfs_inode *lf_dip;       /* lost-n-found dir inode */
-	/* dir_list is used to keep track of directory inodes and
-	 * their parents */
-	osi_list_t dir_hash[FSCK_HASH_SIZE];
-	
-	/* inode_list is used to keep track of the link count of
-	 * inodes */
-	osi_list_t inode_hash[FSCK_HASH_SIZE];
-	osi_list_t dup_list;
-#endif
-};
-
-#endif /* __INCORE_DOT_H__ */
diff --git a/gfs/libgfs/inode.c b/gfs/libgfs/inode.c
deleted file mode 100644
index b288ef6..0000000
--- a/gfs/libgfs/inode.c
+++ /dev/null
@@ -1,322 +0,0 @@
-#include <stdint.h>
-#include "gfs_ondisk.h"
-#include "incore.h"
-#include "osi_user.h"
-#include "libgfs.h"
-
-/* FIXME: Not crazy about this name vs. load_inode, but I'm not very
- * creative ATM */
-/* replaces fs_copyin_dinode */
-int copyin_inode(struct gfs_sbd *sbp, osi_buf_t *bh, struct gfs_inode **inode)
-{
-	struct gfs_inode *ip;
-
-	if(!(ip = (struct gfs_inode *)malloc(sizeof(struct gfs_inode)))) {
-		log_err("Unable to allocate memory for inode\n");
-		return -1;
-	}
-	if(!memset(ip, 0, sizeof(struct gfs_inode))) {
-		log_err("Unable to zero inode memory\n");
-		return -1;
-	}
-	ip->i_sbd = sbp;
-
-	ip->i_num.no_addr = ip->i_num.no_formal_ino = BH_BLKNO(bh);
-	memset(&ip->i_di, 0, sizeof(struct gfs_dinode));
-
-	gfs_dinode_in(&ip->i_di, BH_DATA(bh));
-
-	*inode = ip;
-
-	return 0;
-}
-
-int load_inode(int disk_fd, struct gfs_sbd *sbp, uint64_t block,
-			   struct gfs_inode **inode)
-{
-	osi_buf_t *bh;
-
-	if(get_and_read_buf(disk_fd, sbp->sd_sb.sb_bsize, block, &bh, 0)){
-		log_err("Unable to retrieve block %"PRIu64"\n",
-			block);
-		return -1;
-	}
-
-	if(copyin_inode(sbp, bh, inode)) {
-		relse_buf(bh);
-		return -1;
-	}
-
-	relse_buf(bh);
-	return 0;
-}
-
-
-void free_inode(struct gfs_inode **inode)
-{
-	free(*inode);
-	inode = NULL;
-}
-
-
-int check_inode(struct gfs_inode *ip)
-{
-	int error = 0;
-	if(ip->i_di.di_header.mh_type != GFS_METATYPE_DI) {
-		return -1;
-	}
-
-	if(ip->i_num.no_formal_ino != ip->i_di.di_num.no_formal_ino){
-		log_err(
-			"In-core and on-disk formal inode"
-			"numbers do not match. %"PRIu64" %"PRIu64"\n",
-			ip->i_num.no_formal_ino,
-			ip->i_di.di_num.no_formal_ino);
-		error = -1;
-	}
-
-	/*  Handle a moved inode  */
-
-	if (ip->i_num.no_addr != ip->i_di.di_num.no_addr){
-		log_err("\tBlock # used to read disk inode: %"PRIu64"\n"
-			"\tBlock # recorded in disk inode : %"PRIu64"\n",
-			ip->i_num.no_addr, ip->i_di.di_num.no_addr);
-		error = -1;
-	}
-
-	return error;
-
-}
-
-
-
-/*int remove_inode(struct gfs_sbd *sbp, uint64_t block)
-{
-	struct gfs_inode *ip;
-	load_inode(sbp, block, &ip);
-	check_metatree(ip, &fxns);
-	free_inode(&ip);
-	return 0;
-}*/
-
-/**
- * fs_get_istruct - Get an inode given its number
- * @sdp: The GFS superblock
- * @inum: The inode number
- * @create: Flag to say if we are allowed to create a new struct gfs_inode
- * @ipp: pointer to put the returned inode in
- *
- * Returns: 0 on success, -1 on error
- */
-static int fs_get_istruct(int disk_fd, struct gfs_sbd *sdp,
-						  struct gfs_inum *inum,
-						  int create, struct gfs_inode **ipp)
-{
-	struct gfs_inode *ip = NULL;
-	int error = 0;
-
-	if (!create){
-		/* we are not currently tracking which inodes we already have */
-		error = -1;
-		goto out;
-	}
-
-	ip = (struct gfs_inode *)malloc(sizeof(struct gfs_inode));
-	// FIXME: handle failed malloc
-	ip->i_num = *inum;
-
-	ip->i_sbd = sdp;
-
-	error = fs_copyin_dinode(disk_fd, sdp->sd_sb.sb_bsize, ip, NULL);
-	if (error){
-		free(ip);
-		ip = NULL;
-		goto out;
-	}
-
- out:
-	*ipp = ip;
-
-	return error;
-}
-
-
-
-/**
- * make_dinode - Fill in a new dinode structure
- * @dip: the directory this inode is being created in
- * @inum: the inode number
- * @type: the file type
- * @mode: the file permissions
- * @cred: a credentials structure
- *
- */
-
-int make_dinode(int disk_fd, struct gfs_inode *dip,
-					   struct gfs_sbd *sdp, struct gfs_inum *inum,
-                       unsigned int type, unsigned int mode, osi_cred_t *cred)
-{
-	struct gfs_dinode di;
-	osi_buf_t *dibh;
-	struct gfs_rgrpd *rgd;
-	int error;
-
-	error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, inum->no_addr,
-							 &dibh, 0);
-	if (error)
-		goto out;
-
-	if(check_meta(dibh, 0)){
-		struct gfs_meta_header mh;
-	        log_debug("Buffer #%"PRIu64" has no meta header.\n",
-			  BH_BLKNO(dibh));
-		memset(&mh, 0, sizeof(struct gfs_meta_header));
-		mh.mh_magic = GFS_MAGIC;
-		mh.mh_type = GFS_METATYPE_NONE;
-		gfs_meta_header_out(&mh, BH_DATA(dibh));
-		log_debug("meta header added.\n");
-	}
-
-	((struct gfs_meta_header *)BH_DATA(dibh))->mh_type =
-		cpu_to_gfs32(GFS_METATYPE_DI);
-	((struct gfs_meta_header *)BH_DATA(dibh))->mh_format =
-		cpu_to_gfs32(GFS_FORMAT_DI);
-
-	memset(BH_DATA(dibh) + sizeof(struct gfs_dinode), 0,
-	       BH_SIZE(dibh) - sizeof(struct gfs_dinode));
-
-	memset(&di, 0, sizeof(struct gfs_dinode));
-
-	gfs_meta_header_in(&di.di_header, BH_DATA(dibh));
-
-	di.di_num = *inum;
-
-	if (dip && (dip->i_di.di_mode & 02000))
-	{
-		di.di_mode = mode | ((type == GFS_FILE_DIR) ? 02000 : 0);
-		di.di_gid = dip->i_di.di_gid;
-	}
-	else
-	{
-		di.di_mode = mode;
-		di.di_gid = osi_cred_to_gid(cred);
-	}
-
-	di.di_uid = osi_cred_to_uid(cred);
-	di.di_nlink = 1;
-	di.di_blocks = 1;
-	di.di_atime = di.di_mtime = di.di_ctime = osi_current_time();
-
-	rgd = fs_blk2rgrpd(sdp, inum->no_addr);
-	if(!rgd){
-		log_crit("Unable to map block #%"PRIu64" to rgrp\n", inum->no_addr);
-		exit(1);
-	}
-
-	di.di_rgrp = rgd->rd_ri.ri_addr;
-	di.di_goal_rgrp = di.di_rgrp;
-	di.di_goal_dblk = di.di_goal_mblk = inum->no_addr - rgd->rd_ri.ri_data1;
-
-	di.di_type = type;
-
-	gfs_dinode_out(&di, BH_DATA(dibh));
-	if (write_buf(disk_fd, dibh, 0)){
-		log_err("make_dinode:  bad write_buf()\n");
-		error = -EIO;
-	}
-
-	relse_buf(dibh);
-
-
- out:
-
-	return error;
-}
-
-int create_inode(int disk_fd, struct gfs_sbd *sbp, unsigned int type,
-				 struct gfs_inode **ip)
-{
-	uint64_t block;
-	struct gfs_rgrpd *rgd;
-	osi_list_t *tmp;
-	struct gfs_inum inum;
-	int allocate=0;
-	unsigned int mode = 0755;
-	osi_cred_t cred;
-	cred.cr_uid = getuid();
-	cred.cr_gid = getgid();
- retry:
-	inum.no_addr = inum.no_formal_ino = 0;
-	/* Search for a resource group that has free space */
-	osi_list_foreach(tmp, (osi_list_t *)&sbp->sd_rglist) {
-		/* Create a new inode in that rgd */
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-		if(fs_rgrp_read(disk_fd, rgd, FALSE)) {
-			return -1;
-		}
-		if(rgd->rd_rg.rg_freemeta){
-			block = fs_blkalloc_internal(rgd, 0,
-						     GFS_BLKST_FREEMETA, GFS_BLKST_USEDMETA, 1);
-			log_debug("Got block %"PRIu64"\n", block);
-			if(block == BFITNOENT) {
-				fs_rgrp_relse(rgd);
-				continue;
-			}
-			block += rgd->rd_ri.ri_data1;
-
-			inum.no_addr = inum.no_formal_ino = block;
-			/* FIXME: type isn't right */
-			block_set(sbp->bl, block, type);
-			/* write out the rgrp */
-			gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-			write_buf(disk_fd, rgd->rd_bh[0], 0);
-			fs_rgrp_relse(rgd);
-			break;
-		}
-		else {
-			if(allocate && !clump_alloc(disk_fd, rgd, 0)){
-				block = fs_blkalloc_internal(rgd, 0,
-							     GFS_BLKST_FREEMETA,
-							     GFS_BLKST_USEDMETA, 1);
-				log_debug("Got block %"PRIu64"\n", block);
-
-				if(block == BFITNOENT) {
-					fs_rgrp_relse(rgd);
-					continue;
-				}
-				block += rgd->rd_ri.ri_data1;
-
-				inum.no_addr = inum.no_formal_ino = block;
-
-				/* FIXME: type isn't right */
-				block_set(sbp->bl, block, type);
-
-				/* write out the rgrp */
-				gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-				write_buf(disk_fd, rgd->rd_bh[0], 0);
-				fs_rgrp_relse(rgd);
-				break;
-			}
-			fs_rgrp_relse(rgd);
-		}
-	}
-
-	if(!inum.no_addr){
-		if(allocate){
-			log_err("No space available for new file or directory.\n");
-			return -1;
-		} else {
-			allocate = 1;
-			goto retry;
-		}
-	}
-
-	/* We need to setup the inode without attaching it to a directory */
-	if (make_dinode(disk_fd, NULL, sbp, &inum, type, mode, &cred)) {
-		return -1;
-	}
-	if (fs_get_istruct(disk_fd, sbp, &inum, 1, ip)) {
-		return -1;
-	}
-	return 0;
-}
diff --git a/gfs/libgfs/libgfs.h b/gfs/libgfs/libgfs.h
deleted file mode 100644
index d4e6237..0000000
--- a/gfs/libgfs/libgfs.h
+++ /dev/null
@@ -1,398 +0,0 @@
-/* These make the library more palatable to userland */
-
-#ifndef LIBGFS_H
-#define LIBGFS_H
-
-#include <stdint.h>
-#include "osi_user.h"
-#include "incore.h"
-
-struct qstr {
-        unsigned int hash;
-        unsigned int len;
-        const unsigned char *name;
-};
-#define up(x) ;
-#define up_write(x) ;
-#define down(x) ;
-#define down_write(x) ;
-#define printk printf
-
-/* ------------------------------------------------------------------------- */
-/* formerly bitmap.h:                                                        */
-/* ------------------------------------------------------------------------- */
-struct bmap {
-	uint64_t size;
-	uint64_t mapsize;
-	int chunksize;
-	int chunks_per_byte;
-	char *map;
-};
-
-int bitmap_create(struct bmap *bmap, uint64_t size, uint8_t bitsize);
-int bitmap_set(struct bmap *bmap, uint64_t offset, uint8_t val);
-int bitmap_get(struct bmap *bmap, uint64_t bit, uint8_t *val);
-int bitmap_clear(struct bmap *bmap, uint64_t offset);
-void bitmap_destroy(struct bmap *bmap);
-uint64_t bitmap_size(struct bmap *bmap);
-
-/* ------------------------------------------------------------------------- */
-/* formerly block_list.h:                                                    */
-/* ------------------------------------------------------------------------- */
-#define BMAP_COUNT 13
-
-enum block_list_type {
-	gbmap = 0,  /* Grouped bitmap */
-	dbmap,	    /* Ondisk bitmap - like grouped bitmap, but mmaps
-		     * the bitmaps onto file(s) ondisk - not implemented */
-};
-
-/* Must be kept in sync with mark_to_bitmap array in block_list.c */
-enum mark_block {
-	block_free = 0,
-	block_used,
-	indir_blk,
-	inode_dir,
-	inode_file,
-	inode_lnk,
-	inode_blk,
-	inode_chr,
-	inode_fifo,
-	inode_sock,
-	leaf_blk,
-	journal_blk,
-	meta_other,
-	meta_free,
-	meta_eattr,
-	meta_inval = 15,
-	bad_block,	/* Contains at least one bad block */
-	dup_block,	/* Contains at least one duplicate block */
-	eattr_block,	/* Contains an eattr */
-};
-
-struct block_query {
-	uint8_t block_type;
-	uint8_t bad_block;
-	uint8_t dup_block;
-	uint8_t eattr_block;
-};
-
-struct gbmap {
-	struct bmap group_map;
-	struct bmap bad_map;
-	struct bmap dup_map;
-	struct bmap eattr_map;
-};
-
-struct dbmap {
-	struct bmap group_map;
-	char *group_file;
-	struct bmap bad_map;
-	char *bad_file;
-	struct bmap dup_map;
-	char *dup_file;
-	struct bmap eattr_map;
-	char *eattr_file;
-};
-
-union block_lists {
-	struct gbmap gbmap;
-	struct dbmap dbmap;
-};
-
-
-/* bitmap implementation */
-struct block_list {
-	enum block_list_type type;
-	/* Union of bitmap, rle */
-	union block_lists list;
-};
-
-
-struct block_list *block_list_create(uint64_t size, enum block_list_type type);
-int block_mark(struct block_list *il, uint64_t block, enum mark_block mark);
-int block_set(struct block_list *il, uint64_t block, enum mark_block mark);
-int block_clear(struct block_list *il, uint64_t block, enum mark_block m);
-int block_check(struct block_list *il, uint64_t block,
-		struct block_query *val);
-int block_check_for_mark(struct block_list *il, uint64_t block,
-			 enum mark_block mark);
-void *block_list_destroy(struct block_list *il);
-int find_next_block_type(struct block_list *il, enum mark_block m, uint64_t *b);
-
-/* ------------------------------------------------------------------------- */
-/* formerly log.h:                                                           */
-/* ------------------------------------------------------------------------- */
-#define MSG_DEBUG	7
-#define MSG_INFO	6
-#define MSG_NOTICE	5
-#define MSG_WARN	4
-#define MSG_ERROR	3
-#define MSG_CRITICAL	2
-#define MSG_NULL	1
-
-struct options;
-
-#define print_log(iif, priority, format...)	\
-do { \
-	print_log_level(iif, priority, __FILE__, __LINE__, ## format);	\
-} while(0)
-
-#define log_debug(format...) \
-do { \
-	print_log(0, MSG_DEBUG, format);		\
-} while(0)
-
-#define log_info(format...) \
-do { \
-	print_log(0, MSG_INFO, format);		\
-} while(0)
-
-#define log_notice(format...) \
-do { \
-	print_log(0, MSG_NOTICE, format);	\
-} while(0)
-
-#define log_warn(format...) \
-do { \
-	print_log(0, MSG_WARN, format);		\
-} while(0)
-
-#define log_err(format...) \
-do { \
-	print_log(0, MSG_ERROR, format);		\
-} while(0)
-
-#define log_crit(format...) \
-do { \
-	print_log(0, MSG_CRITICAL, format);	\
-} while(0)
-
-#define stack log_debug("<backtrace> - %s()\n", __func__)
-
-#define log_at_debug(format...)		\
-do { \
-	print_log(1, MSG_DEBUG, format);	\
-} while(0)
-
-#define log_at_info(format...) \
-do { \
-	print_log(1, MSG_INFO, format);		\
-} while(0)
-
-#define log_at_notice(format...) \
-do { \
-	print_log(1, MSG_NOTICE, format);	\
-} while(0)
-
-#define log_at_warn(format...) \
-do { \
-	print_log(1, MSG_WARN, format);		\
-} while(0)
-
-#define log_at_err(format...) \
-do { \
-	print_log(1, MSG_ERROR, format);		\
-} while(0)
-
-#define log_at_crit(format...) \
-do { \
-	print_log(1, MSG_CRITICAL, format);	\
-} while(0)
-
-void increase_verbosity(void);
-void decrease_verbosity(void);
-void print_log_level(int iif, int priority, const char *file, int line, const char *format, ...);
-int query(struct options *opts, const char *format, ...);
-
-/* ------------------------------------------------------------------------- */
-/* formerly bio.h:                                                           */
-/* ------------------------------------------------------------------------- */
-/* buf_write flags */
-#define BW_WAIT 1
-
-
-#define BH_DATA(bh) ((char *)(bh)->b_data)
-#define BH_BLKNO(bh) ((uint64)(bh)->b_blocknr)
-#define BH_SIZE(bh) ((uint32)(bh)->b_size)
-#define BH_STATE(bh) ((uint32)(bh)->b_state)
-
-int get_buf(uint32_t sb_bsize, uint64 blkno, osi_buf_t **bhp);
-void relse_buf(osi_buf_t *bh);
-int read_buf(int disk_fd, osi_buf_t *bh, int flags);
-int write_buf(int disk_fd, osi_buf_t *bh, int flags);
-int get_and_read_buf(int disk_fd, uint32_t sb_bsize, uint64 blkno,
-					 osi_buf_t **bhp, int flags);
-
-/* ------------------------------------------------------------------------- */
-/* formerly fs_bits.h:                                                       */
-/* ------------------------------------------------------------------------- */
-#define BFITNOENT (0xFFFFFFFF)
-
-struct fs_bitmap
-{
-	uint32   bi_offset;	/* The offset in the buffer of the first byte */
-	uint32   bi_start;      /* The position of the first byte in this block */
-	uint32   bi_len;        /* The number of bytes in this block */
-};
-typedef struct fs_bitmap fs_bitmap_t;
-
-/* functions with blk #'s that are buffer relative */
-uint32_t fs_bitcount(unsigned char *buffer, unsigned int buflen,
-		     unsigned char state);
-uint32_t fs_bitfit(unsigned char *buffer, unsigned int buflen,
-		   uint32_t goal, unsigned char old_state);
-
-/* functions with blk #'s that are rgrp relative */
-uint32_t fs_blkalloc_internal(struct gfs_rgrpd *rgd, uint32_t goal,
-			      unsigned char old_state,
-			      unsigned char new_state, int do_it);
-
-/* functions with blk #'s that are file system relative */
-int fs_get_bitmap(int disk_fd, struct gfs_sbd *sdp, uint64_t blkno, struct gfs_rgrpd *rgd);
-int fs_set_bitmap(int disk_fd, struct gfs_sbd *sdp, uint64_t blkno, int state);
-
-/* ------------------------------------------------------------------------- */
-/* formerly fs_bmap.h                                                        */
-/* ------------------------------------------------------------------------- */
-int fs_unstuff_dinode(int disk_fd, struct gfs_inode *ip);
-int fs_block_map(int disk_fd, struct gfs_inode *ip, uint64 lblock, int *new,
-		 uint64 *dblock, uint32 *extlen);
-
-/* ------------------------------------------------------------------------- */
-/* formerly iddev.h                                                          */
-/* ------------------------------------------------------------------------- */
-int device_size(int fd, uint64_t *bytes);
-
-/* ------------------------------------------------------------------------- */
-/* formerly util.h:                                                          */
-/* ------------------------------------------------------------------------- */
-#define do_lseek(fd, off) \
-  ((lseek((fd), (off), SEEK_SET) == (off)) ? 0 : -1)
-
-#define do_read(fd, buff, len) \
-  ((read((fd), (buff), (len)) == (len)) ? 0 : -1)
-
-#define do_write(fd, buff, len) \
-  ((write((fd), (buff), (len)) == (len)) ? 0 : -1)
-
-int compute_height(struct gfs_sbd *sdp, uint64 sz);
-int check_range(struct gfs_sbd *sdp, uint64 blkno);
-int set_meta(osi_buf_t *bh, int type, int format);
-int check_type(osi_buf_t *bh, int type);
-int check_meta(osi_buf_t *bh, int type);
-int next_rg_meta(struct gfs_rgrpd *rgd, uint64 *block, int first);
-int next_rg_meta_free(struct gfs_rgrpd *rgd, uint64 *block, int first, int *free);
-int next_rg_metatype(int disk_fd, struct gfs_rgrpd *rgd, uint64 *block, uint32 type, int first);
-struct di_info *search_list(osi_list_t *list, uint64 addr);
-
-/* ------------------------------------------------------------------------- */
-/* formerly rgrp.h:                                                          */
-/* ------------------------------------------------------------------------- */
-struct gfs_sbd;
-struct gfs_rgrpd;
-struct gfs_inode;
-
-int fs_compute_bitstructs(struct gfs_rgrpd *rgd);
-struct gfs_rgrpd *fs_blk2rgrpd(struct gfs_sbd *sdp, uint64_t blk);
-
-int fs_rgrp_read(int disk_fd, struct gfs_rgrpd *rgd, int repair_if_corrupted);
-void fs_rgrp_relse(struct gfs_rgrpd *rgd);
-int fs_rgrp_verify(struct gfs_rgrpd *rgd);
-int fs_rgrp_recount(int disk_fd, struct gfs_rgrpd *rgd);
-
-int clump_alloc(int disk_fd, struct gfs_rgrpd *rgd, uint32_t goal);
-int fs_blkalloc(int disk_fd, struct gfs_inode *ip, uint64_t *block);
-int fs_metaalloc(int disk_fd, struct gfs_inode *ip, uint64_t *block);
-
-/* ------------------------------------------------------------------------- */
-/* formerly file.h:                                                          */
-/* ------------------------------------------------------------------------- */
-int readi(int disk_fd, struct gfs_inode *ip, void *buf, uint64_t offset,
-		  unsigned int size);
-int writei(int disk_fd, struct gfs_inode *ip, void *buf, uint64_t offset,
-		   unsigned int size);
-
-/* ------------------------------------------------------------------------- */
-/* formerly inode.h:                                                         */
-/* ------------------------------------------------------------------------- */
-int copyin_inode(struct gfs_sbd *sbp, osi_buf_t *bh, struct gfs_inode **ip);
-int load_inode(int disk_fd, struct gfs_sbd *sbp, uint64_t block,
-			   struct gfs_inode **ip);
-void free_inode(struct gfs_inode **inode);
-int check_inode(struct gfs_inode *ip);
-int create_inode(int disk_fd, struct gfs_sbd *sbp, unsigned int type,
-				 struct gfs_inode **ip);
-int make_dinode(int disk_fd, struct gfs_inode *dip,
-					   struct gfs_sbd *sdp, struct gfs_inum *inum,
-				unsigned int type, unsigned int mode, osi_cred_t *cred);
-
-/* ------------------------------------------------------------------------- */
-/* formerly fs_inode.h:                                                      */
-/* ------------------------------------------------------------------------- */
-int fs_copyin_dinode(int disk_fd, uint32_t sb_bsize, struct gfs_inode *ip, osi_buf_t *bh);
-int fs_copyout_dinode(int disk_fd, uint32_t sb_bsize, struct gfs_inode *ip);
-int fs_mkdir(int disk_fd, struct gfs_inode *dip, char *new_dir, int mode, struct gfs_inode **nip);
-
-static __inline__ int fs_is_stuffed(struct gfs_inode *ip)
-{
-	return !ip->i_di.di_height;
-}
-
-static __inline__ int fs_is_jdata(struct gfs_inode *ip)
-{
-	return ip->i_di.di_flags & GFS_DIF_JDATA;
-}
-
-/* ------------------------------------------------------------------------- */
-/* formerly fs_dir.h:                                                        */
-/* ------------------------------------------------------------------------- */
-#define ID_FILENAME 0
-#define ID_INUM     1
-typedef struct identifier_s {
-	int type;
-
-	osi_filename_t *filename;
-	struct gfs_inum *inum;
-} identifier_t;
-
-int dirent_del(int disk_fd, struct gfs_inode *dip, osi_buf_t *bh,
-	       struct gfs_dirent *prev, struct gfs_dirent *cur);
-int gfs_inode_is_stuffed(struct gfs_inode *ip);
-int dirent_first(osi_buf_t *bh, struct gfs_dirent **dent);
-int dirent_next(osi_buf_t *bh, struct gfs_dirent **dent);
-int get_leaf_nr(int file_fd, struct gfs_inode *dip, uint32 index,
-				uint64 *leaf_out);
-int fs_filecmp(osi_filename_t *file1, char *file2, int len_of_file2);
-int fs_dirent_del(int disk_fd, struct gfs_inode *dip, osi_buf_t *bh, osi_filename_t *filename);
-int fs_dir_add(int disk_fd, struct gfs_inode *dip, osi_filename_t *filename,
-	       struct gfs_inum *inum, unsigned int type);
-int fs_dirent_alloc(int disk_fd, struct gfs_inode *dip, osi_buf_t *bh,
-		    int name_len, struct gfs_dirent **dent_out);
-
-int fs_dir_search(int disk_fd, struct gfs_inode *dip, identifier_t *id, unsigned int *type);
-int get_first_leaf(int disk_fd, struct gfs_inode *dip, uint32 index,
-				   osi_buf_t **bh_out);
-int get_next_leaf(int disk_fd, struct gfs_inode *dip,osi_buf_t *bh_in,osi_buf_t **bh_out);
-int get_leaf(int disk_fd, struct gfs_inode *dip, uint64 leaf_no,
-			 osi_buf_t **bhp);
-
-/* ------------------------------------------------------------------------- */
-/* formerly super.h:                                                         */
-/* ------------------------------------------------------------------------- */
-int hexdump(uint64 startaddr, const unsigned char *lpBuffer, int len);
-int read_sb(int disk_fd, struct gfs_sbd *sdp);
-int ji_update(int disk_fd, struct gfs_sbd *sdp);
-int ri_update(int disk_fd, struct gfs_sbd *sdp);
-void ri_cleanup(osi_list_t *rglist);
-int write_sb(int disk_fd, struct gfs_sbd *sdp);
-int set_block_ranges(int disk_fd, struct gfs_sbd *sdp);
-int read_super_block(int disk_fd, struct gfs_sbd *sdp);
-int compute_constants(struct gfs_sbd *sdp);
-uint32 rgrplength2bitblocks(struct gfs_sbd *sdp, uint32 length);
-
-/* ------------------------------------------------------------------------- */
-/* formerly rgrp.h:                                                          */
-/* ------------------------------------------------------------------------- */
-
-#endif
diff --git a/gfs/libgfs/log.c b/gfs/libgfs/log.c
deleted file mode 100644
index c80e85e..0000000
--- a/gfs/libgfs/log.c
+++ /dev/null
@@ -1,139 +0,0 @@
-#include <stdio.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <libintl.h>
-
-#include <sys/select.h>
-#include <unistd.h>
-
-#include "incore.h"
-#include "libgfs.h"
-
-#define _(String) gettext(String)
-
-struct log_state {
-	int print_level;
-};
-static struct log_state _state = {MSG_NOTICE};
-
-void increase_verbosity(void)
-{
-	_state.print_level++;
-}
-
-void decrease_verbosity(void)
-{
-	_state.print_level--;
-}
-
-static void __attribute__((format(printf, 4, 0)))
-print_msg(int priority, const char *file, int line, const char *format, va_list args) {
-
-	switch (priority) {
-
-	case MSG_DEBUG:
-		printf("(%s:%d)\t", file, line);
-		vprintf(format, args);
-		break;
-	case MSG_INFO:
-	case MSG_NOTICE:
-	case MSG_WARN:
-		vprintf(format, args);
-		break;
-	case MSG_ERROR:
-	case MSG_CRITICAL:
-	default:
-		vfprintf(stderr, format, args);
-		break;
-	}
-	return;
-}
-
-void __attribute__((format(printf, 5, 6)))
-print_log_level(int iif, int priority, const char *file, int line, const char *format, ...)
-{
-
-	va_list args;
-	const char *transform;
-
-        va_start(args, format);
-
-	transform = _(format);
-
-	if((_state.print_level == priority) ||
-	   (!iif && (_state.print_level >= priority)))
-		print_msg(priority, file, line, transform, args);
-
-	va_end(args);
-}
-
-int __attribute__((format(printf, 2, 3)))
-query(struct options *opts, const char *format, ...)
-{
-
-	va_list args;
-	const char *transform;
-	char response;
-	fd_set rfds;
-	struct timeval tv;
-	int err = 0;
-	int ret = 0;
-
-	va_start(args, format);
-
-	transform = _(format);
-
-	if(opts->yes)
-		return 1;
-	if(opts->no)
-		return 0;
-
-	/* Watch stdin (fd 0) to see when it has input. */
-	FD_ZERO(&rfds);
-	FD_SET(STDIN_FILENO, &rfds);
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-	/* Make sure there isn't extraneous input before asking the
-	 * user the question */
-	while((err = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv))) {
-		if(err < 0) {
-			log_debug("Error in select() on stdin\n");
-			break;
-		}
-		err = read(STDIN_FILENO, &response, sizeof(char));
-
-	}
- query:
-	vprintf(transform, args);
-
-	/* Make sure query is printed out */
-	fflush(NULL);
-
- rescan:
-	err = read(STDIN_FILENO, &response, sizeof(char));
-
-	if(tolower(response) == 'y') {
-		ret = 1;
-	} else if (tolower(response) == 'n') {
-		ret = 0;
-	} else if ((response == ' ') || (response == '\t')) {
-		goto rescan;
-	} else {
-		while(response != '\n')
-			err = read(STDIN_FILENO, &response, sizeof(char));
-		printf("Bad response, please type 'y' or 'n'.\n");
-		goto query;
-	}
-
-	/* Clip the input */
-	while((err = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv))) {
-		if(err < 0) {
-			log_debug("Error in select() on stdin\n");
-			break;
-		}
-		err = read(STDIN_FILENO, &response, sizeof(char));
-	}
-
-	return ret;
-}
diff --git a/gfs/libgfs/ondisk.c b/gfs/libgfs/ondisk.c
deleted file mode 100644
index 15ce0b5..0000000
--- a/gfs/libgfs/ondisk.c
+++ /dev/null
@@ -1,1282 +0,0 @@
-#ifndef HELPER_PROGRAM
-
-#include "libgfs.h"
-
-#define pv(struct, member, fmt) printk("  "#member" = "fmt"\n", struct->member);
-
-#else
-
-#include <stdio.h>
-#include <string.h>
-
-#include "global.h"
-#include "linux_endian.h"
-#include "gfs_ondisk.h" /* pull in kernel structures / routines */
-
-#define printk printf
-#define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
-
-#endif				/*  !HELPER_PROGRAM  */
-
-#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
-#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
-#define CPIN_16(s1, s2, member) {(s1->member) = gfs16_to_cpu((s2->member));}
-#define CPOUT_16(s1, s2, member) {(s2->member) = cpu_to_gfs16((s1->member));}
-#define CPIN_32(s1, s2, member) {(s1->member) = gfs32_to_cpu((s2->member));}
-#define CPOUT_32(s1, s2, member) {(s2->member) = cpu_to_gfs32((s1->member));}
-#define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));}
-#define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));}
-
-#define pa(struct, member, count) print_array(#member, struct->member, count);
-
-/**
- * print_array - Print out an array of bytes
- * @title: what to print before the array
- * @buf: the array
- * @count: the number of bytes
- */
-
-static void
-print_array(const char *title, char *buf, int count)
-{
-	int x;
-
-	printk("  %s =\n", title);
-	for (x = 0; x < count; x++) {
-		printk("%.2X ", (unsigned char) buf[x]);
-		if (x % 16 == 15)
-			printk("\n");
-	}
-	if (x % 16)
-		printk("\n");
-
-}
-
-/**
- * gfs_inum_in - Read in an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_in(struct gfs_inum *no, char *buf)
-{
-	struct gfs_inum *str = (struct gfs_inum *) buf;
-
-	CPIN_64(no, str, no_formal_ino);
-	CPIN_64(no, str, no_addr);
-
-}
-
-/**
- * gfs_inum_out - Write out an inode number
- * @no: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_inum_out(struct gfs_inum *no, char *buf)
-{
-	struct gfs_inum *str = (struct gfs_inum *) buf;
-
-	CPOUT_64(no, str, no_formal_ino);
-	CPOUT_64(no, str, no_addr);
-
-}
-
-/**
- * gfs_inum_print - Print out a inode number
- * @no: the cpu-order buffer
- *
- */
-
-void
-gfs_inum_print(struct gfs_inum *no)
-{
-
-	pv(no, no_formal_ino, "%" PRIu64);
-	pv(no, no_addr, "%" PRIu64);
-
-}
-
-/**
- * gfs_meta_header_in - Read in a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_meta_header_in(struct gfs_meta_header *mh, char *buf)
-{
-	struct gfs_meta_header *str = (struct gfs_meta_header *) buf;
-
-	CPIN_32(mh, str, mh_magic);
-	CPIN_32(mh, str, mh_type);
-	CPIN_64(mh, str, mh_generation);
-	CPIN_32(mh, str, mh_format);
-	CPIN_32(mh, str, mh_incarn);
-
-}
-
-/**
- * gfs_meta_header_in - Write out a metadata header
- * @mh: the cpu-order structure
- * @buf: the disk-order buffer
- *
- * Don't ever change the generation number in this routine.
- * It's done manually in increment_generation().
- */
-
-void
-gfs_meta_header_out(struct gfs_meta_header *mh, char *buf)
-{
-	struct gfs_meta_header *str = (struct gfs_meta_header *) buf;
-
-	CPOUT_32(mh, str, mh_magic);
-	CPOUT_32(mh, str, mh_type);
-	/*CPOUT_64(mh, str, mh_generation); */
-	CPOUT_32(mh, str, mh_format);
-	CPOUT_32(mh, str, mh_incarn);
-
-}
-
-/**
- * gfs_meta_header_print - Print out a metadata header
- * @mh: the cpu-order buffer
- *
- */
-
-void
-gfs_meta_header_print(struct gfs_meta_header *mh)
-{
-
-	pv(mh, mh_magic, "0x%.8X");
-	pv(mh, mh_type, "%u");
-	pv(mh, mh_generation, "%" PRIu64);
-	pv(mh, mh_format, "%u");
-	pv(mh, mh_incarn, "%u");
-
-}
-
-/**
- * gfs_sb_in - Read in a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_in(struct gfs_sb *sb, char *buf)
-{
-	struct gfs_sb *str = (struct gfs_sb *) buf;
-
-	gfs_meta_header_in(&sb->sb_header, buf);
-
-	CPIN_32(sb, str, sb_fs_format);
-	CPIN_32(sb, str, sb_multihost_format);
-	CPIN_32(sb, str, sb_flags);
-
-	CPIN_32(sb, str, sb_bsize);
-	CPIN_32(sb, str, sb_bsize_shift);
-	CPIN_32(sb, str, sb_seg_size);
-
-	gfs_inum_in(&sb->sb_jindex_di, (char *) &str->sb_jindex_di);
-	gfs_inum_in(&sb->sb_rindex_di, (char *) &str->sb_rindex_di);
-	gfs_inum_in(&sb->sb_root_di, (char *) &str->sb_root_di);
-
-	CPIN_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPIN_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_in(&sb->sb_quota_di, (char *) &str->sb_quota_di);
-	gfs_inum_in(&sb->sb_license_di, (char *) &str->sb_license_di);
-
-	CPIN_08(sb, str, sb_reserved, 96);
-
-}
-
-/**
- * gfs_sb_out - Write out a superblock
- * @sb: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_sb_out(struct gfs_sb *sb, char *buf)
-{
-	struct gfs_sb *str = (struct gfs_sb *) buf;
-
-	gfs_meta_header_out(&sb->sb_header, buf);
-
-	CPOUT_32(sb, str, sb_fs_format);
-	CPOUT_32(sb, str, sb_multihost_format);
-	CPOUT_32(sb, str, sb_flags);
-
-	CPOUT_32(sb, str, sb_bsize);
-	CPOUT_32(sb, str, sb_bsize_shift);
-	CPOUT_32(sb, str, sb_seg_size);
-
-	gfs_inum_out(&sb->sb_jindex_di, (char *) &str->sb_jindex_di);
-	gfs_inum_out(&sb->sb_rindex_di, (char *) &str->sb_rindex_di);
-	gfs_inum_out(&sb->sb_root_di, (char *) &str->sb_root_di);
-
-	CPOUT_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
-	CPOUT_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
-
-	gfs_inum_out(&sb->sb_quota_di, (char *) &str->sb_quota_di);
-	gfs_inum_out(&sb->sb_license_di, (char *) &str->sb_license_di);
-
-	CPOUT_08(sb, str, sb_reserved, 96);
-
-}
-
-/**
- * gfs_sb_print - Print out a superblock
- * @sb: the cpu-order buffer
- *
- */
-
-void
-gfs_sb_print(struct gfs_sb *sb)
-{
-	gfs_meta_header_print(&sb->sb_header);
-
-	pv(sb, sb_fs_format, "%u");
-	pv(sb, sb_multihost_format, "%u");
-	pv(sb, sb_flags, "%u");
-
-	pv(sb, sb_bsize, "%u");
-	pv(sb, sb_bsize_shift, "%u");
-	pv(sb, sb_seg_size, "%u");
-
-	gfs_inum_print(&sb->sb_jindex_di);
-	gfs_inum_print(&sb->sb_rindex_di);
-	gfs_inum_print(&sb->sb_root_di);
-
-	pv(sb, sb_lockproto, "%s");
-	pv(sb, sb_locktable, "%s");
-
-	gfs_inum_print(&sb->sb_quota_di);
-	gfs_inum_print(&sb->sb_license_di);
-
-	pa(sb, sb_reserved, 96);
-
-}
-
-/**
- * gfs_jindex_in - Read in a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_in(struct gfs_jindex *jindex, char *buf)
-{
-	struct gfs_jindex *str = (struct gfs_jindex *) buf;
-
-	CPIN_64(jindex, str, ji_addr);
-	CPIN_32(jindex, str, ji_nsegment);
-	CPIN_32(jindex, str, ji_pad);
-
-	CPIN_08(jindex, str, ji_reserved, 64);
-
-}
-
-/**
- * gfs_jindex_out - Write out a journal index structure
- * @jindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_jindex_out(struct gfs_jindex *jindex, char *buf)
-{
-	struct gfs_jindex *str = (struct gfs_jindex *) buf;
-
-	CPOUT_64(jindex, str, ji_addr);
-	CPOUT_32(jindex, str, ji_nsegment);
-	CPOUT_32(jindex, str, ji_pad);
-
-	CPOUT_08(jindex, str, ji_reserved, 64);
-
-}
-
-/**
- * gfs_jindex_print - Print out a journal index structure
- * @ji: the cpu-order buffer
- *
- */
-
-void
-gfs_jindex_print(struct gfs_jindex *ji)
-{
-
-	pv(ji, ji_addr, "%" PRIu64);
-	pv(ji, ji_nsegment, "%u");
-	pv(ji, ji_pad, "%u");
-
-	pa(ji, ji_reserved, 64);
-
-}
-
-/**
- * gfs_rindex_in - Read in a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_in(struct gfs_rindex *grindex, char *buf)
-{
-	struct gfs_rindex *str = (struct gfs_rindex *) buf;
-
-	CPIN_64(grindex, str, ri_addr);
-	CPIN_32(grindex, str, ri_length);
-	CPIN_32(grindex, str, ri_pad);
-
-	CPIN_64(grindex, str, ri_data1);
-	CPIN_32(grindex, str, ri_data);
-
-	CPIN_32(grindex, str, ri_bitbytes);
-
-	CPIN_08(grindex, str, ri_reserved, 64);
-
-}
-
-/**
- * gfs_rindex_out - Write out a resource index structure
- * @rindex: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rindex_out(struct gfs_rindex *grindex, char *buf)
-{
-	struct gfs_rindex *str = (struct gfs_rindex *) buf;
-
-	CPOUT_64(grindex, str, ri_addr);
-	CPOUT_32(grindex, str, ri_length);
-	CPOUT_32(grindex, str, ri_pad);
-
-	CPOUT_64(grindex, str, ri_data1);
-	CPOUT_32(grindex, str, ri_data);
-
-	CPOUT_32(grindex, str, ri_bitbytes);
-
-	CPOUT_08(grindex, str, ri_reserved, 64);
-
-}
-
-/**
- * gfs_rindex_print - Print out a resource index structure
- * @ri: the cpu-order buffer
- *
- */
-
-void
-gfs_rindex_print(struct gfs_rindex *ri)
-{
-
-	pv(ri, ri_addr, "%" PRIu64);
-	pv(ri, ri_length, "%u");
-	pv(ri, ri_pad, "%u");
-
-	pv(ri, ri_data1, "%" PRIu64);
-	pv(ri, ri_data, "%u");
-
-	pv(ri, ri_bitbytes, "%u");
-
-	pa(ri, ri_reserved, 64);
-
-}
-
-/**
- * gfs_rgrp_in - Read in a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf)
-{
-	struct gfs_rgrp *str = (struct gfs_rgrp *) buf;
-
-	gfs_meta_header_in(&rgrp->rg_header, buf);
-
-	CPIN_32(rgrp, str, rg_flags);
-
-	CPIN_32(rgrp, str, rg_free);
-
-	CPIN_32(rgrp, str, rg_useddi);
-	CPIN_32(rgrp, str, rg_freedi);
-	gfs_inum_in(&rgrp->rg_freedi_list, (char *) &str->rg_freedi_list);
-
-	CPIN_32(rgrp, str, rg_usedmeta);
-	CPIN_32(rgrp, str, rg_freemeta);
-
-	CPIN_08(rgrp, str, rg_reserved, 64);
-
-}
-
-/**
- * gfs_rgrp_out - Write out a resource group header
- * @rgrp: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf)
-{
-	struct gfs_rgrp *str = (struct gfs_rgrp *) buf;
-
-	gfs_meta_header_out(&rgrp->rg_header, buf);
-
-	CPOUT_32(rgrp, str, rg_flags);
-
-	CPOUT_32(rgrp, str, rg_free);
-
-	CPOUT_32(rgrp, str, rg_useddi);
-	CPOUT_32(rgrp, str, rg_freedi);
-	gfs_inum_out(&rgrp->rg_freedi_list, (char *) &str->rg_freedi_list);
-
-	CPOUT_32(rgrp, str, rg_usedmeta);
-	CPOUT_32(rgrp, str, rg_freemeta);
-
-	CPOUT_08(rgrp, str, rg_reserved, 64);
-
-}
-
-/**
- * gfs_rgrp_print - Print out a resource group header
- * @rg: the cpu-order buffer
- */
-
-void
-gfs_rgrp_print(struct gfs_rgrp *rg)
-{
-
-	gfs_meta_header_print(&rg->rg_header);
-
-	pv(rg, rg_flags, "%u");
-
-	pv(rg, rg_free, "%u");
-
-	pv(rg, rg_useddi, "%u");
-	pv(rg, rg_freedi, "%u");
-	gfs_inum_print(&rg->rg_freedi_list);
-
-	pv(rg, rg_usedmeta, "%u");
-	pv(rg, rg_freemeta, "%u");
-
-	pa(rg, rg_reserved, 64);
-
-}
-
-/**
- * gfs_quota_in - Read in a quota structures
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_in(struct gfs_quota *quota, char *buf)
-{
-	struct gfs_quota *str = (struct gfs_quota *) buf;
-
-	CPIN_64(quota, str, qu_limit);
-	CPIN_64(quota, str, qu_warn);
-	CPIN_64(quota, str, qu_value);
-
-	CPIN_08(quota, str, qu_reserved, 64);
-
-}
-
-/**
- * gfs_quota_out - Write out a quota structure
- * @quota: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_out(struct gfs_quota *quota, char *buf)
-{
-	struct gfs_quota *str = (struct gfs_quota *) buf;
-
-	CPOUT_64(quota, str, qu_limit);
-	CPOUT_64(quota, str, qu_warn);
-	CPOUT_64(quota, str, qu_value);
-
-	CPOUT_08(quota, str, qu_reserved, 64);
-
-}
-
-/**
- * gfs_quota_print - Print out a quota structure
- * @quota: the cpu-order buffer
- */
-
-void
-gfs_quota_print(struct gfs_quota *quota)
-{
-
-	pv(quota, qu_limit, "%" PRIu64);
-	pv(quota, qu_warn, "%" PRIu64);
-	pv(quota, qu_value, "%" PRId64);
-
-	pa(quota, qu_reserved, 64);
-
-}
-
-/**
- * gfs_dinode_in - Read in a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_in(struct gfs_dinode *dinode, char *buf)
-{
-	struct gfs_dinode *str = (struct gfs_dinode *) buf;
-
-	gfs_meta_header_in(&dinode->di_header, buf);
-
-	gfs_inum_in(&dinode->di_num, (char *) &str->di_num);
-
-	CPIN_32(dinode, str, di_mode);
-	CPIN_32(dinode, str, di_uid);
-	CPIN_32(dinode, str, di_gid);
-	CPIN_32(dinode, str, di_nlink);
-	CPIN_64(dinode, str, di_size);
-	CPIN_64(dinode, str, di_blocks);
-	CPIN_64(dinode, str, di_atime);
-	CPIN_64(dinode, str, di_mtime);
-	CPIN_64(dinode, str, di_ctime);
-	CPIN_32(dinode, str, di_major);
-	CPIN_32(dinode, str, di_minor);
-
-	CPIN_64(dinode, str, di_rgrp);
-	CPIN_64(dinode, str, di_goal_rgrp);
-	CPIN_32(dinode, str, di_goal_dblk);
-	CPIN_32(dinode, str, di_goal_mblk);
-	CPIN_32(dinode, str, di_flags);
-	CPIN_32(dinode, str, di_payload_format);
-	CPIN_16(dinode, str, di_type);
-	CPIN_16(dinode, str, di_height);
-	CPIN_32(dinode, str, di_incarn);
-	CPIN_16(dinode, str, di_pad);
-
-	CPIN_16(dinode, str, di_depth);
-	CPIN_32(dinode, str, di_entries);
-
-	gfs_inum_in(&dinode->di_next_unused, (char *) &str->di_next_unused);
-
-	CPIN_64(dinode, str, di_eattr);
-
-	CPIN_08(dinode, str, di_reserved, 56);
-
-}
-
-/**
- * gfs_dinode_out - Write out a dinode
- * @dinode: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dinode_out(struct gfs_dinode *dinode, char *buf)
-{
-	struct gfs_dinode *str = (struct gfs_dinode *) buf;
-
-	gfs_meta_header_out(&dinode->di_header, buf);
-
-	gfs_inum_out(&dinode->di_num, (char *) &str->di_num);
-
-	CPOUT_32(dinode, str, di_mode);
-	CPOUT_32(dinode, str, di_uid);
-	CPOUT_32(dinode, str, di_gid);
-	CPOUT_32(dinode, str, di_nlink);
-	CPOUT_64(dinode, str, di_size);
-	CPOUT_64(dinode, str, di_blocks);
-	CPOUT_64(dinode, str, di_atime);
-	CPOUT_64(dinode, str, di_mtime);
-	CPOUT_64(dinode, str, di_ctime);
-	CPOUT_32(dinode, str, di_major);
-	CPOUT_32(dinode, str, di_minor);
-
-	CPOUT_64(dinode, str, di_rgrp);
-	CPOUT_64(dinode, str, di_goal_rgrp);
-	CPOUT_32(dinode, str, di_goal_dblk);
-	CPOUT_32(dinode, str, di_goal_mblk);
-	CPOUT_32(dinode, str, di_flags);
-	CPOUT_32(dinode, str, di_payload_format);
-	CPOUT_16(dinode, str, di_type);
-	CPOUT_16(dinode, str, di_height);
-	CPOUT_32(dinode, str, di_incarn);
-	CPOUT_16(dinode, str, di_pad);
-
-	CPOUT_16(dinode, str, di_depth);
-	CPOUT_32(dinode, str, di_entries);
-
-	gfs_inum_out(&dinode->di_next_unused, (char *) &str->di_next_unused);
-
-	CPOUT_64(dinode, str, di_eattr);
-
-	CPOUT_08(dinode, str, di_reserved, 56);
-
-}
-
-/**
- * gfs_dinode_print - Print out a dinode
- * @di: the cpu-order buffer
- */
-
-void
-gfs_dinode_print(struct gfs_dinode *di)
-{
-
-	gfs_meta_header_print(&di->di_header);
-
-	gfs_inum_print(&di->di_num);
-
-	pv(di, di_mode, "0%o");
-	pv(di, di_uid, "%u");
-	pv(di, di_gid, "%u");
-	pv(di, di_nlink, "%u");
-	pv(di, di_size, "%" PRIu64);
-	pv(di, di_blocks, "%" PRIu64);
-	pv(di, di_atime, "%" PRId64);
-	pv(di, di_mtime, "%" PRId64);
-	pv(di, di_ctime, "%" PRId64);
-	pv(di, di_major, "%u");
-	pv(di, di_minor, "%u");
-
-	pv(di, di_rgrp, "%" PRIu64);
-	pv(di, di_goal_rgrp, "%" PRIu64);
-	pv(di, di_goal_dblk, "%u");
-	pv(di, di_goal_mblk, "%u");
-	pv(di, di_flags, "0x%.8X");
-	pv(di, di_payload_format, "%u");
-	pv(di, di_type, "%u");
-	pv(di, di_height, "%u");
-	pv(di, di_incarn, "%u");
-	pv(di, di_pad, "%u");
-
-	pv(di, di_depth, "%u");
-	pv(di, di_entries, "%u");
-
-	gfs_inum_print(&di->di_next_unused);
-
-	pv(di, di_eattr, "%" PRIu64);
-
-	pa(di, di_reserved, 56);
-
-}
-
-/**
- * gfs_indirect_in - copy in the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_in(struct gfs_indirect *indirect, char *buf)
-{
-	struct gfs_indirect *str = (struct gfs_indirect *) buf;
-
-	gfs_meta_header_in(&indirect->in_header, buf);
-
-	CPIN_08(indirect, str, in_reserved, 64);
-
-}
-
-/**
- * gfs_indirect_out - copy out the header of an indirect block
- * @indirect: the in memory copy
- * @buf: the buffer copy
- *
- */
-
-void
-gfs_indirect_out(struct gfs_indirect *indirect, char *buf)
-{
-	struct gfs_indirect *str = (struct gfs_indirect *) buf;
-
-	gfs_meta_header_out(&indirect->in_header, buf);
-
-	CPOUT_08(indirect, str, in_reserved, 64);
-
-}
-
-/**
- * gfs_indirect_print - Print out a indirect block header
- * @indirect: the cpu-order buffer
- */
-
-void
-gfs_indirect_print(struct gfs_indirect *indirect)
-{
-
-	gfs_meta_header_print(&indirect->in_header);
-
-	pa(indirect, in_reserved, 64);
-
-}
-
-/**
- * gfs_dirent_in - Read in a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_in(struct gfs_dirent *dirent, char *buf)
-{
-	struct gfs_dirent *str = (struct gfs_dirent *) buf;
-
-	gfs_inum_in(&dirent->de_inum, (char *) &str->de_inum);
-	CPIN_32(dirent, str, de_hash);
-	CPIN_16(dirent, str, de_rec_len);
-	CPIN_16(dirent, str, de_name_len);
-	CPIN_16(dirent, str, de_type);
-
-	CPIN_08(dirent, str, de_reserved, 14);
-
-}
-
-/**
- * gfs_dirent_out - Write out a directory entry
- * @dirent: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_dirent_out(struct gfs_dirent *dirent, char *buf)
-{
-	struct gfs_dirent *str = (struct gfs_dirent *) buf;
-
-	gfs_inum_out(&dirent->de_inum, (char *) &str->de_inum);
-	CPOUT_32(dirent, str, de_hash);
-	CPOUT_16(dirent, str, de_rec_len);
-	CPOUT_16(dirent, str, de_name_len);
-	CPOUT_16(dirent, str, de_type);
-
-	CPOUT_08(dirent, str, de_reserved, 14);
-
-}
-
-/**
- * gfs_dirent_print - Print out a directory entry
- * @de: the cpu-order buffer
- * @name: the filename
- */
-
-void
-gfs_dirent_print(struct gfs_dirent *de, const char *name)
-{
-	char buf[GFS_FNAMESIZE + 1];
-
-	gfs_inum_print(&de->de_inum);
-	pv(de, de_hash, "0x%.8X");
-	pv(de, de_rec_len, "%u");
-	pv(de, de_name_len, "%u");
-	pv(de, de_type, "%u");
-
-	pa(de, de_reserved, 14);
-
-	memset(buf, 0, GFS_FNAMESIZE + 1);
-	memcpy(buf, name, de->de_name_len);
-	printk("  name = %s\n", buf);
-
-}
-
-/**
- * gfs_leaf_in - Read in a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_in(struct gfs_leaf *leaf, char *buf)
-{
-	struct gfs_leaf *str = (struct gfs_leaf *) buf;
-
-	gfs_meta_header_in(&leaf->lf_header, buf);
-
-	CPIN_16(leaf, str, lf_depth);
-	CPIN_16(leaf, str, lf_entries);
-	CPIN_32(leaf, str, lf_dirent_format);
-	CPIN_64(leaf, str, lf_next);
-
-	CPIN_08(leaf, str, lf_reserved, 64);
-
-}
-
-/**
- * gfs_leaf_out - Write out a directory leaf header
- * @leaf: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_leaf_out(struct gfs_leaf *leaf, char *buf)
-{
-	struct gfs_leaf *str = (struct gfs_leaf *) buf;
-
-	gfs_meta_header_out(&leaf->lf_header, buf);
-
-	CPOUT_16(leaf, str, lf_depth);
-	CPOUT_16(leaf, str, lf_entries);
-	CPOUT_32(leaf, str, lf_dirent_format);
-	CPOUT_64(leaf, str, lf_next);
-
-	CPOUT_08(leaf, str, lf_reserved, 64);
-
-}
-
-/**
- * gfs_leaf_print - Print out a directory leaf header
- * @lf: the cpu-order buffer
- */
-
-void
-gfs_leaf_print(struct gfs_leaf *lf)
-{
-
-	gfs_meta_header_print(&lf->lf_header);
-
-	pv(lf, lf_depth, "%u");
-	pv(lf, lf_entries, "%u");
-	pv(lf, lf_dirent_format, "%u");
-	pv(lf, lf_next, "%" PRIu64);
-
-	pa(lf, lf_reserved, 64);
-
-}
-
-/**
- * gfs_log_header_in - Read in a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_in(struct gfs_log_header *head, char *buf)
-{
-	struct gfs_log_header *str = (struct gfs_log_header *) buf;
-
-	gfs_meta_header_in(&head->lh_header, buf);
-
-	CPIN_32(head, str, lh_flags);
-	CPIN_32(head, str, lh_pad);
-
-	CPIN_64(head, str, lh_first);
-	CPIN_64(head, str, lh_sequence);
-
-	CPIN_64(head, str, lh_tail);
-	CPIN_64(head, str, lh_last_dump);
-
-	CPIN_08(head, str, lh_reserved, 64);
-
-}
-
-/**
- * gfs_log_header_out - Write out a log header
- * @head: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_log_header_out(struct gfs_log_header *head, char *buf)
-{
-	struct gfs_log_header *str = (struct gfs_log_header *) buf;
-
-	gfs_meta_header_out(&head->lh_header, buf);
-
-	CPOUT_32(head, str, lh_flags);
-	CPOUT_32(head, str, lh_pad);
-
-	CPOUT_64(head, str, lh_first);
-	CPOUT_64(head, str, lh_sequence);
-
-	CPOUT_64(head, str, lh_tail);
-	CPOUT_64(head, str, lh_last_dump);
-
-	CPOUT_08(head, str, lh_reserved, 64);
-
-}
-
-/**
- * gfs_log_header_print - Print out a log header
- * @head: the cpu-order buffer
- */
-
-void
-gfs_log_header_print(struct gfs_log_header *lh)
-{
-
-	gfs_meta_header_print(&lh->lh_header);
-
-	pv(lh, lh_flags, "0x%.8X");
-	pv(lh, lh_pad, "%u");
-
-	pv(lh, lh_first, "%" PRIu64);
-	pv(lh, lh_sequence, "%" PRIu64);
-
-	pv(lh, lh_tail, "%" PRIu64);
-	pv(lh, lh_last_dump, "%" PRIu64);
-
-	pa(lh, lh_reserved, 64);
-
-}
-
-/**
- * gfs_desc_in - Read in a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_in(struct gfs_log_descriptor *desc, char *buf)
-{
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *) buf;
-
-	gfs_meta_header_in(&desc->ld_header, buf);
-
-	CPIN_32(desc, str, ld_type);
-	CPIN_32(desc, str, ld_length);
-	CPIN_32(desc, str, ld_data1);
-	CPIN_32(desc, str, ld_data2);
-
-	CPIN_08(desc, str, ld_reserved, 64);
-
-}
-
-/**
- * gfs_desc_out - Write out a log descriptor
- * @desc: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_desc_out(struct gfs_log_descriptor *desc, char *buf)
-{
-	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *) buf;
-
-	gfs_meta_header_out(&desc->ld_header, buf);
-
-	CPOUT_32(desc, str, ld_type);
-	CPOUT_32(desc, str, ld_length);
-	CPOUT_32(desc, str, ld_data1);
-	CPOUT_32(desc, str, ld_data2);
-
-	CPOUT_08(desc, str, ld_reserved, 64);
-
-}
-
-/**
- * gfs_desc_print - Print out a log descriptor
- * @ld: the cpu-order buffer
- */
-
-void
-gfs_desc_print(struct gfs_log_descriptor *ld)
-{
-
-	gfs_meta_header_print(&ld->ld_header);
-
-	pv(ld, ld_type, "%u");
-	pv(ld, ld_length, "%u");
-	pv(ld, ld_data1, "%u");
-	pv(ld, ld_data2, "%u");
-
-	pa(ld, ld_reserved, 64);
-
-}
-
-/**
- * gfs_block_tag_in - Read in a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_in(struct gfs_block_tag *tag, char *buf)
-{
-	struct gfs_block_tag *str = (struct gfs_block_tag *) buf;
-
-	CPIN_64(tag, str, bt_blkno);
-	CPIN_32(tag, str, bt_flags);
-	CPIN_32(tag, str, bt_pad);
-
-}
-
-/**
- * gfs_block_tag_out - Write out a block tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_block_tag_out(struct gfs_block_tag *tag, char *buf)
-{
-	struct gfs_block_tag *str = (struct gfs_block_tag *) buf;
-
-	CPOUT_64(tag, str, bt_blkno);
-	CPOUT_32(tag, str, bt_flags);
-	CPOUT_32(tag, str, bt_pad);
-
-}
-
-/**
- * gfs_block_tag_print - Print out a block tag
- * @tag: the cpu-order buffer
- */
-
-void
-gfs_block_tag_print(struct gfs_block_tag *tag)
-{
-
-	pv(tag, bt_blkno, "%" PRIu64);
-	pv(tag, bt_flags, "%u");
-	pv(tag, bt_pad, "%u");
-
-}
-
-/**
- * gfs_quota_tag_in - Read in a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_in(struct gfs_quota_tag *tag, char *buf)
-{
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *) buf;
-
-	CPIN_64(tag, str, qt_change);
-	CPIN_32(tag, str, qt_flags);
-	CPIN_32(tag, str, qt_id);
-
-}
-
-/**
- * gfs_quota_tag_out - Write out a quota tag
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_quota_tag_out(struct gfs_quota_tag *tag, char *buf)
-{
-	struct gfs_quota_tag *str = (struct gfs_quota_tag *) buf;
-
-	CPOUT_64(tag, str, qt_change);
-	CPOUT_32(tag, str, qt_flags);
-	CPOUT_32(tag, str, qt_id);
-
-}
-
-/**
- * gfs_quota_tag_print - Print out a quota tag
- * @tag: the cpu-order buffer
- */
-
-void
-gfs_quota_tag_print(struct gfs_quota_tag *tag)
-{
-
-	pv(tag, qt_change, "%" PRId64);
-	pv(tag, qt_flags, "0x%.8X");
-	pv(tag, qt_id, "%u");
-
-}
-
-/**
- * gfs_ea_header_in - Read in a Extended Attribute header
- * @tag: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_in(struct gfs_ea_header *ea, char *buf)
-{
-	struct gfs_ea_header *str = (struct gfs_ea_header *) buf;
-
-	CPIN_32(ea, str, ea_rec_len);
-	CPIN_32(ea, str, ea_data_len);
-	ea->ea_name_len = str->ea_name_len;
-	ea->ea_type = str->ea_type;
-	ea->ea_flags = str->ea_flags;
-	ea->ea_num_ptrs = str->ea_num_ptrs;
-	CPIN_32(ea, str, ea_pad);
-
-}
-
-/**
- * gfs_ea_header_out - Write out a Extended Attribute header
- * @ea: the cpu-order structure
- * @buf: the disk-order buffer
- *
- */
-
-void
-gfs_ea_header_out(struct gfs_ea_header *ea, char *buf)
-{
-	struct gfs_ea_header *str = (struct gfs_ea_header *) buf;
-
-	CPOUT_32(ea, str, ea_rec_len);
-	CPOUT_32(ea, str, ea_data_len);
-	str->ea_name_len = ea->ea_name_len;
-	str->ea_type = ea->ea_type;
-	str->ea_flags = ea->ea_flags;
-	str->ea_num_ptrs = ea->ea_num_ptrs;
-	CPOUT_32(ea, str, ea_pad);
-
-}
-
-/**
- * gfs_ea_header_printt - Print out a Extended Attribute header
- * @ea: the cpu-order buffer
- */
-
-void
-gfs_ea_header_print(struct gfs_ea_header *ea, char *name)
-{
-	char buf[GFS_EA_MAX_NAME_LEN + 1];
-
-	pv(ea, ea_rec_len, "%u");
-	pv(ea, ea_data_len, "%u");
-	pv(ea, ea_name_len, "%u");
-	pv(ea, ea_type, "%u");
-	pv(ea, ea_flags, "%u");
-	pv(ea, ea_num_ptrs, "%u");
-	pv(ea, ea_pad, "%u");
-
-	memset(buf, 0, GFS_EA_MAX_NAME_LEN + 1);
-	memcpy(buf, name, ea->ea_name_len);
-	printf("  name = %s\n", buf);
-}
-
-static const uint32_t crc_32_tab[] = {
-	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
-	0xe963a535, 0x9e6495a3,
-	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,
-	0xe7b82d07, 0x90bf1d91,
-	0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb,
-	0xf4d4b551, 0x83d385c7,
-	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
-	0xfa0f3d63, 0x8d080df5,
-	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447,
-	0xd20d85fd, 0xa50ab56b,
-	0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75,
-	0xdcd60dcf, 0xabd13d59,
-	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
-	0xcfba9599, 0xb8bda50f,
-	0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11,
-	0xc1611dab, 0xb6662d3d,
-	0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
-	0x9fbfe4a5, 0xe8b8d433,
-	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
-	0x91646c97, 0xe6635c01,
-	0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b,
-	0x8208f4c1, 0xf50fc457,
-	0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49,
-	0x8cd37cf3, 0xfbd44c65,
-	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
-	0xa4d1c46d, 0xd3d6f4fb,
-	0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
-	0xaa0a4c5f, 0xdd0d7cc9,
-	0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3,
-	0xb966d409, 0xce61e49f,
-	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
-	0xb7bd5c3b, 0xc0ba6cad,
-	0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af,
-	0x04db2615, 0x73dc1683,
-	0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d,
-	0x0a00ae27, 0x7d079eb1,
-	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
-	0x196c3671, 0x6e6b06e7,
-	0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9,
-	0x17b7be43, 0x60b08ed5,
-	0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767,
-	0x3fb506dd, 0x48b2364b,
-	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
-	0x316e8eef, 0x4669be79,
-	0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703,
-	0x220216b9, 0x5505262f,
-	0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
-	0x2cd99e8b, 0x5bdeae1d,
-	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
-	0x72076785, 0x05005713,
-	0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d,
-	0x7cdcefb7, 0x0bdbdf21,
-	0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b,
-	0x6fb077e1, 0x18b74777,
-	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
-	0x616bffd3, 0x166ccf45,
-	0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
-	0x4969474d, 0x3e6e77db,
-	0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5,
-	0x47b2cf7f, 0x30b5ffe9,
-	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
-	0x54de5729, 0x23d967bf,
-	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1,
-	0x5a05df1b, 0x2d02ef8d
-};
-
-/**
- * gfs_dir_hash - hash an array of data
- * @data: the data to be hashed
- * @len: the length of data to be hashed
- *
- * Take some data and convert it to a 32-bit hash.
- *
- * The hash function is a 32-bit CRC of the data.  The algorithm uses
- * the crc_32_tab table above.
- *
- * This may not be the fastest hash function, but it does a fair bit better
- * at providing uniform results than the others I've looked at.  That's
- * really important for efficient directories.
- *
- * Returns: the hash
- */
-
-uint32_t
-gfs_dir_hash(const char *data, int len)
-{
-	uint32_t hash = 0xFFFFFFFF;
-
-	for (; len--; data++)
-		hash = crc_32_tab[(hash ^ *data) & 0xFF] ^ (hash >> 8);
-
-	hash = ~hash;
-
-	return hash;
-}
diff --git a/gfs/libgfs/rgrp.c b/gfs/libgfs/rgrp.c
deleted file mode 100644
index 6407b80..0000000
--- a/gfs/libgfs/rgrp.c
+++ /dev/null
@@ -1,593 +0,0 @@
-#include <stdint.h>
-#include "gfs_ondisk.h"
-#include "incore.h"
-#include "libgfs.h"
-
-/**
- * fs_compute_bitstructs - Compute the bitmap sizes
- * @rgd: The resource group descriptor
- *
- * Returns: 0 on success, -1 on error
- */
-int fs_compute_bitstructs(struct gfs_rgrpd *rgd)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_bitmap *bits;
-	uint32 length = rgd->rd_ri.ri_length;
-	uint32 bytes_left, bytes;
-	int x;
-
-	if(!(rgd->rd_bits = (struct gfs_bitmap *)malloc(length * sizeof(struct gfs_bitmap)))) {
-		log_err("Unable to allocate bitmap structure\n");
-		stack;
-		return -1;
-	}
-	if(!memset(rgd->rd_bits, 0, length * sizeof(struct gfs_bitmap))) {
-		log_err("Unable to zero bitmap structure\n");
-		stack;
-		return -1;
-	}
-	
-	bytes_left = rgd->rd_ri.ri_bitbytes;
-
-	for (x = 0; x < length; x++){
-		bits = &rgd->rd_bits[x];
-
-		if (length == 1){
-			bytes = bytes_left;
-			bits->bi_offset = sizeof(struct gfs_rgrp);
-			bits->bi_start = 0;
-			bits->bi_len = bytes;
-		}
-		else if (x == 0){
-			bytes = sdp->sd_sb.sb_bsize - sizeof(struct gfs_rgrp);
-			bits->bi_offset = sizeof(struct gfs_rgrp);
-			bits->bi_start = 0;
-			bits->bi_len = bytes;
-		}
-		else if (x + 1 == length){
-			bytes = bytes_left;
-			bits->bi_offset = sizeof(struct gfs_meta_header);
-			bits->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
-			bits->bi_len = bytes;
-		}
-		else{
-			bytes = sdp->sd_sb.sb_bsize - sizeof(struct gfs_meta_header);
-			bits->bi_offset = sizeof(struct gfs_meta_header);
-			bits->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
-			bits->bi_len = bytes;
-		}
-
-		bytes_left -= bytes;
-	}
-
-	if(bytes_left){
-		log_err( "fs_compute_bitstructs:  Too many blocks in rgrp to "
-			"fit into available bitmap.\n");
-		return -1;
-	}
-
-	if((rgd->rd_bits[length - 1].bi_start +
-	    rgd->rd_bits[length - 1].bi_len) * GFS_NBBY != rgd->rd_ri.ri_data){
-		log_err( "fs_compute_bitstructs:  # of blks in rgrp do not equal "
-			"# of blks represented in bitmap.\n"
-			"\tbi_start = %u\n"
-			"\tbi_len   = %u\n"
-			"\tGFS_NBBY = %u\n"
-			"\tri_data  = %u\n",
-			rgd->rd_bits[length - 1].bi_start,
-			rgd->rd_bits[length - 1].bi_len,
-			GFS_NBBY,
-			rgd->rd_ri.ri_data);
-		return -1;
-	}
-
-
-	if(!(rgd->rd_bh = (osi_buf_t **)malloc(length * sizeof(osi_buf_t *)))) {
-		log_err("Unable to allocate osi_buf structure\n");
-		stack;
-		return -1;
-	}
-	if(!memset(rgd->rd_bh, 0, length * sizeof(osi_buf_t *))) {
-		log_err("Unable to zero osi_buf structure\n");
-		stack;
-		return -1;
-	}
-
-	return 0;
-}
-
-
-/**
- * blk2rgrpd - Find resource group for a given data block number
- * @sdp: The GFS superblock
- * @n: The data block number
- *
- * Returns: Ths resource group, or NULL if not found
- */
-struct gfs_rgrpd *fs_blk2rgrpd(struct gfs_sbd *sdp, uint64 blk)
-{
-	osi_list_t *tmp;
-	struct gfs_rgrpd *rgd = NULL;
-	struct gfs_rindex *ri;
-
-	for(tmp = (osi_list_t *)sdp->sd_rglist.next; 
-		tmp != (osi_list_t *)&sdp->sd_rglist; tmp = tmp->next){
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-		ri = &rgd->rd_ri;
-
-		if (ri->ri_data1 <= blk && blk < ri->ri_data1 + ri->ri_data){
-			break;
-		} else
-			rgd = NULL;
-	}
-	return rgd;
-}
-
-/**
- * fs_rgrp_read - read in the resource group information from disk.
- * @rgd - resource group structure
- * @repair_if_corrupted - If TRUE, rgrps found to be corrupt should be repaired
- *                 according to the index.  If FALSE, no corruption is fixed.
- */
-int fs_rgrp_read(int disk_fd, struct gfs_rgrpd *rgd, int repair_if_corrupted)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	unsigned int x, length = rgd->rd_ri.ri_length;
-	int error;
-
-	if(rgd->rd_open_count){
-		log_debug("rgrp already read...\n");
-		rgd->rd_open_count++;
-		return 0;
-	}
-
-	for (x = 0; x < length; x++){
-		if(rgd->rd_bh[x]){
-			log_err("Programmer error!  Bitmaps are already present in rgrp.\n");
-			exit(1);
-		}
-		error = get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize,
-								 rgd->rd_ri.ri_addr + x, &(rgd->rd_bh[x]), 0);
-		if (error) {
-		  	log_err("Unable to read rgrp from disk.\n"); 
-		  	goto fail;
-		}
-
-		if(check_meta(rgd->rd_bh[x], (x) ? GFS_METATYPE_RB : GFS_METATYPE_RG)){
-			log_err("Buffer #%"PRIu64" (%d of %d) is neither"
-				" GFS_METATYPE_RB nor GFS_METATYPE_RG.\n",
-				BH_BLKNO(rgd->rd_bh[x]),
-				(int)x+1,
-				(int)length);
-			if (repair_if_corrupted) {
-				log_err("Attempting to repair.\n");
-				memset(&rgd->rd_rg, 0, sizeof(struct gfs_rgrp));
-				rgd->rd_rg.rg_header.mh_magic = GFS_MAGIC;
-				rgd->rd_rg.rg_header.mh_type = GFS_METATYPE_RG;
-				rgd->rd_rg.rg_header.mh_format = GFS_FORMAT_RG;
-				rgd->rd_rg.rg_free = rgd->rd_ri.ri_data;
-				gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[x]));
-				write_buf(disk_fd, rgd->rd_bh[x], BW_WAIT);
-			}
-			else {
-				error = -1;
-				goto fail;
-			}
-		}
-	}
-
-	gfs_rgrp_in(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-	rgd->rd_open_count = 1;
-
-	return 0;
-
- fail:
-	for (x = 0; x < length; x++){
-		relse_buf(rgd->rd_bh[x]);
-		rgd->rd_bh[x] = NULL;
-	}
-
-	log_err("Resource group is corrupted.\n");
-	return error;
-}
-
-void fs_rgrp_relse(struct gfs_rgrpd *rgd)
-{
-	int x, length = rgd->rd_ri.ri_length;
-
-	rgd->rd_open_count--;
-	if(rgd->rd_open_count){
-		log_debug("rgrp still held...\n");
-	} else {
-		for (x = 0; x < length; x++){
-			relse_buf(rgd->rd_bh[x]);
-			rgd->rd_bh[x] = NULL;
-		}
-	}
-}
-
-
-/**
- * rgrp_verify - Verify that a resource group is consistent
- * @sdp: the filesystem
- * @rgd: the rgrp
- *
- * Returns: 0 if ok, -1 on error
- */
-int fs_rgrp_verify(struct gfs_rgrpd *rgd)
-{
-	struct gfs_bitmap *bits = NULL;
-	uint32 length = rgd->rd_ri.ri_length;
-	uint32 count[4], tmp;
-	int buf, x;
-
-	for (x = 0; x < 4; x++){
-		count[x] = 0;
-
-		for (buf = 0; buf < length; buf++){
-			bits = &rgd->rd_bits[buf];
-			count[x] += fs_bitcount((unsigned char *)
-						BH_DATA(rgd->rd_bh[buf]) +
-						bits->bi_offset,
-						bits->bi_len, x);
-		}
-	}
-
-	if(count[0] != rgd->rd_rg.rg_free){
-		log_err("free data mismatch:  %u != %u\n",
-			count[0], rgd->rd_rg.rg_free);
-		return -1;
-	}
-
-	tmp = rgd->rd_ri.ri_data -
-		(rgd->rd_rg.rg_usedmeta + rgd->rd_rg.rg_freemeta) -
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi) -
-		rgd->rd_rg.rg_free;
-
-	if(count[1] != tmp){
-		log_err("used data mismatch:  %u != %u\n",
-			count[1], tmp);
-		return -1;
-	}
-	if(count[2] != rgd->rd_rg.rg_freemeta){
-		log_err("free metadata mismatch:  %u != %u\n",
-			count[2], rgd->rd_rg.rg_freemeta);
-		return -1;
-	}
-
-	tmp = rgd->rd_rg.rg_usedmeta +
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi);
-
-	if(count[3] != tmp){
-		log_err("used metadata mismatch:  %u != %u\n",
-			count[3], tmp);
-		return -1;
-	}
-	return 0;
-}
-
-/**
- * fs_rgrp_recount - adjust block tracking numbers
- * rgd: resource group
- *
- * The resource groups keep track of how many free blocks, used blocks,
- * etc there are.  This function readjusts those numbers based on the
- * current state of the bitmap.
- *
- * Returns: 0 on success, -1 on failure
- */
-int fs_rgrp_recount(int disk_fd, struct gfs_rgrpd *rgd){
-	int i,j;
-	fs_bitmap_t *bits = NULL;
-	uint32 length = rgd->rd_ri.ri_length;
-	uint32 count[4], tmp;
-
-	for(i=0; i < 4; i++){
-		count[i] = 0;
-		for(j = 0; j < length; j++){
-			bits = (fs_bitmap_t *)&rgd->rd_bits[j];
-			count[i] += fs_bitcount((unsigned char *)
-						BH_DATA(rgd->rd_bh[j]) +
-						bits->bi_offset,
-						bits->bi_len, i);
-		}
-	}
-	if(count[0] != rgd->rd_rg.rg_free){
-		log_warn("\tAdjusting free block count (%u -> %u).\n",
-			rgd->rd_rg.rg_free, count[0]);
-		rgd->rd_rg.rg_free = count[0];
-	}
-	if(count[2] != rgd->rd_rg.rg_freemeta){
-		log_warn("\tAdjusting freemeta block count (%u -> %u).\n",
-		       rgd->rd_rg.rg_freemeta, count[2]);
-		rgd->rd_rg.rg_freemeta = count[2];
-	}
-	tmp = rgd->rd_rg.rg_usedmeta +
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi);
-
-	if(count[3] != tmp){
-		int first = 1;
-		struct gfs_sbd *sdp = rgd->rd_sbd;
-		uint32 useddi = 0;
-		uint32 freedi = 0;
-		uint64 block;
-		struct gfs_inode *ip;
-
-		while (1){  /* count the used dinodes */
-			if(next_rg_metatype(disk_fd, rgd, &block,
-					    GFS_METATYPE_DI, first)){
-				break;
-			}
-			first = 0;
-			if(load_inode(disk_fd, sdp, block, &ip)) {
-				stack;
-				continue;
-			}
-
-			if (ip->i_di.di_flags & GFS_DIF_UNUSED){
-				freedi++;
-				continue;
-			}
-			free_inode(&ip);
-			useddi++;
-		}
-
-		if(useddi != rgd->rd_rg.rg_useddi){
-			log_warn("\tAdjusting used dinode block count (%u -> %u).\n",
-				rgd->rd_rg.rg_useddi, useddi);
-			rgd->rd_rg.rg_useddi = useddi;
-		}
-		if(freedi != rgd->rd_rg.rg_freedi){
-			log_warn("\tAdjusting free dinode block count (%u -> %u).\n",
-				rgd->rd_rg.rg_freedi, freedi);
-			rgd->rd_rg.rg_freedi = freedi;
-		}
-		if(rgd->rd_rg.rg_usedmeta != count[3] - (freedi + useddi)){
-			log_warn("\tAdjusting used meta block count (%u -> %u).\n",
-				rgd->rd_rg.rg_usedmeta,
-				(count[3] - (freedi + useddi)));
-			rgd->rd_rg.rg_usedmeta = count[3] - (freedi + useddi);
-		}
-	}
-
-	tmp = rgd->rd_ri.ri_data -
-		(rgd->rd_rg.rg_usedmeta + rgd->rd_rg.rg_freemeta) -
-		(rgd->rd_rg.rg_useddi + rgd->rd_rg.rg_freedi) -
-		rgd->rd_rg.rg_free;
-
-	if(count[1] != tmp){
-		log_err("Could not reconcile rgrp block counts.\n");
-		return -1;
-	}
-	return 0;
-}
-
-/**
- * clump_alloc - Allocate a clump of metadata
- * @rgd: the resource group descriptor
- * @goal: the goal block in the RG
- *
- * Returns: 0 on success, -1 on failure
- */
-int clump_alloc(int disk_fd, struct gfs_rgrpd *rgd, uint32 goal)
-{
-	struct gfs_sbd *sdp = rgd->rd_sbd;
-	struct gfs_meta_header mh;
-	osi_buf_t *bh[GFS_META_CLUMP] = {0};
-	uint32 block;
-	int i,j;
-	int error = 0;
-
-	memset(&mh, 0, sizeof(struct gfs_meta_header));
-	mh.mh_magic = GFS_MAGIC;
-	mh.mh_type = GFS_METATYPE_NONE;
-
-	if(rgd->rd_rg.rg_free < GFS_META_CLUMP){
-		log_debug(" Not enough free blocks in rgrp.\n");
-		return -1;
-	}
-
-	for (i = 0; i < GFS_META_CLUMP; i++){
-		block = fs_blkalloc_internal(rgd, goal,
-					     GFS_BLKST_FREE,
-					     GFS_BLKST_FREEMETA, TRUE);
-		log_debug("Got block %u\n", block);
-
-		if(block == BFITNOENT) {
-			log_err("Unable to get enough blocks\n");
-			goto fail;
-		}
-		block += rgd->rd_ri.ri_data1;
-		block_set(rgd->rd_sbd->bl, block, meta_free);
-		if (get_buf(sdp->sd_sb.sb_bsize, block, &(bh[i]))){
-			log_err("Unable to allocate new buffer.\n");
-			goto fail;
-		}
-		gfs_meta_header_out(&mh, BH_DATA(bh[i]));
-
-		goal = block;
-	}
-
-	log_debug("64 Meta blocks (%"PRIu64" - %"PRIu64"), allocated in rgrp 0x%lx\n",
-		(rgd->rd_ri.ri_data1 + block)-63,
-		(rgd->rd_ri.ri_data1 + block),
-		(unsigned long)rgd);
-	for (j = 0; j < GFS_META_CLUMP; j++){
-
-		error = write_buf(disk_fd, bh[j], BW_WAIT);
-		if (error){
-			log_err("Unable to write allocated metablock to disk.\n");
-			goto fail;
-		}
-	}
-
-	if(rgd->rd_rg.rg_free < GFS_META_CLUMP){
-		log_err("More blocks were allocated from rgrp "
-			"than are available.\n");
-		goto fail;
-	}
-	rgd->rd_rg.rg_free -= GFS_META_CLUMP;
-	rgd->rd_rg.rg_freemeta += GFS_META_CLUMP;
-
-	for (i = 0; i < GFS_META_CLUMP; i++)
-		relse_buf(bh[i]);
-
-	return 0;
-
- fail:
-	log_debug("clump_alloc failing...\n");
-	for(--i; i >=0; i--){
-		fs_set_bitmap(disk_fd, sdp, BH_BLKNO(bh[i]), GFS_BLKST_FREE);
-		relse_buf(bh[i]);
-	}
-	return -1;
-}
-
-
-/**
- * fs_blkalloc - Allocate a data block
- * @ip: the inode to allocate the data block for
- * @block: the block allocated
- *
- * Returns: 0 on success, -1 on failure
- */
-int fs_blkalloc(int disk_fd, struct gfs_inode *ip, uint64 *block)
-{
-	osi_list_t *tmp;
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd;
-	uint32 goal;
-	int same;
-
-	for(tmp = (osi_list_t *)sdp->sd_rglist.next;
-		tmp != (osi_list_t *)&sdp->sd_rglist; tmp = tmp->next){
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-
-		if(!rgd){
-			log_err( "fs_blkalloc:  Bad rgrp list!\n");
-			return -1;
-		}
-
-		if(fs_rgrp_read(disk_fd, rgd, FALSE)){
-			log_err( "fs_blkalloc:  Unable to read rgrp.\n");
-			return -1;
-		}
-
-		if(!rgd->rd_rg.rg_free){
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-
-		same = (rgd->rd_ri.ri_addr == ip->i_di.di_goal_rgrp);
-		goal = (same) ? ip->i_di.di_goal_dblk : 0;
-
-		*block = fs_blkalloc_internal(rgd, goal,
-					      GFS_BLKST_FREE,
-					      GFS_BLKST_USED, TRUE);
-
-		log_debug("Got block %"PRIu64"\n", *block);
-		if(*block == BFITNOENT) {
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-		if (!same){
-			ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-			ip->i_di.di_goal_mblk = 0;
-		}
-
-		*block += rgd->rd_ri.ri_data1;
-		ip->i_di.di_goal_dblk = *block;
-
-		rgd->rd_rg.rg_free--;
-
-		gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-		if(write_buf(disk_fd, rgd->rd_bh[0], 0)){
-			log_err( "Unable to write out rgrp block #%"
-				PRIu64".\n",
-				BH_BLKNO(rgd->rd_bh[0]));
-			fs_rgrp_relse(rgd);
-			return -1;
-		}
-		fs_rgrp_relse(rgd);
-		return 0;
-	}
-
-	return 1;
-}
-
-
-/**
- * fs_metaalloc - Allocate a metadata block to a file
- * @ip:  the file
- * @block: the block allocated
- *
- * Returns: 0 on success, -1 on failure
- */
-int fs_metaalloc(int disk_fd, struct gfs_inode *ip, uint64 *block)
-{
-	osi_list_t *tmp;
-	struct gfs_sbd *sdp = ip->i_sbd;
-	struct gfs_rgrpd *rgd;
-	uint32 goal;
-	int same;
-	int error = 0;
-
-	/* ATTENTION -- maybe we should try to allocate from goal rgrp first */
-	for(tmp = (osi_list_t *)sdp->sd_rglist.next;
-		tmp != (osi_list_t *)&sdp->sd_rglist; tmp = tmp->next){
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-
-		if(!rgd){
-			log_err( "fs_metaalloc:  Bad rgrp list!\n");
-			return -1;
-		}
-
-		if(fs_rgrp_read(disk_fd, rgd, FALSE)){
-			log_err( "fs_metaalloc:  Unable to read rgrp.\n");
-			return -1;
-		}
-
-		same = (rgd->rd_ri.ri_addr == ip->i_di.di_goal_rgrp);
-		goal = (same) ? ip->i_di.di_goal_mblk : 0;
-
-		if (!rgd->rd_rg.rg_freemeta){
-			error = clump_alloc(disk_fd, rgd, goal);
-			if (error){
-				fs_rgrp_relse(rgd);
-				continue;
-			}
-		}
-
-
-		if(!rgd->rd_rg.rg_freemeta){
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-		*block = fs_blkalloc_internal(rgd, goal,
-					      GFS_BLKST_FREEMETA,
-					      GFS_BLKST_USEDMETA, TRUE);
-		log_debug("Got block %"PRIu64"\n", *block);
-		if(*block == BFITNOENT) {
-			fs_rgrp_relse(rgd);
-			continue;
-		}
-		if (!same){
-			ip->i_di.di_goal_rgrp = rgd->rd_ri.ri_addr;
-			ip->i_di.di_goal_dblk = 0;
-		}
-		*block += rgd->rd_ri.ri_data1;
-		ip->i_di.di_goal_mblk = *block;
-
-		rgd->rd_rg.rg_freemeta--;
-		rgd->rd_rg.rg_usedmeta++;
-
-		gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[0]));
-		write_buf(disk_fd, rgd->rd_bh[0], 0);
-		fs_rgrp_relse(rgd);
-		/* if we made it this far, then we are ok */
-		return 0;
-	}
-
-	return -1;
-}
diff --git a/gfs/libgfs/size.c b/gfs/libgfs/size.c
deleted file mode 100644
index 289c04d..0000000
--- a/gfs/libgfs/size.c
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/mount.h>
-
-#include "libgfs.h"
-
-#ifndef BLKGETSIZE64
-#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
-#endif
-
-/**
- * do_device_size - determine the size of a Linux block device
- * @device: the path to the device node
- *
- * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
- */
-
-static int
-do_device_size(int fd, uint64_t *bytes)
-{
-	unsigned long size;
-	off_t off;
-	int error;
-
-	error = ioctl(fd, BLKGETSIZE64, bytes);	/* Size in bytes */
-	if (!error)
-		return 0;
-
-	error = ioctl(fd, BLKGETSIZE, &size);	/* Size in 512-byte blocks */
-	if (!error) {
-		*bytes = ((uint64_t) size) << 9;
-		return 0;
-	}
-
-	off = lseek(fd, 0, SEEK_END);
-	if (off >= 0) {
-		*bytes = off;
-		return 0;
-	}
-
-	return -1;
-}
-
-/**
- * device_size - figure out a device's size
- * @fd: the file descriptor of a device
- * @bytes: the number of bytes the device holds
- *
- * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
- */
-
-int
-device_size(int fd, uint64_t *bytes)
-{
-	struct stat st;
-	int error;
-
-	error = fstat(fd, &st);
-	if (error)
-		return error;
-
-	if (S_ISREG(st.st_mode)) {
-		*bytes = st.st_size;
-		return 0;
-	} else if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))
-		return do_device_size(fd, bytes);
-	else if (S_ISDIR(st.st_mode))
-		errno = EISDIR;
-	else
-		errno = EINVAL;
-
-	return -1;
-}
diff --git a/gfs/libgfs/super.c b/gfs/libgfs/super.c
deleted file mode 100644
index cf45e94..0000000
--- a/gfs/libgfs/super.c
+++ /dev/null
@@ -1,530 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <errno.h>
-
-#include "osi_list.h"
-#include "osi_user.h"
-#include "gfs_ondisk.h"
-#include "incore.h"
-#include "libgfs.h"
-
-#ifndef BLKGETSIZE64
-#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
-#endif
-
-#define DIV_RU(x, y) (((x) + (y) - 1) / (y))
-#define ri_compare(rg, ondisk, expected, field, fmt)	\
-	if (ondisk.field != expected.field) { \
-		log_warn("rgindex[%d] " #field " discrepancy: index 0x%" fmt \
-				 " != expected: 0x%" fmt "\n", \
-				 rg, ondisk.field, expected.field);	\
-		ondisk.field = expected.field; \
-		rgindex_modified = TRUE; \
-	}
-
-static uint64 total_journal_space;
-
-/**
- * check_sb - Check superblock
- * @sdp: the filesystem
- * @sb: The superblock
- *
- * Checks the version code of the FS is one that we understand how to
- * read and that the sizes of the various on-disk structures have not
- * changed.
- *
- * Returns: 0 on success, -1 on failure
- */
-static int check_sb(struct gfs_sbd *sdp, struct gfs_sb *sb)
-{
-	int error = 0;
-	if (sb->sb_header.mh_magic != GFS_MAGIC ||
-	    sb->sb_header.mh_type != GFS_METATYPE_SB){
-		log_crit("Either the super block is corrupted, or this "
-			 "is not a GFS filesystem\n");
-		log_debug("Header magic: %X Header Type: %X\n",
-			  sb->sb_header.mh_magic,
-			  sb->sb_header.mh_type);
-		error = -EINVAL;
-		goto out;
-	}
-
-	/*  If format numbers match exactly, we're done.  */
-	if (sb->sb_fs_format != GFS_FORMAT_FS ||
-	    sb->sb_multihost_format != GFS_FORMAT_MULTI){
-		log_warn("Old file system detected.\n");
-	}
-
- out:
-	return error;
-}
-
-/*
- * compute_constants: compute constants for the superblock
- *
- * assumes:
- *    sb_bsize_shift is set either from the ondisk superblock or otherwise.
- *    sb_bsize is set either from the ondisk superblock or otherwise.
- */
-int compute_constants(struct gfs_sbd *sdp)
-{
-	unsigned int x;
-	uint64 space = 0;
-	int error = 0;
-
-	sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - 9;
-	sdp->sd_diptrs =
-		(sdp->sd_sb.sb_bsize-sizeof(struct gfs_dinode)) /
-		sizeof(uint64);
-	sdp->sd_inptrs =
-		(sdp->sd_sb.sb_bsize-sizeof(struct gfs_indirect)) /
-		sizeof(uint64);
-	sdp->sd_jbsize = sdp->sd_sb.sb_bsize - sizeof(struct gfs_meta_header);
-	sdp->sd_hash_bsize = sdp->sd_sb.sb_bsize / 2;
-	sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(uint64);
-	sdp->sd_heightsize[0] = sdp->sd_sb.sb_bsize -
-		sizeof(struct gfs_dinode);
-	sdp->sd_heightsize[1] = sdp->sd_sb.sb_bsize * sdp->sd_diptrs;
-	for (x = 2; ; x++){
-		space = sdp->sd_heightsize[x - 1] * sdp->sd_inptrs;
-		/* FIXME: Do we really need this first check?? */
-		if (space / sdp->sd_inptrs != sdp->sd_heightsize[x - 1] ||
-		    space % sdp->sd_inptrs != 0)
-			break;
-		sdp->sd_heightsize[x] = space;
-	}
-	sdp->sd_max_height = x;
-	if(sdp->sd_max_height > GFS_MAX_META_HEIGHT){
-		log_err("Bad max metadata height.\n");
-		error = -1;
-		return error;
-	}
-
-	sdp->sd_jheightsize[0] = sdp->sd_sb.sb_bsize -
-		sizeof(struct gfs_dinode);
-	sdp->sd_jheightsize[1] = sdp->sd_jbsize * sdp->sd_diptrs;
-	for (x = 2; ; x++){
-		space = sdp->sd_jheightsize[x - 1] * sdp->sd_inptrs;
-		if (space / sdp->sd_inptrs != sdp->sd_jheightsize[x - 1] ||
-		    space % sdp->sd_inptrs != 0)
-			break;
-		sdp->sd_jheightsize[x] = space;
-	}
-	sdp->sd_max_jheight = x;
-	if(sdp->sd_max_jheight > GFS_MAX_META_HEIGHT){
-		log_err("Bad max jheight.\n");
-		error = -1;
-	}
-	return error;
-}
-
-/*
- * read_sb: read the super block from disk
- * sdp: in-core super block
- *
- * This function reads in the super block from disk and
- * initializes various constants maintained in the super
- * block
- *
- * Returns: 0 on success, -1 on failure.
- */
-int read_sb(int disk_fd, struct gfs_sbd *sdp)
-{
-	osi_buf_t *bh;
-	int error;
-	error = get_and_read_buf(disk_fd, 512, /* assume 512 block size at first */
-							 GFS_SB_ADDR >> sdp->sd_fsb2bb_shift, &bh, 0);
-	if (error){
-		log_crit("Unable to read superblock\n");
-		goto out;
-	}
-
-	gfs_sb_in(&sdp->sd_sb, BH_DATA(bh));
-
-	relse_buf(bh);
-
-	error = check_sb(sdp, &sdp->sd_sb);
-	if (error)
-		goto out;
-
-	compute_constants(sdp);
-
- out:
-
-	return error;
-}
-
-
-/*
- * ji_update - fill in journal info
- * ip: the journal index inode
- *
- * Given the inode for the journal index, read in all
- * the journal indexes.
- *
- * Returns: 0 on success, -1 on failure
- */
-int ji_update(int disk_fd, struct gfs_sbd *sdp)
-{
-	struct gfs_inode *ip = sdp->sd_jiinode;
-	char buf[sizeof(struct gfs_jindex)];
-	unsigned int j;
-	int error=0;
-
-
-	if(ip->i_di.di_size % sizeof(struct gfs_jindex) != 0){
-		log_err("The size reported in the journal index"
-			" inode is not a\n"
-			 "\tmultiple of the size of a journal index.\n");
-		return -1;
-	}
-
-	if(!(sdp->sd_jindex = (struct gfs_jindex *)malloc(ip->i_di.di_size))) {
-		log_err("Unable to allocate journal index\n");
-		return -1;
-	}
-	if(!memset(sdp->sd_jindex, 0, ip->i_di.di_size)) {
-		log_err("Unable to zero journal index\n");
-		return -1;
-	}
-	total_journal_space = 0;
-
-	for (j = 0; ; j++) {
-		struct gfs_jindex *journ;
-		error = readi(disk_fd, ip, buf, j * sizeof(struct gfs_jindex),
-				 sizeof(struct gfs_jindex));
-		if(!error)
-			break;
-		if (error != sizeof(struct gfs_jindex)){
-			log_err("An error occurred while reading the"
-				" journal index file.\n");
-			goto fail;
-		}
-
-		journ = sdp->sd_jindex + j;
-		gfs_jindex_in(journ, buf);
-		total_journal_space += journ->ji_nsegment * sdp->sd_sb.sb_seg_size;
-	}
-
-
-	if(j * sizeof(struct gfs_jindex) != ip->i_di.di_size){
-		log_err("journal inode size invalid\n");
-		log_debug("j * sizeof(struct gfs_jindex) !="
-			  " ip->i_di.di_size\n");
-		log_debug("%d != %d\n",
-			  j * sizeof(struct gfs_jindex), ip->i_di.di_size);
-		goto fail;
-	}
-	sdp->sd_journals = j;
-	log_debug("%d journals found.\n", j);
-
-	return 0;
-
- fail:
-	free(sdp->sd_jindex);
-	return -1;
-}
-
-/* Print out debugging information in same format as gfs_edit. */
-int hexdump(uint64 startaddr, const unsigned char *lpBuffer, int len)
-{
-	const unsigned char *pointer,*ptr2;
-	int i;
-	uint64 l;
-
-	pointer = (unsigned char *)lpBuffer;
-	ptr2 = (unsigned char *)lpBuffer;
-	l = 0;
-	while (l < len) {
-		log_info("%.8"PRIX64,startaddr + l);
-		for (i=0; i<16; i++) { /* first print it in hex */
-			if (i%4 == 0)
-				log_info(" ");
-			log_info("%02X",*pointer);
-			pointer++;
-		}
-		log_info(" [");
-		for (i=0; i<16; i++) { /* now print it in character format */
-			if ((*ptr2 >=' ') && (*ptr2 <= '~'))
-				log_info("%c",*ptr2);
-			else
-				log_info(".");
-			ptr2++;
-		}
-		log_info("] \n");
-		l+=16;
-	}
-	return (len);
-}
-
-/**
- * rgrplength2bitblocks - blerg - Stolen by Bob from gfs_mkfs.  Good 
- * candidate for gfslib.
- *
- * @sdp:    the superblock
- * @length: the number of blocks in a RG
- *
- * Give a number of blocks in a RG, figure out the number of blocks
- * needed for bitmaps.
- *
- * Returns: the number of bitmap blocks
- */
-
-uint32 rgrplength2bitblocks(struct gfs_sbd *sdp, uint32 length)
-{
-	uint32 bitbytes;
-	uint32 old_blocks = 0, blocks;
-	int tries = 0;
-	
-	for (;;) {
-		bitbytes = (length - old_blocks) / GFS_NBBY;
-		blocks = 1;
-
-		if (bitbytes > sdp->sd_sb.sb_bsize - sizeof(struct gfs_rgrp)) {
-			bitbytes -= sdp->sd_sb.sb_bsize - sizeof(struct gfs_rgrp);
-			blocks += DIV_RU(bitbytes, (sdp->sd_sb.sb_bsize -
-					      sizeof(struct gfs_meta_header)));
-		}
-		if (blocks == old_blocks)
-			break;
-		old_blocks = blocks;
-		if (tries++ > 10) {
-			blocks = 0;
-			break;
-		}
-	}
-	return blocks;
-}
-
-/*
- * ri_cleanup - free up the memory we previously allocated.
- */
-void ri_cleanup(osi_list_t *rglist)
-{
-	struct gfs_rgrpd *rgd;
-
-	while(!osi_list_empty(rglist)){
-		rgd = osi_list_entry(rglist->next, struct gfs_rgrpd, rd_list);
-		if(rgd->rd_bits)
-			free(rgd->rd_bits);
-		if(rgd->rd_bh)
-			free(rgd->rd_bh);
-		osi_list_del((osi_list_t *)&rgd->rd_list);
-		free(rgd);
-	}
-}
-
-/**
- * ri_update - attach rgrps to the super block
- * @sdp:
- *
- * Given the rgrp index inode, link in all rgrps into the super block
- * and be sure that they can be read.
- *
- * Returns: 0 on success, -1 on failure.
- */
-int ri_update(int disk_fd, struct gfs_sbd *sdp)
-{
-	struct gfs_rgrpd *rgd;
-	osi_list_t *tmp;
-	struct gfs_rindex buf;
-	unsigned int rg;
-	int error, count1 = 0, count2 = 0;
-	
-	for (rg = 0; ; rg++) {
-		error = readi(disk_fd, sdp->sd_riinode, (char *)&buf,
-					  rg * sizeof(struct gfs_rindex),
-					  sizeof(struct gfs_rindex));
-		if (!error)
-			break;
-		if (error != sizeof(struct gfs_rindex)){
-			log_err("Unable to read resource group index #%u.\n", rg);
-			goto fail;
-		}
-		rgd = (struct gfs_rgrpd *)malloc(sizeof(struct gfs_rgrpd));
-		// FIXME: handle failed malloc
-		rgd->rd_sbd = sdp;
-		osi_list_add_prev((osi_list_t *)&rgd->rd_list,
-						  (osi_list_t *)&sdp->sd_rglist);
-		gfs_rindex_in(&rgd->rd_ri, (char *)&buf);
-		if(fs_compute_bitstructs(rgd)){
-			goto fail;
-		}
-		rgd->rd_open_count = 0;
-		count1++;
-	}
-	log_debug("%u resource groups found.\n", rg);
-	for (tmp = (osi_list_t *)sdp->sd_rglist.next;
-		 tmp != (osi_list_t *)&sdp->sd_rglist; tmp = tmp->next) {
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-		error = fs_rgrp_read(disk_fd, rgd, FALSE);
-		if (error) {
-			log_err("Unable to read in rgrp descriptor.\n");
-			goto fail;
-		}
-		fs_rgrp_relse(rgd);
-		count2++;
-	}
-	if (count1 != count2) {
-		log_err("Rgrps allocated (%d) does not equal"
-				" rgrps read (%d).\n", count1, count2);
-		goto fail;
-	}
-	sdp->sd_rgcount = count1;
-	return 0;
-
- fail:
-	while(!osi_list_empty((osi_list_t *)&sdp->sd_rglist)){
-		rgd = osi_list_entry((osi_list_t *)sdp->sd_rglist.next,
-							 struct gfs_rgrpd, rd_list);
-		if(rgd->rd_bits)
-			free(rgd->rd_bits);
-		if(rgd->rd_bh)
-			free(rgd->rd_bh);
-		osi_list_del((osi_list_t *)&rgd->rd_list);
-		free(rgd);
-	}
-	return -1;
-}
-
-/**
- * set_block_ranges
- * @sdp: superblock
- *
- * Uses info in rgrps and jindex to determine boundaries of the
- * file system.
- *
- * Returns: 0 on success, -1 on failure
- */
-int set_block_ranges(int disk_fd, struct gfs_sbd *sdp)
-{
-	struct gfs_jindex *jdesc;
-	struct gfs_rgrpd *rgd;
-	struct gfs_rindex *ri;
-	osi_list_t *tmp;
-	char buf[sdp->sd_sb.sb_bsize];
-	uint64 rmax = 0;
-	uint64 jmax = 0;
-	uint64 rmin = 0;
-	uint64 i;
-	int error;
-
-	log_info("Setting block ranges...\n");
-
-	for (tmp = (osi_list_t *)sdp->sd_rglist.next;
-		 tmp != (osi_list_t *)&sdp->sd_rglist; tmp = tmp->next)
-	{
-		rgd = osi_list_entry(tmp, struct gfs_rgrpd, rd_list);
-		ri = &rgd->rd_ri;
-		if (ri->ri_data1 + ri->ri_data - 1 > rmax)
-			rmax = ri->ri_data1 + ri->ri_data - 1;
-		if (!rmin || ri->ri_data1 < rmin)
-			rmin = ri->ri_data1;
-	}
-
-
-	for (i = 0; i < sdp->sd_journals; i++)
-	{
-		jdesc = &sdp->sd_jindex[i];
-
-		if ((jdesc->ji_addr+jdesc->ji_nsegment*sdp->sd_sb.sb_seg_size-1)
-		    > jmax)
-			jmax = jdesc->ji_addr + jdesc->ji_nsegment
-				* sdp->sd_sb.sb_seg_size - 1;
-	}
-
-	sdp->last_fs_block = (jmax > rmax) ? jmax : rmax;
-
-	sdp->last_data_block = rmax;
-	sdp->first_data_block = rmin;
-
-	if(do_lseek(disk_fd, (sdp->last_fs_block * sdp->sd_sb.sb_bsize))){
-		log_crit("Can't seek to last block in file system: %"
-			 PRIu64"\n", sdp->last_fs_block);
-		goto fail;
-	}
-
-	memset(buf, 0, sdp->sd_sb.sb_bsize);
-	error = read(disk_fd, buf, sdp->sd_sb.sb_bsize);
-	if (error != sdp->sd_sb.sb_bsize){
-		log_crit("Can't read last block in file system (%u), "
-			 "last_fs_block: %"PRIu64"\n",
-			 error, sdp->last_fs_block);
-		goto fail;
-	}
-
-	return 0;
-
- fail:
-	return -1;
-}
-
-int write_sb(int disk_fd, struct gfs_sbd *sbp)
-{
-	int error = 0;
-	osi_buf_t *bh;
-
-	error = get_and_read_buf(disk_fd, sbp->sd_sb.sb_bsize,
-							 GFS_SB_ADDR >> sbp->sd_fsb2bb_shift, &bh, 0);
-	if (error){
-		log_crit("Unable to read superblock\n");
-		goto out;
-	}
-
-	memset(BH_DATA(bh), 0, sbp->sd_sb.sb_bsize);
-	gfs_sb_out(&sbp->sd_sb, BH_DATA(bh));
-
-	/* FIXME: Should this set the BW_WAIT flag? */
-	if((error = write_buf(disk_fd, bh, 0))) {
-		stack;
-		goto out;
-	}
-
-	relse_buf(bh);
-out:
-	return error;
-
-}
-
-/**
- * read_super_block
- * @sdp:
- *
- * Returns: 0 on success, -1 on failure
- */
-int read_super_block(int disk_fd, struct gfs_sbd *sdp)
-{
-	uint32_t i;
-
-	sync();
-
-	/********************************************************************
-	 ***************** First, initialize all lists **********************
-	 ********************************************************************/
-	log_info("Initializing lists...\n");
-	osi_list_init((osi_list_t *)&sdp->sd_rglist);
-	for(i = 0; i < FSCK_HASH_SIZE; i++) {
-		osi_list_init(&sdp->dir_hash[i]);
-		osi_list_init(&sdp->inode_hash[i]);
-	}
-
-	/********************************************************************
-	 ************  next, read in on-disk SB and set constants  **********
-	 ********************************************************************/
-	sdp->sd_sb.sb_bsize = 512;
-	if (sdp->sd_sb.sb_bsize < GFS_BASIC_BLOCK)
-		sdp->sd_sb.sb_bsize = GFS_BASIC_BLOCK;
-
-	if(sizeof(struct gfs_sb) > sdp->sd_sb.sb_bsize){
-		log_crit("GFS superblock is larger than the blocksize!\n");
-		log_debug("sizeof(struct gfs_sb) > sdp->sb.sb_bsize\n");
-		return -1;
-	}
-
-	if(read_sb(disk_fd, sdp) < 0){
-		return -1;
-	}
-
-	return 0;
-}
diff --git a/gfs/libgfs/util.c b/gfs/libgfs/util.c
deleted file mode 100644
index 998396b..0000000
--- a/gfs/libgfs/util.c
+++ /dev/null
@@ -1,271 +0,0 @@
-#include "libgfs.h"
-
-/**
- * compute_height
- * @sdp:
- * @sz:
- *
- */
-int compute_height(struct gfs_sbd *sdp, uint64 sz)
-{
-  unsigned int height;
-  uint64 space, old_space;
-  unsigned int bsize = sdp->sd_sb.sb_bsize;
-
-  if (sz <= (bsize - sizeof(struct gfs_dinode)))
-    return 0;
-
-  height = 1;
-  space = sdp->sd_diptrs * bsize;
-
-  while (sz > space)
-  {
-    old_space = space;
-
-    height++;
-    space *= sdp->sd_inptrs;
-
-    if (space / sdp->sd_inptrs != old_space ||
-        space % sdp->sd_inptrs != 0)
-      break;
-  }
-
-  return height;
-}
-
-
-/*
- * check_range - check if blkno is within FS limits
- * @sdp: super block
- * @blkno: block number
- *
- * Returns: 0 if ok, -1 if out of bounds
- */
-int check_range(struct gfs_sbd *sdp, uint64 blkno){
-	if((blkno > sdp->last_fs_block) ||
-	   (blkno < sdp->first_data_block))
-		return -1;
-	return 0;
-}
-
-
-/*
- * set_meta - set the meta header of a buffer
- * @bh
- * @type
- *
- * Returns: 0 if ok, -1 on error
- */
-int set_meta(osi_buf_t *bh, int type, int format){
-  struct gfs_meta_header header;
-
-  if(!check_meta(bh, 0)){
-	  log_debug("Setting metadata\n");
-    ((struct gfs_meta_header *)BH_DATA(bh))->mh_type = cpu_to_gfs32(type);
-    ((struct gfs_meta_header *)BH_DATA(bh))->mh_format = cpu_to_gfs32(format);
-  } else {
-    memset(&header, 0, sizeof(struct gfs_meta_header));
-    header.mh_magic = GFS_MAGIC;
-    header.mh_type = type;
-    header.mh_format = format;
-
-    gfs_meta_header_out(&header, BH_DATA(bh));
-  }
-  return 0;
-}
-
-
-
-
-/*
- * check_meta - check the meta header of a buffer
- * @bh: buffer to check
- * @type: meta type (or 0 if don't care)
- *
- * Returns: 0 if ok, -1 on error
- */
-int check_meta(osi_buf_t *bh, int type){
-  uint32 check_magic = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_magic;
-  uint32 check_metatype = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_type;
- 
-  check_magic = gfs32_to_cpu(check_magic);
-  check_metatype = gfs32_to_cpu(check_metatype);
-  if((check_magic != GFS_MAGIC) || (type && (check_metatype != type))){
-	  log_debug("For %"PRIu64" Expected %X:%X - got %X:%X\n", BH_BLKNO(bh), GFS_MAGIC, type,
-		    check_magic, check_metatype);
-    return -1;
-  }
-  return 0;
-}
-
-/*
- * check_type - check the meta type of a buffer
- * @bh: buffer to check
- * @type: meta type
- *
- * Returns: 0 if ok, -1 on error
- */
-int check_type(osi_buf_t *bh, int type){
-  uint32 check_magic = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_magic;
-  uint32 check_metatype = ((struct gfs_meta_header *)BH_DATA((bh)))->mh_type;
- 
-  check_magic = gfs32_to_cpu(check_magic);
-  check_metatype = gfs32_to_cpu(check_metatype);
-  if((check_magic != GFS_MAGIC) || (check_metatype != type)){
-    return -1;
-  }
-  return 0;
-}
-
-/**
- * next_rg_meta
- * @rgd:
- * @block:
- * @first: if set, start at zero and ignore block
- *
- * The position to start looking from is *block.  When a block
- * is found, it is returned in block.
- *
- * Returns: 0 on success, -1 when finished
- */
-int next_rg_meta(struct gfs_rgrpd *rgd, uint64 *block, int first)
-{
-  struct gfs_bitmap *bits = NULL;
-  uint32 length = rgd->rd_ri.ri_length;
-  uint32 blk = (first)? 0: (uint32)((*block+1)-rgd->rd_ri.ri_data1);
-  int i;
-
-  if(!first && (*block < rgd->rd_ri.ri_data1)){
-    log_err("next_rg_meta:  Start block is outside rgrp bounds.\n");
-    exit(1);
-  }
-
-  for(i=0; i < length; i++){
-    bits = &rgd->rd_bits[i];
-    if(blk < bits->bi_len*GFS_NBBY){
-      break;
-    }
-    blk -= bits->bi_len*GFS_NBBY;
-  }
-
-
-  for(; i < length; i++){
-    bits = &rgd->rd_bits[i];
-
-    blk = fs_bitfit((unsigned char *)BH_DATA(rgd->rd_bh[i]) + bits->bi_offset,
-                    bits->bi_len, blk, GFS_BLKST_USEDMETA);
-
-    if(blk != BFITNOENT){
-	    *block = blk + (bits->bi_start * GFS_NBBY) + rgd->rd_ri.ri_data1;
-	    break;
-    }
-
-    blk=0;
-  }
-
-  if(i == length){
-    return -1;
-  }
-  return 0;
-}
-
-/**
- * next_rg_meta_free - finds free or used metadata
- * @rgd:
- * @block:
- * @first: if set, start at zero and ignore block
- *
- * The position to start looking from is *block.  When a block
- * is found, it is returned in block.
- *
- * Returns: 0 on success, -1 when finished
- */
-int next_rg_meta_free(struct gfs_rgrpd *rgd, uint64 *block, int first, int *mfree)
-{
-  struct gfs_bitmap *bits = NULL;
-  uint32 length = rgd->rd_ri.ri_length;
-  uint32 blk = (first)? 0: (uint32)((*block+1)-rgd->rd_ri.ri_data1);
-  uint32 ublk, fblk;
-  int i;
-
-  if(!first && (*block < rgd->rd_ri.ri_data1)){
-    log_err("next_rg_meta:  Start block is outside rgrp bounds.\n");
-    exit(1);
-  }
-
-  for(i=0; i < length; i++){
-    bits = &rgd->rd_bits[i];
-    if(blk < bits->bi_len*GFS_NBBY){
-      break;
-    }
-    blk -= bits->bi_len*GFS_NBBY;
-  }
-
-
-  for(; i < length; i++){
-    bits = &rgd->rd_bits[i];
-
-    ublk = fs_bitfit((unsigned char *)BH_DATA(rgd->rd_bh[i]) + bits->bi_offset,
-                    bits->bi_len, blk, GFS_BLKST_USEDMETA);
-
-    fblk = fs_bitfit((unsigned char *)BH_DATA(rgd->rd_bh[i]) + bits->bi_offset,
-			     bits->bi_len, blk, GFS_BLKST_FREEMETA);
-    if(ublk < fblk) {
-	    blk = ublk;
-	    *mfree = 0;
-    } else {
-	    blk = fblk;
-	    *mfree = 1;
-    }
-    if(blk != BFITNOENT){
-	    *block = blk + (bits->bi_start * GFS_NBBY) + rgd->rd_ri.ri_data1;
-	    break;
-    }
-
-    blk=0;
-  }
-
-  if(i == length){
-    return -1;
-  }
-  return 0;
-}
-
-/**
- * next_rg_metatype
- * @rgd:
- * @block:
- * @type: the type of metadata we're looking for
- * @first: if set we should start at block zero and block is ignored
- *
- * Returns: 0 on success, -1 on error or finished
- */
-int next_rg_metatype(int disk_fd, struct gfs_rgrpd *rgd, uint64 *block,
-					 uint32 type, int first)
-{
-  struct gfs_sbd *sdp = rgd->rd_sbd;
-  osi_buf_t *bh=NULL;
-
-  do{
-    relse_buf(bh);
-    if(next_rg_meta(rgd, block, first))
-      return -1;
-
-    if (get_and_read_buf(disk_fd, sdp->sd_sb.sb_bsize, *block, &bh, 0)){
-      log_err("next_rg_metatype:  Unable to read meta block "
-	      "#%"PRIu64" from disk\n", *block);
-      exit(1);
-    }
-
-    if(check_meta(bh,0)){
-      log_err("next_rg_metatype:  next_rg_meta returned block #%"PRIu64",\n"
-	      "                   which is not a valid meta block.\n", *block);
-      exit(1);
-    }
-
-    first = 0;
-  } while(check_meta(bh, type));
-  relse_buf(bh);
-
-  return 0;
-}
diff --git a/gfs/man/Makefile b/gfs/man/Makefile
deleted file mode 100644
index 9047b36..0000000
--- a/gfs/man/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-MANTARGET= \
-	gfs.8 \
-	mount.gfs.8 \
-	gfs_edit.8 \
-	fsck.gfs.8 \
-	gfs_grow.8 \
-	gfs_jadd.8 \
-	mkfs.gfs.8 \
-	gfs_quota.8 \
-	gfs_tool.8
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-all:
-
-clean:
diff --git a/gfs/man/fsck.gfs.8 b/gfs/man/fsck.gfs.8
deleted file mode 100644
index 3dd8b85..0000000
--- a/gfs/man/fsck.gfs.8
+++ /dev/null
@@ -1,59 +0,0 @@
-.TH fsck.gfs 8
-
-.SH NAME
-fsck.gfs - Offline GFS file system checker
-
-.SH SYNOPSIS
-.B fsck.gfs
-[\fIOPTION\fR]... \fIDEVICE\fR
-
-.SH WARNING
-All GFS nodes \fImust\fP have the GFS filesystem unmounted before running
-fsck.gfs.  Failure to unmount all nodes may result in filesystem corruption.
-
-.SH DESCRIPTION
-fsck.gfs will check that the GFS file system on a device is structurally valid.
-It should not be run on a mounted file system.  If file system corruption is
-detected, it will attempt to repair the file system.  There is a limit to what
-fsck.gfs can do.  If important file system structures are destroyed, such that
-the checker can not determine what the repairs should be, reparations could
-fail.
-
-GFS is a journaled file system, and as such should be able to repair damages to
-the file system on its own.  However, faulty hardware has the ability to write
-incomplete blocks to a file system thereby causing corruption that GFS can not
-fix.  The first step to ensuring a healthy file system is the selection of
-reliable hardware (i.e. storage systems that will write complete blocks - even
-in the event of power failure).
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Help.
-
-This prints out the proper command line usage syntax.
-.TP
-\fB-q\fP
-Quiet.
-.TP
-\fB-n\fP
-No to all questions.
-
-By specifying this option, fsck.gfs will only show the changes that
-would be made, not make any changes to the filesystem.
-.TP
-\fB-V\fP
-Version.
-
-Print out the current version name.
-.TP
-\fB-v\fP
-Verbose operation.
-
-Print more information while running.
-.TP
-\fB-y\fP
-Yes to all questions.
-
-By specifying this option, fsck.gfs will not prompt before making
-changes.
diff --git a/gfs/man/gfs.8 b/gfs/man/gfs.8
deleted file mode 100644
index f3a579e..0000000
--- a/gfs/man/gfs.8
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH gfs 8
-
-.SH NAME
-gfs \- GFS reference guide
-
-.SH SYNOPSIS
-Overview of manpages and their locations
-
-.SH DESCRIPTION
-The GFS documentation has been split into a number of sections.  Please
-refer to the table below to determine which man page coincides with the
-command/feature you are looking for.
-.TP 16
-gfs
-GFS overview (this man page)
-.TP
-mount.gfs
-Mounting a GFS file system
-.TP
-fsck.gfs
-The GFS file system checker
-.TP
-gfs_grow
-Growing a GFS file system
-.TP
-gfs_jadd
-Adding a journal to a GFS file system
-.TP
-mkfs.gfs
-Make a GFS file system
-.TP
-gfs_quota
-Manipulate GFS disk quotas 
-.TP
-gfs_tool
-Tool to manipulate a GFS file system
-
diff --git a/gfs/man/gfs_edit.8 b/gfs/man/gfs_edit.8
deleted file mode 100644
index 0a53b8b..0000000
--- a/gfs/man/gfs_edit.8
+++ /dev/null
@@ -1 +0,0 @@
-.so man8/gfs2_edit.8
diff --git a/gfs/man/gfs_grow.8 b/gfs/man/gfs_grow.8
deleted file mode 100644
index 5133ec4..0000000
--- a/gfs/man/gfs_grow.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH gfs_grow 8
-
-.SH NAME
-gfs_grow - Expand a GFS filesystem
-
-.SH SYNOPSIS
-.B gfs_grow
-[\fIOPTION\fR]... <\fIDEVICE\fR|\fIMOINTPOINT\fR>...
-
-.SH DESCRIPTION
-gfs_grow is used to expand a GFS filesystem after the device
-upon which the filesystem resides has also been expanded.  By
-running gfs_grow on a GFS filesystem, you are requesting that
-any spare space between the current end of the filesystem and
-the end of the device is filled with a newly initialized GFS
-filesystem extension.  When this operation is complete, the resource
-index for the filesystem is updated so that all nodes in the
-cluster can use the extra storage space which has been added.
-
-You may only run gfs_grow on a mounted filesystem; expansion of 
-unmounted filesystems is not supported.  You only need to
-run gfs_grow on one node in the cluster.  All the other nodes will
-see the expansion has occurred and automatically start to use the
-newly available space.
-
-You must be superuser to execute \fBgfs_grow\fP.  The gfs_grow
-tool tries to prevent you from corrupting your filesystem by checking as
-many of the likely problems as it can.  When expanding a filesystem,
-only the last step of updating the resource index affects the currently
-mounted filesystem and so failure part way through the expansion process
-should leave your filesystem in its original unexpanded state.
-
-You can run gfs_grow with the \fB-Tv\fP flags to get a display
-of the current state of a mounted GFS filesystem.  This can be useful
-to do after the expansion process to see if the changes have been 
-successful.
-
-\fBgfs_grow\fP will consume all the remaining space in a device and add
-it to the filesystem.  If you want to add journals too, you need to add
-the journals first using \fBgfs_jadd\fP.
-
-.SH OPTIONS
-.TP 
-\fB-h\fP
-Prints out a short usage message and exits.
-.TP
-\fB-q\fP
-Quiet. Turns down the verbosity level.
-.TP
-\fB-T\fP
-Test. Do all calculations, but do not write any data to the disk and do
-not expand the filesystem. This is used to discover what the tool would
-have done were it run without this flag. You probably want to turn the
-verbosity level up in order to gain most information from this option.
-.TP
-\fB-V\fP
-Version. Print out version information, then exit.
-.TP
-\fB-v\fP
-Verbose. Turn up verbosity of messages.
-
-.SH SEE ALSO
-mkfs.gfs(8) gfs_jadd(8)
diff --git a/gfs/man/gfs_jadd.8 b/gfs/man/gfs_jadd.8
deleted file mode 100644
index 24804e0..0000000
--- a/gfs/man/gfs_jadd.8
+++ /dev/null
@@ -1,75 +0,0 @@
-.TH gfs_jadd 8
-
-.SH NAME
-gfs_jadd \- Add journals to a GFS filesystem
-
-.SH SYNOPSIS
-.B gfs_jadd
-[\fIOPTION\fR]... <\fIDEVICE\fR|\fIMOINTPOINT\fR>...
-
-.SH DESCRIPTION
-\fIgfs_jadd\fR is used to add journals to a GFS filesystem after
-the device upon which the filesystem resides has been grown.
-By running \fIgfs_jadd\fR
-on a GFS filesystem, you are filling in space between the current end
-of the filesystem and the end of the device upon which the filesystem
-resides.  When this operation
-is complete, the journal index is updated so that machines mounting the
-filesystem at a later date will see the newly created journals in
-addition to the journals already there. Machines which are already running
-in the cluster are unaffected.
-
-\fIgfs_jadd\fR will not use space that has been formatted for filesystem data even if that space has never been populated with files.
-
-You may only run \fIgfs_jadd\fR on a mounted filesystem, addition of journals to 
-unmounted filesystems is not supported.  
-You only need to run \fIgfs_jadd\fR
-on one node in the cluster. All the other nodes will see the expansion
-has occurred when required.
-
-You must be superuser to execute \fIgfs_jadd\fR. The
-\fIgfs_jadd\fR
-tool tries to prevent you from corrupting your filesystem by checking as
-many of the likely problems as it can. When growing a filesystem,
-only the last step of updating the journal index affects the currently
-mounted filesystem and so failure part way through the expansion process
-should leave your filesystem in its original state.
-
-You can run \fIgfs_jadd\fR with the \fI-Tv\fR
-flags to get a display of the current state of a mounted GFS filesystem.
-This can be useful to do after the journal addition process to see if the
-changes have been successful.
-
-.SH OPTIONS
-.TP
-\fB-j num\fP
-The number of new journals to add. This defaults to 1.
-.TP
-\fB-J size\fP
-The size of the new journals in megabytes. The defaults to 128MB (the
-minimum size allowed is 32MB). If you want to add journals of different
-sizes to the filesystem, you'll need to run gfs_jadd once for each
-different size of journal. The size you specify here will be rounded
-down so that it is a multiple of the journal segment size which was
-specified at filesystem creation time.
-.TP
-\fB-h\fP
-Help. Prints out a short usage message and exits.
-.TP
-\fB-q\fP
-Quiet. Turns down the verbosity level.
-.TP
-\fB-T\fP
-Test. Do all calculations, but do not write any data to the disk and do
-not add journals. This is used to discover what the tool would
-have done were it run without this flag. You probably want to turn the
-verbosity level up in order to gain most information from this option.
-.TP
-\fB-V\fP
-Version. Print version information, then exit.
-.TP
-\fB-v\fP
-Verbose. Turn up verbosity of messages.
-
-.SH SEE ALSO
-mkfs.gfs(8) gfs_grow(8)
diff --git a/gfs/man/gfs_quota.8 b/gfs/man/gfs_quota.8
deleted file mode 100644
index bc905ac..0000000
--- a/gfs/man/gfs_quota.8
+++ /dev/null
@@ -1,101 +0,0 @@
-.TH gfs_quota 8
-
-.SH NAME
-gfs_quota - Manipulate GFS disk quotas
-
-.SH SYNOPSIS
-.B gfs_quota
-<list|sync|get|limit|warn|check|init> [\fIOPTION\fR]...
-
-.SH DESCRIPTION
-gfs_quota is used to examine and change quota values in a GFS filesystem.
-This command has a number of different actions.
-
-.SH ACTIONS
-.TP
-\fBlist\fP
-List the contents of the quota file.  Only IDs that have a non-zero hard limit,
-warn limit, or value are printed.
-.TP
-\fBsync\fP
-Sync any local quota changes to the quota file.
-.TP
-\fBget\fP
-Get the current data for the ID specified by the -u or -g argument.
-.TP
-\fBlimit\fP
-Set the current hard limit for the ID specified by the -u or -g argument to 
-the value specified by the -l argument on the specified filesystem.
-The filesystem won't let the user or group use more than this much space.
-A value of zero here means that no limit is enforced.
-.TP
-\fBwarn\fP
-Set the current warn limit for the ID specified by the -u or -g argument to 
-the value specified by the -l argument on the specified filesystem.
-The filesystem will start complaining to the user or group when more
-than this much space is used.  A value of zero here means that the
-user won't ever be warned.
-.TP
-\fBcheck\fP
-Scan a filesystem and make sure that what's out there on the disk matches
-what's in the quota file.  This is only accurate if the filesystem is
-idle when this is running.  If there is a mismatch, it is printed to
-stdout.  Note: GFS quotas are transactional and a quota check is \fBnot\fP
-needed every time there is a system crash.
-.TP
-\fBinit\fP
-Scan a filesystem and initialize the quota file with the values obtained
-from the scan.  The filesystem should be idle when this is run.  You should
-only need to do this if you upgrade a pre-quota GFS filesystem (pre-GFS 5.1).
-
-.SH OPTIONS
-\fB-b\fP
-The units for disk space are filesystem blocks.
-.TP
-\fB-d\fP
-Don't include the space allocated to GFS' hidden files in
-what's reported for the root UID and GID values.  This is useful
-if you're trying to get the numbers reported by gfs_quota to match
-up with the numbers reported by du.
-.TP
-\fB-f\fP \fIDirectory\fR 
-Specifies which filesystem to perform the action on.
-.TP
-\fB-g\fP \fIGID\fR 
-Specifies the group ID for get, limit, or warn.  It can be either
-the group name from the group file, or the GID number.
-.TP
-\fB-h\fP
-Print  out  a  help  message  describing  available
-options, then exit.
-.TP
-\fB-k\fP
-The units for disk space are kilobytes.
-.TP
-\fB-l\fP \fISize\fR 
-Specifies the new value for the limit or warn actions.
-The value is assumed to be in the units specified by the
--m, -k, -s, -b arguments.  The default is megabytes.
-.TP
-\fB-m\fP
-The units for disk space are megabytes.  This is the default.
-.TP
-\fB-n\fP
-Don't try to resolve UIDs and GIDs into user and group names.
-.TP
-\fB-s\fP
-The units for disk space are sectors (512-byte blocks).
-.TP
-\fB-u\fP \fIUID\fR 
-Specifies the user ID for get, limit, or warn.  It can be either
-the username from the password file, or the UID number.
-.TP
-\fB-V\fP
-Print program version information, then exit.
-
-.SH EXAMPLE
-To set the hard limit for user "nobody" to
-1048576 kilobytes on filesystem /gfs0
-
-gfs_quota limit -l 1048576 -k -u nobody -f /gfs0
-
diff --git a/gfs/man/gfs_tool.8 b/gfs/man/gfs_tool.8
deleted file mode 100644
index 7cefdc2..0000000
--- a/gfs/man/gfs_tool.8
+++ /dev/null
@@ -1,145 +0,0 @@
-.TH gfs_tool 8
-
-.SH NAME
-gfs_tool - interface to gfs ioctl calls
-
-.SH SYNOPSIS
-.B gfs_tool
-\fICOMMAND\fR [\fIOPTION\fR] [\fIPARAMETERS ...\fR]
-
-.SH DESCRIPTION
-gfs_tool is an interface to a variety of the GFS ioctl calls.
-.TP
-Specifying gfs_tool -h prints gfs_tool command line usage (help).
-.TP
-Specifying gfs_tool -V prints the gfs_tool version information.
-.SH COMMANDS
-.TP
-\fBclearflag\fP \fIFlag\fR \fIFile1\fR \fIFile2\fR \fI...\fR 
-Clear an attribute flag on a file.
-.TP
-\fBcounters\fP \fIMountPoint\fR [-c] [-i \fIinterval\fR]
-Print out statistics about a filesystem.  If -c is specified, gfs_tool
-keeps running printing out the statistics once per second or, if
-specified, the interval given with the -i option, in seconds.
-.TP
-\fBdf\fP \fIMountPoint\fR [-k]|[-H]
-Print out a space usage summary of a given filesystem.  The information
-printed is more detailed than a standard "df".  If -k is specified, the
-output is given in kilobytes (KB).  If -H is specified, the output is
-given in human readable format (similar to df -h).  If neither -k nor -H
-are specified, the output is given in file system blocks.
-
-.TP
-\fBfreeze\fP \fIMountPoint\fR
-Freeze (quiesce) a GFS cluster.
-.TP
-\fBgetsb\fP \fIMountPoint\fR
-Print out the superblock of a mounted filesystem.
-.TP
-\fBgettune\fP \fIMountPoint\fR
-Print out the current values of the tuning parameters in a running
-filesystem.
-.TP
-\fBjindex\fP \fIMountPoint\fR
-Print out the journal index of a mounted filesystem.
-.TP
-\fBlayout\fP \fIFile\fR \fI[buffersize]\fR
-Print out on-disk layout information about a file or directory.
-Buffersize is the size of the buffer (in bytes) that gfs_tool allocates
-to store the file's metadata during processing.  It defaults to 4194304
-bytes.  If you are printing a very big directory you may need to specify
-a bigger size.
-.TP
-\fBlist\fP
-List the currently mounted GFS filesystems.  Each line represents
-a filesystem.  The columns represent (in order): 1) A number that
-is a cookie that represents the mounted filesystem. 2) The name of the
-device that holds the filesystem (well, the name as the Linux
-kernel knows it). 3) The lock table field that the filesystem was
-mounted with.
-.TP
-\fBlockdump\fP \fIMountPoint\fR \fI[buffersize]\fR
-Print out information about the locks this machine holds for a given
-filesystem. Buffersize is the size of the buffer (in bytes) that gfs_tool
-allocates to store the lock data during processing.  It defaults to 4194304
-bytes.
-.TP
-\fBmargs\fP \fIarguments\fR
-This loads arguments into the module what will override the mount
-options passed with the -o field on the next mount.  See mount.gfs(8).
-.TP
-\fBreclaim\fP \fIFile\fR
-Returns unused on-disk metadata blocks to free blocks.
-.TP
-\fBrindex\fP \fIMountPoint\fR
-Print out the resource group index of a mounted filesystem.
-.TP
-\fBquota\fP \fIMountPoint\fR
-Print out the quota file of a mounted filesystem.  Also see
-the "gfs_quota list" command.
-.TP
-\fBsb\fP \fIdevice\fR \fBproto\fP \fI[newvalue]\fR
-View (and possibly replace) the name of the locking protocol in the
-file system superblock.  The file system shouldn't be mounted by any
-client when you do this.
-.TP
-\fBsb\fP \fIdevice\fR \fBtable\fP \fI[newvalue]\fR
-View (and possibly replace) the name of the locking table in the
-file system superblock.  The file system shouldn't be mounted by any
-client when you do this.
-.TP
-\fBsb\fP \fIdevice\fR \fBondisk\fP \fI[newvalue]\fR
-View (and possibly replace) the ondisk format number in the
-file system superblock.  The file system shouldn't be mounted by any
-client when you do this.  No one should have to use this.
-.TP
-\fBsb\fP \fIdevice\fR \fBmultihost\fP \fI[newvalue]\fR
-View (and possibly replace) the multihost format number in the
-file system superblock.  The file system shouldn't be mounted by any
-client when you do this.  No one should have to use this.
-.TP
-\fBsb\fP \fIdevice\fR \fBall\fP
-Print out the superblock.
-.TP
-\fBsetflag\fP \fIFlag\fR \fIFile1\fR \fIFile2\fR \fI...\fR 
-Set an attribute flag on a file.  There are four currently
-supported flags.  They are jdata, directio, inherit_jdata, and
-inherit_directio.
-  
-The \fIjdata\fR flag causes all the data written to a regular file
-to be journaled. The jdata flag can only be set (or cleared) if the file
-is zero length.
-
-The \fIdirectio\fR flag causes all I/O to a regular file to be Direct
-I/O, even if the O_DIRECT flag isn't used on the open() command.
-
-The \fIinherit_jdata\fR flag is set on a directory.  It causes all new
-regular files created in that directory automatically inherit the
-\fIjdata\fR flag.  The \fIinherit_jdata\fR is also inherited by any new
-subdirectories created in that directory.
-
-The \fIinherit_directio\fR flag is set on a directory.  It causes all new
-regular files created in that directory automatically inherit the
-\fIdirectio\fR flag.  The \fIinherit_directio\fR is also inherited by
-any new subdirectories created in that directory.
-.TP
-\fBsettune\fP \fIMountPoint\fR \fIparameter\fR \fInewvalue\fR
-Set the value of tuning parameter.  Use \fBgettune\fP for a listing of 
-tunable parameters.
-.TP
-\fBshrink\fP \fIMountPoint\fR
-Causes any unused inodes to be thrown out of memory.
-.TP
-\fBstat\fP \fIFile\fR
-Print out extended stat information about a file.
-.TP
-\fBunfreeze\fP \fIMountPoint\fR
-Unfreeze a GFS cluster.
-.TP
-\fBversion\fP
-Print out the version of GFS that this program goes with.
-.TP
-\fBwithdraw\fP \fIMountPoint\fR
-Cause GFS to abnormally shutdown a given filesystem on this node.
-
diff --git a/gfs/man/mkfs.gfs.8 b/gfs/man/mkfs.gfs.8
deleted file mode 100644
index 9176ea7..0000000
--- a/gfs/man/mkfs.gfs.8
+++ /dev/null
@@ -1,82 +0,0 @@
-.TH mkfs.gfs 8
-
-.SH NAME
-mkfs.gfs - Make a GFS filesystem
-
-.SH SYNOPSIS
-.B mkfs.gfs
-[\fIOPTION\fR]... \fIDEVICE\fR
-
-.SH DESCRIPTION
-mkfs.gfs is used to create a Global File System.
-
-.SH OPTIONS
-.TP
-\fB-b\fP \fIBlockSize\fR 
-Set the filesystem block size to \fIBlockSize\fR (must be a power of
-two).  The minimum block size is 512.  The FS block size cannot exceed
-the machine's memory page size.  On the most architectures (i386,
-x86_64, s390, s390x), the memory page size is 4096 bytes.  On other
-architectures it may be bigger.  The default block size is 4096 bytes.
-In general, GFS filesystems should not deviate from the default value.
-.TP
-\fB-D\fP
-Enable debugging output.
-.TP
-\fB-h\fP
-Print  out  a  help  message  describing  available
-options, then exit.
-.TP
-\fB-J\fP \fIMegaBytes\fR 
-The size of the journals in Megabytes. The default journal size is 
-128 megabytes.  The minimum size is 32 megabytes.
-.TP
-\fB-j\fP \fINumber\fR 
-The number of journals for mkfs.gfs to create.  You need at least one
-journal per machine that will mount the filesystem.
-.TP
-\fB-O\fP
-This option prevents mkfs.gfs from asking for confirmation before writing
-the filesystem.
-.TP
-\fB-p\fP \fILockProtoName\fR 
-LockProtoName is the name of the  locking  protocol to use.  The locking
-protocol should be \fIlock_dlm\fR for a clustered file system or if you 
-are using GFS as a local filesystem (\fB1 node only\fP), you can specify the
-\fIlock_nolock\fR protocol.
-.TP
-\fB-q\fP
-Be quiet.  Don't print anything.
-.TP
-\fB-r\fP \fIMegaBytes\fR
-mkfs.gfs will try to make Resource Groups (RGs) about this big.
-Minimum RG size is 32 MB.  Maximum RG size is 2048 MB.
-A large RG size may increase performance on very large file systems.
-If not specified, mkfs.gfs will choose the RG size based on the size
-of the file system: average size file systems will have 256 MB RGs, and
-bigger file systems will have bigger RGs for better performance.
-.TP
-\fB-s\fP \fIBlocks\fR 
-Journal segment size in filesystem blocks.  This value must be at
-least two and not large enough to produce a segment size greater than
-4MB.
-.TP
-\fB-t\fP \fILockTableName\fR 
-The lock table field appropriate to the lock module you're using.
-It is \fIclustername:fsname\fR.
-Clustername must match that in cluster.conf; only members of this
-cluster are permitted to use this file system.
-Fsname is a unique file system name used to distinguish this GFS file
-system from others created (1 to 16 characters).  Lock_nolock doesn't
-use this field.
-.TP
-\fB-V\fP
-Print program version information, then exit.
-
-.SH EXAMPLE
-.TP
-mkfs.gfs -t mycluster:mygfs -p lock_dlm -j 2 /dev/vg0/mygfs
-This will make a Global File System on the block device
-"/dev/vg0/mygfs".  It will belong to "mycluster" and register itself
-as wanting locking for "mygfs".  It will use DLM for locking and make
-two journals.
diff --git a/gfs/man/mount.gfs.8 b/gfs/man/mount.gfs.8
deleted file mode 100644
index 5975c13..0000000
--- a/gfs/man/mount.gfs.8
+++ /dev/null
@@ -1,193 +0,0 @@
-.TH mount.gfs 8
-
-.SH NAME
-mount.gfs - GFS mount options
-
-.SH SYNOPSIS
-.B mount
-[\fIStandardMountOptions\fR] \fB-t\fP gfs \fIDEVICE\fR \fIMOUNTPOINT\fR \fB-o\fP [GFSOption1,GFSOption2,GFSOptionX...]
-
-.SH DESCRIPTION
-GFS may be used as a local (single computer) filesystem, but its real purpose
-is in clusters, where multiple computers (nodes) share a common storage device.
-
-Above is the format typically used to mount a GFS filesystem, using the
-\fBmount\fP(8) command.  The \fIdevice\fR may be any block device on which you
-have created a GFS filesystem.  Examples include a
-single disk partition (e.g. /dev/sdb3), a loopback device, a device exported
-from another node (e.g. an iSCSI device or a \fBgnbd\fP(8) device), or a
-logical volume (typically comprised of a number of individual disks).
-
-\fIdevice\fR does not necessarily need to match the device name as seen on
-another node in the cluster, nor does it need to be a logical volume.  However,
-the use of a cluster-aware volume manager such as CLVM2 (see \fBlvm\fP(8))
-will guarantee that the managed devices are named identically on each node in a
-cluster (for much easier management), and will allow you to configure a very
-large volume from multiple storage units (e.g. disk drives).
-
-\fIdevice\fR must make the entire filesystem storage area visible to the
-computer.  That is, you cannot mount different parts of a single filesystem on
-different computers.  Each computer must see an entire filesystem.  You
-may, however, mount several GFS filesystems if you want to distribute your
-data storage in a controllable way.
-
-\fImountpoint\fR is the same as \fIdir\fR in the \fBmount\fP(8) man page.
-
-This man page describes GFS-specific options that can be passed to the GFS 
-file system at mount time, using the \fB-o\fP flag.  There are many other
-\fB-o\fP options handled by the generic mount command \fBmount\fP(8).
-However, the options described below are specifically for GFS, and are not
-interpreted by the mount command nor by the kernel's Virtual File System.  GFS
-and non-GFS options may be intermingled after the \fB-o\fP, separated by
-commas (but no spaces).
-
-As an alternative to mount command line options, you may send mount
-options to gfs using "gfs_tool margs" (after loading the gfs kernel
-module, but before mounting GFS).  For example, you may need to do
-this when working from an initial ramdisk \fBinitrd\fP(4).  The
-options are restricted to the ones described on this man page (no
-general \fBmount\fP(8) options will be recognized), must not be
-preceded by -o, and must be separated by commas (no spaces).  Example:
-
-# gfs_tool margs "lockproto=lock_nolock,ignore_local_fs"
-
-Options loaded via "gfs_tool margs" have a lifetime of only one GFS
-mount.  If you wish to mount another GFS filesystem, you must set
-another group of options with "gfs_tool margs".
-
-If you have trouble mounting GFS, check the syslog (e.g. /var/log/messages)
-for specific error messages.
-
-.SH OPTIONS
-.TP
-\fBlockproto=\fP\fILockModuleName\fR
-This specifies which inter-node lock protocol is used by the GFS filesystem
-for this mount, overriding the default lock protocol name stored in the
-filesystem's on-disk superblock.
-
-The \fILockModuleName\fR must be an exact match of the protocol name presented
-by the lock module when it registers with the lock harness.  Traditionally,
-this matches the .o filename of the lock module, e.g. \fIlock_dlm\fR,
-or \fIlock_nolock\fR.
-
-The default lock protocol name is written to disk initially when creating the
-filesystem with \fBmkfs.gfs\fP(8), -p option.  It can be changed on-disk by
-using the \fBgfs_tool\fP(8) utility's \fBsb proto\fP command.
-
-The \fBlockproto\fP mount option should be used only under special
-circumstances in which you want to temporarily use a different lock protocol
-without changing the on-disk default.
-.TP
-\fBlocktable=\fP\fILockTableName\fR
-This specifies the identity of the cluster and of the filesystem for this
-mount, overriding the default cluster/filesystem identify stored in the
-filesystem's on-disk superblock.  The cluster/filesystem name is recognized
-globally throughout the cluster, and establishes a unique namespace for
-the inter-node locking system, enabling the mounting of multiple GFS
-filesystems.
-
-The format of \fILockTableName\fR is lock-module-specific.  For
-lock_dlm, the format is \fIclustername:fsname\fR.  For
-lock_nolock, the field is ignored.
-
-The default cluster/filesystem name is written to disk initially when creating
-the filesystem with \fBmkfs.gfs\fP(8), -t option.  It can be changed on-disk
-by using the \fBgfs_tool\fP(8) utility's \fBsb table\fP command.
-
-The \fBlocktable\fP mount option should be used only under special
-circumstances in which you want to mount the filesystem in a different cluster,
-or mount it as a different filesystem name, without changing the on-disk
-default.
-.TP
-\fBlocalcaching\fP
-This flag tells GFS that it is running as a local (not clustered) filesystem,
-so it can turn on some block caching optimizations that can't be used when
-running in cluster mode.
-
-This is turned on automatically by the lock_nolock module,
-but can be overridden by using the \fBignore_local_fs\fP option.
-.TP
-\fBlocalflocks\fP
-This flag tells GFS that it is running as a local (not clustered) filesystem,
-so it can allow the kernel VFS layer to do all flock and fcntl file locking.
-When running in cluster mode, these file locks require inter-node locks,
-and require the support of GFS.  When running locally, better performance
-is achieved by letting VFS handle the whole job.
-
-This is turned on automatically by the lock_nolock module,
-but can be overridden by using the \fBignore_local_fs\fP option.
-.TP
-\fBoopses_ok\fP
-Normally, GFS automatically turns on the "kernel.panic_on_oops"
-sysctl to cause the machine to panic if an oops (an in-kernel
-segfault or GFS assertion failure) happens.  An oops on one machine of
-a cluster filesystem can cause the filesystem to stall on all machines
-in the cluster.  (Panics don't have this "feature".)  By turning on
-"panic_on_oops", GFS tries to make sure the cluster remains in
-operation even if one machine has a problem.  There are cases,
-however, where this behavior is not desirable -- debugging being
-the main one.  The \fBoopses_ok\fP option causes GFS to leave the
-"panic_on_oops" variable alone so oopses can happen.  Use this option
-with care.
-
-This is turned on automatically by the lock_nolock module,
-but can be overridden by using the \fBignore_local_fs\fP option.
-.TP
-\fBignore_local_fs\fP
-By default, using the nolock lock module automatically turns on the
-\fBlocalcaching\fP and \fBlocalflocks\fP optimizations.  \fBignore_local_fs\fP
-forces GFS to treat the filesystem as if it were a multihost (clustered)
-filesystem, with \fBlocalcaching\fP and \fBlocalflocks\fP optimizations
-turned off.
-.TP
-\fBupgrade\fP
-This flag tells GFS to upgrade the filesystem's on-disk format to the version
-supported by the current GFS software installation on this computer.
-If you try to mount an old-version disk image, GFS will notify you via a syslog
-message that you need to upgrade.  Try mounting again, using the
-\fB-o upgrade\fP option.  When upgrading, only one node may mount the GFS
-filesystem.
-.TP
-\fBnum_glockd\fP
-Tunes GFS to alleviate memory pressure when rapidly acquiring many locks (e.g.
-several processes scanning through huge directory trees).  GFS' glockd kernel
-daemon cleans up memory for no-longer-needed glocks.  Multiple instances
-of the daemon clean up faster than a single instance.  The default value is
-one daemon, with a maximum of 32.  Since this option was introduced, other
-methods of rapid cleanup have been developed within GFS, so this option may go
-away in the future.
-.TP
-\fBacl\fP
-Enables POSIX Access Control List \fBacl\fP(5) support within GFS.
-.TP
-\fBspectator\fP
-Mount this filesystem using a special form of read-only mount.  The mount
-does not use one of the filesystem's journals.
-.TP
-\fBsuiddir\fP
-Sets owner of any newly created file or directory to be that of parent
-directory, if parent directory has S_ISUID permission attribute bit set.
-Sets S_ISUID in any new directory, if its parent directory's S_ISUID is set.
-Strips all execution bits on a new file, if parent directory owner is different
-from owner of process creating the file.  Set this option only if you know
-why you are setting it.
-
-.SH LINKS
-.TP 30
-http://sources.redhat.com/cluster
--- home site of GFS
-.TP
-http://www.suse.de/~agruen/acl/linux-acls/
--- good writeup on ACL support in Linux
-
-.SH SEE ALSO
-
-\fBgfs\fP(8), 
-\fBmount\fP(8) for general mount options,
-\fBchmod\fP(1) and \fBchmod\fP(2) for access permission flags,
-\fBacl\fP(5) for access control lists,
-\fBlvm\fP(8) for volume management,
-\fBccs\fP(7) for cluster management,
-\fBumount\fP(8),
-\fBinitrd\fP(4).
-
diff --git a/gfs/tests/Makefile b/gfs/tests/Makefile
deleted file mode 100644
index 5b2e7c0..0000000
--- a/gfs/tests/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS=filecon2 mmdd
diff --git a/gfs/tests/filecon2/Makefile b/gfs/tests/filecon2/Makefile
deleted file mode 100644
index d443a70..0000000
--- a/gfs/tests/filecon2/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-TARGETS= filecon2_server filecon2_client
-
-all: $(TARGETS)
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-
-CFLAGS += -O3
-CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-CFLAGS += -I../../include
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-%: %.o
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
diff --git a/gfs/tests/filecon2/filecon2.h b/gfs/tests/filecon2/filecon2.h
deleted file mode 100644
index 96e03b7..0000000
--- a/gfs/tests/filecon2/filecon2.h
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef __FILECON2_DOT_H__
-#define __FILECON2_DOT_H__
-
-
-
-/*  Extern Macro  */
-
-#ifndef EXTERN
-#define EXTERN extern
-#define INIT(X)
-#else
-#undef EXTERN
-#define EXTERN
-#define INIT(X) =X 
-#endif
-
-
-
-#define die(fmt, args...) \
-do \
-{ \
-  fprintf(stderr, "%s: ", prog_name); \
-  fprintf(stderr, fmt, ##args); \
-  exit(EXIT_FAILURE); \
-} \
-while (0)
-
-#define type_zalloc(ptr, type, count) \
-do \
-{ \
-  (ptr) = (type *)malloc(sizeof(type) * (count)); \
-  if ((ptr)) \
-    memset((char *)(ptr), 0, sizeof(type) * (count)); \
-  else \
-    die("unable to allocate memory on line %d of file %s\n", \
-        __LINE__, __FILE__); \
-} \
-while (0)
-
-#define type_alloc(ptr, type, count) \
-do \
-{ \
-  (ptr) = (type *)malloc(sizeof(type) * (count)); \
-  if (!(ptr)) \
-    die("unable to allocate memory on line %d of file %s\n", \
-        __LINE__, __FILE__); \
-} \
-while (0)
-
-#define do_lseek(fd, off) \
-do \
-{ \
-  if (lseek((fd), (off), SEEK_SET) != (off)) \
-    die("bad seek: %s on line %d of file %s\n", \
-        strerror(errno),__LINE__, __FILE__); \
-} \
-while (0)
-
-#define do_read(fd, buf, len) \
-do \
-{ \
-  int do_read_out; \
-  do_read_out = read((fd), (buf), (len)); \
-  if (do_read_out != (len)) \
-    die("bad read: result = %d (%s) on line %d of file %s\n", \
-        do_read_out, strerror(errno), __LINE__, __FILE__); \
-} \
-while (0)
-
-#define do_write(fd, buf, len) \
-do \
-{ \
-  int do_write_out; \
-  do_write_out = write((fd), (buf), (len)); \
-  if (do_write_out != (len)) \
-    die("bad write: result = %d (%s) on line %d of file %s\n", \
-        do_write_out, strerror(errno), __LINE__, __FILE__); \
-} \
-while (0)
-
-#define do_ftruncate(fd, off) \
-do \
-{ \
-  if (ftruncate((fd), (off)) < 0) \
-    die("bad truncate: %s on line %d of file %s\n", \
-	strerror(errno), __LINE__, __FILE__); \
-} \
-while (0)
-
-#define RAND(x) ((x) * (random() / (RAND_MAX + 1.0)))
-
-#define DIV_RU(x, y) (((x) + (y) - 1) / (y))
-
-
-
-#define FILECON2_PORT       (12046)
-#define FILECON2_MAGIC      (0x76543210)
-
-#define FCR_READ_BUFFERED   (16241)
-#define FCR_READ_DIRECT     (16242)
-#define FCR_READ_MMAPPED    (16243)
-#define FCR_WRITE_BUFFERED  (16244)
-#define FCR_WRITE_DIRECT    (16245)
-#define FCR_WRITE_MMAPPED   (16246)
-#define FCR_TRUNC           (16247)
-#define FCR_NOP             (16248)
-#define FCR_SEED            (16249)
-#define FCR_STOP            (16250)
-
-struct filecon2_request
-{
-  uint32 magic;
-  uint32 type;
-  uint32 length;
-  uint32 data;
-  uint64 offset;
-};
-typedef struct filecon2_request filecon2_request_t;
-
-static __inline__ void request_in(filecon2_request_t *req, char *buf)
-{
-  filecon2_request_t *str = (filecon2_request_t *)buf;
-  req->magic = be32_to_cpu(str->magic);
-  req->type = be32_to_cpu(str->type);
-  req->length = be32_to_cpu(str->length);
-  req->data = be32_to_cpu(str->data);
-  req->offset = be64_to_cpu(str->offset);
-}
-
-static __inline__ void request_out(filecon2_request_t *req, char *buf)
-{
-  filecon2_request_t *str = (filecon2_request_t *)buf;
-  str->magic = cpu_to_be32(req->magic);
-  str->type = cpu_to_be32(req->type);
-  str->length = cpu_to_be32(req->length);
-  str->data = cpu_to_be32(req->data);
-  str->offset = cpu_to_be64(req->offset);
-}
-
-
-EXTERN char *prog_name;
-EXTERN pid_t pid;
-
-
-#endif  /*  __FILECON2_DOT_H__  */
-
diff --git a/gfs/tests/filecon2/filecon2_client.c b/gfs/tests/filecon2/filecon2_client.c
deleted file mode 100644
index a2196c6..0000000
--- a/gfs/tests/filecon2/filecon2_client.c
+++ /dev/null
@@ -1,841 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#include "global.h"
-#include "linux_endian.h"
-#define EXTERN
-#include "filecon2.h"
-
-
-
-#ifndef O_DIRECT
-#define O_DIRECT (0)
-#warning O_DIRECT is broken
-#endif
-#ifndef PAGE_SIZE
-#define PAGE_SIZE (65536)
-#endif
-
-#define CHANCES (8)
-
-#define PATTERN_RAND      (12341)
-#define PATTERN_OPNUM     (12342)
-
-
-
-struct operation
-{
-  char *name;
-  void (*func)();
-};
-typedef struct operation operation_t;
-
-
-
-unsigned int port = FILECON2_PORT;
-unsigned int seed = 0;
-uint64 offset = 0;
-uint64 length = 1048576;
-uint32 chunk = 1024;
-unsigned int pattern = PATTERN_RAND;
-int buffered = FALSE;
-int direct = FALSE;
-int mmapped = FALSE;  
-int trunc = FALSE;
-int nop = FALSE;
-unsigned int align = 1;
-int reread = FALSE;
-int respect_eof = FALSE;
-int check_file_size = FALSE;
-int verbose = FALSE;
-char *servername = NULL;
-char *filename = NULL;
-
-int user_seed = FALSE;
-int fd_b = -1, fd_d = -1;
-int sock;
-
-int first = FALSE;
-unsigned char *mmap_data = NULL;
-
-uint64 file_size;
-unsigned int opnum;
-
-float chances[CHANCES];
-
-
-
-
-
-void rand_extent(uint64 *o, uint32 *l)
-{
-  uint64 off;
-  uint32 len;
-
-  if (align > 1)
-  {
-    do
-    {
-      off = RAND(length / align);
-      len = RAND(chunk / align) + 1;
-      off *= align;
-      len *= align;
-    }
-    while (off + len > length);
-  }
-  else
-  {
-    do
-    {
-      off = RAND(length);
-      len = RAND(chunk) + 1;
-    }
-    while (off + len > length);
-  }
-
-  *o = off;
-  *l = len;
-}
-
-
-void fill_pattern(unsigned char *data, unsigned int len)
-{
-  unsigned int x;
-
-  switch (pattern)
-  {
-  case PATTERN_RAND:
-    while (len--)
-      *data++ = RAND(256);
-    break;
-
-  case PATTERN_OPNUM:
-    x = cpu_to_be32(opnum);
-    while (len)
-    {
-      if (len > sizeof(unsigned int))
-      {
-	memcpy(data, &x, sizeof(unsigned int));
-	data += sizeof(unsigned int);
-	len -= sizeof(unsigned int);
-      }
-      else
-      {
-	memcpy(data, &x, len);
-	break;
-      }
-    }
-    break;
-
-  default:
-    die("unknown pattern\n");
-  }
-}
-
-
-void do_first()
-{
-  filecon2_request_t req;
-  unsigned char data[sizeof(filecon2_request_t) + 1];
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_WRITE_BUFFERED;
-  req.length = 1;
-  req.data = 1;
-  req.offset = offset + length - 1;
-
-  fill_pattern(data + sizeof(filecon2_request_t), 1);
-
-  do_lseek(fd_b, offset + length - 1);
-  do_write(fd_b, data + sizeof(filecon2_request_t), 1);
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + 1);
-
-  mmap_data = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd_b, offset);
-  if (mmap_data == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-
-  first = FALSE;
-}
-
-
-void do_check_file_size()
-{
-  struct stat st;
-  int error;
-
-  error = fstat(fd_b, &st);
-  if (error)
-    die("can't stat file: %s\n", strerror(errno));
-
-  if (file_size != st.st_size)
-    die("file size mismatch (server = %"PRIu64", me = %"PRIu64")\n",
-	file_size, st.st_size);
-}
-
-
-void op_buffered_read()
-{
-  filecon2_request_t req;
-  uint64 off;
-  uint32 len;
-  unsigned char *data;
-  int error;
-
-  rand_extent(&off, &len);
-  off += offset;
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_READ_BUFFERED;
-  req.length = len;
-  req.data = len;
-  req.offset = off;
-
-  type_alloc(data, char, sizeof(filecon2_request_t) + len);
-
-  do_lseek(fd_b, off);
-  error = read(fd_b, data + sizeof(filecon2_request_t), len);
-  if (error < 0)
-    die("error reading from file: %s\n", strerror(errno));
-  req.data = error;
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + req.data);
-
-  free(data);
-}
-
-
-void op_buffered_write()
-{
-  filecon2_request_t req;
-  uint64 off;
-  uint32 len;
-  unsigned char *data;
-
-  rand_extent(&off, &len);
-  off += offset;
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_WRITE_BUFFERED;
-  req.length = len;
-  req.data = len;
-  req.offset = off;
-
-  type_alloc(data, char, sizeof(filecon2_request_t) + len);
-
-  fill_pattern(data + sizeof(filecon2_request_t), len);
-
-  do_lseek(fd_b, off);
-  do_write(fd_b, data + sizeof(filecon2_request_t), len);
-
-  if (reread)
-  {
-    unsigned char *data_reread;
-
-    type_alloc(data_reread, char, len);
-
-    do_lseek(fd_b, off);
-    do_read(fd_b, data_reread, len);
-
-    if (memcmp(data + sizeof(filecon2_request_t), data_reread, len) != 0)
-      die("buffered write: bad reread\n");
-
-    free(data_reread);
-  }
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + req.data);
-
-  free(data);
-}
-
-
-void op_direct_read()
-{
-  filecon2_request_t req;
-  uint64 off;
-  uint32 len;
-  unsigned char *data, *data_orig;
-  unsigned int remainder;
-  int error;
-
-  if (respect_eof)
-  {
-    if (file_size < offset + align)
-    {
-      off = offset;
-      len = 0;
-    }
-    else
-      for (;;)
-      {
-	rand_extent(&off, &len);
-	off += offset;
-	if (off + len <= file_size)
-	  break;
-      }
-  }
-  else
-  {
-    rand_extent(&off, &len);
-    off += offset;
-  }
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_READ_DIRECT;
-  req.length = len;
-  req.data = len;
-  req.offset = off;
-
-  data = data_orig = malloc(sizeof(filecon2_request_t) + len + PAGE_SIZE);
-  if (!data)
-    die("out of memory\n");
-  remainder = ((unsigned long)(data + sizeof(filecon2_request_t))) & (PAGE_SIZE - 1);
-  if (remainder)
-    data += PAGE_SIZE - remainder;
-
-  do_lseek(fd_d, off);
-  error = read(fd_d, data + sizeof(filecon2_request_t), len);
-  if (error < 0)
-    die("error reading from file: %s\n", strerror(errno));
-  req.data = error;
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + req.data);
-
-  free(data_orig);
-}
-
-
-void op_direct_write()
-{
-  filecon2_request_t req;
-  uint64 off;
-  uint32 len;
-  unsigned char *data, *data_orig;
-  unsigned int remainder;
-
-  rand_extent(&off, &len);
-  off += offset;
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_WRITE_DIRECT;
-  req.length = len;
-  req.data = len;
-  req.offset = off;
-
-  data = data_orig = malloc(sizeof(filecon2_request_t) + len + PAGE_SIZE);
-  if (!data)
-    die("out of memory\n");
-  remainder = ((unsigned long)(data + sizeof(filecon2_request_t))) & (PAGE_SIZE - 1);
-  if (remainder)
-    data += PAGE_SIZE - remainder;
-
-  fill_pattern(data + sizeof(filecon2_request_t), len);
-
-  do_lseek(fd_d, off);
-  do_write(fd_d, data + sizeof(filecon2_request_t), len);
-
-  if (reread)
-  {
-    unsigned char *data_reread, *data_reread_orig;
-
-    data_reread = data_reread_orig = malloc(len + PAGE_SIZE);
-    if (!data_reread)
-      die("out of memory\n");
-    remainder = ((unsigned long)data_reread) & (PAGE_SIZE - 1);
-    if (remainder)
-      data_reread += PAGE_SIZE - remainder;
-
-    do_lseek(fd_d, off);
-    do_read(fd_d, data_reread, len);
-
-    if (memcmp(data + sizeof(filecon2_request_t), data_reread, len) != 0)
-      die("direct write: bad reread\n");
-
-    free(data_reread_orig);
-  }
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + req.data);
-
-  free(data_orig);
-}
-
-
-void op_mmapped_read()
-{
-  filecon2_request_t req;
-  uint64 off;
-  uint32 len;
-  unsigned char *data;
-
-  rand_extent(&off, &len);
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_READ_MMAPPED;
-  req.length = len;
-  req.data = len;
-  req.offset = offset + off;
-
-  type_alloc(data, char, sizeof(filecon2_request_t) + len);
-
-  memcpy(data + sizeof(filecon2_request_t), mmap_data + off, len);
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + req.data);
-
-  free(data);
-}
-
-
-void op_mmapped_write()
-{
-  filecon2_request_t req;
-  uint64 off;
-  uint32 len;
-  unsigned char *data;
-
-  rand_extent(&off, &len);
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_WRITE_MMAPPED;
-  req.length = len;
-  req.data = len;
-  req.offset = offset + off;
-
-  type_alloc(data, char, sizeof(filecon2_request_t) + len);
-
-  fill_pattern(data + sizeof(filecon2_request_t), len);
-
-  memcpy(mmap_data + off, data + sizeof(filecon2_request_t), len);
-
-  if (reread)
-  {
-    if (memcmp(mmap_data + off, data + sizeof(filecon2_request_t), len) != 0)
-      die("mmapped write: bad reread\n");
-  }
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t) + req.data);
-
-  free(data);
-}
-
-
-void op_trunc()
-{
-  filecon2_request_t req;
-  uint64 off;
-  unsigned char data[sizeof(filecon2_request_t)];
-
-  if (align > 1)
-  {
-    off = RAND((length / align) + 1);
-    off *= align;
-  }
-  else
-    off = RAND(length + 1);
-
-  off += offset;
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_TRUNC;
-  req.offset = off;
-
-  do_ftruncate(fd_b, off);
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t));
-}
-
-
-void op_nop()
-{
-  filecon2_request_t req;
-  unsigned char data[sizeof(filecon2_request_t)];
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_NOP;
-
-  request_out(&req, data);
-  do_write(sock, data, sizeof(filecon2_request_t));
-}
-
-
-const static operation_t ops[] =
-{
-  { "buffered read", op_buffered_read },
-  { "buffered write", op_buffered_write },
-  { "direct read", op_direct_read },
-  { "direct write", op_direct_write },
-  { "mmapped read", op_mmapped_read },
-  { "mmapped write", op_mmapped_write },
-  { "truncate", op_trunc },
-  { "nop", op_nop },
-};
-
-
-int do_op()
-{
-  filecon2_request_t req;
-  unsigned char buf[sizeof(filecon2_request_t)];
-  float c, x = 0.0;
-  unsigned int op;
-
-
-  do_read(sock, buf, sizeof(filecon2_request_t));
-  request_in(&req, buf);
-
-  if (req.magic != FILECON2_MAGIC)
-    die("magic number mismatch\n");
-  if (req.type == FCR_STOP)
-    return FALSE;
-  if (req.type)
-    die("strange message from server\n");
-
-  file_size = req.offset;
-  opnum = req.length;
-
-
-  if (first)
-  {
-    do_first();
-    return TRUE;
-  }
-  else if (check_file_size)
-    do_check_file_size();
-
-
-  for (;;)
-  {
-    op = 0;
-    c = RAND(1);
-
-    for (;;)
-    {
-      if (chances[op])
-      {
-	x += chances[op];
-	if (x > c)
-	{
-	  ops[op].func();
-	  return TRUE;
-	}
-      }
-
-      op++;
-      if (op == CHANCES)
-	break;
-    }
-  }
-
-
-  die("D'oh!\n");
-}
-
-
-void compute_chances()
-{
-  unsigned int x;
-  float sum = 0.0;
-
-  for (x = 0; x < CHANCES; x++)
-    chances[x] = 0.0;
-
-  if (buffered)
-  {
-    chances[0] = 1.0;
-    chances[1] = 1.0;
-  }
-  if (direct)
-  {
-    chances[2] = 1.0;
-    chances[3] = 1.0;
-  }
-  if (mmapped)
-  {
-    chances[4] = 1.0;
-    chances[5] = 1.0;
-  }
-  if (trunc)
-    chances[6] = 0.1;
-  if (nop)
-    chances[7] = 0.1;
-
-  for (x = 0; x < CHANCES; x++)
-    sum += chances[x];
-
-  for (x = 0; x < CHANCES; x++)
-    chances[x] /= sum;
-}
-
-
-void do_seed()
-{
-  filecon2_request_t req;
-  unsigned char buf[sizeof(filecon2_request_t)];
-
-  do_read(sock, buf, sizeof(filecon2_request_t));
-  request_in(&req, buf);
-
-  if (req.magic != FILECON2_MAGIC)
-    die("magic number mismatch\n");
-  if (req.type != FCR_SEED)
-    die("strange message from server\n");
-
-  if (!user_seed)
-    seed = req.length;
-
-  if (verbose)
-    printf("\nseed = %u\n", seed);
-
-  srandom(seed);
-}
-
-
-int main(int argc, char *argv[])
-{
-  int optchar, cont = TRUE;
-  struct hostent *hname;
-  struct sockaddr_in sin;
-  unsigned int x;
-  int error;
-
-
-  prog_name = argv[0];
-  pid = getpid();
-
-
-  if (argc < 3)
-  {
-    fprintf(stderr, "%s usage:\n\n", prog_name);
-    fprintf(stderr, "%s -p <port> -s <seed> -o <offset> -l <length> -c <chunksize> -f <pattern> -b -d -m -t -n -a <align> -r -e -x -v server file\n\n", prog_name);
-    fprintf(stderr, "  -p <port>          Port to connect to\n");
-    fprintf(stderr, "  -s <seed>          Seed for the random number generator\n");
-    fprintf(stderr, "  -o <offset>        The start of the active region in bytes\n");
-    fprintf(stderr, "  -l <length>        The length of the active region in bytes\n");
-    fprintf(stderr, "  -c <chunksize>     Read/Write up to this amount in one I/O\n");
-    fprintf(stderr, "  -f <pattern>       Do writes with this pattern (rand, opnum)\n");
-    fprintf(stderr, "  -b                 Do buffered I/O\n");
-    fprintf(stderr, "  -d                 Do direct I/O\n");
-    fprintf(stderr, "  -m                 Do memory mapped I/O\n");
-    fprintf(stderr, "  -t                 Do truncates\n");
-    fprintf(stderr, "  -n                 Do nops\n");
-    fprintf(stderr, "  -a <align>         I/O should be aligned to multiples of this value\n");
-    fprintf(stderr, "  -r                 Reread writes\n");
-    fprintf(stderr, "  -e                 Don't try to read past the EOF when doing Direct I/O\n");
-    fprintf(stderr, "  -x                 Always check to make sure the file's size is correct\n");
-    fprintf(stderr, "  -v                 Be verbose\n");
-    exit(EXIT_FAILURE);
-  }
-
-  while (cont)
-  {
-    optchar = getopt(argc, argv, "p:s:o:l:c:f:bdmtna:rexv");
-    switch (optchar)
-    {
-    case 'p':
-      sscanf(optarg, "%u", &port);
-      break;
-    case 's':
-      sscanf(optarg, "%u", &seed);
-      user_seed = TRUE;
-      break;
-    case 'o':
-      sscanf(optarg, "%"SCNu64"", &offset);
-      break;
-    case 'l':
-      sscanf(optarg, "%"SCNu64"", &length);
-      break;
-    case 'c':
-      sscanf(optarg, "%u", &chunk);
-      break;
-    case 'f':
-      if (strcmp(optarg, "rand") == 0)
-	pattern = PATTERN_RAND;
-      else if (strcmp(optarg, "opnum") == 0)
-	pattern = PATTERN_OPNUM;
-      else
-	die("unknown pattern %s\n", optarg);
-      break;
-    case 'b':
-      buffered = TRUE;
-      break;
-    case 'd':
-      direct = TRUE;
-      break;
-    case 'm':
-      mmapped = TRUE;
-      break;
-    case 't':
-      trunc = TRUE;
-      break;
-    case 'n':
-      nop = TRUE;
-      break;
-    case 'a':
-      sscanf(optarg, "%u", &align);
-      break;
-    case 'r':
-      reread = TRUE;
-      break;
-    case 'e':
-      respect_eof = TRUE;
-      break;
-    case 'x':
-      check_file_size = TRUE;
-      break;
-    case 'v':
-      verbose = TRUE;
-      break;
-    case EOF:
-      cont = FALSE;
-      break;
-    default:
-      die("bad argument\n");
-    }
-  }
-
-  if (optind < argc)
-    servername = argv[optind++];
-  else
-    die("no servername\n");
-
-  if (optind < argc)
-    filename = argv[optind++];
-  else
-    die("no filename\n");
-
-  if (port >= 65536)
-    die("invalid port number: %u\n", port);
-
-  if (align > chunk || chunk > length)
-    die("bad sizes, should be: -a <= -c < = -l\n");
-
-  if (offset % align)
-    die("offset not aligned\n");
-
-  if (mmapped)
-  {
-    if (trunc)
-      die("can't do both -m and -t\n");
-    first = TRUE;
-  }
-
-
-  compute_chances();
-
-
-  if (verbose)
-  {
-    printf("port = %u\n", port);
-    if (user_seed)
-      printf("seed = %u\n", seed);
-    else
-      printf("seed = <ProvidedByServer>\n");
-    printf("offset = %"PRIu64"\n", offset);
-    printf("length = %"PRIu64"\n", length);
-    printf("chunk = %u\n", chunk);
-    switch (pattern)
-    {
-    case PATTERN_RAND:
-      printf("pattern = rand\n");
-      break;
-    case PATTERN_OPNUM:
-      printf("pattern = opnum\n");
-      break;
-    default:
-      printf("pattern = unknown\n");
-      break;
-    }
-    printf("buffered = %d\n", buffered);
-    printf("direct = %d\n", direct);
-    printf("mmapped = %d\n", mmapped);  
-    printf("trunc = %d\n", trunc);
-    printf("nop = %d\n", nop);
-    printf("align = %u\n", align);
-    printf("reread = %d\n", reread);
-    printf("respect_eof = %d\n", respect_eof);
-    printf("check_file_size = %d\n", check_file_size);
-    printf("verbose = %d\n", verbose);
-    printf("servername = %s\n", servername);
-    printf("filename = %s\n", filename);
-
-    printf("\n");
-    for (x = 0; x < CHANCES; x++)
-      printf("%s %f\n", ops[x].name, chances[x]);
-  }
-
-
-  fd_b = open(filename, O_RDWR);
-  if (fd_b < 0)
-    die("can't open file %s: %s\n", filename, strerror(errno));
-
-  if (direct)
-  {
-    fd_d = open(filename, O_RDWR | O_DIRECT);
-    if (fd_d < 0)
-      die("can't open file %s: %s\n", filename, strerror(errno));
-  }
-
-
-  hname = gethostbyname(servername);
-  if (!hname)
-    die("can't resolve host %s: %s\n", servername, strerror(errno));
-
-  sock = socket(AF_INET, SOCK_STREAM, 0);
-  if (sock < 0)
-    die("can't open socket: %s\n", strerror(errno));
-
-  sin.sin_family = AF_INET;
-  sin.sin_addr.s_addr = *((uint32 *)*(hname->h_addr_list));
-  sin.sin_port = cpu_to_be16(port);
- 
-  error = connect(sock, (struct sockaddr *)&sin, sizeof(struct sockaddr_in));
-  if (error < 0)
-    die("can't connect to host %s (%u): %s\n", servername, port, strerror(errno));
-
-
-  do_seed();
-
-
-  while (do_op()) /* Do nothing */;
-
-
-  close(sock);
-  if (direct)
-    close(fd_d);
-  if (mmap_data)
-    munmap(mmap_data, length);
-  close(fd_b);
-
-
-  exit(EXIT_SUCCESS);
-}
-
-
-
diff --git a/gfs/tests/filecon2/filecon2_server.c b/gfs/tests/filecon2/filecon2_server.c
deleted file mode 100644
index bc59124..0000000
--- a/gfs/tests/filecon2/filecon2_server.c
+++ /dev/null
@@ -1,597 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#include "global.h"
-#include "osi_list.h"
-#include "linux_endian.h"
-#define EXTERN
-#include "filecon2.h"
-
-
-
-struct log
-{
-  osi_list_t list;
-  unsigned int cli;
-  filecon2_request_t req;
-};
-typedef struct log log_t;
-
-
-
-int fd = -1;
-unsigned int clients = 0;
-struct sockaddr_in *ssin = NULL;
-int *sock = NULL;
-unsigned int t = 0;
-
-int log = FALSE;
-osi_list_decl(log_list);
-
-
-
-
-
-char *type2string(unsigned int type)
-{
-  char *type_string;
-
-  switch (type)
-  {
-  case FCR_READ_BUFFERED:
-    type_string = "read(b)";
-    break;
-  case FCR_READ_DIRECT:
-    type_string = "read(d)";
-    break;
-  case FCR_READ_MMAPPED:
-    type_string = "read(m)";
-    break;
-  case FCR_WRITE_BUFFERED:
-    type_string = "write(b)";
-    break;
-  case FCR_WRITE_DIRECT:
-    type_string = "write(d)";
-    break;
-  case FCR_WRITE_MMAPPED:
-    type_string = "write(m)";
-    break;
-  case FCR_TRUNC:
-    type_string = "trunc";
-    break;
-  case FCR_NOP:
-    type_string = "nop";
-    break;
-  case FCR_SEED:
-    type_string = "seed";
-    break;
-  case FCR_STOP:
-    type_string = "stop";
-    break;
-  default:
-    type_string = "unknown";
-    break;
-  }
-
-  return type_string;
-}
-
-
-void request_print(unsigned int cli, filecon2_request_t *req)
-{
-  printf("Request from %u/%.8X/%.4X:\n",
-	 cli, be32_to_cpu(ssin[cli].sin_addr.s_addr), be16_to_cpu(ssin[cli].sin_port));
-  printf("  magic = 0x%X\n", req->magic);
-  printf("  type = %s (%u)\n", type2string(req->type), req->type);
-  printf("  length = %u\n", req->length);
-  printf("  data = %u\n", req->data);
-  printf("  offset = %"PRIu64"\n", req->offset);
-}
-
-
-void dump_data(filecon2_request_t *req, unsigned char *client, unsigned char *server)
-{
-  FILE *outfile;
-  unsigned int x;
-  unsigned int first = (unsigned int)-1, last = (unsigned int)-1;
-  uint64 f1, l1, f2, l2;
-
-  for (x = 0; x < req->data; x++)
-    if (client[x] != server[x])
-    {
-      first = x;
-      break;
-    }
-
-  if (first == (unsigned int)-1)
-    die("blerg1\n");
-
-  for (x = req->data; x--; )
-    if (client[x] != server[x])
-    {
-      last = x;
-      break;
-    }
-
-  if (last == (unsigned int)-1)
-    die("blerg2\n");
-
-  f1 = req->offset + first;
-  l1 = req->offset + last;
-
-  printf("Error range (%"PRIu64" - %"PRIu64"), (%u - %u) \n",
-	 f1, l1, first, last);
-
-  if (log)
-  {
-    osi_list_t *tmp, *head;
-    log_t *l;
-    unsigned int t = 0;
-
-    for (head = &log_list, tmp = head->next;
-	 tmp != head;
-	 tmp = tmp->next, t++)
-    {
-      l = osi_list_entry(tmp, log_t, list);
-
-      if (l->req.type == FCR_NOP)
-	continue;
-      else if (l->req.type == FCR_TRUNC)
-      {
-	f2 = l->req.offset;
-	l2 = l->req.offset;
-      }
-      else
-      {
-	f2 = l->req.offset;
-	l2 = l->req.offset + l->req.data - 1;
-      }
-
-      if ((f1 <= f2 && f2 <= l1) ||
-	  (f1 <= l2 && l2 <= l1) ||
-	  (f2 <= f1 && f1 <= l2) ||
-	  (f2 <= l1 && l1 <= l2))
-      {
-	printf("%.7u: %u/%.8X/%.4X: %s (%"PRIu64" - %"PRIu64")\n",
-	       t,
-	       l->cli, be32_to_cpu(ssin[l->cli].sin_addr.s_addr), be16_to_cpu(ssin[l->cli].sin_port),
-	       type2string(l->req.type),
-	       f2, l2);
-      }
-    }
-  }
-
-  outfile = fopen("out.client", "w");
-  if (!outfile)
-    die("can't open file %s: %s\n", "out.client", strerror(errno));
-  for (x = 0; x < req->data; x++)
-  {
-    fprintf(outfile, "%.2X", client[x]);
-    if (x % 32 == 31)
-      fprintf(outfile, "\n");
-  }
-  if (x % 32)
-    fprintf(outfile, "\n");
-  fclose(outfile);
-
-  outfile = fopen("out.server", "w");
-  if (!outfile)
-    die("can't open file %s: %s\n", "out.server", strerror(errno));
-  for (x = 0; x < req->data; x++)
-  {
-    fprintf(outfile, "%.2X", server[x]);
-    if (x % 32 == 31)
-      fprintf(outfile, "\n");
-  }
-  if (x % 32)
-    fprintf(outfile, "\n");
-  fclose(outfile);
-}
-
-
-void do_op(unsigned int cli)
-{
-  struct stat st;
-  filecon2_request_t req;
-  unsigned char buf[sizeof(filecon2_request_t)];
-  uint64 first, last;
-  unsigned char *data1 = NULL;
-  unsigned char *data2;
-  unsigned int x = 0;
-  int error;
-
-  error = fstat(fd, &st);
-  if (error)
-    die("can't stat file: %s\n", strerror(errno));
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.length = t;
-  req.offset = st.st_size;
-  request_out(&req, buf);
-  do_write(sock[cli], buf, sizeof(filecon2_request_t));
-
-  do_read(sock[cli], buf, sizeof(filecon2_request_t));
-  request_in(&req, buf);
-
-  if (req.magic != FILECON2_MAGIC)
-  {
-    request_print(cli, &req);
-    die("magic number mismatch\n");
-  }
-
-  if (req.type == FCR_NOP)
-    first = last = 0;
-  else if (req.type == FCR_TRUNC)
-    first = last = req.offset;
-  else
-  {
-    first = req.offset;
-    last = req.offset + req.data - 1;
-  }
-
-  printf("%.7u: %d/%u/%.8X/%.4X: %s (%"PRIu64" - %"PRIu64")\n",
-	 t, pid,
-	 cli, be32_to_cpu(ssin[cli].sin_addr.s_addr), be16_to_cpu(ssin[cli].sin_port),
-	 type2string(req.type),
-	 first, last);
-
-  if (log)
-  {
-    log_t *l;
-    l = malloc(sizeof(log_t));
-    if (!l)
-      die("out of memory\n");
-    memset(l, 0, sizeof(log_t));
-    l->cli = cli;
-    l->req = req;
-    osi_list_add_prev(&l->list, &log_list);
-  }
-
-  if (req.data)
-  {
-    data1 = malloc(req.data);
-    if (!data1)
-    {
-      request_print(cli, &req);
-      die("out of memory\n");
-    }
-
-    for (;;)
-    {
-      error = read(sock[cli], data1 + x, req.data - x);
-      if (error < 0)
-      {
-	request_print(cli, &req);
-	die("can't read from socket: %s\n", strerror(errno));
-      }
-
-      x += error;
-
-      if (x == req.data)
-	break;
-      if (x > req.data)
-      {
-	request_print(cli, &req);
-	die("data overflow from client: %u\n", x);
-      }
-    }
-  }
-
-  if (req.type == FCR_READ_BUFFERED ||
-      req.type == FCR_READ_MMAPPED)
-  {
-    data2 = malloc(req.data + 1);  /*  req.data might be zero  */;
-    if (!data2)
-    {
-      request_print(cli, &req);
-      die("out of memory\n");
-    }
-
-    do_lseek(fd, req.offset);
-    error = read(fd, data2, req.length);
-    if (error < 0)
-    {
-      request_print(cli, &req);
-      die("bad read from file: %s\n", strerror(errno));
-    }
-
-    if (error != req.data)
-    {
-      request_print(cli, &req);
-      die("length mismatch from read: %u\n", error);
-    }
-    if (req.data && memcmp(data1, data2, req.data) != 0)
-    {
-      request_print(cli, &req);
-      dump_data(&req, data1, data2);
-      die("value mismatch\n");
-    }
-
-    free(data2);
-  }
-  else if (req.type == FCR_READ_DIRECT)
-  {
-    data2 = malloc(req.length + 1);
-    if (!data2)
-    {
-      request_print(cli, &req);
-      die("out of memory\n");
-    }
-
-    do_lseek(fd, req.offset);
-    error = read(fd, data2, req.length);
-    if (error < 0)
-    {
-      request_print(cli, &req);
-      die("bad read from file: %s\n", strerror(errno));
-    }
-
-    /*  FixMe!!!  */
-    if (error < req.data || error - req.data > 4096)
-    {
-      request_print(cli, &req);
-      die("length mismatch from read: %u\n", error);
-    }
-    if (req.data && memcmp(data1, data2, req.data) != 0)
-    {
-      request_print(cli, &req);
-      dump_data(&req, data1, data2);
-      die("value mismatch\n");
-    }
-
-    free(data2);
-  }
-  else if (req.type == FCR_WRITE_BUFFERED ||
-	   req.type == FCR_WRITE_DIRECT ||
-	   req.type == FCR_WRITE_MMAPPED)
-  {
-    if (!req.data)
-    {
-      request_print(cli, &req);
-      die("no data to write\n");
-    }
-    if (req.length != req.data)
-    {
-      request_print(cli, &req);
-      die("length != data on write\n");
-    }
-
-    do_lseek(fd, req.offset);
-    error = write(fd, data1, req.length);
-    if (error < 0)
-    {
-      request_print(cli, &req);
-      die("bad write to file: %s\n", strerror(errno));
-    }
-    if (error != req.length)
-    {
-      request_print(cli, &req);
-      die("short write: %u\n", error);
-    }
-  }
-  else if (req.type == FCR_TRUNC)
-  {
-    error = ftruncate(fd, req.offset);
-    if (error)
-    {
-      request_print(cli, &req);
-      die("bad truncate: %s\n", strerror(errno));
-    }
-  }
-  else if (req.type == FCR_NOP)
-  {
-    /*  Do nothing  */
-  }
-  else
-  {
-    request_print(cli, &req);
-    die("strange message from client\n");
-  }
-
-  if (req.data)
-    free(data1);
-}
-
-
-void do_seed(int sock)
-{
-  filecon2_request_t req;
-  unsigned char buf[sizeof(filecon2_request_t)];
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_SEED;
-  req.length = random();
-  request_out(&req, buf);
-  do_write(sock, buf, sizeof(filecon2_request_t));
-}
-
-
-void do_stop(int sock)
-{
-  filecon2_request_t req;
-  unsigned char buf[sizeof(filecon2_request_t)];
-
-  memset(&req, 0, sizeof(filecon2_request_t));
-  req.magic = FILECON2_MAGIC;
-  req.type = FCR_STOP;
-  request_out(&req, buf);
-  do_write(sock, buf, sizeof(filecon2_request_t));
-}
-
-
-int main(int argc, char *argv[])
-{
-  unsigned int port = FILECON2_PORT;
-  unsigned int seed = time(NULL) ^ getpid();
-  unsigned int wait_clients = 1;
-  unsigned int to = 0;
-  char *filename;
-
-  int optchar, cont = TRUE;
-  int asking_sock;
-  int trueint = TRUE;
-  struct sockaddr_in sin;
-  fd_set fds;
-  struct timeval tv;
-  unsigned int size;
-  unsigned int cli;
-  int error;
-
-
-  prog_name = argv[0];
-  pid = getpid();
-
-
-  if (argc < 2)
-  {
-    fprintf(stderr, "%s usage:\n\n", prog_name);
-    fprintf(stderr, "%s -p <port> -s <seed> -w <clients> -t <to> filename\n\n", prog_name);
-    fprintf(stderr, "  -p <port>          The port to listen on (%u by default)\n", FILECON2_PORT);
-    fprintf(stderr, "  -s <seed>          Seed for the random number generator\n");
-    fprintf(stderr, "  -w <clients>       Wait for a number of clients to join\n");
-    fprintf(stderr, "  -t <to>            Only do a given number of operations\n");
-    fprintf(stderr, "  -l                 Log operations for error reporting\n");
-    exit(EXIT_FAILURE);
-  }
-
-  while (cont)
-  {
-    optchar = getopt(argc, argv, "p:s:w:t:l");
-    switch (optchar)
-    {
-    case 'p':
-      sscanf(optarg, "%u", &port);
-      break;
-    case 's':
-      sscanf(optarg, "%u", &seed);
-      break;
-    case 'w':
-      sscanf(optarg, "%u", &wait_clients);
-      break;
-    case 't':
-      sscanf(optarg, "%u", &to);
-      break;
-    case 'l':
-      log = TRUE;
-      break;
-    case EOF:
-      cont = FALSE;
-      break;
-    default:
-      die("bad argument\n");
-    }
-  }
-
-  if (optind < argc)
-    filename = argv[optind];
-  else
-    die("no filename\n");
-
-  if (port >= 65536)
-    die("invalid port number: %u\n", port);
-
-
-  srandom(seed);
-
-
-  fd = open(filename, O_RDWR, 0644);
-  if (fd < 0)
-    die("can't open file %s: %s\n", filename, strerror(errno));
-
-
-  asking_sock = socket(AF_INET, SOCK_STREAM, 0);
-  if (asking_sock < 0)
-    die("can't open socket: %s\n", strerror(errno));
-
-  error = setsockopt(asking_sock, SOL_SOCKET, SO_REUSEADDR, &trueint, sizeof(int));
-  if (error < 0)
-    die("can't set SO_REUSEADDR: %s\n", strerror(errno));
-
-  sin.sin_family = AF_INET;
-  sin.sin_addr.s_addr = INADDR_ANY;
-  sin.sin_port = cpu_to_be16(port);
-
-  error = bind(asking_sock, (struct sockaddr *)&sin, sizeof(struct sockaddr_in));
-  if (error < 0)
-    die("can't bind to port %u: %s\n", port, strerror(errno));
-
-  error = listen(asking_sock, 5);
-  if (error < 0)
-    die("can't bind to socket: %s\n", strerror(errno));
-
-  
-  for (;;)
-  {
-    FD_ZERO(&fds);
-    FD_SET(asking_sock, &fds);
-    tv.tv_sec = 0;
-    tv.tv_usec = 0;
-
-    error = select(asking_sock + 1, &fds, NULL, NULL,
-		   (clients < wait_clients) ? NULL : &tv);
-    if (error < 0)
-      die("can't select: %s\n", strerror(errno));
-
-    if (error)  /*  Add a new client  */
-    {
-      cli = clients;
-      clients++;
-
-      sock = realloc(sock, clients * sizeof(int));
-      if (!sock)
-	die("can't alloc memory: %s\n", strerror(errno));
-      ssin = realloc(ssin, clients * sizeof(struct sockaddr_in));
-      if (!ssin)
-	die("can't alloc memory: %s\n", strerror(errno));
-
-      size = sizeof(struct sockaddr_in);
-      sock[cli] = accept(asking_sock, &ssin[cli], &size);
-      if (sock[cli] < 0)
-	die("can't accept: %s\n", strerror(errno));
-
-      do_seed(sock[cli]);
-
-      printf("connect %u/%.8X/%.4X\n",
-	     cli, be32_to_cpu(ssin[cli].sin_addr.s_addr), be16_to_cpu(ssin[cli].sin_port));
-    }
-
-    if (clients < wait_clients)
-      continue;
-
-
-    cli = RAND(clients);
-    do_op(cli);
-    t++;
-
-    if (to && t == to)
-      break;
-  }
-
-
-  for (cli = 0; cli < clients; cli++)
-  {
-    do_stop(sock[cli]);
-    close(sock[cli]);
-  }
-  close(fd);
-
-
-  exit(EXIT_SUCCESS);
-}
-
-
-
diff --git a/gfs/tests/mmdd/Makefile b/gfs/tests/mmdd/Makefile
deleted file mode 100644
index eb9cc9e..0000000
--- a/gfs/tests/mmdd/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-TARGETS= mmdd sfdd
-
-all: $(TARGETS)
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-
-CFLAGS += -D_GNU_SOURCE
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-mmdd.o: mmdd.c
-	$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
-
-sfdd.o: mmdd.c
-	$(CC) $(CFLAGS) -DUSE_SENDFILE -c -o $@ $<
-
-%: %.o
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include mmdd.d
--include sfdd.d
diff --git a/gfs/tests/mmdd/mmdd.c b/gfs/tests/mmdd/mmdd.c
deleted file mode 100644
index 3864f71..0000000
--- a/gfs/tests/mmdd/mmdd.c
+++ /dev/null
@@ -1,703 +0,0 @@
-#ifdef __linux__
-#else
-#undef USE_SENDFILE
-#endif
-
-#ifdef __FreeBSD__
-#define O_SYNC O_FSYNC
-#else
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#ifdef USE_SENDFILE
-#include <sys/sendfile.h>
-#endif
-
-
-
-#define die(fmt, args...) \
-do \
-{ \
-  fprintf(stderr, "%s: ", prog_name); \
-  fprintf(stderr, fmt, ##args); \
-  exit(EXIT_FAILURE); \
-} \
-while (0)
-
-#define TRUE (1)
-#define FALSE (0)
-
-
-
-#ifndef O_DIRECT
-#define O_DIRECT (0)
-#warning O_DIRECT is broken
-#endif
-#ifndef PAGE_SIZE
-#define PAGE_SIZE (65536)
-#endif
-
-
-
-char *prog_name;
-off_t read_offset = 0;
-off_t write_offset = 0;
-int private = FALSE;
-
-
-
-
-
-#ifdef USE_SENDFILE
-void send_sendfile(int ifd, int ofd, unsigned bs)
-{
-  int count;
-
-  count = sendfile(ofd, ifd, &read_offset, bs);
-  if (count != bs)
-    die("Bad sendfile return %d: %s\n", count, strerror(errno));   
-
-  write_offset += bs;
-}
-#endif
-
-
-void do_bothmapped(int ifd, int ofd, unsigned bs)
-{
-  char *data_in;
-  char *data_out;
-
-  data_in = mmap(NULL, bs, PROT_READ, (private) ? MAP_PRIVATE : MAP_SHARED, ifd, read_offset);
-  if (data_in == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-
-  data_out = mmap(NULL, bs, PROT_READ | PROT_WRITE, (private) ? MAP_PRIVATE : MAP_SHARED, ofd, write_offset);
-  if (data_out == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-  
-  memcpy(data_out, data_in, bs);
-
-  munmap(data_in, bs);
-  munmap(data_out, bs);
-
-  read_offset += bs;
-  write_offset += bs;
-}
-
-
-void do_imapped(int ifd, int ofd, unsigned bs)
-{
-  char *data;
-  int count;
-
-  data = mmap(NULL, bs, PROT_READ, (private) ? MAP_PRIVATE : MAP_SHARED, ifd, read_offset);
-  if (data == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-
-  count = write(ofd, data, bs);
-  if (count != bs)
-    die("bad write return %d: %s\n", count, strerror(errno));
-
-  munmap(data, bs);
-
-  read_offset += bs;
-  write_offset += bs;
-}
-
-
-void do_omapped(int ifd, int ofd, unsigned bs)
-{
-  char *data;
-  int count;
-
-  data = mmap(NULL, bs, PROT_READ | PROT_WRITE, (private) ? MAP_PRIVATE : MAP_SHARED, ofd, write_offset);
-  if (data == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-
-  count = read(ifd, data, bs);
-  if (count != bs)
-    die("bad read return %d: %s\n", count, strerror(errno));
-  
-  munmap(data, bs);
-
-  read_offset += bs;
-  write_offset += bs;
-}
-
-
-void do_mapped_read(int fd, char *buf, unsigned int bs)
-{
-  char *data;
-
-  data = mmap(NULL, bs, PROT_READ, (private) ? MAP_PRIVATE : MAP_SHARED, fd, read_offset);
-  if (data == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-
-  memcpy(buf, data, bs);
-
-  munmap(data, bs);
-
-  read_offset += bs;
-}
-
-
-void do_raw_read(int fd, char *buf, unsigned int bs)
-{
-  int count;
-
-  count = read(fd, buf, bs);
-  if (count != bs)
-    die("bad read return %d: %s\n", count, strerror(errno));
-}
-
-
-void do_mapped_write(int fd, char *buf, unsigned int bs)
-{
-  char *data;
-
-  data = mmap(NULL, bs, PROT_READ | PROT_WRITE, (private) ? MAP_PRIVATE : MAP_SHARED, fd, write_offset);
-  if (data == MAP_FAILED)
-    die("can't mmap file: %s\n", strerror(errno));
-
-  memcpy(data, buf, bs);
-
-  munmap(data, bs);
-
-  write_offset += bs;
-}
-
-
-void do_raw_write(int fd, char *buf, unsigned int bs)
-{
-  int count;
-
-  count = write(fd, buf, bs);
-  if (count != bs)
-    die("bad write return %d: %s\n", count, strerror(errno));
-}
-
-
-int main(int argc, char *argv[])
-{
-  int arg;
-
-  char *ifname = NULL;
-  char *ofname = NULL;
-  int imapped = FALSE, omapped = FALSE;
-  unsigned int bs = 4096;
-  unsigned long long move = 0;
-  unsigned long long count = 0;
-  unsigned long long skip = 0;
-  unsigned long long seek = 0;
-  int do_fsync = FALSE;
-  int do_osync = FALSE;
-  int verbose = FALSE;
-  int notrunc = FALSE;
-  int nobounce = FALSE;
-  int append = FALSE;
-  int direct = FALSE;
-  int fgt = FALSE;
-  int do_excl = FALSE;
-  
-  int done_bs = FALSE;
-  int done_amount = FALSE;
-  int done_skip = FALSE;
-  int done_seek = FALSE;
-  int done_fsync = FALSE;
-  int done_osync = FALSE;
-  int done_notrunc = FALSE;
-  int done_nobounce = FALSE;
-  int done_append = FALSE;
-  int done_direct = FALSE;
-  int done_private = FALSE;
-  int done_fgt = FALSE;
-  int done_excl = FALSE;
-
-#ifdef USE_SENDFILE
-  int do_sendfile = FALSE;
-  int done_sendfile = FALSE;
-#endif
-  
-  int ifd = -1, ofd = -1;
-
-  char c;
-  char *data;
-  unsigned long long x;
-  unsigned int remainder;
-
-  unsigned int timeslots, index = 0;
-  struct timeval *tv;
-  unsigned long long t1, t2;
-  double seconds, mbps;
-
-  struct stat st;
-  char *fgt_name = NULL;
-  FILE *fgt_file;
-
-  int error;
-
-
-
-  prog_name = argv[0];
-
-
-
-  if (argc == 1)
-    die("options:  Help me!  Help me!\n");
-
-
-
-  for (arg = 1; arg < argc; arg++)
-  {
-    if (strncmp(argv[arg], "if=", 3) == 0)
-    {
-      if (ifname)
-	die("you're only allowed one \"i?f=\"\n");
-
-      ifname = argv[arg] + 3;
-      imapped = FALSE;
-    }
-    else if (strncmp(argv[arg], "imf=", 4) == 0)
-    {
-      if (ifname)
-	die("you're only allowed one \"i?f=\"\n");
-
-      ifname = argv[arg] + 4;
-      imapped = TRUE;
-    }
-    else if (strncmp(argv[arg], "of=", 3) == 0)
-    {
-      if (ofname)
-	die("you're only allowed one \"o?f=\"\n");
-
-      ofname = argv[arg] + 3;
-      omapped = FALSE;
-    }
-    else if (strncmp(argv[arg], "omf=", 4) == 0)
-    {
-      if (ofname)
-	die("you're only allowed one \"o?f=\"\n");
-
-      ofname = argv[arg] + 4;
-      omapped = TRUE;
-    }
-    else if (strncmp(argv[arg], "bs=", 3) == 0)
-    {
-      if (done_bs)
-	die("you're only allowed one \"bs=\"\n");
-      done_bs = TRUE;
-
-      bs = atoi(argv[arg] + 3);
-      c = argv[arg][strlen(argv[arg]) - 1];
-      if (c == 'k')
-	bs <<= 10;
-      else if (c == 'm')
-	bs <<= 20;
-      else if (c == 'g')
-	bs <<= 30;
-
-      if (!bs)
-	die("invalid blocksize: %u\n", bs);
-    }
-    else if (strncmp(argv[arg], "move=", 5) == 0)
-    {
-      if (done_amount)
-	die("you're only allowed one amount\n");
-      done_amount = TRUE;
-
-      sscanf(argv[arg] + 5, "%qu", &move);
-      c = argv[arg][strlen(argv[arg]) - 1];
-      if (c == 'k')
-	move <<= 10;
-      else if (c == 'm')
-	move <<= 20;
-      else if (c == 'g')
-	move <<= 30;
-
-      if (!move)
-	die("zero move\n");
-    }
-    else if (strncmp(argv[arg], "count=", 6) == 0)
-    {
-      if (done_amount)
-	die("you're only allowed one amount\n");
-      done_amount = TRUE;
-
-      sscanf(argv[arg] + 6, "%qu", &count);
-
-      if (!count)
-	die("zero count\n");
-    }
-    else if (strncmp(argv[arg], "skip=", 5) == 0)
-    {
-      if (done_skip)
-	die("you're only allowed one skip\n");
-      done_skip = TRUE;
-
-      sscanf(argv[arg] + 5, "%qu", &skip);
-    }
-    else if (strncmp(argv[arg], "seek=", 5) == 0)
-    {
-      if (done_seek)
-	die("you're only allowed one seek\n");
-      done_seek = TRUE;
-
-      sscanf(argv[arg] + 5, "%qu", &seek);
-    }
-    else if (strncmp(argv[arg], "fsync=", 6) == 0)
-    {
-      if (done_fsync)
-	die("you're only allowed one \"fsync=\"\n");
-      done_fsync = TRUE;
-
-      do_fsync = atoi(argv[arg] + 6);
-    }
-    else if (strncmp(argv[arg], "osync=", 6) == 0)
-    {
-      if (done_osync)
-	die("you're only allowed one \"osync=\"\n");
-      done_osync = TRUE;
-
-      do_osync = atoi(argv[arg] + 6);
-    }
-    else if (strncmp(argv[arg], "notrunc=", 8) == 0)
-    {
-      if (done_notrunc)
-	die("you're only allowed one \"notrunc=\"\n");
-      done_notrunc = TRUE;
-
-      notrunc = atoi(argv[arg] + 8);
-    }
-    else if (strncmp(argv[arg], "nobounce=", 9) == 0)
-    {
-      if (done_nobounce)
-	die("you're only allowed one \"nobounce=\"\n");
-      done_nobounce = TRUE;
-
-      nobounce = atoi(argv[arg] + 9);
-    }
-    else if (strncmp(argv[arg], "append=", 7) == 0)
-    {
-      if (done_append)
-	die("you're only allowed one \"append=\"\n");
-      done_append = TRUE;
-
-      append = atoi(argv[arg] + 7);
-    }
-    else if (strncmp(argv[arg], "direct=", 7) == 0)
-    {
-      if (done_direct)
-	die("you're only allowed one \"direct=\"\n");
-      done_direct = TRUE;
-
-      direct = atoi(argv[arg] + 7);
-    }
-#ifdef USE_SENDFILE
-    else if (strncmp(argv[arg], "sendfile=", 9) == 0)
-    {
-      if (done_sendfile)
-	die("you're only allowed one \"sendfile=\"\n");
-      done_sendfile = TRUE;
-
-      do_sendfile = atoi(argv[arg] + 9);
-    }
-#endif
-    else if (strncmp(argv[arg], "private=", 8) == 0)
-    {
-      if (done_private)
-	die("you're only allowed one \"private=\"\n");
-      done_private = TRUE;
-
-      private = atoi(argv[arg] + 8);
-    }
-    else if (strncmp(argv[arg], "fgt=", 4) == 0)
-    {
-      if (done_fgt)
-	die("you're only allowed one \"fgt=\"\n");
-      done_fgt = TRUE;
-
-      if (isdigit(*(argv[arg] + 4)))
-	fgt = atoi(argv[arg] + 4);
-      else
-      {
-	fgt = TRUE;
-	fgt_name = argv[arg] + 4;
-      }
-    }
-    else if (strncmp(argv[arg], "excl=", 5) == 0)
-    {
-      if (done_excl)
-	die("you're only allowed one \"excl=\"\n");
-      done_excl = TRUE;
-
-      do_excl = atoi(argv[arg] + 5);
-    }
-    else if (strcmp(argv[arg], "-v") == 0)
-    {
-      verbose = TRUE;
-    }
-    else
-    {
-      die("unknown/unimplemented option: %s\n", argv[arg]);
-    }
-  }
-
-
-
-  if (!done_amount)
-    die("need an amount to move\n");
-
-  if (verbose)
-  {
-    fprintf(stderr, "ifname = %s (%s)\n", ifname, (imapped) ? "mapped" : "raw");
-    fprintf(stderr, "ofname = %s (%s)\n", ofname, (omapped) ? "mapped" : "raw");
-    fprintf(stderr, "bs = %u\n", bs);
-    fprintf(stderr, "move = %qu\n", move);
-    fprintf(stderr, "count = %qu\n", count);
-    fprintf(stderr, "skip = %qu\n", skip);
-    fprintf(stderr, "seek = %qu\n", seek);
-    fprintf(stderr, "fsync = %d\n", do_fsync);
-    fprintf(stderr, "notrunc = %d\n", notrunc);
-    fprintf(stderr, "nobounce = %d\n", nobounce);
-    fprintf(stderr, "append = %d\n", append);
-    fprintf(stderr, "direct = %d\n", direct);
-#ifdef USE_SENDFILE
-    fprintf(stderr, "sendfile = %d\n", do_sendfile);
-#endif
-    fprintf(stderr, "private = %d\n", private);
-    fprintf(stderr, "fine grain timing = %d\n", fgt);
-    fprintf(stderr, "fine grain timing file = %s\n", (fgt_name) ? fgt_name : "NULL");
-    fprintf(stderr, "excl = %d\n", do_excl);
-  }
-
-  if (!count)
-  {
-    if (move % bs != 0)
-      die("move size (%qu) not divisible by block size (%u)\n", move, bs);
-    count = move / bs;
-  }
-
-
-
-  data = (char *)malloc(bs + PAGE_SIZE);
-  if (!data)
-    die("out of memory\n");
-
-  remainder = ((unsigned long)data) & (PAGE_SIZE - 1);
-  if (remainder)
-    data += PAGE_SIZE - remainder;
-
-  memset(data, 0, bs);
-
-
-
-  if (fgt)
-  {
-    if (count & 0xFFFFFFFFF0000000)
-      die("count is too high -- can't do fine grain timing\n");
-    timeslots = count + 3;
-  }
-  else
-    timeslots = 2;
-
-  tv = malloc(timeslots * sizeof(struct timeval));
-  if (!tv)
-    die("out of memory\n");
-
-
-
-  gettimeofday(&tv[index++], NULL);
-
-
-
-  if (ifname)
-  {
-    if (strcmp(ifname, "-") == 0)
-      ifd = STDIN_FILENO;
-    else
-    {
-      ifd = open(ifname, O_RDONLY | ((direct) ? O_DIRECT : 0));
-      if (ifd < 0)
-	die("can't open file %s: %s\n", ifname, strerror(errno));
-      if (verbose)
-      {
-	error = fstat(ifd, &st);
-	if (error)
-	  die("can't stat file %s: %s\n", ifname, strerror(errno));
-	fprintf(stderr, "input inode = %qu\n", (unsigned long long)st.st_ino);
-      }
-
-      if (skip && lseek(ifd, skip * bs, SEEK_SET) != skip * bs)
-	die("can't skip:  %s\n", strerror(errno));
-    }
-  }
-
-  if (ofname)
-  {
-    if (strcmp(ofname, "-") == 0)
-      ofd = STDOUT_FILENO;
-    else
-    {
-      ofd = open(ofname,
-		 O_RDWR |
-		 O_CREAT |
-		 ((notrunc) ? 0 : O_TRUNC) |
-		 ((direct) ? O_DIRECT : 0) |
-		 ((append) ? O_APPEND : 0) |
-		 ((do_osync) ? O_SYNC : 0) |
-		 ((do_excl) ? O_EXCL : 0),
-		 0644);
-      if (ofd < 0)
-	die("can't open file %s: %s\n", ofname, strerror(errno));
-      if (verbose)
-      {
-	error = fstat(ofd, &st);
-	if (error)
-	  die("can't stat file %s: %s\n", ofname, strerror(errno));
-	fprintf(stderr, "output inode = %qu\n", (unsigned long long)st.st_ino);
-      }
-
-      if (seek && lseek(ofd, seek * bs, SEEK_SET) != seek * bs)
-	die("can't seek:  %s\n", strerror(errno));
-    }
-  }
-
-  if (ofd >= 0 && omapped)
-  {
-    if (ftruncate(ofd, bs * count) < 0)
-      die("can't truncate bigger: %s\n", strerror(errno));
-  }
-
-
-
-  if (fgt)
-    gettimeofday(&tv[index++], NULL);
-
-
-
-  for (x = 0; x < count; x++)
-  {
-#ifdef USE_SENDFILE
-    if (do_sendfile && ifd >= 0 && ofd >= 0)
-      send_sendfile(ifd, ofd, bs);
-    else 
-#endif
-    if (nobounce && ifd >= 0 && ofd >= 0 && (imapped || omapped))
-    {
-      if (imapped && omapped)
-	do_bothmapped(ifd, ofd, bs);
-      else if (imapped)
-	do_imapped(ifd, ofd, bs);
-      else
-	do_omapped(ifd, ofd, bs);
-    }  
-    else
-    {
-      if (ifd >= 0)
-      {
-	if (imapped)
-	  do_mapped_read(ifd, data, bs);
-	else
-	  do_raw_read(ifd, data, bs);
-      }
-
-      if (ofd >= 0)
-      {
-	if (omapped)
-	  do_mapped_write(ofd, data, bs);
-	else
-	  do_raw_write(ofd, data, bs);
-      }
-    }
-
-    if (verbose)
-      fprintf(stderr, "%qu\n", x);
-
-    if (fgt)
-      gettimeofday(&tv[index++], NULL);
-  }
-
-
-
-  if (ifd >= 0)
-    close(ifd);
-
-  if (ofd >= 0)
-  {
-    if (do_fsync)
-      fsync(ofd);
-    close(ofd);
-  }
-
-
-
-  gettimeofday(&tv[index++], NULL);
-
-  if (index != timeslots)
-    die("index != timeslots\n");
-
-
-
-  if (fgt)
-  {
-    if (fgt_name)
-    {
-      fgt_file = fopen(fgt_name, "w");
-      if (!fgt_file)
-	die("can't open file %s:  %s\n", fgt_name, strerror(errno));
-    }
-    else
-      fgt_file = stderr;
-
-    t1 = (unsigned long long)tv[0].tv_sec * 1000000 + tv[0].tv_usec;
-    fprintf(fgt_file, "start = %qu\n", t1);
-
-    for (index = 1; index < timeslots; index++)
-    {
-      t1 = (unsigned long long)tv[index - 1].tv_sec * 1000000 + tv[index - 1].tv_usec;
-      t2 = (unsigned long long)tv[index].tv_sec * 1000000 + tv[index].tv_usec;
-
-      if (index == 1)
-	fprintf(fgt_file, "setup = %qu\n", t2 - t1);
-      else if (index == timeslots - 1)
-	fprintf(fgt_file, "cleanup = %qu\n", t2 - t1);
-      else
-	fprintf(fgt_file, "loop %u = %qu\n", index - 2, t2 - t1);
-    }
-
-    t1 = (unsigned long long)tv[0].tv_sec * 1000000 + tv[0].tv_usec;
-    t2 = (unsigned long long)tv[timeslots - 1].tv_sec * 1000000 + tv[timeslots - 1].tv_usec;
-
-    fprintf(fgt_file, "total = %qu\n", t2 - t1);
-
-    if (fgt_name)
-      fclose(fgt_file);
-  }
-
-
-
-  t1 = (unsigned long long)tv[0].tv_sec * 1000000 + tv[0].tv_usec;
-  t2 = (unsigned long long)tv[timeslots - 1].tv_sec * 1000000 + tv[timeslots - 1].tv_usec;
-
-  seconds = (t2 - t1) / 1000000.0;
-  mbps = bs * count / 1048576.0 / seconds;
-
-  fprintf(stderr, "seconds = %.4f, MB/s = %.4f\n", seconds, mbps);
-
-
-
-  exit(EXIT_SUCCESS);
-}
-
-
-
diff --git a/gfs2/mount/gfs_ondisk.h b/gfs2/mount/gfs_ondisk.h
new file mode 100644
index 0000000..eea9038
--- /dev/null
+++ b/gfs2/mount/gfs_ondisk.h
@@ -0,0 +1,1904 @@
+/*
+ * On-disk structures.
+ *
+ * THE BIG PICTURE of on-disk layout:
+ *
+ * GFS filesystem code views the entire filesystem, including journals, as
+ * one contiguous group of blocks on one (perhaps virtual) storage device.
+ * The filesystem space is shared, not distributed; each node in the cluster
+ * must see the entire filesystem space.
+ *
+ * If the filesystem is spread across multiple physical storage devices,
+ * volume management (device mapping) must be used to present the fileystem
+ * space to GFS as one (virtual) device, with contiguous blocks.
+ *
+ * The superblock contains basic information about the filesytem, and appears
+ * at a location 64 KBytes into the filesystem.  The first 64 KBytes of the
+ * filesystem are empty, providing a safety buffer against wayward volume
+ * management software (that sometimes write data into the first few bytes of
+ * a device) or administrators.
+ *
+ * After the superblock, the rest of the filesystem is divided into multiple
+ * Resource Groups and several journals.
+ *
+ * The Resource Groups (RGs or rgrps) contain the allocatable blocks that are
+ * used for storing files, directories, etc., and all of the associated
+ * metadata.  Each RG has its own set of block allocation statistics (within
+ * the RG header), a number of blocks containing the block allocation bitmap,
+ * and a large number of allocatable blocks for file data and metadata.
+ * Multiple RGs allow multiple nodes to simultaneously allocate blocks from the 
+ * filesystem (using different RGs), enhancing parallel access.  RG size and
+ * number of RGs are determined by gfs_mkfs when creating the filesystem.
+ * An administrator can specify RG size (see man gfs_mkfs).
+ *
+ * The journals contain temporary copies of metadata blocks, along with
+ * other data, that allow GFS to recover the filesystem to a consistent state
+ * (at least as far as metadata is concerned) if a node fails in the midst
+ * of performing a write transaction.  There must be one journal for each node
+ * in the cluster.  Since access to the entire filesystem space is shared,
+ * if a node crashes, another node will be able to read the crashed node's
+ * journal, and perform recovery.
+ *
+ * Currently, gfs_mkfs places the journals right in the middle of a freshly
+ * created filesystem space, between 2 large groups of RGs.  From a filesystem
+ * layout perspective, this placement is not a requirement; the journals
+ * could be placed anywhere within the filesystem space.
+ *
+ * New Resource Groups and Journals may be added to the filesystem after the
+ * filesystem has been created, if the filesystem's (virtual) device is made
+ * larger.  See man gfs_grow and gfs_jadd.
+ *
+ * A few special hidden inodes are contained in a GFS filesystem.  They do
+ * not appear in any directories; instead, the superblock points to them
+ * using block numbers for their location.  The special inodes are:
+ *
+ *   Root inode:  Root directory of the filesystem
+ *   Resource Group Index:  A file containing block numbers and sizes of all RGs
+ *   Journal Index:  A file containing block numbers and sizes of all journals
+ *   Quota:  A file containing all quota information for the filesystem
+ *   License:  A file containing license information
+ *
+ * Note that there is NOTHING RELATED TO INTER-NODE LOCK MANAGEMENT ON-DISK.
+ * Locking is handled completely off-disk, typically via LAN.
+ *
+ * NOTE:
+ * If you add 8 byte fields to these structures, they must be 8 byte
+ * aligned.  4 byte field must be 4 byte aligned, etc...
+ *
+ * All structures must be a multiple of 8 bytes long.
+ *
+ * GRIPES:
+ * We should have forgetten about supporting 512B FS block sizes 
+ * and made the di_reserved field in the struct gfs_dinode structure
+ * much bigger.
+ *
+ * de_rec_len in struct gfs_dirent should really have been a 32-bit value
+ * as it now limits us to a 64k FS block size (with the current code
+ * in dir.c).
+ */
+
+#ifndef __GFS_ONDISK_DOT_H__
+#define __GFS_ONDISK_DOT_H__
+
+#define GFS_MAGIC               (0x01161970) /* for all on-disk headers */
+#define GFS_BASIC_BLOCK         (512)  /* "basic block" = "sector" = 512B */
+#define GFS_BASIC_BLOCK_SHIFT   (9)
+
+/*  Controls how much data can be logged in-core before dumping log to disk */
+
+#define GFS_DUMPS_PER_LOG       (4)    /* 1/4 of on-disk journal size*/
+
+/*  Lock numbers of the LM_TYPE_NONDISK type.  These protect certain
+ *  cluster-wide operations (rather than on-disk entities).
+ *  Currently, the LIVE lock is not used for any real purpose.  */
+
+#define GFS_MOUNT_LOCK          (0)    /* only one node can Mount at a time */
+#define GFS_LIVE_LOCK           (1)    /* shared by all mounted nodes */
+#define GFS_TRANS_LOCK          (2)    /* Transaction, protects jrnl recovery */
+#define GFS_RENAME_LOCK         (3)    /* only one node can Rename at a time */
+
+/*  On-disk format (version) numbers for various metadata types,
+ *  used in gfs_meta_header  */
+
+#define GFS_FORMAT_SB           (100)  /* Super-Block */
+#define GFS_FORMAT_RG           (200)  /* Resource Group Header */
+#define GFS_FORMAT_RB           (300)  /* Resource Group Block Alloc BitBlock */
+#define GFS_FORMAT_DI           (400)  /* "Disk" inode (dinode) */
+#define GFS_FORMAT_IN           (500)  /* Indirect dinode block list */
+#define GFS_FORMAT_LF           (600)  /* Leaf dinode block list */
+#define GFS_FORMAT_JD           (700)  /* Journal Data */
+#define GFS_FORMAT_LH           (800)  /* Log Header */
+#define GFS_FORMAT_LD           (900)  /* Log Descriptor */
+/*  These don't have actual struct gfs_meta_header structures to go with them */
+#define GFS_FORMAT_JI           (1000) /* Journal Index */
+#define GFS_FORMAT_RI           (1100) /* Resource Group Index */
+#define GFS_FORMAT_DE           (1200) /* Directory Entry */
+#define GFS_FORMAT_QU           (1500) /* Quota */
+#define GFS_FORMAT_EA           (1600) /* Extended Attribute */
+#define GFS_FORMAT_ED           (1700) /* Extended Attribute data */
+/*  These version #s are embedded in the superblock  */
+#define GFS_FORMAT_FS           (1309) /* Filesystem (all-encompassing) */
+#define GFS_FORMAT_MULTI        (1401) /* Multi-Host */
+
+/*
+ *  An on-disk inode number
+ *  Initially, the on-disk block address of the inode block is assigned as the
+ *  formal (permanent) ID as well.  Block address can change (to move inode
+ *  on-disk), but formal ID must stay unchanged once assigned.
+ */
+
+#define gfs_inum_equal(ino1, ino2) \
+(((ino1)->no_formal_ino == (ino2)->no_formal_ino) && \
+ ((ino1)->no_addr == (ino2)->no_addr))
+
+struct gfs_inum {
+	uint64_t no_formal_ino;        /* inode identifier */
+	uint64_t no_addr;              /* block # of dinode block */
+};
+
+/*
+ *  Generic metadata head structure
+ *
+ *  Every inplace buffer logged in the journal must start
+ *  with a struct gfs_meta_header.
+ *
+ *  In addition to telling what kind of metadata is in the block,
+ *  the metaheader contains the important generation and incarnation
+ *  numbers.
+ *
+ *  The generation number is used during journal recovery to determine
+ *  whether an in-place block on-disk is older than an on-disk journaled copy
+ *  of the block.  If so, GFS overwrites the in-place block with the journaled
+ *  version of the block.
+ *
+ *  A meta block's generation number must increment monotonically across the
+ *  cluster, each time new contents are committed to the block.  This means
+ *  that whenever GFS allocates a pre-existing metadata block, GFS must read
+ *  that block from disk (in case another node has incremented it).  It also
+ *  means that GFS must sync the block (with incremented generation number)
+ *  to disk (both log and in-place blocks), not only after changing contents
+ *  of the block, but also after de-allocating the block (GFS can't just throw
+ *  away incore metadata for a file that it's just erased).
+ *
+ *  The incarnation number is used only for on-disk (d)inodes.  GFS increments
+ *  it each time it de-allocates a dinode block (i.e. each time the dinode
+ *  loses its identity with a particular file, directory, etc.).  When the
+ *  dinode is later allocated (i.e. to be identified with a new file, etc.),
+ *  GFS copies the incarnation number into the VFS inode's i_generation member.
+ *  If GFS is used as the backing store for an NFS server, GFS uses this
+ *  i_generation number as part of the NFS filehandle, which differentiates
+ *  it from the previous identity of the dinode, and helps protect against
+ *  filesystem corruption that could happen with the use of outdated,
+ *  invalid, or malicious filehandles.  See ops_export.c.
+ *
+ *  GFS caches de-allocated meta-headers, to minimize disk reads.
+ *  See struct gfs_meta_header_cache.
+ */
+
+#define GFS_METATYPE_NONE       (0)
+#define GFS_METATYPE_SB         (1)    /* Super-Block */
+#define GFS_METATYPE_RG         (2)    /* Resource Group Header */
+#define GFS_METATYPE_RB         (3)    /* Resource Group Block Alloc BitBlock */
+#define GFS_METATYPE_DI         (4)    /* "Disk" inode (dinode) */
+#define GFS_METATYPE_IN         (5)    /* Indirect dinode block list */
+#define GFS_METATYPE_LF         (6)    /* Leaf dinode block list */
+#define GFS_METATYPE_JD         (7)    /* Journal Data */
+#define GFS_METATYPE_LH         (8)    /* Log Header (gfs_log_header) */
+#define GFS_METATYPE_LD         (9)    /* Log Descriptor (gfs_log_descriptor) */
+#define GFS_METATYPE_EA         (10)   /* Extended Attribute */
+#define GFS_METATYPE_ED         (11)   /* Extended Attribute data */
+
+#define GFS_META_CLUMP          (64)   /* # blocks to convert fm data to meta */
+
+struct gfs_meta_header {
+	uint32_t mh_magic;      /* GFS_MAGIC sanity check magic number */
+	uint32_t mh_type;       /* GFS_METATYPE_XX type of metadata block */
+	uint64_t mh_generation; /* increment before writing to journal */
+	uint32_t mh_format;     /* GFS_FORMAT_XX (version # for this type) */
+	uint32_t mh_incarn;     /* increment when marking dinode "unused" */
+};
+
+/*
+ *  super-block structure
+ *
+ *  One of these is at beginning of filesystem.
+ *  It's probably good if SIZEOF_SB <= GFS_BASIC_BLOCK (512 bytes)
+ */
+
+/*  Address of SuperBlock in GFS basic blocks.  1st 64K of filesystem is empty
+    for safety against getting clobbered by wayward volume managers, etc.
+    64k was chosen because it's the largest GFS-supported fs block size.  */
+#define GFS_SB_ADDR             (128)
+
+/*  The lock number for the superblock (must be zero)  */
+#define GFS_SB_LOCK             (0)
+#define GFS_CRAP_LOCK           (1)
+
+/*  Requirement:  GFS_LOCKNAME_LEN % 8 == 0
+    Includes: the fencing zero at the end  */
+#define GFS_LOCKNAME_LEN        (64)
+
+struct gfs_sb {
+	/*  Order is important; need to be able to read old superblocks
+	    in order to support on-disk version upgrades */
+	struct gfs_meta_header sb_header;
+
+	uint32_t sb_fs_format;         /* GFS_FORMAT_FS (on-disk version) */
+	uint32_t sb_multihost_format;  /* GFS_FORMAT_MULTI */
+	uint32_t sb_flags;             /* ?? */
+
+	uint32_t sb_bsize;             /* fundamental FS block size in bytes */
+	uint32_t sb_bsize_shift;       /* log2(sb_bsize) */
+	uint32_t sb_seg_size;          /* Journal segment size in FS blocks */
+
+	/* These special inodes do not appear in any on-disk directory. */
+	struct gfs_inum sb_jindex_di;  /* journal index inode */
+	struct gfs_inum sb_rindex_di;  /* resource group index inode */
+	struct gfs_inum sb_root_di;    /* root directory inode */
+
+	/* Default inter-node locking protocol (lock module) and namespace */
+	char sb_lockproto[GFS_LOCKNAME_LEN]; /* lock protocol name */
+	char sb_locktable[GFS_LOCKNAME_LEN]; /* unique name for this FS */
+
+	/* More special inodes */
+	struct gfs_inum sb_quota_di;   /* quota inode */
+	struct gfs_inum sb_license_di; /* license inode */
+
+	char sb_reserved[96];
+};
+
+/*
+ *  journal index structure 
+ *
+ *  One for each journal used by the filesystem.
+ *  These descriptors are packed contiguously within the jindex inode (file).
+ */
+
+struct gfs_jindex {
+	uint64_t ji_addr;       /* starting block of the journal */
+	uint32_t ji_nsegment;   /* number (quantity) of segments in journal */
+	uint32_t ji_pad;
+
+	char ji_reserved[64];
+};
+
+/*
+ *  resource index structure 
+ *
+ *  One of these for each resource group in the filesystem.
+ *  These descriptors are packed contiguously within the rindex inode (file).
+ *  Also see struct gfs_rgrp.
+ */
+
+struct gfs_rindex {
+	uint64_t ri_addr;     /* block # of 1st block (header) in rgrp */
+	uint32_t ri_length;   /* # fs blocks containing rgrp header & bitmap */
+	uint32_t ri_pad;
+
+	uint64_t ri_data1;    /* block # of first data/meta block in rgrp */
+	uint32_t ri_data;     /* number (qty) of data/meta blocks in rgrp */
+
+	uint32_t ri_bitbytes; /* total # bytes used by block alloc bitmap */
+
+	char ri_reserved[64];
+};
+
+/*
+ *  resource group header structure
+ *
+ *  One of these at beginning of the first block of an rgrp,
+ *     followed by block alloc bitmap data in remainder of first block.
+ *  Each resource group contains:
+ *    Header block, including block allocation statistics (struct gfs_rgrp)
+ *       and first part of block alloc bitmap.
+ *    Bitmap block(s), continuing block alloc bitmap started in header block.
+ *    Data/meta blocks, allocatable blocks containing file data and metadata.
+ *  
+ *  In older versions, now-unused (but previously allocated) dinodes were
+ *  saved for re-use in an on-disk linked list (chain).  This is no longer
+ *  done, but support still exists for reclaiming dinodes from this list,
+ *  to support upgrades from older on-disk formats.
+ */
+
+/* Each data block within rgrp is represented by 2 bits in the alloc bitmap */
+#define GFS_NBBY                (4)  /* # blocks represented by 1 bitmap byte */
+#define GFS_BIT_SIZE            (2)
+#define GFS_BIT_MASK            (0x00000003)
+
+/*
+ * 4 possible block allocation states:
+ *   bit 0 = alloc(1)/free(0)
+ *   bit 1 = metadata(1)/data(0)
+ */
+#define GFS_BLKST_FREE          (0)
+#define GFS_BLKST_USED          (1)
+#define GFS_BLKST_FREEMETA      (2)
+#define GFS_BLKST_USEDMETA      (3)
+
+struct gfs_rgrp {
+	struct gfs_meta_header rg_header;
+
+	uint32_t rg_flags;      /* ?? */
+
+	uint32_t rg_free;       /* Number (qty) of free data blocks */
+
+	/* Dinodes are USEDMETA, but are handled separately from other METAs */
+	uint32_t rg_useddi;     /* Number (qty) of dinodes (used or free) */
+	uint32_t rg_freedi;     /* Number (qty) of unused (free) dinodes */
+	struct gfs_inum rg_freedi_list; /* 1st block in chain of free dinodes */
+
+	/* These META statistics do not include dinodes (used or free) */
+	uint32_t rg_usedmeta;   /* Number (qty) of used metadata blocks */
+	uint32_t rg_freemeta;   /* Number (qty) of unused metadata blocks */
+
+	char rg_reserved[64];
+};
+
+/*
+ *  quota structure
+ */
+
+struct gfs_quota {
+	uint64_t qu_limit;
+	uint64_t qu_warn;
+	int64_t qu_value;
+
+	char qu_reserved[64];
+};
+
+/*
+ *  dinode (disk inode) structure
+ *  The ondisk representation of inodes
+ *  One for each file, directory, etc.
+ *  GFS does not put more than one inode in a single block.
+ *  The inode may be "stuffed", carrying file data along with metadata,
+ *    if the file data is small enough.
+ *  Otherwise, the inode block contains pointers to other blocks that contain
+ *    either file data or other pointers to other blocks (indirect addressing
+ *    via a metadata tree).
+ */
+
+#define GFS_MAX_META_HEIGHT     (10)
+#define GFS_DIR_MAX_DEPTH       (17)
+
+/*  Dinode types  */
+#define GFS_FILE_NON            (0)
+#define GFS_FILE_REG            (1)    /* regular file */
+#define GFS_FILE_DIR            (2)    /* directory */
+#define GFS_FILE_LNK            (5)    /* link */
+#define GFS_FILE_BLK            (7)    /* block device node */
+#define GFS_FILE_CHR            (8)    /* character device node */
+#define GFS_FILE_FIFO           (101)  /* fifo/pipe */
+#define GFS_FILE_SOCK           (102)  /* socket */
+
+/*  Dinode flags  */
+#define GFS_DIF_JDATA             (0x00000001) /* jrnl all data for this file */
+#define GFS_DIF_EXHASH            (0x00000002) /* hashed directory (leaves) */
+#define GFS_DIF_UNUSED            (0x00000004) /* unused dinode */
+#define GFS_DIF_EA_INDIRECT       (0x00000008) /* extended attribute, indirect*/
+#define GFS_DIF_DIRECTIO          (0x00000010)
+#define GFS_DIF_IMMUTABLE         (0x00000020) /* Can't change file */
+#define GFS_DIF_APPENDONLY        (0x00000040) /* Can only add to end of file */
+#define GFS_DIF_NOATIME           (0x00000080) /* Don't update access time
+						  (currently unused/ignored) */
+#define GFS_DIF_SYNC              (0x00000100) /* Flush to disk, don't cache
+						  (currently unused/ignored) */
+#define GFS_DIF_INHERIT_DIRECTIO  (0x40000000) /* new files get DIRECTIO flag */
+#define GFS_DIF_INHERIT_JDATA     (0x80000000) /* new files get JDATA flag */
+
+struct gfs_dinode {
+	struct gfs_meta_header di_header;
+
+	struct gfs_inum di_num; /* formal inode # and block address */
+
+	uint32_t di_mode;	/* mode of file */
+	uint32_t di_uid;	/* owner's user id */
+	uint32_t di_gid;	/* owner's group id */
+	uint32_t di_nlink;	/* number (qty) of links to this file */
+	uint64_t di_size;	/* number (qty) of bytes in file */
+	uint64_t di_blocks;	/* number (qty) of blocks in file */
+	int64_t di_atime;	/* time last accessed */
+	int64_t di_mtime;	/* time last modified */
+	int64_t di_ctime;	/* time last changed */
+
+	/*  Non-zero only for character or block device nodes  */
+	uint32_t di_major;	/* device major number */
+	uint32_t di_minor;	/* device minor number */
+
+	/*  Block allocation strategy  */
+	uint64_t di_rgrp;	/* dinode rgrp block number */
+	uint64_t di_goal_rgrp;	/* rgrp to alloc from next */
+	uint32_t di_goal_dblk;	/* data block goal */
+	uint32_t di_goal_mblk;	/* metadata block goal */
+
+	uint32_t di_flags;	/* GFS_DIF_... */
+
+	/*  struct gfs_rindex, struct gfs_jindex, or struct gfs_dirent */
+	uint32_t di_payload_format;  /* GFS_FORMAT_... */
+	uint16_t di_type;	/* GFS_FILE_... type of file */
+	uint16_t di_height;	/* height of metadata (0 == stuffed) */
+	uint32_t di_incarn;	/* incarnation (unused, see gfs_meta_header) */
+	uint16_t di_pad;
+
+	/*  These only apply to directories  */
+	uint16_t di_depth;	/* Number of bits in the table */
+	uint32_t di_entries;	/* The # (qty) of entries in the directory */
+
+	/*  This formed an on-disk chain of unused dinodes  */
+	struct gfs_inum di_next_unused;  /* used in old versions only */
+
+	uint64_t di_eattr;	/* extended attribute block number */
+
+	char di_reserved[56];
+};
+
+/*
+ *  indirect block header
+ *
+ *  A component of a dinode's indirect addressing metadata tree.
+ *  These are pointed to by pointers in dinodes or other indirect blocks.
+ */
+
+struct gfs_indirect {
+	struct gfs_meta_header in_header;
+
+	char in_reserved[64];
+};
+
+/*
+ *  directory structure - many of these per directory file
+ *
+ * See comments at beginning of dir.c
+ */
+
+#define GFS_FNAMESIZE               (255)
+#define GFS_DIRENT_SIZE(name_len) ((sizeof(struct gfs_dirent) + (name_len) + 7) & ~7)
+#define IS_LEAF     (1) /* Hashed (leaf) directory */
+#define IS_DINODE   (2) /* Linear (stuffed dinode block) directory */
+
+struct gfs_dirent {
+	struct gfs_inum de_inum;    /* formal inode number and block address */
+	uint32_t de_hash;           /* hash of the filename */
+	uint16_t de_rec_len;        /* the length of the dirent */
+	uint16_t de_name_len;       /* the length of the name */
+	uint16_t de_type;           /* GFS_FILE_... type of dinode this points to */
+
+	char de_reserved[14];
+};
+
+/*
+ *  Header of leaf directory nodes
+ *
+ * See comments at beginning of dir.c
+ */
+
+struct gfs_leaf {
+	struct gfs_meta_header lf_header;
+
+	uint16_t lf_depth;          /* Depth of leaf */
+	uint16_t lf_entries;        /* Number of dirents in leaf */
+	uint32_t lf_dirent_format;  /* GFS_FORMAT_DE (version #) */
+	uint64_t lf_next;           /* Next leaf, if overflow */
+
+	char lf_reserved[64];
+};
+
+/*
+ *  Log header structure
+ *
+ *  Two of these are in the first block of a transaction log:
+ *    1)  at beginning of block
+ *    2)  at end of first 512-byte sector within block
+ */
+
+#define GFS_LOG_HEAD_UNMOUNT    (0x00000001)  /* log is clean, can unmount fs */
+
+struct gfs_log_header {
+	struct gfs_meta_header lh_header;
+
+	uint32_t lh_flags;	/* GFS_LOG_HEAD_... */
+	uint32_t lh_pad;
+
+	uint64_t lh_first;	/* Block number of first header in this trans */
+	uint64_t lh_sequence;	/* Sequence number of this transaction */
+
+	uint64_t lh_tail;	/* Block number of log tail */
+	uint64_t lh_last_dump;	/* Block number of last dump */
+
+	char lh_reserved[64];
+};
+
+/*
+ *  Log type descriptor
+ *
+ *  One of these for each chunk in a transaction
+ */
+
+#define GFS_LOG_DESC_METADATA   (300)    /* metadata */
+/*  ld_data1 is the number (quantity) of metadata blocks in the descriptor.
+    ld_data2 is unused.
+    */
+
+#define GFS_LOG_DESC_IUL        (400)    /* unlinked inode */
+/*  ld_data1 is TRUE if this is a dump.
+    ld_data2 is unused.
+    FixMe!!!  ld_data1 should be the number (quantity) of entries.
+              ld_data2 should be "TRUE if this is a dump".
+    */
+
+#define GFS_LOG_DESC_IDA        (401)    /* de-allocated inode */
+/*  ld_data1 is unused.
+    ld_data2 is unused.
+    FixMe!!!  ld_data1 should be the number (quantity) of entries.
+    */
+
+#define GFS_LOG_DESC_Q          (402)    /* quota */
+/*  ld_data1 is the number of quota changes in the descriptor.
+    ld_data2 is TRUE if this is a dump.
+    */
+
+#define GFS_LOG_DESC_LAST       (500)    /* final in a logged transaction */
+/*  ld_data1 is unused.
+    ld_data2 is unused.
+    */
+
+struct gfs_log_descriptor {
+	struct gfs_meta_header ld_header;
+
+	uint32_t ld_type;	/* GFS_LOG_DESC_... Type of this log chunk */
+	uint32_t ld_length;	/* Number of buffers in this chunk */
+	uint32_t ld_data1;	/* descriptor-specific field */
+	uint32_t ld_data2;	/* descriptor-specific field */
+
+	char ld_reserved[64];
+};
+
+/*
+ *  Metadata block tags
+ *
+ *  One for each logged block.  Tells where block really belongs on-disk.
+ *  These descriptor tags are packed contiguously after a gfs_log_descriptor.
+ */
+
+struct gfs_block_tag {
+	uint64_t bt_blkno;	/* inplace block number */
+	uint32_t bt_flags;	/* ?? */
+	uint32_t bt_pad;
+};
+
+/*
+ *  Quota Journal Tag
+ */
+
+#define GFS_QTF_USER            (0x00000001)
+
+struct gfs_quota_tag {
+	int64_t qt_change;
+	uint32_t qt_flags;      /* GFS_QTF_... */
+	uint32_t qt_id;
+};
+
+/*
+ *  Extended attribute header format
+ */
+
+#define GFS_EA_MAX_NAME_LEN     (255)
+#define GFS_EA_MAX_DATA_LEN     (65536)
+
+#define GFS_EATYPE_UNUSED       (0)
+#define GFS_EATYPE_USR          (1)     /* user attribute */
+#define GFS_EATYPE_SYS          (2)     /* system attribute */
+#define GFS_EATYPE_SECURITY	(3)	/* security attribute */
+
+#define GFS_EATYPE_LAST         (3)
+#define GFS_EATYPE_VALID(x)     ((x) <= GFS_EATYPE_LAST)
+
+#define GFS_EAFLAG_LAST         (0x01)	/* last ea in block */
+
+struct gfs_ea_header {
+	uint32_t ea_rec_len;    /* total record length: hdr + name + data */
+	uint32_t ea_data_len;   /* data length, in bytes */
+	uint8_t ea_name_len;    /* no NULL pointer after the string */
+	uint8_t ea_type;        /* GFS_EATYPE_... */
+	uint8_t ea_flags;       /* GFS_EAFLAG_... */
+	uint8_t ea_num_ptrs;    /* # fs blocks needed for EA */
+	uint32_t ea_pad;
+};
+
+/*
+ * Statfs change
+ * Describes an change to the pool of free and allocated
+ * blocks.
+ */
+
+struct gfs_statfs_change {
+	uint64_t sc_total;
+	uint64_t sc_free;
+	uint64_t sc_dinodes;
+};
+
+struct gfs_statfs_change_host {
+	int64_t sc_total;
+	int64_t sc_free;
+	int64_t sc_dinodes;
+};
+
+/*  Endian functions  */
+
+#define GFS_ENDIAN_BIG
+
+#ifdef GFS_ENDIAN_BIG
+
+#define gfs16_to_cpu be16_to_cpu
+#define gfs32_to_cpu be32_to_cpu
+#define gfs64_to_cpu be64_to_cpu
+
+#define cpu_to_gfs16 cpu_to_be16
+#define cpu_to_gfs32 cpu_to_be32
+#define cpu_to_gfs64 cpu_to_be64
+
+#else				/*  GFS_ENDIAN_BIG  */
+
+#define gfs16_to_cpu le16_to_cpu
+#define gfs32_to_cpu le32_to_cpu
+#define gfs64_to_cpu le64_to_cpu
+
+#define cpu_to_gfs16 cpu_to_le16
+#define cpu_to_gfs32 cpu_to_le32
+#define cpu_to_gfs64 cpu_to_le64
+
+#endif				/*  GFS_ENDIAN_BIG  */
+
+/*  Translation functions  */
+
+void gfs_inum_in(struct gfs_inum *no, char *buf);
+void gfs_inum_out(struct gfs_inum *no, char *buf);
+void gfs_meta_header_in(struct gfs_meta_header *mh, char *buf);
+void gfs_meta_header_out(struct gfs_meta_header *mh, char *buf);
+void gfs_sb_in(struct gfs_sb *sb, char *buf);
+void gfs_sb_out(struct gfs_sb *sb, char *buf);
+void gfs_jindex_in(struct gfs_jindex *jindex, char *buf);
+void gfs_jindex_out(struct gfs_jindex *jindex, char *buf);
+void gfs_rindex_in(struct gfs_rindex *rindex, char *buf);
+void gfs_rindex_out(struct gfs_rindex *rindex, char *buf);
+void gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf);
+void gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf);
+void gfs_quota_in(struct gfs_quota *quota, char *buf);
+void gfs_quota_out(struct gfs_quota *quota, char *buf);
+void gfs_dinode_in(struct gfs_dinode *dinode, char *buf);
+void gfs_dinode_out(struct gfs_dinode *dinode, char *buf);
+void gfs_indirect_in(struct gfs_indirect *indirect, char *buf);
+void gfs_indirect_out(struct gfs_indirect *indirect, char *buf);
+void gfs_dirent_in(struct gfs_dirent *dirent, char *buf);
+void gfs_dirent_out(struct gfs_dirent *dirent, char *buf);
+void gfs_leaf_in(struct gfs_leaf *leaf, char *buf);
+void gfs_leaf_out(struct gfs_leaf *leaf, char *buf);
+void gfs_log_header_in(struct gfs_log_header *head, char *buf);
+void gfs_log_header_out(struct gfs_log_header *head, char *buf);
+void gfs_desc_in(struct gfs_log_descriptor *desc, char *buf);
+void gfs_desc_out(struct gfs_log_descriptor *desc, char *buf);
+void gfs_block_tag_in(struct gfs_block_tag *btag, char *buf);
+void gfs_block_tag_out(struct gfs_block_tag *btag, char *buf);
+void gfs_quota_tag_in(struct gfs_quota_tag *qtag, char *buf);
+void gfs_quota_tag_out(struct gfs_quota_tag *qtag, char *buf);
+void gfs_ea_header_in(struct gfs_ea_header *qtag, char *buf);
+void gfs_ea_header_out(struct gfs_ea_header *qtag, char *buf);
+
+/*  Printing functions  */
+
+void gfs_inum_print(struct gfs_inum *no);
+void gfs_meta_header_print(struct gfs_meta_header *mh);
+void gfs_sb_print(struct gfs_sb *sb);
+void gfs_jindex_print(struct gfs_jindex *jindex);
+void gfs_rindex_print(struct gfs_rindex *rindex);
+void gfs_rgrp_print(struct gfs_rgrp *rgrp);
+void gfs_quota_print(struct gfs_quota *quota);
+void gfs_dinode_print(struct gfs_dinode *dinode);
+void gfs_indirect_print(struct gfs_indirect *indirect);
+void gfs_dirent_print(struct gfs_dirent *dirent, const char *name);
+void gfs_leaf_print(struct gfs_leaf *leaf);
+void gfs_log_header_print(struct gfs_log_header *head);
+void gfs_desc_print(struct gfs_log_descriptor *desc);
+void gfs_block_tag_print(struct gfs_block_tag *tag);
+void gfs_quota_tag_print(struct gfs_quota_tag *tag);
+void gfs_ea_header_print(struct gfs_ea_header *ea, char *name);
+
+/*  The hash function for ExHash directories  */
+
+uint32_t gfs_dir_hash(const char *data, int len);
+
+#endif /* __GFS_ONDISK_DOT_H__ */
+
+
+
+#ifdef WANT_GFS_CONVERSION_FUNCTIONS
+
+#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
+#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
+#define CPIN_16(s1, s2, member) {(s1->member) = gfs16_to_cpu((s2->member));}
+#define CPOUT_16(s1, s2, member) {(s2->member) = cpu_to_gfs16((s1->member));}
+#define CPIN_32(s1, s2, member) {(s1->member) = gfs32_to_cpu((s2->member));}
+#define CPOUT_32(s1, s2, member) {(s2->member) = cpu_to_gfs32((s1->member));}
+#define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));}
+#define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));}
+
+#define pa(struct, member, count) print_array(#member, struct->member, count);
+
+/**
+ * print_array - Print out an array of bytes
+ * @title: what to print before the array
+ * @buf: the array
+ * @count: the number of bytes
+ *
+ */
+
+static void
+print_array(const char *title, char *buf, int count)
+{
+	int x;
+
+	printk("  %s =\n", title);
+	for (x = 0; x < count; x++) {
+		printk("%.2X ", (unsigned char)buf[x]);
+		if (x % 16 == 15)
+			printk("\n");
+	}
+	if (x % 16)
+		printk("\n");
+}
+
+/**
+ * gfs_inum_in - Read in an inode number
+ * @no: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_inum_in(struct gfs_inum *no, char *buf)
+{
+	struct gfs_inum *str = (struct gfs_inum *)buf;
+
+	CPIN_64(no, str, no_formal_ino);
+	CPIN_64(no, str, no_addr);
+}
+
+/**
+ * gfs_inum_out - Write out an inode number
+ * @no: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_inum_out(struct gfs_inum *no, char *buf)
+{
+	struct gfs_inum *str = (struct gfs_inum *)buf;
+
+	CPOUT_64(no, str, no_formal_ino);
+	CPOUT_64(no, str, no_addr);
+}
+
+/**
+ * gfs_inum_print - Print out a inode number
+ * @no: the cpu-order buffer
+ *
+ */
+
+void
+gfs_inum_print(struct gfs_inum *no)
+{
+	pv(no, no_formal_ino, "%"PRIu64);
+	pv(no, no_addr, "%"PRIu64);
+}
+
+/**
+ * gfs_meta_header_in - Read in a metadata header
+ * @mh: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_meta_header_in(struct gfs_meta_header *mh, char *buf)
+{
+	struct gfs_meta_header *str = (struct gfs_meta_header *)buf;
+
+	CPIN_32(mh, str, mh_magic);
+	CPIN_32(mh, str, mh_type);
+	CPIN_64(mh, str, mh_generation);
+	CPIN_32(mh, str, mh_format);
+	CPIN_32(mh, str, mh_incarn);
+}
+
+/**
+ * gfs_meta_header_in - Write out a metadata header
+ * @mh: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ * Don't ever change the generation number in this routine.
+ * It's done manually in increment_generation().
+ */
+
+void
+gfs_meta_header_out(struct gfs_meta_header *mh, char *buf)
+{
+	struct gfs_meta_header *str = (struct gfs_meta_header *)buf;
+
+	CPOUT_32(mh, str, mh_magic);
+	CPOUT_32(mh, str, mh_type);
+#if 0
+	/* Don't do this!
+	   Mh_generation should only be change manually. */
+	CPOUT_64(mh, str, mh_generation);
+#endif
+	CPOUT_32(mh, str, mh_format);
+	CPOUT_32(mh, str, mh_incarn);
+}
+
+/**
+ * gfs_meta_header_print - Print out a metadata header
+ * @mh: the cpu-order buffer
+ *
+ */
+
+void
+gfs_meta_header_print(struct gfs_meta_header *mh)
+{
+	pv(mh, mh_magic, "0x%.8X");
+	pv(mh, mh_type, "%u");
+	pv(mh, mh_generation, "%"PRIu64);
+	pv(mh, mh_format, "%u");
+	pv(mh, mh_incarn, "%u");
+}
+
+/**
+ * gfs_sb_in - Read in a superblock
+ * @sb: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_sb_in(struct gfs_sb *sb, char *buf)
+{
+	struct gfs_sb *str = (struct gfs_sb *)buf;
+
+	gfs_meta_header_in(&sb->sb_header, buf);
+
+	CPIN_32(sb, str, sb_fs_format);
+	CPIN_32(sb, str, sb_multihost_format);
+	CPIN_32(sb, str, sb_flags);
+
+	CPIN_32(sb, str, sb_bsize);
+	CPIN_32(sb, str, sb_bsize_shift);
+	CPIN_32(sb, str, sb_seg_size);
+
+	gfs_inum_in(&sb->sb_jindex_di, (char *)&str->sb_jindex_di);
+	gfs_inum_in(&sb->sb_rindex_di, (char *)&str->sb_rindex_di);
+	gfs_inum_in(&sb->sb_root_di, (char *)&str->sb_root_di);
+
+	CPIN_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
+	CPIN_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
+
+	gfs_inum_in(&sb->sb_quota_di, (char *)&str->sb_quota_di);
+	gfs_inum_in(&sb->sb_license_di, (char *)&str->sb_license_di);
+
+	CPIN_08(sb, str, sb_reserved, 96);
+}
+
+/**
+ * gfs_sb_out - Write out a superblock
+ * @sb: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_sb_out(struct gfs_sb *sb, char *buf)
+{
+	struct gfs_sb *str = (struct gfs_sb *)buf;
+
+	gfs_meta_header_out(&sb->sb_header, buf);
+
+	CPOUT_32(sb, str, sb_fs_format);
+	CPOUT_32(sb, str, sb_multihost_format);
+	CPOUT_32(sb, str, sb_flags);
+
+	CPOUT_32(sb, str, sb_bsize);
+	CPOUT_32(sb, str, sb_bsize_shift);
+	CPOUT_32(sb, str, sb_seg_size);
+
+	gfs_inum_out(&sb->sb_jindex_di, (char *)&str->sb_jindex_di);
+	gfs_inum_out(&sb->sb_rindex_di, (char *)&str->sb_rindex_di);
+	gfs_inum_out(&sb->sb_root_di, (char *)&str->sb_root_di);
+
+	CPOUT_08(sb, str, sb_lockproto, GFS_LOCKNAME_LEN);
+	CPOUT_08(sb, str, sb_locktable, GFS_LOCKNAME_LEN);
+
+	gfs_inum_out(&sb->sb_quota_di, (char *)&str->sb_quota_di);
+	gfs_inum_out(&sb->sb_license_di, (char *)&str->sb_license_di);
+
+	CPOUT_08(sb, str, sb_reserved, 96);
+}
+
+/**
+ * gfs_sb_print - Print out a superblock
+ * @sb: the cpu-order buffer
+ *
+ */
+
+void
+gfs_sb_print(struct gfs_sb *sb)
+{
+	gfs_meta_header_print(&sb->sb_header);
+
+	pv(sb, sb_fs_format, "%u");
+	pv(sb, sb_multihost_format, "%u");
+	pv(sb, sb_flags, "%u");
+
+	pv(sb, sb_bsize, "%u");
+	pv(sb, sb_bsize_shift, "%u");
+	pv(sb, sb_seg_size, "%u");
+
+	gfs_inum_print(&sb->sb_jindex_di);
+	gfs_inum_print(&sb->sb_rindex_di);
+	gfs_inum_print(&sb->sb_root_di);
+
+	pv(sb, sb_lockproto, "%s");
+	pv(sb, sb_locktable, "%s");
+
+	gfs_inum_print(&sb->sb_quota_di);
+	gfs_inum_print(&sb->sb_license_di);
+
+	pa(sb, sb_reserved, 96);
+}
+
+/**
+ * gfs_jindex_in - Read in a journal index structure
+ * @jindex: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_jindex_in(struct gfs_jindex *jindex, char *buf)
+{
+	struct gfs_jindex *str = (struct gfs_jindex *)buf;
+
+	CPIN_64(jindex, str, ji_addr);
+	CPIN_32(jindex, str, ji_nsegment);
+	CPIN_32(jindex, str, ji_pad);
+
+	CPIN_08(jindex, str, ji_reserved, 64);
+}
+
+/**
+ * gfs_jindex_out - Write out a journal index structure
+ * @jindex: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_jindex_out(struct gfs_jindex *jindex, char *buf)
+{
+	struct gfs_jindex *str = (struct gfs_jindex *)buf;
+
+	CPOUT_64(jindex, str, ji_addr);
+	CPOUT_32(jindex, str, ji_nsegment);
+	CPOUT_32(jindex, str, ji_pad);
+
+	CPOUT_08(jindex, str, ji_reserved, 64);
+}
+
+/**
+ * gfs_jindex_print - Print out a journal index structure
+ * @ji: the cpu-order buffer
+ *
+ */
+
+void
+gfs_jindex_print(struct gfs_jindex *ji)
+{
+	pv(ji, ji_addr, "%"PRIu64);
+	pv(ji, ji_nsegment, "%u");
+	pv(ji, ji_pad, "%u");
+
+	pa(ji, ji_reserved, 64);
+}
+
+/**
+ * gfs_rindex_in - Read in a resource index structure
+ * @rindex: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_rindex_in(struct gfs_rindex *grindex, char *buf)
+{
+	struct gfs_rindex *str = (struct gfs_rindex *)buf;
+
+	CPIN_64(grindex, str, ri_addr);
+	CPIN_32(grindex, str, ri_length);
+	CPIN_32(grindex, str, ri_pad);
+
+	CPIN_64(grindex, str, ri_data1);
+	CPIN_32(grindex, str, ri_data);
+
+	CPIN_32(grindex, str, ri_bitbytes);
+
+	CPIN_08(grindex, str, ri_reserved, 64);
+}
+
+/**
+ * gfs_rindex_out - Write out a resource index structure
+ * @rindex: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_rindex_out(struct gfs_rindex *grindex, char *buf)
+{
+	struct gfs_rindex *str = (struct gfs_rindex *)buf;
+
+	CPOUT_64(grindex, str, ri_addr);
+	CPOUT_32(grindex, str, ri_length);
+	CPOUT_32(grindex, str, ri_pad);
+
+	CPOUT_64(grindex, str, ri_data1);
+	CPOUT_32(grindex, str, ri_data);
+
+	CPOUT_32(grindex, str, ri_bitbytes);
+
+	CPOUT_08(grindex, str, ri_reserved, 64);
+}
+
+/**
+ * gfs_rindex_print - Print out a resource index structure
+ * @ri: the cpu-order buffer
+ *
+ */
+
+void
+gfs_rindex_print(struct gfs_rindex *ri)
+{
+	pv(ri, ri_addr, "%"PRIu64);
+	pv(ri, ri_length, "%u");
+	pv(ri, ri_pad, "%u");
+
+	pv(ri, ri_data1, "%"PRIu64);
+	pv(ri, ri_data, "%u");
+
+	pv(ri, ri_bitbytes, "%u");
+
+	pa(ri, ri_reserved, 64);
+}
+
+/**
+ * gfs_rgrp_in - Read in a resource group header
+ * @rgrp: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf)
+{
+	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
+
+	gfs_meta_header_in(&rgrp->rg_header, buf);
+
+	CPIN_32(rgrp, str, rg_flags);
+
+	CPIN_32(rgrp, str, rg_free);
+
+	CPIN_32(rgrp, str, rg_useddi);
+	CPIN_32(rgrp, str, rg_freedi);
+	gfs_inum_in(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
+
+	CPIN_32(rgrp, str, rg_usedmeta);
+	CPIN_32(rgrp, str, rg_freemeta);
+
+	CPIN_08(rgrp, str, rg_reserved, 64);
+}
+
+/**
+ * gfs_rgrp_out - Write out a resource group header
+ * @rgrp: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf)
+{
+	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
+
+	gfs_meta_header_out(&rgrp->rg_header, buf);
+
+	CPOUT_32(rgrp, str, rg_flags);
+
+	CPOUT_32(rgrp, str, rg_free);
+
+	CPOUT_32(rgrp, str, rg_useddi);
+	CPOUT_32(rgrp, str, rg_freedi);
+	gfs_inum_out(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
+
+	CPOUT_32(rgrp, str, rg_usedmeta);
+	CPOUT_32(rgrp, str, rg_freemeta);
+
+	CPOUT_08(rgrp, str, rg_reserved, 64);
+}
+
+/**
+ * gfs_rgrp_print - Print out a resource group header
+ * @rg: the cpu-order buffer
+ *
+ */
+
+void
+gfs_rgrp_print(struct gfs_rgrp *rg)
+{
+	gfs_meta_header_print(&rg->rg_header);
+
+	pv(rg, rg_flags, "%u");
+
+	pv(rg, rg_free, "%u");
+
+	pv(rg, rg_useddi, "%u");
+	pv(rg, rg_freedi, "%u");
+	gfs_inum_print(&rg->rg_freedi_list);
+
+	pv(rg, rg_usedmeta, "%u");
+	pv(rg, rg_freemeta, "%u");
+
+	pa(rg, rg_reserved, 64);
+}
+
+/**
+ * gfs_quota_in - Read in a quota structures
+ * @quota: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_quota_in(struct gfs_quota *quota, char *buf)
+{
+	struct gfs_quota *str = (struct gfs_quota *)buf;
+
+	CPIN_64(quota, str, qu_limit);
+	CPIN_64(quota, str, qu_warn);
+	CPIN_64(quota, str, qu_value);
+
+	CPIN_08(quota, str, qu_reserved, 64);
+}
+
+/**
+ * gfs_quota_out - Write out a quota structure
+ * @quota: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_quota_out(struct gfs_quota *quota, char *buf)
+{
+	struct gfs_quota *str = (struct gfs_quota *)buf;
+
+	CPOUT_64(quota, str, qu_limit);
+	CPOUT_64(quota, str, qu_warn);
+	CPOUT_64(quota, str, qu_value);
+
+	CPOUT_08(quota, str, qu_reserved, 64);
+}
+
+/**
+ * gfs_quota_print - Print out a quota structure
+ * @quota: the cpu-order buffer
+ *
+ */
+
+void
+gfs_quota_print(struct gfs_quota *quota)
+{
+	pv(quota, qu_limit, "%"PRIu64);
+	pv(quota, qu_warn, "%"PRIu64);
+	pv(quota, qu_value, "%"PRId64);
+
+	pa(quota, qu_reserved, 64);
+}
+
+/**
+ * gfs_dinode_in - Read in a dinode
+ * @dinode: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_dinode_in(struct gfs_dinode *dinode, char *buf)
+{
+	struct gfs_dinode *str = (struct gfs_dinode *)buf;
+
+	gfs_meta_header_in(&dinode->di_header, buf);
+
+	gfs_inum_in(&dinode->di_num, (char *)&str->di_num);
+
+	CPIN_32(dinode, str, di_mode);
+	CPIN_32(dinode, str, di_uid);
+	CPIN_32(dinode, str, di_gid);
+	CPIN_32(dinode, str, di_nlink);
+	CPIN_64(dinode, str, di_size);
+	CPIN_64(dinode, str, di_blocks);
+	CPIN_64(dinode, str, di_atime);
+	CPIN_64(dinode, str, di_mtime);
+	CPIN_64(dinode, str, di_ctime);
+	CPIN_32(dinode, str, di_major);
+	CPIN_32(dinode, str, di_minor);
+
+	CPIN_64(dinode, str, di_rgrp);
+	CPIN_64(dinode, str, di_goal_rgrp);
+	CPIN_32(dinode, str, di_goal_dblk);
+	CPIN_32(dinode, str, di_goal_mblk);
+	CPIN_32(dinode, str, di_flags);
+	CPIN_32(dinode, str, di_payload_format);
+	CPIN_16(dinode, str, di_type);
+	CPIN_16(dinode, str, di_height);
+	CPIN_32(dinode, str, di_incarn);
+	CPIN_16(dinode, str, di_pad);
+
+	CPIN_16(dinode, str, di_depth);
+	CPIN_32(dinode, str, di_entries);
+
+	gfs_inum_in(&dinode->di_next_unused, (char *)&str->di_next_unused);
+
+	CPIN_64(dinode, str, di_eattr);
+
+	CPIN_08(dinode, str, di_reserved, 56);
+}
+
+/**
+ * gfs_dinode_out - Write out a dinode
+ * @dinode: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_dinode_out(struct gfs_dinode *dinode, char *buf)
+{
+	struct gfs_dinode *str = (struct gfs_dinode *)buf;
+
+	gfs_meta_header_out(&dinode->di_header, buf);
+
+	gfs_inum_out(&dinode->di_num, (char *)&str->di_num);
+
+	CPOUT_32(dinode, str, di_mode);
+	CPOUT_32(dinode, str, di_uid);
+	CPOUT_32(dinode, str, di_gid);
+	CPOUT_32(dinode, str, di_nlink);
+	CPOUT_64(dinode, str, di_size);
+	CPOUT_64(dinode, str, di_blocks);
+	CPOUT_64(dinode, str, di_atime);
+	CPOUT_64(dinode, str, di_mtime);
+	CPOUT_64(dinode, str, di_ctime);
+	CPOUT_32(dinode, str, di_major);
+	CPOUT_32(dinode, str, di_minor);
+
+	CPOUT_64(dinode, str, di_rgrp);
+	CPOUT_64(dinode, str, di_goal_rgrp);
+	CPOUT_32(dinode, str, di_goal_dblk);
+	CPOUT_32(dinode, str, di_goal_mblk);
+	CPOUT_32(dinode, str, di_flags);
+	CPOUT_32(dinode, str, di_payload_format);
+	CPOUT_16(dinode, str, di_type);
+	CPOUT_16(dinode, str, di_height);
+	CPOUT_32(dinode, str, di_incarn);
+	CPOUT_16(dinode, str, di_pad);
+
+	CPOUT_16(dinode, str, di_depth);
+	CPOUT_32(dinode, str, di_entries);
+
+	gfs_inum_out(&dinode->di_next_unused, (char *)&str->di_next_unused);
+
+	CPOUT_64(dinode, str, di_eattr);
+
+	CPOUT_08(dinode, str, di_reserved, 56);
+}
+
+/**
+ * gfs_dinode_print - Print out a dinode
+ * @di: the cpu-order buffer
+ *
+ */
+
+void
+gfs_dinode_print(struct gfs_dinode *di)
+{
+	gfs_meta_header_print(&di->di_header);
+
+	gfs_inum_print(&di->di_num);
+
+	pv(di, di_mode, "0%o");
+	pv(di, di_uid, "%u");
+	pv(di, di_gid, "%u");
+	pv(di, di_nlink, "%u");
+	pv(di, di_size, "%"PRIu64);
+	pv(di, di_blocks, "%"PRIu64);
+	pv(di, di_atime, "%"PRId64);
+	pv(di, di_mtime, "%"PRId64);
+	pv(di, di_ctime, "%"PRId64);
+	pv(di, di_major, "%u");
+	pv(di, di_minor, "%u");
+
+	pv(di, di_rgrp, "%"PRIu64);
+	pv(di, di_goal_rgrp, "%"PRIu64);
+	pv(di, di_goal_dblk, "%u");
+	pv(di, di_goal_mblk, "%u");
+	pv(di, di_flags, "0x%.8X");
+	pv(di, di_payload_format, "%u");
+	pv(di, di_type, "%u");
+	pv(di, di_height, "%u");
+	pv(di, di_incarn, "%u");
+	pv(di, di_pad, "%u");
+
+	pv(di, di_depth, "%u");
+	pv(di, di_entries, "%u");
+
+	gfs_inum_print(&di->di_next_unused);
+
+	pv(di, di_eattr, "%"PRIu64);
+
+	pa(di, di_reserved, 56);
+}
+
+/**
+ * gfs_indirect_in - copy in the header of an indirect block
+ * @indirect: the in memory copy
+ * @buf: the buffer copy
+ *
+ */
+
+void
+gfs_indirect_in(struct gfs_indirect *indirect, char *buf)
+{
+	struct gfs_indirect *str = (struct gfs_indirect *)buf;
+
+	gfs_meta_header_in(&indirect->in_header, buf);
+
+	CPIN_08(indirect, str, in_reserved, 64);
+}
+
+/**
+ * gfs_indirect_out - copy out the header of an indirect block
+ * @indirect: the in memory copy
+ * @buf: the buffer copy
+ *
+ */
+
+void
+gfs_indirect_out(struct gfs_indirect *indirect, char *buf)
+{
+	struct gfs_indirect *str = (struct gfs_indirect *)buf;
+
+	gfs_meta_header_out(&indirect->in_header, buf);
+
+	CPOUT_08(indirect, str, in_reserved, 64);
+}
+
+/**
+ * gfs_indirect_print - Print out a indirect block header
+ * @indirect: the cpu-order buffer
+ *
+ */
+
+void
+gfs_indirect_print(struct gfs_indirect *indirect)
+{
+	gfs_meta_header_print(&indirect->in_header);
+
+	pa(indirect, in_reserved, 64);
+}
+
+/**
+ * gfs_dirent_in - Read in a directory entry
+ * @dirent: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_dirent_in(struct gfs_dirent *dirent, char *buf)
+{
+	struct gfs_dirent *str = (struct gfs_dirent *)buf;
+
+	gfs_inum_in(&dirent->de_inum, (char *)&str->de_inum);
+	CPIN_32(dirent, str, de_hash);
+	CPIN_16(dirent, str, de_rec_len);
+	CPIN_16(dirent, str, de_name_len);
+	CPIN_16(dirent, str, de_type);
+
+	CPIN_08(dirent, str, de_reserved, 14);
+}
+
+/**
+ * gfs_dirent_out - Write out a directory entry
+ * @dirent: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_dirent_out(struct gfs_dirent *dirent, char *buf)
+{
+	struct gfs_dirent *str = (struct gfs_dirent *)buf;
+
+	gfs_inum_out(&dirent->de_inum, (char *)&str->de_inum);
+	CPOUT_32(dirent, str, de_hash);
+	CPOUT_16(dirent, str, de_rec_len);
+	CPOUT_16(dirent, str, de_name_len);
+	CPOUT_16(dirent, str, de_type);
+
+	CPOUT_08(dirent, str, de_reserved, 14);
+}
+
+/**
+ * gfs_dirent_print - Print out a directory entry
+ * @de: the cpu-order buffer
+ * @name: the filename
+ *
+ */
+
+void
+gfs_dirent_print(struct gfs_dirent *de, const char *name)
+{
+	char buf[GFS_FNAMESIZE + 1];
+
+	gfs_inum_print(&de->de_inum);
+	pv(de, de_hash, "0x%.8X");
+	pv(de, de_rec_len, "%u");
+	pv(de, de_name_len, "%u");
+	pv(de, de_type, "%u");
+
+	pa(de, de_reserved, 14);
+
+	memset(buf, 0, GFS_FNAMESIZE + 1);
+	memcpy(buf, name, de->de_name_len);
+	printk("  name = %s\n", buf);
+}
+
+/**
+ * gfs_leaf_in - Read in a directory leaf header
+ * @leaf: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_leaf_in(struct gfs_leaf *leaf, char *buf)
+{
+	struct gfs_leaf *str = (struct gfs_leaf *)buf;
+
+	gfs_meta_header_in(&leaf->lf_header, buf);
+
+	CPIN_16(leaf, str, lf_depth);
+	CPIN_16(leaf, str, lf_entries);
+	CPIN_32(leaf, str, lf_dirent_format);
+	CPIN_64(leaf, str, lf_next);
+
+	CPIN_08(leaf, str, lf_reserved, 64);
+}
+
+/**
+ * gfs_leaf_out - Write out a directory leaf header
+ * @leaf: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_leaf_out(struct gfs_leaf *leaf, char *buf)
+{
+	struct gfs_leaf *str = (struct gfs_leaf *)buf;
+
+	gfs_meta_header_out(&leaf->lf_header, buf);
+
+	CPOUT_16(leaf, str, lf_depth);
+	CPOUT_16(leaf, str, lf_entries);
+	CPOUT_32(leaf, str, lf_dirent_format);
+	CPOUT_64(leaf, str, lf_next);
+
+	CPOUT_08(leaf, str, lf_reserved, 64);
+}
+
+/**
+ * gfs_leaf_print - Print out a directory leaf header
+ * @lf: the cpu-order buffer
+ *
+ */
+
+void
+gfs_leaf_print(struct gfs_leaf *lf)
+{
+	gfs_meta_header_print(&lf->lf_header);
+
+	pv(lf, lf_depth, "%u");
+	pv(lf, lf_entries, "%u");
+	pv(lf, lf_dirent_format, "%u");
+	pv(lf, lf_next, "%"PRIu64);
+
+	pa(lf, lf_reserved, 64);
+}
+
+/**
+ * gfs_log_header_in - Read in a log header
+ * @head: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_log_header_in(struct gfs_log_header *head, char *buf)
+{
+	struct gfs_log_header *str = (struct gfs_log_header *)buf;
+
+	gfs_meta_header_in(&head->lh_header, buf);
+
+	CPIN_32(head, str, lh_flags);
+	CPIN_32(head, str, lh_pad);
+
+	CPIN_64(head, str, lh_first);
+	CPIN_64(head, str, lh_sequence);
+
+	CPIN_64(head, str, lh_tail);
+	CPIN_64(head, str, lh_last_dump);
+
+	CPIN_08(head, str, lh_reserved, 64);
+}
+
+/**
+ * gfs_log_header_out - Write out a log header
+ * @head: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_log_header_out(struct gfs_log_header *head, char *buf)
+{
+	struct gfs_log_header *str = (struct gfs_log_header *)buf;
+
+	gfs_meta_header_out(&head->lh_header, buf);
+
+	CPOUT_32(head, str, lh_flags);
+	CPOUT_32(head, str, lh_pad);
+
+	CPOUT_64(head, str, lh_first);
+	CPOUT_64(head, str, lh_sequence);
+
+	CPOUT_64(head, str, lh_tail);
+	CPOUT_64(head, str, lh_last_dump);
+
+	CPOUT_08(head, str, lh_reserved, 64);
+}
+
+/**
+ * gfs_log_header_print - Print out a log header
+ * @head: the cpu-order buffer
+ *
+ */
+
+void
+gfs_log_header_print(struct gfs_log_header *lh)
+{
+	gfs_meta_header_print(&lh->lh_header);
+
+	pv(lh, lh_flags, "0x%.8X");
+	pv(lh, lh_pad, "%u");
+
+	pv(lh, lh_first, "%"PRIu64);
+	pv(lh, lh_sequence, "%"PRIu64);
+
+	pv(lh, lh_tail, "%"PRIu64);
+	pv(lh, lh_last_dump, "%"PRIu64);
+
+	pa(lh, lh_reserved, 64);
+}
+
+/**
+ * gfs_desc_in - Read in a log descriptor
+ * @desc: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_desc_in(struct gfs_log_descriptor *desc, char *buf)
+{
+	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *)buf;
+
+	gfs_meta_header_in(&desc->ld_header, buf);
+
+	CPIN_32(desc, str, ld_type);
+	CPIN_32(desc, str, ld_length);
+	CPIN_32(desc, str, ld_data1);
+	CPIN_32(desc, str, ld_data2);
+
+	CPIN_08(desc, str, ld_reserved, 64);
+}
+
+/**
+ * gfs_desc_out - Write out a log descriptor
+ * @desc: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_desc_out(struct gfs_log_descriptor *desc, char *buf)
+{
+	struct gfs_log_descriptor *str = (struct gfs_log_descriptor *)buf;
+
+	gfs_meta_header_out(&desc->ld_header, buf);
+
+	CPOUT_32(desc, str, ld_type);
+	CPOUT_32(desc, str, ld_length);
+	CPOUT_32(desc, str, ld_data1);
+	CPOUT_32(desc, str, ld_data2);
+
+	CPOUT_08(desc, str, ld_reserved, 64);
+}
+
+/**
+ * gfs_desc_print - Print out a log descriptor
+ * @ld: the cpu-order buffer
+ *
+ */
+
+void
+gfs_desc_print(struct gfs_log_descriptor *ld)
+{
+	gfs_meta_header_print(&ld->ld_header);
+
+	pv(ld, ld_type, "%u");
+	pv(ld, ld_length, "%u");
+	pv(ld, ld_data1, "%u");
+	pv(ld, ld_data2, "%u");
+
+	pa(ld, ld_reserved, 64);
+}
+
+/**
+ * gfs_block_tag_in - Read in a block tag
+ * @tag: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_block_tag_in(struct gfs_block_tag *tag, char *buf)
+{
+	struct gfs_block_tag *str = (struct gfs_block_tag *)buf;
+
+	CPIN_64(tag, str, bt_blkno);
+	CPIN_32(tag, str, bt_flags);
+	CPIN_32(tag, str, bt_pad);
+}
+
+/**
+ * gfs_block_tag_out - Write out a block tag
+ * @tag: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_block_tag_out(struct gfs_block_tag *tag, char *buf)
+{
+	struct gfs_block_tag *str = (struct gfs_block_tag *)buf;
+
+	CPOUT_64(tag, str, bt_blkno);
+	CPOUT_32(tag, str, bt_flags);
+	CPOUT_32(tag, str, bt_pad);
+}
+
+/**
+ * gfs_block_tag_print - Print out a block tag
+ * @tag: the cpu-order buffer
+ *
+ */
+
+void
+gfs_block_tag_print(struct gfs_block_tag *tag)
+{
+	pv(tag, bt_blkno, "%"PRIu64);
+	pv(tag, bt_flags, "%u");
+	pv(tag, bt_pad, "%u");
+}
+
+/**
+ * gfs_quota_tag_in - Read in a quota tag
+ * @tag: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_quota_tag_in(struct gfs_quota_tag *tag, char *buf)
+{
+	struct gfs_quota_tag *str = (struct gfs_quota_tag *)buf;
+
+	CPIN_64(tag, str, qt_change);
+	CPIN_32(tag, str, qt_flags);
+	CPIN_32(tag, str, qt_id);
+}
+
+/**
+ * gfs_quota_tag_out - Write out a quota tag
+ * @tag: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_quota_tag_out(struct gfs_quota_tag *tag, char *buf)
+{
+	struct gfs_quota_tag *str = (struct gfs_quota_tag *)buf;
+
+	CPOUT_64(tag, str, qt_change);
+	CPOUT_32(tag, str, qt_flags);
+	CPOUT_32(tag, str, qt_id);
+}
+
+/**
+ * gfs_quota_tag_print - Print out a quota tag
+ * @tag: the cpu-order buffer
+ *
+ */
+
+void
+gfs_quota_tag_print(struct gfs_quota_tag *tag)
+{
+	pv(tag, qt_change, "%"PRId64);
+	pv(tag, qt_flags, "0x%.8X");
+	pv(tag, qt_id, "%u");
+}
+
+/**
+ * gfs_ea_header_in - Read in a Extended Attribute header
+ * @tag: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_ea_header_in(struct gfs_ea_header *ea, char *buf)
+{
+	struct gfs_ea_header *str = (struct gfs_ea_header *)buf;
+
+	CPIN_32(ea, str, ea_rec_len);
+	CPIN_32(ea, str, ea_data_len);
+	ea->ea_name_len = str->ea_name_len;
+	ea->ea_type = str->ea_type;
+	ea->ea_flags = str->ea_flags;
+	ea->ea_num_ptrs = str->ea_num_ptrs;
+	CPIN_32(ea, str, ea_pad);
+}
+
+/**
+ * gfs_ea_header_out - Write out a Extended Attribute header
+ * @ea: the cpu-order structure
+ * @buf: the disk-order buffer
+ *
+ */
+
+void
+gfs_ea_header_out(struct gfs_ea_header *ea, char *buf)
+{
+	struct gfs_ea_header *str = (struct gfs_ea_header *)buf;
+
+	CPOUT_32(ea, str, ea_rec_len);
+	CPOUT_32(ea, str, ea_data_len);
+	str->ea_name_len = ea->ea_name_len;
+	str->ea_type = ea->ea_type;
+	str->ea_flags = ea->ea_flags;
+	str->ea_num_ptrs = ea->ea_num_ptrs;
+	CPOUT_32(ea, str, ea_pad);
+}
+
+/**
+ * gfs_ea_header_printt - Print out a Extended Attribute header
+ * @ea: the cpu-order buffer
+ *
+ */
+
+void
+gfs_ea_header_print(struct gfs_ea_header *ea, char *name)
+{
+	char buf[GFS_EA_MAX_NAME_LEN + 1];
+
+	pv(ea, ea_rec_len, "%u");
+	pv(ea, ea_data_len, "%u");
+	pv(ea, ea_name_len, "%u");
+	pv(ea, ea_type, "%u");
+	pv(ea, ea_flags, "%u");
+	pv(ea, ea_num_ptrs, "%u");
+	pv(ea, ea_pad, "%u");
+
+	memset(buf, 0, GFS_EA_MAX_NAME_LEN + 1);
+	memcpy(buf, name, ea->ea_name_len);
+	printk("  name = %s\n", buf);
+}
+
+static const uint32_t crc_32_tab[] =
+{
+  0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+  0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+  0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+  0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
+  0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+  0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+  0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
+  0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
+  0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+  0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+  0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
+  0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+  0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
+  0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
+  0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+  0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
+  0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
+  0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+  0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
+  0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+  0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+  0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
+  0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
+  0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+  0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+  0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
+  0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+  0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
+  0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
+  0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+  0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
+  0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
+};
+
+/**
+ * gfs_dir_hash - hash an array of data
+ * @data: the data to be hashed
+ * @len: the length of data to be hashed
+ *
+ * Take some data and convert it to a 32-bit hash.
+ *
+ * The hash function is a 32-bit CRC of the data.  The algorithm uses
+ * the crc_32_tab table above.
+ *
+ * This may not be the fastest hash function, but it does a fair bit better
+ * at providing uniform results than the others I've looked at.  That's
+ * really important for efficient directories.
+ *
+ * Returns: the hash
+ */
+
+uint32_t
+gfs_dir_hash(const char *data, int len)
+{
+	uint32_t hash = 0xFFFFFFFF;
+
+	for (; len--; data++)
+		hash = crc_32_tab[(hash ^ *data) & 0xFF] ^ (hash >> 8);
+
+	hash = ~hash;
+
+	return hash;
+}
+
+#endif  /* WANT_GFS_CONVERSION_FUNCTIONS */
+
diff --git a/group/dlm_controld/Makefile b/group/dlm_controld/Makefile
index b165dbc..bb5c82e 100644
--- a/group/dlm_controld/Makefile
+++ b/group/dlm_controld/Makefile
@@ -1,11 +1,7 @@
 include ../../make/defines.mk
 
 TARGET = dlm_controld
-SBINDIRT = dlm_controld
-ifdef enable_pacemaker
-TARGET += dlm_controld.pcmk
-SBINDIRT += dlm_controld.pcmk
-endif
+SBINDIRT = ${TARGET}
 
 all: depends ${TARGET}
 
@@ -14,22 +10,17 @@ include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-SHAREDOBJS=	action.o \
-		cpg.o \
-		crc.o \
-		deadlock.o \
-		main.o \
-		netlink.o \
-		plock.o \
-		group.o
-
-PCMK_OBJS=	pacemaker-pcmk.o \
-		$(SHAREDOBJS:.o=-pcmk.o)
-
-OBJS=		$(SHAREDOBJS) \
-		config.o \
-		member_cman.o \
-		logging.o
+OBJS=	action.o \
+	cpg.o \
+	crc.o \
+	deadlock.o \
+	main.o \
+	netlink.o \
+	plock.o \
+	group.o \
+	config.o \
+	member_cman.o \
+	logging.o
 
 CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${logtincdir} 
 CFLAGS += -I${dlmincdir} -I${dlmcontrolincdir}
@@ -39,33 +30,19 @@ CFLAGS += -I${KERNEL_SRC}/include/
 CFLAGS += -I$(S)/../lib/ -I$(S)/../include/
 CFLAGS += -I${incdir}
 
-PCMK_CFLAGS += -DENABLE_PACEMAKER=1
-PCMK_CFLAGS += -I${incdir}/heartbeat -I${incdir}/pacemaker
-PCMK_CFLAGS += `pkg-config glib-2.0 --cflags`
-PCMK_CFLAGS += `xml2-config --cflags`
-
-LDFLAGS += -lpthread
-LDFLAGS += -L${dlmlibdir} -ldlm 
 LDFLAGS += -L${logtlibdir} -llogthread
+LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
+LDFLAGS += -L${dlmlibdir} -L${fencedlibdir} -ldlm -lfenced
 LDFLAGS += -L${openaislibdir} -lSaCkpt
 LDFLAGS += -L${corosynclibdir} -lcpg -lconfdb
+LDFLAGS += -lpthread
 LDFLAGS += -L../lib -lgroup
 LDFLAGS += -L${libdir}
 
 LDDEPS += ../lib/libgroup.a
 
-PCMK_LDFLAGS += -lcib -lcrmcommon -lcrmcluster -ltotem_pg
-PCMK_LDFLAGS += `pkg-config glib-2.0 --libs`
-PCMK_LDFLAGS += `xml2-config --libs`
-
-CMAN_LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
-CMAN_LDFLAGS += -L${fencedlibdir} -lfenced
-
-dlm_controld: ${OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS) $(CMAN_LDFLAGS)
-
-dlm_controld.pcmk: ${PCMK_OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS) $(PCMK_LDFLAGS)
+${TARGET}: ${OBJS} ${LDDEPS}
+	$(CC) -o $@ $^ $(LDFLAGS)
 
 depends:
 	$(MAKE) -C ../lib all
@@ -73,4 +50,3 @@ depends:
 clean: generalclean
 
 -include $(OBJS:.o=.d)
--include $(PCMK_OBJS:.o=.d)
diff --git a/group/dlm_controld/pacemaker.c b/group/dlm_controld/pacemaker.c
deleted file mode 100644
index 93c1841..0000000
--- a/group/dlm_controld/pacemaker.c
+++ /dev/null
@@ -1,362 +0,0 @@
-#include <syslog.h>
-
-#include "config.h"
-#include "dlm_daemon.h"
-
-#include <glib.h>
-#include <bzlib.h>
-#include <heartbeat/ha_msg.h>
-
-#include <pacemaker/crm_config.h>
-
-#include <pacemaker/crm/crm.h>
-#include <pacemaker/crm/ais.h>
-#include <pacemaker/crm/attrd.h>
-/* heartbeat support is irrelevant here */
-#undef SUPPORT_HEARTBEAT 
-#define SUPPORT_HEARTBEAT 0
-#include <pacemaker/crm/common/cluster.h>
-#include <pacemaker/crm/common/stack.h>
-#include <pacemaker/crm/common/ipc.h>
-#include <pacemaker/crm/msg_xml.h>
-#include <pacemaker/crm/cib.h>
-
-#define COMMS_DIR     "/sys/kernel/config/dlm/cluster/comms"
-
-int setup_ccs(void)
-{
-    /* To avoid creating an additional place for the dlm to be configured,
-     * only allow configuration from the command-line until CoroSync is stable
-     * enough to be used with Pacemaker
-     */
-    cfgd_groupd_compat = 0; /* always use libcpg and disable backward compat */
-    return 0;
-}
-
-void close_ccs(void) { return; }
-int get_weight(int nodeid, char *lockspace) { return 1; }
-
-/* TODO: Make this configurable
- * Can't use logging.c as-is as whitetank exposes a different logging API
- */
-void init_logging(void) {
-    openlog("cluster-dlm", LOG_PERROR|LOG_PID|LOG_CONS|LOG_NDELAY, LOG_DAEMON);
-    /* cl_log_enable_stderr(TRUE); */
-}
-
-void setup_logging(void) { return; }
-void close_logging(void) {
-    closelog();
-}
-
-extern int ais_fd_async;
-
-char *local_node_uname = NULL;
-void dlm_process_node(gpointer key, gpointer value, gpointer user_data);
-
-int setup_cluster(void)
-{
-    ais_fd_async = -1;
-    crm_log_init("cluster-dlm", LOG_INFO, FALSE, TRUE, 0, NULL);
-    
-    if(init_ais_connection(NULL, NULL, NULL, &local_node_uname, &our_nodeid) == FALSE) {
-	log_error("Connection to our AIS plugin failed");
-	return -1;
-    }
-
-    /* Sign up for membership updates */
-    send_ais_text(crm_class_notify, "true", TRUE, NULL, crm_msg_ais);
-    
-    /* Requesting the current list of known nodes */
-    send_ais_text(crm_class_members, __FUNCTION__, TRUE, NULL, crm_msg_ais);
-
-    return ais_fd_async;
-}
-
-void update_cluster(void)
-{
-    static uint64_t last_membership = 0;
-    cluster_quorate = crm_have_quorum;
-    if(last_membership < crm_peer_seq) {
-	log_debug("Processing membership %llu", crm_peer_seq);
-	g_hash_table_foreach(crm_peer_id_cache, dlm_process_node, &last_membership);
-	last_membership = crm_peer_seq;
-    }
-}
-
-void process_cluster(int ci)
-{
-    ais_dispatch(ais_fd_async, NULL);
-    update_cluster();
-}
-
-void close_cluster(void) {
-    terminate_ais_connection();
-}
-
-#include <arpa/inet.h>
-#include <corosync/totem/totemip.h>
-
-void dlm_process_node(gpointer key, gpointer value, gpointer user_data)
-{
-    int rc = 0;
-    struct stat tmp;
-    char path[PATH_MAX];
-    crm_node_t *node = value;
-    uint64_t *last = user_data;
-    const char *action = "Skipped";
-
-    gboolean do_add = FALSE;
-    gboolean do_remove = FALSE;
-    gboolean is_active = FALSE;
-
-    memset(path, 0, PATH_MAX);
-    snprintf(path, PATH_MAX, "%s/%d", COMMS_DIR, node->id);
-
-    rc = stat(path, &tmp);
-    is_active = crm_is_member_active(node);
-    
-    if(rc == 0 && is_active) {
-	/* nothing to do?
-	 * maybe the node left and came back...
-	 */
-    } else if(rc == 0) {
-	do_remove = TRUE;
-
-    } else if(is_active && node->addr) {
-	do_add = TRUE;
-    }
-
-    if(do_remove) {
-	action = "Removed";
-	del_configfs_node(node->id);
-    }
-
-    if(do_add) {
-	char *addr_copy = strdup(node->addr);
-	char *addr_top = addr_copy;
-	char *addr = NULL;
-	
-	if(do_remove) {
-	    action = "Re-added";
-	} else {
-	    action = "Added";
-	}
-	
-	do {
-	    char ipaddr[1024];
-	    int addr_family = AF_INET;
-	    int cna_len = 0;
-	    struct sockaddr_storage cna_addr;
-	    struct totem_ip_address totem_addr;
-	    
-	    addr = strsep(&addr_copy, " ");
-	    if(addr == NULL) {
-		break;
-	    }
-	    
-	    /* do_cmd_get_node_addrs */
-	    if(strstr(addr, "ip(") == NULL) {
-		continue;
-		
-	    } else if(strchr(addr, ':')) {
-		rc = sscanf(addr, "ip(%[0-9A-Fa-f:])", ipaddr);
-		if(rc != 1) {
-		    log_error("Could not extract IPv6 address from '%s'", addr);
-		    continue;			
-		}
-		addr_family = AF_INET6;
-		    
-	    } else {
-		rc = sscanf(addr, "ip(%[0-9.]) ", ipaddr);
-		if(rc != 1) {
-		    log_error("Could not extract IPv4 address from '%s'", addr);
-		    continue;			
-		}
-	    }
-		
-	    rc = inet_pton(addr_family, ipaddr, &totem_addr);
-	    if(rc != 1) {
-		log_error("Could not parse '%s' as in IPv%c address", ipaddr, (addr_family==AF_INET)?'4':'6');
-		continue;
-	    }
-
-	    rc = totemip_parse(&totem_addr, ipaddr, addr_family);
-	    if(rc != 0) {
-		log_error("Could not convert '%s' into a totem address", ipaddr);
-		continue;
-	    }
-
-	    rc = totemip_totemip_to_sockaddr_convert(&totem_addr, 0, &cna_addr, &cna_len);
-	    if(rc != 0) {
-		log_error("Could not convert totem address for '%s' into sockaddr", ipaddr);
-		continue;
-	    }
-
-	    log_debug("Adding address %s to configfs for node %u", addr, node->id);
-	    add_configfs_node(node->id, ((char*)&cna_addr), cna_len, (node->id == our_nodeid));
-
-	} while(addr != NULL);
-	free(addr_top);
-    }
-
-    log_debug("%s %sctive node %u: born-on=%llu, last-seen=%llu, this-event=%llu, last-event=%llu",
-	       action, crm_is_member_active(value)?"a":"ina",
-	       node->id, node->born, node->last_seen,
-	       crm_peer_seq, (unsigned long long)*last);
-}
-
-int is_cluster_member(int nodeid)
-{
-    crm_node_t *node = crm_get_peer(nodeid, NULL);
-    return crm_is_member_active(node);
-}
-
-char *nodeid2name(int nodeid) {
-    crm_node_t *node = crm_get_peer(nodeid, NULL);
-    if(node->uname == NULL) {
-	return NULL;
-    }
-    return strdup(node->uname);
-}
-
-static int pcmk_cluster_fd = 0;
-
-static void attrd_deadfn(int ci) 
-{
-    log_error("%s: Lost connection to the cluster", __FUNCTION__);
-    pcmk_cluster_fd = 0;
-    return;
-}
-
-void kick_node_from_cluster(int nodeid)
-{
-    int fd = pcmk_cluster_fd;
-    int rc = crm_terminate_member_no_mainloop(nodeid, NULL, &fd);
-    
-    if(fd > 0 && fd != pcmk_cluster_fd) {
-	pcmk_cluster_fd = fd;
-	client_add(pcmk_cluster_fd, NULL, attrd_deadfn);
-    }
-    
-    switch(rc) {
-	case 1:
-	    log_debug("Requested that node %d be kicked from the cluster", nodeid);
-	    break;
-	case -1:
-	    log_error("Don't know how to kick node %d from the cluster", nodeid);
-	    break;
-	case 0:
-	    log_error("Could not kick node %d from the cluster", nodeid);
-	    break;
-	default:
-	    log_error("Unknown result when kicking node %d from the cluster", nodeid);
-	    break;
-    }
-    return;
-}
-
-cib_t *cib = NULL;
-
-static void cib_deadfn(int ci) 
-{
-    log_error("Lost connection to the cib");
-    cib = NULL; /* TODO: memory leak in unlikely error path */
-    return;
-}
-
-static cib_t *cib_connect(void) 
-{
-    int rc = 0;
-    int cib_fd = 0;
-    if(cib) {
-	return cib;
-    }
-    
-    cib = cib_new();
-    rc = cib->cmds->signon_raw(cib, crm_system_name, cib_command, &cib_fd, NULL);
-    if(rc != cib_ok) {
-	log_error("Signon to cib failed: %s", cib_error2string(rc));
-	cib = NULL; /* TODO: memory leak in unlikely error path */
-
-    } else {
-	client_add(cib_fd, NULL, cib_deadfn);
-    }
-    return cib;
-}
-
-
-int fence_in_progress(int *in_progress)
-{
-    int rc = 0;
-    xmlNode *xpath_data;
-
-    cib_connect();    
-    if(cib == NULL) {
-	return -1;
-    }
-
-    /* TODO: Not definitive - but a good approximation */
-    rc = cib->cmds->query(cib, "//nvpar[@name='terminate']", &xpath_data,
-			  cib_xpath|cib_scope_local|cib_sync_call);
-
-    if(xpath_data == NULL) {
-	*in_progress = 0;
-	return 0;
-    }
-
-    log_debug("Fencing in progress: %s", xpath_data?"true":"false");	
-    free_xml(xpath_data);
-    *in_progress = 1;
-    return 1;
-}
-
-#define XPATH_MAX  1024
-
-int fence_node_time(int nodeid, uint64_t *last_fenced_time)
-{
-    int rc = 0;
-    static time_t last_log = 0;
-
-    xmlNode *xpath_data;
-    char xpath_query[XPATH_MAX];
-    crm_node_t *node = crm_get_peer(nodeid, NULL);
-
-    if(last_fenced_time) {
-	*last_fenced_time = 0;
-    }
-
-    if(node == NULL || node->uname == NULL) {
-	log_error("Nothing known about node %d", nodeid);	
-	return 0;
-    }
-
-    cib_connect();
-    if(cib == NULL) {
-	return -1;
-    }
-
-    snprintf(xpath_query, XPATH_MAX, "//lrm[@id='%s']", node->uname);
-    rc = cib->cmds->query(
-	cib, xpath_query, &xpath_data, cib_xpath|cib_scope_local|cib_sync_call);
-
-    if(xpath_data == NULL) {
-	/* the node has been shot - return 'now' */
-	log_level(LOG_INFO, "Node %d/%s was last shot 'now'", nodeid, node->uname);	
-	*last_fenced_time = time(NULL);
-	last_log = 0;
-
-    } else {
-	time_t now = time(NULL);
-	if(last_log == 0) {
-	    log_level(LOG_INFO, "Node %d/%s has not been shot yet", nodeid, node->uname);
-
-	} else if(now - last_log > 30) {
-	    log_level(LOG_DEBUG, "Node %d/%s has still not been shot yet", nodeid, node->uname);
-	}
-	last_log = now;
-    }
-
-    free_xml(xpath_data);
-    return 0;
-}
diff --git a/group/gfs_controld/Makefile b/group/gfs_controld/Makefile
index 9d07a36..577917d 100644
--- a/group/gfs_controld/Makefile
+++ b/group/gfs_controld/Makefile
@@ -1,10 +1,6 @@
 include ../../make/defines.mk
 
 TARGET= gfs_controld
-ifdef enable_pacemaker
-TARGET += gfs_controld.pcmk
-SBINDIRT += gfs_controld.pcmk
-endif
 
 SBINDIRT=$(TARGET)
 
@@ -15,7 +11,7 @@ include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-SHAREDOBJS= 	main.o \
+OBJS= 	main.o \
 	crc.o \
 	config.o \
 	cpg-new.o \
@@ -23,14 +19,8 @@ SHAREDOBJS= 	main.o \
 	group.o \
 	util.o \
 	plock.o \
-	logging.o
-
-
-PCMK_OBJS=	member_pcmk-pcmk.o \
-		$(SHAREDOBJS:.o=-pcmk.o)
-
-OBJS=		$(SHAREDOBJS) \
-		member_cman.o
+	logging.o \
+	member_cman.o
 
 CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${logtincdir} -I${dlmcontrolincdir}
 CFLAGS += -I${corosyncincdir} -I${openaisincdir} -I${fencedincdir}
@@ -39,11 +29,8 @@ CFLAGS += -I$(S)/../libgfscontrol
 CFLAGS += -I$(S)/../lib/ -I$(S)/../include/
 CFLAGS += -I${incdir}
 
-PCMK_CFLAGS += -DENABLE_PACEMAKER=1
-PCMK_CFLAGS += -I${incdir}/heartbeat -I${incdir}/pacemaker
-PCMK_CFLAGS += `pkg-config glib-2.0 --cflags`
-PCMK_CFLAGS += `xml2-config --cflags`
-
+LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
+LDFLAGS += -L${fencedlibdir} -lfenced
 LDFLAGS += -L${dlmcontrollibdir} -ldlmcontrol
 LDFLAGS += -L${logtlibdir} -llogthread
 LDFLAGS += -L${corosynclibdir} -lcpg -lpthread
@@ -51,21 +38,10 @@ LDFLAGS += -L${openaislibdir} -lSaCkpt
 LDFLAGS += -L../lib -lgroup
 LDFLAGS += -L${libdir}
 
-PCMK_LDFLAGS += -L${ccslibdir} -lccs
-PCMK_LDFLAGS += -lcib -lcrmcommon -lcrmcluster -ltotem_pg
-PCMK_LDFLAGS += `pkg-config glib-2.0 --libs`
-PCMK_LDFLAGS += `xml2-config --libs`
-
-CMAN_LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
-CMAN_LDFLAGS += -L${fencedlibdir} -lfenced
-
 LDDEPS += ../lib/libgroup.a
 
 gfs_controld: ${OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS) $(CMAN_LDFLAGS)
-
-gfs_controld.pcmk: ${PCMK_OBJS} ${LDDEPS}
-	$(CC) -o $@ $^ $(LDFLAGS) $(PCMK_LDFLAGS)
+	$(CC) -o $@ $^ $(LDFLAGS)
 
 depends:
 	$(MAKE) -C ../lib all
diff --git a/group/gfs_controld/member_pcmk.c b/group/gfs_controld/member_pcmk.c
deleted file mode 100644
index 4a99b50..0000000
--- a/group/gfs_controld/member_pcmk.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include "gfs_daemon.h"
-#include "config.h"
-
-#include <glib.h>
-#include <bzlib.h>
-#include <heartbeat/ha_msg.h>
-
-#include <pacemaker/crm_config.h>
-
-#include <pacemaker/crm/crm.h>
-#include <pacemaker/crm/ais.h>
-#include <pacemaker/crm/attrd.h>
-/* heartbeat support is irrelevant here */
-#undef SUPPORT_HEARTBEAT 
-#define SUPPORT_HEARTBEAT 0
-#include <pacemaker/crm/common/cluster.h>
-#include <pacemaker/crm/common/stack.h>
-#include <pacemaker/crm/common/ipc.h>
-#include <pacemaker/crm/msg_xml.h>
-#include <pacemaker/crm/ais.h>
-
-extern int ais_fd_async;
-
-static int pcmk_cluster_fd = 0;
-static void attrd_deadfn(int ci) 
-{
-    log_error("%s: Lost connection to the cluster", __FUNCTION__);
-    pcmk_cluster_fd = 0;
-    return;
-}
-
-void kick_node_from_cluster(int nodeid)
-{
-    int fd = pcmk_cluster_fd;
-    int rc = crm_terminate_member_no_mainloop(nodeid, NULL, &fd);
-    
-    if(fd > 0 && fd != pcmk_cluster_fd) {
-	pcmk_cluster_fd = fd;
-	client_add(pcmk_cluster_fd, NULL, attrd_deadfn);
-    }
-    
-    switch(rc) {
-	case 1:
-	    log_debug("Requested that node %d be kicked from the cluster", nodeid);
-	    break;
-	case -1:
-	    log_error("Don't know how to kick node %d from the cluster", nodeid);
-	    break;
-	case 0:
-	    log_error("Could not kick node %d from the cluster", nodeid);
-	    break;
-	default:
-	    log_error("Unknown result when kicking node %d from the cluster", nodeid);
-	    break;
-    }
-    return;
-}
-
-void process_cluster(int ci)
-{
-    ais_dispatch(ais_fd_async, NULL);
-    /* cluster_quorate = crm_have_quorum; */
-}
-
-void update_cluster(void)
-{
-}
-
-int setup_cluster(void)
-{
-    ais_fd_async = -1;
-    crm_log_init("cluster-gfs", LOG_DEBUG, FALSE, TRUE, 0, NULL);
-    
-    if(init_ais_connection(NULL, NULL, NULL, NULL, &our_nodeid) == FALSE) {
-        log_error("Connection to our AIS plugin failed");
-        return -1;
-    }
-
-    if(crm_get_cluster_name(&clustername) == FALSE) {
-        log_error("No cluster name supplied");
-	return -1;
-
-    } else {
-        log_debug("Connected as node %u to cluster '%s'", our_nodeid, clustername);
-    }
-    
-    /* Sign up for membership updates */
-    send_ais_text(crm_class_notify, "true", TRUE, NULL, crm_msg_ais);
-    
-    /* Requesting the current list of known nodes */
-    send_ais_text(crm_class_members, __FUNCTION__, TRUE, NULL, crm_msg_ais);
-
-    return ais_fd_async;
-}
-
-void close_cluster(void)
-{
-    terminate_ais_connection();
-}
-
-#include <../../fence/libfenced/libfenced.h>
-int fenced_node_info(int nodeid, struct fenced_node *node) 
-{
-    /* The caller, we_are_in_fence_domain(), wants to check
-     * if we're part of the fencing domain.
-     * Check the node is alive and synthesize the
-     * appropriate value for .member
-     */
-
-    crm_node_t *pnode = crm_get_peer(nodeid, NULL);
-    node->member = crm_is_member_active(pnode);
-    return 0;
-}
diff --git a/group/man/Makefile b/group/man/Makefile
index 7fab518..70387c3 100644
--- a/group/man/Makefile
+++ b/group/man/Makefile
@@ -1,8 +1,6 @@
 MANTARGET= \
 	dlm_controld.8 \
-	dlm_controld.pcmk.8 \
 	gfs_controld.8 \
-	gfs_controld.pcmk.8 \
 	gfs_control.8 \
 	group_tool.8 \
 	groupd.8
diff --git a/group/man/dlm_controld.pcmk.8 b/group/man/dlm_controld.pcmk.8
deleted file mode 100644
index d69f41b..0000000
--- a/group/man/dlm_controld.pcmk.8
+++ /dev/null
@@ -1 +0,0 @@
-.so man8/dlm_controld.8
diff --git a/group/man/gfs_controld.pcmk.8 b/group/man/gfs_controld.pcmk.8
deleted file mode 100644
index f305866..0000000
--- a/group/man/gfs_controld.pcmk.8
+++ /dev/null
@@ -1 +0,0 @@
-.so man8/gfs_controld.8
diff --git a/make/defines.mk.input b/make/defines.mk.input
index ca6a4d7..f7a35a7 100644
--- a/make/defines.mk.input
+++ b/make/defines.mk.input
@@ -12,7 +12,6 @@ logrotatedir ?= ${DESTDIR}@LOGROTATEDIR@
 mandir ?= ${DESTDIR}@MANDIR@
 module_dir ?= ${DESTDIR}@MODULE_DIR@
 incdir ?= ${DESTDIR}@INCDIR@
-snmpbin ?= @SNMPBIN@
 notifyddir ?= ${DESTDIR}@CONFDIR@/cman-notify.d
 pkgconfigdir ?= ${DESTDIR}@LIBDIR@/pkgconfig
 
@@ -31,9 +30,7 @@ LDFLAGS += @LDFLAGS@
 SRCDIR = @SRCDIR@
 OBJDIR = @OBJDIR@
 
-KERNEL_BUILD = @KERNEL_BUILD@
 KERNEL_SRC = @KERNEL_SRC@
-gfskincdir ?= @GFSKINCDIR@
 ccsincdir ?= @CCSINCDIR@
 ccslibdir ?= @CCSLIBDIR@
 cmanincdir ?= @CMANINCDIR@
@@ -52,10 +49,6 @@ ncursesincdir ?= @NCURSESINCDIR@
 ncurseslibdir ?= @NCURSESLIBDIR@
 slangincdir ?= @SLANGINCDIR@
 slanglibdir ?= @SLANGLIBDIR@
-nssincdir ?= @NSSINCDIR@
-nsslibdir ?= @NSSLIBDIR@
-nsprincdir ?= @NSPRINCDIR@
-nsprlibdir ?= @NSPRLIBDIR@
 corosyncincdir ?= @COROSYNCINCDIR@
 corosynclibdir ?= @COROSYNCLIBDIR@
 openaisincdir ?= @OPENAISINCDIR@
@@ -63,17 +56,9 @@ openaislibdir ?= @OPENAISLIBDIR@
 corosyncbin ?= @COROSYNCBIN@
 ldapincdir ?= @LDAPINCDIR@
 ldaplibdir ?= @LDAPLIBDIR@
-virtincdir ?= @VIRTINCDIR@
-virtlibdir ?= @VIRTLIBDIR@
 zlibincdir ?= @ZLIBINCDIR@
 zliblibdir ?= @ZLIBLIBDIR@
-fence_agents ?= @FENCE_AGENTS@
-fenceagentslibdir ?= @FENCEAGENTSLIBDIR@
-experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@
-legacy_code ?= @ENABLE_LEGACY_CODE@
 contrib_code ?= @ENABLE_CONTRIB@
-enable_pacemaker ?= @ENABLE_PACEMAKER@
-enable_gfs-kernel/src/gfs ?= @ENABLE_GFSKERNEL@
 disable_dbus ?= @DISABLE_DBUS@
 without_common ?= @DISABLE_COMMON@
 without_config ?= @DISABLE_CONFIG@
@@ -81,10 +66,8 @@ without_cman ?= @DISABLE_CMAN@
 without_dlm ?= @DISABLE_DLM@
 without_group ?= @DISABLE_GROUP@
 without_fence ?= @DISABLE_FENCE@
-enable_gfs ?= @ENABLE_GFS@
 without_gfs2 ?= @DISABLE_GFS2@
 without_rgmanager ?= @DISABLE_RGMANAGER@
-without_resource_agents ?= @DISABLE_RESOURCE_AGENTS@
 without_bindings ?= @DISABLE_BINDINGS@
 
 THISDIR = $(shell echo $(CURDIR) | sed -e 's|$(OBJDIR)/||g')
@@ -94,4 +77,3 @@ CONFDIR=@CONFDIR@
 CONFFILE=@CONFFILE@
 
 UNINSTALL = perl @SRCDIR@/scripts/uninstall.pl
-FENCEPARSE = bash @SRCDIR@/scripts/fenceparse
diff --git a/make/fencebuild.mk b/make/fencebuild.mk
deleted file mode 100644
index 30cd26b..0000000
--- a/make/fencebuild.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-ifndef FENCEAGENTSLIB
-	ifndef SBINDIRT
-		SBINDIRT=$(TARGET)
-	endif
-	ifndef MANTARGET
-		MANTARGET=$(TARGET).8
-	endif
-endif
-
-all: $(TARGET) $(MANTARGET)
-
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-$(TARGET):
-	${FENCEPARSE} \
-		${SRCDIR}/make/copyright.cf REDHAT_COPYRIGHT \
-		${RELEASE_VERSION} \
-		$(S) $@ | \
-	sed \
-		-e 's#@FENCEAGENTSLIBDIR@#${fenceagentslibdir}#g' \
-		-e 's#@SNMPBIN@#${snmpbin}#g' \
-		-e 's#@LOGDIR@#${logdir}#g' \
-		-e 's#@SBINDIR@#${sbindir}#g' \
-	> $@
-
-ifdef MAKEMAN
-$(MANTARGET): $(MANTARGET:.8=) ${SRCDIR}/fence/agents/lib/fence2man.xsl
-	set -e && \
-	PYTHONPATH=${OBJDIR}/fence/agents/lib \
-		python $^ -o metadata > .$@.tmp && \
-	xsltproc ${SRCDIR}/fence/agents/lib/fence2man.xsl .$@.tmp > $@
-
-clean: generalclean
-	rm -f $(MANTARGET) .$(MANTARGET).tmp
-else
-$(MANTARGET): $(S)/$(MANTARGET)
-	cp $< $@
-
-clean: generalclean
-	if [ "$(OBJDIR)" != "$(SRCDIR)" ]; then rm -f $(MANTARGET); fi
-endif
diff --git a/make/install.mk b/make/install.mk
index 823184b..96c9875 100644
--- a/make/install.mk
+++ b/make/install.mk
@@ -47,18 +47,6 @@ ifdef UDEVT
 		install -m644 $(S)/$$i ${DESTDIR}/etc/udev/rules.d; \
 	done
 endif
-ifdef KMODT
-	install -d ${module_dir}/${KDIRT}
-	install -m644 ${KMODT} ${module_dir}/${KDIRT}
-endif
-ifdef KHEADT
-	install -d ${incdir}/linux
-	install -m644 ${KHEADT} ${incdir}/linux
-endif
-ifdef FENCEAGENTSLIB
-	install -d ${DESTDIR}/${fenceagentslibdir}
-	install -m644 ${FENCEAGENTSLIB} ${DESTDIR}/${fenceagentslibdir}
-endif
 ifdef DOCS
 	install -d ${docdir}
 	set -e; \
diff --git a/make/release.mk b/make/release.mk
index f5b1481..5f483e6 100644
--- a/make/release.mk
+++ b/make/release.mk
@@ -16,24 +16,14 @@ projectver=$(project)-$(version)
 projecttar=$(projectver).tar
 projectgz=$(projecttar).gz
 projectbz=$(projecttar).bz2
-
-fenceproject=fence-agents
-fenceprojectver=$(fenceproject)-$(version)
-fenceprojecttar=$(fenceprojectver).tar
-fenceprojectgz=$(fenceprojecttar).gz
-fenceprojectbz=$(fenceprojecttar).bz2
-
-rasproject=resource-agents
-rasprojectver=$(rasproject)-$(version)
-rasprojecttar=$(rasprojectver).tar
-rasprojectgz=$(rasprojecttar).gz
-rasprojectbz=$(rasprojecttar).bz2
+projectxz=$(projecttar).xz
 
 rgmproject=rgmanager
 rgmprojectver=$(rgmproject)-$(version)
 rgmprojecttar=$(rgmprojectver).tar
 rgmprojectgz=$(rgmprojecttar).gz
 rgmprojectbz=$(rgmprojecttar).bz2
+rgmprojectxz=$(rgmprojecttar).xz
 
 # temp dirs
 
@@ -84,15 +74,11 @@ tarballs: tag
 tarballs: $(releasearea)/$(projecttar)
 tarballs: $(releasearea)/$(projectgz)
 tarballs: $(releasearea)/$(projectbz)
-tarballs: $(releasearea)/$(fenceprojecttar)
-tarballs: $(releasearea)/$(fenceprojectgz)
-tarballs: $(releasearea)/$(fenceprojectbz)
-tarballs: $(releasearea)/$(rasprojecttar)
-tarballs: $(releasearea)/$(rasprojectgz)
-tarballs: $(releasearea)/$(rasprojectbz)
+tarballs: $(releasearea)/$(projectxz)
 tarballs: $(releasearea)/$(rgmprojecttar)
 tarballs: $(releasearea)/$(rgmprojectgz)
 tarballs: $(releasearea)/$(rgmprojectbz)
+tarballs: $(releasearea)/$(rgmprojectxz)
 
 $(releasearea)/$(projecttar):
 	@echo Creating $(project) tarball
@@ -103,46 +89,11 @@ $(releasearea)/$(projecttar):
 		$(gitver) | \
 		(cd $(releasearea)/ && tar xf -)
 	cd $(releasearea) && \
-	sed -i -e \
-		's#<CVS>#$(version)#g' \
-		$(projectver)/gfs-kernel/src/gfs/gfs.h && \
 	echo "VERSION \"$(version)\"" \
 		>> $(projectver)/make/official_release_version && \
 	tar cpf $(projecttar) $(projectver) && \
 	rm -rf $(projectver)
 
-$(releasearea)/$(fenceprojecttar): $(releasearea)/$(projecttar)
-	@echo Creating $(fenceproject) tarball
-	cd $(releasearea) && \
-	rm -rf $(projectver) $(fenceprojectver) && \
-	tar xpf $(projecttar) && \
-	mv $(projectver) $(fenceprojectver) && \
-	cd $(fenceprojectver) && \
-	rm -rf bindings cman common config contrib dlm gfs* group \
-		rgmanager fence/fenced fence/fence_node \
-		fence/fence_tool fence/include fence/libfence \
-		fence/libfenced fence/man && \
-	cd .. && \
-	tar cpf $(fenceprojecttar) $(fenceprojectver) && \
-	rm -rf $(fenceprojectver)
-
-$(releasearea)/$(rasprojecttar): $(releasearea)/$(projecttar)
-	@echo Creating $(rasproject) tarball
-	cd $(releasearea) && \
-	rm -rf $(projectver) $(rasprojectver) && \
-	tar xpf $(projecttar) && \
-	mv $(projectver) $(rasprojectver) && \
-	cd $(rasprojectver) && \
-	rm -rf bindings cman common config contrib dlm fence gfs* \
-		group rgmanager/ChangeLog rgmanager/errors.txt \
-		rgmanager/event-script.txt rgmanager/examples \
-		rgmanager/include rgmanager/init.d rgmanager/man \
-		rgmanager/README rgmanager/src/clulib \
-		rgmanager/src/daemons rgmanager/src/utils && \
-	cd .. && \
-	tar cpf $(rasprojecttar) $(rasprojectver) && \
-	rm -rf $(rasprojectver)
-
 $(releasearea)/$(rgmprojecttar): $(releasearea)/$(projecttar)
 	@echo Creating $(rgmproject) tarball
 	cd $(releasearea) && \
@@ -151,7 +102,10 @@ $(releasearea)/$(rgmprojecttar): $(releasearea)/$(projecttar)
 	mv $(projectver) $(rgmprojectver) && \
 	cd $(rgmprojectver) && \
 	rm -rf bindings cman common config contrib dlm fence gfs* group \
-		rgmanager/src/resources && \
+		doc/cluster_conf.html && \
+	sed -i \
+		-e 's#cluster_conf.html##g' \
+		-e 's#README.licence.*#README.licence#g' doc/Makefile && \
 	cd .. && \
 	tar cpf $(rgmprojecttar) $(rgmprojectver) && \
 	rm -rf $(rgmprojectver)
@@ -164,6 +118,10 @@ $(releasearea)/%.bz2: $(releasearea)/%
 	@echo Creating $@
 	cat $< | bzip2 -c > $@
 
+$(releasearea)/%.xz: $(releasearea)/%
+	@echo Creating $@
+	cat $< | xz -z -9 > $@
+
 changelog: checks setup $(releasearea)/Changelog-$(version)
 
 $(releasearea)/Changelog-$(version): $(releasearea)/$(projecttar)
@@ -175,7 +133,7 @@ sha256: changelog tarballs $(releasearea)/$(projectver).sha256
 
 $(releasearea)/$(projectver).sha256: $(releasearea)/Changelog-$(version)
 	cd $(releasearea) && \
-	sha256sum Changelog-$(version) *.gz *.bz2 | sort -k2 > $@
+	sha256sum Changelog-$(version) *.gz *.bz2 *.xz | sort -k2 > $@
 
 sign: sha256 $(releasearea)/$(projectver).sha256.asc
 
@@ -192,7 +150,7 @@ ifeq (,$(release))
 else
 	git push --tags origin
 	cd $(releasearea) && \
-	scp *.gz *.bz2 Changelog-* *sha256* \
+	scp *.gz *.bz2 *.xz Changelog-* *sha256* \
 		fedorahosted.org:$(project)
 	@echo Hey you!.. yeah you looking somewhere else!
 	@echo remember to update the wiki and send the email to cluster-devel and linux-cluster
diff --git a/make/uninstall.mk b/make/uninstall.mk
index bbf7edc..01e8d2d 100644
--- a/make/uninstall.mk
+++ b/make/uninstall.mk
@@ -26,15 +26,6 @@ endif
 ifdef UDEVT
 	${UNINSTALL} ${UDEVT} ${DESTDIR}/etc/udev/rules.d
 endif
-ifdef KMODT
-	${UNINSTALL} ${KMODT} ${module_dir}/${KDIRT}
-endif
-ifdef KHEADT
-	${UNINSTALL} ${KHEADT} ${incdir}/linux
-endif
-ifdef FENCEAGENTSLIB
-	${UNINSTALL} ${FENCEAGENTSLIB}* ${DESTDIR}/${fenceagentslibdir}
-endif
 ifdef DOCS
 	${UNINSTALL} ${DOCS} ${docdir}
 endif
diff --git a/rgmanager/src/Makefile b/rgmanager/src/Makefile
index e6bd048..c79d053 100644
--- a/rgmanager/src/Makefile
+++ b/rgmanager/src/Makefile
@@ -1,8 +1,4 @@
 include ../../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS= clulib daemons utils
-
-ifndef without_resource_agents
-SUBDIRS += resources
-endif
+SUBDIRS=resources clulib daemons utils
diff --git a/rgmanager/src/resources/ASEHAagent.sh b/rgmanager/src/resources/ASEHAagent.sh
deleted file mode 100644
index 4c906a9..0000000
--- a/rgmanager/src/resources/ASEHAagent.sh
+++ /dev/null
@@ -1,900 +0,0 @@
-#!/bin/bash
-
-# 
-# Sybase Availability Agent for Red Hat Cluster v15.0.2 
-# Copyright (C) - 2007
-# Sybase, Inc. All rights reserved.
-#
-# Sybase Availability Agent for Red Hat Cluster v15.0.2 is licensed
-# under the GNU General Public License Version 2.
-#
-# Author(s):
-#    Jian-ping Hui <jphui at sybase.com>
-#
-# Description: Service script for starting/stopping/monitoring \
-#              Sybase Adaptive Server on: \
-#                            Red Hat Enterprise Linux 5 ES \
-#                            Red Hat Enterprise Linux 5 AS
-#
-# NOTES:
-#
-# (1) Before running this script, we assume that user has installed
-#     Sybase ASE 15.0.2 or higher version on the machine. Please
-#     customize your configuration in /etc/cluster/cluster.conf according
-#     to your actual environment. We assume the following files exist before
-#     you start the service:
-#         /$sybase_home/SYBASE.sh
-#         /$sybase_home/$sybase_ase/install/RUN_$server_name
-#
-# (2) You can customize the interval value in the meta-data section if needed:
-#                <action name="start" timeout="300" />
-#                <action name="stop" timeout="300" />
-#                
-#                <!-- Checks to see if it''s mounted in the right place -->
-#                <action name="status"  interval="30" timeout="100" />
-#                <action name="monitor" interval="30" timeout="100" />
-#                
-#                <!--Checks to see if we can read from the mountpoint -->
-#                <action name="status" depth="10" timeout="100" interval="120" />
-#                <action name="monitor" depth="10" timeout="100" interval="120" />
-#                
-#                <action name="meta-data" timeout="5" />
-#                <action name="validate-all" timeout="5" />
-#     The timeout value is not supported by Redhat in RHCS5.0. 
-# 
-# (3) This script should be put under /usr/share/cluster. Its owner should be "root" with 
-#     execution permission.
-#
-
-. /etc/init.d/functions
-. $(dirname $0)/ocf-shellfuncs
-
-PROG=${0}
-
-export LD_POINTER_GUARD=0
-
-#######################################################################################
-# Declare some variables we will use in the script. Please don't change their values. #
-#######################################################################################
-declare login_string=""
-declare RUNSERVER_SCRIPT=$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/RUN_$OCF_RESKEY_server_name
-declare CONSOLE_LOG=$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/$OCF_RESKEY_server_name.log
-
-##################################################################################################
-# This function will be called by rgmanager to get the meta data of resource agent "ASEHAagent". #
-# NEVER CHANGE ANYTHING IN THIS FUNCTION.
-##################################################################################################
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="ASEHAagent" version="rgmanager 2.0">
-	<version>1.0</version>
-
-	<longdesc lang="en">
-		Sybase ASE Failover Instance
-	</longdesc>
-	<shortdesc lang="en">
-		Sybase ASE Failover Instance
-	</shortdesc>
-
-	<parameters>
-		<parameter name="name" unique="1" primary="1">
-			<longdesc lang="en">
-				Instance name of resource agent "ASEHAagent"
-			</longdesc>
-			<shortdesc lang="en">
-				name
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="sybase_home" unique="1" required="1">
-			<longdesc lang="en">
-				The home directory of sybase products
-			</longdesc>
-			<shortdesc lang="en">
-				SYBASE home directory
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="sybase_ase" unique="1" required="1">
-			<longdesc lang="en">
-				The directory name under sybase_home where ASE products are installed
-			</longdesc>
-			<shortdesc lang="en">
-				SYBASE_ASE directory name
-			</shortdesc>
-			<content type="string" default="ASE-15_0" />
-		</parameter>
-
-		<parameter name="sybase_ocs" unique="1" required="1">
-			<longdesc lang="en">
-				The directory name under sybase_home where OCS products are installed, i.e. ASE-15_0
-			</longdesc>
-			<shortdesc lang="en">
-				SYBASE_OCS directory name
-			</shortdesc>
-			<content type="string" default="OCS-15_0" />
-		</parameter>
-
-		<parameter name="server_name" unique="1" required="1">
-			<longdesc lang="en">
-				The ASE server name which is configured for the HA service
-			</longdesc>
-			<shortdesc lang="en">
-				ASE server name
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="login_file" unique="1" required="1">
-			<longdesc lang="en">
-				The full path of login file which contains the login/password pair
-			</longdesc>
-			<shortdesc lang="en">
-				Login file
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="interfaces_file" unique="1" required="1">
-			<longdesc lang="en">
-				The full path of interfaces file which is used to start/access the ASE server
-			</longdesc>
-			<shortdesc lang="en">
-				Interfaces file
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="sybase_user" unique="1" required="1">
-			<longdesc lang="en">
-				The user who can run ASE server
-			</longdesc>
-			<shortdesc lang="en">
-				Sybase user
-			</shortdesc>
-			<content type="string" default="sybase" />
-		</parameter>
-
-		<parameter name="shutdown_timeout" unique="1" required="1">
-			<longdesc lang="en">
-				The maximum seconds to wait for the ASE server to shutdown before killing the process directly
-			</longdesc>
-			<shortdesc>
-				Shutdown timeout value
-			</shortdesc>
-			<content type="integer" default="0" />
-		</parameter>
-
-		<parameter name="start_timeout" unique="1" required="1">
-			<longdesc lang="en">
-				The maximum seconds to wait for an ASE server to complete before determining that the server had failed to start
-			</longdesc>
-			<shortdesc lang="en">
-				Start timeout value
-			</shortdesc>
-			<content type="integer" default="0" />
-		</parameter>
-
-		<parameter name="deep_probe_timeout" unique="1" required="1">
-			<longdesc lang="en">
-				The maximum seconds to wait for the response of ASE server before determining that the server had no response while running deep probe
-			</longdesc>
-			<shortdesc lang="en">
-				Deep probe timeout value
-			</shortdesc>
-			<content type="integer" default="0" />
-		</parameter>
-	</parameters>
-	<actions>
-		<action name="start" timeout="300" />
-		<action name="stop" timeout="300" />
-		
-		<!-- Checks to see if it''s mounted in the right place -->
-		<action name="status"  interval="30" timeout="100" />
-		<action name="monitor" interval="30" timeout="100" />
-		
-		<!--Checks to see if we can read from the mountpoint -->
-		<action name="status" depth="10" timeout="100" interval="120" />
-		<action name="monitor" depth="10" timeout="100" interval="120" />
-		
-		<action name="meta-data" timeout="5" />
-		<action name="validate-all" timeout="5" />
-	</actions>
-
-	<special tag="rgmanager">
-	</special>
-</resource-agent>
-EOT
-}
-
-##################################################################################################
-# Function Name: validate_all                                                                    #
-# Parameter: None                                                                                #
-# Return value:                                                                                  #
-#             0               SUCCESS                                                            #
-#             OCF_ERR_ARGS    Parameters are invalid                                             #
-# Description: Do some validation on the user-configurable stuff at the beginning of the script. #
-##################################################################################################
-verify_all() 
-{
-	ocf_log debug "ASEHAagent: Start 'verify_all'"
-
-	# Check if the parameter 'sybase_home' is set.	
-	if [[ -z "$OCF_RESKEY_sybase_home" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_home' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_home' is a valid path.
-	if [[ ! -d $OCF_RESKEY_sybase_home ]]
-	then
-		ocf_log err "ASEHAagent: The sybase_home '$OCF_RESKEY_sybase_home' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the script file SYBASE.sh exists
-	if [[ ! -f $OCF_RESKEY_sybase_home/SYBASE.sh ]]
-	then
-		ocf_log err "ASEHAagent: The file $OCF_RESKEY_sybase_home/SYBASE.sh is required to run this script. Failed to run the script."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_ase' is set.
-	if [[ -z "$OCF_RESKEY_sybase_ase" ]] 
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_ase' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the directory /$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase exists.
-	if [[ ! -d $OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase ]]
-	then
-		ocf_log err "ASEHAagent: The directory '$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_ocs' is set.
-	if [[ -z "$OCF_RESKEY_sybase_ocs" ]] 
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_ocs' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the directory /$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ocs exists.
-	if [[ ! -d $OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ocs ]]
-	then
-		ocf_log err "ASEHAagent: The directory '$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ocs' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'server_name' is set.	
-	if [[ -z "$OCF_RESKEY_server_name" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'server_name' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the Run_server file exists.
-	if [[ ! -f $RUNSERVER_SCRIPT ]]
-	then
-		ocf_log err "ASEHAagent: There file $RUNSERVER_SCRIPT doesn't exist. The sybase directory may be incorrect."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'login_file' is set.	
-	if [[ -z "$OCF_RESKEY_login_file" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'login_file' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the login file exist.
-	if [[ ! -f $OCF_RESKEY_login_file ]]
-	then
-		ocf_log err "ASEHAagent: The login file '$OCF_RESKEY_login_file' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_user' is set
-	if [[ -z "$OCF_RESKEY_sybase_user" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_user' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the user 'sybase_user' exist
-	id -u $OCF_RESKEY_sybase_user
-	if [[ $? != 0 ]]
-	then
-		ocf_log err "ASEHAagent: The user '$OCF_RESKEY_sybase_user' doesn't exist in the system."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'interfaces_file' is set
-	if [[ -z "$OCF_RESKEY_interfaces_file" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'interfaces_file' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the file 'interfaces_file' exists
-	if [[ ! -f $OCF_RESKEY_interfaces_file ]]
-	then
-		ocf_log err "ASEHAagent: The interfaces file '$OCF_RESKEY_interfaces_file' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'shutdown_timeout' is a valid value
-	if [[ $OCF_RESKEY_shutdown_timeout -eq 0 ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'shutdown_timeout' is not set. Its value cannot be zero."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'start_timeout' is a valid value
-	if [[ $OCF_RESKEY_start_timeout -eq 0 ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'start_timeout' is not set. Its value cannot be zero."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'deep_probe_timeout' is a valid value
-	if [[ $OCF_RESKEY_deep_probe_timeout -eq 0 ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'deep_probe_timeout' is not set. Its value cannot be zero."
-		return $OCF_ERR_ARGS
-	fi
-
-	ocf_log debug "ASEHAagent: End 'verify_all' successfully."
-
-	return 0
-}
-
-################################################################################################################
-# Function name: get_login_string                                                                              #
-# Parameter: None                                                                                              #
-# Return value:                                                                                                #
-#              0    SUCCESS                                                                                    #
-#              1    FAIL                                                                                       #
-# Description: Analyze the login_file to format the login string. This function will set the global variable   #
-#              "login_string". If the login/password is clear text, the "login_string" will become to "-Ulogin #
-#              -Ppassword" if there is no error. If there are any errors in this function, the string          #
-#              "login_string" will be still empty. In current stage, the encrypted string is not supported     #
-#              because "haisql" is not available on this platform.                                             #
-################################################################################################################
-get_login_string()
-{
-	tmpstring=""
-	login_sting=""
-
-	# Read the first column. The valid value will be "normal" or "encrypted". Any other values are invalid.
-	login_type=`head -1 $OCF_RESKEY_login_file | awk '{print $1}'`
-	if [[ $login_type = "normal" ]]
-	then
-		# The login/password pair is saved in clear text.
-		# Abstract the login/password from the line. 
-		tmpstring=`head -1 $OCF_RESKEY_login_file | awk '{print $2}'`
-
-		# Abstract "user" from the string.
-		user=`echo $tmpstring | awk -F'/' '{print $1}'`
-		# Check if the "user" string is NULL. If it is NULL, it means this is not a valid user.
-		if  [[ -z $user ]]
-		then
-			ocf_log err "ASEHAagent: Login username is not specified in the file '$OCF_RESKEY_login_file'"
-			return 1
-		fi
-
-		# Abstract "password" from the string.
-		passwd=`echo $tmpstring | awk -F'/' '{print $2}'`
-
-		# Format the "login_string".
-		login_string="-U$user -P$passwd"
-	else
-		# The login_type is invalid value.
-		ocf_log err "ASEHAagent: Login type specified in the file $OCF_RESKEY_login_file is not 'normal' or 'encrypted' which are only supported values."
-		return 1
-	fi
-
-	# The "login_file" has been analyzed successfully. Now, the value of "login_string" contains the login/password information.
-	return 0
-}
-
-##############################################################################################
-# Function name: ase_start                                                                   #
-# Parameter: None                                                                            #
-# Return value:                                                                              #
-#             0  SUCCESS                                                                     #
-#             1  FAIL                                                                        #
-# Description: This function is used to start the ASE server in primary or secondary server. #
-##############################################################################################
-ase_start()
-{
-	ocf_log debug "ASEHAagent: Start 'ase_start'"
-
-	# Check if the server is running. If yes, return SUCCESS directly. Otherwise, continue the start work.
-	ase_is_running
-	if [[ $? = 0 ]]
-	then
-		# The server is running. 
-		ocf_log info "ASEHAagent: Server is running. Start is success."
-		return 0
-	fi
-
-	# The server is not running. We need to start it.
-	# If the log file existed, delete it.
-	if [[ -f $CONSOLE_LOG ]]
-	then
-		rm -f $CONSOLE_LOG
-	fi
-		
-	ocf_log debug "ASEHAagent: Starting '$OCF_RESKEY_server_name'..."
-
-	# Run runserver script to start the server. Since this script will be run by root and ASE server
-	# needs to be run by another user, we need to change the user to sybase_user first. Then, run
-	# the script to start the server.
-	su $OCF_RESKEY_sybase_user -c ksh << EOF
-		# set required SYBASE environment by running SYBASE.sh.
-		. $OCF_RESKEY_sybase_home/SYBASE.sh
-		# Run the RUNSERVER_SCRIPT to start the server.
-                . $RUNSERVER_SCRIPT > $CONSOLE_LOG 2>&1 &
-EOF
-
-	# Monitor every 1 seconds if the server has
-	# recovered, until RECOVERY_TIMEOUT.
-	t=0
-	while [[ $t -le $OCF_RESKEY_start_timeout ]]
-	do
-		grep -s "Recovery complete." $CONSOLE_LOG > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			# The server has not completed the recovery. We need to continue to monitor the recovery
-			# process.
-			t=`expr $t + 1`
-		else
-			# The server has completed the recovery.
-			ocf_log info "ASEHAagent: ASE server '$OCF_RESKEY_server_name' started successfully."
-			break
-		fi
-		sleep 1
-	done
-
-	# If $t is larger than start_timeout, it means the ASE server cannot start in given time. Otherwise, it 
-	# means the ASE server has started successfully.
-	if [[ $t -gt $OCF_RESKEY_start_timeout ]]
-	then
-		# The server cannot start in specified time. We think the start is failed.
-		ocf_log err "ASEHAagent: Failed to start ASE server '$OCF_RESKEY_server_name'. Please check the server error log $CONSOLE_LOG for possible problems."
-		return 1
-	fi
-
-	ocf_log debug "ASEHAagent: End 'ase_start' successfully."
-
-	return 0
-}
-
-#############################################################################################
-# Function name: ase_stop                                                                   #
-# Parameter: None                                                                           #
-# Return value:                                                                             #
-#             0  SUCCESS                                                                    #
-#             1  FAIL                                                                       #
-# Description: This function is used to stop the ASE server in primary or secondary server. #
-#############################################################################################
-ase_stop()
-{
-	ocf_log debug "ASEHAagent: Start 'ase_stop'"
-
-	# Check if the ASE server is still running.
-	ase_is_running
-	if [[ $? != 0 ]]
-	then
-		# The ASE server is not running. We need not to shutdown it.
-		ocf_log info "ASEHAagent: The dataserver $OCF_RESKEY_server_name is not running."
-		return 0
-	fi
-
-	# Call get_login_string() to parse the login/password string
-	get_login_string
-	if [[ $? = 1 ]]
-	then
-		# The login account cannot be used. So we will kill the process directly.
-		ocf_log info "ASEHAagent: Cannot parse the login file $OCF_RESKEY_login_file. Kill the processes of ASE directly."
-		# Kill the OS processes immediately.
-		kill_ase 0
-		return $?
-	fi
-
-	# Just in case things are hung, start a process that will wait for the
-	# timeout period, then kill any remaining porcesses.  We'll need to
-	# monitor this process (set -m), so we can terminate it later if it is
-	# not needed.
-	set -m
-	$PROG kill &
-	KILL_PID=$!     # If successful, we will also terminate watchdog process
-
-	# Run "shutdown with nowait" from isql command line to shutdown the server
-	su $OCF_RESKEY_sybase_user -c ksh << EOF
-		# set required SYBASE environment by running SYBASE.sh.
-		. $OCF_RESKEY_sybase_home/SYBASE.sh
-		# Run "shutdown with nowait" to shutdown the server immediately.
-		(echo "use master" ; echo go ; echo "shutdown with nowait"; echo go) | \
-		\$SYBASE/\$SYBASE_OCS/bin/isql $login_string -S$OCF_RESKEY_server_name -I$OCF_RESKEY_interfaces_file  &
-EOF
-
-	sleep 5
-
-	# Check if the server has been shutted down successfully
-	t=0
-	while [[ $t -lt $OCF_RESKEY_shutdown_timeout ]]
-	do
-		# Search "usshutdown: exiting" in the server log. If found, it means the server has been shutted down. 
-		# Otherwise, we need to wait.
-		tail $CONSOLE_LOG | grep "ueshutdown: exiting" > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			# The shutdown is still in processing. Wait...
-			sleep 2
-			t=`expr $t+2`
-		else
-			# The shutdown is success.
-			ocf_log info "ASEHAagent: ASE server '$OCF_RESKEY_server_name' shutdown with isql successfully."
-			break
-		fi
-	done
-
-	# If $t is larger than shutdown_timeout, it means the ASE server cannot be shutted down in given time. We need
-	# to wait for the background kill process to kill the OS processes directly.
-	if  [[ $t -ge $OCF_RESKEY_shutdown_timeout ]]
-	then
-		ocf_log err "ASEHAagent: Shutdown of '$OCF_RESKEY_server_name' from isql failed.  Server is either down or unreachable."
-	fi
-
-	# Here, the ASE server has been shutted down by isql command or killed by background process. We need to do
-	# further check to make sure all processes have gone away before saying shutdown is complete. This stops the
-	# other node from starting up the package before it has been stopped and the file system has been unmounted.
-	
-	# Get all processes ids from log file
-	declare -a ENGINE_ALL=(`sed -n -e '/engine /s/^.*os pid \([0-9]*\).*online$/\1/p' $CONSOLE_LOG`)
-	typeset -i num_procs=${#ENGINE_ALL[@]}
-
-	# We cannot find any process id from log file. It may be because the log file is corrupted or be deleted.
-	# In this case, we determine the shutdown is failed.
-	if [[ "${ENGINE_ALL[@]}" = "" ]]
-	then
-		ocf_log err "ASEHAagent: Unable to find the process id from $CONSOLE_LOG."
-		ocf_log err "ASEHAagent: Stop ASE server failed."
-		return 1
-	fi
-
-	# Monitor the system processes to make sure all ASE related processes have gone away.
-	while true
-	do
-		# To every engine process, search it in system processes list. If it is not in the
-		# list, it means this process has gone away. Otherwise, we need to wait for it is
-		# killed by background process.
-		for i in ${ENGINE_ALL[@]}
-		do
-			ps -fu $OCF_RESKEY_sybase_user | awk '{print $2}' | grep $i | grep -v grep
-			if [[ $? != 0 ]]
-			then
-				ocf_log debug "ASEHAagent: $i process has stopped."
-				c=0
-				while (( c < $num_procs ))
-				do
-					if [[ ${ENGINE_ALL[$c]} = $i ]]
-					then
-						unset ENGINE_ALL[$c]
-						c=$num_procs
-					fi
-					(( c = c + 1 ))	
-				done
-			fi
-		done
-		
-		# To here, all processes should have gone away. 
-		if [[ ${ENGINE_ALL[@]} = "" ]]
-		then
-			#
-			# Looks like shutdown was successful, so kill the
-			# script to kill any hung processes, which we started earlier.
-			# Check to see if the script is still running.  If jobs
-			# returns that the script is done, then we don't need to kill
-			# it.
-			#
-			job=$(jobs | grep -v Done)
-			if [[ ${job} != "" ]]
-			then
-				ocf_log debug "ASEHAagent: Killing the kill_ase script."
-
-				kill -15 $KILL_PID > /dev/null 2>&1
-			fi
-			break
-	        fi
-		sleep 5
-	done
-
-	ocf_log debug "ASEHAagent: End 'ase_stop'."
-
-	return 0
-}
-
-####################################################################################
-# Function name: ase_is_running                                                    #
-# Parameter: None                                                                  #
-# Return value:                                                                    #
-#             0   ASE server is running                                            #
-#             1   ASE server is not running or there are errors                    #
-# Description: This function is used to check if the ASE server is still running . #
-####################################################################################
-ase_is_running()
-{
-	# If the error log doesn't exist, we can say there is no ASE is running.
-	if [[ ! -f $CONSOLE_LOG ]]
-	then
-		return 1
-	fi
-
-	# The error log file exists. Check if the engine 0 is alive.
-	ENGINE_0=(`sed -n -e '/engine 0/s/^.*os pid \([0-9]*\).*online$/\1/p' $CONSOLE_LOG`)
-	if [[ "$ENGINE_0" = "" ]]
-	then
-		# The engine 0 is down.
-		return 1 
-	else
-		kill -s 0 $ENGINE_0 > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			# The engine 0 is not running.
-			return 1
-		else
-			# The engine 0 is running.
-			return 0
-		fi
-        fi
-
-	return 1
-}
-
-####################################################################################
-# Function name: ase_is_running                                                    #
-# Parameter:                                                                       #
-#             DELAY  The seconds to wait before killing the ASE processes. 0 means #
-#                    kill the ASE processes immediately.                           #
-# Return value: None                                                               #
-#             1   ASE server is not running or there are errors                    #
-# Description: This function is used to check if the ASE server is still running . #
-####################################################################################
-kill_ase()
-{
-	ocf_log debug "ASEHAagent: Start 'kill_ase'."
-
-	DELAY=$1
-
-	# Wait for sometime before sending a kill signal.  
-	t=0
-        while [[ $t -lt $DELAY ]]
-        do
-     		sleep 1
-		t=`expr $t+1`
-        done
-
-	# Get the process ids from log file
-	declare -a ENGINE_ALL=`sed -n -e '/engine /s/^.*os pid \([0-9]*\).*online$/\1/p' $CONSOLE_LOG`
-
-	# If there is no process id found in the log file, we need not to continue.
-	if [[ "${ENGINE_ALL[@]}" = "" ]]
-	then
-		ocf_log err "ASEHAagent: Unable to find the process id from $CONSOLE_LOG."
-		return
-	fi
-
-	# Kill the datasever process(es)
-	for pid in ${ENGINE_ALL[@]}
-	do
-		kill -9 $pid > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			ocf_log info "ASEHAagent: kill_ase function did NOT find process $pid running."
-		else
-			ocf_log info "ASEHAagent: kill_ase function did find process $pid running.  Sent SIGTERM."
-		fi
-	done
-
-	ocf_log debug "ASEHAagent: End 'kill_ase'."
-}
-
-
-#######################################################################################
-# Function name: terminate                                                            #
-# Parameter: None                                                                     #
-# Return value: Always be 1                                                           #
-# Description: This function is called automatically after this script is terminated. #
-#######################################################################################
-terminate()
-{
-	ocf_log debug "ASEHAagent: This monitor script has been signaled to terminate."
-	exit 1
-}
-
-#####################################################################################
-# Function name: ase_status                                                         #
-# Parameter:                                                                        #
-#             0   Level 0 probe. In this level, we just check if engine 0 is alive  #
-#             10  Level 10 probe. In this level, we need to probe if the ASE server #
-#                 still has response.                                               #              
-# Return value:                                                                     #
-#             0   The server is still alive                                         #
-#             1   The server is down                                                #
-# Description: This function is used to check if the ASE server is still running.   #
-#####################################################################################
-ase_status()
-{
-	ocf_log debug "ASEHAagent: Start 'ase_status'."
-
-	# Step 1: Check if the engine 0 is alive
-	ase_is_running
-	if [[ $? = 1 ]]
-	then
-		# ASE is down. Return fail to rgmanager to trigger the failover process.
-		ocf_log err "ASEHAagent: ASE server is down."
-		return 1
-	fi
-
-	# ASE process is still alive. 
-	# Step2: If this is level 10 probe, We need to check if the ASE server still has response.
-	if [[ $1 -gt 0 ]]
-	then
-		ocf_log debug "ASEHAagent: Need to run deep probe."
-		# Run deep probe
-		deep_probe
-		if [[ $? = 1 ]]
-		then
-			# Deep probe failed. This means the server has been down.
-			ocf_log err "ASEHAagent: Deep probe found the ASE server is down."
-			return 1
-		fi
-	fi
-
-	ocf_log debug "ASEHAagent: End 'ase_status'."
-
-	return 0
-}
-
-####################################################################################
-# Function name: deep_probe                                                        #
-# Parameter: None                                                                  #
-# Return value:                                                                    #
-#             0   ASE server is alive                                              #
-#             1   ASE server is down                                               #
-# Description: This function is used to run deep probe to make sure the ASE server #
-#              still has response.                                                 #
-####################################################################################
-deep_probe()
-{
-	declare -i rv
-	
-	ocf_log debug "ASEHAagent: Start 'deep_probe'."	
-
-	# Declare two temporary files which will be used in this probe.
-	tmpfile1="$(mktemp /tmp/ASEHAagent.1.XXXXXX)"
-	tmpfile2="$(mktemp /tmp/ASEHAagent.2.XXXXXX)"
-	
-	# Get the login_string by analyzing the login_file.
-	get_login_string
-	if [[ $? = 1 ]]
-	then
-		# Login string cannot be fetched. Cannot continue the deep probe.
-		ocf_log err "ASEHAagent: Cannot run the deep probe because of incorrect login file $OCF_RESKEY_login_file. Deep probe failed."
-		return 1
-	fi
-
-	rm -f $tmpfile1
-	rm -f $tmpfile2
-
-	# The login file is correct. We have gotten the login account and password from it.
-	# Run isql command in background.
-	su $OCF_RESKEY_sybase_user -c ksh << EOF
-		# set required SYBASE environment by running SYBASE.sh.
-		. $OCF_RESKEY_sybase_home/SYBASE.sh
-		# Run a very simple SQL statement to make sure the server is still ok. The output will be put to
-		# tmpfile1.
-		(echo "select 1"; echo "go") |
-		\$SYBASE/\$SYBASE_OCS/bin/isql $login_string -S$OCF_RESKEY_server_name -I$OCF_RESKEY_interfaces_file -t $OCF_RESKEY_deep_probe_timeout -e -o$tmpfile1 &
-		# Record the isql command process id to temporary file. If the isql is hung, we need this process id
-                # to kill the hung process.
-		echo \$! > $tmpfile2	
-EOF
-	
-	declare -i t=0
-		
-	# Monitor the output file tmpfile1.
-	while [[ $t -lt $OCF_RESKEY_deep_probe_timeout ]]
-	do
-		# If the SQL statement is executed successfully, we will get the following output:
-		# 1> select 1
-		# 
-		# -----------
-		#           1
-		# 
-		# (1 row affected)
-		# So, we determine if the execution is success by searching the keyword "(1 row affected)".
-		grep "(1 row affected)" $tmpfile1
-		if [[ $? = 0 ]]
-		then
-			ocf_log debug "ASEHAagent: Deep probe sucess."
-			break
-		else
-			sleep 1
-			t=`expr $t+1`
-		fi
-	done	
-
-	# If $t is larger than deep_probe_timeout, it means the isql command line cannot finish in given time.
-	# This means the deep probe failed. We need to kill the isql process manually.
-	if [[ $t -ge $OCF_RESKEY_deep_probe_timeout ]]
-	then
-		ocf_log err "ASEHAagent: Deep probe fail. The dataserver has no response."		
-
-		# Read the process id of isql process from tmpfile2
-		pid=`cat $tmpfile2 | awk '{print $1}'`
-
-		rm -f $tmpfile1
-		rm -f $tmpfile2
-
-		# Kill the isql process directly.
-		kill -9 $pid
-		return 1
-	fi
-
-	rm -f $tmpfile1
-	rm -f $tmpfile2
-
-	ocf_log debug "ASEHAagent: End 'deep_probe'."
-
-	return 0
-}
-
-trap terminate SIGTERM
-
-#############################
-# Do some real work here... #
-#############################
-case $1 in
-	start)
-		verify_all || exit 1
-		ase_start
-		exit $?
-		;;
-	stop)
-		verify_all || exit 1
-		ase_stop
-		exit $?
-		;;
-	status | monitor)
-		verify_all || exit 1
-		ase_status $OCF_CHECK_LEVEL
-		exit $?
-		;;
-	kill)
-		kill_ase $OCF_RESKEY_shutdown_timeout
-		;;
-	meta-data)
-		meta_data
-		exit $?
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	*)
-		echo "Usage: $SCRIPT {start|stop|monitor|status|validate-all|meta-data}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
-exit 0
-
diff --git a/rgmanager/src/resources/Makefile b/rgmanager/src/resources/Makefile
index f689e93..00b2bc8 100644
--- a/rgmanager/src/resources/Makefile
+++ b/rgmanager/src/resources/Makefile
@@ -1,118 +1,12 @@
-TARGET1=utils/config-utils.sh
-TARGET2=fs.sh
-TARGET3=oracledb.sh
-
-all: $(TARGET1) $(TARGET2) $(TARGET3)
-
 include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-
-RESOURCES=service.sh ip.sh nfsclient.sh nfsexport.sh \
-	script.sh netfs.sh clusterfs.sh \
-	apache.sh openldap.sh samba.sh mysql.sh \
-	postgres-8.sh tomcat-6.sh lvm.sh \
-	vm.sh SAPInstance SAPDatabase named.sh \
-	ASEHAagent.sh nfsserver.sh orainstance.sh oralistener.sh
-
-METADATA=apache.metadata openldap.metadata samba.metadata \
-	mysql.metadata postgres-8.metadata tomcat-5.metadata \
-	tomcat-6.metadata named.metadata lvm.metadata \
-	orainstance.metadata oralistener.metadata
-
-EVENT_TARGETS= \
-	default_event_script.sl \
-	follow-service.sl
-
-GENERAL_TARGETS=ocf-shellfuncs svclib_nfslock lvm_by_lv.sh lvm_by_vg.sh
-
-UTIL_TARGETS= \
-	utils/ra-skelet.sh utils/messages.sh \
-	utils/httpd-parse-config.pl utils/tomcat-parse-config.pl \
-	utils/member_util.sh utils/fs-lib.sh \
-	utils/named-parse-config.pl
 
-SBINDIRT= \
-	utils/rhev-check.sh
+all:
 
-$(TARGET1):
-	mkdir -p utils
-	cat $(S)/$(TARGET1).in | sed \
-		-e 's#@CONFDIR@#${CONFDIR}#g' \
-		-e 's#@CONFFILE@#${CONFFILE}#g' \
-	> $(TARGET1)
+SHAREDIRT= default_event_script.sl \
+	   follow-service.sl
 
-$(TARGET2):
-	cat $(S)/$(TARGET2).in | sed \
-		-e 's#@LOGDIR@#${logdir}#g' \
-	> $(TARGET2)
-
-$(TARGET3):
-	cat $(S)/$(TARGET3).in | sed \
-		-e 's#@LOGDIR@#${logdir}#g' \
-	> $(TARGET3)
-
-install:
-	install -d ${sharedir}/utils
-	set -e; \
-	for i in $(RESOURCES); do \
-	 install -m755 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(METADATA) $(EVENT_TARGETS); do \
-	 install -m644 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(GENERAL_TARGETS); do \
-	 install -m755 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(UTIL_TARGETS); do \
-	 install -m755 $(S)/$$i ${sharedir}/utils; \
-	done
-	install -m755 $(TARGET1) ${sharedir}/utils
-	install -m755 $(TARGET2) $(TARGET3) ${sharedir}
-	install -d ${sbindir}
-	for i in $(SBINDIRT); do \
-	 install -m755 $(S)/$$i ${sbindir}; \
-	done
-
-uninstall:
-	${UNINSTALL} ${RESOURCES} ${GENERAL_TARGETS} \
-		     ${METADATA} ${EVENT_TARGETS} ${UTIL_TARGETS} \
-		     $(TARGET1) $(TARGET2) $(TARGET3) \
-		     ${sharedir} ${SBINDIRT}
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
 
 clean: generalclean
-	rm -f resources.rng
-
-check: $(RESOURCES) $(TARGET2) $(TARGET3) ra-api-1-modified.dtd
-	@echo Validating resource agent meta-data
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "   ./$$f "; \
-		bash ./$$f meta-data | xmllint --dtdvalid \
-				  ./ra-api-1-modified.dtd --noout -; \
-		if [ $$? -ne 0 ]; then exit 1; fi \
-	done
-
-#
-# Schema maintenance.  Run 'make resources.rng' and paste it in to
-# config/tools/xml/cluster.rng.in where it says 'autogenerated'.
-#
-# resources.rng.* should never be distributed by themselves.
-#
-resources.rng: $(RESOURCES) $(TARGET2) $(TARGET3) ra2rng.xsl ra2ref.xsl
-	rm -f resources.rng
-	cat resources.rng.head >> resources.rng
-	@echo Generating per-resource RelaxNG information...
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "    ./$$f"; \
-		bash ./$$f meta-data | xsltproc ra2rng.xsl - >> resources.rng; \
-	done
-	cat resources.rng.mid >> resources.rng
-	@echo Generating per-resource RelaxNG reference information...
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "    ./$$f"; \
-		bash ./$$f meta-data | xsltproc ra2ref.xsl - >> resources.rng; \
-	done
-	cat resources.rng.tail >> resources.rng
-
diff --git a/rgmanager/src/resources/SAPDatabase b/rgmanager/src/resources/SAPDatabase
deleted file mode 100644
index 5027018..0000000
--- a/rgmanager/src/resources/SAPDatabase
+++ /dev/null
@@ -1,1025 +0,0 @@
-#!/bin/sh
-#
-# SAPDatabase
-#
-# Description:	Manages any type of SAP supported database instance
-#               as a High-Availability OCF compliant resource.
-#
-# Author:       Alexander Krauth, October 2006
-# Support:      linux at sap.com
-# License:      GNU General Public License (GPL)
-# Copyright:    (c) 2006, 2007 Alexander Krauth
-#
-# An example usage: 
-#      See usage() function below for more details...
-#
-# OCF instance parameters:
-#	OCF_RESKEY_SID
-#       OCF_RESKEY_DIR_EXECUTABLE   (optional, well known directories will be searched by default)
-#       OCF_RESKEY_DBTYPE
-#       OCF_RESKEY_NETSERVICENAME   (optional, non standard name of Oracle Listener)
-#       OCF_RESKEY_DBJ2EE_ONLY      (optional, default is false)
-#       OCF_RESKEY_JAVA_HOME        (optional, only needed if DBJ2EE_ONLY is true and JAVA_HOME enviroment variable is not set)
-#       OCF_RESKEY_STRICT_MONITORING (optional, activate application level monitoring - with Oracle a failover will occur in case of an archiver stuck)
-#       OCF_RESKEY_AUTOMATIC_RECOVER (optional, automatic startup recovery, default is false)
-#       OCF_RESKEY_DIR_BOOTSTRAP    (optional, if non standard J2EE server directory)
-#       OCF_RESKEY_DIR_SECSTORE     (optional, if non standard J2EE secure store directory)
-#       OCF_RESKEY_DB_JARS          (optional, if maintained in bootstrap.properties, mandatory for WebAS Java 7.10)
-#	OCF_RESKEY_PRE_START_USEREXIT	(optional, lists a script which can be executed before the resource is started)
-#	OCF_RESKEY_POST_START_USEREXIT	(optional, lists a script which can be executed after the resource is started)
-#	OCF_RESKEY_PRE_STOP_USEREXIT	(optional, lists a script which can be executed before the resource is stopped)
-#	OCF_RESKEY_POST_STOP_USEREXIT	(optional, lists a script which can be executed after the resource is stopped)
-#
-# ToDo:
-# Remove all the database dependend stuff from the agent and use
-# saphostcontrol daemon as soon as SAP will release it.
-#
-#######################################################################
-# Initialization:
-
-if [ -f $(dirname $0)/.ocf-shellfuncs ]; then
-        . $(dirname $0)/.ocf-shellfuncs
-elif [ -f $(dirname $0)/ocf-shellfuncs ]; then
-        LC_ALL=C
-        LANG=C
-        PATH=/bin:/sbin:/usr/bin:/usr/sbin
-        export LC_ALL LANG PATH
-        . $(dirname $0)/ocf-shellfuncs
-else
-        echo Could not find ocf-shellfuncs!
-        exit 1
-fi
-
-#######################################################################
-
-SH=/bin/sh
-
-usage() {
-  methods=`sapdatabase_methods`
-  methods=`echo $methods | tr ' ' '|'`
-  cat <<-!
-	usage: $0 ($methods)
-
-	$0 manages a SAP database of any type as an HA resource.
-        Currently Oracle, MaxDB and DB/2 UDB are supported.
-        ABAP databases as well as JAVA only databases are supported.
-
-	The 'start' operation starts the instance.
-	The 'stop' operation stops the instance.
-	The 'status' operation reports whether the instance is running
-	The 'monitor' operation reports whether the instance seems to be working
-	The 'recover' operation tries to recover the instance after a crash (instance will be stopped first!)
-	The 'validate-all' operation reports whether the parameters are valid
-	The 'methods' operation reports on the methods $0 supports
-
-	!
-}
-
-meta_data() {
-	cat <<END
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="SAPDatabase">
-<version>1.92.1</version>
-
-<longdesc lang="en">
-Resource script for SAP databases. It manages a SAP database of any type as an HA resource.
-</longdesc>
-<shortdesc lang="en">SAP database resource agent</shortdesc>
-
-<parameters>
- <parameter name="SID" unique="1" required="1" primary="1">
-  <longdesc lang="en">The unique SAP system identifier. e.g. P01</longdesc>
-  <shortdesc lang="en">SAP system ID</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_EXECUTABLE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find sapstartsrv and sapcontrol.</longdesc>
-  <shortdesc lang="en">path of sapstartsrv and sapcontrol</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DBTYPE" unique="0" required="1">
-  <longdesc lang="en">The name of the database vendor you use. Set either: ORA,DB6,ADA</longdesc>
-  <shortdesc lang="en">database vendor</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="NETSERVICENAME" unique="0" required="0">
-  <longdesc lang="en">The Oracle TNS listener name.</longdesc>
-  <shortdesc lang="en">listener name</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DBJ2EE_ONLY" unique="0" required="0">
-  <longdesc lang="en">If you do not have a ABAP stack installed in the SAP database, set this to TRUE</longdesc>
-  <shortdesc lang="en">only JAVA stack installed</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="JAVA_HOME" unique="0" required="0">
-  <longdesc lang="en">This is only needed if the DBJ2EE_ONLY parameter is set to true. Enter the path to the Java SDK which is used by the SAP WebAS Java</longdesc>
-  <shortdesc lang="en">Path to Java SDK</shortdesc>
-  <content type="string" default=""/>
- </parameter>
- <parameter name="STRICT_MONITORING" unique="0" required="0">
-  <longdesc lang="en">This controls how the resource agent monitors the database. If set to true, it will use SAP tools to test the connect to the database. Do not use with Oracle, because it will result in unwanted failovers in case of an archiver stuck</longdesc>
-  <shortdesc lang="en">Activates application level monitoring</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="AUTOMATIC_RECOVER" unique="0" required="0">
-  <longdesc lang="en">The SAPDatabase resource agent tries to recover a failed start attempt automaticaly one time. This is done by running a forced abort of the RDBMS and/or executing recovery commands.</longdesc>
-  <shortdesc lang="en">Enable or disable automatic startup recovery</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="DIR_BOOTSTRAP" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find the J2EE instance bootstrap directory. e.g. /usr/sap/P01/J00/j2ee/cluster/bootstrap</longdesc>
-  <shortdesc lang="en">path to j2ee bootstrap directory</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_SECSTORE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find the J2EE security store directory. e.g. /usr/sap/P01/SYS/global/security/lib/tools</longdesc>
-  <shortdesc lang="en">path to j2ee secure store directory</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DB_JARS" unique="0" required="0">
-  <longdesc lang="en">The full qualified filename of the jdbc driver for the database connection test. It will be automaticaly read from the bootstrap.properties file in Java engine 6.40 and 7.00. For Java engine 7.10 the parameter is mandatory.</longdesc>
-  <shortdesc lang="en">file name of the jdbc driver</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="PRE_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets started.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got started.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="PRE_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets stopped.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got stopped.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
-</parameters>
-
-<actions>
-<action name="start" timeout="1800" />
-<action name="stop" timeout="1800" />
-<action name="status" depth="0" timeout="60" interval="120" start-delay="180" />
-<action name="monitor" depth="0" timeout="60" interval="120" start-delay="180" />
-<action name="validate-all" timeout="5" />
-<action name="meta-data" timeout="5" />
-<action name="methods" timeout="5" />
-</actions>
-</resource-agent>
-END
-}
-
-trap_handler() {
-  rm -f $TEMPFILE
-  exit $OCF_ERR_GENERIC
-}
-
-
-do_exit() {
-  # If we've got a tempfile variable and the tempfile exists...
-  #  ... if the return code is 0 *or* the temp file is empty
-  #    remove it.
-  if [ -n "$TEMPFILE" ] && [ -e "$TEMPFILE" ]; then
-    if [ $1 -eq 0 ] || [ "$(stat -c %s $TEMPFILE)" = "0" ]; then
-      rm -f $TEMPFILE
-    fi
-  fi
-  exit $1
-}
-
-
-#
-# listener_start: Start the given listener
-#
-listener_start() {
-  orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
-  rc=$OCF_SUCCESS
-  output=`echo "lsnrctl start $NETSERVICENAME" | su - $orasid 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "Oracle Listener $NETSERVICENAME started: $output"
-    rc=$OCF_SUCCESS
-  else
-    ocf_log err "Oracle Listener $NETSERVICENAME start failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# listener_stop: Stop the given listener
-#
-listener_stop() {
-  orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
-  rc=$OCF_SUCCESS
-  if
-      listener_status
-  then
-      : listener is running, trying to stop it later...
-  else
-      return $OCF_SUCCESS
-  fi
-  output=`echo "lsnrctl stop $NETSERVICENAME" | su - $orasid 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "Oracle Listener $NETSERVICENAME stopped: $output"
-  else
-    ocf_log err "Oracle Listener $NETSERVICENAME stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# listener_status: is the given listener running?
-#
-listener_status() {
-  orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
-  # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
-  # as the output might be to long.
-  cnt=`ps efo args --user $orasid | grep $NETSERVICENAME | grep -c tnslsnr`
-  if [ $cnt -eq 1 ]
-  then
-    rc=$OCF_SUCCESS
-  else
-    ocf_log info "listener process not running for $NETSERVICENAME for $SID"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# x_server_start: Start the given x_server
-#
-x_server_start() {
-  rc=$OCF_SUCCESS
-  output=`echo "x_server start" | su - $sidadm 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "MaxDB x_server start: $output"
-    rc=$OCF_SUCCESS
-  else
-    ocf_log err "MaxDB x_server start failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# x_server_stop: Stop the x_server
-#
-x_server_stop() {
-  rc=$OCF_SUCCESS
-  output=`echo "x_server stop" | su - $sidadm 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "MaxDB x_server stop: $output"
-  else
-    ocf_log err "MaxDB x_server stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# x_server_status: is the x_server running?
-#
-x_server_status() {
-  sdbuser=`grep "^SdbOwner" /etc/opt/sdb | awk -F'=' '{print $2}'`
-  # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
-  # as the output might be to long.
-  cnt=`ps efo args --user $sdbuser | grep -c vserver`
-  if [ $cnt -ge 1 ]
-  then
-    rc=$OCF_SUCCESS
-  else
-    ocf_log info "x_server process not running"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# oracle_stop: Stop the Oracle database without any condition
-#
-oracle_stop() {
-echo '#!/bin/sh
-LOG=$HOME/stopdb.log
-date > $LOG
-
-if [ -x "${ORACLE_HOME}/bin/sqlplus" ]
-then
-    SRVMGRDBA_EXE="${ORACLE_HOME}/bin/sqlplus"
-else
-   echo "Can not find executable sqlplus" >> $LOG
-   exit 1
-fi
-
-$SRVMGRDBA_EXE /NOLOG >> $LOG << !
-connect / as sysdba
-shutdown immediate
-exit
-!
-rc=$?
-cat $LOG
-exit $rc' > $TEMPFILE
-
-chmod 700 $TEMPFILE
-chown $sidadm $TEMPFILE
-
-su - $sidadm -c $TEMPFILE
-retcode=$?
-rm -f $TEMPFILE
-
-if [ $retcode -eq 0 ]; then
-  sapdatabase_status
-  if [ $? -ne $OCF_NOT_RUNNING ]; then
-    retcode=1
-  fi
-fi
-
-return $retcode
-}
-
-#
-# maxdb_stop: Stop the MaxDB database without any condition
-#
-maxdb_stop() {
-
-# x_Server must be running to stop database
-x_server_status
-if [ $? -ne $OCF_SUCCESS ]; then x_server_start; fi
-
-if [ $DBJ2EE_ONLY -eq 1 ]; then
-   userkey=c_J2EE
-else
-   userkey=c
-fi
-
-echo "#!/bin/sh
-LOG=\$HOME/stopdb.log
-date > \$LOG
-echo \"Stop database with xuserkey >$userkey<\" >> \$LOG
-dbmcli -U ${userkey} db_offline >> \$LOG 2>&1
-exit \$?" > $TEMPFILE
-
-chmod 700 $TEMPFILE
-chown $sidadm $TEMPFILE
-
-su - $sidadm -c $TEMPFILE
-retcode=$?
-rm -f $TEMPFILE
-
-if [ $retcode -eq 0 ]; then
-  sapdatabase_status
-  if [ $? -ne $OCF_NOT_RUNNING ]; then
-    retcode=1
-  fi
-fi
-
-return $retcode
-}
-
-#
-# db6udb_stop: Stop the DB2/UDB database without any condition
-#
-db6udb_stop() {
-echo '#!/bin/sh
-LOG=$HOME/stopdb.log
-date > $LOG
-echo "Shut down the database" >> $LOG
-$INSTHOME/sqllib/bin/db2 deactivate database $DB2DBDFT |tee -a $LOG  2>&1
-$INSTHOME/sqllib/adm/db2stop force |tee -a $LOG  2>&1
-exit $?' > $TEMPFILE
-
-chmod 700 $TEMPFILE
-chown $sidadm $TEMPFILE
-
-su - $sidadm -c $TEMPFILE
-retcode=$?
-rm -f $TEMPFILE
-
-if [ $retcode -eq 0 ]; then
-  sapdatabase_status
-  if [ $? -ne $OCF_NOT_RUNNING ]; then
-    retcode=1
-  fi
-fi
-
-return $retcode
-}
-
-#
-# oracle_recover: try to clean up oracle after a crash
-#
-oracle_recover() {
-echo '#!/bin/sh
-LOG=$HOME/recover.log
-date > $LOG
-echo "Logfile written by heartbeat SAPDatabase resource agent" >> $LOG
-
-if [ -x "${ORACLE_HOME}/bin/sqlplus" ]
-then
-    SRVMGRDBA_EXE="${ORACLE_HOME}/bin/sqlplus"
-else
-   echo "Can not find executable sqlplus" >> $LOG
-   exit 1
-fi
-
-$SRVMGRDBA_EXE /NOLOG >> $LOG << !
-connect / as sysdba
-shutdown abort
-startup mount
-WHENEVER SQLERROR EXIT SQL.SQLCODE
-WHENEVER OSERROR EXIT FAILURE
-alter database recover automatic database;
-alter database open;
-exit
-!
-rc=$?
-cat $LOG
-exit $rc' > $TEMPFILE
-
-  chmod 700 $TEMPFILE
-  chown $sidadm $TEMPFILE
-
-  su - $sidadm -c $TEMPFILE
-  retcode=$?
-  rm -f $TEMPFILE
-
-  return $retcode
-}
-
-#
-# maxdb_recover: try to clean up MaxDB after a crash
-#
-maxdb_recover() {
-  # x_Server must be running to stop database
-  x_server_status
-  if [ $? -ne $OCF_SUCCESS ]; then x_server_start; fi
-
-  if [ $DBJ2EE_ONLY -eq 1 ]; then
-     userkey=c_J2EE
-  else
-     userkey=c
-  fi
-
-echo "#!/bin/sh
-LOG=\$HOME/recover.log
-date > \$LOG
-echo \"Logfile written by heartbeat SAPDatabase resource agent\" >> \$LOG
-echo \"Cleanup database with xuserkey >$userkey<\" >> \$LOG
-echo \"db_stop\" >> \$LOG 2>&1
-dbmcli -U ${userkey} db_stop >> \$LOG 2>&1
-echo \"db_clear\" >> \$LOG 2>&1
-dbmcli -U ${userkey} db_clear >> \$LOG 2>&1
-echo \"db_online\" >> \$LOG 2>&1
-dbmcli -U ${userkey} db_online >> \$LOG 2>&1
-rc=\$?
-cat \$LOG
-exit \$rc" > $TEMPFILE
-
-  chmod 700 $TEMPFILE
-  chown $sidadm $TEMPFILE
-
-  su - $sidadm -c $TEMPFILE
-  retcode=$?
-  rm -f $TEMPFILE
-
-  return $retcode
-}
-
-#
-# db6udb_recover: try to recover DB/2 after a crash
-#
-db6udb_recover() {
-  db2sid="db2`echo $SID | tr '[:upper:]' '[:lower:]'`"
-
-echo '#!/bin/sh
-LOG=$HOME/recover.log
-date > $LOG
-echo "Logfile written by heartbeat SAPDatabase resource agent" >> $LOG
-$INSTHOME/sqllib/bin/db2_kill >> $LOG  2>&1
-$INSTHOME/sqllib/adm/db2start >> $LOG  2>&1
-$INSTHOME/sqllib/bin/db2 activate database $DB2DBDFT >> $LOG  2>&1
-rc=$?
-cat $LOG
-exit $rc' > $TEMPFILE
-
-  chmod 700 $TEMPFILE
-  chown $db2sid $TEMPFILE
-
-  su - $db2sid -c $TEMPFILE
-  retcode=$?
-  rm -f $TEMPFILE
-
-  return $retcode
-}
-
-#
-# methods: What methods/operations do we support?
-#
-sapdatabase_methods() {
-  cat <<-!
-	start
-	stop
-	status
-	monitor
-	recover
-	validate-all
-	methods
-	meta-data
-	usage
-	!
-}
-
-
-#
-# sapuserexit : Many SAP customers need some additional processes/tools to run their SAP systems.
-#               This specialties do not allow a totally generic SAP cluster resource agent.
-#               Someone should write a resource agent for each additional process you need, if it
-#               is required to monitor that process within the cluster manager. To enable
-#               you to extent this resource agent without developing a new one, this user exit
-#               was introduced.
-#
-sapuserexit() {
-  NAME="$1"
-  VALUE="$2"
-
-  if [ -n "$VALUE" ]
-  then
-    if [ -x "$VALUE" ]
-    then
-      ocf_log info "Calling userexit ${NAME} with customer script file ${VALUE}"
-      eval "$VALUE" >& /dev/null
-      ocf_log info "Exiting userexit ${NAME} with customer script file ${VALUE}, returncode: $?"
-    else
-      ocf_log warn "Attribute ${NAME} is set to ${VALUE}, but this file is not executable"
-    fi
-  fi
-  return 0
-}
-
-
-#
-# sapdatabase_start : Start the SAP database
-#
-sapdatabase_start() {
-  sapuserexit PRE_START_USEREXIT "$OCF_RESKEY_PRE_START_USEREXIT"
-
-  case $DBTYPE in
-    ADA) x_server_start
-         ;;
-    ORA) listener_start
-         ;;
-  esac
-
-  output=`su - $sidadm -c $SAPSTARTDB`
-  rc=$?
-
-  if [ $DBJ2EE_ONLY -eq 1 ]
-  then
-    sapdatabase_monitor 1
-    rc=$?
-  fi
-
-  if [ $rc -ne 0 -a $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
-  then
-    ocf_log warn "SAP database $SID start failed: $output"
-    ocf_log warn "Try to recover database $SID"
-
-    output=''
-    sapdatabase_recover
-    rc=$?
-  fi
-
-  if [ $rc -eq 0 ]
-  then
-    ocf_log info "SAP database $SID started: $output"
-    rc=$OCF_SUCCESS
-    sapuserexit POST_START_USEREXIT "$OCF_RESKEY_POST_START_USEREXIT"
-  else
-    ocf_log err "SAP database $SID start failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-
-  return $rc
-}
-
-#
-# sapdatabase_stop: Stop the SAP database
-#
-sapdatabase_stop() {
-
-  sapuserexit PRE_STOP_USEREXIT "$OCF_RESKEY_PRE_STOP_USEREXIT"
-
-  # use of the stopdb kernel script is not possible, because there are to may checks in that
-  # script. We want to stop the database regardless of anything.
-  #output=`su - $sidadm -c $SAPSTOPDB`
-
-  case $DBTYPE in
-    ORA) output=`oracle_stop`
-         ;;
-    ADA) output=`maxdb_stop`
-         ;;
-    DB6) output=`db6udb_stop`
-         ;;
-  esac
-
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "SAP database $SID stopped: $output"
-    rc=$OCF_SUCCESS
-  else
-    ocf_log err "SAP database $SID stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-
-  case $DBTYPE in
-    ORA) listener_stop
-         ;;
-    ADA) x_server_stop
-         ;;
-  esac
-
-  sapuserexit POST_STOP_USEREXIT "$OCF_RESKEY_POST_STOP_USEREXIT"
-
-  return $rc
-}
-
-
-#
-# sapdatabase_monitor: Can the given database instance do anything useful?
-#
-sapdatabase_monitor() {
-  strict=$1
-  rc=$OCF_SUCCESS
-
-  case $DBTYPE in
-    ADA) x_server_status 
-         if [ $? -ne $OCF_SUCCESS ]; then x_server_start; fi
-         ;;
-    ORA) listener_status
-         if [ $? -ne $OCF_SUCCESS ]; then listener_start; fi
-         ;;
-  esac
-
-  if [ $strict -eq 0 ]
-  then
-    sapdatabase_status
-    rc=$?
-  else
-    if [ $DBJ2EE_ONLY -eq 0 ]
-    then
-      output=`echo "$SAPDBCONNECT -d -w /dev/null" | su $sidadm 2>&1`
-      if [ $? -le 4 ]
-      then
-        rc=$OCF_SUCCESS
-      else
-        rc=$OCF_NOT_RUNNING
-      fi
-    else
-      MYCP=""
-      EXECMD=""
-
-      # WebAS Java 6.40+7.00
-      IAIK_JCE="$SECSTORE"/iaik_jce.jar
-      IAIK_JCE_EXPORT="$SECSTORE"/iaik_jce_export.jar
-      EXCEPTION="$BOOTSTRAP"/exception.jar
-      LOGGING="$BOOTSTRAP"/logging.jar
-      OPENSQLSTA="$BOOTSTRAP"/opensqlsta.jar
-      TC_SEC_SECSTOREFS="$BOOTSTRAP"/tc_sec_secstorefs.jar
-      JDDI="$BOOTSTRAP"/../server0/bin/ext/jdbdictionary/jddi.jar
-      ANTLR="$BOOTSTRAP"/../server0/bin/ext/antlr/antlr.jar
-      FRAME="$BOOTSTRAP"/../server0/bin/system/frame.jar
-  
-      # only start jdbcconnect when all jars available
-      if [ -f "$EXCEPTION" -a -f "$LOGGING" -a -f "$OPENSQLSTA" -a -f "$TC_SEC_SECSTOREFS" -a -f "$JDDI" -a -f "$ANTLR" -a -f "$FRAME" -a -f "$SAPDBCONNECT" ]
-      then
-        MYCP=".:$FRAME:$ANTLR:$JDDI:$IAIK_JCE_EXPORT:$IAIK_JCE:$EXCEPTION:$LOGGING:$OPENSQLSTA:$TC_SEC_SECSTOREFS:$DB_JARS:$SAPDBCONNECT" 
-        EXECMD="com.sap.inst.jdbc.connect.JdbcCon -sec $SID:$SID"
-      else
-      # WebAS Java 7.10
-        LAUNCHER=${BOOTSTRAP}/sap.com~tc~bl~offline_launcher~impl.jar
-
-        if [ -f "$DB_JARS" -a -f "$SAPDBCONNECT" -a -f "$LAUNCHER" ]
-        then
-          MYCP="$LAUNCHER"
-          EXECMD="com.sap.engine.offline.OfflineToolStart com.sap.inst.jdbc.connect.JdbcCon ${SAPDBCONNECT}:${SECSTORE}:${DB_JARS}:${BOOTSTRAP} -sec $SID:$SID"
-        fi
-      fi
-
-      if [ -n "$EXECMD" ]
-      then
-        output=`eval ${JAVA_HOME}/bin/java -cp $MYCP $EXECMD`
-        if [ $? -le 0 ]
-        then
-          rc=$OCF_SUCCESS
-        else
-          rc=$OCF_NOT_RUNNING
-        fi
-      else
-        output="Cannot find all jar files needed for database monitoring."
-        rc=$OCF_ERR_GENERIC
-      fi
-    fi
-  fi
-
-  if [ $rc -ne $OCF_SUCCESS ]
-  then
-    ocf_log err "The SAP database $SID ist not running: $output"
-  fi
-  return $rc
-}
-
-
-#
-# sapdatabase_status: Are there any database processes on this host ?
-#
-sapdatabase_status() {
-  case $DBTYPE in
-    ADA) SEARCH="$SID/db/pgm/kernel"
-         SUSER=`grep "^SdbOwner" /etc/opt/sdb | awk -F'=' '{print $2}'`
-         SNUM=2
-         ;;
-    ORA) SEARCH="ora_[a-z][a-z][a-z][a-z]_"
-         SUSER="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
-         SNUM=4
-         ;;
-    DB6) SEARCH="db2[a-z][a-z][a-z][a-z][a-z]"
-         SUSER="db2`echo $SID | tr '[:upper:]' '[:lower:]'`"
-         SNUM=5
-         ;;
-  esac
-
-  # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
-  # as the output might be to long.
-  cnt=`ps efo args --user $SUSER 2> /dev/null | grep -c "$SEARCH"`
-  if [ $cnt -ge $SNUM ]
-  then
-    rc=$OCF_SUCCESS
-  else
-    # ocf_log info "Database Instance $SID is not running on `hostname`"
-    rc=$OCF_NOT_RUNNING
-  fi
-  return $rc
-}
-
-
-#
-# sapdatabase_recover:
-#
-sapdatabase_recover() {
-
-  case $DBTYPE in
-    ORA) recoutput=`oracle_recover`
-         ;;
-    ADA) recoutput=`maxdb_recover`
-         ;;
-    DB6) recoutput=`db6udb_recover`
-         ;;
-  esac
-
-  sapdatabase_monitor 1
-  retcode=$?
-
-  if [ $retcode -eq $OCF_SUCCESS ]
-  then
-    ocf_log info "Recover of SAP database $SID was successful: $recoutput"
-  else
-    ocf_log err "Recover of SAP database $SID failed: $recoutput"
-  fi
-
-  return $retcode
-}
-
-
-#
-# sapdatabase_validate: Check the symantic of the input parameters 
-#
-sapdatabase_validate() {
-  rc=$OCF_SUCCESS
-  if [ `echo "$SID" | grep -c '^[A-Z][A-Z0-9][A-Z0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing parameter SID: '$SID' is not a valid system ID!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  case "$DBTYPE" in
-   ORA|ADA|DB6) ;;
-   *) ocf_log err "Parsing parameter DBTYPE: '$DBTYPE' is not a supported database type!"
-      rc=$OCF_ERR_ARGS ;;
-  esac
-
-  return $rc
-}
-
-
-#
-#	'main' starts here...
-#
-
-if
-  ( [ $# -ne 1 ] )
-then
-  usage
-  exit $OCF_ERR_ARGS
-fi
-
-# These operations don't require OCF instance parameters to be set
-case "$1" in
-  meta-data)	meta_data
-		exit $OCF_SUCCESS;;
-
-  usage) 	usage
-		exit $OCF_SUCCESS;;
-
-  methods)	sapdatabase_methods
-		exit $?;;
-
-  *);;
-esac
-
-# Set a tempfile and make sure to clean it up again
-TEMPFILE="$(mktemp /tmp/SAPDatabase.tmp.XXXXXX)"
-trap trap_handler INT TERM
-
-# Everything after here must call do_exit to remove temp file
-
-
-US=`id -u -n`
-US=`echo $US`
-if
-  [ $US != root  ]
-then
-  ocf_log err "$0 must be run as root"
-  do_exit $OCF_ERR_PERM
-fi
-
-# mandatory parameter check
-if  [ -z "$OCF_RESKEY_SID" ]; then
-  ocf_log err "Please set OCF_RESKEY_SID to the SAP system id!"
-  do_exit $OCF_ERR_ARGS
-fi
-SID=`echo "$OCF_RESKEY_SID"`
-
-if [ -z "$OCF_RESKEY_DBTYPE" ]; then
-  ocf_log err "Please set OCF_RESKEY_DBTYPE to the database vendor specific tag (ORA,ADA,DB6)!"
-  do_exit $OCF_ERR_ARGS
-fi
-DBTYPE=`echo "$OCF_RESKEY_DBTYPE" | tr '[a-z]' '[A-Z]'`
-
-# optional OCF parameters, we try to guess which directories are correct
-EXESTARTDB="startdb"
-EXESTOPDB="stopdb"
-EXEDBCONNECT="R3trans"
-if [ -z "$OCF_RESKEY_DBJ2EE_ONLY" ]; then
-  DBJ2EE_ONLY=0
-else
-  case "$OCF_RESKEY_DBJ2EE_ONLY" in
-   1|true|TRUE|yes|YES) DBJ2EE_ONLY=1
-                        EXESTARTDB="startj2eedb"
-                        EXESTOPDB="stopj2eedb"
-                        EXEDBCONNECT="jdbcconnect.jar"
-                        ;;
-   0|false|FALSE|no|NO) DBJ2EE_ONLY=0;;
-   *) ocf_log err "Parsing parameter DBJ2EE_ONLY: '$DBJ2EE_ONLY' is not a boolean value!"
-      do_exit $OCF_ERR_ARGS ;;
-  esac
-fi
-
-if [ -z "$OCF_RESKEY_NETSERVICENAME" ]; then
-  case "$DBTYPE" in
-    ORA|ora) NETSERVICENAME="LISTENER";;
-    *)       NETSERVICENAME="";;
-  esac
-else
-  NETSERVICENAME="$OCF_RESKEY_NETSERVICENAME"
-fi
-
-if [ -z "$OCF_RESKEY_STRICT_MONITORING" ]; then
-  OCF_RESKEY_STRICT_MONITORING=0
-else
-  case "$OCF_RESKEY_STRICT_MONITORING" in
-   1|true|TRUE|yes|YES) OCF_RESKEY_STRICT_MONITORING=1;;
-   0|false|FALSE|no|NO) OCF_RESKEY_STRICT_MONITORING=0;;
-   *)  ocf_log err "Parsing parameter STRICT_MONITORING: '$OCF_RESKEY_STRICT_MONITORING' is not a boolean value!"
-       do_exit $OCF_ERR_ARGS ;;
-  esac
-fi
-
-PATHLIST="
-$OCF_RESKEY_DIR_EXECUTABLE
-/usr/sap/$SID/*/exe
-/usr/sap/$SID/SYS/exe/run
-/sapmnt/$SID/exe
-"
-DIR_EXECUTABLE=""
-for EXEPATH in $PATHLIST
-do
-  if [ -x $EXEPATH/$EXESTARTDB -a -x $EXEPATH/$EXESTOPDB -a -x $EXEPATH/$EXEDBCONNECT ]
-  then
-    DIR_EXECUTABLE=$EXEPATH
-    SAPSTARTDB=$EXEPATH/$EXESTARTDB
-    SAPSTOPDB=$EXEPATH/$EXESTOPDB
-    SAPDBCONNECT=$EXEPATH/$EXEDBCONNECT
-    break
-  fi
-done
-if [ -z "$DIR_EXECUTABLE" ]
-then
-  ocf_log warn "Cannot find $EXESTARTDB,$EXESTOPDB and $EXEDBCONNECT executable, please set DIR_EXECUTABLE parameter!"
-  do_exit $OCF_NOT_RUNNING
-fi
-
-if [ $DBJ2EE_ONLY -eq 1 ]
-then
-  if [ -n "$OCF_RESKEY_DIR_BOOTSTRAP" ]
-  then
-    BOOTSTRAP="$OCF_RESKEY_DIR_BOOTSTRAP"
-  else
-    BOOTSTRAP=`echo /usr/sap/$SID/*/j2ee/cluster/bootstrap | head -1`
-  fi
-
-  if [ -n "$OCF_RESKEY_DIR_SECSTORE" ]
-  then
-    SECSTORE="$OCF_RESKEY_DIR_SECSTORE"
-  else
-    SECSTORE=/usr/sap/$SID/SYS/global/security/lib/tools
-  fi
-
-  if [ -n "$OCF_RESKEY_JAVA_HOME" ]
-  then
-    JAVA_HOME="$OCF_RESKEY_JAVA_HOME"
-    PATH=$JAVA_HOME/bin:$PATH
-  else
-    if [ -n "$JAVA_HOME" ]
-    then
-      PATH=$JAVA_HOME/bin:$PATH
-    else
-      ocf_log err "Cannot find JAVA_HOME directory, please set JAVA_HOME parameter!"
-      do_exit $OCF_NOT_RUNNING
-    fi
-  fi
-
-  if [ -n "$OCF_RESKEY_DB_JARS" ]
-  then
-    DB_JARS=$OCF_RESKEY_DB_JARS
-  else
-    if [ -f "$BOOTSTRAP"/bootstrap.properties ]; then
-      DB_JARS=`cat $BOOTSTRAP/bootstrap.properties | grep -i rdbms.driverLocation | sed -e 's/\\\:/:/g' | awk -F= '{print $2}'`
-    fi
-  fi
-fi
-
-if [ -z "$OCF_RESKEY_AUTOMATIC_RECOVER" ]
-then
-  OCF_RESKEY_AUTOMATIC_RECOVER=0
-else
-  case "$OCF_RESKEY_AUTOMATIC_RECOVER" in
-   1|true|TRUE|yes|YES) OCF_RESKEY_AUTOMATIC_RECOVER=1;;
-   0|false|FALSE|no|NO) OCF_RESKEY_AUTOMATIC_RECOVER=0;;
-  esac
-fi
-
-# as root user we need the library path to the SAP kernel to be able to call executables
-if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
-  LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
-fi
-sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
-
-# What kind of method was invoked?
-case "$1" in
-
-  start)	sapdatabase_start
-		do_exit $?;;
-
-  stop)		sapdatabase_stop
-		do_exit $?;;
-
-  monitor)
-          	sapdatabase_monitor $OCF_RESKEY_STRICT_MONITORING
-		do_exit $?;;
-
-  status)
-                sapdatabase_status
-                do_exit $?;;
-
-  recover)      sapdatabase_recover
-                do_exit $?;;
-
-  validate-all)	sapdatabase_validate
-		do_exit $?;;
-
-  *)		sapdatabase_methods
-		do_exit $OCF_ERR_UNIMPLEMENTED;;
-esac
diff --git a/rgmanager/src/resources/SAPInstance b/rgmanager/src/resources/SAPInstance
deleted file mode 100644
index e70e2a3..0000000
--- a/rgmanager/src/resources/SAPInstance
+++ /dev/null
@@ -1,591 +0,0 @@
-#!/bin/sh
-#
-# SAPInstance
-#
-# Description:	Manages a single SAP Instance as a High-Availability
-#		resource. One SAP Instance is defined by one 
-#               SAP Instance-Profile. start/stop handels all services
-#               of the START-Profile, status and monitor care only
-#               about essential services.
-#
-# Author:       Alexander Krauth, June 2006
-# Support:      linux at sap.com
-# License:      GNU General Public License (GPL)
-# Copyright:    (c) 2006, 2007 Alexander Krauth
-#
-# An example usage: 
-#      See usage() function below for more details...
-#
-# OCF instance parameters:
-#	OCF_RESKEY_InstanceName
-#	OCF_RESKEY_DIR_EXECUTABLE   (optional, well known directories will be searched by default)
-#	OCF_RESKEY_DIR_PROFILE      (optional, well known directories will be searched by default)
-#	OCF_RESKEY_START_PROFILE    (optional, well known directories will be searched by default)
-#	OCF_RESKEY_START_WAITTIME   (optional, to solve timing problems during J2EE-Addin start)
-#	OCF_RESKEY_AUTOMATIC_RECOVER    (optional, automatic startup recovery using cleanipc, default is false)
-#	OCF_RESKEY_PRE_START_USEREXIT	(optional, lists a script which can be executed before the resource is started)
-#	OCF_RESKEY_POST_START_USEREXIT	(optional, lists a script which can be executed after the resource is started)
-#	OCF_RESKEY_PRE_STOP_USEREXIT	(optional, lists a script which can be executed before the resource is stopped)
-#	OCF_RESKEY_POST_STOP_USEREXIT	(optional, lists a script which can be executed after the resource is stopped)
-#
-#######################################################################
-# Initialization:
-
-if [ -f $(dirname $0)/.ocf-shellfuncs ]; then
-        . $(dirname $0)/.ocf-shellfuncs
-elif [ -f $(dirname $0)/ocf-shellfuncs ]; then
-        LC_ALL=C
-        LANG=C
-        PATH=/bin:/sbin:/usr/bin:/usr/sbin
-        export LC_ALL LANG PATH
-        . $(dirname $0)/ocf-shellfuncs
-else
-        echo Could not find ocf-shellfuncs!
-        exit 1
-fi
-
-
-#######################################################################
-
-SH=/bin/sh
-
-usage() {
-  methods=`sapinstance_methods`
-  methods=`echo $methods | tr ' ' '|'`
-  cat <<-!
-	usage: $0 ($methods)
-
-	$0 manages a SAP Instance as an HA resource.
-
-	The 'start' operation starts the instance.
-	The 'stop' operation stops the instance.
-	The 'status' operation reports whether the instance is running
-	The 'monitor' operation reports whether the instance seems to be working
-	The 'validate-all' operation reports whether the parameters are valid
-	The 'methods' operation reports on the methods $0 supports
-
-	!
-}
-
-meta_data() {
-	cat <<END
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="SAPInstance">
-<version>1.92.1</version>
-
-<longdesc lang="en">
-Resource script for SAP. It manages a SAP Instance as an HA resource.
-</longdesc>
-<shortdesc lang="en">SAP instance resource agent</shortdesc>
-
-<parameters>
- <parameter name="InstanceName" unique="1" required="1" primary="1">
-  <longdesc lang="en">The full qualified SAP instance name. e.g. P01_DVEBMGS00_sapp01ci</longdesc>
-  <shortdesc lang="en">instance name: SID_INSTANCE_VIR-HOSTNAME</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_EXECUTABLE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find sapstartsrv and sapcontrol.</longdesc>
-  <shortdesc lang="en">path of sapstartsrv and sapcontrol</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_PROFILE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find the SAP START profile.</longdesc>
-  <shortdesc lang="en">path of start profile</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="START_PROFILE" unique="0" required="0">
-  <longdesc lang="en">The name of the SAP START profile.</longdesc>
-  <shortdesc lang="en">start profile name</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="START_WAITTIME" unique="0" required="0">
-  <longdesc lang="en">After that time in seconds a monitor operation is executed by the resource agent. Does the monitor return SUCCESS, the start is handled as SUCCESS. This is useful to resolve timing problems with e.g. the J2EE-Addin instance.</longdesc>
-  <shortdesc lang="en">Check the successful start after that time (do not wait for J2EE-Addin)</shortdesc>
-  <content type="string" default="3600" />
- </parameter>
- <parameter name="AUTOMATIC_RECOVER" unique="0" required="0">
-  <longdesc lang="en">The SAPInstance resource agent tries to recover a failed start attempt automaticaly one time. This is done by killing runing instance processes and executing cleanipc.</longdesc>
-  <shortdesc lang="en">Enable or disable automatic startup recovery</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="PRE_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets started.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got started.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="PRE_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets stopped.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got stopped.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
-</parameters>
-
-<actions>
-<action name="start" timeout="180" />
-<action name="stop" timeout="240" />
-<action name="status" timeout="60" depth="0" interval="120" start-delay="240" />
-<action name="monitor" depth="0" timeout="60" interval="120" start-delay="240" />
-<action name="validate-all" timeout="5" />
-<action name="meta-data" timeout="5" />
-<action name="methods" timeout="5" />
-</actions>
-</resource-agent>
-END
-}
-
-
-#
-# methods: What methods/operations do we support?
-#
-sapinstance_methods() {
-  cat <<-!
-	start
-	stop
-	status
-	monitor
-	validate-all
-	methods
-	meta-data
-	usage
-	!
-}
-
-
-#
-# check_sapstartsrv : Before using sapcontrol we make sure that the sapstartsrv is running for the correct instance.
-#                     We cannot use sapinit and the /usr/sap/sapservices file in case of an enquerep instance,
-#                     because then we have two instances with the same instance number.
-#
-check_sapstartsrv() {
-  restart=0
-  runninginst=""
-  chkrc=$OCF_SUCCESS
-
-  output=`$SAPCONTROL -nr $InstanceNr -function ParameterValue INSTANCE_NAME -format script`
-  if [ $? -eq 0 ]
-  then
-    runninginst=`echo "$output" | grep '^0 : ' | cut -d' ' -f3`
-    if [ "$runninginst" != "$InstanceName" ]
-    then 
-      ocf_log warn "sapstartsrv is running for instance $runninginst, that service will be killed"
-      restart=1
-    fi
-  else
-    ocf_log warn "sapstartsrv is not running for instance $SID-$InstanceName, it will be started now"
-    restart=1
-  fi
-
-  if [ -z "$runninginst" ]; then runninginst=$InstanceName; fi
-
-  if [ $restart -eq 1 ]
-  then
-    pkill -9 -f "sapstartsrv.*$runninginst"
-    $SAPSTARTSRV pf=$SAPSTARTPROFILE -D -u $sidadm
-
-    # now make sure the daemon has been started and is able to respond
-    srvrc=1
-    while [ $srvrc -eq 1 -a `pgrep -f "sapstartsrv.*$runninginst" | wc -l` -gt 0 ]
-    do
-      sleep 1
-      $SAPCONTROL -nr $InstanceNr -function GetProcessList > /dev/null 2>&1
-      srvrc=$?
-    done
-
-    if [ $srvrc -ne 1 ]
-    then
-      ocf_log info "sapstartsrv for instance $SID-$InstanceName was restarted !"
-      chkrc=$OCF_SUCCESS
-    else
-      ocf_log error "sapstartsrv for instance $SID-$InstanceName could not be started!"
-      chkrc=$OCF_NOT_RUNNING
-    fi
-  fi
-
-  return $chkrc
-}
-
-
-#
-# sapuserexit : Many SAP customers need some additional processes/tools to run their SAP systems.
-#               This specialties do not allow a totally generic SAP cluster resource agent.
-#               Someone should write a resource agent for each additional process you need, if it
-#               is required to monitor that process within the cluster manager. To enable 
-#               you to extent this resource agent without developing a new one, this user exit
-#               was introduced.
-#
-sapuserexit() {
-  NAME="$1"
-  VALUE="$2"
-
-  if [ -n "$VALUE" ]
-  then
-    if [ -x "$VALUE" ]
-    then
-      ocf_log info "Calling userexit ${NAME} with customer script file ${VALUE}"
-      eval "$VALUE" >& /dev/null
-      ocf_log info "Exiting userexit ${NAME} with customer script file ${VALUE}, returncode: $?"
-    else
-      ocf_log warn "Attribute ${NAME} is set to ${VALUE}, but this file is not executable"
-    fi
-  fi
-  return 0
-}
-
-
-#
-# cleanup_instance : remove resources (processes and shared memory) from a crashed instance)
-#
-cleanup_instance() {
-  pkill -9 -f -U $sidadm $InstanceName
-  $DIR_EXECUTABLE/cleanipc $InstanceNr remove
-  return 0
-}
-
-#
-# sapinstance_start : Start the SAP instance
-#
-sapinstance_start() {
-
-  sapuserexit PRE_START_USEREXIT "$OCF_RESKEY_PRE_START_USEREXIT"
-
-  rc=$OCF_NOT_RUNNING
-  loopcount=0
-  while [ $loopcount -lt 2 ]
-  do
-    loopcount=$(($loopcount + 1))
-
-    check_sapstartsrv
-    output=`$SAPCONTROL -nr $InstanceNr -function Start`
-    rc=$?
-    ocf_log info "Starting SAP Instance $SID-$InstanceName: $output"
-
-    if [ $rc -ne 0 ]
-    then
-      ocf_log err "SAP Instance $SID-$InstanceName start failed."
-      return $OCF_ERR_GENERIC
-    fi
-
-    startrc=1
-    while [ $startrc -gt 0 ]
-    do
-      waittime_start=`date +%s`
-      output=`$SAPCONTROL -nr $InstanceNr -function WaitforStarted $OCF_RESKEY_START_WAITTIME 10`
-      startrc=$?
-      waittime_stop=`date +%s`
-
-      if [ $startrc -ne 0 ]
-      then
-        if [ $(($waittime_stop - $waittime_start)) -ge $OCF_RESKEY_START_WAITTIME ]
-        then
-          sapinstance_monitor NOLOG
-          if [ $? -eq $OCF_SUCCESS ]
-          then
-            output="START_WAITTIME ($OCF_RESKEY_START_WAITTIME) has elapsed, but instance monitor returned SUCCESS. Instance considered running."
-            startrc=0; loopcount=2
-          fi
-        else
-          if [ $loopcount -eq 1 -a $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
-          then
-            ocf_log warn "SAP Instance $SID-$InstanceName start failed: $output"
-            ocf_log warn "Try to recover $SID-$InstanceName"
-            cleanup_instance
-          else
-            loopcount=2
-          fi
-          startrc=-1
-        fi
-      else
-        loopcount=2
-      fi
-    done
-  done
-
-  if [ $startrc -eq 0 ]
-  then
-    ocf_log info "SAP Instance $SID-$InstanceName started: $output"
-    rc=$OCF_SUCCESS
-    sapuserexit POST_START_USEREXIT "$OCF_RESKEY_POST_START_USEREXIT"
-  else
-    ocf_log err "SAP Instance $SID-$InstanceName start failed: $output"
-    rc=$OCF_NOT_RUNNING
-  fi
-
-  return $rc
-}
-
-
-#
-# sapinstance_recover: Try startup of failed instance by cleaning up resources
-#
-sapinstance_recover() {
-  cleanup_instance
-  sapinstance_start
-  return $?
-}
-
-
-#
-# sapinstance_stop: Stop the SAP instance
-#
-sapinstance_stop() {
-  sapuserexit PRE_STOP_USEREXIT "$OCF_RESKEY_PRE_STOP_USEREXIT"
-
-  check_sapstartsrv
-
-  output=`$SAPCONTROL -nr $InstanceNr -function Stop`
-  if [ $? -eq 0 ]
-  then
-    output=`$SAPCONTROL -nr $InstanceNr -function WaitforStopped 3600 1`
-    if [ $? -eq 0 ]
-    then
-      ocf_log info "SAP Instance $SID-$InstanceName stopped: $output"
-      rc=$OCF_SUCCESS
-    else
-      ocf_log err "SAP Instance $SID-$InstanceName stop failed: $output"
-      rc=$OCF_ERR_GENERIC
-    fi
-  else
-    ocf_log err "SAP Instance $SID-$InstanceName stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-
-  sapuserexit POST_STOP_USEREXIT "$OCF_RESKEY_POST_STOP_USEREXIT"
-
-  return $rc
-}
-
-
-#
-# sapinstance_monitor: Can the given SAP instance do anything useful?
-#
-sapinstance_monitor() {
-  MONLOG=$1
-  check_sapstartsrv
-  rc=$?
-
-  if [ $rc -eq $OCF_SUCCESS ]
-  then
-    count=0
-    LOCALHOST=`hostname`
-    output=`$SAPCONTROL -nr $InstanceNr -host $LOCALHOST -function GetProcessList -format script`
-
-    # we have to parse the output, because the returncode doesn't tell anything about the instance status
-    for SERVNO in `echo "$output" | grep '^[0-9] ' | cut -d' ' -f1 | sort -u`
-    do
-      COLOR=`echo "$output" | grep "^$SERVNO dispstatus: " | cut -d' ' -f3`
-      SERVICE=`echo "$output" | grep "^$SERVNO name: " | cut -d' ' -f3`
-      STATE=0
-
-      case $COLOR in
-        GREEN|YELLOW)       STATE=$OCF_SUCCESS;;
-        *)                  STATE=$OCF_NOT_RUNNING;;
-      esac 
-
-      case $SERVICE in
-        disp+work|msg_server|enserver|enrepserver|jcontrol|jstart)
-                      if [ $STATE -eq $OCF_NOT_RUNNING ]
-                      then
-                        if [ "$MONLOG" != "NOLOG" ]
-                        then
-                          ocf_log err "SAP instance service $SERVICE is not running with status $COLOR !"
-                        fi
-                        rc=$STATE
-                      fi
-                      count=1;;
-        *);;
-      esac
-    done
-
-    if [ $count -eq 0 -a $rc -eq $OCF_SUCCESS ]
-    then
-      if [ "$MONLOG" != "NOLOG" ]
-      then
-        ocf_log err "The SAP instance does not run any services which this RA could monitor!"
-      fi
-      rc=$OCF_ERR_ARGS
-    fi
-  fi
-  
-  return $rc
-}
-
-#
-# sapinstance_validate: Check the symantic of the input parameters 
-#
-sapinstance_validate() {
-  rc=$OCF_SUCCESS
-  if [ `echo "$SID" | grep -c '^[A-Z][A-Z0-9][A-Z0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$SID' is not a valid system ID!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  if [ `echo "$InstanceName" | grep -c '^[A-Z].*[0-9][0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$InstanceName' is not a valid instance name!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  if [ `echo "$InstanceNr" | grep -c '^[0-9][0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$InstanceNr' is not a valid instance number!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  if [ `echo "$SAPVIRHOST" | grep -c '^[A-Za-z][A-Za-z0-9_-]*$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$SAPVIRHOST' is not a valid hostname!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  return $rc
-}
-
-
-#
-#	'main' starts here...
-#
-
-if
-  ( [ $# -ne 1 ] )
-then
-  usage
-  exit $OCF_ERR_ARGS
-fi
-
-# These operations don't require OCF instance parameters to be set
-case "$1" in
-  meta-data)	meta_data
-		exit $OCF_SUCCESS;;
-
-  usage) 	usage
-		exit $OCF_SUCCESS;;
-
-  methods)	sapinstance_methods
-		exit $?;;
-
-  *);;
-esac
-
-US=`id -u -n`
-US=`echo $US`
-if
-  [ $US != root  ]
-then
-  ocf_log err "$0 must be run as root"
-  exit $OCF_ERR_PERM
-fi
-
-# parameter check
-if  [ -z "$OCF_RESKEY_InstanceName" ]
-then
-  ocf_log err "Please set OCF_RESKEY_InstanceName to the name to the SAP instance profile!"
-  exit $OCF_ERR_ARGS
-fi
-
-SID=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f1`
-InstanceName=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f2`
-InstanceNr=`echo "$InstanceName" | sed 's/.*\([0-9][0-9]\)$/\1/'`
-SAPVIRHOST=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f3`
-
-# optional OCF parameters, we try to guess which directories are correct
-if  [ -z "$OCF_RESKEY_DIR_EXECUTABLE" ]
-then
-  if [ -x /usr/sap/$SID/$InstanceName/exe/sapstartsrv -a -x /usr/sap/$SID/$InstanceName/exe/sapcontrol ]
-  then
-    DIR_EXECUTABLE="/usr/sap/$SID/$InstanceName/exe"
-    SAPSTARTSRV="/usr/sap/$SID/$InstanceName/exe/sapstartsrv"
-    SAPCONTROL="/usr/sap/$SID/$InstanceName/exe/sapcontrol"
-  elif [ -x /usr/sap/$SID/SYS/exe/run/sapstartsrv -a -x /usr/sap/$SID/SYS/exe/run/sapcontrol ]
-  then
-    DIR_EXECUTABLE="/usr/sap/$SID/SYS/exe/run"
-    SAPSTARTSRV="/usr/sap/$SID/SYS/exe/run/sapstartsrv"
-    SAPCONTROL="/usr/sap/$SID/SYS/exe/run/sapcontrol"
-  else
-    ocf_log warn "Cannot find sapstartsrv and sapcontrol executable, please set DIR_EXECUTABLE parameter!"
-    exit $OCF_NOT_RUNNING
-  fi
-else
-  DIR_EXECUTABLE="$OCF_RESKEY_DIR_EXECUTABLE"
-  SAPSTARTSRV="$OCF_RESKEY_DIR_EXECUTABLE/sapstartsrv"
-  SAPCONTROL="$OCF_RESKEY_DIR_EXECUTABLE/sapcontrol"
-fi
-
-if [ -z "$OCF_RESKEY_DIR_PROFILE" ]
-then
-  if [ -d /usr/sap/$SID/SYS/profile/ ]
-  then
-    DIR_PROFILE="/usr/sap/$SID/SYS/profile"
-  else
-    ocf_log warn "Expected /usr/sap/$SID/SYS/profile/ to be a directory, please set DIR_PROFILE parameter!"
-    exit $OCF_NOT_RUNNING
-  fi
-else
-  DIR_PROFILE="$OCF_RESKEY_DIR_PROFILE"
-fi
-
-if [ -z "$OCF_RESKEY_START_PROFILE" ]
-then
-  SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
-  if [ ! -r $SAPSTARTPROFILE ]
-  then
-    ocf_log warn "Expected $SAPSTARTPROFILE to be the instance START profile, please set START_PROFILE parameter!"
-    exit $OCF_NOT_RUNNING
-  fi
-else
-  SAPSTARTPROFILE="$OCF_RESKEY_START_PROFILE"
-fi
-
-if [ -z "$OCF_RESKEY_START_WAITTIME" ]
-then
-  OCF_RESKEY_START_WAITTIME=3600
-fi
-
-
-if [ -z "$OCF_RESKEY_AUTOMATIC_RECOVER" ]
-then
-  OCF_RESKEY_AUTOMATIC_RECOVER=0
-else
-  case "$OCF_RESKEY_AUTOMATIC_RECOVER" in
-   1|true|TRUE|yes|YES) OCF_RESKEY_AUTOMATIC_RECOVER=1;;
-   0|false|FALSE|no|NO) OCF_RESKEY_AUTOMATIC_RECOVER=0;;
-  esac
-fi
-
-# as root user we need the library path to the SAP kernel to be able to call sapcontrol
-if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
-  LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
-fi
-sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
-
-# What kind of method was invoked?
-case "$1" in
-
-  start)	sapinstance_start
-		exit $?;;
-
-  stop)		sapinstance_stop
-		exit $?;;
-
-  status|monitor)
-          	sapinstance_monitor
-		exit $?;;
-
-  validate-all)	sapinstance_validate
-		exit $?;;
-
-  *)		sapinstance_methods
-		exit $OCF_ERR_UNIMPLEMENTED;;
-esac
diff --git a/rgmanager/src/resources/apache.metadata b/rgmanager/src/resources/apache.metadata
deleted file mode 100644
index 727d138..0000000
--- a/rgmanager/src/resources/apache.metadata
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="apache">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Apache web server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an Apache web server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Define a name for use in &lt;IfDefine name&gt; directive.
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="server_root">
-            <longdesc lang="en">
-                Define an alternate initial ServerRoot
-            </longdesc>
-            <shortdesc lang="en">
-                Initial ServerRoot
-            </shortdesc>
-	    <content type="string" default="/etc/httpd"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define an alternate ServerConfigFile
-            </longdesc>
-            <shortdesc lang="en">
-                Initial ServerConfigFile
-            </shortdesc>
-            <content type="string" default="conf/httpd.conf"/>
-        </parameter>
-
-	<parameter name="httpd_options">
-	    <longdesc lang="en">
-		Other command-line options for httpd
-	    </longdesc>
-	    <shortdesc lang="en">
-		Other command-line options for httpd
-	    </shortdesc>
-	    <content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-	    <longdesc lang="en">
-		Wait X seconds for correct end of service shutdown
-	    </longdesc>
-	    <shortdesc lang="en">
-		Wait X seconds for correct end of service shutdown
-	    </shortdesc>
-	    <content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="1"/>
-	<action name="validate-all" timeout="1"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/apache.sh b/rgmanager/src/resources/apache.sh
deleted file mode 100644
index ca0325f..0000000
--- a/rgmanager/src/resources/apache.sh
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-if [ -x /usr/sbin/httpd ]; then
-	declare APACHE_HTTPD=/usr/sbin/httpd
-elif [ -x /usr/sbin/apache2 ]; then
-	declare APACHE_HTTPD=/usr/sbin/apache2
-fi
-declare APACHE_serverConfigFile
-declare APACHE_pid_file="`generate_name_for_pid_file`"
-declare APACHE_conf_dir="`generate_name_for_conf_dir`"
-declare APACHE_genConfig="$APACHE_conf_dir/httpd.conf"
-
-declare APACHE_parseConfig=$(dirname $0)/utils/httpd-parse-config.pl
-
-apache_serverConfigFile()
-{
-	if $(echo $OCF_RESKEY_config_file | grep -q "^/"); then
-		APACHE_serverConfigFile="$OCF_RESKEY_config_file"
-	else 
-		APACHE_serverConfigFile="$OCF_RESKEY_server_root/$OCF_RESKEY_config_file"
-	fi
-
-	return;
-}
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT 
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-                                                	
-	if [ -z "$OCF_RESKEY_server_root" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid ServerRoot"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -d "$OCF_RESKEY_server_root" ]; then
-		clog_service_verify $CLOG_FAILED "ServerRoot Directory Is Missing"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$APACHE_serverConfigFile" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE "$APACHE_serverConfigFile"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$APACHE_pid_file" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid name of PID file"
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_check_syntax $CLOG_INIT "$APACHE_serverConfigFile"
-
-	"$APACHE_HTTPD" -t \
-		-D"$OCF_RESKEY_name" \
-		-d "$OCF_RESKEY_server_root" \
-		-f "$APACHE_serverConfigFile" \
-		$OCF_RESKEY_httpd_options &> /dev/null
-		
-	if [ $? -ne 0 ]; then
-		clog_check_syntax $CLOG_FAILED "$APACHE_serverConfigFile"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_check_syntax $CLOG_SUCCEED "$APACHE_serverConfigFile"
-
-	return 0
-}
-
-generate_configFile()
-{
-	declare originalConfigFile=$1;
-	declare generatedConfigFile=$2;
-	declare ip_addresses=$3;
-
-	if [ -f "$generatedConfigFile" ]; then
-		sha1_verify "$generatedConfigFile"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$originalConfigFile" "$generatedConfigFile"
-
-	generate_configTemplate "$generatedConfigFile" "$1"
-	cat >> "$generatedConfigFile" << EOT
-# From a cluster perspective, the key fields are:
-#     Listen - must be set to service floating IP address.
-#     ServerRoot - path to the ServerRoot (initial value is set in service conf)
-#
-
-EOT
-
-	IFS_old="$IFS"
-	IFS=$'\n'
-	for i in `"$APACHE_parseConfig" -D"$OCF_RESKEY_name" < "$originalConfigFile" | grep -P '(^Listen)|(^Port)' `; do 
-		port=`echo $i | sed 's/^Listen \(.*\)/\1/;s/^Port \(.*\)/\1/'`;
-		testcond=`echo $port|grep :`
-		if [ $testcond ]; then
-			port=`echo $port|awk -F : '{print $2}'`
-		fi
-		IFS=$' ';
-		for z in $ip_addresses; do 
-			echo "Listen $z:$port" >> "$generatedConfigFile";
-		done
-		IFS=$'\n';
-	done;
-	IFS="$IFS_old"
-
-	echo "PidFile \"$APACHE_pid_file\"" >> "$generatedConfigFile";
-	echo >> "$generatedConfigFile"
-
-	cat "$originalConfigFile" | sed 's/^Listen/### Listen/;s/^Port/### Port/;s/^PidFile/### PidFile/' | \
-	"$APACHE_parseConfig" -D"$OCF_RESKEY_name" >> "$generatedConfigFile"
-
-	sha1_addToFile "$generatedConfigFile"
-	clog_generate_config $CLOG_SUCCEED "$originalConfigFile" "$generatedConfigFile"
-}
-
-start()
-{
-	declare ip_addresses
-
-	clog_service_start $CLOG_INIT	
-
-	create_pid_directory
-	create_conf_directory "$APACHE_conf_dir"
-	check_pid_file "$APACHE_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$APACHE_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-	get_service_ip_keys "$OCF_RESKEY_service_name"
-	ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	generate_configFile "$APACHE_serverConfigFile" "$APACHE_genConfig" "$ip_addresses"
-
-	"$APACHE_HTTPD" \
-		"-D$OCF_RESKEY_name" \
-		-d "$OCF_RESKEY_server_root" \
-		-f "$APACHE_genConfig" \
-		$OCF_RESKEY_httpd_options \
-		-k start
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED		
-		return $OCF_ERR_GENERIC
-	else
-		clog_service_start $CLOG_SUCCEED
-	fi
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$APACHE_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$APACHE_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$APACHE_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-if [ "$1" != "meta-data" ]; then
-	apache_serverConfigFile
-fi;
-		
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all|verify-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
deleted file mode 100644
index 06214d5..0000000
--- a/rgmanager/src/resources/clusterfs.sh
+++ /dev/null
@@ -1,275 +0,0 @@
-#!/bin/bash
-
-#
-# Cluster File System mount/umount/fsck/etc. agent
-#
-
-. $(dirname $0)/utils/fs-lib.sh
-
-do_metadata()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="clusterfs" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines a cluster file system mount (i.e. GFS)
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a cluster file system mount.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Symbolic name for this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                File System Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="mountpoint" unique="1" required="1">
-	    <longdesc lang="en">
-	        Path in file system heirarchy to mount this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Mount Point
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="device" unique="1" required="1">
-	    <longdesc lang="en">
-	        Block device, file system label, or UUID of file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Device or Label
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fstype">
-	    <longdesc lang="en">
-	        File system type.  If not specified, mount(8) will attempt to
-		determine the file system type.
-	    </longdesc>
-            <shortdesc lang="en">
-                File system type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="force_unmount">
-            <longdesc lang="en">
-                If set, the cluster will kill all processes using 
-                this file system when the resource group is 
-                stopped.  Otherwise, the unmount will fail, and
-                the resource group will be restarted.
-            </longdesc>
-            <shortdesc lang="en">
-                Force Unmount
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">
-                If set, the file system will be checked (even if
-                it is a journalled file system).  This option is
-                ignored for non-journalled file systems such as
-                ext2.
-            </longdesc>
-            <shortdesc lang="en">
-                Mount Options
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-	<parameter name="self_fence">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		immediately reboot.  Generally, this is used in conjunction
-		with force-unmount support, but it is not required.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Seppuku Unmount
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="fsid">
-	    <longdesc lang="en">
-	    	File system ID for NFS exports.  This can be overridden
-		in individual nfsclient entries.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	NFS File system ID
-	    </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set, the node will try to kill lockd and issue 
-		reclaims across all remaining network interface cards.
-		This happens always, regardless of unmounting failed.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="30"/>
-	<!-- Recovery isn't possible; we don't know if resources are using
-	     the file system. -->
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<!-- Checks to see if we can write to the mountpoint (if !ROFS) -->
-	<action name="status" depth="20" timeout="30" interval="10m"/>
-	<action name="monitor" depth="20" timeout="30" interval="10m"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-    	<child type="fs" start="1" stop="3"/>
-    	<child type="clusterfs" start="1" stop="3"/>
-        <child type="nfsexport" start="3" stop="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_fstype()
-{
-	# Auto detect?
-	[ -z "$OCF_RESKEY_fstype" ] && return $OCF_SUCCESS
-
-	case $OCF_RESKEY_fstype in
-	gfs|gfs2)
-		return $OCF_SUCCESS
-		;;
-	*)
-		ocf_log err "File system type $OCF_RESKEY_fstype not supported"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-}
-
-
-verify_options()
-{
-	declare -i ret=$OCF_SUCCESS
-
-	#
-	# From mount(8)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		async|atime|auto|defaults|dev|exec|_netdev|noatime)
-			continue
-			;;
-		noauto|nodev|noexec|nosuid|nouser|ro|rw|suid|sync)
-			continue
-			;;
-		dirsync|user|users)
-			continue
-			;;
-		esac
-
-		case $OCF_RESKEY_fstype in
-		gfs)
-			case $o in
-				lockproto=*|locktable=*|hostdata=*)
-					continue;
-					;;
-				localcaching|localflocks|ignore_local_fs)
-					continue;
-					;;
-				num_glockd|acl|suiddir)	
-					continue
-					;;
-			esac
-			;;
-		gfs2)
-			# XXX
-			continue
-			;;
-		esac
-
-
-		ocf_log err "Option $o not supported for $OCF_RESKEY_fstype"
-		ret=$OCF_ERR_ARGS
-	done
-
-	return $ret
-}
-
-
-do_verify()
-{
-	verify_name || return $OCF_ERR_ARGS
-	verify_fstype || return $OCF_ERR_ARGS
-	verify_device || return $OCF_ERR_ARGS
-	verify_mountpoint || return $OCF_ERR_ARGS
-	verify_options || return $OCF_ERR_ARGS
-}
-
-
-do_pre_unmount() {
-	#
-	# Check the rgmanager-supplied reference count if one exists.
-	# If the reference count is <= 1, we can safely proceed
-	#
-	if [ -n "$OCF_RESKEY_RGMANAGER_meta_refcnt" ]; then
-		refs=$OCF_RESKEY_RGMANAGER_meta_refcnt
-		if [ $refs -gt 0 ]; then
-			ocf_log debug "Not unmounting $OCF_RESOURCE_INSTANCE - still in use by $refs other service(s)"
-			return 2
-		fi
-	fi
-
-	if [ -z "$force_umount" ]; then
-		ocf_log debug "Not umounting $dev (clustered file system)"
-		return 2
-	fi
-
-	#
-	# Always do this hackery on clustered file systems.
-	#
-	if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-		ocf_log warning "Dropping node-wide NFS locks"
-		mkdir -p $mp/.clumanager/statd
-		pkill -KILL -x lockd
-		# Copy out the notify list; our 
-		# IPs are already torn down
-		if notify_list_store $mp/.clumanager/statd; then
-			notify_list_broadcast $mp/.clumanager/statd
-		fi
-	fi
-
-	# Always invalidate buffers on clusterfs resources
-	clubufflush -f $dev
-
-	return 0
-}
-
-main $*
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index 4eae767..87c8a1c 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -1,3 +1,23 @@
+%
+% Copyright (C) 1997-2003 Sistina Software, Inc.  All rights reserved.
+% Copyright (C) 2004-2011 Red Hat, Inc.  All rights reserved.
+%
+% This program is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License
+% as published by the Free Software Foundation; either version 2
+% of the License, or (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program; if not, write to the Free Software
+% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+%
+
+
 define node_in_set(node_list, node)
 {
 	variable x, len;
diff --git a/rgmanager/src/resources/drbd.metadata b/rgmanager/src/resources/drbd.metadata
deleted file mode 100644
index 30fe122..0000000
--- a/rgmanager/src/resources/drbd.metadata
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" ?>
-<resource-agent version="rgmanager 2.0" name="drbd">
-  <version>1.0</version>
-
-  <longdesc lang="en">
-    This is a DRBD resource. The resource must be configured
-    in the configuration file (/etc/drbd.conf), and the
-    DRBD kernel module must be loaded. 
-  </longdesc>
-
-  <shortdesc lang="en">
-    This is a DRBD resource.
-  </shortdesc>
-
-  <parameters>
-    <parameter name="name" unique="1" primary="1">
-      <longdesc lang="en">
-    Symbolic name for this resource.
-      </longdesc>
-      <shortdesc lang="en">
-    Cluster resource name
-      </shortdesc>
-      <content type="string"/>
-    </parameter>
-    <parameter name="resource" unique="1" required="1">
-      <longdesc lang="en">
-	The DRBD resource name, as specified in /etc/drbd.conf.
-      </longdesc>
-      <shortdesc lang="en">
-	DRBD resource name
-      </shortdesc>
-      <content type="string"/>
-    </parameter>
-  </parameters>
-
-  <actions>
-    <action name="start" timeout="20"/>
-    <action name="stop" timeout="20"/>
-    
-    <!-- Checks to see if the resource is Primary locally -->
-    <action name="status" depth="10" interval="60" timeout="20"/>
-    <action name="monitor" depth="10" interval="60" timeout="20"/>
-    
-    <action name="meta-data" timeout="20"/>
-    <action name="verify-all" timeout="20"/>
-  </actions>
-  
-  <special tag="rgmanager">
-    <attributes maxinstances="1"/>
-  </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/drbd.sh b/rgmanager/src/resources/drbd.sh
deleted file mode 100644
index 4571660..0000000
--- a/rgmanager/src/resources/drbd.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/bash
-#
-#  Copyright LINBIT, 2008
-#
-#  This program is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU General Public License as published by the
-#  Free Software Foundation; either version 2, or (at your option) any
-#  later version.
-#
-#  This program is distributed in the hope that it will be useful, but
-#  WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; see the file COPYING.  If not, write to the
-#  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
-#  MA 02139, USA.
-#
-
-#
-# DRBD resource management using the drbdadm utility.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-drbd_verify_all()
-{
-    # Do we have the drbdadm utility?
-    if ! which drbdadm >/dev/null 2>&1 ; then
-	ocf_log error "drbdadm not installed, not found in PATH ($PATH), or not executable."
-	return $OCF_ERR_INSTALLED
-    fi
-
-    # Is drbd loaded?
-    if ! grep drbd /proc/modules >/dev/null 2>&1; then
-	ocf_log error "drbd not found in /proc/modules. Do you need to modprobe?"
-	return $OCF_ERR_INSTALLED
-    fi
-
-    # Do we have the "resource" parameter?
-    if [ -n "$OCF_RESKEY_resource" ]; then
-
-      # Can drbdadm parse the resource name?
-      if ! drbdadm sh-dev $OCF_RESKEY_resource >/dev/null 2>&1; then
-  	ocf_log error "DRBD resource \"$OCF_RESKEY_resource\" not found." 
-  	return $OCF_ERR_CONFIGURED
-      fi
-
-      # Is the backing device a locally available block device?
-      backing_dev=$(drbdadm sh-ll-dev $OCF_RESKEY_resource)
-      if [ ! -b $backing_dev ]; then
-  	ocf_log error "Backing device for DRBD resource \"$OCF_RESKEY_resource\" ($backing_dev) not found or not a block device."
-  	return $OCF_ERR_INSTALLED
-      fi
-
-    fi
-
-    return 0
-}
-
-drbd_status() {
-    role=$(drbdadm role $OCF_RESKEY_resource)
-    case $role in
-	Primary/*)
-	    return $OCF_RUNNING
-	    ;;
-	Secondary/*)
-	    return $OCF_NOT_RUNNING
-	    ;;
-
-    esac
-    return $OCF_ERR_GENERIC
-}
-
-drbd_promote() {
-    drbdadm primary $OCF_RESKEY_resource || return $?
-}
-
-drbd_demote() {
-    drbdadm secondary $OCF_RESKEY_resource || return $?
-}
-
-
-if [ -z "$OCF_CHECK_LEVEL" ]; then
-	OCF_CHECK_LEVEL=0
-fi
-
-# This one doesn't need to pass the verify check
-case $1 in
-    meta-data)
-	cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'` && exit 0
-	exit $OCF_ERR_GENERIC
-	;;
-esac
-
-# Everything else does
-drbd_verify_all || exit $?
-case $1 in
-    start)
-	if drbd_status; then
-	    ocf_log debug "DRBD resource ${OCF_RESKEY_resource} already configured"
-	    exit 0
-	fi
-	drbd_promote 
-	if [ $? -ne 0 ]; then
-	    exit $OCF_ERR_GENERIC
-	fi
-	
-	exit $?
-	;;
-    stop)
-	if drbd_status; then
-	    drbd_demote
-	    if [ $? -ne 0 ]; then
-		exit $OCF_ERR_GENERIC
-	    fi
-	else
-	    ocf_log debug "DRBD resource ${OCF_RESKEY_resource} is not configured"
-	fi
-	exit 0
-	;;
-    status|monitor)
-	drbd_status
-	exit $?
-	;;
-    restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	exit 0
-	;;
-    verify-all)
-    	exit 0
-    	;;
-    *)
-	echo "usage: $0 {start|stop|status|monitor|restart|meta-data|verify-all}"
-	exit $OCF_ERR_GENERIC
-	;;
-esac
diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
deleted file mode 100644
index b63d53b..0000000
--- a/rgmanager/src/resources/fs.sh.in
+++ /dev/null
@@ -1,443 +0,0 @@
-#!/bin/bash
-
-#
-# File system (normal) mount/umount/fsck/etc. agent
-#
-
-. $(dirname $0)/utils/fs-lib.sh
-
-do_metadata()
-{
-	cat <<EOT
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<resource-agent name="fs" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines a standard file system mount (= not a clustered
-	or otherwise shared file system).
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a file system mount.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Symbolic name for this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                File System Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="mountpoint" unique="1" required="1">
-	    <longdesc lang="en">
-	        Path in file system heirarchy to mount this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Mount Point
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="device" unique="1" required="1">
-	    <longdesc lang="en">
-	        Block device, file system label, or UUID of file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Device or Label
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fstype">
-	    <longdesc lang="en">
-	        File system type.  If not specified, mount(8) will attempt to
-		determine the file system type.
-	    </longdesc>
-            <shortdesc lang="en">
-                File system type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="force_unmount">
-            <longdesc lang="en">
-                If set, the cluster will kill all processes using 
-                this file system when the resource group is 
-                stopped.  Otherwise, the unmount will fail, and
-                the resource group will be restarted.
-            </longdesc>
-            <shortdesc lang="en">
-                Force Unmount
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="quick_status">
-            <longdesc lang="en">
-		Use quick status checks.  When set to 0 (the default), this
-		agent behaves normally.  When set to 1, this agent will not
-		log errors incurred or perform the file system accessibility
-		check (e.g. it will not try to read from/write to the file
-		system).  You should only set this to 1 if you have lots of
-		file systems on your cluster or you are seeing very high load
-		spikes as a direct result of this agent.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Quick/brief status checks.
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-	<parameter name="self_fence">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		immediately reboot.  Generally, this is used in conjunction
-		with force-unmount support, but it is not required.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Seppuku Unmount
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="nfslock" inherit="nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="fsid">
-	    <longdesc lang="en">
-	    	File system ID for NFS exports.  This can be overridden
-		in individual nfsclient entries.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	NFS File system ID
-	    </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-        <parameter name="force_fsck">
-            <longdesc lang="en">
-                If set, the file system will be checked (even if
-                it is a journalled file system).  This option is
-                ignored for non-journalled file systems such as
-                ext2.
-            </longdesc>
-            <shortdesc lang="en">
-                Force fsck support
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">
-	    	Options used when the file system is mounted.  These
-		are often file-system specific.  See mount(8) for supported
-		mount options.
-            </longdesc>
-            <shortdesc lang="en">
-                Mount Options
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="30"/>
-	<!-- Recovery isn't possible; we don't know if resources are using
-	     the file system. -->
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Note: active monitoring is constant and supplants all
-	     check depths -->
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="30"/>
-	<action name="monitor" depth="10" timeout="30" interval="30"/>
-
-	<!-- Checks to see if we can write to the mountpoint (if !ROFS) -->
-	<action name="status" depth="20" timeout="30" interval="1m"/>
-	<action name="monitor" depth="20" timeout="30" interval="1m"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<attributes maxinstances="1"/>
-        <child type="fs" start="1" stop="3"/>
-        <child type="clusterfs" start="1" stop="3"/>
-        <child type="nfsexport" start="3" stop="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_fstype()
-{
-	# Auto detect?
-	[ -z "$OCF_RESKEY_fstype" ] && return 0
-
-	case $OCF_RESKEY_fstype in
-	ext2|ext3|ext4|btrfs|jfs|xfs|reiserfs|vfat|tmpfs|vxfs)
-		return 0
-		;;
-	*)
-		echo "File system type $OCF_RESKEY_fstype not supported"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-}
-
-
-verify_options()
-{
-	declare -i ret=$OCF_SUCCESS
-	declare o
-
-	#
-	# From mount(8)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		async|atime|auto|defaults|dev|exec|_netdev|noatime)
-			continue
-			;;
-		noauto|nodev|noexec|nosuid|nouser|ro|rw|suid|sync)
-			continue
-			;;
-		dirsync|user|users)
-			continue
-			;;
-		esac
-
-		do_verify_option $OCF_RESKEY_fstype "$o"
-
-		case $OCF_RESKEY_fstype in
-		ext2|ext3|ext4)
-			case $o in
-			bsddf|minixdf|check|check=*|nocheck|debug)
-				continue
-				;;
-			errors=*|grpid|bsdgroups|nogrpid|sysvgroups)
-				continue
-				;;
-			resgid=*|resuid=*|sb=*|grpquota|noquota)
-				continue
-				;;
-			quota|usrquota|nouid32)
-				continue
-				;;
-			esac
-
-			if [ "$OCF_RESKEY_fstype" = "ext3" ] ||
-			   [ "$OCF_RESKEY_fstype" = "ext4" ]; then
-				case $0 in
-				noload|data=*)
-					continue
-					;;
-				esac
-			fi
-			;;
-		vfat)
-			case $o in
-			blocksize=512|blocksize=1024|blocksize=2048)
-				continue
-				;;
-			uid=*|gid=*|umask=*|dmask=*|fmask=*)
-				continue
-				;;
-			check=r*|check=n*|check=s*|codepage=*)
-				continue
-				;;
-			conv=b*|conv=t*|conv=a*|cvf_format=*)
-				continue
-				;;
-			cvf_option=*|debug|fat=12|fat=16|fat=32)
-				continue
-				;;
-			iocharset=*|quiet)
-				continue
-				;;
-			esac
-			;;
-
-		jfs)
-			case $o in
-			conv|hash=rupasov|hash=tea|hash=r5|hash=detect)
-				continue
-				;;
-			hashed_relocation|no_unhashed_relocation)
-				continue
-				;;
-			noborder|nolog|notail|resize=*)
-				continue
-				;;
-			esac
-			;;
-
-		xfs)
-			case $o in
-			biosize=*|dmapi|xdsm|logbufs=*|logbsize=*)
-				continue
-				;;
-			logdev=*|rtdev=*|noalign|noatime)
-				continue
-				;;
-			norecovery|osyncisdsync|quota|userquota)
-				continue
-				;;
-			uqnoenforce|grpquota|gqnoenforce)
-				continue
-				;;
-			sunit=*|swidth=*)
-				continue
-				;;
-			esac
-			;;
-
-		tmpfs)
-			case $o in
-			size=*|nr_blocks=*|mode=*)
-				continue
-				;;
-			esac
-			;;
-		btrfs)
-			# tbd
-			continue
-			;;
-		esac
-
-		echo Option $o not supported for $OCF_RESKEY_fstype
-		ret=$OCF_ERR_ARGS
-	done
-
-	return $ret
-}
-
-
-do_validate()
-{
-	verify_name || return $OCF_ERR_ARGS
-	verify_fstype || return $OCF_ERR_ARGS
-	verify_device || return $OCF_ERR_ARGS
-	verify_mountpoint || return $OCF_ERR_ARGS
-	verify_options || return $OCF_ERR_ARGS
-}
-
-
-do_pre_mount()
-{
-	declare fstype="$OCF_RESKEY_fstype"
-
-	#
-	# Check to determine if we need to fsck the filesystem.
-	#
-	# Note: this code should not indicate in any manner suggested
-	# file systems to use in the cluster.  Known filesystems are
-	# listed here for correct operation.
-	#
-        case "$fstype" in
-        reiserfs) typeset fsck_needed="" ;;
-        ext3)     typeset fsck_needed="" ;;
-        ext4)     typeset fsck_needed="" ;;
-        btrfs)    typeset fsck_needed="" ;;
-        jfs)      typeset fsck_needed="" ;;
-        xfs)      typeset fsck_needed="" ;;
-	vxfs)	  typeset fsck_needed="" ;;
-        ext2)     typeset fsck_needed=yes ;;
-        minix)    typeset fsck_needed=yes ;;
-        vfat)     typeset fsck_needed=yes ;;
-        msdos)    typeset fsck_needed=yes ;;
-	"")       typeset fsck_needed=yes ;;		# assume fsck
-	*)
-		typeset fsck_needed=yes 		# assume fsck
-	     	ocf_log warn "\
-Unknown file system type '$fstype' for device $dev.  Assuming fsck is required."
-		;;
-	esac
-
-
-	#
-	# Fsck the device, if needed.
-	#
-	if [ -n "$fsck_needed" ] || [ "${OCF_RESKEY_force_fsck}" = "yes" ] ||\
-	   [ "${OCF_RESKEY_force_fsck}" = "1" ]; then
-		typeset fsck_log=@LOGDIR@/$(basename $dev).fsck.log
-		ocf_log debug "Running fsck on $dev"
-		fsck -p $dev >> $fsck_log 2>&1
-		ret_val=$?
-		if [ $ret_val -gt 1 ]; then
-			ocf_log err "\
-'fsck -p $dev' failed, error=$ret_val; check $fsck_log for errors"
-			ocf_log debug "Invalidating buffers for $dev"
-			$INVALIDATEBUFFERS -f $dev
-			return $OCF_ERR_GENERIC
-		fi
-		rm -f $fsck_log
-	fi
-
-	return 0
-}
-
-do_post_mount() {
-	#
-	# Create this for the NFS NLM broadcast bit
-	#
-	if [ $NFS_TRICKS -eq 0 ]; then
-		if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-			mkdir -p "$mp"/.clumanager/statd
-			notify_list_merge "$mp"/.clumanager/statd
-		fi
-	fi
-
-	return 0
-}
-
-
-do_force_unmount() {
-	if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-		ocf_log warning "Dropping node-wide NFS locks"
-		pkill -KILL -x lockd
-		mkdir -p "$mp"/.clumanager/statd
-		# Copy out the notify list; our
-		# IPs are already torn down
-		notify_list_store "$mp"/.clumanager/statd
-
-		# Save for post-umount phase
-		export nfslock_reclaim=1
-	fi
-
-	return 0
-}
-
-
-do_post_unmount() {
-	if [ "$nfslock_reclaim" = "1" ]; then
-		# If we have this flag set, do a full reclaim broadcast
-		notify_list_broadcast "$mp"/.clumanager/statd
-	fi
-
-	return 0
-}
-
-main $*
diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
deleted file mode 100755
index f9256e7..0000000
--- a/rgmanager/src/resources/ip.sh
+++ /dev/null
@@ -1,987 +0,0 @@
-#!/bin/bash
-
-#
-# IPv4/IPv6 address management using new /sbin/ifcfg instead of 
-# ifconfig utility.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-# Grab nfs lock tricks if available
-export NFS_TRICKS=1
-if [ -f "$(dirname $0)/svclib_nfslock" ]; then
-	. $(dirname $0)/svclib_nfslock
-	NFS_TRICKS=0
-fi
-
-. $(dirname $0)/ocf-shellfuncs
-
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent version="rgmanager 2.0" name="ip">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This is an IP address.  Both IPv4 and IPv6 addresses are supported,
-        as well as NIC link monitoring for each IP address.
-    </longdesc>
-    <shortdesc lang="en">
-        This is an IP address.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="address" unique="1" primary="1">
-            <longdesc lang="en">
-                IPv4 or IPv6 address to use as a virtual IP
-                resource.
-            </longdesc>
-
-            <shortdesc lang="en">
-                IP Address
-            </shortdesc>
-
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="family">
-            <longdesc lang="en">
-                IPv4 or IPv6 address protocol family.
-            </longdesc>
-
-            <shortdesc lang="en">
-                Family
-            </shortdesc>
-
-            <!--
-            <val>auto</val>
-            <val>inet</val>
-            <val>inet6</val>
-            -->
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="monitor_link">
-            <longdesc lang="en">
-                Enabling this causes the status check to fail if
-                the link on the NIC to which this IP address is
-                bound is not present.
-            </longdesc>
-            <shortdesc lang="en">
-                Monitor NIC Link
-            </shortdesc>
-            <content type="boolean" default="1"/>
-        </parameter>
-
-	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="sleeptime">
-	    <longdesc lang="en">
-		Amount of time to sleep after removing an IP address.
-		Value is specified in seconds. Default value is 10.
-	    </longdesc>
-	    <shortdesc lang="en">
-		Amount of time (seconds) to sleep.
-	    </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="disable_rdisc">
-	    <longdesc lang="en">
-	        Disable updating of routing using RDISC protocol and
-	        preserve static routes.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Disable updating of routing using RDISC protocol
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="20"/>
-        <action name="stop" timeout="20"/>
-	<!-- No recover action.  If the IP address is not useable, then
-	     resources may or may not depend on it.  If it's been 
-	     deconfigured, resources using it are in a bad state. -->
-
-	<!-- Checks to see if the IP is up and (optionally) the link is
-	     working -->
-        <action name="status" interval="20" timeout="10"/>
-        <action name="monitor" interval="20" timeout="10"/>
-
-	<!-- Checks to see if we can ping the IP address locally -->
-        <action name="status" depth="10" interval="60" timeout="20"/>
-        <action name="monitor" depth="10" interval="60" timeout="20"/>
-
-        <action name="meta-data" timeout="20"/>
-        <action name="validate-all" timeout="20"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<attributes maxinstances="1"/>
-	<child type="nfsclient" forbid="1"/>
-	<child type="nfsexport" forbid="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_address()
-{
-	# XXX TBD
-	return 0
-}
-
-
-verify_all()
-{
-	# XXX TBD
-	return 0
-}
-
-
-#
-# Expand an IPv6 address.
-#
-ipv6_expand()
-{
-	typeset addr=$1
-	typeset maskbits
-	typeset -i x
-	typeset tempaddr
-	
-	maskbits=${addr/*\//}
-	if [ "$maskbits" = "$addr" ]; then
-		maskbits=""
-	else
-		# chop off mask bits
-		addr=${addr/\/*/}
-	fi
-
-	# grab each hex quad and expand it to 4 digits if it isn't already
-	# leave doublecolon in place for expansion out to the proper number of zeros later
-	tempaddr=""
-	for count in `seq 1 8`; do
-		quad=`echo $addr|awk -v count=$count -F : '{print $count}'`
-		quadlen=${#quad}
-		if [ $quadlen -eq 0 ]; then
-			quad=::
-		elif [ $quadlen -eq 1 ]; then
-			quad=000$quad
-		elif [ $quadlen -eq 2 ]; then
-			quad=00$quad
-		elif [ $quadlen -eq 3 ]; then
-			quad=0$quad
-		fi
-		tempaddr=$tempaddr$quad
-	done
-	addr=$tempaddr
-
-	# use space as placeholder
-	addr=${addr/::/\ }
-
-	# get rid of colons
-	addr=${addr//:/}
-
-	# add in zeroes where the doublecolon was
-	len=$((${#addr}-1))
-	zeroes=
-	while [ $len -lt 32 ]; do
-		zeroes="0$zeroes"
-		((len++))
-	done
-	addr=${addr/\ /$zeroes}
-
-	# probably a better way to do this
-	for (( x=0; x < ${#addr} ; x++)); do
-		naddr=$naddr${addr:x:1}
-
-		if (( x < (${#addr} - 1) && x%4 == 3)); then
-			naddr=$naddr:
-		fi
-	done
-
-	if [ -n "$maskbits" ]; then
-		echo "$naddr/$maskbits"
-		return 0
-	fi
-
-	echo "$naddr"
-	return 0
-}
-
-
-#
-# see if two ipv6 addrs are in the same subnet
-#
-ipv6_same_subnet()
-{
-	declare addrl=$1
-	declare addrr=$2
-	declare m=$3 
-	declare r x llsb rlsb
-
-	if [ $# -lt 2 ]; then
-		ocf_log err "usage: ipv6_same_subnet addr1 addr2 [mask]"
-		return 255
-	fi
-
-	if [ -z "$m" ]; then
-		m=${addrl/*\//}
-
-		[ -n "$m" ] || return 1
-
-	fi
-
-	if [ "${addrr}" != "${addrr/*\//}" ] &&
-	   [ "$m" != "${addrr/*\//}" ]; then
-		return 1
-	fi
-
-	addrl=${addrl/\/*/}
-	if [ ${#addrl} -lt 39 ]; then
-		addrl=$(ipv6_expand $addrl)
-	fi
-
-	addrr=${addrr/\/*/}
-	if [ ${#addrr} -lt 39 ]; then
-		addrr=$(ipv6_expand $addrr)
-	fi
-
-	# Calculate the amount to compare directly
-	x=$(($m/4+$m/16-(($m%4)==0)))
-
-	# and the remaining number of bits
-	r=$(($m%4))
-
-	if [ $r -ne 0 ]; then
-		# If we have any remaining bits, we will need to compare
-		# them later.  Get them now.
-		llsb=`printf "%d" 0x${addrl:$x:1}`
-		rlsb=`printf "%d" 0x${addrr:$x:1}`
-
-		# One less byte to compare directly, please
-		((--x))
-	fi
-	
-	# direct (string comparison) to see if they are equal
-	if [ "${addrl:0:$x}" != "${addrr:0:$x}" ]; then
-		return 1
-	fi
-
-	case $r in
-	0)
-		return 0
-		;;
-	1)	
-		[ $(($llsb & 8)) -eq $(($rlsb & 8)) ]
-		return $?
-		;;
-	2)
-		[ $(($llsb & 12)) -eq $(($rlsb & 12)) ]
-		return $?
-		;;
-	3)
-		[ $(($llsb & 14)) -eq $(($rlsb & 14)) ]
-		return $?
-		;;
-	esac
-
-	return 1
-}
-
-
-ipv4_same_subnet()
-{
-	declare addrl=$1
-	declare addrr=$2
-	declare m=$3 
-	declare r x llsb rlsb
-
-	if [ $# -lt 2 ]; then
-		ocf_log err "usage: ipv4_same_subnet current_addr new_addr [maskbits]"
-		return 255
-	fi
-
-
-	#
-	# Chop the netmask off of the ipaddr:
-	# e.g. 1.2.3.4/22 -> 22
-	#
-	if [ -z "$m" ]; then
-		m=${addrl/*\//}
-		[ -n "$m" ] || return 1
-	fi
-
-	#
-	# Check to see if there was a subnet mask provided on the
-	# new IP address.  If there was one and it does not match
-	# our expected subnet mask, we are done.
-	#
-	if [ "${addrr}" != "${addrr/\/*/}" ] &&
-	   [ "$m" != "${addrr/*\//}" ]; then
-		return 1
-	fi
-
-	#
-	# Chop off subnet bits for good.
-	#
-	addrl=${addrl/\/*/}
-	addrr=${addrr/\/*/}
-
-	#
-	# Remove '.' characters from dotted decimal notation and save
-	# in arrays. i.e.
-	#
-	#	192.168.1.163 -> array[0] = 192
-	#	                 array[1] = 168
-	#	                 array[2] = 1
-	#	                 array[3] = 163
-	#
-
-	let x=0
-	for quad in ${addrl//./\ }; do
-		ip1[((x++))]=$quad
-	done
-
-	x=0
-	for quad in ${addrr//./\ }; do
-		ip2[((x++))]=$quad
-	done
-
-	x=0
-
-	while [ $m -ge 8 ]; do
-		((m-=8))
-		if [ ${ip1[x]} -ne ${ip2[x]} ]; then
-			return 1
-		fi
-		((x++))
-	done
-
-	case $m in
-	0)
-		return 0
-		;;
-	1)	
-		[ $((${ip1[x]} & 128)) -eq $((${ip2[x]} & 128)) ]
-		return $?
-		;;
-	2)
-		[ $((${ip1[x]} & 192)) -eq $((${ip2[x]} & 192)) ]
-		return $?
-		;;
-	3)
-		[ $((${ip1[x]} & 224)) -eq $((${ip2[x]} & 224)) ]
-		return $?
-		;;
-	4)
-		[ $((${ip1[x]} & 240)) -eq $((${ip2[x]} & 240)) ]
-		return $?
-		;;
-	5)
-		[ $((${ip1[x]} & 248)) -eq $((${ip2[x]} & 248)) ]
-		return $?
-		;;
-	6)
-		[ $((${ip1[x]} & 252)) -eq $((${ip2[x]} & 252)) ]
-		return $?
-		;;
-	7)
-		[ $((${ip1[x]} & 254)) -eq $((${ip2[x]} & 254)) ]
-		return $?
-		;;
-	esac
-
-	return 1
-}
-
-
-ipv6_list_interfaces()
-{
-	declare idx dev ifaddr
-	declare ifaddr_exp
-	
-	while read idx dev ifaddr; do
-	    
-		isSlave $dev
-		if [ $? -ne 2 ]; then
-			continue
-		fi
-		
-		idx=${idx/:/}
-		
-		ifaddr_exp=$(ipv6_expand $ifaddr)
-		
-		echo $dev ${ifaddr_exp/\/*/} ${ifaddr_exp/*\//}
-		
-	done < <(/sbin/ip -o -f inet6 addr | awk '{print $1,$2,$4}')
-
-	return 0
-}
-
-
-isSlave()
-{
-	declare intf=$1
-	declare line
-
-	if [ -z "$intf" ]; then
-		ocf_log err "usage: isSlave <I/F>"
-		return $OCF_ERR_ARGS
-	fi
-
-	line=$(/sbin/ip link list dev $intf)
-	if [ $? -ne 0 ]; then
-		ocf_log err "$intf not found"
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ "$line" = "${line/<*SLAVE*>/}" ]; then
-		return 2
-	fi
-
-	# Yes, it is a slave device.  Ignore.
-	return 0
-}
-
-
-# 
-# Check if interface is in UP state
-#
-interface_up()
-{
-       declare intf=$1
-       
-       if [ -z "$intf" ]; then
-		ocf_log err "usage: interface_up <I/F>"
-		return 1
-       fi
-       
-       line=$(/sbin/ip -o link show up dev $intf 2> /dev/null)
-       [ -z "$line" ] && return 2
-       
-       return 0
-}
-
-
-ethernet_link_up()
-{
-	declare linkstate=$(ethtool $1 | grep "Link detected:" |\
-			    awk '{print $3}')
-	
-	[ -n "$linkstate" ] || return 0
-
-	case $linkstate in
-	yes)
-		return 0
-		;;
-	*)
-		return 1
-		;;
-	esac
-	
-	return 1
-}
-
-
-#
-# Checks the physical link status of an ethernet or bonded interface.
-#
-network_link_up()
-{
-	declare slaves
-	declare intf_arg=$1
-	declare link_up=1		# Assume link down
-	declare intf_test
-
-	if [ -z "$intf_arg" ]; then
-		ocf_log err "usage: network_link_up <intf>"
-		return 1
-	fi
-	
-	ethernet_link_up $intf_arg
-	link_up=$?
-
-	if [ $link_up -eq 0 ]; then
-		ocf_log debug "Link for $intf_arg: Detected"
-	else
-		ocf_log warn "Link for $intf_arg: Not detected"
-	fi
-
-	return $link_up
-}
-
-
-ipv4_list_interfaces()
-{
-	declare idx dev ifaddr
-
-	while read idx dev ifaddr; do
-	        
-		isSlave $dev
-		if [ $? -ne 2 ]; then
-			continue
-		fi
-		
-		idx=${idx/:/}
-		
-		echo $dev ${ifaddr/\/*/} ${ifaddr/*\//}
-		
-	done < <(/sbin/ip -o -f inet addr | awk '{print $1,$2,$4}')
-	
-	return 0
-}
-
-
-#
-# Add an IP address to our interface.
-#
-ipv6()
-{
-	declare dev maskbits
-	declare addr=$2
-	declare addr_exp=$(ipv6_expand $addr)
-	
-	while read dev ifaddr_exp maskbits; do 
-	        if [ -z "$dev" ]; then
-		        continue
-		fi
-		
-		if [ "$1" = "add" ]; then
-			ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp
-			if [ $? -ne 0 ]; then
-                                continue
-                        fi
-                        interface_up $dev
-                        if [ $? -ne 0 ]; then
-                                continue
-                        fi
-			if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
-                        	network_link_up $dev
-                        	if [ $? -ne 0 ]; then
-                                	continue
-                        	fi
-			fi
-
-			if [ "${addr/\/*/}" = "${addr}" ]; then
-				addr="$addr/$maskbits"
-			fi
-			ocf_log info "Adding IPv6 address $addr to $dev"
-		fi
-		if [ "$1" = "del" ]; then
-		        if [ "${addr_exp/\/*/}" != "$ifaddr_exp" ]; then
-			        continue
-			fi
-			addr=`/sbin/ip addr list | grep "$addr" | head -n 1 | awk '{print $2}'`
-			ocf_log info "Removing IPv6 address $addr from $dev"
-                fi
-		
-		if [ "$1" = "add" ]; then
-			ocf_log debug "Pinging addr ${addr%%/*} from dev $dev"
-			if ping_check inet6 ${addr%%/*} $dev; then
-				ocf_log err "IPv6 address collision ${addr%%/*}"
-				return 1
-			fi
-		fi
-		/sbin/ip -f inet6 addr $1 dev $dev $addr
-		[ $? -ne 0 ] && return 1
-		
-		#
-		# NDP should take of figuring out our new address.  Plus,
-		# we do not have something (like arping) to do this for ipv6
-		# anyway.
-		# 
-		# RFC 2461, section 7.2.6 states thusly:
-		#
-	   	# Note that because unsolicited Neighbor Advertisements do not
-		# reliably update caches in all nodes (the advertisements might
-		# not be received by all nodes), they should only be viewed as
-		# a performance optimization to quickly update the caches in
-		#  most neighbors. 
-		#
-		
-		# Not sure if this is necessary for ipv6 either.
-		file=$(which rdisc 2>/dev/null)
-		if [ -f "$file" ]; then
-			if [ "$OCF_RESKEY_disable_rdisc" != "yes" ] && \
-			   [ "$OCF_RESKEY_disable_rdisc" != "1" ]; then
-		        	killall -HUP rdisc || rdisc -fs
-			fi
-		fi
-		
-		return 0
-	done < <(ipv6_list_interfaces)
-	
-	return 1
-}
-
-
-#
-# Add an IP address to our interface.
-#
-ipv4()
-{
-	declare dev ifaddr maskbits
-	declare addr=$2
-	
-	while read dev ifaddr maskbits; do
-	        if [ -z "$dev" ]; then
-		        continue
-		fi
-
-		if [ "$1" = "add" ]; then
-		        ipv4_same_subnet $ifaddr/$maskbits $addr
-			if [ $? -ne 0 ]; then
-			        continue
-			fi
-		        interface_up $dev
-			if [ $? -ne 0 ]; then
-			        continue
-			fi
-			if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
-				network_link_up $dev
-				if [ $? -ne 0 ]; then
-					continue
-				fi
-			fi
-
-			if [ "${addr/\/*/}" = "${addr}" ]; then
-				addr="$addr/$maskbits"
-			fi
-			ocf_log info "Adding IPv4 address $addr to $dev"
-		fi
-		if [ "$1" = "del" ]; then
-			if [ "${addr/\/*/}" != "$ifaddr" ]; then
-			        continue
-			fi
-			addr=`/sbin/ip addr list | grep "$ifaddr/" | head -n 1 | awk '{print $2}'`
-			ocf_log info "Removing IPv4 address $addr from $dev"
-		fi
-		
-		if [ "$1" = "add" ]; then
-			ocf_log debug "Pinging addr ${addr%%/*} from dev $dev"
-			if ping_check inet ${addr%%/*} $dev; then
-				ocf_log err "IPv4 address collision ${addr%%/*}"
-				return 1
-			fi
-		fi
-		/sbin/ip -f inet addr $1 dev $dev $addr
-		[ $? -ne 0 ] && return 1
-		
-        	#
-	        # The following is needed only with ifconfig; ifcfg does it for us
-        	#
-		if [ "$1" = "add" ]; then
-        		# do that freak arp thing
-		    
- 		        hwaddr=$(/sbin/ip -o link show $dev)
-			hwaddr=${hwaddr/*link\/ether\ /}
-			hwaddr=${hwaddr/\ \*/}
-			
-			addr=${addr/\/*/}
-			ocf_log debug "Sending gratuitous ARP: $addr $hwaddr"
-			arping -q -c 2 -U -I $dev $addr
-		fi
-		
-		file=$(which rdisc 2>/dev/null)
-		if [ -f "$file" ]; then
-			if [ "$OCF_RESKEY_disable_rdisc" != "yes" ] && \
-			   [ "$OCF_RESKEY_disable_rdisc" != "1" ]; then
-			        killall -HUP rdisc || rdisc -fs
-			fi
-		fi
-		
-		return 0
-	done  < <(ipv4_list_interfaces)
-	
-	return 1
-}
-
-
-#
-# Usage:
-# ping_check <family> <address> [interface]
-#
-ping_check()
-{
-	declare ops="-c 1 -w 2"
-	declare pingcmd=""
-
-	if [ "$1" = "inet6" ]; then
-		pingcmd="ping6"
-	else
-		pingcmd="ping"
-	fi
-
-	if [ -n "$3" ]; then 
-		ops="$ops -I $3"
-	fi
-
-	return $($pingcmd $ops $2 &> /dev/null)
-}
-
-
-# 
-# Usage:
-# check_interface_up <family> <address>
-#
-check_interface_up()
-{
-	declare dev
-	declare addr=${2/\/*/}
-	declare currentAddr caExpanded
-
-	if [ "$1" == "inet6" ]; then
-		addrExpanded=$(ipv6_expand $addr)
-		for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-			caExpanded=$(ipv6_expand $currentAddr)
-			caExpanded=${caExpanded/\/*/}
-			if [ "$addrExpanded" == "$caExpanded" ]; then
-				dev=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}" | awk '{print $2}')
-				break
-			fi
-		done
-	else
-		dev=$(/sbin/ip -f $1 -o addr | grep " $addr/" | awk '{print $2}')
-	fi
-
-	if [ -z "$dev" ]; then
-		return 1
-	fi
-	
-	interface_up $dev
-	return $?
-}
-
-
-# 
-# Usage:
-# address_configured <family> <address>
-#
-address_configured()
-{
-	declare line
-	declare addr
-	declare currentAddr caExpanded
-
-	# Chop off maxk bits 
-	addr=${2/\/*/}
-
-	if [ "$1" == "inet6" ]; then
-		addrExpanded=$(ipv6_expand $addr)
-		for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-			caExpanded=$(ipv6_expand $currentAddr)
-			caExpanded=${caExpanded/\/*/}
-			if [ "$addrExpanded" == "$caExpanded" ]; then
-				line=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}");
-				break
-			fi
-		done
-	else
-		line=$(/sbin/ip -f $1 -o addr | grep " $addr/")
-	fi
-
-	if [ -z "$line" ]; then
-		return 1
-	fi
-	return 0
-}
-
-
-#
-# Usage:
-# ip_op <family> <operation> <address> [quiet]
-#
-ip_op()
-{
-	declare dev
-	declare rtr
-	declare addr=${3/\/*/}
-	declare caExpanded currentAddr
-
-	if [ "$2" = "status" ]; then
-
-		ocf_log debug "Checking $3, Level $OCF_CHECK_LEVEL"
-	
-		if [ "$1" == "inet6" ]; then
-			addrExpanded=$(ipv6_expand $addr)
-			for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-				caExpanded=$(ipv6_expand $currentAddr)
-				caExpanded=${caExpanded/\/*/}
-				if [ "$addrExpanded" == "$caExpanded" ]; then
-					dev=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}" | awk '{print $2}')
-					break
-				fi
-			done
-		else
-			dev=$(/sbin/ip -f $1 -o addr | grep " $addr/" | awk '{print $2}')
-		fi
-
-		if [ -z "$dev" ]; then
-			ocf_log warn "$3 is not configured"
-			return 1
-		fi
-		ocf_log debug "$3 present on $dev"
-		
-		if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
-			if ! network_link_up $dev; then
-		        	ocf_log warn "No link on $dev..."
-				return 1
-			fi
-			ocf_log debug "Link detected on $dev"
-		fi
-		
-		[ $OCF_CHECK_LEVEL -lt 10 ] && return 0
-		if ! ping_check $1 $addr $dev; then
-			ocf_log warn "Failed to ping $addr"
-			return 1
-		fi
-		ocf_log debug "Local ping to $addr succeeded"
-		
-		return 0
-	fi
-
-	case $1 in
-	inet)
-		ipv4 $2 $3
-		return $?
-		;;
-	inet6)
-		if [ "$2" = "del" ]; then
-			addrExpanded=$(ipv6_expand $addr)
-			for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-				caExpanded=$(ipv6_expand $currentAddr)
-				caExpanded=${caExpanded/\/*/}
-				if [ "$addrExpanded" == "$caExpanded" ]; then
-					addr6=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}" | awk '{print $4}')
-					ipv6 $2 $addr6
-					return $?
-				fi
-			done
-		fi
-
-		ipv6 $2 $3
-		return $?
-		;;
-	esac
-	return 1
-}
-
-
-case ${OCF_RESKEY_family} in
-inet)
-	;;
-inet6)
-	;;
-*)
-	if [ "${OCF_RESKEY_address//:/}" != "${OCF_RESKEY_address}" ]; then
-		export OCF_RESKEY_family=inet6
-	else
-		export OCF_RESKEY_family=inet
-	fi
-	;;
-esac
-
-
-if [ -z "$OCF_CHECK_LEVEL" ]; then
-	OCF_CHECK_LEVEL=0
-fi
-
-if [ "${OCF_RESKEY_monitor_link}" = "no" ] ||
-   [ "${OCF_RESKEY_monitor_link}" = "0" ]; then
-        OCF_RESKEY_monitor_link="no"
-else
-        OCF_RESKEY_monitor_link="yes"
-fi
-
-case $1 in
-start)
-	if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-		ocf_log debug "${OCF_RESKEY_address} already configured"
-		exit 0
-	fi
-	ip_op ${OCF_RESKEY_family} add ${OCF_RESKEY_address}
-	if [ $? -ne 0 ]; then
-		exit $OCF_ERR_GENERIC
-	fi
-
-	if [ $NFS_TRICKS -eq 0 ]; then
-		if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-			notify_list_broadcast /var/lib/nfs/statd
-		fi
-	fi
-
-	exit $?
-	;;
-stop)
-	if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-		
-		ip_op ${OCF_RESKEY_family} del ${OCF_RESKEY_address}
-
-		# Make sure it's down
-		if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-			ocf_log err "Failed to remove ${OCF_RESKEY_address}"
-			exit 1
-		fi
-
-		# XXX Let nfsd/lockd clear their queues; we hope to have a
-		# way to enforce this in the future
-		if [ -z "$OCF_RESKEY_sleeptime" ]; then
-		    sleep 10
-		else
-		    if [ "$OCF_RESKEY_sleeptime" -gt "0" ]; then
-			sleep $OCF_RESKEY_sleeptime
-		    fi
-		fi
-	else
-		ocf_log debug "${OCF_RESKEY_address} is not configured"
-	fi
-	exit 0
-	;;
-status|monitor)
-	ip_op ${OCF_RESKEY_family} status ${OCF_RESKEY_address}
-	[ $? -ne 0 ] && exit $OCF_NOT_RUNNING
-	
-	check_interface_up ${OCF_RESKEY_family} ${OCF_RESKEY_address}
-	exit $?
-	;;
-restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	exit 0
-	;;
-meta-data)
-	meta_data
-	exit 0
-	;;
-validate-all|verify_all)
-	verify_all
-	exit $?
-	;;
-*)
-	echo "usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-
diff --git a/rgmanager/src/resources/lvm.metadata b/rgmanager/src/resources/lvm.metadata
deleted file mode 100644
index 3759063..0000000
--- a/rgmanager/src/resources/lvm.metadata
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" ?>
-<resource-agent name="lvm" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	This defines a LVM volume group that is ...
-    </longdesc>
-
-    <shortdesc lang="en">
-	LVM Failover script
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                Unique name for this LVM resource
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="vg_name" required="1">
-            <longdesc lang="en">
-                Name of the volume group being managed
-            </longdesc>
-            <shortdesc lang="en">
-                Volume group name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="lv_name">
-            <longdesc lang="en">
-                Name of the logical volume being managed.  This
-		parameter is optional if there are more than one
-		logical volumes in the volume group to be managed.
-            </longdesc>
-            <shortdesc lang="en">
-                Logical Volume name (optional).
-            </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="self_fence">
-	    <longdesc lang="en">
-		If set and the clean up of the tags fails, the node will
-		immediately reboot.
-	    </longdesc>
-	    <shortdesc lang="en">
-		Fence the node if it is not able to clean up LVM tags
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-	<action name="stop" timeout="5"/>
-
-	<action name="status" timeout="5" interval="1h"/>
-	<action name="monitor" timeout="5" interval="1h"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="30"/>
-    </actions>
-
-    <special tag="rgmanager">
-    	<attributes maxinstances="1"/>
-    </special>
-
-</resource-agent>
diff --git a/rgmanager/src/resources/lvm.sh b/rgmanager/src/resources/lvm.sh
deleted file mode 100644
index e71460c..0000000
--- a/rgmanager/src/resources/lvm.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/bash
-
-#
-# LVM Failover Script.
-# NOTE: Changes to /etc/lvm/lvm.conf are required for proper operation.
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/member_util.sh
-. $(dirname $0)/lvm_by_lv.sh
-. $(dirname $0)/lvm_by_vg.sh
-
-rv=0
-
-################################################################################
-# ha_lvm_proper_setup_check
-#
-################################################################################
-function ha_lvm_proper_setup_check
-{
-	##
-	# The default for lvm.conf:activation/volume_list is empty,
-	# this must be changed for HA LVM.
-	##
-	if ! lvm dumpconfig activation/volume_list >& /dev/null; then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* \"volume_list\" not specified in lvm.conf."
-		return $OCF_ERR_GENERIC
-	fi
-
-	##
-	# Machine's cluster node name must be present as
-	# a tag in lvm.conf:activation/volume_list
-	##
-	if ! lvm dumpconfig activation/volume_list | grep $(local_node_name); then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* @$(local_node_name) missing from \"volume_list\" in lvm.conf"
-		return $OCF_ERR_GENERIC
-	fi
-
-	##
-	# The volume group to be failed over must NOT be in
-	# lvm.conf:activation/volume_list; otherwise, machines
-	# will be able to activate the VG regardless of the tags
-	##
-	if lvm dumpconfig activation/volume_list | grep "\"$OCF_RESKEY_vg_name\""; then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* $OCF_RESKEY_vg_name found in \"volume_list\" in lvm.conf"
-		return $OCF_ERR_GENERIC
-	fi
-
-	##
-	# Next, we need to ensure that their initrd has been updated
-	# If not, the machine could boot and activate the VG outside
-	# the control of rgmanager
-	##
-	# Fixme: we might be able to perform a better check...
-	if [ "$(find /boot -name *.img -newer /etc/lvm/lvm.conf)" == "" ]; then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* initrd image needs to be newer than lvm.conf"
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-################################################################################
-# MAIN
-################################################################################
-
-case $1 in
-start)
-	if ! [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		ha_lvm_proper_setup_check || exit 1
-	fi
-
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_start || exit 1
-	else
-		lv_start || exit 1
-	fi
-	;;
-
-status|monitor)
-	ocf_log notice "Getting status"
-
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_status || exit 1
-	else
-		lv_status || exit 1
-	fi
-	;;
-		    
-stop)
-	if ! [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		if ! ha_lvm_proper_setup_check; then
-			ocf_log err "WARNING: An improper setup can cause data corruption!"
-		fi
-	fi
-
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_stop || exit 1
-	else
-		lv_stop || exit 1
-	fi
-	;;
-
-recover|restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	;;
-
-meta-data)
-	cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-	;;
-
-validate-all|verify-all)
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_verify || exit 1
-	else
-		lv_verify || exit 1
-	fi
-	;;
-*)
-	echo "usage: $0 {start|status|monitor|stop|restart|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit $rv
diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
deleted file mode 100644
index 4aead58..0000000
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ /dev/null
@@ -1,410 +0,0 @@
-#!/bin/bash
-
-# lv_verify
-#
-# Verify the parameters passed in
-#
-lv_verify()
-{
-	# Anything to verify?  Perhaps the names?
-	return $OCF_SUCCESS
-}
-
-# lv_exec_resilient
-#
-# Sometimes, devices can come back.  Their metadata will conflict
-# with the good devices that remain.  This function filters out those
-# failed devices when executing the given command
-#
-# Finishing with vgscan resets the cache/filter
-lv_exec_resilient()
-{
-	declare command=$1
-	declare all_pvs
-
-	ocf_log notice "Making resilient : $command"
-
-	if [ -z $command ]; then
-		ocf_log err "lv_exec_resilient: Arguments not supplied"
-		return $OCF_ERR_ARGS
-	fi
-
-	# pvs will print out only those devices that are valid
-	# If a device dies and comes back, it will not appear
-	# in pvs output (but you will get a Warning).
-	all_pvs=(`pvs --noheadings -o pv_name | grep -v Warning`)
-
-	# Now we use those valid devices in a filter which we set up.
-	# The device will then be activated because there are no
-	# metadata conflicts.
-        command=$command" --config devices{filter=["
-	for i in ${all_pvs[*]}; do
-		command=$command'"a|'$i'|",'
-	done
-	command=$command"\"r|.*|\"]}"
-
-	ocf_log notice "Resilient command: $command"
-	if ! $command ; then
-		ocf_log err "lv_exec_resilient failed"
-		vgscan
-		return $OCF_ERR_GENERIC
-	else
-		vgscan
-		return $OCF_SUCCESS
-	fi
-}
-
-# lv_activate_resilient
-#
-# Sometimes, devices can come back.  Their metadata will conflict
-# with the good devices that remain.  We must filter out those
-# failed devices when trying to reactivate
-lv_activate_resilient()
-{
-	declare action=$1
-	declare lv_path=$2
-	declare op="-ay"
-
-	if [ -z $action ] || [ -z $lv_path ]; then
-		ocf_log err "lv_activate_resilient: Arguments not supplied"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ $action != "start" ]; then
-	        op="-an"
-	fi
-
-	if ! lv_exec_resilient "lvchange $op $lv_path" ; then
-		ocf_log err "lv_activate_resilient $action failed on $lv_path"
-		return $OCF_ERR_GENERIC
-	else
-		return $OCF_SUCCESS
-	fi
-}
-
-lv_status_clustered()
-{
-	#
-	# Check if device is active
-	#
-	if [[ ! $(lvs -o attr --noheadings $lv_path) =~ ....a. ]]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-# lv_status
-#
-# Is the LV active?
-lv_status_single()
-{
-	declare lv_path="$OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-	declare dev="/dev/$lv_path"
-	declare realdev
-	declare owner
-	declare my_name
-
-	#
-	# Check if device is active
-	#
-	if [[ ! $(lvs -o attr --noheadings $lv_path) =~ ....a. ]]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		ocf_log notice "$OCF_RESKEY_vg_name is a cluster volume.  Ignoring..."
-		return $OCF_SUCCESS
-	fi
-
-	#
-	# Check if all links/device nodes are present
-	#
-        if [ -h "$dev" ]; then
-		realdev=$(readlink -f $dev)
-		if [ $? -ne 0 ]; then
-			ocf_log err "Failed to follow link, $dev"
-			return $OCF_ERR_ARGS
-		fi
-
-		if [ ! -b $realdev ]; then
-			ocf_log err "Device node for $lv_path is not present"
-			return $OCF_ERR_GENERIC
-		fi
-	else
-	        ocf_log err "Symbolic link for $lv_path is not present"
-		return $OCF_ERR_GENERIC
-	fi
-
-	#
-	# Verify that we are the correct owner
-	#
-	owner=`lvs -o tags --noheadings $lv_path`
-	my_name=$(local_node_name)
-	if [ -z $my_name ]; then
-		ocf_log err "Unable to determine local machine name"
-
-		# FIXME: I don't really want to fail on 1st offense
-		return $OCF_SUCCESS
-	fi
-
-	if [ -z $owner ] || [ $my_name != $owner ]; then
-		ocf_log err "WARNING: $lv_path should not be active"
-		ocf_log err "WARNING: $my_name does not own $lv_path"
-		ocf_log err "WARNING: Attempting shutdown of $lv_path"
-
-		lv_activate_resilient "stop" $lv_path
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-function lv_status
-{
-	# We pass in the VG name to see of the logical volume is clustered
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		lv_status_clustered
-	else
-		lv_status_single
-	fi
-}
-
-# lv_activate_and_tag
-lv_activate_and_tag()
-{
-	declare action=$1
-	declare tag=$2
-	declare lv_path=$3
-	typeset self_fence=""
-
-	case ${OCF_RESKEY_self_fence} in
-		"yes")          self_fence=1 ;;
-		1)              self_fence=1 ;;
-		*)              self_fence="" ;;
-	esac
-
-	if [ -z $action ] || [ -z $tag ] || [ -z $lv_path ]; then
-		ocf_log err "Supplied args: 1) $action, 2) $tag, 3) $lv_path"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ $action == "start" ]; then
-		ocf_log notice "Activating $lv_path"
-		lvchange --addtag $tag $lv_path
-		if [ $? -ne 0 ]; then
-			ocf_log err "Unable to add tag to $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! lv_activate_resilient $action $lv_path; then
-			ocf_log err "Unable to activate $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-	else
-		ocf_log notice "Deactivating $lv_path"
-		if ! lv_activate_resilient $action $lv_path; then
-			if [ "$self_fence" ]; then
-				ocf_log err "Unable to deactivate $lv_path: REBOOTING"
-				sync
-				reboot -fn
-			else
-				ocf_log err "Unable to deactivate $lv_path"
-			fi
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Removing ownership tag ($tag) from $lv_path"
-
-		lvchange --deltag $tag $lv_path
-		if [ $? -ne 0 ]; then
-			ocf_log err "Unable to delete tag from $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if [ `lvs --noheadings -o lv_tags $lv_path` == $tag ]; then
-			ocf_log notice "Removing ownership tag ($tag) from $lv_path"
-			lvchange --deltag $tag $lv_path
-			if [ $? -ne 0 ]; then
-				ocf_log err "Unable to delete tag from $lv_path"
-				return $OCF_ERR_GENERIC
-			fi
-		fi
-	fi
-
-	return $OCF_SUCCESS
-}
-
-# lv_activate
-# $1: start/stop only
-#
-# Basically, if we want to [de]activate an LVM volume,
-# we must own it.  That means that our tag must be on it.
-# This requires a change to /etc/lvm/lvm.conf:
-#	volume_list = [ "root_volume", "@my_hostname" ]
-# where "root_volume" is your root volume group and
-# "my_hostname" is $(local_node_name)
-#
-# If there is a node failure, we may wish to "steal" the
-# LV.  For that, we need to check if the node that owns
-# it is still part of the cluster.  We use the tag to
-# determine who owns the volume then query for their
-# liveness.  If they are dead, we can steal.
-lv_activate()
-{
-	declare lv_path="$OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-	declare owner=`lvs -o tags --noheadings $lv_path`
-	declare my_name=$(local_node_name)
-
-	if [ -z $my_name ]; then
-		ocf_log err "Unable to determine cluster node name"
-		return $OCF_ERR_GENERIC
-	fi
-
-	#
-	# FIXME: This code block is repeated below... might be
-	# nice to put it in a function
-	#
-	if [ ! -z $owner ] && [ $owner != $my_name ]; then
-		if is_node_member_clustat $owner ; then
-			ocf_log err "$owner owns $lv_path unable to $1"
-			return $OCF_ERR_GENERIC
-		fi
-		ocf_log notice "Owner of $lv_path is not in the cluster"
-		ocf_log notice "Stealing $lv_path"
-
-		lvchange --deltag $owner $lv_path
-		if [ $? -ne 0 ]; then
-			ocf_log err "Failed to steal $lv_path from $owner"
-			return $OCF_ERR_GENERIC
-		fi
-
-		# Warning --deltag doesn't always result in failure
-		if [ ! -z `lvs -o tags --noheadings $lv_path` ]; then
-			ocf_log err "Failed to steal $lv_path from $owner."
-			return $OCF_ERR_GENERIC
-		fi
-	fi
-
-	if ! lv_activate_and_tag $1 $my_name $lv_path; then
-		ocf_log err "Failed to $1 $lv_path"
-
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
-
-		if vgreduce --removemissing --force --config \
-		    "activation { volume_list = \"$OCF_RESKEY_vg_name\" }" \
-		    $OCF_RESKEY_vg_name; then
-			ocf_log notice "$OCF_RESKEY_vg_name now consistent"
-			owner=`lvs -o tags --noheadings $lv_path`
-			if [ ! -z $owner ] && [ $owner != $my_name ]; then
-				if is_node_member_clustat $owner ; then
-					ocf_log err "$owner owns $lv_path unable to $1"
-					return $OCF_ERR_GENERIC
-				fi
-				ocf_log notice "Owner of $lv_path is not in the cluster"
-				ocf_log notice "Stealing $lv_path"
-
-				lvchange --deltag $owner $lv_path
-				if [ $? -ne 0 ]; then
-					ocf_log err "Failed to steal $lv_path from $owner"
-					return $OCF_ERR_GENERIC
-				fi
-
-				# Warning --deltag doesn't always result in failure
-				if [ ! -z `lvs -o tags --noheadings $lv_path` ]; then
-					ocf_log err "Failed to steal $lv_path from $owner."
-					return $OCF_ERR_GENERIC
-				fi
-			fi
-
-			if ! lv_activate_and_tag $1 $my_name $lv_path; then
-				ocf_log err "Failed second attempt to $1 $lv_path"
-				return $OCF_ERR_GENERIC
-			else
-				ocf_log notice "Second attempt to $1 $lv_path successful"
-				return $OCF_SUCCESS
-			fi
-		else
-			ocf_log err "Failed to $1 $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-	fi
-	return $OCF_SUCCESS
-}
-
-function lv_start_clustered
-{
-	if ! lvchange -aey $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name; then
-		ocf_log err "Failed to activate logical volume, $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-
-		if ! lvconvert --repair --use-policies $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name; then
-			ocf_log err "Failed to cleanup $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! lvchange -aey $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name; then
-			ocf_log err "Failed second attempt to activate $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Second attempt to activate $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name successful"
-		return $OCF_SUCCESS
-	fi
-	return $OCF_SUCCESS
-}
-
-function lv_start_single
-{
-	if ! lvs $OCF_RESKEY_vg_name >& /dev/null; then
-		lv_count=0
-	else
-		lv_count=`lvs --noheadings -o name $OCF_RESKEY_vg_name | grep -v _mlog | grep -v _mimage | grep -v nconsistent | wc -l`
-	fi
-	if [ $lv_count -gt 1 ]; then
-		ocf_log err "HA LVM requires Only one logical volume per volume group."
-		ocf_log err "There are currently $lv_count logical volumes in $OCF_RESKEY_vg_name"
-		ocf_log err "Failing HA LVM start of $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-		exit $OCF_ERR_GENERIC
-	fi
-
-	if ! lv_activate start; then
-		return 1
-	fi
-
-	return 0
-}
-
-function lv_start
-{
-	# We pass in the VG name to see of the logical volume is clustered
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		lv_start_clustered
-	else
-		lv_start_single
-	fi
-}
-
-function lv_stop_clustered
-{
-	lvchange -aln $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name
-}
-
-function lv_stop_single
-{
-	if ! lv_activate stop; then
-		return 1
-	fi
-
-	return 0
-}
-
-function lv_stop
-{
-	# We pass in the VG name to see of the logical volume is clustered
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		lv_stop_clustered
-	else
-		lv_stop_single
-	fi
-}
diff --git a/rgmanager/src/resources/lvm_by_vg.sh b/rgmanager/src/resources/lvm_by_vg.sh
deleted file mode 100644
index 2cce7c9..0000000
--- a/rgmanager/src/resources/lvm_by_vg.sh
+++ /dev/null
@@ -1,401 +0,0 @@
-#!/bin/bash
-
-# vg_owner
-#
-# Returns:
-#    1 == We are the owner
-#    2 == We can claim it
-#    0 == Owned by someone else
-function vg_owner
-{
-	local owner=`vgs -o tags --noheadings $OCF_RESKEY_vg_name`
-	local my_name=$(local_node_name)
-
-	if [ -z $my_name ]; then
-		ocf_log err "Unable to determine cluster node name"
-		return 0
-	fi
-
-	if [ -z $owner ]; then
-		# No-one owns this VG yet, so we can claim it
-		return 2
-	fi
-
-	if [ $owner != $my_name ]; then
-		if is_node_member_clustat $owner ; then
-			return 0
-		fi
-		return 2
-	fi
-
-	return 1
-}
-
-function strip_tags
-{
-	local i
-
-	for i in `vgs --noheadings -o tags $OCF_RESKEY_vg_name | sed s/","/" "/g`; do
-		ocf_log info "Stripping tag, $i"
-		vgchange --deltag $i $OCF_RESKEY_vg_name
-	done
-
-	if [ ! -z `vgs -o tags --noheadings $OCF_RESKEY_vg_name` ]; then
-		ocf_log err "Failed to remove ownership tags from $OCF_RESKEY_vg_name"
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-function strip_and_add_tag
-{
-	if ! strip_tags; then
-		ocf_log err "Failed to remove tags from volume group, $OCF_RESKEY_vg_name"
-		return $OCF_ERR_GENERIC
-	fi
-
-	vgchange --addtag $(local_node_name) $OCF_RESKEY_vg_name
-	if [ $? -ne 0 ]; then
-		ocf_log err "Failed to add ownership tag to $OCF_RESKEY_vg_name"
-		return $OCF_ERR_GENERIC
-        fi
-
-	ocf_log info "New tag \"$(local_node_name)\" added to $OCF_RESKEY_vg_name"
-
-	return $OCF_SUCCESS
-}
-
-function vg_status_clustered
-{
-	return $OCF_SUCCESS
-}
-
-# vg_status
-#
-# Are all the LVs active?
-function vg_status_single
-{
-	local i
-	local dev
-	local my_name=$(local_node_name)
-
-	#
-	# Check that all LVs are active
-	#
-	for i in `lvs $OCF_RESKEY_vg_name --noheadings -o attr`; do
-		if [[ ! $i =~ ....a. ]]; then
-			return $OCF_ERR_GENERIC
-		fi
-	done
-
-	#
-	# Check if all links/device nodes are present
-	#
-	for i in `lvs $OCF_RESKEY_vg_name --noheadings -o name`; do
-		dev="/dev/$OCF_RESKEY_vg_name/$i"
-
-		if [ -h $dev ]; then
-			realdev=$(readlink -f $dev)
-			if [ $? -ne 0 ]; then
-				ocf_log err "Failed to follow link, $dev"
-				return $OCF_ERR_GENERIC
-			fi
-
-			if [ ! -b $realdev ]; then
-				ocf_log err "Device node for $dev is not present"
-				return $OCF_ERR_GENERIC
-			fi
-		else
-			ocf_log err "Symbolic link for $lv_path is not present"
-			return $OCF_ERR_GENERIC
-		fi
-	done
-
-	#
-	# Verify that we are the correct owner
-	#
-	vg_owner
-	if [ $? -ne 1 ]; then
-		ocf_log err "WARNING: $OCF_RESKEY_vg_name should not be active"
-		ocf_log err "WARNING: $my_name does not own $OCF_RESKEY_vg_name"
-		ocf_log err "WARNING: Attempting shutdown of $OCF_RESKEY_vg_name"
-
-		# FIXME: may need more force to shut this down
-		vgchange -an $OCF_RESKEY_vg_name
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-##
-# Main status function for volume groups
-##
-function vg_status
-{
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		vg_status_clustered
-	else
-		vg_status_single
-	fi
-}
-
-function vg_verify
-{
-	# Anything to verify?
-	return $OCF_SUCCESS
-}
-
-function vg_start_clustered
-{
-	local a
-	local results
-	local all_pvs
-	local resilience
-
-	ocf_log info "Starting volume group, $OCF_RESKEY_vg_name"
-
-	if ! vgchange -aey $OCF_RESKEY_vg_name; then
-		ocf_log err "Failed to activate volume group, $OCF_RESKEY_vg_name"
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
-
-		if ! vgreduce --removemissing --force $OCF_RESKEY_vg_name; then
-			ocf_log err "Failed to make $OCF_RESKEY_vg_name consistent"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! vgchange -aey $OCF_RESKEY_vg_name; then
-			ocf_log err "Failed second attempt to activate $OCF_RESKEY_vg_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Second attempt to activate $OCF_RESKEY_vg_name successful"
-		return $OCF_SUCCESS
-	else
-		# The activation commands succeeded, but did they do anything?
-		# Make sure all the logical volumes are active
-		results=(`lvs -o name,attr --noheadings 2> /dev/null $OCF_RESKEY_vg_name`)
-		a=0
-		while [ ! -z ${results[$a]} ]; do
-			if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-				all_pvs=(`pvs --noheadings -o name 2> /dev/null`)
-				resilience=" --config devices{filter=["
-			        for i in ${all_pvs[*]}; do
-			                resilience=$resilience'"a|'$i'|",'
-        			done
-				resilience=$resilience"\"r|.*|\"]}"
-
-				vgchange -aey $OCF_RESKEY_vg_name $resilience
-				break
-			fi
-			a=$(($a + 2))
-		done
-
-		#  We need to check the LVs again if we made the command resilient
-		if [ ! -z $resilience ]; then
-			results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name $resilience 2> /dev/null`)
-			a=0
-			while [ ! -z ${results[$a]} ]; do
-				if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-		                        ocf_log err "Failed to activate $OCF_RESKEY_vg_name"
-                		        return $OCF_ERR_GENERIC
-                		fi
-				a=$(($a + 2))
-			done
-			ocf_log err "Orphan storage device in $OCF_RESKEY_vg_name slowing operations"
-		fi
-	fi
-
-	return $OCF_SUCCESS
-}
-
-function vg_start_single
-{
-	local a
-	local results
-	local all_pvs
-	local resilience
-
-	ocf_log info "Starting volume group, $OCF_RESKEY_vg_name"
-
-	vg_owner
-	case $? in
-	0)
-		ocf_log info "Someone else owns this volume group"
-		return $OCF_ERR_GENERIC
-		;;
-	1)
-		ocf_log info "I own this volume group"
-		;;
-	2)
-		ocf_log info "I can claim this volume group"
-		;;
-	esac
-
-	if ! strip_and_add_tag ||
-	   ! vgchange -ay $OCF_RESKEY_vg_name; then
-		ocf_log err "Failed to activate volume group, $OCF_RESKEY_vg_name"
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
-
-		if ! vgreduce --removemissing --force --config \
-			"activation { volume_list = \"$OCF_RESKEY_vg_name\" }" \
-			$OCF_RESKEY_vg_name; then
-
-			ocf_log err "Failed to make $OCF_RESKEY_vg_name consistent"
-			return $OCF_ERR_GENERIC
-		fi
-
-		vg_owner
-		if [ $? -eq 0 ]; then
-			ocf_log err "Unable to claim ownership of $OCF_RESKEY_vg_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! strip_and_add_tag ||
-		   ! vgchange -ay $OCF_RESKEY_vg_name; then
-			ocf_log err "Failed second attempt to activate $OCF_RESKEY_vg_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Second attempt to activate $OCF_RESKEY_vg_name successful"
-		return $OCF_SUCCESS
-	else
-		# The activation commands succeeded, but did they do anything?
-		# Make sure all the logical volumes are active
-		results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name 2> /dev/null`)
-		a=0
-		while [ ! -z ${results[$a]} ]; do
-			if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-				all_pvs=(`pvs --noheadings -o name 2> /dev/null`)
-				resilience=" --config devices{filter=["
-			        for i in ${all_pvs[*]}; do
-			                resilience=$resilience'"a|'$i'|",'
-        			done
-				resilience=$resilience"\"r|.*|\"]}"
-
-				vgchange -ay $OCF_RESKEY_vg_name $resilience
-				break
-			fi
-			a=$(($a + 2))
-		done
-
-		#  We need to check the LVs again if we made the command resilient
-		if [ ! -z $resilience ]; then
-			results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name $resilience 2> /dev/null`)
-			a=0
-			while [ ! -z ${results[$a]} ]; do
-				if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-		                        ocf_log err "Failed to activate $OCF_RESKEY_vg_name"
-                		        return $OCF_ERR_GENERIC
-                		fi
-				a=$(($a + 2))
-			done
-			ocf_log err "Orphan storage device in $OCF_RESKEY_vg_name slowing operations"
-		fi
-	fi
-
-	return $OCF_SUCCESS
-}
-
-##
-# Main start function for volume groups
-##
-function vg_start
-{
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		vg_start_clustered
-	else
-		vg_start_single
-	fi
-}
-
-function vg_stop_clustered
-{
-	local a
-	local results
-	typeset self_fence=""
-
-	case ${OCF_RESKEY_self_fence} in
-		"yes")          self_fence=1 ;;
-		1)              self_fence=1 ;;
-		*)              self_fence="" ;;
-	esac
-
-	#  Shut down the volume group
-	#  Do we need to make this resilient?
-	vgchange -aln $OCF_RESKEY_vg_name
-
-	#  Make sure all the logical volumes are inactive
-	results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name 2> /dev/null`)
-	a=0
-	while [ ! -z ${results[$a]} ]; do
-		if [[ ${results[$(($a + 1))]} =~ ....a. ]]; then
-			if [ "$self_fence" ]; then
-				ocf_log err "Unable to deactivate $lv_path REBOOT"
-				sync
-				reboot -fn
-			else
-				ocf_log err "Logical volume $OCF_RESKEY_vg_name/${results[$a]} failed to shutdown"
-			fi
-			return $OCF_ERR_GENERIC
-		fi
-		a=$(($a + 2))
-	done
-
-	return $OCF_SUCCESS
-}
-
-function vg_stop_single
-{
-	local a
-	local results
-	typeset self_fence=""
-
-	case ${OCF_RESKEY_self_fence} in
-		"yes")          self_fence=1 ;;
-		1)              self_fence=1 ;;
-		*)              self_fence="" ;;
-	esac
-
-	#  Shut down the volume group
-	#  Do we need to make this resilient?
-	vgchange -an $OCF_RESKEY_vg_name
-
-	#  Make sure all the logical volumes are inactive
-	results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name 2> /dev/null`)
-	a=0
-	while [ ! -z ${results[$a]} ]; do
-		if [[ ${results[$(($a + 1))]} =~ ....a. ]]; then
-			if [ "$self_fence" ]; then
-				ocf_log err "Unable to deactivate $lv_path REBOOT"
-				sync
-				reboot -fn
-			else
-				ocf_log err "Logical volume $OCF_RESKEY_vg_name/${results[$a]} failed to shutdown"
-			fi
-			return $OCF_ERR_GENERIC
-		fi
-		a=$(($a + 2))
-	done
-
-	#  Make sure we are the owner before we strip the tags
-	vg_owner
-	if [ $? -ne 0 ]; then
-		strip_tags
-	fi
-
-	return $OCF_SUCCESS
-}
-
-##
-# Main stop function for volume groups
-##
-function vg_stop
-{
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		vg_stop_clustered
-	else
-		vg_stop_single
-	fi
-}
diff --git a/rgmanager/src/resources/mysql.metadata b/rgmanager/src/resources/mysql.metadata
deleted file mode 100644
index 7c87a57..0000000
--- a/rgmanager/src/resources/mysql.metadata
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="mysql">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of MySQL database server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a MySQL database server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Define a name 
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Define configuration file
-            </shortdesc>
-	    <content type="string" default="/etc/my.cnf"/>
-        </parameter>
-
-        <parameter name="listen_address">
-            <longdesc lang="en">
-		Define an IP address for MySQL
-            </longdesc>
-            <shortdesc lang="en">
-		Define an IP address for MySQL server. If the address
-		is not given then first IP address from the service is taken.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-	<parameter name="mysqld_options">
-		<longdesc lang="en">
-			Other command-line options for mysqld
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for mysqld
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="startup_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service startup
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service startup
-		</shortdesc>
-		<content type="number" default="30" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/mysql.sh b/rgmanager/src/resources/mysql.sh
deleted file mode 100644
index 8b244ec..0000000
--- a/rgmanager/src/resources/mysql.sh
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare MYSQL_MYSQLD=/usr/bin/mysqld_safe
-declare MYSQL_ipAddress
-declare MYSQL_pid_file="`generate_name_for_pid_file`"
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$MYSQL_pid_file" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid name of PID file"
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-	return 0
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	check_pid_file "$MYSQL_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$MYSQL_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ -n "$OCF_RESKEY_listen_address" ]; then
-		MYSQL_ipAddress="$OCF_RESKEY_listen_address"
-	else
-		clog_looking_for $CLOG_INIT "IP Address"
-
-	        get_service_ip_keys "$OCF_RESKEY_service_name"
-	        ip_addresses=`build_ip_list`
-
-		if [ -n "$ip_addresses" ]; then
-			for i in $ip_addresses; do
-				MYSQL_ipAddress="$i"
-				break;
-			done
-		else
-			clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Address"
-		fi
-	fi
-
-	clog_looking_for $CLOG_SUCCEED "IP Address"
-
-	$MYSQL_MYSQLD --defaults-file="$OCF_RESKEY_config_file" \
-		--pid-file="$MYSQL_pid_file" \
-		--bind-address="$MYSQL_ipAddress" \
-		$OCF_RESKEY_mysqld_options > /dev/null 2>&1 &
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	declare i=$OCF_RESKEY_startup_wait
-	while [ "$i" -gt 0 ]; do
-		if [ -f "$MYSQL_pid_file" ]; then
-			break;			
-		fi
-		sleep 1
-		let i=$i-1
-        done
-
-        if [ "$i" -eq 0 ]; then
-		clog_service_start $CLOG_FAILED_TIMEOUT
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$MYSQL_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$MYSQL_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$MYSQL_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/named.metadata b/rgmanager/src/resources/named.metadata
deleted file mode 100644
index 64442b1..0000000
--- a/rgmanager/src/resources/named.metadata
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="named">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of DNS named server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an instance of named server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/named.conf"/>
-        </parameter>
-
-        <parameter name="named_sdb">
-            <longdesc lang="en">
-		Simplified Database Backend
-            </longdesc>
-            <shortdesc lang="en">
-		Simplified Database Backend
-            </shortdesc>
-	    <content type="boolean" default="0"/>
-        </parameter>
-
-	<parameter name="named_working_dir">
-		<longdesc lang="en">
-			Other command-line options for named
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for named
-		</shortdesc>
-		<content type="string" default="/var/named" />
-	</parameter>
-
-	<parameter name="named_options">
-		<longdesc lang="en">
-			Other command-line options for named
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for named
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" default="5" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/named.sh b/rgmanager/src/resources/named.sh
deleted file mode 100644
index c8f65bb..0000000
--- a/rgmanager/src/resources/named.sh
+++ /dev/null
@@ -1,193 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare NAMED_NAMED=/usr/sbin/named
-declare NAMED_pid_file="`generate_name_for_pid_file`"
-declare NAMED_conf_dir="`generate_name_for_conf_dir`"
-declare NAMED_gen_config_file="$NAMED_conf_dir/named.conf"
-declare NAMED_url_list
-declare NAMED_parse_config=$(dirname $0)/utils/named-parse-config.pl
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_address="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	generate_configTemplate "$generated_file" "$1"
-	cat "$original_file" | grep -v "^[[:space:]]*listen-on" | \
-		grep -v "^[[:space:]]*pid-file" | \
-		grep -v "^[[:space:]]*directory" >> "$generated_file"
-
-	declare tmp_file=`mktemp -t cluster.XXXXXXXXXX`
-	mv "$generated_file" "$tmp_file"
-
-	"$NAMED_parse_config" "$OCF_RESKEY_named_working_dir" "$NAMED_pid_file" "$ip_address" \
-		 < "$tmp_file" > "$generated_file"
-
-	rm "$tmp_file"	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-
-	return 0;
-}
-
-start()
-{
-	declare ip_list;
-	
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$NAMED_conf_dir"
-	check_pid_file "$NAMED_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$NAMED_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	ip_list=`echo $ip_addresses | sed 's/ /;/;s/\([[:digit:]]\)$/\1;/' `
-
-	if [ -z "$ip_list" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-
-	generate_config_file "$OCF_RESKEY_config_file" "$NAMED_gen_config_file" "$ip_list"
-
-	$NAMED_NAMED -c "$NAMED_gen_config_file" $OCF_RESKEY_named_options
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$NAMED_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$NAMED_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$NAMED_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
deleted file mode 100644
index 53eab98..0000000
--- a/rgmanager/src/resources/netfs.sh
+++ /dev/null
@@ -1,376 +0,0 @@
-#!/bin/bash
-
-#
-# NFS/CIFS file system mount/umount/etc. agent
-#
-
-. $(dirname $0)/utils/fs-lib.sh
-
-do_metadata()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="netfs" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an NFS/CIFS mount for use by cluster services.
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an NFS/CIFS file system mount.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Symbolic name for this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                File System Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="mountpoint" unique="1" required="1">
-	    <longdesc lang="en">
-	        Path in file system heirarchy to mount this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Mount Point
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="host" required="1">
-	    <longdesc lang="en">
-	    	Server IP address or hostname
-	    </longdesc>
-            <shortdesc lang="en">
-	    	IP or Host
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="export" required="1">
-	    <longdesc lang="en">
-	    	NFS Export directory name or CIFS share
-	    </longdesc>
-            <shortdesc lang="en">
-	    	Export
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fstype" required="0">
-	    <longdesc lang="en">
-	    	File System type (nfs, nfs4 or cifs)
-	    </longdesc>
-            <shortdesc lang="en">
-	    	File System Type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="no_unmount" required="0">
-	    <longdesc lang="en">
-	    	Do not unmount the filesystem during a stop or relocation operation
-	    </longdesc>
-            <shortdesc lang="en">
-	    	Skip unmount opration
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="force_unmount">
-            <longdesc lang="en">
-                If set, the cluster will kill all processes using 
-                this file system when the resource group is 
-                stopped.  Otherwise, the unmount will fail, and
-                the resource group will be restarted.
-            </longdesc>
-            <shortdesc lang="en">
-                Force Unmount
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">
-	    	Provides a list of mount options.  If none are specified,
-		the NFS file system is mounted -o sync.
-            </longdesc>
-            <shortdesc lang="en">
-                Mount Options
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="30"/>
-	<!-- Recovery isn't possible; we don't know if resources are using
-	     the file system. -->
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<!-- Checks to see if we can write to the mountpoint (if !ROFS) -->
-	<action name="status" depth="20" timeout="30" interval="10m"/>
-	<action name="monitor" depth="20" timeout="30" interval="10m"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-        <child type="nfsexport" forbid="1"/>
-        <child type="nfsclient" forbid="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_host()
-{
-	if [ -z "$OCF_RESKEY_host" ]; then
-	       ocf_log err "No server hostname or IP address specified."
-	       return 1
-	fi
-
-	host $OCF_RESKEY_host 2>&1 | grep -vq "not found"
-	if [ $? -eq 0 ]; then
-		return 0
-	fi
-
-	ocf_log err "Hostname or IP address \"$OCF_RESKEY_host\" not valid"
-
-	return $OCF_ERR_ARGS
-}
-
-
-verify_fstype()
-{
-	# Auto detect?
-	[ -z "$OCF_RESKEY_fstype" ] && return 0
-
-	case $OCF_RESKEY_fstype in
-	nfs|nfs4|cifs)
-		return 0
-		;;
-	*)
-		ocf_log err "File system type $OCF_RESKEY_fstype not supported"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-}
-
-
-verify_options()
-{
-	declare -i ret=0
-
-	#
-	# From mount(1)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		async|atime|auto|defaults|dev|exec|_netdev|noatime)
-			continue
-			;;
-		noauto|nodev|noexec|nosuid|nouser|ro|rw|suid|sync)
-			continue
-			;;
-		dirsync|user|users)
-			continue
-			;;
-		esac
-
-		case $OCF_RESKEY_fstype in
-		cifs)
-			continue
-			;;
-		nfs|nfs4)
-			case $o in
-			#
-			# NFS / NFS4 common
-			#
-			rsize=*|wsize=*|timeo=*|retrans=*|acregmin=*)
-				continue
-				;;
-			acregmax=*|acdirmin=*|acdirmax=*|actimeo=*)
-				continue
-				;;
-			retry=*|port=*|bg|fg|soft|hard|intr|cto|ac|noac)
-				continue
-				;;
-			esac
-
-			#
-			# NFS v2/v3 only
-			#
-			if [ "$OCF_RESKEY_fstype" = "nfs" ]; then
-				case $o in
-				mountport=*|mounthost=*)
-					continue
-					;;
-				mountprog=*|mountvers=*|nfsprog=*|nfsvers=*)
-					continue
-					;;
-				namelen=*)
-					continue
-					;;
-				tcp|udp|lock|nolock)
-					continue
-					;;
-				esac
-			fi
-
-			#
-			# NFS4 only
-			#
-			if [ "$OCF_RESKEY_fstype" = "nfs4" ]; then
-				case $o in
-				proto=*|clientaddr=*|sec=*)
-					continue
-					;;
-				esac
-			fi
-
-			;;
-		esac
-
-		ocf_log err "Option $o not supported for $OCF_RESKEY_fstype"
-		ret=$OCF_ERR_ARGS
-	done
-
-	return $ret
-}
-
-
-do_validate()
-{
-	verify_name || return $OCF_ERR_ARGS
-	verify_fstype|| return $OCF_ERR_ARGS
-	verify_host || return $OCF_ERR_ARGS
-	verify_mountpoint || return $OCF_ERR_ARGS
-	verify_options || return $OCF_ERR_ARGS
-	# verify_target || return $OCF_ERR_ARGS
-}
-
-
-#
-# Override real_device to use fs-lib's functions for start/stop_filesystem
-#
-real_device() {
-	export REAL_DEVICE="$1"
-}
-
-
-#
-# do_mount - nfs / cifs are mounted differently than blockdevs
-#
-do_mount() {
-	declare opts=""
-	declare mount_options=""
-	declare ret_val
-	declare mp="$OCF_RESKEY_mountpoint"
-
-	#
-	# Get the filesystem type, if specified.
-	#
-	fstype_option=""
-	fstype=${OCF_RESKEY_fstype}
-		case "$fstype" in
-	""|"[ 	]*")
-		fstype=""
-		;;
-	*)	# found it
-		fstype_option="-t $fstype"
-		;;
-	esac
-
-	#
-	# Get the mount options, if they exist.
-	#
-	mount_options=""
-	opts=${OCF_RESKEY_options}
-	case "$opts" in 
-	""|"[ 	]*")
-		opts=""
-		;;
-	*)	# found it
-		mount_options="-o $opts"
-		;;
-	esac
-
-        case $OCF_RESKEY_fstype in
-	nfs|nfs4)
-		mount -t $OCF_RESKEY_fstype $mount_options $OCF_RESKEY_host:"$OCF_RESKEY_export" "$mp"
-		;;
-	cifs)
-		mount -t $OCF_RESKEY_fstype $mount_options //$OCF_RESKEY_host/"$OCF_RESKEY_export" "$mp"
-		;;
-	esac
-
-	ret_val=$?
-	if [ $ret_val -ne 0 ]; then
-		ocf_log err "\
-'mount $fstype_option $mount_options $OCF_RESKEY_host:$OCF_RESKEY_export $mp' failed, error=$ret_val"
-		return 1
-	fi
-	
-	return 0
-}
-
-
-do_force_unmount() {
-        case $OCF_RESKEY_fstype in
-	nfs|nfs4)
-		ocf_log warning "Calling 'umount -f $mp'"
-		umount -f "$OCF_RESKEY_mountpoint"
-		;;
-	*)
-		;;
-	esac
-
-	return 0	# Returning 0 lets stop_filesystem do add'l checks
-}
-
-
-populate_defaults()
-{
-	if [ -z "$OCF_RESKEY_fstype" ]; then
-		export OCF_RESKEY_fstype=nfs
-	fi
-
-
-        case $OCF_RESKEY_fstype in
-	nfs|nfs4)
-		export OCF_RESKEY_device="$OCF_RESKEY_host:$OCF_RESKEY_export"
-		if [ -z "$OCF_RESKEY_options" ]; then
-			export OCF_RESKEY_options=sync,soft,noac
-		fi
-		;;
-	cifs)
-		export OCF_RESKEY_device="//$OCF_RESKEY_host/$OCF_RESKEY_export"
-		if [ -z "$OCF_RESKEY_options" ]; then
-			export OCF_RESKEY_options=guest
-		fi
-		;;
-	esac
-}
-
-
-#
-# Main...
-#
-populate_defaults
-main $*
diff --git a/rgmanager/src/resources/nfsclient.sh b/rgmanager/src/resources/nfsclient.sh
deleted file mode 100644
index 0437d32..0000000
--- a/rgmanager/src/resources/nfsclient.sh
+++ /dev/null
@@ -1,445 +0,0 @@
-#!/bin/bash
-
-#
-# NFS Export Client handler agent script
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent version="rgmanager 2.0" name="nfsclient">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines how a machine or group of machines may access
-        an NFS export on the cluster.  IP addresses, IP wildcards,
-	hostnames, hostname wildcards, and netgroups are supported.
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an NFS client.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                This is a symbolic name of a client used to reference
-                it in the resource tree.  This is NOT the same thing
-                as the target option.
-            </longdesc>
-            <shortdesc lang="en">
-                Client Name
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="target" required="1">
-            <longdesc lang="en">
-                This is either a hostname, a wildcard (IP address or
-                hostname based), or a netgroup to which defining a
-                host or hosts to export to.
-            </longdesc>
-            <shortdesc lang="en">
-                Target Hostname, Wildcard, or Netgroup
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="path" inherit="path">
-            <longdesc lang="en">
-                This is the path to export to the target.  This
-                field is generally left blank, as it inherits the
-                path from the parent export.
-            </longdesc>
-            <shortdesc lang="en">
-                Path to Export
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="svcname" inherit="service%name">
-            <longdesc lang="en">
-            </longdesc>
-            <shortdesc lang="en">
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-
-        <parameter name="fsid" inherit="fsid">
-            <longdesc lang="en">
-	    	File system ID inherited from the parent nfsexport/
-		clusterfs/fs resource.  Putting fsid in the options
-		field will override this.
-            </longdesc>
-            <shortdesc lang="en">
-	    	File system ID
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">Defines a list of options for this
-                particular client.  See 'man 5 exports' for a list
-                of available options.
-            </longdesc>
-            <shortdesc lang="en">
-                Export Options
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="allow_recover">
-            <longdesc lang="en">
-		Allows recovery of this NFS client (default = 1) if it
-		disappears from the export list.  If set to 0, the service
-		will be restarted.  This is useful to help preserve export
-		ordering.
-            </longdesc>
-            <shortdesc lang="en">
-		Allow recovery
-            </shortdesc>
-            <content type="boolean"/>
-        </parameter>
-
-	<parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-		Service this NFS export belongs to.  Used for caching
-		exports on a per-service basis.
-            </longdesc>
-            <shortdesc lang="en">
-                Service Name
-            </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="use_cache" inherit="service%nfs_client_cache">
-            <longdesc lang="en">
-	   	On systems with large numbers of exports, a performance
-		problem in the exportfs command can cause inordinately long
-		status check times for services with lots of mounted
-		NFS clients.  This occurs because exportfs does DNS queries
-		on all clients in the export list.
-
-		Setting this option to '1' will enable caching of the export
-		list returned from the exportfs command on a per-service
-		basis.  The cache will last for 30 seconds before expiring
-		instead of being generated each time an nfsclient resource
-		is called.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Enable exportfs list caching
-            </shortdesc>
-	    <content type="integer"/>
-	</parameter>
-
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="90"/>
-        <action name="stop" timeout="5"/>
-        <action name="recover" timeout="90"/>
-
-	<!-- Checks to see if the export exists in /var/lib/nfs/etab -->
-        <action name="status" timeout="5" interval="1m"/>
-        <action name="monitor" timeout="5" interval="1m"/>
-
-        <action name="meta-data" timeout="5"/>
-        <action name="validate-all" timeout="30"/>
-    </actions>
-
-</resource-agent>
-EOT
-}
-
-
-verify_options()
-{
-	declare o
-	declare -i ret=0
-
-	[ -z "$OCF_RESKEY_options" ] && return 0
-	
-	#
-	# From exports(5)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		fsid=*)
-			ocf_log debug "Using designated $o instead of fsid=$OCF_RESKEY_fsid"
-			unset OCF_RESKEY_fsid
-			;;
-		secure)
-			;;
-		insecure)
-			;;
-
-		rw)
-			;;
-		ro)
-			;;
-		async)
-			;;
-		sync)
-			;;
-		wdelay)
-			;;
-		no_wdelay)
-			;;
-		hide)
-			;;
-		nohide)
-			;;
-		subtree_check)
-			;;
-		no_subtree_check)
-			;;
-		secure_locks)
-			;;
-		insecure_locks)
-			;;
-		auth_nlm)
-			;;
-		no_auth_nlm)
-			;;
-		mountpoint=*)
-			;;
-		mp=*)
-			;;
-		root_squash)
-			;;
-		no_root_squash)
-			;;
-		all_squash)
-			;;
-		no_all_squash)
-			;;
-		anonuid=*)
-			;;
-		anongid=*)
-			;;
-		*)
-			ocf_log err "Export Option $o invalid"
-			ret=$OCF_ERR_ARGS
-			;;
-		esac
-	done
-
-	return $ret
-}
-
-
-verify_target()
-{
-	# XXX need to add wildcards, hostname, ip, etc.
-	[ -n "$OCF_RESKEY_target" ] && return 0
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_path()
-{
-	if [ -z "$OCF_RESKEY_path" ]; then
-		ocf_log err "No export path specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-
-	ocf_log err "$OCF_RESKEY_path is not a directory"
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_type()
-{
-	[ -z "$OCF_RESKEY_type" ] && return 0
-	[ "$OCF_RESKEY_type" = "nfs" ] && return 0
-
-	ocf_log err "Export type $OCF_RESKEY_type not supported yet"
-	return $OCF_ERR_ARGS
-}
-
-
-verify_all()
-{
-	declare -i ret=0
-
-	verify_type || ret=$OCF_ERR_ARGS
-	verify_options || ret=$OCF_ERR_ARGS
-	verify_target || ret=$OCF_ERR_ARGS
-	verify_path || ret=$OCF_ERR_ARGS
-
-	return $ret
-}
-
-
-case $1 in
-start)
-	declare option_str
-
-	verify_all || exit $OCF_ERR_ARGS
-
-	#
-	# XXX
-	# Bad: Side-effect of verify_options: unset OCF_RESKEY_fsid if
-	# fsid is specified in the options string.
-	#
-	if [ -z "$OCF_RESKEY_options" ] && [ -n "$OCF_RESKEY_fsid" ]; then
-		option_str="fsid=$OCF_RESKEY_fsid"
-	elif [ -n "$OCF_RESKEY_options" ] && [ -z "$OCF_RESKEY_fsid" ]; then
-		option_str="$OCF_RESKEY_options"
-	elif [ -n "$OCF_RESKEY_fsid" ] && [ -n "$OCF_RESKEY_options" ]; then
-		option_str="fsid=$OCF_RESKEY_fsid,$OCF_RESKEY_options"
-	fi
-
-	if [ -z "$option_str" ]; then
-		ocf_log info "Adding export: ${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-		exportfs -i "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-		rv=$?
-	else
-		ocf_log info "Adding export: ${OCF_RESKEY_target}:${OCF_RESKEY_path} ($option_str)"
-		exportfs -i -o $option_str "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-		rv=$?
-	fi
-	;;
-
-stop)
-	verify_all || exit $OCF_ERR_ARGS
-
-	ocf_log info "Removing export: ${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-	exportfs -u "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-	rv=$?
-	;;
-
-status|monitor)
-	verify_all || exit $OCF_ERR_ARGS
-
-	if [ "${OCF_RESKEY_target}" = "*" ]; then
-		export OCF_RESKEY_target="\<world\>"
-	fi
-
-	#
-	# Status check fix from Birger Wathne:
-	# * Exports longer than 14 chars have line breaks inserted, which
-	#   broke the way the status check worked.
-	#
-        # Status check fix from Craig Lewis: 
-        # * Exports with RegExp metacharacters need to be escaped. 
-        #   These metacharacters are: * ? . 
-        # 
-	export OCF_RESKEY_target_regexp=$(echo $OCF_RESKEY_target | \
-		sed -e 's/*/[*]/g' -e 's/?/[?]/g' -e 's/\./\\./g') 
-
-	declare tmpfn
-	declare time_created time_now
-	declare -i delta=0
-
-	#
-	# Don't let anyone read the cache files.
-	#
-	umask 066
-
-	mkdir -p /var/cache/cluster
-
-	if [ -n "$OCF_RESKEY_service_name" ] && [ "$OCF_RESKEY_use_cache" = "1" ]; then
-
-		#
-		# For large #s of exports, we need to cache the information
-		#
-		tmpfn=/var/cache/cluster/nfsclient-status-cache-$OCF_RESKEY_service_name
-
-		if [ -f "$tmpfn" ]; then
-			time_created=$(stat -c "%Y" $tmpfn)
-			time_now=$(date +"%s")
-			delta=$((time_now-time_created))
-		fi
-		#echo "Cache age = $delta seconds"
-	else
-		delta=100
-		#
-		# Create a different file if this is a separate instance
-		#
-		tmpfn=/var/cache/cluster/nfsclient-status-cache-$$
-	fi
-
-	if ! [ -f "$tmpfn" ] || [ $delta -gt 30 ]; then
-		#echo "Create $tmpfn. Nonexistent / expired / no service name"
-		exportfs -v > $tmpfn
-	fi
-
-        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -iq \
-		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_regexp}" 
-	rv=$? 
-
-	if [ $rv -eq 0 ]; then
-		[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
-		exit 0
-	fi
-
-	declare OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target")
-	if [ $? -ne 0 ]; then
-		[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
-		ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
-		exit 1
-	fi
-
-        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
-		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_tmp}" 
-	rv=$? 
-
-	[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
-	if [ $rv -eq 0 ]; then
-		exit 0
-	fi
-
-	ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
-	exit 1
-	;;
-
-recover)
-	if [ "$OCF_RESKEY_allow_recover" = "0" ] || \
-	   [ "$OCF_RESKEY_allow_recover" = "no" ] || \
-	   [ "$OCF_RESKEY_allow_recover" = "false" ]; then
-		exit 1
-	fi
-
-	$0 stop || exit 1
-	$0 start || exit 1
-	;;
-
-restart)
-	#
-	# Recover might better be "exportfs -r" - reexport
-	#
-	$0 stop || exit 1
-	$0 start || exit 1
-	;;
-
-meta-data)
-	meta_data
-	exit 0
-	;;
-
-validate-all)
-	verify_all
-	rv=$?
-	;;
-
-*)
-	echo "usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-	rv=$OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit $rv
diff --git a/rgmanager/src/resources/nfsexport.sh b/rgmanager/src/resources/nfsexport.sh
deleted file mode 100644
index b013a5e..0000000
--- a/rgmanager/src/resources/nfsexport.sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/bin/bash
-
-#
-# NFS Export Script.  Handles starting/stopping clurmtabd and doing
-# the strange NFS stuff to get it to fail over properly.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-
-rmtabpid=""
-nfsop_arg=""
-rv=0
-
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="nfsexport" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an NFS export path.  Generally, these are
-        defined inline and implicitly; you should not have to 
-        configure one of these.  All of the relevant information
-        is inherited from the parent.
-    </longdesc>
-
-    <shortdesc lang="en">
-        This defines an NFS export.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                Descriptive name for this export.  Generally, only
-                one export is ever defined, and it's called "generic
-                nfs export".
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="device" inherit="device">
-            <longdesc lang="en">
-                If you can see this, your GUI is broken.
-            </longdesc>
-            <shortdesc lang="en">
-                If you can see this, your GUI is broken.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="path" inherit="mountpoint">
-            <longdesc lang="en">
-                If you can see this, your GUI is broken.
-            </longdesc>
-            <shortdesc lang="en">
-                If you can see this, your GUI is broken.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fsid" inherit="fsid">
-            <longdesc lang="en">
-                If you can see this, your GUI is broken.
-            </longdesc>
-            <shortdesc lang="en">
-                If you can see this, your GUI is broken.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-	<action name="stop" timeout="5"/>
-	<action name="recover" timeout="5"/>
-
-	<!-- NFS Exports really don't do anything except provide a path
-	     for nfs clients.  So, status and monitor are no-ops -->
-	<action name="status" timeout="5" interval="1h"/>
-	<action name="monitor" timeout="5" interval="1h"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="30"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<child type="nfsexport" forbid="1"/>
-	<child type="nfsclient"/>
-    </special>
-
-</resource-agent>
-EOT
-}
-
-
-verify_device()
-{
-	if [ -z "$OCF_RESKEY_device" ]; then
-	       ocf_log err "No device or label specified."
-	       return $OCF_ERR_ARGS
-	fi
-
-	[ -b "$OCF_RESKEY_device" ] && return 0
-	[ -b "`findfs $OCF_RESKEY_device`" ] && return 0
-
-	ocf_log err "Device or label \"$OCF_RESKEY_device\" not valid"
-
-	return $OCF_ERR_ARGS
-}
-
-
-verify_path()
-{
-	if [ -z "$OCF_RESKEY_path" ]; then
-		ocf_log err "No export path specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-
-	ocf_log err "$OCF_RESKEY_path is not a directory"
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_all()
-{
-	declare -i ret=0
-
-	verify_device || ret=$OCF_ERR_ARGS
-	verify_path || ret=$OCF_ERR_ARGS
-
-	return $ret
-}
-
-
-#
-# Check if the NFS daemons are running.
-#
-nfs_daemons_running()
-{
-    declare NFS_DAEMONS="nfsd rpc.mountd rpc.statd"
-
-    for daemon in $NFS_DAEMONS; do
-        ps -ef | grep "$daemon" | grep -v grep >/dev/null 2>&1
-        if [ $? -ne 0 ]; then
-	    ocf_log err \
-            "NFS daemon $daemon is not running."
-	    ocf_log err \
-            "Verify that the NFS service run level script is enabled."
-            return 1
-        fi
-    done
-
-    return 0
-}
-
-
-nfs_check()
-{
-	declare junk
-
-	if nfs_daemons_running; then
-		return 0
-	fi
-
-	#
-	# Don't restart daemons during status check.
-	#
-	if [ "$1" = "status" ]; then
-		return 1;
-	fi
-		
-  	ocf_log err "Restarting NFS daemons"
-	# Note restart does less than stop/start
-	junk=$(/sbin/service nfslock stop)
-	junk=$(/sbin/service nfslock start)
-	junk=$(/sbin/service nfs stop)
-	junk=$(/sbin/service nfs start)
-	sleep 2
-	
-	if ! nfs_daemons_running; then
-		ocf_log err "Failed restarting NFS daemons"
-    		return 1
-	fi
-	ocf_log notice "Successfully restarted NFS daemons"
-}
-
-
-case $1 in
-start)
-	nfs_check start || exit 1
-	rv=0
-	;;
-
-status|monitor)
-	nfs_check status || exit 1
-	rv=0
-	;;
-		    
-stop)
-	nfs_check restart || exit 1
-	rv=0
-	;;
-
-recover|restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	rv=0
-	;;
-
-meta-data)
-	meta_data
-	rv=0
-	;;
-
-validate-all)
-	verify_all
-	rv=$?
-	;;
-*)
-	echo "usage: $0 {start|status|monitor|stop|recover|restart|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit $rv
diff --git a/rgmanager/src/resources/nfsserver.sh b/rgmanager/src/resources/nfsserver.sh
deleted file mode 100644
index f7b6b7a..0000000
--- a/rgmanager/src/resources/nfsserver.sh
+++ /dev/null
@@ -1,499 +0,0 @@
-#!/bin/bash
-
-#
-# NFS Server Script.  Handles starting/stopping Servand doing
-# the strange NFS stuff to get it to fail over properly.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-V4RECOVERY="/var/lib/nfs/v4recovery"
-PROC_V4RECOVERY="/proc/fs/nfsd/nfsv4recoverydir"
-
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-# SELinux information
-which restorecon &> /dev/null && selinuxenabled
-export SELINUX_ENABLED=$?
-if [ $SELINUX_ENABLED ]; then
-	export SELINUX_LABEL="$(ls -ldZ /var/lib/nfs/statd | cut -f4 -d' ')"
-fi
-
-
-log_do()
-{
-	ocf_log debug $*
-	$* &> /dev/null
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		ocf_log debug "Failed: $*"
-	fi
-	return $ret
-}
-
-
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="nfsserver" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an NFS server resource.  The NFS server
-	resource is useful for exporting NFSv4 file systems
-	to clients.  Because of the way NFSv4 works, only
-	one NFSv4 resource may exist on a server at a
-	time.  Additionally, it is not possible to use
-	the nfsserver resource when also using local instances
-	of NFS on each cluster node.
-    </longdesc>
-
-    <shortdesc lang="en">
-        This defines an NFS server resource.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                Descriptive name for this server.  Generally, only
-                one server is ever defined per service.
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="path" inherit="mountpoint">
-            <longdesc lang="en">
-	        This is the path you intend to export.  Usually, this is
-		left blank, and the mountpoint of the parent file system
-		is used.  This path is passed to nfsclient resources as
-		the export path when exportfs is called.
-            </longdesc>
-            <shortdesc lang="en">
-	    	This is the path you intend to export.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="nfspath">
-            <longdesc lang="en">
-	        This is the path containing shared NFS information which
-		is used for NFS recovery after a failover.  This
-		is relative to the export path, and defaults to
-		".clumanager/nfs".
-            </longdesc>
-            <shortdesc lang="en">
-	        This is the path containing shared NFS recovery
-		information, relative to the path parameter.
-            </shortdesc>
-	    <content type="string" default=".clumanager/nfs"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-	<action name="stop" timeout="5"/>
-	<action name="recover" timeout="5"/>
-
-	<action name="status" timeout="5" interval="30"/>
-	<action name="monitor" timeout="5" interval="30"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="30"/>
-    </actions>
-
-    <special tag="rgmanager">
-    	<attributes maxinstances="1"/>
-	<child type="nfsexport" forbid="1"/>
-	<child type="nfsserver" forbid="1"/>
-	<child type="nfsclient" start="1" stop="2"/>
-	<child type="ip" start="2" stop="1"/>
-    </special>
-
-</resource-agent>
-EOT
-}
-
-
-verify_path()
-{
-	if [ -z "$OCF_RESKEY_path" ]; then
-		ocf_log err "No server path specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-
-	ocf_log err "$OCF_RESKEY_path is not a directory"
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_nfspath()
-{
-	if [ -z "$OCF_RESKEY_nfspath" ]; then
-		echo No NFS data path specified.
-		return 1
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-	
-	# xxx do nothing for now.
-	return 0
-}
-
-
-verify_all()
-{
-	verify_path || return 1
-	verify_nfspath || return 1
-
-	return 0
-}
-
-
-nfs_daemons()
-{
-	declare oper
-	declare val
-
-	case $1 in
-	start)
-		ocf_log info "Starting NFS daemons"
-		/etc/init.d/nfs start
-		if [ $? -ne 0 ]; then
-			ocf_log err "Failed to start NFS daemons"
-			return 1
-		fi
-
-		ocf_log debug "NFS daemons are running"
-		return 0
-		;;
-	stop)
-		ocf_log info "Stopping NFS daemons"
-		if ! /etc/init.d/nfs stop; then
-			ocf_log err "Failed to stop NFS daemons"
-			return 1
-		fi
-
-		ocf_log debug "NFS daemons are stopped"
-
-		return 0
-		;;
-	status|monitor)
-		declare recoverydir="$OCF_RESKEY_path/$OCF_RESKEY_nfspath/v4recovery"
-		val=$(cat $PROC_V4RECOVERY)
-
-		[ "$val" = "$recoverydir" ] || ocf_log warning \
-			"NFSv4 recovery directory is $val instead of $recoverydir"
-		/etc/init.d/nfs status
-		if [ $? -eq 0 ]; then
-			ocf_log debug "NFS daemons are running"
-			return 0
-		fi
-		return 1
-		;;
-	esac
-}
-
-
-create_tree()
-{
-	declare fp="$OCF_RESKEY_path/$OCF_RESKEY_nfspath"
-
-	[ -d "$fp" ] || mkdir -p "$fp"
-
-	[ -d "$fp/statd" ] || mkdir -p "$fp/statd"
-	[ -d "$fp/v4recovery" ] || mkdir -p "$fp/v4recovery"
-
-	#
-	# Create our own private copy which we use for notifies.
-	# This way, we can be sure to advertise on possibly multiple
-	# IP addresses.
-	#
-	[ -d "$fp/statd/sm" ] || mkdir -p "$fp/statd/sm"
-	[ -d "$fp/statd/sm.bak" ] || mkdir -p "$fp/statd/sm.bak"
-	[ -d "$fp/statd/sm-ha" ] || mkdir -p "$fp/statd/sm-ha"
-	[ -n "`id -u rpcuser`" -a "`id -g rpcuser`" ] && chown -R rpcuser.rpcuser "$fp/statd"
-
-	# Create if they don't exist
-	[ -f "$fp/etab" ] || touch "$fp/etab"
-	[ -f "$fp/xtab" ] || touch "$fp/xtab"
-	[ -f "$fp/rmtab" ] || touch "$fp/rmtab"
-
-	[ $SELINUX_ENABLED ] && chcon -R "$SELINUX_LABEL" "$fp"
-
-        #
-        # Generate a random state file.  If this ends up being what a client
-        # already has in its list, that's bad, but the chances of this
-        # are small - and relocations should be rare.
-        #
-        dd if=/dev/urandom of=$fp/state bs=1 count=4 &> /dev/null
-	[ -n "`id -u rpcuser`" -a "`id -g rpcuser`" ] && chown rpcuser.rpcuser "$fp/state"
-}
-
-setup_v4recovery()
-{
-	declare recoverydir="$OCF_RESKEY_path/$OCF_RESKEY_nfspath/v4recovery"
-
-	# mounts /proc/fs/nfsd for us
-	lsmod | grep -q nfsd
-	if [ $? -ne 0 ]; then
-		modprobe nfsd
-	fi
-
-	val=$(cat "$PROC_V4RECOVERY")
-
-	# Ensure start-after-start works
-	if [ "$val" = "$recoverydir" ]; then
-		return 0
-	fi
-
-	#
-	# If the value is not default, there may be another
-	# cluster service here already which has replaced
-	# the v4 recovery directory.  In that case,
-	# we must refuse to go any further.
-	#
-	if [ "$val" != "$V4RECOVERY" ]; then
-		ocf_log err "NFSv4 recovery directory has an unexpected value: $val"
-		return 1
-	fi
-
-	#
-	# Redirect nfs v4 recovery dir to shared storage
-	#
-	echo "$recoverydir" > "$PROC_V4RECOVERY"
-	if [ $? -ne 0 ]; then
-		echo "Uh oh... echo failed!?"
-	fi
-
-	val="$(cat $PROC_V4RECOVERY)"
-	if [ "$val" != "$recoverydir" ]; then
-		ocf_log err "Failed to change NFSv4 recovery path"
-		ocf_log err "Wanted: $recoverydir; got $val"
-		return 1
-	fi
-
-	return 0
-}
-
-
-cleanup_v4recovery()
-{
-	#
-	# Restore nfsv4 recovery directory to default
-	#
-	echo "$V4RECOVERY" > "$PROC_V4RECOVERY"
-	return $?
-}
-
-
-is_bound()
-{
-	mount | grep -q "$1 on $2 type none (.*bind.*)"
-	return $?
-}
-
-
-setup_tree()
-{
-	declare fp="$OCF_RESKEY_path/$OCF_RESKEY_nfspath"
-
-	if is_bound $fp/statd /var/lib/nfs/statd; then
-		ocf_log debug "$fp is already bound to /var/lib/nfs/statd"
-		return 0
-	fi
-
-	mount -o bind "$fp/statd" /var/lib/nfs/statd
-	cp -a "$fp"/*tab /var/lib/nfs
-	[ $SELINUX_ENABLED ] && restorecon /var/lib/nfs
-}
-
-
-cleanup_tree()
-{
-	declare fp="$OCF_RESKEY_path/$OCF_RESKEY_nfspath"
-
-	if is_bound "$fp/statd" /var/lib/nfs/statd; then
-		log_do umount /var/lib/nfs/statd || return 1
-	else
-		ocf_log debug "$fp is not bound to /var/lib/nfs/statd"
-	fi
-
-	cp -a /var/lib/nfs/*tab "$fp"
-
-	return 0
-}
-
-start_locking()
-{
-	declare ret
-	[ -x /sbin/rpc.statd ] || return 1
-	
-	#
-	# Synchronize these before starting statd
-	#
-	cp -f /var/lib/nfs/statd/sm-ha/* /var/lib/nfs/statd/sm 2> /dev/null
-	cp -f /var/lib/nfs/statd/sm/* /var/lib/nfs/statd/sm-ha 2> /dev/null
-
-	if pidof rpc.statd &> /dev/null; then
-		ocf_log debug "rpc.statd is already running"
-		return 0
-	fi
-
-	#
-	# Set this resrouce script as the callout program.  We are evil.
-	# In cases where we want to preserve lock information, this is needed
-	# because we can't do the "copy" that we do on the down-state...
-	#
-	ocf_log info "Starting rpc.statd"
-	rm -f /var/run/sm-notify.pid
-	rpc.statd -H $0 -d
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		ocf_log err "Failed to start rpc.statd"
-		return $ret
-	fi
-	touch /var/lock/subsys/nfslock
-	return $ret
-}
-
-
-terminate()
-{
-	declare pids
-	declare i=0
-
-	while : ; do
-		pids=$(pidof $1)
-		[ -z "$pids" ] && return 0
-	 	kill $pids
-		sleep 1
-		((i++))
-		[ $i -gt 3 ] && return 1
-	done
-}
-
-
-killkill()
-{
-	declare pids
-	declare i=0
-
-	while : ; do
-		pids=$(pidof $1)
-		[ -z "$pids" ] && return 0
-	 	kill -9 $pids
-		sleep 1
-		((i++))
-		[ $i -gt 3 ] && return 1
-	done
-}
-
-
-stop_locking()
-{
-	declare ret 
-
-	ocf_log info "Stopping rpc.statd"
-	if terminate rpc.statd; then
-		ocf_log debug "rpc.statd is stopped"
-	else
-		if killkill rpc.statd; then
-			ocf_log debug "rpc.statd is stopped"
-		else
-			ocf_log debug "Failed to stop rpc.statd"
-			return 1
-		fi
-	fi
-}
-
-
-case $1 in
-start)
-	# Check for and source configuration file
-	ocf_log info "Starting NFS Server $OCF_RESKEY_name"
-	create_tree || exit 1
-	setup_tree || exit 1
-	setup_v4recovery || exit 1
-
-	start_locking
-	nfs_daemons start
-	rv=$?
-	if [ $rv -eq 0 ]; then
-		ocf_log info "Started NFS Server $OCF_RESKEY_name"
-		exit 0
-	fi
-
-	ocf_log err "Failed to start NFS Server $OCF_RESKEY_name"
-	exit $rv
-	;;
-
-status|monitor)
-	nfs_daemons status 
-	exit $?
-	;;
-		    
-stop)
-	if ! nfs_daemons stop; then
-		ocf_log err "Failed to stop NFS Server $OCF_RESKEY_name"
-		exit $OCF_ERR_GENERIC
-	fi
-
-	# Copy the current notify list into our private area
-	ocf_log debug "Copying sm files for future notification..."
-	rm -f /var/lib/nfs/statd/sm-ha/* &> /dev/null
-	cp -f /var/lib/nfs/statd/sm/* /var/lib/nfs/statd/sm-ha &> /dev/null
-
-	stop_locking || exit 1
-	cleanup_v4recovery
-	cleanup_tree || exit 1
-	exit 0
-	;;
-
-add-client)
-	ocf_log debug "$0 $1 $2 $3"
-	touch /var/lib/nfs/statd/sm/$2
-	touch /var/lib/nfs/statd/sm-ha/$2
-	exit 0
-	;;
-
-del-client)
-	ocf_log debug "$0 $1 $2 $3"
-	touch /var/lib/nfs/statd/sm/$2
-	rm -f /var/lib/nfs/statd/sm-ha/$2
-	exit 0
-	;;
-
-recover|restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	exit 0
-	;;
-
-meta-data)
-	meta_data
-	exit 0
-	;;
-
-validate-all)
-	verify_all
-	exit $?
-	;;
-*)
-	echo "usage: $0 {start|stop|status|monitor|restart|recover|add-client|del-client|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit 0
diff --git a/rgmanager/src/resources/ocf-shellfuncs b/rgmanager/src/resources/ocf-shellfuncs
deleted file mode 100644
index f8226cb..0000000
--- a/rgmanager/src/resources/ocf-shellfuncs
+++ /dev/null
@@ -1,165 +0,0 @@
-#! /bin/bash
-#
-# 	$Id$
-#
-# 	Common helper functions for the OCF Resource Agents supplied by
-# 	heartbeat.
-
-
-# TODO: Some of this should probably split out into a generic OCF
-# library for shell scripts, but for the time being, we'll just use it
-# ourselves...
-#
-
-# TODO wish-list:
-# - Generic function for evaluating version numbers
-# - Generic function(s) to extract stuff from our own meta-data
-# - Logging function which automatically adds resource identifier etc
-#   prefixes
-# TODO: Move more common functionality for OCF RAs here.
-#
-__SCRIPT_NAME=`basename $0`
-
-# lhh - determine if we're a dumb terminal
-consoletype &> /dev/null
-if [ $? -eq 1 ]; then
-	__SERIAL="yes"
-fi
-
-__LOG_PID=$PPID
-__LOG_NAME=$(basename $(readlink /proc/$PPID/exe))
-
-pretty_echo() {
-	declare pretty
-	declare n=""
-        declare __OCF_PRIO="$1"
-        shift
-        declare __OCF_MSG="$*"
-
-	if [ -n "$__SERIAL" ]; then
-		echo "<$__OCF_PRIO> $__OCF_MSG"
-		return 0
-	fi
-
-	case $__OCF_PRIO in
-	emerg)		pretty="";;
-	alert)		pretty="";;
-        crit|critical)	pretty="";;
-        err|error)	pretty="";;
-        warn|warning)	pretty="";;
-	note|notice)	pretty="";;
-        info)		pretty="";;
-        debug|dbg)	pretty="";;
-        *)		pretty="";;
-	esac
-
-	echo "$n<$pretty$__OCF_PRIO$n> $__OCF_MSG"
-	return 0
-}
-
-__ocf_set_defaults() {
-	__OCF_ACTION="$1"
-
-	# Return to sanity for the agents...
-	unset LANG
-	LC_ALL=C
-	export LC_ALL
-
-	# TODO: Review whether we really should source this. Or rewrite
-	# to match some emerging helper function syntax...? This imports
-	# things which no OCF RA should be using...
-
-	OCF_SUCCESS=0
-	OCF_ERR_GENERIC=1
-	OCF_ERR_ARGS=2
-	OCF_ERR_UNIMPLEMENTED=3
-	OCF_ERR_PERM=4
-	OCF_ERR_INSTALLED=5
-	OCF_ERR_CONFIGURED=6
-	OCF_NOT_RUNNING=7
-
-	if [ -z "$OCF_RESOURCE_TYPE" ]; then
-		: ${OCF_RESOURCE_TYPE:=$__SCRIPT_NAME}
-	fi
-
-	if [ -z "$OCF_RA_VERSION_MAJOR" ]; then
-		: We are being invoked as an init script.
-		: Fill in some things with reasonable values.
-		: ${OCF_RESOURCE_INSTANCE:="default"}
-		return 0
-        fi
-
-	if [ -z "$OCF_ROOT" ]; then
-		OCF_ROOT=$(dirname $0)
-	fi
-	if [ ! -d "$OCF_ROOT" ]; then
-		ocf_log err "OCF_ROOT points to non-directory $OCF_ROOT."
-		exit $OCF_ERR_GENERIC
-	fi
-
-	# TODO: Anything else we should be setting and thus checking?
-        # There is nothing in this script which depends on the version
-	# of the API.  TESTING THIS HERE IS A BUG.  THIS SHOULD BE
-	# tested by the script that's invoked us.  FIXME!!
-	if [ "x$OCF_RA_VERSION_MAJOR" != "x1" ]; then
-		ocf_log err "This script is OCF RA API 1.x compliant only!"
-		exit $OCF_ERR_UNIMPLEMENTED
-	fi
-	# TODO: Should the minor level really be a number and not rather
-	# a list of flags...?
-        # AlanR says -- absolutely not -- a list of flags is good for a list
-	# of implemented features, not a version compiliance
-	# perhaps some future version might have such a list of
-	# flags, but that would be _in addition to_ the minor version number
-	if [ -z "$OCF_RA_VERSION_MINOR" ]; then
-		ocf_log err "No OCF RA minor version set."
-		exit $OCF_ERR_UNIMPLEMENTED
-	fi
-
-	if [ "x$__OCF_ACTION" = "xmeta-data" ]; then
-		OCF_RESOURCE_INSTANCE="undef"
-	fi	
-
-	if [ -z "$OCF_RESOURCE_INSTANCE" ]; then
-		ocf_log err "Need to tell us our resource instance name."
-		exit $OCF_ERR_ARGS
-	fi
-}
-
-
-ocf_log() {
-	# TODO: Revisit and implement internally.
-	if
-          [ $# -lt 2 ]
-        then
-          ocf_log err "Not enough arguments [$#] to ocf_log."
-        fi
-
-        declare __OCF_PRIO="$1"
-	declare -i __OCF_PRIO_N
-
-        shift
-
-        declare __OCF_MSG="$*"
-
-        case "${__OCF_PRIO}" in
-	emerg)		__OCF_PRIO_N=0;; # Not in original ocf-shellfuncs
-	alert)		__OCF_PRIO_N=1;; # Not in original ocf-shellfuncs
-        crit|critical)	__OCF_PRIO_N=2;;
-        err|error)	__OCF_PRIO_N=3;;
-        warn|warning)	__OCF_PRIO_N=4;;
-	note|notice)	__OCF_PRIO_N=5;; # Not in original ocf-shellfuncs
-        info)		__OCF_PRIO_N=6;;
-        debug|dbg)	__OCF_PRIO_N=7;;
-        *)		__OCF_PRIO_N=5;; # Defaults to INFO
-	esac
-
-	pretty_echo $__OCF_PRIO "$__OCF_MSG"
-
-	if [ -z "`which clulog 2> /dev/null`" ]; then
-		return 0
-	fi
-	clulog -s $__OCF_PRIO_N "$__OCF_MSG"
-}
-
-__ocf_set_defaults "$@"
diff --git a/rgmanager/src/resources/openldap.metadata b/rgmanager/src/resources/openldap.metadata
deleted file mode 100644
index 9bd7193..0000000
--- a/rgmanager/src/resources/openldap.metadata
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="openldap">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Open LDAP 
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an Open LDAP server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/openldap/slapd.conf"/>
-        </parameter>
-
-        <parameter name="url_list">
-            <longdesc lang="en">
-               Serve URL list. Default behaviour of URL list is changed and 
-		enhanced. eg. ldap:/// won't bind all IP address on the
-		computer but to all IP addresses in service. Using
-		ldap://0:port/ will bind to all IP addresses for service on
-		given port.
-            </longdesc>
-            <shortdesc lang="en">
-                URL list
-            </shortdesc>
-	    <content type="string" default="ldap:///"/>
-        </parameter>
-
-	<parameter name="slapd_options">
-		<longdesc lang="en">
-			Other command-line options for slapd
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for slapd
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/openldap.sh b/rgmanager/src/resources/openldap.sh
deleted file mode 100644
index 49ff81f..0000000
--- a/rgmanager/src/resources/openldap.sh
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare LDAP_SLAPD=/usr/sbin/slapd
-declare LDAP_pid_file="`generate_name_for_pid_file`"
-declare LDAP_conf_dir="`generate_name_for_conf_dir`"
-declare LDAP_gen_config_file="$LDAP_conf_dir/slapd.conf"
-declare LDAP_url_list
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_url_list()
-{
-	declare ldap_url_source=$1
-	declare ip_addresses=$2
-	declare url_list
-	declare tmp;
-	
-	for u in $ldap_url_source; do 
-		if [[ "$u" =~ ':///' ]]; then
-			for z in $ip_addresses; do
-				tmp=`echo $u | sed "s,://,://$z,"`
-				url_list="$url_list $tmp"
-			done
-		elif [[ "$u" =~ '://0:' ]]; then
-			for z in $ip_addresses; do
-				tmp=`echo $u | sed "s,://0:,://$z:,"`
-				url_list="$url_list $tmp"
-			done
-		else
-			url_list="$url_list $u"
-		fi
-	done
-	
-	echo $url_list
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	generate_configTemplate "$generated_file" "$1"
-	echo "pidfile \"$LDAP_pid_file\"" >> $generated_file
-	echo >> $generated_file	
-	sed 's/^[[:space:]]*pidfile/### pidfile/i' < "$original_file" >> "$generated_file"
-	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$LDAP_conf_dir"
-	check_pid_file "$LDAP_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$LDAP_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	LDAP_url_list=`generate_url_list "$OCF_RESKEY_url_list" "$ip_addresses"`
-
-	if [ -z "$LDAP_url_list" ]; then
-		ocf_log error "Generating URL List for $OCF_RESOURCE_INSTANCE > Failed"
-		return $OCF_ERR_GENERIC
-	fi
-
-	generate_config_file "$OCF_RESKEY_config_file" "$LDAP_gen_config_file"
-
-	$LDAP_SLAPD -f "$LDAP_gen_config_file" -n "$OCF_RESOURCE_INSTANCE" \
-		-h "$LDAP_url_list" $OCF_RESKEY_slapd_options
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$LDAP_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$LDAP_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$LDAP_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/oracledb.sh.in b/rgmanager/src/resources/oracledb.sh.in
deleted file mode 100644
index 5ba3370..0000000
--- a/rgmanager/src/resources/oracledb.sh.in
+++ /dev/null
@@ -1,886 +0,0 @@
-#!/bin/bash
-# Author(s):
-#     Hardy Merrill <hmerrill at redhat.com>
-#     Lon Hohberger <lhh at redhat.com>
-#     Michael Moon <Michael dot Moon at oracle.com>
-#
-# chkconfig: 345 99 01
-# description: Service script for starting/stopping      \
-#	       Oracle(R) Database 10g on                 \
-#		        Red Hat Enterprise Linux 5
-#
-# NOTES:
-#
-# (1) You can comment out the LOCKFILE declaration below.  This will prevent
-# the need for this script to access anything outside of the ORACLE_HOME 
-# path.
-#
-# (2) You MUST customize ORACLE_USER, ORACLE_HOME, ORACLE_SID, and
-# ORACLE_HOSTNAME to match your installation if not running from within
-# rgmanager.
-#
-# (3) Do NOT place this script in shared storage; place it in ORACLE_USER's
-# home directory in non-clustered environments and /usr/share/cluster
-# in rgmanager/Red Hat cluster environments.
-#
-# Oracle is a registered trademark of Oracle Corporation.
-# Oracle9i is a trademark of Oracle Corporation.
-# Oracle10g is a trademark of Oracle Corporation.
-# All other trademarks are property of their respective owners.
-#
-
-. /etc/init.d/functions
-
-#
-# Source stuff from /etc/sysconfig, but this may be overridden if
-# this is being called as a cluster resource agent instead.
-#. /etc/sysconfig/oracledb
-
-declare SCRIPT="`basename $0`"
-declare SCRIPTDIR="`dirname $0`"
-
-[ -n "$OCF_RESKEY_user" ] && ORACLE_USER=$OCF_RESKEY_user
-[ -n "$OCF_RESKEY_home" ] && ORACLE_HOME=$OCF_RESKEY_home
-[ -n "$OCF_RESKEY_name" ] && ORACLE_SID=$OCF_RESKEY_name
-[ -n "$OCF_RESKEY_listener_name" ] && ORACLE_LISTENER=$OCF_RESKEY_listener_name
-[ -n "$OCF_RESKEY_lockfile" ] && LOCKFILE=$OCF_RESKEY_lockfile
-[ -n "$OCF_RESKEY_type" ] && ORACLE_TYPE=$OCF_RESKEY_type
-[ -n "$OCF_RESKEY_vhost" ] && ORACLE_HOSTNAME=$OCF_RESKEY_vhost
-
-######################################################
-# Customize these to match your Oracle installation. #
-######################################################
-#
-# 1. Oracle user.  Must be the same across all cluster members.  In the event
-#    that this script is run by the super-user, it will automatically switch
-#    to the Oracle user and restart.  Oracle needs to run as the Oracle
-#    user, not as root.
-#
-#[ -n "$ORACLE_USER" ] || ORACLE_USER=oracle
-
-#
-# 2. Oracle home.  This is set up during the installation phase of Oracle.
-#    From the perspective of the cluster, this is generally the mount point
-#    you intend to use as the mount point for your Oracle Infrastructure
-#    service.
-#
-#[ -n "$ORACLE_HOME" ] || ORACLE_HOME=/mnt/oracle/home
-
-#
-# 3. This is your SID.  This is set up during oracle installation as well.
-#
-#[ -n "$ORACLE_SID" ] || ORACLE_SID=orcl
-
-#
-# 4. The oracle user probably doesn't have the permission to write to 
-# /var/lock/subsys, so use the user's home directory.
-#
-#[ -n "$LOCKFILE" ] || LOCKFILE="/home/$ORACLE_USER/.oracle-ias.lock"
-[ -n "$LOCKFILE" ] || LOCKFILE="$ORACLE_HOME/.oracle-ias.lock"
-#[ -n "$LOCKFILE" ] || LOCKFILE="/var/lock/subsys/oracle-ias" # Watch privileges
-
-#
-# 5. Type of Oracle Database.  Currently supported: 10g 10g-iAS(untested!)
-#
-[ -n "$ORACLE_TYPE" ] || ORACLE_TYPE="base-em"
-
-#
-# 6. Oracle virtual hostname.  This is the hostname you gave Oracle during
-#    installation.
-#
-#[ -n "$ORACLE_HOSTNAME" ] || ORACLE_HOSTNAME=svc0.foo.test.com
-
-
-
-###########################################################################
-ORACLE_TYPE=`echo $ORACLE_TYPE | tr A-Z a-z`
-export ORACLE_USER ORACLE_HOME ORACLE_SID LOCKFILE ORACLE_TYPE
-export ORACLE_HOSTNAME
-
-
-##########################
-# Set up paths we'll use.  Not all are used by all the different types of
-# Oracle installations
-#
-export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/opmn/lib
-export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$PATH
-
-declare -i	RESTART_RETRIES=3
-declare -r	DB_PROCNAMES="pmon"
-#declare -r	DB_PROCNAMES="pmonXX" # testing
-#declare -r	DB_PROCNAMES="pmon smon dbw0 lgwr"
-
-declare -r	LSNR_PROCNAME="tnslsnr"
-#declare -r	LSNR_PROCNAME="tnslsnrXX" # testing
-
-
-##########################################################
-# (Hopefully) No user-serviceable parts below this line. #
-##########################################################
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="oracledb" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	Oracle 10g Failover Instance
-    </longdesc>
-    <shortdesc lang="en">
-	Oracle 10g Failover Instance
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-		Instance name (SID) of oracle instance
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle SID
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="listener_name" unique="1">
-	    <longdesc lang="en">
-		Oracle Listener Instance Name.  If you have multiple 
-		instances of Oracle running, it may be necessary to 
-		have multiple listeners on the same machine with
-		different names.
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle Listener Instance Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-
-        <parameter name="user" required="1">
-	    <longdesc lang="en">
-		Oracle user name.  This is the user name of the Oracle
-		user which the Oracle AS instance runs as.
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle User Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="home" required="1">
-	    <longdesc lang="en">
-		This is the Oracle (application, not user) home directory.
-		This is configured when you install Oracle.
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle Home Directory
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="type" required="0">
-	    <longdesc lang="en">
-		This is the Oracle installation type:
-		base - Database Instance and Listener only
-		base-em (or 10g) - Database, Listener, Enterprise Manager,
-				   and iSQL*Plus
-		ias (or 10g-ias) - Internet Application Server (Infrastructure)
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle Installation Type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="vhost" required="0" unique="1">
-	    <longdesc lang="en">
-	        Virtual Hostname matching the installation hostname of
-		Oracle 10g.  Note that during the start/stop of an oracledb
-		resource, your hostname will temporarily be changed to
-		this hostname.  As such, it is recommended that oracledb
-		resources be instanced as part of an exclusive service only.
-	    </longdesc>
-            <shortdesc lang="en">
-		Virtual Hostname
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="90"/>
-        <action name="recover" timeout="990"/>
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" timeout="10"/>
-	<action name="monitor" timeout="10"/>
-
-	<action name="status" depth="10" timeout="30" interval="30"/>
-	<action name="monitor" depth="10" timeout="30" interval="30"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<attributes maxinstances="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-#
-# "action"-like macro supporting functions
-#
-faction()
-{
-	echo -n "$1"
-	shift
-	$*
-	if [ $? -eq 0 ]; then
-		echo_success
-		echo
-		return 0
-	fi
-
-	echo_failure
-	echo
-	return 1
-}
-
-
-#
-# Start Oracle9i (database portion)
-#
-start_db()
-{
-	declare tmpfile
-	declare logfile
-	declare -i rv
-
-	tmpfile="$(mktemp /tmp/$SCRIPT-start.XXXXXX)"
-	logfile=@LOGDIR@/$SCRIPT-start.log
-
-	#
-	# Set up our sqlplus script.  Basically, we're trying to 
-	# capture output in the hopes that it's useful in the case
-	# that something doesn't work properly.
-	#
-	echo "startup" > $tmpfile
-	echo "quit" >> $tmpfile
-
-	sqlplus "/ as sysdba" < $tmpfile &> $logfile
-	rv=$?
-
-	rm -f $tmpfile
-
-	# Dump logfile to /var/log/messages
-	logger -f $logfile
-
-	if [ $rv -ne 0 ]; then
-		echo "ORACLE_HOME Incorrectly set?"
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	# 
-	# If we see:
-	# ORA-.....: failure, we failed
-	#
-
-	rm -f $tmpfile
-	grep -q "^ORA-" $logfile
-	if [ $? -eq 0 ]; then
-		echo "ORACLE_SID Incorrectly set?"
-		rm -f $tmpfile
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Stop Oracle9i (database portion)
-#
-stop_db()
-{
-	declare tmpfile
-	declare logfile
-	declare -i rv
-
-	tmpfile="$(mktemp /tmp/$SCRIPT-stop.XXXXXX)"
-	logfile=@LOGDIR@/$SCRIPT-stop.log
-
-	# Setup for Stop ...
-	echo "shutdown abort" > $tmpfile
-	echo "quit" >> $tmpfile
-
-	sqlplus "/ as sysdba" < $tmpfile &> $logfile
-	rv=$?
-
-	rm -f $tmpfile
-
-	# Dump logfile to /var/log/messages
-	logger -f $logfile
-
-	if [ $rv -ne 0 ]; then
-		echo "ORACLE_HOME Incorrectly set?"
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	# 
-	# If we see 'failure' in the log, we're done.
-	#
-	rm -f $tmpfile
-	grep -q "^ORA-" $logfile
-	if [ $? -eq 0 ]; then
-		echo_failure
-		echo
-		echo "Possible reason: ORACLE_SID Incorrectly set."
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Destroy any remaining processes with refs to $ORACLE_HOME
-#
-force_cleanup()
-{
-	declare pids
-	declare pid
-
-	# Patch from Shane Bradley to fix 471266
-	pids=`ps ax | grep $ORACLE_HOME | grep "ora_.*_${ORACLE_SID}" | grep -v grep | awk '{print $1}'`
-
-	logger -t $SCRIPT "<err> Not all Oracle processes exited cleanly, killing"
-	
-	for pid in $pids; do
-		kill -9 $pid
-		if [ $? -eq 0 ]; then
-			logger -t $SCRIPT "Killed $pid"
-		fi
-	done
-
-	return 0
-}
-
-
-
-#
-# Wait for oracle processes to exit.  Time out after 60 seconds
-#
-exit_idle()
-{
-	declare -i n=0
-	while ps ax | grep $ORACLE_HOME | grep -q -v grep; do
-		if [ $n -ge 90 ]; then
-			force_cleanup
-			return 0
-		fi
-		sleep 1
-		((n++))
-	done
-	return 0
-}
-
-
-#
-# Get database background process status.  Restart it if it failed and
-# we have seen the lock file.
-#
-get_db_status()
-{
-	declare -i subsys_lock=$1
-	declare -i i=0
-	declare -i rv=0
-	declare ora_procname
-
-	for procname in $DB_PROCNAMES ; do
-
-		ora_procname="ora_${procname}_${ORACLE_SID}"
-		
-		status $ora_procname
-		if [ $? -eq 0 ] ; then
-			# This one's okay; go to the next one.
-			continue
-		fi
-
-		#
-		# We're not supposed to be running, and we are,
-		# in fact, not running...
-		# XXX only works when monitoring one db process; consider
-		# extending in future.
-		#
-		if [ $subsys_lock -ne 0 ]; then
-			return 3
-		fi
-
-		for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-			# this db process is down - stop and
-			# (re)start all ora_XXXX_$ORACLE_SID processes
-			logger -t $SCRIPT "Restarting Oracle Database..."
-			stop_db
-			if [ $? != 0 ] ; then
-				# stop failed - return 1
-				return 1
-			fi
-
-			start_db
-			if [ $? == 0 ] ; then
-				# ora_XXXX_$ORACLE_SID processes started
-				# successfully, so break out of the
-				# stop/start # 'for' loop
-				break
-			fi
-		done
-
-		if [ $i -eq 0 ]; then
-			# stop/start's failed - return 1 (failure)
-			return 1
-		fi
-	done
-	return 0
-}
-
-
-#
-# Get the status of the Oracle listener process
-#
-get_lsnr_status() 
-{
-	declare -i subsys_lock=$1
-	declare -i rv
-
-	status $LSNR_PROCNAME
-	rv=$?
-	if [ $rv == 0 ] ; then
-		return 0 # Listener is running fine
-	fi
-
-	#
-	# We're not supposed to be running, and we are,
-	# in fact, not running.  Return 3
-	#
-	if [ $subsys_lock -ne 0 ]; then
-		return 3
-	fi
-
-	#
-	# Listener is NOT running (but should be) - try to restart
-	#
-	for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-
-		action "Restarting Oracle listener:" lsnrctl start \
-					$ORACLE_LISTENER
-		lsnrctl status $ORACLE_LISTENER >& /dev/null
-		if [ $? == 0 ] ; then
-			break # Listener was (re)started and is running fine
-		fi
-	done
-
-	if [ $i -eq 0 ]; then
-		# stop/start's failed - return 1 (failure)
-		return 1
-	fi
-
-	status $LSNR_PROCNAME
-	if [ $? != 0 ] ; then
-		return 1 # Problem restarting the Listener
-	fi
-	return 0 # Success restarting the Listener
-}
-
-
-#
-# usage: get_opmn_proc_status <ias-component> [process-type]
-#
-# Get the status of a specific OPMN-managed process.  If process-type
-# is not specified, assume the process-type is the same as the ias-component.
-# If the lock-file exists (or no lock file is specified), try to restart
-# the given process-type if it is not running.
-#
-get_opmn_proc_status()
-{
-	declare comp=$1
-	declare opmntype=$2
-	declare type_pretty
-	declare _pid _status
-	
-	[ -n "$comp" ] || return 1
-	if [ -z "$opmntype" ]; then
-		opmntype=$comp
-	else
-		type_pretty=" [$opmntype]"
-	fi
-
-	for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-
-		_status=`opmnctl status | grep "^$comp " | grep " $opmntype " | cut -d '|' -f3,4 | sed -e 's/ //g' -e 's/|/ /g'`
-
-		_pid=`echo $_status | cut -f1 -d' '`
-		_status=`echo $_status | cut -f2 -d' '`
-		if [ "${_status}" == "Alive" ] || [ "${_status}" == "Init" ]; then
-			if [ $i -lt $RESTART_RETRIES ] ; then
-				echo "  $comp$type_pretty restarted"
-			fi
-			echo "  $comp$type_pretty (pid $_pid) is running..."
-			break
-		else
-			echo "  $comp$type_pretty is stopped"
-
-			#
-			# Try to restart it, but don't worry if we fail.  OPMN
-			# is supposed to handle restarting these anyway.
-			#
-			# If it's running and you tell OPMN to "start" it,
-			# you will get an error.
-			#
-			# If it's NOT running and you tell OPMN to "restart"
-			# it, you will also get an error.
-			#
-			opmnctl startproc process-type=$opmntype &> /dev/null
-		fi
-	done
-
-	if [ $i -eq 0 ]; then
-		# restarts failed - return 1 (failure)
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Get the status of the OPMN-managed processes.
-#
-get_opmn_status()
-{
-	declare -i subsys_lock=$1
-	declare -i ct_errors=0
-
-	opmnctl status &> /dev/null
-	if [ $? -eq 2 ]; then
-		#
-		# OPMN not running??
-		#
-		echo "opmn is stopped"
-
-		if [ $subsys_lock -eq 0 ]; then
-			#
-			# Don't handle full opmn-restart. XXX
-			#
-			return 1
-		fi
-
-		# That's okay, it's not supposed to be!
-		return 3
-	fi
-
-	#
-	# Print out the PIDs for everyone.
-	#
-	echo "opmn is running..."
-	echo "opmn components:"
-
-	#
-	# Check the OPMN-managed processes
-	#
-	get_opmn_proc_status OID || ((ct_errors++))
-	get_opmn_proc_status HTTP_Server || ((ct_errors++))
-	get_opmn_proc_status OC4J OC4J_SECURITY || ((ct_errors++))
-
-	#
-	# One or more OPMN-managed processes failed and could not be
-	# restarted.
-	#
-	if [ $ct_errors -ne 0 ]; then
-		return 1
-	fi
-	return 0
-}
-
-
-#
-# Helps us keep a running status so we know what our ultimate return
-# code will be.  Returns 1 if the $1 and $2 are not equivalent, otherwise
-# returns $1.  The return code is meant to be the next $1 when this is
-# called, so, for example:
-#
-# update_status 0   <-- returns 0
-# update_status $? 0 <-- returns 0
-# update_status $? 3 <-- returns 1 (values different - error condition)
-# update_status $? 1 <-- returns 1 (same, but happen to be error state!)
-#
-# update_status 3
-# update_status $? 3 <-- returns 3
-#
-# (and so forth...)
-#
-update_status()
-{
-	declare -i old_status=$1
-	declare -i new_status=$2
-
-	if [ -z "$2" ]; then
-		return $old_status
-	fi
-
-	if [ $old_status -ne $new_status ]; then
-		return 1
-	fi
-
-	return $old_status
-}
-
-
-#
-# Print an error message to the user and exit.
-#
-oops()
-{
-	echo "Please configure this script ($0) to"
-	echo "match your installation."
-	echo 
-	echo "    $1 failed validation checks."
-	exit 1
-}
-
-
-#
-# Do some validation on the user-configurable stuff at the beginning of the
-# script.
-#
-validation_checks()
-{
-	#
-	# If the oracle user doesn't exist, we're done.
-	#
-	[ -n "$ORACLE_USER" ] || oops "ORACLE_USER"
-	id -u $ORACLE_USER > /dev/null || oops "ORACLE_USER"
-	id -g $ORACLE_USER > /dev/null || oops "ORACLE_USER"
-
-	#
-	# If the oracle home isn't a directory, we're done
-	#
-	[ -n "$ORACLE_HOME" ] || oops ORACLE_HOME
-	#[ -d "$ORACLE_HOME" ] || oops ORACLE_HOME
-
-	#
-	# If the oracle SID is NULL, we're done
-	#
-	[ -n "$ORACLE_SID" ] || oops ORACLE_SID
-
-	#
-	# If we don't know the type, we're done
-	#
-	if [ "$ORACLE_TYPE" = "base" ]; then
-		# Other names for base
-		ORACLE_TYPE="base"
-	elif [ "$ORACLE_TYPE" = "10g" ] || [ "$ORACLE_TYPE" = "base-em" ]; then
-		ORACLE_TYPE="base-em"
-	elif [ "$ORACLE_TYPE" = "10g-ias" ] || [ "$ORACLE_TYPE" = "ias" ]; then
-		ORACLE_TYPE="ias"
-	else
-		oops ORACLE_TYPE
-	fi
-
-	#
-	# If the hostname is zero-length, fix it
-	#
-	[ -n "$ORACLE_HOSTNAME" ] || ORACLE_HOSTNAME=`hostname`
-
-	#
-	# Super user? Automatically change UID and exec as oracle user.
-	# Oracle needs to be run as the Oracle user, not root!
-	#
-	if [ "`id -u`" = "0" ]; then
-		echo "Restarting $0 as $ORACLE_USER."
-		#
-		# Breaks on RHEL5 
-		# exec sudo -u $ORACLE_USER $0 $*
-		#
-		su $ORACLE_USER -c "$0 $*"
-		exit $?
-	fi
-
-	#
-	# If we're not root and not the Oracle user, we're done.
-	#
-	[ "`id -u`" = "`id -u $ORACLE_USER`" ] || exit 1
-	[ "`id -g`" = "`id -g $ORACLE_USER`" ] || exit 1
-
-	#
-	# Go home.
-	#
-	cd $ORACLE_HOME
-
-	return 0
-}
-
-
-#
-# Start Oracle9i Application Server Infrastructure
-#
-start_oracle()
-{
-	faction "Starting Oracle Database:" start_db || return 1
-	action "Starting Oracle Listener:" lsnrctl start $ORACLE_LISTENER || return 1
-
-	if [ "$ORACLE_TYPE" = "base-em" ]; then
-		action "Starting iSQL*Plus:" isqlplusctl start || return 1
-		action "Starting Oracle EM DB Console:" emctl start dbconsole || return 1
-	elif [ "$ORACLE_TYPE" = "ias" ]; then
-		action "Starting Oracle EM:" emctl start em || return 1
-		action "Starting iAS Infrastructure:" opmnctl startall || return 1
-	fi
-
-	if [ -n "$LOCKFILE" ]; then
-		touch $LOCKFILE
-	fi
-	return 0
-}
-
-
-#
-# Stop Oracle9i Application Server Infrastructure
-#
-stop_oracle()
-{
-	if ! [ -e "$ORACLE_HOME/bin/lsnrctl" ]; then
-		echo "Oracle Listener Control is not available"
-		echo "    ($ORACLE_HOME not mounted?)"
-		return 0
-	fi
-
-	if [ "$ORACLE_TYPE" = "base-em" ]; then
-		action "Stopping Oracle EM DB Console:" emctl stop dbconsole || return 1
-		action "Stopping iSQL*Plus:" isqlplusctl stop || return 1
-	elif [ "$ORACLE_TYPE" = "ias" ]; then
-		action "Stopping iAS Infrastructure:" opmnctl stopall || return 1
-		action "Stopping Oracle EM:" emctl stop em || return 1
-	fi
-
-	faction "Stopping Oracle Database:" stop_db || return 1
-	action "Stopping Oracle Listener:" lsnrctl stop $ORACLE_LISTENER
-	faction "Waiting for all Oracle processes to exit:" exit_idle 
-
-	if [ $? -ne 0 ]; then
-		echo "WARNING: Not all Oracle processes exited cleanly"
-	fi
-
-	if [ -n "$LOCKFILE" ]; then
-		rm -f $LOCKFILE
-	fi
-	return 0
-}
-
-
-#
-# Find and display the status of iAS infrastructure.
-#
-# This has three parts:
-# (1) Oracle database itself
-# (2) Oracle listener process
-# (3) OPMN and OPMN-managed processes
-#
-# - If all are (cleanly) down, we return 3.  In order for this to happen,
-# $LOCKFILE must not exist.  In this case, we try and restart certain parts
-# of the service - as this may be running in a clustered environment.
-#
-# - If some but not all are running (and, if $LOCKFILE exists, we could not
-# restart the failed portions), we return 1 (ERROR)
-#
-# - If all are running, return 0.  In the "all-running" case, we recreate
-# $LOCKFILE if it does not exist.
-#
-status_oracle()
-{
-	declare -i subsys_lock=1
-	declare -i last 
-
-	#
-	# Check for lock file.  Crude and rudimentary, but it works
-	#
-	if [ -z "$LOCKFILE" ] || [ -f $LOCKFILE ]; then
-		subsys_lock=0 
-	fi
-
-	# Check database status
-	get_db_status $subsys_lock
-	update_status $? # Start
-	last=$?
-
-	# Check & report listener status
-	get_lsnr_status $subsys_lock
-	update_status $? $last
-	last=$?
-	
-	if [ "$ORACLE_TYPE" = "base-em" ]; then
-		# XXX Add isqlplus status check?!
-		emctl status dbconsole 2>&1 | grep "is running"
-		update_status $? $last
-		last=$?
-	elif [ "$ORACLE_TYPE" = "ias" ]; then
-		# Check & report opmn / opmn-managed process status
-		get_opmn_status $subsys_lock
-		update_status $? $last
-		last=$?
-	fi
-
-	#
-	# No lock file, but everything's running.  Put the lock
-	# file back. XXX - this kosher?
-	#
-	if [ $last -eq 0 ] && [ $subsys_lock -ne 0 ]; then
-		touch $LOCKFILE
-	fi
-
-	return $last
-}
-
-
-########################
-# Do some real work... #
-########################
-if [ "$1" = "meta-data" ]; then
-	meta_data
-	exit 0
-fi
-
-validation_checks $*
-
-case $1 in
-	start)
-		start_oracle
-		exit $?
-		;;
-	stop)
-		stop_oracle
-		exit $?
-		;;
-	status|monitor)
-		status_oracle
-		exit $?
-		;;
-	restart)
-		$0 stop || exit $?
-		$0 start || exit $?
-		exit 0
-		;;
-	*)
-		echo "usage: $SCRIPT {start|stop|status|restart|meta-data}"
-		exit 1
-		;;
-esac
-exit 0
diff --git a/rgmanager/src/resources/orainstance.metadata b/rgmanager/src/resources/orainstance.metadata
deleted file mode 100644
index f11995d..0000000
--- a/rgmanager/src/resources/orainstance.metadata
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" ?>
-<!-- $Id: orainstance.metadata 58 2009-06-29 05:15:12Z hevirtan $ -->
-
-<!-- Resource metadata for Oracle DB agent -->
-<resource-agent name="orainstance" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	Oracle 10g Failover Instance
-    </longdesc>
-    <shortdesc lang="en">
-	Oracle 10g Failover Instance
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    	<longdesc lang="en">
-				Instance name (SID) of oracle instance
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Oracle SID
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-
-        <parameter name="user" required="1">
-	    	<longdesc lang="en">
-				Oracle user name.  This is the user name of the Oracle
-				user which the Oracle instance runs as.
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Oracle User Name
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-
-        <parameter name="home" required="1">
-	    	<longdesc lang="en">
-				This is the Oracle database home directory.
-				This is configured when you install Oracle.
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Oracle Home Directory
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-
-        <parameter name="listeners">
-	    	<longdesc lang="en">
-				List of Oracle listeners which will be started with
-				the database instance. Listener names are separated by
-				whitespace. Defaults to empty which disables listeners.
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Oracle listeners
-        	</shortdesc>
-	    	<content type="string" default=""/>
-        </parameter>
-
-        <parameter name="lockfile">
-	    	<longdesc lang="en">
-				Location for lockfile which will be used for checking if
-				the Oracle should be running or not. Defaults to location
-				under /tmp.
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Pathname for lockfile
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-		<action name="stop" timeout="90"/>
-
-		<!-- Note: status check will also perform recover 
-			 (Oracle DB restart) if the check fails -->
-		<action name="status" timeout="900" interval="1m"/>
-		<action name="monitor" timeout="900" interval="1m"/>
-
-		<action name="meta-data" timeout="0"/>
-		<action name="verify-all" timeout="0"/>
-    </actions>
-
-</resource-agent>
diff --git a/rgmanager/src/resources/orainstance.sh b/rgmanager/src/resources/orainstance.sh
deleted file mode 100644
index ca80f32..0000000
--- a/rgmanager/src/resources/orainstance.sh
+++ /dev/null
@@ -1,526 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2003-2004, 2006-2007 Red Hat, Inc.
-#
-# Author(s):
-#     Hardy Merrill <hmerrill at redhat.com>
-#     Lon Hohberger <lhh at redhat.com>
-#     Michael Moon <Michael dot Moon at oracle.com>
-#
-# This program is Open Source software.  You may modify and/or redistribute
-# it persuant to the terms of the Open Software License version 2.1, which
-# is available from the following URL and is included herein by reference:
-#
-# 	http://opensource.org/licenses/osl-2.1.php
-#
-# chkconfig: 345 99 01
-# description: Service script for starting/stopping      \
-#	       Oracle(R) Database 10g on                 \
-#		        Red Hat Enterprise Linux 5
-#
-# NOTES:
-#
-# (1) You can comment out the LOCKFILE declaration below.  This will prevent
-# the need for this script to access anything outside of the ORACLE_HOME 
-# path.
-#
-# (2) You MUST customize ORACLE_USER, ORACLE_HOME, ORACLE_SID, and
-# ORACLE_HOSTNAME to match your installation if not running from within
-# rgmanager.
-#
-# (3) Do NOT place this script in shared storage; place it in ORACLE_USER's
-# home directory in non-clustered environments and /usr/share/cluster
-# in rgmanager/Red Hat cluster environments.
-#
-# Oracle is a registered trademark of Oracle Corporation.
-# Oracle9i is a trademark of Oracle Corporation.
-# Oracle10g is a trademark of Oracle Corporation.
-# All other trademarks are property of their respective owners.
-#
-#
-# $Id: orainstance.sh 127 2009-08-21 09:17:52Z hevirtan $
-#
-# Original version is distributed with RHCS. The modifications include
-# the following minor changes:
-# - Meta-data moved to a dedicated file
-# - Support for multiple listeners
-# - Disabled EM
-# - SysV init support removed. Only usable with rgmanager
-#
-
-. /etc/init.d/functions
-
-declare SCRIPT="`basename $0`"
-declare SCRIPTDIR="`dirname $0`"
-
-# Required parameters from rgmanager
-ORACLE_USER=$OCF_RESKEY_user
-ORACLE_HOME=$OCF_RESKEY_home
-ORACLE_SID=$OCF_RESKEY_name
-
-# Optional parameters with default values
-LISTENERS=$OCF_RESKEY_listeners
-LOCKFILE="/tmp/.oracle10g-${ORACLE_SID}.lock"
-[ -n "$OCF_RESKEY_lockfile" ] && LOCKFILE=$OCF_RESKEY_lockfile
-
-export LISTENERS ORACLE_USER ORACLE_HOME ORACLE_SID LOCKFILE
-export LD_LIBRARY_PATH=$ORACLE_HOME/lib
-export PATH=$ORACLE_HOME/bin:$PATH
-
-declare -i	RESTART_RETRIES=3
-declare -r	DB_PROCNAMES="pmon"
-declare -r	LSNR_PROCNAME="tnslsnr"
-
-
-#
-# Start Oracle (database portion)
-#
-start_db() {
-	declare tmpfile
-	declare logfile
-	declare -i rv
-
-	tmpfile=/tmp/$SCRIPT-start.$$
-	logfile=/tmp/$SCRIPT-start.log
-
-	# Set up our sqlplus script.  Basically, we're trying to 
-	# capture output in the hopes that it's useful in the case
-	# that something doesn't work properly.
-	echo "startup" > $tmpfile
-	echo "quit" >> $tmpfile
-
-	sqlplus "/ as sysdba" < $tmpfile > $logfile
-	rv=$?
-
-	rm -f $tmpfile
-
-	# Dump logfile to /var/log/messages
-	initlog -q -c "cat $logfile"
-	
-	if [ $rv -ne 0 ]; then
-        rm -f $logfile
-        initlog -n $SCRIPT -q -s "sqlplus returned 1, failed"
-		return 1
-	fi
-
-	# If we see:
-	# ORA-.....: failure, we failed
-	grep -q "failure" $logfile
-	rv=$?
-
-    rm -f $logfile
-	if [ $rv -eq 0 ]; then
-        initlog -n $SCRIPT -q -s "found failure in stdout, returning 1"
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Stop Oracle (database portion)
-#
-stop_db() {
-	declare tmpfile
-	declare logfile
-	declare -i rv
-
-	tmpfile=/tmp/$SCRIPT-stop.$$
-	logfile=/tmp/$SCRIPT-stop.log
-
-    ora_procname="ora_${DB_PROCNAMES}_${ORACLE_SID}"
-    status $ora_procname
-    if [ $? -ne 0 ]; then
-        # No pmon process found, db already down
-        return 0
-    fi
-
-	# Setup for Stop ...
-	echo "shutdown immediate" > $tmpfile
-	echo "quit" >> $tmpfile
-
-	sqlplus "/ as sysdba" < $tmpfile > $logfile
-	rv=$?
-
-	rm -f $tmpfile
-
-	# Dump logfile to /var/log/messages
-	initlog -q -c "cat $logfile"
-	
-    # sqlplus returned failure. We'll return failed to rhcs
-	if [ $rv -ne 0 ]; then
-        rm -f $logfile
-        initlog -n $SCRIPT -q -s "sqlplus returned 1, failed"
-		return 1
-	fi
-
-	grep -q failure $logfile
-    rv=$?
-    rm -f $logfile
-
-	# If we see 'failure' in the log, we're done.
-	if [ $rv -eq 0 ]; then
-        initlog -n $SCRIPT -q -s "found failure in stdout, returning 1"
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Destroy any remaining processes with refs to $ORACLE_SID
-#
-force_cleanup() {
-	declare pids
-	declare pid
-
-	pids=`ps ax | grep $ORACLE_SID | grep -v grep | awk '{print $1}'`
-
-	initlog -n $SCRIPT -s "<err> Not all Oracle processes exited cleanly, killing"
-	
-	for pid in $pids; do
-		kill -9 $pid
-		if [ $? -eq 0 ]; then
-			initlog -n $SCRIPT -s "Killed $pid"
-		fi
-	done
-
-	return 0
-}
-
-
-#
-# Wait for oracle processes to exit.  Time out after 60 seconds
-#
-exit_idle() {
-	declare -i n=0
-	
-	while ps ax | grep $ORACLE_SID | grep -q -v $LSNR_PROCNAME | grep -q -v grep; do
-		if [ $n -ge 90 ]; then
-			force_cleanup
-			return 0
-		fi
-		sleep 1
-		((n++))
-	done
-	return 0
-}
-
-
-#
-# Get database background process status.  Restart it if it failed and
-# we have seen the lock file.
-#
-get_db_status() {
-	declare -i subsys_lock=$1
-	declare -i i=0
-	declare -i rv=0
-	declare ora_procname
-
-	for procname in $DB_PROCNAMES ; do
-		ora_procname="ora_${procname}_${ORACLE_SID}"
-		
-		status $ora_procname
-		if [ $? -eq 0 ] ; then
-			# This one's okay; go to the next one.
-			continue
-		fi
-
-		# We're not supposed to be running, and we are,
-		# in fact, not running...
-		if [ $subsys_lock -ne 0 ]; then
-			return 3
-		fi
-
-		for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-			# this db process is down - stop and
-			# (re)start all ora_XXXX_$ORACLE_SID processes
-			initlog -q -n $SCRIPT -s "Restarting Oracle Database..."
-			stop_db
-
-			start_db
-			if [ $? == 0 ] ; then
-				# ora_XXXX_$ORACLE_SID processes started
-				# successfully, so break out of the
-				# stop/start # 'for' loop
-				break
-			fi
-		done
-
-		if [ $i -eq 0 ]; then
-			# stop/start's failed - return 1 (failure)
-            initlog -q -n $SCRIPT -s "Restart failed, retuning 1"
-			return 1
-		fi
-	done
-	return 0
-}
-
-
-#
-# Get the status of the Oracle listener process
-#
-get_lsnr_status() {
-	declare -i subsys_lock=$1
-	declare -i rv
-    declare -r LISTENER=$3
-
-    lsnrctl status $LISTENER >& /dev/null
-	rv=$?
-	if [ $rv == 0 ] ; then
-		return 0 # Listener is running fine
-	fi
-
-	# We're not supposed to be running, and we are,
-	# in fact, not running.  Return 3
-	if [ $subsys_lock -ne 0 ]; then
-		return 3
-	fi
-
-	# Listener is NOT running (but should be) - try to restart
-	for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-        initlog -n $SCRIPT -q -s "Restarting Oracle listener ($LISTENER)"
-		lsnrctl start $LISTENER
-		lsnrctl status $LISTENER >& /dev/null
-		if [ $? == 0 ] ; then
-			break # Listener was (re)started and is running fine
-		fi
-	done
-
-	if [ $i -eq 0 ]; then
-		# stop/start's failed - return 1 (failure)
-        initlog -n $SCRIPT -q -s "Listener restart failed, retuning 1"
-		return 1
-	fi
-
-    lsnrctl status $LISTENER >& /dev/null
-	if [ $? != 0 ] ; then
-        initlog -n $SCRIPT -q -s "Listener status failed, retuning 1"
-		return 1 # Problem restarting the Listener
-	fi
-	return 0 # Success restarting the Listener
-}
-
-
-#
-# Helps us keep a running status so we know what our ultimate return
-# code will be.  Returns 1 if the $1 and $2 are not equivalent, otherwise
-# returns $1.  The return code is meant to be the next $1 when this is
-# called, so, for example:
-#
-# update_status 0   <-- returns 0
-# update_status $? 0 <-- returns 0
-# update_status $? 3 <-- returns 1 (values different - error condition)
-# update_status $? 1 <-- returns 1 (same, but happen to be error state!)
-#
-# update_status 3
-# update_status $? 3 <-- returns 3
-#
-# (and so forth...)
-#
-update_status() {
-	declare -i old_status=$1
-	declare -i new_status=$2
-
-	if [ -z "$2" ]; then
-		return $old_status
-	fi
-
-	if [ $old_status -ne $new_status ]; then
-        initlog -n $SCRIPT -q -s "$old_status vs $new_status - returning 1"
-		return 1
-	fi
-
-	return $old_status
-}
-
-
-#
-# Print an error message to the user and exit.
-#
-oops() {
-	#echo "Please configure this script ($0) to"
-	#echo "match your installation."
-	#echo 
-	#echo "    $1 failed validation checks."
-    initlog -n $SCRIPT -q -s "$1 failed validation checks"
-	exit 1
-}
-
-
-#
-# Do some validation on the user-configurable stuff at the beginning of the
-# script.
-#
-validation_checks() {
-	# If the oracle user doesn't exist, we're done.
-	[ -n "$ORACLE_USER" ] || oops "ORACLE_USER"
-	id -u $ORACLE_USER > /dev/null || oops "ORACLE_USER"
-	id -g $ORACLE_USER > /dev/null || oops "ORACLE_USER"
-
-	# If the oracle home isn't a directory, we're done
-	[ -n "$ORACLE_HOME" ] || oops ORACLE_HOME
-
-	# If the oracle SID is NULL, we're done
-	[ -n "$ORACLE_SID" ] || oops ORACLE_SID
-
-	# Super user? Automatically change UID and exec as oracle user.
-	# Oracle needs to be run as the Oracle user, not root!
-	if [ "`id -u`" = "0" ]; then
-		su $ORACLE_USER -c "$0 $*"
-		exit $?
-	fi
-
-	# If we're not root and not the Oracle user, we're done.
-	[ "`id -u`" = "`id -u $ORACLE_USER`" ] || exit 1
-	[ "`id -g`" = "`id -g $ORACLE_USER`" ] || exit 1
-
-	# Go home.
-	cd $ORACLE_HOME
-
-	return 0
-}
-
-
-#
-# Start Oracle
-#
-start_oracle() {
-    initlog -n $SCRIPT -q -s "Starting Oracle Database"
-	start_db || return 1
-	
-    for LISTENER in ${LISTENERS}; do
-        logfile=/tmp/$SCRIPT-lsn-$$.log
-        initlog -n $SCRIPT -q -s "Starting Oracle Listener $LISTENER"
-        lsnrctl start $LISTENER > $logfile
-        initlog -q -c "cat $logfile"
-        rm -f $logfile
-    done
-
-	if [ -n "$LOCKFILE" ]; then
-		touch $LOCKFILE
-	fi
-	return 0
-}
-
-
-#
-# Stop Oracle
-#
-stop_oracle() {
-	if ! [ -e "$ORACLE_HOME/bin/lsnrctl" ]; then
-		initlog -n $SCRIPT -q -s "Oracle Listener Control is not available ($ORACLE_HOME not mounted?)"
-		return 0
-	fi
-
-    initlog -n $SCRIPT -q -s "Stopping Oracle Database"
-    stop_db || return 1
-
-	
-    for LISTENER in ${LISTENERS}; do
-        initlog -n $SCRIPT -q -s "Stopping Oracle Listener $LISTENER"
-        lsnrctl stop $LISTENER
-    done
-
-    initlog -n $SCRIPT -q -s "Waiting for all Oracle processes to exit"
-    exit_idle
-
-	if [ $? -ne 0 ]; then
-		initlog -n $SCRIPT -q -s "WARNING: Not all Oracle processes exited cleanly"
-	fi
-
-	if [ -n "$LOCKFILE" ]; then
-		rm -f $LOCKFILE
-	fi
-	return 0
-}
-
-
-#
-# Find and display the status of iAS infrastructure.
-#
-# This has three parts:
-# (1) Oracle database itself
-# (2) Oracle listener process
-# (3) OPMN and OPMN-managed processes
-#
-# - If all are (cleanly) down, we return 3.  In order for this to happen,
-# $LOCKFILE must not exist.  In this case, we try and restart certain parts
-# of the service - as this may be running in a clustered environment.
-#
-# - If some but not all are running (and, if $LOCKFILE exists, we could not
-# restart the failed portions), we return 1 (ERROR)
-#
-# - If all are running, return 0.  In the "all-running" case, we recreate
-# $LOCKFILE if it does not exist.
-#
-status_oracle() {
-	declare -i subsys_lock=1
-	declare -i last 
-	declare -i depth=$1
-
-	# Check for lock file. Crude and rudimentary, but it works
-	if [ -z "$LOCKFILE" ] || [ -f $LOCKFILE ]; then
-		subsys_lock=0 
-	fi
-
-	# Check database status
-	get_db_status $subsys_lock $depth
-	update_status $? # Start
-	last=$?
-
-	# Check & report listener status
-    for LISTENER in ${LISTENERS}; do
-        get_lsnr_status $subsys_lock $depth $LISTENER
-        update_status $? $last
-        last=$?
-    done
-	
-	# No lock file, but everything's running.  Put the lock
-	# file back. XXX - this kosher?
-	if [ $last -eq 0 ] && [ $subsys_lock -ne 0 ]; then
-		touch $LOCKFILE
-	fi
-
-	return $last
-}
-
-
-########################
-# Do some real work... #
-########################
-
-case $1 in
-    meta-data)
-        cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-        exit 0
-        ;;
-	start)
-        validation_checks $*
-		start_oracle
-		exit $?
-		;;
-	stop)
-        validation_checks $*
-		stop_oracle
-		exit $?
-		;;
-	status|monitor)
-        validation_checks $*
-		status_oracle $OCF_CHECK_LEVEL
-		exit $?
-		;;
-	restart)
-		$0 stop || exit $?
-		$0 start || exit $?
-		exit 0
-		;;
-	*)
-		echo "usage: $SCRIPT {start|stop|restart|status|monitor|meta-data}"
-		exit 1
-		;;
-esac
-
-exit 0
diff --git a/rgmanager/src/resources/oralistener.metadata b/rgmanager/src/resources/oralistener.metadata
deleted file mode 100644
index 30f8731..0000000
--- a/rgmanager/src/resources/oralistener.metadata
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" ?>
-<!-- $Id: oralistener.metadata 61 2009-06-29 10:01:49Z hevirtan $ -->
-
-<!-- Resource metadata for Oracle listener agent -->
-<resource-agent name="oralistener" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	Oracle 10g Listener Instance
-    </longdesc>
-    <shortdesc lang="en">
-	Oracle 10g Listener Instance
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    	<longdesc lang="en">
-				Listener name
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Listener name
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-
-        <parameter name="user" required="1">
-	    	<longdesc lang="en">
-				Oracle user name.  This is the user name of the Oracle
-				user which the Oracle instance runs as.
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Oracle User Name
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-
-        <parameter name="home" required="1">
-	    	<longdesc lang="en">
-				This is the Oracle database home directory.
-				This is configured when you install Oracle.
-	    	</longdesc>
-        	<shortdesc lang="en">
-				Oracle Home Directory
-        	</shortdesc>
-	    	<content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="90"/>
-		<action name="stop" timeout="30"/>
-		<!-- <action name="recover" timeout="90"/> -->
-
-		<action name="status" timeout="90" interval="5m"/>
-		<action name="monitor" timeout="90" interval="5m"/>
-
-		<action name="meta-data" timeout="0"/>
-		<action name="verify-all" timeout="0"/>
-    </actions>
-
-</resource-agent>
diff --git a/rgmanager/src/resources/oralistener.sh b/rgmanager/src/resources/oralistener.sh
deleted file mode 100644
index 3d6b839..0000000
--- a/rgmanager/src/resources/oralistener.sh
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/bash
-#
-# $Id: oralistener.sh 127 2009-08-21 09:17:52Z hevirtan $
-#
-# Red Hat Cluster Suite resource agent for controlling Oracle 10g
-# listener instances. This script will start, stop and monitor running
-# listeners.
-#
-# start:    Will start given listener instance
-#
-# stop:     Will stop given listener instance
-#
-# monitor:  Will check that the listener is OK by calling lsnrctl status
-#
-
-# Grab the global RHCS helper functions
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare -i	RESTART_RETRIES=3
-
-ORACLE_USER=$OCF_RESKEY_user
-ORACLE_HOME=$OCF_RESKEY_home
-LISTENER=$OCF_RESKEY_name
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:$ORACLE_HOME/bin
-export LC_ALL LANG PATH ORACLE_HOME
-
-verify_all() {
-    clog_service_verify $CLOG_INIT
-
-    if [ -z "$OCF_RESKEY_name" ]; then
-        clog_service_verify $CLOG_FAILED "Invalid name of service (listener name)"
-        return $OCF_ERR_ARGS
-    fi
-
-    if [ -z "$OCF_RESKEY_home" ]; then
-        clog_service_verify $CLOG_FAILED "No Oracle home specified."
-        return $OCF_ERR_ARGS
-    fi
-
-    if [ -z "$OCF_RESKEY_user" ]; then
-        clog_service_verify $CLOG_FAILED "No Oracle username specified."
-        return $OCF_ERR_ARGS
-    fi
-        
-    # Make sure the lsnrctl binary is in our $PATH
-    if [ ! -x $(which lsnrctl) ]; then
-        clog_service_verify $CLOG_FAILED "oralistener:${OCF_RESKEY_home}: Unable to locate lsnrctl command from path! ($PATH)"
-        return $OCF_ERR_GENERIC
-    fi
-
-    clog_service_verify $CLOG_SUCCEED
-    return 0
-}
-
-start () {
-    clog_service_start $CLOG_INIT
-    
-    logfile="/tmp/oracle_lsn.$$"
-    su -p - $ORACLE_USER -c "lsnrctl start $LISTENER > $logfile"
-
-    initlog -q -c "cat $logfile"
-    rm -f $logfile
-
-    clog_service_start $CLOG_SUCCEED
-    return 0
-}
- 
-stop () {
-    clog_service_stop $CLOG_INIT
-    
-    logfile="/tmp/oracle_lsn.$$"
-    su -p - $ORACLE_USER -c "lsnrctl stop $LISTENER > $logfile"
-
-    initlog -q -c "cat $logfile"
-    rm -f $logfile
-
-    clog_service_stop $CLOG_SUCCEED
-    return 0
-}
- 
-monitor () {
-    clog_service_status $CLOG_INIT
-    
-    su -p - $ORACLE_USER -c "lsnrctl status $LISTENER"
-    rv=$?
-    if [ $rv == 0 ]; then
-        clog_service_status $CLOG_SUCCEED
-	    return 0 # Listener is running fine
-    else
-        clog_service_status $CLOG_FAILED
-        return $OCF_ERR_GENERIC
-    fi
-}
-
-recover() {
-	for (( i=$RESTART_RETRIES ; i; i-- )); do
-		start
-		if [ $? == 0 ] ; then
-		    break
-		fi
-	done
-
-	if [ $i -eq 0 ]; then
-		# stop/start's failed - return 1 (failure)
-		return 1
-	fi
-
-    status
-	if [ $? != 0 ] ; then
-		return 1 # Problem restarting the Listener
-	fi
-
-	return 0 # Success restarting the Listener
-}
-
-case $1 in
-    meta-data)
-        cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-        exit 0
-        ;;
-    verify-all)
-        verify_all
-        exit $?
-        ;;
-    start)
-        verify_all && start
-        exit $?
-        ;;
-    stop)
-        verify_all && stop
-        exit $?
-        ;;
-    recover)
-        verify_all && recover
-        exit $?
-        ;;
-    status|monitor)
-        verify_all
-        monitor
-        exit $?
-        ;;
-    *)
-        echo "Usage: $0 {start|stop|recover|monitor|status|meta-data|verify-all}"
-        exit $OCF_ERR_GENERIC
-        ;;
-esac
diff --git a/rgmanager/src/resources/postgres-8.metadata b/rgmanager/src/resources/postgres-8.metadata
deleted file mode 100644
index ad3f84e..0000000
--- a/rgmanager/src/resources/postgres-8.metadata
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="postgres-8">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of PostgreSQL server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a PostgreSQL server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/var/lib/pgsql/data/postgresql.conf"/>
-        </parameter>
-
-	<parameter name="postmaster_user">
-		<longdesc lang="en">
-			User who runs the database server because it can't be
-			run by root.
-		</longdesc>
-		<shortdesc lang="en">
-			User who runs the database server
-		</shortdesc>
-		<content type="string" default="postgres" />
-	</parameter>
-
-	<parameter name="postmaster_options">
-		<longdesc lang="en">
-			Other command-line options for postmaster
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for postmaster
-		</shortdesc>
-		<content type="string" default="-D /var/lib/pgsql/data"/>
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
deleted file mode 100644
index b0b59c7..0000000
--- a/rgmanager/src/resources/postgres-8.sh
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare PSQL_POSTMASTER="/usr/bin/postmaster"
-declare PSQL_pid_file="`generate_name_for_pid_file`"
-declare PSQL_conf_dir="`generate_name_for_conf_dir`"
-declare PSQL_gen_config_file="$PSQL_conf_dir/postgresql.conf"
-declare PSQL_kill_timeout="5"
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_postmaster_user" ]; then
-		clog_servicer_verify $CLOG_FAILED "Invalid User"
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addressess="$3"
-	
-	declare ip_comma="";
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	declare x=1
-	for i in $ip_addressess; do
-		i=`echo $i | sed -e 's/\/.*$//'`
-		if [ $x -eq 1 ]; then
-			x=0
-			ip_comma=$i
-		else
-			ip_comma=$ip_comma,$i
-		fi 
-	done
-
-	generate_configTemplate "$generated_file" "$1"
-	echo "external_pid_file = '$PSQL_pid_file'" >> "$generated_file"
-	echo "listen_addresses = '$ip_comma'" >> "$generated_file"
-
-	echo >> "$generated_file"	
-	sed 's/^[[:space:]]*external_pid_file/### external_pid_file/i;s/^[[:space:]]*listen_addresses/### listen_addresses/i' < "$original_file" >> "$generated_file"
-	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	declare pguser_group
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$PSQL_conf_dir"
-	check_pid_file "$PSQL_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$PSQL_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	#
-	# Create an empty PID file for the postgres user and
-	# change it to be owned by the postgres user so that
-	# postmaster doesn't complain.
-	#
-	pguser_group=`groups $OCF_RESKEY_postmaster_user | cut -f1 -d ' '`
-	touch $PSQL_pid_file
-	chown $OCF_RESKEY_postmaster_user.$pguser_group $PSQL_pid_file
-
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	generate_config_file "$OCF_RESKEY_config_file" "$PSQL_gen_config_file" "$ip_addresses"
-
-	su - "$OCF_RESKEY_postmaster_user" -c "$PSQL_POSTMASTER -c config_file=\"$PSQL_gen_config_file\" \
-		$OCF_RESKEY_postmaster_options" &> /dev/null &
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic_sigkill "$PSQL_pid_file" "$OCF_RESKEY_shutdown_wait" "$PSQL_kill_timeout"
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$PSQL_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$PSQL_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/ra-api-1-modified.dtd b/rgmanager/src/resources/ra-api-1-modified.dtd
deleted file mode 100644
index 9c42d23..0000000
--- a/rgmanager/src/resources/ra-api-1-modified.dtd
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<!-- This is based on the RA-API-1.0 DTD from:
-     http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/ra-api-1.dtd
-
-     There are additions for rgmanager.  These additions should be
-     ignored by other RMs.
- -->
-
-<!ELEMENT resource-agent (version,longdesc,shortdesc,parameters,actions,special*) >
-<!ATTLIST resource-agent
-	name	CDATA	#REQUIRED
-	version CDATA   #IMPLIED>
-
-<!ELEMENT version (#PCDATA)>
-
-<!ELEMENT parameters (parameter*)>
-
-<!ELEMENT actions (action*)>
-
-<!-- Primary and required are for rgmanager use. -->
-<!ELEMENT parameter (longdesc+,shortdesc+,content)>
-<!ATTLIST parameter
-	name	CDATA	#REQUIRED
-	primary (1|0)   "0"
-	required (1|0)	"0"
-	inherit CDATA	""
-	unique	(1|0)	"0"
-	reconfig (1|0)  "0">
-
-<!ELEMENT longdesc ANY>
-<!ATTLIST longdesc
-	lang	NMTOKEN	#IMPLIED>
-
-<!ELEMENT shortdesc ANY>
-<!ATTLIST shortdesc
-	lang	NMTOKEN	#IMPLIED>
-
-<!ELEMENT content EMPTY>
-<!ATTLIST content
-	type	(string|integer|boolean)	#REQUIRED
-	default CDATA	#IMPLIED>
-
-<!ELEMENT action EMPTY>
-<!ATTLIST action
-	name	(start|stop|recover|status|reconfig|monitor|reload|meta-data|validate-all|migrate|methods)	#REQUIRED
-	timeout		CDATA	#REQUIRED
-	interval 	CDATA	#IMPLIED
-	start-delay 	CDATA	#IMPLIED
-	depth		CDATA	#IMPLIED>
-
-<!-- Special tag list for rgmanager -->
-<!ELEMENT special (attributes*, child*)>
-<!ATTLIST special
-	tag	CDATA	#REQUIRED>
-
-<!ELEMENT attributes EMPTY>
-<!ATTLIST attributes
-	maxinstances CDATA "0"
-	init_on_add CDATA "0"
-	destroy_on_delete CDATA "0">
-
-<!ELEMENT child EMPTY>
-<!ATTLIST child
-	type CDATA #REQUIRED
-	forbid (1|0) "0"
-	start CDATA "100"
-	stop CDATA "0">
diff --git a/rgmanager/src/resources/ra2man.xsl b/rgmanager/src/resources/ra2man.xsl
deleted file mode 100644
index 095a7b3..0000000
--- a/rgmanager/src/resources/ra2man.xsl
+++ /dev/null
@@ -1,158 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="no"/>
-
-<xsl:template match="parameter">
-.TP
-.B <xsl:value-of select="@name"/><xsl:text>
-</xsl:text>
-<xsl:value-of select="normalize-space(longdesc)"/><xsl:text>
-</xsl:text>
-<xsl:if test="@primary = 1">This is the defining attribute for the <b><xsl:value-of select="/resource-agent/@name"/></b> resource type, and will be shown in logs.
-</xsl:if>
-<xsl:if test="@unique = 1 or @primary = 1">No other instances of the 
-.B <xsl:value-of select="/resource-agent/@name"/>
-resource may have the same value for the 
-.B <xsl:value-of select="@name"/>
-parameter.
-</xsl:if>
-<xsl:if test="@required = 1 or @primary = 1">This parameter is required; the resource manager will ignore specification of a resource without this parameter.</xsl:if>
-<xsl:if test="@reconfig = 1">You may safely change this attribute on the fly; doing so will not cause a restart of the resource or its children.
-</xsl:if>
-Content: <xsl:value-of select="content/@type"/><xsl:text>
-</xsl:text>
-<xsl:if test="content/@default">Default Value: <xsl:value-of select="content/@default"/>
-</xsl:if>
-</xsl:template>
-
-<xsl:template match="action">
-.TP
-\fB<xsl:value-of select="@name"/>\fp<xsl:if test="@timeout"> (timeout: <xsl:value-of select="@timeout"/>) </xsl:if>
-<xsl:choose>
-<xsl:when test="@name = 'start'">
-This starts the resource.
-</xsl:when>
-<xsl:when test="@name = 'stop'">
-This stops the resource.
-</xsl:when>
-<xsl:when test="@name = 'monitor'">
-<xsl:if test="@depth">
-Depth <xsl:value-of select="@depth"/>.
-</xsl:if>
-This checks the status of the resource.  This is specified in the OCF Resource Agent API, but not LSB compliant.  This is synonymous with
-.B status
-on some resource managers.
-</xsl:when>
-<xsl:when test="@name = 'validate-all'">
-Given (minimally) all required parameters to start or check the status of the resource, validate that those parameters are correct as much as possible.
-</xsl:when>
-<xsl:when test="@name = 'meta-data'">
-Display the XML metadata describing this resource.
-</xsl:when>
-<xsl:when test="@name = 'reload'">Reconfigure the resource in-place with the new given parameters.
-</xsl:when>
-<xsl:when test="@name = 'recover'">
-Attempt to recover the resource in-place without affecting dependencies.  If this fails, the resource manager will try more forceful recovery (such as stop-start).
-</xsl:when>
-<!-- known non-OCF stuff -->
-<xsl:when test="@name = 'status'">
-<xsl:if test="@depth">Depth <xsl:value-of select="@depth"/>.
-</xsl:if>
-This checks the status of the resource.  This is LSB compliant, but not specified by the OCF Resource Agent API.  This is synonymous with
-.B monitor
-on some resource managers.
-</xsl:when>
-<xsl:when test="@name = 'reconfig'">
-Reconfigure the resource in-place with the new given parameters.
-</xsl:when>
-<xsl:when test="@name = 'verify-all'">
-Given (minimally) all required parameters to start or check the status of the resource, validate that those parameters are correct as much as possible.  This is a misinterpretation of the 
-.B validate-all
-action, and should be fixed.  Please report a bug.
-</xsl:when>
-<xsl:when test="@name = 'promote'">
-If this resource was the slave instance of the
-resource, promote it to master status.
-</xsl:when>
-<xsl:when test="@name = 'demote'">
-If this resource was the master instance of the
-resource, demote it to slave status.
-</xsl:when>
-<xsl:when test="@name = 'migrate'">
-Migrate this resource to another node in the cluster.
-</xsl:when>
-<!-- Ehhh -->
-<xsl:otherwise>
-The operational behavior of this is not known.
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template match="child">
-.PP
-<xsl:value-of select="@type"/> -
-Started at level <xsl:value-of select="@start"/>.
-Stopped at level <xsl:value-of select="@stop"/>.
-</xsl:template>
-<xsl:template match="/resource-agent">.TH RESOURCE_AGENT 8 2009-01-20 "<xsl:value-of select="@name"/> (Resource Agent)"
-.SH
-<xsl:value-of select="@name"/>
-Cluster Resource Agent
-
-.SH DESCRIPTION
-<xsl:value-of select="normalize-space(longdesc)"/>
-
-.SH PARAMETERS
-<xsl:apply-templates select="parameters"/>
-
-.SH RGMANAGER INTERNAL PARAMETERS
-.TP
-.B __enforce_timeouts
-If set to 1, an operation exceeding the defined timeout will be considered
-a failure of that operation.  Note that fail-to-stop is critical, and causes
-a service to enter the failed state.
-
-.TP
-.B __independent_subtree
-If set to 1, failure of a status operation of this resource or any of its
-children will be considered non-fatal unless a restart of this resource and
-all of its children also fails.
-
-.SH ACTIONS
-<xsl:apply-templates select="actions"/>
-
-.SH RGMANAGER NOTES
-<xsl:if test="special/@tag = 'rgmanager'">
-<xsl:if test="special/attributes/@maxinstances">
-.PP
-An instatnce of this resource defined in the
-.B &lt;resources&gt;
-section of
-.B cluster.conf
-can be referenced in the resource
-tree at most <xsl:value-of select="special/attributes/@maxinstances"/>
-time(s).  All subsequent references to this resource will be ignored.
-</xsl:if>
-<xsl:if test="special/attributes/@root">
-.PP
-This is the root resource class.  Other resource 
-types must be attached as children to this resource
-class.
-</xsl:if>
-<xsl:if test="special/child/@type">
-.PP
-Known Child Types:
-<xsl:apply-templates select="special"/>
-</xsl:if>
-</xsl:if>
-.SH REFERENCES
-.PP
-http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/resource-agent-api.txt?rev=HEAD - The Open Cluster Framework Resource Agent Application Programming Interface draft version 1.0
-
-.PP
-http://www.linux-foundation.org/spec/refspecs/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html - Linux Standards Base v3.1.0 - Init Script Actions
-
-.PP
-http://sources.redhat.com/cluster/wiki/RGManager - Linux-cluster Resource Group Manager information
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/rgmanager/src/resources/ra2ref.xsl b/rgmanager/src/resources/ra2ref.xsl
deleted file mode 100644
index 6e61073..0000000
--- a/rgmanager/src/resources/ra2ref.xsl
+++ /dev/null
@@ -1,10 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="yes"/>
-<xsl:template name="capitalize">
-	<xsl:param name="value"/>
-	<xsl:variable name="normalized" select="translate($value, '_abcdefghijklmnopqrstuvwrxyz', '-ABCDEFGHIJKLMNOPQRSTUVWRXYZ')"/>
-	<xsl:value-of select="$normalized"/>
-</xsl:template>
-<xsl:template match="/resource-agent">
-        &lt;ref name="<xsl:call-template name="capitalize"><xsl:with-param name="value" select="@name"/></xsl:call-template>"/&gt;</xsl:template>
-</xsl:stylesheet>
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
deleted file mode 100644
index 11782d7..0000000
--- a/rgmanager/src/resources/ra2rng.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="yes"/>
-<xsl:template name="capitalize">
-	<xsl:param name="value"/>
-	<xsl:variable name="normalized" select="translate($value, '_abcdefghijklmnopqrstuvwrxyz', '-ABCDEFGHIJKLMNOPQRSTUVWRXYZ')"/>
-	<xsl:value-of select="$normalized"/>
-</xsl:template>
-
-<xsl:template match="/resource-agent">
-  &lt;define name="<xsl:call-template name="capitalize"><xsl:with-param name="value" select="@name"/></xsl:call-template>"&gt;
-    &lt;element name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>"&gt;
-      &lt;choice&gt;
-      &lt;group&gt;
-        &lt;!-- rgmanager specific stuff --&gt;
-        &lt;attribute name="ref" rha:description="Reference to existing <xsl:value-of select="@name"/> resource in the resources section."/&gt;
-      &lt;/group&gt;
-      &lt;group&gt;<xsl:for-each select="parameters/parameter">
-		<xsl:choose>
-			<xsl:when test="@required = 1 or @primary = 1">
-        &lt;attribute name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>"/&gt;</xsl:when>
-			<xsl:otherwise>
-        &lt;optional&gt;
-          &lt;attribute name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>"/&gt;
-        &lt;/optional&gt;</xsl:otherwise>
-		</xsl:choose>
-	</xsl:for-each>
-      &lt;/group&gt;
-      &lt;/choice&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;ref name="CHILDREN"/&gt;
-      &lt;/optional&gt;
-    &lt;/element&gt;
-  &lt;/define&gt;
-
-</xsl:template>
-</xsl:stylesheet>
diff --git a/rgmanager/src/resources/resources.rng.head b/rgmanager/src/resources/resources.rng.head
deleted file mode 100644
index 750c6d3..0000000
--- a/rgmanager/src/resources/resources.rng.head
+++ /dev/null
@@ -1 +0,0 @@
-<!-- Autogenerated.  Paste in to cluster.ng in the 'resources' section -->
diff --git a/rgmanager/src/resources/resources.rng.mid b/rgmanager/src/resources/resources.rng.mid
deleted file mode 100644
index cc2dff3..0000000
--- a/rgmanager/src/resources/resources.rng.mid
+++ /dev/null
@@ -1,3 +0,0 @@
-  <define name="CHILDREN">
-    <zeroOrMore>
-     <choice>
diff --git a/rgmanager/src/resources/resources.rng.tail b/rgmanager/src/resources/resources.rng.tail
deleted file mode 100644
index 5cbcc9d..0000000
--- a/rgmanager/src/resources/resources.rng.tail
+++ /dev/null
@@ -1,24 +0,0 @@
-
-      <ref name="RESOURCEACTION"/>
-     </choice>
-    </zeroOrMore>
-  </define>
-
-  <define name="RESOURCEACTION">
-   <zeroOrMore>
-    <element name="action" rha:description="Overrides resource action timings for a resource instance.">
-     <attribute name="name" rha:description="Name of resource action (start, stop, status, etc.)."/>
-     <optional>
-      <attribute name="depth" rha:description="Status check depth (resource agent dependent; * = all depths)."/>
-     </optional>
-     <optional>
-      <attribute name="interval" rha:description="Status check interval."/>
-     </optional>
-     <optional>
-      <attribute name="timeout" rha:description="Action timeout.  Meaningless unless __enforce_timeouts is set for this resource."/>
-     </optional>
-    </element>
-   </zeroOrMore>
-  </define>
-
-<!-- End autogenerated resources definitions -->
diff --git a/rgmanager/src/resources/samba.metadata b/rgmanager/src/resources/samba.metadata
deleted file mode 100644
index 1e03fcd..0000000
--- a/rgmanager/src/resources/samba.metadata
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="samba">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </longdesc>
-    <shortdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                Samba Symbolic Name.
-            </longdesc>
-            <shortdesc lang="en">
-                Samba Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/samba/smb.conf"/>
-        </parameter>
-
-	<parameter name="smbd_options">
-		<longdesc lang="en">
-			Other command-line options for smbd
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for smbd
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="nmbd_options">
-		<longdesc lang="en">
-			Other command-line options for nmbd
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for nmbd
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this smb service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-        <action name="stop" timeout="0"/>
-
-	<!-- This is just a wrapper for LSB init scripts, so monitor
-	     and status can't have a timeout, nor do they do any extra
-	     work regardless of the depth -->
-        <action name="status" interval="30s" timeout="0"/>
-        <action name="monitor" interval="30s" timeout="0"/>
-
-        <action name="meta-data" timeout="0"/>
-        <action name="validate-all" timeout="0"/>
-    </actions>
-</resource-agent>
diff --git a/rgmanager/src/resources/samba.sh b/rgmanager/src/resources/samba.sh
deleted file mode 100644
index f7c134b..0000000
--- a/rgmanager/src/resources/samba.sh
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare SAMBA_SMBD=/usr/sbin/smbd
-declare SAMBA_NMBD=/usr/sbin/nmbd
-declare SAMBA_pid_dir="`generate_name_for_pid_dir`"
-declare SAMBA_conf_dir="`generate_name_for_conf_dir`"
-declare SAMBA_smbd_pid_file="$SAMBA_pid_dir/smbd-smb.conf.pid"
-declare SAMBA_nmbd_pid_file="$SAMBA_pid_dir/nmbd-smb.conf.pid"
-declare SAMBA_gen_config_file="$SAMBA_conf_dir/smb.conf"
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addresses="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	generate_configTemplate "$generated_file" "$1"
-
-	echo "pid directory = \"$SAMBA_pid_dir\"" >> "$generated_file"
-	echo "interfaces = $ip_addresses" >> "$generated_file"
-	echo "bind interfaces only = Yes" >> "$generated_file"
-	echo "netbios name = ${OCF_RESKEY_name/ /_}" >> "$generated_file"
-	echo >> "$generated_file"	
-	sed 's/^[[:space:]]*pid directory/### pid directory/i;s/^[[:space:]]*interfaces/### interfaces/i;s/^[[:space:]]*bind interfaces only/### bind interfaces only/i;s/^[[:space:]]*netbios name/### netbios name/i' \
-	     < "$original_file" >> "$generated_file"
-	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	mkdir -p "$SAMBA_pid_dir"
-	create_conf_directory "$SAMBA_conf_dir"
-	check_pid_file "$SAMBA_smbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$SAMBA_smbd_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	check_pid_file "$SAMBA_nmbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$SAMBA_nmbd_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	generate_config_file "$OCF_RESKEY_config_file" "$SAMBA_gen_config_file" "$ip_addresses"
-
-	$SAMBA_SMBD -D -s "$SAMBA_gen_config_file" $OCF_RESKEY_smbd_options
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	$SAMBA_NMBD -D -s "$SAMBA_gen_config_file" $OCF_RESKEY_nmbd_options	
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	 
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$SAMBA_smbd_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	stop_generic "$SAMBA_nmbd_pid_file"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ -e "$SAMBA_smbd_pid_file" ]; then
-		rm -f "$SAMBA_smbd_pid_file"
-	fi
-
-	if [ -e "$SAMBA_nmbd_pid_file" ]; then
-		rm -f "$SAMBA_nmbd_pid_file"
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$SAMBA_smbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$SAMBA_smbd_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	status_check_pid "$SAMBA_nmbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$SAMBA_nmbd_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/script.sh b/rgmanager/src/resources/script.sh
deleted file mode 100644
index 4129811..0000000
--- a/rgmanager/src/resources/script.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-
-#
-# Script to handle a non-OCF script (e.g. a normal init-script)
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="script">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        The script resource allows a standard LSB-compliant init script
-	to be used to start a clustered service.
-    </longdesc>
-    <shortdesc lang="en">
-        LSB-compliant init script as a clustered resource.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                Name
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="file" unique="1" required="1">
-            <longdesc lang="en">
-                Path to script
-            </longdesc>
-            <shortdesc lang="en">
-                Path to script
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name, in case the
-		script wants to know this information.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-        <action name="stop" timeout="0"/>
-
-	<!-- This is just a wrapper for LSB init scripts, so monitor
-	     and status can't have a timeout, nor do they do any extra
-	     work regardless of the depth -->
-        <action name="status" interval="30s" timeout="0"/>
-        <action name="monitor" interval="30s" timeout="0"/>
-
-        <action name="meta-data" timeout="0"/>
-        <action name="validate-all" timeout="0"/>
-    </actions>
-</resource-agent>
-EOT
-}
-
-case $1 in
-	meta-data)
-		meta_data
-		exit 0
-		;;
-	validate-all)
-		exit 0 # XXX XXX XXX
-		;;
-	*)
-		;;
-esac
-
-[ -n "${OCF_RESKEY_file}" ] || exit $OCF_ERR_ARGS      # Invalid Argument
-[ -f "${OCF_RESKEY_file}" ] || exit $OCF_ERR_INSTALLED # Program not installed
-[ -x "${OCF_RESKEY_file}" ] || exit $OCF_ERR_GENERIC   # Generic error
-
-# Don't need to catch return codes; this one will work.
-ocf_log info "Executing ${OCF_RESKEY_file} $1"
-${OCF_RESKEY_file} $1
-
-declare -i rv=$?
-if [ $rv -ne 0 ]; then
-	ocf_log err "script:$OCF_RESKEY_name: $1 of $OCF_RESKEY_file failed (returned $rv)"
-	exit $OCF_ERR_GENERIC
-fi
diff --git a/rgmanager/src/resources/service.sh b/rgmanager/src/resources/service.sh
deleted file mode 100644
index e37f518..0000000
--- a/rgmanager/src/resources/service.sh
+++ /dev/null
@@ -1,282 +0,0 @@
-#!/bin/bash
-
-#
-# Dummy OCF script for resource group
-#
-
-# Grab nfs lock tricks if available
-export NFS_TRICKS=1
-if [ -f "$(dirname $0)/svclib_nfslock" ]; then
-	. $(dirname $0)/svclib_nfslock
-	NFS_TRICKS=0
-fi
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="service">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines a collection of resources, known as a resource
-        group or cluster service.
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a service (resource group).
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" required="1" primary="1">
-            <longdesc lang="en">
-                This is the name of the resource group.
-            </longdesc>
-            <shortdesc lang="en">
-                Name.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-    
-        <parameter name="domain" reconfig="1">
-            <longdesc lang="en">
-                Failover domains define lists of cluster members
-                to try in the event that a resource group fails.
-            </longdesc>
-            <shortdesc lang="en">
-                Failover domain.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="autostart" reconfig="1">
-            <longdesc lang="en">
-	    	If set to yes, this resource group will automatically be started
-		after the cluster forms a quorum.  If set to no, this resource
-		group will start in the 'disabled' state after the cluster forms
-		a quorum.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Automatic start after quorum formation
-            </shortdesc>
-            <content type="boolean" default="1"/>
-        </parameter>
-
-        <parameter name="exclusive" reconfig="1">
-            <longdesc lang="en">
-	    	If set, this resource group will only relocate to
-		nodes which have no other resource groups running in the
-		event of a failure.  If no empty nodes are available,
-		this resource group will not be restarted after a failure.
-		Additionally, resource groups will not automatically
-		relocate to the node running this resource group.  This
-		option can be overridden by manual start and/or relocate
-		operations.
-            </longdesc>
-            <shortdesc lang="en">
-	        Exclusive service.
-            </shortdesc>
-            <content type="boolean" default="0"/>
-        </parameter>
-
-	<parameter name="nfslock">
-	    <longdesc lang="en">
-	    	Enable NFS lock workarounds.  When used with a compatible
-		HA-callout program like clunfslock, this could be used
-		to provide NFS lock failover, but at significant cost to
-		other services on the machine.  This requires a compatible
-		version of nfs-utils and manual configuration of rpc.statd;
-		see 'man rpc.statd' to see if your version supports
-		the -H parameter.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds.
-	    </shortdesc>
-	    <content type="boolean" default="0"/>
-	</parameter>
-
-	<parameter name="nfs_client_cache">
-            <longdesc lang="en">
-	   	On systems with large numbers of exports, a performance
-		problem in the exportfs command can cause inordinately long
-		status check times for services with lots of mounted
-		NFS clients.  This occurs because exportfs does DNS queries
-		on all clients in the export list.
-
-		Setting this option to '1' will enable caching of the export
-		list returned from the exportfs command on a per-service
-		basis.  The cache will last for 30 seconds before expiring
-		instead of being generated each time an nfsclient resource
-		is called.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Enable exportfs list caching (performance).
-            </shortdesc>
-	    <content type="integer" default="0"/>
-	</parameter>
-
-                
-        <parameter name="recovery" reconfig="1">
-            <longdesc lang="en">
-	        This currently has three possible options: "restart" tries
-		to restart failed parts of this resource group locally before
-		attempting to relocate (default); "relocate" does not bother
-		trying to restart the service locally; "disable" disables
-		the resource group if any component fails.  Note that
-		any resource with a valid "recover" operation which can be
-		recovered without a restart will be.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Failure recovery policy (restart, relocate, or disable).
-            </shortdesc>
-            <content type="string" default="restart"/>
-        </parameter>
-
-        <parameter name="depend">
-            <longdesc lang="en">
-		Service dependency; will not start without the specified
-		service running.
-            </longdesc>
-            <shortdesc lang="en">
-		Top-level service this depends on, in service:name format.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="depend_mode">
-            <longdesc lang="en">
-		Service dependency mode.
-		hard - This service is stopped/started if its dependency
-		       is stopped/started
-		soft - This service only depends on the other service for
-		       initial startip.  If the other service stops, this
-		       service is not stopped.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Service dependency mode (soft or hard).
-            </shortdesc>
-            <content type="string" default="hard"/>
-        </parameter>
-
-        <parameter name="max_restarts">
-            <longdesc lang="en">
-	    	Maximum restarts for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Maximum restarts for this service.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-        <parameter name="restart_expire_time">
-            <longdesc lang="en">
-	    	Restart expiration time.  A restart is forgotten
-		after this time.  When combined with the max_restarts
-		option, this lets administrators specify a threshold
-		for when to fail over services.  If max_restarts
-		is exceeded in this given expiration time, the service
-		is relocated instead of restarted again.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Restart expiration time; amount of time before a restart
-		is forgotten.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-	<parameter name="priority">
-	    <longdesc lang="en">
-		Priority for the service.  In a failover scenario, this
-		indicates the ordering of the service (1 is processed
-		first, 2 is processed second, etc.).  This overrides the
-		order presented in cluster.conf.  This option only has
-		an effect if central processing within rgmanager is turned
-		on.
-	    </longdesc>
-	    <shortdesc lang="en">
-		Service priority.
-	    </shortdesc>
-	    <content type="integer" default="0"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-        <action name="stop" timeout="5"/>
-	
-	<!-- No-ops.  Groups are abstract resource types. 
-        <action name="status" timeout="5" interval="1h"/>
-        <action name="monitor" timeout="5" interval="1h"/>
- -->
-
-        <action name="reconfig" timeout="5"/>
-        <action name="recover" timeout="5"/>
-        <action name="reload" timeout="5"/>
-        <action name="meta-data" timeout="5"/>
-        <action name="validate-all" timeout="5"/>
-    </actions>
-    
-    <special tag="rgmanager">
-        <attributes maxinstances="1"/>
-        <child type="lvm" start="1" stop="9"/>
-        <child type="fs" start="2" stop="8"/>
-        <child type="clusterfs" start="3" stop="7"/>
-        <child type="netfs" start="4" stop="6"/>
-	<child type="nfsexport" start="5" stop="5"/>
-
-	<child type="nfsclient" start="6" stop="4"/>
-
-        <child type="ip" start="7" stop="2"/>
-        <child type="smb" start="8" stop="3"/>
-        <child type="script" start="9" stop="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-#
-# A Resource group is abstract, but the OCF RA API doesn't allow for abstract
-# resources, so here it is.
-#
-case $1 in
-	start)
-		#
-		# XXX If this is set, we kill lockd.  If there is no
-		# child IP address, then clients will NOT get the reclaim
-		# notification.
-		#
-		if [ $NFS_TRICKS -eq 0 ]; then
-			if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   		   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-				pkill -KILL -x lockd
-			fi
-		fi
-		exit 0
-		;;
-	stop)
-		exit 0
-		;;
-	recover|restart)
-		exit 0
-		;;
-	status|monitor)
-		exit 0
-		;;
-	reload)
-		exit 0
-		;;
-	meta-data)
-		meta_data
-		exit 0
-		;;
-	validate-all)
-		exit 0
-		;;
-	reconfig)
-		exit 0
-		;;
-	*)
-		exit 0
-		;;
-esac
diff --git a/rgmanager/src/resources/smb.sh b/rgmanager/src/resources/smb.sh
deleted file mode 100644
index e62678b..0000000
--- a/rgmanager/src/resources/smb.sh
+++ /dev/null
@@ -1,677 +0,0 @@
-#!/bin/bash
-
-#
-# Script to manage a Samba file-sharing service component.
-# Unline NFS, this should be placed at the top level of a service
-# because it will try to gather information necessary to run the
-# smbd/nmbd daemons at run-time from the service structure.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-#
-# Definitions!
-#
-declare SAMBA_CONFIG_DIR=/etc/samba
-declare SMBD_COMMAND=/usr/sbin/smbd
-declare NMBD_COMMAND=/usr/sbin/nmbd
-declare KILLALL_COMMAND=/usr/bin/killall
-declare SAMBA_PID_DIR=/var/run/samba
-declare SAMBA_LOCK_DIR=/var/cache/samba
-
-#
-# gross globals
-#
-declare -a ipkeys
-declare -a fskeys
-
-# Don't change please :)
-_FAIL=255
-
-. $(dirname $0)/ocf-shellfuncs
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="smb">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </longdesc>
-    <shortdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                Samba Symbolic Name.  This name will
-		correspond to /etc/samba/smb.conf.NAME
-            </longdesc>
-            <shortdesc lang="en">
-                Samba Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="workgroup">
-            <longdesc lang="en">
-	    	Workgroup name
-            </longdesc>
-            <shortdesc lang="en">
-	    	Workgroup name
-            </shortdesc>
-	    <content type="string" default="LINUXCLUSTER"/>
-        </parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this smb service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-        <action name="stop" timeout="0"/>
-
-	<!-- This is just a wrapper for LSB init scripts, so monitor
-	     and status can't have a timeout, nor do they do any extra
-	     work regardless of the depth -->
-        <action name="status" interval="30s" timeout="0"/>
-        <action name="monitor" interval="30s" timeout="0"/>
-
-        <action name="meta-data" timeout="0"/>
-        <action name="validate-all" timeout="0"/>
-    </actions>
-</resource-agent>
-EOT
-}
-
-
-#
-# Usage: ccs_get key
-#
-ccs_get()
-{
-	declare outp
-	declare key
-
-	[ -n "$1" ] || return $_FAIL
-
-	key="$*"
-
-	outp=$(ccs_tool query "$key" 2>&1)
-	if [ $? -ne 0 ]; then
-		if [ "$outp" = "${outp/No data available/}" ] || [ "$outp" = "${outp/Operation not permitted/}" ]; then
-			ocf_log err "$outp ($key)"
-			return $_FAIL
-		fi
-
-		# no real error, just no data available
-		return 0
-	fi
-
-	echo $outp
-
-	return 0
-}
-
-
-#
-# Build a list of service IP keys; traverse refs if necessary
-#
-get_service_ip_keys()
-{
-	declare svc=$1
-	declare -i x y=0
-	declare outp
-	declare key
-
-	#
-	# Find service-local IP keys
-	#
-	x=1
-	while : ; do
-		key="/cluster/rm/service[@name=\"$svc\"]/ip[$x]"
-
-		#
-		# Try direct method
-		#
-		outp=$(ccs_get "$key/@address")
-		if [ $? -ne 0 ]; then
-			return 1
-		fi
-
-		#
-		# Try by reference
-		#
-		if [ -z "$outp" ]; then
-			outp=$(ccs_get "$key/@ref")
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			key="/cluster/rm/resources/ip[@address=\"$outp\"]"
-		fi
-
-		if [ -z "$outp" ]; then
-			break
-		fi
-
-		#ocf_log debug "IP $outp found @ $key"
-
-		ipkeys[$y]="$key"
-
-		((y++))
-		((x++))
-	done
-
-	ocf_log debug "$y IP addresses found for $svc/$OCF_RESKEY_name"
-
-	return 0
-}
-
-
-#
-# Build a list of service fs keys, traverse refs if necessary
-#
-get_service_fs_keys()
-{
-	declare svc=$1
-	declare -i x y=0
-	declare outp
-	declare key
-
-	#
-	# Find service-local IP keys
-	#
-	x=1
-	while : ; do
-		key="/cluster/rm/service[@name=\"$svc\"]/fs[$x]"
-
-		#
-		# Try direct method
-		#
-		outp=$(ccs_get "$key/@name")
-		if [ $? -ne 0 ]; then
-			return 1
-		fi
-
-		#
-		# Try by reference
-		#
-		if [ -z "$outp" ]; then
-			outp=$(ccs_get "$key/@ref")
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			key="/cluster/rm/resources/fs[@name=\"$outp\"]"
-		fi
-
-		if [ -z "$outp" ]; then
-			break
-		fi
-
-		#ocf_log debug "filesystem $outp found @ $key"
-
-		fskeys[$y]="$key"
-
-		((y++))
-		((x++))
-	done
-
-	ocf_log debug "$y filesystems found for $svc/$OCF_RESKEY_name"
-
-	return 0
-}
-
-
-build_ip_list()
-{
-	declare ipaddrs ipaddr
-	declare -i x=0
-
-	while [ -n "${ipkeys[$x]}" ]; do
-		ipaddr=$(ccs_get "${ipkeys[$x]}/@address")
-		if [ -z "$ipaddr" ]; then
-			break
-		fi
-
-		ipaddrs="$ipaddrs $ipaddr"
-
-		((x++))
-	done
-
-	echo $ipaddrs
-}
-
-
-add_sha1()
-{
-	declare sha1line="# rgmanager-sha1 $(sha1sum "$1")"
-	echo $sha1line >> "$1"
-}
-
-
-verify_sha1()
-{
-	declare tmpfile="$(mktemp /tmp/smb-$OCF_RESKEY_name.tmp.XXXXXX)"
-	declare current exp
-
-	exp=$(grep "^# rgmanager-sha1.*$1" "$1" | head -1)
-	if [ -z "$exp" ]; then
-		# No sha1 line.  We're done.
-		ocf_log debug "No SHA1 info in $1"
-		return 1
-	fi
-
-	#
-	# Find expected sha1 and expected file name
-	#
-	exp=${exp/*sha1 /}
-	exp=${exp/ */}
-
-	grep -v "^# rgmanager-sha1" "$1" > "$tmpfile"
-	current=$(sha1sum "$tmpfile")
-	current=${current/ */}
-
-	rm -f "$tmpfile"
-
-	if [ "$current" = "$exp" ]; then
-		ocf_log debug "SHA1 sum matches for $1"
-		return 0
-	fi
-	ocf_log debug "SHA1 sum does not match for $1"
-	return 1
-}
-
-
-add_fs_entries()
-{
-	declare conf="$1"
-	declare sharename
-	declare sharepath key
-
-	declare -i x=0
-
-	while [ -n "${fskeys[$x]}" ]; do
-		key="${fskeys[$x]}/@name"
-
-		sharename=$(ccs_get "$key")
-		if [ -z "$sharename" ]; then
-			break
-		fi
-
-		key="${fskeys[$x]}/@mountpoint"
-		sharepath=$(ccs_get "$key")
-		if [ -z "$sharepath" ]; then
-			break
-		fi
-
-		cat >> "$conf" <<EODEV
-[$sharename]
-	comment = Auto-generated $sharename share
-	# Hide the secret cluster files
-	veto files = /.clumanager/.rgmanager/
-	browsable = yes
-	writable = no
-	public = yes
-	path = $sharepath
-
-EODEV
-
-		((x++))
-	done
-}
-
-
-#
-# Generate the samba configuration if neede for this service.
-#
-gen_smb_conf()
-{
-	declare conf="$1"
-	declare lvl="debug"
-
-	if [ -f "$conf" ]; then
-		verify_sha1 "$conf"
-		if [ $? -ne 0 ]; then
-			ocf_log debug "Config file changed; skipping"
-			return 0
-		fi
-	else
-		lvl="info"
-	fi
-
-	ocf_log $lvl "Creating $conf"
-
-	get_service_ip_keys "$OCF_RESKEY_service_name"
-	get_service_fs_keys "$OCF_RESKEY_service_name"
-
-	cat > "$conf" <<EOT
-#
-# "$conf"
-#
-# This template configuration wass automatically generated, and will
-# be automatically regenerated if removed.  Please modify this file to
-# speficy subdirectories and/or client access permissions.
-#
-# Once this file has been altered, automatic re-generation will stop.
-# Remember to copy this file to all other cluster members after making
-# changes, or your SMB service will not operate correctly.
-#
-# From a cluster perspective, the key fields are:
-#     lock directory - must be unique per samba service.
-#     bind interfaces only - must be present set to yes.
-#     interfaces - must be set to service floating IP address.
-#     path - must be the service mountpoint or subdirectory thereof.
-#
-
-[global]
-        workgroup = $OCF_RESKEY_workgroup
-        pid directory = /var/run/samba/$OCF_RESKEY_name
-        lock directory = /var/cache/samba/$OCF_RESKEY_name
-	log file = /var/log/samba/%m.log
-	#private dir = /var/
-	encrypt passwords = yes
-	bind interfaces only = yes
-	netbios name = ${OCF_RESKEY_name/ /_}
-
-	#
-	# Interfaces are based on ip resources at the top level of
-	# "$OCF_RESKEY_service_name"; IPv6 addresses may or may not
-	# work correctly.
-	#
-	interfaces = $(build_ip_list)
-
-#
-# Shares based on fs resources at the top level of "$OCF_RESKEY_service_name"
-#
-EOT
-	add_fs_entries "$conf"
-	add_sha1 "$conf"
-
-	return 0
-}
-
-
-#
-# Kill off the specified PID
-# (from clumanager 1.0.x/1.2.x)
-#
-# Killing off the samba daemons was miserable to implement, merely
-# because killall doesn't distinguish by program commandline.
-# Consequently I had to implement these routines to selectively pick 'em off.
-#
-# Kills of either the {smbd|nmbd} which is running and was started with
-# the specified argument.  Can't use `killall` to do this because it
-# doesn't allow you to distinguish which process to kill based on any
-# of the program arguments.
-#
-# This routine is also called on "status" checks.  In this case it doesn't
-# actually kill anything.
-#
-# Parameters:
-#       daemonName - daemon name, can be either smbd or nmbd
-#       command - [stop|start|status]
-#       arg     - argument passed to daemon.  In this case its not the
-#                 full set of program args, rather its really just the
-#                 samba config file.
-#
-# Returns: 0 - success (or the daemon isn't currently running)
-#          1 - failure
-#
-kill_daemon_by_arg()
-{
-    	declare daemonName=$1
-	declare action=$2
-	declare arg=$3
-	# Create a unique temporary file to stash off intermediate results
-	declare tmpfile_str=/tmp/sambapids.XXXXXX
-	declare tmpfile
-	declare ret
-
-	tmpfile=$(mktemp $tmpfile_str); ret_val=$?
-
-	if [ -z "$tmpfile" ]; then
-		ocf_log err "kill_daemon_by_arg: Can't create tmp file"
-		return $_FAIL
-	fi
-
-	# Mumble, need to strip off the /etc/samba portion, otherwise the
-	# grep pattern matching will fail.
-	declare confFile="$(basename $arg)"
-
-	# First generate a list of candidate pids.
-	pidof $daemonName > $tmpfile
-	if [ $? -ne 0 ]; then
-		ocf_log debug "kill_daemon_by_arg: no pids for $daemonName"
-		rm -f $tmpfile
-		case "$action" in
-		'stop')
-			return 0
-		;;
-		'status')
-			return $_FAIL
-		;;
-		esac
-		return 0
-	fi
-
-	# If you don't find any matching daemons for a "stop" operation, thats
-	# considered success; whereas for "status" inquiries its a failure.
-	case "$action" in
-	'stop')
-		ret=0
-	;;
-	'status')
-		ret=$_FAIL
-	;;
-	esac
-	#
-	# At this point tmpfile contains a set of pids for the corresponding
-	# {smbd|nmbd}.  Now look though this candidate set of pids and compare
-	# the program arguments (samba config file name).  This distinguishes
-	# which ones should be killed off.
-	#
-	declare daemonPid=""
-	for daemonPid in $(cat $tmpfile); do
-		declare commandLine=$(cat /proc/$daemonPid/cmdline)
-		declare confBase="$(basename $commandLine)"
-		if [ "$confBase" = "$confFile" ]; then
-			case "$action" in
-			'status')
-				rm -f $tmpfile
-				return 0
-			;;
-			esac
-			kill_daemon_pid $daemonPid
-			if [ $? -ne 0 ]; then
-				ret=$_FAIL
-				ocf_log err \
-				"kill_daemon_by_arg: kill_daemon_pid $daemonPid failed"
-			else
-				ocf_log debug \
-				 "kill_daemon_by_arg: kill_daemon_pid $daemonPid success"
-			fi
-		fi
-	done
-	rm -f $tmpfile
-	return $ret
-}
-
-
-#
-# Kill off the specified PID
-# (from clumanager 1.0.x/1.2.x)
-#
-kill_daemon_pid()
-{
-	declare pid=$1
-	declare retval=0
-
-
-	kill -TERM $pid
-	if [ $? -eq 0 ]; then
-		ocf_log debug "Samba: successfully killed $pid"
-	else
-		ocf_log debug "Samba: failed to kill $pid"
-		retval=$_FAIL
-	fi
-	return $retval
-}
-
-
-share_start_stop()
-{
-	declare command=$1
-	declare conf="$SAMBA_CONFIG_DIR/smb.conf.$OCF_RESKEY_name"
-	declare smbd_command
-	declare nmbd_command
-	declare netbios_name
-	
-	#
-	# Specify daemon options
-	# -D = spawn off as separate daemon
-	# -s = the following arg specifies the config file
-	#
-	declare smbd_options="-D -s"
-	declare nmbd_options="-D -s"
-
-	if [ "$command" = "start" ]; then
-		gen_smb_conf "$conf"
-	else 
-		if ! [ -f "$conf" ]; then
-			ocf_log warn "\"$conf\" missing during $command"
-		fi
-	fi
-
-	#
-	# On clusters with multiple samba shares, we need to ensure (as much
-	# as possible) that each service is advertised as a separate netbios
-	# name.
-	#
-	# Generally, the admin sets this in smb.conf.NAME - but since
-	# it is not required, we need another option.  Consequently, we use
-	# smb instance name (which must be unique)
-	#
-	if [ -f "$conf" ]; then
-		grep -qe "^\([[:space:]]\+n\|n\)etbios[[:space:]]\+name[[:space:]]*=[[:space:]]*[[:alnum:]]\+" "$conf"
-		if [ $? -ne 0 ]; then
-
-			netbios_name=$OCF_RESKEY_name
-
-			ocf_log notice "Using $netbios_name as NetBIOS name (service $OCF_RESKEY_service_name)"
-			nmbd_options=" -n $netbios_name $nmbd_options"
-		fi
-	fi
-
-	case $command in
-	start)
-		ocf_log info "Starting Samba instance \"$OCF_RESKEY_name\""
-		mkdir -p "$SAMBA_PID_DIR/$OCF_RESKEY_name"
-		mkdir -p "$SAMBA_LOCK_DIR/$OCF_RESKEY_name"
-
-		[ -f "$SMBD_COMMAND" ] || exit $OCF_ERR_INSTALLED
-		[ -f "$NMBD_COMMAND" ] || exit $OCF_ERR_INSTALLED
-
-		# Kick off the per-service smbd
-		$SMBD_COMMAND $smbd_options "$conf"
-		ret_val=$?
-		if [ $ret_val -ne 0 ]; then
-			ocf_log err "Samba service failed: $SMBD_COMMAND $smbd_options \"$conf\""
-			return $_FAIL
-		fi
-		ocf_log debug "Samba service succeeded: $SMBD_COMMAND $smbd_options \"$conf\""
-
-		# Kick off the per-service nmbd
-		$NMBD_COMMAND $nmbd_options "$conf"
-		ret_val=$?
-		if [ $ret_val -ne 0 ]; then
-			ocf_log err "Samba service failed: $NMBD_COMMAND $nmbd_options \"$conf\""
-			return $_FAIL
-		fi
-		ocf_log debug "Samba service succeeded: $NMBD_COMMAND $nmbd_options \"$conf\""
-	;;
-	stop)
-		ocf_log info "Stopping Samba instance \"$OCF_RESKEY_name\""
-
-       		kill_daemon_by_arg "nmbd" $command "$conf"
-       		kill_daemon_by_arg "smbd" $command "$conf"
-       		if [ "$SAMBA_PID_DIR/$OCF_RESKEY_name" != "/" ]; then
-       			pushd "$SAMBA_PID_DIR" &> /dev/null
-       			rm -rf "$OCF_RESKEY_name"
-	       		popd &> /dev/null
-		fi
-		if [ "$SAMBA_LOCK_DIR/$OCF_RESKEY_name" != "/" ]; then
-     			pushd "$SAMBA_LOCK_DIR" &> /dev/null
-			rm -rf "$OCF_RESKEY_name"
-			popd &> /dev/null
-		fi
-	;;
-	status)
-		ocf_log debug "Checking Samba instance \"$OCF_RESKEY_name\""
-		kill_daemon_by_arg "nmbd" $command "$conf"
-		if [ $? -ne 0 ]; then
-			ocf_log err \
-			"share_start_stop: nmbd for service $svc_name died!"
-			return $_FAIL
-		fi
-		kill_daemon_by_arg "smbd" $command "$conf"
-		if [ $? -ne 0 ]; then
-			ocf_log err \
-		"share_start_stop: nmbd for service $svc_name died!"
-			return $_FAIL
-		fi
-	;;
-	esac
-}
-
-
-verify_all()
-{
-	[ -z "$OCF_RESKEY_workgroup" ] && export OCF_RESKEY_workgroup="LINUXCLUSTER"
-	[ -n "${OCF_RESKEY_name}" ] || exit $OCF_ERR_ARGS      # Invalid Argument
-	if [ -z "${OCF_RESKEY_service_name}" ]; then
-		ocf_log ERR "Samba service ${OCF_RESKEY_name} is not the child of a service"
-		exit $OCF_ERR_ARGS
-	fi
-}
-
-case $1 in
-	meta-data)
-		meta_data
-		exit 0
-	;;
-	start|stop)
-		verify_all
-		share_start_stop $1
-		exit $?
-	;;
-	status|monitor)
-		verify_all
-		share_start_stop status
-		exit $?
-	;;
-	validate-all)
-		verify_all
-		echo "Yer radio's workin', driver!"
-		exit 0
-	;;
-	*)
-		echo "usage: $0 {start|stop|status|monitor|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
diff --git a/rgmanager/src/resources/svclib_nfslock b/rgmanager/src/resources/svclib_nfslock
deleted file mode 100644
index f69a57c..0000000
--- a/rgmanager/src/resources/svclib_nfslock
+++ /dev/null
@@ -1,260 +0,0 @@
-#!/bin/bash
-# Do reclaim-broadcasts when we kill lockd during shutdown/startup
-# of a cluster service.
-#
-# Exported functions:
-#
-#  notify_list_store
-#  notify_list_merge
-#  notify_list_broadcast
-#
-
-#
-# Usage:
-# statd_notify <directory> <hostname|ip>
-#
-# Copy out a list from <directory>, merge them with the system nfs lock
-# list, and send them out as <hostname|ip> after generating a random
-# state (needed so clients will reclaim their locks)
-#
-nfslock_statd_notify()
-{
-	declare tmpdir=$(mktemp -d /tmp/statd-$2.XXXXXX)
-	declare nl_dir=$1
-	declare nl_ip=$2
-	declare command		# Work around bugs in rpc.statd
-	declare pid_xxx		# Work around bugs in rpc.statd
-	declare owner
-
-	[ -z "$lockd_pid" ] && return 0
-	if ! [ -d $nl_dir ]; then
-		return 0
-	fi
-
-	if [ -z "`ls $nl_dir/sm/* 2> /dev/null`" ]; then
-		ocf_log debug "No hosts to notify"
-		return 0
-	fi
-
-	# Ok, copy the HA directory to something we can use.
-       	mkdir -p $tmpdir/sm
-	
-	# Copy in our specified entries
-	cp -f $nl_dir/sm/* $tmpdir/sm
-
-	# Copy in our global entries
-	# XXX This might be what we just copied.
-
-	if [ -d "/var/lib/nfs/statd/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
-		cp -f /var/lib/nfs/statd/sm/* $tmpdir/sm
-	elif [ -d "/var/lib/nfs/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
-		cp -f /var/lib/nfs/sm/* $tmpdir/sm
-	fi
-
-	#
-	# Generate a random state file.  If this ends up being what a client
-	# already has in its list, that's bad, but the chances of this
-	# are small - and relocations should be rare.
-	#
-	dd if=/dev/urandom of=$tmpdir/state bs=1 count=4 &> /dev/null
-
-	#
-	# Make sure we set permissions, or statd will not like it.
-	#
-	chown -R $owner $tmpdir
-
-	#
-	# Tell rpc.statd to notify clients.  Don't go into background, 
-	# because statd is buggy and won't exit like it's supposed to after
-	# sending the notifications out.
-	#
-	ocf_log info "Sending reclaim notifications via $nl_ip"
-	command="rpc.statd -NFP $tmpdir -n $nl_ip"
-	eval $command 2>&1 &
-	sleep 3 # XXX - the instance of rpc.statd we just spawned is supposed
-	        # to exit after it finishes notifying clients.
-	        # rpc.statd spawned which is still running handles the actual
-	        # new SM_MON requests... we hope 3 seconds is enough time
-	        # to get all the SM_NOTIFY messages out.  rpc.statd = bugged
-	#
-	# clean up
-	#
-	pid_xxx=`ps auwwx | grep "$command" | grep -v grep | awk '{print $2}'`
-	kill $pid_xxx
-	rm -rf $tmpdir
-
-	return 0
-}
-
-
-#
-# Copy of isSlave from svclib_ip and/or ip.sh
-#
-nfslock_isSlave()
-{
-        declare intf=$1
-        declare line
-
-        if [ -z "$intf" ]; then
-                ocf_log err "usage: isSlave <I/F>"
-                return 1
-        fi
-
-        line=$(/sbin/ip link list dev $intf)
-        if [ $? -ne 0 ]; then
-                ocf_log err "$intf not found"
-                return 1
-        fi
-
-        if [ "$line" = "${line/<*SLAVE*>/}" ]; then
-                return 2
-        fi
-
-        # Yes, it is a slave device.  Ignore.
-        return 0
-}
-
-
-#
-# Get all the IPs on the system except loopback IPs
-#
-nfslock_ip_address_list()
-{
-        declare idx dev family ifaddr
-
-        while read idx dev family ifaddr; do
-
-		if [ "$family" != "inet" ] && [ "$family" != "inet6" ]; then
-			continue
-		fi
-
-		if [ "$dev" = "lo" ]; then
-			# Ignore loopback
-			continue
-		fi
-
-                nfslock_isSlave $dev
-                if [ $? -ne 2 ]; then
-                        continue
-                fi
-
-                idx=${idx/:/}
-
-                echo $dev $family ${ifaddr/\/*/} ${ifaddr/*\//}
-
-        done < <(/sbin/ip -o addr list | awk '{print $1,$2,$3,$4}')
-
-        return 0
-}
-	
-
-#
-# Usage: broadcast_notify <state_directory>
-#
-# Send the contents of <state_directory> out via all IPs on the system.
-#
-notify_list_broadcast()
-{
-        declare dev family addr maskbits ip_name
-	declare lockd_pid=$(pidof lockd)
-	declare nl_dir=$1
-
-	# First of all, send lockd a SIGKILL.  We hope nfsd is running.
-	# If it is, this will cause lockd to reset the grace period for
-	# lock reclaiming.
-	if [ -n "$lockd_pid" ]; then
-		ocf_log info "Asking lockd to drop locks (pid $lockd_pid)"
-		kill -9 $lockd_pid
-	else
-		ocf_log warning "lockd not running; cannot notify clients"
-		return 1
-	fi
-	
-        while read dev family addr maskbits; do
-		if [ "$family" != "inet" ]; then
-			continue
-		fi
-
-		ip_name=$(clufindhostname -i $addr)
-		if [ -z "$ip_name" ]; then
-			nfslock_statd_notify $nl_dir $addr
-		else
-			nfslock_statd_notify $nl_dir $ip_name
-		fi
-
-	done < <(nfslock_ip_address_list)
-}
-
-
-#
-# Store the lock monitor list from rpc.statd - do this during a teardown
-# after the IP addresses of a service have been taken offline.  Note that
-# this should be done by HA-callout programs, but this feature is not in
-# RHEL3. 
-#
-notify_list_store()
-{
-	declare nl_dir=$1
-	declare owner
-
-	mkdir -p $nl_dir/sm
-
-	if [ -d "/var/lib/nfs/statd/sm" ]; then
-	        if [ -z "`ls /var/lib/nfs/statd/sm/* 2> /dev/null`" ]; then
-			return 1
-			# nothing to do!
-		fi
-
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
-		cp -af /var/lib/nfs/statd/sm/* $nl_dir/sm
-		chown -R $owner $nl_dir
-		return 0
-	elif [ -d "/var/lib/nfs/sm" ]; then
-	        if [ -z "`ls /var/lib/nfs/sm/* 2> /dev/null`" ]; then
-			return 1
-			# nothing to do!
-		fi
-
-		owner=$(ls -dl /var/lib/nfs/sm | awk '{print $3"."$4}')
-		cp -af /var/lib/nfs/sm/* $nl_dir/sm
-		chown -R $owner $nl_dir
-		return 0
-	fi
-
-	return 1
-}
-
-
-#
-# Merge the contents of <nl_dir>/sm with the system-wide list
-# Make sure ownership is right, or statd will hiccup.  This should not
-# actually ever be needed because statd will, upon getting a SM_MON
-# request, create all the entries in this list.  It's mostly for
-# housekeeping for next time we relocate the service.
-#
-notify_list_merge()
-{
-	declare nl_dir=$1
-	declare owner
-
-	if [ -z "`ls $nl_dir/* 2> /dev/null`" ]; then
-		return 1
-	fi
-
-	if [ -d "/var/lib/nfs/statd/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
- 		cp -af $nl_dir/sm/* /var/lib/nfs/statd/sm
-		chown -R $owner $nl_dir
-		return 0
-	elif [ -d "/var/lib/nfs/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/sm | awk '{print $3"."$4}')
- 		cp -af $nl_dir/sm/* /var/lib/nfs/sm
-		chown -R $owner $nl_dir
-		return 0
-	fi
-
-	return 1
-}
-
diff --git a/rgmanager/src/resources/tomcat-5.metadata b/rgmanager/src/resources/tomcat-5.metadata
deleted file mode 100644
index 021bef7..0000000
--- a/rgmanager/src/resources/tomcat-5.metadata
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="tomcat-5">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Tomcat server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a Tomcat server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/tomcat5/tomcat5.conf"/>
-        </parameter>
-
-	<parameter name="tomcat_user">
-		<longdesc lang="en">
-			User who runs the Tomcat server
-		</longdesc>
-		<shortdesc lang="en">
-			User who runs the Tomcat server
-		</shortdesc>
-		<content type="string" default="tomcat" />
-	</parameter>
-
-	<parameter name="catalina_options">
-		<longdesc lang="en">
-			Other command-line options for Catalina
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for Catalina
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="catalina_base">
-		<longdesc lang="en">
-			Cataliny base directory
-		</longdesc>
-		<shortdesc lang="en">
-			Catalina base directory (differs for each service)
-		</shortdesc>
-		<content type="string" default="/usr/share/tomcat5" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" default="30" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/tomcat-5.sh b/rgmanager/src/resources/tomcat-5.sh
deleted file mode 100644
index cbdd2e3..0000000
--- a/rgmanager/src/resources/tomcat-5.sh
+++ /dev/null
@@ -1,256 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare TOMCAT_TOMCAT=/usr/bin/dtomcat5
-declare TOMCAT_RELINK=/usr/share/tomcat5/bin/relink
-declare TOMCAT_pid_file="`generate_name_for_pid_file`"
-declare TOMCAT_conf_dir="`generate_name_for_conf_dir`/conf"
-declare TOMCAT_gen_config_file="$TOMCAT_conf_dir/server.xml"
-declare TOMCAT_gen_catalina_base="`generate_name_for_conf_dir`"
-
-declare JAVA_HOME
-declare CATALINA_HOME
-declare CATALINA_BASE
-declare CATALINA_TMPDIR
-declare CLASSPATH
-declare TOMCAT_USER
-##
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	. "$OCF_RESKEY_config_file"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_verify $CLOG_FAILED "Error In The File \"$OCF_RESKEY_config_file\""
-		return $OCF_ERR_ARGS
-	fi 
-
-	if [ -z "$JAVA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_HOME Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$JAVA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_HOME Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$JAVA_ENDORSED_DIRS" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_ENDORSED_DIRS Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$JAVA_ENDORSED_DIRS" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_ENDORSED_DIRS Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$TOMCAT_USER" ]; then
-		clog_service_verify $CLOG_FAILED "TOMCAT_USER Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addresses="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-#	generate_configTemplate "$generated_file" "$original_file"
-	$(dirname $0)/utils/tomcat-parse-config.pl $ip_addresses < "$original_file" >> "$generated_file"
-
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$TOMCAT_conf_dir"
-	check_pid_file "$TOMCAT_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$TOMCAT_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-	generate_config_file "$OCF_RESKEY_catalina_base/conf/server.xml" "$TOMCAT_gen_config_file" "$ip_addresses"
-	ln -s "$OCF_RESKEY_catalina_base"/* "$TOMCAT_gen_catalina_base" &> /dev/null
-	ln -s "$OCF_RESKEY_catalina_base"/conf/* "$TOMCAT_gen_catalina_base"/conf &> /dev/null
-	
-	CLASSPATH="$JAVA_HOME"/lib/tools.jar:"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar:`/usr/bin/build-classpath mx4j/mx4j-impl`:`/usr/bin/build-classpath mx4j/mx4j-jmx`
-
-	su "$TOMCAT_USER" -c "$JAVA_HOME/bin/java" $JAVA_OPTS $OCF_RESKEY_catalina_options \
-		-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
-		-Dcatalina.base="$TOMCAT_gen_catalina_base" \
-		-Dcatalina.home="$CATALINA_HOME" \
-		-Djava.io.tmpdir="$CATALINA_TMPDIR" \
-		org.apache.catalina.startup.Bootstrap "$@" start \
-		>> "$TOMCAT_gen_catalina_base"/logs/catalina.out 2>&1 &
-	                                                
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ -z "$!" ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	echo $! > "$TOMCAT_pid_file"
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$TOMCAT_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-        if [ -e "$TOMCAT_pid_file" ]; then
-		rm -f "$TOMCAT_pid_file"
-	fi
-                                
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$TOMCAT_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$TOMCAT_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/tomcat-6.metadata b/rgmanager/src/resources/tomcat-6.metadata
deleted file mode 100644
index 493e0d5..0000000
--- a/rgmanager/src/resources/tomcat-6.metadata
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="tomcat-6">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Tomcat server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a Tomcat server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/tomcat6/tomcat6.conf"/>
-        </parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" default="30" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/tomcat-6.sh b/rgmanager/src/resources/tomcat-6.sh
deleted file mode 100644
index 3371ea5..0000000
--- a/rgmanager/src/resources/tomcat-6.sh
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare TOMCAT_pid_file="`generate_name_for_pid_file`"
-declare TOMCAT_conf_dir="`generate_name_for_conf_dir`/conf"
-declare TOMCAT_gen_config_file="$TOMCAT_conf_dir/server.xml"
-declare TOMCAT_gen_catalina_base="`generate_name_for_conf_dir`"
-
-declare CATALINA_HOME
-declare CATALINA_BASE
-declare CATALINA_TMPDIR
-declare CLASSPATH
-declare TOMCAT_USER
-##
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	. "$OCF_RESKEY_config_file"
-
-	if [ $? -ne 0 ]; then
-		clog_service_verify $CLOG_FAILED "Error In The File \"$OCF_RESKEY_config_file\""
-		return $OCF_ERR_ARGS
-	fi 
-
-	if [ -z "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$TOMCAT_USER" ]; then
-		clog_service_verify $CLOG_FAILED "TOMCAT_USER Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addresses="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	$(dirname $0)/utils/tomcat-parse-config.pl $ip_addresses < "$original_file" > "$generated_file"
-
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$TOMCAT_conf_dir"
-	check_pid_file "$TOMCAT_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$TOMCAT_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	. "$OCF_RESKEY_config_file"
-
-	generate_config_file "$CATALINA_BASE/conf/server.xml" "$TOMCAT_gen_config_file" "$ip_addresses"
-	rm -f "$TOMCAT_gen_catalina_base/conf/tomcat6.conf"
-	( cat $OCF_RESKEY_config_file | grep -v 'CATALINA_PID=' | grep -v 'CATALINA_BASE='; echo CATALINA_BASE="$TOMCAT_gen_catalina_base"; echo CATALINA_PID="$TOMCAT_pid_file") > "$TOMCAT_gen_catalina_base/conf/tomcat6.conf" 
-	ln -s "$CATALINA_BASE"/* "$TOMCAT_gen_catalina_base" &> /dev/null
-	ln -s "$CATALINA_BASE"/conf/* "$TOMCAT_gen_catalina_base"/conf &> /dev/null
-	
-	export TOMCAT_CFG="$TOMCAT_gen_catalina_base/conf/tomcat6.conf"
-	/usr/sbin/tomcat6 start
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$TOMCAT_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-        if [ -e "$TOMCAT_pid_file" ]; then
-		rm -f "$TOMCAT_pid_file"
-	fi
-                                
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$TOMCAT_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$TOMCAT_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/utils/config-utils.sh.in b/rgmanager/src/resources/utils/config-utils.sh.in
deleted file mode 100644
index e3a44d0..0000000
--- a/rgmanager/src/resources/utils/config-utils.sh.in
+++ /dev/null
@@ -1,242 +0,0 @@
-#!/bin/bash
-
-declare RA_COMMON_pid_dir=/var/run/cluster
-declare RA_COMMON_conf_dir=@CONFDIR@
-
-declare -i FAIL=255
-declare -a ip_keys
-
-generate_configTemplate()
-{
-	cat > $1 << EOT
-#
-# "$1" was created from the "$2"
-#
-# This template configuration was automatically generated, and will be
-# automatically regenerated if removed. Once this file has been altered,
-# automatic re-generation will stop. Remember to copy this file to all 
-# other cluster members after making changes, or your service will not 
-# operate correctly.
-#
-EOT
-}
-
-sha1_addToFile()
-{
-        declare sha1line="# rgmanager-sha1 $(sha1sum "$1")"
-        echo $sha1line >> "$1"
-}
-
-sha1_verify()
-{
-	declare sha1_new sha1_old
-	declare oldFile=$1
-
-	ocf_log debug "Checking: SHA1 checksum of config file $oldFile"
-
-	sha1_new=`cat $oldFile | grep -v "# rgmanager-sha1" | sha1sum | sed 's/^\([a-z0-9]\+\) .*$/\1/'`
-	sha1_old=`tail -n 1 $oldFile | sed 's/^# rgmanager-sha1 \(.*\)$/\1/' | sed 's/^\([a-z0-9]\+\) .*$/\1/'`
-
-	if [ "$sha1_new" = "$sha1_old" ]; then
-	        ocf_log debug "Checking: SHA1 checksum > succeed"
-		return 0;
-	else
-		ocf_log debug "Checking: SHA1 checksum > failed - file changed"
-		return 1;
-	fi
-}
-
-#
-# Usage: ccs_get key
-#
-ccs_get()
-{
-	declare outp
-	declare key
-
-	[ -n "$1" ] || return $FAIL
-
-	key="$*"
-
-	outp=$(ccs_tool query "$key" 2>&1)
-	if [ $? -ne 0 ]; then
-		if [[ "$outp" =~ "Query failed: Invalid argument" ]]; then
-			# This usually means that element does not exist
-			# e.g. when checking for IP address 
-			return 0;
-		fi
-
-		if [ "$outp" = "${outp/No data available/}" ] || [ "$outp" = "${outp/Operation not permitted/}" ]; then
-			ocf_log err "$outp ($key)"
-			return $FAIL
-		fi
-
-		# no real error, just no data available
-		return 0
-	fi
-
-	echo $outp
-
-	return 0
-}
-
-#
-# Build a list of service IP keys; traverse refs if necessary
-# Usage: get_service_ip_keys desc serviceName
-#
-get_service_ip_keys()
-{
-	declare svc=$1
-	declare -i x y=0
-	declare outp
-	declare key
-
-	#
-	# Find service-local IP keys
-	#
-	x=1
-	while : ; do
-		key="/cluster/rm/service[@name=\"$svc\"]/ip[$x]"
-
-		#
-		# Try direct method
-		#
-		outp=$(ccs_get "$key/@address")
-		if [ $? -ne 0 ]; then
-			return 1
-		fi
-
-		#
-		# Try by reference
-		#
-		if [ -z "$outp" ]; then
-			outp=$(ccs_get "$key/@ref")
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			key="/cluster/rm/resources/ip[@address=\"$outp\"]"
-		fi
-
-		if [ -z "$outp" ]; then
-			break
-		fi
-
-		#ocf_log debug "IP $outp found @ $key"
-
-		ip_keys[$y]="$key"
-
-		((y++))
-		((x++))
-	done
-
-	ocf_log debug "$y IP addresses found for $svc/$OCF_RESKEY_name"
-
-	return 0
-}
-
-build_ip_list()
-{
-        declare ipaddrs ipaddr
-        declare -i x=0
-                        
-        while [ -n "${ip_keys[$x]}" ]; do
-              ipaddr=$(ccs_get "${ip_keys[$x]}/@address")
-              if [ -z "$ipaddr" ]; then
-                                   break
-              fi
-
-              ipaddrs="$ipaddrs $ipaddr"
-             ((x++))
-        done
-
-        echo $ipaddrs
-}
-
-generate_name_for_pid_file()
-{
-	declare filename=$(basename $0)
-	
-	echo "$RA_COMMON_pid_dir/$(basename $0 | sed 's/^\(.*\)\..*/\1/')/$OCF_RESOURCE_INSTANCE.pid"
-	
-	return 0;
-}
-
-generate_name_for_pid_dir()
-{
-	declare filename=$(basename $0)
-	
-	echo "$RA_COMMON_pid_dir/$(basename $0 | sed 's/^\(.*\)\..*/\1/')/$OCF_RESOURCE_INSTANCE"
-	
-	return 0;
-}
-
-generate_name_for_conf_dir()
-{
-	declare filename=$(basename $0)
-
-	echo "$RA_COMMON_conf_dir/$(basename $0 | sed 's/^\(.*\)\..*/\1/')/$OCF_RESOURCE_INSTANCE"
-	
-	return 0;
-}
-
-create_pid_directory()
-{
-	declare program_name="$(basename $0 | sed 's/^\(.*\)\..*/\1/')"
-	declare dirname="$RA_COMMON_pid_dir/$program_name"
-
-	if [ -d "$dirname" ]; then
-		return 0;
-	fi
-	
-	chmod 711 "$RA_COMMON_pid_dir"
-	mkdir -p "$dirname"
-	
-	if [ "$program_name" = "mysql" ]; then
-		chown mysql.root "$dirname"
-	elif [ "$program_name" = "tomcat-5" ]; then
-		chown tomcat.root "$dirname"
-	fi
-
-	return 0;
-}
-
-create_conf_directory()
-{
-	declare dirname="$1"
-
-	if [ -d "$dirname" ]; then
-		return 0;
-	fi
-	
-	mkdir -p "$dirname"
-	
-	return 0;
-}
-
-check_pid_file() {
-	declare pid_file="$1"
-
-	if [ -z "$pid_file" ]; then
-		return 1;
-	fi
-
-	if [ ! -e "$pid_file" ]; then
-		return 0;
-	fi
-
-	## if PID file is empty then it should be safe to remove it
-	read pid < "$pid_file"
-	if [ -z "$pid" ]; then
-		rm $pid_file
-		ocf_log debug "PID File \"$pid_file\" Was Removed - Zero length";
-		return 0;
-	fi
-
-	if [ ! -d /proc/`cat "$pid_file"` ]; then	
-		rm "$pid_file"
-		ocf_log debug "PID File \"$pid_file\" Was Removed - PID Does Not Exist";
-		return 0;
-	fi
-
-	return 1;
-}
diff --git a/rgmanager/src/resources/utils/fs-lib.sh b/rgmanager/src/resources/utils/fs-lib.sh
deleted file mode 100644
index 7b933f8..0000000
--- a/rgmanager/src/resources/utils/fs-lib.sh
+++ /dev/null
@@ -1,957 +0,0 @@
-#!/bin/bash
-
-#
-# File system common functions
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-# Private return codes
-FAIL=2
-NO=1
-YES=0
-YES_STR="yes"
-
-[ -z "$OCF_RESOURCE_INSTANCE" ] && export OCF_RESOURCE_INSTANCE="filesystem:$OCF_RESKEY_name"
-
-#
-# Using a global to contain the return value saves
-# clone() operations.  This is important to reduce
-# resource consumption during status checks.
-#
-# There is no way to return a string from a function
-# in bash without cloning the process, which is exactly
-# what we are trying to avoid.  So, we have to resort
-# to using a dedicated global variable.  This one is
-# for the real_device() function below.
-#
-declare REAL_DEVICE
-
-#
-# Stub ocf_log function for when we are using
-# quick_status, since ocf_log generally forks (and
-# sourcing ocf-shellfuncs forks -a lot-).
-#
-ocf_log()
-{
-	echo $*
-}
-
-#
-# Assume NFS_TRICKS are not available until we are
-# proved otherwise.
-#
-export NFS_TRICKS=1
-
-#
-# Quick status doesn't fork() or clone() when using
-# device files directly.  (i.e. not symlinks, LABEL= or
-# UUID=
-#
-if [ "$1" = "status" -o "$1" = "monitor" ] &&
-   [ "$OCF_RESKEY_quick_status" = "1" ]; then
-	echo Using Quick Status
-
-	# XXX maybe we can make ocf-shellfuncs have a 'quick' mode too?
-	export OCF_SUCCESS=0
-	export OCF_ERR_GENERIC=1
-else
-	#
-	# Grab nfs lock tricks if available
-	#
-	if [ -f "$(dirname $0)/svclib_nfslock" ]; then
-		. $(dirname $0)/svclib_nfslock
-		NFS_TRICKS=0
-	fi
-
-	. $(dirname $0)/ocf-shellfuncs
-fi
-
-
-verify_name()
-{
-	if [ -z "$OCF_RESKEY_name" ]; then
-		ocf_log err "No file system name specified."
-		return $OCF_ERR_ARGS
-	fi
-	return $OCF_SUCCESS
-}
-
-
-verify_mountpoint()
-{
-	if [ -z "$OCF_RESKEY_mountpoint" ]; then
-		ocf_log err "No mount point specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	if ! [ -e "$OCF_RESKEY_mountpoint" ]; then
-		ocf_log info "Mount point $OCF_RESKEY_mountpoint will be "\
-				"created at mount time."
-		return $OCF_SUCCESS
-	fi
-
-	[ -d "$OCF_RESKEY_mountpoint" ] && return $OCF_SUCCESS
-
-	ocf_log err "$OCF_RESKEY_mountpoint exists but is not a directory."
-
-	return $OCF_ERR_ARGS
-}
-
-
-#
-# This used to be called using $(...), but doing this causes bash
-# to set up a pipe and clone().  So, the output of this function is
-# stored in the global variable REAL_DEVICE, declared previously.
-#
-real_device()
-{
-	declare dev="$1"
-	declare realdev
-
-	REAL_DEVICE=""
-
-	[ -z "$dev" ] && return $OCF_ERR_ARGS
-
-	# Oops, we have a link.  Sorry, this is going to fork.
-	if [ -h "$dev" ]; then
-		realdev=$(readlink -f $dev)
-		if [ $? -ne 0 ]; then
-			return $OCF_ERR_ARGS
-		fi
-		REAL_DEVICE="$realdev"
-		return $OCF_SUCCESS
-	fi
-
-	# If our provided blockdev is a device, we are done
-	if [ -b "$dev" ]; then
-		REAL_DEVICE="$dev"
-		return $OCF_SUCCESS
-	fi
-
-	# It's not a link, it's not a block device.  If it also
-	# does not match UUID= or LABEL=, then findfs is not
-	# going to find anything useful, so we should quit now.
-	if [ "${dev/UUID=/}" = "$dev" ] &&
-	   [ "${dev/LABEL=/}" = "$dev" ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	# When using LABEL= or UUID=, we can't save a fork.
-	realdev=$(findfs "$dev" 2> /dev/null)
-	if [ -n "$realdev" ] && [ -b "$realdev" ]; then
-		REAL_DEVICE="$realdev"
-		return $OCF_SUCCESS
-	fi
-
-	return $OCF_ERR_GENERIC
-}
-
-
-verify_device()
-{
-	declare realdev
-
-	if [ -z "$OCF_RESKEY_device" ]; then
-	       ocf_log err "No device or label specified."
-	       return $OCF_ERR_ARGS
-	fi
-
-	real_device "$OCF_RESKEY_device"
-	realdev="$REAL_DEVICE"
-	if [ -n "$realdev" ]; then
-		if [ "$realdev" != "$OCF_RESKEY_device" ]; then
-			ocf_log info "Specified $OCF_RESKEY_device maps to $realdev"
-		fi
-		return $OCF_SUCCESS
-	fi
-
-	ocf_log err "Device or label \"$OCF_RESKEY_device\" not valid"
-
-	return $OCF_ERR_ARGS
-}
-
-
-#
-# mount_in_use device mount_point
-#
-# Check to see if either the device or mount point are in use anywhere on
-# the system.  It is not required that the device be mounted on the named
-# moint point, just if either are in use.
-#
-mount_in_use () {
-	declare mp tmp_mp
-	declare dev tmp_dev
-	declare junka junkb junkc junkd
-
-	if [ $# -ne 2 ]; then
-		ocf_log err "Usage: mount_in_use device mount_point".
-		return $FAIL
-	fi
-
-	dev="$1"
-	mp="$2"
-
-	while read -r tmp_dev tmp_mp junka junkb junkc junkd; do
-		# XXX fork/clone warning XXX
-		if [ "${tmp_dev:0:1}" != "-" ]; then
-			tmp_dev="$(printf "$tmp_dev")"
-		fi
-
-		if [ -n "$tmp_dev" -a "$tmp_dev" = "$dev" ]; then
-			return $YES
-		fi
-
-		# Mountpoint from /proc/mounts containing spaces will
-		# have spaces represented in octal.  printf takes care
-		# of this for us.
-		tmp_mp="$(printf "$tmp_mp")"
-
-		if [ -n "$tmp_mp" -a "$tmp_mp" = "$mp" ]; then
-			return $YES
-		fi
-	done < /proc/mounts
-
-	return $NO
-}
-
-
-#
-# is_mounted device mount_point
-#
-# Check to see if the device is mounted.  Print a warning if its not
-# mounted on the directory we expect it to be mounted on.
-#
-is_mounted () {
-
-	declare mp tmp_mp
-	declare dev tmp_dev
-	declare ret=$FAIL
-	declare found=1
-	declare poss_mp
-
-	if [ $# -ne 2 ]; then
-		ocf_log err "Usage: is_mounted device mount_point"
-		return $FAIL
-	fi
-
-	real_device "$1"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-		ocf_log err "$OCF_RESOURCE_INSTANCE: is_mounted: Could not match $1 with a real device"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -h "$2" ]; then
-		mp="$(readlink -f $2)"
-	else
-		mp="$2"
-	fi
-
-	ret=$NO
-
-	# This bash glyph simply removes a trailing slash
-	# if one exists.  /a/b/ -> /a/b; /a/b -> /a/b.
-	mp="${mp%/}"
-
-	while read -r tmp_dev tmp_mp junk_a junk_b junk_c junk_d
-	do
-		# XXX fork/clone warning XXX
-		if [ "${tmp_dev:0:1}" != "-" ]; then
-			tmp_dev="$(printf "$tmp_dev")"
-		fi
-
-		real_device "$tmp_dev"
-		tmp_dev="$REAL_DEVICE"
-
-		# XXX fork/clone warning XXX
-		# Mountpoint from /proc/mounts containing spaces will
-		# have spaces represented in octal.  printf takes care
-		# of this for us.
-		tmp_mp="$(printf "$tmp_mp")"
-
-		if [ -n "$tmp_dev" -a "$tmp_dev" = "$dev" ]; then
-			#
-			# Check to see if its mounted in the right
-			# place
-			#
-			if [ -n "$tmp_mp" ]; then
-				if [ "$tmp_mp" != "$mp" ]; then
-					poss_mp=$tmp_mp
-				else
-					found=0
-				fi
-			fi
-			ret=$YES
-		fi
-	done < /proc/mounts
-
-	if [ $ret -eq $YES ] && [ $found -ne 0 ]; then
-		ocf_log warn "Device $dev is mounted on $poss_mp instead of $mp"
-	fi
-
-	return $ret
-}
-
-
-#
-# is_alive mount_point
-#
-# Check to see if mount_point is alive (testing read/write)
-#
-is_alive()
-{
-	declare errcode
-	declare mount_point="$1"
-	declare file=".writable_test.$(hostname)"
-	declare rw
-
-	if [ $# -ne 1 ]; then
-	        ocf_log err "Usage: is_alive mount_point"
-		return $FAIL
-	fi
-
-	[ -z "$OCF_CHECK_LEVEL" ] && export OCF_CHECK_LEVEL=0
-
-	test -d "$mount_point"
-	if [ $? -ne 0 ]; then
-		ocf_log err "${OCF_RESOURCE_INSTANCE}: is_alive: $mount_point is not a directory"
-		return $FAIL
-	fi
-
-	[ $OCF_CHECK_LEVEL -lt 10 ] && return $YES
-
-	# depth 10 test (read test)
-	ls "$mount_point" > /dev/null 2> /dev/null
-	errcode=$?
-	if [ $errcode -ne 0 ]; then
-		ocf_log err "${OCF_RESOURCE_INSTANCE}: is_alive: failed read test on [$mount_point]. Return code: $errcode"
-		return $NO
-	fi
-
-	[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
-
-	# depth 20 check (write test)
-	rw=$YES
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-                if [ "$o" = "ro" ]; then
-		        rw=$NO
-                fi
-	done
-	if [ $rw -eq $YES ]; then
-	        file="$mount_point"/$file
-		while true; do
-			if [ -e "$file" ]; then
-				file=${file}_tmp
-				continue
-			else
-			        break
-			fi
-		done
-		touch $file > /dev/null 2> /dev/null
-		errcode=$?
-		if [ $errcode -ne 0 ]; then
-			ocf_log err "${OCF_RESOURCE_INSTANCE}: is_alive: failed write test on [$mount_point]. Return code: $errcode"
-			return $NO
-		fi
-		rm -f $file > /dev/null 2> /dev/null
-	fi
-
-	return $YES
-}
-
-
-#
-# Decide which quota options are enabled and return a string
-# which we can pass to quotaon
-#
-quota_opts()
-{
-	declare quotaopts=""
-	declare opts="$1"
-	declare mopt
-
-	for mopt in `echo $opts | sed -e s/,/\ /g`; do
-		case $mopt in
-		quota)
-			quotaopts="gu"
-			break
-			;;
-		usrquota)
-			quotaopts="u$quotaopts"
-			continue
-			;;
-		grpquota)
-			quotaopts="g$quotaopts"
-			continue
-			;;
-		noquota)
-			quotaopts=""
-			return 0
-			;;
-		esac
-	done
-
-	echo $quotaopts
-	return 0
-}
-
-
-
-#
-# Enable quotas on the mount point if the user requested them
-#
-enable_fs_quotas()
-{
-	declare -i need_check=0
-	declare -i rv
-	declare quotaopts=""
-	declare mopt
-	declare opts="$1"
-	declare mp="$2"
-
-	if ! type quotaon &> /dev/null; then
-		ocf_log err "quotaon not found in $PATH"
-		return $OCF_ERR_GENERIC
-	fi
-
-	quotaopts=$(quota_opts $opts)
-	[ -z "$quotaopts" ] && return 0
-
-	ocf_log debug "quotaopts = $quotaopts"
-
-	# Ok, create quota files if they don't exist
-	for f in quota.user aquota.user quota.group aquota.group; do
-		if ! [ -f "$mp/$f" ]; then
-			ocf_log info "$mp/$f was missing - creating"
-			touch "$mp/$f"
-			chmod 600 "$mp/$f"
-			need_check=1
-		fi
-	done
-
-	if [ $need_check -eq 1 ]; then
-		ocf_log info "Checking quota info in $mp"
-		quotacheck -$quotaopts "$mp"
-	fi
-
-	ocf_log info "Enabling Quotas on $mp"
-	ocf_log debug "quotaon -$quotaopts \"$mp\""
-	quotaon -$quotaopts "$mp"
-	rv=$?
-	if [ $rv -ne 0 ]; then
-		# Just a warning
-		ocf_log warn "Unable to turn on quotas for $mp; return = $rv"
-	fi
-
-	return $rv
-}
-
-
-# Agent-specific actions to take before mounting
-# (if required).  Typically things like fsck.
-do_pre_mount() {
-	return 0
-}
-
-# Default mount handler - for block devices
-#
-do_mount() {
-	declare dev="$1"
-	declare mp="$2"
-	declare mount_options=""
-	declare fstype_option=""
-	declare fstype
-
-	#
-	# Get the filesystem type, if specified.
-	#
-	fstype_option=""
-	fstype=${OCF_RESKEY_fstype}
-	case "$fstype" in
-	""|"[ 	]*")
-		fstype=""
-		;;
-	*)	# found it
-		fstype_option="-t $fstype"
-		;;
-	esac
-
-	#
-	# Get the mount options, if they exist.
-	#
-	mount_options=""
-	opts=${OCF_RESKEY_options}
-	case "$opts" in
-	""|"[ 	]*")
-		opts=""
-		;;
-	*)	# found it
-		mount_options="-o $opts"
-		;;
-	esac
-
-	#
-	# Mount the device
-	#
-	ocf_log info "mounting $dev on $mp"
-	ocf_log err "mount $fstype_option $mount_options $dev $mp"
-	mount $fstype_option $mount_options "$dev" "$mp"
-}
-
-
-# Agent-specific actions to take after mounting
-# (if required).
-do_post_mount() {
-	return 0
-}
-
-
-# Agent-specific actions to take before unmounting
-# (if required)
-do_pre_unmount() {
-	return 0
-}
-
-
-# Agent-specific actions to take after umount succeeds
-# (if required)
-do_post_unmount() {
-	return 0
-}
-
-
-# Agent-specific force-unmount logic, if required
-do_force_unmount() {
-	return 0
-}
-
-
-#
-# start_filesystem
-#
-start_filesystem() {
-	declare -i ret_val=$OCF_SUCCESS
-	declare mp="${OCF_RESKEY_mountpoint}"
-	declare dev=""			# device
-	declare fstype=""
-	declare opts=""
-	declare mount_options=""
-
-	#
-	# Check if mount point was specified.  If not, no need to continue.
-	#
-	case "$mp" in
-	""|"[ 	]*")		# nothing to mount
-		return $OCF_SUCCESS
-		;;
-	/*)			# found it
-		;;
-	*)			# invalid format
-			ocf_log err \
-"start_filesystem: Invalid mount point format (must begin with a '/'): \'$mp\'"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-
-	#
-	# Get the device
-	#
-	real_device "$OCF_RESKEY_device"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-			ocf_log err "\
-start_filesystem: Could not match $OCF_RESKEY_device with a real device"
-			return $OCF_ERR_ARGS
-	fi
-
-	#
-	# Ensure we've got a valid directory
-	#
-	if [ -e "$mp" ]; then
-		if ! [ -d "$mp" ]; then
-			ocf_log err"\
-start_filesystem: Mount point $mp exists but is not a directory"
-			return $OCF_ERR_ARGS
-		fi
-	else
-		ocf_log err "\
-start_filesystem: Creating mount point $mp for device $dev"
-		mkdir -p "$mp"
-		ret_val=$?
-		if [ $ret_val -ne 0 ]; then
-			ocf_log err "\
-start_filesystem: Unable to create $mp.  Error code: $ret_val"
-			return $OCF_ERR_GENERIC
-		fi
-	fi
-
-	#
-	# See if the device is already mounted.
-	#
-	is_mounted "$dev" "$mp"
-	case $? in
-	$YES)		# already mounted
-		ocf_log debug "$dev already mounted"
-		return $OCF_SUCCESS
-		;;
-	$NO)		# not mounted, continue
-		;;
-	*)
-		return $FAIL
-		;;
-	esac
-
-
-	#
-	# Make sure that neither the device nor the mount point are mounted
-	# (i.e. they may be mounted in a different location).  The'mount_in_use'
-	# function checks to see if either the device or mount point are in
-	# use somewhere else on the system.
-	#
-	mount_in_use "$dev" "$mp"
-	case $? in
-	$YES)		# uh oh, someone is using the device or mount point
-		ocf_log err "\
-Cannot mount $dev on $mp, the device or mount point is already in use!"
-		return $FAIL
-		;;
-	$NO)		# good, no one else is using it
-		;;
-	$FAIL)
-		return $FAIL
-		;;
-	*)
-		ocf_log err "Unknown return from mount_in_use"
-		return $FAIL
-		;;
-	esac
-
-	do_pre_mount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	do_mount "$dev" "$mp"
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	do_post_mount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	enable_fs_quotas "$opts" "$mp"
-
-	return $OCF_SUCCESS
-}
-
-
-#
-# stop_filesystem - unmount a file system; calls out to
-#
-stop_filesystem() {
-	declare -i ret_val=0
-	declare -i try
-	declare -i sleep_time=5		# time between each umount failure
-	declare umount_failed=""
-	declare force_umount=""
-	declare self_fence=""
-	declare quotaopts=""
-
-	#
-	# Get the mount point, if it exists.  If not, no need to continue.
-	#
-	mp=${OCF_RESKEY_mountpoint}
-	case "$mp" in
-	""|"[ 	]*")		# nothing to mount
-		return $OCF_SUCCESS
-		;;
-	/*)			# found it
-		;;
-	*)		# invalid format
-			ocf_log err \
-"stop_filesystem: Invalid mount point format (must begin with a '/'): \'$mp\'"
-		return $FAIL
-		;;
-	esac
-
-	#
-	# Get the device
-	#
-	real_device "$OCF_RESKEY_device"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-			ocf_log err "\
-stop: Could not match $OCF_RESKEY_device with a real device"
-			return $FAIL
-	fi
-
-	#
-	# Get the force unmount setting if there is a mount point.
-	#
-	case ${OCF_RESKEY_force_unmount} in
-        $YES_STR)	force_umount=$YES ;;
-	on)		force_umount=$YES ;;
-	true)		force_umount=$YES ;;
-	1)		force_umount=$YES ;;
-        *)		force_umount="" ;;
-	esac
-
-	case ${OCF_RESKEY_self_fence} in
-        $YES_STR)	self_fence=$YES ;;
-	on)		self_fence=$YES ;;
-	true)		self_fence=$YES ;;
-	1)		self_fence=$YES ;;
-        *)		self_fence="" ;;
-	esac
-
-	do_pre_unmount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	#
-	# Preparations: sync, turn off quotas
-	#
-	sync
-
-	quotaopts=$(quota_opts $OCF_RESKEY_options)
-	if [ -n "$quotaopts" ]; then
-		ocf_log debug "Turning off quotas for $mp"
-		quotaoff -$quotaopts "$mp" &> /dev/null
-	fi
-
-	#
-	# Unmount the device.
-	#
-	for try in 1 2 3; do
-		if [ $try -ne 1 ]; then
-			sleep $sleep_time
-		fi
-
-		is_mounted "$dev" "$mp"
-		case $? in
-		$NO)
-			ocf_log info "$dev is not mounted"
-			umount_failed=
-			break
-			;;
-		$YES)	# fallthrough
-			;;
-		*)
-			return $FAIL
-			;;
-		esac
-
-		ocf_log info "unmounting $mp"
-		umount "$mp"
-		ret_val=$?
-		if  [ $ret_val -eq 0 ]; then
-			umount_failed=
-			break
-		fi
-
-		ocf_log debug "umount failed: $ret_val"
-		umount_failed=yes
-
-		if [ -z "$force_umount" ]; then
-			continue
-		fi
-
-		# Force unmount: try #1: send SIGTERM
-		if [ $try -eq 1 ]; then
-			ocf_log warning "Sending SIGTERM to processes on $mp"
-			fuser -TERM -kvm "$mp"
-			continue
-		else
-			ocf_log warning "Sending SIGKILL to processes on $mp"
-			fuser -kvm "$mp"
-
-			do_force_unmount
-			case $? in
-			0)
-				;;
-			1)
-				return $OCF_ERR_GENERIC
-				;;
-			2)
-				break
-				;;
-			esac
-		fi
-	done # for
-
-	do_post_unmount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	if [ -n "$umount_failed" ]; then
-		ocf_log err "'umount $mp' failed, error=$ret_val"
-
-		if [ "$self_fence" ]; then
-			ocf_log alert "umount failed - REBOOTING"
-			sync
-			reboot -fn
-		fi
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-
-do_start() {
-	declare tries=0
-	declare rv
-
-	while [ $tries -lt 3 ]; do
-		start_filesystem
-		rv=$?
-		if [ $rv -eq 0 ]; then
-			return 0
-		fi
-
-		((tries++))
-		sleep 3
-	done
-	return $rv
-}
-
-
-do_stop() {
-	stop_filesystem
-	return $?
-}
-
-
-do_monitor() {
-	#
-	# Get the device
-	#
-	real_device "$OCF_RESKEY_device"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-			ocf_log err "\
-start_filesystem: Could not match $OCF_RESKEY_device with a real device"
-			return $OCF_ERR_ARGS
-	fi
-
-	is_mounted "$dev" "${OCF_RESKEY_mountpoint}"
-
-	if [ $? -ne $YES ]; then
-		ocf_log err "${OCF_RESOURCE_INSTANCE}: ${OCF_RESKEY_device} is not mounted on ${OCF_RESKEY_mountpoint}"
-		return $OCF_NOT_RUNNING
-	fi
-
-	if [ "$OCF_RESKEY_quick_status" = "1" ]; then
-		return 0
-	fi
-
-	is_alive "${OCF_RESKEY_mountpoint}"
-	[ $? -eq $YES ] && return 0
-
-	ocf_log err "fs:${OCF_RESKEY_name}: Mount point is not accessible!"
-	return $OCF_ERR_GENERIC
-}
-
-
-do_restart() {
-	stop_filesystem
-	if [ $? -ne 0 ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	start_filesystem
-	if [ $? -ne 0 ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	return 0
-}
-
-
-# MUST BE OVERRIDDEN
-do_metadata() {
-	return 1
-}
-
-
-do_validate() {
-	return 1
-}
-
-
-main() {
-	case $1 in
-	start)
-		do_start
-		exit $?
-		;;
-	stop)
-		do_stop
-		exit $?
-		;;
-	status|monitor)
-		do_monitor
-		exit $?
-		;;
-	restart)
-		do_restart
-		exit $?
-		;;
-	meta-data)
-		do_metadata
-		exit $?
-		;;
-	validate-all)
-		do_validate
-		;;
-	*)
-		echo "usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-	esac
-	exit 0
-}
-
diff --git a/rgmanager/src/resources/utils/httpd-parse-config.pl b/rgmanager/src/resources/utils/httpd-parse-config.pl
deleted file mode 100644
index 26ef378..0000000
--- a/rgmanager/src/resources/utils/httpd-parse-config.pl
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/perl -w
-
-##
-##  This script removes <IfDefine foo> sections from the
-##  Apache httpd.conf file. This is quite useful because we
-##  don't have any direct access to the parsed configuration
-##  file of the httpd server.
-##
-##  Usage: ./httpd-parse-config.pl -Dfoo1 -Dfoo2 < httpd.conf
-##         where fooX are defines as passed to the httpd server
-##
-##  Note:  All whitespace characters at the beginning and end 
-##         of lines are removed.
-##
-use strict;
-
-my @defines = ();
-## Default behaviour is to show all lines when we are not
-## in the <IfDefine foo> sections.
-my @show = (1);
-
-sub testIfDefine($) {
-	my $param = $1;
-	my $positiveTest = 1;
-	if ($param =~ /^!(.*)$/) {
-		$param = $1;
-		$positiveTest = 0;
-	}
-
-	foreach my $def (@defines) {
-		if ($def eq $param) {
-			return $positiveTest;
-		}
-	}
-
-	return (1-$positiveTest);	
-}
-
-foreach my $arg (@ARGV) {
-	if ($arg =~ /^-D(.*)$/) {
-		push(@defines, $1);
-	}
-}
-
-## Parse config file and remove IfDefine sections 
-while (my $line = <STDIN>) {
-	chomp($line);
-	$line =~ s/^\s*(.*?)\s*$/$1/;
-	if ($line =~ /<IfDefine (.*)>/) {
-		if (testIfDefine($1) == 1) {
-			if ($show[$#show] == 1) {
-				push (@show, 1);
-			} else {
-				push (@show, 0);
-			}
-		} else {
-			push (@show, 0);
-		}
-	} elsif ($line =~ /<\/IfDefine>/) {
-		pop(@show);
-	} elsif ($show[$#show] == 1) {
-		print $line, "\n";
-	}
-}
-
diff --git a/rgmanager/src/resources/utils/member_util.sh b/rgmanager/src/resources/utils/member_util.sh
deleted file mode 100644
index f9a0906..0000000
--- a/rgmanager/src/resources/utils/member_util.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-#
-# Use clustat to figure out if the specified node is a member
-# of the cluster.  Returns 2 if not found, 1 if not a member, and
-# 0 if the node is happily running.
-# Tested on RHEL4 and RHEL5; requires RHCS 5.1 or 4.5 to operate
-# properly in all cases.
-#
-is_node_member_clustat()
-{
-	declare line=$(clustat -xm $1 | grep "name=\"$1\"")
-	declare tmp
-
-	# Done if there's no node in the list with that name: not a 
-	# cluster member, and not in the configuration.
-	[ -n "$line" ] || return 2
-
-	# Clear out xml tag seps.
-	line=${line/*</}
-	line=${line/\/>/}
-
-	# Make vars out of XML attributes.
-	for tmp in $line; do
-		eval declare __$tmp
-	done
-
-	# Flip the value.  clustat reports 1 for member, 0 for not;
-	# Exactly the opposite of what a shell script expects.
-	((__state = !__state))
-	return $__state
-}
-
-
-#
-# Print the local node name to stdout
-# Returns 0 if could be found, 1 if not
-# Tested on RHEL4 (magma) and RHEL5 (cman)
-#
-local_node_name()
-{
-	declare node state line
-
-	if which magma_tool &> /dev/null; then
-		# Use magma_tool, if available.
-		line=$(magma_tool localname | grep "^Local")
-
-		if [ -n "$line" ]; then
-			echo ${line/* = /}
-			return 0
-		fi
-	fi
-
-	if ! which cman_tool &> /dev/null; then
-		# No cman tool? :(
-		return 2
-	fi
-
-	# Use cman_tool
-
-	line=$(cman_tool status | grep -i "Node name: $1")
-	[ -n "$line" ] || return 1
-	echo ${line/*name: /}
-	return 0
-}
-
diff --git a/rgmanager/src/resources/utils/messages.sh b/rgmanager/src/resources/utils/messages.sh
deleted file mode 100644
index 9381f1f..0000000
--- a/rgmanager/src/resources/utils/messages.sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/bash
-
-declare CLOG_INIT=100
-declare CLOG_SUCCEED=200
-declare CLOG_SUCCEED_KILL=201
-
-declare CLOG_FAILED=400
-declare CLOG_FAILED_TIMEOUT=401
-declare CLOG_FAILED_NOT_FOUND=403
-declare CLOG_FAILED_INVALID=404
-declare CLOG_FAILED_NOT_READABLE=405
-declare CLOG_FAILED_KILL=406
-
-##
-## Usage:
-##	clog_service_start %operation%
-##
-clog_service_start()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log info "Starting Service $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Starting Service $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Starting Service $OCF_RESOURCE_INSTANCE > Failed"
-			;;
-		$CLOG_FAILED_TIMEOUT)
-			ocf_log error "Starting Service $OCF_RESOURCE_INSTANCE > Failed - Timeout Error"
-			;;
-	esac
-	return 0
-}
-
-##
-## Usage:
-##	clog_service_stop %operation%
-##
-clog_service_stop()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log info "Stopping Service $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log info "Stopping Service $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_SUCCEED_KILL)
-			ocf_log info "Killing Service $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Stopping Service $OCF_RESOURCE_INSTANCE > Failed"
-			;;
-		$CLOG_FAILED_NOT_STOPPED)
-			ocf_log error "Stopping Service $OCF_RESOURCE_INSTANCE > Failed - Application Is Still Running"
-			;;
-		$CLOG_FAILED_KILL)
-			ocf_log error "Killing Service $OCF_RESOURCE_INSTANCE > Failed"
-			;;
-	esac
-	return 0
-}
-
-##
-## Usage:
-##	clog_service_status %operation%
-##
-clog_service_status()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Monitoring Service $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Monitoring Service $OCF_RESOURCE_INSTANCE > Service Is Running"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Monitoring Service $OCF_RESOURCE_INSTANCE > Service Is Not Running"
-			;;
-		$CLOG_FAILED_NOT_FOUND)
-			ocf_log error "Monitoring Service $OCF_RESOURCE_INSTANCE > Service Is Not Running - PID File Not Found"
-			;;
-	esac
-	return 0
-}
-
-##
-## Usage:
-##	clog_service_verify %operation%
-##	clog_service_verify $CLOG_FAILED %reason%
-##
-clog_service_verify()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Verifying Configuration Of $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Verifying Configuration Of $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_FAILED_NOT_CHILD)
-			ocf_log error "Service $OCF_RESOURCE_INSTANCE Is Not A Child Of A Service"
-			;;
-		$CLOG_FAILED)
-			if [ "x$2" = "x" ]; then
-				ocf_log error "Verifying Configuration Of $OCF_RESOURCE_INSTANCE > Failed"
-			else
-				ocf_log error "Verifying Configuration Of $OCF_RESOURCE_INSTANCE > Failed - $2"
-			fi
-			;;
-	esac
-	return 0
-}
-
-
-##
-## Usage:
-##	clog_check_sha1 %operation% %filename%
-##
-clog_check_sha1()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking SHA1 Checksum Of File $1"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking SHA1 Checksum Of File > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log debug "Checking SHA1 Checksum Of File > Failed - File Changed"
-			;;
-	esac
-	return 0;
-} 
-
-##
-## Usage:
-##	clog_check_file_exist %operation% %filename%
-##
-clog_check_file_exist()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking Existence Of File $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking Existence Of File $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;
-		$CLOG_FAILED_INVALID)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed - Invalid Argument"
-			;;
-		$CLOG_FAILED_NOT_FOUND)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed - File Doesn't Exist"
-			;;
-		$CLOG_FAILED_NOT_READABLE)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed - File Is Not Readable"
-			;;
-	esac
-	return 0;
-} 
-
-##
-## Usage:
-##	clog_check_pid %operation% %filename%
-##
-clog_check_pid()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking Non-Existence Of PID File $2"
-			return 0
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking Non-Existence of PID File $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Checking Non-Existence of PID File $2 [$OCF_RESOURCE_INSTANCE] > Failed - PID File Exists For $OCF_RESOURCE_INSTANCE"
-			;;
-	esac
-	return 0;
-}
-
-##
-## Usage:
-##	clog_check_syntax %operation% %filename%
-##
-clog_check_syntax()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking Syntax Of The File $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking Syntax Of The File $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Checking Syntax Of The File $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;		
-	esac
-	return 0;
-}
-
-##
-## Usage:
-##	clog_generate_config %operation% %old filename% %new filename%
-##
-clog_generate_config()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Generating New Config File $3 From $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Generating New Config File $3 From $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Generating New Config File $3 From $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;		
-	esac
-	return 0;
-}
-
-##
-## Usage:
-##	clog_looking_for %operation% %resource%
-##	clog_looking_for %operation% "IP Addresses"
-##	clog_looking_for %operation% "Filesystems"
-##
-clog_looking_for()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Looking For $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Looking For $2 > Succeed - $3 $2 Found"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;		
-		$CLOG_FAILED_NOT_FOUND)
-			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed - No $2 Found"
-			;;		
-	esac
-	return 0;
-}
diff --git a/rgmanager/src/resources/utils/named-parse-config.pl b/rgmanager/src/resources/utils/named-parse-config.pl
deleted file mode 100644
index 7a8b2dd..0000000
--- a/rgmanager/src/resources/utils/named-parse-config.pl
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/perl -w
-
-##
-##  Parse named.conf (from STDIN) and add options from cluster.conf
-##  
-##  ./named-parse-config.pl "directory" "pid-file" "listen-on"
-##
-use strict;
-
-if ($#ARGV < 2) {
-	die ("Not enough arguments");
-}
-
-while (my $line = <STDIN>) {
-	chomp($line);
-	$line =~ s/(.*?)\s*$/$1/;
-	if ($line =~ /^\s*options\s+\{/) {
-		print $line, "\n";
-		print "\tdirectory \"$ARGV[0]\";\n";
-		print "\tpid-file \"$ARGV[1]\";\n";
-		print "\tlisten-on { $ARGV[2] };\n";
-	} else {
-		print $line, "\n";
-	}
-}
-
diff --git a/rgmanager/src/resources/utils/ra-skelet.sh b/rgmanager/src/resources/utils/ra-skelet.sh
deleted file mode 100644
index 5de7bb2..0000000
--- a/rgmanager/src/resources/utils/ra-skelet.sh
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/bash
-
-status_check_pid()
-{
-	declare pid_file="$1"
-
-	if [ -z "$pid_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ ! -e "$pid_file" ]; then
-		clog_check_file_exist $CLOG_FAILED "$pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	read pid < "$pid_file"
-	
-	if [ -z "$pid" ]; then
-		return $OCF_ERR_GENERIC
-	fi
-	
-	if [ ! -d /proc/$pid ]; then
-		return $OCF_ERR_GENERIC
-	fi	
-
-	return 0
-}
-
-stop_generic()
-{
-	declare pid_file="$1"
-	declare stop_timeout="$2"
-	declare pid;
-	declare count=0;
-
-	if [ ! -e "$pid_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_FOUND "$pid_file"
-		# In stop-after-stop situation there is no PID file but
-		# it will be nice to check for it in stop-after-start
-		# look at bug #449394
-		return 0
-	fi
-
-	if [ -z "$stop_timeout" ]; then
-		stop_timeout=20
-	fi
-
-	read pid < "$pid_file"
-
-	# @todo: PID file empty -> error?
-	if [ -z "$pid" ]; then
-		return 0;
-	fi
-
-	# @todo: PID is not running -> error?
-	if [ ! -d "/proc/$pid" ]; then
-		return 0;
-	fi
-
-	kill -TERM "$pid"
-
-	if [ $? -ne 0 ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	until [ `ps --pid "$pid" &> /dev/null; echo $?` = '1' ] || [ $count -gt $stop_timeout ]
-	do
-		sleep 1
-		let count=$count+1
-	done
-
-	if [ $count -gt $stop_timeout ]; then
-		clog_service_stop $CLOG_FAILED_NOT_STOPPED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	return 0;
-}
-
-stop_generic_sigkill() {
-	# Use stop_generic (kill -TERM) and if application did not stop
-	# correctly then use kill -QUIT and check if it was killed
-	declare pid_file="$1"
-	declare stop_timeout="$2"
-	declare kill_timeout="$3"
-	declare pid
-	
-	stop_generic "$pid_file" "$stop_timeout"
-	if [ $? -eq 0 ]; then
-		return 0;
-	fi
-	
-	read pid < "$pid_file"
-	kill -QUIT "$pid"
-	if [ $? -ne 0 ]; then
-		return $OCF_GENERIC_ERROR
-	fi
-	
-	sleep "$kill_timeout"
-	ps --pid "$psql_pid" &> /dev/null
-	if [ $? -eq 0 ]; then
-		clog_service_stop $CLOG_FAILED_KILL
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED_KILL
-	return 0
-}
diff --git a/rgmanager/src/resources/utils/rhev-check.sh b/rgmanager/src/resources/utils/rhev-check.sh
deleted file mode 100644
index 48ee8fb..0000000
--- a/rgmanager/src/resources/utils/rhev-check.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-MYNAME=`basename $0`
-
-do_log()
-{
-	declare severity=$1
-
-	shift
-	echo "<$severity> $*"
-	clulog -s $severity "$*"
-}
-
-if [ -z "$1" ]; then
-	do_log 4 No host specified.
-	exit 1
-fi
-
-do_log 6 "Checking RHEV status on $1"
-
-tries=3
-http_code=
-
-while [ $tries -gt 0 ]; do
-
-	# Record start/end times so we can calculate the difference
-	start_time=$(date +%s)
-	http_code="$(curl -m 10 -sk https://$1/RHEVManagerWeb/HealthStatus.aspx -D - | head -1 | cut -f2 -d' ')"
-
-	if [ "$http_code" = "200" ]; then
-		exit 0
-	fi
-
-	# Reduce sleep time if the attempt took a noticeable amount
-	# of time.
-	end_time=$(date +%s)
-	delta=$(((end_time - start_time)))
-	sleep_time=$(((5 - delta)))
-
-	((tries-=1))
-
-	# if we're going to retry and we have a nonzero sleep time,
-	# go to sleep.
-	if [ $tries -gt 0 ] && [ $sleep_time -gt 0 ]; then
-		sleep $sleep_time
-	fi
-done
-
-if [ -n "$http_code" ]; then
-	do_log 3 "RHEV Status check on $1 failed; last HTTP code: $http_code"
-else
-	do_log 3 "RHEV Status check on $1 failed"
-fi
-
-exit 1
diff --git a/rgmanager/src/resources/utils/tomcat-parse-config.pl b/rgmanager/src/resources/utils/tomcat-parse-config.pl
deleted file mode 100644
index 109ecae..0000000
--- a/rgmanager/src/resources/utils/tomcat-parse-config.pl
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -w
-
-##
-##  This script replace IP addresses on which tomcat server
-##  should listen. Tomcat can't listen on every IP because that 
-##  way we can run only on instance. 
-##
-##  Usage: ./tomcat-parse-config.pl ip1 ip2 < /etc/tomcat/server.xml
-##         where ipXX defines an IP address [eg. 127.0.0.1 134.45.11.1]
-##
-##
-use strict;
-
-while (my $line = <STDIN>) {
-	chomp ($line);
-
-	if ($line =~ /(.*?)<Connector (.*)/) {
-		my $tmp = $2;
-		my $content = "<Connector ";
-		my $start = $1;
-		my $rest = "";
-
-		while (($tmp =~ />/) == 0) {
-			$content .= $tmp . "\n";
-			$tmp = <STDIN>;
-			chomp($tmp);
-		}
-
-		if ($tmp =~ /(.*?)>(.*)/) {
-			$content .= $1 . ">\n";
-			$rest = $2;
-			chomp($rest);
-		}
-		
-		print $start;
-		foreach my $arg (@ARGV) {
-			$content =~ s/\s+address=".*?"/ /;
-			$content =~ s/Connector /Connector address="$arg" /;
-			print $content;
-		}
-		print $rest;
-	} else {
-		print $line,"\n";
-	}
-}
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
deleted file mode 100644
index 22f29f1..0000000
--- a/rgmanager/src/resources/vm.sh
+++ /dev/null
@@ -1,1069 +0,0 @@
-#!/bin/bash
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-export PATH
-
-. $(dirname $0)/ocf-shellfuncs || exit 1
-
-#
-# Virtual Machine start/stop script (requires the virsh command)
-#
-
-# Indeterminate state: xend/libvirtd is down.
-export OCF_APP_ERR_INDETERMINATE=150
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="vm">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	Defines a Virtual Machine
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a Virtual Machine
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                This is the name of the virtual machine.
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-    
-        <parameter name="domain" reconfig="1">
-            <longdesc lang="en">
-                Failover domains define lists of cluster members
-                to try in the event that the host of the virtual machine
-		fails.
-            </longdesc>
-            <shortdesc lang="en">
-                Cluster failover Domain
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="autostart" reconfig="1">
-            <longdesc lang="en">
-	    	If set to yes, this resource group will automatically be started
-		after the cluster forms a quorum.  If set to no, this virtual
-		machine will start in the 'disabled' state after the cluster
-		forms a quorum.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Automatic start after quorum formation
-            </shortdesc>
-            <content type="boolean" default="1"/>
-        </parameter>
-
-        <parameter name="exclusive" reconfig="1">
-            <longdesc lang="en">
-	    	If set, this resource group will only relocate to
-		nodes which have no other resource groups running in the
-		event of a failure.  If no empty nodes are available,
-		this resource group will not be restarted after a failure.
-		Additionally, resource groups will not automatically
-		relocate to the node running this resource group.  This
-		option can be overridden by manual start and/or relocate
-		operations.
-            </longdesc>
-            <shortdesc lang="en">
-	        Exclusive resource group
-            </shortdesc>
-            <content type="boolean" default="0"/>
-        </parameter>
-
-        <parameter name="recovery" reconfig="1">
-            <longdesc lang="en">
-	        This currently has three possible options: "restart" tries
-		to restart this virtual machine locally before
-		attempting to relocate (default); "relocate" does not bother
-		trying to restart the VM locally; "disable" disables
-		the VM if it fails.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Failure recovery policy
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-       <parameter name="migration_mapping" reconfig="1">
-           <longdesc lang="en">
-               Mapping of the hostname of a target cluster member to a different hostname
-           </longdesc>
-           <shortdesc lang="en">
-               memberhost:targethost,memberhost:targethost ..
-           </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-	<parameter name="use_virsh">
-	    <longdesc lang="en">
-	    	Force use of virsh instead of xm on Xen machines.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	If set to 1, vm.sh will use the virsh command to manage
-		virtual machines instead of xm.  This is required when
-		using non-Xen virtual machines (e.g. qemu / KVM).
-	    </shortdesc>
-            <content type="integer" default=""/>
-        </parameter>
-
-	<parameter name="xmlfile">
-	    <longdesc lang="en">
-	    	Full path to libvirt XML file describing the domain.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	Full path to libvirt XML file describing the domain.
-	    </shortdesc>
-            <content type="string"/>
-	</parameter>
-
-	<parameter name="migrate">
-	    <longdesc lang="en">
-	    	Migration type (live or pause, default = live).
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	Migration type (live or pause, default = live).
-	    </shortdesc>
-            <content type="string" default="live"/>
-        </parameter>
-
-	<parameter name="path">
-	    <longdesc lang="en">
-		Path specification vm.sh will search for the specified
- 		VM configuration file.  /path1:/path2:...
-	    </longdesc>
-	    <shortdesc lang="en">
-		Path to virtual machine configuration files.
- 	    </shortdesc>
-	    <content type="string"/>
- 	</parameter>
-
-	<parameter name="snapshot">
-	    <longdesc lang="en">
-	    	Path to the snapshot directory where the virtual machine
-		image will be stored.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	Path to the snapshot directory where the virtual machine
-		image will be stored.
-	    </shortdesc>
-            <content type="string" default=""/>
-        </parameter>
-
-        <parameter name="depend">
-            <longdesc lang="en">
-		Service dependency; will not start without the specified
-		service running.
-            </longdesc>
-            <shortdesc lang="en">
-		Top-level service this depends on, in service:name format.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="depend_mode">
-            <longdesc lang="en">
-		Service dependency mode.
-		hard - This service is stopped/started if its dependency
-		       is stopped/started
-		soft - This service only depends on the other service for
-		       initial startip.  If the other service stops, this
-		       service is not stopped.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Service dependency mode (soft or hard).
-            </shortdesc>
-            <content type="string" default="hard"/>
-        </parameter>
-
-        <parameter name="max_restarts" reconfig="1">
-            <longdesc lang="en">
-	    	Maximum restarts for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Maximum restarts for this service.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-        <parameter name="restart_expire_time" reconfig="1">
-            <longdesc lang="en">
-	    	Restart expiration time.  A restart is forgotten
-		after this time.  When combined with the max_restarts
-		option, this lets administrators specify a threshold
-		for when to fail over services.  If max_restarts
-		is exceeded in this given expiration time, the service
-		is relocated instead of restarted again.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Restart expiration time; amount of time before a restart
-		is forgotten.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-        <parameter name="status_program" reconfig="1">
-            <longdesc lang="en">
-	    	Ordinarily, only the presence/health of a virtual machine
-		is checked.  If specified, the status_program value is
-		executed during a depth 10 check.  The intent of this 
-		program is to ascertain the status of critical services
-		within a virtual machine.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Additional status check program
-            </shortdesc>
-            <content type="string" default=""/>
-        </parameter>
-
-	<parameter name="hypervisor">
-            <shortdesc lang="en">
-		Hypervisor
-            </shortdesc >
-            <longdesc lang="en">
-		Specify hypervisor tricks to use.  Default = auto.
-		Other supported options are xen and qemu.
-            </longdesc>
-	    <content type="string" default="auto" />
-	</parameter>
-
-	<parameter name="hypervisor_uri">
-            <longdesc lang="en">
-		Hypervisor URI.  Generally, this is keyed off of the
-		hypervisor and does not need to be set.
-            </longdesc>
-            <shortdesc lang="en">
-		Hypervisor URI (normally automatic).
-            </shortdesc >
-	    <content type="string" default="auto" />
-	</parameter>
-
-	<parameter name="migration_uri">
-            <longdesc lang="en">
-		Migration URI.  Generally, this is keyed off of the
-		hypervisor and does not need to be set.
-            </longdesc>
-            <shortdesc lang="en">
-		Migration URI (normally automatic).
-            </shortdesc >
-	    <content type="string" default="auto" />
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="300"/>
-        <action name="stop" timeout="120"/>
-	
-        <action name="status" timeout="10" interval="30"/>
-        <action name="monitor" timeout="10" interval="30"/>
-
-	<!-- depth 10 calls the status_program -->
-        <action name="status" depth="10" timeout="20" interval="60"/>
-        <action name="monitor" depth="10" timeout="20" interval="60"/>
-
-	<!-- reconfigure - reconfigure with new OCF parameters.
-	     NOT OCF COMPATIBLE AT ALL -->
-	<action name="reconfig" timeout="10"/>
-
-	<action name="migrate" timeout="10m"/>
-
-        <action name="meta-data" timeout="5"/>
-        <action name="validate-all" timeout="5"/>
-
-    </actions>
-    
-    <special tag="rgmanager">
-    	<!-- Destroy_on_delete / init_on_add are currently only
-	     supported for migratory resources (no children
-	     and the 'migrate' action; see above.  Do not try this
-	     with normal services -->
-        <attributes maxinstances="1" destroy_on_delete="0" init_on_add="0"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-build_virsh_cmdline()
-{
-	declare cmdline=""
-	declare operation=$1
-
-	if [ -n "$OCF_RESKEY_hypervisor_uri" ]; then
-		cmdline="$cmdline -c $OCF_RESKEY_hypervisor_uri"
-	fi
-
-	cmdline="$cmdline $operation $OCF_RESKEY_name"
-		
-	echo $cmdline
-}
-
-
-# this is only used on startup
-build_xm_cmdline()
-{
-	declare operation=$1
-	#
-	# Virtual domains should never restart themselves when 
-	# controlled externally; the external monitoring app
-	# should.
-	#
-	declare cmdline="on_shutdown=\"destroy\" on_reboot=\"destroy\" on_crash=\"destroy\""
-
-	if [ -n "$OCF_RESKEY_path" ]; then
-		operation="$operation --path=\"$OCF_RESKEY_path\""
-	fi
-
-	if [ -n "$OCF_RESKEY_name" ]; then
-		cmdline="$operation $OCF_RESKEY_name $cmdline"
-	fi
-
-	echo $cmdline
-}
-
-
-do_xm_start()
-{
-	# Use /dev/null for the configuration file, if xmdefconfig
-	# doesn't exist...
-	#
-	declare cmdline
-
-	echo -n "Virtual machine $OCF_RESKEY_name is "
-	do_status && return 0
-
-	cmdline="`build_xm_cmdline create`"
-
-	ocf_log debug "xm $cmdline"
-
-	eval xm $cmdline
-	return $?
-}
-
-
-get_timeout()
-{
-	declare -i default_timeout=60
-	declare -i tout=60
-
-	if [ -n "$OCF_RESKEY_RGMANAGER_meta_timeout" ]; then
-		tout=$OCF_RESKEY_RGMANAGER_meta_timeout
-	elif [ -n "$OCF_RESKEY_CRM_meta_timeout" ]; then
-		tout=$OCF_RESKEY_CRM_meta_timeout
-	fi
-
-	if [ $tout -eq 0 ]; then
-		echo $default_timeout
-		return 0
-	fi
-	if [ $tout -lt 0 ]; then
-		echo $default_timeout
-		return 0
-	fi
-
-	echo $tout
-	return 0
-}
-
-
-#
-# Start a virtual machine given the parameters from
-# the environment.
-#
-do_virsh_start()
-{
-	declare cmdline
-	declare snapshotimage
-
-	echo -n "Virtual machine $OCF_RESKEY_name is "
-	do_status && return 0
-
-	snapshotimage="$OCF_RESKEY_snapshot/$OCF_RESKEY_name"
-
-        if [ -n "$OCF_RESKEY_snapshot" -a -f "$snapshotimage" ]; then
-		eval virsh restore $snapshotimage
-		if [ $? -eq 0 ]; then
-			rm -f $snapshotimage
-			return 0
-		fi
-		return 1
-	fi
-
-	if [ -n "$OCF_RESKEY_xmlfile" -a -f "$OCF_RESKEY_xmlfile" ]; then
-		# TODO: try to use build_virsh_cmdline for the hypervisor_uri
-		cmdline="virsh create $OCF_RESKEY_xmlfile"
-	else
-		cmdline="virsh $(build_virsh_cmdline start)"
-	fi
-
-	ocf_log debug "$cmdline"
-
-	$cmdline
-	return $?
-}
-
-
-do_xm_stop()
-{
-	declare -i timeout=60
-	declare -i ret=1
-	declare st
-
-	for op in $*; do
-		echo "CMD: xm $op $OCF_RESKEY_name"
-		xm $op $OCF_RESKEY_name
-
-		timeout=60
-		while [ $timeout -gt 0 ]; do
-			sleep 5
-			((timeout -= 5))
-			do_status&>/dev/null || return 0
-			while read dom state; do
-				#
-				# State is "stopped".  Kill it.
-				#
-				if [ "$dom" != "$OCF_RESKEY_name" ]; then
-					continue
-				fi
-				if [ "$state" != "---s-" ]; then
-					continue
-				fi
-				xm destroy $OCF_RESKEY_name
-			done < <(xm list | awk '{print $1, $5}')
-		done
-	done
-
-	return 1
-}
-
-
-#
-# Stop a VM.  Try to shut it down.  Wait a bit, and if it
-# doesn't shut down, destroy it.
-#
-do_virsh_stop()
-{
-	declare -i timeout=$(get_timeout)
-	declare -i ret=1
-	declare state
-
-	state=$(do_status)
-	[ $? -eq 0 ] || return 0
-
-	if [ -n "$OCF_RESKEY_snapshot" ]; then
-		virsh save $OCF_RESKEY_name "$OCF_RESKEY_snapshot/$OCF_RESKEY_name"
-	fi
-
-	for op in $*; do
-		echo virsh $op $OCF_RESKEY_name ...
-		virsh $op $OCF_RESKEY_name
-
-		timeout=$(get_timeout)
-		while [ $timeout -gt 0 ]; do
-			sleep 5
-			((timeout -= 5))
-			state=$(do_status)
-			[ $? -eq 0 ] || return 0
-
-			if [ "$state" = "paused" ]; then
-				virsh destroy $OCF_RESKEY_name
-			fi
-		done
-	done
-
-	return 1
-}
-
-
-do_start()
-{
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		do_virsh_start $*
-		return $?
-	fi
-
-	do_xm_start $*
-	return $?
-}
-
-
-do_stop()
-{
-	declare domstate rv
-
-	domstate=$(do_status)
-	rv=$?
-	ocf_log debug "Virtual machine $OCF_RESKEY_name is $domstate"
-	if [ $rv -eq $OCF_APP_ERR_INDETERMINATE ]; then
-		ocf_log crit "xend/libvirtd is dead; cannot stop $OCF_RESKEY_name"
-		return 1
-	fi
-
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		do_virsh_stop $*
-		return $?
-	fi
-
-	do_xm_stop $*
-	return $?
-}
-
-
-#
-# Reconfigure a running VM.
-#
-reconfigure()
-{
-	return 0
-}
-
-
-xm_status()
-{
-	service xend status &> /dev/null
-	if [ $? -ne 0 ]; then 
-		# if xend died
-		echo indeterminate
-		return $OCF_APP_ERR_INDETERMINATE
-	fi
-
-	xm list $OCF_RESKEY_name &> /dev/null
-	if [ $? -eq 0 ]; then
-		echo "running"
-		return 0
-	fi
-	xm list migrating-$OCF_RESKEY_name &> /dev/null
-	if [ $? -eq 0 ]; then
-		echo "running"
-		return 0
-	fi
-	echo "not running"
-	return 1
-}
-
-
-virsh_status()
-{
-	declare state pid
-
-	if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
-		service xend status &> /dev/null
-		if [ $? -ne 0 ]; then 
-			echo indeterminate
-			return $OCF_APP_ERR_INDETERMINATE
-		fi
-	fi
-
-	#
-	# libvirtd is required when using virsh even though
-	# not specifically when also using Xen.  This is because
-	# libvirtd is required for migration.
-	#
-	pid=$(pidof libvirtd)
-	if [ -z "$pid" ]; then 
-		echo indeterminate
-		return $OCF_APP_ERR_INDETERMINATE
-	fi
-
-	state=$(virsh domstate $OCF_RESKEY_name)
-
-	echo $state
-
-	if [ "$state" = "running" ] || [ "$state" = "paused" ] || [ "$state" = "no state" ] || 
-	   [ "$state" = "idle" ]; then
-		return 0
-	fi
-
-	if [ "$state" = "shut off" ]; then
-		return $OCF_NOT_RUNNING
-	fi
-
-	return $OCF_ERR_GENERIC
-}
-
-
-#
-# Simple status check: Find the VM in the list of running
-# VMs
-#
-do_status()
-{
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		virsh_status
-		return $?
-	fi
-
-	xm_status
-	return $?
-}
-
-
-#
-# virsh "path" attribute support
-#
-check_config_file()
-{
-	declare path=$1
-
-	if [ -f "$path/$OCF_RESKEY_name" ]; then
-		echo $path/$OCF_RESKEY_name
-		return 2
-	elif [ -f "$path/$OCF_RESKEY_name.xml" ]; then
-		echo $path/$OCF_RESKEY_name.xml
-		return 2
-	fi
-
-	return 0
-}
-
-
-parse_input()
-{
-	declare delim=$1
-	declare input=$2
-	declare func=$3
-	declare inp
-	declare value
-
-	while [ -n "$input" ]; do
-		value=${input/$delim*/}
-		if [ -n "$value" ]; then
-			eval $func $value
-			if [ $? -eq 2 ]; then
-				return 0
-			fi
-		fi
-		inp=${input/$value$delim/}
-		if [ "$input" = "$inp" ]; then
-			inp=${input/$value/}
-		fi
-		input=$inp
-	done
-}
-
-
-search_config_path()
-{
-	declare config_file=$(parse_input ":" "$OCF_RESKEY_path" check_config_file)
-
-	if [ -n "$config_file" ]; then
-		export OCF_RESKEY_xmlfile=$config_file
-		return 0
-	fi
-
-	return 1
-}
-
-
-choose_management_tool()
-{
-	declare -i is_xml
-
-	#
-	# Don't override user value for use_virsh if one is given
-	#
-	if [ -n "$OCF_RESKEY_use_virsh" ]; then
-		return 0
-	fi
-
-	which xmllint &> /dev/null
-	if [ $? -ne 0 ]; then
-		ocf_log warning "Could not find xmllint; assuming virsh mode"
-		export OCF_RESKEY_use_virsh=1
-		unset OCF_RESKEY_path
-		return 0
-	fi
-
-	xmllint $OCF_RESKEY_xmlfile &> /dev/null
-	is_xml=$?
-
-	if [ $is_xml -eq 0 ]; then
-		ocf_log debug "$OCF_RESKEY_xmlfile is XML; using virsh"
-		export OCF_RESKEY_use_virsh=1
-		unset OCF_RESKEY_path
-	else
-		ocf_log debug "$OCF_RESKEY_xmlfile is not XML; using xm"
-		export OCF_RESKEY_use_virsh=0
-		unset OCF_RESKEY_xmlfile
-	fi
-
-	return 0
-}
-
-
-
-validate_all()
-{
-	if [ "$(id -u)" != "0" ]; then
-	       ocf_log err "Cannot control VMs. as non-root user."
-	       return 1
-	fi
-
-	#
-	# If someone selects a hypervisor, honor it.
-	# Otherwise, ask virsh what the hypervisor is.
-	#
-	if [ -z "$OCF_RESKEY_hypervisor" ] ||
-	   [ "$OCF_RESKEY_hypervisor" = "auto" ]; then
-		export OCF_RESKEY_hypervisor="`virsh version | grep \"Running hypervisor:\" | awk '{print $3}' | tr A-Z a-z`"
-		if [ -z "$OCF_RESKEY_hypervisor" ]; then
-			ocf_log err "Could not determine Hypervisor"
-			return $OCF_ERR_ARGS
-		fi
-		echo Hypervisor: $OCF_RESKEY_hypervisor 
-	fi
-
-	#
-	# Xen hypervisor only for when use_virsh = 0.
-	#
-	if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
-		if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
-			ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
-			return $OCF_ERR_ARGS
-		fi
-
-		if [ -n "$OCF_RESKEY_xmlfile" ]; then
-			ocf_log err "Cannot use xmlfile if use_virsh is set to 0"
-			return $OCF_ERR_ARGS
-		fi
-	else
-
-		#
-		# Virsh path support.
-		#
-		if [ -n "$OCF_RESKEY_path" ] &&
-		   [ "$OCF_RESKEY_path" != "/etc/xen" ]; then
-			if [ -n "$OCF_RESKEY_xmlfile" ]; then
-				ocf_log warning "Using $OCF_RESKEY_xmlfile instead of searching $OCF_RESKEY_path"
-			else
-				search_config_path
-				if [ $? -ne 0 ]; then
-					ocf_log warning "Could not find $OCF_RESKEY_name or $OCF_RESKEY_name.xml in search path $OCF_RESKEY_path"
-					unset OCF_RESKEY_xmlfile
-				else
-					ocf_log debug "Using $OCF_RESKEY_xmlfile"
-				fi
-				choose_management_tool
-			fi
-		else
-			export OCF_RESKEY_use_virsh=1
-		fi
-	fi
-
-	if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
-
-		echo "Management tool: xm"
-		which xm &> /dev/null
-		if [ $? -ne 0 ]; then
-			ocf_log err "Cannot find 'xm'; is it installed?"
-			return $OCF_ERR_INSTALLED
-		fi
-
-		if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
-			ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
-			return $OCF_ERR_ARGS
-		fi
-	else
-		echo "Management tool: virsh"
-		which virsh &> /dev/null
-		if [ $? -ne 0 ]; then
-			ocf_log err "Cannot find 'virsh'; is it installed?"
-			return $OCF_ERR_INSTALLED
-		fi
-	fi
-
-	#
-	# Set the hypervisor URI
-	#
-	if [ -z "$OCF_RESKEY_hypervisor_uri" -o "$OCF_RESKEY_hypervisor_uri" = "auto" ] &&
-	   [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-
-		# Virsh makes it easier to do this.  Really.
-		if [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-			OCF_RESKEY_hypervisor_uri="qemu:///system"
-		fi
-
-		# I just need to believe in it more.
-		if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
-			OCF_RESKEY_hypervisor_uri="xen:///"
-		fi
-
-		echo Hypervisor URI: $OCF_RESKEY_hypervisor_uri
-	fi
-
-	#
-	# Set the migration URI
-	#
-	if [ -z "$OCF_RESKEY_migration_uri" -o "$OCF_RESKEY_migration_uri" = "auto" ] &&
-	   [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-
-		# Virsh makes it easier to do this.  Really.
-		if [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-			export OCF_RESKEY_migration_uri="qemu+ssh://%s/system"
-		fi
-
-		# I just need to believe in it more.
-		if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
-			export OCF_RESKEY_migration_uri="xenmigr://%s/"
-		fi
-
-		[ -n "$OCF_RESKEY_migration_uri" ] && echo Migration URI format: $(printf $OCF_RESKEY_migration_uri target_host)
-	fi
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		echo No domain name specified
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-		export migrateuriopt="tcp:%s"
-	fi
-
-	#virsh list --all | awk '{print $2}' | grep -q "^$OCF_RESKEY_name\$"
-	return $?
-}
-
-
-virsh_migrate()
-{
-	declare target=$1
-	declare rv=1
-
-	#
-	# Xen and qemu have different migration mechanisms
-	#
-	if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then 
-		cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $OCF_RESKEY_hypervisor_uri $(printf $OCF_RESKEY_migration_uri $target)"
-		ocf_log debug "$cmd"
-		
-		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
-		rv=$?
-	elif [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-		cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target) $(printf $migrateuriopt $target)"
-		ocf_log debug "$cmd"
-		
-		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
-		rv=$?
-	fi
-
-	if [ $rv -ne 0 ]; then
-		ocf_log err "Migrate $OCF_RESKEY_name to $target failed:"
-		ocf_log err "$err"
-
-		if [ "$err" != "${err/does not exist/}" ]; then
-			return $OCF_ERR_CONFIGURED
-		fi
-		if [ "$err" != "${err/Domain not found/}" ]; then
-			return $OCF_ERR_CONFIGURED
-		fi
-
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $rv
-}
-
-
-#
-# XM migrate
-#
-xm_migrate()
-{
-	declare target=$1
-	declare errstr rv migrate_opt cmd
-
-	rv=1
-
-	if [ "$OCF_RESKEY_migrate" = "live" ]; then
-		migrate_opt="-l"
-	fi
-
-	# migrate() function  sets target using migration_mapping;
-	# no need to do it here anymore
-	cmd="xm migrate $migrate_opt $OCF_RESKEY_name $target"
-	ocf_log debug "$cmd"
-
-	err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
-	rv=$?
-
-	if [ $rv -ne 0 ]; then
-		ocf_log err "Migrate $OCF_RESKEY_name to $target failed:"
-		ocf_log err "$err"
-
-		if [ "$err" != "${err/does not exist/}" ]; then
-			return $OCF_NOT_RUNNING
-		fi
-		if [ "$err" != "${err/Connection refused/}" ]; then
-			return $OCF_ERR_CONFIGURED
-		fi
-
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $?
-}
-
-# 
-# Virsh migrate
-#
-migrate()
-{
-	declare target=$1
-	declare rv migrate_opt
-
-	if [ "$OCF_RESKEY_migrate" = "live" ]; then
-		migrate_opt="--live"
-	fi
-
-	# Patch from Marcelo Azevedo to migrate over private
-	# LANs instead of public LANs
-        if [ -n "$OCF_RESKEY_migration_mapping" ] ; then
-                target=${OCF_RESKEY_migration_mapping#*$target:} target=${target%%,*}
-        fi
-
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		virsh_migrate $target
-		rv=$?
-	else
-		xm_migrate $target
-		rv=$?
-	fi
-
-	return $rv
-}
-
-
-wait_start()
-{
-	declare -i timeout_remaining=$(get_timeout)
-	declare -i start_time
-	declare -i end_time
-	declare -i delta
-	declare -i sleep_time
-
-	if [ -z "$OCF_RESKEY_status_program" ]; then
-		return 0
-	fi
-
-	while [ $timeout_remaining -gt 0 ]; do
-		start_time=$(date +%s)
-		bash -c "$OCF_RESKEY_status_program"
-		if [ $? -eq 0 ]; then
-			return 0
-		fi
-		end_time=$(date +%s)
-		delta=$(((end_time - start_time)))
-		sleep_time=$(((5 - delta)))
-
-		((timeout_remaining -= $delta))
-		if [ $sleep_time -gt 0 ]; then
-			sleep $sleep_time
-			((timeout_remaining -= $sleep_time))
-		fi
-	done
-
-	ocf_log err "Start of $OCF_RESOURCE_INSTANCE has failed"
-	ocf_log err "Timeout exceeded while waiting for \"$OCF_RESKEY_status_program\""
-
-	return 1
-}
-
-#
-#
-#
-
-case $1 in
-	start)
-		validate_all || exit $OCF_ERR_ARGS
-		do_start
-		rv=$?
-		if [ $rv -ne 0 ]; then
-			exit $rv
-		fi
-
-		wait_start
-		exit $?
-		;;
-	stop)
-		validate_all || exit $OCF_ERR_ARGS
-		do_stop shutdown destroy
-		exit $?
-		;;
-	kill)
-		validate_all || exit $OCF_ERR_ARGS
-		do_stop destroy
-		exit $?
-		;;
-	recover|restart)
-		exit 0
-		;;
-	status|monitor)
-		validate_all || exit $OCF_ERR_ARGS
-		echo -n "Virtual machine $OCF_RESKEY_name is "
-		do_status
-		rv=$?
-		if [ $rv -ne 0 ]; then
-			exit $rv
-		fi
-		[ -z "$OCF_RESKEY_status_program" ] && exit 0
-		[ -z "$OCF_CHECK_LEVEL" ] && exit 0
-		[ $OCF_CHECK_LEVEL -lt 10 ] && exit 0
-
-		bash -c "$OCF_RESKEY_status_program" &> /dev/null
-		exit $?
-		;;
-	migrate)
-		validate_all || exit $OCF_ERR_ARGS
-		migrate $2 # Send VM to this node
-		rv=$?
-		if [ $rv -eq $OCF_ERR_GENERIC ]; then
-			# Catch-all: If migration failed with
-			# an unhandled error, do a status check
-			# to see if the VM is really dead.
-			#
-			# If the VM is still in good health, return
-			# a value to rgmanager to indicate the 
-			# non-critical error
-			#
-			# OCF states that codes 150-199 are reserved
-			# for application use, so we'll use 150
-			#
-			do_status > /dev/null
-			if [ $? -eq 0 ]; then
-				rv=150
-			fi
-		fi
-		exit $rv
-		;;
-	reload)
-		exit 0
-		;;
-	reconfig)
-		validate_all || exit $OCF_ERR_ARGS
-		echo "$0 RECONFIGURING $OCF_RESKEY_memory"
-		reconfigure
-		exit $?
-		;;
-	meta-data)
-		meta_data
-		exit 0
-		;;
-	validate-all)
-		validate_all
-		exit $?
-		;;
-	*)
-		echo "usage: $0 {start|stop|restart|status|reload|reconfig|meta-data|validate-all}"
-		exit 1
-		;;
-esac
diff --git a/scripts/fenceparse b/scripts/fenceparse
deleted file mode 100644
index b6ed431..0000000
--- a/scripts/fenceparse
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-set -e
-
-export LC_ALL=C
-
-definefile="$1"
-define="$2"
-release="$3"
-srcdir="$4"
-infile="$5"
-
-definedata="$(cat $definefile | grep "^\#define $define" | sed -e 's/.*'$define' //')"
-
-realinfile="$(ls $srcdir/$infile.*{py,pl,sh} 2>/dev/null || true)"
-
-[ -z "$realinfile" ] && exit 1
-
-interpreter="$(cat $realinfile | head -n 1 | awk -F "/" '{print $NF}')"
-interpreter="$(echo $interpreter)"
-
-case "$interpreter" in
-	perl)
-		start="\$"
-		end=";"
-	;;
-	*)
-		start=""
-		end=""
-	;;
-esac
-
-awk "{print}(\$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $realinfile
-echo ${start}RELEASE_VERSION=\"${release}\"${end}
-echo ${start}BUILD_DATE=\"\(built $(date)\)\"${end}
-if awk -v p=0 "(\$1 ~ /#BEGIN_VERSION_GENERATION/){p = 1} (\$1 ~ /#END_VERSION_GENERATION/){p = 0} {if(p==1)print}" $realinfile | \
-		grep -q REDHAT_COPYRIGHT; then
-	echo ${start}REDHAT_COPYRIGHT=${definedata}${end}
-fi
-awk -v p=0 "(\$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $realinfile
-
-exit 0


More information about the cluster-commits mailing list