From 77aabfd312d46b1bb28324aea875db40258cd763 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:23:57 -0400 Subject: [PATCH 01/67] Trying something new --- Authorization | 0 Back-end.py | 0 Makefile | 2 +- ReplicationNodeHandler.c | 0 ReplicationNodeHandler.h | 0 p205-decandia.pdf | Bin python_caller.c | 0 python_caller.h | 0 python_caller.o | Bin rpfs.c | 134 ++------------------------------------- rpfs.h | 16 ----- 11 files changed, 5 insertions(+), 147 deletions(-) mode change 100644 => 100755 Authorization mode change 100644 => 100755 Back-end.py mode change 100644 => 100755 Makefile mode change 100644 => 100755 ReplicationNodeHandler.c mode change 100644 => 100755 ReplicationNodeHandler.h mode change 100644 => 100755 p205-decandia.pdf mode change 100644 => 100755 python_caller.c mode change 100644 => 100755 python_caller.h mode change 100644 => 100755 python_caller.o mode change 100644 => 100755 rpfs.c delete mode 100644 rpfs.h diff --git a/Authorization b/Authorization old mode 100644 new mode 100755 diff --git a/Back-end.py b/Back-end.py old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 0cf984a..a4ba469 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: rpfs.c python_caller.c python_caller.h rpfs.h +all: rpfs.c python_caller.c python_caller.h cc python_caller.c rpfs.c -o rpfs -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse -pthread -L/usr/local/lib -lfuse -lssl -lcrypto clean: diff --git a/ReplicationNodeHandler.c b/ReplicationNodeHandler.c old mode 100644 new mode 100755 diff --git a/ReplicationNodeHandler.h b/ReplicationNodeHandler.h old mode 100644 new mode 100755 diff --git a/p205-decandia.pdf b/p205-decandia.pdf old mode 100644 new mode 100755 diff --git a/python_caller.c b/python_caller.c old mode 100644 new mode 100755 diff --git a/python_caller.h b/python_caller.h old mode 100644 new mode 100755 diff --git a/python_caller.o b/python_caller.o old mode 100644 new mode 100755 diff --git a/rpfs.c b/rpfs.c old mode 100644 new mode 100755 index 6a7ef17..9e6f2b2 --- a/rpfs.c +++ b/rpfs.c @@ -7,12 +7,8 @@ #include #include #include -#include #include "uthash.h" #include "python_caller.h" -#include "rpfs.h" - - struct photo { char md5string[MD5_DIGEST_LENGTH*2+1]; @@ -21,10 +17,8 @@ struct photo { }; struct photo* photos = NULL; -static const char *master_path = "/master.node"; -char **nodeListing; -int backupNum; +static const char *master_path = "/master.node"; static int rpfs_getattr(const char *path, struct stat *stbuf) { @@ -51,6 +45,7 @@ static int rpfs_setxattr(const char *path, const char *name, const char *value, return 0; } + static int rpfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { @@ -61,10 +56,6 @@ static int rpfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, filler(buf, ".", NULL, 0); filler(buf, "..", NULL, 0); filler(buf, master_path + 1, NULL, 0); - int i = 0; - for (i; i < backupNum; i++) { - filler(buf, nodeListing[i]+1, NULL, 0); - } return 0; } @@ -87,17 +78,7 @@ static int rpfs_open(const char *path, struct fuse_file_info *fi) static int rpfs_write(const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { - - if(path != master_path && path != "/"){ - int errMsg = 0; - - errMsg = pwrite(fi->fh, buf, size, offset); - if (errMsg < 0) - return -errno; - - return errMsg; - } - + struct timeval tstartFull; struct timeval tstartFullEnd; gettimeofday(&tstartFull,NULL); @@ -155,9 +136,6 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs // get - check hash - python get if (strcmp(instr, "get")==0) { HASH_FIND_STR(photos, md5string, p); - if(!p){ - return -ENOENT; - } get(p->id); } @@ -173,107 +151,6 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs printf("Time spent performing entire operation: %4ld seconds and %d microseconds\n", tstartFullEnd.tv_sec - tstartFull.tv_sec, tstartFullEnd.tv_usec - tstartFull.tv_usec); return size; } -/* michael's shitty code*/ -/** - * Create and open a file - * - * If the file does not exist, first create it with the specified - * mode, and then open it. - * - * If this method is not implemented or under Linux kernel - * versions earlier than 2.6.15, the mknod() and open() methods - * will be called instead. - * - * Introduced in version 2.5 - * - * mode is 0777 | S_IFREG (if regular file) - */ -static int rpfs_create(const char *path, mode_t mode, struct fuse_file_info *fi){ - int fd; - fd = creat(path, mode); - if(fd < 0) - return -errno; - return fd; - -} - -/** Read data from an open file - * - * Read should return exactly the number of bytes requested except - * on EOF or error, otherwise the rest of the data will be - * substituted with zeroes. An exception to this is when the - * 'direct_io' mount option is specified, in which case the return - * value of the read system call will reflect the return value of - * this operation. - * - * Changed in version 2.2 - */ - -static int rpfs_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi){ - int errMsg = 0; - errMsg = pread(fi->fh, buf, size, offset); - if (errMsg < 0) - return -errMsg; - - return errMsg; -} - -static int rpfs_writeBackup(mode_t mode, size_t size,struct fuse_file_info *fi){ - int erMsg; - erMsg = rpfs_checkCrash(fi); - if(erMsg < 0){ - return erMsg; - } - char *metaDataCopy; - rpfs_read(master_path, metaDataCopy, size, 0, fi); - int i = 0; - for (i; i < backupNum; i++) { - rpfs_write(nodeListing[i], metaDataCopy, size, 0, fi); - } - return erMsg; -} - -static int rpfs_checkCrash(struct fuse_file_info *fi){ - int errMsg; - DIR *dp = opendir("/"); - if(dp == NULL){ - return -errno; - } - int index = 0; - while(index < backupNum){ - if(fopen(nodeListing[index], 'w+')!= NULL){ - errMsg = rpfs_create(nodeListing[index], S_IFREG|0777, fi); - - } - } - /* TO DO: - Check err clauses - */ - return errMsg; - -} - -//creates nodes -static int rpfs_init(int backups){ - backupNum=backups; - int i = 0; - for(i; i Date: Sun, 19 Apr 2015 23:36:20 -0400 Subject: [PATCH 02/67] asdfas --- rpfs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rpfs.c b/rpfs.c index 9e6f2b2..89233c8 100755 --- a/rpfs.c +++ b/rpfs.c @@ -20,6 +20,18 @@ struct photo* photos = NULL; static const char *master_path = "/master.node"; +static int createBackup() +{ + char * name = "/tmp/test/backup_"; + for(int i = 0; i < 10; i++) + { + char filename[100]; + sprintf(filename, "%s%d", name, i); + FILE *f = fopen(filename, "w"); + fclose(f); + } +} + static int rpfs_getattr(const char *path, struct stat *stbuf) { int res = 0; @@ -162,5 +174,6 @@ static struct fuse_operations rpfs_oper = { }; int main(int argc, char *argv[]) { + createBackup(); return fuse_main(argc, argv, &rpfs_oper, NULL); } \ No newline at end of file From 2e6b2a483ef95b71fbe11e6d92a7990a7cfbf8a8 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:36:36 -0400 Subject: [PATCH 03/67] asdfas --- rpfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 89233c8..6964ad9 100755 --- a/rpfs.c +++ b/rpfs.c @@ -22,8 +22,9 @@ static const char *master_path = "/master.node"; static int createBackup() { + int i; char * name = "/tmp/test/backup_"; - for(int i = 0; i < 10; i++) + for(i = 0; i < 10; i++) { char filename[100]; sprintf(filename, "%s%d", name, i); From f426ae65ff9df97950049c4c9d0d45a5bf8a8248 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:38:34 -0400 Subject: [PATCH 04/67] asdfasdf --- rpfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpfs.c b/rpfs.c index 6964ad9..bd98680 100755 --- a/rpfs.c +++ b/rpfs.c @@ -19,6 +19,7 @@ struct photo { struct photo* photos = NULL; static const char *master_path = "/master.node"; +bool nodesAlive[10]; static int createBackup() { @@ -30,7 +31,9 @@ static int createBackup() sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "w"); fclose(f); + nodesAlive[i] = true; } + printf("Hello\n"); } static int rpfs_getattr(const char *path, struct stat *stbuf) From 52f664926e298e5eaebaa4c417fff7507f73e229 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:40:13 -0400 Subject: [PATCH 05/67] asdfas --- rpfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index bd98680..3a69485 100755 --- a/rpfs.c +++ b/rpfs.c @@ -31,11 +31,13 @@ static int createBackup() sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "w"); fclose(f); - nodesAlive[i] = true; + nodesAlive[i] = 1; } - printf("Hello\n"); + return 0; } +static + static int rpfs_getattr(const char *path, struct stat *stbuf) { int res = 0; From 2ee49f324c93cc8f4ac9ffdedaa551a2da157b01 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:40:31 -0400 Subject: [PATCH 06/67] asdfas --- rpfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpfs.c b/rpfs.c index 3a69485..a1de2b4 100755 --- a/rpfs.c +++ b/rpfs.c @@ -19,7 +19,7 @@ struct photo { struct photo* photos = NULL; static const char *master_path = "/master.node"; -bool nodesAlive[10]; +int nodesAlive[10]; static int createBackup() { @@ -35,8 +35,7 @@ static int createBackup() } return 0; } - -static + static int rpfs_getattr(const char *path, struct stat *stbuf) { From c7d5336dee51b2ba30f2baa2056c5b09df26b21d Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:45:33 -0400 Subject: [PATCH 07/67] asdfas --- rpfs.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index a1de2b4..ff54265 100755 --- a/rpfs.c +++ b/rpfs.c @@ -35,6 +35,18 @@ static int createBackup() } return 0; } + +static int checkValue() +{ + printf("Checking!\n"); + return 0; +} + +static int putValue() +{ + printf("Putting!\n"); + return 0; +} static int rpfs_getattr(const char *path, struct stat *stbuf) @@ -153,7 +165,10 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs // get - check hash - python get if (strcmp(instr, "get")==0) { HASH_FIND_STR(photos, md5string, p); - get(p->id); + if(p != NULL) + { + get(p->id); + } } // post - hash - if file exist, md5 hash, python From 18c22cdc64afe3577acb21cd3093e1dfc764537a Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:47:27 -0400 Subject: [PATCH 08/67] asdfas --- rpfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpfs.c b/rpfs.c index ff54265..f939479 100755 --- a/rpfs.c +++ b/rpfs.c @@ -167,6 +167,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs HASH_FIND_STR(photos, md5string, p); if(p != NULL) { + checkValue(); get(p->id); } } @@ -177,6 +178,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs memcpy(p->md5string, md5string, strlen(md5string)); //p->md5string = md5string; p->id = put(filename); + putValue(); HASH_ADD_STR(photos, md5string, p); } gettimeofday(&tstartFullEnd, NULL); From f081de427b0866f1b62ef9e6800032d39362bb75 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:48:24 -0400 Subject: [PATCH 09/67] asdfas --- rpfs.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rpfs.c b/rpfs.c index f939479..588c2db 100755 --- a/rpfs.c +++ b/rpfs.c @@ -143,12 +143,6 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs if (strcmp(instr, "get")!=0 && strcmp(instr, "post")!=0) return -ENOENT; - // Check filename path validity, maybe not needed - for (i=0; i Date: Sun, 19 Apr 2015 23:58:01 -0400 Subject: [PATCH 10/67] asdfsa --- rpfs.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 588c2db..084402f 100755 --- a/rpfs.c +++ b/rpfs.c @@ -36,18 +36,44 @@ static int createBackup() return 0; } -static int checkValue() +static int stillAlive() { + int i; + for(i = 0; i < 10; i++) + { + + } +} + +static int checkValue(struct photo * p, ) +{ + stillAlive(); printf("Checking!\n"); return 0; } static int putValue() { + stillAlive(); + removeNode(1); printf("Putting!\n"); return 0; } - + +static int removeNode(int i) +{ + char * name = "/tmp/test/backup_"; + char filename[100]; + sprintf(filename, "%s%d", name, i); + remove(filename); + nodesAlive[i] = 0; + +} + +static int addNode(int i) +{ + +} static int rpfs_getattr(const char *path, struct stat *stbuf) { From 3a70721a5da6dab8c0715e6411c7694068ff7124 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:59:02 -0400 Subject: [PATCH 11/67] asdfas --- rpfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 084402f..9346874 100755 --- a/rpfs.c +++ b/rpfs.c @@ -65,7 +65,8 @@ static int removeNode(int i) char * name = "/tmp/test/backup_"; char filename[100]; sprintf(filename, "%s%d", name, i); - remove(filename); + int retVal = remove(filename); + printf("RetVAL! %d\n", retVal); nodesAlive[i] = 0; } From f6832d3f253f85f23fb38e4fa8a608cdf0d31425 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:59:37 -0400 Subject: [PATCH 12/67] asdfas --- rpfs.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rpfs.c b/rpfs.c index 9346874..446e4b3 100755 --- a/rpfs.c +++ b/rpfs.c @@ -45,21 +45,6 @@ static int stillAlive() } } -static int checkValue(struct photo * p, ) -{ - stillAlive(); - printf("Checking!\n"); - return 0; -} - -static int putValue() -{ - stillAlive(); - removeNode(1); - printf("Putting!\n"); - return 0; -} - static int removeNode(int i) { char * name = "/tmp/test/backup_"; @@ -76,6 +61,21 @@ static int addNode(int i) } +static int checkValue(struct photo * p, ) +{ + stillAlive(); + printf("Checking!\n"); + return 0; +} + +static int putValue() +{ + stillAlive(); + removeNode(1); + printf("Putting!\n"); + return 0; +} + static int rpfs_getattr(const char *path, struct stat *stbuf) { int res = 0; From 079dfc790dfc174b77a62de353995c1ef0832536 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 19 Apr 2015 23:59:58 -0400 Subject: [PATCH 13/67] asdfsa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 446e4b3..831235f 100755 --- a/rpfs.c +++ b/rpfs.c @@ -61,7 +61,7 @@ static int addNode(int i) } -static int checkValue(struct photo * p, ) +static int checkValue(struct photo * p) { stillAlive(); printf("Checking!\n"); From 53c7a970c6d0ded79537a2f64516673eed1700e6 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:00:19 -0400 Subject: [PATCH 14/67] asdfas --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 831235f..2a62710 100755 --- a/rpfs.c +++ b/rpfs.c @@ -188,7 +188,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs HASH_FIND_STR(photos, md5string, p); if(p != NULL) { - checkValue(); + checkValue(p); get(p->id); } } From 175e010be65859ec48e8a8a31b99d36a96366a14 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:02:09 -0400 Subject: [PATCH 15/67] asdfas --- rpfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 2a62710..78cfa51 100755 --- a/rpfs.c +++ b/rpfs.c @@ -24,7 +24,7 @@ int nodesAlive[10]; static int createBackup() { int i; - char * name = "/tmp/test/backup_"; + char * name = "/tmp/backup/backup_"; for(i = 0; i < 10; i++) { char filename[100]; @@ -47,7 +47,7 @@ static int stillAlive() static int removeNode(int i) { - char * name = "/tmp/test/backup_"; + char * name = "/tmp/backup/backup_"; char filename[100]; sprintf(filename, "%s%d", name, i); int retVal = remove(filename); From de4894067d72792efc284867cf5ec86fb853e027 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:17:44 -0400 Subject: [PATCH 16/67] asdfas --- rpfs.c | 104 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 82 insertions(+), 22 deletions(-) diff --git a/rpfs.c b/rpfs.c index 78cfa51..d4b05e2 100755 --- a/rpfs.c +++ b/rpfs.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "uthash.h" #include "python_caller.h" @@ -17,6 +18,7 @@ struct photo { }; struct photo* photos = NULL; +struct photo* photosNodes = NULL; static const char *master_path = "/master.node"; int nodesAlive[10]; @@ -36,42 +38,91 @@ static int createBackup() return 0; } -static int stillAlive() -{ - int i; - for(i = 0; i < 10; i++) +int copy_file(char *old_filename, char *new_filename) { + FILE *ptr_old, *ptr_new; + errno_t err = 0, err1 = 0; + int a; - } -} + err = fopen_s(&ptr_old, old_filename, "rb"); + err1 = fopen_s(&ptr_new, new_filename, "wb"); -static int removeNode(int i) -{ - char * name = "/tmp/backup/backup_"; - char filename[100]; - sprintf(filename, "%s%d", name, i); - int retVal = remove(filename); - printf("RetVAL! %d\n", retVal); - nodesAlive[i] = 0; + if(err != 0) + return -1; -} + if(err1 != 0) + { + fclose(ptr_old); + return -1; + } -static int addNode(int i) -{ + while(1) + { + a = fgetc(ptr_old); + + if(!feof(ptr_old)) + fputc(a, ptr_new); + else + break; + } + fclose(ptr_new); + fclose(ptr_old); + return 0; + } + +static int stillAlive() +{ + int i; + char * name = "/tmp/backup/backup_"; + for(i = 0; i < 10; i++) + { + char filename[100]; + sprintf(filename, "%s%d", name, i); + if(access(filename,F_OK) == 0) + { + if(nodesAlive[i] == 0) + { + char filename2[100]; + sprintf(filename2, "%s%d", name, i - 1); + remove(filename); + copy_file(filename2,filename); + } + nodesAlive[i] = 1; + }else + { + nodesAlive[i] = 0; + } + } } static int checkValue(struct photo * p) { stillAlive(); - printf("Checking!\n"); - return 0; + int i; + int agree = 0; + int disagree = 0; + char * name = "/tmp/backup/backup_"; + for(i = 0; i < 10; i++) + { + char filename[100]; + sprintf(filename, "%s%d", name, i); + + } + if(agree >= disagree) + { + return 0; + } + else + { + return -1; + } + } static int putValue() { stillAlive(); - removeNode(1); printf("Putting!\n"); return 0; } @@ -188,8 +239,17 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs HASH_FIND_STR(photos, md5string, p); if(p != NULL) { - checkValue(p); - get(p->id); + if(checkValue(p) == 0) + { + get(p->id); + }else + { + printf("File does not exist!\n"); + } + } + else + { + printf("File does not exist!\n"); } } From 507ae0aada6c1393f6825494ff501b910b985aaa Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:18:33 -0400 Subject: [PATCH 17/67] asdfas --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index d4b05e2..77016d8 100755 --- a/rpfs.c +++ b/rpfs.c @@ -41,7 +41,7 @@ static int createBackup() int copy_file(char *old_filename, char *new_filename) { FILE *ptr_old, *ptr_new; - errno_t err = 0, err1 = 0; + int err = 0, err1 = 0; int a; err = fopen_s(&ptr_old, old_filename, "rb"); From f206e701c85eb72e4096c2a810b241e2d867831a Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:19:21 -0400 Subject: [PATCH 18/67] asdfa --- rpfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpfs.c b/rpfs.c index 77016d8..e077b86 100755 --- a/rpfs.c +++ b/rpfs.c @@ -44,13 +44,13 @@ int copy_file(char *old_filename, char *new_filename) int err = 0, err1 = 0; int a; - err = fopen_s(&ptr_old, old_filename, "rb"); - err1 = fopen_s(&ptr_new, new_filename, "wb"); + ptr_old = fopen(old_filename, "rb"); + ptr_new = fopen_s(new_filename, "wb"); - if(err != 0) + if(ptr_old == 0) return -1; - if(err1 != 0) + if(ptr_new == 0) { fclose(ptr_old); return -1; From b318b35e30464bda2725d9dae6a58763e49936e9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:19:38 -0400 Subject: [PATCH 19/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index e077b86..e6aecfd 100755 --- a/rpfs.c +++ b/rpfs.c @@ -45,7 +45,7 @@ int copy_file(char *old_filename, char *new_filename) int a; ptr_old = fopen(old_filename, "rb"); - ptr_new = fopen_s(new_filename, "wb"); + ptr_new = fopen(new_filename, "wb"); if(ptr_old == 0) return -1; From 17caecc1b6b90e998a6e4ac08aba6d9ffec2c213 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:28:12 -0400 Subject: [PATCH 20/67] asdfas --- rpfs.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/rpfs.c b/rpfs.c index e6aecfd..785203d 100755 --- a/rpfs.c +++ b/rpfs.c @@ -38,7 +38,7 @@ static int createBackup() return 0; } -int copy_file(char *old_filename, char *new_filename) +static int copy_file(char *old_filename, char *new_filename) { FILE *ptr_old, *ptr_new; int err = 0, err1 = 0; @@ -99,15 +99,38 @@ static int stillAlive() static int checkValue(struct photo * p) { stillAlive(); - int i; + int i,j; + long sz = 0; int agree = 0; int disagree = 0; char * name = "/tmp/backup/backup_"; for(i = 0; i < 10; i++) { - char filename[100]; - sprintf(filename, "%s%d", name, i); - + if(nodesAlive[i]) + { + char filename[100]; + sprintf(filename, "%s%d", name, i); + FILE *f = fopen(filename, "w"); + fseek(fp, 0L, SEEK_END); + sz = ftell(fp); + fseek(fp, 0L, SEEK_SET); + photosNodes = malloc(sz); + int agreed = 0; + for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) + { + if(p->id == photosNodes[i]->id) + { + agree++; + agreed = 1; + } + } + if(!agreed) + { + disagree++; + } + free(photosNodes); + fclose(f); + } } if(agree >= disagree) { @@ -123,7 +146,6 @@ static int checkValue(struct photo * p) static int putValue() { stillAlive(); - printf("Putting!\n"); return 0; } From 7106115778fd137faa32c60df6ddcc5686f5afea Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:28:39 -0400 Subject: [PATCH 21/67] asdfsa --- rpfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpfs.c b/rpfs.c index 785203d..0c6e59b 100755 --- a/rpfs.c +++ b/rpfs.c @@ -111,14 +111,14 @@ static int checkValue(struct photo * p) char filename[100]; sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "w"); - fseek(fp, 0L, SEEK_END); - sz = ftell(fp); - fseek(fp, 0L, SEEK_SET); + fseek(f, 0L, SEEK_END); + sz = ftell(f); + fseek(f, 0L, SEEK_SET); photosNodes = malloc(sz); int agreed = 0; for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { - if(p->id == photosNodes[i]->id) + if(p->id == photosNodes[i].id) { agree++; agreed = 1; From 7be9fcc7efee7e0d496aa105d78ad881d1889ecf Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:35:47 -0400 Subject: [PATCH 22/67] asdfas --- rpfs.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/rpfs.c b/rpfs.c index 0c6e59b..8933b26 100755 --- a/rpfs.c +++ b/rpfs.c @@ -17,8 +17,14 @@ struct photo { UT_hash_handle hh; }; +struct photoBackup +{ + char md5string[MD5_DIGEST_LENGTH*2+1]; + unsigned long long id; +}; + struct photo* photos = NULL; -struct photo* photosNodes = NULL; +struct photoBackup* photosNodes = NULL; static const char *master_path = "/master.node"; int nodesAlive[10]; @@ -110,7 +116,7 @@ static int checkValue(struct photo * p) { char filename[100]; sprintf(filename, "%s%d", name, i); - FILE *f = fopen(filename, "w"); + FILE *f = fopen(filename, "wb"); fseek(f, 0L, SEEK_END); sz = ftell(f); fseek(f, 0L, SEEK_SET); @@ -143,9 +149,25 @@ static int checkValue(struct photo * p) } -static int putValue() +static int putValue(struct photo *p) { stillAlive(); + int i; + long sz = 0; + int agree = 0; + int disagree = 0; + char * name = "/tmp/backup/backup_"; + for(i = 0; i < 10; i++) + { + if(nodesAlive[i]) + { + char filename[100]; + sprintf(filename, "%s%d", name, i); + FILE *f = fopen(filename, "a"); + fprintf(f, "%s%llu", p->md5string, p->id); + fclose(f); + } + } return 0; } From 2eb5782163b4cc35e1ba3771b7d599e643f0786e Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:36:15 -0400 Subject: [PATCH 23/67] asdfas --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 8933b26..5cfaa36 100755 --- a/rpfs.c +++ b/rpfs.c @@ -303,7 +303,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs memcpy(p->md5string, md5string, strlen(md5string)); //p->md5string = md5string; p->id = put(filename); - putValue(); + putValue(p); HASH_ADD_STR(photos, md5string, p); } gettimeofday(&tstartFullEnd, NULL); From f61b20b53052d2a047dfeed60fc54ad90011cb19 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:39:39 -0400 Subject: [PATCH 24/67] asdfas --- rpfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 5cfaa36..9b9f0c6 100755 --- a/rpfs.c +++ b/rpfs.c @@ -114,6 +114,7 @@ static int checkValue(struct photo * p) { if(nodesAlive[i]) { + printf("Here\n"); char filename[100]; sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "wb"); @@ -122,10 +123,12 @@ static int checkValue(struct photo * p) fseek(f, 0L, SEEK_SET); photosNodes = malloc(sz); int agreed = 0; + printf("%d\n",sz); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { if(p->id == photosNodes[i].id) { + printf("Agree!\n"); agree++; agreed = 1; } @@ -288,7 +291,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs get(p->id); }else { - printf("File does not exist!\n"); + printf("Nodes did not agree!\n"); } } else From e81267edd0bf01e5a85fbd500d5544878d38e6e9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:41:11 -0400 Subject: [PATCH 25/67] asdfas --- rpfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpfs.c b/rpfs.c index 9b9f0c6..2a39d0e 100755 --- a/rpfs.c +++ b/rpfs.c @@ -124,8 +124,10 @@ static int checkValue(struct photo * p) photosNodes = malloc(sz); int agreed = 0; printf("%d\n",sz); + printf("%llu\n",p->id); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { + printf("%llu\n", photosNodes.id); if(p->id == photosNodes[i].id) { printf("Agree!\n"); From e1981276e3edb729277db00efa20b5384746c2e9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:41:58 -0400 Subject: [PATCH 26/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 2a39d0e..f18532c 100755 --- a/rpfs.c +++ b/rpfs.c @@ -127,7 +127,7 @@ static int checkValue(struct photo * p) printf("%llu\n",p->id); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { - printf("%llu\n", photosNodes.id); + printf("%llu\n", photosNodes[i].id); if(p->id == photosNodes[i].id) { printf("Agree!\n"); From b1f40550b405ae17015c90156a9e94504ad3a352 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:45:29 -0400 Subject: [PATCH 27/67] asdfas --- rpfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index f18532c..74a7732 100755 --- a/rpfs.c +++ b/rpfs.c @@ -89,6 +89,7 @@ static int stillAlive() { if(nodesAlive[i] == 0) { + printf("Erasing!\n"); char filename2[100]; sprintf(filename2, "%s%d", name, i - 1); remove(filename); @@ -117,7 +118,7 @@ static int checkValue(struct photo * p) printf("Here\n"); char filename[100]; sprintf(filename, "%s%d", name, i); - FILE *f = fopen(filename, "wb"); + FILE *f = fopen(filename, "rb+"); fseek(f, 0L, SEEK_END); sz = ftell(f); fseek(f, 0L, SEEK_SET); From ff170a26b6ecac94c869d844fe28575975a9f2de Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:46:39 -0400 Subject: [PATCH 28/67] asdfas --- rpfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 74a7732..7b9fd88 100755 --- a/rpfs.c +++ b/rpfs.c @@ -124,8 +124,9 @@ static int checkValue(struct photo * p) fseek(f, 0L, SEEK_SET); photosNodes = malloc(sz); int agreed = 0; - printf("%d\n",sz); + printf("%d\n",sz/sizeof(photoBackup)); printf("%llu\n",p->id); + printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[i]); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { printf("%llu\n", photosNodes[i].id); From 790cd6b983e1893a3dd329a802e9cfd558cbc611 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:47:14 -0400 Subject: [PATCH 29/67] asdfas --- rpfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 7b9fd88..0c30399 100755 --- a/rpfs.c +++ b/rpfs.c @@ -124,9 +124,9 @@ static int checkValue(struct photo * p) fseek(f, 0L, SEEK_SET); photosNodes = malloc(sz); int agreed = 0; - printf("%d\n",sz/sizeof(photoBackup)); + printf("%d\n",sz/sizeof(struct photoBackup)); printf("%llu\n",p->id); - printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[i]); + printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0]); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { printf("%llu\n", photosNodes[i].id); From d9f2c7e6c3c7412146b6de4c816ad5e9ef15e7a2 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:47:47 -0400 Subject: [PATCH 30/67] asdfsa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 0c30399..3c9024d 100755 --- a/rpfs.c +++ b/rpfs.c @@ -126,7 +126,7 @@ static int checkValue(struct photo * p) int agreed = 0; printf("%d\n",sz/sizeof(struct photoBackup)); printf("%llu\n",p->id); - printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0]); + printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { printf("%llu\n", photosNodes[i].id); From 3ca70d8131c5af32135e8be8c24ca1c51e515b24 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:49:06 -0400 Subject: [PATCH 31/67] asdfa --- rpfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpfs.c b/rpfs.c index 3c9024d..a262195 100755 --- a/rpfs.c +++ b/rpfs.c @@ -124,6 +124,7 @@ static int checkValue(struct photo * p) fseek(f, 0L, SEEK_SET); photosNodes = malloc(sz); int agreed = 0; + printf("%d\n", sizeof(photosNodes[i])); printf("%d\n",sz/sizeof(struct photoBackup)); printf("%llu\n",p->id); printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); From a8364777a242809cc2500c518cd15e0cb6ebf473 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:52:05 -0400 Subject: [PATCH 32/67] asdfa --- rpfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index a262195..0aeb5aa 100755 --- a/rpfs.c +++ b/rpfs.c @@ -19,7 +19,6 @@ struct photo { struct photoBackup { - char md5string[MD5_DIGEST_LENGTH*2+1]; unsigned long long id; }; @@ -172,7 +171,7 @@ static int putValue(struct photo *p) char filename[100]; sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "a"); - fprintf(f, "%s%llu", p->md5string, p->id); + fprintf(f, "%llu",p->id); fclose(f); } } From e9a03fbaae99b0ee86b42baa7d2bf849a500ebcb Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:56:25 -0400 Subject: [PATCH 33/67] asdfa --- rpfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rpfs.c b/rpfs.c index 0aeb5aa..6bde322 100755 --- a/rpfs.c +++ b/rpfs.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "uthash.h" #include "python_caller.h" @@ -123,10 +124,7 @@ static int checkValue(struct photo * p) fseek(f, 0L, SEEK_SET); photosNodes = malloc(sz); int agreed = 0; - printf("%d\n", sizeof(photosNodes[i])); - printf("%d\n",sz/sizeof(struct photoBackup)); - printf("%llu\n",p->id); - printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); + fread(photosNodes, sizeof(photosNodes[i]), sizeof(photosNodes)/sizeof(photosNodes[i]),f); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) { printf("%llu\n", photosNodes[i].id); @@ -171,6 +169,7 @@ static int putValue(struct photo *p) char filename[100]; sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "a"); + fwrite(&(p->id),sizeof(p->id), 1, f); fprintf(f, "%llu",p->id); fclose(f); } From 2efa857fd4499f211f51a1616d9610ffb88150a1 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 00:58:40 -0400 Subject: [PATCH 34/67] asdfa --- rpfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 6bde322..d273bff 100755 --- a/rpfs.c +++ b/rpfs.c @@ -115,7 +115,6 @@ static int checkValue(struct photo * p) { if(nodesAlive[i]) { - printf("Here\n"); char filename[100]; sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "rb+"); @@ -133,6 +132,7 @@ static int checkValue(struct photo * p) printf("Agree!\n"); agree++; agreed = 1; + break; } } if(!agreed) @@ -170,7 +170,6 @@ static int putValue(struct photo *p) sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "a"); fwrite(&(p->id),sizeof(p->id), 1, f); - fprintf(f, "%llu",p->id); fclose(f); } } From e066b74c73269e68844b596bc5ef70ee02c99bb7 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:01:54 -0400 Subject: [PATCH 35/67] asdaf --- rpfs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpfs.c b/rpfs.c index d273bff..38e34d1 100755 --- a/rpfs.c +++ b/rpfs.c @@ -24,7 +24,6 @@ struct photoBackup }; struct photo* photos = NULL; -struct photoBackup* photosNodes = NULL; static const char *master_path = "/master.node"; int nodesAlive[10]; @@ -107,7 +106,6 @@ static int checkValue(struct photo * p) { stillAlive(); int i,j; - long sz = 0; int agree = 0; int disagree = 0; char * name = "/tmp/backup/backup_"; @@ -119,9 +117,9 @@ static int checkValue(struct photo * p) sprintf(filename, "%s%d", name, i); FILE *f = fopen(filename, "rb+"); fseek(f, 0L, SEEK_END); - sz = ftell(f); + long sz = ftell(f); fseek(f, 0L, SEEK_SET); - photosNodes = malloc(sz); + struct photoBackup* photosNodes = malloc(sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[i]), sizeof(photosNodes)/sizeof(photosNodes[i]),f); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) From d4face231c52c7941928e872b9ac4a2c9063179e Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:03:33 -0400 Subject: [PATCH 36/67] asda --- rpfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpfs.c b/rpfs.c index 38e34d1..727932e 100755 --- a/rpfs.c +++ b/rpfs.c @@ -115,6 +115,7 @@ static int checkValue(struct photo * p) { char filename[100]; sprintf(filename, "%s%d", name, i); + printf("%s\n",filename); FILE *f = fopen(filename, "rb+"); fseek(f, 0L, SEEK_END); long sz = ftell(f); From 7c6fa43fc9a26a11a3f098fa3c46d2a273accb61 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:06:19 -0400 Subject: [PATCH 37/67] asdfasasd --- rpfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 727932e..b7d4a8b 100755 --- a/rpfs.c +++ b/rpfs.c @@ -122,8 +122,8 @@ static int checkValue(struct photo * p) fseek(f, 0L, SEEK_SET); struct photoBackup* photosNodes = malloc(sz); int agreed = 0; - fread(photosNodes, sizeof(photosNodes[i]), sizeof(photosNodes)/sizeof(photosNodes[i]),f); - for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[i]); j++) + fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); + for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { printf("%llu\n", photosNodes[i].id); if(p->id == photosNodes[i].id) From ed0b02adec049468bcc3246a05043a3a886521a4 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:08:09 -0400 Subject: [PATCH 38/67] asdf --- rpfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpfs.c b/rpfs.c index b7d4a8b..2aaadbb 100755 --- a/rpfs.c +++ b/rpfs.c @@ -121,6 +121,8 @@ static int checkValue(struct photo * p) long sz = ftell(f); fseek(f, 0L, SEEK_SET); struct photoBackup* photosNodes = malloc(sz); + printf("%d\n",sz); + printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) From 860102d7dc6a009fdc26568bccbb60a58bd26d2f Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:10:31 -0400 Subject: [PATCH 39/67] asdfa --- rpfs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rpfs.c b/rpfs.c index 2aaadbb..c10940d 100755 --- a/rpfs.c +++ b/rpfs.c @@ -115,20 +115,16 @@ static int checkValue(struct photo * p) { char filename[100]; sprintf(filename, "%s%d", name, i); - printf("%s\n",filename); FILE *f = fopen(filename, "rb+"); fseek(f, 0L, SEEK_END); long sz = ftell(f); fseek(f, 0L, SEEK_SET); struct photoBackup* photosNodes = malloc(sz); - printf("%d\n",sz); - printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { - printf("%llu\n", photosNodes[i].id); - if(p->id == photosNodes[i].id) + if(p->id == photosNodes[j].id) { printf("Agree!\n"); agree++; From 27334440b255e4caf3b7815422a9a604d5e97f9c Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:11:08 -0400 Subject: [PATCH 40/67] Final Commit --- rpfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index c10940d..2675518 100755 --- a/rpfs.c +++ b/rpfs.c @@ -126,7 +126,6 @@ static int checkValue(struct photo * p) { if(p->id == photosNodes[j].id) { - printf("Agree!\n"); agree++; agreed = 1; break; From 404ea25564e9f0739cb158103052e91215047f54 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:32:56 -0400 Subject: [PATCH 41/67] asdfa --- rpfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpfs.c b/rpfs.c index 2675518..81be018 100755 --- a/rpfs.c +++ b/rpfs.c @@ -120,6 +120,7 @@ static int checkValue(struct photo * p) long sz = ftell(f); fseek(f, 0L, SEEK_SET); struct photoBackup* photosNodes = malloc(sz); + printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) From 31cc6236ab4ebec0f904589b2cb5f29c7e865d8c Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:38:07 -0400 Subject: [PATCH 42/67] asdf --- rpfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpfs.c b/rpfs.c index 81be018..f6dce08 100755 --- a/rpfs.c +++ b/rpfs.c @@ -125,6 +125,7 @@ static int checkValue(struct photo * p) fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { + printf("%llu\n", photosNodes[j].id); if(p->id == photosNodes[j].id) { agree++; From 8d8287c2211a1384b2070dddcc2862620f5655f4 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:39:12 -0400 Subject: [PATCH 43/67] asdfa --- rpfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpfs.c b/rpfs.c index f6dce08..4d774bc 100755 --- a/rpfs.c +++ b/rpfs.c @@ -123,6 +123,7 @@ static int checkValue(struct photo * p) printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); + printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { printf("%llu\n", photosNodes[j].id); From c0d8b919bc65140250434ddf9700d72f38b28090 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:40:14 -0400 Subject: [PATCH 44/67] asdfsa --- rpfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpfs.c b/rpfs.c index 4d774bc..90c0658 100755 --- a/rpfs.c +++ b/rpfs.c @@ -123,6 +123,8 @@ static int checkValue(struct photo * p) printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); + printf("%d\n", sizeof(photosNodes[0])); + printf("%d\n", sizeof(photoBackup)); printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { From fe22858ae9dd16c5e9b9323240af5ceea2484209 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:42:29 -0400 Subject: [PATCH 45/67] asdf --- rpfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rpfs.c b/rpfs.c index 90c0658..e35980f 100755 --- a/rpfs.c +++ b/rpfs.c @@ -123,9 +123,7 @@ static int checkValue(struct photo * p) printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); - printf("%d\n", sizeof(photosNodes[0])); - printf("%d\n", sizeof(photoBackup)); - printf("%d\n",sizeof(photosNodes)/sizeof(photosNodes[0])); + printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(photoBackup), sizeof(photosNodes)/sizeof(photosNodes[0])); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { printf("%llu\n", photosNodes[j].id); From 6d7d9ec4ea14db164b1c687facf8b6c4c2aa8603 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:42:46 -0400 Subject: [PATCH 46/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index e35980f..14c12d7 100755 --- a/rpfs.c +++ b/rpfs.c @@ -123,7 +123,7 @@ static int checkValue(struct photo * p) printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); - printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(photoBackup), sizeof(photosNodes)/sizeof(photosNodes[0])); + printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(struct photoBackup), sizeof(photosNodes)/sizeof(photosNodes[0])); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { printf("%llu\n", photosNodes[j].id); From 8b88783b1df104da0bd32bf6b11588d3ec557767 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:44:22 -0400 Subject: [PATCH 47/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 14c12d7..c1bc994 100755 --- a/rpfs.c +++ b/rpfs.c @@ -123,7 +123,7 @@ static int checkValue(struct photo * p) printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); - printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(struct photoBackup), sizeof(photosNodes)/sizeof(photosNodes[0])); + printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(struct photoBackup), sz/sizeof(photosNodes[0])); for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) { printf("%llu\n", photosNodes[j].id); From 7e37fa33c5c134c95638d8bcd870365b557eddda Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:45:02 -0400 Subject: [PATCH 48/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index c1bc994..a80b00e 100755 --- a/rpfs.c +++ b/rpfs.c @@ -124,7 +124,7 @@ static int checkValue(struct photo * p) int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(struct photoBackup), sz/sizeof(photosNodes[0])); - for(j = 0; j < sizeof(photosNodes)/sizeof(photosNodes[0]); j++) + for(j = 0; j < sz/sizeof(photosNodes[0]); j++) { printf("%llu\n", photosNodes[j].id); if(p->id == photosNodes[j].id) From a02fa0555f825dbd5ab8dda1a14cc9d88e436be2 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:47:07 -0400 Subject: [PATCH 49/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index a80b00e..f02e5eb 100755 --- a/rpfs.c +++ b/rpfs.c @@ -122,7 +122,7 @@ static int checkValue(struct photo * p) struct photoBackup* photosNodes = malloc(sz); printf("%d\n",sz); int agreed = 0; - fread(photosNodes, sizeof(photosNodes[0]), sizeof(photosNodes)/sizeof(photosNodes[0]),f); + fread(photosNodes, sizeof(photosNodes[0]), sz/sizeof(photosNodes[0]),f); printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(struct photoBackup), sz/sizeof(photosNodes[0])); for(j = 0; j < sz/sizeof(photosNodes[0]); j++) { From c29616fc8a0fdad59e425db0473281747ffeaf10 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 01:47:55 -0400 Subject: [PATCH 50/67] asdfa --- rpfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/rpfs.c b/rpfs.c index f02e5eb..f26de3b 100755 --- a/rpfs.c +++ b/rpfs.c @@ -120,13 +120,10 @@ static int checkValue(struct photo * p) long sz = ftell(f); fseek(f, 0L, SEEK_SET); struct photoBackup* photosNodes = malloc(sz); - printf("%d\n",sz); int agreed = 0; fread(photosNodes, sizeof(photosNodes[0]), sz/sizeof(photosNodes[0]),f); - printf("%d%d%d\n", sizeof(photosNodes[0]), sizeof(struct photoBackup), sz/sizeof(photosNodes[0])); for(j = 0; j < sz/sizeof(photosNodes[0]); j++) { - printf("%llu\n", photosNodes[j].id); if(p->id == photosNodes[j].id) { agree++; From fe74b7e9076b317ca9ee3aa56ae5ac5fa2112b5b Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 02:02:31 -0400 Subject: [PATCH 51/67] asdfas --- rpfs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index f26de3b..33f6234 100755 --- a/rpfs.c +++ b/rpfs.c @@ -89,8 +89,18 @@ static int stillAlive() if(nodesAlive[i] == 0) { printf("Erasing!\n"); + int otherIndex = 0; + int j; + for(j = 0; j < 10; j++) + { + if(nodesAlive[j] == 1) + { + otherIndex = j; + break; + } + } char filename2[100]; - sprintf(filename2, "%s%d", name, i - 1); + sprintf(filename2, "%s%d", name, otherIndex); remove(filename); copy_file(filename2,filename); } From 73baff2ab0b9818ef5b89f6d0ad22ca5b43bb43a Mon Sep 17 00:00:00 2001 From: Xiang Xu Date: Mon, 20 Apr 2015 02:21:39 -0400 Subject: [PATCH 52/67] bash --- test.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test.sh diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..b720313 --- /dev/null +++ b/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +destdir=/tmp/test.txt + +for i in `seq 1 10`; +do + echo "$i.jpg" >> "$destdir" +done + From 227b40ef4266d55df7c9b399860032ffaf24dcdf Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 02:22:50 -0400 Subject: [PATCH 53/67] asdfas --- test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index b720313..f72cd5f 100644 --- a/test.sh +++ b/test.sh @@ -1,9 +1,9 @@ #!/bin/bash -destdir=/tmp/test.txt +destdir=/tmp/test/master.node for i in `seq 1 10`; do - echo "$i.jpg" >> "$destdir" + echo "post test.JPG" >> "$destdir" done From d304279e083743522a411ce1f37a5dd531ffcd53 Mon Sep 17 00:00:00 2001 From: Xiang Xu Date: Mon, 20 Apr 2015 02:28:31 -0400 Subject: [PATCH 54/67] photos --- Archive.zip | Bin 0 -> 358012 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Archive.zip diff --git a/Archive.zip b/Archive.zip new file mode 100644 index 0000000000000000000000000000000000000000..873b10fb770391cadea180d9030b63068c37b12f GIT binary patch literal 358012 zcmeI*2{hGf`#13IWS-izMKq99Dl!jgFqdR1B$6_d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a)x-Z$KETZ}w3uYR6yqo}csWR# zw7q)xPo+nM7=`IljH5)0QlrrJ>ft{X4{2f)rb{u7!X-nELffl{ALXS2F$&YA7)S9_ mqDEo5MKb Date: Mon, 20 Apr 2015 02:56:56 -0400 Subject: [PATCH 55/67] asdfa --- rpfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 33f6234..7e596ab 100755 --- a/rpfs.c +++ b/rpfs.c @@ -264,11 +264,16 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs } char* instr = malloc(index); - char* filename = malloc(strlen(buf)-index-1); + char* filename = malloc(strlen(buf)-index); memcpy(instr, buf, index); memcpy(filename, &buf[index+1], strlen(buf)-index); - + i = 0; + while(filename[i] != ' ') + { + i++; + } + filename[i] = '\0'; printf("%s\n", instr); printf("%s\n", filename); From 39328b9b2d49d2d9eb713ff1a42e704672abc1ff Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 02:57:53 -0400 Subject: [PATCH 56/67] asdfas --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 7e596ab..9055f1e 100755 --- a/rpfs.c +++ b/rpfs.c @@ -264,7 +264,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs } char* instr = malloc(index); - char* filename = malloc(strlen(buf)-index); + char* filename = malloc(strlen(buf)-index - 1); memcpy(instr, buf, index); memcpy(filename, &buf[index+1], strlen(buf)-index); From 406dc753697ca9aa8f220986dbf83cc674c0a29d Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 02:58:41 -0400 Subject: [PATCH 57/67] asdfsa --- rpfs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/rpfs.c b/rpfs.c index 9055f1e..33f6234 100755 --- a/rpfs.c +++ b/rpfs.c @@ -264,16 +264,11 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs } char* instr = malloc(index); - char* filename = malloc(strlen(buf)-index - 1); + char* filename = malloc(strlen(buf)-index-1); memcpy(instr, buf, index); memcpy(filename, &buf[index+1], strlen(buf)-index); - i = 0; - while(filename[i] != ' ') - { - i++; - } - filename[i] = '\0'; + printf("%s\n", instr); printf("%s\n", filename); From 43f5fe51b883cabad0e4e75ef2787fbf6c0806a9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:00:03 -0400 Subject: [PATCH 58/67] asdfas --- rpfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpfs.c b/rpfs.c index 33f6234..52b7dc6 100755 --- a/rpfs.c +++ b/rpfs.c @@ -268,6 +268,12 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs memcpy(instr, buf, index); memcpy(filename, &buf[index+1], strlen(buf)-index); + i = 0; + while(filename[i] != ' ' || filename[i] != '\0') + { + i++; + } + filename[i] = '\0'; printf("%s\n", instr); printf("%s\n", filename); From 7a5e110421f2f4798e021201a0b1e3155428689d Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:00:54 -0400 Subject: [PATCH 59/67] asdfsa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 52b7dc6..5b26d8b 100755 --- a/rpfs.c +++ b/rpfs.c @@ -269,7 +269,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs memcpy(instr, buf, index); memcpy(filename, &buf[index+1], strlen(buf)-index); i = 0; - while(filename[i] != ' ' || filename[i] != '\0') + while(instr[i] != ' ' || instr[i] != '\0') { i++; } From 4469caa23111cb6ef2a395d736f217ac4760f518 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:01:42 -0400 Subject: [PATCH 60/67] asdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index 5b26d8b..189599b 100755 --- a/rpfs.c +++ b/rpfs.c @@ -273,7 +273,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs { i++; } - filename[i] = '\0'; + instr[i] = '\0'; printf("%s\n", instr); printf("%s\n", filename); From ca6e8aa2df7cd887166a349fa3ed18ba23b4edb0 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:04:10 -0400 Subject: [PATCH 61/67] asdfas --- rpfs.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rpfs.c b/rpfs.c index 189599b..64b8034 100755 --- a/rpfs.c +++ b/rpfs.c @@ -267,13 +267,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs char* filename = malloc(strlen(buf)-index-1); memcpy(instr, buf, index); - memcpy(filename, &buf[index+1], strlen(buf)-index); - i = 0; - while(instr[i] != ' ' || instr[i] != '\0') - { - i++; - } - instr[i] = '\0'; + memcpy(filename, &buf[index+1], strlen(buf)-index-1); printf("%s\n", instr); printf("%s\n", filename); From 82fab1ce07be90332afec10dfe9220d5079d1d5e Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:08:19 -0400 Subject: [PATCH 62/67] asdfa --- rpfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 64b8034..649a4e0 100755 --- a/rpfs.c +++ b/rpfs.c @@ -263,12 +263,13 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs } } - char* instr = malloc(index); - char* filename = malloc(strlen(buf)-index-1); + char* instr = malloc(index + 1); + char* filename = malloc(strlen(buf)-index); memcpy(instr, buf, index); memcpy(filename, &buf[index+1], strlen(buf)-index-1); + instr[index] = '\0'; printf("%s\n", instr); printf("%s\n", filename); From 57fd1d99afd32698c47c61753371ec48be599780 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:17:04 -0400 Subject: [PATCH 63/67] asdfas --- rpfs.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rpfs.c b/rpfs.c index 649a4e0..a7c86df 100755 --- a/rpfs.c +++ b/rpfs.c @@ -263,13 +263,25 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs } } + int index2 = 0; + for(i = index + 1; i < size; i++) + { + if(buf[i]==' ') + { + index2 = i + 1; + break; + } + index2 = i; + } + char* instr = malloc(index + 1); - char* filename = malloc(strlen(buf)-index); + char* filename = malloc(index2 - index + 1); memcpy(instr, buf, index); - memcpy(filename, &buf[index+1], strlen(buf)-index-1); + memcpy(filename, &buf[index+1], index2 - index + 1); instr[index] = '\0'; + filename[index2 - index] = '\0'; printf("%s\n", instr); printf("%s\n", filename); From 143eba36b0a58aff219372124496b0ff3818013a Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:19:26 -0400 Subject: [PATCH 64/67] asdfa --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index f72cd5f..6090ec9 100644 --- a/test.sh +++ b/test.sh @@ -2,7 +2,7 @@ destdir=/tmp/test/master.node -for i in `seq 1 10`; +for i in `seq 1 100`; do echo "post test.JPG" >> "$destdir" done From 36466cef0773b699251a693ef523b0a134606431 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:19:37 -0400 Subject: [PATCH 65/67] asdfa --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 6090ec9..ab78904 100644 --- a/test.sh +++ b/test.sh @@ -4,6 +4,6 @@ destdir=/tmp/test/master.node for i in `seq 1 100`; do - echo "post test.JPG" >> "$destdir" + echo "post i.jpg" >> "$destdir" done From 047676f038d7544f9f676758c0624d712f4c1015 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 20 Apr 2015 03:20:46 -0400 Subject: [PATCH 66/67] asdfa --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index ab78904..f489bc1 100644 --- a/test.sh +++ b/test.sh @@ -4,6 +4,6 @@ destdir=/tmp/test/master.node for i in `seq 1 100`; do - echo "post i.jpg" >> "$destdir" + echo "post $i.jpg" >> "$destdir" done From 818b03989b2ba1562dfcc9415879b5b27dc066c2 Mon Sep 17 00:00:00 2001 From: Anthony Date: Tue, 21 Apr 2015 13:46:10 -0400 Subject: [PATCH 67/67] aasdfa --- rpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpfs.c b/rpfs.c index a7c86df..90dbe29 100755 --- a/rpfs.c +++ b/rpfs.c @@ -281,7 +281,7 @@ static int rpfs_write(const char *path, const char *buf, size_t size, off_t offs memcpy(filename, &buf[index+1], index2 - index + 1); instr[index] = '\0'; - filename[index2 - index] = '\0'; + filename[index2 - index - 1] = '\0'; printf("%s\n", instr); printf("%s\n", filename);