xfs
[Top] [All Lists]

[PATCH] Mark core as dirty when atime updated needed for XFS inode

Subject: [PATCH] Mark core as dirty when atime updated needed for XFS inode
From: Niv Sardi <xaiki@xxxxxxxxxx>
Date: Thu, 23 Oct 2008 13:41:09 +1100
Currently we're not writting atime updates back to disk on unmount
if it's the only change that happened. One solution would be to implement
->dirty_inode() but that might be overkill and has a perf hit, instead
just tag as needed for update in reclaim()

Signed-off-by: Niv Sardi <xaiki@xxxxxxxxxx>
---
 fs/xfs/xfs_vnodeops.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index e257f65..828d398 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -2840,6 +2840,7 @@ int
 xfs_reclaim(
        xfs_inode_t     *ip)
 {
+       struct inode    *inode = VFS_I(ip);
 
        xfs_itrace_entry(ip);
 
@@ -2856,10 +2857,13 @@ xfs_reclaim(
        ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0);
 
        /*
-        * Make sure the atime in the XFS inode is correct before freeing the
-        * Linux inode.
+        * Mark dirty and update atime only if different from the linux inode 
one.
         */
-       xfs_synchronize_atime(ip);
+       if (! timespec_equal(&inode->i_atime,
+                            (struct timespec *) &ip->i_d.di_atime)) {
+               xfs_synchronize_atime(ip);
+               ip->i_update_core = 1;
+       }
 
        /*
         * If we have nothing to flush with this inode then complete the
-- 
1.5.6.2


--=-=-=


-- 
Niv Sardi

--=-=-=--


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] Mark core as dirty when atime updated needed for XFS inode, Niv Sardi <=