summaryrefslogtreecommitdiff
path: root/fs/gfs2/aops.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2018-10-12 20:07:27 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2018-12-11 17:50:35 +0100
commit977767a7e1ee32ae85377d88b5383da789d2a6b5 (patch)
treec417d24dbbaaea8d28d62a37b5df16f200f237de /fs/gfs2/aops.c
parent40e020c129cfc991e8ab4736d2665351ffd1468d (diff)
gfs2: Clean up gfs2_is_{ordered,writeback}
The gfs2_is_ordered and gfs2_is_writeback checks are weird in that they implicitly check for !gfs2_is_jdata. This makes understanding how to use those functions correctly a challenge. Clean this up by making gfs2_is_ordered and gfs2_is_writeback take a super block instead of an inode and by removing the implicit !gfs2_is_jdata checks. Update the callers accordingly. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/aops.c')
-rw-r--r--fs/gfs2/aops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 8afbb35559b9..d9d2a3470656 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -930,14 +930,14 @@ static const struct address_space_operations gfs2_jdata_aops = {
void gfs2_set_aops(struct inode *inode)
{
struct gfs2_inode *ip = GFS2_I(inode);
+ struct gfs2_sbd *sdp = GFS2_SB(inode);
- if (gfs2_is_writeback(ip))
+ if (gfs2_is_jdata(ip))
+ inode->i_mapping->a_ops = &gfs2_jdata_aops;
+ else if (gfs2_is_writeback(sdp))
inode->i_mapping->a_ops = &gfs2_writeback_aops;
- else if (gfs2_is_ordered(ip))
+ else if (gfs2_is_ordered(sdp))
inode->i_mapping->a_ops = &gfs2_ordered_aops;
- else if (gfs2_is_jdata(ip))
- inode->i_mapping->a_ops = &gfs2_jdata_aops;
else
BUG();
}
-