Lines Matching refs:bhs

44 	struct buffer_head **bhs = fatent->bhs;  in fat12_ent_set_ptr()  local
46 WARN_ON(offset >= (bhs[0]->b_size - 1)); in fat12_ent_set_ptr()
47 fatent->u.ent12_p[0] = bhs[0]->b_data + offset; in fat12_ent_set_ptr()
48 fatent->u.ent12_p[1] = bhs[0]->b_data + (offset + 1); in fat12_ent_set_ptr()
50 WARN_ON(offset != (bhs[0]->b_size - 1)); in fat12_ent_set_ptr()
51 fatent->u.ent12_p[0] = bhs[0]->b_data + offset; in fat12_ent_set_ptr()
52 fatent->u.ent12_p[1] = bhs[1]->b_data; in fat12_ent_set_ptr()
59 fatent->u.ent16_p = (__le16 *)(fatent->bhs[0]->b_data + offset); in fat16_ent_set_ptr()
65 fatent->u.ent32_p = (__le32 *)(fatent->bhs[0]->b_data + offset); in fat32_ent_set_ptr()
71 struct buffer_head **bhs = fatent->bhs; in fat12_ent_bread() local
76 bhs[0] = sb_bread(sb, blocknr); in fat12_ent_bread()
77 if (!bhs[0]) in fat12_ent_bread()
85 bhs[1] = sb_bread(sb, blocknr); in fat12_ent_bread()
86 if (!bhs[1]) in fat12_ent_bread()
94 brelse(bhs[0]); in fat12_ent_bread()
107 fatent->bhs[0] = sb_bread(sb, blocknr); in fat_ent_bread()
108 if (!fatent->bhs[0]) { in fat_ent_bread()
171 mark_buffer_dirty_inode(fatent->bhs[0], fatent->fat_inode); in fat12_ent_put()
173 mark_buffer_dirty_inode(fatent->bhs[1], fatent->fat_inode); in fat12_ent_put()
182 mark_buffer_dirty_inode(fatent->bhs[0], fatent->fat_inode); in fat16_ent_put()
190 mark_buffer_dirty_inode(fatent->bhs[0], fatent->fat_inode); in fat32_ent_put()
196 struct buffer_head **bhs = fatent->bhs; in fat12_ent_next() local
201 WARN_ON(ent12_p[0] > (u8 *)(bhs[0]->b_data + in fat12_ent_next()
202 (bhs[0]->b_size - 2))); in fat12_ent_next()
203 WARN_ON(ent12_p[1] > (u8 *)(bhs[0]->b_data + in fat12_ent_next()
204 (bhs[0]->b_size - 1))); in fat12_ent_next()
205 if (nextp < (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))) { in fat12_ent_next()
211 WARN_ON(ent12_p[0] != (u8 *)(bhs[0]->b_data + in fat12_ent_next()
212 (bhs[0]->b_size - 1))); in fat12_ent_next()
213 WARN_ON(ent12_p[1] != (u8 *)bhs[1]->b_data); in fat12_ent_next()
216 brelse(bhs[0]); in fat12_ent_next()
217 bhs[0] = bhs[1]; in fat12_ent_next()
228 const struct buffer_head *bh = fatent->bhs[0]; in fat16_ent_next()
240 const struct buffer_head *bh = fatent->bhs[0]; in fat32_ent_next()
323 struct buffer_head **bhs = fatent->bhs; in fat_ent_update_ptr() local
326 if (!fatent->nr_bhs || bhs[0]->b_blocknr != blocknr) in fat_ent_update_ptr()
332 brelse(bhs[1]); in fat_ent_update_ptr()
339 if (bhs[1]->b_blocknr != (blocknr + 1)) in fat_ent_update_ptr()
374 static int fat_mirror_bhs(struct super_block *sb, struct buffer_head **bhs, in fat_mirror_bhs() argument
386 c_bh = sb_getblk(sb, backup_fat + bhs[n]->b_blocknr); in fat_mirror_bhs()
393 memcpy(c_bh->b_data, bhs[n]->b_data, sb->s_blocksize); in fat_mirror_bhs()
417 err = fat_sync_bhs(fatent->bhs, fatent->nr_bhs); in fat_ent_write()
421 return fat_mirror_bhs(sb, fatent->bhs, fatent->nr_bhs); in fat_ent_write()
446 static void fat_collect_bhs(struct buffer_head **bhs, int *nr_bhs, in fat_collect_bhs() argument
453 if (fatent->bhs[n] == bhs[i]) in fat_collect_bhs()
457 get_bh(fatent->bhs[n]); in fat_collect_bhs()
458 bhs[i] = fatent->bhs[n]; in fat_collect_bhs()
470 struct buffer_head *bhs[MAX_BUF_PER_PAGE]; in fat_alloc_clusters() local
505 fat_collect_bhs(bhs, &nr_bhs, &fatent); in fat_alloc_clusters()
539 err = fat_sync_bhs(bhs, nr_bhs); in fat_alloc_clusters()
541 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_alloc_clusters()
544 brelse(bhs[i]); in fat_alloc_clusters()
558 struct buffer_head *bhs[MAX_BUF_PER_PAGE]; in fat_free_clusters() local
603 err = fat_sync_bhs(bhs, nr_bhs); in fat_free_clusters()
607 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_free_clusters()
611 brelse(bhs[i]); in fat_free_clusters()
614 fat_collect_bhs(bhs, &nr_bhs, &fatent); in fat_free_clusters()
618 err = fat_sync_bhs(bhs, nr_bhs); in fat_free_clusters()
622 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_free_clusters()
626 brelse(bhs[i]); in fat_free_clusters()