ReactOS  0.4.14-dev-342-gdc047f9
Badblock.c
Go to the documentation of this file.
1 /*
2  * PROJECT: Mke2fs
3  * FILE: Badblock.c
4  * PROGRAMMER: Matt Wu <mattwu@163.com>
5  * HOMEPAGE: http://ext2.yeah.net
6  */
7 
8 /* INCLUDES **************************************************************/
9 
10 #include "Mke2fs.h"
11 
12 /* DEFINITIONS ***********************************************************/
13 
14 /* FUNCTIONS *************************************************************/
15 
17  PEXT2_BADBLK_LIST bb_list)
18 {
19  bool retval;
21  LARGE_INTEGER SysTime;
22 
23  NtQuerySystemTime(&SysTime);
24 
26 
27  Ext2Sys->group_desc[0].bg_free_inodes_count--;
28  Ext2Sys->ext2_sb->s_free_inodes_count--;
29 
30  memset(&inode, 0, sizeof(EXT2_INODE));
31  inode.i_mode = (USHORT)((0777 & ~Ext2Sys->umask));
32  inode.i_uid = inode.i_gid = 0;
33  inode.i_blocks = 0;
34  inode.i_block[0] = 0;
35  inode.i_links_count = 2;
38  inode.i_size = 0;
39 
40  retval = ext2_save_inode(Ext2Sys, EXT2_BAD_INO, &inode);
41 
42  return retval;
43 }
bool ext2_save_inode(PEXT2_FILESYS Ext2Sys, ULONG no, PEXT2_INODE pInode)
Definition: Inode.c:59
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
umode_t i_mode
Definition: fs.h:87
__u32 i_atime
Definition: fs.h:81
__u32 i_mtime
Definition: fs.h:83
Definition: fs.h:78
__u32 i_block[15]
Definition: fs.h:86
PEXT2_GROUP_DESC group_desc
Definition: Mke2fs.h:158
gid_t i_gid
Definition: fs.h:89
#define EXT2_BAD_INO
Definition: ext2_fs.h:58
__u64 i_blocks
Definition: fs.h:85
__u32 i_ctime
Definition: fs.h:82
loff_t i_size
Definition: fs.h:80
uid_t i_uid
Definition: fs.h:88
PEXT2_INODE_BITMAP inode_map
Definition: Mke2fs.h:161
bool create_bad_block_inode(PEXT2_FILESYS Ext2Sys, PEXT2_BADBLK_LIST bb_list)
Definition: Badblock.c:16
#define ext2_mark_inode_bitmap
Definition: Mke2fs.h:216
__u32 umask
Definition: Mke2fs.h:170
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:417
#define memset(x, y, z)
Definition: compat.h:39
PEXT2_SUPER_BLOCK ext2_sb
Definition: Mke2fs.h:159