[Ocfs2-commits] zab commits r2015 - in trunk/fs/ocfs2: . cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Mar 18 19:54:12 CST 2005


Author: zab
Signed-off-by: mfasheh
Date: 2005-03-18 19:54:11 -0600 (Fri, 18 Mar 2005)
New Revision: 2015

Removed:
   trunk/fs/ocfs2/cluster/util.c
   trunk/fs/ocfs2/cluster/util.h
   trunk/fs/ocfs2/dlm/util.c
   trunk/fs/ocfs2/dlm/util.h
   trunk/fs/ocfs2/util.c
   trunk/fs/ocfs2/util.h
Modified:
   trunk/fs/ocfs2/Makefile
   trunk/fs/ocfs2/aio.c
   trunk/fs/ocfs2/alloc.c
   trunk/fs/ocfs2/buffer_head_io.c
   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/dir.c
   trunk/fs/ocfs2/dlm/Makefile
   trunk/fs/ocfs2/dlm/dlmast.c
   trunk/fs/ocfs2/dlm/dlmconvert.c
   trunk/fs/ocfs2/dlm/dlmfs.c
   trunk/fs/ocfs2/dlm/dlmfs_compat.c
   trunk/fs/ocfs2/dlm/dlmlock.c
   trunk/fs/ocfs2/dlm/dlmmaster.c
   trunk/fs/ocfs2/dlm/dlmmod.c
   trunk/fs/ocfs2/dlm/dlmrecovery.c
   trunk/fs/ocfs2/dlm/dlmthread.c
   trunk/fs/ocfs2/dlm/dlmunlock.c
   trunk/fs/ocfs2/dlm/userdlm.c
   trunk/fs/ocfs2/dlmglue.c
   trunk/fs/ocfs2/file.c
   trunk/fs/ocfs2/heartbeat.c
   trunk/fs/ocfs2/inode.c
   trunk/fs/ocfs2/journal.c
   trunk/fs/ocfs2/mmap.c
   trunk/fs/ocfs2/namei.c
   trunk/fs/ocfs2/ocfs.h
   trunk/fs/ocfs2/ocfs_log.h
   trunk/fs/ocfs2/suballoc.c
   trunk/fs/ocfs2/super.c
   trunk/fs/ocfs2/sysfile.c
   trunk/fs/ocfs2/vote.c
Log:
o get rid of all the copies of our unused util wrappers

Signed-off-by: mfasheh


Modified: trunk/fs/ocfs2/Makefile
===================================================================
--- trunk/fs/ocfs2/Makefile	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/Makefile	2005-03-19 01:54:11 UTC (rev 2015)
@@ -81,7 +81,6 @@
 	super.c 		\
 	symlink.c 		\
 	sysfile.c 		\
-	util.c 			\
 	ver.c 			\
 	vote.c
 
@@ -113,7 +112,6 @@
 	super.h			\
 	symlink.h		\
 	sysfile.h		\
-	util.h			\
 	ver.h			\
 	vote.h
 

Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/aio.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -47,7 +47,6 @@
 #include "inode.h"
 #include "mmap.h"
 #include "suballoc.h"
