linux-lts-quantal-3.5.0/kernel/replay.c
/* Handler that is called when the kernel work queue event thread is run */
Handler that is called when the kernel work queue event thread is run
Handler that is called when the kernel work queue event thread is run
static void
write_and_free_handler (struct work_struct *work)
{
	int fd = 0;
	struct syscall_result* write_psr;
	loff_t pos;
	struct file* file = NULL;
	mm_segment_t old_fs;
	struct record_thread *prect;
	struct write_async_params* awp;
	awp = (struct write_async_params*) work;
	prect = awp->prect;
	old_fs = get_fs();
	MPRINT ("Pid %d write_and_free_handler called for record pid %d\n", current->pid, prect->rp_record_pid);
	set_fs(KERNEL_DS);
	file = init_log_write (prect, &pos, &fd);
	if (file) {
		MPRINT ("Writing %lu records for pid %d\n", prect->rp_in_ptr, current->pid);
		write_psr = &prect->rp_log[0];
		write_log_data (file, &pos, prect, write_psr, prect->rp_in_ptr);
		term_log_write (file, fd);
	}
#ifdef LOG_COMPRESS_1
	file = init_clog_write (prect, &pos, &fd);
	if (file) {
		write_psr = &prect->rp_log[0];
		write_clog_data (file, &pos, prect, write_psr, prect->rp_in_ptr);
		term_clog_write (file, fd);
	}
#endif
	set_fs(old_fs);
	argsfreeall (prect);
#ifdef LOG_COMPRESS_1
	clogfreeall (prect);
#endif
	 __destroy_record_thread(prect);
	KFREE(awp);
	return;
}
static void write_and_free_handler ( struct work_struct * work ) { int fd = 0 ; struct syscall_result * write_psr ; loff_t pos ; struct file * file = NULL ; mm_segment_t old_fs ; struct record_thread * prect ; struct write_async_params * awp ; awp = ( struct write_async_params * ) work ; prect = awp -> prect ; old_fs = get_fs ( ) ; MPRINT ( " \n " , current -> pid , prect -> rp_record_pid ) ; set_fs ( KERNEL_DS ) ; file = init_log_write ( prect , & pos , & fd ) ; if ( file ) { MPRINT ( " \n " , prect -> rp_in_ptr , current -> pid ) ; write_psr = & prect -> rp_log [ 0 ] ; write_log_data ( file , & pos , prect , write_psr , prect -> rp_in_ptr ) ; term_log_write ( file , fd ) ; } #ifdef LOG_COMPRESS_1 file = init_clog_write ( prect , & pos , & fd ) ; if ( file ) { write_psr = & prect -> rp_log [ 0 ] ; write_clog_data ( file , & pos , prect , write_psr , prect -> rp_in_ptr ) ; term_clog_write ( file , fd ) ; } #endif set_fs ( old_fs ) ; argsfreeall ( prect ) ; #ifdef LOG_COMPRESS_1 clogfreeall ( prect ) ; #endif __destroy_record_thread ( prect ) ; KFREE ( awp ) ; return ; }
Handler that is called when the kernel work queue event thread is run
Handler that is called when the kernel work queue event thread is run