set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); 
schedule_timeout_uninterruptible(1); 
int journal_stop(handle_t *handle){	transaction_t *transaction = handle->h_transaction;	journal_t *journal = transaction->t_journal;	int old_handle_count, err;	J_ASSERT(transaction->t_updates > 0);	J_ASSERT(journal_current_handle() == handle);	if (is_handle_aborted(handle))		err = -EIO;	else		err = 0;	if (--handle->h_ref > 0) {		jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1,			  handle->h_ref);		return err;	}	jbd_debug(4, "Handle %p going down\n", handle);	/*	 * Implement synchronous transaction batching.  If the handle	 * was synchronous, don't force a commit immediately.  Let's	 * yield and let another thread piggyback onto this transaction.	 * Keep doing that while new threads continue to arrive.	 * It doesn't cost much - we're about to run a commit and sleep	 * on IO anyway.  Speeds up many-threaded, many-dir operations	 * by 30x or more...	 */	if (handle->h_sync) {		do {			old_handle_count = transaction->t_handle_count;			set_current_state(TASK_UNINTERRUPTIBLE);			schedule_timeout(1);		} while (old_handle_count != transaction->t_handle_count);	}	current->journal_info = NULL;	spin_lock(&journal->j_state_lock);	spin_lock(&transaction->t_handle_lock);	transaction->t_outstanding_credits -= handle->h_buffer_credits;	transaction->t_updates--;	if (!transaction->t_updates) {		wake_up(&journal->j_wait_updates);		if (journal->j_barrier_count)			wake_up(&journal->j_wait_transaction_locked);	}	/*	 * If the handle is marked SYNC, we need to set another commit	 * going!  We also want to force a commit if the current	 * transaction is occupying too much of the log, or if the	 * transaction is too old now.	 */	if (handle->h_sync ||			transaction->t_outstanding_credits >				journal->j_max_transaction_buffers ||	    		time_after_eq(jiffies, transaction->t_expires)) {		/* Do this even for aborted journals: an abort still		 * completes the commit thread, it just doesn't write		 * anything to disk. */		tid_t tid = transaction->t_tid;		spin_unlock(&transaction->t_handle_lock);		jbd_debug(2, "transaction too old, requesting commit for "					"handle %p\n", handle);		/* This is non-blocking */		__log_start_commit(journal, transaction->t_tid);		spin_unlock(&journal->j_state_lock);		/*		 * Special case: JFS_SYNC synchronous updates require us		 * to wait for the commit to complete.  		 */		if (handle->h_sync && !(current->flags & PF_MEMALLOC))			err = log_wait_commit(journal, tid);	} else {		spin_unlock(&transaction->t_handle_lock);		spin_unlock(&journal->j_state_lock);	}	jbd_free_handle(handle);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/041e0e3b1970c508dc9a95b7dd9dc86271a7d7ac/transaction.c/clean/fs/jbd/transaction.c