Lines Matching refs:p_chain

155 static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain)  in __exfat_free_cluster()  argument
164 if (p_chain->dir == EXFAT_FREE_CLUSTER || in __exfat_free_cluster()
165 p_chain->dir == EXFAT_EOF_CLUSTER || in __exfat_free_cluster()
166 p_chain->dir < EXFAT_FIRST_CLUSTER) in __exfat_free_cluster()
170 if (p_chain->size == 0) in __exfat_free_cluster()
174 if (!is_valid_cluster(sbi, p_chain->dir)) { in __exfat_free_cluster()
175 exfat_err(sb, "invalid start cluster (%u)", p_chain->dir); in __exfat_free_cluster()
179 clu = p_chain->dir; in __exfat_free_cluster()
184 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in __exfat_free_cluster()
185 unsigned int last_cluster = p_chain->dir + p_chain->size - 1; in __exfat_free_cluster()
202 } while (num_clusters < p_chain->size); in __exfat_free_cluster()
234 int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain) in exfat_free_cluster() argument
239 ret = __exfat_free_cluster(inode, p_chain); in exfat_free_cluster()
245 int exfat_find_last_cluster(struct super_block *sb, struct exfat_chain *p_chain, in exfat_find_last_cluster() argument
251 next = p_chain->dir; in exfat_find_last_cluster()
252 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_find_last_cluster()
253 *ret_clu = next + p_chain->size - 1; in exfat_find_last_cluster()
264 if (p_chain->size != count) { in exfat_find_last_cluster()
267 p_chain->size, count); in exfat_find_last_cluster()
323 struct exfat_chain *p_chain, bool sync_bmap) in exfat_alloc_cluster() argument
345 hint_clu = p_chain->dir; in exfat_alloc_cluster()
366 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_alloc_cluster()
367 if (exfat_chain_cont_cluster(sb, p_chain->dir, in exfat_alloc_cluster()
372 p_chain->flags = ALLOC_FAT_CHAIN; in exfat_alloc_cluster()
376 p_chain->dir = EXFAT_EOF_CLUSTER; in exfat_alloc_cluster()
381 p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_alloc_cluster()
382 if (exfat_chain_cont_cluster(sb, p_chain->dir, in exfat_alloc_cluster()
387 p_chain->flags = ALLOC_FAT_CHAIN; in exfat_alloc_cluster()
399 if (p_chain->flags == ALLOC_FAT_CHAIN) { in exfat_alloc_cluster()
406 if (p_chain->dir == EXFAT_EOF_CLUSTER) { in exfat_alloc_cluster()
407 p_chain->dir = new_clu; in exfat_alloc_cluster()
408 } else if (p_chain->flags == ALLOC_FAT_CHAIN) { in exfat_alloc_cluster()
420 p_chain->size += num_clusters; in exfat_alloc_cluster()
429 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_alloc_cluster()
430 if (exfat_chain_cont_cluster(sb, p_chain->dir, in exfat_alloc_cluster()
435 p_chain->flags = ALLOC_FAT_CHAIN; in exfat_alloc_cluster()
441 __exfat_free_cluster(inode, p_chain); in exfat_alloc_cluster()
448 struct exfat_chain *p_chain, unsigned int *ret_count) in exfat_count_num_clusters() argument
454 if (!p_chain->dir || p_chain->dir == EXFAT_EOF_CLUSTER) { in exfat_count_num_clusters()
459 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_count_num_clusters()
460 *ret_count = p_chain->size; in exfat_count_num_clusters()
464 clu = p_chain->dir; in exfat_count_num_clusters()