]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] remember mode of reiserfs journal
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Oct 2007 17:24:05 +0000 (13:24 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Oct 2008 11:49:04 +0000 (07:49 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/reiserfs/journal.c
include/linux/reiserfs_fs_sb.h

index 70b89607667682565b90a4e750ca9016b6ebe907..9643c3bbeb3b611d3817bc17698d76c5d54e89b5 100644 (file)
@@ -2575,7 +2575,7 @@ static int release_journal_dev(struct super_block *super,
        if (journal->j_dev_bd != NULL) {
                if (journal->j_dev_bd->bd_dev != super->s_dev)
                        bd_release(journal->j_dev_bd);
-               result = blkdev_put(journal->j_dev_bd, 0); /* move up */
+               result = blkdev_put(journal->j_dev_bd, journal->j_dev_mode);
                journal->j_dev_bd = NULL;
        }
 
@@ -2608,6 +2608,7 @@ static int journal_init_dev(struct super_block *super,
        /* there is no "jdev" option and journal is on separate device */
        if ((!jdev_name || !jdev_name[0])) {
                journal->j_dev_bd = open_by_devnum(jdev, blkdev_mode);
+               journal->j_dev_mode = blkdev_mode;
                if (IS_ERR(journal->j_dev_bd)) {
                        result = PTR_ERR(journal->j_dev_bd);
                        journal->j_dev_bd = NULL;
@@ -2628,8 +2629,9 @@ static int journal_init_dev(struct super_block *super,
                return 0;
        }
 
+       journal->j_dev_mode = blkdev_mode;
        journal->j_dev_bd = open_bdev_exclusive(jdev_name,
-                                               FMODE_READ|FMODE_WRITE, journal);
+                                               blkdev_mode, journal);
        if (IS_ERR(journal->j_dev_bd)) {
                result = PTR_ERR(journal->j_dev_bd);
                journal->j_dev_bd = NULL;
index 315517e8bfa1cdd6704f4a9620ca8a3d8c7f5d2a..bda6b562a1e05dc5ee936ca52dfc8bfb14ae86a9 100644 (file)
@@ -178,6 +178,7 @@ struct reiserfs_journal {
        struct reiserfs_journal_cnode *j_first; /*  oldest journal block.  start here for traverse */
 
        struct block_device *j_dev_bd;
+       fmode_t j_dev_mode;
        int j_1st_reserved_block;       /* first block on s_dev of reserved area journal */
 
        unsigned long j_state;