tag | line | file | source code |
sb | 108 | drivers/block/ramdisk.c | } sb; |
sb | 110 | drivers/block/ramdisk.c | (struct minix_super_block *)&sb; |
sb | 112 | drivers/block/ramdisk.c | (struct ext2_super_block *)&sb; |
sb | 135 | drivers/block/ramdisk.c | *((struct super_block *) &sb) = |
sb | 777 | drivers/char/tpqic02.c | static int send_qic02_data(char sb[], unsigned size, int ignore_ex) |
sb | 787 | drivers/char/tpqic02.c | stat = notify_cmd(sb[i], ignore_ex); |
sb | 40 | fs/ext/freelists.c | void ext_free_block(struct super_block * sb, int block) |
sb | 45 | fs/ext/freelists.c | if (!sb) { |
sb | 49 | fs/ext/freelists.c | lock_super (sb); |
sb | 50 | fs/ext/freelists.c | if (block < sb->u.ext_sb.s_firstdatazone || |
sb | 51 | fs/ext/freelists.c | block >= sb->u.ext_sb.s_nzones) { |
sb | 55 | fs/ext/freelists.c | bh = get_hash_table(sb->s_dev, block, sb->s_blocksize); |
sb | 59 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeblock) |
sb | 60 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 61 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblock || efb->count == 254) { |
sb | 65 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeblock) |
sb | 66 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeblock); |
sb | 67 | fs/ext/freelists.c | if (!(sb->u.ext_sb.s_firstfreeblock = bread (sb->s_dev, |
sb | 68 | fs/ext/freelists.c | block, sb->s_blocksize))) |
sb | 70 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 71 | fs/ext/freelists.c | efb->next = sb->u.ext_sb.s_firstfreeblocknumber; |
sb | 73 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblocknumber = block; |
sb | 77 | fs/ext/freelists.c | sb->u.ext_sb.s_freeblockscount ++; |
sb | 78 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 79 | fs/ext/freelists.c | mark_buffer_dirty(sb->u.ext_sb.s_firstfreeblock, 1); |
sb | 80 | fs/ext/freelists.c | unlock_super (sb); |
sb | 84 | fs/ext/freelists.c | int ext_new_block(struct super_block * sb) |
sb | 90 | fs/ext/freelists.c | if (!sb) { |
sb | 94 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblock) |
sb | 96 | fs/ext/freelists.c | lock_super (sb); |
sb | 97 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 100 | fs/ext/freelists.c | mark_buffer_dirty(sb->u.ext_sb.s_firstfreeblock, 1); |
sb | 105 | fs/ext/freelists.c | j = sb->u.ext_sb.s_firstfreeblocknumber; |
sb | 106 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblocknumber = efb->next; |
sb | 107 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeblock); |
sb | 108 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblocknumber) { |
sb | 109 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblock = NULL; |
sb | 111 | fs/ext/freelists.c | if (!(sb->u.ext_sb.s_firstfreeblock = bread (sb->s_dev, |
sb | 112 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblocknumber, |
sb | 113 | fs/ext/freelists.c | sb->s_blocksize))) |
sb | 117 | fs/ext/freelists.c | if (j < sb->u.ext_sb.s_firstdatazone || j > sb->u.ext_sb.s_nzones) { |
sb | 122 | fs/ext/freelists.c | sb->u.ext_sb.s_freeblockscount --; |
sb | 123 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 125 | fs/ext/freelists.c | if (!(bh=getblk(sb->s_dev, j, sb->s_blocksize))) { |
sb | 136 | fs/ext/freelists.c | unlock_super (sb); |
sb | 140 | fs/ext/freelists.c | unsigned long ext_count_free_blocks(struct super_block *sb) |
sb | 147 | fs/ext/freelists.c | lock_super (sb); |
sb | 148 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblock) |
sb | 151 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 155 | fs/ext/freelists.c | if (!(bh = bread (sb->s_dev, block, sb->s_blocksize))) { |
sb | 167 | fs/ext/freelists.c | sb->u.ext_sb.s_freeblockscount, count); |
sb | 168 | fs/ext/freelists.c | unlock_super (sb); |
sb | 171 | fs/ext/freelists.c | return sb->u.ext_sb.s_freeblockscount; |
sb | 179 | fs/ext/freelists.c | struct super_block * sb; |
sb | 202 | fs/ext/freelists.c | sb = inode->i_sb; |
sb | 206 | fs/ext/freelists.c | lock_super (sb); |
sb | 207 | fs/ext/freelists.c | if (ino < 1 || ino > sb->u.ext_sb.s_ninodes) { |
sb | 209 | fs/ext/freelists.c | unlock_super (sb); |
sb | 212 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 213 | fs/ext/freelists.c | efi = ((struct ext_free_inode *) sb->u.ext_sb.s_firstfreeinodeblock->b_data) + |
sb | 214 | fs/ext/freelists.c | (sb->u.ext_sb.s_firstfreeinodenumber-1)%EXT_INODES_PER_BLOCK; |
sb | 215 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodeblock || efi->count == 14) { |
sb | 219 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 220 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeinodeblock); |
sb | 222 | fs/ext/freelists.c | if (!(bh = bread(dev, block, sb->s_blocksize))) |
sb | 226 | fs/ext/freelists.c | efi->next = sb->u.ext_sb.s_firstfreeinodenumber; |
sb | 228 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodenumber = ino; |
sb | 229 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodeblock = bh; |
sb | 233 | fs/ext/freelists.c | sb->u.ext_sb.s_freeinodescount ++; |
sb | 234 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 235 | fs/ext/freelists.c | mark_buffer_dirty(sb->u.ext_sb.s_firstfreeinodeblock, 1); |
sb | 236 | fs/ext/freelists.c | unlock_super (sb); |
sb | 241 | fs/ext/freelists.c | struct super_block * sb; |
sb | 249 | fs/ext/freelists.c | sb = dir->i_sb; |
sb | 250 | fs/ext/freelists.c | inode->i_sb = sb; |
sb | 251 | fs/ext/freelists.c | inode->i_flags = sb->s_flags; |
sb | 252 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 254 | fs/ext/freelists.c | lock_super (sb); |
sb | 255 | fs/ext/freelists.c | efi = ((struct ext_free_inode *) sb->u.ext_sb.s_firstfreeinodeblock->b_data) + |
sb | 256 | fs/ext/freelists.c | (sb->u.ext_sb.s_firstfreeinodenumber-1)%EXT_INODES_PER_BLOCK; |
sb | 259 | fs/ext/freelists.c | mark_buffer_dirty(sb->u.ext_sb.s_firstfreeinodeblock, 1); |
sb | 264 | fs/ext/freelists.c | j = sb->u.ext_sb.s_firstfreeinodenumber; |
sb | 265 | fs/ext/freelists.c | if (efi->next > sb->u.ext_sb.s_ninodes) { |
sb | 269 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodenumber = efi->next; |
sb | 271 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeinodeblock); |
sb | 272 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodenumber) { |
sb | 273 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodeblock = NULL; |
sb | 275 | fs/ext/freelists.c | if (!(sb->u.ext_sb.s_firstfreeinodeblock = |
sb | 276 | fs/ext/freelists.c | bread(sb->s_dev, block, sb->s_blocksize))) |
sb | 280 | fs/ext/freelists.c | sb->u.ext_sb.s_freeinodescount --; |
sb | 281 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 284 | fs/ext/freelists.c | inode->i_dev = sb->s_dev; |
sb | 296 | fs/ext/freelists.c | unlock_super (sb); |
sb | 300 | fs/ext/freelists.c | unsigned long ext_count_free_inodes(struct super_block *sb) |
sb | 307 | fs/ext/freelists.c | lock_super (sb); |
sb | 308 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 311 | fs/ext/freelists.c | efi = ((struct ext_free_inode *) sb->u.ext_sb.s_firstfreeinodeblock->b_data) + |
sb | 312 | fs/ext/freelists.c | ((sb->u.ext_sb.s_firstfreeinodenumber-1)%EXT_INODES_PER_BLOCK); |
sb | 316 | fs/ext/freelists.c | if (ino < 1 || ino > sb->u.ext_sb.s_ninodes) { |
sb | 318 | fs/ext/freelists.c | (int) sb->u.ext_sb.s_firstfreeinodenumber,ino); |
sb | 322 | fs/ext/freelists.c | if (!(bh = bread (sb->s_dev, block, sb->s_blocksize))) { |
sb | 335 | fs/ext/freelists.c | sb->u.ext_sb.s_freeinodescount, count); |
sb | 336 | fs/ext/freelists.c | unlock_super (sb); |
sb | 339 | fs/ext/freelists.c | return sb->u.ext_sb.s_freeinodescount; |
sb | 33 | fs/ext/inode.c | void ext_put_super(struct super_block *sb) |
sb | 36 | fs/ext/inode.c | lock_super(sb); |
sb | 37 | fs/ext/inode.c | sb->s_dev = 0; |
sb | 38 | fs/ext/inode.c | if (sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 39 | fs/ext/inode.c | brelse (sb->u.ext_sb.s_firstfreeinodeblock); |
sb | 40 | fs/ext/inode.c | if (sb->u.ext_sb.s_firstfreeblock) |
sb | 41 | fs/ext/inode.c | brelse (sb->u.ext_sb.s_firstfreeblock); |
sb | 42 | fs/ext/inode.c | unlock_super(sb); |
sb | 128 | fs/ext/inode.c | void ext_write_super (struct super_block *sb) |
sb | 133 | fs/ext/inode.c | if (!(bh = bread(sb->s_dev, 1, BLOCK_SIZE))) { |
sb | 138 | fs/ext/inode.c | es->s_firstfreeblock = sb->u.ext_sb.s_firstfreeblocknumber; |
sb | 139 | fs/ext/inode.c | es->s_freeblockscount = sb->u.ext_sb.s_freeblockscount; |
sb | 140 | fs/ext/inode.c | es->s_firstfreeinode = sb->u.ext_sb.s_firstfreeinodenumber; |
sb | 141 | fs/ext/inode.c | es->s_freeinodescount = sb->u.ext_sb.s_freeinodescount; |
sb | 144 | fs/ext/inode.c | sb->s_dirt = 0; |
sb | 147 | fs/ext/inode.c | void ext_statfs (struct super_block *sb, struct statfs *buf) |
sb | 153 | fs/ext/inode.c | put_fs_long(sb->u.ext_sb.s_nzones << sb->u.ext_sb.s_log_zone_size, |
sb | 155 | fs/ext/inode.c | tmp = ext_count_free_blocks(sb); |
sb | 158 | fs/ext/inode.c | put_fs_long(sb->u.ext_sb.s_ninodes, &buf->f_files); |
sb | 159 | fs/ext/inode.c | put_fs_long(ext_count_free_inodes(sb), &buf->f_ffree); |
sb | 37 | fs/ext2/balloc.c | static struct ext2_group_desc * get_group_desc (struct super_block * sb, |
sb | 45 | fs/ext2/balloc.c | if (block_group >= sb->u.ext2_sb.s_groups_count) |
sb | 46 | fs/ext2/balloc.c | ext2_panic (sb, "get_group_desc", |
sb | 49 | fs/ext2/balloc.c | block_group, sb->u.ext2_sb.s_groups_count); |
sb | 51 | fs/ext2/balloc.c | group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); |
sb | 52 | fs/ext2/balloc.c | desc = block_group % EXT2_DESC_PER_BLOCK(sb); |
sb | 53 | fs/ext2/balloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) |
sb | 54 | fs/ext2/balloc.c | ext2_panic (sb, "get_group_desc", |
sb | 59 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 61 | fs/ext2/balloc.c | *bh = sb->u.ext2_sb.s_group_desc[group_desc]; |
sb | 65 | fs/ext2/balloc.c | static void read_block_bitmap (struct super_block * sb, |
sb | 72 | fs/ext2/balloc.c | gdp = get_group_desc (sb, block_group, NULL); |
sb | 73 | fs/ext2/balloc.c | bh = bread (sb->s_dev, gdp->bg_block_bitmap, sb->s_blocksize); |
sb | 75 | fs/ext2/balloc.c | ext2_panic (sb, "read_block_bitmap", |
sb | 79 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[bitmap_nr] = block_group; |
sb | 80 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[bitmap_nr] = bh; |
sb | 94 | fs/ext2/balloc.c | static int load__block_bitmap (struct super_block * sb, |
sb | 101 | fs/ext2/balloc.c | if (block_group >= sb->u.ext2_sb.s_groups_count) |
sb | 102 | fs/ext2/balloc.c | ext2_panic (sb, "load_block_bitmap", |
sb | 105 | fs/ext2/balloc.c | block_group, sb->u.ext2_sb.s_groups_count); |
sb | 107 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_groups_count <= EXT2_MAX_GROUP_LOADED) { |
sb | 108 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_block_bitmap[block_group]) { |
sb | 109 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_block_bitmap_number[block_group] != |
sb | 111 | fs/ext2/balloc.c | ext2_panic (sb, "load_block_bitmap", |
sb | 116 | fs/ext2/balloc.c | read_block_bitmap (sb, block_group, block_group); |
sb | 121 | fs/ext2/balloc.c | for (i = 0; i < sb->u.ext2_sb.s_loaded_block_bitmaps && |
sb | 122 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[i] != block_group; i++) |
sb | 124 | fs/ext2/balloc.c | if (i < sb->u.ext2_sb.s_loaded_block_bitmaps && |
sb | 125 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[i] == block_group) { |
sb | 126 | fs/ext2/balloc.c | block_bitmap_number = sb->u.ext2_sb.s_block_bitmap_number[i]; |
sb | 127 | fs/ext2/balloc.c | block_bitmap = sb->u.ext2_sb.s_block_bitmap[i]; |
sb | 129 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j] = |
sb | 130 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j - 1]; |
sb | 131 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j] = |
sb | 132 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j - 1]; |
sb | 134 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[0] = block_bitmap_number; |
sb | 135 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[0] = block_bitmap; |
sb | 137 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_loaded_block_bitmaps < EXT2_MAX_GROUP_LOADED) |
sb | 138 | fs/ext2/balloc.c | sb->u.ext2_sb.s_loaded_block_bitmaps++; |
sb | 140 | fs/ext2/balloc.c | brelse (sb->u.ext2_sb.s_block_bitmap[EXT2_MAX_GROUP_LOADED - 1]); |
sb | 141 | fs/ext2/balloc.c | for (j = sb->u.ext2_sb.s_loaded_block_bitmaps - 1; j > 0; j--) { |
sb | 142 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j] = |
sb | 143 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j - 1]; |
sb | 144 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j] = |
sb | 145 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j - 1]; |
sb | 147 | fs/ext2/balloc.c | read_block_bitmap (sb, block_group, 0); |
sb | 152 | fs/ext2/balloc.c | static inline int load_block_bitmap (struct super_block * sb, |
sb | 155 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_loaded_block_bitmaps > 0 && |
sb | 156 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[0] == block_group) |
sb | 159 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_groups_count <= EXT2_MAX_GROUP_LOADED && |
sb | 160 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[block_group] == block_group && |
sb | 161 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[block_group]) |
sb | 164 | fs/ext2/balloc.c | return load__block_bitmap (sb, block_group); |
sb | 167 | fs/ext2/balloc.c | void ext2_free_blocks (struct super_block * sb, unsigned long block, |
sb | 179 | fs/ext2/balloc.c | if (!sb) { |
sb | 183 | fs/ext2/balloc.c | lock_super (sb); |
sb | 184 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 187 | fs/ext2/balloc.c | ext2_error (sb, "ext2_free_blocks", |
sb | 190 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 197 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb); |
sb | 198 | fs/ext2/balloc.c | bit = (block - es->s_first_data_block) % EXT2_BLOCKS_PER_GROUP(sb); |
sb | 199 | fs/ext2/balloc.c | if (bit + count > EXT2_BLOCKS_PER_GROUP(sb)) |
sb | 200 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_free_blocks", |
sb | 204 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, block_group); |
sb | 205 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 206 | fs/ext2/balloc.c | gdp = get_group_desc (sb, block_group, &bh2); |
sb | 208 | fs/ext2/balloc.c | if (test_opt (sb, CHECK_STRICT) && |
sb | 212 | fs/ext2/balloc.c | sb->u.ext2_sb.s_itb_per_group) || |
sb | 214 | fs/ext2/balloc.c | sb->u.ext2_sb.s_itb_per_group))) |
sb | 215 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_free_blocks", |
sb | 222 | fs/ext2/balloc.c | ext2_warning (sb, "ext2_free_blocks", |
sb | 232 | fs/ext2/balloc.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 235 | fs/ext2/balloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 239 | fs/ext2/balloc.c | sb->s_dirt = 1; |
sb | 240 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 251 | fs/ext2/balloc.c | int ext2_new_block (struct super_block * sb, unsigned long goal, |
sb | 267 | fs/ext2/balloc.c | if (!sb) { |
sb | 271 | fs/ext2/balloc.c | lock_super (sb); |
sb | 272 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 274 | fs/ext2/balloc.c | (!fsuser() && (sb->u.ext2_sb.s_resuid != current->fsuid) && |
sb | 275 | fs/ext2/balloc.c | (sb->u.ext2_sb.s_resgid == 0 || |
sb | 276 | fs/ext2/balloc.c | !in_group_p (sb->u.ext2_sb.s_resgid)))) { |
sb | 277 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 289 | fs/ext2/balloc.c | i = (goal - es->s_first_data_block) / EXT2_BLOCKS_PER_GROUP(sb); |
sb | 290 | fs/ext2/balloc.c | gdp = get_group_desc (sb, i, &bh2); |
sb | 292 | fs/ext2/balloc.c | j = ((goal - es->s_first_data_block) % EXT2_BLOCKS_PER_GROUP(sb)); |
sb | 297 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 298 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 316 | fs/ext2/balloc.c | if (j < EXT2_BLOCKS_PER_GROUP(sb) - 32) |
sb | 323 | fs/ext2/balloc.c | if ((j + k) < EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 342 | fs/ext2/balloc.c | r = memscan(p, 0, (EXT2_BLOCKS_PER_GROUP(sb) - j + 7) >> 3); |
sb | 344 | fs/ext2/balloc.c | if (k < EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 349 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb), |
sb | 351 | fs/ext2/balloc.c | if (k < EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 363 | fs/ext2/balloc.c | for (k = 0; k < sb->u.ext2_sb.s_groups_count; k++) { |
sb | 365 | fs/ext2/balloc.c | if (i >= sb->u.ext2_sb.s_groups_count) |
sb | 367 | fs/ext2/balloc.c | gdp = get_group_desc (sb, i, &bh2); |
sb | 371 | fs/ext2/balloc.c | if (k >= sb->u.ext2_sb.s_groups_count) { |
sb | 372 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 375 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 376 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 377 | fs/ext2/balloc.c | r = memscan(bh->b_data, 0, EXT2_BLOCKS_PER_GROUP(sb) >> 3); |
sb | 379 | fs/ext2/balloc.c | if (j < EXT2_BLOCKS_PER_GROUP(sb)) |
sb | 383 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb)); |
sb | 384 | fs/ext2/balloc.c | if (j >= EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 385 | fs/ext2/balloc.c | ext2_error (sb, "ext2_new_block", |
sb | 387 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 403 | fs/ext2/balloc.c | tmp = j + i * EXT2_BLOCKS_PER_GROUP(sb) + es->s_first_data_block; |
sb | 405 | fs/ext2/balloc.c | if (test_opt (sb, CHECK_STRICT) && |
sb | 408 | fs/ext2/balloc.c | in_range (tmp, gdp->bg_inode_table, sb->u.ext2_sb.s_itb_per_group))) |
sb | 409 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_new_block", |
sb | 414 | fs/ext2/balloc.c | ext2_warning (sb, "ext2_new_block", |
sb | 429 | fs/ext2/balloc.c | k < 8 && (j + k) < EXT2_BLOCKS_PER_GROUP(sb); k++) { |
sb | 444 | fs/ext2/balloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 450 | fs/ext2/balloc.c | ext2_error (sb, "ext2_new_block", |
sb | 453 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 456 | fs/ext2/balloc.c | if (!(bh = getblk (sb->s_dev, j, sb->s_blocksize))) { |
sb | 457 | fs/ext2/balloc.c | ext2_error (sb, "ext2_new_block", "cannot get block %d", j); |
sb | 458 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 461 | fs/ext2/balloc.c | memset(bh->b_data, 0, sb->s_blocksize); |
sb | 472 | fs/ext2/balloc.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 473 | fs/ext2/balloc.c | sb->s_dirt = 1; |
sb | 474 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 478 | fs/ext2/balloc.c | unsigned long ext2_count_free_blocks (struct super_block * sb) |
sb | 487 | fs/ext2/balloc.c | lock_super (sb); |
sb | 488 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 492 | fs/ext2/balloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 493 | fs/ext2/balloc.c | gdp = get_group_desc (sb, i, NULL); |
sb | 495 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 496 | fs/ext2/balloc.c | x = ext2_count_free (sb->u.ext2_sb.s_block_bitmap[bitmap_nr], |
sb | 497 | fs/ext2/balloc.c | sb->s_blocksize); |
sb | 504 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 507 | fs/ext2/balloc.c | return sb->u.ext2_sb.s_es->s_free_blocks_count; |
sb | 512 | fs/ext2/balloc.c | struct super_block * sb, |
sb | 515 | fs/ext2/balloc.c | return test_bit ((block - sb->u.ext2_sb.s_es->s_first_data_block) % |
sb | 516 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb), map); |
sb | 519 | fs/ext2/balloc.c | void ext2_check_blocks_bitmap (struct super_block * sb) |
sb | 529 | fs/ext2/balloc.c | lock_super (sb); |
sb | 530 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 534 | fs/ext2/balloc.c | desc_blocks = (sb->u.ext2_sb.s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / |
sb | 535 | fs/ext2/balloc.c | EXT2_DESC_PER_BLOCK(sb); |
sb | 536 | fs/ext2/balloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 537 | fs/ext2/balloc.c | gdp = get_group_desc (sb, i, NULL); |
sb | 539 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 540 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 543 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 548 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 552 | fs/ext2/balloc.c | if (!block_in_use (gdp->bg_block_bitmap, sb, bh->b_data)) |
sb | 553 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 557 | fs/ext2/balloc.c | if (!block_in_use (gdp->bg_inode_bitmap, sb, bh->b_data)) |
sb | 558 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 562 | fs/ext2/balloc.c | for (j = 0; j < sb->u.ext2_sb.s_itb_per_group; j++) |
sb | 563 | fs/ext2/balloc.c | if (!block_in_use (gdp->bg_inode_table + j, sb, bh->b_data)) |
sb | 564 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 568 | fs/ext2/balloc.c | x = ext2_count_free (bh, sb->s_blocksize); |
sb | 570 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 577 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 581 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 107 | fs/ext2/dir.c | struct super_block * sb; |
sb | 112 | fs/ext2/dir.c | sb = inode->i_sb; |
sb | 116 | fs/ext2/dir.c | offset = filp->f_pos & (sb->s_blocksize - 1); |
sb | 119 | fs/ext2/dir.c | blk = (filp->f_pos) >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 122 | fs/ext2/dir.c | filp->f_pos += sb->s_blocksize - offset; |
sb | 130 | fs/ext2/dir.c | for (i = 16 >> (EXT2_BLOCK_SIZE_BITS(sb) - 9), num = 0; |
sb | 151 | fs/ext2/dir.c | for (i = 0; i < sb->s_blocksize && i < offset; ) { |
sb | 165 | fs/ext2/dir.c | filp->f_pos = (filp->f_pos & ~(sb->s_blocksize - 1)) |
sb | 171 | fs/ext2/dir.c | && offset < sb->s_blocksize) { |
sb | 177 | fs/ext2/dir.c | filp->f_pos = (filp->f_pos & (sb->s_blocksize - 1)) |
sb | 178 | fs/ext2/dir.c | + sb->s_blocksize; |
sb | 89 | fs/ext2/file.c | struct super_block * sb; |
sb | 97 | fs/ext2/file.c | sb = inode->i_sb; |
sb | 99 | fs/ext2/file.c | ext2_warning (sb, "ext2_file_read", "mode = %07o", |
sb | 114 | fs/ext2/file.c | block = offset >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 115 | fs/ext2/file.c | offset &= (sb->s_blocksize - 1); |
sb | 116 | fs/ext2/file.c | size = (size + sb->s_blocksize - 1) >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 117 | fs/ext2/file.c | blocks = (left + offset + sb->s_blocksize - 1) >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 120 | fs/ext2/file.c | if (blocks < read_ahead[MAJOR(inode->i_dev)] >> (EXT2_BLOCK_SIZE_BITS(sb) - 9)) |
sb | 121 | fs/ext2/file.c | blocks = read_ahead[MAJOR(inode->i_dev)] >> (EXT2_BLOCK_SIZE_BITS(sb) - 9); |
sb | 190 | fs/ext2/file.c | if (left < sb->s_blocksize - offset) |
sb | 193 | fs/ext2/file.c | chars = sb->s_blocksize - offset; |
sb | 239 | fs/ext2/file.c | struct super_block * sb; |
sb | 248 | fs/ext2/file.c | sb = inode->i_sb; |
sb | 249 | fs/ext2/file.c | if (sb->s_flags & MS_RDONLY) |
sb | 256 | fs/ext2/file.c | ext2_warning (sb, "ext2_file_write", "mode = %07o", |
sb | 281 | fs/ext2/file.c | bh = ext2_getblk (inode, pos2 / sb->s_blocksize, 1, &err); |
sb | 287 | fs/ext2/file.c | c = sb->s_blocksize - (pos2 % sb->s_blocksize); |
sb | 290 | fs/ext2/file.c | if (c != sb->s_blocksize && !bh->b_uptodate) { |
sb | 300 | fs/ext2/file.c | p = (pos2 % sb->s_blocksize) + bh->b_data; |
sb | 36 | fs/ext2/ialloc.c | static struct ext2_group_desc * get_group_desc (struct super_block * sb, |
sb | 44 | fs/ext2/ialloc.c | if (block_group >= sb->u.ext2_sb.s_groups_count) |
sb | 45 | fs/ext2/ialloc.c | ext2_panic (sb, "get_group_desc", |
sb | 48 | fs/ext2/ialloc.c | block_group, sb->u.ext2_sb.s_groups_count); |
sb | 50 | fs/ext2/ialloc.c | group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); |
sb | 51 | fs/ext2/ialloc.c | desc = block_group % EXT2_DESC_PER_BLOCK(sb); |
sb | 52 | fs/ext2/ialloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) |
sb | 53 | fs/ext2/ialloc.c | ext2_panic (sb, "get_group_desc", |
sb | 58 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 60 | fs/ext2/ialloc.c | *bh = sb->u.ext2_sb.s_group_desc[group_desc]; |
sb | 64 | fs/ext2/ialloc.c | static void read_inode_bitmap (struct super_block * sb, |
sb | 71 | fs/ext2/ialloc.c | gdp = get_group_desc (sb, block_group, NULL); |
sb | 72 | fs/ext2/ialloc.c | bh = bread (sb->s_dev, gdp->bg_inode_bitmap, sb->s_blocksize); |
sb | 74 | fs/ext2/ialloc.c | ext2_panic (sb, "read_inode_bitmap", |
sb | 78 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[bitmap_nr] = block_group; |
sb | 79 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[bitmap_nr] = bh; |
sb | 93 | fs/ext2/ialloc.c | static int load_inode_bitmap (struct super_block * sb, |
sb | 100 | fs/ext2/ialloc.c | if (block_group >= sb->u.ext2_sb.s_groups_count) |
sb | 101 | fs/ext2/ialloc.c | ext2_panic (sb, "load_inode_bitmap", |
sb | 104 | fs/ext2/ialloc.c | block_group, sb->u.ext2_sb.s_groups_count); |
sb | 105 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_loaded_inode_bitmaps > 0 && |
sb | 106 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[0] == block_group) |
sb | 108 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_groups_count <= EXT2_MAX_GROUP_LOADED) { |
sb | 109 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_inode_bitmap[block_group]) { |
sb | 110 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_inode_bitmap_number[block_group] != block_group) |
sb | 111 | fs/ext2/ialloc.c | ext2_panic (sb, "load_inode_bitmap", |
sb | 116 | fs/ext2/ialloc.c | read_inode_bitmap (sb, block_group, block_group); |
sb | 121 | fs/ext2/ialloc.c | for (i = 0; i < sb->u.ext2_sb.s_loaded_inode_bitmaps && |
sb | 122 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[i] != block_group; |
sb | 125 | fs/ext2/ialloc.c | if (i < sb->u.ext2_sb.s_loaded_inode_bitmaps && |
sb | 126 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[i] == block_group) { |
sb | 127 | fs/ext2/ialloc.c | inode_bitmap_number = sb->u.ext2_sb.s_inode_bitmap_number[i]; |
sb | 128 | fs/ext2/ialloc.c | inode_bitmap = sb->u.ext2_sb.s_inode_bitmap[i]; |
sb | 130 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j] = |
sb | 131 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j - 1]; |
sb | 132 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j] = |
sb | 133 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j - 1]; |
sb | 135 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[0] = inode_bitmap_number; |
sb | 136 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[0] = inode_bitmap; |
sb | 138 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_loaded_inode_bitmaps < EXT2_MAX_GROUP_LOADED) |
sb | 139 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_loaded_inode_bitmaps++; |
sb | 141 | fs/ext2/ialloc.c | brelse (sb->u.ext2_sb.s_inode_bitmap[EXT2_MAX_GROUP_LOADED - 1]); |
sb | 142 | fs/ext2/ialloc.c | for (j = sb->u.ext2_sb.s_loaded_inode_bitmaps - 1; j > 0; j--) { |
sb | 143 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j] = |
sb | 144 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j - 1]; |
sb | 145 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j] = |
sb | 146 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j - 1]; |
sb | 148 | fs/ext2/ialloc.c | read_inode_bitmap (sb, block_group, 0); |
sb | 190 | fs/ext2/ialloc.c | struct super_block * sb; |
sb | 222 | fs/ext2/ialloc.c | sb = inode->i_sb; |
sb | 223 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 225 | fs/ext2/ialloc.c | inode->i_ino > sb->u.ext2_sb.s_es->s_inodes_count) { |
sb | 226 | fs/ext2/ialloc.c | ext2_error (sb, "free_inode", |
sb | 228 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 231 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 232 | fs/ext2/ialloc.c | block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(sb); |
sb | 233 | fs/ext2/ialloc.c | bit = (inode->i_ino - 1) % EXT2_INODES_PER_GROUP(sb); |
sb | 234 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, block_group); |
sb | 235 | fs/ext2/ialloc.c | bh = sb->u.ext2_sb.s_inode_bitmap[bitmap_nr]; |
sb | 237 | fs/ext2/ialloc.c | ext2_warning (sb, "ext2_free_inode", |
sb | 240 | fs/ext2/ialloc.c | gdp = get_group_desc (sb, block_group, &bh2); |
sb | 246 | fs/ext2/ialloc.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 250 | fs/ext2/ialloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 255 | fs/ext2/ialloc.c | sb->s_dirt = 1; |
sb | 257 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 307 | fs/ext2/ialloc.c | struct super_block * sb; |
sb | 319 | fs/ext2/ialloc.c | sb = dir->i_sb; |
sb | 320 | fs/ext2/ialloc.c | inode->i_sb = sb; |
sb | 321 | fs/ext2/ialloc.c | inode->i_flags = sb->s_flags; |
sb | 322 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 323 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 329 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_groups_count; |
sb | 344 | fs/ext2/ialloc.c | for (j = 0; j < sb->u.ext2_sb.s_groups_count; j++) { |
sb | 345 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, j, &bh2); |
sb | 364 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, i, &bh2); |
sb | 373 | fs/ext2/ialloc.c | for (j = 1; j < sb->u.ext2_sb.s_groups_count; j <<= 1) { |
sb | 375 | fs/ext2/ialloc.c | if (i >= sb->u.ext2_sb.s_groups_count) |
sb | 376 | fs/ext2/ialloc.c | i -= sb->u.ext2_sb.s_groups_count; |
sb | 377 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, i, &bh2); |
sb | 389 | fs/ext2/ialloc.c | for (j = 2; j < sb->u.ext2_sb.s_groups_count; j++) { |
sb | 390 | fs/ext2/ialloc.c | if (++i >= sb->u.ext2_sb.s_groups_count) |
sb | 392 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, i, &bh2); |
sb | 402 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 406 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, i); |
sb | 407 | fs/ext2/ialloc.c | bh = sb->u.ext2_sb.s_inode_bitmap[bitmap_nr]; |
sb | 409 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb))) < |
sb | 410 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb)) { |
sb | 412 | fs/ext2/ialloc.c | ext2_warning (sb, "ext2_new_inode", |
sb | 417 | fs/ext2/ialloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 423 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_new_inode", |
sb | 426 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 432 | fs/ext2/ialloc.c | j += i * EXT2_INODES_PER_GROUP(sb) + 1; |
sb | 434 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_new_inode", |
sb | 437 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 446 | fs/ext2/ialloc.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 447 | fs/ext2/ialloc.c | sb->s_dirt = 1; |
sb | 449 | fs/ext2/ialloc.c | inode->i_sb = sb; |
sb | 452 | fs/ext2/ialloc.c | inode->i_dev = sb->s_dev; |
sb | 454 | fs/ext2/ialloc.c | if (test_opt (sb, GRPID)) |
sb | 464 | fs/ext2/ialloc.c | inode->i_blksize = sb->s_blocksize; |
sb | 485 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 489 | fs/ext2/ialloc.c | unsigned long ext2_count_free_inodes (struct super_block * sb) |
sb | 498 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 499 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 503 | fs/ext2/ialloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 504 | fs/ext2/ialloc.c | gdp = get_group_desc (sb, i, NULL); |
sb | 506 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, i); |
sb | 507 | fs/ext2/ialloc.c | x = ext2_count_free (sb->u.ext2_sb.s_inode_bitmap[bitmap_nr], |
sb | 508 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb) / 8); |
sb | 515 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 518 | fs/ext2/ialloc.c | return sb->u.ext2_sb.s_es->s_free_inodes_count; |
sb | 522 | fs/ext2/ialloc.c | void ext2_check_inodes_bitmap (struct super_block * sb) |
sb | 530 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 531 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 535 | fs/ext2/ialloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 536 | fs/ext2/ialloc.c | gdp = get_group_desc (sb, i, NULL); |
sb | 538 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, i); |
sb | 539 | fs/ext2/ialloc.c | x = ext2_count_free (sb->u.ext2_sb.s_inode_bitmap[bitmap_nr], |
sb | 540 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb) / 8); |
sb | 542 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_check_inodes_bitmap", |
sb | 549 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_check_inodes_bitmap", |
sb | 553 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 71 | fs/ext2/namei.c | struct super_block * sb; |
sb | 80 | fs/ext2/namei.c | sb = dir->i_sb; |
sb | 95 | fs/ext2/namei.c | if ((block << EXT2_BLOCK_SIZE_BITS (sb)) >= dir->i_size) |
sb | 116 | fs/ext2/namei.c | ext2_panic (sb, "ext2_find_entry", |
sb | 127 | fs/ext2/namei.c | dlimit = bh->b_data + sb->s_blocksize; |
sb | 146 | fs/ext2/namei.c | if (((block + NAMEI_RA_SIZE) << EXT2_BLOCK_SIZE_BITS (sb)) >= |
sb | 225 | fs/ext2/namei.c | struct super_block * sb; |
sb | 231 | fs/ext2/namei.c | sb = dir->i_sb; |
sb | 257 | fs/ext2/namei.c | if ((char *)de >= sb->s_blocksize + bh->b_data) { |
sb | 260 | fs/ext2/namei.c | bh = ext2_bread (dir, offset >> EXT2_BLOCK_SIZE_BITS(sb), 1, err); |
sb | 273 | fs/ext2/namei.c | de->rec_len = sb->s_blocksize; |
sb | 274 | fs/ext2/namei.c | dir->i_size = offset + sb->s_blocksize; |
sb | 553 | fs/ext2/namei.c | struct super_block * sb; |
sb | 556 | fs/ext2/namei.c | sb = inode->i_sb; |
sb | 574 | fs/ext2/namei.c | if ((void *) de >= (void *) (bh->b_data + sb->s_blocksize)) { |
sb | 576 | fs/ext2/namei.c | bh = ext2_bread (inode, offset >> EXT2_BLOCK_SIZE_BITS(sb), 1, &err); |
sb | 578 | fs/ext2/namei.c | offset += sb->s_blocksize; |
sb | 29 | fs/ext2/super.c | void ext2_error (struct super_block * sb, const char * function, |
sb | 35 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 36 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_state |= EXT2_ERROR_FS; |
sb | 37 | fs/ext2/super.c | sb->u.ext2_sb.s_es->s_state |= EXT2_ERROR_FS; |
sb | 38 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 39 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 44 | fs/ext2/super.c | if (test_opt (sb, ERRORS_PANIC) || |
sb | 45 | fs/ext2/super.c | (sb->u.ext2_sb.s_es->s_errors == EXT2_ERRORS_PANIC && |
sb | 46 | fs/ext2/super.c | !test_opt (sb, ERRORS_CONT) && !test_opt (sb, ERRORS_RO))) |
sb | 48 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 50 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 51 | fs/ext2/super.c | if (test_opt (sb, ERRORS_RO) || |
sb | 52 | fs/ext2/super.c | (sb->u.ext2_sb.s_es->s_errors == EXT2_ERRORS_RO && |
sb | 53 | fs/ext2/super.c | !test_opt (sb, ERRORS_CONT) && !test_opt (sb, ERRORS_PANIC))) { |
sb | 55 | fs/ext2/super.c | sb->s_flags |= MS_RDONLY; |
sb | 59 | fs/ext2/super.c | NORET_TYPE void ext2_panic (struct super_block * sb, const char * function, |
sb | 65 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 66 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_state |= EXT2_ERROR_FS; |
sb | 67 | fs/ext2/super.c | sb->u.ext2_sb.s_es->s_state |= EXT2_ERROR_FS; |
sb | 68 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 69 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 75 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 78 | fs/ext2/super.c | void ext2_warning (struct super_block * sb, const char * function, |
sb | 88 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 91 | fs/ext2/super.c | void ext2_put_super (struct super_block * sb) |
sb | 96 | fs/ext2/super.c | lock_super (sb); |
sb | 97 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 98 | fs/ext2/super.c | sb->u.ext2_sb.s_es->s_state = sb->u.ext2_sb.s_mount_state; |
sb | 99 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 101 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 102 | fs/ext2/super.c | db_count = sb->u.ext2_sb.s_db_per_group; |
sb | 104 | fs/ext2/super.c | if (sb->u.ext2_sb.s_group_desc[i]) |
sb | 105 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_group_desc[i]); |
sb | 106 | fs/ext2/super.c | kfree_s (sb->u.ext2_sb.s_group_desc, |
sb | 109 | fs/ext2/super.c | if (sb->u.ext2_sb.s_inode_bitmap[i]) |
sb | 110 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_inode_bitmap[i]); |
sb | 112 | fs/ext2/super.c | if (sb->u.ext2_sb.s_block_bitmap[i]) |
sb | 113 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_block_bitmap[i]); |
sb | 114 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_sbh); |
sb | 115 | fs/ext2/super.c | unlock_super (sb); |
sb | 132 | fs/ext2/super.c | static int convert_pre_02b_fs (struct super_block * sb, |
sb | 143 | fs/ext2/super.c | bh2 = bread (sb->s_dev, 2, BLOCK_SIZE); |
sb | 149 | fs/ext2/super.c | groups_count = (sb->u.ext2_sb.s_blocks_count - |
sb | 150 | fs/ext2/super.c | sb->u.ext2_sb.s_first_data_block + |
sb | 151 | fs/ext2/super.c | (EXT2_BLOCK_SIZE(sb) * 8) - 1) / |
sb | 152 | fs/ext2/super.c | (EXT2_BLOCK_SIZE(sb) * 8); |
sb | 166 | fs/ext2/super.c | sb->s_magic = EXT2_SUPER_MAGIC; |
sb | 298 | fs/ext2/super.c | static void ext2_setup_super (struct super_block * sb, |
sb | 304 | fs/ext2/super.c | sb->s_flags |= MS_RDONLY; |
sb | 306 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 307 | fs/ext2/super.c | if (!(sb->u.ext2_sb.s_mount_state & EXT2_VALID_FS)) |
sb | 310 | fs/ext2/super.c | else if ((sb->u.ext2_sb.s_mount_state & EXT2_ERROR_FS)) |
sb | 326 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 327 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 328 | fs/ext2/super.c | if (test_opt (sb, DEBUG)) |
sb | 331 | fs/ext2/super.c | EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize, |
sb | 332 | fs/ext2/super.c | sb->u.ext2_sb.s_frag_size, |
sb | 333 | fs/ext2/super.c | sb->u.ext2_sb.s_groups_count, |
sb | 334 | fs/ext2/super.c | EXT2_BLOCKS_PER_GROUP(sb), |
sb | 335 | fs/ext2/super.c | EXT2_INODES_PER_GROUP(sb), |
sb | 336 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_opt); |
sb | 337 | fs/ext2/super.c | if (test_opt (sb, CHECK)) { |
sb | 338 | fs/ext2/super.c | ext2_check_blocks_bitmap (sb); |
sb | 339 | fs/ext2/super.c | ext2_check_inodes_bitmap (sb); |
sb | 344 | fs/ext2/super.c | static int ext2_check_descriptors (struct super_block * sb) |
sb | 348 | fs/ext2/super.c | unsigned long block = sb->u.ext2_sb.s_es->s_first_data_block; |
sb | 353 | fs/ext2/super.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) |
sb | 355 | fs/ext2/super.c | if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) |
sb | 356 | fs/ext2/super.c | gdp = (struct ext2_group_desc *) sb->u.ext2_sb.s_group_desc[desc_block++]->b_data; |
sb | 358 | fs/ext2/super.c | gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) |
sb | 360 | fs/ext2/super.c | ext2_error (sb, "ext2_check_descriptors", |
sb | 367 | fs/ext2/super.c | gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) |
sb | 369 | fs/ext2/super.c | ext2_error (sb, "ext2_check_descriptors", |
sb | 376 | fs/ext2/super.c | gdp->bg_inode_table + sb->u.ext2_sb.s_itb_per_group >= |
sb | 377 | fs/ext2/super.c | block + EXT2_BLOCKS_PER_GROUP(sb)) |
sb | 379 | fs/ext2/super.c | ext2_error (sb, "ext2_check_descriptors", |
sb | 385 | fs/ext2/super.c | block += EXT2_BLOCKS_PER_GROUP(sb); |
sb | 391 | fs/ext2/super.c | struct super_block * ext2_read_super (struct super_block * sb, void * data, |
sb | 400 | fs/ext2/super.c | int dev = sb->s_dev; |
sb | 407 | fs/ext2/super.c | set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL); |
sb | 409 | fs/ext2/super.c | &sb->u.ext2_sb.s_mount_opt)) { |
sb | 410 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 414 | fs/ext2/super.c | lock_super (sb); |
sb | 417 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 418 | fs/ext2/super.c | unlock_super (sb); |
sb | 427 | fs/ext2/super.c | sb->u.ext2_sb.s_es = es; |
sb | 428 | fs/ext2/super.c | sb->s_magic = es->s_magic; |
sb | 429 | fs/ext2/super.c | if (sb->s_magic != EXT2_SUPER_MAGIC |
sb | 431 | fs/ext2/super.c | && sb->s_magic != EXT2_PRE_02B_MAGIC |
sb | 434 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 435 | fs/ext2/super.c | unlock_super (sb); |
sb | 442 | fs/ext2/super.c | sb->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; |
sb | 443 | fs/ext2/super.c | sb->s_blocksize_bits = EXT2_BLOCK_SIZE_BITS(sb); |
sb | 444 | fs/ext2/super.c | if (sb->s_blocksize != BLOCK_SIZE && |
sb | 445 | fs/ext2/super.c | (sb->s_blocksize == 1024 || sb->s_blocksize == 2048 || |
sb | 446 | fs/ext2/super.c | sb->s_blocksize == 4096)) { |
sb | 450 | fs/ext2/super.c | set_blocksize (dev, sb->s_blocksize); |
sb | 451 | fs/ext2/super.c | logic_sb_block = (sb_block*BLOCK_SIZE) / sb->s_blocksize; |
sb | 452 | fs/ext2/super.c | offset = (sb_block*BLOCK_SIZE) % sb->s_blocksize; |
sb | 453 | fs/ext2/super.c | bh = bread (dev, logic_sb_block, sb->s_blocksize); |
sb | 457 | fs/ext2/super.c | sb->u.ext2_sb.s_es = es; |
sb | 459 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 460 | fs/ext2/super.c | unlock_super (sb); |
sb | 466 | fs/ext2/super.c | sb->u.ext2_sb.s_frag_size = EXT2_MIN_FRAG_SIZE << |
sb | 468 | fs/ext2/super.c | if (sb->u.ext2_sb.s_frag_size) |
sb | 469 | fs/ext2/super.c | sb->u.ext2_sb.s_frags_per_block = sb->s_blocksize / |
sb | 470 | fs/ext2/super.c | sb->u.ext2_sb.s_frag_size; |
sb | 472 | fs/ext2/super.c | sb->s_magic = 0; |
sb | 473 | fs/ext2/super.c | sb->u.ext2_sb.s_blocks_per_group = es->s_blocks_per_group; |
sb | 474 | fs/ext2/super.c | sb->u.ext2_sb.s_frags_per_group = es->s_frags_per_group; |
sb | 475 | fs/ext2/super.c | sb->u.ext2_sb.s_inodes_per_group = es->s_inodes_per_group; |
sb | 476 | fs/ext2/super.c | sb->u.ext2_sb.s_inodes_per_block = sb->s_blocksize / |
sb | 478 | fs/ext2/super.c | sb->u.ext2_sb.s_itb_per_group = sb->u.ext2_sb.s_inodes_per_group / |
sb | 479 | fs/ext2/super.c | sb->u.ext2_sb.s_inodes_per_block; |
sb | 480 | fs/ext2/super.c | sb->u.ext2_sb.s_desc_per_block = sb->s_blocksize / |
sb | 482 | fs/ext2/super.c | sb->u.ext2_sb.s_sbh = bh; |
sb | 483 | fs/ext2/super.c | sb->u.ext2_sb.s_es = es; |
sb | 485 | fs/ext2/super.c | sb->u.ext2_sb.s_resuid = resuid; |
sb | 487 | fs/ext2/super.c | sb->u.ext2_sb.s_resuid = es->s_def_resuid; |
sb | 489 | fs/ext2/super.c | sb->u.ext2_sb.s_resgid = resgid; |
sb | 491 | fs/ext2/super.c | sb->u.ext2_sb.s_resgid = es->s_def_resgid; |
sb | 492 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_state = es->s_state; |
sb | 493 | fs/ext2/super.c | sb->u.ext2_sb.s_rename_lock = 0; |
sb | 494 | fs/ext2/super.c | sb->u.ext2_sb.s_rename_wait = NULL; |
sb | 496 | fs/ext2/super.c | if (sb->s_magic == EXT2_PRE_02B_MAGIC) { |
sb | 501 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 502 | fs/ext2/super.c | unlock_super (sb); |
sb | 510 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 511 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 512 | fs/ext2/super.c | unlock_super (sb); |
sb | 517 | fs/ext2/super.c | if (!convert_pre_02b_fs (sb, bh)) { |
sb | 518 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 519 | fs/ext2/super.c | unlock_super (sb); |
sb | 528 | fs/ext2/super.c | if (sb->s_magic != EXT2_SUPER_MAGIC) { |
sb | 529 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 530 | fs/ext2/super.c | unlock_super (sb); |
sb | 537 | fs/ext2/super.c | if (sb->s_blocksize != bh->b_size) { |
sb | 538 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 539 | fs/ext2/super.c | unlock_super (sb); |
sb | 547 | fs/ext2/super.c | if (sb->s_blocksize != sb->u.ext2_sb.s_frag_size) { |
sb | 548 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 549 | fs/ext2/super.c | unlock_super (sb); |
sb | 552 | fs/ext2/super.c | sb->u.ext2_sb.s_frag_size, sb->s_blocksize); |
sb | 556 | fs/ext2/super.c | sb->u.ext2_sb.s_groups_count = (es->s_blocks_count - |
sb | 558 | fs/ext2/super.c | EXT2_BLOCKS_PER_GROUP(sb) - 1) / |
sb | 559 | fs/ext2/super.c | EXT2_BLOCKS_PER_GROUP(sb); |
sb | 560 | fs/ext2/super.c | db_count = (sb->u.ext2_sb.s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / |
sb | 561 | fs/ext2/super.c | EXT2_DESC_PER_BLOCK(sb); |
sb | 562 | fs/ext2/super.c | sb->u.ext2_sb.s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL); |
sb | 563 | fs/ext2/super.c | if (sb->u.ext2_sb.s_group_desc == NULL) { |
sb | 564 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 565 | fs/ext2/super.c | unlock_super (sb); |
sb | 571 | fs/ext2/super.c | sb->u.ext2_sb.s_group_desc[i] = bread (dev, logic_sb_block + i + 1, |
sb | 572 | fs/ext2/super.c | sb->s_blocksize); |
sb | 573 | fs/ext2/super.c | if (!sb->u.ext2_sb.s_group_desc[i]) { |
sb | 574 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 575 | fs/ext2/super.c | unlock_super (sb); |
sb | 577 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_group_desc[j]); |
sb | 578 | fs/ext2/super.c | kfree_s (sb->u.ext2_sb.s_group_desc, |
sb | 585 | fs/ext2/super.c | if (!ext2_check_descriptors (sb)) { |
sb | 586 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 587 | fs/ext2/super.c | unlock_super (sb); |
sb | 589 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_group_desc[j]); |
sb | 590 | fs/ext2/super.c | kfree_s (sb->u.ext2_sb.s_group_desc, |
sb | 597 | fs/ext2/super.c | sb->u.ext2_sb.s_inode_bitmap_number[i] = 0; |
sb | 598 | fs/ext2/super.c | sb->u.ext2_sb.s_inode_bitmap[i] = NULL; |
sb | 599 | fs/ext2/super.c | sb->u.ext2_sb.s_block_bitmap_number[i] = 0; |
sb | 600 | fs/ext2/super.c | sb->u.ext2_sb.s_block_bitmap[i] = NULL; |
sb | 602 | fs/ext2/super.c | sb->u.ext2_sb.s_loaded_inode_bitmaps = 0; |
sb | 603 | fs/ext2/super.c | sb->u.ext2_sb.s_loaded_block_bitmaps = 0; |
sb | 604 | fs/ext2/super.c | sb->u.ext2_sb.s_db_per_group = db_count; |
sb | 605 | fs/ext2/super.c | unlock_super (sb); |
sb | 609 | fs/ext2/super.c | sb->s_dev = dev; |
sb | 610 | fs/ext2/super.c | sb->s_op = &ext2_sops; |
sb | 611 | fs/ext2/super.c | if (!(sb->s_mounted = iget (sb, EXT2_ROOT_INO))) { |
sb | 612 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 614 | fs/ext2/super.c | if (sb->u.ext2_sb.s_group_desc[i]) |
sb | 615 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_group_desc[i]); |
sb | 616 | fs/ext2/super.c | kfree_s (sb->u.ext2_sb.s_group_desc, |
sb | 625 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_group_desc[i], 1); |
sb | 626 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 629 | fs/ext2/super.c | ext2_setup_super (sb, es); |
sb | 630 | fs/ext2/super.c | return sb; |
sb | 633 | fs/ext2/super.c | static void ext2_commit_super (struct super_block * sb, |
sb | 637 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 638 | fs/ext2/super.c | sb->s_dirt = 0; |
sb | 652 | fs/ext2/super.c | void ext2_write_super (struct super_block * sb) |
sb | 656 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 657 | fs/ext2/super.c | es = sb->u.ext2_sb.s_es; |
sb | 665 | fs/ext2/super.c | ext2_commit_super (sb, es); |
sb | 667 | fs/ext2/super.c | sb->s_dirt = 0; |
sb | 670 | fs/ext2/super.c | int ext2_remount (struct super_block * sb, int * flags, char * data) |
sb | 673 | fs/ext2/super.c | unsigned short resuid = sb->u.ext2_sb.s_resuid; |
sb | 674 | fs/ext2/super.c | unsigned short resgid = sb->u.ext2_sb.s_resgid; |
sb | 681 | fs/ext2/super.c | set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL); |
sb | 686 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_opt = new_mount_opt; |
sb | 687 | fs/ext2/super.c | sb->u.ext2_sb.s_resuid = resuid; |
sb | 688 | fs/ext2/super.c | sb->u.ext2_sb.s_resgid = resgid; |
sb | 689 | fs/ext2/super.c | es = sb->u.ext2_sb.s_es; |
sb | 690 | fs/ext2/super.c | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) |
sb | 694 | fs/ext2/super.c | !(sb->u.ext2_sb.s_mount_state & EXT2_VALID_FS)) |
sb | 700 | fs/ext2/super.c | es->s_state = sb->u.ext2_sb.s_mount_state; |
sb | 702 | fs/ext2/super.c | mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1); |
sb | 703 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 704 | fs/ext2/super.c | ext2_commit_super (sb, es); |
sb | 712 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_state = es->s_state; |
sb | 713 | fs/ext2/super.c | sb->s_flags &= ~MS_RDONLY; |
sb | 714 | fs/ext2/super.c | ext2_setup_super (sb, es); |
sb | 719 | fs/ext2/super.c | void ext2_statfs (struct super_block * sb, struct statfs * buf) |
sb | 725 | fs/ext2/super.c | if (test_opt (sb, MINIX_DF)) |
sb | 732 | fs/ext2/super.c | sb->u.ext2_sb.s_db_per_group /* descriptors */ + |
sb | 735 | fs/ext2/super.c | sb->u.ext2_sb.s_itb_per_group /* inode table */; |
sb | 736 | fs/ext2/super.c | overhead = sb->u.ext2_sb.s_es->s_first_data_block + |
sb | 737 | fs/ext2/super.c | sb->u.ext2_sb.s_groups_count * overhead_per_group; |
sb | 741 | fs/ext2/super.c | put_fs_long (sb->s_blocksize, &buf->f_bsize); |
sb | 742 | fs/ext2/super.c | put_fs_long (sb->u.ext2_sb.s_es->s_blocks_count - overhead, |
sb | 744 | fs/ext2/super.c | tmp = ext2_count_free_blocks (sb); |
sb | 746 | fs/ext2/super.c | if (tmp >= sb->u.ext2_sb.s_es->s_r_blocks_count) |
sb | 747 | fs/ext2/super.c | put_fs_long (tmp - sb->u.ext2_sb.s_es->s_r_blocks_count, |
sb | 751 | fs/ext2/super.c | put_fs_long (sb->u.ext2_sb.s_es->s_inodes_count, &buf->f_files); |
sb | 752 | fs/ext2/super.c | put_fs_long (ext2_count_free_inodes (sb), &buf->f_ffree); |
sb | 494 | fs/inode.c | struct inode * __iget(struct super_block * sb, int nr, int crossmntp) |
sb | 501 | fs/inode.c | if (!sb) |
sb | 503 | fs/inode.c | h = hash(sb->s_dev, nr); |
sb | 506 | fs/inode.c | if (inode->i_dev == sb->s_dev && inode->i_ino == nr) |
sb | 518 | fs/inode.c | inode->i_sb = sb; |
sb | 519 | fs/inode.c | inode->i_dev = sb->s_dev; |
sb | 521 | fs/inode.c | inode->i_flags = sb->s_flags; |
sb | 532 | fs/inode.c | if (inode->i_dev != sb->s_dev || inode->i_ino != nr) { |
sb | 28 | fs/isofs/inode.c | void isofs_put_super(struct super_block *sb) |
sb | 30 | fs/isofs/inode.c | lock_super(sb); |
sb | 36 | fs/isofs/inode.c | sb->s_dev = 0; |
sb | 37 | fs/isofs/inode.c | unlock_super(sb); |
sb | 312 | fs/isofs/inode.c | void isofs_statfs (struct super_block *sb, struct statfs *buf) |
sb | 316 | fs/isofs/inode.c | put_fs_long(sb->u.isofs_sb.s_nzones, &buf->f_blocks); |
sb | 319 | fs/isofs/inode.c | put_fs_long(sb->u.isofs_sb.s_ninodes, &buf->f_files); |
sb | 46 | fs/minix/bitmap.c | void minix_free_block(struct super_block * sb, int block) |
sb | 51 | fs/minix/bitmap.c | if (!sb) { |
sb | 55 | fs/minix/bitmap.c | if (block < sb->u.minix_sb.s_firstdatazone || |
sb | 56 | fs/minix/bitmap.c | block >= sb->u.minix_sb.s_nzones) { |
sb | 60 | fs/minix/bitmap.c | bh = get_hash_table(sb->s_dev,block,BLOCK_SIZE); |
sb | 64 | fs/minix/bitmap.c | zone = block - sb->u.minix_sb.s_firstdatazone + 1; |
sb | 67 | fs/minix/bitmap.c | bh = sb->u.minix_sb.s_zmap[zone]; |
sb | 73 | fs/minix/bitmap.c | printk("free_block (%04x:%d): bit already cleared\n",sb->s_dev,block); |
sb | 78 | fs/minix/bitmap.c | int minix_new_block(struct super_block * sb) |
sb | 83 | fs/minix/bitmap.c | if (!sb) { |
sb | 90 | fs/minix/bitmap.c | if ((bh=sb->u.minix_sb.s_zmap[i]) != NULL) |
sb | 100 | fs/minix/bitmap.c | j += i*8192 + sb->u.minix_sb.s_firstdatazone-1; |
sb | 101 | fs/minix/bitmap.c | if (j < sb->u.minix_sb.s_firstdatazone || |
sb | 102 | fs/minix/bitmap.c | j >= sb->u.minix_sb.s_nzones) |
sb | 104 | fs/minix/bitmap.c | if (!(bh = getblk(sb->s_dev,j,BLOCK_SIZE))) { |
sb | 115 | fs/minix/bitmap.c | unsigned long minix_count_free_blocks(struct super_block *sb) |
sb | 117 | fs/minix/bitmap.c | return (sb->u.minix_sb.s_nzones - count_used(sb->u.minix_sb.s_zmap,sb->u.minix_sb.s_zmap_blocks,sb->u.minix_sb.s_nzones)) |
sb | 118 | fs/minix/bitmap.c | << sb->u.minix_sb.s_log_zone_size; |
sb | 161 | fs/minix/bitmap.c | struct super_block * sb; |
sb | 168 | fs/minix/bitmap.c | sb = dir->i_sb; |
sb | 169 | fs/minix/bitmap.c | inode->i_sb = sb; |
sb | 193 | fs/minix/bitmap.c | inode->i_dev = sb->s_dev; |
sb | 205 | fs/minix/bitmap.c | unsigned long minix_count_free_inodes(struct super_block *sb) |
sb | 207 | fs/minix/bitmap.c | return sb->u.minix_sb.s_ninodes - count_used(sb->u.minix_sb.s_imap,sb->u.minix_sb.s_imap_blocks,sb->u.minix_sb.s_ninodes); |
sb | 28 | fs/minix/inode.c | static void minix_commit_super (struct super_block * sb, |
sb | 31 | fs/minix/inode.c | mark_buffer_dirty(sb->u.minix_sb.s_sbh, 1); |
sb | 32 | fs/minix/inode.c | sb->s_dirt = 0; |
sb | 35 | fs/minix/inode.c | void minix_write_super (struct super_block * sb) |
sb | 39 | fs/minix/inode.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 40 | fs/minix/inode.c | ms = sb->u.minix_sb.s_ms; |
sb | 44 | fs/minix/inode.c | minix_commit_super (sb, ms); |
sb | 46 | fs/minix/inode.c | sb->s_dirt = 0; |
sb | 50 | fs/minix/inode.c | void minix_put_super(struct super_block *sb) |
sb | 54 | fs/minix/inode.c | lock_super(sb); |
sb | 55 | fs/minix/inode.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 56 | fs/minix/inode.c | sb->u.minix_sb.s_ms->s_state = sb->u.minix_sb.s_mount_state; |
sb | 57 | fs/minix/inode.c | mark_buffer_dirty(sb->u.minix_sb.s_sbh, 1); |
sb | 59 | fs/minix/inode.c | sb->s_dev = 0; |
sb | 61 | fs/minix/inode.c | brelse(sb->u.minix_sb.s_imap[i]); |
sb | 63 | fs/minix/inode.c | brelse(sb->u.minix_sb.s_zmap[i]); |
sb | 64 | fs/minix/inode.c | brelse (sb->u.minix_sb.s_sbh); |
sb | 65 | fs/minix/inode.c | unlock_super(sb); |
sb | 80 | fs/minix/inode.c | int minix_remount (struct super_block * sb, int * flags, char * data) |
sb | 84 | fs/minix/inode.c | ms = sb->u.minix_sb.s_ms; |
sb | 85 | fs/minix/inode.c | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) |
sb | 89 | fs/minix/inode.c | !(sb->u.minix_sb.s_mount_state & MINIX_VALID_FS)) |
sb | 92 | fs/minix/inode.c | ms->s_state = sb->u.minix_sb.s_mount_state; |
sb | 93 | fs/minix/inode.c | mark_buffer_dirty(sb->u.minix_sb.s_sbh, 1); |
sb | 94 | fs/minix/inode.c | sb->s_dirt = 1; |
sb | 95 | fs/minix/inode.c | minix_commit_super (sb, ms); |
sb | 99 | fs/minix/inode.c | sb->u.minix_sb.s_mount_state = ms->s_state; |
sb | 101 | fs/minix/inode.c | mark_buffer_dirty(sb->u.minix_sb.s_sbh, 1); |
sb | 102 | fs/minix/inode.c | sb->s_dirt = 1; |
sb | 104 | fs/minix/inode.c | if (!(sb->u.minix_sb.s_mount_state & MINIX_VALID_FS)) |
sb | 107 | fs/minix/inode.c | else if ((sb->u.minix_sb.s_mount_state & MINIX_ERROR_FS)) |
sb | 213 | fs/minix/inode.c | void minix_statfs(struct super_block *sb, struct statfs *buf) |
sb | 219 | fs/minix/inode.c | tmp = sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone; |
sb | 220 | fs/minix/inode.c | tmp <<= sb->u.minix_sb.s_log_zone_size; |
sb | 222 | fs/minix/inode.c | tmp = minix_count_free_blocks(sb); |
sb | 225 | fs/minix/inode.c | put_fs_long(sb->u.minix_sb.s_ninodes, &buf->f_files); |
sb | 226 | fs/minix/inode.c | put_fs_long(minix_count_free_inodes(sb), &buf->f_ffree); |
sb | 227 | fs/minix/inode.c | put_fs_long(sb->u.minix_sb.s_namelen, &buf->f_namelen); |
sb | 19 | fs/msdos/fat.c | int fat_access(struct super_block *sb,int nr,int new_value) |
sb | 25 | fs/msdos/fat.c | if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters) return 0; |
sb | 26 | fs/msdos/fat.c | if (MSDOS_SB(sb)->fat_bits == 16) first = last = nr*2; |
sb | 31 | fs/msdos/fat.c | if (!(bh = msdos_sread(sb->s_dev,MSDOS_SB(sb)->fat_start+(first >> |
sb | 39 | fs/msdos/fat.c | if (!(bh2 = msdos_sread(sb->s_dev,MSDOS_SB(sb)->fat_start+(last |
sb | 46 | fs/msdos/fat.c | if (MSDOS_SB(sb)->fat_bits == 16) { |
sb | 61 | fs/msdos/fat.c | if (MSDOS_SB(sb)->fat_bits == 16) |
sb | 76 | fs/msdos/fat.c | for (copy = 1; copy < MSDOS_SB(sb)->fats; copy++) { |
sb | 77 | fs/msdos/fat.c | if (!(c_bh = msdos_sread(sb->s_dev,MSDOS_SB(sb)-> |
sb | 78 | fs/msdos/fat.c | fat_start+(first >> SECTOR_BITS)+MSDOS_SB(sb)-> |
sb | 83 | fs/msdos/fat.c | if (!(c_bh2 = msdos_sread(sb->s_dev, |
sb | 84 | fs/msdos/fat.c | MSDOS_SB(sb)->fat_start+(first >> |
sb | 85 | fs/msdos/fat.c | SECTOR_BITS)+MSDOS_SB(sb)->fat_length*copy |
sb | 238 | fs/msdos/fat.c | struct msdos_sb_info *sb; |
sb | 241 | fs/msdos/fat.c | sb = MSDOS_SB(inode->i_sb); |
sb | 244 | fs/msdos/fat.c | if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) return 0; |
sb | 245 | fs/msdos/fat.c | return sector+sb->dir_start; |
sb | 247 | fs/msdos/fat.c | cluster = sector/sb->cluster_size; |
sb | 248 | fs/msdos/fat.c | offset = sector % sb->cluster_size; |
sb | 250 | fs/msdos/fat.c | return (cluster-2)*sb->cluster_size+sb->data_start+offset; |
sb | 30 | fs/msdos/inode.c | struct super_block *sb; |
sb | 39 | fs/msdos/inode.c | sb = inode->i_sb; |
sb | 46 | fs/msdos/inode.c | fs_panic(sb,"..."); |
sb | 55 | fs/msdos/inode.c | void msdos_put_super(struct super_block *sb) |
sb | 57 | fs/msdos/inode.c | cache_inval_dev(sb->s_dev); |
sb | 58 | fs/msdos/inode.c | set_blocksize (sb->s_dev,BLOCK_SIZE); |
sb | 59 | fs/msdos/inode.c | lock_super(sb); |
sb | 60 | fs/msdos/inode.c | sb->s_dev = 0; |
sb | 61 | fs/msdos/inode.c | unlock_super(sb); |
sb | 281 | fs/msdos/inode.c | void msdos_statfs(struct super_block *sb,struct statfs *buf) |
sb | 285 | fs/msdos/inode.c | put_fs_long(sb->s_magic,&buf->f_type); |
sb | 286 | fs/msdos/inode.c | put_fs_long(MSDOS_SB(sb)->cluster_size*SECTOR_SIZE,&buf->f_bsize); |
sb | 287 | fs/msdos/inode.c | put_fs_long(MSDOS_SB(sb)->clusters,&buf->f_blocks); |
sb | 288 | fs/msdos/inode.c | lock_fat(sb); |
sb | 289 | fs/msdos/inode.c | if (MSDOS_SB(sb)->free_clusters != -1) |
sb | 290 | fs/msdos/inode.c | free = MSDOS_SB(sb)->free_clusters; |
sb | 293 | fs/msdos/inode.c | for (nr = 2; nr < MSDOS_SB(sb)->clusters+2; nr++) |
sb | 294 | fs/msdos/inode.c | if (!fat_access(sb,nr,-1)) free++; |
sb | 295 | fs/msdos/inode.c | MSDOS_SB(sb)->free_clusters = free; |
sb | 297 | fs/msdos/inode.c | unlock_fat(sb); |
sb | 308 | fs/msdos/inode.c | struct msdos_sb_info *sb; |
sb | 311 | fs/msdos/inode.c | sb = MSDOS_SB(inode->i_sb); |
sb | 313 | fs/msdos/inode.c | return sb->dir_start + block; |
sb | 315 | fs/msdos/inode.c | cluster = block/sb->cluster_size; |
sb | 316 | fs/msdos/inode.c | offset = block % sb->cluster_size; |
sb | 318 | fs/msdos/inode.c | return (cluster-2)*sb->cluster_size+sb->data_start+offset; |
sb | 93 | fs/msdos/misc.c | void lock_fat(struct super_block *sb) |
sb | 95 | fs/msdos/misc.c | while (MSDOS_SB(sb)->fat_lock) sleep_on(&MSDOS_SB(sb)->fat_wait); |
sb | 96 | fs/msdos/misc.c | MSDOS_SB(sb)->fat_lock = 1; |
sb | 100 | fs/msdos/misc.c | void unlock_fat(struct super_block *sb) |
sb | 102 | fs/msdos/misc.c | MSDOS_SB(sb)->fat_lock = 0; |
sb | 103 | fs/msdos/misc.c | wake_up(&MSDOS_SB(sb)->fat_wait); |
sb | 321 | fs/msdos/misc.c | inode = iget(sb,sector*MSDOS_DPS+entry); \ |
sb | 337 | fs/msdos/misc.c | static int raw_scan_sector(struct super_block *sb,int sector,char *name, |
sb | 346 | fs/msdos/misc.c | if (!(bh = msdos_sread(sb->s_dev,sector))) return -EIO; |
sb | 378 | fs/msdos/misc.c | static int raw_scan_root(struct super_block *sb,char *name,int *number,int *ino, |
sb | 383 | fs/msdos/misc.c | for (count = 0; count < MSDOS_SB(sb)->dir_entries/MSDOS_DPS; count++) { |
sb | 384 | fs/msdos/misc.c | if ((cluster = raw_scan_sector(sb,MSDOS_SB(sb)->dir_start+count, |
sb | 396 | fs/msdos/misc.c | static int raw_scan_nonroot(struct super_block *sb,int start,char *name, |
sb | 406 | fs/msdos/misc.c | for (count = 0; count < MSDOS_SB(sb)->cluster_size; count++) { |
sb | 407 | fs/msdos/misc.c | if ((cluster = raw_scan_sector(sb,(start-2)* |
sb | 408 | fs/msdos/misc.c | MSDOS_SB(sb)->cluster_size+MSDOS_SB(sb)->data_start+ |
sb | 412 | fs/msdos/misc.c | if (!(start = fat_access(sb,start,-1))) { |
sb | 413 | fs/msdos/misc.c | fs_panic(sb,"FAT error"); |
sb | 432 | fs/msdos/misc.c | static int raw_scan(struct super_block *sb,int start,char *name,int *number, |
sb | 436 | fs/msdos/misc.c | return raw_scan_nonroot(sb,start,name,number,ino,res_bh,res_de); |
sb | 437 | fs/msdos/misc.c | else return raw_scan_root(sb,name,number,ino,res_bh,res_de); |
sb | 239 | fs/msdos/namei.c | static void dump_fat(struct super_block *sb,int start) |
sb | 244 | fs/msdos/namei.c | start = fat_access(sb,start,-1); |
sb | 160 | fs/namei.c | struct super_block * sb; |
sb | 172 | fs/namei.c | } else if ((sb = dir->i_sb) && (dir == sb->s_mounted)) { |
sb | 173 | fs/namei.c | sb = dir->i_sb; |
sb | 175 | fs/namei.c | dir = sb->s_covered; |
sb | 44 | fs/nfs/inode.c | void nfs_put_super(struct super_block *sb) |
sb | 47 | fs/nfs/inode.c | close_fp(sb->u.nfs_sb.s_server.file, 0); |
sb | 48 | fs/nfs/inode.c | lock_super(sb); |
sb | 49 | fs/nfs/inode.c | sb->s_dev = 0; |
sb | 50 | fs/nfs/inode.c | unlock_super(sb); |
sb | 61 | fs/nfs/inode.c | struct super_block *nfs_read_super(struct super_block *sb, void *raw_data, |
sb | 68 | fs/nfs/inode.c | dev_t dev = sb->s_dev; |
sb | 72 | fs/nfs/inode.c | sb->s_dev = 0; |
sb | 82 | fs/nfs/inode.c | sb->s_dev = 0; |
sb | 87 | fs/nfs/inode.c | sb->s_dev = 0; |
sb | 91 | fs/nfs/inode.c | lock_super(sb); |
sb | 92 | fs/nfs/inode.c | sb->s_blocksize = 1024; /* XXX */ |
sb | 93 | fs/nfs/inode.c | sb->s_blocksize_bits = 10; |
sb | 94 | fs/nfs/inode.c | sb->s_magic = NFS_SUPER_MAGIC; |
sb | 95 | fs/nfs/inode.c | sb->s_dev = dev; |
sb | 96 | fs/nfs/inode.c | sb->s_op = &nfs_sops; |
sb | 97 | fs/nfs/inode.c | server = &sb->u.nfs_sb.s_server; |
sb | 119 | fs/nfs/inode.c | sb->u.nfs_sb.s_root = data->root; |
sb | 120 | fs/nfs/inode.c | unlock_super(sb); |
sb | 121 | fs/nfs/inode.c | if (!(sb->s_mounted = nfs_fhget(sb, &data->root, NULL))) { |
sb | 122 | fs/nfs/inode.c | sb->s_dev = 0; |
sb | 126 | fs/nfs/inode.c | return sb; |
sb | 129 | fs/nfs/inode.c | void nfs_statfs(struct super_block *sb, struct statfs *buf) |
sb | 135 | fs/nfs/inode.c | error = nfs_proc_statfs(&sb->u.nfs_sb.s_server, &sb->u.nfs_sb.s_root, |
sb | 161 | fs/nfs/inode.c | struct inode *nfs_fhget(struct super_block *sb, struct nfs_fh *fhandle, |
sb | 168 | fs/nfs/inode.c | if (!sb) { |
sb | 173 | fs/nfs/inode.c | error = nfs_proc_getattr(&sb->u.nfs_sb.s_server, fhandle, |
sb | 181 | fs/nfs/inode.c | if (!(inode = iget(sb, fattr->fileid))) { |
sb | 185 | fs/nfs/inode.c | if (inode->i_dev == sb->s_dev) { |
sb | 58 | fs/proc/fd.c | struct super_block * sb; |
sb | 68 | fs/proc/fd.c | sb = dir->i_sb; |
sb | 79 | fs/proc/fd.c | if (!(*result = iget(sb,(pid << 16)+2))) { |
sb | 113 | fs/proc/fd.c | if (!(*result = iget(sb,ino))) |
sb | 26 | fs/proc/inode.c | void proc_put_super(struct super_block *sb) |
sb | 28 | fs/proc/inode.c | lock_super(sb); |
sb | 29 | fs/proc/inode.c | sb->s_dev = 0; |
sb | 30 | fs/proc/inode.c | unlock_super(sb); |
sb | 61 | fs/proc/inode.c | void proc_statfs(struct super_block *sb, struct statfs *buf) |
sb | 35 | fs/super.c | static int do_remount_sb(struct super_block *sb, int flags, char * data); |
sb | 185 | fs/super.c | void __wait_on_super(struct super_block * sb) |
sb | 189 | fs/super.c | add_wait_queue(&sb->s_wait, &wait); |
sb | 192 | fs/super.c | if (sb->s_lock) { |
sb | 196 | fs/super.c | remove_wait_queue(&sb->s_wait, &wait); |
sb | 202 | fs/super.c | struct super_block * sb; |
sb | 204 | fs/super.c | for (sb = super_blocks + 0 ; sb < super_blocks + NR_SUPER ; sb++) { |
sb | 205 | fs/super.c | if (!sb->s_dev) |
sb | 207 | fs/super.c | if (dev && sb->s_dev != dev) |
sb | 209 | fs/super.c | wait_on_super(sb); |
sb | 210 | fs/super.c | if (!sb->s_dev || !sb->s_dirt) |
sb | 212 | fs/super.c | if (dev && (dev != sb->s_dev)) |
sb | 214 | fs/super.c | if (sb->s_op && sb->s_op->write_super) |
sb | 215 | fs/super.c | sb->s_op->write_super(sb); |
sb | 239 | fs/super.c | struct super_block * sb; |
sb | 246 | fs/super.c | if (!(sb = get_super(dev))) |
sb | 248 | fs/super.c | if (sb->s_covered) { |
sb | 253 | fs/super.c | if (sb->s_op && sb->s_op->put_super) |
sb | 254 | fs/super.c | sb->s_op->put_super(sb); |
sb | 324 | fs/super.c | struct super_block * sb; |
sb | 330 | fs/super.c | if (!(sb=get_super(dev))) |
sb | 332 | fs/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 334 | fs/super.c | retval = do_remount_sb(sb, MS_RDONLY, 0); |
sb | 340 | fs/super.c | if (!(sb=get_super(dev)) || !(sb->s_covered)) |
sb | 342 | fs/super.c | if (!sb->s_covered->i_mount) |
sb | 345 | fs/super.c | if (!fs_may_umount(dev, sb->s_mounted)) |
sb | 347 | fs/super.c | sb->s_covered->i_mount = NULL; |
sb | 348 | fs/super.c | iput(sb->s_covered); |
sb | 349 | fs/super.c | sb->s_covered = NULL; |
sb | 350 | fs/super.c | iput(sb->s_mounted); |
sb | 351 | fs/super.c | sb->s_mounted = NULL; |
sb | 352 | fs/super.c | if (sb->s_op && sb->s_op->write_super && sb->s_dirt) |
sb | 353 | fs/super.c | sb->s_op->write_super(sb); |
sb | 433 | fs/super.c | struct super_block * sb; |
sb | 451 | fs/super.c | sb = read_super(dev,type,flags,data,0); |
sb | 452 | fs/super.c | if (!sb || sb->s_covered) { |
sb | 456 | fs/super.c | sb->s_covered = dir_i; |
sb | 457 | fs/super.c | dir_i->i_mount = sb->s_mounted; |
sb | 468 | fs/super.c | static int do_remount_sb(struct super_block *sb, int flags, char *data) |
sb | 472 | fs/super.c | if (!(flags & MS_RDONLY ) && sb->s_dev && is_read_only(sb->s_dev)) |
sb | 476 | fs/super.c | if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) |
sb | 477 | fs/super.c | if (!fs_may_remount_ro(sb->s_dev)) |
sb | 479 | fs/super.c | if (sb->s_op && sb->s_op->remount_fs) { |
sb | 480 | fs/super.c | retval = sb->s_op->remount_fs(sb, &flags, data); |
sb | 484 | fs/super.c | sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | |
sb | 637 | fs/super.c | struct super_block * sb; |
sb | 671 | fs/super.c | sb = read_super(ROOT_DEV,fs_type->name,root_mountflags,NULL,1); |
sb | 672 | fs/super.c | if (sb) { |
sb | 673 | fs/super.c | inode = sb->s_mounted; |
sb | 675 | fs/super.c | sb->s_covered = inode; |
sb | 676 | fs/super.c | sb->s_flags = root_mountflags; |
sb | 681 | fs/super.c | (sb->s_flags & MS_RDONLY) ? " readonly" : ""); |
sb | 32 | fs/sysv/balloc.c | void sysv_free_block(struct super_block * sb, unsigned int block) |
sb | 37 | fs/sysv/balloc.c | if (!sb) { |
sb | 41 | fs/sysv/balloc.c | if (block < sb->sv_firstdatazone || block >= sb->sv_nzones) { |
sb | 45 | fs/sysv/balloc.c | lock_super(sb); |
sb | 46 | fs/sysv/balloc.c | if (*sb->sv_sb_flc_count > sb->sv_flc_size) { |
sb | 48 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 54 | fs/sysv/balloc.c | if (*sb->sv_sb_flc_count == sb->sv_flc_size) { |
sb | 58 | fs/sysv/balloc.c | bh = sv_getblk(sb, sb->s_dev, block); |
sb | 61 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 65 | fs/sysv/balloc.c | switch (sb->sv_type) { |
sb | 84 | fs/sysv/balloc.c | *flc_count = *sb->sv_sb_flc_count; /* = sb->sv_flc_size */ |
sb | 85 | fs/sysv/balloc.c | memcpy(flc_blocks, sb->sv_sb_flc_blocks, *flc_count * sizeof(sysv_zone_t)); |
sb | 89 | fs/sysv/balloc.c | *sb->sv_sb_flc_count = 0; |
sb | 94 | fs/sysv/balloc.c | if (*sb->sv_sb_flc_count == 0) { /* Applies only to Coherent FS */ |
sb | 95 | fs/sysv/balloc.c | bh = sv_getblk(sb, sb->s_dev, block); |
sb | 98 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 101 | fs/sysv/balloc.c | memset(bh->b_data, 0, sb->sv_block_size); |
sb | 109 | fs/sysv/balloc.c | bh = sv_get_hash_table(sb, sb->s_dev, block); |
sb | 114 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 116 | fs/sysv/balloc.c | sb->sv_sb_flc_blocks[(*sb->sv_sb_flc_count)++] = block; |
sb | 117 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 118 | fs/sysv/balloc.c | *sb->sv_sb_total_free_blocks = |
sb | 119 | fs/sysv/balloc.c | to_coh_ulong(from_coh_ulong(*sb->sv_sb_total_free_blocks) + 1); |
sb | 121 | fs/sysv/balloc.c | *sb->sv_sb_total_free_blocks = *sb->sv_sb_total_free_blocks + 1; |
sb | 122 | fs/sysv/balloc.c | mark_buffer_dirty(sb->sv_bh1, 1); /* super-block has been modified */ |
sb | 123 | fs/sysv/balloc.c | if (sb->sv_bh1 != sb->sv_bh2) mark_buffer_dirty(sb->sv_bh2, 1); |
sb | 124 | fs/sysv/balloc.c | sb->s_dirt = 1; /* and needs time stamp */ |
sb | 125 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 128 | fs/sysv/balloc.c | int sysv_new_block(struct super_block * sb) |
sb | 134 | fs/sysv/balloc.c | if (!sb) { |
sb | 138 | fs/sysv/balloc.c | lock_super(sb); |
sb | 139 | fs/sysv/balloc.c | if (*sb->sv_sb_flc_count == 0) { /* Applies only to Coherent FS */ |
sb | 140 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 143 | fs/sysv/balloc.c | block = sb->sv_sb_flc_blocks[(*sb->sv_sb_flc_count)-1]; |
sb | 144 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 147 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 150 | fs/sysv/balloc.c | (*sb->sv_sb_flc_count)--; |
sb | 151 | fs/sysv/balloc.c | if (block < sb->sv_firstdatazone || block >= sb->sv_nzones) { |
sb | 153 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 156 | fs/sysv/balloc.c | if (*sb->sv_sb_flc_count == 0) { /* the last block continues the free list */ |
sb | 160 | fs/sysv/balloc.c | if (!(bh = sv_bread(sb, sb->s_dev, block))) { |
sb | 163 | fs/sysv/balloc.c | (*sb->sv_sb_flc_count)++; |
sb | 164 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 168 | fs/sysv/balloc.c | switch (sb->sv_type) { |
sb | 187 | fs/sysv/balloc.c | if (*flc_count > sb->sv_flc_size) { |
sb | 190 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 193 | fs/sysv/balloc.c | *sb->sv_sb_flc_count = *flc_count; |
sb | 194 | fs/sysv/balloc.c | memcpy(sb->sv_sb_flc_blocks, flc_blocks, *flc_count * sizeof(sysv_zone_t)); |
sb | 198 | fs/sysv/balloc.c | bh = sv_getblk(sb, sb->s_dev, block); |
sb | 201 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 206 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 209 | fs/sysv/balloc.c | memset(bh->b_data, 0, sb->sv_block_size); |
sb | 213 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 214 | fs/sysv/balloc.c | *sb->sv_sb_total_free_blocks = |
sb | 215 | fs/sysv/balloc.c | to_coh_ulong(from_coh_ulong(*sb->sv_sb_total_free_blocks) - 1); |
sb | 217 | fs/sysv/balloc.c | *sb->sv_sb_total_free_blocks = *sb->sv_sb_total_free_blocks - 1; |
sb | 218 | fs/sysv/balloc.c | mark_buffer_dirty(sb->sv_bh1, 1); /* super-block has been modified */ |
sb | 219 | fs/sysv/balloc.c | if (sb->sv_bh1 != sb->sv_bh2) mark_buffer_dirty(sb->sv_bh2, 1); |
sb | 220 | fs/sysv/balloc.c | sb->s_dirt = 1; /* and needs time stamp */ |
sb | 221 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 225 | fs/sysv/balloc.c | unsigned long sysv_count_free_blocks(struct super_block * sb) |
sb | 236 | fs/sysv/balloc.c | lock_super(sb); |
sb | 237 | fs/sysv/balloc.c | if (*sb->sv_sb_flc_count > 0) { |
sb | 238 | fs/sysv/balloc.c | for (i = *sb->sv_sb_flc_count ; /* i > 0 */ ; ) { |
sb | 239 | fs/sysv/balloc.c | block = sb->sv_sb_flc_blocks[--i]; |
sb | 240 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 253 | fs/sysv/balloc.c | if (block < sb->sv_firstdatazone || block >= sb->sv_nzones) { |
sb | 257 | fs/sysv/balloc.c | if (!(bh = sv_bread(sb, sb->s_dev, block))) { |
sb | 262 | fs/sysv/balloc.c | switch (sb->sv_type) { |
sb | 281 | fs/sysv/balloc.c | if (*flc_count > sb->sv_flc_size) { |
sb | 292 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 307 | fs/sysv/balloc.c | old_count = *sb->sv_sb_total_free_blocks; |
sb | 308 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 312 | fs/sysv/balloc.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 313 | fs/sysv/balloc.c | *sb->sv_sb_total_free_blocks = (sb->sv_convert ? to_coh_ulong(count) : count); |
sb | 314 | fs/sysv/balloc.c | mark_buffer_dirty(sb->sv_bh2, 1); /* super-block has been modified */ |
sb | 315 | fs/sysv/balloc.c | sb->s_dirt = 1; /* and needs time stamp */ |
sb | 318 | fs/sysv/balloc.c | unlock_super(sb); |
sb | 323 | fs/sysv/balloc.c | count = *sb->sv_sb_total_free_blocks; |
sb | 324 | fs/sysv/balloc.c | if (sb->sv_convert) |
sb | 70 | fs/sysv/dir.c | struct super_block * sb; |
sb | 77 | fs/sysv/dir.c | if (!inode || !(sb = inode->i_sb) || !S_ISDIR(inode->i_mode)) |
sb | 82 | fs/sysv/dir.c | offset = filp->f_pos & sb->sv_block_size_1; |
sb | 83 | fs/sysv/dir.c | bh = sysv_file_bread(inode, filp->f_pos >> sb->sv_block_size_bits, 0); |
sb | 85 | fs/sysv/dir.c | filp->f_pos += sb->sv_block_size - offset; |
sb | 89 | fs/sysv/dir.c | while (offset < sb->sv_block_size && filp->f_pos < inode->i_size) { |
sb | 74 | fs/sysv/file.c | struct super_block * sb = inode->i_sb; |
sb | 103 | fs/sysv/file.c | block = offset >> sb->sv_block_size_bits; |
sb | 104 | fs/sysv/file.c | offset &= sb->sv_block_size_1; |
sb | 105 | fs/sysv/file.c | size = (size + sb->sv_block_size_1) >> sb->sv_block_size_bits; |
sb | 106 | fs/sysv/file.c | blocks = (left + offset + sb->sv_block_size_1) >> sb->sv_block_size_bits; |
sb | 109 | fs/sysv/file.c | blocks += read_ahead[MAJOR(inode->i_dev)] >> (sb->sv_block_size_bits - 9); |
sb | 162 | fs/sysv/file.c | if (left < sb->sv_block_size - offset) |
sb | 165 | fs/sysv/file.c | chars = sb->sv_block_size - offset; |
sb | 199 | fs/sysv/file.c | struct super_block * sb = inode->i_sb; |
sb | 226 | fs/sysv/file.c | bh = sysv_getblk (inode, pos >> sb->sv_block_size_bits, 1); |
sb | 232 | fs/sysv/file.c | c = sb->sv_block_size - (pos & sb->sv_block_size_1); |
sb | 235 | fs/sysv/file.c | if (c != sb->sv_block_size && !bh->b_uptodate) { |
sb | 246 | fs/sysv/file.c | p = (pos & sb->sv_block_size_1) + bh->b_data; |
sb | 33 | fs/sysv/fsync.c | struct super_block * sb; |
sb | 40 | fs/sysv/fsync.c | sb = inode->i_sb; |
sb | 41 | fs/sysv/fsync.c | bh = sv_get_hash_table(sb, inode->i_dev, block); |
sb | 109 | fs/sysv/fsync.c | struct super_block * sb; |
sb | 115 | fs/sysv/fsync.c | sb = inode->i_sb; |
sb | 116 | fs/sysv/fsync.c | for (i = 0; i < sb->sv_ind_per_block; i++) { |
sb | 118 | fs/sysv/fsync.c | ((unsigned long *) ind_bh->b_data) + i, sb->sv_convert, |
sb | 135 | fs/sysv/fsync.c | struct super_block * sb; |
sb | 141 | fs/sysv/fsync.c | sb = inode->i_sb; |
sb | 142 | fs/sysv/fsync.c | for (i = 0; i < sb->sv_ind_per_block; i++) { |
sb | 144 | fs/sysv/fsync.c | ((unsigned long *) dind_bh->b_data) + i, sb->sv_convert, |
sb | 161 | fs/sysv/fsync.c | struct super_block * sb; |
sb | 167 | fs/sysv/fsync.c | sb = inode->i_sb; |
sb | 168 | fs/sysv/fsync.c | for (i = 0; i < sb->sv_ind_per_block; i++) { |
sb | 170 | fs/sysv/fsync.c | ((unsigned long *) tind_bh->b_data) + i, sb->sv_convert, |
sb | 38 | fs/sysv/ialloc.c | static inline sysv_ino_t * sv_sb_fic_inode (struct super_block * sb, unsigned int i) |
sb | 40 | fs/sysv/ialloc.c | if (sb->sv_bh1 == sb->sv_bh2) |
sb | 41 | fs/sysv/ialloc.c | return &sb->sv_sb_fic_inodes[i]; |
sb | 46 | fs/sysv/ialloc.c | return (sysv_ino_t*)(sb->sv_sbd1 + offset); |
sb | 48 | fs/sysv/ialloc.c | return (sysv_ino_t*)(sb->sv_sbd2 + offset); |
sb | 54 | fs/sysv/ialloc.c | struct super_block * sb; |
sb | 73 | fs/sysv/ialloc.c | if (!(sb = inode->i_sb)) { |
sb | 78 | fs/sysv/ialloc.c | if (ino <= SYSV_ROOT_INO || ino > sb->sv_ninodes) { |
sb | 82 | fs/sysv/ialloc.c | if (!(bh = sv_bread(sb, inode->i_dev, sb->sv_firstinodezone + ((ino-1) >> sb->sv_inodes_per_block_bits)))) { |
sb | 87 | fs/sysv/ialloc.c | raw_inode = (struct sysv_inode *) bh->b_data + ((ino-1) & sb->sv_inodes_per_block_1); |
sb | 88 | fs/sysv/ialloc.c | lock_super(sb); |
sb | 89 | fs/sysv/ialloc.c | if (*sb->sv_sb_fic_count < sb->sv_fic_size) |
sb | 90 | fs/sysv/ialloc.c | *sv_sb_fic_inode(sb,(*sb->sv_sb_fic_count)++) = ino; |
sb | 91 | fs/sysv/ialloc.c | (*sb->sv_sb_total_free_inodes)++; |
sb | 92 | fs/sysv/ialloc.c | mark_buffer_dirty(sb->sv_bh1, 1); /* super-block has been modified */ |
sb | 93 | fs/sysv/ialloc.c | if (sb->sv_bh1 != sb->sv_bh2) mark_buffer_dirty(sb->sv_bh2, 1); |
sb | 94 | fs/sysv/ialloc.c | sb->s_dirt = 1; /* and needs time stamp */ |
sb | 97 | fs/sysv/ialloc.c | unlock_super(sb); |
sb | 105 | fs/sysv/ialloc.c | struct super_block * sb; |
sb | 112 | fs/sysv/ialloc.c | sb = dir->i_sb; |
sb | 113 | fs/sysv/ialloc.c | inode->i_sb = sb; |
sb | 115 | fs/sysv/ialloc.c | lock_super(sb); /* protect against task switches */ |
sb | 116 | fs/sysv/ialloc.c | if ((*sb->sv_sb_fic_count == 0) |
sb | 117 | fs/sysv/ialloc.c | || (*sv_sb_fic_inode(sb,(*sb->sv_sb_fic_count)-1) == 0) /* Applies only to SystemV2 FS */ |
sb | 126 | fs/sysv/ialloc.c | for (i = 0, ino = SYSV_ROOT_INO+1, block = sb->sv_firstinodezone, j = SYSV_ROOT_INO ; i < sb->sv_fic_size && block < sb->sv_firstdatazone ; block++, j = 0) { |
sb | 127 | fs/sysv/ialloc.c | if (!(bh = sv_bread(sb, sb->s_dev, block))) { |
sb | 133 | fs/sysv/ialloc.c | for (; j < sb->sv_inodes_per_block && i < sb->sv_fic_size; ino++, j++, raw_inode++) { |
sb | 135 | fs/sysv/ialloc.c | *sv_sb_fic_inode(sb,i++) = ino; |
sb | 141 | fs/sysv/ialloc.c | unlock_super(sb); |
sb | 144 | fs/sysv/ialloc.c | *sb->sv_sb_fic_count = i; |
sb | 147 | fs/sysv/ialloc.c | ino = *sv_sb_fic_inode(sb,--(*sb->sv_sb_fic_count)); |
sb | 148 | fs/sysv/ialloc.c | mark_buffer_dirty(sb->sv_bh1, 1); /* super-block has been modified */ |
sb | 149 | fs/sysv/ialloc.c | if (sb->sv_bh1 != sb->sv_bh2) mark_buffer_dirty(sb->sv_bh2, 1); |
sb | 150 | fs/sysv/ialloc.c | sb->s_dirt = 1; /* and needs time stamp */ |
sb | 153 | fs/sysv/ialloc.c | inode->i_dev = sb->s_dev; |
sb | 169 | fs/sysv/ialloc.c | (*sb->sv_sb_total_free_inodes)--; |
sb | 170 | fs/sysv/ialloc.c | mark_buffer_dirty(sb->sv_bh2, 1); /* super-block has been modified again */ |
sb | 171 | fs/sysv/ialloc.c | sb->s_dirt = 1; /* and needs time stamp again */ |
sb | 172 | fs/sysv/ialloc.c | unlock_super(sb); |
sb | 176 | fs/sysv/ialloc.c | unsigned long sysv_count_free_inodes(struct super_block * sb) |
sb | 185 | fs/sysv/ialloc.c | lock_super(sb); |
sb | 192 | fs/sysv/ialloc.c | for (block = sb->sv_firstinodezone, j = SYSV_ROOT_INO ; block < sb->sv_firstdatazone ; block++, j = 0) { |
sb | 193 | fs/sysv/ialloc.c | if (!(bh = sv_bread(sb, sb->s_dev, block))) { |
sb | 199 | fs/sysv/ialloc.c | for (; j < sb->sv_inodes_per_block ; j++, raw_inode++) |
sb | 204 | fs/sysv/ialloc.c | if (count != *sb->sv_sb_total_free_inodes) { |
sb | 205 | fs/sysv/ialloc.c | printk("sysv_count_free_inodes: free inode count was %d, correcting to %d\n",(short)(*sb->sv_sb_total_free_inodes),count); |
sb | 206 | fs/sysv/ialloc.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 207 | fs/sysv/ialloc.c | *sb->sv_sb_total_free_inodes = count; |
sb | 208 | fs/sysv/ialloc.c | mark_buffer_dirty(sb->sv_bh2, 1); /* super-block has been modified */ |
sb | 209 | fs/sysv/ialloc.c | sb->s_dirt = 1; /* and needs time stamp */ |
sb | 212 | fs/sysv/ialloc.c | unlock_super(sb); |
sb | 215 | fs/sysv/ialloc.c | return *sb->sv_sb_total_free_inodes; |
sb | 63 | fs/sysv/inode.c | static void detected_bs512 (struct super_block *sb) |
sb | 65 | fs/sysv/inode.c | sb->sv_block_size = 512; |
sb | 66 | fs/sysv/inode.c | sb->sv_block_size_1 = 512-1; |
sb | 67 | fs/sysv/inode.c | sb->sv_block_size_bits = 9; |
sb | 68 | fs/sysv/inode.c | sb->sv_block_size_ratio = 2; |
sb | 69 | fs/sysv/inode.c | sb->sv_block_size_ratio_bits = 1; |
sb | 70 | fs/sysv/inode.c | sb->sv_inodes_per_block = 512/64; |
sb | 71 | fs/sysv/inode.c | sb->sv_inodes_per_block_1 = 512/64-1; |
sb | 72 | fs/sysv/inode.c | sb->sv_inodes_per_block_bits = 9-6; |
sb | 73 | fs/sysv/inode.c | sb->sv_toobig_block = 10 + |
sb | 74 | fs/sysv/inode.c | (sb->sv_ind_per_block = 512/4) + |
sb | 75 | fs/sysv/inode.c | (sb->sv_ind_per_block_2 = (512/4)*(512/4)) + |
sb | 76 | fs/sysv/inode.c | (sb->sv_ind_per_block_3 = (512/4)*(512/4)*(512/4)); |
sb | 77 | fs/sysv/inode.c | sb->sv_ind_per_block_1 = 512/4-1; |
sb | 78 | fs/sysv/inode.c | sb->sv_ind_per_block_2_1 = (512/4)*(512/4)-1; |
sb | 79 | fs/sysv/inode.c | sb->sv_ind_per_block_2_bits = 2 * |
sb | 80 | fs/sysv/inode.c | (sb->sv_ind_per_block_bits = 9-2); |
sb | 81 | fs/sysv/inode.c | sb->sv_ind_per_block_block_size_1 = (512/4)*512-1; |
sb | 82 | fs/sysv/inode.c | sb->sv_ind_per_block_block_size_bits = (9-2)+9; |
sb | 83 | fs/sysv/inode.c | sb->sv_ind_per_block_2_block_size_1 = (512/4)*(512/4)*512-1; |
sb | 84 | fs/sysv/inode.c | sb->sv_ind_per_block_2_block_size_bits = (9-2)+(9-2)+9; |
sb | 85 | fs/sysv/inode.c | sb->sv_ind0_size = 10 * 512; |
sb | 86 | fs/sysv/inode.c | sb->sv_ind1_size = (10 + (512/4))* 512; |
sb | 87 | fs/sysv/inode.c | sb->sv_ind2_size = (10 + (512/4) + (512/4)*(512/4)) * 512; |
sb | 90 | fs/sysv/inode.c | static void detected_bs1024 (struct super_block *sb) |
sb | 92 | fs/sysv/inode.c | sb->sv_block_size = 1024; |
sb | 93 | fs/sysv/inode.c | sb->sv_block_size_1 = 1024-1; |
sb | 94 | fs/sysv/inode.c | sb->sv_block_size_bits = 10; |
sb | 95 | fs/sysv/inode.c | sb->sv_block_size_ratio = 1; |
sb | 96 | fs/sysv/inode.c | sb->sv_block_size_ratio_bits = 0; |
sb | 97 | fs/sysv/inode.c | sb->sv_inodes_per_block = 1024/64; |
sb | 98 | fs/sysv/inode.c | sb->sv_inodes_per_block_1 = 1024/64-1; |
sb | 99 | fs/sysv/inode.c | sb->sv_inodes_per_block_bits = 10-6; |
sb | 100 | fs/sysv/inode.c | sb->sv_toobig_block = 10 + |
sb | 101 | fs/sysv/inode.c | (sb->sv_ind_per_block = 1024/4) + |
sb | 102 | fs/sysv/inode.c | (sb->sv_ind_per_block_2 = (1024/4)*(1024/4)) + |
sb | 103 | fs/sysv/inode.c | (sb->sv_ind_per_block_3 = (1024/4)*(1024/4)*(1024/4)); |
sb | 104 | fs/sysv/inode.c | sb->sv_ind_per_block_1 = 1024/4-1; |
sb | 105 | fs/sysv/inode.c | sb->sv_ind_per_block_2_1 = (1024/4)*(1024/4)-1; |
sb | 106 | fs/sysv/inode.c | sb->sv_ind_per_block_2_bits = 2 * |
sb | 107 | fs/sysv/inode.c | (sb->sv_ind_per_block_bits = 10-2); |
sb | 108 | fs/sysv/inode.c | sb->sv_ind_per_block_block_size_1 = (1024/4)*1024-1; |
sb | 109 | fs/sysv/inode.c | sb->sv_ind_per_block_block_size_bits = (10-2)+10; |
sb | 110 | fs/sysv/inode.c | sb->sv_ind_per_block_2_block_size_1 = (1024/4)*(1024/4)*1024-1; |
sb | 111 | fs/sysv/inode.c | sb->sv_ind_per_block_2_block_size_bits = (10-2)+(10-2)+10; |
sb | 112 | fs/sysv/inode.c | sb->sv_ind0_size = 10 * 1024; |
sb | 113 | fs/sysv/inode.c | sb->sv_ind1_size = (10 + (1024/4))* 1024; |
sb | 114 | fs/sysv/inode.c | sb->sv_ind2_size = (10 + (1024/4) + (1024/4)*(1024/4)) * 1024; |
sb | 117 | fs/sysv/inode.c | static const char* detect_xenix (struct super_block *sb, struct buffer_head *bh) |
sb | 125 | fs/sysv/inode.c | case 1: detected_bs512(sb); break; |
sb | 126 | fs/sysv/inode.c | case 2: detected_bs1024(sb); break; |
sb | 129 | fs/sysv/inode.c | sb->sv_type = FSTYPE_XENIX; |
sb | 132 | fs/sysv/inode.c | static struct super_block * detected_xenix (struct super_block *sb, struct buffer_head *bh1, struct buffer_head *bh2) |
sb | 137 | fs/sysv/inode.c | if (sb->sv_block_size == BLOCK_SIZE) |
sb | 149 | fs/sysv/inode.c | sb->sv_convert = 0; |
sb | 150 | fs/sysv/inode.c | sb->sv_kludge_symlinks = 1; |
sb | 151 | fs/sysv/inode.c | sb->sv_truncate = 1; |
sb | 152 | fs/sysv/inode.c | sb->sv_link_max = XENIX_LINK_MAX; |
sb | 153 | fs/sysv/inode.c | sb->sv_fic_size = XENIX_NICINOD; |
sb | 154 | fs/sysv/inode.c | sb->sv_flc_size = XENIX_NICFREE; |
sb | 155 | fs/sysv/inode.c | sb->sv_bh1 = bh1; |
sb | 156 | fs/sysv/inode.c | sb->sv_bh2 = bh2; |
sb | 157 | fs/sysv/inode.c | sb->sv_sbd1 = (char *) sbd1; |
sb | 158 | fs/sysv/inode.c | sb->sv_sbd2 = (char *) sbd2; |
sb | 159 | fs/sysv/inode.c | sb->sv_sb_fic_count = &sbd1->s_ninode; |
sb | 160 | fs/sysv/inode.c | sb->sv_sb_fic_inodes = &sbd1->s_inode[0]; |
sb | 161 | fs/sysv/inode.c | sb->sv_sb_total_free_inodes = &sbd2->s_tinode; |
sb | 162 | fs/sysv/inode.c | sb->sv_sb_flc_count = &sbd1->s_nfree; |
sb | 163 | fs/sysv/inode.c | sb->sv_sb_flc_blocks = &sbd1->s_free[0]; |
sb | 164 | fs/sysv/inode.c | sb->sv_sb_total_free_blocks = &sbd2->s_tfree; |
sb | 165 | fs/sysv/inode.c | sb->sv_sb_time = &sbd2->s_time; |
sb | 166 | fs/sysv/inode.c | sb->sv_block_base = 0; |
sb | 167 | fs/sysv/inode.c | sb->sv_firstinodezone = 2; |
sb | 168 | fs/sysv/inode.c | sb->sv_firstdatazone = sbd1->s_isize; |
sb | 169 | fs/sysv/inode.c | sb->sv_nzones = sbd1->s_fsize; |
sb | 170 | fs/sysv/inode.c | sb->sv_ndatazones = sb->sv_nzones - sb->sv_firstdatazone; |
sb | 171 | fs/sysv/inode.c | return sb; |
sb | 174 | fs/sysv/inode.c | static const char* detect_sysv4 (struct super_block *sb, struct buffer_head *bh) |
sb | 184 | fs/sysv/inode.c | case 1: detected_bs512(sb); break; |
sb | 185 | fs/sysv/inode.c | case 2: detected_bs1024(sb); break; |
sb | 188 | fs/sysv/inode.c | sb->sv_type = FSTYPE_SYSV4; |
sb | 191 | fs/sysv/inode.c | static struct super_block * detected_sysv4 (struct super_block *sb, struct buffer_head *bh) |
sb | 195 | fs/sysv/inode.c | if (sb->sv_block_size == BLOCK_SIZE) |
sb | 206 | fs/sysv/inode.c | sb->sv_convert = 0; |
sb | 207 | fs/sysv/inode.c | sb->sv_kludge_symlinks = 0; /* ?? */ |
sb | 208 | fs/sysv/inode.c | sb->sv_truncate = 1; |
sb | 209 | fs/sysv/inode.c | sb->sv_link_max = SYSV_LINK_MAX; |
sb | 210 | fs/sysv/inode.c | sb->sv_fic_size = SYSV_NICINOD; |
sb | 211 | fs/sysv/inode.c | sb->sv_flc_size = SYSV_NICFREE; |
sb | 212 | fs/sysv/inode.c | sb->sv_bh1 = bh; |
sb | 213 | fs/sysv/inode.c | sb->sv_bh2 = bh; |
sb | 214 | fs/sysv/inode.c | sb->sv_sbd1 = (char *) sbd; |
sb | 215 | fs/sysv/inode.c | sb->sv_sbd2 = (char *) sbd; |
sb | 216 | fs/sysv/inode.c | sb->sv_sb_fic_count = &sbd->s_ninode; |
sb | 217 | fs/sysv/inode.c | sb->sv_sb_fic_inodes = &sbd->s_inode[0]; |
sb | 218 | fs/sysv/inode.c | sb->sv_sb_total_free_inodes = &sbd->s_tinode; |
sb | 219 | fs/sysv/inode.c | sb->sv_sb_flc_count = &sbd->s_nfree; |
sb | 220 | fs/sysv/inode.c | sb->sv_sb_flc_blocks = &sbd->s_free[0]; |
sb | 221 | fs/sysv/inode.c | sb->sv_sb_total_free_blocks = &sbd->s_tfree; |
sb | 222 | fs/sysv/inode.c | sb->sv_sb_time = &sbd->s_time; |
sb | 223 | fs/sysv/inode.c | sb->sv_block_base = 0; |
sb | 224 | fs/sysv/inode.c | sb->sv_firstinodezone = 2; |
sb | 225 | fs/sysv/inode.c | sb->sv_firstdatazone = sbd->s_isize; |
sb | 226 | fs/sysv/inode.c | sb->sv_nzones = sbd->s_fsize; |
sb | 227 | fs/sysv/inode.c | sb->sv_ndatazones = sb->sv_nzones - sb->sv_firstdatazone; |
sb | 228 | fs/sysv/inode.c | return sb; |
sb | 231 | fs/sysv/inode.c | static const char* detect_sysv2 (struct super_block *sb, struct buffer_head *bh) |
sb | 241 | fs/sysv/inode.c | case 1: detected_bs512(sb); break; |
sb | 242 | fs/sysv/inode.c | case 2: detected_bs1024(sb); break; |
sb | 245 | fs/sysv/inode.c | sb->sv_type = FSTYPE_SYSV2; |
sb | 248 | fs/sysv/inode.c | static struct super_block * detected_sysv2 (struct super_block *sb, struct buffer_head *bh) |
sb | 252 | fs/sysv/inode.c | if (sb->sv_block_size == BLOCK_SIZE) |
sb | 263 | fs/sysv/inode.c | sb->sv_convert = 0; |
sb | 264 | fs/sysv/inode.c | sb->sv_kludge_symlinks = 0; /* ?? */ |
sb | 265 | fs/sysv/inode.c | sb->sv_truncate = 1; |
sb | 266 | fs/sysv/inode.c | sb->sv_link_max = SYSV_LINK_MAX; |
sb | 267 | fs/sysv/inode.c | sb->sv_fic_size = SYSV_NICINOD; |
sb | 268 | fs/sysv/inode.c | sb->sv_flc_size = SYSV_NICFREE; |
sb | 269 | fs/sysv/inode.c | sb->sv_bh1 = bh; |
sb | 270 | fs/sysv/inode.c | sb->sv_bh2 = bh; |
sb | 271 | fs/sysv/inode.c | sb->sv_sbd1 = (char *) sbd; |
sb | 272 | fs/sysv/inode.c | sb->sv_sbd2 = (char *) sbd; |
sb | 273 | fs/sysv/inode.c | sb->sv_sb_fic_count = &sbd->s_ninode; |
sb | 274 | fs/sysv/inode.c | sb->sv_sb_fic_inodes = &sbd->s_inode[0]; |
sb | 275 | fs/sysv/inode.c | sb->sv_sb_total_free_inodes = &sbd->s_tinode; |
sb | 276 | fs/sysv/inode.c | sb->sv_sb_flc_count = &sbd->s_nfree; |
sb | 277 | fs/sysv/inode.c | sb->sv_sb_flc_blocks = &sbd->s_free[0]; |
sb | 278 | fs/sysv/inode.c | sb->sv_sb_total_free_blocks = &sbd->s_tfree; |
sb | 279 | fs/sysv/inode.c | sb->sv_sb_time = &sbd->s_time; |
sb | 280 | fs/sysv/inode.c | sb->sv_block_base = 0; |
sb | 281 | fs/sysv/inode.c | sb->sv_firstinodezone = 2; |
sb | 282 | fs/sysv/inode.c | sb->sv_firstdatazone = sbd->s_isize; |
sb | 283 | fs/sysv/inode.c | sb->sv_nzones = sbd->s_fsize; |
sb | 284 | fs/sysv/inode.c | sb->sv_ndatazones = sb->sv_nzones - sb->sv_firstdatazone; |
sb | 285 | fs/sysv/inode.c | return sb; |
sb | 288 | fs/sysv/inode.c | static const char* detect_coherent (struct super_block *sb, struct buffer_head *bh) |
sb | 296 | fs/sysv/inode.c | detected_bs512(sb); |
sb | 297 | fs/sysv/inode.c | sb->sv_type = FSTYPE_COH; |
sb | 300 | fs/sysv/inode.c | static struct super_block * detected_coherent (struct super_block *sb, struct buffer_head *bh) |
sb | 310 | fs/sysv/inode.c | sb->sv_convert = 1; |
sb | 311 | fs/sysv/inode.c | sb->sv_kludge_symlinks = 1; |
sb | 312 | fs/sysv/inode.c | sb->sv_truncate = 1; |
sb | 313 | fs/sysv/inode.c | sb->sv_link_max = COH_LINK_MAX; |
sb | 314 | fs/sysv/inode.c | sb->sv_fic_size = COH_NICINOD; |
sb | 315 | fs/sysv/inode.c | sb->sv_flc_size = COH_NICFREE; |
sb | 316 | fs/sysv/inode.c | sb->sv_bh1 = bh; |
sb | 317 | fs/sysv/inode.c | sb->sv_bh2 = bh; |
sb | 318 | fs/sysv/inode.c | sb->sv_sbd1 = (char *) sbd; |
sb | 319 | fs/sysv/inode.c | sb->sv_sbd2 = (char *) sbd; |
sb | 320 | fs/sysv/inode.c | sb->sv_sb_fic_count = &sbd->s_ninode; |
sb | 321 | fs/sysv/inode.c | sb->sv_sb_fic_inodes = &sbd->s_inode[0]; |
sb | 322 | fs/sysv/inode.c | sb->sv_sb_total_free_inodes = &sbd->s_tinode; |
sb | 323 | fs/sysv/inode.c | sb->sv_sb_flc_count = &sbd->s_nfree; |
sb | 324 | fs/sysv/inode.c | sb->sv_sb_flc_blocks = &sbd->s_free[0]; |
sb | 325 | fs/sysv/inode.c | sb->sv_sb_total_free_blocks = &sbd->s_tfree; |
sb | 326 | fs/sysv/inode.c | sb->sv_sb_time = &sbd->s_time; |
sb | 327 | fs/sysv/inode.c | sb->sv_block_base = 0; |
sb | 328 | fs/sysv/inode.c | sb->sv_firstinodezone = 2; |
sb | 329 | fs/sysv/inode.c | sb->sv_firstdatazone = sbd->s_isize; |
sb | 330 | fs/sysv/inode.c | sb->sv_nzones = from_coh_ulong(sbd->s_fsize); |
sb | 331 | fs/sysv/inode.c | sb->sv_ndatazones = sb->sv_nzones - sb->sv_firstdatazone; |
sb | 332 | fs/sysv/inode.c | return sb; |
sb | 335 | fs/sysv/inode.c | struct super_block *sysv_read_super(struct super_block *sb,void *data, |
sb | 340 | fs/sysv/inode.c | int dev = sb->s_dev; |
sb | 351 | fs/sysv/inode.c | lock_super(sb); |
sb | 356 | fs/sysv/inode.c | if ((found = detect_xenix(sb,bh)) != NULL) |
sb | 362 | fs/sysv/inode.c | if ((found = detect_sysv4(sb,bh)) != NULL) |
sb | 364 | fs/sysv/inode.c | if ((found = detect_sysv2(sb,bh)) != NULL) |
sb | 367 | fs/sysv/inode.c | if ((found = detect_coherent(sb,bh)) != NULL) |
sb | 378 | fs/sysv/inode.c | if ((found = detect_sysv4(sb,bh)) != NULL) { |
sb | 379 | fs/sysv/inode.c | sb->sv_block_base = offsets[i] << sb->sv_block_size_ratio_bits; |
sb | 382 | fs/sysv/inode.c | if ((found = detect_sysv2(sb,bh)) != NULL) { |
sb | 383 | fs/sysv/inode.c | sb->sv_block_base = offsets[i] << sb->sv_block_size_ratio_bits; |
sb | 389 | fs/sysv/inode.c | sb->s_dev=0; |
sb | 390 | fs/sysv/inode.c | unlock_super(sb); |
sb | 396 | fs/sysv/inode.c | if (sb->sv_block_size == BLOCK_SIZE) { |
sb | 397 | fs/sysv/inode.c | switch (sb->sv_type) { |
sb | 399 | fs/sysv/inode.c | if (!detected_xenix(sb,bh,bh)) |
sb | 403 | fs/sysv/inode.c | if (!detected_sysv4(sb,bh)) |
sb | 407 | fs/sysv/inode.c | if (!detected_sysv2(sb,bh)) |
sb | 413 | fs/sysv/inode.c | sb->s_dev = 0; |
sb | 414 | fs/sysv/inode.c | unlock_super(sb); |
sb | 422 | fs/sysv/inode.c | unsigned long blocknr = bh->b_blocknr << sb->sv_block_size_ratio_bits; |
sb | 425 | fs/sysv/inode.c | set_blocksize(dev,sb->sv_block_size); |
sb | 427 | fs/sysv/inode.c | switch (sb->sv_type) { |
sb | 429 | fs/sysv/inode.c | if ((bh1 = bread(dev, blocknr, sb->sv_block_size)) == NULL) |
sb | 431 | fs/sysv/inode.c | if ((bh2 = bread(dev, blocknr+1, sb->sv_block_size)) == NULL) |
sb | 433 | fs/sysv/inode.c | if (!detected_xenix(sb,bh1,bh2)) |
sb | 437 | fs/sysv/inode.c | if ((bh2 = bread(dev, blocknr+1, sb->sv_block_size)) == NULL) |
sb | 439 | fs/sysv/inode.c | if (!detected_sysv4(sb,bh2)) |
sb | 443 | fs/sysv/inode.c | if ((bh2 = bread(dev, blocknr+1, sb->sv_block_size)) == NULL) |
sb | 445 | fs/sysv/inode.c | if (!detected_sysv2(sb,bh2)) |
sb | 449 | fs/sysv/inode.c | if ((bh2 = bread(dev, blocknr+1, sb->sv_block_size)) == NULL) |
sb | 451 | fs/sysv/inode.c | if (!detected_coherent(sb,bh2)) |
sb | 458 | fs/sysv/inode.c | set_blocksize(sb->s_dev,BLOCK_SIZE); |
sb | 459 | fs/sysv/inode.c | sb->s_dev = 0; |
sb | 460 | fs/sysv/inode.c | unlock_super(sb); |
sb | 465 | fs/sysv/inode.c | sb->sv_ninodes = (sb->sv_firstdatazone - sb->sv_firstinodezone) << sb->sv_inodes_per_block_bits; |
sb | 467 | fs/sysv/inode.c | printk("VFS: Found a %s FS (block size = %d) on device %d/%d\n",found,sb->sv_block_size,MAJOR(dev),MINOR(dev)); |
sb | 468 | fs/sysv/inode.c | sb->s_magic = SYSV_MAGIC_BASE + sb->sv_type; |
sb | 470 | fs/sysv/inode.c | sb->s_blocksize = sb->sv_block_size; |
sb | 471 | fs/sysv/inode.c | sb->s_blocksize_bits = sb->sv_block_size_bits; |
sb | 473 | fs/sysv/inode.c | sb->s_dev = dev; |
sb | 474 | fs/sysv/inode.c | sb->s_op = &sysv_sops; |
sb | 475 | fs/sysv/inode.c | sb->s_mounted = iget(sb,SYSV_ROOT_INO); |
sb | 476 | fs/sysv/inode.c | unlock_super(sb); |
sb | 477 | fs/sysv/inode.c | if (!sb->s_mounted) { |
sb | 478 | fs/sysv/inode.c | sysv_put_super(sb); |
sb | 482 | fs/sysv/inode.c | sb->s_dirt = 1; |
sb | 485 | fs/sysv/inode.c | return sb; |
sb | 489 | fs/sysv/inode.c | void sysv_write_super (struct super_block *sb) |
sb | 491 | fs/sysv/inode.c | lock_super(sb); |
sb | 492 | fs/sysv/inode.c | if (sb->sv_bh1->b_dirt || sb->sv_bh2->b_dirt) { |
sb | 496 | fs/sysv/inode.c | if (sb->sv_convert) |
sb | 498 | fs/sysv/inode.c | *sb->sv_sb_time = time; |
sb | 499 | fs/sysv/inode.c | mark_buffer_dirty(sb->sv_bh2, 1); |
sb | 501 | fs/sysv/inode.c | sb->s_dirt = 0; |
sb | 502 | fs/sysv/inode.c | unlock_super(sb); |
sb | 505 | fs/sysv/inode.c | void sysv_put_super(struct super_block *sb) |
sb | 508 | fs/sysv/inode.c | lock_super(sb); |
sb | 509 | fs/sysv/inode.c | brelse(sb->sv_bh1); |
sb | 510 | fs/sysv/inode.c | if (sb->sv_bh1 != sb->sv_bh2) brelse(sb->sv_bh2); |
sb | 512 | fs/sysv/inode.c | if (sb->s_blocksize != BLOCK_SIZE) |
sb | 513 | fs/sysv/inode.c | set_blocksize(sb->s_dev,BLOCK_SIZE); |
sb | 514 | fs/sysv/inode.c | sb->s_dev = 0; |
sb | 515 | fs/sysv/inode.c | unlock_super(sb); |
sb | 518 | fs/sysv/inode.c | void sysv_statfs(struct super_block *sb, struct statfs *buf) |
sb | 522 | fs/sysv/inode.c | put_fs_long(sb->s_magic, &buf->f_type); /* type of filesystem */ |
sb | 523 | fs/sysv/inode.c | put_fs_long(sb->sv_block_size, &buf->f_bsize); /* block size */ |
sb | 524 | fs/sysv/inode.c | put_fs_long(sb->sv_ndatazones, &buf->f_blocks); /* total data blocks in file system */ |
sb | 525 | fs/sysv/inode.c | tmp = sysv_count_free_blocks(sb); |
sb | 528 | fs/sysv/inode.c | put_fs_long(sb->sv_ninodes, &buf->f_files); /* total file nodes in file system */ |
sb | 529 | fs/sysv/inode.c | put_fs_long(sysv_count_free_inodes(sb), &buf->f_ffree); /* free file nodes in fs */ |
sb | 537 | fs/sysv/inode.c | static inline int inode_bmap(struct super_block * sb, struct inode * inode, int nr) |
sb | 542 | fs/sysv/inode.c | return tmp + sb->sv_block_base; |
sb | 545 | fs/sysv/inode.c | static int block_bmap(struct super_block * sb, struct buffer_head * bh, int nr, int convert) |
sb | 557 | fs/sysv/inode.c | return tmp + sb->sv_block_base; |
sb | 563 | fs/sysv/inode.c | struct super_block * sb = inode->i_sb; |
sb | 569 | fs/sysv/inode.c | return inode_bmap(sb,inode,block); |
sb | 571 | fs/sysv/inode.c | convert = sb->sv_convert; |
sb | 572 | fs/sysv/inode.c | if (block < sb->sv_ind_per_block) { |
sb | 573 | fs/sysv/inode.c | i = inode_bmap(sb,inode,10); |
sb | 576 | fs/sysv/inode.c | bh = bread(inode->i_dev,i,sb->sv_block_size); |
sb | 577 | fs/sysv/inode.c | return block_bmap(sb, bh, block, convert); |
sb | 579 | fs/sysv/inode.c | block -= sb->sv_ind_per_block; |
sb | 580 | fs/sysv/inode.c | if (block < sb->sv_ind_per_block_2) { |
sb | 581 | fs/sysv/inode.c | i = inode_bmap(sb,inode,11); |
sb | 584 | fs/sysv/inode.c | bh = bread(inode->i_dev,i,sb->sv_block_size); |
sb | 585 | fs/sysv/inode.c | i = block_bmap(sb, bh, block >> sb->sv_ind_per_block_bits, convert); |
sb | 588 | fs/sysv/inode.c | bh = bread(inode->i_dev,i,sb->sv_block_size); |
sb | 589 | fs/sysv/inode.c | return block_bmap(sb, bh, block & sb->sv_ind_per_block_1, convert); |
sb | 591 | fs/sysv/inode.c | block -= sb->sv_ind_per_block_2; |
sb | 592 | fs/sysv/inode.c | if (block < sb->sv_ind_per_block_3) { |
sb | 593 | fs/sysv/inode.c | i = inode_bmap(sb,inode,12); |
sb | 596 | fs/sysv/inode.c | bh = bread(inode->i_dev,i,sb->sv_block_size); |
sb | 597 | fs/sysv/inode.c | i = block_bmap(sb, bh, block >> sb->sv_ind_per_block_2_bits, convert); |
sb | 600 | fs/sysv/inode.c | bh = bread(inode->i_dev,i,sb->sv_block_size); |
sb | 601 | fs/sysv/inode.c | i = block_bmap(sb, bh, (block >> sb->sv_ind_per_block_bits) & sb->sv_ind_per_block_1,convert); |
sb | 604 | fs/sysv/inode.c | bh = bread(inode->i_dev,i,sb->sv_block_size); |
sb | 605 | fs/sysv/inode.c | return block_bmap(sb, bh, block & sb->sv_ind_per_block_1, convert); |
sb | 622 | fs/sysv/inode.c | struct super_block *sb; |
sb | 627 | fs/sysv/inode.c | sb = inode->i_sb; |
sb | 632 | fs/sysv/inode.c | result = sv_getblk(sb, inode->i_dev, tmp); |
sb | 640 | fs/sysv/inode.c | tmp = sysv_new_block(sb); |
sb | 643 | fs/sysv/inode.c | result = sv_getblk(sb, inode->i_dev, tmp); |
sb | 645 | fs/sysv/inode.c | sysv_free_block(sb,tmp); |
sb | 658 | fs/sysv/inode.c | struct super_block *sb; |
sb | 673 | fs/sysv/inode.c | sb = inode->i_sb; |
sb | 677 | fs/sysv/inode.c | if (sb->sv_convert) |
sb | 680 | fs/sysv/inode.c | result = sv_getblk(sb, bh->b_dev, block); |
sb | 692 | fs/sysv/inode.c | block = sysv_new_block(sb); |
sb | 697 | fs/sysv/inode.c | result = sv_getblk(sb, bh->b_dev, block); |
sb | 699 | fs/sysv/inode.c | sysv_free_block(sb,block); |
sb | 703 | fs/sysv/inode.c | *p = (sb->sv_convert ? to_coh_ulong(block) : block); |
sb | 711 | fs/sysv/inode.c | struct super_block * sb = inode->i_sb; |
sb | 717 | fs/sysv/inode.c | if (block < sb->sv_ind_per_block) { |
sb | 721 | fs/sysv/inode.c | block -= sb->sv_ind_per_block; |
sb | 722 | fs/sysv/inode.c | if (block < sb->sv_ind_per_block_2) { |
sb | 724 | fs/sysv/inode.c | bh = block_getblk(inode, bh, block >> sb->sv_ind_per_block_bits, create); |
sb | 725 | fs/sysv/inode.c | return block_getblk(inode, bh, block & sb->sv_ind_per_block_1, create); |
sb | 727 | fs/sysv/inode.c | block -= sb->sv_ind_per_block_2; |
sb | 728 | fs/sysv/inode.c | if (block < sb->sv_ind_per_block_3) { |
sb | 730 | fs/sysv/inode.c | bh = block_getblk(inode, bh, block >> sb->sv_ind_per_block_2_bits, create); |
sb | 731 | fs/sysv/inode.c | bh = block_getblk(inode, bh, (block >> sb->sv_ind_per_block_bits) & sb->sv_ind_per_block_1, create); |
sb | 732 | fs/sysv/inode.c | return block_getblk(inode, bh, block & sb->sv_ind_per_block_1, create); |
sb | 784 | fs/sysv/inode.c | struct super_block * sb = inode->i_sb; |
sb | 793 | fs/sysv/inode.c | if (!ino || ino > sb->sv_ninodes) { |
sb | 798 | fs/sysv/inode.c | block = sb->sv_firstinodezone + ((ino-1) >> sb->sv_inodes_per_block_bits); |
sb | 799 | fs/sysv/inode.c | if (!(bh = sv_bread(sb,inode->i_dev,block))) { |
sb | 804 | fs/sysv/inode.c | raw_inode = (struct sysv_inode *) bh->b_data + ((ino-1) & sb->sv_inodes_per_block_1); |
sb | 806 | fs/sysv/inode.c | if (sb->sv_kludge_symlinks) |
sb | 813 | fs/sysv/inode.c | if (sb->sv_convert) { |
sb | 828 | fs/sysv/inode.c | if (sb->sv_convert) |
sb | 871 | fs/sysv/inode.c | struct super_block * sb = inode->i_sb; |
sb | 878 | fs/sysv/inode.c | if (!ino || ino > sb->sv_ninodes) { |
sb | 884 | fs/sysv/inode.c | block = sb->sv_firstinodezone + ((ino-1) >> sb->sv_inodes_per_block_bits); |
sb | 885 | fs/sysv/inode.c | if (!(bh = sv_bread(sb,inode->i_dev,block))) { |
sb | 890 | fs/sysv/inode.c | raw_inode = (struct sysv_inode *) bh->b_data + ((ino-1) & sb->sv_inodes_per_block_1); |
sb | 892 | fs/sysv/inode.c | if (sb->sv_kludge_symlinks) |
sb | 898 | fs/sysv/inode.c | if (sb->sv_convert) { |
sb | 912 | fs/sysv/inode.c | if (sb->sv_convert) |
sb | 63 | fs/sysv/namei.c | struct super_block * sb; |
sb | 70 | fs/sysv/namei.c | sb = dir->i_sb; |
sb | 72 | fs/sysv/namei.c | if (sb->sv_truncate) |
sb | 83 | fs/sysv/namei.c | pos += sb->sv_block_size; |
sb | 92 | fs/sysv/namei.c | if (offset < sb->sv_block_size) |
sb | 146 | fs/sysv/namei.c | struct super_block * sb; |
sb | 156 | fs/sysv/namei.c | sb = dir->i_sb; |
sb | 158 | fs/sysv/namei.c | if (sb->sv_truncate) |
sb | 193 | fs/sysv/namei.c | if (offset < sb->sv_block_size) |
sb | 366 | fs/sysv/namei.c | struct super_block * sb; |
sb | 389 | fs/sysv/namei.c | sb = inode->i_sb; |
sb | 395 | fs/sysv/namei.c | pos += sb->sv_block_size; |
sb | 406 | fs/sysv/namei.c | if (offset < sb->sv_block_size) |
sb | 535 | fs/sysv/namei.c | struct super_block * sb; |
sb | 554 | fs/sysv/namei.c | sb = inode->i_sb; |
sb | 557 | fs/sysv/namei.c | while (i < sb->sv_block_size_1 && (c = *(symname++))) |
sb | 42 | fs/sysv/truncate.c | struct super_block * sb; |
sb | 49 | fs/sysv/truncate.c | sb = inode->i_sb; |
sb | 51 | fs/sysv/truncate.c | for (i = ((unsigned long) inode->i_size + sb->sv_block_size_1) >> sb->sv_block_size_bits; i < 10; i++) { |
sb | 56 | fs/sysv/truncate.c | bh = sv_get_hash_table(sb, inode->i_dev, block); |
sb | 57 | fs/sysv/truncate.c | if ((i << sb->sv_block_size_bits) < inode->i_size) { |
sb | 69 | fs/sysv/truncate.c | sysv_free_block(sb,block); |
sb | 77 | fs/sysv/truncate.c | struct super_block * sb; |
sb | 90 | fs/sysv/truncate.c | sb = inode->i_sb; |
sb | 91 | fs/sysv/truncate.c | indbh = sv_bread(sb, inode->i_dev, indblock); |
sb | 105 | fs/sysv/truncate.c | i = (inode->i_size - offset + sb->sv_block_size_1) >> sb->sv_block_size_bits; |
sb | 106 | fs/sysv/truncate.c | for (; i < sb->sv_ind_per_block; i++) { |
sb | 109 | fs/sysv/truncate.c | if (sb->sv_convert) |
sb | 113 | fs/sysv/truncate.c | bh = sv_get_hash_table(sb, inode->i_dev, block); |
sb | 114 | fs/sysv/truncate.c | if ((i << sb->sv_block_size_bits) + offset < inode->i_size) { |
sb | 126 | fs/sysv/truncate.c | sysv_free_block(sb,block); |
sb | 128 | fs/sysv/truncate.c | for (i = 0; i < sb->sv_ind_per_block; i++) |
sb | 137 | fs/sysv/truncate.c | sysv_free_block(sb,indblock); |
sb | 146 | fs/sysv/truncate.c | struct super_block * sb; |
sb | 158 | fs/sysv/truncate.c | sb = inode->i_sb; |
sb | 159 | fs/sysv/truncate.c | indbh = sv_bread(sb, inode->i_dev, indblock); |
sb | 172 | fs/sysv/truncate.c | i = (inode->i_size - offset + sb->sv_ind_per_block_block_size_1) >> sb->sv_ind_per_block_block_size_bits; |
sb | 173 | fs/sysv/truncate.c | for (; i < sb->sv_ind_per_block; i++) { |
sb | 176 | fs/sysv/truncate.c | if (sb->sv_convert) |
sb | 180 | fs/sysv/truncate.c | retry |= trunc_indirect(inode,offset+(i<<sb->sv_ind_per_block_bits),ind,sb->sv_convert,&indbh->b_dirt); |
sb | 182 | fs/sysv/truncate.c | for (i = 0; i < sb->sv_ind_per_block; i++) |
sb | 191 | fs/sysv/truncate.c | sysv_free_block(sb,indblock); |
sb | 200 | fs/sysv/truncate.c | struct super_block * sb; |
sb | 212 | fs/sysv/truncate.c | sb = inode->i_sb; |
sb | 213 | fs/sysv/truncate.c | indbh = sv_bread(sb, inode->i_dev, indblock); |
sb | 226 | fs/sysv/truncate.c | i = (inode->i_size - offset + sb->sv_ind_per_block_2_block_size_1) >> sb->sv_ind_per_block_2_block_size_bits; |
sb | 227 | fs/sysv/truncate.c | for (; i < sb->sv_ind_per_block; i++) { |
sb | 230 | fs/sysv/truncate.c | if (sb->sv_convert) |
sb | 234 | fs/sysv/truncate.c | retry |= trunc_dindirect(inode,offset+(i<<sb->sv_ind_per_block_2_bits),ind,sb->sv_convert,&indbh->b_dirt); |
sb | 236 | fs/sysv/truncate.c | for (i = 0; i < sb->sv_ind_per_block; i++) |
sb | 245 | fs/sysv/truncate.c | sysv_free_block(sb,indblock); |
sb | 253 | fs/sysv/truncate.c | struct super_block * sb; |
sb | 255 | fs/sysv/truncate.c | sb = inode->i_sb; |
sb | 257 | fs/sysv/truncate.c | | trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,&inode->i_dirt) |
sb | 258 | fs/sysv/truncate.c | | trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,&inode->i_dirt) |
sb | 259 | fs/sysv/truncate.c | | trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,&inode->i_dirt); |
sb | 53 | fs/umsdos/inode.c | void UMSDOS_put_super(struct super_block *sb) |
sb | 55 | fs/umsdos/inode.c | msdos_put_super(sb); |
sb | 62 | fs/umsdos/inode.c | void UMSDOS_statfs(struct super_block *sb,struct statfs *buf) |
sb | 64 | fs/umsdos/inode.c | msdos_statfs(sb,buf); |
sb | 412 | fs/umsdos/inode.c | struct super_block *sb = msdos_read_super(s,data,silent); |
sb | 415 | fs/umsdos/inode.c | if (sb != NULL){ |
sb | 416 | fs/umsdos/inode.c | sb->s_op = &umsdos_sops; |
sb | 417 | fs/umsdos/inode.c | PRINTK (("umsdos_read_super %p\n",sb->s_mounted)); |
sb | 418 | fs/umsdos/inode.c | umsdos_setup_dir_inode (sb->s_mounted); |
sb | 454 | fs/umsdos/inode.c | if (umsdos_real_lookup (sb->s_mounted,UMSDOS_PSDROOT_NAME |
sb | 485 | fs/umsdos/inode.c | return sb; |
sb | 91 | fs/xiafs/bitmap.c | #define get_imap_zone(sb, bit_nr, not_que) \ |
sb | 92 | fs/xiafs/bitmap.c | get__map_zone((sb), (sb)->u.xiafs_sb.s_imap_buf, \ |
sb | 93 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_imap_iznr, \ |
sb | 94 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_imap_cached, 1, \ |
sb | 95 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_imap_zones, _XIAFS_IMAP_SLOTS, \ |
sb | 98 | fs/xiafs/bitmap.c | #define get_zmap_zone(sb, bit_nr, not_que) \ |
sb | 99 | fs/xiafs/bitmap.c | get__map_zone((sb), (sb)->u.xiafs_sb.s_zmap_buf, \ |
sb | 100 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_zmap_zznr, \ |
sb | 101 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_zmap_cached, \ |
sb | 102 | fs/xiafs/bitmap.c | 1+(sb)->u.xiafs_sb.s_imap_zones, \ |
sb | 103 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_zmap_zones, _XIAFS_ZMAP_SLOTS, \ |
sb | 107 | fs/xiafs/bitmap.c | get__map_zone(struct super_block *sb, struct buffer_head * bmap_buf[], |
sb | 114 | fs/xiafs/bitmap.c | z_nr = bit_nr >> XIAFS_BITS_PER_Z_BITS(sb); |
sb | 121 | fs/xiafs/bitmap.c | lock_super(sb); |
sb | 134 | fs/xiafs/bitmap.c | tmp_bh=bread(sb->s_dev, z_nr+first_zone, XIAFS_ZSIZE(sb)); /* cache not hit */ |
sb | 137 | fs/xiafs/bitmap.c | unlock_super(sb); |
sb | 150 | fs/xiafs/bitmap.c | #define xiafs_unlock_super(sb, cache) if (cache) unlock_super(sb); |
sb | 152 | fs/xiafs/bitmap.c | #define get_free_ibit(sb, prev_bit) \ |
sb | 153 | fs/xiafs/bitmap.c | get_free__bit(sb, sb->u.xiafs_sb.s_imap_buf, \ |
sb | 154 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_imap_iznr, \ |
sb | 155 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_imap_cached, \ |
sb | 156 | fs/xiafs/bitmap.c | 1, sb->u.xiafs_sb.s_imap_zones, \ |
sb | 159 | fs/xiafs/bitmap.c | #define get_free_zbit(sb, prev_bit) \ |
sb | 160 | fs/xiafs/bitmap.c | get_free__bit(sb, sb->u.xiafs_sb.s_zmap_buf, \ |
sb | 161 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_zmap_zznr, \ |
sb | 162 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_zmap_cached, \ |
sb | 163 | fs/xiafs/bitmap.c | 1 + sb->u.xiafs_sb.s_imap_zones, \ |
sb | 164 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_zmap_zones, \ |
sb | 168 | fs/xiafs/bitmap.c | get_free__bit(struct super_block *sb, struct buffer_head * bmap_buf[], |
sb | 177 | fs/xiafs/bitmap.c | total_bits=bmap_zones << XIAFS_BITS_PER_Z_BITS(sb); |
sb | 181 | fs/xiafs/bitmap.c | end_bit=XIAFS_BITS_PER_Z(sb); |
sb | 195 | fs/xiafs/bitmap.c | bh = get__map_zone(sb, bmap_buf, bznr, cache, first_zone, |
sb | 202 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_zmap_cached); |
sb | 210 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, cache); |
sb | 211 | fs/xiafs/bitmap.c | return (pos & ~(XIAFS_BITS_PER_Z(sb)-1))+tmp; |
sb | 214 | fs/xiafs/bitmap.c | void xiafs_free_zone(struct super_block * sb, int d_addr) |
sb | 219 | fs/xiafs/bitmap.c | if (!sb) { |
sb | 223 | fs/xiafs/bitmap.c | if (d_addr < sb->u.xiafs_sb.s_firstdatazone || |
sb | 224 | fs/xiafs/bitmap.c | d_addr >= sb->u.xiafs_sb.s_nzones) { |
sb | 228 | fs/xiafs/bitmap.c | bh = get_hash_table(sb->s_dev, d_addr, XIAFS_ZSIZE(sb)); |
sb | 232 | fs/xiafs/bitmap.c | bit=d_addr - sb->u.xiafs_sb.s_firstdatazone + 1; |
sb | 233 | fs/xiafs/bitmap.c | bh = get_zmap_zone(sb, bit, NULL); |
sb | 236 | fs/xiafs/bitmap.c | offset = bit & (XIAFS_BITS_PER_Z(sb) -1); |
sb | 240 | fs/xiafs/bitmap.c | sb->s_dev, bit, bit, WHERE_ERR); |
sb | 242 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_zmap_cached); |
sb | 245 | fs/xiafs/bitmap.c | int xiafs_new_zone(struct super_block * sb, u_long prev_addr) |
sb | 250 | fs/xiafs/bitmap.c | if (!sb) { |
sb | 254 | fs/xiafs/bitmap.c | if (prev_addr < sb->u.xiafs_sb.s_firstdatazone || |
sb | 255 | fs/xiafs/bitmap.c | prev_addr >= sb->u.xiafs_sb.s_nzones) { |
sb | 256 | fs/xiafs/bitmap.c | prev_addr=sb->u.xiafs_sb.s_firstdatazone; |
sb | 258 | fs/xiafs/bitmap.c | prev_znr=prev_addr-sb->u.xiafs_sb.s_firstdatazone+1; |
sb | 259 | fs/xiafs/bitmap.c | tmp=get_free_zbit(sb, prev_znr); |
sb | 262 | fs/xiafs/bitmap.c | tmp += sb->u.xiafs_sb.s_firstdatazone -1; |
sb | 263 | fs/xiafs/bitmap.c | if (!(bh = getblk(sb->s_dev, tmp, XIAFS_ZSIZE(sb)))) { |
sb | 281 | fs/xiafs/bitmap.c | struct super_block * sb; |
sb | 291 | fs/xiafs/bitmap.c | sb = inode->i_sb; |
sb | 293 | fs/xiafs/bitmap.c | bh = get_imap_zone(sb, ino, NULL); |
sb | 297 | fs/xiafs/bitmap.c | if (!clear_bit(ino & (XIAFS_BITS_PER_Z(sb)-1), bh->b_data)) |
sb | 302 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_imap_cached); |
sb | 307 | fs/xiafs/bitmap.c | struct super_block * sb; |
sb | 311 | fs/xiafs/bitmap.c | sb = dir->i_sb; |
sb | 314 | fs/xiafs/bitmap.c | inode->i_sb = sb; |
sb | 317 | fs/xiafs/bitmap.c | tmp=get_free_ibit(sb, dir->i_ino); |
sb | 324 | fs/xiafs/bitmap.c | inode->i_dev = sb->s_dev; |
sb | 352 | fs/xiafs/bitmap.c | unsigned long xiafs_count_free_inodes(struct super_block *sb) |
sb | 359 | fs/xiafs/bitmap.c | izones=sb->u.xiafs_sb.s_imap_zones; |
sb | 361 | fs/xiafs/bitmap.c | bh=get_imap_zone(sb, i << XIAFS_BITS_PER_Z_BITS(sb), ¬_que); |
sb | 364 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_imap_cached); |
sb | 367 | fs/xiafs/bitmap.c | i=izones << XIAFS_BITS_PER_Z_BITS(sb); |
sb | 371 | fs/xiafs/bitmap.c | unsigned long xiafs_count_free_zones(struct super_block *sb) |
sb | 378 | fs/xiafs/bitmap.c | zzones=sb->u.xiafs_sb.s_zmap_zones; |
sb | 380 | fs/xiafs/bitmap.c | bh=get_zmap_zone(sb, i << XIAFS_BITS_PER_Z_BITS(sb), ¬_que); |
sb | 383 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_zmap_cached); |
sb | 386 | fs/xiafs/bitmap.c | i=zzones << XIAFS_BITS_PER_Z_BITS(sb); |
sb | 35 | fs/xiafs/inode.c | void xiafs_put_super(struct super_block *sb) |
sb | 39 | fs/xiafs/inode.c | lock_super(sb); |
sb | 40 | fs/xiafs/inode.c | sb->s_dev = 0; |
sb | 42 | fs/xiafs/inode.c | brelse(sb->u.xiafs_sb.s_imap_buf[i]); |
sb | 44 | fs/xiafs/inode.c | brelse(sb->u.xiafs_sb.s_zmap_buf[i]); |
sb | 45 | fs/xiafs/inode.c | unlock_super(sb); |
sb | 158 | fs/xiafs/inode.c | void xiafs_statfs(struct super_block *sb, struct statfs *buf) |
sb | 163 | fs/xiafs/inode.c | put_fs_long(XIAFS_ZSIZE(sb), &buf->f_bsize); |
sb | 164 | fs/xiafs/inode.c | put_fs_long(sb->u.xiafs_sb.s_ndatazones, &buf->f_blocks); |
sb | 165 | fs/xiafs/inode.c | tmp = xiafs_count_free_zones(sb); |
sb | 168 | fs/xiafs/inode.c | put_fs_long(sb->u.xiafs_sb.s_ninodes, &buf->f_files); |
sb | 169 | fs/xiafs/inode.c | put_fs_long(xiafs_count_free_inodes(sb), &buf->f_ffree); |
sb | 309 | include/linux/ext2_fs.h | #define test_opt(sb, opt) ((sb)->u.ext2_sb.s_mount_opt & \ |
sb | 80 | include/linux/ext_fs.h | extern unsigned long ext_count_free_inodes(struct super_block *sb); |
sb | 81 | include/linux/ext_fs.h | extern int ext_new_block(struct super_block * sb); |
sb | 82 | include/linux/ext_fs.h | extern void ext_free_block(struct super_block * sb, int block); |
sb | 83 | include/linux/ext_fs.h | extern unsigned long ext_count_free_blocks(struct super_block *sb); |
sb | 476 | include/linux/fs.h | extern struct inode * __iget(struct super_block * sb,int nr,int crsmnt); |
sb | 519 | include/linux/fs.h | extern inline struct inode * iget(struct super_block * sb,int nr) |
sb | 521 | include/linux/fs.h | return __iget(sb,nr,1); |
sb | 171 | include/linux/iso_fs.h | extern unsigned long isofs_count_free_inodes(struct super_block *sb); |
sb | 36 | include/linux/locks.h | extern inline void wait_on_super(struct super_block * sb) |
sb | 38 | include/linux/locks.h | if (sb->s_lock) |
sb | 39 | include/linux/locks.h | __wait_on_super(sb); |
sb | 42 | include/linux/locks.h | extern inline void lock_super(struct super_block * sb) |
sb | 44 | include/linux/locks.h | if (sb->s_lock) |
sb | 45 | include/linux/locks.h | __wait_on_super(sb); |
sb | 46 | include/linux/locks.h | sb->s_lock = 1; |
sb | 49 | include/linux/locks.h | extern inline void unlock_super(struct super_block * sb) |
sb | 51 | include/linux/locks.h | sb->s_lock = 0; |
sb | 52 | include/linux/locks.h | wake_up(&sb->s_wait); |
sb | 95 | include/linux/minix_fs.h | extern unsigned long minix_count_free_inodes(struct super_block *sb); |
sb | 96 | include/linux/minix_fs.h | extern int minix_new_block(struct super_block * sb); |
sb | 97 | include/linux/minix_fs.h | extern void minix_free_block(struct super_block * sb, int block); |
sb | 98 | include/linux/minix_fs.h | extern unsigned long minix_count_free_blocks(struct super_block *sb); |
sb | 109 | include/linux/minix_fs.h | extern int minix_remount (struct super_block * sb, int * flags, char * data); |
sb | 125 | include/linux/msdos_fs.h | extern void lock_fat(struct super_block *sb); |
sb | 126 | include/linux/msdos_fs.h | extern void unlock_fat(struct super_block *sb); |
sb | 140 | include/linux/msdos_fs.h | extern int fat_access(struct super_block *sb,int nr,int new_value); |
sb | 166 | include/linux/msdos_fs.h | extern void msdos_put_super(struct super_block *sb); |
sb | 169 | include/linux/msdos_fs.h | extern void msdos_statfs(struct super_block *sb,struct statfs *buf); |
sb | 96 | include/linux/nfs_fs.h | extern struct super_block *nfs_read_super(struct super_block *sb, |
sb | 98 | include/linux/nfs_fs.h | extern struct inode *nfs_fhget(struct super_block *sb, struct nfs_fh *fhandle, |
sb | 340 | include/linux/sysv_fs.h | sv_get_hash_table (struct super_block *sb, int dev, unsigned int block) |
sb | 342 | include/linux/sysv_fs.h | return get_hash_table (dev, block + sb->sv_block_base, sb->sv_block_size); |
sb | 347 | include/linux/sysv_fs.h | sv_getblk (struct super_block *sb, int dev, unsigned int block) |
sb | 349 | include/linux/sysv_fs.h | return getblk (dev, block + sb->sv_block_base, sb->sv_block_size); |
sb | 354 | include/linux/sysv_fs.h | sv_bread (struct super_block *sb, int dev, unsigned int block) |
sb | 356 | include/linux/sysv_fs.h | return bread (dev, block + sb->sv_block_base, sb->sv_block_size); |
sb | 379 | include/linux/sysv_fs.h | extern unsigned long sysv_count_free_inodes(struct super_block *sb); |
sb | 380 | include/linux/sysv_fs.h | extern int sysv_new_block(struct super_block * sb); |
sb | 381 | include/linux/sysv_fs.h | extern void sysv_free_block(struct super_block * sb, unsigned int block); |
sb | 382 | include/linux/sysv_fs.h | extern unsigned long sysv_count_free_blocks(struct super_block *sb); |
sb | 83 | include/linux/xia_fs.h | extern unsigned long xiafs_count_free_inodes(struct super_block *sb); |
sb | 84 | include/linux/xia_fs.h | extern int xiafs_new_zone(struct super_block * sb, u_long prev_addr); |
sb | 85 | include/linux/xia_fs.h | extern void xiafs_free_zone(struct super_block * sb, int block); |
sb | 86 | include/linux/xia_fs.h | extern unsigned long xiafs_count_free_zones(struct super_block *sb); |
sb | 94 | tools/build.c | struct stat sb; |
sb | 101 | tools/build.c | if (stat("/", &sb)) { |
sb | 105 | tools/build.c | major_root = major(sb.st_dev); |
sb | 106 | tools/build.c | minor_root = minor(sb.st_dev); |
sb | 108 | tools/build.c | if (stat(argv[4], &sb)) { |
sb | 112 | tools/build.c | major_root = major(sb.st_rdev); |
sb | 113 | tools/build.c | minor_root = minor(sb.st_rdev); |
sb | 43 | zBoot/xtract.c | struct stat sb; |