[Oracleasm-commits] jlbec commits r349 - in trunk: . include include/linux include/linux/oracleasm kernel vendor/common vendor/rhas21 vendor/rhel3 vendor/rhel4 vendor/sles8 vendor/sles9
svn-commits@oss.oracle.com
svn-commits at oss.oracle.com
Thu Jul 6 20:42:49 CDT 2006
Author: jlbec
Date: 2006-07-06 20:42:43 -0500 (Thu, 06 Jul 2006)
New Revision: 349
Added:
trunk/include/linux/oracleasm/
trunk/include/linux/oracleasm/Makefile
trunk/include/linux/oracleasm/abi.h
trunk/include/linux/oracleasm/abi_compat.h
trunk/include/linux/oracleasm/compat32.h
trunk/include/linux/oracleasm/disk.h
trunk/include/linux/oracleasm/error.h
trunk/include/linux/oracleasm/kernel.h
trunk/include/linux/oracleasm/manager.h
trunk/include/linux/oracleasm/manager_compat.h
trunk/include/linux/oracleasm/module_version.h.in
trunk/vendor/common/oracleasm-headers.spec-generic.in
Removed:
trunk/include/asmerror.h
trunk/include/linux/asm_module_version.h.in
trunk/include/linux/asmabi.h
trunk/include/linux/asmabi_compat.h
trunk/include/linux/asmcompat32.h
trunk/include/linux/asmdisk.h
trunk/include/linux/asmkernel.h
trunk/include/linux/asmmanager.h
trunk/include/linux/asmmanager_compat.h
trunk/tools/
trunk/vendor/common/oracleasm-support.spec-generic.in
trunk/vendor/common/oracleasm.init
trunk/vendor/common/oracleasm.sysconfig
Modified:
trunk/Config.make.in
trunk/Makefile
trunk/Postamble.make
trunk/Preamble.make
trunk/README
trunk/configure.in
trunk/include/Makefile
trunk/include/linux/
trunk/include/linux/Makefile
trunk/kernel/Makefile
trunk/kernel/oracleasm.c
trunk/vendor/common/
trunk/vendor/common/Makefile
trunk/vendor/common/Vendor.make
trunk/vendor/rhas21/Vendor.make
trunk/vendor/rhel3/Vendor.make
trunk/vendor/rhel4/Vendor.make
trunk/vendor/sles8/Vendor.make
trunk/vendor/sles9/Vendor.make
Log:
The big rework to split out oracleasm-support:
- Remove all oracleasm-support parts
- Move the headers to a directory fit for installation
- Create an oracleasm-headers package for installation of the headers
- Update to latest Makebo
Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/Config.make.in 2006-07-07 01:42:43 UTC (rev 349)
@@ -18,16 +18,19 @@
bindir = @bindir@
sbindir = @sbindir@
+libdir = @libdir@
+includedir = @includedir@
+datarootdir = @datarootdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
mandir = @mandir@
-datarootdir = @datarootdir@
top_builddir = .
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_HEADER = @INSTALL_DATA@
LN_S = @LN_S@
@@ -42,8 +45,6 @@
DEFS = @DEFS@
-USERM64 = @USERM64@
-
KERNELDIR = @KERNELDIR@
KERNELINC = $(KERNELDIR)/include
KERNELVER = @KERNELVER@
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/Makefile 2006-07-07 01:42:43 UTC (rev 349)
@@ -14,7 +14,7 @@
#
# Add any directories to recurse into via the SUBDIRS variable.
#
-SUBDIRS = include kernel tools documents vendor
+SUBDIRS = include kernel documents vendor
KAPI_COMPAT_FILES = \
kapi-compat/include/i_mutex.h
Modified: trunk/Postamble.make
===================================================================
--- trunk/Postamble.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/Postamble.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -54,18 +54,46 @@
$(MAKE) -C $@
.PHONY: all-rules
-all-rules: subdirs $(LIBRARIES) $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(UNINST_PROGRAMS) $(MODULES) $(MANS) $(ALL_RULES)
+all-rules: subdirs $(UNINST_LIBRARIES) $(LIBRARIES) $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(UNINST_PROGRAMS) $(MODULES) $(MANS) $(ALL_RULES)
INSTALL_SUBDIRS = $(addsuffix -install,$(SUBDIRS))
-.PHONY: install-rules install-subdirs $(INSTALL_RULES) install-bin-programs install-bin-extra install-sbin-programs install-sbin-extra
+.PHONY: install-rules install-subdirs $(INSTALL_RULES) install-libraries install-headers install-bin-programs install-bin-extra install-sbin-programs install-sbin-extra
install-subdirs: $(INSTALL_SUBDIRS)
$(INSTALL_SUBDIRS):
$(MAKE) -C $(subst -install,,$@) install
+install-libraries: $(LIBRARIES)
+ifdef LIBRARIES
+ $(SHELL) $(TOPDIR)/mkinstalldirs $(DESTDIR)$(libdir)
+ for lib in $(LIBRARIES); do \
+ $(INSTALL_LIBRARY) $$lib $(DESTDIR)$(libdir)/$$lib; \
+ done
+endif
+
+ifeq ($(filter /%,$(HEADERS_SUBDIR)),)
+Hsubdir = /$(HEADERS_SUBDIR)
+else
+Hsubdir = $(HEADERS_SUBDIR)
+endif
+
+ifeq ($(filter include/%,$(HEADERS)),)
+Hinstall =
+else
+Hinstall = include/
+endif
+
+install-headers: $(HEADERS)
+ifdef HEADERS
+ $(SHELL) $(TOPDIR)/mkinstalldirs $(DESTDIR)$(includedir)$(Hsubdir)
+ for hdr in $(patsubst include/%,%,$(HEADERS)); do \
+ $(INSTALL_HEADER) $(Hinstall)$$hdr $(DESTDIR)$(includedir)$(Hsubdir)/$$hdr; \
+ done
+endif
+
install-bin-programs: $(BIN_PROGRAMS)
ifdef BIN_PROGRAMS
$(SHELL) $(TOPDIR)/mkinstalldirs $(DESTDIR)$(bindir)
@@ -108,7 +136,7 @@
done
endif
-install-rules: install-subdirs $(INSTALL_RULES) install-bin-programs install-bin-extra install-sbin-programs install-sbin-extra install-mans
+install-rules: install-subdirs $(INSTALL_RULES) install-libraries install-headers install-bin-programs install-bin-extra install-sbin-programs install-sbin-extra install-mans
CLEAN_SUBDIRS = $(addsuffix -clean,$(SUBDIRS))
@@ -121,7 +149,7 @@
$(MAKE) -C $(subst -clean,,$@) clean
clean: clean-subdirs $(CLEAN_RULES)
- rm -f *.o *.p .*.d core $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(LIBRARIES) $(CLEAN_FILE) stamp-md5
+ rm -f *.o *.p .*.d core $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(UNINST_PROGRAMS) $(LIBRARIES) $(UNINST_LIBRARIES) $(CLEAN_FILES) stamp-md5
DIST_SUBDIRS = $(addsuffix -dist,$(SUBDIRS))
@@ -160,6 +188,7 @@
distclean: clean
rm -f Config.make config.status config.cache config.log
+
LOCAL_DFILES := $(wildcard .*.d)
ifneq ($(LOCAL_DFILES),)
.PHONY: $(LOCAL_DFILES)
Modified: trunk/Preamble.make
===================================================================
--- trunk/Preamble.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/Preamble.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -7,11 +7,16 @@
endif
LIBRARIES =
-PROGRAMS =
+UNINST_LIBRARIES =
+BIN_PROGRAMS =
+SBIN_PROGRAMS =
+UNINST_PROGRAMS =
MODULES =
+HEADERS =
MANS =
-ALL_RULES =
+HEADERS_SUBDIR =
+
INSTALL_RULES =
CLEAN_FILES =
Modified: trunk/README
===================================================================
--- trunk/README 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/README 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,46 +1,16 @@
-First things first.
+[Oracle Linux ASMLib]
-!!!! DO NOT RUN THE TESTS WITHOUT CHECKING YOUR DISKS !!!!
+ This package contains the kernel driver for Oracle's generic Linux
+ASMLib. To use this driver, you will also need the support tools and
+the actual ASMLib library. Packages for both are available on the Oracle
+Technology Network (http://otn.oracle.com/tech/linux/asmlib/).
+ Building the ASMlib requires a quick run of the configure script
+in the toplevel directory. It will try to guess the location of your
+kernel. If you want a specific kernel, see the --with-kernel and
+--with-vendorkernel options to the configure script. This driver only
+supports Linux 2.6. You then can run a make.
+ Once built and installed, the support tools will be able to load
+the driver and configure ASM storage.
- The asmtest and asmtest-multi checks write to the last 10MB or
-so of a specified disk. They take an argument of the disk to write to.
-Do not destroy your data.
-
-
-Second things later.
-
- Building ASMlib requires a quick run of the configure script
-in the toplevel directory. It will ask the location to the includes for
-your kernel. This code currently only supports Linux 2.6. You then can
-run a make.
- Testing ASMlib is pretty easy. First, install and mount the
-filesystem:
-
- # mkdir /dev/oracleasm
- # insmod kernel/oracleasm.ko
- # mount -t oracleasmfs oracleasmfs /dev/oracleasm
-
- Next, you have to mark disks as candidates for ASM. asmtool is
-the tool for this. It exists in the tools/ subdirectory. eg:
-
- # tools/asmtool -m /dev/sdf5
-
- Now you can then either use 10i or the test programs to try
-things out. Have fun. Report bugs.
-
-
-Third things fourth.
-
- There isn't an easy way to determine the maximum I/O a
-particular device can handle dynamically. The current code takes the
-least common denominator and reports the maximum I/O as the maximum of
-the smallest card (the MegaRAID).
- Also note that while in good cases the maximum I/O will go out
-as one SCSI command, errors can cause it to break up. These can be
-hardware and are not really predictable. Low memory situations (where a
-large scatter/gather list cannot be allocated) also relax this
-assurance. But, if no error occurs on the disk and there is enough
-memory, the I/O goes out all together.
-
Joel Becker <joel.becker at oracle.com>
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/configure.in 2006-07-07 01:42:43 UTC (rev 349)
@@ -46,28 +46,6 @@
AC_HEADER_STDC
AC_C_CONST
-AC_ARG_ENABLE(force32,
- [ --enable-force32 Force building a 32bit library on a 64bit platform],
- force32="$enableval",
- force32="no")
-
-USERM64=""
-case "$host_cpu" in
-ppc64|powerpc64|ppc64iseries|ppc64pseries)
- case "$force32" in
- yes|true|on)
- ;;
- *)
- USERM64="$M64"
- ;;
- esac
- ;;
-*)
- ;;
-esac
-
-AC_SUBST(USERM64)
-
AC_CHECK_SIZEOF(unsigned long)
MB_VENDOR()
@@ -184,8 +162,8 @@
AC_OUTPUT([Config.make
-include/linux/asm_module_version.h
-vendor/common/oracleasm-support.spec-generic
+include/linux/oracleasm/module_version.h
vendor/sles9/oracleasm.spec-generic
vendor/rhel4/oracleasm.spec-generic
+vendor/common/oracleasm-headers.spec-generic
])
Modified: trunk/include/Makefile
===================================================================
--- trunk/include/Makefile 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/Makefile 2006-07-07 01:42:43 UTC (rev 349)
@@ -14,28 +14,7 @@
#
SUBDIRS = linux
-HEADERS = \
- asmerror.h
-
-DIST_FILES = $(HEADERS)
-
#
-# Handle the architecture link
-#
-SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
- -e s/arm.*/arm/ -e s/sa110/arm/ \
- -e s/s390x/s390/ )
-ARCH := $(SUBARCH)
-
-#
-# Deprecated
-#asm-link: asm
-#
-#asm:
-# $(LN_S) asm-$(ARCH) asm
-
-
-#
# Include this at the very end of the Makefile
#
include $(TOPDIR)/Postamble.make
Deleted: trunk/include/asmerror.h
===================================================================
--- trunk/include/asmerror.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/asmerror.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,87 +0,0 @@
-/*
- * NAME
- * asmerror.h - Oracle ASM library internal error header.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file contains the internal error code mappings for the
- * Oracle Automatic Storage Managment userspace library.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- * 2005/09/14 - Joel Becker <joel.becker at oracle.com>
- * Make NODEV a nonfatal error.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-
-
-#ifndef _ASMERROR_H
-#define _ASMERROR_H
-
-/*
- * Error codes. Positive means runtime error, negative means software
- * error. See asmlib.c for the description strings.
- */
-enum _ASMErrors
-{
- ASM_ERR_INSTALL = -5, /* Driver not installed */
- ASM_ERR_FAULT = -4, /* Invalid address */
- ASM_ERR_NODEV_OLD = -3, /* Old invalid device */
- ASM_ERR_BADIID = -2, /* Invalid IID */
- ASM_ERR_INVAL = -1, /* Invalid argument */
- ASM_ERR_NONE = 0, /* No error */
- ASM_ERR_PERM = 1, /* Operation not permitted */
- ASM_ERR_NOMEM = 2, /* Out of memory */
- ASM_ERR_IO = 3, /* I/O error */
- ASM_ERR_DSCVR = 4, /* Bad discovery string */
- ASM_ERR_NODEV = 5, /* Invalid device */
-};
-
-#endif /* _ASMERROR_H */
Property changes on: trunk/include/linux
___________________________________________________________________
Name: svn:ignore
- .*.sw?
.swp
asm_module_version.h
+ .*.sw?
Modified: trunk/include/linux/Makefile
===================================================================
--- trunk/include/linux/Makefile 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/Makefile 2006-07-07 01:42:43 UTC (rev 349)
@@ -12,21 +12,8 @@
#
# Add any directories to recurse into via the SUBDIRS variable.
#
-SUBDIRS =
+SUBDIRS = oracleasm
-HEADERS = \
- asmabi.h \
- asmabi_compat.h \
- asmdisk.h \
- asmmanager.h \
- asmmanager_compat.h \
- asmkernel.h \
- asmcompat32.h \
- asm_module_version.h
-
-DIST_FILES = $(HEADERS) asm_module_version.h.in
-
-
#
# Include this at the very end of the Makefile
#
Deleted: trunk/include/linux/asm_module_version.h.in
===================================================================
--- trunk/include/linux/asm_module_version.h.in 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asm_module_version.h.in 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,32 +0,0 @@
-/*
- * NAME
- * version.h - Hack to make MODULE_VERSION work.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * Copyright (c) 2004 Oracle Corporation. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License, version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have recieved a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#ifndef _ASM_MODULE_VERSION_H
-#define _ASM_MODULE_VERSION_H
-
-#define ASM_MODULE_VERSION "@VERSION@"
-
-#endif /* _ASM_MODULE_VERSION */
-
-
Deleted: trunk/include/linux/asmabi.h
===================================================================
--- trunk/include/linux/asmabi.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmabi.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,184 +0,0 @@
-/*
- * NAME
- * asmabi.h - ASM library userspace to kernelspace ABI.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file describes the ABI used by the Oracle Automatic
- * Storage Management library to communicate with the associated
- * kernel driver.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/08/19 - Joel Becker <joel.becker at oracle.com>
- * Start working on the V2 ABI.
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-
-/*
- * This file is internal to the implementation of the Oracle ASM
- * library on Linux. This file presumes the definitions in asmlib.h
- * and oratypes.h
- */
-
-
-#ifndef _ASMABI_H
-#define _ASMABI_H
-
-
-/*
- * Defines
- */
-#define ASM_ABI_MAGIC 0x41534DU
-
-#define ASM_ABI_VERSION_V2 2UL
-#define ASM_ABI_VERSION ASM_ABI_VERSION_V2
-
-
-/*
- * Enums
- */
-
-enum asm_operation_types
-{
- ASMOP_NONE = 0,
- ASMOP_QUERY_VERSION,
- ASMOP_GET_IID,
- ASMOP_CHECK_IID,
- ASMOP_QUERY_DISK,
-#define ASM_LAST_TRANSACTION_OP ASMOP_QUERY_DISK
- ASMOP_OPEN_DISK,
- ASMOP_CLOSE_DISK,
- ASMOP_IO32,
- ASMOP_IO64,
- ASM_NUM_OPERATIONS /* This must always be last */
-};
-
-/* Users of the commands should always use ASMOP_IO */
-#if BITS_PER_LONG == 32
-# define ASMOP_IO ASMOP_IO32
-#else
-# if BITS_PER_LONG == 64
-# define ASMOP_IO ASMOP_IO64
-# else
-# error Invalid number of bits (BITS_PER_LONG)
-# endif /* BITS_PER_LONG == 64 */
-#endif /* BITS_PER_LONG == 32 */
-
-
-
-/*
- * Structures
- */
-
-struct oracleasm_abi_info
-{
-/*00*/ __u32 ai_magic; /* ASM_ABI_MAGIC */
- __u16 ai_version; /* ABI version */
- __u16 ai_type; /* Type of operation */
- __u32 ai_size; /* Size of passed structure */
- __u32 ai_status; /* Did it succeed */
-/*10*/
-};
-
-/*
- * These are __u64 to handle 32<->64 pointer stuff.
- */
-struct oracleasm_io_v2
-{
-/*00*/ struct oracleasm_abi_info io_abi; /* ABI info */
-/*10*/ __u64 io_handle; /* asm_ctx */
- __u64 io_requests; /* asm_ioc ** */
-/*20*/ __u64 io_waitreqs; /* asm_ioc ** */
- __u64 io_completions; /* asm_ioc ** */
-/*30*/ __u64 io_timeout; /* struct timespec * */
- __u64 io_statusp; /* __u32 * */
-/*40*/ __u32 io_reqlen;
- __u32 io_waitlen;
- __u32 io_complen;
- __u32 io_pad1; /* Pad to 64bit aligned size */
-/*50*/
-};
-
-struct oracleasm_query_disk_v2
-{
-/*00*/ struct oracleasm_abi_info qd_abi;
-/*10*/ __u32 qd_fd;
- __u32 qd_max_sectors;
- __u32 qd_hardsect_size;
- __u32 qd_pad1; /* Pad to 64bit aligned size */
-/*20*/
-};
-
-struct oracleasm_open_disk_v2
-{
-/*00*/ struct oracleasm_abi_info od_abi;
-/*10*/ __u32 od_fd;
- __u32 od_pad1;
- __u64 od_handle;
-/*20*/
-};
-
-struct oracleasm_close_disk_v2
-{
-/*00*/ struct oracleasm_abi_info cd_abi;
-/*10*/ __u64 cd_handle;
-/*18*/
-};
-
-struct oracleasm_get_iid_v2
-{
-/*00*/ struct oracleasm_abi_info gi_abi;
-/*10*/ __u64 gi_iid;
-/*18*/
-};
-
-#endif /* _ASMABI_H */
-
Deleted: trunk/include/linux/asmabi_compat.h
===================================================================
--- trunk/include/linux/asmabi_compat.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmabi_compat.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,152 +0,0 @@
-/*
- * NAME
- * asmabi_compat.h - Old ASM library userspace to kernelspace ABI.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file describes the older ABIs used by the Oracle Automatic
- * Storage Management library to communicate with the associated
- * kernel driver.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/08/19 - Joel Becker <joel.becker at oracle.com>
- * Compat version.
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-
-/*
- * This file is internal to the implementation of the Oracle ASM
- * library on Linux. This file presumes the definitions in asmlib.h
- * and oratypes.h
- */
-
-
-#ifndef _ASMABI_COMPAT_H
-#define _ASMABI_COMPAT_H
-
-
-/*
- * Structures
- */
-
-/*
- * These are __u64 to handle 32<->64 pointer stuff.
- */
-struct oracleasm_io_v1
-{
- __u64 io_handle; /* asm_ctx */
- __u64 io_requests; /* asm_ioc ** */
- __u64 io_waitreqs; /* asm_ioc ** */
- __u64 io_completions; /* asm_ioc ** */
- __u64 io_timeout; /* struct timespec * */
- __u64 io_statusp; /* __u32 * */
- __u32 io_reqlen;
- __u32 io_waitlen;
- __u32 io_complen;
- __u32 io_pad1; /* Pad to 64bit aligned size */
-};
-
-struct oracleasm_disk_query_v1
-{
- __u64 dq_rdev;
- __u64 dq_maxio; /* gcc padding is lame */
-};
-
-#define ASM_ABI_VERSION_V1 1UL
-struct oracleasm_get_iid_v1
-{
- __u64 gi_iid;
- __u64 gi_version; /* gcc padding is lame */
-};
-
-
-
-/*
- * ioctls
- */
-#define ASM_IOCTL_BASE 0xFD
-
-/* ioctls on /dev/oracleasm */
-#define ASMIOC_GETIID _IOR(ASM_IOCTL_BASE, 0, struct oracleasm_get_iid_v1)
-#define ASMIOC_CHECKIID _IOWR(ASM_IOCTL_BASE, 1, struct oracleasm_get_iid_v1)
-
-/* ioctls on /dev/oracleasm/<iid> */
-#define ASMIOC_QUERYDISK _IOWR(ASM_IOCTL_BASE, 2, struct oracleasm_disk_query_v1)
-#define ASMIOC_OPENDISK _IOWR(ASM_IOCTL_BASE, 3, struct oracleasm_disk_query_v1)
-#define ASMIOC_CLOSEDISK _IOW(ASM_IOCTL_BASE, 4, struct oracleasm_disk_query_v1)
-
-
-/*
- * We have separate ioctls so we *know* when the pointers are 32bit
- * or 64bit.
- *
- * All userspace callers should use ASMIOC_IODISK.
- */
-#define ASMIOC_IODISK32 _IOWR(ASM_IOCTL_BASE, 5, struct oracleasm_io_v1)
-
-#if BITS_PER_LONG == 32
-# define ASMIOC_IODISK ASMIOC_IODISK32
-#else
-# if BITS_PER_LONG == 64
-# define ASMIOC_IODISK64 _IOWR(ASM_IOCTL_BASE, 6, struct oracleasm_io_v1)
-# define ASMIOC_IODISK ASMIOC_IODISK64
-# else
-# error Invalid number of bits (BITS_PER_LONG)
-# endif /* BITS_PER_LONG == 64 */
-#endif /* BITS_PER_LONG == 32 */
-
-
-/* ioctl for testing */
-#define ASMIOC_DUMP _IO(ASM_IOCTL_BASE, 16)
-
-
-#endif /* _ASMABI_COMPAT_H */
-
Deleted: trunk/include/linux/asmcompat32.h
===================================================================
--- trunk/include/linux/asmcompat32.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmcompat32.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,101 +0,0 @@
-/*
- * NAME
- * asmcompat32.h - ASM library 32<->64bit compatibilty support.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file contains helpers for supporting 32bit, 64bit, and
- * 32bit-on-64bit implementations of the Oracle Automatic Storage
- * Management library.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-
-/*
- * This file is an internal header to the asmlib implementation on
- * Linux. This file presumes the definitions in asmlib.h and
- * oratypes.h.
- */
-
-
-#ifndef _ASMCOMPAT32_H
-#define _ASMCOMPAT32_H
-
-/*
- * This is ugly. SIZEOF_UNSIGNED_LONG comes from autoconf.
- * Do you have a better way? I chose not to hand-cook an autoconf
- * test because I'm lazy and it doesn't seem significantly better.
- */
-#ifndef BITS_PER_LONG
-# if SIZEOF_UNSIGNED_LONG == 4
-# define BITS_PER_LONG 32
-# else
-# if SIZEOF_UNSIGNED_LONG == 8
-# define BITS_PER_LONG 64
-# else
-# error Unknown size of unsigned long (SIZEOF_UNSIGNED_LONG)
-# endif /* SIZEOF_UNSIGNED_LONG == 8 */
-# endif /* SIZEOF_UNSIGNED_LONG == 4 */
-#endif /* BITS_PER_LONG */
-
-/*
- * Handle the ID sizes
- */
-#define HIGH_UB4(_ub8) ((unsigned long)(((_ub8) >> 32) & 0xFFFFFFFFULL))
-#define LOW_UB4(_ub8) ((unsigned long)((_ub8) & 0xFFFFFFFFULL))
-
-#if defined(CONFIG_COMPAT)
-# include <linux/ioctl32.h>
-#endif
-
-#endif /* _ASMCOMPAT32_H */
-
Deleted: trunk/include/linux/asmdisk.h
===================================================================
--- trunk/include/linux/asmdisk.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmdisk.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,139 +0,0 @@
-/*
- * NAME
- * asmdisk.h - ASM library disk tag.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file contains the definition of the ASM library's disk
- * tag. This tag allows recognition of ASM disks.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-/*
- * This file is an internal header to the asmlib implementation on
- * Linux.
- */
-
-
-#ifndef _ASMDISK_H
-#define _ASMDISK_H
-
-/*
- * Defines
- */
-
-/*
- * Disk label. This is a 32 byte quantity at offset 32 (0x20) on the
- * disk. The first 8 bytes are "ORCLDISK". The remaining 24 bytes
- * are a unique device label determined by the administrator.
- */
-#define ASM_DISK_LABEL_MARKED "ORCLDISK"
-#define ASM_DISK_LABEL_CLEAR "ORCLCLRD"
-#define ASM_DISK_LABEL_OFFSET 32
-
-struct asm_disk_label {
- char dl_tag[8];
- char dl_id[24];
-};
-
-#ifndef __KERNEL__
-/*
- * Why?
- * label_asm_name is defined as a SQL identifier. That is, it is
- * case insensitive. It is also defined as ASCII only. Disk names
- * are what become label_asm_name. So for the user's convenience (sic),
- * we blatantly promote to uppercase.
- */
-static inline int asmdisk_toupper(unsigned char *str, ssize_t len,
- int glob)
-{
- int count, c;
-
- if (len < 0)
- len = INT_MAX;
- count = 0;
- for (count = 0; (count < len) && str[count]; count++)
- {
- c = str[count];
- if (!isascii(c))
- return -ERANGE;
- /* This is super-ASCII-specific */
- if (c == '_')
- continue;
- if (glob &&
- ((c == '*') || (c == '?') ||
- (c == '[') || (c == ']') ||
- (c == '\\') || (c == '-')))
- continue;
- if (c < '0')
- return c;
- if (c <= '9')
- continue;
- if (c < 'A')
- return c;
- if (c <= 'Z')
- continue;
- if (c < '_')
- return c;
- if ((c < 'a') || (c > 'z'))
- return c;
- str[count] = (unsigned char)(c - ('a' - 'A'));
- }
-
- if (!glob && count && ((str[0] < 'A') || (str[0] > 'Z')))
- return str[0];
-
- return 0;
-}
-#endif /* __KERNEL__ */
-
-#endif /* _ASMDISK_H */
Deleted: trunk/include/linux/asmkernel.h
===================================================================
--- trunk/include/linux/asmkernel.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmkernel.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,169 +0,0 @@
-/*
- * NAME
- * asmkernel.h - Kernel definitions for ASM library structures.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file contains the kernel definitions of various structures
- * used by the Oracle Automatic Storage Managment userspace
- * library.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License, version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have recieved a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-/*
- * This file describes structures that are private to the Linux kernel
- * module for asmlib. See asmlib.h for field descriptions.
- *
- * THESE STRUCTURS MUST BE ABI COMPATIBLE WITH THE asmlib.h
- * DEFINITION!!!
-*/
-
-
-#ifndef _ASMKERNEL_H
-#define _ASMKERNEL_H
-
-#ifdef __KERNEL__
-
-/*
- * ASM Defines
- */
-
-/* i/o status bits */
-#define ASM_BUSY 0x0001 /* too busy to process */
-#define ASM_SUBMITTED 0x0002 /* request submitted for processing */
-#define ASM_COMPLETED 0x0004 /* request completed */
-#define ASM_FREE 0x0008 /* memory is free */
-#define ASM_CANCELLED 0x0010 /* request cancelled */
-#define ASM_ERROR 0x0020 /* request failed with an error */
-#define ASM_WARN 0x0040 /* a future request may fail */
-#define ASM_PARTIAL 0x0080 /* only a partial transfer */
-#define ASM_BADKEY 0x0100 /* disk key mismatch */
-#define ASM_BAD_DATA 0x0200 /* I/O was not allowed by the fence key */
-#define ASM_LOCAL_ERROR 0x0400 /* error is local to this host */
-
-/* special timeout values */
-#define ASM_NOWAIT 0x0 /* return as soon as possible */
-#define ASM_WAIT 0xffffffff /* never timeout */
-
-/* status flags indicating reasons for return */
-#define ASM_IO_POSTED 0x1 /* posted to run by OS */
-#define ASM_IO_TIMEOUT 0x2 /* timeout */
-#define ASM_IO_WAITED 0x4 /* wait list complete */
-#define ASM_IO_FULL 0x8 /* completion list full */
-#define ASM_IO_IDLE 0x10 /* no more active I/O */
-
-/* I/O operations */
-#define ASM_NOOP 0x00 /* no-op to key check or pass a hint */
-#define ASM_READ 0x01 /* Read data from disk */
-#define ASM_WRITE 0x02 /* write data to disk */
-/* 0x03 is unused */
-#define ASM_COPY 0x03 /* copy data from one location to another */
-#define ASM_GETKEY 0x04 /* get value of one or more disk keys */
-#define ASM_SETKEY 0x05 /* set value of one or more disk keys */
-
-
-
-/*
- * Disk/Fence Keys - (unused as yet)
- */
-typedef struct _asm_check asm_check;
-struct _asm_check
-{
- __u32 key_num_asm_check;
- __u32 spare1_asm_check;
- __u64 key_mask_asm_check;
- __u64 key_value_asm_check;
- __u64 error_key_asm_check;
-};
-
-
-/*
- * I/O control block
- */
-typedef struct _asm_ioc32 asm_ioc32;
-struct _asm_ioc32 {
- __u32 ccount_asm_ioc;
- __s32 error_asm_ioc;
- __s32 warn_asm_ioc;
- __u32 elaptime_asm_ioc;
- __u16 status_asm_ioc;
- __u16 flags_asm_ioc;
- __u8 operation_asm_ioc;
- __u8 priority_asm_ioc;
- __u16 hint_asm_ioc;
- __u64 disk_asm_ioc;
- __u64 first_asm_ioc;
- __u32 rcount_asm_ioc;
- __u16 xor_asm_ioc;
- __u16 abs_asm_ioc;
- __u32 abn_offset_asm_ioc;
- __u32 abn_asm_ioc;
- __u32 abn_mask_asm_ioc;
- __u32 spare1_asm_ioc;
- __u64 tag_asm_ioc;
- __u64 reserved_asm_ioc;
- __u32 buffer_asm_ioc;
- __u32 check_asm_ioc;
-};
-
-#if BITS_PER_LONG == 32
-# define asm_ioc asm_ioc32
-#else
-# if BITS_PER_LONG == 64
-# define asm_ioc asm_ioc64
-typedef struct _asm_ioc64 asm_ioc64;
-struct _asm_ioc64 {
- __u32 ccount_asm_ioc;
- __s32 error_asm_ioc;
- __s32 warn_asm_ioc;
- __u32 elaptime_asm_ioc;
- __u16 status_asm_ioc;
- __u16 flags_asm_ioc;
- __u8 operation_asm_ioc;
- __u8 priority_asm_ioc;
- __u16 hint_asm_ioc;
- __u64 disk_asm_ioc;
- __u64 first_asm_ioc;
- __u32 rcount_asm_ioc;
- __u16 xor_asm_ioc;
- __u16 abs_asm_ioc;
- __u32 abn_offset_asm_ioc;
- __u32 abn_asm_ioc;
- __u32 abn_mask_asm_ioc;
- __u32 spare1_asm_ioc;
- __u64 tag_asm_ioc;
- __u64 reserved_asm_ioc;
- __u64 buffer_asm_ioc;
- __u64 check_asm_ioc;
-};
-# else
-# error Invalid bits per long (BITS_PER_LONG)
-# endif /* BITS_PER_LONG == 64 */
-#endif /* BITS_PER_LONG == 32 */
-
-#endif /* __KERNEL__ */
-
-#endif /* _ASMKERNEL */
-
-
Deleted: trunk/include/linux/asmmanager.h
===================================================================
--- trunk/include/linux/asmmanager.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmmanager.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,237 +0,0 @@
-/*
- * NAME
- * asmmanager.h - ASM management device.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file contains routines for managing the ASM kernel manager
- * device. The library communicates to the kernel driver through
- * this device.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-/*
- * This file is an internal header to the asmlib implementation on
- * Linux.
- */
-
-
-#ifndef _ASMMANAGER_H
-#define _ASMMANAGER_H
-
-/*
- * Defines
- */
-
-/*
- * Path-fu for the ASM manager device. This is where a particular
- * oracleasmfs is mounted. Default is ASM_MANAGER_DEFAULT
- */
-#define ASM_MANAGER_DEFAULT "/dev/oracleasm"
-
-/* Subdirectories of the manager device */
-#define ASM_MANAGER_DISKS "disks"
-#define ASM_MANAGER_INSTANCES "iid"
-
-/*
- * Instance file in the instance's iid directory. A process opens
- * <manager>/iid/<iid>/instance to connect to the instance. Eg,
- * for a default instance with iid 00000000.00000001, you have
- * /dev/oracleasm/iid/00000000.00000001/instance
- */
-#define ASM_MANAGER_INSTANCE_CONNECTION "instance"
-
-/*
- * Filenames for the operation transaction files.
- */
-static char *asm_operation_files[] = {
- [ASMOP_NONE] = NULL,
-
- /*
- * The first three operations live under the manager, and
- * are global to the mount. A process can open them
- * via <manager>/<operation_file. A default instance would use
- * /dev/oracleasm/.query_version, for example.r
- */
- [ASMOP_QUERY_VERSION] = ".query_version",
- [ASMOP_GET_IID] = ".get_iid",
- [ASMOP_CHECK_IID] = ".check_iid",
- [ASMOP_QUERY_DISK] = ".query_disk",
-
- /*
- * The other operations are stateful and don't work with
- * transaction files.
- */
-};
-
-#ifndef __KERNEL__
-static inline char *asm_disk_path(const char *manager, const char *disk)
-{
- size_t len;
- char *asm_disk;
-
- if (!manager || !*manager || !disk)
- return NULL;
-
- len = strlen(manager) + strlen("/") +
- strlen(ASM_MANAGER_DISKS) + strlen("/") + strlen(disk);
- asm_disk = (char *)malloc(sizeof(char) * (len + 1));
- if (!asm_disk)
- return NULL;
- snprintf(asm_disk, len + 1, "%s/%s/%s", manager,
- ASM_MANAGER_DISKS, disk);
-
- return asm_disk;
-}
-
-
-static inline char *asm_disk_name(const char *manager,
- const char *disk_path)
-{
- size_t len;
- char *asm_disk_base, *disk;
-
- if (!manager || !*manager || !disk_path)
- return NULL;
-
- asm_disk_base = asm_disk_path(manager, "");
- if (!asm_disk_base)
- return NULL;
-
- if (strncmp(disk_path, asm_disk_base,
- strlen(asm_disk_base)))
- {
- free(asm_disk_base);
- return NULL;
- }
- disk_path = disk_path + strlen(asm_disk_base);
- free(asm_disk_base);
-
- for (; (*disk_path != '\0') && (*disk_path == '/'); disk_path++)
- ;
-
- len = strlen(disk_path);
- disk = (char *)malloc(sizeof(char) * (len + 1));
- if (!disk)
- return NULL;
- strncpy(disk, disk_path, len + 1);
-
- return disk;
-}
-
-
-static inline char *asm_manage_path(const char *manager)
-{
- size_t len;
- char *asm_manage;
-
- if (!manager || !*manager)
- return NULL;
- len = strlen(manager) + strlen("/") +
- strlen(ASM_MANAGER_INSTANCES);
- asm_manage = (char *)malloc(sizeof(char) * (len + 1));
- if (!asm_manage)
- return NULL;
- snprintf(asm_manage, len + 1, "%s/%s", manager,
- ASM_MANAGER_INSTANCES);
-
- return asm_manage;
-}
-
-
-#define ASM_MANAGER_IID_FORMAT "%.8lX%.8lX"
-static inline char *asm_iid_path(const char *manager,
- unsigned long iid_high,
- unsigned long iid_low)
-{
- size_t len;
- char *asm_iid;
-
- if (!manager || !*manager)
- return NULL;
- len = strlen(manager) + strlen("/") +
- strlen(ASM_MANAGER_INSTANCES) + strlen("/") +
- (8 + 8 + 1); /* 8 chars per u32, 1 char for '.' */
- asm_iid = (char *)malloc(sizeof(char) * (len + 1));
- if (!asm_iid)
- return NULL;
- snprintf(asm_iid, len + 1, "%s/%s/" ASM_MANAGER_IID_FORMAT,
- manager, ASM_MANAGER_INSTANCES, iid_high, iid_low);
-
- return asm_iid;
-}
-
-static inline char *asm_operation_path(const char *manager,
- int op)
-{
- size_t len;
- char *path;
-
- if (!manager || !*manager)
- return NULL;
- if (op > ASM_LAST_TRANSACTION_OP)
- return NULL;
-
- len = strlen(manager) + strlen("/") +
- strlen(asm_operation_files[op]);
- path = (char *)malloc(sizeof(char) * (len + 1));
- if (!path)
- return NULL;
-
- snprintf(path, len + 1, "%s/%s", manager,
- asm_operation_files[op]);
-
- return path;
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ASMMANAGER_H */
Deleted: trunk/include/linux/asmmanager_compat.h
===================================================================
--- trunk/include/linux/asmmanager_compat.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/asmmanager_compat.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,180 +0,0 @@
-/*
- * NAME
- * asmmanager.h - ASM management device.
- *
- * AUTHOR
- * Joel Becker <joel.becker at oracle.com>
- *
- * DESCRIPTION
- * This file contains routines for managing the ASM kernel manager
- * device. The library communicates to the kernel driver through
- * this device.
- *
- * MODIFIED (YYYY/MM/DD)
- * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
- * Initial LGPL header.
- *
- * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms
- * of the GNU General Public License version 2 (the "GPL") distributed
- * with this softwarere in the file COPYING.GPL, in which case the
- * provisions of the GPL are applicable instead of the above.
- *
- * If you wish to allow the use of your version of this file only under
- * the terms of the GPL and not to allow others to use your version of
- * this file under the license above, indicate your decision by deleting
- * the provisions above and replace them with the notice and other
- * provisions required by the GPL. If you do not delete the provisions
- * above, a recipient may use your version of this file under the above
- * license or the GPL.
- */
-
-/*
- * This file is an internal header to the asmlib implementation on
- * Linux.
- */
-
-
-#ifndef _ASMMANAGER_H
-#define _ASMMANAGER_H
-
-/*
- * Defines
- */
-
-/*
- * Path-fu for the ASM manager device. This is where a particular
- * oracleasmfs is mounted. Default is ASM_MANAGER_DEFAULT
- */
-#define ASM_MANAGER_DEFAULT "/dev/oracleasm"
-#define ASM_MANAGER_DISKS "disks"
-#define ASM_MANAGER_INSTANCES "iid"
-
-#ifndef __KERNEL__
-static inline char *asm_disk_path(const char *manager, const char *disk)
-{
- size_t len;
- char *asm_disk;
-
- if (!manager || !*manager || !disk)
- return NULL;
-
- len = strlen(manager) + strlen("/") +
- strlen(ASM_MANAGER_DISKS) + strlen("/") + strlen(disk);
- asm_disk = (char *)malloc(sizeof(char) * (len + 1));
- if (!asm_disk)
- return NULL;
- snprintf(asm_disk, len + 1, "%s/%s/%s", manager,
- ASM_MANAGER_DISKS, disk);
-
- return asm_disk;
-}
-
-
-static inline char *asm_disk_name(const char *manager,
- const char *disk_path)
-{
- size_t len;
- char *asm_disk_base, *disk;
-
- if (!manager || !*manager || !disk_path)
- return NULL;
-
- asm_disk_base = asm_disk_path(manager, "");
- if (!asm_disk_base)
- return NULL;
-
- if (strncmp(disk_path, asm_disk_base,
- strlen(asm_disk_base)))
- {
- free(asm_disk_base);
- return NULL;
- }
- disk_path = disk_path + strlen(asm_disk_base);
- free(asm_disk_base);
-
- for (; (*disk_path != '\0') && (*disk_path == '/'); disk_path++)
- ;
-
- len = strlen(disk_path);
- disk = (char *)malloc(sizeof(char) * (len + 1));
- if (!disk)
- return NULL;
- strncpy(disk, disk_path, len + 1);
-
- return disk;
-}
-
-
-static inline char *asm_manage_path(const char *manager)
-{
- size_t len;
- char *asm_manage;
-
- if (!manager || !*manager)
- return NULL;
- len = strlen(manager) + strlen("/") +
- strlen(ASM_MANAGER_INSTANCES);
- asm_manage = (char *)malloc(sizeof(char) * (len + 1));
- if (!asm_manage)
- return NULL;
- snprintf(asm_manage, len + 1, "%s/%s", manager,
- ASM_MANAGER_INSTANCES);
-
- return asm_manage;
-}
-
-
-#define ASM_MANAGER_IID_FORMAT "%.8lX%.8lX"
-static inline char *asm_iid_path(const char *manager,
- unsigned long iid_high,
- unsigned long iid_low)
-{
- size_t len;
- char *asm_iid;
-
- if (!manager || !*manager)
- return NULL;
- len = strlen(manager) + strlen("/") +
- strlen(ASM_MANAGER_INSTANCES) + strlen("/") +
- (8 + 8 + 1); /* 8 chars per u32, 1 char for '.' */
- asm_iid = (char *)malloc(sizeof(char) * (len + 1));
- if (!asm_iid)
- return NULL;
- snprintf(asm_iid, len + 1, "%s/%s/" ASM_MANAGER_IID_FORMAT,
- manager, ASM_MANAGER_INSTANCES, iid_high, iid_low);
-
- return asm_iid;
-}
-#endif /* __KERNEL__ */
-#endif /* _ASMMANAGER_H */
Property changes on: trunk/include/linux/oracleasm
___________________________________________________________________
Name: svn:ignore
+ .*.sw?
module_version.h
Added: trunk/include/linux/oracleasm/Makefile
===================================================================
--- trunk/include/linux/oracleasm/Makefile 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/Makefile 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,35 @@
+#
+# Set TOPDIR to the project toplevel directory
+#
+TOPDIR = ../../..
+
+#
+# Include this first, right after setting TOPDIR
+#
+include $(TOPDIR)/Preamble.make
+
+
+#
+# Add any directories to recurse into via the SUBDIRS variable.
+#
+SUBDIRS =
+
+HEADERS_SUBDIR = linux/oracleasm
+HEADERS = \
+ abi.h \
+ abi_compat.h \
+ disk.h \
+ error.h \
+ manager.h \
+ manager_compat.h \
+ kernel.h \
+ compat32.h \
+ module_version.h
+
+DIST_FILES = $(HEADERS) module_version.h.in
+
+
+#
+# Include this at the very end of the Makefile
+#
+include $(TOPDIR)/Postamble.make
Copied: trunk/include/linux/oracleasm/abi.h (from rev 348, trunk/include/linux/asmabi.h)
===================================================================
--- trunk/include/linux/asmabi.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/abi.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,184 @@
+/*
+ * NAME
+ * abi.h - ASM library userspace to kernelspace ABI.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file describes the ABI used by the Oracle Automatic
+ * Storage Management library to communicate with the associated
+ * kernel driver.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/08/19 - Joel Becker <joel.becker at oracle.com>
+ * Start working on the V2 ABI.
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+
+/*
+ * This file is internal to the implementation of the Oracle ASM
+ * library on Linux. This file presumes the definitions in asmlib.h
+ * and oratypes.h
+ */
+
+
+#ifndef _ORACLEASM_ABI_H
+#define _ORACLEASM_ABI_H
+
+
+/*
+ * Defines
+ */
+#define ASM_ABI_MAGIC 0x41534DU
+
+#define ASM_ABI_VERSION_V2 2UL
+#define ASM_ABI_VERSION ASM_ABI_VERSION_V2
+
+
+/*
+ * Enums
+ */
+
+enum asm_operation_types
+{
+ ASMOP_NONE = 0,
+ ASMOP_QUERY_VERSION,
+ ASMOP_GET_IID,
+ ASMOP_CHECK_IID,
+ ASMOP_QUERY_DISK,
+#define ASM_LAST_TRANSACTION_OP ASMOP_QUERY_DISK
+ ASMOP_OPEN_DISK,
+ ASMOP_CLOSE_DISK,
+ ASMOP_IO32,
+ ASMOP_IO64,
+ ASM_NUM_OPERATIONS /* This must always be last */
+};
+
+/* Users of the commands should always use ASMOP_IO */
+#if BITS_PER_LONG == 32
+# define ASMOP_IO ASMOP_IO32
+#else
+# if BITS_PER_LONG == 64
+# define ASMOP_IO ASMOP_IO64
+# else
+# error Invalid number of bits (BITS_PER_LONG)
+# endif /* BITS_PER_LONG == 64 */
+#endif /* BITS_PER_LONG == 32 */
+
+
+
+/*
+ * Structures
+ */
+
+struct oracleasm_abi_info
+{
+/*00*/ __u32 ai_magic; /* ASM_ABI_MAGIC */
+ __u16 ai_version; /* ABI version */
+ __u16 ai_type; /* Type of operation */
+ __u32 ai_size; /* Size of passed structure */
+ __u32 ai_status; /* Did it succeed */
+/*10*/
+};
+
+/*
+ * These are __u64 to handle 32<->64 pointer stuff.
+ */
+struct oracleasm_io_v2
+{
+/*00*/ struct oracleasm_abi_info io_abi; /* ABI info */
+/*10*/ __u64 io_handle; /* asm_ctx */
+ __u64 io_requests; /* asm_ioc ** */
+/*20*/ __u64 io_waitreqs; /* asm_ioc ** */
+ __u64 io_completions; /* asm_ioc ** */
+/*30*/ __u64 io_timeout; /* struct timespec * */
+ __u64 io_statusp; /* __u32 * */
+/*40*/ __u32 io_reqlen;
+ __u32 io_waitlen;
+ __u32 io_complen;
+ __u32 io_pad1; /* Pad to 64bit aligned size */
+/*50*/
+};
+
+struct oracleasm_query_disk_v2
+{
+/*00*/ struct oracleasm_abi_info qd_abi;
+/*10*/ __u32 qd_fd;
+ __u32 qd_max_sectors;
+ __u32 qd_hardsect_size;
+ __u32 qd_pad1; /* Pad to 64bit aligned size */
+/*20*/
+};
+
+struct oracleasm_open_disk_v2
+{
+/*00*/ struct oracleasm_abi_info od_abi;
+/*10*/ __u32 od_fd;
+ __u32 od_pad1;
+ __u64 od_handle;
+/*20*/
+};
+
+struct oracleasm_close_disk_v2
+{
+/*00*/ struct oracleasm_abi_info cd_abi;
+/*10*/ __u64 cd_handle;
+/*18*/
+};
+
+struct oracleasm_get_iid_v2
+{
+/*00*/ struct oracleasm_abi_info gi_abi;
+/*10*/ __u64 gi_iid;
+/*18*/
+};
+
+#endif /* _ORACLEASM_ABI_H */
+
Copied: trunk/include/linux/oracleasm/abi_compat.h (from rev 348, trunk/include/linux/asmabi_compat.h)
===================================================================
--- trunk/include/linux/asmabi_compat.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/abi_compat.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,152 @@
+/*
+ * NAME
+ * abi_compat.h - Older ASM library userspace to kernelspace ABIs.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file describes the older ABIs used by the Oracle Automatic
+ * Storage Management library to communicate with the associated
+ * kernel driver.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/08/19 - Joel Becker <joel.becker at oracle.com>
+ * Compat version.
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+
+/*
+ * This file is internal to the implementation of the Oracle ASM
+ * library on Linux. This file presumes the definitions in asmlib.h
+ * and oratypes.h
+ */
+
+
+#ifndef _ORACLEASM_ABI_COMPAT_H
+#define _ORACLEASM_ABI_COMPAT_H
+
+
+/*
+ * Structures
+ */
+
+/*
+ * These are __u64 to handle 32<->64 pointer stuff.
+ */
+struct oracleasm_io_v1
+{
+ __u64 io_handle; /* asm_ctx */
+ __u64 io_requests; /* asm_ioc ** */
+ __u64 io_waitreqs; /* asm_ioc ** */
+ __u64 io_completions; /* asm_ioc ** */
+ __u64 io_timeout; /* struct timespec * */
+ __u64 io_statusp; /* __u32 * */
+ __u32 io_reqlen;
+ __u32 io_waitlen;
+ __u32 io_complen;
+ __u32 io_pad1; /* Pad to 64bit aligned size */
+};
+
+struct oracleasm_disk_query_v1
+{
+ __u64 dq_rdev;
+ __u64 dq_maxio; /* gcc padding is lame */
+};
+
+#define ASM_ABI_VERSION_V1 1UL
+struct oracleasm_get_iid_v1
+{
+ __u64 gi_iid;
+ __u64 gi_version; /* gcc padding is lame */
+};
+
+
+
+/*
+ * ioctls
+ */
+#define ASM_IOCTL_BASE 0xFD
+
+/* ioctls on /dev/oracleasm */
+#define ASMIOC_GETIID _IOR(ASM_IOCTL_BASE, 0, struct oracleasm_get_iid_v1)
+#define ASMIOC_CHECKIID _IOWR(ASM_IOCTL_BASE, 1, struct oracleasm_get_iid_v1)
+
+/* ioctls on /dev/oracleasm/<iid> */
+#define ASMIOC_QUERYDISK _IOWR(ASM_IOCTL_BASE, 2, struct oracleasm_disk_query_v1)
+#define ASMIOC_OPENDISK _IOWR(ASM_IOCTL_BASE, 3, struct oracleasm_disk_query_v1)
+#define ASMIOC_CLOSEDISK _IOW(ASM_IOCTL_BASE, 4, struct oracleasm_disk_query_v1)
+
+
+/*
+ * We have separate ioctls so we *know* when the pointers are 32bit
+ * or 64bit.
+ *
+ * All userspace callers should use ASMIOC_IODISK.
+ */
+#define ASMIOC_IODISK32 _IOWR(ASM_IOCTL_BASE, 5, struct oracleasm_io_v1)
+
+#if BITS_PER_LONG == 32
+# define ASMIOC_IODISK ASMIOC_IODISK32
+#else
+# if BITS_PER_LONG == 64
+# define ASMIOC_IODISK64 _IOWR(ASM_IOCTL_BASE, 6, struct oracleasm_io_v1)
+# define ASMIOC_IODISK ASMIOC_IODISK64
+# else
+# error Invalid number of bits (BITS_PER_LONG)
+# endif /* BITS_PER_LONG == 64 */
+#endif /* BITS_PER_LONG == 32 */
+
+
+/* ioctl for testing */
+#define ASMIOC_DUMP _IO(ASM_IOCTL_BASE, 16)
+
+
+#endif /* _ORACLEASM_ABI_COMPAT_H */
+
Copied: trunk/include/linux/oracleasm/compat32.h (from rev 348, trunk/include/linux/asmcompat32.h)
===================================================================
--- trunk/include/linux/asmcompat32.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/compat32.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,101 @@
+/*
+ * NAME
+ * compat32.h - ASM library 32<->64bit compatibilty support.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file contains helpers for supporting 32bit, 64bit, and
+ * 32bit-on-64bit implementations of the Oracle Automatic Storage
+ * Management library.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+
+/*
+ * This file is an internal header to the asmlib implementation on
+ * Linux. This file presumes the definitions in asmlib.h and
+ * oratypes.h.
+ */
+
+
+#ifndef _ORACLEASM_COMPAT32_H
+#define _ORACLEASM_COMPAT32_H
+
+/*
+ * This is ugly. SIZEOF_UNSIGNED_LONG comes from autoconf.
+ * Do you have a better way? I chose not to hand-cook an autoconf
+ * test because I'm lazy and it doesn't seem significantly better.
+ */
+#ifndef BITS_PER_LONG
+# if SIZEOF_UNSIGNED_LONG == 4
+# define BITS_PER_LONG 32
+# else
+# if SIZEOF_UNSIGNED_LONG == 8
+# define BITS_PER_LONG 64
+# else
+# error Unknown size of unsigned long (SIZEOF_UNSIGNED_LONG)
+# endif /* SIZEOF_UNSIGNED_LONG == 8 */
+# endif /* SIZEOF_UNSIGNED_LONG == 4 */
+#endif /* BITS_PER_LONG */
+
+/*
+ * Handle the ID sizes
+ */
+#define HIGH_UB4(_ub8) ((unsigned long)(((_ub8) >> 32) & 0xFFFFFFFFULL))
+#define LOW_UB4(_ub8) ((unsigned long)((_ub8) & 0xFFFFFFFFULL))
+
+#if defined(CONFIG_COMPAT)
+# include <linux/ioctl32.h>
+#endif
+
+#endif /* _ORACLEASM_COMPAT32_H */
+
Copied: trunk/include/linux/oracleasm/disk.h (from rev 348, trunk/include/linux/asmdisk.h)
===================================================================
--- trunk/include/linux/asmdisk.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/disk.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,139 @@
+/*
+ * NAME
+ * disk.h - ASM library disk tag.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file contains the definition of the ASM library's disk
+ * tag. This tag allows recognition of ASM disks.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+/*
+ * This file is an internal header to the asmlib implementation on
+ * Linux.
+ */
+
+
+#ifndef _ORACLEASM_DISK_H
+#define _ORACLEASM_DISK_H
+
+/*
+ * Defines
+ */
+
+/*
+ * Disk label. This is a 32 byte quantity at offset 32 (0x20) on the
+ * disk. The first 8 bytes are "ORCLDISK". The remaining 24 bytes
+ * are a unique device label determined by the administrator.
+ */
+#define ASM_DISK_LABEL_MARKED "ORCLDISK"
+#define ASM_DISK_LABEL_CLEAR "ORCLCLRD"
+#define ASM_DISK_LABEL_OFFSET 32
+
+struct asm_disk_label {
+ char dl_tag[8];
+ char dl_id[24];
+};
+
+#ifndef __KERNEL__
+/*
+ * Why?
+ * label_asm_name is defined as a SQL identifier. That is, it is
+ * case insensitive. It is also defined as ASCII only. Disk names
+ * are what become label_asm_name. So for the user's convenience (sic),
+ * we blatantly promote to uppercase.
+ */
+static inline int asmdisk_toupper(unsigned char *str, ssize_t len,
+ int glob)
+{
+ int count, c;
+
+ if (len < 0)
+ len = INT_MAX;
+ count = 0;
+ for (count = 0; (count < len) && str[count]; count++)
+ {
+ c = str[count];
+ if (!isascii(c))
+ return -ERANGE;
+ /* This is super-ASCII-specific */
+ if (c == '_')
+ continue;
+ if (glob &&
+ ((c == '*') || (c == '?') ||
+ (c == '[') || (c == ']') ||
+ (c == '\\') || (c == '-')))
+ continue;
+ if (c < '0')
+ return c;
+ if (c <= '9')
+ continue;
+ if (c < 'A')
+ return c;
+ if (c <= 'Z')
+ continue;
+ if (c < '_')
+ return c;
+ if ((c < 'a') || (c > 'z'))
+ return c;
+ str[count] = (unsigned char)(c - ('a' - 'A'));
+ }
+
+ if (!glob && count && ((str[0] < 'A') || (str[0] > 'Z')))
+ return str[0];
+
+ return 0;
+}
+#endif /* __KERNEL__ */
+
+#endif /* _ORACLEASM_DISK_H */
Copied: trunk/include/linux/oracleasm/error.h (from rev 348, trunk/include/asmerror.h)
===================================================================
--- trunk/include/asmerror.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/error.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,87 @@
+/*
+ * NAME
+ * error.h - Oracle ASM library internal error header.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file contains the internal error code mappings for the
+ * Oracle Automatic Storage Managment userspace library.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ * 2005/09/14 - Joel Becker <joel.becker at oracle.com>
+ * Make NODEV a nonfatal error.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+
+
+#ifndef _ORACLEASM_ERROR_H
+#define _ORACLEASM_ERROR_H
+
+/*
+ * Error codes. Positive means runtime error, negative means software
+ * error. See asmlib.c for the description strings.
+ */
+enum _ASMErrors
+{
+ ASM_ERR_INSTALL = -5, /* Driver not installed */
+ ASM_ERR_FAULT = -4, /* Invalid address */
+ ASM_ERR_NODEV_OLD = -3, /* Old invalid device */
+ ASM_ERR_BADIID = -2, /* Invalid IID */
+ ASM_ERR_INVAL = -1, /* Invalid argument */
+ ASM_ERR_NONE = 0, /* No error */
+ ASM_ERR_PERM = 1, /* Operation not permitted */
+ ASM_ERR_NOMEM = 2, /* Out of memory */
+ ASM_ERR_IO = 3, /* I/O error */
+ ASM_ERR_DSCVR = 4, /* Bad discovery string */
+ ASM_ERR_NODEV = 5, /* Invalid device */
+};
+
+#endif /* _ORACLEASM_ERROR_H */
Copied: trunk/include/linux/oracleasm/kernel.h (from rev 348, trunk/include/linux/asmkernel.h)
===================================================================
--- trunk/include/linux/asmkernel.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/kernel.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,169 @@
+/*
+ * NAME
+ * kernel.h - Kernel definitions for ASM library structures.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file contains the kernel definitions of various structures
+ * used by the Oracle Automatic Storage Managment userspace
+ * library.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License, version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have recieved a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ */
+
+/*
+ * This file describes structures that are private to the Linux kernel
+ * module for asmlib. See asmlib.h for field descriptions.
+ *
+ * THESE STRUCTURS MUST BE ABI COMPATIBLE WITH THE asmlib.h
+ * DEFINITION!!!
+*/
+
+
+#ifndef _ORACLEASM_KERNEL_H
+#define _ORACLEASM_KERNEL_H
+
+#ifdef __KERNEL__
+
+/*
+ * ASM Defines
+ */
+
+/* i/o status bits */
+#define ASM_BUSY 0x0001 /* too busy to process */
+#define ASM_SUBMITTED 0x0002 /* request submitted for processing */
+#define ASM_COMPLETED 0x0004 /* request completed */
+#define ASM_FREE 0x0008 /* memory is free */
+#define ASM_CANCELLED 0x0010 /* request cancelled */
+#define ASM_ERROR 0x0020 /* request failed with an error */
+#define ASM_WARN 0x0040 /* a future request may fail */
+#define ASM_PARTIAL 0x0080 /* only a partial transfer */
+#define ASM_BADKEY 0x0100 /* disk key mismatch */
+#define ASM_BAD_DATA 0x0200 /* I/O was not allowed by the fence key */
+#define ASM_LOCAL_ERROR 0x0400 /* error is local to this host */
+
+/* special timeout values */
+#define ASM_NOWAIT 0x0 /* return as soon as possible */
+#define ASM_WAIT 0xffffffff /* never timeout */
+
+/* status flags indicating reasons for return */
+#define ASM_IO_POSTED 0x1 /* posted to run by OS */
+#define ASM_IO_TIMEOUT 0x2 /* timeout */
+#define ASM_IO_WAITED 0x4 /* wait list complete */
+#define ASM_IO_FULL 0x8 /* completion list full */
+#define ASM_IO_IDLE 0x10 /* no more active I/O */
+
+/* I/O operations */
+#define ASM_NOOP 0x00 /* no-op to key check or pass a hint */
+#define ASM_READ 0x01 /* Read data from disk */
+#define ASM_WRITE 0x02 /* write data to disk */
+/* 0x03 is unused */
+#define ASM_COPY 0x03 /* copy data from one location to another */
+#define ASM_GETKEY 0x04 /* get value of one or more disk keys */
+#define ASM_SETKEY 0x05 /* set value of one or more disk keys */
+
+
+
+/*
+ * Disk/Fence Keys - (unused as yet)
+ */
+typedef struct _asm_check asm_check;
+struct _asm_check
+{
+ __u32 key_num_asm_check;
+ __u32 spare1_asm_check;
+ __u64 key_mask_asm_check;
+ __u64 key_value_asm_check;
+ __u64 error_key_asm_check;
+};
+
+
+/*
+ * I/O control block
+ */
+typedef struct _asm_ioc32 asm_ioc32;
+struct _asm_ioc32 {
+ __u32 ccount_asm_ioc;
+ __s32 error_asm_ioc;
+ __s32 warn_asm_ioc;
+ __u32 elaptime_asm_ioc;
+ __u16 status_asm_ioc;
+ __u16 flags_asm_ioc;
+ __u8 operation_asm_ioc;
+ __u8 priority_asm_ioc;
+ __u16 hint_asm_ioc;
+ __u64 disk_asm_ioc;
+ __u64 first_asm_ioc;
+ __u32 rcount_asm_ioc;
+ __u16 xor_asm_ioc;
+ __u16 abs_asm_ioc;
+ __u32 abn_offset_asm_ioc;
+ __u32 abn_asm_ioc;
+ __u32 abn_mask_asm_ioc;
+ __u32 spare1_asm_ioc;
+ __u64 tag_asm_ioc;
+ __u64 reserved_asm_ioc;
+ __u32 buffer_asm_ioc;
+ __u32 check_asm_ioc;
+};
+
+#if BITS_PER_LONG == 32
+# define asm_ioc asm_ioc32
+#else
+# if BITS_PER_LONG == 64
+# define asm_ioc asm_ioc64
+typedef struct _asm_ioc64 asm_ioc64;
+struct _asm_ioc64 {
+ __u32 ccount_asm_ioc;
+ __s32 error_asm_ioc;
+ __s32 warn_asm_ioc;
+ __u32 elaptime_asm_ioc;
+ __u16 status_asm_ioc;
+ __u16 flags_asm_ioc;
+ __u8 operation_asm_ioc;
+ __u8 priority_asm_ioc;
+ __u16 hint_asm_ioc;
+ __u64 disk_asm_ioc;
+ __u64 first_asm_ioc;
+ __u32 rcount_asm_ioc;
+ __u16 xor_asm_ioc;
+ __u16 abs_asm_ioc;
+ __u32 abn_offset_asm_ioc;
+ __u32 abn_asm_ioc;
+ __u32 abn_mask_asm_ioc;
+ __u32 spare1_asm_ioc;
+ __u64 tag_asm_ioc;
+ __u64 reserved_asm_ioc;
+ __u64 buffer_asm_ioc;
+ __u64 check_asm_ioc;
+};
+# else
+# error Invalid bits per long (BITS_PER_LONG)
+# endif /* BITS_PER_LONG == 64 */
+#endif /* BITS_PER_LONG == 32 */
+
+#endif /* __KERNEL__ */
+
+#endif /* _ORACLEASM_KERNEL */
+
+
Copied: trunk/include/linux/oracleasm/manager.h (from rev 348, trunk/include/linux/asmmanager.h)
===================================================================
--- trunk/include/linux/asmmanager.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/manager.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,237 @@
+/*
+ * NAME
+ * manager.h - ASM management device.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file contains routines for managing the ASM kernel manager
+ * device. The library communicates to the kernel driver through
+ * this device.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+/*
+ * This file is an internal header to the asmlib implementation on
+ * Linux.
+ */
+
+
+#ifndef _ORACLEASM_MANAGER_H
+#define _ORACLEASM_MANAGER_H
+
+/*
+ * Defines
+ */
+
+/*
+ * Path-fu for the ASM manager device. This is where a particular
+ * oracleasmfs is mounted. Default is ASM_MANAGER_DEFAULT
+ */
+#define ASM_MANAGER_DEFAULT "/dev/oracleasm"
+
+/* Subdirectories of the manager device */
+#define ASM_MANAGER_DISKS "disks"
+#define ASM_MANAGER_INSTANCES "iid"
+
+/*
+ * Instance file in the instance's iid directory. A process opens
+ * <manager>/iid/<iid>/instance to connect to the instance. Eg,
+ * for a default instance with iid 00000000.00000001, you have
+ * /dev/oracleasm/iid/00000000.00000001/instance
+ */
+#define ASM_MANAGER_INSTANCE_CONNECTION "instance"
+
+/*
+ * Filenames for the operation transaction files.
+ */
+static char *asm_operation_files[] = {
+ [ASMOP_NONE] = NULL,
+
+ /*
+ * The first three operations live under the manager, and
+ * are global to the mount. A process can open them
+ * via <manager>/<operation_file. A default instance would use
+ * /dev/oracleasm/.query_version, for example.r
+ */
+ [ASMOP_QUERY_VERSION] = ".query_version",
+ [ASMOP_GET_IID] = ".get_iid",
+ [ASMOP_CHECK_IID] = ".check_iid",
+ [ASMOP_QUERY_DISK] = ".query_disk",
+
+ /*
+ * The other operations are stateful and don't work with
+ * transaction files.
+ */
+};
+
+#ifndef __KERNEL__
+static inline char *asm_disk_path(const char *manager, const char *disk)
+{
+ size_t len;
+ char *asm_disk;
+
+ if (!manager || !*manager || !disk)
+ return NULL;
+
+ len = strlen(manager) + strlen("/") +
+ strlen(ASM_MANAGER_DISKS) + strlen("/") + strlen(disk);
+ asm_disk = (char *)malloc(sizeof(char) * (len + 1));
+ if (!asm_disk)
+ return NULL;
+ snprintf(asm_disk, len + 1, "%s/%s/%s", manager,
+ ASM_MANAGER_DISKS, disk);
+
+ return asm_disk;
+}
+
+
+static inline char *asm_disk_name(const char *manager,
+ const char *disk_path)
+{
+ size_t len;
+ char *asm_disk_base, *disk;
+
+ if (!manager || !*manager || !disk_path)
+ return NULL;
+
+ asm_disk_base = asm_disk_path(manager, "");
+ if (!asm_disk_base)
+ return NULL;
+
+ if (strncmp(disk_path, asm_disk_base,
+ strlen(asm_disk_base)))
+ {
+ free(asm_disk_base);
+ return NULL;
+ }
+ disk_path = disk_path + strlen(asm_disk_base);
+ free(asm_disk_base);
+
+ for (; (*disk_path != '\0') && (*disk_path == '/'); disk_path++)
+ ;
+
+ len = strlen(disk_path);
+ disk = (char *)malloc(sizeof(char) * (len + 1));
+ if (!disk)
+ return NULL;
+ strncpy(disk, disk_path, len + 1);
+
+ return disk;
+}
+
+
+static inline char *asm_manage_path(const char *manager)
+{
+ size_t len;
+ char *asm_manage;
+
+ if (!manager || !*manager)
+ return NULL;
+ len = strlen(manager) + strlen("/") +
+ strlen(ASM_MANAGER_INSTANCES);
+ asm_manage = (char *)malloc(sizeof(char) * (len + 1));
+ if (!asm_manage)
+ return NULL;
+ snprintf(asm_manage, len + 1, "%s/%s", manager,
+ ASM_MANAGER_INSTANCES);
+
+ return asm_manage;
+}
+
+
+#define ASM_MANAGER_IID_FORMAT "%.8lX%.8lX"
+static inline char *asm_iid_path(const char *manager,
+ unsigned long iid_high,
+ unsigned long iid_low)
+{
+ size_t len;
+ char *asm_iid;
+
+ if (!manager || !*manager)
+ return NULL;
+ len = strlen(manager) + strlen("/") +
+ strlen(ASM_MANAGER_INSTANCES) + strlen("/") +
+ (8 + 8 + 1); /* 8 chars per u32, 1 char for '.' */
+ asm_iid = (char *)malloc(sizeof(char) * (len + 1));
+ if (!asm_iid)
+ return NULL;
+ snprintf(asm_iid, len + 1, "%s/%s/" ASM_MANAGER_IID_FORMAT,
+ manager, ASM_MANAGER_INSTANCES, iid_high, iid_low);
+
+ return asm_iid;
+}
+
+static inline char *asm_operation_path(const char *manager,
+ int op)
+{
+ size_t len;
+ char *path;
+
+ if (!manager || !*manager)
+ return NULL;
+ if (op > ASM_LAST_TRANSACTION_OP)
+ return NULL;
+
+ len = strlen(manager) + strlen("/") +
+ strlen(asm_operation_files[op]);
+ path = (char *)malloc(sizeof(char) * (len + 1));
+ if (!path)
+ return NULL;
+
+ snprintf(path, len + 1, "%s/%s", manager,
+ asm_operation_files[op]);
+
+ return path;
+}
+
+#endif /* __KERNEL__ */
+#endif /* _ORACLEASM_MANAGER_H */
Copied: trunk/include/linux/oracleasm/manager_compat.h (from rev 348, trunk/include/linux/asmmanager_compat.h)
===================================================================
--- trunk/include/linux/asmmanager_compat.h 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/include/linux/oracleasm/manager_compat.h 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,180 @@
+/*
+ * NAME
+ * manager_compat.h - Older ASM management device specification.
+ *
+ * AUTHOR
+ * Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ * This file contains routines for managing the ASM kernel manager
+ * device. The library communicates to the kernel driver through
+ * this device.
+ *
+ * MODIFIED (YYYY/MM/DD)
+ * 2004/01/02 - Joel Becker <joel.becker at oracle.com>
+ * Initial LGPL header.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ * - Neither the name of Oracle Corporation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above.
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL. If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+/*
+ * This file is an internal header to the asmlib implementation on
+ * Linux.
+ */
+
+
+#ifndef _ORACLEASM_MANAGER_H
+#define _ORACLEASM_MANAGER_H
+
+/*
+ * Defines
+ */
+
+/*
+ * Path-fu for the ASM manager device. This is where a particular
+ * oracleasmfs is mounted. Default is ASM_MANAGER_DEFAULT
+ */
+#define ASM_MANAGER_DEFAULT "/dev/oracleasm"
+#define ASM_MANAGER_DISKS "disks"
+#define ASM_MANAGER_INSTANCES "iid"
+
+#ifndef __KERNEL__
+static inline char *asm_disk_path(const char *manager, const char *disk)
+{
+ size_t len;
+ char *asm_disk;
+
+ if (!manager || !*manager || !disk)
+ return NULL;
+
+ len = strlen(manager) + strlen("/") +
+ strlen(ASM_MANAGER_DISKS) + strlen("/") + strlen(disk);
+ asm_disk = (char *)malloc(sizeof(char) * (len + 1));
+ if (!asm_disk)
+ return NULL;
+ snprintf(asm_disk, len + 1, "%s/%s/%s", manager,
+ ASM_MANAGER_DISKS, disk);
+
+ return asm_disk;
+}
+
+
+static inline char *asm_disk_name(const char *manager,
+ const char *disk_path)
+{
+ size_t len;
+ char *asm_disk_base, *disk;
+
+ if (!manager || !*manager || !disk_path)
+ return NULL;
+
+ asm_disk_base = asm_disk_path(manager, "");
+ if (!asm_disk_base)
+ return NULL;
+
+ if (strncmp(disk_path, asm_disk_base,
+ strlen(asm_disk_base)))
+ {
+ free(asm_disk_base);
+ return NULL;
+ }
+ disk_path = disk_path + strlen(asm_disk_base);
+ free(asm_disk_base);
+
+ for (; (*disk_path != '\0') && (*disk_path == '/'); disk_path++)
+ ;
+
+ len = strlen(disk_path);
+ disk = (char *)malloc(sizeof(char) * (len + 1));
+ if (!disk)
+ return NULL;
+ strncpy(disk, disk_path, len + 1);
+
+ return disk;
+}
+
+
+static inline char *asm_manage_path(const char *manager)
+{
+ size_t len;
+ char *asm_manage;
+
+ if (!manager || !*manager)
+ return NULL;
+ len = strlen(manager) + strlen("/") +
+ strlen(ASM_MANAGER_INSTANCES);
+ asm_manage = (char *)malloc(sizeof(char) * (len + 1));
+ if (!asm_manage)
+ return NULL;
+ snprintf(asm_manage, len + 1, "%s/%s", manager,
+ ASM_MANAGER_INSTANCES);
+
+ return asm_manage;
+}
+
+
+#define ASM_MANAGER_IID_FORMAT "%.8lX%.8lX"
+static inline char *asm_iid_path(const char *manager,
+ unsigned long iid_high,
+ unsigned long iid_low)
+{
+ size_t len;
+ char *asm_iid;
+
+ if (!manager || !*manager)
+ return NULL;
+ len = strlen(manager) + strlen("/") +
+ strlen(ASM_MANAGER_INSTANCES) + strlen("/") +
+ (8 + 8 + 1); /* 8 chars per u32, 1 char for '.' */
+ asm_iid = (char *)malloc(sizeof(char) * (len + 1));
+ if (!asm_iid)
+ return NULL;
+ snprintf(asm_iid, len + 1, "%s/%s/" ASM_MANAGER_IID_FORMAT,
+ manager, ASM_MANAGER_INSTANCES, iid_high, iid_low);
+
+ return asm_iid;
+}
+#endif /* __KERNEL__ */
+#endif /* _ORACLEASM_MANAGER_H */
Copied: trunk/include/linux/oracleasm/module_version.h.in (from rev 348, trunk/include/linux/asm_module_version.h.in)
Modified: trunk/kernel/Makefile
===================================================================
--- trunk/kernel/Makefile 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/kernel/Makefile 2006-07-07 01:42:43 UTC (rev 349)
@@ -13,7 +13,7 @@
endif
-HEADERS = transaction_file.h proc.h masklog.h
+UNINST_HEADERS = transaction_file.h proc.h masklog.h
SOURCES = oracleasm.c transaction_file.c proc.c masklog.c
OBJECTS = $(subst .c,.o,$(SOURCES))
@@ -39,7 +39,7 @@
install-oracleasm: $(INSTALL_MODULE)
$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules_install
-DIST_FILES = $(SOURCES) $(HEADERS)
+DIST_FILES = $(SOURCES) $(UNINST_HEADERS)
include $(TOPDIR)/Postamble.make
Modified: trunk/kernel/oracleasm.c
===================================================================
--- trunk/kernel/oracleasm.c 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/kernel/oracleasm.c 2006-07-07 01:42:43 UTC (rev 349)
@@ -71,14 +71,14 @@
#include <asm/uaccess.h>
#include <linux/spinlock.h>
-#include "linux/asmcompat32.h"
-#include "linux/asmkernel.h"
-#include "linux/asmabi.h"
-#include "linux/asmdisk.h"
-#include "linux/asmmanager.h"
-#include "asmerror.h"
+#include "linux/oracleasm/compat32.h"
+#include "linux/oracleasm/kernel.h"
+#include "linux/oracleasm/abi.h"
+#include "linux/oracleasm/disk.h"
+#include "linux/oracleasm/manager.h"
+#include "linux/oracleasm/error.h"
-#include "linux/asm_module_version.h"
+#include "linux/oracleasm/module_version.h"
#include "masklog.h"
#include "proc.h"
Property changes on: trunk/vendor/common
___________________________________________________________________
Name: svn:ignore
- .*.sw?
oracleasm-support.spec
oracleasm-support.spec-generic
+ .*.sw?
oracleasm-headers.spec
oracleasm-headers.spec-generic
Modified: trunk/vendor/common/Makefile
===================================================================
--- trunk/vendor/common/Makefile 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/common/Makefile 2006-07-07 01:42:43 UTC (rev 349)
@@ -3,9 +3,7 @@
include $(TOPDIR)/Preamble.make
DIST_FILES = \
- oracleasm.init \
- oracleasm.sysconfig \
- oracleasm-support.spec-generic.in \
+ oracleasm-headers.spec-generic.in \
Vendor.make
include $(TOPDIR)/Postamble.make
Modified: trunk/vendor/common/Vendor.make
===================================================================
--- trunk/vendor/common/Vendor.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/common/Vendor.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,20 +1,21 @@
#
-# Support files
+# Header files
#
# This Vendor.make expects TOOLSARCH set by someone including it
+# It also expects PKG_VERSION and INCLUDE_REQUIRES to be set.
RPMBUILD = $(shell /usr/bin/which rpmbuild 2>/dev/null || /usr/bin/which rpm 2>/dev/null || echo /bin/false)
RPM_TOPDIR = `pwd`
-$(TOPDIR)/oracleasm-support-$(DIST_VERSION)-$(PKG_VERSION).src.rpm: dist $(TOPDIR)/vendor/common/oracleasm-support.spec-generic
- sed -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' < "$(TOPDIR)/vendor/common/oracleasm-support.spec-generic" > "$(TOPDIR)/vendor/common/oracleasm-support.spec"
- $(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" "$(TOPDIR)/vendor/common/oracleasm-support.spec"
- rm "$(TOPDIR)/vendor/common/oracleasm-support.spec"
+$(TOPDIR)/oracleasm-headers-$(DIST_VERSION)-$(PKG_VERSION).src.rpm: dist $(TOPDIR)/vendor/common/oracleasm-headers.spec-generic
+ sed -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' -e 's/@@INCLUDE_REQUIRES@@/'$(INCLUDE_REQUIRES)'/' < "$(TOPDIR)/vendor/common/oracleasm-headers.spec-generic" > "$(TOPDIR)/vendor/common/oracleasm-headers.spec"
+ $(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" "$(TOPDIR)/vendor/common/oracleasm-headers.spec"
+ rm "$(TOPDIR)/vendor/common/oracleasm-headers.spec"
-support_srpm: $(TOPDIR)/oracleasm-support-$(DIST_VERSION)-$(PKG_VERSION).src.rpm
+headers_srpm: $(TOPDIR)/oracleasm-headers-$(DIST_VERSION)-$(PKG_VERSION).src.rpm
-support_rpm: support_srpm
- $(RPMBUILD) --rebuild $(TOOLSARCH) "oracleasm-support-$(DIST_VERSION)-$(PKG_VERSION).src.rpm"
+headers_rpm: headers_srpm
+ $(RPMBUILD) --rebuild $(TOOLSARCH) "oracleasm-headers-$(DIST_VERSION)-$(PKG_VERSION).src.rpm"
Copied: trunk/vendor/common/oracleasm-headers.spec-generic.in (from rev 348, trunk/vendor/common/oracleasm-support.spec-generic.in)
===================================================================
--- trunk/vendor/common/oracleasm-support.spec-generic.in 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/common/oracleasm-headers.spec-generic.in 2006-07-07 01:42:43 UTC (rev 349)
@@ -0,0 +1,102 @@
+#
+# Spec file for oracleasm
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+# Because RPM is dumb
+%define _unpackaged_files_terminate_build 0
+
+# Turn on's and off's (summit and debug not used but added
+# for future proofing)
+
+
+
+Summary: The Oracle Automatic Storage Management driver ABI headers.
+Name: oracleasm-headers
+Version: @DIST_VERSION@
+Release: @@PKG_VERSION@@
+Copyright: GPL
+Group: System Environment/Kernel
+Source: oracleasm- at DIST_VERSION@.tar.gz
+URL: http://oss.oracle.com/projects/oracleasm/
+Distribution: Oracle
+Vendor: Oracle Corporation
+Packager: Joel Becker <joel.becker at oracle.com>
+# Requires: What, for /usr/include/linux??
+Requires: @@INCLUDE_REQUIRES@@
+AutoReqProv: no
+
+
+BuildRoot: %{_tmppath}/oracleasm-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+
+%description
+Headers that define the ABI between the Oracle Linux ASMLib kernel driver
+and userspace programs.
+
+
+%prep
+%setup -n oracleasm-%{version}
+
+
+%build
+./configure \
+ --prefix=%{_prefix} \
+ --exec-prefix=%{_exec_prefix} \
+ --bindir=%{_bindir} \
+ --sbindir=%{_sbindir} \
+ --sysconfdir=%{_sysconfdir} \
+ --datadir=%{_datadir} \
+ --includedir=%{_includedir} \
+ --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} \
+ --localstatedir=%{_localstatedir} \
+ --sharedstatedir=%{_sharedstatedir} \
+ --mandir=%{_mandir} \
+ --infodir=%{_infodir} \
+ --sbindir=/usr/sbin
+
+make
+
+
+%install
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%post
+
+%files
+%defattr(-,root,root)
+/usr/include/linux/oracleasm
+
+
+
+%changelog
+* Tue Jul 04 2006 Joel Becker <joel.becker at oracle.com>
+- Make headers package
+
+* Wed Jan 07 2004 Joel Becker <joel.becker at oracle.com>
+- Make open package.
+
+* Thu Dec 11 2003 Joel Becker <joel.becker at oracle.com>
+- Try at userspace thingie.
+
+* Wed Nov 12 2003 Joel Becker <joel.becker at oracle.com>
+- Start the ASM rename.
+
+* Thu Oct 30 2003 Joel Becker <joel.becker at oracle.com>
+- Created EL3 version
+
+* Mon Jun 23 2003 Joel Becker <joel.becker at oracle.com>
+- Added osm-lib bits
+
+* Fri Jun 20 2003 Joel Becker <joel.becker at oracle.com>
+- Initial RPM
+
Deleted: trunk/vendor/common/oracleasm-support.spec-generic.in
===================================================================
--- trunk/vendor/common/oracleasm-support.spec-generic.in 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/common/oracleasm-support.spec-generic.in 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,111 +0,0 @@
-#
-# Spec file for oracleasm
-#
-
-# Macros
-# This one is hardcoded because, well, it belongs there
-%define _prefix /usr
-# Because RPM is dumb
-%define _unpackaged_files_terminate_build 0
-
-# Turn on's and off's (summit and debug not used but added
-# for future proofing)
-
-
-
-Summary: The Oracle Automatic Storage Management support programs.
-Name: oracleasm-support
-Version: @DIST_VERSION@
-Release: @@PKG_VERSION@@
-Copyright: GPL
-Group: System Environment/Kernel
-Source: oracleasm- at DIST_VERSION@.tar.gz
-URL: http://oss.oracle.com/projects/oracleasm/
-Distribution: Oracle
-Vendor: Oracle Corporation
-Packager: Joel Becker <joel.becker at oracle.com>
-AutoReqProv: no
-
-
-BuildRoot: %{_tmppath}/oracleasm-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
-
-
-
-%description
-Tools to manage the Oracle Automatic Storage Management library driver
-
-
-%prep
-%setup -n oracleasm-%{version}
-
-
-%build
-./configure \
- --prefix=%{_prefix} \
- --exec-prefix=%{_exec_prefix} \
- --bindir=%{_bindir} \
- --sbindir=%{_sbindir} \
- --sysconfdir=%{_sysconfdir} \
- --datadir=%{_datadir} \
- --includedir=%{_includedir} \
- --libdir=%{_libdir} \
- --libexecdir=%{_libexecdir} \
- --localstatedir=%{_localstatedir} \
- --sharedstatedir=%{_sharedstatedir} \
- --mandir=%{_mandir} \
- --infodir=%{_infodir} \
- --sbindir=/usr/sbin
-
-cd tools
-make
-cd ..
-
-
-
-%install
-
-mkdir -p $RPM_BUILD_ROOT/etc/init.d
-cp -f vendor/common/oracleasm.init $RPM_BUILD_ROOT/etc/init.d/oracleasm
-mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
-cp -f vendor/common/oracleasm.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/oracleasm
-
-cd tools
-make DESTDIR="$RPM_BUILD_ROOT" install
-
-
-%clean
-rm -rf "$RPM_BUILD_ROOT"
-
-
-%post
-chkconfig oracleasm on
-
-%files
-%defattr(-,root,root)
-/usr/sbin/asmtool
-/usr/sbin/asmscan
-%attr(0755,root,root) /usr/lib/oracleasm/oracleasm_debug_link
-%attr(0755,root,root) /etc/init.d/oracleasm
-%config /etc/sysconfig/oracleasm
-
-
-
-%changelog
-* Wed Jan 07 2004 Joel Becker <joel.becker at oracle.com>
-- Make open package.
-
-* Thu Dec 11 2003 Joel Becker <joel.becker at oracle.com>
-- Try at userspace thingie.
-
-* Wed Nov 12 2003 Joel Becker <joel.becker at oracle.com>
-- Start the ASM rename.
-
-* Thu Oct 30 2003 Joel Becker <joel.becker at oracle.com>
-- Created EL3 version
-
-* Mon Jun 23 2003 Joel Becker <joel.becker at oracle.com>
-- Added osm-lib bits
-
-* Fri Jun 20 2003 Joel Becker <joel.becker at oracle.com>
-- Initial RPM
-
Deleted: trunk/vendor/common/oracleasm.init
===================================================================
--- trunk/vendor/common/oracleasm.init 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/common/oracleasm.init 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,933 +0,0 @@
-#! /bin/sh
-# init fragment for oracleasm
-#
-# chkconfig: 2345 29 20
-# description: Load OracleASM driver at system boot
-#
-### BEGIN INIT INFO
-# Provides: oracleasm
-# Required-Start: hwscan
-# Should-Start: ypbind
-# Required-Stop:
-# Default-Start: 2 3 5
-# Default-Stop:
-# Description: Load OCFS driver at system boot
-### END INIT INFO
-
-
-# Force LC_ALL=C
-export LC_ALL=C
-
-if [ -f /etc/redhat-release ]
-then
-. /etc/init.d/functions
-
-init_status()
-{
- return 0
-}
-
-success_status()
-{
- success
- echo
-}
-
-failure_status()
-{
- failure $1
- echo
-}
-
-exit_status()
-{
- exit $?
-}
-elif [ -f /etc/SuSE-release -o -f /etc/UnitedLinux-release ]
-then
-. /etc/rc.status
-
-init_status()
-{
- rc_reset
-}
-
-success_status()
-{
- /bin/true
- rc_status -v
-}
-
-failure_status()
-{
- /bin/false
- rc_status -v
-}
-
-exit_status()
-{
- rc_exit
-}
-else
-init_status()
-{
- return 0
-}
-
-success_status()
-{
- echo "OK"
- return 0
-}
-
-failure_status()
-{
- echo "Failed"
- return 0
-}
-
-exit_status()
-{
- exit $?
-}
-fi
-
-# Source configuration
-[ -f /etc/sysconfig/oracleasm ] && . /etc/sysconfig/oracleasm
-
-init_status
-
-KVER="`uname -r`"
-MODNAME="oracleasm"
-
-if [ -z "${ORACLE_ASMMANAGER}" ]
-then
- ORACLE_ASMMANAGER="/dev/oracleasm"
-fi
-
-
-
-#
-# if_fail()
-#
-# Evaluates return codes. If 0, prints "OK", if 1, prints "Failed"
-# and exits. If 2, status is "already done" and nothing is printed.
-# The rest of the functions in here all honor this convention.
-#
-if_fail()
-{
- RC="$1"
- REASON="$2"
- if [ "$RC" = "0" ]
- then
- success_status
- return
- elif [ "$RC" = "2" ]
- then
- return
- fi
- failure_status "${REASON}"
- exit 1
-}
-
-
-#
-# dev_create()
-#
-# Create $1
-# Returns 0 on success, 1 on error, 2 if it already exists.
-#
-dev_create()
-{
- if [ "$#" -lt "1" -o -z "$1" ]
- then
- echo "dev_create(): Requires an argument" >&2
- return 1
- fi
- DEV="$1"
- if [ -e "$DEV" ]
- then
- if [ -d "$DEV" ]
- then
- return 2
- fi
- echo "dev_create(): File $DEV is not a directory" >&2
- return 1
- fi
-
- echo -n "Creating $DEV mount point: "
- mkdir "$DEV" 2>/dev/null
- if [ $? != 0 ]
- then
- echo "Unable to create mount point $DEV" >&2
- return 1
- fi
- return 0
-}
-
-
-#
-# load_module()
-# Load a module
-#
-# 0 is success, 1 is error, 2 is already loaded
-#
-load_module()
-{
- if [ "$#" -lt "1" -o -z "$1" ]
- then
- echo "load_module(): Requires an argument" >&2
- return 1
- fi
- MODNAME="$1"
-
- MODOUT="`awk '$1 ~ /^'$MODNAME'$/{print $1;exit}' < /proc/modules 2>/dev/null`"
- if [ -n "$MODOUT" ]
- then
- return 2
- fi
-
- echo -n "Loading module \"$MODNAME\": "
- modprobe -s "$MODNAME"
- if [ "$?" != 0 ]
- then
- echo "Unable to load module \"$MODNAME\"" >&2
- return 1
- fi
-
- return 0
-}
-
-#
-# unload_module()
-# Unload a module
-#
-# 0 is success, 1 is error, 2 is not loaded
-#
-unload_module()
-{
- if [ "$#" -lt "1" -o -z "$1" ]
- then
- echo "unload_module(): Requires an argument" >&2
- return 1
- fi
- MODNAME="$1"
-
- MODOUT="`awk '$1 ~ /^'$MODNAME'$/{print $1,$3;exit}' < /proc/modules 2>/dev/null`"
- if [ -z "$MODOUT" ]
- then
- return 2
- fi
- case "$MODOUT" in
- $MODNAME\ 0)
- ;;
- $MODNAME\ *)
- return 2
- ;;
- *)
- echo -n "Invalid module parsing! "
- return 1
- ;;
- esac
-
- echo -n "Unloading module \"$MODNAME\": "
- modprobe -rs "$MODNAME"
- if [ "$?" != 0 ]
- then
- echo "Unable to unload module \"$MODNAME\"" >&2
- return 1
- fi
-
- return 0
-}
-
-
-#
-# mount_device()
-# Mount the /dev/oracleasm filesystem
-#
-# 0 is success, 1 is error, 2 is already mounted
-#
-mount_device()
-{
- if [ -z "$ORACLE_ASMMANAGER" ]
- then
- echo "mount_device(): No device specified!" >&2
- return 1
- fi
- ORACLE_ASMMANAGERSEARCH="`echo "$ORACLE_ASMMANAGER" | sed -e 's/\//\\\\\//g'`"
- MOUNTOUT="`awk '$2 ~ /^'$ORACLE_ASMMANAGERSEARCH'$/{print $2; exit}' < /proc/mounts 2>/dev/null`"
-
- if [ -n "$MOUNTOUT" ]
- then
- return 2
- fi
-
- echo -n "Mounting ASMlib driver filesystem: "
- mount $OPTS -t oracleasmfs oracleasmfs $ORACLE_ASMMANAGER
- if [ $? != 0 ]
- then
- echo "Unable to mount ASMlib driver filesystem" >&2
- return 1
- fi
-
- for i in ${ORACLE_ASMMANAGER}/.[a-z]*
- do
- if [ "$i" = ${ORACLE_ASMMANAGER}'/.[a-z]*' ]
- then
- break
- fi
- perm_disk "$i"
- if [ $? = 1 ]
- then
- echo "Unable to fix ASM driver permissions" >&2
- return 1
- fi
- done
-
- perm_disk ${ORACLE_ASMMANAGER}/iid
- if [ $? = 1 ]
- then
- echo "Unable to fix ASM driver permissions" >&2
- return 1
- fi
-
- chmod 0770 ${ORACLE_ASMMANAGER}/iid
- if [ $? = 1 ]
- then
- echo "Unable to fix ASM driver permissions" >&2
- return 1
- fi
-
-
- return 0
-}
-
-
-#
-# unmount_device()
-# Unmount the /dev/oracleasm filesystem
-#
-# 0 is success, 1 is error, 2 is not mounted
-#
-unmount_device()
-{
- if [ -z "$ORACLE_ASMMANAGER" ]
- then
- echo "mount_device(): No device specified!" >&2
- return 1
- fi
- ORACLE_ASMMANAGERSEARCH="`echo "$ORACLE_ASMMANAGER" | sed -e 's/\//\\\\\//g'`"
- MOUNTOUT="`awk '$2 ~ /^'$ORACLE_ASMMANAGERSEARCH'$/{print $2; exit}' < /proc/mounts 2>/dev/null`"
-
- if [ -z "$MOUNTOUT" ]
- then
- return 2
- fi
-
- echo -n "Unmounting ASMlib driver filesystem: "
- umount $ORACLE_ASMMANAGER
- if [ $? != 0 ]
- then
- echo "Unable to unmount ASMlib driver filesystem" >&2
- return 1
- fi
-
- return 0
-}
-
-
-#
-# write_sysconfig()
-#
-# Writes the system configuration out
-#
-write_sysconfig()
-{
- echo -n "Writing Oracle ASM library driver configuration: "
- cat >/etc/sysconfig/oracleasm <<EOF
-#
-# This is a configuration file for automatic loading of the Oracle
-# Automatic Storage Management library kernel driver. It is generated
-# By running /etc/init.d/oracleasm configure. Please use that method
-# to modify this file
-#
-
-# ORACLEASM_ENABELED: 'true' means to load the driver on boot.
-ORACLEASM_ENABLED=${ORACLEASM_ENABLED:-false}
-
-# ORACLEASM_UID: Default user owning the $ORACLE_ASMMANAGER mount point.
-ORACLEASM_UID=${ORACLEASM_UID}
-
-# ORACLEASM_GID: Default group owning the $ORACLE_ASMMANAGER mount point.
-ORACLEASM_GID=${ORACLEASM_GID}
-
-# ORACLEASM_SCANBOOT: 'true' means fix disk perms on boot
-ORACLEASM_SCANBOOT=${ORACLEASM_SCANBOOT}
-
-# ORACLEASM_CLEARBOOT: 'true' means clean old disk perms on boot
-ORACLEASM_CLEARBOOT=${ORACLEASM_CLEARBOOT}
-
-# ORACLEASM_SCANORDER: Matching patterns to order disk scanning
-ORACLEASM_SCANORDER=${ORACLEASM_SCANORDER}
-
-# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan
-ORACLEASM_SCANEXCLUDE=${ORACLEASM_SCANEXCLUDE}
-
-EOF
-
- if [ $? != 0 ]
- then
- return 1
- fi
- return 0
-}
-
-
-#
-# configure_ask()
-#
-# Ask configuration questions, setting the shell vars.
-#
-configure_ask()
-{
- cat <<EOF
-Configuring the Oracle ASM library driver.
-
-This will configure the on-boot properties of the Oracle ASM library
-driver. The following questions will determine whether the driver is
-loaded on boot and what permissions it will have. The current values
-will be shown in brackets ('[]'). Hitting <ENTER> without typing an
-answer will keep that current value. Ctrl-C will abort.
-
-EOF
-
- while :
- do
- echo -n "Default user to own the driver interface [$ORACLEASM_UID]: "
- read LINE
- case "$LINE" in
- "")
- break
- ;;
- *[^a-zA-Z0-9]*)
- echo "Invalid user: $LINE" >&2
- ;;
- *)
- ORACLEASM_UID=$LINE
- break
- ;;
- esac
- done
-
- while :
- do
- echo -n "Default group to own the driver interface [$ORACLEASM_GID]: "
- read LINE
- case "$LINE" in
- "")
- break
- ;;
- *[^a-zA-Z0-9]*)
- echo "Invalid group: $LINE" >&2
- ;;
- *)
- ORACLEASM_GID=$LINE
- break
- ;;
- esac
- done
-
- while :
- do
- if [ "$ORACLEASM_ENABLED" = "true" ]
- then
- CUR=y
- else
- CUR=n
- fi
- echo -n "Start Oracle ASM library driver on boot (y/n) [$CUR]: "
- read LINE
- case "$LINE" in
- "")
- break
- ;;
- y|Y)
- ORACLEASM_ENABLED=true
- break
- ;;
- n|N)
- ORACLEASM_ENABLED=false
- break
- ;;
- *)
- echo "Invalid response: $LINE" >&2
- ;;
- esac
- done
-
- while :
- do
- if [ -z "$ORACLEASM_SCANBOOT" ]
- then
- ORACLEASM_SCANBOOT=true
- fi
- if [ "${ORACLEASM_SCANBOOT}" = "true" ]
- then
- CUR=y
- else
- CUR=n
- fi
- echo -n "Fix permissions of Oracle ASM disks on boot (y/n) [$CUR]: "
- read LINE
- case "$LINE" in
- "")
- break
- ;;
- y|Y)
- ORACLEASM_SCANBOOT=true
- break
- ;;
- n|N)
- ORACLEASM_SCANBOOT=false
- break
- ;;
- *)
- echo "Invalid response: $LINE" >&2
- ;;
- esac
- done
-}
-
-
-#
-# upper_disk()
-# Make a disk name uppercase
-#
-upper_disk()
-{
- case "$1" in
- */*)
- # Don't upper pathnames
- echo "$1"
- ;;
- *)
- echo "$1" | tr '[a-z]' '[A-Z]'
- ;;
- esac
-}
-
-
-#
-# make_disk()
-# Creates an ASM disk.
-#
-# Returns 0 on success, 1 on error, 2 on already marked.
-#
-make_disk()
-{
- if [ "$#" -lt "2" -o -z "$1" -o -z "$2" ]
- then
- echo "make_disk(): Requires two arguments" >&2
- return 1
- fi
- LABEL="$1"
- DISKNAME="$2"
- if [ ! -z "$3" ]
- then
- MARK="-a mark=$3"
- fi
-
- OUTPUT="`asmtool -C -l "${ORACLE_ASMMANAGER}" -n "${LABEL}" -s "${DISKNAME}" $MARK 2>&1`"
- if [ $? != 0 ]
- then
- echo -n "Marking disk \"$DISKNAME\" as an ASM disk: "
- echo "$OUTPUT"
- return 1
- fi
- case "$OUTPUT" in
- *is\ marked*)
- return 2
- ;;
- *)
- ;;
- esac
- echo -n "Marking disk \"$DISKNAME\" as an ASM disk: "
- return 0
-}
-
-
-#
-# relabel_disk()
-# Relabels an ASM disk.
-#
-# Returns 0 on success, 1 on error.
-#
-relabel_disk()
-{
- if [ "$#" -lt "2" -o -z "$1" -o -z "$2" ]
- then
- echo "relabel_disk(): Requires two arguments" >&2
- return 1
- fi
- OLDDISK="$1"
- NEWLABEL="$2"
- FORCE="$3"
-
- if [ -z "$FORCE" ]
- then
- REDIR=''
- else
- REDIR='2>&1'
- fi
- OUTPUT="`asmtool -H -l "${ORACLE_ASMMANAGER}" -n "${OLDDISK}" -a "label=${NEWLABEL}" $FORCE $REDIR`"
- if [ $? != 0 ]
- then
- if [ -z "$FORCE" ]
- then
- echo "If you really wish to change the label, rerun with the force-renamedisk command." >&2
- fi
- echo -n "Renaming disk \"$OLDDISK\" to \"$NEWLABEL\": "
- return 1
- fi
- echo -n "Renaming disk \"$OLDDISK\" to \"$NEWLABEL\": "
- return 0
-}
-
-
-#
-# remove_disk()
-# Removes the ASM disk.
-#
-# Returns 0 on success, 1 on error, 2 on not there.
-#
-remove_disk()
-{
- if [ "$#" -lt "1" -o -z "$1" ]
- then
- echo "remove_disk(): Requires an argument" >&2
- return 1
- fi
- DISKNAME="$1"
-
- OUTPUT="`asmtool -D -l "${ORACLE_ASMMANAGER}" -n "${DISKNAME}" 2>&1`"
- if [ $? != 0 ]
- then
- echo -n "Removing ASM disk \"$DISKNAME\": "
- return 1
- fi
- case "$OUTPUT" in
- *not\ marked*)
- return 2
- ;;
- *)
- ;;
- esac
- echo -n "Removing ASM disk \"$DISKNAME\": "
- return 0
-}
-
-
-#
-# check_disk()
-# Check if the disk is an ASM disk
-#
-check_disk()
-{
- if [ "$#" -lt "1" -o -z "$1" ]
- then
- echo "check_disk(): Requires an argument" >&2
- return 1
- fi
- DISKNAME="$1"
-
- asmtool -I -l "$ORACLE_ASMMANAGER" -n "$DISKNAME" -a label 2>&1| sed -e 's/^asmtool: //'
-}
-
-
-#
-# perm_disk()
-# Set the appropriate permissions on a disk.
-#
-# Returns 0 on success, 1 on error, 2 on already correct
-#
-perm_disk()
-{
- if [ "$#" -lt "1" -o -z "$1" ]
- then
- echo "perm_disk(): Requires an argument" >&2
- return 1
- fi
- DISKNAME="$1"
-
- OUTPUT="`ls -ld "${DISKNAME}" 2>/dev/null`"
- if [ $? != 0 ]
- then
- echo -n "Checking ownership of disk \"${DISKNAME}\": "
- return 1
- fi
- OUID="`echo "$OUTPUT" | awk '{print $3}'`"
- OGID="`echo "$OUTPUT" | awk '{print $4}'`"
-
- if [ "$OUID" = "${ORACLEASM_UID:-root}" -a "$OGID" = "${ORACLEASM_GID:-root}" ]
- then
- return 2
- fi
-
- chown "${ORACLEASM_UID:-root}:${ORACLEASM_GID:-root}" "$DISKNAME"
- if [ $? != 0 ]
- then
- return 1
- fi
-
- chmod 0660 "$DISKNAME"
- if [ $? != 0 ]
- then
- return 1
- fi
-
- return 0
-}
-
-
-
-
-#
-# scan_disks()
-# Scan disks to find any ASM disks and perhaps fix their ownership.
-#
-# Returns 0 on success, 1 on error, 2 on disabled.
-#
-scan_disks()
-{
- if [ "$ORACLEASM_SCANBOOT" != "true" ]
- then
- return 2
- fi
-
- echo -n "Scanning system for ASM disks: "
- RC=0
-
- SCANARGS=
- for d in ${ORACLEASM_SCANORDER}
- do
- SCANARGS="${SCANARGS} -s $d"
- done
-
- for d in ${ORACLEASM_SCANEXCLUDE}
- do
- SCANARGS="${SCANARGS} -x $d"
- done
-
- OUTPUT="`asmscan -l "${ORACLE_ASMMANAGER}" ${SCANARGS} 2>/dev/null`"
- if [ $? != 0 ]
- then
- return 1
- fi
-
- ls -1 "${ORACLE_ASMMANAGER}/disks" | while read LINE
- do
- perm_disk "${ORACLE_ASMMANAGER}/disks/${LINE}"
- if [ $? = 1 ]
- then
- echo "Unable to fix permissions on ASM disk \"$LINE\"" >&2
- return 1
- fi
- done
-
- return 0
-}
-
-configure()
-{
- configure_ask
- write_sysconfig
- if_fail $? "Unable to write the driver configuration"
-}
-
-
-scandisks()
-{
- scan_disks
- if_fail "$?" "Unable to scan for ASM disks"
-}
-
-
-start()
-{
- dev_create "${ORACLE_ASMMANAGER}"
- if_fail "$?" "Unable to create ${ORACLE_ASMMANAGER}"
-
- if [ "$ORACLEASM_ENABLED" != "true" ]
- then
- exit 0
- fi
-
- load_module "${MODNAME}"
- if_fail "$?" "Unable to load the ASMlib driver module"
-
- mount_device
- if_fail "$?" "Unable to mount the ASMlib driver filesystem"
-
- scandisks
-}
-
-
-stop()
-{
- unmount_device
- if_fail "$?" "Unable to unmount the ASMlib driver filesystem"
-
- unload_module oracleasm
- if_fail "$?" "Unable to unload the ASM library driver"
-}
-
-
-
-case "$1" in
- start)
- start
- ;;
-
- status)
- echo -n $"Checking if ASM is loaded: "
- grep '^oracleasm ' /proc/modules >/dev/null 2>&1
- if_fail $?
-
- echo -n $"Checking if $ORACLE_ASMMANAGER is mounted: "
- ORACLE_ASMMANAGERSEARCH="`echo $ORACLE_ASMMANAGER | sed -e 's/\//\\\\\//g'`"
- grep "^oracleasmfs $ORACLE_ASMMANAGERSEARCH oracleasmfs" /proc/mounts >/dev/null 2>&1
- if_fail $?
-
- exit 0
- ;;
-
- configure)
- configure
- if [ "$ORACLEASM_ENABLED" = "true" ]
- then
- start
- else
- stop
- fi
- ;;
-
- enable)
- ORACLEASM_ENABLED=true
- write_sysconfig
- if_fail $? "Unable to write the driver configuration"
- start
- ;;
-
- disable)
- ORACLEASM_ENABLED=false
- write_sysconfig
- if_fail $? "Unable to write the driver configuration"
- stop
- ;;
-
- createdisk)
- if [ -z "$2" -o -z "$3" ]
- then
- echo "Action \"createdisk\" requires two arguments" >&2
- exit 1
- fi
- UPDISK="`upper_disk "$2"`"
- make_disk "$UPDISK" "$3"
- if [ $? = 1 ]
- then
- if_fail 1 "Unable to create disk \"$UPDISK\""
- fi
- perm_disk "${ORACLE_ASMMANAGER}/disks/$UPDISK"
- if_fail $? "Unable to change ownership of disk \"$UPDISK\""
- ;;
-
- deletedisk)
- if [ -z "$2" ]
- then
- echo "Action \"deletedisk\" requires an argument" >&2
- exit 1
- fi
- UPDISK="`upper_disk "$2"`"
- remove_disk "$UPDISK"
- if_fail $? "Unable to delete disk \"$UPDISK\""
- ;;
-
- renamedisk)
- if [ -z "$2" -o -z "$3" ]
- then
- echo "Action \"renamedisk\" requires two arguments" >&2
- exit 1
- fi
- OLDDISK="$2"
- NEWDISK="`upper_disk "$3"`"
- relabel_disk "$OLDDISK" "$NEWDISK"
- # We know this will error via asmtool
- if_fail 1 "Unable to rename disk \"$OLDDISK\"" >&2
- ;;
-
- force-renamedisk)
- if [ -z "$2" -o -z "$3" ]
- then
- echo "Action \"renamedisk\" requires two arguments" >&2
- exit 1
- fi
- OLDDISK="$2"
- NEWDISK="`upper_disk "$3"`"
- relabel_disk "$OLDDISK" "$NEWDISK" "-a force=yes"
- if [ $? = 1 ]
- then
- if_fail 1 "Unable to rename disk \"$OLDDISK\"" >&2
- fi
- perm_disk "${ORACLE_ASMMANAGER}/disks/$NEWDISK"
- if_fail $? "Unable to change ownership of disk \"$NEWDISK\""
- ;;
-
- listdisks)
- if [ -d "${ORACLE_ASMMANAGER}/disks/" ]
- then
- ls -1 "${ORACLE_ASMMANAGER}/disks/"
- fi
- ;;
-
- querydisk)
- if [ -z "$2" ]
- then
- echo "Action \"querydisk\" requires an argument" >&2
- exit 1
- fi
- shift
- for d in "$@"
- do
- case "$d" in
- */*)
- check_disk "$d"
- ;;
- *)
- UPDISK="`upper_disk "$d"`"
- check_disk "$UPDISK"
- ;;
- esac
- done
- ;;
-
- scandisks)
- scandisks
- ;;
-
- stop)
- stop
- ;;
-
- restart)
- stop
- start
- ;;
-
- *)
- echo "Usage: $0 {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}"
- exit 1
-esac
-
-exit 0
-
Deleted: trunk/vendor/common/oracleasm.sysconfig
===================================================================
--- trunk/vendor/common/oracleasm.sysconfig 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/common/oracleasm.sysconfig 2006-07-07 01:42:43 UTC (rev 349)
@@ -1,22 +0,0 @@
-#
-# This is a configuration file for automatic loading of the Oracle
-# Automatic Storage Management library kernel driver. It is generated
-# By running /etc/init.d/oracleasm configure. Please use that method
-# to modify this file
-#
-
-# ORACLEASM_ENABELED: 'true' means to load the driver on boot.
-ORACLEASM_ENABLED=false
-
-# ORACLEASM_UID: Default UID owning the /dev/oracleasm mount point.
-ORACLEASM_UID=
-
-# ORACLEASM_GID: Default GID owning the /dev/oracleasm mount point.
-ORACLEASM_GID=
-
-# ORACLEASM_SCANBOOT: 'true' means fix disk perms on boot
-ORACLEASM_SCANBOOT=true
-
-# ORACLEASM_CLEARBOOT: 'true' means clean old disk perms on boot
-ORACLEASM_CLEARBOOT=true
-
Modified: trunk/vendor/rhas21/Vendor.make
===================================================================
--- trunk/vendor/rhas21/Vendor.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/rhas21/Vendor.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -4,6 +4,8 @@
TOOLSARCH = $(shell $(TOPDIR)/vendor/rhas21/rpmarch.guess tools $(TOPDIR))
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = kernel-headers
include $(TOPDIR)/vendor/common/Vendor.make
-packages: support_rpm
+packages: headers_rpm
Modified: trunk/vendor/rhel3/Vendor.make
===================================================================
--- trunk/vendor/rhel3/Vendor.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/rhel3/Vendor.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -4,6 +4,8 @@
TOOLSARCH = $(shell $(TOPDIR)/vendor/rhel3/rpmarch.guess tools $(TOPDIR))
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = glibc-kernheaders
include $(TOPDIR)/vendor/common/Vendor.make
-packages: support_rpm
+packages: headers_rpm
Modified: trunk/vendor/rhel4/Vendor.make
===================================================================
--- trunk/vendor/rhel4/Vendor.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/rhel4/Vendor.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -26,6 +26,8 @@
rpmbuild --rebuild $(MODULEARCH) "oracleasm-$(patsubst rhel4_%_rpm,%,$@)-$(DIST_VERSION)-$(PKG_VERSION).src.rpm"
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = glibc-kernheaders
include $(TOPDIR)/vendor/common/Vendor.make
-packages: $(shell $(TOPDIR)/vendor/rhel4/kernel.guess targets) support_rpm
+packages: $(shell $(TOPDIR)/vendor/rhel4/kernel.guess targets) headers_rpm
Modified: trunk/vendor/sles8/Vendor.make
===================================================================
--- trunk/vendor/sles8/Vendor.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/sles8/Vendor.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -4,7 +4,8 @@
TOOLSARCH = $(shell $(TOPDIR)/vendor/sles8/rpmarch.guess tools $(TOPDIR))
-
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = glibc-devel
include $(TOPDIR)/vendor/common/Vendor.make
-packages: support_rpm
+packages: headers_rpm
Modified: trunk/vendor/sles9/Vendor.make
===================================================================
--- trunk/vendor/sles9/Vendor.make 2006-06-30 22:47:32 UTC (rev 348)
+++ trunk/vendor/sles9/Vendor.make 2006-07-07 01:42:43 UTC (rev 349)
@@ -19,6 +19,8 @@
rpmbuild --rebuild $(MODULEARCH) "oracleasm-$(patsubst sles9_%_rpm,%,$@)-$(DIST_VERSION)-$(PKG_VERSION).src.rpm"
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = glibc-devel
include $(TOPDIR)/vendor/common/Vendor.make
-packages: $(shell $(TOPDIR)/vendor/sles9/kernel.guess targets) support_rpm
+packages: $(shell $(TOPDIR)/vendor/sles9/kernel.guess targets) headers_rpm
More information about the Oracleasm-commits
mailing list