Commit f16f1182 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] JBD: remove lock_kernel()

lock_kernel() is no longer needed in JBD.  Remove all the lock_kernel() calls
from fs/jbd/.

Here is where I get to say "ex-parrot".
parent b9c3dc07
......@@ -70,8 +70,6 @@ void journal_commit_transaction(journal_t *journal)
spin_unlock(&journal->j_list_lock);
#endif
lock_kernel();
J_ASSERT(journal->j_running_transaction != NULL);
J_ASSERT(journal->j_committing_transaction == NULL);
......@@ -168,8 +166,6 @@ void journal_commit_transaction(journal_t *journal)
commit_transaction->t_log_start = journal->j_head;
wake_up(&journal->j_wait_transaction_locked);
spin_unlock(&journal->j_state_lock);
unlock_kernel();
jbd_debug (3, "JBD: commit phase 2\n");
......
......@@ -83,11 +83,6 @@ EXPORT_SYMBOL(journal_force_commit);
static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
/*
* List of all journals in the system. Protected by the BKL.
*/
static LIST_HEAD(all_journals);
/*
* Helper function used to manage commit timeouts
*/
......@@ -137,8 +132,6 @@ int kjournald(void *arg)
daemonize("kjournald");
lock_kernel();
/* Set up an interval timer which can be used to trigger a
commit wakeup after the commit interval expires */
init_timer(&timer);
......@@ -153,10 +146,6 @@ int kjournald(void *arg)
printk(KERN_INFO "kjournald starting. Commit interval %ld seconds\n",
journal->j_commit_interval / HZ);
lock_kernel();
list_add(&journal->j_all_journals, &all_journals);
unlock_kernel();
/*
* And now, wait forever for commit wakeup events.
*/
......@@ -234,14 +223,9 @@ int kjournald(void *arg)
}
spin_unlock(&journal->j_state_lock);
lock_kernel();
list_del(&journal->j_all_journals);
unlock_kernel();
journal->j_task = NULL;
wake_up(&journal->j_wait_done_commit);
jbd_debug(1, "Journal thread exiting.\n");
unlock_kernel();
return 0;
}
......@@ -514,7 +498,6 @@ int log_wait_commit(journal_t *journal, tid_t tid)
{
int err = 0;
lock_kernel();
#ifdef CONFIG_JBD_DEBUG
lock_journal(journal);
spin_lock(&journal->j_state_lock);
......@@ -542,8 +525,6 @@ int log_wait_commit(journal_t *journal, tid_t tid)
printk(KERN_EMERG "journal commit I/O error\n");
err = -EIO;
}
unlock_kernel();
return err;
}
......@@ -918,15 +899,14 @@ void journal_update_superblock(journal_t *journal, int wait)
* any future commit will have to be careful to update the
* superblock again to re-record the true start of the log. */
lock_kernel();
spin_lock(&journal->j_state_lock);
if (sb->s_start)
journal->j_flags &= ~JFS_FLUSHED;
else
journal->j_flags |= JFS_FLUSHED;
unlock_kernel();
spin_unlock(&journal->j_state_lock);
}
/*
* Read the superblock for a given journal, performing initial
* validation of the format.
......@@ -1425,7 +1405,6 @@ void __journal_abort_soft (journal_t *journal, int errno)
if (journal->j_flags & JFS_ABORT)
return;
lock_kernel();
if (!journal->j_errno)
journal->j_errno = errno;
......@@ -1433,7 +1412,6 @@ void __journal_abort_soft (journal_t *journal, int errno)
if (errno)
journal_update_superblock(journal, 1);
unlock_kernel();
}
/**
......@@ -1500,17 +1478,17 @@ void journal_abort (journal_t *journal, int errno)
* If the journal has been aborted on this mount time -EROFS will
* be returned.
*/
int journal_errno (journal_t *journal)
int journal_errno(journal_t *journal)
{
int err;
lock_journal(journal);
lock_kernel();
spin_lock(&journal->j_state_lock);
if (journal->j_flags & JFS_ABORT)
err = -EROFS;
else
err = journal->j_errno;
unlock_kernel();
spin_unlock(&journal->j_state_lock);
unlock_journal(journal);
return err;
}
......@@ -1523,17 +1501,17 @@ int journal_errno (journal_t *journal)
* An error must be cleared or Acked to take a FS out of readonly
* mode.
*/
int journal_clear_err (journal_t *journal)
int journal_clear_err(journal_t *journal)
{
int err = 0;
lock_journal(journal);
lock_kernel();
spin_lock(&journal->j_state_lock);
if (journal->j_flags & JFS_ABORT)
err = -EROFS;
else
journal->j_errno = 0;
unlock_kernel();
spin_unlock(&journal->j_state_lock);
unlock_journal(journal);
return err;
}
......@@ -1545,13 +1523,13 @@ int journal_clear_err (journal_t *journal)
* An error must be cleared or Acked to take a FS out of readonly
* mode.
*/
void journal_ack_err (journal_t *journal)
void journal_ack_err(journal_t *journal)
{
lock_journal(journal);
lock_kernel();
spin_lock(&journal->j_state_lock);
if (journal->j_errno)
journal->j_flags |= JFS_ACK_ERR;
unlock_kernel();
spin_unlock(&journal->j_state_lock);
unlock_journal(journal);
}
......
......@@ -290,9 +290,7 @@ handle_t *journal_start(journal_t *journal, int nblocks)
current->journal_info = handle;
lock_kernel();
err = start_this_handle(journal, handle);
unlock_kernel();
if (err < 0) {
jbd_free_handle(handle);
current->journal_info = NULL;
......@@ -407,7 +405,6 @@ int journal_restart(handle_t *handle, int nblocks)
J_ASSERT(transaction->t_updates > 0);
J_ASSERT(journal_current_handle() == handle);
lock_kernel();
spin_lock(&transaction->t_handle_lock);
transaction->t_outstanding_credits -= handle->h_buffer_credits;
transaction->t_updates--;
......@@ -421,7 +418,6 @@ int journal_restart(handle_t *handle, int nblocks)
handle->h_buffer_credits = nblocks;
ret = start_this_handle(journal, handle);
unlock_kernel();
return ret;
}
......@@ -845,10 +841,8 @@ int journal_get_create_access(handle_t *handle, struct buffer_head *bh)
* which hits an assertion error.
*/
JBUFFER_TRACE(jh, "cancelling revoke");
lock_kernel();
journal_cancel_revoke(handle, jh);
journal_put_journal_head(jh);
unlock_kernel();
out:
unlock_journal(journal);
return err;
......@@ -1385,7 +1379,6 @@ int journal_stop(handle_t *handle)
}
current->journal_info = NULL;
lock_kernel();
spin_lock(&transaction->t_handle_lock);
transaction->t_outstanding_credits -= handle->h_buffer_credits;
transaction->t_updates--;
......@@ -1431,7 +1424,6 @@ int journal_stop(handle_t *handle)
spin_unlock(&transaction->t_handle_lock);
}
unlock_kernel();
jbd_free_handle(handle);
return err;
}
......@@ -1448,16 +1440,13 @@ int journal_force_commit(journal_t *journal)
handle_t *handle;
int ret;
lock_kernel();
handle = journal_start(journal, 1);
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
goto out;
} else {
handle->h_sync = 1;
ret = journal_stop(handle);
}
handle->h_sync = 1;
ret = journal_stop(handle);
out:
unlock_kernel();
return ret;
}
......
......@@ -623,7 +623,6 @@ struct transaction_s
* a commit?
* @j_commit_timer: The timer used to wakeup the commit thread
* @j_commit_timer_active: Timer flag
* @j_all_journals: Link all journals together - system-wide
* @j_revoke: The revoke table - maintains the list of revoked blocks in the
* current transaction.
*/
......@@ -804,9 +803,6 @@ struct journal_s
struct timer_list *j_commit_timer;
int j_commit_timer_active; /* [j_state_lock] */
/* Link all journals together - system-wide [lock_kernel] */
struct list_head j_all_journals;
/*
* The revoke table: maintains the list of revoked blocks in the
* current transaction. [j_revoke_lock]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment