summaryrefslogtreecommitdiff
path: root/src/journal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal.h')
-rw-r--r--src/journal.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/journal.h b/src/journal.h
new file mode 100644
index 0000000..34ada1a
--- /dev/null
+++ b/src/journal.h
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Roberto Maar *
+ * robi@users.berlios.de *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef JOURNAL_H
+#define JOURNAL_H
+
+
+//struct for cache the descriptor data
+typedef struct journal_descriptor_tag_s
+{
+ blk64_t f_blocknr; /* Tho od-disk block number */
+ __u32 j_blocknr; /* The on-journal block number */
+ __u32 transaction; /* Transaction Sequence*/
+} journal_descriptor_tag_t;
+
+
+void dump_journal_superblock( void); //print journal superblock
+extern int journal_open(char* , int );// open an extract the blocklist from journal
+extern int journal_close(void); // close the journal (last function in main() if the journal open)
+static int init_journal(void); // main for extract the journal to the local private data
+static const char *type_to_name(int);
+int get_block_list_count(blk64_t block);//get count of journal blocklist
+int get_block_list(journal_descriptor_tag_t *, blk64_t, int);//get a sortet list of all copys of a filesystemblock
+int read_journal_block(off_t, char*, int, unsigned int*);
+void print_block_list(int);
+int dump_journal_block( __u32 , int );
+void print_block_transaction(blk64_t,int);//print all transactions for a fs-block
+__u32 get_journal_blocknr(blk64_t, __u32);// get the last dir-block for transaction from journal or if not found the real block
+
+
+#endif \ No newline at end of file