]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - ipc/shm.c
fs: Add FOP_HUGE_PAGES
[thirdparty/kernel/stable.git] / ipc / shm.c
index a89f001a8bf07250baaca4455c22263ce5ab4769..3e3071252dac65350588cd3eb04b84f80a38411b 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -662,8 +662,8 @@ static const struct file_operations shm_file_operations = {
 };
 
 /*
- * shm_file_operations_huge is now identical to shm_file_operations,
- * but we keep it distinct for the sake of is_file_shm_hugepages().
+ * shm_file_operations_huge is now identical to shm_file_operations
+ * except for fop_flags
  */
 static const struct file_operations shm_file_operations_huge = {
        .mmap           = shm_mmap,
@@ -672,13 +672,9 @@ static const struct file_operations shm_file_operations_huge = {
        .get_unmapped_area      = shm_get_unmapped_area,
        .llseek         = noop_llseek,
        .fallocate      = shm_fallocate,
+       .fop_flags      = FOP_HUGE_PAGES,
 };
 
-bool is_file_shm_hugepages(struct file *file)
-{
-       return file->f_op == &shm_file_operations_huge;
-}
-
 static const struct vm_operations_struct shm_vm_ops = {
        .open   = shm_open,     /* callback for a new vm-area open */
        .close  = shm_close,    /* callback for when the vm-area is released */