sbinfo 926 fs/hugetlbfs/inode.c struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(root->d_sb); sbinfo 927 fs/hugetlbfs/inode.c struct hugepage_subpool *spool = sbinfo->spool; sbinfo 928 fs/hugetlbfs/inode.c unsigned long hpage_size = huge_page_size(sbinfo->hstate); sbinfo 929 fs/hugetlbfs/inode.c unsigned hpage_shift = huge_page_shift(sbinfo->hstate); sbinfo 932 fs/hugetlbfs/inode.c if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID)) sbinfo 934 fs/hugetlbfs/inode.c from_kuid_munged(&init_user_ns, sbinfo->uid)); sbinfo 935 fs/hugetlbfs/inode.c if (!gid_eq(sbinfo->gid, GLOBAL_ROOT_GID)) sbinfo 937 fs/hugetlbfs/inode.c from_kgid_munged(&init_user_ns, sbinfo->gid)); sbinfo 938 fs/hugetlbfs/inode.c if (sbinfo->mode != 0755) sbinfo 939 fs/hugetlbfs/inode.c seq_printf(m, ",mode=%o", sbinfo->mode); sbinfo 940 fs/hugetlbfs/inode.c if (sbinfo->max_inodes != -1) sbinfo 941 fs/hugetlbfs/inode.c seq_printf(m, ",nr_inodes=%lu", sbinfo->max_inodes); sbinfo 963 fs/hugetlbfs/inode.c struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); sbinfo 968 fs/hugetlbfs/inode.c if (sbinfo) { sbinfo 969 fs/hugetlbfs/inode.c spin_lock(&sbinfo->stat_lock); sbinfo 972 fs/hugetlbfs/inode.c if (sbinfo->spool) { sbinfo 975 fs/hugetlbfs/inode.c spin_lock(&sbinfo->spool->lock); sbinfo 976 fs/hugetlbfs/inode.c buf->f_blocks = sbinfo->spool->max_hpages; sbinfo 977 fs/hugetlbfs/inode.c free_pages = sbinfo->spool->max_hpages sbinfo 978 fs/hugetlbfs/inode.c - sbinfo->spool->used_hpages; sbinfo 980 fs/hugetlbfs/inode.c spin_unlock(&sbinfo->spool->lock); sbinfo 981 fs/hugetlbfs/inode.c buf->f_files = sbinfo->max_inodes; sbinfo 982 fs/hugetlbfs/inode.c buf->f_ffree = sbinfo->free_inodes; sbinfo 984 fs/hugetlbfs/inode.c spin_unlock(&sbinfo->stat_lock); sbinfo 1004 fs/hugetlbfs/inode.c static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo) sbinfo 1006 fs/hugetlbfs/inode.c if (sbinfo->free_inodes >= 0) { sbinfo 1007 fs/hugetlbfs/inode.c spin_lock(&sbinfo->stat_lock); sbinfo 1008 fs/hugetlbfs/inode.c if (unlikely(!sbinfo->free_inodes)) { sbinfo 1009 fs/hugetlbfs/inode.c spin_unlock(&sbinfo->stat_lock); sbinfo 1012 fs/hugetlbfs/inode.c sbinfo->free_inodes--; sbinfo 1013 fs/hugetlbfs/inode.c spin_unlock(&sbinfo->stat_lock); sbinfo 1019 fs/hugetlbfs/inode.c static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) sbinfo 1021 fs/hugetlbfs/inode.c if (sbinfo->free_inodes >= 0) { sbinfo 1022 fs/hugetlbfs/inode.c spin_lock(&sbinfo->stat_lock); sbinfo 1023 fs/hugetlbfs/inode.c sbinfo->free_inodes++; sbinfo 1024 fs/hugetlbfs/inode.c spin_unlock(&sbinfo->stat_lock); sbinfo 1033 fs/hugetlbfs/inode.c struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(sb); sbinfo 1036 fs/hugetlbfs/inode.c if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo))) sbinfo 1040 fs/hugetlbfs/inode.c hugetlbfs_inc_free_inodes(sbinfo); sbinfo 1254 fs/hugetlbfs/inode.c struct hugetlbfs_sb_info *sbinfo; sbinfo 1256 fs/hugetlbfs/inode.c sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); sbinfo 1257 fs/hugetlbfs/inode.c if (!sbinfo) sbinfo 1259 fs/hugetlbfs/inode.c sb->s_fs_info = sbinfo; sbinfo 1260 fs/hugetlbfs/inode.c spin_lock_init(&sbinfo->stat_lock); sbinfo 1261 fs/hugetlbfs/inode.c sbinfo->hstate = ctx->hstate; sbinfo 1262 fs/hugetlbfs/inode.c sbinfo->max_inodes = ctx->nr_inodes; sbinfo 1263 fs/hugetlbfs/inode.c sbinfo->free_inodes = ctx->nr_inodes; sbinfo 1264 fs/hugetlbfs/inode.c sbinfo->spool = NULL; sbinfo 1265 fs/hugetlbfs/inode.c sbinfo->uid = ctx->uid; sbinfo 1266 fs/hugetlbfs/inode.c sbinfo->gid = ctx->gid; sbinfo 1267 fs/hugetlbfs/inode.c sbinfo->mode = ctx->mode; sbinfo 1275 fs/hugetlbfs/inode.c sbinfo->spool = hugepage_new_subpool(ctx->hstate, sbinfo 1278 fs/hugetlbfs/inode.c if (!sbinfo->spool) sbinfo 1292 fs/hugetlbfs/inode.c kfree(sbinfo->spool); sbinfo 1293 fs/hugetlbfs/inode.c kfree(sbinfo); sbinfo 218 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); sbinfo 223 mm/shmem.c if (sbinfo->max_blocks) { sbinfo 224 mm/shmem.c if (percpu_counter_compare(&sbinfo->used_blocks, sbinfo 225 mm/shmem.c sbinfo->max_blocks - pages) > 0) sbinfo 227 mm/shmem.c percpu_counter_add(&sbinfo->used_blocks, pages); sbinfo 240 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); sbinfo 242 mm/shmem.c if (sbinfo->max_blocks) sbinfo 243 mm/shmem.c percpu_counter_sub(&sbinfo->used_blocks, pages); sbinfo 266 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(sb); sbinfo 267 mm/shmem.c if (sbinfo->max_inodes) { sbinfo 268 mm/shmem.c spin_lock(&sbinfo->stat_lock); sbinfo 269 mm/shmem.c if (!sbinfo->free_inodes) { sbinfo 270 mm/shmem.c spin_unlock(&sbinfo->stat_lock); sbinfo 273 mm/shmem.c sbinfo->free_inodes--; sbinfo 274 mm/shmem.c spin_unlock(&sbinfo->stat_lock); sbinfo 281 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(sb); sbinfo 282 mm/shmem.c if (sbinfo->max_inodes) { sbinfo 283 mm/shmem.c spin_lock(&sbinfo->stat_lock); sbinfo 284 mm/shmem.c sbinfo->free_inodes++; sbinfo 285 mm/shmem.c spin_unlock(&sbinfo->stat_lock); sbinfo 460 mm/shmem.c static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo, sbinfo 471 mm/shmem.c if (list_empty(&sbinfo->shrinklist)) sbinfo 474 mm/shmem.c spin_lock(&sbinfo->shrinklist_lock); sbinfo 475 mm/shmem.c list_for_each_safe(pos, next, &sbinfo->shrinklist) { sbinfo 501 mm/shmem.c spin_unlock(&sbinfo->shrinklist_lock); sbinfo 558 mm/shmem.c spin_lock(&sbinfo->shrinklist_lock); sbinfo 559 mm/shmem.c list_splice_tail(&list, &sbinfo->shrinklist); sbinfo 560 mm/shmem.c sbinfo->shrinklist_len -= removed; sbinfo 561 mm/shmem.c spin_unlock(&sbinfo->shrinklist_lock); sbinfo 569 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(sb); sbinfo 571 mm/shmem.c if (!READ_ONCE(sbinfo->shrinklist_len)) sbinfo 574 mm/shmem.c return shmem_unused_huge_shrink(sbinfo, sc, 0); sbinfo 580 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(sb); sbinfo 581 mm/shmem.c return READ_ONCE(sbinfo->shrinklist_len); sbinfo 587 mm/shmem.c static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo, sbinfo 594 mm/shmem.c static inline bool is_huge_enabled(struct shmem_sb_info *sbinfo) sbinfo 597 mm/shmem.c (shmem_huge == SHMEM_HUGE_FORCE || sbinfo->huge) && sbinfo 1021 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); sbinfo 1063 mm/shmem.c spin_lock(&sbinfo->shrinklist_lock); sbinfo 1070 mm/shmem.c &sbinfo->shrinklist); sbinfo 1071 mm/shmem.c sbinfo->shrinklist_len++; sbinfo 1073 mm/shmem.c spin_unlock(&sbinfo->shrinklist_lock); sbinfo 1087 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); sbinfo 1094 mm/shmem.c spin_lock(&sbinfo->shrinklist_lock); sbinfo 1097 mm/shmem.c sbinfo->shrinklist_len--; sbinfo 1099 mm/shmem.c spin_unlock(&sbinfo->shrinklist_lock); sbinfo 1410 mm/shmem.c static struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo) sbinfo 1413 mm/shmem.c if (sbinfo->mpol) { sbinfo 1414 mm/shmem.c spin_lock(&sbinfo->stat_lock); /* prevent replace/use races */ sbinfo 1415 mm/shmem.c mpol = sbinfo->mpol; sbinfo 1417 mm/shmem.c spin_unlock(&sbinfo->stat_lock); sbinfo 1425 mm/shmem.c static inline struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo) sbinfo 1747 mm/shmem.c struct shmem_sb_info *sbinfo; sbinfo 1767 mm/shmem.c sbinfo = SHMEM_SB(inode->i_sb); sbinfo 1814 mm/shmem.c switch (sbinfo->huge) { sbinfo 1854 mm/shmem.c ret = shmem_unused_huge_shrink(sbinfo, NULL, 1); sbinfo 1900 mm/shmem.c spin_lock(&sbinfo->shrinklist_lock); sbinfo 1907 mm/shmem.c &sbinfo->shrinklist); sbinfo 1908 mm/shmem.c sbinfo->shrinklist_len++; sbinfo 1910 mm/shmem.c spin_unlock(&sbinfo->shrinklist_lock); sbinfo 2246 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(sb); sbinfo 2279 mm/shmem.c shmem_get_sbmpol(sbinfo)); sbinfo 2729 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); sbinfo 2787 mm/shmem.c if (sbinfo->max_blocks && end - start > sbinfo->max_blocks) { sbinfo 2859 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(dentry->d_sb); sbinfo 2864 mm/shmem.c if (sbinfo->max_blocks) { sbinfo 2865 mm/shmem.c buf->f_blocks = sbinfo->max_blocks; sbinfo 2867 mm/shmem.c buf->f_bfree = sbinfo->max_blocks - sbinfo 2868 mm/shmem.c percpu_counter_sum(&sbinfo->used_blocks); sbinfo 2870 mm/shmem.c if (sbinfo->max_inodes) { sbinfo 2871 mm/shmem.c buf->f_files = sbinfo->max_inodes; sbinfo 2872 mm/shmem.c buf->f_ffree = sbinfo->free_inodes; sbinfo 3543 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(fc->root->d_sb); sbinfo 3547 mm/shmem.c spin_lock(&sbinfo->stat_lock); sbinfo 3548 mm/shmem.c inodes = sbinfo->max_inodes - sbinfo->free_inodes; sbinfo 3550 mm/shmem.c if (!sbinfo->max_blocks) { sbinfo 3554 mm/shmem.c if (percpu_counter_compare(&sbinfo->used_blocks, sbinfo 3561 mm/shmem.c if (!sbinfo->max_inodes) { sbinfo 3572 mm/shmem.c sbinfo->huge = ctx->huge; sbinfo 3574 mm/shmem.c sbinfo->max_blocks = ctx->blocks; sbinfo 3576 mm/shmem.c sbinfo->max_inodes = ctx->inodes; sbinfo 3577 mm/shmem.c sbinfo->free_inodes = ctx->inodes - inodes; sbinfo 3584 mm/shmem.c mpol_put(sbinfo->mpol); sbinfo 3585 mm/shmem.c sbinfo->mpol = ctx->mpol; /* transfers initial ref */ sbinfo 3588 mm/shmem.c spin_unlock(&sbinfo->stat_lock); sbinfo 3591 mm/shmem.c spin_unlock(&sbinfo->stat_lock); sbinfo 3597 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(root->d_sb); sbinfo 3599 mm/shmem.c if (sbinfo->max_blocks != shmem_default_max_blocks()) sbinfo 3601 mm/shmem.c sbinfo->max_blocks << (PAGE_SHIFT - 10)); sbinfo 3602 mm/shmem.c if (sbinfo->max_inodes != shmem_default_max_inodes()) sbinfo 3603 mm/shmem.c seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes); sbinfo 3604 mm/shmem.c if (sbinfo->mode != (0777 | S_ISVTX)) sbinfo 3605 mm/shmem.c seq_printf(seq, ",mode=%03ho", sbinfo->mode); sbinfo 3606 mm/shmem.c if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID)) sbinfo 3608 mm/shmem.c from_kuid_munged(&init_user_ns, sbinfo->uid)); sbinfo 3609 mm/shmem.c if (!gid_eq(sbinfo->gid, GLOBAL_ROOT_GID)) sbinfo 3611 mm/shmem.c from_kgid_munged(&init_user_ns, sbinfo->gid)); sbinfo 3614 mm/shmem.c if (sbinfo->huge) sbinfo 3615 mm/shmem.c seq_printf(seq, ",huge=%s", shmem_format_huge(sbinfo->huge)); sbinfo 3617 mm/shmem.c shmem_show_mpol(seq, sbinfo->mpol); sbinfo 3625 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(sb); sbinfo 3627 mm/shmem.c percpu_counter_destroy(&sbinfo->used_blocks); sbinfo 3628 mm/shmem.c mpol_put(sbinfo->mpol); sbinfo 3629 mm/shmem.c kfree(sbinfo); sbinfo 3637 mm/shmem.c struct shmem_sb_info *sbinfo; sbinfo 3641 mm/shmem.c sbinfo = kzalloc(max((int)sizeof(struct shmem_sb_info), sbinfo 3643 mm/shmem.c if (!sbinfo) sbinfo 3646 mm/shmem.c sb->s_fs_info = sbinfo; sbinfo 3667 mm/shmem.c sbinfo->max_blocks = ctx->blocks; sbinfo 3668 mm/shmem.c sbinfo->free_inodes = sbinfo->max_inodes = ctx->inodes; sbinfo 3669 mm/shmem.c sbinfo->uid = ctx->uid; sbinfo 3670 mm/shmem.c sbinfo->gid = ctx->gid; sbinfo 3671 mm/shmem.c sbinfo->mode = ctx->mode; sbinfo 3672 mm/shmem.c sbinfo->huge = ctx->huge; sbinfo 3673 mm/shmem.c sbinfo->mpol = ctx->mpol; sbinfo 3676 mm/shmem.c spin_lock_init(&sbinfo->stat_lock); sbinfo 3677 mm/shmem.c if (percpu_counter_init(&sbinfo->used_blocks, 0, GFP_KERNEL)) sbinfo 3679 mm/shmem.c spin_lock_init(&sbinfo->shrinklist_lock); sbinfo 3680 mm/shmem.c INIT_LIST_HEAD(&sbinfo->shrinklist); sbinfo 3696 mm/shmem.c inode = shmem_get_inode(sb, NULL, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE); sbinfo 3699 mm/shmem.c inode->i_uid = sbinfo->uid; sbinfo 3700 mm/shmem.c inode->i_gid = sbinfo->gid; sbinfo 3993 mm/shmem.c struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); sbinfo 4004 mm/shmem.c switch (sbinfo->huge) {