| /linux/fs/ |
| H A D | buffer.c | 57 static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, 62 inline void touch_buffer(struct buffer_head *bh) in touch_buffer() argument 64 trace_block_touch_buffer(bh); in touch_buffer() 65 folio_mark_accessed(bh->b_folio); in touch_buffer() 69 void __lock_buffer(struct buffer_head *bh) in __lock_buffer() argument 71 wait_on_bit_lock_io(&bh->b_state, BH_Lock, TASK_UNINTERRUPTIBLE); in __lock_buffer() 75 void unlock_buffer(struct buffer_head *bh) in unlock_buffer() argument 77 clear_bit_unlock(BH_Lock, &bh->b_state); in unlock_buffer() 79 wake_up_bit(&bh->b_state, BH_Lock); in unlock_buffer() 91 struct buffer_head *head, *bh; in buffer_check_dirty_writeback() local [all …]
|
| /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 …]
|
| /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/include/linux/ |
| H A D | buffer_head.h | 49 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); 91 static __always_inline void set_buffer_##name(struct buffer_head *bh) \ 93 if (!test_bit(BH_##bit, &(bh)->b_state)) \ 94 set_bit(BH_##bit, &(bh)->b_state); \ 96 static __always_inline void clear_buffer_##name(struct buffer_head *bh) \ 98 clear_bit(BH_##bit, &(bh)->b_state); \ 100 static __always_inline int buffer_##name(const struct buffer_head *bh) \ 102 return test_bit(BH_##bit, &(bh)->b_state); \ 109 static __always_inline int test_set_buffer_##name(struct buffer_head *bh) \ 111 return test_and_set_bit(BH_##bit, &(bh)->b_state); \ [all …]
|
| /linux/fs/nilfs2/ |
| H A D | page.c | 34 struct buffer_head *bh = folio_buffers(folio); in __nilfs_get_folio_block() local 36 if (!bh) in __nilfs_get_folio_block() 37 bh = create_empty_buffers(folio, 1 << blkbits, b_state); in __nilfs_get_folio_block() 40 bh = get_nth_bh(bh, block - first_block); in __nilfs_get_folio_block() 42 wait_on_buffer(bh); in __nilfs_get_folio_block() 43 return bh; in __nilfs_get_folio_block() 54 struct buffer_head *bh; in nilfs_grab_buffer() local 60 bh = __nilfs_get_folio_block(folio, blkoff, index, blkbits, b_state); in nilfs_grab_buffer() 61 if (unlikely(!bh)) { in nilfs_grab_buffer() 66 bh->b_bdev = inode->i_sb->s_bdev; in nilfs_grab_buffer() [all …]
|
| H A D | gcinode.c | 59 struct buffer_head *bh; in nilfs_gccache_submit_read_data() local 62 bh = nilfs_grab_buffer(inode, inode->i_mapping, blkoff, 0); in nilfs_gccache_submit_read_data() 63 if (unlikely(!bh)) in nilfs_gccache_submit_read_data() 66 if (buffer_uptodate(bh)) in nilfs_gccache_submit_read_data() 77 lock_buffer(bh); in nilfs_gccache_submit_read_data() 78 if (buffer_uptodate(bh)) { in nilfs_gccache_submit_read_data() 79 unlock_buffer(bh); in nilfs_gccache_submit_read_data() 83 if (!buffer_mapped(bh)) in nilfs_gccache_submit_read_data() 84 set_buffer_mapped(bh); in nilfs_gccache_submit_read_data() 85 bh->b_blocknr = pbn; in nilfs_gccache_submit_read_data() [all …]
|
| H A D | btnode.c | 51 struct buffer_head *bh; in nilfs_btnode_create_block() local 53 bh = nilfs_grab_buffer(inode, btnc, blocknr, BIT(BH_NILFS_Node)); in nilfs_btnode_create_block() 54 if (unlikely(!bh)) in nilfs_btnode_create_block() 57 if (unlikely(buffer_mapped(bh) || buffer_uptodate(bh) || in nilfs_btnode_create_block() 58 buffer_dirty(bh))) { in nilfs_btnode_create_block() 71 memset(bh->b_data, 0, i_blocksize(inode)); in nilfs_btnode_create_block() 72 bh->b_blocknr = blocknr; in nilfs_btnode_create_block() 73 set_buffer_mapped(bh); in nilfs_btnode_create_block() 74 set_buffer_uptodate(bh); in nilfs_btnode_create_block() 76 folio_unlock(bh->b_folio); in nilfs_btnode_create_block() [all …]
|
| H A D | mdt.c | 31 struct buffer_head *bh, in nilfs_mdt_insert_new_block() argument 36 struct folio *folio = bh->b_folio; in nilfs_mdt_insert_new_block() 43 bh->b_blocknr = 0; in nilfs_mdt_insert_new_block() 45 ret = nilfs_bmap_insert(ii->i_bmap, block, (unsigned long)bh); in nilfs_mdt_insert_new_block() 49 set_buffer_mapped(bh); in nilfs_mdt_insert_new_block() 52 from = kmap_local_folio(folio, offset_in_folio(folio, bh->b_data)); in nilfs_mdt_insert_new_block() 53 memset(from, 0, bh->b_size); in nilfs_mdt_insert_new_block() 55 init_block(inode, bh, from); in nilfs_mdt_insert_new_block() 60 set_buffer_uptodate(bh); in nilfs_mdt_insert_new_block() 61 mark_buffer_dirty(bh); in nilfs_mdt_insert_new_block() [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/affs/ |
| H A D | file.c | 53 struct buffer_head *bh; in affs_grow_extcache() local 102 bh = affs_bread(sb, key); in affs_grow_extcache() 103 if (!bh) in affs_grow_extcache() 105 key = be32_to_cpu(AFFS_TAIL(sb, bh)->extension); in affs_grow_extcache() 106 affs_brelse(bh); in affs_grow_extcache() 120 affs_alloc_extblock(struct inode *inode, struct buffer_head *bh, u32 ext) in affs_alloc_extblock() argument 126 blocknr = affs_alloc_block(inode, bh->b_blocknr); in affs_alloc_extblock() 144 tmp = be32_to_cpu(AFFS_TAIL(sb, bh)->extension); in affs_alloc_extblock() 147 AFFS_TAIL(sb, bh)->extension = cpu_to_be32(blocknr); in affs_alloc_extblock() 148 affs_adjust_checksum(bh, blocknr - tmp); in affs_alloc_extblock() [all …]
|
| H A D | amigaffs.c | 26 affs_insert_hash(struct inode *dir, struct buffer_head *bh) in affs_insert_hash() argument 33 ino = bh->b_blocknr; in affs_insert_hash() 34 offset = affs_hash_name(sb, AFFS_TAIL(sb, bh)->name + 1, AFFS_TAIL(sb, bh)->name[0]); in affs_insert_hash() 50 AFFS_TAIL(sb, bh)->parent = cpu_to_be32(dir->i_ino); in affs_insert_hash() 51 AFFS_TAIL(sb, bh)->hash_chain = 0; in affs_insert_hash() 52 affs_fix_checksum(sb, bh); in affs_insert_hash() 78 struct buffer_head *bh; in affs_remove_hash() local 89 bh = affs_bread(sb, dir->i_ino); in affs_remove_hash() 90 if (!bh) in affs_remove_hash() 94 hash_ino = be32_to_cpu(AFFS_HEAD(bh)->table[offset]); in affs_remove_hash() [all …]
|
| H A D | bitmap.c | 43 struct buffer_head *bh; in affs_free_block() local 59 bh = sbi->s_bmap_bh; in affs_free_block() 61 affs_brelse(bh); in affs_free_block() 62 bh = affs_bread(sb, bm->bm_key); in affs_free_block() 63 if (!bh) in affs_free_block() 65 sbi->s_bmap_bh = bh; in affs_free_block() 70 data = (__be32 *)bh->b_data + bit / 32 + 1; in affs_free_block() 79 tmp = be32_to_cpu(*(__be32 *)bh->b_data); in affs_free_block() 80 *(__be32 *)bh->b_data = cpu_to_be32(tmp - mask); in affs_free_block() 82 mark_buffer_dirty(bh); in affs_free_block() [all …]
|
| H A D | inode.c | 21 struct buffer_head *bh; in affs_iget() local 38 bh = affs_bread(sb, block); in affs_iget() 39 if (!bh) { in affs_iget() 43 if (affs_checksum_block(sb, bh) || be32_to_cpu(AFFS_HEAD(bh)->ptype) != T_SHORT) { in affs_iget() 46 AFFS_HEAD(bh)->ptype, block); in affs_iget() 50 tail = AFFS_TAIL(sb, bh); in affs_iget() 144 inode->i_size = strlen((char *)AFFS_HEAD(bh)->table); in affs_iget() 155 affs_brelse(bh); in affs_iget() 160 affs_brelse(bh); in affs_iget() 169 struct buffer_head *bh; in affs_write_inode() local [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 | symlink.c | 30 struct buffer_head *bh = NULL; in ext4_encrypted_get_link() local 42 bh = ext4_bread(NULL, inode, 0, 0); in ext4_encrypted_get_link() 43 if (IS_ERR(bh)) in ext4_encrypted_get_link() 44 return ERR_CAST(bh); in ext4_encrypted_get_link() 45 if (!bh) { in ext4_encrypted_get_link() 49 caddr = bh->b_data; in ext4_encrypted_get_link() 54 brelse(bh); in ext4_encrypted_get_link() 68 static void ext4_free_link(void *bh) in ext4_free_link() argument 70 brelse(bh); in ext4_free_link() 76 struct buffer_head *bh; in ext4_get_link() local [all …]
|
| H A D | indirect.c | 34 struct buffer_head *bh; member 37 static inline void add_chain(Indirect *p, struct buffer_head *bh, __le32 *v) in add_chain() argument 40 p->bh = bh; in add_chain() 150 struct buffer_head *bh; in ext4_get_branch() local 166 bh = sb_getblk(sb, key); in ext4_get_branch() 167 if (unlikely(!bh)) { in ext4_get_branch() 172 if (!bh_uptodate_or_lock(bh)) { in ext4_get_branch() 173 if (ext4_read_bh(bh, 0, NULL, false) < 0) { in ext4_get_branch() 174 put_bh(bh); in ext4_get_branch() 178 if (ext4_check_indirect_blockref(inode, bh)) { in ext4_get_branch() [all …]
|
| H A D | ext4_jbd2.c | 186 struct buffer_head *bh, in ext4_journal_abort_handle() argument 194 if (bh) in ext4_journal_abort_handle() 195 BUFFER_TRACE(bh, "abort"); in ext4_journal_abort_handle() 233 struct buffer_head *bh, in __ext4_journal_get_write_access() argument 241 err = jbd2_journal_get_write_access(handle, bh); in __ext4_journal_get_write_access() 243 ext4_journal_abort_handle(where, line, __func__, bh, in __ext4_journal_get_write_access() 253 jbd2_journal_set_triggers(bh, in __ext4_journal_get_write_access() 269 struct buffer_head *bh, ext4_fsblk_t blocknr) in __ext4_forget() argument 276 BUFFER_TRACE(bh, "enter"); in __ext4_forget() 279 bh, is_metadata, inode->i_mode, in __ext4_forget() [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 …]
|
| /linux/fs/minix/ |
| H A D | itree_common.c | 7 struct buffer_head *bh; member 12 static inline void add_chain(Indirect *p, struct buffer_head *bh, block_t *v) in add_chain() argument 15 p->bh = bh; in add_chain() 25 static inline block_t *block_end(struct buffer_head *bh) in block_end() argument 27 return (block_t *)((char*)bh->b_data + bh->b_size); in block_end() 38 struct buffer_head *bh; in get_branch() local 46 bh = sb_bread(sb, block_to_cpu(p->key)); in get_branch() 47 if (!bh) in get_branch() 52 add_chain(++p, bh, (block_t *)bh->b_data + *++offsets); in get_branch() 61 brelse(bh); in get_branch() [all …]
|
| 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 …]
|
| /linux/fs/jbd2/ |
| H A D | transaction.c | 907 static void warn_dirty_buffer(struct buffer_head *bh) in warn_dirty_buffer() argument 913 bh->b_bdev, (unsigned long long)bh->b_blocknr); in warn_dirty_buffer() 920 struct buffer_head *bh = jh2bh(jh); in jbd2_freeze_jh_data() local 922 J_EXPECT_JH(jh, buffer_uptodate(bh), "Possible IO failure.\n"); in jbd2_freeze_jh_data() 923 source = kmap_local_folio(bh->b_folio, bh_offset(bh)); in jbd2_freeze_jh_data() 926 memcpy(jh->b_frozen_data, source, bh->b_size); in jbd2_freeze_jh_data() 950 struct buffer_head *bh; in do_get_write_access() local 963 bh = jh2bh(jh); in do_get_write_access() 968 lock_buffer(bh); in do_get_write_access() 974 trace_jbd2_lock_buffer_stall(bh->b_bdev->bd_dev, in do_get_write_access() [all …]
|
| /linux/fs/bfs/ |
| H A D | dir.c | 32 struct buffer_head *bh; in bfs_readdir() local 47 bh = sb_bread(dir->i_sb, block); in bfs_readdir() 48 if (!bh) { in bfs_readdir() 53 de = (struct bfs_dirent *)(bh->b_data + offset); in bfs_readdir() 59 brelse(bh); in bfs_readdir() 66 brelse(bh); in bfs_readdir() 129 struct buffer_head *bh; in bfs_lookup() local 137 bh = bfs_find_entry(dir, &dentry->d_name, &de); in bfs_lookup() 138 if (bh) { in bfs_lookup() 140 brelse(bh); in bfs_lookup() [all …]
|