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()
326 struct buffer_head **bhs = fatent->bhs; in fat_ent_update_ptr() local
329 if (!fatent->nr_bhs || bhs[0]->b_blocknr != blocknr) in fat_ent_update_ptr()
335 brelse(bhs[1]); in fat_ent_update_ptr()
342 if (bhs[1]->b_blocknr != (blocknr + 1)) in fat_ent_update_ptr()
377 static int fat_mirror_bhs(struct super_block *sb, struct buffer_head **bhs, in fat_mirror_bhs() argument
389 c_bh = sb_getblk(sb, backup_fat + bhs[n]->b_blocknr); in fat_mirror_bhs()
396 memcpy(c_bh->b_data, bhs[n]->b_data, sb->s_blocksize); in fat_mirror_bhs()
420 err = fat_sync_bhs(fatent->bhs, fatent->nr_bhs); in fat_ent_write()
424 return fat_mirror_bhs(sb, fatent->bhs, fatent->nr_bhs); in fat_ent_write()
449 static void fat_collect_bhs(struct buffer_head **bhs, int *nr_bhs, in fat_collect_bhs() argument
456 if (fatent->bhs[n] == bhs[i]) in fat_collect_bhs()
460 get_bh(fatent->bhs[n]); in fat_collect_bhs()
461 bhs[i] = fatent->bhs[n]; in fat_collect_bhs()
473 struct buffer_head *bhs[MAX_BUF_PER_PAGE]; in fat_alloc_clusters() local
508 fat_collect_bhs(bhs, &nr_bhs, &fatent); in fat_alloc_clusters()
542 err = fat_sync_bhs(bhs, nr_bhs); in fat_alloc_clusters()
544 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_alloc_clusters()
547 brelse(bhs[i]); in fat_alloc_clusters()
561 struct buffer_head *bhs[MAX_BUF_PER_PAGE]; in fat_free_clusters() local
606 err = fat_sync_bhs(bhs, nr_bhs); in fat_free_clusters()
610 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_free_clusters()
614 brelse(bhs[i]); in fat_free_clusters()
617 fat_collect_bhs(bhs, &nr_bhs, &fatent); in fat_free_clusters()
621 err = fat_sync_bhs(bhs, nr_bhs); in fat_free_clusters()
625 err = fat_mirror_bhs(sb, bhs, nr_bhs); in fat_free_clusters()
629 brelse(bhs[i]); in fat_free_clusters()