Merge tag 'vfs-6.10.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[linux-block.git] / fs / xfs / xfs_file.c
index 632653e00906fa32e2b5a8c70451522952a8660a..2ce302b4885f53b9e69d21a63f8897e4c7e4b022 100644 (file)
@@ -1230,8 +1230,7 @@ xfs_file_open(
 {
        if (xfs_is_shutdown(XFS_M(inode->i_sb)))
                return -EIO;
-       file->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC |
-                       FMODE_DIO_PARALLEL_WRITE | FMODE_CAN_ODIRECT;
+       file->f_mode |= FMODE_NOWAIT | FMODE_CAN_ODIRECT;
        return generic_file_open(inode, file);
 }
 
@@ -1244,7 +1243,9 @@ xfs_dir_open(
        unsigned int    mode;
        int             error;
 
-       error = xfs_file_open(inode, file);
+       if (xfs_is_shutdown(ip->i_mount))
+               return -EIO;
+       error = generic_file_open(inode, file);
        if (error)
                return error;
 
@@ -1490,7 +1491,6 @@ const struct file_operations xfs_file_operations = {
        .compat_ioctl   = xfs_file_compat_ioctl,
 #endif
        .mmap           = xfs_file_mmap,
-       .mmap_supported_flags = MAP_SYNC,
        .open           = xfs_file_open,
        .release        = xfs_file_release,
        .fsync          = xfs_file_fsync,
@@ -1498,6 +1498,8 @@ const struct file_operations xfs_file_operations = {
        .fallocate      = xfs_file_fallocate,
        .fadvise        = xfs_file_fadvise,
        .remap_file_range = xfs_file_remap_range,
+       .fop_flags      = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
+                         FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE,
 };
 
 const struct file_operations xfs_dir_file_operations = {