Lines Matching refs:sbinfo
589 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); in hugetlbfs_statfs() local
594 if (sbinfo) { in hugetlbfs_statfs()
595 spin_lock(&sbinfo->stat_lock); in hugetlbfs_statfs()
598 if (sbinfo->spool) { in hugetlbfs_statfs()
601 spin_lock(&sbinfo->spool->lock); in hugetlbfs_statfs()
602 buf->f_blocks = sbinfo->spool->max_hpages; in hugetlbfs_statfs()
603 free_pages = sbinfo->spool->max_hpages in hugetlbfs_statfs()
604 - sbinfo->spool->used_hpages; in hugetlbfs_statfs()
606 spin_unlock(&sbinfo->spool->lock); in hugetlbfs_statfs()
607 buf->f_files = sbinfo->max_inodes; in hugetlbfs_statfs()
608 buf->f_ffree = sbinfo->free_inodes; in hugetlbfs_statfs()
610 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_statfs()
630 static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo) in hugetlbfs_dec_free_inodes() argument
632 if (sbinfo->free_inodes >= 0) { in hugetlbfs_dec_free_inodes()
633 spin_lock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
634 if (unlikely(!sbinfo->free_inodes)) { in hugetlbfs_dec_free_inodes()
635 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
638 sbinfo->free_inodes--; in hugetlbfs_dec_free_inodes()
639 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
645 static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) in hugetlbfs_inc_free_inodes() argument
647 if (sbinfo->free_inodes >= 0) { in hugetlbfs_inc_free_inodes()
648 spin_lock(&sbinfo->stat_lock); in hugetlbfs_inc_free_inodes()
649 sbinfo->free_inodes++; in hugetlbfs_inc_free_inodes()
650 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_inc_free_inodes()
659 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(sb); in hugetlbfs_alloc_inode() local
662 if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo))) in hugetlbfs_alloc_inode()
666 hugetlbfs_inc_free_inodes(sbinfo); in hugetlbfs_alloc_inode()
877 struct hugetlbfs_sb_info *sbinfo; in hugetlbfs_fill_super() local
892 sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); in hugetlbfs_fill_super()
893 if (!sbinfo) in hugetlbfs_fill_super()
895 sb->s_fs_info = sbinfo; in hugetlbfs_fill_super()
896 sbinfo->hstate = config.hstate; in hugetlbfs_fill_super()
897 spin_lock_init(&sbinfo->stat_lock); in hugetlbfs_fill_super()
898 sbinfo->max_inodes = config.nr_inodes; in hugetlbfs_fill_super()
899 sbinfo->free_inodes = config.nr_inodes; in hugetlbfs_fill_super()
900 sbinfo->spool = NULL; in hugetlbfs_fill_super()
907 sbinfo->spool = hugepage_new_subpool(config.hstate, in hugetlbfs_fill_super()
910 if (!sbinfo->spool) in hugetlbfs_fill_super()
924 kfree(sbinfo->spool); in hugetlbfs_fill_super()
925 kfree(sbinfo); in hugetlbfs_fill_super()