diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:11:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:11:13 -0500 |
commit | 29bd17af7d8ffc16bb5eb286947495c166ea826e (patch) | |
tree | 5c20c44b51bdb3573949d1dc23bc3d3927d759fa /fs/ocfs2/journal.c | |
parent | 2ba14a017a4ba8d2266316f481d4ad7400073d18 (diff) | |
parent | 2fe5c1d7eb88830b09c863a4b5b3279dc120f3af (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: (31 commits)
ocfs2: clean up bh null checks
ocfs2: document access rules for blocked_lock_list
configfs: file.c fix possible recursive locking
configfs: dir.c fix possible recursive locking
configfs: Remove EXPERIMENTAL
ocfs2: bump version number
ocfs2/dlm: Clear joining_node on hearbeat node down
ocfs2: convert byte order of constant instead of variable
ocfs2: Update default cluster timeouts
ocfs2: printf fixes
ocfs2: Use generic_file_llseek
ocfs2: Safer read_inline_data()
ocfs2: Silence false lockdep warnings
[PATCH 2/2] ocfs2: cluster aware flock()
[PATCH 1/2] ocfs2: add flock lock type
ocfs2: Local alloc window size changeable via mount option
ocfs2: Support commit= mount option
ocfs2: Add missing permission checks
[PATCH 2/2] ocfs2: Implement group add for online resize
[PATCH 1/2] ocfs2: Add group extend for online resize
...
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r-- | fs/ocfs2/journal.c | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 8d81f6c1b877..f31c7e8c19c3 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include "localalloc.h" | 44 | #include "localalloc.h" |
45 | #include "slot_map.h" | 45 | #include "slot_map.h" |
46 | #include "super.h" | 46 | #include "super.h" |
47 | #include "vote.h" | ||
48 | #include "sysfile.h" | 47 | #include "sysfile.h" |
49 | 48 | ||
50 | #include "buffer_head_io.h" | 49 | #include "buffer_head_io.h" |
@@ -103,7 +102,7 @@ static int ocfs2_commit_cache(struct ocfs2_super *osb) | |||
103 | mlog(0, "commit_thread: flushed transaction %lu (%u handles)\n", | 102 | mlog(0, "commit_thread: flushed transaction %lu (%u handles)\n", |
104 | journal->j_trans_id, flushed); | 103 | journal->j_trans_id, flushed); |
105 | 104 | ||
106 | ocfs2_kick_vote_thread(osb); | 105 | ocfs2_wake_downconvert_thread(osb); |
107 | wake_up(&journal->j_checkpointed); | 106 | wake_up(&journal->j_checkpointed); |
108 | finally: | 107 | finally: |
109 | mlog_exit(status); | 108 | mlog_exit(status); |
@@ -314,14 +313,18 @@ int ocfs2_journal_dirty_data(handle_t *handle, | |||
314 | return err; | 313 | return err; |
315 | } | 314 | } |
316 | 315 | ||
317 | #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * 5) | 316 | #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * JBD_DEFAULT_MAX_COMMIT_AGE) |
318 | 317 | ||
319 | void ocfs2_set_journal_params(struct ocfs2_super *osb) | 318 | void ocfs2_set_journal_params(struct ocfs2_super *osb) |
320 | { | 319 | { |
321 | journal_t *journal = osb->journal->j_journal; | 320 | journal_t *journal = osb->journal->j_journal; |
321 | unsigned long commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL; | ||
322 | |||
323 | if (osb->osb_commit_interval) | ||
324 | commit_interval = osb->osb_commit_interval; | ||
322 | 325 | ||
323 | spin_lock(&journal->j_state_lock); | 326 | spin_lock(&journal->j_state_lock); |
324 | journal->j_commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL; | 327 | journal->j_commit_interval = commit_interval; |
325 | if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER) | 328 | if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER) |
326 | journal->j_flags |= JFS_BARRIER; | 329 | journal->j_flags |= JFS_BARRIER; |
327 | else | 330 | else |
@@ -337,7 +340,7 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) | |||
337 | struct ocfs2_dinode *di = NULL; | 340 | struct ocfs2_dinode *di = NULL; |
338 | struct buffer_head *bh = NULL; | 341 | struct buffer_head *bh = NULL; |
339 | struct ocfs2_super *osb; | 342 | struct ocfs2_super *osb; |
340 | int meta_lock = 0; | 343 | int inode_lock = 0; |
341 | 344 | ||
342 | mlog_entry_void(); | 345 | mlog_entry_void(); |
343 | 346 | ||
@@ -367,14 +370,14 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) | |||
367 | /* Skip recovery waits here - journal inode metadata never | 370 | /* Skip recovery waits here - journal inode metadata never |
368 | * changes in a live cluster so it can be considered an | 371 | * changes in a live cluster so it can be considered an |
369 | * exception to the rule. */ | 372 | * exception to the rule. */ |
370 | status = ocfs2_meta_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY); | 373 | status = ocfs2_inode_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY); |
371 | if (status < 0) { | 374 | if (status < 0) { |
372 | if (status != -ERESTARTSYS) | 375 | if (status != -ERESTARTSYS) |
373 | mlog(ML_ERROR, "Could not get lock on journal!\n"); | 376 | mlog(ML_ERROR, "Could not get lock on journal!\n"); |
374 | goto done; | 377 | goto done; |
375 | } | 378 | } |
376 | 379 | ||
377 | meta_lock = 1; | 380 | inode_lock = 1; |
378 | di = (struct ocfs2_dinode *)bh->b_data; | 381 | di = (struct ocfs2_dinode *)bh->b_data; |
379 | 382 | ||
380 | if (inode->i_size < OCFS2_MIN_JOURNAL_SIZE) { | 383 | if (inode->i_size < OCFS2_MIN_JOURNAL_SIZE) { |
@@ -414,8 +417,8 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) | |||
414 | status = 0; | 417 | status = 0; |
415 | done: | 418 | done: |
416 | if (status < 0) { | 419 | if (status < 0) { |
417 | if (meta_lock) | 420 | if (inode_lock) |
418 | ocfs2_meta_unlock(inode, 1); | 421 | ocfs2_inode_unlock(inode, 1); |
419 | if (bh != NULL) | 422 | if (bh != NULL) |
420 | brelse(bh); | 423 | brelse(bh); |
421 | if (inode) { | 424 | if (inode) { |
@@ -544,7 +547,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) | |||
544 | OCFS2_I(inode)->ip_open_count--; | 547 | OCFS2_I(inode)->ip_open_count--; |
545 | 548 | ||
546 | /* unlock our journal */ | 549 | /* unlock our journal */ |
547 | ocfs2_meta_unlock(inode, 1); | 550 | ocfs2_inode_unlock(inode, 1); |
548 | 551 | ||
549 | brelse(journal->j_bh); | 552 | brelse(journal->j_bh); |
550 | journal->j_bh = NULL; | 553 | journal->j_bh = NULL; |
@@ -883,8 +886,8 @@ restart: | |||
883 | ocfs2_super_unlock(osb, 1); | 886 | ocfs2_super_unlock(osb, 1); |
884 | 887 | ||
885 | /* We always run recovery on our own orphan dir - the dead | 888 | /* We always run recovery on our own orphan dir - the dead |
886 | * node(s) may have voted "no" on an inode delete earlier. A | 889 | * node(s) may have disallowd a previos inode delete. Re-processing |
887 | * revote is therefore required. */ | 890 | * is therefore required. */ |
888 | ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, | 891 | ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, |
889 | NULL); | 892 | NULL); |
890 | 893 | ||
@@ -973,9 +976,9 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, | |||
973 | } | 976 | } |
974 | SET_INODE_JOURNAL(inode); | 977 | SET_INODE_JOURNAL(inode); |
975 | 978 | ||
976 | status = ocfs2_meta_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY); | 979 | status = ocfs2_inode_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY); |
977 | if (status < 0) { | 980 | if (status < 0) { |
978 | mlog(0, "status returned from ocfs2_meta_lock=%d\n", status); | 981 | mlog(0, "status returned from ocfs2_inode_lock=%d\n", status); |
979 | if (status != -ERESTARTSYS) | 982 | if (status != -ERESTARTSYS) |
980 | mlog(ML_ERROR, "Could not lock journal!\n"); | 983 | mlog(ML_ERROR, "Could not lock journal!\n"); |
981 | goto done; | 984 | goto done; |
@@ -1047,7 +1050,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, | |||
1047 | done: | 1050 | done: |
1048 | /* drop the lock on this nodes journal */ | 1051 | /* drop the lock on this nodes journal */ |
1049 | if (got_lock) | 1052 | if (got_lock) |
1050 | ocfs2_meta_unlock(inode, 1); | 1053 | ocfs2_inode_unlock(inode, 1); |
1051 | 1054 | ||
1052 | if (inode) | 1055 | if (inode) |
1053 | iput(inode); | 1056 | iput(inode); |
@@ -1162,14 +1165,14 @@ static int ocfs2_trylock_journal(struct ocfs2_super *osb, | |||
1162 | SET_INODE_JOURNAL(inode); | 1165 | SET_INODE_JOURNAL(inode); |
1163 | 1166 | ||
1164 | flags = OCFS2_META_LOCK_RECOVERY | OCFS2_META_LOCK_NOQUEUE; | 1167 | flags = OCFS2_META_LOCK_RECOVERY | OCFS2_META_LOCK_NOQUEUE; |
1165 | status = ocfs2_meta_lock_full(inode, NULL, 1, flags); | 1168 | status = ocfs2_inode_lock_full(inode, NULL, 1, flags); |
1166 | if (status < 0) { | 1169 | if (status < 0) { |
1167 | if (status != -EAGAIN) | 1170 | if (status != -EAGAIN) |
1168 | mlog_errno(status); | 1171 | mlog_errno(status); |
1169 | goto bail; | 1172 | goto bail; |
1170 | } | 1173 | } |
1171 | 1174 | ||
1172 | ocfs2_meta_unlock(inode, 1); | 1175 | ocfs2_inode_unlock(inode, 1); |
1173 | bail: | 1176 | bail: |
1174 | if (inode) | 1177 | if (inode) |
1175 | iput(inode); | 1178 | iput(inode); |
@@ -1241,7 +1244,7 @@ static int ocfs2_orphan_filldir(void *priv, const char *name, int name_len, | |||
1241 | 1244 | ||
1242 | /* Skip bad inodes so that recovery can continue */ | 1245 | /* Skip bad inodes so that recovery can continue */ |
1243 | iter = ocfs2_iget(p->osb, ino, | 1246 | iter = ocfs2_iget(p->osb, ino, |
1244 | OCFS2_FI_FLAG_ORPHAN_RECOVERY); | 1247 | OCFS2_FI_FLAG_ORPHAN_RECOVERY, 0); |
1245 | if (IS_ERR(iter)) | 1248 | if (IS_ERR(iter)) |
1246 | return 0; | 1249 | return 0; |
1247 | 1250 | ||
@@ -1277,7 +1280,7 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb, | |||
1277 | } | 1280 | } |
1278 | 1281 | ||
1279 | mutex_lock(&orphan_dir_inode->i_mutex); | 1282 | mutex_lock(&orphan_dir_inode->i_mutex); |
1280 | status = ocfs2_meta_lock(orphan_dir_inode, NULL, 0); | 1283 | status = ocfs2_inode_lock(orphan_dir_inode, NULL, 0); |
1281 | if (status < 0) { | 1284 | if (status < 0) { |
1282 | mlog_errno(status); | 1285 | mlog_errno(status); |
1283 | goto out; | 1286 | goto out; |
@@ -1293,7 +1296,7 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb, | |||
1293 | *head = priv.head; | 1296 | *head = priv.head; |
1294 | 1297 | ||
1295 | out_cluster: | 1298 | out_cluster: |
1296 | ocfs2_meta_unlock(orphan_dir_inode, 0); | 1299 | ocfs2_inode_unlock(orphan_dir_inode, 0); |
1297 | out: | 1300 | out: |
1298 | mutex_unlock(&orphan_dir_inode->i_mutex); | 1301 | mutex_unlock(&orphan_dir_inode->i_mutex); |
1299 | iput(orphan_dir_inode); | 1302 | iput(orphan_dir_inode); |
@@ -1380,10 +1383,10 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, | |||
1380 | iter = oi->ip_next_orphan; | 1383 | iter = oi->ip_next_orphan; |
1381 | 1384 | ||
1382 | spin_lock(&oi->ip_lock); | 1385 | spin_lock(&oi->ip_lock); |
1383 | /* Delete voting may have set these on the assumption | 1386 | /* The remote delete code may have set these on the |
1384 | * that the other node would wipe them successfully. | 1387 | * assumption that the other node would wipe them |
1385 | * If they are still in the node's orphan dir, we need | 1388 | * successfully. If they are still in the node's |
1386 | * to reset that state. */ | 1389 | * orphan dir, we need to reset that state. */ |
1387 | oi->ip_flags &= ~(OCFS2_INODE_DELETED|OCFS2_INODE_SKIP_DELETE); | 1390 | oi->ip_flags &= ~(OCFS2_INODE_DELETED|OCFS2_INODE_SKIP_DELETE); |
1388 | 1391 | ||
1389 | /* Set the proper information to get us going into | 1392 | /* Set the proper information to get us going into |