]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
fs/ntfs3: Remove tmp var is_ro in ntfs_fill_super
authorKari Argillander <kari.argillander@gmail.com>
Thu, 9 Sep 2021 18:09:38 +0000 (21:09 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 20 Sep 2021 15:53:10 +0000 (18:53 +0300)
We only use this in two places so we do not really need it. Also
wrapper sb_rdonly() is pretty self explanatory. This will make little
bit easier to read this super long variable list in the beginning of
ntfs_fill_super().

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/super.c

index c18705bf857f6f58c56c619a9702fa02dc7a30b6..93b8a1f4d7483210eeac016f2fb8abaa7e5d8b2c 100644 (file)
@@ -887,7 +887,6 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
        struct ATTR_DEF_ENTRY *t;
        u16 *upcase;
        u16 *shared;
-       bool is_ro;
        struct MFT_REF ref;
 
        ref.high = 0;
@@ -1010,16 +1009,14 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
 
        iput(inode);
 
-       is_ro = sb_rdonly(sb);
-
        if (sbi->flags & NTFS_FLAGS_NEED_REPLAY) {
-               if (!is_ro) {
+               if (!sb_rdonly(sb)) {
                        ntfs_warn(sb,
                                  "failed to replay log file. Can't mount rw!");
                        return -EINVAL;
                }
        } else if (sbi->volume.flags & VOLUME_FLAG_DIRTY) {
-               if (!is_ro && !sbi->options->force) {
+               if (!sb_rdonly(sb) && !sbi->options->force) {
                        ntfs_warn(
                                sb,
                                "volume is dirty and \"force\" flag is not set!");