-#include "util.h"
 
 struct ocfs2_kiocb_private {
 	struct list_head	kp_teardown_item;

Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/alloc.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -39,7 +39,6 @@
 #include "extent_map.h"
 #include "inode.h"
 #include "localalloc.h"
-#include "util.h"
 #include "suballoc.h"
 #include "sysfile.h"
 #include "file.h"

Modified: trunk/fs/ocfs2/buffer_head_io.c
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/buffer_head_io.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -35,7 +35,6 @@
 #include "ocfs2.h"
 
 #include "alloc.h"
-#include "util.h"
 
 #include "ocfs_journal.h"
 #include "buffer_head_io.h"

Modified: trunk/fs/ocfs2/cluster/Makefile
===================================================================
--- trunk/fs/ocfs2/cluster/Makefile	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/cluster/Makefile	2005-03-19 01:54:11 UTC (rev 2015)
@@ -35,8 +35,7 @@
 SOURCES =			\
 	heartbeat.c		\
 	nodemanager.c		\
-	tcp.c			\
-	util.c
+	tcp.c
 
 HEADERS = 			\
 	cl_compat.h		\
@@ -44,8 +43,7 @@
 	nodemanager.h		\
 	ocfs2_heartbeat.h	\
 	ocfs2_nodemanager.h	\
-	tcp.h			\
-	util.h
+	tcp.h
 
 DIST_FILES = $(SOURCES) $(HEADERS)
 

Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/cluster/heartbeat.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -62,7 +62,6 @@
 #include <asm/bitops.h>
 
 #include "cl_compat.h"
-#include "util.h"
 
 #include "heartbeat.h"
 #include "tcp.h"

Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/cluster/nodemanager.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -20,7 +20,6 @@
  */
 
 #include "cl_compat.h"
-#include "util.h"
 
 #include <linux/module.h>
 #include <linux/kernel.h>

Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -103,7 +103,6 @@
 #include <asm/uaccess.h>
 
 #include "cl_compat.h"
-#include "util.h"
 
 
 #include "heartbeat.h"

Deleted: trunk/fs/ocfs2/cluster/util.c
===================================================================
--- trunk/fs/ocfs2/cluster/util.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/cluster/util.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -1,185 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * util.c
- *
- * General purpose code
- *
- * 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.
- *
- * Authors: Kurt Hackel
- */
-
-
-#include "cl_compat.h"
-
-#include <linux/version.h>
-#include <linux/fs.h>
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-
-#include "util.h"
-
-/* block all but 'mask' sigs, optionally saving off our previous
- * signal state. */
-void util_block_sigs(sigset_t *oldsigs, unsigned long mask)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	sigset_t tmpsig;
-
-	siginitsetinv(&tmpsig, mask);
-	sigprocmask(SIG_BLOCK, &tmpsig, oldsigs);
-#else
-	spin_lock_irq (&current->sighand->siglock);
-	if (oldsigs)
-		*oldsigs = current->blocked;
-	siginitsetinv (&current->blocked, mask);
-	recalc_sigpending ();
-	spin_unlock_irq (&current->sighand->siglock);
-#endif
-}
-
-void util_unblock_sigs(sigset_t newsig)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	sigprocmask(SIG_SETMASK, &newsig, NULL);
-#else
-       	spin_lock_irq (&current->sighand->siglock);
-	current->blocked = newsig;
-	recalc_sigpending ();
-	spin_unlock_irq (&current->sighand->siglock);
-#endif
-}
-
-/* prefetch has been declared to allow to build in debug mode */
-#ifdef DEBUG
-#ifndef ARCH_HAS_PREFETCH
-inline void prefetch (const void *x)
-{;
-}
-#endif
-#endif
-
-/* resizable (using chained pages) array stuff */
-void util_init_rarray(util_rarray *arr, u16 elem_size)
-{
-	arr->elements = 0;
-	arr->max_elem = 0;
-	arr->elem_size = elem_size;
-	arr->page = NULL;
-}	
-
-
-void * util_rarray_idx_to_slot(util_rarray *arr, int idx)
-{
-	int pgnum, pgoff;
-	util_rarray_page *pg;
-	
-	if (idx >= arr->max_elem) {
-		printk("eek! asked for %d, but only %d elements\n", 
-		       idx, arr->max_elem);
-		return NULL;
-	}
-	
-	pgnum = idx / UTIL_RARRAY_ELEM_PER_BUF(arr);
-	pgoff = idx % UTIL_RARRAY_ELEM_PER_BUF(arr);
-	pg = (util_rarray_page *)arr->page;
-	while (pgnum--) {
-		if (!pg->next) {
-			printk("eeek! no next page!\n");
-			return NULL;
-		}
-		pg = pg->next;
-	}
-	return (((char *)pg->buf) + (pgoff * arr->elem_size));
-}
-
-
-void * util_get_new_rarray_slot(util_rarray *arr, int *index)
-{
-	char *tmp;
-	util_rarray_page *newpg, *pg;
-	
-	if (arr->max_elem == arr->elements) {
-		newpg = (util_rarray_page *) __get_free_page(GFP_KERNEL);
-		if (!newpg) {
-			printk("could not grow array!!!\n");
-			return NULL;
-		}
-		memset(newpg, 0, PAGE_SIZE);
-		if (arr->page) {
-			pg = (util_rarray_page *)arr->page;
-			while (pg->next)
-				pg = pg->next;
-			pg->next = newpg;
-		} else
-			arr->page = newpg;
-		arr->max_elem += UTIL_RARRAY_ELEM_PER_BUF(arr);
-	}
-
-	tmp = util_rarray_idx_to_slot(arr, arr->elements);
-	if (tmp) {
-		if (index)
-			*index = arr->elements;
-		arr->elements++;
-	}
-	return tmp;
-}
-
-
-int util_add_to_rarray(util_rarray *arr, void *new)
-{
-	void *slot;
-	int idx;
-
-	slot = util_get_new_rarray_slot(arr, &idx);
-	if (slot == NULL) 
-		return -EINVAL;
-	memcpy(slot, new, arr->elem_size);
-	return idx;
-}
-
-/* resizes rarray to at least newelem elements */
-int util_resize_rarray(util_rarray *arr, int newelem)
-{
-	util_rarray_page *newpg, *pg;
-
-	printk("util_resize_rarray: newsize=%d, maxelem=%d\n", newelem, arr->max_elem);
-	while (arr->max_elem < newelem) {
-		newpg = (util_rarray_page *) __get_free_page(GFP_KERNEL);
-		if (!newpg) {
-			printk("could not grow array!!!\n");
-			return -ENOMEM;
-		}
-		memset(newpg, 0, PAGE_SIZE);
-		if (arr->page) {
-			pg = (util_rarray_page *)arr->page;
-			while (pg->next)
-				pg = pg->next;
-			pg->next = newpg;
-		} else
-			arr->page = newpg;
-		arr->max_elem += UTIL_RARRAY_ELEM_PER_BUF(arr);
-	}
-	printk("leaving util_resize_rarray: newsize=%d, maxelem=%d\n", newelem, arr->max_elem);
-
-	return 0;
-}
-
-

