shmem.c (fdbdfefbabefcdf3f57560163b43fdc4cf95eb2f) | shmem.c (3b33719c9b741066f7d2bc6036409752f8e0478d) |
---|---|
1/* 2 * Resizable virtual memory filesystem for Linux. 3 * 4 * Copyright (C) 2000 Linus Torvalds. 5 * 2000 Transmeta Corp. 6 * 2000-2001 Christoph Rohland 7 * 2000-2001 SAP AG 8 * 2002 Red Hat Inc. --- 3961 unchanged lines hidden (view full) --- 3970 shmem_huge = huge; 3971 if (shmem_huge < SHMEM_HUGE_DENY) 3972 SHMEM_SB(shm_mnt->mnt_sb)->huge = shmem_huge; 3973 return count; 3974} 3975 3976struct kobj_attribute shmem_enabled_attr = 3977 __ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store); | 1/* 2 * Resizable virtual memory filesystem for Linux. 3 * 4 * Copyright (C) 2000 Linus Torvalds. 5 * 2000 Transmeta Corp. 6 * 2000-2001 Christoph Rohland 7 * 2000-2001 SAP AG 8 * 2002 Red Hat Inc. --- 3961 unchanged lines hidden (view full) --- 3970 shmem_huge = huge; 3971 if (shmem_huge < SHMEM_HUGE_DENY) 3972 SHMEM_SB(shm_mnt->mnt_sb)->huge = shmem_huge; 3973 return count; 3974} 3975 3976struct kobj_attribute shmem_enabled_attr = 3977 __ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store); |
3978#endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */ |
|
3978 | 3979 |
3980#ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE |
|
3979bool shmem_huge_enabled(struct vm_area_struct *vma) 3980{ 3981 struct inode *inode = file_inode(vma->vm_file); 3982 struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); 3983 loff_t i_size; 3984 pgoff_t off; 3985 3986 if (shmem_huge == SHMEM_HUGE_FORCE) --- 14 unchanged lines hidden (view full) --- 4001 case SHMEM_HUGE_ADVISE: 4002 /* TODO: implement fadvise() hints */ 4003 return (vma->vm_flags & VM_HUGEPAGE); 4004 default: 4005 VM_BUG_ON(1); 4006 return false; 4007 } 4008} | 3981bool shmem_huge_enabled(struct vm_area_struct *vma) 3982{ 3983 struct inode *inode = file_inode(vma->vm_file); 3984 struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); 3985 loff_t i_size; 3986 pgoff_t off; 3987 3988 if (shmem_huge == SHMEM_HUGE_FORCE) --- 14 unchanged lines hidden (view full) --- 4003 case SHMEM_HUGE_ADVISE: 4004 /* TODO: implement fadvise() hints */ 4005 return (vma->vm_flags & VM_HUGEPAGE); 4006 default: 4007 VM_BUG_ON(1); 4008 return false; 4009 } 4010} |
4009#endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */ | 4011#endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE */ |
4010 4011#else /* !CONFIG_SHMEM */ 4012 4013/* 4014 * tiny-shmem: simple shmemfs and tmpfs using ramfs code 4015 * 4016 * This is intended for small system where the benefits of the full 4017 * shmem code (swap-backed and resource-limited) are outweighed by --- 219 unchanged lines hidden --- | 4012 4013#else /* !CONFIG_SHMEM */ 4014 4015/* 4016 * tiny-shmem: simple shmemfs and tmpfs using ramfs code 4017 * 4018 * This is intended for small system where the benefits of the full 4019 * shmem code (swap-backed and resource-limited) are outweighed by --- 219 unchanged lines hidden --- |