kfusd/kfusd.c
static int fusd_client_release(struct inode *inode, struct file *file)
{
	int retval;
	fusd_file_t *fusd_file;
	fusd_dev_t *fusd_dev;
	fusd_msg_t fusd_msg;
	struct fusd_transaction *transaction;

	GET_FUSD_FILE_AND_DEV(file->private_data, fusd_file, fusd_dev);
	LOCK_FUSD_FILE(fusd_file);

	RDEBUG(3, "got a close on /dev/%s (owned by pid %d) from pid %d",
	       NAME(fusd_dev), fusd_dev->pid, current->pid);

	/* Tell the driver that the file closed, if it still exists. */
	init_fusd_msg(&fusd_msg);
	fusd_msg.subcmd = FUSD_CLOSE;
	retval = fusd_fops_call_send(fusd_file, &fusd_msg, &transaction);
	RDEBUG(5, "fusd_client_release: send returned %d", retval);
	if (retval >= 0)
		retval = fusd_fops_call_wait(fusd_file, NULL, transaction);

	RDEBUG(5, "fusd_client_release: call_wait %d", retval);
	/* delete the file off the device's file-list, and free it.  note
	 * that device may be a zombie right now and may be freed when we
	 * come back from free_fusd_file.  we only release the lock if the
	 * device still exists. */
	RAWLOCK_FUSD_DEV(fusd_dev);
	if (!free_fusd_file(fusd_dev, fusd_file)) {
		UNLOCK_FUSD_DEV(fusd_dev);
	}

	return retval;

invalid_dev:
invalid_file:
	RDEBUG(1, "got a close on client file from pid %d, INVALID DEVICE!",
	       current->pid);
	return -EPIPE;
}
/* close() has been called on a registered device.  like
 * fusd_client_open, we must lock the entire device. */
close() has been called on a registered device.  like
fusd_client_open, we must lock the entire device.
close () has been called on a registered device . like fusd_client_open we must lock the entire device .
static int fusd_client_release(struct inode *inode, struct file *file)
{
	int retval;
	fusd_file_t *fusd_file;
	fusd_dev_t *fusd_dev;
	fusd_msg_t fusd_msg;
	struct fusd_transaction *transaction;
	GET_FUSD_FILE_AND_DEV(file->private_data, fusd_file, fusd_dev);
	LOCK_FUSD_FILE(fusd_file);
	RDEBUG(3, "got a close on /dev/%s (owned by pid %d) from pid %d",
	       NAME(fusd_dev), fusd_dev->pid, current->pid);
	init_fusd_msg(&fusd_msg);
	fusd_msg.subcmd = FUSD_CLOSE;
	retval = fusd_fops_call_send(fusd_file, &fusd_msg, &transaction);
	RDEBUG(5, "fusd_client_release: send returned %d", retval);
	if (retval >= 0)
		retval = fusd_fops_call_wait(fusd_file, NULL, transaction);
	RDEBUG(5, "fusd_client_release: call_wait %d", retval);
	RAWLOCK_FUSD_DEV(fusd_dev);
	if (!free_fusd_file(fusd_dev, fusd_file)) {
		UNLOCK_FUSD_DEV(fusd_dev);
	}
	return retval;
invalid_dev:
invalid_file:
	RDEBUG(1, "got a close on client file from pid %d, INVALID DEVICE!",
	       current->pid);
	return -EPIPE;
}
static int fusd_client_release ( struct inode * inode , struct file * file ) { int retval ; fusd_file_t * fusd_file ; fusd_dev_t * fusd_dev ; fusd_msg_t fusd_msg ; struct fusd_transaction * transaction ; GET_FUSD_FILE_AND_DEV ( file -> private_data , fusd_file , fusd_dev ) ; LOCK_FUSD_FILE ( fusd_file ) ; RDEBUG ( 3 , " " , NAME ( fusd_dev ) , fusd_dev -> pid , current -> pid ) ; init_fusd_msg ( & fusd_msg ) ; fusd_msg . subcmd = FUSD_CLOSE ; retval = fusd_fops_call_send ( fusd_file , & fusd_msg , & transaction ) ; RDEBUG ( 5 , " " , retval ) ; if ( retval >= 0 ) retval = fusd_fops_call_wait ( fusd_file , NULL , transaction ) ; RDEBUG ( 5 , " " , retval ) ; RAWLOCK_FUSD_DEV ( fusd_dev ) ; if ( ! free_fusd_file ( fusd_dev , fusd_file ) ) { UNLOCK_FUSD_DEV ( fusd_dev ) ; } return retval ; invalid_dev : invalid_file : RDEBUG ( 1 , " " , current -> pid ) ; return - EPIPE ; }
close() has been called on a registered device.
close () has been called on a registered device .
/* Tell the driver that the file closed, if it still exists. */ /* delete the file off the device's file-list, and free it.  note
	 * that device may be a zombie right now and may be freed when we
	 * come back from free_fusd_file.  we only release the lock if the
	 * device still exists. */