@@ -410,7 +410,7 @@ static bool shmem_confirm_swap(struct address_space *mapping,
410410#define SHMEM_HUGE_DENY (-1)
411411#define SHMEM_HUGE_FORCE (-2)
412412
413- #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
413+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE
414414/* ifdef here to avoid bloating shmem.o when not necessary */
415415
416416static int shmem_huge __read_mostly ;
@@ -580,7 +580,7 @@ static long shmem_unused_huge_count(struct super_block *sb,
580580 struct shmem_sb_info * sbinfo = SHMEM_SB (sb );
581581 return READ_ONCE (sbinfo -> shrinklist_len );
582582}
583- #else /* !CONFIG_TRANSPARENT_HUGE_PAGECACHE */
583+ #else /* !CONFIG_TRANSPARENT_HUGEPAGE */
584584
585585#define shmem_huge SHMEM_HUGE_DENY
586586
@@ -589,11 +589,11 @@ static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,
589589{
590590 return 0 ;
591591}
592- #endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE */
592+ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
593593
594594static inline bool is_huge_enabled (struct shmem_sb_info * sbinfo )
595595{
596- if (IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE ) &&
596+ if (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ) &&
597597 (shmem_huge == SHMEM_HUGE_FORCE || sbinfo -> huge ) &&
598598 shmem_huge != SHMEM_HUGE_DENY )
599599 return true;
@@ -1059,7 +1059,7 @@ static int shmem_setattr(struct dentry *dentry, struct iattr *attr)
10591059 * Part of the huge page can be beyond i_size: subject
10601060 * to shrink under memory pressure.
10611061 */
1062- if (IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE )) {
1062+ if (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE )) {
10631063 spin_lock (& sbinfo -> shrinklist_lock );
10641064 /*
10651065 * _careful to defend against unlocked access to
@@ -1510,7 +1510,7 @@ static struct page *shmem_alloc_and_acct_page(gfp_t gfp,
15101510 int nr ;
15111511 int err = - ENOSPC ;
15121512
1513- if (!IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE ))
1513+ if (!IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ))
15141514 huge = false;
15151515 nr = huge ? HPAGE_PMD_NR : 1 ;
15161516
@@ -2093,7 +2093,7 @@ unsigned long shmem_get_unmapped_area(struct file *file,
20932093 get_area = current -> mm -> get_unmapped_area ;
20942094 addr = get_area (file , uaddr , len , pgoff , flags );
20952095
2096- if (!IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE ))
2096+ if (!IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ))
20972097 return addr ;
20982098 if (IS_ERR_VALUE (addr ))
20992099 return addr ;
@@ -2232,7 +2232,7 @@ static int shmem_mmap(struct file *file, struct vm_area_struct *vma)
22322232
22332233 file_accessed (file );
22342234 vma -> vm_ops = & shmem_vm_ops ;
2235- if (IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE ) &&
2235+ if (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ) &&
22362236 ((vma -> vm_start + ~HPAGE_PMD_MASK ) & HPAGE_PMD_MASK ) <
22372237 (vma -> vm_end & HPAGE_PMD_MASK )) {
22382238 khugepaged_enter (vma , vma -> vm_flags );
@@ -3459,7 +3459,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
34593459 case Opt_huge :
34603460 ctx -> huge = result .uint_32 ;
34613461 if (ctx -> huge != SHMEM_HUGE_NEVER &&
3462- !(IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE ) &&
3462+ !(IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ) &&
34633463 has_transparent_hugepage ()))
34643464 goto unsupported_parameter ;
34653465 ctx -> seen |= SHMEM_SEEN_HUGE ;
@@ -3605,7 +3605,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
36053605 if (!gid_eq (sbinfo -> gid , GLOBAL_ROOT_GID ))
36063606 seq_printf (seq , ",gid=%u" ,
36073607 from_kgid_munged (& init_user_ns , sbinfo -> gid ));
3608- #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
3608+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE
36093609 /* Rightly or wrongly, show huge mount option unmasked by shmem_huge */
36103610 if (sbinfo -> huge )
36113611 seq_printf (seq , ",huge=%s" , shmem_format_huge (sbinfo -> huge ));
@@ -3850,7 +3850,7 @@ static const struct super_operations shmem_ops = {
38503850 .evict_inode = shmem_evict_inode ,
38513851 .drop_inode = generic_delete_inode ,
38523852 .put_super = shmem_put_super ,
3853- #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
3853+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE
38543854 .nr_cached_objects = shmem_unused_huge_count ,
38553855 .free_cached_objects = shmem_unused_huge_scan ,
38563856#endif
@@ -3912,7 +3912,7 @@ int __init shmem_init(void)
39123912 goto out1 ;
39133913 }
39143914
3915- #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
3915+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE
39163916 if (has_transparent_hugepage () && shmem_huge > SHMEM_HUGE_DENY )
39173917 SHMEM_SB (shm_mnt -> mnt_sb )-> huge = shmem_huge ;
39183918 else
@@ -3928,7 +3928,7 @@ int __init shmem_init(void)
39283928 return error ;
39293929}
39303930
3931- #if defined(CONFIG_TRANSPARENT_HUGE_PAGECACHE ) && defined(CONFIG_SYSFS )
3931+ #if defined(CONFIG_TRANSPARENT_HUGEPAGE ) && defined(CONFIG_SYSFS )
39323932static ssize_t shmem_enabled_show (struct kobject * kobj ,
39333933 struct kobj_attribute * attr , char * buf )
39343934{
@@ -3980,9 +3980,9 @@ static ssize_t shmem_enabled_store(struct kobject *kobj,
39803980
39813981struct kobj_attribute shmem_enabled_attr =
39823982 __ATTR (shmem_enabled , 0644 , shmem_enabled_show , shmem_enabled_store );
3983- #endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */
3983+ #endif /* CONFIG_TRANSPARENT_HUGEPAGE && CONFIG_SYSFS */
39843984
3985- #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
3985+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE
39863986bool shmem_huge_enabled (struct vm_area_struct * vma )
39873987{
39883988 struct inode * inode = file_inode (vma -> vm_file );
@@ -4017,7 +4017,7 @@ bool shmem_huge_enabled(struct vm_area_struct *vma)
40174017 return false;
40184018 }
40194019}
4020- #endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE */
4020+ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
40214021
40224022#else /* !CONFIG_SHMEM */
40234023
@@ -4186,7 +4186,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
41864186 vma -> vm_file = file ;
41874187 vma -> vm_ops = & shmem_vm_ops ;
41884188
4189- if (IS_ENABLED (CONFIG_TRANSPARENT_HUGE_PAGECACHE ) &&
4189+ if (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ) &&
41904190 ((vma -> vm_start + ~HPAGE_PMD_MASK ) & HPAGE_PMD_MASK ) <
41914191 (vma -> vm_end & HPAGE_PMD_MASK )) {
41924192 khugepaged_enter (vma , vma -> vm_flags );
0 commit comments