 lease = *flp; 
static int __setlease(struct file *filp, long arg, struct file_lock **flp){	struct file_lock *fl, **before, **my_before = NULL, *lease = *flp;	struct dentry *dentry = filp->f_dentry;	struct inode *inode = dentry->d_inode;	int error, rdlease_count = 0, wrlease_count = 0;	time_out_leases(inode);	error = -EINVAL;	if (!flp || !(*flp) || !(*flp)->fl_lmops || !(*flp)->fl_lmops->fl_break)		goto out;	error = -EAGAIN;	if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))		goto out;	if ((arg == F_WRLCK)	    && ((atomic_read(&dentry->d_count) > 1)		|| (atomic_read(&inode->i_count) > 1)))		goto out;	/*	 * At this point, we know that if there is an exclusive	 * lease on this file, then we hold it on this filp	 * (otherwise our open of this file would have blocked).	 * And if we are trying to acquire an exclusive lease,	 * then the file is not open by anyone (including us)	 * except for this filp.	 */	for (before = &inode->i_flock;			((fl = *before) != NULL) && IS_LEASE(fl);			before = &fl->fl_next) {		if (lease->fl_lmops->fl_mylease(fl, lease))			my_before = before;		else if (fl->fl_type == (F_INPROGRESS | F_UNLCK))			/*			 * Someone is in the process of opening this			 * file for writing so we may not take an			 * exclusive lease on it.			 */			wrlease_count++;		else			rdlease_count++;	}	if ((arg == F_RDLCK && (wrlease_count > 0)) ||	    (arg == F_WRLCK && ((rdlease_count + wrlease_count) > 0)))		goto out;	if (my_before != NULL) {		error = lease->fl_lmops->fl_change(my_before, arg);		goto out;	}	error = 0;	if (arg == F_UNLCK)		goto out;	error = -EINVAL;	if (!leases_enable)		goto out;	error = lease_alloc(filp, arg, &fl);	if (error)		goto out;	locks_copy_lock(fl, lease);	locks_insert_lock(before, fl);	*flp = fl;out:	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7eaae2828dadae3abde7f77734c874d4b74b313a/locks.c/clean/fs/locks.c