Skip to content

Commit 1097df3

Browse files
Tao MaJoel Becker
authored andcommitted
ocfs2: Sync max_inline_data_with_xattr from tools.
In ocfs2-tools, we have added ocfs2_max_inline_data_with_xattr, so add it in the kernel's ocfs2_fs.h. Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
1 parent 1dd473f commit 1097df3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎fs/ocfs2/ocfs2_fs.h‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,9 +1417,16 @@ static inline int ocfs2_fast_symlink_chars(int blocksize)
14171417
return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink);
14181418
}
14191419

1420-
static inline int ocfs2_max_inline_data(int blocksize)
1420+
static inline int ocfs2_max_inline_data_with_xattr(int blocksize,
1421+
struct ocfs2_dinode *di)
14211422
{
1422-
return blocksize - offsetof(struct ocfs2_dinode, id2.i_data.id_data);
1423+
if (di && (di->i_dyn_features & OCFS2_INLINE_XATTR_FL))
1424+
return blocksize -
1425+
offsetof(struct ocfs2_dinode, id2.i_data.id_data) -
1426+
di->i_xattr_inline_size;
1427+
else
1428+
return blocksize -
1429+
offsetof(struct ocfs2_dinode, id2.i_data.id_data);
14231430
}
14241431

14251432
static inline int ocfs2_extent_recs_per_inode(int blocksize)

0 commit comments

Comments
 (0)