summaryrefslogtreecommitdiff
path: root/fs/gfs2/incore.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2017-11-14 18:53:12 +0300
committerBob Peterson <rpeterso@redhat.com>2018-01-19 00:18:53 +0300
commit235628c5c76040b0ec206ea9ab9e017771e0d78e (patch)
treeab8a3c322a8d59ab5814a14d61f9cf6050d0d0d7 /fs/gfs2/incore.h
parent9db115a0e3d3814e41eb703082b83a261d81736c (diff)
downloadlinux-235628c5c76040b0ec206ea9ab9e017771e0d78e.tar.xz
gfs2: Add gfs2_max_stuffed_size
Add a small inline function for computing the maximum size of a stuffed inode instead of open coding that in several places throughout the code. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r--fs/gfs2/incore.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 6e18e9793ec4..9d4d7367175f 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -861,5 +861,10 @@ static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which)
extern struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl);
+static inline unsigned gfs2_max_stuffed_size(const struct gfs2_inode *ip)
+{
+ return GFS2_SB(&ip->i_inode)->sd_sb.sb_bsize - sizeof(struct gfs2_dinode);
+}
+
#endif /* __INCORE_DOT_H__ */