[Ocfs2-commits] rev 18 - in trunk: . src src/inc vendor vendor/redhat vendor/unitedlinux

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Jan 29 07:58:17 CST 2004


Author: manish
Date: 2004-01-29 01:58:15 -0600 (Thu, 29 Jan 2004)
New Revision: 18

Added:
   trunk/vendor/
   trunk/vendor/Makefile
   trunk/vendor/redhat/
   trunk/vendor/redhat/Makefile
   trunk/vendor/redhat/ocfs2-2.4.18-e.spec.in
   trunk/vendor/redhat/ocfs2-2.4.21-EL.spec.in
   trunk/vendor/redhat/ocfs2-2.4.9-e.spec.in
   trunk/vendor/unitedlinux/
   trunk/vendor/unitedlinux/Makefile
   trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB-SMP.spec.in
   trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB.spec.in
   trunk/vendor/unitedlinux/ocfs2-2.4.19-64GB-SMP.spec.in
   trunk/vendor/unitedlinux/ocfs2-2.4.21-107.spec.in
   trunk/vendor/unitedlinux/ocfs2-2.4.21-111.spec.in
   trunk/vendor/unitedlinux/ocfs2-2.4.21-138.spec.in
Modified:
   trunk/Config.make.in
   trunk/Makefile
   trunk/configure.in
   trunk/src/alloc.c
   trunk/src/dcache.c
   trunk/src/dir.c
   trunk/src/hash.c
   trunk/src/inc/io.h
   trunk/src/inc/ocfs.h
   trunk/src/inc/proto.h
   trunk/src/inode.c
   trunk/src/io.c
   trunk/src/journal.c
   trunk/src/namei.c
   trunk/src/nm.c
   trunk/src/oin.c
   trunk/src/osb.c
   trunk/src/util.c
Log:
Sync


Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/Config.make.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -9,6 +9,8 @@
 MICRO_VERSION = @MICRO_VERSION@
 EXTRA_VERSION = @EXTRA_VERSION@
 
+SUPPORT_REQUIRED_VERSION = @SUPPORT_REQUIRED_VERSION@
+
 SHELL = @SHELL@
 
 prefix = @prefix@

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/Makefile	2004-01-29 07:58:15 UTC (rev 18)
@@ -2,7 +2,7 @@
 
 include $(TOPDIR)/Preamble.make
 
-SUBDIRS = src docs patches
+SUBDIRS = src docs patches vendor
 
 DIST_FILES = \
 	COPYING		\
@@ -30,50 +30,50 @@
 
 # REDHAT 
 rhas_srpm: dist
-	rpm -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/redhat/ocfs-2.4.9-e.spec
+	rpm -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/redhat/ocfs2-2.4.9-e.spec
 
 rhasia64_srpm: dist
-	rpm -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/redhat/ocfs-2.4.18-e.spec
+	rpm -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/redhat/ocfs2-2.4.18-e.spec
 
 rhas_rpm: rhas_srpm
-	rpm --rebuild --target i686 "ocfs-2.4.9-e-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpm --rebuild --target i686 "ocfs2-2.4.9-e-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 rhasia64_rpm: rhasia64_srpm
-	rpm --rebuild --target ia64  "ocfs-2.4.18-e-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpm --rebuild --target ia64  "ocfs2-2.4.18-e-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 rhel3_srpm: dist
-	rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/redhat/ocfs-2.4.21-EL.spec
+	rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/redhat/ocfs2-2.4.21-EL.spec
 
 rhel3_rpm: rhel3_srpm
-	rpmbuild --rebuild --target i686 "ocfs-2.4.21-EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpmbuild --rebuild --target i686 "ocfs2-2.4.21-EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 
 # UNITED LINUX 
 #
 ul64gb_srpm: dist
-	rpm -bs --define "_sourcedir `realpath $(TOPDIR)`" --define "_srcrpmdir `realpath $(TOPDIR)`" $(TOPDIR)/unitedlinux/ocfs-2.4.19-64GB-SMP.spec
+	rpm -bs --define "_sourcedir `realpath $(TOPDIR)`" --define "_srcrpmdir `realpath $(TOPDIR)`" $(TOPDIR)/vendor/unitedlinux/ocfs2-2.4.19-64GB-SMP.spec
 
 ul64gb_rpm: ul64gb_srpm
-	rpm --rebuild  --target i586 "ocfs-2.4.19-64GB-SMP-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpm --rebuild  --target i586 "ocfs2-2.4.19-64GB-SMP-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 
 ul4gbsmp_srpm: dist
-	rpm -bs --define "_sourcedir `realpath $(TOPDIR)`" --define "_srcrpmdir `realpath $(TOPDIR)`" $(TOPDIR)/unitedlinux/ocfs-2.4.19-4GB-SMP.spec
+	rpm -bs --define "_sourcedir `realpath $(TOPDIR)`" --define "_srcrpmdir `realpath $(TOPDIR)`" $(TOPDIR)/vendor/unitedlinux/ocfs2-2.4.19-4GB-SMP.spec
 
 ul4gbsmp_rpm: ul4gbsmp_srpm
-	rpm --rebuild --target i586 "ocfs-2.4.19-4GB-SMP-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpm --rebuild --target i586 "ocfs2-2.4.19-4GB-SMP-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 ul4gb_srpm: dist
-	rpm -bs --define "_sourcedir `realpath $(TOPDIR)`" --define "_srcrpmdir `realpath $(TOPDIR)`" $(TOPDIR)/unitedlinux/ocfs-2.4.19-4GB.spec
+	rpm -bs --define "_sourcedir `realpath $(TOPDIR)`" --define "_srcrpmdir `realpath $(TOPDIR)`" $(TOPDIR)/vendor/unitedlinux/ocfs2-2.4.19-4GB.spec
 
 ul4gb_rpm: ul4gb_srpm
-	rpm --rebuild --target i586 "ocfs-2.4.19-4GB-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpm --rebuild --target i586 "ocfs2-2.4.19-4GB-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 ul10sp3_%_srpm: dist
-	rpm -bs --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" $(TOPDIR)/unitedlinux/ocfs-2.4.21-$(patsubst ul10sp3_%_srpm,%,$@).spec
+	rpm -bs --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" $(TOPDIR)/vendor/unitedlinux/ocfs2-2.4.21-$(patsubst ul10sp3_%_srpm,%,$@).spec
 
 ul10sp3_%_rpm: ul10sp3_%_srpm
-	rpm --rebuild --target i586 "ocfs-2.4.21-$(patsubst ul10sp3_%_rpm,%,$@)-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+	rpm --rebuild --target i586 "ocfs2-2.4.21-$(patsubst ul10sp3_%_rpm,%,$@)-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
 
 distclean: clean
 	rm -f Config.make config.status config.cache config.log

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/configure.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -1,6 +1,6 @@
 AC_INIT(src/Makefile)
 
-PACKAGE=ocfs
+PACKAGE=ocfs2
 VERSION=1.9.9
 
 AC_SUBST(PACKAGE)
@@ -12,8 +12,11 @@
 EXTRA_VERSION=UNSTABLE
 
 # Adjust this only to bump the RPM packaging version
-RPM_VERSION=2
+RPM_VERSION=1
 
+# Required version of ocfs-tools
+SUPPORT_REQUIRED_VERSION=1.1.0
+
 DIST_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 VERSION=$DIST_VERSION-$EXTRA_VERSION
 
@@ -26,6 +29,8 @@
 AC_SUBST(VERSION)
 AC_SUBST(RPM_VERSION)
 
+AC_SUBST(SUPPORT_REQUIRED_VERSION)
+
 AC_CANONICAL_HOST
 
 OCFS_PROCESSOR=
@@ -61,6 +66,7 @@
 esac
 
 AC_SUBST(OCFS_PROCESSOR)
+
 AC_PROG_CC
 AC_PROG_CPP
 
@@ -298,4 +304,14 @@
 GCCINC=$gccdir
 AC_SUBST(GCCINC)
 
-AC_OUTPUT([Config.make])
+AC_OUTPUT([Config.make
+vendor/redhat/ocfs2-2.4.9-e.spec
+vendor/redhat/ocfs2-2.4.18-e.spec
+vendor/redhat/ocfs2-2.4.21-EL.spec
+vendor/unitedlinux/ocfs2-2.4.19-64GB-SMP.spec
+vendor/unitedlinux/ocfs2-2.4.19-4GB-SMP.spec
+vendor/unitedlinux/ocfs2-2.4.19-4GB.spec
+vendor/unitedlinux/ocfs2-2.4.21-107.spec
+vendor/unitedlinux/ocfs2-2.4.21-111.spec
+vendor/unitedlinux/ocfs2-2.4.21-138.spec
+])

Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/alloc.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -3176,7 +3176,7 @@
  *
  */
 int ocfs_free_file_extents (ocfs_super * osb, struct buffer_head *fe_bh,
-			    ocfs_bitmap_free_head *free_head)
+			    ocfs_bitmap_free_head *free_head, struct inode *inode)
 {
 	int status = 0;
 	__u32 i;
@@ -3184,7 +3184,6 @@
 	ocfs_extent_group *extent = NULL;
 	struct buffer_head *extent_bh = NULL;
 	ocfs_file_entry *fe = NULL;
-	struct inode *inode = NULL;
 	__u64 offset;
 
 	LOG_ENTRY ();
@@ -3196,7 +3195,6 @@
 		offset = fe->this_sector;
 	OCFS_BH_PUT_DATA(fe_bh);
 
-	inode = ocfs_get_inode_from_offset(osb, offset, fe_bh);
 	if (inode)
 		SET_BH_SEQNUM(inode, fe_bh);
 
@@ -3249,8 +3247,6 @@
 			OCFS_BH_PUT_DATA(extent_bh);
 		brelse(extent_bh);
 	}
-	if (inode)
-		iput(inode);
 	
 	OCFS_BH_PUT_DATA(fe_bh);
 	LOG_EXIT_STATUS (status);

Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/dcache.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -100,7 +100,6 @@
 #else
 		args.offset = fe->this_sector;
 		args.fe_bh = fe_bh;
-		args.file_lookup_only = false;
 		OCFS_BH_PUT_DATA(fe_bh);
 		fe = NULL;
 		ocfs_read_inode2 (inode, (void *) &args);

Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/dir.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -4,10 +4,7 @@
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
 
 static int ocfs_insert_dir_node (ocfs_super * osb, struct buffer_head *bhs[], ocfs_file_entry * InsertEntry, struct buffer_head *lockbh, __s32 * IndexOffset, struct buffer_head **insert_bh, ocfs_journal_handle * handle, struct inode *dir_inode, struct inode *file_inode);
-static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], 
-				  struct qstr * SearchName, 
-				  struct buffer_head ** found_fe_bh, 
-				  ocfs_file * OFile, struct inode *dir_inode);
+static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, bool sync);
 static bool ocfs_find_index (ocfs_super * osb, struct buffer_head *bhs[], 
 			     struct qstr * FileName, int *Index);
 #if 0
@@ -145,11 +142,11 @@
 	ocfs_lock_res *lockres = NULL;
 	bool temp_bhs = false;
 	bool lock_acq = false;
+	bool sync = true;
 	struct buffer_head *bh = NULL;
 	struct buffer_head **bhs = NULL;
 	int bufsz, nbhs, i;
-	ocfs_dir_node *dir = NULL;
-	struct inode *tmpinode = NULL;
+	__u32 lock_type = OCFS_DLM_SHARED_LOCK;
 
 	/* TODO: change this to take a buffer head instead of fe */
 
@@ -177,7 +174,9 @@
 
 	if (take_lock) {
 		/* Get a shared lock on the directory... */
-		status = ocfs_acquire_lock (osb, parent_off, OCFS_DLM_SHARED_LOCK, FLAG_DIR,
+		// temp change... try this out
+		lock_type = OCFS_DLM_ENABLE_CACHE_LOCK;
+		status = ocfs_acquire_lock (osb, parent_off, lock_type, FLAG_DIR,
 				    	&lockres, &bh, inode);
 		if (status < 0) {
 			/* Volume should be disabled in this case */
@@ -186,6 +185,14 @@
 			goto leave;
 		}
 		lock_acq = true;
+		if (lockres->master_node_num == osb->node_num &&
+		    lockres->lock_type > OCFS_DLM_SHARED_LOCK)
+			sync = false;
+		else 
+			sync = true;
+	} else {
+		/* calling function has already taken a cache or exclusive lock */
+		sync = false;
 	}
 
 	if (bhs[0]==NULL || bhs[0]->b_blocknr != (thisDirNode >> 9)) {
@@ -195,7 +202,7 @@
 				bhs[i]=NULL;
 			}
 		}
