Home
last modified time | relevance | path

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

123456789

/fs/
Dbuffer.c50 init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private) in init_buffer() argument
52 bh->b_end_io = handler; in init_buffer()
53 bh->b_private = private; in init_buffer()
59 struct buffer_head *bh in sync_buffer() local
63 bd = bh->b_bdev; in sync_buffer()
70 void __lock_buffer(struct buffer_head *bh) in __lock_buffer() argument
72 wait_on_bit_lock(&bh->b_state, BH_Lock, sync_buffer, in __lock_buffer()
77 void unlock_buffer(struct buffer_head *bh) in unlock_buffer() argument
79 clear_bit_unlock(BH_Lock, &bh->b_state); in unlock_buffer()
81 wake_up_bit(&bh->b_state, BH_Lock); in unlock_buffer()
[all …]
/fs/ocfs2/
Dbuffer_head_io.c54 int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, in ocfs2_write_block() argument
60 (unsigned long long)bh->b_blocknr, inode); in ocfs2_write_block()
62 BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO); in ocfs2_write_block()
63 BUG_ON(buffer_jbd(bh)); in ocfs2_write_block()
75 lock_buffer(bh); in ocfs2_write_block()
76 set_buffer_uptodate(bh); in ocfs2_write_block()
79 clear_buffer_dirty(bh); in ocfs2_write_block()
81 get_bh(bh); /* for end_buffer_write_sync() */ in ocfs2_write_block()
82 bh->b_end_io = end_buffer_write_sync; in ocfs2_write_block()
83 submit_bh(WRITE, bh); in ocfs2_write_block()
[all …]
/fs/jbd/
Dcommit.c27 static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate) in journal_end_buffer_io_sync() argument
29 BUFFER_TRACE(bh, ""); in journal_end_buffer_io_sync()
31 set_buffer_uptodate(bh); in journal_end_buffer_io_sync()
33 clear_buffer_uptodate(bh); in journal_end_buffer_io_sync()
34 unlock_buffer(bh); in journal_end_buffer_io_sync()
51 static void release_buffer_page(struct buffer_head *bh) in release_buffer_page() argument
55 if (buffer_dirty(bh)) in release_buffer_page()
57 if (atomic_read(&bh->b_count) != 1) in release_buffer_page()
59 page = bh->b_page; in release_buffer_page()
70 __brelse(bh); in release_buffer_page()
[all …]
Dtransaction.c515 struct buffer_head *bh = jh2bh(jh); in jbd_unexpected_dirty_buffer() local
517 if (test_clear_buffer_dirty(bh)) in jbd_unexpected_dirty_buffer()
518 set_buffer_jbddirty(bh); in jbd_unexpected_dirty_buffer()
536 struct buffer_head *bh; in do_get_write_access() local
553 bh = jh2bh(jh); in do_get_write_access()
557 lock_buffer(bh); in do_get_write_access()
558 jbd_lock_bh_state(bh); in do_get_write_access()
573 if (buffer_dirty(bh)) { in do_get_write_access()
596 unlock_buffer(bh); in do_get_write_access()
600 jbd_unlock_bh_state(bh); in do_get_write_access()
[all …]
Dcheckpoint.c94 struct buffer_head *bh = jh2bh(jh); in __try_to_free_cp_buf() local
96 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && in __try_to_free_cp_buf()
97 !buffer_dirty(bh) && !buffer_write_io_error(bh)) { in __try_to_free_cp_buf()
100 jbd_unlock_bh_state(bh); in __try_to_free_cp_buf()
101 journal_remove_journal_head(bh); in __try_to_free_cp_buf()
102 BUFFER_TRACE(bh, "release"); in __try_to_free_cp_buf()
103 __brelse(bh); in __try_to_free_cp_buf()
105 jbd_unlock_bh_state(bh); in __try_to_free_cp_buf()
180 static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh) in jbd_sync_bh() argument
183 get_bh(bh); in jbd_sync_bh()
[all …]
/fs/hpfs/
Dbuffer.c32 struct buffer_head *bh; in hpfs_map_sector() local
36 *bhp = bh = sb_bread(s, secno); in hpfs_map_sector()
37 if (bh != NULL) in hpfs_map_sector()
38 return bh->b_data; in hpfs_map_sector()
49 struct buffer_head *bh; in hpfs_get_sector() local
54 if ((*bhp = bh = sb_getblk(s, secno)) != NULL) { in hpfs_get_sector()
55 if (!buffer_uptodate(bh)) wait_on_buffer(bh); in hpfs_get_sector()
56 set_buffer_uptodate(bh); in hpfs_get_sector()
57 return bh->b_data; in hpfs_get_sector()
69 struct buffer_head *bh; in hpfs_map_4sectors() local
[all …]
Danode.c15 struct buffer_head *bh) in hpfs_bplus_lookup() argument
27 brelse(bh); in hpfs_bplus_lookup()
28 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1; in hpfs_bplus_lookup()
33 brelse(bh); in hpfs_bplus_lookup()
41 brelse(bh); in hpfs_bplus_lookup()
50 brelse(bh); in hpfs_bplus_lookup()
54 brelse(bh); in hpfs_bplus_lookup()
67 struct buffer_head *bh, *bh1, *bh2; in hpfs_add_sector_to_btree() local
72 if (!(fnode = hpfs_map_fnode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree()
75 if (!(anode = hpfs_map_anode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree()
[all …]
/fs/gfs2/
Dmeta_io.c145 struct buffer_head *bh; in gfs2_getbuf() local
171 for (bh = page_buffers(page); bufnum--; bh = bh->b_this_page) in gfs2_getbuf()
173 get_bh(bh); in gfs2_getbuf()
175 if (!buffer_mapped(bh)) in gfs2_getbuf()
176 map_bh(bh, sdp->sd_vfs, blkno); in gfs2_getbuf()
182 return bh; in gfs2_getbuf()
185 static void meta_prep_new(struct buffer_head *bh) in meta_prep_new() argument
187 struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data; in meta_prep_new()
189 lock_buffer(bh); in meta_prep_new()
190 clear_buffer_dirty(bh); in meta_prep_new()
[all …]
Dlog.c95 struct buffer_head *bh; in gfs2_ail1_start_one() local
103 bh = bd->bd_bh; in gfs2_ail1_start_one()
107 if (!buffer_busy(bh)) { in gfs2_ail1_start_one()
108 if (!buffer_uptodate(bh)) in gfs2_ail1_start_one()
109 gfs2_io_error_bh(sdp, bh); in gfs2_ail1_start_one()
114 if (!buffer_dirty(bh)) in gfs2_ail1_start_one()
119 get_bh(bh); in gfs2_ail1_start_one()
121 lock_buffer(bh); in gfs2_ail1_start_one()
122 if (test_clear_buffer_dirty(bh)) { in gfs2_ail1_start_one()
123 bh->b_end_io = end_buffer_write_sync; in gfs2_ail1_start_one()
[all …]
/fs/jbd2/
Dcommit.c33 static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate) in journal_end_buffer_io_sync() argument
35 BUFFER_TRACE(bh, ""); in journal_end_buffer_io_sync()
37 set_buffer_uptodate(bh); in journal_end_buffer_io_sync()
39 clear_buffer_uptodate(bh); in journal_end_buffer_io_sync()
40 unlock_buffer(bh); in journal_end_buffer_io_sync()
57 static void release_buffer_page(struct buffer_head *bh) in release_buffer_page() argument
61 if (buffer_dirty(bh)) in release_buffer_page()
63 if (atomic_read(&bh->b_count) != 1) in release_buffer_page()
65 page = bh->b_page; in release_buffer_page()
76 __brelse(bh); in release_buffer_page()
[all …]
Dtransaction.c525 struct buffer_head *bh = jh2bh(jh); in jbd_unexpected_dirty_buffer() local
527 if (test_clear_buffer_dirty(bh)) in jbd_unexpected_dirty_buffer()
528 set_buffer_jbddirty(bh); in jbd_unexpected_dirty_buffer()
546 struct buffer_head *bh; in do_get_write_access() local
563 bh = jh2bh(jh); in do_get_write_access()
567 lock_buffer(bh); in do_get_write_access()
568 jbd_lock_bh_state(bh); in do_get_write_access()
583 if (buffer_dirty(bh)) { in do_get_write_access()
606 unlock_buffer(bh); in do_get_write_access()
610 jbd_unlock_bh_state(bh); in do_get_write_access()
[all …]
Dcheckpoint.c95 struct buffer_head *bh = jh2bh(jh); in __try_to_free_cp_buf() local
97 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && in __try_to_free_cp_buf()
98 !buffer_dirty(bh) && !buffer_write_io_error(bh)) { in __try_to_free_cp_buf()
101 jbd_unlock_bh_state(bh); in __try_to_free_cp_buf()
102 jbd2_journal_remove_journal_head(bh); in __try_to_free_cp_buf()
103 BUFFER_TRACE(bh, "release"); in __try_to_free_cp_buf()
104 __brelse(bh); in __try_to_free_cp_buf()
106 jbd_unlock_bh_state(bh); in __try_to_free_cp_buf()
182 static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh) in jbd_sync_bh() argument
185 get_bh(bh); in jbd_sync_bh()
[all …]
/fs/affs/
Dfile.c22 static struct buffer_head *affs_alloc_extblock(struct inode *inode, struct buffer_head *bh, u32 ext…
76 struct buffer_head *bh; in affs_grow_extcache() local
125 bh = affs_bread(sb, key); in affs_grow_extcache()
126 if (!bh) in affs_grow_extcache()
128 key = be32_to_cpu(AFFS_TAIL(sb, bh)->extension); in affs_grow_extcache()
129 affs_brelse(bh); in affs_grow_extcache()
143 affs_alloc_extblock(struct inode *inode, struct buffer_head *bh, u32 ext) in affs_alloc_extblock() argument
149 blocknr = affs_alloc_block(inode, bh->b_blocknr); in affs_alloc_extblock()
167 tmp = be32_to_cpu(AFFS_TAIL(sb, bh)->extension); in affs_alloc_extblock()
170 AFFS_TAIL(sb, bh)->extension = cpu_to_be32(blocknr); in affs_alloc_extblock()
[all …]
Damigaffs.c27 affs_insert_hash(struct inode *dir, struct buffer_head *bh) in affs_insert_hash() argument
34 ino = bh->b_blocknr; in affs_insert_hash()
35 offset = affs_hash_name(sb, AFFS_TAIL(sb, bh)->name + 1, AFFS_TAIL(sb, bh)->name[0]); in affs_insert_hash()
51 AFFS_TAIL(sb, bh)->parent = cpu_to_be32(dir->i_ino); in affs_insert_hash()
52 AFFS_TAIL(sb, bh)->hash_chain = 0; in affs_insert_hash()
53 affs_fix_checksum(sb, bh); in affs_insert_hash()
79 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
29 #define AFFS_HEAD(bh) ((struct affs_head *)(bh)->b_data) argument
30 #define AFFS_TAIL(sb, bh) ((struct affs_tail *)((bh)->b_data+(sb)->s_blocksize-sizeof(struct affs_t… argument
31 #define AFFS_ROOT_HEAD(bh) ((struct affs_root_head *)(bh)->b_data) argument
32 #define AFFS_ROOT_TAIL(sb, bh) ((struct affs_root_tail *)((bh)->b_data+(sb)->s_blocksize-sizeof(str… argument
33 #define AFFS_DATA_HEAD(bh) ((struct affs_data_head *)(bh)->b_data) argument
34 #define AFFS_DATA(bh) (((struct affs_data_head *)(bh)->b_data)->data) argument
133 extern int affs_insert_hash(struct inode *inode, struct buffer_head *bh);
136 extern u32 affs_checksum_block(struct super_block *sb, struct buffer_head *bh);
137 extern void affs_fix_checksum(struct super_block *sb, struct buffer_head *bh);
[all …]
/fs/omfs/
Ddir.c39 struct buffer_head *bh; in omfs_scan_list() local
45 bh = sb_bread(dir->i_sb, in omfs_scan_list()
47 if (!bh) { in omfs_scan_list()
52 oi = (struct omfs_inode *) bh->b_data; in omfs_scan_list()
54 brelse(bh); in omfs_scan_list()
59 return bh; in omfs_scan_list()
63 brelse(bh); in omfs_scan_list()
72 struct buffer_head *bh; in omfs_find_entry() local
76 bh = omfs_get_bucket(dir, name, namelen, &ofs); in omfs_find_entry()
77 if (!bh) in omfs_find_entry()
[all …]
/fs/ext2/
Dxattr.c67 #define HDR(bh) ((struct ext2_xattr_header *)((bh)->b_data)) argument
69 #define FIRST_ENTRY(bh) ENTRY(HDR(bh)+1) argument
79 # define ea_bdebug(bh, f...) do { \ argument
82 bdevname(bh->b_bdev, b), \
83 (unsigned long) bh->b_blocknr); \
152 struct buffer_head *bh = NULL; in ext2_xattr_get() local
168 bh = sb_bread(inode->i_sb, EXT2_I(inode)->i_file_acl); in ext2_xattr_get()
170 if (!bh) in ext2_xattr_get()
172 ea_bdebug(bh, "b_count=%d, refcount=%d", in ext2_xattr_get()
173 atomic_read(&(bh->b_count)), le32_to_cpu(HDR(bh)->h_refcount)); in ext2_xattr_get()
[all …]
/fs/reiserfs/
Dprints.c134 static void sprintf_block_head(char *buf, struct buffer_head *bh) in sprintf_block_head() argument
137 B_LEVEL(bh), B_NR_ITEMS(bh), B_FREE_SPACE(bh)); in sprintf_block_head()
140 static void sprintf_buffer_head(char *buf, struct buffer_head *bh) in sprintf_buffer_head() argument
146 bdevname(bh->b_bdev, b), bh->b_size, in sprintf_buffer_head()
147 (unsigned long long)bh->b_blocknr, atomic_read(&(bh->b_count)), in sprintf_buffer_head()
148 bh->b_state, bh->b_page, in sprintf_buffer_head()
149 buffer_uptodate(bh) ? "UPTODATE" : "!UPTODATE", in sprintf_buffer_head()
150 buffer_dirty(bh) ? "DIRTY" : "CLEAN", in sprintf_buffer_head()
151 buffer_locked(bh) ? "LOCKED" : "UNLOCKED"); in sprintf_buffer_head()
388 static int print_internal(struct buffer_head *bh, int first, int last) in print_internal() argument
[all …]
/fs/xfs/linux-2.6/
Dxfs_aops.c86 struct buffer_head *bh, *head; in xfs_count_page_state() local
90 bh = head = page_buffers(page); in xfs_count_page_state()
92 if (buffer_uptodate(bh) && !buffer_mapped(bh)) in xfs_count_page_state()
94 else if (buffer_unwritten(bh)) in xfs_count_page_state()
96 else if (buffer_delay(bh)) in xfs_count_page_state()
98 } while ((bh = bh->b_this_page) != head); in xfs_count_page_state()
182 struct buffer_head *bh, *next; in xfs_destroy_ioend() local
185 for (bh = ioend->io_buffer_head; bh; bh = next) { in xfs_destroy_ioend()
186 next = bh->b_private; in xfs_destroy_ioend()
187 bh->b_end_io(bh, !ioend->io_error); in xfs_destroy_ioend()
[all …]
/fs/minix/
Dbitmap.c25 struct buffer_head *bh; in count_free() local
28 if (!(bh=map[i])) in count_free()
30 for (j=0; j<bh->b_size; j++) in count_free()
31 sum += nibblemap[bh->b_data[j] & 0xf] in count_free()
32 + nibblemap[(bh->b_data[j]>>4) & 0xf]; in count_free()
35 if (numblocks==0 || !(bh=map[numblocks-1])) in count_free()
37 i = ((numbits - (numblocks-1) * bh->b_size * 8) / 16) * 2; in count_free()
39 sum += nibblemap[bh->b_data[j] & 0xf] in count_free()
40 + nibblemap[(bh->b_data[j]>>4) & 0xf]; in count_free()
45 i = *(__u16 *)(&bh->b_data[j]) | ~((1<<i) - 1); in count_free()
[all …]
Ditree_common.c6 struct buffer_head *bh; member
11 static inline void add_chain(Indirect *p, struct buffer_head *bh, block_t *v) in add_chain() argument
14 p->bh = bh; in add_chain()
24 static inline block_t *block_end(struct buffer_head *bh) in block_end() argument
26 return (block_t *)((char*)bh->b_data + bh->b_size); in block_end()
37 struct buffer_head *bh; in get_branch() local
45 bh = sb_bread(sb, block_to_cpu(p->key)); in get_branch()
46 if (!bh) in get_branch()
51 add_chain(++p, bh, (block_t *)bh->b_data + *++offsets); in get_branch()
60 brelse(bh); in get_branch()
[all …]
/fs/ext4/
Dext4_jbd2.c8 struct buffer_head *bh) in __ext4_journal_get_undo_access() argument
13 err = jbd2_journal_get_undo_access(handle, bh); in __ext4_journal_get_undo_access()
15 ext4_journal_abort_handle(where, __func__, bh, in __ext4_journal_get_undo_access()
22 struct buffer_head *bh) in __ext4_journal_get_write_access() argument
27 err = jbd2_journal_get_write_access(handle, bh); in __ext4_journal_get_write_access()
29 ext4_journal_abort_handle(where, __func__, bh, in __ext4_journal_get_write_access()
36 struct buffer_head *bh) in __ext4_journal_forget() argument
41 err = jbd2_journal_forget(handle, bh); in __ext4_journal_forget()
43 ext4_journal_abort_handle(where, __func__, bh, in __ext4_journal_forget()
50 ext4_fsblk_t blocknr, struct buffer_head *bh) in __ext4_journal_revoke() argument
[all …]
/fs/squashfs/
Dblock.c50 struct buffer_head *bh; in get_block_length() local
52 bh = sb_bread(sb, *cur_index); in get_block_length()
53 if (bh == NULL) in get_block_length()
57 *length = (unsigned char) bh->b_data[*offset]; in get_block_length()
58 put_bh(bh); in get_block_length()
59 bh = sb_bread(sb, ++(*cur_index)); in get_block_length()
60 if (bh == NULL) in get_block_length()
62 *length |= (unsigned char) bh->b_data[0] << 8; in get_block_length()
65 *length = (unsigned char) bh->b_data[*offset] | in get_block_length()
66 (unsigned char) bh->b_data[*offset + 1] << 8; in get_block_length()
[all …]
/fs/sysv/
Dballoc.c30 static inline sysv_zone_t *get_chunk(struct super_block *sb, struct buffer_head *bh) in get_chunk() argument
32 char *bh_data = bh->b_data; in get_chunk()
45 struct buffer_head * bh; in sysv_free_block() local
77 bh = sb_getblk(sb, block); in sysv_free_block()
78 if (!bh) { in sysv_free_block()
83 memset(bh->b_data, 0, sb->s_blocksize); in sysv_free_block()
84 *(__fs16*)bh->b_data = cpu_to_fs16(sbi, count); in sysv_free_block()
85 memcpy(get_chunk(sb,bh), blocks, count * sizeof(sysv_zone_t)); in sysv_free_block()
86 mark_buffer_dirty(bh); in sysv_free_block()
87 set_buffer_uptodate(bh); in sysv_free_block()
[all …]
/fs/ext3/
Dext3_jbd.c8 struct buffer_head *bh) in __ext3_journal_get_undo_access() argument
10 int err = journal_get_undo_access(handle, bh); in __ext3_journal_get_undo_access()
12 ext3_journal_abort_handle(where, __func__, bh, handle,err); in __ext3_journal_get_undo_access()
17 struct buffer_head *bh) in __ext3_journal_get_write_access() argument
19 int err = journal_get_write_access(handle, bh); in __ext3_journal_get_write_access()
21 ext3_journal_abort_handle(where, __func__, bh, handle,err); in __ext3_journal_get_write_access()
26 struct buffer_head *bh) in __ext3_journal_forget() argument
28 int err = journal_forget(handle, bh); in __ext3_journal_forget()
30 ext3_journal_abort_handle(where, __func__, bh, handle,err); in __ext3_journal_forget()
35 unsigned long blocknr, struct buffer_head *bh) in __ext3_journal_revoke() argument
[all …]

123456789