ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Badblock.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:          Mke2fs
00003  * FILE:             Badblock.c
00004  * PROGRAMMER:       Matt Wu <mattwu@163.com>
00005  * HOMEPAGE:         http://ext2.yeah.net
00006  */
00007 
00008 /* INCLUDES **************************************************************/
00009 
00010 #include "Mke2fs.h"
00011 
00012 /* DEFINITIONS ***********************************************************/
00013 
00014 /* FUNCTIONS *************************************************************/
00015 
00016 bool create_bad_block_inode( PEXT2_FILESYS Ext2Sys,
00017                              PEXT2_BADBLK_LIST bb_list)
00018 {
00019     bool            retval;
00020     EXT2_INODE      inode;
00021     LARGE_INTEGER   SysTime;
00022     
00023     NtQuerySystemTime(&SysTime);
00024 
00025     ext2_mark_inode_bitmap(Ext2Sys->inode_map, EXT2_BAD_INO);
00026 
00027     Ext2Sys->group_desc[0].bg_free_inodes_count--;
00028     Ext2Sys->ext2_sb->s_free_inodes_count--;
00029 
00030     memset(&inode, 0, sizeof(EXT2_INODE));
00031     inode.i_mode = (USHORT)((0777 & ~Ext2Sys->umask));
00032     inode.i_uid = inode.i_gid = 0;
00033     inode.i_blocks = 0;
00034     inode.i_block[0] = 0;
00035     inode.i_links_count = 2;
00036     RtlTimeToSecondsSince1970(&SysTime, &inode.i_mtime);
00037     inode.i_ctime = inode.i_atime = inode.i_mtime;
00038     inode.i_size = 0;
00039 
00040     retval = ext2_save_inode(Ext2Sys, EXT2_BAD_INO, &inode);
00041 
00042     return retval;
00043 }

Generated on Mon May 28 2012 04:36:04 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.