tag | line | file | source code |
sb | 700 | drivers/char/tpqic02.c | static int send_qic02_data(char sb[], unsigned size, int ignore_ex) |
sb | 710 | drivers/char/tpqic02.c | stat = notify_cmd(sb[i], ignore_ex); |
sb | 47 | fs/ext/freelists.c | void ext_free_block(struct super_block * sb, int block) |
sb | 52 | fs/ext/freelists.c | if (!sb) { |
sb | 56 | fs/ext/freelists.c | lock_super (sb); |
sb | 57 | fs/ext/freelists.c | if (block < sb->u.ext_sb.s_firstdatazone || |
sb | 58 | fs/ext/freelists.c | block >= sb->u.ext_sb.s_nzones) { |
sb | 62 | fs/ext/freelists.c | bh = get_hash_table(sb->s_dev, block, sb->s_blocksize); |
sb | 66 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeblock) |
sb | 67 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 68 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblock || efb->count == 254) { |
sb | 72 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeblock) |
sb | 73 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeblock); |
sb | 74 | fs/ext/freelists.c | if (!(sb->u.ext_sb.s_firstfreeblock = bread (sb->s_dev, |
sb | 75 | fs/ext/freelists.c | block, sb->s_blocksize))) |
sb | 77 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 78 | fs/ext/freelists.c | efb->next = sb->u.ext_sb.s_firstfreeblocknumber; |
sb | 80 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblocknumber = block; |
sb | 84 | fs/ext/freelists.c | sb->u.ext_sb.s_freeblockscount ++; |
sb | 85 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 86 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblock->b_dirt = 1; |
sb | 87 | fs/ext/freelists.c | unlock_super (sb); |
sb | 91 | fs/ext/freelists.c | int ext_new_block(struct super_block * sb) |
sb | 97 | fs/ext/freelists.c | if (!sb) { |
sb | 101 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblock) |
sb | 103 | fs/ext/freelists.c | lock_super (sb); |
sb | 104 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 107 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblock->b_dirt = 1; |
sb | 112 | fs/ext/freelists.c | j = sb->u.ext_sb.s_firstfreeblocknumber; |
sb | 113 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblocknumber = efb->next; |
sb | 114 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeblock); |
sb | 115 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblocknumber) { |
sb | 116 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblock = NULL; |
sb | 118 | fs/ext/freelists.c | if (!(sb->u.ext_sb.s_firstfreeblock = bread (sb->s_dev, |
sb | 119 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeblocknumber, |
sb | 120 | fs/ext/freelists.c | sb->s_blocksize))) |
sb | 124 | fs/ext/freelists.c | if (j < sb->u.ext_sb.s_firstdatazone || j > sb->u.ext_sb.s_nzones) { |
sb | 129 | fs/ext/freelists.c | sb->u.ext_sb.s_freeblockscount --; |
sb | 130 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 132 | fs/ext/freelists.c | if (!(bh=getblk(sb->s_dev, j, sb->s_blocksize))) { |
sb | 143 | fs/ext/freelists.c | unlock_super (sb); |
sb | 147 | fs/ext/freelists.c | unsigned long ext_count_free_blocks(struct super_block *sb) |
sb | 154 | fs/ext/freelists.c | lock_super (sb); |
sb | 155 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeblock) |
sb | 158 | fs/ext/freelists.c | efb = (struct ext_free_block *) sb->u.ext_sb.s_firstfreeblock->b_data; |
sb | 162 | fs/ext/freelists.c | if (!(bh = bread (sb->s_dev, block, sb->s_blocksize))) { |
sb | 174 | fs/ext/freelists.c | sb->u.ext_sb.s_freeblockscount, count); |
sb | 175 | fs/ext/freelists.c | unlock_super (sb); |
sb | 178 | fs/ext/freelists.c | return sb->u.ext_sb.s_freeblockscount; |
sb | 186 | fs/ext/freelists.c | struct super_block * sb; |
sb | 209 | fs/ext/freelists.c | sb = inode->i_sb; |
sb | 213 | fs/ext/freelists.c | lock_super (sb); |
sb | 214 | fs/ext/freelists.c | if (ino < 1 || ino > sb->u.ext_sb.s_ninodes) { |
sb | 216 | fs/ext/freelists.c | unlock_super (sb); |
sb | 219 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 220 | fs/ext/freelists.c | efi = ((struct ext_free_inode *) sb->u.ext_sb.s_firstfreeinodeblock->b_data) + |
sb | 221 | fs/ext/freelists.c | (sb->u.ext_sb.s_firstfreeinodenumber-1)%EXT_INODES_PER_BLOCK; |
sb | 222 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodeblock || efi->count == 14) { |
sb | 226 | fs/ext/freelists.c | if (sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 227 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeinodeblock); |
sb | 229 | fs/ext/freelists.c | if (!(bh = bread(dev, block, sb->s_blocksize))) |
sb | 233 | fs/ext/freelists.c | efi->next = sb->u.ext_sb.s_firstfreeinodenumber; |
sb | 235 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodenumber = ino; |
sb | 236 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodeblock = bh; |
sb | 240 | fs/ext/freelists.c | sb->u.ext_sb.s_freeinodescount ++; |
sb | 241 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 242 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodeblock->b_dirt = 1; |
sb | 243 | fs/ext/freelists.c | unlock_super (sb); |
sb | 248 | fs/ext/freelists.c | struct super_block * sb; |
sb | 256 | fs/ext/freelists.c | sb = dir->i_sb; |
sb | 257 | fs/ext/freelists.c | inode->i_sb = sb; |
sb | 258 | fs/ext/freelists.c | inode->i_flags = sb->s_flags; |
sb | 259 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 261 | fs/ext/freelists.c | lock_super (sb); |
sb | 262 | fs/ext/freelists.c | efi = ((struct ext_free_inode *) sb->u.ext_sb.s_firstfreeinodeblock->b_data) + |
sb | 263 | fs/ext/freelists.c | (sb->u.ext_sb.s_firstfreeinodenumber-1)%EXT_INODES_PER_BLOCK; |
sb | 266 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodeblock->b_dirt = 1; |
sb | 271 | fs/ext/freelists.c | j = sb->u.ext_sb.s_firstfreeinodenumber; |
sb | 272 | fs/ext/freelists.c | if (efi->next > sb->u.ext_sb.s_ninodes) { |
sb | 276 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodenumber = efi->next; |
sb | 278 | fs/ext/freelists.c | brelse (sb->u.ext_sb.s_firstfreeinodeblock); |
sb | 279 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodenumber) { |
sb | 280 | fs/ext/freelists.c | sb->u.ext_sb.s_firstfreeinodeblock = NULL; |
sb | 282 | fs/ext/freelists.c | if (!(sb->u.ext_sb.s_firstfreeinodeblock = |
sb | 283 | fs/ext/freelists.c | bread(sb->s_dev, block, sb->s_blocksize))) |
sb | 287 | fs/ext/freelists.c | sb->u.ext_sb.s_freeinodescount --; |
sb | 288 | fs/ext/freelists.c | sb->s_dirt = 1; |
sb | 291 | fs/ext/freelists.c | inode->i_dev = sb->s_dev; |
sb | 303 | fs/ext/freelists.c | unlock_super (sb); |
sb | 307 | fs/ext/freelists.c | unsigned long ext_count_free_inodes(struct super_block *sb) |
sb | 314 | fs/ext/freelists.c | lock_super (sb); |
sb | 315 | fs/ext/freelists.c | if (!sb->u.ext_sb.s_firstfreeinodeblock) |
sb | 318 | fs/ext/freelists.c | efi = ((struct ext_free_inode *) sb->u.ext_sb.s_firstfreeinodeblock->b_data) + |
sb | 319 | fs/ext/freelists.c | ((sb->u.ext_sb.s_firstfreeinodenumber-1)%EXT_INODES_PER_BLOCK); |
sb | 323 | fs/ext/freelists.c | if (ino < 1 || ino > sb->u.ext_sb.s_ninodes) { |
sb | 325 | fs/ext/freelists.c | (int) sb->u.ext_sb.s_firstfreeinodenumber,ino); |
sb | 329 | fs/ext/freelists.c | if (!(bh = bread (sb->s_dev, block, sb->s_blocksize))) { |
sb | 342 | fs/ext/freelists.c | sb->u.ext_sb.s_freeinodescount, count); |
sb | 343 | fs/ext/freelists.c | unlock_super (sb); |
sb | 346 | 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 | 112 | fs/ext2/balloc.c | static void read_block_bitmap (struct super_block * sb, |
sb | 121 | fs/ext2/balloc.c | group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); |
sb | 122 | fs/ext2/balloc.c | desc = block_group % EXT2_DESC_PER_BLOCK(sb); |
sb | 123 | fs/ext2/balloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) |
sb | 124 | fs/ext2/balloc.c | ext2_panic (sb, "read_block_bitmap", |
sb | 129 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 130 | fs/ext2/balloc.c | bh = bread (sb->s_dev, gdp[desc].bg_block_bitmap, sb->s_blocksize); |
sb | 132 | fs/ext2/balloc.c | ext2_panic (sb, "read_block_bitmap", |
sb | 138 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[bitmap_nr] = block_group; |
sb | 139 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[bitmap_nr] = bh; |
sb | 153 | fs/ext2/balloc.c | static int load__block_bitmap (struct super_block * sb, |
sb | 160 | fs/ext2/balloc.c | if (block_group >= sb->u.ext2_sb.s_groups_count) |
sb | 161 | fs/ext2/balloc.c | ext2_panic (sb, "load_block_bitmap", |
sb | 164 | fs/ext2/balloc.c | block_group, sb->u.ext2_sb.s_groups_count); |
sb | 166 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_groups_count <= EXT2_MAX_GROUP_LOADED) { |
sb | 167 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_block_bitmap[block_group]) { |
sb | 168 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_block_bitmap_number[block_group] != |
sb | 170 | fs/ext2/balloc.c | ext2_panic (sb, "load_block_bitmap", |
sb | 175 | fs/ext2/balloc.c | read_block_bitmap (sb, block_group, block_group); |
sb | 180 | fs/ext2/balloc.c | for (i = 0; i < sb->u.ext2_sb.s_loaded_block_bitmaps && |
sb | 181 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[i] != block_group; i++) |
sb | 183 | fs/ext2/balloc.c | if (i < sb->u.ext2_sb.s_loaded_block_bitmaps && |
sb | 184 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[i] == block_group) { |
sb | 185 | fs/ext2/balloc.c | block_bitmap_number = sb->u.ext2_sb.s_block_bitmap_number[i]; |
sb | 186 | fs/ext2/balloc.c | block_bitmap = sb->u.ext2_sb.s_block_bitmap[i]; |
sb | 188 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j] = |
sb | 189 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j - 1]; |
sb | 190 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j] = |
sb | 191 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j - 1]; |
sb | 193 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[0] = block_bitmap_number; |
sb | 194 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[0] = block_bitmap; |
sb | 196 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_loaded_block_bitmaps < |
sb | 198 | fs/ext2/balloc.c | sb->u.ext2_sb.s_loaded_block_bitmaps++; |
sb | 200 | fs/ext2/balloc.c | brelse (sb->u.ext2_sb.s_block_bitmap |
sb | 202 | fs/ext2/balloc.c | for (j = sb->u.ext2_sb.s_loaded_block_bitmaps - 1; j > 0; j--) { |
sb | 203 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j] = |
sb | 204 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[j - 1]; |
sb | 205 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j] = |
sb | 206 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[j - 1]; |
sb | 208 | fs/ext2/balloc.c | read_block_bitmap (sb, block_group, 0); |
sb | 213 | fs/ext2/balloc.c | static inline int load_block_bitmap (struct super_block * sb, |
sb | 216 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_loaded_block_bitmaps > 0 && |
sb | 217 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[0] == block_group) |
sb | 220 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_groups_count <= EXT2_MAX_GROUP_LOADED && |
sb | 221 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap_number[block_group] == block_group && |
sb | 222 | fs/ext2/balloc.c | sb->u.ext2_sb.s_block_bitmap[block_group]) |
sb | 225 | fs/ext2/balloc.c | return load__block_bitmap (sb, block_group); |
sb | 228 | fs/ext2/balloc.c | void ext2_free_block (struct super_block * sb, unsigned long block) |
sb | 240 | fs/ext2/balloc.c | if (!sb) { |
sb | 244 | fs/ext2/balloc.c | lock_super (sb); |
sb | 245 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 247 | fs/ext2/balloc.c | ext2_error (sb, "ext2_free_block", "block not in datazone"); |
sb | 248 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 255 | fs/ext2/balloc.c | bh = get_hash_table (sb->s_dev, block, sb->s_blocksize); |
sb | 261 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb); |
sb | 262 | fs/ext2/balloc.c | bit = (block - es->s_first_data_block) % EXT2_BLOCKS_PER_GROUP(sb); |
sb | 263 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, block_group); |
sb | 264 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 266 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_free_block", |
sb | 270 | fs/ext2/balloc.c | ext2_warning (sb, "ext2_free_block", |
sb | 273 | fs/ext2/balloc.c | group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); |
sb | 274 | fs/ext2/balloc.c | desc = block_group % EXT2_DESC_PER_BLOCK(sb); |
sb | 275 | fs/ext2/balloc.c | bh2 = sb->u.ext2_sb.s_group_desc[group_desc]; |
sb | 277 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_free_block", |
sb | 284 | fs/ext2/balloc.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 287 | fs/ext2/balloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 291 | fs/ext2/balloc.c | sb->s_dirt = 1; |
sb | 292 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 303 | fs/ext2/balloc.c | int ext2_new_block (struct super_block * sb, unsigned long goal) |
sb | 318 | fs/ext2/balloc.c | if (!sb) { |
sb | 322 | fs/ext2/balloc.c | lock_super (sb); |
sb | 323 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 325 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 333 | fs/ext2/balloc.c | i = ((goal - es->s_first_data_block) / EXT2_BLOCKS_PER_GROUP(sb)); |
sb | 334 | fs/ext2/balloc.c | group_desc = i / EXT2_DESC_PER_BLOCK(sb); |
sb | 335 | fs/ext2/balloc.c | desc = i % EXT2_DESC_PER_BLOCK(sb); |
sb | 337 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 339 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_new_block", |
sb | 344 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb)); |
sb | 349 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 350 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 352 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_new_block", |
sb | 354 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 373 | fs/ext2/balloc.c | if (j < EXT2_BLOCKS_PER_GROUP(sb) - 32) |
sb | 383 | fs/ext2/balloc.c | if ((j + k) < EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 401 | fs/ext2/balloc.c | (EXT2_BLOCKS_PER_GROUP(sb) - j + 7) >> 3); |
sb | 403 | fs/ext2/balloc.c | if (k < EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 408 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb), |
sb | 410 | fs/ext2/balloc.c | if (k < EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 420 | fs/ext2/balloc.c | for (k = 0; k < sb->u.ext2_sb.s_groups_count; k++) { |
sb | 422 | fs/ext2/balloc.c | if (i >= sb->u.ext2_sb.s_groups_count) { |
sb | 427 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 431 | fs/ext2/balloc.c | if (desc >= EXT2_DESC_PER_BLOCK(sb)) { |
sb | 435 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc] |
sb | 440 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_new_block", |
sb | 446 | fs/ext2/balloc.c | if (k >= sb->u.ext2_sb.s_groups_count) { |
sb | 447 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 450 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 451 | fs/ext2/balloc.c | bh = sb->u.ext2_sb.s_block_bitmap[bitmap_nr]; |
sb | 453 | fs/ext2/balloc.c | ext2_panic (sb, "ext2_new_block", |
sb | 456 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb) >> 3); |
sb | 458 | fs/ext2/balloc.c | if (j >= EXT2_BLOCKS_PER_GROUP(sb)) |
sb | 460 | fs/ext2/balloc.c | EXT2_BLOCKS_PER_GROUP(sb)); |
sb | 461 | fs/ext2/balloc.c | if (j >= EXT2_BLOCKS_PER_GROUP(sb)) { |
sb | 462 | fs/ext2/balloc.c | ext2_error (sb, "ext2_new_block", |
sb | 464 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 474 | fs/ext2/balloc.c | ext2_warning (sb, "ext2_new_block", |
sb | 479 | fs/ext2/balloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 486 | fs/ext2/balloc.c | j += i * EXT2_BLOCKS_PER_GROUP(sb) + es->s_first_data_block; |
sb | 488 | fs/ext2/balloc.c | ext2_error (sb, "ext2_new_block", |
sb | 491 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 494 | fs/ext2/balloc.c | if (!(bh = getblk (sb->s_dev, j, sb->s_blocksize))) { |
sb | 495 | fs/ext2/balloc.c | ext2_error (sb, "ext2_new_block", "cannot get block %d", j); |
sb | 496 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 499 | fs/ext2/balloc.c | clear_block (bh->b_data, sb->s_blocksize); |
sb | 508 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_dirt = 1; |
sb | 510 | fs/ext2/balloc.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 511 | fs/ext2/balloc.c | sb->s_dirt = 1; |
sb | 512 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 516 | fs/ext2/balloc.c | unsigned long ext2_count_free_blocks (struct super_block * sb) |
sb | 527 | fs/ext2/balloc.c | lock_super (sb); |
sb | 528 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 534 | fs/ext2/balloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 536 | fs/ext2/balloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) { |
sb | 542 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 545 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 546 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_block_bitmap[bitmap_nr]) |
sb | 548 | fs/ext2/balloc.c | (sb->u.ext2_sb.s_block_bitmap[bitmap_nr], |
sb | 549 | fs/ext2/balloc.c | sb->s_blocksize); |
sb | 558 | fs/ext2/balloc.c | if (desc == EXT2_DESC_PER_BLOCK(sb)) { |
sb | 566 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 569 | fs/ext2/balloc.c | return sb->u.ext2_sb.s_es->s_free_blocks_count; |
sb | 573 | fs/ext2/balloc.c | void ext2_check_blocks_bitmap (struct super_block * sb) |
sb | 583 | fs/ext2/balloc.c | lock_super (sb); |
sb | 584 | fs/ext2/balloc.c | es = sb->u.ext2_sb.s_es; |
sb | 590 | fs/ext2/balloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 592 | fs/ext2/balloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) { |
sb | 593 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 599 | fs/ext2/balloc.c | sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 602 | fs/ext2/balloc.c | bitmap_nr = load_block_bitmap (sb, i); |
sb | 603 | fs/ext2/balloc.c | if (sb->u.ext2_sb.s_block_bitmap[bitmap_nr]) |
sb | 605 | fs/ext2/balloc.c | (sb->u.ext2_sb.s_block_bitmap[bitmap_nr], |
sb | 606 | fs/ext2/balloc.c | sb->s_blocksize); |
sb | 609 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 613 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 619 | fs/ext2/balloc.c | if (desc == EXT2_DESC_PER_BLOCK(sb)) { |
sb | 626 | fs/ext2/balloc.c | ext2_error (sb, "ext2_check_blocks_bitmap", |
sb | 630 | fs/ext2/balloc.c | unlock_super (sb); |
sb | 99 | fs/ext2/dir.c | struct super_block * sb; |
sb | 104 | fs/ext2/dir.c | sb = inode->i_sb; |
sb | 106 | fs/ext2/dir.c | offset = filp->f_pos & (sb->s_blocksize - 1); |
sb | 107 | fs/ext2/dir.c | bh = ext2_bread (inode, (filp->f_pos) >> EXT2_BLOCK_SIZE_BITS(sb), |
sb | 110 | fs/ext2/dir.c | filp->f_pos += sb->s_blocksize - offset; |
sb | 114 | fs/ext2/dir.c | while (offset < sb->s_blocksize && filp->f_pos < inode->i_size) { |
sb | 82 | fs/ext2/file.c | struct super_block * sb; |
sb | 90 | fs/ext2/file.c | sb = inode->i_sb; |
sb | 92 | fs/ext2/file.c | ext2_warning (sb, "ext2_file_read", "mode = %07o", |
sb | 107 | fs/ext2/file.c | block = offset >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 108 | fs/ext2/file.c | offset &= (sb->s_blocksize - 1); |
sb | 109 | fs/ext2/file.c | size = (size + sb->s_blocksize - 1) >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 110 | fs/ext2/file.c | blocks = (left + offset + sb->s_blocksize - 1) >> EXT2_BLOCK_SIZE_BITS(sb); |
sb | 114 | fs/ext2/file.c | (EXT2_BLOCK_SIZE_BITS(sb) - 9); |
sb | 167 | fs/ext2/file.c | if (left < sb->s_blocksize - offset) |
sb | 170 | fs/ext2/file.c | chars = sb->s_blocksize - offset; |
sb | 212 | fs/ext2/file.c | struct super_block * sb; |
sb | 219 | fs/ext2/file.c | sb = inode->i_sb; |
sb | 221 | fs/ext2/file.c | ext2_warning (sb, "ext2_file_write", "mode = %07o\n", |
sb | 235 | fs/ext2/file.c | bh = ext2_getblk (inode, pos / sb->s_blocksize, 1, &err); |
sb | 241 | fs/ext2/file.c | c = sb->s_blocksize - (pos % sb->s_blocksize); |
sb | 244 | fs/ext2/file.c | if (c != sb->s_blocksize && !bh->b_uptodate) { |
sb | 254 | fs/ext2/file.c | p = (pos % sb->s_blocksize) + bh->b_data; |
sb | 62 | fs/ext2/ialloc.c | static void read_inode_bitmap (struct super_block * sb, |
sb | 71 | fs/ext2/ialloc.c | group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); |
sb | 72 | fs/ext2/ialloc.c | desc = block_group % EXT2_DESC_PER_BLOCK(sb); |
sb | 73 | fs/ext2/ialloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) |
sb | 74 | fs/ext2/ialloc.c | ext2_panic (sb, "read_inode_bitmap", |
sb | 78 | fs/ext2/ialloc.c | gdp = (struct ext2_group_desc *) sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 79 | fs/ext2/ialloc.c | bh = bread (sb->s_dev, gdp[desc].bg_inode_bitmap, sb->s_blocksize); |
sb | 81 | fs/ext2/ialloc.c | ext2_panic (sb, "read_inode_bitmap", "Cannot read inode bitmap\n" |
sb | 84 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[bitmap_nr] = block_group; |
sb | 85 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[bitmap_nr] = bh; |
sb | 99 | fs/ext2/ialloc.c | static int load_inode_bitmap (struct super_block * sb, |
sb | 106 | fs/ext2/ialloc.c | if (block_group >= sb->u.ext2_sb.s_groups_count) |
sb | 107 | fs/ext2/ialloc.c | ext2_panic (sb, "load_inode_bitmap", |
sb | 110 | fs/ext2/ialloc.c | block_group, sb->u.ext2_sb.s_groups_count); |
sb | 111 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_loaded_inode_bitmaps > 0 && |
sb | 112 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[0] == block_group) |
sb | 114 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_groups_count <= EXT2_MAX_GROUP_LOADED) { |
sb | 115 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_inode_bitmap[block_group]) { |
sb | 116 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_inode_bitmap_number[block_group] != block_group) |
sb | 117 | fs/ext2/ialloc.c | ext2_panic (sb, "load_inode_bitmap", |
sb | 122 | fs/ext2/ialloc.c | read_inode_bitmap (sb, block_group, block_group); |
sb | 127 | fs/ext2/ialloc.c | for (i = 0; i < sb->u.ext2_sb.s_loaded_inode_bitmaps && |
sb | 128 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[i] != block_group; |
sb | 131 | fs/ext2/ialloc.c | if (i < sb->u.ext2_sb.s_loaded_inode_bitmaps && |
sb | 132 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[i] == block_group) { |
sb | 133 | fs/ext2/ialloc.c | inode_bitmap_number = sb->u.ext2_sb.s_inode_bitmap_number[i]; |
sb | 134 | fs/ext2/ialloc.c | inode_bitmap = sb->u.ext2_sb.s_inode_bitmap[i]; |
sb | 136 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j] = |
sb | 137 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j - 1]; |
sb | 138 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j] = |
sb | 139 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j - 1]; |
sb | 141 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[0] = inode_bitmap_number; |
sb | 142 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[0] = inode_bitmap; |
sb | 144 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_loaded_inode_bitmaps < EXT2_MAX_GROUP_LOADED) |
sb | 145 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_loaded_inode_bitmaps++; |
sb | 147 | fs/ext2/ialloc.c | brelse (sb->u.ext2_sb.s_inode_bitmap[EXT2_MAX_GROUP_LOADED - 1]); |
sb | 148 | fs/ext2/ialloc.c | for (j = sb->u.ext2_sb.s_loaded_inode_bitmaps - 1; j > 0; j--) { |
sb | 149 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j] = |
sb | 150 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap_number[j - 1]; |
sb | 151 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j] = |
sb | 152 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_inode_bitmap[j - 1]; |
sb | 154 | fs/ext2/ialloc.c | read_inode_bitmap (sb, block_group, 0); |
sb | 196 | fs/ext2/ialloc.c | struct super_block * sb; |
sb | 230 | fs/ext2/ialloc.c | sb = inode->i_sb; |
sb | 231 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 233 | fs/ext2/ialloc.c | inode->i_ino > sb->u.ext2_sb.s_es->s_inodes_count) { |
sb | 234 | fs/ext2/ialloc.c | ext2_error (sb, "free_inode", |
sb | 236 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 239 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 240 | fs/ext2/ialloc.c | block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(sb); |
sb | 241 | fs/ext2/ialloc.c | bit = (inode->i_ino - 1) % EXT2_INODES_PER_GROUP(sb); |
sb | 242 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, block_group); |
sb | 243 | fs/ext2/ialloc.c | bh = sb->u.ext2_sb.s_inode_bitmap[bitmap_nr]; |
sb | 245 | fs/ext2/ialloc.c | ext2_panic (sb, "ext2_free_inode", |
sb | 248 | fs/ext2/ialloc.c | ext2_warning (sb, "ext2_free_inode", |
sb | 251 | fs/ext2/ialloc.c | group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); |
sb | 252 | fs/ext2/ialloc.c | desc = block_group % EXT2_DESC_PER_BLOCK(sb); |
sb | 253 | fs/ext2/ialloc.c | bh2 = sb->u.ext2_sb.s_group_desc[group_desc]; |
sb | 255 | fs/ext2/ialloc.c | ext2_panic (sb, "ext2_free_inode", |
sb | 264 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 268 | fs/ext2/ialloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 273 | fs/ext2/ialloc.c | sb->s_dirt = 1; |
sb | 275 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 313 | fs/ext2/ialloc.c | static struct ext2_group_desc * get_group_desc (struct super_block * sb, |
sb | 318 | fs/ext2/ialloc.c | if (group >= sb->u.ext2_sb.s_groups_count || group < 0 ) |
sb | 319 | fs/ext2/ialloc.c | ext2_panic (sb, "get_group_desc", "Invalid group %d", group); |
sb | 320 | fs/ext2/ialloc.c | if (!sb->u.ext2_sb.s_group_desc[group / EXT2_DESC_PER_BLOCK(sb)]) |
sb | 321 | fs/ext2/ialloc.c | ext2_panic (sb, "get_group_desc", |
sb | 324 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_group_desc[group / EXT2_DESC_PER_BLOCK(sb)] |
sb | 326 | fs/ext2/ialloc.c | return gdp + (group % EXT2_DESC_PER_BLOCK(sb)); |
sb | 341 | fs/ext2/ialloc.c | struct super_block * sb; |
sb | 351 | fs/ext2/ialloc.c | sb = dir->i_sb; |
sb | 352 | fs/ext2/ialloc.c | inode->i_sb = sb; |
sb | 353 | fs/ext2/ialloc.c | inode->i_flags = sb->s_flags; |
sb | 354 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 355 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 361 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_groups_count; |
sb | 376 | fs/ext2/ialloc.c | for (j = 0; j < sb->u.ext2_sb.s_groups_count; j++) { |
sb | 377 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, j); |
sb | 393 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, i); |
sb | 398 | fs/ext2/ialloc.c | for (j = 1; j < sb->u.ext2_sb.s_groups_count; j <<= 1) { |
sb | 400 | fs/ext2/ialloc.c | if (i >= sb->u.ext2_sb.s_groups_count) |
sb | 401 | fs/ext2/ialloc.c | i -= sb->u.ext2_sb.s_groups_count; |
sb | 402 | fs/ext2/ialloc.c | tmp = get_group_desc (sb, i); |
sb | 412 | fs/ext2/ialloc.c | for (j = 2; j < sb->u.ext2_sb.s_groups_count; j++) { |
sb | 413 | fs/ext2/ialloc.c | if (++i >= sb->u.ext2_sb.s_groups_count) |
sb | 415 | fs/ext2/ialloc.c | tmp = get_group_desc (sb,i); |
sb | 425 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 429 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, i); |
sb | 430 | fs/ext2/ialloc.c | bh = sb->u.ext2_sb.s_inode_bitmap[bitmap_nr]; |
sb | 432 | fs/ext2/ialloc.c | ext2_panic (sb, "ext2_new_inode", |
sb | 435 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb))) < |
sb | 436 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb)) { |
sb | 438 | fs/ext2/ialloc.c | ext2_warning (sb, "ext2_new_inode", |
sb | 443 | fs/ext2/ialloc.c | if (sb->s_flags & MS_SYNC) { |
sb | 449 | fs/ext2/ialloc.c | j += i * EXT2_INODES_PER_GROUP(sb) + 1; |
sb | 451 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_new_inode", |
sb | 454 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 461 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_group_desc[i / EXT2_DESC_PER_BLOCK(sb)]->b_dirt = 1; |
sb | 463 | fs/ext2/ialloc.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 464 | fs/ext2/ialloc.c | sb->s_dirt = 1; |
sb | 466 | fs/ext2/ialloc.c | inode->i_sb = sb; |
sb | 469 | fs/ext2/ialloc.c | inode->i_dev = sb->s_dev; |
sb | 474 | fs/ext2/ialloc.c | inode->i_blksize = sb->s_blocksize; |
sb | 493 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 497 | fs/ext2/ialloc.c | unsigned long ext2_count_free_inodes (struct super_block * sb) |
sb | 508 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 509 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 515 | fs/ext2/ialloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 517 | fs/ext2/ialloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) { |
sb | 521 | fs/ext2/ialloc.c | gdp = (struct ext2_group_desc *) sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 524 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, i); |
sb | 525 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_inode_bitmap[bitmap_nr]) |
sb | 526 | fs/ext2/ialloc.c | x = ext2_count_free (sb->u.ext2_sb.s_inode_bitmap[bitmap_nr], |
sb | 527 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb) / 8); |
sb | 537 | fs/ext2/ialloc.c | if (desc == EXT2_DESC_PER_BLOCK(sb)) { |
sb | 545 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 548 | fs/ext2/ialloc.c | return sb->u.ext2_sb.s_es->s_free_inodes_count; |
sb | 552 | fs/ext2/ialloc.c | void ext2_check_inodes_bitmap (struct super_block * sb) |
sb | 562 | fs/ext2/ialloc.c | lock_super (sb); |
sb | 563 | fs/ext2/ialloc.c | es = sb->u.ext2_sb.s_es; |
sb | 569 | fs/ext2/ialloc.c | for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { |
sb | 571 | fs/ext2/ialloc.c | if (!sb->u.ext2_sb.s_group_desc[group_desc]) { |
sb | 572 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_check_inodes_bitmap", |
sb | 577 | fs/ext2/ialloc.c | gdp = (struct ext2_group_desc *) sb->u.ext2_sb.s_group_desc[group_desc]->b_data; |
sb | 580 | fs/ext2/ialloc.c | bitmap_nr = load_inode_bitmap (sb, i); |
sb | 581 | fs/ext2/ialloc.c | if (sb->u.ext2_sb.s_inode_bitmap[bitmap_nr]) |
sb | 582 | fs/ext2/ialloc.c | x = ext2_count_free (sb->u.ext2_sb.s_inode_bitmap[bitmap_nr], |
sb | 583 | fs/ext2/ialloc.c | EXT2_INODES_PER_GROUP(sb) / 8); |
sb | 586 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_check_inodes_bitmap", |
sb | 591 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_check_inodes_bitmap", |
sb | 597 | fs/ext2/ialloc.c | if (desc == EXT2_DESC_PER_BLOCK(sb)) { |
sb | 604 | fs/ext2/ialloc.c | ext2_error (sb, "ext2_check_inodes_bitmap", |
sb | 608 | fs/ext2/ialloc.c | unlock_super (sb); |
sb | 72 | fs/ext2/namei.c | struct super_block * sb; |
sb | 78 | fs/ext2/namei.c | sb = dir->i_sb; |
sb | 92 | fs/ext2/namei.c | if (!bh || (char *)de >= sb->s_blocksize + bh->b_data) { |
sb | 94 | fs/ext2/namei.c | bh = ext2_bread (dir, offset >> EXT2_BLOCK_SIZE_BITS(sb), 0, &err); |
sb | 96 | fs/ext2/namei.c | offset += sb->s_blocksize; |
sb | 174 | fs/ext2/namei.c | struct super_block * sb; |
sb | 180 | fs/ext2/namei.c | sb = dir->i_sb; |
sb | 205 | fs/ext2/namei.c | if ((char *)de >= sb->s_blocksize + bh->b_data) { |
sb | 208 | fs/ext2/namei.c | bh = ext2_bread (dir, offset >> EXT2_BLOCK_SIZE_BITS(sb), 1, err); |
sb | 221 | fs/ext2/namei.c | de->rec_len = sb->s_blocksize; |
sb | 222 | fs/ext2/namei.c | dir->i_size = offset + sb->s_blocksize; |
sb | 521 | fs/ext2/namei.c | struct super_block * sb; |
sb | 524 | fs/ext2/namei.c | sb = inode->i_sb; |
sb | 542 | fs/ext2/namei.c | if ((void *) de >= (void *) (bh->b_data + sb->s_blocksize)) { |
sb | 544 | fs/ext2/namei.c | bh = ext2_bread (inode, offset >> EXT2_BLOCK_SIZE_BITS(sb), 1, &err); |
sb | 546 | 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 | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 39 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 49 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 52 | fs/ext2/super.c | volatile void ext2_panic (struct super_block * sb, const char * function, |
sb | 58 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 59 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_state |= EXT2_ERROR_FS; |
sb | 60 | fs/ext2/super.c | sb->u.ext2_sb.s_es->s_state |= EXT2_ERROR_FS; |
sb | 61 | fs/ext2/super.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 62 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 68 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 71 | fs/ext2/super.c | void ext2_warning (struct super_block * sb, const char * function, |
sb | 85 | fs/ext2/super.c | MAJOR(sb->s_dev), MINOR(sb->s_dev), function, buf); |
sb | 88 | fs/ext2/super.c | void ext2_put_super (struct super_block * sb) |
sb | 92 | fs/ext2/super.c | lock_super (sb); |
sb | 93 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 94 | fs/ext2/super.c | sb->u.ext2_sb.s_es->s_state = sb->u.ext2_sb.s_mount_state; |
sb | 95 | fs/ext2/super.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 98 | fs/ext2/super.c | ext2_dcache_invalidate (sb->s_dev); |
sb | 100 | fs/ext2/super.c | sb->s_dev = 0; |
sb | 102 | fs/ext2/super.c | if (sb->u.ext2_sb.s_group_desc[i]) |
sb | 103 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_group_desc[i]); |
sb | 105 | fs/ext2/super.c | if (sb->u.ext2_sb.s_inode_bitmap[i]) |
sb | 106 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_inode_bitmap[i]); |
sb | 108 | fs/ext2/super.c | if (sb->u.ext2_sb.s_block_bitmap[i]) |
sb | 109 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_block_bitmap[i]); |
sb | 110 | fs/ext2/super.c | brelse (sb->u.ext2_sb.s_sbh); |
sb | 111 | fs/ext2/super.c | unlock_super (sb); |
sb | 128 | fs/ext2/super.c | static int convert_pre_02b_fs (struct super_block * sb, |
sb | 139 | fs/ext2/super.c | bh2 = bread (sb->s_dev, 2, BLOCK_SIZE); |
sb | 145 | fs/ext2/super.c | groups_count = (sb->u.ext2_sb.s_blocks_count - |
sb | 146 | fs/ext2/super.c | sb->u.ext2_sb.s_first_data_block + |
sb | 147 | fs/ext2/super.c | (EXT2_BLOCK_SIZE(sb) * 8) - 1) / |
sb | 148 | fs/ext2/super.c | (EXT2_BLOCK_SIZE(sb) * 8); |
sb | 162 | fs/ext2/super.c | sb->s_magic = EXT2_SUPER_MAGIC; |
sb | 435 | fs/ext2/super.c | static void ext2_commit_super (struct super_block * sb, |
sb | 439 | fs/ext2/super.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 440 | fs/ext2/super.c | sb->s_dirt = 0; |
sb | 454 | fs/ext2/super.c | void ext2_write_super (struct super_block * sb) |
sb | 458 | fs/ext2/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 459 | fs/ext2/super.c | es = sb->u.ext2_sb.s_es; |
sb | 467 | fs/ext2/super.c | ext2_commit_super (sb, es); |
sb | 469 | fs/ext2/super.c | sb->s_dirt = 0; |
sb | 472 | fs/ext2/super.c | int ext2_remount (struct super_block * sb, int * flags) |
sb | 476 | fs/ext2/super.c | es = sb->u.ext2_sb.s_es; |
sb | 477 | fs/ext2/super.c | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) |
sb | 481 | fs/ext2/super.c | !(sb->u.ext2_sb.s_mount_state & EXT2_VALID_FS)) |
sb | 486 | fs/ext2/super.c | es->s_state = sb->u.ext2_sb.s_mount_state; |
sb | 488 | fs/ext2/super.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 489 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 490 | fs/ext2/super.c | ext2_commit_super (sb, es); |
sb | 496 | fs/ext2/super.c | sb->u.ext2_sb.s_mount_state = es->s_state; |
sb | 502 | fs/ext2/super.c | sb->u.ext2_sb.s_sbh->b_dirt = 1; |
sb | 503 | fs/ext2/super.c | sb->s_dirt = 1; |
sb | 504 | fs/ext2/super.c | if (!(sb->u.ext2_sb.s_mount_state & EXT2_VALID_FS)) |
sb | 507 | fs/ext2/super.c | else if ((sb->u.ext2_sb.s_mount_state & EXT2_ERROR_FS)) |
sb | 517 | fs/ext2/super.c | void ext2_statfs (struct super_block * sb, struct statfs * buf) |
sb | 522 | fs/ext2/super.c | put_fs_long (sb->s_blocksize, &buf->f_bsize); |
sb | 523 | fs/ext2/super.c | put_fs_long (sb->u.ext2_sb.s_es->s_blocks_count, &buf->f_blocks); |
sb | 524 | fs/ext2/super.c | tmp = ext2_count_free_blocks (sb); |
sb | 526 | fs/ext2/super.c | if (tmp >= sb->u.ext2_sb.s_es->s_r_blocks_count) |
sb | 527 | fs/ext2/super.c | put_fs_long (tmp - sb->u.ext2_sb.s_es->s_r_blocks_count, |
sb | 531 | fs/ext2/super.c | put_fs_long (sb->u.ext2_sb.s_es->s_inodes_count, &buf->f_files); |
sb | 532 | fs/ext2/super.c | put_fs_long (ext2_count_free_inodes (sb), &buf->f_ffree); |
sb | 417 | fs/inode.c | struct inode * iget(struct super_block * sb,int nr) |
sb | 419 | fs/inode.c | return __iget(sb,nr,1); |
sb | 422 | fs/inode.c | struct inode * __iget(struct super_block * sb, int nr, int crossmntp) |
sb | 426 | fs/inode.c | if (!sb) |
sb | 430 | fs/inode.c | inode = *(hash(sb->s_dev,nr)); |
sb | 432 | fs/inode.c | if (inode->i_dev != sb->s_dev || inode->i_ino != nr) { |
sb | 437 | fs/inode.c | if (inode->i_dev != sb->s_dev || inode->i_ino != nr) |
sb | 458 | fs/inode.c | inode->i_sb = sb; |
sb | 459 | fs/inode.c | inode->i_dev = sb->s_dev; |
sb | 461 | fs/inode.c | inode->i_flags = sb->s_flags; |
sb | 39 | fs/isofs/inode.c | void isofs_put_super(struct super_block *sb) |
sb | 41 | fs/isofs/inode.c | lock_super(sb); |
sb | 47 | fs/isofs/inode.c | sb->s_dev = 0; |
sb | 48 | fs/isofs/inode.c | unlock_super(sb); |
sb | 299 | fs/isofs/inode.c | void isofs_statfs (struct super_block *sb, struct statfs *buf) |
sb | 303 | fs/isofs/inode.c | put_fs_long(sb->u.isofs_sb.s_nzones, &buf->f_blocks); |
sb | 306 | fs/isofs/inode.c | put_fs_long(sb->u.isofs_sb.s_ninodes, &buf->f_files); |
sb | 68 | fs/minix/bitmap.c | void minix_free_block(struct super_block * sb, int block) |
sb | 73 | fs/minix/bitmap.c | if (!sb) { |
sb | 77 | fs/minix/bitmap.c | if (block < sb->u.minix_sb.s_firstdatazone || |
sb | 78 | fs/minix/bitmap.c | block >= sb->u.minix_sb.s_nzones) { |
sb | 82 | fs/minix/bitmap.c | bh = get_hash_table(sb->s_dev,block,BLOCK_SIZE); |
sb | 86 | fs/minix/bitmap.c | zone = block - sb->u.minix_sb.s_firstdatazone + 1; |
sb | 89 | fs/minix/bitmap.c | bh = sb->u.minix_sb.s_zmap[zone]; |
sb | 95 | fs/minix/bitmap.c | printk("free_block (%04x:%d): bit already cleared\n",sb->s_dev,block); |
sb | 100 | fs/minix/bitmap.c | int minix_new_block(struct super_block * sb) |
sb | 105 | fs/minix/bitmap.c | if (!sb) { |
sb | 112 | fs/minix/bitmap.c | if ((bh=sb->u.minix_sb.s_zmap[i]) != NULL) |
sb | 122 | fs/minix/bitmap.c | j += i*8192 + sb->u.minix_sb.s_firstdatazone-1; |
sb | 123 | fs/minix/bitmap.c | if (j < sb->u.minix_sb.s_firstdatazone || |
sb | 124 | fs/minix/bitmap.c | j >= sb->u.minix_sb.s_nzones) |
sb | 126 | fs/minix/bitmap.c | if (!(bh = getblk(sb->s_dev,j,BLOCK_SIZE))) { |
sb | 137 | fs/minix/bitmap.c | unsigned long minix_count_free_blocks(struct super_block *sb) |
sb | 139 | 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 | 140 | fs/minix/bitmap.c | << sb->u.minix_sb.s_log_zone_size; |
sb | 183 | fs/minix/bitmap.c | struct super_block * sb; |
sb | 190 | fs/minix/bitmap.c | sb = dir->i_sb; |
sb | 191 | fs/minix/bitmap.c | inode->i_sb = sb; |
sb | 215 | fs/minix/bitmap.c | inode->i_dev = sb->s_dev; |
sb | 227 | fs/minix/bitmap.c | unsigned long minix_count_free_inodes(struct super_block *sb) |
sb | 229 | 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 | void minix_put_super(struct super_block *sb) |
sb | 32 | fs/minix/inode.c | lock_super(sb); |
sb | 33 | fs/minix/inode.c | sb->s_dev = 0; |
sb | 35 | fs/minix/inode.c | brelse(sb->u.minix_sb.s_imap[i]); |
sb | 37 | fs/minix/inode.c | brelse(sb->u.minix_sb.s_zmap[i]); |
sb | 38 | fs/minix/inode.c | unlock_super(sb); |
sb | 135 | fs/minix/inode.c | void minix_statfs(struct super_block *sb, struct statfs *buf) |
sb | 141 | fs/minix/inode.c | tmp = sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone; |
sb | 142 | fs/minix/inode.c | tmp <<= sb->u.minix_sb.s_log_zone_size; |
sb | 144 | fs/minix/inode.c | tmp = minix_count_free_blocks(sb); |
sb | 147 | fs/minix/inode.c | put_fs_long(sb->u.minix_sb.s_ninodes, &buf->f_files); |
sb | 148 | fs/minix/inode.c | put_fs_long(minix_count_free_inodes(sb), &buf->f_ffree); |
sb | 149 | fs/minix/inode.c | put_fs_long(sb->u.minix_sb.s_namelen, &buf->f_namelen); |
sb | 18 | 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 | 41 | fs/msdos/fat.c | if (!(bh2 = msdos_sread(sb->s_dev,MSDOS_SB(sb)->fat_start+(last |
sb | 48 | fs/msdos/fat.c | if (MSDOS_SB(sb)->fat_bits == 16) { |
sb | 63 | fs/msdos/fat.c | if (MSDOS_SB(sb)->fat_bits == 16) |
sb | 78 | fs/msdos/fat.c | for (copy = 1; copy < MSDOS_SB(sb)->fats; copy++) { |
sb | 79 | fs/msdos/fat.c | if (!(c_bh = msdos_sread(sb->s_dev,MSDOS_SB(sb)-> |
sb | 80 | fs/msdos/fat.c | fat_start+(first >> SECTOR_BITS)+MSDOS_SB(sb)-> |
sb | 85 | fs/msdos/fat.c | if (!(c_bh2 = msdos_sread(sb->s_dev, |
sb | 86 | fs/msdos/fat.c | MSDOS_SB(sb)->fat_start+(first >> |
sb | 87 | fs/msdos/fat.c | SECTOR_BITS)+MSDOS_SB(sb)->fat_length*copy |
sb | 240 | fs/msdos/fat.c | struct msdos_sb_info *sb; |
sb | 243 | fs/msdos/fat.c | sb = MSDOS_SB(inode->i_sb); |
sb | 246 | fs/msdos/fat.c | if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) return 0; |
sb | 247 | fs/msdos/fat.c | return sector+sb->dir_start; |
sb | 249 | fs/msdos/fat.c | cluster = sector/sb->cluster_size; |
sb | 250 | fs/msdos/fat.c | offset = sector % sb->cluster_size; |
sb | 252 | fs/msdos/fat.c | return (cluster-2)*sb->cluster_size+sb->data_start+offset; |
sb | 22 | fs/msdos/inode.c | struct super_block *sb; |
sb | 31 | fs/msdos/inode.c | sb = inode->i_sb; |
sb | 38 | fs/msdos/inode.c | fs_panic(sb,"..."); |
sb | 47 | fs/msdos/inode.c | void msdos_put_super(struct super_block *sb) |
sb | 49 | fs/msdos/inode.c | cache_inval_dev(sb->s_dev); |
sb | 50 | fs/msdos/inode.c | lock_super(sb); |
sb | 51 | fs/msdos/inode.c | sb->s_dev = 0; |
sb | 52 | fs/msdos/inode.c | unlock_super(sb); |
sb | 262 | fs/msdos/inode.c | void msdos_statfs(struct super_block *sb,struct statfs *buf) |
sb | 266 | fs/msdos/inode.c | put_fs_long(sb->s_magic,&buf->f_type); |
sb | 267 | fs/msdos/inode.c | put_fs_long(MSDOS_SB(sb)->cluster_size*SECTOR_SIZE,&buf->f_bsize); |
sb | 268 | fs/msdos/inode.c | put_fs_long(MSDOS_SB(sb)->clusters,&buf->f_blocks); |
sb | 269 | fs/msdos/inode.c | lock_fat(sb); |
sb | 270 | fs/msdos/inode.c | if (MSDOS_SB(sb)->free_clusters != -1) |
sb | 271 | fs/msdos/inode.c | free = MSDOS_SB(sb)->free_clusters; |
sb | 274 | fs/msdos/inode.c | for (nr = 2; nr < MSDOS_SB(sb)->clusters+2; nr++) |
sb | 275 | fs/msdos/inode.c | if (!fat_access(sb,nr,-1)) free++; |
sb | 276 | fs/msdos/inode.c | MSDOS_SB(sb)->free_clusters = free; |
sb | 278 | fs/msdos/inode.c | unlock_fat(sb); |
sb | 289 | fs/msdos/inode.c | struct msdos_sb_info *sb; |
sb | 292 | fs/msdos/inode.c | sb = MSDOS_SB(inode->i_sb); |
sb | 293 | fs/msdos/inode.c | if ((sb->cluster_size & 1) || (sb->data_start & 1)) return 0; |
sb | 295 | fs/msdos/inode.c | if (sb->dir_start & 1) return 0; |
sb | 296 | fs/msdos/inode.c | return (sb->dir_start >> 1)+block; |
sb | 298 | fs/msdos/inode.c | cluster = (block*2)/sb->cluster_size; |
sb | 299 | fs/msdos/inode.c | offset = (block*2) % sb->cluster_size; |
sb | 301 | fs/msdos/inode.c | return ((cluster-2)*sb->cluster_size+sb->data_start+offset) >> 1; |
sb | 90 | fs/msdos/misc.c | void lock_fat(struct super_block *sb) |
sb | 92 | fs/msdos/misc.c | while (MSDOS_SB(sb)->fat_lock) sleep_on(&MSDOS_SB(sb)->fat_wait); |
sb | 93 | fs/msdos/misc.c | MSDOS_SB(sb)->fat_lock = 1; |
sb | 97 | fs/msdos/misc.c | void unlock_fat(struct super_block *sb) |
sb | 99 | fs/msdos/misc.c | MSDOS_SB(sb)->fat_lock = 0; |
sb | 100 | fs/msdos/misc.c | wake_up(&MSDOS_SB(sb)->fat_wait); |
sb | 330 | fs/msdos/misc.c | inode = iget(sb,sector*MSDOS_DPS+entry); \ |
sb | 346 | fs/msdos/misc.c | static int raw_scan_sector(struct super_block *sb,int sector,char *name, |
sb | 355 | fs/msdos/misc.c | if (!(bh = msdos_sread(sb->s_dev,sector,(void **) &data))) return -EIO; |
sb | 386 | fs/msdos/misc.c | static int raw_scan_root(struct super_block *sb,char *name,int *number,int *ino, |
sb | 391 | fs/msdos/misc.c | for (count = 0; count < MSDOS_SB(sb)->dir_entries/MSDOS_DPS; count++) { |
sb | 392 | fs/msdos/misc.c | if ((cluster = raw_scan_sector(sb,MSDOS_SB(sb)->dir_start+count, |
sb | 404 | fs/msdos/misc.c | static int raw_scan_nonroot(struct super_block *sb,int start,char *name, |
sb | 414 | fs/msdos/misc.c | for (count = 0; count < MSDOS_SB(sb)->cluster_size; count++) { |
sb | 415 | fs/msdos/misc.c | if ((cluster = raw_scan_sector(sb,(start-2)* |
sb | 416 | fs/msdos/misc.c | MSDOS_SB(sb)->cluster_size+MSDOS_SB(sb)->data_start+ |
sb | 420 | fs/msdos/misc.c | if (!(start = fat_access(sb,start,-1))) { |
sb | 421 | fs/msdos/misc.c | fs_panic(sb,"FAT error"); |
sb | 440 | fs/msdos/misc.c | static int raw_scan(struct super_block *sb,int start,char *name,int *number, |
sb | 444 | fs/msdos/misc.c | return raw_scan_nonroot(sb,start,name,number,ino,res_bh,res_de); |
sb | 445 | fs/msdos/misc.c | else return raw_scan_root(sb,name,number,ino,res_bh,res_de); |
sb | 226 | fs/msdos/namei.c | static void dump_fat(struct super_block *sb,int start) |
sb | 231 | fs/msdos/namei.c | start = fat_access(sb,start,-1); |
sb | 97 | fs/namei.c | struct super_block * sb; |
sb | 109 | fs/namei.c | } else if ((sb = dir->i_sb) && (dir == sb->s_mounted)) { |
sb | 110 | fs/namei.c | sb = dir->i_sb; |
sb | 112 | 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 | 121 | 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 | 39 | fs/super.c | static int do_remount_sb(struct super_block *sb, int flags); |
sb | 56 | fs/super.c | void __wait_on_super(struct super_block * sb) |
sb | 60 | fs/super.c | add_wait_queue(&sb->s_wait, &wait); |
sb | 63 | fs/super.c | if (sb->s_lock) { |
sb | 67 | fs/super.c | remove_wait_queue(&sb->s_wait, &wait); |
sb | 73 | fs/super.c | struct super_block * sb; |
sb | 75 | fs/super.c | for (sb = super_blocks + 0 ; sb < super_blocks + NR_SUPER ; sb++) { |
sb | 76 | fs/super.c | if (!sb->s_dev) |
sb | 78 | fs/super.c | if (dev && sb->s_dev != dev) |
sb | 80 | fs/super.c | wait_on_super(sb); |
sb | 81 | fs/super.c | if (!sb->s_dev || !sb->s_dirt) |
sb | 83 | fs/super.c | if (dev && (dev != sb->s_dev)) |
sb | 85 | fs/super.c | if (sb->s_op && sb->s_op->write_super) |
sb | 86 | fs/super.c | sb->s_op->write_super(sb); |
sb | 110 | fs/super.c | struct super_block * sb; |
sb | 117 | fs/super.c | if (!(sb = get_super(dev))) |
sb | 119 | fs/super.c | if (sb->s_covered) { |
sb | 124 | fs/super.c | if (sb->s_op && sb->s_op->put_super) |
sb | 125 | fs/super.c | sb->s_op->put_super(sb); |
sb | 204 | fs/super.c | struct super_block * sb; |
sb | 210 | fs/super.c | if (!(sb=get_super(dev))) |
sb | 212 | fs/super.c | if (!(sb->s_flags & MS_RDONLY)) { |
sb | 213 | fs/super.c | retval = do_remount_sb(sb, MS_RDONLY); |
sb | 219 | fs/super.c | if (!(sb=get_super(dev)) || !(sb->s_covered)) |
sb | 221 | fs/super.c | if (!sb->s_covered->i_mount) |
sb | 224 | fs/super.c | if (!fs_may_umount(dev, sb->s_mounted)) |
sb | 226 | fs/super.c | sb->s_covered->i_mount = NULL; |
sb | 227 | fs/super.c | iput(sb->s_covered); |
sb | 228 | fs/super.c | sb->s_covered = NULL; |
sb | 229 | fs/super.c | iput(sb->s_mounted); |
sb | 230 | fs/super.c | sb->s_mounted = NULL; |
sb | 231 | fs/super.c | if (sb->s_op && sb->s_op->write_super && sb->s_dirt) |
sb | 232 | fs/super.c | sb->s_op->write_super(sb); |
sb | 312 | fs/super.c | struct super_block * sb; |
sb | 330 | fs/super.c | sb = read_super(dev,type,flags,data,0); |
sb | 331 | fs/super.c | if (!sb || sb->s_covered) { |
sb | 335 | fs/super.c | sb->s_covered = dir_i; |
sb | 336 | fs/super.c | dir_i->i_mount = sb->s_mounted; |
sb | 347 | fs/super.c | static int do_remount_sb(struct super_block *sb, int flags) |
sb | 352 | fs/super.c | if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) |
sb | 353 | fs/super.c | if (!fs_may_remount_ro(sb->s_dev)) |
sb | 355 | fs/super.c | if (sb->s_op && sb->s_op->remount_fs) { |
sb | 356 | fs/super.c | retval = sb->s_op->remount_fs(sb, &flags); |
sb | 360 | fs/super.c | sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | |
sb | 491 | fs/super.c | struct super_block * sb; |
sb | 503 | fs/super.c | sb = read_super(ROOT_DEV,fs_type->name,root_mountflags,NULL,1); |
sb | 504 | fs/super.c | if (sb) { |
sb | 505 | fs/super.c | inode = sb->s_mounted; |
sb | 507 | fs/super.c | sb->s_covered = inode; |
sb | 508 | fs/super.c | sb->s_flags = root_mountflags; |
sb | 513 | fs/super.c | (sb->s_flags & MS_RDONLY) ? " readonly" : ""); |
sb | 98 | fs/xiafs/bitmap.c | #define get_imap_zone(sb, bit_nr, not_que) \ |
sb | 99 | fs/xiafs/bitmap.c | get__map_zone((sb), (sb)->u.xiafs_sb.s_imap_buf, \ |
sb | 100 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_imap_iznr, \ |
sb | 101 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_imap_cached, 1, \ |
sb | 102 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_imap_zones, _XIAFS_IMAP_SLOTS, \ |
sb | 105 | fs/xiafs/bitmap.c | #define get_zmap_zone(sb, bit_nr, not_que) \ |
sb | 106 | fs/xiafs/bitmap.c | get__map_zone((sb), (sb)->u.xiafs_sb.s_zmap_buf, \ |
sb | 107 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_zmap_zznr, \ |
sb | 108 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_zmap_cached, \ |
sb | 109 | fs/xiafs/bitmap.c | 1+(sb)->u.xiafs_sb.s_imap_zones, \ |
sb | 110 | fs/xiafs/bitmap.c | (sb)->u.xiafs_sb.s_zmap_zones, _XIAFS_ZMAP_SLOTS, \ |
sb | 114 | fs/xiafs/bitmap.c | get__map_zone(struct super_block *sb, struct buffer_head * bmap_buf[], |
sb | 121 | fs/xiafs/bitmap.c | z_nr = bit_nr >> XIAFS_BITS_PER_Z_BITS(sb); |
sb | 128 | fs/xiafs/bitmap.c | lock_super(sb); |
sb | 141 | fs/xiafs/bitmap.c | tmp_bh=bread(sb->s_dev, z_nr+first_zone, XIAFS_ZSIZE(sb)); /* cache not hit */ |
sb | 144 | fs/xiafs/bitmap.c | unlock_super(sb); |
sb | 157 | fs/xiafs/bitmap.c | #define xiafs_unlock_super(sb, cache) if (cache) unlock_super(sb); |
sb | 159 | fs/xiafs/bitmap.c | #define get_free_ibit(sb, prev_bit) \ |
sb | 160 | fs/xiafs/bitmap.c | get_free__bit(sb, sb->u.xiafs_sb.s_imap_buf, \ |
sb | 161 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_imap_iznr, \ |
sb | 162 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_imap_cached, \ |
sb | 163 | fs/xiafs/bitmap.c | 1, sb->u.xiafs_sb.s_imap_zones, \ |
sb | 166 | fs/xiafs/bitmap.c | #define get_free_zbit(sb, prev_bit) \ |
sb | 167 | fs/xiafs/bitmap.c | get_free__bit(sb, sb->u.xiafs_sb.s_zmap_buf, \ |
sb | 168 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_zmap_zznr, \ |
sb | 169 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_zmap_cached, \ |
sb | 170 | fs/xiafs/bitmap.c | 1 + sb->u.xiafs_sb.s_imap_zones, \ |
sb | 171 | fs/xiafs/bitmap.c | sb->u.xiafs_sb.s_zmap_zones, \ |
sb | 175 | fs/xiafs/bitmap.c | get_free__bit(struct super_block *sb, struct buffer_head * bmap_buf[], |
sb | 184 | fs/xiafs/bitmap.c | total_bits=bmap_zones << XIAFS_BITS_PER_Z_BITS(sb); |
sb | 188 | fs/xiafs/bitmap.c | end_bit=XIAFS_BITS_PER_Z(sb); |
sb | 202 | fs/xiafs/bitmap.c | bh = get__map_zone(sb, bmap_buf, bznr, cache, first_zone, |
sb | 209 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_zmap_cached); |
sb | 217 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, cache); |
sb | 218 | fs/xiafs/bitmap.c | return (pos & ~(XIAFS_BITS_PER_Z(sb)-1))+tmp; |
sb | 221 | fs/xiafs/bitmap.c | void xiafs_free_zone(struct super_block * sb, int d_addr) |
sb | 226 | fs/xiafs/bitmap.c | if (!sb) { |
sb | 230 | fs/xiafs/bitmap.c | if (d_addr < sb->u.xiafs_sb.s_firstdatazone || |
sb | 231 | fs/xiafs/bitmap.c | d_addr >= sb->u.xiafs_sb.s_nzones) { |
sb | 235 | fs/xiafs/bitmap.c | bh = get_hash_table(sb->s_dev, d_addr, XIAFS_ZSIZE(sb)); |
sb | 239 | fs/xiafs/bitmap.c | bit=d_addr - sb->u.xiafs_sb.s_firstdatazone + 1; |
sb | 240 | fs/xiafs/bitmap.c | bh = get_zmap_zone(sb, bit, NULL); |
sb | 243 | fs/xiafs/bitmap.c | offset = bit & (XIAFS_BITS_PER_Z(sb) -1); |
sb | 247 | fs/xiafs/bitmap.c | sb->s_dev, bit, bit, WHERE_ERR); |
sb | 249 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_zmap_cached); |
sb | 252 | fs/xiafs/bitmap.c | int xiafs_new_zone(struct super_block * sb, u_long prev_addr) |
sb | 257 | fs/xiafs/bitmap.c | if (!sb) { |
sb | 261 | fs/xiafs/bitmap.c | if (prev_addr < sb->u.xiafs_sb.s_firstdatazone || |
sb | 262 | fs/xiafs/bitmap.c | prev_addr >= sb->u.xiafs_sb.s_nzones) { |
sb | 263 | fs/xiafs/bitmap.c | prev_addr=sb->u.xiafs_sb.s_firstdatazone; |
sb | 265 | fs/xiafs/bitmap.c | prev_znr=prev_addr-sb->u.xiafs_sb.s_firstdatazone+1; |
sb | 266 | fs/xiafs/bitmap.c | tmp=get_free_zbit(sb, prev_znr); |
sb | 269 | fs/xiafs/bitmap.c | tmp += sb->u.xiafs_sb.s_firstdatazone -1; |
sb | 270 | fs/xiafs/bitmap.c | if (!(bh = getblk(sb->s_dev, tmp, XIAFS_ZSIZE(sb)))) { |
sb | 288 | fs/xiafs/bitmap.c | struct super_block * sb; |
sb | 298 | fs/xiafs/bitmap.c | sb = inode->i_sb; |
sb | 300 | fs/xiafs/bitmap.c | bh = get_imap_zone(sb, ino, NULL); |
sb | 304 | fs/xiafs/bitmap.c | if (clear_bit(ino & (XIAFS_BITS_PER_Z(sb)-1), bh->b_data)) |
sb | 309 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_imap_cached); |
sb | 314 | fs/xiafs/bitmap.c | struct super_block * sb; |
sb | 318 | fs/xiafs/bitmap.c | sb = dir->i_sb; |
sb | 321 | fs/xiafs/bitmap.c | inode->i_sb = sb; |
sb | 324 | fs/xiafs/bitmap.c | tmp=get_free_ibit(sb, dir->i_ino); |
sb | 331 | fs/xiafs/bitmap.c | inode->i_dev = sb->s_dev; |
sb | 359 | fs/xiafs/bitmap.c | unsigned long xiafs_count_free_inodes(struct super_block *sb) |
sb | 366 | fs/xiafs/bitmap.c | izones=sb->u.xiafs_sb.s_imap_zones; |
sb | 368 | fs/xiafs/bitmap.c | bh=get_imap_zone(sb, i << XIAFS_BITS_PER_Z_BITS(sb), ¬_que); |
sb | 371 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_imap_cached); |
sb | 374 | fs/xiafs/bitmap.c | i=izones << XIAFS_BITS_PER_Z_BITS(sb); |
sb | 378 | fs/xiafs/bitmap.c | unsigned long xiafs_count_free_zones(struct super_block *sb) |
sb | 385 | fs/xiafs/bitmap.c | zzones=sb->u.xiafs_sb.s_zmap_zones; |
sb | 387 | fs/xiafs/bitmap.c | bh=get_zmap_zone(sb, i << XIAFS_BITS_PER_Z_BITS(sb), ¬_que); |
sb | 390 | fs/xiafs/bitmap.c | xiafs_unlock_super(sb, sb->u.xiafs_sb.s_zmap_cached); |
sb | 393 | 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 | 79 | include/linux/ext_fs.h | extern unsigned long ext_count_free_inodes(struct super_block *sb); |
sb | 80 | include/linux/ext_fs.h | extern int ext_new_block(struct super_block * sb); |
sb | 81 | include/linux/ext_fs.h | extern void ext_free_block(struct super_block * sb, int block); |
sb | 82 | include/linux/ext_fs.h | extern unsigned long ext_count_free_blocks(struct super_block *sb); |
sb | 370 | include/linux/fs.h | extern struct inode * __iget(struct super_block * sb,int nr,int crsmnt); |
sb | 371 | include/linux/fs.h | extern struct inode * iget(struct super_block * sb,int nr); |
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 | 90 | include/linux/minix_fs.h | extern unsigned long minix_count_free_inodes(struct super_block *sb); |
sb | 91 | include/linux/minix_fs.h | extern int minix_new_block(struct super_block * sb); |
sb | 92 | include/linux/minix_fs.h | extern void minix_free_block(struct super_block * sb, int block); |
sb | 93 | include/linux/minix_fs.h | extern unsigned long minix_count_free_blocks(struct super_block *sb); |
sb | 130 | include/linux/msdos_fs.h | extern void lock_fat(struct super_block *sb); |
sb | 131 | include/linux/msdos_fs.h | extern void unlock_fat(struct super_block *sb); |
sb | 145 | include/linux/msdos_fs.h | extern int fat_access(struct super_block *sb,int nr,int new_value); |
sb | 170 | include/linux/msdos_fs.h | extern void msdos_put_super(struct super_block *sb); |
sb | 173 | include/linux/msdos_fs.h | extern void msdos_statfs(struct super_block *sb,struct statfs *buf); |
sb | 101 | include/linux/nfs_fs.h | extern struct super_block *nfs_read_super(struct super_block *sb, |
sb | 103 | include/linux/nfs_fs.h | extern struct inode *nfs_fhget(struct super_block *sb, struct nfs_fh *fhandle, |
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 | 92 | tools/build.c | struct stat sb; |
sb | 98 | tools/build.c | if (stat("/", &sb)) { |
sb | 102 | tools/build.c | major_root = major(sb.st_dev); |
sb | 103 | tools/build.c | minor_root = minor(sb.st_dev); |
sb | 105 | tools/build.c | if (stat(argv[4], &sb)) { |
sb | 109 | tools/build.c | major_root = major(sb.st_rdev); |
sb | 110 | tools/build.c | minor_root = minor(sb.st_rdev); |
sb | 41 | zBoot/xtract.c | struct stat sb; |