Deleted: trunk/fs/ocfs2/cluster/util.h
===================================================================
--- trunk/fs/ocfs2/cluster/util.h	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/cluster/util.h	2005-03-19 01:54:11 UTC (rev 2015)
@@ -1,77 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * util.h
- *
- * Function prototypes
- *
- * 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.
- *
- * Authors: Kurt Hackel
- */
-
-#ifndef CLUSTER_UTIL_H
-#define CLUSTER_UTIL_H
-
-#ifdef __KERNEL__
-#define SHUTDOWN_SIGS   (sigmask(SIGKILL) | sigmask(SIGHUP) | \
-			 sigmask(SIGINT) | sigmask(SIGQUIT))
-
-/* timeout structure taken from Ben's aio.c */
-typedef struct _util_timeout {
-	struct timer_list	timer;
-	int			timed_out;
-	wait_queue_head_t	wait;
-} util_timeout;
-
-void util_clear_timeout(util_timeout *to);
-void util_init_timeout(util_timeout *to);
-void util_set_timeout(util_timeout *to, __u32 timeout);
-void util_show_stack(unsigned long *esp);
-void util_show_trace(unsigned long *stack);
-int util_sleep(__u32 ms);
-void util_block_sigs(sigset_t *oldsigs, unsigned long mask);
-void util_unblock_sigs(sigset_t newsig);
-
-#endif  /* __KERNEL__ */
-
-/* resizable array */
-typedef struct _util_rarray
-{
-	void *page;
-	u16 elements;
-	u16 max_elem;
-	u16 elem_size;
-	u16 reserved1;
-} util_rarray;
-
-#define UTIL_RARRAY_PAGE_BUF_SIZE    (PAGE_SIZE - offsetof(util_rarray_page, buf))
-#define UTIL_RARRAY_ELEM_PER_BUF(r)  ((UTIL_RARRAY_PAGE_BUF_SIZE) / (r)->elem_size)
-typedef struct _util_rarray_page
-{
-	void *next;
-	char buf[0];
-} util_rarray_page;
-
-void util_init_rarray(util_rarray *arr, u16 elem_size);
-void * util_get_new_rarray_slot(util_rarray *arr, int *index);
-int util_add_to_rarray(util_rarray *arr, void *new);
-void * util_rarray_idx_to_slot(util_rarray *arr, int idx);
-int util_resize_rarray(util_rarray *arr, int newelem);
-
-#endif /* CLUSTER_UTIL_H */

Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dir.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -56,7 +56,6 @@
 #include "ocfs_journal.h"
 #include "namei.h"
 #include "suballoc.h"
