diff options
author | robi <robi> | 2010-08-07 18:33:14 +0000 |
---|---|---|
committer | robi <robi> | 2010-08-07 18:33:14 +0000 |
commit | e7e7cbc6501ba93f184d78e324c7fc5ad533918c (patch) | |
tree | a8d33054b35ea05b86e560d0d1af2caea165c6a1 | |
parent | 1c8b53b70d4d7e910ce619aeea2267195564da27 (diff) |
enable fattr + recover unlinked file
-rwxr-xr-x | configure | 34 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | src/Makefile.in | 4 | ||||
-rw-r--r-- | src/inode.c | 16 | ||||
-rw-r--r-- | src/recover.c | 1 |
5 files changed, 39 insertions, 19 deletions
@@ -903,6 +903,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_debug +enable_file_attr ' ac_precious_vars='build_alias host_alias @@ -1549,6 +1550,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Turn on debugging + --enable-file-attr enable restore of file attribute Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -4361,13 +4363,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4364: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4366: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4367: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4369: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4370: output\"" >&5) + (eval echo "\"\$as_me:4372: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5573,7 +5575,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5576 "configure"' > conftest.$ac_ext + echo '#line 5578 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7426,11 +7428,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7429: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7431: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7433: \$? = $ac_status" >&5 + echo "$as_me:7435: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7765,11 +7767,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7768: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7770: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7772: \$? = $ac_status" >&5 + echo "$as_me:7774: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7870,11 +7872,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7873: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7875: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7877: \$? = $ac_status" >&5 + echo "$as_me:7879: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7925,11 +7927,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7928: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7930: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7932: \$? = $ac_status" >&5 + echo "$as_me:7934: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10725,7 +10727,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10728 "configure" +#line 10730 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10821,7 +10823,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10824 "configure" +#line 10826 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11053,6 +11055,10 @@ if test "${enable_debug+set}" = set; then enableval=$enable_debug; if test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DDEBUG"; fi fi +# Check whether --enable-file-attr was given. +if test "${enable_file_attr+set}" = set; then + enableval=$enable_file_attr; if test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DFILE_ATTR"; fi +fi ac_config_files="$ac_config_files Makefile src/Makefile" diff --git a/configure.in b/configure.in index 4e738fc..2a728ea 100644 --- a/configure.in +++ b/configure.in @@ -8,6 +8,7 @@ AC_PROG_CC AM_PROG_LIBTOOL AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging ], [if test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DDEBUG"; fi]) - +AC_ARG_ENABLE(file-attr,[ --enable-file-attr enable restore of file attribute ], + [if test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DFILE_ATTR"; fi]) AC_OUTPUT(Makefile src/Makefile) diff --git a/src/Makefile.in b/src/Makefile.in index 8df23e3..7391b9f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -240,9 +240,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/src/inode.c b/src/inode.c index 487ca37..d4a14df 100644 --- a/src/inode.c +++ b/src/inode.c @@ -378,8 +378,18 @@ void dump_inode(FILE *out, const char *prefix, else if (LINUX_S_ISSOCK(inode->i_mode)) i_type = "socket"; else i_type = "bad type"; fprintf(out, "%sInode: %u Type: %s ", prefix, inode_num, i_type); - fprintf(out, "%sMode: %04o Flags: 0x%x\n", + fprintf(out, "%sMode: %04o Flags: 0x%x ", prefix, inode->i_mode & 0777, inode->i_flags); +#ifdef FILE_ATTR + if (do_dump_blocks && inode->i_flags) { + fprintf(out,"["); + print_flags(out, inode->i_flags, 0); + fprintf(out,"]\n"); + } + else +#endif + fprintf(out,"\n"); + if (is_large_inode && large_inode->i_extra_isize >= 24) { fprintf(out, "%sGeneration: %u Version: 0x%08x:%08x\n", prefix, inode->i_generation, large_inode->i_version_hi, @@ -607,6 +617,8 @@ r_item* get_last_undel_inode(struct ring_buf* buf){ #ifdef DEBUG printf("UD-Inode %d\n",item->transaction.start); #endif + if(! item->inode->i_links_count) + item->inode->i_links_count = 1 ; return item; } } @@ -636,6 +648,8 @@ r_item* get_last_undel_inode(struct ring_buf* buf){ } // if (item->inode->i_generation != generation) // buf->reuse_flag = 1; + if(! item->inode->i_links_count) + item->inode->i_links_count = 1 ; #ifdef DEBUG printf("UTD-Inode %d\n",item->transaction.start); #endif diff --git a/src/recover.c b/src/recover.c index 8d6e382..daad216 100644 --- a/src/recover.c +++ b/src/recover.c @@ -50,7 +50,6 @@ #define ACL_ERROR 0x01 -//#define FILE_ATTR #ifdef FILE_ATTR #include "e2p/e2p.h" //#FLAGS_MODIFIABLE = EXT2_NOATIME_FL | EXT2_SYNC_FL | EXT2_DIRSYNC_FL | EXT2_APPEND_FL | EXT2_COMPR_FL | EXT2_NODUMP_FL | |