overlayfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
PATCH 1/1 overlayfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
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.
Remove .direct_IO and thus the entire address space operations for overlayfs and set FMODE_CAN_ODIRECT in ovl_open instead.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/overlayfs/file.c | 1 + fs/overlayfs/inode.c | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-)
fs/overlayfs/file.c +1 -0
@@ -156,6 +156,7 @@ static int ovl_open(struct inode *inode, struct file *file)/* No longer need these flags, so don't pass them on to underlying fs */ file->f_flags &= ~(O_CREAT |O_EXCL |O_NOCTTY |O_TRUNC ); + file->f_mode |=FMODE_CAN_ODIRECT ;ovl_path_realdata (dentry, &realpath); realfile =ovl_open_realfile (file, &realpath);
fs/overlayfs/inode.c +0 -6
@@ -886,11 +886,6 @@ static const struct inode_operations ovl_special_inode_operations = { .update_time = ovl_update_time, }; -static const struct address_space_operations ovl_aops = { -/* For O_DIRECT dentry_open() checks f_mapping->a_ops->direct_IO */ - .direct_IO = noop_direct_IO, -}; -/* * It is possible to stack overlayfs instance on top of another * overlayfs instance as lower layer. We need to annotate the
@@ -1032,7 +1027,6 @@ static void ovl_fill_inode(struct inode *inode, umode_t mode, dev_t rdev)case S_IFREG : inode->i_op = &ovl_file_inode_operations; inode->i_fop = &ovl_file_operations; - inode->i_mapping->a_ops = &ovl_aops;break ;case S_IFDIR :
Signature · 1 line
2.39.2