-#include "util.h"
 
 #include "buffer_head_io.h"
 

Modified: trunk/fs/ocfs2/dlm/Makefile
===================================================================
--- trunk/fs/ocfs2/dlm/Makefile	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/Makefile	2005-03-19 01:54:11 UTC (rev 2015)
@@ -27,7 +27,7 @@
 
 obj-m := ocfs2_dlm.o ocfs2_dlmfs.o
 
-ocfs2_dlm-objs := dlmmod.o dlmthread.o dlmrecovery.o util.o \
+ocfs2_dlm-objs := dlmmod.o dlmthread.o dlmrecovery.o \
 	dlmmaster.o dlmast.o dlmconvert.o dlmlock.o dlmunlock.o
 
 ocfs2_dlmfs-objs := userdlm.o dlmfs.o $(DLMFS_COMPAT)
@@ -49,15 +49,13 @@
 	dlmthread.c		\
 	userdlm.c		\
 	dlmfs.c			\
-	dlmfs_compat.c		\
-	util.c
+	dlmfs_compat.c
 
 HEADERS = 			\
 	dlmcommon.h		\
 	dlmmod.h		\
 	userdlm.h		\
-	dlmfs_compat.h		\
-	util.h
+	dlmfs_compat.h
 
 DIST_FILES = $(SOURCES) $(HEADERS)
 

Modified: trunk/fs/ocfs2/dlm/dlmast.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmast.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmast.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -40,7 +40,6 @@
 #include <linux/inet.h>
 #include <linux/spinlock.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/dlmconvert.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmconvert.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmconvert.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -40,7 +40,6 @@
 #include <linux/inet.h>
 #include <linux/spinlock.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmfs.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -38,7 +38,6 @@
 
 #include <asm/uaccess.h>
 
-#include "util.h"
 
 #include "cluster/nodemanager.h"
 #include "cluster/heartbeat.h"

Modified: trunk/fs/ocfs2/dlm/dlmfs_compat.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs_compat.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmfs_compat.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -3,7 +3,6 @@
 #include <linux/mount.h>
 #include <linux/fs.h>
 
-#include "util.h"
 
 #include "cluster/nodemanager.h"
 #include "cluster/tcp.h"

Modified: trunk/fs/ocfs2/dlm/dlmlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmlock.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmlock.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -40,7 +40,6 @@
 #include <linux/inet.h>
 #include <linux/spinlock.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmaster.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmmaster.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -40,7 +40,6 @@
 #include <linux/inet.h>
 #include <linux/spinlock.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmmod.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -41,7 +41,6 @@
 #include <linux/spinlock.h>
 #include <linux/proc_fs.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmrecovery.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmrecovery.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -39,7 +39,6 @@
 #include <linux/socket.h>
 #include <linux/inet.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmthread.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmthread.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -41,7 +41,6 @@
 #include <linux/timer.h>
 #include <linux/kthread.h>
 
-#include "util.h"
 
 #include "cluster/cl_compat.h"
 #include "cluster/heartbeat.h"

Modified: trunk/fs/ocfs2/dlm/dlmunlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmunlock.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/dlmunlock.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -40,7 +40,6 @@
 #include <linux/inet.h>
 #include <linux/spinlock.h>
 
-#include "util.h"
 
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"

Modified: trunk/fs/ocfs2/dlm/userdlm.c
===================================================================
--- trunk/fs/ocfs2/dlm/userdlm.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/userdlm.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -35,7 +35,6 @@
 #include <linux/version.h>
 #include <linux/crc32.h>
 
-#include "util.h"
 
 #include "cluster/nodemanager.h"
 #include "cluster/heartbeat.h"

