15 static char ErrorBuffer[256];
30 struct buffer_head *dir_bh;
39 dir_bh = affs_bread(sb, dir->
i_ino);
46 dir_bh = affs_bread(sb, hash_ino);
55 if (dir->
i_ino == dir_bh->b_blocknr)
60 affs_adjust_checksum(dir_bh, ino);
66 mark_inode_dirty(dir);
79 struct buffer_head *bh;
80 u32 rem_ino, hash_ino;
85 rem_ino = rem_bh->b_blocknr;
87 pr_debug(
"AFFS: remove_hash(dir=%d, ino=%d, hashval=%d)\n", (
u32)dir->
i_ino, rem_ino, offset);
89 bh = affs_bread(sb, dir->
i_ino);
96 if (hash_ino == rem_ino) {
98 if (dir->
i_ino == bh->b_blocknr)
102 affs_adjust_checksum(bh,
be32_to_cpu(ino) - hash_ino);
109 bh = affs_bread(sb, hash_ino);
119 mark_inode_dirty(dir);
129 spin_lock(&inode->
i_lock);
136 spin_unlock(&inode->
i_lock);
143 affs_remove_link(
struct dentry *dentry)
147 struct buffer_head *bh =
NULL, *link_bh =
NULL;
153 bh = affs_bread(sb, inode->
i_ino);
158 if (inode->
i_ino == link_ino) {
163 link_bh = affs_bread(sb, link_ino);
169 retval = PTR_ERR(dir);
178 affs_fix_dcache(inode, link_ino);
181 affs_unlock_dir(dir);
189 affs_unlock_dir(dir);
194 affs_unlock_dir(dir);
197 link_bh = affs_bread(sb, link_ino);
203 if (ino == link_ino) {
206 affs_adjust_checksum(bh,
be32_to_cpu(ino2) - link_ino);
222 bh = affs_bread(sb, ino);
228 affs_brelse(link_bh);
235 affs_empty_dir(
struct inode *inode)
238 struct buffer_head *bh;
242 bh = affs_bread(sb, inode->
i_ino);
247 for (size = AFFS_SB(sb)->s_hashsize - 1; size >= 0; size--)
271 struct inode *
inode, *dir;
272 struct buffer_head *bh =
NULL;
289 affs_lock_link(inode);
297 affs_lock_dir(inode);
298 retval = affs_empty_dir(inode);
299 affs_unlock_dir(inode);
312 affs_unlock_dir(dir);
315 retval = affs_remove_link(dentry);
318 affs_unlock_link(inode);
320 mark_inode_dirty(inode);
327 affs_unlock_dir(dir);
328 affs_unlock_link(inode);
365 checksumptr = ptr + 5;
378 secs -=
sys_tz.tz_minuteswest * 60 + ((8 * 365 + 2) * 24 * 60 * 60);
382 secs -= days * 86400;
421 u32 prot = AFFS_I(inode)->i_protect;
443 AFFS_I(inode)->i_protect = prot;
452 vsnprintf(ErrorBuffer,
sizeof(ErrorBuffer),fmt,args);
456 function,ErrorBuffer);
468 vsnprintf(ErrorBuffer,
sizeof(ErrorBuffer),fmt,args);
472 function,ErrorBuffer);
483 #ifdef AFFS_NO_TRUNCATE
489 for (i = 0; i < len; i++) {
490 if (name[i] <
' ' || name[i] ==
':'
491 || (name[i] > 0x7e && name[i] < 0xa0))