/* NOTE: This function runs with the inode_lock spin lock held so it is not allowed to sleep.  */
int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
/* NOTE: This function runs with the inode_lock spin lock held so it is not allowed to sleep.  */
int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
{
	ntfs_inode *ni;
	if (vi->i_ino != na->mft_no)
		return 0;
	ni = NTFS_I(vi);
	if (likely(!NInoAttr(ni))) {
		if (unlikely(na->type != AT_UNUSED))
			return 0;
	} else {
		if (ni->type != na->type)
			return 0;
		if (ni->name_len != na->name_len)
			return 0;
		if (na->name_len && memcmp(ni->name, na->name,
				na->name_len * sizeof(ntfschar)))
			return 0;
	}
	return 1;
}