[Ocfs2-commits] manish commits r2107 - in trunk: . fs fs/configfs
fs/ocfs2 fs/ocfs2/cluster fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Apr 4 02:43:47 CDT 2005
Author: manish
Signed-off-by: mfasheh
Date: 2005-04-04 02:43:45 -0500 (Mon, 04 Apr 2005)
New Revision: 2107
Added:
trunk/fs/ocfs2/cluster/ver.c
trunk/fs/ocfs2/cluster/ver.h
trunk/fs/ocfs2/dlm/dlmfsver.c
trunk/fs/ocfs2/dlm/dlmfsver.h
trunk/fs/ocfs2/dlm/dlmver.c
trunk/fs/ocfs2/dlm/dlmver.h
Modified:
trunk/Config.make.in
trunk/Postamble.make
trunk/Versioning.make
trunk/fs/Makefile
trunk/fs/configfs/Makefile
trunk/fs/configfs/mount.c
trunk/fs/ocfs2/Makefile
trunk/fs/ocfs2/cluster/Makefile
trunk/fs/ocfs2/cluster/nodemanager.c
trunk/fs/ocfs2/dlm/Makefile
trunk/fs/ocfs2/dlm/dlmdomain.c
trunk/fs/ocfs2/dlm/dlmfs.c
trunk/fs/ocfs2/proc.c
trunk/fs/ocfs2/super.c
trunk/fs/ocfs2/ver.c
trunk/fs/ocfs2/ver.h
Log:
Do versioning magic for all the kernel modules
Signed-off-by: mfasheh
Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/Config.make.in 2005-04-04 07:43:45 UTC (rev 2107)
@@ -57,6 +57,8 @@
GCCINC = @GCCINC@
KVER =
+else
+MAKEBO_VERSION = @VERSION@
endif
EXTRA_CFLAGS += @KAPI_COMPAT_CFLAGS@
Modified: trunk/Postamble.make
===================================================================
--- trunk/Postamble.make 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/Postamble.make 2005-04-04 07:43:45 UTC (rev 2107)
@@ -1,38 +1,7 @@
-ifdef VERSION_SRC
+include $(TOPDIR)/Versioning.make
-ifndef VERSION_FILES
-$(error Need VERSION_FILES defined for version objects)
-endif
+$(VERSION_OBJ): $(STAMP_MD5) $(VERSTAMP)
-ifndef VERSION_PREFIX
-$(error Need VERSION_PREFIX defined for version objects)
-endif
-
-VERSION_OBJ = $(subst .c,.o,$(VERSION_SRC))
-
-VERSION_NUM = $(VERSION_PREFIX)_BUILD_VERSION
-VERSION_DATE = $(VERSION_PREFIX)_BUILD_DATE
-VERSION_MD5 = $(VERSION_PREFIX)_BUILD_MD5
-
-VERDEFS = -D$(VERSION_NUM)=\""$(VERSION)"\" \
- -D$(VERSION_DATE)=\""$(shell LANG=C date)"\" \
- -D$(VERSION_MD5)=\""$(shell cat stamp-md5)"\"
-
-VERMAGIC = $(if $(filter $(VERSION_OBJ),$@),$(VERDEFS))
-
-ifneq ($(MAKECMDGOALS),install)
-VERSTAMP = stamp
-endif
-
-stamp: ;
-
-stamp-md5: $(VERSION_FILES)
- @cat $(VERSION_FILES) Makefile | md5sum | sed -e 's/ .*//' > stamp-md5
-
-$(VERSION_OBJ): stamp-md5 $(VERSTAMP)
-endif
-
-
LOCAL_CFLAGS = $($(subst /,_,$(basename $@))_CFLAGS)
LOCAL_CPPFLAGS = $($(subst /,_,$(basename $@))_CPPFLAGS)
Modified: trunk/Versioning.make
===================================================================
--- trunk/Versioning.make 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/Versioning.make 2005-04-04 07:43:45 UTC (rev 2107)
@@ -20,7 +20,11 @@
STAMP_MD5 = stamp-md5
endif
-VERDEFS = -D$(VERSION_NUM)=\""$(VERSION)"\" \
+ifndef MAKEBO_VERSION
+MAKEBO_VERSION = $(VERSION)
+endif
+
+VERDEFS = -D$(VERSION_NUM)=\""$(MAKEBO_VERSION)"\" \
-D$(VERSION_DATE)=\""$(shell LANG=C date)"\" \
-D$(VERSION_MD5)=\""$(shell cat $(STAMP_MD5))"\"
Modified: trunk/fs/Makefile
===================================================================
--- trunk/fs/Makefile 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/Makefile 2005-04-04 07:43:45 UTC (rev 2107)
@@ -49,6 +49,8 @@
build-modules:
$(MAKE) -C ocfs2 stamp-md5
+ $(MAKE) -C ocfs2/cluster stamp-md5
+ $(MAKE) -C ocfs2/dlm stamp-md5
$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules
install-modules:
Modified: trunk/fs/configfs/Makefile
===================================================================
--- trunk/fs/configfs/Makefile 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/configfs/Makefile 2005-04-04 07:43:45 UTC (rev 2107)
@@ -44,6 +44,7 @@
symlink.c \
compat_kref.c \
compat_libfs.c
+
CONFIGFS_OBJECTS = $(subst .c,.o,$(CONFIGFS_SOURCES))
BOBTEST_SOURCES = bobtest.c
Modified: trunk/fs/configfs/mount.c
===================================================================
--- trunk/fs/configfs/mount.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/configfs/mount.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -153,9 +153,10 @@
unregister_filesystem(&configfs_fs_type);
}
-module_init(configfs_init);
-module_exit(configfs_exit);
+MODULE_AUTHOR("Oracle");
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Oracle");
MODULE_VERSION("0.0.1");
MODULE_DESCRIPTION("Simple RAM filesystem for user driven kernel subsystem configuration.");
+
+module_init(configfs_init);
+module_exit(configfs_exit);
Modified: trunk/fs/ocfs2/Makefile
===================================================================
--- trunk/fs/ocfs2/Makefile 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/Makefile 2005-04-04 07:43:45 UTC (rev 2107)
@@ -44,16 +44,16 @@
#
-# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
-# are needed for VERSION_FILES
-#
-
-#
# Since SUBDIRS means something to kbuild, define them safely. Do not
# include trailing slashes.
#
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 \
@@ -114,7 +114,7 @@
OBJECTS = $(subst .c,.o,$(SOURCES))
VERSION_FILES = $(SOURCES) $(HEADERS)
VERSION_SRC = ver.c
-VERSION_PREFIX = OCFS
+VERSION_PREFIX = OCFS2
INSTALL_MOD_DIR := fs/ocfs2
Modified: trunk/fs/ocfs2/cluster/Makefile
===================================================================
--- trunk/fs/ocfs2/cluster/Makefile 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/cluster/Makefile 2005-04-04 07:43:45 UTC (rev 2107)
@@ -18,29 +18,26 @@
# 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
+
ifneq ($(QUIET),1)
EXTRA_CFLAGS += -DENABLE_HBPRINTK
EXTRA_CFLAGS += -DENABLE_NMPRINTK
EXTRA_CFLAGS += -DENABLE_NETPRINTK
endif
-INSTALL_MOD_DIR := fs/ocfs2
-
-obj-m := ocfs2_nodemanager.o
-
-ocfs2_nodemanager-objs := nodemanager.o heartbeat.o tcp.o
-
-ifeq ($(KERNELRELEASE),)
#
-# Called from a regular "make".
+# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
+# are needed for VERSION_FILES
#
SOURCES = \
heartbeat.c \
nodemanager.c \
- tcp.c
+ tcp.c \
+ ver.c
HEADERS = \
cl_compat.h \
@@ -48,17 +45,43 @@
nodemanager.h \
ocfs2_heartbeat.h \
ocfs2_nodemanager.h \
- tcp.h
+ tcp.h \
+ ver.h
+OBJECTS = $(subst .c,.o,$(SOURCES))
+VERSION_FILES = $(SOURCES) $(HEADERS)
+VERSION_SRC = ver.c
+VERSION_PREFIX = CLUSTER
+
+INSTALL_MOD_DIR := fs/ocfs2
+
+obj-m := ocfs2_nodemanager.o
+
+ocfs2_nodemanager-objs := $(OBJECTS)
+
+ifneq ($(KERNELRELEASE),)
+#
+# Argh, Versioning.make has ordering requirements, so we put this here
+#
+STAMP_DIR := $(OUR_TOPDIR)/fs/ocfs2/cluster
+include $(OUR_TOPDIR)/Versioning.make
+CFLAGS_$(VERSION_OBJ) += -D$(VERSION_NUM)=\""$(MAKEBO_VERSION)"\" \
+ -D$(VERSION_DATE)=\"x\" -D$(VERSION_MD5)=\""$(shell cat $(STAMP_MD5))"\"
+endif
+
+ifeq ($(KERNELRELEASE),)
+#
+# Called from a regular "make".
+#
+
DIST_FILES = $(SOURCES) $(HEADERS)
-ALL_RULES = build-modules
+ALL_RULES = stamp-md5 build-modules
CLEAN_RULES = clean-modules
INSTALL_RULES = install-modules
-
ifneq ($(KERNEL_26),)
#
# This is a 2.6 kernel. Just forward to kbuild.
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -62,6 +62,7 @@
#include "tcp.h"
#include "nodemanager.h"
#include "heartbeat.h"
+#include "ver.h"
#include "configfs.h"
@@ -719,6 +720,8 @@
{
int ret;
+ cluster_print_version();
+
hb_init();
ret = net_register_hb_callbacks();
if (!ret) {
@@ -734,6 +737,8 @@
return ret;
}
+MODULE_AUTHOR("Oracle");
MODULE_LICENSE("GPL");
+
module_init(init_nm)
module_exit(exit_nm)
Added: trunk/fs/ocfs2/cluster/ver.c
===================================================================
--- trunk/fs/ocfs2/cluster/ver.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/cluster/ver.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -0,0 +1,45 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * ver.c
+ *
+ * version string
+ *
+ * Copyright (C) 2002, 2005 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/kernel.h>
+
+#include "ver.h"
+
+#define VERSION_FORMAT "%s %s (build %s)"
+
+void cluster_print_version(void)
+{
+ printk(KERN_INFO "OCFS2 Node Manager " VERSION_FORMAT "\n",
+ CLUSTER_BUILD_VERSION, CLUSTER_BUILD_DATE, CLUSTER_BUILD_MD5);
+}
+
+MODULE_DESCRIPTION("OCFS2 Node Manager "
+ CLUSTER_BUILD_VERSION " " CLUSTER_BUILD_DATE " "
+ "(build " CLUSTER_BUILD_MD5 ")");
+
+#ifdef MODULE_VERSION
+MODULE_VERSION(CLUSTER_BUILD_VERSION);
+#endif
Added: trunk/fs/ocfs2/cluster/ver.h
===================================================================
--- trunk/fs/ocfs2/cluster/ver.h 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/cluster/ver.h 2005-04-04 07:43:45 UTC (rev 2107)
@@ -0,0 +1,31 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * ver.h
+ *
+ * Function prototypes
+ *
+ * Copyright (C) 2005 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 CLUSTER_VER_H
+#define CLUSTER_VER_H
+
+void cluster_print_version(void);
+
+#endif /* CLUSTER_VER_H */
Modified: trunk/fs/ocfs2/dlm/Makefile
===================================================================
--- trunk/fs/ocfs2/dlm/Makefile 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/Makefile 2005-04-04 07:43:45 UTC (rev 2107)
@@ -26,28 +26,12 @@
EXTRA_CFLAGS += -DENABLE_DLMPRINTK
endif
-ifeq ($(KERNELRELEASE),)
-ifeq ($(KERNEL_26),)
-DLMFS_COMPAT := dlmfs_compat.o
-endif
-endif
-
-INSTALL_MOD_DIR := fs/ocfs2
-
-obj-m := ocfs2_dlm.o ocfs2_dlmfs.o
-
-ocfs2_dlm-objs := dlmdomain.o dlmdebug.o dlmthread.o dlmrecovery.o \
- dlmmaster.o dlmast.o dlmconvert.o dlmlock.o dlmunlock.o
-
-ocfs2_dlmfs-objs := userdlm.o dlmfs.o $(DLMFS_COMPAT)
-
-
-ifeq ($(KERNELRELEASE),)
#
-# Called from a regular "make".
+# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
+# are needed for VERSION_FILES
#
-SOURCES = \
+DLM_SOURCES = \
dlmdebug.c \
dlmdomain.c \
dlmmaster.c \
@@ -57,8 +41,14 @@
dlmunlock.c \
dlmrecovery.c \
dlmthread.c \
+ dlmver.c
+
+DLMFS_SOURCES = \
userdlm.c \
dlmfs.c \
+ dlmfsver.c
+
+DLMFS_COMPAT_SOURCES = \
dlmfs_compat.c
HEADERS = \
@@ -68,12 +58,52 @@
dlmcommon.h \
dlmapi.h \
userdlm.h \
- dlmfs_compat.h
+ dlmfs_compat.h \
+ dlmver.h \
+ dlmfsver.h
-DIST_FILES = $(SOURCES) $(HEADERS)
+DLM_OBJECTS = $(subst .c,.o,$(DLM_SOURCES))
+DLMFS_OBJECTS = $(subst .c,.o,$(DLMFS_SOURCES))
-ALL_RULES = build-modules
+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_SRC = dlmver.c dlmfsver.c
+VERSION_PREFIX = DLM
+
+INSTALL_MOD_DIR := fs/ocfs2
+
+obj-m := ocfs2_dlm.o ocfs2_dlmfs.o
+
+ocfs2_dlm-objs := $(DLM_OBJECTS)
+
+ocfs2_dlmfs-objs := $(DLMFS_OBJECTS)
+
+ifneq ($(KERNELRELEASE),)
+#
+# Argh, Versioning.make has ordering requirements, so we put this here
+#
+STAMP_DIR := $(OUR_TOPDIR)/fs/ocfs2/dlm
+include $(OUR_TOPDIR)/Versioning.make
+endif
+
+# This has to be outside a conditional, because of a bug in make
+# It's harmless in the regular make case, as VERSION_OBJ will be empty
+$(foreach objfile,$(VERSION_OBJ),$(eval CFLAGS_$(objfile) += $(VERDEFS)))
+
+ifeq ($(KERNELRELEASE),)
+#
+# Called from a regular "make".
+#
+
+DIST_FILES = $(DLM_SOURCES) $(DLMFS_SOURCES) $(DLMFS_COMPAT_SOURCES) $(HEADERS)
+
+ALL_RULES = stamp-md5 build-modules
+
CLEAN_RULES = clean-modules
INSTALL_RULES = install-modules
Modified: trunk/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdomain.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/dlmdomain.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -42,6 +42,8 @@
#include "dlmdebug.h"
+#include "dlmver.h"
+
/*
*
* spinlock lock ordering: if multiple locks are needed, obey this ordering:
@@ -1324,6 +1326,8 @@
{
int status;
+ dlm_print_version();
+
dlmprintk0("Loaded dlm module\n");
status = dlm_register_net_handlers();
@@ -1341,8 +1345,8 @@
dlmprintk0("Unloaded dlm module\n");
} /* dlm_driver_exit */
-MODULE_LICENSE ("GPL");
MODULE_AUTHOR("Oracle");
+MODULE_LICENSE("GPL");
-module_init (dlm_init);
-module_exit (dlm_exit);
+module_init(dlm_init);
+module_exit(dlm_exit);
Modified: trunk/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/dlmfs.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -1,7 +1,7 @@
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
- * userdlmfs.c
+ * dlmfs.c
*
* Code which implements the kernel side of a minimal userspace
* interface to our DLM. This file handles the virtual file system
@@ -48,6 +48,8 @@
#include "dlmfs_compat.h"
#include "userdlm.h"
+#include "dlmfsver.h"
+
static struct super_operations dlmfs_ops;
static struct file_operations dlmfs_file_operations;
static struct inode_operations dlmfs_dir_inode_operations;
@@ -620,6 +622,8 @@
int status;
int cleanup_inode = 0, cleanup_worker = 0;
+ dlmfs_print_version();
+
dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache",
sizeof(struct dlmfs_inode_private),
0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
@@ -660,7 +664,8 @@
"were freed\n");
}
+MODULE_AUTHOR("Oracle");
+MODULE_LICENSE("GPL");
+
module_init(init_dlmfs_fs)
module_exit(exit_dlmfs_fs)
-
-MODULE_LICENSE("GPL");
Added: trunk/fs/ocfs2/dlm/dlmfsver.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfsver.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/dlmfsver.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -0,0 +1,45 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmfsver.c
+ *
+ * version string
+ *
+ * Copyright (C) 2002, 2005 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/kernel.h>
+
+#include "dlmfsver.h"
+
+#define VERSION_FORMAT "%s %s (build %s)"
+
+void dlmfs_print_version(void)
+{
+ printk(KERN_INFO "OCFS2 DLMFS " VERSION_FORMAT "\n",
+ DLM_BUILD_VERSION, DLM_BUILD_DATE, DLM_BUILD_MD5);
+}
+
+MODULE_DESCRIPTION("OCFS2 DLM filesystem interface "
+ DLM_BUILD_VERSION " " DLM_BUILD_DATE " "
+ "(build " DLM_BUILD_MD5 ")");
+
+#ifdef MODULE_VERSION
+MODULE_VERSION(DLM_BUILD_VERSION);
+#endif
Added: trunk/fs/ocfs2/dlm/dlmfsver.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfsver.h 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/dlmfsver.h 2005-04-04 07:43:45 UTC (rev 2107)
@@ -0,0 +1,31 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmver.h
+ *
+ * Function prototypes
+ *
+ * Copyright (C) 2005 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_VER_H
+#define DLMFS_VER_H
+
+void dlmfs_print_version(void);
+
+#endif /* DLMFS_VER_H */
Added: trunk/fs/ocfs2/dlm/dlmver.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmver.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/dlmver.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -0,0 +1,45 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmver.c
+ *
+ * version string
+ *
+ * Copyright (C) 2002, 2005 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/kernel.h>
+
+#include "dlmver.h"
+
+#define VERSION_FORMAT "%s %s (build %s)"
+
+void dlm_print_version(void)
+{
+ printk(KERN_INFO "OCFS2 DLM " VERSION_FORMAT "\n",
+ DLM_BUILD_VERSION, DLM_BUILD_DATE, DLM_BUILD_MD5);
+}
+
+MODULE_DESCRIPTION("OCFS2 DLM "
+ DLM_BUILD_VERSION " " DLM_BUILD_DATE " "
+ "(build " DLM_BUILD_MD5 ")");
+
+#ifdef MODULE_VERSION
+MODULE_VERSION(DLM_BUILD_VERSION);
+#endif
Added: trunk/fs/ocfs2/dlm/dlmver.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmver.h 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/dlm/dlmver.h 2005-04-04 07:43:45 UTC (rev 2107)
@@ -0,0 +1,31 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmfsver.h
+ *
+ * Function prototypes
+ *
+ * Copyright (C) 2005 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 DLM_VER_H
+#define DLM_VER_H
+
+void dlm_print_version(void);
+
+#endif /* DLM_VER_H */
Modified: trunk/fs/ocfs2/proc.c
===================================================================
--- trunk/fs/ocfs2/proc.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/proc.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define OCFSPROC_PRIVATE_DECLS
-
#include "ocfs_compat.h"
#include <linux/fs.h>
@@ -41,6 +39,7 @@
#include "alloc.h"
#include "heartbeat.h"
#include "journal.h"
+#include "ver.h"
/* Tracing */
@@ -69,7 +68,8 @@
ocfs_proc_list top_dir[] = {
{ "version", NULL, ocfs_proc_version },
{ "nodename", NULL, ocfs_proc_nodename },
- { NULL } };
+ { NULL }
+};
ocfs_proc_list sub_dir[] = {
{ "nodenum", NULL, ocfs_proc_nodenum },
@@ -80,7 +80,8 @@
{ "nodes", NULL, ocfs_proc_nodes },
{ "allocstat", NULL, ocfs_proc_alloc_stat },
{ "label", NULL, ocfs_proc_label },
- { NULL } };
+ { NULL }
+};
/*
* ocfs_proc_init()
@@ -160,12 +161,10 @@
{
int len;
int ret;
- ocfs_super *osb;
+ ocfs_super *osb = data;
LOG_ENTRY ();
- osb = data;
-
#define ALLOC_STATS_HDR "%-25s %10u\n"
len = sprintf (page, "%s\n", "*** Disk Allocation Stats ***");
@@ -208,15 +207,10 @@
{
int len;
int ret;
- extern char *ocfs_version;
- extern char *ocfs_date;
- extern char *ocfs_md5;
LOG_ENTRY ();
-
- len = sprintf (page, "%s %s (build %s)\n", ocfs_version, ocfs_date,
- ocfs_md5);
+ len = ocfs2_str_version(page);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
@@ -232,14 +226,11 @@
{
int len;
int ret;
- ocfs_super *osb;
+ ocfs_super *osb = data;
LOG_ENTRY ();
- osb = data;
- sprintf (page, "%d\n", osb->node_num);
- len = strlen (page);
-
+ len = sprintf (page, "%d\n", osb->node_num);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
@@ -255,14 +246,11 @@
{
int len;
int ret;
- ocfs_super *osb;
+ ocfs_super *osb = data;
LOG_ENTRY ();
- osb = data;
- sprintf (page, "%d\n", osb->slot_num);
- len = strlen (page);
-
+ len = sprintf (page, "%d\n", osb->slot_num);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
@@ -276,20 +264,21 @@
static int ocfs_proc_nodename (char *page, char **start, off_t off,
int count, int *eof, void *data)
{
+ int len;
int ret;
struct nm_node *node;
LOG_ENTRY ();
node = nm_get_node_by_num(nm_this_node());
+
if (node) {
- sprintf(page, "%s\n", node->nd_name);
+ len = sprintf(page, "%s\n", node->nd_name);
nm_node_put(node);
- } else
- strcat (page, "(unknown)\n");
+ } else
+ len = sprintf(page, "(unknown)\n");
- ret = ocfs_proc_calc_metrics (page, start, off, count, eof,
- strlen(page));
+ ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
return ret;
@@ -357,8 +346,7 @@
LOG_ENTRY ();
- len = sprintf (page, "%s\n", "unknown");
-
+ len = sprintf(page, "unknown\n");
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
@@ -373,13 +361,11 @@
int count, int *eof, void *data)
{
int len;
- ocfs_super *osb;
int ret = 0;
+ ocfs_super *osb = data;
LOG_ENTRY ();
- osb = data;
-
#define PROC_STATS \
"Number of nodes : %u\n" \
"Cluster size : %d\n" \
@@ -405,13 +391,11 @@
{
int len;
int ret;
- ocfs_super *osb;
+ ocfs_super *osb = data;
LOG_ENTRY ();
- osb = data;
len = snprintf (page, sizeof(osb->dev_str), "%s\n", osb->dev_str);
-
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
@@ -428,13 +412,11 @@
int len = 0;
int i;
int ret;
- ocfs_super *osb;
+ ocfs_super *osb = data;
char mount;
LOG_ENTRY ();
- osb = data;
-
if (osb) {
for (i = 0; i < OCFS_NODE_MAP_MAX_NODES; i++) {
mount = ocfs_node_map_test_bit(osb, &osb->mounted_map, i) ? 'M' : ' ';
@@ -457,17 +439,13 @@
{
int len;
int ret;
- ocfs_super *osb;
+ ocfs_super *osb = data;
LOG_ENTRY ();
- osb = (ocfs_super *) data;
-
len = sprintf (page, "%s\n", osb->vol_label);
-
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
LOG_EXIT_INT (ret);
return ret;
} /* ocfs_proc_label */
-
Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/super.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -108,21 +108,22 @@
// -disabled for ocfs_show_trace- EXPORT_NO_SYMBOLS;
-MODULE_LICENSE ("GPL");
MODULE_AUTHOR("Oracle");
+MODULE_LICENSE("GPL");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-module_param (debug_context, uint, 0);
-module_param (debug_level, uint, 0);
-module_param (debug_exclude, uint, 0);
+module_param(debug_context, uint, 0);
+module_param(debug_level, uint, 0);
+module_param(debug_exclude, uint, 0);
#else /* 2.6.x kernel */
-MODULE_PARM (debug_context, "i");
+MODULE_PARM(debug_context, "i");
+MODULE_PARM(debug_level, "i");
+MODULE_PARM(debug_exclude, "i");
+#endif /* Linux 2.4 stuff */
+
MODULE_PARM_DESC(debug_context, "Debug context");
-MODULE_PARM (debug_level, "i");
MODULE_PARM_DESC(debug_level, "Debug level");
-MODULE_PARM (debug_exclude, "i");
MODULE_PARM_DESC(debug_exclude, "Process ID to exclude from tracing");
-#endif /* Linux 2.4 stuff */
static int ocfs_parse_options (char *options, u32 * uid, u32 * gid, int * reclaim_id);
@@ -530,7 +531,7 @@
LOG_ENTRY ();
- ocfs_version_print();
+ ocfs2_print_version();
if (init_ocfs2_extent_maps())
return -ENOMEM;
@@ -1537,6 +1538,5 @@
} /* ocfs_delete_osb */
-MODULE_LICENSE("GPL");
module_init(ocfs2_init);
module_exit(ocfs2_exit);
Modified: trunk/fs/ocfs2/ver.c
===================================================================
--- trunk/fs/ocfs2/ver.c 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/ver.c 2005-04-04 07:43:45 UTC (rev 2107)
@@ -5,7 +5,7 @@
*
* version string
*
- * Copyright (C) 2002, 2004 Oracle. All rights reserved.
+ * Copyright (C) 2002, 2005 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
@@ -23,32 +23,30 @@
* Boston, MA 021110-1307, USA.
*/
-#include "ocfs_compat.h"
-
#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/types.h>
-#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/kernel.h>
-#include "ocfs_log.h"
-#include "ocfs.h"
-
#include "ver.h"
+#define VERSION_FORMAT "%s %s (build %s)"
-MODULE_DESCRIPTION("The Oracle Cluster Filesystem (version "
- OCFS_BUILD_VERSION
- ")");
-
-char *ocfs_version = OCFS_BUILD_VERSION;
-char *ocfs_date = OCFS_BUILD_DATE;
-char *ocfs_md5 = OCFS_BUILD_MD5;
-
-void ocfs_version_print (void)
+void ocfs2_print_version(void)
{
- printk(KERN_INFO "Oracle Cluster FileSystem "
- OCFS_BUILD_VERSION " "
- OCFS_BUILD_DATE " "
- "(build " OCFS_BUILD_MD5 ")\n");
+ printk(KERN_INFO "OCFS2 " VERSION_FORMAT "\n",
+ OCFS2_BUILD_VERSION, OCFS2_BUILD_DATE, OCFS2_BUILD_MD5);
}
+
+int ocfs2_str_version(char *buf)
+{
+ return sprintf(buf, VERSION_FORMAT "\n",
+ OCFS2_BUILD_VERSION, OCFS2_BUILD_DATE, OCFS2_BUILD_MD5);
+}
+
+MODULE_DESCRIPTION("OCFS2 "
+ OCFS2_BUILD_VERSION " " OCFS2_BUILD_DATE " "
+ "(build " OCFS2_BUILD_MD5 ")");
+
+#ifdef MODULE_VERSION
+MODULE_VERSION(OCFS2_BUILD_VERSION);
+#endif
Modified: trunk/fs/ocfs2/ver.h
===================================================================
--- trunk/fs/ocfs2/ver.h 2005-04-04 07:41:40 UTC (rev 2106)
+++ trunk/fs/ocfs2/ver.h 2005-04-04 07:43:45 UTC (rev 2107)
@@ -26,6 +26,7 @@
#ifndef OCFS2_VER_H
#define OCFS2_VER_H
-void ocfs_version_print(void);
+void ocfs2_print_version(void);
+int ocfs2_str_version(char *buf);
#endif /* OCFS2_VER_H */
More information about the Ocfs2-commits
mailing list