READ_ONLY_THP_FOR_FS is no longer present, delete related code.

Signed-off-by: Zi Yan <[email protected]>
---
 fs/open.c | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 91f1139591ab..cef382d9d8b8 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -970,33 +970,6 @@ static int do_dentry_open(struct file *f,
        if ((f->f_flags & O_DIRECT) && !(f->f_mode & FMODE_CAN_ODIRECT))
                return -EINVAL;
 
-       /*
-        * XXX: Huge page cache doesn't support writing yet. Drop all page
-        * cache for this file before processing writes.
-        */
-       if (f->f_mode & FMODE_WRITE) {
-               /*
-                * Depends on full fence from get_write_access() to synchronize
-                * against collapse_file() regarding i_writecount and nr_thps
-                * updates. Ensures subsequent insertion of THPs into the page
-                * cache will fail.
-                */
-               if (filemap_nr_thps(inode->i_mapping)) {
-                       struct address_space *mapping = inode->i_mapping;
-
-                       filemap_invalidate_lock(inode->i_mapping);
-                       /*
-                        * unmap_mapping_range just need to be called once
-                        * here, because the private pages is not need to be
-                        * unmapped mapping (e.g. data segment of dynamic
-                        * shared libraries here).
-                        */
-                       unmap_mapping_range(mapping, 0, 0, 0);
-                       truncate_inode_pages(mapping, 0);
-                       filemap_invalidate_unlock(inode->i_mapping);
-               }
-       }
-
        return 0;
 
 cleanup_all:
-- 
2.43.0


Reply via email to