xfs
[Top] [All Lists]

[PATCH 1/5] xfs: do eofb filtering before dirty check

To: xfs@xxxxxxxxxxx
Subject: [PATCH 1/5] xfs: do eofb filtering before dirty check
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Fri, 28 Mar 2014 09:15:59 -0400
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1396012563-60973-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1396012563-60973-1-git-send-email-bfoster@xxxxxxxxxx>
Reorder xfs_inode_free_eofblocks() so the explicit eofb filtering (i.e.,
uid, etc.) occurs before the dirty mapping check. This facilitates the
addition of a flush flag.

If we want to issue a flush, we should do so after the filtering logic
but before the dirty check since a flush reduces the likelihood we skip
an inode due to a dirty mapping.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 fs/xfs/xfs_icache.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 98d3524..7ff59c9 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1223,14 +1223,6 @@ xfs_inode_free_eofblocks(
                return 0;
        }
 
-       /*
-        * If the mapping is dirty the operation can block and wait for some
-        * time. Unless we are waiting, skip it.
-        */
-       if (!(flags & SYNC_WAIT) &&
-           mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
-               return 0;
-
        if (eofb) {
                if (!xfs_inode_match_id(ip, eofb))
                        return 0;
@@ -1241,6 +1233,14 @@ xfs_inode_free_eofblocks(
                        return 0;
        }
 
+       /*
+        * If the mapping is dirty the operation can block and wait for some
+        * time. Unless we are waiting, skip it.
+        */
+       if (!(flags & SYNC_WAIT) &&
+           mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
+               return 0;
+
        ret = xfs_free_eofblocks(ip->i_mount, ip, true);
 
        /* don't revisit the inode if we're not waiting */
-- 
1.8.3.1

<Prev in Thread] Current Thread [Next in Thread>