]>
Commit | Line | Data |
---|---|---|
1011375f PS |
1 | |
2 | dirops.c | 10 +++++++--- | |
3 | find_inodes.c | 1 + | |
4 | salvage_dir_inodes.c | 18 ++---------------- | |
5 | user_interface.c | 1 + | |
6 | write_inodes.c | 1 + | |
7 | 5 files changed, 12 insertions(+), 19 deletions(-) | |
8 | ||
9 | --- e2salvage-0.0.8a/src/dirops.c.orig 2003-10-07 22:49:36.000000000 +0200 | |
10 | +++ e2salvage-0.0.8a/src/dirops.c 2005-06-15 21:39:52.000000000 +0200 | |
11 | @@ -20,13 +20,13 @@ | |
12 | ||
13 | myreclen = EXT2_DIR_REC_LEN(strlen(name)); | |
14 | ||
15 | - for (dirent = (struct ext2_dir_entry_2 *)block; (void *)dirent < ((void *)block)+blocksize; ((void *)dirent) += dirent->rec_len) { | |
16 | + for (dirent = (struct ext2_dir_entry_2 *)block; (void *)dirent < ((void *)block) + blocksize; dirent = (void*)dirent + dirent->rec_len) { | |
17 | if (dirent->rec_len - dirent->name_len >= myreclen) { | |
18 | orig_rec_len = dirent->rec_len; | |
19 | dirent->rec_len = EXT2_DIR_REC_LEN(dirent->name_len); | |
20 | orig_rec_len -= dirent->rec_len; | |
21 | ||
22 | - ((void *)dirent) += dirent->rec_len; | |
23 | + dirent = (void*)dirent + dirent->rec_len; | |
24 | ||
25 | dirent->inode = inum; | |
26 | dirent->rec_len = orig_rec_len; | |
27 | @@ -42,7 +42,11 @@ | |
28 | int dirent_del(char * block, __u32 inum, __u32 lost_found_ino) | |
29 | { | |
30 | struct ext2_dir_entry_2 * dirent, * ldirent; | |
31 | - for (ldirent = NULL, dirent = (struct ext2_dir_entry_2 *)block; (void *)dirent < ((void *)block)+blocksize; ldirent = dirent, ((void *)dirent) += dirent->rec_len) | |
32 | + for (ldirent = NULL, | |
33 | + dirent = (struct ext2_dir_entry_2 *)block; | |
34 | + (void *)dirent < ((void *)block)+blocksize; | |
35 | + ldirent = dirent, | |
36 | + dirent = (void*)dirent + dirent->rec_len) | |
37 | if (dirent->inode == inum) { | |
38 | if (!ldirent) { | |
39 | fprintf(stderr, "Internal error 32762:6448\n"); | |
40 | --- e2salvage-0.0.8a/src/find_inodes.c.orig 2003-10-07 22:49:37.000000000 +0200 | |
41 | +++ e2salvage-0.0.8a/src/find_inodes.c 2005-06-15 21:40:34.000000000 +0200 | |
42 | @@ -4,6 +4,7 @@ | |
43 | #include <sys/stat.h> | |
44 | #include <sys/time.h> | |
45 | #include <fcntl.h> | |
46 | +#include <string.h> | |
47 | #include <unistd.h> | |
48 | ||
49 | #include "main.h" | |
50 | --- e2salvage-0.0.8a/src/salvage_dir_inodes.c.orig 2003-10-07 22:49:37.000000000 +0200 | |
51 | +++ e2salvage-0.0.8a/src/salvage_dir_inodes.c 2005-06-15 21:42:33.000000000 +0200 | |
52 | @@ -6,6 +6,7 @@ | |
53 | #include <sys/stat.h> | |
54 | #include <unistd.h> | |
55 | #include <fcntl.h> | |
56 | +#include <string.h> | |
57 | #include <time.h> | |
58 | #include <linux/ext2_fs.h> | |
59 | ||
60 | @@ -48,21 +49,6 @@ | |
61 | return(p); | |
62 | } | |
63 | ||
64 | -static int invalid_inode_block( __u32 block ) | |
65 | -{ struct mem_inode_s *p; | |
66 | - for(p=mem_inodes;p!=NULL;p=p->next) | |
67 | - if( p->block==block ) | |
68 | - { p->to_block=0; | |
69 | - p->inode_nr=0; | |
70 | - p->need_to_write=1; | |
71 | - if(p->ok) | |
72 | - { fprintf(stderr,"!!!!!!!!!!\n"); | |
73 | - p->ok=0; | |
74 | - } | |
75 | - } | |
76 | - return(1); | |
77 | -} | |
78 | - | |
79 | static int set_inode_number_block( struct mem_inode_s *ib, __u32 num ) | |
80 | { struct mem_inode_s *p; | |
81 | __u32 inum,block; | |
82 | @@ -102,7 +88,7 @@ | |
83 | ||
84 | static int fix_two_inode_bloks( struct mem_inode_s *ib, struct mem_inode_s *in ) | |
85 | { struct mem_inode_s *p; | |
86 | - int i,ofs[128],nofs=0; | |
87 | + int ofs[128], nofs=0; | |
88 | __u32 inum; | |
89 | if( ib->block_offset!=in->block_offset ) | |
90 | { set_inode_number_block(ib,in->inode_nr); | |
91 | --- e2salvage-0.0.8a/src/user_interface.c.orig 2003-10-07 22:49:37.000000000 +0200 | |
92 | +++ e2salvage-0.0.8a/src/user_interface.c 2005-06-15 21:41:22.000000000 +0200 | |
93 | @@ -4,6 +4,7 @@ | |
94 | #include <sys/stat.h> | |
95 | #include <sys/time.h> | |
96 | #include <fcntl.h> | |
97 | +#include <string.h> | |
98 | #include <unistd.h> | |
99 | ||
100 | #include "disk.h" | |
101 | --- e2salvage-0.0.8a/src/write_inodes.c.orig 2003-10-07 22:49:37.000000000 +0200 | |
102 | +++ e2salvage-0.0.8a/src/write_inodes.c 2005-06-15 21:41:38.000000000 +0200 | |
103 | @@ -4,6 +4,7 @@ | |
104 | #include <sys/stat.h> | |
105 | #include <sys/time.h> | |
106 | #include <fcntl.h> | |
107 | +#include <string.h> | |
108 | #include <unistd.h> | |
109 | ||
110 | #include "main.h" |