[Ocfs2-commits] jlbec commits r1134 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Jun 17 18:31:40 CDT 2004


Author: jlbec
Date: 2004-06-17 17:31:38 -0500 (Thu, 17 Jun 2004)
New Revision: 1134

Added:
   trunk/src/buffer_head_io.h
Removed:
   trunk/src/ocfs_buffer_head.h
Modified:
   trunk/src/Makefile
   trunk/src/alloc.c
   trunk/src/bitmap.c
   trunk/src/buffer_head_io.c
   trunk/src/dir.c
   trunk/src/dlm.c
   trunk/src/file.c
   trunk/src/heartbeat.c
   trunk/src/inode.c
   trunk/src/journal.c
   trunk/src/lockres.c
   trunk/src/namei.c
   trunk/src/nm.c
   trunk/src/super.c
   trunk/src/sysfile.c
   trunk/src/volcfg.c
Log:
o Rename ocfs_buffer_head.h to buffer_head_io.h.  It's an internal header

Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/Makefile	2004-06-17 22:31:38 UTC (rev 1134)
@@ -147,7 +147,7 @@
 	ocfs_log.h		\
 	ocfs_compat.h		\
 	ocfs_journal.h		\
-	ocfs_buffer_head.h	\
+	buffer_head_io.h	\
 	alloc.h			\
 	bitmap.h		\
 	dcache.h		\

Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/alloc.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -46,7 +46,7 @@
 #include "file.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #ifndef USERSPACE_TOOL
 

Modified: trunk/src/bitmap.c
===================================================================
--- trunk/src/bitmap.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/bitmap.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -41,7 +41,7 @@
 #include "util.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 /* Tracing */
 #define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_BITMAP

Modified: trunk/src/buffer_head_io.c
===================================================================
--- trunk/src/buffer_head_io.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/buffer_head_io.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -40,7 +40,7 @@
 #include "util.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_IO
 

Copied: trunk/src/buffer_head_io.h (from rev 1131, trunk/src/ocfs_buffer_head.h)

Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/dir.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -55,7 +55,7 @@
 #include "namei.h"
 #include "util.h"
 
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_DIR
 

Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/dlm.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -46,7 +46,7 @@
 #include "vote.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 extern __u32 comm_voting;
 

Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/file.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -45,7 +45,7 @@
 #include "util.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_FILE
 

Modified: trunk/src/heartbeat.c
===================================================================
--- trunk/src/heartbeat.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/heartbeat.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -42,7 +42,7 @@
 #include "vote.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 /* Tracing */
 #define OCFS_DEBUG_CONTEXT      OCFS_DEBUG_CONTEXT_HEARTBEAT

Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/inode.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -55,7 +55,7 @@
 #include "vote.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_INODE
 

Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/journal.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -48,7 +48,7 @@
 #include "sysfile.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_JOURNAL
 

Modified: trunk/src/lockres.c
===================================================================
--- trunk/src/lockres.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/lockres.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -41,7 +41,7 @@
 #include "util.h"
 #include "vote.h"
 
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 /* Tracing */
 #define OCFS_DEBUG_CONTEXT      OCFS_DEBUG_CONTEXT_LOCKRES

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/namei.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -62,7 +62,7 @@
 #include "vote.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_NAMEI
 

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/nm.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -49,7 +49,7 @@
 #include "vote.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 /* Tracing */
 #define OCFS_DEBUG_CONTEXT      OCFS_DEBUG_CONTEXT_NM

