[Ocfs2-commits] bryce commits r1682 - branches/bryce/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Dec 1 06:35:29 CST 2004
Author: bryce
Date: 2004-12-01 06:35:27 -0600 (Wed, 01 Dec 2004)
New Revision: 1682
Modified:
branches/bryce/src/suballoc.c
Log:
....
someone out there hates me
cl->cl_recs[group->bryce_bg_chain].bryce_c_free += cpu_to_le32(count);
I have no idea if that line is correct. I think it is though
I'm just worried about the cl_recs[group->bryce_bg_chain] bit which is BE u16
Modified: branches/bryce/src/suballoc.c
===================================================================
--- branches/bryce/src/suballoc.c 2004-12-01 12:05:22 UTC (rev 1681)
+++ branches/bryce/src/suballoc.c 2004-12-01 12:35:27 UTC (rev 1682)
@@ -176,7 +176,7 @@
bg->bryce_bg_blkno = le64_to_cpu(group_blkno);
/* set the 1st bit in the bitmap to account for the descriptor block */
ocfs2_set_bit(0, (unsigned long *) bg->bg_bitmap);
- cpu_to_le16(bg->bryce_bg_free_bits_count) = le16_to_cpu(bg->bryce_bg_bits) - 1;
+ bg->bryce_bg_free_bits_count = cpu_to_le16(le16_to_cpu(bg->bryce_bg_bits) - 1);
status = ocfs_journal_dirty(handle, bg_bh);
if (status < 0)
@@ -366,15 +366,15 @@
goto bail;
}
- cpu_to_le32(cl->cl_recs[alloc_rec].bryce_c_free) += le16_to_cpu(bg->bryce_bg_free_bits_count);
- cpu_to_le32(cl->cl_recs[alloc_rec].bryce_c_total) += le16_to_cpu(bg->bryce_bg_bits);
- cpu_to_le64(cl->cl_recs[alloc_rec].bryce_c_blkno) = bg_blkno;
+ cl->cl_recs[alloc_rec].bryce_c_free += cpu_to_le32(le16_to_cpu(bg->bryce_bg_free_bits_count));
+ cl->cl_recs[alloc_rec].bryce_c_total += cpu_to_le32(le16_to_cpu(bg->bryce_bg_bits));
+ cl->cl_recs[alloc_rec].bryce_c_blkno = cpu_to_le64(bg_blkno);
if (le16_to_cpu(cl->bryce_cl_next_free_rec) < le16_to_cpu(cl->bryce_cl_count))
cpu_to_le16(cl->bryce_cl_next_free_rec)++;
- cpu_to_le32(fe->id1.bitmap1.bryce_i_used) += (le16_to_cpu(bg->bryce_bg_bits) - le16_to_cpu(bg->bryce_bg_free_bits_count));
- cpu_to_le32(fe->id1.bitmap1.bryce_i_total) += le16_to_cpu(bg->bryce_bg_bits);
- cpu_to_le32(fe->bryce_i_clusters) += le16_to_cpu(cl->bryce_cl_cpg);
+ fe->id1.bitmap1.bryce_i_used += cpu_to_le32((le16_to_cpu(bg->bryce_bg_bits) - le16_to_cpu(bg->bryce_bg_free_bits_count)));
+ fe->id1.bitmap1.bryce_i_total += cpu_to_le32(le16_to_cpu(bg->bryce_bg_bits));
+ fe->bryce_i_clusters += cpu_to_le32(le16_to_cpu(cl->bryce_cl_cpg));
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -384,8 +384,8 @@
spin_lock(&OCFS_I(alloc_inode)->ip_lock);
OCFS_I(alloc_inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
- cpu_to_le64(fe->bryce_i_size) = ocfs2_clusters_to_bytes(alloc_inode->i_sb,
- le32_to_cpu(fe->bryce_i_clusters));
+ fe->bryce_i_size = cpu_to_le64(ocfs2_clusters_to_bytes(alloc_inode->i_sb,
+ le32_to_cpu(fe->bryce_i_clusters)));
spin_unlock(&OCFS_I(alloc_inode)->ip_lock);
alloc_inode->i_size = le64_to_cpu(fe->bryce_i_size);
alloc_inode->i_blocks = (alloc_inode->i_size + osb->sb->s_blocksize - 1) >> osb->sb->s_blocksize_bits;
@@ -773,7 +773,7 @@
LOG_ENTRY();
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
- OCFS_ASSERT(cpu_to_le16(bg->bryce_bg_free_bits_count) >= num_bits);
+ OCFS_ASSERT(bg->bryce_bg_free_bits_count >= cpu_to_le16(num_bits));
LOG_TRACE_ARGS("block_group_set_bits: off = %u, num = %u\n", bit_off,
num_bits);
@@ -790,7 +790,7 @@
goto bail;
}
- cpu_to_le16(bg->bryce_bg_free_bits_count) -= num_bits;
+ bg->bryce_bg_free_bits_count -= cpu_to_le16(num_bits);
while(num_bits--)
ocfs2_set_bit(bit_off++, bitmap);
@@ -859,7 +859,7 @@
goto bail;
}
- cpu_to_le64(prev_bg->bryce_bg_next_group) = le64_to_cpu(bg->bryce_bg_next_group);
+ prev_bg->bryce_bg_next_group = cpu_to_le64(le64_to_cpu(bg->bryce_bg_next_group));
status = ocfs_journal_dirty(handle, prev_bg_bh);
if (status < 0) {
@@ -874,7 +874,7 @@
goto bail;
}
- cpu_to_le64(bg->bryce_bg_next_group) = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno);
+ bg->bryce_bg_next_group = cpu_to_le64(le64_to_cpu(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno));
status = ocfs_journal_dirty(handle, bg_bh);
if (status < 0) {
@@ -889,7 +889,7 @@
goto bail;
}
- cpu_to_le64(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno) = le64_to_cpu(bg->bryce_bg_blkno);
+ fe->id2.i_chain.cl_recs[chain].bryce_c_blkno = cpu_to_le64(le64_to_cpu(bg->bryce_bg_blkno));
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -900,9 +900,9 @@
status = 0;
bail:
if (status < 0) {
- cpu_to_le64(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno) = fe_ptr;
- cpu_to_le64(bg->bryce_bg_next_group) = bg_ptr;
- cpu_to_le64(prev_bg->bryce_bg_next_group) = prev_bg_ptr;
+ fe->id2.i_chain.cl_recs[chain].bryce_c_blkno = cpu_to_le64(fe_ptr);
+ bg->bryce_bg_next_group = cpu_to_le64(bg_ptr);
+ prev_bg->bryce_bg_next_group = cpu_to_le64(prev_bg_ptr);
}
LOG_EXIT_STATUS(status);
@@ -1071,8 +1071,8 @@
goto bail;
}
- cpu_to_le32(fe->id1.bitmap1.bryce_i_used) += *num_bits;
- cpu_to_le32(cl->cl_recs[chain].bryce_c_free) -= *num_bits;
+ fe->id1.bitmap1.bryce_i_used += cpu_to_le32(*num_bits);
+ cl->cl_recs[chain].bryce_c_free -= cpu_to_le16(*num_bits);
status = ocfs_journal_dirty(handle,
ac->ac_bh);
@@ -1423,7 +1423,7 @@
ocfs2_set_bit(bit_off + tmp,
(unsigned long *) undo_bg->bg_bitmap);
}
- cpu_to_le16(bg->bryce_bg_free_bits_count) += num_bits;
+ bg->bryce_bg_free_bits_count += cpu_to_le16(num_bits);
status = ocfs_journal_dirty(handle, group_bh);
if (status < 0)
@@ -1486,8 +1486,8 @@
goto bail;
}
- cpu_to_le32(cl->cl_recs[le16_to_cpu(group->bryce_bg_chain)].bryce_c_free) += count;
- cpu_to_le32(fe->id1.bitmap1.bryce_i_used) -= count;
+ cl->cl_recs[group->bryce_bg_chain].bryce_c_free += cpu_to_le32(count);
+ fe->id1.bitmap1.bryce_i_used -= cpu_to_le32(count);
status = ocfs_journal_dirty(handle, alloc_bh);
if (status < 0) {
More information about the Ocfs2-commits
mailing list