Lines Matching defs:bh

21 /* Insert a header block bh into the directory dir
26 affs_insert_hash(struct inode *dir, struct buffer_head *bh)
33 ino = bh->b_blocknr;
34 offset = affs_hash_name(sb, AFFS_TAIL(sb, bh)->name + 1, AFFS_TAIL(sb, bh)->name[0]);
50 AFFS_TAIL(sb, bh)->parent = cpu_to_be32(dir->i_ino);
51 AFFS_TAIL(sb, bh)->hash_chain = 0;
52 affs_fix_checksum(sb, bh);
78 struct buffer_head *bh;
89 bh = affs_bread(sb, dir->i_ino);
90 if (!bh)
94 hash_ino = be32_to_cpu(AFFS_HEAD(bh)->table[offset]);
98 if (dir->i_ino == bh->b_blocknr)
99 AFFS_HEAD(bh)->table[offset] = ino;
101 AFFS_TAIL(sb, bh)->hash_chain = ino;
102 affs_adjust_checksum(bh, be32_to_cpu(ino) - hash_ino);
103 mark_buffer_dirty_inode(bh, dir);
108 affs_brelse(bh);
109 bh = affs_bread(sb, hash_ino);
110 if (!bh)
112 hash_ino = be32_to_cpu(AFFS_TAIL(sb, bh)->hash_chain);
115 affs_brelse(bh);
146 struct buffer_head *bh, *link_bh = NULL;
152 bh = affs_bread(sb, inode->i_ino);
153 if (!bh)
161 link_ino = be32_to_cpu(AFFS_TAIL(sb, bh)->link_chain);
185 memcpy(AFFS_TAIL(sb, bh)->name, AFFS_TAIL(sb, link_bh)->name, 32);
186 retval = affs_insert_hash(dir, bh);
191 mark_buffer_dirty_inode(bh, inode);
201 while ((ino = be32_to_cpu(AFFS_TAIL(sb, bh)->link_chain)) != 0) {
204 AFFS_TAIL(sb, bh)->link_chain = ino2;
205 affs_adjust_checksum(bh, be32_to_cpu(ino2) - link_ino);
206 mark_buffer_dirty_inode(bh, inode);
208 /* Fix the link count, if bh is a normal header block without links */
209 switch (be32_to_cpu(AFFS_TAIL(sb, bh)->stype)) {
214 if (!AFFS_TAIL(sb, bh)->link_chain)
220 affs_brelse(bh);
221 bh = affs_bread(sb, ino);
222 if (!bh)
228 affs_brelse(bh);
237 struct buffer_head *bh;
241 bh = affs_bread(sb, inode->i_ino);
242 if (!bh)
247 if (AFFS_HEAD(bh)->table[size])
251 affs_brelse(bh);
271 struct buffer_head *bh = NULL;
284 bh = affs_bread(sb, (u32)(long)dentry->d_fsdata);
285 if (!bh)
290 switch (be32_to_cpu(AFFS_TAIL(sb, bh)->stype)) {
306 retval = affs_remove_hash(dir, bh);
309 mark_buffer_dirty_inode(bh, inode);
322 affs_brelse(bh);
339 affs_checksum_block(struct super_block *sb, struct buffer_head *bh)
341 __be32 *ptr = (__be32 *)bh->b_data;
357 affs_fix_checksum(struct super_block *sb, struct buffer_head *bh)
360 __be32 *ptr = (__be32 *)bh->b_data;