summaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6/xfs_file.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-14 13:33:36 +1100
committerNathan Scott <nathans@sgi.com>2006-03-14 13:33:36 +1100
commit220b5284139be6ecbc39b353fd76f0923eccc3d6 (patch)
tree86ab8c671631a109690d6589a19d9774d8bed18f /fs/xfs/linux-2.6/xfs_file.c
parent9b94c2eddf407ad8faa5672ffa691e2076167564 (diff)
[XFS] Dynamically allocate vattr in places it makes sense to do so, to
reduce stack use. Also re-use vattr in some places so that multiple copies are not held on-stack. SGI-PV: 947312 SGI-Modid: xfs-linux-melb:xfs-kern:25369a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 269995ddfbdf..ce8fe40e1628 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -420,7 +420,7 @@ linvfs_file_mmap(
{
struct inode *ip = filp->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(ip);
- vattr_t va = { .va_mask = XFS_AT_UPDATIME };
+ vattr_t *vattr;
int error;
vma->vm_ops = &linvfs_file_vm_ops;
@@ -431,9 +431,14 @@ linvfs_file_mmap(
}
#endif /* CONFIG_XFS_DMAPI */
- VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error);
- if (!error)
- vn_revalidate(vp); /* update Linux inode flags */
+ vattr = kmalloc(sizeof(*vattr), GFP_KERNEL);
+ if (unlikely(!vattr))
+ return -ENOMEM;
+ vattr->va_mask = XFS_AT_UPDATIME;
+ VOP_SETATTR(vp, vattr, XFS_AT_UPDATIME, NULL, error);
+ if (likely(!error))
+ __vn_revalidate(vp, vattr); /* update flags */
+ kfree(vattr);
return 0;
}