summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.h
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2020-06-17 07:47:34 -0500
committerAndreas Gruenbacher <agruenba@redhat.com>2020-07-03 12:05:34 +0200
commit7542486b89b2e321ffe0de82163b425d6a38bc72 (patch)
tree69dad92b550226ee3e77caf2b141542f8686ef8a /fs/gfs2/log.h
parent34244d711dea568f4a42c5b0d6b3d620f8cb6971 (diff)
downloadlinux-7542486b89b2e321ffe0de82163b425d6a38bc72.tar.gz
linux-7542486b89b2e321ffe0de82163b425d6a38bc72.tar.bz2
linux-7542486b89b2e321ffe0de82163b425d6a38bc72.zip
gfs2: eliminate GIF_ORDERED in favor of list_empty
In several places, we used the GIF_ORDERED inode flag to determine if an inode was on the ordered writes list. However, since we always held the sd_ordered_lock spin_lock during the manipulation, we can just as easily check list_empty(&ip->i_ordered) instead. This allows us to keep more than one ordered writes list to make journal writing improvements. This patch eliminates GIF_ORDERED in favor of checking list_empty. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/log.h')
-rw-r--r--fs/gfs2/log.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/log.h b/fs/gfs2/log.h
index c1cd6ae17659..8965c751a303 100644
--- a/fs/gfs2/log.h
+++ b/fs/gfs2/log.h
@@ -53,9 +53,9 @@ static inline void gfs2_ordered_add_inode(struct gfs2_inode *ip)
if (gfs2_is_jdata(ip) || !gfs2_is_ordered(sdp))
return;
- if (!test_bit(GIF_ORDERED, &ip->i_flags)) {
+ if (list_empty(&ip->i_ordered)) {
spin_lock(&sdp->sd_ordered_lock);
- if (!test_and_set_bit(GIF_ORDERED, &ip->i_flags))
+ if (list_empty(&ip->i_ordered))
list_add(&ip->i_ordered, &sdp->sd_log_ordered);
spin_unlock(&sdp->sd_ordered_lock);
}