-		status = ocfs_read_dirnode(osb, thisDirNode, &bhs[0], OCFS_BH_CACHED, inode);
+		status = ocfs_read_dirnode(osb, thisDirNode, sync, &bhs[0], inode);
 		if (status < 0) {
 			/* Volume should be disabled in this case */
 			LOG_ERROR_STATUS (status);
@@ -207,14 +214,14 @@
 	/* if file_name is null here, it means that we want to walk the */
 	/* directory for all files if it is not null, it means we want */
 	/* a particular file */
-	if (!ocfs_search_dir_node (osb, bhs, file_name, fe_bh, ofile, inode))
+	if (!ocfs_search_dir_node (osb, bhs, file_name, fe_bh, ofile, inode, sync))
 		status = -ENOENT;
 
 leave:
 
 	if (take_lock && lock_acq)
 	{
-		tmpstat = ocfs_release_lock (osb, parent_off, OCFS_DLM_SHARED_LOCK,
+		tmpstat = ocfs_release_lock (osb, parent_off, lock_type,
 					     FLAG_DIR, lockres, bh, inode);
 		if (tmpstat < 0) {
 			LOG_ERROR_STATUS (tmpstat);
@@ -358,7 +365,7 @@
  * ocfs_search_dir_node()
  *
  */
-static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode)
+static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, bool sync)
 {
 	__u32 start;
 	__u32 i;
@@ -438,7 +445,7 @@
 					bhs[i] = NULL;
 				}
 			}
-			status = ocfs_read_dirnode(osb, next, bhs, OCFS_BH_CACHED, dir_inode);
+			status = ocfs_read_dirnode(osb, next, sync, bhs, dir_inode);
 			if (status < 0) {
 				LOG_ERROR_STR("failed to read directory");
 				bRet = false;
@@ -617,7 +624,7 @@
 			goto leave;
 		}
 		memset(arr, 0, bufsz);
-		status = ocfs_read_dirnode(osb, DirNodeOffset, arr, OCFS_BH_CACHED, dir_inode);
+		status = ocfs_read_dirnode(osb, DirNodeOffset, false, arr, dir_inode);
 		if (status < 0) {
 			LOG_ERROR_STATUS (status);
 			goto leave;
@@ -1076,7 +1083,7 @@
 	LockNode = NULL;
 
 	/* get the bhs for dir_off */
-	status = ocfs_read_dirnode(osb, dir_off, bhs, OCFS_BH_CACHED, dir_inode);
+	status = ocfs_read_dirnode(osb, dir_off, false, bhs, dir_inode);
 	if (status < 0) {
 		LOG_ERROR_STATUS (status);
 		goto leave;
@@ -1111,7 +1118,7 @@
 	dir_off = locknode_off;
 	while (1) {
 		LOG_TRACE_ARGS("ocfs_insert_file: now checking %u.%u\n", dir_off);
-		status = ocfs_read_dirnode(osb, dir_off, bhs, OCFS_BH_CACHED, dir_inode);
+		status = ocfs_read_dirnode(osb, dir_off, false, bhs, dir_inode);
 		if (status < 0) {
 			LOG_ERROR_STATUS (status);
 			goto leave;
@@ -1202,8 +1209,7 @@
 		if (dir_next_node != INVALID_NODE_POINTER) {
 			/* already allocated a new block */
 			LOG_TRACE_ARGS("ocfs_insert_file: CASE 2A\n");
-			status = ocfs_read_dirnode(osb, dir_next_node, newbhs, 
-						   OCFS_BH_COND_CACHED, dir_inode);
+			status = ocfs_read_dirnode(osb, dir_next_node, false, newbhs, dir_inode);
 			if (status < 0) {
 				ocfs_safefree(newbhs);
 				LOG_ERROR_STATUS (status);
@@ -1221,6 +1227,8 @@
 		} else {
 			/* Allocate a new dir node */
 			__u64 fileOffset = 0;
+			unsigned long blk;
+
 			LOG_TRACE_ARGS("ocfs_insert_file: CASE 2B\n");
 
 			status = ocfs_alloc_node_block(osb, 
@@ -1234,22 +1242,21 @@
 				goto leave;
 			}
 
-			status = ocfs_read_dirnode(osb, bitmapOffset, newbhs, 
-						   OCFS_BH_COND_CACHED, dir_inode);
+			status = ocfs_read_bhs(osb, bitmapOffset, osb->vol_layout.dir_node_size,
+					       newbhs, OCFS_BH_COND_CACHED, dir_inode);
 			if (status < 0) {
 				ocfs_safefree(newbhs);
 				LOG_ERROR_STATUS (status);
 				goto leave;
 			}
-
 			dirtyall = true;
 			/* clear all 128k, all garbage currently */
 			for (i=0; i<numbhs; i++) {
 				status = ocfs_journal_access(handle, newbhs[i],
 						    OCFS_JOURNAL_ACCESS_WRITE);
 				if (status < 0) {
-					for (i=0; i<numbhs; i++)
-						brelse(newbhs[i]);
+					while (i >= 0)
+						brelse(newbhs[i--]);
 					ocfs_safefree(newbhs);
 					LOG_ERROR_STATUS (status);
 					goto leave;

Modified: trunk/src/hash.c
===================================================================
--- trunk/src/hash.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/hash.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -1156,15 +1156,19 @@
 }
 
 typedef struct _ocfs_inode_num {
+	enum {
+		INUM_UNBOUND = 0,  /* unbound to an inode*/
+		INUM_BOUND         /* we have an inode attached. */
+	}                 i_state;
 	struct list_head  i_list;
 	unsigned long     i_ino;
-	__u64             i_off;    /* fe->this_sector OR
+	__u64             i_voteoff;/* fe->this_sector OR
 				     * fe->extents[0].disk_off */
-	__u64             i_fe_off; /* used only for directory inodes,
+	__u64             i_feoff;  /* used only for directory inodes,
 				     * points to parent fe of
-				     * dirnode. for files i_off == i_fe_off,
+				     * dirnode. for files i_voteoff == i_feoff,
 				     * for root directory this is 0 */
-	atomic_t          i_refcnt; /* this is very short lived */
+	struct inode     *i_inode;  /* may be null! */
 } ocfs_inode_num;
 
 static inline ocfs_inode_num *ocfs_create_inode_num(void)
@@ -1179,7 +1183,9 @@
 	memset(inum, 0, sizeof(ocfs_inode_num));
 
 	INIT_LIST_HEAD(&inum->i_list);
-	atomic_set(&inum->i_refcnt, 1);
+	inum->i_state = INUM_UNBOUND;
+	inum->i_inode = NULL;
+	inum->i_voteoff = inum->i_feoff = 0;
 
 bail:
 	return(inum);
@@ -1234,6 +1240,7 @@
 	struct list_head *iter = NULL;
 	struct list_head *tmpiter = NULL;
 	ocfs_inode_num *inum;
+	LIST_HEAD(tmp);
 
 	LOG_ENTRY();
 
@@ -1247,15 +1254,10 @@
 
 		list_for_each_safe(iter, tmpiter, head) {
 			inum = list_entry(iter, ocfs_inode_num, i_list);
-			if (atomic_read(&inum->i_refcnt) != 1)
-				LOG_TRACE_ARGS("inum %lu has refcount %u "
-					       "(offset = %u.%u)\n",
-					       inum->i_ino, 
-					       atomic_read(&inum->i_refcnt),
-					       HILO(inum->i_off));
 
 			list_del(&inum->i_list);
-			ocfs_free_inode_num(inum);
+			list_add(&inum->i_list, &tmp);
+
 			retval++;
 			h->num_ents--;
 		}
@@ -1263,6 +1265,15 @@
 
 	spin_unlock(&h->lock);
 
+	list_for_each_safe(iter, tmpiter, &tmp) {
+		inum = list_entry(iter, ocfs_inode_num, i_list);
+		list_del(&inum->i_list);
+
+		if (inum->i_inode)
+			iput(inum->i_inode);
+		ocfs_free_inode_num(inum);
+	}
+
 	LOG_EXIT_STATUS(retval);
 	return retval;
 } /* ocfs_inode_hash_prune_all */
@@ -1310,7 +1321,6 @@
 		BUG();
 
 	bucket = OCFS_INODE_HASH(h, off);
-	LOG_TRACE_ARGS("off = %u.%u, bucket = %d\n", HILO(off), bucket);
 
 	head = &h->hash[bucket];
 
@@ -1320,7 +1330,7 @@
 	list_for_each(iter, head) {
 		inum = list_entry(iter, ocfs_inode_num, i_list);
 
-		if (inum->i_off == off)
+		if (inum->i_voteoff == off)
 			break;
 		inum = NULL;
 	}
@@ -1329,36 +1339,80 @@
 	return(inum);
 } /* __ocfs_inode_hash_lookup */
 
-/* 
- * ocfs_inode_hash_lookup()
- * 
- * lookup an offset in the hash. return '0' if it doesn't exist or error,
- * otherwise return the inode number and (optionally) the fe_off. You
- * have no guaruntee that it will stay in the hash after this call, or
- * that it won't get inserted either! */
-unsigned long ocfs_inode_hash_lookup(ocfs_inode_hash *h, 
-				     __u64 offset, 
-				     __u64 *fe_off)
+static ocfs_inode_num * __ocfs_inode_hash_rev_lookup(ocfs_inode_hash *h, 
+						     __u64 feoff)
 {
-	unsigned long ino = 0;
 	ocfs_inode_num *inum = NULL;
+	int bucket;
+	struct list_head *head;
+	struct list_head *iter = NULL;
 
-	LOG_ENTRY_ARGS("(offset=%u.%u)\n", HILO(offset));
+	if (spin_trylock(&h->lock))
+		BUG();
 
+	for(bucket = 0; bucket < h->size; bucket++) {
+		head = &h->hash[bucket];
+
+		if (list_empty(head))
+			continue;
+
+		list_for_each(iter, head) {
+			inum = list_entry(iter, ocfs_inode_num, i_list);
+
+			if (inum->i_feoff == feoff)
+				break;
+			inum = NULL;
+		}
+		
+		if (inum)
+			break;
+	}
+
+	return(inum);
+} /* __ocfs_inode_hash_rev_lookup */
+
+/*
+ *
+ * reverse means we're not sure if the voteoff is really the voteoff
+ * or the fe_off, so double check the hash.
+ */
+struct inode *ocfs_inode_hash_lookup(ocfs_super *osb, 
+				     __u64 voteoff, 
+				     bool reverse)
+{
+	ocfs_inode_num *inum = NULL;
+	ocfs_inode_hash *h = &osb->inode_hash;
+	struct inode * inode = NULL;
+
+//	LOG_ENTRY_ARGS("(voteoff=%u.%u, reverse = %s)\n", HILO(voteoff),
+//		       reverse ? "true" : "false");
+
+search:
 	spin_lock(&h->lock);
+	
+	inum = __ocfs_inode_hash_lookup(h, voteoff);
+	if (!inum && reverse) {
+		inum = __ocfs_inode_hash_rev_lookup(h, voteoff);
+	}
 
-	inum = __ocfs_inode_hash_lookup(h, offset);
 	if (inum) {
-		ino = inum->i_ino;
-		if (fe_off)
-			*fe_off = inum->i_fe_off;
+		if (inum->i_state == INUM_UNBOUND) {
+			spin_unlock(&h->lock);
+			LOG_TRACE_STR("waiting for inum to be bound");
+
+			yield();
+			goto search;
+		}
+
+		inode = inum->i_inode;
+		atomic_inc(&inode->i_count);
 	}
 
 	spin_unlock(&h->lock);
 
-	LOG_EXIT_ULONG(ino);
-	return(ino);
-} /* ocfs_inode_hash_lookup */
+//	LOG_EXIT_PTR(inode);
+	return(inode);
+}
 
 /*
  * ocfs_inode_hash_insert()
@@ -1369,18 +1423,18 @@
  */
 unsigned long ocfs_inode_hash_insert(ocfs_super *osb,
 				     __u64 offset,
-				     __u64 fe_off,
-				     unsigned long ino)
+				     __u64 fe_off)
 {
 	ocfs_inode_hash *h = &osb->inode_hash;
 	ocfs_inode_num *inum = NULL;
 	ocfs_inode_num *new_inum = NULL;
 	struct list_head *head;
 	int bucket;
-	unsigned long retval = ino;
+	unsigned long ino = 0;
+	struct super_block *sb = osb->sb;
 
-	LOG_ENTRY_ARGS("(offset = %u.%u, ino = %lu, fe_off = %u.%u)\n", 
-		       HILO(offset), ino, HILO(fe_off));
+	LOG_ENTRY_ARGS("(offset = %u.%u, fe_off = %u.%u)\n", 
+		       HILO(offset), HILO(fe_off));
 
 again:
 	spin_lock(&h->lock);
@@ -1388,16 +1442,16 @@
 	inum = __ocfs_inode_hash_lookup(h, offset);
 
 	/* whoa, offset better be the same! */
-	if (inum && (inum->i_off != offset)) {
-		LOG_ERROR_ARGS("inum=%p, i_off=%u.%u, offset=%u.%u)\n",
-			       inum, inum ? inum->i_off : 0ULL,
+	if (inum && (inum->i_voteoff != offset)) {
+		LOG_ERROR_ARGS("inum=%p, i_voteoff=%u.%u, offset=%u.%u)\n",
+			       inum, inum ? inum->i_voteoff : 0ULL,
 			       offset);
 		BUG();
 	}
 
-	if (inum && (inum->i_fe_off != fe_off)) {
-		LOG_ERROR_ARGS("inum=%p, i_fe_off=%u.%u, fe_off=%u.%u)\n",
-			       inum, inum ? inum->i_fe_off : 0ULL,
+	if (inum && (inum->i_feoff != fe_off)) {
+		LOG_ERROR_ARGS("inum=%p, i_feoff=%u.%u, fe_off=%u.%u)\n",
+			       inum, inum ? inum->i_feoff : 0ULL,
 			       fe_off);
 		BUG();
 	}
@@ -1417,9 +1471,15 @@
 	 * create it now and go back up to try an insert. */
 	if (inum == NULL && new_inum == NULL) {
 		new_inum = ocfs_create_inode_num();
+
+		/* root inode always has the same inode number. */
+		if (offset == osb->vol_layout.root_start_off)
+			ino = OCFS_ROOT_INODE_NUMBER;
+		else
+			ino = iunique(sb, OCFS_ROOT_INODE_NUMBER);
 		new_inum->i_ino = ino;
-		new_inum->i_off = offset;
-		new_inum->i_fe_off = fe_off;
+		new_inum->i_voteoff = offset;
+		new_inum->i_feoff = fe_off;
 
 		goto again;
 	}
@@ -1431,19 +1491,80 @@
 		new_inum = NULL;
 	}
 
+	/* if we never did an insert, then return the looked up ino. */
 	if (inum)
-		retval = inum->i_ino;
+		ino = inum->i_ino;
 
-	if (retval != ino)
-		LOG_TRACE_ARGS("Returning a different i_ino! "
-			       "(offset = %u.%u, passed ino = %lu, "
-			       "returned = %lu\n", HILO(offset), ino, retval);
+	LOG_EXIT_ULONG(ino);
 
-	LOG_EXIT_ULONG(retval);
-
-	return retval;
+	return ino;
 } /* ocfs_inode_hash_insert */
 
+/*
+ * bind an inode to an inum.
+ */
+void ocfs_inode_hash_bind(ocfs_super *osb, __u64 voteoff, struct inode *inode)
+{
+	ocfs_inode_hash *h = &osb->inode_hash;
+	ocfs_inode_num *inum = NULL;
+
+	LOG_ENTRY_ARGS("(voteoff=%u.%u, inode->i_ino = %lu)\n",
+		       HILO(voteoff), inode->i_ino);
+
+	spin_lock(&h->lock);
+
+	inum = __ocfs_inode_hash_lookup(h, voteoff);
+
+	if (!inum) {
+		printk("ocfs: lost inum, offset = %u.%u, inode->i_ino = %lu\n",
+		       HILO(voteoff), inode->i_ino);
+
+		BUG();
+	}
+
+	if ((inum->i_voteoff != voteoff) 
+	    || (GET_INODE_VOTEOFF(inode) != voteoff)) {
+		LOG_ERROR_ARGS("passed=%u.%u, on inode=%u.%u, "
+			       "(inum voteoff = %u.%u, feoff = %u.%u)\n",
+			       HILO(voteoff), HILO(GET_INODE_VOTEOFF(inode)),
+			       HILO(inum->i_voteoff), HILO(inum->i_feoff));
+		BUG();
+	}
+
+	if (inum->i_ino != inode->i_ino) {
+		LOG_ERROR_ARGS("inode numbers don't match! "
+			       "(inum=%lu, inode=%lu)\n", 
+			       inum->i_ino, inode->i_ino);
+		LOG_ERROR_ARGS("passed=%u.%u, on inode=%u.%u, "
+			       "(inum voteoff = %u.%u, feoff = %u.%u)\n",
+			       HILO(voteoff), HILO(GET_INODE_VOTEOFF(inode)),
+			       HILO(inum->i_voteoff), HILO(inum->i_feoff));
+		BUG();
+	}
+
+	if (inum->i_state == INUM_UNBOUND) {
+		inum->i_inode = inode;
+		inum->i_state = INUM_BOUND;
+		atomic_inc(&inode->i_count);
+
+		LOG_TRACE_ARGS("bound to ino %lu, voteoff=%u.%u, "
+			       "feoff=%u.%u\n", inode->i_ino, 
+			       HILO(inum->i_voteoff), HILO(inum->i_feoff));
+	} else if (inum->i_inode != inode) {
+		LOG_ERROR_ARGS("Inum is bound to a different inode!"
+			       "(%u.%u) (%lu) (%lu)\n",
+			       HILO(voteoff), inode->i_ino, 
+			       inum->i_inode->i_ino);
+		BUG();
+	}
+
+
+	spin_unlock(&h->lock);
+
+	LOG_EXIT();
+	return;
+}
+
 /* 
  * __ocfs_hash_remove()
  *
@@ -1462,12 +1583,8 @@
 		BUG();
 	}
 
-	if (atomic_dec_and_test(&inum->i_refcnt)) {
-		list_del(&inum->i_list);
-		h->num_ents--;
-	} else {
-		inum = NULL;
-	}
+	list_del(&inum->i_list);
+	h->num_ents--;
 
 	return(inum);
 } /* __ocfs_hash_remove */
@@ -1487,9 +1604,11 @@
 
 	spin_unlock(&h->lock);
 
-	if (inum)
-		ocfs_free(inum);
+	if (inum->i_inode)
+		iput(inum->i_inode);
 
+	ocfs_free(inum);
+
 	LOG_EXIT();
 	return;
 } /* ocfs_inode_hash_remove */
@@ -1510,6 +1629,7 @@
 {
 	int status = 0;
 	ocfs_inode_num *inum = NULL;
+	ocfs_inode_num *target = NULL;
 	struct list_head *head;
 	int bucket;
 
@@ -1519,14 +1639,30 @@
 
 	spin_lock(&h->lock);
 
+	/* Sanity check. If we're going to be moving buckets, make
+	 * sure someone else isn't in the new one. */
+	if (newoff != oldoff) {
+		target = __ocfs_inode_hash_lookup(h, newoff);
+		if (target) {
+			LOG_ERROR_ARGS("Rehashing on top of an existing inum!"
+				       "oldoff = %u.%u, newoff = %u.%u\n", 
+				       HILO(oldoff),
+				       HILO(newoff));
+			BUG();
+		}
+	}
+
 	inum = __ocfs_inode_hash_lookup(h, oldoff);
 	if (inum == NULL)
 		BUG();
 
+	if (inum->i_state != INUM_BOUND)
+		BUG();
+
 	list_del(&inum->i_list);
 
-	inum->i_off = newoff;
-	inum->i_fe_off = new_fe_off;
+	inum->i_voteoff = newoff;
+	inum->i_feoff = new_fe_off;
 
 	bucket = OCFS_INODE_HASH(h, newoff);
 	head = &h->hash[bucket];
@@ -1561,29 +1697,19 @@
 /* 
  * ocfs_get_inode_from_offset()
  *
- * Ok, because we don't have inode->i_sem when going into this, things
- * are a bit tricky. Basically the kernel can call clear_inode on it
- * while we're lookup up the inode number. Clear inode will call
- * remove, and though we've got a number, it'll have been deleted from
- * the hash. So we up a refcount on the inode_num to avoid it being
- * deleted during remove. This doesn't prevent the inode itself from
- * being removed however, and we might have to recreate it. 
+ * If you call this on an offset, you MUST make sure that it won't be
+ * deleted out from underneath us.
  */
 struct inode *ocfs_get_inode_from_offset(ocfs_super *osb, 
 					 __u64 offset, 
 					 struct buffer_head *fe_bh)
 {
 	struct inode *inode = NULL;
-	ocfs_inode_num *inum = NULL;
-	ocfs_inode_num *new_inum = NULL;
 	struct super_block *sb = osb->sb;
-	unsigned long new_ino = 0;
-	ocfs_inode_hash *h = &(osb->inode_hash);
-	int bucket;
-	struct list_head *head;
-	ocfs_find_inode_args args;
+	unsigned long ino = 0;
 	__u64 fe_off;
 	ocfs_file_entry *fe;
+	ocfs_find_inode_args args;
 
 	LOG_ENTRY_ARGS("(offset = %u.%u)\n", HILO(offset));
 
@@ -1632,70 +1758,41 @@
 	fe_off = fe->this_sector;
 	OCFS_BH_PUT_DATA(fe_bh);
 
-	/* this is allowed to be slow. Create the inode num 1st to
-	 * simplify stuff.*/
-	new_inum = ocfs_create_inode_num();
-	if (new_inum == NULL) {
-		LOG_ERROR_STATUS(-ENOMEM);
-		goto bail;
-	}
+	inode = ocfs_inode_hash_lookup(osb, offset, false);
+	if (!inode) {
+		/* we should put this guy in the hash now... */
+		LOG_TRACE_STR("calling iget4");
 
-	spin_lock(&h->lock);
+		args.offset = fe_off;
+		args.fe_bh = fe_bh;
 
-	inum = __ocfs_inode_hash_lookup(h, offset);
-	LOG_TRACE_ARGS("return from lookup, inum=0x%x\n", inum);
-
-	/* if not found, insert it into hash (create new one) and inc
-	 * refcount */
-	if (!inum) {
-		inum = new_inum;
-
-		new_ino = iunique(sb, OCFS_ROOT_INODE_NUMBER);
-		inum->i_ino = new_ino;
-		inum->i_off = offset;
-		inum->i_fe_off = fe_off;
-
-		LOG_TRACE_ARGS("Allocating a new inode number, "
-			       "(offset = %u.%u, i_ino = %lu\n", 
-			       HILO(offset), new_ino);
-
-		bucket = OCFS_INODE_HASH(h, offset);
-		head = &h->hash[bucket];
-		list_add(&inum->i_list, head);
-		h->num_ents++;
-	}
-
-	atomic_inc(&inum->i_refcnt);
-
-	spin_unlock(&h->lock);
-
-	if (inum != new_inum)
-		ocfs_free(new_inum);
-
-	/* call iget4, return inode */
-	args.offset = offset;
-	args.fe_bh = fe_bh;
-	args.file_lookup_only = false;
-	inode = iget4(sb, inum->i_ino, (find_inode_t) ocfs_find_inode, &args);
-	if (!inode || is_bad_inode (inode)) {
-		LOG_ERROR_STATUS(-EINVAL);
-		if (inode) {
-			iput(inode);
+		/* alright, allocate a new inode number for this guy
+		 * and insert it into the hash. It's not bound yet --
+		 * read_inode2 binds the actual inode to it. */
+		ino = ocfs_inode_hash_insert(osb, offset, fe_off);
+#ifdef LINUX_2_5
+		inode = ocfs_iget (sb, &args);
+#else
+		inode =
+			iget4 (sb, ino,
+			       (find_inode_t) ocfs_find_inode, 
+			       (void *) (&args));
+#endif
+		if (inode == NULL) {
+			LOG_ERROR_STR("access error");
 			inode = NULL;
+			goto bail;
 		}
-		/* we want to cleanup after ourselves. */
-		atomic_dec(&inum->i_refcnt);
-		ocfs_inode_hash_remove(h, inum->i_off);
-		inum = NULL;
+		if (is_bad_inode (inode)) {
+			LOG_ERROR_STR("access error (bad inode)");
+			iput (inode);
+			inode = NULL;
+			goto bail;
+		}
 	}
 
+
 bail:
-	/* We don't have to worry about freeing the inum after this
-	 * dec because the inode cannot have been destroyed yet (it's
-	 * still got a refcount of at least 1) */
-	if (inum)
-		atomic_dec(&inum->i_refcnt);
-
 	if (inode)
 		LOG_TRACE_ARGS("returning inode with number %lu\n", 
 			       inode->i_ino);
@@ -1704,3 +1801,5 @@
 
 	return(inode);
 } /* ocfs_get_inode_from_offset */
+
+

Modified: trunk/src/inc/io.h
===================================================================
--- trunk/src/inc/io.h	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/inc/io.h	2004-01-29 07:58:15 UTC (rev 18)
@@ -16,11 +16,6 @@
 				  int                  flags, 
 				  struct inode        *inode);
 
-int ocfs_write_dirnode(ocfs_super * osb, struct buffer_head *bhs[],
-		      int flags, struct inode *hdr_inode);
-int ocfs_read_dirnode(ocfs_super * osb, __u64 off, struct buffer_head *bhs[],
-		      int flags, struct inode *hdr_inode);
-
 int ocfs_write_bhs (ocfs_super          *osb,
 		    struct buffer_head  *bh[], 
 		    int                  nr, 
@@ -33,6 +28,16 @@
 		    int                  flags, 
 		    struct inode         *inode);
 
+struct inode * ocfs_get_fileent_inode(ocfs_super *osb, int idx, struct buffer_head *bhs[], 
+				     struct inode *parent);
+
+void ocfs_put_fileent_inode(int idx, struct inode *arr[]);
+
+int ocfs_write_dirnode(ocfs_super * osb, struct buffer_head *bhs[], struct inode *hdr_inode);
+
+int ocfs_read_dirnode(ocfs_super * osb, __u64 off, bool sync, struct buffer_head *bhs[], struct inode *hdr_inode);
+
+
 void ocfs_end_buffer_io_sync     (struct buffer_head   *bh, 
 				  int                   uptodate);
 
@@ -40,7 +45,6 @@
 #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_CACHE_LOCK        16    /* For read only; better know what you are doing with this one! */
 
 
 #define OCFS_NONCACHED(osb,off)  ((off) < (osb)->vol_layout.data_start_off)

Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/inc/ocfs.h	2004-01-29 07:58:15 UTC (rev 18)
@@ -210,7 +210,8 @@
 typedef struct _ocfs_inode_private
 {
 	void *           generic_ip;
-	__u64            offset;
+	__u64            voteoff;
+//	__u64            feoff;
 //	struct list_head i_clean_buffers;
 	atomic_t         i_clean_buffer_seq;
 	__u8             deleted; /* this can be a generic flags field later */
@@ -228,12 +229,12 @@
 #define SET_INODE_DELETED(i) OCFS_GENERIC_IP(i)->deleted = 1
 #define CLEAR_INODE_DELETED(i) OCFS_GENERIC_IP(i)->deleted = 0
 
-#define SET_INODE_OFFSET(i,o)						      \
+#define SET_INODE_VOTEOFF(i,o)						      \
 do {									      \
-	OCFS_GENERIC_IP(i)->offset = o;					      \
+	OCFS_GENERIC_IP(i)->voteoff = o;				      \
 } while (0)
 
-#define GET_INODE_OFFSET(i) OCFS_GENERIC_IP(i)->offset
+#define GET_INODE_VOTEOFF(i) OCFS_GENERIC_IP(i)->voteoff
 
 #define CLEAR_INODE_OIN(i)						      \
 do {									      \
@@ -311,7 +312,7 @@
 #define  FLAG_FILE_UNUSED5        0x00008000
 #define  FLAG_FILE_UNUSED6        0x00010000
 #define  FLAG_DEL_NAME            0x00020000
-#define  FLAG_RESET_VALID         0x00040000
+#define  FLAG_DEL_INODE           0x00040000
 #define  FLAG_FILE_UNUSED7        0x00080000
 #define  FLAG_FILE_UNUSED8        0x00100000
 #define  FLAG_FILE_UNUSED9        0x00200000
@@ -2454,7 +2455,6 @@
 {
 	__u64 offset;
 	struct buffer_head *fe_bh;
-	bool file_lookup_only;
 }
 ocfs_find_inode_args;
 /* timeout structure taken from Ben's aio.c */
@@ -2570,6 +2570,18 @@
 	__ret;								  \
 })
 
+
+static inline int ocfs_get_max_dir_index(ocfs_dir_node *dir) 
+{
+	int i;
+	int ret = -1;
+	for (i=0; i<dir->num_ent_used; i++)
+		if ((int)dir->index[i] > ret)
+			ret = (int)dir->index[i];
+
+	return ret;
+}
+
 #include "proto.h"
 
 #endif /* !OCFS_H */

Modified: trunk/src/inc/proto.h
===================================================================
--- trunk/src/inc/proto.h	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/inc/proto.h	2004-01-29 07:58:15 UTC (rev 18)
@@ -6,7 +6,7 @@
 int ocfs_find_contiguous_space_from_bitmap (ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, bool sysfile, struct buffer_head *lock_bh);
 int ocfs_alloc_node_block (ocfs_super * osb, __u64 FileSize, __u64 * DiskOffset, __u64 * file_off, __u32 NodeNum, __u32 Type, ocfs_journal_handle *handle);
 int ocfs_free_directory_block (ocfs_super * osb, ocfs_file_entry * fe, ocfs_bitmap_free_head *free_head, struct inode *inode);
-int ocfs_free_file_extents (ocfs_super * osb, struct buffer_head *fe_bh, ocfs_bitmap_free_head *free_head);
+int ocfs_free_file_extents (ocfs_super * osb, struct buffer_head *fe_bh, ocfs_bitmap_free_head *free_head, struct inode *inode);
 
 
 int ocfs_wait_for_disk_lock_release (ocfs_super * osb, __u64 offset, __u32 time_to_wait, __u32 lock_type);
@@ -226,11 +226,10 @@
 
 int ocfs_inode_hash_init(ocfs_super *osb);
 void ocfs_inode_hash_destroy(ocfs_inode_hash *h);
-
 unsigned long ocfs_inode_hash_insert(ocfs_super *osb,
 				     __u64 offset,
-				     __u64 fe_off,
-				     unsigned long ino);
+				     __u64 fe_off);
+void ocfs_inode_hash_bind(ocfs_super *osb, __u64 voteoff, struct inode *inode);
 void ocfs_inode_hash_remove(ocfs_inode_hash *h, __u64 off);
 int ocfs_inode_rehash(ocfs_inode_hash *h, 
 		      __u64 oldoff, 
@@ -238,6 +237,6 @@
 		      __u64 new_fe_off);
 struct inode *ocfs_get_inode_from_offset(ocfs_super *osb, __u64 offset, 
 					 struct buffer_head *fe_bh);
-unsigned long ocfs_inode_hash_lookup(ocfs_inode_hash *h, 
-				     __u64 offset, 
-				     __u64 *fe_off);
+struct inode *ocfs_inode_hash_lookup(ocfs_super *osb, 
+				     __u64 voteoff, 
+				     bool reverse);

Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/inode.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -136,65 +136,60 @@
 		goto bail;
 	}
 
-	if (args->file_lookup_only == false) {
-		fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
-		if (S_ISDIR (inode->i_mode)) {
-			LOG_TRACE_STR ("find_inode -> S_ISDIR");
-			if (fe->extents[0].disk_off != fileOff) {
-				LOG_TRACE_ARGS
-			    	("DIR : inode number same but full offset does not match: %u.%u != %u.%u\n",
-			     	fe->extents[0].disk_off, fileOff);
-				goto bail;
-			}
-		} else if (args->offset != fileOff) {
+	fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
+	if (S_ISDIR (inode->i_mode)) {
+		LOG_TRACE_STR ("find_inode -> S_ISDIR");
+		if (fe->extents[0].disk_off != fileOff) {
 			LOG_TRACE_ARGS
-		    	("FILE : inode number same but full offset does not match: %u.%u != %u.%u\n",
-		     	args->offset, fileOff);
+		    	("DIR : inode number same but full offset does not match: %u.%u != %u.%u\n",
+		     	fe->extents[0].disk_off, fileOff);
 			goto bail;
 		}
+	} else if (args->offset != fileOff) {
+		LOG_TRACE_ARGS
+	    	("FILE : inode number same but full offset does not match: %u.%u != %u.%u\n",
+	     	args->offset, fileOff);
+		goto bail;
+	}
 	
 #ifdef REPOPULATE_INODE
-		/* not sure if this is appropriate, but we have the most 
-	 	* current file entry so why not use it? */
-		mode = fe->prot_bits;
-	
-		switch (fe->attribs) {
-	    	case OCFS_ATTRIB_DIRECTORY:
-		    	mode |= S_IFDIR;
-		    	break;
-	    	case OCFS_ATTRIB_CHAR:
-		    	mode |= S_IFCHR;
-		    	inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
-		    	break;
-	    	case OCFS_ATTRIB_BLOCK:
-		    	mode |= S_IFBLK;
-		    	inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
-		    	break;
-	    	case OCFS_ATTRIB_FIFO:
-		    	mode |= S_IFIFO;
-		    	break;
-	    	case OCFS_ATTRIB_SYMLINK:
-		    	mode |= S_IFLNK;
-		    	break;
-	    	case OCFS_ATTRIB_SOCKET:
-		    	mode |= S_IFSOCK;
-		    	break;
-	    	case OCFS_ATTRIB_REG:
-	    	default:
-		    	mode |= S_IFREG;
-		    	break;
-		}
-		oin = NULL;		/* set it back to our current OIN if we have one */
-		if (inode_data_is_oin (inode))
-			oin = GET_INODE_OIN(inode);
-	
-		ocfs_populate_inode (inode, fe, mode, oin, false);
-#endif /* REPOPULATE_INODE */
-	} else {
-		if (args->offset != fileOff)
-			goto bail;
+	/* not sure if this is appropriate, but we have the most 
+ 	* current file entry so why not use it? */
+	mode = fe->prot_bits;
+
+	switch (fe->attribs) {
+    	case OCFS_ATTRIB_DIRECTORY:
+	    	mode |= S_IFDIR;
+	    	break;
+    	case OCFS_ATTRIB_CHAR:
+	    	mode |= S_IFCHR;
+	    	inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
+	    	break;
+    	case OCFS_ATTRIB_BLOCK:
+	    	mode |= S_IFBLK;
+	    	inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
+	    	break;
+    	case OCFS_ATTRIB_FIFO:
+	    	mode |= S_IFIFO;
+	    	break;
+    	case OCFS_ATTRIB_SYMLINK:
+	    	mode |= S_IFLNK;
+	    	break;
+    	case OCFS_ATTRIB_SOCKET:
+	    	mode |= S_IFSOCK;
+	    	break;
+    	case OCFS_ATTRIB_REG:
+    	default:
+	    	mode |= S_IFREG;
+	    	break;
 	}
+	oin = NULL;		/* set it back to our current OIN if we have one */
+	if (inode_data_is_oin (inode))
+		oin = GET_INODE_OIN(inode);
 
+	ocfs_populate_inode (inode, fe, mode, oin, false);
+#endif /* REPOPULATE_INODE */
+
 	ret = 1;
 bail:
 	if (fe)
@@ -225,7 +220,6 @@
 
 	if (!IS_VALID_FILE_ENTRY(fe)) {
 		printk("ocfs: invalid file entry!\n");
-
 		BUG();
 	}
 
@@ -246,13 +240,12 @@
 	else
 		CLEAR_INODE_OIN(inode);
 
-	SET_INODE_OFFSET(inode, offset);
+	SET_INODE_VOTEOFF(inode, offset);
 
 	if (create_ino) {
-		uniq_ino = iunique(sb, OCFS_ROOT_INODE_NUMBER);
-		uniq_ino = ocfs_inode_hash_insert(osb, offset, fe_off, 
-						  uniq_ino);
+		uniq_ino = ocfs_inode_hash_insert(osb, offset, fe_off);
 		inode->i_ino = uniq_ino;
+		/* caller needs to know to call inode_hash_bind! */
 	}
 	LOG_TRACE_ARGS("offset = %u.%u, ino = %lu, create_ino = %s\n",
 		       HILO(offset), inode->i_ino, 
@@ -331,7 +324,7 @@
 		inode->i_uid = osb->vol_layout.uid;
 		inode->i_gid = osb->vol_layout.gid;
 		SET_INODE_OIN (inode, osb->oin_root_dir);
-		SET_INODE_OFFSET(inode, osb->vol_layout.root_start_off);
+		SET_INODE_VOTEOFF(inode, osb->vol_layout.root_start_off);
 		goto bail;
 	}
 
@@ -395,6 +388,7 @@
 	ocfs_inode *newoin;
 	umode_t mode;
 	ocfs_file_entry *fe = NULL;
+	__u64 voteoff;
 
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x)\n", inode, opaque);
 
@@ -422,7 +416,8 @@
 		inode->i_uid = osb->vol_layout.uid;
 		inode->i_gid = osb->vol_layout.gid;
 		SET_INODE_OIN (inode, osb->oin_root_dir);
-		SET_INODE_OFFSET(inode, osb->vol_layout.root_start_off);
+		SET_INODE_VOTEOFF(inode, osb->vol_layout.root_start_off);
+		ocfs_inode_hash_bind(osb, GET_INODE_VOTEOFF(inode), inode);
 		goto bail;
 	}
 
@@ -433,6 +428,9 @@
 
 	args = (ocfs_find_inode_args *) opaque;
 	newoin = NULL;
+	if (args->fe_bh == NULL)
+		BUG();
+
 	fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
 
 	mode = fe->prot_bits;
@@ -465,6 +463,9 @@
 	}
 	ocfs_populate_inode (inode, fe, mode, newoin, false);
 
+	voteoff = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
+	ocfs_inode_hash_bind(osb, voteoff, inode);
+
 bail:
 	if (fe)
 		OCFS_BH_PUT_DATA(args->fe_bh);
@@ -519,25 +520,20 @@
 		goto bail;
 	}
 
-	if (args->file_lookup_only == false) {
-		if (S_ISDIR (inode->i_mode)) {
-			LOG_TRACE_STR ("find_actor -> S_ISDIR\n");
-			fe = OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
-			if (fe->extents[0].disk_off != fileOff) {
-				LOG_TRACE_ARGS
-			    	("DIR : inode number same but full offset does not match: %u.%u != %u.%u\n",
-			     	fe->extents[0].disk_off, fileOff);
-				goto bail;
-			}
-		} else if (args->offset != fileOff) {
+	if (S_ISDIR (inode->i_mode)) {
+		LOG_TRACE_STR ("find_actor -> S_ISDIR\n");
+		fe = OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
+		if (fe->extents[0].disk_off != fileOff) {
 			LOG_TRACE_ARGS
-		    	("FILE : inode number same but full offset does not match: %u.%u != %u.%u\n",
-		     	args->offset, fileOff);
+		    	("DIR : inode number same but full offset does not match: %u.%u != %u.%u\n",
+		     	fe->extents[0].disk_off, fileOff);
 			goto bail;
 		}
-	} else {
-		if (args->offset != fileOff)
-			goto bail;
+	} else if (args->offset != fileOff) {
+		LOG_TRACE_ARGS
+	    	("FILE : inode number same but full offset does not match: %u.%u != %u.%u\n",
+	     	args->offset, fileOff);
+		goto bail;
 	}
 
 	ret = 1;
@@ -630,8 +626,11 @@
  */
 void ocfs_put_inode (struct inode *inode)
 {
+	ocfs_super *osb;
+
 	LOG_ENTRY_ARGS ("(0x%08x, inode_i_ino=%lu)\n", inode, inode->i_ino);
 	LOG_TRACE_ARGS ("put_inode: count=%d\n", inode->i_count);
+	osb = OCFS_GENERIC_SB_P(inode->i_sb);
 	if (inode_data_is_oin(inode) && (atomic_read (&inode->i_count) == 1) ) {
 	     ocfs_inode *oin;
 	     oin = GET_INODE_OIN(inode);
@@ -639,6 +638,21 @@
 	     ocfs_extent_map_init (&oin->map);
 	     //dump_inode_clean_queue_buffers(inode);
 	} 
+	/* Ok, if after this iput we would be the last holder of the
+	 * root inode, then we know we're unmounting so just dump it
+	 * now. */
+	if ((inode->i_ino == OCFS_ROOT_INODE_NUMBER) 
+	    && (atomic_read(&inode->i_count) == 2)) {
+		LOG_TRACE_STR("Oop, iputing the root inode!");
+		/* this is fun. Bring up the refcount for our call to
+		 * hash_remove so the iput inside of that function
+		 * doesn't throw us into recursion :) */
+		atomic_inc(&inode->i_count);
+		ocfs_inode_hash_remove(&osb->inode_hash, 
+				       GET_INODE_VOTEOFF(inode));
+		atomic_dec(&inode->i_count);
+	}
+
 	LOG_EXIT ();
 	return;
 }				/* ocfs_put_inode */
@@ -714,6 +728,7 @@
 			LOG_TRACE_STR("hashtable has already been destroyed.");
 		}
 	}
+#if 0
 	/* we may be called after unmount, in which case
 	 * don't do this. */
 	if (osb->inode_hash.size) {
@@ -724,6 +739,7 @@
 				       "skipping call to hash_remove\n",
 				       inode->i_ino, HILO(offset));
 	}
+#endif
 
 bail:
 	LOG_EXIT ();
@@ -1528,9 +1544,7 @@
                                         totalioblocks += blocks;
 				}
                         } else {
-				printk(
-				       "ocfs_rw_direct : brw_kiovec() %d\n",
-				       err);	
+				printk( "ocfs_rw_direct : brw_kiovec() %d\n", err);	
 				break;
 			}
                         unmap_kiobuf (iobuf);

Modified: trunk/src/io.c
===================================================================
--- trunk/src/io.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/io.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -35,112 +35,144 @@
 				  int nr, int flags, struct inode *inodes[]);
 
 
