/* Searches the inode's list of locks to find any POSIX locks which conflict. This function is called from locks_verify_locked() only.  */
int locks_mandatory_locked(struct inode *inode)
/* Searches the inode's list of locks to find any POSIX locks which conflict. This function is called from locks_verify_locked() only.  */
int locks_mandatory_locked(struct inode *inode)
{
	fl_owner_t owner = current->files;
	struct file_lock *fl;
	lock_kernel();
	for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
		if (!IS_POSIX(fl))
			continue;
		if (fl->fl_owner != owner)
			break;
	}
	unlock_kernel();
	return fl ? -EAGAIN : 0;
}