[Ocfs2-commits] bryce commits r1799 - branches/endian/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jan 20 08:25:39 CST 2005
Author: bryce
Date: 2005-01-20 08:25:37 -0600 (Thu, 20 Jan 2005)
New Revision: 1799
Modified:
branches/endian/src/24io.c
branches/endian/src/Makefile
branches/endian/src/alloc.c
branches/endian/src/alloc.h
branches/endian/src/aops.c
branches/endian/src/buffer_head_io.c
branches/endian/src/dcache.c
branches/endian/src/dir.c
branches/endian/src/extent_map.c
branches/endian/src/file.c
branches/endian/src/inode.c
branches/endian/src/journal.c
branches/endian/src/localalloc.c
branches/endian/src/namei.c
branches/endian/src/namei.h
branches/endian/src/ocfs.h
branches/endian/src/ocfs2_fs.h
branches/endian/src/ocfs_journal.h
branches/endian/src/proc.c
branches/endian/src/suballoc.c
branches/endian/src/super.c
branches/endian/src/vote.c
Log:
1) bryce_ is now replaced with odd_ (on disk data)
2) all %llu's that matter have been 64bitized
3) namei.c is complely fragged because of that dumb PARENT_INO()
macro definition which the PPC64 compiler hates
I have NO idea what to do with it. Really.
4) There seems to be some iffyness with prototypes for
irq_offset_up
irq_offset_down
irq_offset_value
havn't determined how to make the compiler happy about that
Phil
=--=
Modified: branches/endian/src/24io.c
===================================================================
--- branches/endian/src/24io.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/24io.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -78,8 +78,13 @@
p_sector += offset;
if (p_sector == 0) {
err = -EIO;
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("isector=%lu inode=%lu\n",
+ isector, OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS ("isector=%lu inode=%llu\n",
isector, OCFS_I(inode)->ip_blkno);
+#endif
}
/* 2.4 shouldn't ever have this happen */
Modified: branches/endian/src/Makefile
===================================================================
--- branches/endian/src/Makefile 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/Makefile 2005-01-20 14:25:37 UTC (rev 1799)
@@ -23,6 +23,7 @@
GLOBAL_DEFINES =
GLOBAL_DEFINES += -DCATCH_BH_JBD_RACES
+#GLOBAL_DEFINES += -DPURE_EVIL
ifdef OCFS_DEBUG
GLOBAL_DEFINES += -DDEBUG
@@ -50,7 +51,7 @@
ifneq ($(QUIET),1)
GLOBAL_DEFINES += -DVERBOSE_BH_JBD_TRACE
-GLOBAL_DEFINES += -DVERBOSE_LOCKING_TRACE
+#GLOBAL_DEFINES += -DVERBOSE_LOCKING_TRACE
GLOBAL_DEFINES += -DVERBOSE_BH_SEQNUM_TRACE
GLOBAL_DEFINES += -DVERBOSE_PROCESS_VOTE
GLOBAL_DEFINES += -DVERBOSE_COMMIT_THREAD
@@ -68,7 +69,7 @@
buffer_head_io.c \
dcache.c \
dir.c \
- dlmglue.c \
+ dlm.c \
extent_map.c \
file.c \
heartbeat.c \
@@ -76,20 +77,22 @@
ioctl.c \
journal.c \
localalloc.c \
- mmap.c \
- namei.c \
- ocfs_compat.c \
+ lockres.c \
+ nm.c \
proc.c \
- slot_map.c \
suballoc.c \
super.c \
symlink.c \
sysfile.c \
util.c \
ver.c \
- vote.c
+ volcfg.c \
+ vote.c \
+ namei.c
+
HFILES = \
ocfs2_fs.h \
+ ocfs2_disk_dlm.h \
ocfs1_fs_compat.h \
ocfs.h \
ocfs_log.h \
@@ -99,7 +102,7 @@
alloc.h \
dcache.h \
dir.h \
- dlmglue.h \
+ dlm.h \
extent_map.h \
file.h \
heartbeat.h \
@@ -107,17 +110,19 @@
ioctl.h \
journal.h \
localalloc.h \
- mmap.h \
+ lockres.h \
namei.h \
+ nm.h \
proc.h \
- slot_map.h \
suballoc.h \
super.h \
symlink.h \
sysfile.h \
util.h \
ver.h \
+ volcfg.h \
vote.h
+
VERSION_FILES = $(CFILES) $(HFILES)
VERSION_SRC = ver.c
VERSION_PREFIX = OCFS
@@ -190,7 +195,7 @@
BASE_DEFINES = -DMODULE -DLINUX -D__KERNEL__
DEFINES += $(BASE_DEFINES) $(GLOBAL_DEFINES)
-INCLUDES = -I. -I$(TOPDIR) -I$(KERNELINC) -I$(GCCINC)
+INCLUDES = -I. -I$(KERNELINC) -I$(GCCINC)
CFLAGS = $(OPTS) $(MACH_CFLAGS) -pipe -nostdinc -fno-strict-aliasing \
-fno-common -fomit-frame-pointer $(MODVERSIONS) $(WARNINGS)
@@ -239,8 +244,8 @@
INSTALL_RULES = install-ocfs
install-ocfs: $(INSTALL_MODULE)
- $(TOPDIR)/mkinstalldirs $(DESTDIR)$(MODULEDIR)/ocfs2
- $(INSTALL_DATA) $< $(DESTDIR)$(MODULEDIR)/ocfs2/$<
+ $(TOPDIR)/mkinstalldirs $(DESTDIR)$(MODULEDIR)
+ $(INSTALL_DATA) $< $(DESTDIR)$(MODULEDIR)/$<
include $(TOPDIR)/Postamble.make
@@ -266,8 +271,7 @@
STAMP_DIR = $(OCFS_SRC_DIR)
include $(OCFS_SRC_DIR)/../Versioning.make
-CLUSTERINC := $(OCFS_SRC_DIR)/..
-EXTRA_CFLAGS += $(GLOBAL_DEFINES) -I$(CLUSTERINC)
+EXTRA_CFLAGS += $(GLOBAL_DEFINES)
CFLAGS_$(VERSION_OBJ) += $(VERDEFS)
Modified: branches/endian/src/alloc.c
===================================================================
--- branches/endian/src/alloc.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/alloc.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -105,9 +105,9 @@
static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
u64 blkno)
{
- return blkno == (le64_to_cpu(ext->bryce_e_blkno) +
+ return blkno == (le64_to_cpu(ext->odd_e_blkno) +
ocfs2_clusters_to_blocks(inode->i_sb,
- le32_to_cpu(ext->bryce_e_clusters)));
+ le32_to_cpu(ext->odd_e_clusters)));
}
/*
@@ -126,8 +126,8 @@
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
- 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,
+ if (le64_to_cpu(fe->odd_i_last_eb_blk)) {
+ retval = ocfs_read_block(osb, le64_to_cpu(fe->odd_i_last_eb_blk), &eb_bh,
OCFS_BH_CACHED, inode);
if (retval < 0) {
LOG_ERROR_STATUS(retval);
@@ -138,9 +138,9 @@
} else
el = &(fe->id2.i_list);
- OCFS_ASSERT(le16_to_cpu(el->bryce_l_tree_depth) == 0);
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_tree_depth) == 0);
- retval = le16_to_cpu(el->bryce_l_count) - le16_to_cpu(el->bryce_l_next_free_rec);
+ retval = le16_to_cpu(el->odd_l_count) - le16_to_cpu(el->odd_l_next_free_rec);
bail:
if (eb_bh)
brelse(eb_bh);
@@ -204,16 +204,16 @@
eb = (ocfs2_extent_block *) bhs[i]->b_data;
/* Ok, setup the minimal stuff here. */
strcpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE);
- eb->bryce_h_blkno = cpu_to_le64(first_blkno);
+ eb->odd_h_blkno = cpu_to_le64(first_blkno);
#ifndef OCFS_USE_ALL_METADATA_SUBALLOCATORS
/* we always use node zeros suballocator */
- eb->bryce_h_suballoc_node = cpu_to_le16(0);
+ eb->odd_h_suballoc_node = cpu_to_le16(0);
#else
eb->h_suballoc_node = osb->node_num;
#endif
- eb->bryce_h_suballoc_bit = cpu_to_le16(suballoc_bit_start);
- eb->h_list.bryce_l_count = cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb));
+ eb->odd_h_suballoc_bit = cpu_to_le16(suballoc_bit_start);
+ eb->h_list.odd_l_count = cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb));
suballoc_bit_start++;
first_blkno++;
@@ -286,9 +286,9 @@
el = &fe->id2.i_list;
/* we never add a branch to a leaf. */
- OCFS_ASSERT(le16_to_cpu(el->bryce_l_tree_depth));
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_tree_depth));
- new_blocks = le16_to_cpu(el->bryce_l_tree_depth);
+ new_blocks = le16_to_cpu(el->odd_l_tree_depth);
/* allocate the number of new eb blocks we need */
size = sizeof(struct buffer_head *) * new_blocks;
@@ -328,14 +328,14 @@
goto bail;
}
- eb->bryce_h_next_leaf_blk = cpu_to_le64(0);
- eb_el->bryce_l_tree_depth = cpu_to_le16(i);
- eb_el->bryce_l_next_free_rec = cpu_to_le16(1);
- eb_el->l_recs[0].bryce_e_cpos = fe->bryce_i_clusters; /* no need to convert? */
- eb_el->l_recs[0].bryce_e_blkno = cpu_to_le64(next_blkno);
- eb_el->l_recs[0].bryce_e_clusters = cpu_to_le32(0);
- if (!le16_to_cpu(eb_el->bryce_l_tree_depth))
- new_last_eb_blk = le64_to_cpu(eb->bryce_h_blkno);
+ eb->odd_h_next_leaf_blk = cpu_to_le64(0);
+ eb_el->odd_l_tree_depth = cpu_to_le16(i);
+ eb_el->odd_l_next_free_rec = cpu_to_le16(1);
+ eb_el->l_recs[0].odd_e_cpos = fe->odd_i_clusters; /* no need to convert? */
+ eb_el->l_recs[0].odd_e_blkno = cpu_to_le64(next_blkno);
+ eb_el->l_recs[0].odd_e_clusters = cpu_to_le32(0);
+ if (!le16_to_cpu(eb_el->odd_l_tree_depth))
+ new_last_eb_blk = le64_to_cpu(eb->odd_h_blkno);
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -343,7 +343,7 @@
goto bail;
}
- next_blkno = le64_to_cpu(eb->bryce_h_blkno);
+ next_blkno = le64_to_cpu(eb->odd_h_blkno);
}
/* This is a bit hairy. We want to update up to three blocks
@@ -375,18 +375,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 = le16_to_cpu(el->bryce_l_next_free_rec);
- el->l_recs[i].bryce_e_blkno = cpu_to_le64(next_blkno);
- el->l_recs[i].bryce_e_cpos = fe->bryce_i_clusters;
- el->l_recs[i].bryce_e_clusters = cpu_to_le32(0);
- el->bryce_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->bryce_l_next_free_rec) + 1 );
+ i = le16_to_cpu(el->odd_l_next_free_rec);
+ el->l_recs[i].odd_e_blkno = cpu_to_le64(next_blkno);
+ el->l_recs[i].odd_e_cpos = fe->odd_i_clusters;
+ el->l_recs[i].odd_e_clusters = cpu_to_le32(0);
+ el->odd_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->odd_l_next_free_rec) + 1 );
/* fe needs a new last extent block pointer, as does the
* next_leaf on the previously last-extent-block. */
- fe->bryce_i_last_eb_blk = cpu_to_le64(new_last_eb_blk);
+ fe->odd_i_last_eb_blk = cpu_to_le64(new_last_eb_blk);
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
- eb->bryce_h_next_leaf_blk = cpu_to_le64(new_last_eb_blk);
+ eb->odd_h_next_leaf_blk = cpu_to_le64(new_last_eb_blk);
status = ocfs_journal_dirty(handle, last_eb_bh);
if (status < 0)
@@ -457,12 +457,12 @@
}
/* copy the fe data into the new extent block */
- eb_el->bryce_l_tree_depth = fe_el->bryce_l_tree_depth;
- eb_el->bryce_l_next_free_rec = fe_el->bryce_l_next_free_rec;
- for(i = 0; i < le16_to_cpu(fe_el->bryce_l_next_free_rec); i++) {
- eb_el->l_recs[i].bryce_e_cpos = fe_el->l_recs[i].bryce_e_cpos;
- eb_el->l_recs[i].bryce_e_clusters = fe_el->l_recs[i].bryce_e_clusters;
- eb_el->l_recs[i].bryce_e_blkno = fe_el->l_recs[i].bryce_e_blkno;
+ eb_el->odd_l_tree_depth = fe_el->odd_l_tree_depth;
+ eb_el->odd_l_next_free_rec = fe_el->odd_l_next_free_rec;
+ for(i = 0; i < le16_to_cpu(fe_el->odd_l_next_free_rec); i++) {
+ eb_el->l_recs[i].odd_e_cpos = fe_el->l_recs[i].odd_e_cpos;
+ eb_el->l_recs[i].odd_e_clusters = fe_el->l_recs[i].odd_e_clusters;
+ eb_el->l_recs[i].odd_e_blkno = fe_el->l_recs[i].odd_e_blkno;
}
status = ocfs_journal_dirty(handle, new_eb_bh);
@@ -479,21 +479,21 @@
}
/* update fe now */
- fe_el->bryce_l_tree_depth = cpu_to_le16(le16_to_cpu(fe_el->bryce_l_tree_depth) + 1);
- fe_el->l_recs[0].bryce_e_cpos = cpu_to_le32(0);
- fe_el->l_recs[0].bryce_e_blkno = eb->bryce_h_blkno;
- fe_el->l_recs[0].bryce_e_clusters = fe->bryce_i_clusters;
- for(i = 1; i < le16_to_cpu(fe_el->bryce_l_next_free_rec); i++) {
- fe_el->l_recs[i].bryce_e_cpos = cpu_to_le32(0);
- fe_el->l_recs[i].bryce_e_clusters = cpu_to_le32(0);
- fe_el->l_recs[i].bryce_e_blkno = cpu_to_le64(0);
+ fe_el->odd_l_tree_depth = cpu_to_le16(le16_to_cpu(fe_el->odd_l_tree_depth) + 1);
+ fe_el->l_recs[0].odd_e_cpos = cpu_to_le32(0);
+ fe_el->l_recs[0].odd_e_blkno = eb->odd_h_blkno;
+ fe_el->l_recs[0].odd_e_clusters = fe->odd_i_clusters;
+ for(i = 1; i < le16_to_cpu(fe_el->odd_l_next_free_rec); i++) {
+ fe_el->l_recs[i].odd_e_cpos = cpu_to_le32(0);
+ fe_el->l_recs[i].odd_e_clusters = cpu_to_le32(0);
+ fe_el->l_recs[i].odd_e_blkno = cpu_to_le64(0);
}
- fe_el->bryce_l_next_free_rec = cpu_to_le16(1);
+ fe_el->odd_l_next_free_rec = cpu_to_le16(1);
/* If this is our 1st tree depth shift, then last_eb_blk
* becomes the allocated extent block */
- if (le16_to_cpu(fe_el->bryce_l_tree_depth) == 1)
- fe->bryce_i_last_eb_blk = eb->bryce_h_blkno;
+ if (le16_to_cpu(fe_el->odd_l_tree_depth) == 1)
+ fe->odd_i_last_eb_blk = eb->odd_h_blkno;
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -545,14 +545,14 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
- if (le16_to_cpu(el->bryce_l_tree_depth)) {
+ if (le16_to_cpu(el->odd_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 = le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth);
+ num_bhs = le16_to_cpu(fe->id2.i_list.odd_l_tree_depth);
eb_bhs = kmalloc(sizeof(struct buffer_head *) * num_bhs,
GFP_KERNEL);
if (!eb_bhs) {
@@ -563,9 +563,9 @@
memset(eb_bhs, 0, sizeof(struct buffer_head *) * num_bhs);
i = 0;
- 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);
+ while(le16_to_cpu(el->odd_l_tree_depth)) {
+ OCFS_ASSERT_RO(le16_to_cpu(el->odd_l_next_free_rec));
+ next_blkno = le64_to_cpu(el->l_recs[le16_to_cpu(el->odd_l_next_free_rec)-1].odd_e_blkno);
OCFS_ASSERT(i < num_bhs);
status = ocfs_read_block(osb, next_blkno, &eb_bhs[i],
@@ -589,21 +589,22 @@
/* When we leave this loop, eb_bhs[num_bhs - 1] will
* hold the bottom-most leaf extent block. */
}
- OCFS_ASSERT(!le16_to_cpu(el->bryce_l_tree_depth));
+ OCFS_ASSERT(!le16_to_cpu(el->odd_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(le16_to_cpu(el->bryce_l_next_free_rec));
+ OCFS_ASSERT_RO(le16_to_cpu(el->odd_l_next_free_rec));
-/* el->l_recs[el->bryce_l_next_free_rec - 1].bryce_e_clusters) += new_clusters; */
+/* el->l_recs[el->odd_l_next_free_rec - 1].odd_e_clusters) += new_clusters; */
- temp_i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
- el->l_recs[temp_i].bryce_e_clusters = le32_to_cpu(el->l_recs[temp_i]) + new_clusters;
+#warning FIX ME
+/* temp_i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
+ el->l_recs[temp_i].odd_e_clusters = le32_to_cpu(el->l_recs[temp_i]) + 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;
@@ -612,11 +613,12 @@
/* finally, make our actual change to the
* intermediate extent blocks. */
-/* el->l_recs[el->bryce_l_next_free_rec - 1].bryce_e_clusters += new_clusters; */
+/* el->l_recs[el->odd_l_next_free_rec - 1].odd_e_clusters += new_clusters; */
- temp_i = el->bryce_l_next_free_rec - 1;
+#warning FIX ME
+/* temp_i = el->odd_l_next_free_rec - 1;
el->l_recs[temp_i] = le32_to_cpu(le32_to_cpu(el->l_recs[temp_i]) + new_clusters);
-
+*/
status = ocfs_journal_dirty(handle, eb_bhs[i]);
if (status < 0)
LOG_ERROR_STATUS(status);
@@ -626,31 +628,31 @@
* the loop above */
eb = (ocfs2_extent_block *) eb_bhs[num_bhs - 1]->b_data;
el = &eb->h_list;
- OCFS_ASSERT(!le16_to_cpu(el->bryce_l_tree_depth));
+ OCFS_ASSERT(!le16_to_cpu(el->odd_l_tree_depth));
}
/* yay, we can finally add the actual extent now! */
- 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,
+ i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
+ if (le16_to_cpu(el->odd_l_next_free_rec) && ocfs_extent_contig(inode,
&el->l_recs[i],
start_blk)) {
- 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)) {
+ el->l_recs[i].odd_e_clusters += new_clusters;
+ } else if (le16_to_cpu(el->odd_l_next_free_rec) && !le32_to_cpu(el->l_recs[i].odd_e_clusters)) {
/* having an empty extent at eof is legal. */
- OCFS_ASSERT_RO(le32_to_cpu(el->l_recs[i].bryce_e_cpos) == le32_to_cpu(fe->bryce_i_clusters));
- el->l_recs[i].bryce_e_blkno = cpu_to_le64(start_blk);
- el->l_recs[i].bryce_e_clusters = cpu_to_le32(new_clusters);
+ OCFS_ASSERT_RO(le32_to_cpu(el->l_recs[i].odd_e_cpos) == le32_to_cpu(fe->odd_i_clusters));
+ el->l_recs[i].odd_e_blkno = cpu_to_le64(start_blk);
+ el->l_recs[i].odd_e_clusters = cpu_to_le32(new_clusters);
} else {
/* No contiguous record, or no empty record at eof, so
* we add a new one. */
- 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);
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_next_free_rec) < le16_to_cpu(el->odd_l_count));
+ i = le16_to_cpu(el->odd_l_next_free_rec);
- el->l_recs[i].bryce_e_blkno = cpu_to_le64(start_blk);
- el->l_recs[i].bryce_e_clusters = cpu_to_le32(new_clusters);
- el->l_recs[i].bryce_e_cpos = fe->bryce_i_clusters;
- el->bryce_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->bryce_l_next_free_rec + 1));
+ el->l_recs[i].odd_e_blkno = cpu_to_le64(start_blk);
+ el->l_recs[i].odd_e_clusters = cpu_to_le32(new_clusters);
+ el->l_recs[i].odd_e_cpos = fe->odd_i_clusters;
+ el->odd_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->odd_l_next_free_rec + 1));
}
/*
@@ -661,13 +663,13 @@
new_clusters);
if (status) {
LOG_ERROR_STATUS(status);
- ocfs2_extent_map_drop(inode, le32_to_cpu(fe->bryce_i_clusters));
+ ocfs2_extent_map_drop(inode, le32_to_cpu(fe->odd_i_clusters));
}
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0)
LOG_ERROR_STATUS(status);
- if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)) {
+ if (le16_to_cpu(fe->id2.i_list.odd_l_tree_depth)) {
status = ocfs_journal_dirty(handle, eb_bhs[num_bhs - 1]);
if (status < 0)
LOG_ERROR_STATUS(status);
@@ -725,10 +727,10 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
- 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);
+ while(le16_to_cpu(el->odd_l_tree_depth) > 1) {
+ OCFS_ASSERT_RO(le16_to_cpu(el->odd_l_next_free_rec));
+ i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
+ blkno = le64_to_cpu(el->l_recs[i].odd_e_blkno);
OCFS_ASSERT_RO(blkno);
if (bh) {
@@ -747,7 +749,7 @@
OCFS_ASSERT_RO(IS_VALID_EXTENT_BLOCK(eb));
el = &eb->h_list;
- if (le16_to_cpu(el->bryce_l_next_free_rec) < le16_to_cpu(el->bryce_l_count)) {
+ if (le16_to_cpu(el->odd_l_next_free_rec) < le16_to_cpu(el->odd_l_count)) {
if (lowest_bh)
brelse(lowest_bh);
lowest_bh = bh;
@@ -758,7 +760,7 @@
/* If we didn't find one and the fe doesn't have any room,
* then return '1' */
if (!lowest_bh
- && (le16_to_cpu(fe->id2.i_list.bryce_l_next_free_rec) == le16_to_cpu(fe->id2.i_list.bryce_l_count)))
+ && (le16_to_cpu(fe->id2.i_list.odd_l_next_free_rec) == le16_to_cpu(fe->id2.i_list.odd_l_count)))
status = 1;
*target_bh = lowest_bh;
@@ -788,16 +790,22 @@
LOG_ENTRY();
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("add %u clusters starting at block %lu to inode "
+ "%lu\n",new_clusters, start_blk,
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("add %u clusters starting at block %llu to inode "
"%llu\n",new_clusters, start_blk,
OCFS_I(inode)->ip_blkno);
+#endif
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
- if (le16_to_cpu(el->bryce_l_tree_depth)) {
+ if (le16_to_cpu(el->odd_l_tree_depth)) {
/* jump to end of tree */
- status = ocfs_read_block(osb, le64_to_cpu(fe->bryce_i_last_eb_blk), &last_eb_bh,
+ status = ocfs_read_block(osb, le64_to_cpu(fe->odd_i_last_eb_blk), &last_eb_bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
LOG_EXIT_STATUS(status);
@@ -808,10 +816,10 @@
}
/* Can we allocate without adding/shifting tree bits? */
- 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)
+ i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
+ if (!le16_to_cpu(el->odd_l_next_free_rec)
+ || (le16_to_cpu(el->odd_l_next_free_rec) < le16_to_cpu(el->odd_l_count))
+ || !le32_to_cpu(el->l_recs[i].odd_e_clusters)
|| ocfs_extent_contig(inode, &el->l_recs[i], start_blk))
goto out_add;
@@ -828,11 +836,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(le16_to_cpu(el->bryce_l_next_free_rec) == le16_to_cpu(el->bryce_l_count));
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_next_free_rec) == le16_to_cpu(el->odd_l_count));
OCFS_ASSERT(!bh);
LOG_TRACE_ARGS("ocfs2_allocate_extent: need to shift tree "
"depth (current = %u)\n",
- le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth));
+ le16_to_cpu(fe->id2.i_list.odd_l_tree_depth));
/* ocfs2_shift_tree_depth will return us a buffer with
* the new extent block (so we can pass that to
@@ -845,7 +853,7 @@
}
/* Special case: we have room now if we shifted from
* tree_depth 0 */
- if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth) == 1)
+ if (le16_to_cpu(fe->id2.i_list.odd_l_tree_depth) == 1)
goto out_add;
}
@@ -899,7 +907,7 @@
*new_last_eb = NULL;
/* we have no tree, so of course, no last_eb. */
- if (!le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth))
+ if (!le16_to_cpu(fe->id2.i_list.odd_l_tree_depth))
goto bail;
/* trunc to zero special case - this makes tree_depth = 0
@@ -909,11 +917,11 @@
eb = (ocfs2_extent_block *) old_last_eb->b_data;
el = &(eb->h_list);
- OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_next_free_rec));
/* Make sure that this guy will actually be empty after we
* clear away the data. */
- if (le32_to_cpu(el->l_recs[0].bryce_e_cpos) < new_i_clusters)
+ if (le32_to_cpu(el->l_recs[0].odd_e_cpos) < new_i_clusters)
goto bail;
/* Ok, at this point, we know that last_eb will definitely
@@ -922,9 +930,9 @@
el = &(fe->id2.i_list);
/* go down the tree, */
do {
- 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);
+ for(i = (le16_to_cpu(el->odd_l_next_free_rec) - 1); i >= 0; i--) {
+ if (le32_to_cpu(el->l_recs[i].odd_e_cpos) < new_i_clusters) {
+ block = le64_to_cpu(el->l_recs[i].odd_e_blkno);
break;
}
}
@@ -944,11 +952,15 @@
eb = (ocfs2_extent_block *) bh->b_data;
el = &(eb->h_list);
OCFS_ASSERT(IS_VALID_EXTENT_BLOCK(eb));
- } while (le16_to_cpu(el->bryce_l_tree_depth));
+ } while (le16_to_cpu(el->odd_l_tree_depth));
*new_last_eb = bh;
get_bh(*new_last_eb);
- LOG_TRACE_ARGS("returning block %llu\n", le64_to_cpu(eb->bryce_h_blkno));
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("returning block %lu\n", le64_to_cpu(eb->odd_h_blkno));
+#else
+ LOG_TRACE_ARGS("returning block %llu\n", le64_to_cpu(eb->odd_h_blkno));
+#endif
bail:
if (bh)
brelse(bh);
@@ -980,7 +992,7 @@
status = ocfs_find_new_last_ext_blk(osb,
inode,
fe,
- le32_to_cpu(fe->bryce_i_clusters) - clusters_to_del,
+ le32_to_cpu(fe->odd_i_clusters) - clusters_to_del,
old_last_eb_bh,
&last_eb_bh);
if (status < 0) {
@@ -999,41 +1011,41 @@
el = &(fe->id2.i_list);
spin_lock(&OCFS_I(inode)->ip_lock);
- OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters) - clusters_to_del;
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->odd_i_clusters) - clusters_to_del;
spin_unlock(&OCFS_I(inode)->ip_lock);
- fe->bryce_i_clusters = cpu_to_le32(le32_to_cpu(fe->bryce_i_clusters) - clusters_to_del);
- fe->bryce_i_mtime = cpu_to_le64(OCFS_CURRENT_TIME);
+ fe->odd_i_clusters = cpu_to_le32(le32_to_cpu(fe->odd_i_clusters) - clusters_to_del);
+ fe->odd_i_mtime = cpu_to_le64(OCFS_CURRENT_TIME);
- i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
+ i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
- OCFS_ASSERT(le32_to_cpu(el->l_recs[i].bryce_e_clusters) >= clusters_to_del);
- el->l_recs[i].bryce_e_clusters = cpu_to_le32(le32_to_cpu(el->l_recs[i].bryce_e_clusters) - clusters_to_del);
+ OCFS_ASSERT(le32_to_cpu(el->l_recs[i].odd_e_clusters) >= clusters_to_del);
+ el->l_recs[i].odd_e_clusters = cpu_to_le32(le32_to_cpu(el->l_recs[i].odd_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 (!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 (!le16_to_cpu(el->odd_l_tree_depth))
+ delete_blk = le64_to_cpu(el->l_recs[i].odd_e_blkno) + le32_to_cpu(el->l_recs[i].odd_e_clusters);
else
- next_eb = le64_to_cpu(el->l_recs[i].bryce_e_blkno);
+ next_eb = le64_to_cpu(el->l_recs[i].odd_e_blkno);
- if (!le32_to_cpu(el->l_recs[i].bryce_e_clusters)) {
+ if (!le32_to_cpu(el->l_recs[i].odd_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].bryce_e_cpos = cpu_to_le32(0);
- el->l_recs[i].bryce_e_blkno = cpu_to_le64(0);
- OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
- el->bryce_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->bryce_l_next_free_rec) - 1);
+ el->l_recs[i].odd_e_cpos = cpu_to_le32(0);
+ el->l_recs[i].odd_e_blkno = cpu_to_le64(0);
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_next_free_rec));
+ el->odd_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->odd_l_next_free_rec) - 1);
}
- depth = le16_to_cpu(el->bryce_l_tree_depth);
- if (!le32_to_cpu(fe->bryce_i_clusters)) {
+ depth = le16_to_cpu(el->odd_l_tree_depth);
+ if (!le32_to_cpu(fe->odd_i_clusters)) {
/* trunc to zero is a special case. */
- el->bryce_l_tree_depth = cpu_to_le16(0);
- fe->bryce_i_last_eb_blk = cpu_to_le64(0);
+ el->odd_l_tree_depth = cpu_to_le16(0);
+ fe->odd_i_last_eb_blk = cpu_to_le64(0);
} else if (last_eb)
- fe->bryce_i_last_eb_blk = last_eb->bryce_h_blkno;
+ fe->odd_i_last_eb_blk = last_eb->odd_h_blkno;
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -1051,7 +1063,7 @@
LOG_ERROR_STATUS(status);
goto bail;
}
- last_eb->bryce_h_next_leaf_blk = cpu_to_le64(0);
+ last_eb->odd_h_next_leaf_blk = cpu_to_le64(0);
status = ocfs_journal_dirty(handle, last_eb_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1061,8 +1073,13 @@
/* if our tree depth > 0, update all the tree blocks below us. */
while(depth) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("traveling tree (depth = %d, next_eb = %lu)\n",
+ depth, next_eb);
+#else
LOG_TRACE_ARGS("traveling tree (depth = %d, next_eb = %llu)\n",
depth, next_eb);
+#endif
status = ocfs_read_block(osb, next_eb, &eb_bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
@@ -1080,55 +1097,75 @@
goto bail;
}
- OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
- OCFS_ASSERT(depth == (le16_to_cpu(el->bryce_l_tree_depth) + 1));
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_next_free_rec));
+ OCFS_ASSERT(depth == (le16_to_cpu(el->odd_l_tree_depth) + 1));
- i = le16_to_cpu(el->bryce_l_next_free_rec) - 1;
+ i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("extent block %lu, before: record %d: "
+ "(%u, %u, %lu), next = %u\n",
+ le64_to_cpu(eb->odd_h_blkno),
+ i,
+ le32_to_cpu(el->l_recs[i].odd_e_cpos),
+ le32_to_cpu(el->l_recs[i].odd_e_clusters),
+ le64_to_cpu(el->l_recs[i].odd_e_blkno),
+ le16_to_cpu(el->odd_l_next_free_rec));
+#else
LOG_TRACE_ARGS("extent block %llu, before: record %d: "
"(%u, %u, %llu), next = %u\n",
- le64_to_cpu(eb->bryce_h_blkno),
+ le64_to_cpu(eb->odd_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));
+ le32_to_cpu(el->l_recs[i].odd_e_cpos),
+ le32_to_cpu(el->l_recs[i].odd_e_clusters),
+ le64_to_cpu(el->l_recs[i].odd_e_blkno),
+ le16_to_cpu(el->odd_l_next_free_rec));
+#endif
+ OCFS_ASSERT(le32_to_cpu(el->l_recs[i].odd_e_clusters) >= clusters_to_del);
+ el->l_recs[i].odd_e_clusters = cpu_to_le32(le32_to_cpu(el->l_recs[i].odd_e_clusters) - clusters_to_del);
- OCFS_ASSERT(le32_to_cpu(el->l_recs[i].bryce_e_clusters) >= clusters_to_del);
- el->l_recs[i].bryce_e_clusters = cpu_to_le32(le32_to_cpu(el->l_recs[i].bryce_e_clusters) - clusters_to_del);
-
- next_eb = le64_to_cpu(el->l_recs[i].bryce_e_blkno);
+ next_eb = le64_to_cpu(el->l_recs[i].odd_e_blkno);
/* bottom-most block requires us to delete data.*/
- 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)) {
- el->l_recs[i].bryce_e_cpos = cpu_to_le32(0);
- el->l_recs[i].bryce_e_blkno = cpu_to_le64(0);
- OCFS_ASSERT(le16_to_cpu(el->bryce_l_next_free_rec));
- el->bryce_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->bryce_l_next_free_rec) - 1);
+ if (!le16_to_cpu(el->odd_l_tree_depth))
+ delete_blk = le64_to_cpu(el->l_recs[i].odd_e_blkno) +
+ le32_to_cpu(el->l_recs[i].odd_e_clusters);
+ if (!le32_to_cpu(el->l_recs[i].odd_e_clusters)) {
+ el->l_recs[i].odd_e_cpos = cpu_to_le32(0);
+ el->l_recs[i].odd_e_blkno = cpu_to_le64(0);
+ OCFS_ASSERT(le16_to_cpu(el->odd_l_next_free_rec));
+ el->odd_l_next_free_rec = cpu_to_le16(le16_to_cpu(el->odd_l_next_free_rec) - 1);
}
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("extent block %lu, after: record %d: "
+ "(%u, %u, %lu), next = %u\n",
+ le64_to_cpu(eb->odd_h_blkno),
+ i,
+ le32_to_cpu(el->l_recs[i].odd_e_cpos),
+ le32_to_cpu(el->l_recs[i].odd_e_clusters),
+ le64_to_cpu(el->l_recs[i].odd_e_blkno),
+ le16_to_cpu(el->odd_l_next_free_rec));
+#else
LOG_TRACE_ARGS("extent block %llu, after: record %d: "
"(%u, %u, %llu), next = %u\n",
- le64_to_cpu(eb->bryce_h_blkno),
+ le64_to_cpu(eb->odd_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));
-
+ le32_to_cpu(el->l_recs[i].odd_e_cpos),
+ le32_to_cpu(el->l_recs[i].odd_e_clusters),
+ le64_to_cpu(el->l_recs[i].odd_e_blkno),
+ le16_to_cpu(el->odd_l_next_free_rec));
+#endif
status = ocfs_journal_dirty(handle, eb_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
goto bail;
}
- if (!le16_to_cpu(el->bryce_l_next_free_rec)) {
+ if (!le16_to_cpu(el->odd_l_next_free_rec)) {
LOG_TRACE_ARGS("deleting this extent block.\n");
- 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));
+ OCFS_ASSERT(!le16_to_cpu(eb->odd_h_suballoc_node));
+ OCFS_ASSERT(!le32_to_cpu(el->l_recs[0].odd_e_clusters));
+ OCFS_ASSERT(!le32_to_cpu(el->l_recs[0].odd_e_cpos));
+ OCFS_ASSERT(!le64_to_cpu(el->l_recs[0].odd_e_blkno));
status = ocfs2_free_extent_block(handle,
tc->tc_ext_alloc_inode,
tc->tc_ext_alloc_bh,
@@ -1154,7 +1191,7 @@
status = 0;
bail:
if (!status)
- ocfs2_extent_map_trunc(inode, le32_to_cpu(fe->bryce_i_clusters));
+ ocfs2_extent_map_trunc(inode, le32_to_cpu(fe->odd_i_clusters));
else
ocfs2_extent_map_drop(inode, 0);
LOG_EXIT_STATUS(status);
@@ -1196,23 +1233,31 @@
inode->i_size);
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)) {
+ if (le16_to_cpu(fe->id2.i_list.odd_l_tree_depth)) {
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
el = &(eb->h_list);
} else
el = &(fe->id2.i_list);
- last_eb = le64_to_cpu(fe->bryce_i_last_eb_blk);
+ last_eb = le64_to_cpu(fe->odd_i_last_eb_blk);
start:
+#ifdef HAVE_64BIT_LONG
LOG_TRACE_ARGS("ocfs_commit_truncate: fe->i_clusters = %u, "
+ "last_eb = %lu, fe->i_last_eb_blk = %lu, "
+ "fe->id2.i_list.l_tree_depth = %u last_eb_bh = %p\n",
+ le32_to_cpu(fe->odd_i_clusters), last_eb, le64_to_cpu(fe->odd_i_last_eb_blk),
+ le16_to_cpu(fe->id2.i_list.odd_l_tree_depth), last_eb_bh);
+#else
+ 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",
- 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);
+ le32_to_cpu(fe->odd_i_clusters), last_eb, le64_to_cpu(fe->odd_i_last_eb_blk),
+ le16_to_cpu(fe->id2.i_list.odd_l_tree_depth), last_eb_bh);
+#endif
- if (last_eb != le64_to_cpu(fe->bryce_i_last_eb_blk)) {
+ if (last_eb != le64_to_cpu(fe->odd_i_last_eb_blk)) {
LOG_TRACE_ARGS("last_eb changed!\n");
- OCFS_ASSERT(le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth));
- last_eb = le64_to_cpu(fe->bryce_i_last_eb_blk);
+ OCFS_ASSERT(le16_to_cpu(fe->id2.i_list.odd_l_tree_depth));
+ last_eb = le64_to_cpu(fe->odd_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
@@ -1237,12 +1282,12 @@
/* by now, el will point to the extent list on the bottom most
* portion of this tree. */
- 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);
+ i = le16_to_cpu(el->odd_l_next_free_rec) - 1;
+ if (le32_to_cpu(el->l_recs[i].odd_e_cpos) >= target_i_clusters)
+ clusters_to_del = le32_to_cpu(el->l_recs[i].odd_e_clusters);
else
- clusters_to_del = (le32_to_cpu(el->l_recs[i].bryce_e_clusters)
- + le32_to_cpu(el->l_recs[i].bryce_e_cpos))
+ clusters_to_del = (le32_to_cpu(el->l_recs[i].odd_e_clusters)
+ + le32_to_cpu(el->l_recs[i].odd_e_cpos))
- target_i_clusters;
LOG_TRACE_ARGS("clusters_to_del = %u in this pass\n", clusters_to_del);
@@ -1270,8 +1315,8 @@
goto bail;
}
- OCFS_ASSERT(le32_to_cpu(fe->bryce_i_clusters) >= target_i_clusters);
- if (le32_to_cpu(fe->bryce_i_clusters) > target_i_clusters)
+ OCFS_ASSERT(le32_to_cpu(fe->odd_i_clusters) >= target_i_clusters);
+ if (le32_to_cpu(fe->odd_i_clusters) > target_i_clusters)
goto start;
bail:
up_write(&OCFS_I(inode)->ip_alloc_sem);
@@ -1316,11 +1361,15 @@
inode->i_size);
fe = (ocfs2_dinode *) fe_bh->b_data;
+#ifdef HAVE_64BIT_LONG
LOG_TRACE_ARGS("fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
- "%llu\n", le32_to_cpu(fe->bryce_i_clusters), new_i_clusters, le64_to_cpu(fe->bryce_i_size));
+ "%lu\n", le32_to_cpu(fe->odd_i_clusters), new_i_clusters, le64_to_cpu(fe->odd_i_size));
+#else
+ LOG_TRACE_ARGS("fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
+ "%llu\n", le32_to_cpu(fe->odd_i_clusters), new_i_clusters, le64_to_cpu(fe->odd_i_size));
+#endif
+ OCFS_ASSERT(le32_to_cpu(fe->odd_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)) {
status = -ENOMEM;
@@ -1337,11 +1386,11 @@
}
metadata_delete = 0;
- if (le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth)) {
+ if (le16_to_cpu(fe->id2.i_list.odd_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, le64_to_cpu(fe->bryce_i_last_eb_blk),
+ status = ocfs_read_block(osb, le64_to_cpu(fe->odd_i_last_eb_blk),
&last_eb_bh, OCFS_BH_CACHED, inode);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1350,7 +1399,7 @@
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
OCFS_ASSERT(IS_VALID_EXTENT_BLOCK(eb));
el = &(eb->h_list);
- if (le32_to_cpu(el->l_recs[0].bryce_e_cpos) >= new_i_clusters)
+ if (le32_to_cpu(el->l_recs[0].odd_e_cpos) >= new_i_clusters)
metadata_delete = 1;
}
Modified: branches/endian/src/alloc.h
===================================================================
--- branches/endian/src/alloc.h 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/alloc.h 2005-01-20 14:25:37 UTC (rev 1799)
@@ -48,7 +48,7 @@
* new tree_depth==0 extent_block, and one block at the new
* top-of-the tree.
*/
- return(le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth) + 2);
+ return(le16_to_cpu(fe->id2.i_list.odd_l_tree_depth) + 2);
}
typedef struct _ocfs2_truncate_context {
Modified: branches/endian/src/aops.c
===================================================================
--- branches/endian/src/aops.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/aops.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -67,15 +67,19 @@
goto bail;
}
fe = (ocfs2_dinode *) bh->b_data;
-
if (!IS_VALID_FILE_ENTRY(fe)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Invalid fe at blkno %lu",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS("Invalid fe at blkno %llu",
OCFS_I(inode)->ip_blkno);
+#endif
goto bail;
}
if ((u64)iblock >= ocfs2_clusters_to_blocks(inode->i_sb,
- le32_to_cpu(fe->bryce_i_clusters))) {
+ le32_to_cpu(fe->odd_i_clusters))) {
LOG_ERROR_ARGS ("block offset is outside the allocated size: %llu",
(unsigned long long)iblock);
goto bail;
@@ -85,7 +89,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,
- le64_to_cpu(fe->id2.i_list.l_recs[0].bryce_e_blkno) + iblock);
+ le64_to_cpu(fe->id2.i_list.l_recs[0].odd_e_blkno) + iblock);
if (!buffer_cache_bh) {
LOG_ERROR_STR("couldn't getblock for symlink!");
goto bail;
@@ -112,7 +116,7 @@
}
map_bh(bh_result, inode->i_sb,
- le64_to_cpu(fe->id2.i_list.l_recs[0].bryce_e_blkno) + iblock);
+ le64_to_cpu(fe->id2.i_list.l_recs[0].odd_e_blkno) + iblock);
err = 0;
@@ -171,10 +175,17 @@
up_read(&OCFS_I(inode)->ip_node_extend_sem);
if (err) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Error %d from get_blocks(0x%p, %llu, 1, %lu, NULL)\n",
+ err,
+ inode, (unsigned long long)iblock,
+ p_blkno);
+#else
LOG_ERROR_ARGS("Error %d from get_blocks(0x%p, %llu, 1, %llu, NULL)\n",
err,
inode, (unsigned long long)iblock,
p_blkno);
+#endif
goto bail;
}
@@ -184,9 +195,15 @@
if (bh_result->b_blocknr == 0) {
err = -EIO;
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("iblock = %llu p_blkno = %lu blkno=(%lu)\n",
+ (unsigned long long)iblock, p_blkno,
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS ("iblock = %llu p_blkno = %llu blkno=(%llu)\n",
(unsigned long long)iblock, p_blkno,
OCFS_I(inode)->ip_blkno);
+#endif
}
if (vbo < OCFS_I(inode)->ip_mmu_private)
@@ -194,11 +211,19 @@
if (!create)
goto bail;
if (vbo != OCFS_I(inode)->ip_mmu_private) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Uh-oh, vbo = %lu, i_size = %llu, mmu = %lu, "
+ "inode = %lu\n",
+ vbo, inode->i_size,
+ OCFS_I(inode)->ip_mmu_private,
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS("Uh-oh, vbo = %lld, i_size = %llu, mmu = %llu, "
"inode = %llu\n",
vbo, inode->i_size,
OCFS_I(inode)->ip_mmu_private,
OCFS_I(inode)->ip_blkno);
+#endif
BUG();
err = -EIO;
goto bail;
Modified: branches/endian/src/buffer_head_io.c
===================================================================
--- branches/endian/src/buffer_head_io.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/buffer_head_io.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -191,8 +191,13 @@
#ifdef OCFS_DBG_TIMING
my_timing_t begin, end;
#endif
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(block=(%lu), nr=(%d), flags=%d, inode=%p)\n",
+ block, nr, flags, inode);
+#else
LOG_ENTRY_ARGS("(block=(%llu), nr=(%d), flags=%d, inode=%p)\n",
block, nr, flags, inode);
+#endif
#ifdef OCFS_DBG_TIMING
rdtsc (begin.lohi[0], begin.lohi[1]);
#endif
@@ -309,8 +314,13 @@
if (inode)
up(&OCFS_I(inode)->ip_io_sem);
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("block=(%lu), nr=(%d), cached=%s\n", block, nr,
+ (!(flags & OCFS_BH_CACHED) || ignore_cache) ? "no" : "yes");
+#else
LOG_TRACE_ARGS("block=(%llu), nr=(%d), cached=%s\n", block, nr,
(!(flags & OCFS_BH_CACHED) || ignore_cache) ? "no" : "yes");
+#endif
bail:
Modified: branches/endian/src/dcache.c
===================================================================
--- branches/endian/src/dcache.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/dcache.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -74,17 +74,29 @@
/* did we or someone else delete this inode? */
if (INODE_DELETED(inode)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("dentry_revalidate: inode (%lu) deleted, "
+ "returning false\n",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("dentry_revalidate: inode (%llu) deleted, "
"returning false\n",
OCFS_I(inode)->ip_blkno);
+#endif
goto bail;
}
#warning "should we do this for all files?"
if (S_ISDIR(inode->i_mode) && (!inode->i_nlink)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("dentry_revalidate: dir inode (%lu) orphaned, "
+ "returning false\n",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("dentry_revalidate: dir inode (%llu) orphaned, "
"returning false\n",
OCFS_I(inode)->ip_blkno);
+#endif
goto bail;
}
Modified: branches/endian/src/dir.c
===================================================================
--- branches/endian/src/dir.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/dir.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -89,8 +89,11 @@
LOG_SET_CONTEXT(READDIR);
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("dirino=%lu\n", OCFS_I(inode)->ip_blkno);
+#else
LOG_ENTRY_ARGS("dirino=%llu\n", OCFS_I(inode)->ip_blkno);
-
+#endif
stored = 0;
bh = NULL;
@@ -110,9 +113,15 @@
blk = (filp->f_pos) >> sb->s_blocksize_bits;
bh = ocfs_bread (inode, blk, &err, 0);
if (!bh) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("directory #%lu contains a hole at offset %lu\n",
+ OCFS_I(inode)->ip_blkno,
+ (unsigned long)filp->f_pos);
+#else
LOG_ERROR_ARGS ("directory #%llu contains a hole at offset %lu\n",
OCFS_I(inode)->ip_blkno,
(unsigned long)filp->f_pos);
+#endif
filp->f_pos += sb->s_blocksize - offset;
continue;
}
@@ -143,10 +152,10 @@
* least that it is non-zero. A
* failure will be detected in the
* dirent test below. */
- if (le16_to_cpu(de->bryce_rec_len) <
+ if (le16_to_cpu(de->odd_rec_len) <
OCFS2_DIR_REC_LEN(1))
break;
- i += le16_to_cpu(de->bryce_rec_len);
+ i += le16_to_cpu(de->odd_rec_len);
}
offset = i;
filp->f_pos = (filp->f_pos & ~(sb->s_blocksize - 1))
@@ -165,8 +174,8 @@
brelse (bh);
goto bail;
}
- offset += le16_to_cpu(de->bryce_rec_len);
- if (le64_to_cpu(de->bryce_inode)) {
+ offset += le16_to_cpu(de->odd_rec_len);
+ if (le64_to_cpu(de->odd_inode)) {
/* We might block in the next section
* if the data destination is
* currently swapped out. So, use a
@@ -182,7 +191,7 @@
error = filldir(dirent, de->name,
de->name_len,
filp->f_pos,
- ino_from_blkno(sb, le64_to_cpu(de->bryce_inode)),
+ ino_from_blkno(sb, le64_to_cpu(de->odd_inode)),
d_type);
if (error)
break;
@@ -190,7 +199,7 @@
goto revalidate;
stored ++;
}
- filp->f_pos += le16_to_cpu(de->bryce_rec_len);
+ filp->f_pos += le16_to_cpu(de->odd_rec_len);
}
offset = 0;
brelse (bh);
@@ -227,9 +236,13 @@
int tmpstat;
int lock_acq = 0;
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS ("(osb=%p, parent=%lu, name='%*s', blkno=%p, inode=%p)\n",
+ osb, OCFS_I(inode)->ip_blkno, namelen, name, blkno, inode);
+#else
LOG_ENTRY_ARGS ("(osb=%p, parent=%llu, name='%*s', blkno=%p, inode=%p)\n",
osb, OCFS_I(inode)->ip_blkno, namelen, name, blkno, inode);
-
+#endif
if (take_lock) {
/* Get a lock on the directory... */
status = ocfs_acquire_lock_ro (osb, inode);
@@ -248,7 +261,7 @@
goto leave;
}
- *blkno = le64_to_cpu((*dirent)->bryce_inode);
+ *blkno = le64_to_cpu((*dirent)->odd_inode);
status = 0;
leave:
@@ -290,33 +303,49 @@
if ((inode->i_size <
(OCFS2_DIR_REC_LEN(1) + OCFS2_DIR_REC_LEN(2))) ||
!(bh = ocfs_bread (inode, 0, &err, 0))) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("bad directory (dir #%lu) - no data block\n",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS ("bad directory (dir #%llu) - no data block\n",
OCFS_I(inode)->ip_blkno);
+#endif
return 1;
}
de = (struct ocfs2_dir_entry *) bh->b_data;
de1 = (struct ocfs2_dir_entry *)
- ((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) ||
+ ((char *) de + le16_to_cpu(de->odd_rec_len));
+ if ((le64_to_cpu(de->odd_inode) != OCFS_I(inode)->ip_blkno) ||
+ !le64_to_cpu(de1->odd_inode) ||
strcmp (".", de->name) ||
strcmp ("..", de1->name)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("bad directory (dir #%lu) - no `.' or `..'\n",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS ("bad directory (dir #%llu) - no `.' or `..'\n",
OCFS_I(inode)->ip_blkno);
+#endif
brelse (bh);
return 1;
}
- 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));
+ offset = le16_to_cpu(de->odd_rec_len) + le16_to_cpu(de1->odd_rec_len);
+ de = (struct ocfs2_dir_entry *) ((char *) de1 + le16_to_cpu(de1->odd_rec_len));
while (offset < inode->i_size ) {
if (!bh || (void *) de >= (void *) (bh->b_data + sb->s_blocksize)) {
brelse (bh);
bh = ocfs_bread(inode,
offset >> sb->s_blocksize_bits, &err, 0);
if (!bh) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("directory #%lu contains a hole at offset %lu\n",
+ OCFS_I(inode)->ip_blkno, offset);
+#else
LOG_ERROR_ARGS ("directory #%llu contains a hole at offset %lu\n",
OCFS_I(inode)->ip_blkno, offset);
+
+#endif
offset += sb->s_blocksize;
continue;
}
@@ -326,13 +355,13 @@
brelse (bh);
return 1;
}
- if (le64_to_cpu(de->bryce_inode)) {
+ if (le64_to_cpu(de->odd_inode)) {
brelse (bh);
return 0;
}
- offset += le16_to_cpu(de->bryce_rec_len);
+ offset += le16_to_cpu(de->odd_rec_len);
de = (struct ocfs2_dir_entry *)
- ((char *) de + le16_to_cpu(de->bryce_rec_len));
+ ((char *) de + le16_to_cpu(de->odd_rec_len));
}
brelse (bh);
return 1;
@@ -403,9 +432,13 @@
LOG_ENTRY();
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("extending dir %lu (i_size = %llu)\n",
+ OCFS_I(dir)->ip_blkno, dir->i_size);
+#else
LOG_TRACE_ARGS("extending dir %llu (i_size = %llu)\n",
OCFS_I(dir)->ip_blkno, dir->i_size);
-
+#endif
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
LOG_ERROR_STATUS (status = -ENOMEM);
@@ -467,8 +500,8 @@
}
memset(new_bh->b_data, 0, sb->s_blocksize);
de = (struct ocfs2_dir_entry *) new_bh->b_data;
- 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);
+ de->odd_inode = le64_to_cpu(0); /* 0 shouldn't need conversion but just to be on the safe side */
+ de->odd_rec_len = le16_to_cpu(sb->s_blocksize);
status = ocfs_journal_dirty(handle, new_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -522,12 +555,16 @@
LOG_ENTRY();
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("getting ready to insert namelen %d into dir %lu\n",
+ namelen, OCFS_I(dir)->ip_blkno);
+#else
LOG_TRACE_ARGS("getting ready to insert namelen %d into dir %llu\n",
namelen, OCFS_I(dir)->ip_blkno);
-
+#endif
OCFS_ASSERT(S_ISDIR(dir->i_mode));
fe = (ocfs2_dinode *) parent_fe_bh->b_data;
- OCFS_ASSERT(le64_to_cpu(fe->bryce_i_size) == dir->i_size);
+ OCFS_ASSERT(le64_to_cpu(fe->odd_i_size) == dir->i_size);
sb = dir->i_sb;
@@ -584,9 +621,9 @@
status = -EEXIST;
goto bail;
}
- if (((le64_to_cpu(de->bryce_inode) == 0) &&
- (le16_to_cpu(de->bryce_rec_len) >= rec_len)) ||
- (le16_to_cpu(de->bryce_rec_len) >=
+ if (((le64_to_cpu(de->odd_inode) == 0) &&
+ (le16_to_cpu(de->odd_rec_len) >= rec_len)) ||
+ (le16_to_cpu(de->odd_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 +632,8 @@
status = 0;
goto bail;
}
- offset += le16_to_cpu(de->bryce_rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->bryce_rec_len));
+ offset += le16_to_cpu(de->odd_rec_len);
+ de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->odd_rec_len));
}
status = 0;
Modified: branches/endian/src/extent_map.c
===================================================================
--- branches/endian/src/extent_map.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/extent_map.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -120,11 +120,11 @@
parent = *p;
ent = rb_entry(parent, struct ocfs2_extent_map_entry,
e_node);
- if ((cpos + clusters) <= le32_to_cpu(ent->e_rec.bryce_e_cpos)) {
+ if ((cpos + clusters) <= le32_to_cpu(ent->e_rec.odd_e_cpos)) {
p = &(*p)->rb_left;
ent = NULL;
- } else if (cpos >= (le32_to_cpu(ent->e_rec.bryce_e_cpos) +
- le32_to_cpu(ent->e_rec.bryce_e_clusters))) {
+ } else if (cpos >= (le32_to_cpu(ent->e_rec.odd_e_cpos) +
+ le32_to_cpu(ent->e_rec.odd_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 (le16_to_cpu(el->bryce_l_tree_depth))
+ while (le16_to_cpu(el->odd_l_tree_depth))
{
blkno = 0;
- for (i = 0; i < le16_to_cpu(el->bryce_l_next_free_rec); i++) {
+ for (i = 0; i < le16_to_cpu(el->odd_l_next_free_rec); i++) {
rec = &el->l_recs[i];
ret = -EBADR;
- if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) >
+ if ((le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)) >
OCFS_I(inode)->ip_clusters)
goto out_free;
- if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) <= cpos) {
+ if ((le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)) <= cpos) {
ret = ocfs2_extent_map_insert(inode,
rec,
- le16_to_cpu(el->bryce_l_tree_depth));
+ le16_to_cpu(el->odd_l_tree_depth));
if (ret && (ret != -EEXIST))
goto out_free;
continue;
}
- if ((cpos + clusters) <= le32_to_cpu(rec->bryce_e_cpos)) {
+ if ((cpos + clusters) <= le32_to_cpu(rec->odd_e_cpos)) {
ret = ocfs2_extent_map_insert(inode,
rec,
- le16_to_cpu(el->bryce_l_tree_depth));
+ le16_to_cpu(el->odd_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 ((le32_to_cpu(rec->bryce_e_cpos) > cpos) ||
+ if ((le32_to_cpu(rec->odd_e_cpos) > cpos) ||
((cpos + clusters) >
- (le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters))))
+ (le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters))))
goto out_free;
/*
@@ -212,7 +212,7 @@
if (blkno)
goto out_free;
- blkno = le64_to_cpu(rec->bryce_e_blkno);
+ blkno = le64_to_cpu(rec->odd_e_blkno);
}
/*
@@ -237,13 +237,13 @@
el = &eb->h_list;
}
- if (le16_to_cpu(el->bryce_l_tree_depth))
+ if (le16_to_cpu(el->odd_l_tree_depth))
BUG();
- for (i = 0; i < le16_to_cpu(el->bryce_l_next_free_rec); i++) {
+ for (i = 0; i < le16_to_cpu(el->odd_l_next_free_rec); i++) {
rec = &el->l_recs[i];
ret = ocfs2_extent_map_insert(inode, rec,
- le16_to_cpu(el->bryce_l_tree_depth));
+ le16_to_cpu(el->odd_l_tree_depth));
if (ret)
goto out_free;
}
@@ -283,7 +283,7 @@
*ret_ent = ent;
return 0;
}
- blkno = le64_to_cpu(ent->e_rec.bryce_e_blkno);
+ blkno = le64_to_cpu(ent->e_rec.odd_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, le32_to_cpu(ent->e_rec.bryce_e_cpos),
- le32_to_cpu(ent->e_rec.bryce_e_clusters),
+ old_ent = ocfs2_extent_map_lookup(em, le32_to_cpu(ent->e_rec.odd_e_cpos),
+ le32_to_cpu(ent->e_rec.odd_e_clusters),
&p, &parent);
if (old_ent)
return -EEXIST;
@@ -376,8 +376,8 @@
goto out_unlock;
}
- old_ent = ocfs2_extent_map_lookup(em, le32_to_cpu(rec->bryce_e_cpos),
- le32_to_cpu(rec->bryce_e_clusters),
+ old_ent = ocfs2_extent_map_lookup(em, le32_to_cpu(rec->odd_e_cpos),
+ le32_to_cpu(rec->odd_e_clusters),
NULL, NULL);
if (!old_ent)
@@ -406,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 = !!(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)));
+ ctxt->need_left = !!(le32_to_cpu(rec->odd_e_cpos) > le32_to_cpu(old_ent->e_rec.odd_e_cpos));
+ ctxt->need_right = !!((le32_to_cpu(old_ent->e_rec.odd_e_cpos) +
+ le32_to_cpu(old_ent->e_rec.odd_e_clusters)) >
+ (le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)));
ret = -EAGAIN;
if (ctxt->need_left) {
if (!ctxt->left_ent)
goto out_unlock;
*(ctxt->left_ent) = *old_ent;
- 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);
+ ctxt->left_ent->e_rec.odd_e_clusters = cpu_to_le32(
+ le32_to_cpu(rec->odd_e_cpos) - le32_to_cpu(ctxt->left_ent->e_rec.odd_e_cpos));
}
if (ctxt->need_right) {
if (!ctxt->right_ent)
goto out_unlock;
*(ctxt->right_ent) = *old_ent;
- 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);
+ ctxt->right_ent->e_rec.odd_e_cpos = cpu_to_le32(
+ le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters));
+ ctxt->right_ent->e_rec.odd_e_clusters = cpu_to_le32(
+ (le32_to_cpu(old_ent->e_rec.odd_e_cpos) +
+ le32_to_cpu(old_ent->e_rec.odd_e_clusters)) -
+ le32_to_cpu(ctxt->right_ent->e_rec.odd_e_cpos));
}
rb_erase(&old_ent->e_node, &em->em_extents);
@@ -468,13 +468,13 @@
int ret;
struct ocfs2_em_insert_context ctxt = {0, };
- if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) >
+ if ((le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)) >
OCFS_I(inode)->ip_map.em_clusters)
return -EBADR;
/* Zero e_clusters means a truncated tail record. It better be EOF */
- if (!le32_to_cpu(rec->bryce_e_clusters)) {
- if ((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) !=
+ if (!le32_to_cpu(rec->odd_e_clusters)) {
+ if ((le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)) !=
OCFS_I(inode)->ip_map.em_clusters)
return -EBADR;
@@ -554,7 +554,7 @@
ocfs2_extent_rec *old;
OCFS_ASSERT(new_clusters);
- OCFS_ASSERT(le32_to_cpu(rec->bryce_e_clusters) >= new_clusters);
+ OCFS_ASSERT(le32_to_cpu(rec->odd_e_clusters) >= new_clusters);
if (em->em_clusters < OCFS_I(inode)->ip_clusters) {
/*
@@ -566,32 +566,32 @@
em->em_clusters = OCFS_I(inode)->ip_clusters;
}
- OCFS_ASSERT((le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters)) ==
+ OCFS_ASSERT((le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)) ==
(em->em_clusters + new_clusters));
em->em_clusters += new_clusters;
ret = -ENOENT;
- if (le32_to_cpu(rec->bryce_e_clusters) > new_clusters) {
+ if (le32_to_cpu(rec->odd_e_clusters) > new_clusters) {
/* This is a contiguous append */
- ent = ocfs2_extent_map_lookup(em, le32_to_cpu(rec->bryce_e_cpos), 1,
+ ent = ocfs2_extent_map_lookup(em, le32_to_cpu(rec->odd_e_cpos), 1,
NULL, NULL);
if (ent) {
old = &ent->e_rec;
- 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) +
+ OCFS_ASSERT((le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters)) ==
+ (le32_to_cpu(old->odd_e_cpos) + le32_to_cpu(old->odd_e_clusters) +
new_clusters));
if (!ent->e_tree_depth) {
- 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));
+ OCFS_ASSERT(le32_to_cpu(old->odd_e_cpos) == le32_to_cpu(rec->odd_e_cpos));
+ OCFS_ASSERT(le64_to_cpu(old->odd_e_blkno) ==
+ le64_to_cpu(rec->odd_e_blkno));
ret = 0;
}
/*
* Let non-leafs fall through as -ENOENT to
* force insertion of the new leaf.
*/
- cpu_to_le32(old->bryce_e_clusters) += new_clusters;
+ old->odd_e_clusters = cpu_to_le32(le32_to_cpu(old->odd_e_clusters) + new_clusters);
}
}
@@ -684,18 +684,18 @@
if (ent) {
/* We should never find ourselves straddling an interval */
- if ((le32_to_cpu(ent->e_rec.bryce_e_cpos) > v_cpos) ||
+ if ((le32_to_cpu(ent->e_rec.odd_e_cpos) > v_cpos) ||
((v_cpos + count) >
- (le32_to_cpu(ent->e_rec.bryce_e_cpos) + le32_to_cpu(ent->e_rec.bryce_e_clusters))))
+ (le32_to_cpu(ent->e_rec.odd_e_cpos) + le32_to_cpu(ent->e_rec.odd_e_clusters))))
return -ESRCH;
- coff = v_cpos - le32_to_cpu(ent->e_rec.bryce_e_cpos);
+ coff = v_cpos - le32_to_cpu(ent->e_rec.odd_e_cpos);
*p_cpos = ocfs2_blocks_to_clusters(inode->i_sb,
- le64_to_cpu(ent->e_rec.bryce_e_blkno)) +
+ le64_to_cpu(ent->e_rec.odd_e_blkno)) +
coff;
if (ret_count)
- *ret_count = le32_to_cpu(ent->e_rec.bryce_e_clusters) - coff;
+ *ret_count = le32_to_cpu(ent->e_rec.odd_e_clusters) - coff;
return 0;
}
@@ -743,19 +743,19 @@
rec = &ent->e_rec;
/* We should never find ourselves straddling an interval */
- if ((le32_to_cpu(rec->bryce_e_cpos) > cpos) ||
+ if ((le32_to_cpu(rec->odd_e_cpos) > cpos) ||
((cpos + clusters) >
- (le32_to_cpu(rec->bryce_e_cpos) + le32_to_cpu(rec->bryce_e_clusters))))
+ (le32_to_cpu(rec->odd_e_cpos) + le32_to_cpu(rec->odd_e_clusters))))
return -ESRCH;
boff = ocfs2_clusters_to_blocks(inode->i_sb,
- cpos - le32_to_cpu(rec->bryce_e_cpos));
+ cpos - le32_to_cpu(rec->odd_e_cpos));
boff += (v_blkno & (u64)(bpc - 1));
- *p_blkno = le64_to_cpu(rec->bryce_e_blkno) + boff;
+ *p_blkno = le64_to_cpu(rec->odd_e_blkno) + boff;
if (ret_count) {
*ret_count = ocfs2_clusters_to_blocks(inode->i_sb,
- le32_to_cpu(rec->bryce_e_clusters)) - boff;
+ le32_to_cpu(rec->odd_e_clusters)) - boff;
}
return 0;
@@ -836,7 +836,7 @@
ent = rb_entry(node, struct ocfs2_extent_map_entry,
e_node);
- if (le32_to_cpu(ent->e_rec.bryce_e_cpos) < new_clusters)
+ if (le32_to_cpu(ent->e_rec.odd_e_cpos) < new_clusters)
break;
rb_erase(&ent->e_node, &em->em_extents);
@@ -851,7 +851,7 @@
/* Do we have an entry straddling new_clusters? */
if (tail_ent) {
if (ent &&
- ((le32_to_cpu(ent->e_rec.bryce_e_cpos) + le32_to_cpu(ent->e_rec.bryce_e_clusters)) >
+ ((le32_to_cpu(ent->e_rec.odd_e_cpos) + le32_to_cpu(ent->e_rec.odd_e_clusters)) >
new_clusters))
*tail_ent = ent;
else
@@ -924,8 +924,8 @@
__ocfs2_extent_map_drop(inode, new_clusters, &free_head, &ent);
if (ent)
- cpu_to_le32(ent->e_rec.bryce_e_clusters) =
- new_clusters - le32_to_cpu(ent->e_rec.bryce_e_cpos);
+ ent->e_rec.odd_e_clusters = cpu_to_le32(
+ new_clusters - le32_to_cpu(ent->e_rec.odd_e_cpos));
OCFS_I(inode)->ip_map.em_clusters = new_clusters;
Modified: branches/endian/src/file.c
===================================================================
--- branches/endian/src/file.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/file.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -66,19 +66,19 @@
static void ocfs_fe_set_attributes(ocfs2_dinode *fe, struct iattr *attr)
{
if (attr->ia_valid & ATTR_SIZE)
- cpu_to_le64(fe->bryce_i_size) = attr->ia_size;
+ fe->odd_i_size = cpu_to_le64(attr->ia_size);
if (attr->ia_valid & ATTR_UID)
- cpu_to_le32(fe->bryce_i_uid) = attr->ia_uid;
+ fe->odd_i_uid = cpu_to_le32(attr->ia_uid);
if (attr->ia_valid & ATTR_GID)
- cpu_to_le32(fe->bryce_i_gid) = attr->ia_gid;
+ fe->odd_i_gid = cpu_to_le32(attr->ia_gid);
if (attr->ia_valid & ATTR_MODE)
- cpu_to_le16(fe->bryce_i_mode) = attr->ia_mode;
+ fe->odd_i_mode = cpu_to_le16(attr->ia_mode);
if (attr->ia_valid & ATTR_CTIME)
- cpu_to_le64(fe->bryce_i_ctime) = ocfs_get_seconds(attr->ia_ctime);
+ fe->odd_i_ctime = cpu_to_le64(ocfs_get_seconds(attr->ia_ctime));
if (attr->ia_valid & ATTR_ATIME)
- cpu_to_le64(fe->bryce_i_atime) = ocfs_get_seconds(attr->ia_atime);
+ fe->odd_i_atime = cpu_to_le64(ocfs_get_seconds(attr->ia_atime));
if (attr->ia_valid & ATTR_MTIME)
- cpu_to_le64(fe->bryce_i_mtime) = ocfs_get_seconds(attr->ia_mtime);
+ fe->odd_i_mtime = cpu_to_le64(ocfs_get_seconds(attr->ia_mtime));
}
int ocfs_sync_inode(struct inode *inode)
@@ -357,7 +357,7 @@
fe = (ocfs2_dinode *) bh->b_data;
- cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
+ fe->odd_i_mtime = cpu_to_le64(OCFS_CURRENT_TIME);
ocfs_fe_set_attributes(fe, attr);
@@ -512,25 +512,45 @@
if (filp->f_flags & O_APPEND)
newsize = count + inode->i_size;
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS ("ppos=%llu newsize=%lu cursize=%llu\n",
+ *ppos, newsize, inode->i_size);
+#else
LOG_TRACE_ARGS ("ppos=%llu newsize=%llu cursize=%llu\n",
*ppos, newsize, inode->i_size);
+#endif
if (newsize > inode->i_size) {
writingAtEOF = 1;
+#ifdef HAVE_64BIT_LONG
LOG_TRACE_ARGS
+ ("Writing at EOF, will need more allocation: have=%lu, "
+ "need=%lu\n",
+ ocfs2_clusters_to_bytes(inode->i_sb,
+ OCFS_I(inode)->ip_clusters),
+ newsize);
+#else
+ LOG_TRACE_ARGS
("Writing at EOF, will need more allocation: have=%llu, "
"need=%llu\n",
ocfs2_clusters_to_bytes(inode->i_sb,
OCFS_I(inode)->ip_clusters),
newsize);
+#endif
status = ocfs_extend_file(osb, inode, newsize);
if (status < 0) {
if (status != -EINTR && status != -ENOSPC) {
LOG_ERROR_STATUS (status);
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS ("Failed to extend file from "
+ "%llu to %lu",
+ *ppos, newsize);
+#else
+ LOG_ERROR_ARGS ("Failed to extend file from "
"%llu to %llu",
*ppos, newsize);
+#endif
ret = -ENOSPC;
} else
ret = status;
@@ -794,9 +814,13 @@
ocfs_journal_handle *handle = NULL;
ocfs2_truncate_context *tc = NULL;
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(inode = %lu, new_i_size = %lu\n",
+ OCFS_I(inode)->ip_blkno, new_i_size);
+#else
LOG_ENTRY_ARGS("(inode = %llu, new_i_size = %llu\n",
OCFS_I(inode)->ip_blkno, new_i_size);
-
+#endif
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
LOG_ERROR_STATUS (status = -ENOMEM);
@@ -816,29 +840,39 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT(le64_to_cpu(fe->bryce_i_size) == inode->i_size);
+ OCFS_ASSERT(le64_to_cpu(fe->odd_i_size) == inode->i_size);
- if (new_i_size > le64_to_cpu(fe->bryce_i_size)) {
+ if (new_i_size > le64_to_cpu(fe->odd_i_size)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("asked to truncate file with size (%lu) "
+ "to size (%lu)!\n", le64_to_cpu(fe->odd_i_size),
+ new_i_size);
+#else
LOG_TRACE_ARGS("asked to truncate file with size (%llu) "
- "to size (%llu)!\n", le64_to_cpu(fe->bryce_i_size),
+ "to size (%llu)!\n", le64_to_cpu(fe->odd_i_size),
new_i_size);
+#endif
status = -EINVAL;
LOG_ERROR_STATUS(status);
goto bail;
}
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("inode %lu, i_size = %lu, new_i_size = %lu\n",
+ le64_to_cpu(fe->odd_i_blkno), le64_to_cpu(fe->odd_i_size), new_i_size);
+#else
LOG_TRACE_ARGS("inode %llu, i_size = %llu, new_i_size = %llu\n",
- le64_to_cpu(fe->bryce_i_blkno), le64_to_cpu(fe->bryce_i_size), new_i_size);
-
+ le64_to_cpu(fe->odd_i_blkno), le64_to_cpu(fe->odd_i_size), new_i_size);
+#endif
/* lets handle the simple truncate cases before doing any more
* cluster locking. */
- if (new_i_size == le64_to_cpu(fe->bryce_i_size))
+ if (new_i_size == le64_to_cpu(fe->odd_i_size))
goto bail;
- if (le32_to_cpu(fe->bryce_i_clusters) == ocfs2_clusters_for_bytes(osb->sb,
+ if (le32_to_cpu(fe->odd_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", le32_to_cpu(fe->bryce_i_clusters));
+ "truncate\n", le32_to_cpu(fe->odd_i_clusters));
/* No allocation change is required, so lets fast path
* this truncate. */
handle = ocfs_start_trans(osb, handle,
@@ -1001,8 +1035,13 @@
}
block = ocfs2_clusters_to_blocks(osb->sb, bit_off);
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("Allocating %u clusters at block %u for inode %lu\n",
+ num_bits, bit_off, OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("Allocating %u clusters at block %u for inode %llu\n",
num_bits, bit_off, OCFS_I(inode)->ip_blkno);
+#endif
status = ocfs2_insert_extent(osb, handle, inode, fe_bh, block,
num_bits, meta_ac);
if (status < 0) {
@@ -1010,9 +1049,10 @@
goto leave;
}
- cpu_to_le32(fe->bryce_i_clusters) += num_bits;
+ fe->odd_i_clusters = cpu_to_le32(le32_to_cpu(fe->odd_i_clusters) + num_bits);
+
spin_lock(&OCFS_I(inode)->ip_lock);
- OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->odd_i_clusters);
spin_unlock(&OCFS_I(inode)->ip_lock);
status = ocfs_journal_dirty(handle, fe_bh);
@@ -1025,7 +1065,7 @@
if (clusters_to_add) {
LOG_TRACE_ARGS("need to alloc once more, clusters = %u, "
- "wanted = %u\n", le32_to_cpu(fe->bryce_i_clusters),
+ "wanted = %u\n", le32_to_cpu(fe->odd_i_clusters),
clusters_to_add);
status = -EAGAIN;
if (reason)
@@ -1072,8 +1112,11 @@
ocfs2_alloc_context *meta_ac = NULL;
enum ocfs2_alloc_restarted why;
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(new_i_size=%lu)\n", new_i_size);
+#else
LOG_ENTRY_ARGS("(new_i_size=%llu)\n", new_i_size);
-
+#endif
/* setattr sometimes calls us like this. */
if (new_i_size == 0)
goto leave;
@@ -1099,20 +1142,27 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT(new_i_size >= le64_to_cpu(fe->bryce_i_size));
+ OCFS_ASSERT(new_i_size >= le64_to_cpu(fe->odd_i_size));
- if (le64_to_cpu(fe->bryce_i_size) == new_i_size) {
+ if (le64_to_cpu(fe->odd_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)
- - le32_to_cpu(fe->bryce_i_clusters);
+ - le32_to_cpu(fe->odd_i_clusters);
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("extend inode %lu, new_i_size = %lu, i_size = %llu, "
+ "fe->i_clusters = %u, clusters_to_add = %u\n",
+ OCFS_I(inode)->ip_blkno, new_i_size, inode->i_size,
+ le32_to_cpu(fe->odd_i_clusters), clusters_to_add);
+#else
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,
- le32_to_cpu(fe->bryce_i_clusters), clusters_to_add);
+ le32_to_cpu(fe->odd_i_clusters), clusters_to_add);
+#endif
if (!clusters_to_add)
goto do_start_trans;
@@ -1200,7 +1250,7 @@
if (status == -EAGAIN
&& (new_i_size >
- ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->bryce_i_clusters)))) {
+ ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->odd_i_clusters)))) {
if (why == RESTART_META) {
LOG_TRACE_ARGS("restarting function.\n");
@@ -1210,10 +1260,10 @@
/* update i_size in case we crash after the
* extend_trans */
- cpu_to_le64(fe->bryce_i_size) =
+ fe->odd_i_size = cpu_to_le64(
ocfs2_clusters_to_bytes(osb->sb,
- le32_to_cpu(fe->bryce_i_clusters));
- cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
+ le32_to_cpu(fe->odd_i_clusters)));
+ fe->odd_i_mtime = cpu_to_le64(OCFS_CURRENT_TIME);
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -1224,7 +1274,7 @@
clusters_to_add =
ocfs2_clusters_for_bytes(osb->sb,
new_i_size)
- - le32_to_cpu(fe->bryce_i_clusters) + overalloc_bits;
+ - le32_to_cpu(fe->odd_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 +1295,26 @@
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, 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));
+ if (new_i_size > ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->odd_i_clusters)))
+ fe->odd_i_size = cpu_to_le64(ocfs2_clusters_to_bytes(osb->sb, le32_to_cpu(fe->odd_i_clusters)));
else
- cpu_to_le64(fe->bryce_i_size) = new_i_size;
+ fe->odd_i_size = cpu_to_le64(new_i_size);
#warning "is there a reason why we don't update i_blocks here?"
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("fe: i_clusters = %u, i_size=%lu\n",
+ le32_to_cpu(fe->odd_i_clusters), le64_to_cpu(fe->odd_i_size));
+
+ LOG_TRACE_ARGS("inode: ip_clusters=%u, i_size=%llu\n",
+ OCFS_I(inode)->ip_clusters, inode->i_size);
+#else
LOG_TRACE_ARGS("fe: i_clusters = %u, i_size=%llu\n",
- le32_to_cpu(fe->bryce_i_clusters), le64_to_cpu(fe->bryce_i_size));
+ le32_to_cpu(fe->odd_i_clusters), le64_to_cpu(fe->odd_i_size));
LOG_TRACE_ARGS("inode: ip_clusters=%u, i_size=%llu\n",
OCFS_I(inode)->ip_clusters, inode->i_size);
+#endif
- cpu_to_le64(fe->bryce_i_mtime) = OCFS_CURRENT_TIME;
+ fe->odd_i_mtime = cpu_to_le64(OCFS_CURRENT_TIME);
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
Modified: branches/endian/src/inode.c
===================================================================
--- branches/endian/src/inode.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/inode.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -114,8 +114,11 @@
ocfs_find_inode_args args;
u32 flags = 0;
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(blkno = %lu)\n", blkno);
+#else
LOG_ENTRY_ARGS("(blkno = %llu)\n", blkno);
-
+#endif
/* Ok. By now we've either got the offsets passed to us by the
* caller, or we just pulled them off the bh. Lets do some
* sanity checks to make sure they're OK. */
@@ -156,9 +159,13 @@
bail:
if (inode)
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("returning inode with number %lu\n",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("returning inode with number %llu\n",
OCFS_I(inode)->ip_blkno);
-
+#endif
LOG_EXIT_PTR(inode);
return(inode);
@@ -247,9 +254,15 @@
LOG_ERROR_ARGS("inode %lu has no generic_ip (is_bad_inode = "
"%d)!\n", inode->i_ino, is_bad_inode(inode));
if (args)
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("args-blkno = %lu, args->ino = %lu, "
+ "args->flags = 0x%x\n", args->blkno,
+ args->ino, args->flags);
+#else
LOG_ERROR_ARGS("args-blkno = %llu, args->ino = %lu, "
"args->flags = 0x%x\n", args->blkno,
args->ino, args->flags);
+#endif
BUG();
}
@@ -342,18 +355,28 @@
ocfs_super *osb;
int status = -EINVAL;
- LOG_ENTRY_ARGS ("(0x%p, size:%llu)\n", inode, le64_to_cpu(fe->bryce_i_size));
-
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS ("(0x%p, size:%lu)\n", inode, le64_to_cpu(fe->odd_i_size));
+#else
+ LOG_ENTRY_ARGS ("(0x%p, size:%llu)\n", inode, le64_to_cpu(fe->odd_i_size));
+#endif
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) || !(le32_to_cpu(fe->bryce_i_flags) & OCFS2_VALID_FL)) {
+ if (!IS_VALID_FILE_ENTRY(fe) || !(le32_to_cpu(fe->odd_i_flags) & OCFS2_VALID_FL)) {
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("invalid file entry! i_ino=%lu, "
+ "fe->i_blkno=%lu, valid_flag = %d\n",
+ inode->i_ino, le64_to_cpu(fe->odd_i_blkno),
+ (le32_to_cpu(fe->odd_i_flags) & OCFS2_VALID_FL));
+#else
+ LOG_ERROR_ARGS("invalid file entry! i_ino=%lu, "
"fe->i_blkno=%llu, valid_flag = %d\n",
- inode->i_ino, le64_to_cpu(fe->bryce_i_blkno),
- (le32_to_cpu(fe->bryce_i_flags) & OCFS2_VALID_FL));
+ inode->i_ino, le64_to_cpu(fe->odd_i_blkno),
+ (le32_to_cpu(fe->odd_i_flags) & OCFS2_VALID_FL));
+#endif
goto bail;
}
@@ -365,39 +388,44 @@
}
inode->i_version = 1;
- 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_generation = le32_to_cpu(fe->odd_i_generation);
+ inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.odd_i_rdev));
+ inode->i_mode = le16_to_cpu(fe->odd_i_mode);
+ inode->i_uid = le32_to_cpu(fe->odd_i_uid);
+ inode->i_gid = le32_to_cpu(fe->odd_i_gid);
inode->i_blksize = (u32)osb->s_clustersize; // sb->s_blocksize;
- inode->i_blocks = (le64_to_cpu(fe->bryce_i_size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
+ inode->i_blocks = (le64_to_cpu(fe->odd_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, 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_SET_INODE_TIME(inode, i_atime, le64_to_cpu(fe->odd_i_atime));
+ OCFS_SET_INODE_TIME(inode, i_mtime, le64_to_cpu(fe->odd_i_mtime));
+ OCFS_SET_INODE_TIME(inode, i_ctime, le64_to_cpu(fe->odd_i_ctime));
- OCFS_I(inode)->ip_blkno = le64_to_cpu(fe->bryce_i_blkno);
+ OCFS_I(inode)->ip_blkno = le64_to_cpu(fe->odd_i_blkno);
- OCFS_I(inode)->ip_clusters = le32_to_cpu((fe->bryce_i_clusters));
+ OCFS_I(inode)->ip_clusters = le32_to_cpu((fe->odd_i_clusters));
OCFS_I(inode)->ip_inode = inode;
if (create_ino)
- inode->i_ino = ino_from_blkno(inode->i_sb, le64_to_cpu(fe->bryce_i_blkno));
+ inode->i_ino = ino_from_blkno(inode->i_sb, le64_to_cpu(fe->odd_i_blkno));
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("blkno = %lu, ino = %lu, create_ino = %s\n",
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino,
+ create_ino ? "true" : "false");
+#else
LOG_TRACE_ARGS("blkno = %llu, ino = %lu, create_ino = %s\n",
- le64_to_cpu(fe->bryce_i_blkno), inode->i_ino,
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino,
create_ino ? "true" : "false");
+#endif
+ inode->i_nlink = le16_to_cpu(fe->odd_i_links_count);
- inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
-
- if (le32_to_cpu(fe->bryce_i_flags) & OCFS2_LOCAL_ALLOC_FL) {
+ if (le32_to_cpu(fe->odd_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->bryce_i_flags) & OCFS2_SUPER_BLOCK_FL) {
+ } else if (le32_to_cpu(fe->odd_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 ;-)
@@ -409,20 +437,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 = le64_to_cpu(fe->bryce_i_size);
+ inode->i_size = le64_to_cpu(fe->odd_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 = le64_to_cpu(fe->bryce_i_size);
+ inode->i_size = le64_to_cpu(fe->odd_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 = le64_to_cpu(fe->bryce_i_size);
+ inode->i_size = le64_to_cpu(fe->odd_i_size);
break;
default:
init_special_inode(inode, inode->i_mode,
@@ -477,19 +505,24 @@
goto bail;
}
- 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));
+ sysfile = le32_to_cpu(fe->odd_i_flags) & OCFS2_SYSTEM_FL;
+ if (S_ISCHR(le16_to_cpu(fe->odd_i_mode)) || S_ISBLK(le16_to_cpu(fe->odd_i_mode)))
+ inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.odd_i_rdev));
status = -EINVAL;
if (ocfs_populate_inode (inode, fe, 0) < 0) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("populate inode failed! i_blkno=%lu, i_ino=%lu\n",
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino);
+#else
LOG_ERROR_ARGS("populate inode failed! i_blkno=%llu, i_ino=%lu\n",
- le64_to_cpu(fe->bryce_i_blkno), inode->i_ino);
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino);
+#endif
make_bad_inode (inode);
goto bail;
}
- if (args->blkno != le64_to_cpu(fe->bryce_i_blkno))
+ if (args->blkno != le64_to_cpu(fe->odd_i_blkno))
BUG();
if (sysfile)
@@ -534,7 +567,7 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
/* zero allocation, zero truncate :) */
- if (!le32_to_cpu(fe->bryce_i_clusters))
+ if (!le32_to_cpu(fe->odd_i_clusters))
goto bail;
handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
@@ -639,7 +672,7 @@
}
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (!(le32_to_cpu(fe->bryce_i_flags) & OCFS2_ORPHANED_FL)) {
+ if (!(le32_to_cpu(fe->odd_i_flags) & OCFS2_ORPHANED_FL)) {
/* for lack of a better error? */
status = -EEXIST;
LOG_ERROR_STATUS(status);
@@ -647,13 +680,13 @@
}
/* has someone already deleted us?! baaad... */
- if (le64_to_cpu(fe->bryce_i_dtime)) {
+ if (le64_to_cpu(fe->odd_i_dtime)) {
status = -EEXIST;
LOG_ERROR_STATUS(status);
goto bail;
}
- if (le16_to_cpu(fe->bryce_i_links_count)) {
+ if (le16_to_cpu(fe->odd_i_links_count)) {
status = -EBUSY;
LOG_ERROR_STATUS(status);
goto bail;
@@ -695,7 +728,7 @@
goto bail;
}
- inode_alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, le16_to_cpu(fe->bryce_i_suballoc_node));
+ inode_alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, le16_to_cpu(fe->odd_i_suballoc_node));
if (!inode_alloc_inode) {
status = -EEXIST;
LOG_ERROR_STATUS(status);
@@ -733,8 +766,8 @@
goto bail;
}
- cpu_to_le64(fe->bryce_i_dtime) = OCFS_CURRENT_TIME;
- cpu_to_le32(fe->bryce_i_flags) &= (~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL));
+ fe->odd_i_dtime = cpu_to_le64(OCFS_CURRENT_TIME);
+ fe->odd_i_flags &= cpu_to_le32((~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL)));
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -785,9 +818,13 @@
if (!inode)
goto bail;
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("Clearing inode: %lu, nlink = %u)\n",
+ OCFS_I(inode)->ip_blkno, inode->i_nlink);
+#else
LOG_TRACE_ARGS("Clearing inode: %llu, nlink = %u)\n",
OCFS_I(inode)->ip_blkno, inode->i_nlink);
-
+#endif
/* we should not really be using osb in this context. */
osb = OCFS_SB(inode->i_sb);
@@ -899,8 +936,13 @@
LOG_SET_CONTEXT(REVALIDATE);
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(inode = 0x%p, ino = %lu)\n", inode,
+ inode ? OCFS_I(inode)->ip_blkno : 0ULL);
+#else
LOG_ENTRY_ARGS("(inode = 0x%p, ino = %llu)\n", inode,
inode ? OCFS_I(inode)->ip_blkno : 0ULL);
+#endif
if (!inode) {
LOG_TRACE_STR("eep, no inode!\n");
@@ -963,8 +1005,11 @@
ocfs2_dinode *fe = (ocfs2_dinode *) bh->b_data;
#warning "need to check the casts and the endian-ness in this function"
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(inode %lu)\n", OCFS_I(inode)->ip_blkno);
+#else
LOG_ENTRY_ARGS("(inode %llu)\n", OCFS_I(inode)->ip_blkno);
-
+#endif
status = ocfs_journal_access(handle, inode, bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
@@ -973,17 +1018,17 @@
}
spin_lock(&OCFS_I(inode)->ip_lock);
- cpu_to_le32(fe->bryce_i_clusters) = OCFS_I(inode)->ip_clusters;
+ fe->odd_i_clusters = cpu_to_le32(OCFS_I(inode)->ip_clusters);
spin_unlock(&OCFS_I(inode)->ip_lock);
- 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);
+ fe->odd_i_size = cpu_to_le64((u64)inode->i_size);
+ fe->odd_i_links_count = cpu_to_le16(inode->i_nlink);
+ fe->odd_i_uid = cpu_to_le32(inode->i_uid);
+ fe->odd_i_gid = cpu_to_le32(inode->i_gid);
+ fe->odd_i_mode = cpu_to_le16(inode->i_mode);
+ fe->odd_i_atime = cpu_to_le64(ocfs_get_seconds(inode->i_atime));
+ fe->odd_i_ctime = cpu_to_le64(ocfs_get_seconds(inode->i_ctime));
+ fe->odd_i_mtime = cpu_to_le64(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;
@@ -1017,17 +1062,27 @@
spin_lock(&OCFS_I(inode)->ip_lock);
if (INODE_DELETED(inode)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("Inode %lu was marked as deleted!",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("Inode %llu was marked as deleted!",
OCFS_I(inode)->ip_blkno);
+#endif
status = -ENOENT;
goto bail;
}
/* Add checks as needed */
- 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))
+ if ((le64_to_cpu(fe->odd_i_dtime)) || (!(le32_to_cpu(fe->odd_i_flags) & OCFS2_VALID_FL))) {
+ if (le64_to_cpu(fe->odd_i_dtime))
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Inode %lu has dtime = %lu\n",
+ inode->i_ino, le64_to_cpu(fe->odd_i_dtime));
+#else
LOG_ERROR_ARGS("Inode %lu has dtime = %llu\n",
- inode->i_ino, le64_to_cpu(fe->bryce_i_dtime));
+ inode->i_ino, le64_to_cpu(fe->odd_i_dtime));
+#endif
else
LOG_TRACE_STR ("File Entry is invalid");
@@ -1035,58 +1090,79 @@
goto bail;
}
- if (inode->i_generation != le32_to_cpu(fe->bryce_i_generation)) {
+ if (inode->i_generation != le32_to_cpu(fe->odd_i_generation)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Inode %lu is stale! (%u, %u)\n",
+ OCFS_I(inode)->ip_blkno,
+ le32_to_cpu(inode->i_generation),
+ le32_to_cpu(fe->odd_i_generation));
+#else
LOG_ERROR_ARGS("Inode %llu is stale! (%u, %u)\n",
OCFS_I(inode)->ip_blkno,
le32_to_cpu(inode->i_generation),
- le32_to_cpu(fe->bryce_i_generation));
+ le32_to_cpu(fe->odd_i_generation));
+#endif
SET_INODE_DELETED(inode);
status = -ENOENT;
goto bail;
}
- 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 != le32_to_cpu(fe->odd_i_clusters)) ||
+ (inode->i_size != le64_to_cpu(fe->odd_i_size)) ||
+ inode->i_uid != le32_to_cpu(fe->odd_i_uid) ||
+ inode->i_gid != le32_to_cpu(fe->odd_i_gid) ||
+ inode->i_mode != le16_to_cpu(fe->odd_i_mode) ||
+ inode->i_nlink != le16_to_cpu(fe->odd_i_links_count)){
- if (OCFS_I(inode)->ip_clusters > le32_to_cpu(fe->bryce_i_clusters)) {
+ if (OCFS_I(inode)->ip_clusters > le32_to_cpu(fe->odd_i_clusters)) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("destroying extent maps for %lu, "
+ "ip_clusters = %u, i_clusters = %u\n",
+ OCFS_I(inode)->ip_blkno,
+ OCFS_I(inode)->ip_clusters,
+ le32_to_cpu(fe->odd_i_clusters));
+#else
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,
- le32_to_cpu(fe->bryce_i_clusters));
+ le32_to_cpu(fe->odd_i_clusters));
+#endif
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 = le32_to_cpu(fe->bryce_i_clusters);
- inode->i_size = le64_to_cpu(fe->bryce_i_size);
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->odd_i_clusters);
+ inode->i_size = le64_to_cpu(fe->odd_i_size);
if (S_ISREG(inode->i_mode)) {
OCFS_I(inode)->ip_mmu_private = inode->i_size;
}
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("verifyupdate: setting nlink from %d to %d for %lu\n",
+ inode->i_nlink, le16_to_cpu(fe->odd_i_links_count),
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("verifyupdate: setting nlink from %d to %d for %llu\n",
- inode->i_nlink, le16_to_cpu(fe->bryce_i_links_count),
+ inode->i_nlink, le16_to_cpu(fe->odd_i_links_count),
OCFS_I(inode)->ip_blkno);
- inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
+#endif
+ inode->i_nlink = le16_to_cpu(fe->odd_i_links_count);
inode->i_blocks = (inode->i_size + osb->sb->s_blocksize - 1) >> osb->sb->s_blocksize_bits;
- 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_uid = le32_to_cpu(fe->odd_i_uid);
+ inode->i_gid = le32_to_cpu(fe->odd_i_gid);
+ inode->i_mode = le16_to_cpu(fe->odd_i_mode);
inode->i_blksize = (__u32) osb->s_clustersize;
- 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));
+ OCFS_SET_INODE_TIME(inode, i_ctime, le64_to_cpu(fe->odd_i_ctime));
+ OCFS_SET_INODE_TIME(inode, i_atime, le64_to_cpu(fe->odd_i_atime));
+ OCFS_SET_INODE_TIME(inode, i_mtime, le64_to_cpu(fe->odd_i_mtime));
- 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))) {
+ if (S_ISCHR(le16_to_cpu(fe->odd_i_mode)) ||
+ S_ISBLK(le16_to_cpu(fe->odd_i_mode)) ||
+ S_ISFIFO(le16_to_cpu(fe->odd_i_mode)) ||
+ S_ISSOCK(le16_to_cpu(fe->odd_i_mode))) {
inode->i_rdev = 0;
init_special_inode(inode, inode->i_mode,
- huge_decode_dev(le64_to_cpu(fe->id1.dev1.bryce_i_rdev)));
+ huge_decode_dev(le64_to_cpu(fe->id1.dev1.odd_i_rdev)));
}
}
@@ -1096,7 +1172,7 @@
spin_unlock(&OCFS_I(inode)->ip_lock);
if (drop_map)
- ocfs2_extent_map_trunc(inode, le32_to_cpu(fe->bryce_i_clusters));
+ ocfs2_extent_map_trunc(inode, le32_to_cpu(fe->odd_i_clusters));
return(status);
} /* ocfs_refresh_inode */
@@ -1124,8 +1200,13 @@
spin_lock(&OCFS_I(inode)->ip_lock);
if (INODE_DELETED(inode)) {
spin_unlock(&OCFS_I(inode)->ip_lock);
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("Inode %lu was marked as deleted!",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("Inode %llu was marked as deleted!",
OCFS_I(inode)->ip_blkno);
+#endif
status = -ENOENT;
goto leave;
}
Modified: branches/endian/src/journal.c
===================================================================
--- branches/endian/src/journal.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/journal.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -267,14 +267,25 @@
lock->inode,
lock->num_ident);
else
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("commit_thread: Skipping release for "
+ "inode %lu!\n",
+ OCFS_I(lock->inode)->ip_blkno);
+#else
+ LOG_ERROR_ARGS("commit_thread: Skipping release for "
"inode %llu!\n",
OCFS_I(lock->inode)->ip_blkno);
+#endif
if (tmpstat < 0)
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("commit_thread: release_lock status is"
+ " %d releasing lock on inode %lu!\n",
+ tmpstat, OCFS_I(lock->inode)->ip_blkno);
+#else
+ LOG_ERROR_ARGS("commit_thread: release_lock status is"
" %d releasing lock on inode %llu!\n",
tmpstat, OCFS_I(lock->inode)->ip_blkno);
-
+#endif
if (lock->drop_holders) {
lockres = GET_INODE_LOCKRES(lock->inode);
ocfs_acquire_lockres_write(lock->inode);
@@ -739,8 +750,13 @@
OCFS_ASSERT(inode);
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(inode=%lu, type=%u, flags=%u)\n",
+ OCFS_I(inode)->ip_blkno, type, flags);
+#else
LOG_ENTRY_ARGS("(inode=%llu, type=%u, flags=%u)\n",
OCFS_I(inode)->ip_blkno, type, flags);
+#endif
lock = kmem_cache_alloc(OcfsGlobalCtxt.lock_cache, GFP_NOFS);
if (lock == NULL) {
@@ -856,26 +872,43 @@
}
fe = (ocfs2_dinode *) bh->b_data;
- if (le64_to_cpu(fe->bryce_i_size) < OCFS2_MIN_JOURNAL_SIZE) {
+ if (le64_to_cpu(fe->odd_i_size) < OCFS2_MIN_JOURNAL_SIZE) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Journal file size (%lu) is too small!",
+ le64_to_cpu(fe->odd_i_size));
+#else
LOG_ERROR_ARGS("Journal file size (%llu) is too small!",
- le64_to_cpu(fe->bryce_i_size));
+ le64_to_cpu(fe->odd_i_size));
+#endif
status = -EINVAL;
goto done;
}
- 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));
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("fe->i_size = %lu\n", le64_to_cpu(fe->odd_i_size));
+ LOG_TRACE_ARGS("fe->i_clusters = %u\n", le32_to_cpu(fe->odd_i_clusters));
+ LOG_TRACE_ARGS("fe->i_blkno = %lu\n", le64_to_cpu(fe->odd_i_blkno));
LOG_TRACE_ARGS("inode->ip_clusters = %u\n",
OCFS_I(inode)->ip_clusters);
-
- if (OCFS_I(inode)->ip_clusters != le32_to_cpu(fe->bryce_i_clusters))
+#else
+ LOG_TRACE_ARGS("fe->i_size = %llu\n", le64_to_cpu(fe->odd_i_size));
+ LOG_TRACE_ARGS("fe->i_clusters = %u\n", le32_to_cpu(fe->odd_i_clusters));
+ LOG_TRACE_ARGS("fe->i_blkno = %llu\n", le64_to_cpu(fe->odd_i_blkno));
+ LOG_TRACE_ARGS("inode->ip_clusters = %u\n",
+ OCFS_I(inode)->ip_clusters);
+#endif
+ if (OCFS_I(inode)->ip_clusters != le32_to_cpu(fe->odd_i_clusters))
LOG_ERROR_ARGS("inode and fe alloc sizes differ! "
"(%u != %u", OCFS_I(inode)->ip_clusters,
- le32_to_cpu(fe->bryce_i_clusters));
- if (inode->i_size != le64_to_cpu(fe->bryce_i_size))
+ le32_to_cpu(fe->odd_i_clusters));
+ if (inode->i_size != le64_to_cpu(fe->odd_i_size))
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("inode and fe i_size's differ! (%llu != %lu",
+ inode->i_size, le64_to_cpu(fe->odd_i_size));
+#else
LOG_ERROR_ARGS("inode and fe i_size's differ! (%llu != %llu",
- inode->i_size, le64_to_cpu(fe->bryce_i_size));
+ inode->i_size, le64_to_cpu(fe->odd_i_size));
+#endif
OCFS_I(inode)->ip_open_cnt++;
@@ -1271,7 +1304,7 @@
clean_orphans = 1;
fe = (ocfs2_dinode *) bh->b_data;
- OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
+ OCFS_I(inode)->ip_clusters = le32_to_cpu(fe->odd_i_clusters);
status = ocfs_force_read_journal(inode);
if (status < 0) {
@@ -1431,24 +1464,38 @@
goto bail;
}
- local += le16_to_cpu(de->bryce_rec_len);
- offset += le16_to_cpu(de->bryce_rec_len);
+ local += le16_to_cpu(de->odd_rec_len);
+ offset += le16_to_cpu(de->odd_rec_len);
/* I guess we silently fail on no inode? */
- if (!le64_to_cpu(de->bryce_inode))
+ if (!le64_to_cpu(de->odd_inode))
continue;
if (de->file_type > OCFS2_FT_MAX) {
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("block %llu contains invalid "
+ "de: inode = %lu, rec_len = "
+ "%u, name_len = %u, file_type "
+ "= %u, name='%*s'\n",
+ (unsigned long long) bh->b_blocknr,
+ cpu_to_le64(de->odd_inode),
+ cpu_to_le16(de->odd_rec_len),
+ de->name_len,
+ de->file_type,
+ de->name_len,
+ de->name);
+#else
+ LOG_ERROR_ARGS("block %llu contains invalid "
"de: inode = %llu, rec_len = "
"%u, name_len = %u, file_type "
"= %u, name='%*s'\n",
(unsigned long long) bh->b_blocknr,
- cpu_to_le64(de->bryce_inode),
- cpu_to_le16(de->bryce_rec_len),
+ cpu_to_le64(de->odd_inode),
+ cpu_to_le16(de->odd_rec_len),
de->name_len,
de->file_type,
de->name_len,
de->name);
+#endif
continue;
}
if (de->name_len == 1 && !strncmp(".", de->name, 1))
@@ -1456,7 +1503,7 @@
if (de->name_len == 2 && !strncmp("..", de->name, 2))
continue;
- iter = ocfs_iget(osb, le64_to_cpu(de->bryce_inode));
+ iter = ocfs_iget(osb, le64_to_cpu(de->odd_inode));
if (!iter)
continue;
@@ -1535,8 +1582,11 @@
ocfs_publish *publish = NULL;
struct buffer_head *publish_bh = NULL;
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS("(0x%p, %lu)\n", osb, node_num);
+#else
LOG_ENTRY_ARGS("(0x%p, %llu)\n", osb, node_num);
-
+#endif
/* take a lock on the publish sector */
down (&(osb->publish_lock));
Modified: branches/endian/src/localalloc.c
===================================================================
--- branches/endian/src/localalloc.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/localalloc.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -161,9 +161,14 @@
alloc = (ocfs2_dinode *) alloc_bh->b_data;
- if (!(le32_to_cpu(alloc->bryce_i_flags) & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) {
+ if (!(le32_to_cpu(alloc->odd_i_flags) & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("Invalid local alloc inode, %lu\n",
+ OCFS_I(inode)->ip_blkno);
+#else
LOG_ERROR_ARGS("Invalid local alloc inode, %llu\n",
OCFS_I(inode)->ip_blkno);
+#endif
status = -EINVAL;
goto bail;
}
@@ -175,23 +180,23 @@
* we load it so there should be no bits used from the main
* bitmap. */
if (num_used
- || 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)) {
+ || le32_to_cpu(alloc->id1.bitmap1.odd_i_used)
+ || le32_to_cpu(alloc->id1.bitmap1.odd_i_total)
+ || le32_to_cpu(LOCAL_ALLOC(alloc)->odd_la_bm_off)) {
LOG_ERROR_ARGS("Local alloc hasn't been recovered!\n"
"found = %u, set = %u, taken = %u, off = %u\n",
num_used,
- 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));
+ le32_to_cpu(alloc->id1.bitmap1.odd_i_used),
+ le32_to_cpu(alloc->id1.bitmap1.odd_i_total),
+ le32_to_cpu(LOCAL_ALLOC(alloc)->odd_la_bm_off));
status = -EBUSY;
goto bail;
}
- 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))) {
+ if (!le16_to_cpu(LOCAL_ALLOC(alloc)->odd_la_size) ||
+ (le16_to_cpu(LOCAL_ALLOC(alloc)->odd_la_size) > ocfs2_local_alloc_size(inode->i_sb))) {
LOG_ERROR_ARGS("Local alloc size is invalid (la_size = %u)\n",
- le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size));
+ le16_to_cpu(LOCAL_ALLOC(alloc)->odd_la_size));
status = -EINVAL;
goto bail;
}
@@ -535,11 +540,11 @@
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- OCFS_ASSERT(le32_to_cpu(alloc->id1.bitmap1.bryce_i_used) ==
+ OCFS_ASSERT(le32_to_cpu(alloc->id1.bitmap1.odd_i_used) ==
ocfs_local_alloc_count_bits(alloc));
- free_bits = le32_to_cpu(alloc->id1.bitmap1.bryce_i_total) -
- le32_to_cpu(alloc->id1.bitmap1.bryce_i_used);
+ free_bits = le32_to_cpu(alloc->id1.bitmap1.odd_i_total) -
+ le32_to_cpu(alloc->id1.bitmap1.odd_i_used);
if (bits_wanted > free_bits) {
/* uhoh, window change time. */
status =
@@ -593,7 +598,7 @@
}
bitmap = LOCAL_ALLOC(alloc)->la_bitmap;
- *bit_off = le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off) + start;
+ *bit_off = le32_to_cpu(LOCAL_ALLOC(alloc)->odd_la_bm_off) + start;
/* local alloc is always contiguous by nature -- we never
* delete bits from it! */
*num_bits = bits_wanted;
@@ -609,7 +614,7 @@
while(bits_wanted--)
ocfs2_set_bit(start++, bitmap);
- cpu_to_le32(alloc->id1.bitmap1.bryce_i_used) += *num_bits;
+ alloc->id1.bitmap1.odd_i_used = cpu_to_le32(le32_to_cpu(alloc->id1.bitmap1.odd_i_used) + *num_bits);
status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
if (status < 0) {
@@ -636,7 +641,7 @@
LOG_ENTRY();
buffer = LOCAL_ALLOC(alloc)->la_bitmap;
- for (i = 0; i < le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size); i++) {
+ for (i = 0; i < le16_to_cpu(LOCAL_ALLOC(alloc)->odd_la_size); i++) {
memcpy(&tmp, buffer, 1);
count+= BITCOUNT(tmp);
buffer++;
@@ -658,7 +663,7 @@
LOG_ENTRY_ARGS("(numbits wanted = %u)\n", numbits);
- if (!le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)) {
+ if (!le32_to_cpu(alloc->id1.bitmap1.odd_i_total)) {
LOG_TRACE_STR("No bits in my window!");
bitoff = -1;
goto bail;
@@ -668,7 +673,7 @@
numfound = bitoff = startoff = 0;
lastzero = -1;
- left = le32_to_cpu(alloc->id1.bitmap1.bryce_i_total);
+ left = le32_to_cpu(alloc->id1.bitmap1.odd_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 +721,10 @@
int i;
LOG_ENTRY();
- 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++)
+ alloc->id1.bitmap1.odd_i_total = cpu_to_le32(0);
+ alloc->id1.bitmap1.odd_i_used = cpu_to_le32(0);
+ LOCAL_ALLOC(alloc)->odd_la_bm_off = cpu_to_le32(0);
+ for(i = 0; i < le16_to_cpu(LOCAL_ALLOC(alloc)->odd_la_size); i++)
LOCAL_ALLOC(alloc)->la_bitmap[i] = 0;
LOG_EXIT();
@@ -766,25 +771,25 @@
void *bitmap;
LOG_ENTRY_ARGS("total = %u, COUNT = %u, used = %u\n",
- le32_to_cpu(alloc->id1.bitmap1.bryce_i_total),
+ le32_to_cpu(alloc->id1.bitmap1.odd_i_total),
ocfs_local_alloc_count_bits(alloc),
- le32_to_cpu(alloc->id1.bitmap1.bryce_i_used));
+ le32_to_cpu(alloc->id1.bitmap1.odd_i_used));
- if (!le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)) {
+ if (!le32_to_cpu(alloc->id1.bitmap1.odd_i_total)) {
LOG_TRACE_STR("nothing to sync!");
goto bail;
}
- if (le32_to_cpu(alloc->id1.bitmap1.bryce_i_used) == le32_to_cpu(alloc->id1.bitmap1.bryce_i_total)) {
+ if (le32_to_cpu(alloc->id1.bitmap1.odd_i_used) == le32_to_cpu(alloc->id1.bitmap1.odd_i_total)) {
LOG_TRACE_STR("all bits were taken!");
goto bail;
}
la_start_blk = ocfs2_clusters_to_blocks(osb->sb,
- le32_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_bm_off));
+ le32_to_cpu(LOCAL_ALLOC(alloc)->odd_la_bm_off));
bitmap = LOCAL_ALLOC(alloc)->la_bitmap;
start = count = bit_off = 0;
- left = le32_to_cpu(alloc->id1.bitmap1.bryce_i_total);
+ left = le32_to_cpu(alloc->id1.bitmap1.odd_i_total);
while ((bit_off = ocfs2_find_next_zero_bit(bitmap, left, start))
!= -1) {
@@ -800,11 +805,17 @@
ocfs2_clusters_to_blocks(osb->sb,
start - count);
+#ifdef HAVE_64BIT_LONG
LOG_TRACE_ARGS("freeing %u bits starting at local "
+ "alloc bit %u (la_start_blk = %lu, "
+ "blkno = %lu)\n", count, start - count,
+ la_start_blk, blkno);
+#else
+ LOG_TRACE_ARGS("freeing %u bits starting at local "
"alloc bit %u (la_start_blk = %llu, "
"blkno = %llu)\n", count, start - count,
la_start_blk, blkno);
-
+#endif
status = ocfs_free_clusters(handle, main_bm_inode,
main_bm_bh, blkno, count);
if (status < 0) {
@@ -878,7 +889,7 @@
LOG_ENTRY();
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- if (le32_to_cpu(alloc->id1.bitmap1.bryce_i_total))
+ if (le32_to_cpu(alloc->id1.bitmap1.odd_i_total))
LOG_TRACE_STR("asking me to alloc a new window over a"
" non-empty one");
@@ -899,20 +910,20 @@
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- 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);
+ LOCAL_ALLOC(alloc)->odd_la_bm_off = cpu_to_le32(cluster_off);
+ alloc->id1.bitmap1.odd_i_total = cpu_to_le32(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. */
- cpu_to_le32(alloc->id1.bitmap1.bryce_i_used) = 0;
+ alloc->id1.bitmap1.odd_i_used = cpu_to_le32(0);
memset(LOCAL_ALLOC(alloc)->la_bitmap, 0,
- le16_to_cpu(LOCAL_ALLOC(alloc)->bryce_la_size));
+ le16_to_cpu(LOCAL_ALLOC(alloc)->odd_la_size));
LOG_TRACE_STR("New window allocated:");
LOG_TRACE_ARGS("window la_bm_off = %u\n",
- 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));
+ le32_to_cpu(LOCAL_ALLOC(alloc)->odd_la_bm_off));
+ LOG_TRACE_ARGS("window bits = %u\n", le32_to_cpu(alloc->id1.bitmap1.odd_i_total));
bail:
LOG_EXIT_STATUS(status);
Modified: branches/endian/src/namei.c
===================================================================
--- branches/endian/src/namei.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/namei.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -223,15 +223,15 @@
memset(new_bh->b_data, 0, osb->sb->s_blocksize);
de = (struct ocfs2_dir_entry *) new_bh->b_data;
- de->bryce_inode = cpu_to_le64(OCFS_I(inode)->ip_blkno);
+ de->odd_inode = cpu_to_le64(OCFS_I(inode)->ip_blkno);
de->name_len = 1;
- de->bryce_rec_len =
+ de->odd_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->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 -
+ de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->odd_rec_len));
+ de->odd_inode = cpu_to_le64(OCFS_I(parent)->ip_blkno);
+ de->odd_rec_len = cpu_to_le16(inode->i_sb->s_blocksize -
OCFS2_DIR_REC_LEN(1));
de->name_len = 2;
strcpy (de->name, "..");
@@ -299,8 +299,14 @@
}
if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) {
+#ifdef HAVE_64BIT_LONG
+ printk("inode %lu has i_nlink of %u\n",
+ OCFS_I(dir)->ip_blkno, dir->i_nlink);
+#else
printk("inode %llu has i_nlink of %u\n",
OCFS_I(dir)->ip_blkno, dir->i_nlink);
+
+#endif
status = -EMLINK;
goto leave;
}
@@ -334,7 +340,7 @@
ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
dirfe = (ocfs2_dinode *) parent_fe_bh->b_data;
- if (!le16_to_cpu(dirfe->bryce_i_links_count)) {
+ if (!le16_to_cpu(dirfe->odd_i_links_count)) {
/* can't make a file in a deleted directory. */
status = -ENOENT;
goto leave;
@@ -385,14 +391,21 @@
fe = (ocfs2_dinode *)new_fe_bh->b_data;
if (ocfs_populate_inode(inode, fe, 1) < 0) {
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%llu, "
- "i_blkno=%llu, i_ino=%lu\n",
+ "i_blkno=%lu, i_ino=%lu\n",
(unsigned long long)new_fe_bh->b_blocknr,
- le64_to_cpu(fe->bryce_i_blkno), inode->i_ino);
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino);
+#else
+ LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%lu, "
+ "i_blkno=%lu, i_ino=%lu\n",
+ (unsigned long long)new_fe_bh->b_blocknr,
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino);
+#endif
BUG();
}
- file_off = le64_to_cpu(fe->bryce_i_blkno) << dir->i_sb->s_blocksize_bits;
+ file_off = le64_to_cpu(fe->odd_i_blkno) << dir->i_sb->s_blocksize_bits;
ocfs_inode_set_new(osb, inode);
ocfs_init_lockres(osb, inode);
@@ -412,7 +425,7 @@
LOG_ERROR_STATUS(status);
goto leave;
}
- cpu_to_le16(dirfe->bryce_i_links_count)++;
+ dirfe->odd_i_links_count = cpu_to_le16(le16_to_cpu(dirfe->odd_i_links_count) +1);
status = ocfs_journal_dirty(handle, parent_fe_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -421,7 +434,7 @@
dir->i_nlink++;
}
- status = ocfs_add_entry(handle, dentry, inode, le64_to_cpu(fe->bryce_i_blkno),
+ status = ocfs_add_entry(handle, dentry, inode, le64_to_cpu(fe->odd_i_blkno),
parent_fe_bh, de_bh);
if (status < 0) {
LOG_ERROR_STATUS (status);
@@ -526,43 +539,43 @@
spin_lock(&osb->s_next_gen_lock);
inode->i_generation = osb->s_next_generation++;
spin_unlock(&osb->s_next_gen_lock);
- 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;
+ fe->odd_i_generation = le32_to_cpu(inode->i_generation);
+ fe->odd_i_blkno = cpu_to_le64(fe_blkno);
+ fe->odd_i_suballoc_bit = cpu_to_le16(suballoc_bit);
+ fe->odd_i_suballoc_node = cpu_to_le16(osb->node_num);
+ fe->odd_i_uid = cpu_to_le32(current->fsuid);
if (dir->i_mode & S_ISGID) {
- cpu_to_le32(fe->bryce_i_gid) = dir->i_gid;
+ fe->odd_i_gid = cpu_to_le32(dir->i_gid);
if (S_ISDIR(mode))
mode |= S_ISGID;
} else
- cpu_to_le32(fe->bryce_i_gid) = current->fsgid;
- cpu_to_le16(fe->bryce_i_mode) = mode;
+ fe->odd_i_gid = cpu_to_le32(current->fsgid);
+ fe->odd_i_mode = cpu_to_le16(mode);
if (S_ISCHR (mode) || S_ISBLK (mode))
- cpu_to_le64(fe->id1.dev1.bryce_i_rdev) = huge_encode_dev(dev);
+ fe->id1.dev1.odd_i_rdev = cpu_to_le64(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))
- cpu_to_le16(fe->bryce_i_links_count) = 2;
+ fe->odd_i_links_count = cpu_to_le16(2);
else
- cpu_to_le16(fe->bryce_i_links_count) = 1;
+ fe->odd_i_links_count = cpu_to_le16(1);
- cpu_to_le64(fe->bryce_i_last_eb_blk) = 0;
+ fe->odd_i_last_eb_blk = cpu_to_le64(0);
strcpy (fe->i_signature, OCFS2_INODE_SIGNATURE);
- cpu_to_le32(fe->bryce_i_flags) |= OCFS2_VALID_FL;
- cpu_to_le16(DISK_LOCK(fe)->bryce_dl_master) = osb->node_num;
+ fe->odd_i_flags |= cpu_to_le32(OCFS2_VALID_FL);
+ DISK_LOCK(fe)->odd_dl_master = cpu_to_le16((osb->node_num);
DISK_LOCK(fe)->dl_level = OCFS_LKM_EXMODE;
- 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;
+ fe->odd_i_atime = cpu_to_le64(OCFS_CURRENT_TIME);
+ fe->odd_i_ctime = cpu_to_le64(OCFS_CURRENT_TIME);
+ fe->odd_i_mtime = cpu_to_le64(OCFS_CURRENT_TIME);
+ fe->odd_i_dtime = cpu_to_le64(0);
fel = &fe->id2.i_list;
- 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);
+ fel->odd_l_tree_depth = cpu_to_le16(0);
+ fel->odd_l_next_free_rec = cpu_to_le16(0);
+ fel->odd_l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb));
fe = NULL;
@@ -691,7 +704,7 @@
inode);
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (le16_to_cpu(fe->bryce_i_links_count) >= OCFS2_LINK_MAX) {
+ if (le16_to_cpu(fe->odd_i_links_count) >= OCFS2_LINK_MAX) {
err = -EMLINK;
goto bail;
}
@@ -709,14 +722,14 @@
goto bail;
}
- 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));
+ cpu_to_le16(fe->odd_i_links_count)++;
+ cpu_to_le64(fe->odd_i_ctime) = OCFS_CURRENT_TIME;
+ inode->i_nlink = le16_to_cpu(fe->odd_i_links_count);
+ OCFS_SET_INODE_TIME(inode, i_ctime, le64_to_cpu(fe->odd_i_ctime));
err = ocfs_journal_dirty(handle, fe_bh);
if (err < 0) {
- cpu_to_le16(fe->bryce_i_links_count)--;
+ cpu_to_le16(fe->odd_i_links_count)--;
inode->i_nlink--;
LOG_ERROR_STATUS(err);
goto bail;
@@ -725,7 +738,7 @@
err = ocfs_add_entry(handle, dentry, inode, OCFS_I(inode)->ip_blkno,
parent_fe_bh, de_bh);
if (err) {
- cpu_to_le16(fe->bryce_i_links_count)--;
+ cpu_to_le16(fe->odd_i_links_count)--;
inode->i_nlink--;
LOG_ERROR_STATUS(err);
goto bail;
@@ -856,14 +869,14 @@
}
fe = (ocfs2_dinode *) fe_bh->b_data;
- if (le16_to_cpu(fe->bryce_i_links_count) != inode->i_nlink) {
+ if (le16_to_cpu(fe->odd_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, le16_to_cpu(fe->bryce_i_links_count));
- inode->i_nlink = le16_to_cpu(fe->bryce_i_links_count);
+ inode->i_nlink, le16_to_cpu(fe->odd_i_links_count));
+ inode->i_nlink = le16_to_cpu(fe->odd_i_links_count);
}
- if (S_ISDIR(inode->i_mode) || (le16_to_cpu(fe->bryce_i_links_count) == 1)) {
+ if (S_ISDIR(inode->i_mode) || (le16_to_cpu(fe->odd_i_links_count) == 1)) {
status = ocfs_orphan_add(osb, handle, inode, fe, orphan_name,
orphan_entry_bh);
if (status < 0) {
@@ -880,10 +893,10 @@
}
if (S_ISDIR (inode->i_mode)) {
- cpu_to_le16(fe->bryce_i_links_count) = 0;
+ fe->odd_i_links_count = cpu_to_le16(0);
inode->i_nlink = 0;
} else {
- cpu_to_le16(fe->bryce_i_links_count)--;
+ fe->odd_i_links_count = cpu_to_le16(le16_to_cpu(fe->odd_i_links_count - 1);
inode->i_nlink--;
}
@@ -1016,10 +1029,17 @@
return(status);
} /* ocfs_double_lock */
+
+/*
#define PARENT_INO(buffer) \
((struct ocfs2_dir_entry *) ((char *) buffer + \
- le16_to_cpu(((struct ocfs2_dir_entry *) buffer)->bryce_rec_len)))->bryce_inode
+ le16_to_cpu(((struct ocfs2_dir_entry *) buffer->odd_rec_len)))->odd_inode)
+*/
+#define PARENT_INO(buffer) \
+ ((struct ocfs2_dir_entry *) ((char *) buffer + \
+ ((struct ocfs2_dir_entry *) buffer->odd_rec_len)))->odd_inode)
+
/*
* ocfs_rename()
*
@@ -1157,7 +1177,7 @@
* and merrily kill the link to whatever was created under the
* same name. Goodbye sticky bit ;-<
*/
- if (le64_to_cpu(old_de->bryce_inode) != OCFS_I(old_inode)->ip_blkno)
+ if (le64_to_cpu(old_de->odd_inode) != OCFS_I(old_inode)->ip_blkno)
goto bail;
/* check if the target already exists (in which case we need
@@ -1200,10 +1220,17 @@
newfe = (ocfs2_dinode *) newfe_bh->b_data;
+#ifdef HAVE_64BIT_LONG
LOG_TRACE_ARGS("aha rename over existing... new_de=%p "
+ "new_blkno=%lu newfebh=%p bhblocknr=%lu\n",
+ new_de, newfe_blkno, newfe_bh, newfe_bh ?
+ (unsigned long long)newfe_bh->b_blocknr : 0ULL);
+#else
+ LOG_TRACE_ARGS("aha rename over existing... new_de=%p "
"new_blkno=%llu newfebh=%p bhblocknr=%llu\n",
new_de, newfe_blkno, newfe_bh, newfe_bh ?
(unsigned long long)newfe_bh->b_blocknr : 0ULL);
+#endif
if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) {
status = ocfs_prepare_orphan_dir(osb, handle,
@@ -1247,7 +1274,7 @@
goto bail;
}
- if (S_ISDIR(new_inode->i_mode) || (le16_to_cpu(newfe->bryce_i_links_count) == 1)){
+ if (S_ISDIR(new_inode->i_mode) || (le16_to_cpu(newfe->odd_i_links_count) == 1)){
status = ocfs_orphan_add(osb, handle, new_inode,
newfe, orphan_name,
orphan_entry_bh);
@@ -1264,7 +1291,7 @@
LOG_ERROR_STATUS (status);
goto bail;
}
- new_de->bryce_inode =
+ new_de->odd_inode =
le64_to_cpu(OCFS_I(old_inode)->ip_blkno);
new_de->file_type = old_de->file_type;
new_dir->i_version++;
@@ -1275,9 +1302,9 @@
}
if (S_ISDIR (new_inode->i_mode))
- cpu_to_le16(newfe->bryce_i_links_count) = 0;
+ newfe->odd_i_links_count = cpu_to_le16(0);
else
- cpu_to_le16(newfe->bryce_i_links_count)--;
+ newfe->odd_i_links_count = cpu_to_le16(le16_to_cpu(newfe->odd_i_links_count) - 1);
status = ocfs_journal_dirty(handle, newfe_bh);
if (status < 0) {
@@ -1338,7 +1365,7 @@
new_dir_bh,
OCFS_JOURNAL_ACCESS_WRITE);
fe = (ocfs2_dinode *) new_dir_bh->b_data;
- cpu_to_le16(fe->bryce_i_links_count) = new_dir->i_nlink;
+ cpu_to_le16(fe->odd_i_links_count) = new_dir->i_nlink;
status = ocfs_journal_dirty(handle, new_dir_bh);
}
}
@@ -1353,7 +1380,7 @@
status = ocfs_journal_access(handle, old_dir,
old_dir_bh, OCFS_JOURNAL_ACCESS_WRITE);
fe = (ocfs2_dinode *) old_dir_bh->b_data;
- cpu_to_le16(fe->bryce_i_links_count) = old_dir->i_nlink;
+ cpu_to_le16(fe->odd_i_links_count) = old_dir->i_nlink;
status = ocfs_journal_dirty(handle, old_dir_bh);
}
}
@@ -1571,7 +1598,7 @@
ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, dir);
dirfe = (ocfs2_dinode *) parent_fe_bh->b_data;
- if (!le32_to_cpu(dirfe->bryce_i_links_count)) {
+ if (!le32_to_cpu(dirfe->odd_i_links_count)) {
/* can't make a file in a deleted directory. */
status = -ENOENT;
goto bail;
@@ -1615,10 +1642,17 @@
fe = (ocfs2_dinode *) new_fe_bh->b_data;
if (ocfs_populate_inode (inode, fe, 1) < 0) {
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%llu, "
+ "i_blkno=%lu, i_ino=%lu\n",
+ (unsigned long long)new_fe_bh->b_blocknr,
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino);
+#else
+ 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,
- le64_to_cpu(fe->bryce_i_blkno), inode->i_ino);
+ le64_to_cpu(fe->odd_i_blkno), inode->i_ino);
+#endif
BUG();
}
@@ -1632,7 +1666,11 @@
data_ac, NULL, NULL);
if (status < 0) {
if (status != -ENOSPC && status != -EINTR) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS ("Failed to extend file to %lu", newsize);
+#else
LOG_ERROR_ARGS ("Failed to extend file to %llu", newsize);
+#endif
LOG_ERROR_STATUS(status);
status = -ENOSPC;
}
@@ -1654,7 +1692,7 @@
goto bail;
}
- status = ocfs_add_entry(handle, dentry, inode, le64_to_cpu(fe->bryce_i_blkno),
+ status = ocfs_add_entry(handle, dentry, inode, le64_to_cpu(fe->odd_i_blkno),
parent_fe_bh, de_bh);
if (status < 0) {
LOG_ERROR_STATUS (status);
@@ -1688,7 +1726,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->bryce_rec_len);
+ const int rlen = le16_to_cpu(de->odd_rec_len);
if (rlen < OCFS2_DIR_REC_LEN(1))
error_msg = "rec_len is smaller than minimal";
@@ -1700,11 +1738,19 @@
error_msg = "directory entry across blocks";
if (error_msg != NULL)
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("bad entry in directory #%lu: %s - "
+ "offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
+ OCFS_I(dir)->ip_blkno, error_msg, offset,
+ le64_to_cpu(de->odd_inode),
+ rlen, de->name_len);
+#else
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->bryce_inode),
+ le64_to_cpu(de->odd_inode),
rlen, de->name_len);
+#endif
return error_msg == NULL ? 1 : 0;
}
@@ -1750,29 +1796,29 @@
retval = -EEXIST;
goto bail;
}
- if (((le64_to_cpu(de->bryce_inode) == 0) &&
- (le16_to_cpu(de->bryce_rec_len) >= rec_len)) ||
- (le16_to_cpu(de->bryce_rec_len) >=
+ if (((le64_to_cpu(de->odd_inode) == 0) &&
+ (le16_to_cpu(de->odd_rec_len) >= rec_len)) ||
+ (le16_to_cpu(de->odd_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->bryce_rec_len);
- if (le64_to_cpu(de->bryce_inode)) {
+ offset += le16_to_cpu(de->odd_rec_len);
+ if (le64_to_cpu(de->odd_inode)) {
de1 = (struct ocfs2_dir_entry *) ((char *) de +
OCFS2_DIR_REC_LEN(de->name_len));
- de1->bryce_rec_len =
- cpu_to_le16(le16_to_cpu(de->bryce_rec_len) -
+ de1->odd_rec_len =
+ cpu_to_le16(le16_to_cpu(de->odd_rec_len) -
OCFS2_DIR_REC_LEN(de->name_len));
- de->bryce_rec_len = cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len));
+ de->odd_rec_len = cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len));
de = de1;
}
de->file_type = OCFS2_FT_UNKNOWN;
if (blkno) {
- de->bryce_inode = cpu_to_le64(blkno);
+ de->odd_inode = cpu_to_le64(blkno);
ocfs_set_de_type(de, inode->i_mode);
} else
- le64_to_cpu(de->bryce_inode) = 0;
+ de->odd_inode = cpu_to_le64(0);
de->name_len = namelen;
memcpy (de->name, name, namelen);
@@ -1782,8 +1828,8 @@
retval = 0;
goto bail;
}
- offset += le16_to_cpu(de->bryce_rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->bryce_rec_len));
+ offset += le16_to_cpu(de->odd_rec_len);
+ de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->odd_rec_len));
}
/* when you think about it, the assert above should prevent us
@@ -1823,17 +1869,17 @@
goto bail;
}
if (pde)
- pde->bryce_rec_len = cpu_to_le16(le16_to_cpu(pde->bryce_rec_len) +
- le16_to_cpu(de->bryce_rec_len));
+ pde->odd_rec_len = cpu_to_le16(le16_to_cpu(pde->odd_rec_len) +
+ le16_to_cpu(de->odd_rec_len));
else
- cpu_to_le64(de->bryce_inode) = 0;
+ de->odd_inode = cpu_to_le64(0);
dir->i_version++;
status = ocfs_journal_dirty(handle, bh);
goto bail;
}
- i += le16_to_cpu(de->bryce_rec_len);
+ i += le16_to_cpu(de->odd_rec_len);
pde = de;
- de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->bryce_rec_len));
+ de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->odd_rec_len));
}
bail:
LOG_EXIT_STATUS(status);
@@ -1874,7 +1920,7 @@
goto bail;
}
/* prevent looping on a bad block */
- de_len = le16_to_cpu(de->bryce_rec_len);
+ de_len = le16_to_cpu(de->odd_rec_len);
if (de_len <= 0) {
ret = -1;
goto bail;
@@ -2004,8 +2050,14 @@
goto bail;
}
- namelen = snprintf(name, OCFS2_MAX_FILENAME_LENGTH+1, "%llu",
+#ifdef HAVE_64BIT_LONG
+ namelen = snprintf(name, OCFS2_MAX_FILENAME_LENGTH+1, "%lu",
blkno);
+#else
+ namelen = snprintf(name, OCFS2_MAX_FILENAME_LENGTH+1, "%llu",
+ blkno);
+#endif
+
if (namelen <= 0) {
kfree(name);
if (!namelen)
@@ -2133,8 +2185,8 @@
* underneath us... */
orphan_fe = (ocfs2_dinode *) orphan_dir_bh->b_data;
if (S_ISDIR(inode->i_mode))
- cpu_to_le16(orphan_fe->bryce_i_links_count)++;
- orphan_dir_inode->i_nlink = le16_to_cpu(orphan_fe->bryce_i_links_count);
+ orphan_fe->odd_i_links_count = cpu_to_le16(le16_to_cpu(orphan_fe->odd_i_links_count) + 1);
+ orphan_dir_inode->i_nlink = le16_to_cpu(orphan_fe->odd_i_links_count);
status = ocfs_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
@@ -2150,7 +2202,7 @@
goto leave;
}
- cpu_to_le32(fe->bryce_i_flags) |= OCFS2_ORPHANED_FL;
+ fe->odd_i_flags |= cpu_to_le32(OCFS2_ORPHANED_FL);
leave:
if (orphan_dir_inode)
iput(orphan_dir_inode);
@@ -2183,8 +2235,13 @@
goto leave;
}
+#ifdef HAVE_64BIT_LONG
+ namelen = snprintf(name, OCFS2_MAX_FILENAME_LENGTH+1, "%lu",
+ OCFS_I(inode)->ip_blkno);
+#else
namelen = snprintf(name, OCFS2_MAX_FILENAME_LENGTH+1, "%llu",
OCFS_I(inode)->ip_blkno);
+#endif
if (namelen <= 0) {
if (namelen)
status = namelen;
@@ -2224,8 +2281,8 @@
/* do the i_nlink dance! :) */
orphan_fe = (ocfs2_dinode *) orphan_dir_bh->b_data;
if (S_ISDIR(inode->i_mode))
- cpu_to_le16(orphan_fe->bryce_i_links_count)--;
- orphan_dir_inode->i_nlink = le16_to_cpu(orphan_fe->bryce_i_links_count);
+ orphan_fe->odd_i_links_count = cpu_to_le16(le16_to_cpu(orphan_fe->odd_i_links_count) - 1);
+ orphan_dir_inode->i_nlink = le16_to_cpu(orphan_fe->odd_i_links_count);
status = ocfs_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
Modified: branches/endian/src/namei.h
===================================================================
--- branches/endian/src/namei.h 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/namei.h 2005-01-20 14:25:37 UTC (rev 1799)
@@ -41,7 +41,7 @@
{
if (len != de->name_len)
return 0;
- if (!le64_to_cpu(de->bryce_inode))
+ if (!le64_to_cpu(de->odd_inode))
return 0;
return !memcmp(name, de->name, len);
}
Modified: branches/endian/src/ocfs.h
===================================================================
--- branches/endian/src/ocfs.h 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/ocfs.h 2005-01-20 14:25:37 UTC (rev 1799)
@@ -898,10 +898,15 @@
atomic_read(&inode->i_count), inode->i_state,
inode->i_ino);
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("inode=%lu, deleted=%u\n",
+ OCFS_I(inode)->ip_blkno,
+ INODE_DELETED(inode));
+#else
LOG_ERROR_ARGS("inode=%llu, deleted=%u\n",
OCFS_I(inode)->ip_blkno,
INODE_DELETED(inode));
-
+#endif
return -EINVAL;
}
Modified: branches/endian/src/ocfs2_fs.h
===================================================================
--- branches/endian/src/ocfs2_fs.h 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/ocfs2_fs.h 2005-01-20 14:25:37 UTC (rev 1799)
@@ -213,16 +213,16 @@
* It describes a range of clusters on disk.
*/
typedef struct _ocfs2_extent_rec {
-/*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 */
+/*00*/ __u32 odd_e_cpos; /* Offset into the file, in clusters */
+ __u32 odd_e_clusters; /* Clusters covered by this extent */
+ __u64 odd_e_blkno; /* Physical disk offset, in blocks */
/*10*/
} ocfs2_extent_rec;
typedef struct _ocfs2_chain_rec {
- __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 */
+ __u32 odd_c_free; /* Number of free bits in this chain. */
+ __u32 odd_c_total; /* Number of total bits in this chain */
+ __u64 odd_c_blkno; /* Physical disk offset (blocks) of 1st group */
} ocfs2_chain_rec;
/*
@@ -232,14 +232,14 @@
* ocfs2_extent_block.h_list, respectively.
*/
typedef struct _ocfs2_extent_list {
-/*00*/ __u16 bryce_l_tree_depth; /* Extent tree depth from this
+/*00*/ __u16 odd_l_tree_depth; /* Extent tree depth from this
point. 0 means data extents
hang directly off this
header (a leaf) */
- __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?? */
+ __u16 odd_l_count; /* Number of extent records */
+ __u16 odd_l_next_free_rec; /* Next unused extent slot */
+ __u16 odd_l_reserved1; /* unused?? */
+ __u64 odd_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 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?? */
+/*00*/ __u16 odd_cl_cpg; /* Clusters per Block Group */
+ __u16 odd_cl_bpc; /* Bits per cluster */
+ __u16 odd_cl_count; /* Total chains in this list */
+ __u16 odd_cl_next_free_rec; /* Next unused chain slot */
+ __u64 odd_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 bryce_h_reserved1; /* unused?? */
-/*10*/ __s16 bryce_h_suballoc_node; /* Node suballocator this
+ __u64 odd_h_reserved1; /* unused?? */
+/*10*/ __s16 odd_h_suballoc_node; /* Node suballocator this
extent_header belongs to */
- __u16 bryce_h_suballoc_bit; /* Bit offset in suballocater
+ __u16 odd_h_suballoc_bit; /* Bit offset in suballocater
block group */
- __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,
+ __u32 odd_h_reserved2; /* unused ?? */
+ __u64 odd_h_blkno; /* Offset on disk, in blocks */
+/*20*/ __u64 odd_h_reserved3; /* unused?? */
+ __u64 odd_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,7 +284,7 @@
*/
typedef struct _ocfs2_disk_lock
{
-/*00*/ __s16 bryce_dl_master; /* Node number of current master */
+/*00*/ __s16 odd_dl_master; /* Node number of current master */
__u8 dl_level; /* Lock level */
__u8 dl_reserved1;
/*04*/
@@ -296,29 +296,29 @@
* are relative to the start of ocfs2_dinode.id2.
*/
typedef struct _ocfs2_super_block {
-/*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
+/*00*/ __u16 odd_s_major_rev_level;
+ __u16 odd_s_minor_rev_level;
+ __u16 odd_s_mnt_count; /* unused?? */
+ __s16 odd_s_max_mnt_count; /* unused?? */
+ __u16 odd_s_state; /* unused?? */ /* File system state */
+ __u16 odd_s_errors; /* unused?? */ /* Behaviour when detecting errors */
+ __u32 odd_s_checkinterval; /* unused?? */ /* Max time between checks */
+/*10*/ __u64 odd_s_lastcheck; /* unused?? */ /* Time of last check */
+ __u32 odd_s_creator_os; /* unused?? */ /* OS */
+ __u32 odd_s_feature_compat; /* Compatible feature set */
+/*20*/ __u32 odd_s_feature_incompat; /* Incompatible feature set */
+ __u32 odd_s_feature_ro_compat; /* Readonly-compatible feature set */
+ __u64 odd_s_root_blkno; /* Offset, in blocks, of root directory
dinode */
-/*30*/ __u64 bryce_s_system_dir_blkno; /* Offset, in blocks, of system
+/*30*/ __u64 odd_s_system_dir_blkno; /* Offset, in blocks, of system
directory dinode */
- __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
+ __u32 odd_s_blocksize_bits; /* Blocksize for this fs */
+ __u32 odd_s_clustersize_bits; /* Clustersize for this fs */
+/*40*/ __u16 odd_s_max_nodes; /* Max nodes in this cluster before
tunefs required */
- __u16 bryce_s_reserved1; /* unused?? */
- __u32 bryce_s_reserved2; /* unused?? */
- __u64 bryce_s_first_cluster_group; /* Block offset of 1st cluster
+ __u16 odd_s_reserved1; /* unused?? */
+ __u32 odd_s_reserved2; /* unused?? */
+ __u64 odd_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 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?? */
+/*00*/ __u32 odd_la_bm_off; /* Starting bit offset in main bitmap */
+ __u16 odd_la_size; /* Size of included bitmap, in bytes */
+ __u16 odd_la_reserved1; /* unused?? */
+ __u64 odd_la_reserved2; /* unused?? */
/*10*/ __u8 la_bitmap[0];
} ocfs2_local_alloc;
@@ -344,37 +344,37 @@
*/
typedef struct _ocfs2_dinode {
/*00*/ __u8 i_signature[8]; /* Signature for validation */
- __u32 bryce_i_generation; /* Generation number */
- __s16 bryce_i_suballoc_node; /* Node suballocater this inode
+ __u32 odd_i_generation; /* Generation number */
+ __s16 odd_i_suballoc_node; /* Node suballocater this inode
belongs to */
- __u16 bryce_i_suballoc_bit; /* Bit offset in suballocater
+ __u16 odd_i_suballoc_bit; /* Bit offset in suballocater
block group */
/*10*/ ocfs2_disk_lock i_disk_lock; /* Lock structure */
-/*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
+/*14*/ __u32 odd_i_clusters; /* Cluster count */
+/*18*/ __u32 odd_i_uid; /* Owner UID */
+ __u32 odd_i_gid; /* Owning GID */
+/*20*/ __u64 odd_i_size; /* Size in bytes */
+ __u16 odd_i_mode; /* File mode */
+ __u16 odd_i_links_count; /* Links count */
+ __u32 odd_i_flags; /* File flags */
+/*30*/ __u64 odd_i_atime; /* Access time */
+ __u64 odd_i_ctime; /* Creation time */
+/*40*/ __u64 odd_i_mtime; /* Modification time */
+ __u64 odd_i_dtime; /* Deletion time */
+/*50*/ __u64 odd_i_blkno; /* Offset on disk, in blocks */
+ __u64 odd_i_last_eb_blk; /* Pointer to last extent
block */
-/*60*/ __u64 bryce_i_reserved1[11]; /* unused?? */
+/*60*/ __u64 odd_i_reserved1[11]; /* unused?? */
/*B8*/ union {
- __u64 bryce_i_pad1; /* unused?? */ /* Generic way to refer to this
+ __u64 odd_i_pad1; /* unused?? */ /* Generic way to refer to this
64bit union */
struct {
- __u64 bryce_i_rdev; /* Device number */
+ __u64 odd_i_rdev; /* Device number */
} dev1;
struct { /* Info for bitmap system
inodes */
- __u32 bryce_i_used; /* Bits (ie, clusters) used */
- __u32 bryce_i_total; /* Total bits (clusters)
+ __u32 odd_i_used; /* Bits (ie, clusters) used */
+ __u32 odd_i_total; /* Total bits (clusters)
available */
} bitmap1;
} id1; /* Inode type dependant 1 */
@@ -391,8 +391,8 @@
* On-disk directory entry structure for OCFS2
*/
struct ocfs2_dir_entry {
-/*00*/ __u64 bryce_inode; /* Inode number */
- __u16 bryce_rec_len; /* Directory entry length */
+/*00*/ __u64 odd_inode; /* Inode number */
+ __u16 odd_rec_len; /* Directory entry length */
__u8 name_len; /* Name length */
__u8 file_type;
/*0C*/ char name[OCFS2_MAX_FILENAME_LENGTH]; /* File name */
@@ -405,20 +405,20 @@
typedef struct _ocfs2_group_desc
{
/*00*/ __u8 bg_signature[8]; /* Signature for validation */
- __u16 bryce_bg_size; /* Size of included bitmap in
+ __u16 odd_bg_size; /* Size of included bitmap in
bytes. */
- __u16 bryce_bg_bits; /* Bits represented by this
+ __u16 odd_bg_bits; /* Bits represented by this
group. */
- __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
+ __u16 odd_bg_free_bits_count; /* Free bits count */
+ __u16 odd_bg_chain; /* What chain I am in. */
+/*10*/ __u32 odd_bg_generation;
+ __u32 odd_bg_reserved1; /* unused?? */
+ __u64 odd_bg_next_group; /* Next group in my list, in
blocks */
-/*20*/ __u64 bryce_bg_parent_dinode; /* dinode which owns me, in
+/*20*/ __u64 odd_bg_parent_dinode; /* dinode which owns me, in
blocks */
- __u64 bryce_bg_blkno; /* Offset on disk, in blocks */
-/*30*/ __u64 bryce_bg_reserved2[2]; /* unused?? */
+ __u64 odd_bg_blkno; /* Offset on disk, in blocks */
+/*30*/ __u64 odd_bg_reserved2[2]; /* unused?? */
/*40*/ __u8 bg_bitmap[0];
} ocfs2_group_desc;
Modified: branches/endian/src/ocfs_journal.h
===================================================================
--- branches/endian/src/ocfs_journal.h 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/ocfs_journal.h 2005-01-20 14:25:37 UTC (rev 1799)
@@ -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 + le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth);
+ dinode_blocks = 1 + 1 + le16_to_cpu(fe->id2.i_list.odd_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 + le16_to_cpu(fe->id2.i_list.bryce_l_tree_depth) + 1;
+ int credits = 1 + le16_to_cpu(fe->id2.i_list.odd_l_tree_depth) + 1;
int bitmap_blocks, i;
- i = le16_to_cpu(last_el->bryce_l_next_free_rec) - 1;
+ i = le16_to_cpu(last_el->odd_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 (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);
+ if (le16_to_cpu(fe->id2.i_list.odd_l_tree_depth)
+ && (le16_to_cpu(last_el->odd_l_next_free_rec) == 1)
+ && ((le32_to_cpu(last_el->l_recs[i].odd_e_clusters) - clusters_to_del) == 0))
+ credits += 1 + le16_to_cpu(fe->id2.i_list.odd_l_tree_depth);
/* bitmap fe + group descriptor */
bitmap_blocks = OCFS_SUBALLOC_FREE;
Modified: branches/endian/src/proc.c
===================================================================
--- branches/endian/src/proc.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/proc.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -465,7 +465,11 @@
len = sprintf (page, PROC_STATS, pubmap,
osb->num_nodes, osb->s_clustersize,
+#ifdef HAVE_64BIT_LONG
+ (long long unsigned int)ocfs2_clusters_to_bytes(osb->sb, osb->num_clusters),
+#else
ocfs2_clusters_to_bytes(osb->sb, osb->num_clusters),
+#endif
atomic_read(&osb->journal->num_trans),
atomic_read(&osb->journal->num_cmt_locks),
atomic_read(&osb->journal->num_chkpt_locks));
Modified: branches/endian/src/suballoc.c
===================================================================
--- branches/endian/src/suballoc.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/suballoc.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -167,16 +167,16 @@
memset(bg, 0, sb->s_blocksize);
strcpy (bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE);
- 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);
+ bg->odd_bg_generation = cpu_to_le32(alloc_inode->i_generation);
+ bg->odd_bg_size = le16_to_cpu(ocfs2_group_bitmap_size(sb));
+ bg->odd_bg_bits = (u32) le16_to_cpu(cl->odd_cl_cpg) * (u32) le16_to_cpu(cl->odd_cl_bpc);
+ bg->odd_bg_chain = le16_to_cpu(my_chain);
+ bg->odd_bg_next_group = le64_to_cpu(cl->cl_recs[my_chain].odd_c_blkno);
+ bg->odd_bg_parent_dinode = le64_to_cpu(OCFS_I(alloc_inode)->ip_blkno);
+ bg->odd_bg_blkno = le64_to_cpu(group_blkno);
/* set the 1st bit in the bitmap to account for the descriptor block */
ocfs2_set_bit(0, (unsigned long *) bg->bg_bitmap);
- cpu_to_le16(bg->bryce_bg_free_bits_count) = le16_to_cpu(bg->bryce_bg_bits) - 1;
+ bg->odd_bg_free_bits_count = cpu_to_le16(le16_to_cpu(bg->odd_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 < 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))
+ while (curr < le16_to_cpu(cl->odd_cl_count)) {
+ if (le32_to_cpu(cl->cl_recs[best].odd_c_total) > le32_to_cpu(cl->cl_recs[curr].odd_c_total))
best = curr;
curr++;
}
@@ -299,14 +299,14 @@
cl = &fe->id2.i_chain;
status = ocfs_reserve_clusters(osb,
handle,
- le16_to_cpu(cl->bryce_cl_cpg),
+ le16_to_cpu(cl->odd_cl_cpg),
&ac);
if (status < 0) {
LOG_ERROR_STATUS(status);
goto bail;
}
- credits = ocfs_calc_group_alloc_credits(osb->sb, le16_to_cpu(cl->bryce_cl_cpg));
+ credits = ocfs_calc_group_alloc_credits(osb->sb, le16_to_cpu(cl->odd_cl_cpg));
handle = ocfs_start_trans(osb, handle, credits);
if (!handle) {
status = -ENOMEM;
@@ -317,7 +317,7 @@
status = ocfs_claim_clusters(osb,
handle,
ac,
- le16_to_cpu(cl->bryce_cl_cpg),
+ le16_to_cpu(cl->odd_cl_cpg),
&bit_off,
&num_bits);
if (status < 0) {
@@ -336,8 +336,13 @@
/* setup the group */
bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off);
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("new descriptor, record %u, at block %lu\n",
+ alloc_rec, bg_blkno);
+#else
LOG_TRACE_ARGS("new descriptor, record %u, at block %llu\n",
alloc_rec, bg_blkno);
+#endif
bg_bh = sb_getblk(osb->sb, bg_blkno);
if (!bg_bh) {
@@ -366,15 +371,15 @@
goto bail;
}
- cpu_to_le32(cl->cl_recs[alloc_rec].bryce_c_free) += le16_to_cpu(bg->bryce_bg_free_bits_count);
- cpu_to_le32(cl->cl_recs[alloc_rec].bryce_c_total) += le16_to_cpu(bg->bryce_bg_bits);
- cpu_to_le64(cl->cl_recs[alloc_rec].bryce_c_blkno) = bg_blkno;
- 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)++;
+ cl->cl_recs[alloc_rec].odd_c_free = cpu_to_le32(le32_to_cpu(cl->cl_recs[alloc_rec].odd_c_free) + le16_to_cpu(bg->odd_bg_free_bits_count));
+ cl->cl_recs[alloc_rec].odd_c_total = cpu_to_le32(le32_to_cpu(cl->cl_recs[alloc_rec].odd_c_total) + le16_to_cpu(bg->odd_bg_bits));
+ cl->cl_recs[alloc_rec].odd_c_blkno = cpu_to_le64(bg_blkno);
+ if (le16_to_cpu(cl->odd_cl_next_free_rec) < le16_to_cpu(cl->odd_cl_count))
+ cl->odd_cl_next_free_rec = cpu_to_le16(le16_to_cpu(cl->odd_cl_next_free_rec) + 1);
- cpu_to_le32(fe->id1.bitmap1.bryce_i_used) += (le16_to_cpu(bg->bryce_bg_bits) - le16_to_cpu(bg->bryce_bg_free_bits_count));
- cpu_to_le32(fe->id1.bitmap1.bryce_i_total) += le16_to_cpu(bg->bryce_bg_bits);
- cpu_to_le32(fe->bryce_i_clusters) += le16_to_cpu(cl->bryce_cl_cpg);
+ fe->id1.bitmap1.odd_i_used = cpu_to_le32(le32_to_cpu(fe->id1.bitmap1.odd_i_used) + (le16_to_cpu(bg->odd_bg_bits) - le16_to_cpu(bg->odd_bg_free_bits_count)));
+ fe->id1.bitmap1.odd_i_total = cpu_to_le32(le32_to_cpu(fe->id1.bitmap1.odd_i_total) + le16_to_cpu(bg->odd_bg_bits));
+ fe->odd_i_clusters = cpu_to_le32(le32_to_cpu(fe->odd_i_clusters) + le16_to_cpu(cl->odd_cl_cpg));
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
@@ -383,11 +388,11 @@
}
spin_lock(&OCFS_I(alloc_inode)->ip_lock);
- OCFS_I(alloc_inode)->ip_clusters = le32_to_cpu(fe->bryce_i_clusters);
- cpu_to_le64(fe->bryce_i_size) = ocfs2_clusters_to_bytes(alloc_inode->i_sb,
- le32_to_cpu(fe->bryce_i_clusters));
+ OCFS_I(alloc_inode)->ip_clusters = le32_to_cpu(fe->odd_i_clusters);
+ fe->odd_i_size= le64_to_cpu(ocfs2_clusters_to_bytes(alloc_inode->i_sb,
+ le32_to_cpu(fe->odd_i_clusters)));
spin_unlock(&OCFS_I(alloc_inode)->ip_lock);
- alloc_inode->i_size = le64_to_cpu(fe->bryce_i_size);
+ alloc_inode->i_size = le64_to_cpu(fe->odd_i_size);
alloc_inode->i_blocks = (alloc_inode->i_size + osb->sb->s_blocksize - 1) >> osb->sb->s_blocksize_bits;
status = 0;
@@ -437,10 +442,10 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT_RO(le32_to_cpu(fe->bryce_i_flags) & OCFS2_CHAIN_FL);
+ OCFS_ASSERT_RO(le32_to_cpu(fe->odd_i_flags) & OCFS2_CHAIN_FL);
- free_bits = le32_to_cpu(fe->id1.bitmap1.bryce_i_total) -
- le32_to_cpu(fe->id1.bitmap1.bryce_i_used);
+ free_bits = le32_to_cpu(fe->id1.bitmap1.odd_i_total) -
+ le32_to_cpu(fe->id1.bitmap1.odd_i_used);
if (bits_wanted > free_bits) {
/* cluster bitmap never grows */
@@ -458,8 +463,8 @@
}
/* You should never ask for this much metadata */
OCFS_ASSERT(bits_wanted <=
- (le32_to_cpu(fe->id1.bitmap1.bryce_i_total)
- - le32_to_cpu(fe->id1.bitmap1.bryce_i_used)));
+ (le32_to_cpu(fe->id1.bitmap1.odd_i_total)
+ - le32_to_cpu(fe->id1.bitmap1.odd_i_used)));
}
get_bh(bh);
@@ -715,9 +720,9 @@
bitmap = bg->bg_bitmap;
while((offset = ocfs2_find_next_zero_bit(bitmap,
- le16_to_cpu(bg->bryce_bg_bits),
+ le16_to_cpu(bg->odd_bg_bits),
start)) != -1) {
- if (offset == le16_to_cpu(bg->bryce_bg_bits))
+ if (offset == le16_to_cpu(bg->odd_bg_bits))
break;
if (!ocfs_test_bg_bit_allocatable(bg_bh, offset)) {
@@ -773,7 +778,7 @@
LOG_ENTRY();
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
- OCFS_ASSERT(cpu_to_le16(bg->bryce_bg_free_bits_count) >= num_bits);
+ OCFS_ASSERT(cpu_to_le16(bg->odd_bg_free_bits_count) >= num_bits);
LOG_TRACE_ARGS("block_group_set_bits: off = %u, num = %u\n", bit_off,
num_bits);
@@ -790,7 +795,7 @@
goto bail;
}
- cpu_to_le16(bg->bryce_bg_free_bits_count) -= num_bits;
+ bg->odd_bg_free_bits_count = cpu_to_le16(le16_to_cpu(bg->odd_bg_free_bits_count) - num_bits);
while(num_bits--)
ocfs2_set_bit(bit_off++, bitmap);
@@ -812,16 +817,16 @@
{
u16 curr, best;
- OCFS_ASSERT(le16_to_cpu(cl->bryce_cl_next_free_rec));
+ OCFS_ASSERT(le16_to_cpu(cl->odd_cl_next_free_rec));
best = curr = 0;
- 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))
+ while (curr < le16_to_cpu(cl->odd_cl_next_free_rec)) {
+ if (le32_to_cpu(cl->cl_recs[curr].odd_c_free) > le32_to_cpu(cl->cl_recs[best].odd_c_free))
best = curr;
curr++;
}
- OCFS_ASSERT(best < le16_to_cpu(cl->bryce_cl_next_free_rec));
+ OCFS_ASSERT(best < le16_to_cpu(cl->odd_cl_next_free_rec));
return best;
}
@@ -844,14 +849,21 @@
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(prev_bg));
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("In suballoc %lu, chain %u, move group %lu to top, "
+ "prev = %lu\n", le64_to_cpu(fe->odd_i_blkno), chain, le64_to_cpu(bg->odd_bg_blkno),
+ le64_to_cpu(prev_bg->odd_bg_blkno));
+#else
LOG_TRACE_ARGS("In suballoc %llu, chain %u, move group %llu to top, "
- "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));
+ "prev = %llu\n", le64_to_cpu(fe->odd_i_blkno), chain, le64_to_cpu(bg->odd_bg_blkno),
+ le64_to_cpu(prev_bg->odd_bg_blkno));
+#endif
- 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);
+ fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].odd_c_blkno);
+ bg_ptr = le64_to_cpu(bg->odd_bg_next_group);
+ prev_bg_ptr = le64_to_cpu(prev_bg->odd_bg_next_group);
+
status = ocfs_journal_access(handle, alloc_inode, prev_bg_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
@@ -859,7 +871,7 @@
goto bail;
}
- cpu_to_le64(prev_bg->bryce_bg_next_group) = le64_to_cpu(bg->bryce_bg_next_group);
+ prev_bg->odd_bg_next_group = bg->odd_bg_next_group;
status = ocfs_journal_dirty(handle, prev_bg_bh);
if (status < 0) {
@@ -874,7 +886,7 @@
goto bail;
}
- cpu_to_le64(bg->bryce_bg_next_group) = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno);
+ bg->odd_bg_next_group = fe->id2.i_chain.cl_recs[chain].odd_c_blkno;
status = ocfs_journal_dirty(handle, bg_bh);
if (status < 0) {
@@ -889,7 +901,7 @@
goto bail;
}
- cpu_to_le64(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno) = le64_to_cpu(bg->bryce_bg_blkno);
+ fe->id2.i_chain.cl_recs[chain].odd_c_blkno = bg->odd_bg_blkno;
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
@@ -900,9 +912,9 @@
status = 0;
bail:
if (status < 0) {
- cpu_to_le64(fe->id2.i_chain.cl_recs[chain].bryce_c_blkno) = fe_ptr;
- cpu_to_le64(bg->bryce_bg_next_group) = bg_ptr;
- cpu_to_le64(prev_bg->bryce_bg_next_group) = prev_bg_ptr;
+ fe->id2.i_chain.cl_recs[chain].odd_c_blkno = cpu_to_le64(fe_ptr);
+ bg->odd_bg_next_group = cpu_to_le64(bg_ptr);
+ prev_bg->odd_bg_next_group = cpu_to_le64(prev_bg_ptr);
}
LOG_EXIT_STATUS(status);
@@ -912,7 +924,7 @@
static inline int ocfs_block_group_reasonably_empty(ocfs2_group_desc *bg,
u32 wanted)
{
- return le16_to_cpu(bg->bryce_bg_free_bits_count) > wanted;
+ return le16_to_cpu(bg->odd_bg_free_bits_count) > wanted;
}
/* return 0 on success, -ENOSPC to keep searching and any other < 0
@@ -929,7 +941,7 @@
OCFS_ASSERT(ocfs2_is_cluster_bitmap(inode));
- if (le16_to_cpu(bg->bryce_bg_free_bits_count)) {
+ if (le16_to_cpu(bg->odd_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 +968,7 @@
OCFS_ASSERT(min_bits == 1);
OCFS_ASSERT(!ocfs2_is_cluster_bitmap(inode));
- if (le16_to_cpu(bg->bryce_bg_free_bits_count))
+ if (le16_to_cpu(bg->odd_bg_free_bits_count))
ret = ocfs_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
group_bh, bits_wanted,
bit_off, bits_found);
@@ -983,11 +995,15 @@
ocfs2_group_desc *bg;
chain = ac->ac_chain;
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("trying to alloc %u bits from chain %u, inode %lu\n",
+ bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
+#else
LOG_TRACE_ARGS("trying to alloc %u bits from chain %u, inode %llu\n",
bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
-
+#endif
status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
- le64_to_cpu(cl->cl_recs[chain].bryce_c_blkno), &group_bh,
+ le64_to_cpu(cl->cl_recs[chain].odd_c_blkno), &group_bh,
OCFS_BH_CACHED, alloc_inode);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1002,14 +1018,14 @@
while ((status = ac->ac_group_search(alloc_inode, group_bh,
bits_wanted, min_bits, bit_off,
&tmp_bits)) == -ENOSPC) {
- if (!le64_to_cpu(bg->bryce_bg_next_group))
+ if (!le64_to_cpu(bg->odd_bg_next_group))
break;
if (prev_group_bh) {
brelse(prev_group_bh);
prev_group_bh = NULL;
}
- next_group = le64_to_cpu(bg->bryce_bg_next_group);
+ next_group = le64_to_cpu(bg->odd_bg_next_group);
prev_group_bh = group_bh;
group_bh = NULL;
status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
@@ -1028,8 +1044,13 @@
goto bail;
}
+#ifdef HAVE_64BIT_LONG
LOG_TRACE_ARGS("alloc succeeds: we give %u bits from block group "
- "%llu\n", tmp_bits, le64_to_cpu(bg->bryce_bg_blkno));
+ "%lu\n", tmp_bits, le64_to_cpu(bg->odd_bg_blkno));
+#else
+ LOG_TRACE_ARGS("alloc succeeds: we give %u bits from block group "
+ "%llu\n", tmp_bits, le64_to_cpu(bg->odd_bg_blkno));
+#endif
*num_bits = tmp_bits;
@@ -1071,8 +1092,8 @@
goto bail;
}
- cpu_to_le32(fe->id1.bitmap1.bryce_i_used) += *num_bits;
- cpu_to_le32(cl->cl_recs[chain].bryce_c_free) -= *num_bits;
+ fe->id1.bitmap1.odd_i_used = cpu_to_le32(le32_to_cpu(fe->id1.bitmap1.odd_i_used) + *num_bits);
+ cl->cl_recs[chain].odd_c_free = cpu_to_le32(le32_to_cpu(cl->cl_recs[chain].odd_c_free) - *num_bits);
status = ocfs_journal_dirty(handle,
ac->ac_bh);
@@ -1092,10 +1113,14 @@
goto bail;
}
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("Allocated %u bits from suballocator %lu\n",
+ *num_bits, le64_to_cpu(fe->odd_i_blkno));
+#else
LOG_TRACE_ARGS("Allocated %u bits from suballocator %llu\n",
- *num_bits, le64_to_cpu(fe->bryce_i_blkno));
-
- *bg_blkno = le64_to_cpu(bg->bryce_bg_blkno);
+ *num_bits, le64_to_cpu(fe->odd_i_blkno));
+#endif
+ *bg_blkno = le64_to_cpu(bg->odd_bg_blkno);
bail:
if (group_bh)
brelse(group_bh);
@@ -1128,7 +1153,7 @@
fe = (ocfs2_dinode *) ac->ac_bh->b_data;
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
- OCFS_ASSERT_RO(le32_to_cpu(fe->id1.bitmap1.bryce_i_used) < le32_to_cpu(fe->id1.bitmap1.bryce_i_total));
+ OCFS_ASSERT_RO(le32_to_cpu(fe->id1.bitmap1.odd_i_used) < le32_to_cpu(fe->id1.bitmap1.odd_i_total));
cl = (ocfs2_chain_list *) &fe->id2.i_chain;
@@ -1153,10 +1178,10 @@
* because we only calculate enough journal credits for one
* relink per alloc. */
ac->ac_allow_chain_relink = 0;
- for (i = 0; i < le16_to_cpu(cl->bryce_cl_next_free_rec); i ++) {
+ for (i = 0; i < le16_to_cpu(cl->odd_cl_next_free_rec); i ++) {
if (i == victim)
continue;
- if (!le32_to_cpu(cl->cl_recs[i].bryce_c_free))
+ if (!le32_to_cpu(cl->cl_recs[i].odd_c_free))
continue;
ac->ac_chain = i;
@@ -1423,8 +1448,8 @@
ocfs2_set_bit(bit_off + tmp,
(unsigned long *) undo_bg->bg_bitmap);
}
- cpu_to_le16(bg->bryce_bg_free_bits_count) += num_bits;
+ bg->odd_bg_free_bits_count = cpu_to_le16(le16_to_cpu(bg->odd_bg_free_bits_count) + num_bits);
status = ocfs_journal_dirty(handle, group_bh);
if (status < 0)
LOG_ERROR_STATUS(status);
@@ -1442,6 +1467,7 @@
u64 bg_blkno,
unsigned int count)
{
+ int i_temp=0;
int status = 0;
ocfs_super *osb = OCFS2_SB(alloc_inode->i_sb);
ocfs2_dinode *fe = (ocfs2_dinode *) alloc_bh->b_data;
@@ -1453,12 +1479,19 @@
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
OCFS_ASSERT((count + start_bit)
- <= ((u32) le16_to_cpu(cl->bryce_cl_cpg) * (u32) le16_to_cpu(cl->bryce_cl_bpc)));
+ <= ((u32) le16_to_cpu(cl->odd_cl_cpg) * (u32) le16_to_cpu(cl->odd_cl_bpc)));
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("suballocator %lu: freeing %u bits from group %lu, "
+ "starting at %u\n",
+ OCFS_I(alloc_inode)->ip_blkno, count, bg_blkno,
+ start_bit);
+#else
LOG_TRACE_ARGS("suballocator %llu: freeing %u bits from group %llu, "
"starting at %u\n",
OCFS_I(alloc_inode)->ip_blkno, count, bg_blkno,
start_bit);
+#endif
status = ocfs_read_block(osb, bg_blkno, &group_bh, OCFS_BH_CACHED,
alloc_inode);
@@ -1469,7 +1502,7 @@
group = (ocfs2_group_desc *) group_bh->b_data;
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(group));
- OCFS_ASSERT((count + start_bit) <= le16_to_cpu(group->bryce_bg_bits));
+ OCFS_ASSERT((count + start_bit) <= le16_to_cpu(group->odd_bg_bits));
status = ocfs_block_group_clear_bits(handle, alloc_inode,
group, group_bh,
@@ -1486,9 +1519,13 @@
goto bail;
}
- cpu_to_le32(cl->cl_recs[le16_to_cpu(group->bryce_bg_chain)].bryce_c_free) += count;
- cpu_to_le32(fe->id1.bitmap1.bryce_i_used) -= count;
+/* cpu_to_le32(cl->cl_recs[le16_to_cpu(group->odd_bg_chain)].odd_c_free) += count; */
+ i_temp = cpu_to_le32(cl->cl_recs[le16_to_cpu(group->odd_bg_chain)].odd_c_free);
+ i_temp += count;
+ cl->cl_recs[le16_to_cpu(group->odd_bg_chain)].odd_c_free = i_temp;
+ fe->id1.bitmap1.odd_i_used = cpu_to_le32(le32_to_cpu(fe->id1.bitmap1.odd_i_used) - count);
+
status = ocfs_journal_dirty(handle, alloc_bh);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -1515,8 +1552,8 @@
struct buffer_head *inode_alloc_bh,
ocfs2_dinode *di)
{
- u64 blk = le64_to_cpu(di->bryce_i_blkno);
- u16 bit = le16_to_cpu(di->bryce_i_suballoc_bit);
+ u64 blk = le64_to_cpu(di->odd_i_blkno);
+ u16 bit = le16_to_cpu(di->odd_i_suballoc_bit);
u64 bg_blkno = ocfs_which_suballoc_group(blk, bit);
return ocfs_free_suballoc_bits(handle, inode_alloc_inode,
@@ -1528,8 +1565,8 @@
struct buffer_head *eb_alloc_bh,
ocfs2_extent_block *eb)
{
- u64 blk = le64_to_cpu(eb->bryce_h_blkno);
- u16 bit = le16_to_cpu(eb->bryce_h_suballoc_bit);
+ u64 blk = le64_to_cpu(eb->odd_h_blkno);
+ u16 bit = le16_to_cpu(eb->odd_h_suballoc_bit);
u64 bg_blkno = ocfs_which_suballoc_group(blk, bit);
return ocfs_free_suballoc_bits(handle, eb_alloc_inode, eb_alloc_bh,
@@ -1558,10 +1595,17 @@
ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno,
&bg_start_bit);
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("want to free %u clusters starting at block %lu\n",
+ num_clusters, start_blk);
+ LOG_TRACE_ARGS("bg_blkno = %lu, bg_start_bit = %u\n", bg_blkno,
+ bg_start_bit);
+#else
LOG_TRACE_ARGS("want to free %u clusters starting at block %llu\n",
num_clusters, start_blk);
LOG_TRACE_ARGS("bg_blkno = %llu, bg_start_bit = %u\n", bg_blkno,
bg_start_bit);
+#endif
status = ocfs_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
bg_start_bit, bg_blkno,
@@ -1577,39 +1621,58 @@
{
printk("Block Group:\n");
printk("bg_signature: %s\n", bg->bg_signature);
- 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));
+ printk("bg_size: %u\n", le16_to_cpu(bg->odd_bg_size));
+ printk("bg_bits: %u\n", le16_to_cpu(bg->odd_bg_bits));
+ printk("bg_free_bits_count: %u\n", le16_to_cpu(bg->odd_bg_free_bits_count));
+ printk("bg_chain: %u\n", le16_to_cpu(bg->odd_bg_chain));
+ printk("bg_generation: %u\n", le32_to_cpu(bg->odd_bg_generation));
+#ifdef HAVE_64BIT_LONG
+ printk("bg_next_group: %lu\n", le64_to_cpu(bg->odd_bg_next_group));
+ printk("bg_parent_dinode: %lu\n", le64_to_cpu(bg->odd_bg_parent_dinode));
+ printk("bg_blkno: %lu\n", le64_to_cpu(bg->odd_bg_blkno));
+#else
+ printk("bg_next_group: %llu\n", le64_to_cpu(bg->odd_bg_next_group));
+ printk("bg_parent_dinode: %llu\n", le64_to_cpu(bg->odd_bg_parent_dinode));
+ printk("bg_blkno: %llu\n", le64_to_cpu(bg->odd_bg_blkno));
+#endif
}
static inline void debug_suballoc_inode(ocfs2_dinode *fe)
{
int i;
- printk("Suballoc Inode %llu:\n", le64_to_cpu(fe->bryce_i_blkno));
+#ifdef HAVE_64BIT_LONG
+ printk("Suballoc Inode %lu:\n", le64_to_cpu(fe->odd_i_blkno));
+#else
+ printk("Suballoc Inode %llu:\n", le64_to_cpu(fe->odd_i_blkno));
+#endif
printk("i_signature: %s\n", fe->i_signature);
- 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));
+#ifdef HAVE_64BIT_LONG
+ printk("i_size: %lu\n", le64_to_cpu(fe->odd_i_size));
+#else
+ printk("i_size: %llu\n", le64_to_cpu(fe->odd_i_size));
+#endif
+ printk("i_clusters: %u\n", le32_to_cpu(fe->odd_i_clusters));
+ printk("i_generation: %u\n", le32_to_cpu(fe->odd_i_generation));
+ printk("id1.bitmap1.i_used: %u\n", le32_to_cpu(fe->id1.bitmap1.odd_i_used));
+ printk("id1.bitmap1.i_total: %u\n", le32_to_cpu(fe->id1.bitmap1.odd_i_total));
+ printk("id2.i_chain.cl_cpg: %u\n", le16_to_cpu(fe->id2.i_chain.odd_cl_cpg));
+ printk("id2.i_chain.cl_bpc: %u\n", le16_to_cpu(fe->id2.i_chain.odd_cl_bpc));
+ printk("id2.i_chain.cl_count: %u\n", le16_to_cpu(fe->id2.i_chain.odd_cl_count));
printk("id2.i_chain.cl_next_free_rec: %u\n",
- 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++) {
+ le16_to_cpu(fe->id2.i_chain.odd_cl_next_free_rec));
+ for(i = 0; i < le16_to_cpu(fe->id2.i_chain.odd_cl_next_free_rec); i++) {
printk("fe->id2.i_chain.cl_recs[%d].c_free: %u\n", i,
- le32_to_cpu(fe->id2.i_chain.cl_recs[i].bryce_c_free));
+ le32_to_cpu(fe->id2.i_chain.cl_recs[i].odd_c_free));
printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i,
- le32_to_cpu(fe->id2.i_chain.cl_recs[i].bryce_c_total));
+ le32_to_cpu(fe->id2.i_chain.cl_recs[i].odd_c_total));
+#ifdef HAVE_64BIT_LONG
+ printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %lu\n", i,
+ le64_to_cpu(fe->id2.i_chain.cl_recs[i].odd_c_blkno));
+#else
printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %llu\n", i,
- le64_to_cpu(fe->id2.i_chain.cl_recs[i].bryce_c_blkno));
+ le64_to_cpu(fe->id2.i_chain.cl_recs[i].odd_c_blkno));
+#endif
}
}
Modified: branches/endian/src/super.c
===================================================================
--- branches/endian/src/super.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/super.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -768,8 +768,8 @@
bm_lock = (ocfs2_dinode *) bh->b_data;
- numbits = le32_to_cpu(bm_lock->id1.bitmap1.bryce_i_total);
- freebits = numbits - le32_to_cpu(bm_lock->id1.bitmap1.bryce_i_used);
+ numbits = le32_to_cpu(bm_lock->id1.bitmap1.odd_i_total);
+ freebits = numbits - le32_to_cpu(bm_lock->id1.bitmap1.odd_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 = le16_to_cpu(di->id2.i_super.bryce_s_max_nodes);
+ osb->max_nodes = le16_to_cpu(di->id2.i_super.odd_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)->bryce_s_feature_compat);
+ le32_to_cpu(OCFS2_RAW_SB(di)->odd_s_feature_compat);
osb->s_feature_ro_compat =
- le32_to_cpu(OCFS2_RAW_SB(di)->bryce_s_feature_ro_compat);
+ le32_to_cpu(OCFS2_RAW_SB(di)->odd_s_feature_ro_compat);
osb->s_feature_incompat =
- le32_to_cpu(OCFS2_RAW_SB(di)->bryce_s_feature_incompat);
+ le32_to_cpu(OCFS2_RAW_SB(di)->odd_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.bryce_s_clustersize_bits);
+ osb->s_clustersize_bits = le32_to_cpu(di->id2.i_super.odd_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->bryce_i_clusters) - 1)
+ if (ocfs2_clusters_to_blocks(osb->sb, le32_to_cpu(di->odd_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,9 +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.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);
+ osb->root_blkno = le64_to_cpu(di->id2.i_super.odd_s_root_blkno);
+ osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.odd_s_system_dir_blkno);
+ osb->first_cluster_group_blkno = le64_to_cpu(di->id2.i_super.odd_s_first_cluster_group);
printk("vol_label: %s\n", osb->vol_label);
{
int ttt;
@@ -1511,8 +1511,11 @@
printk("%02x ", di->id2.i_super.s_uuid[ttt]);
printk("\n");
}
+#ifdef HAVE_64BIT_LONG
+ printk("root_blkno=%lu, system_dir_blkno=%lu\n", osb->root_blkno, osb->system_dir_blkno);
+#else
printk("root_blkno=%llu, system_dir_blkno=%llu\n", osb->root_blkno, osb->system_dir_blkno);
-
+#endif
atomic_set (&osb->vol_state, VOLUME_INIT);
/* load root, system_dir, and all global system inodes */
@@ -1570,13 +1573,21 @@
osb->vote_blkno = osb->publish_blkno + osb->publish_blocks;
osb->vote_blocks = osb->max_nodes;
+#ifdef HAVE_64BIT_LONG
+ printk("autoconfig: blkno=%lu, blocks=%u newblkno=%lu newblocks=%u\n",
+ osb->autoconfig_blkno, osb->autoconfig_blocks,
+ osb->new_autoconfig_blkno, osb->new_autoconfig_blocks);
+ printk("publish: blkno=%lu, blocks=%u\n", osb->publish_blkno,
+ osb->publish_blocks);
+ printk("vote: blkno=%lu, blocks=%u\n", osb->vote_blkno, osb->vote_blocks);
+#else
printk("autoconfig: blkno=%llu, blocks=%u newblkno=%llu newblocks=%u\n",
osb->autoconfig_blkno, osb->autoconfig_blocks,
osb->new_autoconfig_blkno, osb->new_autoconfig_blocks);
printk("publish: blkno=%llu, blocks=%u\n", osb->publish_blkno,
osb->publish_blocks);
printk("vote: blkno=%llu, blocks=%u\n", osb->vote_blkno, osb->vote_blocks);
-
+#endif
osb->autoconfig_bhs = ocfs_malloc (osb->total_autoconfig_blocks
* sizeof(struct buffer_head *));
if (!osb->autoconfig_bhs) {
@@ -1608,11 +1619,16 @@
goto bail;
}
di = (ocfs2_dinode *) bitmap_bh->b_data;
- 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);
+ osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.odd_cl_cpg);
+ osb->num_clusters = le32_to_cpu(di->id1.bitmap1.odd_i_total);
brelse(bitmap_bh);
+#ifdef HAVE_64BIT_LONG
+ printk("cluster bitmap inode: %lu, clusters per group: %u\n",
+ osb->bitmap_blkno, osb->bitmap_cpg);
+#else
printk("cluster bitmap inode: %llu, clusters per group: %u\n",
osb->bitmap_blkno, osb->bitmap_cpg);
+#endif
osb->prealloc_lock = 0;
@@ -1744,39 +1760,46 @@
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.bryce_s_blocksize_bits)) != blksz) {
+ if ((1 << le32_to_cpu(di->id2.i_super.odd_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.bryce_s_blocksize_bits),
+ 1 << le32_to_cpu(di->id2.i_super.odd_s_blocksize_bits),
blksz);
- } else if (le16_to_cpu(di->id2.i_super.bryce_s_major_rev_level) !=
+ } else if (le16_to_cpu(di->id2.i_super.odd_s_major_rev_level) !=
OCFS2_MAJOR_REV_LEVEL ||
- le16_to_cpu(di->id2.i_super.bryce_s_minor_rev_level) !=
+ le16_to_cpu(di->id2.i_super.odd_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.bryce_s_major_rev_level),
- le16_to_cpu(di->id2.i_super.bryce_s_minor_rev_level),
+ le16_to_cpu(di->id2.i_super.odd_s_major_rev_level),
+ le16_to_cpu(di->id2.i_super.odd_s_minor_rev_level),
OCFS2_MAJOR_REV_LEVEL,
OCFS2_MINOR_REV_LEVEL);
- } else if (bh->b_blocknr != le64_to_cpu(di->bryce_i_blkno)) {
+ } else if (bh->b_blocknr != le64_to_cpu(di->odd_i_blkno)) {
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("bad block number on superblock: "
+ "found %lu, should be %llu\n",
+ le64_to_cpu(di->odd_i_blkno),
+ (unsigned long long)bh->b_blocknr);
+#else
+ LOG_ERROR_ARGS("bad block number on superblock: "
"found %llu, should be %llu\n",
- le64_to_cpu(di->bryce_i_blkno),
+ le64_to_cpu(di->odd_i_blkno),
(unsigned long long)bh->b_blocknr);
- } 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) {
+#endif
+ } else if (le32_to_cpu(di->id2.i_super.odd_s_clustersize_bits) < 12 ||
+ le32_to_cpu(di->id2.i_super.odd_s_clustersize_bits) > 20) {
LOG_ERROR_ARGS("bad cluster size found: %u\n",
- 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)) {
+ 1 << le32_to_cpu(di->id2.i_super.odd_s_clustersize_bits));
+ } else if (!le64_to_cpu(di->id2.i_super.odd_s_root_blkno)) {
LOG_ERROR_STR("bad root_blkno: 0");
- } else if (!le64_to_cpu(di->id2.i_super.bryce_s_system_dir_blkno)) {
+ } else if (!le64_to_cpu(di->id2.i_super.odd_s_system_dir_blkno)) {
LOG_ERROR_STR("bad system_dir_blkno: 0");
- } else if (le16_to_cpu(di->id2.i_super.bryce_s_max_nodes) > OCFS2_MAX_NODES) {
+ } else if (le16_to_cpu(di->id2.i_super.odd_s_max_nodes) > OCFS2_MAX_NODES) {
LOG_ERROR_ARGS("max_nodes found greater than maximum: "
"found %u, max %u\n",
- le16_to_cpu(di->id2.i_super.bryce_s_max_nodes),
+ le16_to_cpu(di->id2.i_super.odd_s_max_nodes),
OCFS2_MAX_NODES);
} else {
/* found it! */
Modified: branches/endian/src/vote.c
===================================================================
--- branches/endian/src/vote.c 2005-01-20 09:12:44 UTC (rev 1798)
+++ branches/endian/src/vote.c 2005-01-20 14:25:37 UTC (rev 1799)
@@ -420,6 +420,16 @@
break;
if (ocfs_node_map_stringify(&obj->got_vote_map, &gotstr) < 0)
break;
+#ifdef HAVE_64BIT_LONG
+ ret = snprintf(p, max, "REQST: %d %c %3d %s %21lu %21lu %08x | %s\n",
+ obj->pid,
+ vote_state_str[obj->vote_state],
+ obj->vote_status,
+ reqstr,
+ request->lock_id,
+ request->lock_seq_num,
+ request->flags, gotstr);
+#else
ret = snprintf(p, max, "REQST: %d %c %3d %s %21llu %21llu %08x | %s\n",
obj->pid,
vote_state_str[obj->vote_state],
@@ -428,11 +438,23 @@
request->lock_id,
request->lock_seq_num,
request->flags, gotstr);
+#endif
break;
case OCFS_VOTE_REPLY:
reply = (ocfs_dlm_reply_master *) dlm_msg->msg_buf;
if (ocfs_node_map_stringify(&obj->req_vote_map, &reqstr) < 0)
break;
+#ifdef HAVE_64BIT_LONG
+ ret = snprintf(p, max, "REPLY: %d %c %3d %s %21lu %21lu %08x | %3d\n",
+ obj->pid,
+ vote_state_str[obj->vote_state],
+ obj->vote_status,
+ reqstr,
+ reply->h.lock_id,
+ reply->h.lock_seq_num,
+ reply->h.flags,
+ reply->status);
+#else
ret = snprintf(p, max, "REPLY: %d %c %3d %s %21llu %21llu %08x | %3d\n",
obj->pid,
vote_state_str[obj->vote_state],
@@ -442,7 +464,7 @@
reply->h.lock_seq_num,
reply->h.flags,
reply->status);
-
+#endif
break;
case OCFS_INFO_DISMOUNT:
ret = snprintf(p, max, "UNMNT: %d\n", obj->pid);
@@ -495,10 +517,17 @@
obj->vote_state == VOTE_OBJ_STATE_DESTROYING ||
obj->vote_state == VOTE_OBJ_STATE_UNSENT ||
req->lock_id != data->u.s.lock_id) {
+#ifdef HAVE_64BIT_LONG
LOG_ERROR_ARGS("bad message: vote_state=%d type=%d "
+ "lockid=%lu expected=%lu\n",
+ obj->vote_state, dlm_msg->msg_type,
+ req->lock_id, data->u.s.lock_id);
+#else
+ LOG_ERROR_ARGS("bad message: vote_state=%d type=%d "
"lockid=%llu expected=%llu\n",
obj->vote_state, dlm_msg->msg_type,
req->lock_id, data->u.s.lock_id);
+#endif
status = -EINVAL;
}
}
@@ -576,18 +605,30 @@
spin_lock(&obj->lock);
if (obj->vote_state != VOTE_OBJ_STATE_SENT &&
obj->vote_state != VOTE_OBJ_STATE_PARTIAL_REPLY) {
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("bad vote reply state=%d, node=%u, lockid=%lu, seq=%lu, vote=%d\n",
+ obj->vote_state, dlm_msg->src_node,
+ reply_msg->lock_id,
+ reply_msg->lock_seq_num, reply->status);
+#else
LOG_ERROR_ARGS("bad vote reply state=%d, node=%u, lockid=%llu, seq=%llu, vote=%d\n",
obj->vote_state, dlm_msg->src_node,
reply_msg->lock_id,
reply_msg->lock_seq_num, reply->status);
+#endif
status = -EINVAL;
goto unlock;
}
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS("node=%u, lockid=%lu, seq=%lu, vote=%d\n",
+ dlm_msg->src_node, reply_msg->lock_id,
+ reply_msg->lock_seq_num, reply->status);
+#else
LOG_TRACE_ARGS("node=%u, lockid=%llu, seq=%llu, vote=%d\n",
dlm_msg->src_node, reply_msg->lock_id,
reply_msg->lock_seq_num, reply->status);
-
+#endif
ctxt.got_vote_map = &(obj->got_vote_map);
ctxt.status = &(obj->vote_status);
ctxt.flags = reply_msg->flags;
@@ -834,8 +875,13 @@
ocfs_vote_obj *obj;
__u32 msg_len, obj_len;
+#ifdef HAVE_64BIT_LONG
+ LOG_ENTRY_ARGS ("(osb=0x%p, id=%lu, ty=%u, fl=%u)\n",
+ osb, lock_id, lock_type, flags);
+#else
LOG_ENTRY_ARGS ("(osb=0x%p, id=%llu, ty=%u, fl=%u)\n",
osb, lock_id, lock_type, flags);
+#endif
msg_len = sizeof (ocfs_dlm_msg) + sizeof (ocfs_dlm_req_master);
obj_len = sizeof (ocfs_vote_obj) + sizeof (ocfs_dlm_req_master);
@@ -877,9 +923,23 @@
spin_lock (&obj->lock);
if (obj->vote_status >= 0 && obj->vote_state == VOTE_OBJ_STATE_FULL_REPLY) {
+#ifdef HAVE_64BIT_LONG
+ LOG_TRACE_ARGS ("OK vote, lockid=%lu\n", lock_id);
+#else
LOG_TRACE_ARGS ("OK vote, lockid=%llu\n", lock_id);
+#endif
} else if ((obj->vote_status != -EAGAIN && obj->vote_status != -EBUSY) || obj->vote_state != VOTE_OBJ_STATE_FULL_REPLY) {
#warning "should we even be erroring here at all!"
+#ifdef HAVE_64BIT_LONG
+ LOG_ERROR_ARGS("inode %lu, vote_status=%d, vote_state=%d, "
+ "lockid=%lu, flags = 0x%x, asked type = %u "
+ "master = %d, state = 0x%lx, type = %u\n",
+ OCFS_I(inode)->ip_blkno, obj->vote_status,
+ obj->vote_state, lock_id, flags, lock_type,
+ GET_INODE_LOCKRES(inode)->master_node_num,
+ GET_INODE_LOCKRES(inode)->readonly_state,
+ GET_INODE_LOCKRES(inode)->lock_type);
+#else
LOG_ERROR_ARGS("inode %llu, vote_status=%d, vote_state=%d, "
"lockid=%llu, flags = 0x%x, asked type = %u "
"master = %d, state = 0x%lx, type = %u\n",
@@ -888,6 +948,7 @@
GET_INODE_LOCKRES(inode)->master_node_num,
GET_INODE_LOCKRES(inode)->readonly_state,
GET_INODE_LOCKRES(inode)->lock_type);
+#endif
}
*vote_status = obj->vote_status;
obj->vote_state = VOTE_OBJ_STATE_DESTROYING;
More information about the Ocfs2-commits
mailing list