aboutsummaryrefslogtreecommitdiff
path: root/fs/ocfs2/xattr.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/xattr.h')
-rw-r--r--fs/ocfs2/xattr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.h b/fs/ocfs2/xattr.h
index 02afa87d5e6..c25c7c62a05 100644
--- a/fs/ocfs2/xattr.h
+++ b/fs/ocfs2/xattr.h
@@ -57,4 +57,12 @@ static inline u16 ocfs2_blocks_per_xattr_bucket(struct super_block *sb)
{
return OCFS2_XATTR_BUCKET_SIZE / (1 << sb->s_blocksize_bits);
}
+
+static inline u16 ocfs2_xattr_max_xe_in_bucket(struct super_block *sb)
+{
+ u16 len = sb->s_blocksize -
+ offsetof(struct ocfs2_xattr_header, xh_entries);
+
+ return len / sizeof(struct ocfs2_xattr_entry);
+}
#endif /* OCFS2_XATTR_H */