| /linux/fs/ocfs2/ |
| H A D | buffer_head_io.c | 38 int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, in ocfs2_write_block() argument 43 trace_ocfs2_write_block((unsigned long long)bh->b_blocknr, ci); in ocfs2_write_block() 45 BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO); in ocfs2_write_block() 46 BUG_ON(buffer_jbd(bh)); in ocfs2_write_block() 59 lock_buffer(bh); in ocfs2_write_block() 60 set_buffer_uptodate(bh); in ocfs2_write_block() 63 clear_buffer_dirty(bh); in ocfs2_write_block() 65 get_bh(bh); /* for end_buffer_write_sync() */ in ocfs2_write_block() 66 bh->b_end_io = end_buffer_write_sync; in ocfs2_write_block() 67 submit_bh(REQ_OP_WRITE, bh); in ocfs2_write_block() [all …]
|
| H A D | inode.c | 62 struct buffer_head **bh, 65 struct buffer_head *bh); 67 struct buffer_head *bh); 485 struct buffer_head *bh = NULL; in ocfs2_read_locked_inode() local 573 &bh, OCFS2_BH_IGNORE_CACHE, 0); in ocfs2_read_locked_inode() 576 &bh, OCFS2_BH_IGNORE_CACHE, 1); in ocfs2_read_locked_inode() 579 &bh, OCFS2_BH_IGNORE_CACHE); in ocfs2_read_locked_inode() 581 status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh); in ocfs2_read_locked_inode() 586 if (!status && !buffer_jbd(bh)) { in ocfs2_read_locked_inode() 589 osb->sb, bh); in ocfs2_read_locked_inode() [all …]
|
| H A D | uptodate.c | 228 struct buffer_head *bh) in ocfs2_buffer_cached() argument 237 (unsigned long long) bh->b_blocknr, in ocfs2_buffer_cached() 241 index = ocfs2_search_cache_array(ci, bh->b_blocknr); in ocfs2_buffer_cached() 243 item = ocfs2_search_cache_tree(ci, bh->b_blocknr); in ocfs2_buffer_cached() 258 struct buffer_head *bh) in ocfs2_buffer_uptodate() argument 263 if (!buffer_uptodate(bh)) in ocfs2_buffer_uptodate() 268 if (buffer_jbd(bh)) in ocfs2_buffer_uptodate() 273 return ocfs2_buffer_cached(ci, bh); in ocfs2_buffer_uptodate() 281 struct buffer_head *bh) in ocfs2_buffer_read_ahead() argument 283 return buffer_locked(bh) && ocfs2_buffer_cached(ci, bh); in ocfs2_buffer_read_ahead() [all …]
|
| H A D | buffer_head_io.h | 16 struct buffer_head *bh, 31 struct buffer_head *bh)); 34 struct buffer_head *bh); 40 struct buffer_head **bh, in ocfs2_read_block() argument 42 struct buffer_head *bh)) in ocfs2_read_block() argument 46 if (bh == NULL) { in ocfs2_read_block() 52 status = ocfs2_read_blocks(ci, off, 1, bh, 0, validate); in ocfs2_read_block()
|
| /linux/fs/hpfs/ |
| H A D | buffer.c | 40 struct buffer_head *bh; in hpfs_prefetch_sectors() local 49 bh = sb_find_get_block(s, secno); in hpfs_prefetch_sectors() 50 if (bh) { in hpfs_prefetch_sectors() 51 if (buffer_uptodate(bh)) { in hpfs_prefetch_sectors() 52 brelse(bh); in hpfs_prefetch_sectors() 55 brelse(bh); in hpfs_prefetch_sectors() 74 struct buffer_head *bh; in hpfs_map_sector() local 82 *bhp = bh = sb_bread(s, hpfs_search_hotfix_map(s, secno)); in hpfs_map_sector() 83 if (bh != NULL) in hpfs_map_sector() 84 return bh->b_data; in hpfs_map_sector() [all …]
|
| H A D | anode.c | 16 struct buffer_head *bh) in hpfs_bplus_lookup() argument 28 brelse(bh); in hpfs_bplus_lookup() 29 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1; in hpfs_bplus_lookup() 34 brelse(bh); in hpfs_bplus_lookup() 42 brelse(bh); in hpfs_bplus_lookup() 51 brelse(bh); in hpfs_bplus_lookup() 55 brelse(bh); in hpfs_bplus_lookup() 68 struct buffer_head *bh, *bh1, *bh2; in hpfs_add_sector_to_btree() local 74 if (!(fnode = hpfs_map_fnode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree() 77 if (!(anode = hpfs_map_anode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree() [all …]
|
| /linux/fs/ext4/ |
| H A D | page-io.c | 93 static void buffer_io_error(struct buffer_head *bh) in buffer_io_error() argument 96 bh->b_bdev, in buffer_io_error() 97 (unsigned long long)bh->b_blocknr); in buffer_io_error() 107 struct buffer_head *bh, *head; in ext4_finish_bio() local 122 bh = head = folio_buffers(folio); in ext4_finish_bio() 129 if (bh_offset(bh) < bio_start || in ext4_finish_bio() 130 bh_offset(bh) + bh->b_size > bio_end) { in ext4_finish_bio() 131 if (buffer_async_write(bh)) in ext4_finish_bio() 135 clear_buffer_async_write(bh); in ext4_finish_bio() 137 set_buffer_write_io_error(bh); in ext4_finish_bio() [all …]
|
| H A D | mmp.c | 43 struct buffer_head *bh) in write_mmp_block_thawed() argument 45 struct mmp_struct *mmp = (struct mmp_struct *)(bh->b_data); in write_mmp_block_thawed() 48 lock_buffer(bh); in write_mmp_block_thawed() 49 bh->b_end_io = end_buffer_write_sync; in write_mmp_block_thawed() 50 get_bh(bh); in write_mmp_block_thawed() 51 submit_bh(REQ_OP_WRITE | REQ_SYNC | REQ_META | REQ_PRIO, bh); in write_mmp_block_thawed() 52 wait_on_buffer(bh); in write_mmp_block_thawed() 53 if (unlikely(!buffer_uptodate(bh))) in write_mmp_block_thawed() 58 static int write_mmp_block(struct super_block *sb, struct buffer_head *bh) in write_mmp_block() argument 65 return write_mmp_block_thawed(sb, bh); in write_mmp_block() [all …]
|
| H A D | inode.c | 869 static void ext4_update_bh_state(struct buffer_head *bh, unsigned long flags) in ext4_update_bh_state() argument 877 if (!bh->b_folio) { in ext4_update_bh_state() 878 bh->b_state = (bh->b_state & ~EXT4_MAP_FLAGS) | flags; in ext4_update_bh_state() 886 old_state = READ_ONCE(bh->b_state); in ext4_update_bh_state() 889 } while (unlikely(!try_cmpxchg(&bh->b_state, &old_state, new_state))); in ext4_update_bh_state() 913 struct buffer_head *bh, int flags) in _ext4_get_block() argument 922 map.m_len = bh->b_size >> inode->i_blkbits; in _ext4_get_block() 927 map_bh(bh, inode->i_sb, map.m_pblk); in _ext4_get_block() 928 ext4_update_bh_state(bh, map.m_flags); in _ext4_get_block() 929 bh->b_size = inode->i_sb->s_blocksize * map.m_len; in _ext4_get_block() [all …]
|
| /linux/fs/minix/ |
| H A D | bitmap.c | 46 struct buffer_head *bh; in minix_free_block() local 61 bh = sbi->s_zmap[zone]; in minix_free_block() 63 if (!minix_test_and_clear_bit(bit, bh->b_data)) in minix_free_block() 67 mark_buffer_dirty(bh); in minix_free_block() 78 struct buffer_head *bh = sbi->s_zmap[i]; in minix_new_block() local 82 j = minix_find_first_zero_bit(bh->b_data, bits_per_zone); in minix_new_block() 84 minix_set_bit(j, bh->b_data); in minix_new_block() 86 mark_buffer_dirty(bh); in minix_new_block() 107 minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh) in minix_V1_raw_inode() argument 121 *bh = sb_bread(sb, block); in minix_V1_raw_inode() [all …]
|
| /linux/fs/qnx4/ |
| H A D | namei.c | 27 struct buffer_head *bh, unsigned long *offset) in qnx4_match() argument 33 if (bh == NULL) { in qnx4_match() 37 de = (union qnx4_directory_entry *) (bh->b_data + *offset); in qnx4_match() 54 struct buffer_head *bh; in qnx4_find_entry() local 57 bh = NULL; in qnx4_find_entry() 60 if (!bh) { in qnx4_find_entry() 63 bh = sb_bread(dir->i_sb, block); in qnx4_find_entry() 64 if (!bh) { in qnx4_find_entry() 69 *res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset); in qnx4_find_entry() 70 if (qnx4_match(len, name, bh, &offset)) { in qnx4_find_entry() [all …]
|
| /linux/fs/gfs2/ |
| H A D | dir.c | 93 struct buffer_head *bh; in gfs2_dir_get_new_buffer() local 95 bh = gfs2_meta_new(ip->i_gl, block); in gfs2_dir_get_new_buffer() 96 gfs2_trans_add_meta(ip->i_gl, bh); in gfs2_dir_get_new_buffer() 97 gfs2_metatype_set(bh, GFS2_METATYPE_JD, GFS2_FORMAT_JD); in gfs2_dir_get_new_buffer() 98 gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header)); in gfs2_dir_get_new_buffer() 99 *bhp = bh; in gfs2_dir_get_new_buffer() 106 struct buffer_head *bh; in gfs2_dir_get_existing_buffer() local 109 error = gfs2_meta_read(ip->i_gl, block, DIO_WAIT, 0, &bh); in gfs2_dir_get_existing_buffer() 112 if (gfs2_metatype_check(GFS2_SB(&ip->i_inode), bh, GFS2_METATYPE_JD)) { in gfs2_dir_get_existing_buffer() 113 brelse(bh); in gfs2_dir_get_existing_buffer() [all …]
|
| H A D | xattr.c | 84 typedef int (*ea_call_t) (struct gfs2_inode *ip, struct buffer_head *bh, 88 static int ea_foreach_i(struct gfs2_inode *ip, struct buffer_head *bh, in ea_foreach_i() argument 95 if (gfs2_metatype_check(GFS2_SB(&ip->i_inode), bh, GFS2_METATYPE_EA)) in ea_foreach_i() 98 for (ea = GFS2_EA_BH2FIRST(bh);; prev = ea, ea = GFS2_EA2NEXT(ea)) { in ea_foreach_i() 103 if (!(bh->b_data <= (char *)ea && (char *)GFS2_EA2NEXT(ea) <= in ea_foreach_i() 104 bh->b_data + bh->b_size)) { in ea_foreach_i() 112 error = ea_call(ip, bh, ea, prev, data); in ea_foreach_i() 118 bh->b_data + bh->b_size) { in ea_foreach_i() 131 struct buffer_head *bh, *eabh; in ea_foreach() local 135 error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, 0, &bh); in ea_foreach() [all …]
|
| H A D | recovery.c | 33 struct buffer_head **bh) in gfs2_replay_read_block() argument 50 *bh = gfs2_meta_ra(gl, dblock, extlen); in gfs2_replay_read_block() 170 struct buffer_head *bh; in get_log_header() local 173 error = gfs2_replay_read_block(jd, blk, &bh); in get_log_header() 177 error = __get_log_header(sdp, (const struct gfs2_log_header *)bh->b_data, in get_log_header() 179 brelse(bh); in get_log_header() 201 struct buffer_head *bh; in foreach_descriptor() local 211 error = gfs2_replay_read_block(jd, start, &bh); in foreach_descriptor() 214 if (gfs2_meta_check(sdp, bh)) { in foreach_descriptor() 215 brelse(bh); in foreach_descriptor() [all …]
|
| /linux/fs/isofs/ |
| H A D | namei.c | 36 struct buffer_head *bh = NULL; in isofs_find_entry() local 51 if (!bh) { in isofs_find_entry() 52 bh = isofs_bread(dir, block); in isofs_find_entry() 53 if (!bh) in isofs_find_entry() 57 de = (struct iso_directory_record *) (bh->b_data + offset); in isofs_find_entry() 61 brelse(bh); in isofs_find_entry() 62 bh = NULL; in isofs_find_entry() 69 block_saved = bh->b_blocknr; in isofs_find_entry() 80 brelse(bh); in isofs_find_entry() 81 bh = NULL; in isofs_find_entry() [all …]
|
| /linux/fs/romfs/ |
| H A D | storage.c | 106 struct buffer_head *bh; in romfs_blk_read() local 114 bh = sb_bread(sb, pos >> ROMBSBITS); in romfs_blk_read() 115 if (!bh) in romfs_blk_read() 117 memcpy(buf, bh->b_data + offset, segment); in romfs_blk_read() 118 brelse(bh); in romfs_blk_read() 133 struct buffer_head *bh; in romfs_blk_strnlen() local 143 bh = sb_bread(sb, pos >> ROMBSBITS); in romfs_blk_strnlen() 144 if (!bh) in romfs_blk_strnlen() 146 buf = bh->b_data + offset; in romfs_blk_strnlen() 148 brelse(bh); in romfs_blk_strnlen() [all …]
|
| /linux/fs/omfs/ |
| H A D | bitmap.c | 53 struct buffer_head *bh; in set_run() local 57 bh = sb_bread(sb, clus_to_blk(sbi, sbi->s_bitmap_ino) + map); in set_run() 58 if (!bh) in set_run() 66 mark_buffer_dirty(bh); in set_run() 67 brelse(bh); in set_run() 68 bh = sb_bread(sb, in set_run() 70 if (!bh) in set_run() 75 set_bit(bit, (unsigned long *)bh->b_data); in set_run() 78 clear_bit(bit, (unsigned long *)bh->b_data); in set_run() 81 mark_buffer_dirty(bh); in set_run() [all …]
|
| /linux/drivers/usb/gadget/function/ |
| H A D | f_mass_storage.c | 334 struct fsg_buffhd *bh, unsigned int length) in set_bulk_out_req_length() argument 338 bh->bulk_out_intended_length = length; in set_bulk_out_req_length() 342 bh->outreq->length = length; in set_bulk_out_req_length() 418 struct fsg_buffhd *bh = req->context; in bulk_in_complete() local 427 smp_store_release(&bh->state, BUF_STATE_EMPTY); in bulk_in_complete() 434 struct fsg_buffhd *bh = req->context; in bulk_out_complete() local 437 if (req->status || req->actual != bh->bulk_out_intended_length) in bulk_out_complete() 439 req->status, req->actual, bh->bulk_out_intended_length); in bulk_out_complete() 444 smp_store_release(&bh->state, BUF_STATE_FULL); in bulk_out_complete() 547 static bool start_in_transfer(struct fsg_common *common, struct fsg_buffhd *bh) in start_in_transfer() argument [all …]
|
| /linux/fs/efs/ |
| H A D | symlink.c | 18 struct buffer_head *bh; in efs_symlink_read_folio() local 29 bh = sb_bread(inode->i_sb, efs_bmap(inode, 0)); in efs_symlink_read_folio() 30 if (!bh) in efs_symlink_read_folio() 32 memcpy(link, bh->b_data, (size > EFS_BLOCKSIZE) ? EFS_BLOCKSIZE : size); in efs_symlink_read_folio() 33 brelse(bh); in efs_symlink_read_folio() 35 bh = sb_bread(inode->i_sb, efs_bmap(inode, 1)); in efs_symlink_read_folio() 36 if (!bh) in efs_symlink_read_folio() 38 memcpy(link + EFS_BLOCKSIZE, bh->b_data, size - EFS_BLOCKSIZE); in efs_symlink_read_folio() 39 brelse(bh); in efs_symlink_read_folio()
|
| /linux/fs/udf/ |
| H A D | inode.c | 75 brelse(iinfo->cached_extent.epos.bh); in __udf_clear_extent_cache() 104 if (pos->bh) in udf_read_extent_cache() 105 get_bh(pos->bh); in udf_read_extent_cache() 121 if (pos->bh) in udf_update_extent_cache() 122 get_bh(pos->bh); in udf_update_extent_cache() 440 brelse(epos.bh); in udf_map_block() 685 if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) || in udf_extend_file() 686 (epos.bh && epos.offset == sizeof(struct allocExtDesc))) { in udf_extend_file() 718 brelse(epos.bh); in udf_extend_file() 743 prev_epos.bh = NULL; in inode_getblk() [all …]
|
| /linux/fs/ntfs3/ |
| H A D | bitmap.c | 509 struct buffer_head *bh = NULL; in wnd_rescan() local 571 bh = ntfs_bread(sb, lbo >> sb->s_blocksize_bits); in wnd_rescan() 572 if (!bh) { in wnd_rescan() 577 used = ntfs_bitmap_weight_le(bh->b_data, wbits); in wnd_rescan() 591 used = find_next_zero_bit_le(bh->b_data, wbits, wpos); in wnd_rescan() 607 frb = find_next_bit_le(bh->b_data, wbits, wpos); in wnd_rescan() 625 if (bh) in wnd_rescan() 626 put_bh(bh); in wnd_rescan() 627 bh = NULL; in wnd_rescan() 703 struct buffer_head *bh; in wnd_map() local [all …]
|
| /linux/fs/jbd2/ |
| H A D | checkpoint.c | 138 struct buffer_head *bh = journal->j_chkpt_bhs[i]; in __flush_batch() local 139 BUFFER_TRACE(bh, "brelse"); in __flush_batch() 140 __brelse(bh); in __flush_batch() 157 struct buffer_head *bh; in jbd2_log_do_checkpoint() local 199 bh = jh2bh(jh); in jbd2_log_do_checkpoint() 216 journal->j_devname, (unsigned long long) bh->b_blocknr); in jbd2_log_do_checkpoint() 235 if (!trylock_buffer(bh)) { in jbd2_log_do_checkpoint() 242 get_bh(bh); in jbd2_log_do_checkpoint() 244 wait_on_buffer(bh); in jbd2_log_do_checkpoint() 246 BUFFER_TRACE(bh, "brelse"); in jbd2_log_do_checkpoint() [all …]
|
| /linux/fs/nilfs2/ |
| H A D | segbuf.h | 99 #define NILFS_SEGBUF_NEXT_BH(bh) \ argument 100 (list_entry((bh)->b_assoc_buffers.next, struct buffer_head, \ 102 #define NILFS_SEGBUF_BH_IS_LAST(bh, head) ((bh)->b_assoc_buffers.next == head) argument 136 struct buffer_head *bh) in nilfs_segbuf_add_segsum_buffer() argument 138 list_add_tail(&bh->b_assoc_buffers, &segbuf->sb_segsum_buffers); in nilfs_segbuf_add_segsum_buffer() 145 struct buffer_head *bh) in nilfs_segbuf_add_payload_buffer() argument 147 list_add_tail(&bh->b_assoc_buffers, &segbuf->sb_payload_buffers); in nilfs_segbuf_add_payload_buffer() 153 struct buffer_head *bh) in nilfs_segbuf_add_file_buffer() argument 155 get_bh(bh); in nilfs_segbuf_add_file_buffer() 156 nilfs_segbuf_add_payload_buffer(segbuf, bh); in nilfs_segbuf_add_file_buffer()
|
| /linux/fs/ |
| H A D | mpage.c | 96 static void map_buffer_to_folio(struct folio *folio, struct buffer_head *bh, in map_buffer_to_folio() argument 110 buffer_uptodate(bh)) { in map_buffer_to_folio() 120 page_bh->b_state = bh->b_state; in map_buffer_to_folio() 121 page_bh->b_bdev = bh->b_bdev; in map_buffer_to_folio() 122 page_bh->b_blocknr = bh->b_blocknr; in map_buffer_to_folio() 431 struct buffer_head *bh, *head = folio_buffers(folio); in clean_buffers() local 435 bh = head; in clean_buffers() 440 clear_buffer_dirty(bh); in clean_buffers() 441 bh = bh->b_this_page; in clean_buffers() 442 } while (bh != head); in clean_buffers() [all …]
|
| /linux/fs/hfs/ |
| H A D | part_tbl.c | 61 struct buffer_head *bh; in hfs_part_find() local 66 bh = sb_bread512(sb, *part_start + HFS_PMAP_BLK, data); in hfs_part_find() 67 if (!bh) in hfs_part_find() 76 pm = (struct old_pmap *)bh->b_data; in hfs_part_find() 94 pm = (struct new_pmap *)bh->b_data; in hfs_part_find() 104 brelse(bh); in hfs_part_find() 105 bh = sb_bread512(sb, *part_start + HFS_PMAP_BLK + ++i, pm); in hfs_part_find() 106 if (!bh) in hfs_part_find() 114 brelse(bh); in hfs_part_find()
|