[Ocfs2-commits] mfasheh commits r1535 - branches/dlm-changes/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Oct 1 15:06:23 CDT 2004


Author: mfasheh
Date: 2004-10-01 15:06:21 -0500 (Fri, 01 Oct 2004)
New Revision: 1535

Modified:
   branches/dlm-changes/src/sysfile.c
   branches/dlm-changes/src/sysfile.h
Log:
* ocfs_read_system_file() is no longer used, so get rid of it.



Modified: branches/dlm-changes/src/sysfile.c
===================================================================
--- branches/dlm-changes/src/sysfile.c	2004-10-01 17:05:09 UTC (rev 1534)
+++ branches/dlm-changes/src/sysfile.c	2004-10-01 20:06:21 UTC (rev 1535)
@@ -126,78 +126,3 @@
 	return inode;
 }
 
-
-/*
- * ocfs_read_system_file()
- *
- * make sure that the bhs array is either all NULL'd out or you really
- * know what you're doing! Also, those bh's will have to be brelse'd
- * after you're done with them!
- *
- */
-int ocfs_read_system_file(ocfs_super *osb, int type, __u32 node,
-			  struct buffer_head *bhs[], __u64 Length)
-{
-	int status = 0, i;
-	__u64 ret = 0;
-	struct inode *inode = NULL;
-	__u32 blocks;
-	__u64 off, contig_blocks, contig_bytes;
-
-	LOG_ENTRY_ARGS ("type=%d, node=%u, Length = %llu\n", type, node, Length);
-
-	OCFS_ASSERT(!(Length & (osb->sb->s_blocksize - 1)));
-
-	inode = ocfs_get_system_file_inode(osb, type, node);
-	if (!inode) {
-		LOG_ERROR_STATUS(status=-EINVAL);
-		goto leave;
-	}
-
-	off = 0;
-	i = 0;
-	blocks = Length >> osb->sb->s_blocksize_bits;
-	while (blocks > 0) {
-		status = ocfs_lookup_file_allocation(osb, off, &ret,
-						     (Length - off), 
-						     &contig_bytes,
-						     inode, 1);
-		contig_blocks =
-			contig_bytes >> osb->sb->s_blocksize_bits;
-		if (contig_bytes !=
-		    (contig_blocks << osb->sb->s_blocksize_bits)) {
-			LOG_ERROR_ARGS("unaligned system file read! off=%llu, "
-				       "contig_bytes=%llu\n", off, contig_bytes);
-			LOG_ERROR_STATUS(status=-EINVAL);
-			goto leave;
-		}
-		if (contig_blocks > blocks) {
-			contig_blocks = blocks;
-			contig_bytes = blocks << osb->sb->s_blocksize_bits;
-		}
-		if (status == 0) {
-			// found all remaining
-		} else if (status == -EFAIL && contig_blocks > 0) {
-			// found some
-		} else {
-			// failed
-			LOG_ERROR_STATUS(status = -EIO);
-			goto leave;
-		}
-		status = ocfs_read_bhs(osb, ret, contig_blocks << osb->sb->s_blocksize_bits, &(bhs[i]), OCFS_BH_CACHED, inode);
-		if (status < 0) {
-			LOG_ERROR_STATUS (status);
-			goto leave;
-		}
-		i += contig_blocks;
-		blocks -= contig_blocks;
-		off += contig_bytes;
-	}
-
-leave:
-	if (inode)
-		iput(inode);
-
-	LOG_EXIT_STATUS (status);
-	return status;
-}				/* ocfs_read_system_file */

Modified: branches/dlm-changes/src/sysfile.h
===================================================================
--- branches/dlm-changes/src/sysfile.h	2004-10-01 17:05:09 UTC (rev 1534)
+++ branches/dlm-changes/src/sysfile.h	2004-10-01 20:06:21 UTC (rev 1535)
@@ -30,7 +30,5 @@
 #define OCFS2_SYSFILE_H
 
 struct inode * ocfs_get_system_file_inode(ocfs_super *osb, int type, __u32 node);
-int ocfs_read_system_file (ocfs_super *osb, int type, __u32 node,
-			   struct buffer_head *bhs[], __u64 Length);
 
 #endif /* OCFS2_SYSFILE_H */



More information about the Ocfs2-commits mailing list