Home
last modified time | relevance | path

Searched refs:bh (Results 1 – 25 of 333) sorted by relevance

12345678910>>...14

/linux-6.6.21/fs/ocfs2/
Dbuffer_head_io.c38 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-6.6.21/fs/
Dbuffer.c57 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-6.6.21/fs/gfs2/
Dmeta_io.c35 struct buffer_head *bh, *head; in gfs2_aspace_writepage() local
43 bh = head; in gfs2_aspace_writepage()
46 if (!buffer_mapped(bh)) in gfs2_aspace_writepage()
56 lock_buffer(bh); in gfs2_aspace_writepage()
57 } else if (!trylock_buffer(bh)) { in gfs2_aspace_writepage()
61 if (test_clear_buffer_dirty(bh)) { in gfs2_aspace_writepage()
62 mark_buffer_async_write(bh); in gfs2_aspace_writepage()
64 unlock_buffer(bh); in gfs2_aspace_writepage()
66 } while ((bh = bh->b_this_page) != head); in gfs2_aspace_writepage()
76 struct buffer_head *next = bh->b_this_page; in gfs2_aspace_writepage()
[all …]
/linux-6.6.21/fs/hpfs/
Dbuffer.c40 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 …]
Danode.c16 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
73 if (!(fnode = hpfs_map_fnode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree()
76 if (!(anode = hpfs_map_anode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree()
[all …]
/linux-6.6.21/include/linux/
Dbuffer_head.h48 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
90 static __always_inline void set_buffer_##name(struct buffer_head *bh) \
92 if (!test_bit(BH_##bit, &(bh)->b_state)) \
93 set_bit(BH_##bit, &(bh)->b_state); \
95 static __always_inline void clear_buffer_##name(struct buffer_head *bh) \
97 clear_bit(BH_##bit, &(bh)->b_state); \
99 static __always_inline int buffer_##name(const struct buffer_head *bh) \
101 return test_bit(BH_##bit, &(bh)->b_state); \
108 static __always_inline int test_set_buffer_##name(struct buffer_head *bh) \
110 return test_and_set_bit(BH_##bit, &(bh)->b_state); \
[all …]
/linux-6.6.21/fs/nilfs2/
Dgcinode.c62 struct buffer_head *bh; in nilfs_gccache_submit_read_data() local
65 bh = nilfs_grab_buffer(inode, inode->i_mapping, blkoff, 0); in nilfs_gccache_submit_read_data()
66 if (unlikely(!bh)) in nilfs_gccache_submit_read_data()
69 if (buffer_uptodate(bh)) in nilfs_gccache_submit_read_data()
80 lock_buffer(bh); in nilfs_gccache_submit_read_data()
81 if (buffer_uptodate(bh)) { in nilfs_gccache_submit_read_data()
82 unlock_buffer(bh); in nilfs_gccache_submit_read_data()
86 if (!buffer_mapped(bh)) { in nilfs_gccache_submit_read_data()
87 bh->b_bdev = inode->i_sb->s_bdev; in nilfs_gccache_submit_read_data()
88 set_buffer_mapped(bh); in nilfs_gccache_submit_read_data()
[all …]
Dbtnode.c50 struct buffer_head *bh; in nilfs_btnode_create_block() local
52 bh = nilfs_grab_buffer(inode, btnc, blocknr, BIT(BH_NILFS_Node)); in nilfs_btnode_create_block()
53 if (unlikely(!bh)) in nilfs_btnode_create_block()
56 if (unlikely(buffer_mapped(bh) || buffer_uptodate(bh) || in nilfs_btnode_create_block()
57 buffer_dirty(bh))) { in nilfs_btnode_create_block()
58 brelse(bh); in nilfs_btnode_create_block()
61 memset(bh->b_data, 0, i_blocksize(inode)); in nilfs_btnode_create_block()
62 bh->b_bdev = inode->i_sb->s_bdev; in nilfs_btnode_create_block()
63 bh->b_blocknr = blocknr; in nilfs_btnode_create_block()
64 set_buffer_mapped(bh); in nilfs_btnode_create_block()
[all …]
Dpage.c34 struct buffer_head *bh; in __nilfs_get_page_block() local
40 bh = nilfs_page_get_nth_block(page, block - first_block); in __nilfs_get_page_block()
42 touch_buffer(bh); in __nilfs_get_page_block()
43 wait_on_buffer(bh); in __nilfs_get_page_block()
44 return bh; in __nilfs_get_page_block()
55 struct buffer_head *bh; in nilfs_grab_buffer() local
61 bh = __nilfs_get_page_block(page, blkoff, index, blkbits, b_state); in nilfs_grab_buffer()
62 if (unlikely(!bh)) { in nilfs_grab_buffer()
67 return bh; in nilfs_grab_buffer()
74 void nilfs_forget_buffer(struct buffer_head *bh) in nilfs_forget_buffer() argument
[all …]
Dmdt.c31 struct buffer_head *bh, in nilfs_mdt_insert_new_block() argument
42 bh->b_blocknr = 0; in nilfs_mdt_insert_new_block()
44 ret = nilfs_bmap_insert(ii->i_bmap, block, (unsigned long)bh); in nilfs_mdt_insert_new_block()
48 set_buffer_mapped(bh); in nilfs_mdt_insert_new_block()
50 kaddr = kmap_atomic(bh->b_page); in nilfs_mdt_insert_new_block()
51 memset(kaddr + bh_offset(bh), 0, i_blocksize(inode)); in nilfs_mdt_insert_new_block()
53 init_block(inode, bh, kaddr); in nilfs_mdt_insert_new_block()
54 flush_dcache_page(bh->b_page); in nilfs_mdt_insert_new_block()
57 set_buffer_uptodate(bh); in nilfs_mdt_insert_new_block()
58 mark_buffer_dirty(bh); in nilfs_mdt_insert_new_block()
[all …]
/linux-6.6.21/fs/omfs/
Ddir.c38 struct buffer_head *bh; in omfs_scan_list() local
44 bh = omfs_bread(dir->i_sb, block); in omfs_scan_list()
45 if (!bh) { in omfs_scan_list()
50 oi = (struct omfs_inode *) bh->b_data; in omfs_scan_list()
52 brelse(bh); in omfs_scan_list()
57 return bh; in omfs_scan_list()
61 brelse(bh); in omfs_scan_list()
70 struct buffer_head *bh; in omfs_find_entry() local
74 bh = omfs_get_bucket(dir, name, namelen, &ofs); in omfs_find_entry()
75 if (!bh) in omfs_find_entry()
[all …]
/linux-6.6.21/fs/ext2/
Dxattr.c69 #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-6.6.21/fs/affs/
Dfile.c53 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 …]
Damigaffs.c26 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 …]
Daffs.h19 #define AFFS_BLOCK(sb, bh, blk) (AFFS_HEAD(bh)->table[AFFS_SB(sb)->s_hashsize-1-(blk)]) argument
21 #define AFFS_HEAD(bh) ((struct affs_head *)(bh)->b_data) argument
22 #define AFFS_TAIL(sb, bh) ((struct affs_tail *)((bh)->b_data+(sb)->s_blocksize-sizeof(struct affs_t… argument
23 #define AFFS_ROOT_HEAD(bh) ((struct affs_root_head *)(bh)->b_data) argument
24 #define AFFS_ROOT_TAIL(sb, bh) ((struct affs_root_tail *)((bh)->b_data+(sb)->s_blocksize-sizeof(str… argument
25 #define AFFS_DATA_HEAD(bh) ((struct affs_data_head *)(bh)->b_data) argument
26 #define AFFS_DATA(bh) (((struct affs_data_head *)(bh)->b_data)->data) argument
137 extern int affs_insert_hash(struct inode *inode, struct buffer_head *bh);
140 extern u32 affs_checksum_block(struct super_block *sb, struct buffer_head *bh);
141 extern void affs_fix_checksum(struct super_block *sb, struct buffer_head *bh);
[all …]
/linux-6.6.21/fs/ext4/
Dsymlink.c30 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 …]
Dpage-io.c93 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
123 bh = head = folio_buffers(folio); in ext4_finish_bio()
130 if (bh_offset(bh) < bio_start || in ext4_finish_bio()
131 bh_offset(bh) + bh->b_size > bio_end) { in ext4_finish_bio()
132 if (buffer_async_write(bh)) in ext4_finish_bio()
136 clear_buffer_async_write(bh); in ext4_finish_bio()
138 set_buffer_write_io_error(bh); in ext4_finish_bio()
[all …]
Dext4_jbd2.c184 struct buffer_head *bh, in ext4_journal_abort_handle() argument
192 if (bh) in ext4_journal_abort_handle()
193 BUFFER_TRACE(bh, "abort"); in ext4_journal_abort_handle()
231 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()
251 jbd2_journal_set_triggers(bh, in __ext4_journal_get_write_access()
267 struct buffer_head *bh, ext4_fsblk_t blocknr) in __ext4_forget() argument
274 BUFFER_TRACE(bh, "enter"); in __ext4_forget()
277 bh, is_metadata, inode->i_mode, in __ext4_forget()
[all …]
Dmmp.c43 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
67 err = write_mmp_block_thawed(sb, bh); in write_mmp_block()
[all …]
/linux-6.6.21/fs/reiserfs/
Dprints.c148 static int scnprintf_block_head(char *buf, size_t size, struct buffer_head *bh) in scnprintf_block_head() argument
152 B_LEVEL(bh), B_NR_ITEMS(bh), B_FREE_SPACE(bh)); in scnprintf_block_head()
155 static int scnprintf_buffer_head(char *buf, size_t size, struct buffer_head *bh) in scnprintf_buffer_head() argument
159 bh->b_bdev, bh->b_size, in scnprintf_buffer_head()
160 (unsigned long long)bh->b_blocknr, in scnprintf_buffer_head()
161 atomic_read(&(bh->b_count)), in scnprintf_buffer_head()
162 bh->b_state, bh->b_page, in scnprintf_buffer_head()
163 buffer_uptodate(bh) ? "UPTODATE" : "!UPTODATE", in scnprintf_buffer_head()
164 buffer_dirty(bh) ? "DIRTY" : "CLEAN", in scnprintf_buffer_head()
165 buffer_locked(bh) ? "LOCKED" : "UNLOCKED"); in scnprintf_buffer_head()
[all …]
/linux-6.6.21/fs/minix/
Ditree_common.c7 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 …]
Dbitmap.c46 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-6.6.21/fs/jbd2/
Dcommit.c32 static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate) in journal_end_buffer_io_sync() argument
34 struct buffer_head *orig_bh = bh->b_private; in journal_end_buffer_io_sync()
36 BUFFER_TRACE(bh, ""); in journal_end_buffer_io_sync()
38 set_buffer_uptodate(bh); in journal_end_buffer_io_sync()
40 clear_buffer_uptodate(bh); in journal_end_buffer_io_sync()
46 unlock_buffer(bh); in journal_end_buffer_io_sync()
63 static void release_buffer_page(struct buffer_head *bh) in release_buffer_page() argument
67 if (buffer_dirty(bh)) in release_buffer_page()
69 if (atomic_read(&bh->b_count) != 1) in release_buffer_page()
71 folio = bh->b_folio; in release_buffer_page()
[all …]
Drecovery.c72 struct buffer_head *bh; in do_readahead() local
95 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in do_readahead()
96 if (!bh) { in do_readahead()
101 if (!buffer_uptodate(bh) && !buffer_locked(bh)) { in do_readahead()
102 bufs[nbufs++] = bh; in do_readahead()
109 brelse(bh); in do_readahead()
134 struct buffer_head *bh; in jread() local
151 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in jread()
152 if (!bh) in jread()
155 if (!buffer_uptodate(bh)) { in jread()
[all …]
/linux-6.6.21/fs/sysv/
Dballoc.c31 static inline sysv_zone_t *get_chunk(struct super_block *sb, struct buffer_head *bh) in get_chunk() argument
33 char *bh_data = bh->b_data; in get_chunk()
46 struct buffer_head * bh; in sysv_free_block() local
78 bh = sb_getblk(sb, block); in sysv_free_block()
79 if (!bh) { in sysv_free_block()
84 memset(bh->b_data, 0, sb->s_blocksize); in sysv_free_block()
85 *(__fs16*)bh->b_data = cpu_to_fs16(sbi, count); in sysv_free_block()
86 memcpy(get_chunk(sb,bh), blocks, count * sizeof(sysv_zone_t)); in sysv_free_block()
87 mark_buffer_dirty(bh); in sysv_free_block()
88 set_buffer_uptodate(bh); in sysv_free_block()
[all …]

12345678910>>...14