Deleted: trunk/src/ocfs_buffer_head.h
===================================================================
--- trunk/src/ocfs_buffer_head.h	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/ocfs_buffer_head.h	2004-06-17 22:31:38 UTC (rev 1134)
@@ -1,234 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs_buffer_head.h
- *
- * Buffer cache handling functions defined
- *
- * 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.
- *
- * Authors: Kurt Hackel, Mark Fasheh, Sunil Mushran, Wim Coekaerts,
- *	    Manish Singh
- */
-
-#ifndef OCFSIO_H
-#define OCFSIO_H
-
-#include <linux/compiler.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
-
-/* Yosh made me do it. */
-static inline int ocfs_write_bh  (ocfs_super          *osb, 
-				  struct buffer_head  *bh, 
-				  int                  flags, 
-				  struct inode        *inode);
-static inline int ocfs_read_bh   (ocfs_super          *osb, 
-				  __u64                off, 
-				  struct buffer_head **bh, 
-				  int                  flags, 
-				  struct inode        *inode);
-
-int ocfs_write_bhs (ocfs_super          *osb,
-		    struct buffer_head  *bh[], 
-		    int                  nr, 
-		    int                  flags, 
-		    struct inode        *inode);
-int ocfs_read_bhs  (ocfs_super          *osb, 
-		    __u64                off,
-		    __u64                len, 
-		    struct buffer_head  *bhs[], 
-		    int                  flags, 
-		    struct inode         *inode);
-
-
-#define OCFS_BH_CACHED            1
-#define OCFS_BH_COND_CACHED       2
-#define OCFS_BH_CONCURRENT_WRITE  4     /* This should only be used by ocfs_worker */
-#define OCFS_BH_IGNORE_JBD        8     /* This should only be used by ocfs_checkpoint_handle! */
-#define OCFS_BH_READAHEAD         16	/* 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 OCFS_BH_GET_DATA(bh)  ((void *) ((bh)->b_data))
-#define OCFS_BH_GET_DATA_READ(bh) OCFS_BH_GET_DATA(bh)
-#define OCFS_BH_GET_DATA_WRITE(bh) OCFS_BH_GET_DATA(bh)
-#define OCFS_BH_GET_DATA_WRITE_TRYLOCK(bh) OCFS_BH_GET_DATA(bh)
-#define OCFS_BH_PUT_DATA(bh) do { } while(0)
-
-#define STATE_BH_BITS	8
-#define USED_BH_BITS	23 /* Number of BH bits used up through JBD */
-
-#define STATE_BIT_MAX           (1 << STATE_BH_BITS)
-#define STATE_BIT_MAX_MASK      ((1 << STATE_BH_BITS)-1)
-#define STATE_BIT_MASK		((~0UL) << USED_BH_BITS)
-
-
-static inline void CLEAR_BH_SEQNUM(struct buffer_head *bh)
-{
-	unsigned int prev = bh->b_state & STATE_BIT_MASK;
-	bh->b_state &= ~prev;
-}
-
-static inline void SET_BH_SEQNUM(struct inode *inode, struct buffer_head *bh)
-{
-	unsigned int seq = (atomic_read(GET_INODE_CLEAN_SEQ(inode)) & 
-			    STATE_BIT_MAX_MASK) << USED_BH_BITS;
-
-	CLEAR_BH_SEQNUM(bh);
-	bh->b_state |= seq;
-}
-
-static inline int TEST_BH_SEQNUM(struct inode *inode, struct buffer_head *bh)
-{
-	int ret;
-	unsigned int seq =
-		(bh->b_state & STATE_BIT_MASK) >> USED_BH_BITS;
-
-	ret = (seq == atomic_read(GET_INODE_CLEAN_SEQ(inode)));
-	return ret;
-}
-
-static inline int check_block_zero_write(struct buffer_head *bh)
-{
-	if (unlikely(bh->b_blocknr == 0)) {
-		ocfs_vol_disk_hdr *hdr = OCFS_BH_GET_DATA_READ(bh);
-
-		if (hdr == NULL) {
-			printk ("ocfs2: failed to map bh page!!!\n");
-			return -EIO;
-		}
-
-		if (memcmp(hdr->signature, 
-			   OCFS_VOLUME_SIGNATURE, 
-			   strlen(OCFS_VOLUME_SIGNATURE)) != 0) {
-			printk("ocfs2: WARNING! attempting to write non "
-			       "volume header to block 0\n");
-			OCFS_BH_PUT_DATA(bh);
-			return -EIO;
-		}
-
-		OCFS_BH_PUT_DATA(bh);
-	}
-
-	return 0;
-}
-
-#define OCFS_PRINT_FE_SIZE(bh)						      \
-do {									      \
-	if (bh) {							      \
-		ocfs2_dinode *__fe = bh->b_data;			      \
-		if (IS_VALID_FILE_ENTRY(__fe)) {			      \
-			printk("ocfs2: %s:%d fe_check: file_size = (%llu), "  \
-				"this_sector = (%llu)\n",		      \
-				__FUNCTION__, __LINE__, 		      \
-				__fe->file_size,			      \
-				__fe->this_sector);			      \
-		}							      \
-	}								      \
-} while(0)
-
-/* check the 1st five bytes. */
-static inline int ocfs_poison(struct buffer_head *bh)
-{
-	int i;
-	for(i = 0; i < 512; i++)
-		if ((bh)->b_data[i] != 'P')
-			return(0);
-	return(1);
-}
-
-#define OCFS_DO_HEX_DUMP(bh)						      \
-do {									      \
-	printk("bh->b_blocknr = %lu, bh->b_data:\n", bh->b_blocknr);	      \
-	for(i = 0; i < 512; i++) {					      \
-		printk("%03x ", bh->b_data[i]);				      \
-		if ( ((i+1) % 16) == 0 )				      \
-		printk("\n");						      \
-	}								      \
-	printk("\n");							      \
-} while (0)
-
-static inline int ocfs_write_bh (ocfs_super * osb, struct buffer_head *bh, 
-				 int flags, struct inode *inode)
-{
-	int status;
-	
-	IO_FUNC_TIMING_DECL
-
-	status = ocfs_write_bhs (osb, &bh, 1, flags, inode);
-
-	IO_FUNC_TIMING_PRINT("ocfs_write_bh", status);
-
-	return status;
-}
-
-static inline int ocfs_read_bh (ocfs_super * osb, __u64 off, 
-				struct buffer_head **bh, int flags, 
-				struct inode *inode)
-{
-	int status = 0;
-
-	IO_FUNC_TIMING_DECL
-
-	if (bh == NULL) {
-		printk("ocfs2: bh == NULL\n");
-		status = -EINVAL;
-		goto bail;
-	}
-	
-	status = ocfs_read_bhs(osb, off, osb->sb->s_blocksize, bh,
-			       flags, inode);
-
-bail:
-	IO_FUNC_TIMING_PRINT("ocfs_read_bh", status);
-
-	return status;
-}
-
-#endif /* OCFSIO_H */

Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/super.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -65,7 +65,7 @@
 #include "vote.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 #define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_SUPER
 

Modified: trunk/src/sysfile.c
===================================================================
--- trunk/src/sysfile.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/sysfile.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -43,7 +43,7 @@
 #include "util.h"
 
 #include "ocfs_journal.h"
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 /* Tracing */
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_SYSFILE

Modified: trunk/src/volcfg.c
===================================================================
--- trunk/src/volcfg.c	2004-06-17 22:29:23 UTC (rev 1133)
+++ trunk/src/volcfg.c	2004-06-17 22:31:38 UTC (rev 1134)
@@ -39,7 +39,7 @@
 #include "util.h"
 #include "volcfg.h"
 
-#include "ocfs_buffer_head.h"
+#include "buffer_head_io.h"
 
 /* Tracing */
 #define  OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_VOLCFG



More information about the Ocfs2-commits mailing list