/*
* sb can be NULL here. In this case sbi->flags should be 0 too.
*/
- if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR))
+ if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR) ||
+ unlikely(ntfs3_forced_shutdown(sb)))
return;
blocksize = sb->s_blocksize;
/* sbi->flags */
#define NTFS_FLAGS_NODISCARD 0x00000001
/* ntfs in shutdown state. */
-#define NTFS_FLAGS_SHUTDOWN 0x00000002
+#define NTFS_FLAGS_SHUTDOWN_BIT 0x00000002 /* == 4*/
/* Set when LogFile is replaying. */
#define NTFS_FLAGS_LOG_REPLAYING 0x00000008
/* Set when we changed first MFT's which copy must be updated in $MftMirr. */
return sb->s_fs_info;
}
-static inline bool ntfs3_forced_shutdown(struct super_block *sb)
+static inline int ntfs3_forced_shutdown(struct super_block *sb)
{
- return test_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags);
+ return test_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags);
}
/*
*/
static void ntfs_shutdown(struct super_block *sb)
{
- set_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags);
+ set_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags);
}
/*