+void ocfs_put_fileent_inode(int idx, struct inode **arr)
+{
+	switch (idx) {
+		case 0:
+		case 255:
+			break;
+		default:
+			/* release the ref from the get */
+			if (arr[idx])
+				iput(arr[idx]);
+			break;
+	}
+}
+
+struct inode * ocfs_get_fileent_inode(ocfs_super *osb, int idx, struct buffer_head *bhs[], 
+					     struct inode *parent)
+{
+	unsigned long top = bhs[0]->b_blocknr;
+	struct inode *retval = NULL;
+
+	switch (idx) {
+		case 0:
+		case 255:
+			retval = parent;
+			break;
+		default:
+			/* this will iget() the inode if non-NULL */
+			retval = ocfs_inode_hash_lookup(osb, (top+idx) << 9, true);
+			break;
+	}
+	return retval;
+}
+
+/* caching for dirnodes is now straighforward */
+/* if there is an inode for a given offset, use its seqnum to determine caching */
+/* if there is no inode, then it is definitely a sync read (barring buffer_jbd) */
+
 int ocfs_write_dirnode(ocfs_super * osb, struct buffer_head *bhs[],
-		      int flags, struct inode *hdr_inode)
+		      struct inode *hdr_inode)
 {
 	int status, i;
 	struct inode **arr = NULL;
 	struct inode *inode;
 	__u64 tmpoff;
-	unsigned long ino = 0;
-	ocfs_find_inode_args args;
+	
+	LOG_ENTRY();
 
 	arr = (struct inode **) ocfs_malloc (256 * sizeof(struct inode *));
-	if (arr == NULL) {
+	if (!arr) {
 		LOG_ERROR_STATUS(status = -ENOMEM);
 		goto bail;
 	}
 
-	arr[0] = hdr_inode;
-	for (i=1, tmpoff = (bhs[i]->b_blocknr << 9); i< 256; i++, tmpoff += 512ULL) {
-		inode = NULL;
-		ino = ocfs_inode_hash_lookup(&osb->inode_hash, tmpoff, NULL);
-		if (ino) {
-			args.offset = tmpoff;
-			args.fe_bh = bhs[i];
-			args.file_lookup_only = true;
-			inode = iget4(osb->sb, ino, (find_inode_t) ocfs_find_inode, &args);
-			if (!inode || is_bad_inode (inode)) {
-				LOG_ERROR_STATUS(-EINVAL);
-				if (inode) {
-					iput(inode);
-					inode = NULL;
-				}
-			}
-		}
-		arr[i] = inode;
-	}
+	for (i=0; i< 256; i++)
+		arr[i] = ocfs_get_fileent_inode(osb, i, bhs, hdr_inode);
+		
+	status = ocfs_write_bhs_iarr (osb, bhs, 256, 0, arr);
+	if (status < 0)
+		LOG_ERROR_STATUS(status);
 
-	status = ocfs_write_bhs_iarr (osb, bhs, 256, flags, arr);
-	
-	for (i=1; i< 256; i++) {
-		inode = arr[i];
-		if (inode)
-			iput(inode);
-	}
+	for (i=0; i<256; i++)
+		ocfs_put_fileent_inode(i, arr);
+	ocfs_safefree(arr);
 
 bail:
-	ocfs_safefree(arr);
+	LOG_EXIT_STATUS(status);	
 	return status;
 }
 
-
-
-int ocfs_read_dirnode(ocfs_super * osb, __u64 off, struct buffer_head *bhs[],
-		      int flags, struct inode *hdr_inode)
+int ocfs_read_dirnode(ocfs_super * osb, __u64 off, bool sync, 
+		      struct buffer_head *bhs[], struct inode *hdr_inode)
 {
-	int status, i;
+	int status, i, max, total=1;
 	struct inode **arr = NULL;
-	struct inode *inode;
-	__u64 tmpoff;
-	unsigned long ino = 0;
-	ocfs_find_inode_args args;
+	ocfs_dir_node *dir;
+	unsigned long blk;
 
-	arr = (struct inode **) ocfs_malloc (256 * sizeof(struct inode *));
-	if (arr == NULL) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+	LOG_ENTRY();
+
+	if (sync) {
+		status = ocfs_read_bhs (osb, off, osb->vol_layout.dir_node_size,
+					bhs, 0, hdr_inode);
+		if (status < 0)
+			LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
-	arr[0] = hdr_inode;
-	for (i=1, tmpoff=off+512ULL; i< 256; i++, tmpoff += 512ULL) {
-		inode = NULL;
-		ino = ocfs_inode_hash_lookup(&osb->inode_hash, tmpoff, NULL);
-		if (ino) {
-			args.offset = tmpoff;
-			args.fe_bh = bhs[i];
-			args.file_lookup_only = true;
-			inode = iget4(osb->sb, ino, (find_inode_t) ocfs_find_inode, &args);
-			if (!inode || is_bad_inode (inode)) {
-				LOG_ERROR_STATUS(-EINVAL);
-				if (inode) {
-					iput(inode);
-					inode = NULL;
-				}
-			}
-		}
-		arr[i] = inode;
+
+	status = ocfs_read_bh (osb, off, &bhs[0], OCFS_BH_CACHED, hdr_inode);
+	if (status < 0) {
+		LOG_ERROR_STATUS(status);
+		goto bail;
 	}
 
-	status = ocfs_read_bhs_iarr (osb, off, osb->vol_layout.dir_node_size,
-				 bhs, flags, arr);
+	dir = (ocfs_dir_node *) OCFS_BH_GET_DATA_READ(bhs[0]);
+	max = ocfs_get_max_dir_index(dir);
+	max++; // zero-indexed
+	OCFS_BH_PUT_DATA(bhs[0]);
+
+	if (max > 0) {
+		total = max+1;
+		arr = (struct inode **) ocfs_malloc (total * sizeof(struct inode *));
+		if (!arr) {
+			LOG_ERROR_STATUS(status = -ENOMEM);
+			goto bail;
+		}
 	
-	for (i=1; i< 256; i++) {
-		inode = arr[i];
-		if (inode)
-			iput(inode);
+		for (i=0; i<total; i++) {
+			arr[i] = ocfs_get_fileent_inode(osb, i, bhs, hdr_inode);
+		}
+	
+		/* read only as many blocks as maximum of dir index */
+		status = ocfs_read_bhs_iarr (osb, 
+					     off+512ULL, 
+					     (total-1) << 9, 
+					     &bhs[1], 
+					     OCFS_BH_CACHED, 
+					     &arr[1]);
+		if (status < 0)
+			LOG_ERROR_STATUS(status);
+	
+		for (i=0; i<total; i++)
+			ocfs_put_fileent_inode(i, arr);
+	
+		ocfs_safefree(arr);
+	} else {
+		total = 1;
 	}
-
+	
+	/* fill in the remainder of the blocks not read from disk */
+	for (i=total, blk = ((unsigned long)(off >> 9) + total); i<256; i++, blk++)
+		bhs[i] = getblk (OCFS_GET_BLOCKDEV(osb->sb), blk, 512);
 bail:
-	ocfs_safefree(arr);
+	LOG_EXIT_STATUS(status);
 	return status;
 }
 
 
-
-
-
-
 static int ocfs_write_bhs_iarr (ocfs_super * osb, struct buffer_head *bhs[], 
 				  int nr, int flags, struct inode *inodes[])
 {
@@ -365,10 +397,6 @@
 		if ((flags & OCFS_BH_CACHED) && (!buffer_uptodate(bh)))
 			ignore_cache = 1;
 
-		/* explicitly do not reread from disk */
-		if (flags & OCFS_BH_CACHE_LOCK)
-			ignore_cache = 0;
-
 		if (buffer_jbd(bh)) {
 #ifdef VERBOSE_BH_JBD_TRACE
 			if (!(flags & OCFS_BH_CACHED) || ignore_cache)

Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/journal.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -890,7 +890,6 @@
 	/* Ok, look up the inode for our journal */
 	args.offset = fe->this_sector;
 	args.fe_bh = bh;
-	args.file_lookup_only = false;
 	LOG_TRACE_ARGS("fe->this_sector = %u.%u\n", HI(fe->this_sector), 
 		       LO(fe->this_sector));
 	OCFS_BH_PUT_DATA(bh);
@@ -1504,7 +1503,6 @@
 	/* Ok, look up the inode for our journal */
 	args.offset = fe->this_sector;
 	args.fe_bh = bh;
-	args.file_lookup_only = false;
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #ifdef LINUX_2_5

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/namei.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -42,6 +42,8 @@
 	struct super_block *sb = dir->i_sb;
 	struct dentry *ret;
 	ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+	unsigned long ino;
+	__u64 inode_off;
 
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", dir, dentry,
                         dentry->d_name.len, dentry->d_name.name);
@@ -60,49 +62,46 @@
 		goto bail;
 	}
 
-//	fe = ocfs_allocate_file_entry();
-//	if (!fe) {
-//		LOG_ERROR_STR("could not allocate file entry");
-//		ret = ERR_PTR (-ENOMEM);
-//		goto bail;
-//	}
-	
 	LOG_TRACE_ARGS("about to call find_files_on_disk with inode=%08x\n", dir);
-		
+
 	status = ocfs_find_files_on_disk (osb, parentOffset, &(dentry->d_name), 
 					  &fe_bh, NULL, dir, true);
-	if (status >= 0) {
-		unsigned long ino;
-		__u64 inode_off;
+	if (status < 0)
+		goto bail_add;
+	
+	fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(fe_bh); /* read */
+	if (!IS_VALID_FILE_ENTRY(fe)) {
+		printk("ocfs: invalid file entry!  parent=%u.%u, name='%*s'\n",
+		       parentOffset, dentry->d_name.len, dentry->d_name.name);
+		BUG();
+	}
 
-		fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(fe_bh); /* read */
-		args.offset = fe->this_sector;
-//		args.entry = fe;
-		args.fe_bh = fe_bh;
-		args.file_lookup_only = false;
-		if (fe->attribs & OCFS_ATTRIB_DIRECTORY)
-			inode_off = fe->extents[0].disk_off;
-		else
-			inode_off = fe->this_sector;
+	args.offset = fe->this_sector;
+	args.fe_bh = fe_bh;
+	if (fe->attribs & OCFS_ATTRIB_DIRECTORY)
+		inode_off = fe->extents[0].disk_off;
+	else
+		inode_off = fe->this_sector;
+	fe_off = fe->this_sector;
+	OCFS_BH_PUT_DATA(fe_bh);
+	fe = NULL;
 
-		fe_off = fe->this_sector;
-		OCFS_BH_PUT_DATA(fe_bh);
-
-		fe = NULL;
+	/* first, check if we've already got an inode in the hash. */
+	inode = ocfs_inode_hash_lookup(osb, inode_off, false);
+	if (!inode) {
 		/* we should put this guy in the hash now... */
-
 		LOG_TRACE_STR("calling iget4");
 		/* alright, allocate a new inode number for this guy
-		 * and insert it into the hash. */
-		ino = iunique(osb->sb, OCFS_ROOT_INODE_NUMBER);
-		ino = ocfs_inode_hash_insert(osb, inode_off, fe_off, ino);
-
+		 * and insert it into the hash. It's not bound yet --
+		 * read_inode2 binds the actual inode to it. */
+		ino = ocfs_inode_hash_insert(osb, inode_off, fe_off);
 #ifdef LINUX_2_5
 		inode = ocfs_iget (sb, &args);
 #else
 		inode =
-		    iget4 (sb, ino,
-			   (find_inode_t) ocfs_find_inode, (void *) (&args));
+			iget4 (sb, ino,
+			       (find_inode_t) ocfs_find_inode, 
+			       (void *) (&args));
 #endif
 		if (inode == NULL) {
 			LOG_ERROR_STR("access error");
@@ -117,13 +116,13 @@
 			goto bail;
 		}
 	}
+
+bail_add:
 	dentry->d_op = &ocfs_dentry_ops;
 	d_add (dentry, inode);
 	ret = NULL;
 
 bail:
-//	if (fe)
-//		ocfs_release_file_entry (fe);
 	if (fe_bh)
 		brelse(fe_bh);
 
@@ -155,13 +154,6 @@
 	
 	atomic_inc (&dir->i_count);
 
-	inode = new_inode (dir->i_sb);
-	if (IS_ERR (inode)) {
-		status = PTR_ERR(inode);
-		LOG_ERROR_STR("new_inode failed!");
-		goto leave;
-	}
-
 	/* get our super block */
 	osb = (ocfs_super *) OCFS_GENERIC_SB_P(dir->i_sb);
 	if (osb->osb_flags & OCFS_OSB_FLAGS_SHUTDOWN) {
@@ -169,6 +161,13 @@
 		status = -EACCES;
 		goto leave;
 	}
+
+	inode = new_inode (dir->i_sb);
+	if (IS_ERR (inode)) {
+		status = PTR_ERR(inode);
+		LOG_ERROR_STR("new_inode failed!");
+		goto leave;
+	}
 	
 	/* need the offset of our parent directory to lock it */
 	if (!ocfs_linux_get_inode_offset (dir, &parent_off, NULL)) {
@@ -274,6 +273,7 @@
 		oin->inode = inode;
 		ocfs_populate_inode (inode, fe, mode, oin, true);
 		insert_inode_hash (inode);
+		ocfs_inode_hash_bind(osb, GET_INODE_VOTEOFF(inode), inode);
 		d_instantiate (dentry, inode);
 	} else if (status == -ENOSPC)
 		LOG_TRACE_STR ("Disk is full");
@@ -316,6 +316,7 @@
 	struct buffer_head *fe_bh = NULL;
 	bool cache_lock;
 	int i;
+	unsigned long blk;
 
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, %d, %d, '%*s')\n", dir, dentry, mode,
 			dev, dentry->d_name.len, dentry->d_name.name);
@@ -425,15 +426,9 @@
 //		if (!cache_lock)
 //			DISK_LOCK_FILE_LOCK (fe) = OCFS_DLM_NO_LOCK;
 		
-		status = ocfs_read_dirnode(osb, bitmapOffset, dirbhs, OCFS_BH_CACHED, inode);
-		if (status < 0) {
-			ocfs_safefree (dirbhs);
-			OCFS_BH_PUT_DATA(lock_bh);
-			LOG_ERROR_STATUS (status);
-			goto leave;
-		}
-
+		blk = (unsigned long)(bitmapOffset >> 9);
 		for (i = 0; i < numblks; i++) {
+			dirbhs[i] = getblk (OCFS_GET_BLOCKDEV(osb->sb), blk++, osb->sb->s_blocksize);
 			tmp = OCFS_BH_GET_DATA_WRITE(dirbhs[i]); /* write */
 			memset(tmp, 0, osb->sect_size);
 			OCFS_BH_PUT_DATA(dirbhs[i]);
@@ -454,7 +449,7 @@
 		 * header have to hit disk, but the rest of it has to
 		 * be zeroed out too. At least this will populate the
 		 * cache now... */
-		status = ocfs_write_dirnode(osb, dirbhs, 0, inode);
+		status = ocfs_write_dirnode(osb, dirbhs, inode);
 		if (status < 0) {
 			for(i=0; i < numblks; i++)
 				brelse(dirbhs[i]);
@@ -571,8 +566,10 @@
 		ocfs_linux_get_inode_offset (inode, &fileOff, NULL);
 
 	status = -EBUSY;
-	if (atomic_read (&inode->i_count) > 1 || atomic_read (&dentry->d_count) > 2) {
-		LOG_TRACE_STR ("i_count > 1 or d_count > 2");
+	/* i_count > 2 is because we'll be holding a ref on it for our
+	 * inode hash. */
+	if (atomic_read (&inode->i_count) > 2 || atomic_read (&dentry->d_count) > 2) {
+		LOG_TRACE_STR ("i_count > 2 or d_count > 2");
 	} else if (!ocfs_empty(dentry)) {
 		LOG_TRACE_STR ("dentry is not empty, cannot delete");
 	} else if (oin && oin->open_hndl_cnt > 0) {
@@ -897,12 +894,13 @@
 	if (inode_data_is_oin (new_dir))
 		newDirOff = (GET_INODE_OIN(new_dir))->dir_disk_off;
 	else
-		newDirOff = GET_INODE_OFFSET (new_dir);
+		newDirOff = GET_INODE_VOTEOFF (new_dir);
 
 	if (new_dentry->d_inode != NULL && inode_data_is_oin (new_dentry->d_inode))
 		newOIN = GET_INODE_OIN(new_dentry->d_inode);
 
-	if (atomic_read (&old_inode->i_count) > 1) {
+	/* want an i_count == 2 because the hash has a reference. */
+	if (atomic_read (&old_inode->i_count) > 2) {
 		status = -EBUSY;
 		goto bail;
 	} else if (atomic_read (&old_dentry->d_count) > 2) {
@@ -1041,7 +1039,8 @@
 		}
 
 		status = ocfs_fe_smash (osb, newDirOff, 0, 
-					tmpoff, handle, &free_head, new_dentry, new_dir);
+					tmpoff, handle, &free_head, new_dentry,
+					new_dir);
 		if (status < 0) {
 			/* TODO: we should make this transactional such that */
 			/* either we get the new file or the old file stays. */
@@ -1058,8 +1057,10 @@
 		/* Delete the file Entry only on the source directory */
 		LOG_TRACE_STR ("Source & Target Directories are different");
 
-		status = ocfs_fe_smash (osb, oldDirOff, FLAG_DEL_NAME, 
-					oldOffset, handle, NULL, old_dentry, old_dir);
+		status = ocfs_fe_smash (osb, oldDirOff, 
+					FLAG_DEL_NAME | FLAG_DEL_INODE, 
+					oldOffset, handle, NULL, old_dentry, 
+					old_dir);
 		if (status < 0) {
 			if (status != -ENOTEMPTY && status != -EINTR && 
 			    status != -EBUSY)
@@ -1133,7 +1134,7 @@
 					  tmpfe->extents[0].disk_off, 
 					  tmpfe->this_sector);
 		} else {
-			SET_INODE_OFFSET(old_dentry->d_inode, 
+			SET_INODE_VOTEOFF(old_dentry->d_inode, 
 					 tmpfe->this_sector);
 			ocfs_inode_rehash(&osb->inode_hash, 
 					  tmpoff,
@@ -1386,6 +1387,7 @@
 	inode->i_size = newsize;
 	inode->i_blocks = (newsize + sb->s_blocksize) >> sb->s_blocksize_bits;
 	insert_inode_hash (inode);
+	ocfs_inode_hash_bind(osb, GET_INODE_VOTEOFF(inode), inode);
 	d_instantiate (dentry, inode);
 
 	status = ocfs_block_symlink (inode, symname, l);
@@ -1557,10 +1559,12 @@
 
 /* ocfs_fe_smash()
  *
- * Flags for 'flags' field (no flags means do everything?)
+ * Flags for 'flags' field (no flags means do everything)
  * FLAG_DEL_NAME    - Only want to remove the file entry -- do not free 
  *                    any extents. this flag is used during rename.
  *
+ * FLAG_DEL_INODE   - Do not remove the inode from our inode hash.
+ *
  * Two functions call this: ocfs_unlink (no flags) and ocfs_rename
  * (uses both flags under different circumstances).
  *
@@ -1770,7 +1774,7 @@
 	} else {
 		/* mark all the extents (and extent metadata) for
 		 * this file so we can remove them after commit. */
-		status = ocfs_free_file_extents (osb, fe_bh, free_head);
+		status = ocfs_free_file_extents (osb, fe_bh, free_head, inode);
 		if (status < 0) {
 			ocfs_clear_buffer_modified(fe_bh);
 			ocfs_clear_buffer_modified(lock_node_bh);
@@ -1794,12 +1798,17 @@
 
 leave:
 
+	if (inode && status == 0 && !(flags & FLAG_DEL_INODE)) {
+		SET_INODE_DELETED(inode);
+		printk("ocfs_fe_smash: removing inode %lu, voteoff = %u.%u\n",
+		       inode->i_ino, HILO(GET_INODE_VOTEOFF(inode)));
+		ocfs_inode_hash_remove(&osb->inode_hash, 
+				       GET_INODE_VOTEOFF(inode));
+	}
+
 	if (local_handle && handle && (status < 0))
 		ocfs_abort_trans(handle);
 	else if (local_handle && handle) {
-		SET_INODE_DELETED(inode);
-		ocfs_inode_hash_remove(&osb->inode_hash, lock_id);
-
 		status = ocfs_commit_trans(handle);
 		if (status < 0)
 			LOG_ERROR_STATUS(status);
@@ -1811,6 +1820,7 @@
 				LOG_ERROR_STATUS(status);
 		}
 	}
+
         /* NEW: adding a fake release lock for the dead file entry here */
         /* need this to alert dentry-owners on other nodes */
         /* Release the file lock if we acquired it */

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/nm.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -29,7 +29,6 @@
 /* Tracing */
 #define OCFS_DEBUG_CONTEXT      OCFS_DEBUG_CONTEXT_NM
 
-static struct inode * ocfs_get_inode_no_bh(ocfs_super * osb, __u64 voteoff);
 static int ocfs_release_dir_cache_lock (ocfs_super *osb, struct buffer_head **dir_bhs, struct inode *inode);
 static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, __u32 flags, int status, bool *master_alive, ocfs_inode **oin);
 static int ocfs_disk_update_resource (ocfs_super * osb, ocfs_lock_res * lock_res, struct buffer_head **bh, __u32 timeout, struct inode *inode);
@@ -445,6 +444,7 @@
 			flush_counter = 0;
 		}
 #endif
+
 	} /* while (!OCFS_FLAG_SHUTDOWN_VOL_THREAD && !OCFS_OSB_FLAGS_BEING_DISMOUNTED) */
 
         /* Flush all scheduled tasks */
@@ -633,66 +633,6 @@
 #undef OCFS_DEBUG_CONTEXT
 #define OCFS_DEBUG_CONTEXT	OCFS_DEBUG_CONTEXT_DLM
 
-/*
- * ocfs_get_inode_no_bh()
- *
- */
-static struct inode * ocfs_get_inode_no_bh(ocfs_super * osb, __u64 voteoff)
-{
-        int status;
-        struct inode *inode = NULL;
-	struct buffer_head *fe_bh = NULL;
-	__u64 fe_off = 0;
-
-	LOG_ENTRY_ARGS("(voteoff = %u.%u)\n", HILO(voteoff));
-
-	if (voteoff == osb->vol_layout.root_start_off) {
-		inode = osb->sb->s_root->d_inode;
-		if (inode)
-			atomic_inc(&inode->i_count);
-		goto bail;
-	}
-
-	/* try to lookup the offset in the hash. If it's in there,
-	 * then we have an inode and we should continue. Get the fe
-	 * offset and read that in. */
-
-	/* if it's not in the inode hash, then it can't have an inode
-	 * in memory. */
-	if (ocfs_inode_hash_lookup(&osb->inode_hash, voteoff, &fe_off) == 0)
-		goto bail;
-
-	LOG_TRACE_ARGS("got fe_off = %u.%u\n", HILO(fe_off));
-
-	/* only root dir has that fe_off in inode hash and we
-	 * should've caught that case above... */
-	if (fe_off == 0) {
-		LOG_ERROR_STATUS(-EFAIL);
-		goto bail;
-	}
-
-	/* use the fe_off passed back as the offset might be for a
-	 * directory and we actually want to give the FE bh. */
-	status = ocfs_read_bh(osb, fe_off, &fe_bh, OCFS_BH_CACHED, NULL);
-	if (status < 0) {
-		LOG_ERROR_STATUS(status);
-		goto bail;
-	}
-
-	inode = ocfs_get_inode_from_offset(osb, voteoff, fe_bh);
-	if (inode)
-		SET_BH_SEQNUM(inode, fe_bh);
-
-bail:
-	if (fe_bh)
-		brelse(fe_bh);
-
-	LOG_EXIT_PTR (inode);
-        return inode;
-}				/* ocfs_get_inode_no_bh */
-
-
-
 static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, 
 					  __u32 flags, int status, bool *master_alive, ocfs_inode **oin)
 {
@@ -861,8 +801,7 @@
 		}
 	}
 
-	/* if we're lucky this will not need to do an IO */
-	inode = ocfs_get_inode_no_bh(osb, lock_id);
+	inode = ocfs_inode_hash_lookup(osb, lock_id, false);
 	status = ocfs_find_update_res (osb, lock_id, &lockres, NULL, NULL,
 					(OCFS_NM_HEARTBEAT_TIME/2), inode);
 	if (status < 0) {
@@ -959,6 +898,12 @@
 					oin_sem = NULL;
 				}
 			}
+			if (inode) {
+				SET_INODE_DELETED(inode);
+				ocfs_inode_hash_remove(&osb->inode_hash, 
+						     GET_INODE_VOTEOFF(inode));
+			}
+
 			if (!lockres) {
 				/* is there an inode to dump? */
 				if (inode) {
@@ -1140,7 +1085,7 @@
 				}
 				memset(dir_bhs, 0, dirblks * sizeof(*dir_bhs));
 
-				status = ocfs_read_dirnode(osb, lock_id, dir_bhs, OCFS_BH_CACHED, inode);
+				status = ocfs_read_dirnode(osb, lock_id, false, dir_bhs, inode);
 				if (status >= 0)
 					ocfs_release_dir_cache_lock(osb, dir_bhs, inode);
 			
@@ -1335,6 +1280,7 @@
 		iput(inode);
 	}
 leave:
+
 	LOG_EXIT_STATUS (status);
 	return status;
 }				/* ocfs_process_vote */
@@ -1436,12 +1382,20 @@
 	OCFS_BH_PUT_DATA(dir_bhs[0]);
 	dirnode = NULL;
 
-	status = ocfs_write_dirnode(osb, dir_bhs, 0, inode);
+	status = ocfs_write_dirnode(osb, dir_bhs, inode);
 	if (status < 0) {
 		LOG_ERROR_STATUS (status);
 		goto bail;
 	}
+	
+	for (i = 0; i < 256; i++) {
+		if (dir_bhs[i]) {
+			mark_buffer_uptodate(dir_bhs[i], false);
+			CLEAR_BH_SEQNUM(dir_bhs[i]);
+		}
+	}
 
+
 	while (next_node_ptr != -1) {
 		/* clean it up */
 		for (i = 0; i < dirblks; i++)
@@ -1449,8 +1403,7 @@
 				brelse(dir_bhs[i]);
 		memset(dir_bhs, 0, dirblks * sizeof(*dir_bhs));
 
-		status = ocfs_read_dirnode(osb, next_node_ptr, dir_bhs, 
-					   OCFS_BH_CACHED, inode);
+		status = ocfs_read_dirnode(osb, next_node_ptr, false, dir_bhs, inode);
 		if (status < 0) {
 			LOG_ERROR_STATUS (status);
 			goto bail;
@@ -1483,11 +1436,17 @@
 		OCFS_BH_PUT_DATA(dir_bhs[0]);
 		dirnode = NULL;
 
-		status = ocfs_write_dirnode(osb, dir_bhs, 0, inode);
+		status = ocfs_write_dirnode(osb, dir_bhs, inode);
 		if (status < 0) {
 			LOG_ERROR_STATUS (status);
 			goto bail;
 		}
+		for (i = 0; i < 256; i++) {
+			if (dir_bhs[i]) {
+				mark_buffer_uptodate(dir_bhs[i], false);
+				CLEAR_BH_SEQNUM(dir_bhs[i]);
+			}
+		}
 	}
 
 bail:

Modified: trunk/src/oin.c
===================================================================
--- trunk/src/oin.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/oin.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -556,8 +556,7 @@
 	}
 
 	/* put the offset/inode number in the inode cache thingy. */
-	ocfs_inode_hash_insert(osb, osb->vol_layout.root_start_off, 
-			       0, OCFS_ROOT_INODE_NUMBER);
+	ocfs_inode_hash_insert(osb, osb->vol_layout.root_start_off, 0);
 	// oin->Parentoin = NULL; /*  Root has no parent */
 
 	/*  Set the Rootdirectories root Dir Node */

Modified: trunk/src/osb.c
===================================================================
--- trunk/src/osb.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/osb.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -483,12 +483,13 @@
 	ocfs_vol_disk_hdr *volDiskHdr = NULL;
 	ocfs_lock_res *LockResource = NULL;
 	bool lock_acq = false;
-	char *buf = NULL;
+	char *buf = NULL, *sect;
 	struct buffer_head *lock_bh = NULL;
 	struct buffer_head **dirnode_bhs = NULL;
 	struct buffer_head *hdr_bh = NULL;
 	ocfs_dir_node *NewDirNode = NULL;
 	int size, i;
+	unsigned long blk;
 
 	LOG_ENTRY ();
 
@@ -555,14 +556,15 @@
 		goto bail;
 	}
 
-	status = ocfs_read_dirnode(osb, bitmapOffset, dirnode_bhs, 0, NULL);
+	status = ocfs_read_bhs(osb, bitmapOffset, osb->vol_layout.dir_node_size, 
+			       dirnode_bhs, 0, NULL);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status = -EFAIL);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
-
+		
 	for (i = 0; i < OCFS_DEFAULT_DIR_NODE_SECTS; i++) {
-		char *sect = OCFS_BH_GET_DATA_WRITE(dirnode_bhs[i]); /* write */
+	       	sect = OCFS_BH_GET_DATA_WRITE(dirnode_bhs[i]); /* write */
 		memset(sect, 0, osb->sect_size);
 		OCFS_BH_PUT_DATA(dirnode_bhs[i]);
 	}

Modified: trunk/src/util.c
===================================================================
--- trunk/src/util.c	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/src/util.c	2004-01-29 07:58:15 UTC (rev 18)
@@ -266,7 +266,7 @@
 
 	if (oin && inode_data_is_oin (inode))
 		*oin = GET_INODE_OIN(inode);
-	*off = GET_INODE_OFFSET (inode);
+	*off = GET_INODE_VOTEOFF (inode);
 
 	LOG_TRACE_ARGS("offset=%u.%u, i_ino=%u\n", HILO((*off)), inode->i_ino);
 

Added: trunk/vendor/Makefile
===================================================================
--- trunk/vendor/Makefile	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/Makefile	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,7 @@
+TOPDIR = ..
+
+include $(TOPDIR)/Preamble.make
+
+SUBDIRS = redhat unitedlinux
+
+include $(TOPDIR)/Postamble.make

Added: trunk/vendor/redhat/Makefile
===================================================================
--- trunk/vendor/redhat/Makefile	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/redhat/Makefile	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,10 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+DIST_FILES = \
+	ocfs2-2.4.9-e.spec.in	\
+	ocfs2-2.4.18-e.spec.in	\
+	ocfs2-2.4.21-EL.spec.in
+
+include $(TOPDIR)/Postamble.make

Added: trunk/vendor/redhat/ocfs2-2.4.18-e.spec.in
===================================================================
--- trunk/vendor/redhat/ocfs2-2.4.18-e.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/redhat/ocfs2-2.4.18-e.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,172 @@
+#
+# Spec file for ocfs2
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+
+# Turn on's and off's (summit and debug not used but added
+# for future proofing)
+%define chicks 		1
+%define buildup		1
+%define buildsmp	1
+%define buildenterprise	0
+%define buildsummit	0
+%define builddebug	0
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define base 2.4.18-e
+%define kver %{base}.37
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 2
+Name: ocfs2-%{base}
+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: nobody <nobody at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: kernel >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+uniprocessor kernels.
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Cluster Filesystem Version 2 for SMP systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-smp >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description smp
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+symmetric multiprocessor kernels.
+%endif
+
+
+%if %{builddebug}
+%package debug
+Summary: The Oracle Cluster Filesystem Version 2 for debugging systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-debug >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description debug
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+debugging kernels.
+%endif
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+# Hack to find a good source tree
+KVER=""
+if test -d "/usr/src/linux-%{kver}"; then
+    KVER="%{kver}"
+else
+    CURKVER="`uname -r | awk '{sub(/smp$|enterprise$|summit$|debug$/,"");print}'`"
+    case "$CURKVER" in
+    %{base}*)
+        if test -d "/usr/src/linux-${CURKVER}"; then
+            KVER="${CURKVER}"
+        fi
+        ;;
+    *)
+        ;;
+    esac
+fi
+
+if test -z "$KVER" ; then
+    if test -d "/usr/src/linux-2.4" ; then
+        KPATH="/usr/src/linux-2.4"
+    elif test -d "/usr/src/linux" ; then
+        KPATH="/usr/src/linux"
+    else
+        echo "No kernel tree to build from!" >&2
+        exit 1
+    fi
+else
+    KPATH="/usr/src/linux-${KVER}"
+fi
+    
+%configure --with-kernel="${KPATH}"
+cd src
+
+%if %{buildup}
+make KVER=up
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-ABI/ocfs2" install 
+%endif
+
+%if %{buildsmp}
+make clean
+make KVER=smp
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-smp-ABI/ocfs2" install 
+%endif
+
+%if %{builddebug}
+make clean
+make KVER=debug
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-debug-ABI/ocfs2" install 
+%endif
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%if %{buildup}
+%post
+/etc/init.d/ocfs2 link
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{base}-ABI/ocfs2
+%endif
+
+%if %{buildsmp}
+%post smp
+/etc/init.d/ocfs2 link
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{base}-smp-ABI/ocfs2
+%endif
+
+%if %{builddebug}
+%files debug
+%defattr(-,root,root)
+/lib/modules/%{base}-debug-ABI/ocfs2
+%endif
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/redhat/ocfs2-2.4.21-EL.spec.in
===================================================================
--- trunk/vendor/redhat/ocfs2-2.4.21-EL.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/redhat/ocfs2-2.4.21-EL.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,206 @@
+#
+# Spec file for ocfs2
+#
+
+# 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 chicks 		1
+%define buildup		1
+%define buildsmp	1
+%define buildhugemem	1
+%define builddebug	0
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define base 2.4.21
+%define abi 2.4.21-EL
+%define kver %{base}-4.EL
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 2
+Name: ocfs2-%{abi}
+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: nobody <nobody at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: kernel >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+uniprocessor kernels.
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Cluster Filesystem Version 2 for SMP systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-smp >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description smp
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+symmetric multiprocessor kernels.
+%endif
+
+
+%if %{buildhugemem}
+%package hugemem
+Summary: The Oracle Cluster Filesystem for huge memory systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-hugemem >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description hugemem
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+symmetric multiprocessor kernels.
+%endif
+
+
+%if %{builddebug}
+%package debug
+Summary: The Oracle Cluster Filesystem Version 2 for debugging systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-debug >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description debug
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+debugging kernels.
+%endif
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+# Hack to find a good source tree
+KVER=""
+if test -d "/usr/src/linux-%{kver}"; then
+    KVER="%{kver}"
+else
+    CURKVER="`uname -r | awk '{sub(/smp$|hugemem$|debug$/,"");print}'`"
+    case "$CURKVER" in
+    %{base}*)
+        if test -d "/usr/src/linux-${CURKVER}"; then
+            KVER="${CURKVER}"
+        fi
+        ;;
+    *)
+        ;;
+    esac
+fi
+
+if test -z "$KVER" ; then
+    if test -d "/usr/src/linux-2.4" ; then
+        KPATH="/usr/src/linux-2.4"
+    elif test -d "/usr/src/linux" ; then
+        KPATH="/usr/src/linux"
+    else
+        echo "No kernel tree to build from!" >&2
+        exit 1
+    fi
+else
+    KPATH="/usr/src/linux-${KVER}"
+fi
+    
+%configure --with-kernel="${KPATH}"
+cd src
+
+%if %{buildup}
+make KVER=up
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-ABI/ocfs2" install 
+%endif
+
+%if %{buildsmp}
+make clean
+make KVER=smp
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-smp-ABI/ocfs2" install 
+%endif
+
+%if %{buildhugemem}
+make clean
+make KVER=hugemem
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-hugemem-ABI/ocfs2" install 
+%endif
+
+%if %{builddebug}
+make clean
+make KVER=debug
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{abi}-debug-ABI/ocfs2" install 
+%endif
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%if %{buildup}
+%post
+/etc/init.d/ocfs2 link
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{abi}-ABI/ocfs2
+%endif
+
+%if %{buildsmp}
+%post smp
+/etc/init.d/ocfs2 link
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{abi}-smp-ABI/ocfs2
+%endif
+
+%if %{buildhugemem}
+%post hugemem
+/etc/init.d/ocfs2 link
+
+%files hugemem
+%defattr(-,root,root)
+/lib/modules/%{abi}-hugemem-ABI/ocfs2
+%endif
+
+%if %{builddebug}
+%files debug
+%defattr(-,root,root)
+/lib/modules/%{abi}-debug-ABI/ocfs2
+%endif
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/redhat/ocfs2-2.4.9-e.spec.in
===================================================================
--- trunk/vendor/redhat/ocfs2-2.4.9-e.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/redhat/ocfs2-2.4.9-e.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,249 @@
+#
+# Spec file for ocfs2
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+
+# Turn on's and off's (summit and debug not used but added
+# for future proofing)
+%define chicks 		1
+%define buildup		1
+%define buildsmp	1
+%define buildenterprise	1
+%define buildsummit	1
+%define builddebug	0
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define base 2.4.9-e
+%define kver %{base}.12
+%define kveraio %{base}.25
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 2
+Name: ocfs2-%{base}
+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: nobody <nobody at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: kernel >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+#Obsoletes: 
+BuildRequires: kernel-source >= %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+uniprocessor kernels.
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Cluster Filesystem Version 2 for SMP systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-smp >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+#Obsoletes: 
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description smp
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+symmetric multiprocessor kernels.
+%endif
+
+
+%if %{buildenterprise}
+%package enterprise
+Summary: The Oracle Cluster Filesystem Version 2 for enterprise systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-enterprise >= %{kver}
+Requires: ocfs-support >= %{support_ver}
+#Obsoletes: 
+BuildRequires: kernel-source >= %{kver}
+AutoReqProv: no
+
+
+%description enterprise
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+symmetric processor kernels on machines with more than 4GB of RAM.
+%endif
+
+
+%if %{buildsummit}
+%package summit
+Summary: The Oracle Cluster Filesystem Version 2 for summit based systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-summit >= %{kveraio}
+Requires: ocfs-support >= %{support_ver}
+#Obsoletes: 
+BuildRequires: kernel-source >= %{kveraio}
+AutoReqProv: no
+
+
+%description summit
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+summit based symmetric processor kernels e.g. IBM's x440.
+%endif
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+# Hack to find a good source tree
+KVER=""
+if test -d "/usr/src/linux-%{kver}"; then
+    KVER="%{kver}"
+else
+    echo "No %{kver} kernel tree to build from!" >&2
+    exit 1
+fi
+
+KPATH="/usr/src/linux-${KVER}"
+    
+%configure --with-kernel="${KPATH}"  --enable-aio=no
+cd src
+
+%if %{buildup}
+make clean
+make KVER=up
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-ABI/ocfs2-noaio" install 
+%endif
+
+%if %{buildsmp}
+make clean
+make KVER=smp
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-smp-ABI/ocfs2-noaio" install 
+%endif
+
+%if %{buildenterprise}
+make clean
+make KVER=ent
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-enterprise-ABI/ocfs2-noaio" install 
+%endif
+
+
+# Now to build with AIO
+cd ..
+KVER=""
+if test -d "/usr/src/linux-%{kveraio}"; then
+    KVER="%{kveraio}"
+else
+    echo "No kernel tree to build from!" >&2
+    exit 1
+fi
+
+KPATH="/usr/src/linux-${KVER}"
+    
+%configure --with-kernel="${KPATH}"  --enable-aio=yes
+cd src
+
+%if %{buildup}
+make clean
+make KVER=up
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-ABI/ocfs2" install 
+%endif
+
+%if %{buildsmp}
+make clean
+make KVER=smp
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-smp-ABI/ocfs2" install 
+%endif
+
+%if %{buildenterprise}
+make clean
+make KVER=ent
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-enterprise-ABI/ocfs2" install 
+%endif
+
+
+%if %{buildsummit}
+cd ..
+# Now to find a summit source tree
+KVER=""
+if test -d "/usr/src/linux-%{kveraio}summit"; then
+    KVER="%{kveraio}summit"
+else
+    echo "No %{kveraio} summit tree to build from!" >&2
+    exit 1
+fi
+
+KPATH="/usr/src/linux-${KVER}"
+    
+%configure --with-kernel="${KPATH}" --enable-aio=yes
+cd src
+
+make clean
+make KVER=summit
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{base}-summit-ABI/ocfs2" install 
+%endif
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%if %{buildup}
+%post
+/etc/init.d/ocfs2 link
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{base}-ABI/ocfs2
+/lib/modules/%{base}-ABI/ocfs2-noaio
+%endif
+
+
+%if %{buildsmp}
+%post smp
+/etc/init.d/ocfs2 link
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{base}-smp-ABI/ocfs2
+/lib/modules/%{base}-smp-ABI/ocfs2-noaio
+%endif
+
+
+%if %{buildenterprise}
+%post enterprise
+/etc/init.d/ocfs2 link
+
+%files enterprise
+%defattr(-,root,root)
+/lib/modules/%{base}-enterprise-ABI/ocfs2
+/lib/modules/%{base}-enterprise-ABI/ocfs2-noaio
+%endif
+
+%if %{buildsummit}
+%post summit
+/etc/init.d/ocfs2 link
+
+%files summit
+%defattr(-,root,root)
+/lib/modules/%{base}-summit-ABI/ocfs2
+%endif
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/unitedlinux/Makefile
===================================================================
--- trunk/vendor/unitedlinux/Makefile	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/Makefile	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,13 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+DIST_FILES = 					\
+	ocfs2-2.4.19-64GB-SMP.spec.in		\
+	ocfs2-2.4.19-4GB-SMP.spec.in		\
+	ocfs2-2.4.19-4GB.spec.in		\
+	ocfs2-2.4.21-107.spec.in		\
+	ocfs2-2.4.21-111.spec.in		\
+	ocfs2-2.4.21-138.spec.in
+
+include $(TOPDIR)/Postamble.make

