[Ocfs2-commits] mfasheh commits r1330 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Aug 4 14:39:58 CDT 2004
Author: mfasheh
Date: 2004-08-04 13:39:56 -0500 (Wed, 04 Aug 2004)
New Revision: 1330
Modified:
trunk/src/journal.c
Log:
* some minor cleanup.
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-08-04 01:34:01 UTC (rev 1329)
+++ trunk/src/journal.c 2004-08-04 18:39:56 UTC (rev 1330)
@@ -536,7 +536,7 @@
}
/* This for loop is for debug purposes. Basically we want to check the
- * BH_JBD bit on our buffers. If the handle was checkpointed, then
+ * BH_JBD bit on our buffers. If the transaction was checkpointed, then
* none of them should have that bit set after the revoke
* stage. Otherwise, they *should* have it set. */
#define CHECK_JBD_BUFFERS(buffs, num_buffs) \
@@ -910,9 +910,7 @@
i = handle->num_buffs;
/* Increase the ref count on this buffer. We
* do this because we still want to keep them
- * around after commit so that we can
- * checkpoint them and then "revoke" the whole
- * transaction. */
+ * around in case of abort */
get_bh(bh);
handle->buffs[i] = bh;
handle->num_buffs++;
@@ -1026,7 +1024,6 @@
ocfs2_dinode *fe = NULL;
__u64 lock_id = 0;
struct buffer_head *bh = NULL;
- __u64 alloc_size;
LOG_ENTRY();
@@ -1053,10 +1050,8 @@
down_write(&OCFS_I(inode)->ip_io_sem);
-
SET_INODE_JOURNAL(inode);
- /* TODO: Use another type of lock. */
status = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE,
FLAG_FILE_CREATE, &bh, inode);
if (status < 0) {
@@ -1074,9 +1069,6 @@
"You must run tuneocfs to add a journal for this node.\n",
fe->i_size, OCFS_JOURNAL_DEFAULT_SIZE);
status = -EINVAL;
- }
-
- if (status < 0) {
fe = NULL;
up_write(&OCFS_I(inode)->ip_io_sem);
@@ -1085,16 +1077,18 @@
LOG_TRACE_ARGS("fe->i_size = %llu\n", fe->i_size);
LOG_TRACE_ARGS("fe->i_clusters = %u\n", fe->i_clusters);
-
- /* gonna need this later */
- alloc_size = (u64)fe->i_clusters << osb->s_clustersize_bits;
LOG_TRACE_ARGS("fe->i_blkno = %llu\n", fe->i_blkno);
- inode->i_size = fe->i_size;
- fe = NULL;
+ LOG_TRACE_ARGS("inode->ip_alloc_size = %llu\n",
+ OCFS_I(inode)->ip_alloc_size);
- /* we just changed this but extend_system_file doesn't know
- * about oins, so we update alloc_size ourselves. */
- OCFS_I(inode)->ip_alloc_size = alloc_size;
+ if (OCFS_I(inode)->ip_alloc_size
+ != ((u64)fe->i_clusters << osb->s_clustersize_bits))
+ LOG_ERROR_ARGS("inode and fe alloc sizes differ! "
+ "(%llu != %llu", OCFS_I(inode)->ip_alloc_size,
+ (u64)fe->i_clusters << osb->s_clustersize_bits);
+ if (inode->i_size != fe->i_size)
+ LOG_ERROR_ARGS("inode and fe i_size's differ! (%llu != %llu",
+ inode->i_size, fe->i_size);
/* add this node to openmap and update disk lock */
status = ocfs_update_disk_lock (osb,
@@ -1107,8 +1101,6 @@
goto done;
}
OCFS_I(inode)->ip_open_cnt++;
- LOG_TRACE_ARGS("inode->ip_alloc_size = %llu\n",
- OCFS_I(inode)->ip_alloc_size);
up_write(&OCFS_I(inode)->ip_io_sem);
@@ -1211,7 +1203,7 @@
osb->commit->c_task = NULL;
kfree(osb->commit);
}
-
+
/* Shutdown the kernel journal system */
journal_destroy(journal->k_journal);
More information about the Ocfs2-commits
mailing list