Deleted: trunk/fs/ocfs2/dlm/util.c
===================================================================
--- trunk/fs/ocfs2/dlm/util.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/util.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -1,183 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * util.c
- *
- * General purpose code
- *
- * 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.
- *
- * Authors: Kurt Hackel
- */
-
-
-#include <linux/version.h>
-#include <linux/fs.h>
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-
-#include "util.h"
-
-/* block all but 'mask' sigs, optionally saving off our previous
- * signal state. */
-void util_block_sigs(sigset_t *oldsigs, unsigned long mask)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	sigset_t tmpsig;
-
-	siginitsetinv(&tmpsig, mask);
-	sigprocmask(SIG_BLOCK, &tmpsig, oldsigs);
-#else
-	spin_lock_irq (&current->sighand->siglock);
-	if (oldsigs)
-		*oldsigs = current->blocked;
-	siginitsetinv (&current->blocked, mask);
-	recalc_sigpending ();
-	spin_unlock_irq (&current->sighand->siglock);
-#endif
-}
-
-void util_unblock_sigs(sigset_t newsig)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	sigprocmask(SIG_SETMASK, &newsig, NULL);
-#else
-       	spin_lock_irq (&current->sighand->siglock);
-	current->blocked = newsig;
-	recalc_sigpending ();
-	spin_unlock_irq (&current->sighand->siglock);
-#endif
-}
-
-/* prefetch has been declared to allow to build in debug mode */
-#ifdef DEBUG
-#ifndef ARCH_HAS_PREFETCH
-inline void prefetch (const void *x)
-{;
-}
-#endif
-#endif
-
-/* resizable (using chained pages) array stuff */
-void util_init_rarray(util_rarray *arr, u16 elem_size)
-{
-	arr->elements = 0;
-	arr->max_elem = 0;
-	arr->elem_size = elem_size;
-	arr->page = NULL;
-}	
-
-
-void * util_rarray_idx_to_slot(util_rarray *arr, int idx)
-{
-	int pgnum, pgoff;
-	util_rarray_page *pg;
-	
-	if (idx >= arr->max_elem) {
-		printk("eek! asked for %d, but only %d elements\n", 
-		       idx, arr->max_elem);
-		return NULL;
-	}
-	
-	pgnum = idx / UTIL_RARRAY_ELEM_PER_BUF(arr);
-	pgoff = idx % UTIL_RARRAY_ELEM_PER_BUF(arr);
-	pg = (util_rarray_page *)arr->page;
-	while (pgnum--) {
-		if (!pg->next) {
-			printk("eeek! no next page!\n");
-			return NULL;
-		}
-		pg = pg->next;
-	}
-	return (((char *)pg->buf) + (pgoff * arr->elem_size));
-}
-
-
-void * util_get_new_rarray_slot(util_rarray *arr, int *index)
-{
-	char *tmp;
-	util_rarray_page *newpg, *pg;
-	
-	if (arr->max_elem == arr->elements) {
-		newpg = (util_rarray_page *) __get_free_page(GFP_KERNEL);
-		if (!newpg) {
-			printk("could not grow array!!!\n");
-			return NULL;
-		}
-		memset(newpg, 0, PAGE_SIZE);
-		if (arr->page) {
-			pg = (util_rarray_page *)arr->page;
-			while (pg->next)
-				pg = pg->next;
-			pg->next = newpg;
-		} else
-			arr->page = newpg;
-		arr->max_elem += UTIL_RARRAY_ELEM_PER_BUF(arr);
-	}
-
-	tmp = util_rarray_idx_to_slot(arr, arr->elements);
-	if (tmp) {
-		if (index)
-			*index = arr->elements;
-		arr->elements++;
-	}
-	return tmp;
-}
-
-
-int util_add_to_rarray(util_rarray *arr, void *new)
-{
-	void *slot;
-	int idx;
-
-	slot = util_get_new_rarray_slot(arr, &idx);
-	if (slot == NULL) 
-		return -EINVAL;
-	memcpy(slot, new, arr->elem_size);
-	return idx;
-}
-
-/* resizes rarray to at least newelem elements */
-int util_resize_rarray(util_rarray *arr, int newelem)
-{
-	util_rarray_page *newpg, *pg;
-
-	printk("util_resize_rarray: newsize=%d, maxelem=%d\n", newelem, arr->max_elem);
-	while (arr->max_elem < newelem) {
-		newpg = (util_rarray_page *) __get_free_page(GFP_KERNEL);
-		if (!newpg) {
-			printk("could not grow array!!!\n");
-			return -ENOMEM;
-		}
-		memset(newpg, 0, PAGE_SIZE);
-		if (arr->page) {
-			pg = (util_rarray_page *)arr->page;
-			while (pg->next)
-				pg = pg->next;
-			pg->next = newpg;
-		} else
-			arr->page = newpg;
-		arr->max_elem += UTIL_RARRAY_ELEM_PER_BUF(arr);
-	}
-	printk("leaving util_resize_rarray: newsize=%d, maxelem=%d\n", newelem, arr->max_elem);
-
-	return 0;
-}
-
-

