/* Delete a lock and then free it. Wake up processes that are blocked waiting for this lock, notify the FS that the lock has been cleared and finally free the lock.  */
static void locks_delete_lock(struct file_lock **thisfl_p)
/* Delete a lock and then free it. Wake up processes that are blocked waiting for this lock, notify the FS that the lock has been cleared and finally free the lock.  */
static void locks_delete_lock(struct file_lock **thisfl_p)
{
	struct file_lock *fl = *thisfl_p;
	*thisfl_p = fl->fl_next;
	fl->fl_next = NULL;
	list_del_init(&fl->fl_link);
	fasync_helper(0, fl->fl_file, 0, &fl->fl_fasync);
	if (fl->fl_fasync != NULL) {
		printk(KERN_ERR "locks_delete_lock: fasync == %p\n", fl->fl_fasync);
		fl->fl_fasync = NULL;
	}
	if (fl->fl_nspid) {
		put_pid(fl->fl_nspid);
		fl->fl_nspid = NULL;
	}
	locks_wake_up_blocks(fl);
	locks_free_lock(fl);
}