kfusd/kfusd.c
int fusd_dev_is_valid(fusd_dev_t *fusd_dev)
{
	struct list_head *tmp;
	int dev_found = 0;

	/* The first thing we must do is acquire the global lock on the
	 * device list, and make sure this device is valid; if so, mark it
	 * as being "in use".  If we don't do this, there's a race: after we
	 * enter this function, the device may be unregistered. */
	down(&fusd_devlist_sem);

	list_for_each(tmp, &fusd_devlist_head)
	{
		fusd_dev_t *d = list_entry(tmp, fusd_dev_t, devlist);

		if (d == fusd_dev && d->magic == FUSD_DEV_MAGIC && !ZOMBIE(d)) {
			dev_found = 1;
			break;
		}
	}

	/* A device will not be deallocated when this counter is >0 */
	if (dev_found)
		fusd_dev->open_in_progress++;

	up(&fusd_devlist_sem);

	return dev_found;
}
/*
 * fusd_dev_is_valid: If a fusd device is valid, returns 1, and will have
 * set the "open_in_progress" flag on the device.
 */
If a fusd device is valid, returns 1, and will have
set the "open_in_progress" flag on the device.
If a fusd device is valid returns 1 and will have set the " open_in_progress " flag on the device .
int fusd_dev_is_valid(fusd_dev_t *fusd_dev)
{
	struct list_head *tmp;
	int dev_found = 0;
	down(&fusd_devlist_sem);
	list_for_each(tmp, &fusd_devlist_head)
	{
		fusd_dev_t *d = list_entry(tmp, fusd_dev_t, devlist);
		if (d == fusd_dev && d->magic == FUSD_DEV_MAGIC && !ZOMBIE(d)) {
			dev_found = 1;
			break;
		}
	}
	if (dev_found)
		fusd_dev->open_in_progress++;
	up(&fusd_devlist_sem);
	return dev_found;
}
int fusd_dev_is_valid ( fusd_dev_t * fusd_dev ) { struct list_head * tmp ; int dev_found = 0 ; down ( & fusd_devlist_sem ) ; list_for_each ( tmp , & fusd_devlist_head ) { fusd_dev_t * d = list_entry ( tmp , fusd_dev_t , devlist ) ; if ( d == fusd_dev && d -> magic == FUSD_DEV_MAGIC && ! ZOMBIE ( d ) ) { dev_found = 1 ; break ; } } if ( dev_found ) fusd_dev -> open_in_progress ++ ; up ( & fusd_devlist_sem ) ; return dev_found ; }
fusd_dev_is_valid: If a fusd device is valid, returns 1, and will have
 set the "open_in_progress" flag on the device.
fusd_dev_is_valid : If a fusd device is valid returns 1 and will have set the " open_in_progress " flag on the device .
/* The first thing we must do is acquire the global lock on the
	 * device list, and make sure this device is valid; if so, mark it
	 * as being "in use".  If we don't do this, there's a race: after we
	 * enter this function, the device may be unregistered. */ /* A device will not be deallocated when this counter is >0 */