diff options
| author | David S. Miller <davem@davemloft.net> | 2009-09-24 18:13:11 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-09-24 18:13:11 -0400 |
| commit | 8b3f6af86378d0a10ca2f1ded1da124aef13b62c (patch) | |
| tree | de6ca90295730343c495be8d98be8efa322140ef /fs/jbd2 | |
| parent | 139d6065c83071d5f66cd013a274a43699f8e2c1 (diff) | |
| parent | 94e0fb086fc5663c38bbc0fe86d698be8314f82f (diff) | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/cpc-usb/TODO
drivers/staging/cpc-usb/cpc-usb_drv.c
drivers/staging/cpc-usb/cpc.h
drivers/staging/cpc-usb/cpc_int.h
drivers/staging/cpc-usb/cpcusb.h
Diffstat (limited to 'fs/jbd2')
| -rw-r--r-- | fs/jbd2/commit.c | 12 | ||||
| -rw-r--r-- | fs/jbd2/journal.c | 10 | ||||
| -rw-r--r-- | fs/jbd2/transaction.c | 7 |
3 files changed, 19 insertions, 10 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 7b4088b2364d..26d991ddc1e6 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/writeback.h> | 25 | #include <linux/writeback.h> |
| 26 | #include <linux/backing-dev.h> | 26 | #include <linux/backing-dev.h> |
| 27 | #include <linux/bio.h> | 27 | #include <linux/bio.h> |
| 28 | #include <linux/blkdev.h> | ||
| 28 | #include <trace/events/jbd2.h> | 29 | #include <trace/events/jbd2.h> |
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| @@ -133,8 +134,8 @@ static int journal_submit_commit_record(journal_t *journal, | |||
| 133 | bh->b_end_io = journal_end_buffer_io_sync; | 134 | bh->b_end_io = journal_end_buffer_io_sync; |
| 134 | 135 | ||
| 135 | if (journal->j_flags & JBD2_BARRIER && | 136 | if (journal->j_flags & JBD2_BARRIER && |
| 136 | !JBD2_HAS_INCOMPAT_FEATURE(journal, | 137 | !JBD2_HAS_INCOMPAT_FEATURE(journal, |
| 137 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { | 138 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { |
| 138 | set_buffer_ordered(bh); | 139 | set_buffer_ordered(bh); |
| 139 | barrier_done = 1; | 140 | barrier_done = 1; |
| 140 | } | 141 | } |
| @@ -220,7 +221,6 @@ static int journal_submit_inode_data_buffers(struct address_space *mapping) | |||
| 220 | .nr_to_write = mapping->nrpages * 2, | 221 | .nr_to_write = mapping->nrpages * 2, |
| 221 | .range_start = 0, | 222 | .range_start = 0, |
| 222 | .range_end = i_size_read(mapping->host), | 223 | .range_end = i_size_read(mapping->host), |
| 223 | .for_writepages = 1, | ||
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | ret = generic_writepages(mapping, &wbc); | 226 | ret = generic_writepages(mapping, &wbc); |
| @@ -707,11 +707,13 @@ start_journal_io: | |||
| 707 | /* Done it all: now write the commit record asynchronously. */ | 707 | /* Done it all: now write the commit record asynchronously. */ |
| 708 | 708 | ||
| 709 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, | 709 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, |
| 710 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { | 710 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { |
| 711 | err = journal_submit_commit_record(journal, commit_transaction, | 711 | err = journal_submit_commit_record(journal, commit_transaction, |
| 712 | &cbh, crc32_sum); | 712 | &cbh, crc32_sum); |
| 713 | if (err) | 713 | if (err) |
| 714 | __jbd2_journal_abort_hard(journal); | 714 | __jbd2_journal_abort_hard(journal); |
| 715 | if (journal->j_flags & JBD2_BARRIER) | ||
| 716 | blkdev_issue_flush(journal->j_dev, NULL); | ||
| 715 | } | 717 | } |
| 716 | 718 | ||
| 717 | /* | 719 | /* |
| @@ -834,7 +836,7 @@ wait_for_iobuf: | |||
| 834 | jbd_debug(3, "JBD: commit phase 5\n"); | 836 | jbd_debug(3, "JBD: commit phase 5\n"); |
| 835 | 837 | ||
| 836 | if (!JBD2_HAS_INCOMPAT_FEATURE(journal, | 838 | if (!JBD2_HAS_INCOMPAT_FEATURE(journal, |
| 837 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { | 839 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { |
| 838 | err = journal_submit_commit_record(journal, commit_transaction, | 840 | err = journal_submit_commit_record(journal, commit_transaction, |
| 839 | &cbh, crc32_sum); | 841 | &cbh, crc32_sum); |
| 840 | if (err) | 842 | if (err) |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index e378cb383979..53b86e16e5fe 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
| @@ -768,7 +768,7 @@ static void jbd2_seq_history_stop(struct seq_file *seq, void *v) | |||
| 768 | { | 768 | { |
| 769 | } | 769 | } |
| 770 | 770 | ||
| 771 | static struct seq_operations jbd2_seq_history_ops = { | 771 | static const struct seq_operations jbd2_seq_history_ops = { |
| 772 | .start = jbd2_seq_history_start, | 772 | .start = jbd2_seq_history_start, |
| 773 | .next = jbd2_seq_history_next, | 773 | .next = jbd2_seq_history_next, |
| 774 | .stop = jbd2_seq_history_stop, | 774 | .stop = jbd2_seq_history_stop, |
| @@ -872,7 +872,7 @@ static void jbd2_seq_info_stop(struct seq_file *seq, void *v) | |||
| 872 | { | 872 | { |
| 873 | } | 873 | } |
| 874 | 874 | ||
| 875 | static struct seq_operations jbd2_seq_info_ops = { | 875 | static const struct seq_operations jbd2_seq_info_ops = { |
| 876 | .start = jbd2_seq_info_start, | 876 | .start = jbd2_seq_info_start, |
| 877 | .next = jbd2_seq_info_next, | 877 | .next = jbd2_seq_info_next, |
| 878 | .stop = jbd2_seq_info_stop, | 878 | .stop = jbd2_seq_info_stop, |
| @@ -1187,6 +1187,12 @@ static int journal_reset(journal_t *journal) | |||
| 1187 | 1187 | ||
| 1188 | first = be32_to_cpu(sb->s_first); | 1188 | first = be32_to_cpu(sb->s_first); |
| 1189 | last = be32_to_cpu(sb->s_maxlen); | 1189 | last = be32_to_cpu(sb->s_maxlen); |
| 1190 | if (first + JBD2_MIN_JOURNAL_BLOCKS > last + 1) { | ||
| 1191 | printk(KERN_ERR "JBD: Journal too short (blocks %llu-%llu).\n", | ||
| 1192 | first, last); | ||
| 1193 | journal_fail_superblock(journal); | ||
| 1194 | return -EINVAL; | ||
| 1195 | } | ||
| 1190 | 1196 | ||
| 1191 | journal->j_first = first; | 1197 | journal->j_first = first; |
| 1192 | journal->j_last = last; | 1198 | journal->j_last = last; |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 6213ac728f30..a0512700542f 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
| @@ -57,7 +57,7 @@ jbd2_get_transaction(journal_t *journal, transaction_t *transaction) | |||
| 57 | INIT_LIST_HEAD(&transaction->t_private_list); | 57 | INIT_LIST_HEAD(&transaction->t_private_list); |
| 58 | 58 | ||
| 59 | /* Set up the commit timer for the new transaction. */ | 59 | /* Set up the commit timer for the new transaction. */ |
| 60 | journal->j_commit_timer.expires = round_jiffies(transaction->t_expires); | 60 | journal->j_commit_timer.expires = round_jiffies_up(transaction->t_expires); |
| 61 | add_timer(&journal->j_commit_timer); | 61 | add_timer(&journal->j_commit_timer); |
| 62 | 62 | ||
| 63 | J_ASSERT(journal->j_running_transaction == NULL); | 63 | J_ASSERT(journal->j_running_transaction == NULL); |
| @@ -238,6 +238,8 @@ repeat_locked: | |||
| 238 | __jbd2_log_space_left(journal)); | 238 | __jbd2_log_space_left(journal)); |
| 239 | spin_unlock(&transaction->t_handle_lock); | 239 | spin_unlock(&transaction->t_handle_lock); |
| 240 | spin_unlock(&journal->j_state_lock); | 240 | spin_unlock(&journal->j_state_lock); |
| 241 | |||
| 242 | lock_map_acquire(&handle->h_lockdep_map); | ||
| 241 | out: | 243 | out: |
| 242 | if (unlikely(new_transaction)) /* It's usually NULL */ | 244 | if (unlikely(new_transaction)) /* It's usually NULL */ |
| 243 | kfree(new_transaction); | 245 | kfree(new_transaction); |
| @@ -303,8 +305,6 @@ handle_t *jbd2_journal_start(journal_t *journal, int nblocks) | |||
| 303 | handle = ERR_PTR(err); | 305 | handle = ERR_PTR(err); |
| 304 | goto out; | 306 | goto out; |
| 305 | } | 307 | } |
| 306 | |||
| 307 | lock_map_acquire(&handle->h_lockdep_map); | ||
| 308 | out: | 308 | out: |
| 309 | return handle; | 309 | return handle; |
| 310 | } | 310 | } |
| @@ -426,6 +426,7 @@ int jbd2_journal_restart(handle_t *handle, int nblocks) | |||
| 426 | __jbd2_log_start_commit(journal, transaction->t_tid); | 426 | __jbd2_log_start_commit(journal, transaction->t_tid); |
| 427 | spin_unlock(&journal->j_state_lock); | 427 | spin_unlock(&journal->j_state_lock); |
| 428 | 428 | ||
| 429 | lock_map_release(&handle->h_lockdep_map); | ||
| 429 | handle->h_buffer_credits = nblocks; | 430 | handle->h_buffer_credits = nblocks; |
| 430 | ret = start_this_handle(journal, handle); | 431 | ret = start_this_handle(journal, handle); |
| 431 | return ret; | 432 | return ret; |