Deleted: trunk/fs/ocfs2/dlm/util.h
===================================================================
--- trunk/fs/ocfs2/dlm/util.h	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlm/util.h	2005-03-19 01:54:11 UTC (rev 2015)
@@ -1,80 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * util.h
- *
- * Function prototypes
- *
- * 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.
- *
- * Authors: Kurt Hackel
- */
-
-#ifndef CLUSTER_UTIL_H
-#define CLUSTER_UTIL_H
-
-#ifdef __KERNEL__
-#define SHUTDOWN_SIGS   (sigmask(SIGKILL) | sigmask(SIGHUP) | \
-			 sigmask(SIGINT) | sigmask(SIGQUIT))
-
-#include <linux/timer.h>
-#include <linux/wait.h>
-
-/* timeout structure taken from Ben's aio.c */
-typedef struct _util_timeout {
-	struct timer_list	timer;
-	int			timed_out;
-	wait_queue_head_t	wait;
-} util_timeout;
-
-void util_clear_timeout(util_timeout *to);
-void util_init_timeout(util_timeout *to);
-void util_set_timeout(util_timeout *to, __u32 timeout);
-void util_show_stack(unsigned long *esp);
-void util_show_trace(unsigned long *stack);
-int util_sleep(__u32 ms);
-void util_block_sigs(sigset_t *oldsigs, unsigned long mask);
-void util_unblock_sigs(sigset_t newsig);
-
-#endif  /* __KERNEL__ */
-
-/* resizable array */
-typedef struct _util_rarray
-{
-	void *page;
-	u16 elements;
-	u16 max_elem;
-	u16 elem_size;
-	u16 reserved1;
-} util_rarray;
-
-#define UTIL_RARRAY_PAGE_BUF_SIZE    (PAGE_SIZE - offsetof(util_rarray_page, buf))
-#define UTIL_RARRAY_ELEM_PER_BUF(r)  ((UTIL_RARRAY_PAGE_BUF_SIZE) / (r)->elem_size)
-typedef struct _util_rarray_page
-{
-	void *next;
-	char buf[0];
-} util_rarray_page;
-
-void util_init_rarray(util_rarray *arr, u16 elem_size);
-void * util_get_new_rarray_slot(util_rarray *arr, int *index);
-int util_add_to_rarray(util_rarray *arr, void *new);
-void * util_rarray_idx_to_slot(util_rarray *arr, int idx);
-int util_resize_rarray(util_rarray *arr, int newelem);
-
-#endif /* CLUSTER_UTIL_H */

Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/dlmglue.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -33,7 +33,6 @@
 #include <linux/crc32.h>
 #include <linux/kthread.h>
 
-#include <cluster/util.h>
 #include <cluster/heartbeat.h>
 #include <cluster/nodemanager.h>
 #include <cluster/tcp.h>
@@ -50,7 +49,6 @@
 #include "heartbeat.h"
 #include "inode.h"
 #include "slot_map.h"
-#include "util.h"
 #include "vote.h"
 
 #include "ocfs_journal.h"

Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/file.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -48,7 +48,6 @@
 #include "inode.h"
 #include "mmap.h"
 #include "suballoc.h"
-#include "util.h"
 
 #include "ocfs_journal.h"
 #include "buffer_head_io.h"

Modified: trunk/fs/ocfs2/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/heartbeat.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/heartbeat.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -31,7 +31,6 @@
 #include <linux/slab.h>
 #include <linux/highmem.h>
 
-#include <cluster/util.h>
 #include <cluster/heartbeat.h>
 #include <cluster/nodemanager.h>
 #include <dlm/dlmcommon.h>
@@ -42,7 +41,6 @@
 
 #include "alloc.h"
 #include "heartbeat.h"
