Lines Matching refs:p_chain

148 static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain)  in __exfat_free_cluster()  argument
157 if (p_chain->dir == EXFAT_FREE_CLUSTER || in __exfat_free_cluster()
158 p_chain->dir == EXFAT_EOF_CLUSTER || in __exfat_free_cluster()
159 p_chain->dir < EXFAT_FIRST_CLUSTER) in __exfat_free_cluster()
163 if (p_chain->size == 0) in __exfat_free_cluster()
167 if (!is_valid_cluster(sbi, p_chain->dir)) { in __exfat_free_cluster()
168 exfat_err(sb, "invalid start cluster (%u)", p_chain->dir); in __exfat_free_cluster()
172 clu = p_chain->dir; in __exfat_free_cluster()
177 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in __exfat_free_cluster()
178 unsigned int last_cluster = p_chain->dir + p_chain->size - 1; in __exfat_free_cluster()
195 } while (num_clusters < p_chain->size); in __exfat_free_cluster()
227 int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain) in exfat_free_cluster() argument
232 ret = __exfat_free_cluster(inode, p_chain); in exfat_free_cluster()
238 int exfat_find_last_cluster(struct super_block *sb, struct exfat_chain *p_chain, in exfat_find_last_cluster() argument
244 next = p_chain->dir; in exfat_find_last_cluster()
245 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_find_last_cluster()
246 *ret_clu = next + p_chain->size - 1; in exfat_find_last_cluster()
257 if (p_chain->size != count) { in exfat_find_last_cluster()
260 p_chain->size, count); in exfat_find_last_cluster()
307 struct exfat_chain *p_chain, bool sync_bmap) in exfat_alloc_cluster() argument
329 hint_clu = p_chain->dir; in exfat_alloc_cluster()
351 p_chain->flags = ALLOC_FAT_CHAIN; in exfat_alloc_cluster()
354 p_chain->dir = EXFAT_EOF_CLUSTER; in exfat_alloc_cluster()
359 p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_alloc_cluster()
360 if (exfat_chain_cont_cluster(sb, p_chain->dir, in exfat_alloc_cluster()
361 p_chain->size)) { in exfat_alloc_cluster()
365 p_chain->flags = ALLOC_FAT_CHAIN; in exfat_alloc_cluster()
375 if (p_chain->flags == ALLOC_FAT_CHAIN) { in exfat_alloc_cluster()
382 if (p_chain->dir == EXFAT_EOF_CLUSTER) { in exfat_alloc_cluster()
383 p_chain->dir = new_clu; in exfat_alloc_cluster()
384 } else if (p_chain->flags == ALLOC_FAT_CHAIN) { in exfat_alloc_cluster()
390 p_chain->size++; in exfat_alloc_cluster()
394 if (p_chain->size == num_alloc) { in exfat_alloc_cluster()
406 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_alloc_cluster()
407 if (exfat_chain_cont_cluster(sb, p_chain->dir, in exfat_alloc_cluster()
408 p_chain->size)) { in exfat_alloc_cluster()
412 p_chain->flags = ALLOC_FAT_CHAIN; in exfat_alloc_cluster()
417 __exfat_free_cluster(inode, p_chain); in exfat_alloc_cluster()
424 struct exfat_chain *p_chain, unsigned int *ret_count) in exfat_count_num_clusters() argument
430 if (!p_chain->dir || p_chain->dir == EXFAT_EOF_CLUSTER) { in exfat_count_num_clusters()
435 if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { in exfat_count_num_clusters()
436 *ret_count = p_chain->size; in exfat_count_num_clusters()
440 clu = p_chain->dir; in exfat_count_num_clusters()