23 #include <linux/string.h>
32 char *bh_data = bh->b_data;
45 struct buffer_head * bh;
48 unsigned block = fs32_to_cpu(sbi, nr);
59 printk(
"sysv_free_block: trying to free block not in datazone\n");
67 printk(
"sysv_free_block: flc_count > flc_size\n");
77 bh = sb_getblk(sb, block);
79 printk(
"sysv_free_block: getblk() failed\n");
84 *(
__fs16*)bh->b_data = cpu_to_fs16(sbi, count);
87 set_buffer_uptodate(bh);
104 struct buffer_head * bh;
116 block = fs32_to_cpu(sbi, nr);
121 printk(
"sysv_new_block: new block %d is not in data zone\n",
130 if (!(bh = sb_bread(sb, block))) {
131 printk(
"sysv_new_block: cannot read free-list block\n");
136 count = fs16_to_cpu(sbi, *(
__fs16*)bh->b_data);
138 printk(
"sysv_new_block: free-list block with >flc_size entries\n");
163 struct buffer_head * bh =
NULL;
191 while (n && (zone = blocks[--n]) != 0)
196 block = fs32_to_cpu(sbi, zone);
203 bh = sb_bread(sb, block);
206 n = fs16_to_cpu(sbi, *(
__fs16*)bh->b_data);
207 blocks = get_chunk(sb, bh);
211 if (count != sb_count)
218 printk(
"sysv_count_free_blocks: new block %d is not in data zone\n",
222 printk(
"sysv_count_free_blocks: cannot read free-list block\n");
225 printk(
"sysv_count_free_blocks: >flc_size entries in free-list block\n");
232 printk(
"sysv_count_free_blocks: free block count was %d, "
233 "correcting to %d\n", sb_count, count);