kfusd/kfusd.c
static struct fusd_transaction *fusd_find_incomplete_transaction(fusd_file_t *fusd_file, int subcmd)
{
	struct fusd_transaction *transaction = fusd_find_transaction_by_pid(fusd_file, current->pid);
	if (transaction == NULL)
		return NULL;


	if (transaction->subcmd != subcmd) {
		RDEBUG(2, "Incomplete transaction %ld thrown out, was expecting subcmd %d but received %d",
		       transaction->transid, transaction->subcmd, subcmd);
		fusd_cleanup_transaction(fusd_file, transaction);
		return NULL;
	}

	RDEBUG(4, "pid %d restarting system call with transid %ld", current->pid,
	       transaction->transid);
	return transaction;
}
/* todo
 * fusd_restart_check: Called from the beginning of most system calls
 * to see if we are restarting a system call.
 *
 * In the common case -- that this is NOT a restarted syscall -- we
 * return 0.
 *
 * In the much less common case, we return ERESTARTSYS, and expect the
 * caller to jump right to its fusd_fops_call() call.
 *
 * In the even LESS (hopefully very rare) case when one PID had an
 * interrupted syscall, but a different PID is the next to do a system
 * call on that file descriptor -- well, we lose.  Clear state of that
 * old syscall out and continue as usual.
 */


In the common case -- that this is NOT a restarted syscall -- we
return 0.

In the much less common case, we return ERESTARTSYS, and expect the
caller to jump right to its fusd_fops_call() call.

In the even LESS (hopefully very rare) case when one PID had an
interrupted syscall, but a different PID is the next to do a system
call on that file descriptor -- well, we lose.  Clear state of that
old syscall out and continue as usual.
In the common case -- that this is NOT a restarted syscall -- we return 0 . In the much less common case we return ERESTARTSYS and expect the caller to jump right to its fusd_fops_call () call . In the even LESS ( hopefully very rare ) case when one PID had an interrupted syscall but a different PID is the next to do a system call on that file descriptor -- well we lose . Clear state of that old syscall out and continue as usual .
static struct fusd_transaction *fusd_find_incomplete_transaction(fusd_file_t *fusd_file, int subcmd)
{
	struct fusd_transaction *transaction = fusd_find_transaction_by_pid(fusd_file, current->pid);
	if (transaction == NULL)
		return NULL;
	if (transaction->subcmd != subcmd) {
		RDEBUG(2, "Incomplete transaction %ld thrown out, was expecting subcmd %d but received %d",
		       transaction->transid, transaction->subcmd, subcmd);
		fusd_cleanup_transaction(fusd_file, transaction);
		return NULL;
	}
	RDEBUG(4, "pid %d restarting system call with transid %ld", current->pid,
	       transaction->transid);
	return transaction;
}
static struct fusd_transaction * fusd_find_incomplete_transaction ( fusd_file_t * fusd_file , int subcmd ) { struct fusd_transaction * transaction = fusd_find_transaction_by_pid ( fusd_file , current -> pid ) ; if ( transaction == NULL ) return NULL ; if ( transaction -> subcmd != subcmd ) { RDEBUG ( 2 , " " , transaction -> transid , transaction -> subcmd , subcmd ) ; fusd_cleanup_transaction ( fusd_file , transaction ) ; return NULL ; } RDEBUG ( 4 , " " , current -> pid , transaction -> transid ) ; return transaction ; }
todo
 fusd_restart_check: Called from the beginning of most system calls
 to see if we are restarting a system call.
todo fusd_restart_check : Called from the beginning of most system calls to see if we are restarting a system call .