/* Check whether 'de' has enough room to hold an entry of 'new_rec_len' bytes.  */
static int ocfs2_dirent_would_fit(struct ocfs2_dir_entry *de, unsigned int new_rec_len)
/* Check whether 'de' has enough room to hold an entry of 'new_rec_len' bytes.  */
static int ocfs2_dirent_would_fit(struct ocfs2_dir_entry *de, unsigned int new_rec_len)
{
	unsigned int de_really_used;
	if (le64_to_cpu(de->inode) == 0 &&
	    le16_to_cpu(de->rec_len) >= new_rec_len)
		return 1;
	de_really_used = OCFS2_DIR_REC_LEN(de->name_len);
	if (le16_to_cpu(de->rec_len) >= (de_really_used + new_rec_len))
	    return 1;
	return 0;
}