[Ocfs2-commits] khackel commits r1452 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Sep 10 15:16:26 CDT 2004


Author: khackel
Date: 2004-09-10 15:16:24 -0500 (Fri, 10 Sep 2004)
New Revision: 1452

Modified:
   trunk/src/dir.c
   trunk/src/inode.c
   trunk/src/journal.c
   trunk/src/namei.c
   trunk/src/nm.c
Log:
remove FLAG_DIR

Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c	2004-09-10 05:26:16 UTC (rev 1451)
+++ trunk/src/dir.c	2004-09-10 20:16:24 UTC (rev 1452)
@@ -94,7 +94,7 @@
 	down_write(&OCFS_I(inode)->ip_io_sem);
 
 	error = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE,
-				  FLAG_DIR|FLAG_READONLY, &lockbh, inode);
+				  FLAG_READONLY, &lockbh, inode);
 	if (lockbh) {
 		brelse(lockbh);
 		lockbh = NULL;
@@ -207,7 +207,7 @@
 
 	if (have_disk_lock) {
 		error = ocfs_release_lock (osb, OCFS_LKM_EXMODE,
-					     FLAG_DIR|FLAG_READONLY, inode);
+					     FLAG_READONLY, inode);
 		if (error < 0)
 			LOG_ERROR_STATUS (error);
 	}
@@ -241,7 +241,7 @@
 	if (take_lock) {
 		/* Get a lock on the directory... */
 		status = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE,
-					    FLAG_DIR|FLAG_READONLY, 
+					    FLAG_READONLY, 
 					    &bh, inode);
 		if (status < 0) {
 			/* Volume should be disabled in this case */
@@ -266,7 +266,7 @@
 	if (take_lock && lock_acq)
 	{
 		tmpstat = ocfs_release_lock (osb, OCFS_LKM_EXMODE,
-					     FLAG_DIR|FLAG_READONLY, inode);
+					     FLAG_READONLY, inode);
 		if (tmpstat < 0) {
 			LOG_ERROR_STATUS (tmpstat);
 			/* Volume should be disabled in this case */

Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-09-10 05:26:16 UTC (rev 1451)
+++ trunk/src/inode.c	2004-09-10 20:16:24 UTC (rev 1452)
@@ -588,8 +588,6 @@
 	 * take an extra ref. to avoid recursive calls to
 	 * delete_inode. */
 	atomic_inc(&inode->i_count);
-	if (S_ISDIR(inode->i_mode))
-		lock_flags |= FLAG_DIR;
 	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, lock_flags, 
 				   &fe_bh, inode);
 	atomic_set(&inode->i_count, 0);
@@ -636,13 +634,13 @@
 
 	lock_kernel();
 
-	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, FLAG_DIR,
+	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 0,
 				   &orphan_dir_bh, orphan_dir_inode);
 	if (status < 0) {
 		LOG_ERROR_STATUS(status);
 		goto bail_locked;
 	}
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR,
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0,
 			     orphan_dir_inode);
 
 	status = ocfs_orphan_del(osb, handle, orphan_dir_inode, inode, 

Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-09-10 05:26:16 UTC (rev 1451)
+++ trunk/src/journal.c	2004-09-10 20:16:24 UTC (rev 1452)
@@ -1688,7 +1688,7 @@
 	down_write(&OCFS_I(orphan_dir_inode)->ip_io_sem);
 	status = ocfs_acquire_lock(osb, 
 				   OCFS_LKM_EXMODE,
-				   FLAG_DIR|FLAG_READONLY, 
+				   FLAG_READONLY, 
 				   &lockbh, 
 				   orphan_dir_inode);
 	if (lockbh) {
@@ -1765,7 +1765,7 @@
 	}
 
 	status = ocfs_release_lock (osb, OCFS_LKM_EXMODE, 
-				    FLAG_DIR|FLAG_READONLY, orphan_dir_inode);
+				    FLAG_READONLY, orphan_dir_inode);
 	have_disk_lock = 0;
 	if (status < 0) {
 		LOG_ERROR_STATUS(status);
@@ -1787,7 +1787,7 @@
 
 	if (have_disk_lock) {
 		tmpstat = ocfs_release_lock (osb, OCFS_LKM_EXMODE,
-					     FLAG_DIR|FLAG_READONLY,  
+					     FLAG_READONLY,  
 					     orphan_dir_inode);
 		if (tmpstat < 0)
 			LOG_ERROR_STATUS(tmpstat);

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-09-10 05:26:16 UTC (rev 1451)
+++ trunk/src/namei.c	2004-09-10 20:16:24 UTC (rev 1452)
@@ -238,7 +238,7 @@
 	}
 
 	/* lock the parent directory */
-	status = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE, FLAG_DIR, 
+	status = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE, 0, 
 				    &parent_fe_bh, dir);
 	if (status < 0) {
 		if (status != -EINTR)
@@ -247,7 +247,7 @@
 	}
 
 	/* Ok, we got the lock -- we'd better add it to our transaction */
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR, dir);
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
 
 	dirfe = (ocfs2_dinode *) parent_fe_bh->b_data;
 	if (!dirfe->i_links_count) {
@@ -595,14 +595,14 @@
 	down_write(&OCFS_I(dir)->ip_io_sem);
 	drop_dir_sem = 1;
 	/* lock the parent directory */
-	err = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE, FLAG_DIR, 
+	err = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE, 0, 
 				    &parent_fe_bh, dir);
 	if (err < 0) {
 		if (err != -EINTR)
 			LOG_ERROR_STATUS (err);
 		goto bail;
 	}
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR, dir);
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
 
 	down_write(&OCFS_I(inode)->ip_io_sem);
 	drop_inode_sem = 1;
