| /linux/fs/ |
| H A D | buffer.c | 59 inline void touch_buffer(struct buffer_head *bh) in touch_buffer() argument 61 trace_block_touch_buffer(bh); in touch_buffer() 62 folio_mark_accessed(bh->b_folio); in touch_buffer() 66 void __lock_buffer(struct buffer_head *bh) in __lock_buffer() argument 68 wait_on_bit_lock_io(&bh->b_state, BH_Lock, TASK_UNINTERRUPTIBLE); in __lock_buffer() 72 void unlock_buffer(struct buffer_head *bh) in unlock_buffer() argument 74 clear_and_wake_up_bit(BH_Lock, &bh->b_state); in unlock_buffer() 86 struct buffer_head *head, *bh; in buffer_check_dirty_writeback() local 99 bh = head; in buffer_check_dirty_writeback() 101 if (buffer_locked(bh)) in buffer_check_dirty_writeback() [all …]
|
| 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/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/ext2/ |
| H A D | xattr.c | 69 #define HDR(bh) ((struct ext2_xattr_header *)((bh)->b_data)) argument 71 #define FIRST_ENTRY(bh) ENTRY(HDR(bh)+1) argument 81 # define ea_bdebug(bh, f...) do { \ argument 83 bh->b_bdev, (unsigned long) bh->b_blocknr); \ 89 # define ea_bdebug(bh, f...) no_printk(f) argument 199 struct buffer_head *bh = NULL; in ext2_xattr_get() local 220 bh = sb_bread(inode->i_sb, EXT2_I(inode)->i_file_acl); in ext2_xattr_get() 222 if (!bh) in ext2_xattr_get() 224 ea_bdebug(bh, "b_count=%d, refcount=%d", in ext2_xattr_get() 225 atomic_read(&(bh->b_count)), le32_to_cpu(HDR(bh)->h_refcount)); in ext2_xattr_get() [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/ext4/ |
| H A D | ext4_jbd2.c | 194 struct buffer_head *bh, in ext4_journal_abort_handle() argument 202 if (bh) in ext4_journal_abort_handle() 203 BUFFER_TRACE(bh, "abort"); in ext4_journal_abort_handle() 241 struct buffer_head *bh, in __ext4_journal_get_write_access() argument 249 err = jbd2_journal_get_write_access(handle, bh); in __ext4_journal_get_write_access() 251 ext4_journal_abort_handle(where, line, __func__, bh, in __ext4_journal_get_write_access() 261 jbd2_journal_set_triggers(bh, in __ext4_journal_get_write_access() 277 struct buffer_head *bh, ext4_fsblk_t blocknr) in __ext4_forget() argument 284 BUFFER_TRACE(bh, "enter"); in __ext4_forget() 287 bh, is_metadata, inode->i_mode, in __ext4_forget() [all …]
|
| H A D | namei.c | 58 struct buffer_head *bh; in ext4_append() local 83 bh = ext4_bread(handle, inode, *block, EXT4_GET_BLOCKS_CREATE); in ext4_append() 84 if (IS_ERR(bh)) in ext4_append() 85 return bh; in ext4_append() 91 BUFFER_TRACE(bh, "get_write_access"); in ext4_append() 92 err = ext4_journal_get_write_access(handle, inode->i_sb, bh, in ext4_append() 96 return bh; in ext4_append() 99 brelse(bh); in ext4_append() 130 struct buffer_head *bh; in __ext4_read_dirblock() local 142 bh = ERR_PTR(-EIO); in __ext4_read_dirblock() [all …]
|
| H A D | xattr.c | 69 # define ea_bdebug(bh, fmt, ...) \ argument 71 bh->b_bdev, (unsigned long)bh->b_blocknr, ##__VA_ARGS__) 74 # define ea_bdebug(bh, fmt, ...) no_printk(fmt, ##__VA_ARGS__) argument 150 struct buffer_head *bh) in ext4_xattr_block_csum_verify() argument 152 struct ext4_xattr_header *hdr = BHDR(bh); in ext4_xattr_block_csum_verify() 156 lock_buffer(bh); in ext4_xattr_block_csum_verify() 158 bh->b_blocknr, hdr)); in ext4_xattr_block_csum_verify() 159 unlock_buffer(bh); in ext4_xattr_block_csum_verify() 165 struct buffer_head *bh) in ext4_xattr_block_csum_set() argument 168 BHDR(bh)->h_checksum = ext4_xattr_block_csum(inode, in ext4_xattr_block_csum_set() [all …]
|
| H A D | balloc.c | 183 struct buffer_head *bh, in ext4_init_block_bitmap() argument 191 ASSERT(buffer_locked(bh)); in ext4_init_block_bitmap() 199 memset(bh->b_data, 0, sb->s_blocksize); in ext4_init_block_bitmap() 202 if ((bit_max >> 3) >= bh->b_size) in ext4_init_block_bitmap() 206 ext4_set_bit(bit, bh->b_data); in ext4_init_block_bitmap() 213 ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); in ext4_init_block_bitmap() 217 ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); in ext4_init_block_bitmap() 223 ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); in ext4_init_block_bitmap() 232 sb->s_blocksize * 8, bh->b_data); in ext4_init_block_bitmap() 267 struct buffer_head **bh) in ext4_get_group_desc() argument [all …]
|
| H A D | migrate.c | 94 struct buffer_head *bh; in update_ind_extent_range() local 99 bh = ext4_sb_bread(inode->i_sb, pblock, 0); in update_ind_extent_range() 100 if (IS_ERR(bh)) in update_ind_extent_range() 101 return PTR_ERR(bh); in update_ind_extent_range() 103 i_data = (__le32 *)bh->b_data; in update_ind_extent_range() 114 put_bh(bh); in update_ind_extent_range() 123 struct buffer_head *bh; in update_dind_extent_range() local 128 bh = ext4_sb_bread(inode->i_sb, pblock, 0); in update_dind_extent_range() 129 if (IS_ERR(bh)) in update_dind_extent_range() 130 return PTR_ERR(bh); in update_dind_extent_range() [all …]
|
| H A D | inode.c | 868 static void ext4_update_bh_state(struct buffer_head *bh, unsigned long flags) in ext4_update_bh_state() argument 876 if (!bh->b_folio) { in ext4_update_bh_state() 877 bh->b_state = (bh->b_state & ~EXT4_MAP_FLAGS) | flags; in ext4_update_bh_state() 885 old_state = READ_ONCE(bh->b_state); in ext4_update_bh_state() 888 } while (unlikely(!try_cmpxchg(&bh->b_state, &old_state, new_state))); in ext4_update_bh_state() 912 struct buffer_head *bh, int flags) in _ext4_get_block() argument 921 map.m_len = bh->b_size >> inode->i_blkbits; in _ext4_get_block() 926 map_bh(bh, inode->i_sb, map.m_pblk); in _ext4_get_block() 927 ext4_update_bh_state(bh, map.m_flags); in _ext4_get_block() 928 bh->b_size = inode->i_sb->s_blocksize * map.m_len; in _ext4_get_block() [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/udf/ |
| H A D | balloc.c | 35 struct buffer_head *bh = NULL; in read_block_bitmap() local 43 bh = sb_bread(sb, udf_get_lb_pblock(sb, &loc, block)); in read_block_bitmap() 44 bitmap->s_block_bitmap[bitmap_nr] = bh; in read_block_bitmap() 45 if (!bh) in read_block_bitmap() 68 if (udf_test_bit(i + off, bh->b_data)) { in read_block_bitmap() 71 brelse(bh); in read_block_bitmap() 127 struct buffer_head *bh = NULL; in udf_bitmap_free_blocks() local 155 bh = bitmap->s_block_bitmap[bitmap_nr]; in udf_bitmap_free_blocks() 157 if (udf_set_bit(bit + i, bh->b_data)) { in udf_bitmap_free_blocks() 160 ((__u8 *)bh->b_data)[(bit + i) >> 3]); in udf_bitmap_free_blocks() [all …]
|
| H A D | inode.c | 73 brelse(iinfo->cached_extent.epos.bh); in __udf_clear_extent_cache() 102 if (pos->bh) in udf_read_extent_cache() 103 get_bh(pos->bh); in udf_read_extent_cache() 119 if (pos->bh) in udf_update_extent_cache() 120 get_bh(pos->bh); in udf_update_extent_cache() 379 brelse(epos.bh); in udf_map_block() 694 if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) || in udf_extend_file() 695 (epos.bh && epos.offset == sizeof(struct allocExtDesc))) { in udf_extend_file() 727 brelse(epos.bh); in udf_extend_file() 752 prev_epos.bh = NULL; in inode_getblk() [all …]
|
| H A D | truncate.c | 120 brelse(epos.bh); in udf_truncate_tail_extent() 149 brelse(prev_epos.bh); in udf_discard_prealloc() 151 if (prev_epos.bh) in udf_discard_prealloc() 152 get_bh(prev_epos.bh); in udf_discard_prealloc() 170 brelse(epos.bh); in udf_discard_prealloc() 171 brelse(prev_epos.bh); in udf_discard_prealloc() 181 struct allocExtDesc *aed = (struct allocExtDesc *) (epos->bh->b_data); in udf_update_alloc_ext_desc() 188 udf_update_tag(epos->bh->b_data, len); in udf_update_alloc_ext_desc() 189 mmb_mark_buffer_dirty(epos->bh, &UDF_I(inode)->i_metadata_bhs); in udf_update_alloc_ext_desc() 235 if (!epos.bh) in udf_truncate_extents() [all …]
|
| H A D | super.c | 745 struct buffer_head *bh = NULL; in udf_check_vsd() local 774 bh = sb_bread(sb, sector >> sb->s_blocksize_bits); in udf_check_vsd() 775 if (!bh) in udf_check_vsd() 778 vsd = (struct volStructDesc *)(bh->b_data + in udf_check_vsd() 783 brelse(bh); in udf_check_vsd() 797 brelse(bh); in udf_check_vsd() 802 else if (!bh && sector - session_offset == VSD_FIRST_SECTOR_OFFSET) in udf_check_vsd() 861 struct buffer_head *bh; in udf_find_fileset() local 869 bh = udf_read_ptagged(sb, fileset, 0, &ident); in udf_find_fileset() 870 if (!bh) in udf_find_fileset() [all …]
|
| /linux/fs/fat/ |
| H A D | dir.c | 44 struct buffer_head *bh, in fat_make_i_pos() argument 47 return ((loff_t)bh->b_blocknr << MSDOS_SB(sb)->dir_per_block_bits) in fat_make_i_pos() 48 | (de - (struct msdos_dir_entry *)bh->b_data); in fat_make_i_pos() 56 struct buffer_head *bh; in fat_dir_readahead() local 66 bh = sb_find_get_block(sb, phys); in fat_dir_readahead() 67 if (bh == NULL || !buffer_uptodate(bh)) { in fat_dir_readahead() 71 brelse(bh); in fat_dir_readahead() 85 struct buffer_head **bh, struct msdos_dir_entry **de) in fat__get_entry() argument 93 brelse(*bh); in fat__get_entry() 94 *bh = NULL; in fat__get_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 | 333 struct fsg_buffhd *bh, unsigned int length) in set_bulk_out_req_length() argument 337 bh->bulk_out_intended_length = length; in set_bulk_out_req_length() 341 bh->outreq->length = length; in set_bulk_out_req_length() 417 struct fsg_buffhd *bh = req->context; in bulk_in_complete() local 426 smp_store_release(&bh->state, BUF_STATE_EMPTY); in bulk_in_complete() 433 struct fsg_buffhd *bh = req->context; in bulk_out_complete() local 436 if (req->status || req->actual != bh->bulk_out_intended_length) in bulk_out_complete() 438 req->status, req->actual, bh->bulk_out_intended_length); in bulk_out_complete() 443 smp_store_release(&bh->state, BUF_STATE_FULL); in bulk_out_complete() 546 static bool start_in_transfer(struct fsg_common *common, struct fsg_buffhd *bh) in start_in_transfer() argument [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/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()
|
| /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()
|