Lines Matching defs:sbinfo
1012 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(root->d_sb);
1013 struct hugepage_subpool *spool = sbinfo->spool;
1014 unsigned long hpage_size = huge_page_size(sbinfo->hstate);
1015 unsigned hpage_shift = huge_page_shift(sbinfo->hstate);
1018 if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID))
1020 from_kuid_munged(&init_user_ns, sbinfo->uid));
1021 if (!gid_eq(sbinfo->gid, GLOBAL_ROOT_GID))
1023 from_kgid_munged(&init_user_ns, sbinfo->gid));
1024 if (sbinfo->mode != 0755)
1025 seq_printf(m, ",mode=%o", sbinfo->mode);
1026 if (sbinfo->max_inodes != -1)
1027 seq_printf(m, ",nr_inodes=%lu", sbinfo->max_inodes);
1049 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb);
1054 if (sbinfo) {
1055 spin_lock(&sbinfo->stat_lock);
1058 if (sbinfo->spool) {
1061 spin_lock(&sbinfo->spool->lock);
1062 buf->f_blocks = sbinfo->spool->max_hpages;
1063 free_pages = sbinfo->spool->max_hpages
1064 - sbinfo->spool->used_hpages;
1066 spin_unlock(&sbinfo->spool->lock);
1067 buf->f_files = sbinfo->max_inodes;
1068 buf->f_ffree = sbinfo->free_inodes;
1070 spin_unlock(&sbinfo->stat_lock);
1090 static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo)
1092 if (sbinfo->free_inodes >= 0) {
1093 spin_lock(&sbinfo->stat_lock);
1094 if (unlikely(!sbinfo->free_inodes)) {
1095 spin_unlock(&sbinfo->stat_lock);
1098 sbinfo->free_inodes--;
1099 spin_unlock(&sbinfo->stat_lock);
1105 static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo)
1107 if (sbinfo->free_inodes >= 0) {
1108 spin_lock(&sbinfo->stat_lock);
1109 sbinfo->free_inodes++;
1110 spin_unlock(&sbinfo->stat_lock);
1119 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(sb);
1122 if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo)))
1126 hugetlbfs_inc_free_inodes(sbinfo);
1341 struct hugetlbfs_sb_info *sbinfo;
1343 sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL);
1344 if (!sbinfo)
1346 sb->s_fs_info = sbinfo;
1347 spin_lock_init(&sbinfo->stat_lock);
1348 sbinfo->hstate = ctx->hstate;
1349 sbinfo->max_inodes = ctx->nr_inodes;
1350 sbinfo->free_inodes = ctx->nr_inodes;
1351 sbinfo->spool = NULL;
1352 sbinfo->uid = ctx->uid;
1353 sbinfo->gid = ctx->gid;
1354 sbinfo->mode = ctx->mode;
1362 sbinfo->spool = hugepage_new_subpool(ctx->hstate,
1365 if (!sbinfo->spool)
1385 kfree(sbinfo->spool);
1386 kfree(sbinfo);