/* XXX: sfr & willy disagree over whether F_INPROGRESS should be returned to userspace.  */
int fcntl_getlease(struct file *filp)
/* XXX: sfr & willy disagree over whether F_INPROGRESS should be returned to userspace.  */
int fcntl_getlease(struct file *filp)
{
	struct file_lock *fl;
	int type = F_UNLCK;
	lock_kernel();
	time_out_leases(filp->f_path.dentry->d_inode);
	for (fl = filp->f_path.dentry->d_inode->i_flock; fl && IS_LEASE(fl);
			fl = fl->fl_next) {
		if (fl->fl_file == filp) {
			type = fl->fl_type & ~F_INPROGRESS;
			break;
		}
	}
	unlock_kernel();
	return type;
}