diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-10-12 14:07:27 -0400 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2018-12-11 11:50:35 -0500 |
commit | 977767a7e1ee32ae85377d88b5383da789d2a6b5 (patch) | |
tree | c417d24dbbaaea8d28d62a37b5df16f200f237de /fs/gfs2/inode.h | |
parent | 40e020c129cfc991e8ab4736d2665351ffd1468d (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/inode.h')
-rw-r--r-- | fs/gfs2/inode.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index b5b6341a4f5c..793808263c6d 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -30,16 +30,14 @@ static inline int gfs2_is_jdata(const struct gfs2_inode *ip) | |||
30 | return ip->i_diskflags & GFS2_DIF_JDATA; | 30 | return ip->i_diskflags & GFS2_DIF_JDATA; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline int gfs2_is_writeback(const struct gfs2_inode *ip) | 33 | static inline bool gfs2_is_ordered(const struct gfs2_sbd *sdp) |
34 | { | 34 | { |
35 | const struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 35 | return sdp->sd_args.ar_data == GFS2_DATA_ORDERED; |
36 | return (sdp->sd_args.ar_data == GFS2_DATA_WRITEBACK) && !gfs2_is_jdata(ip); | ||
37 | } | 36 | } |
38 | 37 | ||
39 | static inline int gfs2_is_ordered(const struct gfs2_inode *ip) | 38 | static inline bool gfs2_is_writeback(const struct gfs2_sbd *sdp) |
40 | { | 39 | { |
41 | const struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 40 | return sdp->sd_args.ar_data == GFS2_DATA_WRITEBACK; |
42 | return (sdp->sd_args.ar_data == GFS2_DATA_ORDERED) && !gfs2_is_jdata(ip); | ||
43 | } | 41 | } |
44 | 42 | ||
45 | static inline int gfs2_is_dir(const struct gfs2_inode *ip) | 43 | static inline int gfs2_is_dir(const struct gfs2_inode *ip) |