[Ocfs2-commits] jlbec commits r906 - in trunk/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri May 7 18:37:59 CDT 2004
Author: jlbec
Date: 2004-05-07 17:37:57 -0500 (Fri, 07 May 2004)
New Revision: 906
Modified:
trunk/src/Makefile
trunk/src/alloc.c
trunk/src/dcache.c
trunk/src/dir.c
trunk/src/dlm.c
trunk/src/extmap.c
trunk/src/file.c
trunk/src/hash.c
trunk/src/heartbeat.c
trunk/src/inc/io.h
trunk/src/inc/ocfs.h
trunk/src/inc/proto.h
trunk/src/inode.c
trunk/src/io.c
trunk/src/journal.c
trunk/src/lockres.c
trunk/src/namei.c
trunk/src/nm.c
trunk/src/oin.c
trunk/src/osb.c
trunk/src/super.c
trunk/src/sysfile.c
trunk/src/util.c
trunk/src/volcfg.c
trunk/src/vote.c
Log:
bool and ocfs_bool are gone. So are true and false. Use int (or __u32
in on-disk structures). Use 1 and 0.
Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/Makefile 2004-05-07 22:37:57 UTC (rev 906)
@@ -121,7 +121,7 @@
DEFINES += $(BASE_DEFINES) $(GLOBAL_DEFINES)
-CFILES = \
+CFILES = \
alloc.c \
bitmap.c \
dcache.c \
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/alloc.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -52,7 +52,7 @@
static int _squish_extent_entries(ocfs_super *osb, ocfs_alloc_ext *extarr,
__u8 *freeExtent,
ocfs_journal_handle *handle,
- __u64 FileSize, bool flag, struct inode *inode) ;
+ __u64 FileSize, int flag, struct inode *inode) ;
static int ocfs_fix_extent_group(ocfs_super *osb, struct buffer_head *group_bh, struct inode *inode);
@@ -80,7 +80,7 @@
struct buffer_head *local_alloc_bh,
struct buffer_head *bm_lock_bh,
struct inode *bm_inode,
- bool in_recovery);
+ int in_recovery);
static __u32 ocfs_alloc_count_bits(ocfs_local_alloc *alloc);
static void ocfs_clear_local_alloc(ocfs_local_alloc *alloc);
static int ocfs_find_space_from_local(ocfs_super *osb, __u32 bitswanted,
@@ -521,8 +521,8 @@
ocfs_alloc_bm AllocBitmap;
ocfs_alloc_bm *tmpbitmap = NULL;
__u32 i;
- bool needs_uninit = false;
- bool needs_unlock = false;
+ int needs_uninit = 0;
+ int needs_unlock = 0;
LOG_ENTRY ();
@@ -563,14 +563,14 @@
if (Type == DISK_ALLOC_VOLUME) {
down (&(osb->vol_alloc_sem));
- needs_unlock = true;
+ needs_unlock = 1;
/* don't need to read it here as
* ocfs_free_main_bitmap handles that for us. */
tmpbitmap = &osb->cluster_bitmap;
} else {
down(&(osb->node_alloc_sem));
- needs_unlock = true;
+ needs_unlock = 1;
/* Read in the bitmap file for the dir alloc and look
for the required space, if found */
@@ -582,7 +582,7 @@
ocfs_initialize_bitmap(&AllocBitmap, fileSize * 8, allocSize * 8);
tmpbitmap = &AllocBitmap;
- needs_uninit = true;
+ needs_uninit = 1;
bitmapblocks = (OCFS_ALIGN(tmpbitmap->validbits, OCFS_BITS_IN_CHUNK) / OCFS_BITS_IN_CHUNK);
status = ocfs_read_system_file(osb, fileId, AllocBitmap.chunk,
@@ -975,7 +975,7 @@
OcfsExtent->alloc_file_off = fileOffset;
OcfsExtent->alloc_node = osb->node_num;
OcfsExtent->next_data_ext = 0;
- fe->local_ext = false;
+ fe->local_ext = 0;
fe->granularity++;
LOG_TRACE_ARGS ("Granularity is: %d\n", fe->granularity);
@@ -1143,7 +1143,7 @@
}
/* Update the File Entry Extent */
- fe->local_ext = false;
+ fe->local_ext = 0;
LOG_TRACE_ARGS("fe->alloc_size = %llu\n", fe->alloc_size);
fe->extents[0].file_off = 0;
@@ -1173,11 +1173,11 @@
int ocfs_allocate_extent (ocfs_super * osb, struct buffer_head *fe_bh, ocfs_journal_handle *handle, __u64 actualDiskOffset, __u64 actualLength, struct inode *inode)
{
int status = 0;
- bool IncreaseTreeDepth = false;
+ int IncreaseTreeDepth = 0;
int k = 0, i;
ocfs_extent_group *extent = NULL, *extent_header = NULL;
struct buffer_head *extent_bh = NULL, *extent_header_bh = NULL;
- bool UpdateParent = false;
+ int UpdateParent = 0;
__u64 newExtentOff, up_ptr;
ocfs_file_entry * FileEntry = NULL;
@@ -1220,7 +1220,7 @@
}
/* We have no more room in the fe, must increase
* granularity */
- IncreaseTreeDepth = true;
+ IncreaseTreeDepth = 1;
goto increase_depth;
}
LOG_TRACE_STR("Using NON-local extents");
@@ -1230,7 +1230,7 @@
LOG_ERROR_ARGS ("granularity=%d", FileEntry->granularity);
/* This File is no longer using Local Extents */
- IncreaseTreeDepth = false;
+ IncreaseTreeDepth = 0;
status = ocfs_read_bh(osb, FileEntry->last_ext_ptr, &extent_bh, OCFS_BH_COND_CACHED, inode);
if (status < 0) {
@@ -1258,7 +1258,7 @@
extent->extents[k].num_bytes += actualLength;
status = 0;
- UpdateParent = true;
+ UpdateParent = 1;
goto do_update_parent;
}
@@ -1276,7 +1276,7 @@
extent->extents[k].num_bytes = actualLength;
extent->extents[k].disk_off = actualDiskOffset;
extent->next_free_ext++;
- UpdateParent = true;
+ UpdateParent = 1;
} else {
__u64 up_hdr_node_ptr = 0;
@@ -1329,7 +1329,7 @@
* increase the granularity. */
if (i == FileEntry->granularity &&
FileEntry->next_free_ext == OCFS_MAX_FILE_ENTRY_EXTENTS) {
- IncreaseTreeDepth = true;
+ IncreaseTreeDepth = 1;
goto increase_depth;
}
/* ok, we need to add a branch. pass in NULL
@@ -1507,10 +1507,10 @@
* 'flag' seems to be an indicator that (if true) tells us that we already know
* we're gonna have to clear out all of extarr.
*/
-static int _squish_extent_entries(ocfs_super *osb, ocfs_alloc_ext *extarr, __u8 *freeExtent, ocfs_journal_handle *handle, __u64 FileSize, bool flag, struct inode *inode)
+static int _squish_extent_entries(ocfs_super *osb, ocfs_alloc_ext *extarr, __u8 *freeExtent, ocfs_journal_handle *handle, __u64 FileSize, int flag, struct inode *inode)
{
int status = 0;
- bool FirstTime = true;
+ int FirstTime = 1;
ocfs_alloc_ext *ext;
__u32 i, csize = osb->cluster_size_bits,
numBitsAllocated = 0, bitmapOffset = 0,
@@ -1535,7 +1535,7 @@
if (flag || foff >= FileSize) {
if (!flag && FirstTime) {
*freeExtent = i;
- FirstTime = false;
+ FirstTime = 0;
}
numBitsAllocated = (__u32) (bytes>>csize);
bitmapOffset = (__u32) ((doff - dstart) >> csize);
@@ -1543,7 +1543,7 @@
} else {
if (FirstTime) {
*freeExtent = i + 1;
- FirstTime = false;
+ FirstTime = 0;
}
origLength = bytes;
ext->num_bytes = bytes = FileSize - foff;
@@ -1774,9 +1774,9 @@
__u64 bytes, foff, doff, orig_bytes, dstart = osb->vol_layout.data_start_off, total_bytes, tmp_off;
__u32 csize = osb->cluster_size_bits;
__u32 num_sectors, bitmap_offset;
- bool done = false;
+ int done = 0;
int gran = fe->granularity;
- bool needs_brelse = false;
+ int needs_brelse = 0;
LOG_ENTRY();
@@ -1849,7 +1849,7 @@
/* We want to do the next bit of stuff too */
gran = 2;
- needs_brelse = true;
+ needs_brelse = 1;
}
/* This is a hack, but i have little time to make this function right*/
@@ -1926,7 +1926,7 @@
gran = 1;
if (needs_brelse)
brelse(tmp_bh2);
- needs_brelse = true;
+ needs_brelse = 1;
}
for (i =0; i < OCFS_TREE_STACK_SIZE; i++)
@@ -2015,7 +2015,7 @@
/* we want to exit the
* for loop now */
total_bytes+= (orig_bytes - bytes);
- done = true;
+ done = 1;
} else {
/* if we get here,
* then we don't want
@@ -2023,7 +2023,7 @@
* *anything* from
* this extent. */
LOG_TRACE_ARGS("Not deleting extent %d, disk_off = %llu, num_bytes = %llu, file_off = %llu\n", i, ext->disk_off, ext->num_bytes, ext->file_off);
- done = true;
+ done = 1;
goto skip_bitmap_add;
}
status = ocfs_handle_add_commit_bits(handle, num_sectors, bitmap_offset, -1, DISK_ALLOC_VOLUME);
@@ -2116,7 +2116,7 @@
AllocExtent->this_ext);
if (AllocExtent->extents[0].file_off ==newsize)
- done = true;
+ done = 1;
OCFS_BH_PUT_DATA(bh_stack[tos]);
AllocExtent = NULL;
@@ -2346,7 +2346,7 @@
struct buffer_head *extent_bh = NULL;
__u64 alloc_size;
int i, j;
- bool updated_lep; /* used to mark whether fe->last_ext_ptr has
+ int updated_lep; /* used to mark whether fe->last_ext_ptr has
* been updated */
LOG_ENTRY ();
@@ -2357,7 +2357,7 @@
if (FileEntry->local_ext) {
status = _squish_extent_entries(osb, FileEntry->extents,
&FileEntry->next_free_ext,
- handle, alloc_size, false,
+ handle, alloc_size, 0,
inode);
if (status < 0) {
LOG_ERROR_STATUS (status);
@@ -2369,7 +2369,7 @@
LOG_TRACE_ARGS("non-local extents. taking that code path, truncating to alloc_size of (%llu)\n", alloc_size);
/* non-local extents */
- updated_lep = false;
+ updated_lep = 0;
/* Loop backwards through only the used free extent headers here */
for (i = (FileEntry->next_free_ext - 1); i >= 0; i--) {
@@ -2414,7 +2414,7 @@
FileEntry->next_free_ext = i + 1;
/* We're done - we can't split more than one
* parts of the tree. */
- updated_lep = true;
+ updated_lep = 1;
break;
}
brelse(extent_bh);
@@ -2425,8 +2425,8 @@
if (alloc_size == 0) {
FileEntry->last_ext_ptr = 0;
FileEntry->granularity = -1;
- FileEntry->local_ext = true;
- updated_lep = true;
+ FileEntry->local_ext = 1;
+ updated_lep = 1;
}
if (!updated_lep) {
@@ -2705,7 +2705,7 @@
* Pass in 'lock_bh' and bitmap_inode only if you've already taken the
* vol_alloc semaphore, and you've done the acquire_lock on the bitmap.
*/
-int ocfs_find_contiguous_space_from_bitmap (ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, bool sysfile, struct buffer_head *lock_bh, struct inode *bitmap_inode)
+int ocfs_find_contiguous_space_from_bitmap (ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, int sysfile, struct buffer_head *lock_bh, struct inode *bitmap_inode)
{
int status = 0, tmpstat, startbh, numblocks;
__u32 bitoffset = 0, ClusterCount = 0;
@@ -2713,12 +2713,12 @@
__u32 LargeAlloc = 0;
static __u32 LargeAllocOffset = 0;
static __u32 SmallAllocOffset = 0;
- bool bLockAcquired = false;
+ int bLockAcquired = 0;
struct buffer_head *bh = NULL;
ocfs_file_entry *bm_lock = NULL;
__u32 bitmapblocks; /* we only care about the valid blocks */
- bool local_lock = true;
- bool local_inode = false;
+ int local_lock = 1;
+ int local_inode = 0;
__u32 five_percent;
LOG_ENTRY ();
@@ -2726,7 +2726,7 @@
OCFS_ASSERT (osb);
if (lock_bh) {
- local_lock = false;
+ local_lock = 0;
bh = lock_bh;
} else /* local lock */
down (&(osb->vol_alloc_sem));
@@ -2738,7 +2738,7 @@
LOG_ERROR_STR("Could not get bitmap inode!");
goto leave;
}
- local_inode = true;
+ local_inode = 1;
}
if (local_lock) {
@@ -2751,7 +2751,7 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- bLockAcquired = true;
+ bLockAcquired = 1;
}
bm_lock = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(bh); /* write */
@@ -2924,13 +2924,13 @@
__u32 numBits = 0;
__u32 foundBit = -1;
__u32 blockSize = 0, blockSizeBits = 0;
- bool bLockAcquired = false;
+ int bLockAcquired = 0;
__u32 bm_file = 0;
__u32 alloc_file = 0;
struct buffer_head *bh = NULL;
ocfs_file_entry *fe = NULL;
- bool needs_uninit = false;
- bool delay_lockrel = false;
+ int needs_uninit = 0;
+ int delay_lockrel = 0;
struct inode *inode = NULL; /* alloc bitmap file inode */
LOG_ENTRY_ARGS("(FileSize = (%llu), Type=%d)\n", FileSize,Type);
@@ -2970,7 +2970,7 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- bLockAcquired = true;
+ bLockAcquired = 1;
numBits = ((FileSize + (blockSize-1)) >> blockSizeBits);
numBytes = numBits << blockSizeBits;
@@ -2987,7 +2987,7 @@
if ((fileSize != 0) && (allocSize != 0)) {
/* Round this off to dirnodesize */
ocfs_initialize_bitmap (&bitmap, (__u32) fileSize * 8, (__u32) allocSize * 8);
- needs_uninit = true;
+ needs_uninit = 1;
status = ocfs_read_system_file (osb, bm_file, bitmap.chunk,
allocSize, offset);
@@ -3027,7 +3027,7 @@
status = ocfs_extend_system_file (osb, alloc_file,
newFileSize + extent, NULL,
- handle, false);
+ handle, 0);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto leave;
@@ -3042,7 +3042,7 @@
/* Calculate the new bitmap size */
status = ocfs_extend_system_file (osb, bm_file, bitMapSize, bh,
- handle, true);
+ handle, 1);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto leave;
@@ -3060,7 +3060,7 @@
else
ocfs_initialize_bitmap(&bitmap, fileSize * 8,
allocSize * 8);
- needs_uninit = true;
+ needs_uninit = 1;
status = ocfs_read_system_file (osb, bm_file, bitmap.chunk,
allocSize, offset);
@@ -3071,7 +3071,7 @@
foundBit = prevFileSize * 8;
- delay_lockrel = true;
+ delay_lockrel = 1;
if (Type == DISK_ALLOC_DIR_NODE)
atomic_inc(&osb->alloc_stats.dir_extends);
@@ -3394,14 +3394,14 @@
struct buffer_head *local_alloc_bh,
struct buffer_head *bm_lock_bh,
struct inode *bm_inode,
- bool in_recovery)
+ int in_recovery)
{
int status = 0, tmpstat;
__u32 bitmapblocks;
struct buffer_head *bh = NULL;
int bit_off, left;
ocfs_local_alloc *alloc = NULL;
- bool local_lock = true, got_lock = false;
+ int local_lock = 1, got_lock = 0;
void *bitmap;
struct inode *local_inode = NULL;
@@ -3419,7 +3419,7 @@
OCFS_BH_PUT_DATA(local_alloc_bh);
if (bm_lock_bh) {
- local_lock = false;
+ local_lock = 0;
bh = bm_lock_bh;
}
@@ -3448,7 +3448,7 @@
LOG_ERROR_STATUS (status);
goto bail;
}
- got_lock = true;
+ got_lock = 1;
}
bitmapblocks = (OCFS_ALIGN(osb->cluster_bitmap.validbits,
@@ -3553,7 +3553,7 @@
status = ocfs_find_contiguous_space_from_bitmap(osb, alloc_bytes,
&cluster_off,
- &cluster_count, false,
+ &cluster_count, 0,
lock_bh, bm_inode);
if (status < 0) {
LOG_ERROR_STATUS(status);
@@ -3705,12 +3705,12 @@
printk("ocfs2: disabling local alloc "
"bitmap for this mount.\n");
- ocfs_shutdown_local_alloc(osb, NULL, false,
- false);
+ ocfs_shutdown_local_alloc(osb, NULL, 0,
+ 0);
/* we want to make sure an empty alloc
* hits disk. */
- ocfs_handle_set_sync(handle, true);
+ ocfs_handle_set_sync(handle, 1);
/* the bh might not have been dirtied to
* the journal yet. */
@@ -3766,7 +3766,7 @@
status = ocfs_sync_local_to_main(osb, &(handle->commit_bits),
NULL, main_bm_bh,
- main_bm_inode, false);
+ main_bm_inode, 0);
if (status < 0) {
LOG_ERROR_STATUS(status);
goto bail;
@@ -3784,7 +3784,7 @@
* want to crash after having free'd the main bitmap
* bits and on replay have an old copy of the local
* alloc put back! */
- ocfs_handle_set_sync(handle, true);
+ ocfs_handle_set_sync(handle, 1);
alloc = (ocfs_local_alloc *) OCFS_BH_GET_DATA_WRITE(osb->local_alloc_bh); /* write */ /* journal access */
goto tryagain;
@@ -3852,12 +3852,12 @@
* we'll try to use our local alloc instead.
*
*/
-int ocfs_find_space(ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, bool sysfile, ocfs_journal_handle *handle)
+int ocfs_find_space(ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, int sysfile, ocfs_journal_handle *handle)
{
int status = 0;
__u32 bitswanted;
__u32 csize = osb->vol_layout.cluster_size;
- bool use_global = true;
+ int use_global = 1;
LOG_ENTRY_ARGS("(file_size = (%llu), handle = 0x%p, sysfile = %s)\n",
file_size, handle, sysfile ? "true" : "false");
@@ -3877,7 +3877,7 @@
if ( (handle && osb->have_local_alloc)
&& (osb->vol_layout.cluster_size <= OCFS_LOCAL_ALLOC_MAX_CSIZE)
&& (file_size <= OCFS_LOCAL_ALLOC_MAX_ALLOC) )
- use_global = false;
+ use_global = 0;
if (!use_global) {
status = ocfs_find_space_from_local(osb, bitswanted,
@@ -3886,7 +3886,7 @@
/* If we've run out of space for our local alloc, lets
* try the global one just in case... */
if (status == -ENOSPC)
- use_global = true;
+ use_global = 1;
else if (status < 0) {
LOG_ERROR_STATUS(status);
goto bail;
@@ -3952,7 +3952,7 @@
}
osb->local_alloc_bh = alloc_bh;
- osb->have_local_alloc = true;
+ osb->have_local_alloc = 1;
OCFS_BH_PUT_DATA(alloc_bh);
bail:
@@ -3975,8 +3975,8 @@
* returned brelse'd and NULL'd out.*/
void ocfs_shutdown_local_alloc(ocfs_super *osb,
struct buffer_head **local_alloc_bh,
- bool sync,
- bool in_recovery)
+ int sync,
+ int in_recovery)
{
int status;
ocfs_local_alloc *alloc = NULL;
@@ -4023,7 +4023,7 @@
/* this is special only if we're using the one off osb. */
if (!local_alloc_bh) {
osb->local_alloc_bh = NULL;
- osb->have_local_alloc = false;
+ osb->have_local_alloc = 0;
} else
*local_alloc_bh = NULL;
@@ -4050,7 +4050,7 @@
goto bail;
}
- ocfs_shutdown_local_alloc(osb, &alloc_bh, true, true);
+ ocfs_shutdown_local_alloc(osb, &alloc_bh, 1, 1);
bail:
if (alloc_bh)
Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/dcache.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -89,7 +89,7 @@
/* hit the disk */
/* TODO: optimize */
down (&(OCFS_I(inode)->priv_sem));
- OCFS_I(inode)->needs_verification = true;
+ OCFS_I(inode)->needs_verification = 1;
tmpstat = ocfs_verify_update_inode(osb, inode, &needs_trunc);
if (tmpstat < 0)
LOG_ERROR_STATUS (tmpstat);
Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/dir.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -29,8 +29,8 @@
#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_DIR
static int ocfs_insert_dir_node (ocfs_super * osb, struct buffer_head *bhs[], ocfs_file_entry * InsertEntry, struct buffer_head *lockbh, __s32 * IndexOffset, struct buffer_head **insert_bh, ocfs_journal_handle * handle, struct inode *dir_inode, struct inode *file_inode);
-static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, bool sync);
-static bool ocfs_find_index (ocfs_super * osb, struct buffer_head *bhs[],
+static int ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, int sync);
+static int ocfs_find_index (ocfs_super * osb, struct buffer_head *bhs[],
struct qstr * FileName, int *Index);
#if 0
static void ocfs_print_dir_node (ocfs_super * osb, ocfs_dir_node * DirNode);
@@ -120,7 +120,7 @@
LOG_ERROR_STR("filldir failed");
} else {
r = ocfs_find_files_on_disk (osb, rootOff, NULL, &entry_bh,
- ofile, inode, true);
+ ofile, inode, 1);
if (r < 0)
break;
entry = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(entry_bh); /* read */
@@ -160,14 +160,14 @@
/* ocfs_find_files_on_disk()
* NOTE: this should always be called with inode->i_sem taken!
*/
-int ocfs_find_files_on_disk (ocfs_super * osb, __u64 parent_off, struct qstr * file_name, struct buffer_head ** fe_bh, ocfs_file * ofile, struct inode *inode, bool take_lock)
+int ocfs_find_files_on_disk (ocfs_super * osb, __u64 parent_off, struct qstr * file_name, struct buffer_head ** fe_bh, ocfs_file * ofile, struct inode *inode, int take_lock)
{
int status = -ENOENT;
__u64 thisDirNode;
int tmpstat;
- bool temp_bhs = false;
- bool lock_acq = false;
- bool sync = true;
+ int temp_bhs = 0;
+ int lock_acq = 0;
+ int sync = 1;
struct buffer_head *bh = NULL;
struct buffer_head **bhs = NULL;
int bufsz, nbhs, i;
@@ -180,10 +180,10 @@
thisDirNode = parent_off;
if (ofile == NULL) {
- temp_bhs = true;
+ temp_bhs = 1;
bhs = ocfs_malloc (bufsz);
if (bhs == NULL) {
- temp_bhs = false;
+ temp_bhs = 0;
LOG_ERROR_STATUS(status = -ENOMEM);
goto leave;
}
@@ -195,7 +195,7 @@
}
OCFS_ASSERT(bhs);
- sync = false;
+ sync = 0;
if (take_lock) {
/* Get a lock on the directory... */
status = ocfs_acquire_lock (osb, parent_off, lock_type, FLAG_DIR|FLAG_READDIR,
@@ -206,10 +206,10 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- lock_acq = true;
+ lock_acq = 1;
// used to set sync if not locally owned
// should not need to anymore...
- // sync = true;
+ // sync = 1;
}
if (bhs[0]==NULL || bhs[0]->b_blocknr != (thisDirNode >> 9)) {
@@ -302,7 +302,7 @@
__u64 offset;
ocfs_dir_node *DirNode = NULL;
ocfs_file_entry *fe = NULL;
- bool sync_fe_write = false;
+ int sync_fe_write = 0;
LOG_ENTRY ();
@@ -321,7 +321,7 @@
goto bail;
}
- sync_fe_write = true;
+ sync_fe_write = 1;
OCFS_BH_PUT_DATA(bhs[idx+1]);
}
@@ -348,13 +348,13 @@
* ocfs_search_dir_node()
*
*/
-static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, bool sync)
+static int ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, int sync)
{
__u32 start;
__u32 i;
ocfs_file_entry *fe;
int status;
- bool bRet = false;
+ int bRet = 0;
ocfs_dir_node * DirNode = NULL, *tmp;
LOG_ENTRY ();
@@ -362,7 +362,7 @@
DirNode = (ocfs_dir_node *) ocfs_malloc(512);
if (DirNode == NULL) {
LOG_ERROR_STR("Out of memory");
- bRet = false;
+ bRet = 0;
goto bail;
}
@@ -378,14 +378,14 @@
if (!IS_VALID_DIR_NODE (DirNode)) {
LOG_TRACE_STR("Invalid Dir Node!\n");
- bRet = false;
+ bRet = 0;
goto bail;
}
while (1) {
/* Iterate thru this dirnode and find a matching entry */
for (i = start; i < DirNode->num_ent_used; i++) {
- bool found = true;
+ int found = 1;
if (SearchName != NULL) {
found = ocfs_find_index (osb, bhs, SearchName, (int *) &i);
@@ -413,7 +413,7 @@
OFile->curr_dir_off = DirNode->node_disk_off;
OFile->curr_byte_off = i + 1;
}
- bRet = true;
+ bRet = 1;
goto bail;
} else
break;
@@ -431,7 +431,7 @@
status = ocfs_read_dirnode(osb, next, sync, bhs, dir_inode);
if (status < 0) {
LOG_ERROR_STR("failed to read directory");
- bRet = false;
+ bRet = 0;
goto bail;
}
@@ -441,7 +441,7 @@
if (!IS_VALID_DIR_NODE (DirNode)) {
LOG_TRACE_STR("Invalid Dir Node!\n");
- bRet = false;
+ bRet = 0;
goto bail;
}
start = 0;
@@ -471,12 +471,12 @@
*
* Locks the dirnode bh, and then only one fe at a time.
*/
-static bool ocfs_find_index (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * FileName, int *Index)
+static int ocfs_find_index (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * FileName, int *Index)
{
int lowBnd, upBnd;
ocfs_file_entry *fe;
int res = -1, index = 0, start = 0;
- int ret = false;
+ int ret = 0;
struct qstr q;
ocfs_dir_node * DirNode = NULL;
@@ -484,7 +484,7 @@
DirNode = (ocfs_dir_node *)OCFS_BH_GET_DATA_READ(bhs[0]); /* read */
if (!IS_VALID_DIR_NODE (DirNode) || FileName==NULL) {
- ret = false;
+ ret = 0;
goto bail;
}
@@ -507,12 +507,12 @@
if (!res) {
*Index = index;
- ret = true;
+ ret = 1;
goto bail;
}
}
*Index = index;
- ret = false;
+ ret = 0;
goto bail;
}
@@ -540,17 +540,17 @@
if (!res) {
*Index = index;
- ret = true;
+ ret = 1;
goto bail;
}
if (res < 0) {
*Index = index;
- ret = false;
+ ret = 0;
goto bail;
}
}
*Index = lowBnd + upBnd - 1;
- ret = false;
+ ret = 0;
goto bail;
}
@@ -561,7 +561,7 @@
if (!res) {
*Index = index;
- ret = true;
+ ret = 1;
goto bail;
}
@@ -607,7 +607,7 @@
goto leave;
}
memset(arr, 0, bufsz);
- status = ocfs_read_dirnode(osb, DirNodeOffset, false, arr, dir_inode);
+ status = ocfs_read_dirnode(osb, DirNodeOffset, 0, arr, dir_inode);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto leave;
@@ -990,12 +990,12 @@
ocfs_dir_node *DirNode = NULL;
ocfs_dir_node *LockNode = NULL;
__u64 dir_off;
- bool parent_is_lock_node;
+ int parent_is_lock_node;
struct buffer_head **bhs = NULL;
const int numbhs = 256;
const int length = numbhs * sizeof(struct buffer_head *);
int i = 0;
- bool dirtyall = false;
+ int dirtyall = 0;
void *buf;
__u64 locknode_off, dir_next_node, new_head_del = 0;
__u64 locknode_head_del;
@@ -1058,7 +1058,7 @@
LockNode = NULL;
/* get the bhs for dir_off */
- status = ocfs_read_dirnode(osb, dir_off, false, bhs, dir_inode);
+ status = ocfs_read_dirnode(osb, dir_off, 0, bhs, dir_inode);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto leave;
@@ -1091,7 +1091,7 @@
dir_off = locknode_off;
while (1) {
LOG_TRACE_ARGS("ocfs_insert_file: now checking %llu\n", dir_off);
- status = ocfs_read_dirnode(osb, dir_off, false, bhs, dir_inode);
+ status = ocfs_read_dirnode(osb, dir_off, 0, bhs, dir_inode);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto leave;
@@ -1181,7 +1181,7 @@
if (dir_next_node != INVALID_NODE_POINTER) {
/* already allocated a new block */
LOG_TRACE_ARGS("ocfs_insert_file: CASE 2A\n");
- status = ocfs_read_dirnode(osb, dir_next_node, false, newbhs, dir_inode);
+ status = ocfs_read_dirnode(osb, dir_next_node, 0, newbhs, dir_inode);
if (status < 0) {
ocfs_safefree(newbhs);
LOG_ERROR_STATUS (status);
@@ -1215,7 +1215,7 @@
goto leave;
}
- dirtyall = true;
+ dirtyall = 1;
blk = (unsigned long)(bitmapOffset >> 9);
for (i = 0; i < numbhs; i++) {
newbhs[i] = getblk(OCFS_GET_BLOCKDEV(osb->sb),
Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/dlm.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -33,7 +33,7 @@
/* Tracing */
#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_DLM
-int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh, bool *disk_vote, struct inode *inode);
+int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh, int *disk_vote, struct inode *inode);
static inline int ocfs_wait_for_readonly_drop(ocfs_super *osb, struct inode *inode);
@@ -59,7 +59,7 @@
__u64 pubmap = 0;
__u8 *p;
__u32 wait;
- bool publish_flag = false;
+ int publish_flag = 0;
struct buffer_head **bhs = NULL;
__u64 feoff;
@@ -127,9 +127,9 @@
pubsect = (ocfs_publish *)p;
largestseqno++;
LOG_TRACE_ARGS ("largestseqno : %llu\n", largestseqno);
- osb->publish_dirty = true;
+ osb->publish_dirty = 1;
pubsect->publ_seq_num = largestseqno;
- pubsect->dirty = true;
+ pubsect->dirty = 1;
pubsect->vote = FLAG_VOTE_NODE;
pubsect->vote_map = *vote_map;
pubsect->vote_type = flags;
@@ -268,7 +268,7 @@
struct buffer_head *bh = NULL;
__u32 curr_master;
__u8 lock_level;
- bool is_dir = false, disk_vote = false;
+ int is_dir = 0, disk_vote = 0;
ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
LOG_ENTRY_ARGS ("(0x%p, %llu, %u, 0x%p, %u)\n",
@@ -408,7 +408,7 @@
finally:
if (lockres && status >= 0)
status = ocfs_update_lockres (osb, GET_INODE_VOTEOFF(inode), &bh,
- NULL, 0, inode, false);
+ NULL, 0, inode, 0);
if (bh)
brelse(bh);
@@ -453,8 +453,8 @@
}
for (i = 0; i < numnodes; i++) {
- bool node_alive = (IS_NODE_ALIVE (osb->publ_map, i, numnodes));
- bool node_in_map = (IS_NODE_ALIVE (vote_map, i, numnodes));
+ int node_alive = (IS_NODE_ALIVE (osb->publ_map, i, numnodes));
+ int node_in_map = (IS_NODE_ALIVE (vote_map, i, numnodes));
status = 0;
p = OCFS_BH_GET_DATA_READ(bhs[i]); /* read */
@@ -577,7 +577,7 @@
}
pubsect = (ocfs_publish *)OCFS_BH_GET_DATA_WRITE(bh); /* write */
- pubsect->dirty = false;
+ pubsect->dirty = 0;
pubsect->vote = 0;
pubsect->vote_type = 0;
pubsect->vote_map = 0;
@@ -592,7 +592,7 @@
}
- osb->publish_dirty = false;
+ osb->publish_dirty = 0;
atomic_set (&osb->node_req_vote, 0);
@@ -615,7 +615,7 @@
int status = 0;
__u64 offset = 0;
ocfs_file_entry *fe = NULL;
- bool changed = false;
+ int changed = 0;
ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
@@ -644,7 +644,7 @@
OCFS_BH_PUT_DATA(*bh);
fe = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(*bh); /* write */
}
- changed = true;
+ changed = 1;
DISK_LOCK_CURRENT_MASTER (fe) = lockres->master_node_num;
}
@@ -654,7 +654,7 @@
OCFS_BH_PUT_DATA(*bh);
fe = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(*bh); /* write */
}
- changed = true;
+ changed = 1;
DISK_LOCK_FILE_LOCK (fe) = lockres->lock_type;
}
@@ -666,7 +666,7 @@
OCFS_BH_PUT_DATA(*bh);
fe = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(*bh); /* write */
}
- changed = true;
+ changed = 1;
DISK_LOCK_OIN_MAP (fe) = lockres->oin_openmap;
}
}
@@ -677,7 +677,7 @@
OCFS_BH_PUT_DATA(*bh);
fe = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(*bh); /* write */
}
- changed = true;
+ changed = 1;
DISK_LOCK_SEQNUM (fe) = lockres->last_upd_seq_num;
}
@@ -708,7 +708,7 @@
int ocfs_update_master_on_open (ocfs_super * osb, struct inode *inode, ocfs_journal_handle *handle)
{
int status = -EAGAIN;
- bool disk_vote = false;
+ int disk_vote = 0;
struct buffer_head *bh = NULL;
ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
@@ -814,10 +814,10 @@
ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
int k = 0;
struct buffer_head *tmpbh = NULL, **b = NULL;
- /* TODO: 40 bytes of "bool" sitting on the stack for now. move */
+ /* TODO: 40 bytes of "int" sitting on the stack for now. move */
/* mutually exclusive flags into an enum and switch on them */
- bool disk_vote = false;
- bool no_owner = false, owner_dead = false, wait_on_recovery = false;
+ int disk_vote = 0;
+ int no_owner = 0, owner_dead = 0, wait_on_recovery = 0;
__u32 extra_lock_flags = 0;
LOG_ENTRY_ARGS ("(0x%p, %llu, %u, %u, 0x%p)\n",
@@ -834,7 +834,7 @@
flags |= FLAG_ACQUIRE_LOCK;
- status = ocfs_update_lockres (osb, lock_id, b, &updated, 0, inode, true);
+ status = ocfs_update_lockres (osb, lock_id, b, &updated, 0, inode, 1);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto bail;
@@ -846,7 +846,7 @@
LOG_TRACE_ARGS("attempting to get lock, pass: %d\n", ++k);
if (lockres->master_node_num == osb->node_num)
- updated = true;
+ updated = 1;
if (!updated) {
status = ocfs_read_bh (osb, lock_id, b, 0, inode);
@@ -863,7 +863,7 @@
lockres->lock_type = DISK_LOCK_FILE_LOCK (disklock);
lockres->oin_openmap = DISK_LOCK_OIN_MAP (disklock);
}
- updated = true;
+ updated = 1;
OCFS_BH_PUT_DATA(*b);
}
@@ -994,7 +994,7 @@
status = -EINTR;
goto finally;
}
- updated = false;
+ updated = 0;
goto again;
}
goto finally;
@@ -1028,14 +1028,14 @@
int status = 0, vote_status = 0;
int tmpstat;
__u64 lockseqno;
- bool cachelock = false;
- bool disk_vote = false;
+ int cachelock = 0;
+ int disk_vote = 0;
ocfs_file_entry *fe = NULL;
struct buffer_head *tmpbh = NULL, **b = NULL;
__u64 oin_node_map;
__u32 curr_master;
int lockflags = (lock_id >= osb->vol_layout.bitmap_off ? OCFS_BH_CACHED : 0);
- bool clear_tmp = false;
+ int clear_tmp = 0;
ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
LOG_ENTRY_ARGS ("(0x%p, %llu, %u, %u, 0x%p)\n",
@@ -1045,7 +1045,7 @@
b = &bh;
else {
b = &tmpbh;
- clear_tmp = true;
+ clear_tmp = 1;
}
if (bh == NULL) {
@@ -1127,7 +1127,7 @@
ocfs_show_trace(NULL);
LOG_TRACE_STR ("Disk vote");
- disk_vote = true;
+ disk_vote = 1;
status = ocfs_disk_request_vote (osb, lock_id, lock_type, flags, &votemap, &lockseqno, 5000, inode, NULL);
tmpstat = ocfs_reset_voting (osb);
@@ -1161,7 +1161,7 @@
if ((DISK_LOCK_FILE_LOCK (fe) == OCFS_DLM_ENABLE_CACHE_LOCK) &&
(DISK_LOCK_CURRENT_MASTER (fe) == osb->node_num)) {
lockres->lock_type = OCFS_DLM_ENABLE_CACHE_LOCK;
- cachelock = true;
+ cachelock = 1;
LOG_TRACE_STR("keeping at CACHE_LOCK");
}
else {
@@ -1176,7 +1176,7 @@
tmpstat = ocfs_write_bh (osb, *b, 0, inode);
if (tmpstat < 0)
LOG_ERROR_STATUS (tmpstat);
- clear_tmp = false;
+ clear_tmp = 0;
}
finito:
@@ -1269,7 +1269,7 @@
struct inode *inode = dentry->d_inode;
ocfs_super *osb = (ocfs_super *)data;
- ocfs_inc_inode_seq(osb, inode, false);
+ ocfs_inc_inode_seq(osb, inode, 0);
return 0;
}
@@ -1285,13 +1285,13 @@
dentry = list_entry (iter, struct dentry, d_alias);
ocfs_foreach_child (dentry, ocfs_zap_child_buffers_func, osb);
}
- ocfs_inc_inode_seq(osb, inode, false);
+ ocfs_inc_inode_seq(osb, inode, 0);
return 0;
}
/* inode is definitely non NULL */
-int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh, bool *disk_vote, struct inode *inode)
+int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh, int *disk_vote, struct inode *inode)
{
__u64 vote_map = 0ULL, open_map = 0ULL;
__u64 lockseqnum = 0;
@@ -1300,8 +1300,8 @@
__u64 lock_id;
__u32 lock_write_flags = DLOCK_FLAG_MASTER | DLOCK_FLAG_LOCK | DLOCK_FLAG_OPEN_MAP;
__u32 lock_type = requested_lock;
- bool need_to_zap_buffers = false, need_lock_write = true;
- bool is_readdir = (flags & FLAG_READDIR) ? true : false;
+ int need_to_zap_buffers = 0, need_lock_write = 1;
+ int is_readdir = (flags & FLAG_READDIR) ? 1 : 0;
int status = 0, vote_status = 0;
ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
@@ -1324,14 +1324,14 @@
}
if (flags & (FLAG_CHANGE_MASTER | FLAG_REMASTER)) {
/* on a master change... */
- need_to_zap_buffers = true; /* need to dump local buffers */
- need_lock_write = true; /* and rewrite the lock */
+ need_to_zap_buffers = 1; /* need to dump local buffers */
+ need_lock_write = 1; /* and rewrite the lock */
} else if (flags & (FLAG_ADD_OIN_MAP | FLAG_DROP_READONLY)) {
- need_lock_write = false;
- need_to_zap_buffers = false;
+ need_lock_write = 0;
+ need_to_zap_buffers = 0;
} else if (flags & (FLAG_READDIR | FLAG_FILE_RELEASE_CACHE)) {
- need_lock_write = false;
- need_to_zap_buffers = true;
+ need_lock_write = 0;
+ need_to_zap_buffers = 1;
} else {
if (bh) {
fe = (ocfs_file_entry *)OCFS_BH_GET_DATA_READ(bh); /* read */
@@ -1340,8 +1340,8 @@
DISK_LOCK_FILE_LOCK (fe) != OCFS_DLM_ENABLE_CACHE_LOCK);
OCFS_BH_PUT_DATA(bh);
} else
- need_lock_write = false;
- need_to_zap_buffers = false;
+ need_lock_write = 0;
+ need_to_zap_buffers = 0;
}
/* that's why it's called fast path */
@@ -1399,7 +1399,7 @@
/* disk voting */
LOG_TRACE_STR ("Disk vote");
- *disk_vote = true;
+ *disk_vote = 1;
status = ocfs_disk_request_vote (osb, lock_id, lock_type, flags, &vote_map, &lockseqnum, 5000, inode, &open_map);
if (status < 0) {
if (status != -EAGAIN)
@@ -1480,7 +1480,7 @@
if (lockres->readonly_map == 0ULL)
return status;
- status = ocfs_drop_readonly_cache_lock(osb, inode, false);
+ status = ocfs_drop_readonly_cache_lock(osb, inode, 0);
return status;
}
Modified: trunk/src/extmap.c
===================================================================
--- trunk/src/extmap.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/extmap.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -31,10 +31,10 @@
/* Crazy wacky extent map stuff */
/* works ok in userland debugocfs stuff too */
-static bool ocfs_extent_map_add (ocfs_extent_map * map, __s64 virtual, __s64 physical, __s64 sectors);
+static int ocfs_extent_map_add (ocfs_extent_map * map, __s64 virtual, __s64 physical, __s64 sectors);
static void ocfs_extent_map_remove (ocfs_extent_map * map, __s64 virtual, __s64 sectors);
-static bool ocfs_extent_map_lookup (ocfs_extent_map *map, __s64 virtual, __s64 *physical, __s64 *sectors, __u32 *index);
-static bool ocfs_extent_map_next_entry (ocfs_extent_map *map, __u32 index, __s64 *virtual, __s64 *physical, __s64 *sectors);
+static int ocfs_extent_map_lookup (ocfs_extent_map *map, __s64 virtual, __s64 *physical, __s64 *sectors, __u32 *index);
+static int ocfs_extent_map_next_entry (ocfs_extent_map *map, __u32 index, __s64 *virtual, __s64 *physical, __s64 *sectors);
/*
* ocfs_extent_map_init()
@@ -47,7 +47,7 @@
OCFS_ASSERT (map != NULL);
spin_lock_init(&(map->lock));
map->count = 0;
- map->initialized = true;
+ map->initialized = 1;
INIT_LIST_HEAD(&map->head);
LOG_EXIT ();
@@ -80,7 +80,7 @@
map->count);
map->count = 0;
}
- map->initialized = false;
+ map->initialized = 0;
}
spin_unlock(&(map->lock));
}
@@ -128,12 +128,12 @@
*
* Must call this with spinlock already held!
*/
-static bool ocfs_coalesce_extent_map_entry (ocfs_extent_map * map, __s64 virtual, __s64 physical, __s64 sectors)
+static int ocfs_coalesce_extent_map_entry (ocfs_extent_map * map, __s64 virtual, __s64 physical, __s64 sectors)
{
struct list_head *iter, *tmpiter;
ocfs_extent *tmp, *victim;
int voverlap, loverlap;
- bool ret = false;
+ int ret = 0;
LOG_ENTRY ();
@@ -155,7 +155,7 @@
victim = NULL;
list_for_each_safe(iter, tmpiter, &map->head) {
- bool assimilate = false;
+ int assimilate = 0;
tmp = list_entry (iter, ocfs_extent, list);
voverlap =
@@ -177,7 +177,7 @@
break;
case FULLY_CONTAINED: /* already fully accounted for, done */
- ret = true;
+ ret = 1;
goto bail;
break;
@@ -185,43 +185,43 @@
break;
case LEFT_ADJACENT: /* add new left part to found entry */
- assimilate = true;
+ assimilate = 1;
sectors += tmp->sectors;
- ret = true;
+ ret = 1;
break;
case LEFT_OVERLAP: /* new physical/virtual ==> old end */
/* must be same distance from edge */
if ((tmp->virtual - virtual) == (tmp->physical - physical)) {
- assimilate = true;
+ assimilate = 1;
sectors = tmp->sectors + (tmp->virtual - virtual);
- ret = true;
+ ret = 1;
}
break;
case FULLY_CONTAINING: /* completely take over this entry */
- assimilate = true;
- ret = true;
+ assimilate = 1;
+ ret = 1;
break;
case RIGHT_OVERLAP: /* old physical/virtual ==> new end */
/* must be same distance from edge */
if ((virtual - tmp->virtual) == (physical - tmp->physical)) {
- assimilate = true;
+ assimilate = 1;
sectors += virtual - tmp->virtual;
virtual = tmp->virtual;
physical = tmp->physical;
//KASEY??? tmp->sectors = 0; /* mark for deletion */
- ret = true;
+ ret = 1;
}
break;
case RIGHT_ADJACENT: /* add new right part to found entry */
- assimilate = true;
+ assimilate = 1;
virtual = tmp->virtual;
physical = tmp->physical;
sectors += tmp->sectors;
- ret = true;
+ ret = 1;
break;
}
@@ -253,12 +253,12 @@
* ocfs_extent_map_add()
*
*/
-static bool ocfs_extent_map_add (ocfs_extent_map * map, __s64 virtual, __s64 physical, __s64 sectors)
+static int ocfs_extent_map_add (ocfs_extent_map * map, __s64 virtual, __s64 physical, __s64 sectors)
{
ocfs_extent *ext, *tmp;
- bool ret = false;
+ int ret = 0;
struct list_head *iter, *tmpiter;
- bool added;
+ int added;
LOG_ENTRY ();
@@ -272,7 +272,7 @@
if (ocfs_coalesce_extent_map_entry (map, virtual, physical, sectors)) {
LOG_TRACE_STR ("Successfully coalesced map entry");
- ret = true;
+ ret = 1;
goto release_spinlock;
}
@@ -285,12 +285,12 @@
ext->physical = physical;
ext->sectors = sectors;
- added=false;
+ added = 0;
list_for_each_safe(iter, tmpiter, &map->head) {
tmp = list_entry (iter, ocfs_extent, list);
if (ext->virtual < tmp->virtual) {
list_add_tail(&ext->list, iter);
- added=true;
+ added = 1;
break;
}
}
@@ -298,7 +298,7 @@
list_add_tail(&ext->list, &map->head);
map->count++;
- ret = true;
+ ret = 1;
release_spinlock:
spin_unlock(&(map->lock));
@@ -352,11 +352,11 @@
* ocfs_extent_map_lookup()
*
*/
-static bool ocfs_extent_map_lookup (ocfs_extent_map *map, __s64 virtual, __s64 *physical, __s64 *sectors, __u32 *index)
+static int ocfs_extent_map_lookup (ocfs_extent_map *map, __s64 virtual, __s64 *physical, __s64 *sectors, __u32 *index)
{
struct list_head *iter, *tmpiter;
ocfs_extent *tmp;
- bool ret = false;
+ int ret = 0;
__s64 hi, lo, delta;
LOG_ENTRY ();
@@ -377,7 +377,7 @@
if (virtual >= lo && virtual < hi) {
*physical = tmp->physical + delta;
*sectors = tmp->sectors - delta;
- ret = true;
+ ret = 1;
break;
}
(*index)++;
@@ -393,11 +393,11 @@
* ocfs_extent_map_next_entry()
*
*/
-static bool ocfs_extent_map_next_entry (ocfs_extent_map *map, __u32 index, __s64 *virtual, __s64 *physical, __s64 *sectors)
+static int ocfs_extent_map_next_entry (ocfs_extent_map *map, __u32 index, __s64 *virtual, __s64 *physical, __s64 *sectors)
{
struct list_head *iter, *tmpiter;
ocfs_extent *tmp;
- bool ret = false;
+ int ret = 0;
LOG_ENTRY ();
@@ -421,7 +421,7 @@
*virtual = tmp->virtual;
*physical = tmp->physical;
*sectors = tmp->sectors;
- ret = true;
+ ret = 1;
break;
}
@@ -498,9 +498,9 @@
* retrieved, decoded and updated in the extent map.
*
*/
-bool ocfs_get_next_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __u32 RunIndex, __s64 * Vbo, __s64 * Lbo, __u32 * SectorCount)
+int ocfs_get_next_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __u32 RunIndex, __s64 * Vbo, __s64 * Lbo, __u32 * SectorCount)
{
- bool Results;
+ int Results;
__s64 LiSectorCount;
LOG_ENTRY ();
@@ -513,7 +513,7 @@
if (LiSectorCount > 0x00000000ffffffffLL) {
/* overflow */
- Results = false;
+ Results = 0;
*SectorCount = 0xffffffffUL;
} else {
*SectorCount = ((__u32)(LiSectorCount & 0xFFFFFFFFULL)) << OCFS_LOG_SECTOR_SIZE;
@@ -530,9 +530,9 @@
*
* Returns true if entry available in the extent map, false otherwise.
*/
-bool ocfs_lookup_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 * Lbo, __u64 * SectorCount, __u32 * Index)
+int ocfs_lookup_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 * Lbo, __u64 * SectorCount, __u32 * Index)
{
- bool ret;
+ int ret;
__s64 LiLbo = 0;
__s64 LiSectorCount = 0;
__u64 remainder = 0;
@@ -550,7 +550,7 @@
*Lbo += remainder;
}
} else {
- ret = false;
+ ret = 0;
*Lbo = 0;
}
@@ -582,7 +582,7 @@
__s64 tempVbo;
__s64 tempLbo;
__u64 tempSize;
- bool Ret;
+ int Ret;
int j;
LOG_ENTRY ();
@@ -666,9 +666,9 @@
*
* Returns true on success, false otherwise.
*/
-bool ocfs_add_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 Lbo, __u64 ByteCount)
+int ocfs_add_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 Lbo, __u64 ByteCount)
{
- bool ret;
+ int ret;
LOG_ENTRY ();
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/file.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -93,7 +93,7 @@
int ret =0, err = 0, status = 0;
int mode = file->f_flags;
ocfs_super *osb = NULL;
- bool bAcquiredOIN = false;
+ int bAcquiredOIN = 0;
struct buffer_head *fe_bh = NULL;
int truncate_pages = 0;
@@ -112,7 +112,7 @@
* inode, and therefore we are given the oin too */
down(&inode->i_sem);
down (&(OCFS_I(inode)->priv_sem));
- bAcquiredOIN = true;
+ bAcquiredOIN = 1;
/* If the in use flag is set, forget about it. This will go
* eventually. */
@@ -212,7 +212,7 @@
if (bAcquiredOIN) {
up (&(OCFS_I(inode)->priv_sem));
- bAcquiredOIN = false;
+ bAcquiredOIN = 0;
}
if (truncate_pages) {
@@ -230,7 +230,7 @@
leave:
if (bAcquiredOIN) {
up (&(OCFS_I(inode)->priv_sem));
- bAcquiredOIN = false;
+ bAcquiredOIN = 0;
}
if (fe_bh)
@@ -266,7 +266,7 @@
ocfs_file *ofile = NULL;
ocfs_super * osb;
struct dentry *dentry;
- bool last_close = false;
+ int last_close = 0;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", inode, file,
file->f_dentry->d_name.len, file->f_dentry->d_name.name);
@@ -305,7 +305,7 @@
down (&(OCFS_I(inode)->priv_sem));
OCFS_I(inode)->open_hndl_cnt--;
if (!OCFS_I(inode)->open_hndl_cnt)
- last_close = true;
+ last_close = 1;
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
up (&(OCFS_I(inode)->priv_sem));
@@ -412,10 +412,10 @@
int tmpstat;
ocfs_file_entry *fileEntry = NULL;
__u64 dirOffset = 0;
- bool bAcquiredLock = false;
+ int bAcquiredLock = 0;
__u64 lockId = 0;
__u32 lockFlags = 0, locktype = 0;
- bool bCacheLock = false;
+ int bCacheLock = 0;
struct buffer_head *bh = NULL;
ocfs_journal_handle *handle = NULL;
int flags = 0;
@@ -440,7 +440,7 @@
/* Acquire the Lock using TCP/IP and disk based locking */
if ((DISK_LOCK_FILE_LOCK (fileEntry) == OCFS_DLM_ENABLE_CACHE_LOCK) &&
(DISK_LOCK_CURRENT_MASTER (fileEntry) == osb->node_num)) {
- bCacheLock = true;
+ bCacheLock = 1;
}
/* now we always take an UPDATE lock */
@@ -455,8 +455,8 @@
goto leave;
}
/* we want this transaction to return quickly. */
- ocfs_handle_set_checkpoint(handle, false);
- ocfs_handle_set_sync(handle, false);
+ ocfs_handle_set_checkpoint(handle, 0);
+ ocfs_handle_set_sync(handle, 0);
locktype = bCacheLock ? OCFS_DLM_ENABLE_CACHE_LOCK : OCFS_DLM_EXCLUSIVE_LOCK;
status = ocfs_acquire_lock (osb, lockId, locktype, lockFlags,
@@ -466,7 +466,7 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- bAcquiredLock = true;
+ bAcquiredLock = 1;
status = ocfs_journal_access(handle, bh, OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
@@ -511,7 +511,7 @@
} else {
ocfs_journal_add_lock(handle, locktype, lockFlags,
bh, inode);
- bAcquiredLock = false;
+ bAcquiredLock = 0;
ocfs_commit_trans(handle);
}
@@ -542,7 +542,7 @@
ssize_t ocfs_file_write (struct file *filp, const char *buf, size_t count, loff_t * ppos)
{
int ret = 0;
- int saAcquired = false, writingAtEOF = false;
+ int saAcquired = 0, writingAtEOF = 0;
ocfs_super *osb = NULL;
struct inode *inode = filp->f_dentry->d_inode;
int status;
@@ -601,7 +601,7 @@
} else {
LOG_TRACE_STR
("there are other readers, but you're the first writer\n");
- saAcquired = true;
+ saAcquired = 1;
OCFS_SET_FLAG(OCFS_I(inode)->oin_flags, OCFS_OIN_OPEN_FOR_WRITE);
}
}
@@ -626,14 +626,14 @@
if ((newsize > inode->i_size) || (filp->f_flags & O_APPEND)) {
down(&osb->extend_sem);
- writingAtEOF = true;
+ writingAtEOF = 1;
if (filp->f_flags & O_APPEND)
newsize = count + inode->i_size;
/* did someone beat us to it? */
if (newsize <= inode->i_size) {
- writingAtEOF = false;
+ writingAtEOF = 0;
up(&osb->extend_sem);
}
}
@@ -779,9 +779,9 @@
ocfs_file_entry *fe = NULL;
__u64 lockId = 0;
__u32 lockFlags = 0, locktype = 0;
- bool bFileLockAcquired = false;
- bool bAcquiredLock = false;
- bool bCacheLock = false;
+ int bFileLockAcquired = 0;
+ int bAcquiredLock = 0;
+ int bCacheLock = 0;
__u64 new_alloc_size;
struct buffer_head *bh = NULL;
int flags = 0;
@@ -816,11 +816,11 @@
lockId = fe->this_sector;
lockFlags = FLAG_FILE_TRUNCATE;
- bFileLockAcquired = true;
+ bFileLockAcquired = 1;
if ((DISK_LOCK_FILE_LOCK (fe) == OCFS_DLM_ENABLE_CACHE_LOCK)
&& (DISK_LOCK_CURRENT_MASTER (fe) == osb->node_num)) {
- bCacheLock = true;
+ bCacheLock = 1;
}
OCFS_BH_PUT_DATA(bh);
@@ -832,7 +832,7 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- bAcquiredLock = true;
+ bAcquiredLock = 1;
/* add this fe to the journal transaction */
status = ocfs_journal_access(handle, bh, OCFS_JOURNAL_ACCESS_WRITE);
@@ -939,11 +939,11 @@
__u64 numClustersAlloc = 0;
__u64 lockId = 0;
__u32 lockFlags = 0, locktype = 0;
- bool bFileLockAcquired = false;
- bool bAcquiredLock = false;
+ int bFileLockAcquired = 0;
+ int bAcquiredLock = 0;
__u64 actualDiskOffset = 0;
__u64 actualLength = 0;
- bool bCacheLock = false;
+ int bCacheLock = 0;
struct buffer_head *bh = NULL;
int flags = 0;
ocfs_journal_handle *handle = NULL;
@@ -985,8 +985,8 @@
}
/* we don't want to checkpoint extends. */
- ocfs_handle_set_checkpoint(handle, false);
- ocfs_handle_set_sync(handle, false);
+ ocfs_handle_set_checkpoint(handle, 0);
+ ocfs_handle_set_sync(handle, 0);
/* Grab a lock on the entry found if we have more than
* 1 extents and also make this node the master*/
@@ -995,11 +995,11 @@
/* now we always take an EXTEND lock */
lockId = fileEntry->this_sector;
lockFlags = FLAG_FILE_EXTEND;
- bFileLockAcquired = true;
+ bFileLockAcquired = 1;
if ((DISK_LOCK_FILE_LOCK (fileEntry) == OCFS_DLM_ENABLE_CACHE_LOCK) &&
(DISK_LOCK_CURRENT_MASTER (fileEntry) == osb->node_num)) {
- bCacheLock = true;
+ bCacheLock = 1;
}
OCFS_BH_PUT_DATA(bh);
brelse(bh);
@@ -1012,7 +1012,7 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- bAcquiredLock = true;
+ bAcquiredLock = 1;
} else {
handle = passed_handle;
}
@@ -1058,7 +1058,7 @@
}
status = ocfs_find_space(osb, allocSize, &bitmapOffset,
- &numClustersAlloc, false, handle);
+ &numClustersAlloc, 0, handle);
if (status < 0) {
OCFS_BH_PUT_DATA(bh);
if (status != -ENOSPC && status != -EINTR)
@@ -1150,7 +1150,7 @@
ocfs_journal_add_lock(handle, locktype,
lockFlags, bh, inode);
- bAcquiredLock = false;
+ bAcquiredLock = 0;
ocfs_commit_trans(handle);
}
@@ -1193,7 +1193,7 @@
ocfs_super *osb = NULL;
__u64 parentOff, fileOff;
struct super_block *sb = inode->i_sb;
- bool extended = false;
+ int extended = 0;
int needs_trunc = 0;
LOG_ENTRY_ARGS ("(0x%p, '%*s')\n", dentry,
@@ -1271,7 +1271,7 @@
else {
status = ocfs_extend_file(osb, newsize, fileOff, NULL,
inode, attr);
- extended = true;
+ extended = 1;
}
if (status < 0) {
if (status != -EINTR)
Modified: trunk/src/hash.c
===================================================================
--- trunk/src/hash.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/hash.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -791,7 +791,7 @@
*/
struct inode *ocfs_inode_hash_lookup(ocfs_super *osb,
__u64 voteoff,
- bool reverse)
+ int reverse)
{
ocfs_inode_num *inum = NULL;
ocfs_inode_hash *h = &osb->inode_hash;
Modified: trunk/src/heartbeat.c
===================================================================
--- trunk/src/heartbeat.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/heartbeat.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -48,7 +48,7 @@
*
* Returns 0 if success, < 0 if error.
*/
-int ocfs_nm_heart_beat (ocfs_super * osb, __u32 flag, bool read_publish)
+int ocfs_nm_heart_beat (ocfs_super * osb, __u32 flag, int read_publish)
{
int status = 0;
ocfs_publish *publish = NULL;
@@ -74,7 +74,7 @@
publish = (ocfs_publish *) OCFS_BH_GET_DATA_WRITE(*pub_bh); /* write */
if ((publish->dirty) && (!osb->publish_dirty)) {
LOG_TRACE_STR(("NMThread reads the bit as dirty"));
- publish->dirty = false;
+ publish->dirty = 0;
}
/* Write the current time in local node's publish sector */
OcfsQuerySystemTime (&publish->time);
@@ -116,7 +116,7 @@
* the live nodes in the publishmap.
*
*/
-void ocfs_update_publish_map (ocfs_super * osb, struct buffer_head *bhs[], bool first_time)
+void ocfs_update_publish_map (ocfs_super * osb, struct buffer_head *bhs[], int first_time)
{
ocfs_publish *publish;
ocfs_vol_node_map *node_map;
Modified: trunk/src/inc/io.h
===================================================================
--- trunk/src/inc/io.h 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/inc/io.h 2004-05-07 22:37:57 UTC (rev 906)
@@ -61,7 +61,7 @@
int ocfs_write_dirnode(ocfs_super * osb, struct buffer_head *bhs[], struct inode *hdr_inode);
-int ocfs_read_dirnode(ocfs_super * osb, __u64 off, bool sync, struct buffer_head *bhs[], struct inode *hdr_inode);
+int ocfs_read_dirnode(ocfs_super * osb, __u64 off,int sync, struct buffer_head *bhs[], struct inode *hdr_inode);
void ocfs_end_buffer_io_sync (struct buffer_head *bh,
Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/inc/ocfs.h 2004-05-07 22:37:57 UTC (rev 906)
@@ -99,11 +99,7 @@
#include "journal.h"
-typedef enum { false = 0, true = 1 } ocfs_bool;
-/* This should be removed and all old code fixed to just use ocfs_bool */
-typedef ocfs_bool bool;
-
#define OCFS_POINTER_SIZE (sizeof(void *))
#ifdef __LP64__
@@ -594,7 +590,7 @@
do { \
if (!_flg) { \
down (_sem); \
- _flg = true; \
+ _flg = 1; \
} \
} while (0)
@@ -602,7 +598,7 @@
do { \
if (_flg) { \
up (_sem); \
- _flg = false; \
+ _flg = 0; \
} \
} while (0)
@@ -736,15 +732,15 @@
(((ext)->disk_off + (ext)->num_bytes) == (off))
#define OCFS_IS_VALID_EXTENT(__ext, __typ) ({ \
- bool __ret = false; \
+ int __ret = 0; \
switch (__typ) { \
case EXTENT_HEADER: \
if (IS_VALID_EXTENT_HEADER(__ext)) \
- __ret = true; \
+ __ret = 1; \
break; \
case EXTENT_DATA: \
if (IS_VALID_EXTENT_DATA(__ext)) \
- __ret = true; \
+ __ret = 1; \
break; \
} \
__ret; \
@@ -1512,7 +1508,7 @@
{
spinlock_t lock;
__u32 count;
- bool initialized;
+ int initialized;
struct list_head head;
__u32 next_idx;
struct list_head *next_ptr;
@@ -1605,7 +1601,7 @@
/* These fields are protected by priv_sem */
struct semaphore priv_sem;
__u32 open_hndl_cnt;
- bool needs_verification;
+ int needs_verification;
__u64 chng_seq_num;
ocfs_extent_map map;
__s64 alloc_size;
@@ -1813,10 +1809,10 @@
struct semaphore cfg_lock;
BARF_BARF_BARF *node_cfg_info[OCFS_MAXIMUM_NODES];
__u64 cfg_seq_num;
- bool cfg_initialized;
+ int cfg_initialized;
__u32 num_cfg_nodes;
__u32 node_num;
- bool reclaim_id; /* reclaim the original node number*/
+ int reclaim_id; /* reclaim the original node number*/
__u8 hbm;
__u32 hbt;
__u32 sect_size;
@@ -1824,20 +1820,15 @@
__u32 cluster_size_bits;
__u32 dir_alloc_bits;
__u32 file_alloc_bits;
- bool needs_flush;
+ int needs_flush;
ocfs_alloc_bm cluster_bitmap;
-#if 0
- /* eventually we should want to "cache" these too */
- ocfs_alloc_bm file_alloc_bitmap;
- ocfs_alloc_bm dir_alloc_bitmap;
-#endif
__u32 max_dir_node_ent;
ocfs_vol_state vol_state;
struct semaphore recovery_lock;
spinlock_t recovery_map_lock;
__u32 recovery_map;
- bool disable_recovery;
+ int disable_recovery;
atomic_t num_recovery_threads;
struct semaphore node_alloc_sem;
struct semaphore vol_alloc_sem;
@@ -1849,14 +1840,13 @@
atomic_t nm_init;
wait_queue_head_t nm_init_event;
__u32 prealloc_lock;
-// __u8 *cfg_prealloc;
struct buffer_head **cfg_bhs;
__u32 cfg_len;
__u32 cfg_numblocks;
struct semaphore publish_lock; /* protects r/w to publish sector */
atomic_t node_req_vote; /* set when node's vote req pending */
struct semaphore trans_lock; /* serializes transactions */
- bool publish_dirty;
+ int publish_dirty;
struct list_head needs_flush_head;
wait_queue_head_t flush_event;
atomic_t flush_event_woken;
@@ -1865,7 +1855,7 @@
spinlock_t clean_buffer_lock;
struct list_head lock_recovery_lists[OCFS_MAXIMUM_NODES];
__u64 last_publ_seq_num[OCFS_MAXIMUM_NODES];
- bool have_local_alloc;
+ int have_local_alloc;
/* Protected by the trans_lock. */
struct buffer_head *local_alloc_bh;
ocfs_inode_hash inode_hash;
@@ -1908,7 +1898,7 @@
char *node_name; /* human readable node identification */
char *cluster_name; /* unused */
ocfs_comm_info comm_info; /* ip address, etc for listener */
- bool comm_info_read; /* ipc info loaded from config file */
+ int comm_info_read; /* ipc info loaded from config file */
__u8 hbm;
spinlock_t comm_seq_lock; /* protects comm_seq_num */
__u64 comm_seq_num; /* local node seq num used in ipcdlm */
@@ -1938,7 +1928,7 @@
{
__u32 dlm_msg_size;
__u16 version;
- bool init;
+ int init;
struct socket *send_sock;
struct socket *recv_sock;
struct completion complete;
@@ -1978,7 +1968,7 @@
{
__u64 time; // NUMBER RANGE(0,ULONG_LONG_MAX)
__s32 vote; // BOOL
- bool dirty; // BOOL
+ __u32 dirty; // BOOL
__u32 vote_type; // FILEFLAG
__u64 vote_map; // NODEBITMAP
__u64 publ_seq_num; // NUMBER RANGE(0,ULONG_LONG_MAX)
@@ -1986,7 +1976,7 @@
__u8 hbm[OCFS_MAXIMUM_NODES]; // UNUSED
/* last seq num used in comm voting */
__u64 comm_seq_num; // NUMBER RANGE(0,ULONG_LONG_MAX)
- bool mounted; /* used for journaling */
+ __u32 mounted; /* used for journaling */
__u64 fe_off; /* needed to create inodes. */
}
OCFS_GCC_ATTR_PACKALGN
@@ -2020,7 +2010,7 @@
{
ocfs_disk_lock disk_lock; // DISKLOCK
__u8 signature[8]; // CHAR[8]
- bool local_ext; // BOOL
+ __u32 local_ext; // BOOL
__u8 next_free_ext; // NUMBER RANGE(0,OCFS_MAX_FILE_ENTRY_EXTENTS)
__s8 next_del; // DIRNODEINDEX
__s32 granularity; // NUMBER RANGE(-1,3)
Modified: trunk/src/inc/proto.h
===================================================================
--- trunk/src/inc/proto.h 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/inc/proto.h 2004-05-07 22:37:57 UTC (rev 906)
@@ -31,7 +31,7 @@
int ocfs_free_extents_for_truncate (ocfs_super * osb, ocfs_file_entry * FileEntry, ocfs_journal_handle *handle, struct inode *inode);
int ocfs_lookup_file_allocation (ocfs_super * osb, __s64 Vbo, __s64 * Lbo, __u32 sectors, u32 *sector_count, struct inode *inode);
int ocfs_get_leaf_extent (ocfs_super * osb, ocfs_file_entry * FileEntry, __s64 Vbo, struct buffer_head **data_extent_bh, struct inode *inode);
-int ocfs_find_contiguous_space_from_bitmap (ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, bool sysfile, struct buffer_head *lock_bh, struct inode *bitmap_inode);
+int ocfs_find_contiguous_space_from_bitmap (ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count,int sysfile, struct buffer_head *lock_bh, struct inode *bitmap_inode);
int ocfs_alloc_node_block (ocfs_super * osb, __u64 FileSize, __u64 * DiskOffset, __u64 * file_off, __u32 NodeNum, __u32 Type, ocfs_journal_handle *handle);
int ocfs_free_directory_block (ocfs_super * osb, ocfs_file_entry * fe, ocfs_journal_handle *handle, struct inode *inode);
int ocfs_free_file_extents (ocfs_super * osb, struct buffer_head *fe_bh, ocfs_journal_handle *handle, struct inode *inode);
@@ -46,14 +46,14 @@
int ocfs_disk_reset_voting (ocfs_super * osb, __u64 lock_id, __u32 lock_type);
void ocfs_init_dlm_msg (ocfs_super * osb, ocfs_dlm_msg * dlm_msg, __u32 msg_len, __u32 type);
-int ocfs_update_lockres (ocfs_super * osb, __u64 lock_id, struct buffer_head **bh, __u32 * updated, __u32 timeout, struct inode *inode, bool reread);
+int ocfs_update_lockres (ocfs_super * osb, __u64 lock_id, struct buffer_head **bh, __u32 * updated, __u32 timeout, struct inode *inode,int reread);
int ocfs_acquire_lockres (ocfs_lock_res * lockres, __u32 timeout);
void ocfs_release_lockres (ocfs_lock_res * lockres);
void ocfs_init_lockres (ocfs_super * osb, struct inode *inode);
int ocfs_acquire_lock (ocfs_super * osb, __u64 lock_id, __u32 lock_type, __u32 flags, struct buffer_head **bh, struct inode *inode);
int ocfs_release_lock (ocfs_super * osb, __u64 lock_id, __u32 lock_type, __u32 flags, struct buffer_head *bh, struct inode *inode);
-int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh, bool *disk_vote, struct inode *inode);
+int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh,int *disk_vote, struct inode *inode);
void ocfs_process_one_vote_reply(ocfs_super *osb, ocfs_vote_reply_ctxt *ctxt, __u32 node_num);
int ocfs_break_cache_lock_zap_buffers(ocfs_super * osb, struct inode * inode);
void ocfs_compute_dlm_stats(int status, int vote_status, ocfs_dlm_stats *stats);
@@ -61,16 +61,16 @@
int ocfs_wait_for_lock_release (ocfs_super * osb, __u64 offset, __u32 time_to_wait, __u32 lock_type, struct inode *inode);
int ocfs_update_master_on_open (ocfs_super * osb, struct inode *inode, ocfs_journal_handle *handle);
-int ocfs_extend_system_file (ocfs_super * osb, __u32 FileId, __u64 FileSize, struct buffer_head *fe_bh, ocfs_journal_handle *handle, bool zero);
+int ocfs_extend_system_file (ocfs_super * osb, __u32 FileId, __u64 FileSize, struct buffer_head *fe_bh, ocfs_journal_handle *handle,int zero);
void ocfs_extent_map_init (ocfs_extent_map * map);
void ocfs_extent_map_destroy (ocfs_extent_map * map);
void ocfs_delete_all_extent_maps (ocfs_super * osb, struct inode * oin);
void ocfs_remove_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __u32 ByteCount);
-bool ocfs_get_next_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __u32 RunIndex, __s64 * Vbo, __s64 * Lbo, __u32 * SectorCount);
-bool ocfs_lookup_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 * Lbo, __u64 * SectorCount, __u32 * Index);
+int ocfs_get_next_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __u32 RunIndex, __s64 * Vbo, __s64 * Lbo, __u32 * SectorCount);
+int ocfs_lookup_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 * Lbo, __u64 * SectorCount, __u32 * Index);
int ocfs_update_extent_map (ocfs_super * osb, ocfs_extent_map * Map, void *Buffer, __s64 * localVbo, __u64 * remainingLength, ocfs_ext_flag Flag);
-bool ocfs_add_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 Lbo, __u64 ByteCount);
+int ocfs_add_extent_map_entry (ocfs_super * osb, ocfs_extent_map * Map, __s64 Vbo, __s64 Lbo, __u64 ByteCount);
@@ -94,7 +94,7 @@
#endif
int ocfs_inode_init_private(struct inode *inode);
-void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode, bool create_ino);
+void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode,int create_ino);
void ocfs_read_locked_inode (struct inode *inode, ocfs_find_inode_args *args);
void ocfs_read_inode2 (struct inode *inode, void *opaque);
void ocfs_read_inode (struct inode *inode);
@@ -187,8 +187,8 @@
void ocfs_sync_blockdev(struct super_block *sb);
int ocfs_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
-int ocfs_nm_heart_beat (ocfs_super * osb, __u32 flag, bool read_publish);
-void ocfs_update_publish_map (ocfs_super * osb, struct buffer_head *bhs[], bool first_time);
+int ocfs_nm_heart_beat (ocfs_super * osb, __u32 flag,int read_publish);
+void ocfs_update_publish_map (ocfs_super * osb, struct buffer_head *bhs[],int first_time);
int ocfs_send_dlm_request_msg (ocfs_super * osb, __u64 lock_id, __u32 lock_type, __u32 flags, __u64 * vote_map, __u64 *openmap, struct inode *inode, int *vote_status);
@@ -197,8 +197,8 @@
int ocfs_init_udp_sock (struct socket **send_sock, struct socket **recv_sock);
int ocfs_recv_udp_msg (ocfs_recv_ctxt * recv_ctxt);
int ocfs_send_dismount_msg (ocfs_super * osb, __u64 vote_map);
-int ocfs_send_vote_reply (ocfs_super * osb, ocfs_dlm_msg * dlm_msg, __u32 vote_status, bool inode_open);
-int ocfs_drop_readonly_cache_lock(ocfs_super *osb, struct inode *inode, bool yield);
+int ocfs_send_vote_reply (ocfs_super * osb, ocfs_dlm_msg * dlm_msg, __u32 vote_status,int inode_open);
+int ocfs_drop_readonly_cache_lock(ocfs_super *osb, struct inode *inode,int yield);
void ocfs_initialize_bitmap (ocfs_alloc_bm * bitmap, __u32 validbits, __u32 allocbits);
@@ -257,7 +257,7 @@
int ocfs_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);
int ocfs_symlink (struct inode *dir, struct dentry *dentry, const char *symname);
-int ocfs_find_files_on_disk (ocfs_super * osb, __u64 parent_off, struct qstr * file_name, struct buffer_head ** fe_bh, ocfs_file * ofile, struct inode *inode, bool take_lock);
+int ocfs_find_files_on_disk (ocfs_super * osb, __u64 parent_off, struct qstr * file_name, struct buffer_head ** fe_bh, ocfs_file * ofile, struct inode *inode,int take_lock);
int ocfs_write_force_dir_node (ocfs_super * osb, struct buffer_head *bhs[], __s32 idx);
int ocfs_insert_file (ocfs_super * osb, ocfs_file_entry * InsertEntry, struct buffer_head *lock_bh, struct buffer_head **insert_bh, ocfs_journal_handle * handle, struct inode *dir_inode, struct inode *file_inode);
int ocfs_reindex_dir_node (ocfs_super * osb, __u64 DirNodeOffset, struct buffer_head *bhs[], ocfs_journal_handle *handle, struct inode *dir_inode);
@@ -269,7 +269,7 @@
void ocfs_recover_oin_locks(ocfs_super *osb, __u32 node_num);
int ocfs_process_vote (ocfs_super * osb, ocfs_vote_request_ctxt *ctxt);
-void ocfs_inc_inode_seq(ocfs_super *osb, struct inode *inode, bool sync_buffers);
+void ocfs_inc_inode_seq(ocfs_super *osb, struct inode *inode,int sync_buffers);
int ocfs_follow_link(struct dentry *dentry, struct nameidata *nd);
@@ -278,9 +278,9 @@
int ocfs_load_local_alloc(ocfs_super *osb);
void ocfs_shutdown_local_alloc(ocfs_super *osb,
struct buffer_head **local_alloc_bh,
- bool sync,
- bool in_recovery);
-int ocfs_find_space(ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count, bool sysfile, ocfs_journal_handle *handle);
+ int sync,
+ int in_recovery);
+int ocfs_find_space(ocfs_super * osb, __u64 file_size, __u64 * cluster_off, __u64 * cluster_count,int sysfile, ocfs_journal_handle *handle);
int ocfs_recover_local_alloc(ocfs_super *osb, int node_num);
void ocfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate);
@@ -300,7 +300,7 @@
struct buffer_head *fe_bh);
struct inode *ocfs_inode_hash_lookup(ocfs_super *osb,
__u64 voteoff,
- bool reverse);
+ int reverse);
ino_t ocfs_inode_hash_lookup_ino(ocfs_super *osb, __u64 voteoff);
void ocfs_init_timeout(ocfs_timeout *to);
Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/inode.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -216,7 +216,7 @@
if (feoff < osb->vol_layout.root_start_off)
flags |= OCFS_FIND_INODE_FLAG_SYSFILE;
- inode = ocfs_inode_hash_lookup(osb, voteoff, false);
+ inode = ocfs_inode_hash_lookup(osb, voteoff, 0);
if (!inode) {
/* we should put this guy in the hash now... */
LOG_TRACE_STR("calling iget4");
@@ -360,7 +360,7 @@
* ocfs_populate_inode()
*
*/
-void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode, bool create_ino)
+void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode, int create_ino)
{
struct super_block *sb;
ocfs_super *osb;
@@ -494,7 +494,7 @@
ocfs_file_entry *fe = NULL;
struct buffer_head *bh = NULL;
int status;
- bool sysfile = false, skip_bind = false;
+ int sysfile = 0, skip_bind = 0;
LOG_ENTRY_ARGS ("(0x%p, 0x%p)\n", inode, args);
@@ -559,7 +559,7 @@
mode |= S_IFREG;
break;
}
- ocfs_populate_inode (inode, fe, mode, false);
+ ocfs_populate_inode (inode, fe, mode, 0);
/* eventually this case has to GO! */
voteoff = S_ISDIR (mode) ? fe->u.child_dirnode : fe->this_sector;
@@ -567,7 +567,6 @@
if (voteoff != args->voteoff)
BUG();
-skip_fe:
if (sysfile)
OCFS_SET_FLAG(OCFS_I(inode)->flags, OCFS_INODE_SYSFILE);
@@ -914,7 +913,7 @@
__s64 vbo = 0;
__s64 lbo = 0;
__u32 len;
- bool oin_locked = false;
+ int oin_locked = 0;
LOG_ENTRY_ARGS ("(0x%p, %ld, 0x%p, %d)\n", inode, iblock, bh_result,
create);
@@ -944,7 +943,7 @@
if (!(OCFS_I(inode)->oin_flags & OCFS_OIN_OPEN_FOR_DIRECTIO)) {
down(&(OCFS_I(inode)->priv_sem));
- oin_locked = true;
+ oin_locked = 1;
}
len = 1;
@@ -1309,8 +1308,8 @@
int nbhs;
int sector_size, sector_bits, sector_mask;
int ret = 0;
- bool large_io = false;
- bool inuse = false;
+ int large_io = 0;
+ int inuse = 0;
unsigned long blocks_end_cluster = 0;
loff_t saved_off;
size_t saved_size;
@@ -1351,7 +1350,7 @@
return err;
max_sectors = KIO_MAX_SECTORS;
- large_io = false;
+ large_io = 0;
#endif
#ifdef LARGEIOS
if ((*offp & 4095) || (size & 4095)) {
@@ -1364,12 +1363,12 @@
else {
if (!((unsigned long) buf & 4095)) {
/* yippie we are .. we can do 4kb size io's */
- large_io = true;
+ large_io = 1;
/* for 2.4.9 */
max_sectors = KIO_MAX_SECTORS / 8;
} else {
max_sectors = KIO_MAX_SECTORS;
- large_io = false;
+ large_io = 0;
}
}
@@ -1452,7 +1451,7 @@
new_iobuf = 0;
#endif
- inuse = true;
+ inuse = 1;
totalioblocks = 0;
while (size > 0) {
@@ -1522,7 +1521,7 @@
else
free_kiovec_sz(1, &iobuf, &nbhs);
#endif
- inuse = false;
+ inuse = 0;
totalioblocks = 0;
firstlogic = nextlogic;
firstphys = nextphys;
Modified: trunk/src/io.c
===================================================================
--- trunk/src/io.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/io.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -71,7 +71,7 @@
break;
default:
/* this will iget() the inode if non-NULL */
- retval = ocfs_inode_hash_lookup(osb, (top+idx) << 9, true);
+ retval = ocfs_inode_hash_lookup(osb, (top+idx) << 9, 1);
break;
}
return retval;
@@ -111,7 +111,7 @@
return status;
}
-int ocfs_read_dirnode(ocfs_super * osb, __u64 off, bool sync,
+int ocfs_read_dirnode(ocfs_super * osb, __u64 off, int sync,
struct buffer_head *bhs[], struct inode *hdr_inode)
{
int status, i, max, total=1;
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/journal.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -30,15 +30,15 @@
static int ocfs_checkpoint_handle(ocfs_journal_handle *handle);
static int ocfs_revoke_handle(ocfs_journal_handle *handle);
-static int ocfs_journal_toggle_mounted(ocfs_super *osb, int node_num, bool value);
-static bool ocfs_journal_get_mount_state(ocfs_super *osb, int node_num);
+static int ocfs_journal_toggle_mounted(ocfs_super *osb, int node_num, int value);
+static int ocfs_journal_get_mount_state(ocfs_super *osb, int node_num);
static int ocfs_reset_publish (ocfs_super * osb, __u64 node_num);
static int ocfs_journal_release_locks(ocfs_journal_handle *handle, int abort);
static int ocfs_force_read_journal(ocfs_super *osb, __u64 size,
struct inode *inode);
static int ocfs_recover_vol(struct _ocfs_super *osb, int node_num);
static int __ocfs_recovery_thread(void *arg);
-static int ocfs_commit_cache (ocfs_super * osb, bool data_flush);
+static int ocfs_commit_cache (ocfs_super * osb, int data_flush);
/* DO NOT EVER CALL THIS FUNCTION WITH A LOCKED BUFFER HEAD! */
ocfs_journal_handle * ocfs_start_trans(ocfs_super *osb, int max_buffs)
@@ -104,8 +104,8 @@
up(&osb->journal.commit_sem);
/* default handle flags! */
- ocfs_handle_set_sync(retval, true);
- ocfs_handle_set_checkpoint(retval, true);
+ ocfs_handle_set_sync(retval, 1);
+ ocfs_handle_set_checkpoint(retval, 1);
LOG_EXIT_PTR(retval);
return(retval);
@@ -318,7 +318,7 @@
handle_t *kern_handle;
transaction_t *kern_trans;
int retval, i;
- bool checkpoint, sync;
+ int checkpoint, sync;
ocfs_journal *journal;
ocfs_bitmap_free_head *commit_head, *abort_head;
@@ -334,7 +334,7 @@
checkpoint = handle->flags & OCFS_HANDLE_CHECKPOINT;
/* if you want to checkpoint, you MUST also sync. */
if (checkpoint)
- ocfs_handle_set_sync(handle, true);
+ ocfs_handle_set_sync(handle, 1);
sync = handle->flags & OCFS_HANDLE_SYNC;
LOG_TRACE_ARGS("Commiting %d blocks, checkpoint = %s, sync = %s\n",
@@ -409,7 +409,7 @@
* commit then we need to add it to our journals list
* so it can be done later */
list_add_tail(&(handle->h_list), &(journal->commited));
- osb->needs_flush = true;
+ osb->needs_flush = 1;
up(&journal->commit_sem);
}
@@ -459,7 +459,7 @@
int j;
ocfs_journal_copyout *co = NULL;
char *data;
- bool dirtied;
+ int dirtied;
LOG_ENTRY();
@@ -478,7 +478,7 @@
/* Ok, search the dirtied buffers list for this
* block. */
bh = NULL;
- dirtied = true;
+ dirtied = 1;
for(j = 0; j < handle->num_buffs; j++)
if (handle->buffs[j]->b_blocknr == co->blocknr) {
bh = handle->buffs[j];
@@ -499,7 +499,7 @@
if (bh == NULL)
BUG();
- dirtied = false;
+ dirtied = 0;
}
LOG_TRACE_ARGS("Aborting block %lu, forget=%u\n", co->blocknr,
@@ -617,7 +617,7 @@
int status = -1;
char *data;
int i;
- bool found = false;
+ int found = 0;
LOG_ENTRY_ARGS("(bh->b_blocknr=%lu, type=%d (\"%s\"), "
"bh->b_size = %hu)\n",
@@ -644,7 +644,7 @@
* call as that's when we know for sure it's clean. */
for(i = 0; i < handle->num_co; i++)
if (handle->co_buffs[i].blocknr == bh->b_blocknr) {
- found = true;
+ found = 1;
break;
}
@@ -1065,13 +1065,13 @@
}
/* true if mounted, false otherwise */
-static bool ocfs_journal_get_mount_state(ocfs_super *osb, int node_num)
+static int ocfs_journal_get_mount_state(ocfs_super *osb, int node_num)
{
int status = 0;
ocfs_publish *publish = NULL;
struct buffer_head *publish_bh = NULL;
__u64 offset = 0;
- bool retval = false;
+ int retval = 0;
int flags = 0;
LOG_ENTRY();
@@ -1102,7 +1102,7 @@
return(retval);
}
-static int ocfs_journal_toggle_mounted(ocfs_super *osb, int node_num, bool value)
+static int ocfs_journal_toggle_mounted(ocfs_super *osb, int node_num, int value)
{
int status = 0;
ocfs_publish *publish = NULL;
@@ -1150,7 +1150,7 @@
down (&(osb->publish_lock));
- retval = ocfs_journal_toggle_mounted(osb, node_num, true);
+ retval = ocfs_journal_toggle_mounted(osb, node_num, 1);
if (osb->node_num == node_num)
osb->check_mounted = 1;
@@ -1173,7 +1173,7 @@
if (osb->node_num == node_num)
osb->check_mounted = 0;
- retval = ocfs_journal_toggle_mounted(osb, node_num, false);
+ retval = ocfs_journal_toggle_mounted(osb, node_num, 0);
up (&(osb->publish_lock));
@@ -1375,7 +1375,7 @@
journal_t *k_journal = NULL;
struct buffer_head *bh = NULL;
ocfs_journal * journal = NULL;
- bool recovery_lock = false, got_lock = false;
+ int recovery_lock = 0, got_lock = 0;
__u64 alloc_size;
LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n", node_num,
@@ -1391,7 +1391,7 @@
/* Grab the local recovery resource to ensure no other thread
* comes in from this node for recovery */
down(&(osb->recovery_lock));
- recovery_lock = true;
+ recovery_lock = 1;
if (osb->disable_recovery) {
LOG_TRACE_STR("Shutting down so skipping reovery.");
goto done;
@@ -1434,7 +1434,7 @@
LOG_ERROR_STR("Could not lock journal!");
goto done;
}
- got_lock = true;
+ got_lock = 1;
/* check if that nodes publish sector has been reset (mounted
* is set false) if so, we can unlock and quit. otherwise we
@@ -1577,10 +1577,10 @@
publish = (ocfs_publish *) OCFS_BH_GET_DATA_WRITE(publish_bh); /* write */
- publish->dirty = false;
+ publish->dirty = 0;
publish->vote = 0;
publish->vote_type = 0;
- publish->mounted = false;
+ publish->mounted = 0;
OCFS_BH_PUT_DATA(publish_bh);
@@ -1687,7 +1687,7 @@
misses = 0;
}
- status = ocfs_commit_cache (osb, false);
+ status = ocfs_commit_cache (osb, 0);
if (status < 0)
LOG_ERROR_STATUS(status);
@@ -1717,7 +1717,7 @@
*
* In any case, it will release the trans lock for you.
*/
-static int ocfs_commit_cache (ocfs_super * osb, bool data_flush)
+static int ocfs_commit_cache (ocfs_super * osb, int data_flush)
{
int status = 0, tmpstat;
ocfs_journal * journal = NULL;
@@ -1770,7 +1770,7 @@
up(&commit->c_lock);
up(&journal->commit_sem);
- osb->needs_flush = false;
+ osb->needs_flush = 0;
/* shutdown code wants to hold the trans lock */
if (journal->state != OCFS_JOURNAL_IN_SHUTDOWN)
up(&osb->trans_lock);
Modified: trunk/src/lockres.c
===================================================================
--- trunk/src/lockres.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/lockres.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -43,7 +43,7 @@
*
* Returns 0 if success, < 0 if error.
*/
-int ocfs_update_lockres (ocfs_super * osb, __u64 lock_id, struct buffer_head **bh, __u32 * updated, __u32 timeout, struct inode *inode, bool reread)
+int ocfs_update_lockres (ocfs_super * osb, __u64 lock_id, struct buffer_head **bh, __u32 * updated, __u32 timeout, struct inode *inode, int reread)
{
int status = 0;
struct buffer_head *tmpbh = NULL, **b = NULL;
Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/namei.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -87,7 +87,7 @@
LOG_TRACE_ARGS("about to call find_files_on_disk with inode=%p\n", dir);
status = ocfs_find_files_on_disk (osb, parentOffset, &(dentry->d_name),
- &fe_bh, NULL, dir, true);
+ &fe_bh, NULL, dir, 1);
if (status < 0)
goto bail_add;
@@ -166,8 +166,8 @@
goto leave;
}
- ocfs_handle_set_checkpoint(handle, false);
- ocfs_handle_set_sync(handle, false);
+ ocfs_handle_set_checkpoint(handle, 0);
+ ocfs_handle_set_sync(handle, 0);
/* lock the parent directory */
status = ocfs_acquire_lock (osb, parent_off,
@@ -200,7 +200,7 @@
parent_off = GET_INODE_VOTEOFF(dir);
- ocfs_populate_inode (inode, fe, mode, true);
+ ocfs_populate_inode (inode, fe, mode, 1);
insert_inode_hash (inode);
ocfs_inode_hash_bind(osb, GET_INODE_VOTEOFF(inode), inode);
@@ -211,7 +211,7 @@
ocfs_init_lockres (osb, inode);
status = ocfs_update_lockres (osb, GET_INODE_VOTEOFF(inode), &new_fe_bh,
- NULL, 0, inode, false);
+ NULL, 0, inode, 0);
d_instantiate (dentry, inode);
ocfs_commit_trans(handle);
@@ -262,7 +262,7 @@
ocfs_dir_node *pLockNode = NULL;
__u64 t;
struct buffer_head *fe_bh = NULL;
- bool cache_lock;
+ int cache_lock;
int i;
unsigned long blk;
@@ -311,7 +311,7 @@
strncpy (fe->filename, dentry->d_name.name, dentry->d_name.len);
fe->filename[dentry->d_name.len]='\0';
fe->filename_len = dentry->d_name.len;
- fe->local_ext = true;
+ fe->local_ext = 1;
fe->granularity = -1;
fe->next_free_ext = 0;
fe->last_ext_ptr = 0;
@@ -494,7 +494,7 @@
int retval = -EBUSY;
ocfs_super *osb = NULL;
__u64 parentOff, fileOff;
- bool do_release = false;
+ int do_release = 0;
struct inode *parentInode = dentry->d_parent->d_inode;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", dir, dentry,
@@ -523,10 +523,10 @@
} else if (OCFS_I(inode)->oin_flags & OCFS_OIN_DELETE_ON_CLOSE) {
LOG_TRACE_STR ("OCFS_OIN_DELETE_ON_CLOSE set");
status = 0;
- do_release = true;
+ do_release = 1;
} else {
status = -EFAIL;
- do_release = true;
+ do_release = 1;
spin_lock(&oin_num_ext_lock);
if (OCFS_I(inode)->num_extends) {
@@ -597,7 +597,7 @@
struct inode *inode2)
{
int status = 0;
- bool id2_locked = false;
+ int id2_locked = 0;
__u64 tmpid;
__u32 tmptype, tmpflags;
struct buffer_head **tmpbh;
@@ -642,7 +642,7 @@
LOG_ERROR_STATUS (status);
goto bail;
}
- id2_locked = true;
+ id2_locked = 1;
}
/* lock id1 */
status = ocfs_acquire_lock(osb, id1, type1, flags1,
@@ -820,8 +820,8 @@
ocfs_super *osb = NULL;
__u64 oldOffset, newDirOff, oldDirOff, t;
__u64 tmpoff = 0;
- bool kill_newfe = false;
- bool delete_target_oin = false;
+ int kill_newfe = 0;
+ int delete_target_oin = 0;
ocfs_bitmap_free_head *free_head = NULL;
ocfs_journal_handle *handle = NULL;
__u32 dir_lock_flags = FLAG_FILE_CREATE | FLAG_DIR;
@@ -832,7 +832,7 @@
__u32 newfe_flags = 0;
__u32 newfe_lockid = 0;
int needs_trunc = 0;
- bool got_oldlock = false, got_newlock = false;
+ int got_oldlock = 0, got_newlock = 0;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, 0x%p, 0x%p, from='%*s' to='%*s')\n",
old_dir, old_dentry, new_dir, new_dentry,
@@ -897,7 +897,7 @@
down (&(OCFS_I(new_inode)->priv_sem));
status = ocfs_verify_update_inode (osb, new_inode, &needs_trunc);
up (&(OCFS_I(new_inode)->priv_sem));
- delete_target_oin = true;
+ delete_target_oin = 1;
if (needs_trunc)
ocfs_truncate_inode_pages(new_inode, 0);
}
@@ -957,12 +957,12 @@
LOG_ERROR_STATUS(status);
goto finally;
}
- got_oldlock = true;
+ got_oldlock = 1;
/* check if the target already exists (in which case we need
* to delete it */
status = ocfs_find_files_on_disk(osb, newDirOff, &(new_dentry->d_name),
- &newfe_bh, NULL, new_dir, false);
+ &newfe_bh, NULL, new_dir, 0);
/* The only error we allow here is -ENOENT because the new
* file not existing is perfectly valid. */
@@ -974,7 +974,7 @@
}
if (status == 0)
- kill_newfe = true;
+ kill_newfe = 1;
/* In case we need to overwrite an existing file, we blow it
* away first */
@@ -1002,7 +1002,7 @@
LOG_ERROR_STATUS(status);
goto finally;
}
- got_newlock = true;
+ got_newlock = 1;
status = ocfs_fe_smash (osb, newDirOff, 0,
tmpoff, handle, new_dentry,
@@ -1232,7 +1232,7 @@
struct buffer_head *lock_bh = NULL;
ocfs_file_entry *fe = NULL;
ocfs_journal_handle *handle = NULL;
- bool got_lock = false;
+ int got_lock = 0;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, symname='%s' actual='%*s')\n", dir,
@@ -1281,7 +1281,7 @@
LOG_ERROR_STATUS (status);
goto abort_trans;
}
- got_lock = true;
+ got_lock = 1;
status = ocfs_mknod_locked(osb, dir, dentry,
S_IFLNK | S_IRWXUGO, OCFS_NODEV, lock_bh,
@@ -1308,7 +1308,7 @@
inode->i_rdev = OCFS_NODEV;
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(new_fe_bh); /* read */
- ocfs_populate_inode (inode, fe, S_IFLNK | S_IRWXUGO, true);
+ ocfs_populate_inode (inode, fe, S_IFLNK | S_IRWXUGO, 1);
OCFS_BH_PUT_DATA(new_fe_bh);
fe = NULL;
@@ -1380,7 +1380,7 @@
__u64 lockId = 0;
__u32 index;
struct buffer_head *fe_bh = NULL, *lockbh = NULL, *dirbh = NULL;
- bool cache_lock = false, needs_reindex = false;
+ int cache_lock = 0, needs_reindex = 0;
__u64 dir_node_ptr = 0;
int flags = 0;
struct qstr *file_name = &(dentry->d_name);
@@ -1541,13 +1541,13 @@
int tmpstat;
ocfs_file_entry *fe = NULL;
__u32 lockFlags = 0;
- bool local_handle = false, is_dir;
+ int local_handle = 0, is_dir;
__u64 lock_id = 0;
struct buffer_head *fe_bh = NULL, *lock_bh = NULL;
struct buffer_head *lock_node_bh = NULL; /* parent locknode */
ocfs_journal_handle *handle = NULL;
struct inode *inode = dentry->d_inode;
- bool got_parent = false, got_file = false;
+ int got_parent = 0, got_file = 0;
LOG_ENTRY ();
@@ -1593,7 +1593,7 @@
LOG_ERROR_STATUS (status = -ENOMEM);
goto leave;
}
- local_handle = true;
+ local_handle = 1;
/* lock parent directory, yes we use FLAG_FILE_CREATE even
* though we're deleting ;) */
@@ -1604,12 +1604,12 @@
LOG_ERROR_STATUS(status);
goto leave;
}
- got_parent = true;
+ got_parent = 1;
/* this will re-read the directory now with the EXCLUSIVE */
/* lock already held; it will also return the fe_bh to us */
status = ocfs_find_files_on_disk (osb, lock_node_off, &(dentry->d_name),
- &fe_bh, NULL, parent_inode, false);
+ &fe_bh, NULL, parent_inode, 0);
if (status < 0) {
LOG_ERROR_STATUS(status);
goto leave;
@@ -1635,7 +1635,7 @@
LOG_ERROR_STATUS (status);
goto leave;
}
- got_file = true;
+ got_file = 1;
skip_lock:
status = ocfs_journal_access(handle, fe_bh, OCFS_JOURNAL_ACCESS_WRITE);
Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/nm.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -33,7 +33,7 @@
spinlock_t oin_num_ext_lock = SPIN_LOCK_UNLOCKED;
struct semaphore recovery_list_sem;
-static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, __u32 flags, int status, bool *master_alive, struct inode *inode);
+static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, __u32 flags, int status, int *master_alive, struct inode *inode);
static int ocfs_search_commited(ocfs_super *osb, struct inode *inode);
static int ocfs_schedule_process_vote(ocfs_super *osb, struct buffer_head *bh, int vote_node);
@@ -44,7 +44,7 @@
ocfs_super *osb;
ocfs_lock_res *lockres;
struct inode *inode;
- bool yield;
+ int yield;
} ocfs_ro_cache_drop_ctxt;
@@ -322,7 +322,7 @@
OCFS_BH_PUT_DATA(bh);
bh = NULL;
- ocfs_nm_heart_beat (osb, HEARTBEAT_METHOD_DISK, false);
+ ocfs_nm_heart_beat (osb, HEARTBEAT_METHOD_DISK, 0);
/* release publish lock */
up (&(osb->publish_lock));
@@ -347,7 +347,7 @@
num_nodes = OCFS_MAXIMUM_NODES;
/* Refresh the publish map */
- ocfs_update_publish_map (osb, &(osb->cfg_bhs[OCFS_VOLCFG_NEWCFG_SECTORS]), false);
+ ocfs_update_publish_map (osb, &(osb->cfg_bhs[OCFS_VOLCFG_NEWCFG_SECTORS]), 0);
/* send signal to mount thread to continue */
if (atomic_read (&osb->nm_init) < OCFS_HEARTBEAT_INIT) {
@@ -484,17 +484,17 @@
static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num,
- __u32 flags, int status, bool *master_alive, struct inode *inode)
+ __u32 flags, int status, int *master_alive, struct inode *inode)
{
int vote_type = INVALID_REQUEST;
- bool my_node_wins = false;
+ int my_node_wins = 0;
__u64 lockid = GET_INODE_VOTEOFF(inode);
ocfs_vote_obj_lookup_data data;
LOG_ENTRY_ARGS("(status=%d, lockid=%llu, node_num=%d, flags=%08x)\n", status,
lockid, node_num, flags);
- *master_alive = true;
+ *master_alive = 1;
if (status < 0) {
if (status == -ETIMEDOUT) {
LOG_TRACE_STR("(INVALID_REQUEST) status == -ETIMEDOUT");
@@ -616,15 +616,15 @@
ocfs_vote *vote = NULL;
struct buffer_head *fe_bh = NULL, *vote_bh = NULL;
int vote_type = INVALID_REQUEST, vote_response = 0;
- bool oin_sem = false;
+ int oin_sem = 0;
struct inode *inode = NULL;
- bool master_alive = true, is_dir = false;
- bool is_locked, open_handle;
+ int master_alive = 1, is_dir = 0;
+ int is_locked, open_handle;
int lockflags = 0;
- bool inc_inode_seq = false;
- bool disk_vote = (ctxt->request_method == DISK_VOTE);
- bool comm_vote = (ctxt->request_method == COMM_VOTE);
- bool have_i_sem = false;
+ int inc_inode_seq = 0;
+ int disk_vote = (ctxt->request_method == DISK_VOTE);
+ int comm_vote = (ctxt->request_method == COMM_VOTE);
+ int have_i_sem = 0;
ocfs_publish *publish = (disk_vote ? ctxt->u.publish : NULL);
ocfs_dlm_msg *dlm_msg = (comm_vote ? ctxt->u.dlm_msg : NULL);
__u32 node_num = ctxt->node_num;
@@ -675,7 +675,7 @@
* below, but due to lock ordering, we want to take it
* before we acquire_lockres. */
down(&inode->i_sem);
- have_i_sem = true;
+ have_i_sem = 1;
}
if (disk_vote) {
@@ -690,7 +690,7 @@
if (inode) {
lockres = GET_INODE_LOCKRES(inode);
status = ocfs_update_lockres (osb, lock_id, NULL, NULL,
- (OCFS_NM_HEARTBEAT_TIME/2), inode, true);
+ (OCFS_NM_HEARTBEAT_TIME/2), inode, 1);
}
if (status < 0) {
if (status == -ETIMEDOUT)
@@ -726,7 +726,7 @@
/* Ok, for all operations where we no longer need
* isem, drop it now. */
up(&inode->i_sem);
- have_i_sem = false;
+ have_i_sem = 0;
}
if (disk_vote) {
@@ -744,12 +744,12 @@
}
vote_response = 0;
- open_handle = false;
+ open_handle = 0;
switch (vote_type) {
case UPDATE_OIN_INODE:
LOG_TRACE_STR("UPDATE_OIN_INODE");
down (&(OCFS_I(inode)->priv_sem));
- OCFS_I(inode)->needs_verification = true;
+ OCFS_I(inode)->needs_verification = 1;
tmpstat = ocfs_verify_update_inode(osb, inode, &needs_trunc);
if (tmpstat < 0)
LOG_ERROR_STATUS (tmpstat);
@@ -775,9 +775,9 @@
vote_response = FLAG_VOTE_NODE;
if (inode) {
- oin_sem = true;
+ oin_sem = 1;
down (&(OCFS_I(inode)->priv_sem));
- OCFS_I(inode)->needs_verification = true;
+ OCFS_I(inode)->needs_verification = 1;
tmpstat = ocfs_verify_update_inode(osb, inode, &needs_trunc);
if (tmpstat < 0)
LOG_ERROR_STATUS (tmpstat);
@@ -799,7 +799,7 @@
up(&(OCFS_I(inode)->priv_sem));
ocfs_release_lockres (lockres); // ocfs_process_vote
lockres = NULL;
- oin_sem = false;
+ oin_sem = 0;
if (needs_trunc) {
ocfs_truncate_inode_pages(inode, 0);
needs_trunc = 0;
@@ -832,14 +832,14 @@
fsync_inode_buffers (inode);
#endif
up(&inode->i_sem);
- have_i_sem = false;
+ have_i_sem = 0;
}
break;
}
if (inode) {
up(&inode->i_sem);
- have_i_sem = false;
+ have_i_sem = 0;
}
/* Set the always update master on open flag */
@@ -871,7 +871,7 @@
}
if (oin_sem) {
up(&(OCFS_I(inode)->priv_sem));
- oin_sem = false;
+ oin_sem = 0;
}
if (needs_trunc) {
@@ -942,7 +942,7 @@
if (lockres->readonly_map != 0ULL) {
OCFS_ASSERT(lockres->readonly_node == osb->node_num);
#warning need to make sure inode is not NULL in process_vote
- status = ocfs_drop_readonly_cache_lock(osb, inode, true);
+ status = ocfs_drop_readonly_cache_lock(osb, inode, 1);
if (status < 0)
LOG_ERROR_STATUS(status);
vote_response = FLAG_VOTE_UPDATE_RETRY;
@@ -1017,7 +1017,7 @@
}
brelse(fe_bh);
vote_response = FLAG_VOTE_NODE;
- inc_inode_seq = true;
+ inc_inode_seq = 1;
status = 0;
break;
@@ -1108,7 +1108,7 @@
if (inode && OCFS_I(inode)->open_hndl_cnt
&& flags & (FLAG_FILE_EXTEND|FLAG_FILE_UPDATE)
&& !(flags & FLAG_DIR))
- open_handle = true;
+ open_handle = 1;
break;
case INVALID_REQUEST:
@@ -1219,7 +1219,7 @@
leave:
if (inode) {
if (inc_inode_seq)
- ocfs_inc_inode_seq(osb, inode, true);
+ ocfs_inc_inode_seq(osb, inode, 1);
if (have_i_sem)
up(&inode->i_sem);
iput(inode);
@@ -1233,7 +1233,7 @@
/* inode is definitely non NULL */
-void ocfs_inc_inode_seq(ocfs_super *osb, struct inode *inode, bool sync_buffers)
+void ocfs_inc_inode_seq(ocfs_super *osb, struct inode *inode, int sync_buffers)
{
atomic_t *seq = GET_INODE_CLEAN_SEQ(inode);
@@ -1302,7 +1302,7 @@
static int _ocfs_drop_readonly_cache_lock_thread(void *arg);
/* inode is definitely non NULL */
-int ocfs_drop_readonly_cache_lock(ocfs_super *osb, struct inode *inode, bool yield)
+int ocfs_drop_readonly_cache_lock(ocfs_super *osb, struct inode *inode, int yield)
{
ocfs_ro_cache_drop_ctxt *arg;
int status = 0;
@@ -1344,7 +1344,7 @@
ocfs_lock_res *lockres = ctxt->lockres;
struct inode *inode = ctxt->inode;
int status = 0;
- bool yield = ctxt->yield;
+ int yield = ctxt->yield;
if (yield) {
/* this will wait until process_vote gets to the release */
@@ -1372,7 +1372,7 @@
status = 0;
while (lockres->readonly_map != 0ULL) {
- bool disk_vote = false;
+ int disk_vote = 0;
lockres->readonly_map &= osb->publ_map; /* remove all dead nodes */
status = new_lock_function(osb, OCFS_DLM_ENABLE_CACHE_LOCK, FLAG_DROP_READONLY,
Modified: trunk/src/oin.c
===================================================================
--- trunk/src/oin.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/oin.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -218,11 +218,11 @@
fe = NULL;
status = ocfs_update_lockres (osb, GET_INODE_VOTEOFF(inode), &fe_bh,
- NULL, 0, inode, false);
+ NULL, 0, inode, 0);
status = 0;
leave:
if (status == 0)
- OCFS_I(inode)->needs_verification = false;
+ OCFS_I(inode)->needs_verification = 0;
if (fe_bh) {
if (fe)
@@ -244,12 +244,12 @@
{
int status = 0;
ocfs_file_entry *fe = NULL;
- bool local_handle = true;
+ int local_handle = 1;
LOG_ENTRY ();
if (handle)
- local_handle = false;
+ local_handle = 0;
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(fe_bh); /* read */
@@ -271,8 +271,8 @@
goto leave;
}
/* we want this to be a really fast transaction. */
- ocfs_handle_set_sync(handle, false);
- ocfs_handle_set_checkpoint(handle, false);
+ ocfs_handle_set_sync(handle, 0);
+ ocfs_handle_set_checkpoint(handle, 0);
}
/* this will update the lock info from disk while also
@@ -321,7 +321,7 @@
__u64 tempoff;
ocfs_extent_group *extent = NULL;
struct buffer_head *extent_bh = NULL;
- bool bRet;
+ int bRet;
ocfs_file_entry *fe = NULL;
void *tmp;
Modified: trunk/src/osb.c
===================================================================
--- trunk/src/osb.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/osb.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -79,8 +79,8 @@
spin_lock_init(&osb->recovery_map_lock);
osb->recovery_map = 0;
- osb->needs_flush = false;
- osb->disable_recovery = false;
+ osb->needs_flush = 0;
+ osb->disable_recovery = 0;
init_MUTEX (&(osb->publish_lock));
atomic_set (&osb->node_req_vote, 0);
@@ -90,7 +90,7 @@
init_waitqueue_head (&osb->nm_init_event);
atomic_set (&osb->nm_init, 0);
- osb->publish_dirty = false;
+ osb->publish_dirty = 0;
init_waitqueue_head (&osb->flush_event);
atomic_set (&osb->flush_event_woken, 0);
atomic_set (&osb->clean_buffer_seq, 1);
@@ -220,7 +220,7 @@
goto finally;
}
- ocfs_update_publish_map (osb, publish_bhs, true);
+ ocfs_update_publish_map (osb, publish_bhs, 1);
for(i = 0; i < OCFS_MAXIMUM_NODES; i++)
osb->last_publ_seq_num[i] = (__u64) (-1);
@@ -345,7 +345,7 @@
ocfs_publish *publish = NULL;
int node_num = osb->node_num;
struct buffer_head * publish_bh = NULL;
- bool mounted;
+ int mounted;
LOG_ENTRY ();
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/super.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -39,7 +39,7 @@
__u32 mount_cnt; /* Number of volumes currently mounted */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-bool mount_cnt_inc; /* true when mount_cnt is inc by 1 during first mount */
+int mount_cnt_inc; /* true when mount_cnt is inc by 1 during first mount */
#endif
char *node_name = NULL;
@@ -126,11 +126,11 @@
extern struct semaphore recovery_list_sem;
-static int ocfs_parse_options (char *options, __u32 * uid, __u32 * gid, bool * reclaim_id);
+static int ocfs_parse_options (char *options, __u32 * uid, __u32 * gid, int * reclaim_id);
static int __init ocfs_driver_entry (void);
static void __exit ocfs_driver_exit (void);
static void ocfs_put_super (struct super_block *sb);
-static int ocfs_mount_volume (struct super_block *sb, bool reclaim_id, struct inode *root);
+static int ocfs_mount_volume (struct super_block *sb, int reclaim_id, struct inode *root);
static int ocfs_read_params(void);
static int ocfs_initialize_mem_lists (void);
static void ocfs_free_mem_lists (void);
@@ -254,7 +254,7 @@
struct inode *inode = NULL;
__u32 uid = current->fsuid;
__u32 gid = current->fsgid;
- bool reclaim_id;
+ int reclaim_id;
ocfs_super *osb = NULL;
LOG_ENTRY_ARGS ("%p, %p, %i", sb, data, silent);
@@ -374,7 +374,7 @@
*
* e.g., gid=9999,uid=9999,[no]cache,reclaimid
*/
-static int ocfs_parse_options (char *options, __u32 * uid, __u32 * gid, bool * reclaim_id)
+static int ocfs_parse_options (char *options, __u32 * uid, __u32 * gid, int * reclaim_id)
{
char *c;
char *value;
@@ -382,7 +382,7 @@
LOG_ENTRY ();
- *reclaim_id = false;
+ *reclaim_id = 0;
if (!options) {
ret = 0;
goto bail;
@@ -422,7 +422,7 @@
goto bail;
}
} else if (!strcmp (c, "reclaimid")) {
- *reclaim_id = true;
+ *reclaim_id = 1;
} else {
LOG_ERROR_ARGS ("Invalid mount option: %s", c);
goto bail;
@@ -505,7 +505,7 @@
spin_lock (&mount_cnt_lock);
mount_cnt = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- mount_cnt_inc = false;
+ mount_cnt_inc = 0;
#endif
spin_unlock (&mount_cnt_lock);
@@ -840,7 +840,7 @@
* ocfs_mount_volume()
*
*/
-static int ocfs_mount_volume (struct super_block *sb, bool reclaim_id, struct inode *root)
+static int ocfs_mount_volume (struct super_block *sb, int reclaim_id, struct inode *root)
{
int status = 0;
ocfs_super *osb = NULL;
@@ -970,9 +970,9 @@
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- if (mount_cnt_inc == false) {
+ if (mount_cnt_inc == 0) {
MOD_INC_USE_COUNT;
- mount_cnt_inc = true;
+ mount_cnt_inc = 1;
}
#endif
}
@@ -985,7 +985,7 @@
osb->hbm = DISK_HBEAT_COMM_ON;
down (&(osb->publish_lock));
- ocfs_nm_heart_beat (osb, HEARTBEAT_METHOD_DISK, true);
+ ocfs_nm_heart_beat (osb, HEARTBEAT_METHOD_DISK, 1);
up (&(osb->publish_lock));
osb->publ_map |= (1 << osb->node_num);
@@ -1038,7 +1038,7 @@
int ocfs_dismount_volume (struct super_block *sb)
{
int status = 0;
- bool AcquiredOSB = false;
+ int AcquiredOSB = 0;
ocfs_super *osb = NULL;
__u32 nodemap;
__u32 tempmap;
@@ -1061,7 +1061,7 @@
/* disable any new recovery threads and wait for any currently
* running ones to exit. */
down(&osb->recovery_lock);
- osb->disable_recovery = true;
+ osb->disable_recovery = 1;
up(&osb->recovery_lock);
while (atomic_read(&osb->num_recovery_threads)) {
LOG_TRACE_STR("Waiting on a recovery thread to complete.");
@@ -1069,7 +1069,7 @@
}
down(&(osb->osb_res));
- AcquiredOSB = true;
+ AcquiredOSB = 1;
#ifdef UMOUNT_CHECK
if (osb->file_open_cnt > 0) {
@@ -1085,7 +1085,7 @@
/* Shutdown the journal and sync up and clear the local alloc. */
ocfs_journal_shutdown(osb);
- ocfs_shutdown_local_alloc(osb, NULL, true, false);
+ ocfs_shutdown_local_alloc(osb, NULL, 1, 0);
/* unset the mounted flag -- we're done with the journal and
* the local alloc bitmap */
@@ -1146,7 +1146,7 @@
osb->vol_state = VOLUME_DISMOUNTED;
if (AcquiredOSB) {
up (&(osb->osb_res));
- AcquiredOSB = false;
+ AcquiredOSB = 0;
}
printk ("ocfs2: Unmounting device (%u,%u) on %s (node %d)\n",
@@ -1169,7 +1169,7 @@
spin_lock (&mount_cnt_lock);
if (!mount_cnt && mount_cnt_inc) {
MOD_DEC_USE_COUNT;
- mount_cnt_inc = false;
+ mount_cnt_inc = 0;
}
spin_unlock (&mount_cnt_lock);
#endif
@@ -1177,7 +1177,7 @@
leave:
if (AcquiredOSB) {
up (&(osb->osb_res));
- AcquiredOSB = false;
+ AcquiredOSB = 0;
}
LOG_EXIT_STATUS (status);
Modified: trunk/src/sysfile.c
===================================================================
--- trunk/src/sysfile.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/sysfile.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -235,11 +235,11 @@
*
* You need to be holding node_alloc_sem!
*/
-int ocfs_extend_system_file (ocfs_super * osb, __u32 FileId, __u64 FileSize, struct buffer_head *fe_bh, ocfs_journal_handle *handle, bool zero)
+int ocfs_extend_system_file (ocfs_super * osb, __u32 FileId, __u64 FileSize, struct buffer_head *fe_bh, ocfs_journal_handle *handle, int zero)
{
int status = 0;
__u64 actualDiskOffset = 0, actualLength = 0;
- bool local_fe = false;
+ int local_fe = 0;
ocfs_file_entry *fe = NULL;
__u64 alloc_size;
int numbhs, i;
@@ -251,7 +251,7 @@
OCFS_ASSERT (osb);
if (!fe_bh) {
- local_fe = true;
+ local_fe = 1;
status = ocfs_read_bh(osb, (FileId * osb->sect_size) + osb->vol_layout.root_int_off, &fe_bh, OCFS_BH_COND_CACHED, NULL);
if (status < 0) {
LOG_ERROR_STATUS (status);
@@ -284,7 +284,7 @@
ocfs_find_contiguous_space_from_bitmap (osb,
FileSize - alloc_size,
&BitmapOffset,
- &numClusterAlloc, true,
+ &numClusterAlloc, 1,
NULL, NULL);
if (status < 0) {
LOG_ERROR_STATUS (status);
Modified: trunk/src/util.c
===================================================================
--- trunk/src/util.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/util.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -158,7 +158,7 @@
#ifdef OCFS_LINUX_MEM_DEBUG
struct list_head *iter, *tmpiter;
alloc_item *item = NULL;
- bool do_free = false;
+ int do_free = 0;
list_for_each_safe (iter, tmpiter, &OcfsGlobalCtxt.item_list) {
item = list_entry (iter, alloc_item, list);
@@ -168,7 +168,7 @@
LOG_TRACE_ARGS (" - %x (%p, '%s')\n", m, item->u.slab, item->tag);
#endif
list_del (&item->list);
- do_free = true;
+ do_free = 1;
break;
}
}
@@ -226,7 +226,7 @@
#ifdef OCFS_LINUX_MEM_DEBUG
struct list_head *iter, *tmpiter;
alloc_item *item = NULL;
- bool do_free = false;
+ int do_free = 0;
list_for_each_safe (iter, tmpiter, &OcfsGlobalCtxt.item_list) {
item = list_entry (iter, alloc_item, list);
@@ -237,7 +237,7 @@
item->u.length, item->tag);
#endif
list_del (&item->list);
- do_free = true;
+ do_free = 1;
break;
}
}
Modified: trunk/src/volcfg.c
===================================================================
--- trunk/src/volcfg.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/volcfg.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -36,7 +36,7 @@
static int ocfs_update_disk_config (ocfs_super * osb, __u32 node_num, ocfs_node_config_info * disk);
static int ocfs_release_disk_lock (ocfs_super * osb, __u64 lock_off);
static int ocfs_add_node_to_config (ocfs_super * osb);
-static bool ocfs_has_node_config_changed (ocfs_super * osb);
+static int ocfs_has_node_config_changed (ocfs_super * osb);
static int ocfs_refresh_node_config (ocfs_super * osb);
static void ocfs_show_all_node_cfgs (ocfs_super * osb);
static int ocfs_disknode_to_node (BARF_BARF_BARF ** node, ocfs_node_config_info * disk);
@@ -130,7 +130,7 @@
__u32 sect_size;
__u32 size;
struct buffer_head *cfg_bhs[OCFS_MAXIMUM_NODES];
- ocfs_bool done = false;
+ int done = 0;
LOG_ENTRY ();
@@ -165,7 +165,7 @@
p = OCFS_BH_GET_DATA_READ(cfg_bhs[node_num]); /* read */
disk_node = (ocfs_node_config_info *) p;
if (disk_node->node_name[0] == '\0')
- done = true;
+ done = 1;
OCFS_BH_PUT_DATA(cfg_bhs[node_num]);
if (done)
break;
@@ -297,9 +297,9 @@
{
int status = 0;
char *lock_buf = NULL;
- bool tried_acq = false;
- bool break_lock = false;
- bool bh_locked = false;
+ int tried_acq = 0;
+ int break_lock = 0;
+ int bh_locked = 0;
ocfs_disk_lock *disk_lock;
ocfs_cfg_task *cfg_task = NULL;
__u32 sect_size;
@@ -348,7 +348,7 @@
}
lock_buf = OCFS_BH_GET_DATA_WRITE(bh); /* write */
- bh_locked = true;
+ bh_locked = 1;
disk_lock = (ocfs_disk_lock *) lock_buf;
@@ -369,20 +369,20 @@
/* Write into volcfg lock sector... */
OCFS_BH_PUT_DATA(bh);
- bh_locked = false;
+ bh_locked = 0;
status = ocfs_write_bh(osb, bh, 0, NULL);
if (status < 0) {
LOG_ERROR_STATUS (status);
goto finito;
}
- tried_acq = true;
+ tried_acq = 1;
}
ocfs_sleep (OCFS_VOLCFG_LOCK_TIME);
if (bh_locked)
OCFS_BH_PUT_DATA(bh);
- bh_locked = false;
+ bh_locked = 0;
/* Read the volcfg lock sector again... */
status = ocfs_read_bh(osb, lock_off, &bh, 0, NULL);
@@ -430,7 +430,7 @@
} else {
disk_lock = (ocfs_disk_lock *) lock_buf;
if (DISK_LOCK_CURRENT_MASTER (disk_lock) == lock_node_num)
- break_lock = true;
+ break_lock = 1;
else {
LOG_TRACE_ARGS ("Node config locked by node: %d\n",
DISK_LOCK_CURRENT_MASTER (disk_lock));
@@ -852,7 +852,7 @@
continue;
}
- osb->cfg_initialized = true;
+ osb->cfg_initialized = 1;
osb->cfg_seq_num = hdr->cfg_seq_num;
osb->num_cfg_nodes = hdr->num_nodes;
LOG_TRACE_ARGS ("Num of configured nodes (%u)\n", osb->num_cfg_nodes);
@@ -921,12 +921,12 @@
* ocfs_has_node_config_changed()
*
*/
-static bool ocfs_has_node_config_changed (ocfs_super * osb)
+static int ocfs_has_node_config_changed (ocfs_super * osb)
{
BARF_BARF_BARF *node;
ocfs_ipc_config_info *ipc;
ocfs_comm_info *g_ipc;
- bool chg = false;
+ int chg = 0;
LOG_ENTRY ();
@@ -937,21 +937,21 @@
if (OcfsGlobalCtxt.node_name &&
strncmp (node->node_name, OcfsGlobalCtxt.node_name,
MAX_NODE_NAME_LENGTH))
- chg = true;
+ chg = 1;
if (!chg && ipc->type != g_ipc->type)
- chg = true;
+ chg = 1;
if (!chg && ipc->ip_port != g_ipc->ip_port)
- chg = true;
+ chg = 1;
if (!chg && g_ipc->ip_addr &&
strncmp (ipc->ip_addr, g_ipc->ip_addr, MAX_IP_ADDR_LEN))
- chg = true;
+ chg = 1;
if (!chg && g_ipc->ip_mask &&
strncmp (ipc->ip_mask, g_ipc->ip_mask, MAX_IP_ADDR_LEN))
- chg = true;
+ chg = 1;
LOG_EXIT_INT (chg);
return chg;
Modified: trunk/src/vote.c
===================================================================
--- trunk/src/vote.c 2004-05-06 23:57:31 UTC (rev 905)
+++ trunk/src/vote.c 2004-05-07 22:37:57 UTC (rev 906)
@@ -37,7 +37,7 @@
static ocfs_vote_obj * ocfs_alloc_vote_obj (int bytes, __u32 reqlock, __u64 votemap);
static void ocfs_dlm_recv_msg (void *val);
-static bool ocfs_check_ipc_msg (__u8 * msg, __u32 msg_len);
+static int ocfs_check_ipc_msg (__u8 * msg, __u32 msg_len);
static int ocfs_comm_process_vote_reply (ocfs_super * osb, ocfs_dlm_msg * dlm_msg);
static int ocfs_comm_process_msg (__u8 * msg);
@@ -266,7 +266,7 @@
* ocfs_send_vote_reply()
*
*/
-int ocfs_send_vote_reply (ocfs_super * osb, ocfs_dlm_msg * dlm_msg, __u32 vote_status, bool inode_open)
+int ocfs_send_vote_reply (ocfs_super * osb, ocfs_dlm_msg * dlm_msg, __u32 vote_status, int inode_open)
{
ocfs_dlm_req_master *req_master;
ocfs_dlm_reply_master *reply_master;
@@ -332,9 +332,9 @@
* ocfs_check_ipc_msg()
*
*/
-bool ocfs_check_ipc_msg (__u8 * msg, __u32 msg_len)
+int ocfs_check_ipc_msg (__u8 * msg, __u32 msg_len)
{
- bool bret = false;
+ int bret = 0;
ocfs_dlm_msg *dlm_msg;
LOG_ENTRY ();
@@ -366,7 +366,7 @@
goto bail;
}
- bret = true;
+ bret = 1;
bail:
LOG_EXIT_INT (bret);
More information about the Ocfs2-commits
mailing list