Merge tag 'upstream-4.4-rc1' of git://git.infradead.org/linux-ubifs
[firefly-linux-kernel-4.4.55.git] / fs / ubifs / super.c
index 9547a27868ad49e11151c324c8f60a7db2bc92f6..8ee3133dd8e49af9f413025683236cf464a62f12 100644 (file)
@@ -128,7 +128,10 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)
        if (err)
                goto out_ino;
 
-       inode->i_flags |= (S_NOCMTIME | S_NOATIME);
+       inode->i_flags |= S_NOCMTIME;
+#ifndef CONFIG_UBIFS_ATIME_SUPPORT
+       inode->i_flags |= S_NOATIME;
+#endif
        set_nlink(inode, le32_to_cpu(ino->nlink));
        i_uid_write(inode, le32_to_cpu(ino->uid));
        i_gid_write(inode, le32_to_cpu(ino->gid));
@@ -2139,7 +2142,12 @@ static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags,
                if (err)
                        goto out_deact;
                /* We do not support atime */
-               sb->s_flags |= MS_ACTIVE | MS_NOATIME;
+               sb->s_flags |= MS_ACTIVE;
+#ifndef CONFIG_UBIFS_ATIME_SUPPORT
+               sb->s_flags |= MS_NOATIME;
+#else
+               ubifs_msg(c, "full atime support is enabled.");
+#endif
        }
 
        /* 'fill_super()' opens ubi again so we must close it here */