[Oracleasm-commits] jlbec commits r282 - in branches/extended: .
include/linux kernel tools vendor/common vendor/redhat vendor/suse
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Feb 23 13:41:58 CST 2005
Author: jlbec
Date: 2005-02-23 13:41:56 -0600 (Wed, 23 Feb 2005)
New Revision: 282
Added:
branches/extended/include/linux/asmmanager_compat.h
branches/extended/kernel/transaction_file.c
branches/extended/kernel/transaction_file.h
branches/extended/rpmarch.guess
branches/extended/vendor/common/oracleasm.init
Removed:
branches/extended/vendor/common/oracleasm.init.functions
branches/extended/vendor/redhat/oracleasm-2.4.21-EL.spec.in
branches/extended/vendor/redhat/oracleasm-2.4.9-e.spec.in
branches/extended/vendor/redhat/oracleasm.init.in
branches/extended/vendor/suse/oracleasm.init.in
Modified:
branches/extended/Config.make.in
branches/extended/Makefile
branches/extended/Postamble.make
branches/extended/Preamble.make
branches/extended/README
branches/extended/README.bugs
branches/extended/config.guess
branches/extended/config.sub
branches/extended/configure.in
branches/extended/include/linux/Makefile
branches/extended/include/linux/asmabi.h
branches/extended/include/linux/asmmanager.h
branches/extended/kernel/Makefile
branches/extended/kernel/oracleasm.c
branches/extended/tools/
branches/extended/tools/Makefile
branches/extended/tools/asmscan.c
branches/extended/tools/asmtool.c
branches/extended/vendor/common/Makefile
branches/extended/vendor/common/oracleasm-support.spec.in
branches/extended/vendor/redhat/Makefile
branches/extended/vendor/suse/Makefile
branches/extended/vendor/suse/oracleasm-2.6.5.spec-generic.in
Log:
o Merge changes 243:267 from the port-2.6 branch
Modified: branches/extended/Config.make.in
===================================================================
--- branches/extended/Config.make.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/Config.make.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -46,12 +46,10 @@
USERM64 = @USERM64@
MCMODEL = @MCMODEL@
-TOOLSARCH = @TOOLSARCH@
-MODULEARCH = @MODULEARCH@
-
KERNELDIR = @KERNELDIR@
KERNELINC = $(KERNELDIR)/include
KERNELVER = @KERNELVER@
+BUILD_DRIVER = @BUILD_DRIVER@
MODULEDIR = @MODULEDIR@
MODVERSIONS = @MODVERSIONS@
Modified: branches/extended/Makefile
===================================================================
--- branches/extended/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -8,6 +8,8 @@
#
include $(TOPDIR)/Preamble.make
+TOOLSARCH = $(shell $(TOPDIR)/rpmarch.guess tools $(TOPDIR))
+MODULEARCH = $(shell $(TOPDIR)/rpmarch.guess module $(TOPDIR))
#
# Add any directories to recurse into via the SUBDIRS variable.
@@ -29,7 +31,8 @@
configure \
configure.in \
install-sh \
- mkinstalldirs
+ mkinstalldirs \
+ rpmarch.guess
#
@@ -42,7 +45,7 @@
support_srpm: $(TOPDIR)/oracleasm-support-$(DIST_VERSION)-$(RPM_VERSION).src.rpm
support_rpm: support_srpm
- $(RPMBUILD) --rebuild --target $(TOOLSARCH) "oracleasm-support-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+ $(RPMBUILD) --rebuild $(TOOLSARCH) "oracleasm-support-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
#
@@ -59,7 +62,7 @@
$(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" $(TOPDIR)/vendor/suse/oracleasm-2.6.5-$(patsubst sles9_%_srpm,%,$@).spec
sles9_%_rpm: sles9_%_srpm
- $(RPMBUILD) --rebuild --target $(MODULEARCH) "oracleasm-2.6.5-$(patsubst sles9_%_rpm,%,$@)-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+ $(RPMBUILD) --rebuild $(MODULEARCH) "oracleasm-2.6.5-$(patsubst sles9_%_rpm,%,$@)-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
#
Modified: branches/extended/Postamble.make
===================================================================
--- branches/extended/Postamble.make 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/Postamble.make 2005-02-23 19:41:56 UTC (rev 282)
@@ -37,7 +37,7 @@
LOCAL_CPPFLAGS = $($(subst /,_,$(basename $@))_CPPFLAGS)
%.o: %.c
- $(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(INCLUDES) $(DEFINES) $(VERMAGIC) -o $@ -c $<
+ $(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(INCLUDES) $(DEFINES) $(VERMAGIC) $(CDEPFLAGS) -o $@ -c $<
%.p: %.c
$(CC) $(CFLAGS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(INCLUDES) $(DEFINES) $(VERMAGIC) -E -o $@ -c $<
@@ -54,7 +54,7 @@
$(MAKE) -C $@
.PHONY: all-rules
-all-rules: subdirs $(LIBRARIES) $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(NOINST_PROGRAMS) $(MODULES) $(MANS) $(ALL_RULES)
+all-rules: subdirs $(LIBRARIES) $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(UNINST_PROGRAMS) $(MODULES) $(MANS) $(ALL_RULES)
INSTALL_SUBDIRS = $(addsuffix -install,$(SUBDIRS))
@@ -121,7 +121,7 @@
$(MAKE) -C $(subst -clean,,$@) clean
clean: clean-subdirs $(CLEAN_RULES)
- rm -f *.o *.p core $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(LIBRARIES) $(CLEAN_FILES) stamp-md5
+ rm -f *.o *.p .*.d core $(BIN_PROGRAMS) $(SBIN_PROGRAMS) $(LIBRARIES) $(CLEAN_FILE) stamp-md5
DIST_SUBDIRS = $(addsuffix -dist,$(SUBDIRS))
@@ -146,7 +146,7 @@
done
dist-all: dist-copy dist-subdirs
-
+
dist-bye:
-rm -rf $(DIST_TOPDIR)
@@ -160,9 +160,12 @@
distclean: clean
rm -f Config.make config.status config.cache config.log
+LOCAL_DFILES := $(wildcard .*.d)
+ifneq ($(LOCAL_DFILES),)
+.PHONY: $(LOCAL_DFILES)
+-include $(LOCAL_DFILES)
+endif
+
ifeq (Cscope.make,$(wildcard Cscope.make))
include Cscope.make
endif
-
-
-
Modified: branches/extended/Preamble.make
===================================================================
--- branches/extended/Preamble.make 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/Preamble.make 2005-02-23 19:41:56 UTC (rev 282)
@@ -12,7 +12,6 @@
MANS =
ALL_RULES =
-
INSTALL_RULES =
CLEAN_FILES =
@@ -26,6 +25,8 @@
CFLAGS += $($(subst /,_,$(basename $@))_CFLAGS)
CFLAGS += -pipe
+# protect with configure?
+CDEPFLAGS = -MD -MP -MF $(@D)/.$(basename $(@F)).d
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
Modified: branches/extended/README
===================================================================
--- branches/extended/README 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/README 2005-02-23 19:41:56 UTC (rev 282)
@@ -10,16 +10,15 @@
Second things later.
- Building ASMlib requires a quick run of the Configure script
+ 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 the kernels from Red Hat
-Advanced Server 2.1 (2.4.9-e.3+). So, your path is likely to look like
-/usr/src/linux-2.4.9-e.3/include or so. You then can run a make.
+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.o
+ # insmod kernel/oracleasm.ko
# mount -t oracleasmfs oracleasmfs /dev/oracleasm
Next, you have to mark disks as candidates for ASM. asmtool is
Modified: branches/extended/README.bugs
===================================================================
--- branches/extended/README.bugs 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/README.bugs 2005-02-23 19:41:56 UTC (rev 282)
@@ -2,6 +2,19 @@
Bugs fixed by release.
+oracleasm 2.0.0
+---------------
+3919995: oracleasm listdisks should also correlate with the devices
+4113520: ASMLib FOR Linux allows use of disk without a partition table
+
+oracleasm 1.0.3
+---------------
+3843206: ASM_INIT_INSTALL while trying to load generic Linux ASMLib
+3797446: Linux 10103 patch TC3, ASM RBAL process hanging, ASMLib
+3843975: ASMLib Linux, can't run querydisk on disk devices
+3843989: ASMLib Linux, unable to discover cciss disks, unable to discover md disks
+3860229: Linux ASMLib, ASM fails to start on boot, Oracle user is in NIS
+
oracleasm 1.0.2
---------------
######: Unable to change a raw device ASM disk to use ASMLib
Modified: branches/extended/config.guess
===================================================================
--- branches/extended/config.guess 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/config.guess 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-timestamp='2003-10-07'
+timestamp='2004-11-12'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -197,15 +197,21 @@
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
+ amd64:OpenBSD:*:*)
+ echo x86_64-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ cats:OpenBSD:*:*)
+ echo arm-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
+ luna88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -221,25 +227,33 @@
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ echo mips64-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:MirBSD:*:*)
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit 0 ;;
alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
+ case $UNAME_RELEASE in
+ *4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
@@ -277,15 +291,13 @@
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
+ # A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -307,6 +319,12 @@
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit 0 ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
@@ -327,7 +345,7 @@
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
@@ -399,6 +417,9 @@
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -734,7 +755,7 @@
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
@@ -742,6 +763,11 @@
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
@@ -752,21 +778,7 @@
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -815,9 +827,18 @@
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit 0 ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit 0 ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
@@ -986,6 +1007,9 @@
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
@@ -1055,9 +1079,9 @@
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
- M68*:*:R3V[567]*:*)
+ M68*:*:R3V[5678]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1155,9 +1179,10 @@
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
- case `uname -p` in
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
@@ -1172,7 +1197,7 @@
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
+ NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1216,6 +1241,19 @@
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms && exit 0 ;;
+ I*) echo ia64-dec-vms && exit 0 ;;
+ V*) echo vax-dec-vms && exit 0 ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
Modified: branches/extended/config.sub
===================================================================
--- branches/extended/config.sub 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/config.sub 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-timestamp='2003-10-07'
+timestamp='2004-11-30'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -70,7 +70,7 @@
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -118,7 +118,8 @@
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -144,7 +145,7 @@
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
+ -apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@@ -236,7 +237,7 @@
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
+ | m32r | m32rle | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -261,12 +262,12 @@
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xscale | xstormy16 | xtensa \
+ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -299,7 +300,7 @@
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
+ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
@@ -307,7 +308,7 @@
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
- | m32r-* \
+ | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -325,8 +326,9 @@
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
+ | mmix-* \
| msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
@@ -335,14 +337,14 @@
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
@@ -362,6 +364,9 @@
basic_machine=a29k-amd
os=-udi
;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -379,6 +384,9 @@
amd64)
basic_machine=x86_64-pc
;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -438,12 +446,27 @@
basic_machine=j90-cray
os=-unicos
;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16c)
+ basic_machine=cr16c-unknown
+ os=-elf
+ ;;
crds | unos)
basic_machine=m68k-crds
;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -466,6 +489,10 @@
basic_machine=m88k-motorola
os=-sysv3
;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -644,10 +671,6 @@
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -728,10 +751,6 @@
np1)
basic_machine=np1-gould
;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -743,6 +762,10 @@
basic_machine=or32-unknown
os=-coff
;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
@@ -963,6 +986,10 @@
tower | tower-32)
basic_machine=m68k-ncr
;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
udi29k)
basic_machine=a29k-amd
os=-udi
@@ -1006,6 +1033,10 @@
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1036,6 +1067,9 @@
romp)
basic_machine=romp-ibm
;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1058,7 +1092,7 @@
sh64)
basic_machine=sh64-unknown
;;
- sparc | sparcv9 | sparcv9b)
+ sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -1131,19 +1165,20 @@
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1182,6 +1217,9 @@
-opened*)
os=-openedition
;;
+ -os400*)
+ os=-os400
+ ;;
-wince*)
os=-wince
;;
@@ -1203,6 +1241,9 @@
-atheos*)
os=-atheos
;;
+ -syllable*)
+ os=-syllable
+ ;;
-386bsd)
os=-bsd
;;
@@ -1225,6 +1266,9 @@
-sinix*)
os=-sysv4
;;
+ -tpf*)
+ os=-tpf
+ ;;
-triton*)
os=-sysv3
;;
@@ -1261,6 +1305,9 @@
-kaos*)
os=-kaos
;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
-none)
;;
*)
@@ -1341,6 +1388,9 @@
*-ibm)
os=-aix
;;
+ *-knuth)
+ os=-mmixware
+ ;;
*-wec)
os=-proelf
;;
@@ -1473,9 +1523,15 @@
-mvs* | -opened*)
vendor=ibm
;;
+ -os400*)
+ vendor=ibm
+ ;;
-ptx*)
vendor=sequent
;;
+ -tpf*)
+ vendor=ibm
+ ;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
Modified: branches/extended/configure.in
===================================================================
--- branches/extended/configure.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/configure.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -17,7 +17,7 @@
#
MAJOR_VERSION=1
MINOR_VERSION=0
-MICRO_VERSION=91
+MICRO_VERSION=94
INTERFACE_AGE=0
BINARY_AGE=0
VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}"
@@ -162,6 +162,33 @@
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $M64"
+AC_CHECK_SIZEOF(unsigned long)
+
+AC_MSG_CHECKING([for kernel module symbol versions])
+AC_EGREP_CPP(kernel_has_modversions,
+[#include <linux/autoconf.h>
+#ifdef CONFIG_MODVERSIONS
+ kernel_has_modversions
+#endif
+}], modversions=yes, modversions=no)
+AC_MSG_RESULT($modversions)
+
+MODVERSIONS=
+if test "x$modversions" = "xyes"; then
+ MODVERSIONS="-include \$(KERNELINC)/linux/modversions.h -DMODVERSIONS"
+fi
+AC_SUBST(MODVERSIONS)
+
+CPPFLAGS="$saved_CPPFLAGS"
+CFLAGS="$saved_CFLAGS"
+
+AC_MSG_CHECKING(for directory for kernel modules)
+AC_ARG_WITH(moddir, [ --with-moddir=/path Path to where modules should be installed [/lib/modules/<KVER>/fs]], moddir="$withval", moddir="/lib/modules/$kversion/kernel/fs")
+AC_MSG_RESULT($moddir)
+
+MODULEDIR=$moddir
+AC_SUBST(MODULEDIR)
+
AC_MSG_CHECKING(for kernel version)
rm -f conf.kvertest
AC_TRY_RUN([
@@ -183,66 +210,26 @@
return 1;
#endif
}],kversion=`cat conf.kvertest`, kversion="none")
-AC_MSG_RESULT($kversion)
rm -f conf.kvertest
-if test "x$kversion" = "xnone"; then
- AC_MSG_ERROR([Could not determine kernel version.])
-fi
-
+BUILD_DRIVER=
case "$kversion" in
2.6.*)
+ AC_MSG_RESULT($kversion)
+ BUILD_DRIVER=yes
;;
+ none)
+ AC_MSG_RESULT([Could not determine kernel version, disabling driver build])
+ ;;
*)
- AC_MSG_ERROR([This module only supports kernel version 2.6.x])
+ AC_MSG_RESULT([This module only supports kernel version 2.6.x, disabling driver build])
;;
esac
+AC_SUBST(BUILD_DRIVER)
KERNELVER=$kversion
AC_SUBST(KERNELVER)
-AC_MSG_CHECKING([for Red Hat kernel])
-AC_EGREP_CPP(kernel_is_Red_Hat,
-[#include <linux/autoconf.h>
-#ifdef RED_HAT_LINUX_KERNEL
- kernel_is_Red_Hat
-#endif
-}], rhkernel=yes, rhkernel=no)
-AC_MSG_RESULT($rhkernel)
-
-KVER=
-if test "x$rhkernel" = "xyes"; then
- KVER=smp
-fi
-AC_SUBST(KVER)
-
-AC_CHECK_SIZEOF(unsigned long)
-
-AC_MSG_CHECKING([for kernel module symbol versions])
-AC_EGREP_CPP(kernel_has_modversions,
-[#include <linux/autoconf.h>
-#ifdef CONFIG_MODVERSIONS
- kernel_has_modversions
-#endif
-}], modversions=yes, modversions=no)
-AC_MSG_RESULT($modversions)
-
-MODVERSIONS=
-if test "x$modversions" = "xyes"; then
- MODVERSIONS="-include \$(KERNELINC)/linux/modversions.h -DMODVERSIONS"
-fi
-AC_SUBST(MODVERSIONS)
-
-CPPFLAGS="$saved_CPPFLAGS"
-CFLAGS="$saved_CFLAGS"
-
-AC_MSG_CHECKING(for directory for kernel modules)
-AC_ARG_WITH(moddir, [ --with-moddir=/path Path to where modules should be installed [/lib/modules/<KVER>/fs]], moddir="$withval", moddir="/lib/modules/$kversion/kernel/fs")
-AC_MSG_RESULT($moddir)
-
-MODULEDIR=$moddir
-AC_SUBST(MODULEDIR)
-
AC_MSG_CHECKING(for gcc include path)
gccdir="`$CC -print-search-dirs | sed -n 's/^install: \(.*\)/\1/p'`include"
if test -z "$gccdir"; then
@@ -265,9 +252,5 @@
AC_OUTPUT([Config.make
include/linux/asm_module_version.h
vendor/common/oracleasm-support.spec
-vendor/redhat/oracleasm.init
-vendor/redhat/oracleasm-2.4.9-e.spec
-vendor/redhat/oracleasm-2.4.21-EL.spec
-vendor/suse/oracleasm.init
vendor/suse/oracleasm-2.6.5.spec-generic
])
Modified: branches/extended/include/linux/Makefile
===================================================================
--- branches/extended/include/linux/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/include/linux/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -14,13 +14,14 @@
#
SUBDIRS =
-HEADERS = \
- asmabi.h \
- asmabi_compat.h \
- asmdisk.h \
- asmmanager.h \
- asmkernel.h \
- asmcompat32.h \
+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
Modified: branches/extended/include/linux/asmabi.h
===================================================================
--- branches/extended/include/linux/asmabi.h 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/include/linux/asmabi.h 2005-02-23 19:41:56 UTC (rev 282)
@@ -93,10 +93,12 @@
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 */
};
enum asm_disk_options {
@@ -108,7 +110,7 @@
ASM_DISK_OPTION_TAG = (1 << 4),
};
-/* Users of the commands should always use ASMOP_IODISK */
+/* Users of the commands should always use ASMOP_IO */
#if BITS_PER_LONG == 32
# define ASMOP_IO ASMOP_IO32
#else
@@ -128,9 +130,10 @@
struct oracleasm_abi_info
{
/*00*/ __u32 ai_magic; /* ASM_ABI_MAGIC */
- __u32 ai_version; /* ABI version */
- __u32 ai_type; /* Type of operation */
+ __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*/
};
@@ -186,13 +189,5 @@
/*18*/
};
-/*
- * Until I get seq/transaction file going
- */
-#ifndef ASM_IOCTL_BASE
-#define ASM_IOCTL_BASE 0xFD
-#endif
-#define ASMIOC_KITCHENSINK _IOWR(ASM_IOCTL_BASE, 20, struct oracleasm_abi_info)
-
#endif /* _ASMABI_H */
Modified: branches/extended/include/linux/asmmanager.h
===================================================================
--- branches/extended/include/linux/asmmanager.h 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/include/linux/asmmanager.h 2005-02-23 19:41:56 UTC (rev 282)
@@ -77,9 +77,42 @@
* 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)
{
@@ -176,5 +209,29 @@
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 */
Copied: branches/extended/include/linux/asmmanager_compat.h (from rev 267, branches/port-2.6/include/linux/asmmanager_compat.h)
Modified: branches/extended/kernel/Makefile
===================================================================
--- branches/extended/kernel/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/kernel/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -12,7 +12,8 @@
endif
-SOURCES = oracleasm.c
+HEADERS = transaction_file.h
+SOURCES = oracleasm.c transaction_file.c
OBJECTS = $(subst .c,.o,$(SOURCES))
ifeq ($(KERNELRELEASE),)
@@ -20,23 +21,24 @@
INSTALL_MODULE = oracleasm.ko
+ifeq ($(BUILD_DRIVER), yes)
ALL_RULES = build-oracleasm
CLEAN_RULES = clean-oracleasm
+INSTALL_RULES = install-oracleasm
+endif
+
build-oracleasm:
$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules
clean-oracleasm:
$(MAKE) -C $(KERNELDIR) M=$(CURDIR) clean
-INSTALL_RULES = install-oracleasm
-
install-oracleasm: $(INSTALL_MODULE)
- $(TOPDIR)/mkinstalldirs $(DESTDIR)$(MODULEDIR)
- $(INSTALL_DATA) $< $(DESTDIR)$(MODULEDIR)/$<
+ $(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules_install
-DIST_FILES = $(SOURCES)
+DIST_FILES = $(SOURCES) $(HEADERS)
include $(TOPDIR)/Postamble.make
Modified: branches/extended/kernel/oracleasm.c
===================================================================
--- branches/extended/kernel/oracleasm.c 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/kernel/oracleasm.c 2005-02-23 19:41:56 UTC (rev 282)
@@ -17,6 +17,8 @@
* Initial GPL header.
* 2004/09/10 - Joel Becker <joel.becker at oracle.com>
* First port to 2.6.
+ * 2004/12/16 - Joel Becker <joel.becker at oracle.com>
+ * Change from ioctl to transaction files.
*
* Copyright (c) 2002-2004 Oracle Corporation. All rights reserved.
*
@@ -77,6 +79,12 @@
#include "linux/asm_module_version.h"
+#if 0
+#include "transaction_file.h"
+#else
+#include "transaction_file.c" /* XXX ugly for now */
+#endif
+
#if PAGE_CACHE_SIZE % 1024
#error Oh no, PAGE_CACHE_SIZE is not divisible by 1k! I cannot cope.
#endif /* PAGE_CACHE_SIZE % 1024 */
@@ -129,7 +137,6 @@
static struct super_operations asmfs_ops;
-static struct address_space_operations asmfs_aops;
static struct file_operations asmfs_dir_operations;
static struct file_operations asmfs_file_operations;
static struct inode_operations asmfs_file_inode_operations;
@@ -229,6 +236,10 @@
return container_of(inode, struct asmfs_inode_info, vfs_inode);
}
+static inline struct inode *ASMFS_F2I(struct file *file)
+{
+ return file->f_dentry->d_inode;
+}
/*
* asm disk info
@@ -279,6 +290,34 @@
};
+/*
+ * Transaction file contexts.
+ */
+static ssize_t asmfs_svc_query_version(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_get_iid(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_check_iid(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_open_disk(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_close_disk(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_io32(struct file *file, char *buf, size_t size);
+#if BITS_PER_LONG == 64
+static ssize_t asmfs_svc_io64(struct file *file, char *buf, size_t size);
+#endif
+
+static struct transaction_context trans_contexts[] = {
+ [ASMOP_QUERY_VERSION] = {asmfs_svc_query_version},
+ [ASMOP_GET_IID] = {asmfs_svc_get_iid},
+ [ASMOP_CHECK_IID] = {asmfs_svc_check_iid},
+ [ASMOP_QUERY_DISK] = {asmfs_svc_query_disk},
+ [ASMOP_OPEN_DISK] = {asmfs_svc_open_disk},
+ [ASMOP_CLOSE_DISK] = {asmfs_svc_close_disk},
+ [ASMOP_IO32] = {asmfs_svc_io32},
+#if BITS_PER_LONG == 64
+ [ASMOP_IO64] = {asmfs_svc_io64},
+#endif
+};
+
+
static struct inode *asmdisk_alloc_inode(struct super_block *sb)
{
struct asm_disk_info *d = kmem_cache_alloc(asmdisk_cachep, SLAB_KERNEL);
@@ -493,68 +532,75 @@
printk(KERN_INFO "asm_request_cache: not all structures were freed\n");
}
-static struct inode *asmfs_get_inode(struct super_block *sb, int mode, int dev)
-{
- struct inode *inode = new_inode(sb);
- if (inode) {
- inode->i_mode = mode;
- inode->i_uid = current->fsuid;
- inode->i_gid = current->fsgid;
- inode->i_blksize = PAGE_CACHE_SIZE;
- inode->i_blocks = 0;
- inode->i_rdev = 0;
- inode->i_mapping->a_ops = &asmfs_aops;
- inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
- switch (mode & S_IFMT) {
- default:
- init_special_inode(inode, mode, dev);
- break;
- case S_IFREG:
- inode->i_op = &asmfs_file_inode_operations;
- inode->i_fop = &asmfs_file_operations;
- break;
- case S_IFDIR:
- inode->i_op = &simple_dir_inode_operations;
- inode->i_fop = &asmfs_dir_operations;
- /* directory inodes start off with i_nlink == 2 (for "." entry) */
- inode->i_nlink++;
- break;
- case S_IFLNK:
- inode->i_op = &page_symlink_inode_operations;
- break;
- }
- }
-
- return inode;
-}
-
/*
- * File creation. Allocate an inode, update free inode and dentry counts
- * and we're done..
+ * Disk file creation in the disks directory.
*/
static int asmfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
{
struct inode * inode;
- int error = -ENOSPC;
- dprintk("ASM: Alloc'd dentry\n");
- inode = asmfs_get_inode(dir->i_sb, mode, dev);
+ if (!S_ISBLK(mode))
+ return -EINVAL;
- if (inode) {
- d_instantiate(dentry, inode);
- dget(dentry); /* Extra count - pin the dentry in core */
- error = 0;
- }
+ inode = new_inode(dir->i_sb);
+ if (!inode)
+ return -ENOMEM;
- return error;
+ inode->i_ino = (unsigned long)inode;
+ inode->i_mode = mode;
+ inode->i_uid = current->fsuid;
+ inode->i_gid = current->fsgid;
+ inode->i_blksize = PAGE_CACHE_SIZE;
+ inode->i_blocks = 0;
+ inode->i_rdev = 0;
+ inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ init_special_inode(inode, mode, dev);
+
+ d_instantiate(dentry, inode);
+
+ /* Extra count - pin the dentry in core */
+ dget(dentry);
+
+ return 0;
}
+/*
+ * Instance file creation in the iid directory.
+ */
static int asmfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
- return asmfs_mknod(dir, dentry, mode | S_IFREG, 0);
+ struct inode *inode;
+
+ if ((mode & S_IFMT) && !S_ISREG(mode))
+ return -EINVAL;
+
+ mode |= S_IFREG;
+
+ inode = new_inode(dir->i_sb);
+ if (!inode)
+ return -ENOMEM;
+
+ inode->i_ino = (unsigned long)inode;
+ inode->i_mode = mode;
+ inode->i_uid = current->fsuid;
+ inode->i_gid = current->fsgid;
+ inode->i_blksize = PAGE_CACHE_SIZE;
+ inode->i_blocks = 0;
+ inode->i_rdev = 0;
+ inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_op = &asmfs_file_inode_operations;
+ inode->i_fop = &asmfs_file_operations;
+
+ d_instantiate(dentry, inode);
+
+ /* Extra count - pin the dentry in core */
+ dget(dentry);
+
+ return 0;
}
+
static inline int asmfs_positive(struct dentry *dentry)
{
return dentry->d_inode && !d_unhashed(dentry);
@@ -727,12 +773,12 @@
return interface;
}
-static int asm_open_disk(struct inode *inode, struct file *file,
- struct block_device *bdev)
+static int asm_open_disk(struct file *file, struct block_device *bdev)
{
int ret;
struct asm_disk_info *d;
struct asm_disk_head *h;
+ struct inode *inode = ASMFS_F2I(file);
struct inode *disk_inode;
ret = blkdev_get(bdev, FMODE_WRITE | FMODE_READ, 0);
@@ -802,8 +848,9 @@
return ret;
}
-static int asm_close_disk(struct inode *inode, struct file *file, unsigned long handle)
+static int asm_close_disk(struct file *file, unsigned long handle)
{
+ struct inode *inode = ASMFS_F2I(file);
struct asm_disk_info *d;
struct block_device *bdev;
struct inode *disk_inode;
@@ -1064,8 +1111,7 @@
list_add(&r->r_list, &afi->f_complete);
if (r->r_error)
r->r_status |= ASM_ERROR;
- else
- r->r_status |= ASM_COMPLETED;
+ r->r_status |= ASM_COMPLETED;
spin_unlock_irqrestore(&afi->f_lock, flags);
@@ -1216,12 +1262,12 @@
return 0;
} /* asm_associate_options() */
-static int asm_submit_io(struct inode *inode,
- struct file *file,
+static int asm_submit_io(struct file *file,
asm_ioc __user *user_iocp,
asm_ioc *ioc)
{
int ret, rw = READ;
+ struct inode *inode = ASMFS_F2I(file);
struct asm_request *r;
struct asm_disk_info *d;
struct inode *disk_inode;
@@ -1389,8 +1435,7 @@
} /* asm_submit_io() */
-static int asm_maybe_wait_io(struct inode *inode,
- struct file *file,
+static int asm_maybe_wait_io(struct file *file,
asm_ioc *iocp,
struct timeout *to)
{
@@ -1514,8 +1559,7 @@
} /* asm_maybe_wait_io() */
-static int asm_complete_io(struct inode *inode,
- struct file *file,
+static int asm_complete_io(struct file *file,
asm_ioc **ioc)
{
int ret = 0;
@@ -1557,8 +1601,7 @@
} /* asm_complete_io() */
-static int asm_wait_completion(struct inode *inode,
- struct file *file,
+static int asm_wait_completion(struct file *file,
struct oracleasm_io_v2 *io,
struct timeout *to,
u32 *status)
@@ -1629,8 +1672,7 @@
} /* asm_wait_completion() */
-static inline int asm_submit_io_native(struct inode *inode,
- struct file *file,
+static inline int asm_submit_io_native(struct file *file,
struct oracleasm_io_v2 *io)
{
int ret = 0;
@@ -1649,7 +1691,7 @@
break;
LOG("ASM: Submitting user ioc at 0x%p\n", iocp);
- ret = asm_submit_io(inode, file, iocp, &tmp);
+ ret = asm_submit_io(file, iocp, &tmp);
if (ret)
break;
}
@@ -1659,8 +1701,7 @@
} /* asm_submit_io_native() */
-static inline int asm_maybe_wait_io_native(struct inode *inode,
- struct file *file,
+static inline int asm_maybe_wait_io_native(struct file *file,
struct oracleasm_io_v2 *io,
struct timeout *to)
{
@@ -1674,7 +1715,7 @@
((asm_ioc **)((unsigned long)(io->io_waitreqs))) + i))
return -EFAULT;
- ret = asm_maybe_wait_io(inode, file, iocp, to);
+ ret = asm_maybe_wait_io(file, iocp, to);
if (ret)
break;
}
@@ -1684,8 +1725,7 @@
} /* asm_maybe_wait_io_native() */
-static inline int asm_complete_ios_native(struct inode *inode,
- struct file *file,
+static inline int asm_complete_ios_native(struct file *file,
struct oracleasm_io_v2 *io,
struct timeout *to,
u32 *status)
@@ -1696,7 +1736,7 @@
LOG_ENTRY();
for (i = 0; i < io->io_complen; i++) {
- ret = asm_complete_io(inode, file, &iocp);
+ ret = asm_complete_io(file, &iocp);
if (ret)
break;
if (iocp) {
@@ -1711,7 +1751,7 @@
if (*status & ASM_IO_WAITED)
break;
- ret = asm_wait_completion(inode, file, io, to, status);
+ ret = asm_wait_completion(file, io, to, status);
if (ret)
break;
if (*status & ASM_IO_IDLE)
@@ -1752,8 +1792,7 @@
} /* asm_promote_64() */
-static inline int asm_submit_io_thunk(struct inode *inode,
- struct file *file,
+static inline int asm_submit_io_thunk(struct file *file,
struct oracleasm_io_v2 *io)
{
int ret = 0;
@@ -1780,7 +1819,7 @@
asm_promote_64(&tmp);
- ret = asm_submit_io(inode, file, (asm_ioc *)iocp, &tmp);
+ ret = asm_submit_io(file, (asm_ioc *)iocp, &tmp);
if (ret)
break;
}
@@ -1790,8 +1829,7 @@
} /* asm_submit_io_thunk() */
-static inline int asm_maybe_wait_io_thunk(struct inode *inode,
- struct file *file,
+static inline int asm_maybe_wait_io_thunk(struct file *file,
struct oracleasm_io_v2 *io,
struct timeout *to)
{
@@ -1813,7 +1851,7 @@
/* Remember, the this is pointing to 32bit userspace */
iocp = (asm_ioc *)(unsigned long)iocp_32;
- ret = asm_maybe_wait_io(inode, file, iocp, to);
+ ret = asm_maybe_wait_io(file, iocp, to);
if (ret)
break;
}
@@ -1823,8 +1861,7 @@
} /* asm_maybe_wait_io_thunk() */
-static inline int asm_complete_ios_thunk(struct inode *inode,
- struct file *file,
+static inline int asm_complete_ios_thunk(struct file *file,
struct oracleasm_io_v2 *io,
struct timeout *to,
u32 *status)
@@ -1836,7 +1873,7 @@
LOG_ENTRY();
for (i = 0; i < io->io_complen; i++) {
- ret = asm_complete_io(inode, file, &iocp);
+ ret = asm_complete_io(file, &iocp);
if (ret)
break;
if (iocp) {
@@ -1853,7 +1890,7 @@
if (*status & ASM_IO_WAITED)
break;
- ret = asm_wait_completion(inode, file, io, to, status);
+ ret = asm_wait_completion(file, io, to, status);
if (ret)
break;
if (*status & ASM_IO_IDLE)
@@ -1869,9 +1906,8 @@
#endif /* BITS_PER_LONG == 64 */
-static int asm_do_io(struct inode *inode,
- struct file *file,
- struct oracleasm_io_v2 *io, int bpl)
+static int asm_do_io(struct file *file, struct oracleasm_io_v2 *io,
+ int bpl)
{
int ret = 0;
u32 status = 0;
@@ -1904,10 +1940,10 @@
io->io_reqlen);
ret = -EINVAL;
if (bpl == ASM_BPL_32)
- ret = asm_submit_io_32(inode, file, io);
+ ret = asm_submit_io_32(file, io);
#if BITS_PER_LONG == 64
else if (bpl == ASM_BPL_64)
- ret = asm_submit_io_64(inode, file, io);
+ ret = asm_submit_io_64(file, io);
#endif /* BITS_PER_LONG == 64 */
if (ret)
@@ -1919,12 +1955,10 @@
io->io_waitlen);
ret = -EINVAL;
if (bpl == ASM_BPL_32)
- ret = asm_maybe_wait_io_32(inode, file,
- io, &to);
+ ret = asm_maybe_wait_io_32(file, io, &to);
#if BITS_PER_LONG == 64
else if (bpl == ASM_BPL_64)
- ret = asm_maybe_wait_io_64(inode, file,
- io, &to);
+ ret = asm_maybe_wait_io_64(file, io, &to);
#endif /* BITS_PER_LONG == 64 */
if (ret)
@@ -1938,12 +1972,12 @@
io->io_complen);
ret = -EINVAL;
if (bpl == ASM_BPL_32)
- ret = asm_complete_ios_32(inode, file, io,
- &to, &status);
+ ret = asm_complete_ios_32(file, io, &to,
+ &status);
#if BITS_PER_LONG == 64
else if (bpl == ASM_BPL_64)
- ret = asm_complete_ios_64(inode, file, io,
- &to, &status);
+ ret = asm_complete_ios_64(file, io, &to,
+ &status);
#endif /* BITS_PER_LONG == 64 */
if (ret < 0)
@@ -1964,7 +1998,7 @@
return ret;
} /* asm_do_io() */
-static void asm_cleanup_bios(struct inode *inode, struct file *file)
+static void asm_cleanup_bios(struct file *file)
{
struct asmfs_file_info *afi = ASMFS_FILE(file);
struct bio *bio;
@@ -2000,7 +2034,7 @@
INIT_LIST_HEAD(&afi->f_complete);
init_waitqueue_head(&afi->f_wait);
- aii = ASMFS_I(inode);
+ aii = ASMFS_I(ASMFS_F2I(file));
spin_lock_irq(&aii->i_lock);
list_add(&afi->f_ctx, &aii->i_threads);
spin_unlock_irq(&aii->i_lock);
@@ -2022,7 +2056,7 @@
struct task_struct *tsk = current;
DECLARE_WAITQUEUE(wait, tsk);
- aii = ASMFS_I(inode);
+ aii = ASMFS_I(ASMFS_F2I(file));
afi = ASMFS_FILE(file);
if (!afi)
@@ -2034,7 +2068,7 @@
*/
list_for_each_entry_safe(h, n, &afi->f_disks, h_flist) {
d = h->h_disk;
- asm_close_disk(inode, file, (unsigned long)d->d_bdev);
+ asm_close_disk(file, (unsigned long)d->d_bdev);
}
/* FIXME: Clean up things that hang off of afi */
@@ -2083,7 +2117,7 @@
spin_unlock_irq(&afi->f_lock);
/* And cleanup any pages from those I/Os */
- asm_cleanup_bios(inode, file);
+ asm_cleanup_bios(file);
dprintk("ASM: Done with afi 0x%p\n", afi);
file->private_data = NULL;
@@ -2107,103 +2141,110 @@
return 0;
}
-static int asmfs_svc_query_version(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_query_version(struct file *file, char *buf, size_t size)
{
- struct oracleasm_abi_info abi_info;
+ struct oracleasm_abi_info *abi_info;
int ret;
- if (copy_from_user(&abi_info,
- (struct oracleasm_abi_info __user *)arg,
- sizeof(struct oracleasm_abi_info)))
- return -EFAULT;
+ if (size != sizeof(struct oracleasm_abi_info))
+ return -EINVAL;
- ret = asmfs_verify_abi(&abi_info);
- if (ret && (ret != -ESRCH)) {
- return ret;
+ abi_info = (struct oracleasm_abi_info *)buf;
+
+ ret = asmfs_verify_abi(abi_info);
+ if (ret) {
+ if (ret == -ESRCH) {
+ abi_info->ai_version = ASM_ABI_VERSION;
+ abi_info->ai_status = -ESRCH;
+ } else
+ goto out;
}
- if (abi_info.ai_size != sizeof(struct oracleasm_abi_info))
- return -EBADR;
- if (abi_info.ai_type != ASMOP_QUERY_VERSION)
- return -EBADRQC;
- /* Handle ESRCH after checking for bad ABI magics */
- if (ret == -ESRCH) {
- abi_info.ai_version = ASM_ABI_VERSION;
- if (copy_to_user((struct oracleasm_abi_info __user *)arg,
- &abi_info,
- sizeof(struct oracleasm_abi_info)))
- return -EFAULT;
- }
+ ret = -EBADR;
+ if (abi_info->ai_size != sizeof(struct oracleasm_abi_info))
+ goto out;
+ ret = -EBADRQC;
+ if (abi_info->ai_type != ASMOP_QUERY_VERSION)
+ goto out;
+
+ ret = 0;
+
+out:
+ if (!abi_info->ai_status)
+ abi_info->ai_status = ret;
- return ret;
+ return size;
}
-static int asmfs_svc_get_iid(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_get_iid(struct file *file, char *buf, size_t size)
{
- struct oracleasm_get_iid_v2 iid_info;
- struct asmfs_sb_info *asb = ASMFS_SB(inode->i_sb);
+ struct oracleasm_get_iid_v2 *iid_info;
+ struct asmfs_sb_info *asb = ASMFS_SB(ASMFS_F2I(file)->i_sb);
int ret;
- if (copy_from_user(&iid_info,
- (struct oracleasm_get_iid_v2 __user *)arg,
- sizeof(struct oracleasm_get_iid_v2)))
- return -EFAULT;
+ if (size != sizeof(struct oracleasm_get_iid_v2))
+ return -EINVAL;
- ret = asmfs_verify_abi(&iid_info.gi_abi);
+ iid_info = (struct oracleasm_get_iid_v2 *)buf;
+
+ ret = asmfs_verify_abi(&iid_info->gi_abi);
if (ret)
- return ret;
- if (iid_info.gi_abi.ai_size !=
+ goto out;
+ ret = -EBADR;
+ if (iid_info->gi_abi.ai_size !=
sizeof(struct oracleasm_get_iid_v2))
- return -EBADR;
- if (iid_info.gi_abi.ai_type != ASMOP_GET_IID)
- return -EBADRQC;
+ goto out;
+ ret = -EBADRQC;
+ if (iid_info->gi_abi.ai_type != ASMOP_GET_IID)
+ goto out;
spin_lock_irq(&asb->asmfs_lock);
- iid_info.gi_iid = (u64)asb->next_iid;
+ iid_info->gi_iid = (u64)asb->next_iid;
asb->next_iid++;
spin_unlock_irq(&asb->asmfs_lock);
- if (copy_to_user((struct oracleasm_get_iid_v2 __user *)arg,
- &iid_info,
- sizeof(struct oracleasm_get_iid_v2)))
- return -EFAULT;
- return 0;
+ ret = 0;
+
+out:
+ iid_info->gi_abi.ai_status = ret;
+
+ return size;
}
-static int asmfs_svc_check_iid(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_check_iid(struct file *file, char *buf, size_t size)
{
- struct oracleasm_get_iid_v2 iid_info;
- struct asmfs_sb_info *asb = ASMFS_SB(inode->i_sb);
+ struct oracleasm_get_iid_v2 *iid_info;
+ struct asmfs_sb_info *asb = ASMFS_SB(ASMFS_F2I(file)->i_sb);
int ret;
- if (copy_from_user(&iid_info,
- (struct oracleasm_get_iid_v2 __user *)arg,
- sizeof(struct oracleasm_get_iid_v2)))
- return -EFAULT;
+ if (size != sizeof(struct oracleasm_get_iid_v2))
+ return -EINVAL;
- ret = asmfs_verify_abi(&iid_info.gi_abi);
+ iid_info = (struct oracleasm_get_iid_v2 *)buf;
+
+ ret = asmfs_verify_abi(&iid_info->gi_abi);
if (ret)
- return ret;
- if (iid_info.gi_abi.ai_size !=
+ goto out;
+
+ ret = -EBADR;
+ if (iid_info->gi_abi.ai_size !=
sizeof(struct oracleasm_get_iid_v2))
- return -EBADR;
- if (iid_info.gi_abi.ai_type != ASMOP_CHECK_IID)
- return -EBADRQC;
+ goto out;
+ ret = -EBADRQC;
+ if (iid_info->gi_abi.ai_type != ASMOP_CHECK_IID)
+ goto out;
spin_lock_irq(&asb->asmfs_lock);
- if (iid_info.gi_iid >= (u64)asb->next_iid)
- iid_info.gi_iid = (u64)0;
+ if (iid_info->gi_iid >= (u64)asb->next_iid)
+ iid_info->gi_iid = (u64)0;
spin_unlock_irq(&asb->asmfs_lock);
- if (!iid_info.gi_iid)
- {
- if (copy_to_user((struct oracleasm_get_iid_v2 __user *)arg,
- &iid_info,
- sizeof(struct oracleasm_get_iid_v2)))
- return -EFAULT;
- }
+ ret = 0;
- return 0;
+out:
+ iid_info->gi_abi.ai_status = ret;
+
+ return size;
}
/*
@@ -2234,309 +2275,271 @@
return pow_two_sectors;
}
-static int asmfs_svc_query_disk(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size)
{
- struct oracleasm_query_disk_v2 qd_info;
+ struct oracleasm_query_disk_v2 *qd_info;
struct file *filp;
struct block_device *bdev;
int ret;
- if (copy_from_user(&qd_info,
- (struct oracleasm_query_disk_v2 __user *)arg,
- sizeof(struct oracleasm_query_disk_v2)))
- return -EFAULT;
+ if (size != sizeof(struct oracleasm_query_disk_v2))
+ return -EINVAL;
- ret = asmfs_verify_abi(&qd_info.qd_abi);
+ qd_info = (struct oracleasm_query_disk_v2 *)buf;
+
+ ret = asmfs_verify_abi(&qd_info->qd_abi);
if (ret)
- return ret;
- if (qd_info.qd_abi.ai_size !=
+ goto out;
+
+ ret = -EBADR;
+ if (qd_info->qd_abi.ai_size !=
sizeof(struct oracleasm_query_disk_v2))
- return -EBADR;
- if (qd_info.qd_abi.ai_type != ASMOP_QUERY_DISK)
- return -EBADRQC;
+ goto out;
+ ret = -EBADRQC;
+ if (qd_info->qd_abi.ai_type != ASMOP_QUERY_DISK)
+ goto out;
- filp = fget(qd_info.qd_fd);
+ ret = -ENODEV;
+ filp = fget(qd_info->qd_fd);
if (!filp)
- return -ENODEV;
+ goto out;
bdev = I_BDEV(filp->f_mapping->host);
- qd_info.qd_max_sectors = compute_max_sectors(bdev);
- qd_info.qd_hardsect_size = bdev_hardsect_size(bdev);
- qd_info.qd_interface = (u32)asm_disk_get_interface(bdev);
+ qd_info->qd_max_sectors = compute_max_sectors(bdev);
+ qd_info->qd_hardsect_size = bdev_hardsect_size(bdev);
+ qd_info->qd_interface = (u32)asm_disk_get_interface(bdev);
fput(filp);
- if (copy_to_user((struct oracleasm_query_disk_v2 __user *)arg,
- &qd_info,
- sizeof(struct oracleasm_query_disk_v2)))
- return -EFAULT;
+ ret = 0;
- return 0;
+out:
+ qd_info->qd_abi.ai_status = ret;
+
+ return size;
}
-static int asmfs_svc_open_disk(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_open_disk(struct file *file, char *buf, size_t size)
{
struct oracleasm_open_disk_v2 od_info;
struct block_device *bdev = NULL;
struct file *filp;
int ret;
- LOG_ENTRY();
+ if (size != sizeof(struct oracleasm_open_disk_v2))
+ return -EINVAL;
if (copy_from_user(&od_info,
- (struct oracleasm_open_disk_v2 __user *)arg,
+ (struct oracleasm_open_disk_v2 __user *)buf,
sizeof(struct oracleasm_open_disk_v2)))
return -EFAULT;
+ od_info.od_handle = 0; /* Unopened */
+
ret = asmfs_verify_abi(&od_info.od_abi);
if (ret)
- return ret;
+ goto out_error;
+
+ ret = -EBADR;
if (od_info.od_abi.ai_size !=
sizeof(struct oracleasm_open_disk_v2))
- return -EBADR;
+ goto out_error;
+ ret = -EBADRQC;
if (od_info.od_abi.ai_type != ASMOP_OPEN_DISK)
- return -EBADRQC;
+ goto out_error;
+ ret = -ENODEV;
filp = fget(od_info.od_fd);
if (!filp)
- return -ENODEV;
+ goto out_error;
- ret = -ENODEV;
if (igrab(filp->f_mapping->host)) {
bdev = I_BDEV(filp->f_mapping->host);
- ret = asm_open_disk(inode, file, bdev);
+ ret = asm_open_disk(file, bdev);
}
fput(filp);
if (ret)
- return ret;
+ goto out_error;
od_info.od_handle = (u64)(unsigned long)bdev;
- if (copy_to_user((struct oracleasm_open_disk_v2 __user *)arg,
+out_error:
+ od_info.od_abi.ai_status = ret;
+ if (copy_to_user((struct oracleasm_open_disk_v2 __user *)buf,
&od_info,
sizeof(struct oracleasm_open_disk_v2))) {
- asm_close_disk(inode, file,
- (unsigned long)od_info.od_handle);
+ if (od_info.od_handle)
+ asm_close_disk(file,
+ (unsigned long)od_info.od_handle);
/* Ignore close errors, this is the real error */
return -EFAULT;
}
- LOG_EXIT_RET(0);
- return 0;
+ return size;
}
-static int asmfs_svc_close_disk(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_close_disk(struct file *file, char *buf, size_t size)
{
struct oracleasm_close_disk_v2 cd_info;
int ret;
- LOG_ENTRY();
+ if (size != sizeof(struct oracleasm_close_disk_v2))
+ return -EINVAL;
if (copy_from_user(&cd_info,
- (struct oracleasm_close_disk_v2 __user *)arg,
+ (struct oracleasm_close_disk_v2 __user *)buf,
sizeof(struct oracleasm_close_disk_v2)))
return -EFAULT;
ret = asmfs_verify_abi(&cd_info.cd_abi);
if (ret)
- return ret;
+ goto out_error;
+
+ ret = -EBADR;
if (cd_info.cd_abi.ai_size !=
sizeof(struct oracleasm_close_disk_v2))
- return -EBADR;
+ goto out_error;
+ ret = -EBADRQC;
if (cd_info.cd_abi.ai_type != ASMOP_CLOSE_DISK)
- return -EBADRQC;
+ goto out_error;
- ret = asm_close_disk(inode, file,
- (unsigned long)cd_info.cd_handle);
+ ret = asm_close_disk(file, (unsigned long)cd_info.cd_handle);
- LOG_EXIT_RET(ret);
- return ret;
+out_error:
+ cd_info.cd_abi.ai_status = ret;
+ if (copy_to_user((struct oracleasm_close_disk_v2 __user *)buf,
+ &cd_info,
+ sizeof(struct oracleasm_close_disk_v2)))
+ return -EFAULT;
+
+ return size;
}
-static int asmfs_svc_io32(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_io32(struct file *file, char *buf, size_t size)
{
+ struct oracleasm_abi_info __user *user_abi_info;
struct oracleasm_io_v2 io_info;
int ret;
+ if (size != sizeof(struct oracleasm_io_v2))
+ return -EINVAL;
+
if (copy_from_user(&io_info,
- (struct oracleasm_io_v2 __user *)arg,
+ (struct oracleasm_io_v2 __user *)buf,
sizeof(struct oracleasm_io_v2)))
return -EFAULT;
ret = asmfs_verify_abi(&io_info.io_abi);
if (ret)
- return ret;
+ goto out_error;
+
+ ret = -EBADR;
if (io_info.io_abi.ai_size !=
sizeof(struct oracleasm_io_v2))
- return -EBADR;
+ goto out_error;
+ ret = -EBADRQC;
if (io_info.io_abi.ai_type != ASMOP_IO32)
- return -EBADRQC;
+ goto out_error;
- ret = asm_do_io(inode, file, &io_info, ASM_BPL_32);
+ ret = asm_do_io(file, &io_info, ASM_BPL_32);
- return ret;
+out_error:
+ user_abi_info = (struct oracleasm_abi_info __user *)buf;
+ if (put_user(ret, &(user_abi_info->ai_status)))
+ return -EFAULT;
+
+ return size;
}
#if BITS_PER_LONG == 64
-static int asmfs_svc_io64(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_svc_io64(struct file *file, char *buf, size_t size)
{
+ struct oracleasm_abi_info __user *user_abi_info;
struct oracleasm_io_v2 io_info;
int ret;
- LOG_ENTRY();
+ if (size != sizeof(struct oracleasm_io_v2))
+ return -EINVAL;
if (copy_from_user(&io_info,
- (struct oracleasm_io_v2 __user *)arg,
+ (struct oracleasm_io_v2 __user *)buf,
sizeof(struct oracleasm_io_v2)))
return -EFAULT;
ret = asmfs_verify_abi(&io_info.io_abi);
if (ret)
- return ret;
+ goto out_error;
+
+ ret = -EBADR;
if (io_info.io_abi.ai_size !=
sizeof(struct oracleasm_io_v2))
- return -EBADR;
+ goto out_error;
+ ret = -EBADRQC;
if (io_info.io_abi.ai_type != ASMOP_IO64)
- return -EBADRQC;
+ goto out_error;
- ret = asm_do_io(inode, file, &io_info, ASM_BPL_64);
+ ret = asm_do_io(file, &io_info, ASM_BPL_64);
- LOG_EXIT_RET(ret);
- return ret;
+out_error:
+ user_abi_info = (struct oracleasm_abi_info __user *)buf;
+ if (put_user(ret, &(user_abi_info->ai_status)))
+ return -EFAULT;
+
+ return size;
}
#endif /* BITS_PER_LONG == 64 */
+
/*
- * This function is on the way to true transaction-style files.
+ * Because each of these operations need to access the filp->private,
+ * we must multiplex.
*/
-static int asmfs_ugly_multiplexing_hack(struct inode *inode, struct file *file, unsigned long arg)
+static ssize_t asmfs_file_read(struct file *file, char *buf, size_t size, loff_t *pos)
{
struct oracleasm_abi_info __user *user_abi_info;
- int ret;
+ ssize_t ret;
int op;
- user_abi_info = (struct oracleasm_abi_info __user *)arg;
+ asm_cleanup_bios(file);
+
+ user_abi_info = (struct oracleasm_abi_info __user *)buf;
if (get_user(op, &((user_abi_info)->ai_type)))
return -EFAULT;
- switch (inode->i_mode & S_IFMT) {
+ switch (op) {
default:
- ret = -EINVAL;
+ ret = -EBADRQC;
break;
- case S_IFDIR:
- switch (op) {
- default:
- ret = -EBADRQC;
- break;
-
- case ASMOP_QUERY_VERSION:
- ret = asmfs_svc_query_version(inode, file, arg);
- break;
-
- case ASMOP_GET_IID:
- ret = asmfs_svc_get_iid(inode,
- file,
- arg);
- break;
-
- case ASMOP_CHECK_IID:
- ret = asmfs_svc_check_iid(inode,
- file,
- arg);
- break;
- }
+ case ASMOP_OPEN_DISK:
+ ret = asmfs_svc_open_disk(file, (char *)buf,
+ size);
break;
- case S_IFREG:
- switch (op) {
- default:
- ret = -EBADRQC;
- break;
-
- case ASMOP_QUERY_DISK:
- ret = asmfs_svc_query_disk(inode, file, arg);
- break;
-
- case ASMOP_OPEN_DISK:
- ret = asmfs_svc_open_disk(inode, file, arg);
- break;
-
- case ASMOP_CLOSE_DISK:
- ret = asmfs_svc_close_disk(inode, file, arg);
- break;
-
- case ASMOP_IO32:
- ret = asmfs_svc_io32(inode, file, arg);
- break;
-
-#if BITS_PER_LONG == 64
- case ASMOP_IO64:
- ret = asmfs_svc_io64(inode, file, arg);
- break;
-#endif /* BITS_PER_LONG == 64 */
- }
+ case ASMOP_CLOSE_DISK:
+ ret = asmfs_svc_close_disk(file, (char *)buf,
+ size);
break;
- }
- return ret;
-}
-
-
-/*
- * Yes, evil ioctl()s. Next it goes seq_file.
- */
-static int asmfs_file_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg)
-{
- int ret;
-
- LOG_ENTRY();
-
- asm_cleanup_bios(inode, file);
-
- switch (cmd) {
- default:
- LOG("ASM: Invalid ioctl 0x%u\n", cmd);
- return -ENOTTY;
+ case ASMOP_IO32:
+ ret = asmfs_svc_io32(file, (char *)buf, size);
break;
- case ASMIOC_KITCHENSINK:
- ret = asmfs_ugly_multiplexing_hack(inode, file,
- arg);
+#if BITS_PER_LONG == 64
+ case ASMOP_IO64:
+ ret = asmfs_svc_io64(file, (char *)buf, size);
break;
+#endif /* BITS_PER_LONG == 64 */
}
- LOG_EXIT_RET(ret);
return ret;
}
-static int asmfs_dir_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg)
-{
- int ret;
-
- switch (cmd) {
- default:
- ret = -ENOTTY;
- break;
-
- case ASMIOC_KITCHENSINK:
- ret = asmfs_ugly_multiplexing_hack(inode, file,
- arg);
- break;
- }
-
- return ret;
-}
-
-
-static struct address_space_operations asmfs_aops = {
-};
-
static struct file_operations asmfs_file_operations = {
.open = asmfs_file_open,
.release = asmfs_file_release,
- .ioctl = asmfs_file_ioctl,
+ .read = asmfs_file_read,
};
static struct inode_operations asmfs_file_inode_operations = {
@@ -2574,9 +2577,9 @@
static int asmfs_fill_super(struct super_block *sb,
void *data, int silent)
{
- struct inode * inode;
- struct dentry * root, * dentry;
- struct asmfs_sb_info * asb;
+ struct inode *inode;
+ struct dentry *root, *dentry;
+ struct asmfs_sb_info *asb;
struct asmfs_params params;
struct qstr name;
@@ -2600,11 +2603,21 @@
init_limits(asb, ¶ms);
- inode = asmfs_get_inode(sb, S_IFDIR | 0755, 0);
+ inode = new_inode(sb);
if (!inode)
- goto out_free_asb;;
+ goto out_free_asb;
+ inode->i_ino = (unsigned long)inode;
+ inode->i_mode = S_IFDIR | 0755;
inode->i_uid = inode->i_gid = 0;
+ inode->i_blksize = PAGE_CACHE_SIZE;
+ inode->i_blocks = 0;
+ inode->i_rdev = 0;
+ inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_op = &simple_dir_inode_operations;
+ inode->i_fop = &asmfs_dir_operations;
+ /* directory inodes start off with i_nlink == 2 (for "." entry) */
+ inode->i_nlink++;
root = d_alloc_root(inode);
if (!root) {
@@ -2621,12 +2634,12 @@
inode = new_inode(sb);
if (!inode)
goto out_genocide;
+ inode->i_ino = (unsigned long)inode;
inode->i_mode = S_IFDIR | 0755;
inode->i_uid = inode->i_gid = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_op = &asmfs_disk_dir_inode_operations;
inode->i_fop = &asmfs_dir_operations;
- inode->i_op = &asmfs_disk_dir_inode_operations;
- inode->i_ino = (unsigned long)inode;
d_add(dentry, inode);
name.name = ASM_MANAGER_INSTANCES;
@@ -2638,14 +2651,62 @@
inode = new_inode(sb);
if (!inode)
goto out_genocide;
+ inode->i_ino = (unsigned long)inode;
inode->i_mode = S_IFDIR | 0770;
inode->i_uid = inode->i_gid = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_op = &asmfs_iid_dir_inode_operations;
inode->i_fop = &asmfs_dir_operations;
- inode->i_op = &asmfs_iid_dir_inode_operations;
- inode->i_ino = (unsigned long)inode;
d_add(dentry, inode);
+ name.name = asm_operation_files[ASMOP_QUERY_VERSION];
+ name.len = strlen(asm_operation_files[ASMOP_QUERY_VERSION]);
+ name.hash = full_name_hash(name.name, name.len);
+ dentry = d_alloc(root, &name);
+ if (!dentry)
+ goto out_genocide;
+ inode = new_transaction_inode(sb, 0770,
+ &trans_contexts[ASMOP_QUERY_VERSION]);
+ if (!inode)
+ goto out_genocide;
+ d_add(dentry, inode);
+
+ name.name = asm_operation_files[ASMOP_GET_IID];
+ name.len = strlen(asm_operation_files[ASMOP_GET_IID]);
+ name.hash = full_name_hash(name.name, name.len);
+ dentry = d_alloc(root, &name);
+ if (!dentry)
+ goto out_genocide;
+ inode = new_transaction_inode(sb, 0770,
+ &trans_contexts[ASMOP_GET_IID]);
+ if (!inode)
+ goto out_genocide;
+ d_add(dentry, inode);
+
+ name.name = asm_operation_files[ASMOP_CHECK_IID];
+ name.len = strlen(asm_operation_files[ASMOP_CHECK_IID]);
+ name.hash = full_name_hash(name.name, name.len);
+ dentry = d_alloc(root, &name);
+ if (!dentry)
+ goto out_genocide;
+ inode = new_transaction_inode(sb, 0770,
+ &trans_contexts[ASMOP_CHECK_IID]);
+ if (!inode)
+ goto out_genocide;
+ d_add(dentry, inode);
+
+ name.name = asm_operation_files[ASMOP_QUERY_DISK];
+ name.len = strlen(asm_operation_files[ASMOP_QUERY_DISK]);
+ name.hash = full_name_hash(name.name, name.len);
+ dentry = d_alloc(root, &name);
+ if (!dentry)
+ goto out_genocide;
+ inode = new_transaction_inode(sb, 0770,
+ &trans_contexts[ASMOP_QUERY_DISK]);
+ if (!inode)
+ goto out_genocide;
+ d_add(dentry, inode);
+
sb->s_root = root;
@@ -2669,43 +2730,9 @@
static void __init init_asmfs_dir_operations(void) {
asmfs_dir_operations = simple_dir_operations;
asmfs_dir_operations.fsync = simple_sync_file;
- asmfs_dir_operations.ioctl = asmfs_dir_ioctl;
};
-#ifdef CONFIG_COMPAT /* 64 bit module handling 32bit userspace */
-static int compat_ioctls [] = {
- ASMIOC_KITCHENSINK
-};
-
-static int __init init_asmfs_ioctl32(void) {
- int ret, i;
- int num = sizeof(compat_ioctls) / sizeof(*compat_ioctls);
-
- for (i = 0; i < num; i++) {
- ret = register_ioctl32_conversion(compat_ioctls[i],
- NULL);
- if (ret)
- break;
- }
- if (ret) {
- for (num = i, i = 0; i < num; i++) {
- unregister_ioctl32_conversion(compat_ioctls[i]);
- }
- }
- return ret;
-}
-
-static void __exit exit_asmfs_ioctl32(void) {
- int i;
- int num = sizeof(compat_ioctls) / sizeof(*compat_ioctls);
-
- for (i = 0; i < num; i++) {
- unregister_ioctl32_conversion(compat_ioctls[i]);
- }
-}
-#endif /* CONFIG_COMPAT */
-
static struct super_block *asmfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
@@ -2744,14 +2771,6 @@
goto out_diskcache;
}
-#ifdef CONFIG_COMPAT
- ret = init_asmfs_ioctl32();
- if (ret) {
- printk("oracleasmfs: Unable to initialize 32bit compat\n");
- goto out_ioctl32;
- }
-#endif /* CONFIG_COMPAT */
-
init_asmfs_dir_operations();
ret = register_filesystem(&asmfs_fs_type);
if (ret) {
@@ -2762,11 +2781,6 @@
return 0;
out_register:
-#ifdef CONFIG_COMPAT
- exit_asmfs_ioctl32();
-
-out_ioctl32:
-#endif /* CONFIG_COMPAT */
destroy_asmdiskcache();
out_diskcache:
@@ -2782,9 +2796,6 @@
static void __exit exit_asmfs_fs(void)
{
unregister_filesystem(&asmfs_fs_type);
-#ifdef CONFIG_COMPAT
- exit_asmfs_ioctl32();
-#endif /* CONFIG_COMPAT */
destroy_asmdiskcache();
destroy_requestcache();
destroy_inodecache();
Copied: branches/extended/kernel/transaction_file.c (from rev 267, branches/port-2.6/kernel/transaction_file.c)
Copied: branches/extended/kernel/transaction_file.h (from rev 267, branches/port-2.6/kernel/transaction_file.h)
Copied: branches/extended/rpmarch.guess (from rev 267, branches/port-2.6/rpmarch.guess)
Property changes on: branches/extended/rpmarch.guess
___________________________________________________________________
Name: svn:executable
+ *
Property changes on: branches/extended/tools
___________________________________________________________________
Name: svn:ignore
- asmtool
asmscan
.*.sw?
+ asmtool
asmscan
.*.sw?
*.d
Modified: branches/extended/tools/Makefile
===================================================================
--- branches/extended/tools/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/tools/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -23,13 +23,9 @@
DIST_FILES = $(ASMTOOL_SOURCES) $(ASMSCAN_SOURCES) $(LOCAL_HEADERS)
-$(ASMTOOL_OBJECTS): $(HEADERS) $(LOCAL_HEADERS)
-
asmtool: $(ASMTOOL_OBJECTS)
$(LINK)
-ASMSCAN_OBJECTS: $(HEADERS) $(LOCAL_HEADERS)
-
asmscan: $(ASMSCAN_OBJECTS)
$(LINK)
Modified: branches/extended/tools/asmscan.c
===================================================================
--- branches/extended/tools/asmscan.c 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/tools/asmscan.c 2005-02-23 19:41:56 UTC (rev 282)
@@ -49,6 +49,9 @@
#include <errno.h>
#include <linux/types.h>
+#include <linux/hdreg.h>
+#include "linux/asmcompat32.h"
+#include "linux/asmabi.h"
#include "linux/asmdisk.h"
#include "linux/asmmanager.h"
@@ -62,9 +65,12 @@
#define DEV_PREFIX "/dev/"
#define PROC_IDE_FORMAT "/proc/ide/%s/media"
+/* So as not to include linux/fs.h, let's explicitly do this here. */
+#ifndef BLKRRPART
+#define BLKRRPART _IO(0x12,95) /* re-read partition table */
+#endif
-
/*
* Typedefs
*/
@@ -104,6 +110,8 @@
static int as_pattern_match(ASMScanPattern *pattern,
const char *dev_name);
static void as_clean_pattern_list(struct list_head *pattern_list);
+static void as_pattern_empty(ASMScanPattern *pattern);
+static void as_empty_pattern_list(struct list_head *pattern_list);
static ASMScanDevice *as_device_new(struct list_head *device_list,
const char *dev_name);
static void as_device_free(ASMScanDevice *device);
@@ -191,7 +199,7 @@
} /* as_pattern_new() */
-static void as_pattern_free(ASMScanPattern *pattern)
+static void as_pattern_empty(ASMScanPattern *pattern)
{
struct list_head *pos, *tmp;
ASMScanDevice *device;
@@ -205,6 +213,15 @@
as_device_free(device);
}
}
+ }
+} /* as_pattern_empty() */
+
+
+static void as_pattern_free(ASMScanPattern *pattern)
+{
+ if (pattern)
+ {
+ as_pattern_empty(pattern);
list_del(&pattern->sp_list);
free(pattern);
}
@@ -240,6 +257,18 @@
} /* as_clean_pattern_list() */
+static void as_empty_pattern_list(struct list_head *pattern_list)
+{
+ struct list_head *pos;
+ ASMScanPattern *pattern;
+
+ list_for_each(pos, pattern_list) {
+ pattern = list_entry(pos, ASMScanPattern, sp_list);
+ as_pattern_empty(pattern);
+ }
+} /* as_empty_pattern_list() */
+
+
static ASMScanDevice *as_device_new(struct list_head *device_list,
const char *dev_name)
{
@@ -365,7 +394,7 @@
/* Um, wow, this is, like, one big hardcode */
static int scan_devices(struct list_head *order_list,
- struct list_head *exclude_list)
+ struct list_head *exclude_list)
{
int rc, major, minor;
FILE *f;
@@ -712,13 +741,13 @@
if (!dir)
goto out;
+ rc = 0;
while ((d_ent = readdir(dir)) != NULL)
{
if (!strcmp(d_ent->d_name, ".") || !strcmp(d_ent->d_name, ".."))
continue;
- rc = needs_clean(manager, d_ent->d_name);
- if (!rc)
+ if (!needs_clean(manager, d_ent->d_name))
continue;
fprintf(stdout, "Cleaning disk \"%s\"\n", d_ent->d_name);
@@ -729,6 +758,7 @@
return rc;
} /* clean_disks() */
+
static int device_is_disk(const char *manager, const char *device,
char **disk_name)
{
@@ -868,6 +898,74 @@
}
+static int device_is_partition(ASMScanDevice *device)
+{
+ struct hd_geometry geo;
+ int rc, fd;
+
+ /* Any errors, return false. This will force BLKRRPART on the device. */
+ fd = open(device->sd_path, O_RDONLY);
+ if (fd < 0)
+ return 0;
+
+ rc = ioctl(fd, HDIO_GETGEO, &geo);
+
+ close(fd);
+
+ if (rc)
+ return 0;
+
+ return !!geo.start;
+} /* device_is_partition() */
+
+
+static int reread_single_device(ASMScanDevice *device)
+{
+ int rc, fd;
+
+ /* Any errors, return false. This will force BLKRRPART on the device. */
+ fd = open(device->sd_path, O_RDONLY);
+ if (fd < 0)
+ return -errno;
+
+ rc = ioctl(fd, BLKRRPART, NULL);
+
+ if (rc)
+ rc = -errno;
+
+ close(fd);
+
+ return rc;
+} /* reread_single_device() */
+
+
+static int reread_partitions(struct list_head *order_list)
+{
+ int rc;
+ struct list_head *pos_l, *pos_d;
+ ASMScanPattern *pattern;
+ ASMScanDevice *device;
+
+ list_for_each(pos_l, order_list) {
+ pattern = list_entry(pos_l, ASMScanPattern, sp_list);
+ list_for_each(pos_d, &pattern->sp_matches) {
+ device = list_entry(pos_d, ASMScanDevice, sd_list);
+ if (device_is_partition(device))
+ continue;
+ rc = reread_single_device(device);
+ /*
+ * Drop rc to the fllor, as failing to reread partitions
+ * just means we go with the existing partition map.
+ * (Keep rc as a variable, just in case we care later.)
+ */
+ }
+ }
+
+ /* Ignore errors */
+ return 0;
+} /* rescan_partitions() */
+
+
static int make_disks(const char *manager, struct list_head *order_list)
{
int rc;
@@ -1028,6 +1126,21 @@
goto out;
}
+ rc = scan_devices(&order_list, &exclude_list);
+ if (rc)
+ goto out;
+
+ rc = reread_partitions(&order_list);
+ if (rc)
+ goto out;
+
+ /*
+ * With BLKRRPART called, the devices might not exist anymore.
+ * We rescan below.
+ */
+ as_empty_pattern_list(&order_list);
+ as_empty_pattern_list(&exclude_list);
+
rc = clean_disks(manager);
if (rc)
goto out;
Modified: branches/extended/tools/asmtool.c
===================================================================
--- branches/extended/tools/asmtool.c 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/tools/asmtool.c 2005-02-23 19:41:56 UTC (rev 282)
@@ -31,8 +31,9 @@
* Boston, MA 021110-1307, USA.
*/
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -47,6 +48,8 @@
#include <errno.h>
#include <linux/types.h>
+#include "linux/asmcompat32.h"
+#include "linux/asmabi.h"
#include "linux/asmdisk.h"
#include "linux/asmmanager.h"
@@ -58,8 +61,20 @@
*/
#define ASMFS_MAGIC 0x958459f6
#define ASM_DISK_XOR_OFFSET 0x0C
+/* Ted T'so recommends clearing 16K at the front and end of disks. */
+#define CLEAR_DISK_SIZE (16 * 1024)
+/* Kernel ABI ioctls for testing disks */
+#define HDIO_GETGEO 0x0301
+#define LOOP_GET_STATUS64 0x4C05
+#define LOOP_GET_STATUS 0x4C03
+struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
/*
* Enums
@@ -137,9 +152,13 @@
static inline size_t strnlen(const char *s, size_t size);
static void print_usage(int rc);
static void print_version();
+static int device_is_partition(int fd);
+static int device_is_loopback(int fd);
static int open_disk(const char *disk_name);
static int read_disk(int fd, ASMHeaderInfo *ahi);
static int write_disk(int fd, ASMHeaderInfo *ahi);
+static int clear_disk(int fd);
+static int clear_disk_chunk(int fd, char *buf);
static int check_disk(ASMHeaderInfo *ahi, const char *label);
static int mark_disk(int fd, ASMHeaderInfo *ahi,
const char *label);
@@ -229,7 +248,29 @@
exit(0);
} /* print_version() */
+static int device_is_partition(int fd)
+{
+ struct hd_geometry geo;
+ int rc;
+ rc = ioctl(fd, HDIO_GETGEO, &geo);
+ if (rc)
+ return 0;
+
+ return !!geo.start;
+} /* device_is_partition() */
+
+static int device_is_loopback(int fd)
+{
+ int rc;
+ char buf[1024];
+
+ rc = ioctl(fd, LOOP_GET_STATUS64, buf);
+ if (rc)
+ rc = ioctl(fd, LOOP_GET_STATUS, buf);
+ return !rc;
+} /* device_is_loopback() */
+
static int open_disk(const char *disk_name)
{
int fd, rc;
@@ -267,6 +308,7 @@
static int read_disk(int fd, ASMHeaderInfo *ahi)
{
+ off_t off;
int rc, tot;
struct asm_disk_label *adl;
__u32 *xor_buf;
@@ -277,8 +319,8 @@
xor_buf = &ahi->ah_xor;
adl = &ahi->ah_label;
- rc = lseek(fd, ASM_DISK_XOR_OFFSET, SEEK_SET);
- if (rc < 0)
+ off = lseek(fd, ASM_DISK_XOR_OFFSET, SEEK_SET);
+ if (off == (off_t)-1)
return -errno;
tot = 0;
@@ -300,8 +342,8 @@
if (tot < sizeof(__u32))
return -ENOSPC;
- rc = lseek(fd, ASM_DISK_LABEL_OFFSET, SEEK_SET);
- if (rc < 0)
+ off = lseek(fd, ASM_DISK_LABEL_OFFSET, SEEK_SET);
+ if (off == (off_t)-1)
return -errno;
tot = 0;
@@ -329,6 +371,7 @@
static int write_disk(int fd, ASMHeaderInfo *ahi)
{
+ off_t off;
int rc, tot;
__u32 *xor_buf;
struct asm_disk_label *adl;
@@ -339,8 +382,8 @@
xor_buf = &ahi->ah_xor;
adl = &ahi->ah_label;
- rc = lseek(fd, ASM_DISK_XOR_OFFSET, SEEK_SET);
- if (rc < 0)
+ off = lseek(fd, ASM_DISK_XOR_OFFSET, SEEK_SET);
+ if (off == (off_t)-1)
return -errno;
tot = 0;
@@ -362,8 +405,8 @@
if (tot < sizeof(__u32))
return -ENOSPC;
- rc = lseek(fd, ASM_DISK_LABEL_OFFSET, SEEK_SET);
- if (rc < 0)
+ off = lseek(fd, ASM_DISK_LABEL_OFFSET, SEEK_SET);
+ if (off == (off_t)-1)
return -errno;
tot = 0;
@@ -389,6 +432,71 @@
} /* write_disk() */
+static int clear_disk_chunk(int fd, char *buf)
+{
+ int rc, tot = 0;
+
+ while (tot < CLEAR_DISK_SIZE)
+ {
+ rc = write(fd, buf + tot, CLEAR_DISK_SIZE - tot);
+ if (!rc)
+ break;
+ if (rc < 0)
+ {
+ if ((errno == EAGAIN) || (errno == EINTR))
+ continue;
+ else
+ return -errno;
+ }
+ tot += rc;
+ }
+
+ if (tot < CLEAR_DISK_SIZE)
+ return -ENOSPC;
+
+ return 0;
+}
+
+static int clear_disk(int fd)
+{
+ loff_t off;
+ int rc;
+ char *buf;
+
+ if (fd < 0)
+ return -EINVAL;
+
+ buf = malloc(sizeof(char) * CLEAR_DISK_SIZE);
+ if (!buf)
+ return -ENOMEM;
+ memset(buf, 0, CLEAR_DISK_SIZE);
+
+ off = lseek64(fd, 0, SEEK_SET);
+ if (off == (loff_t)-1) {
+ rc = -errno;
+ goto out_free;
+ }
+
+ rc = clear_disk_chunk(fd, buf);
+ if (rc)
+ goto out_free;
+
+ off = lseek64(fd, -CLEAR_DISK_SIZE, SEEK_END);
+ if (off == (loff_t)-1) {
+ rc = -errno;
+ goto out_free;
+ }
+
+ rc = clear_disk_chunk(fd, buf);
+
+out_free:
+ free(buf);
+
+ return rc;
+} /* write_disk() */
+
+
+
static int check_disk(ASMHeaderInfo *ahi, const char *label)
{
int tot;
@@ -842,10 +950,22 @@
goto out;
fd = rc;
+ rc = -EINVAL;
+ if (!device_is_loopback(fd) && !device_is_partition(fd))
+ {
+ fprintf(stderr,
+ "asmtool: Device \"%s\" is not a partition\n",
+ target);
+ if (!attrs->force)
+ goto out_close;
+ else
+ fprintf(stderr, "asmtool: Continuing anyway\n");
+ }
+
rc = read_disk(fd, &ahi);
if (rc)
{
- fprintf(stdout,
+ fprintf(stderr,
"asmtool: Unable to read device \"%s\": %s\n",
target, strerror(-rc));
goto out_close;
@@ -887,6 +1007,14 @@
target);
goto out_close;
}
+ rc = clear_disk(fd);
+ if (rc)
+ {
+ fprintf(stderr,
+ "asmtool: Unable to clear device \"%s\": %s\n",
+ target, strerror(-rc));
+ goto out_close;
+ }
rc = mark_disk(fd, &ahi, disk);
if (rc)
{
@@ -940,6 +1068,7 @@
int c, rc, fd;
char *label, *asm_disk;
ASMHeaderInfo ahi;
+ struct stat stat_buf;
rc = -EINVAL;
c = asmdisk_toupper(disk, -1, 0);
@@ -1007,9 +1136,19 @@
}
else
{
- fprintf(stdout,
- "asmtool: Disk \"%s\" is a valid ASM disk\n",
- disk);
+ rc = fstat(fd, &stat_buf);
+ if (rc)
+ {
+ fprintf(stdout,
+ "asmtool: Disk \"%s\" is a valid ASM disk [unknown]\n",
+ disk);
+ }
+ else
+ {
+ fprintf(stdout,
+ "asmtool: Disk \"%s\" is a valid ASM disk on device [%d, %d]\n",
+ disk, major(stat_buf.st_rdev), minor(stat_buf.st_rdev));
+ }
}
out_close:
Modified: branches/extended/vendor/common/Makefile
===================================================================
--- branches/extended/vendor/common/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/common/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -3,7 +3,7 @@
include $(TOPDIR)/Preamble.make
DIST_FILES = \
- oracleasm.init.functions \
+ oracleasm.init \
oracleasm.sysconfig \
oracleasm-support.spec.in
Modified: branches/extended/vendor/common/oracleasm-support.spec.in
===================================================================
--- branches/extended/vendor/common/oracleasm-support.spec.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/common/oracleasm-support.spec.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -58,16 +58,9 @@
%install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
-IVENDOR=redhat
-if [ -r /etc/SuSE-release ]
-then
- IVENDOR=suse
-fi
-cp -f vendor/$IVENDOR/oracleasm.init $RPM_BUILD_ROOT/etc/init.d/oracleasm
+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
-mkdir -p $RPM_BUILD_ROOT/usr/%{_lib}/oracleasm
-cp -f vendor/common/oracleasm.init.functions $RPM_BUILD_ROOT/usr/%{_lib}/oracleasm/oracleasm.init.functions
cd tools
make DESTDIR="$RPM_BUILD_ROOT" install
@@ -84,7 +77,6 @@
%defattr(-,root,root)
/usr/sbin/asmtool
/usr/sbin/asmscan
-/usr/%{_lib}/oracleasm/oracleasm.init.functions
%attr(0755,root,root) /etc/init.d/oracleasm
%config /etc/sysconfig/oracleasm
Copied: branches/extended/vendor/common/oracleasm.init (from rev 267, branches/port-2.6/vendor/common/oracleasm.init)
Property changes on: branches/extended/vendor/common/oracleasm.init
___________________________________________________________________
Name: svn:executable
+ *
Deleted: branches/extended/vendor/common/oracleasm.init.functions
===================================================================
--- branches/extended/vendor/common/oracleasm.init.functions 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/common/oracleasm.init.functions 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,659 +0,0 @@
-# -*-Shell-script-*-
-# init functions for oracleasm
-#
-# Parent caller must have sourced init.d functions
-# . /etc/init.d/functions on Red Hat
-# . /etc/rc.status on UnitedLinux
-#
-
-# Force LC_ALL=C
-export LC_ALL=C
-
-
-#
-# 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
-}
-
-
-#
-# module_link()
-#
-# Link $1 from path $2 to $3
-# Returns 0 on success, 1 on error, 2 if it already exists.
-#
-module_link()
-{
- if [ "$#" -lt 3 -o -z "$1" -o -z "$2" -o -z "$3" ]
- then
- echo -n "module_link(): Requires 3 arguments" >&2
- return 1
- fi
- MODULENAME="$1"
- SRCPATH="$2"
- TARGETPATH="$3"
-
- # Assume any symlink is OK - caveat emptor for non-RPM users
- test -L "${TARGETPATH}/${MODULENAME}" && return 2
- # If the source module isn't there, this is a first install
- test -f "${SRCPATH}/${MODULENAME}" || return 2
-
- echo -n "Linking module ${MODULENAME} into the module path "
-
- # Same deal for modules that are physically there
- if test -f "${TARGETPATH}/${MODULENAME}" ; then
- echo
- echo "Leaving existing module in place"
- return 2
- fi
-
- if test ! -d "$TARGETPATH" ; then
- if test -e "${TARGETPATH}"; then
- echo "Path \"${TARGETPATH}\" already exists, but is not a directory" >&2
- return 1
- else
- mkdir -p "$TARGETPATH" >/dev/null 2>&1
- if test $? != 0; then
- echo "Unable to create directory \"${TARGETPATH}\"" >&2
- return 1
- fi
- fi
- fi
-
- ln -s "${SRCPATH}/${MODULENAME}" "${TARGETPATH}/${MODULENAME}" >/dev/null 2>&1
- if test $? != 0; then
- echo "Unable to create symbolic link \"${TARGETPATH}/${MODULENAME}\"" >&2
- return 1
- fi
- depmod -a
-
- 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
-
- 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 GID: $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 GID: $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 "
- 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" | 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
-}
-
Modified: branches/extended/vendor/redhat/Makefile
===================================================================
--- branches/extended/vendor/redhat/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/redhat/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -2,9 +2,6 @@
include $(TOPDIR)/Preamble.make
-DIST_FILES = \
- oracleasm-2.4.9-e.spec.in \
- oracleasm-2.4.21-EL.spec.in \
- oracleasm.init.in
+DIST_FILES =
include $(TOPDIR)/Postamble.make
Deleted: branches/extended/vendor/redhat/oracleasm-2.4.21-EL.spec.in
===================================================================
--- branches/extended/vendor/redhat/oracleasm-2.4.21-EL.spec.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/redhat/oracleasm-2.4.21-EL.spec.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,249 +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)
-%define buildup 1
-%define buildsmp 1
-%define buildhugemem 1
-%define builddebug 0
-
-# From the EL3 kernel specfile
-%ifnarch i686
-%define buildhugemem 0
-%endif
-
-%ifarch s390 s390x
-%define buildsmp 0
-%endif
-%ifarch ppc64pseries ppc64iseries
-%define buildsmp 0
-%endif
-%ifarch ia64
-%define buildsmp 0
-%endif
-%ifarch ia32e
-%define buildsmp 0
-%endif
-
-
-# This must be changed to the minimum ABI compat kernel version expected
-%define base 2.4.21
-%define abi 2.4.21-EL
-%define kver %{base}-15.EL
-
-# The minimum -support package required for the kernel bits.
-%define support_ver 1.0.2
-
-Summary: The Oracle Automatic Storage Management library driver.
-Name: oracleasm-%{abi}
-Version: @DIST_VERSION@
-Release: @RPM_VERSION@
-Copyright: GPL
-Group: System Environment/Kernel
-Source: oracleasm- at DIST_VERSION@.tar.gz
-URL: http://oss.oracle.com/
-Distribution: Oracle
-Vendor: Oracle Corporation
-Packager: Joel Becker <joel.becker at oracle.com>
-Provides: oracleasm = %{version}
-AutoReqProv: no
-Requires: kernel >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-
-
-BuildRoot: %{_tmppath}/oracleasm-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
-
-
-%description
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for uniprocessor kernels.
-
-%if %{buildsmp}
-%package smp
-Summary: The Oracle Automatic Storage Management library driver for SMP systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-smp >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description smp
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for symmetric multiprocessor kernels.
-%endif
-
-
-%if %{buildhugemem}
-%package hugemem
-Summary: The Oracle Automatic Storage Management library driver for hugemem systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-hugemem >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description hugemem
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for symmetric multiprocessor kernels on
-machines with more than 16GB of RAM.
-%endif
-
-
-%if %{builddebug}
-%package debug
-Summary: The Oracle Automatic Storage Management library driver for debugging systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-debug >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description debug
-Kenrel driver for the Oracle Automatic Storage Management library.
-This package is compiled for debugging kernels.
-%endif
-
-
-
-
-%prep
-%setup -n oracleasm-%{version}
-
-
-%build
-# Hack to find a good source tree
-KVER=""
-if test -d "/usr/src/linux-%{kver}"; then
- KVER="%{kver}"
-else
- CURKVER="`uname -r | awk '{sub(/smp$|hugemem$|debug$/,"");print}'`"
- case "$CURKVER" in
- %{base}*)
- if test -d "/usr/src/linux-${CURKVER}"; then
- KVER="${CURKVER}"
- fi
- ;;
- *)
- ;;
- esac
-fi
-
-if test -z "$KVER" ; then
- if test -d "/usr/src/linux-2.4" ; then
- KPATH="/usr/src/linux-2.4"
- elif test -d "/usr/src/linux" ; then
- KPATH="/usr/src/linux"
- else
- echo "No kernel tree to build from!" >&2
- exit 1
- fi
-else
- KPATH="/usr/src/linux-${KVER}"
-fi
-
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-
-%if %{buildup}
-make KVER=up
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-ABI/oracleasm" install
-%endif
-
-%if %{buildsmp}
-make clean
-make KVER=smp
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-smp-ABI/oracleasm" install
-%endif
-
-%if %{buildhugemem}
-make clean
-make KVER=hugemem
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-hugemem-ABI/oracleasm" install
-%endif
-
-%if %{builddebug}
-make clean
-make KVER=debug
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-debug-ABI/oracleasm" install
-%endif
-
-
-
-%install
-
-
-
-%clean
-rm -rf "$RPM_BUILD_ROOT"
-
-
-
-%if %{buildup}
-%post
-/etc/init.d/oracleasm link
-
-%files
-%defattr(-,root,root)
-/lib/modules/%{abi}-ABI/oracleasm
-%endif
-
-%if %{buildsmp}
-%post smp
-/etc/init.d/oracleasm link
-
-%files smp
-%defattr(-,root,root)
-/lib/modules/%{abi}-smp-ABI/oracleasm
-%endif
-
-%if %{buildhugemem}
-%post hugemem
-/etc/init.d/oracleasm link
-
-%files hugemem
-%defattr(-,root,root)
-/lib/modules/%{abi}-hugemem-ABI/oracleasm
-%endif
-
-%if %{builddebug}
-%post debug
-/etc/init.d/oracleasm link
-
-%files debug
-%defattr(-,root,root)
-/lib/modules/%{abi}-debug-ABI/oracleasm
-%endif
-
-
-
-%changelog
-* Tue Jan 13 2004 Joel Becker <joel.becker at oracle.com>
-- Kernel-only EL3 specfile.
-
-* 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: branches/extended/vendor/redhat/oracleasm-2.4.9-e.spec.in
===================================================================
--- branches/extended/vendor/redhat/oracleasm-2.4.9-e.spec.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/redhat/oracleasm-2.4.9-e.spec.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,285 +0,0 @@
-#
-# Spec file for oracleasm
-#
-
-# Macros
-# This one is hardcoded because, well, it belongs there
-%define _prefix /usr
-
-# Turn on's and off's (summit and debug not used but added
-# for future proofing)
-%define buildup 1
-%define buildsmp 1
-%define buildenterprise 1
-%define buildsummit 0
-%define builddebug 0
-
-
-# This must be changed to the minimum ABI compat kernel version expected
-%define base 2.4.9-e
-%define kver %{base}.25
-
-# The minimum -support package required for the kernel bits.
-%define support_ver 1.0.2
-
-Summary: The Oracle Automatic Storage Management library driver.
-Name: oracleasm-%{base}
-Version: @DIST_VERSION@
-Release: @RPM_VERSION@
-Copyright: GPL
-Group: System Environment/Kernel
-Source: oracleasm- at DIST_VERSION@.tar.gz
-URL: http://oss.oracle.com/
-Distribution: Oracle
-Vendor: Oracle Corporation
-Packager: Joel Becker <joel.becker at oracle.com>
-Provides: oracleasm = %{version}
-AutoReqProv: no
-Requires: kernel >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-
-
-BuildRoot: %{_tmppath}/oracleasm-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
-
-
-%description
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for uniprocessor kernels.
-
-%if %{buildsmp}
-%package smp
-Summary: The Oracle Automatic Storage Management library driver for SMP systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-smp >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description smp
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for symmetric multiprocessor kernels.
-%endif
-
-
-%if %{buildenterprise}
-%package enterprise
-Summary: The Oracle Automatic Storage Management library driver for enterprise systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-enterprise >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description enterprise
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for symmetric processor kernels on machines
-with more than 4GB of RAM.
-%endif
-
-
-%if %{buildsummit}
-%package summit
-Summary: The Oracle Automatic Storage Management library driver for summit based systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-summit >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description summit
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for summit based symmetric processor kernels
-eg IBM's x440
-%endif
-
-
-%if %{builddebug}
-%package debug
-Summary: The Oracle Automatic Storage Management library driver for debugging systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-Requires: kernel-debug >= %{kver}
-Requires: oracleasm-support >= %{support_ver}
-BuildRequires: kernel-source >= %{kver}
-AutoReqProv: no
-
-
-%description debug
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for debugging kernels.
-%endif
-
-
-%prep
-%setup -n oracleasm-%{version}
-
-
-%build
-# Hack to find a good source tree
-KVER=""
-if test -d "/usr/src/linux-%{kver}"; then
- KVER="%{kver}"
-else
- CURKVER="`uname -r | awk '{sub(/smp$|enterprise$|summit$|debug$/,"");print}'`"
- case "$CURKVER" in
- %{base}*)
- if test -d "/usr/src/linux-${CURKVER}"; then
- KVER="${CURKVER}"
- fi
- ;;
- *)
- ;;
- esac
-fi
-
-if test -z "$KVER" ; then
- if test -d "/usr/src/linux-2.4" ; then
- KPATH="/usr/src/linux-2.4"
- elif test -d "/usr/src/linux" ; then
- KPATH="/usr/src/linux"
- else
- echo "No kernel tree to build from!" >&2
- exit 1
- fi
-else
- KPATH="/usr/src/linux-${KVER}"
-fi
-
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-
-%if %{buildup}
-make KVER=up
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-ABI/oracleasm" install
-%endif
-
-%if %{buildsmp}
-make clean
-make KVER=smp
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-smp-ABI/oracleasm" install
-%endif
-
-%if %{buildenterprise}
-make clean
-make KVER=ent
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-enterprise-ABI/oracleasm" install
-%endif
-
-%if %{builddebug}
-make clean
-make KVER=debug
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-debug-ABI/oracleasm" install
-%endif
-
-
-%if %{buildsummit}
-cd ..
-# Now to find a summit source tree
-KVER=""
-if test -d "/usr/src/linux-%{kver}summit"; then
- KVER="%{kver}summit"
-else
- CURKVER="`uname -r | awk '{sub(/smp$|enterprise$|summit$|debug$/,"");print}'`"
- case "$CURKVER" in
- %{base}*)
- if test -d "/usr/src/linux-${CURKVER}summit"; then
- KVER="${CURKVER}summit"
- fi
- ;;
- *)
- ;;
- esac
-fi
-
-if test -z "$KVER" ; then
- echo "No summit tree to build from!" >&2
- exit 1
-fi
-
-KPATH="/usr/src/linux-${KVER}"
-
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-
-make clean
-make KVER=summit
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-summit-ABI/oracleasm" install
-%endif
-
-
-
-%install
-
-
-
-%clean
-rm -rf "$RPM_BUILD_ROOT"
-
-
-%if %{buildup}
-%post
-/etc/init.d/oracleasm link
-
-%files
-%defattr(-,root,root)
-/lib/modules/%{base}-ABI/oracleasm
-%endif
-
-%if %{buildsmp}
-%post smp
-/etc/init.d/oracleasm link
-
-%files smp
-%defattr(-,root,root)
-/lib/modules/%{base}-smp-ABI/oracleasm
-%endif
-
-%if %{buildenterprise}
-%post enterprise
-/etc/init.d/oracleasm link
-
-%files enterprise
-%defattr(-,root,root)
-/lib/modules/%{base}-enterprise-ABI/oracleasm
-%endif
-
-%if %{buildsummit}
-%post summit
-/etc/init.d/oracleasm link
-
-%files summit
-%defattr(-,root,root)
-/lib/modules/%{base}-summit-ABI/oracleasm
-%endif
-
-%if %{builddebug}
-%post debug
-/etc/init.d/oracleasm link
-
-%files debug
-%defattr(-,root,root)
-/lib/modules/%{base}-debug-ABI/oracleasm
-%endif
-
-
-
-%changelog
-* Tue Jan 13 2004 Joel Becker <joel.becker at oracle.com>
-- Strip out userspace.
-
-* Wed Nov 12 2003 Joel Becker <joel.becker at oracle.com>
-- Start ASM transition
-
-* 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: branches/extended/vendor/redhat/oracleasm.init.in
===================================================================
--- branches/extended/vendor/redhat/oracleasm.init.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/redhat/oracleasm.init.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,407 +0,0 @@
-#! /bin/sh
-# init fragment for oracleasm
-#
-# chkconfig: 2345 29 20
-# description: ASM ABI link fixup.
-
-#
-# Note that the start priority is 26. This is the same as raw devices.
-# It seemed appropriate.
-#
-#
-
-
-# Force LC_ALL=C
-export LC_ALL=C
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-
-# Source init.d functions
-. /etc/init.d/functions
-
-# Source common functions
-. ${libdir}/oracleasm/oracleasm.init.functions
-
-# Source configuration
-[ -f /etc/sysconfig/oracleasm ] && . /etc/sysconfig/oracleasm
-
-
-KVER="`uname -r`"
-case "$KVER" in
-2.4.9-e.*)
- BASE_VER=2.4.9-e
- BASE_STR=2.4.9-e
- ;;
-2.4.18-e.*)
- echo -n "Checking for Red Hat enterprise kernel: "
- failure $"Red Hat Advanced Server 2.1 for IA-64 is not suppported;"
- echo
- exit 1
- ;;
-2.4.21-*.EL*)
- BASE_VER=2.4.21-
- BASE_STR=2.4.21-EL
- ;;
-*)
- echo -n "Checking for Red Hat enterprise kernel: "
- failure $"Kernel ${KVER} is not a Red Hat enterprise release;"
- echo
- exit 1
- ;;
-esac
-
-check_ver()
-{
- VERNUM="$1"
- case "$VERNUM" in
- [0-9])
- ;;
- [1-9][0-9])
- ;;
- [1-9][0-9][0-9])
- ;;
- *)
- echo -n "Checking for Red Hat enterprise kernel: "
- failure $"Kernel ${KVER} is not a Red Hat enterprise release;"
- echo
- exit 1
- ;;
- esac
-}
-
-EVER="${KVER#${BASE_VER}}"
-ETYPE=""
-case "$EVER" in
-*hugemem)
- ETYPE=hugemem
- ;;
-*smp)
- ETYPE=smp
- ;;
-*enterprise)
- if test "$BASE_VER" = "2.4.9-e"
- then
- ETYPE=enterprise
- fi
- ;;
-*summit)
- if test "$BASE_VER" = "2.4.9-e"
- then
- ETYPE=summit
- fi
- ;;
-*[0-9])
- ETYPE=up
- ;;
-*[0-9].EL)
- # UP on RHEL 3
- ETYPE=up
- ;;
-*[0-9].ELorafw*)
- # UP on RHEL 3 orafw
- check_ver "${EVER#*orafw}"
- ETYPE=up
- ;;
-esac
-
-if test -z "$ETYPE"
-then
- echo -n "Checking for Red Hat enterprise kernel: "
- failure $"Kernel ${KVER} is not a Red Hat enerprise release;"
- echo
- exit 1
-fi
-
-case "$EVER" in
-*.EL)
- EVER="${EVER%.EL}"
- ;;
-*)
- ;;
-esac
-
-if test "$ETYPE" = "up"
-then
- ETYPE=""
-fi
-case "$BASE_STR" in
-2.4.21-EL)
- case "$EVER" in
- *ELorafw*)
- EVER="${EVER%${ETYPE}}"
- check_ver "${EVER#*orafw}"
- EVER="${EVER%.ELorafw*}"
- ;;
- *)
- EVER="${EVER%.EL${ETYPE}}"
- ;;
- esac
- ;;
-*)
- EVER="${EVER%${ETYPE}}"
- ;;
-esac
-
-EMAJOR=0
-EMINOR=0
-EMICRO=0
-EVER="${EVER#.}"
-EMAJOR="${EVER%%.*}"
-check_ver $EMAJOR
-ETMP="${EVER#${EMAJOR}}"
-ETMP="${ETMP#.}"
-if test -n "$ETMP"
-then
- EMINOR="${ETMP%%.*}"
- check_ver $EMINOR
- ETMP="${ETMP#${EMINOR}}"
- ETMP="${ETMP#.}"
-fi
-if test -n "$ETMP"
-then
- EMICRO="${ETMP%%.*}"
- check_ver $EMICRO
- ETMP="${ETMP#${EMICRO}}"
- ETMP="${ETMP#.}"
-fi
-if test -n "$ETMP"
-then
- echo -n "Checking for Red Hat enterprise kernel: "
- failure $"Kernel ${KVER} is not a Red Hat enterprise release;"
- echo
- exit 1
-fi
-
-# This is for path happiness...
-if test "$ETYPE" != ""
-then
- ETYPE="${ETYPE}-"
-fi
-MODPATH="/lib/modules/${KVER}/kernel/drivers/addon/oracleasm"
-OBJPATH="/lib/modules/${BASE_STR}-${ETYPE}ABI/oracleasm"
-MODNAME="oracleasm"
-if [ -z "${ORACLE_ASMMANAGER}" ]
-then
- ORACLE_ASMMANAGER="/dev/oracleasm"
-fi
-
-
-
-if_fail()
-{
- RC="$1"
- if [ "$RC" = "0" ]
- then
- success
- echo
- return
- elif [ "$RC" = "2" ]
- then
- return
- fi
- failure $"$2;"
- echo
- exit 1
-}
-
-
-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" -o ! -r "${OBJPATH}/${MODNAME}.o" ]
- 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: "
- if grep '^oracleasm ' /proc/modules >/dev/null 2>&1
- then
- success $"ASM is already loaded; status"
- echo
- echo -n $"Checking if $ORACLE_ASMMANAGER is mounted: "
- ORACLE_ASMMANAGERSEARCH="`echo $ORACLE_ASMMANAGER | sed -e 's/\//\\\\\//g'`"
- if grep "^oracleasmfs $ORACLE_ASMMANAGERSEARCH oracleasmfs" /proc/mounts >/dev/null 3>&1
- then
- success $"$ORACLE_ASMMANAGER is already mounted; status"
- echo
- exit 0
- else
- failure $"$ORACLE_ASMMANAGER is not mounted; status"
- echo
- exit 1
- fi
- else
- failure $"ASM is not loaded; status"
- echo
- exit 1
- fi
- ;;
-
- 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)
- ls -1 "${ORACLE_ASMMANAGER}/disks/"
- ;;
-
- querydisk)
- if [ -z "$2" ]
- then
- echo "Action \"querydisk\" requires an argument" >&2
- exit 1
- fi
- case "$2" in
- */*)
- check_disk "$2"
- ;;
- *)
- UPDISK="`upper_disk "$2"`"
- check_disk "$UPDISK"
- ;;
- esac
- ;;
-
- 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
-
Modified: branches/extended/vendor/suse/Makefile
===================================================================
--- branches/extended/vendor/suse/Makefile 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/suse/Makefile 2005-02-23 19:41:56 UTC (rev 282)
@@ -2,8 +2,6 @@
include $(TOPDIR)/Preamble.make
-DIST_FILES = \
- oracleasm.init.in \
- oracleasm-2.6.5.spec-generic.in
+DIST_FILES = oracleasm-2.6.5.spec-generic.in
include $(TOPDIR)/Postamble.make
Modified: branches/extended/vendor/suse/oracleasm-2.6.5.spec-generic.in
===================================================================
--- branches/extended/vendor/suse/oracleasm-2.6.5.spec-generic.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/suse/oracleasm-2.6.5.spec-generic.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -73,7 +73,7 @@
%define kver %{base}-%{sver}
# The minimum -support package required for the kernel bits.
-%define support_ver 1.0.90
+%define support_ver 1.0.94
Summary: The Oracle Automatic Storage Management library driver.
Name: oracleasm-%{kver}
@@ -269,107 +269,156 @@
%if %{builddefault}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/default"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-default/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-default/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-default/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{buildsmp}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/smp"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-smp/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-smp/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-smp/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{buildbigsmp}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/bigsmp"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-bigsmp/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-bigsmp/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-bigsmp/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{build64kpagesize}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/64k-pagesize"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-64k-pagesize/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-64k-pagesize/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-64k-pagesize/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{buildsn2}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/sn2"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-sn2/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-sn2/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-sn2/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{buildiseries64}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/iseries64"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-iseries64/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-iseries64/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-iseries64/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{buildpmac64}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/pmac64"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-pmac64/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pmac64/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pmac64/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{buildpseries64}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/pseries64"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-pseries64/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pseries64/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pseries64/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{builds390}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/s390"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-s390/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
%if %{builds390x}
KPATH="/usr/src/linux-%{kver}-obj/%{karch}/s390x"
-%configure --sbindir=/usr/sbin --with-kernel="${KPATH}"
-cd kernel
-make
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-s390x/kernel/drivers/addon/oracleasm" install
+%configure --with-kernel="${KPATH}"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390x/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390x/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
make clean
-cd ..
%endif
-
%install
Deleted: branches/extended/vendor/suse/oracleasm.init.in
===================================================================
--- branches/extended/vendor/suse/oracleasm.init.in 2005-02-17 18:48:45 UTC (rev 281)
+++ branches/extended/vendor/suse/oracleasm.init.in 2005-02-23 19:41:56 UTC (rev 282)
@@ -1,259 +0,0 @@
-#! /bin/sh
-# init fragment for asmlib
-#
-### 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
-
-#
-# Note that the start priority is after the network comes up.
-# There is no real automatic mounting yet.
-#
-
-# Force LC_ALL=C
-export LC_ALL=C
-
-# Source init.d functions
-. /etc/rc.status
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-. ${libdir}/oracleasm/oracleasm.init.functions
-
-# Source networking configuration
-[ -f /etc/sysconfig/oracleasm ] && . /etc/sysconfig/oracleasm
-
-
-rc_reset
-
-if [ -z "$ORACLE_ASMMANAGER" ]
-then
- ORACLE_ASMMANAGER=/dev/oracleasm
-fi
-MODNAME=oracleasm
-
-KVER="`uname -r`"
-MODPATH="/lib/modules/${KVER}/kernel/drivers/addon/oracleasm"
-
-
-
-
-if_fail()
-{
- RC="$1"
- if [ "$RC" = "0" ]
- then
- true
- rc_status -v
- return
- elif [ "$RC" = "2" ]
- then
- return
- fi
- false
- rc_status -v
- rc_exit
-}
-
-
-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
- return
- 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: "
- if grep '^oracleasm ' /proc/modules >/dev/null 2>&1
- then
- rc_status -v
- echo -n $"Checking if $ORACLE_ASMMANAGER is mounted: "
- ORACLE_ASMMANAGERSEARCH="`echo $ORACLE_ASMMANAGER | sed -e 's/\//\\\\\//g'`"
- if grep "^oracleasmfs $ORACLE_ASMMANAGERSEARCH oracleasmfs" /proc/mounts >/dev/null 2>&1
- then
- rc_status -v
- rc_exit
- else
- rc_status -v
- rc_exit
- fi
- else
- false
- rc_status -v
- rc_exit
- fi
- ;;
-
- 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 "$2" "$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)
- ls -1 "${ORACLE_ASMMANAGER}/disks/"
- ;;
-
- querydisk)
- if [ -z "$2" ]
- then
- echo "Action \"querydisk\" requires an argument" >&2
- exit 1
- fi
- case "$2" in
- */*)
- check_disk "$2"
- ;;
- *)
- UPDISK="`upper_disk "$2"`"
- check_disk "$UPDISK"
- ;;
- esac
- ;;
-
- scandisks)
- scandisks
- ;;
-
- stop)
- stop
- ;;
-
- restart)
- stop
- start
- ;;
-
- *)
- echo "Usage: $0 {start|stop|restart|enable|disable|configure|createdisk|renamedisk|deletedisk|querydisk|listdisks|scandisks|status}"
- exit 1
-esac
-
-rc_exit
More information about the Oracleasm-commits
mailing list