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()
108 fatent->bhs[0] = sb_bread(sb, blocknr); in fat_ent_bread()
109 if (!fatent->bhs[0]) { in fat_ent_bread()
172 mark_buffer_dirty_inode(fatent->bhs[0], fatent->fat_inode); in fat12_ent_put()
174 mark_buffer_dirty_inode(fatent->bhs[1], fatent->fat_inode); in fat12_ent_put()
183 mark_buffer_dirty_inode(fatent->bhs[0], fatent->fat_inode); in fat16_ent_put()
191 mark_buffer_dirty_inode(fatent->bhs[0], fatent->fat_inode); in fat32_ent_put()
197 struct buffer_head **bhs = fatent->bhs; in fat12_ent_next() local
202 WARN_ON(ent12_p[0] > (u8 *)(bhs[0]->b_data + in fat12_ent_next()
203 (bhs[0]->b_size - 2))); in fat12_ent_next()
204 WARN_ON(ent12_p[1] > (u8 *)(bhs[0]->b_data + in fat12_ent_next()
205 (bhs[0]->b_size - 1))); in fat12_ent_next()
206 if (nextp < (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))) { in fat12_ent_next()
212 WARN_ON(ent12_p[0] != (u8 *)(bhs[0]->b_data + in fat12_ent_next()
213 (bhs[0]->b_size - 1))); in fat12_ent_next()
214 WARN_ON(ent12_p[1] != (u8 *)bhs[1]->b_data); in fat12_ent_next()
217 brelse(bhs[0]); in fat12_ent_next()
218 bhs[0] = bhs[1]; in fat12_ent_next()
229 const struct buffer_head *bh = fatent->bhs[0]; in fat16_ent_next()
241 const struct buffer_head *bh = fatent->bhs[0]; in fat32_ent_next()
324 struct buffer_head **bhs = fatent->bhs; in fat_ent_update_ptr() local
327 if (!fatent->nr_bhs || bhs[0]->b_blocknr != blocknr) in fat_ent_update_ptr()
333 brelse(bhs[1]); in fat_ent_update_ptr()
340 if (bhs[1]->b_blocknr != (blocknr + 1)) in fat_ent_update_ptr()
375 static int fat_mirror_bhs(struct super_block *sb, struct buffer_head **bhs, in fat_mirror_bhs() argument
387 c_bh = sb_getblk(sb, backup_fat + bhs[n]->b_blocknr); in fat_mirror_bhs()
394 memcpy(c_bh->b_data, bhs[n]->b_data, sb->s_blocksize); in fat_mirror_bhs()
418 err = fat_sync_bhs(fatent->bhs, fatent->nr_bhs); in fat_ent_write()
422 return fat_mirror_bhs(sb, fatent->bhs, fatent->nr_bhs); in fat_ent_write()
447 static void fat_collect_bhs(struct buffer_head **bhs, int *nr_bhs, in fat_collect_bhs() argument
454 if (fatent->bhs[n] == bhs[i]) in fat_collect_bhs()
458 get_bh(fatent->bhs[n]); in fat_collect_bhs()
459 bhs[i] = fatent->bhs[n]; in fat_collect_bhs()
471 struct buffer_head *bhs[MAX_BUF_PER_PAGE]; in fat_alloc_clusters() local
506 fat_collect_bhs(bhs, &nr_bhs, &fatent); in fat_alloc_clusters()
540 err = fat_sync_bhs(bhs, nr_bhs); in fat_alloc_clusters()
542 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_alloc_clusters()
545 brelse(bhs[i]); in fat_alloc_clusters()
559 struct buffer_head *bhs[MAX_BUF_PER_PAGE]; in fat_free_clusters() local
604 err = fat_sync_bhs(bhs, nr_bhs); in fat_free_clusters()
608 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_free_clusters()
612 brelse(bhs[i]); in fat_free_clusters()
615 fat_collect_bhs(bhs, &nr_bhs, &fatent); in fat_free_clusters()
619 err = fat_sync_bhs(bhs, nr_bhs); in fat_free_clusters()
623 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_free_clusters()
627 brelse(bhs[i]); in fat_free_clusters()