[Ocfs2-commits] manish commits r880 - in trunk/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Apr 28 18:43:12 CDT 2004
Author: manish
Date: 2004-04-28 17:43:10 -0500 (Wed, 28 Apr 2004)
New Revision: 880
Modified:
trunk/src/dcache.c
trunk/src/dir.c
trunk/src/file.c
trunk/src/inc/ocfs.h
trunk/src/inode.c
trunk/src/namei.c
trunk/src/super.c
trunk/src/symlink.c
Log:
Remove a pile of unnecessary (ocfs_super *) casts
Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/dcache.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -55,7 +55,7 @@
dentry->d_name.len, dentry->d_name.name);
if ((inode = dentry->d_inode) == NULL ||
- (osb = (ocfs_super *)(OCFS_GENERIC_SB_P(inode->i_sb))) == NULL)
+ (osb = OCFS_GENERIC_SB_P(inode->i_sb)) == NULL)
goto bail;
if (osb->publ_map == (1 << osb->node_num)) {
Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/dir.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -58,11 +58,12 @@
pos = filp->f_pos;
sb = inode->i_sb;
- if (!(OCFS_GENERIC_SB_P(sb))) {
+ osb = OCFS_GENERIC_SB_P(sb);
+
+ if (!osb) {
LOG_TRACE_STR ("Invalid OSB");
goto bail;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
rootOff = GET_INODE_VOTEOFF(inode);
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/file.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -101,7 +101,7 @@
LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", inode, file,
file->f_dentry->d_name.len, file->f_dentry->d_name.name);
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
if (osb->osb_flags & OCFS_OSB_FLAGS_SHUTDOWN) {
LOG_ERROR_STR ("Volume has been shutdown");
@@ -278,7 +278,7 @@
if (file->private_data)
ofile = (ocfs_file *) file->private_data;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
/* dir */
if (S_ISDIR (inode->i_mode)) {
@@ -394,7 +394,7 @@
int err = 0;
journal_t *journal;
struct inode *inode = dentry->d_inode;
- ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ ocfs_super *osb = OCFS_GENERIC_SB_P(inode->i_sb);
LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, %d, '%*s')\n", file, dentry, datasync,
dentry->d_name.len, dentry->d_name.name);
@@ -575,8 +575,9 @@
ret = -EIO;
goto bail;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
+
lockres = OCFS_I(inode)->lock_res;
if (lockres == NULL) {
ret = -EIO;
@@ -740,8 +741,9 @@
ret = -EINVAL;
goto bail;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
+
if (filp->f_flags & O_DIRECT) {
/* anything special for o_direct? */
LOG_TRACE_STR ("O_DIRECT");
@@ -1217,7 +1219,7 @@
LOG_ENTRY_ARGS ("(0x%08x, '%*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
if (!dentry->d_parent || !dentry->d_parent->d_inode) {
LOG_ERROR_STR ("bad inode or root inode");
@@ -1398,7 +1400,7 @@
if (inode == NULL || !OCFS_I(inode)->open_hndl_cnt)
goto bail;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER)
goto bail;
Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/inc/ocfs.h 2004-04-28 22:43:10 UTC (rev 880)
@@ -2528,7 +2528,7 @@
if (!inode)
return;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER)
is_root = 1;
Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/inode.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -377,7 +377,7 @@
LOG_ENTRY_ARGS ("(0x%08x, %u, size:%u)\n", inode, mode, fe->file_size);
sb = inode->i_sb;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+ osb = OCFS_GENERIC_SB_P(sb);
fe_off = fe->this_sector;
offset = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
@@ -599,7 +599,7 @@
goto bail;
}
sb = inode->i_sb;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+ osb = OCFS_GENERIC_SB_P(sb);
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
ocfs_read_inode_nofe(osb, inode,
osb->vol_layout.root_start_off);
@@ -830,7 +830,7 @@
HILO(GET_INODE_FEOFF(inode)));
/* we should not really be using osb in this context. */
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
if (!inode->u.generic_ip) {
LOG_ERROR_ARGS("inode %lu has no generic_ip!\n", inode->i_ino);
@@ -1033,7 +1033,7 @@
goto bail;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
if ((iblock << 9) > PATH_MAX + 1) {
LOG_ERROR_ARGS ("file offset > PATH_MAX: %u.%u", iblock << 9);
@@ -1101,7 +1101,7 @@
goto bail;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
vbo = (__s64) iblock << inode->i_sb->s_blocksize_bits;
if (!INODE_JOURNAL(inode) && vbo >= OCFS_I(inode)->alloc_size) {
@@ -1158,7 +1158,7 @@
#endif
{
int disk_block = 0;
- ocfs_super *osb =(ocfs_super *) OCFS_GENERIC_SB_P(mapping->host->i_sb);
+ ocfs_super *osb = OCFS_GENERIC_SB_P(mapping->host->i_sb);
__s64 vbo = 0;
__s64 lbo = 0;
__u32 len;
@@ -1218,7 +1218,7 @@
goto bail;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ osb = OCFS_GENERIC_SB_P(inode->i_sb);
vbo = (__s64) iblock << inode->i_sb->s_blocksize_bits;
len = 1;
Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/namei.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -71,7 +71,7 @@
struct inode *inode = NULL;
struct super_block *sb = dir->i_sb;
struct dentry *ret;
- ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+ ocfs_super *osb = OCFS_GENERIC_SB_P(sb);
LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", dir, dentry,
dentry->d_name.len, dentry->d_name.name);
@@ -138,7 +138,7 @@
dev, dentry->d_name.len, dentry->d_name.name);
/* get our super block */
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(dir->i_sb);
+ osb = OCFS_GENERIC_SB_P(dir->i_sb);
if (osb->osb_flags & OCFS_OSB_FLAGS_SHUTDOWN) {
LOG_ERROR_STR ("Volume has been shutdown");
status = -EACCES;
@@ -527,7 +527,7 @@
dentry->d_name.len, dentry->d_name.name);
inode = dentry->d_inode;
- osb = (ocfs_super *)OCFS_GENERIC_SB_P(dir->i_sb);
+ osb = OCFS_GENERIC_SB_P(dir->i_sb);
parentOff = GET_INODE_VOTEOFF(dir);
@@ -935,7 +935,7 @@
old_dentry->d_name.len, old_dentry->d_name.name,
new_dentry->d_name.len, new_dentry->d_name.name);
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(old_dir->i_sb);
+ osb = OCFS_GENERIC_SB_P(old_dir->i_sb);
/* old parent dir offset */
oldDirOff = GET_INODE_VOTEOFF(old_dir);
@@ -1356,7 +1356,7 @@
l = strlen (symname) + 1;
newsize = l - 1;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(dir->i_sb);
+ osb = OCFS_GENERIC_SB_P(dir->i_sb);
/* need the offset of our parent directory to lock it */
parent_off = GET_INODE_VOTEOFF(parentInode);
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/super.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -283,7 +283,7 @@
if (status < 0)
goto read_super_error;
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+ osb = OCFS_GENERIC_SB_P(sb);
if (!osb) {
status = -EINVAL;
goto read_super_error;
@@ -736,7 +736,7 @@
LOG_ENTRY_ARGS ("(%p, %p)\n", sb, buf);
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+ osb = OCFS_GENERIC_SB_P(sb);
numbits = osb->cluster_bitmap.validbits;
status = ocfs_read_bh (osb, OCFS_BITMAP_LOCK_OFFSET, &bh, 0, NULL);
@@ -1089,7 +1089,7 @@
goto leave;
}
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
+ osb = OCFS_GENERIC_SB_P(sb);
if ( osb == NULL) {
LOG_ERROR_STATUS (status = -EFAIL);
Modified: trunk/src/symlink.c
===================================================================
--- trunk/src/symlink.c 2004-04-28 22:32:37 UTC (rev 879)
+++ trunk/src/symlink.c 2004-04-28 22:43:10 UTC (rev 880)
@@ -118,8 +118,8 @@
{
unsigned l;
char buf[10];
- struct inode *inode = (struct inode *)data;
- ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+ struct inode *inode = data;
+ ocfs_super *osb = OCFS_GENERIC_SB_P(inode->i_sb);
sprintf(buf,"%ld",osb->node_num);
l = strlen(buf);
More information about the Ocfs2-commits
mailing list