Index
Sekrety super pamięci (2)
5 (2)
Eisenbert Judaizm
ÂŚwięty terror
McIntyre Vonda Opiekun snu
kometa (6)
www nie com pl 1
Bettelheim Bruno Cudowne i pożyteczne O znaczeniach i wartoÂściach baÂśni (9)
Cornwell Patricia Post Mortem
rozdzial 29 (21)
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • souvenir.htw.pl

  • [ Pobierz całość w formacie PDF ]
    .\n",kdevname(dev));goto failed_mount;}if (sb->s_blocksize != bh->b_size) {if (!silent)printk ("VFS: Unsupported blocksize on dev ""%s.\n", kdevname(dev));goto failed_mount;}if (sb->s_blocksize != sb->u.ext2_sb.s_frag_size) {printk ("EXT2-fs: fragsize %lu != blocksize %lu (not supported yet)\n",sb->u.ext2_sb.s_frag_size, sb->s_blocksize);goto failed_mount;}if (sb->u.ext2_sb.s_blocks_per_group > sb->s_blocksize * 8) {printk ("EXT2-fs: #blocks per group too big: %lu\n",sb->u.ext2_sb.s_blocks_per_group);goto failed_mount;}if (sb->u.ext2_sb.s_frags_per_group > sb->s_blocksize * 8) {printk ("EXT2-fs: #fragments per group too big: %lu\n",sb->u.ext2_sb.s_frags_per_group);goto failed_mount;}if (sb->u.ext2_sb.s_inodes_per_group > sb->s_blocksize * 8) {printk ("EXT2-fs: #inodes per group too big: %lu\n",sb->u.ext2_sb.s_inodes_per_group);goto failed_mount;}sb->u.ext2_sb.s_groups_count = (es->s_blocks_count -es->s_first_data_block +EXT2_BLOCKS_PER_GROUP(sb) - 1) /EXT2_BLOCKS_PER_GROUP(sb);db_count = (sb->u.ext2_sb.s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) /EXT2_DESC_PER_BLOCK(sb);sb->u.ext2_sb.s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL);if (sb->u.ext2_sb.s_group_desc == NULL) {printk ("EXT2-fs: not enough memory\n");goto failed_mount;}for (i = 0; i < db_count; i++) {sb->u.ext2_sb.s_group_desc[i] = bread (dev, logic_sb_block + i + 1,sb->s_blocksize);if (!sb->u.ext2_sb.s_group_desc[i]) {for (j = 0; j < i; j++)brelse (sb->u.ext2_sb.s_group_desc[j]);kfree_s (sb->u.ext2_sb.s_group_desc,db_count * sizeof (struct buffer_head *));printk ("EXT2-fs: unable to read group descriptors\n");goto failed_mount;}}if (!ext2_check_descriptors (sb)) {for (j = 0; j < db_count; j++)brelse (sb->u.ext2_sb.s_group_desc[j]);kfree_s (sb->u.ext2_sb.s_group_desc,db_count * sizeof (struct buffer_head *));printk ("EXT2-fs: group descriptors corrupted !\n");goto failed_mount;}for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) {sb->u.ext2_sb.s_inode_bitmap_number[i] = 0;sb->u.ext2_sb.s_inode_bitmap[i] = NULL;sb->u.ext2_sb.s_block_bitmap_number[i] = 0;sb->u.ext2_sb.s_block_bitmap[i] = NULL;}sb->u.ext2_sb.s_loaded_inode_bitmaps = 0;sb->u.ext2_sb.s_loaded_block_bitmaps = 0;sb->u.ext2_sb.s_db_per_group = db_count;unlock_super (sb);/** set up enough so that it can read an inode*/sb->s_dev = dev;sb->s_op = &ext2_sops;if (!(sb->s_mounted = iget (sb, EXT2_ROOT_INO))) {sb->s_dev = 0;for (i = 0; i < db_count; i++)if (sb->u.ext2_sb.s_group_desc[i])brelse (sb->u.ext2_sb.s_group_desc[i]);kfree_s (sb->u.ext2_sb.s_group_desc,db_count * sizeof (struct buffer_head *));brelse (bh);printk ("EXT2-fs: get root inode failed\n");MOD_DEC_USE_COUNT;return NULL;}ext2_setup_super (sb, es);return sb;}static void ext2_commit_super (struct super_block * sb,struct ext2_super_block * es){es->s_wtime = CURRENT_TIME;mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1);sb->s_dirt = 0;}/** In the second extended file system, it is not necessary to* write the super block since we use a mapping of the* disk super block in a buffer.** However, this function is still used to set the fs valid* flags to 0.We need to set this flag to 0 since the fs* may have been checked while mounted and e2fsck may have* set s_state to EXT2_VALID_FS after some corrections.*/void ext2_write_super (struct super_block * sb){struct ext2_super_block * es;if (!(sb->s_flags & MS_RDONLY)) {es = sb->u.ext2_sb.s_es;ext2_debug ("setting valid to 0\n");if (es->s_state & EXT2_VALID_FS) {es->s_state &= ~EXT2_VALID_FS;es->s_mtime = CURRENT_TIME;}ext2_commit_super (sb, es);}sb->s_dirt = 0;}int ext2_remount (struct super_block * sb, int * flags, char * data){struct ext2_super_block * es;unsigned short resuid = sb->u.ext2_sb.s_resuid;unsigned short resgid = sb->u.ext2_sb.s_resgid;unsigned long new_mount_opt;unsigned long tmp;/** Allow the "check" option to be passed as a remount option.*/new_mount_opt = EXT2_MOUNT_CHECK_NORMAL;if (!parse_options (data, &tmp, &resuid, &resgid,&new_mount_opt))return -EINVAL;sb->u.ext2_sb.s_mount_opt = new_mount_opt;sb->u.ext2_sb.s_resuid = resuid;sb->u.ext2_sb.s_resgid = resgid;es = sb->u.ext2_sb.s_es;if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))return 0;if (*flags & MS_RDONLY) {if (es->s_state & EXT2_VALID_FS ||!(sb->u.ext2_sb.s_mount_state & EXT2_VALID_FS))return 0;/** OK, we are remounting a valid rw partition rdonly, so set* the rdonly flag and then mark the partition as valid again.*/es->s_state = sb->u.ext2_sb.s_mount_state;es->s_mtime = CURRENT_TIME;mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1);sb->s_dirt = 1;ext2_commit_super (sb, es);}else {/** Mounting a RDONLY partition read-write, so reread and* store the current valid flag.(It may have been changed* by e2fsck since we originally mounted the partition.)*/sb->u.ext2_sb.s_mount_state = es->s_state;sb->s_flags &= ~MS_RDONLY;ext2_setup_super (sb, es);}return 0;}static struct file_system_type ext2_fs_type = {ext2_read_super, "ext2", 1, NULL};int init_ext2_fs(void){return register_filesystem(&ext2_fs_type);}#ifdef MODULEint init_module(void){int status;if ((status = init_ext2_fs()) == 0)register_symtab(0);return status;}void cleanup_module(void){unregister_filesystem(&ext2_fs_type);}#endifvoid ext2_statfs (struct super_block * sb, struct statfs * buf, int bufsiz){unsigned long overhead;unsigned long overhead_per_group;struct statfs tmp;if (test_opt (sb, MINIX_DF))overhead = 0;else {/** Compute the overhead (FS structures)*/overhead_per_group = 1 /* super block */ +sb->u.ext2_sb.s_db_per_group /* descriptors */ +1 /* block bitmap */ +1 /* inode bitmap */ +sb->u.ext2_sb.s_itb_per_group /* inode table */;overhead = sb->u.ext2_sb.s_es->s_first_data_block +sb->u.ext2_sb.s_groups_count * overhead_per_group;}tmp.f_type = EXT2_SUPER_MAGIC;tmp.f_bsize = sb->s_blocksize;tmp.f_blocks = sb->u.ext2_sb.s_es->s_blocks_count - overhead;tmp.f_bfree = ext2_count_free_blocks (sb);tmp.f_bavail = tmp.f_bfree - sb->u.ext2_sb.s_es->s_r_blocks_count;if (tmp.f_bfree < sb->u.ext2_sb.s_es->s_r_blocks_count)tmp.f_bavail = 0;tmp.f_files = sb->u.ext2_sb.s_es->s_inodes_count;tmp.f_ffree = ext2_count_free_inodes (sb);tmp.f_namelen = EXT2_NAME_LEN;memcpy_tofs(buf, &tmp, bufsiz);} [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • aceton.keep.pl
  • 
    Wszelkie Prawa Zastrzeżone! Kawa była słaba i bez smaku. Nie miała treści, a jedynie formę. Design by SZABLONY.maniak.pl.