[Ocfs2-commits] bryce commits r1677 - branches/bryce/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Nov 30 11:06:45 CST 2004
Author: bryce
Date: 2004-11-30 11:06:44 -0600 (Tue, 30 Nov 2004)
New Revision: 1677
Modified:
branches/bryce/src/alloc.c
branches/bryce/src/alloc.h
branches/bryce/src/aops.c
branches/bryce/src/dir.c
branches/bryce/src/dlm.c
branches/bryce/src/extent_map.c
branches/bryce/src/file.c
branches/bryce/src/inode.c
branches/bryce/src/journal.c
branches/bryce/src/localalloc.c
branches/bryce/src/lockres.c
branches/bryce/src/namei.c
branches/bryce/src/namei.h
branches/bryce/src/ocfs.h
branches/bryce/src/ocfs2_fs.h
branches/bryce/src/ocfs_journal.h
branches/bryce/src/suballoc.c
branches/bryce/src/super.c
branches/bryce/src/volcfg.c
Log:
endian hell
Modified: branches/bryce/src/alloc.c
===================================================================
--- branches/bryce/src/alloc.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/alloc.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -104,9 +104,9 @@
static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
u64 blkno)
{
- return blkno == (ext->e_blkno +
+ return blkno == (le64_to_cpu(ext->bryce_e_blkno) +
ocfs2_clusters_to_blocks(inode->i_sb,
- ext->e_clusters));
+ le32_to_cpu(ext->bryce_e_clusters)));
}
/*
@@ -125,8 +125,8 @@
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
- if (fe->i_last_eb_blk) {
- retval = ocfs_read_block(osb, fe->i_last_eb_blk, &eb_bh,
+ if (le64_to_cpu(fe->bryce_i_last_eb_blk)) {
+ retval = ocfs_read_block(osb, le64_to_cpu(fe->bryce_i_last_eb_blk), &eb_bh,
OCFS_BH_CACHED, inode);
if (retval < 0) {
LOG_ERROR_STATUS(retval);
@@ -137,9 +137,9 @@
} else
el = &(fe->id2.i_list);
- OCFS_ASSERT(el->l_tree_depth == 0);
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_tree_depth) == 0);
- retval = el->l_count - el->l_next_free_rec;
+ retval = le16_to_cpu(el->bryce_l_count) - le16_to_cpu(el->bryce_l_next_free_rec);
bail:
if (eb_bh)
brelse(eb_bh);
@@ -203,17 +203,16 @@
eb = (ocfs2_extent_block *) bhs[i]->b_data;
/* Ok, setup the minimal stuff here. */
strcpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE);
- eb->h_blkno = first_blkno;
- eb->h_fs_generation = osb->fs_generation;
+ cpu_to_le64(eb->bryce_h_blkno) = first_blkno;
#ifndef OCFS_USE_ALL_METADATA_SUBALLOCATORS
/* we always use node zeros suballocator */
- eb->h_suballoc_node = 0;
+ cpu_to_le16(eb->bryce_h_suballoc_node) = 0;
#else
eb->h_suballoc_node = osb->node_num;
#endif
- eb->h_suballoc_bit = suballoc_bit_start;
- eb->h_list.l_count = ocfs2_extent_recs_per_eb(osb->sb);
+ cpu_to_le16(eb->bryce_h_suballoc_bit) = suballoc_bit_start;
+ cpu_to_le16(eb->h_list.bryce_l_count) = ocfs2_extent_recs_per_eb(osb->sb);
suballoc_bit_start++;
first_blkno++;
@@ -286,9 +285,9 @@
el = &fe->id2.i_list;
/* we never add a branch to a leaf. */
- OCFS_ASSERT(el->l_tree_depth);
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_tree_depth));
- new_blocks = el->l_tree_depth;
+ new_blocks = le16_to_cpu(el->bryce_l_tree_depth);
/* allocate the number of new eb blocks we need */
size = sizeof(struct buffer_head *) * new_blocks;
@@ -328,14 +327,14 @@
goto bail;
}
- eb->h_next_leaf_blk = 0;
- eb_el->l_tree_depth = i;
- eb_el->l_next_free_rec = 1;
- eb_el->l_recs[0].e_cpos = fe->i_clusters;
- eb_el->l_recs[0].e_blkno = next_blkno;
- eb_el->l_recs[0].e_clusters = 0;
- if (!eb_el->l_tree_depth)
- new_last_eb_blk = eb->h_blkno;
+ cpu_to_le64(eb->bryce_h_next_leaf_blk) = 0;
+ cpu_to_le16(eb_el->bryce_l_tree_depth) = i;
+ cpu_to_le16(eb_el->bryce_l_next_free_rec) = 1;
+ cpu_to_le32(eb_el->l_recs[0].bryce_e_cpos) = le32_to_cpu(fe->bryce_i_clusters);
+ cpu_to_le64(eb_el->l_recs[0].bryce_e_blkno) = next_blkno;
+ cpu_to_le32(eb_el->l_recs[0].bryce_e_clusters) = 0;
+ if (!le16_to_cpu(eb_el->bryce_l_tree_depth))
+ new_last_eb_blk = le64_to_cpu(eb->bryce_h_blkno);
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -343,7 +342,7 @@
goto bail;
}
- next_blkno = eb->h_blkno;
+ next_blkno = le64_to_cpu(eb->bryce_h_blkno);
}
/* This is a bit hairy. We want to update up to three blocks
@@ -375,18 +374,18 @@
/* Link the new branch into the rest of the tree (el will
* either be on the fe, or the extent block passed in. */
- i = el->l_next_free_rec;
- el->l_recs[i].e_blkno = next_blkno;
- el->l_recs[i].e_cpos = fe->i_clusters;
- el->l_recs[i].e_clusters = 0;
- el->l_next_free_rec++;
+ i = le16_to_cpu(el->bryce_l_next_free_rec);
+ cpu_to_le64(el->l_recs[i].bryce_e_blkno) = next_blkno;
+ cpu_to_le32(el->l_recs[i].bryce_e_cpos) = le32_to_cpu(fe->bryce_i_clusters);
+ cpu_to_le32(el->l_recs[i].bryce_e_clusters) = 0;
+ cpu_to_le16(el->bryce_l_next_free_rec)++;
/* fe needs a new last extent block pointer, as does the
* next_leaf on the previously last-extent-block. */
- fe->i_last_eb_blk = new_last_eb_blk;
+ cpu_to_le64(fe->bryce_i_last_eb_blk) = new_last_eb_blk;
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
- eb->h_next_leaf_blk = new_last_eb_blk;
+ cpu_to_le64(eb->bryce_h_next_leaf_blk) = new_last_eb_blk;
status = ocfs_journal_dirty(handle, last_eb_bh);
if (status < 0)
@@ -457,12 +456,12 @@
}
/* copy the fe data into the new extent block */
- eb_el->l_tree_depth = fe_el->l_tree_depth;
- eb_el->l_next_free_rec = fe_el->l_next_free_rec;
- for(i = 0; i < fe_el->l_next_free_rec; i++) {
- eb_el->l_recs[i].e_cpos = fe_el->l_recs[i].e_cpos;
- eb_el->l_recs[i].e_clusters = fe_el->l_recs[i].e_clusters;
- eb_el->l_recs[i].e_blkno = fe_el->l_recs[i].e_blkno;
+ cpu_to_le16(eb_el->bryce_l_tree_depth) = le16_to_cpu(fe_el->bryce_l_tree_depth);
+ cpu_to_le16(eb_el->bryce_l_next_free_rec) = le16_to_cpu(fe_el->bryce_l_next_free_rec);
+ for(i = 0; i < le16_to_cpu(fe_el->bryce_l_next_free_rec); i++) {
+ cpu_to_le32(eb_el->l_recs[i].bryce_e_cpos) = le32_to_cpu(fe_el->l_recs[i].bryce_e_cpos);
+ cpu_to_le32(eb_el->l_recs[i].bryce_e_clusters) = le32_to_cpu(fe_el->l_recs[i].bryce_e_clusters);
+ cpu_to_le64(eb_el->l_recs[i].bryce_e_blkno) = le64_to_cpu(fe_el->l_recs[i].bryce_e_blkno);
}
status = ocfs_journal_dirty(handle, new_eb_bh);
@@ -479,21 +478,21 @@
}
/* update fe now */
- fe_el->l_tree_depth++;
- fe_el->l_recs[0].e_cpos = 0;
- fe_el->l_recs[0].e_blkno = eb->h_blkno;
- fe_el->l_recs[0].e_clusters = fe->i_clusters;
- for(i = 1; i < fe_el->l_next_free_rec; i++) {
- fe_el->l_recs[i].e_cpos = 0;
- fe_el->l_recs[i].e_clusters = 0;
- fe_el->l_recs[i].e_blkno = 0;
+ cpu_to_le16(fe_el->bryce_l_tree_depth)++;
+ cpu_to_le32(fe_el->l_recs[0].bryce_e_cpos) = 0;
+ cpu_to_le64(fe_el->l_recs[0].bryce_e_blkno) = le64_to_cpu(eb->bryce_h_blkno);
+ cpu_to_le32(fe_el->l_recs[0].bryce_e_clusters) = le32_to_cpu(fe->bryce_i_clusters);
+ for(i = 1; i < le16_to_cpu(fe_el->bryce_l_next_free_rec); i++) {
+ cpu_to_le32(fe_el->l_recs[i].bryce_e_cpos) = 0;
+ cpu_to_le32(fe_el->l_recs[i].bryce_e_clusters) = 0;
+ cpu_to_le64(fe_el->l_recs[i].bryce_e_blkno) = 0;
}
- fe_el->l_next_free_rec = 1;
+ cpu_to_le16(fe_el->bryce_l_next_free_rec) = 1;
/* If this is our 1st tree depth shift, then last_eb_blk
* becomes the allocated extent block */
- if (fe_el->l_tree_depth == 1)
- fe->i_last_eb_blk = eb->h_blkno;
+ if (le16_to_cpu(fe_el->bryce_l_tree_depth) == 1)
+ cpu_to_le64(fe->bryce_i_last_eb_blk) = le64_to_cpu(eb->bryce_h_blkno);
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -544,14 +543,14 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
- if (el->l_tree_depth) {
+ if (le16_to_cpu(el->bryce_l_tree_depth)) {
/* This is another operation where we want to be
* careful about our tree updates. An error here means
* none of the previous changes we made should roll
* forward. As a result, we have to record the buffers
* for this part of the tree in an array and reserve a
* journal write to them before making any changes. */
- num_bhs = fe->id2.i_list.l_tree_depth;
+ num_bhs = le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth);
eb_bhs = kmalloc(sizeof(struct buffer_head *) * num_bhs,
GFP_KERNEL);
if (!eb_bhs) {
@@ -562,9 +561,9 @@
memset(eb_bhs, 0, sizeof(struct buffer_head *) * num_bhs);
i = 0;
- while(el->l_tree_depth) {
- OCFS_ASSERT_RO(el->l_next_free_rec);
- next_blkno = el->l_recs[el->l_next_free_rec-1].e_blkno;
+ while(le16_to_cpu(el->bryce_l_tree_depth)) {
+ OCFS_ASSERT_RO(le16_to_cpu(el->bryce_l_next_free_rec));
+ next_blkno = le64_to_cpu(el->l_recs[le16_to_cpu(el->bryce_l_next_free_rec)-1].bryce_e_blkno);
OCFS_ASSERT(i < num_bhs);
status = ocfs_read_block(osb, next_blkno, &eb_bhs[i],
@@ -588,15 +587,15 @@
/* When we leave this loop, eb_bhs[num_bhs - 1] will
* hold the bottom-most leaf extent block. */
}
- OCFS_ASSERT(!el->l_tree_depth);
+ OCFS_ASSERT(!le16_to_cpu(el->bryce_l_tree_depth));
el = &fe->id2.i_list;
/* If we have tree depth, then the fe update is
* trivial, and we want to switch el out for the
* bottom-most leaf in order to update it with the
* actual extent data below. */
- OCFS_ASSERT_RO(el->l_next_free_rec);
- el->l_recs[el->l_next_free_rec - 1].e_clusters += new_clusters;
+ OCFS_ASSERT_RO(le16_to_cpu(el->bryce_l_next_free_rec));
+ cpu_to_le32(el->l_recs[le16_to_cpu(el->bryce_l_next_free_rec) - 1].bryce_e_clusters) += new_clusters;
/* (num_bhs - 1) to avoid the leaf */
for(i = 0; i < (num_bhs - 1); i++) {
eb = (ocfs2_extent_block *) eb_bhs[i]->b_data;
@@ -604,7 +603,7 @@
/* finally, make our actual change to the
* intermediate extent blocks. */
- el->l_recs[el->l_next_free_rec - 1].e_clusters
+ cpu_to_le32(el->l_recs[le16_to_cpu(el->bryce_l_next_free_rec) - 1].bryce_e_clusters)
+= new_clusters;
status = ocfs_journal_dirty(handle, eb_bhs[i]);
@@ -616,31 +615,31 @@
* the loop above */
eb = (ocfs2_extent_block *) eb_bhs[num_bhs - 1]->b_data;
el = &eb->h_list;
- OCFS_ASSERT(!el->l_tree_depth);
+ OCFS_ASSERT(!le16_to_cpu(el->bryce_l_tree_depth));
}
/* yay, we can finally add the actual extent now! */
- i = el->l_next_free_rec - 1;
- if (el->l_next_free_rec && ocfs_extent_contig(inode,
+ i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
+ if (le16_to_cpu(el->bryce_l_next_free_rec) && ocfs_extent_contig(inode,
&el->l_recs[i],
start_blk)) {
- el->l_recs[i].e_clusters += new_clusters;
- } else if (el->l_next_free_rec && !el->l_recs[i].e_clusters) {
+ cpu_to_le32(el->l_recs[i].bryce_e_clusters) += new_clusters;
+ } else if (le16_to_cpu(el->bryce_l_next_free_rec) && !le32_to_cpu(el->l_recs[i].bryce_e_clusters)) {
/* having an empty extent at eof is legal. */
- OCFS_ASSERT_RO(el->l_recs[i].e_cpos == fe->i_clusters);
- el->l_recs[i].e_blkno = start_blk;
- el->l_recs[i].e_clusters = new_clusters;
+ OCFS_ASSERT_RO(le32_to_cpu(el->l_recs[i].bryce_e_cpos) == le32_to_cpu(fe->bryce_i_clusters));
+ cpu_to_le64(el->l_recs[i].bryce_e_blkno) = start_blk;
+ cpu_to_le32(el->l_recs[i].bryce_e_clusters) = new_clusters;
} else {
/* No contiguous record, or no empty record at eof, so
* we add a new one. */
- OCFS_ASSERT(el->l_next_free_rec < el->l_count);
- i = el->l_next_free_rec;
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec) < le16_to_cpu(el->bryce_l_count));
+ i = le16_to_cpu(el->bryce_l_next_free_rec);
- el->l_recs[i].e_blkno = start_blk;
- el->l_recs[i].e_clusters = new_clusters;
- el->l_recs[i].e_cpos = fe->i_clusters;
- el->l_next_free_rec++;
+ cpu_to_le64(el->l_recs[i].bryce_e_blkno) = start_blk;
+ cpu_to_le32(el->l_recs[i].bryce_e_clusters) = new_clusters;
+ cpu_to_le32(el->l_recs[i].bryce_e_cpos) = le32_to_cpu(fe->bryce_i_clusters);
+ cpu_to_le16(el->bryce_l_next_free_rec)++;
}
/*
@@ -651,13 +650,13 @@
new_clusters);
if (status) {
LOG_ERROR_STATUS(status);
- ocfs2_extent_map_drop(inode, fe->i_clusters);
+ ocfs2_extent_map_drop(inode, le32_to_cpu(fe->bryce_i_clusters));
}
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0)
LOG_ERROR_STATUS(status);
- if (fe->id2.i_list.l_tree_depth) {
+ if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)) {
status = ocfs_journal_dirty(handle, eb_bhs[num_bhs - 1]);
if (status < 0)
LOG_ERROR_STATUS(status);
@@ -715,10 +714,10 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
- while(el->l_tree_depth > 1) {
- OCFS_ASSERT_RO(el->l_next_free_rec);
- i = el->l_next_free_rec - 1;
- blkno = el->l_recs[i].e_blkno;
+ while(le16_to_cpu(el->bryce_l_tree_depth) > 1) {
+ OCFS_ASSERT_RO(le16_to_cpu(el->bryce_l_next_free_rec));
+ i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
+ blkno = le64_to_cpu(el->l_recs[i].bryce_e_blkno);
OCFS_ASSERT_RO(blkno);
if (bh) {
@@ -737,7 +736,7 @@
OCFS_ASSERT_RO(IS_VALID_EXTENT_BLOCK(eb));
el = &eb->h_list;
- if (el->l_next_free_rec < el->l_count) {
+ if (le16_to_cpu(el->bryce_l_next_free_rec) < le16_to_cpu(el->bryce_l_count)) {
if (lowest_bh)
brelse(lowest_bh);
lowest_bh = bh;
@@ -748,7 +747,7 @@
/* If we didn't find one and the fe doesn't have any room,
* then return '1' */
if (!lowest_bh
- && (fe->id2.i_list.l_next_free_rec == fe->id2.i_list.l_count))
+ && (le16_to_cpu(fe->id2.i_list.bryce_l_next_free_rec) == le16_to_cpu(fe->id2.i_list.bryce_l_count)))
status = 1;
*target_bh = lowest_bh;
@@ -785,9 +784,9 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
- if (el->l_tree_depth) {
+ if (le16_to_cpu(el->bryce_l_tree_depth)) {
/* jump to end of tree */
- status = ocfs_read_block(osb, fe->i_last_eb_blk, &last_eb_bh,
+ status = ocfs_read_block(osb, le64_to_cpu(fe->bryce_i_last_eb_blk), &last_eb_bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
LOG_EXIT_STATUS(status);
@@ -798,10 +797,10 @@
}
/* Can we allocate without adding/shifting tree bits? */
- i = el->l_next_free_rec - 1;
- if (!el->l_next_free_rec
- || (el->l_next_free_rec < el->l_count)
- || !el->l_recs[i].e_clusters
+ i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
+ if (!le16_to_cpu(el->bryce_l_next_free_rec)
+ || (le16_to_cpu(el->bryce_l_next_free_rec) < le16_to_cpu(el->bryce_l_count))
+ || !le32_to_cpu(el->l_recs[i].bryce_e_clusters)
|| ocfs_extent_contig(inode, &el->l_recs[i], start_blk))
goto out_add;
@@ -818,11 +817,11 @@
/* We traveled all the way to the bottom and found nothing. */
if (shift) {
/* if we hit a leaf, we'd better be empty :) */
- OCFS_ASSERT(el->l_next_free_rec == el->l_count);
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec) == le16_to_cpu(el->bryce_l_count));
OCFS_ASSERT(!bh);
LOG_TRACE_ARGS("ocfs2_allocate_extent: need to shift tree "
"depth (current = %u)\n",
- fe->id2.i_list.l_tree_depth);
+ le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth));
/* ocfs2_shift_tree_depth will return us a buffer with
* the new extent block (so we can pass that to
@@ -835,7 +834,7 @@
}
/* Special case: we have room now if we shifted from
* tree_depth 0 */
- if (fe->id2.i_list.l_tree_depth == 1)
+ if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth) == 1)
goto out_add;
}
@@ -889,7 +888,7 @@
*new_last_eb = NULL;
/* we have no tree, so of course, no last_eb. */
- if (!fe->id2.i_list.l_tree_depth)
+ if (!le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth))
goto bail;
/* trunc to zero special case - this makes tree_depth = 0
@@ -899,11 +898,11 @@
eb = (ocfs2_extent_block *) old_last_eb->b_data;
el = &(eb->h_list);
- OCFS_ASSERT(el->l_next_free_rec);
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
/* Make sure that this guy will actually be empty after we
* clear away the data. */
- if (el->l_recs[0].e_cpos < new_i_clusters)
+ if (le32_to_cpu(el->l_recs[0].bryce_e_cpos) < new_i_clusters)
goto bail;
/* Ok, at this point, we know that last_eb will definitely
@@ -912,9 +911,9 @@
el = &(fe->id2.i_list);
/* go down the tree, */
do {
- for(i = (el->l_next_free_rec - 1); i >= 0; i--) {
- if (el->l_recs[i].e_cpos < new_i_clusters) {
- block = el->l_recs[i].e_blkno;
+ for(i = (le16_to_cpu(el->bryce_l_next_free_rec) - 1); i >= 0; i--) {
+ if (le32_to_cpu(el->l_recs[i].bryce_e_cpos) < new_i_clusters) {
+ block = le64_to_cpu(el->l_recs[i].bryce_e_blkno);
break;
}
}
@@ -934,11 +933,11 @@
eb = (ocfs2_extent_block *) bh->b_data;
el = &(eb->h_list);
OCFS_ASSERT(IS_VALID_EXTENT_BLOCK(eb));
- } while (el->l_tree_depth);
+ } while (le16_to_cpu(el->bryce_l_tree_depth));
*new_last_eb = bh;
get_bh(*new_last_eb);
- LOG_TRACE_ARGS("returning block %llu\n", eb->h_blkno);
+ LOG_TRACE_ARGS("returning block %llu\n", le64_to_cpu(eb->bryce_h_blkno));
bail:
if (bh)
brelse(bh);
@@ -970,7 +969,7 @@
status = ocfs_find_new_last_ext_blk(osb,
inode,
fe,
- fe->i_clusters - clusters_to_del,
+ le32_to_cpu(fe->bryce_i_clusters) - clusters_to_del,
old_last_eb_bh,
&last_eb_bh);
if (status < 0) {
@@ -989,41 +988,41 @@
el = &(fe->id2.i_list);
spin_lock(&OCFS_I(inode)->ip_lock);
- OCFS_I(inode)->ip_clusters = fe->i_clusters - clusters_to_del;
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters) - clusters_to_del;
spin_unlock(&OCFS_I(inode)->ip_lock);
- fe->i_clusters -= clusters_to_del;
- fe->i_mtime = OCFS_CURRENT_TIME;
+ cpu_to_le32(fe->bryce_i_clusters) -= clusters_to_del;
+ cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
- i = el->l_next_free_rec - 1;
+ i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
- OCFS_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
- el->l_recs[i].e_clusters -= clusters_to_del;
+ OCFS_ASSERT(le32_to_cpu(el->l_recs[i].bryce_e_clusters) >= clusters_to_del);
+ cpu_to_le32(el->l_recs[i].bryce_e_clusters) -= clusters_to_del;
/* tree depth zero, we can just delete the clusters, otherwise
* we need to record the offset of the next level extent block
* as we may overwrite it. */
- if (!el->l_tree_depth)
- delete_blk = el->l_recs[i].e_blkno + el->l_recs[i].e_clusters;
+ if (!le16_to_cpu(el->bryce_l_tree_depth))
+ delete_blk = le64_to_cpu(el->l_recs[i].bryce_e_blkno) + le32_to_cpu(el->l_recs[i].bryce_e_clusters);
else
- next_eb = el->l_recs[i].e_blkno;
+ next_eb = le64_to_cpu(el->l_recs[i].bryce_e_blkno);
- if (!el->l_recs[i].e_clusters) {
+ if (!le32_to_cpu(el->l_recs[i].bryce_e_clusters)) {
/* if we deleted the whole extent record, then clear
* out the other fields and update the extent
* list. For depth > 0 trees, we've already recorded
* the extent block in 'next_eb' */
- el->l_recs[i].e_cpos = 0;
- el->l_recs[i].e_blkno = 0;
- OCFS_ASSERT(el->l_next_free_rec);
- el->l_next_free_rec--;
+ cpu_to_le32(el->l_recs[i].bryce_e_cpos) = 0;
+ cpu_to_le64(el->l_recs[i].bryce_e_blkno) = 0;
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
+ cpu_to_le16(el->bryce_l_next_free_rec)--;
}
- depth = el->l_tree_depth;
- if (!fe->i_clusters) {
+ depth = le16_to_cpu(el->bryce_l_tree_depth);
+ if (!le32_to_cpu(fe->bryce_i_clusters)) {
/* trunc to zero is a special case. */
- el->l_tree_depth = 0;
- fe->i_last_eb_blk = 0;
+ cpu_to_le16(el->bryce_l_tree_depth) = 0;
+ cpu_to_le64(fe->bryce_i_last_eb_blk) = 0;
} else if (last_eb)
- fe->i_last_eb_blk = last_eb->h_blkno;
+ cpu_to_le64(fe->bryce_i_last_eb_blk) = le64_to_cpu(last_eb->bryce_h_blkno);
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -1041,7 +1040,7 @@
LOG_ERROR_STATUS(status);
goto bail;
}
- last_eb->h_next_leaf_blk = 0;
+ cpu_to_le64(last_eb->bryce_h_next_leaf_blk) = 0;
status = ocfs_journal_dirty(handle, last_eb_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1070,34 +1069,42 @@
goto bail;
}
- OCFS_ASSERT(el->l_next_free_rec);
- OCFS_ASSERT(depth == (el->l_tree_depth + 1));
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
+ OCFS_ASSERT(depth == (le16_to_cpu(el->bryce_l_tree_depth) + 1));
- i = el->l_next_free_rec - 1;
+ i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
LOG_TRACE_ARGS("extent block %llu, before: record %d: "
- "(%u, %u, %llu), next = %u\n", eb->h_blkno, i,
- el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
- el->l_recs[i].e_blkno, el->l_next_free_rec);
+ "(%u, %u, %llu), next = %u\n",
+ le64_to_cpu(eb->bryce_h_blkno),
+ i,
+ le32_to_cpu(el->l_recs[i].bryce_e_cpos),
+ le32_to_cpu(el->l_recs[i].bryce_e_clusters),
+ le64_to_cpu(el->l_recs[i].bryce_e_blkno),
+ le16_to_cpu(el->bryce_l_next_free_rec));
- OCFS_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
- el->l_recs[i].e_clusters -= clusters_to_del;
+ OCFS_ASSERT(le32_to_cpu(el->l_recs[i].bryce_e_clusters) >= clusters_to_del);
+ cpu_to_le32(el->l_recs[i].bryce_e_clusters) -= clusters_to_del;
- next_eb = el->l_recs[i].e_blkno;
+ next_eb = le64_to_cpu(el->l_recs[i].bryce_e_blkno);
/* bottom-most block requires us to delete data.*/
- if (!el->l_tree_depth)
- delete_blk = el->l_recs[i].e_blkno +
- el->l_recs[i].e_clusters;
- if (!el->l_recs[i].e_clusters) {
- el->l_recs[i].e_cpos = 0;
- el->l_recs[i].e_blkno = 0;
- OCFS_ASSERT(el->l_next_free_rec);
- el->l_next_free_rec--;
+ if (!le16_to_cpu(el->bryce_l_tree_depth))
+ delete_blk = le64_to_cpu(el->l_recs[i].bryce_e_blkno) +
+ le32_to_cpu(el->l_recs[i].bryce_e_clusters);
+ if (!le32_to_cpu(el->l_recs[i].bryce_e_clusters)) {
+ cpu_to_le32(el->l_recs[i].bryce_e_cpos) = 0;
+ cpu_to_le64(el->l_recs[i].bryce_e_blkno) = 0;
+ OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
+ cpu_to_le16(el->bryce_l_next_free_rec)--;
}
LOG_TRACE_ARGS("extent block %llu, after: record %d: "
- "(%u, %u, %llu), next = %u\n", eb->h_blkno, i,
- el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
- el->l_recs[i].e_blkno, el->l_next_free_rec);
+ "(%u, %u, %llu), next = %u\n",
+ le64_to_cpu(eb->bryce_h_blkno),
+ i,
+ le32_to_cpu(el->l_recs[i].bryce_e_cpos),
+ le32_to_cpu(el->l_recs[i].bryce_e_clusters),
+ le64_to_cpu(el->l_recs[i].bryce_e_blkno),
+ le16_to_cpu(el->bryce_l_next_free_rec));
status = ocfs_journal_dirty(handle, eb_bh);
if (status < 0) {
@@ -1105,12 +1112,12 @@
goto bail;
}
- if (!el->l_next_free_rec) {
+ if (!le16_to_cpu(el->bryce_l_next_free_rec)) {
LOG_TRACE_ARGS("deleting this extent block.\n");
- OCFS_ASSERT(!eb->h_suballoc_node);
- OCFS_ASSERT(!el->l_recs[0].e_clusters);
- OCFS_ASSERT(!el->l_recs[0].e_cpos);
- OCFS_ASSERT(!el->l_recs[0].e_blkno);
+ OCFS_ASSERT(!le16_to_cpu(eb->bryce_h_suballoc_node));
+ OCFS_ASSERT(!le32_to_cpu(el->l_recs[0].bryce_e_clusters));
+ OCFS_ASSERT(!le32_to_cpu(el->l_recs[0].bryce_e_cpos));
+ OCFS_ASSERT(!le64_to_cpu(el->l_recs[0].bryce_e_blkno));
status = ocfs2_free_extent_block(handle,
tc->tc_ext_alloc_inode,
tc->tc_ext_alloc_bh,
@@ -1136,7 +1143,7 @@
status = 0;
bail:
if (!status)
- ocfs2_extent_map_trunc(inode, fe->i_clusters);
+ ocfs2_extent_map_trunc(inode, le32_to_cpu(fe->bryce_i_clusters));
else
ocfs2_extent_map_drop(inode, 0);
LOG_EXIT_STATUS(status);
@@ -1178,23 +1185,23 @@
inode->i_size);
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (fe->id2.i_list.l_tree_depth) {
+ if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)) {
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
el = &(eb->h_list);
} else
el = &(fe->id2.i_list);
- last_eb = fe->i_last_eb_blk;
+ last_eb = le64_to_cpu(fe->bryce_i_last_eb_blk);
start:
LOG_TRACE_ARGS("ocfs_commit_truncate: fe->i_clusters = %u, "
"last_eb = %llu, fe->i_last_eb_blk = %llu, "
"fe->id2.i_list.l_tree_depth = %u last_eb_bh = %p\n",
- fe->i_clusters, last_eb, fe->i_last_eb_blk,
- fe->id2.i_list.l_tree_depth, last_eb_bh);
+ le32_to_cpu(fe->bryce_i_clusters), last_eb, le64_to_cpu(fe->bryce_i_last_eb_blk),
+ le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth), last_eb_bh);
- if (last_eb != fe->i_last_eb_blk) {
+ if (last_eb != le64_to_cpu(fe->bryce_i_last_eb_blk)) {
LOG_TRACE_ARGS("last_eb changed!\n");
- OCFS_ASSERT(fe->id2.i_list.l_tree_depth);
- last_eb = fe->i_last_eb_blk;
+ OCFS_ASSERT(le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth));
+ last_eb = le64_to_cpu(fe->bryce_i_last_eb_blk);
/* i_last_eb_blk may have changed, read it if
* necessary. We don't have to worry about the
* truncate to zero case here (where there becomes no
@@ -1219,12 +1226,13 @@
/* by now, el will point to the extent list on the bottom most
* portion of this tree. */
- i = el->l_next_free_rec - 1;
- if (el->l_recs[i].e_cpos >= target_i_clusters)
- clusters_to_del = el->l_recs[i].e_clusters;
+ i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
+ if (le32_to_cpu(el->l_recs[i].bryce_e_cpos) >= target_i_clusters)
+ clusters_to_del = le32_to_cpu(el->l_recs[i].bryce_e_clusters);
else
- clusters_to_del = (el->l_recs[i].e_clusters
- + el->l_recs[i].e_cpos) - target_i_clusters;
+ clusters_to_del = (le32_to_cpu(el->l_recs[i].bryce_e_clusters)
+ + le32_to_cpu(el->l_recs[i].bryce_e_cpos))
+ - target_i_clusters;
LOG_TRACE_ARGS("clusters_to_del = %u in this pass\n", clusters_to_del);
credits = ocfs_calc_tree_trunc_credits(osb->sb, clusters_to_del,
@@ -1251,8 +1259,8 @@
goto bail;
}
- OCFS_ASSERT(fe->i_clusters >= target_i_clusters);
- if (fe->i_clusters > target_i_clusters)
+ OCFS_ASSERT(le32_to_cpu(fe->bryce_i_clusters) >= target_i_clusters);
+ if (le32_to_cpu(fe->bryce_i_clusters) > target_i_clusters)
goto start;
bail:
up_write(&OCFS_I(inode)->ip_alloc_sem);
@@ -1298,9 +1306,9 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
LOG_TRACE_ARGS("fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
- "%llu\n", fe->i_clusters, new_i_clusters, fe->i_size);
+ "%llu\n", le32_to_cpu(fe->bryce_i_clusters), new_i_clusters, le64_to_cpu(fe->bryce_i_size));
- OCFS_ASSERT(fe->i_clusters > new_i_clusters);
+ OCFS_ASSERT(le32_to_cpu(fe->bryce_i_clusters) > new_i_clusters);
*tc = kmalloc(sizeof(ocfs2_truncate_context), GFP_KERNEL);
if (!(*tc)) {
@@ -1318,11 +1326,11 @@
}
metadata_delete = 0;
- if (fe->id2.i_list.l_tree_depth) {
+ if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)) {
/* If we have a tree, then the truncate may result in
* metadata deletes. Figure this out from the
* rightmost leaf block.*/
- status = ocfs_read_block(osb, fe->i_last_eb_blk,
+ status = ocfs_read_block(osb, le64_to_cpu(fe->bryce_i_last_eb_blk),
&last_eb_bh, OCFS_BH_CACHED, inode);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1331,7 +1339,7 @@
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
OCFS_ASSERT(IS_VALID_EXTENT_BLOCK(eb));
el = &(eb->h_list);
- if (el->l_recs[0].e_cpos >= new_i_clusters)
+ if (le32_to_cpu(el->l_recs[0].bryce_e_cpos) >= new_i_clusters)
metadata_delete = 1;
}
Modified: branches/bryce/src/alloc.h
===================================================================
--- branches/bryce/src/alloc.h 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/alloc.h 2004-11-30 17:06:44 UTC (rev 1677)
@@ -48,7 +48,7 @@
* new tree_depth==0 extent_block, and one block at the new
* top-of-the tree.
*/
- return(fe->id2.i_list.l_tree_depth + 2);
+ return(le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth) + 2);
}
typedef struct _ocfs2_truncate_context {
Modified: branches/bryce/src/aops.c
===================================================================
--- branches/bryce/src/aops.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/aops.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -75,7 +75,7 @@
}
if ((u64)iblock >= ocfs2_clusters_to_blocks(inode->i_sb,
- fe->i_clusters)) {
+ le32_to_cpu(fe->bryce_i_clusters))) {
LOG_ERROR_ARGS ("block offset is outside the allocated size: %llu",
(unsigned long long)iblock);
goto bail;
@@ -85,7 +85,7 @@
* need be, copy it over from the buffer cache. */
if (!buffer_uptodate(bh_result) && ocfs_inode_is_new(osb, inode)) {
buffer_cache_bh = sb_getblk(osb->sb,
- fe->id2.i_list.l_recs[0].e_blkno + iblock);
+ le64_to_cpu(fe->id2.i_list.l_recs[0].bryce_e_blkno) + iblock);
if (!buffer_cache_bh) {
LOG_ERROR_STR("couldn't getblock for symlink!");
goto bail;
@@ -112,7 +112,7 @@
}
map_bh(bh_result, inode->i_sb,
- fe->id2.i_list.l_recs[0].e_blkno + iblock);
+ le64_to_cpu(fe->id2.i_list.l_recs[0].bryce_e_blkno) + iblock);
err = 0;
Modified: branches/bryce/src/dir.c
===================================================================
--- branches/bryce/src/dir.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/dir.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -143,10 +143,10 @@
* least that it is non-zero. A
* failure will be detected in the
* dirent test below. */
- if (le16_to_cpu(de->rec_len) <
+ if (le16_to_cpu(de->bryce_rec_len) <
OCFS2_DIR_REC_LEN(1))
break;
- i += le16_to_cpu(de->rec_len);
+ i += le16_to_cpu(de->bryce_rec_len);
}
offset = i;
filp->f_pos = (filp->f_pos & ~(sb->s_blocksize - 1))
@@ -165,8 +165,8 @@
brelse (bh);
goto bail;
}
- offset += le16_to_cpu(de->rec_len);
- if (le64_to_cpu(de->inode)) {
+ offset += le16_to_cpu(de->bryce_rec_len);
+ if (le64_to_cpu(de->bryce_inode)) {
/* We might block in the next section
* if the data destination is
* currently swapped out. So, use a
@@ -182,7 +182,7 @@
error = filldir(dirent, de->name,
de->name_len,
filp->f_pos,
- ino_from_blkno(sb, le64_to_cpu(de->inode)),
+ ino_from_blkno(sb, le64_to_cpu(de->bryce_inode)),
d_type);
if (error)
break;
@@ -190,7 +190,7 @@
goto revalidate;
stored ++;
}
- filp->f_pos += le16_to_cpu(de->rec_len);
+ filp->f_pos += le16_to_cpu(de->bryce_rec_len);
}
offset = 0;
brelse (bh);
@@ -248,7 +248,7 @@
goto leave;
}
- *blkno = le64_to_cpu((*dirent)->inode);
+ *blkno = le64_to_cpu((*dirent)->bryce_inode);
status = 0;
leave:
@@ -297,9 +297,9 @@
de = (struct ocfs2_dir_entry *) bh->b_data;
de1 = (struct ocfs2_dir_entry *)
- ((char *) de + le16_to_cpu(de->rec_len));
- if ((le64_to_cpu(de->inode) != OCFS_I(inode)->ip_blkno) ||
- !le64_to_cpu(de1->inode) ||
+ ((char *) de + le16_to_cpu(de->bryce_rec_len));
+ if ((le64_to_cpu(de->bryce_inode) != OCFS_I(inode)->ip_blkno) ||
+ !le64_to_cpu(de1->bryce_inode) ||
strcmp (".", de->name) ||
strcmp ("..", de1->name)) {
LOG_ERROR_ARGS ("bad directory (dir #%llu) - no `.' or `..'\n",
@@ -307,8 +307,8 @@
brelse (bh);
return 1;
}
- offset = le16_to_cpu(de->rec_len) + le16_to_cpu(de1->rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de1 + le16_to_cpu(de1->rec_len));
+ offset = le16_to_cpu(de->bryce_rec_len) + le16_to_cpu(de1->bryce_rec_len);
+ de = (struct ocfs2_dir_entry *) ((char *) de1 + le16_to_cpu(de1->bryce_rec_len));
while (offset < inode->i_size ) {
if (!bh || (void *) de >= (void *) (bh->b_data + sb->s_blocksize)) {
brelse (bh);
@@ -326,13 +326,13 @@
brelse (bh);
return 1;
}
- if (le64_to_cpu(de->inode)) {
+ if (le64_to_cpu(de->bryce_inode)) {
brelse (bh);
return 0;
}
- offset += le16_to_cpu(de->rec_len);
+ offset += le16_to_cpu(de->bryce_rec_len);
de = (struct ocfs2_dir_entry *)
- ((char *) de + le16_to_cpu(de->rec_len));
+ ((char *) de + le16_to_cpu(de->bryce_rec_len));
}
brelse (bh);
return 1;
@@ -467,8 +467,8 @@
}
memset(new_bh->b_data, 0, sb->s_blocksize);
de = (struct ocfs2_dir_entry *) new_bh->b_data;
- de->inode = 0;
- de->rec_len = le16_to_cpu(sb->s_blocksize);
+ de->bryce_inode = le64_to_cpu(0); /* 0 shouldn't need conversion but just to be on the safe side */
+ de->bryce_rec_len = le16_to_cpu(sb->s_blocksize);
status = ocfs_journal_dirty(handle, new_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -527,7 +527,7 @@
OCFS_ASSERT(S_ISDIR(dir->i_mode));
fe = (ocfs2_dinode *) parent_fe_bh->b_data;
- OCFS_ASSERT(fe->i_size == dir->i_size);
+ OCFS_ASSERT(le64_to_cpu(fe->bryce_i_size) == dir->i_size);
sb = dir->i_sb;
@@ -584,9 +584,9 @@
status = -EEXIST;
goto bail;
}
- if (((le64_to_cpu(de->inode) == 0) &&
- (le16_to_cpu(de->rec_len) >= rec_len)) ||
- (le16_to_cpu(de->rec_len) >=
+ if (((le64_to_cpu(de->bryce_inode) == 0) &&
+ (le16_to_cpu(de->bryce_rec_len) >= rec_len)) ||
+ (le16_to_cpu(de->bryce_rec_len) >=
(OCFS2_DIR_REC_LEN(de->name_len) + rec_len))) {
/* Ok, we found a spot. Return this bh and let
* the caller actually fill it in. */
@@ -595,8 +595,8 @@
status = 0;
goto bail;
}
- offset += le16_to_cpu(de->rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->rec_len));
+ offset += le16_to_cpu(de->bryce_rec_len);
+ de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->bryce_rec_len));
}
status = 0;
Modified: branches/bryce/src/dlm.c
===================================================================
--- branches/bryce/src/dlm.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/dlm.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -89,7 +89,7 @@
BUG();
}
- if ((DISK_LOCK(fe)->dl_master == lockres->master_node_num)
+ if (le16_to_cpu((DISK_LOCK(fe)->bryce_dl_master) == lockres->master_node_num)
&& (DISK_LOCK(fe)->dl_level == lockres->lock_type))
goto skip_write;
@@ -101,7 +101,7 @@
BUG();
}
- DISK_LOCK(fe)->dl_master = lockres->master_node_num;
+ cpu_to_le16(DISK_LOCK(fe)->bryce_dl_master) = lockres->master_node_num;
DISK_LOCK(fe)->dl_level = lockres->lock_type;
set_buffer_uptodate(bh);
@@ -594,7 +594,7 @@
fe = (ocfs2_dinode *) bh->b_data;
/* may not need to rewrite the lock later if
* we already have a cachelock */
- if ((DISK_LOCK(fe)->dl_master == osb->node_num)
+ if (le16_to_cpu((DISK_LOCK(fe)->bryce_dl_master) == osb->node_num)
&& (DISK_LOCK(fe)->dl_level != requested_lock))
need_lock_write = 1;
else
Modified: branches/bryce/src/extent_map.c
===================================================================
--- branches/bryce/src/extent_map.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/extent_map.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -120,11 +120,11 @@
parent = *p;
ent = rb_entry(parent, struct ocfs2_extent_map_entry,
e_node);
- if ((cpos + clusters) <= ent->e_rec.e_cpos) {
+ if ((cpos + clusters) <= le32_to_cpu(ent->e_rec.bryce_e_cpos)) {
p = &(*p)->rb_left;
ent = NULL;
- } else if (cpos >= (ent->e_rec.e_cpos +
- ent->e_rec.e_clusters)) {
+ } else if (cpos >= (le32_to_cpu(ent->e_rec.bryce_e_cpos) +
+ le32_to_cpu(ent->e_rec.bryce_e_clusters))) {
p = &(*p)->rb_right;
ent = NULL;
} else
@@ -162,29 +162,29 @@
* we hold alloc_sem. So we can do this without other
* locks.
*/
- while (el->l_tree_depth)
+ while (le16_to_cpu(el->bryce_l_tree_depth))
{
blkno = 0;
- for (i = 0; i < el->l_next_free_rec; i++) {
+ for (i = 0; i < le16_to_cpu(el->bryce_l_next_free_rec); i++) {
rec = &el->l_recs[i];
ret = -EBADR;
- if ((rec->e_cpos + rec->e_clusters) >
+ if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) >
OCFS_I(inode)->ip_clusters)
goto out_free;
- if ((rec->e_cpos + rec->e_clusters) <= cpos) {
+ if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) <= cpos) {
ret = ocfs2_extent_map_insert(inode,
rec,
- el->l_tree_depth);
+ le16_to_cpu(el->bryce_l_tree_depth));
if (ret && (ret != -EEXIST))
goto out_free;
continue;
}
- if ((cpos + clusters) <= rec->e_cpos) {
+ if ((cpos + clusters) <= le32_to_cpu(rec->bryce_e_cpos)) {
ret = ocfs2_extent_map_insert(inode,
rec,
- el->l_tree_depth);
+ le16_to_cpu(el->bryce_l_tree_depth));
if (ret && (ret != -EEXIST))
goto out_free;
continue;
@@ -198,9 +198,9 @@
/* Check to see if we're stradling */
ret = -ESRCH;
- if ((rec->e_cpos > cpos) ||
+ if ((le32_to_cpu(rec->bryce_e_cpos) > cpos) ||
((cpos + clusters) >
- (rec->e_cpos + rec->e_clusters)))
+ (le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters))))
goto out_free;
/*
@@ -212,7 +212,7 @@
if (blkno)
goto out_free;
- blkno = rec->e_blkno;
+ blkno = le64_to_cpu(rec->bryce_e_blkno);
}
/*
@@ -237,13 +237,13 @@
el = &eb->h_list;
}
- if (el->l_tree_depth)
+ if (le16_to_cpu(el->bryce_l_tree_depth))
BUG();
- for (i = 0; i < el->l_next_free_rec; i++) {
+ for (i = 0; i < le16_to_cpu(el->bryce_l_next_free_rec); i++) {
rec = &el->l_recs[i];
ret = ocfs2_extent_map_insert(inode, rec,
- el->l_tree_depth);
+ le16_to_cpu(el->bryce_l_tree_depth));
if (ret)
goto out_free;
}
@@ -283,7 +283,7 @@
*ret_ent = ent;
return 0;
}
- blkno = ent->e_rec.e_blkno;
+ blkno = le64_to_cpu(ent->e_rec.bryce_e_blkno);
spin_unlock(&OCFS_I(inode)->ip_lock);
ret = ocfs_read_block(OCFS_SB(inode->i_sb), blkno, &bh,
@@ -339,8 +339,8 @@
struct rb_node **p, *parent;
struct ocfs2_extent_map_entry *old_ent;
- old_ent = ocfs2_extent_map_lookup(em, ent->e_rec.e_cpos,
- ent->e_rec.e_clusters,
+ old_ent = ocfs2_extent_map_lookup(em, le32_to_cpu(ent->e_rec.bryce_e_cpos),
+ le32_to_cpu(ent->e_rec.bryce_e_clusters),
&p, &parent);
if (old_ent)
return -EEXIST;
@@ -376,8 +376,9 @@
goto out_unlock;
}
- old_ent = ocfs2_extent_map_lookup(em, rec->e_cpos,
- rec->e_clusters, NULL, NULL);
+ old_ent = ocfs2_extent_map_lookup(em, le32_to_cpu(rec->bryce_e_cpos),
+ le32_to_cpu(rec->bryce_e_clusters),
+ NULL, NULL);
if (!old_ent)
BUG();
@@ -405,28 +406,28 @@
* the first go round. In the end, the pieces we need will
* be used, and the pieces we don't will be freed.
*/
- ctxt->need_left = !!(rec->e_cpos > old_ent->e_rec.e_cpos);
- ctxt->need_right = !!((old_ent->e_rec.e_cpos +
- old_ent->e_rec.e_clusters) >
- (rec->e_cpos + rec->e_clusters));
+ ctxt->need_left = !!(le32_to_cpu(rec->bryce_e_cpos) > le32_to_cpu(old_ent->e_rec.bryce_e_cpos));
+ ctxt->need_right = !!((le32_to_cpu(old_ent->e_rec.bryce_e_cpos) +
+ le32_to_cpu(old_ent->e_rec.bryce_e_clusters)) >
+ (le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)));
ret = -EAGAIN;
if (ctxt->need_left) {
if (!ctxt->left_ent)
goto out_unlock;
*(ctxt->left_ent) = *old_ent;
- ctxt->left_ent->e_rec.e_clusters =
- rec->e_cpos - ctxt->left_ent->e_rec.e_cpos;
+ cpu_to_le32(ctxt->left_ent->e_rec.bryce_e_clusters) =
+ le32_to_cpu(rec->bryce_e_cpos) - le32_to_cpu(ctxt->left_ent->e_rec.bryce_e_cpos);
}
if (ctxt->need_right) {
if (!ctxt->right_ent)
goto out_unlock;
*(ctxt->right_ent) = *old_ent;
- ctxt->right_ent->e_rec.e_cpos =
- rec->e_cpos + rec->e_clusters;
- ctxt->right_ent->e_rec.e_clusters =
- (old_ent->e_rec.e_cpos +
- old_ent->e_rec.e_clusters) -
- ctxt->right_ent->e_rec.e_cpos;
+ cpu_to_le32(ctxt->right_ent->e_rec.bryce_e_cpos) =
+ le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters);
+ cpu_to_le32(ctxt->right_ent->e_rec.bryce_e_clusters) =
+ (le32_to_cpu(old_ent->e_rec.bryce_e_cpos) +
+ le32_to_cpu(old_ent->e_rec.bryce_e_clusters)) -
+ le32_to_cpu(ctxt->right_ent->e_rec.bryce_e_cpos);
}
rb_erase(&old_ent->e_node, &em->em_extents);
@@ -467,13 +468,13 @@
int ret;
struct ocfs2_em_insert_context ctxt = {0, };
- if ((rec->e_cpos + rec->e_clusters) >
+ if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) >
OCFS_I(inode)->ip_map.em_clusters)
return -EBADR;
/* Zero e_clusters means a truncated tail record. It better be EOF */
- if (!rec->e_clusters) {
- if ((rec->e_cpos + rec->e_clusters) !=
+ if (!le32_to_cpu(rec->bryce_e_clusters)) {
+ if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) !=
OCFS_I(inode)->ip_map.em_clusters)
return -EBADR;
@@ -553,7 +554,7 @@
ocfs2_extent_rec *old;
OCFS_ASSERT(new_clusters);
- OCFS_ASSERT(rec->e_clusters >= new_clusters);
+ OCFS_ASSERT(le32_to_cpu(rec->bryce_e_clusters) >= new_clusters);
if (em->em_clusters < OCFS_I(inode)->ip_clusters) {
/*
@@ -565,32 +566,32 @@
em->em_clusters = OCFS_I(inode)->ip_clusters;
}
- OCFS_ASSERT((rec->e_cpos + rec->e_clusters) ==
+ OCFS_ASSERT((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) ==
(em->em_clusters + new_clusters));
em->em_clusters += new_clusters;
ret = -ENOENT;
- if (rec->e_clusters > new_clusters) {
+ if (le32_to_cpu(rec->bryce_e_clusters) > new_clusters) {
/* This is a contiguous append */
- ent = ocfs2_extent_map_lookup(em, rec->e_cpos, 1,
+ ent = ocfs2_extent_map_lookup(em, le32_to_cpu(rec->bryce_e_cpos), 1,
NULL, NULL);
if (ent) {
old = &ent->e_rec;
- OCFS_ASSERT((rec->e_cpos + rec->e_clusters) ==
- (old->e_cpos + old->e_clusters +
+ OCFS_ASSERT((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) ==
+ (le32_to_cpu(old->bryce_e_cpos) + le32_to_cpu(old->bryce_e_clusters) +
new_clusters));
if (!ent->e_tree_depth) {
- OCFS_ASSERT(old->e_cpos == rec->e_cpos);
- OCFS_ASSERT(old->e_blkno ==
- rec->e_blkno);
+ OCFS_ASSERT(le32_to_cpu(old->bryce_e_cpos) == le32_to_cpu(rec->bryce_e_cpos));
+ OCFS_ASSERT(le64_to_cpu(old->bryce_e_blkno) ==
+ le64_to_cpu(rec->bryce_e_blkno));
ret = 0;
}
/*
* Let non-leafs fall through as -ENOENT to
* force insertion of the new leaf.
*/
- old->e_clusters += new_clusters;
+ cpu_to_le32(old->bryce_e_clusters) += new_clusters;
}
}
@@ -683,18 +684,18 @@
if (ent) {
/* We should never find ourselves straddling an interval */
- if ((ent->e_rec.e_cpos > v_cpos) ||
+ if ((le32_to_cpu(ent->e_rec.bryce_e_cpos) > v_cpos) ||
((v_cpos + count) >
- (ent->e_rec.e_cpos + ent->e_rec.e_clusters)))
+ (le32_to_cpu(ent->e_rec.bryce_e_cpos) + le32_to_cpu(ent->e_rec.bryce_e_clusters))))
return -ESRCH;
- coff = v_cpos - ent->e_rec.e_cpos;
+ coff = v_cpos - le32_to_cpu(ent->e_rec.bryce_e_cpos);
*p_cpos = ocfs2_blocks_to_clusters(inode->i_sb,
- ent->e_rec.e_blkno) +
+ le64_to_cpu(ent->e_rec.bryce_e_blkno)) +
coff;
if (ret_count)
- *ret_count = ent->e_rec.e_clusters - coff;
+ *ret_count = le32_to_cpu(ent->e_rec.bryce_e_clusters) - coff;
return 0;
}
@@ -742,19 +743,19 @@
rec = &ent->e_rec;
/* We should never find ourselves straddling an interval */
- if ((rec->e_cpos > cpos) ||
+ if ((le32_to_cpu(rec->bryce_e_cpos) > cpos) ||
((cpos + clusters) >
- (rec->e_cpos + rec->e_clusters)))
+ (le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters))))
return -ESRCH;
boff = ocfs2_clusters_to_blocks(inode->i_sb,
- cpos - rec->e_cpos);
+ cpos - le32_to_cpu(rec->bryce_e_cpos));
boff += (v_blkno & (u64)(bpc - 1));
- *p_blkno = rec->e_blkno + boff;
+ *p_blkno = le64_to_cpu(rec->bryce_e_blkno) + boff;
if (ret_count) {
*ret_count = ocfs2_clusters_to_blocks(inode->i_sb,
- rec->e_clusters) - boff;
+ le32_to_cpu(rec->bryce_e_clusters)) - boff;
}
return 0;
@@ -835,7 +836,7 @@
ent = rb_entry(node, struct ocfs2_extent_map_entry,
e_node);
- if (ent->e_rec.e_cpos < new_clusters)
+ if (le32_to_cpu(ent->e_rec.bryce_e_cpos) < new_clusters)
break;
rb_erase(&ent->e_node, &em->em_extents);
@@ -850,7 +851,7 @@
/* Do we have an entry straddling new_clusters? */
if (tail_ent) {
if (ent &&
- ((ent->e_rec.e_cpos + ent->e_rec.e_clusters) >
+ ((le32_to_cpu(ent->e_rec.bryce_e_cpos) + le32_to_cpu(ent->e_rec.bryce_e_clusters)) >
new_clusters))
*tail_ent = ent;
else
@@ -923,8 +924,8 @@
__ocfs2_extent_map_drop(inode, new_clusters, &free_head, &ent);
if (ent)
- ent->e_rec.e_clusters =
- new_clusters - ent->e_rec.e_cpos;
+ cpu_to_le32(ent->e_rec.bryce_e_clusters) =
+ new_clusters - le32_to_cpu(ent->e_rec.bryce_e_cpos);
OCFS_I(inode)->ip_map.em_clusters = new_clusters;
Modified: branches/bryce/src/file.c
===================================================================
--- branches/bryce/src/file.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/file.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -66,19 +66,19 @@
static void ocfs_fe_set_attributes(ocfs2_dinode *fe, struct iattr *attr)
{
if (attr->ia_valid & ATTR_SIZE)
- fe->i_size = attr->ia_size;
+ cpu_to_le64(fe->bryce_i_size) = attr->ia_size;
if (attr->ia_valid & ATTR_UID)
- fe->i_uid = attr->ia_uid;
+ cpu_to_le32(fe->bryce_i_uid) = attr->ia_uid;
if (attr->ia_valid & ATTR_GID)
- fe->i_gid = attr->ia_gid;
+ cpu_to_le32(fe->bryce_i_gid) = attr->ia_gid;
if (attr->ia_valid & ATTR_MODE)
- fe->i_mode = attr->ia_mode;
+ cpu_to_le16(fe->bryce_i_mode) = attr->ia_mode;
if (attr->ia_valid & ATTR_CTIME)
- fe->i_ctime = ocfs_get_seconds(attr->ia_ctime);
+ cpu_to_le64(fe->bryce_i_ctime) = ocfs_get_seconds(attr->ia_ctime);
if (attr->ia_valid & ATTR_ATIME)
- fe->i_atime = ocfs_get_seconds(attr->ia_atime);
+ cpu_to_le64(fe->bryce_i_atime) = ocfs_get_seconds(attr->ia_atime);
if (attr->ia_valid & ATTR_MTIME)
- fe->i_mtime = ocfs_get_seconds(attr->ia_mtime);
+ cpu_to_le64(fe->bryce_i_mtime) = ocfs_get_seconds(attr->ia_mtime);
}
int ocfs_sync_inode(struct inode *inode)
@@ -357,7 +357,7 @@
fe = (ocfs2_dinode *) bh->b_data;
- fe->i_mtime = OCFS_CURRENT_TIME;
+ cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
ocfs_fe_set_attributes(fe, attr);
@@ -816,11 +816,11 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT(fe->i_size == inode->i_size);
+ OCFS_ASSERT(le64_to_cpu(fe->bryce_i_size) == inode->i_size);
- if (new_i_size > fe->i_size) {
+ if (new_i_size > le64_to_cpu(fe->bryce_i_size)) {
LOG_TRACE_ARGS("asked to truncate file with size (%llu) "
- "to size (%llu)!\n", fe->i_size,
+ "to size (%llu)!\n", le64_to_cpu(fe->bryce_i_size),
new_i_size);
status = -EINVAL;
LOG_ERROR_STATUS(status);
@@ -828,17 +828,17 @@
}
LOG_TRACE_ARGS("inode %llu, i_size = %llu, new_i_size = %llu\n",
- fe->i_blkno, fe->i_size, new_i_size);
+ le64_to_cpu(fe->bryce_i_blkno), le64_to_cpu(fe->bryce_i_size), new_i_size);
/* lets handle the simple truncate cases before doing any more
* cluster locking. */
- if (new_i_size == fe->i_size)
+ if (new_i_size == le64_to_cpu(fe->bryce_i_size))
goto bail;
- if (fe->i_clusters == ocfs2_clusters_for_bytes(osb->sb,
+ if (le32_to_cpu(fe->bryce_i_clusters) == ocfs2_clusters_for_bytes(osb->sb,
new_i_size)) {
LOG_TRACE_ARGS("fe->i_clusters = %u, so we do a simple "
- "truncate\n", fe->i_clusters);
+ "truncate\n", le32_to_cpu(fe->bryce_i_clusters));
/* No allocation change is required, so lets fast path
* this truncate. */
handle = ocfs_start_trans(osb, handle,
@@ -1010,9 +1010,9 @@
goto leave;
}
- fe->i_clusters += num_bits;
+ cpu_to_le32(fe->bryce_i_clusters) += num_bits;
spin_lock(&OCFS_I(inode)->ip_lock);
- OCFS_I(inode)->ip_clusters = fe->i_clusters;
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
spin_unlock(&OCFS_I(inode)->ip_lock);
status = ocfs_journal_dirty(handle, fe_bh);
@@ -1025,7 +1025,7 @@
if (clusters_to_add) {
LOG_TRACE_ARGS("need to alloc once more, clusters = %u, "
- "wanted = %u\n", fe->i_clusters,
+ "wanted = %u\n", le32_to_cpu(fe->bryce_i_clusters),
clusters_to_add);
status = -EAGAIN;
if (reason)
@@ -1099,20 +1099,20 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT(new_i_size >= fe->i_size);
+ OCFS_ASSERT(new_i_size >= le64_to_cpu(fe->bryce_i_size));
- if (fe->i_size == new_i_size) {
+ if (le64_to_cpu(fe->bryce_i_size) == new_i_size) {
OCFS_ASSERT(inode->i_size == new_i_size);
goto leave;
}
clusters_to_add = ocfs2_clusters_for_bytes(osb->sb, new_i_size)
- - fe->i_clusters;
+ - le32_to_cpu(fe->bryce_i_clusters);
LOG_TRACE_ARGS("extend inode %llu, new_i_size = %llu, i_size = %llu, "
"fe->i_clusters = %u, clusters_to_add = %u\n",
OCFS_I(inode)->ip_blkno, new_i_size, inode->i_size,
- fe->i_clusters, clusters_to_add);
+ le32_to_cpu(fe->bryce_i_clusters), clusters_to_add);
if (!clusters_to_add)
goto do_start_trans;
@@ -1200,7 +1200,7 @@
if (status == -EAGAIN
&& (new_i_size >
- ocfs2_clusters_to_bytes(osb->sb, fe->i_clusters))) {
+ ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->bryce_i_clusters)))) {
if (why == RESTART_META) {
LOG_TRACE_ARGS("restarting function.\n");
@@ -1210,10 +1210,10 @@
/* update i_size in case we crash after the
* extend_trans */
- fe->i_size =
+ cpu_to_le64(fe->bryce_i_size) =
ocfs2_clusters_to_bytes(osb->sb,
- fe->i_clusters);
- fe->i_mtime = OCFS_CURRENT_TIME;
+ le32_to_cpu(fe->bryce_i_clusters));
+ cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -1224,7 +1224,7 @@
clusters_to_add =
ocfs2_clusters_for_bytes(osb->sb,
new_i_size)
- - fe->i_clusters + overalloc_bits;
+ - le32_to_cpu(fe->bryce_i_clusters) + overalloc_bits;
LOG_TRACE_ARGS("restarting transaction.\n");
/* TODO: This can be more intelligent. */
credits = ocfs_calc_extend_credits(osb->sb,
@@ -1245,18 +1245,18 @@
no_alloc:
/* this may not be the end of our allocation so only update
* i_size to what's appropriate. */
- if (new_i_size > ocfs2_clusters_to_bytes(osb->sb, fe->i_clusters))
- fe->i_size = ocfs2_clusters_to_bytes(osb->sb, fe->i_clusters);
+ if (new_i_size > ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->bryce_i_clusters)))
+ le64_to_cpu(fe->bryce_i_size) = ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->bryce_i_clusters));
else
- fe->i_size = new_i_size;
+ cpu_to_le64(fe->bryce_i_size) = new_i_size;
#warning "is there a reason why we don't update i_blocks here?"
LOG_TRACE_ARGS("fe: i_clusters = %u, i_size=%llu\n",
- fe->i_clusters, fe->i_size);
+ le32_to_cpu(fe->bryce_i_clusters), le64_to_cpu(fe->bryce_i_size));
LOG_TRACE_ARGS("inode: ip_clusters=%u, i_size=%llu\n",
OCFS_I(inode)->ip_clusters, inode->i_size);
- fe->i_mtime = OCFS_CURRENT_TIME;
+ cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
Modified: branches/bryce/src/inode.c
===================================================================
--- branches/bryce/src/inode.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/inode.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -342,30 +342,21 @@
ocfs_super *osb;
int status = -EINVAL;
- LOG_ENTRY_ARGS ("(0x%p, size:%llu)\n", inode, fe->i_size);
+ LOG_ENTRY_ARGS ("(0x%p, size:%llu)\n", inode, le64_to_cpu(fe->bryce_i_size));
sb = inode->i_sb;
osb = OCFS_SB(sb);
// this means that read_inode cannot create a superblock
// inode today. change if needed.
- if (!IS_VALID_FILE_ENTRY(fe) || !(fe->i_flags & OCFS2_VALID_FL)) {
+ if (!IS_VALID_FILE_ENTRY(fe) || !(le32_to_cpu(fe->bryce_i_flags) & OCFS2_VALID_FL)) {
LOG_ERROR_ARGS("invalid file entry! i_ino=%lu, "
"fe->i_blkno=%llu, valid_flag = %d\n",
- inode->i_ino, fe->i_blkno,
- (fe->i_flags & OCFS2_VALID_FL));
+ inode->i_ino, le64_to_cpu(fe->bryce_i_blkno),
+ (le32_to_cpu(fe->bryce_i_flags) & OCFS2_VALID_FL));
goto bail;
}
- if (le32_to_cpu(fe->i_fs_generation) != osb->fs_generation) {
- LOG_ERROR_ARGS("file entry generation does not match "
- "superblock! osb->fs_generation=%x, "
- "fe->i_fs_generation=%x\n",
- osb->fs_generation,
- le32_to_cpu(fe->i_fs_generation));
- goto bail;
- }
-
if (!inode->u.generic_ip && ocfs_inode_init_private(inode)) {
/* How can we recover gracefully? */
LOG_ERROR_STR("unable to allocate private data for "
@@ -374,39 +365,39 @@
}
inode->i_version = 1;
- inode->i_generation = le32_to_cpu(fe->i_generation);
- inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
- inode->i_mode = fe->i_mode;
- inode->i_uid = fe->i_uid;
- inode->i_gid = fe->i_gid;
+ inode->i_generation = le32_to_cpu(fe->bryce_i_generation);
+ inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.bryce_i_rdev));
+ inode->i_mode = le16_to_cpu(fe->bryce_i_mode);
+ inode->i_uid = le32_to_cpu(fe->bryce_i_uid);
+ inode->i_gid = le32_to_cpu(fe->bryce_i_gid);
inode->i_blksize = (u32)osb->s_clustersize; // sb->s_blocksize;
- inode->i_blocks = (fe->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
+ inode->i_blocks = (le64_to_cpu(fe->bryce_i_size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
inode->i_mapping->a_ops = &ocfs_aops;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
inode->i_attr_flags |= ATTR_FLAG_NOATIME;
#endif
inode->i_flags |= S_NOATIME;
- OCFS_SET_INODE_TIME(inode, i_atime, fe->i_atime);
- OCFS_SET_INODE_TIME(inode, i_mtime, fe->i_mtime);
- OCFS_SET_INODE_TIME(inode, i_ctime, fe->i_ctime);
+ OCFS_SET_INODE_TIME(inode, i_atime, le64_to_cpu(fe->bryce_i_atime));
+ OCFS_SET_INODE_TIME(inode, i_mtime, le64_to_cpu(fe->bryce_i_mtime));
+ OCFS_SET_INODE_TIME(inode, i_ctime, le64_to_cpu(fe->bryce_i_ctime));
- OCFS_I(inode)->ip_blkno = fe->i_blkno;
+ OCFS_I(inode)->ip_blkno = le64_to_cpu(fe->bryce_i_blkno);
- OCFS_I(inode)->ip_clusters = fe->i_clusters;
+ OCFS_I(inode)->ip_clusters = le32_to_cpu((fe->bryce_i_clusters));
OCFS_I(inode)->ip_inode = inode;
if (create_ino)
- inode->i_ino = ino_from_blkno(inode->i_sb, fe->i_blkno);
+ inode->i_ino = ino_from_blkno(inode->i_sb, le64_to_cpu(fe->bryce_i_blkno));
LOG_TRACE_ARGS("blkno = %llu, ino = %lu, create_ino = %s\n",
- fe->i_blkno, inode->i_ino,
+ le64_to_cpu(fe->bryce_i_blkno), inode->i_ino,
create_ino ? "true" : "false");
- inode->i_nlink = fe->i_links_count;
+ inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
- if (le32_to_cpu(fe->i_flags) & OCFS2_LOCAL_ALLOC_FL) {
+ if (le32_to_cpu(fe->bryce_i_flags) & OCFS2_LOCAL_ALLOC_FL) {
LOG_TRACE_ARGS("local alloc inode: i_ino=%lu\n", inode->i_ino);
- } else if (le32_to_cpu(fe->i_flags) & OCFS2_SUPER_BLOCK_FL) {
+ } else if (le32_to_cpu(fe->bryce_i_flags) & OCFS2_SUPER_BLOCK_FL) {
LOG_TRACE_ARGS("superblock inode: i_ino=%lu\n", inode->i_ino);
// we can't actually hit this as read_inode can't handle
// superblocks today ;-)
@@ -418,20 +409,20 @@
atomic_set(GET_INODE_CLEAN_SEQ(inode), atomic_read(&osb->clean_buffer_seq));
inode->i_fop = &ocfs_fops;
inode->i_op = &ocfs_file_iops;
- inode->i_size = fe->i_size;
+ inode->i_size = le64_to_cpu(fe->bryce_i_size);
OCFS_I(inode)->ip_mmu_private = inode->i_size;
break;
case S_IFDIR:
atomic_set(GET_INODE_CLEAN_SEQ(inode), atomic_read(&osb->clean_buffer_seq));
inode->i_op = &ocfs_dir_iops;
inode->i_fop = &ocfs_dops;
- inode->i_size = fe->i_size;
+ inode->i_size = le64_to_cpu(fe->bryce_i_size);
break;
case S_IFLNK:
atomic_set(GET_INODE_CLEAN_SEQ(inode), atomic_read(&osb->clean_buffer_seq));
inode->i_op = &ocfs_symlink_inode_operations;
//inode->i_fop = &ocfs_fops;
- inode->i_size = fe->i_size;
+ inode->i_size = le64_to_cpu(fe->bryce_i_size);
break;
default:
init_special_inode(inode, inode->i_mode,
@@ -486,19 +477,19 @@
goto bail;
}
- sysfile = le32_to_cpu(fe->i_flags) & OCFS2_SYSTEM_FL;
- if (S_ISCHR(fe->i_mode) || S_ISBLK(fe->i_mode))
- inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
+ sysfile = le32_to_cpu(fe->bryce_i_flags) & OCFS2_SYSTEM_FL;
+ if (S_ISCHR(le16_to_cpu(fe->bryce_i_mode)) || S_ISBLK(le16_to_cpu(fe->bryce_i_mode)))
+ inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.bryce_i_rdev));
status = -EINVAL;
if (ocfs_populate_inode (inode, fe, 0) < 0) {
LOG_ERROR_ARGS("populate inode failed! i_blkno=%llu, i_ino=%lu\n",
- fe->i_blkno, inode->i_ino);
+ le64_to_cpu(fe->bryce_i_blkno), inode->i_ino);
make_bad_inode (inode);
goto bail;
}
- if (args->blkno != fe->i_blkno)
+ if (args->blkno != le64_to_cpu(fe->bryce_i_blkno))
BUG();
if (sysfile)
@@ -543,7 +534,7 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
/* zero allocation, zero truncate :) */
- if (!fe->i_clusters)
+ if (!le32_to_cpu(fe->bryce_i_clusters))
goto bail;
handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
@@ -648,7 +639,7 @@
}
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (!(fe->i_flags & OCFS2_ORPHANED_FL)) {
+ if (!(le32_to_cpu(fe->bryce_i_flags) & OCFS2_ORPHANED_FL)) {
/* for lack of a better error? */
status = -EEXIST;
LOG_ERROR_STATUS(status);
@@ -656,13 +647,13 @@
}
/* has someone already deleted us?! baaad... */
- if (fe->i_dtime) {
+ if (le64_to_cpu(fe->bryce_i_dtime)) {
status = -EEXIST;
LOG_ERROR_STATUS(status);
goto bail;
}
- if (fe->i_links_count) {
+ if (le16_to_cpu(fe->bryce_i_links_count)) {
status = -EBUSY;
LOG_ERROR_STATUS(status);
goto bail;
@@ -704,7 +695,7 @@
goto bail;
}
- inode_alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, fe->i_suballoc_node);
+ inode_alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, le16_to_cpu(fe->bryce_i_suballoc_node));
if (!inode_alloc_inode) {
status = -EEXIST;
LOG_ERROR_STATUS(status);
@@ -742,8 +733,8 @@
goto bail;
}
- fe->i_dtime = OCFS_CURRENT_TIME;
- fe->i_flags &= (~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL));
+ cpu_to_le64(fe->bryce_i_dtime) = OCFS_CURRENT_TIME;
+ cpu_to_le32(fe->bryce_i_flags) &= (~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL));
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -982,17 +973,17 @@
}
spin_lock(&OCFS_I(inode)->ip_lock);
- fe->i_clusters = OCFS_I(inode)->ip_clusters;
+ cpu_to_le32(fe->bryce_i_clusters) = OCFS_I(inode)->ip_clusters;
spin_unlock(&OCFS_I(inode)->ip_lock);
- fe->i_size = (u64)inode->i_size;
- fe->i_links_count = inode->i_nlink;
- fe->i_uid = inode->i_uid;
- fe->i_gid = inode->i_gid;
- fe->i_mode = inode->i_mode;
- fe->i_atime = ocfs_get_seconds(inode->i_atime);
- fe->i_ctime = ocfs_get_seconds(inode->i_ctime);
- fe->i_mtime = ocfs_get_seconds(inode->i_mtime);
+ cpu_to_le64(fe->bryce_i_size) = (u64)inode->i_size;
+ cpu_to_le16(fe->bryce_i_links_count) = inode->i_nlink;
+ cpu_to_le32(fe->bryce_i_uid) = inode->i_uid;
+ cpu_to_le32(fe->bryce_i_gid) = inode->i_gid;
+ cpu_to_le16(fe->bryce_i_mode) = inode->i_mode;
+ cpu_to_le64(fe->bryce_i_atime) = ocfs_get_seconds(inode->i_atime);
+ cpu_to_le64(fe->bryce_i_ctime) = ocfs_get_seconds(inode->i_ctime);
+ cpu_to_le64(fe->bryce_i_mtime) = ocfs_get_seconds(inode->i_mtime);
#warning "do we want to update these here?"
// fe->i_dtime = ocfs_get_seconds(inode->i_dtime);
// fe->i_generation = inode->i_generation;
@@ -1033,10 +1024,10 @@
}
/* Add checks as needed */
- if ((fe->i_dtime) || (!(fe->i_flags & OCFS2_VALID_FL))) {
- if (fe->i_dtime)
+ if ((le64_to_cpu(fe->bryce_i_dtime)) || (!(le32_to_cpu(fe->bryce_i_flags) & OCFS2_VALID_FL))) {
+ if (le64_to_cpu(fe->bryce_i_dtime))
LOG_ERROR_ARGS("Inode %lu has dtime = %llu\n",
- inode->i_ino, fe->i_dtime);
+ inode->i_ino, le64_to_cpu(fe->bryce_i_dtime));
else
LOG_TRACE_STR ("File Entry is invalid");
@@ -1044,58 +1035,58 @@
goto bail;
}
- if (inode->i_generation != le32_to_cpu(fe->i_generation)) {
+ if (inode->i_generation != le32_to_cpu(fe->bryce_i_generation)) {
LOG_ERROR_ARGS("Inode %llu is stale! (%u, %u)\n",
OCFS_I(inode)->ip_blkno,
- inode->i_generation,
- le32_to_cpu(fe->i_generation));
+ le32_to_cpu(inode->i_generation),
+ le32_to_cpu(fe->bryce_i_generation));
SET_INODE_DELETED(inode);
status = -ENOENT;
goto bail;
}
- if ((OCFS_I(inode)->ip_clusters != fe->i_clusters) ||
- (inode->i_size != fe->i_size) ||
- inode->i_uid != fe->i_uid ||
- inode->i_gid != fe->i_gid ||
- inode->i_mode != fe->i_mode ||
- inode->i_nlink != fe->i_links_count){
+ if ((OCFS_I(inode)->ip_clusters != le32_to_cpu(fe->bryce_i_clusters)) ||
+ (inode->i_size != le64_to_cpu(fe->bryce_i_size)) ||
+ inode->i_uid != le32_to_cpu(fe->bryce_i_uid) ||
+ inode->i_gid != le32_to_cpu(fe->bryce_i_gid) ||
+ inode->i_mode != le16_to_cpu(fe->bryce_i_mode) ||
+ inode->i_nlink != le16_to_cpu(fe->bryce_i_links_count)){
- if (OCFS_I(inode)->ip_clusters > fe->i_clusters) {
+ if (OCFS_I(inode)->ip_clusters > le32_to_cpu(fe->bryce_i_clusters)) {
LOG_TRACE_ARGS("destroying extent maps for %llu, "
"ip_clusters = %u, i_clusters = %u\n",
OCFS_I(inode)->ip_blkno,
OCFS_I(inode)->ip_clusters,
- fe->i_clusters);
+ le32_to_cpu(fe->bryce_i_clusters));
drop_map = 1; /* Because we have the lock here */
}
LOG_TRACE_STR("Allocsize, filesize or seq no did not match");
- OCFS_I(inode)->ip_clusters = fe->i_clusters;
- inode->i_size = fe->i_size;
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
+ inode->i_size = le64_to_cpu(fe->bryce_i_size);
if (S_ISREG(inode->i_mode)) {
OCFS_I(inode)->ip_mmu_private = inode->i_size;
}
LOG_TRACE_ARGS("verifyupdate: setting nlink from %d to %d for %llu\n",
- inode->i_nlink, fe->i_links_count,
+ inode->i_nlink, le16_to_cpu(fe->bryce_i_links_count),
OCFS_I(inode)->ip_blkno);
- inode->i_nlink = fe->i_links_count;
+ inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
inode->i_blocks = (inode->i_size + osb->sb->s_blocksize - 1) >> osb->sb->s_blocksize_bits;
- inode->i_uid = fe->i_uid;
- inode->i_gid = fe->i_gid;
- inode->i_mode = fe->i_mode;
+ inode->i_uid = le32_to_cpu(fe->bryce_i_uid);
+ inode->i_gid = le32_to_cpu(fe->bryce_i_gid);
+ inode->i_mode = le16_to_cpu(fe->bryce_i_mode);
inode->i_blksize = (__u32) osb->s_clustersize;
- OCFS_SET_INODE_TIME(inode, i_ctime, fe->i_ctime);
- OCFS_SET_INODE_TIME(inode, i_atime, fe->i_atime);
- OCFS_SET_INODE_TIME(inode, i_mtime, fe->i_mtime);
+ OCFS_SET_INODE_TIME(inode, i_ctime, le64_to_cpu(fe->bryce_i_ctime));
+ OCFS_SET_INODE_TIME(inode, i_atime, le64_to_cpu(fe->bryce_i_atime));
+ OCFS_SET_INODE_TIME(inode, i_mtime, le64_to_cpu(fe->bryce_i_mtime));
- if (S_ISCHR(fe->i_mode) ||
- S_ISBLK(fe->i_mode) ||
- S_ISFIFO(fe->i_mode) ||
- S_ISSOCK(fe->i_mode)) {
+ if (S_ISCHR(le16_to_cpu(fe->bryce_i_mode)) ||
+ S_ISBLK(le16_to_cpu(fe->bryce_i_mode)) ||
+ S_ISFIFO(le16_to_cpu(fe->bryce_i_mode)) ||
+ S_ISSOCK(le16_to_cpu(fe->bryce_i_mode))) {
inode->i_rdev = 0;
init_special_inode(inode, inode->i_mode,
- huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev)));
+ huge_decode_dev(le64_to_cpu(fe->id1.dev1.bryce_i_rdev)));
}
}
@@ -1105,7 +1096,7 @@
spin_unlock(&OCFS_I(inode)->ip_lock);
if (drop_map)
- ocfs2_extent_map_trunc(inode, fe->i_clusters);
+ ocfs2_extent_map_trunc(inode, le32_to_cpu(fe->bryce_i_clusters));
return(status);
} /* ocfs_refresh_inode */
Modified: branches/bryce/src/journal.c
===================================================================
--- branches/bryce/src/journal.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/journal.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -856,26 +856,26 @@
}
fe = (ocfs2_dinode *) bh->b_data;
- if (fe->i_size < OCFS2_MIN_JOURNAL_SIZE) {
+ if (le64_to_cpu(fe->bryce_i_size) < OCFS2_MIN_JOURNAL_SIZE) {
LOG_ERROR_ARGS("Journal file size (%llu) is too small!",
- fe->i_size);
+ le64_to_cpu(fe->bryce_i_size));
status = -EINVAL;
goto done;
}
- LOG_TRACE_ARGS("fe->i_size = %llu\n", fe->i_size);
- LOG_TRACE_ARGS("fe->i_clusters = %u\n", fe->i_clusters);
- LOG_TRACE_ARGS("fe->i_blkno = %llu\n", fe->i_blkno);
+ LOG_TRACE_ARGS("fe->i_size = %llu\n", le64_to_cpu(fe->bryce_i_size));
+ LOG_TRACE_ARGS("fe->i_clusters = %u\n", le32_to_cpu(fe->bryce_i_clusters));
+ LOG_TRACE_ARGS("fe->i_blkno = %llu\n", le64_to_cpu(fe->bryce_i_blkno));
LOG_TRACE_ARGS("inode->ip_clusters = %u\n",
OCFS_I(inode)->ip_clusters);
- if (OCFS_I(inode)->ip_clusters != fe->i_clusters)
+ if (OCFS_I(inode)->ip_clusters != le32_to_cpu(fe->bryce_i_clusters))
LOG_ERROR_ARGS("inode and fe alloc sizes differ! "
"(%u != %u", OCFS_I(inode)->ip_clusters,
- fe->i_clusters);
- if (inode->i_size != fe->i_size)
+ le32_to_cpu(fe->bryce_i_clusters));
+ if (inode->i_size != le64_to_cpu(fe->bryce_i_size))
LOG_ERROR_ARGS("inode and fe i_size's differ! (%llu != %llu",
- inode->i_size, fe->i_size);
+ inode->i_size, le64_to_cpu(fe->bryce_i_size));
OCFS_I(inode)->ip_open_cnt++;
@@ -1271,7 +1271,7 @@
clean_orphans = 1;
fe = (ocfs2_dinode *) bh->b_data;
- OCFS_I(inode)->ip_clusters = fe->i_clusters;
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
status = ocfs_force_read_journal(inode);
if (status < 0) {
@@ -1431,11 +1431,11 @@
goto bail;
}
- local += le16_to_cpu(de->rec_len);
- offset += le16_to_cpu(de->rec_len);
+ local += le16_to_cpu(de->bryce_rec_len);
+ offset += le16_to_cpu(de->bryce_rec_len);
/* I guess we silently fail on no inode? */
- if (!le64_to_cpu(de->inode))
+ if (!le64_to_cpu(de->bryce_inode))
continue;
if (de->file_type > OCFS2_FT_MAX) {
LOG_ERROR_ARGS("block %llu contains invalid "
@@ -1443,8 +1443,8 @@
"%u, name_len = %u, file_type "
"= %u, name='%*s'\n",
(unsigned long long) bh->b_blocknr,
- de->inode,
- de->rec_len,
+ cpu_to_le64(de->bryce_inode),
+ cpu_to_le16(de->bryce_rec_len),
de->name_len,
de->file_type,
de->name_len,
@@ -1456,7 +1456,7 @@
if (de->name_len == 2 && !strncmp("..", de->name, 2))
continue;
- iter = ocfs_iget(osb, de->inode);
+ iter = ocfs_iget(osb, le64_to_cpu(de->bryce_inode));
if (!iter)
continue;
Modified: branches/bryce/src/localalloc.c
===================================================================
--- branches/bryce/src/localalloc.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/localalloc.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -161,7 +161,7 @@
alloc = (ocfs2_dinode *) alloc_bh->b_data;
- if (!(alloc->i_flags & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) {
+ if (!(le32_to_cpu(alloc->bryce_i_flags) & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) {
LOG_ERROR_ARGS("Invalid local alloc inode, %llu\n",
OCFS_I(inode)->ip_blkno);
status = -EINVAL;
@@ -175,23 +175,23 @@
* we load it so there should be no bits used from the main
* bitmap. */
if (num_used
- || alloc->id1.bitmap1.i_used
- || alloc->id1.bitmap1.i_total
- || LOCAL_ALLOC(alloc)->la_bm_off) {
+ || le32_to_cpu(alloc->id1.bitmap1.bryce_i_used)
+ || le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)
+ || le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off)) {
LOG_ERROR_ARGS("Local alloc hasn't been recovered!\n"
"found = %u, set = %u, taken = %u, off = %u\n",
num_used,
- alloc->id1.bitmap1.i_used,
- alloc->id1.bitmap1.i_total,
- LOCAL_ALLOC(alloc)->la_bm_off);
+ le32_to_cpu(alloc->id1.bitmap1.bryce_i_used),
+ le32_to_cpu(alloc->id1.bitmap1.bryce_i_total),
+ le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off));
status = -EBUSY;
goto bail;
}
- if (!LOCAL_ALLOC(alloc)->la_size ||
- (LOCAL_ALLOC(alloc)->la_size > ocfs2_local_alloc_size(inode->i_sb))) {
+ if (!le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size) ||
+ (le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size) > ocfs2_local_alloc_size(inode->i_sb))) {
LOG_ERROR_ARGS("Local alloc size is invalid (la_size = %u)\n",
- LOCAL_ALLOC(alloc)->la_size);
+ le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size));
status = -EINVAL;
goto bail;
}
@@ -535,11 +535,11 @@
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- OCFS_ASSERT(alloc->id1.bitmap1.i_used ==
+ OCFS_ASSERT(le32_to_cpu(alloc->id1.bitmap1.bryce_i_used) ==
ocfs_local_alloc_count_bits(alloc));
- free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) -
- le32_to_cpu(alloc->id1.bitmap1.i_used);
+ free_bits = le32_to_cpu(alloc->id1.bitmap1.bryce_i_total) -
+ le32_to_cpu(alloc->id1.bitmap1.bryce_i_used);
if (bits_wanted > free_bits) {
/* uhoh, window change time. */
status =
@@ -593,7 +593,7 @@
}
bitmap = LOCAL_ALLOC(alloc)->la_bitmap;
- *bit_off = LOCAL_ALLOC(alloc)->la_bm_off + start;
+ *bit_off = le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off) + start;
/* local alloc is always contiguous by nature -- we never
* delete bits from it! */
*num_bits = bits_wanted;
@@ -609,7 +609,7 @@
while(bits_wanted--)
ocfs2_set_bit(start++, bitmap);
- alloc->id1.bitmap1.i_used += *num_bits;
+ cpu_to_le32(alloc->id1.bitmap1.bryce_i_used) += *num_bits;
status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
if (status < 0) {
@@ -636,7 +636,7 @@
LOG_ENTRY();
buffer = LOCAL_ALLOC(alloc)->la_bitmap;
- for (i = 0; i < LOCAL_ALLOC(alloc)->la_size; i++) {
+ for (i = 0; i < le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size); i++) {
memcpy(&tmp, buffer, 1);
count+= BITCOUNT(tmp);
buffer++;
@@ -658,7 +658,7 @@
LOG_ENTRY_ARGS("(numbits wanted = %u)\n", numbits);
- if (!alloc->id1.bitmap1.i_total) {
+ if (!le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)) {
LOG_TRACE_STR("No bits in my window!");
bitoff = -1;
goto bail;
@@ -668,7 +668,7 @@
numfound = bitoff = startoff = 0;
lastzero = -1;
- left = alloc->id1.bitmap1.i_total;
+ left = le32_to_cpu(alloc->id1.bitmap1.bryce_i_total);
while ((bitoff = ocfs2_find_next_zero_bit(bitmap, left, startoff)) != -1) {
if (bitoff == left) {
/* LOG_TRACE_ARGS("bitoff (%d) == left", bitoff); */
@@ -716,10 +716,10 @@
int i;
LOG_ENTRY();
- alloc->id1.bitmap1.i_total = 0;
- alloc->id1.bitmap1.i_used = 0;
- LOCAL_ALLOC(alloc)->la_bm_off = 0;
- for(i = 0; i < LOCAL_ALLOC(alloc)->la_size; i++)
+ cpu_to_le32(alloc->id1.bitmap1.bryce_i_total) = 0;
+ cpu_to_le32(alloc->id1.bitmap1.bryce_i_used) = 0;
+ cpu_to_le32(LOCAL_ALLOC(alloc)->bryce_la_bm_off) = 0;
+ for(i = 0; i < le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size); i++)
LOCAL_ALLOC(alloc)->la_bitmap[i] = 0;
LOG_EXIT();
@@ -766,25 +766,25 @@
void *bitmap;
LOG_ENTRY_ARGS("total = %u, COUNT = %u, used = %u\n",
- alloc->id1.bitmap1.i_total,
+ le32_to_cpu(alloc->id1.bitmap1.bryce_i_total),
ocfs_local_alloc_count_bits(alloc),
- alloc->id1.bitmap1.i_used);
+ le32_to_cpu(alloc->id1.bitmap1.bryce_i_used));
- if (!alloc->id1.bitmap1.i_total) {
+ if (!le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)) {
LOG_TRACE_STR("nothing to sync!");
goto bail;
}
- if (alloc->id1.bitmap1.i_used == alloc->id1.bitmap1.i_total) {
+ if (le32_to_cpu(alloc->id1.bitmap1.bryce_i_used) == le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)) {
LOG_TRACE_STR("all bits were taken!");
goto bail;
}
la_start_blk = ocfs2_clusters_to_blocks(osb->sb,
- LOCAL_ALLOC(alloc)->la_bm_off);
+ le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off));
bitmap = LOCAL_ALLOC(alloc)->la_bitmap;
start = count = bit_off = 0;
- left = alloc->id1.bitmap1.i_total;
+ left = le32_to_cpu(alloc->id1.bitmap1.bryce_i_total);
while ((bit_off = ocfs2_find_next_zero_bit(bitmap, left, start))
!= -1) {
@@ -878,7 +878,7 @@
LOG_ENTRY();
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- if (alloc->id1.bitmap1.i_total)
+ if (le32_to_cpu(alloc->id1.bitmap1.bryce_i_total))
LOG_TRACE_STR("asking me to alloc a new window over a"
" non-empty one");
@@ -899,20 +899,20 @@
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- LOCAL_ALLOC(alloc)->la_bm_off = cluster_off;
- alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count);
+ cpu_to_le32(LOCAL_ALLOC(alloc)->bryce_la_bm_off) = cluster_off;
+ cpu_to_le32(alloc->id1.bitmap1.bryce_i_total) = le32_to_cpu(cluster_count);
/* just in case... In the future when we find space ourselves,
* we don't have to get all contiguous -- but we'll have to
* set all previously used bits in bitmap and update
* la_bits_set before setting the bits in the main bitmap. */
- alloc->id1.bitmap1.i_used = 0;
+ cpu_to_le32(alloc->id1.bitmap1.bryce_i_used) = 0;
memset(LOCAL_ALLOC(alloc)->la_bitmap, 0,
- LOCAL_ALLOC(alloc)->la_size);
+ le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size));
LOG_TRACE_STR("New window allocated:");
LOG_TRACE_ARGS("window la_bm_off = %u\n",
- LOCAL_ALLOC(alloc)->la_bm_off);
- LOG_TRACE_ARGS("window bits = %u\n", alloc->id1.bitmap1.i_total);
+ le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off));
+ LOG_TRACE_ARGS("window bits = %u\n", le32_to_cpu(alloc->id1.bitmap1.bryce_i_total));
bail:
LOG_EXIT_STATUS(status);
Modified: branches/bryce/src/lockres.c
===================================================================
--- branches/bryce/src/lockres.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/lockres.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -29,6 +29,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
+#include <linux/byteorder/generic.h>
#include "ocfs_log.h"
#include "ocfs.h"
@@ -94,7 +95,7 @@
BUG();
lockres->lock_type = DISK_LOCK(fe)->dl_level;
- lockres->master_node_num = DISK_LOCK(fe)->dl_master;
+ lockres->master_node_num = le16_to_cpu(DISK_LOCK(fe)->bryce_dl_master);
out:
if (bh && drop_bh)
Modified: branches/bryce/src/namei.c
===================================================================
--- branches/bryce/src/namei.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/namei.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -223,15 +223,15 @@
memset(new_bh->b_data, 0, osb->sb->s_blocksize);
de = (struct ocfs2_dir_entry *) new_bh->b_data;
- de->inode = cpu_to_le64(OCFS_I(inode)->ip_blkno);
+ de->bryce_inode = cpu_to_le64(OCFS_I(inode)->ip_blkno);
de->name_len = 1;
- de->rec_len =
+ de->bryce_rec_len =
cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len));
strcpy (de->name, ".");
ocfs_set_de_type(de, S_IFDIR);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->rec_len));
- de->inode = cpu_to_le64(OCFS_I(parent)->ip_blkno);
- de->rec_len = cpu_to_le16(inode->i_sb->s_blocksize -
+ de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->bryce_rec_len));
+ de->bryce_inode = cpu_to_le64(OCFS_I(parent)->ip_blkno);
+ de->bryce_rec_len = cpu_to_le16(inode->i_sb->s_blocksize -
OCFS2_DIR_REC_LEN(1));
de->name_len = 2;
strcpy (de->name, "..");
@@ -334,7 +334,7 @@
ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
dirfe = (ocfs2_dinode *) parent_fe_bh->b_data;
- if (!dirfe->i_links_count) {
+ if (!le16_to_cpu(dirfe->bryce_i_links_count)) {
/* can't make a file in a deleted directory. */
status = -ENOENT;
goto leave;
@@ -388,11 +388,11 @@
LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%llu, "
"i_blkno=%llu, i_ino=%lu\n",
(unsigned long long)new_fe_bh->b_blocknr,
- fe->i_blkno, inode->i_ino);
+ le64_to_cpu(fe->bryce_i_blkno), inode->i_ino);
BUG();
}
- file_off = fe->i_blkno << dir->i_sb->s_blocksize_bits;
+ file_off = le64_to_cpu(fe->bryce_i_blkno) << dir->i_sb->s_blocksize_bits;
ocfs_inode_set_new(osb, inode);
ocfs_init_lockres(osb, inode);
@@ -412,7 +412,7 @@
LOG_ERROR_STATUS(status);
goto leave;
}
- dirfe->i_links_count++;
+ cpu_to_le16(dirfe->bryce_i_links_count)++;
status = ocfs_journal_dirty(handle, parent_fe_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -421,7 +421,7 @@
dir->i_nlink++;
}
- status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
+ status = ocfs_add_entry(handle, dentry, inode, le64_to_cpu(fe->bryce_i_blkno),
parent_fe_bh, de_bh);
if (status < 0) {
LOG_ERROR_STATUS (status);
@@ -526,42 +526,43 @@
spin_lock(&osb->s_next_gen_lock);
inode->i_generation = osb->s_next_generation++;
spin_unlock(&osb->s_next_gen_lock);
- fe->i_generation = cpu_to_le32(inode->i_generation);
- fe->i_fs_generation = cpu_to_le32(osb->fs_generation);
- fe->i_blkno = fe_blkno;
- fe->i_suballoc_bit = suballoc_bit;
- fe->i_suballoc_node = osb->node_num;
- fe->i_uid = current->fsuid;
+ cpu_to_le32(fe->bryce_i_generation) = le32_to_cpu(inode->i_generation);
+ cpu_to_le64(fe->bryce_i_blkno) = fe_blkno;
+ cpu_to_le16(fe->bryce_i_suballoc_bit) = suballoc_bit;
+ cpu_to_le16(fe->bryce_i_suballoc_node) = osb->node_num;
+ cpu_to_le32(fe->bryce_i_uid) = current->fsuid;
if (dir->i_mode & S_ISGID) {
- fe->i_gid = dir->i_gid;
+ cpu_to_le32(fe->bryce_i_gid) = dir->i_gid;
if (S_ISDIR(mode))
mode |= S_ISGID;
} else
- fe->i_gid = current->fsgid;
- fe->i_mode = mode;
+ cpu_to_le32(fe->bryce_i_gid) = current->fsgid;
+ cpu_to_le16(fe->bryce_i_mode) = mode;
if (S_ISCHR (mode) || S_ISBLK (mode))
- fe->id1.dev1.i_rdev = huge_encode_dev(dev);
+ cpu_to_le64(fe->id1.dev1.bryce_i_rdev) = huge_encode_dev(dev);
if (S_ISLNK (mode) || S_ISDIR (mode) || S_ISREG (mode))
atomic_set(GET_INODE_CLEAN_SEQ(inode), atomic_read(&osb->clean_buffer_seq));
if (S_ISDIR (mode))
- fe->i_links_count = 2;
+ cpu_to_le16(fe->bryce_i_links_count) = 2;
else
- fe->i_links_count = 1;
+ cpu_to_le16(fe->bryce_i_links_count) = 1;
- fe->i_last_eb_blk = 0;
+ cpu_to_le64(fe->bryce_i_last_eb_blk) = 0;
strcpy (fe->i_signature, OCFS2_INODE_SIGNATURE);
- fe->i_flags |= OCFS2_VALID_FL;
- DISK_LOCK(fe)->dl_master = osb->node_num;
+ cpu_to_le32(fe->bryce_i_flags) |= OCFS2_VALID_FL;
+ cpu_to_le16(DISK_LOCK(fe)->bryce_dl_master) = osb->node_num;
DISK_LOCK(fe)->dl_level = OCFS_LKM_EXMODE;
- fe->i_atime = fe->i_ctime = fe->i_mtime = OCFS_CURRENT_TIME;
- fe->i_dtime = 0;
+ cpu_to_le64(fe->bryce_i_atime) = OCFS_CURRENT_TIME;
+ cpu_to_le64(fe->bryce_i_ctime) = OCFS_CURRENT_TIME;
+ cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
+ cpu_to_le64(fe->bryce_i_dtime) = 0;
fel = &fe->id2.i_list;
- fel->l_tree_depth = 0;
- fel->l_next_free_rec = 0;
- fel->l_count = ocfs2_extent_recs_per_inode(osb->sb);
+ cpu_to_le16(fel->bryce_l_tree_depth) = 0;
+ cpu_to_le16(fel->bryce_l_next_free_rec) = 0;
+ cpu_to_le16(fel->bryce_l_count) = ocfs2_extent_recs_per_inode(osb->sb);
fe = NULL;
@@ -690,7 +691,7 @@
inode);
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (fe->i_links_count >= OCFS2_LINK_MAX) {
+ if (le16_to_cpu(fe->bryce_i_links_count) >= OCFS2_LINK_MAX) {
err = -EMLINK;
goto bail;
}
@@ -708,14 +709,14 @@
goto bail;
}
- fe->i_links_count++;
- fe->i_ctime = OCFS_CURRENT_TIME;
- inode->i_nlink = fe->i_links_count;
- OCFS_SET_INODE_TIME(inode, i_ctime, fe->i_ctime);
+ cpu_to_le16(fe->bryce_i_links_count)++;
+ cpu_to_le64(fe->bryce_i_ctime) = OCFS_CURRENT_TIME;
+ inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
+ OCFS_SET_INODE_TIME(inode, i_ctime, le64_to_cpu(fe->bryce_i_ctime));
err = ocfs_journal_dirty(handle, fe_bh);
if (err < 0) {
- fe->i_links_count--;
+ cpu_to_le16(fe->bryce_i_links_count)--;
inode->i_nlink--;
LOG_ERROR_STATUS(err);
goto bail;
@@ -724,7 +725,7 @@
err = ocfs_add_entry(handle, dentry, inode, OCFS_I(inode)->ip_blkno,
parent_fe_bh, de_bh);
if (err) {
- fe->i_links_count--;
+ cpu_to_le16(fe->bryce_i_links_count)--;
inode->i_nlink--;
LOG_ERROR_STATUS(err);
goto bail;
@@ -855,14 +856,14 @@
}
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (fe->i_links_count != inode->i_nlink) {
+ if (le16_to_cpu(fe->bryce_i_links_count) != inode->i_nlink) {
printk("ocfs_unlink: hmm, inode has nlink = %u, fe has "
"link_cnt = %u. Setting inode from fe.\n",
- inode->i_nlink, fe->i_links_count);
- inode->i_nlink = fe->i_links_count;
+ inode->i_nlink, le16_to_cpu(fe->bryce_i_links_count));
+ inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
}
- if (S_ISDIR(inode->i_mode) || (fe->i_links_count == 1)) {
+ if (S_ISDIR(inode->i_mode) || (le16_to_cpu(fe->bryce_i_links_count) == 1)) {
status = ocfs_orphan_add(osb, handle, inode, fe, orphan_name,
orphan_entry_bh);
if (status < 0) {
@@ -879,10 +880,10 @@
}
if (S_ISDIR (inode->i_mode)) {
- fe->i_links_count = 0;
+ cpu_to_le16(fe->bryce_i_links_count) = 0;
inode->i_nlink = 0;
} else {
- fe->i_links_count--;
+ cpu_to_le16(fe->bryce_i_links_count)--;
inode->i_nlink--;
}
@@ -1017,7 +1018,7 @@
#define PARENT_INO(buffer) \
((struct ocfs2_dir_entry *) ((char *) buffer + \
- le16_to_cpu(((struct ocfs2_dir_entry *) buffer)->rec_len)))->inode
+ le16_to_cpu(((struct ocfs2_dir_entry *) buffer)->bryce_rec_len)))->bryce_inode
/*
* ocfs_rename()
@@ -1156,7 +1157,7 @@
* and merrily kill the link to whatever was created under the
* same name. Goodbye sticky bit ;-<
*/
- if (le64_to_cpu(old_de->inode) != OCFS_I(old_inode)->ip_blkno)
+ if (le64_to_cpu(old_de->bryce_inode) != OCFS_I(old_inode)->ip_blkno)
goto bail;
/* check if the target already exists (in which case we need
@@ -1246,7 +1247,7 @@
goto bail;
}
- if (S_ISDIR(new_inode->i_mode) || (newfe->i_links_count == 1)){
+ if (S_ISDIR(new_inode->i_mode) || (le16_to_cpu(newfe->bryce_i_links_count) == 1)){
status = ocfs_orphan_add(osb, handle, new_inode,
newfe, orphan_name,
orphan_entry_bh);
@@ -1263,7 +1264,7 @@
LOG_ERROR_STATUS (status);
goto bail;
}
- new_de->inode =
+ new_de->bryce_inode =
le64_to_cpu(OCFS_I(old_inode)->ip_blkno);
new_de->file_type = old_de->file_type;
new_dir->i_version++;
@@ -1274,9 +1275,9 @@
}
if (S_ISDIR (new_inode->i_mode))
- newfe->i_links_count = 0;
+ cpu_to_le16(newfe->bryce_i_links_count) = 0;
else
- newfe->i_links_count--;
+ cpu_to_le16(newfe->bryce_i_links_count)--;
status = ocfs_journal_dirty(handle, newfe_bh);
if (status < 0) {
@@ -1337,7 +1338,7 @@
new_dir_bh,
OCFS_JOURNAL_ACCESS_WRITE);
fe = (ocfs2_dinode *) new_dir_bh->b_data;
- fe->i_links_count = new_dir->i_nlink;
+ cpu_to_le16(fe->bryce_i_links_count) = new_dir->i_nlink;
status = ocfs_journal_dirty(handle, new_dir_bh);
}
}
@@ -1352,7 +1353,7 @@
status = ocfs_journal_access(handle, old_dir,
old_dir_bh, OCFS_JOURNAL_ACCESS_WRITE);
fe = (ocfs2_dinode *) old_dir_bh->b_data;
- fe->i_links_count = old_dir->i_nlink;
+ cpu_to_le16(fe->bryce_i_links_count) = old_dir->i_nlink;
status = ocfs_journal_dirty(handle, old_dir_bh);
}
}
@@ -1570,7 +1571,7 @@
ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
dirfe = (ocfs2_dinode *) parent_fe_bh->b_data;
- if (!dirfe->i_links_count) {
+ if (!le32_to_cpu(dirfe->bryce_i_links_count)) {
/* can't make a file in a deleted directory. */
status = -ENOENT;
goto bail;
@@ -1617,7 +1618,7 @@
LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%llu, "
"i_blkno=%llu, i_ino=%lu\n",
(unsigned long long)new_fe_bh->b_blocknr,
- fe->i_blkno, inode->i_ino);
+ le64_to_cpu(fe->bryce_i_blkno), inode->i_ino);
BUG();
}
@@ -1653,7 +1654,7 @@
goto bail;
}
- status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
+ status = ocfs_add_entry(handle, dentry, inode, le64_to_cpu(fe->bryce_i_blkno),
parent_fe_bh, de_bh);
if (status < 0) {
LOG_ERROR_STATUS (status);
@@ -1687,7 +1688,7 @@
int ocfs_check_dir_entry (struct inode * dir, struct ocfs2_dir_entry * de, struct buffer_head * bh, unsigned long offset)
{
const char * error_msg = NULL;
- const int rlen = le16_to_cpu(de->rec_len);
+ const int rlen = le16_to_cpu(de->bryce_rec_len);
if (rlen < OCFS2_DIR_REC_LEN(1))
error_msg = "rec_len is smaller than minimal";
@@ -1702,7 +1703,7 @@
LOG_ERROR_ARGS("bad entry in directory #%llu: %s - "
"offset=%lu, inode=%llu, rec_len=%d, name_len=%d",
OCFS_I(dir)->ip_blkno, error_msg, offset,
- le64_to_cpu(de->inode),
+ le64_to_cpu(de->bryce_inode),
rlen, de->name_len);
return error_msg == NULL ? 1 : 0;
}
@@ -1749,29 +1750,29 @@
retval = -EEXIST;
goto bail;
}
- if (((le64_to_cpu(de->inode) == 0) &&
- (le16_to_cpu(de->rec_len) >= rec_len)) ||
- (le16_to_cpu(de->rec_len) >=
+ if (((le64_to_cpu(de->bryce_inode) == 0) &&
+ (le16_to_cpu(de->bryce_rec_len) >= rec_len)) ||
+ (le16_to_cpu(de->bryce_rec_len) >=
(OCFS2_DIR_REC_LEN(de->name_len) + rec_len))) {
status = ocfs_journal_access(handle, dir, insert_bh,
OCFS_JOURNAL_ACCESS_WRITE);
/* By now the buffer is marked for journaling */
- offset += le16_to_cpu(de->rec_len);
- if (le64_to_cpu(de->inode)) {
+ offset += le16_to_cpu(de->bryce_rec_len);
+ if (le64_to_cpu(de->bryce_inode)) {
de1 = (struct ocfs2_dir_entry *) ((char *) de +
OCFS2_DIR_REC_LEN(de->name_len));
- de1->rec_len =
- cpu_to_le16(le16_to_cpu(de->rec_len) -
+ de1->bryce_rec_len =
+ cpu_to_le16(le16_to_cpu(de->bryce_rec_len) -
OCFS2_DIR_REC_LEN(de->name_len));
- de->rec_len = cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len));
+ de->bryce_rec_len = cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len));
de = de1;
}
de->file_type = OCFS2_FT_UNKNOWN;
if (blkno) {
- de->inode = cpu_to_le64(blkno);
+ de->bryce_inode = cpu_to_le64(blkno);
ocfs_set_de_type(de, inode->i_mode);
} else
- de->inode = 0;
+ le64_to_cpu(de->bryce_inode) = 0;
de->name_len = namelen;
memcpy (de->name, name, namelen);
@@ -1781,8 +1782,8 @@
retval = 0;
goto bail;
}
- offset += le16_to_cpu(de->rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->rec_len));
+ offset += le16_to_cpu(de->bryce_rec_len);
+ de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->bryce_rec_len));
}
/* when you think about it, the assert above should prevent us
@@ -1822,17 +1823,17 @@
goto bail;
}
if (pde)
- pde->rec_len = cpu_to_le16(le16_to_cpu(pde->rec_len) +
- le16_to_cpu(de->rec_len));
+ pde->bryce_rec_len = cpu_to_le16(le16_to_cpu(pde->bryce_rec_len) +
+ le16_to_cpu(de->bryce_rec_len));
else
- de->inode = 0;
+ cpu_to_le64(de->bryce_inode) = 0;
dir->i_version++;
status = ocfs_journal_dirty(handle, bh);
goto bail;
}
- i += le16_to_cpu(de->rec_len);
+ i += le16_to_cpu(de->bryce_rec_len);
pde = de;
- de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->rec_len));
+ de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->bryce_rec_len));
}
bail:
LOG_EXIT_STATUS(status);
@@ -1873,7 +1874,7 @@
goto bail;
}
/* prevent looping on a bad block */
- de_len = le16_to_cpu(de->rec_len);
+ de_len = le16_to_cpu(de->bryce_rec_len);
if (de_len <= 0) {
ret = -1;
goto bail;
@@ -2132,8 +2133,8 @@
* underneath us... */
orphan_fe = (ocfs2_dinode *) orphan_dir_bh->b_data;
if (S_ISDIR(inode->i_mode))
- orphan_fe->i_links_count++;
- orphan_dir_inode->i_nlink = orphan_fe->i_links_count;
+ cpu_to_le16(orphan_fe->bryce_i_links_count)++;
+ orphan_dir_inode->i_nlink = le16_to_cpu(orphan_fe->bryce_i_links_count);
status = ocfs_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
@@ -2149,7 +2150,7 @@
goto leave;
}
- fe->i_flags |= OCFS2_ORPHANED_FL;
+ cpu_to_le32(fe->bryce_i_flags) |= OCFS2_ORPHANED_FL;
leave:
if (orphan_dir_inode)
iput(orphan_dir_inode);
@@ -2223,8 +2224,8 @@
/* do the i_nlink dance! :) */
orphan_fe = (ocfs2_dinode *) orphan_dir_bh->b_data;
if (S_ISDIR(inode->i_mode))
- orphan_fe->i_links_count--;
- orphan_dir_inode->i_nlink = orphan_fe->i_links_count;
+ cpu_to_le16(orphan_fe->bryce_i_links_count)--;
+ orphan_dir_inode->i_nlink = le16_to_cpu(orphan_fe->bryce_i_links_count);
status = ocfs_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
Modified: branches/bryce/src/namei.h
===================================================================
--- branches/bryce/src/namei.h 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/namei.h 2004-11-30 17:06:44 UTC (rev 1677)
@@ -41,7 +41,7 @@
{
if (len != de->name_len)
return 0;
- if (!de->inode)
+ if (!le64_to_cpu(de->bryce_inode))
return 0;
return !memcmp(name, de->name, len);
}
Modified: branches/bryce/src/ocfs.h
===================================================================
--- branches/bryce/src/ocfs.h 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/ocfs.h 2004-11-30 17:06:44 UTC (rev 1677)
@@ -514,7 +514,6 @@
u8 *uuid;
u8 *vol_label;
u64 first_cluster_group_blkno;
- u32 fs_generation;
u32 s_feature_compat;
u32 s_feature_incompat;
Modified: branches/bryce/src/ocfs2_fs.h
===================================================================
--- branches/bryce/src/ocfs2_fs.h 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/ocfs2_fs.h 2004-11-30 17:06:44 UTC (rev 1677)
@@ -213,16 +213,16 @@
* It describes a range of clusters on disk.
*/
typedef struct _ocfs2_extent_rec {
-/*00*/ __u32 e_cpos; /* Offset into the file, in clusters */
- __u32 e_clusters; /* Clusters covered by this extent */
- __u64 e_blkno; /* Physical disk offset, in blocks */
+/*00*/ __u32 bryce_e_cpos; /* Offset into the file, in clusters */
+ __u32 bryce_e_clusters; /* Clusters covered by this extent */
+ __u64 bryce_e_blkno; /* Physical disk offset, in blocks */
/*10*/
} ocfs2_extent_rec;
typedef struct _ocfs2_chain_rec {
- __u32 c_free; /* Number of free bits in this chain. */
- __u32 c_total; /* Number of total bits in this chain */
- __u64 c_blkno; /* Physical disk offset (blocks) of 1st group */
+ __u32 bryce_c_free; /* Number of free bits in this chain. */
+ __u32 bryce_c_total; /* Number of total bits in this chain */
+ __u64 bryce_c_blkno; /* Physical disk offset (blocks) of 1st group */
} ocfs2_chain_rec;
/*
@@ -232,15 +232,15 @@
* ocfs2_extent_block.h_list, respectively.
*/
typedef struct _ocfs2_extent_list {
-/*00*/ __u16 l_tree_depth; /* Extent tree depth from this
+/*00*/ __u16 bryce_l_tree_depth; /* Extent tree depth from this
point. 0 means data extents
hang directly off this
header (a leaf) */
- __u16 l_count; /* Number of extent records */
- __u16 l_next_free_rec; /* Next unused extent slot */
- __u16 l_reserved1;
- __u64 l_reserved2; /* Pad to
- sizeof(ocfs2_extent_rec) */
+ __u16 bryce_l_count; /* Number of extent records */
+ __u16 bryce_l_next_free_rec; /* Next unused extent slot */
+ __u16 bryce_l_reserved1; /* unused?? */
+ __u64 bryce_l_reserved2; /* unused?? */
+ /* Pad to sizeof(ocfs2_extent_rec) */
/*10*/ ocfs2_extent_rec l_recs[0]; /* Extent records */
} ocfs2_extent_list;
@@ -250,11 +250,11 @@
* ocfs2_dinode.id2.i_chain.
*/
typedef struct _ocfs2_chain_list {
-/*00*/ __u16 cl_cpg; /* Clusters per Block Group */
- __u16 cl_bpc; /* Bits per cluster */
- __u16 cl_count; /* Total chains in this list */
- __u16 cl_next_free_rec; /* Next unused chain slot */
- __u64 cl_reserved1;
+/*00*/ __u16 bryce_cl_cpg; /* Clusters per Block Group */
+ __u16 bryce_cl_bpc; /* Bits per cluster */
+ __u16 bryce_cl_count; /* Total chains in this list */
+ __u16 bryce_cl_next_free_rec; /* Next unused chain slot */
+ __u64 bryce_cl_reserved1; /* unused?? */
/*10*/ ocfs2_chain_rec cl_recs[0]; /* Chain records */
} ocfs2_chain_list;
@@ -264,15 +264,15 @@
typedef struct _ocfs2_extent_block
{
/*00*/ __u8 h_signature[8]; /* Signature for verification */
- __u64 h_reserved1;
-/*10*/ __s16 h_suballoc_node; /* Node suballocator this
+ __u64 bryce_h_reserved1; /* unused?? */
+/*10*/ __s16 bryce_h_suballoc_node; /* Node suballocator this
extent_header belongs to */
- __u16 h_suballoc_bit; /* Bit offset in suballocater
+ __u16 bryce_h_suballoc_bit; /* Bit offset in suballocater
block group */
- __u32 h_fs_generation; /* Must match super block */
- __u64 h_blkno; /* Offset on disk, in blocks */
-/*20*/ __u64 h_reserved3;
- __u64 h_next_leaf_blk; /* Offset on disk, in blocks,
+ __u32 bryce_h_reserved2; /* unused ?? */
+ __u64 bryce_h_blkno; /* Offset on disk, in blocks */
+/*20*/ __u64 bryce_h_reserved3; /* unused?? */
+ __u64 bryce_h_next_leaf_blk; /* Offset on disk, in blocks,
of next leaf header pointing
to data */
/*30*/ ocfs2_extent_list h_list; /* Extent record list */
@@ -284,8 +284,8 @@
*/
typedef struct _ocfs2_disk_lock
{
-/*00*/ __s16 dl_master; /* Node number of current master */
- __u8 dl_level; /* Lock level */
+/*00*/ __s16 bryce_dl_master; /* Node number of current master */
+ __u8 dl_level; /* Lock level */
__u8 dl_reserved1;
/*04*/
} ocfs2_disk_lock;
@@ -296,29 +296,29 @@
* are relative to the start of ocfs2_dinode.id2.
*/
typedef struct _ocfs2_super_block {
-/*00*/ __u16 s_major_rev_level;
- __u16 s_minor_rev_level;
- __u16 s_mnt_count;
- __s16 s_max_mnt_count;
- __u16 s_state; /* File system state */
- __u16 s_errors; /* Behaviour when detecting errors */
- __u32 s_checkinterval; /* Max time between checks */
-/*10*/ __u64 s_lastcheck; /* Time of last check */
- __u32 s_creator_os; /* OS */
- __u32 s_feature_compat; /* Compatible feature set */
-/*20*/ __u32 s_feature_incompat; /* Incompatible feature set */
- __u32 s_feature_ro_compat; /* Readonly-compatible feature set */
- __u64 s_root_blkno; /* Offset, in blocks, of root directory
+/*00*/ __u16 bryce_s_major_rev_level;
+ __u16 bryce_s_minor_rev_level;
+ __u16 bryce_s_mnt_count; /* unused?? */
+ __s16 bryce_s_max_mnt_count; /* unused?? */
+ __u16 bryce_s_state; /* unused?? */ /* File system state */
+ __u16 bryce_s_errors; /* unused?? */ /* Behaviour when detecting errors */
+ __u32 bryce_s_checkinterval; /* unused?? */ /* Max time between checks */
+/*10*/ __u64 bryce_s_lastcheck; /* unused?? */ /* Time of last check */
+ __u32 bryce_s_creator_os; /* unused?? */ /* OS */
+ __u32 bryce_s_feature_compat; /* Compatible feature set */
+/*20*/ __u32 bryce_s_feature_incompat; /* Incompatible feature set */
+ __u32 bryce_s_feature_ro_compat; /* Readonly-compatible feature set */
+ __u64 bryce_s_root_blkno; /* Offset, in blocks, of root directory
dinode */
-/*30*/ __u64 s_system_dir_blkno; /* Offset, in blocks, of system
+/*30*/ __u64 bryce_s_system_dir_blkno; /* Offset, in blocks, of system
directory dinode */
- __u32 s_blocksize_bits; /* Blocksize for this fs */
- __u32 s_clustersize_bits; /* Clustersize for this fs */
-/*40*/ __u16 s_max_nodes; /* Max nodes in this cluster before
+ __u32 bryce_s_blocksize_bits; /* Blocksize for this fs */
+ __u32 bryce_s_clustersize_bits; /* Clustersize for this fs */
+/*40*/ __u16 bryce_s_max_nodes; /* Max nodes in this cluster before
tunefs required */
- __u16 s_reserved1;
- __u32 s_reserved2;
- __u64 s_first_cluster_group; /* Block offset of 1st cluster
+ __u16 bryce_s_reserved1; /* unused?? */
+ __u32 bryce_s_reserved2; /* unused?? */
+ __u64 bryce_s_first_cluster_group; /* Block offset of 1st cluster
* group header */
/*50*/ __u8 s_label[64]; /* Label for mounting, etc. */
/*90*/ __u8 s_uuid[16]; /* Was vol_id */
@@ -332,10 +332,10 @@
*/
typedef struct _ocfs2_local_alloc
{
-/*00*/ __u32 la_bm_off; /* Starting bit offset in main bitmap */
- __u16 la_size; /* Size of included bitmap, in bytes */
- __u16 la_reserved1;
- __u64 la_reserved2;
+/*00*/ __u32 bryce_la_bm_off; /* Starting bit offset in main bitmap */
+ __u16 bryce_la_size; /* Size of included bitmap, in bytes */
+ __u16 bryce_la_reserved1; /* unused?? */
+ __u64 bryce_la_reserved2; /* unused?? */
/*10*/ __u8 la_bitmap[0];
} ocfs2_local_alloc;
@@ -344,39 +344,37 @@
*/
typedef struct _ocfs2_dinode {
/*00*/ __u8 i_signature[8]; /* Signature for validation */
- __u32 i_generation; /* Generation number */
- __s16 i_suballoc_node; /* Node suballocater this inode
+ __u32 bryce_i_generation; /* Generation number */
+ __s16 bryce_i_suballoc_node; /* Node suballocater this inode
belongs to */
- __u16 i_suballoc_bit; /* Bit offset in suballocater
+ __u16 bryce_i_suballoc_bit; /* Bit offset in suballocater
block group */
/*10*/ ocfs2_disk_lock i_disk_lock; /* Lock structure */
-/*14*/ __u32 i_clusters; /* Cluster count */
-/*18*/ __u32 i_uid; /* Owner UID */
- __u32 i_gid; /* Owning GID */
-/*20*/ __u64 i_size; /* Size in bytes */
- __u16 i_mode; /* File mode */
- __u16 i_links_count; /* Links count */
- __u32 i_flags; /* File flags */
-/*30*/ __u64 i_atime; /* Access time */
- __u64 i_ctime; /* Creation time */
-/*40*/ __u64 i_mtime; /* Modification time */
- __u64 i_dtime; /* Deletion time */
-/*50*/ __u64 i_blkno; /* Offset on disk, in blocks */
- __u64 i_last_eb_blk; /* Pointer to last extent
+/*14*/ __u32 bryce_i_clusters; /* Cluster count */
+/*18*/ __u32 bryce_i_uid; /* Owner UID */
+ __u32 bryce_i_gid; /* Owning GID */
+/*20*/ __u64 bryce_i_size; /* Size in bytes */
+ __u16 bryce_i_mode; /* File mode */
+ __u16 bryce_i_links_count; /* Links count */
+ __u32 bryce_i_flags; /* File flags */
+/*30*/ __u64 bryce_i_atime; /* Access time */
+ __u64 bryce_i_ctime; /* Creation time */
+/*40*/ __u64 bryce_i_mtime; /* Modification time */
+ __u64 bryce_i_dtime; /* Deletion time */
+/*50*/ __u64 bryce_i_blkno; /* Offset on disk, in blocks */
+ __u64 bryce_i_last_eb_blk; /* Pointer to last extent
block */
-/*60*/ __u32 i_fs_generation; /* Generation per fs-instance */
- __u32 i_reserved0; /* Generation per fs-instance */
-/*68*/ __u64 i_reserved1[10];
+/*60*/ __u64 bryce_i_reserved1[11]; /* unused?? */
/*B8*/ union {
- __u64 i_pad1; /* Generic way to refer to this
+ __u64 bryce_i_pad1; /* unused?? */ /* Generic way to refer to this
64bit union */
struct {
- __u64 i_rdev; /* Device number */
+ __u64 bryce_i_rdev; /* Device number */
} dev1;
struct { /* Info for bitmap system
inodes */
- __u32 i_used; /* Bits (ie, clusters) used */
- __u32 i_total; /* Total bits (clusters)
+ __u32 bryce_i_used; /* Bits (ie, clusters) used */
+ __u32 bryce_i_total; /* Total bits (clusters)
available */
} bitmap1;
} id1; /* Inode type dependant 1 */
@@ -393,8 +391,8 @@
* On-disk directory entry structure for OCFS2
*/
struct ocfs2_dir_entry {
-/*00*/ __u64 inode; /* Inode number */
- __u16 rec_len; /* Directory entry length */
+/*00*/ __u64 bryce_inode; /* Inode number */
+ __u16 bryce_rec_len; /* Directory entry length */
__u8 name_len; /* Name length */
__u8 file_type;
/*0C*/ char name[OCFS2_MAX_FILENAME_LENGTH]; /* File name */
@@ -407,20 +405,20 @@
typedef struct _ocfs2_group_desc
{
/*00*/ __u8 bg_signature[8]; /* Signature for validation */
- __u16 bg_size; /* Size of included bitmap in
+ __u16 bryce_bg_size; /* Size of included bitmap in
bytes. */
- __u16 bg_bits; /* Bits represented by this
+ __u16 bryce_bg_bits; /* Bits represented by this
group. */
- __u16 bg_free_bits_count; /* Free bits count */
- __u16 bg_chain; /* What chain I am in. */
-/*10*/ __u32 bg_generation;
- __u32 bg_reserved1;
- __u64 bg_next_group; /* Next group in my list, in
+ __u16 bryce_bg_free_bits_count; /* Free bits count */
+ __u16 bryce_bg_chain; /* What chain I am in. */
+/*10*/ __u32 bryce_bg_generation;
+ __u32 bryce_bg_reserved1; /* unused?? */
+ __u64 bryce_bg_next_group; /* Next group in my list, in
blocks */
-/*20*/ __u64 bg_parent_dinode; /* dinode which owns me, in
+/*20*/ __u64 bryce_bg_parent_dinode; /* dinode which owns me, in
blocks */
- __u64 bg_blkno; /* Offset on disk, in blocks */
-/*30*/ __u64 bg_reserved2[2];
+ __u64 bryce_bg_blkno; /* Offset on disk, in blocks */
+/*30*/ __u64 bryce_bg_reserved2[2]; /* unused?? */
/*40*/ __u8 bg_bitmap[0];
} ocfs2_group_desc;
Modified: branches/bryce/src/ocfs_journal.h
===================================================================
--- branches/bryce/src/ocfs_journal.h 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/ocfs_journal.h 2004-11-30 17:06:44 UTC (rev 1677)
@@ -379,7 +379,7 @@
* prev. last_eb_blk + blocks along edge of tree.
* calc_symlink_credits passes because we just need 1
* credit for the dinode there. */
- dinode_blocks = 1 + 1 + fe->id2.i_list.l_tree_depth;
+ dinode_blocks = 1 + 1 + le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth);
return (bitmap_blocks + sysfile_bitmap_blocks + dinode_blocks);
}
@@ -412,18 +412,18 @@
ocfs2_extent_list *last_el)
{
/* for file entry + all headers in this pass + update to next leaf */
- int credits = 1 + fe->id2.i_list.l_tree_depth + 1;
+ int credits = 1 + le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth) + 1;
int bitmap_blocks, i;
- i = last_el->l_next_free_rec - 1;
+ i = le16_to_cpu(last_el->bryce_l_next_free_rec) - 1;
OCFS_ASSERT(i >= 0);
/* We may be deleting metadata blocks, so metadata alloc dinode +
one desc. block for each possible delete. */
- if (fe->id2.i_list.l_tree_depth
- && (last_el->l_next_free_rec == 1)
- && ((last_el->l_recs[i].e_clusters - clusters_to_del) == 0))
- credits += 1 + fe->id2.i_list.l_tree_depth;
+ if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)
+ && (le16_to_cpu(last_el->bryce_l_next_free_rec) == 1)
+ && ((le32_to_cpu(last_el->l_recs[i].bryce_e_clusters) - clusters_to_del) == 0))
+ credits += 1 + le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth);
/* bitmap fe + group descriptor */
bitmap_blocks = OCFS_SUBALLOC_FREE;
Modified: branches/bryce/src/suballoc.c
===================================================================
--- branches/bryce/src/suballoc.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/suballoc.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -167,16 +167,16 @@
memset(bg, 0, sb->s_blocksize);
strcpy (bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE);
- bg->bg_generation = cpu_to_le32(OCFS2_SB(sb)->fs_generation);
- bg->bg_size = ocfs2_group_bitmap_size(sb);
- bg->bg_bits = (u32) cl->cl_cpg * (u32) cl->cl_bpc;
- bg->bg_chain = my_chain;
- bg->bg_next_group = cl->cl_recs[my_chain].c_blkno;
- bg->bg_parent_dinode = OCFS_I(alloc_inode)->ip_blkno;
- bg->bg_blkno = group_blkno;
+ bg->bryce_bg_generation = cpu_to_le32(alloc_inode->i_generation);
+ bg->bryce_bg_size = le16_to_cpu(ocfs2_group_bitmap_size(sb));
+ bg->bryce_bg_bits = (u32) le16_to_cpu(cl->bryce_cl_cpg) * (u32) le16_to_cpu(cl->bryce_cl_bpc);
+ bg->bryce_bg_chain = le16_to_cpu(my_chain);
+ bg->bryce_bg_next_group = le64_to_cpu(cl->cl_recs[my_chain].bryce_c_blkno);
+ bg->bryce_bg_parent_dinode = le64_to_cpu(OCFS_I(alloc_inode)->ip_blkno);
+ 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);
- bg->bg_free_bits_count = bg->bg_bits - 1;
+ cpu_to_le16(bg->bryce_bg_free_bits_count) = le16_to_cpu(bg->bryce_bg_bits) - 1;
status = ocfs_journal_dirty(handle, bg_bh);
if (status < 0)
@@ -192,8 +192,8 @@
u16 curr, best;
best = curr = 0;
- while (curr < cl->cl_count) {
- if (cl->cl_recs[best].c_total > cl->cl_recs[curr].c_total)
+ while (curr < le16_to_cpu(cl->bryce_cl_count)) {
+ if (le32_to_cpu(cl->cl_recs[best].bryce_c_total) > le32_to_cpu(cl->cl_recs[curr].bryce_c_total))
best = curr;
curr++;
}
@@ -299,14 +299,14 @@
cl = &fe->id2.i_chain;
status = ocfs_reserve_clusters(osb,
handle,
- cl->cl_cpg,
+ le16_to_cpu(cl->bryce_cl_cpg),
&ac);
if (status < 0) {
LOG_ERROR_STATUS(status);
goto bail;
}
- credits = ocfs_calc_group_alloc_credits(osb->sb, cl->cl_cpg);
+ credits = ocfs_calc_group_alloc_credits(osb->sb, le16_to_cpu(cl->bryce_cl_cpg));
handle = ocfs_start_trans(osb, handle, credits);
if (!handle) {
status = -ENOMEM;
@@ -317,7 +317,7 @@
status = ocfs_claim_clusters(osb,
handle,
ac,
- cl->cl_cpg,
+ le16_to_cpu(cl->bryce_cl_cpg),
&bit_off,
&num_bits);
if (status < 0) {
@@ -366,15 +366,15 @@
goto bail;
}
- cl->cl_recs[alloc_rec].c_free += bg->bg_free_bits_count;
- cl->cl_recs[alloc_rec].c_total += bg->bg_bits;
- cl->cl_recs[alloc_rec].c_blkno = bg_blkno;
- if (cl->cl_next_free_rec < cl->cl_count)
- cl->cl_next_free_rec++;
+ 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;
+ 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)++;
- fe->id1.bitmap1.i_used += (bg->bg_bits - bg->bg_free_bits_count);
- fe->id1.bitmap1.i_total += bg->bg_bits;
- fe->i_clusters += cl->cl_cpg;
+ 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);
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -383,11 +383,11 @@
}
spin_lock(&OCFS_I(alloc_inode)->ip_lock);
- OCFS_I(alloc_inode)->ip_clusters = fe->i_clusters;
- fe->i_size = ocfs2_clusters_to_bytes(alloc_inode->i_sb,
- fe->i_clusters);
+ 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));
spin_unlock(&OCFS_I(alloc_inode)->ip_lock);
- alloc_inode->i_size = fe->i_size;
+ 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;
status = 0;
@@ -437,10 +437,10 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT_RO(fe->i_flags & OCFS2_CHAIN_FL);
+ OCFS_ASSERT_RO(le32_to_cpu(fe->bryce_i_flags) & OCFS2_CHAIN_FL);
- free_bits = le32_to_cpu(fe->id1.bitmap1.i_total) -
- le32_to_cpu(fe->id1.bitmap1.i_used);
+ free_bits = le32_to_cpu(fe->id1.bitmap1.bryce_i_total) -
+ le32_to_cpu(fe->id1.bitmap1.bryce_i_used);
if (bits_wanted > free_bits) {
/* cluster bitmap never grows */
@@ -458,8 +458,8 @@
}
/* You should never ask for this much metadata */
OCFS_ASSERT(bits_wanted <=
- (le32_to_cpu(fe->id1.bitmap1.i_total)
- - le32_to_cpu(fe->id1.bitmap1.i_used)));
+ (le32_to_cpu(fe->id1.bitmap1.bryce_i_total)
+ - le32_to_cpu(fe->id1.bitmap1.bryce_i_used)));
}
get_bh(bh);
@@ -715,9 +715,9 @@
bitmap = bg->bg_bitmap;
while((offset = ocfs2_find_next_zero_bit(bitmap,
- bg->bg_bits,
+ le16_to_cpu(bg->bryce_bg_bits),
start)) != -1) {
- if (offset == bg->bg_bits)
+ if (offset == le16_to_cpu(bg->bryce_bg_bits))
break;
if (!ocfs_test_bg_bit_allocatable(bg_bh, offset)) {
@@ -773,7 +773,7 @@
LOG_ENTRY();
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
- OCFS_ASSERT(bg->bg_free_bits_count >= num_bits);
+ OCFS_ASSERT(cpu_to_le16(bg->bryce_bg_free_bits_count) >= num_bits);
LOG_TRACE_ARGS("block_group_set_bits: off = %u, num = %u\n", bit_off,
num_bits);
@@ -790,7 +790,7 @@
goto bail;
}
- bg->bg_free_bits_count -= num_bits;
+ cpu_to_le16(bg->bryce_bg_free_bits_count) -= num_bits;
while(num_bits--)
ocfs2_set_bit(bit_off++, bitmap);
@@ -812,16 +812,16 @@
{
u16 curr, best;
- OCFS_ASSERT(cl->cl_next_free_rec);
+ OCFS_ASSERT(le16_to_cpu(cl->bryce_cl_next_free_rec));
best = curr = 0;
- while (curr < cl->cl_next_free_rec) {
- if (cl->cl_recs[curr].c_free > cl->cl_recs[best].c_free)
+ while (curr < le16_to_cpu(cl->bryce_cl_next_free_rec)) {
+ if (le32_to_cpu(cl->cl_recs[curr].bryce_c_free) > le32_to_cpu(cl->cl_recs[best].bryce_c_free))
best = curr;
curr++;
}
- OCFS_ASSERT(best < cl->cl_next_free_rec);
+ OCFS_ASSERT(best < le16_to_cpu(cl->bryce_cl_next_free_rec));
return best;
}
@@ -845,12 +845,12 @@
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(prev_bg));
LOG_TRACE_ARGS("In suballoc %llu, chain %u, move group %llu to top, "
- "prev = %llu\n", fe->i_blkno, chain, bg->bg_blkno,
- prev_bg->bg_blkno);
+ "prev = %llu\n", le64_to_cpu(fe->bryce_i_blkno), chain, le64_to_cpu(bg->bryce_bg_blkno),
+ le64_to_cpu(prev_bg->bryce_bg_blkno));
- fe_ptr = fe->id2.i_chain.cl_recs[chain].c_blkno;
- bg_ptr = bg->bg_next_group;
- prev_bg_ptr = prev_bg->bg_next_group;
+ fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno);
+ bg_ptr = le64_to_cpu(bg->bryce_bg_next_group);
+ prev_bg_ptr = le64_to_cpu(prev_bg->bryce_bg_next_group);
status = ocfs_journal_access(handle, alloc_inode, prev_bg_bh,
OCFS_JOURNAL_ACCESS_WRITE);
@@ -859,7 +859,7 @@
goto bail;
}
- prev_bg->bg_next_group = bg->bg_next_group;
+ cpu_to_le64(prev_bg->bryce_bg_next_group) = 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;
}
- bg->bg_next_group = fe->id2.i_chain.cl_recs[chain].c_blkno;
+ cpu_to_le64(bg->bryce_bg_next_group) = 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;
}
- fe->id2.i_chain.cl_recs[chain].c_blkno = bg->bg_blkno;
+ cpu_to_le64(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno) = 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) {
- fe->id2.i_chain.cl_recs[chain].c_blkno = fe_ptr;
- bg->bg_next_group = bg_ptr;
- prev_bg->bg_next_group = prev_bg_ptr;
+ 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;
}
LOG_EXIT_STATUS(status);
@@ -912,7 +912,7 @@
static inline int ocfs_block_group_reasonably_empty(ocfs2_group_desc *bg,
u32 wanted)
{
- return bg->bg_free_bits_count > wanted;
+ return le16_to_cpu(bg->bryce_bg_free_bits_count) > wanted;
}
/* return 0 on success, -ENOSPC to keep searching and any other < 0
@@ -929,7 +929,7 @@
OCFS_ASSERT(ocfs2_is_cluster_bitmap(inode));
- if (bg->bg_free_bits_count) {
+ if (le16_to_cpu(bg->bryce_bg_free_bits_count)) {
ret = ocfs_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
group_bh, bits_wanted,
&tmp_off, &tmp_found);
@@ -956,7 +956,7 @@
OCFS_ASSERT(min_bits == 1);
OCFS_ASSERT(!ocfs2_is_cluster_bitmap(inode));
- if (bg->bg_free_bits_count)
+ if (le16_to_cpu(bg->bryce_bg_free_bits_count))
ret = ocfs_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
group_bh, bits_wanted,
bit_off, bits_found);
@@ -987,7 +987,7 @@
bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
- cl->cl_recs[chain].c_blkno, &group_bh,
+ le64_to_cpu(cl->cl_recs[chain].bryce_c_blkno), &group_bh,
OCFS_BH_CACHED, alloc_inode);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1002,14 +1002,14 @@
while ((status = ac->ac_group_search(alloc_inode, group_bh,
bits_wanted, min_bits, bit_off,
&tmp_bits)) == -ENOSPC) {
- if (!bg->bg_next_group)
+ if (!le64_to_cpu(bg->bryce_bg_next_group))
break;
if (prev_group_bh) {
brelse(prev_group_bh);
prev_group_bh = NULL;
}
- next_group = bg->bg_next_group;
+ next_group = le64_to_cpu(bg->bryce_bg_next_group);
prev_group_bh = group_bh;
group_bh = NULL;
status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
@@ -1029,7 +1029,7 @@
}
LOG_TRACE_ARGS("alloc succeeds: we give %u bits from block group "
- "%llu\n", tmp_bits, bg->bg_blkno);
+ "%llu\n", tmp_bits, le64_to_cpu(bg->bryce_bg_blkno));
*num_bits = tmp_bits;
@@ -1071,8 +1071,8 @@
goto bail;
}
- fe->id1.bitmap1.i_used += *num_bits;
- cl->cl_recs[chain].c_free -= *num_bits;
+ cpu_to_le32(fe->id1.bitmap1.bryce_i_used) += *num_bits;
+ cpu_to_le32(cl->cl_recs[chain].bryce_c_free) -= *num_bits;
status = ocfs_journal_dirty(handle,
ac->ac_bh);
@@ -1093,9 +1093,9 @@
}
LOG_TRACE_ARGS("Allocated %u bits from suballocator %llu\n",
- *num_bits, fe->i_blkno);
+ *num_bits, le64_to_cpu(fe->bryce_i_blkno));
- *bg_blkno = bg->bg_blkno;
+ *bg_blkno = le64_to_cpu(bg->bryce_bg_blkno);
bail:
if (group_bh)
brelse(group_bh);
@@ -1128,7 +1128,7 @@
fe = (ocfs2_dinode *) ac->ac_bh->b_data;
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT_RO(fe->id1.bitmap1.i_used < fe->id1.bitmap1.i_total);
+ OCFS_ASSERT_RO(le32_to_cpu(fe->id1.bitmap1.bryce_i_used) < le32_to_cpu(fe->id1.bitmap1.bryce_i_total));
cl = (ocfs2_chain_list *) &fe->id2.i_chain;
@@ -1153,10 +1153,10 @@
* because we only calculate enough journal credits for one
* relink per alloc. */
ac->ac_allow_chain_relink = 0;
- for (i = 0; i < cl->cl_next_free_rec; i ++) {
+ for (i = 0; i < le16_to_cpu(cl->bryce_cl_next_free_rec); i ++) {
if (i == victim)
continue;
- if (!cl->cl_recs[i].c_free)
+ if (!le32_to_cpu(cl->cl_recs[i].bryce_c_free))
continue;
ac->ac_chain = i;
@@ -1423,7 +1423,7 @@
ocfs2_set_bit(bit_off + tmp,
(unsigned long *) undo_bg->bg_bitmap);
}
- bg->bg_free_bits_count += num_bits;
+ cpu_to_le16(bg->bryce_bg_free_bits_count) += num_bits;
status = ocfs_journal_dirty(handle, group_bh);
if (status < 0)
@@ -1453,7 +1453,7 @@
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
OCFS_ASSERT((count + start_bit)
- <= ((u32) cl->cl_cpg * (u32) cl->cl_bpc));
+ <= ((u32) le16_to_cpu(cl->bryce_cl_cpg) * (u32) le16_to_cpu(cl->bryce_cl_bpc)));
LOG_TRACE_ARGS("suballocator %llu: freeing %u bits from group %llu, "
"starting at %u\n",
@@ -1469,7 +1469,7 @@
group = (ocfs2_group_desc *) group_bh->b_data;
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(group));
- OCFS_ASSERT((count + start_bit) <= group->bg_bits);
+ OCFS_ASSERT((count + start_bit) <= le16_to_cpu(group->bryce_bg_bits));
status = ocfs_block_group_clear_bits(handle, alloc_inode,
group, group_bh,
@@ -1486,8 +1486,8 @@
goto bail;
}
- cl->cl_recs[group->bg_chain].c_free += count;
- fe->id1.bitmap1.i_used -= count;
+ 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;
status = ocfs_journal_dirty(handle, alloc_bh);
if (status < 0) {
@@ -1515,8 +1515,8 @@
struct buffer_head *inode_alloc_bh,
ocfs2_dinode *di)
{
- u64 blk = le64_to_cpu(di->i_blkno);
- u16 bit = le16_to_cpu(di->i_suballoc_bit);
+ u64 blk = le64_to_cpu(di->bryce_i_blkno);
+ u16 bit = le16_to_cpu(di->bryce_i_suballoc_bit);
u64 bg_blkno = ocfs_which_suballoc_group(blk, bit);
return ocfs_free_suballoc_bits(handle, inode_alloc_inode,
@@ -1528,8 +1528,8 @@
struct buffer_head *eb_alloc_bh,
ocfs2_extent_block *eb)
{
- u64 blk = le64_to_cpu(eb->h_blkno);
- u16 bit = le16_to_cpu(eb->h_suballoc_bit);
+ u64 blk = le64_to_cpu(eb->bryce_h_blkno);
+ u16 bit = le16_to_cpu(eb->bryce_h_suballoc_bit);
u64 bg_blkno = ocfs_which_suballoc_group(blk, bit);
return ocfs_free_suballoc_bits(handle, eb_alloc_inode, eb_alloc_bh,
@@ -1577,38 +1577,39 @@
{
printk("Block Group:\n");
printk("bg_signature: %s\n", bg->bg_signature);
- printk("bg_size: %u\n", bg->bg_size);
- printk("bg_bits: %u\n", bg->bg_bits);
- printk("bg_free_bits_count: %u\n", bg->bg_free_bits_count);
- printk("bg_chain: %u\n", bg->bg_chain);
- printk("bg_generation: %u\n", bg->bg_generation);
- printk("bg_next_group: %llu\n", bg->bg_next_group);
- printk("bg_parent_dinode: %llu\n", bg->bg_parent_dinode);
- printk("bg_blkno: %llu\n", bg->bg_blkno);
+ printk("bg_size: %u\n", le16_to_cpu(bg->bryce_bg_size));
+ printk("bg_bits: %u\n", le16_to_cpu(bg->bryce_bg_bits));
+ printk("bg_free_bits_count: %u\n", le16_to_cpu(bg->bryce_bg_free_bits_count));
+ printk("bg_chain: %u\n", le16_to_cpu(bg->bryce_bg_chain));
+ printk("bg_generation: %u\n", le32_to_cpu(bg->bryce_bg_generation));
+ printk("bg_next_group: %llu\n", le64_to_cpu(bg->bryce_bg_next_group));
+ printk("bg_parent_dinode: %llu\n", le64_to_cpu(bg->bryce_bg_parent_dinode));
+ printk("bg_blkno: %llu\n", le64_to_cpu(bg->bryce_bg_blkno));
}
static inline void debug_suballoc_inode(ocfs2_dinode *fe)
{
int i;
- printk("Suballoc Inode %llu:\n", fe->i_blkno);
+ printk("Suballoc Inode %llu:\n", le64_to_cpu(fe->bryce_i_blkno));
printk("i_signature: %s\n", fe->i_signature);
- printk("i_size: %llu\n", fe->i_size);
- printk("i_clusters: %u\n", fe->i_clusters);
- printk("i_generation: %u\n", fe->i_generation);
- printk("id1.bitmap1.i_used: %u\n", fe->id1.bitmap1.i_used);
- printk("id1.bitmap1.i_total: %u\n", fe->id1.bitmap1.i_total);
- printk("id2.i_chain.cl_cpg: %u\n", fe->id2.i_chain.cl_cpg);
- printk("id2.i_chain.cl_bpc: %u\n", fe->id2.i_chain.cl_bpc);
- printk("id2.i_chain.cl_count: %u\n", fe->id2.i_chain.cl_count);
+
+ printk("i_size: %llu\n", le64_to_cpu(fe->bryce_i_size));
+ printk("i_clusters: %u\n", le32_to_cpu(fe->bryce_i_clusters));
+ printk("i_generation: %u\n", le32_to_cpu(fe->bryce_i_generation));
+ printk("id1.bitmap1.i_used: %u\n", le32_to_cpu(fe->id1.bitmap1.bryce_i_used));
+ printk("id1.bitmap1.i_total: %u\n", le32_to_cpu(fe->id1.bitmap1.bryce_i_total));
+ printk("id2.i_chain.cl_cpg: %u\n", le16_to_cpu(fe->id2.i_chain.bryce_cl_cpg));
+ printk("id2.i_chain.cl_bpc: %u\n", le16_to_cpu(fe->id2.i_chain.bryce_cl_bpc));
+ printk("id2.i_chain.cl_count: %u\n", le16_to_cpu(fe->id2.i_chain.bryce_cl_count));
printk("id2.i_chain.cl_next_free_rec: %u\n",
- fe->id2.i_chain.cl_next_free_rec);
- for(i = 0; i < fe->id2.i_chain.cl_next_free_rec; i++) {
+ le16_to_cpu(fe->id2.i_chain.bryce_cl_next_free_rec));
+ for(i = 0; i < le16_to_cpu(fe->id2.i_chain.bryce_cl_next_free_rec); i++) {
printk("fe->id2.i_chain.cl_recs[%d].c_free: %u\n", i,
- fe->id2.i_chain.cl_recs[i].c_free);
+ le32_to_cpu(fe->id2.i_chain.cl_recs[i].bryce_c_free));
printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i,
- fe->id2.i_chain.cl_recs[i].c_total);
+ le32_to_cpu(fe->id2.i_chain.cl_recs[i].bryce_c_total));
printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %llu\n", i,
- fe->id2.i_chain.cl_recs[i].c_blkno);
+ le64_to_cpu(fe->id2.i_chain.cl_recs[i].bryce_c_blkno));
}
}
Modified: branches/bryce/src/super.c
===================================================================
--- branches/bryce/src/super.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/super.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -768,8 +768,8 @@
bm_lock = (ocfs2_dinode *) bh->b_data;
- numbits = le32_to_cpu(bm_lock->id1.bitmap1.i_total);
- freebits = numbits - le32_to_cpu(bm_lock->id1.bitmap1.i_used);
+ numbits = le32_to_cpu(bm_lock->id1.bitmap1.bryce_i_total);
+ freebits = numbits - le32_to_cpu(bm_lock->id1.bitmap1.bryce_i_used);
buf->f_type = OCFS_MAGIC;
buf->f_bsize = sb->s_blocksize;
@@ -1335,7 +1335,7 @@
/* this needs to be done before most other initializations */
di = (ocfs2_dinode *) bh->b_data;
- osb->max_nodes = le32_to_cpu(di->id2.i_super.s_max_nodes);
+ osb->max_nodes = le16_to_cpu(di->id2.i_super.bryce_s_max_nodes);
if (osb->max_nodes > OCFS2_MAX_NODES) {
LOG_ERROR_ARGS("Invalid number of nodes (%u)\n",
osb->max_nodes);
@@ -1345,11 +1345,11 @@
printk("max_nodes for this device: %u\n", osb->max_nodes);
osb->s_feature_compat =
- le32_to_cpu(OCFS2_RAW_SB(di)->s_feature_compat);
+ le32_to_cpu(OCFS2_RAW_SB(di)->bryce_s_feature_compat);
osb->s_feature_ro_compat =
- le32_to_cpu(OCFS2_RAW_SB(di)->s_feature_ro_compat);
+ le32_to_cpu(OCFS2_RAW_SB(di)->bryce_s_feature_ro_compat);
osb->s_feature_incompat =
- le32_to_cpu(OCFS2_RAW_SB(di)->s_feature_incompat);
+ le32_to_cpu(OCFS2_RAW_SB(di)->bryce_s_feature_incompat);
if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) {
LOG_ERROR_ARGS("couldn't mount because of unsupported "
@@ -1484,12 +1484,12 @@
di = (ocfs2_dinode *) bh->b_data;
/* get some pseudo constants for clustersize bits */
- osb->s_clustersize_bits = le32_to_cpu(di->id2.i_super.s_clustersize_bits);
+ osb->s_clustersize_bits = le32_to_cpu(di->id2.i_super.bryce_s_clustersize_bits);
osb->s_clustersize = 1 << osb->s_clustersize_bits;
printk("clusterbits=%d\n", osb->s_clustersize_bits);
OCFS_ASSERT(osb->s_clustersize_bits);
- if (ocfs2_clusters_to_blocks(osb->sb, le32_to_cpu(di->i_clusters) - 1)
+ if (ocfs2_clusters_to_blocks(osb->sb, le32_to_cpu(di->bryce_i_clusters) - 1)
> (u32)~0UL) {
LOG_ERROR_ARGS("Volume might try to write to blocks beyond "
"what jbd can address in 32 bits.\n");
@@ -1500,10 +1500,9 @@
strncpy(osb->vol_label, di->id2.i_super.s_label, 63);
osb->vol_label[63] = '\0';
memcpy(osb->uuid, di->id2.i_super.s_uuid, MAX_VOL_ID_LENGTH);
- osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno);
- osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno);
- osb->first_cluster_group_blkno = le64_to_cpu(di->id2.i_super.s_first_cluster_group);
- osb->fs_generation = le32_to_cpu(di->i_fs_generation);
+ osb->root_blkno = le64_to_cpu(di->id2.i_super.bryce_s_root_blkno);
+ osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.bryce_s_system_dir_blkno);
+ osb->first_cluster_group_blkno = le64_to_cpu(di->id2.i_super.bryce_s_first_cluster_group);
printk("vol_label: %s\n", osb->vol_label);
{
int ttt;
@@ -1609,8 +1608,8 @@
goto bail;
}
di = (ocfs2_dinode *) bitmap_bh->b_data;
- osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg);
- osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total);
+ osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.bryce_cl_cpg);
+ osb->num_clusters = le32_to_cpu(di->id1.bitmap1.bryce_i_total);
brelse(bitmap_bh);
printk("cluster bitmap inode: %llu, clusters per group: %u\n",
osb->bitmap_blkno, osb->bitmap_cpg);
@@ -1745,39 +1744,39 @@
if (memcmp(di->i_signature, OCFS2_SUPER_BLOCK_SIGNATURE,
strlen(OCFS2_SUPER_BLOCK_SIGNATURE)) == 0) {
status = -EINVAL;
- if ((1 << le32_to_cpu(di->id2.i_super.s_blocksize_bits)) != blksz) {
+ if ((1 << le32_to_cpu(di->id2.i_super.bryce_s_blocksize_bits)) != blksz) {
LOG_ERROR_ARGS("found superblock with incorrect block size: "
"found %u, should be %u\n",
- 1 << le32_to_cpu(di->id2.i_super.s_blocksize_bits),
+ 1 << le32_to_cpu(di->id2.i_super.bryce_s_blocksize_bits),
blksz);
- } else if (le16_to_cpu(di->id2.i_super.s_major_rev_level) !=
+ } else if (le16_to_cpu(di->id2.i_super.bryce_s_major_rev_level) !=
OCFS2_MAJOR_REV_LEVEL ||
- le16_to_cpu(di->id2.i_super.s_minor_rev_level) !=
+ le16_to_cpu(di->id2.i_super.bryce_s_minor_rev_level) !=
OCFS2_MINOR_REV_LEVEL) {
#warning dont know what is appropriate on minor rev difference
LOG_ERROR_ARGS("found superblock with bad version: "
"found %u.%u, should be %u.%u\n",
- le16_to_cpu(di->id2.i_super.s_major_rev_level),
- le16_to_cpu(di->id2.i_super.s_minor_rev_level),
+ le16_to_cpu(di->id2.i_super.bryce_s_major_rev_level),
+ le16_to_cpu(di->id2.i_super.bryce_s_minor_rev_level),
OCFS2_MAJOR_REV_LEVEL,
OCFS2_MINOR_REV_LEVEL);
- } else if (bh->b_blocknr != le64_to_cpu(di->i_blkno)) {
+ } else if (bh->b_blocknr != le64_to_cpu(di->bryce_i_blkno)) {
LOG_ERROR_ARGS("bad block number on superblock: "
"found %llu, should be %llu\n",
- le64_to_cpu(di->i_blkno),
+ le64_to_cpu(di->bryce_i_blkno),
(unsigned long long)bh->b_blocknr);
- } else if (le32_to_cpu(di->id2.i_super.s_clustersize_bits) < 12 ||
- le32_to_cpu(di->id2.i_super.s_clustersize_bits) > 20) {
+ } else if (le32_to_cpu(di->id2.i_super.bryce_s_clustersize_bits) < 12 ||
+ le32_to_cpu(di->id2.i_super.bryce_s_clustersize_bits) > 20) {
LOG_ERROR_ARGS("bad cluster size found: %u\n",
- 1 << le32_to_cpu(di->id2.i_super.s_clustersize_bits));
- } else if (!le64_to_cpu(di->id2.i_super.s_root_blkno)) {
+ 1 << le32_to_cpu(di->id2.i_super.bryce_s_clustersize_bits));
+ } else if (!le64_to_cpu(di->id2.i_super.bryce_s_root_blkno)) {
LOG_ERROR_STR("bad root_blkno: 0");
- } else if (!le64_to_cpu(di->id2.i_super.s_system_dir_blkno)) {
+ } else if (!le64_to_cpu(di->id2.i_super.bryce_s_system_dir_blkno)) {
LOG_ERROR_STR("bad system_dir_blkno: 0");
- } else if (le32_to_cpu(di->id2.i_super.s_max_nodes) > OCFS2_MAX_NODES) {
+ } else if (le16_to_cpu(di->id2.i_super.bryce_s_max_nodes) > OCFS2_MAX_NODES) {
LOG_ERROR_ARGS("max_nodes found greater than maximum: "
"found %u, max %u\n",
- le32_to_cpu(di->id2.i_super.s_max_nodes),
+ le16_to_cpu(di->id2.i_super.bryce_s_max_nodes),
OCFS2_MAX_NODES);
} else {
/* found it! */
Modified: branches/bryce/src/volcfg.c
===================================================================
--- branches/bryce/src/volcfg.c 2004-11-30 16:05:52 UTC (rev 1676)
+++ branches/bryce/src/volcfg.c 2004-11-30 17:06:44 UTC (rev 1677)
@@ -29,6 +29,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
+#include <linux/byteorder/generic.h>
#include "ocfs_log.h"
#include "ocfs.h"
@@ -341,7 +342,7 @@
}
disk_lock = (ocfs2_disk_lock *) bh->b_data;
- lock_node_num = disk_lock->dl_master;
+ lock_node_num = le16_to_cpu(disk_lock->bryce_dl_master);
if (disk_lock->dl_level == 0 || break_lock) {
if (disk_lock->dl_level != 0)
@@ -352,7 +353,7 @@
/* Attempt to lock volcfg */
memcpy(disk_lock, cfg_buf, osb->sb->s_blocksize);
- disk_lock->dl_master = osb->node_num;
+ cpu_to_le16(disk_lock->bryce_dl_master) = osb->node_num;
disk_lock->dl_level = 1;
memcpy(cfg_buf, disk_lock, osb->sb->s_blocksize);
@@ -393,7 +394,7 @@
/* Write the config info into the disk */
disk_lock = (ocfs2_disk_lock *)cfg_buf;
- disk_lock->dl_master = OCFS_INVALID_NODE_NUM;
+ cpu_to_le16(disk_lock->bryce_dl_master) = OCFS_INVALID_NODE_NUM;
disk_lock->dl_level = 0;
if (op == OCFS_VOLCFG_ADD)
@@ -411,11 +412,11 @@
break;
} else {
disk_lock = (ocfs2_disk_lock *)lock_buf;
- if (disk_lock->dl_master == lock_node_num)
+ if (le16_to_cpu(disk_lock->bryce_dl_master) == lock_node_num)
break_lock = 1;
else {
LOG_TRACE_ARGS ("Node config locked by node: %d\n",
- disk_lock->dl_master);
+ le16_to_cpu(disk_lock->bryce_dl_master));
ocfs_sleep (OCFS_VOLCFG_LOCK_TIME);
}
}
More information about the Ocfs2-commits
mailing list