[Ocfs2-commits] manish commits r2206 - in trunk: . fs fs/configfs
fs/ocfs2 fs/ocfs2/cluster fs/ocfs2/dlm kapi-compat/include
vendor/redhat
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Apr 29 21:31:40 CDT 2005
Author: manish
Signed-off-by: jlbec
Date: 2005-04-29 21:31:39 -0500 (Fri, 29 Apr 2005)
New Revision: 2206
Added:
trunk/kapi-compat/include/rb_last.h
Removed:
trunk/Kbuild-24.make
trunk/fs/configfs/compat_kref.c
trunk/fs/configfs/compat_libfs.c
trunk/fs/configfs/compatinclude/
trunk/fs/ocfs2/24io.c
trunk/fs/ocfs2/cluster/cl_compat.h
trunk/fs/ocfs2/dlm/dlmfs_compat.c
trunk/fs/ocfs2/dlm/dlmfs_compat.h
trunk/fs/ocfs2/ocfs_compat.c
trunk/fs/ocfs2/ocfs_compat.h
trunk/kapi-compat/include/kcalloc.h
trunk/kapi-compat/include/msecs_to_jiffies.h
trunk/kapi-compat/include/wait_event_interruptible_timeout.h
trunk/kapi-compat/include/wait_event_timeout.h
trunk/vendor/redhat/ocfs2-2.4.21-EL.spec-generic.in
Modified:
trunk/Config.make.in
trunk/Makefile
trunk/configure.in
trunk/fs/Makefile
trunk/fs/configfs/Makefile
trunk/fs/configfs/configfs_internal.h
trunk/fs/configfs/dir.c
trunk/fs/configfs/inode.c
trunk/fs/configfs/mount.c
trunk/fs/ocfs2/Makefile
trunk/fs/ocfs2/aio.c
trunk/fs/ocfs2/aio.h
trunk/fs/ocfs2/alloc.c
trunk/fs/ocfs2/aops.c
trunk/fs/ocfs2/buffer_head_io.c
trunk/fs/ocfs2/buffer_head_io.h
trunk/fs/ocfs2/cluster/Makefile
trunk/fs/ocfs2/cluster/heartbeat.c
trunk/fs/ocfs2/cluster/nodemanager.c
trunk/fs/ocfs2/cluster/tcp.c
trunk/fs/ocfs2/cluster/tcp.h
trunk/fs/ocfs2/dcache.c
trunk/fs/ocfs2/dir.c
trunk/fs/ocfs2/dlm/Makefile
trunk/fs/ocfs2/dlm/dlmfs.c
trunk/fs/ocfs2/dlm/dlmthread.c
trunk/fs/ocfs2/dlm/userdlm.h
trunk/fs/ocfs2/dlmglue.c
trunk/fs/ocfs2/extent_map.c
trunk/fs/ocfs2/file.c
trunk/fs/ocfs2/file.h
trunk/fs/ocfs2/heartbeat.c
trunk/fs/ocfs2/inode.c
trunk/fs/ocfs2/journal.c
trunk/fs/ocfs2/localalloc.c
trunk/fs/ocfs2/mmap.c
trunk/fs/ocfs2/namei.c
trunk/fs/ocfs2/ocfs.h
trunk/fs/ocfs2/proc.c
trunk/fs/ocfs2/slot_map.c
trunk/fs/ocfs2/suballoc.c
trunk/fs/ocfs2/super.c
trunk/fs/ocfs2/symlink.c
trunk/fs/ocfs2/sysfile.c
trunk/fs/ocfs2/vote.c
trunk/vendor/redhat/Makefile
Log:
Get rid of 2.4 kernel support. Say good bye to a ton of ugly compatibility
code.
Signed-off-by: jlbec
Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/Config.make.in 2005-04-30 02:31:39 UTC (rev 2206)
@@ -43,25 +43,12 @@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
-KERNEL_26 = @KERNEL_26@
-
KERNELDIR = @KERNELDIR@
KERNELINC = $(KERNELDIR)/include
-KERNELVER = @KERNELVER@
-# we have to be careful to -include our compat headers after modversions
-# in case the compat code tries to use modversioned symbols
-MODULEDIR = @MODULEDIR@
-MODVERSIONS = @MODVERSIONS@
-
-GCCINC = @GCCINC@
-
ARCH_XEN = @ARCH_XEN@
-
-KVER =
else
MAKEBO_VERSION = @VERSION@
-endif
EXTRA_CFLAGS += @KAPI_COMPAT_CFLAGS@
@@ -70,13 +57,10 @@
BACKING_DEV_CAPABILITIES = @BACKING_DEV_CAPABILITIES@
IDR_GET_NEW_RETURNS_ID = @IDR_GET_NEW_RETURNS_ID@
-COMPAT_SAFE_WRITE = @COMPAT_SAFE_WRITE@
-
OCFS_DEBUG = @OCFS_DEBUG@
+
ifneq ($(OCFS_DEBUG),)
EXTRA_CFLAGS += -g
endif
-OCFS_LARGEIO = @OCFS_LARGEIO@
-OCFS_TRACE = @OCFS_TRACE@
-OCFS_PROCESSOR = @OCFS_PROCESSOR@
+endif
Deleted: trunk/Kbuild-24.make
===================================================================
--- trunk/Kbuild-24.make 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/Kbuild-24.make 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,113 +0,0 @@
-
-#
-# This is a Makefile for 2.4 external module builds. Red Hat
-# Enterprise Linux does not support the usual:
-#
-# make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules
-#
-# So we must hand-roll our compile lines. This is in a seperate
-# file to keep the regular Makefile readable.
-#
-# This uses the Makebo schema. So, the compile parts are filled in.
-# All Makefiles using this code should set MODULE_CFLAGS and
-# MODULE_DEFINES for any extra cflags/defines needed.
-#
-
-WARNINGS = -Wall -Wstrict-prototypes
-OPTIMIZE = -O2
-
-KERNEL_DEFINES = -D__KERNEL__ -DMODULE -DLINUX -DEXPORT_SYMTAB
-KERNEL_CFLAGS = -pipe -nostdinc -fno-strict-aliasing -fno-common \
- -fomit-frame-pointer
-KERNEL_LDADD = -nostdlib
-
-#
-# These arch-specific flags would normally be provided by the
-# kbuild system. Hope we got them right.
-#
-
-ifeq ($(OCFS_PROCESSOR),ppc64)
- MACH_CFLAGS += -m64 -fsigned-char -fno-builtin -msoft-float \
- -mminimal-toc
- MACH_LDADD += -m elf64ppc
-endif
-ifeq ($(OCFS_PROCESSOR),x86_64)
- MACH_CFLAGS += -m64 -mcmodel=kernel
-endif
-ifeq ($(OCFS_PROCESSOR),s390x)
- MACH_CFLAGS += -fno-strength-reduce -fpic
- MACH_LDADD += -m elf64_s390
-endif
-
-
-#
-# RHEL tree hacks. RHEL 2.4 kernel source trees have a tricked-out
-# autoconf.h that contains all the possible configurations
-# mapped by ifdefs. So, these magic defines switch among the
-# configurations. The KVER make variable decides which configuration
-# to use.
-#
-
-ifeq ($(KVER),hugemem)
- KVER_DEFINES += -D__BOOT_KERNEL_HUGEMEM=1
- KVER_DEFINES += -D__BOOT_KERNEL_SMP=0
- KVER_DEFINES += -D__BOOT_KERNEL_UP=0
-endif
-ifeq ($(KVER),smp)
- KVER_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
- KVER_DEFINES += -D__BOOT_KERNEL_SMP=1
- KVER_DEFINES += -D__BOOT_KERNEL_UP=0
-endif
-ifeq ($(KVER),up)
- KVER_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
- KVER_DEFINES += -D__BOOT_KERNEL_SMP=0
- KVER_DEFINES += -D__BOOT_KERNEL_UP=1
-endif
-
-
-INCLUDES = -I. -I$(TOPDIR) -I$(KERNELINC) -I$(GCCINC)
-DEFINES = $(KERNEL_DEFINES) $(KVER_DEFINES)
-CFLAGS = $(OPTIMIZE) $(KERNEL_CFLAGS) $(MACH_CFLAGS) $(MODVERSIONS) \
- $(WARNINGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
-LDADD = $(KERNEL_LDADD) $(MACH_LDADD)
-
-#
-# Ripping off some kbuild 2.6 tricks
-#
-
-# Modules that have multiple parts.
-multi-used-m := $(sort $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs))), $(m))))
-multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)))
-
-# Modules that don't.
-single-used-m := $(sort $(filter-out $(multi-used-m), $(obj-m)))
-link_multi_deps = $($(@:.o=-objs))
-
-#
-# It's impossible, AFAICT, to generate the dependancies for each
-# individual object:parts set. In fact, kbuild 2.6 doesn't try either.
-# They use a simpler trick...they force the rebuild like this, but
-# call if_changed on each target to avoid the useless rebuilds.
-# This is a 2.4 hack, so I don't care that much :-)
-#
-$(multi-used-m): $(multi-objs-m)
- $(CC) -Wl,-r -o $@ $(LDADD) $(link_multi_deps)
-
-build-modules: $(single-used-m) $(multi-used-m)
-
-
-# Kbuild uses INSTALL_MOD_PATH for rooted installs. Makebo uses
-# DESTDIR. Folks really should set INSTALL_MOD_PATH, but in case they
-# don't...
-INSTALL_MOD_PATH ?= $(DESTDIR)
-MODLIB = $(INSTALL_MOD_PATH)$(MODULEDIR)
-
-install-modules: $(obj-m)
- $(TOPDIR)/mkinstalldirs $(MODLIB)/$(INSTALL_MOD_DIR)
- for file in $(obj-m); do \
- $(INSTALL_DATA) $$file $(MODLIB)/$(INSTALL_MOD_DIR)/$$file; \
- done
-
-clean-modules:
- rm -f *.o *.p *.s
-
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -9,12 +9,9 @@
KAPI_COMPAT_FILES = \
kapi-compat/include/assert_spin_locked.h \
kapi-compat/include/journal_access.h \
- kapi-compat/include/kcalloc.h \
kapi-compat/include/kref_init.h \
kapi-compat/include/kref_put.h \
- kapi-compat/include/msecs_to_jiffies.h \
- kapi-compat/include/wait_event_interruptible_timeout.h \
- kapi-compat/include/wait_event_timeout.h
+ kapi-compat/include/rbtree.h
DIST_FILES = \
AUTHORS \
@@ -39,25 +36,6 @@
$(TOPDIR)/mkinstalldirs $(DIST_DIR)/kapi-compat/include
#
-# RHEL3
-#
-$(TOPDIR)/vendor/redhat/ocfs2-2.4.21-%.EL.spec: $(TOPDIR)/vendor/redhat/ocfs2-2.4.21-EL.spec-generic
- SPECVER="$@"; \
- SPECVER="$${SPECVER#*ocfs2-2.4.21-}"; \
- SPECVER="$${SPECVER%.EL.spec}"; \
- sed -e 's/^%define sver.*%{generic}$$/%define sver '$${SPECVER}'/' < $< > $@
-
-rhel3_%_srpm: dist $(TOPDIR)/vendor/redhat/ocfs2-2.4.21-%.EL.spec
- rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/redhat/ocfs2-2.4.21-$(patsubst rhel3_%_srpm,%,$@).EL.spec
-
-rhel3_%_rpm: rhel3_%_srpm
- rpmbuild --rebuild $(MODULEARCH) "ocfs2-2.4.21-$(patsubst rhel3_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
- if test "$(MODULEARCH)" = "--target x86_64"; then \
- rpmbuild --rebuild --target ia32e "ocfs2-2.4.21-$(patsubst rhel3_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm" \
- fi
-
-
-#
# RHEL4
#
$(TOPDIR)/vendor/redhat/ocfs2-2.6.9-%.EL.spec: $(TOPDIR)/vendor/redhat/ocfs2-2.6.9-EL.spec-generic
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/configure.in 2005-04-30 02:31:39 UTC (rev 2206)
@@ -90,17 +90,13 @@
esac
AC_MSG_RESULT($OCFS_PROCESSOR)
-AC_SUBST(OCFS_PROCESSOR)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
-AC_PROG_RANLIB
-AC_PATH_PROG(AR, ar)
-
AC_HEADER_STDC
AC_C_CONST
@@ -117,28 +113,6 @@
AC_SUBST(OCFS_DEBUG)
AC_MSG_RESULT($enable_debug)
-AC_MSG_CHECKING(for tracing)
-AC_ARG_ENABLE(trace, [ --enable-trace=[yes/no] Turn on tracing [default=yes]],,enable_trace=yes)
-OCFS_TRACE=
-if test "x$enable_trace" = "xyes"; then
- OCFS_TRACE=yes
-fi
-AC_SUBST(OCFS_TRACE)
-AC_MSG_RESULT($enable_trace)
-
-AC_MSG_CHECKING(for large ios)
-AC_ARG_ENABLE(largeio, [ --enable-largeio=[yes/no/auto] Turn on largeio [default=auto]],,enable_largeio=auto)
-OCFS_LARGEIO=yes
-if test "x$enable_largeio" = "xno"; then
- OCFS_LARGEIO=
-elif test "x$enable_largeio" = "xauto"; then
- if test "$OCFS_PROCESSOR" = "ia64"; then
- OCFS_LARGEIO=
- fi
-fi
-AC_SUBST(OCFS_LARGEIO)
-AC_MSG_RESULT($enable_largeio)
-
kernelroot="/lib/modules/`uname -r`"
AC_MSG_CHECKING(for directory with kernel build tree)
@@ -215,22 +189,14 @@
fi
fi
-KERNEL_26=
case "$kversion" in
- 2.4.*)
- ;;
2.6.*)
- KERNEL_26=yes
;;
*)
- AC_MSG_ERROR([This module only supports kernel version 2.4.x or 2.6.x])
+ AC_MSG_ERROR([This module only supports kernel version 2.6.x])
;;
esac
-AC_SUBST(KERNEL_26)
-KERNELVER=$kversion
-AC_SUBST(KERNELVER)
-
AC_MSG_CHECKING(for Xen kernel)
AC_ARG_WITH(xen, [ --with-xen Build for Xen kernel [default=no]])
ARCH_XEN=
@@ -242,74 +208,13 @@
fi
AC_SUBST(ARCH_XEN)
-COMPAT_SAFE_WRITE=
-if test "x$KERNEL_26" != "xyes"; then
- AC_MSG_CHECKING([for safe write ordering])
- if egrep "EXPORT_SYMBOL.*\(generic_file_write_nolock\);" "$KERNELSRC/kernel/ksyms.c" >/dev/null 2>&1; then
- have_safe_write=yes
- elif egrep "EXPORT_SYMBOL.*\(do_generic_file_write\);" "$KERNELSRC/kernel/ksyms.c" >/dev/null 2>&1; then
- have_safe_write=yes
- COMPAT_SAFE_WRITE=yes
- else
- have_safe_write=no
- fi
- AC_MSG_RESULT($have_safe_write)
-
- if test "$have_safe_write" = "no"; then
- AC_MSG_ERROR([Can't guarantee safe writes, please try a 2.6.x kernel])
- fi
-fi
-AC_SUBST(COMPAT_SAFE_WRITE)
-
-MODVERSIONS=
-if test "x$KERNEL_26" != "xyes"; then
- 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)
-
- if test "x$modversions" = "xyes"; then
- MODVERSIONS="-include \$(KERNELINC)/linux/modversions.h -DMODVERSIONS"
- fi
-fi
-AC_SUBST(MODVERSIONS)
-
-if test "x$KERNEL_26" != "xyes"; then
- AC_MSG_CHECKING([for NPTL support])
-
- saved_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="-I$KERNELINC $saved_CPPFLAGS"
-
- AC_TRY_COMPILE(
-[#define __KERNEL__ 1
-#include <linux/autoconf.h>
-#include <linux/sched.h>],
-[recalc_sigpending ();], have_NPTL=yes, have_NPTL=no)
-
- CPPFLAGS="$saved_CPPFLAGS"
-
- AC_MSG_RESULT($have_NPTL)
-
- if test "x$have_NPTL" = "xno"; then
- AC_MSG_ERROR([No NPTL support, please try a 2.6.x kernel])
- fi
-fi
-
MISSING_SOCK_CREATE_LITE=
OCFS2_CHECK_KERNEL(sock_create_lite, net.h,, MISSING_SOCK_CREATE_LITE=yes)
AC_SUBST(MISSING_SOCK_CREATE_LITE)
-OCFS2_KERNEL_COMPAT(msecs_to_jiffies, [jiffies.h time.h])
-OCFS2_KERNEL_COMPAT(wait_event_timeout, wait.h)
-OCFS2_KERNEL_COMPAT(wait_event_interruptible_timeout, wait.h)
-OCFS2_KERNEL_COMPAT(kcalloc, slab.h)
OCFS2_KERNEL_COMPAT(assert_spin_locked, spinlock.h)
+OCFS2_KERNEL_COMPAT(rb_last, rbtree.h)
-#this check will break for 2.4 kernels...
OCFS2_CHECK_KERNEL([kref_init with release callback], kref.h,
kref_compat_header="kref_put.h", kref_compat_header="kref_init.h",
[kref_init.*release])
@@ -339,31 +244,7 @@
done
AC_SUBST(KAPI_COMPAT_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>/kernel]]], moddir="$withval", moddir="/lib/modules/$kversion/kernel")
-AC_MSG_RESULT($moddir)
-
-MODULEDIR=$moddir
-AC_SUBST(MODULEDIR)
-
-if test "x$KERNEL_26" = "xyes"; then
- gccdir=
-else
- AC_MSG_CHECKING(for gcc include path)
- gccdir=`$CC -print-file-name=include`
- if test -z "$gccdir"; then
- AC_MSG_RESULT(not found)
- AC_MSG_ERROR(Could not determine gcc include path)
- else
- AC_MSG_RESULT($gccdir)
- fi
-fi
-
-GCCINC=$gccdir
-AC_SUBST(GCCINC)
-
AC_OUTPUT([Config.make
-vendor/redhat/ocfs2-2.4.21-EL.spec-generic
vendor/redhat/ocfs2-2.6.9-EL.spec-generic
vendor/suse/ocfs2-2.6.5.spec-generic
])
Modified: trunk/fs/Makefile
===================================================================
--- trunk/fs/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -28,14 +28,9 @@
else
#
-# Called from a regular "make".
+# Called from a regular "make". Just forward to kbuild.
#
-ifneq ($(KERNEL_26),)
-#
-# This is a 2.6 kernel. Just forward to kbuild.
-#
-
ALL_RULES = build-modules
CLEAN_RULES = clean-modules
@@ -61,17 +56,7 @@
-rm ocfs2/stamp-md5
-rm ocfs2/cluster/stamp-md5
-rm ocfs2/dlm/stamp-md5
-else
-#
-# This is a 2.4 kernel. Let Makebo handle recursion.
-#
-# WARNING WARNING WARNING HACK HACK HACK
-# 2.4 doesn't build configfs yet
-SUBDIRS = $(SAFE_SUBDIRS)
-
-endif
-
include $(TOPDIR)/Postamble.make
endif
Modified: trunk/fs/configfs/Makefile
===================================================================
--- trunk/fs/configfs/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -27,23 +27,15 @@
HEADERS = \
configfs.h \
- configfs_internal.h \
- compatinclude/linux/compat.h \
- compatinclude/linux/kref.h \
- compatinclude/linux/compat_libfs.h
+ configfs_internal.h
-# Get the kobject includes, as this is a 2.4 build
-EXTRA_CFLAGS += -I$(TOPDIR)/fs/configfs/compatinclude
-
CONFIGFS_SOURCES = \
dir.c \
file.c \
inode.c \
item.c \
mount.c \
- symlink.c \
- compat_kref.c \
- compat_libfs.c
+ symlink.c
CONFIGFS_OBJECTS = $(subst .c,.o,$(CONFIGFS_SOURCES))
@@ -68,17 +60,6 @@
INSTALL_RULES = install-modules
-DIST_RULES = dist-subdircreate
-
-dist-subdircreate:
- $(TOPDIR)/mkinstalldirs $(DIST_DIR)/compatinclude/linux
-
-
-ifneq ($(KERNEL_26),)
-#
-# This is a 2.6 kernel. Just forward to kbuild.
-#
-
build-modules:
$(MAKE) -C $(TOPDIR)/fs build-modules
@@ -87,16 +68,7 @@
clean-modules:
$(MAKE) -C $(TOPDIR)/fs clean-modules
-else
-#
-# This is a 2.4 kernel. Because Red Hat's source tree is whack, do
-# everything by hand.
-#
-include $(TOPDIR)/Kbuild-24.make
-
-endif
-
include $(TOPDIR)/Postamble.make
endif
Deleted: trunk/fs/configfs/compat_kref.c
===================================================================
--- trunk/fs/configfs/compat_kref.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/compat_kref.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,59 +0,0 @@
-/*
- * kref.c - library routines for handling generic reference counted objects
- *
- * Copyright (C) 2004 Greg Kroah-Hartman <greg at kroah.com>
- * Copyright (C) 2004 IBM Corp.
- *
- * based on lib/kobject.c which was:
- * Copyright (C) 2002-2003 Patrick Mochel <mochel at osdl.org>
- *
- * This file is released under the GPLv2.
- *
- */
-
-#include "linux/compat.h"
-#include <linux/kref.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-
-/**
- * kref_init - initialize object.
- * @kref: object in question.
- */
-void kref_init(struct kref *kref)
-{
- atomic_set(&kref->refcount,1);
-}
-
-/**
- * kref_get - increment refcount for object.
- * @kref: object.
- */
-void kref_get(struct kref *kref)
-{
- WARN_ON(!atomic_read(&kref->refcount));
- atomic_inc(&kref->refcount);
-}
-
-/**
- * kref_put - decrement refcount for object.
- * @kref: object.
- * @release: pointer to the function that will clean up the object when the
- * last reference to the object is released.
- * This pointer is required, and it is not acceptable to pass kfree
- * in as this function.
- *
- * Decrement the refcount, and if 0, call release().
- */
-void kref_put(struct kref *kref, void (*release) (struct kref *kref))
-{
- WARN_ON(release == NULL);
- WARN_ON(release == (void (*)(struct kref *))kfree);
-
- if (atomic_dec_and_test(&kref->refcount))
- release(kref);
-}
-
-EXPORT_SYMBOL(kref_init);
-EXPORT_SYMBOL(kref_get);
-EXPORT_SYMBOL(kref_put);
Deleted: trunk/fs/configfs/compat_libfs.c
===================================================================
--- trunk/fs/configfs/compat_libfs.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/compat_libfs.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,184 +0,0 @@
-#include <linux/module.h>
-#include <linux/pagemap.h>
-#include <linux/mount.h>
-#include <linux/fs.h>
-
-#include "linux/compat.h"
-#include "linux/compat_libfs.h"
-
-
-static inline int simple_positive(struct dentry *dentry)
-{
- return dentry->d_inode && !d_unhashed(dentry);
-}
-
-/*
- * Check that a directory is empty (this works
- * for regular files too, they'll just always be
- * considered empty..).
- *
- * Note that an empty directory can still have
- * children, they just all have to be negative..
- */
-static int simple_empty(struct dentry *dentry)
-{
- struct list_head *list;
-
- spin_lock(&dcache_lock);
- list = dentry->d_subdirs.next;
-
- while (list != &dentry->d_subdirs) {
- struct dentry *de = list_entry(list, struct dentry, d_child);
-
- if (simple_positive(de)) {
- spin_unlock(&dcache_lock);
- return 0;
- }
- list = list->next;
- }
- spin_unlock(&dcache_lock);
- return 1;
-}
-
-/*
- * This works for both directories and regular files.
- * (non-directories will always have empty subdirs)
- */
-int simple_unlink(struct inode * dir, struct dentry *dentry)
-{
- int retval = -ENOTEMPTY;
-
- if (simple_empty(dentry)) {
- struct inode *inode = dentry->d_inode;
-
- inode->i_nlink--;
- dput(dentry); /* Undo the count from "create" - this does all the work */
- retval = 0;
- }
- return retval;
-}
-
-/*
- * Lookup the data. This is trivial - if the dentry didn't already
- * exist, we know it is negative.
- */
-struct dentry * simple_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
-{
- d_add(dentry, NULL);
- return NULL;
-}
-
-int simple_statfs(struct super_block *sb, struct statfs *buf)
-{
- buf->f_type = sb->s_magic;
- buf->f_bsize = PAGE_CACHE_SIZE;
- buf->f_namelen = 255;
- return 0;
-}
-
-int simple_readpage(struct file *file, struct page *page)
-{
- void *kaddr;
-
- if (Page_Uptodate(page))
- goto out;
-
- kaddr = kmap_atomic(page, KM_USER0);
- memset(kaddr, 0, PAGE_CACHE_SIZE);
- kunmap_atomic(kaddr, KM_USER0);
- flush_dcache_page(page);
- SetPageUptodate(page);
-out:
- unlock_page(page);
- return 0;
-}
-
-int simple_prepare_write(struct file *file, struct page *page,
- unsigned from, unsigned to)
-{
- if (!Page_Uptodate(page)) {
- if (to - from != PAGE_CACHE_SIZE) {
- void *kaddr = kmap_atomic(page, KM_USER0);
- memset(kaddr, 0, from);
- memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
- flush_dcache_page(page);
- kunmap_atomic(kaddr, KM_USER0);
- }
- SetPageUptodate(page);
- }
- return 0;
-}
-
-int simple_commit_write(struct file *file, struct page *page,
- unsigned offset, unsigned to)
-{
- struct inode *inode = page->mapping->host;
- loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
-
- /*
- * No need to use i_size_read() here, the i_size
- * cannot change under us because we hold the i_sem.
- */
- if (pos > inode->i_size)
- i_size_write(inode, pos);
- set_page_dirty(page);
- return 0;
-}
-
-static void put_filesystem(struct file_system_type *fs)
-{
- if (fs->owner)
- __MOD_DEC_USE_COUNT(fs->owner);
-}
-
-/*
- * Wow, this is ugly. We go from name -> fstype so we can
- * call 2.4's kern_mount, which goes from type to name and then
- * calls the unexported do_kern_mount from 2.4, which goes from
- * name -> fstype again.
- */
-static struct vfsmount *
-do_kern_mount(const char *fstype, int flags, char *name, void *data)
-{
- struct file_system_type *type = get_fs_type(fstype);
- struct vfsmount *mnt;
-
- if (!type)
- return ERR_PTR(-ENODEV);
- mnt = kern_mount(type);
- put_filesystem(type);
- return mnt;
-}
-
-static spinlock_t pin_fs_lock = SPIN_LOCK_UNLOCKED;
-
-int simple_pin_fs(char *name, struct vfsmount **mount, int *count)
-{
- struct vfsmount *mnt = NULL;
- spin_lock(&pin_fs_lock);
- if (unlikely(!*mount)) {
- spin_unlock(&pin_fs_lock);
- mnt = do_kern_mount(name, 0, name, NULL);
- if (IS_ERR(mnt))
- return PTR_ERR(mnt);
- spin_lock(&pin_fs_lock);
- if (!*mount)
- *mount = mnt;
- }
- mntget(*mount);
- ++*count;
- spin_unlock(&pin_fs_lock);
- mntput(mnt);
- return 0;
-}
-
-void simple_release_fs(struct vfsmount **mount, int *count)
-{
- struct vfsmount *mnt;
- spin_lock(&pin_fs_lock);
- mnt = *mount;
- if (!--*count)
- *mount = NULL;
- spin_unlock(&pin_fs_lock);
- mntput(mnt);
-}
Modified: trunk/fs/configfs/configfs_internal.h
===================================================================
--- trunk/fs/configfs/configfs_internal.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/configfs_internal.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -25,9 +25,6 @@
*/
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#include "linux/compat_libfs.h"
-#endif
#include <linux/slab.h>
#include <linux/list.h>
Modified: trunk/fs/configfs/dir.c
===================================================================
--- trunk/fs/configfs/dir.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/dir.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -835,23 +835,12 @@
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-static inline struct dentry *configfs_lookup_compat(struct inode *dir, struct dentry *dentry)
-{
- return configfs_lookup(dir, dentry, NULL);
-}
-#endif
-
struct inode_operations configfs_dir_inode_operations = {
.mkdir = configfs_mkdir,
.rmdir = configfs_rmdir,
.symlink = configfs_symlink,
.unlink = configfs_unlink,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.lookup = configfs_lookup,
-#else
- .lookup = configfs_lookup_compat,
-#endif
};
#if 0
Modified: trunk/fs/configfs/inode.c
===================================================================
--- trunk/fs/configfs/inode.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/inode.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -63,9 +63,7 @@
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_mapping->a_ops = &configfs_aops;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
inode->i_mapping->backing_dev_info = &configfs_backing_dev_info;
-#endif
}
return inode;
}
Modified: trunk/fs/configfs/mount.c
===================================================================
--- trunk/fs/configfs/mount.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/configfs/mount.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -42,11 +42,7 @@
static struct super_operations configfs_ops = {
.statfs = simple_statfs,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.drop_inode = generic_delete_inode,
-#else
- .put_inode = force_delete
-#endif
};
static struct config_group configfs_root_group = {
@@ -103,7 +99,6 @@
return 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct super_block *configfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
@@ -116,15 +111,7 @@
.get_sb = configfs_get_sb,
.kill_sb = kill_litter_super,
};
-#else
-static struct super_block *configfs_read_super(struct super_block *sb, void *data, int silent)
-{
- return (configfs_fill_super(sb, data, silent) < 0) ? NULL : sb;
-}
-static DECLARE_FSTYPE(configfs_fs_type, "configfs", configfs_read_super, FS_SINGLE);
-#endif
-
int configfs_pin_fs(void)
{
return simple_pin_fs("configfs", &configfs_mount,
Deleted: trunk/fs/ocfs2/24io.c
===================================================================
--- trunk/fs/ocfs2/24io.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/24io.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,471 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * 24io.c
- *
- * O_DIRECT and AIO routines for 2.4 kernels.
- *
- * Copyright (C) 2002, 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-
-#include "ocfs_compat.h"
-
-#include <linux/fs.h>
-#include <linux/types.h>
-#include <linux/iobuf.h>
-
-#define MLOG_MASK_PREFIX ML_FILE_IO
-#include <cluster/masklog.h>
-
-#include "ocfs.h"
-
-#include "alloc.h"
-#include "extent_map.h"
-#include "inode.h"
-
-static int ocfs_get_sector(struct inode *inode, unsigned long isector,
- unsigned long *osector)
-{
- int err = -EIO;
- u64 v_blkno, p_blkno, p_sector;
- int s_to_b_bits, offset;
-
- mlog_entry ("(0x%p, %lu)\n", inode, isector);
-
- err = -EINVAL;
- if (!inode) {
- mlog(ML_ERROR, "bad inode\n");
- goto bail;
- }
-
- s_to_b_bits = inode->i_sb->s_blocksize_bits -
- OCFS_SB(inode->i_sb)->s_sectsize_bits;
- v_blkno = (u64)isector >> s_to_b_bits;
- offset = (int)((u64)isector & ((1ULL << s_to_b_bits) - 1));
- err = ocfs2_extent_map_get_blocks(inode, v_blkno, 1, &p_blkno,
- NULL);
- if (err) {
- mlog_errno(err);
- goto bail;
- }
-
- p_sector = p_blkno << s_to_b_bits;
- p_sector += offset;
- if (p_sector == 0) {
- err = -EIO;
- mlog(ML_ERROR, "isector=%lu inode=%llu\n",
- isector, OCFS_I(inode)->ip_blkno);
- }
-
- /* 2.4 shouldn't ever have this happen */
- OCFS_ASSERT(p_sector <= ULONG_MAX);
-
- *osector = (unsigned long)p_sector;
-
-bail:
- mlog_exit (err);
- return err;
-} /* ocfs_get_sector */
-
-/*
- * ocfs_rw_direct()
- *
- */
-ssize_t ocfs_rw_direct (int rw, struct file *filp, char *buf, size_t size, loff_t * offp)
-{
- struct kiobuf *iobuf;
- int err = 0;
- unsigned long blocknr, blocks, myiosize;
- size_t transferred;
- int iosize, clustersize;
- int i;
- struct inode *inode = filp->f_dentry->d_inode;
- int max_sectors;
- int nbhs;
- int sector_size, sector_bits, sector_mask, sectors_per_page;
- int large_io = 0;
- int inuse = 0;
- unsigned long blocks_end_cluster = 0;
- loff_t saved_off;
- size_t saved_size;
- unsigned long firstlogic;
- long firstphys;
- long nextphys;
- unsigned long nextlogic = 0;
- unsigned long totalioblocks = 0;
-
- saved_off = *offp;
- saved_size = size;
-
- /* FIXME: Need to differentiate between sectors and blocksize */
- sector_bits = OCFS_SB(inode->i_sb)->s_sectsize_bits;
- sector_size = 1 << OCFS_SB(inode->i_sb)->s_sectsize_bits;
- sector_mask = sector_size - 1;
- sectors_per_page = PAGE_SIZE / sector_size;
- /* max sectors is 1024 in 2.4.9
- * max data is 512kb
- */
-
- err = -EINVAL;
- if (size == 0) {
- mlog(ML_NOTICE, "direct write of 0 bytes\n");
- return 0;
- }
-
- if (rw == READ) {
- if (i_size_read(inode) <= *offp) /* read past end of file */
- return 0;
- if (size > (i_size_read(inode) - *offp))
- size = i_size_read(inode) - *offp;
- }
-
- /* make sure aligned to either PAGE_SIZE or sect_size IO */
-#ifndef LARGEIOS
- if ((*offp & sector_mask) || (size & sector_mask))
- /* if not, then fail, we need either to do dio */
- return err;
-
- max_sectors = KIO_MAX_SECTORS;
- large_io = 0;
-#endif
-#ifdef LARGEIOS
- if ((*offp & ~PAGE_MASK) || (size & ~PAGE_MASK)) {
- /* if it's not PAGE_SIZE, then sect_size */
- if ((*offp & sector_mask) || (size & sector_mask))
- /* if not, then fail, we need either to do dio */
- return err;
- max_sectors = KIO_MAX_SECTORS; /* for 2.4.9 - 1024 */
- } /* ok we 're PAGE_SIZE aligned, lets see if the buffer is */
- else {
- if (!((unsigned long) buf & ~PAGE_MASK)) {
- /* yippie we are .. we can do PAGE_SIZE size io's */
- large_io = 1;
- /* for 2.4.9 */
- max_sectors = KIO_MAX_SECTORS / sectors_per_page;
- } else {
- max_sectors = KIO_MAX_SECTORS;
- large_io = 0;
- }
-
- }
-#endif
- /* find out how far we are to the end of our cluster */
-
- err = 0;
- if (size)
- err = -ENXIO;
-
- /* Split the IO into KIO_MAX_SECTORS chunks, mapping and */
- /* unmapping the single kiobuf as we go to perform each chunk of IO. */
-
- transferred = 0;
- blocknr = *offp >> sector_bits;
- clustersize = inode->i_blksize >> sector_bits;
- myiosize = size >> sector_bits;
- blocks_end_cluster = clustersize - (blocknr % clustersize);
- firstlogic = blocknr;
- totalioblocks = 0;
-
- err = ocfs_get_sector(inode, blocknr, &firstphys);
- if (err)
- goto out;
-
- while (myiosize > 0) {
- if (blocks_end_cluster + 1 > myiosize) {
- totalioblocks += myiosize;
- myiosize = 0;
- goto doio;
- } else {
- totalioblocks += blocks_end_cluster;
- myiosize -= blocks_end_cluster;
- nextlogic = firstlogic + blocks_end_cluster;
- }
-again:
- err = ocfs_get_sector(inode, nextlogic, &nextphys);
- if (err)
- goto out;
-
- if (nextphys == (firstphys + totalioblocks)) {
- // merge ok
- blocks_end_cluster = clustersize - (nextlogic % clustersize);
- if (blocks_end_cluster + 1 > myiosize) {
- totalioblocks += myiosize;
- myiosize = 0;
- } else {
- totalioblocks += blocks_end_cluster;
- myiosize -= blocks_end_cluster;
- nextlogic = nextlogic + blocks_end_cluster;
- goto again;
- }
- }
-doio:
- size = totalioblocks << sector_bits;
- if (large_io)
- nbhs = (size >> PAGE_SHIFT);
- else
- nbhs = (size >> sector_bits);
- if (nbhs > max_sectors)
- nbhs = max_sectors;
-
- err = alloc_kiovec(1, &iobuf);
- if (err)
- goto out;
- inuse = 1;
-
- totalioblocks = 0;
- while (size > 0) {
- if (large_io) {
- blocks = size >> PAGE_SHIFT;
- if (blocks > max_sectors)
- blocks = max_sectors;
- iosize = blocks << PAGE_SHIFT;
- } else {
- blocks = size >> sector_bits;
- if (blocks > max_sectors)
- blocks = max_sectors;
- iosize = blocks << sector_bits;
- }
- if (!blocks)
- break;
- err = map_user_kiobuf (rw, iobuf, (unsigned long) buf, iosize);
- if (err)
- break;
- /* get the blocknr depending on io size for all blocks */
- /* since we are awlays within the extent we only need to get the first block */
- iobuf->blocks[0] = firstphys + totalioblocks;
-
- if (large_io) {
- blocknr += sectors_per_page;
- iobuf->blocks[0] = iobuf->blocks[0] / sectors_per_page;
- } else {
- blocknr++;
- }
-
- for (i = 1; i < blocks; i++) {
- if (large_io) {
- blocknr += sectors_per_page;
- } else {
- blocknr++;
- }
- iobuf->blocks[i] = iobuf->blocks[0] + i;
- }
- err = brw_kiovec(rw, 1, &iobuf, inode->i_dev, iobuf->blocks,
- large_io ? PAGE_SIZE : sector_size);
- if (rw == READ && err > 0)
- mark_dirty_kiobuf(iobuf, err);
-
- if (err >= 0) {
- transferred += err;
- size -= err;
- buf += err;
- if (large_io) {
- totalioblocks +=
- (blocks * sectors_per_page);
- } else {
- totalioblocks += blocks;
- }
- } else {
- MLOG(ML_NOTICE, "brw_kiovec() %d\n", err);
- break;
- }
- unmap_kiobuf (iobuf);
- if (err != iosize)
- break;
- }
- free_kiovec(1, &iobuf);
- inuse = 0;
- totalioblocks = 0;
- firstlogic = nextlogic;
- firstphys = nextphys;
- }
- if (transferred) {
- *offp += transferred;
- err = transferred;
- }
-
-out:
- if (inuse)
- free_kiovec(1, &iobuf);
- return err;
-} /* ocfs_rw_direct */
-
-static void ocfs_aio_issue(void * _iocb);
-
-static void ocfs_aio_complete(struct kiocb *iocb, long res) {
-
- if (iocb->nr_transferred)
- res = iocb->nr_transferred;
-
- aio_complete(iocb, res, 0);
-}
-
-static void ocfs_aio_complete_rw(int rw, void *_iocb, struct kvec *vec,
- ssize_t res)
-{
- struct kiocb *iocb = _iocb;
-
- unmap_kvec(vec, rw == READ);
- free_kvec(vec);
-
- if (res > 0)
- iocb->nr_transferred += res;
-
- /* we only issue a continuation if this part suceeded
- * and there is more remaining */
- if (!iocb->ctx->dead && res == iocb->this_size &&
- iocb->nr_transferred < iocb->size) {
- iocb->this_size = rw;
- INIT_TQUEUE(&iocb->u.tq, ocfs_aio_issue, iocb);
- schedule_task(&iocb->u.tq);
- return;
- }
-
- ocfs_aio_complete(iocb, res);
-}
-
-static void ocfs_aio_complete_read(void *_iocb, struct kvec *vec, ssize_t res)
-{
- ocfs_aio_complete_rw(READ, _iocb, vec, res);
-}
-static void ocfs_aio_complete_write(void *_iocb, struct kvec *vec, ssize_t res)
-{
- ocfs_aio_complete_rw(WRITE, _iocb, vec, res);
-}
-
-static void ocfs_aio_issue(void *_iocb)
-{
- struct kiocb *iocb = _iocb;
- struct inode *inode = iocb->filp->f_dentry->d_inode;
- unsigned long blocknr, blocks, iosize, this, aio_max_blocks;
- int rc = 0, rw = iocb->this_size;
- long firstphys, phys;
- kvec_cb_t cb;
-
- /* FIXME: Need to differentiate betwen sectors and blocksize */
- int sector_bits = OCFS_SB(inode->i_sb)->s_sectsize_bits;
- int clustersize = inode->i_blksize >> sector_bits;
-
- iocb->this_size = 0;
-
- iosize = (iocb->size - iocb->nr_transferred) >> sector_bits;
- BUG_ON(iosize == 0);
- blocknr = (iocb->pos + iocb->nr_transferred) >> sector_bits;
- firstphys = 0;
- blocks = 0;
-
- aio_max_blocks = aio_max_size >> sector_bits;
-
- while (iosize > 0 && blocks < aio_max_blocks) {
- rc = ocfs_get_sector(inode, blocknr, &phys);
- if (rc < 0)
- goto out;
-
- if (firstphys == 0)
- firstphys = phys;
-
- /* issue the io when it stops being contiguous */
- if (firstphys + blocks != phys)
- break;
-
- /* clamp when the rest of the io fits in the cluster */
- this = min(clustersize - (blocknr % clustersize), iosize);
- this = min(this, aio_max_blocks - blocks);
-
- blocks += this;
- blocknr += this;
- iosize -= this;
- }
-
- /* we either got the first phys or returned an error from getblock */
- BUG_ON(blocks == 0);
-
- iocb->this_size = blocks << sector_bits;
-
- cb.fn = (rw == READ) ? ocfs_aio_complete_read :
- ocfs_aio_complete_write;
- cb.data = iocb;
- cb.vec = mm_map_user_kvec(iocb->ctx->mm, rw,
- iocb->buf + iocb->nr_transferred,
- iocb->this_size);
- if (unlikely(IS_ERR(cb.vec))) {
- rc = PTR_ERR(cb.vec);
- goto out;
- }
-
- rc = brw_kvec_async(rw, cb, inode->i_dev, blocks, firstphys,
- sector_bits);
-out:
- if (rc)
- ocfs_aio_complete(iocb, rc);
-}
-
-static ssize_t ocfs_aio_rw(int rw, struct file *file, struct kiocb *req,
- struct iocb *iocb)
-{
- struct inode *inode = req->filp->f_dentry->d_inode;
- loff_t pos = req->pos;
- size_t size = req->size;
-
- int sector_size = 1 << OCFS_SB(inode->i_sb)->s_sectsize_bits;
- int sector_mask = (1 << sector_size) - 1;
-
- if (!size || (pos == i_size_read(inode))) {
- ocfs_aio_complete(req, 0);
- return 0;
- }
-
- if (aio_max_size < sector_size)
- return -EINVAL;
-
- if (pos >= i_size_read(inode))
- return -ENXIO;
-
- if ((pos < 0) || (pos & sector_mask) || (size & sector_mask))
- return -EINVAL;
-
- req->nr_transferred = 0;
-
- /* from this point on errors are communicated through completion */
- req->this_size = rw;
- ocfs_aio_issue(req);
- return 0;
-}
-
-int ocfs_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb)
-{
- int ret;
-
- ret = ocfs_aio_rw(READ, file, req, iocb);
-
- return ret;
-}
-
-int ocfs_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb)
-{
- int ret;
-
- ret = ocfs_aio_rw(WRITE, file, req, iocb);
-
- return ret;
-}
-
-#endif /* 2.6 */
Modified: trunk/fs/ocfs2/Makefile
===================================================================
--- trunk/fs/ocfs2/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,14 +23,6 @@
EXTRA_CFLAGS += -DCATCH_BH_JBD_RACES
-ifdef OCFS_TRACE
-EXTRA_CFLAGS += -DTRACE
-endif
-
-ifdef COMPAT_SAFE_WRITE
-EXTRA_CFLAGS += -DOCFS_COMPAT_SAFE_WRITE
-endif
-
ifdef JOURNAL_ACCESS_WITH_CREDITS
EXTRA_CFLAGS += -DJOURNAL_ACCESS_WITH_CREDITS
endif
@@ -41,13 +33,7 @@
#
SAFE_SUBDIRS = cluster dlm
-#
-# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
-# are needed for VERSION_FILES
-#
-
SOURCES = \
- 24io.c \
aio.c \
alloc.c \
aops.c \
@@ -63,7 +49,6 @@
localalloc.c \
mmap.c \
namei.c \
- ocfs_compat.c \
proc.c \
slot_map.c \
suballoc.c \
@@ -78,7 +63,6 @@
ocfs1_fs_compat.h \
ocfs.h \
ocfs2.h \
- ocfs_compat.h \
buffer_head_io.h \
aio.h \
alloc.h \
@@ -126,7 +110,7 @@
ifeq ($(KERNELRELEASE),)
#
-# Called from a regular "make".
+# Called from a regular "make". Just forward to kbuild.
#
DIST_FILES = $(SOURCES) $(HEADERS)
@@ -137,11 +121,6 @@
INSTALL_RULES = install-modules
-ifneq ($(KERNEL_26),)
-#
-# This is a 2.6 kernel. Just forward to kbuild.
-#
-
# Traverse subdirs via Makebo for "make dist"
ifeq ($(MAKECMDGOALS),dist-all)
SUBDIRS = $(SAFE_SUBDIRS)
@@ -155,18 +134,7 @@
clean-modules:
$(MAKE) -C $(TOPDIR)/fs clean-modules
-else
-#
-# This is a 2.4 kernel. Because Red Hat's source tree is whack, do
-# everything by hand.
-#
-SUBDIRS = $(SAFE_SUBDIRS)
-
-include $(TOPDIR)/Kbuild-24.make
-
-endif
-
include $(TOPDIR)/Postamble.make
endif
Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/aio.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,10 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
-#include <linux/version.h>
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
Modified: trunk/fs/ocfs2/aio.h
===================================================================
--- trunk/fs/ocfs2/aio.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/aio.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -26,12 +26,10 @@
#ifndef OCFS2_AIO_H
#define OCFS2_AIO_H
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
ssize_t ocfs2_file_aio_write(struct kiocb *iocb, const char *buf,
size_t count, loff_t pos);
ssize_t ocfs2_file_aio_read(struct kiocb *iocb, char *buf, size_t count,
loff_t pos);
-#endif
void okp_teardown_from_list(void *data);
void ocfs2_wait_for_okp_destruction(ocfs_super *osb);
Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/alloc.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -989,7 +987,7 @@
OCFS_I(inode)->ip_clusters = fe->i_clusters - clusters_to_del;
spin_unlock(&OCFS_I(inode)->ip_lock);
fe->i_clusters -= clusters_to_del;
- fe->i_mtime = OCFS_CURRENT_TIME;
+ fe->i_mtime = CURRENT_TIME.tv_sec;
i = el->l_next_free_rec - 1;
Modified: trunk/fs/ocfs2/aops.c
===================================================================
--- trunk/fs/ocfs2/aops.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/aops.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -18,7 +18,6 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
#include <linux/fs.h>
#include <linux/slab.h>
@@ -224,7 +223,6 @@
return ret;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int ocfs_writepage(struct page *page, struct writeback_control *wbc)
{
int ret;
@@ -237,155 +235,7 @@
return ret;
}
-#else
-static int ocfs_writepage(struct page *page)
-{
- int ret;
- mlog_entry("(0x%p)\n", page);
-
- ret = block_write_full_page(page, ocfs_get_block);
-
- mlog_exit(ret);
-
- return ret;
-}
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-inline void __mark_dirty(struct buffer_head *bh)
-{
- set_buffer_flushtime(bh);
- refile_buffer(bh);
-}
-
-static int __block_commit_write(struct inode *inode, struct page *page,
- unsigned from, unsigned to)
-{
- unsigned block_start, block_end;
- int partial = 0, need_balance_dirty = 0;
- unsigned blocksize;
- struct buffer_head *bh, *head;
-
- blocksize = 1 << inode->i_blkbits;
-
- for(bh = head = page->buffers, block_start = 0;
- bh != head || !block_start;
- block_start=block_end, bh = bh->b_this_page) {
- block_end = block_start + blocksize;
- if (block_end <= from || block_start >= to) {
- if (!buffer_uptodate(bh))
- partial = 1;
- } else {
- set_bit(BH_Uptodate, &bh->b_state);
- if (!atomic_set_buffer_dirty(bh)) {
- __mark_dirty(bh);
- buffer_insert_inode_data_queue(bh, inode);
- need_balance_dirty = 1;
- }
- }
- }
-
- if (need_balance_dirty)
- balance_dirty();
- /*
- * is this a partial write that happened to make all buffers
- * uptodate then we can optimize away a bogus readpage() for
- * the next read(). Here we 'discover' wether the page went
- * uptodate as a result of this (potentially partial) write.
- */
- if (!partial)
- SetPageUptodate(page);
- return 0;
-}
-
-static int ocfs2_cont_prepare_write(struct page *page, unsigned offset,
- unsigned to, get_block_t *get_block, loff_t *bytes)
-{
- struct address_space *mapping = page->mapping;
- struct inode *inode = mapping->host;
- struct page *new_page;
- unsigned long pgpos;
- long status;
- unsigned zerofrom;
- unsigned blocksize = 1 << inode->i_blkbits;
- char *kaddr;
-
- while (page->index > (pgpos = *bytes>>PAGE_CACHE_SHIFT)) {
- status = -ENOMEM;
- new_page = grab_cache_page(mapping, pgpos);
- if (!new_page)
- goto out;
- /* we might sleep */
- if (*bytes>>PAGE_CACHE_SHIFT != pgpos) {
- unlock_page(new_page);
- page_cache_release(new_page);
- continue;
- }
- zerofrom = *bytes & ~PAGE_CACHE_MASK;
- if (zerofrom & (blocksize-1)) {
- *bytes |= (blocksize-1);
- (*bytes)++;
- }
- status = block_prepare_write(new_page, zerofrom,
- PAGE_CACHE_SIZE, get_block);
- if (status)
- goto out_unmap;
- kaddr = page_address(new_page);
- memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
- flush_dcache_page(new_page);
- __block_commit_write(inode, new_page, zerofrom, PAGE_CACHE_SIZE);
- kunmap(new_page);
- unlock_page(new_page);
- page_cache_release(new_page);
- }
-
- if (page->index < pgpos) {
- /* completely inside the area */
- zerofrom = offset;
- } else {
- /* page covers the boundary, find the boundary offset */
- zerofrom = *bytes & ~PAGE_CACHE_MASK;
-
- /* if we will expand the thing last block will be filled */
- if (to > zerofrom && (zerofrom & (blocksize-1))) {
- *bytes |= (blocksize-1);
- (*bytes)++;
- }
-
- /* starting below the boundary? Nothing to zero out */
- if (offset <= zerofrom)
- zerofrom = offset;
- }
- status = block_prepare_write(page, zerofrom, to, get_block);
- if (status)
- goto out1;
- kaddr = page_address(page);
- if (zerofrom < offset) {
- memset(kaddr+zerofrom, 0, offset-zerofrom);
- flush_dcache_page(page);
- __block_commit_write(inode, page, zerofrom, offset);
- }
- return 0;
-out1:
- ClearPageUptodate(page);
- kunmap(page);
- return status;
-
-out_unmap:
- ClearPageUptodate(new_page);
- kunmap(new_page);
- UnlockPage(new_page);
- page_cache_release(new_page);
-out:
- return status;
-}
-
-/* Mark's favorite hack */
-#undef cont_prepare_write
-#define cont_prepare_write ocfs2_cont_prepare_write
-#endif /* < 2.6.0 */
-
/*
* ocfs_prepare_write()
*
@@ -423,18 +273,9 @@
return ret;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static sector_t ocfs_bmap(struct address_space *mapping, sector_t block)
-#else
-static int ocfs_bmap(struct address_space *mapping, long block)
-#endif
{
- /* Why do two #ifs? Because Mark is an EMACS user. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
sector_t status;
-#else
- int status;
-#endif
u64 p_blkno = 0;
int err = 0;
struct inode *inode = mapping->host;
@@ -459,19 +300,13 @@
bail:
- /* "Gross" - MarkF (While Joel was inserting the #if) */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
status = err ? 0 : p_blkno;
-#else
- status = err ? err : (int)p_blkno;
-#endif
mlog_exit((int)status);
return status;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/*
* TODO: Make this into a generic get_blocks function.
*
@@ -575,23 +410,8 @@
return ret;
} /* ocfs_direct_IO */
-#else
-/*
- * ocfs_direct_IO()
- *
- * we are not using this function anymore, in fact
- * we should never get here any more
- * so let's just BUG(), hint from sct at redhat.com
- */
-static int ocfs_direct_IO (int rw, struct file *filp, struct kiobuf *iobuf, unsigned long blocknr, int blocksize)
-{
- BUG();
- return 0;
-} /* ocfs_direct_IO */
-#endif
-
struct address_space_operations ocfs_aops = {
.readpage = ocfs_readpage,
.writepage = ocfs_writepage,
@@ -599,14 +419,5 @@
.commit_write = ocfs_commit_write,
.bmap = ocfs_bmap,
.sync_page = block_sync_page,
-
- /*
- * On a 2.4 system, we are only adding this here as a dummy basically.
- * Just need open with O_DIRECT to succeed, we still call
- * ocfs_rw_direct().
- *
- * For a 2.6 system, this is the way a filesystem provides
- * direct-io support.
- */
.direct_IO = ocfs_direct_IO
};
Modified: trunk/fs/ocfs2/buffer_head_io.c
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/buffer_head_io.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -107,18 +105,9 @@
lock_buffer(bh);
set_buffer_uptodate(bh);
+
/* remove from dirty list before I/O. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- /*
- * mark_buffer_clean() doesn't exist in 2.6.x kernels.
- * Not many places actually used mark_buffer_clean, but
- * at least reiserfs uses clear_buffer_dirty() as
- * a replacment.
- */
clear_buffer_dirty(bh);
-#else
- mark_buffer_clean(bh);
-#endif
bh->b_end_io = ocfs_end_buffer_io_sync;
submit_bh(WRITE, bh);
Modified: trunk/fs/ocfs2/buffer_head_io.h
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/buffer_head_io.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -26,15 +26,8 @@
#ifndef OCFSIO_H
#define OCFSIO_H
-#include <linux/compiler.h>
+#include <linux/buffer_head.h>
-/* UGLY place to put it, but it is for the best */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-# include <linux/locks.h>
-#else
-# include <linux/buffer_head.h>
-#endif
-
void ocfs_end_buffer_io_sync(struct buffer_head *bh,
int uptodate);
@@ -63,33 +56,6 @@
#define OCFS_BH_CACHED 1
#define OCFS_BH_READAHEAD 8 /* use this to pass READA down to submit_bh */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-/*
- * Copied right out of the 2.6.2 kernel's buffer_head.h:
- * macro tricks to expand the set_buffer_foo(), clear_buffer_foo()
- * and buffer_foo() functions.
- */
-#define BUFFER_FNS(bit, name) \
-static inline void set_buffer_##name(struct buffer_head *bh) \
-{ \
- set_bit(BH_##bit, &(bh)->b_state); \
-} \
-static inline void clear_buffer_##name(struct buffer_head *bh) \
-{ \
- clear_bit(BH_##bit, &(bh)->b_state); \
-} \
-static inline int buffer_##name(struct buffer_head *bh) \
-{ \
- return test_bit(BH_##bit, &(bh)->b_state); \
-}
-
-#undef buffer_uptodate
-#undef buffer_dirty
-BUFFER_FNS(Uptodate, uptodate)
-BUFFER_FNS(Dirty, dirty)
-
-#endif /* 2.4.x kernel */
-
#define STATE_BH_BITS 8
#define USED_BH_BITS 23 /* Number of BH bits used up through JBD */
Modified: trunk/fs/ocfs2/cluster/Makefile
===================================================================
--- trunk/fs/ocfs2/cluster/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/cluster/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,14 +23,6 @@
# this is going to get exciting if configfs is merged
EXTRA_CFLAGS += -I$(OUR_TOPDIR)/fs/configfs/
-# XXX should be folded into the kapi stuff
-EXTRA_CFLAGS += -I$(OUR_TOPDIR)/fs/configfs/compatinclude
-
-#
-# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
-# are needed for VERSION_FILES
-#
-
SOURCES = \
heartbeat.c \
masklog.c \
@@ -39,7 +31,6 @@
ver.c
HEADERS = \
- cl_compat.h \
heartbeat.h \
masklog.h \
nodemanager.h \
@@ -70,7 +61,7 @@
ifeq ($(KERNELRELEASE),)
#
-# Called from a regular "make".
+# Called from a regular "make". Just forward to kbuild.
#
DIST_FILES = $(SOURCES) $(HEADERS)
@@ -81,11 +72,6 @@
INSTALL_RULES = install-modules
-ifneq ($(KERNEL_26),)
-#
-# This is a 2.6 kernel. Just forward to kbuild.
-#
-
build-modules:
$(MAKE) -C $(TOPDIR)/fs build-modules
@@ -94,16 +80,7 @@
clean-modules:
$(MAKE) -C $(TOPDIR)/fs clean-modules
-else
-#
-# This is a 2.4 kernel. Because Red Hat's source tree is whack, do
-# everything by hand.
-#
-include $(TOPDIR)/Kbuild-24.make
-
-endif
-
include $(TOPDIR)/Postamble.make
endif
Deleted: trunk/fs/ocfs2/cluster/cl_compat.h
===================================================================
--- trunk/fs/ocfs2/cluster/cl_compat.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/cluster/cl_compat.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,186 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * cl_compat.h
- *
- * Compatibility stuff for 2.4
- *
- * Copyright (C) 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version
- * 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- *
- */
-
-#ifndef CLUSTER_DLM_COMPAT_H
-#define CLUSTER_DLM_COMPAT_H
-
-#include <linux/version.h>
-#include <linux/types.h>
-#include <linux/kdev_t.h>
-#include <linux/sched.h>
-#include <linux/compiler.h>
-#include <linux/bitops.h>
-
-/* for tcp_sk() */
-#include <net/sock.h>
-#include <linux/tcp.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-# include <linux/locks.h>
-# include <linux/blkdev.h>
-#else
-# include <linux/buffer_head.h>
-#endif
-
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-
-#define flush_scheduled_work flush_scheduled_tasks
-#define work_struct tq_struct
-#define INIT_WORK(w, f, d) INIT_TQUEUE(w, f, d)
-#define schedule_work(w) schedule_task(w)
-
-#define kstatfs statfs
-
-/*
- * Copied right out of the 2.6.2 kernel's buffer_head.h:
- * macro tricks to expand the set_buffer_foo(), clear_buffer_foo()
- * and buffer_foo() functions.
- */
-#define BUFFER_FNS(bit, name) \
-static inline void set_buffer_##name(struct buffer_head *bh) \
-{ \
- set_bit(BH_##bit, &(bh)->b_state); \
-} \
-static inline void clear_buffer_##name(struct buffer_head *bh) \
-{ \
- clear_bit(BH_##bit, &(bh)->b_state); \
-} \
-static inline int buffer_##name(struct buffer_head *bh) \
-{ \
- return test_bit(BH_##bit, &(bh)->b_state); \
-}
-
-#undef buffer_uptodate
-#undef buffer_dirty
-BUFFER_FNS(Uptodate, uptodate)
-BUFFER_FNS(Dirty, dirty)
-
-#define clear_buffer_dirty mark_buffer_clean
-
-#define OCFS_CURRENT_SECONDS CURRENT_TIME
-
-static inline __u32 mk_inode_time(long tv_sec, long tv_nsec)
-{
- return tv_sec;
-}
-
-#ifndef tcp_sk
-static inline struct tcp_opt * tcp_sk(const struct sock *__sk)
-{
- return &__sk->tp_info.af_tcp;
-}
-#endif
-static inline int ocfs_dev_bits(kdev_t dev)
-{
- return blksize_bits(block_size(dev));
-}
-
-#define blk_run_address_space(throwaway) run_task_queue(&tq_disk)
-
-static int unsigned long generic_hweight64(u64 w)
-{
-#if BITS_PER_LONG < 64
- return generic_hweight32((unsigned int)(w >> 32)) +
- generic_hweight32((unsigned int)w);
-#else
- u64 res;
- res = (w & 0x5555555555555555) + ((w >> 1) & 0x5555555555555555);
- res = (res & 0x3333333333333333) + ((res >> 2) & 0x3333333333333333);
- res = (res & 0x0F0F0F0F0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F0F0F0F0F);
- res = (res & 0x00FF00FF00FF00FF) + ((res >> 8) & 0x00FF00FF00FF00FF);
- res = (res & 0x0000FFFF0000FFFF) + ((res >> 16) & 0x0000FFFF0000FFFF);
- return (res & 0x00000000FFFFFFFF) + ((res >> 32) & 0x00000000FFFFFFFF);
-#endif
-}
-
-static inline unsigned long hweight_long(unsigned long w)
-{
- return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w);
-}
-
-#else /* LINUX_VERSION_CODE < 2.6 */
-
-static inline int ocfs_dev_bits(dev_t dev)
-{
- struct block_device *bd = bdget(dev);
- int ret = -EINVAL;
-
- if (bd == NULL)
- goto out;
-
- ret = bd->bd_inode->i_blkbits;
- bdput(bd);
-out:
- return ret;
-
-}
-
-static inline struct buffer_head *getblk(dev_t dev, sector_t block, int size)
-{
- struct block_device *bd = bdget(dev);
- struct buffer_head *bh;
-
- if (bd == NULL)
- return NULL;
-
- bh = __getblk(bd, block, size);
- bdput(bd);
- return bh;
-}
-
-#define OCFS_CURRENT_SECONDS (CURRENT_TIME.tv_sec)
-
-static inline struct timespec mk_inode_time(long tv_sec, long tv_nsec)
-{
- struct timespec ts = {
- .tv_sec = tv_sec,
- .tv_nsec = tv_nsec,
- };
- return ts;
-}
-
-#endif /* LINUX_VERSION_CODE */
-
-#ifdef MISSING_SOCK_CREATE_LITE
-static inline int sock_create_lite(int family, int type, int protocol,
- struct socket **res)
-{
- struct socket *sock = sock_alloc();
- int ret = 0;
-
- if (sock == NULL)
- ret = -ENOMEM;
-
- *res = sock;
-
- return ret;
-}
-#endif /* NO_SOCK_CREATE_LITE */
-
-
-#endif /* CLUSTER_DLM_COMPAT_H */
-
Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/cluster/heartbeat.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -33,10 +33,8 @@
#include <linux/sysctl.h>
#include <linux/random.h>
#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/statfs.h>
#include <linux/moduleparam.h>
-#endif
#include <linux/blkdev.h>
#include <linux/socket.h>
#include <linux/inet.h>
@@ -60,8 +58,6 @@
#include <asm/uaccess.h>
#include <asm/bitops.h>
-#include "cl_compat.h"
-
#include "heartbeat.h"
#include "tcp.h"
#include "nodemanager.h"
@@ -431,7 +427,7 @@
hb_block = (struct hb_disk_heartbeat_block *) slot->ds_raw_block;
memset(hb_block, 0, reg->hr_hb_block_bytes);
/* TODO: time stuff */
- cputime = OCFS_CURRENT_SECONDS;
+ cputime = CURRENT_TIME.tv_sec;
if (!cputime)
cputime = 1;
hb_block->hb_seq = cpu_to_le64(cputime);
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -19,8 +19,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "cl_compat.h"
-
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
@@ -33,11 +31,9 @@
#include <linux/init.h>
#include <linux/sysctl.h>
#include <linux/random.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/statfs.h>
#include <linux/moduleparam.h>
#include <linux/namei.h>
-#endif
#include <linux/blkdev.h>
#include <linux/socket.h>
#include <linux/inet.h>
Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/cluster/tcp.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -88,10 +88,8 @@
#include <linux/sysctl.h>
#include <linux/random.h>
#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/statfs.h>
#include <linux/moduleparam.h>
-#endif
#include <linux/blkdev.h>
#include <linux/proc_fs.h>
#include <linux/file.h>
@@ -99,7 +97,6 @@
#include <asm/uaccess.h>
-#include "cl_compat.h"
#include "heartbeat.h"
@@ -129,21 +126,6 @@
} while (0)
-/* let's only pollute this unit with these ridiculous definitions */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#define sk_sleep sleep
-#define sk_state state
-#define sk_receive_queue receive_queue
-#define sk_reuse reuse
-#define sk_family family
-#define sk_type type
-#define sk_protocol protocol
-#define sk_callback_lock callback_lock
-#define sk_user_data user_data
-#define sk_data_ready data_ready
-#define sk_state_change state_change
-#endif
-
struct net_sock_container {
/* sockets themselves don't seem to have a nice way to refcount them
* above sock_release. one could use iget/iput, but that seems
@@ -1579,6 +1561,22 @@
return ret;
}
+#ifdef MISSING_SOCK_CREATE_LITE
+static inline int sock_create_lite(int family, int type, int protocol,
+ struct socket **res)
+{
+ struct socket *sock = sock_alloc();
+ int ret = 0;
+
+ if (sock == NULL)
+ ret = -ENOMEM;
+
+ *res = sock;
+
+ return ret;
+}
+#endif /* MISSING_SOCK_CREATE_LITE */
+
static void net_try_accept(struct socket *sock)
{
int ret, slen;
Modified: trunk/fs/ocfs2/cluster/tcp.h
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/cluster/tcp.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -118,14 +118,8 @@
static inline int net_link_down(int err, struct socket *sock)
{
if (sock) {
-/* the alternative is to #define around the members */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- if (sock->sk->state != TCP_ESTABLISHED &&
- sock->sk->state != TCP_CLOSE_WAIT)
-#else
if (sock->sk->sk_state != TCP_ESTABLISHED &&
sock->sk->sk_state != TCP_CLOSE_WAIT)
-#endif
return 1;
}
Modified: trunk/fs/ocfs2/dcache.c
===================================================================
--- trunk/fs/ocfs2/dcache.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dcache.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,14 +23,10 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/namei.h>
-#endif
#define MLOG_MASK_PREFIX ML_NAMEI
#include <cluster/masklog.h>
@@ -41,14 +37,14 @@
#include "dcache.h"
#include "file.h"
-static int ocfs_dentry_revalidate24(struct dentry *dentry, int flags)
+static int ocfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd)
{
struct inode *inode = dentry->d_inode;
int ret = 0; /* if all else fails, just return false */
ocfs_super *osb;
- mlog_entry ("(0x%p, %d, '%.*s')\n", dentry, flags,
- dentry->d_name.len, dentry->d_name.name);
+ mlog_entry ("(0x%p, '%.*s')\n", dentry,
+ dentry->d_name.len, dentry->d_name.name);
if (inode == NULL)
goto bail;
@@ -82,21 +78,11 @@
ret = 1;
bail:
- mlog_exit (ret);
+ mlog_exit(ret);
return ret;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-static int ocfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd)
-{
- return ocfs_dentry_revalidate24(dentry, nd ? nd->flags : 0);
-}
struct dentry_operations ocfs_dentry_ops = {
.d_revalidate = ocfs_dentry_revalidate,
};
-#else
-struct dentry_operations ocfs_dentry_ops = {
- .d_revalidate = ocfs_dentry_revalidate24,
-};
-#endif
Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dir.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -36,8 +36,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -191,9 +189,6 @@
offset = 0;
brelse (bh);
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- update_atime(inode);
-#endif
stored = 0;
bail:
Modified: trunk/fs/ocfs2/dlm/Makefile
===================================================================
--- trunk/fs/ocfs2/dlm/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlm/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -22,11 +22,6 @@
EXTRA_CFLAGS += -DBACKING_DEV_CAPABILITIES
endif
-#
-# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
-# are needed for VERSION_FILES
-#
-
DLM_SOURCES = \
dlmdebug.c \
dlmdomain.c \
@@ -44,9 +39,6 @@
dlmfs.c \
dlmfsver.c
-DLMFS_COMPAT_SOURCES = \
- dlmfs_compat.c
-
HEADERS = \
dlmdebug.h \
dlmconvert.h \
@@ -54,20 +46,13 @@
dlmcommon.h \
dlmapi.h \
userdlm.h \
- dlmfs_compat.h \
dlmver.h \
dlmfsver.h
DLM_OBJECTS = $(subst .c,.o,$(DLM_SOURCES))
DLMFS_OBJECTS = $(subst .c,.o,$(DLMFS_SOURCES))
-ifeq ($(KERNELRELEASE),)
-ifeq ($(KERNEL_26),)
-DLMFS_OBJECTS += $(subst .c,.o,$(DLMFS_COMPAT_SOURCES))
-endif
-endif
-
-VERSION_FILES = $(DLM_SOURCES) $(DLMFS_SOURCES) $(DLMFS_COMPAT_SOURCES) $(HEADERS)
+VERSION_FILES = $(DLM_SOURCES) $(DLMFS_SOURCES) $(HEADERS)
VERSION_SRC = dlmver.c dlmfsver.c
VERSION_PREFIX = DLM
@@ -93,10 +78,10 @@
ifeq ($(KERNELRELEASE),)
#
-# Called from a regular "make".
+# Called from a regular "make". Just forward to kbuild.
#
-DIST_FILES = $(DLM_SOURCES) $(DLMFS_SOURCES) $(DLMFS_COMPAT_SOURCES) $(HEADERS)
+DIST_FILES = $(DLM_SOURCES) $(DLMFS_SOURCES) $(HEADERS)
ALL_RULES = stamp-md5 build-modules
@@ -104,12 +89,6 @@
INSTALL_RULES = install-modules
-
-ifneq ($(KERNEL_26),)
-#
-# This is a 2.6 kernel. Just forward to kbuild.
-#
-
build-modules:
$(MAKE) -C $(TOPDIR)/fs build-modules
@@ -118,16 +97,7 @@
clean-modules:
$(MAKE) -C $(TOPDIR)/fs clean-modules
-else
-#
-# This is a 2.4 kernel. Because Red Hat's source tree is whack, do
-# everything by hand.
-#
-include $(TOPDIR)/Kbuild-24.make
-
-endif
-
include $(TOPDIR)/Postamble.make
endif
Modified: trunk/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlm/dlmfs.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -35,6 +35,7 @@
#include <linux/init.h>
#include <linux/string.h>
#include <linux/smp_lock.h>
+#include <linux/backing-dev.h>
#include <asm/uaccess.h>
@@ -45,7 +46,6 @@
#include "dlmapi.h"
-#include "dlmfs_compat.h"
#include "userdlm.h"
#include "dlmfsver.h"
@@ -57,9 +57,7 @@
static struct file_operations dlmfs_file_operations;
static struct inode_operations dlmfs_dir_inode_operations;
static struct inode_operations dlmfs_root_inode_operations;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct inode_operations dlmfs_file_inode_operations;
-#endif
static kmem_cache_t *dlmfs_inode_cache;
struct workqueue_struct *user_dlm_worker;
@@ -312,9 +310,6 @@
ip->ip_dlm = NULL;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#include <linux/backing-dev.h>
-
static struct backing_dev_info dlmfs_backing_dev_info = {
.ra_pages = 0, /* No readahead */
#ifdef BACKING_DEV_CAPABILITIES
@@ -324,17 +319,6 @@
#endif
};
-static inline void dlmfs_set_backing_info(struct inode *inode)
-{
- inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
-}
-#else
-static inline void dlmfs_set_backing_info(struct inode *inode)
-{
- inode->i_rdev = NODEV;
-}
-#endif
-
static struct inode *dlmfs_get_root_inode(struct super_block *sb)
{
struct inode *inode = new_inode(sb);
@@ -349,7 +333,7 @@
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- dlmfs_set_backing_info(inode);
+ inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_nlink++;
@@ -376,7 +360,7 @@
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- dlmfs_set_backing_info(inode);
+ inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
ip = DLMFS_I(inode);
@@ -389,9 +373,7 @@
BUG();
break;
case S_IFREG:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
inode->i_op = &dlmfs_file_inode_operations;
-#endif
inode->i_fop = &dlmfs_file_operations;
i_size_write(inode, DLM_LVB_LEN);
@@ -474,16 +456,10 @@
return status;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int dlmfs_create(struct inode *dir,
struct dentry *dentry,
int mode,
struct nameidata *nd)
-#else
-static int dlmfs_create(struct inode *dir,
- struct dentry *dentry,
- int mode)
-#endif
{
int status = 0;
struct inode *inode;
@@ -585,12 +561,9 @@
.alloc_inode = dlmfs_alloc_inode,
.destroy_inode = dlmfs_destroy_inode,
.clear_inode = dlmfs_clear_inode,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.drop_inode = generic_delete_inode,
-#endif
};
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct inode_operations dlmfs_file_inode_operations = {
.getattr = simple_getattr,
};
@@ -607,18 +580,7 @@
.get_sb = dlmfs_get_sb,
.kill_sb = kill_litter_super,
};
-#else
-static struct super_block *dlmfs_read_super(struct super_block *sb,
- void *data,
- int silent)
-{
- return (dlmfs_fill_super(sb, data, silent)) < 0 ? NULL : sb;
-}
-static DECLARE_FSTYPE(dlmfs_fs_type, "ocfs2_dlmfs", dlmfs_read_super,
- FS_LITTER);
-#endif
-
static int __init init_dlmfs_fs(void)
{
int status;
@@ -634,14 +596,13 @@
return -ENOMEM;
cleanup_inode = 1;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
user_dlm_worker = create_workqueue("user_dlm");
if (!user_dlm_worker) {
status = -ENOMEM;
goto bail;
}
cleanup_worker = 1;
-#endif
+
status = register_filesystem(&dlmfs_fs_type);
bail:
if (status) {
Deleted: trunk/fs/ocfs2/dlm/dlmfs_compat.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs_compat.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlm/dlmfs_compat.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,108 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * dlmfs_compat.c
- *
- * 2.4 compat for dlmfs
- *
- * Copyright (C) 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- *
- */
-
-#include <linux/module.h>
-#include <linux/pagemap.h>
-#include <linux/mount.h>
-#include <linux/fs.h>
-
-
-#include "cluster/nodemanager.h"
-#include "cluster/tcp.h"
-
-#include "dlmapi.h"
-
-#include "dlmfs_compat.h"
-#include "userdlm.h"
-
-static inline int simple_positive(struct dentry *dentry)
-{
- return dentry->d_inode && !d_unhashed(dentry);
-}
-
-/*
- * Check that a directory is empty (this works
- * for regular files too, they'll just always be
- * considered empty..).
- *
- * Note that an empty directory can still have
- * children, they just all have to be negative..
- */
-static int simple_empty(struct dentry *dentry)
-{
- struct list_head *list;
-
- spin_lock(&dcache_lock);
- list = dentry->d_subdirs.next;
-
- while (list != &dentry->d_subdirs) {
- struct dentry *de = list_entry(list, struct dentry, d_child);
-
- if (simple_positive(de)) {
- spin_unlock(&dcache_lock);
- return 0;
- }
- list = list->next;
- }
- spin_unlock(&dcache_lock);
- return 1;
-}
-
-/*
- * This works for both directories and regular files.
- * (non-directories will always have empty subdirs)
- */
-int simple_unlink(struct inode * dir, struct dentry *dentry)
-{
- int retval = -ENOTEMPTY;
-
- if (simple_empty(dentry)) {
- struct inode *inode = dentry->d_inode;
-
- inode->i_nlink--;
- dput(dentry); /* Undo the count from "create" - this does all the work */
- retval = 0;
- }
- return retval;
-}
-
-/*
- * Lookup the data. This is trivial - if the dentry didn't already
- * exist, we know it is negative.
- */
-struct dentry * simple_lookup(struct inode *dir, struct dentry *dentry)
-{
- d_add(dentry, NULL);
- return NULL;
-}
-
-int simple_statfs(struct super_block *sb, struct statfs *buf)
-{
- buf->f_type = DLMFS_MAGIC;
- buf->f_bsize = PAGE_CACHE_SIZE;
- buf->f_namelen = 255;
- return 0;
-}
Deleted: trunk/fs/ocfs2/dlm/dlmfs_compat.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs_compat.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlm/dlmfs_compat.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,67 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * dlmfs_compat.h
- *
- * 2.4 compat for dlmfs
- *
- * Copyright (C) 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- *
- */
-
-#ifndef DLMFS_COMPAT_H
-#define DLMFS_COMPAT_H
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-
-#include <linux/fs.h>
-#include <linux/tqueue.h>
-
-#define simple_dir_operations dcache_dir_ops
-#define simple_rmdir simple_unlink
-#define SLAB_RECLAIM_ACCOUNT 0
-
-int simple_unlink(struct inode * dir, struct dentry *dentry);
-struct dentry * simple_lookup(struct inode *dir, struct dentry *dentry);
-int simple_statfs(struct super_block *sb, struct statfs *buf);
-
-#define work_struct tq_struct
-#define PREPARE_WORK(w, f, d) INIT_TQUEUE(w, f, d)
-#define queue_work(queue, t) schedule_task(t)
-
-#define destroy_workqueue(foobar)
-
-#define flush_workqueue(foobar) flush_scheduled_tasks()
-
-static inline loff_t i_size_read(struct inode *inode)
-{
- return inode->i_size;
-}
-
-static inline void i_size_write(struct inode *inode, loff_t i_size)
-{
- inode->i_size = i_size;
-}
-
-#else
-#include <linux/workqueue.h>
-#endif
-
-#endif /* DLMFS_COMPAT_H */
Modified: trunk/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmthread.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlm/dlmthread.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -41,7 +41,6 @@
#include <linux/kthread.h>
-#include "cluster/cl_compat.h"
#include "cluster/heartbeat.h"
#include "cluster/nodemanager.h"
#include "cluster/tcp.h"
Modified: trunk/fs/ocfs2/dlm/userdlm.h
===================================================================
--- trunk/fs/ocfs2/dlm/userdlm.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlm/userdlm.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -31,9 +31,8 @@
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/version.h>
+#include <linux/workqueue.h>
-#include "dlmfs_compat.h"
-
/* user_lock_res->l_flags flags. */
#define USER_LOCK_ATTACHED (0x00000001) /* have we initialized
* the lvb */
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/dlmglue.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
@@ -1210,9 +1208,9 @@
lvb->lvb_isize = cpu_to_be64(i_size_read(inode));
lvb->lvb_imode = cpu_to_be16(inode->i_mode);
lvb->lvb_inlink = cpu_to_be16(inode->i_nlink);
- lvb->lvb_iatime = cpu_to_be64(ocfs_get_seconds(inode->i_atime));
- lvb->lvb_ictime = cpu_to_be64(ocfs_get_seconds(inode->i_ctime));
- lvb->lvb_imtime = cpu_to_be64(ocfs_get_seconds(inode->i_mtime));
+ lvb->lvb_iatime = cpu_to_be64(inode->i_atime.tv_sec);
+ lvb->lvb_ictime = cpu_to_be64(inode->i_ctime.tv_sec);
+ lvb->lvb_imtime = cpu_to_be64(inode->i_mtime.tv_sec);
mlog_exit_void();
}
@@ -1249,9 +1247,9 @@
inode->i_blocks = 0;
else
inode->i_blocks = ocfs2_align_bytes_to_sectors(i_size_read(inode));
- OCFS_SET_INODE_TIME(inode, i_atime, be64_to_cpu(lvb->lvb_iatime));
- OCFS_SET_INODE_TIME(inode, i_ctime, be64_to_cpu(lvb->lvb_ictime));
- OCFS_SET_INODE_TIME(inode, i_mtime, be64_to_cpu(lvb->lvb_imtime));
+ inode->i_atime.tv_sec = be64_to_cpu(lvb->lvb_iatime);
+ inode->i_ctime.tv_sec = be64_to_cpu(lvb->lvb_ictime);
+ inode->i_mtime.tv_sec = be64_to_cpu(lvb->lvb_imtime);
spin_unlock(&oip->ip_lock);
mlog_exit_void();
Modified: trunk/fs/ocfs2/extent_map.c
===================================================================
--- trunk/fs/ocfs2/extent_map.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/extent_map.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -26,8 +26,6 @@
#define _XOPEN_SOURCE 600 /* Triggers magic in features.h */
#define _LARGEFILE64_SOURCE
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/types.h>
@@ -106,14 +104,7 @@
struct rb_node ***ret_p,
struct rb_node **ret_parent)
{
- struct rb_node **p =
-#ifdef rb_node
-#undef rb_node
- &em->em_extents.rb_node;
-#define rb_node rb_node_s /* I HATE YOU 2.4 */
-#else
- &em->em_extents.rb_node;
-#endif
+ struct rb_node **p = &em->em_extents.rb_node;
struct rb_node *parent = NULL;
struct ocfs2_extent_map_entry *ent = NULL;
Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/file.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,10 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
-#include <linux/version.h>
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -204,6 +200,9 @@
static ssize_t ocfs_file_write(struct file *filp, const char *buf,
size_t count, loff_t *ppos)
{
+ struct iovec local_iov = { .iov_base = (void __user *)buf,
+ .iov_len = count };
+ unsigned int savedflags;
int ret = 0;
ocfs_super *osb = NULL;
struct dentry *dentry = filp->f_dentry;
@@ -238,31 +237,16 @@
goto bail;
down_read(&OCFS_I(inode)->ip_alloc_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- /*
- * On a 2.6 kernel, all a filesystem needs to do to support
- * direct-io is pass in method for getting blocks via the
- * address_space_operations struct
- */
- {
- struct iovec local_iov = { .iov_base = (void __user *)buf,
- .iov_len = count };
- /* ick. seems to be our only way of toggling
- * directio for 2.6 */
- unsigned int savedflags = filp->f_flags;
- if (info.wl_do_direct_io)
- filp->f_flags |= O_DIRECT;
- else
- filp->f_flags &= ~O_DIRECT;
- ret = generic_file_write_nolock (filp, &local_iov, 1, ppos);
- filp->f_flags = savedflags;
- }
-#else
- if (info.wl_do_direct_io)
- ret = ocfs_rw_direct (WRITE, filp, (char *) buf, count, ppos);
+
+ /* ick. seems to be our only way of toggling directio */
+ savedflags = filp->f_flags;
+ if (info.wl_do_direct_io)
+ filp->f_flags |= O_DIRECT;
else
- ret = generic_file_write_nolock (filp, buf, count, ppos);
-#endif
+ filp->f_flags &= ~O_DIRECT;
+ ret = generic_file_write_nolock (filp, &local_iov, 1, ppos);
+ filp->f_flags = savedflags;
+
up_read(&OCFS_I(inode)->ip_alloc_sem);
bail:
@@ -288,6 +272,7 @@
static ssize_t ocfs_file_read(struct file *filp, char *buf,
size_t count, loff_t *ppos)
{
+ unsigned int savedflags;
int ret = 0;
ocfs_super *osb = NULL;
struct dentry *dentry = filp->f_dentry;
@@ -337,30 +322,18 @@
}
down_read(&OCFS_I(inode)->ip_alloc_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- /*
- * On a 2.6 kernel, all a filesystem needs to do to support
- * direct-io is pass in method for getting blocks via the
- * address_space_operations struct
- */
- {
- /* ick. seems to be our only way of toggling
- * directio for 2.6 */
- unsigned int savedflags = filp->f_flags;
- if (do_direct_io)
- filp->f_flags |= O_DIRECT;
- else
- filp->f_flags &= ~O_DIRECT;
- ret = generic_file_read (filp, buf, count, ppos);
- filp->f_flags = savedflags;
- }
-#else
+
+ /* ick. seems to be our only way of toggling directio */
+ savedflags = filp->f_flags;
if (do_direct_io)
- ret = ocfs_rw_direct (READ, filp, buf, count, ppos);
+ filp->f_flags |= O_DIRECT;
else
- ret = generic_file_read (filp, buf, count, ppos);
-#endif
+ filp->f_flags &= ~O_DIRECT;
+ ret = generic_file_read (filp, buf, count, ppos);
+ filp->f_flags = savedflags;
+
up_read(&OCFS_I(inode)->ip_alloc_sem);
+
if (ret == -EINVAL)
mlog(ML_ERROR, "Generic_file_read returned -EINVAL\n");
@@ -380,13 +353,8 @@
.fsync = ocfs_sync_file,
.release = ocfs_file_release,
.open = ocfs_file_open,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.aio_read = ocfs2_file_aio_read,
.aio_write = ocfs2_file_aio_write,
-#else
- .aio_read = ocfs_aio_read,
- .aio_write = ocfs_aio_write,
-#endif
};
struct file_operations ocfs_dops = {
@@ -874,7 +842,7 @@
* extend_trans */
fe->i_size = new_fe_size;
- fe->i_mtime = OCFS_CURRENT_TIME;
+ fe->i_mtime = CURRENT_TIME.tv_sec;
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -920,7 +888,7 @@
mlog(0, "inode: ip_clusters=%u, i_size=%lld\n",
OCFS_I(inode)->ip_clusters, i_size_read(inode));
- fe->i_ctime = fe->i_mtime = OCFS_CURRENT_TIME;
+ fe->i_ctime = fe->i_mtime = CURRENT_TIME.tv_sec;
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -1087,7 +1055,6 @@
return status;
} /* ocfs_setattr */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/*
* ocfs_getattr()
*
@@ -1123,10 +1090,3 @@
.setattr = ocfs_setattr,
.getattr = ocfs_getattr,
};
-#else
-struct inode_operations ocfs_file_iops = {
- .setattr = ocfs_setattr,
- .revalidate = ocfs_inode_revalidate,
-};
-#endif
-
Modified: trunk/fs/ocfs2/file.h
===================================================================
--- trunk/fs/ocfs2/file.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/file.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -44,17 +44,14 @@
struct _ocfs2_alloc_context *meta_ac,
enum ocfs2_alloc_restarted *reason);
int ocfs_setattr(struct dentry *dentry, struct iattr *attr);
+int ocfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
+ struct kstat *stat);
int ocfs_sync_inode(struct inode *inode);
int ocfs_extend_file(ocfs_super *osb,
struct inode *inode,
u64 new_i_size,
u64 *bytes_extended);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-int ocfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
- struct kstat *stat);
-#endif
-
int ocfs_set_inode_size(ocfs_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
Modified: trunk/fs/ocfs2/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/heartbeat.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/heartbeat.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -24,8 +24,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/inode.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -22,8 +22,6 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
-#define KERNEL_NO_F_IOBUF
-#include "ocfs_compat.h"
#include <linux/fs.h>
#include <linux/types.h>
@@ -66,17 +64,12 @@
ocfs_find_inode_args;
static int ocfs_read_locked_inode(struct inode *inode, ocfs_find_inode_args *args);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int ocfs_init_locked_inode(struct inode * inode, void * opaque);
static int ocfs_find_actor (struct inode *inode, void *opaque);
-#else /* 2.4 kernel */
-static int ocfs_find_inode (struct inode *inode, unsigned long ino, void *opaque);
-#endif
static int ocfs_truncate_for_delete(ocfs_super *osb,
struct inode *inode,
struct buffer_head *fe_bh);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/*
* ocfs_ilookup()
* blkno is *required*
@@ -90,15 +83,6 @@
args.ino = ino_from_blkno(osb->sb, blkno);
return ilookup5(osb->sb, args.ino, ocfs_find_actor, &args);
}
-#else
-/*
- * 2.4 doesn't have ilookup so we just fall back to iget here.
- */
-struct inode *ocfs_ilookup(ocfs_super *osb, u64 blkno)
-{
- return ocfs_iget(osb, blkno);
-}
-#endif
/*
* ocfs_iget()
@@ -125,7 +109,6 @@
args.flags = flags;
args.ino = ino_from_blkno(sb, blkno);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
inode = iget5_locked (sb, args.ino, ocfs_find_actor,
ocfs_init_locked_inode, &args);
/* inode was *not* in the inode cache. 2.6.x requires
@@ -136,9 +119,6 @@
ocfs_read_locked_inode(inode, &args);
unlock_new_inode(inode);
}
-#else
- inode = iget4 (sb, args.ino, ocfs_find_inode, &args);
-#endif
if (inode == NULL) {
mlog(ML_ERROR, "access error\n");
inode = NULL;
@@ -162,7 +142,6 @@
} /* ocfs_iget */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/*
* here's how inodes get read from disk:
* iget5_locked -> find_actor -> OCFS_FIND_ACTOR
@@ -217,68 +196,7 @@
return 0;
}
-#else /* 2.4 kernel stuff */
-
/*
- * here's how inodes get read from disk:
- * iget4 -> find_inode -> OCFS_FIND_INODE
- * found? : return the in-memory inode
- * not found? : get_new_inode -> OCFS_READ_INODE2
- */
-
-/*
- * ocfs_find_inode()
- *
- * This is the iget4 helper function
- */
-static int ocfs_find_inode (struct inode *inode, unsigned long ino, void *opaque)
-{
- ocfs_find_inode_args *args = NULL;
- int ret = 0;
-
- mlog_entry ("(0x%p, %lu, 0x%p)\n", inode, ino, opaque);
-
- args = opaque;
-
- if (!inode->u.generic_ip) {
- mlog(ML_ERROR, "inode %lu has no generic_ip (is_bad_inode = "
- "%d)!\n", inode->i_ino, is_bad_inode(inode));
- if (args)
- mlog(ML_ERROR, "args-blkno = %llu, args->ino = %lu, "
- "args->flags = 0x%x\n", args->blkno, args->ino,
- args->flags);
- BUG();
- }
-
- if (opaque == NULL || inode == NULL)
- goto bail;
-
- if (OCFS_I(inode)->ip_blkno != args->blkno)
- goto bail;
-
- ret = 1;
-bail:
- mlog_exit (ret);
- return ret;
-}
-
-void ocfs_read_inode2(struct inode *inode, void *opaque)
-{
- if (ocfs_read_locked_inode(inode, opaque) < 0) {
- mlog(ML_ERROR, "bad inode: i_ino=%lu\n", inode->i_ino);
- make_bad_inode(inode);
- }
-}
-
-void ocfs_read_inode(struct inode *inode)
-{
- make_bad_inode(inode);
-}
-
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
-
-
-/*
* ocfs_inode_init_private()
*
*/
@@ -373,13 +291,10 @@
else
inode->i_blocks = ocfs2_align_bytes_to_sectors(fe->i_size);
inode->i_mapping->a_ops = &ocfs_aops;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- inode->i_attr_flags |= ATTR_FLAG_NOATIME;
-#endif
inode->i_flags |= S_NOATIME;
- OCFS_SET_INODE_TIME(inode, i_atime, fe->i_atime);
- OCFS_SET_INODE_TIME(inode, i_mtime, fe->i_mtime);
- OCFS_SET_INODE_TIME(inode, i_ctime, fe->i_ctime);
+ inode->i_atime.tv_sec = fe->i_atime;
+ inode->i_mtime.tv_sec = fe->i_mtime;
+ inode->i_ctime.tv_sec = fe->i_ctime;
OCFS_I(inode)->ip_blkno = fe->i_blkno;
@@ -521,11 +436,7 @@
void ocfs_sync_blockdev(struct super_block *sb)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- sync_blockdev (sb->s_bdev);
-#else
- fsync_no_super (sb->s_dev);
-#endif
+ sync_blockdev(sb->s_bdev);
}
static int ocfs_truncate_for_delete(ocfs_super *osb,
@@ -754,7 +665,7 @@
goto bail;
}
- fe->i_dtime = OCFS_CURRENT_TIME;
+ fe->i_dtime = CURRENT_TIME.tv_sec;
fe->i_flags &= (~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL));
status = ocfs_journal_dirty(handle, fe_bh);
@@ -912,9 +823,7 @@
/*
* ocfs_inode_revalidate()
*
- * In 2.4, this is called only from stat.c always without i_sem before
- * any stat operations go through. In 2.6, this is called from our own
- * getattr.
+ * This is called from our getattr.
*/
int ocfs_inode_revalidate(struct dentry *dentry)
{
@@ -986,11 +895,11 @@
fe->i_uid = inode->i_uid;
fe->i_gid = inode->i_gid;
fe->i_mode = inode->i_mode;
- fe->i_atime = ocfs_get_seconds(inode->i_atime);
- fe->i_ctime = ocfs_get_seconds(inode->i_ctime);
- fe->i_mtime = ocfs_get_seconds(inode->i_mtime);
+ fe->i_atime = inode->i_atime.tv_sec;
+ fe->i_ctime = inode->i_ctime.tv_sec;
+ fe->i_mtime = inode->i_mtime.tv_sec;
#warning "do we want to update these here?"
-// fe->i_dtime = ocfs_get_seconds(inode->i_dtime);
+// fe->i_dtime = inode->i_dtime.tv_sec;
status = ocfs_journal_dirty(handle, bh);
if (status < 0)
@@ -1031,9 +940,9 @@
inode->i_blocks = 0;
else
inode->i_blocks = ocfs2_align_bytes_to_sectors(i_size_read(inode));
- OCFS_SET_INODE_TIME(inode, i_ctime, fe->i_ctime);
- OCFS_SET_INODE_TIME(inode, i_atime, fe->i_atime);
- OCFS_SET_INODE_TIME(inode, i_mtime, fe->i_mtime);
+ inode->i_atime.tv_sec = fe->i_atime;
+ inode->i_mtime.tv_sec = fe->i_mtime;
+ inode->i_ctime.tv_sec = fe->i_ctime;
spin_unlock(&oip->ip_lock);
} /* ocfs_refresh_inode */
Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/journal.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -119,92 +117,6 @@
return status;
} /* ocfs_commit_cache */
-/*
- * JBD in 2.4 kernels uses lock_kernel pretty heavily. Most of the
- * time we get that from the VFS, but we do transactions without BKL
- * sometimes. 2.6 does things right and spinlocks around it's
- * structures so at least this junk won't last too long...
- *
- * These aren't in ocfs_compat.h because they require wayyyy to much
- * #included.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#include <linux/smp_lock.h>
-
-static inline handle_t *ocfs_journal_start(journal_t *journal, int nblocks)
-{
- handle_t *h;
-
- lock_kernel();
- h = journal_start(journal, nblocks);
- unlock_kernel();
-
- return h;
-}
-
-static inline int ocfs_journal_stop(handle_t *handle)
-{
- int status;
-
- lock_kernel();
- status = journal_stop(handle);
- unlock_kernel();
-
- return status;
-}
-
-#undef journal_start
-#undef journal_stop
-
-#define journal_start(journal, nblocks) \
- ocfs_journal_start(journal, nblocks)
-#define journal_stop(handle) \
- ocfs_journal_stop(handle)
-
-/* these two gained another argument during 2.6 */
-static inline int ocfs_journal_get_write_access(handle_t *handle, struct buffer_head *bh)
-{
- int ret;
-
- lock_kernel();
- ret = journal_get_write_access(handle, bh);
- unlock_kernel();
- return ret;
-}
-
-static inline int ocfs_journal_get_undo_access(handle_t *handle, struct buffer_head *bh)
-{
- int ret;
-
- lock_kernel();
- ret = journal_get_undo_access(handle, bh);
- unlock_kernel();
- return ret;
-}
-
-static inline int ocfs_commit_cache24 (ocfs_super * osb)
-{
- int ret;
-
- lock_kernel();
- ret = ocfs_commit_cache(osb);
- unlock_kernel();
- return ret;
-}
-
-#undef ocfs_commit_cache
-
-#define ocfs_commit_cache ocfs_commit_cache24
-
-#undef journal_get_write_access
-#undef journal_get_undo_access
-
-#define journal_get_write_access(handle, bh, credits) \
- ocfs_journal_get_write_access(handle, bh)
-#define journal_get_undo_access(handle, bh, credits) \
- ocfs_journal_get_undo_access(handle, bh)
-#endif
-
ocfs_journal_handle * ocfs_alloc_handle(ocfs_super *osb)
{
ocfs_journal_handle * retval = NULL;
Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/localalloc.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/mmap.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -56,16 +54,9 @@
size_t size,
ocfs2_buffer_lock_ctxt *ctxt);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct page *ocfs2_nopage(struct vm_area_struct * area,
unsigned long address,
int *type)
-#else
-/* 'type' is unused in 2.4. */
-static struct page *ocfs2_nopage(struct vm_area_struct * area,
- unsigned long address,
- int type)
-#endif
{
int status;
int locked;
@@ -158,16 +149,7 @@
static inline struct rb_node * __ocfs2_buffer_lock_ctxt_root(
ocfs2_buffer_lock_ctxt *ctxt)
{
- struct rb_node *root =
-#ifdef rb_node
-#undef rb_node
- ctxt->b_inodes.rb_node;
-#define rb_node rb_node_s /* I HATE YOU 2.4 */
-#else
- ctxt->b_inodes.rb_node;
-#endif
-
- return root;
+ return ctxt->b_inodes.rb_node;
}
static int ocfs2_buffer_lock_ctxt_insert(ocfs2_buffer_lock_ctxt *ctxt,
@@ -177,14 +159,7 @@
u64 blkno;
ocfs2_backing_inode *tmp, *binode;
struct rb_node * parent = NULL;
- struct rb_node ** p =
-#ifdef rb_node
-#undef rb_node
- &ctxt->b_inodes.rb_node;
-#define rb_node rb_node_s /* I HATE YOU 2.4 */
-#else
- &ctxt->b_inodes.rb_node;
-#endif
+ struct rb_node ** p = &ctxt->b_inodes.rb_node;
OCFS_ASSERT(ctxt);
OCFS_ASSERT(inode);
Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/namei.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -36,8 +36,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -573,7 +571,7 @@
fe->i_last_eb_blk = 0;
strcpy (fe->i_signature, OCFS2_INODE_SIGNATURE);
fe->i_flags |= OCFS2_VALID_FL;
- fe->i_atime = fe->i_ctime = fe->i_mtime = OCFS_CURRENT_TIME;
+ fe->i_atime = fe->i_ctime = fe->i_mtime = CURRENT_TIME.tv_sec;
fe->i_dtime = 0;
fel = &fe->id2.i_list;
@@ -711,9 +709,9 @@
}
fe->i_links_count++;
- fe->i_ctime = OCFS_CURRENT_TIME;
+ fe->i_ctime = CURRENT_TIME.tv_sec;
inode->i_nlink = fe->i_links_count;
- OCFS_SET_INODE_TIME(inode, i_ctime, fe->i_ctime);
+ inode->i_ctime.tv_sec = fe->i_ctime;
err = ocfs_journal_dirty(handle, fe_bh);
if (err < 0) {
@@ -2229,7 +2227,6 @@
return status;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
struct inode_operations ocfs_dir_iops = {
.create = ocfs_create,
.lookup = ocfs_lookup,
@@ -2243,34 +2240,3 @@
.setattr = ocfs_setattr,
.getattr = ocfs_getattr,
};
-#else
-static struct dentry *ocfs_lookup_24(struct inode *dir, struct dentry *dentry)
-{
- return ocfs_lookup(dir, dentry, NULL);
-}
-
-static int ocfs_create_24(struct inode *dir, struct dentry *dentry, int mode)
-{
- return ocfs_create(dir, dentry, mode, NULL);
-}
-
-static int ocfs_mknod_24(struct inode *dir, struct dentry *dentry,
- int mode, int dev)
-{
- return ocfs_mknod(dir, dentry, mode, dev);
-}
-
-struct inode_operations ocfs_dir_iops = {
- .create = ocfs_create_24,
- .lookup = ocfs_lookup_24,
- .link = ocfs_link,
- .unlink = ocfs_unlink,
- .rmdir = ocfs_unlink,
- .symlink = ocfs_symlink,
- .mkdir = ocfs_mkdir,
- .mknod = ocfs_mknod_24,
- .rename = ocfs_rename,
- .setattr = ocfs_setattr,
- .revalidate = ocfs_inode_revalidate,
-};
-#endif
Modified: trunk/fs/ocfs2/ocfs.h
===================================================================
--- trunk/fs/ocfs2/ocfs.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/ocfs.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -29,18 +29,13 @@
/*
** System header files
*/
-#define __KERNEL_SYSCALLS__
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/rbtree.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-# include <linux/workqueue.h>
-#else
-# include <linux/tqueue.h>
-#endif
+#include <linux/workqueue.h>
#include "cluster/nodemanager.h"
#include "cluster/heartbeat.h"
@@ -50,19 +45,17 @@
/* convenience macro */
-#define OCFS_ASSERT(x) do { if (!(x)) BUG(); } while (0)
+#define OCFS_ASSERT(cond) do { if (unlikely(!(cond))) BUG(); } while (0)
+
#define OCFS_ASSERT_RO(x) \
do { \
- if (!(x)) { \
+ if (unlikely(!(x))) { \
printk(KERN_ERR "This should make the filesystem remount RO\n"); \
BUG(); \
} \
} while (0)
-#define OCFS_CURRENT_TIME ocfs_get_seconds(CURRENT_TIME)
-#define OCFS_SET_INODE_TIME(i, x, y) (ocfs_get_seconds(i->x) = (y))
-
#define OCFS_MAX_OSB_ID 65536
#define OCFS_INVALID_NODE_NUM -1
@@ -78,8 +71,8 @@
** Structures...
*/
-#define OCFS_SB(sb) ((ocfs_super *)OCFS_GENERIC_SB_MEMBER(sb))
-#define OCFS2_SB(sb) ((ocfs_super *)OCFS_GENERIC_SB_MEMBER(sb))
+#define OCFS_SB(sb) ((ocfs_super *)(sb)->s_fs_info)
+#define OCFS2_SB(sb) ((ocfs_super *)(sb)->s_fs_info)
/* This totally sucks that we have to include these here
* FIXME: Make them seperately includable. */
Deleted: trunk/fs/ocfs2/ocfs_compat.c
===================================================================
--- trunk/fs/ocfs2/ocfs_compat.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/ocfs_compat.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,120 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs_compat.h
- *
- * Compatibility stuff for 2.4
- *
- * Code to deal with the mess that is clustered mmap.
- *
- * Copyright (C) 2002, 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#include "ocfs_compat.h"
-
-#include <linux/fs.h>
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/highmem.h>
-#include <linux/pagemap.h>
-#include <linux/uio.h>
-#include <linux/rbtree.h>
-
-#include "ocfs.h"
-#include "ocfs2.h"
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-/*
- * This function returns the first node (in sort order) of the tree.
- */
-struct rb_node *rb_first(struct rb_root *root)
-{
- struct rb_node *n;
-
-#undef rb_node
- n = root->rb_node;
-#define rb_node rb_node_s /* I HATE YOU 2.4 */
- if (!n)
- return 0;
- while (n->rb_left)
- n = n->rb_left;
- return n;
-}
-
-struct rb_node *rb_next(struct rb_node *node)
-{
- /* If we have a right-hand child, go down and then left as far
- as we can. */
- if (node->rb_right) {
- node = node->rb_right;
- while (node->rb_left)
- node=node->rb_left;
- return node;
- }
-
- /* No right-hand children. Everything down and left is
- smaller than us, so any 'next' node must be in the general
- direction of our parent. Go up the tree; any time the
- ancestor is a right-hand child of its parent, keep going
- up. First time it's a left-hand child of its parent, said
- parent is our 'next' node. */
- while (node->rb_parent && node == node->rb_parent->rb_right)
- node = node->rb_parent;
-
- return node->rb_parent;
-}
-
-struct rb_node *rb_prev(struct rb_node *node)
-{
- /* If we have a left-hand child, go down and then right as far
- as we can. */
- if (node->rb_left) {
- node = node->rb_left;
- while (node->rb_right)
- node=node->rb_right;
- return node;
- }
-
- /* No left-hand children. Go up till we find an ancestor which
- is a right-hand child of its parent */
- while (node->rb_parent && node == node->rb_parent->rb_left)
- node = node->rb_parent;
-
- return node->rb_parent;
-}
-#endif /* LINUX_VERSION_CODE */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
-struct rb_node *rb_last(struct rb_root *root)
-{
- struct rb_node *n;
-
-#ifdef rb_node
-#undef rb_node
- n = root->rb_node;
-#define rb_node rb_node_s
-#else
- n = root->rb_node;
-#endif
- if (!n)
- return NULL;
- while (n->rb_right)
- n = n->rb_right;
- return n;
-}
-#endif /* LINUX_VERSION_CODE */
Deleted: trunk/fs/ocfs2/ocfs_compat.h
===================================================================
--- trunk/fs/ocfs2/ocfs_compat.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/ocfs_compat.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,153 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs_compat.h
- *
- * Compatibility stuff for 2.4
- *
- * Copyright (C) 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version
- * 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#ifndef OCFS_COMPAT_H
-#define OCFS_COMPAT_H
-
-#include <linux/version.h>
-#include <linux/types.h>
-#include <linux/kdev_t.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-
-#include <linux/sched.h>
-
-#define OCFS_GENERIC_SB_MEMBER(sb) ((sb)->u.generic_sbp)
-
-#define ocfs_get_seconds(t) (t)
-
-#define wait_on_page_locked(p) wait_on_page(p)
-#define PageUptodate(p) Page_Uptodate(p)
-
-#define set_buffer_new(bh) (bh->b_state |= (1UL << BH_New))
-
-#ifdef OCFS_COMPAT_SAFE_WRITE
-#define generic_file_write_nolock do_generic_file_write
-#endif
-
-#define rb_root rb_root_s
-#define rb_node rb_node_s
-struct rb_node *rb_first(struct rb_root *root);
-struct rb_node *rb_next(struct rb_node *node);
-struct rb_node *rb_prev(struct rb_node *node);
-
-typedef long sector_t;
-
-#define map_bh(bh, sb, blk) \
- ({ \
- typeof(bh) _bh = (bh); \
- _bh->b_dev = (sb)->s_dev; \
- _bh->b_blocknr = (blk); \
- _bh->b_state |= (1UL << BH_Mapped); \
- })
-
-#define io_schedule schedule
-#define io_schedule_timeout schedule_timeout
-#define bdev_hardsect_size(b) get_hardsect_size((b)->bd_dev);
-
-#define flush_scheduled_work flush_scheduled_tasks
-#define work_struct tq_struct
-#define INIT_WORK(w, f, d) INIT_TQUEUE(w, f, d)
-#define schedule_work(w) schedule_task(w)
-
-/* I don't believe this does the same thing in 2.4 as it does in 2.6
- * and in fact, I don't think the 2.6 version does *anything* in our
- * case. */
-static inline int sync_mapping_buffers(struct address_space *mapping)
-{
- struct inode *inode = mapping->host;
- int error;
-
- error = fsync_inode_buffers(inode);
- if (!error)
- error = fsync_inode_data_buffers(inode);
- return error;
-}
-
-#define filemap_fdatawrite(mapping) \
- filemap_fdatasync(mapping);
-
-static inline int dequeue_signal_lock(struct task_struct *tsk,
- sigset_t *mask, siginfo_t *info)
-{
- unsigned long flags;
- int ret;
-
- spin_lock_irqsave(&tsk->sighand->siglock, flags);
- ret = dequeue_signal(mask, info);
- spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
-
- return ret;
-}
-
-static inline dev_t huge_decode_dev(u64 val)
-{
- u16 val16 = (u16)(val & 0xFFFFULL);
- return MKDEV((val16 >> 8) & 0xFF, val16 & 0xFF);
-}
-
-static inline u64 huge_encode_dev(dev_t dev)
-{
- return (u64)((MAJOR(dev) << 8) | MINOR(dev));
-}
-
-#define kstatfs statfs
-
-static inline loff_t i_size_read(struct inode *inode)
-{
- return inode->i_size;
-}
-
-static inline void i_size_write(struct inode *inode, loff_t i_size)
-{
- inode->i_size = i_size;
-}
-
-#else /* LINUX_VERSION_CODE < 2.6 */
-#include <linux/sched.h>
-#include <linux/signal.h>
-
-#define OCFS_GENERIC_SB_MEMBER(sb) ((sb)->s_fs_info)
-
-#define ocfs_get_seconds(t) ((t).tv_sec)
-
-#endif /* LINUX_VERSION_CODE < 2.6 */
-
-#ifndef BITS_TO_LONGS
-#define BITS_TO_LONGS(bits) \
- (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
-#endif
-
-#ifndef container_of
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
-struct rb_node *rb_last(struct rb_root *root);
-#endif
-
-#endif /* OCFS_COMPAT_H */
Modified: trunk/fs/ocfs2/proc.c
===================================================================
--- trunk/fs/ocfs2/proc.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/proc.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
Modified: trunk/fs/ocfs2/slot_map.c
===================================================================
--- trunk/fs/ocfs2/slot_map.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/slot_map.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/suballoc.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -24,8 +24,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/super.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/types.h>
@@ -33,10 +31,8 @@
#include <linux/utsname.h>
#include <linux/init.h>
#include <linux/random.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/statfs.h>
#include <linux/moduleparam.h>
-#endif
#include <linux/blkdev.h>
#include <linux/socket.h>
#include <linux/inet.h>
@@ -90,11 +86,7 @@
static int ocfs_statfs(struct super_block *sb, struct kstatfs *buf);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int ocfs_sync_fs(struct super_block *sb, int wait);
-#else
-static int ocfs_sync_fs(struct super_block *sb);
-#endif
static int ocfs_init_global_system_inodes(ocfs_super *osb);
static int ocfs_init_local_system_inodes(ocfs_super *osb);
@@ -116,10 +108,6 @@
.delete_inode = ocfs_delete_inode,
.sync_fs = ocfs_sync_fs,
.write_super = ocfs_write_super,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- .read_inode = ocfs_read_inode,
- .read_inode2 = ocfs_read_inode2,
-#endif
.put_super = ocfs_put_super,
};
@@ -139,17 +127,6 @@
sb->s_dirt = 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-static int ocfs_sync_fs(struct super_block *sb)
-{
- tid_t target;
-
- sb->s_dirt = 0;
- target = log_start_commit(OCFS2_SB(sb)->journal->j_journal, NULL);
- log_wait_commit(OCFS2_SB(sb)->journal->j_journal, target);
- return 0;
-}
-#else
static int ocfs_sync_fs(struct super_block *sb, int wait)
{
tid_t target;
@@ -162,7 +139,6 @@
}
return 0;
}
-#endif
/*
* ocfs_init_global_system_inodes()
@@ -393,7 +369,6 @@
return status;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct super_block *ocfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
{
return get_sb_bdev(fs_type, flags, dev_name, data, ocfs_fill_super);
@@ -411,15 +386,6 @@
.next = NULL
};
-#else
-static struct super_block *ocfs_read_super (struct super_block *sb, void *data, int silent)
-{
- return (ocfs_fill_super(sb, data, silent) < 0) ? NULL : sb;
-}
-
-static DECLARE_FSTYPE (ocfs_fs_type, "ocfs2", ocfs_read_super, FS_REQUIRES_DEV);
-#endif
-
static int __init ocfs2_init(void)
{
int status;
@@ -739,8 +705,7 @@
}
memset(osb, 0, sizeof(ocfs_super));
- OCFS_GENERIC_SB_MEMBER(sb) = osb;
-
+ sb->s_fs_info = osb;
osb->sb = sb;
/* Save off for ocfs_rw_direct */
Modified: trunk/fs/ocfs2/symlink.c
===================================================================
--- trunk/fs/ocfs2/symlink.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/symlink.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -34,8 +34,6 @@
*
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -397,7 +395,6 @@
return ret;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
struct inode_operations ocfs_symlink_inode_operations = {
.readlink = page_readlink,
.follow_link = ocfs_follow_link,
@@ -408,15 +405,3 @@
.follow_link = ocfs_follow_link,
.getattr = ocfs_getattr,
};
-#else
-struct inode_operations ocfs_symlink_inode_operations = {
- .readlink = page_readlink,
- .follow_link = ocfs_follow_link,
- .revalidate = ocfs_inode_revalidate,
-};
-struct inode_operations ocfs_fast_symlink_inode_operations = {
- .readlink = ocfs2_readlink,
- .follow_link = ocfs_follow_link,
- .revalidate = ocfs_inode_revalidate,
-};
-#endif
Modified: trunk/fs/ocfs2/sysfile.c
===================================================================
--- trunk/fs/ocfs2/sysfile.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/sysfile.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/fs/ocfs2/vote.c 2005-04-30 02:31:39 UTC (rev 2206)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
Deleted: trunk/kapi-compat/include/kcalloc.h
===================================================================
--- trunk/kapi-compat/include/kcalloc.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/kapi-compat/include/kcalloc.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,23 +0,0 @@
-#ifndef KAPI_KCALLOC_H
-#define KAPI_KCALLOC_H
-
-#include <linux/slab.h>
-
-static inline void *kcalloc(size_t nmemb, size_t size, int flags)
-{
- void *ret = NULL;
-
- if (nmemb != 0 && (size > (INT_MAX / nmemb)))
- goto out;
-
- ret = kmalloc(nmemb * size, flags);
- if (ret == NULL)
- goto out;
-
- memset(ret, 0, nmemb * size);
-
-out:
- return ret;
-}
-
-#endif /* KAPI_KCALLOC_H */
Deleted: trunk/kapi-compat/include/msecs_to_jiffies.h
===================================================================
--- trunk/kapi-compat/include/msecs_to_jiffies.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/kapi-compat/include/msecs_to_jiffies.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,30 +0,0 @@
-#ifndef KAPI_MSECS_TO_JIFFIES_H
-#define KAPI_MSECS_TO_JIFFIES_H
-
-#include <linux/time.h>
-
-static inline unsigned int jiffies_to_msecs(const unsigned long j)
-{
-#if HZ <= 1000 && !(1000 % HZ)
- return (1000 / HZ) * j;
-#elif HZ > 1000 && !(HZ % 1000)
- return (j + (HZ / 1000) - 1)/(HZ / 1000);
-#else
- return (j * 1000) / HZ;
-#endif
-}
-
-static inline unsigned long msecs_to_jiffies(const unsigned int m)
-{
- if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
- return MAX_JIFFY_OFFSET;
-#if HZ <= 1000 && !(1000 % HZ)
- return (m + (1000 / HZ) - 1) / (1000 / HZ);
-#elif HZ > 1000 && !(HZ % 1000)
- return m * (HZ / 1000);
-#else
- return (m * HZ + 999) / 1000;
-#endif
-}
-
-#endif
Added: trunk/kapi-compat/include/rb_last.h
===================================================================
--- trunk/kapi-compat/include/rb_last.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/kapi-compat/include/rb_last.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -0,0 +1,18 @@
+#ifndef KAPI_RB_LAST_H
+#define KAPI_RB_LAST_H
+
+#include <linux/rbtree.h>
+
+static inline struct rb_node *rb_last(struct rb_root *root)
+{
+ struct rb_node *n;
+
+ n = root->rb_node;
+ if (!n)
+ return NULL;
+ while (n->rb_right)
+ n = n->rb_right;
+ return n;
+}
+
+#endif
Deleted: trunk/kapi-compat/include/wait_event_interruptible_timeout.h
===================================================================
--- trunk/kapi-compat/include/wait_event_interruptible_timeout.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/kapi-compat/include/wait_event_interruptible_timeout.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,37 +0,0 @@
-#ifndef KAPI_WAIT_EVENT_INTERRUPTIBLE_TIMEOUT_H
-#define KAPI_WAIT_EVENT_INTERRUPTIBLE_TIMEOUT_H
-
-#include <linux/wait.h>
-
-#define __wait_event_interruptible_timeout(wq, condition, ret) \
-do { \
- wait_queue_t __wait; \
- init_waitqueue_entry(&__wait, current); \
- \
- add_wait_queue(&wq, &__wait); \
- for (;;) { \
- set_current_state(TASK_INTERRUPTIBLE); \
- if (condition) \
- break; \
- if (!signal_pending(current)) { \
- ret = schedule_timeout(ret); \
- if (!ret) \
- break; \
- continue; \
- } \
- ret = -ERESTARTSYS; \
- break; \
- } \
- current->state = TASK_RUNNING; \
- remove_wait_queue(&wq, &__wait); \
-} while (0)
-
-#define wait_event_interruptible_timeout(wq, condition, timeout) \
-({ \
- long __ret = timeout; \
- if (!(condition)) \
- __wait_event_interruptible_timeout(wq, condition, __ret); \
- __ret; \
-})
-
-#endif
Deleted: trunk/kapi-compat/include/wait_event_timeout.h
===================================================================
--- trunk/kapi-compat/include/wait_event_timeout.h 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/kapi-compat/include/wait_event_timeout.h 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,30 +0,0 @@
-#ifndef KAPI_WAIT_EVENT_TIMEOUT_H
-#define KAPI_WAIT_EVENT_TIMEOUT_H
-
-#include <linux/wait.h>
-
-#define __wait_event_timeout(wq, condition, ret) \
-do { \
- DEFINE_WAIT(__wait); \
- \
- for (;;) { \
- prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \
- if (condition) \
- break; \
- ret = schedule_timeout(ret); \
- if (!ret) \
- break; \
- } \
- finish_wait(&wq, &__wait); \
-} while (0)
-
-#define wait_event_timeout(wq, condition, timeout) \
-({ \
- long __ret = timeout; \
- if (!(condition)) \
- __wait_event_timeout(wq, condition, __ret); \
- __ret; \
-})
-
-
-#endif
Modified: trunk/vendor/redhat/Makefile
===================================================================
--- trunk/vendor/redhat/Makefile 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/vendor/redhat/Makefile 2005-04-30 02:31:39 UTC (rev 2206)
@@ -3,7 +3,6 @@
include $(TOPDIR)/Preamble.make
DIST_FILES = \
- ocfs2-2.4.21-EL.spec-generic.in \
ocfs2-2.6.9-EL.spec-generic.in
include $(TOPDIR)/Postamble.make
Deleted: trunk/vendor/redhat/ocfs2-2.4.21-EL.spec-generic.in
===================================================================
--- trunk/vendor/redhat/ocfs2-2.4.21-EL.spec-generic.in 2005-04-30 01:33:05 UTC (rev 2205)
+++ trunk/vendor/redhat/ocfs2-2.4.21-EL.spec-generic.in 2005-04-30 02:31:39 UTC (rev 2206)
@@ -1,199 +0,0 @@
-#
-# Spec file for ocfs2 on RHEL3
-#
-
-# 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 EL3 kernel specfile
-%ifnarch i686
-%define buildhugemem 0
-%endif
-
-%ifarch ia32e
-%define buildsmp 0
-%endif
-
-%ifarch s390 s390x
-%define buildsmp 0
-%endif
-%ifarch ppc64pseries ppc64iseries
-%define buildsmp 0
-%endif
-%ifarch ia64
-%define buildsmp 0
-%endif
-
-%define base 2.4.21
-%define sver %{generic}
-%define kver %{base}-%{sver}.EL
-
-# The minimum tools package required for the kernel bits.
-%define tools_ver @TOOLS_REQUIRED_VERSION@
-
-Summary: The Oracle Cluster Filesystem 2
-Name: ocfs2-%{kver}
-Version: @DIST_VERSION@
-Release: @RPM_VERSION@
-Copyright: GPL
-Group: System Environment/Kernel
-Source: ocfs2- at DIST_VERSION@.tar.gz
-URL: http://oss.oracle.com/projects/ocfs2/
-Distribution: Oracle
-Vendor: Oracle Corporation
-Packager: Joel Becker <joel.becker at oracle.com>
-Provides: ocfs2 = %{version}
-AutoReqProv: no
-Requires: kernel = %{kver}
-Requires: ocfs2-tools >= %{tools_ver}
-BuildRequires: kernel-source = %{kver}
-
-
-BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
-
-
-%description
-OCFS2 is the Oracle Cluster Filesystem 2. This package is compiled for
-uniprocessor kernels.
-
-%if %{buildsmp}
-%package -n ocfs2-%{kver}smp
-Summary: The Oracle Cluster Filesystem 2 for SMP systems.
-Group: System Environment/Kernel
-Provides: ocfs2 = %{version}
-Requires: kernel-smp = %{kver}
-Requires: ocfs2-tools >= %{tools_ver}
-BuildRequires: kernel-source = %{kver}
-AutoReqProv: no
-
-
-%description -n ocfs2-%{kver}smp
-OCFS2 is the Oracle Cluster Filesystem 2. This package is compiled for
-symmetric multiprocessor kernels.
-%endif
-
-
-%if %{buildhugemem}
-%package -n ocfs2-%{kver}hugemem
-Summary: The Oracle Cluster Filesystem for huge memory systems.
-Group: System Environment/Kernel
-Provides: ocfs2 = %{version}
-Requires: kernel-hugemem = %{kver}
-Requires: ocfs2-tools >= %{tools_ver}
-BuildRequires: kernel-source = %{kver}
-AutoReqProv: no
-
-
-%description -n ocfs2-%{kver}hugemem
-OCFS2 is the Oracle Cluster Filesystem 2. This package is compiled for
-symmetric multiprocessor kernels.
-%endif
-
-
-%if %{builddebug}
-%package -n ocfs2-%{kver}debug
-Summary: The Oracle Cluster Filesystem 2 for debugging systems.
-Group: System Environment/Kernel
-Provides: ocfs2 = %{version}
-Requires: kernel-debug = %{kver}
-Requires: ocfs2-tools >= %{tools_ver}
-BuildRequires: kernel-source = %{kver}
-AutoReqProv: no
-
-
-%description -n ocfs2-%{kver}debug
-OCFS2 is the Oracle Cluster Filesystem 2. This package is compiled for
-debugging kernels.
-%endif
-
-
-%prep
-%setup -n ocfs2-%{version}
-
-
-%build
-KPATH="/usr/src/linux-%{kver}"
-%configure --with-kernel="${KPATH}"
-
-%if %{buildup}
-make KVER=up
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}/kernel" install
-make clean
-%endif
-
-%if %{buildsmp}
-make KVER=smp
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}smp/kernel" install
-make clean
-%endif
-
-%if %{buildhugemem}
-make KVER=hugemem
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}hugemem/kernel" install
-make clean
-%endif
-
-%if %{builddebug}
-make KVER=debug
-make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}debug/kernel" install
-make clean
-%endif
-
-
-%clean
-rm -rf "$RPM_BUILD_ROOT"
-
-
-%if %{buildup}
-%post
-depmod -a
-
-%files
-%defattr(-,root,root)
-/lib/modules/%{kver}/kernel/fs
-%endif
-
-%if %{buildsmp}
-%post -n ocfs2-%{kver}smp
-depmod -a
-
-%files -n ocfs2-%{kver}smp
-%defattr(-,root,root)
-/lib/modules/%{kver}smp/kernel/fs
-%endif
-
-%if %{buildhugemem}
-%post -n ocfs2-%{kver}hugemem
-depmod -a
-
-%files -n ocfs2-%{kver}hugemem
-%defattr(-,root,root)
-/lib/modules/%{kver}hugemem/kernel/fs
-%endif
-
-%if %{builddebug}
-%post -n ocfs2-%{kver}debug
-depmod -a
-
-%files -n ocfs2-%{kver}debug
-%defattr(-,root,root)
-/lib/modules/%{kver}debug/kernel/fs
-%endif
-
-
-%changelog
-* Fri Jan 21 2005 Joel Becker <joel.becker at oracle.com>
-- Migrate to OCFS2
-
-* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
-- Initial rpm spec file
More information about the Ocfs2-commits
mailing list