]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_iops.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_iops.c
index 22e3b714f62973a62817f1ee7262c72c387a152a..0b5fa124bef2a8d53b88af18169020df11f0a68c 100644 (file)
@@ -43,8 +43,6 @@
 #include "xfs_itable.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
-#include "xfs_cap.h"
-#include "xfs_mac.h"
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
@@ -250,13 +248,13 @@ xfs_init_security(
  *
  * XXX(hch):  nfsd is broken, better fix it instead.
  */
-STATIC inline int
+STATIC_INLINE int
 xfs_has_fs_struct(struct task_struct *task)
 {
        return (task->fs != init_task.fs);
 }
 
-STATIC inline void
+STATIC void
 xfs_cleanup_inode(
        bhv_vnode_t     *dvp,
        bhv_vnode_t     *vp,
@@ -623,12 +621,27 @@ xfs_vn_getattr(
 {
        struct inode    *inode = dentry->d_inode;
        bhv_vnode_t     *vp = vn_from_inode(inode);
-       int             error = 0;
+       bhv_vattr_t     vattr = { .va_mask = XFS_AT_STAT };
+       int             error;
 
-       if (unlikely(vp->v_flag & VMODIFIED))
-               error = vn_revalidate(vp);
-       if (!error)
-               generic_fillattr(inode, stat);
+       error = bhv_vop_getattr(vp, &vattr, ATTR_LAZY, NULL);
+       if (likely(!error)) {
+               stat->size = i_size_read(inode);
+               stat->dev = inode->i_sb->s_dev;
+               stat->rdev = (vattr.va_rdev == 0) ? 0 :
+                               MKDEV(sysv_major(vattr.va_rdev) & 0x1ff,
+                                     sysv_minor(vattr.va_rdev));
+               stat->mode = vattr.va_mode;
+               stat->nlink = vattr.va_nlink;
+               stat->uid = vattr.va_uid;
+               stat->gid = vattr.va_gid;
+               stat->ino = vattr.va_nodeid;
+               stat->atime = vattr.va_atime;
+               stat->mtime = vattr.va_mtime;
+               stat->ctime = vattr.va_ctime;
+               stat->blocks = vattr.va_nblocks;
+               stat->blksize = vattr.va_blocksize;
+       }
        return -error;
 }
 
@@ -800,7 +813,7 @@ xfs_vn_removexattr(
 }
 
 
-struct inode_operations xfs_inode_operations = {
+const struct inode_operations xfs_inode_operations = {
        .permission             = xfs_vn_permission,
        .truncate               = xfs_vn_truncate,
        .getattr                = xfs_vn_getattr,
@@ -811,7 +824,7 @@ struct inode_operations xfs_inode_operations = {
        .removexattr            = xfs_vn_removexattr,
 };
 
-struct inode_operations xfs_dir_inode_operations = {
+const struct inode_operations xfs_dir_inode_operations = {
        .create                 = xfs_vn_create,
        .lookup                 = xfs_vn_lookup,
        .link                   = xfs_vn_link,
@@ -830,7 +843,7 @@ struct inode_operations xfs_dir_inode_operations = {
        .removexattr            = xfs_vn_removexattr,
 };
 
-struct inode_operations xfs_symlink_inode_operations = {
+const struct inode_operations xfs_symlink_inode_operations = {
        .readlink               = generic_readlink,
        .follow_link            = xfs_vn_follow_link,
        .put_link               = xfs_vn_put_link,