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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Jun 23 17:00:47 CDT 2004


Author: jlbec
Date: 2004-06-23 16:00:46 -0500 (Wed, 23 Jun 2004)
New Revision: 1202

Modified:
   trunk/src/dir.c
   trunk/src/file.c
   trunk/src/namei.c
   trunk/src/sysfile.c
Log:

o ocfs_find_files_on_disk() now returns a block number, not a byte
  offset.



Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c	2004-06-23 20:08:41 UTC (rev 1201)
+++ trunk/src/dir.c	2004-06-23 21:00:46 UTC (rev 1202)
@@ -240,7 +240,7 @@
  */
 /* parent off changed to file entry offset of parent! */
 int ocfs_find_files_on_disk(ocfs_super *osb, const char *name,
-			    int namelen, __u64 *fe_off,
+			    int namelen, u64 *blkno,
 			    struct inode *inode, int take_lock,
 			    struct buffer_head **dirent_bh,
 			    struct ocfs2_dir_entry **dirent)
@@ -250,8 +250,8 @@
 	int lock_acq = 0;
 	struct buffer_head *bh = NULL;
 
-	LOG_ENTRY_ARGS ("(osb=%p, parent=%llu, name='%*s', fe_off=%p, inode=%p)\n",
-			osb, OCFS_I(inode)->ip_blkno, namelen, name, fe_off, inode);
+	LOG_ENTRY_ARGS ("(osb=%p, parent=%llu, name='%*s', blkno=%p, inode=%p)\n",
+			osb, OCFS_I(inode)->ip_blkno, namelen, name, blkno, inode);
 
 	if (take_lock) {
 		/* Get a lock on the directory... */
@@ -267,13 +267,13 @@
 		lock_acq = 1;
 	}
 
-	*dirent_bh = ocfs_find_entry (name, namelen, inode, dirent);
+	*dirent_bh = ocfs_find_entry(name, namelen, inode, dirent);
 	if (!*dirent_bh || !*dirent) {
 		status = -ENOENT;
 		goto leave;
 	}
 
-	*fe_off = (*dirent)->inode << inode->i_sb->s_blocksize_bits;
+	*blkno = le64_to_cpu((*dirent)->inode);
 
 	status = 0;
 leave:

Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-06-23 20:08:41 UTC (rev 1201)
+++ trunk/src/file.c	2004-06-23 21:00:46 UTC (rev 1202)
@@ -736,6 +736,7 @@
 		*ppos = inode->i_size;
 	}
 
+#if 0 /* Is this fixed in Oracle? */
 	if (filp->f_flags & O_DIRECT) {
 		/* anything special for o_direct? */
 		LOG_TRACE_STR ("O_DIRECT");
@@ -744,6 +745,8 @@
 			filp->f_flags &= ~O_DIRECT;
 		}
 	}
