├── .gitignore ├── COPYING ├── CREDITS ├── Config.make.in ├── MAINTAINERS ├── Makefile ├── Makepdfs ├── Postamble.make ├── Preamble.make ├── README ├── README.O2CB ├── Vendor.make ├── aclocal.m4 ├── autogen.sh ├── blkid.m4 ├── config.guess ├── config.sub ├── configure.in ├── debian ├── .gitignore ├── NEWS ├── README.Debian ├── changelog ├── compat ├── control ├── copyright ├── ocfs2-tools-static-dev.install ├── ocfs2-tools.config ├── ocfs2-tools.docs ├── ocfs2-tools.install ├── ocfs2-tools.manpages ├── ocfs2-tools.postinst ├── ocfs2-tools.postrm ├── ocfs2-tools.templates ├── ocfs2console.install ├── ocfs2console.manpages ├── po │ ├── POTFILES.in │ ├── cs.po │ ├── de.po │ ├── es.po │ ├── fr.po │ ├── nl.po │ ├── pt_BR.po │ ├── ru.po │ ├── sv.po │ ├── templates.pot │ └── vi.po └── rules ├── debugfs.ocfs2 ├── .gitignore ├── Cscope.make ├── Makefile ├── README ├── commands.c ├── debugfs.ocfs2.8.in ├── dump.c ├── dump_dlm_locks.c ├── dump_fs_locks.c ├── dump_net_stats.c ├── find_block_inode.c ├── find_inode_paths.c ├── include │ ├── commands.h │ ├── dump.h │ ├── dump_dlm_locks.h │ ├── dump_fs_locks.h │ ├── dump_net_stats.h │ ├── find_block_inode.h │ ├── find_inode_paths.h │ ├── journal.h │ ├── main.h │ ├── ocfs2_internals.h │ ├── stat_sysdir.h │ └── utils.h ├── journal.c ├── main.c ├── stat_sysdir.c └── utils.c ├── defragfs.ocfs2 ├── Makefile ├── defragfs.ocfs2.8.in ├── include │ ├── libdefrag.h │ ├── o2defrag.h │ └── record.h ├── libdefrag.c ├── main.c └── record.c ├── documentation ├── .gitignore ├── 01-cluster_start_stop.odt ├── 02-mount_umount.odt ├── 03-disk_format.odt ├── migrate_from_ocfs.sxw ├── ocfs2_dlm_design_draft.odt ├── ocfs2_faq.html ├── ocfs2_faq.txt ├── samples │ └── cluster.conf ├── users_guide.odt ├── users_guide.sxw └── users_guide.txt ├── extras ├── .gitignore ├── Makefile ├── check_metaecc.c ├── compute_groups.c ├── decode_lockres.c ├── encode_lockres.c ├── find_allocation_fragments.c ├── find_dup_extents.c ├── find_hardlinks.c ├── find_inode_paths.c ├── mark_journal_dirty.c ├── resize_slotmap.c ├── set_random_bits.c ├── verify_backup_super └── watch-hb.sh ├── fsck.ocfs2 ├── .gitignore ├── Cscope.make ├── Makefile ├── dirblocks.c ├── dirparents.c ├── extent.c ├── fsck.c ├── fsck.ocfs2.8.in ├── fsck.ocfs2.checks.8.in ├── icount.c ├── include │ ├── dirblocks.h │ ├── dirparents.h │ ├── extent.h │ ├── fsck.h │ ├── icount.h │ ├── journal.h │ ├── o2fsck_strings.h │ ├── pass0.h │ ├── pass1.h │ ├── pass1b.h │ ├── pass2.h │ ├── pass3.h │ ├── pass4.h │ ├── pass5.h │ ├── problem.h │ ├── refcount.h │ ├── slot_recovery.h │ ├── util.h │ └── xattr.h ├── journal.c ├── pass0.c ├── pass1.c ├── pass1b.c ├── pass2.c ├── pass3.c ├── pass4.c ├── pass5.c ├── problem.c ├── refcount.c ├── slot_recovery.c ├── strings.c ├── util.c └── xattr.c ├── fswreck ├── .gitignore ├── Cscope.make ├── Makefile ├── chain.c ├── corrupt.c ├── dir.c ├── discontig_bg.c ├── extent.c ├── group.c ├── include │ ├── chain.h │ ├── corrupt.h │ ├── dir.h │ ├── discontig_bg.h │ ├── extent.h │ ├── fsck_type.h │ ├── group.h │ ├── inode.h │ ├── journal.h │ ├── local_alloc.h │ ├── main.h │ ├── quota.h │ ├── refcount.h │ ├── special.h │ ├── symlink.h │ └── truncate_log.h ├── inode.c ├── journal.c ├── local_alloc.c ├── main.c ├── quota.c ├── refcount.c ├── special.c ├── symlink.c └── truncate_log.c ├── glib-2.0.m4 ├── include ├── Makefile ├── o2cb │ ├── .gitignore │ ├── Makefile │ ├── o2cb.h │ ├── o2cb_client_proto.h │ ├── ocfs2_heartbeat.h │ └── ocfs2_nodemanager.h ├── o2dlm │ ├── .gitignore │ ├── Makefile │ └── o2dlm.h ├── ocfs2-kernel │ ├── Makefile │ ├── fiemap.h │ ├── kernel-list.h │ ├── ocfs1_fs_compat.h │ ├── ocfs2_fs.h │ ├── ocfs2_ioctl.h │ ├── ocfs2_lockid.h │ ├── quota_tree.h │ └── sparse_endian_types.h ├── ocfs2 │ ├── .gitignore │ ├── Makefile │ ├── bitops.h │ ├── byteorder.h │ ├── image.h │ ├── jbd2.h │ ├── kernel-rbtree.h │ └── ocfs2.h └── tools-internal │ ├── Makefile │ ├── progress.h │ ├── scandisk.h │ ├── utils.h │ └── verbose.h ├── install-sh ├── libo2cb ├── .gitignore ├── Cscope.make ├── Makefile ├── TODO ├── client_proto.c ├── o2cb.7.in ├── o2cb_abi.c ├── o2cb_abi.h ├── o2cb_crc32.c ├── o2cb_crc32.h └── o2cb_err.et ├── libo2dlm ├── .gitignore ├── Cscope.make ├── Makefile ├── capabilities.c ├── libdlm-compat.h ├── o2dlm.c ├── o2dlm_err.et └── o2dlm_test.c ├── libocfs2 ├── .gitignore ├── Cscope.make ├── Makefile ├── alloc.c ├── backup_super.c ├── bitmap.c ├── bitmap.h ├── bitops.c ├── blockcheck.c ├── blocktype.c ├── cached_inode.c ├── chain.c ├── chainalloc.c ├── checkhb.c ├── closefs.c ├── crc32table.h ├── dir_indexed.c ├── dir_iterate.c ├── dir_iterate.h ├── dir_scan.c ├── dir_util.h ├── dirblock.c ├── dlm.c ├── expanddir.c ├── extend_file.c ├── extent_map.c ├── extent_map.h ├── extent_tree.c ├── extent_tree.h ├── extents.c ├── feature_string.c ├── fileio.c ├── freefs.c ├── getsectsize.c ├── getsize.c ├── heartbeat.c ├── image.c ├── inode.c ├── inode_scan.c ├── ismounted.c ├── kernel-rbtree.c ├── link.c ├── lockid.c ├── lookup.c ├── memory.c ├── mkjournal.c ├── namei.c ├── ocfs2.7.in ├── ocfs2_err.et ├── openfs.c ├── quota.c ├── refcount.c ├── refcount.h ├── slot_map.c ├── sysfile.c ├── truncate.c ├── unix_io.c ├── unlink.c └── xattr.c ├── libtools-internal ├── .gitignore ├── Makefile ├── libtools-internal.h ├── progress.c ├── scandisk.c ├── utils.c └── verbose.c ├── listuuid ├── .gitignore ├── Makefile └── listuuid.c ├── mbvendor.m4 ├── mkfs.ocfs2 ├── .gitignore ├── Cscope.make ├── Makefile ├── check.c ├── mkfs.c ├── mkfs.h └── mkfs.ocfs2.8.in ├── mkinstalldirs ├── mount.ocfs2 ├── .gitignore ├── CREDITS ├── Cscope.make ├── Makefile ├── fstab.c ├── fstab.h ├── mntent.c ├── mntent.h ├── mount.ocfs2.8.in ├── mount.ocfs2.c ├── mount.ocfs2.h ├── mount_constants.h ├── nls.h ├── opts.c ├── opts.h ├── paths.h ├── realpath.c ├── realpath.h ├── sundries.c ├── sundries.h ├── xmalloc.c └── xmalloc.h ├── mounted.ocfs2 ├── .gitignore ├── Cscope.make ├── Makefile ├── mounted.c └── mounted.ocfs2.8.in ├── o2cb.pc.in ├── o2cb_ctl ├── .gitignore ├── Cscope.make ├── Makefile ├── jconfig.c ├── jconfig.h ├── jiterator.c ├── jiterator.h ├── o2cb.8.in ├── o2cb_config.c ├── o2cb_config.h ├── o2cb_ctl.8.in ├── o2cb_ctl.c ├── o2cb_scandisk.c ├── o2cb_scandisk.h ├── o2cbtool.c ├── o2cbtool.h ├── o2cbutils.c ├── ocfs2.cluster.conf.5.in ├── op_cluster.c ├── op_heartbeat.c ├── op_lists.c ├── op_node.c ├── op_register.c ├── op_start.c └── op_status.c ├── o2dlm.pc.in ├── o2image ├── .gitignore ├── Makefile ├── o2image.8.in └── o2image.c ├── o2info ├── .gitignore ├── Makefile ├── libo2info.c ├── libo2info.h ├── o2info.1.in ├── o2info.c ├── o2info.h ├── operations.c ├── utils.c └── utils.h ├── o2monitor ├── .gitignore ├── Makefile ├── o2hbmonitor.8.in └── o2hbmonitor.c ├── ocfs2.pc.in ├── ocfs2_controld ├── .gitignore ├── Makefile ├── ckpt.c ├── cman.c ├── cpg.c ├── dlmcontrol.c ├── main.c ├── mount.c ├── ocfs2_controld.h ├── pacemaker.c └── test_client.c ├── ocfs2_hb_ctl ├── .gitignore ├── Cscope.make ├── Makefile ├── ocfs2_hb_ctl.8.in └── ocfs2_hb_ctl.c ├── ocfs2cdsl ├── .gitignore ├── Makefile ├── ocfs2cdsl.8.in └── ocfs2cdsl.c ├── ocfs2console ├── .gitignore ├── Makefile ├── blkid │ ├── .gitignore │ ├── ChangeLog │ ├── Makefile │ ├── blkid.h │ ├── blkidP.h │ ├── cache.c │ ├── dev.c │ ├── devname.c │ ├── devno.c │ ├── getsize.c │ ├── list.h │ ├── llseek.c │ ├── probe.c │ ├── probe.h │ ├── read.c │ ├── resolve.c │ ├── save.c │ ├── tag.c │ └── version.c ├── ocfs2console ├── ocfs2console.8.in └── ocfs2interface │ ├── .gitignore │ ├── Makefile │ ├── __init__.py │ ├── about.py │ ├── bosa.py │ ├── classlabel.py │ ├── confdefs.py.in │ ├── console.py │ ├── format.py │ ├── fsck.py │ ├── fstab.py │ ├── fswidgets.py │ ├── general.py │ ├── gidlemodule.c │ ├── guiutil.py │ ├── ipwidget.py │ ├── ls.py │ ├── menu.py │ ├── mount.py │ ├── nodeconfig.py │ ├── o2cb_ctl.py │ ├── o2cbmodule.c │ ├── ocfs2module.c │ ├── ocfsplist.c │ ├── ocfsplist.h │ ├── partitionview.py │ ├── plistmodule.c │ ├── process.py │ ├── pushconfig.py │ ├── terminal.py │ ├── toolbar.py │ └── tune.py ├── patches ├── Makefile ├── README ├── libblkidocfs2support.patch └── mountocfs2support.patch ├── pkg.m4 ├── python.m4 ├── pythondev.m4 ├── rpmarch.guess ├── runlog.m4 ├── sizetest ├── .gitignore ├── Makefile ├── sizes.txt └── sizetest.c ├── svnrev.guess ├── tests ├── fsck-test.sh └── mkfs-test.sh ├── tunefs.ocfs2 ├── .gitignore ├── Cscope.make ├── Makefile ├── feature_append_dio.c ├── feature_backup_super.c ├── feature_clusterinfo.c ├── feature_discontig_bg.c ├── feature_extended_slotmap.c ├── feature_indexed_dirs.c ├── feature_inline_data.c ├── feature_local.c ├── feature_metaecc.c ├── feature_quota.c ├── feature_refcount.c ├── feature_sparse_files.c ├── feature_unwritten_extents.c ├── feature_xattr.c ├── libocfs2ne.c ├── libocfs2ne.h ├── o2cluster.8.in ├── o2cluster.c ├── o2ne_err.et ├── ocfs2ne.c ├── op_cloned_volume.c ├── op_features.c ├── op_list_sparse_files.c ├── op_query.c ├── op_reset_uuid.c ├── op_resize_volume.c ├── op_set_journal_block.c ├── op_set_journal_size.c ├── op_set_label.c ├── op_set_quota_sync_interval.c ├── op_set_slot_count.c ├── op_update_cluster_stack.c └── tunefs.ocfs2.8.in ├── vendor.guess └── vendor ├── Makefile ├── common ├── .gitignore ├── 51-ocfs2.rules ├── Makefile ├── Vendor.make ├── o2cb.init.sh ├── o2cb.service ├── o2cb.sysconfig ├── o2cb.sysconfig.5.in ├── ocfs2-tools.spec-generic.in ├── ocfs2.init ├── ocfs2.service ├── ocfs2console.desktop └── ocfs2console.png ├── fc7 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── fc8 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── fc9 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── rhel4 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── rhel5 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── rhel6 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── rhel7 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess ├── sles10 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess └── sles9 ├── Makefile ├── Vendor.make ├── rpmarch.guess └── vendor.guess /.gitignore: -------------------------------------------------------------------------------- 1 | cscope.* 2 | *.a 3 | *.o 4 | stamp-md5 5 | configure 6 | Config.make 7 | config.* 8 | autom4te.cache 9 | aclocal.m4 10 | ocfs2-tools-*.src.rpm 11 | ocfs2-tools-*.tar.gz 12 | build-stamp 13 | configure-stamp 14 | *.pc 15 | *.sw? 16 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | fsck.ocfs2: 2 | Written by Zach Brown. 3 | fsck.ocfs2's behaviour is derived from e2fsck by Theodore Ts'o, Andreas 4 | Dilger, Stephen Tweedie, and others. 5 | 6 | libocfs2: 7 | Written by Joel Becker, Zach Brown, and Sunil Mushran 8 | Huge portions of libocfs2's API and behavior were derived from 9 | libext2fs by Theodore Ts'o, Andreas Dilger, Stephen Tweedie, 10 | and others. 11 | 12 | mkfs.ocfs2: 13 | Written by Kurt Hackel. 14 | Modified by Manish Singh, Joel Becker, and Mark Fasheh. 15 | 16 | debugfs.ocfs2: 17 | Written by Sunil Mushran. 18 | Modified by Mark Fasheh. 19 | 20 | mounted.ocfs2: 21 | Written by Sunil Mushran. 22 | 23 | tunefs.ocfs2 24 | Written by Sunil Mushran. 25 | 26 | ocfs2cdsl: 27 | Written by Manish Singh. 28 | 29 | ocfs2console: 30 | Written by Manish Singh. 31 | 32 | o2info: 33 | Written by Tristan Ye. 34 | 35 | defrag.ocfs2: 36 | Written by Larry Chen. 37 | 38 | ocfs2console/blkid: 39 | From e2fsprogs 1.37, by Theodore Ts'o and Andreas Dilger. 40 | 41 | ocfs2console/ocfs2interface/ipwidget.py: 42 | From anaconda 10.1.1.13, by Jonathan Blandford and Michael Fulbright 43 | -------------------------------------------------------------------------------- /Config.make.in: -------------------------------------------------------------------------------- 1 | PACKAGE = @PACKAGE@ 2 | VERSION = @VERSION@ 3 | 4 | DIST_VERSION = @DIST_VERSION@ 5 | 6 | MAJOR_VERSION = @MAJOR_VERSION@ 7 | MINOR_VERSION = @MINOR_VERSION@ 8 | MICRO_VERSION = @MICRO_VERSION@ 9 | EXTRA_VERSION = @EXTRA_VERSION@ 10 | 11 | SHELL = @SHELL@ 12 | 13 | prefix = @prefix@ 14 | exec_prefix = @exec_prefix@ 15 | 16 | bindir = @bindir@ 17 | sbindir = @sbindir@ 18 | includedir = @includedir@ 19 | libdir = @libdir@ 20 | datadir = @datadir@ 21 | sysconfdir = @sysconfdir@ 22 | mandir = @mandir@ 23 | 24 | root_prefix = @root_prefix@ 25 | root_bindir = @root_bindir@ 26 | root_sbindir = @root_sbindir@ 27 | root_sysconfdir = @root_sysconfdir@ 28 | 29 | pyexecdir = @pyexecdir@ 30 | 31 | top_builddir = . 32 | 33 | INSTALL = @INSTALL@ 34 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 35 | INSTALL_LIBRARY = @INSTALL_PROGRAM@ 36 | INSTALL_DATA = @INSTALL_DATA@ 37 | INSTALL_HEADER = @INSTALL_DATA@ 38 | 39 | LN_S = @LN_S@ 40 | 41 | CC = @CC@ 42 | CPP = @CPP@ 43 | AR = @AR@ 44 | RANLIB = @RANLIB@ 45 | 46 | WARNINGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \ 47 | -Wmissing-declarations 48 | 49 | CFLAGS = @CFLAGS@ 50 | CFLAGS += $(WARNINGS) 51 | CPPFLAGS = @CPPFLAGS@ 52 | LDFLAGS = @LDFLAGS@ 53 | 54 | VENDOR = @VENDOR@ 55 | 56 | COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ 57 | COM_ERR_LIBS = @COM_ERR_LIBS@ 58 | UUID_LIBS = @UUID_LIBS@ 59 | AIO_LIBS = @AIO_LIBS@ 60 | READLINE_LIBS = @READLINE_LIBS@ 61 | NCURSES_LIBS = @NCURSES_LIBS@ 62 | 63 | GLIB_CFLAGS = @GLIB_CFLAGS@ 64 | GLIB_LIBS = @GLIB_LIBS@ 65 | 66 | PYTHON = @PYTHON@ 67 | PYTHON_INCLUDES = @PYTHON_INCLUDES@ 68 | 69 | BLKID_CFLAGS = @BLKID_CFLAGS@ 70 | BLKID_LIBS = @BLKID_LIBS@ 71 | 72 | HAVE_BLKID = @HAVE_BLKID@ 73 | 74 | LIBDLM_FOUND = @LIBDLM_FOUND@ 75 | 76 | BUILD_OCFS2CONSOLE = @BUILD_OCFS2CONSOLE@ 77 | 78 | BUILD_DEBUGOCFS2 = @BUILD_DEBUGOCFS2@ 79 | 80 | HAVE_COROSYNC = @HAVE_COROSYNC@ 81 | BUILD_OCFS2_CONTROLD = @BUILD_OCFS2_CONTROLD@ 82 | BUILD_PCMK_SUPPORT = @BUILD_PCMK_SUPPORT@ 83 | BUILD_CMAN_SUPPORT = @BUILD_CMAN_SUPPORT@ 84 | BUILD_CMAP_SUPPORT = @BUILD_CMAP_SUPPORT@ 85 | BUILD_FSDLM_SUPPORT = @BUILD_FSDLM_SUPPORT@ 86 | CPG_LDFLAGS = @CPG_LDFLAGS@ 87 | AIS_LDFLAGS = @AIS_LDFLAGS@ 88 | DL_LIBS = @DL_LIBS@ 89 | 90 | OCFS2_DEBUG = @OCFS2_DEBUG@ 91 | 92 | OCFS2_DEBUG_EXE = @OCFS2_DEBUG_EXE@ 93 | 94 | OCFS2_DYNAMIC_FSCK = @OCFS2_DYNAMIC_FSCK@ 95 | OCFS2_DYNAMIC_CTL = @OCFS2_DYNAMIC_CTL@ 96 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | fsck.ocfs2: 2 | Zach Brown 3 | Joel Becker 4 | 5 | libocfs2: 6 | Joel Becker 7 | Zach Brown 8 | 9 | ocfs2tool: 10 | Manish Singh 11 | 12 | ocfs2cdsl: 13 | Manish Singh 14 | 15 | debugfs.ocfs2: 16 | Sunil Mushran 17 | 18 | mounted.ocfs2: 19 | Sunil Mushran 20 | 21 | tunefs.ocfs2: 22 | Sunil Mushran 23 | -------------------------------------------------------------------------------- /Preamble.make: -------------------------------------------------------------------------------- 1 | ifeq ($(TOPDIR)/Config.make,$(wildcard $(TOPDIR)/Config.make)) 2 | include $(TOPDIR)/Config.make 3 | else 4 | .PHONY: dummy-notconfigured 5 | dummy-notconfigured: 6 | @echo "Please run the configure script first" 7 | endif 8 | 9 | LIBRARIES = 10 | UNINST_LIBRARIES = 11 | BIN_PROGRAMS = 12 | SBIN_PROGRAMS = 13 | UNINST_PROGRAMS = 14 | MODULES = 15 | HEADERS = 16 | MANS = 17 | 18 | HEADERS_SUBDIR = 19 | 20 | INSTALL_RULES = 21 | 22 | CLEAN_FILES = 23 | CLEAN_RULES = 24 | 25 | DIST_FILES = 26 | DIST_RULES = 27 | 28 | INCLUDES = 29 | DEFINES = 30 | 31 | CFLAGS += -pipe -D_DEFAULT_SOURCE=1 32 | # protect with configure? 33 | CDEPFLAGS = -MD -MP -MF $(@D)/.$(basename $(@F)).d 34 | 35 | LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ 36 | 37 | VERSION_FILES = 38 | VERSION_PREFIX = 39 | VERSION_SRC = 40 | 41 | DIST_TOPDIR = $(TOPDIR)/$(PACKAGE)-$(DIST_VERSION) 42 | DIST_CURDIR = . 43 | DIST_DIR = $(DIST_TOPDIR)/$(DIST_CURDIR) 44 | 45 | GZIP_OPTS = --best 46 | 47 | .PHONY: all strip install 48 | all: all-rules 49 | strip: strip-rules 50 | install: install-rules 51 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | These are tools for the OCFS2 filesystem. 2 | -------------------------------------------------------------------------------- /Vendor.make: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # This Makefile snippet is to be included in Makebo Makefiles that 4 | # use the mbvendor infrastructure 5 | # 6 | 7 | PKG_VERSION = $(shell $(TOPDIR)/svnrev.guess $(PACKAGE)) 8 | 9 | -include $(TOPDIR)/vendor/$(shell ./vendor.guess)/Vendor.make 10 | 11 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | m4_include([pkg.m4]) 2 | m4_include([glib-2.0.m4]) 3 | m4_include([runlog.m4]) 4 | m4_include([python.m4]) 5 | m4_include([pythondev.m4]) 6 | m4_include([blkid.m4]) 7 | m4_include([mbvendor.m4]) 8 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | PROJECT=ocfs2-tools 6 | 7 | rm -rf autom4te.cache 8 | autoconf 9 | ./configure "$@" 10 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | files 3 | *.debhelper 4 | tmp 5 | dsh 6 | *.substvars 7 | ocfs2-tools.o2cb.default 8 | ocfs2-tools.o2cb.init 9 | ocfs2-tools.ocfs2.init 10 | ocfs2-tools 11 | ocfs2-tools-static-dev 12 | stamp-patched 13 | ocfs2console 14 | -------------------------------------------------------------------------------- /debian/NEWS: -------------------------------------------------------------------------------- 1 | ocfs2-tools (1.2.1-1) unstable; urgency=low 2 | 3 | * The init script needs modules now in order to function properly. Upstream 4 | strongly discourages the changes I did in 1.1.5 in order to work for the 5 | monolithic kernel case. 6 | The sctp module is no longer necessary. Please read 7 | /usr/share/doc/ocfs2-tools/README.Debian for the complete requirements. 8 | 9 | -- David Martínez Moreno Sun, 28 May 2006 13:18:50 +0200 10 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | Instructions for OCFS2 filesystems in Debian 2 | ============================================ 3 | 4 | The init script for Debian expects to have most of the kernel code 5 | it uses available in modular form. 6 | 7 | In previous releases sctp module was necessary to work around a 8 | kernel starvation that led to crashes. With 1.2.1 this seems to be 9 | no longer necessary. 10 | 11 | Here follows the name and location of the modules: 12 | 13 | Module name Location 14 | -------------------------------- 15 | configfs File systems 16 | -> Pseudo filesystems 17 | -> Userspace-driven configuration filesystem 18 | ocfs2_nodemanager File systems 19 | -> OCFS2 file system support 20 | ocfs2_dlm File systems 21 | -> OCFS2 file system support 22 | ocfs2_dlmfs File systems 23 | -> OCFS2 file system support 24 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by David Martínez Moreno 2 | on Tue, 5 Jul 2005 17:02:00 +0200. 3 | 4 | It was downloaded from http://oss.oracle.com/projects/ocfs2-tools/files/source/ 5 | 6 | Copyright: (c) 2004-2007 Oracle Corporation, All Rights Reserved. 7 | 8 | License: 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program; if not, write to the Free Software 22 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 23 | 24 | On Debian systems, the complete text of the GNU General Public 25 | License can be found in /usr/share/common-licenses/GPL file. 26 | -------------------------------------------------------------------------------- /debian/ocfs2-tools-static-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | usr/lib/*.a 3 | usr/lib/pkgconfig/* 4 | -------------------------------------------------------------------------------- /debian/ocfs2-tools.config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | ## Source debconf library. 6 | . /usr/share/debconf/confmodule 7 | 8 | ## be sure to read the values from the config file. 9 | if [ -e /etc/default/o2cb ]; then 10 | 11 | . /etc/default/o2cb 12 | 13 | if [ -z "$O2CB_HEARTBEAT_THRESHOLD" ];then 14 | O2CB_HEARTBEAT_THRESHOLD=7 15 | fi 16 | if [ -z "$O2CB_IDLE_TIMEOUT_MS" ];then 17 | O2CB_IDLE_TIMEOUT_MS=10000 18 | fi 19 | if [ -z "$O2CB_KEEPALIVE_DELAY_MS" ];then 20 | O2CB_KEEPALIVE_DELAY_MS=5000 21 | fi 22 | if [ -z "$O2CB_RECONNECT_DELAY_MS" ];then 23 | O2CB_RECONNECT_DELAY_MS=2000 24 | fi 25 | 26 | db_set ocfs2-tools/init "$O2CB_ENABLED" 27 | db_set ocfs2-tools/clustername "$O2CB_BOOTCLUSTER" 28 | db_set ocfs2-tools/heartbeat_threshold "$O2CB_HEARTBEAT_THRESHOLD" 29 | db_set ocfs2-tools/idle_timeout "$O2CB_IDLE_TIMEOUT_MS" 30 | db_set ocfs2-tools/keepalive_delay "$O2CB_KEEPALIVE_DELAY_MS" 31 | db_set ocfs2-tools/reconnect_delay "$O2CB_RECONNECT_DELAY_MS" 32 | fi 33 | 34 | if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then 35 | db_input medium ocfs2-tools/init || true 36 | db_go || true 37 | db_get ocfs2-tools/init 38 | if [ "$RET" = "true" ]; then 39 | db_input medium ocfs2-tools/clustername || true 40 | db_go || true 41 | db_input medium ocfs2-tools/heartbeat_threshold || true 42 | db_go || true 43 | db_input low ocfs2-tools/idle_timeout || true 44 | db_go || true 45 | db_input low ocfs2-tools/keepalive_delay || true 46 | db_go || true 47 | db_input low ocfs2-tools/reconnect_delay || true 48 | db_go || true 49 | fi 50 | fi 51 | 52 | #DEBHELPER# 53 | -------------------------------------------------------------------------------- /debian/ocfs2-tools.docs: -------------------------------------------------------------------------------- 1 | CREDITS 2 | MAINTAINERS 3 | -------------------------------------------------------------------------------- /debian/ocfs2-tools.install: -------------------------------------------------------------------------------- 1 | sbin/debugfs.ocfs2 2 | sbin/fsck.ocfs2 3 | sbin/mkfs.ocfs2 4 | sbin/mount.ocfs2 5 | sbin/mounted.ocfs2 6 | sbin/o2cb_ctl 7 | sbin/ocfs2_hb_ctl 8 | sbin/tunefs.ocfs2 9 | usr/bin/o2info 10 | usr/sbin/o2hbmonitor 11 | usr/share/man/man8/debugfs.ocfs2.8 12 | usr/share/man/man8/fsck.ocfs2.8 13 | usr/share/man/man8/fsck.ocfs2.checks.8 14 | usr/share/man/man8/mkfs.ocfs2.8 15 | usr/share/man/man8/mount.ocfs2.8 16 | usr/share/man/man8/mounted.ocfs2.8 17 | usr/share/man/man7/o2cb.7 18 | usr/share/man/man8/o2cb_ctl.8 19 | usr/share/man/man8/ocfs2_hb_ctl.8 20 | usr/share/man/man8/tunefs.ocfs2.8 21 | usr/share/man/man1/o2info.1 22 | -------------------------------------------------------------------------------- /debian/ocfs2-tools.manpages: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/share/man/man8/debugfs.ocfs2.8 2 | debian/tmp/usr/share/man/man8/fsck.ocfs2.8 3 | debian/tmp/usr/share/man/man8/fsck.ocfs2.checks.8 4 | debian/tmp/usr/share/man/man8/mkfs.ocfs2.8 5 | debian/tmp/usr/share/man/man8/tunefs.ocfs2.8 6 | debian/tmp/usr/share/man/man8/mounted.ocfs2.8 7 | debian/tmp/usr/share/man/man8/o2cb_ctl.8 8 | debian/tmp/usr/share/man/man8/ocfs2_hb_ctl.8 9 | debian/tmp/usr/share/man/man8/o2image.8 10 | debian/tmp/usr/share/man/man7/o2cb.7 11 | debian/tmp/usr/share/man/man1/o2info.1 12 | debian/tmp/usr/share/man/man8/o2hbmonitor.8 13 | debian/tmp/usr/share/man/man5/ocfs2.cluster.conf.5 14 | debian/tmp/usr/share/man/man5/o2cb.sysconfig.5 15 | debian/tmp/usr/share/man/man7/ocfs2.7 16 | -------------------------------------------------------------------------------- /debian/ocfs2-tools.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | ## Source debconf library. 6 | . /usr/share/debconf/confmodule 7 | 8 | if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then 9 | db_get ocfs2-tools/init 10 | O2CB_ENABLED="$RET" 11 | db_get ocfs2-tools/clustername 12 | O2CB_BOOTCLUSTER="$RET" 13 | db_get ocfs2-tools/heartbeat_threshold 14 | O2CB_HEARTBEAT_THRESHOLD="$RET" 15 | db_get ocfs2-tools/idle_timeout 16 | O2CB_IDLE_TIMEOUT_MS="$RET" 17 | db_get ocfs2-tools/keepalive_delay 18 | O2CB_KEEPALIVE_DELAY_MS="$RET" 19 | db_get ocfs2-tools/reconnect_delay 20 | O2CB_RECONNECT_DELAY_MS="$RET" 21 | 22 | cat > /etc/default/o2cb <> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -name '*.c' -print >>cscope.files 7 | find . -name '*.h' -print >>cscope.files 8 | find ../libocfs2/ -name '*.h' -print >>cscope.files 9 | find ../libocfs2/ -name '*.c' -print >>cscope.files 10 | cscope -b 11 | -------------------------------------------------------------------------------- /debugfs.ocfs2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | sbindir = $(root_sbindir) 6 | SBIN_PROGRAMS = debugfs.ocfs2 7 | 8 | DEFINES = -DG_DISABLE_DEPRECATED -DLINUX -DDEBUG 9 | DEFINES += -DVERSION=\"$(VERSION)\" 10 | 11 | INCLUDES = -I$(TOPDIR)/include -Iinclude 12 | INCLUDES += $(GLIB_CFLAGS) 13 | 14 | CFILES = main.c commands.c dump.c utils.c journal.c find_block_inode.c \ 15 | find_inode_paths.c dump_fs_locks.c dump_dlm_locks.c stat_sysdir.c \ 16 | dump_net_stats.c 17 | 18 | HFILES = \ 19 | include/main.h \ 20 | include/commands.h \ 21 | include/dump.h \ 22 | include/utils.h \ 23 | include/journal.h \ 24 | include/find_block_inode.h \ 25 | include/find_inode_paths.h \ 26 | include/ocfs2_internals.h \ 27 | include/dump_fs_locks.h \ 28 | include/dump_dlm_locks.h \ 29 | include/stat_sysdir.h \ 30 | include/dump_net_stats.h 31 | 32 | OBJS = $(subst .c,.o,$(CFILES)) 33 | 34 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 35 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 36 | ifneq ($(BUILD_FSDLM_SUPPORT),) 37 | LIBO2CB_LIBS += -ldlm_lt 38 | endif 39 | ifneq ($(BUILD_CMAP_SUPPORT),) 40 | LIBO2CB_LIBS += -lcmap 41 | endif 42 | 43 | MANS = debugfs.ocfs2.8 44 | 45 | DIST_FILES = $(CFILES) $(HFILES) README debugfs.ocfs2.8.in 46 | 47 | DIST_RULES = dist-subdircreate 48 | 49 | dist-subdircreate: 50 | $(TOPDIR)/mkinstalldirs $(DIST_DIR)/include 51 | 52 | debugfs.ocfs2: $(OBJS) 53 | $(LINK) $(GLIB_LIBS) $(LIBOCFS2_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(READLINE_LIBS) $(NCURSES_LIBS) $(AIO_LIBS) 54 | 55 | include $(TOPDIR)/Postamble.make 56 | -------------------------------------------------------------------------------- /debugfs.ocfs2/README: -------------------------------------------------------------------------------- 1 | debugfs.ocfs2 is a debugging tool for ocfs2 useful for printing on-disk 2 | structures in a readable style. It performs the same task as debugocfs 3 | does for ocfs1 with one big difference, viz., user interface. debugfs.ocfs2 4 | uses the debugfs (ext2) style. 5 | 6 | Currently, apart from being read-only, it does not provide any directory 7 | traversal functionality. What that means is that the user is expected to 8 | provide the inode block number to access any metadata on volume. 9 | 10 | "open " opens the device. "stats" shows the super block information. 11 | "ls " lists the directory at the block number. "nodes" prints the 12 | list of nodes configured on the device. "cat " prints the contents 13 | of the file at that block number. "dump " copies the contents 14 | of the file into outfile. "logdump " prints the contents of the journal 15 | file. 16 | 17 | One can either use the interactive mode, i.e., issue commands at a prompt, or 18 | the echo mode. (echo "stats" | debugfs.ocfs2 /dev/sdb1). The echo mode allows 19 | users to redirect the output to a file (very useful when reading the journal 20 | file). 21 | 22 | The current list of commands are as follows: 23 | 24 | curdev Show current device 25 | open Open a device 26 | close Close a device 27 | show_super_stats, stats [-h] Show superblock 28 | show_inode_info, stat Show inode 29 | pwd Print working directory 30 | ls List directory 31 | cat [outfile] Prints or concatenates file to stdout/outfile 32 | dump Dumps file to outfile 33 | nodes List of nodes 34 | publish Publish blocks 35 | vote Vote blocks 36 | logdump Prints journal file 37 | help, ? This information 38 | quit, q Exit the program 39 | =============================================================================== 40 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * commands.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2004 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | * Authors: Sunil Mushran 24 | */ 25 | 26 | #ifndef __COMMANDS_H__ 27 | #define __COMMANDS_H__ 28 | 29 | void do_command (char *cmd); 30 | void handle_signal (int sig); 31 | 32 | #endif /* __COMMANDS_H__ */ 33 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/dump_fs_locks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dump_fs_locks.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2005, 2008 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef _DUMP_FS_LOCKS_H_ 26 | #define _DUMP_FS_LOCKS_H_ 27 | 28 | void dump_fs_locks(char *uuid_str, FILE *out, char *path, int dump_lvbs, 29 | int only_busy, struct list_head *locklist); 30 | 31 | #endif /* _DUMP_FS_LOCKS_H_ */ 32 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/dump_net_stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dump_net_stats.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2011 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef _DUMP_NET_STATS_H_ 26 | #define _DUMP_NET_STATS_H_ 27 | 28 | struct net_stats { 29 | int ns_valid; 30 | unsigned long ns_send_count; 31 | long long ns_aqry_time; 32 | long long ns_send_time; 33 | long long ns_wait_time; 34 | unsigned long ns_recv_count; 35 | long long ns_proc_time; 36 | }; 37 | 38 | void dump_net_stats(FILE *out, char *path, int interval, int count); 39 | 40 | #endif /* _DUMP_NET_STATS_H_ */ 41 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/find_block_inode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * find_block_inode.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef _FIND_BLOCK_INODE_H_ 26 | #define _FIND_BLOCK_INODE_H_ 27 | 28 | errcode_t find_block_inode(ocfs2_filesys *fs, uint64_t *blkno, int count, 29 | FILE *out); 30 | 31 | #endif /* _FIND_BLOCK_INODE_ */ 32 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/find_inode_paths.h: -------------------------------------------------------------------------------- 1 | /* 2 | * find_inode_path.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2005 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef _FIND_INODE_PATH_H_ 26 | #define _FIND_INODE_PATH_H_ 27 | 28 | errcode_t find_inode_paths(ocfs2_filesys *fs, char **args, int findall, 29 | uint32_t count, uint64_t *blkno, FILE *out); 30 | 31 | #endif /* _FIND_INODE_PATH_H_ */ 32 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/journal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * journal.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2004 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | * Authors: Sunil Mushran, Mark Fasheh 24 | */ 25 | 26 | #ifndef _JOURNAL_H_ 27 | #define _JOURNAL_H_ 28 | 29 | errcode_t read_journal(ocfs2_filesys *fs, uint64_t blkno, FILE *out); 30 | 31 | #endif /* _JOURNAL_H_ */ 32 | -------------------------------------------------------------------------------- /debugfs.ocfs2/include/stat_sysdir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * stat_sysdir.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2011 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef _STAT_SYSDIR_H_ 26 | #define _STAT_SYSDIR_H_ 27 | 28 | void show_stat_sysdir(ocfs2_filesys *fs, FILE *out); 29 | 30 | #endif /* _STAT_SYSDIR_H_ */ 31 | -------------------------------------------------------------------------------- /defragfs.ocfs2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | sbindir = $(root_sbindir) 6 | SBIN_PROGRAMS = defragfs.ocfs2 7 | 8 | DEFINES += -DVERSION=\"$(VERSION)\" 9 | 10 | 11 | INCLUDES = -I$(TOPDIR)/include -I./include 12 | DEFINES = -DVERSION=\"$(VERSION)\" 13 | 14 | CFILES = main.c record.c libdefrag.c 15 | HFILES = \ 16 | include/libdefrag.h \ 17 | include/o2defrag.h \ 18 | include/record.h 19 | 20 | OBJS = $(subst .c,.o,$(CFILES)) 21 | 22 | 23 | DIST_FILES = $(CFILES) $(HFILES) defragfs.ocfs2.8.in 24 | 25 | DIST_RULES = dist-subdircreate 26 | MANS = defragfs.ocfs2.8 27 | 28 | defragfs.ocfs2: $(OBJS) 29 | $(LINK) 30 | 31 | dist-subdircreate: 32 | $(TOPDIR)/mkinstalldirs $(DIST_DIR)/include 33 | 34 | include $(TOPDIR)/Postamble.make 35 | -------------------------------------------------------------------------------- /defragfs.ocfs2/include/libdefrag.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIB_DEFERAG_H__ 2 | #define __LIB_DEFERAG_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #define PRINT_ERR(msg) \ 13 | fprintf(stderr, "[ERROR]\t%s\n", (msg)) 14 | 15 | #define PRINT_FILE_MSG(file, msg) \ 16 | fprintf(stdout, "\"%s\":%s\n", (file), msg) 17 | 18 | #define PRINT_FILE_ERRNO(file) \ 19 | fprintf(stderr, "[ERROR]\"%s\":%s\n", (file), strerror(errno)) 20 | 21 | #define PRINT_FILE_MSG_ERRNO(file, msg) \ 22 | fprintf(stderr, "[ERROR]%s:\"%s\" - %s\n", msg, file, strerror(errno)) 23 | 24 | #define PRINT_FILE_ERR(file, msg) \ 25 | fprintf(stderr, "[ERROR]\"%s\":%s\n", (file), msg) 26 | 27 | void *do_malloc(size_t size); 28 | 29 | int do_read(int fd, void *bytes, size_t count); 30 | 31 | int do_write(int fd, const void *bytes, size_t count); 32 | 33 | unsigned int do_csum(const unsigned char *buff, int len); 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /defragfs.ocfs2/include/o2defrag.h: -------------------------------------------------------------------------------- 1 | #ifndef __O2DEFRAG_H__ 2 | #define __O2DEFRAG_H__ 3 | 4 | #define FS_OCFS2 "ocfs2" 5 | 6 | #define DETAIL 0x01 7 | #define STATISTIC 0x02 8 | #define GO_ON 0x04 9 | #define LOW_IO 0x08 10 | 11 | #define DEVNAME 0 12 | #define DIRNAME 1 13 | #define FILENAME 2 14 | 15 | #define FTW_OPEN_FD 2000 16 | 17 | #define ROOT_UID 0 18 | 19 | #define SHOW_FRAG_FILES 5 20 | #define SCHEDULE_TIME_LIMIT 5 21 | 22 | #define RECORD_EVERY_N_FILES 50 23 | 24 | #ifndef OCFS2_IOC_MOVE_EXT 25 | #define OCFS2_IOC_MOVE_EXT _IOW('o', 6, struct ocfs2_move_extents) 26 | #endif 27 | 28 | struct o2defrag_opt { 29 | int o_num; 30 | char *o_str; 31 | }; 32 | 33 | #define declare_opt(n, s) {\ 34 | .o_num = n,\ 35 | .o_str = s\ 36 | } 37 | 38 | #define PROGRAME_NAME "defragfs.ocfs2" 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /defragfs.ocfs2/include/record.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECORD_H__ 2 | #define __RECORD_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define RECORD_FILE_NAME ".ocfs2.defrag.record" //under /tmp dir 15 | 16 | #define offset_of(type, member) (unsigned long)(&((type *)0)->member) 17 | 18 | #define calc_record_file_size(argc) (RECORD_HEADER_LEN + argc * PATH_MAX) 19 | 20 | 21 | /* 22 | * Because the main way to use this tool is like 23 | * defrag -a -b -c path1 path2 path3 24 | * This struct is used to record every path 25 | */ 26 | struct argv_node { 27 | char *a_path; 28 | struct list_head a_list; 29 | }; 30 | 31 | struct resume_record { 32 | int r_mode_flag; /* mode flag, the binary of the combination of options */ 33 | ino_t r_inode_no; /* start from the file as a inode number */ 34 | int r_argc; /* how many argv_node in the r_argvs list */ 35 | struct list_head r_argvs; /* the list of argv_node */ 36 | }; 37 | 38 | #define RECORD_HEADER_LEN offset_of(struct resume_record, r_argvs) 39 | 40 | extern void dump_record(char *base_name, 41 | struct resume_record *rr, 42 | void (*dump_mode_flag)(int mode_flag)); 43 | 44 | extern void set_record_file_path(char *path); 45 | extern void free_record(struct resume_record *rr); 46 | extern void fill_resume_record(struct resume_record *rr, 47 | int mode_flag, char **argv, int argc, ino_t inode_no); 48 | extern void free_argv_node(struct argv_node *n); 49 | extern int store_record(struct resume_record *rr); 50 | extern int load_record(struct resume_record *rr); 51 | extern void mv_record(struct resume_record *dst, struct resume_record *src); 52 | extern int remove_record(void); 53 | #endif 54 | -------------------------------------------------------------------------------- /documentation/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /documentation/01-cluster_start_stop.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/01-cluster_start_stop.odt -------------------------------------------------------------------------------- /documentation/02-mount_umount.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/02-mount_umount.odt -------------------------------------------------------------------------------- /documentation/03-disk_format.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/03-disk_format.odt -------------------------------------------------------------------------------- /documentation/migrate_from_ocfs.sxw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/migrate_from_ocfs.sxw -------------------------------------------------------------------------------- /documentation/ocfs2_dlm_design_draft.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/ocfs2_dlm_design_draft.odt -------------------------------------------------------------------------------- /documentation/samples/cluster.conf: -------------------------------------------------------------------------------- 1 | cluster: 2 | heartbeat_mode = global 3 | node_count = 3 4 | name = webcluster 5 | 6 | node: 7 | number = 7 8 | cluster = webcluster 9 | ip_port = 7777 10 | ip_address = 192.168.0.107 11 | name = node7 12 | 13 | node: 14 | number = 6 15 | cluster = webcluster 16 | ip_port = 7777 17 | ip_address = 192.168.0.106 18 | name = node6 19 | 20 | node: 21 | number = 10 22 | cluster = webcluster 23 | ip_port = 7777 24 | ip_address = 192.168.0.110 25 | name = node10 26 | 27 | heartbeat: 28 | cluster = webcluster 29 | region = 77D95EF51C0149D2823674FCC162CF8B 30 | 31 | heartbeat: 32 | cluster = webcluster 33 | region = DCDA2845177F4D59A0F2DCD8DE507CC3 34 | 35 | heartbeat: 36 | cluster = webcluster 37 | region = BBA1DBD0F73F449384CE75197D9B7098 38 | -------------------------------------------------------------------------------- /documentation/users_guide.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/users_guide.odt -------------------------------------------------------------------------------- /documentation/users_guide.sxw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/documentation/users_guide.sxw -------------------------------------------------------------------------------- /extras/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | find_hardlinks 3 | find_dup_extents 4 | find_inode_paths 5 | set_random_bits 6 | decode_lockres 7 | mark_journal_dirty 8 | encode_lockres 9 | find_allocation_fragments 10 | compute_groups 11 | check_metaecc 12 | *.d 13 | resize_slotmap 14 | -------------------------------------------------------------------------------- /extras/watch-hb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | die() { 4 | echo $@", exiting" > /dev/stderr 5 | exit 1 6 | } 7 | 8 | usage() { 9 | echo "-r region the hb region to watch" 10 | echo "-d device the hb device to watch" 11 | } 12 | 13 | while getopts ":r:d:" opt; do 14 | case $opt in 15 | r) 16 | region="$OPTARG" 17 | dev=$(cat $region/dev) || die "couldn't read $region/dev" 18 | [ -z "$dev" ] && \ 19 | die "$region/dev isn't set, is the region active?" 20 | 21 | eval "$device=/dev/$dev" 22 | 23 | eval "slot_bytes=$(cat $region/$attr)" || die "couldn't read $region/$attr" 24 | ;; 25 | d) 26 | dev="$OPTARG" 27 | eval "device=$dev" 28 | eval "slot_bytes=512" 29 | ;; 30 | \?) usage 31 | esac 32 | done 33 | 34 | [ -z "$device" ] && \ 35 | die "a region must be specified with -r or a device with -d" 36 | 37 | watch -n 3 -d \ 38 | "echo \"cat //heartbeat\" | debugfs.ocfs2 -n $device 2>/dev/null \ 39 | | od -A d -x | \ 40 | awk '( NF > 2 ) { \$(1) = \$1 / $slot_bytes; if (\$1 == int(\$1)) print \$0 }'" 41 | -------------------------------------------------------------------------------- /fsck.ocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | cscope* 2 | stamp-md5 3 | *.sw? 4 | *.cmd 5 | fsck.ocfs2 6 | *.8 7 | *.d 8 | prompt-codes.h 9 | -------------------------------------------------------------------------------- /fsck.ocfs2/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I include" >> cscope.files 6 | find . -name '*.[ch]' >>cscope.files 7 | find ../libocfs2/ -name '*.[ch]' >> cscope.files 8 | find ../libo2dlm/ -name '*.[ch]' >> cscope.files 9 | cscope -b 10 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/dirblocks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dirblocks.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_DIRBLOCKS_H__ 25 | #define __O2FSCK_DIRBLOCKS_H__ 26 | 27 | #include "ocfs2/ocfs2.h" 28 | #include "ocfs2/kernel-rbtree.h" 29 | 30 | typedef struct _o2fsck_dirblocks { 31 | struct rb_root db_root; 32 | uint64_t db_numblocks; 33 | } o2fsck_dirblocks; 34 | 35 | typedef struct _o2fsck_dirblock_entry { 36 | struct rb_node e_node; 37 | uint64_t e_ino; 38 | uint64_t e_blkno; 39 | uint64_t e_blkcount; 40 | } o2fsck_dirblock_entry; 41 | 42 | typedef unsigned (*dirblock_iterator)(o2fsck_dirblock_entry *, 43 | void *priv_data); 44 | 45 | errcode_t o2fsck_add_dir_block(o2fsck_dirblocks *db, uint64_t ino, 46 | uint64_t blkno, uint64_t blkcount); 47 | 48 | struct _o2fsck_state; 49 | void o2fsck_dir_block_iterate(struct _o2fsck_state *ost, dirblock_iterator func, 50 | void *priv_data); 51 | 52 | uint64_t o2fsck_search_reidx_dir(struct rb_root *root, uint64_t dino); 53 | errcode_t o2fsck_try_add_reidx_dir(struct rb_root *root, uint64_t dino); 54 | errcode_t o2fsck_rebuild_indexed_dirs(ocfs2_filesys *fs, struct rb_root *root); 55 | errcode_t o2fsck_check_dir_index(struct _o2fsck_state *ost, struct ocfs2_dinode *di); 56 | 57 | #endif /* __O2FSCK_DIRBLOCKS_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/dirparents.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dirparents.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_DIRPARENTS_H__ 25 | #define __O2FSCK_DIRPARENTS_H__ 26 | 27 | #include "ocfs2/kernel-rbtree.h" 28 | 29 | typedef struct _o2fsck_dir_parent { 30 | struct rb_node dp_node; 31 | uint64_t dp_ino; /* The dir inode in question. */ 32 | 33 | uint64_t dp_dot_dot; /* The parent according to the dir's own 34 | * '..' entry */ 35 | 36 | uint64_t dp_dirent; /* The inode that has a dirent which points 37 | * to this directory. */ 38 | 39 | /* used by pass3 to walk the dir_parent structs and ensure 40 | * connectivity */ 41 | uint64_t dp_loop_no; 42 | unsigned dp_connected:1, 43 | dp_in_orphan_dir:1; 44 | } o2fsck_dir_parent; 45 | 46 | errcode_t o2fsck_add_dir_parent(struct rb_root *root, 47 | uint64_t ino, 48 | uint64_t dot_dot, 49 | uint64_t dirent, 50 | unsigned in_orphan_dir); 51 | 52 | o2fsck_dir_parent *o2fsck_dir_parent_lookup(struct rb_root *root, 53 | uint64_t ino); 54 | o2fsck_dir_parent *o2fsck_dir_parent_first(struct rb_root *root); 55 | o2fsck_dir_parent *o2fsck_dir_parent_next(o2fsck_dir_parent *from); 56 | 57 | void ocfsck_remove_dir_parent(struct rb_root *root, uint64_t ino); 58 | #endif /* __O2FSCK_DIRPARENTS_H__ */ 59 | 60 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/icount.h: -------------------------------------------------------------------------------- 1 | /* 2 | * icount.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_ICOUNT_H__ 25 | #define __O2FSCK_ICOUNT_H__ 26 | 27 | #include "ocfs2/ocfs2.h" 28 | #include "ocfs2/kernel-rbtree.h" 29 | 30 | typedef struct _o2fsck_icount { 31 | ocfs2_bitmap *ic_single_bm; 32 | struct rb_root ic_multiple_tree; 33 | } o2fsck_icount; 34 | 35 | errcode_t o2fsck_icount_set(o2fsck_icount *icount, uint64_t blkno, 36 | uint16_t count); 37 | uint16_t o2fsck_icount_get(o2fsck_icount *icount, uint64_t blkno); 38 | errcode_t o2fsck_icount_new(ocfs2_filesys *fs, o2fsck_icount **ret); 39 | void o2fsck_icount_free(o2fsck_icount *icount); 40 | void o2fsck_icount_delta(o2fsck_icount *icount, uint64_t blkno, 41 | int delta); 42 | errcode_t o2fsck_icount_next_blkno(o2fsck_icount *icount, uint64_t start, 43 | uint64_t *found); 44 | 45 | #endif /* __O2FSCK_ICOUNT_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/journal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * journal.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_JOURNAL_H__ 25 | #define __O2FSCK_JOURNAL_H__ 26 | 27 | #include "fsck.h" 28 | 29 | errcode_t o2fsck_replay_journals(ocfs2_filesys *fs, int *replayed); 30 | errcode_t o2fsck_should_replay_journals(ocfs2_filesys *fs, int *should, 31 | int *has_dirty); 32 | errcode_t o2fsck_clear_journal_flags(o2fsck_state *ost); 33 | errcode_t o2fsck_check_journals(o2fsck_state *ost); 34 | 35 | #endif /* __O2FSCK_JOURNAL_H__ */ 36 | 37 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/o2fsck_strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * strings.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_STRINGS_H__ 25 | #define __O2FSCK_STRINGS_H__ 26 | 27 | #include "ocfs2/ocfs2.h" 28 | #include "ocfs2/kernel-rbtree.h" 29 | 30 | typedef struct _o2fsck_strings { 31 | struct rb_root s_root; 32 | size_t s_allocated; 33 | } o2fsck_strings; 34 | 35 | int o2fsck_strings_exists(o2fsck_strings *strings, char *string, 36 | size_t strlen); 37 | errcode_t o2fsck_strings_insert(o2fsck_strings *strings, char *string, 38 | size_t strlen, int *is_dup); 39 | void o2fsck_strings_init(o2fsck_strings *strings); 40 | void o2fsck_strings_free(o2fsck_strings *strings); 41 | size_t o2fsck_strings_bytes_allocated(o2fsck_strings *strings); 42 | 43 | #endif /* __O2FSCK_STRINGS_H__ */ 44 | 45 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass0.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pass0.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_PASS0_H__ 25 | #define __O2FSCK_PASS0_H__ 26 | 27 | #include "fsck.h" 28 | 29 | errcode_t o2fsck_pass0(o2fsck_state *ost); 30 | 31 | #endif /* __O2FSCK_PASS0_H__ */ 32 | 33 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pass1.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_PASS1_H__ 25 | #define __O2FSCK_PASS1_H__ 26 | 27 | #include "fsck.h" 28 | 29 | errcode_t o2fsck_pass1(o2fsck_state *ost); 30 | void o2fsck_free_inode_allocs(o2fsck_state *ost); 31 | 32 | #endif /* __O2FSCK_PASS1_H__ */ 33 | 34 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass1b.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pass1b.h 3 | * 4 | * Copyright (C) 2009 Oracle. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License version 2 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | */ 15 | 16 | #ifndef __O2FSCK_PASS1B_H__ 17 | #define __O2FSCK_PASS1B_H__ 18 | 19 | #include "fsck.h" 20 | 21 | errcode_t ocfs2_pass1_dups(o2fsck_state *ost); 22 | 23 | #endif /* __O2FSCK_PASS1_H__ */ 24 | 25 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pass2.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_PASS2_H__ 25 | #define __O2FSCK_PASS2_H__ 26 | 27 | #include "fsck.h" 28 | 29 | errcode_t o2fsck_pass2(o2fsck_state *ost); 30 | int o2fsck_test_inode_allocated(o2fsck_state *ost, uint64_t blkno); 31 | 32 | #endif /* __O2FSCK_PASS2_H__ */ 33 | 34 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pass3.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_PASS3_H__ 25 | #define __O2FSCK_PASS3_H__ 26 | 27 | #include "fsck.h" 28 | 29 | errcode_t o2fsck_pass3(o2fsck_state *ost); 30 | void o2fsck_reconnect_file(o2fsck_state *ost, uint64_t inode); 31 | 32 | #endif /* __O2FSCK_PASS3_H__ */ 33 | 34 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pass4.h 3 | * 4 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Zach Brown 22 | */ 23 | 24 | #ifndef __O2FSCK_PASS4_H__ 25 | #define __O2FSCK_PASS4_H__ 26 | 27 | #include "fsck.h" 28 | 29 | errcode_t replay_orphan_dir(o2fsck_state *ost, int slot_recovery); 30 | errcode_t o2fsck_pass4(o2fsck_state *ost); 31 | 32 | #endif /* __O2FSCK_PASS4_H__ */ 33 | 34 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/pass5.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * pass5.h 5 | * 6 | * Copyright (C) 2004, 2008 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #ifndef __O2FSCK_PASS5_H__ 19 | #define __O2FSCK_PASS5_H__ 20 | 21 | #include "fsck.h" 22 | 23 | errcode_t o2fsck_pass5(o2fsck_state *ost); 24 | 25 | #endif /* __O2FSCK_PASS4_H__ */ 26 | 27 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/refcount.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * refcount.h 5 | * 6 | * Copyright (C) 2009 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #ifndef __O2FSCK_REFCOUNT_H__ 19 | #define __O2FSCK_REFCOUNT_H__ 20 | 21 | #include "fsck.h" 22 | 23 | errcode_t o2fsck_check_refcount_tree(o2fsck_state *ost, 24 | struct ocfs2_dinode *di); 25 | errcode_t o2fsck_mark_clusters_refcounted(o2fsck_state *ost, 26 | uint64_t rf_blkno, 27 | uint64_t i_blkno, 28 | uint64_t p_cpos, 29 | uint32_t clusters, 30 | uint32_t v_cpos); 31 | errcode_t o2fsck_check_mark_refcounted_clusters(o2fsck_state *ost); 32 | #endif /* __O2FSCK_REFCOUNT_H__ */ 33 | 34 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/slot_recovery.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * slot_recovery.c 5 | * 6 | * Slot recovery handler. 7 | * 8 | * Copyright (C) 2008 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License version 2 as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | */ 19 | 20 | #ifndef __O2FSCK_SLOT_RECOVERY_H__ 21 | #define __O2FSCK_SLOT_RECOVERY_H__ 22 | 23 | #include "fsck.h" 24 | 25 | errcode_t o2fsck_replay_truncate_logs(ocfs2_filesys *fs); 26 | errcode_t o2fsck_replay_local_allocs(ocfs2_filesys *fs); 27 | errcode_t o2fsck_replay_orphan_dirs(o2fsck_state *ost); 28 | 29 | #endif /* __O2FSCK_SLOT_RECOVERY_H__ */ 30 | 31 | -------------------------------------------------------------------------------- /fsck.ocfs2/include/xattr.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * xattr.h 5 | * 6 | * Copyright (C) 2004, 2008 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | #ifndef __O2FSCK_XATTR_H__ 18 | #define __O2FSCK_XATTR_H__ 19 | 20 | #include "fsck.h" 21 | 22 | errcode_t o2fsck_check_xattr(o2fsck_state *ost, 23 | struct ocfs2_dinode *di); 24 | 25 | #endif /* __O2FSCK_XATTR_H__ */ 26 | 27 | -------------------------------------------------------------------------------- /fswreck/.gitignore: -------------------------------------------------------------------------------- 1 | cscope.* 2 | fswreck 3 | *.d 4 | *.sw? 5 | -------------------------------------------------------------------------------- /fswreck/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -maxdepth 2 -name '*.c' -print >>cscope.files 7 | find . -maxdepth 2 -name '*.h' -print >>cscope.files 8 | find ../libocfs2/ -maxdepth 2 -name '*.h' -print >>cscope.files 9 | find ../libocfs2/ -maxdepth 2 -name '*.c' -print >>cscope.files 10 | cscope -b 11 | -------------------------------------------------------------------------------- /fswreck/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DEFINES = -DG_DISABLE_DEPRECATED -DLINUX 6 | DEFINES += -DVERSION=\"$(VERSION)\" 7 | 8 | INCLUDES = -I$(TOPDIR)/include -Iinclude 9 | INCLUDES += $(GLIB_CFLAGS) 10 | 11 | UNINST_PROGRAMS = fswreck 12 | 13 | CFILES = main.c corrupt.c chain.c extent.c group.c inode.c local_alloc.c truncate_log.c special.c symlink.c dir.c journal.c quota.c refcount.c discontig_bg.c 14 | 15 | HFILES = \ 16 | include/chain.h \ 17 | include/dir.h \ 18 | include/fsck_type.h \ 19 | include/inode.h \ 20 | include/local_alloc.h \ 21 | include/special.h \ 22 | include/truncate_log.h \ 23 | include/corrupt.h \ 24 | include/extent.h \ 25 | include/group.h \ 26 | include/journal.h \ 27 | include/main.h \ 28 | include/symlink.h \ 29 | include/quota.h \ 30 | include/refcount.h \ 31 | include/discontig_bg.h 32 | 33 | DIST_FILES = $(CFILES) $(HFILES) 34 | DIST_RULES = dist-subdircreate 35 | 36 | OBJS = $(subst .c,.o,$(CFILES)) 37 | 38 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 39 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 40 | 41 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 42 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 43 | 44 | ifneq ($(BUILD_FSDLM_SUPPORT),) 45 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt 46 | else 47 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 48 | endif 49 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 50 | 51 | dist-subdircreate: 52 | $(TOPDIR)/mkinstalldirs $(DIST_DIR)/include 53 | 54 | fswreck: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) 55 | $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(GLIB_LIBS) $(COM_ERR_LIBS) $(AIO_LIBS) 56 | 57 | include $(TOPDIR)/Postamble.make 58 | -------------------------------------------------------------------------------- /fswreck/include/chain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * chain.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __CHAIN_H__ 26 | #define __CHAIN_H__ 27 | 28 | void mess_up_chains_list(ocfs2_filesys *fs, enum fsck_type type, 29 | uint16_t slotnum); 30 | void mess_up_chains_rec(ocfs2_filesys *fs, enum fsck_type type, 31 | uint16_t slotnum); 32 | void mess_up_chains_inode(ocfs2_filesys *fs, enum fsck_type type, 33 | uint16_t slotnum); 34 | void mess_up_chains_group(ocfs2_filesys *fs, enum fsck_type type, 35 | uint16_t slotnum); 36 | void mess_up_chains_group_magic(ocfs2_filesys *fs, enum fsck_type type, 37 | uint16_t slotnum); 38 | void mess_up_chains_cpg(ocfs2_filesys *fs, enum fsck_type type, 39 | uint16_t slotnum); 40 | void mess_up_superblock_clusters_excess(ocfs2_filesys *fs, enum fsck_type type, 41 | uint16_t slotnum); 42 | void mess_up_superblock_clusters_lack(ocfs2_filesys *fs, enum fsck_type type, 43 | uint16_t slotnum); 44 | 45 | #endif /* __CHAIN_H__ */ 46 | -------------------------------------------------------------------------------- /fswreck/include/corrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * corrupt.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __CORRUPT_H 26 | #define __CORRUPT_H 27 | 28 | void corrupt_file(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum); 29 | void corrupt_sys_file(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum); 30 | void corrupt_group_desc(ocfs2_filesys *fs, enum fsck_type type, 31 | uint16_t slotnum); 32 | void corrupt_inode(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum); 33 | void corrupt_local_alloc(ocfs2_filesys *fs, enum fsck_type type, 34 | uint16_t slotnum); 35 | void corrupt_truncate_log(ocfs2_filesys *fs, enum fsck_type type, 36 | uint16_t slotnum); 37 | void corrupt_refcount(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum); 38 | void corrupt_discontig_bg(ocfs2_filesys *fs, enum fsck_type type, 39 | uint16_t slotnum); 40 | void create_named_directory(ocfs2_filesys *fs, char *name, uint64_t *blkno); 41 | 42 | #endif /* __CORRUPT_H */ 43 | -------------------------------------------------------------------------------- /fswreck/include/dir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dir.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __DIR_H 26 | #define __DIR_H 27 | 28 | void mess_up_dir_inode(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno); 29 | void mess_up_dir_dot(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno); 30 | void mess_up_dir_dotdot(ocfs2_filesys *fs, enum fsck_type type, 31 | uint64_t blkno); 32 | void mess_up_dir_ent(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno); 33 | void mess_up_dir_parent_dup(ocfs2_filesys *fs, enum fsck_type type, 34 | uint64_t blkno); 35 | void mess_up_dir_not_connected(ocfs2_filesys *fs, enum fsck_type type, 36 | uint64_t blkno); 37 | 38 | void create_directory(ocfs2_filesys *fs, uint64_t parentblk, uint64_t *blkno); 39 | 40 | #endif /* __DIR_H */ 41 | -------------------------------------------------------------------------------- /fswreck/include/discontig_bg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * discontig_bg.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2010 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #ifndef _FSWRECK_DISCONTIG_BG_H_ 19 | #define _FSWRECK_DISCONTIG_BG_H_ 20 | 21 | void mess_up_discontig_bg(ocfs2_filesys *fs, enum fsck_type type, 22 | uint16_t slotnum); 23 | #endif /* _FSWRECK_DISCONTIG_BG_H_ */ 24 | -------------------------------------------------------------------------------- /fswreck/include/extent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * extent.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __EXTENT_H 26 | #define __EXTENT_H 27 | 28 | void mess_up_extent_list(ocfs2_filesys *fs, enum fsck_type type, 29 | uint64_t blkno); 30 | void mess_up_extent_block(ocfs2_filesys *fs, enum fsck_type type, 31 | uint64_t blkno); 32 | void mess_up_extent_record(ocfs2_filesys *fs, enum fsck_type type, 33 | uint64_t blkno); 34 | 35 | void create_file(ocfs2_filesys *fs, uint64_t blkno, uint64_t *retblkno); 36 | 37 | #endif /* __EXTENT_H */ 38 | -------------------------------------------------------------------------------- /fswreck/include/group.h: -------------------------------------------------------------------------------- 1 | /* 2 | * group.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __GROUP_H 26 | #define __GROUP_H 27 | 28 | void mess_up_group_minor(ocfs2_filesys *fs, enum fsck_type type, 29 | uint16_t slotnum); 30 | void mess_up_group_gen(ocfs2_filesys *fs, enum fsck_type type, 31 | uint16_t slotnum); 32 | void mess_up_group_list(ocfs2_filesys *fs, enum fsck_type type, 33 | uint16_t slotnum); 34 | void mess_up_cluster_group_desc(ocfs2_filesys *fs, enum fsck_type type, 35 | uint16_t slotnum); 36 | void mess_up_cluster_alloc_bits(ocfs2_filesys *fs, enum fsck_type type, 37 | uint16_t slotnum); 38 | 39 | #endif /* __GROUP_H */ 40 | -------------------------------------------------------------------------------- /fswreck/include/inode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * inode.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __INODE_H 26 | #define __INODE_H 27 | 28 | void mess_up_inode_field(ocfs2_filesys *fs, enum fsck_type type, 29 | uint64_t blkno); 30 | void mess_up_inode_not_connected(ocfs2_filesys *fs, enum fsck_type type, 31 | uint64_t blkno); 32 | void mess_up_inode_orphaned(ocfs2_filesys *fs, enum fsck_type type, 33 | uint16_t slotnum); 34 | void mess_up_inode_alloc(ocfs2_filesys *fs, enum fsck_type type, 35 | uint16_t slotnum); 36 | void mess_up_inline_flag(ocfs2_filesys *fs, enum fsck_type type, 37 | uint64_t blkno); 38 | void mess_up_inline_inode(ocfs2_filesys *fs, enum fsck_type type, 39 | uint64_t blkno); 40 | void mess_up_dup_clusters(ocfs2_filesys *fs, enum fsck_type type, 41 | uint64_t blkno); 42 | 43 | #endif /* __INODE_H */ 44 | -------------------------------------------------------------------------------- /fswreck/include/journal.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * journal.h 5 | * 6 | * Copyright (C) 2004, 2008 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #ifndef __JOURNAL_H 19 | #define __JOURNAL_H 20 | 21 | void mess_up_journal(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum); 22 | 23 | #endif /* __JOURNAL_H */ 24 | -------------------------------------------------------------------------------- /fswreck/include/local_alloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * local_alloc.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __LOCAL_ALLOC_H 26 | #define __LOCAL_ALLOC_H 27 | 28 | void mess_up_local_alloc_empty(ocfs2_filesys *fs, enum fsck_type type, 29 | uint16_t slotnum); 30 | void mess_up_local_alloc_bitmap(ocfs2_filesys *fs, enum fsck_type type, 31 | uint16_t slotnum); 32 | void mess_up_local_alloc_used(ocfs2_filesys *fs, enum fsck_type type, 33 | uint16_t slotnum); 34 | 35 | #endif /* __LOCAL_ALLOC_H */ 36 | -------------------------------------------------------------------------------- /fswreck/include/quota.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * quota.h 5 | * 6 | * Copyright (C) 2004, 2008 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #ifndef __QUOTA_H 19 | #define __QUOTA_H 20 | 21 | void mess_up_quota(ocfs2_filesys *fs, enum fsck_type type, uint16_t slotnum); 22 | 23 | #endif /* __QUOTA_H */ 24 | -------------------------------------------------------------------------------- /fswreck/include/refcount.h: -------------------------------------------------------------------------------- 1 | /* 2 | * refcount.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2009 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #ifndef _FSWRECK_REFCOUNT_H_ 19 | #define _FSWRECK_REFCOUNT_H_ 20 | 21 | void mess_up_refcount_tree_block(ocfs2_filesys *fs, enum fsck_type type, 22 | uint64_t blkno); 23 | void mess_up_refcount_tree(ocfs2_filesys *fs, enum fsck_type type, 24 | uint64_t blkno); 25 | #endif /* _FSWRECK_REFCOUNT_H_ */ 26 | -------------------------------------------------------------------------------- /fswreck/include/special.h: -------------------------------------------------------------------------------- 1 | /* 2 | * special.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __SPECIAL_H 26 | #define __SPECIAL_H 27 | 28 | void mess_up_root(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno); 29 | 30 | #endif /* __SPECIAL_H */ 31 | -------------------------------------------------------------------------------- /fswreck/include/symlink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * symlink.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __SYMLINK_H 26 | #define __SYMLINK_H 27 | 28 | void mess_up_symlink(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno); 29 | 30 | #endif /* __SYMLINK_H */ 31 | -------------------------------------------------------------------------------- /fswreck/include/truncate_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * truncate_log.h 3 | * 4 | * Function prototypes, macros, etc. for related 'C' files 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #ifndef __TRUNCATE_LOG_H 26 | #define __TRUNCATE_LOG_H 27 | 28 | void mess_up_truncate_log_list(ocfs2_filesys *fs, enum fsck_type type, 29 | uint16_t slotnum); 30 | void mess_up_truncate_log_rec(ocfs2_filesys *fs, enum fsck_type type, 31 | uint16_t slotnum); 32 | 33 | #endif /* __TRUNCATE_LOG_H */ 34 | -------------------------------------------------------------------------------- /fswreck/special.c: -------------------------------------------------------------------------------- 1 | /* 2 | * special.c 3 | * 4 | * root, lost+found corruptions 5 | * 6 | * Copyright (C) 2006 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #include "main.h" 26 | 27 | extern char *progname; 28 | 29 | /* This file will corrupt inode root. 30 | * And as a sequence, lost+found will also disappear. 31 | * 32 | * Special files error: ROOT_NOTDIR, ROOT_DIR_MISSING, LOSTFOUND_MISSING 33 | * 34 | */ 35 | void mess_up_root(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno) 36 | { 37 | errcode_t ret; 38 | char *inobuf = NULL; 39 | struct ocfs2_dinode *di; 40 | struct ocfs2_super_block *sb = OCFS2_RAW_SB(fs->fs_super); 41 | blkno = sb->s_root_blkno; 42 | 43 | ret = ocfs2_malloc_block(fs->fs_io, &inobuf); 44 | if (ret) 45 | FSWRK_COM_FATAL(progname, ret); 46 | 47 | ret = ocfs2_read_inode(fs, blkno, inobuf); 48 | if (ret) 49 | FSWRK_COM_FATAL(progname, ret); 50 | 51 | di = (struct ocfs2_dinode *)inobuf; 52 | 53 | if (!(di->i_flags & OCFS2_VALID_FL)) 54 | FSWRK_FATAL("not a file"); 55 | 56 | di->i_mode = 0; 57 | 58 | ret = ocfs2_write_inode(fs, blkno, inobuf); 59 | if (ret) 60 | FSWRK_COM_FATAL(progname, ret); 61 | 62 | if (inobuf) 63 | ocfs2_free(&inobuf); 64 | 65 | fprintf(stdout, "ROOT_NOTDIR: " 66 | "Corrupt root inode#%"PRIu64"\n", blkno); 67 | return; 68 | } 69 | -------------------------------------------------------------------------------- /include/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | SUBDIRS = tools-internal ocfs2-kernel o2dlm o2cb ocfs2 6 | 7 | include $(TOPDIR)/Postamble.make 8 | -------------------------------------------------------------------------------- /include/o2cb/.gitignore: -------------------------------------------------------------------------------- 1 | o2cb_err.h 2 | -------------------------------------------------------------------------------- /include/o2cb/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | HFILES_GEN = o2cb_err.h 6 | 7 | all: $(HFILES_GEN) 8 | 9 | HFILES = o2cb.h ocfs2_nodemanager.h ocfs2_heartbeat.h o2cb_client_proto.h 10 | 11 | HEADERS_SUBDIR = o2cb 12 | HEADERS = $(HFILES) $(HFILES_GEN) 13 | 14 | o2cb_err.h: $(TOPDIR)/libo2cb/o2cb_err.h 15 | cp $< $@ 16 | 17 | $(TOPDIR)/libo2cb/o2cb_err.h: 18 | make -C $(TOPDIR)/libo2cb o2cb_err.h 19 | 20 | DIST_FILES = $(HFILES) 21 | 22 | CLEAN_RULES = clean-err 23 | 24 | clean-err: 25 | rm -f o2cb_err.h 26 | 27 | include $(TOPDIR)/Postamble.make 28 | -------------------------------------------------------------------------------- /include/o2cb/ocfs2_heartbeat.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * ocfs2_heartbeat.h 5 | * 6 | * On-disk structures for ocfs2_heartbeat 7 | * 8 | * Copyright (C) 2002, 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2 of the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public 21 | * License along with this program; if not, write to the 22 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 23 | * Boston, MA 02110-1301 USA. 24 | */ 25 | 26 | #ifndef _OCFS2_HEARTBEAT_H 27 | #define _OCFS2_HEARTBEAT_H 28 | 29 | struct o2hb_disk_heartbeat_block { 30 | __le64 hb_seq; 31 | __u8 hb_node; 32 | __u8 hb_pad1[3]; 33 | __le32 hb_cksum; 34 | __le64 hb_generation; 35 | __le32 hb_dead_ms; 36 | }; 37 | 38 | #endif /* _OCFS2_HEARTBEAT_H */ 39 | -------------------------------------------------------------------------------- /include/o2cb/ocfs2_nodemanager.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * ocfs2_nodemanager.h 5 | * 6 | * Header describing the interface between userspace and the kernel 7 | * for the ocfs2_nodemanager module. 8 | * 9 | * Copyright (C) 2002, 2004 Oracle. All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public 22 | * License along with this program; if not, write to the 23 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 24 | * Boston, MA 02110-1301 USA. 25 | * 26 | */ 27 | 28 | #ifndef _OCFS2_NODEMANAGER_H 29 | #define _OCFS2_NODEMANAGER_H 30 | 31 | #define O2NM_API_VERSION 5 32 | 33 | #define O2NM_MAX_NODES 255 34 | #define O2NM_INVALID_NODE_NUM 255 35 | 36 | /* host name, group name, cluster name all 64 bytes */ 37 | #define O2NM_MAX_NAME_LEN 64 // __NEW_UTS_LEN 38 | 39 | /* 40 | * Maximum number of global heartbeat regions allowed. 41 | * **CAUTION** Changing this number will break dlm compatibility. 42 | */ 43 | #define O2NM_MAX_REGIONS 32 44 | 45 | #endif /* _OCFS2_NODEMANAGER_H */ 46 | -------------------------------------------------------------------------------- /include/o2dlm/.gitignore: -------------------------------------------------------------------------------- 1 | o2dlm_err.h 2 | -------------------------------------------------------------------------------- /include/o2dlm/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | HFILES_GEN = o2dlm_err.h 6 | 7 | all: $(HFILES_GEN) 8 | 9 | HFILES = o2dlm.h 10 | 11 | HEADERS_SUBDIR = o2dlm 12 | HEADERS = $(HFILES) $(HFILES_GEN) 13 | 14 | o2dlm_err.h: $(TOPDIR)/libo2dlm/o2dlm_err.h 15 | cp $< $@ 16 | 17 | $(TOPDIR)/libo2dlm/o2dlm_err.h: 18 | make -C $(TOPDIR)/libo2dlm o2dlm_err.h 19 | 20 | DIST_FILES = $(HFILES) 21 | 22 | CLEAN_RULES = clean-err 23 | 24 | clean-err: 25 | rm -f o2dlm_err.h 26 | 27 | include $(TOPDIR)/Postamble.make 28 | -------------------------------------------------------------------------------- /include/ocfs2-kernel/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | HEADERS_SUBDIR = ocfs2-kernel 6 | HEADERS = \ 7 | fiemap.h \ 8 | kernel-list.h \ 9 | ocfs1_fs_compat.h \ 10 | ocfs2_fs.h \ 11 | ocfs2_ioctl.h \ 12 | ocfs2_lockid.h \ 13 | quota_tree.h \ 14 | sparse_endian_types.h 15 | 16 | DIST_FILES = $(HEADERS) 17 | 18 | include $(TOPDIR)/Postamble.make 19 | -------------------------------------------------------------------------------- /include/ocfs2-kernel/quota_tree.h: -------------------------------------------------------------------------------- 1 | #ifndef _QUOTA_TREE_H 2 | #define _QUOTA_TREE_H 3 | 4 | #define QT_TREEOFF 1 5 | 6 | /* Header of leaf tree block */ 7 | struct qt_disk_dqdbheader { 8 | __le32 dqdh_next_free; /* Number of next block with free entry */ 9 | __le32 dqdh_prev_free; /* Number of previous block with free entry */ 10 | __le16 dqdh_entries; /* Number of valid entries in block */ 11 | __le16 dqdh_pad1; 12 | __le32 dqdh_pad2; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /include/ocfs2-kernel/sparse_endian_types.h: -------------------------------------------------------------------------------- 1 | #ifndef O2CB_SPARSE_ENDIAN_TYPES_H 2 | #define O2CB_SPARSE_ENDIAN_TYPES_H 3 | 4 | #include 5 | 6 | typedef __u16 __le16; 7 | typedef __u16 __be16; 8 | typedef __u32 __le32; 9 | typedef __u32 __be32; 10 | typedef __u64 __le64; 11 | typedef __u64 __be64; 12 | 13 | #endif /* O2CB_SPARSE_ENDIAN_TYPES_H */ 14 | -------------------------------------------------------------------------------- /include/ocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | cscope* 2 | stamp-md5 3 | *.sw? 4 | *.cmd 5 | ocfs2_err.h 6 | -------------------------------------------------------------------------------- /include/ocfs2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | HFILES_GEN = ocfs2_err.h 6 | 7 | all: $(HFILES_GEN) 8 | 9 | HFILES = ocfs2.h jbd2.h bitops.h byteorder.h kernel-rbtree.h image.h 10 | 11 | HEADERS_SUBDIR = ocfs2 12 | HEADERS = $(HFILES) $(HFILES_GEN) 13 | 14 | ocfs2_err.h: $(TOPDIR)/libocfs2/ocfs2_err.h 15 | cp $< $@ 16 | 17 | $(TOPDIR)/libocfs2/ocfs2_err.h: 18 | make -C $(TOPDIR)/libocfs2 ocfs2_err.h 19 | 20 | DIST_FILES = $(HFILES) 21 | 22 | CLEAN_RULES = clean-err 23 | 24 | clean-err: 25 | rm -f ocfs2_err.h 26 | 27 | include $(TOPDIR)/Postamble.make 28 | -------------------------------------------------------------------------------- /include/ocfs2/bitops.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * bitops.h 5 | * 6 | * Bitmap frobbing routines for the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | * Authors: Joel Becker 25 | * 26 | * This code is a port of e2fsprogs/lib/ext2fs/bitops.h 27 | * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. 28 | */ 29 | 30 | #ifndef _BITOPS_H 31 | #define _BITOPS_H 32 | 33 | extern int ocfs2_set_bit(int nr,void * addr); 34 | extern int ocfs2_clear_bit(int nr, void * addr); 35 | extern int ocfs2_test_bit(int nr, const void * addr); 36 | 37 | extern int ocfs2_find_first_bit_set(void *addr, int size); 38 | extern int ocfs2_find_first_bit_clear(void *addr, int size); 39 | extern int ocfs2_find_next_bit_set(void *addr, int size, int offset); 40 | extern int ocfs2_find_next_bit_clear(void *addr, int size, int offset); 41 | extern int ocfs2_get_bits_set(void *addr, int size, int offset); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/tools-internal/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | HFILES = verbose.h progress.h utils.h scandisk.h 6 | 7 | DIST_FILES = $(HFILES) 8 | 9 | include $(TOPDIR)/Postamble.make 10 | -------------------------------------------------------------------------------- /include/tools-internal/utils.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * utils.h 5 | * 6 | * Utility functions 7 | * 8 | * Copyright (C) 2010 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2 of the License. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | */ 20 | 21 | #ifndef _INTERNAL_UTILS_H 22 | #define _INTERNAL_UTILS_H 23 | 24 | /* 25 | * Removes trailing whitespace from a string. It does not allocate or reallocate 26 | * any memory. It modifies the string in place. 27 | */ 28 | char *tools_strchomp(char *str); 29 | 30 | /* 31 | * Removes leading whitespace from a string, by moving the rest of the 32 | * characters forward. It does not allocate or reallocate any memory. 33 | * It modifies the string in place. 34 | */ 35 | char *tools_strchug(char *str); 36 | 37 | /* 38 | * Removes both the leading and trailing whitespaces 39 | */ 40 | #define tools_strstrip(str) tools_strchug(tools_strchomp(str)) 41 | 42 | #endif /* _INTERNAL_UTILS_H */ 43 | -------------------------------------------------------------------------------- /libo2cb/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | debug_* 4 | o2cb_err.c 5 | o2cb_err.h 6 | cscope* 7 | libo2cb.a 8 | o2cb.7 9 | -------------------------------------------------------------------------------- /libo2cb/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -maxdepth 2 -name '*.c' -print >>cscope.files 7 | find . -maxdepth 2 -name '*.h' -print >>cscope.files 8 | find ../libocfs2/ -maxdepth 2 -name '*.c' -print >>cscope.files 9 | find ../libocfs2/ -maxdepth 2 -name '*.h' -print >>cscope.files 10 | find ../libo2dlm/ -maxdepth 2 -name '*.c' -print >>cscope.files 11 | find ../libo2dlm/ -maxdepth 2 -name '*.h' -print >>cscope.files 12 | cscope -b 13 | -------------------------------------------------------------------------------- /libo2cb/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | WARNINGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \ 6 | -Wmissing-declarations 7 | 8 | INCLUDES = -I$(TOPDIR)/include -I. 9 | 10 | LIBRARIES = libo2cb.a 11 | 12 | CFLAGS += -fPIC 13 | 14 | ifneq ($(BUILD_CMAP_SUPPORT),) 15 | DEFINES += -DHAVE_CMAP 16 | endif 17 | 18 | ifneq ($(BUILD_FSDLM_SUPPORT),) 19 | DEFINES += -DHAVE_FSDLM 20 | endif 21 | 22 | ifneq ($(OCFS2_DEBUG_EXE),) 23 | DEBUG_EXE_FILES = $(shell awk '/DEBUG_EXE/{if (k[FILENAME] == 0) {print FILENAME; k[FILENAME] = 1;}}' $(CFILES)) 24 | DEBUG_EXE_PROGRAMS = $(addprefix debug_,$(subst .c,,$(DEBUG_EXE_FILES))) 25 | 26 | .SECONDARY: 27 | 28 | UNINST_PROGRAMS += $(DEBUG_EXE_PROGRAMS) 29 | 30 | debug_%.o : %.c 31 | $(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) \ 32 | $(INCLUDES) $(DEFINES) \ 33 | -DDEBUG_EXE -o $@ -c $< 34 | 35 | debug_%: debug_%.o libo2cb.a 36 | $(LINK) $(COM_ERR_LIBS) 37 | 38 | endif 39 | 40 | CFILES = \ 41 | o2cb_abi.c \ 42 | o2cb_crc32.c \ 43 | client_proto.c 44 | 45 | HFILES = \ 46 | o2cb_abi.h \ 47 | o2cb_crc32.h 48 | 49 | HFILES_GEN = o2cb_err.h 50 | 51 | OBJS = $(subst .c,.o,$(CFILES)) \ 52 | o2cb_err.o 53 | 54 | ifneq ($(BUILD_CMAN_SUPPORT),) 55 | DEFINES += -DHAVE_CMAN 56 | endif 57 | 58 | $(OBJS): $(HFILES_GEN) 59 | 60 | o2cb_err.c o2cb_err.h: o2cb_err.et 61 | compile_et o2cb_err.et 62 | 63 | libo2cb.a: $(OBJS) 64 | rm -f $@ 65 | $(AR) r $@ $^ 66 | $(RANLIB) $@ 67 | 68 | MANS = o2cb.7 69 | 70 | DIST_FILES = $(CFILES) $(HFILES) o2cb_err.et o2cb.7.in 71 | 72 | CLEAN_RULES = clean-err 73 | 74 | clean-err: 75 | rm -f o2cb_err.c o2cb_err.h 76 | 77 | include $(TOPDIR)/Postamble.make 78 | -------------------------------------------------------------------------------- /libo2cb/TODO: -------------------------------------------------------------------------------- 1 | * change the name and/or path of /etc/cluster.conf to something friendlier 2 | maybe /etc/sysconfig/cluster/xxxx or similar 3 | * change the cluster.conf format to jlbec's stanza style 4 | * harden the tools for setuid-ness 5 | * fix mount.ocfs2 to handle other normal mount options appropriately (at least 6 | handle rw, which is passed magically by /sbin/mount) 7 | 8 | -------------------------------------------------------------------------------- /libo2cb/o2cb_abi.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * o2cb_abi.c 5 | * 6 | * Layout of configfs paths for O2CB cluster configuration. 7 | * 8 | * Copyright (C) 2005 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | */ 24 | 25 | #ifndef _O2CB_ABI_H 26 | #define _O2CB_ABI_H 27 | 28 | /* 29 | * The latest place is /sys/kernel/config, but older O2CB put it 30 | * at /config. So, libo2cb has to handle detection 31 | */ 32 | #define CONFIGFS_FORMAT_PATH "%s/config" 33 | 34 | #define O2CB_FORMAT_CLUSTER_DIR CONFIGFS_FORMAT_PATH "/cluster" 35 | #define O2CB_FORMAT_CLUSTER O2CB_FORMAT_CLUSTER_DIR "/%s" 36 | #define O2CB_FORMAT_NODE_DIR O2CB_FORMAT_CLUSTER "/node" 37 | #define O2CB_FORMAT_NODE O2CB_FORMAT_NODE_DIR "/%s" 38 | #define O2CB_FORMAT_NODE_ATTR O2CB_FORMAT_NODE "/%s" 39 | #define O2CB_FORMAT_HEARTBEAT_DIR O2CB_FORMAT_CLUSTER "/heartbeat" 40 | #define O2CB_FORMAT_HEARTBEAT_REGION O2CB_FORMAT_HEARTBEAT_DIR "/%s" 41 | #define O2CB_FORMAT_HEARTBEAT_REGION_ATTR O2CB_FORMAT_HEARTBEAT_REGION "/%s" 42 | #define O2CB_FORMAT_HEARTBEAT_MODE O2CB_FORMAT_HEARTBEAT_DIR "/mode" 43 | 44 | /* 45 | * Cluster info flags (ocfs2_cluster_info.ci_stackflags) 46 | */ 47 | #define OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT (0x01) 48 | 49 | #endif /* _O2CB_ABI_H */ 50 | -------------------------------------------------------------------------------- /libo2cb/o2cb_crc32.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * o2cb_crc32.h 5 | * 6 | * libo2cb interface to crc32 functionality. 7 | * 8 | * Copyright (C) 2005 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | */ 25 | 26 | #ifndef _O2CB_CRC32_H 27 | #define _O2CB_CRC32_H 28 | 29 | unsigned long o2cb_crc32(const char *s); 30 | 31 | #endif /* _O2CB_CRC32_H */ 32 | -------------------------------------------------------------------------------- /libo2dlm/.gitignore: -------------------------------------------------------------------------------- 1 | cscope.* 2 | libo2dlm.a 3 | o2dlm_err.* 4 | *.d 5 | o2dlm_test 6 | libdlm.h 7 | debug_* 8 | -------------------------------------------------------------------------------- /libo2dlm/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -name '*.c' -print >>cscope.files 7 | find . -name '*.h' -print >>cscope.files 8 | find ../libocfs2/ -name '*.h' -print >>cscope.files 9 | find ../libocfs2/ -name '*.c' -print >>cscope.files 10 | cscope -b 11 | -------------------------------------------------------------------------------- /libo2dlm/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | INCLUDES = -I. -I$(TOPDIR)/include 6 | 7 | LIBRARIES = libo2dlm.a 8 | 9 | CFLAGS += -fPIC 10 | 11 | ifneq ($(BUILD_FSDLM_SUPPORT),) 12 | DEFINES += -DHAVE_FSDLM 13 | endif 14 | 15 | ifneq ($(OCFS2_DEBUG_EXE),) 16 | DEBUG_EXE_FILES = $(shell awk '/DEBUG_EXE/{if (k[FILENAME] == 0) {print FILENAME; k[FILENAME] = 1;}}' $(CFILES)) 17 | DEBUG_EXE_PROGRAMS = $(addprefix debug_,$(subst .c,,$(DEBUG_EXE_FILES))) 18 | 19 | .SECONDARY: 20 | 21 | UNINST_PROGRAMS += $(DEBUG_EXE_PROGRAMS) 22 | 23 | debug_%.o : %.c 24 | $(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) \ 25 | $(INCLUDES) $(DEFINES) \ 26 | -DDEBUG_EXE -o $@ -c $< 27 | 28 | debug_%: debug_%.o libo2dlm.a 29 | $(LINK) $(COM_ERR_LIBS) 30 | 31 | endif 32 | 33 | CFILES = o2dlm.c capabilities.c 34 | HFILES = libdlm-compat.h 35 | 36 | TESTING_CFILES = o2dlm_test.c 37 | 38 | HFILES_GEN = o2dlm_err.h 39 | 40 | ifeq ($(LIBDLM_FOUND),) 41 | HFILES_GEN += libdlm.h 42 | CLEAN_RULES += clean-libdlm 43 | 44 | libdlm.h: libdlm-compat.h 45 | ln -s $< $@ 46 | 47 | clean-libdlm: 48 | rm -f libdlm.h 49 | 50 | endif 51 | 52 | OBJS = $(subst .c,.o,$(CFILES)) \ 53 | o2dlm_err.o 54 | 55 | $(OBJS): $(HFILES) $(HFILES_GEN) 56 | 57 | TESTING_OBJS = $(subst .c,.o,$(TESTING_CFILES)) 58 | 59 | o2dlm_err.c o2dlm_err.h: o2dlm_err.et 60 | compile_et o2dlm_err.et 61 | 62 | libo2dlm.a: $(OBJS) 63 | rm -f $@ 64 | $(AR) r $@ $^ 65 | $(RANLIB) $@ 66 | 67 | o2dlm_test: $(TESTING_OBJS) $(LIBRARIES) $(COM_ERR_LIBS) 68 | $(LINK) $(DL_LIBS) 69 | 70 | DIST_FILES = $(CFILES) $(HFILES) o2dlm_err.et $(TESTING_CFILES) 71 | 72 | CLEAN_RULES += clean-err clean-test 73 | 74 | clean-err: 75 | rm -f o2dlm_err.c o2dlm_err.h 76 | 77 | clean-test: 78 | rm -f o2dlm_test 79 | 80 | include $(TOPDIR)/Postamble.make 81 | -------------------------------------------------------------------------------- /libocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | cscope* 2 | stamp-md5 3 | *.sw? 4 | *.cmd 5 | ocfs2_err.c 6 | ocfs2_err.h 7 | libocfs2.a 8 | debug_* 9 | *.d 10 | ocfs2.7 11 | -------------------------------------------------------------------------------- /libocfs2/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I include" >> cscope.files 6 | find . -maxdepth 2 -name '*.c' -print >>cscope.files 7 | find . -maxdepth 2 -name '*.h' -print >>cscope.files 8 | find ../libo2dlm -name '*.c' >>cscope.files 9 | find ../libo2dlm -name '*.h' >>cscope.files 10 | find ../libo2cb -name '*.c' >>cscope.files 11 | find ../libo2cb -name '*.h' >>cscope.files 12 | cscope -b 13 | -------------------------------------------------------------------------------- /libocfs2/closefs.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * closefs.c 5 | * 6 | * Close an OCFS2 filesystem. Part of the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | * Ideas taken from e2fsprogs/lib/ext2fs/closefs.c 25 | * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. 26 | */ 27 | 28 | #define _XOPEN_SOURCE 600 /* Triggers XOPEN2K in features.h */ 29 | #define _LARGEFILE64_SOURCE 30 | 31 | #include "ocfs2/ocfs2.h" 32 | 33 | 34 | errcode_t ocfs2_flush(ocfs2_filesys *fs) 35 | { 36 | int type; 37 | errcode_t ret; 38 | 39 | for (type = 0; type < MAXQUOTAS; type++) 40 | if (fs->qinfo[type].flags & OCFS2_QF_INFO_DIRTY) { 41 | ret = ocfs2_write_global_quota_info(fs, type); 42 | if (ret) 43 | return ret; 44 | ret = ocfs2_write_cached_inode(fs, 45 | fs->qinfo[type].qi_inode); 46 | if (ret) 47 | return ret; 48 | } 49 | 50 | return 0; 51 | } 52 | 53 | errcode_t ocfs2_close(ocfs2_filesys *fs) 54 | { 55 | errcode_t ret; 56 | 57 | if (fs->fs_flags & OCFS2_FLAG_DIRTY) { 58 | ret = ocfs2_flush(fs); 59 | if (ret) 60 | return ret; 61 | } 62 | 63 | ocfs2_freefs(fs); 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /libocfs2/dir_iterate.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * dir_iterate.h 5 | * 6 | * Structures for dir iteration for the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | * Authors: Joel Becker 25 | */ 26 | 27 | #ifndef _DIR_ITERATE_H 28 | #define _DIR_ITERATE_H 29 | 30 | struct dir_context { 31 | uint64_t dir; 32 | int flags; 33 | struct ocfs2_dinode *di; 34 | char *buf; 35 | int (*func)(uint64_t dir, 36 | int entry, 37 | struct ocfs2_dir_entry *dirent, 38 | uint64_t blocknr, 39 | int offset, 40 | int blocksize, 41 | char *buf, 42 | void *priv_data); 43 | void *priv_data; 44 | errcode_t errcode; 45 | }; 46 | 47 | extern int ocfs2_process_dir_block(ocfs2_filesys *fs, 48 | uint64_t blocknr, 49 | uint64_t blockcnt, 50 | uint16_t ext_flags, 51 | void *priv_data); 52 | 53 | #define OCFS2_DIR_PAD 4 54 | #define OCFS2_DIR_ROUND (OCFS2_DIR_PAD - 1) 55 | #define OCFS2_DIR_MEMBER_LEN offsetof(struct ocfs2_dir_entry, name) 56 | #define OCFS2_DIR_REC_LEN(name_len) (((name_len) + OCFS2_DIR_MEMBER_LEN + \ 57 | OCFS2_DIR_ROUND) & \ 58 | ~OCFS2_DIR_ROUND) 59 | 60 | #endif /* _DIR_ITERATE_H */ 61 | -------------------------------------------------------------------------------- /libocfs2/dir_util.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * dir_util.h 5 | * 6 | * Structures for dir iteration for the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | * Authors: Joel Becker 25 | */ 26 | 27 | #ifndef _DIR_UTIL_H 28 | #define _DIR_UTIL_H 29 | 30 | static inline int is_dots(const char *name, unsigned int len) 31 | { 32 | if (len == 0) 33 | return 0; 34 | 35 | if (name[0] == '.') { 36 | if (len == 1) 37 | return 1; 38 | if (len == 2 && name[1] == '.') 39 | return 1; 40 | } 41 | 42 | return 0; 43 | } 44 | 45 | #endif /* _DIR_UTIL_H */ 46 | -------------------------------------------------------------------------------- /libocfs2/extent_map.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * extent_map.h 5 | * 6 | * Internal extent map structures for the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | * Authors: Joel Becker 25 | */ 26 | 27 | #ifndef _EXTENT_MAP_H 28 | #define _EXTENT_MAP_H 29 | 30 | #include "ocfs2/kernel-rbtree.h" 31 | 32 | typedef struct _ocfs2_extent_map_entry ocfs2_extent_map_entry; 33 | 34 | struct _ocfs2_extent_map { 35 | struct rb_root em_extents; 36 | uint32_t em_clusters; 37 | }; 38 | 39 | struct _ocfs2_extent_map_entry { 40 | struct rb_node e_node; 41 | int e_tree_depth; 42 | struct ocfs2_extent_rec e_rec; 43 | }; 44 | 45 | #endif /* _EXTENT_MAP_H */ 46 | -------------------------------------------------------------------------------- /libocfs2/freefs.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * freefs.c 5 | * 6 | * Free an OCFS2 filesystem. Part of the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | * 24 | * Ideas taken from e2fsprogs/lib/ext2fs/freefs.c 25 | * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. 26 | */ 27 | 28 | #define _XOPEN_SOURCE 600 /* Triggers XOPEN2K in features.h */ 29 | #define _LARGEFILE64_SOURCE 30 | 31 | #include 32 | 33 | #include "ocfs2/ocfs2.h" 34 | 35 | 36 | void ocfs2_freefs(ocfs2_filesys *fs) 37 | { 38 | if (!fs) 39 | abort(); 40 | 41 | if (fs->fs_orig_super) 42 | ocfs2_free(&fs->fs_orig_super); 43 | if (fs->fs_super) 44 | ocfs2_free(&fs->fs_super); 45 | if (fs->fs_devname) 46 | ocfs2_free(&fs->fs_devname); 47 | if (fs->fs_io) 48 | io_close(fs->fs_io); 49 | 50 | ocfs2_free(&fs); 51 | } 52 | -------------------------------------------------------------------------------- /libocfs2/getsectsize.c: -------------------------------------------------------------------------------- 1 | /* 2 | * getsectsize.c --- get the sector size of a device. 3 | * 4 | * Copyright (C) 1995, 1995 Theodore Ts'o. 5 | * Copyright (C) 2003 VMware, Inc. 6 | * 7 | * %Begin-Header% 8 | * This file may be redistributed under the terms of the GNU Public 9 | * License. 10 | * %End-Header% 11 | */ 12 | 13 | /* Modified for OCFS2 by Manish Singh */ 14 | 15 | #define HAVE_UNISTD_H 1 16 | #define HAVE_ERRNO_H 1 17 | #define HAVE_LINUX_FD_H 1 18 | #define HAVE_OPEN64 1 19 | 20 | #define _LARGEFILE_SOURCE 21 | #define _LARGEFILE64_SOURCE 22 | 23 | #include 24 | #if HAVE_UNISTD_H 25 | #include 26 | #endif 27 | #if HAVE_ERRNO_H 28 | #include 29 | #endif 30 | #include 31 | #ifdef HAVE_LINUX_FD_H 32 | #include 33 | #include 34 | #endif 35 | 36 | #if defined(__linux__) && defined(_IO) && !defined(BLKSSZGET) 37 | #define BLKSSZGET _IO(0x12,104)/* get block device sector size */ 38 | #endif 39 | 40 | #include "ocfs2/ocfs2.h" 41 | 42 | /* 43 | * Returns the number of blocks in a partition 44 | */ 45 | errcode_t ocfs2_get_device_sectsize(const char *file, int *sectsize) 46 | { 47 | int fd; 48 | int ret; 49 | 50 | #ifdef HAVE_OPEN64 51 | fd = open64(file, O_RDONLY); 52 | #else 53 | fd = open(file, O_RDONLY); 54 | #endif 55 | if (fd < 0) { 56 | if (errno == ENOENT) 57 | return OCFS2_ET_NAMED_DEVICE_NOT_FOUND; 58 | else 59 | return OCFS2_ET_IO; 60 | } 61 | 62 | ret = OCFS2_ET_CANNOT_DETERMINE_SECTOR_SIZE; 63 | #ifdef BLKSSZGET 64 | if (ioctl(fd, BLKSSZGET, sectsize) >= 0) 65 | ret = 0; 66 | #endif 67 | close(fd); 68 | return ret; 69 | } 70 | 71 | #ifdef DEBUG_EXE 72 | int main(int argc, char **argv) 73 | { 74 | int sectsize; 75 | int retval; 76 | 77 | if (argc < 2) { 78 | fprintf(stderr, "Usage: %s device\n", argv[0]); 79 | exit(1); 80 | } 81 | 82 | retval = ocfs2_get_device_sectsize(argv[1], §size); 83 | if (retval) { 84 | com_err(argv[0], retval, 85 | "while calling ocfs2_get_device_sectsize"); 86 | exit(1); 87 | } 88 | printf("Device %s has a hardware sector size of %d.\n", 89 | argv[1], sectsize); 90 | exit(0); 91 | } 92 | #endif 93 | -------------------------------------------------------------------------------- /libocfs2/refcount.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * refcount.h 5 | * 6 | * Copyright (C) 2009 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | #ifndef _LIBOCFS2_REFCOUNT_H_ 18 | #define _LIBOCFS2_REFCOUNT_H_ 19 | 20 | typedef errcode_t (ocfs2_post_refcount_func)(ocfs2_filesys *fs, 21 | void *para); 22 | 23 | /* 24 | * Some refcount caller need to do more work after we modify the data b-tree 25 | * during refcount operation(including CoW and add refcount flag), and make the 26 | * transaction complete. So it must give us this structure so that we can do it 27 | * within our transaction. 28 | * 29 | */ 30 | struct ocfs2_post_refcount { 31 | ocfs2_post_refcount_func *func; /* real function. */ 32 | void *para; 33 | }; 34 | #endif /* _LIBOCFS2_REFCOUNT_H_ */ 35 | -------------------------------------------------------------------------------- /libocfs2/sysfile.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * sysfile.c 5 | * 6 | * System inode operations for the OCFS2 userspace library. 7 | * 8 | * Copyright (C) 2004 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this program; if not, write to the 21 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | * Boston, MA 02110-1301 USA. 23 | */ 24 | 25 | #define _XOPEN_SOURCE 600 /* Triggers XOPEN2K in features.h */ 26 | #define _LARGEFILE64_SOURCE 27 | 28 | #include 29 | 30 | #include "ocfs2/ocfs2.h" 31 | 32 | errcode_t ocfs2_lookup_system_inode(ocfs2_filesys *fs, int type, 33 | int slot_num, uint64_t *blkno) 34 | { 35 | errcode_t ret; 36 | char *buf; 37 | 38 | ret = ocfs2_malloc0(sizeof(char) * (OCFS2_MAX_FILENAME_LEN + 1), &buf); 39 | if (ret) 40 | return ret; 41 | 42 | ocfs2_sprintf_system_inode_name(buf, OCFS2_MAX_FILENAME_LEN, 43 | type, slot_num); 44 | 45 | ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, buf, 46 | strlen(buf), NULL, blkno); 47 | 48 | ocfs2_free(&buf); 49 | 50 | return ret; 51 | } 52 | -------------------------------------------------------------------------------- /libtools-internal/.gitignore: -------------------------------------------------------------------------------- 1 | cscope.* 2 | libtools-internal.a 3 | *.d 4 | debug_* 5 | -------------------------------------------------------------------------------- /libtools-internal/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | INCLUDES = -I. -I$(TOPDIR)/include 6 | 7 | UNINST_LIBRARIES = libtools-internal.a 8 | 9 | CFLAGS += -fPIC 10 | 11 | DEFINES += -DVERSION=\"$(VERSION)\" 12 | 13 | ifneq ($(OCFS2_DEBUG_EXE),) 14 | DEBUG_EXE_FILES = $(shell awk '/DEBUG_EXE/{if (k[FILENAME] == 0) {print FILENAME; k[FILENAME] = 1;}}' $(CFILES)) 15 | DEBUG_EXE_PROGRAMS = $(addprefix debug_,$(subst .c,,$(DEBUG_EXE_FILES))) 16 | 17 | .SECONDARY: 18 | 19 | UNINST_PROGRAMS += $(DEBUG_EXE_PROGRAMS) 20 | 21 | debug_%.o : %.c 22 | $(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) \ 23 | $(INCLUDES) $(DEFINES) \ 24 | -DDEBUG_EXE -o $@ -c $< 25 | 26 | debug_%: debug_%.o 27 | $(LINK) $(COM_ERR_LIBS) 28 | 29 | endif 30 | 31 | CFILES = verbose.c progress.c utils.c scandisk.c 32 | HFILES = libtools-internal.h 33 | 34 | OBJS = $(subst .c,.o,$(CFILES)) 35 | 36 | $(OBJS): $(HFILES) $(HFILES_GEN) 37 | 38 | libtools-internal.a: $(OBJS) 39 | rm -f $@ 40 | $(AR) r $@ $^ 41 | $(RANLIB) $@ 42 | 43 | DIST_FILES = $(CFILES) $(HFILES) 44 | 45 | include $(TOPDIR)/Postamble.make 46 | -------------------------------------------------------------------------------- /libtools-internal/libtools-internal.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * libtools-internal.h 5 | * 6 | * Internal header for libtools-internal. 7 | * 8 | * Copyright (C) 2008 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2 of the License. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | */ 20 | 21 | #ifndef _LIBTOOLS_INTERNAL_H 22 | #define _LIBTOOLS_INTERNAL_H 23 | 24 | int tools_verbosity(void); 25 | int tools_is_interactive(void); 26 | void tools_progress_clear(void); 27 | void tools_progress_restore(void); 28 | 29 | #endif /* _LIBTOOLS_INTERNAL_H */ 30 | -------------------------------------------------------------------------------- /listuuid/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | listuuid 3 | *.d 4 | -------------------------------------------------------------------------------- /listuuid/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | INCLUDES = -I$(TOPDIR)/include 6 | 7 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 8 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 9 | 10 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 11 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 12 | 13 | ifneq ($(BUILD_FSDLM_SUPPORT),) 14 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt 15 | else 16 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 17 | endif 18 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 19 | 20 | UNINST_PROGRAMS = listuuid 21 | 22 | CFILES = listuuid.c 23 | 24 | OBJS = $(subst .c,.o,$(CFILES)) 25 | 26 | DIST_FILES = $(CFILES) 27 | 28 | listuuid: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) 29 | $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(COM_ERR_LIBS) $(UUID_LIBS) $(AIO_LIBS) 30 | 31 | include $(TOPDIR)/Postamble.make 32 | -------------------------------------------------------------------------------- /mkfs.ocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | stamp-md5 3 | mkfs.ocfs2 4 | cscope* 5 | mkfs.ocfs2.8 6 | tunefs.ocfs2 7 | *.d 8 | -------------------------------------------------------------------------------- /mkfs.ocfs2/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | find . -name '*.[ch]' >>cscope.files 6 | find ../libocfs2/ -name '*.[ch]' >>cscope.files 7 | find ../libo2cb/ -name '*.[ch]' >>cscope.files 8 | find ../libo2dlm/ -name '*.[ch]' >>cscope.files 9 | cscope -b 10 | -------------------------------------------------------------------------------- /mkfs.ocfs2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | sbindir = $(root_sbindir) 6 | SBIN_PROGRAMS = mkfs.ocfs2 7 | 8 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 9 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 10 | 11 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 12 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 13 | ifneq ($(BUILD_CMAP_SUPPORT),) 14 | LIBO2CB_LIBS += -lcmap 15 | endif 16 | ifneq ($(BUILD_FSDLM_SUPPORT),) 17 | LIBO2CB_LIBS += -ldlm_lt 18 | endif 19 | 20 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 21 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 22 | 23 | INCLUDES = -I$(TOPDIR)/include -I. 24 | DEFINES = -DVERSION=\"$(VERSION)\" 25 | 26 | CFILES = mkfs.c check.c 27 | HFILES = mkfs.h 28 | 29 | OBJS = $(subst .c,.o,$(CFILES)) 30 | 31 | MANS = mkfs.ocfs2.8 32 | 33 | DIST_FILES = $(CFILES) $(HFILES) mkfs.ocfs2.8.in 34 | 35 | mkfs.ocfs2: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) 36 | $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(UUID_LIBS) $(AIO_LIBS) 37 | 38 | include $(TOPDIR)/Postamble.make 39 | -------------------------------------------------------------------------------- /mount.ocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | mount.ocfs2 3 | mount.ocfs2.8 4 | *.d 5 | cscope.* 6 | -------------------------------------------------------------------------------- /mount.ocfs2/CREDITS: -------------------------------------------------------------------------------- 1 | 2 | The following files have been copied from util-linux-2.12p/mount: 3 | fstab.[ch] 4 | mntent.[ch] 5 | mount_constants.h 6 | paths.h 7 | realpath.[ch] 8 | sundries.[ch] 9 | xmalloc.[ch] 10 | 11 | The following files have code which has been copied from one or more files 12 | in util-linux-2.12p/mount: 13 | opts.[ch] 14 | nls.h 15 | -------------------------------------------------------------------------------- /mount.ocfs2/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -name '*.[ch]' >>cscope.files 7 | find ../libocfs2/ -name '*.[ch]' >>cscope.files 8 | find ../libo2cb/ -name '*.[ch]' >>cscope.files 9 | find ../libo2dlm/ -name '*.[ch]' >>cscope.files 10 | cscope -b 11 | -------------------------------------------------------------------------------- /mount.ocfs2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | sbindir = $(root_sbindir) 6 | SBIN_PROGRAMS = mount.ocfs2 7 | 8 | INCLUDES = -I$(TOPDIR)/include 9 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 10 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 11 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 12 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 13 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 14 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 15 | ifneq ($(BUILD_FSDLM_SUPPORT),) 16 | LIBO2CB_LIBS += -ldlm_lt 17 | endif 18 | ifneq ($(BUILD_CMAP_SUPPORT),) 19 | LIBO2CB_LIBS += -lcmap 20 | endif 21 | 22 | DEFINES = -DVERSION=\"$(VERSION)\" 23 | 24 | CORE_CFILES = fstab.c mntent.c realpath.c sundries.c xmalloc.c opts.c 25 | MOUNT_CFILES = mount.ocfs2.c 26 | 27 | HFILES = $(subst .c,.h,$(MOUNT_CFILES) $(CORE_CFILES)) 28 | HFILES += mount_constants.h nls.h paths.h 29 | 30 | MOUNT_OBJS = $(subst .c,.o,$(MOUNT_CFILES) $(CORE_CFILES)) 31 | MANS = mount.ocfs2.8 32 | 33 | DIST_FILES = $(CORE_CFILES) $(MOUNT_CFILES) \ 34 | $(HFILES) $(addsuffix .in,$(MANS)) 35 | 36 | mount.ocfs2: $(MOUNT_OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) 37 | $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(AIO_LIBS) 38 | 39 | include $(TOPDIR)/Postamble.make 40 | -------------------------------------------------------------------------------- /mount.ocfs2/fstab.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/mount.ocfs2/fstab.c -------------------------------------------------------------------------------- /mount.ocfs2/fstab.h: -------------------------------------------------------------------------------- 1 | #include "mntent.h" 2 | int mtab_is_writable(void); 3 | int mtab_does_not_exist(void); 4 | int mtab_is_a_symlink(void); 5 | int is_mounted_once(const char *name); 6 | 7 | struct mntentchn { 8 | struct mntentchn *nxt, *prev; 9 | struct my_mntent m; 10 | }; 11 | 12 | struct mntentchn *mtab_head (void); 13 | struct mntentchn *getmntfile (const char *name); 14 | struct mntentchn *getmntoptfile (const char *file); 15 | struct mntentchn *getmntdirbackward (const char *dir, struct mntentchn *mc); 16 | struct mntentchn *getmntdevbackward (const char *dev, struct mntentchn *mc); 17 | 18 | #if 0 /* OCFS2 modification */ 19 | struct mntentchn *fstab_head (void); 20 | struct mntentchn *getfsfile (const char *file); 21 | struct mntentchn *getfsspec (const char *spec); 22 | struct mntentchn *getfsspecfile (const char *spec, const char *file); 23 | struct mntentchn *getfsuuidspec (const char *uuid); 24 | struct mntentchn *getfsvolspec (const char *label); 25 | #endif 26 | 27 | void lock_mtab (void); 28 | void unlock_mtab (void); 29 | void update_mtab (const char *special, struct my_mntent *with); 30 | -------------------------------------------------------------------------------- /mount.ocfs2/mntent.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/mount.ocfs2/mntent.c -------------------------------------------------------------------------------- /mount.ocfs2/mntent.h: -------------------------------------------------------------------------------- 1 | #ifndef MY_MNTENT_H 2 | #define MY_MNTENT_H 3 | 4 | struct my_mntent { 5 | const char *mnt_fsname; 6 | const char *mnt_dir; 7 | const char *mnt_type; 8 | const char *mnt_opts; 9 | int mnt_freq; 10 | int mnt_passno; 11 | }; 12 | 13 | #define ERR_MAX 5 14 | 15 | typedef struct mntFILEstruct { 16 | FILE *mntent_fp; 17 | char *mntent_file; 18 | int mntent_lineno; 19 | int mntent_errs; 20 | int mntent_softerrs; 21 | } mntFILE; 22 | 23 | mntFILE *my_setmntent (const char *file, char *mode); 24 | void my_endmntent (mntFILE *mfp); 25 | int my_addmntent (mntFILE *mfp, struct my_mntent *mnt); 26 | struct my_mntent *my_getmntent (mntFILE *mfp); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /mount.ocfs2/mount.ocfs2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mount.ocfs2.h Definitions, etc. 3 | * 4 | * Copyright (C) 2004 Oracle. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | */ 22 | 23 | #define _LARGEFILE64_SOURCE 24 | #define _GNU_SOURCE /* Because libc really doesn't want us using O_DIRECT? */ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #include "fstab.h" 42 | #include "nls.h" 43 | #include "paths.h" 44 | #include "realpath.h" 45 | #include "sundries.h" 46 | #include "xmalloc.h" 47 | #include "mntent.h" 48 | #include "mount_constants.h" 49 | #include "opts.h" 50 | 51 | #include "ocfs2/ocfs2.h" 52 | #include "ocfs2/bitops.h" 53 | 54 | -------------------------------------------------------------------------------- /mount.ocfs2/nls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nls.h 3 | * 4 | * Code extracted from util-linux-2.12p/mount/nls.h 5 | * 6 | * Copyright (C) 2005 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | # undef bindtextdomain 26 | # define bindtextdomain(Domain, Directory) /* empty */ 27 | # undef textdomain 28 | # define textdomain(Domain) /* empty */ 29 | # define _(Text) (Text) 30 | # define N_(Text) (Text) 31 | -------------------------------------------------------------------------------- /mount.ocfs2/opts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * opts.h Definitions, function prototypes, etc. 3 | * 4 | * Copyright (C) 2005 Oracle. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | */ 22 | 23 | /* Custom mount options for our own purposes. */ 24 | /* Maybe these should now be freed for kernel use again */ 25 | #define MS_NOAUTO 0x80000000 26 | #define MS_USERS 0x40000000 27 | #define MS_USER 0x20000000 28 | #define MS_OWNER 0x10000000 29 | #define MS_GROUP 0x08000000 30 | #define MS_PAMCONSOLE 0x04000000 31 | #define MS_NETDEV 0x00040000 32 | #define MS_COMMENT 0x00020000 33 | #define MS_LOOP 0x00010000 34 | 35 | /* Options that we keep the mount system call from seeing. */ 36 | #define MS_NOSYS (MS_NOAUTO|MS_USERS|MS_USER|MS_COMMENT|MS_LOOP|MS_PAMCONSOLE|MS_NETDEV) 37 | 38 | /* Options that we keep from appearing in the options field in the mtab. */ 39 | #define MS_NOMTAB (MS_REMOUNT|MS_NOAUTO|MS_USERS|MS_USER|MS_PAMCONSOLE) 40 | 41 | /* Options that we make ordinary users have by default. */ 42 | #define MS_SECURE (MS_NOEXEC|MS_NOSUID|MS_NODEV) 43 | 44 | /* Options that we make owner-mounted devices have by default */ 45 | #define MS_OWNERSECURE (MS_NOSUID|MS_NODEV) 46 | 47 | void parse_opts (char *options, int *flags, char **extra_opts); 48 | char *fix_opts_string (int flags, const char *extra_opts, const char *user); 49 | -------------------------------------------------------------------------------- /mount.ocfs2/paths.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define _PATH_FSTAB "/etc/fstab" 3 | #ifdef _PATH_MOUNTED 4 | #define MOUNTED_LOCK _PATH_MOUNTED "~" 5 | #define MOUNTED_TEMP _PATH_MOUNTED ".tmp" 6 | #else 7 | #define MOUNTED_LOCK "/etc/mtab~" 8 | #define MOUNTED_TEMP "/etc/mtab.tmp" 9 | #endif 10 | #define LOCK_TIMEOUT 10 11 | -------------------------------------------------------------------------------- /mount.ocfs2/realpath.h: -------------------------------------------------------------------------------- 1 | extern char *myrealpath(const char *path, char *resolved_path, int m); 2 | -------------------------------------------------------------------------------- /mount.ocfs2/sundries.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/mount.ocfs2/sundries.c -------------------------------------------------------------------------------- /mount.ocfs2/sundries.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sundries.h 3 | * Support function prototypes. Functions are in sundries.c. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #if !defined(bool_t) && !defined(__GLIBC__) 13 | #include 14 | #endif 15 | 16 | extern int nocluster_opt; 17 | extern int mount_quiet; 18 | extern int verbose; 19 | extern int sloppy; 20 | 21 | #define streq(s, t) (strcmp ((s), (t)) == 0) 22 | 23 | /* Functions in sundries.c that are used in mount.c and umount.c */ 24 | void block_signals (int how); 25 | char *canonicalize (const char *path); 26 | void error (const char *fmt, ...); 27 | int matching_type (const char *type, const char *types); 28 | int matching_opts (const char *options, const char *test_opts); 29 | void *xmalloc (size_t size); 30 | char *xstrdup (const char *s); 31 | char *xstrndup (const char *s, int n); 32 | char *xstrconcat2 (const char *, const char *); 33 | char *xstrconcat3 (const char *, const char *, const char *); 34 | char *xstrconcat4 (const char *, const char *, const char *, const char *); 35 | 36 | void die (int errcode, const char *fmt, ...); 37 | 38 | #ifdef HAVE_NFS 39 | int nfsmount (const char *spec, const char *node, int *flags, 40 | char **orig_opts, char **opt_args, int *version, int running_bg); 41 | #endif 42 | 43 | /* exit status - bits below are ORed */ 44 | #define EX_USAGE 1 /* incorrect invocation or permission */ 45 | #define EX_SYSERR 2 /* out of memory, cannot fork, ... */ 46 | #define EX_SOFTWARE 4 /* internal mount bug or wrong version */ 47 | #define EX_USER 8 /* user interrupt */ 48 | #define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */ 49 | #define EX_FAIL 32 /* mount failure */ 50 | #define EX_SOMEOK 64 /* some mount succeeded */ 51 | 52 | #define EX_BG 256 /* retry in background (internal only) */ 53 | -------------------------------------------------------------------------------- /mount.ocfs2/xmalloc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include /* strdup() */ 4 | #include "xmalloc.h" 5 | #include "nls.h" /* _() */ 6 | #include "sundries.h" /* EX_SYSERR */ 7 | 8 | void (*at_die)(void) = NULL; 9 | 10 | /* Fatal error. Print message and exit. */ 11 | void 12 | die(int err, const char *fmt, ...) { 13 | va_list args; 14 | 15 | va_start(args, fmt); 16 | vfprintf(stderr, fmt, args); 17 | fprintf(stderr, "\n"); 18 | va_end(args); 19 | 20 | if (at_die) 21 | (*at_die)(); 22 | 23 | exit(err); 24 | } 25 | 26 | static void 27 | die_if_null(void *t) { 28 | if (t == NULL) 29 | die(EX_SYSERR, _("not enough memory")); 30 | } 31 | 32 | void * 33 | xmalloc (size_t size) { 34 | void *t; 35 | 36 | if (size == 0) 37 | return NULL; 38 | 39 | t = malloc(size); 40 | die_if_null(t); 41 | 42 | return t; 43 | } 44 | 45 | void * 46 | xrealloc (void *p, size_t size) { 47 | void *t; 48 | 49 | t = realloc(p, size); 50 | die_if_null(t); 51 | 52 | return t; 53 | } 54 | 55 | char * 56 | xstrdup (const char *s) { 57 | char *t; 58 | 59 | if (s == NULL) 60 | return NULL; 61 | 62 | t = strdup(s); 63 | die_if_null(t); 64 | 65 | return t; 66 | } 67 | -------------------------------------------------------------------------------- /mount.ocfs2/xmalloc.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern void *xmalloc(size_t size); 5 | extern void *xrealloc(void *p, size_t size); 6 | extern char *xstrdup(const char *s); 7 | extern void die(int err, const char *fmt, ...); 8 | extern void (*at_die)(void); 9 | -------------------------------------------------------------------------------- /mounted.ocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | mounted.ocfs2 2 | stamp-md5 3 | *.sw? 4 | cscope.* 5 | *.d 6 | mounted.ocfs2.8 7 | -------------------------------------------------------------------------------- /mounted.ocfs2/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | find . -name '*.[ch]' >>cscope.files 6 | find ../libocfs2/ -name '*.[ch]' >>cscope.files 7 | find ../libo2cb/ -name '*.[ch]' >>cscope.files 8 | find ../libo2dlm/ -name '*.[ch]' >>cscope.files 9 | cscope -b 10 | -------------------------------------------------------------------------------- /mounted.ocfs2/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 6 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 7 | 8 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 9 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 10 | 11 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 12 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 13 | ifneq ($(BUILD_FSDLM_SUPPORT),) 14 | LIBO2CB_LIBS += -ldlm_lt 15 | endif 16 | ifneq ($(BUILD_CMAP_SUPPORT),) 17 | LIBO2CB_LIBS += -lcmap 18 | endif 19 | 20 | LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal 21 | LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a 22 | 23 | sbindir = $(root_sbindir) 24 | SBIN_PROGRAMS = mounted.ocfs2 25 | 26 | INCLUDES = -I$(TOPDIR)/include 27 | 28 | CFILES = mounted.c 29 | OBJS = $(subst .c,.o,$(CFILES)) 30 | 31 | MANS = mounted.ocfs2.8 32 | 33 | DIST_FILES = $(CFILES) mounted.ocfs2.8.in 34 | 35 | mounted.ocfs2: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) ${LIBTOOLS_INTERNAL_DEPS} 36 | $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) ${LIBTOOLS_INTERNAL_DEPS} $(COM_ERR_LIBS) $(UUID_LIBS) $(AIO_LIBS) 37 | 38 | include $(TOPDIR)/Postamble.make 39 | -------------------------------------------------------------------------------- /o2cb.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: o2cb 7 | Description: Library for accessing the ocfs2 cluster base (o2cb) 8 | Version: @VERSION@ 9 | Requires: com_err 10 | Libs: -L${libdir} -lo2cb 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /o2cb_ctl/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | clusterbo 4 | o2cb_ctl 5 | o2cb_ctl.8 6 | cscope.* 7 | o2cb 8 | o2cb.8 9 | ocfs2.cluster.conf.5 10 | -------------------------------------------------------------------------------- /o2cb_ctl/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -maxdepth 2 -name '*.c' -print >>cscope.files 7 | find . -maxdepth 2 -name '*.h' -print >>cscope.files 8 | find ../libocfs2/ -maxdepth 2 -name '*.c' -print >>cscope.files 9 | find ../libocfs2/ -maxdepth 2 -name '*.h' -print >>cscope.files 10 | find ../libo2cb/ -maxdepth 2 -name '*.c' -print >>cscope.files 11 | find ../libo2cb/ -maxdepth 2 -name '*.h' -print >>cscope.files 12 | find ../libo2dlm/ -maxdepth 2 -name '*.c' -print >>cscope.files 13 | find ../libo2dlm/ -maxdepth 2 -name '*.h' -print >>cscope.files 14 | cscope -b 15 | -------------------------------------------------------------------------------- /o2cb_ctl/jiterator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jiterator.h 3 | * 4 | * Prototypes for JIterator 5 | * 6 | * Copyright (C) 2002 Joel Becker 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Library General Public 10 | * License version 2 as published by the Free Software Foundation. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef __JITERATOR_H 23 | #define __JITERATOR_H 24 | 25 | 26 | /* Typedefs */ 27 | typedef struct _JIterator JIterator; 28 | typedef gpointer (*JIteratorFunc) (gpointer context); 29 | 30 | 31 | /* Functions */ 32 | JIterator* j_iterator_new(gpointer context, 33 | JIteratorFunc has_more_func, 34 | JIteratorFunc get_next_func, 35 | GDestroyNotify notify_func); 36 | JIterator* j_iterator_new_from_list(GList *init_list); 37 | gboolean j_iterator_has_more(JIterator *iterator); 38 | gpointer j_iterator_get_next(JIterator *iterator); 39 | void j_iterator_free(JIterator *iterator); 40 | 41 | #endif /* __JITERATOR_H */ 42 | 43 | -------------------------------------------------------------------------------- /o2cb_ctl/o2cb_scandisk.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * o2cb_scandisk.h 5 | * 6 | * Copyright (C) 2010 Oracle. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License, version 2, as published by the Free Software Foundation. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "tools-internal/scandisk.h" 29 | #include "o2cb/o2cb.h" 30 | 31 | #include "ocfs2-kernel/kernel-list.h" 32 | 33 | struct o2cb_device { 34 | struct list_head od_list; 35 | char *od_uuid; 36 | #define O2CB_DEVICE_FOUND 0x01 37 | #define O2CB_DEVICE_HB_STARTED 0x02 38 | int od_flags; 39 | struct o2cb_region_desc od_region; 40 | struct o2cb_cluster_desc od_cluster; 41 | }; 42 | 43 | void o2cb_scandisk(struct list_head *hbdevs); 44 | -------------------------------------------------------------------------------- /o2cb_ctl/o2cbutils.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * o2cbutils.c 5 | * 6 | * utility functions 7 | * 8 | * Copyright (C) 2011 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License, version 2, as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | */ 19 | 20 | #include "o2cbtool.h" 21 | 22 | /* 23 | * Only after the local node is added to the cluster is the cluster 24 | * considered registered 25 | * 26 | * Returns 1 if registered, 0 otherwise. 27 | */ 28 | int is_cluster_registered(char *clustername) 29 | { 30 | char **nodename = NULL; 31 | uint32_t local; 32 | int ret = 0, i = 0; 33 | 34 | if (o2cb_list_nodes(clustername, &nodename)) 35 | goto bail; 36 | 37 | while(nodename && nodename[i] && *(nodename[i])) { 38 | if (o2cb_get_node_local(clustername, nodename[i], &local)) 39 | break; 40 | if (local) { 41 | ret = 1; 42 | break; 43 | } 44 | ++i; 45 | } 46 | 47 | if (nodename) 48 | o2cb_free_nodes_list(nodename); 49 | 50 | bail: 51 | return ret; 52 | } 53 | 54 | /* 55 | * Returns 1 if atleast one heartbeat region is active. 56 | * 0 otherwise. 57 | */ 58 | int is_heartbeat_active(char *clustername) 59 | { 60 | gchar **regions = NULL; 61 | errcode_t err; 62 | int active = 0; 63 | 64 | /* lookup active heartbeats */ 65 | err = o2cb_list_hb_regions(clustername, ®ions); 66 | if (err) 67 | goto bail; 68 | 69 | /* if found, heartbeat is active */ 70 | if (regions[0] && *(regions[0])) 71 | active = 1; 72 | 73 | if (regions) 74 | o2cb_free_hb_regions_list(regions); 75 | 76 | bail: 77 | return active; 78 | } 79 | -------------------------------------------------------------------------------- /o2dlm.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: o2dlm 7 | Description: Library for accessing the ocfs2 DLM 8 | Version: @VERSION@ 9 | Requires: com_err 10 | Libs: -L${libdir} -lo2dlm @DL_LIBS@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /o2image/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | o2image 4 | o2image.8 5 | -------------------------------------------------------------------------------- /o2image/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \ 6 | -Wmissing-declarations 7 | 8 | CFLAGS += $(WARNINGS) 9 | 10 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 11 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 12 | 13 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm 14 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 15 | 16 | ifneq ($(BUILD_FSDLM_SUPPORT),) 17 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt 18 | else 19 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 20 | endif 21 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 22 | 23 | sbindir = $(root_sbindir) 24 | SBIN_PROGRAMS = o2image 25 | 26 | INCLUDES = -I$(TOPDIR)/include -I. 27 | INCLUDES += $(GLIB_CFLAGS) 28 | DEFINES = -DVERSION=\"$(VERSION)\" 29 | 30 | MANS = o2image.8 31 | 32 | CFILES = o2image.c 33 | 34 | OBJS = $(subst .c,.o,$(CFILES)) 35 | 36 | DIST_FILES = $(CFILES) $(HFILES) o2image.8.in 37 | 38 | o2image: $(OBJS) $(LIBOCFS2_DEPS) 39 | $(LINK) $(GLIB_LIBS) $(LIBOCFS2_LIBS) $(COM_ERR_LIBS) $(AIO_LIBS) 40 | 41 | include $(TOPDIR)/Postamble.make 42 | -------------------------------------------------------------------------------- /o2info/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | *.cmd 4 | stamp-md5 5 | cscope* 6 | o2info 7 | o2info.1 8 | -------------------------------------------------------------------------------- /o2info/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \ 6 | -Wmissing-declarations 7 | 8 | CFLAGS += $(WARNINGS) 9 | 10 | LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal 11 | LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a 12 | 13 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 14 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 15 | 16 | BIN_PROGRAMS = o2info 17 | 18 | INCLUDES = -I$(TOPDIR)/include -I. 19 | DEFINES = -DVERSION=\"$(VERSION)\" 20 | 21 | MANS = o2info.1 22 | 23 | HFILES = o2info.h \ 24 | utils.h \ 25 | libo2info.h 26 | 27 | CFILES = \ 28 | o2info.c \ 29 | operations.c \ 30 | utils.c 31 | 32 | LIBO2INFO_CFILES = libo2info.c 33 | 34 | OBJS = $(subst .c,.o,$(CFILES)) 35 | 36 | LIBO2INFO_OBJS = $(subst .c,.o,$(LIBO2INFO_CFILES)) 37 | 38 | DIST_FILES = $(CFILES) $(LIBO2INFO_CFILES) $(HFILES) o2info.1.in 39 | 40 | libo2info.a: $(LIBO2INFO_OBJS) 41 | rm -f $@ 42 | $(AR) r $@ $^ 43 | $(RANLIB) $@ 44 | 45 | o2info: $(OBJS) $(LIBOCFS2_DEPS) libo2info.a 46 | $(LINK) $(LIBOCFS2_LIBS) $(LIBTOOLS_INTERNAL_LIBS) $(COM_ERR_LIBS) $(AIO_LIBS) libo2info.a 47 | 48 | include $(TOPDIR)/Postamble.make 49 | -------------------------------------------------------------------------------- /o2info/o2info.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * o2info.h 5 | * 6 | * o2info operation prototypes. 7 | * 8 | * Copyright (C) 2010 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License version 2 as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | */ 19 | 20 | #ifndef __O2INFO_H__ 21 | #define __O2INFO_H__ 22 | 23 | #include 24 | 25 | #include "ocfs2/ocfs2.h" 26 | #include "ocfs2-kernel/kernel-list.h" 27 | 28 | enum o2info_method_type { 29 | O2INFO_USE_LIBOCFS2 = 1, 30 | O2INFO_USE_IOCTL, 31 | O2INFO_USE_NUMTYPES 32 | }; 33 | 34 | struct o2info_method { 35 | enum o2info_method_type om_method; 36 | char om_path[PATH_MAX]; 37 | union { 38 | ocfs2_filesys *om_fs; /* Use libocfs2 for device */ 39 | int om_fd; /* Use ioctl for file */ 40 | }; 41 | }; 42 | 43 | struct o2info_operation { 44 | char *to_name; 45 | int (*to_run)(struct o2info_operation *op, 46 | struct o2info_method *om, 47 | void *arg); 48 | void *to_private; 49 | }; 50 | 51 | struct o2info_option { 52 | struct option opt_option; /* For getopt_long(). If 53 | there is no short 54 | option, set .val to 55 | CHAR_MAX. A unique 56 | value will be inserted 57 | by the code. */ 58 | struct o2info_operation *opt_op; 59 | 60 | char *opt_help; /* Help string */ 61 | int opt_set; /* Was this option seen */ 62 | int (*opt_handler)(struct o2info_option *opt, char *arg); 63 | void *opt_private; 64 | }; 65 | 66 | struct o2info_op_task { 67 | struct list_head o2p_list; 68 | struct o2info_operation *o2p_task; 69 | }; 70 | 71 | #define __O2INFO_OP(_name, _run, _private) \ 72 | { \ 73 | .to_name = #_name, \ 74 | .to_run = _run, \ 75 | .to_private = _private \ 76 | } 77 | 78 | #define DEFINE_O2INFO_OP(_name, _run, _private) \ 79 | struct o2info_operation _name##_op = \ 80 | __O2INFO_OP(_name, _run, _private) 81 | 82 | #endif /* __O2INFO_H__ */ 83 | -------------------------------------------------------------------------------- /o2info/utils.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 8; -*- 2 | * vim: noexpandtab sw=8 ts=8 sts=0: 3 | * 4 | * utils.h 5 | * 6 | * Common utility function prototypes 7 | * 8 | * Copyright (C) 2010 Oracle. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public 12 | * License version 2 as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | */ 19 | 20 | #ifndef __UTILS_H__ 21 | #define __UTILS_H__ 22 | 23 | #include "o2info.h" 24 | 25 | int o2info_get_compat_flag(uint32_t flag, char **compat); 26 | int o2info_get_incompat_flag(uint32_t flag, char **incompat); 27 | int o2info_get_rocompat_flag(uint32_t flag, char **rocompat); 28 | int o2info_get_filetype(struct stat st, char **filetype); 29 | int o2info_get_human_permission(mode_t st_mode, uint16_t *perm, char **h_perm); 30 | int o2info_uid2name(uid_t uid, char **uname); 31 | int o2info_gid2name(gid_t gid, char **name); 32 | struct timespec o2info_get_stat_atime(struct stat *st); 33 | struct timespec o2info_get_stat_ctime(struct stat *st); 34 | struct timespec o2info_get_stat_mtime(struct stat *st); 35 | int o2info_get_human_time(char **htime, struct timespec t); 36 | int o2info_get_human_path(mode_t st_mode, const char *path, char **h_path); 37 | 38 | int o2info_method(const char *path); 39 | 40 | errcode_t o2info_open(struct o2info_method *om, int flags); 41 | errcode_t o2info_close(struct o2info_method *om); 42 | 43 | #endif /* __UTILS_H__ */ 44 | -------------------------------------------------------------------------------- /o2monitor/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | o2hbmonitor 4 | o2hbmonitor.8 5 | -------------------------------------------------------------------------------- /o2monitor/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | SBIN_EXTRA = o2hbmonitor 6 | 7 | WARNINGS = -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes \ 8 | -Wmissing-declarations 9 | 10 | CFLAGS += $(WARNINGS) 11 | 12 | INCLUDES = -I$(TOPDIR)/include -I. 13 | 14 | DEFINES = -DVERSION=\"$(VERSION)\" 15 | 16 | CFILES = o2hbmonitor.c 17 | 18 | OBJS = $(subst .c,.o,$(CFILES)) 19 | 20 | MANS = o2hbmonitor.8 21 | 22 | DIST_FILES = $(CFILES) $(HFILES) o2hbmonitor.8.in 23 | 24 | o2hbmonitor: $(OBJS) 25 | $(LINK) 26 | 27 | include $(TOPDIR)/Postamble.make 28 | -------------------------------------------------------------------------------- /o2monitor/o2hbmonitor.8.in: -------------------------------------------------------------------------------- 1 | .TH "o2hbmonitor" "8" "January 2012" "Version @VERSION@" "OCFS2 Manual Pages" 2 | .SH "NAME" 3 | o2hbmonitor \- Monitors disk heartbeat in the O2CB cluster stack 4 | .SH "SYNOPSIS" 5 | \fBo2hbmonitor\fR [\fB\-w\fR percent] [\fB\-ivV\fR] 6 | .SH "DESCRIPTION" 7 | .PP 8 | \fBo2hbmonitor\fR is a utility to monitor the disk heartbeat in the \fBo2cb\fR 9 | cluster stack. It tracks the time elapsed since the last heartbeat and logs messages 10 | once it exceeds the warn threshold. 11 | 12 | By default, it runs as a daemon and logs messages to the system logger. It can be 13 | started at any time and stopped using \fBkill(1)\fR. It does not affect the functioning 14 | of the heartbeat thread. It is typically automatically started during cluster online and 15 | stopped during cluster offline by the \fIo2cb\fR init script. 16 | 17 | This utility expects the \fBdebugfs\fR file system to be mounted at \fB/sys/kernel/debug\fR. 18 | 19 | .SH "OPTIONS" 20 | .TP 21 | \fB\-w\fR percent 22 | Warn threshold percent. It is the percentage of the idle threshold. It defaults to 50%. 23 | 24 | .TP 25 | \fB\-i\fR 26 | Interactive mode. It works as a daemon by default. This mode is typically only used 27 | for debugging. 28 | 29 | .TP 30 | \fB\-v\fR 31 | Verbose mode. It logs messages only to the system logger by default. In this mode it also 32 | logs the messages to stdout. 33 | 34 | .TP 35 | \fB\-V\fR 36 | Displays version. 37 | 38 | .SH "NOTES" 39 | This utility works with Linux kernel \fB2.6.37\fR and later. 40 | 41 | .SH "SEE ALSO" 42 | .BR o2cb(7) 43 | 44 | .SH "AUTHORS" 45 | Oracle Corporation 46 | 47 | .SH "COPYRIGHT" 48 | Copyright \(co 2010, 2012 Oracle. All rights reserved. 49 | -------------------------------------------------------------------------------- /ocfs2.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: ocfs2 7 | Description: Userspace ocfs2 library 8 | Version: @VERSION@ 9 | Requires: o2dlm o2cb com_err 10 | Libs: -L${libdir} -locfs2 -laio 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /ocfs2_controld/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | test_client 4 | ocfs2_controld.cman 5 | ocfs2_controld.pcmk 6 | -------------------------------------------------------------------------------- /ocfs2_hb_ctl/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | ocfs2_hb_ctl 3 | ocfs2_hb_ctl.8 4 | *.d 5 | cscope.* 6 | -------------------------------------------------------------------------------- /ocfs2_hb_ctl/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -name '*.[ch]' >>cscope.files 7 | find ../libocfs2/ -name '*.[ch]' >>cscope.files 8 | find ../libo2cb/ -name '*.[ch]' >>cscope.files 9 | find ../libo2dlm/ -name '*.[ch]' >>cscope.files 10 | cscope -b 11 | -------------------------------------------------------------------------------- /ocfs2_hb_ctl/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | sbindir = $(root_sbindir) 6 | SBIN_PROGRAMS = ocfs2_hb_ctl 7 | 8 | INCLUDES = -I$(TOPDIR)/include 9 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 10 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 11 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 12 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 13 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 14 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 15 | ifneq ($(BUILD_FSDLM_SUPPORT),) 16 | LIBO2CB_LIBS += -ldlm_lt 17 | endif 18 | ifneq ($(BUILD_CMAP_SUPPORT),) 19 | LIBO2CB_LIBS += -lcmap 20 | endif 21 | 22 | ifndef OCFS2_DYNAMIC_CTL 23 | LDFLAGS += -static 24 | endif 25 | 26 | DEFINES = -DVERSION=\"$(VERSION)\" 27 | 28 | CFILES = ocfs2_hb_ctl.c 29 | 30 | HFILES = 31 | 32 | OBJS = $(subst .c,.o,$(CFILES)) 33 | 34 | MANS = ocfs2_hb_ctl.8 35 | 36 | DIST_FILES = $(CFILES) $(HFILES) ocfs2_hb_ctl.8.in 37 | 38 | all: ocfs2_hb_ctl 39 | 40 | ocfs2_hb_ctl: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) 41 | $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(AIO_LIBS) 42 | 43 | include $(TOPDIR)/Postamble.make 44 | -------------------------------------------------------------------------------- /ocfs2cdsl/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | ocfs2cdsl 3 | stamp-md5 4 | *.d 5 | ocfs2cdsl.8 6 | -------------------------------------------------------------------------------- /ocfs2cdsl/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 6 | LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 7 | 8 | LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS) 9 | LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a 10 | 11 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb 12 | ifneq ($(BUILD_FSDLM_SUPPORT),) 13 | LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt 14 | else 15 | LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a 16 | endif 17 | 18 | sbindir = $(root_sbindir) 19 | SBIN_PROGRAMS = ocfs2cdsl 20 | 21 | DEFINES = -DVERSION=\"$(VERSION)\" 22 | DEFINES += -DG_DISABLE_DEPRECATED 23 | 24 | INCLUDES = -I$(TOPDIR)/include $(GLIB_CFLAGS) 25 | 26 | CFILES = ocfs2cdsl.c 27 | OBJS = $(subst .c,.o,$(CFILES)) 28 | 29 | DIST_RULES = dist-incdir 30 | 31 | MANS = ocfs2cdsl.8 32 | 33 | DIST_FILES = $(CFILES) ocfs2cdsl.8.in 34 | 35 | ocfs2cdsl: $(OBJS) 36 | $(LINK) $(GLIB_LIBS) $(COM_ERR_LIBS) 37 | 38 | include $(TOPDIR)/Postamble.make 39 | -------------------------------------------------------------------------------- /ocfs2console/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.pyc 3 | ocfsmarshal.c 4 | ocfsmarshal.h 5 | cellmap.c 6 | *.so 7 | ocfs2tool.8 8 | *.d 9 | ocfs2console.8 10 | -------------------------------------------------------------------------------- /ocfs2console/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | SUBDIRS = blkid ocfs2interface 6 | 7 | MANS = ocfs2console.8 8 | 9 | SBIN_EXTRA = ocfs2console 10 | 11 | DIST_FILES = ocfs2console ocfs2console.8.in 12 | 13 | include $(TOPDIR)/Postamble.make 14 | -------------------------------------------------------------------------------- /ocfs2console/blkid/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | *.d 3 | blkid_types.h 4 | libblkid-internal.a 5 | -------------------------------------------------------------------------------- /ocfs2console/blkid/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | INCLUDES = -I.. 6 | 7 | CFLAGS += -fPIC 8 | CPPFLAGS = -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \ 9 | -DHAVE_ERRNO_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_LINUX_FD_H=1 \ 10 | -DHAVE_SYS_QUEUE_H=1 -DHAVE_STDLIB_H=1 -DHAVE_LSEEK64=1 \ 11 | -DHAVE_LSEEK64_PROTOTYPE=1 12 | 13 | CFILES = \ 14 | cache.c \ 15 | dev.c \ 16 | devname.c \ 17 | devno.c \ 18 | getsize.c \ 19 | llseek.c \ 20 | probe.c \ 21 | read.c \ 22 | resolve.c \ 23 | save.c \ 24 | tag.c \ 25 | version.c 26 | 27 | HFILES = \ 28 | blkid.h \ 29 | blkidP.h \ 30 | list.h \ 31 | probe.h 32 | 33 | ifndef HAVE_BLKID 34 | 35 | UNINST_LIBRARIES = libblkid-internal.a 36 | 37 | OBJS = $(subst .c,.o,$(CFILES)) 38 | 39 | libblkid-internal.a: $(OBJS) 40 | rm -f $@ 41 | $(AR) r $@ $^ 42 | $(RANLIB) $@ 43 | 44 | endif 45 | 46 | DIST_FILES = $(CFILES) $(HFILES) ChangeLog 47 | 48 | include $(TOPDIR)/Postamble.make 49 | -------------------------------------------------------------------------------- /ocfs2console/blkid/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * version.c --- Return the version of the blkid library 3 | * 4 | * Copyright (C) 2004 Theodore Ts'o. 5 | * 6 | * %Begin-Header% 7 | * This file may be redistributed under the terms of the GNU Public 8 | * License. 9 | * %End-Header% 10 | */ 11 | 12 | #if HAVE_UNISTD_H 13 | #include 14 | #endif 15 | #include 16 | #include 17 | #include 18 | 19 | #include "blkid.h" 20 | 21 | #define E2FSPROGS_VERSION "1.37" 22 | #define E2FSPROGS_DATE "21-Mar-2005" 23 | 24 | static const char *lib_version = E2FSPROGS_VERSION; 25 | static const char *lib_date = E2FSPROGS_DATE; 26 | 27 | int blkid_parse_version_string(const char *ver_string) 28 | { 29 | const char *cp; 30 | int version = 0; 31 | 32 | for (cp = ver_string; *cp; cp++) { 33 | if (*cp == '.') 34 | continue; 35 | if (!isdigit(*cp)) 36 | break; 37 | version = (version * 10) + (*cp - '0'); 38 | } 39 | return version; 40 | } 41 | 42 | int blkid_get_library_version(const char **ver_string, 43 | const char **date_string) 44 | { 45 | if (ver_string) 46 | *ver_string = lib_version; 47 | if (date_string) 48 | *date_string = lib_date; 49 | 50 | return blkid_parse_version_string(lib_version); 51 | } 52 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python -W ignore::DeprecationWarning 2 | 3 | from ocfs2interface.about import process_args 4 | nodeconf = process_args() 5 | 6 | # 7 | # Current pygtk treats no DISPLAY as a WARNING. This means that 8 | # pygtk initialization tries to continue even after gtk_init() has failed. 9 | # All sorts of fun ensues. To prevent this, we turn the warning into an 10 | # error for the duration of gtk initialization. 11 | # 12 | # Originally reported as Novell bugzilla #448523. 13 | # 14 | import warnings 15 | warnings.filterwarnings("error") 16 | try: 17 | import gtk 18 | except Exception, e: 19 | import sys 20 | if str(e).lower().find('display') == -1: 21 | print >>sys.stderr, '''ERROR: Unable to initialize the windowing 22 | system: %s\n''' % e 23 | else: 24 | print >>sys.stderr, '''ERROR: ocfs2console needs an X11 display. 25 | Make sure a proper setup for your display environment exists.\n''' 26 | sys.exit(1) 27 | warnings.filters.pop(0) 28 | 29 | if nodeconf: 30 | from ocfs2interface.nodeconfig import node_config 31 | node_config() 32 | else: 33 | from ocfs2interface.console import main 34 | main() 35 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2console.8.in: -------------------------------------------------------------------------------- 1 | .TH "ocfs2console" "8" "September 2010" "Version @VERSION@" "OCFS2 Manual Pages" 2 | .SH "NAME" 3 | ocfs2console - GUI console for \fIOCFS2\fR. 4 | .SH "SYNOPSIS" 5 | .B ocfs2console 6 | 7 | .SH DESCRIPTION 8 | .PP 9 | \fBocfs2console\fP is a GUI front\-end for managing \fIOCFS2\fR volumes. 10 | This tool is especially recommended to configure the \fIO2CB\fR cluster. 11 | One can also use this tool to format, tune, mount and umount \fIOCFS2\fR volumes. 12 | 13 | .SH SEE ALSO 14 | .BR mkfs.ocfs2(8) 15 | .BR fsck.ocfs2(8) 16 | .BR tunefs.ocfs2(8) 17 | .BR mounted.ocfs2(8) 18 | .BR debugfs.ocfs2(8) 19 | .BR o2cb(7) 20 | 21 | .SH AUTHORS 22 | Oracle Corporation 23 | 24 | .SH COPYRIGHT 25 | Copyright \(co 2004, 2010 Oracle. All rights reserved. 26 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2interface/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.pyc 3 | *.pyo 4 | plistmodule.so 5 | gidlemodule.so 6 | ocfs2module.so 7 | o2cbmodule.so 8 | confdefs.py 9 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2interface/__init__.py: -------------------------------------------------------------------------------- 1 | # OCFS2Console - GUI frontend for OCFS2 management and debugging 2 | # Copyright (C) 2002, 2005 Oracle. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | '''Just a dummy file, so packages work''' 19 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2interface/classlabel.py: -------------------------------------------------------------------------------- 1 | # OCFS2Console - GUI frontend for OCFS2 management and debugging 2 | # Copyright (C) 2005 Oracle. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | import re 19 | 20 | caps = re.compile('(?!\A)[A-Z][a-z]') 21 | 22 | def make_title(m): 23 | return ' ' + m.group() 24 | 25 | class class_label(object): 26 | def __get__(self, obj, cls): 27 | return caps.sub(make_title, cls.__name__) 28 | 29 | class_label = class_label() 30 | 31 | def main(): 32 | import sys 33 | 34 | cls = type(sys.argv[1], (), {'label': class_label}) 35 | print cls.label 36 | 37 | if __name__ == '__main__': 38 | main() 39 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2interface/confdefs.py.in: -------------------------------------------------------------------------------- 1 | # OCFS2Console - GUI frontend for OCFS2 management and debugging 2 | # Copyright (C) 2002, 2007 Oracle. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | OCFS2TOOLS_VERSION = '@VERSION@' 19 | 20 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2interface/ocfsplist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ocfsplist.h 3 | * 4 | * Function prototypes for related 'C' file. 5 | * 6 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | * Author: Manish Singh 24 | */ 25 | 26 | #ifndef __OCFS_PARTITION_LIST_H__ 27 | #define __OCFS_PARTITION_LIST_H__ 28 | 29 | #include 30 | 31 | 32 | typedef struct _OcfsPartitionInfo OcfsPartitionInfo; 33 | 34 | struct _OcfsPartitionInfo 35 | { 36 | gchar *device; 37 | gchar *mountpoint; 38 | gchar *fstype; 39 | }; 40 | 41 | 42 | typedef void (*OcfsPartitionListFunc) (OcfsPartitionInfo *info, 43 | gpointer data); 44 | 45 | 46 | void ocfs_partition_list (OcfsPartitionListFunc func, 47 | gpointer data, 48 | const gchar *filter, 49 | const gchar *fstype, 50 | gboolean unmounted, 51 | gboolean async); 52 | 53 | 54 | #endif /* __OCFS_PARTITION_LIST_H__ */ 55 | -------------------------------------------------------------------------------- /ocfs2console/ocfs2interface/terminal.py: -------------------------------------------------------------------------------- 1 | # OCFS2Console - GUI frontend for OCFS2 management and debugging 2 | # Copyright (C) 2005 Oracle. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | import gtk 19 | 20 | from guiutil import set_props 21 | 22 | try: 23 | import vte 24 | except ImportError: 25 | terminal_ok = False 26 | else: 27 | terminal_ok = True 28 | 29 | class TerminalDialog(gtk.Dialog): 30 | def __init__(self, parent=None, title='Terminal'): 31 | gtk.Dialog.__init__(self, parent=parent, title=title, 32 | buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) 33 | 34 | label = gtk.Label(title) 35 | label.set_alignment(xalign=0.0, yalign=0.5) 36 | self.vbox.pack_start(label) 37 | 38 | frame = gtk.Frame() 39 | frame.set_shadow_type(gtk.SHADOW_IN) 40 | self.vbox.pack_end(frame) 41 | 42 | hbox = gtk.HBox() 43 | frame.add(hbox) 44 | 45 | self.terminal = vte.Terminal() 46 | self.terminal.set_scrollback_lines(8192) 47 | #self.terminal.set_font_from_string('monospace 12') 48 | hbox.pack_start(self.terminal) 49 | 50 | scrollbar = gtk.VScrollbar() 51 | scrollbar.set_adjustment(self.terminal.get_adjustment()) 52 | hbox.pack_end(scrollbar) 53 | 54 | self.show_all() 55 | 56 | def main(): 57 | dialog = TerminalDialog() 58 | dialog.run() 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /patches/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = README mountocfs2support.patch libblkidocfs2support.patch 6 | 7 | include $(TOPDIR)/Postamble.make 8 | -------------------------------------------------------------------------------- /patches/README: -------------------------------------------------------------------------------- 1 | mountocfs2support.patch patch for mount(8) to autodetect ocfs/ocfs2 and 2 | to mount ocfs2 by label and uuid 3 | -------------------------------------------------------------------------------- /pkg.m4: -------------------------------------------------------------------------------- 1 | 2 | dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) 3 | dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page 4 | dnl also defines GSTUFF_PKG_ERRORS on error 5 | AC_DEFUN([PKG_CHECK_MODULES], [ 6 | succeeded=no 7 | 8 | if test -z "$PKG_CONFIG"; then 9 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 10 | fi 11 | 12 | if test "$PKG_CONFIG" = "no" ; then 13 | echo "*** The pkg-config script could not be found. Make sure it is" 14 | echo "*** in your path, or set the PKG_CONFIG environment variable" 15 | echo "*** to the full path to pkg-config." 16 | echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." 17 | else 18 | PKG_CONFIG_MIN_VERSION=0.9.0 19 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then 20 | AC_MSG_CHECKING(for $2) 21 | 22 | if $PKG_CONFIG --exists "$2" ; then 23 | AC_MSG_RESULT(yes) 24 | succeeded=yes 25 | 26 | AC_MSG_CHECKING($1_CFLAGS) 27 | $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` 28 | AC_MSG_RESULT($$1_CFLAGS) 29 | 30 | AC_MSG_CHECKING($1_LIBS) 31 | $1_LIBS=`$PKG_CONFIG --libs "$2"` 32 | AC_MSG_RESULT($$1_LIBS) 33 | else 34 | $1_CFLAGS="" 35 | $1_LIBS="" 36 | ## If we have a custom action on failure, don't print errors, but 37 | ## do set a variable so people can do so. 38 | $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 39 | ifelse([$4], ,echo $$1_PKG_ERRORS,) 40 | fi 41 | 42 | AC_SUBST($1_CFLAGS) 43 | AC_SUBST($1_LIBS) 44 | else 45 | echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." 46 | echo "*** See http://www.freedesktop.org/software/pkgconfig" 47 | fi 48 | fi 49 | 50 | if test $succeeded = yes; then 51 | ifelse([$3], , :, [$3]) 52 | else 53 | ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) 54 | fi 55 | ]) 56 | 57 | 58 | -------------------------------------------------------------------------------- /pythondev.m4: -------------------------------------------------------------------------------- 1 | ## Find the install dirs for the python installation. 2 | ## By James Henstridge 3 | 4 | dnl a macro to check for ability to create python extensions 5 | dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) 6 | dnl function also defines PYTHON_INCLUDES 7 | AC_DEFUN([AM_CHECK_PYTHON_HEADERS], 8 | [AC_REQUIRE([AM_PATH_PYTHON]) 9 | AC_MSG_CHECKING(for headers required to compile python extensions) 10 | dnl deduce PYTHON_INCLUDES 11 | py_prefix=`$PYTHON -c "import sys; print sys.prefix"` 12 | py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` 13 | PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" 14 | if test "$py_prefix" != "$py_exec_prefix"; then 15 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" 16 | fi 17 | AC_SUBST(PYTHON_INCLUDES) 18 | dnl check if the headers exist: 19 | save_CPPFLAGS="$CPPFLAGS" 20 | CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" 21 | AC_TRY_CPP([#include ],dnl 22 | [AC_MSG_RESULT(found) 23 | $1],dnl 24 | [AC_MSG_RESULT(not found) 25 | $2]) 26 | CPPFLAGS="$save_CPPFLAGS" 27 | ]) 28 | -------------------------------------------------------------------------------- /rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | QUERYFILE= 8 | 9 | if test -f /etc/redhat-release ; then 10 | QUERYFILE=/etc/redhat-release 11 | elif test -f /etc/SuSE-release ; then 12 | QUERYFILE=/etc/SuSE-release 13 | elif test -f /etc/UnitedLinux-release ; then 14 | QUERYFILE=/etc/UnitedLinux-release 15 | fi 16 | 17 | if test -n "$QUERYFILE"; then 18 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 19 | fi 20 | 21 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 22 | host_alias=`$srcdir/config.guess` 23 | host=`$srcdir/config.sub $host_alias` 24 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 25 | fi 26 | 27 | case "$host_cpu" in 28 | x86_64|ia64|s390x) 29 | TOOLSARCH="" 30 | ;; 31 | i386|i486|i586|i686|i786|k6|k7) 32 | TOOLSARCH="i386" 33 | ;; 34 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 35 | TOOLSARCH="ppc" 36 | ;; 37 | *) 38 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 39 | TOOLSARCH="" 40 | ;; 41 | esac 42 | 43 | # Only a few of these need to be overwritten from RPM's default 44 | case "$host_cpu" in 45 | i586) 46 | MODULEARCH="$host_cpu" 47 | ;; 48 | i386) 49 | MODULEARCH="i686" 50 | ;; 51 | *) 52 | MODULEARCH="" 53 | ;; 54 | esac 55 | 56 | case "$mode" in 57 | module) 58 | if [ -n "$MODULEARCH" ] ; then 59 | echo "--target $MODULEARCH" 60 | fi 61 | ;; 62 | tools) 63 | if [ -n "$TOOLSARCH" ] ; then 64 | echo "--target $TOOLSARCH" 65 | fi 66 | ;; 67 | *) 68 | echo "rpmarch.guess: Invalid mode: $mode" >&2 69 | echo "error" 70 | exit 1 71 | ;; 72 | esac 73 | 74 | exit 0 75 | -------------------------------------------------------------------------------- /runlog.m4: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001, 2003 Free Software Foundation, Inc. -*- Autoconf -*- 2 | 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2, or (at your option) 6 | # any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 16 | # 02110-1301, USA. 17 | 18 | # AM_RUN_LOG(COMMAND) 19 | # ------------------- 20 | # Run COMMAND, save the exit status in ac_status, and log it. 21 | # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 22 | AC_DEFUN([AM_RUN_LOG], 23 | [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 24 | ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 25 | ac_status=$? 26 | echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 27 | (exit $ac_status); }]) 28 | -------------------------------------------------------------------------------- /sizetest/.gitignore: -------------------------------------------------------------------------------- 1 | cscope* 2 | stamp-md5 3 | *.sw? 4 | *.cmd 5 | sizetest.ocfs2 6 | *.8 7 | *.d 8 | -------------------------------------------------------------------------------- /sizetest/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | UNINST_PROGRAMS = sizetest.ocfs2 6 | 7 | INCLUDES = -I$(TOPDIR)/include 8 | DEFINES = -DVERSION=\"$(VERSION)\" 9 | 10 | CFILES = sizetest.c 11 | OBJS = $(subst .c,.o,$(CFILES)) 12 | 13 | DIST_FILES = $(CFILES) 14 | 15 | sizetest.ocfs2: $(OBJS) $(LIBOCFS2_DEPS) 16 | $(LINK) 17 | 18 | include $(TOPDIR)/Postamble.make 19 | -------------------------------------------------------------------------------- /tunefs.ocfs2/.gitignore: -------------------------------------------------------------------------------- 1 | cscope* 2 | tunefs.ocfs2 3 | *.sw? 4 | stamp-md5 5 | *.d 6 | tunefs.ocfs2.8 7 | o2ne_err.[ch] 8 | debug_* 9 | ocfs2ne 10 | o2cluster 11 | o2cluster.8 12 | -------------------------------------------------------------------------------- /tunefs.ocfs2/Cscope.make: -------------------------------------------------------------------------------- 1 | .PHONY: cscope 2 | cscope: 3 | rm -f cscope.* 4 | echo "-k" >> cscope.files 5 | echo "-I inc" >> cscope.files 6 | find . -maxdepth 2 -name '*.c' -print >>cscope.files 7 | find . -maxdepth 2 -name '*.h' -print >>cscope.files 8 | find ../libocfs2/ -maxdepth 2 -name '*.c' -print >>cscope.files 9 | find ../libocfs2/ -maxdepth 2 -name '*.h' -print >>cscope.files 10 | find ../libocfs2/ -maxdepth 2 -name '*.et' -print >>cscope.files 11 | find ../libo2cb/ -maxdepth 2 -name '*.c' -print >>cscope.files 12 | find ../libo2cb/ -maxdepth 2 -name '*.c' -print >>cscope.files 13 | find ../libo2dlm/ -maxdepth 2 -name '*.h' -print >>cscope.files 14 | find ../libo2dlm/ -maxdepth 2 -name '*.h' -print >>cscope.files 15 | cscope -b 16 | -------------------------------------------------------------------------------- /vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | list_vendors() 4 | { 5 | ls -1 vendor | while read -r line 6 | do 7 | if [ "$line" = "common" ] 8 | then 9 | continue 10 | fi 11 | if [ ! -d "vendor/$line" ] 12 | then 13 | continue 14 | fi 15 | echo $line 16 | done 17 | 18 | # Make common last 19 | if [ -d "vendor/common" ] 20 | then 21 | echo "common" 22 | fi 23 | } 24 | 25 | list_vendors | while read -r v 26 | do 27 | if [ -x "vendor/${v}/vendor.guess" ] 28 | then 29 | if "vendor/${v}/vendor.guess" >/dev/null 2>&1 30 | then 31 | echo "$v" 32 | fi 33 | fi 34 | done 35 | -------------------------------------------------------------------------------- /vendor/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | SUBDIRS = common rhel7 rhel6 rhel5 sles10 rhel4 sles9 fc7 fc8 fc9 6 | 7 | include $(TOPDIR)/Postamble.make 8 | -------------------------------------------------------------------------------- /vendor/common/.gitignore: -------------------------------------------------------------------------------- 1 | ocfs2-tools.spec 2 | ocfs2-tools.spec-generic 3 | *.sw? 4 | o2cb.init 5 | o2cb.sysconfig.5 6 | -------------------------------------------------------------------------------- /vendor/common/51-ocfs2.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="ocfs2_control", SYMLINK+="misc/ocfs2_control", MODE="0660" 2 | -------------------------------------------------------------------------------- /vendor/common/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | SCRIPT_SH = o2cb.init.sh 6 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) 7 | 8 | # Depend on the substitution values 9 | $(SCRIPTS): $(TOPDIR)/Config.make 10 | 11 | $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh 12 | rm -f $@ $@+ 13 | sed -e 's/@@VERSION@@/$(VERSION)/g' $@.sh >$@+ 14 | chmod +x $@+ 15 | mv $@+ $@ 16 | 17 | ALL_RULES = $(SCRIPTS) 18 | 19 | MANS = o2cb.sysconfig.5 20 | 21 | DIST_FILES = \ 22 | $(SCRIPT_SH) \ 23 | o2cb.sysconfig \ 24 | ocfs2.init \ 25 | ocfs2-tools.spec-generic.in \ 26 | 51-ocfs2.rules \ 27 | Vendor.make \ 28 | o2cb.sysconfig.5.in \ 29 | o2cb.service \ 30 | ocfs2.service 31 | 32 | include $(TOPDIR)/Postamble.make 33 | -------------------------------------------------------------------------------- /vendor/common/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # Support files 3 | # 4 | 5 | # This Vendor.make expects TOOLSARCH and VENDOR_EXTENSION to be set by an 6 | # including Makefile. 7 | 8 | 9 | RPMBUILD = $(shell /usr/bin/which rpmbuild 2>/dev/null || /usr/bin/which rpm 2>/dev/null || echo /bin/false) 10 | RPM_TOPDIR = `pwd` 11 | 12 | ifndef VENDOR_EXTENSION 13 | VENDOR_EXTENSION = common 14 | endif 15 | 16 | $(TOPDIR)/ocfs2-tools-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm: dist $(TOPDIR)/vendor/common/ocfs2-tools.spec-generic 17 | sed -e 's,@@PKG_VERSION@@,'$(PKG_VERSION)',g' \ 18 | -e 's,@@VENDOR_EXTENSION@@,'$(VENDOR_EXTENSION)',g' \ 19 | -e 's,@@PYGTK_NAME@@,'$(PYGTK_NAME)',g' \ 20 | -e 's,@@PYVERSION@@,'$(PYVERSION)',g' \ 21 | -e 's,@@COMPILE_PY@@,'$(COMPILE_PY)',g' \ 22 | -e 's,@@CHKCONFIG_DEP@@,'$(CHKCONFIG_DEP)',g' \ 23 | -e 's,@@SYSTEMD_ENABLED@@,'$(SYSTEMD_ENABLED)',g' \ 24 | -e 's:@@INSTALL_DEP_PKG@@:'$(INSTALL_DEP_PKG)':g' \ 25 | -e 's:@@BUILD_DEP_PKG@@:'$(BUILD_DEP_PKG)':g' \ 26 | < "$(TOPDIR)/vendor/common/ocfs2-tools.spec-generic" \ 27 | > "$(TOPDIR)/vendor/common/ocfs2-tools.spec" 28 | $(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" "$(TOPDIR)/vendor/common/ocfs2-tools.spec" 29 | rm "$(TOPDIR)/vendor/common/ocfs2-tools.spec" 30 | 31 | srpm: $(TOPDIR)/ocfs2-tools-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm 32 | 33 | rpm: srpm 34 | $(RPMBUILD) --rebuild $(TOOLSARCH) "ocfs2-tools-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm" 35 | 36 | -------------------------------------------------------------------------------- /vendor/common/o2cb.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Load o2cb Modules 3 | Documentation=man:o2cb(7) man:o2cb.sysconfig(5) 4 | Requires=network.service 5 | After=network.service 6 | 7 | [Service] 8 | Type=oneshot 9 | RemainAfterExit=yes 10 | ExecStart=/sbin/o2cb.init enable 11 | ExecStop=/sbin/o2cb.init disable 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /vendor/common/o2cb.sysconfig: -------------------------------------------------------------------------------- 1 | # 2 | # This is a configuration file for automatic startup of the O2CB 3 | # driver. It is generated by running /etc/init.d/o2cb configure. 4 | # Please use that method to modify this file 5 | # 6 | 7 | # O2CB_ENABLED: 'true' means to load the driver on boot. 8 | O2CB_ENABLED=false 9 | 10 | # O2CB_BOOTCLUSTER: If not empty, the name of a cluster to start. 11 | O2CB_BOOTCLUSTER=ocfs2 12 | 13 | -------------------------------------------------------------------------------- /vendor/common/ocfs2.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Mount ocfs2 Filesystems 3 | Documentation=man:ocfs2(7) man:mount.ocfs2(8) 4 | Requires=o2cb.service 5 | After=o2cb.service 6 | 7 | [Service] 8 | Type=oneshot 9 | RemainAfterExit=yes 10 | ExecStart=/sbin/ocfs2.init start 11 | ExecStop=/sbin/ocfs2.init stop 12 | ExecReload=/sbin/ocfs2.init restart 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /vendor/common/ocfs2console.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Ocfs2 Cluster Config 3 | GenericName=Ocfs2Console 4 | Comment=Configure and setup Ocfs2 clusters in a graphical environment 5 | StartupNotify=true 6 | Icon=/usr/share/ocfs2console/ocfs2console.png 7 | Exec=/usr/sbin/ocfs2console 8 | Type=Application 9 | Terminal=false 10 | Encoding=UTF-8 11 | Categories=System;Settings; 12 | -------------------------------------------------------------------------------- /vendor/common/ocfs2console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markfasheh/ocfs2-tools/4c5ac61dab84778fbe088d4aadf888e40b1102e6/vendor/common/ocfs2console.png -------------------------------------------------------------------------------- /vendor/fc7/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/fc7/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # Fedora 7 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/fc7/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = fc7 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "redhat-lsb\,\ modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/fc7/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/fedora-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/fc7/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/fedora-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 7*) ;; 10 | *) exit 1;; 11 | esac 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /vendor/fc8/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/fc8/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # Fedora 8 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/fc8/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = fc8 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "redhat-lsb\,\ modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/fc8/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/fedora-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/fc8/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/fedora-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 8*) ;; 10 | *) exit 1;; 11 | esac 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /vendor/fc9/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/fc9/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # Fedora 9 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/fc9/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = fc9 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "redhat-lsb\,\ modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/fc9/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/fedora-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/fc9/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/fedora-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 9*) ;; 10 | *) exit 1;; 11 | esac 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /vendor/rhel4/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/rhel4/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # RHEL 4 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/rhel4/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = el4 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "redhat-lsb\,\ modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/rhel4/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/redhat-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/rhel4/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/redhat-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 4[AEW]S) ;; 10 | 4) ;; 11 | *) exit 1 ;; 12 | esac 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /vendor/rhel5/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/rhel5/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # RHEL 5 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/rhel5/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = el5 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/rhel5/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/redhat-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/rhel5/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/redhat-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 4.9*) ;; 10 | 5*) ;; 11 | *) exit 1;; 12 | esac 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /vendor/rhel6/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/rhel6/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # RHEL 6 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/rhel6/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = el6 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/rhel6/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/redhat-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/rhel6/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/redhat-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 6*) ;; 10 | *) exit 1;; 11 | esac 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /vendor/rhel7/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/rhel7/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # RHEL 7 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/rhel7/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = el7 7 | SYSTEMD_ENABLED = 1 8 | INSTALL_DEP_PKG = "kmod" 9 | BUILD_DEP_PKG = "libuuid-devel\,\ ncurses-devel\,\ readline-devel" 10 | 11 | include $(TOPDIR)/vendor/common/Vendor.make 12 | 13 | packages: rpm 14 | -------------------------------------------------------------------------------- /vendor/rhel7/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | 9 | QUERYFILE=/etc/redhat-release 10 | 11 | if test -n "$QUERYFILE"; then 12 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 13 | fi 14 | 15 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 16 | host_alias=`$srcdir/config.guess` 17 | host=`$srcdir/config.sub $host_alias` 18 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 19 | fi 20 | 21 | case "$host_cpu" in 22 | x86_64|ia64|s390x) 23 | TOOLSARCH="$host_cpu" 24 | ;; 25 | i386|i486|i586|i686|i786|k6|k7) 26 | TOOLSARCH="i386" 27 | ;; 28 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 29 | TOOLSARCH="ppc" 30 | ;; 31 | *) 32 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 33 | TOOLSARCH="" 34 | ;; 35 | esac 36 | 37 | # Only a few of these need to be overwritten from RPM's default 38 | case "$host_cpu" in 39 | i386|i586) 40 | MODULEARCH="i686" 41 | ;; 42 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 43 | MODULEARCH="ppc64" 44 | ;; 45 | *) 46 | MODULEARCH="" 47 | ;; 48 | esac 49 | 50 | case "$mode" in 51 | module) 52 | if [ -n "$MODULEARCH" ] ; then 53 | echo "--target $MODULEARCH" 54 | fi 55 | ;; 56 | tools) 57 | if [ -n "$TOOLSARCH" ] ; then 58 | echo "--target $TOOLSARCH" 59 | fi 60 | ;; 61 | *) 62 | echo "rpmarch.guess: Invalid mode: $mode" >&2 63 | echo "error" 64 | exit 1 65 | ;; 66 | esac 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /vendor/rhel7/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/redhat-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | case "`rpm -qf /etc/redhat-release --qf '%{VERSION}' 2>/dev/null`" in 9 | 7*) ;; 10 | *) exit 1;; 11 | esac 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /vendor/sles10/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/sles10/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # SLES 10 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/sles10/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = SLE10 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "redhat-lsb\,\ modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/sles10/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | QUERYFILE=/etc/SuSE-release 9 | 10 | if test -n "$QUERYFILE"; then 11 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 12 | fi 13 | 14 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 15 | host_alias=`$srcdir/config.guess` 16 | host=`$srcdir/config.sub $host_alias` 17 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 18 | fi 19 | 20 | case "$host_cpu" in 21 | x86_64|ia64|s390x) 22 | TOOLSARCH="$host_cpu" 23 | ;; 24 | i386|i486|i586|i686|i786|k6|k7) 25 | TOOLSARCH="i386" 26 | ;; 27 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 28 | TOOLSARCH="ppc" 29 | ;; 30 | *) 31 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 32 | TOOLSARCH="" 33 | ;; 34 | esac 35 | 36 | # Only a few of these need to be overwritten from RPM's default 37 | case "$host_cpu" in 38 | i586) 39 | MODULEARCH="$host_cpu" 40 | ;; 41 | i386|i686) 42 | MODULEARCH="i586" 43 | ;; 44 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 45 | MODULEARCH="ppc64" 46 | ;; 47 | *) 48 | MODULEARCH="" 49 | ;; 50 | esac 51 | 52 | case "$mode" in 53 | module) 54 | if [ -n "$MODULEARCH" ] ; then 55 | echo "--target $MODULEARCH" 56 | fi 57 | ;; 58 | tools) 59 | if [ -n "$TOOLSARCH" ] ; then 60 | echo "--target $TOOLSARCH" 61 | fi 62 | ;; 63 | *) 64 | echo "rpmarch.guess: Invalid mode: $mode" >&2 65 | echo "error" 66 | exit 1 67 | ;; 68 | esac 69 | 70 | exit 0 71 | -------------------------------------------------------------------------------- /vendor/sles10/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/SuSE-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | if [ "`rpm -qf /etc/SuSE-release --qf '%{VERSION}' 2>/dev/null`" != "10" ] 9 | then 10 | exit 1 11 | fi 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /vendor/sles9/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = ../.. 2 | 3 | include $(TOPDIR)/Preamble.make 4 | 5 | DIST_FILES = \ 6 | rpmarch.guess \ 7 | Vendor.make \ 8 | vendor.guess 9 | 10 | include $(TOPDIR)/Postamble.make 11 | -------------------------------------------------------------------------------- /vendor/sles9/Vendor.make: -------------------------------------------------------------------------------- 1 | # 2 | # SLES 9 3 | # 4 | 5 | TOOLSARCH = $(shell $(TOPDIR)/vendor/sles9/rpmarch.guess tools $(TOPDIR)) 6 | VENDOR_EXTENSION = SLE9 7 | SYSTEMD_ENABLED = 0 8 | INSTALL_DEP_PKG = "redhat-lsb\,\ modutils" 9 | 10 | include $(TOPDIR)/vendor/common/Vendor.make 11 | 12 | packages: rpm 13 | -------------------------------------------------------------------------------- /vendor/sles9/rpmarch.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | mode="$1" 4 | srcdir="$2" 5 | 6 | host_cpu= 7 | 8 | QUERYFILE=/etc/SuSE-release 9 | 10 | if test -n "$QUERYFILE"; then 11 | host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`" 12 | fi 13 | 14 | if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then 15 | host_alias=`$srcdir/config.guess` 16 | host=`$srcdir/config.sub $host_alias` 17 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 18 | fi 19 | 20 | case "$host_cpu" in 21 | x86_64|ia64|s390x) 22 | TOOLSARCH="$host_cpu" 23 | ;; 24 | i386|i486|i586|i686|i786|k6|k7) 25 | TOOLSARCH="i386" 26 | ;; 27 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 28 | TOOLSARCH="ppc" 29 | ;; 30 | *) 31 | echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2 32 | TOOLSARCH="" 33 | ;; 34 | esac 35 | 36 | # Only a few of these need to be overwritten from RPM's default 37 | case "$host_cpu" in 38 | i586) 39 | MODULEARCH="$host_cpu" 40 | ;; 41 | i386|i686) 42 | MODULEARCH="i586" 43 | ;; 44 | ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64) 45 | MODULEARCH="ppc64" 46 | ;; 47 | *) 48 | MODULEARCH="" 49 | ;; 50 | esac 51 | 52 | case "$mode" in 53 | module) 54 | if [ -n "$MODULEARCH" ] ; then 55 | echo "--target $MODULEARCH" 56 | fi 57 | ;; 58 | tools) 59 | if [ -n "$TOOLSARCH" ] ; then 60 | echo "--target $TOOLSARCH" 61 | fi 62 | ;; 63 | *) 64 | echo "rpmarch.guess: Invalid mode: $mode" >&2 65 | echo "error" 66 | exit 1 67 | ;; 68 | esac 69 | 70 | exit 0 71 | -------------------------------------------------------------------------------- /vendor/sles9/vendor.guess: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -f /etc/SuSE-release ] 4 | then 5 | exit 1 6 | fi 7 | 8 | if [ "`rpm -qf /etc/SuSE-release --qf '%{VERSION}' 2>/dev/null`" != "9" ] 9 | then 10 | exit 1 11 | fi 12 | 13 | exit 0 14 | --------------------------------------------------------------------------------