[Ocfs2-commits] rev 743 - in trunk/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Mar 1 18:07:52 CST 2004
Author: mfasheh
Date: 2004-03-01 18:07:50 -0600 (Mon, 01 Mar 2004)
New Revision: 743
Modified:
trunk/src/Makefile
trunk/src/file.c
trunk/src/inc/journal.h
trunk/src/journal.c
trunk/src/namei.c
Log:
* get rid of the ALLOW_NO_HANDLE_SYNCING and OCFS_PARANOID_ABORTS macros. We always want this code on now.
Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile 2004-03-01 23:50:58 UTC (rev 742)
+++ trunk/src/Makefile 2004-03-02 00:07:50 UTC (rev 743)
@@ -56,9 +56,6 @@
endif
-DEFINES += -DALLOW_NO_HANDLE_SYNCING
-DEFINES += -DOCFS_PARANOID_ABORTS
-
ifeq ($(KVER),vmware)
KERNELINC = /usr/src/linux-2.4/include
endif
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-03-01 23:50:58 UTC (rev 742)
+++ trunk/src/file.c 2004-03-02 00:07:50 UTC (rev 743)
@@ -561,9 +561,7 @@
}
/* we want this transaction to return quickly. */
ocfs_handle_set_checkpoint(handle, false);
-#ifdef ALLOW_NO_HANDLE_SYNCING
ocfs_handle_set_sync(handle, false);
-#endif
locktype = bCacheLock ? OCFS_DLM_ENABLE_CACHE_LOCK : OCFS_DLM_EXCLUSIVE_LOCK;
status = ocfs_acquire_lock (osb, lockId, locktype, lockFlags, &pLockResource,
@@ -1177,9 +1175,8 @@
/* we don't want to checkpoint extends. */
ocfs_handle_set_checkpoint(handle, false);
-#ifdef ALLOW_NO_HANDLE_SYNCING
ocfs_handle_set_sync(handle, false);
-#endif
+
/* Grab a lock on the entry found if we have more than
* 1 extents and also make this node the master*/
fileEntry = (ocfs_file_entry *)OCFS_BH_GET_DATA_READ(bh); /* read */
Modified: trunk/src/inc/journal.h
===================================================================
--- trunk/src/inc/journal.h 2004-03-01 23:50:58 UTC (rev 742)
+++ trunk/src/inc/journal.h 2004-03-02 00:07:50 UTC (rev 743)
@@ -102,7 +102,6 @@
struct list_head lock_list;
};
-#ifdef OCFS_PARANOID_ABORTS
typedef struct _ocfs_journal_copyout ocfs_journal_copyout;
struct _ocfs_journal_copyout {
unsigned long blocknr; /* what block is this for? */
@@ -119,7 +118,6 @@
ocfs_free(handle->co_buffs); \
handle->co_buffs = NULL; \
} while (0)
-#endif
typedef struct _ocfs_journal_handle ocfs_journal_handle;
struct _ocfs_journal_handle {
@@ -150,7 +148,6 @@
* release on commit/abort. This
* should be a list_head */
-#ifdef OCFS_PARANOID_ABORTS
int num_co;
ocfs_journal_copyout *co_buffs; /* Copy-out buffers. On 1st
* journal_access of a buffer
@@ -159,7 +156,7 @@
* abort we can place the
* original copy back into the
* buffer. */
-#endif
+
/* The next two structures are ONLY to be used for local alloc
* code. It's very, very ugly. */
struct _ocfs_bitmap_free_head *commit_bits; /* bits to be
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-03-01 23:50:58 UTC (rev 742)
+++ trunk/src/journal.c 2004-03-02 00:07:50 UTC (rev 743)
@@ -71,23 +71,21 @@
}
memset(retval->buffs, 0, sizeof(struct buffer_head *) * max_buffs);
-#ifdef OCFS_PARANOID_ABORTS
retval->co_buffs = ocfs_malloc(sizeof(ocfs_journal_copyout)*max_buffs);
if (!retval->co_buffs) {
LOG_ERROR_STR("Failed to allocate memory for journal co_buffs!");
goto done_free;
}
memset(retval->co_buffs, 0, sizeof(ocfs_journal_copyout) * max_buffs);
-#endif
+
spin_lock_init(&(retval->list_lock));
INIT_LIST_HEAD(&(retval->h_list));
INIT_LIST_HEAD(&(retval->locks));
retval->max_buffs = max_buffs;
retval->num_buffs = 0;
retval->num_locks = 0;
-#ifdef OCFS_PARANOID_ABORTS
retval->num_co = 0;
-#endif
+
retval->journal = &osb->journal;
retval->osb = osb;
retval->commit_bits = retval->abort_bits = NULL;
@@ -407,10 +405,9 @@
up(&journal->commit_sem);
}
-#ifdef OCFS_PARANOID_ABORTS
/* At this point, we don't need the copyout buffers. */
ocfs_handle_free_all_copyout(handle);
-#endif
+
/* we don't free the kernel handle because jbd has freed it. */
if (handle->buffs) {
ocfs_free(handle->buffs);
@@ -451,11 +448,9 @@
int i;
int retval;
ocfs_journal * journal = NULL;
-#ifdef OCFS_PARANOID_ABORTS
int j;
ocfs_journal_copyout *co = NULL;
char *data;
-#endif
LOG_ENTRY();
@@ -472,7 +467,6 @@
* though it were clean, even though it contains aborted
* data!*/
-#ifdef OCFS_PARANOID_ABORTS
/* Ok, we're aborting. For all dirtied buffers, copy our old
* data back in. This should reverse what happened during the
* transaction and revert us back.*/
@@ -497,31 +491,7 @@
/* done copying them, free it now. */
ocfs_handle_free_all_copyout(handle);
-#else
- /* take all our dirtied buffers and make sure they can't be
- * written to disk */
- for(i = 0; i < handle->num_buffs; i++) {
- bh = handle->buffs[i];
- lock_buffer(bh);
- /* this buffer has changed data which we want to
- * consider invalid -- mark the sequence number as
- * old. */
- bh->b_state &= ~STATE_BIT_MASK;
- /* clear the uptodate and dirty flags so this never
- * gets written to disk inadvertantly by someone
- * else. */
- clear_buffer_uptodate(bh);
- clear_buffer_dirty(bh);
-
- unlock_buffer(bh);
- /* journal_forget will bforget the buffers for us too. */
- get_bh(bh); /* keep a reference around so we can
- * reread after our journal_flush */
-
- journal_forget(handle->k_handle, bh);
- }
-#endif
/* want to force our handle to disk in abort case. */
handle->k_handle->h_sync = 1;
@@ -599,10 +569,9 @@
{
int status = -1;
char *data;
-#ifdef OCFS_PARANOID_ABORTS
int i;
bool found = false;
-#endif
+
LOG_ENTRY_ARGS("(bh->b_blocknr=%lu, type=%d (\"%s\"), "
"bh->b_size = %hu)\n",
bh->b_blocknr, type,
@@ -620,8 +589,6 @@
* IO on the buffers while in journal_get_*_access */
data = OCFS_BH_GET_DATA_READ(bh);
-#ifdef OCFS_PARANOID_ABORTS
-
/* search for this buffer in our copyout list. If it's already
* there, we need to do nothing. Otherwise, add it to the
* handle.
@@ -648,7 +615,6 @@
handle->co_buffs[i].blocknr = bh->b_blocknr;
handle->num_co++;
}
-#endif
switch (type) {
case OCFS_JOURNAL_ACCESS_CREATE:
Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c 2004-03-01 23:50:58 UTC (rev 742)
+++ trunk/src/namei.c 2004-03-02 00:07:50 UTC (rev 743)
@@ -224,9 +224,7 @@
}
ocfs_handle_set_checkpoint(handle, false);
-#ifdef ALLOW_NO_HANDLE_SYNCING
ocfs_handle_set_sync(handle, false);
-#endif
/* lock the parent directory */
status = ocfs_acquire_lock (osb, parent_off,
More information about the Ocfs2-commits
mailing list