summaryrefslogtreecommitdiff
path: root/fs/ocfs2/inode.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-11-09 14:13:09 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2016-12-10 12:39:45 -0800
commit84e40080bd6f363ddbcab75b04cb7bc742efbf12 (patch)
treebdbaf3074c1798ff5450ca004823e4e301b45ff8 /fs/ocfs2/inode.h
parent876bec6f9bbfcb394916d17e35226b086c04dc45 (diff)
ocfs2: convert inode refcount test to a helper
Replace the open-coded inode refcount flag test with a helper function to reduce the potential for bugs. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/ocfs2/inode.h')
-rw-r--r--fs/ocfs2/inode.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h
index 5af68fcdf9d3..9b955f732bca 100644
--- a/fs/ocfs2/inode.h
+++ b/fs/ocfs2/inode.h
@@ -181,4 +181,10 @@ static inline struct ocfs2_inode_info *cache_info_to_inode(struct ocfs2_caching_
return container_of(ci, struct ocfs2_inode_info, ip_metadata_cache);
}
+/* Does this inode have the reflink flag set? */
+static inline bool ocfs2_is_refcount_inode(struct inode *inode)
+{
+ return (OCFS2_I(inode)->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL);
+}
+
#endif /* OCFS2_INODE_H */