projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ext4: support direct I/O with fscrypt using blk-crypto
[linux-2.6-microblaze.git]
/
fs
/
ext4
/
file.c
diff --git
a/fs/ext4/file.c
b/fs/ext4/file.c
index
8cc1171
..
8bd66cd
100644
(file)
--- a/
fs/ext4/file.c
+++ b/
fs/ext4/file.c
@@
-36,9
+36,11
@@
#include "acl.h"
#include "truncate.h"
#include "acl.h"
#include "truncate.h"
-static bool ext4_dio_supported(struct
inode *inode
)
+static bool ext4_dio_supported(struct
kiocb *iocb, struct iov_iter *iter
)
{
{
- if (IS_ENABLED(CONFIG_FS_ENCRYPTION) && IS_ENCRYPTED(inode))
+ struct inode *inode = file_inode(iocb->ki_filp);
+
+ if (!fscrypt_dio_supported(iocb, iter))
return false;
if (fsverity_active(inode))
return false;
return false;
if (fsverity_active(inode))
return false;
@@
-61,7
+63,7
@@
static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)
inode_lock_shared(inode);
}
inode_lock_shared(inode);
}
- if (!ext4_dio_supported(i
node
)) {
+ if (!ext4_dio_supported(i
ocb, to
)) {
inode_unlock_shared(inode);
/*
* Fallback to buffered I/O if the operation being performed on
inode_unlock_shared(inode);
/*
* Fallback to buffered I/O if the operation being performed on
@@
-509,7
+511,7
@@
static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
}
/* Fallback to buffered I/O if the inode does not support direct I/O. */
}
/* Fallback to buffered I/O if the inode does not support direct I/O. */
- if (!ext4_dio_supported(i
node
)) {
+ if (!ext4_dio_supported(i
ocb, from
)) {
if (ilock_shared)
inode_unlock_shared(inode);
else
if (ilock_shared)
inode_unlock_shared(inode);
else