inode.c (96cafb9ccb153f6a82ff2c9bde68916d9d65501e) | inode.c (d7167b149943e38ad610191ecbb0800c78bbced9) |
---|---|
1/* 2 * hugetlbpage-backed filesystem. Based on ramfs. 3 * 4 * Nadia Yvette Chambers, 2002 5 * 6 * Copyright (C) 2002 Linus Torvalds. 7 * License: GPL 8 */ --- 59 unchanged lines hidden (view full) --- 68 Opt_min_size, 69 Opt_mode, 70 Opt_nr_inodes, 71 Opt_pagesize, 72 Opt_size, 73 Opt_uid, 74}; 75 | 1/* 2 * hugetlbpage-backed filesystem. Based on ramfs. 3 * 4 * Nadia Yvette Chambers, 2002 5 * 6 * Copyright (C) 2002 Linus Torvalds. 7 * License: GPL 8 */ --- 59 unchanged lines hidden (view full) --- 68 Opt_min_size, 69 Opt_mode, 70 Opt_nr_inodes, 71 Opt_pagesize, 72 Opt_size, 73 Opt_uid, 74}; 75 |
76static const struct fs_parameter_spec hugetlb_param_specs[] = { | 76static const struct fs_parameter_spec hugetlb_fs_parameters[] = { |
77 fsparam_u32 ("gid", Opt_gid), 78 fsparam_string("min_size", Opt_min_size), 79 fsparam_u32 ("mode", Opt_mode), 80 fsparam_string("nr_inodes", Opt_nr_inodes), 81 fsparam_string("pagesize", Opt_pagesize), 82 fsparam_string("size", Opt_size), 83 fsparam_u32 ("uid", Opt_uid), 84 {} 85}; 86 | 77 fsparam_u32 ("gid", Opt_gid), 78 fsparam_string("min_size", Opt_min_size), 79 fsparam_u32 ("mode", Opt_mode), 80 fsparam_string("nr_inodes", Opt_nr_inodes), 81 fsparam_string("pagesize", Opt_pagesize), 82 fsparam_string("size", Opt_size), 83 fsparam_u32 ("uid", Opt_uid), 84 {} 85}; 86 |
87static const struct fs_parameter_description hugetlb_fs_parameters = { 88 .specs = hugetlb_param_specs, 89}; 90 | |
91#ifdef CONFIG_NUMA 92static inline void hugetlb_set_vma_policy(struct vm_area_struct *vma, 93 struct inode *inode, pgoff_t index) 94{ 95 vma->vm_policy = mpol_shared_policy_lookup(&HUGETLBFS_I(inode)->policy, 96 index); 97} 98 --- 1066 unchanged lines hidden (view full) --- 1165static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *param) 1166{ 1167 struct hugetlbfs_fs_context *ctx = fc->fs_private; 1168 struct fs_parse_result result; 1169 char *rest; 1170 unsigned long ps; 1171 int opt; 1172 | 87#ifdef CONFIG_NUMA 88static inline void hugetlb_set_vma_policy(struct vm_area_struct *vma, 89 struct inode *inode, pgoff_t index) 90{ 91 vma->vm_policy = mpol_shared_policy_lookup(&HUGETLBFS_I(inode)->policy, 92 index); 93} 94 --- 1066 unchanged lines hidden (view full) --- 1161static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *param) 1162{ 1163 struct hugetlbfs_fs_context *ctx = fc->fs_private; 1164 struct fs_parse_result result; 1165 char *rest; 1166 unsigned long ps; 1167 int opt; 1168 |
1173 opt = fs_parse(fc, &hugetlb_fs_parameters, param, &result); | 1169 opt = fs_parse(fc, hugetlb_fs_parameters, param, &result); |
1174 if (opt < 0) 1175 return opt; 1176 1177 switch (opt) { 1178 case Opt_uid: 1179 ctx->uid = make_kuid(current_user_ns(), result.uint_32); 1180 if (!uid_valid(ctx->uid)) 1181 goto bad_val; --- 170 unchanged lines hidden (view full) --- 1352 fc->fs_private = ctx; 1353 fc->ops = &hugetlbfs_fs_context_ops; 1354 return 0; 1355} 1356 1357static struct file_system_type hugetlbfs_fs_type = { 1358 .name = "hugetlbfs", 1359 .init_fs_context = hugetlbfs_init_fs_context, | 1170 if (opt < 0) 1171 return opt; 1172 1173 switch (opt) { 1174 case Opt_uid: 1175 ctx->uid = make_kuid(current_user_ns(), result.uint_32); 1176 if (!uid_valid(ctx->uid)) 1177 goto bad_val; --- 170 unchanged lines hidden (view full) --- 1348 fc->fs_private = ctx; 1349 fc->ops = &hugetlbfs_fs_context_ops; 1350 return 0; 1351} 1352 1353static struct file_system_type hugetlbfs_fs_type = { 1354 .name = "hugetlbfs", 1355 .init_fs_context = hugetlbfs_init_fs_context, |
1360 .parameters = &hugetlb_fs_parameters, | 1356 .parameters = hugetlb_fs_parameters, |
1361 .kill_sb = kill_litter_super, 1362}; 1363 1364static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; 1365 1366static int can_do_hugetlb_shm(void) 1367{ 1368 kgid_t shm_group; --- 154 unchanged lines hidden --- | 1357 .kill_sb = kill_litter_super, 1358}; 1359 1360static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; 1361 1362static int can_do_hugetlb_shm(void) 1363{ 1364 kgid_t shm_group; --- 154 unchanged lines hidden --- |