fs: crypto: fix issue introduced with lts-integration
Fix the perf issue introduced with wrong conflict resolution of
'commit 81b89766408b ("Merge android-4.9.175 (e2171b6) into msm-4.9")'.
Change-Id: I3b368c5efd8e297bbe6b5c6e3ad12389a0edde7e
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b5e1837..8cb2298 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3624,8 +3624,9 @@
ssize_t ret;
int rw = iov_iter_rw(iter);
-#ifdef CONFIG_FS_ENCRYPTION
- if (IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode))
+#ifdef CONFIG_EXT4_FS_ENCRYPTION
+ if (IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode)
+ && !fscrypt_using_hardware_encryption(inode))
return 0;
#endif