22 #include <linux/kernel.h>
23 #include <linux/stddef.h>
24 #include <linux/sched.h>
25 #include <linux/stat.h>
26 #include <linux/string.h>
63 *bh = sb_bread(sb, block);
70 static int refill_free_cache(
struct super_block *sb)
73 struct buffer_head * bh;
81 while (ino <= sbi->s_ninodes) {
83 *sv_sb_fic_inode(sb,i++) = cpu_to_fs16(SYSV_SB(sb),
ino);
105 struct buffer_head * bh;
111 if (ino <= SYSV_ROOT_INO || ino > sbi->
s_ninodes) {
112 printk(
"sysv_free_inode: inode 0,1,2 or nonexistent inode\n");
117 printk(
"sysv_free_inode: unable to read inode block on device "
118 "%s\n", inode->
i_sb->s_id);
123 if (count < sbi->s_fic_size) {
124 *sv_sb_fic_inode(sb,count++) = cpu_to_fs16(sbi, ino);
152 if (count == 0 || (*sv_sb_fic_inode(sb,count-1) == 0)) {
153 count = refill_free_cache(sb);
161 ino = *sv_sb_fic_inode(sb,--count);
166 inode->
i_ino = fs16_to_cpu(sbi, ino);
169 memset(SYSV_I(inode)->i_data, 0,
sizeof(SYSV_I(inode)->i_data));
170 SYSV_I(inode)->i_dir_start_lookup = 0;
171 insert_inode_hash(inode);
172 mark_inode_dirty(inode);
175 mark_inode_dirty(inode);
184 struct buffer_head * bh;
201 while (ino <= sbi->s_ninodes) {
213 if (count != sb_count)
220 printk(
"sysv_count_free_inodes: "
221 "free inode count was %d, correcting to %d\n",
230 printk(
"sysv_count_free_inodes: unable to read inode table\n");