Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=09262b4339de5417a10803fbfac277eebb38ca5a
Commit:     09262b4339de5417a10803fbfac277eebb38ca5a
Parent:     b3aea4edc2903fdee34920630b8b2433f6452f02
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 29 11:44:50 2007 +1000
Committer:  Tim Shimmin <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 11:38:36 2007 +1000

    [XFS] Create xfs_iflags_test_and_clear helper function
    
    SGI-PV: 969608
    SGI-Modid: xfs-linux-melb:xfs-kern:29496a
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: David Chinner <[EMAIL PROTECTED]>
    Signed-off-by: Tim Shimmin <[EMAIL PROTECTED]>
---
 fs/xfs/xfs_inode.h    |   13 +++++++++++++
 fs/xfs/xfs_vnodeops.c |    7 +------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 79d7246..ea1e24e 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -360,6 +360,19 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
        spin_unlock(&ip->i_flags_lock);
        return ret;
 }
+
+static inline int
+xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
+{
+       int ret;
+
+       spin_lock(&ip->i_flags_lock);
+       ret = ip->i_flags & flags;
+       if (ret)
+               ip->i_flags &= ~flags;
+       spin_unlock(&ip->i_flags_lock);
+       return ret;
+}
 #endif /* __KERNEL__ */
 
 
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index f2c037a..8ed7af3 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1541,12 +1541,7 @@ xfs_release(
                 * significantly reducing the time window where we'd otherwise
                 * be exposed to that problem.
                 */
-               spin_lock(&ip->i_flags_lock);
-               truncated = __xfs_iflags_test(ip, XFS_ITRUNCATED);
-               if (truncated)
-                       ip->i_flags &= ~XFS_ITRUNCATED;
-               spin_unlock(&ip->i_flags_lock);
-
+               truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED);
                if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
                        xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to