aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-05-19 21:30:46 -0400
committerNiv Sardi <xaiki@debian.org>2008-07-28 02:58:18 -0400
commit61436febae29085bffc7c291db03cbd709dc68a3 (patch)
treee2cff92f885294be68326752029febb9fbef8bce /fs/xfs/xfs_vnodeops.c
parent48b62a1a97f118a5a71ae9222bc6d3481d6b757b (diff)
[XFS] kill xfs_igrow_start and xfs_igrow_finish
xfs_igrow_start just expands to xfs_zero_eof with two asserts that are useless in the context of the only caller and some rather confusing comments. xfs_igrow_finish is just a few lines of code decorated again with useless asserts and confusing comments. Just kill those two and merge them into xfs_setattr. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31186a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index e475e3717eb3..9b8b87fcd4ec 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -444,7 +444,13 @@ xfs_setattr(
444 code = 0; 444 code = 0;
445 if ((vap->va_size > ip->i_size) && 445 if ((vap->va_size > ip->i_size) &&
446 (flags & ATTR_NOSIZETOK) == 0) { 446 (flags & ATTR_NOSIZETOK) == 0) {
447 code = xfs_igrow_start(ip, vap->va_size, credp); 447 /*
448 * Do the first part of growing a file: zero any data
449 * in the last block that is beyond the old EOF. We
450 * need to do this before the inode is joined to the
451 * transaction to modify the i_size.
452 */
453 code = xfs_zero_eof(ip, vap->va_size, ip->i_size);
448 } 454 }
449 xfs_iunlock(ip, XFS_ILOCK_EXCL); 455 xfs_iunlock(ip, XFS_ILOCK_EXCL);
450 456
@@ -512,8 +518,11 @@ xfs_setattr(
512 timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; 518 timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG;
513 519
514 if (vap->va_size > ip->i_size) { 520 if (vap->va_size > ip->i_size) {
515 xfs_igrow_finish(tp, ip, vap->va_size, 521 ip->i_d.di_size = vap->va_size;
516 !(flags & ATTR_DMI)); 522 ip->i_size = vap->va_size;
523 if (!(flags & ATTR_DMI))
524 xfs_ichgtime(ip, XFS_ICHGTIME_CHG);
525 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
517 } else if ((vap->va_size <= ip->i_size) || 526 } else if ((vap->va_size <= ip->i_size) ||
518 ((vap->va_size == 0) && ip->i_d.di_nextents)) { 527 ((vap->va_size == 0) && ip->i_d.di_nextents)) {
519 /* 528 /*