diff options
Diffstat (limited to 'fs/reiserfs/journal.c')
-rw-r--r-- | fs/reiserfs/journal.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index e9a972bd0323..d23d6d7a45a6 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -537,40 +537,6 @@ static inline void insert_journal_hash(struct reiserfs_journal_cnode **table, | |||
537 | journal_hash(table, cn->sb, cn->blocknr) = cn; | 537 | journal_hash(table, cn->sb, cn->blocknr) = cn; |
538 | } | 538 | } |
539 | 539 | ||
540 | /* | ||
541 | * Several mutexes depend on the write lock. | ||
542 | * However sometimes we want to relax the write lock while we hold | ||
543 | * these mutexes, according to the release/reacquire on schedule() | ||
544 | * properties of the Bkl that were used. | ||
545 | * Reiserfs performances and locking were based on this scheme. | ||
546 | * Now that the write lock is a mutex and not the bkl anymore, doing so | ||
547 | * may result in a deadlock: | ||
548 | * | ||
549 | * A acquire write_lock | ||
550 | * A acquire j_commit_mutex | ||
551 | * A release write_lock and wait for something | ||
552 | * B acquire write_lock | ||
553 | * B can't acquire j_commit_mutex and sleep | ||
554 | * A can't acquire write lock anymore | ||
555 | * deadlock | ||
556 | * | ||
557 | * What we do here is avoiding such deadlock by playing the same game | ||
558 | * than the Bkl: if we can't acquire a mutex that depends on the write lock, | ||
559 | * we release the write lock, wait a bit and then retry. | ||
560 | * | ||
561 | * The mutexes concerned by this hack are: | ||
562 | * - The commit mutex of a journal list | ||
563 | * - The flush mutex | ||
564 | * - The journal lock | ||
565 | */ | ||
566 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, | ||
567 | struct super_block *s) | ||
568 | { | ||
569 | reiserfs_write_unlock(s); | ||
570 | mutex_lock(m); | ||
571 | reiserfs_write_lock(s); | ||
572 | } | ||
573 | |||
574 | /* lock the current transaction */ | 540 | /* lock the current transaction */ |
575 | static inline void lock_journal(struct super_block *sb) | 541 | static inline void lock_journal(struct super_block *sb) |
576 | { | 542 | { |