[Ocfs2-commits] jlbec commits r1820 - in trunk/fs/ocfs2: cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Jan 20 20:25:53 CST 2005


Author: jlbec
Date: 2005-01-20 20:25:52 -0600 (Thu, 20 Jan 2005)
New Revision: 1820

Added:
   trunk/fs/ocfs2/cluster/cl_compat.h
Removed:
   trunk/fs/ocfs2/dlm/dlm_compat.h
Log:
o Argh, this is really something that belongs in cluster/

Copied: trunk/fs/ocfs2/cluster/cl_compat.h (from rev 1819, trunk/fs/ocfs2/dlm/dlm_compat.h)

Deleted: trunk/fs/ocfs2/dlm/dlm_compat.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlm_compat.h	2005-01-21 01:50:08 UTC (rev 1819)
+++ trunk/fs/ocfs2/dlm/dlm_compat.h	2005-01-21 02:25:52 UTC (rev 1820)
@@ -1,189 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * dlm_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.
- *
- * Authors: Kurt Hackel
- */
-
-#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>
-
-/* 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)
-
-extern inline int generic_fls(int x);
-extern inline int get_bitmask_order(unsigned int count);
-/* XXX Hack to avoid warning */
-struct mem_dqinfo;
-
-#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)
-
-#ifdef HAVE_NPTL
-static inline void dequeue_signal_lock(struct task_struct *task,
-				       sigset_t *blocked, siginfo_t *info)
-{
-	spin_lock_irq(&task->sighand->siglock);
-	dequeue_signal(blocked, info);
-	spin_unlock_irq(&task->sighand->siglock);
-}
-#else
-static inline void dequeue_signal_lock(struct task_struct *task,
-				       sigset_t *blocked, siginfo_t *info)
-{
-	spin_lock_irq(&task->sigmask_lock);
-	dequeue_signal(blocked, info);
-	spin_unlock_irq(&task->sigmask_lock);
-}
-#endif
-#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)
-
-#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 */
-
-#ifndef HAVE_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 /* HAVE_SOCK_CREATE_LITE */
-
-
-#endif  /* CLUSTER_DLM_COMPAT_H */
-



More information about the Ocfs2-commits mailing list