Fork me on GitHub
sb                315 fs/elf.c       	if(!(buf = bread(ii->dev, block, ii->sb->s_blocksize))) {
sb                328 fs/elf.c       	memcpy_b(data, buf->data, ii->sb->s_blocksize);
sb                 19 fs/ext2/bitmaps.c static int find_first_zero(struct superblock *sb, __blk_t block)
sb                 26 fs/ext2/bitmaps.c 	blksize = sb->s_blocksize;
sb                 28 fs/ext2/bitmaps.c 	if(!(buf = bread(sb->dev, block, blksize))) {
sb                 44 fs/ext2/bitmaps.c static int change_bit(int mode, struct superblock *sb, __blk_t block, int item)
sb                 49 fs/ext2/bitmaps.c 	block += item / (sb->s_blocksize * 8);
sb                 50 fs/ext2/bitmaps.c 	byte = (item % (sb->s_blocksize * 8)) / 8;
sb                 51 fs/ext2/bitmaps.c 	bit = (item % (sb->s_blocksize * 8)) % 8;
sb                 54 fs/ext2/bitmaps.c 	if(!(buf = bread(sb->dev, block, sb->s_blocksize))) {
sb                 86 fs/ext2/bitmaps.c 	struct superblock *sb;
sb                 91 fs/ext2/bitmaps.c 	sb = i->sb;
sb                 92 fs/ext2/bitmaps.c 	superblock_lock(sb);
sb                 94 fs/ext2/bitmaps.c 	block = SUPERBLOCK + sb->u.ext2.sb.s_first_data_block;
sb                 99 fs/ext2/bitmaps.c 	for(bg = 0, d = 0; bg < sb->u.ext2.block_groups; bg++, d++) {
sb                100 fs/ext2/bitmaps.c 		if(!(bg % (sb->s_blocksize / sizeof(struct ext2_group_desc)))) {
sb                106 fs/ext2/bitmaps.c 			if(!(buf = bread(sb->dev, block, sb->s_blocksize))) {
sb                107 fs/ext2/bitmaps.c 				superblock_unlock(sb);
sb                113 fs/ext2/bitmaps.c 			if((inode = find_first_zero(sb, gd->bg_inode_bitmap))) {
sb                120 fs/ext2/bitmaps.c 		superblock_unlock(sb);
sb                124 fs/ext2/bitmaps.c 	errno = change_bit(SET_BIT, sb, gd->bg_inode_bitmap, inode - 1);
sb                129 fs/ext2/bitmaps.c 			superblock_unlock(sb);
sb                136 fs/ext2/bitmaps.c 	inode += bg * EXT2_INODES_PER_GROUP(sb);
sb                138 fs/ext2/bitmaps.c 	sb->u.ext2.sb.s_free_inodes_count--;
sb                149 fs/ext2/bitmaps.c 	superblock_unlock(sb);
sb                157 fs/ext2/bitmaps.c 	struct superblock *sb;
sb                161 fs/ext2/bitmaps.c 	if(!i->inode || i->inode > i->sb->u.ext2.sb.s_inodes_count) {
sb                170 fs/ext2/bitmaps.c 	sb = i->sb;
sb                171 fs/ext2/bitmaps.c 	superblock_lock(sb);
sb                173 fs/ext2/bitmaps.c 	b = SUPERBLOCK + sb->u.ext2.sb.s_first_data_block;
sb                174 fs/ext2/bitmaps.c 	bg = (i->inode - 1) / EXT2_INODES_PER_GROUP(sb);
sb                175 fs/ext2/bitmaps.c 	if(!(buf = bread(sb->dev, b + (bg / EXT2_DESC_PER_BLOCK(sb)), sb->s_blocksize))) {
sb                176 fs/ext2/bitmaps.c 		superblock_unlock(sb);
sb                179 fs/ext2/bitmaps.c 	gd = (struct ext2_group_desc *)(buf->data + ((bg % EXT2_DESC_PER_BLOCK(sb)) * sizeof(struct ext2_group_desc)));
sb                180 fs/ext2/bitmaps.c 	errno = change_bit(CLEAR_BIT, sb, gd->bg_inode_bitmap, (i->inode - 1) % EXT2_INODES_PER_GROUP(sb));
sb                186 fs/ext2/bitmaps.c 			superblock_unlock(sb);
sb                194 fs/ext2/bitmaps.c 	sb->u.ext2.sb.s_free_inodes_count++;
sb                205 fs/ext2/bitmaps.c 	superblock_unlock(sb);
sb                209 fs/ext2/bitmaps.c int ext2_balloc(struct superblock *sb)
sb                216 fs/ext2/bitmaps.c 	superblock_lock(sb);
sb                218 fs/ext2/bitmaps.c 	b = SUPERBLOCK + sb->u.ext2.sb.s_first_data_block;
sb                223 fs/ext2/bitmaps.c 	for(bg = 0, d = 0; bg < sb->u.ext2.block_groups; bg++, d++) {
sb                224 fs/ext2/bitmaps.c 		if(!(bg % (sb->s_blocksize / sizeof(struct ext2_group_desc)))) {
sb                230 fs/ext2/bitmaps.c 			if(!(buf = bread(sb->dev, b, sb->s_blocksize))) {
sb                231 fs/ext2/bitmaps.c 				superblock_unlock(sb);
sb                237 fs/ext2/bitmaps.c 			if((block = find_first_zero(sb, gd->bg_block_bitmap))) {
sb                244 fs/ext2/bitmaps.c 		superblock_unlock(sb);
sb                248 fs/ext2/bitmaps.c 	errno = change_bit(SET_BIT, sb, gd->bg_block_bitmap, block - 1);
sb                253 fs/ext2/bitmaps.c 			superblock_unlock(sb);
sb                260 fs/ext2/bitmaps.c 	block += bg * EXT2_BLOCKS_PER_GROUP(sb);
sb                262 fs/ext2/bitmaps.c 	sb->u.ext2.sb.s_free_blocks_count--;
sb                265 fs/ext2/bitmaps.c 	superblock_unlock(sb);
sb                269 fs/ext2/bitmaps.c void ext2_bfree(struct superblock *sb, int block)
sb                276 fs/ext2/bitmaps.c 	if(!block || block > sb->u.ext2.sb.s_blocks_count) {
sb                281 fs/ext2/bitmaps.c 	superblock_lock(sb);
sb                283 fs/ext2/bitmaps.c 	b = SUPERBLOCK + sb->u.ext2.sb.s_first_data_block;
sb                284 fs/ext2/bitmaps.c 	bg = (block - 1) / EXT2_BLOCKS_PER_GROUP(sb);
sb                285 fs/ext2/bitmaps.c 	if(!(buf = bread(sb->dev, b + (bg / EXT2_DESC_PER_BLOCK(sb)), sb->s_blocksize))) {
sb                286 fs/ext2/bitmaps.c 		superblock_unlock(sb);
sb                289 fs/ext2/bitmaps.c 	gd = (struct ext2_group_desc *)(buf->data + ((bg % EXT2_DESC_PER_BLOCK(sb)) * sizeof(struct ext2_group_desc)));
sb                290 fs/ext2/bitmaps.c 	errno = change_bit(CLEAR_BIT, sb, gd->bg_block_bitmap, (block - 1) % EXT2_BLOCKS_PER_GROUP(sb));
sb                296 fs/ext2/bitmaps.c 			superblock_unlock(sb);
sb                304 fs/ext2/bitmaps.c 	sb->u.ext2.sb.s_free_blocks_count++;
sb                307 fs/ext2/bitmaps.c 	superblock_unlock(sb);
sb                 96 fs/ext2/dir.c  	blksize = i->sb->s_blocksize;
sb                 91 fs/ext2/file.c 	blksize = i->sb->s_blocksize;
sb                 24 fs/ext2/inode.c #define BLOCKS_PER_IND_BLOCK(sb)	(EXT2_BLOCK_SIZE(sb) / sizeof(unsigned int))
sb                 25 fs/ext2/inode.c #define BLOCKS_PER_DIND_BLOCK(sb)	(BLOCKS_PER_IND_BLOCK(sb) * BLOCKS_PER_IND_BLOCK(sb))
sb                 26 fs/ext2/inode.c #define BLOCKS_PER_TIND_BLOCK(sb)	(BLOCKS_PER_IND_BLOCK(sb) * BLOCKS_PER_IND_BLOCK(sb) * BLOCKS_PER_IND_BLOCK(sb))
sb                 28 fs/ext2/inode.c #define EXT2_INODES_PER_BLOCK(sb)	(EXT2_BLOCK_SIZE(sb) / sizeof(struct ext2_inode))
sb                 36 fs/ext2/inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                 41 fs/ext2/inode.c 	for(n = offset; n < BLOCKS_PER_IND_BLOCK(i->sb); n++) {
sb                 43 fs/ext2/inode.c 			ext2_bfree(i->sb, indblock[n]);
sb                 45 fs/ext2/inode.c 			i->i_blocks -= i->sb->s_blocksize / 512;
sb                 51 fs/ext2/inode.c static int get_group_desc(struct superblock *sb, __blk_t block_group, struct ext2_group_desc *gd)
sb                 57 fs/ext2/inode.c 	group_desc_block = block_group / EXT2_DESC_PER_BLOCK(sb);
sb                 58 fs/ext2/inode.c 	group_desc = block_group % EXT2_DESC_PER_BLOCK(sb);
sb                 59 fs/ext2/inode.c 	if(!(buf = bread(sb->dev, SUPERBLOCK + sb->u.ext2.sb.s_first_data_block + group_desc_block, sb->s_blocksize))) {
sb                 71 fs/ext2/inode.c 	struct superblock *sb;
sb                 76 fs/ext2/inode.c 	if(!(sb = get_superblock(i->dev))) {
sb                 80 fs/ext2/inode.c 	block_group = ((i->inode - 1) / EXT2_INODES_PER_GROUP(sb));
sb                 81 fs/ext2/inode.c 	if(get_group_desc(sb, block_group, &gd)) {
sb                 84 fs/ext2/inode.c 	block = (((i->inode - 1) % EXT2_INODES_PER_GROUP(sb)) / EXT2_INODES_PER_BLOCK(sb));
sb                 86 fs/ext2/inode.c 	if(!(buf = bread(i->dev, gd.bg_inode_table + block, i->sb->s_blocksize))) {
sb                 89 fs/ext2/inode.c 	offset = ((((i->inode - 1) % EXT2_INODES_PER_GROUP(sb)) % EXT2_INODES_PER_BLOCK(sb)) * sizeof(struct ext2_inode));
sb                144 fs/ext2/inode.c 	struct superblock *sb;
sb                149 fs/ext2/inode.c 	if(!(sb = get_superblock(i->dev))) {
sb                153 fs/ext2/inode.c 	block_group = ((i->inode - 1) / EXT2_INODES_PER_GROUP(sb));
sb                154 fs/ext2/inode.c 	if(get_group_desc(sb, block_group, &gd)) {
sb                157 fs/ext2/inode.c 	block = (((i->inode - 1) % EXT2_INODES_PER_GROUP(sb)) / EXT2_INODES_PER_BLOCK(sb));
sb                159 fs/ext2/inode.c 	if(!(buf = bread(i->dev, gd.bg_inode_table + block, i->sb->s_blocksize))) {
sb                162 fs/ext2/inode.c 	offset = ((((i->inode - 1) % EXT2_INODES_PER_GROUP(sb)) % EXT2_INODES_PER_BLOCK(sb)) * sizeof(struct ext2_inode));
sb                195 fs/ext2/inode.c 	blksize = i->sb->s_blocksize;
sb                203 fs/ext2/inode.c 		if(block < (BLOCKS_PER_IND_BLOCK(i->sb) + EXT2_NDIR_BLOCKS)) {
sb                205 fs/ext2/inode.c 		} else if(block < ((BLOCKS_PER_IND_BLOCK(i->sb) * BLOCKS_PER_IND_BLOCK(i->sb)) + BLOCKS_PER_IND_BLOCK(i->sb) + EXT2_NDIR_BLOCKS)) {
sb                215 fs/ext2/inode.c 			if((newblock = ext2_balloc(i->sb)) < 0) {
sb                220 fs/ext2/inode.c 				ext2_bfree(i->sb, newblock);
sb                233 fs/ext2/inode.c 			if((newblock = ext2_balloc(i->sb)) < 0) {
sb                238 fs/ext2/inode.c 				ext2_bfree(i->sb, newblock);
sb                253 fs/ext2/inode.c 	dblock = block - BLOCKS_PER_IND_BLOCK(i->sb);
sb                254 fs/ext2/inode.c 	tblock = block - (BLOCKS_PER_IND_BLOCK(i->sb) * BLOCKS_PER_IND_BLOCK(i->sb)) - BLOCKS_PER_IND_BLOCK(i->sb);
sb                257 fs/ext2/inode.c 		block = dblock / BLOCKS_PER_IND_BLOCK(i->sb);
sb                260 fs/ext2/inode.c 		block = tblock / (BLOCKS_PER_IND_BLOCK(i->sb) * BLOCKS_PER_IND_BLOCK(i->sb));
sb                265 fs/ext2/inode.c 			if((newblock = ext2_balloc(i->sb)) < 0) {
sb                271 fs/ext2/inode.c 				ext2_bfree(i->sb, newblock);
sb                302 fs/ext2/inode.c 		block = tindblock[tblock / BLOCKS_PER_IND_BLOCK(i->sb)];
sb                305 fs/ext2/inode.c 				if((newblock = ext2_balloc(i->sb)) < 0) {
sb                312 fs/ext2/inode.c 					ext2_bfree(i->sb, newblock);
sb                319 fs/ext2/inode.c 				tindblock[tblock / BLOCKS_PER_IND_BLOCK(i->sb)] = newblock;
sb                330 fs/ext2/inode.c 		iblock = tblock / BLOCKS_PER_IND_BLOCK(i->sb);
sb                347 fs/ext2/inode.c 	block = dindblock[dblock - (iblock * BLOCKS_PER_IND_BLOCK(i->sb))];
sb                349 fs/ext2/inode.c 		if((newblock = ext2_balloc(i->sb)) < 0) {
sb                359 fs/ext2/inode.c 			ext2_bfree(i->sb, newblock);
sb                369 fs/ext2/inode.c 		dindblock[dblock - (iblock * BLOCKS_PER_IND_BLOCK(i->sb))] = newblock;
sb                388 fs/ext2/inode.c 	blksize = i->sb->s_blocksize;
sb                398 fs/ext2/inode.c 				ext2_bfree(i->sb, i->u.ext2.i_data[n]);
sb                406 fs/ext2/inode.c 	if(!block || block < (BLOCKS_PER_IND_BLOCK(i->sb) + EXT2_NDIR_BLOCKS)) {
sb                413 fs/ext2/inode.c 				ext2_bfree(i->sb, i->u.ext2.i_data[EXT2_IND_BLOCK]);
sb                423 fs/ext2/inode.c 		block -= BLOCKS_PER_IND_BLOCK(i->sb);
sb                431 fs/ext2/inode.c 		dblock = block % BLOCKS_PER_IND_BLOCK(i->sb);
sb                432 fs/ext2/inode.c 		for(n = block / BLOCKS_PER_IND_BLOCK(i->sb); n < BLOCKS_PER_IND_BLOCK(i->sb); n++) {
sb                436 fs/ext2/inode.c 					ext2_bfree(i->sb, indblock[n]);
sb                444 fs/ext2/inode.c 			ext2_bfree(i->sb, i->u.ext2.i_data[EXT2_DIND_BLOCK]);
sb                 30 fs/ext2/namei.c 	blksize = dir->sb->s_blocksize;
sb                106 fs/ext2/namei.c 		if(!(buf = bread(dir->dev, block, dir->sb->s_blocksize))) {
sb                110 fs/ext2/namei.c 		dir->i_size += dir->sb->s_blocksize;
sb                111 fs/ext2/namei.c 		(*d_res)->rec_len = dir->sb->s_blocksize;
sb                125 fs/ext2/namei.c 	blksize = dir->sb->s_blocksize;
sb                197 fs/ext2/namei.c 	blksize = dir->sb->s_blocksize;
sb                235 fs/ext2/namei.c 				if(!(*i_res = iget(dir->sb, inode))) {
sb                381 fs/ext2/namei.c 	if(!(i = ialloc(dir->sb, S_IFLNK))) {
sb                401 fs/ext2/namei.c 		if((block = ext2_balloc(dir->sb)) < 0) {
sb                407 fs/ext2/namei.c 		if(!(buf2 = bread(dir->dev, block, dir->sb->s_blocksize))) {
sb                410 fs/ext2/namei.c 			ext2_bfree(dir->sb, block);
sb                423 fs/ext2/namei.c 		i->i_blocks = dir->sb->s_blocksize / 512;
sb                474 fs/ext2/namei.c 	if(!(i = ialloc(dir->sb, S_IFDIR))) {
sb                493 fs/ext2/namei.c 	if(!(buf2 = bread(i->dev, block, dir->sb->s_blocksize))) {
sb                494 fs/ext2/namei.c 		ext2_bfree(dir->sb, block);
sb                501 fs/ext2/namei.c 		ext2_bfree(dir->sb, block);
sb                536 fs/ext2/namei.c 	d2->rec_len = i->sb->s_blocksize - 12;
sb                539 fs/ext2/namei.c 	i->i_size = i->sb->s_blocksize;
sb                540 fs/ext2/namei.c 	i->i_blocks = dir->sb->s_blocksize / 512;
sb                565 fs/ext2/namei.c 	if(!(i = ialloc(dir->sb, mode & S_IFMT))) {
sb                642 fs/ext2/namei.c 	if(!(i = ialloc(dir->sb, S_IFREG))) {
sb                 61 fs/ext2/super.c static void check_superblock(struct ext2_super_block *sb)
sb                 63 fs/ext2/super.c 	if(!(sb->s_state & EXT2_VALID_FS)) {
sb                 65 fs/ext2/super.c 	} else if((sb->s_state & EXT2_ERROR_FS)) {
sb                 67 fs/ext2/super.c 	} else if(sb->s_max_mnt_count >= 0 && sb->s_mnt_count >= (unsigned short int)sb->s_max_mnt_count) {
sb                 69 fs/ext2/super.c 	} else if(sb->s_checkinterval && (sb->s_lastcheck + sb->s_checkinterval <= CURRENT_TIME)) {
sb                 74 fs/ext2/super.c void ext2_statfs(struct superblock *sb, struct statfs *statfsbuf)
sb                 77 fs/ext2/super.c 	statfsbuf->f_bsize = sb->s_blocksize;
sb                 78 fs/ext2/super.c 	statfsbuf->f_blocks = sb->u.ext2.sb.s_blocks_count;
sb                 79 fs/ext2/super.c 	statfsbuf->f_bfree = sb->u.ext2.sb.s_free_blocks_count;
sb                 80 fs/ext2/super.c 	if(statfsbuf->f_bfree >= sb->u.ext2.sb.s_r_blocks_count) {
sb                 81 fs/ext2/super.c 		statfsbuf->f_bavail = statfsbuf->f_bfree - sb->u.ext2.sb.s_r_blocks_count;
sb                 85 fs/ext2/super.c 	statfsbuf->f_files = sb->u.ext2.sb.s_inodes_count;
sb                 86 fs/ext2/super.c 	statfsbuf->f_ffree = sb->u.ext2.sb.s_free_inodes_count;
sb                 91 fs/ext2/super.c int ext2_read_superblock(__dev_t dev, struct superblock *sb)
sb                 96 fs/ext2/super.c 	superblock_lock(sb);
sb                 99 fs/ext2/super.c 		superblock_unlock(sb);
sb                106 fs/ext2/super.c 		superblock_unlock(sb);
sb                114 fs/ext2/super.c 		superblock_unlock(sb);
sb                119 fs/ext2/super.c 	sb->dev = dev;
sb                120 fs/ext2/super.c 	sb->fsop = &ext2_fsop;
sb                121 fs/ext2/super.c 	sb->s_blocksize = EXT2_MIN_BLOCK_SIZE << ext2sb->s_log_block_size;
sb                122 fs/ext2/super.c 	memcpy_b(&sb->u.ext2.sb, ext2sb, sizeof(struct ext2_super_block));
sb                123 fs/ext2/super.c 	EXT2_DESC_PER_BLOCK(sb) = sb->s_blocksize / sizeof(struct ext2_group_desc);
sb                124 fs/ext2/super.c 	sb->u.ext2.block_groups = 1 + (ext2sb->s_blocks_count - 1) / ext2sb->s_blocks_per_group;
sb                126 fs/ext2/super.c 	if(!(sb->root = iget(sb, EXT2_ROOT_INO))) {
sb                128 fs/ext2/super.c 		superblock_unlock(sb);
sb                134 fs/ext2/super.c 	if(!(sb->flags & MS_RDONLY)) {
sb                135 fs/ext2/super.c 		sb->u.ext2.sb.s_state &= ~EXT2_VALID_FS;
sb                136 fs/ext2/super.c 		sb->u.ext2.sb.s_mnt_count++;
sb                137 fs/ext2/super.c 		sb->u.ext2.sb.s_mtime = CURRENT_TIME;
sb                138 fs/ext2/super.c 		memcpy_b(buf->data, &sb->u.ext2.sb, sizeof(struct ext2_super_block));
sb                143 fs/ext2/super.c 	superblock_unlock(sb);
sb                147 fs/ext2/super.c int ext2_remount_fs(struct superblock *sb, int flags)
sb                152 fs/ext2/super.c 	if((flags & MS_RDONLY) == (sb->flags & MS_RDONLY)) {
sb                156 fs/ext2/super.c 	superblock_lock(sb);
sb                157 fs/ext2/super.c 	if(!(buf = bread(sb->dev, SUPERBLOCK, BLKSIZE_1K))) {
sb                158 fs/ext2/super.c 		superblock_unlock(sb);
sb                165 fs/ext2/super.c 		sb->u.ext2.sb.s_state |= EXT2_VALID_FS;
sb                170 fs/ext2/super.c 		memcpy_b(&sb->u.ext2.sb, ext2sb, sizeof(struct ext2_super_block));
sb                171 fs/ext2/super.c 		sb->u.ext2.sb.s_state &= ~EXT2_VALID_FS;
sb                172 fs/ext2/super.c 		sb->u.ext2.sb.s_mnt_count++;
sb                173 fs/ext2/super.c 		sb->u.ext2.sb.s_mtime = CURRENT_TIME;
sb                177 fs/ext2/super.c 	sb->dirty = 1;
sb                178 fs/ext2/super.c 	superblock_unlock(sb);
sb                183 fs/ext2/super.c int ext2_write_superblock(struct superblock *sb)
sb                187 fs/ext2/super.c 	superblock_lock(sb);
sb                188 fs/ext2/super.c 	if(!(buf = bread(sb->dev, SUPERBLOCK, BLKSIZE_1K))) {
sb                189 fs/ext2/super.c 		superblock_unlock(sb);
sb                193 fs/ext2/super.c 	memcpy_b(buf->data, &sb->u.ext2.sb, sizeof(struct ext2_super_block));
sb                194 fs/ext2/super.c 	sb->dirty = 0;
sb                195 fs/ext2/super.c 	superblock_unlock(sb);
sb                200 fs/ext2/super.c void ext2_release_superblock(struct superblock *sb)
sb                202 fs/ext2/super.c 	if(sb->flags & MS_RDONLY) {
sb                206 fs/ext2/super.c 	superblock_lock(sb);
sb                208 fs/ext2/super.c 	sb->u.ext2.sb.s_state |= EXT2_VALID_FS;
sb                209 fs/ext2/super.c 	sb->dirty = 1;
sb                211 fs/ext2/super.c 	superblock_unlock(sb);
sb                 71 fs/ext2/symlink.c 	blksize = i->sb->s_blocksize;
sb                115 fs/ext2/symlink.c 		if(!(buf = bread(i->dev, i->u.ext2.i_data[0], i->sb->s_blocksize))) {
sb                161 fs/inode.c     	i->sb = NULL;
sb                173 fs/inode.c     	if(i->sb && i->sb->fsop && i->sb->fsop->read_inode) {
sb                174 fs/inode.c     		errno = i->sb->fsop->read_inode(i);
sb                187 fs/inode.c     	if(i->sb && i->sb->fsop && i->sb->fsop->write_inode) {
sb                188 fs/inode.c     		errno = i->sb->fsop->write_inode(i);
sb                244 fs/inode.c     struct inode * ialloc(struct superblock *sb, int mode)
sb                250 fs/inode.c     		i->sb = sb;
sb                251 fs/inode.c     		i->rdev = sb->dev;
sb                252 fs/inode.c     		if(i->sb && i->sb->fsop && i->sb->fsop->ialloc) {
sb                253 fs/inode.c     			errno = i->sb->fsop->ialloc(i, mode);
sb                257 fs/inode.c     			i->sb = NULL;
sb                263 fs/inode.c     			i->sb = NULL;
sb                267 fs/inode.c     		i->dev = sb->dev;
sb                275 fs/inode.c     struct inode * iget(struct superblock *sb, __ino_t inode)
sb                285 fs/inode.c     		if((i = search_inode_hash(sb->dev, inode))) {
sb                307 fs/inode.c     		i->dev = i->rdev = sb->dev;
sb                309 fs/inode.c     		i->sb = sb;
sb                368 fs/inode.c     		if(i->sb && i->sb->fsop && i->sb->fsop->ifree) {
sb                370 fs/inode.c     			i->sb->fsop->ifree(i);
sb                 92 fs/iso9660/dir.c 	blksize = i->sb->s_blocksize;
sb                137 fs/iso9660/dir.c 							if(i->sb->u.iso9660.rrip) {
sb                 29 fs/iso9660/inode.c 	sbi = (struct iso9660_sb_info *)&i->sb->u.iso9660;
sb                 30 fs/iso9660/inode.c 	pt_len = isonum_733(sbi->sb->path_table_size);
sb                 31 fs/iso9660/inode.c 	pt_blk = isonum_731(sbi->sb->type_l_path_table);
sb                 69 fs/iso9660/inode.c static int get_parent_dir_size(struct superblock *sb, __blk_t extent)
sb                 75 fs/iso9660/inode.c 	for(n = 0; n < sb->u.iso9660.paths; n++) {
sb                 76 fs/iso9660/inode.c 		ptr = (struct iso9660_pathtable_record *)sb->u.iso9660.pathtable[n];
sb                 80 fs/iso9660/inode.c 			ptr = (struct iso9660_pathtable_record *)sb->u.iso9660.pathtable[parent];
sb                 93 fs/iso9660/inode.c 	struct superblock *sb;
sb                 99 fs/iso9660/inode.c 	sb = (struct superblock *)i->sb;
sb                100 fs/iso9660/inode.c 	if(!sb->u.iso9660.pathtable) {
sb                108 fs/iso9660/inode.c 	blksize = i->sb->s_blocksize;
sb                177 fs/iso9660/inode.c 	block = i->u.iso9660.i_extent + (offset / i->sb->s_blocksize);
sb                 31 fs/iso9660/namei.c 	blksize = dir->sb->s_blocksize;
sb                 67 fs/iso9660/namei.c 				if(dir->sb->u.iso9660.rrip) {
sb                106 fs/iso9660/namei.c 				if(!(*i_res = iget(dir->sb, inode))) {
sb                 46 fs/iso9660/rrip.c 		if(!(buf = bread(i->dev, ce_block, i->sb->s_blocksize))) {
sb                 79 fs/iso9660/rrip.c 				i->sb->u.iso9660.rrip = 1;
sb                176 fs/iso9660/rrip.c 		if(!(buf = bread(i->dev, ce_block, i->sb->s_blocksize))) {
sb                248 fs/iso9660/rrip.c 	if(!(buf = bread(i->dev, dblock, i->sb->s_blocksize))) {
sb                266 fs/iso9660/rrip.c 		if(!(buf2 = bread(i->dev, ce_block, i->sb->s_blocksize))) {
sb                138 fs/iso9660/super.c void iso9660_statfs(struct superblock *sb, struct statfs *statfsbuf)
sb                141 fs/iso9660/super.c 	statfsbuf->f_bsize = sb->s_blocksize;
sb                142 fs/iso9660/super.c 	statfsbuf->f_blocks = isonum_733(sb->u.iso9660.sb->volume_space_size);
sb                151 fs/iso9660/super.c int iso9660_read_superblock(__dev_t dev, struct superblock *sb)
sb                160 fs/iso9660/super.c 	superblock_lock(sb);
sb                165 fs/iso9660/super.c 			superblock_unlock(sb);
sb                181 fs/iso9660/super.c 		superblock_unlock(sb);
sb                189 fs/iso9660/super.c 	sb->dev = dev;
sb                190 fs/iso9660/super.c 	sb->fsop = &iso9660_fsop;
sb                191 fs/iso9660/super.c 	sb->flags = MS_RDONLY;
sb                192 fs/iso9660/super.c 	sb->s_blocksize = isonum_723(pvd->logical_block_size);
sb                193 fs/iso9660/super.c 	sb->u.iso9660.rrip = 0;
sb                194 fs/iso9660/super.c 	if(!(sb->u.iso9660.sb = (void *)kmalloc())) {
sb                195 fs/iso9660/super.c 		superblock_unlock(sb);
sb                199 fs/iso9660/super.c 	memcpy_b(sb->u.iso9660.sb, pvd, sizeof(struct iso9660_super_block));
sb                203 fs/iso9660/super.c 	if(!(sb->root = iget(sb, root_inode))) {
sb                205 fs/iso9660/super.c 		superblock_unlock(sb);
sb                208 fs/iso9660/super.c 	sb->u.iso9660.s_root_inode = root_inode;
sb                210 fs/iso9660/super.c 	superblock_unlock(sb);
sb                214 fs/iso9660/super.c void iso9660_release_superblock(struct superblock *sb)
sb                216 fs/iso9660/super.c 	kfree((unsigned int)sb->u.iso9660.sb);
sb                217 fs/iso9660/super.c 	kfree((unsigned int)sb->u.iso9660.pathtable);
sb                218 fs/iso9660/super.c 	kfree((unsigned int)sb->u.iso9660.pathtable_raw);
sb                 20 fs/minix/bitmaps.c static int count_bits(struct superblock *sb, __blk_t offset, int num, int blocks, int mode)
sb                 28 fs/minix/bitmaps.c 	blksize = sb->s_blocksize;
sb                 31 fs/minix/bitmaps.c 		if(!(buf = bread(sb->dev, offset, blksize))) {
sb                 59 fs/minix/bitmaps.c int minix_change_bit(int mode, struct superblock *sb, int map, int item)
sb                 64 fs/minix/bitmaps.c 	map += item / (sb->s_blocksize * 8);
sb                 65 fs/minix/bitmaps.c 	byte = (item % (sb->s_blocksize * 8)) / 8;
sb                 66 fs/minix/bitmaps.c 	bit = (item % (sb->s_blocksize * 8)) % 8;
sb                 69 fs/minix/bitmaps.c 	if(!(buf = bread(sb->dev, map, sb->s_blocksize))) {
sb                 92 fs/minix/bitmaps.c int minix_balloc(struct superblock *sb)
sb                 96 fs/minix/bitmaps.c 	superblock_lock(sb);
sb                 98 fs/minix/bitmaps.c 	map = 1 + SUPERBLOCK + sb->u.minix.sb.s_imap_blocks;
sb                100 fs/minix/bitmaps.c 	if(!(block = minix_find_first_zero(sb, map, sb->u.minix.nzones, map + sb->u.minix.sb.s_zmap_blocks))) {
sb                101 fs/minix/bitmaps.c 		superblock_unlock(sb);
sb                105 fs/minix/bitmaps.c 	errno = minix_change_bit(SET_BIT, sb, map, block);
sb                106 fs/minix/bitmaps.c 	block += sb->u.minix.sb.s_firstdatazone - 1;
sb                111 fs/minix/bitmaps.c 			superblock_unlock(sb);
sb                118 fs/minix/bitmaps.c 	superblock_unlock(sb);
sb                122 fs/minix/bitmaps.c void minix_bfree(struct superblock *sb, int block)
sb                126 fs/minix/bitmaps.c 	if(block < sb->u.minix.sb.s_firstdatazone || block > sb->u.minix.nzones) {
sb                131 fs/minix/bitmaps.c 	superblock_lock(sb);
sb                133 fs/minix/bitmaps.c 	map = 1 + SUPERBLOCK + sb->u.minix.sb.s_imap_blocks;
sb                134 fs/minix/bitmaps.c 	block -= sb->u.minix.sb.s_firstdatazone - 1;
sb                135 fs/minix/bitmaps.c 	errno = minix_change_bit(CLEAR_BIT, sb, map, block);
sb                145 fs/minix/bitmaps.c 	superblock_unlock(sb);
sb                149 fs/minix/bitmaps.c int minix_count_free_inodes(struct superblock *sb)
sb                154 fs/minix/bitmaps.c 	return count_bits(sb, offset, sb->u.minix.sb.s_ninodes, offset + sb->u.minix.sb.s_imap_blocks, COUNT);
sb                157 fs/minix/bitmaps.c int minix_count_free_blocks(struct superblock *sb)
sb                161 fs/minix/bitmaps.c 	offset = 1 + SUPERBLOCK + sb->u.minix.sb.s_imap_blocks;
sb                162 fs/minix/bitmaps.c 	return count_bits(sb, offset, sb->u.minix.nzones, offset + sb->u.minix.sb.s_zmap_blocks, COUNT);
sb                165 fs/minix/bitmaps.c int minix_find_first_zero(struct superblock *sb, __blk_t offset, int num, int blocks)
sb                167 fs/minix/bitmaps.c 	return count_bits(sb, offset, num, blocks, FIRST_ZERO);
sb                 96 fs/minix/dir.c 	blksize = i->sb->s_blocksize;
sb                134 fs/minix/dir.c 				doffset += i->sb->u.minix.dirsize;
sb                135 fs/minix/dir.c 				offset += i->sb->u.minix.dirsize;
sb                 91 fs/minix/file.c 	blksize = i->sb->s_blocksize;
sb                 25 fs/minix/inode.c 	if(i->sb->u.minix.version == 1) {
sb                 34 fs/minix/inode.c 	if(i->sb->u.minix.version == 1) {
sb                 43 fs/minix/inode.c 	if(i->sb->u.minix.version == 1) {
sb                 52 fs/minix/inode.c 	if(i->sb->u.minix.version == 1) {
sb                 61 fs/minix/inode.c 	if(i->sb->u.minix.version == 1) {
sb                 70 fs/minix/inode.c 	if(i->sb->u.minix.version == 1) {
sb                 27 fs/minix/namei.c 	blksize = dir->sb->s_blocksize;
sb                 28 fs/minix/namei.c 	doffset = dir->sb->u.minix.dirsize * 2;	/* accept only "." and ".." */
sb                 48 fs/minix/namei.c 				doffset += dir->sb->u.minix.dirsize;
sb                 69 fs/minix/namei.c 	blksize = dir->sb->s_blocksize;
sb                 88 fs/minix/namei.c 							dir->i_size += dir->sb->u.minix.dirsize;
sb                104 fs/minix/namei.c 				doffset += dir->sb->u.minix.dirsize;
sb                126 fs/minix/namei.c 		if(!(buf = bread(dir->dev, block, dir->sb->s_blocksize))) {
sb                130 fs/minix/namei.c 		dir->i_size += dir->sb->u.minix.dirsize;
sb                169 fs/minix/namei.c 	blksize = dir->sb->s_blocksize;
sb                192 fs/minix/namei.c 				doffset += dir->sb->u.minix.dirsize;
sb                197 fs/minix/namei.c 				if(!(*i_res = iget(dir->sb, inode))) {
sb                267 fs/minix/namei.c 	for(n = 0; n < i_old->sb->u.minix.namelen; n++) {
sb                273 fs/minix/namei.c 	for(; n < i_old->sb->u.minix.namelen; n++) {
sb                334 fs/minix/namei.c 	if(!(i = ialloc(dir->sb, S_IFLNK))) {
sb                348 fs/minix/namei.c 	block = minix_balloc(dir->sb);
sb                356 fs/minix/namei.c 	if(i->sb->u.minix.version == 1) {
sb                361 fs/minix/namei.c 	blksize = dir->sb->s_blocksize;
sb                363 fs/minix/namei.c 		minix_bfree(dir->sb, block);
sb                371 fs/minix/namei.c 		minix_bfree(dir->sb, block);
sb                379 fs/minix/namei.c 	for(n = 0; n < i->sb->u.minix.namelen; n++) {
sb                385 fs/minix/namei.c 	for(; n < i->sb->u.minix.namelen; n++) {
sb                418 fs/minix/namei.c 	if(strlen(name) > dir->sb->u.minix.namelen) {
sb                424 fs/minix/namei.c 	if(!(i = ialloc(dir->sb, S_IFDIR))) {
sb                446 fs/minix/namei.c 	blksize = dir->sb->s_blocksize;
sb                448 fs/minix/namei.c 		minix_bfree(dir->sb, block);
sb                456 fs/minix/namei.c 		minix_bfree(dir->sb, block);
sb                464 fs/minix/namei.c 	for(n = 0; n < i->sb->u.minix.namelen; n++) {
sb                470 fs/minix/namei.c 	for(; n < i->sb->u.minix.namelen; n++) {
sb                478 fs/minix/namei.c 	i->i_size += i->sb->u.minix.dirsize;
sb                480 fs/minix/namei.c 	d_new = (struct minix_dir_entry *)(buf_new->data + i->sb->u.minix.dirsize);
sb                485 fs/minix/namei.c 	i->i_size += i->sb->u.minix.dirsize;
sb                508 fs/minix/namei.c 	if(!(i = ialloc(dir->sb, mode & S_IFMT))) {
sb                521 fs/minix/namei.c 	for(n = 0; n < i->sb->u.minix.namelen; n++) {
sb                527 fs/minix/namei.c 	for(; n < i->sb->u.minix.namelen; n++) {
sb                581 fs/minix/namei.c 	if(!(i = ialloc(dir->sb, S_IFREG))) {
sb                594 fs/minix/namei.c 	for(n = 0; n < i->sb->u.minix.namelen; n++) {
sb                600 fs/minix/namei.c 	for(; n < i->sb->u.minix.namelen; n++) {
sb                 61 fs/minix/super.c static void check_superblock(struct minix_super_block *sb)
sb                 63 fs/minix/super.c 	if(!(sb->s_state & MINIX_VALID_FS)) {
sb                 66 fs/minix/super.c 	if(sb->s_state & MINIX_ERROR_FS) {
sb                 71 fs/minix/super.c void minix_statfs(struct superblock *sb, struct statfs *statfsbuf)
sb                 73 fs/minix/super.c 	statfsbuf->f_type = sb->u.minix.sb.s_magic;
sb                 74 fs/minix/super.c 	statfsbuf->f_bsize = sb->s_blocksize;
sb                 75 fs/minix/super.c 	statfsbuf->f_blocks = sb->u.minix.nzones << sb->u.minix.sb.s_log_zone_size;
sb                 76 fs/minix/super.c 	statfsbuf->f_bfree = sb->u.minix.nzones - minix_count_free_blocks(sb);
sb                 79 fs/minix/super.c 	statfsbuf->f_files = sb->u.minix.sb.s_ninodes;
sb                 80 fs/minix/super.c 	statfsbuf->f_ffree = sb->u.minix.sb.s_ninodes - minix_count_free_inodes(sb);
sb                 82 fs/minix/super.c 	statfsbuf->f_namelen = sb->u.minix.namelen;
sb                 85 fs/minix/super.c int minix_read_superblock(__dev_t dev, struct superblock *sb)
sb                 90 fs/minix/super.c 	superblock_lock(sb);
sb                 93 fs/minix/super.c 		superblock_unlock(sb);
sb                 96 fs/minix/super.c 	memcpy_b(&sb->u.minix.sb, buf->data, sizeof(struct minix_super_block));
sb                 98 fs/minix/super.c 	switch(sb->u.minix.sb.s_magic) {
sb                100 fs/minix/super.c 			sb->u.minix.namelen = 14;
sb                101 fs/minix/super.c 			sb->u.minix.dirsize = sizeof(__u16) + sb->u.minix.namelen;
sb                102 fs/minix/super.c 			sb->u.minix.version = 1;
sb                103 fs/minix/super.c 			sb->u.minix.nzones = sb->u.minix.sb.s_nzones;
sb                107 fs/minix/super.c 			sb->u.minix.namelen = 30;
sb                108 fs/minix/super.c 			sb->u.minix.dirsize = sizeof(__u16) + sb->u.minix.namelen;
sb                109 fs/minix/super.c 			sb->u.minix.version = 1;
sb                110 fs/minix/super.c 			sb->u.minix.nzones = sb->u.minix.sb.s_nzones;
sb                114 fs/minix/super.c 			sb->u.minix.namelen = 14;
sb                115 fs/minix/super.c 			sb->u.minix.dirsize = sizeof(__u16) + sb->u.minix.namelen;
sb                116 fs/minix/super.c 			sb->u.minix.version = 2;
sb                117 fs/minix/super.c 			sb->u.minix.nzones = sb->u.minix.sb.s_zones;
sb                121 fs/minix/super.c 			sb->u.minix.namelen = 30;
sb                122 fs/minix/super.c 			sb->u.minix.dirsize = sizeof(__u16) + sb->u.minix.namelen;
sb                123 fs/minix/super.c 			sb->u.minix.version = 2;
sb                124 fs/minix/super.c 			sb->u.minix.nzones = sb->u.minix.sb.s_zones;
sb                129 fs/minix/super.c 			superblock_unlock(sb);
sb                134 fs/minix/super.c 	sb->dev = dev;
sb                135 fs/minix/super.c 	sb->fsop = &minix_fsop;
sb                136 fs/minix/super.c 	sb->s_blocksize = BLKSIZE_1K << sb->u.minix.sb.s_log_zone_size;
sb                138 fs/minix/super.c 	if(sb->s_blocksize != BLKSIZE_1K) {
sb                140 fs/minix/super.c 		superblock_unlock(sb);
sb                159 fs/minix/super.c 	if(sb->u.minix.version == 1) {
sb                162 fs/minix/super.c 	if(sb->u.minix.version == 2) {
sb                166 fs/minix/super.c 	if(sb->u.minix.sb.s_imap_blocks > maps) {
sb                167 fs/minix/super.c 		printk("ERROR: %s(): number of imap blocks (%d) is greater than %d!\n", __FUNCTION__, sb->u.minix.sb.s_imap_blocks, maps);
sb                168 fs/minix/super.c 		superblock_unlock(sb);
sb                172 fs/minix/super.c 	if(sb->u.minix.sb.s_zmap_blocks > maps) {
sb                173 fs/minix/super.c 		printk("ERROR: %s(): number of zmap blocks (%d) is greater than %d!\n", __FUNCTION__, sb->u.minix.sb.s_zmap_blocks, maps);
sb                174 fs/minix/super.c 		superblock_unlock(sb);
sb                179 fs/minix/super.c 	superblock_unlock(sb);
sb                181 fs/minix/super.c 	if(!(sb->root = iget(sb, MINIX_ROOT_INO))) {
sb                187 fs/minix/super.c 	check_superblock(&sb->u.minix.sb);
sb                189 fs/minix/super.c 	if(!(sb->flags & MS_RDONLY)) {
sb                190 fs/minix/super.c 		sb->u.minix.sb.s_state &= ~MINIX_VALID_FS;
sb                191 fs/minix/super.c 		memcpy_b(buf->data, &sb->u.minix.sb, sizeof(struct minix_super_block));
sb                200 fs/minix/super.c int minix_remount_fs(struct superblock *sb, int flags)
sb                205 fs/minix/super.c 	if((flags & MS_RDONLY) == (sb->flags & MS_RDONLY)) {
sb                209 fs/minix/super.c 	superblock_lock(sb);
sb                210 fs/minix/super.c 	if(!(buf = bread(sb->dev, SUPERBLOCK, BLKSIZE_1K))) {
sb                211 fs/minix/super.c 		superblock_unlock(sb);
sb                218 fs/minix/super.c 		sb->u.minix.sb.s_state |= MINIX_VALID_FS;
sb                223 fs/minix/super.c 		memcpy_b(&sb->u.minix.sb, minixsb, sizeof(struct minix_super_block));
sb                224 fs/minix/super.c 		sb->u.minix.sb.s_state &= ~MINIX_VALID_FS;
sb                228 fs/minix/super.c 	sb->dirty = 1;
sb                229 fs/minix/super.c 	superblock_unlock(sb);
sb                234 fs/minix/super.c int minix_write_superblock(struct superblock *sb)
sb                238 fs/minix/super.c 	superblock_lock(sb);
sb                239 fs/minix/super.c 	if(!(buf = bread(sb->dev, SUPERBLOCK, BLKSIZE_1K))) {
sb                240 fs/minix/super.c 		superblock_unlock(sb);
sb                244 fs/minix/super.c 	memcpy_b(buf->data, &sb->u.minix.sb, sizeof(struct minix_super_block));
sb                245 fs/minix/super.c 	sb->dirty = 0;
sb                246 fs/minix/super.c 	superblock_unlock(sb);
sb                251 fs/minix/super.c void minix_release_superblock(struct superblock *sb)
sb                253 fs/minix/super.c 	if(sb->flags & MS_RDONLY) {
sb                257 fs/minix/super.c 	superblock_lock(sb);
sb                259 fs/minix/super.c 	sb->u.minix.sb.s_state |= MINIX_VALID_FS;
sb                260 fs/minix/super.c 	sb->dirty = 1;
sb                262 fs/minix/super.c 	superblock_unlock(sb);
sb                 70 fs/minix/symlink.c 	blksize = i->sb->s_blocksize;
sb                 77 fs/minix/symlink.c 	if(i->sb->u.minix.version == 1) {
sb                116 fs/minix/symlink.c 	if(i->sb->u.minix.version == 1) {
sb                117 fs/minix/symlink.c 		if(!(buf = bread(i->dev, i->u.minix.u.i1_zone[0], i->sb->s_blocksize))) {
sb                122 fs/minix/symlink.c 		if(!(buf = bread(i->dev, i->u.minix.u.i2_zone[0], i->sb->s_blocksize))) {
sb                 23 fs/minix/v1_inode.c #define BLOCKS_PER_IND_BLOCK(sb)	(sb->s_blocksize / sizeof(__u16))
sb                 24 fs/minix/v1_inode.c #define MINIX_INODES_PER_BLOCK(sb)	(sb->s_blocksize / sizeof(struct minix_inode))
sb                 36 fs/minix/v1_inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                 41 fs/minix/v1_inode.c 	for(n = offset; n < BLOCKS_PER_IND_BLOCK(i->sb); n++) {
sb                 43 fs/minix/v1_inode.c 			minix_bfree(i->sb, zone[n]);
sb                 58 fs/minix/v1_inode.c 	block = 1 + SUPERBLOCK + i->sb->u.minix.sb.s_imap_blocks + i->sb->u.minix.sb.s_zmap_blocks + (i->inode - 1) / MINIX_INODES_PER_BLOCK(i->sb);
sb                 60 fs/minix/v1_inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                 63 fs/minix/v1_inode.c 	offset = (i->inode - 1) % MINIX_INODES_PER_BLOCK(i->sb);
sb                121 fs/minix/v1_inode.c 	block = 1 + SUPERBLOCK + i->sb->u.minix.sb.s_imap_blocks + i->sb->u.minix.sb.s_zmap_blocks + (i->inode - 1) / MINIX_INODES_PER_BLOCK(i->sb);
sb                123 fs/minix/v1_inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                126 fs/minix/v1_inode.c 	offset = (i->inode - 1) % MINIX_INODES_PER_BLOCK(i->sb);
sb                149 fs/minix/v1_inode.c 	struct superblock *sb;
sb                151 fs/minix/v1_inode.c 	sb = i->sb;
sb                152 fs/minix/v1_inode.c 	superblock_lock(sb);
sb                156 fs/minix/v1_inode.c 	if(!(inode = minix_find_first_zero(sb, offset, sb->u.minix.sb.s_ninodes, offset + sb->u.minix.sb.s_imap_blocks))) {
sb                157 fs/minix/v1_inode.c 		superblock_unlock(sb);
sb                161 fs/minix/v1_inode.c 	errno = minix_change_bit(SET_BIT, sb, offset, inode);
sb                166 fs/minix/v1_inode.c 			superblock_unlock(sb);
sb                177 fs/minix/v1_inode.c 	superblock_unlock(sb);
sb                184 fs/minix/v1_inode.c 	struct superblock *sb;
sb                188 fs/minix/v1_inode.c 	sb = i->sb;
sb                189 fs/minix/v1_inode.c 	superblock_lock(sb);
sb                191 fs/minix/v1_inode.c 	errno = minix_change_bit(CLEAR_BIT, i->sb, 1 + SUPERBLOCK, i->inode);
sb                205 fs/minix/v1_inode.c 	superblock_unlock(sb);
sb                216 fs/minix/v1_inode.c 	blksize = i->sb->s_blocksize;
sb                223 fs/minix/v1_inode.c 		if(block < (BLOCKS_PER_IND_BLOCK(i->sb) + MINIX_NDIR_BLOCKS)) {
sb                233 fs/minix/v1_inode.c 			if((newblock = minix_balloc(i->sb)) < 0) {
sb                238 fs/minix/v1_inode.c 				minix_bfree(i->sb, newblock);
sb                250 fs/minix/v1_inode.c 			if((newblock = minix_balloc(i->sb)) < 0) {
sb                255 fs/minix/v1_inode.c 				minix_bfree(i->sb, newblock);
sb                269 fs/minix/v1_inode.c 	dblock = block - BLOCKS_PER_IND_BLOCK(i->sb);
sb                272 fs/minix/v1_inode.c 		block = dblock / BLOCKS_PER_IND_BLOCK(i->sb);
sb                277 fs/minix/v1_inode.c 			if((newblock = minix_balloc(i->sb)) < 0) {
sb                283 fs/minix/v1_inode.c 				minix_bfree(i->sb, newblock);
sb                313 fs/minix/v1_inode.c 	block = dindblock[dblock - (iblock * BLOCKS_PER_IND_BLOCK(i->sb))];
sb                315 fs/minix/v1_inode.c 		if((newblock = minix_balloc(i->sb)) < 0) {
sb                322 fs/minix/v1_inode.c 			minix_bfree(i->sb, newblock);
sb                329 fs/minix/v1_inode.c 		dindblock[dblock - (iblock * BLOCKS_PER_IND_BLOCK(i->sb))] = newblock;
sb                345 fs/minix/v1_inode.c 	block = length / i->sb->s_blocksize;
sb                354 fs/minix/v1_inode.c 				minix_bfree(i->sb, i->u.minix.u.i1_zone[n]);
sb                361 fs/minix/v1_inode.c 	if(!block || block < (BLOCKS_PER_IND_BLOCK(i->sb) + MINIX_NDIR_BLOCKS)) {
sb                368 fs/minix/v1_inode.c 				minix_bfree(i->sb, i->u.minix.u.i1_zone[MINIX_IND_BLOCK]);
sb                377 fs/minix/v1_inode.c 		block -= BLOCKS_PER_IND_BLOCK(i->sb);
sb                380 fs/minix/v1_inode.c 		if(!(buf = bread(i->dev, i->u.minix.u.i1_zone[MINIX_DIND_BLOCK], i->sb->s_blocksize))) {
sb                384 fs/minix/v1_inode.c 		dblock = block % BLOCKS_PER_IND_BLOCK(i->sb);
sb                385 fs/minix/v1_inode.c 		for(n = block / BLOCKS_PER_IND_BLOCK(i->sb); n < BLOCKS_PER_IND_BLOCK(i->sb); n++) {
sb                389 fs/minix/v1_inode.c 					minix_bfree(i->sb, zone[n]);
sb                396 fs/minix/v1_inode.c 			minix_bfree(i->sb, i->u.minix.u.i1_zone[MINIX_DIND_BLOCK]);
sb                 23 fs/minix/v2_inode.c #define BLOCKS_PER_IND_BLOCK(sb)	(sb->s_blocksize / sizeof(__u32))
sb                 24 fs/minix/v2_inode.c #define MINIX2_INODES_PER_BLOCK(sb)	(sb->s_blocksize / sizeof(struct minix2_inode))
sb                 37 fs/minix/v2_inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                 42 fs/minix/v2_inode.c 	for(n = offset; n < BLOCKS_PER_IND_BLOCK(i->sb); n++) {
sb                 44 fs/minix/v2_inode.c 			minix_bfree(i->sb, zone[n]);
sb                 59 fs/minix/v2_inode.c 	block = 1 + SUPERBLOCK + i->sb->u.minix.sb.s_imap_blocks + i->sb->u.minix.sb.s_zmap_blocks + (i->inode - 1) / MINIX2_INODES_PER_BLOCK(i->sb);
sb                 61 fs/minix/v2_inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                 64 fs/minix/v2_inode.c 	offset = (i->inode - 1) % MINIX2_INODES_PER_BLOCK(i->sb);
sb                122 fs/minix/v2_inode.c 	block = 1 + SUPERBLOCK + i->sb->u.minix.sb.s_imap_blocks + i->sb->u.minix.sb.s_zmap_blocks + (i->inode - 1) / MINIX2_INODES_PER_BLOCK(i->sb);
sb                124 fs/minix/v2_inode.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                127 fs/minix/v2_inode.c 	offset = (i->inode - 1) % MINIX2_INODES_PER_BLOCK(i->sb);
sb                152 fs/minix/v2_inode.c 	struct superblock *sb;
sb                154 fs/minix/v2_inode.c 	sb = i->sb;
sb                155 fs/minix/v2_inode.c 	superblock_lock(sb);
sb                159 fs/minix/v2_inode.c 	if(!(inode = minix_find_first_zero(sb, offset, sb->u.minix.sb.s_ninodes, offset + sb->u.minix.sb.s_imap_blocks))) {
sb                160 fs/minix/v2_inode.c 		superblock_unlock(sb);
sb                164 fs/minix/v2_inode.c 	errno = minix_change_bit(SET_BIT, sb, offset, inode);
sb                169 fs/minix/v2_inode.c 			superblock_unlock(sb);
sb                180 fs/minix/v2_inode.c 	superblock_unlock(sb);
sb                187 fs/minix/v2_inode.c 	struct superblock *sb;
sb                191 fs/minix/v2_inode.c 	sb = i->sb;
sb                192 fs/minix/v2_inode.c 	superblock_lock(sb);
sb                194 fs/minix/v2_inode.c 	errno = minix_change_bit(CLEAR_BIT, i->sb, 1 + SUPERBLOCK, i->inode);
sb                208 fs/minix/v2_inode.c 	superblock_unlock(sb);
sb                219 fs/minix/v2_inode.c 	blksize = i->sb->s_blocksize;
sb                227 fs/minix/v2_inode.c 		if(block < (BLOCKS_PER_IND_BLOCK(i->sb) + MINIX_NDIR_BLOCKS)) {
sb                229 fs/minix/v2_inode.c 		} else if(block < ((BLOCKS_PER_IND_BLOCK(i->sb) * BLOCKS_PER_IND_BLOCK(i->sb)) + BLOCKS_PER_IND_BLOCK(i->sb) + MINIX_NDIR_BLOCKS)) {
sb                239 fs/minix/v2_inode.c 			if((newblock = minix_balloc(i->sb)) < 0) {
sb                244 fs/minix/v2_inode.c 				minix_bfree(i->sb, newblock);
sb                256 fs/minix/v2_inode.c 			if((newblock = minix_balloc(i->sb)) < 0) {
sb                261 fs/minix/v2_inode.c 				minix_bfree(i->sb, newblock);
sb                275 fs/minix/v2_inode.c 	dblock = block - BLOCKS_PER_IND_BLOCK(i->sb);
sb                276 fs/minix/v2_inode.c 	tblock = block - (BLOCKS_PER_IND_BLOCK(i->sb) * BLOCKS_PER_IND_BLOCK(i->sb)) - BLOCKS_PER_IND_BLOCK(i->sb);
sb                279 fs/minix/v2_inode.c 		block = dblock / BLOCKS_PER_IND_BLOCK(i->sb);
sb                282 fs/minix/v2_inode.c 		block = tblock / (BLOCKS_PER_IND_BLOCK(i->sb) * BLOCKS_PER_IND_BLOCK(i->sb));
sb                287 fs/minix/v2_inode.c 			if((newblock = minix_balloc(i->sb)) < 0) {
sb                293 fs/minix/v2_inode.c 				minix_bfree(i->sb, newblock);
sb                323 fs/minix/v2_inode.c 		block = tindblock[tblock / BLOCKS_PER_IND_BLOCK(i->sb)];
sb                326 fs/minix/v2_inode.c 				if((newblock = minix_balloc(i->sb)) < 0) {
sb                333 fs/minix/v2_inode.c 					minix_bfree(i->sb, newblock);
sb                340 fs/minix/v2_inode.c 				tindblock[tblock / BLOCKS_PER_IND_BLOCK(i->sb)] = newblock;
sb                350 fs/minix/v2_inode.c 		iblock = tblock / BLOCKS_PER_IND_BLOCK(i->sb);
sb                367 fs/minix/v2_inode.c 	block = dindblock[dblock - (iblock * BLOCKS_PER_IND_BLOCK(i->sb))];
sb                369 fs/minix/v2_inode.c 		if((newblock = minix_balloc(i->sb)) < 0) {
sb                379 fs/minix/v2_inode.c 			minix_bfree(i->sb, newblock);
sb                389 fs/minix/v2_inode.c 		dindblock[dblock - (iblock * BLOCKS_PER_IND_BLOCK(i->sb))] = newblock;
sb                408 fs/minix/v2_inode.c 	block = length / i->sb->s_blocksize;
sb                417 fs/minix/v2_inode.c 				minix_bfree(i->sb, i->u.minix.u.i2_zone[n]);
sb                424 fs/minix/v2_inode.c 	if(!block || block < (BLOCKS_PER_IND_BLOCK(i->sb) + MINIX_NDIR_BLOCKS)) {
sb                431 fs/minix/v2_inode.c 				minix_bfree(i->sb, i->u.minix.u.i2_zone[MINIX_IND_BLOCK]);
sb                440 fs/minix/v2_inode.c 		block -= BLOCKS_PER_IND_BLOCK(i->sb);
sb                443 fs/minix/v2_inode.c 		if(!(buf = bread(i->dev, i->u.minix.u.i2_zone[MINIX_DIND_BLOCK], i->sb->s_blocksize))) {
sb                447 fs/minix/v2_inode.c 		dblock = block % BLOCKS_PER_IND_BLOCK(i->sb);
sb                448 fs/minix/v2_inode.c 		for(n = block / BLOCKS_PER_IND_BLOCK(i->sb); n < BLOCKS_PER_IND_BLOCK(i->sb); n++) {
sb                452 fs/minix/v2_inode.c 					minix_bfree(i->sb, zone[n]);
sb                459 fs/minix/v2_inode.c 			minix_bfree(i->sb, i->u.minix.u.i2_zone[MINIX_DIND_BLOCK]);
sb                 32 fs/namei.c     	struct superblock *sb;
sb                 63 fs/namei.c     			if(dir == dir->sb->root) {
sb                 64 fs/namei.c     				sb = dir->sb;
sb                 66 fs/namei.c     				dir = sb->dir;
sb                 63 fs/pipefs/super.c int pipefs_read_superblock(__dev_t dev, struct superblock *sb)
sb                 65 fs/pipefs/super.c 	superblock_lock(sb);
sb                 66 fs/pipefs/super.c 	sb->dev = dev;
sb                 67 fs/pipefs/super.c 	sb->fsop = &pipefs_fsop;
sb                 68 fs/pipefs/super.c 	sb->s_blocksize = BLKSIZE_1K;
sb                 70 fs/pipefs/super.c 	superblock_unlock(sb);
sb                 76 fs/pipefs/super.c 	struct superblock *sb = i->sb;
sb                 78 fs/pipefs/super.c 	superblock_lock(sb);
sb                 80 fs/pipefs/super.c 	superblock_unlock(sb);
sb                 83 fs/pipefs/super.c 	i->dev = i->rdev = sb->dev;
sb                258 fs/procfs/data.c 				if(mount_table[n].sb.flags & MS_RDONLY) {
sb                607 fs/procfs/data.c 				if(mount_table[n].sb.flags & MS_RDONLY) {
sb                 93 fs/procfs/file.c 	blksize = i->sb->s_blocksize;
sb                 77 fs/procfs/inode.c void procfs_statfs(struct superblock *sb, struct statfs *statfsbuf)
sb                 80 fs/procfs/inode.c 	statfsbuf->f_bsize = sb->s_blocksize;
sb                 61 fs/procfs/namei.c 			if(!(*i_res = iget(dir->sb, inode))) {
sb                 77 fs/procfs/namei.c 			if(!(*i_res = iget(dir->sb, inode))) {
sb                 61 fs/procfs/super.c int procfs_read_superblock(__dev_t dev, struct superblock *sb)
sb                 63 fs/procfs/super.c 	superblock_lock(sb);
sb                 64 fs/procfs/super.c 	sb->dev = dev;
sb                 65 fs/procfs/super.c 	sb->fsop = &procfs_fsop;
sb                 66 fs/procfs/super.c 	sb->s_blocksize = PAGE_SIZE;
sb                 68 fs/procfs/super.c 	if(!(sb->root = iget(sb, PROC_ROOT_INO))) {
sb                 70 fs/procfs/super.c 		superblock_unlock(sb);
sb                 73 fs/procfs/super.c 	sb->root->u.procfs.i_lev = 0;
sb                 75 fs/procfs/super.c 	superblock_unlock(sb);
sb                 23 fs/super.c     void superblock_lock(struct superblock *sb)
sb                 29 fs/super.c     		if(sb->locked) {
sb                 30 fs/super.c     			sb->wanted = 1;
sb                 37 fs/super.c     	sb->locked = 1;
sb                 41 fs/super.c     void superblock_unlock(struct superblock *sb)
sb                 46 fs/super.c     	sb->locked = 0;
sb                 47 fs/super.c     	if(sb->wanted) {
sb                 48 fs/super.c     		sb->wanted = 0;
sb                103 fs/super.c     				if(mount_table[n].sb.root == i_target) {
sb                123 fs/super.c     			return &mount_table[n].sb;
sb                131 fs/super.c     	struct superblock *sb;
sb                137 fs/super.c     			sb = &mount_table[n].sb;
sb                138 fs/super.c     			if(sb->dirty && !(sb->flags & MS_RDONLY)) {
sb                139 fs/super.c     				if(sb->fsop && sb->fsop->write_superblock) {
sb                140 fs/super.c     					errno = sb->fsop->write_superblock(sb);
sb                142 fs/super.c     						printk("WARNING: %s(): I/O error on device %d,%d while syncing superblock.\n", __FUNCTION__, MAJOR(sb->dev), MINOR(sb->dev));
sb                160 fs/super.c     	if(fs->fsop->read_superblock(dev, &mt->sb)) {
sb                168 fs/super.c     	mt->sb.dir = NULL;
sb                198 fs/super.c     	mt->sb.flags = MS_RDONLY;
sb                200 fs/super.c     		if(fs->fsop->read_superblock(_rootdev, &mt->sb)) {
sb                208 fs/super.c     	mt->sb.root->mount_point = mt->sb.root;
sb                209 fs/super.c     	mt->sb.root->count++;
sb                210 fs/super.c     	mt->sb.dir = mt->sb.root;
sb                211 fs/super.c     	mt->sb.dir->count++;
sb                214 fs/super.c     	current->root = mt->sb.root;
sb                216 fs/super.c     	current->pwd = mt->sb.root;
sb                218 fs/super.c     	iput(mt->sb.root);
sb                 31 include/fiwix/filesystems.h 	struct superblock sb;		/* superblock */
sb                 55 include/fiwix/fs.h #define IS_RDONLY_FS(inode) (((inode)->sb) && ((inode)->sb->flags & MS_RDONLY))
sb                 93 include/fiwix/fs.h 	struct superblock *sb;
sb                 47 include/fiwix/fs_ext2.h #define EXT2_BLOCKS_PER_GROUP(s)	((s)->u.ext2.sb.s_blocks_per_group)
sb                 48 include/fiwix/fs_ext2.h #define EXT2_INODES_PER_GROUP(s)	((s)->u.ext2.sb.s_inodes_per_group)
sb                242 include/fiwix/fs_ext2.h 	struct ext2_super_block sb;
sb                213 include/fiwix/fs_iso9660.h 	struct iso9660_super_block *sb;
sb                106 include/fiwix/fs_minix.h 	struct minix_super_block sb;
sb                293 kernel/syscalls/execve.c 	if(!(buf = bread(i->dev, block, i->sb->s_blocksize))) {
sb                305 kernel/syscalls/execve.c 	memcpy_b(data, buf->data, i->sb->s_blocksize);
sb                 31 kernel/syscalls/fstatfs.c 	if(i->sb && i->sb->fsop && i->sb->fsop->statfs) {
sb                 32 kernel/syscalls/fstatfs.c 		i->sb->fsop->statfs(i->sb, statfsbuf);
sb                 65 kernel/syscalls/mount.c 			if((errno = fs->fsop->remount_fs(&mt->sb, flags))) {
sb                 77 kernel/syscalls/mount.c 		if(flags & MS_RDONLY && !(mt->sb.flags & MS_RDONLY)) {
sb                 84 kernel/syscalls/mount.c 				fs->fsop->release_superblock(&mt->sb);
sb                 91 kernel/syscalls/mount.c 		mt->sb.flags &= ~MS_RDONLY;
sb                 92 kernel/syscalls/mount.c 		mt->sb.flags |= (flags & MS_RDONLY);
sb                185 kernel/syscalls/mount.c 	mt->sb.flags = flags;
sb                187 kernel/syscalls/mount.c 		if((errno = fs->fsop->read_superblock(dev, &mt->sb))) {
sb                214 kernel/syscalls/mount.c 	mt->sb.dir = i_target;
sb                216 kernel/syscalls/mount.c 	i_target->mount_point = mt->sb.root;
sb                 41 kernel/syscalls/newfstat.c 	statbuf->st_blksize = i->sb->s_blocksize;
sb                 44 kernel/syscalls/newfstat.c 		statbuf->st_blocks = (i->i_size / i->sb->s_blocksize * 2);
sb                 47 kernel/syscalls/newlstat.c 	statbuf->st_blksize = i->sb->s_blocksize;
sb                 50 kernel/syscalls/newlstat.c 		statbuf->st_blocks = (i->i_size / i->sb->s_blocksize) * 2;
sb                 47 kernel/syscalls/newstat.c 	statbuf->st_blksize = i->sb->s_blocksize;
sb                 50 kernel/syscalls/newstat.c 		statbuf->st_blocks = (i->i_size / i->sb->s_blocksize) * 2;
sb                 34 kernel/syscalls/pipe.c 	if(!(i = ialloc(&fs->mt->sb, S_IFIFO))) {
sb                 38 kernel/syscalls/statfs.c 	if(i->sb && i->sb->fsop && i->sb->fsop->statfs) {
sb                 39 kernel/syscalls/statfs.c 		i->sb->fsop->statfs(i->sb, statfsbuf);
sb                 28 kernel/syscalls/umount2.c 	struct superblock *sb;
sb                 61 kernel/syscalls/umount2.c 		dev = i_target->sb->dev;
sb                 64 kernel/syscalls/umount2.c 	if(!(sb = get_superblock(dev))) {
sb                 79 kernel/syscalls/umount2.c 	if(check_fs_busy(dev, sb->root)) {
sb                 87 kernel/syscalls/umount2.c 		fs->fsop->release_superblock(sb);
sb                 89 kernel/syscalls/umount2.c 	if(sb->fsop->flags & FSOP_REQUIRES_DEV) {
sb                102 kernel/syscalls/umount2.c 	sb->dir->mount_point = NULL;
sb                103 kernel/syscalls/umount2.c 	iput(sb->root);
sb                104 kernel/syscalls/umount2.c 	iput(sb->dir);
sb                 23 kernel/syscalls/ustat.c 	struct superblock *sb;
sb                 33 kernel/syscalls/ustat.c 	if(!(sb = get_superblock(dev))) {
sb                 36 kernel/syscalls/ustat.c 	if(sb->fsop && sb->fsop->statfs) {
sb                 37 kernel/syscalls/ustat.c 		sb->fsop->statfs(sb, &statfsbuf);
sb                305 mm/page.c      	blksize = i->sb->s_blocksize;