diff options
author | Nathan Scott <nathans@sgi.com> | 2006-03-13 21:33:36 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-03-13 21:33:36 -0500 |
commit | 220b5284139be6ecbc39b353fd76f0923eccc3d6 (patch) | |
tree | 86ab8c671631a109690d6589a19d9774d8bed18f /fs/xfs/linux-2.6/xfs_file.c | |
parent | 9b94c2eddf407ad8faa5672ffa691e2076167564 (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.c | 13 |
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( | |||
420 | { | 420 | { |
421 | struct inode *ip = filp->f_dentry->d_inode; | 421 | struct inode *ip = filp->f_dentry->d_inode; |
422 | vnode_t *vp = LINVFS_GET_VP(ip); | 422 | vnode_t *vp = LINVFS_GET_VP(ip); |
423 | vattr_t va = { .va_mask = XFS_AT_UPDATIME }; | 423 | vattr_t *vattr; |
424 | int error; | 424 | int error; |
425 | 425 | ||
426 | vma->vm_ops = &linvfs_file_vm_ops; | 426 | vma->vm_ops = &linvfs_file_vm_ops; |
@@ -431,9 +431,14 @@ linvfs_file_mmap( | |||
431 | } | 431 | } |
432 | #endif /* CONFIG_XFS_DMAPI */ | 432 | #endif /* CONFIG_XFS_DMAPI */ |
433 | 433 | ||
434 | VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error); | 434 | vattr = kmalloc(sizeof(*vattr), GFP_KERNEL); |
435 | if (!error) | 435 | if (unlikely(!vattr)) |
436 | vn_revalidate(vp); /* update Linux inode flags */ | 436 | return -ENOMEM; |
437 | vattr->va_mask = XFS_AT_UPDATIME; | ||
438 | VOP_SETATTR(vp, vattr, XFS_AT_UPDATIME, NULL, error); | ||
439 | if (likely(!error)) | ||
440 | __vn_revalidate(vp, vattr); /* update flags */ | ||
441 | kfree(vattr); | ||
437 | return 0; | 442 | return 0; |
438 | } | 443 | } |
439 | 444 | ||