Lines Matching refs:exfat
92 void exfat_free_dir_list(struct exfat *exfat) in exfat_free_dir_list() argument
96 list_for_each_entry_safe(dir, i, &exfat->dir_list, list) { in exfat_free_dir_list()
105 void exfat_free_exfat(struct exfat *exfat) in exfat_free_exfat() argument
107 if (exfat) { in exfat_free_exfat()
108 if (exfat->bs) in exfat_free_exfat()
109 free(exfat->bs); in exfat_free_exfat()
110 if (exfat->alloc_bitmap) in exfat_free_exfat()
111 free(exfat->alloc_bitmap); in exfat_free_exfat()
112 if (exfat->disk_bitmap) in exfat_free_exfat()
113 free(exfat->disk_bitmap); in exfat_free_exfat()
114 if (exfat->ohead_bitmap) in exfat_free_exfat()
115 free(exfat->ohead_bitmap); in exfat_free_exfat()
116 if (exfat->upcase_table) in exfat_free_exfat()
117 free(exfat->upcase_table); in exfat_free_exfat()
118 if (exfat->root) in exfat_free_exfat()
119 exfat_free_inode(exfat->root); in exfat_free_exfat()
120 if (exfat->zero_cluster) in exfat_free_exfat()
121 free(exfat->zero_cluster); in exfat_free_exfat()
122 free(exfat); in exfat_free_exfat()
126 struct exfat *exfat_alloc_exfat(struct exfat_blk_dev *blk_dev, struct pbr *bs) in exfat_alloc_exfat()
128 struct exfat *exfat; in exfat_alloc_exfat() local
130 exfat = (struct exfat *)calloc(1, sizeof(*exfat)); in exfat_alloc_exfat()
131 if (!exfat) in exfat_alloc_exfat()
134 INIT_LIST_HEAD(&exfat->dir_list); in exfat_alloc_exfat()
135 exfat->blk_dev = blk_dev; in exfat_alloc_exfat()
136 exfat->bs = bs; in exfat_alloc_exfat()
137 exfat->clus_count = le32_to_cpu(bs->bsx.clu_count); in exfat_alloc_exfat()
138 exfat->clus_size = EXFAT_CLUSTER_SIZE(bs); in exfat_alloc_exfat()
139 exfat->sect_size = EXFAT_SECTOR_SIZE(bs); in exfat_alloc_exfat()
142 exfat->alloc_bitmap = (char *)calloc(1, in exfat_alloc_exfat()
143 EXFAT_BITMAP_SIZE(exfat->clus_count)); in exfat_alloc_exfat()
144 if (!exfat->alloc_bitmap) { in exfat_alloc_exfat()
149 exfat->ohead_bitmap = in exfat_alloc_exfat()
150 calloc(1, EXFAT_BITMAP_SIZE(exfat->clus_count)); in exfat_alloc_exfat()
151 if (!exfat->ohead_bitmap) { in exfat_alloc_exfat()
156 exfat->disk_bitmap = in exfat_alloc_exfat()
157 calloc(1, EXFAT_BITMAP_SIZE(exfat->clus_count)); in exfat_alloc_exfat()
158 if (!exfat->disk_bitmap) { in exfat_alloc_exfat()
163 exfat->zero_cluster = calloc(1, exfat->clus_size); in exfat_alloc_exfat()
164 if (!exfat->zero_cluster) { in exfat_alloc_exfat()
169 exfat->start_clu = EXFAT_FIRST_CLUSTER; in exfat_alloc_exfat()
170 return exfat; in exfat_alloc_exfat()
172 exfat_free_exfat(exfat); in exfat_alloc_exfat()