diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:45:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:45:01 -0500 |
commit | 275220f0fcff1adf28a717076e00f575edf05fda (patch) | |
tree | d249bccc80c64443dab211639050c4fb14332648 /fs/reiserfs | |
parent | fe3c560b8a22cb28e54fe8950abef38e88d75831 (diff) | |
parent | 81c5e2ae33c4b19e53966b427e33646bf6811830 (diff) |
Merge branch 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits)
block: ensure that completion error gets properly traced
blktrace: add missing probe argument to block_bio_complete
block cfq: don't use atomic_t for cfq_group
block cfq: don't use atomic_t for cfq_queue
block: trace event block fix unassigned field
block: add internal hd part table references
block: fix accounting bug on cross partition merges
kref: add kref_test_and_get
bio-integrity: mark kintegrityd_wq highpri and CPU intensive
block: make kblockd_workqueue smarter
Revert "sd: implement sd_check_events()"
block: Clean up exit_io_context() source code.
Fix compile warnings due to missing removal of a 'ret' variable
fs/block: type signature of major_to_index(int) to major_to_index(unsigned)
block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p)
cfq-iosched: don't check cfqg in choose_service_tree()
fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors
cdrom: export cdrom_check_events()
sd: implement sd_check_events()
sr: implement sr_check_events()
...
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/journal.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index d31bce1a9f90..3eea859e6990 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -2551,8 +2551,6 @@ static int release_journal_dev(struct super_block *super, | |||
2551 | result = 0; | 2551 | result = 0; |
2552 | 2552 | ||
2553 | if (journal->j_dev_bd != NULL) { | 2553 | if (journal->j_dev_bd != NULL) { |
2554 | if (journal->j_dev_bd->bd_dev != super->s_dev) | ||
2555 | bd_release(journal->j_dev_bd); | ||
2556 | result = blkdev_put(journal->j_dev_bd, journal->j_dev_mode); | 2554 | result = blkdev_put(journal->j_dev_bd, journal->j_dev_mode); |
2557 | journal->j_dev_bd = NULL; | 2555 | journal->j_dev_bd = NULL; |
2558 | } | 2556 | } |
@@ -2570,7 +2568,7 @@ static int journal_init_dev(struct super_block *super, | |||
2570 | { | 2568 | { |
2571 | int result; | 2569 | int result; |
2572 | dev_t jdev; | 2570 | dev_t jdev; |
2573 | fmode_t blkdev_mode = FMODE_READ | FMODE_WRITE; | 2571 | fmode_t blkdev_mode = FMODE_READ | FMODE_WRITE | FMODE_EXCL; |
2574 | char b[BDEVNAME_SIZE]; | 2572 | char b[BDEVNAME_SIZE]; |
2575 | 2573 | ||
2576 | result = 0; | 2574 | result = 0; |
@@ -2584,7 +2582,10 @@ static int journal_init_dev(struct super_block *super, | |||
2584 | 2582 | ||
2585 | /* there is no "jdev" option and journal is on separate device */ | 2583 | /* there is no "jdev" option and journal is on separate device */ |
2586 | if ((!jdev_name || !jdev_name[0])) { | 2584 | if ((!jdev_name || !jdev_name[0])) { |
2587 | journal->j_dev_bd = open_by_devnum(jdev, blkdev_mode); | 2585 | if (jdev == super->s_dev) |
2586 | blkdev_mode &= ~FMODE_EXCL; | ||
2587 | journal->j_dev_bd = blkdev_get_by_dev(jdev, blkdev_mode, | ||
2588 | journal); | ||
2588 | journal->j_dev_mode = blkdev_mode; | 2589 | journal->j_dev_mode = blkdev_mode; |
2589 | if (IS_ERR(journal->j_dev_bd)) { | 2590 | if (IS_ERR(journal->j_dev_bd)) { |
2590 | result = PTR_ERR(journal->j_dev_bd); | 2591 | result = PTR_ERR(journal->j_dev_bd); |
@@ -2593,22 +2594,14 @@ static int journal_init_dev(struct super_block *super, | |||
2593 | "cannot init journal device '%s': %i", | 2594 | "cannot init journal device '%s': %i", |
2594 | __bdevname(jdev, b), result); | 2595 | __bdevname(jdev, b), result); |
2595 | return result; | 2596 | return result; |
2596 | } else if (jdev != super->s_dev) { | 2597 | } else if (jdev != super->s_dev) |
2597 | result = bd_claim(journal->j_dev_bd, journal); | ||
2598 | if (result) { | ||
2599 | blkdev_put(journal->j_dev_bd, blkdev_mode); | ||
2600 | return result; | ||
2601 | } | ||
2602 | |||
2603 | set_blocksize(journal->j_dev_bd, super->s_blocksize); | 2598 | set_blocksize(journal->j_dev_bd, super->s_blocksize); |
2604 | } | ||
2605 | 2599 | ||
2606 | return 0; | 2600 | return 0; |
2607 | } | 2601 | } |
2608 | 2602 | ||
2609 | journal->j_dev_mode = blkdev_mode; | 2603 | journal->j_dev_mode = blkdev_mode; |
2610 | journal->j_dev_bd = open_bdev_exclusive(jdev_name, | 2604 | journal->j_dev_bd = blkdev_get_by_path(jdev_name, blkdev_mode, journal); |
2611 | blkdev_mode, journal); | ||
2612 | if (IS_ERR(journal->j_dev_bd)) { | 2605 | if (IS_ERR(journal->j_dev_bd)) { |
2613 | result = PTR_ERR(journal->j_dev_bd); | 2606 | result = PTR_ERR(journal->j_dev_bd); |
2614 | journal->j_dev_bd = NULL; | 2607 | journal->j_dev_bd = NULL; |