diff options
author | Nathan Scott <nathans@sgi.com> | 2005-11-01 19:43:58 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 19:43:58 -0500 |
commit | 4aeb664c2561c0bae18d7a3a141d7d2acf126da1 (patch) | |
tree | 832e72237a69b76bf4c965d7383cdbb9fc3f8939 /fs/xfs/xfs_inode.c | |
parent | 0fdfb3757f27b6d802f85e962d9b0f875df17113 (diff) |
[XFS] Improve buffered read throughput by removing unnecessary timer calls
that showed in ´kernel profiles.
SGI-PV: 925163
SGI-Modid: xfs-linux:xfs-kern:23861a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5bf7b709f91a..a648cc8ce96b 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -3688,73 +3688,6 @@ xfs_iroundup( | |||
3688 | return( 0 ); | 3688 | return( 0 ); |
3689 | } | 3689 | } |
3690 | 3690 | ||
3691 | /* | ||
3692 | * Change the requested timestamp in the given inode. | ||
3693 | * We don't lock across timestamp updates, and we don't log them but | ||
3694 | * we do record the fact that there is dirty information in core. | ||
3695 | * | ||
3696 | * NOTE -- callers MUST combine XFS_ICHGTIME_MOD or XFS_ICHGTIME_CHG | ||
3697 | * with XFS_ICHGTIME_ACC to be sure that access time | ||
3698 | * update will take. Calling first with XFS_ICHGTIME_ACC | ||
3699 | * and then XFS_ICHGTIME_MOD may fail to modify the access | ||
3700 | * timestamp if the filesystem is mounted noacctm. | ||
3701 | */ | ||
3702 | void | ||
3703 | xfs_ichgtime(xfs_inode_t *ip, | ||
3704 | int flags) | ||
3705 | { | ||
3706 | timespec_t tv; | ||
3707 | vnode_t *vp = XFS_ITOV(ip); | ||
3708 | struct inode *inode = LINVFS_GET_IP(vp); | ||
3709 | |||
3710 | /* | ||
3711 | * We're not supposed to change timestamps in readonly-mounted | ||
3712 | * filesystems. Throw it away if anyone asks us. | ||
3713 | */ | ||
3714 | if (unlikely(vp->v_vfsp->vfs_flag & VFS_RDONLY)) | ||
3715 | return; | ||
3716 | |||
3717 | /* | ||
3718 | * Don't update access timestamps on reads if mounted "noatime" | ||
3719 | * Throw it away if anyone asks us. | ||
3720 | */ | ||
3721 | if ((ip->i_mount->m_flags & XFS_MOUNT_NOATIME || IS_NOATIME(inode)) && | ||
3722 | ((flags & (XFS_ICHGTIME_ACC|XFS_ICHGTIME_MOD|XFS_ICHGTIME_CHG)) | ||
3723 | == XFS_ICHGTIME_ACC)) | ||
3724 | return; | ||
3725 | |||
3726 | nanotime(&tv); | ||
3727 | if (flags & XFS_ICHGTIME_MOD) { | ||
3728 | VN_MTIMESET(vp, &tv); | ||
3729 | ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; | ||
3730 | ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; | ||
3731 | } | ||
3732 | if (flags & XFS_ICHGTIME_ACC) { | ||
3733 | VN_ATIMESET(vp, &tv); | ||
3734 | ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec; | ||
3735 | ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec; | ||
3736 | } | ||
3737 | if (flags & XFS_ICHGTIME_CHG) { | ||
3738 | VN_CTIMESET(vp, &tv); | ||
3739 | ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; | ||
3740 | ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; | ||
3741 | } | ||
3742 | |||
3743 | /* | ||
3744 | * We update the i_update_core field _after_ changing | ||
3745 | * the timestamps in order to coordinate properly with | ||
3746 | * xfs_iflush() so that we don't lose timestamp updates. | ||
3747 | * This keeps us from having to hold the inode lock | ||
3748 | * while doing this. We use the SYNCHRONIZE macro to | ||
3749 | * ensure that the compiler does not reorder the update | ||
3750 | * of i_update_core above the timestamp updates above. | ||
3751 | */ | ||
3752 | SYNCHRONIZE(); | ||
3753 | ip->i_update_core = 1; | ||
3754 | if (!(inode->i_state & I_LOCK)) | ||
3755 | mark_inode_dirty_sync(inode); | ||
3756 | } | ||
3757 | |||
3758 | #ifdef XFS_ILOCK_TRACE | 3691 | #ifdef XFS_ILOCK_TRACE |
3759 | ktrace_t *xfs_ilock_trace_buf; | 3692 | ktrace_t *xfs_ilock_trace_buf; |
3760 | 3693 | ||