aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-10-08 13:24:05 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:49:04 -0400
commite5eb8caa83a76191feb9705c1a0a689ca260b91e (patch)
tree15c5fcbcbff03c5fd9bbe15b194455e51d773dc3
parentc2dd0dae185423fb243b13d490c3fcfaa18ff333 (diff)
[PATCH] remember mode of reiserfs journal
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/reiserfs/journal.c6
-rw-r--r--include/linux/reiserfs_fs_sb.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 70b896076676..9643c3bbeb3b 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -2575,7 +2575,7 @@ static int release_journal_dev(struct super_block *super,
2575 if (journal->j_dev_bd != NULL) { 2575 if (journal->j_dev_bd != NULL) {
2576 if (journal->j_dev_bd->bd_dev != super->s_dev) 2576 if (journal->j_dev_bd->bd_dev != super->s_dev)
2577 bd_release(journal->j_dev_bd); 2577 bd_release(journal->j_dev_bd);
2578 result = blkdev_put(journal->j_dev_bd, 0); /* move up */ 2578 result = blkdev_put(journal->j_dev_bd, journal->j_dev_mode);
2579 journal->j_dev_bd = NULL; 2579 journal->j_dev_bd = NULL;
2580 } 2580 }
2581 2581
@@ -2608,6 +2608,7 @@ static int journal_init_dev(struct super_block *super,
2608 /* there is no "jdev" option and journal is on separate device */ 2608 /* there is no "jdev" option and journal is on separate device */
2609 if ((!jdev_name || !jdev_name[0])) { 2609 if ((!jdev_name || !jdev_name[0])) {
2610 journal->j_dev_bd = open_by_devnum(jdev, blkdev_mode); 2610 journal->j_dev_bd = open_by_devnum(jdev, blkdev_mode);
2611 journal->j_dev_mode = blkdev_mode;
2611 if (IS_ERR(journal->j_dev_bd)) { 2612 if (IS_ERR(journal->j_dev_bd)) {
2612 result = PTR_ERR(journal->j_dev_bd); 2613 result = PTR_ERR(journal->j_dev_bd);
2613 journal->j_dev_bd = NULL; 2614 journal->j_dev_bd = NULL;
@@ -2628,8 +2629,9 @@ static int journal_init_dev(struct super_block *super,
2628 return 0; 2629 return 0;
2629 } 2630 }
2630 2631
2632 journal->j_dev_mode = blkdev_mode;
2631 journal->j_dev_bd = open_bdev_exclusive(jdev_name, 2633 journal->j_dev_bd = open_bdev_exclusive(jdev_name,
2632 FMODE_READ|FMODE_WRITE, journal); 2634 blkdev_mode, journal);
2633 if (IS_ERR(journal->j_dev_bd)) { 2635 if (IS_ERR(journal->j_dev_bd)) {
2634 result = PTR_ERR(journal->j_dev_bd); 2636 result = PTR_ERR(journal->j_dev_bd);
2635 journal->j_dev_bd = NULL; 2637 journal->j_dev_bd = NULL;
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 315517e8bfa1..bda6b562a1e0 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -178,6 +178,7 @@ struct reiserfs_journal {
178 struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */ 178 struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */
179 179
180 struct block_device *j_dev_bd; 180 struct block_device *j_dev_bd;
181 fmode_t j_dev_mode;
181 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ 182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */
182 183
183 unsigned long j_state; 184 unsigned long j_state;