+#endif
+
 	if (!(filp->f_flags & O_DIRECT)) {
 		/* FIXME: is the down_sem supposed to be here?! */
 		LOG_TRACE_ARGS ("non O_DIRECT write, fileopencount=%d\n",
@@ -882,6 +885,7 @@
 
 	osb = OCFS_SB(inode->i_sb);
 
+#if 0 /* Is this fixed in Oracle? */
 	if (filp->f_flags & O_DIRECT) {
 		/* anything special for o_direct? */
 		LOG_TRACE_STR ("O_DIRECT");
@@ -891,6 +895,7 @@
 			filp->f_flags &= ~O_DIRECT;
 		}
 	}
+#endif
 
 	if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 		down_read(&OCFS_I(inode)->ip_io_sem);

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-06-23 20:08:41 UTC (rev 1201)
+++ trunk/src/namei.c	2004-06-23 21:00:46 UTC (rev 1202)
@@ -120,7 +120,7 @@
 			   struct nameidata *nd)
 {
 	int status;
-	__u64 fe_off = 0;
+	u64 blkno;
 	struct buffer_head *dirent_bh = NULL;
 	struct inode *inode = NULL;
 	struct super_block *sb = dir->i_sb;
@@ -144,13 +144,13 @@
 
 	down_read(&OCFS_I(dir)->ip_io_sem);
 	status = ocfs_find_files_on_disk(osb, dentry->d_name.name,
-					 dentry->d_name.len, &fe_off,
+					 dentry->d_name.len, &blkno,
 					 dir, 1, &dirent_bh, &dirent);
 	up_read(&OCFS_I(dir)->ip_io_sem);
 	if (status < 0)
 		goto bail_add;
 	
-	inode = ocfs_iget(osb, fe_off >> sb->s_blocksize_bits);
+	inode = ocfs_iget(osb, blkno);
 	if (!inode) {
 		LOG_ERROR_STR("Could not create inode!");
 		ret = ERR_PTR (-EACCES);
@@ -671,7 +671,7 @@
 	struct inode *inode = dentry->d_inode;
 	int retval = -EBUSY;
 	ocfs_super *osb = OCFS_SB(dir->i_sb);
-	__u64 fe_off;
+	u64 blkno;
 	struct inode *parentInode = dentry->d_parent->d_inode;
 	ocfs2_dinode *fe = NULL;
 	__u32 lockFlags = (S_ISDIR (inode->i_mode) ? (FLAG_RELEASE_DENTRY | FLAG_DIR) : FLAG_RELEASE_DENTRY);
@@ -723,9 +723,9 @@
 	got_parent = 1;
 
 	/* this will re-read the directory now with the EXCLUSIVE */
-	/* lock already held; it will also return the fe_off to us */
+	/* lock already held; it will also return the blkno to us */
 	status = ocfs_find_files_on_disk(osb, dentry->d_name.name,
-					 dentry->d_name.len, &fe_off,
+					 dentry->d_name.len, &blkno,
 					 parentInode, 0, &dirent_bh,
 					 &dirent);
 	if (status < 0) {
@@ -733,11 +733,12 @@
 		goto leave;
 	}
 
-	if ((fe_off >> inode->i_sb->s_blocksize_bits) !=
-	    OCFS_I(inode)->ip_blkno)
+	if (blkno != OCFS_I(inode)->ip_blkno)
 		BUG();
 
-	status = ocfs_read_bh(osb, fe_off, &fe_bh, OCFS_BH_CACHED, inode);
+	status = ocfs_read_bh(osb,
+			      OCFS_I(inode)->ip_blkno << inode->i_sb->s_blocksize_bits,
+			      &fe_bh, OCFS_BH_CACHED, inode);
 	if (status < 0) {
 		LOG_ERROR_STATUS(status);
 		goto leave;
@@ -1019,7 +1020,7 @@
 	struct buffer_head *newfe_bh = NULL;
 	ocfs_super *osb = NULL;
 	__u64 oldfe_lockid;
-	__u64 newfe_lockid = 0;
+	u64 newfe_blkno;
 	ocfs_journal_handle *handle = NULL;
 	__u32 dir_lock_flags = FLAG_FILE_CREATE | FLAG_DIR;
 	struct buffer_head *old_dir_bh = NULL;
@@ -1151,7 +1152,7 @@
 	 * to delete it */
 	status = ocfs_find_files_on_disk(osb, new_dentry->d_name.name,
 					 new_dentry->d_name.len, 
-					 &newfe_lockid, new_dir, 0,
+					 &newfe_blkno, new_dir, 0,
 					 &new_de_bh, &new_de);
 	/* The only error we allow here is -ENOENT because the new
 	 * file not existing is perfectly valid. */
@@ -1172,8 +1173,7 @@
 		if (!new_inode)
 			BUG();
 
-		if (newfe_lockid != 
-		    (OCFS_I(new_inode)->ip_blkno << new_inode->i_sb->s_blocksize_bits))
+		if (newfe_blkno != OCFS_I(new_inode)->ip_blkno)
 			BUG();
 
 		if (S_ISDIR(new_inode->i_mode))
@@ -1196,8 +1196,8 @@
 			ocfs_truncate_inode_pages(new_inode, 0);
 
 		LOG_TRACE_ARGS("aha rename over existing... new_de=%p "
-			       "newlockid=%llu newfebh=%p bhblocknr=%llu\n",
-			       new_de, newfe_lockid, newfe_bh, newfe_bh ?
+			       "new_blkno=%llu newfebh=%p bhblocknr=%llu\n",
+			       new_de, newfe_blkno, newfe_bh, newfe_bh ?
 			       (unsigned long long)newfe_bh->b_blocknr : 0ULL);
 
 		status = ocfs_journal_access(handle, newfe_bh, 

Modified: trunk/src/sysfile.c
===================================================================
--- trunk/src/sysfile.c	2004-06-23 20:08:41 UTC (rev 1201)
+++ trunk/src/sysfile.c	2004-06-23 21:00:46 UTC (rev 1202)
@@ -93,7 +93,7 @@
 {
 	char namebuf[40];
 	struct inode *inode = NULL;
-	__u64 fe_off = 0;
+	u64 blkno;
 	struct buffer_head *dirent_bh = NULL;
 	struct ocfs2_dir_entry *de = NULL;
 	int status = 0;
@@ -103,13 +103,13 @@
 					type, node);
 	
 	status = ocfs_find_files_on_disk(osb, namebuf, strlen(namebuf),
-					 &fe_off, osb->sys_root_inode, 
+					 &blkno, osb->sys_root_inode, 
 					 0, &dirent_bh, &de);
 	if (status < 0) {
 		goto bail;
 	}
 
-	inode = ocfs_iget(osb, fe_off >> osb->sb->s_blocksize_bits);
+	inode = ocfs_iget(osb, blkno);
 	if (!inode) {
 		LOG_ERROR_STR("Could not create inode!");
 		goto bail;



More information about the Ocfs2-commits mailing list