Lines Matching refs:bh
59 struct buffer_head * bh; in ufs_readdir() local
71 bh = NULL; in ufs_readdir()
77 if (!blk || !(bh = sb_bread(sb, blk))) { in ufs_readdir()
93 de = (struct ufs_dir_entry *)(bh->b_data + i); in ufs_readdir()
113 de = (struct ufs_dir_entry *) (bh->b_data + offset); in ufs_readdir()
119 brelse(bh); in ufs_readdir()
123 bh, offset)) { in ufs_readdir()
129 brelse (bh); in ufs_readdir()
161 brelse (bh); in ufs_readdir()
207 struct buffer_head * bh; in ufs_find_entry() local
211 bh = ufs_getfrag (dir, block, 0, &err); in ufs_find_entry()
212 bh_use[block] = bh; in ufs_find_entry()
213 if (bh && !buffer_uptodate(bh)) in ufs_find_entry()
214 bh_read[toread++] = bh; in ufs_find_entry()
218 struct buffer_head * bh; in ufs_find_entry() local
226 bh = bh_use[block % NAMEI_RA_SIZE]; in ufs_find_entry()
227 if (!bh) { in ufs_find_entry()
234 wait_on_buffer (bh); in ufs_find_entry()
235 if (!buffer_uptodate(bh)) { in ufs_find_entry()
242 de = (struct ufs_dir_entry *) bh->b_data; in ufs_find_entry()
243 dlimit = bh->b_data + sb->s_blocksize; in ufs_find_entry()
254 dir, de, bh, offset)) in ufs_find_entry()
257 if (bh_use[i] != bh) in ufs_find_entry()
260 *res_bh = bh; in ufs_find_entry()
271 brelse (bh); in ufs_find_entry()
274 bh = NULL; in ufs_find_entry()
276 bh = ufs_getfrag (dir, block + NAMEI_RA_SIZE, 0, &err); in ufs_find_entry()
277 bh_use[block % NAMEI_RA_SIZE] = bh; in ufs_find_entry()
278 if (bh && !buffer_uptodate(bh)) in ufs_find_entry()
279 bh_read[toread++] = bh; in ufs_find_entry()
289 struct ufs_dir_entry * de, struct buffer_head * bh, in ufs_check_dir_entry() argument
302 else if (((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize) in ufs_check_dir_entry()
321 struct buffer_head *bh = ufs_bread (dir, 0, 0, &err); in ufs_dotdot() local
324 if (bh) { in ufs_dotdot()
325 res = (struct ufs_dir_entry *) bh->b_data; in ufs_dotdot()
329 *p = bh; in ufs_dotdot()
336 struct buffer_head *bh; in ufs_inode_by_name() local
338 de = ufs_find_entry (dentry, &bh); in ufs_inode_by_name()
341 brelse(bh); in ufs_inode_by_name()
347 struct buffer_head *bh, struct inode *inode) in ufs_set_link() argument
351 mark_buffer_dirty(bh); in ufs_set_link()
353 ll_rw_block (WRITE, 1, &bh); in ufs_set_link()
354 wait_on_buffer(bh); in ufs_set_link()
356 brelse (bh); in ufs_set_link()
372 struct buffer_head * bh; in ufs_add_link() local
386 bh = ufs_bread (dir, 0, 0, &err); in ufs_add_link()
387 if (!bh) in ufs_add_link()
391 de = (struct ufs_dir_entry *) bh->b_data; in ufs_add_link()
393 if ((char *)de >= UFS_SECTOR_SIZE + bh->b_data) { in ufs_add_link()
399 brelse (bh); in ufs_add_link()
400 bh = ufs_bread (dir, offset >> sb->s_blocksize_bits, 1, &err); in ufs_add_link()
401 if (!bh) in ufs_add_link()
406 brelse(bh); in ufs_add_link()
409 de = (struct ufs_dir_entry *) (bh->b_data + fragoff); in ufs_add_link()
416 de = (struct ufs_dir_entry *) bh->b_data; in ufs_add_link()
419 if (!ufs_check_dir_entry ("ufs_add_entry", dir, de, bh, offset)) { in ufs_add_link()
420 brelse (bh); in ufs_add_link()
424 brelse (bh); in ufs_add_link()
452 mark_buffer_dirty(bh); in ufs_add_link()
454 ll_rw_block (WRITE, 1, &bh); in ufs_add_link()
455 wait_on_buffer (bh); in ufs_add_link()
457 brelse (bh); in ufs_add_link()
471 struct buffer_head * bh ) in ufs_delete_entry() argument
483 de = (struct ufs_dir_entry *) bh->b_data; in ufs_delete_entry()
490 while (i < bh->b_size) { in ufs_delete_entry()
491 if (!ufs_check_dir_entry ("ufs_delete_entry", inode, de, bh, i)) { in ufs_delete_entry()
492 brelse(bh); in ufs_delete_entry()
503 mark_buffer_dirty(bh); in ufs_delete_entry()
505 ll_rw_block(WRITE, 1, &bh); in ufs_delete_entry()
506 wait_on_buffer(bh); in ufs_delete_entry()
508 brelse(bh); in ufs_delete_entry()
521 brelse(bh); in ufs_delete_entry()
563 struct buffer_head * bh; in ufs_empty_dir() local
570 !(bh = ufs_bread (inode, 0, 0, &err))) { in ufs_empty_dir()
576 de = (struct ufs_dir_entry *) bh->b_data; in ufs_empty_dir()
590 if (!bh || (void *) de >= (void *) (bh->b_data + sb->s_blocksize)) { in ufs_empty_dir()
591 brelse (bh); in ufs_empty_dir()
592 bh = ufs_bread (inode, offset >> sb->s_blocksize_bits, 1, &err); in ufs_empty_dir()
593 if (!bh) { in ufs_empty_dir()
600 de = (struct ufs_dir_entry *) bh->b_data; in ufs_empty_dir()
602 if (!ufs_check_dir_entry ("empty_dir", inode, de, bh, offset)) { in ufs_empty_dir()
603 brelse (bh); in ufs_empty_dir()
607 brelse (bh); in ufs_empty_dir()
614 brelse (bh); in ufs_empty_dir()