[Ocfs2-commits] jlbec commits r1010 - branches/format-changes/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Jun 4 19:19:06 CDT 2004
Author: jlbec
Date: 2004-06-04 18:19:04 -0500 (Fri, 04 Jun 2004)
New Revision: 1010
Modified:
branches/format-changes/src/file.c
branches/format-changes/src/inode.c
Log:
o Merged revision 979 from trunk
(Remove the getattr stuff for 2.4, since it's never used. Clean up
the 2.6 version (uses generic_fillattr). From Christoph Hellwig.)
Modified: branches/format-changes/src/file.c
===================================================================
--- branches/format-changes/src/file.c 2004-06-04 23:17:12 UTC (rev 1009)
+++ branches/format-changes/src/file.c 2004-06-04 23:19:04 UTC (rev 1010)
@@ -1463,86 +1463,27 @@
*/
int ocfs_getattr (struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
{
- struct inode *inode;
- struct super_block *sb;
- ocfs_super *osb;
- int err = -1;
+ struct inode *inode = dentry->d_inode;
+ struct super_block *sb = dentry->d_inode->i_sb;
+ ocfs_super *osb = sb->s_fs_info;
+ int err;
LOG_ENTRY();
- if (!dentry || !stat)
- goto bail;
-
- inode = dentry->d_inode;
- if (!inode)
- goto bail;
- sb = dentry->d_inode->i_sb;
- osb = ((ocfs_super *) sb->s_fs_info);
-
err = ocfs_inode_revalidate(dentry);
- if (err < 0) {
+ if (err) {
if (err != -ENOENT)
LOG_ERROR_STATUS(err);
goto bail;
}
- stat->dev = inode->i_sb->s_dev;
- stat->ino = inode->i_ino;
- stat->mode = inode->i_mode;
- stat->nlink = inode->i_nlink;
- stat->uid = inode->i_uid;
- stat->gid = inode->i_gid;
- stat->rdev = inode->i_rdev;
- stat->atime = inode->i_atime;
- stat->mtime = inode->i_mtime;
- stat->ctime = inode->i_ctime;
- stat->size = inode->i_size;
- stat->blocks = inode->i_blocks;
+ generic_fillattr(inode, stat);
/* We set the blksize from the cluster size for performance */
- stat->blksize = (__u32) osb->vol_layout.cluster_size;
+ stat->blksize = osb->vol_layout.cluster_size;
- err = 0;
bail:
LOG_EXIT_INT (err);
return err;
-} /* ocfs_getattr */
-
-#else
-/*
- * ocfs_getattr()
- * THIS FUNCTION IS UNUSED IN 2.4.x
- */
-int ocfs_getattr (struct dentry *dentry, struct iattr *attr)
-{
- struct inode *inode;
- int status, needs_trunc = 0;
- ocfs_super *osb;
-
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%*s')\n", dentry, attr,
- dentry->d_name.len, dentry->d_name.name);
-
- inode = dentry->d_inode;
- if (inode == NULL || !OCFS_I(inode)->open_hndl_cnt)
- goto bail;
-
- osb = OCFS_SB(inode->i_sb);
- if (inode == osb->root_inode)
- goto bail;
-
- /* yay, locking hell! Why do we hit disk for this?! */
- down(&inode->i_sem);
- down (&(OCFS_I(inode)->priv_sem));
- status = ocfs_verify_update_inode (osb, inode, &needs_trunc, 0);
- up (&(OCFS_I(inode)->priv_sem));
- if (needs_trunc)
- ocfs_truncate_inode_pages(inode, 0);
- if (status < 0)
- LOG_ERROR_STATUS (status);
- up(&inode->i_sem);
-bail:
- LOG_EXIT_INT (0);
- return 0;
-} /* ocfs_getattr */
+}
#endif
-
Modified: branches/format-changes/src/inode.c
===================================================================
--- branches/format-changes/src/inode.c 2004-06-04 23:17:12 UTC (rev 1009)
+++ branches/format-changes/src/inode.c 2004-06-04 23:19:04 UTC (rev 1010)
@@ -139,16 +139,18 @@
.mknod = ocfs_mknod,
.rename = ocfs_rename,
.setattr = ocfs_setattr,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.getattr = ocfs_getattr,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#else
.revalidate = ocfs_inode_revalidate,
#endif
};
static struct inode_operations ocfs_file_iops = {
.setattr = ocfs_setattr,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.getattr = ocfs_getattr,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#else
.revalidate = ocfs_inode_revalidate,
#endif
};
More information about the Ocfs2-commits
mailing list