/* @dest the current destination mount @last_dest the last seen destination mount @last_src the last seen source mount @type return CL_SLAVE if the new mount has to be cloned as a slave.  */
static struct vfsmount* get_source(struct vfsmount *dest, struct vfsmount *last_dest, struct vfsmount *last_src, int *type)
/* @dest the current destination mount @last_dest the last seen destination mount @last_src the last seen source mount @type return CL_SLAVE if the new mount has to be cloned as a slave.  */
static struct vfsmount* get_source(struct vfsmount *dest, struct vfsmount *last_dest, struct vfsmount *last_src, int *type)
{
	struct vfsmount *p_last_src = NULL;
	struct vfsmount *p_last_dest = NULL;
	*type = CL_PROPAGATION;
	if (IS_MNT_SHARED(dest))
		*type |= CL_MAKE_SHARED;
	while (last_dest != dest->mnt_master) {
		p_last_dest = last_dest;
		p_last_src = last_src;
		last_dest = last_dest->mnt_master;
		last_src = last_src->mnt_master;
	}
	if (p_last_dest) {
		do {
			p_last_dest = next_peer(p_last_dest);
		} while (IS_MNT_NEW(p_last_dest));
	}
	if (dest != p_last_dest) {
		*type |= CL_SLAVE;
		return last_src;
	} else
		return p_last_src;
}