[Ocfs2-commits] jlbec commits r913 - in trunk/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed May 12 15:49:38 CDT 2004
Author: jlbec
Date: 2004-05-12 14:49:36 -0500 (Wed, 12 May 2004)
New Revision: 913
Modified:
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/heartbeat.c
trunk/src/inc/ocfs.h
trunk/src/inc/proto.h
trunk/src/inode.c
trunk/src/journal.c
trunk/src/namei.c
trunk/src/nm.c
trunk/src/oin.c
trunk/src/proc.c
trunk/src/super.c
trunk/src/symlink.c
trunk/src/util.c
trunk/src/ver.c
trunk/src/volcfg.c
Log:
TABs, baby.
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/alloc.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -118,9 +118,9 @@
}
int ocfs_add_to_bitmap_free_head(ocfs_super *osb,
- ocfs_bitmap_free_head *f,
- __u32 len, __u32 fileoff,
- __u32 nodenum, __u32 type)
+ ocfs_bitmap_free_head *f,
+ __u32 len, __u32 fileoff,
+ __u32 nodenum, __u32 type)
{
int status = 0, n;
ocfs_free_rec *log;
@@ -130,7 +130,7 @@
"type=%d (\"%s\")\n", len, fileoff, nodenum, type,
(type == DISK_ALLOC_VOLUME) ? "DISK_ALLOC_VOLUME" :
( (type == DISK_ALLOC_EXTENT_NODE) ?
- "DISK_ALLOC_EXTENT_NODE" : "DISK_ALLOC_DIR_NODE" ));
+ "DISK_ALLOC_EXTENT_NODE" : "DISK_ALLOC_DIR_NODE" ));
if (len == 0) {
printk("ocfs2: Zero length delete!\n");
@@ -138,7 +138,7 @@
"type=%d (\"%s\")\n", len, fileoff, nodenum, type,
(type == DISK_ALLOC_VOLUME) ? "DISK_ALLOC_VOLUME" :
( (type == DISK_ALLOC_EXTENT_NODE) ?
- "DISK_ALLOC_EXTENT_NODE" : "DISK_ALLOC_DIR_NODE" ));
+ "DISK_ALLOC_EXTENT_NODE" : "DISK_ALLOC_DIR_NODE" ));
BUG();
}
@@ -1508,65 +1508,65 @@
*/
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;
+ int status = 0;
int FirstTime = 1;
- ocfs_alloc_ext *ext;
- __u32 i, csize = osb->cluster_size_bits,
- numBitsAllocated = 0, bitmapOffset = 0,
- firstfree = *freeExtent;
- __u64 bytes, foff, doff,
- dstart = osb->vol_layout.data_start_off,
- diskOffsetTobeFreed, lengthTobeFreed = 0,
- actualSize = 0, origLength = 0;
+ ocfs_alloc_ext *ext;
+ __u32 i, csize = osb->cluster_size_bits,
+ numBitsAllocated = 0, bitmapOffset = 0,
+ firstfree = *freeExtent;
+ __u64 bytes, foff, doff,
+ dstart = osb->vol_layout.data_start_off,
+ diskOffsetTobeFreed, lengthTobeFreed = 0,
+ actualSize = 0, origLength = 0;
LOG_ENTRY ();
- firstfree = *freeExtent;
+ firstfree = *freeExtent;
/* loop through the used alloc_extents */
- for (i = 0; i < firstfree; i++) {
- ext = &(extarr[i]);
- bytes = ext->num_bytes;
- foff = ext->file_off;
- doff = ext->disk_off;
- actualSize = (bytes + foff);
- if (flag || actualSize > FileSize) {
- if (flag || foff >= FileSize) {
- if (!flag && FirstTime) {
- *freeExtent = i;
- FirstTime = 0;
- }
- numBitsAllocated = (__u32) (bytes>>csize);
- bitmapOffset = (__u32) ((doff - dstart) >> csize);
- ext->num_bytes = ext->disk_off = ext->file_off = 0;
- } else {
- if (FirstTime) {
- *freeExtent = i + 1;
- FirstTime = 0;
- }
- origLength = bytes;
- ext->num_bytes = bytes = FileSize - foff;
- lengthTobeFreed = origLength - bytes;
- if (lengthTobeFreed == 0) {
- continue;
- }
- numBitsAllocated = (__u32) (lengthTobeFreed >> csize);
- diskOffsetTobeFreed = doff + bytes;
- bitmapOffset = (__u32) ((diskOffsetTobeFreed - dstart) >> csize);
- }
- status = ocfs_handle_add_commit_bits(handle,
+ for (i = 0; i < firstfree; i++) {
+ ext = &(extarr[i]);
+ bytes = ext->num_bytes;
+ foff = ext->file_off;
+ doff = ext->disk_off;
+ actualSize = (bytes + foff);
+ if (flag || actualSize > FileSize) {
+ if (flag || foff >= FileSize) {
+ if (!flag && FirstTime) {
+ *freeExtent = i;
+ FirstTime = 0;
+ }
+ numBitsAllocated = (__u32) (bytes>>csize);
+ bitmapOffset = (__u32) ((doff - dstart) >> csize);
+ ext->num_bytes = ext->disk_off = ext->file_off = 0;
+ } else {
+ if (FirstTime) {
+ *freeExtent = i + 1;
+ FirstTime = 0;
+ }
+ origLength = bytes;
+ ext->num_bytes = bytes = FileSize - foff;
+ lengthTobeFreed = origLength - bytes;
+ if (lengthTobeFreed == 0) {
+ continue;
+ }
+ numBitsAllocated = (__u32) (lengthTobeFreed >> csize);
+ diskOffsetTobeFreed = doff + bytes;
+ bitmapOffset = (__u32) ((diskOffsetTobeFreed - dstart) >> csize);
+ }
+ status = ocfs_handle_add_commit_bits(handle,
numBitsAllocated,
bitmapOffset, -1,
DISK_ALLOC_VOLUME);
- if (status < 0) {
+ if (status < 0) {
LOG_ERROR_STATUS (status);
- break;
+ break;
}
- }
- }
+ }
+ }
LOG_EXIT_STATUS (status);
- return status;
+ return status;
} /* _squish_extent_entries */
#endif /* !USERSPACE_TOOL */
@@ -2093,10 +2093,10 @@
} else { /* It's a header extent */
/* Did we already kill all his children, or
- * are they already dead? */
- if (AllocExtent->next_free_ext == 0) {
+ * are they already dead? */
+ if (AllocExtent->next_free_ext == 0) {
/*Ok, we're done with this guy, pop the stack*/
- LOG_TRACE_ARGS("Popping this header (%llu)\n",
+ LOG_TRACE_ARGS("Popping this header (%llu)\n",
AllocExtent->this_ext);
status = ocfs_handle_add_commit_bits(handle, 1, AllocExtent->alloc_file_off, AllocExtent->alloc_node, DISK_ALLOC_EXTENT_NODE);
@@ -2149,7 +2149,7 @@
AllocExtent->extents[victim].file_off = 0;
AllocExtent->extents[victim].num_bytes = 0;
AllocExtent->extents[victim].disk_off = 0;
- AllocExtent->next_free_ext--;
+ AllocExtent->next_free_ext--;
OCFS_BH_PUT_DATA(bh_stack[tos]);
AllocExtent = NULL;
/* Here's an interesting boundary
@@ -2248,7 +2248,7 @@
OCFS_BH_PUT_DATA(bh_stack[tos]);
if (needs_brelse)
brelse(bh_stack[0]);
- for(i = 1; i < OCFS_TREE_STACK_SIZE; i++)
+ for(i = 1; i < OCFS_TREE_STACK_SIZE; i++)
if (bh_stack[i])
brelse(bh_stack[i]);
@@ -2346,27 +2346,27 @@
{
int status = 0;
struct buffer_head *extent_bh = NULL;
- __u64 alloc_size;
+ __u64 alloc_size;
int i, j;
int updated_lep; /* used to mark whether fe->last_ext_ptr has
* been updated */
LOG_ENTRY ();
- alloc_size = FileEntry->alloc_size;
+ alloc_size = FileEntry->alloc_size;
- /* local extents */
+ /* local extents */
if (FileEntry->local_ext) {
- status = _squish_extent_entries(osb, FileEntry->extents,
+ status = _squish_extent_entries(osb, FileEntry->extents,
&FileEntry->next_free_ext,
handle, alloc_size, 0,
inode);
- if (status < 0) {
- LOG_ERROR_STATUS (status);
- goto finally;
- }
+ if (status < 0) {
+ LOG_ERROR_STATUS (status);
+ goto finally;
+ }
goto finally;
- }
+ }
LOG_TRACE_ARGS("non-local extents. taking that code path, truncating to alloc_size of (%llu)\n", alloc_size);
/* non-local extents */
@@ -2716,8 +2716,8 @@
static __u32 LargeAllocOffset = 0;
static __u32 SmallAllocOffset = 0;
int bLockAcquired = 0;
- struct buffer_head *bh = NULL;
- ocfs_file_entry *bm_lock = NULL;
+ struct buffer_head *bh = NULL;
+ ocfs_file_entry *bm_lock = NULL;
__u32 bitmapblocks; /* we only care about the valid blocks */
int local_lock = 1;
int local_inode = 0;
Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/dcache.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -49,8 +49,8 @@
int flags = nd ? nd->flags : 0;
#endif
- LOG_ENTRY_ARGS ("(0x%p, %d, '%*s')\n", dentry, flags,
- dentry->d_name.len, dentry->d_name.name);
+ LOG_ENTRY_ARGS ("(0x%p, %d, '%*s')\n", dentry, flags,
+ dentry->d_name.len, dentry->d_name.name);
if (inode == NULL)
goto bail;
@@ -130,7 +130,7 @@
int ret, done;
LOG_ENTRY_ARGS ("(0x%p, '%*s')\n", dentry,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
spin_lock (&dcache_lock);
list = dentry->d_subdirs.next;
Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/dir.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -53,7 +53,7 @@
struct inode *inode = filp->f_dentry->d_inode;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", filp, dirent,
- filp->f_dentry->d_name.len, filp->f_dentry->d_name.name);
+ filp->f_dentry->d_name.len, filp->f_dentry->d_name.name);
pos = filp->f_pos;
sb = inode->i_sb;
@@ -105,17 +105,17 @@
ofile = (ocfs_file *) filp->private_data;
while (1) {
- int r;
+ int r;
ino_t ino;
__u64 voteoff;
- /* TODO: find out if we need locking around this ofile */
- if (ofile->filldir.ino != 0) {
- r=filldir (dirent, ofile->filldir.fname, strlen (ofile->filldir.fname),
- ofile->filldir.pos, ofile->filldir.ino, DT_UNKNOWN);
- ofile->filldir.ino = 0;
- if (r < 0)
+ /* TODO: find out if we need locking around this ofile */
+ if (ofile->filldir.ino != 0) {
+ r=filldir (dirent, ofile->filldir.fname, strlen (ofile->filldir.fname),
+ ofile->filldir.pos, ofile->filldir.ino, DT_UNKNOWN);
+ ofile->filldir.ino = 0;
+ if (r < 0)
LOG_ERROR_STR("filldir failed");
- } else {
+ } else {
r = ocfs_find_files_on_disk (osb, NULL, &entry_bh,
ofile, inode, 1);
if (r < 0)
@@ -124,18 +124,18 @@
voteoff = entry->this_sector;
ino = ocfs_inode_hash_lookup_ino(osb, voteoff);
- r=filldir (dirent, entry->filename, strlen (entry->filename), filp->f_pos, ino, DT_UNKNOWN);
- if (r < 0) {
- memcpy(ofile->filldir.fname, entry->filename, OCFS_MAX_FILENAME_LENGTH);
- ofile->filldir.pos = filp->f_pos;
- ofile->filldir.ino = ino;
+ r=filldir (dirent, entry->filename, strlen (entry->filename), filp->f_pos, ino, DT_UNKNOWN);
+ if (r < 0) {
+ memcpy(ofile->filldir.fname, entry->filename, OCFS_MAX_FILENAME_LENGTH);
+ ofile->filldir.pos = filp->f_pos;
+ ofile->filldir.ino = ino;
}
OCFS_BH_PUT_DATA(entry_bh);
brelse(entry_bh);
entry_bh = NULL; entry = NULL;
if (r < 0)
goto bail;
- }
+ }
pos++;
filp->f_pos++;
}
@@ -476,7 +476,7 @@
ocfs_file_entry *fe;
int res = -1, index = 0, start = 0;
int ret = 0;
- struct qstr q;
+ struct qstr q;
ocfs_dir_node * DirNode = NULL;
LOG_ENTRY ();
@@ -499,9 +499,9 @@
FILEENT_PUTBH(DirNode, bhs, index);
continue;
}
- q.name = fe->filename;
- q.len = strlen(fe->filename);
- res = ocfs_compare_qstr(&q, FileName);
+ q.name = fe->filename;
+ q.len = strlen(fe->filename);
+ res = ocfs_compare_qstr(&q, FileName);
FILEENT_PUTBH(DirNode, bhs, index);
if (!res) {
@@ -531,10 +531,10 @@
FILEENT_PUTBH(DirNode, bhs, index);
continue;
}
-
- q.name = fe->filename;
- q.len = strlen(fe->filename);
- res = ocfs_compare_qstr(&q, FileName);
+
+ q.name = fe->filename;
+ q.len = strlen(fe->filename);
+ res = ocfs_compare_qstr(&q, FileName);
FILEENT_PUTBH(DirNode, bhs, index);
if (!res) {
@@ -553,9 +553,9 @@
goto bail;
}
- q.name = fe->filename;
- q.len = strlen(fe->filename);
- res = ocfs_compare_qstr(&q, FileName);
+ q.name = fe->filename;
+ q.len = strlen(fe->filename);
+ res = ocfs_compare_qstr(&q, FileName);
FILEENT_PUTBH(DirNode, bhs, index);
if (!res) {
@@ -692,7 +692,7 @@
int index = -1;
ocfs_file_entry *lastEntry;
__u8 freeOffset;
- struct qstr q;
+ struct qstr q;
ocfs_dir_node * DirNode = NULL;
LOG_ENTRY ();
@@ -1096,7 +1096,7 @@
/* we read the head_del_ent_node or the free_node_ptr, but */
/* hit the old BUG. there are no free slots at dir_off. */
- /* need to search. */
+ /* need to search. */
/* dump the bhs already found */
for (i=0; i<256; i++) {
Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/dlm.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -1312,7 +1312,7 @@
lock_id = GET_INODE_FEOFF(inode);
if (flags & FLAG_READDIR) {
- if (flags & (FLAG_CHANGE_MASTER | FLAG_REMASTER)) {
+ if (flags & (FLAG_CHANGE_MASTER | FLAG_REMASTER)) {
/* there is no readonly_node. treat like normal change master. */
flags &= ~FLAG_READDIR;
}
Modified: trunk/src/extmap.c
===================================================================
--- trunk/src/extmap.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/extmap.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -65,7 +65,7 @@
OCFS_ASSERT (map != NULL);
if (map->initialized) {
- spin_lock(&(map->lock));
+ spin_lock(&(map->lock));
if (map->initialized) {
struct list_head *tmp, *tmp2;
ocfs_extent *ext;
@@ -82,7 +82,7 @@
}
map->initialized = 0;
}
- spin_unlock(&(map->lock));
+ spin_unlock(&(map->lock));
}
LOG_EXIT ();
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/file.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -98,7 +98,7 @@
int truncate_pages = 0;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", inode, file,
- file->f_dentry->d_name.len, file->f_dentry->d_name.name);
+ file->f_dentry->d_name.len, file->f_dentry->d_name.name);
osb = OCFS_SB(inode->i_sb);
@@ -265,25 +265,25 @@
int ocfs_file_release (struct inode *inode, struct file *file)
{
ocfs_file *ofile = NULL;
- ocfs_super * osb;
- struct dentry *dentry;
+ ocfs_super * osb;
+ struct dentry *dentry;
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);
+ file->f_dentry->d_name.len, file->f_dentry->d_name.name);
dentry = file->f_dentry;
if (file->private_data)
- ofile = (ocfs_file *) file->private_data;
+ ofile = (ocfs_file *) file->private_data;
- osb = OCFS_SB(inode->i_sb);
+ osb = OCFS_SB(inode->i_sb);
- /* dir */
+ /* dir */
if (S_ISDIR (inode->i_mode)) {
- /* fix all this - need a real open/close for directories */
+ /* fix all this - need a real open/close for directories */
if (ofile) {
- if (ofile->curr_dir_buf) {
+ if (ofile->curr_dir_buf) {
const int nbhs = osb->vol_layout.dir_node_size >> osb->sect_size_bits;
struct buffer_head **bhs;
int i;
@@ -295,27 +295,27 @@
bhs[i]=NULL;
}
}
- ocfs_safefree (ofile->curr_dir_buf);
- ofile->curr_dir_buf = NULL;
- }
+ ocfs_safefree (ofile->curr_dir_buf);
+ ofile->curr_dir_buf = NULL;
+ }
ocfs_release_ofile (ofile);
- }
- goto bail;
- }
+ }
+ goto bail;
+ }
- down (&(OCFS_I(inode)->priv_sem));
- OCFS_I(inode)->open_hndl_cnt--;
+ down (&(OCFS_I(inode)->priv_sem));
+ OCFS_I(inode)->open_hndl_cnt--;
if (!OCFS_I(inode)->open_hndl_cnt)
last_close = 1;
- if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
- up (&(OCFS_I(inode)->priv_sem));
- goto bail;
- }
+ if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
+ up (&(OCFS_I(inode)->priv_sem));
+ goto bail;
+ }
- LOG_TRACE_ARGS ("openhandles: %d / osbfiles: %lld / refcount: %d\n",
- OCFS_I(inode)->open_hndl_cnt, osb->file_open_cnt,
- atomic_read(&dentry->d_count));
+ LOG_TRACE_ARGS ("openhandles: %d / osbfiles: %lld / refcount: %d\n",
+ OCFS_I(inode)->open_hndl_cnt, osb->file_open_cnt,
+ atomic_read(&dentry->d_count));
if (last_close) {
ocfs_extent_map_destroy (&OCFS_I(inode)->map);
@@ -371,7 +371,7 @@
int err = 0;
LOG_ENTRY_ARGS ("(0x%p, '%*s')\n", file,
- file->f_dentry->d_name.len, file->f_dentry->d_name.name);
+ file->f_dentry->d_name.len, file->f_dentry->d_name.name);
err = ocfs_sync_inode(file->f_dentry->d_inode);
LOG_EXIT_STATUS (err);
@@ -390,7 +390,7 @@
ocfs_super *osb = OCFS_SB(inode->i_sb);
LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, '%*s')\n", file, dentry, datasync,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
err = ocfs_sync_inode(dentry->d_inode);
if (err)
@@ -549,7 +549,7 @@
int needs_trunc = 0;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, %u, '%*s')\n", filp, buf,
- (unsigned int)count,
+ (unsigned int)count,
filp->f_dentry->d_name.len, filp->f_dentry->d_name.name);
/* happy write of zero bytes */
@@ -712,7 +712,7 @@
LOG_ENTRY_ARGS ("(0x%p, 0x%p, %u, '%*s')\n", filp, buf,
(unsigned int)count,
- filp->f_dentry->d_name.len, filp->f_dentry->d_name.name);
+ filp->f_dentry->d_name.len, filp->f_dentry->d_name.name);
if (!inode) {
@@ -782,7 +782,7 @@
int bFileLockAcquired = 0;
int bAcquiredLock = 0;
int bCacheLock = 0;
- __u64 new_alloc_size;
+ __u64 new_alloc_size;
struct buffer_head *bh = NULL;
int flags = 0;
ocfs_journal_handle *handle = NULL;
@@ -1197,7 +1197,7 @@
int needs_trunc = 0;
LOG_ENTRY_ARGS ("(0x%p, '%*s')\n", dentry,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
osb = OCFS_SB(inode->i_sb);
@@ -1265,7 +1265,7 @@
if (needs_trunc)
ocfs_truncate_inode_pages(inode, 0);
- if (inode->i_size > newsize)
+ if (inode->i_size > newsize)
status = ocfs_truncate_file(osb, fileOff, newsize,
inode);
else {
@@ -1369,7 +1369,7 @@
ocfs_super *osb;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", dentry, attr,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
inode = dentry->d_inode;
if (inode == NULL || !OCFS_I(inode)->open_hndl_cnt)
Modified: trunk/src/heartbeat.c
===================================================================
--- trunk/src/heartbeat.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/heartbeat.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -63,13 +63,13 @@
if (pub_bh == NULL && !read_publish)
BUG();
- if (read_publish) {
+ if (read_publish) {
status = ocfs_read_bh(osb, node_publ_off, pub_bh, 0, NULL);
- if (status < 0) {
- LOG_ERROR_STATUS (status);
- goto finally;
- }
- }
+ if (status < 0) {
+ LOG_ERROR_STATUS (status);
+ goto finally;
+ }
+ }
publish = (ocfs_publish *) OCFS_BH_GET_DATA_WRITE(*pub_bh); /* write */
if ((publish->dirty) && (!osb->publish_dirty)) {
Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/inc/ocfs.h 2004-05-12 19:49:36 UTC (rev 913)
@@ -178,12 +178,12 @@
#define OCFS_ASSERT(x) do { if (!(x)) BUG(); } while (0)
#define OCFS_BREAKPOINT() printk("DEBUG BREAKPOINT! %s, %d\n", \
- __FILE__, __LINE__)
+ __FILE__, __LINE__)
#define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
#define BX_(x) ((x) - (((x)>>1)&0x77777777) \
- - (((x)>>2)&0x33333333) \
+ - (((x)>>2)&0x33333333) \
- (((x)>>3)&0x11111111))
@@ -210,10 +210,10 @@
#else
/* time is in 0.1 microsecs */
#define OcfsQuerySystemTime(t) \
- do { \
- (*t) = (__u64)((__u64)CURRENT_TIME * (__u64)10000000); \
- (*t) += (__u64)((__u64)xtime.tv_usec * (__u64)10); \
- } while (0)
+ do { \
+ (*t) = (__u64)((__u64)CURRENT_TIME * (__u64)10000000); \
+ (*t) += (__u64)((__u64)xtime.tv_usec * (__u64)10); \
+ } while (0)
#define OCFS_CURRENT_TIME (CURRENT_TIME)
#define OCFS_SET_INODE_TIME(i, x, y) i->x = (y)
#endif
@@ -227,7 +227,7 @@
#define FIRST_FILE_ENTRY(dir) ((char *) ((char *)dir)+OCFS_SECTOR_SIZE)
#define FILEENT(dir,idx) (ocfs_file_entry *) ( ((char *)dir) + \
- ((dir->index[idx]+1) * OCFS_SECTOR_SIZE))
+ ((dir->index[idx]+1) * OCFS_SECTOR_SIZE))
#define FILEENT_GETBH_WRITE(dir,bhs,idx) \
@@ -498,7 +498,7 @@
#define OCFS_COMM_TYPE "type"
#define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGHUP) | \
- sigmask(SIGINT) | sigmask(SIGQUIT))
+ sigmask(SIGINT) | sigmask(SIGQUIT))
#define EFAIL 999
#define EWARNING 998
@@ -543,48 +543,48 @@
#define _OCFSDEF_H_
#define IS_VALID_DIR_NODE(ptr) \
- (!strncmp((ptr)->signature, OCFS_DIR_NODE_SIGNATURE, \
- strlen(OCFS_DIR_NODE_SIGNATURE)))
+ (!strncmp((ptr)->signature, OCFS_DIR_NODE_SIGNATURE, \
+ strlen(OCFS_DIR_NODE_SIGNATURE)))
/* sm - ocfs 1.0 fails to set fe->sig for dirs */
#define IS_VALID_FILE_ENTRY(ptr) \
(((ptr)->attribs & OCFS_ATTRIB_DIRECTORY) || \
(!strcmp((ptr)->signature, OCFS_FILE_ENTRY_SIGNATURE)))
#define IS_VALID_EXTENT_HEADER(ptr) \
- (!strcmp((ptr)->signature, OCFS_EXTENT_HEADER_SIGNATURE))
+ (!strcmp((ptr)->signature, OCFS_EXTENT_HEADER_SIGNATURE))
#define IS_VALID_EXTENT_DATA(ptr) \
- (!strcmp((ptr)->signature, OCFS_EXTENT_DATA_SIGNATURE))
+ (!strcmp((ptr)->signature, OCFS_EXTENT_DATA_SIGNATURE))
#define IS_VALID_NODE_NUM(node) \
- (((node) >= 0) && ((node) < OCFS_MAXIMUM_NODES))
+ (((node) >= 0) && ((node) < OCFS_MAXIMUM_NODES))
#define OCFS_GET_EXTENT(vbo, extent, k) \
- do { \
- for ((k) = 0; (k) < OCFS_MAX_DATA_EXTENTS; (k)++) { \
- if((__s64)((extent)->extents[(k)].file_off + \
- (extent)->extents[(k)].num_bytes) > (vbo)) \
- break; \
- } \
- } while(0)
+ do { \
+ for ((k) = 0; (k) < OCFS_MAX_DATA_EXTENTS; (k)++) { \
+ if((__s64)((extent)->extents[(k)].file_off + \
+ (extent)->extents[(k)].num_bytes) > (vbo)) \
+ break; \
+ } \
+ } while(0)
#define OCFS_GET_FILE_ENTRY_EXTENT(vbo, fileentry, k) \
- do { \
- for ((k) = 0; (k) < OCFS_MAX_FILE_ENTRY_EXTENTS; (k)++) { \
- if((__s64)((fileentry)->extents[(k)].file_off + \
- (fileentry)->extents[(k)].length) > (vbo)) \
- break; \
- } \
- } while(0)
+ do { \
+ for ((k) = 0; (k) < OCFS_MAX_FILE_ENTRY_EXTENTS; (k)++) { \
+ if((__s64)((fileentry)->extents[(k)].file_off + \
+ (fileentry)->extents[(k)].length) > (vbo)) \
+ break; \
+ } \
+ } while(0)
#define CHECK_FOR_LAST_EXTENT(fileentry, k) \
- do { \
- for((k) = 0; (k) < OCFS_MAX_FILE_ENTRY_EXTENTS; (k)++) { \
- if((fileentry)->extents[(k)].disk_off == 0) \
- break; \
- } \
- (k) = ((k) >= 1) ? ((k) - 1) : (k); \
- } while(0)
+ do { \
+ for((k) = 0; (k) < OCFS_MAX_FILE_ENTRY_EXTENTS; (k)++) { \
+ if((fileentry)->extents[(k)].disk_off == 0) \
+ break; \
+ } \
+ (k) = ((k) >= 1) ? ((k) - 1) : (k); \
+ } while(0)
#define down_with_flag(_sem, _flg) \
do { \
@@ -611,21 +611,21 @@
#define OCFS_CLEAR_FLAG(flag, value) ((flag) &= ~(value))
#define OCFS_SECTOR_ALIGN(buf) \
- ((__u64)buf + \
- (((__u64)buf % OCFS_SECTOR_SIZE) ? \
- (OCFS_SECTOR_SIZE - ((__u64)buf % OCFS_SECTOR_SIZE)):0))
+ ((__u64)buf + \
+ (((__u64)buf % OCFS_SECTOR_SIZE) ? \
+ (OCFS_SECTOR_SIZE - ((__u64)buf % OCFS_SECTOR_SIZE)):0))
#define OCFS_ALIGN(val, align) \
- ((__u64)val + \
- (((__u64)val % align) ? (align - ((__u64)val % align)): 0))
+ ((__u64)val + \
+ (((__u64)val % align) ? (align - ((__u64)val % align)): 0))
/*
** Structures...
*/
#define IS_NODE_ALIVE(pubmap, i, numnodes) \
- (((pubmap) >> ((i) % (numnodes))) & 0x1)
+ (((pubmap) >> ((i) % (numnodes))) & 0x1)
#define NODE_NEEDS_RECOVERY(osb,i) (((i)!=OCFS_INVALID_NODE_NUM) && (i)!=(osb)->node_num && \
!IS_NODE_ALIVE((osb)->publ_map,i,OCFS_MAXIMUM_NODES))
@@ -640,13 +640,13 @@
** consistency checking ...
*/
#define UPDATE_PUBLISH_MAP(pubmap, num, flag, numnodes) \
- do { \
- __u64 var = 0x1; \
- if((flag) == OCFS_PUBLISH_CLEAR) \
- (pubmap) &= (~(var << ((num) % (numnodes)))); \
- else \
- (pubmap) |= (var << ((num) % (numnodes))); \
- } while(0)
+ do { \
+ __u64 var = 0x1; \
+ if((flag) == OCFS_PUBLISH_CLEAR) \
+ (pubmap) &= (~(var << ((num) % (numnodes)))); \
+ else \
+ (pubmap) |= (var << ((num) % (numnodes))); \
+ } while(0)
/* update the recovery map here */
#define SET_NODE_IN_RECOVERY(osb, num) \
@@ -751,14 +751,14 @@
/* lockres macros */
#ifdef OCFS_MEM_DBG
#define ocfs_allocate_extent_entry() (ocfs_extent *)ocfs_dbg_slab_alloc( \
- OcfsGlobalCtxt.extent_cache, \
- __FILE__, __LINE__)
+ OcfsGlobalCtxt.extent_cache, \
+ __FILE__, __LINE__)
#define ocfs_free_extent_entry(ext) ocfs_dbg_slab_free( \
- OcfsGlobalCtxt.extent_cache, ext)
+ OcfsGlobalCtxt.extent_cache, ext)
#else /* !OCFS_MEM_DBG */
#define ocfs_allocate_extent_entry() (ocfs_extent *)kmem_cache_alloc ( \
- OcfsGlobalCtxt.extent_cache, GFP_NOFS)
+ OcfsGlobalCtxt.extent_cache, GFP_NOFS)
#define ocfs_free_extent_entry(ext) kmem_cache_free(OcfsGlobalCtxt.extent_cache, ext)
#endif
@@ -766,12 +766,12 @@
/* ofile macros */
#ifdef OCFS_MEM_DBG
#define ocfs_allocate_ofile(flag) ((ocfs_file *)({ \
- ocfs_file *of = NULL; \
- of = ocfs_dbg_slab_alloc(OcfsGlobalCtxt.ofile_cache, __FILE__, __LINE__); \
+ ocfs_file *of = NULL; \
+ of = ocfs_dbg_slab_alloc(OcfsGlobalCtxt.ofile_cache, __FILE__, __LINE__); \
if (of != NULL) { \
memset (of, 0, sizeof (ocfs_file)); \
of->obj_id.type = OCFS_TYPE_OFILE; \
- of->obj_id.size = sizeof (ocfs_file); \
+ of->obj_id.size = sizeof (ocfs_file); \
if (flag==OCFS_ATTRIB_DIRECTORY) { \
int sz = OCFS_DEFAULT_DIR_NODE_SECTS * sizeof(struct buffer_head *); \
of->curr_dir_buf = ocfs_malloc(sz); \
@@ -781,21 +781,21 @@
} else \
memset(of->curr_dir_buf, 0, sz); \
} \
- } \
+ } \
of; }))
#define ocfs_release_ofile(of) ({ \
OCFS_ASSERT (of); \
ocfs_safefree (of->curr_dir_buf); \
- ocfs_dbg_slab_free (OcfsGlobalCtxt.ofile_cache, of); })
+ ocfs_dbg_slab_free (OcfsGlobalCtxt.ofile_cache, of); })
#else /* !OCFS_MEM_DBG */
#define ocfs_allocate_ofile(flag) ((ocfs_file *)({ \
- ocfs_file *of = NULL; \
+ ocfs_file *of = NULL; \
of = kmem_cache_alloc (OcfsGlobalCtxt.ofile_cache, GFP_NOFS); \
if (of != NULL) { \
memset (of, 0, sizeof (ocfs_file)); \
of->obj_id.type = OCFS_TYPE_OFILE; \
- of->obj_id.size = sizeof (ocfs_file); \
+ of->obj_id.size = sizeof (ocfs_file); \
if (flag==OCFS_ATTRIB_DIRECTORY) { \
int sz = OCFS_DEFAULT_DIR_NODE_SECTS * sizeof(struct buffer_head *); \
of->curr_dir_buf = ocfs_malloc(sz); \
@@ -805,7 +805,7 @@
} else \
memset(of->curr_dir_buf, 0, sz); \
} \
- } \
+ } \
of; }))
#define ocfs_release_ofile(of) ({ \
@@ -1111,27 +1111,27 @@
static inline void eat_value_int(int val)
{
- return;
+ return;
}
static inline void eat_value_uint(unsigned int val)
{
- return;
+ return;
}
static inline void eat_value_long(long val)
{
- return;
+ return;
}
static inline void eat_value_ulong(unsigned long val)
{
- return;
+ return;
}
static inline void eat_value_ptr(void *val)
{
- return;
+ return;
}
/* TRACE disabled. ERROR macros are never disabled. */
@@ -1281,8 +1281,8 @@
#define DLOCK_FLAG_LAST_UPDATE (0x10)
#define DLOCK_FLAG_ADD_SELF (0x20)
#define DLOCK_FLAG_ALL (DLOCK_FLAG_OPEN_MAP | DLOCK_FLAG_LOCK | \
- DLOCK_FLAG_SEQ_NUM | DLOCK_FLAG_MASTER | \
- DLOCK_FLAG_LAST_UPDATE)
+ DLOCK_FLAG_SEQ_NUM | DLOCK_FLAG_MASTER | \
+ DLOCK_FLAG_LAST_UPDATE)
#define DISK_LOCK_CURRENT_MASTER(x) ( ((ocfs_disk_lock *)x)->curr_master )
@@ -1517,12 +1517,12 @@
typedef struct _alloc_item
{
- enum { SLAB_ITEM, KMALLOC_ITEM, VMALLOC_ITEM } type;
+ enum { SLAB_ITEM, KMALLOC_ITEM, VMALLOC_ITEM } type;
void *address;
- union {
- int length;
- void *slab;
- } u;
+ union {
+ int length;
+ void *slab;
+ } u;
struct list_head list;
char tag[30];
}
@@ -1903,7 +1903,7 @@
spinlock_t comm_seq_lock; /* protects comm_seq_num */
__u64 comm_seq_num; /* local node seq num used in ipcdlm */
#ifdef OCFS_LINUX_MEM_DEBUG
- struct list_head item_list;
+ struct list_head item_list;
#endif
struct list_head *bh_sem_hash;
spinlock_t bh_sem_hash_lock;
@@ -2010,7 +2010,7 @@
{
ocfs_disk_lock disk_lock; // DISKLOCK
__u8 signature[8]; // CHAR[8]
- __u32 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)
@@ -2034,7 +2034,7 @@
__u32 gid; // GID
__u16 dev_major; // NUMBER RANGE(0,65535)
__u16 dev_minor; // NUMBER RANGE(0,65535)
- __u8 fe_reserved1[4]; // UNUSED
+ __u8 fe_reserved1[4]; // UNUSED
union {
__u64 fe_private;
__u64 child_dirnode; // NUMBER RANGE(0,ULONG_LONG_MAX)
@@ -2532,10 +2532,10 @@
#define ocfs_wait(wq, condition, timeout) \
({ \
- int __ret = 0; \
- if (!(condition)) \
- __ocfs_wait(wq, condition, timeout, __ret); \
- __ret; \
+ int __ret = 0; \
+ if (!(condition)) \
+ __ocfs_wait(wq, condition, timeout, __ret); \
+ __ret; \
})
#endif /* !USERSPACE_TOOL */
Modified: trunk/src/inc/proto.h
===================================================================
--- trunk/src/inc/proto.h 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/inc/proto.h 2004-05-12 19:49:36 UTC (rev 913)
@@ -203,9 +203,9 @@
int ocfs_process_bitmap_free_head(ocfs_super *osb, ocfs_bitmap_free_head *f);
int ocfs_add_to_bitmap_free_head(ocfs_super *osb,
- ocfs_bitmap_free_head *f,
- __u32 len, __u32 fileoff,
- __u32 nodenum, __u32 type);
+ ocfs_bitmap_free_head *f,
+ __u32 len, __u32 fileoff,
+ __u32 nodenum, __u32 type);
int ocfs_empty (struct dentry *dentry);
Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/inode.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -90,10 +90,10 @@
.open = ocfs_file_open,
.ioctl = ocfs_ioctl,
#ifdef AIO_ENABLED
- .kvec_read = ocfs_kvec_read,
- .kvec_write = ocfs_kvec_write,
- .aio_read = generic_file_aio_read,
- .aio_write = generic_file_aio_write,
+ .kvec_read = ocfs_kvec_read,
+ .kvec_write = ocfs_kvec_write,
+ .aio_read = generic_file_aio_read,
+ .aio_write = generic_file_aio_write,
#endif
};
@@ -1211,14 +1211,14 @@
*
* now:
static int ocfs_direct_IO(int rw, struct kiocb *iocb,
- const struct iovec *iov, loff_t offset,
- unsigned long nr_segs)
+ const struct iovec *iov, loff_t offset,
+ unsigned long nr_segs)
* int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
* loff_t offset, unsigned long nr_segs);
*/
static int ocfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs)
{
- struct file *file = iocb->ki_filp;
+ struct file *file = iocb->ki_filp;
struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
int ret;
@@ -1319,26 +1319,26 @@
if (rw == READ) {
if (inode->i_size < *offp) /* read past end of file */
- return 0;
- if (size > (inode->i_size - *offp))
- size = inode->i_size - *offp;
- }
+ return 0;
+ if (size > (inode->i_size - *offp))
+ size = inode->i_size - *offp;
+ }
/* make sure we are aligned to either 4kb or 512 byte IO */
#ifndef LARGEIOS
if ((*offp & sector_mask) || (size & sector_mask))
/* if not, then fail, we need either to do dio */
- return err;
+ return err;
- max_sectors = KIO_MAX_SECTORS;
- large_io = 0;
+ max_sectors = KIO_MAX_SECTORS;
+ large_io = 0;
#endif
#ifdef LARGEIOS
if ((*offp & 4095) || (size & 4095)) {
/* if it's not 4kb, then 512 */
if ((*offp & sector_mask) || (size & sector_mask))
/* if not, then fail, we need either to do dio */
- return err;
+ return err;
max_sectors = KIO_MAX_SECTORS; /* for 2.4.9 - 1024 */
} /* ok we 're 4kb aligned, lets see if the buffer is */
else {
@@ -1376,43 +1376,43 @@
err = 0;
goto out;
}
- while (myiosize > 0) {
- if (blocks_end_cluster + 1 > myiosize) {
- totalioblocks += myiosize;
- myiosize = 0;
- goto doio;
- } else {
- totalioblocks += blocks_end_cluster;
- myiosize -= blocks_end_cluster;
- nextlogic = firstlogic + blocks_end_cluster;
- }
+ while (myiosize > 0) {
+ if (blocks_end_cluster + 1 > myiosize) {
+ totalioblocks += myiosize;
+ myiosize = 0;
+ goto doio;
+ } else {
+ totalioblocks += blocks_end_cluster;
+ myiosize -= blocks_end_cluster;
+ nextlogic = firstlogic + blocks_end_cluster;
+ }
again:
- ret = ocfs_get_block2 (inode, nextlogic, &nextphys, sector_size);
- if (ret == -1) {
- err = 0;
- goto out;
- }
- if (nextphys == (firstphys + totalioblocks)) {
+ ret = ocfs_get_block2 (inode, nextlogic, &nextphys, sector_size);
+ if (ret == -1) {
+ err = 0;
+ goto out;
+ }
+ if (nextphys == (firstphys + totalioblocks)) {
// merge ok
blocks_end_cluster = clustersize - (nextlogic % clustersize);
- if (blocks_end_cluster + 1 > myiosize) {
- totalioblocks += myiosize;
- myiosize = 0;
- } else {
- totalioblocks += blocks_end_cluster;
- myiosize -= blocks_end_cluster;
- nextlogic = nextlogic + blocks_end_cluster;
- goto again;
- }
- }
+ if (blocks_end_cluster + 1 > myiosize) {
+ totalioblocks += myiosize;
+ myiosize = 0;
+ } else {
+ totalioblocks += blocks_end_cluster;
+ myiosize -= blocks_end_cluster;
+ nextlogic = nextlogic + blocks_end_cluster;
+ goto again;
+ }
+ }
doio:
- size = totalioblocks << sector_bits;
- if (large_io)
- nbhs = (size >> 12);
- else
- nbhs = (size >> sector_bits);
- if (nbhs > max_sectors)
- nbhs = max_sectors;
+ size = totalioblocks << sector_bits;
+ if (large_io)
+ nbhs = (size >> 12);
+ else
+ nbhs = (size >> sector_bits);
+ if (nbhs > max_sectors)
+ nbhs = max_sectors;
#ifdef KERNEL_NO_F_IOBUF
err = alloc_kiovec_sz (1, &iobuf, &nbhs);
@@ -1434,66 +1434,66 @@
#endif
inuse = 1;
- totalioblocks = 0;
- while (size > 0) {
- if (large_io) {
- blocks = size >> 12;
- if (blocks > max_sectors)
- blocks = max_sectors;
- iosize = blocks << 12;
- } else {
- blocks = size >> sector_bits;
- if (blocks > max_sectors)
- blocks = max_sectors;
- iosize = blocks << sector_bits;
- }
- if (!blocks)
- break;
- err = map_user_kiobuf (rw, iobuf, (unsigned long) buf, iosize);
- if (err)
- break;
+ totalioblocks = 0;
+ while (size > 0) {
+ if (large_io) {
+ blocks = size >> 12;
+ if (blocks > max_sectors)
+ blocks = max_sectors;
+ iosize = blocks << 12;
+ } else {
+ blocks = size >> sector_bits;
+ if (blocks > max_sectors)
+ blocks = max_sectors;
+ iosize = blocks << sector_bits;
+ }
+ if (!blocks)
+ break;
+ err = map_user_kiobuf (rw, iobuf, (unsigned long) buf, iosize);
+ if (err)
+ break;
/* get the blocknr depending on io size for all blocks */
- /* since we are awlays within the extent we only need to get the first block */
+ /* since we are awlays within the extent we only need to get the first block */
OCFS_KIO_BLOCKS(iobuf)[0] = firstphys + totalioblocks;
- if (large_io) {
- blocknr+=8;
+ if (large_io) {
+ blocknr+=8;
OCFS_KIO_BLOCKS(iobuf)[0] = OCFS_KIO_BLOCKS(iobuf)[0] / 8;
- } else {
- blocknr++;
- }
+ } else {
+ blocknr++;
+ }
- for (i = 1; i < blocks; i++) {
- if (large_io) {
- blocknr+=8;
- } else {
- blocknr++;
- }
+ for (i = 1; i < blocks; i++) {
+ if (large_io) {
+ blocknr+=8;
+ } else {
+ blocknr++;
+ }
OCFS_KIO_BLOCKS(iobuf)[i] = OCFS_KIO_BLOCKS(iobuf)[0] + i;
- }
+ }
err = brw_kiovec (rw, 1, &iobuf, inode->i_dev, OCFS_KIO_BLOCKS(iobuf),
large_io ? 4096 : sector_size);
#ifdef SUSE
if (rw == READ && err > 0)
mark_dirty_kiobuf(iobuf, err);
#endif
- if (err >= 0) {
- transferred += err;
- size -= err;
- buf += err;
- if (large_io) {
- totalioblocks += (blocks * 8);
- } else {
- totalioblocks += blocks;
+ if (err >= 0) {
+ transferred += err;
+ size -= err;
+ buf += err;
+ if (large_io) {
+ totalioblocks += (blocks * 8);
+ } else {
+ totalioblocks += blocks;
}
- } else {
+ } else {
printk( "ocfs_rw_direct : brw_kiovec() %d\n", err);
break;
}
- unmap_kiobuf (iobuf);
- if (err != iosize)
- break;
- }
+ unmap_kiobuf (iobuf);
+ if (err != iosize)
+ break;
+ }
#ifdef KERNEL_NO_F_IOBUF
free_kiovec_sz(1, &iobuf, &nbhs);
#else
@@ -1506,16 +1506,16 @@
totalioblocks = 0;
firstlogic = nextlogic;
firstphys = nextphys;
- }
- if (transferred) {
- *offp += transferred;
- err = transferred;
- }
+ }
+ if (transferred) {
+ *offp += transferred;
+ err = transferred;
+ }
out:
#ifdef KERNEL_NO_F_IOBUF
- if (inuse)
- free_kiovec_sz (1, &iobuf, &nbhs);
+ if (inuse)
+ free_kiovec_sz (1, &iobuf, &nbhs);
#else
if (inuse) {
if (!new_iobuf)
@@ -1541,24 +1541,24 @@
int ocfs_kvec_rw(struct file *filp, int rw, kvec_cb_t cb, size_t size, loff_t pos)
{
- int err = 0;
- int max_sectors = 25000;
- struct inode *inode = filp->f_dentry->d_inode;
- unsigned long blocknr, blocks, iosize,myiosize;
- long firstphys;
- int clustersize;
- unsigned long blocks_end_cluster = 0;
+ int err = 0;
+ int max_sectors = 25000;
+ struct inode *inode = filp->f_dentry->d_inode;
+ unsigned long blocknr, blocks, iosize,myiosize;
+ long firstphys;
+ int clustersize;
+ unsigned long blocks_end_cluster = 0;
- /* FIXME: Need to differentiate betwen sectors and blocksize */
- int sector_bits = 9;
- int sector_size = 512;
- int sector_mask = 511;
+ /* FIXME: Need to differentiate betwen sectors and blocksize */
+ int sector_bits = 9;
+ int sector_size = 512;
+ int sector_mask = 511;
- int ret;
- unsigned long firstlogic;
- long nextphys;
- unsigned long nextlogic = 0;
- unsigned long totalioblocks = 0;
+ int ret;
+ unsigned long firstlogic;
+ long nextphys;
+ unsigned long nextlogic = 0;
+ unsigned long totalioblocks = 0;
if (!size || (pos == inode->i_size)) {
cb.fn(cb.data, cb.vec, err);
@@ -1585,49 +1585,49 @@
return err;;
}
- iosize = blocks << sector_bits;
- clustersize = inode->i_blksize >> sector_bits;
- blocks_end_cluster = clustersize - (blocknr % clustersize);
- myiosize = size >> 9;
- firstlogic = blocknr;
- totalioblocks = 0;
+ iosize = blocks << sector_bits;
+ clustersize = inode->i_blksize >> sector_bits;
+ blocks_end_cluster = clustersize - (blocknr % clustersize);
+ myiosize = size >> 9;
+ firstlogic = blocknr;
+ totalioblocks = 0;
- err = ocfs_get_block2(inode, blocknr, &firstphys, sector_size);
- if ( err == -1 ) {
- err = 0;
- return err;
- }
- if (blocks_end_cluster + 1 > myiosize) {
- totalioblocks += myiosize;
- myiosize = 0;
- goto doio;
- } else {
- totalioblocks += blocks_end_cluster;
- myiosize -= blocks_end_cluster;
- nextlogic = firstlogic + blocks_end_cluster;
- }
+ err = ocfs_get_block2(inode, blocknr, &firstphys, sector_size);
+ if ( err == -1 ) {
+ err = 0;
+ return err;
+ }
+ if (blocks_end_cluster + 1 > myiosize) {
+ totalioblocks += myiosize;
+ myiosize = 0;
+ goto doio;
+ } else {
+ totalioblocks += blocks_end_cluster;
+ myiosize -= blocks_end_cluster;
+ nextlogic = firstlogic + blocks_end_cluster;
+ }
again:
- ret = ocfs_get_block2 (inode, nextlogic, &nextphys, sector_size);
- if (ret == -1) {
- err = 0;
- return err;
- }
- if (nextphys == (firstphys + totalioblocks)) {
- blocks_end_cluster = clustersize - (nextlogic % clustersize);
- if (blocks_end_cluster + 1 > myiosize) {
- totalioblocks += myiosize;
- myiosize = 0;
- } else {
- totalioblocks += blocks_end_cluster;
- myiosize -= blocks_end_cluster;
- nextlogic = nextlogic + blocks_end_cluster;
- goto again;
- }
- }
+ ret = ocfs_get_block2 (inode, nextlogic, &nextphys, sector_size);
+ if (ret == -1) {
+ err = 0;
+ return err;
+ }
+ if (nextphys == (firstphys + totalioblocks)) {
+ blocks_end_cluster = clustersize - (nextlogic % clustersize);
+ if (blocks_end_cluster + 1 > myiosize) {
+ totalioblocks += myiosize;
+ myiosize = 0;
+ } else {
+ totalioblocks += blocks_end_cluster;
+ myiosize -= blocks_end_cluster;
+ nextlogic = nextlogic + blocks_end_cluster;
+ goto again;
+ }
+ }
doio:
- blocks = totalioblocks;
- err = brw_kvec_async(rw, cb, inode->i_dev, blocks, firstphys, sector_bits);
- return err;
+ blocks = totalioblocks;
+ err = brw_kvec_async(rw, cb, inode->i_dev, blocks, firstphys, sector_bits);
+ return err;
}
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/journal.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -513,8 +513,8 @@
journal_forget(handle->k_handle, bh);
/* this buffer has changed data which we want to
- * consider invalid -- mark the sequence number as
- * old. */
+ * consider invalid -- mark the sequence number as
+ * old. */
CLEAR_BH_SEQNUM(bh);
if (buffer_jbd(bh))
@@ -1565,7 +1565,7 @@
/* Read the publish sector */
node_publ_off = osb->vol_layout.publ_sect_off +
- (node_num * osb->sect_size);
+ (node_num * osb->sect_size);
status = ocfs_read_bh(osb, node_publ_off, &publish_bh,
OCFS_BH_COND_CACHED, NULL);
if (status < 0) {
@@ -1695,11 +1695,11 @@
- /* Flush all scheduled tasks */
+ /* Flush all scheduled tasks */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- flush_scheduled_work ();
+ flush_scheduled_work ();
#else
- flush_scheduled_tasks ();
+ flush_scheduled_tasks ();
#endif
complete (&(commit->c_complete));
return 0;
Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/namei.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -74,7 +74,7 @@
ocfs_super *osb = OCFS_SB(sb);
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", dir, dentry,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
if (dentry->d_name.len > OCFS_MAX_FILENAME_LENGTH) {
LOG_ERROR_STR ("name too long");
@@ -256,7 +256,7 @@
{
int status = 0;
ocfs_file_entry *fe = NULL;
- __u64 t;
+ __u64 t;
struct buffer_head *fe_bh = NULL;
int i;
unsigned long blk;
@@ -320,7 +320,7 @@
DISK_LOCK_WRITER_NODE (fe) = osb->node_num;
DISK_LOCK_OIN_MAP(fe) = (1 << osb->node_num);
OcfsQuerySystemTime(&t);
- DISK_LOCK_LAST_WRITE(fe) = t;
+ DISK_LOCK_LAST_WRITE(fe) = t;
DISK_LOCK_LAST_READ(fe) = t;
fe->create_time = fe->modify_time = OCFS_CURRENT_TIME;
@@ -432,7 +432,7 @@
int ret;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, '%*s')\n", dir, dentry, mode,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
ret = ocfs_mknod (dir, dentry, mode | S_IFDIR, OCFS_NODEV);
LOG_EXIT_INT (ret);
return ret;
@@ -451,7 +451,7 @@
int ret;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, '%*s')\n", dir, dentry, mode,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
ret = ocfs_mknod (dir, dentry, mode | S_IFREG, OCFS_NODEV);
LOG_EXIT_INT (ret);
return ret;
@@ -466,8 +466,8 @@
int status = -EPERM;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, 0x%p, old='%*s' new='%*s')\n", old_dentry, dir, dentry,
- old_dentry->d_name.len, old_dentry->d_name.name,
- dentry->d_name.len, dentry->d_name.name);
+ old_dentry->d_name.len, old_dentry->d_name.name,
+ dentry->d_name.len, dentry->d_name.name);
LOG_EXIT_INT (status);
return status;
@@ -488,7 +488,7 @@
struct inode *parentInode = dentry->d_parent->d_inode;
LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", dir, dentry,
- dentry->d_name.len, dentry->d_name.name);
+ dentry->d_name.len, dentry->d_name.name);
inode = dentry->d_inode;
osb = OCFS_SB(dir->i_sb);
@@ -823,8 +823,8 @@
LOG_ENTRY_ARGS ("(0x%p, 0x%p, 0x%p, 0x%p, from='%*s' to='%*s')\n",
old_dir, old_dentry, new_dir, new_dentry,
- old_dentry->d_name.len, old_dentry->d_name.name,
- new_dentry->d_name.len, new_dentry->d_name.name);
+ old_dentry->d_name.len, old_dentry->d_name.name,
+ new_dentry->d_name.len, new_dentry->d_name.name);
osb = OCFS_SB(old_dir->i_sb);
@@ -1691,9 +1691,9 @@
else if (local_handle && handle)
ocfs_commit_trans(handle);
- /* NEW: adding a fake release lock for the dead file entry here */
- /* need this to alert dentry-owners on other nodes */
- /* Release the file lock if we acquired it */
+ /* NEW: adding a fake release lock for the dead file entry here */
+ /* need this to alert dentry-owners on other nodes */
+ /* Release the file lock if we acquired it */
if (got_file) {
tmpstat = ocfs_release_lock(osb, file_off,
OCFS_DLM_EXCLUSIVE_LOCK,
Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/nm.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -469,11 +469,11 @@
}
}
- /* Flush all scheduled tasks */
+ /* Flush all scheduled tasks */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- flush_scheduled_work ();
+ flush_scheduled_work ();
#else
- flush_scheduled_tasks ();
+ flush_scheduled_tasks ();
#endif
complete (&(osb->dlm_complete));
@@ -1448,11 +1448,11 @@
#endif /* 2.4.x kernel */
}
- /* Flush all scheduled tasks */
+ /* Flush all scheduled tasks */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- flush_scheduled_work ();
+ flush_scheduled_work ();
#else
- flush_scheduled_tasks ();
+ flush_scheduled_tasks ();
#endif
#warning need a way to wait on all of these threads on dismount
Modified: trunk/src/oin.c
===================================================================
--- trunk/src/oin.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/oin.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -38,9 +38,9 @@
int status = 0;
struct buffer_head *fe_bh = NULL;
ocfs_file_entry *fe = NULL;
- struct list_head *iter;
- struct list_head *temp_iter;
- int disk_len;
+ struct list_head *iter;
+ struct list_head *temp_iter;
+ int disk_len;
__u64 offset;
/* We are setting the oin Updated flag in the end. */
Modified: trunk/src/proc.c
===================================================================
--- trunk/src/proc.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/proc.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -147,7 +147,7 @@
struct list_head *temp_iter;
alloc_item *item;
int len = 0;
- char *slabname;
+ char *slabname;
char *tmpstr = NULL;
LOG_ENTRY ();
@@ -166,7 +166,7 @@
list_for_each_safe (iter, temp_iter, &OcfsGlobalCtxt.item_list) {
if (len >= 4096)
- proc_overflow = 1;
+ proc_overflow = 1;
item = list_entry (iter, alloc_item, list);
switch (item->type) {
case SLAB_ITEM:
@@ -189,7 +189,7 @@
break;
case KMALLOC_ITEM:
case VMALLOC_ITEM:
- default:
+ default:
sprintf(tmpstr, "%08x %9d %s\n", item->address,
item->u.length, item->tag);
printk("%s", tmpstr);
@@ -283,10 +283,10 @@
"eagain", "efail", "enoent", "others");
len += sprintf (page + len, DLM_STATS, "netdlm vote requests",
- atomic_read (&nrq->total), atomic_read (&nrq->okay),
- atomic_read (&nrq->etimedout), atomic_read (&nrq->eagain),
- atomic_read (&nrq->efail), atomic_read (&nrq->enoent),
- atomic_read (&nrq->def));
+ atomic_read (&nrq->total), atomic_read (&nrq->okay),
+ atomic_read (&nrq->etimedout), atomic_read (&nrq->eagain),
+ atomic_read (&nrq->efail), atomic_read (&nrq->enoent),
+ atomic_read (&nrq->def));
len += sprintf (page + len, DLM_STATS, "netdlm vote responses",
atomic_read (&nrp->total), atomic_read (&nrp->okay),
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/super.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -158,7 +158,7 @@
};
static inline int ocfs_set_blocksize(struct super_block *sb,
- int blksize, int blksize_bits)
+ int blksize, int blksize_bits)
{
int status = 0;
@@ -277,7 +277,7 @@
if (status < 0)
goto read_super_error;
- osb = OCFS_SB(sb);
+ osb = OCFS_SB(sb);
if (!osb) {
status = -EINVAL;
goto read_super_error;
@@ -337,14 +337,14 @@
}
static struct file_system_type ocfs_fs_type = {
- .owner = THIS_MODULE,
- .name = "ocfs2",
- .get_sb = ocfs_get_sb, /* is this called when we mount
+ .owner = THIS_MODULE,
+ .name = "ocfs2",
+ .get_sb = ocfs_get_sb, /* is this called when we mount
* the fs? */
- .kill_sb = kill_block_super, /* set to the generic one
+ .kill_sb = kill_block_super, /* set to the generic one
* right now, but do we
* need to change that? */
- .fs_flags = FS_REQUIRES_DEV,
+ .fs_flags = FS_REQUIRES_DEV,
.next = NULL
};
@@ -386,9 +386,9 @@
LOG_TRACE_ARGS("strlen(options) = %u, options = \"%s\"\n", (unsigned int)strlen(options), options);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- while ( (c = strsep(&options, ",")) != NULL)
+ while ( (c = strsep(&options, ",")) != NULL)
#else
- for (c = strtok (options, ","); c != NULL; c = strtok (NULL, ","))
+ for (c = strtok (options, ","); c != NULL; c = strtok (NULL, ","))
#endif
// while ( (c = strsep(&options, ",")) != NULL)
{
@@ -459,7 +459,7 @@
memset (&OcfsIpcCtxt, 0, sizeof (ocfs_ipc_ctxt));
#ifdef OCFS_LINUX_MEM_DEBUG
- INIT_LIST_HEAD (&(OcfsGlobalCtxt.item_list));
+ INIT_LIST_HEAD (&(OcfsGlobalCtxt.item_list));
#endif
INIT_LIST_HEAD (&(OcfsGlobalCtxt.osb_next));
INIT_LIST_HEAD (&(OcfsGlobalCtxt.osb_next));
@@ -620,33 +620,33 @@
struct list_head *iter;
struct list_head *temp_iter;
alloc_item *item;
- char *memtype;
- char sizeinfo[20];
+ char *memtype;
+ char sizeinfo[20];
list_for_each_safe (iter, temp_iter, &OcfsGlobalCtxt.item_list) {
item = list_entry (iter, alloc_item, list);
- switch (item->type)
- {
- case SLAB_ITEM:
- /* TODO: use the actual slab name */
- memtype = "SLAB";
- snprintf(sizeinfo, 20, "slab=%p", item->u.slab);
- break;
- case KMALLOC_ITEM:
- memtype = "KMALLOC";
- snprintf(sizeinfo, 20, "size=%d", item->u.length);
- break;
- case VMALLOC_ITEM:
- memtype = "VMALLOC";
- snprintf(sizeinfo, 20, "size=%d", item->u.length);
- break;
- default:
- memtype = "UNKNOWN";
- snprintf(sizeinfo, 20, "size=%d", item->u.length);
- break;
- }
- LOG_ERROR_ARGS ("unfreed %s mem %x: %s tag='%s'", memtype,
- item->address, sizeinfo, item->tag);
+ switch (item->type)
+ {
+ case SLAB_ITEM:
+ /* TODO: use the actual slab name */
+ memtype = "SLAB";
+ snprintf(sizeinfo, 20, "slab=%p", item->u.slab);
+ break;
+ case KMALLOC_ITEM:
+ memtype = "KMALLOC";
+ snprintf(sizeinfo, 20, "size=%d", item->u.length);
+ break;
+ case VMALLOC_ITEM:
+ memtype = "VMALLOC";
+ snprintf(sizeinfo, 20, "size=%d", item->u.length);
+ break;
+ default:
+ memtype = "UNKNOWN";
+ snprintf(sizeinfo, 20, "size=%d", item->u.length);
+ break;
+ }
+ LOG_ERROR_ARGS ("unfreed %s mem %x: %s tag='%s'", memtype,
+ item->address, sizeinfo, item->tag);
}
} /* ocfs_memcheck */
@@ -663,7 +663,7 @@
LOG_ENTRY ();
if (ocfs_table_header)
- unregister_sysctl_table(ocfs_table_header);
+ unregister_sysctl_table(ocfs_table_header);
/* Signal DLM thread to exit */
down (&(OcfsGlobalCtxt.global_res));
@@ -722,16 +722,16 @@
static int ocfs_statfs (struct super_block *sb, struct statfs *buf)
#endif
{
- ocfs_super *osb = NULL;
- __u32 numbits, freebits = 0;
- int status = 0;
- ocfs_file_entry *bm_lock = NULL;
+ ocfs_super *osb = NULL;
+ __u32 numbits, freebits = 0;
+ int status = 0;
+ ocfs_file_entry *bm_lock = NULL;
struct buffer_head *bh = NULL;
- LOG_ENTRY_ARGS ("(%p, %p)\n", sb, buf);
+ LOG_ENTRY_ARGS ("(%p, %p)\n", sb, buf);
- osb = OCFS_SB(sb);
- numbits = osb->cluster_bitmap.validbits;
+ osb = OCFS_SB(sb);
+ numbits = osb->cluster_bitmap.validbits;
status = ocfs_read_bh (osb, OCFS_BITMAP_LOCK_OFFSET, &bh, 0, NULL);
if (status < 0) {
@@ -739,35 +739,35 @@
return -EIO;
}
bm_lock = (ocfs_file_entry *)OCFS_BH_GET_DATA_READ(bh); /* read */
- if (numbits >= bm_lock->u.bitinfo.used_bits)
- freebits = numbits - bm_lock->u.bitinfo.used_bits;
+ if (numbits >= bm_lock->u.bitinfo.used_bits)
+ freebits = numbits - bm_lock->u.bitinfo.used_bits;
/* take out the space reserved for system files */
freebits -= (8 * ONE_MEGA_BYTE / osb->vol_layout.cluster_size);
- buf->f_type = OCFS_MAGIC;
- buf->f_bsize = sb->s_blocksize;
- buf->f_namelen = OCFS_MAX_FILENAME_LENGTH;
- buf->f_bavail = buf->f_bfree;
+ buf->f_type = OCFS_MAGIC;
+ buf->f_bsize = sb->s_blocksize;
+ buf->f_namelen = OCFS_MAX_FILENAME_LENGTH;
+ buf->f_bavail = buf->f_bfree;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- buf->f_blocks =
+ buf->f_blocks =
(unsigned long) ((unsigned long) (numbits) *
(unsigned long) (osb->vol_layout.cluster_size >> osb->sect_size_bits) -
(8 * ONE_MEGA_BYTE / osb->vol_layout.cluster_size));
- buf->f_bfree =
- (unsigned long) (freebits * (osb->vol_layout.cluster_size >> osb->sect_size_bits));
- buf->f_bavail = buf->f_bfree;
- buf->f_files = (unsigned long) (numbits);
- buf->f_ffree = (unsigned long) (numbits) - freebits;
+ buf->f_bfree =
+ (unsigned long) (freebits * (osb->vol_layout.cluster_size >> osb->sect_size_bits));
+ buf->f_bavail = buf->f_bfree;
+ buf->f_files = (unsigned long) (numbits);
+ buf->f_ffree = (unsigned long) (numbits) - freebits;
#else
- buf->f_blocks =
+ buf->f_blocks =
(sector_t) ((unsigned long) (numbits) *
(unsigned long) (osb->vol_layout.cluster_size >> osb->sect_size_bits) -
(8 * ONE_MEGA_BYTE / osb->vol_layout.cluster_size));
- buf->f_bfree =
- (sector_t) (freebits * (osb->vol_layout.cluster_size >> osb->sect_size_bits));
- buf->f_files = (sector_t) (numbits);
- buf->f_ffree = (sector_t) (numbits) - freebits;
+ buf->f_bfree =
+ (sector_t) (freebits * (osb->vol_layout.cluster_size >> osb->sect_size_bits));
+ buf->f_files = (sector_t) (numbits);
+ buf->f_ffree = (sector_t) (numbits) - freebits;
#endif
OCFS_BH_PUT_DATA(bh);
@@ -776,8 +776,8 @@
unlock_buffer(bh);
brelse(bh);
- LOG_EXIT_INT (0);
- return 0;
+ LOG_EXIT_INT (0);
+ return 0;
} /* ocfs_statfs */
@@ -847,7 +847,7 @@
LOG_ENTRY ();
- /* Force 512B sector size for vol_header reads */
+ /* Force 512B sector size for vol_header reads */
status = ocfs_set_blocksize(sb, 512, 9);
if (status < 0) {
LOG_ERROR_STR("unable to set vol_header blocksize");
@@ -886,16 +886,16 @@
LOG_ERROR_STATUS (status = -ENOMEM);
goto leave;
}
- memset(osb, 0, sizeof(ocfs_super));
+ memset(osb, 0, sizeof(ocfs_super));
OCFS_GENERIC_SB_MEMBER(sb) = osb;
- osb->sb = sb;
+ osb->sb = sb;
osb->reclaim_id = reclaim_id;
- /* FIXME: here it should use the actual blocksize */
- sect_size = OCFS_SECTOR_SIZE;
+ /* FIXME: here it should use the actual blocksize */
+ sect_size = OCFS_SECTOR_SIZE;
status = ocfs_initialize_osb (osb, vol_header, vol_label,
sect_size);
if (status < 0) {
Modified: trunk/src/symlink.c
===================================================================
--- trunk/src/symlink.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/symlink.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -59,12 +59,12 @@
static unsigned int
sym_hostname(char *str, void *data)
{
- unsigned int l = strlen(system_utsname.nodename);
+ unsigned int l = strlen(system_utsname.nodename);
- if (str)
- memcpy(str, system_utsname.nodename, l);
+ if (str)
+ memcpy(str, system_utsname.nodename, l);
- return l;
+ return l;
}
/**
@@ -78,12 +78,12 @@
static unsigned int
sym_machine(char *str, void *data)
{
- unsigned int l = strlen(system_utsname.machine);
+ unsigned int l = strlen(system_utsname.machine);
- if (str)
- memcpy(str, system_utsname.machine, l);
+ if (str)
+ memcpy(str, system_utsname.machine, l);
- return l;
+ return l;
}
/**
@@ -97,12 +97,12 @@
static unsigned int
sym_os(char *str, void *data)
{
- unsigned int l = strlen(system_utsname.sysname);
+ unsigned int l = strlen(system_utsname.sysname);
- if (str)
- memcpy(str, system_utsname.sysname, l);
+ if (str)
+ memcpy(str, system_utsname.sysname, l);
- return l;
+ return l;
}
/**
@@ -116,28 +116,28 @@
static unsigned int
sym_nodenum(char *str, void *data)
{
- unsigned l;
- char buf[10];
+ unsigned l;
+ char buf[10];
struct inode *inode = data;
ocfs_super *osb = OCFS_SB(inode->i_sb);
- sprintf(buf,"%lu", (unsigned long)osb->node_num);
- l = strlen(buf);
+ sprintf(buf,"%lu", (unsigned long)osb->node_num);
+ l = strlen(buf);
- if (str) {
- memcpy(str, buf, l);
- str[l] ='\0';
- }
+ if (str) {
+ memcpy(str, buf, l);
+ str[l] ='\0';
+ }
- return l;
+ return l;
}
static struct ocfs_symlink_ops symlink_ops[] = {
- {"hostname}", 9, sym_hostname},
- {"mach}", 5, sym_machine},
- {"os}", 3, sym_os},
- {"nodenum}", 8, sym_nodenum},
- {NULL, 0, NULL}
+ {"hostname}", 9, sym_hostname},
+ {"mach}", 5, sym_machine},
+ {"os}", 3, sym_os},
+ {"nodenum}", 8, sym_nodenum},
+ {NULL, 0, NULL}
};
/* CDSL code - end
@@ -213,23 +213,23 @@
static void ocfs_link_expand(struct ocfs_symlink_ops *ops, char *out, char *in, struct inode *inode)
{
- unsigned int i;
+ unsigned int i;
- while (*in) {
- *out++ = *in;
- if (*in++ != '{')
- continue;
+ while (*in) {
+ *out++ = *in;
+ if (*in++ != '{')
+ continue;
- for (i = 0; ops[i].name; i++) {
- if (memcmp(in, ops[i].name, ops[i].len) == 0) {
- out--;
- out += ops[i].subst_fn(out, inode);
- in += ops[i].len;
- }
- }
- }
+ for (i = 0; ops[i].name; i++) {
+ if (memcmp(in, ops[i].name, ops[i].len) == 0) {
+ out--;
+ out += ops[i].subst_fn(out, inode);
+ in += ops[i].len;
+ }
+ }
+ }
- *out = 0;
+ *out = 0;
}
@@ -244,24 +244,24 @@
static unsigned int ocfs_link_size(struct ocfs_symlink_ops *ops, char *str, struct inode *inode)
{
- unsigned int len = 0;
- unsigned int i;
+ unsigned int len = 0;
+ unsigned int i;
- while (*str) {
- len++;
- if (*str++ != '{')
- continue;
+ while (*str) {
+ len++;
+ if (*str++ != '{')
+ continue;
- for (i = 0; ops[i].name; i++) {
- if (memcmp(str, ops[i].name, ops[i].len) == 0) {
- len--;
- len += ops[i].subst_fn(NULL, inode);
- str += ops[i].len;
- break;
- }
- }
- }
+ for (i = 0; ops[i].name; i++) {
+ if (memcmp(str, ops[i].name, ops[i].len) == 0) {
+ len--;
+ len += ops[i].subst_fn(NULL, inode);
+ str += ops[i].len;
+ break;
+ }
+ }
+ }
- return len + 1;
+ return len + 1;
}
Modified: trunk/src/util.c
===================================================================
--- trunk/src/util.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/util.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -130,11 +130,11 @@
m = kmem_cache_alloc(slab, GFP_NOFS);
#ifdef OCFS_LINUX_MEM_DEBUG
if (m == NULL) {
- LOG_ERROR_ARGS("failed to alloc from slab = %p", slab);
+ LOG_ERROR_ARGS("failed to alloc from slab = %p", slab);
} else {
alloc_item *new;
new = kmalloc (sizeof (alloc_item), GFP_NOFS);
- new->type = SLAB_ITEM;
+ new->type = SLAB_ITEM;
new->address = m;
new->u.slab = slab;
snprintf (new->tag, 30, "%d:%s", line, file);
@@ -157,8 +157,8 @@
#ifdef OCFS_LINUX_MEM_DEBUG
struct list_head *iter, *tmpiter;
- alloc_item *item = NULL;
- int do_free = 0;
+ alloc_item *item = NULL;
+ int do_free = 0;
list_for_each_safe (iter, tmpiter, &OcfsGlobalCtxt.item_list) {
item = list_entry (iter, alloc_item, list);
@@ -167,17 +167,17 @@
#ifdef SUPER_VERBOSE_MEM_DEBUG
LOG_TRACE_ARGS (" - %x (%p, '%s')\n", m, item->u.slab, item->tag);
#endif
- list_del (&item->list);
- do_free = 1;
+ list_del (&item->list);
+ do_free = 1;
break;
}
}
- if (do_free) {
- kmem_cache_free(slab, m);
- kfree (item);
- return;
- }
+ if (do_free) {
+ kmem_cache_free(slab, m);
+ kfree (item);
+ return;
+ }
LOG_ERROR_ARGS ("tried to free mem never allocated: %x", m);
#endif
#ifndef OCFS_LINUX_MEM_DEBUG
@@ -202,7 +202,7 @@
} else {
alloc_item *new;
new = kmalloc (sizeof (alloc_item), GFP_NOFS);
- new->type = KMALLOC_ITEM;
+ new->type = KMALLOC_ITEM;
new->address = m;
new->u.length = Size;
snprintf (new->tag, 30, "%d:%s", line, file);
@@ -225,8 +225,8 @@
#ifdef OCFS_LINUX_MEM_DEBUG
struct list_head *iter, *tmpiter;
- alloc_item *item = NULL;
- int do_free = 0;
+ alloc_item *item = NULL;
+ int do_free = 0;
list_for_each_safe (iter, tmpiter, &OcfsGlobalCtxt.item_list) {
item = list_entry (iter, alloc_item, list);
@@ -237,15 +237,15 @@
item->u.length, item->tag);
#endif
list_del (&item->list);
- do_free = 1;
+ do_free = 1;
break;
}
}
- if (do_free) {
- kfree (Buffer);
- kfree (item);
- return;
- }
+ if (do_free) {
+ kfree (Buffer);
+ kfree (item);
+ return;
+ }
LOG_ERROR_ARGS ("tried to free mem never allocated: %x", Buffer);
#endif
#ifndef OCFS_LINUX_MEM_DEBUG
@@ -310,17 +310,17 @@
*/
int ocfs_compare_qstr (struct qstr * s1, struct qstr * s2)
{
- int s = strncmp ((const char *) s1->name, (const char *) s2->name,
- s1->len < s2->len ? s1->len : s2->len);
+ int s = strncmp ((const char *) s1->name, (const char *) s2->name,
+ s1->len < s2->len ? s1->len : s2->len);
- if (s != 0)
- return s;
- if (s1->len > s2->len)
- return 1;
- else if (s1->len < s2->len)
- return -1;
- else
- return s;
+ if (s != 0)
+ return s;
+ if (s1->len > s2->len)
+ return 1;
+ else if (s1->len < s2->len)
+ return -1;
+ else
+ return s;
} /* ocfs_compare_qstr */
@@ -366,25 +366,25 @@
void ocfs_show_stack(unsigned long * esp)
{
- unsigned long *stack;
- int depth_to_print=16, i;
+ unsigned long *stack;
+ int depth_to_print=16, i;
- // debugging aid: "show_stack(NULL);" prints the
- // back trace for this cpu.
+ // debugging aid: "show_stack(NULL);" prints the
+ // back trace for this cpu.
- if(esp==NULL)
- esp=(unsigned long*)&esp;
+ if(esp==NULL)
+ esp=(unsigned long*)&esp;
- stack = esp;
- for(i=0; i < depth_to_print; i++) {
- if (((long) stack & (THREAD_SIZE-1)) == 0)
- break;
- if (i && ((i % 8) == 0))
- printk("\n ");
- printk("%08lx ", *stack++);
- }
- printk("\n");
- ocfs_show_trace(esp);
+ stack = esp;
+ for(i=0; i < depth_to_print; i++) {
+ if (((long) stack & (THREAD_SIZE-1)) == 0)
+ break;
+ if (i && ((i % 8) == 0))
+ printk("\n ");
+ printk("%08lx ", *stack++);
+ }
+ printk("\n");
+ ocfs_show_trace(esp);
}
static int ocfs_kernel_text_address(unsigned long addr)
@@ -394,22 +394,22 @@
void ocfs_show_trace(unsigned long * stack)
{
- unsigned long addr;
- /* static to not take up stackspace; if we race here too bad */
+ unsigned long addr;
+ /* static to not take up stackspace; if we race here too bad */
- if (!stack)
- stack = (unsigned long*)&stack;
+ if (!stack)
+ stack = (unsigned long*)&stack;
- printk("Call Trace: \n");
-
- while (((long) stack & (THREAD_SIZE-1)) != 0) {
- addr = *stack++;
- if (ocfs_kernel_text_address(addr)) {
- // lookup_symbol(addr, buffer, 512);
- printk("[<%08lx>] %s (0x%p)\n", addr," ",stack-1);
- }
- }
- printk("\n");
+ printk("Call Trace: \n");
+
+ while (((long) stack & (THREAD_SIZE-1)) != 0) {
+ addr = *stack++;
+ if (ocfs_kernel_text_address(addr)) {
+ // lookup_symbol(addr, buffer, 512);
+ printk("[<%08lx>] %s (0x%p)\n", addr," ",stack-1);
+ }
+ }
+ printk("\n");
}
Modified: trunk/src/ver.c
===================================================================
--- trunk/src/ver.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/ver.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -30,8 +30,8 @@
#include <linux/module.h>
MODULE_DESCRIPTION("The Oracle Cluster Filesystem (version "
- OCFS_BUILD_VERSION
- ")");
+ OCFS_BUILD_VERSION
+ ")");
char *ocfs_version = OCFS_BUILD_VERSION;
char *ocfs_date = OCFS_BUILD_DATE;
Modified: trunk/src/volcfg.c
===================================================================
--- trunk/src/volcfg.c 2004-05-12 18:55:28 UTC (rev 912)
+++ trunk/src/volcfg.c 2004-05-12 19:49:36 UTC (rev 913)
@@ -775,8 +775,8 @@
if (hdr->version < NODE_MIN_SUPPORTED_VER ||
hdr->version > NODE_CONFIG_VER) {
LOG_ERROR_ARGS ("Node config version mismatch, (%d) < minimum" \
- " (%d) or > current (%d)", hdr->version,
- NODE_MIN_SUPPORTED_VER, NODE_CONFIG_VER);
+ " (%d) or > current (%d)", hdr->version,
+ NODE_MIN_SUPPORTED_VER, NODE_CONFIG_VER);
status = -EINVAL;
goto finally;
}
More information about the Ocfs2-commits
mailing list