/* This function is called when the file is being removed from the task's fd array. POSIX locks belonging to this task are deleted at this time.  */
void locks_remove_posix(struct file *filp, fl_owner_t owner)
/* This function is called when the file is being removed from the task's fd array. POSIX locks belonging to this task are deleted at this time.  */
void locks_remove_posix(struct file *filp, fl_owner_t owner)
{
	struct file_lock lock;
	if (!filp->f_path.dentry->d_inode->i_flock)
		return;
	lock.fl_type = F_UNLCK;
	lock.fl_flags = FL_POSIX | FL_CLOSE;
	lock.fl_start = 0;
	lock.fl_end = OFFSET_MAX;
	lock.fl_owner = owner;
	lock.fl_pid = current->tgid;
	lock.fl_file = filp;
	lock.fl_ops = NULL;
	lock.fl_lmops = NULL;
	vfs_lock_file(filp, F_SETLK, &lock, NULL);
	if (lock.fl_ops && lock.fl_ops->fl_release_private)
		lock.fl_ops->fl_release_private(&lock);
}