Lines Matching refs:sbinfo
855 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); in hugetlbfs_statfs() local
860 if (sbinfo) { in hugetlbfs_statfs()
861 spin_lock(&sbinfo->stat_lock); in hugetlbfs_statfs()
864 if (sbinfo->spool) { in hugetlbfs_statfs()
867 spin_lock(&sbinfo->spool->lock); in hugetlbfs_statfs()
868 buf->f_blocks = sbinfo->spool->max_hpages; in hugetlbfs_statfs()
869 free_pages = sbinfo->spool->max_hpages in hugetlbfs_statfs()
870 - sbinfo->spool->used_hpages; in hugetlbfs_statfs()
872 spin_unlock(&sbinfo->spool->lock); in hugetlbfs_statfs()
873 buf->f_files = sbinfo->max_inodes; in hugetlbfs_statfs()
874 buf->f_ffree = sbinfo->free_inodes; in hugetlbfs_statfs()
876 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_statfs()
896 static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo) in hugetlbfs_dec_free_inodes() argument
898 if (sbinfo->free_inodes >= 0) { in hugetlbfs_dec_free_inodes()
899 spin_lock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
900 if (unlikely(!sbinfo->free_inodes)) { in hugetlbfs_dec_free_inodes()
901 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
904 sbinfo->free_inodes--; in hugetlbfs_dec_free_inodes()
905 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_dec_free_inodes()
911 static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) in hugetlbfs_inc_free_inodes() argument
913 if (sbinfo->free_inodes >= 0) { in hugetlbfs_inc_free_inodes()
914 spin_lock(&sbinfo->stat_lock); in hugetlbfs_inc_free_inodes()
915 sbinfo->free_inodes++; in hugetlbfs_inc_free_inodes()
916 spin_unlock(&sbinfo->stat_lock); in hugetlbfs_inc_free_inodes()
925 struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(sb); in hugetlbfs_alloc_inode() local
928 if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo))) in hugetlbfs_alloc_inode()
932 hugetlbfs_inc_free_inodes(sbinfo); in hugetlbfs_alloc_inode()
1144 struct hugetlbfs_sb_info *sbinfo; in hugetlbfs_fill_super() local
1159 sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); in hugetlbfs_fill_super()
1160 if (!sbinfo) in hugetlbfs_fill_super()
1162 sb->s_fs_info = sbinfo; in hugetlbfs_fill_super()
1163 sbinfo->hstate = config.hstate; in hugetlbfs_fill_super()
1164 spin_lock_init(&sbinfo->stat_lock); in hugetlbfs_fill_super()
1165 sbinfo->max_inodes = config.nr_inodes; in hugetlbfs_fill_super()
1166 sbinfo->free_inodes = config.nr_inodes; in hugetlbfs_fill_super()
1167 sbinfo->spool = NULL; in hugetlbfs_fill_super()
1174 sbinfo->spool = hugepage_new_subpool(config.hstate, in hugetlbfs_fill_super()
1177 if (!sbinfo->spool) in hugetlbfs_fill_super()
1191 kfree(sbinfo->spool); in hugetlbfs_fill_super()
1192 kfree(sbinfo); in hugetlbfs_fill_super()