/* Returns 1 if new_dentry is a subdirectory of the parent (at any depth). Returns 0 otherwise. Caller must ensure that "new_dentry" is pinned before calling is_subdir()  */
int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry)
/* Returns 1 if new_dentry is a subdirectory of the parent (at any depth). Returns 0 otherwise. Caller must ensure that "new_dentry" is pinned before calling is_subdir()  */
int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry)
{
	int result;
	unsigned long seq;
	if (new_dentry == old_dentry)
		return 1;
	rcu_read_lock();
	do {
		seq = read_seqbegin(&rename_lock);
		if (d_ancestor(old_dentry, new_dentry))
			result = 1;
		else
			result = 0;
	} while (read_seqretry(&rename_lock, seq));
	rcu_read_unlock();
	return result;
}