-#include "util.h"
 
 #include "ocfs_journal.h"
 #include "buffer_head_io.h"

Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/inode.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -48,7 +48,6 @@
 #include "super.h"
 #include "symlink.h"
 #include "sysfile.h"
-#include "util.h"
 #include "vote.h"
 
 #include "ocfs_journal.h"

Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/journal.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -45,7 +45,6 @@
 #include "namei.h"
 #include "slot_map.h"
 #include "super.h"
-#include "util.h"
 #include "vote.h"
 #include "sysfile.h"
 

Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/mmap.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -41,7 +41,6 @@
 #include "file.h"
 #include "inode.h"
 #include "mmap.h"
-#include "util.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_MMAP
 

Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/namei.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -58,7 +58,6 @@
 #include "namei.h"
 #include "suballoc.h"
 #include "symlink.h"
-#include "util.h"
 #include "vote.h"
 
 #include "ocfs_journal.h"

Modified: trunk/fs/ocfs2/ocfs.h
===================================================================
--- trunk/fs/ocfs2/ocfs.h	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/ocfs.h	2005-03-19 01:54:11 UTC (rev 2015)
@@ -42,7 +42,6 @@
 # include <linux/tqueue.h>
 #endif
 
-#include "cluster/util.h"
 #include "cluster/nodemanager.h"
 #include "cluster/heartbeat.h"
 #include "cluster/tcp.h"

Modified: trunk/fs/ocfs2/ocfs_log.h
===================================================================
--- trunk/fs/ocfs2/ocfs_log.h	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/ocfs_log.h	2005-03-19 01:54:11 UTC (rev 2015)
@@ -370,14 +370,6 @@
 #define LOG_ERROR_STR(str)     LOG_ERROR_ARGS("%s\n", str)
 #define LOG_ERROR_STATUS(st)   LOG_ERROR_ARGS("status = %lld\n", (long long)(st))
 
-#define ocfs_trace(p) \
-	do { \
-       		printk("Trace in %s line %d called from [<%lx>]\n", \
-		       __FILE__, __LINE__, \
-		       __builtin_return_address(0) ); \
-       		ocfs_show_trace(NULL); \
-	} while (0)
-
 #ifdef EVIL_TRACE
 #define LOG_SET_CONTEXT(ctxt) current->flags |= (OCFS_TRACE_ ## ctxt) << 24
 #define LOG_CLEAR_CONTEXT()   current->flags &= 0xffffff

Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/suballoc.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -38,7 +38,6 @@
 #include "alloc.h"
 #include "dlmglue.h"
 #include "localalloc.h"
-#include "util.h"
 #include "suballoc.h"
 #include "sysfile.h"
 

Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/super.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -42,7 +42,6 @@
 #include <linux/socket.h>
 #include <linux/inet.h>
 
-#include <cluster/util.h>
 #include <cluster/nodemanager.h>
 #include <dlm/dlmcommon.h>
 
@@ -64,7 +63,6 @@
 #include "slot_map.h"
 #include "super.h"
 #include "sysfile.h"
-#include "util.h"
 #include "ver.h"
 #include "vote.h"
 

Modified: trunk/fs/ocfs2/sysfile.c
===================================================================
--- trunk/fs/ocfs2/sysfile.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/sysfile.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -38,7 +38,6 @@
 #include "dir.h"
 #include "inode.h"
 #include "sysfile.h"
-#include "util.h"
 
 #include "ocfs_journal.h"
 #include "buffer_head_io.h"

