@@ -1401,7 +1401,6 @@ const struct address_space_operations ceph_aops = {
.dirty_folio = ceph_dirty_folio,
.invalidate_folio = ceph_invalidate_folio,
.release_folio = ceph_release_folio,
- .direct_IO = noop_direct_IO,
};
static void ceph_block_sigs(sigset_t *oldset)
@@ -368,6 +368,8 @@ int ceph_open(struct inode *inode, struct file *file)
flags = file->f_flags & ~(O_CREAT|O_EXCL);
if (S_ISDIR(inode->i_mode))
flags = O_DIRECTORY; /* mds likes to know */
+ if (S_ISREG(inode->i_mode))
+ file->f_mode |= FMODE_CAN_ODIRECT;
dout("open inode %p ino %llx.%llx file %p flags %d (%d)\n", inode,
ceph_vinop(inode), file, flags, file->f_flags);
Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for ceph so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/ceph/addr.c | 1 - fs/ceph/file.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)