Lines Matching refs:sbinfo
1179 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(root->d_sb); in hugetlbfs_show_options() local
1180 struct hugepage_subpool *spool = sbinfo->spool; in hugetlbfs_show_options()
1181 unsigned long hpage_size = huge_page_size(sbinfo->hstate); in hugetlbfs_show_options()
1182 unsigned hpage_shift = huge_page_shift(sbinfo->hstate); in hugetlbfs_show_options()
1185 if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID)) in hugetlbfs_show_options()
1187 from_kuid_munged(&init_user_ns, sbinfo->uid)); in hugetlbfs_show_options()
1188 if (!gid_eq(sbinfo->gid, GLOBAL_ROOT_GID)) in hugetlbfs_show_options()
1190 from_kgid_munged(&init_user_ns, sbinfo->gid)); in hugetlbfs_show_options()
1191 if (sbinfo->mode != 0755) in hugetlbfs_show_options()
1192 seq_printf(m, ",mode=%o", sbinfo->mode); in hugetlbfs_show_options()
1193 if (sbinfo->max_inodes != -1) in hugetlbfs_show_options()
1194 seq_printf(m, ",nr_inodes=%lu", sbinfo->max_inodes); in hugetlbfs_show_options()
1216 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); in hugetlbfs_statfs() local
1221 if (sbinfo) { in hugetlbfs_statfs()
1222 spin_lock(&sbinfo->stat_lock); in hugetlbfs_statfs()
1225 if (sbinfo->spool) { in hugetlbfs_statfs()
1228 spin_lock_irq(&sbinfo->spool->lock); in hugetlbfs_statfs()
1229 buf->f_blocks = sbinfo->spool->max_hpages; in hugetlbfs_statfs()
1230 free_pages = sbinfo->spool->max_hpages in hugetlbfs_statfs()
1231 - sbinfo->spool->used_hpages; in hugetlbfs_statfs()
1233 spin_unlock_irq(&sbinfo->spool->lock); in hugetlbfs_statfs()
1234 buf->f_files = sbinfo->max_inodes; in hugetlbfs_statfs()
1235 buf->f_ffree = sbinfo->free_inodes; in hugetlbfs_statfs()
1237 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_statfs()
1257 static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo) in hugetlbfs_dec_free_inodes() argument
1259 if (sbinfo->free_inodes >= 0) { in hugetlbfs_dec_free_inodes()
1260 spin_lock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
1261 if (unlikely(!sbinfo->free_inodes)) { in hugetlbfs_dec_free_inodes()
1262 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
1265 sbinfo->free_inodes--; in hugetlbfs_dec_free_inodes()
1266 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
1272 static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) in hugetlbfs_inc_free_inodes() argument
1274 if (sbinfo->free_inodes >= 0) { in hugetlbfs_inc_free_inodes()
1275 spin_lock(&sbinfo->stat_lock); in hugetlbfs_inc_free_inodes()
1276 sbinfo->free_inodes++; in hugetlbfs_inc_free_inodes()
1277 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_inc_free_inodes()
1286 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(sb); in hugetlbfs_alloc_inode() local
1289 if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo))) in hugetlbfs_alloc_inode()
1293 hugetlbfs_inc_free_inodes(sbinfo); in hugetlbfs_alloc_inode()
1510 struct hugetlbfs_sb_info *sbinfo; in hugetlbfs_fill_super() local
1512 sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); in hugetlbfs_fill_super()
1513 if (!sbinfo) in hugetlbfs_fill_super()
1515 sb->s_fs_info = sbinfo; in hugetlbfs_fill_super()
1516 spin_lock_init(&sbinfo->stat_lock); in hugetlbfs_fill_super()
1517 sbinfo->hstate = ctx->hstate; in hugetlbfs_fill_super()
1518 sbinfo->max_inodes = ctx->nr_inodes; in hugetlbfs_fill_super()
1519 sbinfo->free_inodes = ctx->nr_inodes; in hugetlbfs_fill_super()
1520 sbinfo->spool = NULL; in hugetlbfs_fill_super()
1521 sbinfo->uid = ctx->uid; in hugetlbfs_fill_super()
1522 sbinfo->gid = ctx->gid; in hugetlbfs_fill_super()
1523 sbinfo->mode = ctx->mode; in hugetlbfs_fill_super()
1531 sbinfo->spool = hugepage_new_subpool(ctx->hstate, in hugetlbfs_fill_super()
1534 if (!sbinfo->spool) in hugetlbfs_fill_super()
1554 kfree(sbinfo->spool); in hugetlbfs_fill_super()
1555 kfree(sbinfo); in hugetlbfs_fill_super()