Added: trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB-SMP.spec.in
===================================================================
--- trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB-SMP.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB-SMP.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,96 @@
+#
+# Spec file for ocfs
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define kver 2.4.19-4GB-SMP
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 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: nobody <nobody at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+# Requires: kernel >= %{kver}  -- silly UL nodeps
+Requires: k_psmp = 2.4.19-304
+Requires: ocfs-support >= %{support_ver}
+# BuildRequires: kernel-source >= %{kver}  -- silly UL nodeps
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+the United Linux SMP kernel.
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+# Hack to find a good source tree
+KVER=""
+if test -d "/usr/src/linux-%{kver}"; then
+    KVER="%{kver}"
+else
+    CURKVER="`uname -r | awk '{sub(/smp$|enterprise$|summit$|debug$/,"");print}'`"
+    case "$CURKVER" in
+    %{kver}*)
+        if test -d "/usr/src/linux-${CURKVER}"; then
+            KVER="${CURKVER}"
+        fi
+        ;;
+    *)
+        ;;
+    esac
+fi
+
+if test -z "$KVER" ; then
+    if test -d "/usr/src/linux-2.4" ; then
+        KPATH="/usr/src/linux-2.4"
+    elif test -d "/usr/src/linux" ; then
+        KPATH="/usr/src/linux"
+    else
+        echo "No kernel tree to build from!" >&2
+        exit 1
+    fi
+else
+    KPATH="/usr/src/linux-${KVER}"
+fi
+    
+%configure --with-kernel="${KPATH}"
+cd src
+
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}/kernel/drivers/addon/ocfs2" install 
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{kver}/kernel/drivers/addon/ocfs2
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB.spec.in
===================================================================
--- trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/ocfs2-2.4.19-4GB.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,91 @@
+#
+# Spec file for ocfs2
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define kver 2.4.19-4GB
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 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: nobody <nobody at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+# Requires: kernel >= %{kver}  -- silly UL nodeps
+Requires: k_deflt = 2.4.19-304
+Requires: ocfs-support >= %{support_ver}
+# BuildRequires: kernel-source >= %{kver}  -- silly UL nodeps
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+the United Linux SMP kernel.
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+# Hack to find a good source tree
+KVER=""
+if test -d "/usr/src/linux-%{kver}"; then
+    KVER="%{kver}"
+else
+    CURKVER="`uname -r | awk '{sub(/smp$|enterprise$|summit$|debug$/,"");print}'`"
+    case "$CURKVER" in
+    %{kver}*)
+        if test -d "/usr/src/linux-${CURKVER}"; then
+            KVER="${CURKVER}"
+        fi
+        ;;
+    *)
+        ;;
+    esac
+fi
+
+if test -z "$KVER" ; then
+    if test -d "/usr/src/linux-2.4" ; then
+        KPATH="/usr/src/linux-2.4"
+    elif test -d "/usr/src/linux" ; then
+        KPATH="/usr/src/linux"
+    else
+        echo "No kernel tree to build from!" >&2
+        exit 1
+    fi
+else
+    KPATH="/usr/src/linux-${KVER}"
+fi
+    
+%configure --with-kernel="${KPATH}"
+cd src
+
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}/kernel/drivers/addon/ocfs2" install 
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/unitedlinux/ocfs2-2.4.19-64GB-SMP.spec.in
===================================================================
--- trunk/vendor/unitedlinux/ocfs2-2.4.19-64GB-SMP.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/ocfs2-2.4.19-64GB-SMP.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,96 @@
+#
+# Spec file for ocfs2
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define kver 2.4.19-64GB-SMP
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 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: nobody <nobody at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+# Requires: kernel >= %{kver}  -- silly UL nodeps
+Requires: k_smp = 2.4.19-304
+Requires: ocfs-support >= %{support_ver}
+# BuildRequires: kernel-source >= %{kver}  -- silly UL nodeps
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.  This package is compiled for
+the United Linux SMP kernel.
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+# Hack to find a good source tree
+KVER=""
+if test -d "/usr/src/linux-%{kver}"; then
+    KVER="%{kver}"
+else
+    CURKVER="`uname -r | awk '{sub(/smp$|enterprise$|summit$|debug$/,"");print}'`"
+    case "$CURKVER" in
+    %{kver}*)
+        if test -d "/usr/src/linux-${CURKVER}"; then
+            KVER="${CURKVER}"
+        fi
+        ;;
+    *)
+        ;;
+    esac
+fi
+
+if test -z "$KVER" ; then
+    if test -d "/usr/src/linux-2.4" ; then
+        KPATH="/usr/src/linux-2.4"
+    elif test -d "/usr/src/linux" ; then
+        KPATH="/usr/src/linux"
+    else
+        echo "No kernel tree to build from!" >&2
+        exit 1
+    fi
+else
+    KPATH="/usr/src/linux-${KVER}"
+fi
+    
+%configure --with-kernel="${KPATH}"
+cd src
+
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}/kernel/drivers/addon/ocfs2" install 
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{kver}/kernel/drivers/addon/ocfs2
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/unitedlinux/ocfs2-2.4.21-107.spec.in
===================================================================
--- trunk/vendor/unitedlinux/ocfs2-2.4.21-107.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/ocfs2-2.4.21-107.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,297 @@
+#
+# Spec file for OCFS2 on UL 1.0 SP3
+#
+
+# 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 builddeflt		1
+%define buildsmp		1
+%define buildpsmp		1
+%define buildnuma		0
+%define builditanium2		0
+%define builditanium2smp	0
+
+%ifarch ia64
+%define builddeflt		0
+%define buildsmp		0
+%define buildpsmp		0
+%define builditanium2		1
+%define builditanium2smp	1
+%endif
+
+%ifarch x86_64
+%define buildpsmp		0
+%define buildnuma		1
+%endif
+
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define base		2.4.21
+%define sver		107
+%define kver		%{base}-%{sver}
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 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: k_deflt = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.
+This package is compiled for the default kernel.
+
+%if %{builddeflt}
+%package deflt
+Summary: The Oracle Cluster File System Version 2 for UP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: ocfs2 = %{version}
+Requires: k_deflt = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description deflt
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for the default kernel.
+%endif
+
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Cluster File System Version 2 for SMP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: ocfs2 = %{version}
+Requires: k_smp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description smp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for symmetric multiprocessor kernels.
+%endif
+
+
+%if %{buildpsmp}
+%package psmp
+Summary: The Oracle Cluster File System Version 2 for Pentium SMP systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_psmp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description psmp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for Pentium SMP kernels.
+%endif
+
+
+%if %{buildnuma}
+%package numa
+Summary: The Oracle Cluster File System Version 2 for NUMA systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_numa = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description numa
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for NUMA kernels.
+%endif
+
+
+%if %{builditanium2}
+%package itanium2
+Summary: The Oracle Cluster File System Version 2 for UP Itanium2 systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_itanium2 = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description itanium2
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for UP Itanium2 kernels.
+%endif
+
+
+%if %{builditanium2smp}
+%package itanium2-smp
+Summary: The Oracle Cluster File System Version 2 for SMP Itanium2 systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_itanium2-smp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description itanium2-smp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for Itanium2 SMP kernels.
+%endif
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+
+%if %{builddeflt}
+KPATH="/usr/src/linux-%{kver}-include/default"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-default/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildsmp}
+KPATH="/usr/src/linux-%{kver}-include/smp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-smp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildpsmp}
+KPATH="/usr/src/linux-%{kver}-include/psmp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-psmp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildnuma}
+KPATH="/usr/src/linux-%{kver}-include/numa"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-numa/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{builditanium2}
+KPATH="/usr/src/linux-%{kver}-include/itanium2"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-itanium2/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{builditanium2smp}
+KPATH="/usr/src/linux-%{kver}-include/itanium2-smp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-itanium2-smp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%if %{builddeflt}
+%post deflt
+depmod -a
+
+%files deflt
+%defattr(-,root,root)
+/lib/modules/%{kver}-default/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildsmp}
+%post smp
+depmod -a
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-smp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildpsmp}
+%post psmp
+depmod -a
+
+%files psmp
+%defattr(-,root,root)
+/lib/modules/%{kver}-psmp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildnuma}
+%post numa
+depmod -a
+
+%files numa
+%defattr(-,root,root)
+/lib/modules/%{kver}-numa/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{builditanium2}
+%post itanium2
+depmod -a
+
+%files itanium2
+%defattr(-,root,root)
+/lib/modules/%{kver}-itanium2/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{builditanium2smp}
+%post itanium2-smp
+depmod -a
+
+%files itanium2-smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-itanium2-smp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/unitedlinux/ocfs2-2.4.21-111.spec.in
===================================================================
--- trunk/vendor/unitedlinux/ocfs2-2.4.21-111.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/ocfs2-2.4.21-111.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,297 @@
+#
+# Spec file for OCFS2 on UL 1.0 SP3
+#
+
+# 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 builddeflt		1
+%define buildsmp		1
+%define buildpsmp		1
+%define buildnuma		0
+%define builditanium2		0
+%define builditanium2smp	0
+
+%ifarch ia64
+%define builddeflt		0
+%define buildsmp		0
+%define buildpsmp		0
+%define builditanium2		1
+%define builditanium2smp	1
+%endif
+
+%ifarch x86_64
+%define buildpsmp		0
+%define buildnuma		1
+%endif
+
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define base		2.4.21
+%define sver		111
+%define kver		%{base}-%{sver}
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 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: k_deflt = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.
+This package is compiled for the default kernel.
+
+%if %{builddeflt}
+%package deflt
+Summary: The Oracle Cluster File System Version 2 for UP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: ocfs2 = %{version}
+Requires: k_deflt = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description deflt
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for the default kernel.
+%endif
+
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Cluster File System Version 2 for SMP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: ocfs2 = %{version}
+Requires: k_smp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description smp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for symmetric multiprocessor kernels.
+%endif
+
+
+%if %{buildpsmp}
+%package psmp
+Summary: The Oracle Cluster File System Version 2 for Pentium SMP systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_psmp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description psmp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for Pentium SMP kernels.
+%endif
+
+
+%if %{buildnuma}
+%package numa
+Summary: The Oracle Cluster File System Version 2 for NUMA systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_numa = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description numa
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for NUMA kernels.
+%endif
+
+
+%if %{builditanium2}
+%package itanium2
+Summary: The Oracle Cluster File System Version 2 for UP Itanium2 systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_itanium2 = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description itanium2
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for UP Itanium2 kernels.
+%endif
+
+
+%if %{builditanium2smp}
+%package itanium2-smp
+Summary: The Oracle Cluster File System Version 2 for SMP Itanium2 systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_itanium2-smp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description itanium2-smp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for Itanium2 SMP kernels.
+%endif
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+
+%if %{builddeflt}
+KPATH="/usr/src/linux-%{kver}-include/default"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-default/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildsmp}
+KPATH="/usr/src/linux-%{kver}-include/smp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-smp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildpsmp}
+KPATH="/usr/src/linux-%{kver}-include/psmp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-psmp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildnuma}
+KPATH="/usr/src/linux-%{kver}-include/numa"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-numa/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{builditanium2}
+KPATH="/usr/src/linux-%{kver}-include/itanium2"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-itanium2/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{builditanium2smp}
+KPATH="/usr/src/linux-%{kver}-include/itanium2-smp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-itanium2-smp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%if %{builddeflt}
+%post deflt
+depmod -a
+
+%files deflt
+%defattr(-,root,root)
+/lib/modules/%{kver}-default/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildsmp}
+%post smp
+depmod -a
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-smp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildpsmp}
+%post psmp
+depmod -a
+
+%files psmp
+%defattr(-,root,root)
+/lib/modules/%{kver}-psmp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildnuma}
+%post numa
+depmod -a
+
+%files numa
+%defattr(-,root,root)
+/lib/modules/%{kver}-numa/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{builditanium2}
+%post itanium2
+depmod -a
+
+%files itanium2
+%defattr(-,root,root)
+/lib/modules/%{kver}-itanium2/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{builditanium2smp}
+%post itanium2-smp
+depmod -a
+
+%files itanium2-smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-itanium2-smp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: trunk/vendor/unitedlinux/ocfs2-2.4.21-138.spec.in
===================================================================
--- trunk/vendor/unitedlinux/ocfs2-2.4.21-138.spec.in	2004-01-29 07:40:45 UTC (rev 17)
+++ trunk/vendor/unitedlinux/ocfs2-2.4.21-138.spec.in	2004-01-29 07:58:15 UTC (rev 18)
@@ -0,0 +1,297 @@
+#
+# Spec file for OCFS2 on UL 1.0 SP3
+#
+
+# 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 builddeflt		1
+%define buildsmp		1
+%define buildpsmp		1
+%define buildnuma		0
+%define builditanium2		0
+%define builditanium2smp	0
+
+%ifarch ia64
+%define builddeflt		0
+%define buildsmp		0
+%define buildpsmp		0
+%define builditanium2		1
+%define builditanium2smp	1
+%endif
+
+%ifarch x86_64
+%define buildpsmp		0
+%define buildnuma		1
+%endif
+
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define base		2.4.21
+%define sver		138
+%define kver		%{base}-%{sver}
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     @SUPPORT_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem Version 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: k_deflt = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem Version 2.
+This package is compiled for the default kernel.
+
+%if %{builddeflt}
+%package deflt
+Summary: The Oracle Cluster File System Version 2 for UP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: ocfs2 = %{version}
+Requires: k_deflt = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description deflt
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for the default kernel.
+%endif
+
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Cluster File System Version 2 for SMP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: ocfs2 = %{version}
+Requires: k_smp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description smp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for symmetric multiprocessor kernels.
+%endif
+
+
+%if %{buildpsmp}
+%package psmp
+Summary: The Oracle Cluster File System Version 2 for Pentium SMP systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_psmp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description psmp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for Pentium SMP kernels.
+%endif
+
+
+%if %{buildnuma}
+%package numa
+Summary: The Oracle Cluster File System Version 2 for NUMA systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_numa = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description numa
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for NUMA kernels.
+%endif
+
+
+%if %{builditanium2}
+%package itanium2
+Summary: The Oracle Cluster File System Version 2 for UP Itanium2 systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_itanium2 = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description itanium2
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for UP Itanium2 kernels.
+%endif
+
+
+%if %{builditanium2smp}
+%package itanium2-smp
+Summary: The Oracle Cluster File System Version 2 for SMP Itanium2 systems.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: k_itanium2-smp = %{kver}
+Requires: ocfs-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}
+
+%description itanium2-smp
+The Oracle Cluster Filesystem Version 2.
+This package is compiled for Itanium2 SMP kernels.
+%endif
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+
+%if %{builddeflt}
+KPATH="/usr/src/linux-%{kver}-include/default"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-default/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildsmp}
+KPATH="/usr/src/linux-%{kver}-include/smp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-smp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildpsmp}
+KPATH="/usr/src/linux-%{kver}-include/psmp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-psmp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{buildnuma}
+KPATH="/usr/src/linux-%{kver}-include/numa"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-numa/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{builditanium2}
+KPATH="/usr/src/linux-%{kver}-include/itanium2"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-itanium2/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+%if %{builditanium2smp}
+KPATH="/usr/src/linux-%{kver}-include/itanium2-smp"
+%configure --with-kernel="${KPATH}"
+cd src
+make
+make DESTDIR="$RPM_BUILD_ROOT" MODULEDIR="/lib/modules/%{kver}-itanium2-smp/kernel/drivers/addon/ocfs2" install 
+make clean
+cd ..
+%endif
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%if %{builddeflt}
+%post deflt
+depmod -a
+
+%files deflt
+%defattr(-,root,root)
+/lib/modules/%{kver}-default/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildsmp}
+%post smp
+depmod -a
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-smp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildpsmp}
+%post psmp
+depmod -a
+
+%files psmp
+%defattr(-,root,root)
+/lib/modules/%{kver}-psmp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{buildnuma}
+%post numa
+depmod -a
+
+%files numa
+%defattr(-,root,root)
+/lib/modules/%{kver}-numa/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{builditanium2}
+%post itanium2
+depmod -a
+
+%files itanium2
+%defattr(-,root,root)
+/lib/modules/%{kver}-itanium2/kernel/drivers/addon/ocfs2
+%endif
+
+
+%if %{builditanium2smp}
+%post itanium2-smp
+depmod -a
+
+%files itanium2-smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-itanium2-smp/kernel/drivers/addon/ocfs2
+%endif
+
+
+%changelog
+* Wed Jan 28 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file



More information about the Ocfs2-commits mailing list