Deleted: trunk/fs/ocfs2/util.c
===================================================================
--- trunk/fs/ocfs2/util.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/util.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -1,146 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * util.c
- *
- * General purpose code
- *
- * 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/mm.h>
-#include <linux/slab.h>
-
-#include "ocfs_log.h"
-#include "ocfs.h"
-
-#include "util.h"
-
-/* Tracing */
-#define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_UTIL
-
-/* block all but 'mask' sigs, optionally saving off our previous
- * signal state. */
-void ocfs_block_sigs(sigset_t *oldsigs, unsigned long mask)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	sigset_t tmpsig;
-
-	siginitsetinv(&tmpsig, mask);
-	sigprocmask(SIG_BLOCK, &tmpsig, oldsigs);
-#else
-	spin_lock_irq (&current->sighand->siglock);
-	if (oldsigs)
-		*oldsigs = current->blocked;
-	siginitsetinv (&current->blocked, mask);
-	recalc_sigpending ();
-	spin_unlock_irq (&current->sighand->siglock);
-#endif
-}
-
-void ocfs_unblock_sigs(sigset_t newsig)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	sigprocmask(SIG_SETMASK, &newsig, NULL);
-#else
-       	spin_lock_irq (&current->sighand->siglock);
-	current->blocked = newsig;
-	recalc_sigpending ();
-	spin_unlock_irq (&current->sighand->siglock);
-#endif
-}
-
-/* prefetch has been declared to allow to build in debug mode */
-#ifdef DEBUG
-#ifndef ARCH_HAS_PREFETCH
-inline void prefetch (const void *x)
-{;
-}
-#endif
-#endif
-
-/*
-To print the ocfs call stack use: ocfs_show_stack( NULL);
-
-ocfs_show_trace prints alot of garbage because nothing usefull is exported
-by the kernel to determine which addresses are from the kernel/modules
-
-However the following greps will help you filter out most of the garbage
-from the syslog :
-
-alias ocfstrace='tail -200 /var/log/messages | grep -v modules | grep -v \\\[\<'
-*/
-
-
-
-void ocfs_show_stack(unsigned long * esp)
-{
-	unsigned long *stack;
-	int depth_to_print=16, i;
-
-	// debugging aid: "show_stack(NULL);" prints the
-	// back trace for this cpu.
-
-	if(esp==NULL)
-		esp=(unsigned long*)&esp;
-
-	stack = esp;
-	for(i=0; i < depth_to_print; i++) {
-		if (((long) stack & (THREAD_SIZE-1)) == 0)
-			break;
-		if (i && ((i % 8) == 0))
-			printk("\n       ");
-		printk("%08lx ", *stack++);
-	}
-	printk("\n");
-	ocfs_show_trace(esp);
-}
-
-static int ocfs_kernel_text_address(unsigned long addr)
-{
-  return  addr >= 0xc0000000; 
-}
-
-void ocfs_show_trace(unsigned long * stack)
-{
-	unsigned long addr;
-	/* static to not take up stackspace; if we race here too bad */
-
-	if (!stack)
-		stack = (unsigned long*)&stack;
-
-	printk("Call Trace: \n");
-	
-	while (((long) stack & (THREAD_SIZE-1)) != 0) {
-		addr = *stack++;
-		if (ocfs_kernel_text_address(addr)) {
-		//        lookup_symbol(addr, buffer, 512);
-			printk("[<%08lx>] %s (0x%p)\n", addr," ",stack-1);
-		}
-	}
-	printk("\n");
-
-
-}
-
-
-

Deleted: trunk/fs/ocfs2/util.h
===================================================================
--- trunk/fs/ocfs2/util.h	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/util.h	2005-03-19 01:54:11 UTC (rev 2015)
@@ -1,34 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * util.h
- *
- * Function prototypes
- *
- * 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.
- */
-
-#ifndef OCFS2_UTIL_H
-#define OCFS2_UTIL_H
-
-void ocfs_show_stack(unsigned long *esp);
-void ocfs_show_trace(unsigned long *stack);
-void ocfs_block_sigs(sigset_t *oldsigs, unsigned long mask);
-void ocfs_unblock_sigs(sigset_t newsig);
-
-#endif /* OCFS2_UTIL_H */

Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c	2005-03-19 00:04:59 UTC (rev 2014)
+++ trunk/fs/ocfs2/vote.c	2005-03-19 01:54:11 UTC (rev 2015)
@@ -31,7 +31,6 @@
 #include <linux/smp_lock.h>
 #include <linux/kthread.h>
 
-#include <cluster/util.h>
 #include <cluster/heartbeat.h>
 #include <cluster/nodemanager.h>
 #include <cluster/tcp.h>
@@ -48,7 +47,6 @@
 #include "heartbeat.h"
 #include "inode.h"
 #include "slot_map.h"
-#include "util.h"
 #include "vote.h"
 
 #include "ocfs_journal.h"



More information about the Ocfs2-commits mailing list