diff options
Diffstat (limited to 'fs/jbd/journal.c')
| -rw-r--r-- | fs/jbd/journal.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 5e7b43949517..7ae2c4fe506b 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
| @@ -65,7 +65,6 @@ EXPORT_SYMBOL(journal_set_features); | |||
| 65 | EXPORT_SYMBOL(journal_create); | 65 | EXPORT_SYMBOL(journal_create); |
| 66 | EXPORT_SYMBOL(journal_load); | 66 | EXPORT_SYMBOL(journal_load); |
| 67 | EXPORT_SYMBOL(journal_destroy); | 67 | EXPORT_SYMBOL(journal_destroy); |
| 68 | EXPORT_SYMBOL(journal_recover); | ||
| 69 | EXPORT_SYMBOL(journal_update_superblock); | 68 | EXPORT_SYMBOL(journal_update_superblock); |
| 70 | EXPORT_SYMBOL(journal_abort); | 69 | EXPORT_SYMBOL(journal_abort); |
| 71 | EXPORT_SYMBOL(journal_errno); | 70 | EXPORT_SYMBOL(journal_errno); |
| @@ -81,6 +80,7 @@ EXPORT_SYMBOL(journal_try_to_free_buffers); | |||
| 81 | EXPORT_SYMBOL(journal_force_commit); | 80 | EXPORT_SYMBOL(journal_force_commit); |
| 82 | 81 | ||
| 83 | static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *); | 82 | static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *); |
| 83 | static void __journal_abort_soft (journal_t *journal, int errno); | ||
| 84 | 84 | ||
| 85 | /* | 85 | /* |
| 86 | * Helper function used to manage commit timeouts | 86 | * Helper function used to manage commit timeouts |
| @@ -93,16 +93,6 @@ static void commit_timeout(unsigned long __data) | |||
| 93 | wake_up_process(p); | 93 | wake_up_process(p); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | /* Static check for data structure consistency. There's no code | ||
| 97 | * invoked --- we'll just get a linker failure if things aren't right. | ||
| 98 | */ | ||
| 99 | void __journal_internal_check(void) | ||
| 100 | { | ||
| 101 | extern void journal_bad_superblock_size(void); | ||
| 102 | if (sizeof(struct journal_superblock_s) != 1024) | ||
| 103 | journal_bad_superblock_size(); | ||
| 104 | } | ||
| 105 | |||
| 106 | /* | 96 | /* |
| 107 | * kjournald: The main thread function used to manage a logging device | 97 | * kjournald: The main thread function used to manage a logging device |
| 108 | * journal. | 98 | * journal. |
| @@ -119,16 +109,12 @@ void __journal_internal_check(void) | |||
| 119 | * known as checkpointing, and this thread is responsible for that job. | 109 | * known as checkpointing, and this thread is responsible for that job. |
| 120 | */ | 110 | */ |
| 121 | 111 | ||
| 122 | journal_t *current_journal; // AKPM: debug | 112 | static int kjournald(void *arg) |
| 123 | |||
| 124 | int kjournald(void *arg) | ||
| 125 | { | 113 | { |
| 126 | journal_t *journal = (journal_t *) arg; | 114 | journal_t *journal = (journal_t *) arg; |
| 127 | transaction_t *transaction; | 115 | transaction_t *transaction; |
| 128 | struct timer_list timer; | 116 | struct timer_list timer; |
| 129 | 117 | ||
| 130 | current_journal = journal; | ||
| 131 | |||
| 132 | daemonize("kjournald"); | 118 | daemonize("kjournald"); |
| 133 | 119 | ||
| 134 | /* Set up an interval timer which can be used to trigger a | 120 | /* Set up an interval timer which can be used to trigger a |
| @@ -193,6 +179,8 @@ loop: | |||
| 193 | if (transaction && time_after_eq(jiffies, | 179 | if (transaction && time_after_eq(jiffies, |
| 194 | transaction->t_expires)) | 180 | transaction->t_expires)) |
| 195 | should_sleep = 0; | 181 | should_sleep = 0; |
| 182 | if (journal->j_flags & JFS_UNMOUNT) | ||
| 183 | should_sleep = 0; | ||
| 196 | if (should_sleep) { | 184 | if (should_sleep) { |
| 197 | spin_unlock(&journal->j_state_lock); | 185 | spin_unlock(&journal->j_state_lock); |
| 198 | schedule(); | 186 | schedule(); |
| @@ -969,7 +957,7 @@ void journal_update_superblock(journal_t *journal, int wait) | |||
| 969 | if (wait) | 957 | if (wait) |
| 970 | sync_dirty_buffer(bh); | 958 | sync_dirty_buffer(bh); |
| 971 | else | 959 | else |
| 972 | ll_rw_block(WRITE, 1, &bh); | 960 | ll_rw_block(SWRITE, 1, &bh); |
| 973 | 961 | ||
| 974 | out: | 962 | out: |
| 975 | /* If we have just flushed the log (by marking s_start==0), then | 963 | /* If we have just flushed the log (by marking s_start==0), then |
| @@ -1439,7 +1427,7 @@ int journal_wipe(journal_t *journal, int write) | |||
| 1439 | * device this journal is present. | 1427 | * device this journal is present. |
| 1440 | */ | 1428 | */ |
| 1441 | 1429 | ||
| 1442 | const char *journal_dev_name(journal_t *journal, char *buffer) | 1430 | static const char *journal_dev_name(journal_t *journal, char *buffer) |
| 1443 | { | 1431 | { |
| 1444 | struct block_device *bdev; | 1432 | struct block_device *bdev; |
| 1445 | 1433 | ||
| @@ -1485,7 +1473,7 @@ void __journal_abort_hard(journal_t *journal) | |||
| 1485 | 1473 | ||
| 1486 | /* Soft abort: record the abort error status in the journal superblock, | 1474 | /* Soft abort: record the abort error status in the journal superblock, |
| 1487 | * but don't do any other IO. */ | 1475 | * but don't do any other IO. */ |
| 1488 | void __journal_abort_soft (journal_t *journal, int errno) | 1476 | static void __journal_abort_soft (journal_t *journal, int errno) |
| 1489 | { | 1477 | { |
| 1490 | if (journal->j_flags & JFS_ABORT) | 1478 | if (journal->j_flags & JFS_ABORT) |
| 1491 | return; | 1479 | return; |
| @@ -1880,7 +1868,7 @@ EXPORT_SYMBOL(journal_enable_debug); | |||
| 1880 | 1868 | ||
| 1881 | static struct proc_dir_entry *proc_jbd_debug; | 1869 | static struct proc_dir_entry *proc_jbd_debug; |
| 1882 | 1870 | ||
| 1883 | int read_jbd_debug(char *page, char **start, off_t off, | 1871 | static int read_jbd_debug(char *page, char **start, off_t off, |
| 1884 | int count, int *eof, void *data) | 1872 | int count, int *eof, void *data) |
| 1885 | { | 1873 | { |
| 1886 | int ret; | 1874 | int ret; |
| @@ -1890,7 +1878,7 @@ int read_jbd_debug(char *page, char **start, off_t off, | |||
| 1890 | return ret; | 1878 | return ret; |
| 1891 | } | 1879 | } |
| 1892 | 1880 | ||
| 1893 | int write_jbd_debug(struct file *file, const char __user *buffer, | 1881 | static int write_jbd_debug(struct file *file, const char __user *buffer, |
| 1894 | unsigned long count, void *data) | 1882 | unsigned long count, void *data) |
| 1895 | { | 1883 | { |
| 1896 | char buf[32]; | 1884 | char buf[32]; |
| @@ -1979,6 +1967,14 @@ static int __init journal_init(void) | |||
| 1979 | { | 1967 | { |
| 1980 | int ret; | 1968 | int ret; |
| 1981 | 1969 | ||
| 1970 | /* Static check for data structure consistency. There's no code | ||
| 1971 | * invoked --- we'll just get a linker failure if things aren't right. | ||
| 1972 | */ | ||
| 1973 | extern void journal_bad_superblock_size(void); | ||
| 1974 | if (sizeof(struct journal_superblock_s) != 1024) | ||
| 1975 | journal_bad_superblock_size(); | ||
| 1976 | |||
| 1977 | |||
| 1982 | ret = journal_init_caches(); | 1978 | ret = journal_init_caches(); |
| 1983 | if (ret != 0) | 1979 | if (ret != 0) |
| 1984 | journal_destroy_caches(); | 1980 | journal_destroy_caches(); |
