[Ocfs2-commits] mfasheh commits r1027 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Jun 8 19:04:41 CDT 2004
Author: mfasheh
Date: 2004-06-08 18:04:39 -0500 (Tue, 08 Jun 2004)
New Revision: 1027
Modified:
trunk/src/dlm.c
Log:
* remove ocfs_wait_for_disk_lock_release as it is unused.
Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c 2004-06-08 22:59:55 UTC (rev 1026)
+++ trunk/src/dlm.c 2004-06-08 23:04:39 UTC (rev 1027)
@@ -175,85 +175,6 @@
} /* ocfs_disk_request_vote */
/*
- * ocfs_wait_for_disk_lock_release()
- *
- * @osb: ocfs super block for the volume
- * @offset:
- * @time_to_wait:
- * @lock_type: lowest level to which a lock must deprecate for us to break out.
- *
- * Returns 0 of success, < 0 if error.
- */
-static int ocfs_wait_for_disk_lock_release (ocfs_super * osb, __u64 offset, __u32 time_to_wait, __u32 lock_type)
-{
- int status = -ETIMEDOUT;
- int tmpstat = -ETIMEDOUT;
- __u32 timewaited = 0;
- ocfs_file_entry *fe = NULL;
- struct buffer_head *bh = NULL;
- __u32 curr_master;
- __u8 lock_level;
-
- LOG_ENTRY ();
-
- /* Create a sepearate thread which should set the event of the */
- /* resource after N retries. */
-
- while (time_to_wait > timewaited) {
- bh = NULL;
- fe = NULL;
-
- tmpstat = ocfs_read_bh (osb, offset, &bh, 0, NULL);
- if (tmpstat < 0) {
- LOG_ERROR_STATUS (status = tmpstat);
- goto finally;
- }
- fe = OCFS_BH_GET_DATA_READ(bh);
- curr_master = DISK_LOCK_CURRENT_MASTER (fe);
- lock_level = DISK_LOCK_FILE_LOCK (fe);
- OCFS_BH_PUT_DATA(bh);
-
- /* This will always be zero when the first Node comes up after reboot */
- /* (for volume lock) */
- if ((curr_master == OCFS_INVALID_NODE_NUM) ||
- (curr_master == osb->node_num)) {
- goto got_it;
- }
-
- if (!IS_NODE_ALIVE (osb->publ_map, curr_master, OCFS_MAXIMUM_NODES)) {
- /* Reset the lock as not owned and return success?? */
- /* This needs to be under some sort of cluster wide lock */
- fe = OCFS_BH_GET_DATA_WRITE(bh);
- DISK_LOCK_CURRENT_MASTER (fe) = OCFS_INVALID_NODE_NUM;
- DISK_LOCK_FILE_LOCK (fe) = OCFS_DLM_NO_LOCK;
- OCFS_BH_PUT_DATA(bh);
- tmpstat = ocfs_write_bh (osb, bh, 0, NULL);
- if (tmpstat < 0) {
- LOG_ERROR_STATUS (status = tmpstat);
- }
- goto got_it;
- }
-
- /* If we are here in the code it means the local node is not the master */
- if (lock_level <= lock_type)
- goto got_it;
-
- brelse(bh);
- ocfs_sleep (WAIT_FOR_VOTE_INCREMENT);
- timewaited += WAIT_FOR_VOTE_INCREMENT;
- continue;
-got_it:
- brelse(bh);
- status = 0;
- break;
- }
-
-finally:
- LOG_EXIT_STATUS (status);
- return status;
-} /* ocfs_wait_for_disk_lock_release */
-
-/*
* ocfs_wait_for_lock_release()
* inode is definitely non NULL
*/
More information about the Ocfs2-commits
mailing list