git » libjio » commit b3c5922

Make commit and rollback return ssize_t instead of int. This allows proper large file use by giving the OS the control on how big a transaction can be.

author Alberto Bertogli
2004-08-29 00:22:56 UTC
committer Alberto Bertogli
2007-07-15 13:17:16 UTC
parent c6fe2544f3fe62a9335a1147db5f6684538b0fc9

Make commit and rollback return ssize_t instead of int. This allows proper large file use by giving the OS the control on how big a transaction can be.

Make commit and rollback return ssize_t instead of int.
This allows proper large file use by giving the OS the control on how big a
transaction can be.

libjio.h +2 -2
trans.c +5 -4

diff --git a/libjio.h b/libjio.h
index 24eb536..9e5da7e 100644
--- a/libjio.h
+++ b/libjio.h
@@ -95,8 +95,8 @@ struct disk_operation {
 int jopen(struct jfs *fs, const char *name, int flags, int mode, int jflags);
 void jtrans_init(struct jfs *fs, struct jtrans *ts);
 int jtrans_add(struct jtrans *ts, const void *buf, size_t count, off_t offset);
-int jtrans_commit(struct jtrans *ts);
-int jtrans_rollback(struct jtrans *ts);
+ssize_t jtrans_commit(struct jtrans *ts);
+ssize_t jtrans_rollback(struct jtrans *ts);
 void jtrans_free(struct jtrans *ts);
 int jsync(struct jfs *fs);
 int jclose(struct jfs *fs);
diff --git a/trans.c b/trans.c
index 13d4494..fbbba10 100644
--- a/trans.c
+++ b/trans.c
@@ -180,9 +180,10 @@ int jtrans_add(struct jtrans *ts, const void *buf, size_t count, off_t offset)
 }
 
 /* commit a transaction */
-int jtrans_commit(struct jtrans *ts)
+ssize_t jtrans_commit(struct jtrans *ts)
 {
-	int id, rv, fd = -1;
+	int id, fd = -1;
+	ssize_t rv;
 	uint32_t csum;
 	char *name;
 	unsigned char *buf_init, *bufp;
@@ -422,9 +423,9 @@ exit:
 }
 
 /* rollback a transaction */
-int jtrans_rollback(struct jtrans *ts)
+ssize_t jtrans_rollback(struct jtrans *ts)
 {
-	int rv;
+	ssize_t rv;
 	struct jtrans newts;
 	struct joper *op, *curop, *lop;