[Ocfs2-commits] manish commits r2311 - in trunk/fs/ocfs2: . cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue May 24 13:40:05 CDT 2005
Author: manish
Signed-off-by: mfasheh
Date: 2005-05-24 13:40:03 -0500 (Tue, 24 May 2005)
New Revision: 2311
Modified:
trunk/fs/ocfs2/alloc.c
trunk/fs/ocfs2/aops.c
trunk/fs/ocfs2/buffer_head_io.c
trunk/fs/ocfs2/buffer_head_io.h
trunk/fs/ocfs2/cluster/nodemanager.c
trunk/fs/ocfs2/dcache.c
trunk/fs/ocfs2/dir.c
trunk/fs/ocfs2/dlmglue.c
trunk/fs/ocfs2/file.c
trunk/fs/ocfs2/heartbeat.c
trunk/fs/ocfs2/inode.c
trunk/fs/ocfs2/inode.h
trunk/fs/ocfs2/localalloc.c
trunk/fs/ocfs2/namei.c
trunk/fs/ocfs2/suballoc.c
trunk/fs/ocfs2/vote.c
Log:
Coding style cleanups
Signed-off-by: mfasheh
Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/alloc.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -122,9 +122,9 @@
goto bail;
}
eb = (ocfs2_extent_block *) eb_bh->b_data;
- el = &(eb->h_list);
+ el = &eb->h_list;
} else
- el = &(fe->id2.i_list);
+ el = &fe->id2.i_list;
OCFS_ASSERT(el->l_tree_depth == 0);
@@ -167,7 +167,7 @@
&num_got,
&first_blkno);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -292,7 +292,7 @@
status = ocfs_create_new_meta_bhs(osb, handle, inode, new_blocks,
meta_ac, new_eb_bhs);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -783,7 +783,7 @@
goto bail;
}
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
- el = &(eb->h_list);
+ el = &eb->h_list;
}
/* Can we allocate without adding/shifting tree bits? */
@@ -1428,7 +1428,7 @@
goto bail;
}
eb = (ocfs2_extent_block *) bh->b_data;
- el = &(eb->h_list);
+ el = &eb->h_list;
OCFS2_BUG_ON_INVALID_EXTENT_BLOCK(eb);
} while (el->l_tree_depth);
@@ -1683,9 +1683,9 @@
if (fe->id2.i_list.l_tree_depth) {
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
- el = &(eb->h_list);
+ el = &eb->h_list;
} else
- el = &(fe->id2.i_list);
+ el = &fe->id2.i_list;
last_eb = fe->i_last_eb_blk;
start:
mlog(0, "ocfs_commit_truncate: fe->i_clusters = %u, "
@@ -1882,7 +1882,7 @@
&ext_alloc_bh,
1);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
(*tc)->tc_ext_alloc_bh = ext_alloc_bh;
Modified: trunk/fs/ocfs2/aops.c
===================================================================
--- trunk/fs/ocfs2/aops.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/aops.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -42,7 +42,7 @@
#include "buffer_head_io.h"
static int ocfs_symlink_get_block(struct inode *inode, sector_t iblock,
- struct buffer_head *bh_result, int create)
+ struct buffer_head *bh_result, int create)
{
int err = -EIO;
int status;
@@ -67,7 +67,7 @@
OCFS2_I(inode)->ip_blkno,
&bh, OCFS_BH_CACHED, inode);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
fe = (ocfs2_dinode *) bh->b_data;
@@ -124,7 +124,7 @@
if (bh)
brelse(bh);
- mlog_exit (err);
+ mlog_exit(err);
return err;
}
@@ -145,8 +145,7 @@
if (S_ISLNK(inode->i_mode)) {
/* this always does I/O for some reason. */
- err = ocfs_symlink_get_block (inode, iblock, bh_result,
- create);
+ err = ocfs_symlink_get_block(inode, iblock, bh_result, create);
goto bail;
}
@@ -191,7 +190,7 @@
goto bail;
if (vbo != OCFS2_I(inode)->ip_mmu_private) {
mlog(ML_ERROR, "Uh-oh, vbo = %"MLFi64", i_size = %lld, "
- "mmu = %lld, inode = %"MLFu64"\n",
+ "mmu = %lld, inode = %"MLFu64"\n",
vbo,
i_size_read(inode),
OCFS2_I(inode)->ip_mmu_private,
@@ -208,7 +207,7 @@
if (err < 0)
err = -EIO;
- mlog_exit (err);
+ mlog_exit(err);
return err;
}
@@ -412,15 +411,15 @@
struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
int ret;
- mlog_entry_void ();
+ mlog_entry_void();
/* blockdev_direct_IO checks alignment for us, using */
ret = blockdev_direct_IO_no_locking(rw, iocb, inode,
inode->i_sb->s_bdev, iov, offset,
nr_segs, ocfs_direct_IO_get_blocks,
NULL);
- mlog_exit (ret);
+ mlog_exit(ret);
return ret;
} /* ocfs_direct_IO */
Modified: trunk/fs/ocfs2/buffer_head_io.c
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/buffer_head_io.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -43,7 +43,7 @@
int uptodate)
{
// mlog_entry("(bh->b_blocknr = %u, uptodate = %d)\n", bh->b_blocknr,
-// uptodate);
+// uptodate);
if (!uptodate)
mlog_errno(-EIO);
@@ -57,8 +57,8 @@
// mlog_exit_void();
}
-int ocfs_write_blocks (ocfs_super *osb, struct buffer_head *bhs[],
- int nr, struct inode *inode)
+int ocfs_write_blocks(ocfs_super *osb, struct buffer_head *bhs[],
+ int nr, struct inode *inode)
{
int status = 0;
int i;
@@ -66,7 +66,7 @@
struct buffer_head *bh;
mlog_entry("(bh[0]->b_blocknr = %llu, nr=%d, inode=%p)\n",
- (unsigned long long)bhs[0]->b_blocknr, nr, inode);
+ (unsigned long long)bhs[0]->b_blocknr, nr, inode);
if (osb == NULL || osb->sb == NULL || bhs == NULL) {
status = -EINVAL;
@@ -98,8 +98,8 @@
if (unlikely(buffer_jbd(bh))) {
/* What are you thinking?! */
mlog(ML_ERROR, "trying to write a jbd managed bh "
- "(blocknr = %llu), nr=%d\n",
- (unsigned long long)bh->b_blocknr, nr);
+ "(blocknr = %llu), nr=%d\n",
+ (unsigned long long)bh->b_blocknr, nr);
BUG();
}
@@ -114,7 +114,7 @@
submit_bh(WRITE, bh);
}
- for (i = (nr-1) ; i >= 0; i--) {
+ for (i = (nr - 1) ; i >= 0; i--) {
bh = bhs[i];
wait_on_buffer(bh);
@@ -189,7 +189,7 @@
if (flags & OCFS_BH_CACHED && inode &&
!TEST_BH_SEQNUM(inode, bh)) {
mlog(ML_SEQNUM, "(read) bh (%llu) seqnum (%lu) does "
- "not match inode (%u)\n",
+ "not match inode (%u)\n",
(unsigned long long)bh->b_blocknr,
(bh->b_state & STATE_BIT_MASK) >> 19,
ocfs2_get_inode_seq(inode));
@@ -202,7 +202,7 @@
if (buffer_jbd(bh)) {
if (!(flags & OCFS_BH_CACHED) || ignore_cache)
mlog(ML_BH_IO, "trying to sync read a jbd "
- "managed bh (blocknr = %llu)\n",
+ "managed bh (blocknr = %llu)\n",
(unsigned long long)bh->b_blocknr);
continue;
}
@@ -211,8 +211,8 @@
if (buffer_dirty(bh)) {
/* This should probably be a BUG, or
* at least return an error. */
- mlog(ML_BH_IO, "asking me to sync read a "
- "dirty buffer! (blocknr = %llu)\n",
+ mlog(ML_BH_IO, "asking me to sync read a dirty "
+ "buffer! (blocknr = %llu)\n",
(unsigned long long)bh->b_blocknr);
continue;
}
@@ -220,8 +220,8 @@
lock_buffer(bh);
if (buffer_jbd(bh)) {
#ifdef CATCH_BH_JBD_RACES
- mlog(ML_ERROR, "block %llu had the JBD bit "
- "set while I was in lock_buffer!",
+ mlog(ML_ERROR, "block %llu had the JBD bit set "
+ "while I was in lock_buffer!",
(unsigned long long)bh->b_blocknr);
BUG();
#else
@@ -241,7 +241,7 @@
status = 0;
- for (i = (nr-1); i >= 0; i--) {
+ for (i = (nr - 1); i >= 0; i--) {
bh = bhs[i];
/* We know this can't have changed as we hold the
Modified: trunk/fs/ocfs2/buffer_head_io.h
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.h 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/buffer_head_io.h 2005-05-24 18:40:03 UTC (rev 2311)
@@ -94,19 +94,19 @@
return ret;
}
-static inline int ocfs_write_block (ocfs_super * osb, struct buffer_head *bh,
- struct inode *inode)
+static inline int ocfs_write_block(ocfs_super * osb, struct buffer_head *bh,
+ struct inode *inode)
{
int status;
- status = ocfs_write_blocks (osb, &bh, 1, inode);
+ status = ocfs_write_blocks(osb, &bh, 1, inode);
return status;
}
-static inline int ocfs_read_block (ocfs_super * osb, u64 off,
- struct buffer_head **bh, int flags,
- struct inode *inode)
+static inline int ocfs_read_block(ocfs_super * osb, u64 off,
+ struct buffer_head **bh, int flags,
+ struct inode *inode)
{
int status = 0;
@@ -120,7 +120,6 @@
flags, inode);
bail:
-
return status;
}
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -774,8 +774,8 @@
remove_proc_entry(NM_PROC_PATH, NULL);
}
-static int nm_proc_version (char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int nm_proc_version(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
Modified: trunk/fs/ocfs2/dcache.c
===================================================================
--- trunk/fs/ocfs2/dcache.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/dcache.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -44,8 +44,8 @@
int ret = 0; /* if all else fails, just return false */
ocfs_super *osb;
- mlog_entry ("(0x%p, '%.*s')\n", dentry,
- dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, '%.*s')\n", dentry,
+ dentry->d_name.len, dentry->d_name.name);
if (inode == NULL)
goto bail;
Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/dir.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -101,7 +101,7 @@
while (!error && !stored && filp->f_pos < i_size_read(inode)) {
blk = (filp->f_pos) >> sb->s_blocksize_bits;
- bh = ocfs_bread (inode, blk, &err, 0);
+ bh = ocfs_bread(inode, blk, &err, 0);
if (!bh) {
mlog(ML_ERROR, "directory #%"MLFu64" contains a hole "
"at offset %lld\n",
@@ -117,9 +117,9 @@
if (!offset) {
for (i = 16 >> (sb->s_blocksize_bits - 9), num = 0;
i > 0; i--) {
- tmp = ocfs_bread (inode, ++blk, &err, 1);
+ tmp = ocfs_bread(inode, ++blk, &err, 1);
if (tmp)
- brelse (tmp);
+ brelse(tmp);
}
}
@@ -151,12 +151,12 @@
while (!error && filp->f_pos < i_size_read(inode)
&& offset < sb->s_blocksize) {
de = (struct ocfs2_dir_entry *) (bh->b_data + offset);
- if (!ocfs_check_dir_entry (inode, de, bh, offset)) {
+ if (!ocfs_check_dir_entry(inode, de, bh, offset)) {
/* On error, skip the f_pos to the
next block. */
filp->f_pos = (filp->f_pos |
(sb->s_blocksize - 1)) + 1;
- brelse (bh);
+ brelse(bh);
goto bail;
}
offset += le16_to_cpu(de->rec_len);
@@ -187,7 +187,7 @@
filp->f_pos += le16_to_cpu(de->rec_len);
}
offset = 0;
- brelse (bh);
+ brelse(bh);
}
stored = 0;
@@ -214,9 +214,9 @@
int status = -ENOENT;
int lock_acq = 0;
- mlog_entry ("(osb=%p, parent=%"MLFu64", name='%.*s', blkno=%p, "
- "inode=%p)\n",
- osb, OCFS2_I(inode)->ip_blkno, namelen, name, blkno, inode);
+ mlog_entry("(osb=%p, parent=%"MLFu64", name='%.*s', blkno=%p, "
+ "inode=%p)\n",
+ osb, OCFS2_I(inode)->ip_blkno, namelen, name, blkno, inode);
if (take_lock) {
/* Get a lock on the directory... */
@@ -251,7 +251,7 @@
}
}
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_find_files_on_disk */
@@ -270,7 +270,7 @@
sb = inode->i_sb;
if ((i_size_read(inode) <
(OCFS2_DIR_REC_LEN(1) + OCFS2_DIR_REC_LEN(2))) ||
- !(bh = ocfs_bread (inode, 0, &err, 0))) {
+ !(bh = ocfs_bread(inode, 0, &err, 0))) {
mlog(ML_ERROR, "bad directory (dir #%"MLFu64") - "
"no data block\n",
OCFS2_I(inode)->ip_blkno);
@@ -279,22 +279,22 @@
de = (struct ocfs2_dir_entry *) bh->b_data;
de1 = (struct ocfs2_dir_entry *)
- ((char *) de + le16_to_cpu(de->rec_len));
+ ((char *)de + le16_to_cpu(de->rec_len));
if ((le64_to_cpu(de->inode) != OCFS2_I(inode)->ip_blkno) ||
!le64_to_cpu(de1->inode) ||
- strcmp (".", de->name) ||
- strcmp ("..", de1->name)) {
+ strcmp(".", de->name) ||
+ strcmp("..", de1->name)) {
mlog(ML_ERROR, "bad directory (dir #%"MLFu64") - "
"no `.' or `..'\n",
OCFS2_I(inode)->ip_blkno);
- brelse (bh);
+ brelse(bh);
return 1;
}
offset = le16_to_cpu(de->rec_len) + le16_to_cpu(de1->rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de1 + le16_to_cpu(de1->rec_len));
+ de = (struct ocfs2_dir_entry *)((char *)de1 + le16_to_cpu(de1->rec_len));
while (offset < i_size_read(inode) ) {
- if (!bh || (void *) de >= (void *) (bh->b_data + sb->s_blocksize)) {
- brelse (bh);
+ if (!bh || (void *)de >= (void *)(bh->b_data + sb->s_blocksize)) {
+ brelse(bh);
bh = ocfs_bread(inode,
offset >> sb->s_blocksize_bits, &err, 0);
if (!bh) {
@@ -306,19 +306,19 @@
}
de = (struct ocfs2_dir_entry *) bh->b_data;
}
- if (!ocfs_check_dir_entry (inode, de, bh, offset)) {
- brelse (bh);
+ if (!ocfs_check_dir_entry(inode, de, bh, offset)) {
+ brelse(bh);
return 1;
}
if (le64_to_cpu(de->inode)) {
- brelse (bh);
+ brelse(bh);
return 0;
}
offset += le16_to_cpu(de->rec_len);
de = (struct ocfs2_dir_entry *)
- ((char *) de + le16_to_cpu(de->rec_len));
+ ((char *)de + le16_to_cpu(de->rec_len));
}
- brelse (bh);
+ brelse(bh);
return 1;
}
@@ -489,7 +489,7 @@
if (new_bh)
brelse(new_bh);
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_extend_dir */
@@ -508,8 +508,8 @@
struct buffer_head * bh = NULL;
unsigned short rec_len;
ocfs2_dinode *fe;
- struct ocfs2_dir_entry * de;
- struct super_block * sb;
+ struct ocfs2_dir_entry *de;
+ struct super_block *sb;
int status;
mlog_entry_void();
@@ -529,7 +529,7 @@
goto bail;
}
- bh = ocfs_bread (dir, 0, &status, 0);
+ bh = ocfs_bread(dir, 0, &status, 0);
if (!bh) {
mlog_errno(status);
goto bail;
@@ -540,7 +540,7 @@
de = (struct ocfs2_dir_entry *) bh->b_data;
while (1) {
if ((char *)de >= sb->s_blocksize + bh->b_data) {
- brelse (bh);
+ brelse(bh);
bh = NULL;
if (i_size_read(dir) <= offset) {
@@ -557,10 +557,10 @@
get_bh(*ret_de_bh);
goto bail;
}
- bh = ocfs_bread (dir,
- offset >> sb->s_blocksize_bits,
- &status,
- 0);
+ bh = ocfs_bread(dir,
+ offset >> sb->s_blocksize_bits,
+ &status,
+ 0);
if (!bh) {
mlog_errno(status);
goto bail;
@@ -568,11 +568,11 @@
/* move to next block */
de = (struct ocfs2_dir_entry *) bh->b_data;
}
- if (!ocfs_check_dir_entry (dir, de, bh, offset)) {
+ if (!ocfs_check_dir_entry(dir, de, bh, offset)) {
status = -ENOENT;
goto bail;
}
- if (ocfs_match (namelen, name, de)) {
+ if (ocfs_match(namelen, name, de)) {
status = -EEXIST;
goto bail;
}
@@ -588,13 +588,14 @@
goto bail;
}
offset += le16_to_cpu(de->rec_len);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->rec_len));
+ de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->rec_len));
}
status = 0;
bail:
if (bh)
brelse(bh);
+
mlog_exit(status);
return status;
}
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/dlmglue.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -141,14 +141,14 @@
return lockres->l_type == OCFS_TYPE_SUPER;
}
-static inline ocfs_super * ocfs2_lock_res_super(ocfs2_lock_res *lockres)
+static inline ocfs_super *ocfs2_lock_res_super(ocfs2_lock_res *lockres)
{
OCFS_ASSERT(ocfs2_is_super_lock(lockres));
return (ocfs_super *) lockres->l_priv;
}
-static inline struct inode * ocfs2_lock_res_inode(ocfs2_lock_res *lockres)
+static inline struct inode *ocfs2_lock_res_inode(ocfs2_lock_res *lockres)
{
OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
@@ -523,12 +523,12 @@
mlog(0, "incrementing inode seq... current is %d\n", ocfs2_get_inode_seq(inode));
/* wrap to ONE after 13 bits, will need a spinlock */
- spin_lock (&clean_buffer_lock);
- if ((atomic_read(&osb->clean_buffer_seq)+1) % STATE_BIT_MAX == 0)
+ spin_lock(&clean_buffer_lock);
+ if ((atomic_read(&osb->clean_buffer_seq) + 1) % STATE_BIT_MAX == 0)
atomic_set(&osb->clean_buffer_seq, 1);
else
atomic_inc(&osb->clean_buffer_seq);
- spin_unlock (&clean_buffer_lock);
+ spin_unlock(&clean_buffer_lock);
/* doesn't matter if this another process */
/* has already incremented the global seq */
Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/file.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -90,9 +90,8 @@
int mode = file->f_flags;
struct ocfs2_inode_info *oi = OCFS2_I(inode);
- mlog_entry ("(0x%p, 0x%p, '%.*s')\n", inode, file,
- file->f_dentry->d_name.len,
- file->f_dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file,
+ file->f_dentry->d_name.len, file->f_dentry->d_name.name);
status = -EACCES;
@@ -145,8 +144,8 @@
struct inode *inode = dentry->d_inode;
ocfs_super *osb = OCFS2_SB(inode->i_sb);
- mlog_entry ("(0x%p, 0x%p, %d, '%.*s')\n", file, dentry, datasync,
- dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", file, dentry, datasync,
+ dentry->d_name.len, dentry->d_name.name);
err = ocfs_sync_inode(dentry->d_inode);
if (err)
@@ -156,7 +155,7 @@
err = journal_force_commit(journal);
bail:
- mlog_exit (err);
+ mlog_exit(err);
return (err < 0) ? -EIO : 0;
} /* ocfs_sync_file */
@@ -214,10 +213,10 @@
unsigned int saved_flags;
#endif
- mlog_entry ("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
- (unsigned int)count,
- filp->f_dentry->d_name.len,
- filp->f_dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
+ (unsigned int)count,
+ filp->f_dentry->d_name.len,
+ filp->f_dentry->d_name.name);
/* happy write of zero bytes */
if (count == 0) {
@@ -264,7 +263,7 @@
ocfs2_unlock_buffer_inodes(&ctxt);
if (info.wl_have_i_sem)
up(&inode->i_sem);
- mlog_exit (ret);
+ mlog_exit(ret);
return ret;
}
@@ -284,9 +283,11 @@
ocfs2_backing_inode *target_binode;
DECLARE_BUFFER_LOCK_CTXT(ctxt);
- mlog_entry ("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
- (unsigned int)count, filp->f_dentry->d_name.len,
- filp->f_dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
+ (unsigned int)count,
+ filp->f_dentry->d_name.len,
+ filp->f_dentry->d_name.name);
+
if (!inode) {
mlog(ML_ERROR, "Bad inode or inode has no oin\n");
ret = -EINVAL;
@@ -325,7 +326,7 @@
down_read(&OCFS2_I(inode)->ip_alloc_sem);
- ret = generic_file_read (filp, buf, count, ppos);
+ ret = generic_file_read(filp, buf, count, ppos);
up_read(&OCFS2_I(inode)->ip_alloc_sem);
@@ -336,7 +337,7 @@
ocfs2_unlock_buffer_inodes(&ctxt);
bail:
- mlog_exit (ret);
+ mlog_exit(ret);
return ret;
} /* ocfs_file_read */
@@ -374,7 +375,7 @@
status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -411,7 +412,7 @@
status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
bail:
@@ -488,7 +489,7 @@
status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
if (status < 0)
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -506,7 +507,7 @@
* i_size. */
status = ocfs_orphan_for_truncate(osb, inode, fe_bh, new_i_size);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -530,7 +531,7 @@
if (fe_bh)
brelse(fe_bh);
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_truncate_file */
@@ -847,7 +848,7 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto leave;
}
@@ -894,7 +895,7 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto leave;
}
@@ -924,7 +925,7 @@
goto restart_all;
}
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_extend_file */
@@ -943,8 +944,8 @@
struct buffer_head *bh = NULL;
ocfs_journal_handle *handle = NULL;
- mlog_entry ("(0x%p, '%.*s')\n", dentry,
- dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, '%.*s')\n", dentry,
+ dentry->d_name.len, dentry->d_name.name);
if (attr->ia_valid & ATTR_MODE)
mlog(0, "mode change: %d\n", attr->ia_mode);
@@ -964,7 +965,7 @@
return 0;
}
- status = inode_change_ok (inode, attr);
+ status = inode_change_ok(inode, attr);
if (status)
return status;
@@ -1035,7 +1036,7 @@
mlog_errno(status);
unlock = 0;
- status = inode_setattr (inode, attr);
+ status = inode_setattr(inode, attr);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1043,7 +1044,7 @@
status = ocfs_mark_inode_dirty(handle, inode, bh);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -1063,7 +1064,7 @@
* ocfs_getattr()
*
*/
-int ocfs_getattr (struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+int ocfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
{
struct inode *inode = dentry->d_inode;
struct super_block *sb = dentry->d_inode->i_sb;
@@ -1085,7 +1086,7 @@
stat->blksize = osb->s_clustersize;
bail:
- mlog_exit (err);
+ mlog_exit(err);
return err;
}
Modified: trunk/fs/ocfs2/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/heartbeat.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/heartbeat.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -287,7 +287,7 @@
OCFS_ASSERT(target->num_nodes > 0);
num_longs = BITS_TO_LONGS(target->num_nodes);
- for (i=0; i<num_longs; i++)
+ for (i = 0; i < num_longs; i++)
target->map[i] = from->map[i];
}
@@ -369,7 +369,7 @@
memset(*str, 0, strlen("123 ") * map->num_nodes);
s = *str;
- for (i=0; i<map->num_nodes; i++) {
+ for (i = 0; i < map->num_nodes; i++) {
if (ocfs_node_map_test_bit(map, i)) {
n = sprintf(s, "%3d ", i);
if (n != strlen("123 ")) {
@@ -390,7 +390,7 @@
OCFS_ASSERT(target->num_nodes > 0);
num_longs = BITS_TO_LONGS(target->num_nodes);
- for (i=0; i<num_longs; i++)
+ for (i = 0; i < num_longs; i++)
target->map[i] &= mask->map[i];
}
@@ -402,7 +402,7 @@
OCFS_ASSERT(map1->num_nodes > 0);
num_longs = BITS_TO_LONGS(map1->num_nodes);
- for (i=0; i<num_longs; i++) {
+ for (i = 0; i < num_longs; i++) {
if (map1->map[i] != map2->map[i])
return 0;
}
@@ -416,7 +416,7 @@
{
int bit, prev=0;
while (1) {
- bit = find_next_bit (mask->map, mask->num_nodes, prev);
+ bit = find_next_bit(mask->map, mask->num_nodes, prev);
if (bit >= mask->num_nodes)
break;
ocfs_node_map_clear_bit(target, bit);
@@ -430,7 +430,7 @@
{
int bit, prev=0;
while (1) {
- bit = find_next_bit (mask->map, mask->num_nodes, prev);
+ bit = find_next_bit(mask->map, mask->num_nodes, prev);
if (bit >= mask->num_nodes)
break;
ocfs_node_map_set_bit(target, bit);
Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/inode.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -63,8 +63,8 @@
};
static int ocfs_read_locked_inode(struct inode *inode, struct ocfs2_find_inode_args *args);
-static int ocfs_init_locked_inode(struct inode * inode, void * opaque);
-static int ocfs2_find_actor (struct inode *inode, void *opaque);
+static int ocfs_init_locked_inode(struct inode *inode, void *opaque);
+static int ocfs2_find_actor(struct inode *inode, void *opaque);
static int ocfs_truncate_for_delete(ocfs_super *osb,
struct inode *inode,
struct buffer_head *fe_bh);
@@ -108,8 +108,8 @@
args.flags = flags;
args.ino = ino_from_blkno(sb, blkno);
- inode = iget5_locked (sb, args.ino, ocfs2_find_actor,
- ocfs_init_locked_inode, &args);
+ inode = iget5_locked(sb, args.ino, ocfs2_find_actor,
+ ocfs_init_locked_inode, &args);
/* inode was *not* in the inode cache. 2.6.x requires
* us to do our own read_inode call and unlock it
* afterwards. */
@@ -123,9 +123,9 @@
inode = NULL;
goto bail;
}
- if (is_bad_inode (inode)) {
+ if (is_bad_inode(inode)) {
mlog(ML_ERROR, "access error (bad inode)\n");
- iput (inode);
+ iput(inode);
inode = NULL;
goto bail;
}
@@ -153,7 +153,7 @@
struct ocfs2_find_inode_args *args = NULL;
int ret = 0;
- mlog_entry ("(0x%p, %lu, 0x%p)\n", inode, inode->i_ino, opaque);
+ mlog_entry("(0x%p, %lu, 0x%p)\n", inode, inode->i_ino, opaque);
args = opaque;
@@ -164,7 +164,7 @@
ret = 1;
bail:
- mlog_exit (ret);
+ mlog_exit(ret);
return ret;
}
@@ -173,7 +173,7 @@
* us to sleep.
* return 0 on success, 1 on failure
*/
-static int ocfs_init_locked_inode(struct inode * inode, void * opaque)
+static int ocfs_init_locked_inode(struct inode *inode, void *opaque)
{
struct ocfs2_find_inode_args *args = opaque;
@@ -197,7 +197,7 @@
ocfs_super *osb;
int status = -EINVAL;
- mlog_entry ("(0x%p, size:%"MLFu64")\n", inode, fe->i_size);
+ mlog_entry("(0x%p, size:%"MLFu64")\n", inode, fe->i_size);
sb = inode->i_sb;
osb = OCFS2_SB(sb);
@@ -310,7 +310,7 @@
if (status < 0)
mlog_errno(status);
bail:
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_populate_inode */
@@ -323,7 +323,7 @@
int status;
int sysfile = 0;
- mlog_entry ("(0x%p, 0x%p)\n", inode, args);
+ mlog_entry("(0x%p, 0x%p)\n", inode, args);
status = -EINVAL;
if (inode == NULL || inode->i_sb == NULL) {
@@ -362,7 +362,7 @@
inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
status = -EINVAL;
- if (ocfs_populate_inode (inode, fe, 0) < 0) {
+ if (ocfs_populate_inode(inode, fe, 0) < 0) {
mlog(ML_ERROR, "populate inode failed! i_blkno=%"MLFu64", "
"i_ino=%lu\n", fe->i_blkno, inode->i_ino);
make_bad_inode(inode);
@@ -381,7 +381,7 @@
if (args && bh)
brelse(bh);
- mlog_exit (status);
+ mlog_exit(status);
return status;
}
@@ -416,7 +416,7 @@
status = ocfs_set_inode_size(handle, inode, fe_bh, 0ULL);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -438,7 +438,7 @@
if (handle)
ocfs_commit_trans(handle);
- mlog_exit (status);
+ mlog_exit(status);
return status;
}
@@ -771,7 +771,7 @@
bail:
- mlog_exit_void ();
+ mlog_exit_void();
}
/*
@@ -781,10 +781,10 @@
* stuff in ocfs_get_block (that is, ocfs_get_block pretty much
* expects never to extend).
*/
-struct buffer_head *ocfs_bread(struct inode * inode,
+struct buffer_head *ocfs_bread(struct inode *inode,
int block, int *err, int reada)
{
- struct buffer_head * bh = NULL;
+ struct buffer_head *bh = NULL;
int tmperr;
u64 p_blkno;
int readflags = OCFS_BH_CACHED;
@@ -821,7 +821,7 @@
fail:
if (bh) {
- brelse (bh);
+ brelse(bh);
bh = NULL;
}
*err = -EIO;
Modified: trunk/fs/ocfs2/inode.h
===================================================================
--- trunk/fs/ocfs2/inode.h 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/inode.h 2005-05-24 18:40:03 UTC (rev 2311)
@@ -101,7 +101,7 @@
extern kmem_cache_t *ocfs2_inode_cache;
-struct buffer_head *ocfs_bread(struct inode * inode, int block,
+struct buffer_head *ocfs_bread(struct inode *inode, int block,
int *err, int reada);
void ocfs2_clear_inode(struct inode *inode);
void ocfs2_delete_inode(struct inode *inode);
Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/localalloc.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -399,7 +399,7 @@
handle = ocfs_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -408,14 +408,14 @@
-1);
if (!main_bm_inode) {
status = -EINVAL;
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
ocfs_handle_add_inode(handle, main_bm_inode);
status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
if (status < 0) {
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -895,7 +895,7 @@
handle = ocfs_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
@@ -914,7 +914,7 @@
handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
if (!handle) {
status = -ENOMEM;
- mlog_errno (status);
+ mlog_errno(status);
goto bail;
}
Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/namei.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -74,11 +74,11 @@
struct ocfs2_dir_entry *de_del,
struct buffer_head *bh);
-static int __ocfs_add_entry (ocfs_journal_handle *handle, struct inode *dir,
- const char *name, int namelen,
- struct inode *inode, u64 blkno,
- struct buffer_head *parent_fe_bh,
- struct buffer_head *insert_bh);
+static int __ocfs_add_entry(ocfs_journal_handle *handle, struct inode *dir,
+ const char *name, int namelen,
+ struct inode *inode, u64 blkno,
+ struct buffer_head *parent_fe_bh,
+ struct buffer_head *insert_bh);
static int ocfs_mknod_locked(ocfs_super *osb, struct inode *dir,
struct dentry *dentry, int mode,
@@ -148,11 +148,11 @@
ocfs_super *osb = OCFS2_SB(sb);
struct ocfs2_dir_entry *dirent;
- mlog_entry ("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
- dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
+ dentry->d_name.len, dentry->d_name.name);
if (dentry->d_name.len > OCFS2_MAX_FILENAME_LEN) {
- ret = ERR_PTR (-ENAMETOOLONG);
+ ret = ERR_PTR(-ENAMETOOLONG);
goto bail;
}
@@ -167,13 +167,13 @@
inode = ocfs_iget(osb, blkno);
if (!inode) {
mlog(ML_ERROR, "Could not create inode!\n");
- ret = ERR_PTR (-EACCES);
+ ret = ERR_PTR(-EACCES);
goto bail;
}
bail_add:
dentry->d_op = &ocfs_dentry_ops;
- d_add (dentry, inode);
+ d_add(dentry, inode);
ret = NULL;
bail:
@@ -201,8 +201,8 @@
struct buffer_head *dirent_bh = NULL;
struct ocfs2_dir_entry *dirent;
- mlog_entry ("(0x%p, '%.*s')\n", child,
- child->d_name.len, child->d_name.name);
+ mlog_entry("(0x%p, '%.*s')\n", child,
+ child->d_name.len, child->d_name.name);
mlog(0, "about to call find_files_on_disk with inode=%p\n", dir);
@@ -270,14 +270,14 @@
de->name_len = 1;
de->rec_len =
cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len));
- strcpy (de->name, ".");
+ strcpy(de->name, ".");
ocfs_set_de_type(de, S_IFDIR);
- de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->rec_len));
+ de = (struct ocfs2_dir_entry *) ((char *)de + le16_to_cpu(de->rec_len));
de->inode = cpu_to_le64(OCFS2_I(parent)->ip_blkno);
de->rec_len = cpu_to_le16(inode->i_sb->s_blocksize -
OCFS2_DIR_REC_LEN(1));
de->name_len = 2;
- strcpy (de->name, "..");
+ strcpy(de->name, "..");
ocfs_set_de_type(de, S_IFDIR);
status = ocfs_journal_dirty(handle, new_bh);
@@ -320,8 +320,8 @@
ocfs2_alloc_context *inode_ac = NULL;
ocfs2_alloc_context *data_ac = NULL;
- mlog_entry ("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
- (unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
+ (unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
/* get our super block */
osb = OCFS2_SB(dir->i_sb);
@@ -422,7 +422,7 @@
file_off = fe->i_blkno << dir->i_sb->s_blocksize_bits;
- if (S_ISDIR (mode)) {
+ if (S_ISDIR(mode)) {
status = ocfs_fill_new_dir(osb, handle, dir, inode,
new_fe_bh, data_ac);
if (status < 0) {
@@ -452,8 +452,8 @@
goto leave;
}
- insert_inode_hash (inode);
- d_instantiate (dentry, inode);
+ insert_inode_hash(inode);
+ d_instantiate(dentry, inode);
status = 0;
leave:
@@ -507,8 +507,8 @@
u64 fe_blkno = 0;
u16 suballoc_bit;
- mlog_entry ("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
- (unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
+ (unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
OCFS_ASSERT(new_fe_bh);
*new_fe_bh = NULL;
@@ -556,19 +556,19 @@
} else
fe->i_gid = current->fsgid;
fe->i_mode = mode;
- if (S_ISCHR (mode) || S_ISBLK (mode))
+ if (S_ISCHR(mode) || S_ISBLK(mode))
fe->id1.dev1.i_rdev = cpu_to_le64(huge_encode_dev(dev));
- if (S_ISLNK (mode) || S_ISDIR (mode) || S_ISREG (mode))
+ if (S_ISLNK(mode) || S_ISDIR(mode) || S_ISREG(mode))
ocfs2_init_inode_seq(inode);
- if (S_ISDIR (mode))
+ if (S_ISDIR(mode))
fe->i_links_count = 2;
else
fe->i_links_count = 1;
fe->i_last_eb_blk = 0;
- strcpy (fe->i_signature, OCFS2_INODE_SIGNATURE);
+ strcpy(fe->i_signature, OCFS2_INODE_SIGNATURE);
fe->i_flags |= OCFS2_VALID_FL;
fe->i_atime = fe->i_ctime = fe->i_mtime = CURRENT_TIME.tv_sec;
fe->i_mtime_nsec = fe->i_ctime_nsec = fe->i_atime_nsec =
@@ -597,7 +597,7 @@
*new_fe_bh = NULL;
}
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_mknod_locked */
@@ -605,14 +605,14 @@
* ocfs_mkdir()
*
*/
-static int ocfs_mkdir (struct inode *dir, struct dentry *dentry, int mode)
+static int ocfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
int ret;
- mlog_entry ("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
- dentry->d_name.len, dentry->d_name.name);
- ret = ocfs_mknod (dir, dentry, mode | S_IFDIR, 0);
- mlog_exit (ret);
+ mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
+ dentry->d_name.len, dentry->d_name.name);
+ ret = ocfs_mknod(dir, dentry, mode | S_IFDIR, 0);
+ mlog_exit(ret);
return ret;
} /* ocfs_mkdir */
@@ -621,14 +621,14 @@
* ocfs_create()
*
*/
-static int ocfs_create (struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
+static int ocfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
int ret;
- mlog_entry ("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
- dentry->d_name.len, dentry->d_name.name);
- ret = ocfs_mknod (dir, dentry, mode | S_IFREG, 0);
- mlog_exit (ret);
+ mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
+ dentry->d_name.len, dentry->d_name.name);
+ ret = ocfs_mknod(dir, dentry, mode | S_IFREG, 0);
+ mlog_exit(ret);
return ret;
} /* ocfs_create */
@@ -637,8 +637,8 @@
* ocfs_link()
*
*/
-static int ocfs_link (struct dentry * old_dentry,
- struct inode * dir, struct dentry *dentry)
+static int ocfs_link(struct dentry * old_dentry,
+ struct inode * dir, struct dentry *dentry)
{
ocfs_journal_handle *handle = NULL;
struct inode *inode = old_dentry->d_inode;
@@ -649,10 +649,9 @@
ocfs2_dinode *fe = NULL;
ocfs_super *osb = OCFS2_SB(dir->i_sb);
- mlog_entry ("(inode=%lu, old='%.*s' new='%.*s')\n",
- inode->i_ino, old_dentry->d_name.len,
- old_dentry->d_name.name, dentry->d_name.len,
- dentry->d_name.name);
+ mlog_entry("(inode=%lu, old='%.*s' new='%.*s')\n", inode->i_ino,
+ old_dentry->d_name.len, old_dentry->d_name.name,
+ dentry->d_name.len, dentry->d_name.name);
if (S_ISDIR(inode->i_mode)) {
err = -EPERM;
@@ -677,8 +676,8 @@
}
err = ocfs_prepare_dir_for_insert(osb, dir, parent_fe_bh,
- dentry->d_name.name,
- dentry->d_name.len, &de_bh);
+ dentry->d_name.name,
+ dentry->d_name.len, &de_bh);
if (err < 0) {
mlog_errno(err);
goto bail;
@@ -769,8 +768,8 @@
char orphan_name[OCFS2_ORPHAN_NAMELEN + 1];
struct buffer_head *orphan_entry_bh = NULL;
- mlog_entry ("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
- dentry->d_name.len, dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
+ dentry->d_name.len, dentry->d_name.name);
OCFS_ASSERT((dentry->d_parent->d_inode == dir));
@@ -822,7 +821,7 @@
goto leave;
}
- if (S_ISDIR (inode->i_mode)) {
+ if (S_ISDIR(inode->i_mode)) {
if (!ocfs_empty_dir(inode)) {
status = -ENOTEMPTY;
goto leave;
@@ -874,13 +873,13 @@
}
/* delete the name from the parent dir */
- status = ocfs_delete_entry (handle, dir, dirent, dirent_bh);
+ status = ocfs_delete_entry(handle, dir, dirent, dirent_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- if (S_ISDIR (inode->i_mode)) {
+ if (S_ISDIR(inode->i_mode)) {
fe->i_links_count = 0;
inode->i_nlink = 0;
} else {
@@ -894,7 +893,7 @@
goto leave;
}
- if (S_ISDIR (inode->i_mode)) {
+ if (S_ISDIR(inode->i_mode)) {
dir->i_nlink--;
status = ocfs_mark_inode_dirty(handle, dir,
parent_node_bh);
@@ -986,14 +985,16 @@
} /* ocfs_double_lock */
#define PARENT_INO(buffer) \
- ((struct ocfs2_dir_entry *) ((char *) buffer + \
- le16_to_cpu(((struct ocfs2_dir_entry *) buffer)->rec_len)))->inode
+ ((struct ocfs2_dir_entry *) \
+ ((char *)buffer + \
+ le16_to_cpu(((struct ocfs2_dir_entry *)buffer)->rec_len)))->inode
/*
* ocfs_rename()
*
*/
-static int ocfs_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry)
+static int ocfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry)
{
int status = 0;
struct inode *old_inode = old_dentry->d_inode;
@@ -1018,10 +1019,10 @@
/* At some point it might be nice to break this function up a
* bit. */
- mlog_entry ("(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);
+ mlog_entry("(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);
osb = OCFS2_SB(old_dir->i_sb);
@@ -1030,9 +1031,9 @@
BUG();
}
- if (atomic_read (&old_dentry->d_count) > 2) {
- shrink_dcache_parent (old_dentry);
- if (atomic_read (&old_dentry->d_count) > 2) {
+ if (atomic_read(&old_dentry->d_count) > 2) {
+ shrink_dcache_parent(old_dentry);
+ if (atomic_read(&old_dentry->d_count) > 2) {
status = -EBUSY;
goto bail;
}
@@ -1084,7 +1085,7 @@
}
status = -EIO;
- old_inode_de_bh = ocfs_bread (old_inode, 0, &status, 0);
+ old_inode_de_bh = ocfs_bread(old_inode, 0, &status, 0);
if (!old_inode_de_bh)
goto bail;
@@ -1199,7 +1200,7 @@
}
if (new_de) {
- if (S_ISDIR (new_inode->i_mode)) {
+ if (S_ISDIR(new_inode->i_mode)) {
if (!ocfs_empty_dir(new_inode) || new_inode->i_nlink != 2) {
status = -ENOTEMPTY;
goto bail;
@@ -1239,7 +1240,7 @@
goto bail;
}
- if (S_ISDIR (new_inode->i_mode))
+ if (S_ISDIR(new_inode->i_mode))
newfe->i_links_count = 0;
else
newfe->i_links_count--;
@@ -1251,9 +1252,9 @@
}
} else {
/* if the name was not found in new_dir, add it now */
- status = ocfs_add_entry (handle, new_dentry, old_inode,
- OCFS2_I(old_inode)->ip_blkno,
- new_dir_bh, insert_entry_bh);
+ status = ocfs_add_entry(handle, new_dentry, old_inode,
+ OCFS2_I(old_inode)->ip_blkno,
+ new_dir_bh, insert_entry_bh);
}
old_inode->i_ctime = CURRENT_TIME;
@@ -1473,7 +1474,8 @@
* ocfs_symlink()
*
*/
-static int ocfs_symlink (struct inode *dir, struct dentry *dentry, const char *symname)
+static int ocfs_symlink(struct inode *dir, struct dentry *dentry,
+ const char *symname)
{
int status, l, credits;
u64 newsize;
@@ -1489,17 +1491,16 @@
ocfs2_alloc_context *inode_ac = NULL;
ocfs2_alloc_context *data_ac = NULL;
- mlog_entry ("(0x%p, 0x%p, symname='%s' actual='%.*s')\n", dir,
- dentry, symname, dentry->d_name.len,
- dentry->d_name.name);
+ mlog_entry("(0x%p, 0x%p, symname='%s' actual='%.*s')\n", dir,
+ dentry, symname, dentry->d_name.len, dentry->d_name.name);
sb = dir->i_sb;
osb = OCFS2_SB(sb);
l = strlen(symname) + 1;
- inode = new_inode (sb);
- if (IS_ERR (inode)) {
+ inode = new_inode(sb);
+ if (IS_ERR(inode)) {
status = PTR_ERR(inode);
inode = NULL;
mlog(ML_ERROR, "new_inode failed!\n");
@@ -1573,7 +1574,7 @@
fe = (ocfs2_dinode *) new_fe_bh->b_data;
OCFS2_I(inode)->ip_blkno = fe->i_blkno;
- if (ocfs_populate_inode (inode, fe, 1) < 0) {
+ if (ocfs_populate_inode(inode, fe, 1) < 0) {
mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, "
"i_blkno=%"MLFu64", i_ino=%lu\n",
(unsigned long long)new_fe_bh->b_blocknr,
@@ -1632,8 +1633,8 @@
goto bail;
}
- insert_inode_hash (inode);
- d_instantiate (dentry, inode);
+ insert_inode_hash(inode);
+ d_instantiate(dentry, inode);
bail:
if (handle)
ocfs_commit_trans(handle);
@@ -1648,16 +1649,17 @@
if (data_ac)
ocfs_free_alloc_context(data_ac);
- mlog_exit (status);
+ mlog_exit(status);
return status;
} /* ocfs_symlink */
-int ocfs_check_dir_entry (struct inode * dir, struct ocfs2_dir_entry * de, struct buffer_head * bh, unsigned long offset)
+int ocfs_check_dir_entry(struct inode * dir, struct ocfs2_dir_entry * de,
+ struct buffer_head * bh, unsigned long offset)
{
- const char * error_msg = NULL;
+ const char *error_msg = NULL;
const int rlen = le16_to_cpu(de->rec_len);
if (rlen < OCFS2_DIR_REC_LEN(1))
@@ -1683,16 +1685,16 @@
* If you pass me insert_bh, I'll skip the search of the other dir
* blocks and put the record in there.
*/
-static int __ocfs_add_entry (ocfs_journal_handle *handle, struct inode *dir,
- const char *name, int namelen,
- struct inode *inode, u64 blkno,
- struct buffer_head *parent_fe_bh,
- struct buffer_head *insert_bh)
+static int __ocfs_add_entry(ocfs_journal_handle *handle, struct inode *dir,
+ const char *name, int namelen,
+ struct inode *inode, u64 blkno,
+ struct buffer_head *parent_fe_bh,
+ struct buffer_head *insert_bh)
{
unsigned long offset;
unsigned short rec_len;
- struct ocfs2_dir_entry * de, * de1;
- struct super_block * sb;
+ struct ocfs2_dir_entry *de, *de1;
+ struct super_block *sb;
int retval, status;
mlog_entry_void();
@@ -1711,11 +1713,11 @@
/* These checks should've already been passed by the
* prepare function, but I guess we can leave them
* here anyway. */
- if (!ocfs_check_dir_entry (dir, de, insert_bh, offset)) {
+ if (!ocfs_check_dir_entry(dir, de, insert_bh, offset)) {
retval = -ENOENT;
goto bail;
}
- if (ocfs_match (namelen, name, de)) {
+ if (ocfs_match(namelen, name, de)) {
retval = -EEXIST;
goto bail;
}
@@ -1728,7 +1730,7 @@
/* By now the buffer is marked for journaling */
offset += le16_to_cpu(de->rec_len);
if (le64_to_cpu(de->inode)) {
- de1 = (struct ocfs2_dir_entry *) ((char *) de +
+ de1 = (struct ocfs2_dir_entry *)((char *) de +
OCFS2_DIR_REC_LEN(de->name_len));
de1->rec_len =
cpu_to_le16(le16_to_cpu(de->rec_len) -
@@ -1743,7 +1745,7 @@
} else
de->inode = 0;
de->name_len = namelen;
- memcpy (de->name, name, namelen);
+ memcpy(de->name, name, namelen);
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
dir->i_version++;
@@ -1769,9 +1771,11 @@
* ocfs_delete_entry deletes a directory entry by merging it with the
* previous entry
*/
-static int ocfs_delete_entry (ocfs_journal_handle *handle, struct inode * dir, struct ocfs2_dir_entry * de_del, struct buffer_head * bh)
+static int ocfs_delete_entry(ocfs_journal_handle *handle, struct inode *dir,
+ struct ocfs2_dir_entry *de_del,
+ struct buffer_head *bh)
{
- struct ocfs2_dir_entry * de, * pde;
+ struct ocfs2_dir_entry *de, *pde;
int i, status = -ENOENT;
mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
@@ -1792,7 +1796,8 @@
goto bail;
}
if (pde)
- pde->rec_len = cpu_to_le16(le16_to_cpu(pde->rec_len) +
+ pde->rec_len =
+ cpu_to_le16(le16_to_cpu(pde->rec_len) +
le16_to_cpu(de->rec_len));
else
de->inode = 0;
@@ -1802,7 +1807,7 @@
}
i += le16_to_cpu(de->rec_len);
pde = de;
- de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->rec_len));
+ de = (struct ocfs2_dir_entry *)((char *)de + le16_to_cpu(de->rec_len));
}
bail:
mlog_exit(status);
@@ -1812,27 +1817,29 @@
/*
* Returns 0 if not found, -1 on failure, and 1 on success
*/
-static int inline search_dirblock(struct buffer_head * bh,
+static int inline search_dirblock(struct buffer_head *bh,
struct inode *dir,
const char *name, int namelen,
unsigned long offset,
- struct ocfs2_dir_entry ** res_dir)
+ struct ocfs2_dir_entry **res_dir)
{
- struct ocfs2_dir_entry * de;
- char * dlimit;
+ struct ocfs2_dir_entry *de;
+ char *dlimit, *de_buf;
int de_len;
int ret = 0;
mlog_entry_void();
de = (struct ocfs2_dir_entry *) bh->b_data;
- dlimit = (char *)de + dir->i_sb->s_blocksize;
- while ((char *) de < dlimit) {
+ de_buf = (char *) de;
+
+ dlimit = de_buf + dir->i_sb->s_blocksize;
+ while (de_buf < dlimit) {
/* this code is executed quadratically often */
/* do minimal checking `by hand' */
- if ((char *) de + namelen <= dlimit &&
- ocfs_match (namelen, name, de)) {
+ if (de_buf + namelen <= dlimit &&
+ ocfs_match(namelen, name, de)) {
/* found a match - just to be sure, do a full check */
if (!ocfs_check_dir_entry(dir, de, bh, offset)) {
ret = -1;
@@ -1849,10 +1856,10 @@
goto bail;
}
offset += de_len;
- de = (struct ocfs2_dir_entry *) ((char *) de + de_len);
+ de = (struct ocfs2_dir_entry *) (de_buf + de_len);
}
+
bail:
-
mlog_exit(ret);
return ret;
}
@@ -1863,9 +1870,9 @@
struct inode *dir,
struct ocfs2_dir_entry **res_dir)
{
- struct super_block * sb;
- struct buffer_head * bh_use[NAMEI_RA_SIZE];
- struct buffer_head * bh, *ret = NULL;
+ struct super_block *sb;
+ struct buffer_head *bh_use[NAMEI_RA_SIZE];
+ struct buffer_head *bh, *ret = NULL;
unsigned long start, block, b;
int ra_max = 0; /* Number of bh's in the readahead
buffer, bh_use[] */
Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/suballoc.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -162,7 +162,7 @@
}
memset(bg, 0, sb->s_blocksize);
- strcpy (bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE);
+ strcpy(bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE);
bg->bg_generation = cpu_to_le32(OCFS2_SB(sb)->fs_generation);
bg->bg_size = ocfs2_group_bitmap_size(sb);
bg->bg_bits = (u32) cl->cl_cpg * (u32) cl->cl_bpc;
@@ -171,7 +171,7 @@
bg->bg_parent_dinode = OCFS2_I(alloc_inode)->ip_blkno;
bg->bg_blkno = group_blkno;
/* set the 1st bit in the bitmap to account for the descriptor block */
- ocfs2_set_bit(0, (unsigned long *) bg->bg_bitmap);
+ ocfs2_set_bit(0, (unsigned long *)bg->bg_bitmap);
bg->bg_free_bits_count = bg->bg_bits - 1;
status = ocfs_journal_dirty(handle, bg_bh);
Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c 2005-05-24 00:53:34 UTC (rev 2310)
+++ trunk/fs/ocfs2/vote.c 2005-05-24 18:40:03 UTC (rev 2311)
@@ -232,7 +232,7 @@
OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SKIP_DELETE;
spin_unlock(&OCFS2_I(inode)->ip_lock);
- d_prune_aliases (inode);
+ d_prune_aliases(inode);
done:
return response;
@@ -241,7 +241,7 @@
static void ocfs2_process_dentry_request(struct inode *inode,
int rename)
{
- d_prune_aliases (inode);
+ d_prune_aliases(inode);
/* for rename, we don't drop link counts */
if (!rename) {
More information about the Ocfs2-commits
mailing list