@@ -692,7 +692,7 @@
 	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);
+	__u32 lockFlags = FLAG_RELEASE_DENTRY;
 	struct buffer_head *fe_bh = NULL;
 	struct buffer_head *parent_node_bh = NULL; /* parent locknode */
 	ocfs_journal_handle *handle = NULL;
@@ -723,13 +723,13 @@
 	down_write(&OCFS_I(dir)->ip_io_sem);
 	down_write(&OCFS_I(inode)->ip_io_sem);
 
-	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, FLAG_DIR, 
+	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 0, 
 				   &parent_node_bh, parentInode);
 	if (status < 0) {
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR, parentInode);
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, parentInode);
 
 	/* this will re-read the directory now with the EXCLUSIVE */
 	/* lock already held; it will also return the blkno to us */
@@ -1042,10 +1042,10 @@
 	/* if old and new are the same, this'll just do one lock. */
 	status = ocfs_double_lock(osb, handle, 
 				  OCFS_LKM_EXMODE, 
-				  FLAG_DIR,
+				  0,
 				  &old_dir_bh, old_dir,
 				  OCFS_LKM_EXMODE, 
-				  FLAG_DIR,
+				  0,
 				  &new_dir_bh, new_dir);
 	if (status < 0) {
 		LOG_ERROR_STATUS(status);
@@ -1069,7 +1069,7 @@
 		/* Directories actually require metadata updates to
 		 * the directory info so we can't get away with not
 		 * doing node locking on it. */
-		oldfe_flags  = FLAG_RELEASE_DENTRY|FLAG_FILE_RENAME|FLAG_DIR;
+		oldfe_flags  = FLAG_RELEASE_DENTRY|FLAG_FILE_RENAME;
 
 		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE,
 					   oldfe_flags, &lockbh, old_inode);
@@ -1152,8 +1152,6 @@
 		if (newfe_blkno != OCFS_I(new_inode)->ip_blkno)
 			BUG();
 
-		if (S_ISDIR(new_inode->i_mode))
-			newfe_flags = FLAG_DIR;
 		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE,
 					   newfe_flags, &newfe_bh, 
 					   new_inode);
@@ -1527,7 +1525,7 @@
 	}
 
 	/* lock the parent directory */
-	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, FLAG_DIR, 
+	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 0, 
 				   &parent_fe_bh, dir);
 	if (status < 0) {
 		if (status != -EINTR)
@@ -1535,7 +1533,7 @@
 		goto abort_trans;
 	}
 
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR, dir);
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
 
 	dirfe = (ocfs2_dinode *) parent_fe_bh->b_data;
 	if (!dirfe->i_links_count) {
@@ -2009,13 +2007,13 @@
 	ocfs_handle_add_inode(handle, orphan_dir_inode);
 
 	/* disk lock orphan dir here. */
-	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, FLAG_DIR,
+	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 0,
 				   &orphan_dir_bh, orphan_dir_inode);
 	if (status < 0) {
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR, 
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, 
 			     orphan_dir_inode);
 
 	status = __ocfs_add_entry(handle, orphan_dir_inode, name, namelen, 

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-09-10 05:26:16 UTC (rev 1451)
+++ trunk/src/nm.c	2004-09-10 20:16:24 UTC (rev 1452)
@@ -471,7 +471,6 @@
 	struct inode *inode = NULL;
 	int master_alive = 1, change_master = 0, write_lock = 0;
 	int inc_inode_seq = 0;
-	int have_io_sem = 0;
 	int change_master_succeeded = 0;
 	__s16 node_num = dlm_msg->src_node;
 	__u64 lock_id, seq_num;
@@ -615,10 +614,6 @@
 	if (change_master && vote_response != FLAG_VOTE_NODE)
 		BUG();
 
-	if (have_io_sem && inode)
-		up_write(&OCFS_I(inode)->ip_io_sem);
-	have_io_sem = 0;
-
 	if (inode && (flags & (FLAG_FILE_EXTEND|FLAG_FILE_TRUNCATE)) && 
 	    ((flags & FLAG_ACQUIRE_LOCK && vote_response==FLAG_VOTE_NODE) ||
 	    (flags & FLAG_RELEASE_LOCK))) {
@@ -662,9 +657,6 @@
 	if (!inode)
 		goto no_inode_leave;
 
-	if (have_io_sem)
-		up_write(&OCFS_I(inode)->ip_io_sem);
-
 	if (inc_inode_seq) {
 		ocfs_inc_inode_seq(osb, inode);
 		sync_mapping_buffers(inode->i_mapping);



More information about the Ocfs2-commits mailing list