git » libjio » commit c6fe254

The constants are broken, increidbly things work for most things today by pure luck. They are in this state because at some point (way in the past) jfs and jtrans flags were independant, but this has not been the case for a long time.

author Alberto Bertogli
2004-08-29 00:22:55 UTC
committer Alberto Bertogli
2007-07-15 13:17:16 UTC
parent 867ea331265304c55edd26307f6703e90b2cd851

The constants are broken, increidbly things work for most things today by pure luck. They are in this state because at some point (way in the past) jfs and jtrans flags were independant, but this has not been the case for a long time.

The constants are broken, increidbly things work for most things today by pure
luck. They are in this state because at some point (way in the past) jfs and
jtrans flags were independant, but this has not been the case for a long time.

The patch unifies the constants and puts sane numbers to them.

Thanks to Shehjar Tikoo who noticed this and send a patch.

libjio.h +5 -7

diff --git a/libjio.h b/libjio.h
index e4b7f4a..24eb536 100644
--- a/libjio.h
+++ b/libjio.h
@@ -132,15 +132,13 @@ void frewind(struct jfs *stream);
 FILE *jfsopen(struct jfs *stream, const char *mode);
 
 
-/* jfs constants */
+/* jfs and jtrans constants */
 #define J_NOLOCK	1	/* don't lock the file before operating on it */
 #define J_NOROLLBACK	2	/* no need to read rollback information */
-#define J_LINGER	3	/* use lingering transactions */
-
-/* jtrans constants */
-#define J_COMMITED	1	/* mark a transaction as commited */
-#define J_ROLLBACKED	2	/* mark a transaction as rollbacked */
-#define J_ROLLBACKING	4	/* mark a transaction as rollbacking */
+#define J_LINGER	4	/* use lingering transactions */
+#define J_COMMITED	8	/* mark a transaction as commited */
+#define J_ROLLBACKED	16	/* mark a transaction as rollbacked */
+#define J_ROLLBACKING	32	/* mark a transaction as rollbacking */
 
 /* disk constants */
 #define J_DISKHEADSIZE	 12	/* length of disk_header */