[Ocfs2-commits] mfasheh commits r1764 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Jan 12 19:09:53 CST 2005
Author: mfasheh
Date: 2005-01-12 19:09:52 -0600 (Wed, 12 Jan 2005)
New Revision: 1764
Modified:
trunk/src/journal.c
Log:
* swab ocfs2_dinode->id1.journal1.ij_flags. This means that the whole
id1 union is swabbed consistently.
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2005-01-13 01:01:12 UTC (rev 1763)
+++ trunk/src/journal.c 2005-01-13 01:09:52 UTC (rev 1764)
@@ -690,7 +690,8 @@
osb->journal->state = OCFS_JOURNAL_LOADED;
osb->journal->trans_id = (unsigned long) 1;
- *dirty = (fe->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL);
+ *dirty = (le32_to_cpu(fe->id1.journal1.ij_flags) &
+ OCFS2_JOURNAL_DIRTY_FL);
status = 0;
done:
if (status < 0) {
@@ -711,6 +712,7 @@
int dirty)
{
int status;
+ unsigned int flags;
ocfs_journal * journal = osb->journal;
struct buffer_head *bh = journal->lockbh;
ocfs2_dinode *fe;
@@ -720,10 +722,12 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
+ flags = le32_to_cpu(fe->id1.journal1.ij_flags);
if (dirty)
- fe->id1.journal1.ij_flags |= OCFS2_JOURNAL_DIRTY_FL;
+ flags |= OCFS2_JOURNAL_DIRTY_FL;
else
- fe->id1.journal1.ij_flags &= ~OCFS2_JOURNAL_DIRTY_FL;
+ flags &= ~OCFS2_JOURNAL_DIRTY_FL;
+ fe->id1.journal1.ij_flags = cpu_to_le32(flags);
status = ocfs_write_block(osb, bh, journal->k_inode);
if (status < 0)
@@ -1053,8 +1057,8 @@
static int ocfs_recover_node(ocfs_super *osb, int node_num)
{
int status = 0;
-// int tmpstat;
int slot_num;
+ unsigned int flags;
ocfs2_dinode *fe;
ocfs2_dinode *local_alloc = NULL;
struct inode *inode = NULL;
@@ -1118,7 +1122,7 @@
fe = (ocfs2_dinode *) bh->b_data;
- if (!(fe->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL)) {
+ if (!(le32_to_cpu(fe->id1.journal1.ij_flags) & OCFS2_JOURNAL_DIRTY_FL)) {
LOG_TRACE_ARGS("No recovery required for node %d\n", node_num);
printk("ocfs2_recover_node: No recovery required for node "
"%d\n", node_num);
@@ -1165,7 +1169,9 @@
LOG_ERROR_STATUS(status);
/* mark the node clean. */
- fe->id1.journal1.ij_flags &= ~OCFS2_JOURNAL_DIRTY_FL;
+ flags = le32_to_cpu(fe->id1.journal1.ij_flags) & ~OCFS2_JOURNAL_DIRTY_FL;
+ fe->id1.journal1.ij_flags = cpu_to_le32(flags);
+
status = ocfs_write_block(osb, bh, inode);
if (status < 0)
LOG_ERROR_STATUS(status);
More information about the Ocfs2-commits
mailing list